@memberjunction/ng-base-forms 6.2.0-edge.0 → 6.2.0-edge.2
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/base-form-component.d.ts +34 -0
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +68 -1
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/base-form-section-info.js +5 -5
- package/dist/lib/base-form-section-info.js.map +1 -1
- package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/resolve-form-chrome.js +22 -12
- package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +41 -12
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +476 -378
- 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/explorer-entity-data-grid.component.d.ts +18 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.js +38 -10
- package/dist/lib/explorer-entity-data-grid.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +42 -5
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +118 -23
- 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 +58 -0
- package/dist/lib/form-state.service.d.ts.map +1 -1
- package/dist/lib/form-state.service.js +156 -40
- package/dist/lib/form-state.service.js.map +1 -1
- package/dist/lib/host/entity-form-host.component.d.ts +10 -2
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
- package/dist/lib/host/entity-form-host.component.js +24 -8
- package/dist/lib/host/entity-form-host.component.js.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.d.ts +16 -4
- package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.js +38 -12
- package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-card.component.d.ts +3 -3
- package/dist/lib/isa-related-panel/isa-related-card.component.js +6 -6
- package/dist/lib/isa-related-panel/isa-related-card.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts +3 -3
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +8 -8
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
- package/dist/lib/overlays/form-slide-in.component.d.ts +2 -0
- package/dist/lib/overlays/form-slide-in.component.d.ts.map +1 -1
- package/dist/lib/overlays/form-slide-in.component.js +5 -1
- package/dist/lib/overlays/form-slide-in.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +9 -9
- package/dist/lib/panel/collapsible-panel.component.js +23 -23
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.d.ts +2 -0
- package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.js +5 -1
- package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
- package/dist/lib/panel-slot/form-contribution.d.ts +12 -0
- package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-contribution.js +43 -10
- package/dist/lib/panel-slot/form-contribution.js.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +10 -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 +25 -5
- package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
- 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 +5 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
- package/dist/lib/section-loader-component.d.ts +5 -1
- package/dist/lib/section-loader-component.d.ts.map +1 -1
- package/dist/lib/section-loader-component.js +13 -5
- package/dist/lib/section-loader-component.js.map +1 -1
- package/dist/lib/section-manager/section-manager.component.d.ts +2 -2
- package/dist/lib/section-manager/section-manager.component.js +6 -6
- package/dist/lib/section-manager/section-manager.component.js.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.d.ts +127 -7
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +935 -334
- 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 +7 -0
- package/dist/lib/types/form-types.d.ts.map +1 -1
- package/dist/lib/types/form-types.js +5 -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 +2 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +7 -3
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +20 -18
|
@@ -145,8 +145,24 @@ export class MjEntityFormHostComponent extends BaseAngularComponent {
|
|
|
145
145
|
/** The live form instance, emitted right after it's created (for power-user wiring). */
|
|
146
146
|
FormCreated = new EventEmitter();
|
|
147
147
|
// ── State ───────────────────────────────────────────────────────────────
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
Loading = true;
|
|
149
|
+
/** @deprecated Use {@link Loading}. */
|
|
150
|
+
get loading() {
|
|
151
|
+
return this.Loading;
|
|
152
|
+
}
|
|
153
|
+
/** @deprecated Use {@link Loading}. */
|
|
154
|
+
set loading(value) {
|
|
155
|
+
this.Loading = value;
|
|
156
|
+
}
|
|
157
|
+
ErrorTitle = null;
|
|
158
|
+
/** @deprecated Use {@link ErrorTitle}. */
|
|
159
|
+
get errorTitle() {
|
|
160
|
+
return this.ErrorTitle;
|
|
161
|
+
}
|
|
162
|
+
/** @deprecated Use {@link ErrorTitle}. */
|
|
163
|
+
set errorTitle(value) {
|
|
164
|
+
this.ErrorTitle = value;
|
|
165
|
+
}
|
|
150
166
|
errorDetail = null;
|
|
151
167
|
_formComponentRef = null;
|
|
152
168
|
_sectionRef = null;
|
|
@@ -209,8 +225,8 @@ export class MjEntityFormHostComponent extends BaseAngularComponent {
|
|
|
209
225
|
// ── Core: resolve → load → create → bind → wire ──────────────────────────
|
|
210
226
|
reload() {
|
|
211
227
|
this.teardown();
|
|
212
|
-
this.
|
|
213
|
-
this.
|
|
228
|
+
this.Loading = true;
|
|
229
|
+
this.ErrorTitle = null;
|
|
214
230
|
this.errorDetail = null;
|
|
215
231
|
void this.loadAndMount();
|
|
216
232
|
}
|
|
@@ -264,7 +280,7 @@ export class MjEntityFormHostComponent extends BaseAngularComponent {
|
|
|
264
280
|
this.applyVariants(instance, resolution, entityName);
|
|
265
281
|
this.subscribeToFormEvents(instance);
|
|
266
282
|
this.FormCreated.emit(instance);
|
|
267
|
-
this.
|
|
283
|
+
this.ErrorTitle = null;
|
|
268
284
|
this.errorDetail = null;
|
|
269
285
|
this.LoadComplete.emit();
|
|
270
286
|
}
|
|
@@ -273,7 +289,7 @@ export class MjEntityFormHostComponent extends BaseAngularComponent {
|
|
|
273
289
|
this.fail(`Failed to load ${entityName} record.`, `An unexpected error occurred: ${msg}`);
|
|
274
290
|
}
|
|
275
291
|
finally {
|
|
276
|
-
this.
|
|
292
|
+
this.Loading = false;
|
|
277
293
|
this.cdr.detectChanges();
|
|
278
294
|
}
|
|
279
295
|
}
|
|
@@ -426,9 +442,9 @@ export class MjEntityFormHostComponent extends BaseAngularComponent {
|
|
|
426
442
|
}
|
|
427
443
|
// ── Helpers ───────────────────────────────────────────────────────────────
|
|
428
444
|
fail(title, detail) {
|
|
429
|
-
this.
|
|
445
|
+
this.ErrorTitle = title;
|
|
430
446
|
this.errorDetail = detail;
|
|
431
|
-
this.
|
|
447
|
+
this.Loading = false;
|
|
432
448
|
if (this._formComponentRef) {
|
|
433
449
|
try {
|
|
434
450
|
this._formComponentRef.destroy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-form-host.component.js","sourceRoot":"","sources":["../../../src/lib/host/entity-form-host.component.ts","../../../src/lib/host/entity-form-host.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EACrD,iBAAiB,EAAE,MAAM,EACxC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EAA+B,oBAAoB,EAAE,iBAAiB,EACnF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC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AAyB;mCAKP,gBAAgB;;;;;YC5D/C,2FAAe;YAOf,2FAA8B;YAa9B,2HAAqB;;YApBrB,sCAIC;YAGD,cAMC;YAND,yDAMC;;;iFD0CY,yBAAyB;cANrC,SAAS;6BACI,KAAK,YACP,qBAAqB;;kBAS9B,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kBAM5D,KAAK;;kBAUL,KAAK;;kBAkBL,KAAK;;kBASL,KAAK;;kBAUL,KAAK;;kBAIL,KAAK;;kBAKL,KAAK;;kBAKL,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kFAhGI,yBAAyB","sourcesContent":["import {\n Component, Input, Output, EventEmitter, ViewChild, ViewContainerRef,\n ComponentRef, ChangeDetectorRef, inject, AfterViewInit, OnDestroy, Type\n} from '@angular/core';\nimport {\n CompositeKey, BaseEntity, BaseEntityEvent, FieldValueCollection, EntityFieldTSType\n} from '@memberjunction/core';\nimport { MJGlobal } from '@memberjunction/global';\nimport { Subscription } from 'rxjs';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\nimport { BaseFormComponent } from '../base-form-component';\nimport { BaseFormSectionComponent } from '../base-form-section-component';\nimport { InteractiveFormComponent } from '../interactive-form/interactive-form.component';\nimport { FormResolverService } from '../resolver/form-resolver.service';\nimport { EntityFormConfig } from '../types/entity-form-config';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport {\n FormNotificationEvent, RecordSavedEvent, RecordDeletedEvent,\n RecordSaveFailedEvent, ValidationFailedEvent\n} from '../types/form-types';\n\n/**\n * Presentation-agnostic host that renders ANY MemberJunction entity form —\n * generated (`@RegisterClass` / CodeGen), custom (`*Extended`), or interactive\n * (`EntityFormOverride`) — for a given record.\n *\n * This is the shared core extracted from Explorer's `SingleRecordComponent`. It\n * encapsulates the full lifecycle: **resolve** which form to use (via\n * {@link FormResolverService}, honoring variant overrides) → **load** the\n * record (or accept a pre-loaded one) → **create** the form component\n * dynamically → **bind** record / EditMode / Config / variants → **re-emit**\n * the form's events → **tear down** cleanly.\n *\n * It has ZERO routing and ZERO Explorer dependencies — it only emits events.\n * The surrounding surface (a full-page tab in Explorer, a dialog, or a\n * slide-in) decides what to do with `Navigate`, `Notification`, etc.\n *\n * @example Explorer tab (thin wrapper subscribes + maps to NavigationService)\n * ```html\n * <mj-entity-form-host [EntityName]=\"entityName\" [PrimaryKey]=\"pk\"\n * (Navigate)=\"handleNavigation($event)\" (Saved)=\"onSaved($event)\">\n * </mj-entity-form-host>\n * ```\n *\n * @example Bind a pre-loaded record (dialog/slide-in)\n * ```html\n * <mj-entity-form-host [Record]=\"myEntity\" [Config]=\"DIALOG_FORM_CONFIG\"></mj-entity-form-host>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-form-host',\n templateUrl: './entity-form-host.component.html',\n styleUrls: ['./entity-form-host.component.css'],\n})\nexport class MjEntityFormHostComponent extends BaseAngularComponent implements AfterViewInit, OnDestroy {\n private cdr = inject(ChangeDetectorRef);\n private formResolver = inject(FormResolverService);\n\n /** Anchor for the dynamically-created form component. Always present in the DOM. */\n @ViewChild('anchor', { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n // ── Inputs ──────────────────────────────────────────────────────────────\n\n private _entityName: string | null = null;\n /** Entity name to load a record for. Ignored when {@link Record} is supplied. */\n @Input()\n set EntityName(value: string | null) {\n const changed = this._entityName !== value;\n this._entityName = value;\n if (changed && this._viewInitialized) this.reload();\n }\n get EntityName(): string | null { return this._entityName; }\n\n private _primaryKey: CompositeKey = new CompositeKey();\n /** Primary key of the record to load. Empty key → new record. */\n @Input()\n set PrimaryKey(value: CompositeKey) {\n const changed = !this.compositeKeysEqual(this._primaryKey, value);\n this._primaryKey = value ?? new CompositeKey();\n if (!changed || !this._viewInitialized) return;\n // Skip reload when the incoming key just reflects the current record's now-saved PK\n // (post new-record save rebind). Genuine external swaps still reload.\n if (this._currentRecord && this.compositeKeysEqual(value, this._currentRecord.PrimaryKey)) return;\n this.reload();\n }\n get PrimaryKey(): CompositeKey { return this._primaryKey; }\n\n private _record: BaseEntity | null = null;\n /**\n * Pre-loaded record to bind directly. When supplied, the host skips the\n * load step entirely and mounts the resolved form against this instance —\n * `EntityName`/`PrimaryKey` are not required.\n */\n @Input()\n set Record(value: BaseEntity | null) {\n const changed = this._record !== value;\n this._record = value;\n if (changed && this._viewInitialized) this.reload();\n }\n get Record(): BaseEntity | null { return this._record; }\n\n /** New-record default values: URL-segment string or a plain object. */\n @Input() NewRecordValues: string | Record<string, unknown> | null = null;\n\n /**\n * Render a single registered form **section** (a `BaseFormSectionComponent`\n * registered as `'<EntityName>.<SectionName>'`) instead of the full form.\n * When set, the full-form resolver / variant picker / toolbar container are\n * bypassed — the section component renders its own fields and the host saves\n * the record directly. Used for compact, focused editors (e.g. a quick-edit\n * grid row). Leave null for the normal full-form behavior.\n */\n @Input() SectionName: string | null = null;\n\n private _editMode: boolean | null = null;\n /** Force edit mode. When omitted, new records start in edit, existing in read. */\n @Input()\n set EditMode(value: boolean | null) { this._editMode = value; }\n get EditMode(): boolean | null { return this._editMode; }\n\n /** Per-instance form presentation config (toolbar, sections, width, links). */\n @Input() Config: EntityFormConfig | null = null;\n\n // ── Outputs ─────────────────────────────────────────────────────────────\n\n /** Form navigation request (record link, new record, hierarchy, email, external, dismiss). */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n /** User-facing notification request (success/error/warning/info). */\n @Output() Notification = new EventEmitter<FormNotificationEvent>();\n /** Emitted after the record is successfully saved (carries the live entity). */\n @Output() Saved = new EventEmitter<BaseEntity>();\n /** Re-emitted form `RecordSaved` (richer payload). */\n @Output() RecordSaved = new EventEmitter<RecordSavedEvent>();\n /** Re-emitted form `RecordRefreshed`. */\n @Output() RecordRefreshed = new EventEmitter<BaseEntity>();\n /** Re-emitted form `RecordDeleted`. */\n @Output() RecordDeleted = new EventEmitter<RecordDeletedEvent>();\n /** Re-emitted form `RecordSaveFailed`. */\n @Output() RecordSaveFailed = new EventEmitter<RecordSaveFailedEvent>();\n /** Re-emitted form `ValidationFailed`. */\n @Output() ValidationFailed = new EventEmitter<ValidationFailedEvent>();\n /** Re-emitted form `RecordReady` (record fully initialized). */\n @Output() RecordReady = new EventEmitter<BaseEntity>();\n /** Form asked to be dismissed (e.g. Discard on a brand-new record). */\n @Output() Dismissed = new EventEmitter<void>();\n /** Initial load + mount finished (success path). */\n @Output() LoadComplete = new EventEmitter<void>();\n /** Load failed; carries a user-facing title + detail. */\n @Output() LoadError = new EventEmitter<{ title: string; detail: string }>();\n /** The live form instance, emitted right after it's created (for power-user wiring). */\n @Output() FormCreated = new EventEmitter<BaseFormComponent>();\n\n // ── State ───────────────────────────────────────────────────────────────\n\n public loading = true;\n public errorTitle: string | null = null;\n public errorDetail: string | null = null;\n\n private _formComponentRef: ComponentRef<BaseFormComponent> | null = null;\n private _sectionRef: ComponentRef<BaseFormSectionComponent> | null = null;\n private _isSection = false;\n private _currentRecord: BaseEntity | null = null;\n private _saveHandlerSub: Subscription | null = null;\n private _formEventSubs: Subscription[] = [];\n private _viewInitialized = false;\n\n /** The live form component instance, or null before mount / after teardown. */\n get Form(): BaseFormComponent | null {\n return this._formComponentRef?.instance ?? null;\n }\n\n /** Whether the bound record has unsaved changes. */\n get Dirty(): boolean {\n return this._currentRecord?.Dirty ?? false;\n }\n\n // ── Lifecycle ───────────────────────────────────────────────────────────\n\n ngAfterViewInit(): void {\n this._viewInitialized = true;\n this.reload();\n }\n\n ngOnDestroy(): void {\n this.teardown();\n }\n\n // ── Public API (driven by dialog/slide-in chrome) ─────────────────────────\n\n /**\n * Save the bound record. In full-form mode this runs the form's save\n * pipeline (validation, pending records, notifications); in section mode the\n * section component has no pipeline, so we save the record directly (the\n * record's own save event still drives the `Saved` output).\n */\n async Save(): Promise<boolean> {\n if (this._isSection) {\n return this._currentRecord ? this._currentRecord.Save() : false;\n }\n const f = this.Form;\n if (!f) return false;\n return f.SaveRecord(true);\n }\n\n /** Cancel edits (revert). Full-form mode uses the form's cancel pipeline. */\n Cancel(): void {\n if (this._isSection) {\n if (this._currentRecord?.Dirty) this._currentRecord.Revert();\n return;\n }\n this.Form?.CancelEdit();\n }\n\n /** Refresh the bound record from the database. Full-form mode uses the form's refresh pipeline. */\n async Refresh(): Promise<boolean> {\n if (this._isSection) {\n return this._currentRecord?.IsSaved ? this._currentRecord.Refresh() : false;\n }\n const f = this.Form;\n if (!f) return false;\n return f.RefreshRecord();\n }\n\n // ── Core: resolve → load → create → bind → wire ──────────────────────────\n\n private reload(): void {\n this.teardown();\n this.loading = true;\n this.errorTitle = null;\n this.errorDetail = null;\n void this.loadAndMount();\n }\n\n private async loadAndMount(): Promise<void> {\n const md = this.ProviderToUse;\n // When a pre-loaded record is supplied, derive the entity from it.\n const entityName = this._record?.EntityInfo?.Name ?? this._entityName;\n\n if (!entityName || entityName.trim().length === 0) {\n // Nothing to load yet — a caller will re-invoke once an entity is known.\n return;\n }\n\n try {\n const entity = md.EntityByName(entityName);\n if (!entity) {\n this.fail(`Entity not found: \"${entityName}\"`,\n `This MemberJunction instance has no metadata for entity \"${entityName}\".`);\n return;\n }\n const permissions = entity.GetUserPermisions(md.CurrentUser);\n\n // Section mode short-circuits the full-form resolver / container.\n if (this.SectionName) {\n await this.mountSection(entityName, permissions);\n return;\n }\n\n const resolution = await this.formResolver.ResolveFormForEntity(entity, md.CurrentUser, md);\n if (resolution.kind === 'none') {\n this.fail(`No form is registered for \"${entityName}\".`,\n `No EntityFormOverride or class-based form (@RegisterClass(BaseFormComponent, '${entityName}')) was found. Run CodeGen or register a custom form.`);\n return;\n }\n\n const record = await this.obtainRecord(entityName, md);\n if (!record) return; // fail() already called\n\n // Emit Saved on the record's own save event (covers all save paths).\n this._saveHandlerSub = record.RegisterEventHandler((e: BaseEntityEvent) => {\n if (e.type === 'save') this.Saved.emit(record);\n });\n\n this.anchor.clear();\n const componentRef: ComponentRef<BaseFormComponent> = resolution.kind === 'interactive'\n ? this.anchor.createComponent(InteractiveFormComponent)\n : this.anchor.createComponent(resolution.subClass);\n\n if (resolution.kind === 'interactive') {\n (componentRef as ComponentRef<InteractiveFormComponent>).instance.ComponentID = resolution.override.ComponentID;\n }\n\n this._formComponentRef = componentRef;\n this._currentRecord = record;\n\n const instance = componentRef.instance as BaseFormComponent & { userPermissions?: unknown };\n instance.record = record;\n instance.userPermissions = permissions;\n instance.Config = this.effectiveConfigFor(record);\n instance.EditMode = this._editMode ?? this.Config?.StartInEditMode ?? !record.IsSaved;\n\n this.applyVariants(instance, resolution, entityName);\n this.subscribeToFormEvents(instance);\n\n this.FormCreated.emit(instance);\n this.errorTitle = null;\n this.errorDetail = null;\n this.LoadComplete.emit();\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n this.fail(`Failed to load ${entityName} record.`, `An unexpected error occurred: ${msg}`);\n } finally {\n this.loading = false;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * The config to bind for a given record. For brand-new (unsaved) records we hide the\n * `systemMetadata` section by default — its fields (audit timestamps, IDs, etc.) are\n * empty and irrelevant until the record exists. Doesn't mutate the consumer's config,\n * and defers entirely to a consumer that uses an explicit `VisibleSectionKeys` allowlist.\n */\n private effectiveConfigFor(record: BaseEntity): EntityFormConfig | null {\n if (record.IsSaved) return this.Config;\n if (this.Config?.VisibleSectionKeys?.length) return this.Config; // consumer owns visibility\n const SYSTEM_METADATA_KEY = 'systemMetadata';\n const hidden = this.Config?.HiddenSectionKeys ?? [];\n if (hidden.includes(SYSTEM_METADATA_KEY)) return this.Config;\n return { ...(this.Config ?? {}), HiddenSectionKeys: [...hidden, SYSTEM_METADATA_KEY] };\n }\n\n /**\n * Section mode: resolve a `BaseFormSectionComponent` registered as\n * `'<entity>.<section>'`, mount it, and bind the record. No resolver,\n * variants, container, or form-event surface — section components are bare\n * field editors; the host saves the record directly (see {@link Save}).\n */\n private async mountSection(entityName: string, permissions: unknown): Promise<void> {\n const key = `${entityName}.${this.SectionName}`;\n const reg = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormSectionComponent, key);\n if (!reg?.SubClass) {\n this.fail(`No form section \"${this.SectionName}\" is registered for \"${entityName}\".`,\n `Expected a @RegisterClass(BaseFormSectionComponent, '${key}'). Check the section name.`);\n return;\n }\n\n const record = await this.obtainRecord(entityName);\n if (!record) return;\n\n this._saveHandlerSub = record.RegisterEventHandler((e: BaseEntityEvent) => {\n if (e.type === 'save') this.Saved.emit(record);\n });\n\n this.anchor.clear();\n const ref = this.anchor.createComponent(reg.SubClass as Type<BaseFormSectionComponent>);\n this._sectionRef = ref;\n this._currentRecord = record;\n this._isSection = true;\n\n const instance = ref.instance as BaseFormSectionComponent & { userPermissions?: unknown };\n instance.record = record;\n instance.userPermissions = permissions;\n instance.EditMode = this._editMode ?? this.Config?.StartInEditMode ?? !record.IsSaved;\n\n this.RecordReady.emit(record);\n this.LoadComplete.emit();\n }\n\n /** Resolve the BaseEntity to bind: the supplied instance, or a freshly loaded/new one. */\n private async obtainRecord(entityName: string, md = this.ProviderToUse): Promise<BaseEntity | null> {\n if (this._record) return this._record;\n\n const record = await md.GetEntityObject<BaseEntity>(entityName, md.CurrentUser);\n if (!record) {\n this.fail(`Failed to load ${entityName} record.`, `Unable to instantiate entity \"${entityName}\".`);\n return null;\n }\n\n if (this._primaryKey.HasValue) {\n const loadOk = await record.InnerLoad(this._primaryKey);\n if (!loadOk) {\n this.fail(`Could not load ${entityName} record.`,\n record.LatestResult?.Message\n ? `Server error: ${record.LatestResult.Message}`\n : `InnerLoad returned false for key ${this._primaryKey.ToString()}.`);\n return null;\n }\n } else {\n record.NewRecord();\n this.applyNewRecordValues(record);\n }\n return record;\n }\n\n /** Push variant list + active selection and wire the variant-switch handler. */\n private applyVariants(\n instance: BaseFormComponent,\n resolution: Awaited<ReturnType<FormResolverService['ResolveFormForEntity']>>,\n entityName: string,\n ): void {\n instance.Variants = (resolution.variants ?? [])\n .filter(v => v.Status === 'Active')\n .map(v => ({ ID: v.ID, Label: v.Name ?? `Override ${v.ID.substring(0, 8)}`, Scope: v.Scope, Status: v.Status }));\n instance.CurrentVariantID = resolution.kind === 'interactive' ? resolution.override.ID : null;\n instance.OnVariantChanged = (variantID: string | null) => {\n if (variantID === null) {\n this.formResolver.SetExplicitDefault(entityName);\n } else {\n this.formResolver.SetSelectedVariant(entityName, variantID);\n }\n // Reload via the resolver so tier/priority + the new selection apply.\n this._record = null; // force a fresh load against the new variant\n this.reload();\n };\n }\n\n /** Subscribe to the form's outputs and re-emit them through the host. */\n private subscribeToFormEvents(form: BaseFormComponent): void {\n this.cleanupFormSubs();\n this._formEventSubs.push(\n form.Navigate.subscribe(e => this.Navigate.emit(e)),\n form.Notification.subscribe(e => this.Notification.emit(e)),\n form.RecordSaved.subscribe(e => this.RecordSaved.emit(e)),\n form.RecordRefreshed.subscribe(e => this.RecordRefreshed.emit(e.Record)),\n form.RecordDeleted.subscribe(e => this.RecordDeleted.emit(e)),\n form.RecordSaveFailed.subscribe(e => this.RecordSaveFailed.emit(e)),\n form.ValidationFailed.subscribe(e => this.ValidationFailed.emit(e)),\n form.RecordReady.subscribe(e => this.RecordReady.emit(e)),\n );\n // Surface 'dismiss' navigation as a first-class Dismissed event too.\n this._formEventSubs.push(\n form.Navigate.subscribe(e => { if (e.Kind === 'dismiss') this.Dismissed.emit(); }),\n );\n }\n\n // ── New-record value application (URL segment or object) ──────────────────\n\n private applyNewRecordValues(record: BaseEntity): void {\n if (!this.NewRecordValues) return;\n if (typeof this.NewRecordValues === 'string') {\n if (this.NewRecordValues.length === 0) return;\n const fv = new FieldValueCollection();\n fv.SimpleLoadFromURLSegment(this.NewRecordValues);\n fv.KeyValuePairs\n .filter(kvp => kvp.Value !== null && kvp.Value !== undefined)\n .forEach(kvp => this.setTypedField(record, kvp.FieldName, kvp.Value));\n } else {\n const values = this.NewRecordValues as Record<string, unknown>;\n Object.keys(values)\n .filter(key => values[key] !== null && values[key] !== undefined)\n .forEach(key => this.setTypedField(record, key, values[key]));\n }\n }\n\n /** Set a field with TSType-aware coercion (shared by string + object paths). */\n private setTypedField(record: BaseEntity, fieldName: string, value: unknown): void {\n const f = record.Fields.find(x => x.Name.trim().toLowerCase() === fieldName.trim().toLowerCase());\n if (!f) return;\n switch (f.EntityFieldInfo.TSType) {\n case EntityFieldTSType.String:\n record.Set(fieldName, value?.toString() ?? '');\n break;\n case EntityFieldTSType.Number:\n record.Set(fieldName, typeof value === 'number' ? value : parseFloat(value?.toString() ?? '0'));\n break;\n case EntityFieldTSType.Boolean:\n if (typeof value === 'boolean') record.Set(fieldName, value);\n else if (typeof value === 'string') record.Set(fieldName, value !== 'false' && value !== '0' && value.trim().length > 0);\n else record.Set(fieldName, !!value);\n break;\n case EntityFieldTSType.Date:\n record.Set(fieldName, value instanceof Date ? value : new Date(value?.toString() ?? ''));\n break;\n default:\n record.Set(fieldName, value);\n break;\n }\n }\n\n // ── Helpers ───────────────────────────────────────────────────────────────\n\n private fail(title: string, detail: string): void {\n this.errorTitle = title;\n this.errorDetail = detail;\n this.loading = false;\n if (this._formComponentRef) {\n try { this._formComponentRef.destroy(); } catch { /* noop */ }\n this._formComponentRef = null;\n }\n this.anchor?.clear();\n this.LoadError.emit({ title, detail });\n this.cdr.detectChanges();\n }\n\n private compositeKeysEqual(a: CompositeKey | null | undefined, b: CompositeKey | null | undefined): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n const aKvps = (a.KeyValuePairs || []).filter(kvp => String(kvp.Value ?? '').length > 0);\n const bKvps = (b.KeyValuePairs || []).filter(kvp => String(kvp.Value ?? '').length > 0);\n if (aKvps.length !== bKvps.length) return false;\n for (let i = 0; i < aKvps.length; i++) {\n if (aKvps[i].FieldName !== bKvps[i].FieldName) return false;\n if (String(aKvps[i].Value ?? '') !== String(bKvps[i].Value ?? '')) return false;\n }\n return true;\n }\n\n private cleanupFormSubs(): void {\n for (const sub of this._formEventSubs) sub.unsubscribe();\n this._formEventSubs = [];\n }\n\n private teardown(): void {\n this.cleanupFormSubs();\n if (this._saveHandlerSub) {\n this._saveHandlerSub.unsubscribe();\n this._saveHandlerSub = null;\n }\n if (this._formComponentRef) {\n try { this._formComponentRef.destroy(); } catch { /* noop */ }\n this._formComponentRef = null;\n }\n if (this._sectionRef) {\n try { this._sectionRef.destroy(); } catch { /* noop */ }\n this._sectionRef = null;\n }\n this._isSection = false;\n this._currentRecord = null;\n this.anchor?.clear();\n }\n}\n","<!-- Loading state -->\n@if (loading) {\n <div class=\"mj-form-host-loading\">\n <mj-loading text=\"Loading record...\"></mj-loading>\n </div>\n}\n\n<!-- Error state -->\n@if (!loading && errorTitle) {\n <div class=\"mj-form-host-error\" role=\"alert\">\n <i class=\"fa-solid fa-triangle-exclamation mj-form-host-error-icon\"></i>\n <h3 class=\"mj-form-host-error-title\">{{ errorTitle }}</h3>\n <p class=\"mj-form-host-error-detail\">{{ errorDetail }}</p>\n </div>\n}\n\n<!--\n Anchor for the dynamically-created form component. Always present (static)\n so the ViewContainerRef resolves at AfterViewInit. The form's own template\n carries the <mj-record-form-container>, so nothing wraps it here.\n-->\n<ng-template #anchor></ng-template>\n"]}
|
|
1
|
+
{"version":3,"file":"entity-form-host.component.js","sourceRoot":"","sources":["../../../src/lib/host/entity-form-host.component.ts","../../../src/lib/host/entity-form-host.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EACrD,iBAAiB,EAAE,MAAM,EACxC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EAA+B,oBAAoB,EAAE,iBAAiB,EACnF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,oBAAo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,GAAG,IAAI,CAAC;QAChC,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC;gBAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;YACxD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;IACvB,CAAC;iRApeU,yBAAyB,yBAAzB,yBAAyB;6DAAzB,yBAAyB;mCAKP,gBAAgB;;;;;YC5D/C,2FAAe;YAOf,2FAA8B;YAa9B,2HAAqB;;YApBrB,sCAIC;YAGD,cAMC;YAND,yDAMC;;;iFD0CY,yBAAyB;cANrC,SAAS;6BACI,KAAK,YACP,qBAAqB;;kBAS9B,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kBAM5D,KAAK;;kBAUL,KAAK;;kBAkBL,KAAK;;kBASL,KAAK;;kBAUL,KAAK;;kBAIL,KAAK;;kBAKL,KAAK;;kBAKL,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kFAhGI,yBAAyB","sourcesContent":["import {\n Component, Input, Output, EventEmitter, ViewChild, ViewContainerRef,\n ComponentRef, ChangeDetectorRef, inject, AfterViewInit, OnDestroy, Type\n} from '@angular/core';\nimport {\n CompositeKey, BaseEntity, BaseEntityEvent, FieldValueCollection, EntityFieldTSType\n} from '@memberjunction/core';\nimport { MJGlobal } from '@memberjunction/global';\nimport { Subscription } from 'rxjs';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\nimport { BaseFormComponent } from '../base-form-component';\nimport { BaseFormSectionComponent } from '../base-form-section-component';\nimport { InteractiveFormComponent } from '../interactive-form/interactive-form.component';\nimport { FormResolverService } from '../resolver/form-resolver.service';\nimport { EntityFormConfig } from '../types/entity-form-config';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport {\n FormNotificationEvent, RecordSavedEvent, RecordDeletedEvent,\n RecordSaveFailedEvent, ValidationFailedEvent\n} from '../types/form-types';\n\n/**\n * Presentation-agnostic host that renders ANY MemberJunction entity form —\n * generated (`@RegisterClass` / CodeGen), custom (`*Extended`), or interactive\n * (`EntityFormOverride`) — for a given record.\n *\n * This is the shared core extracted from Explorer's `SingleRecordComponent`. It\n * encapsulates the full lifecycle: **resolve** which form to use (via\n * {@link FormResolverService}, honoring variant overrides) → **load** the\n * record (or accept a pre-loaded one) → **create** the form component\n * dynamically → **bind** record / EditMode / Config / variants → **re-emit**\n * the form's events → **tear down** cleanly.\n *\n * It has ZERO routing and ZERO Explorer dependencies — it only emits events.\n * The surrounding surface (a full-page tab in Explorer, a dialog, or a\n * slide-in) decides what to do with `Navigate`, `Notification`, etc.\n *\n * @example Explorer tab (thin wrapper subscribes + maps to NavigationService)\n * ```html\n * <mj-entity-form-host [EntityName]=\"entityName\" [PrimaryKey]=\"pk\"\n * (Navigate)=\"handleNavigation($event)\" (Saved)=\"onSaved($event)\">\n * </mj-entity-form-host>\n * ```\n *\n * @example Bind a pre-loaded record (dialog/slide-in)\n * ```html\n * <mj-entity-form-host [Record]=\"myEntity\" [Config]=\"DIALOG_FORM_CONFIG\"></mj-entity-form-host>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-form-host',\n templateUrl: './entity-form-host.component.html',\n styleUrls: ['./entity-form-host.component.css'],\n})\nexport class MjEntityFormHostComponent extends BaseAngularComponent implements AfterViewInit, OnDestroy {\n private cdr = inject(ChangeDetectorRef);\n private formResolver = inject(FormResolverService);\n\n /** Anchor for the dynamically-created form component. Always present in the DOM. */\n @ViewChild('anchor', { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n // ── Inputs ──────────────────────────────────────────────────────────────\n\n private _entityName: string | null = null;\n /** Entity name to load a record for. Ignored when {@link Record} is supplied. */\n @Input()\n set EntityName(value: string | null) {\n const changed = this._entityName !== value;\n this._entityName = value;\n if (changed && this._viewInitialized) this.reload();\n }\n get EntityName(): string | null { return this._entityName; }\n\n private _primaryKey: CompositeKey = new CompositeKey();\n /** Primary key of the record to load. Empty key → new record. */\n @Input()\n set PrimaryKey(value: CompositeKey) {\n const changed = !this.compositeKeysEqual(this._primaryKey, value);\n this._primaryKey = value ?? new CompositeKey();\n if (!changed || !this._viewInitialized) return;\n // Skip reload when the incoming key just reflects the current record's now-saved PK\n // (post new-record save rebind). Genuine external swaps still reload.\n if (this._currentRecord && this.compositeKeysEqual(value, this._currentRecord.PrimaryKey)) return;\n this.reload();\n }\n get PrimaryKey(): CompositeKey { return this._primaryKey; }\n\n private _record: BaseEntity | null = null;\n /**\n * Pre-loaded record to bind directly. When supplied, the host skips the\n * load step entirely and mounts the resolved form against this instance —\n * `EntityName`/`PrimaryKey` are not required.\n */\n @Input()\n set Record(value: BaseEntity | null) {\n const changed = this._record !== value;\n this._record = value;\n if (changed && this._viewInitialized) this.reload();\n }\n get Record(): BaseEntity | null { return this._record; }\n\n /** New-record default values: URL-segment string or a plain object. */\n @Input() NewRecordValues: string | Record<string, unknown> | null = null;\n\n /**\n * Render a single registered form **section** (a `BaseFormSectionComponent`\n * registered as `'<EntityName>.<SectionName>'`) instead of the full form.\n * When set, the full-form resolver / variant picker / toolbar container are\n * bypassed — the section component renders its own fields and the host saves\n * the record directly. Used for compact, focused editors (e.g. a quick-edit\n * grid row). Leave null for the normal full-form behavior.\n */\n @Input() SectionName: string | null = null;\n\n private _editMode: boolean | null = null;\n /** Force edit mode. When omitted, new records start in edit, existing in read. */\n @Input()\n set EditMode(value: boolean | null) { this._editMode = value; }\n get EditMode(): boolean | null { return this._editMode; }\n\n /** Per-instance form presentation config (toolbar, sections, width, links). */\n @Input() Config: EntityFormConfig | null = null;\n\n // ── Outputs ─────────────────────────────────────────────────────────────\n\n /** Form navigation request (record link, new record, hierarchy, email, external, dismiss). */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n /** User-facing notification request (success/error/warning/info). */\n @Output() Notification = new EventEmitter<FormNotificationEvent>();\n /** Emitted after the record is successfully saved (carries the live entity). */\n @Output() Saved = new EventEmitter<BaseEntity>();\n /** Re-emitted form `RecordSaved` (richer payload). */\n @Output() RecordSaved = new EventEmitter<RecordSavedEvent>();\n /** Re-emitted form `RecordRefreshed`. */\n @Output() RecordRefreshed = new EventEmitter<BaseEntity>();\n /** Re-emitted form `RecordDeleted`. */\n @Output() RecordDeleted = new EventEmitter<RecordDeletedEvent>();\n /** Re-emitted form `RecordSaveFailed`. */\n @Output() RecordSaveFailed = new EventEmitter<RecordSaveFailedEvent>();\n /** Re-emitted form `ValidationFailed`. */\n @Output() ValidationFailed = new EventEmitter<ValidationFailedEvent>();\n /** Re-emitted form `RecordReady` (record fully initialized). */\n @Output() RecordReady = new EventEmitter<BaseEntity>();\n /** Form asked to be dismissed (e.g. Discard on a brand-new record). */\n @Output() Dismissed = new EventEmitter<void>();\n /** Initial load + mount finished (success path). */\n @Output() LoadComplete = new EventEmitter<void>();\n /** Load failed; carries a user-facing title + detail. */\n @Output() LoadError = new EventEmitter<{ title: string; detail: string }>();\n /** The live form instance, emitted right after it's created (for power-user wiring). */\n @Output() FormCreated = new EventEmitter<BaseFormComponent>();\n\n // ── State ───────────────────────────────────────────────────────────────\n\n public Loading = true;\n\n /** @deprecated Use {@link Loading}. */\n public get loading() {\n return this.Loading;\n }\n /** @deprecated Use {@link Loading}. */\n public set loading(value) {\n this.Loading = value;\n }\n public ErrorTitle: string | null = null;\n\n /** @deprecated Use {@link ErrorTitle}. */\n public get errorTitle(): string | null {\n return this.ErrorTitle;\n }\n /** @deprecated Use {@link ErrorTitle}. */\n public set errorTitle(value: string | null) {\n this.ErrorTitle = value;\n }\n public errorDetail: string | null = null;\n\n private _formComponentRef: ComponentRef<BaseFormComponent> | null = null;\n private _sectionRef: ComponentRef<BaseFormSectionComponent> | null = null;\n private _isSection = false;\n private _currentRecord: BaseEntity | null = null;\n private _saveHandlerSub: Subscription | null = null;\n private _formEventSubs: Subscription[] = [];\n private _viewInitialized = false;\n\n /** The live form component instance, or null before mount / after teardown. */\n get Form(): BaseFormComponent | null {\n return this._formComponentRef?.instance ?? null;\n }\n\n /** Whether the bound record has unsaved changes. */\n get Dirty(): boolean {\n return this._currentRecord?.Dirty ?? false;\n }\n\n // ── Lifecycle ───────────────────────────────────────────────────────────\n\n ngAfterViewInit(): void {\n this._viewInitialized = true;\n this.reload();\n }\n\n ngOnDestroy(): void {\n this.teardown();\n }\n\n // ── Public API (driven by dialog/slide-in chrome) ─────────────────────────\n\n /**\n * Save the bound record. In full-form mode this runs the form's save\n * pipeline (validation, pending records, notifications); in section mode the\n * section component has no pipeline, so we save the record directly (the\n * record's own save event still drives the `Saved` output).\n */\n async Save(): Promise<boolean> {\n if (this._isSection) {\n return this._currentRecord ? this._currentRecord.Save() : false;\n }\n const f = this.Form;\n if (!f) return false;\n return f.SaveRecord(true);\n }\n\n /** Cancel edits (revert). Full-form mode uses the form's cancel pipeline. */\n Cancel(): void {\n if (this._isSection) {\n if (this._currentRecord?.Dirty) this._currentRecord.Revert();\n return;\n }\n this.Form?.CancelEdit();\n }\n\n /** Refresh the bound record from the database. Full-form mode uses the form's refresh pipeline. */\n async Refresh(): Promise<boolean> {\n if (this._isSection) {\n return this._currentRecord?.IsSaved ? this._currentRecord.Refresh() : false;\n }\n const f = this.Form;\n if (!f) return false;\n return f.RefreshRecord();\n }\n\n // ── Core: resolve → load → create → bind → wire ──────────────────────────\n\n private reload(): void {\n this.teardown();\n this.Loading = true;\n this.ErrorTitle = null;\n this.errorDetail = null;\n void this.loadAndMount();\n }\n\n private async loadAndMount(): Promise<void> {\n const md = this.ProviderToUse;\n // When a pre-loaded record is supplied, derive the entity from it.\n const entityName = this._record?.EntityInfo?.Name ?? this._entityName;\n\n if (!entityName || entityName.trim().length === 0) {\n // Nothing to load yet — a caller will re-invoke once an entity is known.\n return;\n }\n\n try {\n const entity = md.EntityByName(entityName);\n if (!entity) {\n this.fail(`Entity not found: \"${entityName}\"`,\n `This MemberJunction instance has no metadata for entity \"${entityName}\".`);\n return;\n }\n const permissions = entity.GetUserPermisions(md.CurrentUser);\n\n // Section mode short-circuits the full-form resolver / container.\n if (this.SectionName) {\n await this.mountSection(entityName, permissions);\n return;\n }\n\n const resolution = await this.formResolver.ResolveFormForEntity(entity, md.CurrentUser, md);\n if (resolution.kind === 'none') {\n this.fail(`No form is registered for \"${entityName}\".`,\n `No EntityFormOverride or class-based form (@RegisterClass(BaseFormComponent, '${entityName}')) was found. Run CodeGen or register a custom form.`);\n return;\n }\n\n const record = await this.obtainRecord(entityName, md);\n if (!record) return; // fail() already called\n\n // Emit Saved on the record's own save event (covers all save paths).\n this._saveHandlerSub = record.RegisterEventHandler((e: BaseEntityEvent) => {\n if (e.type === 'save') this.Saved.emit(record);\n });\n\n this.anchor.clear();\n const componentRef: ComponentRef<BaseFormComponent> = resolution.kind === 'interactive'\n ? this.anchor.createComponent(InteractiveFormComponent)\n : this.anchor.createComponent(resolution.subClass);\n\n if (resolution.kind === 'interactive') {\n (componentRef as ComponentRef<InteractiveFormComponent>).instance.ComponentID = resolution.override.ComponentID;\n }\n\n this._formComponentRef = componentRef;\n this._currentRecord = record;\n\n const instance = componentRef.instance as BaseFormComponent & { userPermissions?: unknown };\n instance.record = record;\n instance.userPermissions = permissions;\n instance.Config = this.effectiveConfigFor(record);\n instance.EditMode = this._editMode ?? this.Config?.StartInEditMode ?? !record.IsSaved;\n\n this.applyVariants(instance, resolution, entityName);\n this.subscribeToFormEvents(instance);\n\n this.FormCreated.emit(instance);\n this.ErrorTitle = null;\n this.errorDetail = null;\n this.LoadComplete.emit();\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n this.fail(`Failed to load ${entityName} record.`, `An unexpected error occurred: ${msg}`);\n } finally {\n this.Loading = false;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * The config to bind for a given record. For brand-new (unsaved) records we hide the\n * `systemMetadata` section by default — its fields (audit timestamps, IDs, etc.) are\n * empty and irrelevant until the record exists. Doesn't mutate the consumer's config,\n * and defers entirely to a consumer that uses an explicit `VisibleSectionKeys` allowlist.\n */\n private effectiveConfigFor(record: BaseEntity): EntityFormConfig | null {\n if (record.IsSaved) return this.Config;\n if (this.Config?.VisibleSectionKeys?.length) return this.Config; // consumer owns visibility\n const SYSTEM_METADATA_KEY = 'systemMetadata';\n const hidden = this.Config?.HiddenSectionKeys ?? [];\n if (hidden.includes(SYSTEM_METADATA_KEY)) return this.Config;\n return { ...(this.Config ?? {}), HiddenSectionKeys: [...hidden, SYSTEM_METADATA_KEY] };\n }\n\n /**\n * Section mode: resolve a `BaseFormSectionComponent` registered as\n * `'<entity>.<section>'`, mount it, and bind the record. No resolver,\n * variants, container, or form-event surface — section components are bare\n * field editors; the host saves the record directly (see {@link Save}).\n */\n private async mountSection(entityName: string, permissions: unknown): Promise<void> {\n const key = `${entityName}.${this.SectionName}`;\n const reg = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormSectionComponent, key);\n if (!reg?.SubClass) {\n this.fail(`No form section \"${this.SectionName}\" is registered for \"${entityName}\".`,\n `Expected a @RegisterClass(BaseFormSectionComponent, '${key}'). Check the section name.`);\n return;\n }\n\n const record = await this.obtainRecord(entityName);\n if (!record) return;\n\n this._saveHandlerSub = record.RegisterEventHandler((e: BaseEntityEvent) => {\n if (e.type === 'save') this.Saved.emit(record);\n });\n\n this.anchor.clear();\n const ref = this.anchor.createComponent(reg.SubClass as Type<BaseFormSectionComponent>);\n this._sectionRef = ref;\n this._currentRecord = record;\n this._isSection = true;\n\n const instance = ref.instance as BaseFormSectionComponent & { userPermissions?: unknown };\n instance.record = record;\n instance.userPermissions = permissions;\n instance.EditMode = this._editMode ?? this.Config?.StartInEditMode ?? !record.IsSaved;\n\n this.RecordReady.emit(record);\n this.LoadComplete.emit();\n }\n\n /** Resolve the BaseEntity to bind: the supplied instance, or a freshly loaded/new one. */\n private async obtainRecord(entityName: string, md = this.ProviderToUse): Promise<BaseEntity | null> {\n if (this._record) return this._record;\n\n const record = await md.GetEntityObject<BaseEntity>(entityName, md.CurrentUser);\n if (!record) {\n this.fail(`Failed to load ${entityName} record.`, `Unable to instantiate entity \"${entityName}\".`);\n return null;\n }\n\n if (this._primaryKey.HasValue) {\n const loadOk = await record.InnerLoad(this._primaryKey);\n if (!loadOk) {\n this.fail(`Could not load ${entityName} record.`,\n record.LatestResult?.Message\n ? `Server error: ${record.LatestResult.Message}`\n : `InnerLoad returned false for key ${this._primaryKey.ToString()}.`);\n return null;\n }\n } else {\n record.NewRecord();\n this.applyNewRecordValues(record);\n }\n return record;\n }\n\n /** Push variant list + active selection and wire the variant-switch handler. */\n private applyVariants(\n instance: BaseFormComponent,\n resolution: Awaited<ReturnType<FormResolverService['ResolveFormForEntity']>>,\n entityName: string,\n ): void {\n instance.Variants = (resolution.variants ?? [])\n .filter(v => v.Status === 'Active')\n .map(v => ({ ID: v.ID, Label: v.Name ?? `Override ${v.ID.substring(0, 8)}`, Scope: v.Scope, Status: v.Status }));\n instance.CurrentVariantID = resolution.kind === 'interactive' ? resolution.override.ID : null;\n instance.OnVariantChanged = (variantID: string | null) => {\n if (variantID === null) {\n this.formResolver.SetExplicitDefault(entityName);\n } else {\n this.formResolver.SetSelectedVariant(entityName, variantID);\n }\n // Reload via the resolver so tier/priority + the new selection apply.\n this._record = null; // force a fresh load against the new variant\n this.reload();\n };\n }\n\n /** Subscribe to the form's outputs and re-emit them through the host. */\n private subscribeToFormEvents(form: BaseFormComponent): void {\n this.cleanupFormSubs();\n this._formEventSubs.push(\n form.Navigate.subscribe(e => this.Navigate.emit(e)),\n form.Notification.subscribe(e => this.Notification.emit(e)),\n form.RecordSaved.subscribe(e => this.RecordSaved.emit(e)),\n form.RecordRefreshed.subscribe(e => this.RecordRefreshed.emit(e.Record)),\n form.RecordDeleted.subscribe(e => this.RecordDeleted.emit(e)),\n form.RecordSaveFailed.subscribe(e => this.RecordSaveFailed.emit(e)),\n form.ValidationFailed.subscribe(e => this.ValidationFailed.emit(e)),\n form.RecordReady.subscribe(e => this.RecordReady.emit(e)),\n );\n // Surface 'dismiss' navigation as a first-class Dismissed event too.\n this._formEventSubs.push(\n form.Navigate.subscribe(e => { if (e.Kind === 'dismiss') this.Dismissed.emit(); }),\n );\n }\n\n // ── New-record value application (URL segment or object) ──────────────────\n\n private applyNewRecordValues(record: BaseEntity): void {\n if (!this.NewRecordValues) return;\n if (typeof this.NewRecordValues === 'string') {\n if (this.NewRecordValues.length === 0) return;\n const fv = new FieldValueCollection();\n fv.SimpleLoadFromURLSegment(this.NewRecordValues);\n fv.KeyValuePairs\n .filter(kvp => kvp.Value !== null && kvp.Value !== undefined)\n .forEach(kvp => this.setTypedField(record, kvp.FieldName, kvp.Value));\n } else {\n const values = this.NewRecordValues as Record<string, unknown>;\n Object.keys(values)\n .filter(key => values[key] !== null && values[key] !== undefined)\n .forEach(key => this.setTypedField(record, key, values[key]));\n }\n }\n\n /** Set a field with TSType-aware coercion (shared by string + object paths). */\n private setTypedField(record: BaseEntity, fieldName: string, value: unknown): void {\n const f = record.Fields.find(x => x.Name.trim().toLowerCase() === fieldName.trim().toLowerCase());\n if (!f) return;\n switch (f.EntityFieldInfo.TSType) {\n case EntityFieldTSType.String:\n record.Set(fieldName, value?.toString() ?? '');\n break;\n case EntityFieldTSType.Number:\n record.Set(fieldName, typeof value === 'number' ? value : parseFloat(value?.toString() ?? '0'));\n break;\n case EntityFieldTSType.Boolean:\n if (typeof value === 'boolean') record.Set(fieldName, value);\n else if (typeof value === 'string') record.Set(fieldName, value !== 'false' && value !== '0' && value.trim().length > 0);\n else record.Set(fieldName, !!value);\n break;\n case EntityFieldTSType.Date:\n record.Set(fieldName, value instanceof Date ? value : new Date(value?.toString() ?? ''));\n break;\n default:\n record.Set(fieldName, value);\n break;\n }\n }\n\n // ── Helpers ───────────────────────────────────────────────────────────────\n\n private fail(title: string, detail: string): void {\n this.ErrorTitle = title;\n this.errorDetail = detail;\n this.Loading = false;\n if (this._formComponentRef) {\n try { this._formComponentRef.destroy(); } catch { /* noop */ }\n this._formComponentRef = null;\n }\n this.anchor?.clear();\n this.LoadError.emit({ title, detail });\n this.cdr.detectChanges();\n }\n\n private compositeKeysEqual(a: CompositeKey | null | undefined, b: CompositeKey | null | undefined): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n const aKvps = (a.KeyValuePairs || []).filter(kvp => String(kvp.Value ?? '').length > 0);\n const bKvps = (b.KeyValuePairs || []).filter(kvp => String(kvp.Value ?? '').length > 0);\n if (aKvps.length !== bKvps.length) return false;\n for (let i = 0; i < aKvps.length; i++) {\n if (aKvps[i].FieldName !== bKvps[i].FieldName) return false;\n if (String(aKvps[i].Value ?? '') !== String(bKvps[i].Value ?? '')) return false;\n }\n return true;\n }\n\n private cleanupFormSubs(): void {\n for (const sub of this._formEventSubs) sub.unsubscribe();\n this._formEventSubs = [];\n }\n\n private teardown(): void {\n this.cleanupFormSubs();\n if (this._saveHandlerSub) {\n this._saveHandlerSub.unsubscribe();\n this._saveHandlerSub = null;\n }\n if (this._formComponentRef) {\n try { this._formComponentRef.destroy(); } catch { /* noop */ }\n this._formComponentRef = null;\n }\n if (this._sectionRef) {\n try { this._sectionRef.destroy(); } catch { /* noop */ }\n this._sectionRef = null;\n }\n this._isSection = false;\n this._currentRecord = null;\n this.anchor?.clear();\n }\n}\n","<!-- Loading state -->\n@if (loading) {\n <div class=\"mj-form-host-loading\">\n <mj-loading text=\"Loading record...\"></mj-loading>\n </div>\n}\n\n<!-- Error state -->\n@if (!loading && errorTitle) {\n <div class=\"mj-form-host-error\" role=\"alert\">\n <i class=\"fa-solid fa-triangle-exclamation mj-form-host-error-icon\"></i>\n <h3 class=\"mj-form-host-error-title\">{{ errorTitle }}</h3>\n <p class=\"mj-form-host-error-detail\">{{ errorDetail }}</p>\n </div>\n}\n\n<!--\n Anchor for the dynamically-created form component. Always present (static)\n so the ViewContainerRef resolves at AfterViewInit. The form's own template\n carries the <mj-record-form-container>, so nothing wraps it here.\n-->\n<ng-template #anchor></ng-template>\n"]}
|
|
@@ -65,9 +65,17 @@ export declare class InteractiveFormComponent extends BaseFormComponent implemen
|
|
|
65
65
|
* NewRecord). Keeping just the form body produces a clean "this is
|
|
66
66
|
* what the form looks like" view.
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
PreviewMode: boolean;
|
|
69
|
+
/** @deprecated Use {@link PreviewMode}. */
|
|
70
|
+
set previewMode(value: InteractiveFormComponent['PreviewMode']);
|
|
71
|
+
/** @deprecated Use {@link PreviewMode}. */
|
|
72
|
+
get previewMode(): InteractiveFormComponent['PreviewMode'];
|
|
69
73
|
/** FormHostProps passed to the React component. Recomputed when record or mode changes. */
|
|
70
|
-
|
|
74
|
+
FormHostProps: FormHostProps | null;
|
|
75
|
+
/** @deprecated Use {@link FormHostProps}. */
|
|
76
|
+
get formHostProps(): FormHostProps | null;
|
|
77
|
+
/** @deprecated Use {@link FormHostProps}. */
|
|
78
|
+
set formHostProps(value: FormHostProps | null);
|
|
71
79
|
/** Loaded-spec error (component row missing, JSON parse failure, etc.). */
|
|
72
80
|
private _loadError;
|
|
73
81
|
/**
|
|
@@ -89,7 +97,11 @@ export declare class InteractiveFormComponent extends BaseFormComponent implemen
|
|
|
89
97
|
* (consistent with every other entity form in MJ) and not duplicated
|
|
90
98
|
* inside the form body.
|
|
91
99
|
*/
|
|
92
|
-
|
|
100
|
+
ReactComponent?: MJReactComponent;
|
|
101
|
+
/** @deprecated Use {@link ReactComponent}. */
|
|
102
|
+
get reactComponent(): MJReactComponent | undefined;
|
|
103
|
+
/** @deprecated Use {@link ReactComponent}. */
|
|
104
|
+
set reactComponent(value: MJReactComponent | undefined);
|
|
93
105
|
/**
|
|
94
106
|
* Promise resolver populated when `SaveRecord` invokes `RequestSave`
|
|
95
107
|
* on the React component. `handleBeforeSave` resolves it after the
|
|
@@ -180,7 +192,7 @@ export declare class InteractiveFormComponent extends BaseFormComponent implemen
|
|
|
180
192
|
private rebuildFormHostProps;
|
|
181
193
|
private primaryKeyToPlain;
|
|
182
194
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveFormComponent, never>;
|
|
183
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveFormComponent, "mj-interactive-form", never, { "record": { "alias": "record"; "required": false; }; "ComponentID": { "alias": "ComponentID"; "required": false; }; "componentSpec": { "alias": "componentSpec"; "required": false; }; "previewMode": { "alias": "previewMode"; "required": false; }; }, { "LoadErrorChanged": "LoadErrorChanged"; }, never, never, false, never>;
|
|
195
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveFormComponent, "mj-interactive-form", never, { "record": { "alias": "record"; "required": false; }; "ComponentID": { "alias": "ComponentID"; "required": false; }; "componentSpec": { "alias": "componentSpec"; "required": false; }; "PreviewMode": { "alias": "PreviewMode"; "required": false; }; "previewMode": { "alias": "previewMode"; "required": false; }; }, { "LoadErrorChanged": "LoadErrorChanged"; }, never, never, false, never>;
|
|
184
196
|
}
|
|
185
197
|
/**
|
|
186
198
|
* Tree-shaking guard. Imported and called from public-api.ts so bundlers don't
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-form.component.d.ts","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,EAAS,SAAS,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E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C;IAgB7E;;;;OAIG;IACI,kBAAkB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI;IAIjF;;;;;;;;OAQG;YACW,gBAAgB;IA4D9B,OAAO,CAAC,kBAAkB;YAOZ,kBAAkB;IAahC,OAAO,CAAC,6BAA6B;IAWrC;;;;;OAKG;IACa,aAAa,IAAI,IAAI;IAKrB,WAAW,IAAI,IAAI;IAKnC;;;;;;;;;;;;;OAaG;IACmB,UAAU,CAAC,qBAAqB,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBlF;;;;;;;;OAQG;IACa,UAAU,IAAI,IAAI;IAiBlC;;;;;;;;;;;OAWG;YACW,iBAAiB;IAoE/B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,iBAAiB;
|
|
1
|
+
{"version":3,"file":"interactive-form.component.d.ts","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,EAAS,SAAS,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EACH,aAAa,EAOhB,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAsB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;AAE3D;;;;;;;;;;;;;;GAcG;AACH,qBAKa,wBAAyB,SAAQ,iBAAkB,YAAW,MAAM,EAAE,SAAS;IAExF;;;;;;;;;OASG;IACH,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,kBAAkB,CAAS;IAEnC,IACoB,MAAM,CAAC,KAAK,EAAE,U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AAqB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB7E;;;;OAIG;IACI,kBAAkB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI;IAIjF;;;;;;;;OAQG;YACW,gBAAgB;IA4D9B,OAAO,CAAC,kBAAkB;YAOZ,kBAAkB;IAahC,OAAO,CAAC,6BAA6B;IAWrC;;;;;OAKG;IACa,aAAa,IAAI,IAAI;IAKrB,WAAW,IAAI,IAAI;IAKnC;;;;;;;;;;;;;OAaG;IACmB,UAAU,CAAC,qBAAqB,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBlF;;;;;;;;OAQG;IACa,UAAU,IAAI,IAAI;IAiBlC;;;;;;;;;;;OAWG;YACW,iBAAiB;IAoE/B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,iBAAiB;yCAnehB,wBAAwB;2CAAxB,wBAAwB;CA0epC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAMnD"}
|
|
@@ -153,9 +153,25 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
153
153
|
* NewRecord). Keeping just the form body produces a clean "this is
|
|
154
154
|
* what the form looks like" view.
|
|
155
155
|
*/
|
|
156
|
-
|
|
156
|
+
PreviewMode = false;
|
|
157
|
+
/** @deprecated Use {@link PreviewMode}. */
|
|
158
|
+
set previewMode(value) {
|
|
159
|
+
this.PreviewMode = value;
|
|
160
|
+
}
|
|
161
|
+
/** @deprecated Use {@link PreviewMode}. */
|
|
162
|
+
get previewMode() {
|
|
163
|
+
return this.PreviewMode;
|
|
164
|
+
}
|
|
157
165
|
/** FormHostProps passed to the React component. Recomputed when record or mode changes. */
|
|
158
|
-
|
|
166
|
+
FormHostProps = null;
|
|
167
|
+
/** @deprecated Use {@link FormHostProps}. */
|
|
168
|
+
get formHostProps() {
|
|
169
|
+
return this.FormHostProps;
|
|
170
|
+
}
|
|
171
|
+
/** @deprecated Use {@link FormHostProps}. */
|
|
172
|
+
set formHostProps(value) {
|
|
173
|
+
this.FormHostProps = value;
|
|
174
|
+
}
|
|
159
175
|
/** Loaded-spec error (component row missing, JSON parse failure, etc.). */
|
|
160
176
|
_loadError = null;
|
|
161
177
|
/**
|
|
@@ -182,7 +198,15 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
182
198
|
* (consistent with every other entity form in MJ) and not duplicated
|
|
183
199
|
* inside the form body.
|
|
184
200
|
*/
|
|
185
|
-
|
|
201
|
+
ReactComponent;
|
|
202
|
+
/** @deprecated Use {@link ReactComponent}. */
|
|
203
|
+
get reactComponent() {
|
|
204
|
+
return this.ReactComponent;
|
|
205
|
+
}
|
|
206
|
+
/** @deprecated Use {@link ReactComponent}. */
|
|
207
|
+
set reactComponent(value) {
|
|
208
|
+
this.ReactComponent = value;
|
|
209
|
+
}
|
|
186
210
|
/**
|
|
187
211
|
* Promise resolver populated when `SaveRecord` invokes `RequestSave`
|
|
188
212
|
* on the React component. `handleBeforeSave` resolves it after the
|
|
@@ -371,14 +395,14 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
371
395
|
* forms that pre-date this contract).
|
|
372
396
|
*/
|
|
373
397
|
async SaveRecord(StopEditModeAfterSave) {
|
|
374
|
-
if (!this.
|
|
398
|
+
if (!this.ReactComponent?.hasMethod?.(FormMethodNames.RequestSave)) {
|
|
375
399
|
return super.SaveRecord(StopEditModeAfterSave);
|
|
376
400
|
}
|
|
377
401
|
const completion = new Promise(resolve => {
|
|
378
402
|
this.pendingSaveResolver = resolve;
|
|
379
403
|
});
|
|
380
404
|
try {
|
|
381
|
-
this.
|
|
405
|
+
this.ReactComponent.invokeMethod(FormMethodNames.RequestSave);
|
|
382
406
|
}
|
|
383
407
|
catch (err) {
|
|
384
408
|
this.pendingSaveResolver = null;
|
|
@@ -401,9 +425,9 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
401
425
|
* leaves the form in a coherent state.
|
|
402
426
|
*/
|
|
403
427
|
CancelEdit() {
|
|
404
|
-
if (this.
|
|
428
|
+
if (this.ReactComponent?.hasMethod?.(FormMethodNames.RequestCancel)) {
|
|
405
429
|
try {
|
|
406
|
-
this.
|
|
430
|
+
this.ReactComponent.invokeMethod(FormMethodNames.RequestCancel);
|
|
407
431
|
}
|
|
408
432
|
catch (err) {
|
|
409
433
|
LogError(`InteractiveFormComponent.CancelEdit: RequestCancel threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -503,7 +527,7 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
503
527
|
*/
|
|
504
528
|
rebuildFormHostProps() {
|
|
505
529
|
if (!this.record) {
|
|
506
|
-
this.
|
|
530
|
+
this.FormHostProps = null;
|
|
507
531
|
return;
|
|
508
532
|
}
|
|
509
533
|
const fields = this.record.Fields.map(f => SimpleEntityFieldInfo.FromEntityFieldInfo(f.EntityFieldInfo));
|
|
@@ -511,7 +535,7 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
511
535
|
const primaryKey = (pk && pk.HasValue)
|
|
512
536
|
? this.primaryKeyToPlain(pk)
|
|
513
537
|
: null;
|
|
514
|
-
this.
|
|
538
|
+
this.FormHostProps = {
|
|
515
539
|
entityName: this.record.EntityInfo.Name,
|
|
516
540
|
primaryKey,
|
|
517
541
|
record: this.record.GetAll(),
|
|
@@ -538,8 +562,8 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
538
562
|
i0.ɵɵviewQuery(_c0, 5);
|
|
539
563
|
} if (rf & 2) {
|
|
540
564
|
let _t;
|
|
541
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
542
|
-
} }, inputs: { record: "record", ComponentID: "ComponentID", componentSpec: "componentSpec", previewMode: "previewMode" }, outputs: { LoadErrorChanged: "LoadErrorChanged" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["reactComponent", ""], [3, "Record", "FormComponent"], ["Variant", "error"], [3, "component", "componentProps"], [1, "mj-loading-state"], [3, "componentEvent", "openEntityRecord", "component", "componentProps"], [1, "fa-solid", "fa-spinner", "fa-spin"], [3, "Navigate", "DeleteRequested", "FavoriteToggled", "HistoryRequested", "ListManagementRequested", "Record", "FormComponent"]], template: function InteractiveFormComponent_Template(rf, ctx) { if (rf & 1) {
|
|
565
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ReactComponent = _t.first);
|
|
566
|
+
} }, inputs: { record: "record", ComponentID: "ComponentID", componentSpec: "componentSpec", PreviewMode: "PreviewMode", previewMode: "previewMode" }, outputs: { LoadErrorChanged: "LoadErrorChanged" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["reactComponent", ""], [3, "Record", "FormComponent"], ["Variant", "error"], [3, "component", "componentProps"], [1, "mj-loading-state"], [3, "componentEvent", "openEntityRecord", "component", "componentProps"], [1, "fa-solid", "fa-spinner", "fa-spin"], [3, "Navigate", "DeleteRequested", "FavoriteToggled", "HistoryRequested", "ListManagementRequested", "Record", "FormComponent"]], template: function InteractiveFormComponent_Template(rf, ctx) { if (rf & 1) {
|
|
543
567
|
i0.ɵɵconditionalCreate(0, InteractiveFormComponent_Conditional_0_Template, 2, 1);
|
|
544
568
|
} if (rf & 2) {
|
|
545
569
|
i0.ɵɵconditional(ctx.record ? 0 : -1);
|
|
@@ -554,11 +578,13 @@ export class InteractiveFormComponent extends BaseFormComponent {
|
|
|
554
578
|
type: Input
|
|
555
579
|
}], componentSpec: [{
|
|
556
580
|
type: Input
|
|
581
|
+
}], PreviewMode: [{
|
|
582
|
+
type: Input
|
|
557
583
|
}], previewMode: [{
|
|
558
584
|
type: Input
|
|
559
585
|
}], LoadErrorChanged: [{
|
|
560
586
|
type: Output
|
|
561
|
-
}],
|
|
587
|
+
}], ReactComponent: [{
|
|
562
588
|
type: ViewChild,
|
|
563
589
|
args: ['reactComponent']
|
|
564
590
|
}] }); })();
|