File

src/ui/form/smart-layout-fragment.service.ts

Description

Form-scoped engine for the dynamic layout fragment slots introduced in SCLNG-1677. Owns the runtime merge/unmerge of a fragment's data sources and databound-control expectations into/out of the parent Smart Form, and keeps the parent toolbars consistent across slot swaps. The visual rendering is owned by the SmartDynamicLayoutSlotComponent host.

Index

Properties
Methods

Methods

clearFragment
clearFragment(slotId: string)

Clears the content of the named slot.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
Returns : void
isFragmentLoaded
isFragmentLoaded(slotId: string, source: string | SmartFormConfiguration | SmartFormLayoutFragment)

Returns whether the given source is currently loaded in a slot.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
source string | SmartFormConfiguration | SmartFormLayoutFragment No
  • The fragment URL or layout object.
Returns : boolean
Async loadFragment
loadFragment(slotId: string, source: string | SmartFormConfiguration | SmartFormLayoutFragment, options?: SmartLayoutFragmentLoadOptions)

Loads a layout fragment into the named slot. This is the public API the parent form (and its logic classes) call to drive a slot.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
source string | SmartFormConfiguration | SmartFormLayoutFragment No
  • The fragment URL or layout object.
options SmartLayoutFragmentLoadOptions Yes
  • Optional startup behavior for this fragment load.
Returns : Promise<boolean>
mergeFragmentDataSources
mergeFragmentDataSources(slotId: string, fragment: SmartFormConfiguration | SmartFormLayoutFragment, host: ISmartLayoutFragmentSlotHost)

Merges a fragment's data sources into the parent form runtime and feeds the fragment's expected databound controls. Called by the slot host before the fragment controls render.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
fragment SmartFormConfiguration | SmartFormLayoutFragment No
  • The processed fragment layout.
host ISmartLayoutFragmentSlotHost No
  • The slot host.
Returns : boolean
registerSlot
registerSlot(slotId: string, host: ISmartLayoutFragmentSlotHost)

Registers a slot host so the form can drive it by slot id.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
host ISmartLayoutFragmentSlotHost No
  • The slot host instance.
Returns : void
releaseSlot
releaseSlot(slotId: string, host?: ISmartLayoutFragmentSlotHost)

Releases a previously registered slot host and removes any remaining fragment expectations it contributed.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
host ISmartLayoutFragmentSlotHost Yes
  • The releasing host; ignored if it no longer owns the slot.
Returns : void
slotOwnsDataSource
slotOwnsDataSource(slotId: string, dataSourceName: string)

Returns whether the currently loaded fragment in the slot owns the given data source.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
dataSourceName string No
  • The data source instance name.
Returns : boolean
unmergeFragmentDataSources
unmergeFragmentDataSources(slotId: string, host: ISmartLayoutFragmentSlotHost)

Unmerges a slot's data sources and databound-control expectations from the parent form runtime and revalidates the toolbars' active TableIO targets.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
host ISmartLayoutFragmentSlotHost No
  • The slot host.
Returns : void

Properties

Readonly slotCleared$
Type : unknown
Default value : this.slotClearedSubject.asObservable()
Readonly slotReleased$
Type : unknown
Default value : this.slotReleasedSubject.asObservable()

results matching ""

    No results matching ""