Member Junction
    Preparing search index...

    Presentation-agnostic host that renders ANY MemberJunction entity form — generated (@RegisterClass / CodeGen), custom (*Extended), or interactive (EntityFormOverride) — for a given record.

    This is the shared core extracted from Explorer's SingleRecordComponent. It encapsulates the full lifecycle: resolve which form to use (via FormResolverService, honoring variant overrides) → load the record (or accept a pre-loaded one) → create the form component dynamically → bind record / EditMode / Config / variants → re-emit the form's events → tear down cleanly.

    It has ZERO routing and ZERO Explorer dependencies — it only emits events. The surrounding surface (a full-page tab in Explorer, a dialog, or a slide-in) decides what to do with Navigate, Notification, etc.

    <mj-entity-form-host [EntityName]="entityName" [PrimaryKey]="pk"
    (Navigate)="handleNavigation($event)" (Saved)="onSaved($event)">
    </mj-entity-form-host>
    <mj-entity-form-host [Record]="myEntity" [Config]="DIALOG_FORM_CONFIG"></mj-entity-form-host>
    

    Standard-form switch. When a custom form (a higher-priority class form or an interactive override) hides the CodeGen-generated form, the host renders a one-line strip above it offering "Open standard form" — every field, same permissions — and back. It lives here rather than in <mj-form-toolbar> because a fully custom form may not render the toolbar at all, which would leave the generated form unreachable. Surfaces drive/persist the choice via FormMode / FormModeChange; hosts that must not offer it set ShowFormModeSwitch to false.

    Hierarchy (View Summary)

    Implements

    • AfterViewInit
    • OnDestroy
    Index

    Constructors

    Properties

    AskAIRequested: EventEmitter<void> = ...

    Emitted when the user clicks the "Ask AI" button on the form toolbar.

    Config: EntityFormConfig | null = null

    Per-instance form presentation config (toolbar, sections, width, links).

    Dismissed: EventEmitter<void> = ...

    Form asked to be dismissed (e.g. Discard on a brand-new record).

    EditModeChanged: EventEmitter<boolean> = ...

    Re-emitted form EditModeChanged (true = edit started, false = ended), plus one true right after mount when the form was created already in edit mode (StartInEditMode, or a new record) — StartEditMode never runs in that path, so without this the shell would never hear about it.

    errorDetail: string | null = null
    ErrorTitle: string | null = null
    FormCreated: EventEmitter<BaseFormComponent> = ...

    The live form instance, emitted right after it's created (for power-user wiring).

    FormModeChange: EventEmitter<EntityFormMode> = ...

    The user switched between the custom and the standard form (so the surface can persist it, e.g. in the URL).

    HasStandardFormAlternative: boolean = false

    True when a custom form is hiding the standard (CodeGen) form — so the switch strip has somewhere to go. Stays true while the standard form is the one mounted, so the strip can offer the way back.

    LoadComplete: EventEmitter<void> = ...

    Initial load + mount finished (success path).

    LoadError: EventEmitter<{ detail: string; title: string }> = ...

    Load failed; carries a user-facing title + detail.

    Loading: boolean = true
    Navigate: EventEmitter<FormNavigationEvent> = ...

    Form navigation request (record link, new record, hierarchy, email, external, dismiss).

    NewRecordValues: string | Record<string, unknown> | null = null

    New-record default values: URL-segment string or a plain object.

    Notification: EventEmitter<FormNotificationEvent> = ...

    User-facing notification request (success/error/warning/info).

    Provider: IMetadataProvider | null

    If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.

    RecordDeleted: EventEmitter<RecordDeletedEvent> = ...

    Re-emitted form RecordDeleted.

    RecordReady: EventEmitter<BaseEntity<unknown>> = ...

    Re-emitted form RecordReady (record fully initialized).

    RecordRefreshed: EventEmitter<BaseEntity<unknown>> = ...

    Re-emitted form RecordRefreshed.

    RecordSaved: EventEmitter<RecordSavedEvent> = ...

    Re-emitted form RecordSaved (richer payload).

    RecordSaveFailed: EventEmitter<RecordSaveFailedEvent> = ...

    Re-emitted form RecordSaveFailed.

    Saved: EventEmitter<BaseEntity<unknown>> = ...

    Emitted after the record is successfully saved (carries the live entity).

    SectionName: string | null = null

    Render a single registered form section (a BaseFormSectionComponent registered as '<EntityName>.<SectionName>') instead of the full form. When set, the full-form resolver / variant picker / toolbar container are bypassed — the section component renders its own fields and the host saves the record directly. Used for compact, focused editors (e.g. a quick-edit grid row). Leave null for the normal full-form behavior.

    ShowFormModeSwitch: boolean = true

    Offer the standard-form strip when a custom form hides the generated one. Set false to suppress it.

    ValidationFailed: EventEmitter<ValidationFailedEvent> = ...

    Re-emitted form ValidationFailed.

    "ɵdir": unknown
    "ɵfac": ɵɵFactoryDeclaration<BaseAngularComponent, never>

    Accessors

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    Methods

    • Save the bound record. In full-form mode this runs the form's save pipeline (validation, pending records, notifications); in section mode the section component has no pipeline, so we save the record directly (the record's own save event still drives the Saved output).

      Returns Promise<boolean>

    • Switch between the custom ('default') and the standard form. Refuses — returning false and emitting a warning Notification — when remounting would silently discard unsaved work (see hasUnsavedWorkToLose). A brand-new record is carried across instead (see _carryNewRecord). With a form mounted but no standard alternative (the generated form is the only one), both modes mount the same form: the mode is recorded and emitted, with no reload and so nothing for the unsaved-work guard to protect. The error state is excluded: fail() also clears HasStandardFormAlternative and Loading, and there the switch must still reload — it is the retry of the failed load.

      Parameters

      Returns boolean