@genesislcap/grid-pro 14.148.0 → 14.148.1-alpha-4b4abd1.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.
@@ -53,7 +53,7 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
53
53
  constructor(options: StreamDatasourceOptions);
54
54
  getRows(params: IServerSideGetRowsParams): Promise<void>;
55
55
  private sortMapByNumericKey;
56
- private dataLogoff;
56
+ dataLogoff(): void;
57
57
  private restartSubscription;
58
58
  private getOrderByAndToBeSortedColIds;
59
59
  private handleCurrentStreamLoad;
@@ -212,11 +212,6 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
212
212
  readonly DOCUMENT_TYPE_NODE: number;
213
213
  readonly ELEMENT_NODE: number;
214
214
  readonly ENTITY_NODE: number;
215
- /**
216
- * A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
217
- * @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
218
- * @alpha
219
- */
220
215
  readonly ENTITY_REFERENCE_NODE: number;
221
216
  readonly NOTATION_NODE: number;
222
217
  readonly PROCESSING_INSTRUCTION_NODE: number;
@@ -400,6 +395,12 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
400
395
  applyFuncName: string;
401
396
  applyAsyncFuncName: string;
402
397
  criteriaChanged(oldCriteria: string, newCriteria: string): void;
398
+ /**
399
+ * Resets the grid data while keeping columnDefs and sends a DATA_LOGOFF message if it's a stream.
400
+ * @remarks This is used when the grid is already initialized and we want to reload the data due to a criteria/filter change.
401
+ * @internal
402
+ */
403
+ private reloadResourceData;
403
404
  resourceNameChanged(oldValue: string, newValue: string): void;
404
405
  pagination: boolean;
405
406
  private indexes;
@@ -408,8 +409,8 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
408
409
  connectedCallback(): void;
409
410
  disconnectedCallback(): void;
410
411
  deepClone(): Node;
412
+ deinit(): void;
411
413
  init(): void;
412
- reset(): void;
413
414
  restart(): void;
414
415
  private clearRowData;
415
416
  private getResourceIndexes;
