@memberjunction/ng-base-forms 6.2.0-edge.2 → 6.2.0-edge.4

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 (188) 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 +132 -1
  30. package/dist/lib/base-form-component.d.ts.map +1 -1
  31. package/dist/lib/base-form-component.js +228 -19
  32. package/dist/lib/base-form-component.js.map +1 -1
  33. package/dist/lib/chrome/form-chrome.d.ts +90 -0
  34. package/dist/lib/chrome/form-chrome.d.ts.map +1 -1
  35. package/dist/lib/chrome/form-chrome.js +142 -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 +241 -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 +977 -249
  52. package/dist/lib/container/record-form-container.component.js.map +1 -1
  53. package/dist/lib/field/form-field.component.d.ts +17 -0
  54. package/dist/lib/field/form-field.component.d.ts.map +1 -1
  55. package/dist/lib/field/form-field.component.js +41 -5
  56. package/dist/lib/field/form-field.component.js.map +1 -1
  57. package/dist/lib/form-state.service.d.ts +5 -0
  58. package/dist/lib/form-state.service.d.ts.map +1 -1
  59. package/dist/lib/form-state.service.js +6 -1
  60. package/dist/lib/form-state.service.js.map +1 -1
  61. package/dist/lib/host/entity-form-host.component.d.ts +16 -1
  62. package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
  63. package/dist/lib/host/entity-form-host.component.js +27 -6
  64. package/dist/lib/host/entity-form-host.component.js.map +1 -1
  65. package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts +24 -0
  66. package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts.map +1 -0
  67. package/dist/lib/interactive-form/form-panel-host-props.builder.js +99 -0
  68. package/dist/lib/interactive-form/form-panel-host-props.builder.js.map +1 -0
  69. package/dist/lib/interactive-form/interactive-form-panel.component.d.ts +109 -0
  70. package/dist/lib/interactive-form/interactive-form-panel.component.d.ts.map +1 -0
  71. package/dist/lib/interactive-form/interactive-form-panel.component.js +424 -0
  72. package/dist/lib/interactive-form/interactive-form-panel.component.js.map +1 -0
  73. package/dist/lib/interactive-form/interactive-form.component.d.ts +2 -0
  74. package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
  75. package/dist/lib/interactive-form/interactive-form.component.js +4 -5
  76. package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
  77. package/dist/lib/panel/collapsible-panel.component.d.ts +69 -1
  78. package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
  79. package/dist/lib/panel/collapsible-panel.component.js +148 -12
  80. package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
  81. package/dist/lib/panel-manager/form-audience.d.ts +46 -0
  82. package/dist/lib/panel-manager/form-audience.d.ts.map +1 -0
  83. package/dist/lib/panel-manager/form-audience.js +34 -0
  84. package/dist/lib/panel-manager/form-audience.js.map +1 -0
  85. package/dist/lib/panel-manager/form-panel-admin.service.d.ts +150 -0
  86. package/dist/lib/panel-manager/form-panel-admin.service.d.ts.map +1 -0
  87. package/dist/lib/panel-manager/form-panel-admin.service.js +433 -0
  88. package/dist/lib/panel-manager/form-panel-admin.service.js.map +1 -0
  89. package/dist/lib/panel-manager/form-panel-inventory.d.ts +255 -0
  90. package/dist/lib/panel-manager/form-panel-inventory.d.ts.map +1 -0
  91. package/dist/lib/panel-manager/form-panel-inventory.js +293 -0
  92. package/dist/lib/panel-manager/form-panel-inventory.js.map +1 -0
  93. package/dist/lib/panel-manager/panel-manager.component.d.ts +232 -0
  94. package/dist/lib/panel-manager/panel-manager.component.d.ts.map +1 -0
  95. package/dist/lib/panel-manager/panel-manager.component.js +1112 -0
  96. package/dist/lib/panel-manager/panel-manager.component.js.map +1 -0
  97. package/dist/lib/panel-slot/base-contribution-panel.d.ts +40 -0
  98. package/dist/lib/panel-slot/base-contribution-panel.d.ts.map +1 -0
  99. package/dist/lib/panel-slot/base-contribution-panel.js +55 -0
  100. package/dist/lib/panel-slot/base-contribution-panel.js.map +1 -0
  101. package/dist/lib/panel-slot/base-form-panel.d.ts +116 -8
  102. package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
  103. package/dist/lib/panel-slot/base-form-panel.js +76 -5
  104. package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
  105. package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts +29 -0
  106. package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts.map +1 -0
  107. package/dist/lib/panel-slot/collect-form-contribution-registrations.js +214 -0
  108. package/dist/lib/panel-slot/collect-form-contribution-registrations.js.map +1 -0
  109. package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts +6 -3
  110. package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts.map +1 -1
  111. package/dist/lib/panel-slot/collect-form-panel-registrations.js +8 -14
  112. package/dist/lib/panel-slot/collect-form-panel-registrations.js.map +1 -1
  113. package/dist/lib/panel-slot/form-contribution.d.ts +170 -7
  114. package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
  115. package/dist/lib/panel-slot/form-contribution.js +245 -71
  116. package/dist/lib/panel-slot/form-contribution.js.map +1 -1
  117. package/dist/lib/panel-slot/form-contributions.component.d.ts +16 -5
  118. package/dist/lib/panel-slot/form-contributions.component.d.ts.map +1 -1
  119. package/dist/lib/panel-slot/form-contributions.component.js +43 -7
  120. package/dist/lib/panel-slot/form-contributions.component.js.map +1 -1
  121. package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts +66 -0
  122. package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts.map +1 -0
  123. package/dist/lib/panel-slot/form-field-panel-slot.component.js +190 -0
  124. package/dist/lib/panel-slot/form-field-panel-slot.component.js.map +1 -0
  125. package/dist/lib/panel-slot/form-panel-slot.component.d.ts +52 -16
  126. package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
  127. package/dist/lib/panel-slot/form-panel-slot.component.js +190 -66
  128. package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
  129. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +11 -0
  130. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
  131. package/dist/lib/panel-slot/form-slot-coordinator.service.js +17 -0
  132. package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
  133. package/dist/lib/panel-slot/merge-panel-validation.d.ts +7 -0
  134. package/dist/lib/panel-slot/merge-panel-validation.d.ts.map +1 -0
  135. package/dist/lib/panel-slot/merge-panel-validation.js +16 -0
  136. package/dist/lib/panel-slot/merge-panel-validation.js.map +1 -0
  137. package/dist/lib/panel-slot/mount-form-contribution.d.ts +15 -0
  138. package/dist/lib/panel-slot/mount-form-contribution.d.ts.map +1 -0
  139. package/dist/lib/panel-slot/mount-form-contribution.js +37 -0
  140. package/dist/lib/panel-slot/mount-form-contribution.js.map +1 -0
  141. package/dist/lib/panel-slot/panel-hides.d.ts +35 -0
  142. package/dist/lib/panel-slot/panel-hides.d.ts.map +1 -0
  143. package/dist/lib/panel-slot/panel-hides.js +111 -0
  144. package/dist/lib/panel-slot/panel-hides.js.map +1 -0
  145. package/dist/lib/panel-slot/placement-preview-panel.component.d.ts +16 -0
  146. package/dist/lib/panel-slot/placement-preview-panel.component.d.ts.map +1 -0
  147. package/dist/lib/panel-slot/placement-preview-panel.component.js +112 -0
  148. package/dist/lib/panel-slot/placement-preview-panel.component.js.map +1 -0
  149. package/dist/lib/panel-slot/placement-preview.d.ts +57 -0
  150. package/dist/lib/panel-slot/placement-preview.d.ts.map +1 -0
  151. package/dist/lib/panel-slot/placement-preview.js +86 -0
  152. package/dist/lib/panel-slot/placement-preview.js.map +1 -0
  153. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
  154. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
  155. package/dist/lib/panel-slot/related-entity-grid-panel.component.js +10 -3
  156. package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
  157. package/dist/lib/panel-slot/slot-order.d.ts +19 -0
  158. package/dist/lib/panel-slot/slot-order.d.ts.map +1 -0
  159. package/dist/lib/panel-slot/slot-order.js +53 -0
  160. package/dist/lib/panel-slot/slot-order.js.map +1 -0
  161. package/dist/lib/resolver/form-resolver.service.d.ts +4 -2
  162. package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -1
  163. package/dist/lib/resolver/form-resolver.service.js +18 -8
  164. package/dist/lib/resolver/form-resolver.service.js.map +1 -1
  165. package/dist/lib/resolver/form-variants.d.ts +28 -0
  166. package/dist/lib/resolver/form-variants.d.ts.map +1 -0
  167. package/dist/lib/resolver/form-variants.js +40 -0
  168. package/dist/lib/resolver/form-variants.js.map +1 -0
  169. package/dist/lib/section-counts/form-section-counts.d.ts +99 -0
  170. package/dist/lib/section-counts/form-section-counts.d.ts.map +1 -0
  171. package/dist/lib/section-counts/form-section-counts.js +223 -0
  172. package/dist/lib/section-counts/form-section-counts.js.map +1 -0
  173. package/dist/lib/toolbar/form-toolbar.component.d.ts +7 -0
  174. package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
  175. package/dist/lib/toolbar/form-toolbar.component.js +194 -128
  176. package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
  177. package/dist/lib/types/form-types.d.ts +8 -0
  178. package/dist/lib/types/form-types.d.ts.map +1 -1
  179. package/dist/lib/types/form-types.js.map +1 -1
  180. package/dist/module.d.ts +29 -23
  181. package/dist/module.d.ts.map +1 -1
  182. package/dist/module.js +43 -5
  183. package/dist/module.js.map +1 -1
  184. package/dist/public-api.d.ts +20 -0
  185. package/dist/public-api.d.ts.map +1 -1
  186. package/dist/public-api.js +21 -0
  187. package/dist/public-api.js.map +1 -1
  188. package/package.json +20 -20
