@memberjunction/ng-base-forms 6.1.0-edge.5 → 6.1.0-edge.6
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/chrome/form-chrome-rail-pref.d.ts +22 -0
- package/dist/lib/chrome/form-chrome-rail-pref.d.ts.map +1 -1
- package/dist/lib/chrome/form-chrome-rail-pref.js +29 -0
- package/dist/lib/chrome/form-chrome-rail-pref.js.map +1 -1
- package/dist/lib/chrome/form-chrome.d.ts +19 -0
- package/dist/lib/chrome/form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/form-chrome.js +26 -0
- package/dist/lib/chrome/form-chrome.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +52 -2
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +485 -161
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts +36 -0
- package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.js +112 -3
- package/dist/lib/explorer-entity-data-grid.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +59 -0
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +710 -294
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/overlays/base-form-overlay.d.ts.map +1 -1
- package/dist/lib/overlays/base-form-overlay.js +3 -1
- package/dist/lib/overlays/base-form-overlay.js.map +1 -1
- package/dist/lib/overlays/form-slide-in.component.js +10 -11
- package/dist/lib/overlays/form-slide-in.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +84 -3
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +253 -37
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.d.ts +12 -0
- package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
- package/dist/lib/related-grid-height.d.ts +48 -11
- package/dist/lib/related-grid-height.d.ts.map +1 -1
- package/dist/lib/related-grid-height.js +53 -12
- package/dist/lib/related-grid-height.js.map +1 -1
- package/dist/lib/section-indicators/form-section-indicator-coordinator.service.d.ts +80 -0
- package/dist/lib/section-indicators/form-section-indicator-coordinator.service.d.ts.map +1 -0
- package/dist/lib/section-indicators/form-section-indicator-coordinator.service.js +99 -0
- package/dist/lib/section-indicators/form-section-indicator-coordinator.service.js.map +1 -0
- package/dist/lib/section-indicators/form-section-indicators.d.ts +97 -0
- package/dist/lib/section-indicators/form-section-indicators.d.ts.map +1 -0
- package/dist/lib/section-indicators/form-section-indicators.js +132 -0
- package/dist/lib/section-indicators/form-section-indicators.js.map +1 -0
- package/dist/lib/section-manager/section-manager.component.js +2 -2
- package/dist/lib/section-manager/section-manager.component.js.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +4 -4
- package/dist/lib/toolbar/form-toolbar.component.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 +25 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-form-overlay.d.ts","sourceRoot":"","sources":["../../../src/lib/overlays/base-form-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,C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,sCAAsC;IAC5B,aAAa,mCAA0C;IACjE,mCAAmC;IACzB,gBAAgB,sCAA6C;IACvE,yCAAyC;IAC/B,gBAAgB,sCAA6C;IACvE,kCAAkC;IACxB,SAAS;eAA6B,MAAM;gBAAU,MAAM;OAAM;IAC5E,qDAAqD;IAC3C,WAAW,kCAAyC;IAI9D,iEAAiE;IAC1D,MAAM,UAAS;IACtB,yEAAyE;IAClE,cAAc,SAAM;IAE3B,8EAA8E;IAC9E,IAAI,YAAY,IAAI,iBAAiB,GAAG,IAAI,CAE3C;IAED,gFAAgF;IAChF,SAAS,KAAK,mBAAmB,IAAI,YAAY,GAAG,SAAS,CAM5D;IAID,gFAAgF;IAC1E,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAUlC,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAKrC,QAAQ,IAAI,IAAI;IAMhB,uEAAuE;IACvE,eAAe,IAAI,IAAI;IAIvB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI;IAa5C,0EAA0E;IAC1E,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;yCAhKjC,eAAe;2CAAf,eAAe;CAyKpC"}
|
|
@@ -109,8 +109,10 @@ export class BaseFormOverlay extends BaseAngularComponent {
|
|
|
109
109
|
get effectivePrimaryKey() {
|
|
110
110
|
if (this.PrimaryKey)
|
|
111
111
|
return this.PrimaryKey;
|
|
112
|
+
// The overlay hosts any entity's form — resolve the key column(s) from EntityName's metadata
|
|
113
|
+
// rather than assuming `ID`. RecordID may be a bare value or a composite segment.
|
|
112
114
|
if (this.RecordID)
|
|
113
|
-
return CompositeKey.
|
|
115
|
+
return CompositeKey.FromURLSegment(this.EntityName ? this.ProviderToUse.EntityByName(this.EntityName) : undefined, this.RecordID);
|
|
114
116
|
return undefined;
|
|
115
117
|
}
|
|
116
118
|
// ── Host event handlers (wired in subclass templates) ─────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
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UAAU,EAAE,IAAI,IAAI,EAAE,CAAC;YAChF,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,OAAO;gBAChC,CAAC,CAAC,GAAG,WAAW,EAAE;gBAClB,CAAC,CAAC,OAAO,WAAW,EAAE,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;IAED,0EAA0E;IAChE,KAAK,CAAC,MAA8B;QAC5C,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;yOAtKmB,eAAe,yBAAf,eAAe;6DAAf,eAAe;;;;;;;iFAAf,eAAe;cADpC,SAAS;;kBAGP,SAAS;mBAAC,MAAM;;kBAKhB,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAML,KAAK;;kBAEL,KAAK;;kBAOL,KAAK;;kBAoBL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAKL,KAAK;;kBAeL,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM","sourcesContent":["import { Directive, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { BaseEntity, CompositeKey } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\nimport { MjEntityFormHostComponent } from '../host/entity-form-host.component';\nimport { EntityFormConfig } from '../types/entity-form-config';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport {\n FormNotificationEvent, RecordDeletedEvent, RecordSaveFailedEvent, ValidationFailedEvent\n} from '../types/form-types';\nimport { BaseFormComponent } from '../base-form-component';\n\n/** How an overlay closed. */\nexport type FormOverlayCloseReason = 'save' | 'cancel';\n\n/**\n * Shared logic for the form overlay shells ({@link MjFormDialogComponent} and\n * {@link MjFormSlideInComponent}). Both wrap an {@link MjEntityFormHostComponent}\n * in chrome that owns the title + Save/Cancel, bubble the host's events upward,\n * and proxy the form inputs downward.\n *\n * Subclasses provide only the template; all input/output plumbing lives here.\n */\n@Directive()\nexport abstract class BaseFormOverlay extends BaseAngularComponent {\n /** Reference to the hosted form (template must name the host `#host`). */\n @ViewChild('host') protected host?: MjEntityFormHostComponent;\n\n // ── Record selection (mirror MjEntityFormHostComponent) ──────────────────\n\n /** Entity name to load. Ignored when {@link Record} is supplied. */\n @Input() EntityName: string | null = null;\n /** Primary key of the record to edit. Empty/absent → new record. */\n @Input() PrimaryKey?: CompositeKey;\n /** Convenience single-column ('ID') key; used when {@link PrimaryKey} is absent. */\n @Input() RecordID?: string;\n /** Pre-loaded record to bind directly (skips load). */\n @Input() Record: BaseEntity | null = null;\n /** New-record default values: URL-segment string or plain object. */\n @Input() NewRecordValues: string | Record<string, unknown> | null = null;\n /**\n * Render a single registered form section (`BaseFormSectionComponent`\n * registered as `'<EntityName>.<SectionName>'`) instead of the full form.\n * See {@link MjEntityFormHostComponent.SectionName}.\n */\n @Input() SectionName: string | null = null;\n /** Force edit mode (default: new → edit, existing → read). */\n @Input() EditMode: boolean | null = null;\n /**\n * Per-instance config OVERRIDE. Treated as a partial set of overrides that is\n * merged **over** the surface's {@link PresetConfig} — so passing\n * `{ StartInEditMode: true }` keeps the preset's `Toolbar: null` etc. instead\n * of replacing the whole preset. Bind the merged result via {@link EffectiveConfig}.\n */\n @Input() Config: EntityFormConfig | null = null;\n\n /**\n * The surface's default config preset (TAB/DIALOG/SLIDEIN). Subclasses override\n * this getter; the base returns an empty object (no defaults).\n */\n protected get PresetConfig(): EntityFormConfig { return {}; }\n\n /**\n * The config actually handed to the form host: the surface {@link PresetConfig}\n * with any consumer {@link Config} overrides merged on top. This is what makes\n * partial configs work — you only specify what differs from the preset.\n */\n get EffectiveConfig(): EntityFormConfig {\n return { ...this.PresetConfig, ...(this.Config ?? {}) };\n }\n\n // ── Chrome ────────────────────────────────────────────────────────────────\n\n /** Title shown in the chrome. When empty, derived from the record on load. */\n @Input() Title = '';\n /** Whether to show the Save/Cancel footer. Default: true. */\n @Input() ShowFooter = true;\n /** Save button label. */\n @Input() SaveButtonText = 'Save';\n /** Cancel button label. */\n @Input() CancelButtonText = 'Cancel';\n\n private _visible = false;\n private _closed = false;\n /** Two-way: whether the overlay is shown. */\n @Input()\n set Visible(value: boolean) {\n if (value !== this._visible) {\n this._visible = value;\n if (value) {\n this._closed = false; // re-arm for the next close\n this.effectiveTitle = this.Title; // section mode has no FormCreated; full mode refines this\n }\n this.VisibleChange.emit(value);\n }\n }\n get Visible(): boolean { return this._visible; }\n\n // ── Outputs ─────────────────────────────────────────────────────────────\n\n @Output() VisibleChange = new EventEmitter<boolean>();\n /** Emitted after a successful save (carries the saved entity). */\n @Output() Saved = new EventEmitter<BaseEntity>();\n /** Emitted when the overlay closes (save or cancel). */\n @Output() Closed = new EventEmitter<FormOverlayCloseReason>();\n /** Re-emitted host navigation requests (consumer decides; chrome never routes). */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n /** Re-emitted host notifications. */\n @Output() Notification = new EventEmitter<FormNotificationEvent>();\n /** Re-emitted host record-deleted. */\n @Output() RecordDeleted = new EventEmitter<RecordDeletedEvent>();\n /** Re-emitted host save-failed. */\n @Output() RecordSaveFailed = new EventEmitter<RecordSaveFailedEvent>();\n /** Re-emitted host validation-failed. */\n @Output() ValidationFailed = new EventEmitter<ValidationFailedEvent>();\n /** Re-emitted host load error. */\n @Output() LoadError = new EventEmitter<{ title: string; detail: string }>();\n /** The live form instance, for power-user wiring. */\n @Output() FormCreated = new EventEmitter<BaseFormComponent>();\n\n // ── State ─────────────────────────────────────────────────────────────────\n\n /** True while a save is in flight (disables the Save button). */\n public saving = false;\n /** Title actually rendered (Title input, or derived from the record). */\n public effectiveTitle = '';\n\n /** The live form component instance (for power-user wiring via MJFormRef). */\n get formInstance(): BaseFormComponent | null {\n return this.host?.Form ?? null;\n }\n\n /** Resolves the primary key to pass to the host (PrimaryKey beats RecordID). */\n protected get effectivePrimaryKey(): CompositeKey | undefined {\n if (this.PrimaryKey) return this.PrimaryKey;\n if (this.RecordID) return CompositeKey.FromID(this.RecordID);\n return undefined;\n }\n\n // ── Host event handlers (wired in subclass templates) ─────────────────────\n\n /** Save via the hosted form. Closing happens on the resulting `Saved` event. */\n async onSaveClick(): Promise<void> {\n if (!this.host) return;\n this.saving = true;\n try {\n await this.host.Save();\n } finally {\n this.saving = false;\n }\n }\n\n onHostSaved(record: BaseEntity): void {\n this.Saved.emit(record);\n this.close('save');\n }\n\n onCancel(): void {\n if (this._closed) return;\n this.host?.Cancel();\n this.close('cancel');\n }\n\n /** Host asked to be dismissed (e.g. Discard on a brand-new record). */\n onHostDismissed(): void {\n this.close('cancel');\n }\n\n onFormCreated(form: BaseFormComponent): void {\n this.FormCreated.emit(form);\n if (!this.Title) {\n const rec = form.record;\n const entityLabel = rec?.EntityInfo?.DisplayName ?? rec?.EntityInfo?.Name ?? '';\n this.effectiveTitle = rec?.IsSaved\n ? `${entityLabel}`\n : `New ${entityLabel}`;\n } else {\n this.effectiveTitle = this.Title;\n }\n }\n\n /** Hide the overlay and emit Closed exactly once per open. Idempotent. */\n protected close(reason: FormOverlayCloseReason): void {\n if (this._closed) return;\n this._closed = true;\n if (this._visible) {\n this._visible = false;\n this.VisibleChange.emit(false);\n }\n this.Closed.emit(reason);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base-form-overlay.js","sourceRoot":"","sources":["../../../src/lib/overlays/base-form-overl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I,CAAC,MAAM,CAAC;YACxB,MAAM,WAAW,GAAG,GAAG,EAAE,UAAU,EAAE,WAAW,IAAI,GAAG,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC;YAChF,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,OAAO;gBAChC,CAAC,CAAC,GAAG,WAAW,EAAE;gBAClB,CAAC,CAAC,OAAO,WAAW,EAAE,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;IAED,0EAA0E;IAChE,KAAK,CAAC,MAA8B;QAC5C,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;yOAxKmB,eAAe,yBAAf,eAAe;6DAAf,eAAe;;;;;;;iFAAf,eAAe;cADpC,SAAS;;kBAGP,SAAS;mBAAC,MAAM;;kBAKhB,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAML,KAAK;;kBAEL,KAAK;;kBAOL,KAAK;;kBAoBL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAKL,KAAK;;kBAeL,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM","sourcesContent":["import { Directive, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { BaseEntity, CompositeKey } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\nimport { MjEntityFormHostComponent } from '../host/entity-form-host.component';\nimport { EntityFormConfig } from '../types/entity-form-config';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport {\n FormNotificationEvent, RecordDeletedEvent, RecordSaveFailedEvent, ValidationFailedEvent\n} from '../types/form-types';\nimport { BaseFormComponent } from '../base-form-component';\n\n/** How an overlay closed. */\nexport type FormOverlayCloseReason = 'save' | 'cancel';\n\n/**\n * Shared logic for the form overlay shells ({@link MjFormDialogComponent} and\n * {@link MjFormSlideInComponent}). Both wrap an {@link MjEntityFormHostComponent}\n * in chrome that owns the title + Save/Cancel, bubble the host's events upward,\n * and proxy the form inputs downward.\n *\n * Subclasses provide only the template; all input/output plumbing lives here.\n */\n@Directive()\nexport abstract class BaseFormOverlay extends BaseAngularComponent {\n /** Reference to the hosted form (template must name the host `#host`). */\n @ViewChild('host') protected host?: MjEntityFormHostComponent;\n\n // ── Record selection (mirror MjEntityFormHostComponent) ──────────────────\n\n /** Entity name to load. Ignored when {@link Record} is supplied. */\n @Input() EntityName: string | null = null;\n /** Primary key of the record to edit. Empty/absent → new record. */\n @Input() PrimaryKey?: CompositeKey;\n /** Convenience single-column ('ID') key; used when {@link PrimaryKey} is absent. */\n @Input() RecordID?: string;\n /** Pre-loaded record to bind directly (skips load). */\n @Input() Record: BaseEntity | null = null;\n /** New-record default values: URL-segment string or plain object. */\n @Input() NewRecordValues: string | Record<string, unknown> | null = null;\n /**\n * Render a single registered form section (`BaseFormSectionComponent`\n * registered as `'<EntityName>.<SectionName>'`) instead of the full form.\n * See {@link MjEntityFormHostComponent.SectionName}.\n */\n @Input() SectionName: string | null = null;\n /** Force edit mode (default: new → edit, existing → read). */\n @Input() EditMode: boolean | null = null;\n /**\n * Per-instance config OVERRIDE. Treated as a partial set of overrides that is\n * merged **over** the surface's {@link PresetConfig} — so passing\n * `{ StartInEditMode: true }` keeps the preset's `Toolbar: null` etc. instead\n * of replacing the whole preset. Bind the merged result via {@link EffectiveConfig}.\n */\n @Input() Config: EntityFormConfig | null = null;\n\n /**\n * The surface's default config preset (TAB/DIALOG/SLIDEIN). Subclasses override\n * this getter; the base returns an empty object (no defaults).\n */\n protected get PresetConfig(): EntityFormConfig { return {}; }\n\n /**\n * The config actually handed to the form host: the surface {@link PresetConfig}\n * with any consumer {@link Config} overrides merged on top. This is what makes\n * partial configs work — you only specify what differs from the preset.\n */\n get EffectiveConfig(): EntityFormConfig {\n return { ...this.PresetConfig, ...(this.Config ?? {}) };\n }\n\n // ── Chrome ────────────────────────────────────────────────────────────────\n\n /** Title shown in the chrome. When empty, derived from the record on load. */\n @Input() Title = '';\n /** Whether to show the Save/Cancel footer. Default: true. */\n @Input() ShowFooter = true;\n /** Save button label. */\n @Input() SaveButtonText = 'Save';\n /** Cancel button label. */\n @Input() CancelButtonText = 'Cancel';\n\n private _visible = false;\n private _closed = false;\n /** Two-way: whether the overlay is shown. */\n @Input()\n set Visible(value: boolean) {\n if (value !== this._visible) {\n this._visible = value;\n if (value) {\n this._closed = false; // re-arm for the next close\n this.effectiveTitle = this.Title; // section mode has no FormCreated; full mode refines this\n }\n this.VisibleChange.emit(value);\n }\n }\n get Visible(): boolean { return this._visible; }\n\n // ── Outputs ─────────────────────────────────────────────────────────────\n\n @Output() VisibleChange = new EventEmitter<boolean>();\n /** Emitted after a successful save (carries the saved entity). */\n @Output() Saved = new EventEmitter<BaseEntity>();\n /** Emitted when the overlay closes (save or cancel). */\n @Output() Closed = new EventEmitter<FormOverlayCloseReason>();\n /** Re-emitted host navigation requests (consumer decides; chrome never routes). */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n /** Re-emitted host notifications. */\n @Output() Notification = new EventEmitter<FormNotificationEvent>();\n /** Re-emitted host record-deleted. */\n @Output() RecordDeleted = new EventEmitter<RecordDeletedEvent>();\n /** Re-emitted host save-failed. */\n @Output() RecordSaveFailed = new EventEmitter<RecordSaveFailedEvent>();\n /** Re-emitted host validation-failed. */\n @Output() ValidationFailed = new EventEmitter<ValidationFailedEvent>();\n /** Re-emitted host load error. */\n @Output() LoadError = new EventEmitter<{ title: string; detail: string }>();\n /** The live form instance, for power-user wiring. */\n @Output() FormCreated = new EventEmitter<BaseFormComponent>();\n\n // ── State ─────────────────────────────────────────────────────────────────\n\n /** True while a save is in flight (disables the Save button). */\n public saving = false;\n /** Title actually rendered (Title input, or derived from the record). */\n public effectiveTitle = '';\n\n /** The live form component instance (for power-user wiring via MJFormRef). */\n get formInstance(): BaseFormComponent | null {\n return this.host?.Form ?? null;\n }\n\n /** Resolves the primary key to pass to the host (PrimaryKey beats RecordID). */\n protected get effectivePrimaryKey(): CompositeKey | undefined {\n if (this.PrimaryKey) return this.PrimaryKey;\n // The overlay hosts any entity's form — resolve the key column(s) from EntityName's metadata\n // rather than assuming `ID`. RecordID may be a bare value or a composite segment.\n if (this.RecordID) return CompositeKey.FromURLSegment(this.EntityName ? this.ProviderToUse.EntityByName(this.EntityName) : undefined, this.RecordID);\n return undefined;\n }\n\n // ── Host event handlers (wired in subclass templates) ─────────────────────\n\n /** Save via the hosted form. Closing happens on the resulting `Saved` event. */\n async onSaveClick(): Promise<void> {\n if (!this.host) return;\n this.saving = true;\n try {\n await this.host.Save();\n } finally {\n this.saving = false;\n }\n }\n\n onHostSaved(record: BaseEntity): void {\n this.Saved.emit(record);\n this.close('save');\n }\n\n onCancel(): void {\n if (this._closed) return;\n this.host?.Cancel();\n this.close('cancel');\n }\n\n /** Host asked to be dismissed (e.g. Discard on a brand-new record). */\n onHostDismissed(): void {\n this.close('cancel');\n }\n\n onFormCreated(form: BaseFormComponent): void {\n this.FormCreated.emit(form);\n if (!this.Title) {\n const rec = form.record;\n const entityLabel = rec?.EntityInfo?.DisplayName ?? rec?.EntityInfo?.Name ?? '';\n this.effectiveTitle = rec?.IsSaved\n ? `${entityLabel}`\n : `New ${entityLabel}`;\n } else {\n this.effectiveTitle = this.Title;\n }\n }\n\n /** Hide the overlay and emit Closed exactly once per open. Idempotent. */\n protected close(reason: FormOverlayCloseReason): void {\n if (this._closed) return;\n this._closed = true;\n if (this._visible) {\n this._visible = false;\n this.VisibleChange.emit(false);\n }\n this.Closed.emit(reason);\n }\n}\n"]}
|
|
@@ -8,25 +8,25 @@ import { SLIDEIN_FORM_CONFIG } from '../types/entity-form-config';
|
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "../host/entity-form-host.component";
|
|
10
10
|
function MjFormSlideInComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
-
const
|
|
11
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
12
12
|
i0.ɵɵelementStart(0, "div", 5)(1, "button", 6);
|
|
13
|
-
i0.ɵɵlistener("click", function MjFormSlideInComponent_Conditional_5_Template_button_click_1_listener() { i0.ɵɵrestoreView(
|
|
13
|
+
i0.ɵɵlistener("click", function MjFormSlideInComponent_Conditional_5_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSaveClick()); });
|
|
14
14
|
i0.ɵɵtext(2);
|
|
15
15
|
i0.ɵɵelementEnd();
|
|
16
16
|
i0.ɵɵelementStart(3, "button", 7);
|
|
17
|
-
i0.ɵɵlistener("click", function MjFormSlideInComponent_Conditional_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(
|
|
17
|
+
i0.ɵɵlistener("click", function MjFormSlideInComponent_Conditional_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
|
|
18
18
|
i0.ɵɵtext(4);
|
|
19
19
|
i0.ɵɵelementEnd()();
|
|
20
20
|
} if (rf & 2) {
|
|
21
|
-
const
|
|
21
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
22
22
|
i0.ɵɵadvance();
|
|
23
|
-
i0.ɵɵproperty("disabled",
|
|
23
|
+
i0.ɵɵproperty("disabled", ctx_r1.saving);
|
|
24
24
|
i0.ɵɵadvance();
|
|
25
|
-
i0.ɵɵtextInterpolate(
|
|
25
|
+
i0.ɵɵtextInterpolate(ctx_r1.SaveButtonText);
|
|
26
26
|
i0.ɵɵadvance();
|
|
27
|
-
i0.ɵɵproperty("disabled",
|
|
27
|
+
i0.ɵɵproperty("disabled", ctx_r1.saving);
|
|
28
28
|
i0.ɵɵadvance();
|
|
29
|
-
i0.ɵɵtextInterpolate(
|
|
29
|
+
i0.ɵɵtextInterpolate(ctx_r1.CancelButtonText);
|
|
30
30
|
} }
|
|
31
31
|
/**
|
|
32
32
|
* Opens any MemberJunction entity form inside a right-edge slide-in panel.
|
|
@@ -78,11 +78,10 @@ export class MjFormSlideInComponent extends BaseFormOverlay {
|
|
|
78
78
|
}
|
|
79
79
|
static ɵfac = /*@__PURE__*/ (() => { let ɵMjFormSlideInComponent_BaseFactory; return function MjFormSlideInComponent_Factory(__ngFactoryType__) { return (ɵMjFormSlideInComponent_BaseFactory || (ɵMjFormSlideInComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MjFormSlideInComponent)))(__ngFactoryType__ || MjFormSlideInComponent); }; })();
|
|
80
80
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MjFormSlideInComponent, selectors: [["mj-form-slide-in"]], inputs: { WidthPx: "WidthPx", Resizable: "Resizable" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 13, consts: [["host", ""], ["Mode", "slide", 3, "WidthChanged", "Closed", "Visible", "Title", "Resizable", "WidthPx"], [1, "mj-form-slide-in-layout"], [1, "mj-form-slide-in-body"], [3, "Saved", "Dismissed", "FormCreated", "Navigate", "Notification", "RecordDeleted", "RecordSaveFailed", "ValidationFailed", "LoadError", "EntityName", "PrimaryKey", "Record", "NewRecordValues", "SectionName", "EditMode", "Config", "Provider"], [1, "mj-form-slide-in-footer"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], ["mjButton", "", 3, "click", "disabled"]], template: function MjFormSlideInComponent_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
82
81
|
i0.ɵɵelementStart(0, "mj-slide-panel", 1);
|
|
83
|
-
i0.ɵɵlistener("WidthChanged", function MjFormSlideInComponent_Template_mj_slide_panel_WidthChanged_0_listener($event) {
|
|
82
|
+
i0.ɵɵlistener("WidthChanged", function MjFormSlideInComponent_Template_mj_slide_panel_WidthChanged_0_listener($event) { return ctx.onWidthChanged($event); })("Closed", function MjFormSlideInComponent_Template_mj_slide_panel_Closed_0_listener() { return ctx.onCancel(); });
|
|
84
83
|
i0.ɵɵelementStart(1, "div", 2)(2, "div", 3)(3, "mj-entity-form-host", 4, 0);
|
|
85
|
-
i0.ɵɵlistener("Saved", function MjFormSlideInComponent_Template_mj_entity_form_host_Saved_3_listener($event) {
|
|
84
|
+
i0.ɵɵlistener("Saved", function MjFormSlideInComponent_Template_mj_entity_form_host_Saved_3_listener($event) { return ctx.onHostSaved($event); })("Dismissed", function MjFormSlideInComponent_Template_mj_entity_form_host_Dismissed_3_listener() { return ctx.onHostDismissed(); })("FormCreated", function MjFormSlideInComponent_Template_mj_entity_form_host_FormCreated_3_listener($event) { return ctx.onFormCreated($event); })("Navigate", function MjFormSlideInComponent_Template_mj_entity_form_host_Navigate_3_listener($event) { return ctx.Navigate.emit($event); })("Notification", function MjFormSlideInComponent_Template_mj_entity_form_host_Notification_3_listener($event) { return ctx.Notification.emit($event); })("RecordDeleted", function MjFormSlideInComponent_Template_mj_entity_form_host_RecordDeleted_3_listener($event) { return ctx.RecordDeleted.emit($event); })("RecordSaveFailed", function MjFormSlideInComponent_Template_mj_entity_form_host_RecordSaveFailed_3_listener($event) { return ctx.RecordSaveFailed.emit($event); })("ValidationFailed", function MjFormSlideInComponent_Template_mj_entity_form_host_ValidationFailed_3_listener($event) { return ctx.ValidationFailed.emit($event); })("LoadError", function MjFormSlideInComponent_Template_mj_entity_form_host_LoadError_3_listener($event) { return ctx.LoadError.emit($event); });
|
|
86
85
|
i0.ɵɵelementEnd()();
|
|
87
86
|
i0.ɵɵconditionalCreate(5, MjFormSlideInComponent_Conditional_5_Template, 5, 4, "div", 5);
|
|
88
87
|
i0.ɵɵelementEnd()();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-slide-in.component.js","sourceRoot":"","sources":["../../../src/lib/overlays/form-slide-in.component.ts","../../../src/lib/overlays/form-slide-in.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;;;;;IC2B1D,AADF,8BAAqC,gBAC4C;IAAxB,0LAAS,oBAAa,KAAC;IAAC,YAAoB;IAAA,iBAAS;IAC5G,iCAA0D;IAArB,0LAAS,iBAAU,KAAC;IAAC,YAAsB;IAClF,AADkF,iBAAS,EACrF;;;IAF+B,cAAmB;IAAnB,wCAAmB;IAAyB,cAAoB;IAApB,2CAAoB;IAClF,cAAmB;IAAnB,wCAAmB;IAAsB,cAAsB;IAAtB,6CAAsB;;AD1BxF;;;;;;;;;;;;;;;;;GAiBG;AAQH,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IACzD,+EAA+E;IACtE,OAAO,GAAG,GAAG,CAAC;IACvB,2CAA2C;IAClC,SAAS,GAAG,IAAI,CAAC;IAE1B,4EAA4E;IAC5E,IAAuB,YAAY,KAAK,OAAO,mBAAmB,CAAC,CAAC,CAAC;IAErE,mEAAmE;IAC3D,WAAW,GAAkB,IAAI,CAAC;IAE1C,QAAQ;QACN,uEAAuE;QACvE,6DAA6D;QAC7D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,IAAI,IAAI,CAAC;QAC5E,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YAClF,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3C,IAAI,EAAE,GAAG,CAAC;gBAAE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IAED,qFAAqF;IACrF,cAAc,CAAC,KAAa;QAC1B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,cAAc,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;IAEO,QAAQ,CAAC,MAAc;QAC7B,OAAO,wBAAwB,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;IACxD,CAAC;qQAjCU,sBAAsB,yBAAtB,sBAAsB;6DAAtB,sBAAsB
|
|
1
|
+
{"version":3,"file":"form-slide-in.component.js","sourceRoot":"","sources":["../../../src/lib/overlays/form-slide-in.component.ts","../../../src/lib/overlays/form-slide-in.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MA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BAAqB,EAAE,iBAAiB;;iFAItE,sBAAsB;cAPlC,SAAS;6BACI,IAAI,YACN,kBAAkB,WACnB,CAAC,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,CAAC;;kBAMjF,KAAK;;kBAEL,KAAK;;kFAJK,sBAAsB","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MjSlidePanelComponent, MJButtonDirective } from '@memberjunction/ng-ui-components';\nimport { UserInfoEngine } from '@memberjunction/core-entities';\n\nimport { BaseFormsModule } from '../../module';\nimport { BaseFormOverlay } from './base-form-overlay';\nimport { SLIDEIN_FORM_CONFIG } from '../types/entity-form-config';\n\n/**\n * Opens any MemberJunction entity form inside a right-edge slide-in panel.\n *\n * Wraps {@link MjEntityFormHostComponent} in `<mj-slide-panel>` (resizable) with\n * a sticky Save/Cancel footer. Defaults to {@link SLIDEIN_FORM_CONFIG} (no in-form\n * toolbar, related grids hidden, full-width body, in-form links inert).\n *\n * Standalone — import it directly:\n * ```typescript\n * import { MjFormSlideInComponent } from '@memberjunction/ng-base-forms';\n * ```\n *\n * @example Declarative\n * ```html\n * <mj-form-slide-in [EntityName]=\"'MJ: Credentials'\" [Record]=\"cred\"\n * [(Visible)]=\"open\" (Saved)=\"refresh()\"></mj-form-slide-in>\n * ```\n */\n@Component({\n standalone: true,\n selector: 'mj-form-slide-in',\n imports: [CommonModule, BaseFormsModule, MjSlidePanelComponent, MJButtonDirective],\n templateUrl: './form-slide-in.component.html',\n styleUrls: ['./form-slide-in.component.css'],\n})\nexport class MjFormSlideInComponent extends BaseFormOverlay implements OnInit {\n /** Initial panel width in px (resizable by the user; persisted per-entity). */\n @Input() WidthPx = 720;\n /** Whether the panel is user-resizable. */\n @Input() Resizable = true;\n\n /** Form config. Defaults to the slide-in preset; consumers can override. */\n protected override get PresetConfig() { return SLIDEIN_FORM_CONFIG; }\n\n /** Entity used to scope the persisted width (resolved on init). */\n private widthEntity: string | null = null;\n\n ngOnInit(): void {\n // Resolve the entity up-front so we can restore the user's saved width\n // before the panel animates in (avoids a mid-render resize).\n this.widthEntity = this.EntityName ?? this.Record?.EntityInfo?.Name ?? null;\n if (this.widthEntity) {\n const saved = UserInfoEngine.Instance.GetSetting(this.widthKey(this.widthEntity));\n const px = saved ? parseInt(saved, 10) : 0;\n if (px > 0) this.WidthPx = px;\n }\n }\n\n /** Persist the user's resize, scoped per-entity (cross-device via User Settings). */\n onWidthChanged(width: number): void {\n this.WidthPx = width;\n if (this.widthEntity) {\n UserInfoEngine.Instance.SetSettingDebounced(this.widthKey(this.widthEntity), String(width));\n }\n }\n\n private widthKey(entity: string): string {\n return `mj.formSlideIn.width.${entity.toLowerCase()}`;\n }\n}\n","<mj-slide-panel\n Mode=\"slide\"\n [Visible]=\"Visible\"\n [Title]=\"effectiveTitle\"\n [Resizable]=\"Resizable\"\n [WidthPx]=\"WidthPx\"\n (WidthChanged)=\"onWidthChanged($event)\"\n (Closed)=\"onCancel()\">\n\n <div class=\"mj-form-slide-in-layout\">\n <div class=\"mj-form-slide-in-body\">\n <mj-entity-form-host #host\n [EntityName]=\"EntityName\"\n [PrimaryKey]=\"effectivePrimaryKey!\"\n [Record]=\"Record\"\n [NewRecordValues]=\"NewRecordValues\"\n [SectionName]=\"SectionName\"\n [EditMode]=\"EditMode\"\n [Config]=\"EffectiveConfig\"\n [Provider]=\"Provider\"\n (Saved)=\"onHostSaved($event)\"\n (Dismissed)=\"onHostDismissed()\"\n (FormCreated)=\"onFormCreated($event)\"\n (Navigate)=\"Navigate.emit($event)\"\n (Notification)=\"Notification.emit($event)\"\n (RecordDeleted)=\"RecordDeleted.emit($event)\"\n (RecordSaveFailed)=\"RecordSaveFailed.emit($event)\"\n (ValidationFailed)=\"ValidationFailed.emit($event)\"\n (LoadError)=\"LoadError.emit($event)\">\n </mj-entity-form-host>\n </div>\n\n @if (ShowFooter) {\n <div class=\"mj-form-slide-in-footer\">\n <button mjButton variant=\"primary\" [disabled]=\"saving\" (click)=\"onSaveClick()\">{{ SaveButtonText }}</button>\n <button mjButton [disabled]=\"saving\" (click)=\"onCancel()\">{{ CancelButtonText }}</button>\n </div>\n }\n </div>\n</mj-slide-panel>\n"]}
|
|
@@ -3,6 +3,8 @@ import { FormContext, PanelVariant, PanelDragStartEvent, PanelDropEvent } from '
|
|
|
3
3
|
import { FormNavigationEvent } from '../types/navigation-events';
|
|
4
4
|
import { MjFormFieldComponent } from '../field/form-field.component';
|
|
5
5
|
import { CompositeKey } from '@memberjunction/core';
|
|
6
|
+
import { type FormSectionIndicatorSource } from '../section-indicators/form-section-indicator-coordinator.service';
|
|
7
|
+
import { type FormSectionIndicators, type ParsedValidationSource } from '../section-indicators/form-section-indicators';
|
|
6
8
|
import * as i0 from "@angular/core";
|
|
7
9
|
/**
|
|
8
10
|
* Reusable collapsible panel for form sections.
|
|
@@ -18,6 +20,10 @@ import * as i0 from "@angular/core";
|
|
|
18
20
|
* - Drag-to-reorder sections
|
|
19
21
|
* - Inheritable "Inherited from X" badge with navigation event
|
|
20
22
|
* - Row count badge for related entity sections
|
|
23
|
+
* - Section indicators: an unsaved-changes dot and an invalid-field count derived
|
|
24
|
+
* live from the projected `mj-form-field`s (plus anything a custom section
|
|
25
|
+
* supplies through `[Indicators]`), published to the form's chrome rail
|
|
26
|
+
* through {@link FormSectionIndicatorCoordinator}
|
|
21
27
|
*
|
|
22
28
|
* @example
|
|
23
29
|
* ```html
|
|
@@ -34,13 +40,38 @@ import * as i0 from "@angular/core";
|
|
|
34
40
|
* </mj-collapsible-panel>
|
|
35
41
|
* ```
|
|
36
42
|
*/
|
|
37
|
-
export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy {
|
|
43
|
+
export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy, FormSectionIndicatorSource {
|
|
38
44
|
private cdr;
|
|
39
45
|
private elementRef;
|
|
40
46
|
private ngZone;
|
|
41
47
|
private chrome;
|
|
48
|
+
private indicators;
|
|
42
49
|
/** Unique key for state persistence */
|
|
43
50
|
SectionKey: string;
|
|
51
|
+
/**
|
|
52
|
+
* Indicator counts a custom section supplies for content that is NOT rendered by
|
|
53
|
+
* `mj-form-field` — a designer, an inline grid, a hand-built editor. Added to the
|
|
54
|
+
* counts this panel derives from its own fields, so a section that mixes both
|
|
55
|
+
* reports the union. Omit for ordinary field panels: their state is derived.
|
|
56
|
+
*
|
|
57
|
+
* ```html
|
|
58
|
+
* <mj-collapsible-panel SectionKey="lines" [Indicators]="{ DirtyCount: LineEditor.EditedRows, ErrorCount: LineEditor.InvalidRows }">
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
Indicators?: Partial<FormSectionIndicators> | null;
|
|
62
|
+
/**
|
|
63
|
+
* Graph-path collection names whose validation failures belong to THIS panel —
|
|
64
|
+
* `ValidationSources="Modifications"` claims `Modifications[2].ProvisionID`.
|
|
65
|
+
*
|
|
66
|
+
* Only needed when a panel hosts a child collection whose path name differs from
|
|
67
|
+
* its `SectionKey`: plain field failures are joined automatically from the panel's
|
|
68
|
+
* `mj-form-field` children, and a graph path whose leading segment already matches
|
|
69
|
+
* the `SectionKey` is claimed without any declaration. Declared HERE, on the panel
|
|
70
|
+
* that owns the collection, rather than in an app-side `fieldName -> sectionKey`
|
|
71
|
+
* map that duplicates a fact the panel owns and drifts silently when a
|
|
72
|
+
* `SectionKey` is renamed. Accepts a single name or a list.
|
|
73
|
+
*/
|
|
74
|
+
ValidationSources?: string | readonly string[] | null;
|
|
44
75
|
/** Display name shown in the panel header */
|
|
45
76
|
SectionName: string;
|
|
46
77
|
/** Font Awesome icon class for the panel header */
|
|
@@ -99,6 +130,12 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
99
130
|
get HostSectionKey(): string;
|
|
100
131
|
get HostVariant(): string;
|
|
101
132
|
get HostIcon(): string;
|
|
133
|
+
/**
|
|
134
|
+
* Indicator counts mirrored onto the host element, so CSS and any DOM sweep can
|
|
135
|
+
* read a section's state without a component reference.
|
|
136
|
+
*/
|
|
137
|
+
get HostDirtyCount(): number;
|
|
138
|
+
get HostErrorCount(): number;
|
|
102
139
|
get HostClass(): string;
|
|
103
140
|
get CssOrder(): number;
|
|
104
141
|
IsDragging: boolean;
|
|
@@ -131,6 +168,48 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
131
168
|
get Collapsible(): boolean;
|
|
132
169
|
/** Whether the panel is expanded (delegates to form state; always true when not collapsible) */
|
|
133
170
|
get Expanded(): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Live state of this section: fields edited since the last save, fields that are
|
|
173
|
+
* invalid or required-and-empty, and fields carrying warnings. Derived from the
|
|
174
|
+
* projected `mj-form-field`s on every read — the same state those fields use for
|
|
175
|
+
* their own amber dot and red underline, so the section can never disagree with
|
|
176
|
+
* its fields — plus graph-path validation failures this section claims, plus
|
|
177
|
+
* whatever a custom section supplies through `[Indicators]`.
|
|
178
|
+
*
|
|
179
|
+
* Read during change detection (host bindings, the header template, the rail via
|
|
180
|
+
* the coordinator). Pure and cheap: one pass over the field list.
|
|
181
|
+
*/
|
|
182
|
+
get SectionIndicators(): FormSectionIndicators;
|
|
183
|
+
get SectionDirtyCount(): number;
|
|
184
|
+
get SectionErrorCount(): number;
|
|
185
|
+
get SectionWarningCount(): number;
|
|
186
|
+
get SectionDirtyTitle(): string;
|
|
187
|
+
get SectionErrorTitle(): string;
|
|
188
|
+
get SectionWarningTitle(): string;
|
|
189
|
+
/** {@link FormSectionIndicatorSource} — the rail reads this through the coordinator. */
|
|
190
|
+
GetSectionIndicators(): FormSectionIndicators;
|
|
191
|
+
/** {@link FormSectionIndicatorSource} — whether a form-level error belongs to this section. */
|
|
192
|
+
OwnsValidationSource(source: ParsedValidationSource): boolean;
|
|
193
|
+
/** Normalized {@link ValidationSources}. */
|
|
194
|
+
get ValidationCollectionNames(): string[];
|
|
195
|
+
/** Field names this panel renders — the join between a plain-field error and this section. */
|
|
196
|
+
private renderedFieldNames;
|
|
197
|
+
private validationScope;
|
|
198
|
+
/**
|
|
199
|
+
* Counts of FIELDS (not messages) in each state. A field is invalid when it shows a
|
|
200
|
+
* failure OR is required and empty in edit mode — exactly the two conditions that
|
|
201
|
+
* paint its underline red. Warnings count only on fields with no failure, mirroring
|
|
202
|
+
* `MjFormFieldComponent.ShowWarnings`.
|
|
203
|
+
*/
|
|
204
|
+
private fieldIndicators;
|
|
205
|
+
/**
|
|
206
|
+
* Graph-path failures (`Lines[2].Amount`) this section owns, once the form has asked
|
|
207
|
+
* for validation to show. Plain field-name failures are NOT counted here — the field
|
|
208
|
+
* that renders them already reports through {@link fieldIndicators}.
|
|
209
|
+
*/
|
|
210
|
+
private claimedGraphErrors;
|
|
211
|
+
/** (Re)declare this section with the container-scoped registry the rail reads. */
|
|
212
|
+
private registerIndicatorSource;
|
|
134
213
|
ngOnInit(): void;
|
|
135
214
|
ngAfterContentInit(): void;
|
|
136
215
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -165,7 +244,9 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
165
244
|
private UpdateFieldNames;
|
|
166
245
|
/**
|
|
167
246
|
* Subscribes to Navigate events from all child form-field components
|
|
168
|
-
* and relays them through this panel's Navigate output.
|
|
247
|
+
* and relays them through this panel's Navigate output. Also listens for
|
|
248
|
+
* value edits so the section indicators (and the rail reading them) refresh
|
|
249
|
+
* on the same tick as the keystroke rather than on the container's next poll.
|
|
169
250
|
*/
|
|
170
251
|
private SubscribeToFieldNavigateEvents;
|
|
171
252
|
/**
|
|
@@ -179,6 +260,6 @@ export declare class MjCollapsiblePanelComponent implements OnInit, OnChanges, A
|
|
|
179
260
|
private DebouncePersistHeight;
|
|
180
261
|
private UpdateVisibilityAndHighlighting;
|
|
181
262
|
static ɵfac: i0.ɵɵFactoryDeclaration<MjCollapsiblePanelComponent, never>;
|
|
182
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MjCollapsiblePanelComponent, "mj-collapsible-panel", never, { "SectionKey": { "alias": "SectionKey"; "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>;
|
|
263
|
+
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>;
|
|
183
264
|
}
|
|
184
265
|
//# 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;;
|
|
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,C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