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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/dist/lib/apply/form-placement-dialog.component.d.ts +266 -0
  2. package/dist/lib/apply/form-placement-dialog.component.d.ts.map +1 -0
  3. package/dist/lib/apply/form-placement-dialog.component.js +1522 -0
  4. package/dist/lib/apply/form-placement-dialog.component.js.map +1 -0
  5. package/dist/lib/apply/form-placement-order.d.ts +37 -0
  6. package/dist/lib/apply/form-placement-order.d.ts.map +1 -0
  7. package/dist/lib/apply/form-placement-order.js +111 -0
  8. package/dist/lib/apply/form-placement-order.js.map +1 -0
  9. package/dist/lib/apply/form-placement-preview.component.d.ts +112 -0
  10. package/dist/lib/apply/form-placement-preview.component.d.ts.map +1 -0
  11. package/dist/lib/apply/form-placement-preview.component.js +346 -0
  12. package/dist/lib/apply/form-placement-preview.component.js.map +1 -0
  13. package/dist/lib/apply/form-placement-text.d.ts +61 -0
  14. package/dist/lib/apply/form-placement-text.d.ts.map +1 -0
  15. package/dist/lib/apply/form-placement-text.js +279 -0
  16. package/dist/lib/apply/form-placement-text.js.map +1 -0
  17. package/dist/lib/apply/form-placement.d.ts +320 -0
  18. package/dist/lib/apply/form-placement.d.ts.map +1 -0
  19. package/dist/lib/apply/form-placement.js +432 -0
  20. package/dist/lib/apply/form-placement.js.map +1 -0
  21. package/dist/lib/apply/form-slot-probe.service.d.ts +121 -0
  22. package/dist/lib/apply/form-slot-probe.service.d.ts.map +1 -0
  23. package/dist/lib/apply/form-slot-probe.service.js +264 -0
  24. package/dist/lib/apply/form-slot-probe.service.js.map +1 -0
  25. package/dist/lib/base-form-component-internals.d.ts +11 -0
  26. package/dist/lib/base-form-component-internals.d.ts.map +1 -0
  27. package/dist/lib/base-form-component-internals.js +33 -0
  28. package/dist/lib/base-form-component-internals.js.map +1 -0
  29. package/dist/lib/base-form-component.d.ts +166 -1
  30. package/dist/lib/base-form-component.d.ts.map +1 -1
  31. package/dist/lib/base-form-component.js +296 -20
  32. package/dist/lib/base-form-component.js.map +1 -1
  33. package/dist/lib/chrome/form-chrome.d.ts +78 -0
  34. package/dist/lib/chrome/form-chrome.d.ts.map +1 -1
  35. package/dist/lib/chrome/form-chrome.js +128 -2
  36. package/dist/lib/chrome/form-chrome.js.map +1 -1
  37. package/dist/lib/chrome/form-composition-registry.d.ts +34 -0
  38. package/dist/lib/chrome/form-composition-registry.d.ts.map +1 -0
  39. package/dist/lib/chrome/form-composition-registry.js +56 -0
  40. package/dist/lib/chrome/form-composition-registry.js.map +1 -0
  41. package/dist/lib/chrome/form-composition-snapshot.d.ts +151 -0
  42. package/dist/lib/chrome/form-composition-snapshot.d.ts.map +1 -0
  43. package/dist/lib/chrome/form-composition-snapshot.js +137 -0
  44. package/dist/lib/chrome/form-composition-snapshot.js.map +1 -0
  45. package/dist/lib/chrome/resolve-form-chrome.d.ts +15 -0
  46. package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
  47. package/dist/lib/chrome/resolve-form-chrome.js +31 -2
  48. package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
  49. package/dist/lib/container/record-form-container.component.d.ts +261 -5
  50. package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
  51. package/dist/lib/container/record-form-container.component.js +1180 -371
  52. package/dist/lib/container/record-form-container.component.js.map +1 -1
  53. package/dist/lib/duplicate-entry-check/duplicate-entry-check.d.ts +150 -0
  54. package/dist/lib/duplicate-entry-check/duplicate-entry-check.d.ts.map +1 -0
  55. package/dist/lib/duplicate-entry-check/duplicate-entry-check.js +263 -0
  56. package/dist/lib/duplicate-entry-check/duplicate-entry-check.js.map +1 -0
  57. package/dist/lib/field/form-field.component.d.ts +22 -0
  58. package/dist/lib/field/form-field.component.d.ts.map +1 -1
  59. package/dist/lib/field/form-field.component.js +51 -6
  60. package/dist/lib/field/form-field.component.js.map +1 -1
  61. package/dist/lib/form-field-edit.coordinator.d.ts +25 -0
  62. package/dist/lib/form-field-edit.coordinator.d.ts.map +1 -0
  63. package/dist/lib/form-field-edit.coordinator.js +27 -0
  64. package/dist/lib/form-field-edit.coordinator.js.map +1 -0
  65. package/dist/lib/form-state.service.d.ts +5 -0
  66. package/dist/lib/form-state.service.d.ts.map +1 -1
  67. package/dist/lib/form-state.service.js +6 -1
  68. package/dist/lib/form-state.service.js.map +1 -1
  69. package/dist/lib/host/entity-form-host.component.d.ts +16 -1
  70. package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
  71. package/dist/lib/host/entity-form-host.component.js +27 -6
  72. package/dist/lib/host/entity-form-host.component.js.map +1 -1
  73. package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts +24 -0
  74. package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts.map +1 -0
  75. package/dist/lib/interactive-form/form-panel-host-props.builder.js +99 -0
  76. package/dist/lib/interactive-form/form-panel-host-props.builder.js.map +1 -0
  77. package/dist/lib/interactive-form/interactive-form-panel.component.d.ts +109 -0
  78. package/dist/lib/interactive-form/interactive-form-panel.component.d.ts.map +1 -0
  79. package/dist/lib/interactive-form/interactive-form-panel.component.js +424 -0
  80. package/dist/lib/interactive-form/interactive-form-panel.component.js.map +1 -0
  81. package/dist/lib/interactive-form/interactive-form.component.d.ts +2 -0
  82. package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
  83. package/dist/lib/interactive-form/interactive-form.component.js +4 -5
  84. package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
  85. package/dist/lib/panel/collapsible-panel.component.d.ts +69 -1
  86. package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
  87. package/dist/lib/panel/collapsible-panel.component.js +148 -12
  88. package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
  89. package/dist/lib/panel-manager/form-audience.d.ts +46 -0
  90. package/dist/lib/panel-manager/form-audience.d.ts.map +1 -0
  91. package/dist/lib/panel-manager/form-audience.js +34 -0
  92. package/dist/lib/panel-manager/form-audience.js.map +1 -0
  93. package/dist/lib/panel-manager/form-panel-admin.service.d.ts +150 -0
  94. package/dist/lib/panel-manager/form-panel-admin.service.d.ts.map +1 -0
  95. package/dist/lib/panel-manager/form-panel-admin.service.js +433 -0
  96. package/dist/lib/panel-manager/form-panel-admin.service.js.map +1 -0
  97. package/dist/lib/panel-manager/form-panel-inventory.d.ts +255 -0
  98. package/dist/lib/panel-manager/form-panel-inventory.d.ts.map +1 -0
  99. package/dist/lib/panel-manager/form-panel-inventory.js +293 -0
  100. package/dist/lib/panel-manager/form-panel-inventory.js.map +1 -0
  101. package/dist/lib/panel-manager/panel-manager.component.d.ts +232 -0
  102. package/dist/lib/panel-manager/panel-manager.component.d.ts.map +1 -0
  103. package/dist/lib/panel-manager/panel-manager.component.js +1112 -0
  104. package/dist/lib/panel-manager/panel-manager.component.js.map +1 -0
  105. package/dist/lib/panel-slot/base-contribution-panel.d.ts +40 -0
  106. package/dist/lib/panel-slot/base-contribution-panel.d.ts.map +1 -0
  107. package/dist/lib/panel-slot/base-contribution-panel.js +55 -0
  108. package/dist/lib/panel-slot/base-contribution-panel.js.map +1 -0
  109. package/dist/lib/panel-slot/base-form-panel.d.ts +116 -8
  110. package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
  111. package/dist/lib/panel-slot/base-form-panel.js +76 -5
  112. package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
  113. package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts +29 -0
  114. package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts.map +1 -0
  115. package/dist/lib/panel-slot/collect-form-contribution-registrations.js +214 -0
  116. package/dist/lib/panel-slot/collect-form-contribution-registrations.js.map +1 -0
  117. package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts +6 -3
  118. package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts.map +1 -1
  119. package/dist/lib/panel-slot/collect-form-panel-registrations.js +8 -14
  120. package/dist/lib/panel-slot/collect-form-panel-registrations.js.map +1 -1
  121. package/dist/lib/panel-slot/form-contribution.d.ts +170 -7
  122. package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
  123. package/dist/lib/panel-slot/form-contribution.js +242 -64
  124. package/dist/lib/panel-slot/form-contribution.js.map +1 -1
  125. package/dist/lib/panel-slot/form-contributions.component.d.ts +16 -5
  126. package/dist/lib/panel-slot/form-contributions.component.d.ts.map +1 -1
  127. package/dist/lib/panel-slot/form-contributions.component.js +43 -7
  128. package/dist/lib/panel-slot/form-contributions.component.js.map +1 -1
  129. package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts +66 -0
  130. package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts.map +1 -0
  131. package/dist/lib/panel-slot/form-field-panel-slot.component.js +190 -0
  132. package/dist/lib/panel-slot/form-field-panel-slot.component.js.map +1 -0
  133. package/dist/lib/panel-slot/form-panel-slot.component.d.ts +52 -16
  134. package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
  135. package/dist/lib/panel-slot/form-panel-slot.component.js +190 -66
  136. package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
  137. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +11 -0
  138. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
  139. package/dist/lib/panel-slot/form-slot-coordinator.service.js +17 -0
  140. package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
  141. package/dist/lib/panel-slot/merge-panel-validation.d.ts +7 -0
  142. package/dist/lib/panel-slot/merge-panel-validation.d.ts.map +1 -0
  143. package/dist/lib/panel-slot/merge-panel-validation.js +16 -0
  144. package/dist/lib/panel-slot/merge-panel-validation.js.map +1 -0
  145. package/dist/lib/panel-slot/mount-form-contribution.d.ts +15 -0
  146. package/dist/lib/panel-slot/mount-form-contribution.d.ts.map +1 -0
  147. package/dist/lib/panel-slot/mount-form-contribution.js +37 -0
  148. package/dist/lib/panel-slot/mount-form-contribution.js.map +1 -0
  149. package/dist/lib/panel-slot/panel-hides.d.ts +35 -0
  150. package/dist/lib/panel-slot/panel-hides.d.ts.map +1 -0
  151. package/dist/lib/panel-slot/panel-hides.js +111 -0
  152. package/dist/lib/panel-slot/panel-hides.js.map +1 -0
  153. package/dist/lib/panel-slot/placement-preview-panel.component.d.ts +16 -0
  154. package/dist/lib/panel-slot/placement-preview-panel.component.d.ts.map +1 -0
  155. package/dist/lib/panel-slot/placement-preview-panel.component.js +112 -0
  156. package/dist/lib/panel-slot/placement-preview-panel.component.js.map +1 -0
  157. package/dist/lib/panel-slot/placement-preview.d.ts +57 -0
  158. package/dist/lib/panel-slot/placement-preview.d.ts.map +1 -0
  159. package/dist/lib/panel-slot/placement-preview.js +86 -0
  160. package/dist/lib/panel-slot/placement-preview.js.map +1 -0
  161. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
  162. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
  163. package/dist/lib/panel-slot/related-entity-grid-panel.component.js +10 -3
  164. package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
  165. package/dist/lib/panel-slot/slot-order.d.ts +19 -0
  166. package/dist/lib/panel-slot/slot-order.d.ts.map +1 -0
  167. package/dist/lib/panel-slot/slot-order.js +53 -0
  168. package/dist/lib/panel-slot/slot-order.js.map +1 -0
  169. package/dist/lib/resolver/form-resolver.service.d.ts +4 -2
  170. package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -1
  171. package/dist/lib/resolver/form-resolver.service.js +18 -8
  172. package/dist/lib/resolver/form-resolver.service.js.map +1 -1
  173. package/dist/lib/resolver/form-variants.d.ts +28 -0
  174. package/dist/lib/resolver/form-variants.d.ts.map +1 -0
  175. package/dist/lib/resolver/form-variants.js +40 -0
  176. package/dist/lib/resolver/form-variants.js.map +1 -0
  177. package/dist/lib/section-counts/form-section-counts.d.ts +99 -0
  178. package/dist/lib/section-counts/form-section-counts.d.ts.map +1 -0
  179. package/dist/lib/section-counts/form-section-counts.js +223 -0
  180. package/dist/lib/section-counts/form-section-counts.js.map +1 -0
  181. package/dist/lib/toolbar/form-toolbar.component.d.ts +129 -2
  182. package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
  183. package/dist/lib/toolbar/form-toolbar.component.js +974 -307
  184. package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
  185. package/dist/lib/types/form-events.d.ts +6 -0
  186. package/dist/lib/types/form-events.d.ts.map +1 -1
  187. package/dist/lib/types/form-events.js +6 -0
  188. package/dist/lib/types/form-events.js.map +1 -1
  189. package/dist/lib/types/form-toolbar-item.d.ts +20 -1
  190. package/dist/lib/types/form-toolbar-item.d.ts.map +1 -1
  191. package/dist/lib/types/form-toolbar-item.js.map +1 -1
  192. package/dist/lib/types/form-types.d.ts +13 -0
  193. package/dist/lib/types/form-types.d.ts.map +1 -1
  194. package/dist/lib/types/form-types.js.map +1 -1
  195. package/dist/lib/types/toolbar-config.d.ts +16 -0
  196. package/dist/lib/types/toolbar-config.d.ts.map +1 -1
  197. package/dist/lib/types/toolbar-config.js +3 -0
  198. package/dist/lib/types/toolbar-config.js.map +1 -1
  199. package/dist/module.d.ts +29 -22
  200. package/dist/module.d.ts.map +1 -1
  201. package/dist/module.js +50 -8
  202. package/dist/module.js.map +1 -1
  203. package/dist/public-api.d.ts +22 -0
  204. package/dist/public-api.d.ts.map +1 -1
  205. package/dist/public-api.js +24 -0
  206. package/dist/public-api.js.map +1 -1
  207. package/package.json +20 -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,EAAE,UAAU,EAAE,MAAM,EAEtE,eAAe,EAAa,WAAW,EAAE,YAAY,EAAE,UAAU,EACjE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W;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"]}
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;AAErE,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,u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,KAAK;;kBAGL,KAAK;;kBAML,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBASL,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;;kBA8C3D,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,mBAAmB;;kBAK/B,WAAW;mBAAC,gBAAgB;;kBAS5B,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,uBAAuB;;kBAKnC,WAAW;mBAAC,OAAO;;kBAmDnB,WAAW;mBAAC,aAAa;;kBAuBzB,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;;kFAzoBrB,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 type { BaseFormComponent } from '../base-form-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 /**\n * Flex order, for a panel the form's section order does not know about.\n *\n * `getSectionDisplayOrder` answers with the section count for an unknown key, which is\n * the highest order on the form — so a contribution panel rendered anywhere lands last\n * regardless of the slot it mounted in. A slot-derived order is passed here instead.\n */\n @Input() Order: number | null = null;\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 /**\n * The fields this panel draws, for the contributions that stand in for one and for the\n * composition snapshot the placement dialog reads.\n *\n * Held as fields rather than derived in getters: the field-panel slot treats a new array\n * as a structural change, and a getter would hand it one on every change-detection pass.\n * Recomputed only when the projected fields change.\n */\n public ClaimableFields: Array<{ Name: string; Label: string }> = [];\n\n /** Just the names, for the field-panel slot. Same lifetime as {@link ClaimableFields}. */\n public ClaimableFieldNames: string[] = [];\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 /**\n * The host form, when this panel sits in one.\n *\n * `Form` stays `unknown` because the panel is reused outside a form host; this narrows\n * it for the one place that needs the record and the provider. The import is type-only,\n * so nothing about the runtime dependency direction changes.\n */\n public get FieldPanelForm(): BaseFormComponent | null {\n return (this.Form as BaseFormComponent | undefined) ?? null;\n }\n\n /** The entity this panel's fields belong to, or '' outside a form. */\n public get FieldPanelEntity(): string {\n return this.FieldPanelForm?.record?.EntityInfo?.Name ?? '';\n }\n\n /** True when a contribution could claim one of this panel's fields. */\n public get HostsFieldPanels(): boolean {\n return this.ClaimableFieldNames.length > 0 && !!this.FieldPanelForm?.record;\n }\n\n /**\n * Flex order, in precedence: where the user put this panel, then where its host said\n * to put it, then the form's section order.\n *\n * The user's placement comes first so a dragged panel draws where it was dropped. `Order`\n * is a fixed number a host supplies (a contribution panel derives one from its slot); it\n * applies only while the user has not placed the panel.\n */\n @HostBinding('style.order')\n get CssOrder(): number {\n const formRef = this.Form as {\n getSectionDisplayOrder?: (key: string) => number;\n getSectionOrderIndex?: (key: string) => number | null;\n };\n const placed = formRef?.getSectionOrderIndex?.(this.SectionKey);\n if (placed != null) return placed;\n if (this.Order != null) return this.Order;\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 /**\n * Move one panel to another's position and store the result.\n *\n * The list this works on is every panel currently on the form in the order they are\n * drawn, not the form's declared sections. A contribution panel is in no declared\n * section list, so working from that list meant a drag involving one matched no index\n * and returned without doing anything — the handle moved and the form did not.\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 = this.visualPanelOrder(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 * Every panel on the form, in the order it is drawn.\n *\n * Ordered by each panel's own `style.order`, which is what CSS lays them out by, so a\n * panel positioned by its slot rather than by the section list still lands in the right\n * place here. Falls back to the declared order when the DOM cannot be read.\n *\n * Searched over descendants of the panels column, not over siblings: a contribution\n * panel is wrapped in its slot host, so it is not a sibling of the baked panels even\n * though it renders among them.\n */\n private visualPanelOrder(declared: readonly string[]): string[] {\n const host = this.elementRef?.nativeElement as HTMLElement | undefined;\n const column = host?.closest?.('.mj-forms-all-panels') ?? host?.parentElement;\n if (!column) return [...declared];\n\n const seen = new Set<string>();\n const found: Array<{ key: string; order: number; index: number }> = [];\n Array.from(column.querySelectorAll('[data-section-key]')).forEach((node, index) => {\n const key = node.getAttribute('data-section-key')?.trim();\n if (!key || seen.has(key)) return;\n seen.add(key);\n const raw = Number((node as HTMLElement).style?.order);\n found.push({ key, order: Number.isFinite(raw) ? raw : 0, index });\n });\n if (found.length === 0) return [...declared];\n\n const ordered = found\n .sort((a, b) => (a.order - b.order) || (a.index - b.index))\n .map((entry) => entry.key);\n // A declared section the DOM did not show — hidden, filtered — keeps its place in\n // the stored order rather than being dropped from it.\n for (const key of declared) {\n if (!seen.has(key)) ordered.push(key);\n }\n return ordered;\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 /**\n * Refresh {@link ClaimableFieldNames}, keeping the previous array when the set is\n * unchanged so the field-panel slot does not read a new reference as a new set.\n */\n private updateClaimableFieldNames(): void {\n const next: Array<{ Name: string; Label: string }> = [];\n for (const field of this.allFields()) {\n if (field.FieldName) next.push({ Name: field.FieldName, Label: field.HostFieldLabel });\n }\n const prev = this.ClaimableFields;\n const same = prev.length === next.length\n && prev.every((f, i) => f.Name === next[i].Name && f.Label === next[i].Label);\n if (same) return;\n this.ClaimableFields = next;\n this.ClaimableFieldNames = next.map((f) => f.Name);\n }\n\n private updateFieldNames(): void {\n if (this.FieldComponents) {\n this.refreshFieldNames();\n this.updateClaimableFieldNames();\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 <!-- Contributions drawn inside this section: one host above the fields, one below. A\n panel standing in for fields draws in their place; one placed in the section by its\n key replaces nothing. -->\n @if (HostsFieldPanels) {\n <mj-form-field-panel-slot\n [Entity]=\"FieldPanelEntity\"\n [FieldNames]=\"ClaimableFieldNames\"\n [SectionKey]=\"SectionKey\"\n Position=\"start\"\n [Record]=\"FieldPanelForm!.record\"\n [FormComponent]=\"FieldPanelForm!\"\n [FormContext]=\"FormContext\">\n </mj-form-field-panel-slot>\n }\n <ng-content></ng-content>\n @if (HostsFieldPanels) {\n <mj-form-field-panel-slot\n [Entity]=\"FieldPanelEntity\"\n [FieldNames]=\"ClaimableFieldNames\"\n [SectionKey]=\"SectionKey\"\n Position=\"end\"\n [Record]=\"FieldPanelForm!.record\"\n [FormComponent]=\"FieldPanelForm!\"\n [FormContext]=\"FormContext\">\n </mj-form-field-panel-slot>\n }\n </div>\n </div>\n</div>\n"]}
@@ -0,0 +1,46 @@
1
+ import { type FormScope } from '@memberjunction/core-entities';
2
+ /**
3
+ * Who a full custom form or a panel is for, and which live item publishing one replaces.
4
+ *
5
+ * Publishing changes an item's own audience — there is one row, never a copy. Whatever was live
6
+ * for that audience before has to be retired in the same transaction: otherwise the audience
7
+ * briefly sees two, or the unique index on active contributions refuses the write.
8
+ */
9
+ /** The audience an item is published to. `RoleID` is read only when the scope is `Role`. */
10
+ export interface FormAudience {
11
+ Scope: FormScope;
12
+ RoleID: string | null;
13
+ }
14
+ /** The scope columns of a form or a panel, which is all these rules read. */
15
+ export interface ScopedRow {
16
+ ID: string;
17
+ EntityID: string;
18
+ Status: string;
19
+ Scope: FormScope;
20
+ RoleID: string | null;
21
+ UserID: string | null;
22
+ /** Panels only. A full custom form has no key: one form is live per entity and audience. */
23
+ ContributionKey?: string | null;
24
+ }
25
+ /** The columns an audience writes. A personal item belongs to the caller; a shared one to nobody. */
26
+ export declare function AudienceColumns(audience: FormAudience, callerID: string): {
27
+ Scope: FormScope;
28
+ RoleID: string | null;
29
+ UserID: string | null;
30
+ };
31
+ /**
32
+ * The panel live for this audience under the same contribution key — the one publishing replaces.
33
+ *
34
+ * Only the same key: two different panels can both be live for everyone, and publishing one must
35
+ * not switch off the other. The rule is the one that decides which panel turning one on retires
36
+ * ({@link ActiveContributionSiblings}), so keys compare the way the unique index compares them.
37
+ */
38
+ export declare function LiveContributionAt(rows: readonly ScopedRow[], target: ScopedRow, audience: FormAudience, callerID: string): ScopedRow | null;
39
+ /**
40
+ * The full custom form live for this audience on the same entity — the one publishing sets aside.
41
+ *
42
+ * Forms have no key because an audience sees one at a time: whichever is live is replaced, and it
43
+ * stays in the picker to switch back to.
44
+ */
45
+ export declare function LiveOverrideAt(rows: readonly ScopedRow[], target: ScopedRow, audience: FormAudience, callerID: string): ScopedRow | null;
46
+ //# sourceMappingURL=form-audience.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-audience.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-manager/form-audience.ts"],"names":[],"mappings":"AACA,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE7G;;;;;;GAMG;AAEH,4FAA4F;AAC5F,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,6EAA6E;AAC7E,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,qGAAqG;AACrG,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,GACjB;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAMpE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,GACjB,SAAS,GAAG,IAAI,CAElB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,GACjB,SAAS,GAAG,IAAI,CAQlB"}
@@ -0,0 +1,34 @@
1
+ import { UUIDsEqual } from '@memberjunction/global';
2
+ import { ActiveContributionSiblings, SameFormAudience } from '@memberjunction/core-entities';
3
+ /** The columns an audience writes. A personal item belongs to the caller; a shared one to nobody. */
4
+ export function AudienceColumns(audience, callerID) {
5
+ return {
6
+ Scope: audience.Scope,
7
+ RoleID: audience.Scope === 'Role' ? audience.RoleID : null,
8
+ UserID: audience.Scope === 'User' ? callerID : null,
9
+ };
10
+ }
11
+ /**
12
+ * The panel live for this audience under the same contribution key — the one publishing replaces.
13
+ *
14
+ * Only the same key: two different panels can both be live for everyone, and publishing one must
15
+ * not switch off the other. The rule is the one that decides which panel turning one on retires
16
+ * ({@link ActiveContributionSiblings}), so keys compare the way the unique index compares them.
17
+ */
18
+ export function LiveContributionAt(rows, target, audience, callerID) {
19
+ return ActiveContributionSiblings(rows, { ...target, ...AudienceColumns(audience, callerID) })[0] ?? null;
20
+ }
21
+ /**
22
+ * The full custom form live for this audience on the same entity — the one publishing sets aside.
23
+ *
24
+ * Forms have no key because an audience sees one at a time: whichever is live is replaced, and it
25
+ * stays in the picker to switch back to.
26
+ */
27
+ export function LiveOverrideAt(rows, target, audience, callerID) {
28
+ const aimed = AudienceColumns(audience, callerID);
29
+ return rows.find((row) => !UUIDsEqual(row.ID, target.ID)
30
+ && row.Status === 'Active'
31
+ && UUIDsEqual(row.EntityID, target.EntityID)
32
+ && SameFormAudience(row, aimed)) ?? null;
33
+ }
34
+ //# sourceMappingURL=form-audience.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-audience.js","sourceRoot":"","sources":["../../../src/lib/panel-manager/form-audience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,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'@memberjunction/core-entities';\n\n/**\n * Who a full custom form or a panel is for, and which live item publishing one replaces.\n *\n * Publishing changes an item's own audience — there is one row, never a copy. Whatever was live\n * for that audience before has to be retired in the same transaction: otherwise the audience\n * briefly sees two, or the unique index on active contributions refuses the write.\n */\n\n/** The audience an item is published to. `RoleID` is read only when the scope is `Role`. */\nexport interface FormAudience {\n Scope: FormScope;\n RoleID: string | null;\n}\n\n/** The scope columns of a form or a panel, which is all these rules read. */\nexport interface ScopedRow {\n ID: string;\n EntityID: string;\n Status: string;\n Scope: FormScope;\n RoleID: string | null;\n UserID: string | null;\n /** Panels only. A full custom form has no key: one form is live per entity and audience. */\n ContributionKey?: string | null;\n}\n\n/** The columns an audience writes. A personal item belongs to the caller; a shared one to nobody. */\nexport function AudienceColumns(\n audience: FormAudience,\n callerID: string,\n): { Scope: FormScope; RoleID: string | null; UserID: string | null } {\n return {\n Scope: audience.Scope,\n RoleID: audience.Scope === 'Role' ? audience.RoleID : null,\n UserID: audience.Scope === 'User' ? callerID : null,\n };\n}\n\n/**\n * The panel live for this audience under the same contribution key — the one publishing replaces.\n *\n * Only the same key: two different panels can both be live for everyone, and publishing one must\n * not switch off the other. The rule is the one that decides which panel turning one on retires\n * ({@link ActiveContributionSiblings}), so keys compare the way the unique index compares them.\n */\nexport function LiveContributionAt(\n rows: readonly ScopedRow[],\n target: ScopedRow,\n audience: FormAudience,\n callerID: string,\n): ScopedRow | null {\n return ActiveContributionSiblings(rows, { ...target, ...AudienceColumns(audience, callerID) })[0] ?? null;\n}\n\n/**\n * The full custom form live for this audience on the same entity — the one publishing sets aside.\n *\n * Forms have no key because an audience sees one at a time: whichever is live is replaced, and it\n * stays in the picker to switch back to.\n */\nexport function LiveOverrideAt(\n rows: readonly ScopedRow[],\n target: ScopedRow,\n audience: FormAudience,\n callerID: string,\n): ScopedRow | null {\n const aimed = AudienceColumns(audience, callerID);\n return rows.find((row) =>\n !UUIDsEqual(row.ID, target.ID)\n && row.Status === 'Active'\n && UUIDsEqual(row.EntityID, target.EntityID)\n && SameFormAudience(row, aimed),\n ) ?? null;\n}\n"]}
@@ -0,0 +1,150 @@
1
+ import { type EntityInfo, type IMetadataProvider } from '@memberjunction/core';
2
+ import { type FormLifecycleStatus } from '@memberjunction/core-entities';
3
+ import type { FormContributionSpec } from '@memberjunction/interactive-component-types/forms';
4
+ import { type FormOverrideRow, type FormPanelContributionRow, type FormPanelRendering } from './form-panel-inventory';
5
+ import { type FormAudience } from './form-audience';
6
+ import * as i0 from "@angular/core";
7
+ /** What a write attempt did, in terms the drawer can show. */
8
+ export interface FormPanelAdminResult {
9
+ Success: boolean;
10
+ Message?: string;
11
+ }
12
+ /**
13
+ * Loads and changes the contribution rows behind one entity's form.
14
+ *
15
+ * Reads come from {@link InteractiveFormsEngine}, which already caches every row for
16
+ * every scope and status and emits when one changes — the same cache the form runtime
17
+ * reads, so the manager cannot disagree with the form it is managing.
18
+ *
19
+ * Writes go through `BaseEntity.Save()` and `.Delete()`. Direct SQL against an entity
20
+ * skips the Record Changes audit row, the server cache invalidation, entity actions and
21
+ * validation, all of which fail silently and leave a database that looks right.
22
+ *
23
+ * Turning a form or panel on follows the rule the Activate actions follow: the one live under the
24
+ * same key for the same audience is retired first, in the same transaction, and each component's
25
+ * status mirrors its row's.
26
+ */
27
+ export declare class FormPanelAdminService {
28
+ /**
29
+ * Every contribution registered on this entity, whatever its scope or status.
30
+ *
31
+ * Not `GetApplicableContributions`: that answers what should render right now, which
32
+ * excludes the drafts and switched-off rows this surface exists to bring back.
33
+ */
34
+ RowsForEntity(entity: EntityInfo | null | undefined): FormPanelContributionRow[];
35
+ /**
36
+ * Whether the entity carries any contribution row at all, whatever its status.
37
+ *
38
+ * Separate from {@link RowsForEntity} because the container asks this on every
39
+ * change-detection pass to decide whether to offer the manager, and projecting every
40
+ * row to answer a yes-or-no question allocates on the hottest path in the form runtime.
41
+ */
42
+ HasRowsForEntity(entity: EntityInfo | null | undefined): boolean;
43
+ /**
44
+ * Switches a row on or off. Off leaves the row in place, rendering for nobody. On retires the
45
+ * panel live under the same key for the same audience first, in the same transaction.
46
+ */
47
+ SetActive(rowID: string, active: boolean, provider?: IMetadataProvider | null): Promise<FormPanelAdminResult>;
48
+ /**
49
+ * Which panels on this form draw for the current user: the winner of each key, with the
50
+ * user's hidden panels left out — the same resolution the form makes. Undefined when that
51
+ * cannot be resolved, so the list falls back to each item's own status.
52
+ */
53
+ RenderingFor(entity: EntityInfo | null | undefined, provider?: IMetadataProvider | null): FormPanelRendering | undefined;
54
+ /**
55
+ * Writes a new placement onto an existing row, through the same row mapper the Create and
56
+ * Modify actions use.
57
+ *
58
+ * Every claim column is rewritten, including the ones the decision leaves out, so a claim the
59
+ * user has just dropped is actually cleared. The key is the one the decision names, or the
60
+ * one the write path derives from its grid claim or the row's component. The order,
61
+ * rail inclusion and configuration, which the placement dialog does not edit, are kept.
62
+ *
63
+ * @param status What the row is saved as: on, a draft, or off. On retires the panel live under
64
+ * the row's new key for its audience, in the same transaction.
65
+ */
66
+ SetPlacement(rowID: string, contribution: FormContributionSpec, status: FormLifecycleStatus, provider?: IMetadataProvider | null): Promise<FormPanelAdminResult>;
67
+ /** Deletes a row outright. The Component it points at is left alone. */
68
+ Remove(rowID: string, provider?: IMetadataProvider | null): Promise<FormPanelAdminResult>;
69
+ /**
70
+ * Whether the current user may publish to a role or to everyone.
71
+ *
72
+ * Only decides what the drawer draws. The server-side entity subclasses enforce the same rule
73
+ * on every save, so a client that draws itself a Publish button still has the write refused.
74
+ */
75
+ CanPublish(provider?: IMetadataProvider | null): boolean;
76
+ /**
77
+ * The full custom forms the engine holds for this entity, in every status: every shared form
78
+ * and the signed-in user's own.
79
+ */
80
+ OverridesForEntity(entity: EntityInfo | null | undefined): FormOverrideRow[];
81
+ /**
82
+ * Changes who a panel is for, and turns it on.
83
+ *
84
+ * The panel live for that audience under the same key is retired first, in the same
85
+ * transaction, so the audience never sees two and the unique index on active contributions
86
+ * never sees two either. A draft or a panel that is off goes live in the same transaction —
87
+ * publishing one never leaves the audience with neither.
88
+ */
89
+ PublishContribution(rowID: string, audience: FormAudience, provider?: IMetadataProvider | null): Promise<FormPanelAdminResult>;
90
+ /**
91
+ * Changes who a full custom form is for, and makes it live. Whichever form was live for that
92
+ * audience is set aside in the same transaction. A personal form set aside stays in its
93
+ * owner's picker, so the two can be swapped back; a role or everyone form set aside is
94
+ * retracted and no longer offered to anyone.
95
+ */
96
+ PublishOverride(overrideID: string, audience: FormAudience, provider?: IMetadataProvider | null): Promise<FormPanelAdminResult>;
97
+ /** Hides a panel from this user's form. Stored per user; nobody else is affected. */
98
+ Hide(entityName: string, key: string): void;
99
+ /** Brings a hidden panel back. */
100
+ Show(entityName: string, key: string): void;
101
+ /**
102
+ * Retire the live item for the audience, then re-aim the target and turn it on, in one
103
+ * transaction.
104
+ *
105
+ * The retirement is enqueued first because the transaction applies writes in order, and the
106
+ * unique index on active contributions would otherwise see two live rows mid-statement.
107
+ */
108
+ private publish;
109
+ /**
110
+ * Saves a panel row in `status`, in one transaction with what that carries: turning it on
111
+ * retires the panel live under its key for its audience first, and each component's status
112
+ * follows its row's.
113
+ */
114
+ private saveAs;
115
+ private begin;
116
+ /** Submits the transaction. When it fails, the reason the first refused write recorded. */
117
+ private submit;
118
+ /** Enqueues turning off a live form or panel and its component. Null when that is enqueued. */
119
+ private retire;
120
+ /** Enqueues a row's save in `status`, then its component's. Null when both are enqueued. */
121
+ private enqueue;
122
+ /**
123
+ * Enqueues the component status that mirrors `status`. A component another live row still
124
+ * renders keeps its status, and one that already has it is not written. Null unless the write
125
+ * is refused.
126
+ */
127
+ private mirrorOnComponent;
128
+ /** Whether a live form or panel outside this write still renders the component. */
129
+ private componentLiveElsewhere;
130
+ /** A fresh copy of a form or panel row, never the engine's own cached instance. */
131
+ private loadScoped;
132
+ private failure;
133
+ private contributionRows;
134
+ private overrideRows;
135
+ /**
136
+ * Load the row, hand it to the caller, then drop the memo the form runtime reads.
137
+ *
138
+ * The engine emits on its own and that clears the registration cache, but the emission
139
+ * is not guaranteed to land before the next change-detection pass, and a form still
140
+ * drawing a panel the user just removed reads as the removal having failed.
141
+ */
142
+ private write;
143
+ /** The decision, with the columns the placement dialog does not edit filled in from the row. */
144
+ private keepUneditedColumns;
145
+ private project;
146
+ private message;
147
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormPanelAdminService, never>;
148
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormPanelAdminService>;
149
+ }
150
+ //# sourceMappingURL=form-panel-admin.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-panel-admin.service.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-manager/form-panel-admin.service.ts"],"names":[],"mappings":"AACA,OAAO,EACkC,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAC/E,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAOH,KAAK,mBAAmB,EAI3B,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EAAkC,KAAK,eAAe,EAAE,KAAK,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEtJ,OAAO,EAIH,KAAK,YAAY,EAEpB,MAAM,iBAAiB,CAAC;;AAEzB,8DAA8D;AAC9D,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD;;;;;;;;;;;;;;GAcG;AACH,qBACa,qBAAqB;IAE9B;;;;;OAKG;IACI,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,EAAE;IAYvF;;;;;;OAMG;IACI,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;IAWvE;;;OAGG;IACU,SAAS,CAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,EACf,QAAQ,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