@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-placement-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/apply/form-placement-dialog.component.ts","../../../src/lib/apply/form-placement-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEpH,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,aA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AADkD,iBAAO,EACnD,EAEF;YA6CN,AAbA,AAzBA,mIAAiC,qHAyBJ,uHAaN;;YAzPc,eAA6C;YAA7C,qEAA6C;YAIhF,cAKC;YALD,uCAKC;YAED,cAKC;YALD,qDAKC;YAED,cAiLC;YAjLD,8CAiLC;YAGkD,eAAqD;YAArD,2EAAqD;YAGnE,eAAa;YAAb,iCAAa;;;iFDlJvC,8BAA8B;cAN1C,SAAS;6BACM,KAAK,YACP,0BAA0B;;kBAMnC,KAAK;;kBAiBL,KAAK;;kBAWL,KAAK;;kBAQL,KAAK;;kBASL,KAAK;;kBAML,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,MAAM;;kBAGN,MAAM;;kFA1EE,8BAA8B","sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewContainerRef, inject } from '@angular/core';\nimport type { FormContributionSlot, FormContributionSpec } from '@memberjunction/interactive-component-types/forms';\nimport {\n FORM_PLACEMENT_SLOTS,\n DefaultSlotFor,\n HasDetailsTab,\n TargetRailItem,\n ReplaceableRailTabs,\n DefaultRailKeyFor,\n ChosenFieldNames,\n DefaultFieldSectionKey,\n FieldsInSection,\n ReplacedPreviewKeys,\n SectionsWithFields,\n ShowsRail,\n SlotIsOnForm,\n InitialPlacementState,\n ChosenSectionKeys,\n ResolvePlacementDecision,\n type FormPlacementContext,\n type FormPlacementDecision,\n type FormPlacementDroppedClaim,\n type FormPlacementSection,\n type FormPlacementField,\n type FormPlacementRailItem,\n type FormPlacementReplaceMode,\n type FormPlacementSlotChoice,\n type FormPlacementState,\n} from './form-placement';\nimport {\n DescribeChosenFields,\n DescribePlacementLine,\n DescribeVisibleTo,\n SectionOptionLabel,\n SummarizePlacement,\n} from './form-placement-text';\nimport { MovedSortKey, PanelsInPosition, type PlacementOrderItem } from './form-placement-order';\nimport { FormSlotProbeService } from './form-slot-probe.service';\nimport { CompositeKey } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\n\n/**\n * Asks where a generated panel should go before anything is written.\n *\n * Presentational by design: it takes the form's composition and the component's own\n * proposal, and emits the answers. It reads nothing and saves nothing, so the host owns\n * both the fetch and the write, and this stays testable without a provider.\n *\n * Scope is not a control here. The create path clamps every contribution to the calling\n * user, deliberately — an agent must not be able to change another person's form — so the\n * dialog states the audience rather than offering a choice it cannot honour. An edit from the\n * Manage drawer keeps the panel's own audience, which the host states through {@link VisibleTo}.\n */\n@Component({\n standalone: false,\n selector: 'mj-form-placement-dialog',\n templateUrl: './form-placement-dialog.component.html',\n styleUrls: ['./form-placement-dialog.component.css'],\n})\nexport class MjFormPlacementDialogComponent extends BaseAngularComponent {\n /** What the form contains. Setting it resets the answers. */\n @Input()\n set Context(value: FormPlacementContext) {\n this._context = value;\n this.hasContext = true;\n this.resetState();\n void this.probeSlots();\n }\n get Context(): FormPlacementContext { return this._context; }\n\n /**\n * A hook to overwrite the starting answers.\n *\n * Without it the dialog starts from a fixed default. The caller seeds what only it knows:\n * a saved row's placement when editing one, or a generated panel's proposed claims when\n * applying one. It runs once the context, the proposal and the hook are all set, in\n * whatever order they arrive.\n */\n @Input()\n set SeedState(value: ((dialog: MjFormPlacementDialogComponent) => void) | null) {\n this._seedState = value;\n this.resetState();\n }\n get SeedState(): ((dialog: MjFormPlacementDialogComponent) => void) | null { return this._seedState; }\n\n /**\n * The component's own registration intent. Identity fields are read from it directly; its\n * claims reach the answers only through `SeedState`.\n */\n @Input()\n set Proposal(value: FormContributionSpec | null) {\n this._proposal = value;\n this.resetState();\n }\n get Proposal(): FormContributionSpec | null { return this._proposal; }\n\n /** Name of the component being placed, for the dialog heading. */\n @Input() ComponentName = '';\n\n /**\n * Whether to read the entity's form to find out which positions it offers.\n *\n * On by default: without it the list is the shape CodeGen produces, which is right for\n * a generated form and can be wrong for a hand-written one. A host that already knows\n * the slots, or one with no Angular form to render, turns it off.\n */\n @Input() ProbeForm = true;\n\n /**\n * The record the scaled form preview shows. Null shows a new, unsaved record, which is\n * what a dialog opened from a conversation has.\n */\n @Input() RecordKey: CompositeKey | null = null;\n\n /** The saved row being edited, which the preview leaves off so it shows only the edit. */\n @Input() ReplacesRowID: string | null = null;\n\n /** The component being placed, so the preview draws it rather than a placeholder. */\n @Input() PanelComponentSpec: ComponentSpec | null = null;\n\n /** The saved component of the panel being edited, for the same reason. */\n @Input() PanelComponentID: string | null = null;\n\n /** Who sees the panel, as the end of \"visible to …\". The caller alone unless the host says otherwise. */\n @Input() VisibleTo = DescribeVisibleTo('User');\n\n /** Offers keeping the panel off, for an edit of a panel that is off now. */\n @Input() OfferKeepOff = false;\n\n /** The user pressed Apply. */\n @Output() Applied = new EventEmitter<FormPlacementDecision>();\n\n /** The user backed out. */\n @Output() Cancelled = new EventEmitter<void>();\n\n private _context: FormPlacementContext = {\n EntityName: '',\n Sections: [],\n Related: [],\n Existing: [],\n SlotsPresent: [],\n SlotsVerified: false,\n Layout: 'accordion',\n Rail: [],\n FullCustomForm: false,\n TargetsVerified: false,\n };\n private _proposal: FormContributionSpec | null = null;\n private _seedState: ((dialog: MjFormPlacementDialogComponent) => void) | null = null;\n private hasContext = false;\n /** The answers as the seed left them, or null when no seed has run. */\n private seededAnswers: string | null = null;\n /** The fields the seeded answers stand in for. Empty when the seed made no field claim. */\n private seededFieldNames: readonly string[] = [];\n\n public State: FormPlacementState = InitialPlacementState(null, this._context);\n\n /**\n * A proposal's claim the caller's seed dropped because this form could not confirm it, for\n * the summary to report while the answers do not make that claim. Null when the seed dropped\n * none. The seed sets it; resetting the answers clears it, and so does reading the form's\n * sections, before the seed runs again against them.\n */\n public DroppedProposalClaim: FormPlacementDroppedClaim | null = null;\n\n /** Starts the answers from the default, then from the caller's seed when it can run. */\n private resetState(): void {\n this.State = InitialPlacementState(this._proposal, this._context);\n this.seededAnswers = null;\n this.seededFieldNames = [];\n this.DroppedProposalClaim = null;\n this.applySeed();\n }\n\n /** Runs the caller's seed once the context, the proposal and the seed are all set. */\n private applySeed(): void {\n if (!this.hasContext || !this._proposal || !this._seedState) return;\n this._seedState(this);\n this.seededAnswers = JSON.stringify(this.State);\n this.seededFieldNames = this.State.ReplaceMode === 'field' ? [...this.State.ReplaceFieldNames] : [];\n }\n\n /** True while the answers are still the ones the seed produced. */\n private get unchangedSinceSeed(): boolean {\n return this.seededAnswers !== null && JSON.stringify(this.State) === this.seededAnswers;\n }\n\n /**\n * The positions to offer. Once the form's own set is known, a slot it does not emit is\n * not shown: choosing it would silently resolve to the bottom of the form, so it is not\n * a position the user can meaningfully pick.\n */\n public get Slots(): readonly FormPlacementSlotChoice[] {\n return FORM_PLACEMENT_SLOTS.filter((s) => SlotIsOnForm(this._context, s.Slot));\n }\n\n /** Slots that sit above the field sections, so the preview renders in form order. */\n public get SlotsAbove(): readonly FormPlacementSlotChoice[] {\n return this.Slots.filter((s) => s.Slot === 'top-area' || s.Slot === 'before-fields');\n }\n\n /** The slot between the fields and the related grids. */\n public get SlotAfterFields(): FormPlacementSlotChoice | undefined {\n return this.Slots.find((s) => s.Slot === 'after-fields');\n }\n\n /** Slots that sit below the related grids. */\n public get SlotsBelow(): readonly FormPlacementSlotChoice[] {\n return this.Slots.filter((s) => s.Slot === 'after-related' || s.Slot === 'after-everything');\n }\n\n public get Summary(): string {\n return SummarizePlacement(this.answers, this._context, this.VisibleTo, {\n FieldsStoodInFor: this.seededFieldNames,\n DroppedClaim: this.DroppedProposalClaim,\n });\n }\n\n /** The answers as they are applied: keeping a panel off counts only where it is offered. */\n private get answers(): FormPlacementState {\n return this.State.KeepOff && !this.OfferKeepOff ? { ...this.State, KeepOff: false } : this.State;\n }\n\n /** When the panel starts: right away, as a draft, or, for a panel that is off, still off. */\n public get StartChoice(): 'now' | 'draft' | 'off' {\n if (this.State.ActivateNow) return 'now';\n return this.State.KeepOff && this.OfferKeepOff ? 'off' : 'draft';\n }\n public set StartChoice(value: 'now' | 'draft' | 'off') {\n this.State.ActivateNow = value === 'now';\n this.State.KeepOff = value === 'off';\n }\n\n /** Whether this form draws a side rail, so tabs are a thing the user can see. */\n public get HasRail(): boolean {\n return ShowsRail(this._context);\n }\n\n /** The rail item the panel will appear under, or null when it gets one of its own. */\n public get TargetRail(): FormPlacementRailItem | null {\n return TargetRailItem(this.State, this._context);\n }\n\n /** True when the panel will add a rail item rather than join one. */\n public get AddsRailItem(): boolean {\n return this.State.Presentation === 'panel' && this.TargetRail === null;\n }\n\n\n\n /** True when the panel would carry no header of its own and none from the host. */\n public get HasTitle(): boolean {\n return this.State.Title.trim().length > 0;\n }\n\n /** A form with no field sections has nothing for a panel to hide. */\n public get CanReplaceSection(): boolean {\n return this._context.Sections.length > 0;\n }\n\n /** Sections whose fields a panel could stand in for. */\n public get FieldSections(): readonly FormPlacementSection[] {\n return SectionsWithFields(this._context);\n }\n\n /** The fields of the section the user is choosing from. */\n public get FieldChoices(): readonly FormPlacementField[] {\n return FieldsInSection(this._context, this.State.ReplaceFieldSectionKey);\n }\n\n /**\n * Whether standing in for fields is offered.\n *\n * Only when the fields were read off a real form. Derived targets name the entity's\n * fields rather than the ones this form draws, and a claim on a field the form does\n * not draw hides nothing while still reading as applied.\n */\n public get CanReplaceField(): boolean {\n return this.FieldSections.length > 0;\n }\n\n /** The names the claim will carry, kept to fields the chosen section really draws. */\n public get ChosenFields(): readonly string[] {\n return ChosenFieldNames(this.State, this._context);\n }\n\n /** Whether this field is in the claim. */\n public IsFieldChosen(fieldName: string): boolean {\n return this.State.ReplaceFieldNames.includes(fieldName);\n }\n\n /** Add or remove one field from the claim. */\n public ToggleField(fieldName: string, chosen: boolean): void {\n const without = this.State.ReplaceFieldNames.filter((n) => n !== fieldName);\n this.State.ReplaceFieldNames = chosen ? [...without, fieldName] : without;\n }\n\n /**\n * Switch which section the claim draws from, dropping the fields chosen in the old one.\n *\n * A claim renders at the top of ONE section, so fields from two of them describe a\n * panel with two places to be. Clearing on switch makes that impossible to express\n * rather than something the dialog has to refuse later.\n */\n public SetFieldSection(sectionKey: string): void {\n this.State.ReplaceFieldSectionKey = sectionKey;\n this.State.ReplaceFieldNames = [];\n }\n\n /** Whether this preview block is the one a field claim lands inside. */\n public HostsFieldPanel(sectionKey: string): boolean {\n return this.State.ReplaceMode === 'field'\n && !!sectionKey\n && this.State.ReplaceFieldSectionKey === sectionKey;\n }\n\n /** The chosen fields named in a line, for the note beside the choice. */\n public get ChosenFieldSummary(): string {\n return DescribeChosenFields(this.State, this._context);\n }\n\n /** A field claim that names no field claims nothing, so Apply would be a lie. */\n public get FieldClaimIsEmpty(): boolean {\n return this.State.ReplaceMode === 'field' && this.ChosenFields.length === 0;\n }\n\n /**\n * True when the form bundles its field sections into a single Details tab, so the\n * section names on offer are the parts of that tab rather than anything the user can\n * point at on screen.\n */\n public get SectionsAreInDetailsTab(): boolean {\n return HasDetailsTab(this._context);\n }\n\n /** How many sections the Details tab is made of, for the option that replaces all of them. */\n public get DetailsTabSectionCount(): number {\n return this._context.Sections.length;\n }\n\n /** The tabs a panel may stand in for. Empty means the form shows no rail. */\n public get RailTabs(): readonly FormPlacementRailItem[] {\n return ReplaceableRailTabs(this._context);\n }\n\n /** Whether standing in for a whole tab is offered at all. */\n public get CanReplaceRailTab(): boolean {\n return this.RailTabs.length > 0;\n }\n\n /** How many panels the chosen tab holds, for the note beside the choice. */\n public get ChosenRailTabSize(): number {\n return this.RailTabs.find((t) => t.Key === this.State.ReplaceRailKey)?.SectionKeys.length ?? 0;\n }\n\n /** Whether this preview block will be taken off the form by the current choice. */\n public IsReplaced(sectionKey: string): boolean {\n return ReplacedPreviewKeys(this.State, this._context).has(sectionKey);\n }\n\n /** Whether the related grid at this position will be taken over. */\n public IsRelatedReplaced(index: number): boolean {\n return this.State.ReplaceMode === 'related' && this.State.ReplaceRelatedIndex === index;\n }\n\n /** Whether every field group in the Details tab is going, so the tab itself is marked. */\n public get IsWholeDetailsTabReplaced(): boolean {\n if (this._context.Sections.length === 0) return false;\n const going = ReplacedPreviewKeys(this.State, this._context);\n return this._context.Sections.every((section) => going.has(section.Key));\n }\n\n /** One section's label, told apart from the Details tab when they share a name. */\n public SectionLabel(section: FormPlacementSection): string {\n return SectionOptionLabel(section, this._context);\n }\n\n /** Whether hiding a section is a guess, because the targets were not read from the form. */\n public get SectionTargetsAreDerived(): boolean {\n return this.CanReplaceSection && !this._context.TargetsVerified;\n }\n\n /**\n * A bare panel carries no chrome and no rail item, so a left-nav form has nowhere to\n * file it and shows it above every section. Worth saying before it is applied.\n */\n public get IsPersistentHero(): boolean {\n return this.State.Presentation === 'bare' && !this.BareJoinsReplacedTab;\n }\n\n /** A bare strip that replaces blocks takes their place in their tab, rather than above every tab. */\n public get BareJoinsReplacedTab(): boolean {\n return this.State.Presentation === 'bare'\n && (this.State.ReplaceMode === 'section' || this.State.ReplaceMode === 'rail-tab');\n }\n\n /** A form with no related grids has nothing for a panel to take over. */\n public get CanReplaceRelated(): boolean {\n return this._context.Related.length > 0;\n }\n\n /** A form with no panels on it yet has nothing for this one to stand in for. */\n public get CanReplaceContribution(): boolean {\n return this._context.Existing.length > 0;\n }\n\n\n /** True while the form is being read to find out which positions it offers. */\n public Probing = false;\n\n /**\n * True when the list is the shape CodeGen produces rather than this form's own, because\n * reading the form did not answer. A hand-written custom template can differ.\n */\n public get SlotsAreAssumed(): boolean {\n return !this.Probing && !this._context.SlotsVerified && this._context.SlotsPresent.length > 0;\n }\n\n public SelectSlot(slot: FormContributionSlot): void {\n this.State.Slot = slot;\n }\n\n /** Refuses a claim the form cannot honour, so the state can never describe a missing target. */\n public SetReplaceMode(mode: FormPlacementReplaceMode): void {\n if (mode === 'section' && !this.CanReplaceSection) return;\n if (mode === 'field' && !this.CanReplaceField) return;\n if (mode === 'related' && !this.CanReplaceRelated) return;\n if (mode === 'contribution' && !this.CanReplaceContribution) return;\n if (mode === 'rail-tab' && !this.CanReplaceRailTab) return;\n this.State.ReplaceMode = mode;\n }\n\n public OnApply(): void {\n this.Applied.emit(ResolvePlacementDecision(this.answers, this._context, this._proposal));\n }\n\n public OnCancel(): void {\n this.Cancelled.emit();\n }\n\n /**\n * Replace the assumed positions and section keys with the form's own.\n *\n * The probe renders the entity's form offscreen, so it costs one hidden form per entity\n * per session and answers for hand-written templates too. A caller that already had the\n * form open has nothing to learn, and a failed probe leaves the assumptions in place.\n */\n private async probeSlots(): Promise<void> {\n const entity = this._context.EntityName;\n if (!this.ProbeForm || !entity || this._context.SlotsVerified || this._context.FullCustomForm) return;\n\n this.Probing = true;\n try {\n const shape = await this.probe.Probe(this.viewContainer, entity, this.ProviderToUse);\n if (shape.Slots.length === 0 || this._context.EntityName !== entity) return;\n const reseed = this.unchangedSinceSeed;\n this._context = {\n ...this._context,\n SlotsPresent: shape.Slots,\n SlotsVerified: true,\n // Sections read off the form replace ones derived from field metadata, which\n // a template generated earlier may not draw.\n Sections: shape.Sections.length > 0 ? shape.Sections : this._context.Sections,\n TargetsVerified: shape.Sections.length > 0 ? true : this._context.TargetsVerified,\n // Resolved through the form's own chrome resolver, so the rail drawn here\n // is the rail the saved record shows.\n Rail: shape.Groups.map((g) => ({\n Key: g.Key, Title: g.Title, Icon: g.Icon,\n SectionKeys: g.SectionKeys, IsMore: g.IsMore === true,\n })),\n Layout: shape.Layout,\n };\n // The rail was not known before the probe, so the default tab was not either.\n if (!this._context.Rail.some((item) => item.Key === this.State.ReplaceRailKey)) {\n this.State = { ...this.State, ReplaceRailKey: DefaultRailKeyFor(this._context) };\n }\n // Once the form's own sections are read, a claim the seed dropped before the read is\n // no longer reported. A reseed below runs the caller's seed against the read form,\n // which may set it again.\n if (shape.Sections.length > 0) this.DroppedProposalClaim = null;\n // The seed ran against a context with no sections or slots in it, so it runs again\n // against the form's own — unless the user has changed an answer since.\n if (reseed) this.applySeed();\n if (!SlotIsOnForm(this._context, this.State.Slot)) {\n this.State = { ...this.State, Slot: DefaultSlotFor(this._context) };\n }\n // The fields were unknown before the probe, so the chosen section was not either.\n const fieldSections = SectionsWithFields(this._context);\n if (!fieldSections.some((section) => section.Key === this.State.ReplaceFieldSectionKey)) {\n this.State = {\n ...this.State,\n ReplaceFieldSectionKey: DefaultFieldSectionKey(this._context),\n ReplaceFieldNames: [],\n ReplaceMode: fieldSections.length === 0 && this.State.ReplaceMode === 'field'\n ? 'none' : this.State.ReplaceMode,\n };\n }\n // Chosen sections, and the section a panel is placed in, must be ones the form draws.\n const drawn = new Set(this._context.Sections.map((s) => s.Key));\n this.State = {\n ...this.State,\n ReplaceSectionKeys: this.State.ReplaceSectionKeys.filter((k) => drawn.has(k)),\n InSectionKey: drawn.has(this.State.InSectionKey) ? this.State.InSectionKey : '',\n };\n // The previously selected section may not be one the form draws. Only a section claim\n // depends on it; a grid, panel or tab claim stands as it is.\n if (!this._context.Sections.some((s) => s.Key === this.State.ReplaceSectionKey)) {\n const dropsSectionClaim = this.State.ReplaceMode === 'section' && this._context.Sections.length === 0;\n this.State = {\n ...this.State,\n ReplaceSectionKey: this._context.Sections[0]?.Key ?? '',\n ReplaceMode: dropsSectionClaim ? 'none' : this.State.ReplaceMode,\n };\n }\n } finally {\n this.Probing = false;\n this.cdr.markForCheck();\n }\n }\n\n /** True when the scaled form could not be drawn, so the list stands in for it. */\n public PreviewFailed = false;\n\n /**\n * Whether the real form is shown, scaled, in place of the list.\n *\n * Not for a full custom form, which draws its own body and has no positions to show, and\n * not when the form is not being read at all.\n */\n public get ShowFormPreview(): boolean {\n return this.ProbeForm && !this.PreviewFailed && !this._context.FullCustomForm && !!this._context.EntityName;\n }\n\n public OnPreviewFailed(): void {\n this.PreviewFailed = true;\n this.cdr.markForCheck();\n }\n\n private previewSpec: { Signature: string; Spec: FormContributionSpec } | null = null;\n\n /**\n * The panel as it would be saved, for the preview to draw.\n *\n * The same object comes back until an answer changes. The preview redraws the form each\n * time this changes identity, and change detection reads it on every pass.\n */\n public get PreviewSpec(): FormContributionSpec {\n const spec = ResolvePlacementDecision(this.State, this._context, this._proposal).Contribution;\n const signature = JSON.stringify(spec);\n if (this.previewSpec?.Signature !== signature) this.previewSpec = { Signature: signature, Spec: spec };\n return this.previewSpec.Spec;\n }\n\n /** Stop replacing anything; the panel goes back to its chosen position. */\n public ClearReplacement(): void {\n this.State = { ...this.State, ReplaceMode: 'none', ReplaceFieldNames: [] };\n }\n\n /** One line saying where the panel goes and what it replaces. */\n public get PlacementLine(): string {\n return DescribePlacementLine(this.State, this._context);\n }\n\n /**\n * The panels in the chosen position, top to bottom, this one among them. Only worth showing\n * when there is another panel to order against.\n */\n public get OrderItems(): PlacementOrderItem[] {\n const items = PanelsInPosition(this.State, this._context, this.State.Title.trim() || this.ComponentName || 'This panel');\n return items.length > 1 ? items : [];\n }\n\n public get CanMoveUp(): boolean {\n return MovedSortKey(this.OrderItems, 'up') != null;\n }\n\n public get CanMoveDown(): boolean {\n return MovedSortKey(this.OrderItems, 'down') != null;\n }\n\n /** Whether a neighbour is there but the move has no order number to land on. */\n public get MoveIsBlocked(): boolean {\n const items = this.OrderItems;\n const at = items.findIndex((item) => item.IsThis);\n const blockedUp = at > 0 && !this.CanMoveUp;\n const blockedDown = at >= 0 && at < items.length - 1 && !this.CanMoveDown;\n return blockedUp || blockedDown;\n }\n\n /** Move this panel one place up or down among the panels in its position. */\n public MoveInPosition(direction: 'up' | 'down'): void {\n const sortKey = MovedSortKey(this.OrderItems, direction);\n if (sortKey == null) return;\n this.State = { ...this.State, SortKey: sortKey };\n }\n\n /**\n * The position control's value: a slot name, or `in:<section key>:start|end` for a place\n * inside a section. One control, because \"above the fields\" and \"at the bottom of Details\"\n * are answers to the same question.\n */\n public get PositionValue(): string {\n const key = this.State.InSectionKey.trim();\n return key ? `in:${key}:${this.State.SectionPosition}` : this.State.Slot;\n }\n public set PositionValue(value: string) {\n const match = /^in:(.+):(start|end)$/.exec(value);\n this.State = match\n ? { ...this.State, InSectionKey: match[1], SectionPosition: match[2] as 'start' | 'end' }\n : { ...this.State, InSectionKey: '', Slot: value as FormContributionSlot };\n }\n\n /** Sections a panel can be placed inside, for the position control. */\n public get PlaceableSections(): readonly FormPlacementSection[] {\n return this._context.Sections;\n }\n\n /** Whether a section is among those the `section` mode stands in for. */\n public IsSectionChosen(key: string): boolean {\n return ChosenSectionKeys(this.State, this._context).includes(key);\n }\n\n /**\n * Add or remove one section from those the panel stands in for. The single key follows the\n * first chosen section, so a one-section claim reads the same as it always has.\n */\n public ToggleSection(key: string, chosen: boolean): void {\n const current = ChosenSectionKeys(this.State, this._context);\n const next = chosen ? [...current.filter((k) => k !== key), key] : current.filter((k) => k !== key);\n const ordered = this._context.Sections.map((s) => s.Key).filter((k) => next.includes(k));\n this.State = { ...this.State, ReplaceSectionKeys: ordered, ReplaceSectionKey: ordered[0] ?? '' };\n }\n\n /** A section claim that names no section stands in for nothing, so Apply would be a lie. */\n public get SectionClaimIsEmpty(): boolean {\n return this.State.ReplaceMode === 'section' && ChosenSectionKeys(this.State, this._context).length === 0;\n }\n\n /** Whether the panel replaces something, so the line offers a way back. */\n public get IsReplacing(): boolean {\n return this.State.ReplaceMode !== 'none';\n }\n\n private readonly probe = inject(FormSlotProbeService);\n private readonly viewContainer = inject(ViewContainerRef);\n private readonly cdr = inject(ChangeDetectorRef);\n}\n","<div class=\"mj-placement\">\n\n <div class=\"mj-placement-head\">\n <div class=\"mj-placement-head-text\">\n <div class=\"mj-placement-eyebrow\">Add to a form</div>\n <h2 class=\"mj-placement-title\">{{ ComponentName || State.Title || 'Panel' }}</h2>\n </div>\n </div>\n\n @if (Proposal) {\n <div class=\"mj-placement-proposal\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Suggested as a {{ Proposal.presentation === 'bare' ? 'bare strip' : 'panel' }}. Where it goes is yours to choose &mdash; nothing is saved until you apply.</span>\n </div>\n }\n\n @if (Context.FullCustomForm) {\n <mj-alert Variant=\"warning\" class=\"mj-placement-alert\">\n A full custom form is rendering {{ Context.EntityName }}. It draws its own body, so a panel\n saved here will not appear until that form is turned off.\n </mj-alert>\n }\n\n @if (ShowFormPreview) {\n <div class=\"mj-placement-body mj-placement-body--preview\">\n\n <!-- Left: the real form, scaled, with the panel drawn where it will go -->\n <div class=\"mj-placement-canvas\">\n <p class=\"mj-placement-hint\">\n The form as it will look, with your panel on it. Make your choices on the right.\n </p>\n <mj-form-placement-preview\n [Provider]=\"Provider\"\n [EntityName]=\"Context.EntityName\"\n [RecordKey]=\"RecordKey\"\n [Spec]=\"PreviewSpec\"\n [ReplacesRowID]=\"ReplacesRowID\"\n [PanelComponentSpec]=\"PanelComponentSpec\"\n [PanelComponentID]=\"PanelComponentID\"\n (Failed)=\"OnPreviewFailed()\">\n </mj-form-placement-preview>\n </div>\n\n <!-- Right: every answer, including the ones the preview sets by clicking -->\n <div class=\"mj-placement-settings mj-placement-settings--side\">\n\n <section>\n <div class=\"mj-placement-label\">Where it goes</div>\n <div class=\"mj-placement-where\">\n <span class=\"mj-placement-where-text\">{{ PlacementLine }}</span>\n @if (IsReplacing) {\n <button type=\"button\" class=\"mj-placement-link\" (click)=\"ClearReplacement()\">Replace nothing</button>\n }\n </div>\n <select class=\"mj-placement-select mj-placement-select--block\" aria-label=\"Position on the form\"\n [(ngModel)]=\"PositionValue\" name=\"mj-slot-select\">\n <optgroup label=\"Between blocks\">\n @for (choice of Slots; track choice.Slot) {\n <option [value]=\"choice.Slot\">{{ choice.Name }}</option>\n }\n </optgroup>\n @if (PlaceableSections.length > 0) {\n <optgroup label=\"Inside a section\">\n @for (section of PlaceableSections; track section.Key) {\n <option [value]=\"'in:' + section.Key + ':start'\">Top of {{ section.Title }}</option>\n <option [value]=\"'in:' + section.Key + ':end'\">Bottom of {{ section.Title }}</option>\n }\n </optgroup>\n }\n </select>\n @if (IsReplacing) {\n <p class=\"mj-placement-hint\">The position is used only when the panel replaces nothing.</p>\n }\n\n @if (OrderItems.length > 0) {\n <div class=\"mj-placement-sublabel\">Order in this position</div>\n <ol class=\"mj-placement-order\" aria-label=\"Order in this position\">\n @for (item of OrderItems; track item.Key) {\n <li class=\"mj-placement-order-item\" [class.is-this]=\"item.IsThis\">\n <span class=\"mj-placement-order-name\">{{ item.Title }}</span>\n @if (item.IsThis) {\n <span class=\"mj-placement-order-moves\">\n <button type=\"button\" class=\"mj-placement-order-move\" aria-label=\"Move up\"\n [disabled]=\"!CanMoveUp\" (click)=\"MoveInPosition('up')\">\n <i class=\"fa-solid fa-arrow-up\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"mj-placement-order-move\" aria-label=\"Move down\"\n [disabled]=\"!CanMoveDown\" (click)=\"MoveInPosition('down')\">\n <i class=\"fa-solid fa-arrow-down\" aria-hidden=\"true\"></i>\n </button>\n </span>\n }\n </li>\n }\n </ol>\n @if (MoveIsBlocked) {\n <p class=\"mj-placement-hint\">\n Two neighbouring panels share an order number, so this one cannot go between them.\n Move one of them first.\n </p>\n }\n }\n </section>\n\n <ng-container *ngTemplateOutlet=\"settings\"></ng-container>\n\n </div>\n </div>\n } @else {\n <div class=\"mj-placement-body\">\n\n <!-- Left: the form, with each slot as a target -->\n <div class=\"mj-placement-preview\">\n <div class=\"mj-placement-label\">Where it goes</div>\n <p class=\"mj-placement-hint\">\n The <strong>{{ Context.EntityName }}</strong> form as it will look. Pick one of the positions\n between the blocks that are already there.\n </p>\n @if (Probing) {\n <p class=\"mj-placement-hint\">Reading the positions this form offers&hellip;</p>\n } @else if (SlotsAreAssumed) {\n <p class=\"mj-placement-hint\">\n Positions shown are the ones generated forms offer. This form could not be read, so a\n hand-written custom template may differ.\n </p>\n }\n\n @for (choice of SlotsAbove; track choice.Slot) {\n <ng-container *ngTemplateOutlet=\"slotRow; context: { $implicit: choice }\"></ng-container>\n }\n\n @if (SectionsAreInDetailsTab) {\n <div class=\"mj-placement-tab\" [class.is-replaced]=\"IsWholeDetailsTabReplaced\">\n <div class=\"mj-placement-tab-head\">\n <i class=\"fa-solid fa-id-card\" aria-hidden=\"true\"></i>\n <span class=\"mj-placement-tab-name\">Details</span>\n <span class=\"mj-placement-tab-kind\">one rail tab &middot; {{ DetailsTabSectionCount }} field groups</span>\n </div>\n @for (section of Context.Sections; track section.Key) {\n <div class=\"mj-placement-existing mj-placement-existing--nested\"\n [class.is-replaced]=\"IsReplaced(section.Key)\">\n <span class=\"mj-placement-existing-name\">{{ section.Title }}</span>\n <span class=\"mj-placement-existing-kind\">\n {{ IsReplaced(section.Key) ? 'replaced' : 'field group' }}\n </span>\n </div>\n @if (HostsFieldPanel(section.Key)) {\n <ng-container *ngTemplateOutlet=\"fieldPanelCard\"></ng-container>\n }\n }\n </div>\n } @else {\n @for (section of Context.Sections; track section.Key) {\n <div class=\"mj-placement-existing\" [class.is-replaced]=\"IsReplaced(section.Key)\">\n <span class=\"mj-placement-existing-name\">{{ section.Title }}</span>\n <span class=\"mj-placement-existing-kind\">\n {{ IsReplaced(section.Key) ? 'replaced' : 'field group' }}\n </span>\n </div>\n @if (HostsFieldPanel(section.Key)) {\n <ng-container *ngTemplateOutlet=\"fieldPanelCard\"></ng-container>\n }\n }\n }\n\n @if (SlotAfterFields) {\n <ng-container *ngTemplateOutlet=\"slotRow; context: { $implicit: SlotAfterFields }\"></ng-container>\n }\n\n @for (related of Context.Related; track related.Entity + related.JoinField; let i = $index) {\n <div class=\"mj-placement-existing\" [class.is-replaced]=\"IsRelatedReplaced(i)\">\n <span class=\"mj-placement-existing-name\">{{ related.DisplayName }}</span>\n <span class=\"mj-placement-existing-kind\">\n {{ IsRelatedReplaced(i) ? 'replaced' : 'auto grid' }}\n </span>\n </div>\n }\n\n @for (choice of SlotsBelow; track choice.Slot) {\n <ng-container *ngTemplateOutlet=\"slotRow; context: { $implicit: choice }\"></ng-container>\n }\n\n @if (HasRail) {\n <p class=\"mj-placement-hint mj-placement-rail-note\">\n @if (AddsRailItem) {\n Your panel gets a rail item of its own.\n } @else if (TargetRail) {\n Your panel appears under <strong>{{ TargetRail.Title }}</strong> in the rail.\n } @else {\n A bare strip has no rail item. It sits above every section.\n }\n </p>\n }\n </div>\n\n <!-- Right: the answers -->\n <div class=\"mj-placement-settings\">\n <ng-container *ngTemplateOutlet=\"settings\"></ng-container>\n </div>\n </div>\n }\n\n <div class=\"mj-placement-foot\">\n <button type=\"button\" mjButton variant=\"primary\" [disabled]=\"FieldClaimIsEmpty || SectionClaimIsEmpty\" (click)=\"OnApply()\">Add to the form</button>\n <button type=\"button\" mjButton (click)=\"OnCancel()\">Cancel</button>\n <span class=\"mj-placement-spacer\"></span>\n <span class=\"mj-placement-summary\">{{ Summary }}</span>\n </div>\n\n</div>\n\n<!--\n One position. Drawn as a gap between the blocks rather than as a block of its own: a\n slot is a place to insert something, not another thing on the form, and boxing it like\n the content made the two read as peers. Selected, the gap opens and holds the panel.\n-->\n<ng-template #slotRow let-choice>\n <div class=\"mj-placement-gap\" [class.is-on]=\"State.Slot === choice.Slot\">\n <label class=\"mj-placement-gap-pick\">\n <input type=\"radio\" name=\"mj-slot\" [value]=\"choice.Slot\" [(ngModel)]=\"State.Slot\">\n <span class=\"mj-placement-gap-rule\" aria-hidden=\"true\"></span>\n <span class=\"mj-placement-gap-text\">\n <span class=\"mj-placement-gap-name\">{{ choice.Name }}</span>\n <span class=\"mj-placement-mono mj-placement-gap-slot\">{{ choice.Label }}</span>\n </span>\n <span class=\"mj-placement-gap-rule\" aria-hidden=\"true\"></span>\n </label>\n @if (State.Slot === choice.Slot) {\n <div class=\"mj-placement-slot-card\">\n <span class=\"mj-placement-slot-card-name\">{{ State.Title || ComponentName || 'Your panel' }}</span>\n <span class=\"mj-placement-slot-card-hint\">Your panel lands here</span>\n </div>\n }\n </div>\n</ng-template>\n\n<!--\n A panel standing in for a field belongs inside that field's section, at the top. Drawn\n under the section block rather than as a slot gap, because the slot choice does not\n apply to this claim.\n-->\n<ng-template #fieldPanelCard>\n <div class=\"mj-placement-slot-card mj-placement-slot-card--in-section\">\n <span class=\"mj-placement-slot-card-name\">{{ State.Title || ComponentName || 'Your panel' }}</span>\n <span class=\"mj-placement-slot-card-hint\">\n at the top of this section, in place of {{ ChosenFieldSummary }}\n </span>\n </div>\n</ng-template>\n\n<!--\n The answers, shared by both layouts. With the form preview on, clicks on the form and these\n controls edit the same state, so either one can be used and each shows what the other chose.\n-->\n<ng-template #settings>\n\n <section>\n <div class=\"mj-placement-label\">Applies to</div>\n <div class=\"mj-placement-entity\">\n <strong>{{ Context.EntityName }}</strong>\n <span>&middot; every record of this entity, visible to {{ VisibleTo }}</span>\n </div>\n </section>\n\n <section>\n <div class=\"mj-placement-label\">How it looks</div>\n <div class=\"mj-placement-grid-2\">\n <label class=\"mj-placement-choice\" [class.is-on]=\"State.Presentation === 'panel'\">\n <input type=\"radio\" name=\"mj-presentation\" value=\"panel\" [(ngModel)]=\"State.Presentation\">\n <span>\n <span class=\"mj-placement-choice-name\">Panel</span>\n <span class=\"mj-placement-choice-hint\">Collapsible section with a header, and its own item in the side rail.</span>\n </span>\n </label>\n <label class=\"mj-placement-choice\" [class.is-on]=\"State.Presentation === 'bare'\">\n <input type=\"radio\" name=\"mj-presentation\" value=\"bare\" [(ngModel)]=\"State.Presentation\">\n <span>\n <span class=\"mj-placement-choice-name\">Bare</span>\n <span class=\"mj-placement-choice-hint\">A strip with no chrome. No header, no rail item.</span>\n </span>\n </label>\n </div>\n\n @if (State.Presentation === 'panel') {\n <div class=\"mj-placement-fields\">\n <div class=\"mj-placement-field\">\n <label for=\"mj-placement-title\">Header and rail label</label>\n <input id=\"mj-placement-title\" type=\"text\" class=\"mj-input\" [(ngModel)]=\"State.Title\" name=\"mj-title\">\n </div>\n <div class=\"mj-placement-field mj-placement-field--icon\">\n <label for=\"mj-placement-icon\">Icon</label>\n <mj-icon-picker id=\"mj-placement-icon\" AriaLabel=\"Panel icon\"\n [(ngModel)]=\"State.Icon\" name=\"mj-icon\"></mj-icon-picker>\n </div>\n </div>\n @if (!HasTitle) {\n <p class=\"mj-placement-warn\">A panel with no label shows an empty header and an unnamed rail item.</p>\n }\n }\n @if (IsPersistentHero) {\n <p class=\"mj-placement-warn\">A bare strip has no rail item. On a form with a side rail it stays above every section rather than belonging to one.</p>\n } @else if (BareJoinsReplacedTab && HasRail) {\n <p class=\"mj-placement-hint\">A bare strip that replaces blocks takes their place, in their tab.</p>\n }\n </section>\n\n <section>\n <div class=\"mj-placement-label\">Does it replace anything?</div>\n <div class=\"mj-placement-stack\">\n <label class=\"mj-placement-row\" [class.is-on]=\"State.ReplaceMode === 'none'\">\n <input type=\"radio\" name=\"mj-replace\" value=\"none\" [(ngModel)]=\"State.ReplaceMode\">\n <span class=\"mj-placement-row-text\">No &mdash; add it alongside what is already there</span>\n </label>\n\n @if (CanReplaceRailTab) {\n <label class=\"mj-placement-row\" [class.is-on]=\"State.ReplaceMode === 'rail-tab'\">\n <input type=\"radio\" name=\"mj-replace\" value=\"rail-tab\" [(ngModel)]=\"State.ReplaceMode\">\n <span class=\"mj-placement-row-text\">\n Replace a <strong>whole tab</strong>\n <span class=\"mj-placement-row-note--quiet\">all {{ ChosenRailTabSize }} blocks in it go and your panel becomes the tab</span>\n </span>\n <select class=\"mj-placement-select\" aria-label=\"Which tab to stand in for\"\n [disabled]=\"State.ReplaceMode !== 'rail-tab'\" [(ngModel)]=\"State.ReplaceRailKey\" name=\"mj-rail\">\n @for (tab of RailTabs; track tab.Key) {\n <option [value]=\"tab.Key\">{{ tab.Title }}</option>\n }\n </select>\n </label>\n }\n\n <label class=\"mj-placement-row\" [class.is-on]=\"State.ReplaceMode === 'section'\"\n [class.is-off]=\"!CanReplaceSection\">\n <input type=\"radio\" name=\"mj-replace\" value=\"section\"\n [disabled]=\"!CanReplaceSection\" [(ngModel)]=\"State.ReplaceMode\">\n <span class=\"mj-placement-row-text\">\n @if (SectionsAreInDetailsTab) {\n Replace <strong>blocks</strong> inside the Details tab\n <span class=\"mj-placement-row-note--quiet\">the tab and the blocks you leave stay</span>\n } @else {\n Replace <strong>field groups</strong>\n }\n @if (SectionTargetsAreDerived) {\n <span class=\"mj-placement-row-note\">from entity metadata &mdash; may not match this form</span>\n }\n </span>\n </label>\n\n @if (State.ReplaceMode === 'section') {\n <!-- Several blocks, all in one tab: the panel takes the place of the first. -->\n <fieldset class=\"mj-placement-fieldpick\">\n <legend class=\"mj-placement-fieldpick-legend\">Blocks your panel takes the place of</legend>\n <div class=\"mj-placement-fieldpick-grid\">\n @for (section of Context.Sections; track section.Key) {\n <label class=\"mj-placement-fieldpick-item\" [class.is-on]=\"IsSectionChosen(section.Key)\">\n <input type=\"checkbox\" name=\"mj-section-pick\"\n [checked]=\"IsSectionChosen(section.Key)\"\n (change)=\"ToggleSection(section.Key, $any($event.target).checked)\">\n <span class=\"mj-placement-fieldpick-name\">{{ SectionLabel(section) }}</span>\n </label>\n }\n </div>\n @if (SectionClaimIsEmpty) {\n <p class=\"mj-placement-warn\">Pick at least one block, or this panel stands in for nothing.</p>\n }\n </fieldset>\n }\n\n <label class=\"mj-placement-row\" [class.is-on]=\"State.ReplaceMode === 'field'\"\n [class.is-off]=\"!CanReplaceField\">\n <input type=\"radio\" name=\"mj-replace\" value=\"field\"\n [disabled]=\"!CanReplaceField\" [(ngModel)]=\"State.ReplaceMode\">\n <span class=\"mj-placement-row-text\">\n Replace <strong>fields</strong> inside one group\n <span class=\"mj-placement-row-note--quiet\">your panel draws inside that group, in their place</span>\n @if (!CanReplaceField) {\n <span class=\"mj-placement-row-note\">this form's fields could not be read</span>\n }\n </span>\n <select class=\"mj-placement-select\" aria-label=\"Which group to take fields from\"\n [disabled]=\"State.ReplaceMode !== 'field'\"\n [ngModel]=\"State.ReplaceFieldSectionKey\" (ngModelChange)=\"SetFieldSection($event)\"\n name=\"mj-field-section\">\n @for (section of FieldSections; track section.Key) {\n <option [value]=\"section.Key\">{{ section.Title }}</option>\n }\n </select>\n </label>\n\n @if (State.ReplaceMode === 'field') {\n <!-- One group at a time: the panel renders at the top of a single section, so\n fields from two of them would describe a panel with two places to be. -->\n <fieldset class=\"mj-placement-fieldpick\">\n <legend class=\"mj-placement-fieldpick-legend\">Fields your panel takes the place of</legend>\n <div class=\"mj-placement-fieldpick-grid\">\n @for (field of FieldChoices; track field.Name) {\n <label class=\"mj-placement-fieldpick-item\" [class.is-on]=\"IsFieldChosen(field.Name)\">\n <input type=\"checkbox\"\n [checked]=\"IsFieldChosen(field.Name)\"\n (change)=\"ToggleField(field.Name, $any($event.target).checked)\">\n <span class=\"mj-placement-fieldpick-name\">{{ field.Label }}</span>\n </label>\n }\n </div>\n @if (FieldClaimIsEmpty) {\n <p class=\"mj-placement-warn\">Pick at least one field, or this panel stands in for nothing.</p>\n }\n <div class=\"mj-placement-fieldpick-where\" role=\"radiogroup\" aria-label=\"Where in the group\">\n <label>\n <input type=\"radio\" name=\"mj-field-position\" value=\"start\" [(ngModel)]=\"State.SectionPosition\">\n At the top of the group\n </label>\n <label>\n <input type=\"radio\" name=\"mj-field-position\" value=\"end\" [(ngModel)]=\"State.SectionPosition\">\n At the bottom\n </label>\n </div>\n </fieldset>\n }\n\n <label class=\"mj-placement-row\" [class.is-on]=\"State.ReplaceMode === 'related'\"\n [class.is-off]=\"!CanReplaceRelated\">\n <input type=\"radio\" name=\"mj-replace\" value=\"related\"\n [disabled]=\"!CanReplaceRelated\" [(ngModel)]=\"State.ReplaceMode\">\n <span class=\"mj-placement-row-text\">Replace a <strong>related grid</strong></span>\n <select class=\"mj-placement-select\" aria-label=\"Which related grid to take over\"\n [disabled]=\"State.ReplaceMode !== 'related'\" [(ngModel)]=\"State.ReplaceRelatedIndex\" name=\"mj-related\">\n @for (related of Context.Related; track related.Entity + related.JoinField; let i = $index) {\n <option [ngValue]=\"i\">{{ related.DisplayName }} via {{ related.JoinField }}</option>\n }\n </select>\n </label>\n\n <label class=\"mj-placement-row\" [class.is-on]=\"State.ReplaceMode === 'contribution'\"\n [class.is-off]=\"!CanReplaceContribution\">\n <input type=\"radio\" name=\"mj-replace\" value=\"contribution\"\n [disabled]=\"!CanReplaceContribution\" [(ngModel)]=\"State.ReplaceMode\">\n <span class=\"mj-placement-row-text\">Replace a <strong>panel already here</strong></span>\n <select class=\"mj-placement-select\" aria-label=\"Which panel to replace\"\n [disabled]=\"State.ReplaceMode !== 'contribution'\" [(ngModel)]=\"State.ReplaceContributionIndex\" name=\"mj-existing\">\n @for (item of Context.Existing; track item.Key; let i = $index) {\n <option [ngValue]=\"i\">{{ item.Title }}</option>\n }\n </select>\n </label>\n </div>\n </section>\n\n <section>\n <div class=\"mj-placement-label\">When it starts</div>\n <div class=\"mj-placement-stack\">\n <label class=\"mj-placement-row\" [class.is-on]=\"StartChoice === 'now'\">\n <input type=\"radio\" name=\"mj-status\" value=\"now\" [(ngModel)]=\"StartChoice\">\n <span class=\"mj-placement-row-text\">Right away</span>\n </label>\n <label class=\"mj-placement-row\" [class.is-on]=\"StartChoice === 'draft'\">\n <input type=\"radio\" name=\"mj-status\" value=\"draft\" [(ngModel)]=\"StartChoice\">\n <span class=\"mj-placement-row-text\">Save as a draft</span>\n </label>\n @if (OfferKeepOff) {\n <label class=\"mj-placement-row\" [class.is-on]=\"StartChoice === 'off'\">\n <input type=\"radio\" name=\"mj-status\" value=\"off\" [(ngModel)]=\"StartChoice\">\n <span class=\"mj-placement-row-text\">Keep it off</span>\n </label>\n }\n </div>\n <p class=\"mj-placement-hint\">A draft is stored but rendered for nobody until you turn it on.</p>\n </section>\n\n @if (Context.Existing.length > 0) {\n <section>\n <div class=\"mj-placement-label\">Already on this form</div>\n <div class=\"mj-placement-stack\">\n @for (item of Context.Existing; track item.Key) {\n <div class=\"mj-placement-existing mj-placement-existing--compact\">\n <span class=\"mj-placement-existing-name\">{{ item.Title }}</span>\n <span class=\"mj-placement-mono mj-placement-existing-kind\">{{ item.Slot }}</span>\n </div>\n }\n </div>\n </section>\n }\n</ng-template>\n"]}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @fileoverview The order of panels in one position on the form, and the order number that
3
+ * moves the placed panel up or down among them.
4
+ */
5
+ import { type FormPlacementContext, type FormPlacementState } from './form-placement';
6
+ /** One panel in the order list of a position. */
7
+ export interface PlacementOrderItem {
8
+ Key: string;
9
+ Title: string;
10
+ SortKey: number;
11
+ /** The panel being placed. */
12
+ IsThis: boolean;
13
+ }
14
+ /** The key the placed panel is listed under in its own order list. */
15
+ export declare const PLACEMENT_ORDER_THIS_KEY = "__this__";
16
+ /** How far apart a panel is put from its neighbour when it moves to either end of the list. */
17
+ export declare const PLACEMENT_ORDER_STEP = 10;
18
+ /**
19
+ * The panels in the chosen position, top to bottom, the one being placed among them.
20
+ *
21
+ * Higher `SortKey` draws first, as the slot and section hosts sort. The placed panel is listed
22
+ * after any panel it ties with: a new row loads after the rows already there, and moving the
23
+ * panel gives it a number of its own. A position is a slot, the top or bottom of a section —
24
+ * where field claims draw too — or the place of a block that panels stand in for. Empty when the
25
+ * panel stands in for a tab, grid or panel, since it then draws alone in that thing's place.
26
+ */
27
+ export declare function PanelsInPosition(state: FormPlacementState, context: FormPlacementContext, title: string): PlacementOrderItem[];
28
+ /**
29
+ * The order number that puts the placed panel one step up or down, or null when it cannot move.
30
+ *
31
+ * The number has to fall strictly between its new neighbours, since equal numbers do not say
32
+ * which draws first. At either end of the list it goes a step past the last one. Between two
33
+ * panels whose numbers are adjacent or equal there is no number to give, so the move is refused
34
+ * rather than landing somewhere the list does not show.
35
+ */
36
+ export declare function MovedSortKey(items: readonly PlacementOrderItem[], direction: 'up' | 'down'): number | null;
37
+ //# sourceMappingURL=form-placement-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-placement-order.d.ts","sourceRoot":"","sources":["../../../src/lib/apply/form-placement-order.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIH,KAAK,oBAAoB,EAEzB,KAAK,kBAAkB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,iDAAiD;AACjD,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,MAAM,GACd,kBAAkB,EAAE,CAatB;AAgDD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAc1G"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @fileoverview The order of panels in one position on the form, and the order number that
3
+ * moves the placed panel up or down among them.
4
+ */
5
+ import { ChosenSectionKeys, SectionHoldingField, TargetsUnread, } from './form-placement';
6
+ /** The key the placed panel is listed under in its own order list. */
7
+ export const PLACEMENT_ORDER_THIS_KEY = '__this__';
8
+ /** How far apart a panel is put from its neighbour when it moves to either end of the list. */
9
+ export const PLACEMENT_ORDER_STEP = 10;
10
+ /**
11
+ * The panels in the chosen position, top to bottom, the one being placed among them.
12
+ *
13
+ * Higher `SortKey` draws first, as the slot and section hosts sort. The placed panel is listed
14
+ * after any panel it ties with: a new row loads after the rows already there, and moving the
15
+ * panel gives it a number of its own. A position is a slot, the top or bottom of a section —
16
+ * where field claims draw too — or the place of a block that panels stand in for. Empty when the
17
+ * panel stands in for a tab, grid or panel, since it then draws alone in that thing's place.
18
+ */
19
+ export function PanelsInPosition(state, context, title) {
20
+ const here = placedPosition(state, context);
21
+ if (!here)
22
+ return [];
23
+ const others = context.Existing
24
+ .filter((e) => existingPosition(e, context) === here)
25
+ .map((e) => ({ Key: e.Key, Title: e.Title, SortKey: e.SortKey ?? 0, IsThis: false }));
26
+ const self = { Key: PLACEMENT_ORDER_THIS_KEY, Title: title, SortKey: state.SortKey ?? 0, IsThis: true };
27
+ const items = [...others, self];
28
+ return items
29
+ .map((item, index) => ({ item, index }))
30
+ .sort((a, b) => b.item.SortKey - a.item.SortKey
31
+ || (a.item.IsThis ? 1 : b.item.IsThis ? -1 : a.index - b.index))
32
+ .map((entry) => entry.item);
33
+ }
34
+ /**
35
+ * Where the placed panel draws, as a key shared by every panel drawing in the same place: a slot
36
+ * name, `in:<section>:<start|end>` for the top or bottom of a section, or `at:<section>` for the
37
+ * place of a block that panels stand in for. Null when it stands in for a tab, grid or panel.
38
+ */
39
+ function placedPosition(state, context) {
40
+ if (state.ReplaceMode === 'field') {
41
+ return state.ReplaceFieldSectionKey ? `in:${state.ReplaceFieldSectionKey}:${state.SectionPosition}` : null;
42
+ }
43
+ if (state.ReplaceMode === 'section')
44
+ return blockPosition(ChosenSectionKeys(state, context), context);
45
+ if (state.ReplaceMode !== 'none')
46
+ return null;
47
+ const inSection = state.InSectionKey.trim();
48
+ return inSection ? `in:${inSection}:${state.SectionPosition}` : state.Slot;
49
+ }
50
+ /** The same key for a panel already on the form. */
51
+ function existingPosition(existing, context) {
52
+ const replaced = (existing.SectionKeys ?? []).map((key) => key.trim()).filter((key) => key.length > 0);
53
+ if (replaced.length > 0) {
54
+ const drawn = TargetsUnread(context)
55
+ ? replaced
56
+ : context.Sections.map((s) => s.Key).filter((key) => replaced.includes(key));
57
+ return blockPosition(drawn, context);
58
+ }
59
+ if (existing.ReplacesPlace)
60
+ return null;
61
+ const position = existing.SectionPosition === 'end' ? 'end' : 'start';
62
+ const inSection = existing.InSectionKey?.trim();
63
+ if (inSection)
64
+ return `in:${inSection}:${position}`;
65
+ const firstField = (existing.FieldNames ?? []).find((name) => name.trim().length > 0);
66
+ if (firstField) {
67
+ const section = SectionHoldingField(context, firstField);
68
+ return section ? `in:${section.Key}:${position}` : null;
69
+ }
70
+ return existing.Slot;
71
+ }
72
+ /**
73
+ * The key for panels standing in for `keys`, in form order: the place of the first. The first
74
+ * block on the form is also where the before-fields slot draws, so the two share one key.
75
+ */
76
+ function blockPosition(keys, context) {
77
+ const first = keys[0];
78
+ if (!first)
79
+ return null;
80
+ return first === context.Sections[0]?.Key ? 'before-fields' : `at:${first}`;
81
+ }
82
+ /**
83
+ * The order number that puts the placed panel one step up or down, or null when it cannot move.
84
+ *
85
+ * The number has to fall strictly between its new neighbours, since equal numbers do not say
86
+ * which draws first. At either end of the list it goes a step past the last one. Between two
87
+ * panels whose numbers are adjacent or equal there is no number to give, so the move is refused
88
+ * rather than landing somewhere the list does not show.
89
+ */
90
+ export function MovedSortKey(items, direction) {
91
+ const at = items.findIndex((item) => item.IsThis);
92
+ if (at < 0)
93
+ return null;
94
+ const target = direction === 'up' ? at - 1 : at + 1;
95
+ if (target < 0 || target >= items.length)
96
+ return null;
97
+ // Its neighbours after the move, read from the list without it: it lands at `target`.
98
+ const rest = items.filter((item) => !item.IsThis);
99
+ const above = rest[target - 1] ?? null;
100
+ const below = rest[target] ?? null;
101
+ if (!above && below)
102
+ return below.SortKey + PLACEMENT_ORDER_STEP;
103
+ if (above && !below)
104
+ return above.SortKey - PLACEMENT_ORDER_STEP;
105
+ if (!above || !below)
106
+ return null;
107
+ if (above.SortKey - below.SortKey < 2)
108
+ return null;
109
+ return Math.floor((above.SortKey + below.SortKey) / 2);
110
+ }
111
+ //# sourceMappingURL=form-placement-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-placement-order.js","sourceRoot":"","sources":["../../../src/lib/apply/form-placement-order.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GAIhB,MAAM,kBAAkB,CAAC;AAW1B,sEAAsE;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;AAEnD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC5B,KAAyB,EACzB,OAA6B,EAC7B,KAAa;IAEb,MAAM,IAAI,GAAG,cAAc,CAA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AC,KAAoC,EAAE,SAAwB;IACvF,MAAM,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpD,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACtD,sFAAsF;IACtF,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;IACnC,IAAI,CAAC,KAAK,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,GAAG,oBAAoB,CAAC;IACjE,IAAI,KAAK,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,GAAG,oBAAoB,CAAC;IACjE,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["/**\n * @fileoverview The order of panels in one position on the form, and the order number that\n * moves the placed panel up or down among them.\n */\n\nimport {\n ChosenSectionKeys,\n SectionHoldingField,\n TargetsUnread,\n type FormPlacementContext,\n type FormPlacementExisting,\n type FormPlacementState,\n} from './form-placement';\n\n/** One panel in the order list of a position. */\nexport interface PlacementOrderItem {\n Key: string;\n Title: string;\n SortKey: number;\n /** The panel being placed. */\n IsThis: boolean;\n}\n\n/** The key the placed panel is listed under in its own order list. */\nexport const PLACEMENT_ORDER_THIS_KEY = '__this__';\n\n/** How far apart a panel is put from its neighbour when it moves to either end of the list. */\nexport const PLACEMENT_ORDER_STEP = 10;\n\n/**\n * The panels in the chosen position, top to bottom, the one being placed among them.\n *\n * Higher `SortKey` draws first, as the slot and section hosts sort. The placed panel is listed\n * after any panel it ties with: a new row loads after the rows already there, and moving the\n * panel gives it a number of its own. A position is a slot, the top or bottom of a section —\n * where field claims draw too — or the place of a block that panels stand in for. Empty when the\n * panel stands in for a tab, grid or panel, since it then draws alone in that thing's place.\n */\nexport function PanelsInPosition(\n state: FormPlacementState,\n context: FormPlacementContext,\n title: string,\n): PlacementOrderItem[] {\n const here = placedPosition(state, context);\n if (!here) return [];\n const others: PlacementOrderItem[] = context.Existing\n .filter((e) => existingPosition(e, context) === here)\n .map((e) => ({ Key: e.Key, Title: e.Title, SortKey: e.SortKey ?? 0, IsThis: false }));\n const self: PlacementOrderItem = { Key: PLACEMENT_ORDER_THIS_KEY, Title: title, SortKey: state.SortKey ?? 0, IsThis: true };\n const items = [...others, self];\n return items\n .map((item, index) => ({ item, index }))\n .sort((a, b) => b.item.SortKey - a.item.SortKey\n || (a.item.IsThis ? 1 : b.item.IsThis ? -1 : a.index - b.index))\n .map((entry) => entry.item);\n}\n\n/**\n * Where the placed panel draws, as a key shared by every panel drawing in the same place: a slot\n * name, `in:<section>:<start|end>` for the top or bottom of a section, or `at:<section>` for the\n * place of a block that panels stand in for. Null when it stands in for a tab, grid or panel.\n */\nfunction placedPosition(state: FormPlacementState, context: FormPlacementContext): string | null {\n if (state.ReplaceMode === 'field') {\n return state.ReplaceFieldSectionKey ? `in:${state.ReplaceFieldSectionKey}:${state.SectionPosition}` : null;\n }\n if (state.ReplaceMode === 'section') return blockPosition(ChosenSectionKeys(state, context), context);\n if (state.ReplaceMode !== 'none') return null;\n const inSection = state.InSectionKey.trim();\n return inSection ? `in:${inSection}:${state.SectionPosition}` : state.Slot;\n}\n\n/** The same key for a panel already on the form. */\nfunction existingPosition(existing: FormPlacementExisting, context: FormPlacementContext): string | null {\n const replaced = (existing.SectionKeys ?? []).map((key) => key.trim()).filter((key) => key.length > 0);\n if (replaced.length > 0) {\n const drawn = TargetsUnread(context)\n ? replaced\n : context.Sections.map((s) => s.Key).filter((key) => replaced.includes(key));\n return blockPosition(drawn, context);\n }\n if (existing.ReplacesPlace) return null;\n const position = existing.SectionPosition === 'end' ? 'end' : 'start';\n const inSection = existing.InSectionKey?.trim();\n if (inSection) return `in:${inSection}:${position}`;\n const firstField = (existing.FieldNames ?? []).find((name) => name.trim().length > 0);\n if (firstField) {\n const section = SectionHoldingField(context, firstField);\n return section ? `in:${section.Key}:${position}` : null;\n }\n return existing.Slot;\n}\n\n/**\n * The key for panels standing in for `keys`, in form order: the place of the first. The first\n * block on the form is also where the before-fields slot draws, so the two share one key.\n */\nfunction blockPosition(keys: readonly string[], context: FormPlacementContext): string | null {\n const first = keys[0];\n if (!first) return null;\n return first === context.Sections[0]?.Key ? 'before-fields' : `at:${first}`;\n}\n\n/**\n * The order number that puts the placed panel one step up or down, or null when it cannot move.\n *\n * The number has to fall strictly between its new neighbours, since equal numbers do not say\n * which draws first. At either end of the list it goes a step past the last one. Between two\n * panels whose numbers are adjacent or equal there is no number to give, so the move is refused\n * rather than landing somewhere the list does not show.\n */\nexport function MovedSortKey(items: readonly PlacementOrderItem[], direction: 'up' | 'down'): number | null {\n const at = items.findIndex((item) => item.IsThis);\n if (at < 0) return null;\n const target = direction === 'up' ? at - 1 : at + 1;\n if (target < 0 || target >= items.length) return null;\n // Its neighbours after the move, read from the list without it: it lands at `target`.\n const rest = items.filter((item) => !item.IsThis);\n const above = rest[target - 1] ?? null;\n const below = rest[target] ?? null;\n if (!above && below) return below.SortKey + PLACEMENT_ORDER_STEP;\n if (above && !below) return above.SortKey - PLACEMENT_ORDER_STEP;\n if (!above || !below) return null;\n if (above.SortKey - below.SortKey < 2) return null;\n return Math.floor((above.SortKey + below.SortKey) / 2);\n}\n"]}
@@ -0,0 +1,112 @@
1
+ import { AfterViewInit, EventEmitter, OnDestroy } from '@angular/core';
2
+ import { CompositeKey } from '@memberjunction/core';
3
+ import { BaseAngularComponent } from '@memberjunction/ng-base-types';
4
+ import type { FormContributionSpec } from '@memberjunction/interactive-component-types/forms';
5
+ import type { ComponentSpec } from '@memberjunction/interactive-component-types';
6
+ import type { EntityFormConfig } from '../types/entity-form-config';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * The entity's real form, scaled down, with the placement dialog's panel drawn on it.
10
+ *
11
+ * The form is rendered by the same host every other surface uses, with a
12
+ * {@link FormPlacementPreview} provided to it, so the form itself places the unsaved panel,
13
+ * hides what it replaces and gives it a rail item.
14
+ *
15
+ * Read-only: the form is `inert` and every answer is made in the dialog's controls. The form
16
+ * shows the rail tab the panel is on; the preview scrolls to it. It has a form state of its own,
17
+ * held in memory, so opening that tab and its sections changes neither the user's saved form state
18
+ * nor the real form open behind the dialog.
19
+ */
20
+ export declare class MjFormPlacementPreviewComponent extends BaseAngularComponent implements AfterViewInit, OnDestroy {
21
+ /**
22
+ * The narrowest width the form is laid out at. A narrower column shows it scaled down; a
23
+ * wider one shows it at its real size, never enlarged.
24
+ */
25
+ static readonly MIN_STAGE_WIDTH = 1100;
26
+ /** A form that never finishes loading must not leave the dialog without a preview. */
27
+ private static readonly LOAD_TIMEOUT_MS;
28
+ /** How long the answers must be still before the panel is redrawn. */
29
+ private static readonly REDRAW_DELAY_MS;
30
+ set EntityName(value: string);
31
+ get EntityName(): string;
32
+ /**
33
+ * The record to show. Null shows a sample: the entity's first record, as Form Builder's
34
+ * preview picks it, or a new empty record when the entity has none.
35
+ */
36
+ set RecordKey(value: CompositeKey | null);
37
+ /** The panel to draw on the form. */
38
+ set Spec(value: FormContributionSpec | null);
39
+ /** The saved row the panel is an edit of, left off the preview. */
40
+ set ReplacesRowID(value: string | null);
41
+ /** The panel's component, not saved yet. Drawn in place of the placeholder. */
42
+ set PanelComponentSpec(value: ComponentSpec | null);
43
+ /** The saved component of the panel being edited. Drawn in place of the placeholder. */
44
+ set PanelComponentID(value: string | null);
45
+ /** The form did not render, so the dialog should show its list instead. */
46
+ Failed: EventEmitter<void>;
47
+ private viewport;
48
+ private stage;
49
+ PrimaryKey: CompositeKey;
50
+ /** False until the record to show is known, so the form is drawn once, not blank and then again. */
51
+ RecordResolved: boolean;
52
+ /** Which record the preview shows, in words. */
53
+ RecordLabel: string;
54
+ readonly FormConfig: EntityFormConfig;
55
+ Scale: number;
56
+ StageWidth: number;
57
+ StageHeight: number;
58
+ Loaded: boolean;
59
+ private _entityName;
60
+ private _recordKey;
61
+ private resolveRun;
62
+ private resolveQueued;
63
+ private _spec;
64
+ private _replacesRowID;
65
+ private _componentSpec;
66
+ private _componentID;
67
+ private resizeObserver;
68
+ private mutationObserver;
69
+ private frame;
70
+ private loadTimer;
71
+ private showTimer;
72
+ private sizeSignature;
73
+ /** Set after each redraw, until the panel has been brought into view. */
74
+ private revealPending;
75
+ private readonly preview;
76
+ private readonly zone;
77
+ private readonly cdr;
78
+ ngAfterViewInit(): void;
79
+ ngOnDestroy(): void;
80
+ OnLoaded(): void;
81
+ OnLoadError(): void;
82
+ /**
83
+ * Resolves the record once the current round of input changes is over, so the entity and the
84
+ * record key arriving together look up a sample record once.
85
+ */
86
+ private queueResolveRecord;
87
+ /** Settles which record the form shows, then lets the form draw. */
88
+ private resolveRecord;
89
+ /**
90
+ * The entity's first record, ordered the way Form Builder's preview orders it: by name when
91
+ * the entity has a name field, so every user sees the same one, else newest first.
92
+ */
93
+ private sampleRecord;
94
+ /**
95
+ * Redraws the panel on the form, shortly after the last change. Each redraw remounts the
96
+ * panel's component, so typing a label must not remount it on every key.
97
+ */
98
+ private showSpec;
99
+ private scheduleMeasure;
100
+ /** Fit the stage to the viewport, then keep the panel in view. Enters Angular only on a change. */
101
+ private measure;
102
+ /**
103
+ * Scrolls the panel into view once it draws after a redraw.
104
+ *
105
+ * On a form with a side rail the form itself shows the tab that holds the panel; this only
106
+ * waits for it to draw and then brings it into view.
107
+ */
108
+ private revealPanel;
109
+ static ɵfac: i0.ɵɵFactoryDeclaration<MjFormPlacementPreviewComponent, never>;
110
+ static ɵcmp: i0.ɵɵComponentDeclaration<MjFormPlacementPreviewComponent, "mj-form-placement-preview", never, { "EntityName": { "alias": "EntityName"; "required": false; }; "RecordKey": { "alias": "RecordKey"; "required": false; }; "Spec": { "alias": "Spec"; "required": false; }; "ReplacesRowID": { "alias": "ReplacesRowID"; "required": false; }; "PanelComponentSpec": { "alias": "PanelComponentSpec"; "required": false; }; "PanelComponentID": { "alias": "PanelComponentID"; "required": false; }; }, { "Failed": "Failed"; }, never, never, false, never>;
111
+ }
112
+ //# sourceMappingURL=form-placement-preview.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-placement-preview.component.d.ts","sourceRoot":"","sources":["../../../src/lib/apply/form-placement-preview.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAA4C,YAAY,EAAiB,SAAS,EAElG,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAsC,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;;AAUpE;;;;;;;;;;;GAWG;AACH,qBAUa,+BAAgC,SAAQ,oBAAqB,YAAW,aAAa,EAAE,SAAS;IACzG;;;OAGG;IACH,gBA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