@memberjunction/ng-base-forms 6.1.4 → 6.2.0-edge.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +43 -40
- package/dist/lib/base-form-component.js.map +1 -1
- 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 +24 -13
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +233 -182
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts +32 -2
- package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.js +54 -13
- package/dist/lib/explorer-entity-data-grid.component.js.map +1 -1
- package/dist/lib/field/default-fk-lookup-strategy.d.ts +60 -0
- package/dist/lib/field/default-fk-lookup-strategy.d.ts.map +1 -0
- package/dist/lib/field/default-fk-lookup-strategy.js +173 -0
- package/dist/lib/field/default-fk-lookup-strategy.js.map +1 -0
- package/dist/lib/field/fk-lookup-strategy.d.ts +124 -0
- package/dist/lib/field/fk-lookup-strategy.d.ts.map +1 -0
- package/dist/lib/field/fk-lookup-strategy.js +97 -0
- package/dist/lib/field/fk-lookup-strategy.js.map +1 -0
- package/dist/lib/field/fk-search-utils.d.ts +33 -2
- package/dist/lib/field/fk-search-utils.d.ts.map +1 -1
- package/dist/lib/field/fk-search-utils.js +56 -3
- package/dist/lib/field/fk-search-utils.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +166 -11
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +742 -338
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/field/linked-field-options.d.ts +16 -0
- package/dist/lib/field/linked-field-options.d.ts.map +1 -1
- package/dist/lib/field/linked-field-options.js +17 -0
- package/dist/lib/field/linked-field-options.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.d.ts.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-card.component.js +12 -8
- 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.d.ts.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +24 -7
- 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 +72 -9
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +185 -43
- 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-indicators/form-section-field-host.d.ts +53 -0
- package/dist/lib/section-indicators/form-section-field-host.d.ts.map +1 -0
- package/dist/lib/section-indicators/form-section-field-host.js +23 -0
- package/dist/lib/section-indicators/form-section-field-host.js.map +1 -0
- 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/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +18 -18
|
@@ -11,7 +11,11 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
* This component is used by CodeGen for related entity grids in forms.
|
|
12
12
|
*/
|
|
13
13
|
export declare class ExplorerEntityDataGridComponent implements AfterViewInit, OnDestroy {
|
|
14
|
-
|
|
14
|
+
InnerGrid: EntityDataGridComponent;
|
|
15
|
+
/** @deprecated Use {@link InnerGrid}. */
|
|
16
|
+
get innerGrid(): EntityDataGridComponent;
|
|
17
|
+
/** @deprecated Use {@link InnerGrid}. */
|
|
18
|
+
set innerGrid(value: EntityDataGridComponent);
|
|
15
19
|
private elementRef;
|
|
16
20
|
private cdr;
|
|
17
21
|
private ngZone;
|
|
@@ -42,6 +46,10 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
42
46
|
ShowExportButton: boolean;
|
|
43
47
|
ShowDeleteButton: boolean;
|
|
44
48
|
ShowCompareButton: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Shows the grid's Merge button. This wrapper only re-emits
|
|
51
|
+
* {@link MergeRecordsRequested} — turn it on only where something subscribes.
|
|
52
|
+
*/
|
|
45
53
|
ShowMergeButton: boolean;
|
|
46
54
|
ShowAddToListButton: boolean;
|
|
47
55
|
ShowDuplicateSearchButton: boolean;
|
|
@@ -76,6 +84,8 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
76
84
|
private _scrollbarMeasureFrame;
|
|
77
85
|
private _destroyed;
|
|
78
86
|
get ResolvedHeight(): number | 'auto' | 'fit-content';
|
|
87
|
+
get HostHeightStyle(): string;
|
|
88
|
+
/** @deprecated Use {@link HostHeightStyle}. */
|
|
79
89
|
get hostHeightStyle(): string;
|
|
80
90
|
private shouldSizeToRows;
|
|
81
91
|
/**
|
|
@@ -118,10 +128,25 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
118
128
|
AfterRowDoubleClick: EventEmitter<AfterRowDoubleClickEventArgs>;
|
|
119
129
|
AfterRowClick: EventEmitter<AfterRowClickEventArgs>;
|
|
120
130
|
AfterDataLoad: EventEmitter<AfterDataLoadEventArgs>;
|
|
131
|
+
/**
|
|
132
|
+
* Emitted when the user asks to merge the selected rows. This wrapper does not host a merge
|
|
133
|
+
* UI — setting `ShowMergeButton` without handling this leaves a button that does nothing, so
|
|
134
|
+
* a host that turns the button on must subscribe here.
|
|
135
|
+
*/
|
|
136
|
+
MergeRecordsRequested: EventEmitter<{
|
|
137
|
+
entityInfo: EntityInfo;
|
|
138
|
+
records: Record<string, unknown>[];
|
|
139
|
+
}>;
|
|
121
140
|
/** Emitted when a row is double-clicked and NavigateOnDoubleClick is true */
|
|
122
141
|
Navigate: EventEmitter<FormNavigationEvent>;
|
|
142
|
+
OnRowDoubleClick(event: AfterRowDoubleClickEventArgs): void;
|
|
143
|
+
/** @deprecated Use {@link OnRowDoubleClick}. */
|
|
123
144
|
onRowDoubleClick(event: AfterRowDoubleClickEventArgs): void;
|
|
145
|
+
OnRowClick(event: AfterRowClickEventArgs): void;
|
|
146
|
+
/** @deprecated Use {@link OnRowClick}. */
|
|
124
147
|
onRowClick(event: AfterRowClickEventArgs): void;
|
|
148
|
+
OnDataLoad(event: AfterDataLoadEventArgs): void;
|
|
149
|
+
/** @deprecated Use {@link OnDataLoad}. */
|
|
125
150
|
onDataLoad(event: AfterDataLoadEventArgs): void;
|
|
126
151
|
private applySizedHeight;
|
|
127
152
|
/**
|
|
@@ -151,11 +176,16 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
151
176
|
* SingleRecordComponent) can call NavigationService.OpenNewEntityRecord
|
|
152
177
|
* and pre-populate the foreign-key fields from NewRecordValues.
|
|
153
178
|
*/
|
|
179
|
+
OnNewRecordTabRequested(event: {
|
|
180
|
+
entityInfo: EntityInfo;
|
|
181
|
+
defaultValues: Record<string, unknown>;
|
|
182
|
+
}): void;
|
|
183
|
+
/** @deprecated Use {@link OnNewRecordTabRequested}. */
|
|
154
184
|
onNewRecordTabRequested(event: {
|
|
155
185
|
entityInfo: EntityInfo;
|
|
156
186
|
defaultValues: Record<string, unknown>;
|
|
157
187
|
}): void;
|
|
158
188
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExplorerEntityDataGridComponent, never>;
|
|
159
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ExplorerEntityDataGridComponent, "mj-explorer-entity-data-grid", never, { "Params": { "alias": "Params"; "required": false; }; "NewRecordValues": { "alias": "NewRecordValues"; "required": false; }; "AllowLoad": { "alias": "AllowLoad"; "required": false; }; "ShowToolbar": { "alias": "ShowToolbar"; "required": false; }; "ShowSearch": { "alias": "ShowSearch"; "required": false; }; "ShowNewButton": { "alias": "ShowNewButton"; "required": false; }; "ShowRefreshButton": { "alias": "ShowRefreshButton"; "required": false; }; "ShowExportButton": { "alias": "ShowExportButton"; "required": false; }; "ShowDeleteButton": { "alias": "ShowDeleteButton"; "required": false; }; "ShowCompareButton": { "alias": "ShowCompareButton"; "required": false; }; "ShowMergeButton": { "alias": "ShowMergeButton"; "required": false; }; "ShowAddToListButton": { "alias": "ShowAddToListButton"; "required": false; }; "ShowDuplicateSearchButton": { "alias": "ShowDuplicateSearchButton"; "required": false; }; "ShowCommunicationButton": { "alias": "ShowCommunicationButton"; "required": false; }; "ShowRecycleBin": { "alias": "ShowRecycleBin"; "required": false; }; "Height": { "alias": "Height"; "required": false; }; "MaxHeight": { "alias": "MaxHeight"; "required": false; }; "ToolbarConfig": { "alias": "ToolbarConfig"; "required": false; }; "SelectionMode": { "alias": "SelectionMode"; "required": false; }; "DeferLoadUntilVisible": { "alias": "DeferLoadUntilVisible"; "required": false; }; "NavigateOnDoubleClick": { "alias": "NavigateOnDoubleClick"; "required": false; }; }, { "AfterRowDoubleClick": "AfterRowDoubleClick"; "AfterRowClick": "AfterRowClick"; "AfterDataLoad": "AfterDataLoad"; "Navigate": "Navigate"; }, never, never, false, never>;
|
|
189
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ExplorerEntityDataGridComponent, "mj-explorer-entity-data-grid", never, { "Params": { "alias": "Params"; "required": false; }; "NewRecordValues": { "alias": "NewRecordValues"; "required": false; }; "AllowLoad": { "alias": "AllowLoad"; "required": false; }; "ShowToolbar": { "alias": "ShowToolbar"; "required": false; }; "ShowSearch": { "alias": "ShowSearch"; "required": false; }; "ShowNewButton": { "alias": "ShowNewButton"; "required": false; }; "ShowRefreshButton": { "alias": "ShowRefreshButton"; "required": false; }; "ShowExportButton": { "alias": "ShowExportButton"; "required": false; }; "ShowDeleteButton": { "alias": "ShowDeleteButton"; "required": false; }; "ShowCompareButton": { "alias": "ShowCompareButton"; "required": false; }; "ShowMergeButton": { "alias": "ShowMergeButton"; "required": false; }; "ShowAddToListButton": { "alias": "ShowAddToListButton"; "required": false; }; "ShowDuplicateSearchButton": { "alias": "ShowDuplicateSearchButton"; "required": false; }; "ShowCommunicationButton": { "alias": "ShowCommunicationButton"; "required": false; }; "ShowRecycleBin": { "alias": "ShowRecycleBin"; "required": false; }; "Height": { "alias": "Height"; "required": false; }; "MaxHeight": { "alias": "MaxHeight"; "required": false; }; "ToolbarConfig": { "alias": "ToolbarConfig"; "required": false; }; "SelectionMode": { "alias": "SelectionMode"; "required": false; }; "DeferLoadUntilVisible": { "alias": "DeferLoadUntilVisible"; "required": false; }; "NavigateOnDoubleClick": { "alias": "NavigateOnDoubleClick"; "required": false; }; }, { "AfterRowDoubleClick": "AfterRowDoubleClick"; "AfterRowClick": "AfterRowClick"; "AfterDataLoad": "AfterDataLoad"; "MergeRecordsRequested": "MergeRecordsRequested"; "Navigate": "Navigate"; }, never, never, false, never>;
|
|
160
190
|
}
|
|
161
191
|
//# sourceMappingURL=explorer-entity-data-grid.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer-entity-data-grid.component.d.ts","sourceRoot":"","sources":["../../src/lib/explorer-entity-data-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAoD,aAAa,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAG3J,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACH,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EAEpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;;AAGhE;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"explorer-entity-data-grid.component.d.ts","sourceRoot":"","sources":["../../src/lib/explorer-entity-data-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAoD,aAAa,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAG3J,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACH,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EAEpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;;AAGhE;;;;;GAKG;AACH,qBA6Ca,+BAAgC,YAAW,aAAa,EAAE,SAAS;IACpD,SAAS,EAAG,uBAAuB,CAAC;IAE5D,yCAAyC;IACzC,IAAI,SAAS,IAAI,uBAAuB,CAEvC;IACD,yCAAyC;IACzC,IAAI,SAAS,CAAC,KAAK,EAAE,uBAAuB,EAE3C;IAED,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,MAAM,C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AqBhC,OAAO,CAAC,yBAAyB;IAiBjC;;;;;;;OAOG;IACH,OAAO,CAAC,4BAA4B;IAiBpC;;;;;OAKG;IACH,uBAAuB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,IAAI;IAQxG,uDAAuD;IACvD,uBAAuB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,IAAI;yCA7Y/F,+BAA+B;2CAA/B,+BAA+B;CAgZ3C"}
|
|
@@ -14,7 +14,15 @@ const _c0 = ["innerGrid"];
|
|
|
14
14
|
* This component is used by CodeGen for related entity grids in forms.
|
|
15
15
|
*/
|
|
16
16
|
export class ExplorerEntityDataGridComponent {
|
|
17
|
-
|
|
17
|
+
InnerGrid;
|
|
18
|
+
/** @deprecated Use {@link InnerGrid}. */
|
|
19
|
+
get innerGrid() {
|
|
20
|
+
return this.InnerGrid;
|
|
21
|
+
}
|
|
22
|
+
/** @deprecated Use {@link InnerGrid}. */
|
|
23
|
+
set innerGrid(value) {
|
|
24
|
+
this.InnerGrid = value;
|
|
25
|
+
}
|
|
18
26
|
elementRef = inject(ElementRef);
|
|
19
27
|
cdr = inject(ChangeDetectorRef);
|
|
20
28
|
ngZone = inject(NgZone);
|
|
@@ -62,6 +70,10 @@ export class ExplorerEntityDataGridComponent {
|
|
|
62
70
|
ShowExportButton = true;
|
|
63
71
|
ShowDeleteButton = false;
|
|
64
72
|
ShowCompareButton = false;
|
|
73
|
+
/**
|
|
74
|
+
* Shows the grid's Merge button. This wrapper only re-emits
|
|
75
|
+
* {@link MergeRecordsRequested} — turn it on only where something subscribes.
|
|
76
|
+
*/
|
|
65
77
|
ShowMergeButton = false;
|
|
66
78
|
ShowAddToListButton = false;
|
|
67
79
|
ShowDuplicateSearchButton = false;
|
|
@@ -98,9 +110,13 @@ export class ExplorerEntityDataGridComponent {
|
|
|
98
110
|
get ResolvedHeight() {
|
|
99
111
|
return this.shouldSizeToRows() ? this.sizedHeightPx : this.Height;
|
|
100
112
|
}
|
|
101
|
-
get
|
|
113
|
+
get HostHeightStyle() {
|
|
102
114
|
return this.shouldSizeToRows() ? `${this.sizedHeightPx}px` : '100%';
|
|
103
115
|
}
|
|
116
|
+
/** @deprecated Use {@link HostHeightStyle}. */
|
|
117
|
+
get hostHeightStyle() {
|
|
118
|
+
return this.HostHeightStyle;
|
|
119
|
+
}
|
|
104
120
|
shouldSizeToRows() {
|
|
105
121
|
return this.Height === 'fit-content' || this.isInsideRelatedEntityPanel();
|
|
106
122
|
}
|
|
@@ -163,7 +179,7 @@ export class ExplorerEntityDataGridComponent {
|
|
|
163
179
|
* button and by the parent-form refresh broadcast.
|
|
164
180
|
*/
|
|
165
181
|
async Refresh() {
|
|
166
|
-
await this.
|
|
182
|
+
await this.InnerGrid?.Refresh();
|
|
167
183
|
}
|
|
168
184
|
subscribeToFormRefresh() {
|
|
169
185
|
this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
@@ -202,15 +218,21 @@ export class ExplorerEntityDataGridComponent {
|
|
|
202
218
|
AfterRowDoubleClick = new EventEmitter();
|
|
203
219
|
AfterRowClick = new EventEmitter();
|
|
204
220
|
AfterDataLoad = new EventEmitter();
|
|
221
|
+
/**
|
|
222
|
+
* Emitted when the user asks to merge the selected rows. This wrapper does not host a merge
|
|
223
|
+
* UI — setting `ShowMergeButton` without handling this leaves a button that does nothing, so
|
|
224
|
+
* a host that turns the button on must subscribe here.
|
|
225
|
+
*/
|
|
226
|
+
MergeRecordsRequested = new EventEmitter();
|
|
205
227
|
/** Emitted when a row is double-clicked and NavigateOnDoubleClick is true */
|
|
206
228
|
Navigate = new EventEmitter();
|
|
207
|
-
|
|
229
|
+
OnRowDoubleClick(event) {
|
|
208
230
|
// Re-emit the event for any consumers
|
|
209
231
|
this.AfterRowDoubleClick.emit(event);
|
|
210
232
|
// Emit navigation event if enabled
|
|
211
233
|
if (this.NavigateOnDoubleClick && event.row) {
|
|
212
234
|
// Use the inner grid's resolved EntityInfo - works for both ViewID and EntityName params
|
|
213
|
-
const entityInfo = this.
|
|
235
|
+
const entityInfo = this.InnerGrid?.EntityInfo;
|
|
214
236
|
if (!entityInfo)
|
|
215
237
|
return;
|
|
216
238
|
const pkey = buildCompositeKey(event.row, entityInfo);
|
|
@@ -221,11 +243,19 @@ export class ExplorerEntityDataGridComponent {
|
|
|
221
243
|
});
|
|
222
244
|
}
|
|
223
245
|
}
|
|
224
|
-
|
|
246
|
+
/** @deprecated Use {@link OnRowDoubleClick}. */
|
|
247
|
+
onRowDoubleClick(event) {
|
|
248
|
+
return this.OnRowDoubleClick(event);
|
|
249
|
+
}
|
|
250
|
+
OnRowClick(event) {
|
|
225
251
|
// Re-emit the event for any consumers
|
|
226
252
|
this.AfterRowClick.emit(event);
|
|
227
253
|
}
|
|
228
|
-
|
|
254
|
+
/** @deprecated Use {@link OnRowClick}. */
|
|
255
|
+
onRowClick(event) {
|
|
256
|
+
return this.OnRowClick(event);
|
|
257
|
+
}
|
|
258
|
+
OnDataLoad(event) {
|
|
229
259
|
this.AfterDataLoad.emit(event);
|
|
230
260
|
if (!this.shouldSizeToRows()) {
|
|
231
261
|
return;
|
|
@@ -240,6 +270,10 @@ export class ExplorerEntityDataGridComponent {
|
|
|
240
270
|
// rows/columns out, so the measurement has to follow the load, not accompany it.
|
|
241
271
|
this.scheduleScrollbarMeasure();
|
|
242
272
|
}
|
|
273
|
+
/** @deprecated Use {@link OnDataLoad}. */
|
|
274
|
+
onDataLoad(event) {
|
|
275
|
+
return this.OnDataLoad(event);
|
|
276
|
+
}
|
|
243
277
|
applySizedHeight() {
|
|
244
278
|
this.sizedHeightPx = RelatedGridHeightPx(this.sizedRowCount, this.MaxHeight, this.scrollbarPx);
|
|
245
279
|
}
|
|
@@ -327,24 +361,28 @@ export class ExplorerEntityDataGridComponent {
|
|
|
327
361
|
* SingleRecordComponent) can call NavigationService.OpenNewEntityRecord
|
|
328
362
|
* and pre-populate the foreign-key fields from NewRecordValues.
|
|
329
363
|
*/
|
|
330
|
-
|
|
364
|
+
OnNewRecordTabRequested(event) {
|
|
331
365
|
this.Navigate.emit({
|
|
332
366
|
Kind: 'new-record',
|
|
333
367
|
EntityName: event.entityInfo.Name,
|
|
334
368
|
DefaultValues: event.defaultValues,
|
|
335
369
|
});
|
|
336
370
|
}
|
|
371
|
+
/** @deprecated Use {@link OnNewRecordTabRequested}. */
|
|
372
|
+
onNewRecordTabRequested(event) {
|
|
373
|
+
return this.OnNewRecordTabRequested(event);
|
|
374
|
+
}
|
|
337
375
|
static ɵfac = function ExplorerEntityDataGridComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ExplorerEntityDataGridComponent)(); };
|
|
338
376
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ExplorerEntityDataGridComponent, selectors: [["mj-explorer-entity-data-grid"]], viewQuery: function ExplorerEntityDataGridComponent_Query(rf, ctx) { if (rf & 1) {
|
|
339
377
|
i0.ɵɵviewQuery(_c0, 5);
|
|
340
378
|
} if (rf & 2) {
|
|
341
379
|
let _t;
|
|
342
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
380
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.InnerGrid = _t.first);
|
|
343
381
|
} }, hostVars: 2, hostBindings: function ExplorerEntityDataGridComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
344
382
|
i0.ɵɵstyleProp("height", ctx.hostHeightStyle);
|
|
345
|
-
} }, inputs: { Params: "Params", NewRecordValues: "NewRecordValues", AllowLoad: "AllowLoad", ShowToolbar: "ShowToolbar", ShowSearch: "ShowSearch", ShowNewButton: "ShowNewButton", ShowRefreshButton: "ShowRefreshButton", ShowExportButton: "ShowExportButton", ShowDeleteButton: "ShowDeleteButton", ShowCompareButton: "ShowCompareButton", ShowMergeButton: "ShowMergeButton", ShowAddToListButton: "ShowAddToListButton", ShowDuplicateSearchButton: "ShowDuplicateSearchButton", ShowCommunicationButton: "ShowCommunicationButton", ShowRecycleBin: "ShowRecycleBin", Height: "Height", MaxHeight: "MaxHeight", ToolbarConfig: "ToolbarConfig", SelectionMode: "SelectionMode", DeferLoadUntilVisible: "DeferLoadUntilVisible", NavigateOnDoubleClick: "NavigateOnDoubleClick" }, outputs: { AfterRowDoubleClick: "AfterRowDoubleClick", AfterRowClick: "AfterRowClick", AfterDataLoad: "AfterDataLoad", Navigate: "Navigate" }, standalone: false, decls: 2, vars: 19, consts: [["innerGrid", ""], [3, "AfterRowDoubleClick", "AfterRowClick", "AfterDataLoad", "NewRecordTabRequested", "Params", "NewRecordValues", "AllowLoad", "ShowToolbar", "ShowSearch", "ShowNewButton", "ShowRefreshButton", "ShowExportButton", "ShowDeleteButton", "ShowCompareButton", "ShowMergeButton", "ShowAddToListButton", "ShowDuplicateSearchButton", "ShowCommunicationButton", "ShowRecycleBin", "Height", "ToolbarConfig", "SelectionMode", "AllowColumnToggle"]], template: function ExplorerEntityDataGridComponent_Template(rf, ctx) { if (rf & 1) {
|
|
383
|
+
} }, inputs: { Params: "Params", NewRecordValues: "NewRecordValues", AllowLoad: "AllowLoad", ShowToolbar: "ShowToolbar", ShowSearch: "ShowSearch", ShowNewButton: "ShowNewButton", ShowRefreshButton: "ShowRefreshButton", ShowExportButton: "ShowExportButton", ShowDeleteButton: "ShowDeleteButton", ShowCompareButton: "ShowCompareButton", ShowMergeButton: "ShowMergeButton", ShowAddToListButton: "ShowAddToListButton", ShowDuplicateSearchButton: "ShowDuplicateSearchButton", ShowCommunicationButton: "ShowCommunicationButton", ShowRecycleBin: "ShowRecycleBin", Height: "Height", MaxHeight: "MaxHeight", ToolbarConfig: "ToolbarConfig", SelectionMode: "SelectionMode", DeferLoadUntilVisible: "DeferLoadUntilVisible", NavigateOnDoubleClick: "NavigateOnDoubleClick" }, outputs: { AfterRowDoubleClick: "AfterRowDoubleClick", AfterRowClick: "AfterRowClick", AfterDataLoad: "AfterDataLoad", MergeRecordsRequested: "MergeRecordsRequested", Navigate: "Navigate" }, standalone: false, decls: 2, vars: 19, consts: [["innerGrid", ""], [3, "AfterRowDoubleClick", "AfterRowClick", "AfterDataLoad", "MergeRecordsRequested", "NewRecordTabRequested", "Params", "NewRecordValues", "AllowLoad", "ShowToolbar", "ShowSearch", "ShowNewButton", "ShowRefreshButton", "ShowExportButton", "ShowDeleteButton", "ShowCompareButton", "ShowMergeButton", "ShowAddToListButton", "ShowDuplicateSearchButton", "ShowCommunicationButton", "ShowRecycleBin", "Height", "ToolbarConfig", "SelectionMode", "AllowColumnToggle"]], template: function ExplorerEntityDataGridComponent_Template(rf, ctx) { if (rf & 1) {
|
|
346
384
|
i0.ɵɵelementStart(0, "mj-entity-data-grid", 1, 0);
|
|
347
|
-
i0.ɵɵlistener("AfterRowDoubleClick", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_AfterRowDoubleClick_0_listener($event) { return ctx.onRowDoubleClick($event); })("AfterRowClick", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_AfterRowClick_0_listener($event) { return ctx.onRowClick($event); })("AfterDataLoad", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_AfterDataLoad_0_listener($event) { return ctx.onDataLoad($event); })("NewRecordTabRequested", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_NewRecordTabRequested_0_listener($event) { return ctx.onNewRecordTabRequested($event); });
|
|
385
|
+
i0.ɵɵlistener("AfterRowDoubleClick", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_AfterRowDoubleClick_0_listener($event) { return ctx.onRowDoubleClick($event); })("AfterRowClick", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_AfterRowClick_0_listener($event) { return ctx.onRowClick($event); })("AfterDataLoad", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_AfterDataLoad_0_listener($event) { return ctx.onDataLoad($event); })("MergeRecordsRequested", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_MergeRecordsRequested_0_listener($event) { return ctx.MergeRecordsRequested.emit($event); })("NewRecordTabRequested", function ExplorerEntityDataGridComponent_Template_mj_entity_data_grid_NewRecordTabRequested_0_listener($event) { return ctx.onNewRecordTabRequested($event); });
|
|
348
386
|
i0.ɵɵelementEnd();
|
|
349
387
|
} if (rf & 2) {
|
|
350
388
|
i0.ɵɵproperty("Params", ctx.Params)("NewRecordValues", ctx.NewRecordValues)("AllowLoad", ctx.EffectiveAllowLoad)("ShowToolbar", ctx.EffectiveShowToolbar)("ShowSearch", ctx.ShowSearch)("ShowNewButton", ctx.ShowNewButton)("ShowRefreshButton", ctx.ShowRefreshButton)("ShowExportButton", ctx.ShowExportButton)("ShowDeleteButton", ctx.ShowDeleteButton)("ShowCompareButton", ctx.ShowCompareButton)("ShowMergeButton", ctx.ShowMergeButton)("ShowAddToListButton", ctx.ShowAddToListButton)("ShowDuplicateSearchButton", ctx.ShowDuplicateSearchButton)("ShowCommunicationButton", ctx.ShowCommunicationButton)("ShowRecycleBin", ctx.ShowRecycleBin)("Height", ctx.ResolvedHeight)("ToolbarConfig", ctx.ToolbarConfig)("SelectionMode", ctx.SelectionMode)("AllowColumnToggle", false);
|
|
@@ -379,12 +417,13 @@ export class ExplorerEntityDataGridComponent {
|
|
|
379
417
|
(AfterRowDoubleClick)="onRowDoubleClick($event)"
|
|
380
418
|
(AfterRowClick)="onRowClick($event)"
|
|
381
419
|
(AfterDataLoad)="onDataLoad($event)"
|
|
420
|
+
(MergeRecordsRequested)="MergeRecordsRequested.emit($event)"
|
|
382
421
|
(NewRecordTabRequested)="onNewRecordTabRequested($event)">
|
|
383
422
|
</mj-entity-data-grid>
|
|
384
423
|
`, host: {
|
|
385
424
|
'[style.height]': 'hostHeightStyle',
|
|
386
425
|
}, styles: ["\n :host {\n display: block;\n height: 100%;\n width: 100%;\n }\n "] }]
|
|
387
|
-
}], null, {
|
|
426
|
+
}], null, { InnerGrid: [{
|
|
388
427
|
type: ViewChild,
|
|
389
428
|
args: ['innerGrid']
|
|
390
429
|
}], Params: [{
|
|
@@ -435,8 +474,10 @@ export class ExplorerEntityDataGridComponent {
|
|
|
435
474
|
type: Output
|
|
436
475
|
}], AfterDataLoad: [{
|
|
437
476
|
type: Output
|
|
477
|
+
}], MergeRecordsRequested: [{
|
|
478
|
+
type: Output
|
|
438
479
|
}], Navigate: [{
|
|
439
480
|
type: Output
|
|
440
481
|
}] }); })();
|
|
441
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ExplorerEntityDataGridComponent, { className: "ExplorerEntityDataGridComponent", filePath: "src/lib/explorer-entity-data-grid.component.ts", lineNumber:
|
|
482
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ExplorerEntityDataGridComponent, { className: "ExplorerEntityDataGridComponent", filePath: "src/lib/explorer-entity-data-grid.component.ts", lineNumber: 70 }); })();
|
|
442
483
|
//# sourceMappingURL=explorer-entity-data-grid.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer-entity-data-grid.component.js","sourceRoot":"","sources":["../../src/lib/explorer-entity-data-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAA4B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3J,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAOH,iBAAiB,EACpB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,2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,UAAU,CAAC,IAAI;YACjC,aAAa,EAAE,KAAK,CAAC,aAAa;SACrC,CAAC,CAAC;IACP,CAAC;yHAlWQ,+BAA+B;6DAA/B,+BAA+B;;;;;;YAA/B,6CAA+B;;YAtCpC,iDAwB8D;YAA1D,AADA,AADA,AADA,2JAAuB,4BAAwB,IAAC,kIAC/B,sBAAkB,IAAC,kIACnB,sBAAkB,IAAC,kJACX,mCAA+B,IAAC;YAC7D,iBAAsB;;YALlB,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,mCAAiB,wCACkB,qCACH,yCACI,8BACX,oCACM,4CACQ,0CACF,0CACA,4CACE,wCACJ,gDACQ,4DACY,wDACJ,sCAClB,8BACR,oCACM,oCACA,4BACJ;;;iFAkB1B,+BAA+B;cA5C3C,SAAS;6BACI,KAAK,YACL,8BAA8B,YAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BT,QAQK;oBACF,gBAAgB,EAAE,iBAAiB;iBACtC;;kBAGA,SAAS;mBAAC,WAAW;;kBASrB,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAiCL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAML,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBA2CL,KAAK;;kBAgGL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,MAAM;;kFArNE,+BAA+B","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, ChangeDetectorRef, NgZone, AfterViewInit, OnDestroy, inject } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { RunViewParams } from '@memberjunction/core';\nimport { FormRecordRefreshCoordinator } from './form-record-refresh.coordinator';\nimport {\n EntityDataGridComponent,\n AfterRowDoubleClickEventArgs,\n AfterRowClickEventArgs,\n AfterDataLoadEventArgs,\n GridToolbarConfig,\n GridSelectionMode,\n buildCompositeKey\n} from '@memberjunction/ng-entity-viewer';\nimport { EntityInfo } from '@memberjunction/core';\nimport { FormNavigationEvent } from './types/navigation-events';\nimport { RELATED_GRID_DEFAULT_MAX_PX, RelatedGridHeightPx } from './related-grid-height';\n\n/**\n * Wrapper for EntityDataGridComponent that emits navigation events on row double-click.\n * The host application subscribes to Navigate events and maps them to its routing system.\n *\n * This component is used by CodeGen for related entity grids in forms.\n */\n@Component({\n standalone: false,\n selector: 'mj-explorer-entity-data-grid',\n template: `\n <!-- Related-entity / form-embedded grid: not a saved User View, so there's no canonical\n GridState to manage — suppress the \"Manage Columns\" chooser (AllowColumnToggle=false). -->\n <mj-entity-data-grid\n #innerGrid\n [Params]=\"Params\"\n [NewRecordValues]=\"NewRecordValues\"\n [AllowLoad]=\"EffectiveAllowLoad\"\n [ShowToolbar]=\"EffectiveShowToolbar\"\n [ShowSearch]=\"ShowSearch\"\n [ShowNewButton]=\"ShowNewButton\"\n [ShowRefreshButton]=\"ShowRefreshButton\"\n [ShowExportButton]=\"ShowExportButton\"\n [ShowDeleteButton]=\"ShowDeleteButton\"\n [ShowCompareButton]=\"ShowCompareButton\"\n [ShowMergeButton]=\"ShowMergeButton\"\n [ShowAddToListButton]=\"ShowAddToListButton\"\n [ShowDuplicateSearchButton]=\"ShowDuplicateSearchButton\"\n [ShowCommunicationButton]=\"ShowCommunicationButton\"\n [ShowRecycleBin]=\"ShowRecycleBin\"\n [Height]=\"ResolvedHeight\"\n [ToolbarConfig]=\"ToolbarConfig\"\n [SelectionMode]=\"SelectionMode\"\n [AllowColumnToggle]=\"false\"\n (AfterRowDoubleClick)=\"onRowDoubleClick($event)\"\n (AfterRowClick)=\"onRowClick($event)\"\n (AfterDataLoad)=\"onDataLoad($event)\"\n (NewRecordTabRequested)=\"onNewRecordTabRequested($event)\">\n </mj-entity-data-grid>\n `,\n styles: [`\n :host {\n display: block;\n height: 100%;\n width: 100%;\n }\n `],\n host: {\n '[style.height]': 'hostHeightStyle',\n },\n})\nexport class ExplorerEntityDataGridComponent implements AfterViewInit, OnDestroy {\n @ViewChild('innerGrid') innerGrid!: EntityDataGridComponent;\n\n private elementRef = inject(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n private ngZone = inject(NgZone);\n private recordRefresh = inject(FormRecordRefreshCoordinator, { optional: true });\n private destroy$ = new Subject<void>();\n\n // Pass-through inputs from EntityDataGridComponent\n @Input() Params: RunViewParams | null = null;\n @Input() NewRecordValues: Record<string, unknown> = {};\n @Input() AllowLoad: boolean = true;\n @Input() ShowToolbar: boolean = true;\n\n /**\n * Existing generated forms still emit `[ShowToolbar]=\"false\"` on related\n * grids. Inside a related-entity panel we restore the toolbar so search /\n * new / export / refresh come back without waiting for CodeGen.\n */\n get EffectiveShowToolbar(): boolean {\n if (this.ShowToolbar) return true;\n return this.isInsideRelatedEntityPanel();\n }\n\n /**\n * Related-entity accordion AND left-nav panels. Accordion used to leave\n * Height='auto' (100% of an auto-sized parent) so AG Grid's viewport\n * collapsed to 0 while the toolbar still showed \"N rows\".\n */\n private isInsideRelatedEntityPanel(): boolean {\n return this.findRelatedEntityPanel() != null;\n }\n\n private findRelatedEntityPanel(): HTMLElement | null {\n let el: HTMLElement | null = this.elementRef.nativeElement?.parentElement ?? null;\n while (el) {\n if (el.tagName?.toLowerCase() === 'mj-collapsible-panel'\n && el.getAttribute('data-variant') === 'related-entity') {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n }\n /** Search box on the left of the toolbar. Default true. */\n @Input() ShowSearch: boolean = true;\n /** Forwarded to the inner grid. Defaults match `<mj-entity-data-grid>`. */\n @Input() ShowNewButton: boolean = true;\n @Input() ShowRefreshButton: boolean = true;\n @Input() ShowExportButton: boolean = true;\n @Input() ShowDeleteButton: boolean = false;\n @Input() ShowCompareButton: boolean = false;\n @Input() ShowMergeButton: boolean = false;\n @Input() ShowAddToListButton: boolean = false;\n @Input() ShowDuplicateSearchButton: boolean = false;\n @Input() ShowCommunicationButton: boolean = false;\n @Input() ShowRecycleBin: boolean = true;\n @Input() Height: number | 'auto' | 'fit-content' = 'auto';\n /**\n * When the grid sizes to its rows (left-nav related panels), this is the\n * cap. Content taller than the cap scrolls inside AG Grid — it does not\n * switch to paging. `null` means grow with the rows, no cap.\n */\n @Input() MaxHeight: number | null = RELATED_GRID_DEFAULT_MAX_PX;\n @Input() ToolbarConfig: GridToolbarConfig = {};\n @Input() SelectionMode: GridSelectionMode = 'single';\n\n /**\n * Related-entity grids (accordion and left-nav) and explicit fit-content grids\n * size to toolbar + header + rows instead of `height: 100%` of leftover / auto space.\n */\n private sizedHeightPx = RelatedGridHeightPx(0, this.MaxHeight);\n /** Rows in the last load — re-applied when the scrollbar measurement changes. */\n private sizedRowCount = 0;\n /**\n * Height AG Grid's horizontal scrollbar currently takes INSIDE our box (0 when the\n * columns fit, or on platforms with overlay scrollbars). Measured from the DOM after\n * layout, never assumed — see `measureHorizontalScrollbarPx`. `undefined` until AG Grid\n * has rendered its scroller and a measurement exists: `RelatedGridHeightPx` then falls\n * back to its fixed `RELATED_GRID_HSCROLLBAR_PX` reserve, so an unmeasured grid on a\n * classic-scrollbar platform never shows a clipped row before the first measurement.\n */\n private scrollbarPx: number | undefined;\n private _hostResizeObserver?: ResizeObserver;\n private _scrollbarMeasureFrame = 0;\n private _destroyed = false;\n\n get ResolvedHeight(): number | 'auto' | 'fit-content' {\n return this.shouldSizeToRows() ? this.sizedHeightPx : this.Height;\n }\n\n get hostHeightStyle(): string {\n return this.shouldSizeToRows() ? `${this.sizedHeightPx}px` : '100%';\n }\n\n private shouldSizeToRows(): boolean {\n return this.Height === 'fit-content' || this.isInsideRelatedEntityPanel();\n }\n\n /**\n * When true (default), the inner grid does not fetch until this component's host\n * element first scrolls into the viewport. This prevents related-entity grids on a\n * form — which are always rendered in the DOM (the collapsible panel hides them via\n * CSS, not @if) — from firing a RunView on form open while they're collapsed or below\n * the fold. The first time the panel becomes visible (scrolled into view and expanded,\n * giving the host non-zero area), the grid loads with its normal spinner.\n * Set to false to restore eager loading for consumers that always want immediate data.\n */\n @Input() DeferLoadUntilVisible: boolean = true;\n\n /** True once the host has first intersected the viewport (or deferral is disabled / unsupported). */\n private _hasBeenVisible = false;\n private _visibilityObserver?: IntersectionObserver;\n\n /**\n * Effective AllowLoad passed to the inner grid: the form's AllowLoad AND\n * (deferral disabled OR the panel has been seen at least once).\n */\n get EffectiveAllowLoad(): boolean {\n return this.AllowLoad && (!this.DeferLoadUntilVisible || this._hasBeenVisible);\n }\n\n ngAfterViewInit(): void {\n this.subscribeToFormRefresh();\n this.ensureHostResizeObserver();\n if (!this.DeferLoadUntilVisible || typeof IntersectionObserver === 'undefined') {\n // Deferral off or unsupported environment — preserve eager-load behavior.\n this._hasBeenVisible = true;\n return;\n }\n\n // Observe outside Angular so scroll churn doesn't trigger change detection;\n // we re-enter the zone only on the one-shot \"became visible\" transition.\n this.ngZone.runOutsideAngular(() => {\n this._visibilityObserver = new IntersectionObserver(\n (entries) => {\n if (entries.some(e => e.isIntersecting)) {\n this.onBecameVisible();\n }\n },\n // Small positive rootMargin pre-loads just before the panel scrolls fully into view.\n { root: null, rootMargin: '200px', threshold: 0 }\n );\n this._visibilityObserver.observe(this.elementRef.nativeElement);\n });\n }\n\n ngOnDestroy(): void {\n this._destroyed = true;\n this.destroy$.next();\n this.destroy$.complete();\n this._visibilityObserver?.disconnect();\n this._visibilityObserver = undefined;\n this._hostResizeObserver?.disconnect();\n this._hostResizeObserver = undefined;\n if (this._scrollbarMeasureFrame && typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(this._scrollbarMeasureFrame);\n }\n this._scrollbarMeasureFrame = 0;\n }\n\n /**\n * Reload this grid from the database. Used by the grid's own refresh\n * button and by the parent-form refresh broadcast.\n */\n public async Refresh(): Promise<void> {\n await this.innerGrid?.Refresh();\n }\n\n private subscribeToFormRefresh(): void {\n this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe(() => {\n void this.refreshIfLoaded();\n });\n }\n\n /**\n * Parent-form refresh fan-out: only reload grids that have already paid\n * for a RunView. Collapsed / never-seen related sections stay deferred.\n */\n private async refreshIfLoaded(): Promise<void> {\n if (!this._hasBeenVisible) {\n return;\n }\n await this.Refresh();\n }\n\n private onBecameVisible(): void {\n if (this._hasBeenVisible) {\n return;\n }\n // One-shot: once loaded we never need to observe again.\n this._visibilityObserver?.disconnect();\n this._visibilityObserver = undefined;\n this.ngZone.run(() => {\n this._hasBeenVisible = true;\n // Flip EffectiveAllowLoad → true, which drives the inner grid's AllowLoad setter to load.\n this.cdr.detectChanges();\n });\n }\n\n /**\n * When true, double-clicking a row emits a Navigate event.\n * Defaults to true.\n */\n @Input() NavigateOnDoubleClick: boolean = true;\n\n // Re-emit events for consumers who need them\n @Output() AfterRowDoubleClick = new EventEmitter<AfterRowDoubleClickEventArgs>();\n @Output() AfterRowClick = new EventEmitter<AfterRowClickEventArgs>();\n @Output() AfterDataLoad = new EventEmitter<AfterDataLoadEventArgs>();\n\n /** Emitted when a row is double-clicked and NavigateOnDoubleClick is true */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n onRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n // Re-emit the event for any consumers\n this.AfterRowDoubleClick.emit(event);\n\n // Emit navigation event if enabled\n if (this.NavigateOnDoubleClick && event.row) {\n // Use the inner grid's resolved EntityInfo - works for both ViewID and EntityName params\n const entityInfo = this.innerGrid?.EntityInfo;\n if (!entityInfo) return;\n\n const pkey = buildCompositeKey(event.row, entityInfo);\n\n this.Navigate.emit({\n Kind: 'record',\n EntityName: entityInfo.Name,\n PrimaryKey: pkey\n });\n }\n }\n\n onRowClick(event: AfterRowClickEventArgs): void {\n // Re-emit the event for any consumers\n this.AfterRowClick.emit(event);\n }\n\n onDataLoad(event: AfterDataLoadEventArgs): void {\n this.AfterDataLoad.emit(event);\n if (!this.shouldSizeToRows()) {\n return;\n }\n this.sizedRowCount = event.loadedRowCount;\n this.applySizedHeight();\n this.cdr.markForCheck();\n // The related-entity panel ancestry can become detectable after ngAfterViewInit, so\n // make sure the observer exists by the time the first sized load happens.\n this.ensureHostResizeObserver();\n // AG Grid decides whether it needs a horizontal scrollbar only after it lays the new\n // rows/columns out, so the measurement has to follow the load, not accompany it.\n this.scheduleScrollbarMeasure();\n }\n\n private applySizedHeight(): void {\n this.sizedHeightPx = RelatedGridHeightPx(this.sizedRowCount, this.MaxHeight, this.scrollbarPx);\n }\n\n /**\n * Horizontal overflow comes and goes with the container width, not only with data\n * loads (a left-nav column narrows, a panel is resized), so re-measure on host resize.\n * Idempotent: creates the observer once, the first time this grid sizes to its rows.\n */\n private ensureHostResizeObserver(): void {\n if (this._hostResizeObserver || this._destroyed || !this.shouldSizeToRows() || typeof ResizeObserver === 'undefined') {\n return;\n }\n this.ngZone.runOutsideAngular(() => {\n this._hostResizeObserver = new ResizeObserver(() => this.scheduleScrollbarMeasure());\n this._hostResizeObserver.observe(this.elementRef.nativeElement);\n });\n }\n\n /**\n * Measure two frames out: AG Grid sizes its fake scroller in its own animation\n * frame (`FakeHScrollComp.setScrollVisible`), and ours must land after that.\n */\n private scheduleScrollbarMeasure(): void {\n if (this._destroyed) {\n return;\n }\n if (typeof requestAnimationFrame === 'undefined') {\n this.applyScrollbarMeasurement();\n return;\n }\n if (this._scrollbarMeasureFrame) {\n return; // one already queued; it will read the latest layout\n }\n this.ngZone.runOutsideAngular(() => {\n this._scrollbarMeasureFrame = requestAnimationFrame(() => {\n this._scrollbarMeasureFrame = requestAnimationFrame(() => {\n this._scrollbarMeasureFrame = 0;\n this.applyScrollbarMeasurement();\n });\n });\n });\n }\n\n private applyScrollbarMeasurement(): void {\n if (this._destroyed || !this.shouldSizeToRows()) {\n return;\n }\n const px = this.measureHorizontalScrollbarPx();\n if (px === this.scrollbarPx) {\n return;\n }\n this.scrollbarPx = px;\n // markForCheck, not detectChanges: the height lives in a HOST binding, which the\n // parent view refreshes, so the view (and its ancestors) must be marked dirty.\n this.ngZone.run(() => {\n this.applySizedHeight();\n this.cdr.markForCheck();\n });\n }\n\n /**\n * The space AG Grid's horizontal scrollbar takes inside our box right now. AG Grid\n * renders it as a \"fake\" scroller element it sizes to the platform scrollbar width\n * when the columns overflow and collapses to 0 when they fit. Overlay scrollbars\n * (macOS \"show when scrolling\") get `.ag-scrollbar-invisible`, which positions the\n * element absolutely — it is drawn over the rows and takes no layout space, so it\n * needs no budget. Returns `undefined` when the scroller has not been rendered yet.\n */\n private measureHorizontalScrollbarPx(): number | undefined {\n const host = this.elementRef.nativeElement as HTMLElement | null;\n const scroller = host?.querySelector<HTMLElement>('.ag-body-horizontal-scroll');\n if (!scroller) {\n // No scroller element yet is NOT a measurement of 0: AG Grid has not laid the grid\n // out. Stay unmeasured so the sizing keeps the fixed reserve until it has.\n return undefined;\n }\n // Watch the scroller too: its height flips 0 <-> N when AG Grid toggles the\n // scrollbar without the host changing size. Re-observing the same target is a no-op.\n this._hostResizeObserver?.observe(scroller);\n if (getComputedStyle(scroller).position === 'absolute') {\n return 0;\n }\n return scroller.offsetHeight;\n }\n\n /**\n * The inner grid's \"New\" button bubbles up here. We re-emit as a\n * `new-record` Navigate event so the host form (and Explorer's\n * SingleRecordComponent) can call NavigationService.OpenNewEntityRecord\n * and pre-populate the foreign-key fields from NewRecordValues.\n */\n onNewRecordTabRequested(event: { entityInfo: EntityInfo; defaultValues: Record<string, unknown> }): void {\n this.Navigate.emit({\n Kind: 'new-record',\n EntityName: event.entityInfo.Name,\n DefaultValues: event.defaultValues,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"explorer-entity-data-grid.component.js","sourceRoot":"","sources":["../../src/lib/explorer-entity-data-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,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AyB8D;YAA1D,AADA,AADA,AADA,AADA,2JAAuB,4BAAwB,IAAC,kIAC/B,sBAAkB,IAAC,kIACnB,sBAAkB,IAAC,kJACX,sCAAkC,IAAC,kJACnC,mCAA+B,IAAC;YAC7D,iBAAsB;;YANlB,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,mCAAiB,wCACkB,qCACH,yCACI,8BACX,oCACM,4CACQ,0CACF,0CACA,4CACE,wCACJ,gDACQ,4DACY,wDACJ,sCAClB,8BACR,oCACM,oCACA,4BACJ;;;iFAmB1B,+BAA+B;cA7C3C,SAAS;6BACI,KAAK,YACL,8BAA8B,YAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BT,QAQK;oBACF,gBAAgB,EAAE,iBAAiB;iBACtC;;kBAGA,SAAS;mBAAC,WAAW;;kBAkBrB,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAiCL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAKL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAML,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAgDL,KAAK;;kBAgGL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kFA9OE,+BAA+B","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, ChangeDetectorRef, NgZone, AfterViewInit, OnDestroy, inject } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { RunViewParams } from '@memberjunction/core';\nimport { FormRecordRefreshCoordinator } from './form-record-refresh.coordinator';\nimport {\n EntityDataGridComponent,\n AfterRowDoubleClickEventArgs,\n AfterRowClickEventArgs,\n AfterDataLoadEventArgs,\n GridToolbarConfig,\n GridSelectionMode,\n buildCompositeKey\n} from '@memberjunction/ng-entity-viewer';\nimport { EntityInfo } from '@memberjunction/core';\nimport { FormNavigationEvent } from './types/navigation-events';\nimport { RELATED_GRID_DEFAULT_MAX_PX, RelatedGridHeightPx } from './related-grid-height';\n\n/**\n * Wrapper for EntityDataGridComponent that emits navigation events on row double-click.\n * The host application subscribes to Navigate events and maps them to its routing system.\n *\n * This component is used by CodeGen for related entity grids in forms.\n */\n@Component({\n standalone: false,\n selector: 'mj-explorer-entity-data-grid',\n template: `\n <!-- Related-entity / form-embedded grid: not a saved User View, so there's no canonical\n GridState to manage — suppress the \"Manage Columns\" chooser (AllowColumnToggle=false). -->\n <mj-entity-data-grid\n #innerGrid\n [Params]=\"Params\"\n [NewRecordValues]=\"NewRecordValues\"\n [AllowLoad]=\"EffectiveAllowLoad\"\n [ShowToolbar]=\"EffectiveShowToolbar\"\n [ShowSearch]=\"ShowSearch\"\n [ShowNewButton]=\"ShowNewButton\"\n [ShowRefreshButton]=\"ShowRefreshButton\"\n [ShowExportButton]=\"ShowExportButton\"\n [ShowDeleteButton]=\"ShowDeleteButton\"\n [ShowCompareButton]=\"ShowCompareButton\"\n [ShowMergeButton]=\"ShowMergeButton\"\n [ShowAddToListButton]=\"ShowAddToListButton\"\n [ShowDuplicateSearchButton]=\"ShowDuplicateSearchButton\"\n [ShowCommunicationButton]=\"ShowCommunicationButton\"\n [ShowRecycleBin]=\"ShowRecycleBin\"\n [Height]=\"ResolvedHeight\"\n [ToolbarConfig]=\"ToolbarConfig\"\n [SelectionMode]=\"SelectionMode\"\n [AllowColumnToggle]=\"false\"\n (AfterRowDoubleClick)=\"onRowDoubleClick($event)\"\n (AfterRowClick)=\"onRowClick($event)\"\n (AfterDataLoad)=\"onDataLoad($event)\"\n (MergeRecordsRequested)=\"MergeRecordsRequested.emit($event)\"\n (NewRecordTabRequested)=\"onNewRecordTabRequested($event)\">\n </mj-entity-data-grid>\n `,\n styles: [`\n :host {\n display: block;\n height: 100%;\n width: 100%;\n }\n `],\n host: {\n '[style.height]': 'hostHeightStyle',\n },\n})\nexport class ExplorerEntityDataGridComponent implements AfterViewInit, OnDestroy {\n @ViewChild('innerGrid') InnerGrid!: EntityDataGridComponent;\n\n /** @deprecated Use {@link InnerGrid}. */\n get innerGrid(): EntityDataGridComponent {\n return this.InnerGrid;\n }\n /** @deprecated Use {@link InnerGrid}. */\n set innerGrid(value: EntityDataGridComponent) {\n this.InnerGrid = value;\n }\n\n private elementRef = inject(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n private ngZone = inject(NgZone);\n private recordRefresh = inject(FormRecordRefreshCoordinator, { optional: true });\n private destroy$ = new Subject<void>();\n\n // Pass-through inputs from EntityDataGridComponent\n @Input() Params: RunViewParams | null = null;\n @Input() NewRecordValues: Record<string, unknown> = {};\n @Input() AllowLoad: boolean = true;\n @Input() ShowToolbar: boolean = true;\n\n /**\n * Existing generated forms still emit `[ShowToolbar]=\"false\"` on related\n * grids. Inside a related-entity panel we restore the toolbar so search /\n * new / export / refresh come back without waiting for CodeGen.\n */\n get EffectiveShowToolbar(): boolean {\n if (this.ShowToolbar) return true;\n return this.isInsideRelatedEntityPanel();\n }\n\n /**\n * Related-entity accordion AND left-nav panels. Accordion used to leave\n * Height='auto' (100% of an auto-sized parent) so AG Grid's viewport\n * collapsed to 0 while the toolbar still showed \"N rows\".\n */\n private isInsideRelatedEntityPanel(): boolean {\n return this.findRelatedEntityPanel() != null;\n }\n\n private findRelatedEntityPanel(): HTMLElement | null {\n let el: HTMLElement | null = this.elementRef.nativeElement?.parentElement ?? null;\n while (el) {\n if (el.tagName?.toLowerCase() === 'mj-collapsible-panel'\n && el.getAttribute('data-variant') === 'related-entity') {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n }\n /** Search box on the left of the toolbar. Default true. */\n @Input() ShowSearch: boolean = true;\n /** Forwarded to the inner grid. Defaults match `<mj-entity-data-grid>`. */\n @Input() ShowNewButton: boolean = true;\n @Input() ShowRefreshButton: boolean = true;\n @Input() ShowExportButton: boolean = true;\n @Input() ShowDeleteButton: boolean = false;\n @Input() ShowCompareButton: boolean = false;\n /**\n * Shows the grid's Merge button. This wrapper only re-emits\n * {@link MergeRecordsRequested} — turn it on only where something subscribes.\n */\n @Input() ShowMergeButton: boolean = false;\n @Input() ShowAddToListButton: boolean = false;\n @Input() ShowDuplicateSearchButton: boolean = false;\n @Input() ShowCommunicationButton: boolean = false;\n @Input() ShowRecycleBin: boolean = true;\n @Input() Height: number | 'auto' | 'fit-content' = 'auto';\n /**\n * When the grid sizes to its rows (left-nav related panels), this is the\n * cap. Content taller than the cap scrolls inside AG Grid — it does not\n * switch to paging. `null` means grow with the rows, no cap.\n */\n @Input() MaxHeight: number | null = RELATED_GRID_DEFAULT_MAX_PX;\n @Input() ToolbarConfig: GridToolbarConfig = {};\n @Input() SelectionMode: GridSelectionMode = 'single';\n\n /**\n * Related-entity grids (accordion and left-nav) and explicit fit-content grids\n * size to toolbar + header + rows instead of `height: 100%` of leftover / auto space.\n */\n private sizedHeightPx = RelatedGridHeightPx(0, this.MaxHeight);\n /** Rows in the last load — re-applied when the scrollbar measurement changes. */\n private sizedRowCount = 0;\n /**\n * Height AG Grid's horizontal scrollbar currently takes INSIDE our box (0 when the\n * columns fit, or on platforms with overlay scrollbars). Measured from the DOM after\n * layout, never assumed — see `measureHorizontalScrollbarPx`. `undefined` until AG Grid\n * has rendered its scroller and a measurement exists: `RelatedGridHeightPx` then falls\n * back to its fixed `RELATED_GRID_HSCROLLBAR_PX` reserve, so an unmeasured grid on a\n * classic-scrollbar platform never shows a clipped row before the first measurement.\n */\n private scrollbarPx: number | undefined;\n private _hostResizeObserver?: ResizeObserver;\n private _scrollbarMeasureFrame = 0;\n private _destroyed = false;\n\n get ResolvedHeight(): number | 'auto' | 'fit-content' {\n return this.shouldSizeToRows() ? this.sizedHeightPx : this.Height;\n }\n\n get HostHeightStyle(): string {\n return this.shouldSizeToRows() ? `${this.sizedHeightPx}px` : '100%';\n }\n\n /** @deprecated Use {@link HostHeightStyle}. */\n get hostHeightStyle(): string {\n return this.HostHeightStyle;\n }\n\n private shouldSizeToRows(): boolean {\n return this.Height === 'fit-content' || this.isInsideRelatedEntityPanel();\n }\n\n /**\n * When true (default), the inner grid does not fetch until this component's host\n * element first scrolls into the viewport. This prevents related-entity grids on a\n * form — which are always rendered in the DOM (the collapsible panel hides them via\n * CSS, not @if) — from firing a RunView on form open while they're collapsed or below\n * the fold. The first time the panel becomes visible (scrolled into view and expanded,\n * giving the host non-zero area), the grid loads with its normal spinner.\n * Set to false to restore eager loading for consumers that always want immediate data.\n */\n @Input() DeferLoadUntilVisible: boolean = true;\n\n /** True once the host has first intersected the viewport (or deferral is disabled / unsupported). */\n private _hasBeenVisible = false;\n private _visibilityObserver?: IntersectionObserver;\n\n /**\n * Effective AllowLoad passed to the inner grid: the form's AllowLoad AND\n * (deferral disabled OR the panel has been seen at least once).\n */\n get EffectiveAllowLoad(): boolean {\n return this.AllowLoad && (!this.DeferLoadUntilVisible || this._hasBeenVisible);\n }\n\n ngAfterViewInit(): void {\n this.subscribeToFormRefresh();\n this.ensureHostResizeObserver();\n if (!this.DeferLoadUntilVisible || typeof IntersectionObserver === 'undefined') {\n // Deferral off or unsupported environment — preserve eager-load behavior.\n this._hasBeenVisible = true;\n return;\n }\n\n // Observe outside Angular so scroll churn doesn't trigger change detection;\n // we re-enter the zone only on the one-shot \"became visible\" transition.\n this.ngZone.runOutsideAngular(() => {\n this._visibilityObserver = new IntersectionObserver(\n (entries) => {\n if (entries.some(e => e.isIntersecting)) {\n this.onBecameVisible();\n }\n },\n // Small positive rootMargin pre-loads just before the panel scrolls fully into view.\n { root: null, rootMargin: '200px', threshold: 0 }\n );\n this._visibilityObserver.observe(this.elementRef.nativeElement);\n });\n }\n\n ngOnDestroy(): void {\n this._destroyed = true;\n this.destroy$.next();\n this.destroy$.complete();\n this._visibilityObserver?.disconnect();\n this._visibilityObserver = undefined;\n this._hostResizeObserver?.disconnect();\n this._hostResizeObserver = undefined;\n if (this._scrollbarMeasureFrame && typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(this._scrollbarMeasureFrame);\n }\n this._scrollbarMeasureFrame = 0;\n }\n\n /**\n * Reload this grid from the database. Used by the grid's own refresh\n * button and by the parent-form refresh broadcast.\n */\n public async Refresh(): Promise<void> {\n await this.InnerGrid?.Refresh();\n }\n\n private subscribeToFormRefresh(): void {\n this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe(() => {\n void this.refreshIfLoaded();\n });\n }\n\n /**\n * Parent-form refresh fan-out: only reload grids that have already paid\n * for a RunView. Collapsed / never-seen related sections stay deferred.\n */\n private async refreshIfLoaded(): Promise<void> {\n if (!this._hasBeenVisible) {\n return;\n }\n await this.Refresh();\n }\n\n private onBecameVisible(): void {\n if (this._hasBeenVisible) {\n return;\n }\n // One-shot: once loaded we never need to observe again.\n this._visibilityObserver?.disconnect();\n this._visibilityObserver = undefined;\n this.ngZone.run(() => {\n this._hasBeenVisible = true;\n // Flip EffectiveAllowLoad → true, which drives the inner grid's AllowLoad setter to load.\n this.cdr.detectChanges();\n });\n }\n\n /**\n * When true, double-clicking a row emits a Navigate event.\n * Defaults to true.\n */\n @Input() NavigateOnDoubleClick: boolean = true;\n\n // Re-emit events for consumers who need them\n @Output() AfterRowDoubleClick = new EventEmitter<AfterRowDoubleClickEventArgs>();\n @Output() AfterRowClick = new EventEmitter<AfterRowClickEventArgs>();\n @Output() AfterDataLoad = new EventEmitter<AfterDataLoadEventArgs>();\n\n /**\n * Emitted when the user asks to merge the selected rows. This wrapper does not host a merge\n * UI — setting `ShowMergeButton` without handling this leaves a button that does nothing, so\n * a host that turns the button on must subscribe here.\n */\n @Output() MergeRecordsRequested = new EventEmitter<{ entityInfo: EntityInfo; records: Record<string, unknown>[] }>();\n\n /** Emitted when a row is double-clicked and NavigateOnDoubleClick is true */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n OnRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n // Re-emit the event for any consumers\n this.AfterRowDoubleClick.emit(event);\n\n // Emit navigation event if enabled\n if (this.NavigateOnDoubleClick && event.row) {\n // Use the inner grid's resolved EntityInfo - works for both ViewID and EntityName params\n const entityInfo = this.InnerGrid?.EntityInfo;\n if (!entityInfo) return;\n\n const pkey = buildCompositeKey(event.row, entityInfo);\n\n this.Navigate.emit({\n Kind: 'record',\n EntityName: entityInfo.Name,\n PrimaryKey: pkey\n });\n }\n }\n\n /** @deprecated Use {@link OnRowDoubleClick}. */\n onRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n return this.OnRowDoubleClick(event);\n }\n\n OnRowClick(event: AfterRowClickEventArgs): void {\n // Re-emit the event for any consumers\n this.AfterRowClick.emit(event);\n }\n\n /** @deprecated Use {@link OnRowClick}. */\n onRowClick(event: AfterRowClickEventArgs): void {\n return this.OnRowClick(event);\n }\n\n OnDataLoad(event: AfterDataLoadEventArgs): void {\n this.AfterDataLoad.emit(event);\n if (!this.shouldSizeToRows()) {\n return;\n }\n this.sizedRowCount = event.loadedRowCount;\n this.applySizedHeight();\n this.cdr.markForCheck();\n // The related-entity panel ancestry can become detectable after ngAfterViewInit, so\n // make sure the observer exists by the time the first sized load happens.\n this.ensureHostResizeObserver();\n // AG Grid decides whether it needs a horizontal scrollbar only after it lays the new\n // rows/columns out, so the measurement has to follow the load, not accompany it.\n this.scheduleScrollbarMeasure();\n }\n\n /** @deprecated Use {@link OnDataLoad}. */\n onDataLoad(event: AfterDataLoadEventArgs): void {\n return this.OnDataLoad(event);\n }\n\n private applySizedHeight(): void {\n this.sizedHeightPx = RelatedGridHeightPx(this.sizedRowCount, this.MaxHeight, this.scrollbarPx);\n }\n\n /**\n * Horizontal overflow comes and goes with the container width, not only with data\n * loads (a left-nav column narrows, a panel is resized), so re-measure on host resize.\n * Idempotent: creates the observer once, the first time this grid sizes to its rows.\n */\n private ensureHostResizeObserver(): void {\n if (this._hostResizeObserver || this._destroyed || !this.shouldSizeToRows() || typeof ResizeObserver === 'undefined') {\n return;\n }\n this.ngZone.runOutsideAngular(() => {\n this._hostResizeObserver = new ResizeObserver(() => this.scheduleScrollbarMeasure());\n this._hostResizeObserver.observe(this.elementRef.nativeElement);\n });\n }\n\n /**\n * Measure two frames out: AG Grid sizes its fake scroller in its own animation\n * frame (`FakeHScrollComp.setScrollVisible`), and ours must land after that.\n */\n private scheduleScrollbarMeasure(): void {\n if (this._destroyed) {\n return;\n }\n if (typeof requestAnimationFrame === 'undefined') {\n this.applyScrollbarMeasurement();\n return;\n }\n if (this._scrollbarMeasureFrame) {\n return; // one already queued; it will read the latest layout\n }\n this.ngZone.runOutsideAngular(() => {\n this._scrollbarMeasureFrame = requestAnimationFrame(() => {\n this._scrollbarMeasureFrame = requestAnimationFrame(() => {\n this._scrollbarMeasureFrame = 0;\n this.applyScrollbarMeasurement();\n });\n });\n });\n }\n\n private applyScrollbarMeasurement(): void {\n if (this._destroyed || !this.shouldSizeToRows()) {\n return;\n }\n const px = this.measureHorizontalScrollbarPx();\n if (px === this.scrollbarPx) {\n return;\n }\n this.scrollbarPx = px;\n // markForCheck, not detectChanges: the height lives in a HOST binding, which the\n // parent view refreshes, so the view (and its ancestors) must be marked dirty.\n this.ngZone.run(() => {\n this.applySizedHeight();\n this.cdr.markForCheck();\n });\n }\n\n /**\n * The space AG Grid's horizontal scrollbar takes inside our box right now. AG Grid\n * renders it as a \"fake\" scroller element it sizes to the platform scrollbar width\n * when the columns overflow and collapses to 0 when they fit. Overlay scrollbars\n * (macOS \"show when scrolling\") get `.ag-scrollbar-invisible`, which positions the\n * element absolutely — it is drawn over the rows and takes no layout space, so it\n * needs no budget. Returns `undefined` when the scroller has not been rendered yet.\n */\n private measureHorizontalScrollbarPx(): number | undefined {\n const host = this.elementRef.nativeElement as HTMLElement | null;\n const scroller = host?.querySelector<HTMLElement>('.ag-body-horizontal-scroll');\n if (!scroller) {\n // No scroller element yet is NOT a measurement of 0: AG Grid has not laid the grid\n // out. Stay unmeasured so the sizing keeps the fixed reserve until it has.\n return undefined;\n }\n // Watch the scroller too: its height flips 0 <-> N when AG Grid toggles the\n // scrollbar without the host changing size. Re-observing the same target is a no-op.\n this._hostResizeObserver?.observe(scroller);\n if (getComputedStyle(scroller).position === 'absolute') {\n return 0;\n }\n return scroller.offsetHeight;\n }\n\n /**\n * The inner grid's \"New\" button bubbles up here. We re-emit as a\n * `new-record` Navigate event so the host form (and Explorer's\n * SingleRecordComponent) can call NavigationService.OpenNewEntityRecord\n * and pre-populate the foreign-key fields from NewRecordValues.\n */\n OnNewRecordTabRequested(event: { entityInfo: EntityInfo; defaultValues: Record<string, unknown> }): void {\n this.Navigate.emit({\n Kind: 'new-record',\n EntityName: event.entityInfo.Name,\n DefaultValues: event.defaultValues,\n });\n }\n\n /** @deprecated Use {@link OnNewRecordTabRequested}. */\n onNewRecordTabRequested(event: { entityInfo: EntityInfo; defaultValues: Record<string, unknown> }): void {\n return this.OnNewRecordTabRequested(event);\n }\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJ's own rows for a foreign-key dropdown — the behaviour every field gets when no
|
|
3
|
+
* {@link FKLookupStrategy} is registered for it.
|
|
4
|
+
*
|
|
5
|
+
* What this replaces: one `RunView` with `[<name>] LIKE '%<typed>%'`, no `OrderBy`, twenty rows.
|
|
6
|
+
* On a large related entity that is twenty arbitrary records containing the letters typed, with
|
|
7
|
+
* `%` and `_` acting as live wildcards.
|
|
8
|
+
*/
|
|
9
|
+
import { FKLookupStrategy, type FKLookupContext, type FKLookupGroup, type FKLookupRow } from './fk-lookup-strategy';
|
|
10
|
+
/** AND-join the non-empty fragments, each parenthesized so precedence survives. */
|
|
11
|
+
export declare function CombineFilters(...parts: ReadonlyArray<string | null | undefined>): string;
|
|
12
|
+
/**
|
|
13
|
+
* The stock lookup: browse by name for the empty query; for a typed one, an escaped `LIKE` on the
|
|
14
|
+
* column the user is searching, prefix matches first. The field's `RelatedEntityFilter` and the
|
|
15
|
+
* `[FKExtraFilter]` input apply to both, in SQL. `{ SearchMode: 'hybrid' }` in `[FKLookupOptions]`
|
|
16
|
+
* ranks through the platform search API instead and hydrates the winners in search order.
|
|
17
|
+
*
|
|
18
|
+
* Subclass it rather than {@link FKLookupStrategy} when an app wants MJ's querying but its own
|
|
19
|
+
* grouping or decoration — `fieldsFor` and `baseFilter` are the hooks for that.
|
|
20
|
+
*/
|
|
21
|
+
export declare class DefaultFKLookupStrategy extends FKLookupStrategy {
|
|
22
|
+
/**
|
|
23
|
+
* `SearchEntity` takes no filter, so the metadata filter can only be applied when hydrating the
|
|
24
|
+
* IDs it returned. Over-fetch so a filter that removes most of the matches still leaves a usable
|
|
25
|
+
* list; when it removes all of them the LIKE path, which filters in SQL, answers instead.
|
|
26
|
+
*/
|
|
27
|
+
private static readonly SEARCH_OVERFETCH;
|
|
28
|
+
private static readonly SEARCH_MIN_TOPK;
|
|
29
|
+
Lookup(context: FKLookupContext): Promise<FKLookupGroup[]>;
|
|
30
|
+
/** The filter the browse and search paths apply, so a recent pick outside it stops being offered. */
|
|
31
|
+
RecentFilter(context: FKLookupContext): string;
|
|
32
|
+
/**
|
|
33
|
+
* The search API ranks across every searchable field of the related entity, so it answers only
|
|
34
|
+
* when the field opted into hybrid ranking AND the user is searching the name field — a column
|
|
35
|
+
* chosen on the scope pill needs a LIKE on that column. A field metadata marks as `Dropdown` is a
|
|
36
|
+
* small reference table the user is meant to read, and a composite key's search result is a
|
|
37
|
+
* compact key segment rather than a SQL literal to hydrate with an IN list; both take the LIKE path.
|
|
38
|
+
*/
|
|
39
|
+
protected shouldSearch(context: FKLookupContext): boolean;
|
|
40
|
+
/** The metadata + caller filters, AND-ed. Subclasses widen this. */
|
|
41
|
+
protected baseFilter(context: FKLookupContext): string;
|
|
42
|
+
/** Fields to read per row. Subclasses widen this for a second line or chips. */
|
|
43
|
+
protected fieldsFor(context: FKLookupContext): string[];
|
|
44
|
+
protected orderBy(context: FKLookupContext): string;
|
|
45
|
+
/** The empty-query list: the first `MaxRows` rows in a deliberate order. */
|
|
46
|
+
protected browse(context: FKLookupContext): Promise<FKLookupRow[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Rank through the platform search API, then hydrate the winners in search order so the
|
|
49
|
+
* dropdown has display columns. Falls back to a LIKE when search returns nothing — a server
|
|
50
|
+
* with no search index — or when the filter removes every hit it did return.
|
|
51
|
+
*/
|
|
52
|
+
protected search(context: FKLookupContext): Promise<FKLookupRow[]>;
|
|
53
|
+
private searchIds;
|
|
54
|
+
protected hydrate(context: FKLookupContext, ids: string[]): Promise<FKLookupRow[]>;
|
|
55
|
+
/** Re-impose the search API's ranking, which the hydrating view does not preserve. */
|
|
56
|
+
private orderByIds;
|
|
57
|
+
/** `LIKE` on the column the user is searching, escaped, honouring that field's own predicate. */
|
|
58
|
+
private likeSearch;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=default-fk-lookup-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-fk-lookup-strategy.d.ts","sourceRoot":"","sources":["../../../src/lib/field/default-fk-lookup-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAkB9B,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,GAAG,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,CAMzF;AAgBD;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC3D;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAK;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAM;IAEhC,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO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