@@ -0,0 +1,424 @@
1
+ import { ChangeDetectorRef, Component, ViewChild, inject } from '@angular/core';
2
+ import { LogError, ValidationResult } from '@memberjunction/core';
3
+ import { ValidationErrorInfo } from '@memberjunction/global';
4
+ import { InteractiveFormsEngine } from '@memberjunction/core-entities';
5
+ import { FormPanelEventNames, FormPanelMethodNames, IsFormPanelRole, } from '@memberjunction/interactive-component-types/forms';
6
+ import { ReactBridgeService } from '@memberjunction/ng-react';
7
+ import { BaseContributionPanel } from '../panel-slot/base-contribution-panel';
8
+ import { ContributionSectionKey } from '../panel-slot/form-contribution';
9
+ import { BuildFormPanelHostProps } from './form-panel-host-props.builder';
10
+ import { FormFieldEditCoordinator } from '../form-field-edit.coordinator';
11
+ import * as i0 from "@angular/core";
12
+ import * as i1 from "@angular/common";
13
+ import * as i2 from "@memberjunction/ng-ui-components";
14
+ import * as i3 from "@memberjunction/ng-react";
15
+ import * as i4 from "../panel/collapsible-panel.component";
16
+ const _c0 = ["reactComponent"];
17
+ function InteractiveFormPanelComponent_Conditional_0_Conditional_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
18
+ i0.ɵɵelementContainer(0);
19
+ } }
20
+ function InteractiveFormPanelComponent_Conditional_0_Conditional_0_Template(rf, ctx) { if (rf & 1) {
21
+ i0.ɵɵelementStart(0, "div", 4);
22
+ i0.ɵɵtemplate(1, InteractiveFormPanelComponent_Conditional_0_Conditional_0_ng_container_1_Template, 1, 0, "ng-container", 5);
23
+ i0.ɵɵelementEnd();
24
+ } if (rf & 2) {
25
+ const ctx_r0 = i0.ɵɵnextContext(2);
26
+ const body_r2 = i0.ɵɵreference(2);
27
+ i0.ɵɵstyleProp("order", ctx_r0.DisplayOrder);
28
+ i0.ɵɵattribute("data-bare-section-key", ctx_r0.BareTabKey)("data-bare-title", ctx_r0.Title);
29
+ i0.ɵɵadvance();
30
+ i0.ɵɵproperty("ngTemplateOutlet", body_r2);
31
+ } }
32
+ function InteractiveFormPanelComponent_Conditional_0_Conditional_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
33
+ i0.ɵɵelementContainer(0);
34
+ } }
35
+ function InteractiveFormPanelComponent_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
36
+ i0.ɵɵelementStart(0, "mj-collapsible-panel", 3);
37
+ i0.ɵɵtemplate(1, InteractiveFormPanelComponent_Conditional_0_Conditional_1_ng_container_1_Template, 1, 0, "ng-container", 5);
38
+ i0.ɵɵelementEnd();
39
+ } if (rf & 2) {
40
+ const ctx_r0 = i0.ɵɵnextContext(2);
41
+ const body_r2 = i0.ɵɵreference(2);
42
+ i0.ɵɵproperty("SectionKey", ctx_r0.SectionKey)("Order", ctx_r0.DisplayOrder)("SectionName", ctx_r0.Title)("Icon", ctx_r0.Icon)("Variant", ctx_r0.Variant)("Form", ctx_r0.FormComponent)("FormContext", ctx_r0.FormContext)("DefaultExpanded", !ctx_r0.IsRelatedClaim);
43
+ i0.ɵɵadvance();
44
+ i0.ɵɵproperty("ngTemplateOutlet", body_r2);
45
+ } }
46
+ function InteractiveFormPanelComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
47
+ i0.ɵɵconditionalCreate(0, InteractiveFormPanelComponent_Conditional_0_Conditional_0_Template, 2, 5, "div", 2)(1, InteractiveFormPanelComponent_Conditional_0_Conditional_1_Template, 2, 9, "mj-collapsible-panel", 3);
48
+ } if (rf & 2) {
49
+ const ctx_r0 = i0.ɵɵnextContext();
50
+ i0.ɵɵconditional(ctx_r0.IsBare ? 0 : 1);
51
+ } }
52
+ function InteractiveFormPanelComponent_ng_template_1_Conditional_0_Template(rf, ctx) { if (rf & 1) {
53
+ i0.ɵɵelementStart(0, "mj-alert", 6);
54
+ i0.ɵɵtext(1);
55
+ i0.ɵɵelementEnd();
56
+ } if (rf & 2) {
57
+ const ctx_r0 = i0.ɵɵnextContext(2);
58
+ i0.ɵɵadvance();
59
+ i0.ɵɵtextInterpolate(ctx_r0.loadError);
60
+ } }
61
+ function InteractiveFormPanelComponent_ng_template_1_Conditional_1_Conditional_0_Template(rf, ctx) { if (rf & 1) {
62
+ i0.ɵɵelementStart(0, "mj-alert", 6);
63
+ i0.ɵɵtext(1);
64
+ i0.ɵɵelementEnd();
65
+ } if (rf & 2) {
66
+ const ctx_r0 = i0.ɵɵnextContext(3);
67
+ i0.ɵɵadvance();
68
+ i0.ɵɵtextInterpolate(ctx_r0.RenderError);
69
+ } }
70
+ function InteractiveFormPanelComponent_ng_template_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
71
+ const _r3 = i0.ɵɵgetCurrentView();
72
+ i0.ɵɵconditionalCreate(0, InteractiveFormPanelComponent_ng_template_1_Conditional_1_Conditional_0_Template, 2, 1, "mj-alert", 6);
73
+ i0.ɵɵelementStart(1, "mj-react-component", 8, 1);
74
+ i0.ɵɵlistener("componentEvent", function InteractiveFormPanelComponent_ng_template_1_Conditional_1_Template_mj_react_component_componentEvent_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.OnReactComponentEvent($event)); })("openEntityRecord", function InteractiveFormPanelComponent_ng_template_1_Conditional_1_Template_mj_react_component_openEntityRecord_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.OnOpenEntityRecord($event)); });
75
+ i0.ɵɵelementEnd();
76
+ } if (rf & 2) {
77
+ const ctx_r0 = i0.ɵɵnextContext(2);
78
+ i0.ɵɵconditional(ctx_r0.RenderError ? 0 : -1);
79
+ i0.ɵɵadvance();
80
+ i0.ɵɵproperty("component", ctx_r0.componentSpec)("componentProps", ctx_r0.HostProps);
81
+ } }
82
+ function InteractiveFormPanelComponent_ng_template_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
83
+ i0.ɵɵelementStart(0, "div", 7);
84
+ i0.ɵɵelement(1, "i", 9);
85
+ i0.ɵɵelementStart(2, "span");
86
+ i0.ɵɵtext(3, "Loading panel\u2026");
87
+ i0.ɵɵelementEnd()();
88
+ } }
89
+ function InteractiveFormPanelComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
90
+ i0.ɵɵconditionalCreate(0, InteractiveFormPanelComponent_ng_template_1_Conditional_0_Template, 2, 1, "mj-alert", 6)(1, InteractiveFormPanelComponent_ng_template_1_Conditional_1_Template, 3, 3)(2, InteractiveFormPanelComponent_ng_template_1_Conditional_2_Template, 4, 0, "div", 7);
91
+ } if (rf & 2) {
92
+ const ctx_r0 = i0.ɵɵnextContext();
93
+ i0.ɵɵconditional(ctx_r0.loadError ? 0 : ctx_r0.componentSpec && ctx_r0.HostProps ? 1 : 2);
94
+ } }
95
+ /**
96
+ * Generic host for a metadata form contribution (`MJ: Entity Form Contributions` row →
97
+ * `componentRole: 'form-panel'` React component). Mounted by `<mj-form-panel-slot>` for
98
+ * `Source: 'metadata'` winners exactly where a compiled BaseFormPanel would mount.
99
+ *
100
+ * Layering: the React component never touches BaseEntity. This host owns the
101
+ * `FormPanelHostProps` snapshot and rebuilds it when the parent record's values change,
102
+ * applies `FieldChanged` to the PARENT record (only for the fields the contribution
103
+ * claims, and only in edit mode; the parent form's Save persists it), forwards
104
+ * `RowCountChanged` to the rail badge, and surfaces `Validate` through
105
+ * `BaseFormPanel.Validate()`.
106
+ */
107
+ export class InteractiveFormPanelComponent extends BaseContributionPanel {
108
+ ReactComponent;
109
+ componentSpec = null;
110
+ HostProps = null;
111
+ /**
112
+ * Load-time failure only: missing ComponentID, component not found, bad Specification
113
+ * JSON, wrong role. Shown in place of the React component.
114
+ */
115
+ loadError = null;
116
+ /**
117
+ * A failure after the React component loaded, shown above it: an `error` event from
118
+ * `<mj-react-component>` (initialization, render timeout, a throw its error boundary
119
+ * caught, or an `error` event the panel raises), or a `Validate` that threw. A throw during
120
+ * render stays inside this panel's subtree, so the rest of the form renders and saves
121
+ * normally.
122
+ *
123
+ * An `error` event stays until the panel is mounted again, and a `Validate` that throws
124
+ * does not replace it. A `Validate` failure clears when a later `Validate` answers.
125
+ */
126
+ RenderError = null;
127
+ /** Where {@link RenderError} came from, or null when it is empty. */
128
+ renderErrorSource = null;
129
+ lastValidation = null;
130
+ lastEditMode = null;
131
+ lastExpanded = null;
132
+ /** The record's field values when {@link HostProps} was last built, by field position. */
133
+ shownValues = null;
134
+ cdr = inject(ChangeDetectorRef);
135
+ reactBridge = inject(ReactBridgeService);
136
+ /** The form's field-edit broadcast, which starts the entry-time duplicate check on a new record. */
137
+ fieldEdits = inject(FormFieldEditCoordinator, { optional: true });
138
+ /** Section identity — {@link ContributionSectionKey}, the key the rail files this panel by. */
139
+ get SectionKey() {
140
+ return ContributionSectionKey(this.Contribution);
141
+ }
142
+ get Title() {
143
+ return this.Contribution.Title ?? this.Contribution.Metadata.contributionKey ?? this.SectionKey;
144
+ }
145
+ async ngOnInit() {
146
+ try {
147
+ await this.reactBridge.getReactContext();
148
+ }
149
+ catch (err) {
150
+ LogError(`InteractiveFormPanelComponent: React bridge bootstrap failed: ${err instanceof Error ? err.message : String(err)}`);
151
+ this.loadError = 'React runtime failed to load. Try a hard refresh.';
152
+ return;
153
+ }
154
+ await this.loadSpec();
155
+ this.RebuildHostProps();
156
+ }
157
+ /**
158
+ * Edit mode, expanded state and the parent record's values are not inputs; detect their
159
+ * changes cheaply. A field the user edits elsewhere on the form reaches the panel this way.
160
+ */
161
+ ngDoCheck() {
162
+ const edit = this.FormComponent?.EditMode ?? false;
163
+ const expanded = this.isExpanded();
164
+ if (edit !== this.lastEditMode || expanded !== this.lastExpanded) {
165
+ const modeChanged = this.lastEditMode !== null && edit !== this.lastEditMode;
166
+ this.lastEditMode = edit;
167
+ this.lastExpanded = expanded;
168
+ if (this.HostProps)
169
+ this.RebuildHostProps();
170
+ if (modeChanged)
171
+ this.invokeIfRegistered(FormPanelMethodNames.SetEditMode, { mode: edit ? 'edit' : 'view' });
172
+ }
173
+ else if (this.HostProps && this.recordValuesChanged()) {
174
+ this.RebuildHostProps();
175
+ }
176
+ }
177
+ ngOnDestroy() {
178
+ this.HostProps = null;
179
+ this.shownValues = null;
180
+ }
181
+ RebuildHostProps() {
182
+ if (!this.Record) {
183
+ this.HostProps = null;
184
+ this.shownValues = null;
185
+ return;
186
+ }
187
+ this.shownValues = this.Record.Fields.map((f) => f.Value);
188
+ this.HostProps = BuildFormPanelHostProps({
189
+ Record: this.Record,
190
+ FormComponent: this.FormComponent ?? null,
191
+ Contribution: this.Contribution,
192
+ SectionKey: this.SectionKey,
193
+ Layout: this.FormComponent?.ChromeLayout ?? 'accordion',
194
+ IsExpanded: this.isExpanded(),
195
+ });
196
+ this.cdr.markForCheck();
197
+ }
198
+ async OnReactComponentEvent(event) {
199
+ switch (event.type) {
200
+ case FormPanelEventNames.RowCountChanged: {
201
+ const args = event.payload;
202
+ if (typeof args?.count === 'number')
203
+ this.FormComponent?.SetSectionRowCount(this.SectionKey, args.count);
204
+ break;
205
+ }
206
+ case FormPanelEventNames.FieldChanged: {
207
+ const args = event.payload;
208
+ this.applyFieldChange(args?.fieldName, args?.newValue);
209
+ break;
210
+ }
211
+ case FormPanelEventNames.ValidationChanged: {
212
+ const args = event.payload;
213
+ this.lastValidation = { isValid: !!args?.isValid, errors: args?.errors ?? [] };
214
+ break;
215
+ }
216
+ case 'error': {
217
+ const payload = event.payload;
218
+ const message = `${this.Title} failed: ${payload?.error ? String(payload.error) : 'unknown error'}`;
219
+ // `<mj-react-component>` logs initialization failures and error-boundary catches
220
+ // itself; a render timeout or an error the panel raises is logged here.
221
+ if (payload?.source !== 'initialization' && payload?.source !== 'react') {
222
+ LogError(`InteractiveFormPanelComponent: ${message}`);
223
+ }
224
+ this.setRenderError(message, 'render');
225
+ break;
226
+ }
227
+ }
228
+ }
229
+ OnOpenEntityRecord(event) {
230
+ this.FormComponent?.OnFormNavigate({ Kind: 'record', EntityName: event.entityName, PrimaryKey: event.key });
231
+ }
232
+ OnRecordRefreshed(record) {
233
+ this.Record = record;
234
+ this.RebuildHostProps();
235
+ this.invokeIfRegistered(FormPanelMethodNames.OnRecordRefreshed);
236
+ }
237
+ /**
238
+ * Surface the panel's validity to the parent form's save.
239
+ *
240
+ * The React method may be `async` — any validator that checks something
241
+ * server-side will be — and `invokeMethod` returns whatever the method
242
+ * returned. Awaiting is therefore load-bearing: a synchronous `'isValid' in
243
+ * live` test sees a Promise, fails, silently falls back to the last cached
244
+ * `ValidationChanged` payload, and the form saves an invalid record with no
245
+ * error and no log. Resolving a non-Promise is a no-op, so one code path
246
+ * covers both shapes.
247
+ *
248
+ * A validator that throws or rejects does not block the save by itself. It is logged and
249
+ * shown in the panel ({@link RenderError}) unless the panel already shows an `error` event,
250
+ * and the result falls back to the last `ValidationChanged` state, so a failure the panel
251
+ * reported before still blocks.
252
+ */
253
+ async Validate() {
254
+ let live;
255
+ if (this.ReactComponent?.hasMethod?.(FormPanelMethodNames.Validate)) {
256
+ try {
257
+ const returned = this.ReactComponent.invokeMethod(FormPanelMethodNames.Validate);
258
+ live = await Promise.resolve(returned);
259
+ if (this.renderErrorSource === 'validate')
260
+ this.setRenderError(null);
261
+ }
262
+ catch (err) {
263
+ LogError(`InteractiveFormPanelComponent.Validate: panel validator threw: ${err instanceof Error ? err.message : String(err)}`);
264
+ if (this.renderErrorSource !== 'render') {
265
+ this.setRenderError(`${this.Title} could not check its values.`, 'validate');
266
+ }
267
+ }
268
+ }
269
+ const state = live && typeof live === 'object' && 'isValid' in live ? live : this.lastValidation;
270
+ return this.toValidationResult(state);
271
+ }
272
+ /** The last state the panel reported through `ValidationChanged`; valid when it has reported none. */
273
+ LastKnownValidation() {
274
+ return this.toValidationResult(this.lastValidation);
275
+ }
276
+ toValidationResult(state) {
277
+ const result = new ValidationResult();
278
+ result.Success = state ? state.isValid : true;
279
+ result.Errors = (state?.errors ?? []).map((message) => new ValidationErrorInfo(this.SectionKey, message, null));
280
+ return result;
281
+ }
282
+ setRenderError(message, source = null) {
283
+ this.renderErrorSource = message ? source : null;
284
+ if (this.RenderError === message)
285
+ return;
286
+ this.RenderError = message;
287
+ this.cdr.markForCheck();
288
+ }
289
+ isExpanded() {
290
+ return this.FormComponent?.IsSectionExpanded(this.SectionKey, !this.IsRelatedClaim) ?? true;
291
+ }
292
+ /** True when a field of the record no longer holds the value {@link HostProps} was built from. */
293
+ recordValuesChanged() {
294
+ const shown = this.shownValues;
295
+ const fields = this.Record?.Fields;
296
+ if (!shown || !fields)
297
+ return false;
298
+ if (fields.length !== shown.length)
299
+ return true;
300
+ for (let i = 0; i < fields.length; i++) {
301
+ if (!Object.is(fields[i].Value, shown[i]))
302
+ return true;
303
+ }
304
+ return false;
305
+ }
306
+ /**
307
+ * Writes a panel's `FieldChanged` to the parent record: only a field the contribution claims
308
+ * (`replacesFieldNames`), and only while the form is in edit mode. Anything else is ignored
309
+ * and logged, so a panel cannot change a field the user did not hand it or edit a record the
310
+ * user is only viewing.
311
+ *
312
+ * A write the record refuses (a disabled or unreadable field) is logged and dropped. A write
313
+ * that succeeds is reported to {@link FormFieldEditCoordinator}, as an edit in
314
+ * `mj-form-field` is. Field validation and the `ValueChange` output of `mj-form-field` do not
315
+ * apply, because a claimed field is not drawn.
316
+ */
317
+ applyFieldChange(fieldName, value) {
318
+ if (!fieldName || !this.Record)
319
+ return;
320
+ const wanted = fieldName.trim().toLowerCase();
321
+ const entityName = this.Record.EntityInfo.Name;
322
+ if (!this.FormComponent?.EditMode) {
323
+ LogError(`InteractiveFormPanelComponent: "${fieldName}" on ${entityName} changed while the form is not in edit mode; change ignored.`);
324
+ return;
325
+ }
326
+ const claimed = (this.Contribution.Metadata.replacesFieldNames ?? []).some((name) => name.trim().toLowerCase() === wanted);
327
+ if (!claimed) {
328
+ LogError(`InteractiveFormPanelComponent: "${fieldName}" on ${entityName} is not a field this panel claims; change ignored.`);
329
+ return;
330
+ }
331
+ const field = this.Record.Fields.find((f) => f.Name.trim().toLowerCase() === wanted);
332
+ if (!field) {
333
+ LogError(`InteractiveFormPanelComponent: unknown field "${fieldName}" on ${entityName}; change ignored.`);
334
+ return;
335
+ }
336
+ try {
337
+ // Dynamic field name from the React side — the same sanctioned Set() path the whole-form host uses.
338
+ this.Record.Set(field.Name, value);
339
+ }
340
+ catch (err) {
341
+ LogError(`InteractiveFormPanelComponent: could not set "${field.Name}" on ${entityName}: ${err instanceof Error ? err.message : String(err)}`);
342
+ return;
343
+ }
344
+ this.fieldEdits?.Notify({ FieldName: field.Name });
345
+ }
346
+ invokeIfRegistered(method, ...args) {
347
+ if (!this.ReactComponent?.hasMethod?.(method))
348
+ return undefined;
349
+ try {
350
+ return this.ReactComponent.invokeMethod(method, ...args);
351
+ }
352
+ catch (err) {
353
+ LogError(`InteractiveFormPanelComponent.${method}: ${err instanceof Error ? err.message : String(err)}`);
354
+ return undefined;
355
+ }
356
+ }
357
+ async loadSpec() {
358
+ const supplied = this.Contribution?.ComponentSpec;
359
+ if (supplied) {
360
+ this.componentSpec = IsFormPanelRole(supplied) ? supplied : null;
361
+ if (!this.componentSpec)
362
+ this.loadError = `Component ${supplied.name} does not declare componentRole='form-panel'.`;
363
+ this.cdr.markForCheck();
364
+ return;
365
+ }
366
+ const id = this.Contribution?.ComponentID;
367
+ if (!id) {
368
+ this.loadError = 'Contribution has no ComponentID.';
369
+ return;
370
+ }
371
+ const provider = this.FormComponent?.ProviderToUse;
372
+ try {
373
+ if (provider)
374
+ await InteractiveFormsEngine.Instance.Config(false, provider.CurrentUser, provider);
375
+ }
376
+ catch (err) {
377
+ LogError(`InteractiveFormPanelComponent: engine Config failed: ${err instanceof Error ? err.message : String(err)}`);
378
+ }
379
+ // A panel's Widget component is not in the engine's loaded forms; the engine fetches it
380
+ // by ID once and serves every later mount of it from memory.
381
+ const component = await InteractiveFormsEngine.Instance.GetComponentByID(id, provider?.CurrentUser, provider);
382
+ if (!component) {
383
+ this.loadError = `Component ${id} not found.`;
384
+ return;
385
+ }
386
+ try {
387
+ this.componentSpec = JSON.parse(component.Specification ?? 'null');
388
+ }
389
+ catch (err) {
390
+ this.loadError = `Component ${component.Name} has invalid Specification JSON: ${err instanceof Error ? err.message : String(err)}`;
391
+ return;
392
+ }
393
+ if (!this.componentSpec) {
394
+ this.loadError = `Component ${component.Name} has an empty Specification.`;
395
+ return;
396
+ }
397
+ if (!IsFormPanelRole(this.componentSpec)) {
398
+ this.loadError = `Component ${component.Name} does not declare componentRole='form-panel'.`;
399
+ this.componentSpec = null;
400
+ }
401
+ this.cdr.markForCheck();
402
+ }
403
+ static ɵfac = /*@__PURE__*/ (() => { let ɵInteractiveFormPanelComponent_BaseFactory; return function InteractiveFormPanelComponent_Factory(__ngFactoryType__) { return (ɵInteractiveFormPanelComponent_BaseFactory || (ɵInteractiveFormPanelComponent_BaseFactory = i0.ɵɵgetInheritedFactory(InteractiveFormPanelComponent)))(__ngFactoryType__ || InteractiveFormPanelComponent); }; })();
404
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InteractiveFormPanelComponent, selectors: [["mj-interactive-form-panel"]], viewQuery: function InteractiveFormPanelComponent_Query(rf, ctx) { if (rf & 1) {
405
+ i0.ɵɵviewQuery(_c0, 5);
406
+ } if (rf & 2) {
407
+ let _t;
408
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ReactComponent = _t.first);
409
+ } }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 1, consts: [["body", ""], ["reactComponent", ""], [1, "mj-form-bare-panel", 2, "display", "block", 3, "order"], [3, "SectionKey", "Order", "SectionName", "Icon", "Variant", "Form", "FormContext", "DefaultExpanded"], [1, "mj-form-bare-panel", 2, "display", "block"], [4, "ngTemplateOutlet"], ["Variant", "error"], [1, "mj-loading-state"], [3, "componentEvent", "openEntityRecord", "component", "componentProps"], [1, "fa-solid", "fa-spinner", "fa-spin"]], template: function InteractiveFormPanelComponent_Template(rf, ctx) { if (rf & 1) {
410
+ i0.ɵɵconditionalCreate(0, InteractiveFormPanelComponent_Conditional_0_Template, 2, 1);
411
+ i0.ɵɵtemplate(1, InteractiveFormPanelComponent_ng_template_1_Template, 3, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
412
+ } if (rf & 2) {
413
+ i0.ɵɵconditional(ctx.Contribution ? 0 : -1);
414
+ } }, dependencies: [i1.NgTemplateOutlet, i2.MJAlertComponent, i3.MJReactComponent, i4.MjCollapsiblePanelComponent], encapsulation: 2 });
415
+ }
416
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InteractiveFormPanelComponent, [{
417
+ type: Component,
418
+ args: [{ standalone: false, selector: 'mj-interactive-form-panel', template: "@if (Contribution) {\n @if (IsBare) {\n <!-- A bare strip's own flex item: it carries the order a panel's chrome would, and the tab\n key the rail reads when the strip replaces blocks. -->\n <div class=\"mj-form-bare-panel\" style=\"display: block\"\n [style.order]=\"DisplayOrder\"\n [attr.data-bare-section-key]=\"BareTabKey\"\n [attr.data-bare-title]=\"Title\">\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </div>\n } @else {\n <mj-collapsible-panel\n [SectionKey]=\"SectionKey\"\n [Order]=\"DisplayOrder\"\n [SectionName]=\"Title\"\n [Icon]=\"Icon\"\n [Variant]=\"Variant\"\n [Form]=\"FormComponent\"\n [FormContext]=\"FormContext\"\n [DefaultExpanded]=\"!IsRelatedClaim\">\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </mj-collapsible-panel>\n }\n}\n\n<ng-template #body>\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && HostProps) {\n @if (RenderError) {\n <mj-alert Variant=\"error\">{{ RenderError }}</mj-alert>\n }\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"HostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading panel\u2026</span>\n </div>\n }\n</ng-template>\n" }]
419
+ }], null, { ReactComponent: [{
420
+ type: ViewChild,
421
+ args: ['reactComponent']
422
+ }] }); })();
423
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InteractiveFormPanelComponent, { className: "InteractiveFormPanelComponent", filePath: "src/lib/interactive-form/interactive-form-panel.component.ts", lineNumber: 42 }); })();
424
+ //# sourceMappingURL=interactive-form-panel.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-form-panel.component.js","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form-panel.component.ts","../../../src/lib/interactive-form/interactive-form-panel.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA8B,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAsC,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EACH,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAMlB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAoB,kBAAkB,EAA4B,MAAM,0BAA0B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;;;;;;;;ICXpE,wB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BAA6B","sourcesContent":["import { ChangeDetectorRef, Component, DoCheck, OnDestroy, OnInit, ViewChild, inject } from '@angular/core';\nimport { LogError, ValidationResult, type BaseEntity, type CompositeKey } from '@memberjunction/core';\nimport { ValidationErrorInfo } from '@memberjunction/global';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport {\n FormPanelEventNames,\n FormPanelMethodNames,\n IsFormPanelRole,\n type FormPanelHostProps,\n type FormPanelRowCountChangedArgs,\n type FormPanelValidateResult,\n type FormFieldChangedArgs,\n type FormValidationChangedArgs,\n} from '@memberjunction/interactive-component-types/forms';\nimport { MJReactComponent, ReactBridgeService, type ReactComponentEvent } from '@memberjunction/ng-react';\nimport { BaseContributionPanel } from '../panel-slot/base-contribution-panel';\nimport { ContributionSectionKey } from '../panel-slot/form-contribution';\nimport { BuildFormPanelHostProps } from './form-panel-host-props.builder';\nimport { FormFieldEditCoordinator } from '../form-field-edit.coordinator';\n\n/** Where a panel failure came from: the panel's validator, or `<mj-react-component>`. */\ntype RenderErrorSource = 'validate' | 'render';\n\n/**\n * Generic host for a metadata form contribution (`MJ: Entity Form Contributions` row →\n * `componentRole: 'form-panel'` React component). Mounted by `<mj-form-panel-slot>` for\n * `Source: 'metadata'` winners exactly where a compiled BaseFormPanel would mount.\n *\n * Layering: the React component never touches BaseEntity. This host owns the\n * `FormPanelHostProps` snapshot and rebuilds it when the parent record's values change,\n * applies `FieldChanged` to the PARENT record (only for the fields the contribution\n * claims, and only in edit mode; the parent form's Save persists it), forwards\n * `RowCountChanged` to the rail badge, and surfaces `Validate` through\n * `BaseFormPanel.Validate()`.\n */\n@Component({\n standalone: false,\n selector: 'mj-interactive-form-panel',\n templateUrl: './interactive-form-panel.component.html',\n})\nexport class InteractiveFormPanelComponent extends BaseContributionPanel implements OnInit, DoCheck, OnDestroy {\n @ViewChild('reactComponent') public ReactComponent?: MJReactComponent;\n\n public componentSpec: ComponentSpec | null = null;\n public HostProps: FormPanelHostProps | null = null;\n\n /**\n * Load-time failure only: missing ComponentID, component not found, bad Specification\n * JSON, wrong role. Shown in place of the React component.\n */\n public loadError: string | null = null;\n\n /**\n * A failure after the React component loaded, shown above it: an `error` event from\n * `<mj-react-component>` (initialization, render timeout, a throw its error boundary\n * caught, or an `error` event the panel raises), or a `Validate` that threw. A throw during\n * render stays inside this panel's subtree, so the rest of the form renders and saves\n * normally.\n *\n * An `error` event stays until the panel is mounted again, and a `Validate` that throws\n * does not replace it. A `Validate` failure clears when a later `Validate` answers.\n */\n public RenderError: string | null = null;\n /** Where {@link RenderError} came from, or null when it is empty. */\n private renderErrorSource: RenderErrorSource | null = null;\n\n private lastValidation: FormPanelValidateResult | null = null;\n private lastEditMode: boolean | null = null;\n private lastExpanded: boolean | null = null;\n /** The record's field values when {@link HostProps} was last built, by field position. */\n private shownValues: unknown[] | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly reactBridge = inject(ReactBridgeService);\n /** The form's field-edit broadcast, which starts the entry-time duplicate check on a new record. */\n private readonly fieldEdits = inject(FormFieldEditCoordinator, { optional: true });\n\n /** Section identity — {@link ContributionSectionKey}, the key the rail files this panel by. */\n public get SectionKey(): string {\n return ContributionSectionKey(this.Contribution);\n }\n\n public get Title(): string {\n return this.Contribution.Title ?? this.Contribution.Metadata.contributionKey ?? this.SectionKey;\n }\n\n public async ngOnInit(): Promise<void> {\n try {\n await this.reactBridge.getReactContext();\n } catch (err) {\n LogError(`InteractiveFormPanelComponent: React bridge bootstrap failed: ${err instanceof Error ? err.message : String(err)}`);\n this.loadError = 'React runtime failed to load. Try a hard refresh.';\n return;\n }\n await this.loadSpec();\n this.RebuildHostProps();\n }\n\n /**\n * Edit mode, expanded state and the parent record's values are not inputs; detect their\n * changes cheaply. A field the user edits elsewhere on the form reaches the panel this way.\n */\n public ngDoCheck(): void {\n const edit = this.FormComponent?.EditMode ?? false;\n const expanded = this.isExpanded();\n if (edit !== this.lastEditMode || expanded !== this.lastExpanded) {\n const modeChanged = this.lastEditMode !== null && edit !== this.lastEditMode;\n this.lastEditMode = edit;\n this.lastExpanded = expanded;\n if (this.HostProps) this.RebuildHostProps();\n if (modeChanged) this.invokeIfRegistered(FormPanelMethodNames.SetEditMode, { mode: edit ? 'edit' : 'view' });\n } else if (this.HostProps && this.recordValuesChanged()) {\n this.RebuildHostProps();\n }\n }\n\n public ngOnDestroy(): void {\n this.HostProps = null;\n this.shownValues = null;\n }\n\n public RebuildHostProps(): void {\n if (!this.Record) { this.HostProps = null; this.shownValues = null; return; }\n this.shownValues = this.Record.Fields.map((f) => f.Value);\n this.HostProps = BuildFormPanelHostProps({\n Record: this.Record,\n FormComponent: this.FormComponent ?? null,\n Contribution: this.Contribution,\n SectionKey: this.SectionKey,\n Layout: this.FormComponent?.ChromeLayout ?? 'accordion',\n IsExpanded: this.isExpanded(),\n });\n this.cdr.markForCheck();\n }\n\n public async OnReactComponentEvent(event: ReactComponentEvent): Promise<void> {\n switch (event.type) {\n case FormPanelEventNames.RowCountChanged: {\n const args = event.payload as FormPanelRowCountChangedArgs;\n if (typeof args?.count === 'number') this.FormComponent?.SetSectionRowCount(this.SectionKey, args.count);\n break;\n }\n case FormPanelEventNames.FieldChanged: {\n const args = event.payload as FormFieldChangedArgs;\n this.applyFieldChange(args?.fieldName, args?.newValue);\n break;\n }\n case FormPanelEventNames.ValidationChanged: {\n const args = event.payload as FormValidationChangedArgs;\n this.lastValidation = { isValid: !!args?.isValid, errors: args?.errors ?? [] };\n break;\n }\n case 'error': {\n const payload = event.payload as { error?: unknown; source?: unknown } | null | undefined;\n const message = `${this.Title} failed: ${payload?.error ? String(payload.error) : 'unknown error'}`;\n // `<mj-react-component>` logs initialization failures and error-boundary catches\n // itself; a render timeout or an error the panel raises is logged here.\n if (payload?.source !== 'initialization' && payload?.source !== 'react') {\n LogError(`InteractiveFormPanelComponent: ${message}`);\n }\n this.setRenderError(message, 'render');\n break;\n }\n }\n }\n\n public OnOpenEntityRecord(event: { entityName: string; key: CompositeKey }): void {\n this.FormComponent?.OnFormNavigate({ Kind: 'record', EntityName: event.entityName, PrimaryKey: event.key });\n }\n\n public override OnRecordRefreshed(record: BaseEntity): void {\n this.Record = record;\n this.RebuildHostProps();\n this.invokeIfRegistered(FormPanelMethodNames.OnRecordRefreshed);\n }\n\n /**\n * Surface the panel's validity to the parent form's save.\n *\n * The React method may be `async` — any validator that checks something\n * server-side will be — and `invokeMethod` returns whatever the method\n * returned. Awaiting is therefore load-bearing: a synchronous `'isValid' in\n * live` test sees a Promise, fails, silently falls back to the last cached\n * `ValidationChanged` payload, and the form saves an invalid record with no\n * error and no log. Resolving a non-Promise is a no-op, so one code path\n * covers both shapes.\n *\n * A validator that throws or rejects does not block the save by itself. It is logged and\n * shown in the panel ({@link RenderError}) unless the panel already shows an `error` event,\n * and the result falls back to the last `ValidationChanged` state, so a failure the panel\n * reported before still blocks.\n */\n public override async Validate(): Promise<ValidationResult> {\n let live: FormPanelValidateResult | undefined;\n if (this.ReactComponent?.hasMethod?.(FormPanelMethodNames.Validate)) {\n try {\n const returned = this.ReactComponent.invokeMethod(FormPanelMethodNames.Validate) as\n FormPanelValidateResult | Promise<FormPanelValidateResult> | undefined;\n live = await Promise.resolve(returned);\n if (this.renderErrorSource === 'validate') this.setRenderError(null);\n } catch (err) {\n LogError(`InteractiveFormPanelComponent.Validate: panel validator threw: ${err instanceof Error ? err.message : String(err)}`);\n if (this.renderErrorSource !== 'render') {\n this.setRenderError(`${this.Title} could not check its values.`, 'validate');\n }\n }\n }\n const state = live && typeof live === 'object' && 'isValid' in live ? live : this.lastValidation;\n return this.toValidationResult(state);\n }\n\n /** The last state the panel reported through `ValidationChanged`; valid when it has reported none. */\n public override LastKnownValidation(): ValidationResult {\n return this.toValidationResult(this.lastValidation);\n }\n\n private toValidationResult(state: FormPanelValidateResult | null): ValidationResult {\n const result = new ValidationResult();\n result.Success = state ? state.isValid : true;\n result.Errors = (state?.errors ?? []).map((message) => new ValidationErrorInfo(this.SectionKey, message, null));\n return result;\n }\n\n private setRenderError(message: string | null, source: RenderErrorSource | null = null): void {\n this.renderErrorSource = message ? source : null;\n if (this.RenderError === message) return;\n this.RenderError = message;\n this.cdr.markForCheck();\n }\n\n private isExpanded(): boolean {\n return this.FormComponent?.IsSectionExpanded(this.SectionKey, !this.IsRelatedClaim) ?? true;\n }\n\n /** True when a field of the record no longer holds the value {@link HostProps} was built from. */\n private recordValuesChanged(): boolean {\n const shown = this.shownValues;\n const fields = this.Record?.Fields;\n if (!shown || !fields) return false;\n if (fields.length !== shown.length) return true;\n for (let i = 0; i < fields.length; i++) {\n if (!Object.is(fields[i].Value, shown[i])) return true;\n }\n return false;\n }\n\n /**\n * Writes a panel's `FieldChanged` to the parent record: only a field the contribution claims\n * (`replacesFieldNames`), and only while the form is in edit mode. Anything else is ignored\n * and logged, so a panel cannot change a field the user did not hand it or edit a record the\n * user is only viewing.\n *\n * A write the record refuses (a disabled or unreadable field) is logged and dropped. A write\n * that succeeds is reported to {@link FormFieldEditCoordinator}, as an edit in\n * `mj-form-field` is. Field validation and the `ValueChange` output of `mj-form-field` do not\n * apply, because a claimed field is not drawn.\n */\n private applyFieldChange(fieldName: string | undefined, value: unknown): void {\n if (!fieldName || !this.Record) return;\n const wanted = fieldName.trim().toLowerCase();\n const entityName = this.Record.EntityInfo.Name;\n if (!this.FormComponent?.EditMode) {\n LogError(`InteractiveFormPanelComponent: \"${fieldName}\" on ${entityName} changed while the form is not in edit mode; change ignored.`);\n return;\n }\n const claimed = (this.Contribution.Metadata.replacesFieldNames ?? []).some((name) => name.trim().toLowerCase() === wanted);\n if (!claimed) {\n LogError(`InteractiveFormPanelComponent: \"${fieldName}\" on ${entityName} is not a field this panel claims; change ignored.`);\n return;\n }\n const field = this.Record.Fields.find((f) => f.Name.trim().toLowerCase() === wanted);\n if (!field) {\n LogError(`InteractiveFormPanelComponent: unknown field \"${fieldName}\" on ${entityName}; change ignored.`);\n return;\n }\n try {\n // Dynamic field name from the React side — the same sanctioned Set() path the whole-form host uses.\n this.Record.Set(field.Name, value);\n } catch (err) {\n LogError(`InteractiveFormPanelComponent: could not set \"${field.Name}\" on ${entityName}: ${err instanceof Error ? err.message : String(err)}`);\n return;\n }\n this.fieldEdits?.Notify({ FieldName: field.Name });\n }\n\n private invokeIfRegistered<T = unknown>(method: string, ...args: unknown[]): T | undefined {\n if (!this.ReactComponent?.hasMethod?.(method)) return undefined;\n try {\n return this.ReactComponent.invokeMethod(method, ...args) as T;\n } catch (err) {\n LogError(`InteractiveFormPanelComponent.${method}: ${err instanceof Error ? err.message : String(err)}`);\n return undefined;\n }\n }\n\n private async loadSpec(): Promise<void> {\n const supplied = this.Contribution?.ComponentSpec;\n if (supplied) {\n this.componentSpec = IsFormPanelRole(supplied) ? supplied : null;\n if (!this.componentSpec) this.loadError = `Component ${supplied.name} does not declare componentRole='form-panel'.`;\n this.cdr.markForCheck();\n return;\n }\n const id = this.Contribution?.ComponentID;\n if (!id) { this.loadError = 'Contribution has no ComponentID.'; return; }\n const provider = this.FormComponent?.ProviderToUse;\n try {\n if (provider) await InteractiveFormsEngine.Instance.Config(false, provider.CurrentUser, provider);\n } catch (err) {\n LogError(`InteractiveFormPanelComponent: engine Config failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n // A panel's Widget component is not in the engine's loaded forms; the engine fetches it\n // by ID once and serves every later mount of it from memory.\n const component = await InteractiveFormsEngine.Instance.GetComponentByID(id, provider?.CurrentUser, provider);\n if (!component) { this.loadError = `Component ${id} not found.`; return; }\n try {\n this.componentSpec = JSON.parse(component.Specification ?? 'null') as ComponentSpec;\n } catch (err) {\n this.loadError = `Component ${component.Name} has invalid Specification JSON: ${err instanceof Error ? err.message : String(err)}`;\n return;\n }\n if (!this.componentSpec) { this.loadError = `Component ${component.Name} has an empty Specification.`; return; }\n if (!IsFormPanelRole(this.componentSpec)) {\n this.loadError = `Component ${component.Name} does not declare componentRole='form-panel'.`;\n this.componentSpec = null;\n }\n this.cdr.markForCheck();\n }\n}\n","@if (Contribution) {\n @if (IsBare) {\n <!-- A bare strip's own flex item: it carries the order a panel's chrome would, and the tab\n key the rail reads when the strip replaces blocks. -->\n <div class=\"mj-form-bare-panel\" style=\"display: block\"\n [style.order]=\"DisplayOrder\"\n [attr.data-bare-section-key]=\"BareTabKey\"\n [attr.data-bare-title]=\"Title\">\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </div>\n } @else {\n <mj-collapsible-panel\n [SectionKey]=\"SectionKey\"\n [Order]=\"DisplayOrder\"\n [SectionName]=\"Title\"\n [Icon]=\"Icon\"\n [Variant]=\"Variant\"\n [Form]=\"FormComponent\"\n [FormContext]=\"FormContext\"\n [DefaultExpanded]=\"!IsRelatedClaim\">\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </mj-collapsible-panel>\n }\n}\n\n<ng-template #body>\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && HostProps) {\n @if (RenderError) {\n <mj-alert Variant=\"error\">{{ RenderError }}</mj-alert>\n }\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"HostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading panel…</span>\n </div>\n }\n</ng-template>\n"]}
@@ -70,6 +70,8 @@ export declare class InteractiveFormComponent extends BaseFormComponent implemen
70
70
  set previewMode(value: InteractiveFormComponent['PreviewMode']);
