@memberjunction/ng-base-forms 6.1.2 → 6.2.0-edge.0
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/container/record-form-container.component.d.ts +4 -1
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +104 -69
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts +14 -1
- package/dist/lib/explorer-entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/explorer-entity-data-grid.component.js +16 -3
- 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 +151 -9
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +724 -334
- 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/isa-related-panel/isa-related-card.component.d.ts.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-card.component.js +6 -2
- 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.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +17 -0
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +65 -2
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +166 -24
- package/dist/lib/panel/collapsible-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/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
|
@@ -42,6 +42,10 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
42
42
|
ShowExportButton: boolean;
|
|
43
43
|
ShowDeleteButton: boolean;
|
|
44
44
|
ShowCompareButton: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Shows the grid's Merge button. This wrapper only re-emits
|
|
47
|
+
* {@link MergeRecordsRequested} — turn it on only where something subscribes.
|
|
48
|
+
*/
|
|
45
49
|
ShowMergeButton: boolean;
|
|
46
50
|
ShowAddToListButton: boolean;
|
|
47
51
|
ShowDuplicateSearchButton: boolean;
|
|
@@ -118,6 +122,15 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
118
122
|
AfterRowDoubleClick: EventEmitter<AfterRowDoubleClickEventArgs>;
|
|
119
123
|
AfterRowClick: EventEmitter<AfterRowClickEventArgs>;
|
|
120
124
|
AfterDataLoad: EventEmitter<AfterDataLoadEventArgs>;
|
|
125
|
+
/**
|
|
126
|
+
* Emitted when the user asks to merge the selected rows. This wrapper does not host a merge
|
|
127
|
+
* UI — setting `ShowMergeButton` without handling this leaves a button that does nothing, so
|
|
128
|
+
* a host that turns the button on must subscribe here.
|
|
129
|
+
*/
|
|
130
|
+
MergeRecordsRequested: EventEmitter<{
|
|
131
|
+
entityInfo: EntityInfo;
|
|
132
|
+
records: Record<string, unknown>[];
|
|
133
|
+
}>;
|
|
121
134
|
/** Emitted when a row is double-clicked and NavigateOnDoubleClick is true */
|
|
122
135
|
Navigate: EventEmitter<FormNavigationEvent>;
|
|
123
136
|
onRowDoubleClick(event: AfterRowDoubleClickEventArgs): void;
|
|
@@ -156,6 +169,6 @@ export declare class ExplorerEntityDataGridComponent implements AfterViewInit, O
|
|
|
156
169
|
defaultValues: Record<string, unknown>;
|
|
157
170
|
}): void;
|
|
158
171
|
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>;
|
|
172
|
+
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
173
|
}
|
|
161
174
|
//# 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,MA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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;yCAvW/F,+BAA+B;2CAA/B,+BAA+B;CA8W3C"}
|
|
@@ -62,6 +62,10 @@ export class ExplorerEntityDataGridComponent {
|
|
|
62
62
|
ShowExportButton = true;
|
|
63
63
|
ShowDeleteButton = false;
|
|
64
64
|
ShowCompareButton = false;
|
|
65
|
+
/**
|
|
66
|
+
* Shows the grid's Merge button. This wrapper only re-emits
|
|
67
|
+
* {@link MergeRecordsRequested} — turn it on only where something subscribes.
|
|
68
|
+
*/
|
|
65
69
|
ShowMergeButton = false;
|
|
66
70
|
ShowAddToListButton = false;
|
|
67
71
|
ShowDuplicateSearchButton = false;
|
|
@@ -202,6 +206,12 @@ export class ExplorerEntityDataGridComponent {
|
|
|
202
206
|
AfterRowDoubleClick = new EventEmitter();
|
|
203
207
|
AfterRowClick = new EventEmitter();
|
|
204
208
|
AfterDataLoad = new EventEmitter();
|
|
209
|
+
/**
|
|
210
|
+
* Emitted when the user asks to merge the selected rows. This wrapper does not host a merge
|
|
211
|
+
* UI — setting `ShowMergeButton` without handling this leaves a button that does nothing, so
|
|
212
|
+
* a host that turns the button on must subscribe here.
|
|
213
|
+
*/
|
|
214
|
+
MergeRecordsRequested = new EventEmitter();
|
|
205
215
|
/** Emitted when a row is double-clicked and NavigateOnDoubleClick is true */
|
|
206
216
|
Navigate = new EventEmitter();
|
|
207
217
|
onRowDoubleClick(event) {
|
|
@@ -342,9 +352,9 @@ export class ExplorerEntityDataGridComponent {
|
|
|
342
352
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.innerGrid = _t.first);
|
|
343
353
|
} }, hostVars: 2, hostBindings: function ExplorerEntityDataGridComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
344
354
|
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) {
|
|
355
|
+
} }, 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
356
|
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); });
|
|
357
|
+
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
358
|
i0.ɵɵelementEnd();
|
|
349
359
|
} if (rf & 2) {
|
|
350
360
|
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,6 +389,7 @@ export class ExplorerEntityDataGridComponent {
|
|
|
379
389
|
(AfterRowDoubleClick)="onRowDoubleClick($event)"
|
|
380
390
|
(AfterRowClick)="onRowClick($event)"
|
|
381
391
|
(AfterDataLoad)="onDataLoad($event)"
|
|
392
|
+
(MergeRecordsRequested)="MergeRecordsRequested.emit($event)"
|
|
382
393
|
(NewRecordTabRequested)="onNewRecordTabRequested($event)">
|
|
383
394
|
</mj-entity-data-grid>
|
|
384
395
|
`, host: {
|
|
@@ -435,8 +446,10 @@ export class ExplorerEntityDataGridComponent {
|
|
|
435
446
|
type: Output
|
|
436
447
|
}], AfterDataLoad: [{
|
|
437
448
|
type: Output
|
|
449
|
+
}], MergeRecordsRequested: [{
|
|
450
|
+
type: Output
|
|
438
451
|
}], Navigate: [{
|
|
439
452
|
type: Output
|
|
440
453
|
}] }); })();
|
|
441
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ExplorerEntityDataGridComponent, { className: "ExplorerEntityDataGridComponent", filePath: "src/lib/explorer-entity-data-grid.component.ts", lineNumber:
|
|
454
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ExplorerEntityDataGridComponent, { className: "ExplorerEntityDataGridComponent", filePath: "src/lib/explorer-entity-data-grid.component.ts", lineNumber: 70 }); })();
|
|
442
455
|
//# 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,2BAA2B,E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AAC,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,SAAS,EA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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;;kBAON,MAAM;;kBAGN,MAAM;;kFAhOE,+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 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 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 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"]}
|
|
@@ -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,CAAC,aAAa,EAAE,CAAC;IASvE,qGAAqG;IACrF,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;IAI9D;;;;;;OAMG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO;IASzD,oEAAoE;IACpE,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;IAKtD,gFAAgF;IAChF,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,EAAE;IAIvD,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;IAKnD,4EAA4E;cAC5D,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAYxE;;;;OAIG;cACa,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YAY1D,SAAS;cAqBP,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAaxF,sFAAsF;IACtF,OAAO,CAAC,UAAU;IAOlB,iGAAiG;YACnF,UAAU;CAkBzB"}
|
|
@@ -0,0 +1,173 @@
|
|
|
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 { RunView, } from '@memberjunction/core';
|
|
10
|
+
import { FKLookupStrategy, } from './fk-lookup-strategy';
|
|
11
|
+
import { EscapeSqlLikeValue, QuoteSqlIdList, RankByPrefix } from './fk-search-utils';
|
|
12
|
+
/** The provider as a search source, or null when this one cannot rank records. */
|
|
13
|
+
function asSearchSource(provider) {
|
|
14
|
+
const candidate = provider;
|
|
15
|
+
return typeof candidate.SearchEntity === 'function' ? candidate : null;
|
|
16
|
+
}
|
|
17
|
+
/** AND-join the non-empty fragments, each parenthesized so precedence survives. */
|
|
18
|
+
export function CombineFilters(...parts) {
|
|
19
|
+
return parts
|
|
20
|
+
.map(p => (p ?? '').trim())
|
|
21
|
+
.filter(p => p.length > 0)
|
|
22
|
+
.map(p => `(${p})`)
|
|
23
|
+
.join(' AND ');
|
|
24
|
+
}
|
|
25
|
+
/** `LIKE` pattern for one field, honouring the field's own `UserSearchPredicateAPI`. */
|
|
26
|
+
function buildLikePattern(predicate, escaped) {
|
|
27
|
+
switch ((predicate ?? '').trim().toLowerCase()) {
|
|
28
|
+
case 'beginswith':
|
|
29
|
+
return `'${escaped}%'`;
|
|
30
|
+
case 'endswith':
|
|
31
|
+
return `'%${escaped}'`;
|
|
32
|
+
case 'exact':
|
|
33
|
+
return `'${escaped}'`;
|
|
34
|
+
default:
|
|
35
|
+
return `'%${escaped}%'`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The stock lookup: browse by name for the empty query; for a typed one, an escaped `LIKE` on the
|
|
40
|
+
* column the user is searching, prefix matches first. The field's `RelatedEntityFilter` and the
|
|
41
|
+
* `[FKExtraFilter]` input apply to both, in SQL. `{ SearchMode: 'hybrid' }` in `[FKLookupOptions]`
|
|
42
|
+
* ranks through the platform search API instead and hydrates the winners in search order.
|
|
43
|
+
*
|
|
44
|
+
* Subclass it rather than {@link FKLookupStrategy} when an app wants MJ's querying but its own
|
|
45
|
+
* grouping or decoration — `fieldsFor` and `baseFilter` are the hooks for that.
|
|
46
|
+
*/
|
|
47
|
+
export class DefaultFKLookupStrategy extends FKLookupStrategy {
|
|
48
|
+
/**
|
|
49
|
+
* `SearchEntity` takes no filter, so the metadata filter can only be applied when hydrating the
|
|
50
|
+
* IDs it returned. Over-fetch so a filter that removes most of the matches still leaves a usable
|
|
51
|
+
* list; when it removes all of them the LIKE path, which filters in SQL, answers instead.
|
|
52
|
+
*/
|
|
53
|
+
static SEARCH_OVERFETCH = 4;
|
|
54
|
+
static SEARCH_MIN_TOPK = 25;
|
|
55
|
+
async Lookup(context) {
|
|
56
|
+
const rows = !context.Query.trim()
|
|
57
|
+
? await this.browse(context)
|
|
58
|
+
: this.shouldSearch(context)
|
|
59
|
+
? await this.search(context)
|
|
60
|
+
: await this.likeSearch(context);
|
|
61
|
+
return [{ Key: 'results', Label: null, Rows: rows }];
|
|
62
|
+
}
|
|
63
|
+
/** The filter the browse and search paths apply, so a recent pick outside it stops being offered. */
|
|
64
|
+
RecentFilter(context) {
|
|
65
|
+
return this.baseFilter(context);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The search API ranks across every searchable field of the related entity, so it answers only
|
|
69
|
+
* when the field opted into hybrid ranking AND the user is searching the name field — a column
|
|
70
|
+
* chosen on the scope pill needs a LIKE on that column. A field metadata marks as `Dropdown` is a
|
|
71
|
+
* small reference table the user is meant to read, and a composite key's search result is a
|
|
72
|
+
* compact key segment rather than a SQL literal to hydrate with an IN list; both take the LIKE path.
|
|
73
|
+
*/
|
|
74
|
+
shouldSearch(context) {
|
|
75
|
+
return (context.Options['SearchMode'] === 'hybrid' &&
|
|
76
|
+
context.SearchField === context.NameField &&
|
|
77
|
+
context.FieldInfo.RelatedEntityDisplayType !== 'Dropdown' &&
|
|
78
|
+
context.RelatedEntity.PrimaryKeys.length === 1);
|
|
79
|
+
}
|
|
80
|
+
/** The metadata + caller filters, AND-ed. Subclasses widen this. */
|
|
81
|
+
baseFilter(context) {
|
|
82
|
+
const fromInput = typeof context.Options['ExtraFilter'] === 'string' ? context.Options['ExtraFilter'] : '';
|
|
83
|
+
return CombineFilters(context.FieldInfo.RelatedEntityFilter, fromInput);
|
|
84
|
+
}
|
|
85
|
+
/** Fields to read per row. Subclasses widen this for a second line or chips. */
|
|
86
|
+
fieldsFor(context) {
|
|
87
|
+
return context.Fields;
|
|
88
|
+
}
|
|
89
|
+
orderBy(context) {
|
|
90
|
+
const fromInput = typeof context.Options['OrderBy'] === 'string' ? context.Options['OrderBy'] : '';
|
|
91
|
+
return fromInput || context.FieldInfo.RelatedEntityOrderBy || `[${context.NameField}]`;
|
|
92
|
+
}
|
|
93
|
+
/** The empty-query list: the first `MaxRows` rows in a deliberate order. */
|
|
94
|
+
async browse(context) {
|
|
95
|
+
const result = await RunView.FromMetadataProvider(context.Provider).RunView({
|
|
96
|
+
EntityName: context.RelatedEntity.Name,
|
|
97
|
+
ExtraFilter: this.baseFilter(context),
|
|
98
|
+
OrderBy: this.orderBy(context),
|
|
99
|
+
MaxRows: context.MaxRows,
|
|
100
|
+
ResultType: 'simple',
|
|
101
|
+
Fields: this.fieldsFor(context),
|
|
102
|
+
});
|
|
103
|
+
return result.Success ? result.Results.map(Values => ({ Values })) : [];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Rank through the platform search API, then hydrate the winners in search order so the
|
|
107
|
+
* dropdown has display columns. Falls back to a LIKE when search returns nothing — a server
|
|
108
|
+
* with no search index — or when the filter removes every hit it did return.
|
|
109
|
+
*/
|
|
110
|
+
async search(context) {
|
|
111
|
+
const ids = await this.searchIds(context);
|
|
112
|
+
if (ids.length === 0) {
|
|
113
|
+
return this.likeSearch(context);
|
|
114
|
+
}
|
|
115
|
+
const rows = await this.hydrate(context, ids);
|
|
116
|
+
if (rows.length === 0) {
|
|
117
|
+
return this.likeSearch(context);
|
|
118
|
+
}
|
|
119
|
+
return this.orderByIds(rows, ids, context.PkField).slice(0, context.MaxRows);
|
|
120
|
+
}
|
|
121
|
+
async searchIds(context) {
|
|
122
|
+
const source = asSearchSource(context.Provider);
|
|
123
|
+
if (!source)
|
|
124
|
+
return [];
|
|
125
|
+
const topK = Math.max(context.MaxRows * DefaultFKLookupStrategy.SEARCH_OVERFETCH, DefaultFKLookupStrategy.SEARCH_MIN_TOPK);
|
|
126
|
+
try {
|
|
127
|
+
const results = await source.SearchEntity({
|
|
128
|
+
entityName: context.RelatedEntity.Name,
|
|
129
|
+
searchText: context.Query.trim(),
|
|
130
|
+
options: { mode: 'hybrid', topK },
|
|
131
|
+
});
|
|
132
|
+
return results.map(r => r.recordId);
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// A server without the search resolver, or an entity with no searchable fields. The LIKE
|
|
136
|
+
// fallback covers both; a failed dropdown lookup is not worth surfacing to the user.
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async hydrate(context, ids) {
|
|
141
|
+
const result = await RunView.FromMetadataProvider(context.Provider).RunView({
|
|
142
|
+
EntityName: context.RelatedEntity.Name,
|
|
143
|
+
ExtraFilter: CombineFilters(`[${context.PkField}] IN (${QuoteSqlIdList(ids)})`, this.baseFilter(context)),
|
|
144
|
+
ResultType: 'simple',
|
|
145
|
+
Fields: this.fieldsFor(context),
|
|
146
|
+
});
|
|
147
|
+
return result.Success ? result.Results.map(Values => ({ Values })) : [];
|
|
148
|
+
}
|
|
149
|
+
/** Re-impose the search API's ranking, which the hydrating view does not preserve. */
|
|
150
|
+
orderByIds(rows, ids, pkField) {
|
|
151
|
+
const rank = new Map(ids.map((id, i) => [id.trim().toLowerCase(), i]));
|
|
152
|
+
const rankOf = (row) => rank.get(String(row.Values[pkField] ?? '').trim().toLowerCase()) ?? ids.length;
|
|
153
|
+
return [...rows].sort((a, b) => rankOf(a) - rankOf(b));
|
|
154
|
+
}
|
|
155
|
+
/** `LIKE` on the column the user is searching, escaped, honouring that field's own predicate. */
|
|
156
|
+
async likeSearch(context) {
|
|
157
|
+
const searchField = context.SearchField || context.NameField;
|
|
158
|
+
const field = context.RelatedEntity.Fields.find(f => f.Name === searchField);
|
|
159
|
+
const pattern = buildLikePattern(field?.UserSearchPredicateAPI ?? null, EscapeSqlLikeValue(context.Query.trim()));
|
|
160
|
+
const result = await RunView.FromMetadataProvider(context.Provider).RunView({
|
|
161
|
+
EntityName: context.RelatedEntity.Name,
|
|
162
|
+
ExtraFilter: CombineFilters(`[${searchField}] LIKE ${pattern}`, this.baseFilter(context)),
|
|
163
|
+
OrderBy: `[${searchField}]`,
|
|
164
|
+
MaxRows: context.MaxRows,
|
|
165
|
+
ResultType: 'simple',
|
|
166
|
+
Fields: this.fieldsFor(context),
|
|
167
|
+
});
|
|
168
|
+
if (!result.Success)
|
|
169
|
+
return [];
|
|
170
|
+
return RankByPrefix(result.Results.map(Values => ({ Values })), context.Query, searchField);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=default-fk-lookup-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-fk-lookup-strategy.js","sourceRoot":"","sources":["../../../src/lib/field/default-fk-lookup-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,OAAO,GAIR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,GAIjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWrF,kFAAkF;AAClF,SAAS,cAAc,CAAC,QAA2B;IACjD,MAAM,SAAS,GAAG,QAAiC,CAAC;IACpD,OAAO,OAAO,SAAS,CAAC,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,GAAG,KAA+C;IAC/E,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;SAClB,IAAI,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC;AAED,w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C,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC9F,CAAC","sourcesContent":["/**\n * MJ's own rows for a foreign-key dropdown — the behaviour every field gets when no\n * {@link FKLookupStrategy} is registered for it.\n *\n * What this replaces: one `RunView` with `[<name>] LIKE '%<typed>%'`, no `OrderBy`, twenty rows.\n * On a large related entity that is twenty arbitrary records containing the letters typed, with\n * `%` and `_` acting as live wildcards.\n */\n\nimport {\n RunView,\n type EntitySearchResult,\n type IMetadataProvider,\n type SearchEntityParams,\n} from '@memberjunction/core';\nimport {\n FKLookupStrategy,\n type FKLookupContext,\n type FKLookupGroup,\n type FKLookupRow,\n} from './fk-lookup-strategy';\nimport { EscapeSqlLikeValue, QuoteSqlIdList, RankByPrefix } from './fk-search-utils';\n\n/**\n * A provider that can rank records through the platform search API. `SearchEntity` lives on\n * `IRunViewProvider`, which every shipped provider implements alongside `IMetadataProvider` —\n * but the field only ever holds the metadata half, so narrow before using it.\n */\ntype SearchCapableProvider = IMetadataProvider & {\n SearchEntity(params: SearchEntityParams): Promise<EntitySearchResult[]>;\n};\n\n/** The provider as a search source, or null when this one cannot rank records. */\nfunction asSearchSource(provider: IMetadataProvider): SearchCapableProvider | null {\n const candidate = provider as SearchCapableProvider;\n return typeof candidate.SearchEntity === 'function' ? candidate : null;\n}\n\n/** AND-join the non-empty fragments, each parenthesized so precedence survives. */\nexport function CombineFilters(...parts: ReadonlyArray<string | null | undefined>): string {\n return parts\n .map(p => (p ?? '').trim())\n .filter(p => p.length > 0)\n .map(p => `(${p})`)\n .join(' AND ');\n}\n\n/** `LIKE` pattern for one field, honouring the field's own `UserSearchPredicateAPI`. */\nfunction buildLikePattern(predicate: string | null, escaped: string): string {\n switch ((predicate ?? '').trim().toLowerCase()) {\n case 'beginswith':\n return `'${escaped}%'`;\n case 'endswith':\n return `'%${escaped}'`;\n case 'exact':\n return `'${escaped}'`;\n default:\n return `'%${escaped}%'`;\n }\n}\n\n/**\n * The stock lookup: browse by name for the empty query; for a typed one, an escaped `LIKE` on the\n * column the user is searching, prefix matches first. The field's `RelatedEntityFilter` and the\n * `[FKExtraFilter]` input apply to both, in SQL. `{ SearchMode: 'hybrid' }` in `[FKLookupOptions]`\n * ranks through the platform search API instead and hydrates the winners in search order.\n *\n * Subclass it rather than {@link FKLookupStrategy} when an app wants MJ's querying but its own\n * grouping or decoration — `fieldsFor` and `baseFilter` are the hooks for that.\n */\nexport class DefaultFKLookupStrategy extends FKLookupStrategy {\n /**\n * `SearchEntity` takes no filter, so the metadata filter can only be applied when hydrating the\n * IDs it returned. Over-fetch so a filter that removes most of the matches still leaves a usable\n * list; when it removes all of them the LIKE path, which filters in SQL, answers instead.\n */\n private static readonly SEARCH_OVERFETCH = 4;\n private static readonly SEARCH_MIN_TOPK = 25;\n\n public async Lookup(context: FKLookupContext): Promise<FKLookupGroup[]> {\n const rows = !context.Query.trim()\n ? await this.browse(context)\n : this.shouldSearch(context)\n ? await this.search(context)\n : await this.likeSearch(context);\n return [{ Key: 'results', Label: null, Rows: rows }];\n }\n\n /** The filter the browse and search paths apply, so a recent pick outside it stops being offered. */\n public override RecentFilter(context: FKLookupContext): string {\n return this.baseFilter(context);\n }\n\n /**\n * The search API ranks across every searchable field of the related entity, so it answers only\n * when the field opted into hybrid ranking AND the user is searching the name field — a column\n * chosen on the scope pill needs a LIKE on that column. A field metadata marks as `Dropdown` is a\n * small reference table the user is meant to read, and a composite key's search result is a\n * compact key segment rather than a SQL literal to hydrate with an IN list; both take the LIKE path.\n */\n protected shouldSearch(context: FKLookupContext): boolean {\n return (\n context.Options['SearchMode'] === 'hybrid' &&\n context.SearchField === context.NameField &&\n context.FieldInfo.RelatedEntityDisplayType !== 'Dropdown' &&\n context.RelatedEntity.PrimaryKeys.length === 1\n );\n }\n\n /** The metadata + caller filters, AND-ed. Subclasses widen this. */\n protected baseFilter(context: FKLookupContext): string {\n const fromInput = typeof context.Options['ExtraFilter'] === 'string' ? context.Options['ExtraFilter'] : '';\n return CombineFilters(context.FieldInfo.RelatedEntityFilter, fromInput);\n }\n\n /** Fields to read per row. Subclasses widen this for a second line or chips. */\n protected fieldsFor(context: FKLookupContext): string[] {\n return context.Fields;\n }\n\n protected orderBy(context: FKLookupContext): string {\n const fromInput = typeof context.Options['OrderBy'] === 'string' ? context.Options['OrderBy'] : '';\n return fromInput || context.FieldInfo.RelatedEntityOrderBy || `[${context.NameField}]`;\n }\n\n /** The empty-query list: the first `MaxRows` rows in a deliberate order. */\n protected async browse(context: FKLookupContext): Promise<FKLookupRow[]> {\n const result = await RunView.FromMetadataProvider(context.Provider).RunView<Record<string, unknown>>({\n EntityName: context.RelatedEntity.Name,\n ExtraFilter: this.baseFilter(context),\n OrderBy: this.orderBy(context),\n MaxRows: context.MaxRows,\n ResultType: 'simple',\n Fields: this.fieldsFor(context),\n });\n return result.Success ? result.Results.map(Values => ({ Values })) : [];\n }\n\n /**\n * Rank through the platform search API, then hydrate the winners in search order so the\n * dropdown has display columns. Falls back to a LIKE when search returns nothing — a server\n * with no search index — or when the filter removes every hit it did return.\n */\n protected async search(context: FKLookupContext): Promise<FKLookupRow[]> {\n const ids = await this.searchIds(context);\n if (ids.length === 0) {\n return this.likeSearch(context);\n }\n const rows = await this.hydrate(context, ids);\n if (rows.length === 0) {\n return this.likeSearch(context);\n }\n return this.orderByIds(rows, ids, context.PkField).slice(0, context.MaxRows);\n }\n\n private async searchIds(context: FKLookupContext): Promise<string[]> {\n const source = asSearchSource(context.Provider);\n if (!source) return [];\n const topK = Math.max(\n context.MaxRows * DefaultFKLookupStrategy.SEARCH_OVERFETCH,\n DefaultFKLookupStrategy.SEARCH_MIN_TOPK\n );\n try {\n const results: EntitySearchResult[] = await source.SearchEntity({\n entityName: context.RelatedEntity.Name,\n searchText: context.Query.trim(),\n options: { mode: 'hybrid', topK },\n });\n return results.map(r => r.recordId);\n } catch {\n // A server without the search resolver, or an entity with no searchable fields. The LIKE\n // fallback covers both; a failed dropdown lookup is not worth surfacing to the user.\n return [];\n }\n }\n\n protected async hydrate(context: FKLookupContext, ids: string[]): Promise<FKLookupRow[]> {\n const result = await RunView.FromMetadataProvider(context.Provider).RunView<Record<string, unknown>>({\n EntityName: context.RelatedEntity.Name,\n ExtraFilter: CombineFilters(\n `[${context.PkField}] IN (${QuoteSqlIdList(ids)})`,\n this.baseFilter(context)\n ),\n ResultType: 'simple',\n Fields: this.fieldsFor(context),\n });\n return result.Success ? result.Results.map(Values => ({ Values })) : [];\n }\n\n /** Re-impose the search API's ranking, which the hydrating view does not preserve. */\n private orderByIds(rows: FKLookupRow[], ids: string[], pkField: string): FKLookupRow[] {\n const rank = new Map(ids.map((id, i) => [id.trim().toLowerCase(), i]));\n const rankOf = (row: FKLookupRow): number =>\n rank.get(String(row.Values[pkField] ?? '').trim().toLowerCase()) ?? ids.length;\n return [...rows].sort((a, b) => rankOf(a) - rankOf(b));\n }\n\n /** `LIKE` on the column the user is searching, escaped, honouring that field's own predicate. */\n private async likeSearch(context: FKLookupContext): Promise<FKLookupRow[]> {\n const searchField = context.SearchField || context.NameField;\n const field = context.RelatedEntity.Fields.find(f => f.Name === searchField);\n const pattern = buildLikePattern(\n field?.UserSearchPredicateAPI ?? null,\n EscapeSqlLikeValue(context.Query.trim())\n );\n const result = await RunView.FromMetadataProvider(context.Provider).RunView<Record<string, unknown>>({\n EntityName: context.RelatedEntity.Name,\n ExtraFilter: CombineFilters(`[${searchField}] LIKE ${pattern}`, this.baseFilter(context)),\n OrderBy: `[${searchField}]`,\n MaxRows: context.MaxRows,\n ResultType: 'simple',\n Fields: this.fieldsFor(context),\n });\n if (!result.Success) return [];\n return RankByPrefix(result.Results.map(Values => ({ Values })), context.Query, searchField);\n }\n}\n"]}
|