@memberjunction/ng-base-forms 6.1.4 → 6.2.0-edge.1

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.
Files changed (103) hide show
  1. package/dist/lib/base-form-component.d.ts.map +1 -1
  2. package/dist/lib/base-form-component.js +43 -40
  3. package/dist/lib/base-form-component.js.map +1 -1
  4. package/dist/lib/base-form-section-info.js +5 -5
  5. package/dist/lib/base-form-section-info.js.map +1 -1
  6. package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
  7. package/dist/lib/chrome/resolve-form-chrome.js +22 -12
  8. package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
  9. package/dist/lib/container/record-form-container.component.d.ts +24 -13
  10. package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
  11. package/dist/lib/container/record-form-container.component.js +233 -182
  12. package/dist/lib/container/record-form-container.component.js.map +1 -1
  13. package/dist/lib/explorer-entity-data-grid.component.d.ts +32 -2
  14. package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
  15. package/dist/lib/explorer-entity-data-grid.component.js +54 -13
  16. package/dist/lib/explorer-entity-data-grid.component.js.map +1 -1
  17. package/dist/lib/field/default-fk-lookup-strategy.d.ts +60 -0
  18. package/dist/lib/field/default-fk-lookup-strategy.d.ts.map +1 -0
  19. package/dist/lib/field/default-fk-lookup-strategy.js +173 -0
  20. package/dist/lib/field/default-fk-lookup-strategy.js.map +1 -0
  21. package/dist/lib/field/fk-lookup-strategy.d.ts +124 -0
  22. package/dist/lib/field/fk-lookup-strategy.d.ts.map +1 -0
  23. package/dist/lib/field/fk-lookup-strategy.js +97 -0
  24. package/dist/lib/field/fk-lookup-strategy.js.map +1 -0
  25. package/dist/lib/field/fk-search-utils.d.ts +33 -2
  26. package/dist/lib/field/fk-search-utils.d.ts.map +1 -1
  27. package/dist/lib/field/fk-search-utils.js +56 -3
  28. package/dist/lib/field/fk-search-utils.js.map +1 -1
  29. package/dist/lib/field/form-field.component.d.ts +166 -11
  30. package/dist/lib/field/form-field.component.d.ts.map +1 -1
  31. package/dist/lib/field/form-field.component.js +742 -338
  32. package/dist/lib/field/form-field.component.js.map +1 -1
  33. package/dist/lib/field/linked-field-options.d.ts +16 -0
  34. package/dist/lib/field/linked-field-options.d.ts.map +1 -1
  35. package/dist/lib/field/linked-field-options.js +17 -0
  36. package/dist/lib/field/linked-field-options.js.map +1 -1
  37. package/dist/lib/form-state.service.d.ts +58 -0
  38. package/dist/lib/form-state.service.d.ts.map +1 -1
  39. package/dist/lib/form-state.service.js +156 -40
  40. package/dist/lib/form-state.service.js.map +1 -1
  41. package/dist/lib/host/entity-form-host.component.d.ts +10 -2
  42. package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
  43. package/dist/lib/host/entity-form-host.component.js +24 -8
  44. package/dist/lib/host/entity-form-host.component.js.map +1 -1
  45. package/dist/lib/interactive-form/interactive-form.component.d.ts +16 -4
  46. package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
  47. package/dist/lib/interactive-form/interactive-form.component.js +38 -12
  48. package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
  49. package/dist/lib/isa-related-panel/isa-related-card.component.d.ts +3 -3
  50. package/dist/lib/isa-related-panel/isa-related-card.component.d.ts.map +1 -1
  51. package/dist/lib/isa-related-panel/isa-related-card.component.js +12 -8
  52. package/dist/lib/isa-related-panel/isa-related-card.component.js.map +1 -1
  53. package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts +3 -3
  54. package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts.map +1 -1
  55. package/dist/lib/isa-related-panel/isa-related-panel.component.js +24 -7
  56. package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
  57. package/dist/lib/overlays/form-slide-in.component.d.ts +2 -0
  58. package/dist/lib/overlays/form-slide-in.component.d.ts.map +1 -1
  59. package/dist/lib/overlays/form-slide-in.component.js +5 -1
  60. package/dist/lib/overlays/form-slide-in.component.js.map +1 -1
  61. package/dist/lib/panel/collapsible-panel.component.d.ts +72 -9
  62. package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
  63. package/dist/lib/panel/collapsible-panel.component.js +185 -43
  64. package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
  65. package/dist/lib/panel-slot/base-form-panel.d.ts +2 -0
  66. package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
  67. package/dist/lib/panel-slot/base-form-panel.js +5 -1
  68. package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
  69. package/dist/lib/panel-slot/form-contribution.d.ts +12 -0
  70. package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
  71. package/dist/lib/panel-slot/form-contribution.js +43 -10
  72. package/dist/lib/panel-slot/form-contribution.js.map +1 -1
  73. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +10 -0
  74. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
  75. package/dist/lib/panel-slot/form-slot-coordinator.service.js +25 -5
  76. package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
  77. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
  78. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
  79. package/dist/lib/panel-slot/related-entity-grid-panel.component.js +5 -1
  80. package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
  81. package/dist/lib/section-indicators/form-section-field-host.d.ts +53 -0
  82. package/dist/lib/section-indicators/form-section-field-host.d.ts.map +1 -0
  83. package/dist/lib/section-indicators/form-section-field-host.js +23 -0
  84. package/dist/lib/section-indicators/form-section-field-host.js.map +1 -0
  85. package/dist/lib/section-loader-component.d.ts +5 -1
  86. package/dist/lib/section-loader-component.d.ts.map +1 -1
  87. package/dist/lib/section-loader-component.js +13 -5
  88. package/dist/lib/section-loader-component.js.map +1 -1
  89. package/dist/lib/section-manager/section-manager.component.d.ts +2 -2
  90. package/dist/lib/section-manager/section-manager.component.js +6 -6
  91. package/dist/lib/section-manager/section-manager.component.js.map +1 -1
  92. package/dist/lib/toolbar/form-toolbar.component.d.ts +5 -5
  93. package/dist/lib/toolbar/form-toolbar.component.js +22 -22
  94. package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
  95. package/dist/lib/types/form-types.d.ts +2 -0
  96. package/dist/lib/types/form-types.d.ts.map +1 -1
  97. package/dist/lib/types/form-types.js +5 -1
  98. package/dist/lib/types/form-types.js.map +1 -1
  99. package/dist/public-api.d.ts +3 -0
  100. package/dist/public-api.d.ts.map +1 -1
  101. package/dist/public-api.js +3 -0
  102. package/dist/public-api.js.map +1 -1
  103. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible-panel.component.js","sourceRoot":"","sources":["../../../src/lib/panel/collapsible-panel.component.ts","../../../src/lib/panel/collapsible-panel.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EACtC,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,EAElD,eAAe,EAAa,WAAW,EAAE,YAAY,EAAE,UAAU,EACjE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,+BAA+B,EAAmC,MAAM,kEAAkE,CAAC;AACpJ,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,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BAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAML,KAAK;;kBAML,KAAK;;kBASL,KAAK;;kBAkBL,KAAK;mBAAC,YAAY;;kBAGlB,KAAK;mBAAC,aAAa;;kBAGnB,KAAK;mBAAC,MAAM;;kBAGZ,KAAK;mBAAC,MAAM;;kBAGZ,KAAK;mBAAC,aAAa;;kBAInB,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAIN,eAAe;mBAAC,oBAAoB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;kBAQ3D,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,mBAAmB;;kBAK/B,WAAW;mBAAC,gBAAgB;;kBAS5B,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,OAAO;;kBAsBnB,WAAW;mBAAC,aAAa;;kBAiBzB,SAAS;mBAAC,cAAc;;kBAqQxB,YAAY;mBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;kBAUnC,YAAY;mBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;;kBAOpC,YAAY;mBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;kFA1drB,2BAA2B","sourcesContent":["import {\n Component, Input, Output, EventEmitter,\n ChangeDetectionStrategy, ChangeDetectorRef, inject,\n OnChanges, SimpleChanges, OnInit, AfterContentInit, AfterViewInit, OnDestroy,\n ContentChildren, QueryList, HostBinding, HostListener, ElementRef,\n ViewChild, NgZone, ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { FormContext, PanelVariant, PanelDragStartEvent, PanelDropEvent } from '../types/form-types';\nimport { IsFormSectionHidden } from '../types/entity-form-config';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport { MjFormFieldComponent } from '../field/form-field.component';\nimport { CompositeKey } from '@memberjunction/core';\nimport { EscapeHTML, HighlightSearchMatches, type ValidationErrorInfo } from '@memberjunction/global';\nimport { FormChromeCoordinator } from '../chrome/form-chrome-coordinator.service';\nimport { FormSectionIndicatorCoordinator, type FormSectionIndicatorSource } from '../section-indicators/form-section-indicator-coordinator.service';\nimport {\n ClaimedCollectionErrors,\n DescribeSectionDirty,\n DescribeSectionErrors,\n DescribeSectionWarnings,\n SectionOwnsValidationSource,\n SumSectionIndicators,\n TallyValidationErrors,\n type FormSectionIndicators,\n type ParsedValidationSource,\n type SectionValidationScope,\n} from '../section-indicators/form-section-indicators';\n\n/**\n * Reusable collapsible panel for form sections.\n *\n * Supports three visual variants:\n * - **default**: White card with accent border (standard field sections)\n * - **related-entity**: Blue-accented card with row count badge (related entity grids)\n * - **inherited**: Purple-accented card with \"Inherited from X\" badge (IS-A parent field sections)\n *\n * Features:\n * - Expand/collapse with smooth animation\n * - Search filtering (hides non-matching panels, highlights matched names)\n * - Drag-to-reorder sections\n * - Inheritable \"Inherited from X\" badge with navigation event\n * - Row count badge for related entity sections\n * - Section indicators: an unsaved-changes dot and an invalid-field count derived\n * live from the projected `mj-form-field`s (plus anything a custom section\n * supplies through `[Indicators]`), published to the form's chrome rail\n * through {@link FormSectionIndicatorCoordinator}\n *\n * @example\n * ```html\n * <mj-collapsible-panel\n * SectionKey=\"productDetails\"\n * SectionName=\"Product Details\"\n * Icon=\"fa fa-box\"\n * Variant=\"inherited\"\n * InheritedFromEntity=\"Products\"\n * [Form]=\"formComponent\"\n * [FormContext]=\"formContext\"\n * (Navigate)=\"onNavigate($event)\">\n * <mj-form-field ...></mj-form-field>\n * </mj-collapsible-panel>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-collapsible-panel',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None, // Required to style projected content (grids, etc.)\n templateUrl: './collapsible-panel.component.html',\n styleUrls: ['./collapsible-panel.component.css']\n})\nexport class MjCollapsiblePanelComponent implements OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy, FormSectionIndicatorSource {\n private cdr = inject(ChangeDetectorRef);\n private elementRef = inject(ElementRef);\n private ngZone = inject(NgZone);\n private chrome = inject(FormChromeCoordinator, { optional: true });\n private indicators = inject(FormSectionIndicatorCoordinator, { optional: true });\n\n /** Unique key for state persistence */\n @Input() SectionKey = '';\n\n /**\n * Indicator counts a custom section supplies for content that is NOT rendered by\n * `mj-form-field` — a designer, an inline grid, a hand-built editor. Added to the\n * counts this panel derives from its own fields, so a section that mixes both\n * reports the union. Omit for ordinary field panels: their state is derived.\n *\n * ```html\n * <mj-collapsible-panel SectionKey=\"lines\" [Indicators]=\"{ DirtyCount: LineEditor.EditedRows, ErrorCount: LineEditor.InvalidRows }\">\n * ```\n */\n @Input() Indicators?: Partial<FormSectionIndicators> | null;\n\n /**\n * Graph-path collection names whose validation failures belong to THIS panel —\n * `ValidationSources=\"Modifications\"` claims `Modifications[2].ProvisionID`.\n *\n * Only needed when a panel hosts a child collection whose path name differs from\n * its `SectionKey`: plain field failures are joined automatically from the panel's\n * `mj-form-field` children, and a graph path whose leading segment already matches\n * the `SectionKey` is claimed without any declaration. Declared HERE, on the panel\n * that owns the collection, rather than in an app-side `fieldName -> sectionKey`\n * map that duplicates a fact the panel owns and drifts silently when a\n * `SectionKey` is renamed. Accepts a single name or a list.\n */\n @Input() ValidationSources?: string | readonly string[] | null;\n\n /** Display name shown in the panel header */\n @Input() SectionName = '';\n\n /** Font Awesome icon class for the panel header */\n @Input() Icon = 'fa fa-folder';\n\n /**\n * Reference to the parent form component for state delegation.\n * Expected to have IsSectionExpanded, SetSectionExpanded, getSectionDisplayOrder methods.\n */\n @Input() Form: unknown;\n\n /** Form-level context (search filter, showEmptyFields) */\n @Input() FormContext?: FormContext;\n\n /** Panel visual variant */\n @Input() Variant: PanelVariant = 'default';\n\n /** Row count badge for related entity sections */\n @Input() BadgeCount: number | undefined;\n\n /** Default expanded state when no persisted state exists */\n @Input() DefaultExpanded: boolean | undefined;\n\n /**\n * For 'inherited' variant: the parent entity name this section's fields come from.\n * Displayed as \"Inherited from X\" badge and used for navigation.\n */\n @Input() InheritedFromEntity = '';\n\n /**\n * For 'inherited' variant: the primary key to navigate to when clicking the badge.\n * (Shared PK in IS-A relationships.)\n */\n @Input() InheritedRecordPrimaryKey?: CompositeKey;\n\n /**\n * Container-driven hard hide. When true the panel is removed from view\n * regardless of search state — used by the record-form container to honor\n * `EntityFormConfig.showRelatedEntities` / `hiddenSectionKeys` /\n * `visibleSectionKeys`. Composes with (overrides) search visibility so all\n * existing `IsVisible`-based section counts stay correct.\n */\n @Input()\n set Hidden(value: boolean) {\n if (value !== this._hidden) {\n this._hidden = value;\n // Recompute visibility if content has initialized (FieldComponents present).\n if (this.FieldComponents) {\n this.UpdateVisibilityAndHighlighting();\n }\n }\n }\n get Hidden(): boolean {\n return this._hidden;\n }\n private _hidden = false;\n\n // ---- Deprecated camelCase aliases (backward compat) ----\n\n /** @deprecated Use [SectionKey] instead */\n @Input('sectionKey') set _deprecatedSectionKey(value: string) { this.SectionKey = value; }\n\n /** @deprecated Use [SectionName] instead */\n @Input('sectionName') set _deprecatedSectionName(value: string) { this.SectionName = value; }\n\n /** @deprecated Use [Icon] instead */\n @Input('icon') set _deprecatedIcon(value: string) { this.Icon = value; }\n\n /** @deprecated Use [Form] instead */\n @Input('form') set _deprecatedForm(value: unknown) { this.Form = value; }\n\n /** @deprecated Use [FormContext] instead */\n @Input('formContext') set _deprecatedFormContext(value: FormContext | undefined) { this.FormContext = value; }\n\n // ---- Outputs ----\n\n @Output() DragStarted = new EventEmitter<PanelDragStartEvent>();\n @Output() DragEnded = new EventEmitter<void>();\n @Output() PanelDrop = new EventEmitter<PanelDropEvent>();\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n // ---- Content Children ----\n\n @ContentChildren(MjFormFieldComponent, { descendants: true }) FieldComponents!: QueryList<MjFormFieldComponent>;\n\n // ---- State ----\n\n DisplayName = '';\n FieldNames = '';\n IsVisible = true;\n\n @HostBinding('attr.data-section-key')\n get HostSectionKey(): string {\n return this.SectionKey;\n }\n\n @HostBinding('attr.data-variant')\n get HostVariant(): string {\n return this.Variant;\n }\n\n @HostBinding('attr.data-icon')\n get HostIcon(): string {\n return this.Icon;\n }\n\n /**\n * Indicator counts mirrored onto the host element, so CSS and any DOM sweep can\n * read a section's state without a component reference.\n */\n @HostBinding('attr.data-dirty-count')\n get HostDirtyCount(): number {\n return this.SectionIndicators.DirtyCount;\n }\n\n @HostBinding('attr.data-error-count')\n get HostErrorCount(): number {\n return this.SectionIndicators.ErrorCount;\n }\n\n @HostBinding('class')\n get HostClass(): string {\n const classes = [`mj-panel--${this.Variant}`];\n if (!this.IsVisible) classes.push('mj-search-hidden');\n if (this.IsDragging) classes.push('mj-dragging');\n if (this.IsDragOver) classes.push('mj-drag-over');\n const indicators = this.SectionIndicators;\n if (indicators.DirtyCount > 0) classes.push('mj-panel-dirty');\n if (indicators.ErrorCount > 0) classes.push('mj-panel-has-errors');\n else if (indicators.WarningCount > 0) classes.push('mj-panel-has-warnings');\n if (this.chrome?.Spec.RelatedRoles.get(this.SectionKey) === 'Detail') {\n classes.push('mj-form-role-detail');\n }\n if (this.chrome?.HidesAccordionChrome(this.SectionKey)) {\n classes.push('mj-chrome-plain');\n }\n if (!this.hasRenderableContent()) {\n classes.push('mj-panel-empty');\n }\n return classes.join(' ');\n }\n\n @HostBinding('style.order')\n get CssOrder(): number {\n const formRef = this.Form as { getSectionDisplayOrder?: (key: string) => number };\n return formRef?.getSectionDisplayOrder ? formRef.getSectionDisplayOrder(this.SectionKey) : 0;\n }\n\n IsDragging = false;\n IsDragOver = false;\n\n // ---- Event relay ----\n\n /** Signals re-subscription when ContentChildren change */\n private fieldNavReset$ = new Subject<void>();\n private destroy$ = new Subject<void>();\n\n // ---- Panel content resize ----\n\n @ViewChild('panelContent') private panelContentRef?: ElementRef<HTMLElement>;\n private resizeObserver?: ResizeObserver;\n private resizeDebounceTimer?: ReturnType<typeof setTimeout>;\n /** ResizeObserver fires once synchronously on observe(); that initial measurement is not a user resize. */\n private resizeObserverPrimed = false;\n\n /**\n * Persisted accordion resize height for related-entity panels.\n * Related grids size themselves from row count (accordion and left-nav),\n * so a pinned pixel height — especially 0 / toolbar-only measured while\n * collapsed — would clip the grid. Only honor a user drag that is at\n * least the CSS min-height.\n */\n get PanelContentHeight(): number | undefined {\n if (this.Variant !== 'related-entity') return undefined;\n if (this.hidesAccordionChrome()) return undefined;\n const formRef = this.Form as { GetSectionPanelHeight?: (key: string) => number | undefined };\n const persisted = formRef?.GetSectionPanelHeight?.(this.SectionKey);\n if (persisted == null || persisted < 120) return undefined;\n return persisted;\n }\n\n private hidesAccordionChrome(): boolean {\n if (this.chrome?.HidesAccordionChrome(this.SectionKey)) return true;\n const el = this.elementRef.nativeElement as HTMLElement | undefined;\n return !!el?.classList.contains('mj-chrome-show');\n }\n\n /** Whether drag-to-reorder is allowed (from FormContext) */\n get ReorderAllowed(): boolean {\n return this.FormContext?.allowSectionReorder !== false;\n }\n\n /**\n * Whether this panel's header may collapse/expand. Driven by\n * `FormContext.collapsibleSections`; when false the panel renders\n * always-expanded with no toggle chevron (used by dialog/slide-in surfaces\n * that lock sections open). Undefined / true means collapsible.\n */\n get Collapsible(): boolean {\n // Selected left-nav item has no accordion chrome. More keeps collapse/expand.\n if (this.hidesAccordionChrome()) return false;\n return this.FormContext?.collapsibleSections !== false;\n }\n\n /** Whether the panel is expanded (delegates to form state; always true when not collapsible) */\n get Expanded(): boolean {\n if (!this.Collapsible) return true;\n const formRef = this.Form as { IsSectionExpanded?: (key: string, defaultExpanded?: boolean) => boolean };\n return formRef?.IsSectionExpanded ? formRef.IsSectionExpanded(this.SectionKey, this.DefaultExpanded) : true;\n }\n\n // ---- Section indicators (unsaved-changes dot + invalid-field count) ----\n\n /**\n * Live state of this section: fields edited since the last save, fields that are\n * invalid or required-and-empty, and fields carrying warnings. Derived from the\n * projected `mj-form-field`s on every read — the same state those fields use for\n * their own amber dot and red underline, so the section can never disagree with\n * its fields — plus graph-path validation failures this section claims, plus\n * whatever a custom section supplies through `[Indicators]`.\n *\n * Read during change detection (host bindings, the header template, the rail via\n * the coordinator). Pure and cheap: one pass over the field list.\n */\n public get SectionIndicators(): FormSectionIndicators {\n return SumSectionIndicators(\n this.fieldIndicators(),\n TallyValidationErrors(this.claimedGraphErrors()),\n this.Indicators,\n );\n }\n\n public get SectionDirtyCount(): number {\n return this.SectionIndicators.DirtyCount;\n }\n\n public get SectionErrorCount(): number {\n return this.SectionIndicators.ErrorCount;\n }\n\n public get SectionWarningCount(): number {\n return this.SectionIndicators.WarningCount;\n }\n\n public get SectionDirtyTitle(): string {\n return DescribeSectionDirty(this.SectionDirtyCount);\n }\n\n public get SectionErrorTitle(): string {\n return DescribeSectionErrors(this.SectionErrorCount);\n }\n\n public get SectionWarningTitle(): string {\n return DescribeSectionWarnings(this.SectionWarningCount);\n }\n\n /** {@link FormSectionIndicatorSource} — the rail reads this through the coordinator. */\n public GetSectionIndicators(): FormSectionIndicators {\n return this.SectionIndicators;\n }\n\n /** {@link FormSectionIndicatorSource} — whether a form-level error belongs to this section. */\n public OwnsValidationSource(source: ParsedValidationSource): boolean {\n return SectionOwnsValidationSource(source, this.SectionKey, this.validationScope());\n }\n\n /** Normalized {@link ValidationSources}. */\n public get ValidationCollectionNames(): string[] {\n const raw = this.ValidationSources;\n if (!raw) return [];\n return (typeof raw === 'string' ? [raw] : [...raw]).map((n) => n.trim()).filter((n) => n.length > 0);\n }\n\n /** Field names this panel renders — the join between a plain-field error and this section. */\n private renderedFieldNames(): string[] {\n const names: string[] = [];\n this.FieldComponents?.forEach((field) => {\n if (field.FieldName) names.push(field.FieldName);\n });\n return names;\n }\n\n private validationScope(): SectionValidationScope {\n return { FieldNames: this.renderedFieldNames(), CollectionNames: this.ValidationCollectionNames };\n }\n\n /**\n * Counts of FIELDS (not messages) in each state. A field is invalid when it shows a\n * failure OR is required and empty in edit mode — exactly the two conditions that\n * paint its underline red. Warnings count only on fields with no failure, mirroring\n * `MjFormFieldComponent.ShowWarnings`.\n */\n private fieldIndicators(): FormSectionIndicators {\n let DirtyCount = 0;\n let ErrorCount = 0;\n let WarningCount = 0;\n this.FieldComponents?.forEach((field) => {\n if (field.IsDirty) DirtyCount++;\n // Only a field that renders an EDITOR can be invalid: a read-only field renders its\n // value as text and never paints an underline, so it is skipped even when\n // `IsRequiredEmpty` would say otherwise (a NOT NULL `__mj_CreatedAt` on a new record\n // is empty and read-only — the user cannot fix it, and it fills itself on save).\n if (!field.EditMode || field.IsFieldReadOnly) return;\n if (field.ShowErrors || field.IsRequiredEmpty) ErrorCount++;\n // The field paints its amber underline on EITHER of these — a stored date the input\n // cannot parse warns on its own, outside the validation pipeline.\n else if (field.ShowWarnings || field.StoredDateIsUnreadable) WarningCount++;\n });\n return { DirtyCount, ErrorCount, WarningCount };\n }\n\n /**\n * Graph-path failures (`Lines[2].Amount`) this section owns, once the form has asked\n * for validation to show. Plain field-name failures are NOT counted here — the field\n * that renders them already reports through {@link fieldIndicators}.\n */\n private claimedGraphErrors(): ValidationErrorInfo[] {\n const ctx = this.FormContext;\n if (!ctx?.showValidation || !ctx.validationErrors?.length) return [];\n return ClaimedCollectionErrors(ctx.validationErrors, this.SectionKey, this.validationScope());\n }\n\n /** (Re)declare this section with the container-scoped registry the rail reads. */\n private registerIndicatorSource(previousKey?: string): void {\n if (!this.indicators) return;\n if (previousKey && previousKey !== this.SectionKey) {\n this.indicators.Unregister(this, previousKey);\n }\n this.indicators.Register(this);\n }\n\n // ---- Lifecycle ----\n\n ngOnInit(): void {\n this.DisplayName = this.SectionName;\n this.chrome?.Changes.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.UpdateVisibilityAndHighlighting();\n });\n this.registerIndicatorSource();\n }\n\n ngAfterContentInit(): void {\n this.UpdateFieldNames();\n this.SubscribeToFieldNavigateEvents();\n this.FieldComponents.changes.subscribe(() => {\n this.UpdateFieldNames();\n this.SubscribeToFieldNavigateEvents();\n // The set of fields changed, so the section's counts (and which errors it\n // claims) may have too — let the rail re-read.\n this.indicators?.NotifyChanged();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['SectionName']) {\n this.DisplayName = this.SectionName;\n }\n if (changes['SectionKey'] && !changes['SectionKey'].firstChange) {\n this.registerIndicatorSource(changes['SectionKey'].previousValue as string | undefined);\n }\n if (changes['SectionName'] || changes['FormContext']) {\n this.UpdateVisibilityAndHighlighting();\n }\n if (changes['FormContext'] && this.FieldComponents) {\n this.FieldComponents.forEach(field => {\n field.FormContext = this.FormContext;\n });\n }\n }\n\n ngAfterViewInit(): void {\n this.SetupResizeObserver();\n }\n\n ngOnDestroy(): void {\n this.indicators?.Unregister(this);\n this.fieldNavReset$.next();\n this.fieldNavReset$.complete();\n this.destroy$.next();\n this.destroy$.complete();\n this.resizeObserver?.disconnect();\n if (this.resizeDebounceTimer) {\n clearTimeout(this.resizeDebounceTimer);\n }\n }\n\n // ---- Actions ----\n\n Toggle(): void {\n if (!this.Collapsible) return;\n const formRef = this.Form as { SetSectionExpanded?: (key: string, expanded: boolean) => void };\n if (formRef?.SetSectionExpanded) {\n formRef.SetSectionExpanded(this.SectionKey, !this.Expanded);\n this.cdr.markForCheck();\n }\n }\n\n /**\n * Navigate to the parent entity when clicking the \"Inherited from X\" badge.\n * Derives the PrimaryKey from the Form's record when InheritedRecordPrimaryKey\n * is not explicitly provided (which is the common case in generated templates).\n */\n OnInheritedBadgeClick(event: MouseEvent): void {\n event.stopPropagation();\n if (!this.InheritedFromEntity) return;\n\n const primaryKey = this.InheritedRecordPrimaryKey\n ?? (this.Form as { record?: { PrimaryKey: CompositeKey } })?.record?.PrimaryKey\n ?? new CompositeKey([]);\n\n this.Navigate.emit({\n Kind: 'entity-hierarchy',\n EntityName: this.InheritedFromEntity,\n PrimaryKey: primaryKey,\n Direction: 'parent'\n });\n }\n\n // ---- Drag and Drop ----\n\n @HostListener('dragover', ['$event'])\n OnDragOver(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n event.preventDefault();\n event.stopPropagation();\n if (event.dataTransfer?.types.includes('text/plain')) {\n this.IsDragOver = true;\n }\n }\n\n @HostListener('dragleave', ['$event'])\n OnDragLeave(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n event.preventDefault();\n this.IsDragOver = false;\n }\n\n @HostListener('drop', ['$event'])\n OnDrop(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n event.preventDefault();\n event.stopPropagation();\n this.IsDragOver = false;\n\n const sourceSectionKey = event.dataTransfer?.getData('text/plain');\n if (sourceSectionKey && sourceSectionKey !== this.SectionKey) {\n this.PanelDrop.emit({\n SourceSectionKey: sourceSectionKey,\n TargetSectionKey: this.SectionKey\n });\n this.ReorderSections(sourceSectionKey, this.SectionKey);\n }\n }\n\n OnDragStart(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n this.IsDragging = true;\n event.dataTransfer?.setData('text/plain', this.SectionKey);\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n }\n this.DragStarted.emit({ SectionKey: this.SectionKey, Event: event });\n }\n\n OnDragEnd(): void {\n this.IsDragging = false;\n this.DragEnded.emit();\n }\n\n // ---- Private Methods ----\n\n private ReorderSections(sourceSectionKey: string, targetSectionKey: string): void {\n const formRef = this.Form as {\n getSectionOrder?: () => string[];\n setSectionOrder?: (order: string[]) => void;\n };\n if (!formRef?.getSectionOrder || !formRef?.setSectionOrder) return;\n\n const currentOrder = formRef.getSectionOrder();\n const sourceIndex = currentOrder.indexOf(sourceSectionKey);\n const targetIndex = currentOrder.indexOf(targetSectionKey);\n if (sourceIndex === -1 || targetIndex === -1) return;\n\n const newOrder = [...currentOrder];\n newOrder.splice(sourceIndex, 1);\n newOrder.splice(targetIndex, 0, sourceSectionKey);\n formRef.setSectionOrder(newOrder);\n this.cdr.markForCheck();\n }\n\n /**\n * Field panels whose only children are empty/hidden (e.g. leftover\n * `Details` with just unused geo columns) should not take space.\n * Custom widgets and related grids have no FieldComponents — keep them.\n */\n /**\n * Whether this panel matches a section-search term by title or field\n * name. Ignores chrome hide/show — the rail uses this to decide if the\n * *group* matches, even when another section is currently selected.\n */\n public MatchesSearch(term: string): boolean {\n const filter = (term || '').toLowerCase().trim();\n if (!filter) return true;\n if (this.SectionName.toLowerCase().includes(filter)) return true;\n if (this.SectionKey.toLowerCase().includes(filter)) return true;\n return this.FieldNames.includes(filter);\n }\n\n private hasRenderableContent(): boolean {\n if (this.Variant === 'related-entity') return true;\n if (!this.FieldComponents || this.FieldComponents.length === 0) return true;\n return this.FieldComponents.some((field) => !field.ShouldHideField);\n }\n\n private isHiddenByChrome(): boolean {\n if (!this.chrome) return false;\n if (this.Variant === 'related-entity') {\n return !this.chrome.IsRelatedSectionVisible(this.SectionKey);\n }\n return !this.chrome.IsFirstClassSectionVisible(this.SectionKey);\n }\n\n private UpdateFieldNames(): void {\n if (this.FieldComponents) {\n const names: string[] = [];\n this.FieldComponents.forEach(field => {\n if (field.DisplayName) {\n names.push(field.DisplayName.toLowerCase());\n }\n });\n this.FieldNames = names.join(' ');\n this.UpdateVisibilityAndHighlighting();\n }\n }\n\n /**\n * Subscribes to Navigate events from all child form-field components\n * and relays them through this panel's Navigate output. Also listens for\n * value edits so the section indicators (and the rail reading them) refresh\n * on the same tick as the keystroke rather than on the container's next poll.\n */\n private SubscribeToFieldNavigateEvents(): void {\n this.fieldNavReset$.next(); // tear down previous subscriptions\n this.FieldComponents.forEach(field => {\n field.Navigate.pipe(takeUntil(this.fieldNavReset$)).subscribe((event: FormNavigationEvent) => {\n this.Navigate.emit(event);\n });\n field.ValueChange.pipe(takeUntil(this.fieldNavReset$)).subscribe(() => {\n this.cdr.markForCheck();\n this.indicators?.NotifyChanged();\n });\n });\n }\n\n /**\n * Sets up a ResizeObserver on the panel content div for related-entity panels.\n * When the user drags the CSS resize handle, we persist the new height.\n */\n private SetupResizeObserver(): void {\n if (this.Variant !== 'related-entity' || !this.panelContentRef) return;\n\n const el = this.panelContentRef.nativeElement;\n // Run outside Angular zone to avoid triggering change detection on every resize frame\n this.ngZone.runOutsideAngular(() => {\n this.resizeObserver = new ResizeObserver((entries) => {\n // Skip the synchronous initial fire emitted when observe() is called — it's the\n // panel's own first measurement on load, not a user-initiated resize. Persisting\n // it would write a spurious panelHeight for every panel on form open.\n if (!this.resizeObserverPrimed) {\n this.resizeObserverPrimed = true;\n return;\n }\n // Only a height change while the panel is expanded reflects a genuine user drag of\n // the resize handle. Ignore reflows while collapsed (e.g. content settling on load).\n if (!this.Expanded) return;\n // Left-nav sizes the grid from the leftover column. Persisting that\n // computed height would write ~0 (or the toolbar) and then pin it.\n if (this.hidesAccordionChrome()) return;\n const entry = entries[0];\n if (!entry) return;\n const newHeight = Math.round(entry.contentRect.height);\n if (newHeight < 120) return;\n this.DebouncePersistHeight(newHeight);\n });\n this.resizeObserver.observe(el);\n });\n }\n\n /**\n * Debounces height persistence so we don't write to DB on every resize frame.\n */\n private DebouncePersistHeight(height: number): void {\n if (this.resizeDebounceTimer) {\n clearTimeout(this.resizeDebounceTimer);\n }\n this.resizeDebounceTimer = setTimeout(() => {\n const formRef = this.Form as { SetSectionPanelHeight?: (key: string, height: number) => void };\n formRef?.SetSectionPanelHeight?.(this.SectionKey, height);\n }, 500);\n }\n\n /**\n * True when this panel projects form fields and field-level security denies the user EVERY one\n * of them.\n *\n * Deliberately false when the panel projects no `mj-form-field` at all — related-entity grids,\n * IS-A cards and slot-injected panels all legitimately have none, and hiding those would remove\n * sections field security has nothing to say about. \"No fields\" and \"no readable fields\" are\n * different states and only the second one should hide the section.\n */\n private get AllProjectedFieldsDenied(): boolean {\n const fields = this.FieldComponents;\n if (!fields || fields.length === 0) {\n return false;\n }\n return fields.toArray().every(f => !f.IsFieldReadableByUser);\n }\n\n private UpdateVisibilityAndHighlighting(): void {\n // Hard hide takes precedence over search state. Driven by an explicit\n // `Hidden` input OR the form config's section-visibility rules carried on\n // FormContext (which also reach slot-injected BaseFormPanels, since every\n // panel receives FormContext).\n if (this._hidden || IsFormSectionHidden(this.FormContext, this.SectionKey, this.Variant) || this.isHiddenByChrome()) {\n this.IsVisible = false;\n this.DisplayName = EscapeHTML(this.SectionName);\n this.cdr.markForCheck();\n return;\n }\n\n // A section whose every field is denied by field-level security renders as a heading over\n // nothing — the fields hide themselves individually, leaving an empty card that reads like a\n // broken screen rather than a permissions boundary. Hide the section instead.\n if (this.AllProjectedFieldsDenied) {\n this.IsVisible = false;\n this.DisplayName = EscapeHTML(this.SectionName);\n this.cdr.markForCheck();\n return;\n }\n\n const searchTerm = (this.FormContext?.sectionFilter || '').toLowerCase().trim();\n\n if (!searchTerm) {\n this.IsVisible = this.hasRenderableContent();\n this.DisplayName = this.SectionName;\n this.cdr.markForCheck();\n return;\n }\n\n const sectionMatches = this.SectionName.toLowerCase().includes(searchTerm);\n const fieldsMatch = this.FieldNames.includes(searchTerm);\n this.IsVisible = this.MatchesSearch(searchTerm);\n\n // DisplayName is bound to `[innerHTML]` in the template — must always be HTML-safe.\n this.DisplayName =\n this.IsVisible && sectionMatches\n ? HighlightSearchMatches(this.SectionName, searchTerm, 'mj-forms-search-highlight')\n : EscapeHTML(this.SectionName);\n\n this.cdr.markForCheck();\n }\n}\n","<div class=\"mj-forms-panel\"\n [class.mj-forms-panel--related]=\"Variant === 'related-entity'\"\n [class.mj-forms-panel--inherited]=\"Variant === 'inherited'\"\n [attr.data-section-key]=\"SectionKey\">\n\n <!-- Panel Header -->\n <div class=\"mj-forms-panel-header\"\n [class.mj-forms-panel-header--static]=\"!Collapsible\"\n [attr.role]=\"Collapsible ? 'button' : null\"\n [attr.tabindex]=\"Collapsible ? 0 : null\"\n (click)=\"Toggle()\">\n <!-- Drag Handle (hidden when reorder disabled) -->\n @if (ReorderAllowed) {\n <div class=\"mj-forms-drag-handle\"\n title=\"Drag to reorder sections\"\n draggable=\"true\"\n (dragstart)=\"OnDragStart($event)\"\n (dragend)=\"OnDragEnd()\"\n (click)=\"$event.stopPropagation()\">\n <i class=\"fa-solid fa-grip-vertical\"></i>\n </div>\n }\n\n <!-- Icon + Title -->\n <div class=\"mj-forms-panel-title-group\">\n <i [class]=\"Icon\" class=\"mj-forms-panel-icon\"></i>\n <h3 class=\"mj-forms-panel-title\">\n <span [innerHTML]=\"DisplayName\"></span>\n <!-- Section indicators: unsaved-changes dot (same idiom as an edited field's\n label dot) and invalid-field count (same colour as the field's red underline).\n Derived from the projected fields — see SectionIndicators. -->\n @if (SectionDirtyCount > 0) {\n <span class=\"mj-forms-panel-dirty\"\n role=\"img\"\n [title]=\"SectionDirtyTitle\"\n [attr.aria-label]=\"SectionDirtyTitle\"></span>\n }\n @if (SectionErrorCount > 0) {\n <span class=\"mj-forms-panel-error-badge\"\n role=\"img\"\n [title]=\"SectionErrorTitle\"\n [attr.aria-label]=\"SectionErrorTitle\">\n <i class=\"fa-solid fa-circle-exclamation\" aria-hidden=\"true\"></i>{{ SectionErrorCount }}\n </span>\n } @else if (SectionWarningCount > 0) {\n <span class=\"mj-forms-panel-warning-badge\"\n role=\"img\"\n [title]=\"SectionWarningTitle\"\n [attr.aria-label]=\"SectionWarningTitle\">\n <i class=\"fa-solid fa-triangle-exclamation\" aria-hidden=\"true\"></i>{{ SectionWarningCount }}\n </span>\n }\n <!-- Row count badge for related entities -->\n @if (BadgeCount !== undefined) {\n <span class=\"mj-forms-row-count-badge\" [class.mj-forms-row-count-badge--zero]=\"BadgeCount === 0\">\n {{ BadgeCount }}\n </span>\n }\n </h3>\n </div>\n\n <!-- Inherited From badge (IS-A) -->\n @if (Variant === 'inherited' && InheritedFromEntity) {\n <a class=\"mj-forms-inherited-badge\" (click)=\"OnInheritedBadgeClick($event)\"\n [title]=\"'View parent record: ' + InheritedFromEntity\">\n <i class=\"fa-solid fa-arrow-up\"></i>\n Inherited from {{ InheritedFromEntity }}\n </a>\n }\n\n <!-- Chevron (hidden when sections are locked open) -->\n @if (Collapsible) {\n <div class=\"mj-forms-panel-chevron\">\n <i [class]=\"Expanded ? 'fa fa-chevron-up' : 'fa fa-chevron-down'\"></i>\n </div>\n }\n </div>\n\n <!-- Panel Body -->\n <div class=\"mj-forms-panel-body\" [class.mj-forms-panel-body--collapsed]=\"!Expanded\">\n <div class=\"mj-forms-panel-content\"\n #panelContent\n [style.height.px]=\"PanelContentHeight\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n"]}
1
+ {"version":3,"file":"collapsible-panel.component.js","sourceRoot":"","sources":["../../../src/lib/panel/collapsible-panel.component.ts","../../../src/lib/panel/collapsible-panel.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EACtC,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAEtE,eAAe,EAAa,WAAW,EAAE,YAAY,EAAE,UAAU,EACjE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,+BAA+B,EAAmC,MAAM,kEAAkE,CAAC;AACpJ,OAAO,EAAE,uBAAuB,EAA6B,MAAM,+CAA+C,CAAC;AACnH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,GAItB,MAAM,+CAA+C,CAAC;;;;;;IChBjD,+BAKwC;IAAnC,AADA,AADA,0MAAa,0BAAmB,KAAC,mLACtB,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AAK;;kBAML,KAAK;;kBAML,KAAK;;kBASL,KAAK;;kBAkBL,KAAK;mBAAC,YAAY;;kBAGlB,KAAK;mBAAC,aAAa;;kBAGnB,KAAK;mBAAC,MAAM;;kBAGZ,KAAK;mBAAC,MAAM;;kBAGZ,KAAK;mBAAC,aAAa;;kBAInB,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAIN,eAAe;mBAAC,oBAAoB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;kBAiC3D,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,mBAAmB;;kBAK/B,WAAW;mBAAC,gBAAgB;;kBAS5B,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,OAAO;;kBAsBnB,WAAW;mBAAC,aAAa;;kBAiBzB,SAAS;mBAAC,cAAc;;kBAkWxB,YAAY;mBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;;kBAUnC,YAAY;mBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;;kBAOpC,YAAY;mBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;kFAhlBrB,2BAA2B","sourcesContent":["import {\n Component, Input, Output, EventEmitter,\n ChangeDetectionStrategy, ChangeDetectorRef, inject, forwardRef, signal,\n OnChanges, SimpleChanges, OnInit, AfterContentInit, AfterViewInit, OnDestroy,\n ContentChildren, QueryList, HostBinding, HostListener, ElementRef,\n ViewChild, NgZone, ViewEncapsulation\n} from '@angular/core';\nimport { Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { FormContext, PanelVariant, PanelDragStartEvent, PanelDropEvent } from '../types/form-types';\nimport { IsFormSectionHidden } from '../types/entity-form-config';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport { MjFormFieldComponent } from '../field/form-field.component';\nimport { CompositeKey } from '@memberjunction/core';\nimport { EscapeHTML, HighlightSearchMatches, type ValidationErrorInfo } from '@memberjunction/global';\nimport { FormChromeCoordinator } from '../chrome/form-chrome-coordinator.service';\nimport { FormSectionIndicatorCoordinator, type FormSectionIndicatorSource } from '../section-indicators/form-section-indicator-coordinator.service';\nimport { FORM_SECTION_FIELD_HOST, type FormSectionFieldHost } from '../section-indicators/form-section-field-host';\nimport {\n ClaimedCollectionErrors,\n DescribeSectionDirty,\n DescribeSectionErrors,\n DescribeSectionWarnings,\n SectionOwnsValidationSource,\n SumSectionIndicators,\n TallyValidationErrors,\n type FormSectionIndicators,\n type ParsedValidationSource,\n type SectionValidationScope,\n} from '../section-indicators/form-section-indicators';\n\n/**\n * Reusable collapsible panel for form sections.\n *\n * Supports three visual variants:\n * - **default**: White card with accent border (standard field sections)\n * - **related-entity**: Blue-accented card with row count badge (related entity grids)\n * - **inherited**: Purple-accented card with \"Inherited from X\" badge (IS-A parent field sections)\n *\n * Features:\n * - Expand/collapse with smooth animation\n * - Search filtering (hides non-matching panels, highlights matched names)\n * - Drag-to-reorder sections\n * - Inheritable \"Inherited from X\" badge with navigation event\n * - Row count badge for related entity sections\n * - Section indicators: an unsaved-changes dot and an invalid-field count derived\n * live from the section's `mj-form-field`s (plus anything a custom section\n * supplies through `[Indicators]`), published to the form's chrome rail\n * through {@link FormSectionIndicatorCoordinator}\n *\n * **Which fields belong to the section.** Two sources, unioned: the `@ContentChildren`\n * query over projected content, and fields that registered themselves through\n * {@link FORM_SECTION_FIELD_HOST}, which this panel provides. The content query\n * cannot see a field declared inside a child component's own template (a widget\n * projected into the panel), and a section that saw none of its fields reported no\n * required-and-empty count, claimed none of the failed save's field errors, and so\n * never badged on the rail. The injector follows the element tree across view\n * boundaries, so the registered set covers exactly those fields. A registered field\n * counts only while its element is physically inside this panel, which keeps a field\n * created in an overlay that happened to inherit this injector from being counted.\n *\n * @example\n * ```html\n * <mj-collapsible-panel\n * SectionKey=\"productDetails\"\n * SectionName=\"Product Details\"\n * Icon=\"fa fa-box\"\n * Variant=\"inherited\"\n * InheritedFromEntity=\"Products\"\n * [Form]=\"formComponent\"\n * [FormContext]=\"formContext\"\n * (Navigate)=\"onNavigate($event)\">\n * <mj-form-field ...></mj-form-field>\n * </mj-collapsible-panel>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-collapsible-panel',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None, // Required to style projected content (grids, etc.)\n templateUrl: './collapsible-panel.component.html',\n styleUrls: ['./collapsible-panel.component.css'],\n // `providers`, not `viewProviders`: the fields that need to reach this panel sit in its\n // projected CONTENT (and in component views nested inside that content).\n providers: [{ provide: FORM_SECTION_FIELD_HOST, useExisting: forwardRef(() => MjCollapsiblePanelComponent) }],\n})\nexport class MjCollapsiblePanelComponent implements OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy, FormSectionIndicatorSource, FormSectionFieldHost {\n private cdr = inject(ChangeDetectorRef);\n private elementRef = inject(ElementRef);\n private ngZone = inject(NgZone);\n private chrome = inject(FormChromeCoordinator, { optional: true });\n private indicators = inject(FormSectionIndicatorCoordinator, { optional: true });\n\n /** Unique key for state persistence */\n @Input() SectionKey = '';\n\n /**\n * Indicator counts a custom section supplies for content that is NOT rendered by\n * `mj-form-field` — a designer, an inline grid, a hand-built editor. Added to the\n * counts this panel derives from its own fields, so a section that mixes both\n * reports the union. Omit for ordinary field panels: their state is derived.\n *\n * ```html\n * <mj-collapsible-panel SectionKey=\"lines\" [Indicators]=\"{ DirtyCount: LineEditor.EditedRows, ErrorCount: LineEditor.InvalidRows }\">\n * ```\n */\n @Input() Indicators?: Partial<FormSectionIndicators> | null;\n\n /**\n * Graph-path collection names whose validation failures belong to THIS panel —\n * `ValidationSources=\"Modifications\"` claims `Modifications[2].ProvisionID`.\n *\n * Only needed when a panel hosts a child collection whose path name differs from\n * its `SectionKey`: plain field failures are joined automatically from the panel's\n * `mj-form-field` children, and a graph path whose leading segment already matches\n * the `SectionKey` is claimed without any declaration. Declared HERE, on the panel\n * that owns the collection, rather than in an app-side `fieldName -> sectionKey`\n * map that duplicates a fact the panel owns and drifts silently when a\n * `SectionKey` is renamed. Accepts a single name or a list.\n */\n @Input() ValidationSources?: string | readonly string[] | null;\n\n /** Display name shown in the panel header */\n @Input() SectionName = '';\n\n /** Font Awesome icon class for the panel header */\n @Input() Icon = 'fa fa-folder';\n\n /**\n * Reference to the parent form component for state delegation.\n * Expected to have IsSectionExpanded, SetSectionExpanded, getSectionDisplayOrder methods.\n */\n @Input() Form: unknown;\n\n /** Form-level context (search filter, showEmptyFields) */\n @Input() FormContext?: FormContext;\n\n /** Panel visual variant */\n @Input() Variant: PanelVariant = 'default';\n\n /** Row count badge for related entity sections */\n @Input() BadgeCount: number | undefined;\n\n /** Default expanded state when no persisted state exists */\n @Input() DefaultExpanded: boolean | undefined;\n\n /**\n * For 'inherited' variant: the parent entity name this section's fields come from.\n * Displayed as \"Inherited from X\" badge and used for navigation.\n */\n @Input() InheritedFromEntity = '';\n\n /**\n * For 'inherited' variant: the primary key to navigate to when clicking the badge.\n * (Shared PK in IS-A relationships.)\n */\n @Input() InheritedRecordPrimaryKey?: CompositeKey;\n\n /**\n * Container-driven hard hide. When true the panel is removed from view\n * regardless of search state — used by the record-form container to honor\n * `EntityFormConfig.showRelatedEntities` / `hiddenSectionKeys` /\n * `visibleSectionKeys`. Composes with (overrides) search visibility so all\n * existing `IsVisible`-based section counts stay correct.\n */\n @Input()\n set Hidden(value: boolean) {\n if (value !== this._hidden) {\n this._hidden = value;\n // Recompute visibility if content has initialized (FieldComponents present).\n if (this.FieldComponents) {\n this.updateVisibilityAndHighlighting();\n }\n }\n }\n get Hidden(): boolean {\n return this._hidden;\n }\n private _hidden = false;\n\n // ---- Deprecated camelCase aliases (backward compat) ----\n\n /** @deprecated Use [SectionKey] instead */\n @Input('sectionKey') set _deprecatedSectionKey(value: string) { this.SectionKey = value; }\n\n /** @deprecated Use [SectionName] instead */\n @Input('sectionName') set _deprecatedSectionName(value: string) { this.SectionName = value; }\n\n /** @deprecated Use [Icon] instead */\n @Input('icon') set _deprecatedIcon(value: string) { this.Icon = value; }\n\n /** @deprecated Use [Form] instead */\n @Input('form') set _deprecatedForm(value: unknown) { this.Form = value; }\n\n /** @deprecated Use [FormContext] instead */\n @Input('formContext') set _deprecatedFormContext(value: FormContext | undefined) { this.FormContext = value; }\n\n // ---- Outputs ----\n\n @Output() DragStarted = new EventEmitter<PanelDragStartEvent>();\n @Output() DragEnded = new EventEmitter<void>();\n @Output() PanelDrop = new EventEmitter<PanelDropEvent>();\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n // ---- Content Children ----\n\n @ContentChildren(MjFormFieldComponent, { descendants: true }) FieldComponents!: QueryList<MjFormFieldComponent>;\n\n /**\n * Fields that found this panel through {@link FORM_SECTION_FIELD_HOST} — those the content\n * query cannot see because a component view sits between them and the panel. Keyed by\n * instance; the value is the edit subscription that keeps the rail live for that field.\n */\n private readonly hostedFields = new Map<MjFormFieldComponent, Subscription>();\n\n /**\n * Bumped whenever the hosted set changes or a hosted field reports an input change. Every\n * reader of the field set touches it, so the views that read this section (its own host\n * bindings, the rail) become dependents Angular re-runs before its no-changes check when a\n * hosted field — refreshed AFTER those views in the same pass — changes underneath them. See\n * {@link FormSectionFieldHost.NotifyFieldChanged}.\n */\n private readonly hostedFieldsVersion = signal(0);\n\n /**\n * Memo behind {@link allFields}. Every real `mj-form-field` reaches this panel through the\n * injector — projected ones included — so the hosted set is the section's whole field list, and\n * the union is read several times per change-detection pass (three host bindings, the header,\n * hide-when-empty, the rail). Recomputed only when the hosted set or a hosted field's inputs\n * change (the signal) or the content query is replaced or resized.\n */\n private fieldsMemo: { version: number; content: QueryList<MjFormFieldComponent> | undefined; contentLength: number; fields: MjFormFieldComponent[] } | null = null;\n\n // ---- State ----\n\n DisplayName = '';\n FieldNames = '';\n IsVisible = true;\n\n @HostBinding('attr.data-section-key')\n get HostSectionKey(): string {\n return this.SectionKey;\n }\n\n @HostBinding('attr.data-variant')\n get HostVariant(): string {\n return this.Variant;\n }\n\n @HostBinding('attr.data-icon')\n get HostIcon(): string {\n return this.Icon;\n }\n\n /**\n * Indicator counts mirrored onto the host element, so CSS and any DOM sweep can\n * read a section's state without a component reference.\n */\n @HostBinding('attr.data-dirty-count')\n get HostDirtyCount(): number {\n return this.SectionIndicators.DirtyCount;\n }\n\n @HostBinding('attr.data-error-count')\n get HostErrorCount(): number {\n return this.SectionIndicators.ErrorCount;\n }\n\n @HostBinding('class')\n get HostClass(): string {\n const classes = [`mj-panel--${this.Variant}`];\n if (!this.IsVisible) classes.push('mj-search-hidden');\n if (this.IsDragging) classes.push('mj-dragging');\n if (this.IsDragOver) classes.push('mj-drag-over');\n const indicators = this.SectionIndicators;\n if (indicators.DirtyCount > 0) classes.push('mj-panel-dirty');\n if (indicators.ErrorCount > 0) classes.push('mj-panel-has-errors');\n else if (indicators.WarningCount > 0) classes.push('mj-panel-has-warnings');\n if (this.chrome?.Spec.RelatedRoles.get(this.SectionKey) === 'Detail') {\n classes.push('mj-form-role-detail');\n }\n if (this.chrome?.HidesAccordionChrome(this.SectionKey)) {\n classes.push('mj-chrome-plain');\n }\n if (!this.hasRenderableContent()) {\n classes.push('mj-panel-empty');\n }\n return classes.join(' ');\n }\n\n @HostBinding('style.order')\n get CssOrder(): number {\n const formRef = this.Form as { getSectionDisplayOrder?: (key: string) => number };\n return formRef?.getSectionDisplayOrder ? formRef.getSectionDisplayOrder(this.SectionKey) : 0;\n }\n\n IsDragging = false;\n IsDragOver = false;\n\n // ---- Event relay ----\n\n /** Signals re-subscription when ContentChildren change */\n private fieldNavReset$ = new Subject<void>();\n private destroy$ = new Subject<void>();\n\n // ---- Panel content resize ----\n\n @ViewChild('panelContent') private panelContentRef?: ElementRef<HTMLElement>;\n private resizeObserver?: ResizeObserver;\n private resizeDebounceTimer?: ReturnType<typeof setTimeout>;\n /** ResizeObserver fires once synchronously on observe(); that initial measurement is not a user resize. */\n private resizeObserverPrimed = false;\n\n /**\n * Persisted accordion resize height for related-entity panels.\n * Related grids size themselves from row count (accordion and left-nav),\n * so a pinned pixel height — especially 0 / toolbar-only measured while\n * collapsed — would clip the grid. Only honor a user drag that is at\n * least the CSS min-height.\n */\n get PanelContentHeight(): number | undefined {\n if (this.Variant !== 'related-entity') return undefined;\n if (this.hidesAccordionChrome()) return undefined;\n const formRef = this.Form as { GetSectionPanelHeight?: (key: string) => number | undefined };\n const persisted = formRef?.GetSectionPanelHeight?.(this.SectionKey);\n if (persisted == null || persisted < 120) return undefined;\n return persisted;\n }\n\n private hidesAccordionChrome(): boolean {\n if (this.chrome?.HidesAccordionChrome(this.SectionKey)) return true;\n const el = this.elementRef.nativeElement as HTMLElement | undefined;\n return !!el?.classList.contains('mj-chrome-show');\n }\n\n /** Whether drag-to-reorder is allowed (from FormContext) */\n get ReorderAllowed(): boolean {\n return this.FormContext?.allowSectionReorder !== false;\n }\n\n /**\n * Whether this panel's header may collapse/expand. Driven by\n * `FormContext.collapsibleSections`; when false the panel renders\n * always-expanded with no toggle chevron (used by dialog/slide-in surfaces\n * that lock sections open). Undefined / true means collapsible.\n */\n get Collapsible(): boolean {\n // Selected left-nav item has no accordion chrome. More keeps collapse/expand.\n if (this.hidesAccordionChrome()) return false;\n return this.FormContext?.collapsibleSections !== false;\n }\n\n /** Whether the panel is expanded (delegates to form state; always true when not collapsible) */\n get Expanded(): boolean {\n if (!this.Collapsible) return true;\n const formRef = this.Form as { IsSectionExpanded?: (key: string, defaultExpanded?: boolean) => boolean };\n return formRef?.IsSectionExpanded ? formRef.IsSectionExpanded(this.SectionKey, this.DefaultExpanded) : true;\n }\n\n // ---- Fields (content query ∪ injector-registered) ----\n\n /** {@link FormSectionFieldHost} — a field rendered inside this section, at any view depth. */\n public RegisterField(field: MjFormFieldComponent): void {\n if (this.hostedFields.has(field)) return;\n // Same contract as a projected field: an edit refreshes the section's counts (and the\n // rail reading them) on the same tick as the keystroke.\n const edits = field.ValueChange.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.cdr.markForCheck();\n this.indicators?.NotifyChanged();\n });\n this.hostedFields.set(field, edits);\n this.onFieldSetChanged();\n }\n\n /** {@link FormSectionFieldHost} */\n public UnregisterField(field: MjFormFieldComponent): void {\n const edits = this.hostedFields.get(field);\n if (!edits) return;\n edits.unsubscribe();\n this.hostedFields.delete(field);\n this.onFieldSetChanged();\n }\n\n /** {@link FormSectionFieldHost} */\n public NotifyFieldChanged(field: MjFormFieldComponent): void {\n if (!this.hostedFields.has(field)) return;\n this.onFieldSetChanged();\n }\n\n private onFieldSetChanged(): void {\n this.hostedFieldsVersion.update((v) => v + 1);\n // Visibility is latched, not derived: hide-when-empty and the all-denied check are computed\n // into IsVisible when the field set changes, so they have to be recomputed here too — a\n // hosted field binds its inputs after content init, and a section evaluated before that\n // would otherwise stay hidden (or visible) on the pre-binding answer.\n if (this.FieldComponents) {\n this.updateVisibilityAndHighlighting();\n }\n this.cdr.markForCheck();\n this.indicators?.NotifyChanged();\n }\n\n /**\n * Searchable display names of every field, read live rather than from the {@link FieldNames}\n * cache — only needed once a hosted field exists, because its name lands after registration\n * (see {@link refreshFieldNames}).\n */\n private liveFieldNames(): string {\n if (this.hostedFields.size === 0) return '';\n const names: string[] = [];\n for (const field of this.allFields()) {\n if (field.DisplayName) names.push(field.DisplayName.toLowerCase());\n }\n return names.join(' ');\n }\n\n /**\n * Every `mj-form-field` this section fronts: the projected ones the content query found, plus\n * the injector-registered ones that have bound their inputs and whose element is inside this\n * panel. Unbound fields are left out because a field with no inputs reports itself hidden and\n * not required-and-empty, which is not information about the section. The containment check\n * is what stops a field created in an overlay, with this panel's injector as its ancestor, from\n * counting against a section it is not displayed in. Memoized — see {@link fieldsMemo}.\n */\n private allFields(): MjFormFieldComponent[] {\n const version = this.hostedFieldsVersion(); // dependency, see the field's doc\n const content = this.FieldComponents;\n const contentLength = content?.length ?? 0;\n const memo = this.fieldsMemo;\n if (memo && memo.version === version && memo.content === content && memo.contentLength === contentLength) {\n return memo.fields;\n }\n const fields: MjFormFieldComponent[] = content ? content.toArray() : [];\n if (this.hostedFields.size > 0) {\n const host = this.elementRef.nativeElement as HTMLElement | undefined;\n const seen = new Set(fields);\n for (const field of this.hostedFields.keys()) {\n if (seen.has(field)) continue;\n if (!field.InputsBound) continue;\n if (host && !host.contains(field.HostElement)) continue;\n fields.push(field);\n }\n }\n this.fieldsMemo = { version, content, contentLength, fields };\n return fields;\n }\n\n // ---- Section indicators (unsaved-changes dot + invalid-field count) ----\n\n /**\n * Live state of this section: fields edited since the last save, fields that are\n * invalid or required-and-empty, and fields carrying warnings. Derived from the\n * projected `mj-form-field`s on every read — the same state those fields use for\n * their own amber dot and red underline, so the section can never disagree with\n * its fields — plus graph-path validation failures this section claims, plus\n * whatever a custom section supplies through `[Indicators]`.\n *\n * Read during change detection (host bindings, the header template, the rail via\n * the coordinator). Pure and cheap: one pass over the field list.\n */\n public get SectionIndicators(): FormSectionIndicators {\n return SumSectionIndicators(\n this.fieldIndicators(),\n TallyValidationErrors(this.claimedGraphErrors()),\n this.Indicators,\n );\n }\n\n public get SectionDirtyCount(): number {\n return this.SectionIndicators.DirtyCount;\n }\n\n public get SectionErrorCount(): number {\n return this.SectionIndicators.ErrorCount;\n }\n\n public get SectionWarningCount(): number {\n return this.SectionIndicators.WarningCount;\n }\n\n public get SectionDirtyTitle(): string {\n return DescribeSectionDirty(this.SectionDirtyCount);\n }\n\n public get SectionErrorTitle(): string {\n return DescribeSectionErrors(this.SectionErrorCount);\n }\n\n public get SectionWarningTitle(): string {\n return DescribeSectionWarnings(this.SectionWarningCount);\n }\n\n /** {@link FormSectionIndicatorSource} — the rail reads this through the coordinator. */\n public GetSectionIndicators(): FormSectionIndicators {\n return this.SectionIndicators;\n }\n\n /** {@link FormSectionIndicatorSource} — whether a form-level error belongs to this section. */\n public OwnsValidationSource(source: ParsedValidationSource): boolean {\n return SectionOwnsValidationSource(source, this.SectionKey, this.validationScope());\n }\n\n /** Normalized {@link ValidationSources}. */\n public get ValidationCollectionNames(): string[] {\n const raw = this.ValidationSources;\n if (!raw) return [];\n return (typeof raw === 'string' ? [raw] : [...raw]).map((n) => n.trim()).filter((n) => n.length > 0);\n }\n\n /** Field names this panel renders — the join between a plain-field error and this section. */\n private renderedFieldNames(): string[] {\n const names: string[] = [];\n for (const field of this.allFields()) {\n if (field.FieldName) names.push(field.FieldName);\n }\n return names;\n }\n\n private validationScope(): SectionValidationScope {\n return { FieldNames: this.renderedFieldNames(), CollectionNames: this.ValidationCollectionNames };\n }\n\n /**\n * Counts of FIELDS (not messages) in each state. A field is invalid when it shows a\n * failure OR is required and empty in edit mode — exactly the two conditions that\n * paint its underline red. Warnings count only on fields with no failure, mirroring\n * `MjFormFieldComponent.ShowWarnings`.\n */\n private fieldIndicators(): FormSectionIndicators {\n let DirtyCount = 0;\n let ErrorCount = 0;\n let WarningCount = 0;\n for (const field of this.allFields()) {\n if (field.IsDirty) DirtyCount++;\n // Only a field that renders an EDITOR can be invalid: a read-only field renders its\n // value as text and never paints an underline, so it is skipped even when\n // `IsRequiredEmpty` would say otherwise (a NOT NULL `__mj_CreatedAt` on a new record\n // is empty and read-only — the user cannot fix it, and it fills itself on save).\n if (!field.EditMode || field.IsFieldReadOnly) continue;\n if (field.ShowErrors || field.IsRequiredEmpty) ErrorCount++;\n // The field paints its amber underline on EITHER of these — a stored date the input\n // cannot parse warns on its own, outside the validation pipeline.\n else if (field.ShowWarnings || field.StoredDateIsUnreadable) WarningCount++;\n }\n return { DirtyCount, ErrorCount, WarningCount };\n }\n\n /**\n * Graph-path failures (`Lines[2].Amount`) this section owns, once the form has asked\n * for validation to show. Plain field-name failures are NOT counted here — the field\n * that renders them already reports through {@link fieldIndicators}.\n */\n private claimedGraphErrors(): ValidationErrorInfo[] {\n const ctx = this.FormContext;\n if (!ctx?.showValidation || !ctx.validationErrors?.length) return [];\n return ClaimedCollectionErrors(ctx.validationErrors, this.SectionKey, this.validationScope());\n }\n\n /** (Re)declare this section with the container-scoped registry the rail reads. */\n private registerIndicatorSource(previousKey?: string): void {\n if (!this.indicators) return;\n if (previousKey && previousKey !== this.SectionKey) {\n this.indicators.Unregister(this, previousKey);\n }\n this.indicators.Register(this);\n }\n\n // ---- Lifecycle ----\n\n ngOnInit(): void {\n this.DisplayName = this.SectionName;\n this.chrome?.Changes.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateVisibilityAndHighlighting();\n });\n this.registerIndicatorSource();\n }\n\n ngAfterContentInit(): void {\n this.updateFieldNames();\n this.subscribeToFieldNavigateEvents();\n this.FieldComponents.changes.subscribe(() => {\n // Drop the field memo before anything below reads it: a replaced QueryList with the same\n // length would otherwise be served from the previous result.\n this.hostedFieldsVersion.update((v) => v + 1);\n this.updateFieldNames();\n this.subscribeToFieldNavigateEvents();\n // The set of fields changed, so the section's counts (and which errors it\n // claims) may have too — let the rail re-read.\n this.indicators?.NotifyChanged();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['SectionName']) {\n this.DisplayName = this.SectionName;\n }\n if (changes['SectionKey'] && !changes['SectionKey'].firstChange) {\n this.registerIndicatorSource(changes['SectionKey'].previousValue as string | undefined);\n }\n if (changes['SectionName'] || changes['FormContext']) {\n this.updateVisibilityAndHighlighting();\n }\n if (changes['FormContext'] && this.FieldComponents) {\n this.FieldComponents.forEach(field => {\n field.FormContext = this.FormContext;\n });\n }\n }\n\n ngAfterViewInit(): void {\n this.setupResizeObserver();\n }\n\n ngOnDestroy(): void {\n this.indicators?.Unregister(this);\n for (const edits of this.hostedFields.values()) edits.unsubscribe();\n this.hostedFields.clear();\n this.fieldNavReset$.next();\n this.fieldNavReset$.complete();\n this.destroy$.next();\n this.destroy$.complete();\n this.resizeObserver?.disconnect();\n if (this.resizeDebounceTimer) {\n clearTimeout(this.resizeDebounceTimer);\n }\n }\n\n // ---- Actions ----\n\n Toggle(): void {\n if (!this.Collapsible) return;\n const formRef = this.Form as { SetSectionExpanded?: (key: string, expanded: boolean) => void };\n if (formRef?.SetSectionExpanded) {\n formRef.SetSectionExpanded(this.SectionKey, !this.Expanded);\n this.cdr.markForCheck();\n }\n }\n\n /**\n * Navigate to the parent entity when clicking the \"Inherited from X\" badge.\n * Derives the PrimaryKey from the Form's record when InheritedRecordPrimaryKey\n * is not explicitly provided (which is the common case in generated templates).\n */\n OnInheritedBadgeClick(event: MouseEvent): void {\n event.stopPropagation();\n if (!this.InheritedFromEntity) return;\n\n const primaryKey = this.InheritedRecordPrimaryKey\n ?? (this.Form as { record?: { PrimaryKey: CompositeKey } })?.record?.PrimaryKey\n ?? new CompositeKey([]);\n\n this.Navigate.emit({\n Kind: 'entity-hierarchy',\n EntityName: this.InheritedFromEntity,\n PrimaryKey: primaryKey,\n Direction: 'parent'\n });\n }\n\n // ---- Drag and Drop ----\n\n @HostListener('dragover', ['$event'])\n OnDragOver(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n event.preventDefault();\n event.stopPropagation();\n if (event.dataTransfer?.types.includes('text/plain')) {\n this.IsDragOver = true;\n }\n }\n\n @HostListener('dragleave', ['$event'])\n OnDragLeave(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n event.preventDefault();\n this.IsDragOver = false;\n }\n\n @HostListener('drop', ['$event'])\n OnDrop(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n event.preventDefault();\n event.stopPropagation();\n this.IsDragOver = false;\n\n const sourceSectionKey = event.dataTransfer?.getData('text/plain');\n if (sourceSectionKey && sourceSectionKey !== this.SectionKey) {\n this.PanelDrop.emit({\n SourceSectionKey: sourceSectionKey,\n TargetSectionKey: this.SectionKey\n });\n this.reorderSections(sourceSectionKey, this.SectionKey);\n }\n }\n\n OnDragStart(event: DragEvent): void {\n if (!this.ReorderAllowed) return;\n this.IsDragging = true;\n event.dataTransfer?.setData('text/plain', this.SectionKey);\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n }\n this.DragStarted.emit({ SectionKey: this.SectionKey, Event: event });\n }\n\n OnDragEnd(): void {\n this.IsDragging = false;\n this.DragEnded.emit();\n }\n\n // ---- Private Methods ----\n\n private reorderSections(sourceSectionKey: string, targetSectionKey: string): void {\n const formRef = this.Form as {\n getSectionOrder?: () => string[];\n setSectionOrder?: (order: string[]) => void;\n };\n if (!formRef?.getSectionOrder || !formRef?.setSectionOrder) return;\n\n const currentOrder = formRef.getSectionOrder();\n const sourceIndex = currentOrder.indexOf(sourceSectionKey);\n const targetIndex = currentOrder.indexOf(targetSectionKey);\n if (sourceIndex === -1 || targetIndex === -1) return;\n\n const newOrder = [...currentOrder];\n newOrder.splice(sourceIndex, 1);\n newOrder.splice(targetIndex, 0, sourceSectionKey);\n formRef.setSectionOrder(newOrder);\n this.cdr.markForCheck();\n }\n\n /**\n * Field panels whose only children are empty/hidden (e.g. leftover\n * `Details` with just unused geo columns) should not take space.\n * Custom widgets and related grids have no FieldComponents — keep them.\n */\n /**\n * Whether this panel matches a section-search term by title or field\n * name. Ignores chrome hide/show — the rail uses this to decide if the\n * *group* matches, even when another section is currently selected.\n */\n public MatchesSearch(term: string): boolean {\n const filter = (term || '').toLowerCase().trim();\n if (!filter) return true;\n if (this.SectionName.toLowerCase().includes(filter)) return true;\n if (this.SectionKey.toLowerCase().includes(filter)) return true;\n return this.FieldNames.includes(filter) || this.liveFieldNames().includes(filter);\n }\n\n private hasRenderableContent(): boolean {\n if (this.Variant === 'related-entity') return true;\n const fields = this.allFields();\n if (fields.length === 0) return true;\n return fields.some((field) => !field.ShouldHideField);\n }\n\n private isHiddenByChrome(): boolean {\n if (!this.chrome) return false;\n if (this.Variant === 'related-entity') {\n return !this.chrome.IsRelatedSectionVisible(this.SectionKey);\n }\n return !this.chrome.IsFirstClassSectionVisible(this.SectionKey);\n }\n\n private updateFieldNames(): void {\n if (this.FieldComponents) {\n this.refreshFieldNames();\n this.updateVisibilityAndHighlighting();\n }\n }\n\n /**\n * Rebuild the searchable field-name string from the current field set. Rebuilt on structural\n * changes only; a hosted field's DisplayName is bound after it registers (its inputs land on its\n * own view's first pass), so search also reads names live through {@link liveFieldNames}\n * rather than relying on this cache alone.\n */\n private refreshFieldNames(): void {\n const names: string[] = [];\n for (const field of this.allFields()) {\n if (field.DisplayName) {\n names.push(field.DisplayName.toLowerCase());\n }\n }\n this.FieldNames = names.join(' ');\n }\n\n /**\n * Subscribes to Navigate events from all child form-field components\n * and relays them through this panel's Navigate output. Also listens for\n * value edits so the section indicators (and the rail reading them) refresh\n * on the same tick as the keystroke rather than on the container's next poll.\n */\n private subscribeToFieldNavigateEvents(): void {\n this.fieldNavReset$.next(); // tear down previous subscriptions\n this.FieldComponents.forEach(field => {\n field.Navigate.pipe(takeUntil(this.fieldNavReset$)).subscribe((event: FormNavigationEvent) => {\n this.Navigate.emit(event);\n });\n // A real projected field also reached this panel through the injector and already has\n // this subscription from RegisterField; a second one would notify the rail twice per edit.\n if (this.hostedFields.has(field)) return;\n field.ValueChange.pipe(takeUntil(this.fieldNavReset$)).subscribe(() => {\n this.cdr.markForCheck();\n this.indicators?.NotifyChanged();\n });\n });\n }\n\n /**\n * Sets up a ResizeObserver on the panel content div for related-entity panels.\n * When the user drags the CSS resize handle, we persist the new height.\n */\n private setupResizeObserver(): void {\n if (this.Variant !== 'related-entity' || !this.panelContentRef) return;\n\n const el = this.panelContentRef.nativeElement;\n // Run outside Angular zone to avoid triggering change detection on every resize frame\n this.ngZone.runOutsideAngular(() => {\n this.resizeObserver = new ResizeObserver((entries) => {\n // Skip the synchronous initial fire emitted when observe() is called — it's the\n // panel's own first measurement on load, not a user-initiated resize. Persisting\n // it would write a spurious panelHeight for every panel on form open.\n if (!this.resizeObserverPrimed) {\n this.resizeObserverPrimed = true;\n return;\n }\n // Only a height change while the panel is expanded reflects a genuine user drag of\n // the resize handle. Ignore reflows while collapsed (e.g. content settling on load).\n if (!this.Expanded) return;\n // Left-nav sizes the grid from the leftover column. Persisting that\n // computed height would write ~0 (or the toolbar) and then pin it.\n if (this.hidesAccordionChrome()) return;\n const entry = entries[0];\n if (!entry) return;\n const newHeight = Math.round(entry.contentRect.height);\n if (newHeight < 120) return;\n this.debouncePersistHeight(newHeight);\n });\n this.resizeObserver.observe(el);\n });\n }\n\n /**\n * Debounces height persistence so we don't write to DB on every resize frame.\n */\n private debouncePersistHeight(height: number): void {\n if (this.resizeDebounceTimer) {\n clearTimeout(this.resizeDebounceTimer);\n }\n this.resizeDebounceTimer = setTimeout(() => {\n const formRef = this.Form as { SetSectionPanelHeight?: (key: string, height: number) => void };\n formRef?.SetSectionPanelHeight?.(this.SectionKey, height);\n }, 500);\n }\n\n /**\n * True when this panel projects form fields and field-level security denies the user EVERY one\n * of them.\n *\n * Deliberately false when the panel projects no `mj-form-field` at all — related-entity grids,\n * IS-A cards and slot-injected panels all legitimately have none, and hiding those would remove\n * sections field security has nothing to say about. \"No fields\" and \"no readable fields\" are\n * different states and only the second one should hide the section.\n */\n private get allProjectedFieldsDenied(): boolean {\n const fields = this.allFields();\n if (fields.length === 0) {\n return false;\n }\n return fields.every(f => !f.IsFieldReadableByUser);\n }\n\n private updateVisibilityAndHighlighting(): void {\n // Hard hide takes precedence over search state. Driven by an explicit\n // `Hidden` input OR the form config's section-visibility rules carried on\n // FormContext (which also reach slot-injected BaseFormPanels, since every\n // panel receives FormContext).\n if (this._hidden || IsFormSectionHidden(this.FormContext, this.SectionKey, this.Variant) || this.isHiddenByChrome()) {\n this.IsVisible = false;\n this.DisplayName = EscapeHTML(this.SectionName);\n this.cdr.markForCheck();\n return;\n }\n\n // A section whose every field is denied by field-level security renders as a heading over\n // nothing — the fields hide themselves individually, leaving an empty card that reads like a\n // broken screen rather than a permissions boundary. Hide the section instead.\n if (this.allProjectedFieldsDenied) {\n this.IsVisible = false;\n this.DisplayName = EscapeHTML(this.SectionName);\n this.cdr.markForCheck();\n return;\n }\n\n const searchTerm = (this.FormContext?.sectionFilter || '').toLowerCase().trim();\n\n if (!searchTerm) {\n this.IsVisible = this.hasRenderableContent();\n this.DisplayName = this.SectionName;\n this.cdr.markForCheck();\n return;\n }\n\n const sectionMatches = this.SectionName.toLowerCase().includes(searchTerm);\n this.IsVisible = this.MatchesSearch(searchTerm);\n\n // DisplayName is bound to `[innerHTML]` in the template — must always be HTML-safe.\n this.DisplayName =\n this.IsVisible && sectionMatches\n ? HighlightSearchMatches(this.SectionName, searchTerm, 'mj-forms-search-highlight')\n : EscapeHTML(this.SectionName);\n\n this.cdr.markForCheck();\n }\n}\n","<div class=\"mj-forms-panel\"\n [class.mj-forms-panel--related]=\"Variant === 'related-entity'\"\n [class.mj-forms-panel--inherited]=\"Variant === 'inherited'\"\n [attr.data-section-key]=\"SectionKey\">\n\n <!-- Panel Header -->\n <div class=\"mj-forms-panel-header\"\n [class.mj-forms-panel-header--static]=\"!Collapsible\"\n [attr.role]=\"Collapsible ? 'button' : null\"\n [attr.tabindex]=\"Collapsible ? 0 : null\"\n (click)=\"Toggle()\">\n <!-- Drag Handle (hidden when reorder disabled) -->\n @if (ReorderAllowed) {\n <div class=\"mj-forms-drag-handle\"\n title=\"Drag to reorder sections\"\n draggable=\"true\"\n (dragstart)=\"OnDragStart($event)\"\n (dragend)=\"OnDragEnd()\"\n (click)=\"$event.stopPropagation()\">\n <i class=\"fa-solid fa-grip-vertical\"></i>\n </div>\n }\n\n <!-- Icon + Title -->\n <div class=\"mj-forms-panel-title-group\">\n <i [class]=\"Icon\" class=\"mj-forms-panel-icon\"></i>\n <h3 class=\"mj-forms-panel-title\">\n <span [innerHTML]=\"DisplayName\"></span>\n <!-- Section indicators: unsaved-changes dot (same idiom as an edited field's\n label dot) and invalid-field count (same colour as the field's red underline).\n Derived from the projected fields — see SectionIndicators. -->\n @if (SectionDirtyCount > 0) {\n <span class=\"mj-forms-panel-dirty\"\n role=\"img\"\n [title]=\"SectionDirtyTitle\"\n [attr.aria-label]=\"SectionDirtyTitle\"></span>\n }\n @if (SectionErrorCount > 0) {\n <span class=\"mj-forms-panel-error-badge\"\n role=\"img\"\n [title]=\"SectionErrorTitle\"\n [attr.aria-label]=\"SectionErrorTitle\">\n <i class=\"fa-solid fa-circle-exclamation\" aria-hidden=\"true\"></i>{{ SectionErrorCount }}\n </span>\n } @else if (SectionWarningCount > 0) {\n <span class=\"mj-forms-panel-warning-badge\"\n role=\"img\"\n [title]=\"SectionWarningTitle\"\n [attr.aria-label]=\"SectionWarningTitle\">\n <i class=\"fa-solid fa-triangle-exclamation\" aria-hidden=\"true\"></i>{{ SectionWarningCount }}\n </span>\n }\n <!-- Row count badge for related entities -->\n @if (BadgeCount !== undefined) {\n <span class=\"mj-forms-row-count-badge\" [class.mj-forms-row-count-badge--zero]=\"BadgeCount === 0\">\n {{ BadgeCount }}\n </span>\n }\n </h3>\n </div>\n\n <!-- Inherited From badge (IS-A) -->\n @if (Variant === 'inherited' && InheritedFromEntity) {\n <a class=\"mj-forms-inherited-badge\" (click)=\"OnInheritedBadgeClick($event)\"\n [title]=\"'View parent record: ' + InheritedFromEntity\">\n <i class=\"fa-solid fa-arrow-up\"></i>\n Inherited from {{ InheritedFromEntity }}\n </a>\n }\n\n <!-- Chevron (hidden when sections are locked open) -->\n @if (Collapsible) {\n <div class=\"mj-forms-panel-chevron\">\n <i [class]=\"Expanded ? 'fa fa-chevron-up' : 'fa fa-chevron-down'\"></i>\n </div>\n }\n </div>\n\n <!-- Panel Body -->\n <div class=\"mj-forms-panel-body\" [class.mj-forms-panel-body--collapsed]=\"!Expanded\">\n <div class=\"mj-forms-panel-content\"\n #panelContent\n [style.height.px]=\"PanelContentHeight\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n"]}
@@ -149,6 +149,8 @@ export declare abstract class BaseFormPanel<TRecord extends BaseEntity = BaseEnt
149
149
  * implementation reports valid (panels that don't need extra validation
150
150
  * can leave this method off).
151
151
  */
152
+ Validate(): ValidationResult;
153
+ /** @deprecated Use {@link Validate}. */
152
154
  validate(): ValidationResult;
153
155
  /**
154
156
  * Called after the parent form reloads the current record from the database.
@@ -1 +1 @@
1
- {"version":3,"file":"base-form-panel.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-slot/base-form-panel.ts"],"names":[],"mappings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AAG,IAAI;IAI7D;;OAEG;IACI,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI/C;;;OAGG;IACI,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAIrG;;OAEG;IACI,eAAe,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI;IAIrD;;OAEG;IACI,eAAe,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI;IAIrD;;OAEG;IACI,kBAAkB,CAAC,GAAG,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAIzE;;OAEG;IACI,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI;IAIvD;;OAEG;IACI,mBAAmB,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;yCA7GtD,aAAa;2CAAb,aAAa;CAgHlC"}
@@ -48,13 +48,17 @@ export class BaseFormPanel {
48
48
  * implementation reports valid (panels that don't need extra validation
49
49
  * can leave this method off).
50
50
  */
51
- validate() {
51
+ Validate() {
52
52
  // Inline construction — ValidationResult is a class in @memberjunction/core,
53
53
  // not a plain interface, so callers can construct via `new`.
54
54
  const result = new ValidationResult();
55
55
  result.Success = true;
56
56
  return result;
57
57
  }
58
+ /** @deprecated Use {@link Validate}. */
59
+ validate() {
60
+ return this.Validate();
61
+ }
58
62
  /**
59
63
  * Called after the parent form reloads the current record from the database.
60
64
  * Default is a no-op. Override to refresh panel-owned data that is not a
@@ -1 +1 @@
1
- {"version":3,"file":"base-form-panel.js","sourceRoot":"","sources":["../../../src/lib/panel-slot/base-form-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAc,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;;AAkHxF;;;;;;;;;;;;;;;;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,GAAG,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,GAAuB;QAC5C,IAAI,CAAC,aAAa,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,GAAuB,EAAE,KAAa;QAC7D,IAAI,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;uGA1GiB,aAAa;6DAAb,aAAa;YAAb,0CAAa;;;iFAAb,aAAa;cADlC,SAAS;;kBAOL,WAAW;mBAAC,eAAe;;kBAI3B,KAAK;;kBAEL,KAAK;;kBAEL,KAAK","sourcesContent":["import { Directive, HostBinding, Input } from '@angular/core';\nimport { BaseEntity, ValidationResult, type FormInclusion } from '@memberjunction/core';\nimport { BaseFormComponent } from '../base-form-component';\nimport { FormContext } from '../types/form-types';\nimport { FormToolbarItemConfig, FormToolbarItemKey } from '../types/form-toolbar-item';\n\n/**\n * Well-known slot positions where panels can be injected into a generated\n * entity form. Used as the `slot` field in a panel's registration metadata.\n *\n * Slot positions inside the form, top to bottom:\n *\n * ┌─ <mj-record-form-container>\n * │ [top-area slot] ← CodeGen-emitted; rare (entities with top-area section)\n * │ [before-fields slot] ← CodeGen-emitted; banners / warnings above field panels\n * │ <connection details>\n * │ <other generated field panels>\n * │ [after-fields slot] ← CodeGen-emitted; typed config knobs, secondary settings — most common slot\n * │ <content items grid>\n * │ <other related-entity grids>\n * │ [after-related slot] ← CodeGen-emitted; bottom-of-form addenda\n * │ [after-everything slot] ← Container-emitted; ALWAYS present (fallback target)\n * └─ </mj-record-form-container>\n *\n * Pick the slot that matches the panel's role. `after-fields` is the default\n * for most \"additional settings\" panels — it sits in the field column, before\n * the related-entity grids.\n *\n * **Fallback behavior** — see `FormSlotCoordinator`. If the registered slot is\n * missing in the current form (CodeGen hasn't been rerun against the new\n * template emitter), the panel walks forward in the chain until it finds an\n * existing slot. `after-everything` is always emitted by the container, so\n * fallback never dead-ends. Pre-CodeGen-regen forms show every panel at the\n * bottom of the form; post-regen forms show them in the preferred position.\n */\nexport type FormPanelSlot =\n | 'top-area'\n | 'before-fields'\n | 'after-fields'\n | 'after-related'\n | 'after-everything';\n\n/**\n * Shape of the `metadata` object every BaseFormPanel registration MUST attach\n * via `@RegisterClass(BaseFormPanel, { metadata: {...} })`. The\n * `<mj-form-panel-slot>` host filters registrations by matching against this\n * shape — registrations without it are silently ignored.\n *\n * - `entity` — the exact entity name (case-sensitive equality enforced by the\n * slot host), OR the wildcard `'*'` to register an\n * **entity-agnostic** panel that mounts on EVERY entity's form.\n * Wildcard panels are expected to self-hide (render nothing) when\n * they don't apply to the current record, so the cross-cutting\n * registration stays unobtrusive on forms it has no business on.\n * - `slot` — which slot the panel renders into.\n * - `sortKey`— higher = earlier within the slot. Defaults to 0 if omitted.\n * Use ranges (e.g., 100/50/10) so future panels can wedge in\n * without recomputing every neighbor's sort.\n */\nexport interface FormPanelRegistrationMetadata extends Record<string, unknown> {\n entity: string;\n slot: FormPanelSlot;\n sortKey?: number;\n /**\n * Identity for last-wins collapse. Two registrations with the same key\n * compete; highest ClassFactory `Priority` wins. Omit to derive:\n * `related:${relatedEntity}:${relatedJoinField}` when claiming a\n * relationship, otherwise the registration is unique and never collapses.\n */\n contributionKey?: string;\n /**\n * When set, this panel **replaces** the default related-entity grid for\n * that relationship on `entity`'s form. The baked CodeGen panel (if any)\n * is hidden; the stock fill-in grid is not mounted.\n */\n relatedEntity?: string;\n /**\n * Disambiguates two FKs to the same related entity (BillTo vs ShipTo).\n * Compared after stripping wrapping `[]`.\n */\n relatedJoinField?: string;\n /**\n * CodeGen `SectionKey` of a baked field (or other) panel this contribution\n * replaces — e.g. `'details'`, `'personalIdentity'`. Hidden at runtime via\n * `HiddenSectionKeys`. Use with `slot: 'before-fields'` for a form hero that\n * is not a collapsible panel. Must name a concrete `entity` (not `'*'`).\n */\n replacesSectionKey?: string;\n /**\n * Pin this contribution to a chrome bucket instead of its own rail item.\n * `'details'` — leftover own-fields group. `'more'` — overflow folder.\n */\n chromeGroup?: 'details' | 'more';\n /**\n * L1 inclusion for this contribution (same verbs as relationships).\n * `'Primary'` — own first-class rail item, in the lead band before Details.\n * `'More'` — overflow folder. `'None'` — hidden.\n * L3 `MJ: Form Chrome Rules` still wins. `chromeGroup` still merges.\n */\n inclusion?: FormInclusion;\n\n /**\n * Open a NEW (unsaved) record on this contribution instead of the first first-class group.\n *\n * A saved record opens where the user last was, or on the lead group. That is right for reading a\n * record and wrong for creating one: the lead group is usually a summary, and a summary of a record\n * with no data is a page of blanks the user has to look past to find where typing starts.\n *\n * Only consulted when the record is unsaved, so it cannot change how an existing record opens.\n * If several contributions on one entity set it, the highest ClassFactory `Priority` wins, matching\n * how every other conflict between registrations is settled.\n */\n leadsWhenUnsaved?: boolean;\n}\n\n/**\n * Abstract base for every dynamically-injectable form panel.\n *\n * Subclasses are standalone Angular components decorated with\n * `@RegisterClass(BaseFormPanel, { metadata: { entity, slot, sortKey? } })`.\n * At runtime, `<mj-form-panel-slot>` discovers matching registrations via\n * `ClassFactory.GetAllRegistrationsByMetadata`, instantiates each via\n * `ViewContainerRef.createComponent`, and wires `Record` + `FormComponent` +\n * `FormContext` into the inputs.\n *\n * Lifecycle hooks: standard Angular `ngOnInit` / `ngOnDestroy` work as usual.\n * `Record` is guaranteed to be set before the first change-detection pass.\n *\n * Optional `validate()` returns a synchronous validation result; the parent\n * `BaseFormComponent.Save()` path will surface it via the existing validation\n * pipeline when called. Panels that don't validate anything beyond what the\n * record itself does can leave this method off.\n */\n@Directive()\nexport abstract class BaseFormPanel<TRecord extends BaseEntity = BaseEntity> {\n /**\n * Slot-mounted hosts must not sit in the left-nav flex column — leftover\n * height targets `mj-collapsible-panel` as a direct child of\n * `.mj-forms-all-panels`. `display: contents` makes the inner panel that child.\n */\n @HostBinding('style.display')\n readonly HostDisplay = 'contents';\n\n /** The entity record being edited. Set by the slot host before view init. */\n @Input() Record!: TRecord;\n /** The host form component (use for EditMode, dirty notifications, etc). Set by the slot host. */\n @Input() FormComponent!: BaseFormComponent;\n /** Optional form context — same shape the collapsible-panel chrome expects. Set by the slot host. */\n @Input() FormContext?: FormContext;\n\n /**\n * Convenience getter for read-only / edit-mode rendering. Falls back to\n * `false` when the panel is shown outside a `BaseFormComponent` host (e.g.,\n * a dashboard quick-edit dialog reusing the same panel — see the\n * \"composable panel\" docs).\n */\n public get EditMode(): boolean {\n return this.FormComponent?.EditMode ?? false;\n }\n\n /**\n * Override to add per-panel validation that should block the parent form's\n * Save(). Return `{ Success: true, Errors: [] }` when valid, or include\n * `ValidationErrorInfo` entries to surface field-level errors. The default\n * implementation reports valid (panels that don't need extra validation\n * can leave this method off).\n */\n public validate(): ValidationResult {\n // Inline construction — ValidationResult is a class in @memberjunction/core,\n // not a plain interface, so callers can construct via `new`.\n const result = new ValidationResult();\n result.Success = true;\n return result;\n }\n\n /**\n * Called after the parent form reloads the current record from the database.\n * Default is a no-op. Override to refresh panel-owned data that is not a\n * related-entity grid (those already subscribe to\n * {@link FormRecordRefreshCoordinator} themselves).\n */\n public OnRecordRefreshed(_record: TRecord): void {\n // Subclasses can override\n }\n\n /**\n * Registers a dynamic toolbar action item / button into the host form toolbar.\n */\n public RegisterToolbarItem(item: FormToolbarItemConfig): void {\n this.FormComponent?.RegisterToolbarItem(item);\n }\n\n /**\n * Unregisters a previously registered dynamic toolbar item by key.\n */\n public UnregisterToolbarItem(key: string): void {\n this.FormComponent?.UnregisterToolbarItem(key);\n }\n\n /**\n * Configures overrides for any toolbar item (standard built-in items like 'edit',\n * 'delete', 'favorite', 'history', etc., or custom items).\n */\n public ConfigureToolbarItem(key: FormToolbarItemKey, overrides: Partial<FormToolbarItemConfig>): void {\n this.FormComponent?.ConfigureToolbarItem(key, overrides);\n }\n\n /**\n * Dynamically hides a toolbar item by key.\n */\n public HideToolbarItem(key: FormToolbarItemKey): void {\n this.FormComponent?.HideToolbarItem(key);\n }\n\n /**\n * Dynamically shows a toolbar item by key.\n */\n public ShowToolbarItem(key: FormToolbarItemKey): void {\n this.FormComponent?.ShowToolbarItem(key);\n }\n\n /**\n * Dynamically disables a toolbar item by key, with an optional reason string for the tooltip.\n */\n public DisableToolbarItem(key: FormToolbarItemKey, reason?: string): void {\n this.FormComponent?.DisableToolbarItem(key, reason);\n }\n\n /**\n * Dynamically enables a toolbar item by key.\n */\n public EnableToolbarItem(key: FormToolbarItemKey): void {\n this.FormComponent?.EnableToolbarItem(key);\n }\n\n /**\n * Sets the numeric display order for a toolbar item.\n */\n public SetToolbarItemOrder(key: FormToolbarItemKey, order: number): void {\n this.FormComponent?.SetToolbarItemOrder(key, order);\n }\n}\n"]}
1
+ {"version":3,"file":"base-form-panel.js","sourceRoot":"","sources":["../../../src/lib/panel-slot/base-form-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAc,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;;AAkHxF;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,OAAgB,aAAa;IAC/B;;;;OAIG;IAEM,WAAW,GAAG,UAAU,CAAC;IAElC,6EAA6E;IACpE,MAAM,CAAW;IAC1B,kGAAkG;IACzF,aAAa,CAAqB;IAC3C,qGAAqG;IAC5F,WAAW,CAAe;IAEnC;;;;;OAKG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,aAAa,EAAE,QAAQ,IAAI,KAAK,CAAC;IACjD,CAAC;IAED;;;;;;OAMG;IACI,QAAQ;QACX,6EAA6E;QAC7E,6DAA6D;QAC7D,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,wCAAwC;IACjC,QAAQ;QACX,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC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input } from '@angular/core';\nimport { BaseEntity, ValidationResult, type FormInclusion } from '@memberjunction/core';\nimport { BaseFormComponent } from '../base-form-component';\nimport { FormContext } from '../types/form-types';\nimport { FormToolbarItemConfig, FormToolbarItemKey } from '../types/form-toolbar-item';\n\n/**\n * Well-known slot positions where panels can be injected into a generated\n * entity form. Used as the `slot` field in a panel's registration metadata.\n *\n * Slot positions inside the form, top to bottom:\n *\n * ┌─ <mj-record-form-container>\n * │ [top-area slot] ← CodeGen-emitted; rare (entities with top-area section)\n * │ [before-fields slot] ← CodeGen-emitted; banners / warnings above field panels\n * │ <connection details>\n * │ <other generated field panels>\n * │ [after-fields slot] ← CodeGen-emitted; typed config knobs, secondary settings — most common slot\n * │ <content items grid>\n * │ <other related-entity grids>\n * │ [after-related slot] ← CodeGen-emitted; bottom-of-form addenda\n * │ [after-everything slot] ← Container-emitted; ALWAYS present (fallback target)\n * └─ </mj-record-form-container>\n *\n * Pick the slot that matches the panel's role. `after-fields` is the default\n * for most \"additional settings\" panels — it sits in the field column, before\n * the related-entity grids.\n *\n * **Fallback behavior** — see `FormSlotCoordinator`. If the registered slot is\n * missing in the current form (CodeGen hasn't been rerun against the new\n * template emitter), the panel walks forward in the chain until it finds an\n * existing slot. `after-everything` is always emitted by the container, so\n * fallback never dead-ends. Pre-CodeGen-regen forms show every panel at the\n * bottom of the form; post-regen forms show them in the preferred position.\n */\nexport type FormPanelSlot =\n | 'top-area'\n | 'before-fields'\n | 'after-fields'\n | 'after-related'\n | 'after-everything';\n\n/**\n * Shape of the `metadata` object every BaseFormPanel registration MUST attach\n * via `@RegisterClass(BaseFormPanel, { metadata: {...} })`. The\n * `<mj-form-panel-slot>` host filters registrations by matching against this\n * shape — registrations without it are silently ignored.\n *\n * - `entity` — the exact entity name (case-sensitive equality enforced by the\n * slot host), OR the wildcard `'*'` to register an\n * **entity-agnostic** panel that mounts on EVERY entity's form.\n * Wildcard panels are expected to self-hide (render nothing) when\n * they don't apply to the current record, so the cross-cutting\n * registration stays unobtrusive on forms it has no business on.\n * - `slot` — which slot the panel renders into.\n * - `sortKey`— higher = earlier within the slot. Defaults to 0 if omitted.\n * Use ranges (e.g., 100/50/10) so future panels can wedge in\n * without recomputing every neighbor's sort.\n */\nexport interface FormPanelRegistrationMetadata extends Record<string, unknown> {\n entity: string;\n slot: FormPanelSlot;\n sortKey?: number;\n /**\n * Identity for last-wins collapse. Two registrations with the same key\n * compete; highest ClassFactory `Priority` wins. Omit to derive:\n * `related:${relatedEntity}:${relatedJoinField}` when claiming a\n * relationship, otherwise the registration is unique and never collapses.\n */\n contributionKey?: string;\n /**\n * When set, this panel **replaces** the default related-entity grid for\n * that relationship on `entity`'s form. The baked CodeGen panel (if any)\n * is hidden; the stock fill-in grid is not mounted.\n */\n relatedEntity?: string;\n /**\n * Disambiguates two FKs to the same related entity (BillTo vs ShipTo).\n * Compared after stripping wrapping `[]`.\n */\n relatedJoinField?: string;\n /**\n * CodeGen `SectionKey` of a baked field (or other) panel this contribution\n * replaces — e.g. `'details'`, `'personalIdentity'`. Hidden at runtime via\n * `HiddenSectionKeys`. Use with `slot: 'before-fields'` for a form hero that\n * is not a collapsible panel. Must name a concrete `entity` (not `'*'`).\n */\n replacesSectionKey?: string;\n /**\n * Pin this contribution to a chrome bucket instead of its own rail item.\n * `'details'` — leftover own-fields group. `'more'` — overflow folder.\n */\n chromeGroup?: 'details' | 'more';\n /**\n * L1 inclusion for this contribution (same verbs as relationships).\n * `'Primary'` — own first-class rail item, in the lead band before Details.\n * `'More'` — overflow folder. `'None'` — hidden.\n * L3 `MJ: Form Chrome Rules` still wins. `chromeGroup` still merges.\n */\n inclusion?: FormInclusion;\n\n /**\n * Open a NEW (unsaved) record on this contribution instead of the first first-class group.\n *\n * A saved record opens where the user last was, or on the lead group. That is right for reading a\n * record and wrong for creating one: the lead group is usually a summary, and a summary of a record\n * with no data is a page of blanks the user has to look past to find where typing starts.\n *\n * Only consulted when the record is unsaved, so it cannot change how an existing record opens.\n * If several contributions on one entity set it, the highest ClassFactory `Priority` wins, matching\n * how every other conflict between registrations is settled.\n */\n leadsWhenUnsaved?: boolean;\n}\n\n/**\n * Abstract base for every dynamically-injectable form panel.\n *\n * Subclasses are standalone Angular components decorated with\n * `@RegisterClass(BaseFormPanel, { metadata: { entity, slot, sortKey? } })`.\n * At runtime, `<mj-form-panel-slot>` discovers matching registrations via\n * `ClassFactory.GetAllRegistrationsByMetadata`, instantiates each via\n * `ViewContainerRef.createComponent`, and wires `Record` + `FormComponent` +\n * `FormContext` into the inputs.\n *\n * Lifecycle hooks: standard Angular `ngOnInit` / `ngOnDestroy` work as usual.\n * `Record` is guaranteed to be set before the first change-detection pass.\n *\n * Optional `validate()` returns a synchronous validation result; the parent\n * `BaseFormComponent.Save()` path will surface it via the existing validation\n * pipeline when called. Panels that don't validate anything beyond what the\n * record itself does can leave this method off.\n */\n@Directive()\nexport abstract class BaseFormPanel<TRecord extends BaseEntity = BaseEntity> {\n /**\n * Slot-mounted hosts must not sit in the left-nav flex column — leftover\n * height targets `mj-collapsible-panel` as a direct child of\n * `.mj-forms-all-panels`. `display: contents` makes the inner panel that child.\n */\n @HostBinding('style.display')\n readonly HostDisplay = 'contents';\n\n /** The entity record being edited. Set by the slot host before view init. */\n @Input() Record!: TRecord;\n /** The host form component (use for EditMode, dirty notifications, etc). Set by the slot host. */\n @Input() FormComponent!: BaseFormComponent;\n /** Optional form context — same shape the collapsible-panel chrome expects. Set by the slot host. */\n @Input() FormContext?: FormContext;\n\n /**\n * Convenience getter for read-only / edit-mode rendering. Falls back to\n * `false` when the panel is shown outside a `BaseFormComponent` host (e.g.,\n * a dashboard quick-edit dialog reusing the same panel — see the\n * \"composable panel\" docs).\n */\n public get EditMode(): boolean {\n return this.FormComponent?.EditMode ?? false;\n }\n\n /**\n * Override to add per-panel validation that should block the parent form's\n * Save(). Return `{ Success: true, Errors: [] }` when valid, or include\n * `ValidationErrorInfo` entries to surface field-level errors. The default\n * implementation reports valid (panels that don't need extra validation\n * can leave this method off).\n */\n public Validate(): ValidationResult {\n // Inline construction — ValidationResult is a class in @memberjunction/core,\n // not a plain interface, so callers can construct via `new`.\n const result = new ValidationResult();\n result.Success = true;\n return result;\n }\n\n /** @deprecated Use {@link Validate}. */\n public validate(): ValidationResult {\n return this.Validate();\n }\n\n /**\n * Called after the parent form reloads the current record from the database.\n * Default is a no-op. Override to refresh panel-owned data that is not a\n * related-entity grid (those already subscribe to\n * {@link FormRecordRefreshCoordinator} themselves).\n */\n public OnRecordRefreshed(_record: TRecord): void {\n // Subclasses can override\n }\n\n /**\n * Registers a dynamic toolbar action item / button into the host form toolbar.\n */\n public RegisterToolbarItem(item: FormToolbarItemConfig): void {\n this.FormComponent?.RegisterToolbarItem(item);\n }\n\n /**\n * Unregisters a previously registered dynamic toolbar item by key.\n */\n public UnregisterToolbarItem(key: string): void {\n this.FormComponent?.UnregisterToolbarItem(key);\n }\n\n /**\n * Configures overrides for any toolbar item (standard built-in items like 'edit',\n * 'delete', 'favorite', 'history', etc., or custom items).\n */\n public ConfigureToolbarItem(key: FormToolbarItemKey, overrides: Partial<FormToolbarItemConfig>): void {\n this.FormComponent?.ConfigureToolbarItem(key, overrides);\n }\n\n /**\n * Dynamically hides a toolbar item by key.\n */\n public HideToolbarItem(key: FormToolbarItemKey): void {\n this.FormComponent?.HideToolbarItem(key);\n }\n\n /**\n * Dynamically shows a toolbar item by key.\n */\n public ShowToolbarItem(key: FormToolbarItemKey): void {\n this.FormComponent?.ShowToolbarItem(key);\n }\n\n /**\n * Dynamically disables a toolbar item by key, with an optional reason string for the tooltip.\n */\n public DisableToolbarItem(key: FormToolbarItemKey, reason?: string): void {\n this.FormComponent?.DisableToolbarItem(key, reason);\n }\n\n /**\n * Dynamically enables a toolbar item by key.\n */\n public EnableToolbarItem(key: FormToolbarItemKey): void {\n this.FormComponent?.EnableToolbarItem(key);\n }\n\n /**\n * Sets the numeric display order for a toolbar item.\n */\n public SetToolbarItemOrder(key: FormToolbarItemKey, order: number): void {\n this.FormComponent?.SetToolbarItemOrder(key, order);\n }\n}\n"]}
@@ -58,6 +58,18 @@ export declare function ResolveContributionKey(meta: FormPanelRegistrationMetada
58
58
  * appended so BillTo / ShipTo do not collide.
59
59
  */
60
60
  export declare function RelatedEntitySectionKey(relationship: FormContributionRelationship, displayInFormPeers: readonly FormContributionRelationship[]): string;
61
+ /**
62
+ * Builds a function that returns {@link RelatedEntitySectionKey}`(relationship, displayInFormPeers)`
63
+ * for any relationship, against the ONE peer set passed here. Build it once per peer set, then
64
+ * call it once per relationship. The relationship does not have to be in the peer set; it is keyed
65
+ * by how many peers share its related entity.
66
+ *
67
+ * Building counts each related entity once, so keying all n peers is O(n). Calling
68
+ * RelatedEntitySectionKey per peer is O(n²), which on an entity with ~150 DisplayInForm
69
+ * relationships (MJ: Users), resolved on every change-detection pass, pegged a CPU core.
70
+ * The returned function reflects the peers as they were when it was built.
71
+ */
72
+ export declare function CreateRelatedEntitySectionKeyResolver(displayInFormPeers: readonly FormContributionRelationship[]): (relationship: FormContributionRelationship) => string;
61
73
  export declare function RelationshipDisplayName(relationship: FormContributionRelationship): string;
62
74
  /**
63
75
  * Last-wins collapse by contributionKey (or derived related key).
@@ -1 +1 @@
1
- {"version":3,"file":"form-contribution.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-contribution.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEjF,0FAA0F;AAC1F,MAAM,WAAW,4BAA4B;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,QA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AAE,SAAS,4BAA4B,EAAE,GACvD,MAAM,EAAE,CAEV"}
@@ -9,7 +9,7 @@
9
9
  * (`angular-codegen.ts` `camelCase` + related-entity sectionKey). If they drift,
10
10
  * hide-baked and skip-baked miss and the user sees a double grid.
11
11
  */
12
- import { UUIDsEqual } from '@memberjunction/global';
12
+ import { NormalizeUUID, UUIDsEqual } from '@memberjunction/global';
13
13
  /** Strip wrapping [] from a join field, matching CodeGen's tab-name helper. */
14
14
  export function StripJoinFieldBrackets(joinField) {
15
15
  return (joinField ?? '').trim().replace(/^\[/, '').replace(/\]$/, '');
@@ -47,12 +47,43 @@ export function ResolveContributionKey(meta) {
47
47
  * appended so BillTo / ShipTo do not collide.
48
48
  */
49
49
  export function RelatedEntitySectionKey(relationship, displayInFormPeers) {
50
- const sameEntity = displayInFormPeers.filter((peer) => UUIDsEqual(peer.RelatedEntityID, relationship.RelatedEntityID));
51
- if (sameEntity.length > 1) {
50
+ // Normalize the target once and stop at the second match. UUIDsEqual's `===` fast path
51
+ // misses on every peer that points elsewhere, so a filter over UUIDsEqual lowercases both
52
+ // sides of every comparison. To key many relationships against the same peers, use
53
+ // CreateRelatedEntitySectionKeyResolver instead.
54
+ const target = NormalizeUUID(relationship.RelatedEntityID);
55
+ let sameEntityCount = 0;
56
+ for (const peer of displayInFormPeers) {
57
+ if (NormalizeUUID(peer.RelatedEntityID) === target && ++sameEntityCount > 1)
58
+ break;
59
+ }
60
+ return relatedSectionKey(relationship, sameEntityCount > 1);
61
+ }
62
+ function relatedSectionKey(relationship, sharesRelatedEntity) {
63
+ if (sharesRelatedEntity) {
52
64
  return FormSectionCamelCase(`${relationship.RelatedEntity} ${StripJoinFieldBrackets(relationship.RelatedEntityJoinField)}`);
53
65
  }
54
66
  return FormSectionCamelCase(relationship.RelatedEntity);
55
67
  }
68
+ /**
69
+ * Builds a function that returns {@link RelatedEntitySectionKey}`(relationship, displayInFormPeers)`
70
+ * for any relationship, against the ONE peer set passed here. Build it once per peer set, then
71
+ * call it once per relationship. The relationship does not have to be in the peer set; it is keyed
72
+ * by how many peers share its related entity.
73
+ *
74
+ * Building counts each related entity once, so keying all n peers is O(n). Calling
75
+ * RelatedEntitySectionKey per peer is O(n²), which on an entity with ~150 DisplayInForm
76
+ * relationships (MJ: Users), resolved on every change-detection pass, pegged a CPU core.
77
+ * The returned function reflects the peers as they were when it was built.
78
+ */
79
+ export function CreateRelatedEntitySectionKeyResolver(displayInFormPeers) {
80
+ const countByEntityID = new Map();
81
+ for (const peer of displayInFormPeers) {
82
+ const id = NormalizeUUID(peer.RelatedEntityID);
83
+ countByEntityID.set(id, (countByEntityID.get(id) ?? 0) + 1);
84
+ }
85
+ return (relationship) => relatedSectionKey(relationship, (countByEntityID.get(NormalizeUUID(relationship.RelatedEntityID)) ?? 0) > 1);
86
+ }
56
87
  export function RelationshipDisplayName(relationship) {
57
88
  const named = relationship.DisplayName?.trim();
58
89
  const raw = named && named.length > 0 ? named : relationship.RelatedEntity;
@@ -113,7 +144,7 @@ function collapseRegistrations(registrations) {
113
144
  }
114
145
  return winners;
115
146
  }
116
- function stockWinner(relationship, peers) {
147
+ function stockWinner(relationship, sectionKey) {
117
148
  const join = StripJoinFieldBrackets(relationship.RelatedEntityJoinField);
118
149
  return {
119
150
  ContributionKey: RelatedContributionKey(relationship.RelatedEntity, join),
@@ -123,7 +154,7 @@ function stockWinner(relationship, peers) {
123
154
  Kind: 'stock-grid',
124
155
  RelatedEntity: relationship.RelatedEntity,
125
156
  RelatedJoinField: join,
126
- BakedSectionKey: RelatedEntitySectionKey(relationship, peers),
157
+ BakedSectionKey: sectionKey,
127
158
  DisplayName: RelationshipDisplayName(relationship),
128
159
  };
129
160
  }
@@ -159,6 +190,7 @@ export function ResolveFormContributions(input) {
159
190
  const peers = visibleRelationships(input.RelatedEntities, input.IsaChildEntityIDs);
160
191
  const collapsed = collapseRegistrations(applicableRegistrations(input.EntityName, input.Registrations));
161
192
  const baked = new Set(input.BakedSectionKeys);
193
+ const sectionKeyOf = CreateRelatedEntitySectionKeyResolver(peers);
162
194
  const claimedKeys = new Set();
163
195
  const registered = [];
164
196
  for (const [key, reg] of collapsed) {
@@ -173,7 +205,7 @@ export function ResolveFormContributions(input) {
173
205
  return StripJoinFieldBrackets(rel.RelatedEntityJoinField) === wantJoin;
174
206
  })
175
207
  : undefined;
176
- const sectionKey = peer ? RelatedEntitySectionKey(peer, peers) : '';
208
+ const sectionKey = peer ? sectionKeyOf(peer) : '';
177
209
  if (related) {
178
210
  claimedKeys.add(key);
179
211
  // A claim that omits the join field covers every FK to that entity.
@@ -190,7 +222,7 @@ export function ResolveFormContributions(input) {
190
222
  if (input.ShowRelatedEntities) {
191
223
  for (const rel of peers) {
192
224
  const key = RelatedContributionKey(rel.RelatedEntity, rel.RelatedEntityJoinField);
193
- const sectionKey = RelatedEntitySectionKey(rel, peers);
225
+ const sectionKey = sectionKeyOf(rel);
194
226
  if (claimedKeys.has(key)) {
195
227
  if (baked.has(sectionKey))
196
228
  hiddenBaked.push(sectionKey);
@@ -198,13 +230,13 @@ export function ResolveFormContributions(input) {
198
230
  }
199
231
  if (baked.has(sectionKey))
200
232
  continue;
201
- stock.push(stockWinner(rel, peers));
233
+ stock.push(stockWinner(rel, sectionKey));
202
234
  }
203
235
  }
204
236
  else {
205
237
  for (const rel of peers) {
206
238
  const key = RelatedContributionKey(rel.RelatedEntity, rel.RelatedEntityJoinField);
207
- const sectionKey = RelatedEntitySectionKey(rel, peers);
239
+ const sectionKey = sectionKeyOf(rel);
208
240
  if (claimedKeys.has(key) && baked.has(sectionKey))
209
241
  hiddenBaked.push(sectionKey);
210
242
  }
@@ -226,6 +258,7 @@ export function ContributionHiddenSectionKeys(entityName, relatedEntities, isaCh
226
258
  ShowRelatedEntities: true,
227
259
  });
228
260
  const peers = visibleRelationships(relatedEntities, isaChildEntityIDs);
261
+ const sectionKeyOf = CreateRelatedEntitySectionKeyResolver(peers);
229
262
  const keys = [];
230
263
  for (const winner of resolved.Winners) {
231
264
  if (winner.Kind !== 'registered')
@@ -242,7 +275,7 @@ export function ContributionHiddenSectionKeys(entityName, relatedEntities, isaCh
242
275
  return StripJoinFieldBrackets(rel.RelatedEntityJoinField) === winner.RelatedJoinField;
243
276
  });
244
277
  if (peer)
245
- keys.push(RelatedEntitySectionKey(peer, peers));
278
+ keys.push(sectionKeyOf(peer));
246
279
  }
247
280
  return keys;
248
281
  }