@genesislcap/grid-pro 14.148.1-alpha-eef6f33.0 → 14.149.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
- dataLogoff(): void;
56
+ private dataLogoff;
57
57
  private restartSubscription;
58
58
  private getOrderByAndToBeSortedColIds;
59
59
  private handleCurrentStreamLoad;
@@ -212,6 +212,11 @@ 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
+ */
215
220
  readonly ENTITY_REFERENCE_NODE: number;
216
221
  readonly NOTATION_NODE: number;
217
222
  readonly PROCESSING_INSTRUCTION_NODE: number;
@@ -395,12 +400,6 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
395
400
  applyFuncName: string;
396
401
  applyAsyncFuncName: string;
397
402
  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;
404
403
  resourceNameChanged(oldValue: string, newValue: string): void;
405
404
  pagination: boolean;
406
405
  private indexes;
@@ -409,8 +408,8 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
409
408
  connectedCallback(): void;
410
409
  disconnectedCallback(): void;
411
410
  deepClone(): Node;
412
- deinit(): void;
413
411
  init(): void;
412
+ reset(): void;
414
413
  restart(): void;
415
414
  private clearRowData;
416
415
  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;IAE1C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2
2
  export * from './logger';
3
- export * from './map';
4
3
  export * from './sanitasations';
5
4
  //# 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,OAAO,CAAC;AACtB,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,iBAAiB,CAAC"}
@@ -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 { getAvailableIndexes, getAvailableIndexFields, logger } from '../utils';
8
+ import { logger } from '../utils';
9
9
  import { GridProBaseDatasource, StreamBaseDatasource } from './base.datasource';
10
10
  import { getColumnType, getFilterByFieldType, getFilterParamsByFieldType, } from './server-side.grid-definitions';
