@genesislcap/grid-tabulator 14.101.2

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.
Files changed (70) hide show
  1. package/README.md +8 -0
  2. package/custom-elements-manifest.config.js +14 -0
  3. package/dist/custom-elements.json +1956 -0
  4. package/dist/dts/cell/index.d.ts +2 -0
  5. package/dist/dts/cell/index.d.ts.map +1 -0
  6. package/dist/dts/cell-renderers/index.d.ts +2 -0
  7. package/dist/dts/cell-renderers/index.d.ts.map +1 -0
  8. package/dist/dts/column/index.d.ts +2 -0
  9. package/dist/dts/column/index.d.ts.map +1 -0
  10. package/dist/dts/datasource/client-side.datasource.d.ts +472 -0
  11. package/dist/dts/datasource/client-side.datasource.d.ts.map +1 -0
  12. package/dist/dts/datasource/index.d.ts +2 -0
  13. package/dist/dts/datasource/index.d.ts.map +1 -0
  14. package/dist/dts/external/fonts.d.ts +7 -0
  15. package/dist/dts/external/fonts.d.ts.map +1 -0
  16. package/dist/dts/external/index.d.ts +4 -0
  17. package/dist/dts/external/index.d.ts.map +1 -0
  18. package/dist/dts/external/tabulator-theme-simple-css.d.ts +2 -0
  19. package/dist/dts/external/tabulator-theme-simple-css.d.ts.map +1 -0
  20. package/dist/dts/grid-tabulator.components.d.ts +16 -0
  21. package/dist/dts/grid-tabulator.components.d.ts.map +1 -0
  22. package/dist/dts/grid-tabulator.d.ts +397 -0
  23. package/dist/dts/grid-tabulator.d.ts.map +1 -0
  24. package/dist/dts/grid-tabulator.definitions.d.ts +7 -0
  25. package/dist/dts/grid-tabulator.definitions.d.ts.map +1 -0
  26. package/dist/dts/grid-tabulator.styles.d.ts +3 -0
  27. package/dist/dts/grid-tabulator.styles.d.ts.map +1 -0
  28. package/dist/dts/grid-tabulator.template.d.ts +3 -0
  29. package/dist/dts/grid-tabulator.template.d.ts.map +1 -0
  30. package/dist/dts/grid-tabulator.types.d.ts +26 -0
  31. package/dist/dts/grid-tabulator.types.d.ts.map +1 -0
  32. package/dist/dts/index.d.ts +14 -0
  33. package/dist/dts/index.d.ts.map +1 -0
  34. package/dist/dts/index.federated.d.ts +1 -0
  35. package/dist/dts/index.federated.d.ts.map +1 -0
  36. package/dist/dts/style/colors.d.ts +2 -0
  37. package/dist/dts/style/colors.d.ts.map +1 -0
  38. package/dist/dts/style/index.d.ts +3 -0
  39. package/dist/dts/style/index.d.ts.map +1 -0
  40. package/dist/dts/style/tokens.d.ts +2 -0
  41. package/dist/dts/style/tokens.d.ts.map +1 -0
  42. package/dist/dts/utils/index.d.ts +2 -0
  43. package/dist/dts/utils/index.d.ts.map +1 -0
  44. package/dist/dts/utils/logger.d.ts +2 -0
  45. package/dist/dts/utils/logger.d.ts.map +1 -0
  46. package/dist/esm/cell/index.js +1 -0
  47. package/dist/esm/cell-renderers/index.js +1 -0
  48. package/dist/esm/column/index.js +1 -0
  49. package/dist/esm/datasource/client-side.datasource.js +526 -0
  50. package/dist/esm/datasource/index.js +1 -0
  51. package/dist/esm/external/fonts.js +16 -0
  52. package/dist/esm/external/index.js +6 -0
  53. package/dist/esm/external/tabulator-theme-simple-css.js +1379 -0
  54. package/dist/esm/grid-tabulator.components.js +29 -0
  55. package/dist/esm/grid-tabulator.definitions.js +77 -0
  56. package/dist/esm/grid-tabulator.js +192 -0
  57. package/dist/esm/grid-tabulator.styles.js +14 -0
  58. package/dist/esm/grid-tabulator.template.js +6 -0
  59. package/dist/esm/grid-tabulator.types.js +77 -0
  60. package/dist/esm/index.federated.js +1 -0
  61. package/dist/esm/index.js +13 -0
  62. package/dist/esm/style/colors.js +3 -0
  63. package/dist/esm/style/index.js +2 -0
  64. package/dist/esm/style/tokens.js +4 -0
  65. package/dist/esm/utils/index.js +1 -0
  66. package/dist/esm/utils/logger.js +2 -0
  67. package/externals.js +5 -0
  68. package/genx.config.ts +14 -0
  69. package/license.txt +46 -0
  70. package/package.json +63 -0