71
71
  /** @deprecated Use {@link PreviewMode}. */
72
72
  get previewMode(): InteractiveFormComponent['PreviewMode'];
73
+ /** A full custom entity form replaces the whole form body. */
74
+ get OwnsEntireFormBody(): boolean;
73
75
  /** FormHostProps passed to the React component. Recomputed when record or mode changes. */
74
76
  FormHostProps: FormHostProps | null;
75
77
  /** @deprecated Use {@link FormHostProps}. */
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-form.component.d.ts","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,EAAS,SAAS,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EACH,aAAa,EAOhB,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAsB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;AAE3D;;;;;;;;;;;;;;GAcG;AACH,qBAKa,wBAAyB,SAAQ,iBAAkB,YAAW,MAAM,EAAE,SAAS;IAExF;;;;;;;;;OASG;IACH,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,kBAAkB,CAAS;IAEnC,IACoB,MAAM,CAAC,KAAK,EAAE,UAAU,EAQ3C;IACD,IAAoB,MAAM,IAAI,UAAU,CAAyB;IAEjE;;;;OAIG;IACa,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAElD;;;;;;;;;;OAUG;IACa,aAAa,EAAE,aAAa,GAAG,IAAI,CAAQ;IAE3D;;;;;;;;;;;OAWG;IACa,WAAW,UAAS;IAEpC,2CAA2C;IAC3C,IAAoB,WAAW,CAAC,KAAK,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAE7E;IACD,2CAA2C;IAC3C,IAAW,WAAW,IAAI,wBAAwB,CAAC,aAAa,CAAC,CAEhE;IAED,2FAA2F;IACpF,aAAa,EAAE,aAAa,GAAG,IAAI,CAAQ;IAElD,6CAA6C;IAC7C,IAAW,aAAa,IAAI,aAAa,GAAG,IAAI,CAE/C;IACD,6CAA6C;IAC7C,IAAW,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,I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ACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,iBAAiB;yCAnehB,wBAAwB;2CAAxB,wBAAwB;CA0epC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAMnD"}
1
+ {"version":3,"file":"interactive-form.component.d.ts","sourceRoot":"","sources":["../../../src/lib/interactive-form/interactive-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,EAAS,SAAS,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EACH,aAAa,EAOhB,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAsB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;AAE3D;;;;;;;;;;;;;;GAcG;AACH,qBAKa,wBAAyB,SAAQ,iBAAkB,YAAW,MAAM,EAAE,SAAS;IAExF;;;;;;;;;OASG;IACH,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,kBAAkB,CAAS;IAEnC,IACoB,MAAM,CAAC,KAAK,EAAE,UAAU,EAQ3C;IACD,IAAoB,MAAM,IAAI,UAAU,CAAyB;IAEjE;;;;OAIG;IACa,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAElD;;;;;;;;;;OAUG;IACa,aAAa,EAAE,aAAa,GAAG,IAAI,CAAQ;IAE3D;;;;;;;;;;;OAWG;IACa,WAAW,UAAS;IAEpC,2CAA2C;IAC3C,IAAoB,WAAW,CAAC,KAAK,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAE7E;IACD,2CAA2C;IAC3C,IAAW,WAAW,IAAI,wBAAwB,CAAC,aAAa,CAAC,CAEhE;IAED,8DAA8D;IAC9D,IAAoB,kBAAkB,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IAAI;IAKnC;;;;;;;;;;;;;OAaG;IACmB,UAAU,CAAC,qBAAqB,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBlF;;;;;;;;OAQG;IACa,UAAU,IAAI,IAAI;IAiBlC;;;;;;;;;;;OAWG;YACW,iBAAiB;IAoE/B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,iBAAiB;yCAtehB,wBAAwB;2CAAxB,wBAAwB;CA6epC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAMnD"}
@@ -6,9 +6,6 @@ import { SimpleEntityFieldInfo } from '@memberjunction/interactive-component-typ
6
6
  import { ReactBridgeService } from '@memberjunction/ng-react';
7
7
  import { BaseFormComponent } from '../base-form-component';
8
8
  import * as i0 from "@angular/core";
9
- import * as i1 from "@memberjunction/ng-ui-components";
10
- import * as i2 from "@memberjunction/ng-react";
11
- import * as i3 from "../container/record-form-container.component";
12
9
  const _c0 = ["reactComponent"];
13
10
  function InteractiveFormComponent_Conditional_0_Conditional_0_Conditional_0_Template(rf, ctx) { if (rf & 1) {
14
11
  i0.ɵɵelementStart(0, "mj-alert", 2);
@@ -162,6 +159,8 @@ export class InteractiveFormComponent extends BaseFormComponent {
162
159
  get previewMode() {
163
160
  return this.PreviewMode;
164
161
  }
162
+ /** A full custom entity form replaces the whole form body. */
163
+ get OwnsEntireFormBody() { return true; }
165
164
  /** FormHostProps passed to the React component. Recomputed when record or mode changes. */
166
165
  FormHostProps = null;
167
166
  /** @deprecated Use {@link FormHostProps}. */
@@ -567,11 +566,11 @@ export class InteractiveFormComponent extends BaseFormComponent {
567
566
  i0.ɵɵconditionalCreate(0, InteractiveFormComponent_Conditional_0_Template, 2, 1);
568
567
  } if (rf & 2) {
569
568
  i0.ɵɵconditional(ctx.record ? 0 : -1);
570
- } }, dependencies: [i1.MJAlertComponent, i2.MJReactComponent, i3.MjRecordFormContainerComponent], encapsulation: 2 });
569
+ } }, encapsulation: 2 });
571
570
  }
