@memberjunction/ng-base-forms 6.2.0-edge.0 → 6.2.0-edge.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/base-form-section-info.js +5 -5
- package/dist/lib/base-form-section-info.js.map +1 -1
- package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/resolve-form-chrome.js +22 -12
- package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +20 -12
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +129 -113
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts +18 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.js +38 -10
- package/dist/lib/explorer-entity-data-grid.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +37 -5
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +106 -20
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/form-state.service.d.ts +58 -0
- package/dist/lib/form-state.service.d.ts.map +1 -1
- package/dist/lib/form-state.service.js +156 -40
- package/dist/lib/form-state.service.js.map +1 -1
- package/dist/lib/host/entity-form-host.component.d.ts +10 -2
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
- package/dist/lib/host/entity-form-host.component.js +24 -8
- package/dist/lib/host/entity-form-host.component.js.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.d.ts +16 -4
- package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.js +38 -12
- package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-card.component.d.ts +3 -3
- package/dist/lib/isa-related-panel/isa-related-card.component.js +6 -6
- package/dist/lib/isa-related-panel/isa-related-card.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts +3 -3
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +8 -8
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
- package/dist/lib/overlays/form-slide-in.component.d.ts +2 -0
- package/dist/lib/overlays/form-slide-in.component.d.ts.map +1 -1
- package/dist/lib/overlays/form-slide-in.component.js +5 -1
- package/dist/lib/overlays/form-slide-in.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +9 -9
- package/dist/lib/panel/collapsible-panel.component.js +23 -23
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.d.ts +2 -0
- package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.js +5 -1
- package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
- package/dist/lib/panel-slot/form-contribution.d.ts +12 -0
- package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-contribution.js +43 -10
- package/dist/lib/panel-slot/form-contribution.js.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +10 -0
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.js +25 -5
- package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js +5 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
- package/dist/lib/section-loader-component.d.ts +5 -1
- package/dist/lib/section-loader-component.d.ts.map +1 -1
- package/dist/lib/section-loader-component.js +13 -5
- package/dist/lib/section-loader-component.js.map +1 -1
- package/dist/lib/section-manager/section-manager.component.d.ts +2 -2
- package/dist/lib/section-manager/section-manager.component.js +6 -6
- package/dist/lib/section-manager/section-manager.component.js.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.d.ts +5 -5
- package/dist/lib/toolbar/form-toolbar.component.js +22 -22
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/lib/types/form-types.d.ts +2 -0
- package/dist/lib/types/form-types.d.ts.map +1 -1
- package/dist/lib/types/form-types.js +5 -1
- package/dist/lib/types/form-types.js.map +1 -1
- package/package.json +18 -18
|
@@ -713,43 +713,47 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
713
713
|
Panels;
|
|
714
714
|
// ---- FormComponent accessor ----
|
|
715
715
|
/** Typed accessor for the form component reference */
|
|
716
|
-
get
|
|
716
|
+
get Fc() {
|
|
717
717
|
return this.FormComponent;
|
|
718
718
|
}
|
|
719
|
+
/** @deprecated Use {@link Fc}. */
|
|
720
|
+
get fc() {
|
|
721
|
+
return this.Fc;
|
|
722
|
+
}
|
|
719
723
|
// ---- Effective state (bridges FormComponent → toolbar inputs) ----
|
|
720
724
|
get EffectiveRecord() {
|
|
721
|
-
return this.
|
|
725
|
+
return this.Fc?.record ?? this.Record;
|
|
722
726
|
}
|
|
723
727
|
get EffectiveEditMode() {
|
|
724
|
-
return this.
|
|
728
|
+
return this.Fc?.EditMode ?? this.EditMode;
|
|
725
729
|
}
|
|
726
730
|
get EffectiveUserCanEdit() {
|
|
727
|
-
return this.
|
|
731
|
+
return this.Fc?.UserCanEdit ?? this.UserCanEdit;
|
|
728
732
|
}
|
|
729
733
|
get EffectiveUserCanDelete() {
|
|
730
|
-
return this.
|
|
734
|
+
return this.Fc?.UserCanDelete ?? this.UserCanDelete;
|
|
731
735
|
}
|
|
732
736
|
get EffectiveIsFavorite() {
|
|
733
|
-
return this.
|
|
737
|
+
return this.Fc?.IsFavorite ?? this.IsFavorite;
|
|
734
738
|
}
|
|
735
739
|
get EffectiveFavoriteInitDone() {
|
|
736
|
-
return this.
|
|
740
|
+
return this.Fc?.FavoriteInitDone ?? this.FavoriteInitDone;
|
|
737
741
|
}
|
|
738
742
|
get EffectiveEntityInfo() {
|
|
739
|
-
return this.
|
|
743
|
+
return this.Fc?.EntityInfo ?? this.EntityInfo;
|
|
740
744
|
}
|
|
741
745
|
get EffectiveIsDirty() {
|
|
742
|
-
if (this.
|
|
746
|
+
if (this.Fc) {
|
|
743
747
|
// OR'd with the form's own extra state: a section that owns an editor (a flow canvas, a
|
|
744
748
|
// designer) holds edits no entity field reflects, and reporting the record clean would let
|
|
745
749
|
// the navigate-away guard discard them without asking.
|
|
746
|
-
return (this.
|
|
750
|
+
return (this.Fc.record?.Dirty ?? false) || this.Fc.HasAdditionalUnsavedChanges;
|
|
747
751
|
}
|
|
748
752
|
return this.IsDirty;
|
|
749
753
|
}
|
|
750
754
|
get EffectiveDirtyFieldNames() {
|
|
751
|
-
if (this.
|
|
752
|
-
return this.
|
|
755
|
+
if (this.Fc?.record?.Fields) {
|
|
756
|
+
return this.Fc.record.Fields.filter(f => f.Dirty).map(f => f.Name);
|
|
753
757
|
}
|
|
754
758
|
return this.DirtyFieldNames;
|
|
755
759
|
}
|
|
@@ -757,11 +761,11 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
757
761
|
return this.IsSaving;
|
|
758
762
|
}
|
|
759
763
|
get EffectiveIsRefreshing() {
|
|
760
|
-
return this.
|
|
764
|
+
return this.Fc?.IsRefreshing ?? this.IsRefreshing;
|
|
761
765
|
}
|
|
762
766
|
get EffectiveWidthMode() {
|
|
763
|
-
if (this.
|
|
764
|
-
return this.
|
|
767
|
+
if (this.Fc?.getFormWidthMode) {
|
|
768
|
+
return this.Fc.getFormWidthMode();
|
|
765
769
|
}
|
|
766
770
|
return this.WidthMode;
|
|
767
771
|
}
|
|
@@ -772,7 +776,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
772
776
|
* Any other value (undefined or a partial config) keeps the toolbar.
|
|
773
777
|
*/
|
|
774
778
|
get EffectiveShowToolbar() {
|
|
775
|
-
return ResolveFormShowToolbar(this.
|
|
779
|
+
return ResolveFormShowToolbar(this.Fc?.Config);
|
|
776
780
|
}
|
|
777
781
|
/**
|
|
778
782
|
* Effective toolbar config: the bound `ToolbarConfig` (or the default)
|
|
@@ -781,36 +785,36 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
781
785
|
* yet per-instance toolbar tweaks still take effect through `fc.Config`.
|
|
782
786
|
*/
|
|
783
787
|
get EffectiveToolbarConfig() {
|
|
784
|
-
return ResolveFormToolbarConfig(this.ToolbarConfig ?? DEFAULT_TOOLBAR_CONFIG, this.
|
|
788
|
+
return ResolveFormToolbarConfig(this.ToolbarConfig ?? DEFAULT_TOOLBAR_CONFIG, this.Fc?.Config);
|
|
785
789
|
}
|
|
786
790
|
get EffectiveRegisteredToolbarItems() {
|
|
787
|
-
if (this.
|
|
788
|
-
return this.
|
|
791
|
+
if (this.Fc?.RegisteredToolbarItems && this.Fc.RegisteredToolbarItems.length > 0) {
|
|
792
|
+
return this.Fc.RegisteredToolbarItems;
|
|
789
793
|
}
|
|
790
794
|
return this.RegisteredToolbarItems;
|
|
791
795
|
}
|
|
792
796
|
get EffectiveToolbarItemOverrides() {
|
|
793
|
-
if (this.
|
|
794
|
-
return this.
|
|
797
|
+
if (this.Fc?.ToolbarItemOverrides && this.Fc.ToolbarItemOverrides.size > 0) {
|
|
798
|
+
return this.Fc.ToolbarItemOverrides;
|
|
795
799
|
}
|
|
796
800
|
return this.ToolbarItemOverrides;
|
|
797
801
|
}
|
|
798
802
|
get EffectiveSearchFilter() {
|
|
799
|
-
return this.
|
|
803
|
+
return this.Fc?.searchFilter ?? '';
|
|
800
804
|
}
|
|
801
805
|
get EffectiveShowEmptyFields() {
|
|
802
|
-
return this.
|
|
806
|
+
return this.Fc?.showEmptyFields ?? false;
|
|
803
807
|
}
|
|
804
808
|
get EffectiveHasCustomSectionOrder() {
|
|
805
|
-
if (this.
|
|
806
|
-
return this.
|
|
809
|
+
if (this.Fc?.hasCustomSectionOrder) {
|
|
810
|
+
return this.Fc.hasCustomSectionOrder();
|
|
807
811
|
}
|
|
808
812
|
return false;
|
|
809
813
|
}
|
|
810
814
|
// ---- Section counts ----
|
|
811
815
|
get TotalSectionCount() {
|
|
812
|
-
if (this.
|
|
813
|
-
return this.
|
|
816
|
+
if (this.Fc?.getTotalSectionCount) {
|
|
817
|
+
return this.Fc.getTotalSectionCount();
|
|
814
818
|
}
|
|
815
819
|
return this.Panels?.length ?? 0;
|
|
816
820
|
}
|
|
@@ -821,8 +825,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
821
825
|
const fromRail = this.ChromeFirstClassGroups.length + this.ChromeMoreItems.length;
|
|
822
826
|
return Math.max(fromPanels, fromRail);
|
|
823
827
|
}
|
|
824
|
-
if (this.
|
|
825
|
-
return this.
|
|
828
|
+
if (this.Fc?.getVisibleSectionCount) {
|
|
829
|
+
return this.Fc.getVisibleSectionCount();
|
|
826
830
|
}
|
|
827
831
|
return this.Panels?.filter((p) => p.IsVisible).length ?? 0;
|
|
828
832
|
}
|
|
@@ -856,7 +860,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
856
860
|
.map((panel) => panel.SectionKey);
|
|
857
861
|
}
|
|
858
862
|
get EffectiveShowRelatedEntities() {
|
|
859
|
-
return this.
|
|
863
|
+
return this.Fc?.Config?.ShowRelatedEntities !== false;
|
|
860
864
|
}
|
|
861
865
|
get ChromeLayout() {
|
|
862
866
|
return this.chrome.Spec.Layout;
|
|
@@ -923,7 +927,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
923
927
|
return this.chrome.IsMoreActive;
|
|
924
928
|
}
|
|
925
929
|
get ChromeReorderAllowed() {
|
|
926
|
-
return this.
|
|
930
|
+
return this.Fc?.formContext?.allowSectionReorder !== false;
|
|
927
931
|
}
|
|
928
932
|
get ShowMoreToggle() {
|
|
929
933
|
return this.chrome.Spec.Layout === 'accordion' && this.ChromeMoreItems.length > 0;
|
|
@@ -935,8 +939,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
935
939
|
return this.ChromeMoreItems.map((item) => item.Title).join(' · ');
|
|
936
940
|
}
|
|
937
941
|
get ExpandedSectionCount() {
|
|
938
|
-
if (this.
|
|
939
|
-
return this.
|
|
942
|
+
if (this.Fc?.getExpandedCount) {
|
|
943
|
+
return this.Fc.getExpandedCount();
|
|
940
944
|
}
|
|
941
945
|
if (!this.Panels)
|
|
942
946
|
return 0;
|
|
@@ -984,8 +988,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
984
988
|
}
|
|
985
989
|
/** Current section order from the form component */
|
|
986
990
|
get SectionManagerOrder() {
|
|
987
|
-
if (this.
|
|
988
|
-
return this.
|
|
991
|
+
if (this.Fc?.getSectionOrder) {
|
|
992
|
+
return this.Fc.getSectionOrder();
|
|
989
993
|
}
|
|
990
994
|
return [];
|
|
991
995
|
}
|
|
@@ -1005,10 +1009,10 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1005
1009
|
if (savedWidth)
|
|
1006
1010
|
this.TagsPanelWidth = parseInt(savedWidth, 10) || 0;
|
|
1007
1011
|
// Subscribe to panel Navigate events and relay them
|
|
1008
|
-
this.
|
|
1012
|
+
this.subscribeToPanelNavigateEvents();
|
|
1009
1013
|
// Watch for panel changes to update counts and re-subscribe
|
|
1010
1014
|
this.Panels.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
1011
|
-
this.
|
|
1015
|
+
this.subscribeToPanelNavigateEvents();
|
|
1012
1016
|
this.scheduleChromeResolve();
|
|
1013
1017
|
this.cdr.markForCheck();
|
|
1014
1018
|
});
|
|
@@ -1023,7 +1027,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1023
1027
|
this.sectionIndicators.Changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
1024
1028
|
this.cdr.markForCheck();
|
|
1025
1029
|
});
|
|
1026
|
-
this.
|
|
1030
|
+
this.restoreChromePrefs();
|
|
1027
1031
|
this.scheduleChromeResolve();
|
|
1028
1032
|
// Watch for changes to record dirty state
|
|
1029
1033
|
this.watchRecordChanges();
|
|
@@ -1068,7 +1072,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1068
1072
|
}
|
|
1069
1073
|
OnMoreFolderToggle() {
|
|
1070
1074
|
this.chrome.ToggleMoreFolder();
|
|
1071
|
-
this.
|
|
1075
|
+
this.persistChromePrefs();
|
|
1072
1076
|
this.cdr.detectChanges();
|
|
1073
1077
|
}
|
|
1074
1078
|
// ---- Section indicators on the rail ----
|
|
@@ -1099,7 +1103,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1099
1103
|
return TallyValidationErrors(this.unroutedValidationErrors()).ErrorCount;
|
|
1100
1104
|
}
|
|
1101
1105
|
unroutedValidationErrors() {
|
|
1102
|
-
const ctx = this.
|
|
1106
|
+
const ctx = this.Fc?.formContext;
|
|
1103
1107
|
if (!ctx?.showValidation || !ctx.validationErrors?.length)
|
|
1104
1108
|
return [];
|
|
1105
1109
|
// Only a section with a rail item may claim: a registered section the chrome dropped
|
|
@@ -1143,12 +1147,12 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1143
1147
|
return DescribeSectionWarnings(count, where);
|
|
1144
1148
|
}
|
|
1145
1149
|
ChromeGroupRowCount(group) {
|
|
1146
|
-
if (!this.
|
|
1150
|
+
if (!this.Fc?.GetSectionRowCount)
|
|
1147
1151
|
return undefined;
|
|
1148
1152
|
let total = 0;
|
|
1149
1153
|
let any = false;
|
|
1150
1154
|
for (const key of group.SectionKeys) {
|
|
1151
|
-
const count = this.
|
|
1155
|
+
const count = this.Fc.GetSectionRowCount(key);
|
|
1152
1156
|
if (count !== undefined) {
|
|
1153
1157
|
total += count;
|
|
1154
1158
|
any = true;
|
|
@@ -1168,7 +1172,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1168
1172
|
if (!this.ChromeRailPinned && previous !== groupKey) {
|
|
1169
1173
|
this.chromeRailExpanded = false;
|
|
1170
1174
|
}
|
|
1171
|
-
this.
|
|
1175
|
+
this.persistChromePrefs();
|
|
1172
1176
|
this.AfterSectionActivated.emit(new AfterSectionActivatedEventArgs(groupKey));
|
|
1173
1177
|
this.cdr.detectChanges();
|
|
1174
1178
|
}
|
|
@@ -1185,7 +1189,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1185
1189
|
if (this.ChromeRailPinned) {
|
|
1186
1190
|
this.chromeRailExpanded = true;
|
|
1187
1191
|
}
|
|
1188
|
-
this.
|
|
1192
|
+
this.persistChromePrefs();
|
|
1189
1193
|
this.cdr.detectChanges();
|
|
1190
1194
|
}
|
|
1191
1195
|
OnRailResizeStart(event) {
|
|
@@ -1210,7 +1214,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1210
1214
|
if (!this.RailResizing)
|
|
1211
1215
|
return;
|
|
1212
1216
|
this.RailResizing = false;
|
|
1213
|
-
this.
|
|
1217
|
+
this.persistChromePrefs();
|
|
1214
1218
|
this.cdr.detectChanges();
|
|
1215
1219
|
}
|
|
1216
1220
|
OnRailLabelHover(event, text) {
|
|
@@ -1272,8 +1276,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1272
1276
|
];
|
|
1273
1277
|
const current = OverlayChromeSectionOrder(defaultKeys, this.EffectiveHasCustomSectionOrder ? this.SectionManagerOrder : []);
|
|
1274
1278
|
const next = MoveChromeGroupInSectionOrder(current, dragged, target);
|
|
1275
|
-
if (this.
|
|
1276
|
-
this.
|
|
1279
|
+
if (this.Fc?.setSectionOrder) {
|
|
1280
|
+
this.Fc.setSectionOrder(next);
|
|
1277
1281
|
this.cdr.detectChanges();
|
|
1278
1282
|
}
|
|
1279
1283
|
}
|
|
@@ -1285,7 +1289,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1285
1289
|
return;
|
|
1286
1290
|
this.chrome.ToggleMore(next);
|
|
1287
1291
|
this.applyChromeVisibility();
|
|
1288
|
-
this.
|
|
1292
|
+
this.persistChromePrefs();
|
|
1289
1293
|
this.AfterSectionActivated.emit(new AfterSectionActivatedEventArgs(MORE_SECTION_KEY));
|
|
1290
1294
|
this.cdr.detectChanges();
|
|
1291
1295
|
}
|
|
@@ -1295,7 +1299,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1295
1299
|
}
|
|
1296
1300
|
this.chromeResolveTimer = setTimeout(() => {
|
|
1297
1301
|
this.chromeResolveTimer = null;
|
|
1298
|
-
this.
|
|
1302
|
+
this.resolveChrome();
|
|
1299
1303
|
this.applyChromeVisibility();
|
|
1300
1304
|
this.cdr.markForCheck();
|
|
1301
1305
|
}, 0);
|
|
@@ -1314,7 +1318,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1314
1318
|
this.chromeRules = rules;
|
|
1315
1319
|
this.scheduleChromeResolve();
|
|
1316
1320
|
}
|
|
1317
|
-
|
|
1321
|
+
resolveChrome() {
|
|
1318
1322
|
const entity = this.EffectiveEntityInfo;
|
|
1319
1323
|
if (!entity)
|
|
1320
1324
|
return;
|
|
@@ -1332,8 +1336,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1332
1336
|
ChromeRules: this.chromeRules,
|
|
1333
1337
|
IncludeUnbakedRelated: this.EffectiveShowRelatedEntities,
|
|
1334
1338
|
Membership: {
|
|
1335
|
-
moreSectionKeys: this.
|
|
1336
|
-
firstClassSectionKeys: this.
|
|
1339
|
+
moreSectionKeys: this.Fc?.getMoreSectionKeys?.() ?? [],
|
|
1340
|
+
firstClassSectionKeys: this.Fc?.getFirstClassSectionKeys?.() ?? [],
|
|
1337
1341
|
},
|
|
1338
1342
|
});
|
|
1339
1343
|
const before = new BeforeLayoutResolveEventArgs(result.Spec.Layout);
|
|
@@ -1352,7 +1356,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1352
1356
|
return;
|
|
1353
1357
|
const group = this.chrome.Spec.Groups.find((g) => g.Key === groupKey);
|
|
1354
1358
|
const keys = group && !group.IsMore ? group.SectionKeys : [groupKey];
|
|
1355
|
-
const form = this.
|
|
1359
|
+
const form = this.Fc;
|
|
1356
1360
|
if (!form?.SetSectionExpanded)
|
|
1357
1361
|
return;
|
|
1358
1362
|
for (const key of keys) {
|
|
@@ -1580,7 +1584,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1580
1584
|
}
|
|
1581
1585
|
chromePanelSnapshots() {
|
|
1582
1586
|
const skip = this.contributionHiddenSectionKeys();
|
|
1583
|
-
const ctx = this.
|
|
1587
|
+
const ctx = this.Fc?.formContext;
|
|
1584
1588
|
const byKey = new Map();
|
|
1585
1589
|
const add = (snapshot) => {
|
|
1586
1590
|
if (!snapshot.SectionKey || skip.has(snapshot.SectionKey))
|
|
@@ -1669,10 +1673,10 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1669
1673
|
return `mj.formChrome.${name}.${suffix}`;
|
|
1670
1674
|
}
|
|
1671
1675
|
/** Delegates to the pure decision in `form-chrome-rail-pref`, supplying this form's registrations. */
|
|
1672
|
-
|
|
1676
|
+
unsavedLeadGroupKey() {
|
|
1673
1677
|
return UnsavedLeadGroupKey(this.EffectiveEntityInfo?.Name, CollectFormPanelRegistrations(), contributionRailKey);
|
|
1674
1678
|
}
|
|
1675
|
-
|
|
1679
|
+
restoreChromePrefs() {
|
|
1676
1680
|
if (ShouldPersistChromeActiveGroup(this.EffectiveRecord?.IsSaved)) {
|
|
1677
1681
|
const group = UserInfoEngine.Instance.GetSetting(this.chromePrefKey('activeGroup'));
|
|
1678
1682
|
if (group)
|
|
@@ -1682,7 +1686,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1682
1686
|
// A new record has no stored position to restore, so without this it opens on the lead
|
|
1683
1687
|
// group -- which is usually a summary, and a summary of a record with no data is a page of
|
|
1684
1688
|
// blanks. A contribution can opt out of that by declaring `leadsWhenUnsaved`.
|
|
1685
|
-
const lead = this.
|
|
1689
|
+
const lead = this.unsavedLeadGroupKey();
|
|
1686
1690
|
if (lead)
|
|
1687
1691
|
this.chrome.ActiveGroupKey = lead;
|
|
1688
1692
|
}
|
|
@@ -1695,7 +1699,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1695
1699
|
this.ChromeRailWidthPx = ParseRailWidthSetting(UserInfoEngine.Instance.GetSetting(this.chromePrefKey('railWidth')));
|
|
1696
1700
|
this.chromeRailExpanded = this.ChromeRailPinned;
|
|
1697
1701
|
}
|
|
1698
|
-
|
|
1702
|
+
persistChromePrefs() {
|
|
1699
1703
|
if (ShouldPersistChromeActiveGroup(this.EffectiveRecord?.IsSaved) && this.chrome.ActiveGroupKey) {
|
|
1700
1704
|
UserInfoEngine.Instance.SetSettingDebounced(this.chromePrefKey('activeGroup'), this.chrome.ActiveGroupKey);
|
|
1701
1705
|
}
|
|
@@ -1707,15 +1711,15 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1707
1711
|
* Subscribes to Navigate events from all child collapsible panels
|
|
1708
1712
|
* and relays them through this container's Navigate output.
|
|
1709
1713
|
*/
|
|
1710
|
-
|
|
1714
|
+
subscribeToPanelNavigateEvents() {
|
|
1711
1715
|
this.panelNavReset$.next(); // tear down previous subscriptions
|
|
1712
1716
|
// Subscribe to RecordReady on the form component — fires once after record is fully initialized
|
|
1713
|
-
if (this.
|
|
1714
|
-
this.
|
|
1715
|
-
this.
|
|
1717
|
+
if (this.Fc) {
|
|
1718
|
+
this.Fc.RecordReady.pipe(takeUntil(this.panelNavReset$)).subscribe(() => {
|
|
1719
|
+
this.loadBadgeCounts();
|
|
1716
1720
|
});
|
|
1717
|
-
this.
|
|
1718
|
-
this.
|
|
1721
|
+
this.Fc.RecordRefreshed.pipe(takeUntil(this.panelNavReset$)).subscribe((e) => {
|
|
1722
|
+
this.onFormRecordRefreshed(e.Record);
|
|
1719
1723
|
});
|
|
1720
1724
|
}
|
|
1721
1725
|
this.Panels.forEach(panel => {
|
|
@@ -1760,7 +1764,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1760
1764
|
* All queries run in parallel for performance.
|
|
1761
1765
|
*/
|
|
1762
1766
|
badgeCountsLoaded = false;
|
|
1763
|
-
|
|
1767
|
+
loadBadgeCounts() {
|
|
1764
1768
|
if (this.badgeCountsLoaded)
|
|
1765
1769
|
return;
|
|
1766
1770
|
const record = this.EffectiveRecord;
|
|
@@ -1768,15 +1772,15 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1768
1772
|
return;
|
|
1769
1773
|
this.badgeCountsLoaded = true;
|
|
1770
1774
|
// Fire queries in parallel — no await needed, they update state async
|
|
1771
|
-
this.
|
|
1772
|
-
this.
|
|
1773
|
-
this.
|
|
1775
|
+
this.loadTagCount(record);
|
|
1776
|
+
this.loadVersionCount(record);
|
|
1777
|
+
this.loadAttachmentCount(record);
|
|
1774
1778
|
}
|
|
1775
1779
|
/**
|
|
1776
1780
|
* Queries the count of linked attachments for the current entity + record
|
|
1777
1781
|
* and updates the AttachmentCount badge on the toolbar.
|
|
1778
1782
|
*/
|
|
1779
|
-
async
|
|
1783
|
+
async loadAttachmentCount(record) {
|
|
1780
1784
|
if (!this.AttachmentsAvailable)
|
|
1781
1785
|
return;
|
|
1782
1786
|
try {
|
|
@@ -1800,7 +1804,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1800
1804
|
* Queries the count of tagged items for the current entity + record
|
|
1801
1805
|
* and updates the TagCount badge on the toolbar.
|
|
1802
1806
|
*/
|
|
1803
|
-
async
|
|
1807
|
+
async loadTagCount(record) {
|
|
1804
1808
|
try {
|
|
1805
1809
|
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
1806
1810
|
// Don't narrow Fields — the server caches RunView results by entity+filter (ignoring Fields),
|
|
@@ -1823,7 +1827,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1823
1827
|
* Queries the count of record change entries for the current entity + record
|
|
1824
1828
|
* and updates the VersionCount badge on the toolbar.
|
|
1825
1829
|
*/
|
|
1826
|
-
async
|
|
1830
|
+
async loadVersionCount(record) {
|
|
1827
1831
|
if (!record.EntityInfo.TrackRecordChanges)
|
|
1828
1832
|
return;
|
|
1829
1833
|
try {
|
|
@@ -1854,12 +1858,12 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1854
1858
|
* Edit mode change: delegate to FormComponent if available, otherwise re-emit.
|
|
1855
1859
|
*/
|
|
1856
1860
|
OnEditModeChange(editMode) {
|
|
1857
|
-
if (this.
|
|
1861
|
+
if (this.Fc) {
|
|
1858
1862
|
if (editMode) {
|
|
1859
|
-
this.
|
|
1863
|
+
this.Fc.StartEditMode();
|
|
1860
1864
|
}
|
|
1861
1865
|
else {
|
|
1862
|
-
this.
|
|
1866
|
+
this.Fc.EndEditMode();
|
|
1863
1867
|
}
|
|
1864
1868
|
this.cdr.markForCheck();
|
|
1865
1869
|
}
|
|
@@ -1871,14 +1875,14 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1871
1875
|
* Save: delegate to FormComponent if available, otherwise re-emit.
|
|
1872
1876
|
*/
|
|
1873
1877
|
async OnSaveRequested() {
|
|
1874
|
-
if (this.
|
|
1878
|
+
if (this.Fc?.SaveRecord) {
|
|
1875
1879
|
// Mark as saving to prevent double-click
|
|
1876
1880
|
this.IsSaving = true;
|
|
1877
1881
|
this.cdr.markForCheck();
|
|
1878
1882
|
try {
|
|
1879
|
-
await this.
|
|
1883
|
+
await this.Fc.SaveRecord(true);
|
|
1880
1884
|
// After successful save, refresh version count badge and record changes drawer
|
|
1881
|
-
this.
|
|
1885
|
+
this.refreshAfterSave();
|
|
1882
1886
|
}
|
|
1883
1887
|
finally {
|
|
1884
1888
|
// Use microtask timing to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
@@ -1898,12 +1902,12 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1898
1902
|
* The save operation creates a new RecordChange entry server-side, so we need
|
|
1899
1903
|
* to update the UI to reflect the new version.
|
|
1900
1904
|
*/
|
|
1901
|
-
|
|
1905
|
+
refreshAfterSave() {
|
|
1902
1906
|
const record = this.EffectiveRecord;
|
|
1903
1907
|
if (!record?.EntityInfo?.TrackRecordChanges)
|
|
1904
1908
|
return;
|
|
1905
1909
|
// Refresh version count badge
|
|
1906
|
-
this.
|
|
1910
|
+
this.loadVersionCount(record);
|
|
1907
1911
|
// If the record changes drawer is open, refresh it too
|
|
1908
1912
|
if (this.ShowRecordChanges && this.recordChangesDrawer) {
|
|
1909
1913
|
this.recordChangesDrawer.Refresh();
|
|
@@ -1913,8 +1917,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1913
1917
|
* Cancel: delegate to FormComponent if available, otherwise re-emit.
|
|
1914
1918
|
*/
|
|
1915
1919
|
OnCancelRequested() {
|
|
1916
|
-
if (this.
|
|
1917
|
-
this.
|
|
1920
|
+
if (this.Fc?.CancelEdit) {
|
|
1921
|
+
this.Fc.CancelEdit();
|
|
1918
1922
|
this.cdr.markForCheck();
|
|
1919
1923
|
}
|
|
1920
1924
|
else {
|
|
@@ -1927,11 +1931,11 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1927
1931
|
* `host.Refresh()` (which calls `RefreshRecord()` directly) still notifies.
|
|
1928
1932
|
*/
|
|
1929
1933
|
async OnRefreshRequested() {
|
|
1930
|
-
if (this.
|
|
1934
|
+
if (this.Fc?.RefreshRecord) {
|
|
1931
1935
|
this.IsRefreshing = true;
|
|
1932
1936
|
this.cdr.markForCheck();
|
|
1933
1937
|
try {
|
|
1934
|
-
await this.
|
|
1938
|
+
await this.Fc.RefreshRecord();
|
|
1935
1939
|
}
|
|
1936
1940
|
finally {
|
|
1937
1941
|
await Promise.resolve();
|
|
@@ -1950,9 +1954,9 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
1950
1954
|
* the record itself (badges, open history drawer) and broadcast to
|
|
1951
1955
|
* in-form listeners (related grids, IS-A panel, custom panels).
|
|
1952
1956
|
*/
|
|
1953
|
-
|
|
1957
|
+
onFormRecordRefreshed(record) {
|
|
1954
1958
|
this.badgeCountsLoaded = false;
|
|
1955
|
-
this.
|
|
1959
|
+
this.loadBadgeCounts();
|
|
1956
1960
|
if (this.ShowRecordChanges && this.recordChangesDrawer) {
|
|
1957
1961
|
this.recordChangesDrawer.Refresh();
|
|
1958
1962
|
}
|
|
@@ -2001,7 +2005,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2001
2005
|
// Refresh tag count — tags may have been added/removed while panel was open
|
|
2002
2006
|
const record = this.EffectiveRecord;
|
|
2003
2007
|
if (record?.EntityInfo) {
|
|
2004
|
-
this.
|
|
2008
|
+
this.loadTagCount(record);
|
|
2005
2009
|
}
|
|
2006
2010
|
}
|
|
2007
2011
|
/**
|
|
@@ -2025,7 +2029,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2025
2029
|
// Refresh attachment count — attachments may have been added/removed while panel was open
|
|
2026
2030
|
const record = this.EffectiveRecord;
|
|
2027
2031
|
if (record?.EntityInfo) {
|
|
2028
|
-
this.
|
|
2032
|
+
this.loadAttachmentCount(record);
|
|
2029
2033
|
}
|
|
2030
2034
|
}
|
|
2031
2035
|
/**
|
|
@@ -2046,7 +2050,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2046
2050
|
// Refresh version count — new changes may have occurred
|
|
2047
2051
|
const record = this.EffectiveRecord;
|
|
2048
2052
|
if (record?.EntityInfo) {
|
|
2049
|
-
this.
|
|
2053
|
+
this.loadVersionCount(record);
|
|
2050
2054
|
}
|
|
2051
2055
|
}
|
|
2052
2056
|
/**
|
|
@@ -2079,7 +2083,7 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2079
2083
|
const reasonSuffix = event.Reason ? ` — "${event.Reason}"` : '';
|
|
2080
2084
|
this.notificationService.CreateSimpleNotification(`Restored ${fieldCount} field${fieldCount === 1 ? '' : 's'} from version dated ${new Date(event.ChangedAt).toLocaleDateString()}${reasonSuffix}`, 'info', 3500);
|
|
2081
2085
|
// Refresh version count — the save just produced a new restore-tagged change.
|
|
2082
|
-
this.
|
|
2086
|
+
this.loadVersionCount(record);
|
|
2083
2087
|
this.cdr.markForCheck();
|
|
2084
2088
|
}
|
|
2085
2089
|
else {
|
|
@@ -2122,8 +2126,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2122
2126
|
this.OnListManagementClosed();
|
|
2123
2127
|
}
|
|
2124
2128
|
OnShowChangesRequested() {
|
|
2125
|
-
if (this.
|
|
2126
|
-
this.
|
|
2129
|
+
if (this.Fc?.ShowChanges) {
|
|
2130
|
+
this.Fc.ShowChanges();
|
|
2127
2131
|
}
|
|
2128
2132
|
else {
|
|
2129
2133
|
this.ShowChangesRequested.emit();
|
|
@@ -2131,8 +2135,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2131
2135
|
}
|
|
2132
2136
|
// ---- Section Control Handlers ----
|
|
2133
2137
|
OnFilterChange(filter) {
|
|
2134
|
-
if (this.
|
|
2135
|
-
this.
|
|
2138
|
+
if (this.Fc?.onFilterChange) {
|
|
2139
|
+
this.Fc.onFilterChange(filter);
|
|
2136
2140
|
if (filter.trim() && this.ChromeMoreItems.length > 0) {
|
|
2137
2141
|
this.chrome.MoreExpanded = true;
|
|
2138
2142
|
}
|
|
@@ -2142,26 +2146,26 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2142
2146
|
}
|
|
2143
2147
|
}
|
|
2144
2148
|
OnExpandAll() {
|
|
2145
|
-
if (this.
|
|
2146
|
-
this.
|
|
2149
|
+
if (this.Fc?.expandAllSections) {
|
|
2150
|
+
this.Fc.expandAllSections();
|
|
2147
2151
|
this.cdr.markForCheck();
|
|
2148
2152
|
}
|
|
2149
2153
|
}
|
|
2150
2154
|
OnCollapseAll() {
|
|
2151
|
-
if (this.
|
|
2152
|
-
this.
|
|
2155
|
+
if (this.Fc?.collapseAllSections) {
|
|
2156
|
+
this.Fc.collapseAllSections();
|
|
2153
2157
|
this.cdr.markForCheck();
|
|
2154
2158
|
}
|
|
2155
2159
|
}
|
|
2156
2160
|
OnShowEmptyFieldsChange(show) {
|
|
2157
|
-
if (this.
|
|
2158
|
-
this.
|
|
2161
|
+
if (this.Fc) {
|
|
2162
|
+
this.Fc.showEmptyFields = show;
|
|
2159
2163
|
this.cdr.markForCheck();
|
|
2160
2164
|
}
|
|
2161
2165
|
}
|
|
2162
2166
|
OnWidthModeChange(mode) {
|
|
2163
|
-
if (this.
|
|
2164
|
-
this.
|
|
2167
|
+
if (this.Fc?.setFormWidthMode) {
|
|
2168
|
+
this.Fc.setFormWidthMode(mode);
|
|
2165
2169
|
this.cdr.markForCheck();
|
|
2166
2170
|
}
|
|
2167
2171
|
else {
|
|
@@ -2170,8 +2174,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2170
2174
|
}
|
|
2171
2175
|
}
|
|
2172
2176
|
OnResetSectionOrder() {
|
|
2173
|
-
if (this.
|
|
2174
|
-
this.
|
|
2177
|
+
if (this.Fc?.resetSectionOrder) {
|
|
2178
|
+
this.Fc.resetSectionOrder();
|
|
2175
2179
|
this.scheduleChromeResolve();
|
|
2176
2180
|
this.cdr.markForCheck();
|
|
2177
2181
|
}
|
|
@@ -2179,7 +2183,15 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2179
2183
|
// ---- Variant picker ----
|
|
2180
2184
|
/** Whether the variant dropdown menu is currently open. Toggled by the
|
|
2181
2185
|
* control's click handler; closed on blur or after a row is picked. */
|
|
2182
|
-
|
|
2186
|
+
VariantMenuOpen = false;
|
|
2187
|
+
/** @deprecated Use {@link VariantMenuOpen}. */
|
|
2188
|
+
get _variantMenuOpen() {
|
|
2189
|
+
return this.VariantMenuOpen;
|
|
2190
|
+
}
|
|
2191
|
+
/** @deprecated Use {@link VariantMenuOpen}. */
|
|
2192
|
+
set _variantMenuOpen(value) {
|
|
2193
|
+
this.VariantMenuOpen = value;
|
|
2194
|
+
}
|
|
2183
2195
|
/**
|
|
2184
2196
|
* Effective variants — prefer the form component's list (set by the host
|
|
2185
2197
|
* resolver) when present, fall back to the directly-bound @Input. This
|
|
@@ -2188,12 +2200,12 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2188
2200
|
* container reads it through this accessor.
|
|
2189
2201
|
*/
|
|
2190
2202
|
get EffectiveVariants() {
|
|
2191
|
-
return this.
|
|
2203
|
+
return this.Fc?.Variants
|
|
2192
2204
|
?? this.Variants
|
|
2193
2205
|
?? [];
|
|
2194
2206
|
}
|
|
2195
2207
|
get EffectiveCurrentVariantID() {
|
|
2196
|
-
return this.
|
|
2208
|
+
return this.Fc?.CurrentVariantID ?? this.CurrentVariantID;
|
|
2197
2209
|
}
|
|
2198
2210
|
/** Whether to show the variant picker at all. Hidden when the entity has
|
|
2199
2211
|
* zero or one applicable variant — there's nothing to switch between. */
|
|
@@ -2206,9 +2218,13 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2206
2218
|
return v?.Label ?? 'Default form';
|
|
2207
2219
|
}
|
|
2208
2220
|
/** Compact subtitle: scope + status, e.g. "User · Active". */
|
|
2209
|
-
|
|
2221
|
+
VariantSubtitle(v) {
|
|
2210
2222
|
return `${v.Scope} · ${v.Status}`;
|
|
2211
2223
|
}
|
|
2224
|
+
/** @deprecated Use {@link VariantSubtitle}. */
|
|
2225
|
+
variantSubtitle(v) {
|
|
2226
|
+
return this.VariantSubtitle(v);
|
|
2227
|
+
}
|
|
2212
2228
|
/**
|
|
2213
2229
|
* User picked an item from the variant menu. If the host installed a
|
|
2214
2230
|
* handler via `instance.OnVariantChanged`, call it; otherwise emit the
|
|
@@ -2217,8 +2233,8 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2217
2233
|
OnVariantPicked(variantID) {
|
|
2218
2234
|
if (variantID === this.EffectiveCurrentVariantID)
|
|
2219
2235
|
return;
|
|
2220
|
-
if (this.
|
|
2221
|
-
this.
|
|
2236
|
+
if (this.Fc && typeof this.Fc.OnVariantChanged === 'function') {
|
|
2237
|
+
this.Fc.OnVariantChanged(variantID);
|
|
2222
2238
|
}
|
|
2223
2239
|
else {
|
|
2224
2240
|
this.VariantChange.emit(variantID);
|
|
@@ -2230,15 +2246,15 @@ export class MjRecordFormContainerComponent extends BaseAngularComponent {
|
|
|
2230
2246
|
this.cdr.markForCheck();
|
|
2231
2247
|
}
|
|
2232
2248
|
OnSectionOrderChange(newOrder) {
|
|
2233
|
-
if (this.
|
|
2234
|
-
this.
|
|
2249
|
+
if (this.Fc?.setSectionOrder) {
|
|
2250
|
+
this.Fc.setSectionOrder(newOrder);
|
|
2235
2251
|
this.scheduleChromeResolve();
|
|
2236
2252
|
this.cdr.markForCheck();
|
|
2237
2253
|
}
|
|
2238
2254
|
}
|
|
2239
2255
|
OnChromeMembershipChange(change) {
|
|
2240
|
-
if (this.
|
|
2241
|
-
this.
|
|
2256
|
+
if (this.Fc?.setChromeMembership) {
|
|
2257
|
+
this.Fc.setChromeMembership(change.moreSectionKeys, change.firstClassSectionKeys);
|
|
2242
2258
|
this.scheduleChromeResolve();
|
|
2243
2259
|
this.cdr.markForCheck();
|
|
2244
2260
|
}
|