@@ -0,0 +1,526 @@
1
+ import { __awaiter, __decorate } from "tslib";
2
+ import { Auth, Connect, dataServerResultFilter, Datasource, DatasourceDefaults, MessageType, normaliseCriteria, ResourceType, } from '@genesislcap/foundation-comms';
3
+ import { LifecycleMixin } from '@genesislcap/foundation-utils';
4
+ import { attr, customElement, DOM, observable } from '@microsoft/fast-element';
5
+ import { FoundationElement } from '@microsoft/fast-foundation';
6
+ import { BehaviorSubject } from 'rxjs';
7
+ import { debounceTime, skip, tap } from 'rxjs/operators';
8
+ import { logger } from '../utils/logger';
9
+ const criteriaDelimiter = ';';
10
+ const criteriaJoin = ' && ';
11
+ const withoutFullInit = null;
12
+ const withoutColumnDefs = null;
13
+ /**
14
+ * The Genesis Datasource element, for client-side data fetching and used exclusively by the GridTabulator element.
15
+ * @alpha
16
+ */
17
+ let GridTabulatorClientSideDatasource = class GridTabulatorClientSideDatasource extends LifecycleMixin(FoundationElement) {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.isSnapshot = false;
21
+ this.maxRows = DatasourceDefaults.MAX_ROWS_250;
22
+ this.maxView = DatasourceDefaults.MAX_VIEW_1000;
23
+ this.pollingInterval = DatasourceDefaults.REQ_REP_POLLING_INTERVAL_MS;
24
+ this.movingView = false;
25
+ this.reverse = false;
26
+ this.restartOnReconnection = false;
27
+ this.isRequestServer = false;
28
+ this.requiresFullRowDataAndColDefs = true;
29
+ this.dataSubWasLoggedOff = false;
30
+ this.rows = new Map();
31
+ this.criteriaFromFilters = new Map();
32
+ this.update = new BehaviorSubject(new Map());
33
+ }
34
+ criteriaChanged(oldCriteria, newCriteria) {
35
+ const criteriaIsNotDuplicate = oldCriteria !== normaliseCriteria(newCriteria, criteriaDelimiter);
36
+ if (this.datasource.initialized && criteriaIsNotDuplicate) {
37
+ this.reloadResourceData();
38
+ }
39
+ }
40
+ resourceNameChanged(oldValue, newValue) {
41
+ if (!oldValue || oldValue === newValue)
42
+ return;
43
+ this.restart();
44
+ }
45
+ connectedCallback() {
46
+ super.connectedCallback();
47
+ const shouldRunConnect = this.shouldRunConnect;
48
+ DOM.queueUpdate(() => {
49
+ if (!shouldRunConnect)
50
+ return;
51
+ this.init();
52
+ });
53
+ this.connectionSub = this.connect.isConnected$.subscribe((isConnected) => {
54
+ var _a;
55
+ if (isConnected && ((_a = this.gridTabulator) === null || _a === void 0 ? void 0 : _a.attributes['ds-disconnected'])) {
56
+ this.gridTabulator.removeAttribute('ds-disconnected');
57
+ if (this.restartOnReconnection) {
58
+ this.reloadResourceData();
59
+ }
60
+ }
61
+ if (!isConnected) {
62
+ this.gridTabulator.setAttribute('ds-disconnected', 'ds-disconnected');
63
+ }
64
+ });
65
+ }
66
+ disconnectedCallback() {
67
+ super.disconnectedCallback();
68
+ const shouldRunDisconnect = this.shouldRunDisconnect;
69
+ DOM.queueUpdate(() => {
70
+ if (!shouldRunDisconnect)
71
+ return;
72
+ this.deinit();
73
+ });
74
+ }
75
+ deepClone() {
76
+ const copy = super.deepClone();
77
+ copy.request = structuredClone(this.request);
78
+ return copy;
79
+ }
80
+ get gridTabulator() {
81
+ return this.parentElement;
82
+ }
83
+ // Genesis Specific
84
+ /**
85
+ * Returns the row id attribute, depending on the resource type.
86
+ * @remarks Will favour the `row-id` attribute if set.
87
+ * @internal
88
+ */
89
+ get rowId() {
90
+ if (this.rowIdAttr)
91
+ return this.rowIdAttr;
92
+ if (this.isRequestServer)
93
+ return DatasourceDefaults.REQUEST_SERVER_ROW_ID;
94
+ return DatasourceDefaults.DATASERVER_ROW_ID;
95
+ }
96
+ /**
97
+ * Initializes the datasource.
98
+ * @public
99
+ * @remarks This method is called automatically when the element is connected to the DOM.
100
+ */
101
+ init() {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ if (this.gridTabulator &&
104
+ this.datasource.validResourceName(this.resourceName) &&
105
+ this.connect.isConnected) {
106
+ const meta = yield this.connect.getMetadata(this.resourceName);
107
+ this.isRequestServer = meta.TYPE === ResourceType.REQUEST_SERVER;
108
+ const gridOptions = Object.assign({ index: this.rowId,
109
+ // getRowId: (params) => params.data[this.rowId],
110
+ layout: 'fitDataFill',
111
+ // responsiveLayout: 'hide', // hide columns that dont fit on the table
112
+ addRowPos: 'top',
113
+ // history: true, // allow undo and redo actions on the table
114
+ movableColumns: true, height: '100%', renderHorizontal: 'virtual',
115
+ // columnDefaults: {
116
+ // tooltip: true, // show tool tips on cells
117
+ // },
118
+ autoColumns: true, rowContextMenu: [
119
+ {
120
+ label: 'Download CSV',
121
+ action: (e, column) => {
122
+ this.gridTabulator.grid.download('csv', `${this.resourceName}.csv`);
123
+ },
124
+ },
125
+ ], popupContainer: false }, this.deferredGridOptions);
126
+ this.gridTabulator.gridOptions = gridOptions;
127
+ const filterDebounceTime = 600;
128
+ this.updateSub = this.update
129
+ .pipe(skip(1), debounceTime(filterDebounceTime), tap((f) => logger.debug('filters (debounced): ', f)))
130
+ .subscribe((_) => {
131
+ this.reloadResourceData();
132
+ });
133
+ return;
134
+ }
135
+ logger.warn(`Application not connected, falling back to local columnDefs/rowData`);
136
+ });
137
+ }
138
+ /**
139
+ * Deinitialises the datasource, resetting it to its initial state.
140
+ * @public
141
+ */
142
+ deinit() {
143
+ this.reset();
144
+ }
145
+ /**
146
+ * Resets the datasource to its initial state.
147
+ * @public
148
+ * @deprecated Use `deinit` instead
149
+ */
150
+ reset() {
151
+ if (this.dataSub) {
152
+ this.dataSub.unsubscribe();
153
+ this.dataSub = undefined;
154
+ }
155
+ if (this.updateSub) {
156
+ this.updateSub.unsubscribe();
157
+ this.updateSub = undefined;
158
+ }
159
+ if (this.connectionSub) {
160
+ this.connectionSub.unsubscribe();
161
+ this.connectionSub = undefined;
162
+ }
163
+ this.dataLogoff();
164
+ this.clearRowData();
165
+ this.isRequestServer = false;
166
+ this.requiresFullRowDataAndColDefs = true;
167
+ this.dataSubWasLoggedOff = false;
168
+ this.criteriaFromFilters = new Map();
169
+ this.update = new BehaviorSubject(new Map());
170
+ this.datasource.deinit();
171
+ }
172
+ /**
173
+ * Restarts the datasource, uses `deinit` and `init` in sequence.
174
+ * @public
175
+ */
176
+ restart() {
177
+ this.deinit();
178
+ this.init();
179
+ }
180
+ /**
181
+ * Force the grid to redispatch the current rows
182
+ */
183
+ refreshRows() {
184
+ this.setRowData(Array.from(this.rows.values()));
185
+ }
186
+ /**
187
+ * Sends a DATA_LOGOFF when the resource is an active stream
188
+ * @remarks Will only happen for streaming DATASERER resources.
189
+ * @internal
190
+ */
191
+ dataLogoff() {
192
+ const shouldPerformDataLogoff = this.sourceRef && !this.isRequestServer && !this.isSnapshot;
193
+ if (shouldPerformDataLogoff && this.auth.isLoggedIn) {
194
+ this.connect.dataLogoff(this.sourceRef);
195
+ }
196
+ this.sourceRef = undefined;
197
+ }
198
+ /**
199
+ * Clears the rowData and columnDefs for the grid.
200
+ * @remarks This is called when `reloadResourceData` happens, on criteria and filters change or full `reset`.
201
+ * @param withColumnDefs - Whether to clear the columnDefs as well. Defaults to true.
202
+ * @internal
203
+ */
204
+ clearRowData(withColumnDefs = true) {
205
+ var _a, _b, _c, _d;
206
+ this.rows = new Map();
207
+ if (withColumnDefs) {
208
+ (_b = (_a = this.gridTabulator) === null || _a === void 0 ? void 0 : _a.grid) === null || _b === void 0 ? void 0 : _b.setColumns([]);
209
+ }
210
+ (_d = (_c = this.gridTabulator) === null || _c === void 0 ? void 0 : _c.grid) === null || _d === void 0 ? void 0 : _d.clearData();
211
+ }
212
+ /**
213
+ * Sets the columnDefs and rowData for the grid.
214
+ * @remarks This should only happen once, when the grid is first initialized. Follow up updates will use the agTransaction.
215
+ * @internal
216
+ */
217
+ setRowData(rowData) {
218
+ const agColumnDefs = null; // this.getAgColumnDefs(this.datasource.fieldMetadata);
219
+ if (agColumnDefs) {
220
+ this.gridTabulator.grid.setColumns(agColumnDefs);
221
+ }
222
+ const data = this.rowDataMapper ? this.rowDataMapper(rowData) : rowData;
223
+ this.gridTabulator.grid.setData(data);
224
+ this.requiresFullRowDataAndColDefs = false;
225
+ }
226
+ /**
227
+ * Resets the grid data while keeping columnDefs and sends a DATA_LOGOFF message if it's a stream.
228
+ * Proxies to {@link @genesislcap/grid-pro#GridProGenesisDatasource.loadResourceData} but without the full init (no metadata fetch).
229
+ * @remarks This is used when the grid is already initialized and we want to reload the data due to a criteria/filter change.
230
+ * @internal
231
+ */
232
+ reloadResourceData() {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ if (this.dataSub) {
235
+ this.dataSub.unsubscribe();
236
+ this.dataSub = undefined;
237
+ }
238
+ this.dataLogoff();
239
+ this.clearRowData(withoutColumnDefs);
240
+ this.loadResourceData(withoutFullInit);
241
+ });
242
+ }
243
+ /**
244
+ * Initializes the datasource and loads the data for the grid.
245
+ * Handles both snapshot and stream data (for both REQUEST_SERVER and DATASERVER resource types).
246
+ *
247
+ * @param withFullInit - if true, will call datasource.init() with requiresMetadataFetch = true, fetching fresh metadata
248
+ * @internal
249
+ */
250
+ loadResourceData(withFullInit = true) {
251
+ return __awaiter(this, void 0, void 0, function* () {
252
+ const requiresMetadataFetch = withFullInit || !this.datasource.initialized;
253
+ const initOK = yield this.datasource.init(this.datasourceOptions(), requiresMetadataFetch);
254
+ if (!initOK) {
255
+ logger.debug(`Genesis Datasource init failed for ${this.resourceName}`);
256
+ this.clearRowData();
257
+ return;
258
+ }
259
+ if (this.isSnapshot) {
260
+ const result = yield this.datasource.snapshot();
261
+ if (result) {
262
+ const rowData = this.handleSnapshot(result);
263
+ this.setRowData(rowData);
264
+ }
265
+ return;
266
+ }
267
+ logger.debug(`requesting stream for ${this.resourceName}`);
268
+ this.dataSub = this.datasource.stream.subscribe((result) => {
269
+ this.sourceRef = result.SOURCE_REF;
270
+ const messageType = result.MESSAGE_TYPE;
271
+ if (messageType && messageType === MessageType.LOGOFF_ACK) {
272
+ this.dataSubWasLoggedOff = true;
273
+ return;
274
+ }
275
+ this.dataSubWasLoggedOff = false;
276
+ if (result.ROW) {
277
+ const nextMessage = dataServerResultFilter(result);
278
+ this.handleStreamResult(nextMessage);
279
+ }
280
+ else {
281
+ this.handleStreamResult(result);
282
+ }
283
+ });
284
+ });
285
+ }
286
+ handleSnapshot(result) {
287
+ if (Array.isArray(result))
288
+ return result;
289
+ if (result.REPLY) {
290
+ return result.REPLY;
291
+ }
292
+ if (result.ROW) {
293
+ return dataServerResultFilter(result).inserts;
294
+ }
295
+ return result.inserts;
296
+ }
297
+ datasourceOptions() {
298
+ return {
299
+ criteria: this.buildCriteria(),
300
+ fields: this.fields,
301
+ isSnapshot: this.isSnapshot,
302
+ orderBy: this.orderBy,
303
+ resourceName: this.resourceName,
304
+ request: this.request,
305
+ reverse: this.reverse,
306
+ maxRows: this.maxRows,
307
+ maxView: this.maxView,
308
+ pollingInterval: this.pollingInterval,
309
+ movingView: this.movingView,
310
+ };
311
+ }
312
+ handleStreamResult(result) {
313
+ if (!result)
314
+ return;
315
+ if (this.isRequestServer) {
316
+ this.applyRequestServerData(result);
317
+ }
318
+ else {
319
+ this.applyDataserverData(result);
320
+ }
321
+ }
322
+ applyRequestServerData(requestServerResult) {
323
+ var _a;
324
+ const requestServerData = requestServerResult.REPLY;
325
+ if (!Array.isArray(requestServerData) ||
326
+ !((_a = requestServerResult.MESSAGE_TYPE) === null || _a === void 0 ? void 0 : _a.startsWith('REP_'))) {
327
+ logger.error('received invalid RequestServerResult', requestServerResult);
328
+ return;
329
+ }
330
+ if (this.requiresFullRowDataAndColDefs) {
331
+ requestServerData === null || requestServerData === void 0 ? void 0 : requestServerData.forEach((insertData) => {
332
+ this.rows.set(insertData[this.rowId], insertData);
333
+ });
334
+ const rowData = this.rows.size > 0 ? Array.from(this.rows.values()) : requestServerData;
335
+ this.setRowData(rowData);
336
+ return;
337
+ }
338
+ const rowsToUpdate = [];
339
+ const rowsToDelete = Array.from(this.rows.values()).filter((row) => {
340
+ const match = requestServerData.find((data) => data[this.rowId] === row[this.rowId]);
341
+ if (match) {
342
+ rowsToUpdate.push(match);
343
+ return false; // don't delete rows that need to be updated
344
+ }
345
+ return true; // delete rows that don't exist in requestServerData
346
+ });
347
+ const rowsToInsert = requestServerData.filter((data) => !this.rows.has(data[this.rowId]));
348
+ this.gridTransaction = { add: [], remove: [], update: [] };
349
+ this.handleStreamInserts(rowsToInsert);
350
+ this.handleStreamDeletes(rowsToDelete);
351
+ this.handleStreamUpdates(rowsToUpdate);
352
+ this.applyTransaction();
353
+ }
354
+ applyDataserverData(dataServerResult) {
355
+ var _a;
356
+ if (this.requiresFullRowDataAndColDefs) {
357
+ (_a = dataServerResult.inserts) === null || _a === void 0 ? void 0 : _a.forEach((insertData) => {
358
+ this.rows.set(insertData[this.rowId], insertData);
359
+ });
360
+ const rowData = Array.from(this.rows.values());
361
+ this.setRowData(rowData);
362
+ return;
363
+ }
364
+ this.gridTransaction = { add: [], remove: [], update: [] };
365
+ this.handleStreamInserts(dataServerResult.inserts);
366
+ this.handleStreamDeletes(dataServerResult.deletes);
367
+ this.handleStreamUpdates(dataServerResult.updates);
368
+ this.applyTransaction();
369
+ }
370
+ applyTransaction() {
371
+ var _a, _b;
372
+ const transaction = this.mapTransaction(this.gridTransaction);
373
+ if (((_a = transaction.add) === null || _a === void 0 ? void 0 : _a.length) > 0) {
374
+ this.gridTabulator.grid.addData(transaction.add);
375
+ }
376
+ if (((_b = transaction.update) === null || _b === void 0 ? void 0 : _b.length) > 0) {
377
+ this.gridTabulator.grid.updateData(transaction.update);
378
+ }
379
+ transaction.remove.forEach((toRemove) => {
380
+ this.gridTabulator.grid.deleteRow(toRemove[this.rowId]);
381
+ });
382
+ }
383
+ mapTransaction(transaction) {
384
+ if (!this.rowDataMapper) {
385
+ return transaction;
386
+ }
387
+ return Object.assign(Object.assign({}, transaction), { add: this.rowDataMapper(transaction.add, this.rows), update: this.rowDataMapper(transaction.update, this.rows), remove: this.rowDataMapper(transaction.remove, this.rows) });
388
+ }
389
+ handleStreamInserts(insertedRows) {
390
+ insertedRows === null || insertedRows === void 0 ? void 0 : insertedRows.forEach((insertData) => {
391
+ if (this.rows.has(insertData[this.rowId]) || this.dataSubWasLoggedOff) {
392
+ const rowToBeUpdated = this.rows.get(insertData[this.rowId]);
393
+ const updatedRow = Object.assign(Object.assign({}, rowToBeUpdated), insertData);
394
+ this.gridTransaction.update.push(updatedRow);
395
+ }
396
+ else {
397
+ this.gridTransaction.add.push(insertData);
398
+ this.gridTransaction.addIndex = 0;
399
+ }
400
+ this.rows.set(insertData[this.rowId], insertData);
401
+ });
402
+ }
403
+ handleStreamDeletes(deletedRows) {
404
+ deletedRows === null || deletedRows === void 0 ? void 0 : deletedRows.forEach((deleteData) => {
405
+ this.gridTransaction.remove.push({ [this.rowId]: deleteData[this.rowId] });
406
+ this.rows.delete(deleteData[this.rowId]);
407
+ });
408
+ }
409
+ handleStreamUpdates(updatedRows) {
410
+ updatedRows === null || updatedRows === void 0 ? void 0 : updatedRows.forEach((updateData) => {
411
+ const rowToBeUpdated = this.rows.get(updateData[this.rowId]);
412
+ const updatedRow = Object.assign(Object.assign({}, rowToBeUpdated), updateData);
413
+ this.gridTransaction.update.push(updatedRow);
414
+ this.rows.set(updateData[this.rowId], updatedRow);
415
+ });
416
+ }
417
+ // FUTURE: Work with the field types vs ag grid column def types!
418
+ // private getAgColumnDefs(fieldsMetadata: FieldMetadata[]) {
419
+ // const colDefsFromGenesisData: ColDef[] = fieldsMetadata?.flatMap((field: FieldMetadata) => {
420
+ // const cellConfigs: ColDef = {};
421
+ // cellConfigs.filterParams = getFilterParamsByFieldType(field.type);
422
+ // switch (field.type) {
423
+ // case FieldTypeEnum.BOOLEAN:
424
+ // if (this.gridTabulator.autoCellRendererByType) {
425
+ // cellConfigs.cellRenderer = GridTabulatorCellRendererTypes.boolean;
426
+ // }
427
+ // break;
428
+ // case FieldTypeEnum.DATE:
429
+ // cellConfigs.valueFormatter = dateValueFormatter;
430
+ // break;
431
+ // case FieldTypeEnum.DATETIME:
432
+ // cellConfigs.valueFormatter = dateTimeValueFormatter;
433
+ // break;
434
+ // default:
435
+ // break;
436
+ // }
437
+ // const templateColDef = this.gridTabulator.gridApi?.getColumnDef(field.name);
438
+ // if (this.gridTabulator.onlyTemplateColDefs && !templateColDef) {
439
+ // return [];
440
+ // }
441
+ // if (this.fields && !this.fields.includes(field.name)) {
442
+ // return [];
443
+ // }
444
+ // return { field: field.name, ...cellConfigs, ...templateColDef };
445
+ // });
446
+ // const colDefsMergedWithTemplateDefs = this.gridTabulator.mergeAllColumnDefsAndStates(
447
+ // colDefsFromGenesisData,
448
+ // true,
449
+ // );
450
+ // return colDefsMergedWithTemplateDefs;
451
+ // }
452
+ buildCriteria() {
453
+ var _a;
454
+ const initialCriteria = ((_a = this.criteria) === null || _a === void 0 ? void 0 : _a.split(criteriaDelimiter)) || [];
455
+ const criteria = initialCriteria.concat(Array.from(this.criteriaFromFilters.values()));
456
+ return normaliseCriteria(criteria.join(criteriaJoin), criteriaDelimiter);
457
+ }
458
+ setFilter(fieldName, newFilter) {
459
+ this.criteriaFromFilters.set(fieldName, newFilter);
460
+ this.update.next(this.criteriaFromFilters);
461
+ }
462
+ removeFilter(fieldName) {
463
+ this.criteriaFromFilters.delete(fieldName);
464
+ this.update.next(this.criteriaFromFilters);
465
+ }
466
+ };
467
+ __decorate([
468
+ Auth
469
+ ], GridTabulatorClientSideDatasource.prototype, "auth", void 0);
470
+ __decorate([
471
+ Connect
472
+ ], GridTabulatorClientSideDatasource.prototype, "connect", void 0);
473
+ __decorate([
474
+ Datasource
475
+ ], GridTabulatorClientSideDatasource.prototype, "datasource", void 0);
476
+ __decorate([
477
+ observable
478
+ ], GridTabulatorClientSideDatasource.prototype, "deferredGridOptions", void 0);
479
+ __decorate([
480
+ attr
481
+ ], GridTabulatorClientSideDatasource.prototype, "criteria", void 0);
482
+ __decorate([
483
+ attr
484
+ ], GridTabulatorClientSideDatasource.prototype, "fields", void 0);
485
+ __decorate([
486
+ attr({ mode: 'boolean', attribute: 'is-snapshot' })
487
+ ], GridTabulatorClientSideDatasource.prototype, "isSnapshot", void 0);
488
+ __decorate([
489
+ attr({ attribute: 'max-rows' })
490
+ ], GridTabulatorClientSideDatasource.prototype, "maxRows", void 0);
491
+ __decorate([
492
+ attr({ attribute: 'max-view' })
493
+ ], GridTabulatorClientSideDatasource.prototype, "maxView", void 0);
494
+ __decorate([
495
+ attr({ attribute: 'polling-interval' })
496
+ ], GridTabulatorClientSideDatasource.prototype, "pollingInterval", void 0);
497
+ __decorate([
498
+ attr({ mode: 'boolean', attribute: 'moving-view' })
499
+ ], GridTabulatorClientSideDatasource.prototype, "movingView", void 0);
500
+ __decorate([
501
+ attr({ attribute: 'order-by' })
502
+ ], GridTabulatorClientSideDatasource.prototype, "orderBy", void 0);
503
+ __decorate([
504
+ observable
505
+ ], GridTabulatorClientSideDatasource.prototype, "request", void 0);
506
+ __decorate([
507
+ attr({ attribute: 'resource-name' })
508
+ ], GridTabulatorClientSideDatasource.prototype, "resourceName", void 0);
509
+ __decorate([
510
+ attr({ mode: 'boolean' })
511
+ ], GridTabulatorClientSideDatasource.prototype, "reverse", void 0);
512
+ __decorate([
513
+ attr({ attribute: 'row-id' })
514
+ ], GridTabulatorClientSideDatasource.prototype, "rowIdAttr", void 0);
515
+ __decorate([
516
+ attr({ mode: 'boolean', attribute: 'restart-on-reconnection' })
517
+ ], GridTabulatorClientSideDatasource.prototype, "restartOnReconnection", void 0);
518
+ __decorate([
519
+ observable
520
+ ], GridTabulatorClientSideDatasource.prototype, "rowDataMapper", void 0);
521
+ GridTabulatorClientSideDatasource = __decorate([
522
+ customElement({
523
+ name: 'grid-tabulator-client-side-datasource',
524
+ })
525
+ ], GridTabulatorClientSideDatasource);
526
+ export { GridTabulatorClientSideDatasource };
@@ -0,0 +1 @@
1
+ export * from './client-side.datasource';
@@ -0,0 +1,16 @@
1
+ import { GridTabulatorTheme } from '../grid-tabulator.types';
2
+ export const tabulatorDefaultFontFace = `
3
+ @font-face {
4
+ font-family: "defaultFontFace";
5
+ }
6
+ `;
7
+ export const tabulatorRapidFontFace = `
8
+ @font-face {
9
+ font-family: "rapidFontFace";
10
+ }
11
+ `;
12
+ export const gridThemeFontFaceMap = {
13
+ [GridTabulatorTheme.default]: tabulatorDefaultFontFace,
14
+ [GridTabulatorTheme.rapid]: tabulatorRapidFontFace,
15
+ };
16
+ export const defaultGridTabulatorFontFace = tabulatorDefaultFontFace;
@@ -0,0 +1,6 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { tabulatorThemeSimpleCSS } from './tabulator-theme-simple-css';
3
+ export const tabulatorExternalStockStyles = css `
4
+ ${tabulatorThemeSimpleCSS}
5
+ `;
6
+ export { tabulatorThemeSimpleCSS };