Member Junction
    Preparing search index...

    Class BaseFormPanel<TRecord>Abstract

    Abstract base for every dynamically-injectable form panel.

    Subclasses are standalone Angular components decorated with @RegisterClass(BaseFormPanel, { metadata: { entity, slot, sortKey? } }). At runtime, <mj-form-panel-slot> discovers matching registrations via ClassFactory.GetAllRegistrationsByMetadata, instantiates each via ViewContainerRef.createComponent, and wires Record + FormComponent + FormContext into the inputs.

    Lifecycle hooks: standard Angular ngOnInit / ngOnDestroy work as usual. Record is guaranteed to be set before the first change-detection pass.

    Optional Validate() returns a validation result, or a Promise of one. BaseFormComponent.SaveRecord() awaits every mounted panel's result and refuses the save when one fails. Panels that don't validate anything beyond what the record itself does can leave this method off.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    FormComponent: BaseFormComponent

    The host form component (use for EditMode, dirty notifications, etc). Set by the slot host.

    FormContext?: FormContext

    Optional form context — same shape the collapsible-panel chrome expects. Set by the slot host.

    HostDisplay: "contents" = 'contents'

    Slot-mounted hosts must not sit in the left-nav flex column — leftover height targets mj-collapsible-panel as a direct child of .mj-forms-all-panels. display: contents makes the inner panel that child.

    Record: TRecord

    The entity record being edited. Set by the slot host before view init.

    RegistrationMetadata?: FormPanelRegistrationMetadata

    The registration this panel was mounted from. Set by the slot host.

    A panel reads its own slot from here, which is the only way it can know where in the form it was asked to sit: the class registration is looked up by the host, not by the panel, so nothing else on the instance carries it.

    SlotElement: HTMLElement | null = null

    The slot element the panel was mounted in, set by the slot host. It is where the panel is on the page, which DisplayOrder reads its neighbours from.

    Accessors

    • get DisplayOrder(): number

      Flex order for the panel's own mj-collapsible-panel, to pass as [Order].

      A panel's section key is not in the form's section order, so without this the form falls back to the section count and draws every panel at the bottom whatever slot it asked for. A panel standing in for a section takes that section's place instead, so replacing something does not also move it.

      A slot between the form's blocks takes the order of the section beside it on the page, so the panel draws where the slot is (see SlotAnchorSectionKey). The very top and the very bottom keep fixed bands: the bottom has to stay below the More folder.

      Returns number

    Methods