@@ -1 +1 @@
1
- {"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EAEnB,kBAAkB,EAClB,2BAA2B,EAG5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,IAAI,EACJ,OAAO,EAKP,wBAAwB,EAIxB,cAAc,EAGd,gBAAgB,EAEjB,MAAM,+BAA+B,CAAC;AAQvC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAOhF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAEnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,oBAAqB,YAAW,qBAAqB;IACnF,IAAI,EAAG,IAAI,CAAC;IACT,OAAO,EAAG,OAAO,CAAC;IAE3B,gBAAgB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC7D,OAAO,CAAC,YAAY,CAAS;IAC7B,cAAc,EAAE,GAAG,CAAC;IACpB,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,eAAe,CAAmB;IAE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';
2
2
  export * from './logger';
3
+ export * from './map';
3
4
  export * from './sanitasations';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Get the keys of the Metadata indexes map
3
+ * @remarks This function will return a flat string array of all the keys in the "metadata indexes" map
4
+ * @param data - the map data to have the keys extracted from
5
+ * @returns the keys of the map
6
+ * @public
7
+ */
8
+ export declare function getAvailableIndexes(data: Map<string, [string]>): string[];
9
+ /**
10
+ * Get the values of the Metadata indexes map
11
+ * @remarks This function will return a flat string array of all the values in the "metadata indexes" map
12
+ * @param data - the map data to have the values extracted from
13
+ * @returns the values of the map
14
+ * @public
15
+ */
16
+ export declare function getAvailableIndexFields(data: Map<string, [string]>): string[];
17
+ //# sourceMappingURL=map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/utils/map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,CAUzE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,CAkB7E"}
@@ -5,7 +5,7 @@ import { attr, customElement, DOM } from '@microsoft/fast-element';
5
5
  import { take } from 'rxjs/operators';
6
6
  import { dateTimeValueFormatter, dateValueFormatter } from '../grid-pro.definitions';
7
7
  import { GridProRendererTypes } from '../grid-pro.types';
8
- import { logger } from '../utils';
8
+ import { getAvailableIndexes, getAvailableIndexFields, logger } from '../utils';
9
9
  import { GridProBaseDatasource, StreamBaseDatasource } from './base.datasource';
10
10
  import { getColumnType, getFilterByFieldType, getFilterParamsByFieldType, } from './server-side.grid-definitions';
11
11
  /**
@@ -72,12 +72,21 @@ export class StreamDatasource extends StreamBaseDatasource {
72
72
  const coldIdBeingSorted = this.currentSortModel[0].colId; // Not allowing multiple sorts by user
73
73
  const sortTypeBeingApplied = this.currentSortModel[0].sort;
74
74
  const orderByAndToBeSortedColIds = this.getOrderByAndToBeSortedColIds(this.resourceIndexes, coldIdBeingSorted);
75
- orderByAndToBeSortedColIds.toBeSorted.forEach((colId) => {
76
- this.currentSortModel.push({ sort: sortTypeBeingApplied, colId });
77
- });
78
- this.resourceParams.ORDER_BY = orderByAndToBeSortedColIds.orderBy;
79
- this.resourceParams.REVERSE = sortTypeBeingApplied === 'desc' ? true : false;
80
- this.restartSubscription();
75
+ if (!orderByAndToBeSortedColIds) {
76
+ const availableIndexes = getAvailableIndexes(this.resourceIndexes);
77
+ const availableIndexFields = getAvailableIndexFields(this.resourceIndexes);
78
+ logger.warn('The FIELD/column (${coldIdBeingSorted}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/');
79
+ logger.debug('Available indexes:', availableIndexes);
80
+ logger.debug('Columns that can be sorted with the available indexes:', availableIndexFields);
81
+ }
82
+ else {
83
+ orderByAndToBeSortedColIds.toBeSorted.forEach((colId) => {
84
+ this.currentSortModel.push({ sort: sortTypeBeingApplied, colId });
85
+ });
86
+ this.resourceParams.ORDER_BY = orderByAndToBeSortedColIds.orderBy;
87
+ this.resourceParams.REVERSE = sortTypeBeingApplied === 'desc' ? true : false;
88
+ this.restartSubscription();
89
+ }
81
90
  }
82
91
  }
83
92
  if (this.moreRows && params.request.startRow >= Number(this.maxRows)) {
@@ -117,7 +126,9 @@ export class StreamDatasource extends StreamBaseDatasource {
117
126
  const successRowData = {
118
127
  rowData: Array.from(this.sortMapByNumericKey(this.rowData).values()),
119
128
  };
120
- if (this.pagination) {
129
+ if (this.pagination && !this.resourceParams.CRITERIA_MATCH) {
130
+ // TODO: Will add a PA for server team, we're at a stage where Criteria Match needs to affect ROWS_COUNT
131
+ // This will cause "pagination" scenarios to show "of more" instead of actual count, less misleading.
121
132
  successRowData.rowCount = Math.min(this.server_ROWS_COUNT, this.maxView);
122
133
  }
123
134
  if (params.request.endRow > this.maxView ||
@@ -172,6 +183,7 @@ export class StreamDatasource extends StreamBaseDatasource {
172
183
  rows.set(insertData[this.rowId], insertData);
173
184
  });
174
185
  this.rowData = rows;
186
+ this.client_ROWS_COUNT = this.rowData.size;
175
187
  }
176
188
  buildCriteriaMatchFromFilters() {
177
189
  this.resourceParams.CRITERIA_MATCH = this.originalCriteriaMatch;
@@ -253,6 +265,7 @@ __decorate([
253
265
  Connect
254
266
  ], StreamDatasource.prototype, "connect", void 0);
255
267
  const criteriaDelimiter = ';';
268
+ const withoutColumnDefs = null;
256
269
  /**
257
270
  * A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
258
271
  * @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
@@ -266,14 +279,27 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
266
279
  this.pagination = false;
267
280
  }
268
281
  criteriaChanged(oldCriteria, newCriteria) {
269
- const startingCriteria = !oldCriteria && newCriteria;
270
- const criteriaNotDuplicate = oldCriteria !== normaliseCriteria(newCriteria, criteriaDelimiter);
271
- // TODO: FUI-1323 - account for linked grid scenarios too.
272
- // TODO: check grid-pro-genesis-datasource criteriaChanged
273
- if (!startingCriteria && criteriaNotDuplicate) {
274
- this.restart();
282
+ const criteriaIsNotDuplicate = oldCriteria !== normaliseCriteria(newCriteria, criteriaDelimiter);
283
+ if (this.ssrmDatasource && criteriaIsNotDuplicate) {
284
+ this.reloadResourceData();
275
285
  }
276
286
  }
287
+ /**
288
+ * Resets the grid data while keeping columnDefs and sends a DATA_LOGOFF message if it's a stream.
289
+ * @remarks This is used when the grid is already initialized and we want to reload the data due to a criteria/filter change.
290
+ * @internal
291
+ */
292
+ reloadResourceData() {
293
+ var _a, _b, _c;
294
+ return __awaiter(this, void 0, void 0, function* () {
295
+ this.ssrmDatasource.dataLogoff();
296
+ this.clearRowData(withoutColumnDefs);
297
+ this.ssrmDatasource = undefined;
298
+ (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
299
+ (_c = (_b = this.agGrid) === null || _b === void 0 ? void 0 : _b.gridApi) === null || _c === void 0 ? void 0 : _c.showLoadingOverlay();
300
+ this.init();
301
+ });
302
+ }
277
303
  resourceNameChanged(oldValue, newValue) {
278
304
  if (!oldValue || oldValue === newValue)
279
305
  return;
@@ -294,7 +320,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
294
320
  DOM.queueUpdate(() => {
295
321
  if (!shouldRunDisconnect)
296
322
  return;
297
- this.reset();
323
+ this.deinit();
298
324
  });
299
325
  }
300
326
  deepClone() {
@@ -303,6 +329,13 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
303
329
  copy.deferredColumnStates = structuredClone(this.deferredColumnStates);
304
330
  return copy;
305
331
  }
332
+ deinit() {
333
+ var _a;
334
+ this.clearRowData();
335
+ this.ssrmDatasource = undefined;
336
+ this.originalFieldDef = undefined;
337
+ (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
338
+ }
306
339
  init() {
307
340
  if (this.agGrid && this.resourceName && this.connect.isConnected) {
308
341
  this.agGrid.gridOptions = Object.assign({ getRowId: (params) => {
@@ -338,8 +371,8 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
338
371
  resourceParams: this.params,
339
372
  resourceIndexes: this.indexes,
340
373
  resourceColDefs: this.originalFieldDef,
341
- maxRows: this.maxRows,
342
- maxView: this.maxView,
374
+ maxRows: +this.maxRows,
375
+ maxView: +this.maxView,
343
376
  rowId: this.rowId,
344
377
  pagination: this.pagination,
345
378
  });
@@ -349,25 +382,22 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
349
382
  }
350
383
  logger.warn(`Application not connected, falling back to local columnDefs/rowData`);
351
384
  }
352
- reset() {
353
- var _a;
354
- this.clearRowData();
355
- this.ssrmDatasource = undefined;
356
- this.originalFieldDef = undefined;
357
- (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
358
- }
359
385
  restart() {
360
- this.reset();
386
+ this.deinit();
361
387
  this.init();
362
388
  }
363
- clearRowData() {
389
+ clearRowData(withColumnDefs = true) {
364
390
  var _a, _b, _c, _d;
365
- (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.setColumnDefs([]);
366
- const agTransaction = { remove: [] };
391
+ this.rowData = new Map();
392
+ if (withColumnDefs) {
393
+ (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.setColumnDefs([]);
394
+ }
395
+ this.agTransaction = { remove: [] };
367
396
  (_c = this.agGrid.gridApi) === null || _c === void 0 ? void 0 : _c.forEachNode((node) => {
368
- agTransaction.remove.push(node.data);
397
+ this.agTransaction.remove.push(node.data);
369
398
  });
370
- (_d = this.agGrid.gridApi) === null || _d === void 0 ? void 0 : _d.applyServerSideTransaction(agTransaction);
399
+ (_d = this.agGrid.gridApi) === null || _d === void 0 ? void 0 : _d.applyServerSideTransaction(this.agTransaction);
400
+ this.agTransaction = undefined;
371
401
  }
372
402
  getResourceIndexes(avaialbleIndexes) {
373
403
  const resourceIndexesMap = new Map();
@@ -419,6 +449,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
419
449
  const updatedInfo = yield this.connect.snapshot(this.resourceName, {
420
450
  MAX_ROWS: 1,
421
451
  MAX_VIEW: 1,
452
+ CRITERIA_MATCH: this.criteria,
422
453
  });
423
454
  this.ssrmDatasource.server_ROWS_COUNT = updatedInfo.ROWS_COUNT;
424
455
  }
@@ -1,3 +1,4 @@
1
1
  export * from './array';
2
2
  export * from './logger';
3
+ export * from './map';
3
4
  export * from './sanitasations';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Get the keys of the Metadata indexes map
3
+ * @remarks This function will return a flat string array of all the keys in the "metadata indexes" map
4
+ * @param data - the map data to have the keys extracted from
5
+ * @returns the keys of the map
6
+ * @public
7
+ */
8
+ export function getAvailableIndexes(data) {
9
+ const availabeIndexes = [];
10
+ for (const [key] of data) {
11
+ if (key) {
12
+ availabeIndexes.push(key);
13
+ }
14
+ }
15
+ return availabeIndexes;
16
+ }
17
+ /**
18
+ * Get the values of the Metadata indexes map
19
+ * @remarks This function will return a flat string array of all the values in the "metadata indexes" map
20
+ * @param data - the map data to have the values extracted from
21
+ * @returns the values of the map
22
+ * @public
23
+ */
24
+ export function getAvailableIndexFields(data) {
25
+ const availableIndexFields = [];
26
+ function traverse(items) {
27
+ for (const item of items) {
28
+ if (item !== null) {
29
+ availableIndexFields.push(item);
30
+ }
31
+ }
32
+ }
33
+ for (const [key, value] of data) {
34
+ if (key !== null && value !== null) {
35
+ traverse(value);
36
+ }
37
+ }
38
+ return availableIndexFields;
39
+ }
@@ -6879,6 +6879,106 @@
6879
6879
  "endIndex": 6
6880
6880
  }
6881
6881
  },
6882
+ {
6883
+ "kind": "Function",
6884
+ "canonicalReference": "@genesislcap/grid-pro!getAvailableIndexes:function(1)",
6885
+ "docComment": "/**\n * Get the keys of the Metadata indexes map\n *\n * @remarks\n *\n * This function will return a flat string array of all the keys in the \"metadata indexes\" map\n *\n * @param data - the map data to have the keys extracted from\n *\n * @returns the keys of the map\n *\n * @public\n */\n",
6886
+ "excerptTokens": [
6887
+ {
6888
+ "kind": "Content",
6889
+ "text": "export declare function getAvailableIndexes(data: "
6890
+ },
6891
+ {
6892
+ "kind": "Reference",
6893
+ "text": "Map",
6894
+ "canonicalReference": "!Map:interface"
6895
+ },
6896
+ {
6897
+ "kind": "Content",
6898
+ "text": "<string, [string]>"
6899
+ },
6900
+ {
6901
+ "kind": "Content",
6902
+ "text": "): "
6903
+ },
6904
+ {
6905
+ "kind": "Content",
6906
+ "text": "string[]"
6907
+ },
6908
+ {
6909
+ "kind": "Content",
6910
+ "text": ";"
6911
+ }
6912
+ ],
6913
+ "fileUrlPath": "src/utils/map.ts",
6914
+ "returnTypeTokenRange": {
6915
+ "startIndex": 4,
6916
+ "endIndex": 5
6917
+ },
6918
+ "releaseTag": "Public",
6919
+ "overloadIndex": 1,
6920
+ "parameters": [
6921
+ {
6922
+ "parameterName": "data",
6923
+ "parameterTypeTokenRange": {
6924
+ "startIndex": 1,
6925
+ "endIndex": 3
6926
+ },
6927
+ "isOptional": false
6928
+ }
6929
+ ],
6930
+ "name": "getAvailableIndexes"
6931
+ },
6932
+ {
6933
+ "kind": "Function",
6934
+ "canonicalReference": "@genesislcap/grid-pro!getAvailableIndexFields:function(1)",
6935
+ "docComment": "/**\n * Get the values of the Metadata indexes map\n *\n * @remarks\n *\n * This function will return a flat string array of all the values in the \"metadata indexes\" map\n *\n * @param data - the map data to have the values extracted from\n *\n * @returns the values of the map\n *\n * @public\n */\n",
6936
+ "excerptTokens": [
6937
+ {
6938
+ "kind": "Content",
6939
+ "text": "export declare function getAvailableIndexFields(data: "
6940
+ },
6941
+ {
6942
+ "kind": "Reference",
6943
+ "text": "Map",
6944
+ "canonicalReference": "!Map:interface"
6945
+ },
6946
+ {
6947
+ "kind": "Content",
6948
+ "text": "<string, [string]>"
6949
+ },
6950
+ {
6951
+ "kind": "Content",
6952
+ "text": "): "
6953
+ },
6954
+ {
6955
+ "kind": "Content",
6956
+ "text": "string[]"
6957
+ },
6958
+ {
6959
+ "kind": "Content",
6960
+ "text": ";"
6961
+ }
6962
+ ],
6963
+ "fileUrlPath": "src/utils/map.ts",
6964
+ "returnTypeTokenRange": {
6965
+ "startIndex": 4,
6966
+ "endIndex": 5
6967
+ },
6968
+ "releaseTag": "Public",
6969
+ "overloadIndex": 1,
6970
+ "parameters": [
6971
+ {
6972
+ "parameterName": "data",
6973
+ "parameterTypeTokenRange": {
6974
+ "startIndex": 1,
6975
+ "endIndex": 3
6976
+ },
6977
+ "isOptional": false
6978
+ }
6979
+ ],
6980
+ "name": "getAvailableIndexFields"
6981
+ },
6882
6982
  {
6883
6983
  "kind": "Variable",
6884
6984
  "canonicalReference": "@genesislcap/grid-pro!getDateEditorTemplate:var",
@@ -1023,6 +1023,24 @@ export declare const getAgBooleanRendererTemplate: (designSystem?: string) => Vi
1023
1023
  */
1024
1024
  export declare const getAgEditableRendererTemplate: (designSystem?: string) => ViewTemplate<EditableRenderer, any>;
1025
1025
 
1026
+ /**
1027
+ * Get the keys of the Metadata indexes map
1028
+ * @remarks This function will return a flat string array of all the keys in the "metadata indexes" map
1029
+ * @param data - the map data to have the keys extracted from
1030
+ * @returns the keys of the map
1031
+ * @public
1032
+ */
1033
+ export declare function getAvailableIndexes(data: Map<string, [string]>): string[];
1034
+
1035
+ /**
1036
+ * Get the values of the Metadata indexes map
1037
+ * @remarks This function will return a flat string array of all the values in the "metadata indexes" map
1038
+ * @param data - the map data to have the values extracted from
1039
+ * @returns the values of the map
1040
+ * @public
1041
+ */
1042
+ export declare function getAvailableIndexFields(data: Map<string, [string]>): string[];
1043
+
1026
1044
  /**
1027
1045
  * Return a column type base on each field's metadata from the selected resource.
1028
1046
  * @param metadataType - The type of the field/column
@@ -2170,6 +2188,12 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
2170
2188
  applyFuncName: string;
2171
2189
  applyAsyncFuncName: string;
2172
2190
  criteriaChanged(oldCriteria: string, newCriteria: string): void;
2191
+ /**
2192
+ * Resets the grid data while keeping columnDefs and sends a DATA_LOGOFF message if it's a stream.
2193
+ * @remarks This is used when the grid is already initialized and we want to reload the data due to a criteria/filter change.
2194
+ * @internal
2195
+ */
2196
+ private reloadResourceData;
2173
2197
  resourceNameChanged(oldValue: string, newValue: string): void;
2174
2198
  pagination: boolean;
2175
2199
  private indexes;
@@ -2178,8 +2202,8 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
2178
2202
  connectedCallback(): void;
2179
2203
  disconnectedCallback(): void;
2180
2204
  deepClone(): Node;
2205
+ deinit(): void;
2181
2206
  init(): void;
2182
- reset(): void;
2183
2207
  restart(): void;
2184
2208
  private clearRowData;
2185
2209
  private getResourceIndexes;
@@ -2343,11 +2367,6 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
2343
2367
  readonly DOCUMENT_TYPE_NODE: number;
2344
2368
  readonly ELEMENT_NODE: number;
2345
2369
  readonly ENTITY_NODE: number;
2346
- /**
2347
- * A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
2348
- * @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
2349
- * @alpha
2350
- */
2351
2370
  readonly ENTITY_REFERENCE_NODE: number;
2352
2371
  readonly NOTATION_NODE: number;
2353
2372
  readonly PROCESSING_INSTRUCTION_NODE: number;
@@ -2706,7 +2725,7 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
2706
2725
  constructor(options: StreamDatasourceOptions);
2707
2726
  getRows(params: IServerSideGetRowsParams): Promise<void>;
2708
2727
  private sortMapByNumericKey;
2709
- private dataLogoff;
2728
+ dataLogoff(): void;
2710
2729
  private restartSubscription;
2711
2730
  private getOrderByAndToBeSortedColIds;
2712
2731
  private handleCurrentStreamLoad;
@@ -0,0 +1,30 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/grid-pro](./grid-pro.md) &gt; [getAvailableIndexes](./grid-pro.getavailableindexes.md)
4
+
5
+ ## getAvailableIndexes() function
6
+
7
+ Get the keys of the Metadata indexes map
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function getAvailableIndexes(data: Map<string, [string]>): string[];
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | data | Map&lt;string, \[string\]&gt; | the map data to have the keys extracted from |
20
+
21
+ **Returns:**
22
+
23
+ string\[\]
24
+
25
+ the keys of the map
26
+
27
+ ## Remarks
28
+
29
+ This function will return a flat string array of all the keys in the "metadata indexes" map
30
+
@@ -0,0 +1,30 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/grid-pro](./grid-pro.md) &gt; [getAvailableIndexFields](./grid-pro.getavailableindexfields.md)
4
+
5
+ ## getAvailableIndexFields() function
6
+
7
+ Get the values of the Metadata indexes map
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function getAvailableIndexFields(data: Map<string, [string]>): string[];
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | data | Map&lt;string, \[string\]&gt; | the map data to have the values extracted from |
20
+
21
+ **Returns:**
22
+
23
+ string\[\]
24
+
25
+ the values of the map
26
+
27
+ ## Remarks
28
+
29
+ This function will return a flat string array of all the values in the "metadata indexes" map
30
+
@@ -41,6 +41,8 @@
41
41
  | --- | --- |
42
42
  | [dateTimeValueFormatter({ value })](./grid-pro.datetimevalueformatter.md) | Returns a formatted date time value from the Grid Pro cell value. |
43
43
  | [dateValueFormatter({ value })](./grid-pro.datevalueformatter.md) | Returns a formatted date value from the Grid Pro cell value. |
44
+ | [getAvailableIndexes(data)](./grid-pro.getavailableindexes.md) | Get the keys of the Metadata indexes map |
45
+ | [getAvailableIndexFields(data)](./grid-pro.getavailableindexfields.md) | Get the values of the Metadata indexes map |
44
46
  | [gridProColumns(itemsBinding, includeRenderers)](./grid-pro.gridprocolumns.md) | A directive that renders a set of grid-pro-column elements from a given input binding |
45
47
  | [mergeAndDedupColDefWithColumnState(colDefs, columnStates)](./grid-pro.mergeanddedupcoldefwithcolumnstate.md) | Merges two arrays, one of <code>ColDef</code> and one of <code>ColumnState</code>, and deduplicates them. |
46
48
 
@@ -723,6 +723,12 @@ export const getAgBooleanRendererTemplate: (designSystem?: string) => ViewTempla
723
723
  // @public
724
724
  export const getAgEditableRendererTemplate: (designSystem?: string) => ViewTemplate<EditableRenderer, any>;
725
725
 
726
+ // @public
727
+ export function getAvailableIndexes(data: Map<string, [string]>): string[];
728
+
729
+ // @public
730
+ export function getAvailableIndexFields(data: Map<string, [string]>): string[];
731
+
726
732
  // @alpha
727
733
  export function getColumnType(metadataType: string): string;
728
734
 
@@ -1015,6 +1021,8 @@ export class GridProServerSideDatasource extends GridProServerSideDatasource_bas
1015
1021
  // (undocumented)
1016
1022
  deepClone(): Node;
1017
1023
  // (undocumented)
1024
+ deinit(): void;
1025
+ // (undocumented)
1018
1026
  disconnectedCallback(): void;
1019
1027
  // (undocumented)
1020
1028
  init(): void;
@@ -1023,8 +1031,6 @@ export class GridProServerSideDatasource extends GridProServerSideDatasource_bas
1023
1031
  // (undocumented)
1024
1032
  get params(): any;
1025
1033
  // (undocumented)
1026
- reset(): void;
1027
- // (undocumented)
1028
1034
  resourceNameChanged(oldValue: string, newValue: string): void;
1029
1035
  // (undocumented)
1030
1036
  restart(): void;
@@ -1199,6 +1205,8 @@ export class StreamDatasource extends StreamBaseDatasource implements IServerSid
1199
1205
  // (undocumented)
1200
1206
  connect: Connect;
1201
1207
  // (undocumented)
1208
+ dataLogoff(): void;
1209
+ // (undocumented)
1202
1210
  dataserverStream: SocketObservable<FilteredDataServerResult>;
1203
1211
  // (undocumented)
1204
1212
  getRows(params: IServerSideGetRowsParams): Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/grid-pro",
3
3
  "description": "Genesis Foundation AG Grid",
4
- "version": "14.148.0",
4
+ "version": "14.148.1-alpha-4b4abd1.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -30,20 +30,20 @@
30
30
  "test:debug": "genx test --debug"
31
31
  },
32
32
  "devDependencies": {
33
- "@genesislcap/foundation-testing": "14.148.0",
34
- "@genesislcap/genx": "14.148.0",
35
- "@genesislcap/rollup-builder": "14.148.0",
36
- "@genesislcap/ts-builder": "14.148.0",
37
- "@genesislcap/uvu-playwright-builder": "14.148.0",
38
- "@genesislcap/vite-builder": "14.148.0",
39
- "@genesislcap/webpack-builder": "14.148.0",
33
+ "@genesislcap/foundation-testing": "14.148.1-alpha-4b4abd1.0",
34
+ "@genesislcap/genx": "14.148.1-alpha-4b4abd1.0",
35
+ "@genesislcap/rollup-builder": "14.148.1-alpha-4b4abd1.0",
36
+ "@genesislcap/ts-builder": "14.148.1-alpha-4b4abd1.0",
37
+ "@genesislcap/uvu-playwright-builder": "14.148.1-alpha-4b4abd1.0",
38
+ "@genesislcap/vite-builder": "14.148.1-alpha-4b4abd1.0",
39
+ "@genesislcap/webpack-builder": "14.148.1-alpha-4b4abd1.0",
40
40
  "rimraf": "^3.0.2"
41
41
  },
42
42
  "dependencies": {
43
- "@genesislcap/foundation-comms": "14.148.0",
44
- "@genesislcap/foundation-logger": "14.148.0",
45
- "@genesislcap/foundation-ui": "14.148.0",
46
- "@genesislcap/foundation-utils": "14.148.0",
43
+ "@genesislcap/foundation-comms": "14.148.1-alpha-4b4abd1.0",
44
+ "@genesislcap/foundation-logger": "14.148.1-alpha-4b4abd1.0",
45
+ "@genesislcap/foundation-ui": "14.148.1-alpha-4b4abd1.0",
46
+ "@genesislcap/foundation-utils": "14.148.1-alpha-4b4abd1.0",
47
47
  "@microsoft/fast-colors": "^5.3.1",
48
48
  "@microsoft/fast-components": "^2.30.6",
49
49
  "@microsoft/fast-element": "^1.12.0",
@@ -68,5 +68,5 @@
68
68
  "access": "public"
69
69
  },
70
70
  "customElements": "dist/custom-elements.json",
71
- "gitHead": "18e7851814a2c8025b486040224ff19b84fca29b"
71
+ "gitHead": "95b4671b321824af65c6741bea4f7cabca4344e5"
72
72
  }