@memberjunction/ng-base-forms 6.2.0-edge.1 → 6.2.0-edge.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/apply/form-placement-dialog.component.d.ts +266 -0
- package/dist/lib/apply/form-placement-dialog.component.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-dialog.component.js +1522 -0
- package/dist/lib/apply/form-placement-dialog.component.js.map +1 -0
- package/dist/lib/apply/form-placement-order.d.ts +37 -0
- package/dist/lib/apply/form-placement-order.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-order.js +111 -0
- package/dist/lib/apply/form-placement-order.js.map +1 -0
- package/dist/lib/apply/form-placement-preview.component.d.ts +112 -0
- package/dist/lib/apply/form-placement-preview.component.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-preview.component.js +346 -0
- package/dist/lib/apply/form-placement-preview.component.js.map +1 -0
- package/dist/lib/apply/form-placement-text.d.ts +61 -0
- package/dist/lib/apply/form-placement-text.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-text.js +279 -0
- package/dist/lib/apply/form-placement-text.js.map +1 -0
- package/dist/lib/apply/form-placement.d.ts +320 -0
- package/dist/lib/apply/form-placement.d.ts.map +1 -0
- package/dist/lib/apply/form-placement.js +432 -0
- package/dist/lib/apply/form-placement.js.map +1 -0
- package/dist/lib/apply/form-slot-probe.service.d.ts +121 -0
- package/dist/lib/apply/form-slot-probe.service.d.ts.map +1 -0
- package/dist/lib/apply/form-slot-probe.service.js +264 -0
- package/dist/lib/apply/form-slot-probe.service.js.map +1 -0
- package/dist/lib/base-form-component-internals.d.ts +11 -0
- package/dist/lib/base-form-component-internals.d.ts.map +1 -0
- package/dist/lib/base-form-component-internals.js +33 -0
- package/dist/lib/base-form-component-internals.js.map +1 -0
- package/dist/lib/base-form-component.d.ts +166 -1
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +296 -20
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/chrome/form-chrome.d.ts +78 -0
- package/dist/lib/chrome/form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/form-chrome.js +128 -2
- package/dist/lib/chrome/form-chrome.js.map +1 -1
- package/dist/lib/chrome/form-composition-registry.d.ts +34 -0
- package/dist/lib/chrome/form-composition-registry.d.ts.map +1 -0
- package/dist/lib/chrome/form-composition-registry.js +56 -0
- package/dist/lib/chrome/form-composition-registry.js.map +1 -0
- package/dist/lib/chrome/form-composition-snapshot.d.ts +151 -0
- package/dist/lib/chrome/form-composition-snapshot.d.ts.map +1 -0
- package/dist/lib/chrome/form-composition-snapshot.js +137 -0
- package/dist/lib/chrome/form-composition-snapshot.js.map +1 -0
- package/dist/lib/chrome/resolve-form-chrome.d.ts +15 -0
- package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/resolve-form-chrome.js +31 -2
- package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +261 -5
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +1180 -371
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.d.ts +150 -0
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.d.ts.map +1 -0
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.js +263 -0
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.js.map +1 -0
- package/dist/lib/field/form-field.component.d.ts +22 -0
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +51 -6
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/form-field-edit.coordinator.d.ts +25 -0
- package/dist/lib/form-field-edit.coordinator.d.ts.map +1 -0
- package/dist/lib/form-field-edit.coordinator.js +27 -0
- package/dist/lib/form-field-edit.coordinator.js.map +1 -0
- package/dist/lib/form-state.service.d.ts +5 -0
- package/dist/lib/form-state.service.d.ts.map +1 -1
- package/dist/lib/form-state.service.js +6 -1
- package/dist/lib/form-state.service.js.map +1 -1
- package/dist/lib/host/entity-form-host.component.d.ts +16 -1
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
- package/dist/lib/host/entity-form-host.component.js +27 -6
- package/dist/lib/host/entity-form-host.component.js.map +1 -1
- package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts +24 -0
- package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts.map +1 -0
- package/dist/lib/interactive-form/form-panel-host-props.builder.js +99 -0
- package/dist/lib/interactive-form/form-panel-host-props.builder.js.map +1 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.d.ts +109 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.d.ts.map +1 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.js +424 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.js.map +1 -0
- package/dist/lib/interactive-form/interactive-form.component.d.ts +2 -0
- package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.js +4 -5
- package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +69 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +148 -12
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/panel-manager/form-audience.d.ts +46 -0
- package/dist/lib/panel-manager/form-audience.d.ts.map +1 -0
- package/dist/lib/panel-manager/form-audience.js +34 -0
- package/dist/lib/panel-manager/form-audience.js.map +1 -0
- package/dist/lib/panel-manager/form-panel-admin.service.d.ts +150 -0
- package/dist/lib/panel-manager/form-panel-admin.service.d.ts.map +1 -0
- package/dist/lib/panel-manager/form-panel-admin.service.js +433 -0
- package/dist/lib/panel-manager/form-panel-admin.service.js.map +1 -0
- package/dist/lib/panel-manager/form-panel-inventory.d.ts +255 -0
- package/dist/lib/panel-manager/form-panel-inventory.d.ts.map +1 -0
- package/dist/lib/panel-manager/form-panel-inventory.js +293 -0
- package/dist/lib/panel-manager/form-panel-inventory.js.map +1 -0
- package/dist/lib/panel-manager/panel-manager.component.d.ts +232 -0
- package/dist/lib/panel-manager/panel-manager.component.d.ts.map +1 -0
- package/dist/lib/panel-manager/panel-manager.component.js +1112 -0
- package/dist/lib/panel-manager/panel-manager.component.js.map +1 -0
- package/dist/lib/panel-slot/base-contribution-panel.d.ts +40 -0
- package/dist/lib/panel-slot/base-contribution-panel.d.ts.map +1 -0
- package/dist/lib/panel-slot/base-contribution-panel.js +55 -0
- package/dist/lib/panel-slot/base-contribution-panel.js.map +1 -0
- package/dist/lib/panel-slot/base-form-panel.d.ts +116 -8
- package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.js +76 -5
- package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
- package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts +29 -0
- package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts.map +1 -0
- package/dist/lib/panel-slot/collect-form-contribution-registrations.js +214 -0
- package/dist/lib/panel-slot/collect-form-contribution-registrations.js.map +1 -0
- package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts +6 -3
- package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts.map +1 -1
- package/dist/lib/panel-slot/collect-form-panel-registrations.js +8 -14
- package/dist/lib/panel-slot/collect-form-panel-registrations.js.map +1 -1
- package/dist/lib/panel-slot/form-contribution.d.ts +170 -7
- package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-contribution.js +242 -64
- package/dist/lib/panel-slot/form-contribution.js.map +1 -1
- package/dist/lib/panel-slot/form-contributions.component.d.ts +16 -5
- package/dist/lib/panel-slot/form-contributions.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-contributions.component.js +43 -7
- package/dist/lib/panel-slot/form-contributions.component.js.map +1 -1
- package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts +66 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts.map +1 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.js +190 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.js.map +1 -0
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts +52 -16
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-panel-slot.component.js +190 -66
- package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +11 -0
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.js +17 -0
- package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
- package/dist/lib/panel-slot/merge-panel-validation.d.ts +7 -0
- package/dist/lib/panel-slot/merge-panel-validation.d.ts.map +1 -0
- package/dist/lib/panel-slot/merge-panel-validation.js +16 -0
- package/dist/lib/panel-slot/merge-panel-validation.js.map +1 -0
- package/dist/lib/panel-slot/mount-form-contribution.d.ts +15 -0
- package/dist/lib/panel-slot/mount-form-contribution.d.ts.map +1 -0
- package/dist/lib/panel-slot/mount-form-contribution.js +37 -0
- package/dist/lib/panel-slot/mount-form-contribution.js.map +1 -0
- package/dist/lib/panel-slot/panel-hides.d.ts +35 -0
- package/dist/lib/panel-slot/panel-hides.d.ts.map +1 -0
- package/dist/lib/panel-slot/panel-hides.js +111 -0
- package/dist/lib/panel-slot/panel-hides.js.map +1 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.d.ts +16 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.d.ts.map +1 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.js +112 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.js.map +1 -0
- package/dist/lib/panel-slot/placement-preview.d.ts +57 -0
- package/dist/lib/panel-slot/placement-preview.d.ts.map +1 -0
- package/dist/lib/panel-slot/placement-preview.js +86 -0
- package/dist/lib/panel-slot/placement-preview.js.map +1 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js +10 -3
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/slot-order.d.ts +19 -0
- package/dist/lib/panel-slot/slot-order.d.ts.map +1 -0
- package/dist/lib/panel-slot/slot-order.js +53 -0
- package/dist/lib/panel-slot/slot-order.js.map +1 -0
- package/dist/lib/resolver/form-resolver.service.d.ts +4 -2
- package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -1
- package/dist/lib/resolver/form-resolver.service.js +18 -8
- package/dist/lib/resolver/form-resolver.service.js.map +1 -1
- package/dist/lib/resolver/form-variants.d.ts +28 -0
- package/dist/lib/resolver/form-variants.d.ts.map +1 -0
- package/dist/lib/resolver/form-variants.js +40 -0
- package/dist/lib/resolver/form-variants.js.map +1 -0
- package/dist/lib/section-counts/form-section-counts.d.ts +99 -0
- package/dist/lib/section-counts/form-section-counts.d.ts.map +1 -0
- package/dist/lib/section-counts/form-section-counts.js +223 -0
- package/dist/lib/section-counts/form-section-counts.js.map +1 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts +129 -2
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +974 -307
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/lib/types/form-events.d.ts +6 -0
- package/dist/lib/types/form-events.d.ts.map +1 -1
- package/dist/lib/types/form-events.js +6 -0
- package/dist/lib/types/form-events.js.map +1 -1
- package/dist/lib/types/form-toolbar-item.d.ts +20 -1
- package/dist/lib/types/form-toolbar-item.d.ts.map +1 -1
- package/dist/lib/types/form-toolbar-item.js.map +1 -1
- package/dist/lib/types/form-types.d.ts +13 -0
- package/dist/lib/types/form-types.d.ts.map +1 -1
- package/dist/lib/types/form-types.js.map +1 -1
- package/dist/lib/types/toolbar-config.d.ts +16 -0
- package/dist/lib/types/toolbar-config.d.ts.map +1 -1
- package/dist/lib/types/toolbar-config.js +3 -0
- package/dist/lib/types/toolbar-config.js.map +1 -1
- package/dist/module.d.ts +29 -22
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +50 -8
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +22 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +24 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +20 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-form.component.js","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form.component.ts","../../../src/lib/interactive-form/interactive-form.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAqB,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChI,OAAO,EAA4B,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAEH,cAAc,EACd,eAAe,EAIf,UAAU,GACb,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAoB,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;;;;;;ICVnD,mCAA0B;IAAA,YAAe;IAAA,iBAAW;;;IAA1B,cAAe;IAAf,sCAAe;;;;IAEzC,gDAKoD;IAAhD,AADA,6PAAkB,oCAA6B,KAAC,oPAC5B,iCAA0B,KAAC;IACnD,iBAAqB;;;IAHjB,AADA,gDAA2B,wCACK;;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,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;YACtE,OAAO,EAAE,IAAI,CAAC,WAAW;YACzB,SAAS,EAAE,IAAI,CAAC,aAAa;YAC7B,SAAS,EAAE,IAAI,CAAC,aAAa;SAChC,CAAC;IACN,CAAC;IAEO,iBAAiB,CAAC,EAAgB;QACtC,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,EAAE,CAAC,aAAa,IAAI,EAAE,EAAE,CAAC;YACvC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC;QACnC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;6QAzeQ,wBAAwB,yBAAxB,wBAAwB;6DAAxB,wBAAwB;;;;;;YCrCrC,gFAAc;;YAAd,qCAiDC;;;iFDZY,wBAAwB;cALpC,SAAS;6BACM,KAAK,YACP,qBAAqB;;kBAkB9B,KAAK;;kBAiBL,KAAK;;kBAaL,KAAK;;kBAcL,KAAK;;kBAGL,KAAK;;kBAoCL,MAAM;;kBAaN,SAAS;mBAAC,gBAAgB;;kFA/GlB,wBAAwB;AA4erC;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IACxC,0CAA0C;IAC1C,IAAI,KAAgB,EAAE,CAAC;QACnB,6DAA6D;QAC7D,MAAM,CAAC,GAAY,wBAAwB,CAAC;IAChD,CAAC;AACL,CAAC","sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, inject } from '@angular/core';\nimport { BaseEntity, CompositeKey, LogError, RunView } from '@memberjunction/core';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport {\n FormHostProps,\n FormEventNames,\n FormMethodNames,\n FormBeforeSaveArgs,\n FormBeforeDeleteArgs,\n FormEditModeChangeRequestedArgs,\n isFormRole,\n} from '@memberjunction/interactive-component-types/forms';\nimport { SimpleEntityFieldInfo } from '@memberjunction/interactive-component-types';\nimport { MJReactComponent, ReactBridgeService, ReactComponentEvent } from '@memberjunction/ng-react';\nimport { BaseFormComponent } from '../base-form-component';\n\n/**\n * Wraps a Component (the IC kind — declared `componentRole: 'form'`) so it can\n * stand in for an Angular form on any entity.\n *\n * **Layering invariant:** the React component never touches BaseEntity. This\n * wrapper owns the entity lifecycle (`record.Save`, `record.Delete`, mode\n * transitions). The React component sees only the snapshot in\n * {@link FormHostProps} and communicates back via `BeforeSave` /\n * `BeforeDelete` / `EditModeChangeRequested` events plus its dirty-field diff.\n *\n * Instantiated by `SingleRecordComponent.LoadForm` when the resolver finds an\n * `EntityFormOverride` matching the user's scope. Behaves exactly like the\n * generated Angular form from the host's perspective: same `record` setter,\n * same `EditMode` toggle, same outputs.\n */\n@Component({\n standalone: false,\n selector: 'mj-interactive-form',\n templateUrl: './interactive-form.component.html',\n})\nexport class InteractiveFormComponent extends BaseFormComponent implements OnInit, OnDestroy {\n\n /**\n * The bound record. Backed by a setter so swapping records *after*\n * the component has mounted (e.g. Form Builder cockpit preview record\n * picker) triggers a fresh `originalSnapshot` capture + a\n * `formHostProps` rebuild — without this, the React form keeps\n * rendering the original record's values even after the input\n * changes. Guarded on `_recordInitialized` so the post-mount path\n * doesn't fire during the first input assignment (handled by\n * `ngOnInit`, which sets both `originalSnapshot` and `formHostProps`).\n */\n private _record!: BaseEntity;\n private _recordInitialized = false;\n\n @Input()\n public override set record(value: BaseEntity) {\n if (this._record === value) return;\n this._record = value;\n if (this._recordInitialized && value) {\n this.originalSnapshot = value.GetAll();\n this.rebuildFormHostProps();\n this.cdr.markForCheck();\n }\n }\n public override get record(): BaseEntity { return this._record; }\n\n /**\n * The Component row ID resolved for this (entity, user, roles) tuple. Set\n * by `SingleRecordComponent.LoadForm` after the resolver returns an\n * override.\n */\n @Input() public ComponentID: string | null = null;\n\n /**\n * Loaded ComponentSpec, parsed from the Component row's `Specification` JSON.\n *\n * Two ways to populate this:\n * 1. **Via `ComponentID`** (the standard path): set the input, ngOnInit\n * fetches the row from `MJ: Components` and assigns the parsed spec.\n * 2. **Direct assignment** (the artifact-viewer path): the caller already\n * has the spec in hand (parsed from an artifact JSON blob) and sets\n * `componentSpec` directly. In that case `ComponentID` should be left\n * null and the DB fetch is skipped.\n */\n @Input() public componentSpec: ComponentSpec | null = null;\n\n /**\n * When true, render the React component **without** the\n * `<mj-record-form-container>` wrapper — i.e. no toolbar (no Save /\n * Cancel / Edit / Delete / History / Tags / Lists).\n *\n * Used by the Form Builder cockpit's Preview tab where the toolbar's\n * actions don't apply (Save would save the *record*, but the cockpit's\n * own Save button saves the *spec*; History/Tags assume a real\n * persistent record, but the preview record can be a synthetic\n * NewRecord). Keeping just the form body produces a clean \"this is\n * what the form looks like\" view.\n */\n @Input() public PreviewMode = false;\n\n /** @deprecated Use {@link PreviewMode}. */\n @Input() public set previewMode(value: InteractiveFormComponent['PreviewMode']) {\n this.PreviewMode = value;\n }\n /** @deprecated Use {@link PreviewMode}. */\n public get previewMode(): InteractiveFormComponent['PreviewMode'] {\n return this.PreviewMode;\n }\n\n /** FormHostProps passed to the React component. Recomputed when record or mode changes. */\n public FormHostProps: FormHostProps | null = null;\n\n /** @deprecated Use {@link FormHostProps}. */\n public get formHostProps(): FormHostProps | null {\n return this.FormHostProps;\n }\n /** @deprecated Use {@link FormHostProps}. */\n public set formHostProps(value: FormHostProps | null) {\n this.FormHostProps = value;\n }\n\n /** Loaded-spec error (component row missing, JSON parse failure, etc.). */\n private _loadError: string | null = null;\n\n /**\n * Loaded-spec error (component row missing, JSON parse failure,\n * React-runtime bootstrap failure, etc.). Setter auto-emits\n * `LoadErrorChanged` so host surfaces (e.g. Form Builder cockpit\n * Preview tab) can show their own error state — retrospective fix #10.\n */\n public get loadError(): string | null { return this._loadError; }\n public set loadError(v: string | null) {\n if (v === this._loadError) return;\n this._loadError = v;\n this.LoadErrorChanged.emit(v);\n }\n\n @Output() public LoadErrorChanged = new EventEmitter<string | null>();\n\n /** Tracks last-known field snapshot for computing the dirty-field diff on save. */\n private originalSnapshot: Record<string, unknown> = {};\n\n /**\n * Reference to the mounted React component. Used by the SaveRecord /\n * CancelEdit overrides below to invoke the component's registered\n * `RequestSave` / `RequestCancel` methods when the host toolbar fires\n * Save/Cancel — so the single user-visible Save lives on the toolbar\n * (consistent with every other entity form in MJ) and not duplicated\n * inside the form body.\n */\n @ViewChild('reactComponent') public ReactComponent?: MJReactComponent;\n\n /** @deprecated Use {@link ReactComponent}. */\n public get reactComponent(): MJReactComponent | undefined {\n return this.ReactComponent;\n }\n /** @deprecated Use {@link ReactComponent}. */\n public set reactComponent(value: MJReactComponent | undefined) {\n this.ReactComponent = value;\n }\n\n /**\n * Promise resolver populated when `SaveRecord` invokes `RequestSave`\n * on the React component. `handleBeforeSave` resolves it after the\n * BeforeSave-driven entity save completes, so SaveRecord can return\n * a meaningful success boolean and honor `StopEditModeAfterSave`.\n */\n private pendingSaveResolver: ((success: boolean) => void) | null = null;\n\n private readonly changeDetector = inject(ChangeDetectorRef);\n private readonly reactBridge = inject(ReactBridgeService);\n\n public override async ngOnInit(): Promise<void> {\n await super.ngOnInit();\n // Force the React bridge to be initialized BEFORE we let our template\n // mount the `<mj-react-component>` child. Without this, the child's\n // ngAfterViewInit can race the adapter bootstrap and throw \"React\n // runtime not initialized\" — which then prevents the form from\n // rendering and silently breaks the save flow.\n try {\n await this.reactBridge.getReactContext();\n } catch (err) {\n LogError(`InteractiveFormComponent: React bridge bootstrap failed: ${err instanceof Error ? err.message : String(err)}`);\n this.loadError ='React runtime failed to load. Try a hard refresh.';\n return;\n }\n if (this.record) {\n this.originalSnapshot = this.record.GetAll();\n this.rebuildFormHostProps();\n }\n // Mark init complete so the `record` setter rebuilds on subsequent\n // input changes (post-mount record swaps from the Form Builder\n // cockpit preview picker, etc.). Before this flag flips, the setter\n // intentionally does nothing because ngOnInit already handles the\n // initial assignment.\n this._recordInitialized = true;\n // Direct-spec path (artifact viewer) takes precedence; DB fetch only\n // when no spec was supplied and we have an ID to look up.\n if (!this.componentSpec && this.ComponentID) {\n await this.loadComponentSpec();\n }\n }\n\n /**\n * Called by the React component via `mj-react-component`'s `componentEvent`\n * @Output. Maps the form-role event names to BaseEntity operations.\n */\n public async OnReactComponentEvent(event: ReactComponentEvent): Promise<void> {\n switch (event.type) {\n case FormEventNames.BeforeSave:\n await this.handleBeforeSave(event.payload as FormBeforeSaveArgs);\n break;\n case FormEventNames.BeforeDelete:\n await this.handleBeforeDelete(event.payload as FormBeforeDeleteArgs);\n break;\n case FormEventNames.EditModeChangeRequested:\n this.handleEditModeChangeRequested(event.payload as FormEditModeChangeRequestedArgs);\n break;\n // FieldChanged / DirtyStateChanged / ValidationChanged are read-only signals;\n // the wrapper doesn't need to react beyond what the component does internally.\n }\n }\n\n /**\n * Called when the form-role component drills into a related record via\n * `callbacks.OpenEntityRecord(...)`. Relays it upward as a `Navigate` event\n * (the same path normal FK links use) so the host opens the target record.\n */\n public OnOpenEntityRecord(event: { entityName: string; key: CompositeKey }): void {\n this.Navigate.emit({ Kind: 'record', EntityName: event.entityName, PrimaryKey: event.key });\n }\n\n /**\n * Apply the React component's dirty-field diff to the BaseEntity, save,\n * and refresh the snapshot. Errors surface via `LatestResult.CompleteMessage`\n * per the BaseEntity Save contract.\n *\n * Resolves `pendingSaveResolver` if {@link SaveRecord} initiated this\n * flow via the toolbar — so the toolbar can return a meaningful boolean\n * and honor `StopEditModeAfterSave`.\n */\n private async handleBeforeSave(args: FormBeforeSaveArgs): Promise<void> {\n if (args.cancel) {\n this.resolvePendingSave(false);\n return;\n }\n if (!this.record) {\n LogError('InteractiveFormComponent.handleBeforeSave: no record loaded');\n this.resolvePendingSave(false);\n return;\n }\n\n const dirtyEntries = Object.entries(args.dirtyFields ?? {});\n if (dirtyEntries.length === 0 && this.record.IsSaved) {\n // No dirty fields on an already-persisted record — a genuine no-op.\n // Most likely the user clicked Save without changing anything, or the\n // React draft didn't reach the host before RequestSave fired. Surface\n // it so the user sees why their edits didn't land.\n console.warn(\n '[InteractiveFormComponent] BeforeSave fired with no dirtyFields. ' +\n 'Either the user clicked Save without changing anything, or the ' +\n 'React draft did not propagate before save fired.'\n );\n // Skip Save() + rebuildFormHostProps(): re-rendering the React form\n // would re-fire BeforeSave on a form that emits it on mount/render —\n // an infinite re-mount loop that starves the form's async data load\n // (it unmounts before setState commits). Treat it as a no-op.\n //\n // Guard on IsSaved so this only short-circuits existing records. A\n // NEW record with no dirty fields must still fall through to Save()\n // so the insert is attempted (and any validation failure surfaced)\n // rather than masked as a reported success with no row inserted.\n this.resolvePendingSave(true);\n return;\n }\n for (const [fieldName, value] of dirtyEntries) {\n const field = this.record.Fields.find(f =>\n f.Name.trim().toLowerCase() === fieldName.trim().toLowerCase());\n if (field) {\n // Use the canonical field name from the lookup so case\n // mismatches between the React draft and the entity schema\n // don't silently drop the value.\n this.record.Set(field.Name, value);\n } else {\n console.warn(\n `[InteractiveFormComponent] Unknown field \"${fieldName}\" in dirtyFields ` +\n `for entity ${this.record.EntityInfo.Name}. Value not applied.`\n );\n }\n }\n\n const saved = await this.record.Save();\n if (saved) {\n this.originalSnapshot = this.record.GetAll();\n this.rebuildFormHostProps();\n } else {\n LogError(`InteractiveFormComponent: save failed for ${this.record.EntityInfo.Name}: ${this.record.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n this.resolvePendingSave(saved);\n }\n\n private resolvePendingSave(success: boolean): void {\n if (this.pendingSaveResolver) {\n this.pendingSaveResolver(success);\n this.pendingSaveResolver = null;\n }\n }\n\n private async handleBeforeDelete(args: FormBeforeDeleteArgs): Promise<void> {\n if (args.cancel) {\n return;\n }\n if (!this.record) {\n return;\n }\n const deleted = await this.record.Delete();\n if (!deleted) {\n LogError(`InteractiveFormComponent: delete failed for ${this.record.EntityInfo.Name}: ${this.record.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n }\n\n private handleEditModeChangeRequested(args: FormEditModeChangeRequestedArgs): void {\n if (args.cancel) {\n return;\n }\n if (args.requestedMode === 'edit') {\n this.StartEditMode();\n } else {\n this.EndEditMode();\n }\n }\n\n /**\n * Propagate Angular-toolbar-driven mode changes into the React component's\n * `FormHostProps.mode`. Without these overrides, clicking Edit on the\n * `<mj-record-form-container>` toolbar flips `this.EditMode` but the React\n * side still sees `mode: 'view'`.\n */\n public override StartEditMode(): void {\n super.StartEditMode();\n this.rebuildFormHostProps();\n }\n\n public override EndEditMode(): void {\n super.EndEditMode();\n this.rebuildFormHostProps();\n }\n\n /**\n * Toolbar **Save** override. Routes the click through the React\n * component's registered `RequestSave` method so the React layer can\n * (a) run its own validation, (b) flush its draft state, (c) emit\n * `BeforeSave` with the dirty-field diff — exactly the flow the\n * in-form Save button would trigger. The wrapper then awaits the\n * BeforeSave handler via `pendingSaveResolver`, gets a real\n * success/failure boolean, and honors `StopEditModeAfterSave`.\n *\n * Falls back to the base implementation for components that haven't\n * registered `RequestSave` — preserves correctness for forms that\n * keep their own in-form Save button (older sample, hand-authored\n * forms that pre-date this contract).\n */\n public override async SaveRecord(StopEditModeAfterSave: boolean): Promise<boolean> {\n if (!this.ReactComponent?.hasMethod?.(FormMethodNames.RequestSave)) {\n return super.SaveRecord(StopEditModeAfterSave);\n }\n const completion = new Promise<boolean>(resolve => {\n this.pendingSaveResolver = resolve;\n });\n try {\n this.ReactComponent.invokeMethod(FormMethodNames.RequestSave);\n } catch (err) {\n this.pendingSaveResolver = null;\n LogError(`InteractiveFormComponent.SaveRecord: RequestSave threw: ${err instanceof Error ? err.message : String(err)}`);\n return false;\n }\n const success = await completion;\n if (success && StopEditModeAfterSave) {\n this.EndEditMode();\n }\n return success;\n }\n\n /**\n * Toolbar **Cancel** override. Asks the React component to discard\n * its draft via `RequestCancel`, then flips out of edit mode the\n * same way the base implementation would. The React component is\n * expected to (a) clear its local draft state and (b) emit\n * `EditModeChangeRequested({ requestedMode: 'view' })` — though we\n * call `EndEditMode` here directly anyway, so even a no-op handler\n * leaves the form in a coherent state.\n */\n public override CancelEdit(): void {\n if (this.ReactComponent?.hasMethod?.(FormMethodNames.RequestCancel)) {\n try {\n this.ReactComponent.invokeMethod(FormMethodNames.RequestCancel);\n } catch (err) {\n LogError(`InteractiveFormComponent.CancelEdit: RequestCancel threw: ${err instanceof Error ? err.message : String(err)}`);\n }\n // Don't call super.CancelEdit() — base reverts the BaseEntity,\n // but for interactive forms the BaseEntity never received the\n // React draft in the first place, so there's nothing to revert.\n // Just flip mode.\n this.EndEditMode();\n return;\n }\n super.CancelEdit();\n }\n\n /**\n * Resolve the Component row, parse its `Specification`, and surface either\n * the spec or an error. Backed by `InteractiveFormsEngine` (in-memory\n * cache, BaseEntity event-driven invalidation) so this is a sub-ms JS\n * lookup once the engine has loaded — the engine handles freshness\n * via remote-invalidate events, replacing the prior RunView's\n * `BypassCache: true` escape hatch. Falls through to a one-shot\n * RunView only on engine-cache miss (defensive — the engine should\n * always have a Type='Form' Component, but if a brand-new Component\n * was just created on the server and the invalidation event hasn't\n * propagated yet, we still want to render rather than blank-screen).\n */\n private async loadComponentSpec(): Promise<void> {\n if (!this.ComponentID) {\n this.loadError ='No ComponentID provided to InteractiveFormComponent.';\n return;\n }\n try {\n const provider = this.ProviderToUse;\n const user = provider.CurrentUser;\n // Lazy-load the form-metadata cache. No-op when already loaded.\n try {\n await InteractiveFormsEngine.Instance.Config(false, user, provider);\n } catch (err) {\n LogError(`InteractiveFormComponent: InteractiveFormsEngine.Config failed: ${err instanceof Error ? err.message : String(err)}`);\n // Fall through to RunView path below — engine miss isn't fatal.\n }\n\n let specJson: string | null = null;\n let nameForError: string | undefined;\n\n const cached = InteractiveFormsEngine.Instance.FindFormByID(this.ComponentID);\n if (cached) {\n specJson = cached.Specification;\n nameForError = cached.Name;\n } else {\n // Engine miss — one-shot RunView fallback. This covers the\n // narrow window where a freshly-created Component hasn't\n // propagated to the engine yet (cross-process remote-invalidate\n // is debounced ~1.5s). After the propagation lands subsequent\n // form opens hit the cache.\n const rv = RunView.FromMetadataProvider(provider);\n const result = await rv.RunView<{ ID: string; Specification: string; Name: string }>({\n EntityName: 'MJ: Components',\n Fields: ['ID', 'Name', 'Specification'],\n ExtraFilter: `ID='${this.ComponentID}'`,\n MaxRows: 1,\n ResultType: 'simple',\n BypassCache: true,\n }, user);\n if (!result.Success || !result.Results?.length) {\n this.loadError =`Component ${this.ComponentID} not found.`;\n return;\n }\n specJson = result.Results[0].Specification;\n nameForError = result.Results[0].Name;\n }\n\n try {\n this.componentSpec = JSON.parse(specJson ?? 'null') as ComponentSpec;\n } catch (err) {\n this.loadError =`Component ${nameForError ?? this.ComponentID} has invalid Specification JSON: ${err instanceof Error ? err.message : String(err)}`;\n return;\n }\n if (!this.componentSpec) {\n this.loadError =`Component ${nameForError ?? this.ComponentID} has an empty Specification.`;\n return;\n }\n // Validate the spec commits to the form-role contract. We use the\n // helper (whose signature is structural via Pick<>) so this stays\n // robust across ComponentSpec field additions.\n if (!isFormRole(this.componentSpec)) {\n this.loadError =`Component ${nameForError ?? this.ComponentID} does not declare componentRole='form'.`;\n return;\n }\n } finally {\n this.changeDetector.markForCheck();\n }\n }\n\n /**\n * Build `FormHostProps` from the current record + permissions + edit mode.\n * Called whenever the record loads, mode changes, or save completes.\n */\n private rebuildFormHostProps(): void {\n if (!this.record) {\n this.FormHostProps = null;\n return;\n }\n const fields: SimpleEntityFieldInfo[] = this.record.Fields.map(f =>\n SimpleEntityFieldInfo.FromEntityFieldInfo(f.EntityFieldInfo));\n\n const pk = this.record.PrimaryKey;\n const primaryKey: Record<string, unknown> | null = (pk && pk.HasValue)\n ? this.primaryKeyToPlain(pk)\n : null;\n\n this.FormHostProps = {\n entityName: this.record.EntityInfo.Name,\n primaryKey,\n record: this.record.GetAll(),\n entityMetadata: {\n fields,\n displayName: this.record.EntityInfo.DisplayName ?? this.record.EntityInfo.Name,\n nameField: this.record.EntityInfo.NameField?.Name,\n },\n mode: this.EditMode ? 'edit' : (pk && pk.HasValue ? 'view' : 'create'),\n canEdit: this.UserCanEdit,\n canDelete: this.UserCanDelete,\n canCreate: this.UserCanCreate,\n };\n }\n\n private primaryKeyToPlain(pk: CompositeKey): Record<string, unknown> {\n const obj: Record<string, unknown> = {};\n for (const kvp of pk.KeyValuePairs ?? []) {\n obj[kvp.FieldName] = kvp.Value;\n }\n return obj;\n }\n}\n\n/**\n * Tree-shaking guard. Imported and called from public-api.ts so bundlers don't\n * drop the component when no consumer references it by name.\n */\nexport function LoadInteractiveFormComponent(): void {\n // Force the class reference to stay live.\n if (false as boolean) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: unknown = InteractiveFormComponent;\n }\n}\n","@if (record) {\n@if (previewMode) {\n <!-- Preview mode — no toolbar wrap. Just the form body for clean\n \"what the form looks like\" previews (Form Builder cockpit). -->\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form…</span>\n </div>\n }\n} @else {\n<mj-record-form-container\n [Record]=\"record\"\n [FormComponent]=\"this\"\n (Navigate)=\"OnFormNavigate($event)\"\n (DeleteRequested)=\"OnDeleteRequested()\"\n (FavoriteToggled)=\"OnFavoriteToggled()\"\n (HistoryRequested)=\"OnHistoryRequested()\"\n (ListManagementRequested)=\"OnListManagementRequested()\">\n\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form…</span>\n </div>\n }\n\n</mj-record-form-container>\n}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-form.component.js","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form.component.ts","../../../src/lib/interactive-form/interactive-form.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAqB,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChI,OAAO,EAA4B,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAEH,cAAc,EACd,eAAe,EAIf,UAAU,GACb,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAoB,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;;;ICVnD,mCAA0B;IAAA,YAAe;IAAA,iBAAW;;;IAA1B,cAAe;IAAf,sCAAe;;;;IAEzC,gDAKoD;IAAhD,AADA,6PAAkB,oCAA6B,KAAC,oPAC5B,iCAA0B,KAAC;IACnD,iBAAqB;;;IAHjB,AADA,gDAA2B,wCACK;;;IAKpC,8BAA8B;IAC1B,uBAA2C;IAC3C,4BAAM;IAAA,kCAAa;IACvB,AADuB,iBAAO,EACxB;;;IAJR,AARA,AAFF,2HAAiB,+GAE4B,gGAQpC;;;IAVT,6FAeC;;;IAeG,mCAA0B;IAAA,YAAe;IAAA,iBAAW;;;IAA1B,cAAe;IAAf,sCAAe;;;;IAEzC,gDAKoD;IAAhD,AADA,6PAAkB,oCAA6B,KAAC,oPAC5B,iCAA0B,KAAC;IACnD,iBAAqB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BAAiB,CAAC,EAAgB;QACtC,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,EAAE,CAAC,aAAa,IAAI,EAAE,EAAE,CAAC;YACvC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC;QACnC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;6QA5eQ,wBAAwB,yBAAxB,wBAAwB;6DAAxB,wBAAwB;;;;;;YCrCrC,gFAAc;;YAAd,qCAoDC;;;iFDfY,wBAAwB;cALpC,SAAS;6BACM,KAAK,YACP,qBAAqB;;kBAkB9B,KAAK;;kBAiBL,KAAK;;kBAaL,KAAK;;kBAcL,KAAK;;kBAGL,KAAK;;kBAuCL,MAAM;;kBAaN,SAAS;mBAAC,gBAAgB;;kFAlHlB,wBAAwB;AA+erC;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IACxC,0CAA0C;IAC1C,IAAI,KAAgB,EAAE,CAAC;QACnB,6DAA6D;QAC7D,MAAM,CAAC,GAAY,wBAAwB,CAAC;IAChD,CAAC;AACL,CAAC","sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, inject } from '@angular/core';\nimport { BaseEntity, CompositeKey, LogError, RunView } from '@memberjunction/core';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport {\n FormHostProps,\n FormEventNames,\n FormMethodNames,\n FormBeforeSaveArgs,\n FormBeforeDeleteArgs,\n FormEditModeChangeRequestedArgs,\n isFormRole,\n} from '@memberjunction/interactive-component-types/forms';\nimport { SimpleEntityFieldInfo } from '@memberjunction/interactive-component-types';\nimport { MJReactComponent, ReactBridgeService, ReactComponentEvent } from '@memberjunction/ng-react';\nimport { BaseFormComponent } from '../base-form-component';\n\n/**\n * Wraps a Component (the IC kind — declared `componentRole: 'form'`) so it can\n * stand in for an Angular form on any entity.\n *\n * **Layering invariant:** the React component never touches BaseEntity. This\n * wrapper owns the entity lifecycle (`record.Save`, `record.Delete`, mode\n * transitions). The React component sees only the snapshot in\n * {@link FormHostProps} and communicates back via `BeforeSave` /\n * `BeforeDelete` / `EditModeChangeRequested` events plus its dirty-field diff.\n *\n * Instantiated by `SingleRecordComponent.LoadForm` when the resolver finds an\n * `EntityFormOverride` matching the user's scope. Behaves exactly like the\n * generated Angular form from the host's perspective: same `record` setter,\n * same `EditMode` toggle, same outputs.\n */\n@Component({\n standalone: false,\n selector: 'mj-interactive-form',\n templateUrl: './interactive-form.component.html',\n})\nexport class InteractiveFormComponent extends BaseFormComponent implements OnInit, OnDestroy {\n\n /**\n * The bound record. Backed by a setter so swapping records *after*\n * the component has mounted (e.g. Form Builder cockpit preview record\n * picker) triggers a fresh `originalSnapshot` capture + a\n * `formHostProps` rebuild — without this, the React form keeps\n * rendering the original record's values even after the input\n * changes. Guarded on `_recordInitialized` so the post-mount path\n * doesn't fire during the first input assignment (handled by\n * `ngOnInit`, which sets both `originalSnapshot` and `formHostProps`).\n */\n private _record!: BaseEntity;\n private _recordInitialized = false;\n\n @Input()\n public override set record(value: BaseEntity) {\n if (this._record === value) return;\n this._record = value;\n if (this._recordInitialized && value) {\n this.originalSnapshot = value.GetAll();\n this.rebuildFormHostProps();\n this.cdr.markForCheck();\n }\n }\n public override get record(): BaseEntity { return this._record; }\n\n /**\n * The Component row ID resolved for this (entity, user, roles) tuple. Set\n * by `SingleRecordComponent.LoadForm` after the resolver returns an\n * override.\n */\n @Input() public ComponentID: string | null = null;\n\n /**\n * Loaded ComponentSpec, parsed from the Component row's `Specification` JSON.\n *\n * Two ways to populate this:\n * 1. **Via `ComponentID`** (the standard path): set the input, ngOnInit\n * fetches the row from `MJ: Components` and assigns the parsed spec.\n * 2. **Direct assignment** (the artifact-viewer path): the caller already\n * has the spec in hand (parsed from an artifact JSON blob) and sets\n * `componentSpec` directly. In that case `ComponentID` should be left\n * null and the DB fetch is skipped.\n */\n @Input() public componentSpec: ComponentSpec | null = null;\n\n /**\n * When true, render the React component **without** the\n * `<mj-record-form-container>` wrapper — i.e. no toolbar (no Save /\n * Cancel / Edit / Delete / History / Tags / Lists).\n *\n * Used by the Form Builder cockpit's Preview tab where the toolbar's\n * actions don't apply (Save would save the *record*, but the cockpit's\n * own Save button saves the *spec*; History/Tags assume a real\n * persistent record, but the preview record can be a synthetic\n * NewRecord). Keeping just the form body produces a clean \"this is\n * what the form looks like\" view.\n */\n @Input() public PreviewMode = false;\n\n /** @deprecated Use {@link PreviewMode}. */\n @Input() public set previewMode(value: InteractiveFormComponent['PreviewMode']) {\n this.PreviewMode = value;\n }\n /** @deprecated Use {@link PreviewMode}. */\n public get previewMode(): InteractiveFormComponent['PreviewMode'] {\n return this.PreviewMode;\n }\n\n /** A full custom entity form replaces the whole form body. */\n public override get OwnsEntireFormBody(): boolean { return true; }\n\n /** FormHostProps passed to the React component. Recomputed when record or mode changes. */\n public FormHostProps: FormHostProps | null = null;\n\n /** @deprecated Use {@link FormHostProps}. */\n public get formHostProps(): FormHostProps | null {\n return this.FormHostProps;\n }\n /** @deprecated Use {@link FormHostProps}. */\n public set formHostProps(value: FormHostProps | null) {\n this.FormHostProps = value;\n }\n\n /** Loaded-spec error (component row missing, JSON parse failure, etc.). */\n private _loadError: string | null = null;\n\n /**\n * Loaded-spec error (component row missing, JSON parse failure,\n * React-runtime bootstrap failure, etc.). Setter auto-emits\n * `LoadErrorChanged` so host surfaces (e.g. Form Builder cockpit\n * Preview tab) can show their own error state — retrospective fix #10.\n */\n public get loadError(): string | null { return this._loadError; }\n public set loadError(v: string | null) {\n if (v === this._loadError) return;\n this._loadError = v;\n this.LoadErrorChanged.emit(v);\n }\n\n @Output() public LoadErrorChanged = new EventEmitter<string | null>();\n\n /** Tracks last-known field snapshot for computing the dirty-field diff on save. */\n private originalSnapshot: Record<string, unknown> = {};\n\n /**\n * Reference to the mounted React component. Used by the SaveRecord /\n * CancelEdit overrides below to invoke the component's registered\n * `RequestSave` / `RequestCancel` methods when the host toolbar fires\n * Save/Cancel — so the single user-visible Save lives on the toolbar\n * (consistent with every other entity form in MJ) and not duplicated\n * inside the form body.\n */\n @ViewChild('reactComponent') public ReactComponent?: MJReactComponent;\n\n /** @deprecated Use {@link ReactComponent}. */\n public get reactComponent(): MJReactComponent | undefined {\n return this.ReactComponent;\n }\n /** @deprecated Use {@link ReactComponent}. */\n public set reactComponent(value: MJReactComponent | undefined) {\n this.ReactComponent = value;\n }\n\n /**\n * Promise resolver populated when `SaveRecord` invokes `RequestSave`\n * on the React component. `handleBeforeSave` resolves it after the\n * BeforeSave-driven entity save completes, so SaveRecord can return\n * a meaningful success boolean and honor `StopEditModeAfterSave`.\n */\n private pendingSaveResolver: ((success: boolean) => void) | null = null;\n\n private readonly changeDetector = inject(ChangeDetectorRef);\n private readonly reactBridge = inject(ReactBridgeService);\n\n public override async ngOnInit(): Promise<void> {\n await super.ngOnInit();\n // Force the React bridge to be initialized BEFORE we let our template\n // mount the `<mj-react-component>` child. Without this, the child's\n // ngAfterViewInit can race the adapter bootstrap and throw \"React\n // runtime not initialized\" — which then prevents the form from\n // rendering and silently breaks the save flow.\n try {\n await this.reactBridge.getReactContext();\n } catch (err) {\n LogError(`InteractiveFormComponent: React bridge bootstrap failed: ${err instanceof Error ? err.message : String(err)}`);\n this.loadError ='React runtime failed to load. Try a hard refresh.';\n return;\n }\n if (this.record) {\n this.originalSnapshot = this.record.GetAll();\n this.rebuildFormHostProps();\n }\n // Mark init complete so the `record` setter rebuilds on subsequent\n // input changes (post-mount record swaps from the Form Builder\n // cockpit preview picker, etc.). Before this flag flips, the setter\n // intentionally does nothing because ngOnInit already handles the\n // initial assignment.\n this._recordInitialized = true;\n // Direct-spec path (artifact viewer) takes precedence; DB fetch only\n // when no spec was supplied and we have an ID to look up.\n if (!this.componentSpec && this.ComponentID) {\n await this.loadComponentSpec();\n }\n }\n\n /**\n * Called by the React component via `mj-react-component`'s `componentEvent`\n * @Output. Maps the form-role event names to BaseEntity operations.\n */\n public async OnReactComponentEvent(event: ReactComponentEvent): Promise<void> {\n switch (event.type) {\n case FormEventNames.BeforeSave:\n await this.handleBeforeSave(event.payload as FormBeforeSaveArgs);\n break;\n case FormEventNames.BeforeDelete:\n await this.handleBeforeDelete(event.payload as FormBeforeDeleteArgs);\n break;\n case FormEventNames.EditModeChangeRequested:\n this.handleEditModeChangeRequested(event.payload as FormEditModeChangeRequestedArgs);\n break;\n // FieldChanged / DirtyStateChanged / ValidationChanged are read-only signals;\n // the wrapper doesn't need to react beyond what the component does internally.\n }\n }\n\n /**\n * Called when the form-role component drills into a related record via\n * `callbacks.OpenEntityRecord(...)`. Relays it upward as a `Navigate` event\n * (the same path normal FK links use) so the host opens the target record.\n */\n public OnOpenEntityRecord(event: { entityName: string; key: CompositeKey }): void {\n this.Navigate.emit({ Kind: 'record', EntityName: event.entityName, PrimaryKey: event.key });\n }\n\n /**\n * Apply the React component's dirty-field diff to the BaseEntity, save,\n * and refresh the snapshot. Errors surface via `LatestResult.CompleteMessage`\n * per the BaseEntity Save contract.\n *\n * Resolves `pendingSaveResolver` if {@link SaveRecord} initiated this\n * flow via the toolbar — so the toolbar can return a meaningful boolean\n * and honor `StopEditModeAfterSave`.\n */\n private async handleBeforeSave(args: FormBeforeSaveArgs): Promise<void> {\n if (args.cancel) {\n this.resolvePendingSave(false);\n return;\n }\n if (!this.record) {\n LogError('InteractiveFormComponent.handleBeforeSave: no record loaded');\n this.resolvePendingSave(false);\n return;\n }\n\n const dirtyEntries = Object.entries(args.dirtyFields ?? {});\n if (dirtyEntries.length === 0 && this.record.IsSaved) {\n // No dirty fields on an already-persisted record — a genuine no-op.\n // Most likely the user clicked Save without changing anything, or the\n // React draft didn't reach the host before RequestSave fired. Surface\n // it so the user sees why their edits didn't land.\n console.warn(\n '[InteractiveFormComponent] BeforeSave fired with no dirtyFields. ' +\n 'Either the user clicked Save without changing anything, or the ' +\n 'React draft did not propagate before save fired.'\n );\n // Skip Save() + rebuildFormHostProps(): re-rendering the React form\n // would re-fire BeforeSave on a form that emits it on mount/render —\n // an infinite re-mount loop that starves the form's async data load\n // (it unmounts before setState commits). Treat it as a no-op.\n //\n // Guard on IsSaved so this only short-circuits existing records. A\n // NEW record with no dirty fields must still fall through to Save()\n // so the insert is attempted (and any validation failure surfaced)\n // rather than masked as a reported success with no row inserted.\n this.resolvePendingSave(true);\n return;\n }\n for (const [fieldName, value] of dirtyEntries) {\n const field = this.record.Fields.find(f =>\n f.Name.trim().toLowerCase() === fieldName.trim().toLowerCase());\n if (field) {\n // Use the canonical field name from the lookup so case\n // mismatches between the React draft and the entity schema\n // don't silently drop the value.\n this.record.Set(field.Name, value);\n } else {\n console.warn(\n `[InteractiveFormComponent] Unknown field \"${fieldName}\" in dirtyFields ` +\n `for entity ${this.record.EntityInfo.Name}. Value not applied.`\n );\n }\n }\n\n const saved = await this.record.Save();\n if (saved) {\n this.originalSnapshot = this.record.GetAll();\n this.rebuildFormHostProps();\n } else {\n LogError(`InteractiveFormComponent: save failed for ${this.record.EntityInfo.Name}: ${this.record.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n this.resolvePendingSave(saved);\n }\n\n private resolvePendingSave(success: boolean): void {\n if (this.pendingSaveResolver) {\n this.pendingSaveResolver(success);\n this.pendingSaveResolver = null;\n }\n }\n\n private async handleBeforeDelete(args: FormBeforeDeleteArgs): Promise<void> {\n if (args.cancel) {\n return;\n }\n if (!this.record) {\n return;\n }\n const deleted = await this.record.Delete();\n if (!deleted) {\n LogError(`InteractiveFormComponent: delete failed for ${this.record.EntityInfo.Name}: ${this.record.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n }\n\n private handleEditModeChangeRequested(args: FormEditModeChangeRequestedArgs): void {\n if (args.cancel) {\n return;\n }\n if (args.requestedMode === 'edit') {\n this.StartEditMode();\n } else {\n this.EndEditMode();\n }\n }\n\n /**\n * Propagate Angular-toolbar-driven mode changes into the React component's\n * `FormHostProps.mode`. Without these overrides, clicking Edit on the\n * `<mj-record-form-container>` toolbar flips `this.EditMode` but the React\n * side still sees `mode: 'view'`.\n */\n public override StartEditMode(): void {\n super.StartEditMode();\n this.rebuildFormHostProps();\n }\n\n public override EndEditMode(): void {\n super.EndEditMode();\n this.rebuildFormHostProps();\n }\n\n /**\n * Toolbar **Save** override. Routes the click through the React\n * component's registered `RequestSave` method so the React layer can\n * (a) run its own validation, (b) flush its draft state, (c) emit\n * `BeforeSave` with the dirty-field diff — exactly the flow the\n * in-form Save button would trigger. The wrapper then awaits the\n * BeforeSave handler via `pendingSaveResolver`, gets a real\n * success/failure boolean, and honors `StopEditModeAfterSave`.\n *\n * Falls back to the base implementation for components that haven't\n * registered `RequestSave` — preserves correctness for forms that\n * keep their own in-form Save button (older sample, hand-authored\n * forms that pre-date this contract).\n */\n public override async SaveRecord(StopEditModeAfterSave: boolean): Promise<boolean> {\n if (!this.ReactComponent?.hasMethod?.(FormMethodNames.RequestSave)) {\n return super.SaveRecord(StopEditModeAfterSave);\n }\n const completion = new Promise<boolean>(resolve => {\n this.pendingSaveResolver = resolve;\n });\n try {\n this.ReactComponent.invokeMethod(FormMethodNames.RequestSave);\n } catch (err) {\n this.pendingSaveResolver = null;\n LogError(`InteractiveFormComponent.SaveRecord: RequestSave threw: ${err instanceof Error ? err.message : String(err)}`);\n return false;\n }\n const success = await completion;\n if (success && StopEditModeAfterSave) {\n this.EndEditMode();\n }\n return success;\n }\n\n /**\n * Toolbar **Cancel** override. Asks the React component to discard\n * its draft via `RequestCancel`, then flips out of edit mode the\n * same way the base implementation would. The React component is\n * expected to (a) clear its local draft state and (b) emit\n * `EditModeChangeRequested({ requestedMode: 'view' })` — though we\n * call `EndEditMode` here directly anyway, so even a no-op handler\n * leaves the form in a coherent state.\n */\n public override CancelEdit(): void {\n if (this.ReactComponent?.hasMethod?.(FormMethodNames.RequestCancel)) {\n try {\n this.ReactComponent.invokeMethod(FormMethodNames.RequestCancel);\n } catch (err) {\n LogError(`InteractiveFormComponent.CancelEdit: RequestCancel threw: ${err instanceof Error ? err.message : String(err)}`);\n }\n // Don't call super.CancelEdit() — base reverts the BaseEntity,\n // but for interactive forms the BaseEntity never received the\n // React draft in the first place, so there's nothing to revert.\n // Just flip mode.\n this.EndEditMode();\n return;\n }\n super.CancelEdit();\n }\n\n /**\n * Resolve the Component row, parse its `Specification`, and surface either\n * the spec or an error. Backed by `InteractiveFormsEngine` (in-memory\n * cache, BaseEntity event-driven invalidation) so this is a sub-ms JS\n * lookup once the engine has loaded — the engine handles freshness\n * via remote-invalidate events, replacing the prior RunView's\n * `BypassCache: true` escape hatch. Falls through to a one-shot\n * RunView only on engine-cache miss (defensive — the engine should\n * always have a Type='Form' Component, but if a brand-new Component\n * was just created on the server and the invalidation event hasn't\n * propagated yet, we still want to render rather than blank-screen).\n */\n private async loadComponentSpec(): Promise<void> {\n if (!this.ComponentID) {\n this.loadError ='No ComponentID provided to InteractiveFormComponent.';\n return;\n }\n try {\n const provider = this.ProviderToUse;\n const user = provider.CurrentUser;\n // Lazy-load the form-metadata cache. No-op when already loaded.\n try {\n await InteractiveFormsEngine.Instance.Config(false, user, provider);\n } catch (err) {\n LogError(`InteractiveFormComponent: InteractiveFormsEngine.Config failed: ${err instanceof Error ? err.message : String(err)}`);\n // Fall through to RunView path below — engine miss isn't fatal.\n }\n\n let specJson: string | null = null;\n let nameForError: string | undefined;\n\n const cached = InteractiveFormsEngine.Instance.FindFormByID(this.ComponentID);\n if (cached) {\n specJson = cached.Specification;\n nameForError = cached.Name;\n } else {\n // Engine miss — one-shot RunView fallback. This covers the\n // narrow window where a freshly-created Component hasn't\n // propagated to the engine yet (cross-process remote-invalidate\n // is debounced ~1.5s). After the propagation lands subsequent\n // form opens hit the cache.\n const rv = RunView.FromMetadataProvider(provider);\n const result = await rv.RunView<{ ID: string; Specification: string; Name: string }>({\n EntityName: 'MJ: Components',\n Fields: ['ID', 'Name', 'Specification'],\n ExtraFilter: `ID='${this.ComponentID}'`,\n MaxRows: 1,\n ResultType: 'simple',\n BypassCache: true,\n }, user);\n if (!result.Success || !result.Results?.length) {\n this.loadError =`Component ${this.ComponentID} not found.`;\n return;\n }\n specJson = result.Results[0].Specification;\n nameForError = result.Results[0].Name;\n }\n\n try {\n this.componentSpec = JSON.parse(specJson ?? 'null') as ComponentSpec;\n } catch (err) {\n this.loadError =`Component ${nameForError ?? this.ComponentID} has invalid Specification JSON: ${err instanceof Error ? err.message : String(err)}`;\n return;\n }\n if (!this.componentSpec) {\n this.loadError =`Component ${nameForError ?? this.ComponentID} has an empty Specification.`;\n return;\n }\n // Validate the spec commits to the form-role contract. We use the\n // helper (whose signature is structural via Pick<>) so this stays\n // robust across ComponentSpec field additions.\n if (!isFormRole(this.componentSpec)) {\n this.loadError =`Component ${nameForError ?? this.ComponentID} does not declare componentRole='form'.`;\n return;\n }\n } finally {\n this.changeDetector.markForCheck();\n }\n }\n\n /**\n * Build `FormHostProps` from the current record + permissions + edit mode.\n * Called whenever the record loads, mode changes, or save completes.\n */\n private rebuildFormHostProps(): void {\n if (!this.record) {\n this.FormHostProps = null;\n return;\n }\n const fields: SimpleEntityFieldInfo[] = this.record.Fields.map(f =>\n SimpleEntityFieldInfo.FromEntityFieldInfo(f.EntityFieldInfo));\n\n const pk = this.record.PrimaryKey;\n const primaryKey: Record<string, unknown> | null = (pk && pk.HasValue)\n ? this.primaryKeyToPlain(pk)\n : null;\n\n this.FormHostProps = {\n entityName: this.record.EntityInfo.Name,\n primaryKey,\n record: this.record.GetAll(),\n entityMetadata: {\n fields,\n displayName: this.record.EntityInfo.DisplayName ?? this.record.EntityInfo.Name,\n nameField: this.record.EntityInfo.NameField?.Name,\n },\n mode: this.EditMode ? 'edit' : (pk && pk.HasValue ? 'view' : 'create'),\n canEdit: this.UserCanEdit,\n canDelete: this.UserCanDelete,\n canCreate: this.UserCanCreate,\n };\n }\n\n private primaryKeyToPlain(pk: CompositeKey): Record<string, unknown> {\n const obj: Record<string, unknown> = {};\n for (const kvp of pk.KeyValuePairs ?? []) {\n obj[kvp.FieldName] = kvp.Value;\n }\n return obj;\n }\n}\n\n/**\n * Tree-shaking guard. Imported and called from public-api.ts so bundlers don't\n * drop the component when no consumer references it by name.\n */\nexport function LoadInteractiveFormComponent(): void {\n // Force the class reference to stay live.\n if (false as boolean) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: unknown = InteractiveFormComponent;\n }\n}\n","@if (record) {\n@if (previewMode) {\n <!-- Preview mode — no toolbar wrap. Just the form body for clean\n \"what the form looks like\" previews (Form Builder cockpit). -->\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form…</span>\n </div>\n }\n} @else {\n<mj-record-form-container\n [Record]=\"record\"\n [FormComponent]=\"this\"\n (Navigate)=\"OnFormNavigate($event)\"\n (DeleteRequested)=\"OnDeleteRequested()\"\n (FavoriteToggled)=\"OnFavoriteToggled()\"\n (HistoryRequested)=\"OnHistoryRequested()\"\n (ListManagementRequested)=\"OnListManagementRequested()\">\n\n <!-- No panel slots: a full custom entity form owns its whole body, so the container\n supplies the toolbar only — no panels and no stock related grids. -->\n\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form…</span>\n </div>\n }\n\n</mj-record-form-container>\n}\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import { EventEmitter, OnChanges, SimpleChanges, OnInit, AfterContentInit, After
|
|
|
2
2
|
import { FormContext, PanelVariant, PanelDragStartEvent, PanelDropEvent } from '../types/form-types';
|
|
3
3
|
import { FormNavigationEvent } from '../types/navigation-events';
|
|
4
4
|
import { MjFormFieldComponent } from '../field/form-field.component';
|
|
5
|
+
import type { BaseFormComponent } from '../base-form-component';
|
|
5
6
|
import { CompositeKey } from '@memberjunction/core';
|
|
6
7
|
import { type FormSectionIndicatorSource } from '../section-indicators/form-section-indicator-coordinator.service';
|
|
7
8
|
import { type FormSectionFieldHost } from '../section-indicators/form-section-field-host';
|
|
@@ -97,6 +98,14 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
97
98
|
FormContext?: FormContext;
|
|
98
99
|
/** Panel visual variant */
|
|
99
100
|
Variant: PanelVariant;
|
|
101
|
+
/**
|
|
102
|
+
* Flex order, for a panel the form's section order does not know about.
|
|
103
|
+
*
|
|
104
|
+
* `getSectionDisplayOrder` answers with the section count for an unknown key, which is
|
|
105
|
+
* the highest order on the form — so a contribution panel rendered anywhere lands last
|
|
106
|
+
* regardless of the slot it mounted in. A slot-derived order is passed here instead.
|
|
107
|
+
*/
|
|
108
|
+
Order: number | null;
|
|
100
109
|
/** Row count badge for related entity sections */
|
|
101
110
|
BadgeCount: number | undefined;
|
|
102
111
|
/** Default expanded state when no persisted state exists */
|
|
@@ -161,6 +170,20 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
161
170
|
DisplayName: string;
|
|
162
171
|
FieldNames: string;
|
|
163
172
|
IsVisible: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* The fields this panel draws, for the contributions that stand in for one and for the
|
|
175
|
+
* composition snapshot the placement dialog reads.
|
|
176
|
+
*
|
|
177
|
+
* Held as fields rather than derived in getters: the field-panel slot treats a new array
|
|
178
|
+
* as a structural change, and a getter would hand it one on every change-detection pass.
|
|
179
|
+
* Recomputed only when the projected fields change.
|
|
180
|
+
*/
|
|
181
|
+
ClaimableFields: Array<{
|
|
182
|
+
Name: string;
|
|
183
|
+
Label: string;
|
|
184
|
+
}>;
|
|
185
|
+
/** Just the names, for the field-panel slot. Same lifetime as {@link ClaimableFields}. */
|
|
186
|
+
ClaimableFieldNames: string[];
|
|
164
187
|
get HostSectionKey(): string;
|
|
165
188
|
get HostVariant(): string;
|
|
166
189
|
get HostIcon(): string;
|
|
@@ -171,6 +194,26 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
171
194
|
get HostDirtyCount(): number;
|
|
172
195
|
get HostErrorCount(): number;
|
|
173
196
|
get HostClass(): string;
|
|
197
|
+
/**
|
|
198
|
+
* The host form, when this panel sits in one.
|
|
199
|
+
*
|
|
200
|
+
* `Form` stays `unknown` because the panel is reused outside a form host; this narrows
|
|
201
|
+
* it for the one place that needs the record and the provider. The import is type-only,
|
|
202
|
+
* so nothing about the runtime dependency direction changes.
|
|
203
|
+
*/
|
|
204
|
+
get FieldPanelForm(): BaseFormComponent | null;
|
|
205
|
+
/** The entity this panel's fields belong to, or '' outside a form. */
|
|
206
|
+
get FieldPanelEntity(): string;
|
|
207
|
+
/** True when a contribution could claim one of this panel's fields. */
|
|
208
|
+
get HostsFieldPanels(): boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Flex order, in precedence: where the user put this panel, then where its host said
|
|
211
|
+
* to put it, then the form's section order.
|
|
212
|
+
*
|
|
213
|
+
* The user's placement comes first so a dragged panel draws where it was dropped. `Order`
|
|
214
|
+
* is a fixed number a host supplies (a contribution panel derives one from its slot); it
|
|
215
|
+
* applies only while the user has not placed the panel.
|
|
216
|
+
*/
|
|
174
217
|
get CssOrder(): number;
|
|
175
218
|
IsDragging: boolean;
|
|
176
219
|
IsDragOver: boolean;
|
|
@@ -283,7 +326,27 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
283
326
|
OnDrop(event: DragEvent): void;
|
|
284
327
|
OnDragStart(event: DragEvent): void;
|
|
285
328
|
OnDragEnd(): void;
|
|
329
|
+
/**
|
|
330
|
+
* Move one panel to another's position and store the result.
|
|
331
|
+
*
|
|
332
|
+
* The list this works on is every panel currently on the form in the order they are
|
|
333
|
+
* drawn, not the form's declared sections. A contribution panel is in no declared
|
|
334
|
+
* section list, so working from that list meant a drag involving one matched no index
|
|
335
|
+
* and returned without doing anything — the handle moved and the form did not.
|
|
336
|
+
*/
|
|
286
337
|
private reorderSections;
|
|
338
|
+
/**
|
|
339
|
+
* Every panel on the form, in the order it is drawn.
|
|
340
|
+
*
|
|
341
|
+
* Ordered by each panel's own `style.order`, which is what CSS lays them out by, so a
|
|
342
|
+
* panel positioned by its slot rather than by the section list still lands in the right
|
|
343
|
+
* place here. Falls back to the declared order when the DOM cannot be read.
|
|
344
|
+
*
|
|
345
|
+
* Searched over descendants of the panels column, not over siblings: a contribution
|
|
346
|
+
* panel is wrapped in its slot host, so it is not a sibling of the baked panels even
|
|
347
|
+
* though it renders among them.
|
|
348
|
+
*/
|
|
349
|
+
private visualPanelOrder;
|
|
287
350
|
/**
|
|
288
351
|
* Field panels whose only children are empty/hidden (e.g. leftover
|
|
289
352
|
* `Details` with just unused geo columns) should not take space.
|
|
@@ -297,6 +360,11 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
297
360
|
MatchesSearch(term: string): boolean;
|
|
298
361
|
private hasRenderableContent;
|
|
299
362
|
private isHiddenByChrome;
|
|
363
|
+
/**
|
|
364
|
+
* Refresh {@link ClaimableFieldNames}, keeping the previous array when the set is
|
|
365
|
+
* unchanged so the field-panel slot does not read a new reference as a new set.
|
|
366
|
+
*/
|
|
367
|
+
private updateClaimableFieldNames;
|
|
300
368
|
private updateFieldNames;
|
|
301
369
|
/**
|
|
302
370
|
* Rebuild the searchable field-name string from the current field set. Rebuilt on structural
|
|
@@ -333,6 +401,6 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
333
401
|
private get allProjectedFieldsDenied();
|
|
334
402
|
private updateVisibilityAndHighlighting;
|
|
335
403
|
static ɵfac: i0.ɵɵFactoryDeclaration<MjCollapsiblePanelComponent, never>;
|
|
336
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MjCollapsiblePanelComponent, "mj-collapsible-panel", never, { "SectionKey": { "alias": "SectionKey"; "required": false; }; "Indicators": { "alias": "Indicators"; "required": false; }; "ValidationSources": { "alias": "ValidationSources"; "required": false; }; "SectionName": { "alias": "SectionName"; "required": false; }; "Icon": { "alias": "Icon"; "required": false; }; "Form": { "alias": "Form"; "required": false; }; "FormContext": { "alias": "FormContext"; "required": false; }; "Variant": { "alias": "Variant"; "required": false; }; "BadgeCount": { "alias": "BadgeCount"; "required": false; }; "DefaultExpanded": { "alias": "DefaultExpanded"; "required": false; }; "InheritedFromEntity": { "alias": "InheritedFromEntity"; "required": false; }; "InheritedRecordPrimaryKey": { "alias": "InheritedRecordPrimaryKey"; "required": false; }; "Hidden": { "alias": "Hidden"; "required": false; }; "_deprecatedSectionKey": { "alias": "sectionKey"; "required": false; }; "_deprecatedSectionName": { "alias": "sectionName"; "required": false; }; "_deprecatedIcon": { "alias": "icon"; "required": false; }; "_deprecatedForm": { "alias": "form"; "required": false; }; "_deprecatedFormContext": { "alias": "formContext"; "required": false; }; }, { "DragStarted": "DragStarted"; "DragEnded": "DragEnded"; "PanelDrop": "PanelDrop"; "Navigate": "Navigate"; }, ["FieldComponents"], ["*"], false, never>;
|
|
404
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MjCollapsiblePanelComponent, "mj-collapsible-panel", never, { "SectionKey": { "alias": "SectionKey"; "required": false; }; "Indicators": { "alias": "Indicators"; "required": false; }; "ValidationSources": { "alias": "ValidationSources"; "required": false; }; "SectionName": { "alias": "SectionName"; "required": false; }; "Icon": { "alias": "Icon"; "required": false; }; "Form": { "alias": "Form"; "required": false; }; "FormContext": { "alias": "FormContext"; "required": false; }; "Variant": { "alias": "Variant"; "required": false; }; "Order": { "alias": "Order"; "required": false; }; "BadgeCount": { "alias": "BadgeCount"; "required": false; }; "DefaultExpanded": { "alias": "DefaultExpanded"; "required": false; }; "InheritedFromEntity": { "alias": "InheritedFromEntity"; "required": false; }; "InheritedRecordPrimaryKey": { "alias": "InheritedRecordPrimaryKey"; "required": false; }; "Hidden": { "alias": "Hidden"; "required": false; }; "_deprecatedSectionKey": { "alias": "sectionKey"; "required": false; }; "_deprecatedSectionName": { "alias": "sectionName"; "required": false; }; "_deprecatedIcon": { "alias": "icon"; "required": false; }; "_deprecatedForm": { "alias": "form"; "required": false; }; "_deprecatedFormContext": { "alias": "formContext"; "required": false; }; }, { "DragStarted": "DragStarted"; "DragEnded": "DragEnded"; "PanelDrop": "PanelDrop"; "Navigate": "Navigate"; }, ["FieldComponents"], ["*"], false, never>;
|
|
337
405
|
}
|
|
338
406
|
//# sourceMappingURL=collapsible-panel.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/panel/collapsible-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EAEtC,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAC3D,SAAS,EAE3B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErG,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAmC,KAAK,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACpJ,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;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,EAAE,MAAM,EAA8B;IAE1F,4CAA4C;IAC5C,IAA0B,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAA+B;IAE7F,qCAAqC;IACrC,IAAmB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAwB;IAExE,qCAAqC;IACrC,IAAmB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAwB;IAEzE,4CAA4C;IAC5C,IAA0B,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAA+B;IAIpG,WAAW,oCAA2C;IACtD,SAAS,qBAA4B;IACrC,SAAS,+BAAsC;IAC/C,QAAQ,oCAA2C;IAIC,eAAe,EAAG,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAEhH;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiD;IAE9E;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAa;IAEjD;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CAAiJ;IAInK,WAAW,SAAM;IACjB,UAAU,SAAM;IAChB,SAAS,UAAQ;IAEjB,IACI,cAAc,IAAI,MAAM,CAE3B;IAED,IACI,WAAW,IAAI,MAAM,CAExB;IAED,IACI,QAAQ,IAAI,MAAM,CAErB;IAED;;;OAGG;IACH,IACI,cAAc,IAAI,MAAM,CAE3B;IAED,IACI,cAAc,IAAI,MAAM,CAE3B;IAED,IACI,SAAS,IAAI,MAAM,CAmBtB;IAED,IACI,QAAQ,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"collapsible-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/panel/collapsible-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EAEtC,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAC3D,SAAS,EAE3B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE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