572
571
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InteractiveFormComponent, [{
573
572
  type: Component,
574
- args: [{ standalone: false, selector: 'mj-interactive-form', template: "@if (record) {\n@if (previewMode) {\n <!-- Preview mode \u2014 no toolbar wrap. Just the form body for clean\n \"what the form looks like\" previews (Form Builder cockpit). -->\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form\u2026</span>\n </div>\n }\n} @else {\n<mj-record-form-container\n [Record]=\"record\"\n [FormComponent]=\"this\"\n (Navigate)=\"OnFormNavigate($event)\"\n (DeleteRequested)=\"OnDeleteRequested()\"\n (FavoriteToggled)=\"OnFavoriteToggled()\"\n (HistoryRequested)=\"OnHistoryRequested()\"\n (ListManagementRequested)=\"OnListManagementRequested()\">\n\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form\u2026</span>\n </div>\n }\n\n</mj-record-form-container>\n}\n}\n" }]
573
+ args: [{ standalone: false, selector: 'mj-interactive-form', template: "@if (record) {\n@if (previewMode) {\n <!-- Preview mode \u2014 no toolbar wrap. Just the form body for clean\n \"what the form looks like\" previews (Form Builder cockpit). -->\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form\u2026</span>\n </div>\n }\n} @else {\n<mj-record-form-container\n [Record]=\"record\"\n [FormComponent]=\"this\"\n (Navigate)=\"OnFormNavigate($event)\"\n (DeleteRequested)=\"OnDeleteRequested()\"\n (FavoriteToggled)=\"OnFavoriteToggled()\"\n (HistoryRequested)=\"OnHistoryRequested()\"\n (ListManagementRequested)=\"OnListManagementRequested()\">\n\n <!-- No panel slots: a full custom entity form owns its whole body, so the container\n supplies the toolbar only \u2014 no panels and no stock related grids. -->\n\n @if (loadError) {\n <mj-alert Variant=\"error\">{{ loadError }}</mj-alert>\n } @else if (componentSpec && formHostProps) {\n <mj-react-component\n #reactComponent\n [component]=\"componentSpec\"\n [componentProps]=\"formHostProps\"\n (componentEvent)=\"OnReactComponentEvent($event)\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n } @else {\n <div class=\"mj-loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading form\u2026</span>\n </div>\n }\n\n</mj-record-form-container>\n}\n}\n" }]
575
574
  }], null, { record: [{
576
575
  type: Input
577
576
  }], ComponentID: [{