11
11
  /**
@@ -40,7 +40,7 @@ export class StreamDatasource extends StreamBaseDatasource {
40
40
  this.pagination = options.pagination;
41
41
  }
42
42
  getRows(params) {
43
- var _a, _b;
43
+ var _a;
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  const filterModelBeingApplied = params.request.filterModel;
46
46
  const filtersAreBeingApplied = Object.keys(filterModelBeingApplied).length > 0;
@@ -62,7 +62,6 @@ export class StreamDatasource extends StreamBaseDatasource {
62
62
  if (toBeAppliedSortModel.length !== ((_a = this.currentSortModel) === null || _a === void 0 ? void 0 : _a.length) ||
63
63
  toBeAppliedSortModel.length > 0) {
64
64
  if (toBeAppliedSortModel.length === 0 && this.currentSortModel) {
65
- this.calculatedRowsCount = 0;
66
65
  this.currentSortModel = null;
67
66
  this.resourceParams.ORDER_BY = null;
68
67
  this.resourceParams.REVERSE = null;
@@ -73,25 +72,12 @@ export class StreamDatasource extends StreamBaseDatasource {
73
72
  const coldIdBeingSorted = this.currentSortModel[0].colId; // Not allowing multiple sorts by user
74
73
  const sortTypeBeingApplied = this.currentSortModel[0].sort;
75
74
  const orderByAndToBeSortedColIds = this.getOrderByAndToBeSortedColIds(this.resourceIndexes, coldIdBeingSorted);
76
- this.calculatedRowsCount = 0;
77
- if (!orderByAndToBeSortedColIds) {
78
- const availableIndexes = getAvailableIndexes(this.resourceIndexes);
79
- const availableIndexFields = getAvailableIndexFields(this.resourceIndexes);
80
- 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/');
81
- logger.debug('Available indexes:', availableIndexes);
82
- logger.debug('Columns that can be sorted with the available indexes:', availableIndexFields);
83
- (_b = params.api) === null || _b === void 0 ? void 0 : _b.refreshServerSide({ purge: true });
84
- params.fail();
85
- return;
86
- }
87
- else {
88
- orderByAndToBeSortedColIds.toBeSorted.forEach((colId) => {
89
- this.currentSortModel.push({ sort: sortTypeBeingApplied, colId });
90
- });
91
- this.resourceParams.ORDER_BY = orderByAndToBeSortedColIds.orderBy;
92
- this.resourceParams.REVERSE = sortTypeBeingApplied === 'desc' ? true : false;
93
- this.restartSubscription();
94
- }
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();
95
81
  }
96
82
  }
97
83
  if (this.moreRows && params.request.startRow >= Number(this.maxRows)) {
@@ -122,20 +108,18 @@ export class StreamDatasource extends StreamBaseDatasource {
122
108
  this.streamSourceRef = result.SOURCE_REF;
123
109
  this.server_ROWS_COUNT = (_a = result.ROWS_COUNT) !== null && _a !== void 0 ? _a : this.rowData.size;
124
110
  }
125
- const successRowData = {
126
- rowData: Array.from(this.sortMapByNumericKey(this.rowData).values()),
127
- rowCount: this.pagination && !this.resourceParams.CRITERIA_MATCH
128
- ? Math.min(this.server_ROWS_COUNT, this.maxView)
129
- : undefined,
130
- };
131
- if (!this.moreRows &&
132
- this.client_ROWS_COUNT &&
133
- this.client_ROWS_COUNT <= this.server_ROWS_COUNT) {
111
+ if (!this.moreRows && this.server_ROWS_COUNT >= this.client_ROWS_COUNT) {
134
112
  this.calculatedRowsCount = this.client_ROWS_COUNT;
135
113
  }
136
114
  else {
137
115
  this.calculatedRowsCount += (_b = this.rowData.size) !== null && _b !== void 0 ? _b : 0;
138
116
  }
117
+ const successRowData = {
118
+ rowData: Array.from(this.sortMapByNumericKey(this.rowData).values()),
119
+ };
120
+ if (this.pagination) {
121
+ successRowData.rowCount = Math.min(this.server_ROWS_COUNT, this.maxView);
122
+ }
139
123
  if (params.request.endRow > this.maxView ||
140
124
  params.request.endRow > this.calculatedRowsCount) {
141
125
  successRowData.rowCount = this.calculatedRowsCount;
@@ -143,9 +127,6 @@ export class StreamDatasource extends StreamBaseDatasource {
143
127
  else if (params.request.endRow === this.server_ROWS_COUNT) {
144
128
  successRowData.rowCount = this.server_ROWS_COUNT;
145
129
  }
146
- else if (!this.moreRows && this.server_ROWS_COUNT >= this.client_ROWS_COUNT) {
147
- successRowData.rowCount = this.calculatedRowsCount;
148
- }
149
130
  params.success(successRowData);
150
131
  });
151
132
  });
@@ -272,7 +253,6 @@ __decorate([
272
253
  Connect
273
254
  ], StreamDatasource.prototype, "connect", void 0);
274
255
  const criteriaDelimiter = ';';
275
- const withoutColumnDefs = null;
276
256
  /**
277
257
  * A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
278
258
  * @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
@@ -286,27 +266,14 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
286
266
  this.pagination = false;
287
267
  }
288
268
  criteriaChanged(oldCriteria, newCriteria) {
289
- const criteriaIsNotDuplicate = oldCriteria !== normaliseCriteria(newCriteria, criteriaDelimiter);
290
- if (this.ssrmDatasource && criteriaIsNotDuplicate) {
291
- this.reloadResourceData();
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();
292
275
  }
293
276
  }
294
- /**
295
- * Resets the grid data while keeping columnDefs and sends a DATA_LOGOFF message if it's a stream.
296
- * @remarks This is used when the grid is already initialized and we want to reload the data due to a criteria/filter change.
297
- * @internal
298
- */
299
- reloadResourceData() {
300
- var _a, _b, _c;
301
- return __awaiter(this, void 0, void 0, function* () {
302
- this.ssrmDatasource.dataLogoff();
303
- this.clearRowData(withoutColumnDefs);
304
- this.ssrmDatasource = undefined;
305
- (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
306
- (_c = (_b = this.agGrid) === null || _b === void 0 ? void 0 : _b.gridApi) === null || _c === void 0 ? void 0 : _c.showLoadingOverlay();
307
- this.init();
308
- });
309
- }
310
277
  resourceNameChanged(oldValue, newValue) {
311
278
  if (!oldValue || oldValue === newValue)
312
279
  return;
@@ -327,7 +294,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
327
294
  DOM.queueUpdate(() => {
328
295
  if (!shouldRunDisconnect)
329
296
  return;
330
- this.deinit();
297
+ this.reset();
331
298
  });
332
299
  }
333
300
  deepClone() {
@@ -336,13 +303,6 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
336
303
  copy.deferredColumnStates = structuredClone(this.deferredColumnStates);
337
304
  return copy;
338
305
  }
339
- deinit() {
340
- var _a;
341
- this.clearRowData();
342
- this.ssrmDatasource = undefined;
343
- this.originalFieldDef = undefined;
344
- (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
345
- }
346
306
  init() {
347
307
  if (this.agGrid && this.resourceName && this.connect.isConnected) {
348
308
  this.agGrid.gridOptions = Object.assign({ getRowId: (params) => {
@@ -378,8 +338,8 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
378
338
  resourceParams: this.params,
379
339
  resourceIndexes: this.indexes,
380
340
  resourceColDefs: this.originalFieldDef,
381
- maxRows: +this.maxRows,
382
- maxView: +this.maxView,
341
+ maxRows: this.maxRows,
342
+ maxView: this.maxView,
383
343
  rowId: this.rowId,
384
344
  pagination: this.pagination,
385
345
  });
@@ -389,22 +349,25 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
389
349
  }
390
350
  logger.warn(`Application not connected, falling back to local columnDefs/rowData`);
391
351
  }
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
+ }
392
359
  restart() {
393
- this.deinit();
360
+ this.reset();
394
361
  this.init();
395
362
  }
396
- clearRowData(withColumnDefs = true) {
363
+ clearRowData() {
397
364
  var _a, _b, _c, _d;
398
- this.rowData = new Map();
399
- if (withColumnDefs) {
400
- (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.setColumnDefs([]);
401
- }
402
- this.agTransaction = { remove: [] };
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: [] };
403
367
  (_c = this.agGrid.gridApi) === null || _c === void 0 ? void 0 : _c.forEachNode((node) => {
404
- this.agTransaction.remove.push(node.data);
368
+ agTransaction.remove.push(node.data);
405
369
  });
406
- (_d = this.agGrid.gridApi) === null || _d === void 0 ? void 0 : _d.applyServerSideTransaction(this.agTransaction);
407
- this.agTransaction = undefined;
370
+ (_d = this.agGrid.gridApi) === null || _d === void 0 ? void 0 : _d.applyServerSideTransaction(agTransaction);
408
371
  }
409
372
  getResourceIndexes(avaialbleIndexes) {
410
373
  const resourceIndexesMap = new Map();
@@ -456,7 +419,6 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
456
419
  const updatedInfo = yield this.connect.snapshot(this.resourceName, {
457
420
  MAX_ROWS: 1,
458
421
  MAX_VIEW: 1,
459
- CRITERIA_MATCH: this.criteria,
460
422
  });
461
423
  this.ssrmDatasource.server_ROWS_COUNT = updatedInfo.ROWS_COUNT;
462
424
  }
@@ -1,4 +1,3 @@
1
1
  export * from './array';
2
2
  export * from './logger';
3
- export * from './map';
4
3
  export * from './sanitasations';
@@ -6879,106 +6879,6 @@
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
- },
6982
6882
  {
6983
6883
  "kind": "Variable",
6984
6884
  "canonicalReference": "@genesislcap/grid-pro!getDateEditorTemplate:var",
@@ -1023,24 +1023,6 @@ 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
-
1044
1026
  /**
1045
1027
  * Return a column type base on each field's metadata from the selected resource.
1046
1028
  * @param metadataType - The type of the field/column
@@ -2188,12 +2170,6 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
2188
2170
  applyFuncName: string;
2189
2171
  applyAsyncFuncName: string;
2190
2172
  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;
2197
2173
  resourceNameChanged(oldValue: string, newValue: string): void;
2198
2174
  pagination: boolean;
2199
2175
  private indexes;
@@ -2202,8 +2178,8 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
2202
2178
  connectedCallback(): void;
2203
2179
  disconnectedCallback(): void;
2204
2180
  deepClone(): Node;
2205
- deinit(): void;
2206
2181
  init(): void;
2182
+ reset(): void;
2207
2183
  restart(): void;
2208
2184
  private clearRowData;
2209
2185
  private getResourceIndexes;
@@ -2367,6 +2343,11 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
2367
2343
  readonly DOCUMENT_TYPE_NODE: number;
2368
2344
  readonly ELEMENT_NODE: number;
2369
2345
  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
+ */
2370
2351
  readonly ENTITY_REFERENCE_NODE: number;
2371
2352
  readonly NOTATION_NODE: number;
2372
2353
  readonly PROCESSING_INSTRUCTION_NODE: number;
@@ -2725,7 +2706,7 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
2725
2706
  constructor(options: StreamDatasourceOptions);
2726
2707
  getRows(params: IServerSideGetRowsParams): Promise<void>;
2727
2708
  private sortMapByNumericKey;
2728
- dataLogoff(): void;
2709
+ private dataLogoff;
2729
2710
  private restartSubscription;
2730
2711
  private getOrderByAndToBeSortedColIds;
2731
2712
  private handleCurrentStreamLoad;
@@ -41,8 +41,6 @@
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 |
46
44
  | [gridProColumns(itemsBinding, includeRenderers)](./grid-pro.gridprocolumns.md) | A directive that renders a set of grid-pro-column elements from a given input binding |
47
45
  | [mergeAndDedupColDefWithColumnState(colDefs, columnStates)](./grid-pro.mergeanddedupcoldefwithcolumnstate.md) | Merges two arrays, one of <code>ColDef</code> and one of <code>ColumnState</code>, and deduplicates them. |
48
46
 
@@ -723,12 +723,6 @@ 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
-
732
726
  // @alpha
733
727
  export function getColumnType(metadataType: string): string;
734
728
 
@@ -1021,8 +1015,6 @@ export class GridProServerSideDatasource extends GridProServerSideDatasource_bas
1021
1015
  // (undocumented)
1022
1016
  deepClone(): Node;
1023
1017
  // (undocumented)
1024
- deinit(): void;
1025
- // (undocumented)
1026
1018
  disconnectedCallback(): void;
1027
1019
  // (undocumented)
1028
1020
  init(): void;
@@ -1031,6 +1023,8 @@ export class GridProServerSideDatasource extends GridProServerSideDatasource_bas
1031
1023
  // (undocumented)
1032
1024
  get params(): any;
1033
1025
  // (undocumented)
1026
+ reset(): void;
1027
+ // (undocumented)
1034
1028
  resourceNameChanged(oldValue: string, newValue: string): void;
1035
1029
  // (undocumented)
1036
1030
  restart(): void;
@@ -1205,8 +1199,6 @@ export class StreamDatasource extends StreamBaseDatasource implements IServerSid
1205
1199
  // (undocumented)
1206
1200
  connect: Connect;
1207
1201
  // (undocumented)
1208
- dataLogoff(): void;
1209
- // (undocumented)
1210
1202
  dataserverStream: SocketObservable<FilteredDataServerResult>;
1211
1203
  // (undocumented)
1212
1204
  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.1-alpha-eef6f33.0",
4
+ "version": "14.149.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.1-alpha-eef6f33.0",
34
- "@genesislcap/genx": "14.148.1-alpha-eef6f33.0",
35
- "@genesislcap/rollup-builder": "14.148.1-alpha-eef6f33.0",
36
- "@genesislcap/ts-builder": "14.148.1-alpha-eef6f33.0",
37
- "@genesislcap/uvu-playwright-builder": "14.148.1-alpha-eef6f33.0",
38
- "@genesislcap/vite-builder": "14.148.1-alpha-eef6f33.0",
39
- "@genesislcap/webpack-builder": "14.148.1-alpha-eef6f33.0",
33
+ "@genesislcap/foundation-testing": "14.149.0",
34
+ "@genesislcap/genx": "14.149.0",
35
+ "@genesislcap/rollup-builder": "14.149.0",
36
+ "@genesislcap/ts-builder": "14.149.0",
37
+ "@genesislcap/uvu-playwright-builder": "14.149.0",
38
+ "@genesislcap/vite-builder": "14.149.0",
39
+ "@genesislcap/webpack-builder": "14.149.0",
40
40
  "rimraf": "^3.0.2"
41
41
  },
42
42
  "dependencies": {
43
- "@genesislcap/foundation-comms": "14.148.1-alpha-eef6f33.0",
44
- "@genesislcap/foundation-logger": "14.148.1-alpha-eef6f33.0",
45
- "@genesislcap/foundation-ui": "14.148.1-alpha-eef6f33.0",
46
- "@genesislcap/foundation-utils": "14.148.1-alpha-eef6f33.0",
43
+ "@genesislcap/foundation-comms": "14.149.0",
44
+ "@genesislcap/foundation-logger": "14.149.0",
45
+ "@genesislcap/foundation-ui": "14.149.0",
46
+ "@genesislcap/foundation-utils": "14.149.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": "27f813cf911820761f0971b5f4639ce91efc7baa"
71
+ "gitHead": "047aa2b96699838f3d333dbaccf17eec5b373c32"
72
72
  }
@@ -1,17 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,39 +0,0 @@
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
- }
@@ -1,30 +0,0 @@
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
-