@genesislcap/grid-pro 14.348.0 → 14.350.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.
Files changed (124) hide show
  1. package/dist/custom-elements.json +2293 -1443
  2. package/dist/dts/cell-renderers/boolean.renderer.d.ts.map +1 -1
  3. package/dist/dts/datasource/base.datasource.d.ts +20 -15
  4. package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
  5. package/dist/dts/datasource/index.d.ts +1 -0
  6. package/dist/dts/datasource/index.d.ts.map +1 -1
  7. package/dist/dts/datasource/server-side.datasource.d.ts +9 -9
  8. package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
  9. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +101 -0
  10. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -0
  11. package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +24 -9
  12. package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
  13. package/dist/dts/grid-pro-v34.d.ts +862 -0
  14. package/dist/dts/grid-pro-v34.d.ts.map +1 -0
  15. package/dist/dts/grid-pro.d.ts +88 -1
  16. package/dist/dts/grid-pro.d.ts.map +1 -1
  17. package/dist/dts/grid-pro.definitions.d.ts.map +1 -1
  18. package/dist/dts/index.d.ts +1 -0
  19. package/dist/dts/index.d.ts.map +1 -1
  20. package/dist/dts/status-bar-components/label-value.status-bar.d.ts +1 -1
  21. package/dist/dts/status-bar-components/label-value.status-bar.d.ts.map +1 -1
  22. package/dist/dts/status-bar-components/load-more.status-bar.d.ts +1 -1
  23. package/dist/dts/status-bar-components/load-more.status-bar.d.ts.map +1 -1
  24. package/dist/dts/status-bar-components/pagination.status-bar.d.ts +1 -1
  25. package/dist/dts/status-bar-components/pagination.status-bar.d.ts.map +1 -1
  26. package/dist/dts/status-bar-components/reload.status-bar.d.ts +1 -1
  27. package/dist/dts/status-bar-components/reload.status-bar.d.ts.map +1 -1
  28. package/dist/esm/cell-renderers/boolean.renderer.js +6 -7
  29. package/dist/esm/datasource/base.datasource.js +68 -95
  30. package/dist/esm/datasource/index.js +1 -0
  31. package/dist/esm/datasource/server-side.datasource.js +127 -149
  32. package/dist/esm/grid-pro-genesis-datasource/datasource-events.types.js +33 -0
  33. package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +83 -78
  34. package/dist/esm/grid-pro-v34.js +1034 -0
  35. package/dist/esm/grid-pro.definitions.js +1 -1
  36. package/dist/esm/grid-pro.js +283 -8
  37. package/dist/esm/grid-pro.template.js +1 -1
  38. package/dist/esm/index.js +1 -0
  39. package/dist/esm/status-bar-components/pagination.status-bar.js +18 -11
  40. package/dist/grid-pro.api.json +3188 -698
  41. package/dist/grid-pro.d.ts +1171 -118
  42. package/docs/api/grid-pro.errorhandlerdialogstyles.md +11 -0
  43. package/docs/api/grid-pro.genesisgriddatasourceelement.md +0 -21
  44. package/docs/api/grid-pro.geterrorhandlerdialogtemplate.md +64 -0
  45. package/docs/api/grid-pro.gridpro.md +17 -0
  46. package/docs/api/grid-pro.gridpro.thememode.md +11 -0
  47. package/docs/api/{grid-pro.gridprobasedatasource.applyallagtransactions.md → grid-pro.gridprobasedatasource.applyalltransactions.md} +3 -3
  48. package/docs/api/grid-pro.gridprobasedatasource.applytransaction.md +3 -3
  49. package/docs/api/grid-pro.gridprobasedatasource.getdatasourcestatusbarpanels.md +15 -1
  50. package/docs/api/grid-pro.gridprobasedatasource.isdisconnected.md +1 -1
  51. package/docs/api/{grid-pro.gridprobasedatasource.agtransaction.md → grid-pro.gridprobasedatasource.keepcoldefsonclearrowdata.md} +3 -3
  52. package/docs/api/grid-pro.gridprobasedatasource.md +17 -55
  53. package/docs/api/grid-pro.gridprobasedatasource.pagination.md +1 -1
  54. package/docs/api/grid-pro.gridprobasedatasource.setdisconnected.md +1 -1
  55. package/docs/api/{grid-pro.gridprobasedatasource.applyfuncname.md → grid-pro.gridprobasedatasource.transactiondata.md} +3 -3
  56. package/docs/api/grid-pro.gridprogenesisdatasource.applytransaction.md +4 -4
  57. package/docs/api/grid-pro.gridprogenesisdatasource.init.md +4 -20
  58. package/docs/api/grid-pro.gridprogenesisdatasource.md +7 -34
  59. package/docs/api/{grid-pro.gridprogenesisdatasource.applyfuncname.md → grid-pro.gridprogenesisdatasource.transactiondata.md} +3 -3
  60. package/docs/api/grid-pro.gridproserversidedatasource.applytransaction.md +4 -4
  61. package/docs/api/grid-pro.gridproserversidedatasource.md +1 -74
  62. package/docs/api/grid-pro.gridproserversidedatasource.onpaginationchanged.md +2 -2
  63. package/docs/api/{grid-pro.gridproserversidedatasource.rowmodel.md → grid-pro.gridprov34._constructor_.md} +5 -3
  64. package/docs/api/grid-pro.gridprov34.addeventlistener.md +89 -0
  65. package/docs/api/{grid-pro.gridproserversidedatasource.applyfuncname.md → grid-pro.gridprov34.aggrid.md} +3 -3
  66. package/docs/api/{grid-pro.gridproserversidedatasource.applyasyncfuncname.md → grid-pro.gridprov34.aggridoptions.md} +3 -3
  67. package/docs/api/grid-pro.gridprov34.autocellrendererbytype.md +14 -0
  68. package/docs/api/grid-pro.gridprov34.cachefilterconfig.md +18 -0
  69. package/docs/api/grid-pro.gridprov34.classnames.md +14 -0
  70. package/docs/api/grid-pro.gridprov34.clearlocalgridoptions.md +17 -0
  71. package/docs/api/grid-pro.gridprov34.columncomponentname.md +14 -0
  72. package/docs/api/grid-pro.gridprov34.combineallgridcomponents.md +53 -0
  73. package/docs/api/grid-pro.gridprov34.connectedcallback.md +18 -0
  74. package/docs/api/grid-pro.gridprov34.customerrorhandlertemplate.md +21 -0
  75. package/docs/api/grid-pro.gridprov34.disconnectedcallback.md +18 -0
  76. package/docs/api/grid-pro.gridprov34.enablecellflashing.md +21 -0
  77. package/docs/api/grid-pro.gridprov34.enablerowflashing.md +16 -0
  78. package/docs/api/grid-pro.gridprov34.eventsandcallbacks.md +14 -0
  79. package/docs/api/grid-pro.gridprov34.getfiltermodel.md +20 -0
  80. package/docs/api/grid-pro.gridprov34.getsavedcolumnstate.md +21 -0
  81. package/docs/api/grid-pro.gridprov34.getselectedrows.md +19 -0
  82. package/docs/api/{grid-pro.gridproserversidedatasource.applytransactionasync.md → grid-pro.gridprov34.globaleventlistener.md} +7 -9
  83. package/docs/api/grid-pro.gridprov34.gridapi.md +14 -0
  84. package/docs/api/grid-pro.gridprov34.gridautosizingenabled.md +16 -0
  85. package/docs/api/grid-pro.gridprov34.gridcomponents.md +16 -0
  86. package/docs/api/grid-pro.gridprov34.griderroritems.md +14 -0
  87. package/docs/api/grid-pro.gridprov34.gridoptions.md +14 -0
  88. package/docs/api/grid-pro.gridprov34.gridoptionsconfig.md +28 -0
  89. package/docs/api/grid-pro.gridprov34.gridparams.md +12 -0
  90. package/docs/api/grid-pro.gridprov34.gridprodatasource.md +18 -0
  91. package/docs/api/grid-pro.gridprov34.gridslot.md +14 -0
  92. package/docs/api/grid-pro.gridprov34.hasselectedrows.md +19 -0
  93. package/docs/api/grid-pro.gridprov34.headercasetype.md +18 -0
  94. package/docs/api/grid-pro.gridprov34.headerheight.md +14 -0
  95. package/docs/api/grid-pro.gridprov34.hidedatasourceerror.md +18 -0
  96. package/docs/api/grid-pro.gridprov34.initialised.md +14 -0
  97. package/docs/api/grid-pro.gridprov34.isserverside.md +12 -0
  98. package/docs/api/grid-pro.gridprov34.md +1008 -0
  99. package/docs/api/grid-pro.gridprov34.mergeallcolumndefsandstates.md +230 -0
  100. package/docs/api/grid-pro.gridprov34.onlytemplatecoldefs.md +14 -0
  101. package/docs/api/grid-pro.gridprov34.pagination.md +21 -0
  102. package/docs/api/grid-pro.gridprov34.paginationpagesize.md +25 -0
  103. package/docs/api/grid-pro.gridprov34.persistcolumnstatekey.md +16 -0
  104. package/docs/api/grid-pro.gridprov34.persistfiltermodelkey.md +16 -0
  105. package/docs/api/grid-pro.gridprov34.provider.md +14 -0
  106. package/docs/api/grid-pro.gridprov34.restorecachedfilterconfig.md +18 -0
  107. package/docs/api/grid-pro.gridprov34.rowdata.md +18 -0
  108. package/docs/api/grid-pro.gridprov34.rowdatachanged.md +67 -0
  109. package/docs/api/grid-pro.gridprov34.rowheight.md +14 -0
  110. package/docs/api/grid-pro.gridprov34.setfiltermodel.md +55 -0
  111. package/docs/api/grid-pro.gridprov34.setuppaginationandstatusbar.md +53 -0
  112. package/docs/api/grid-pro.gridprov34.statepersistanceenabled.md +18 -0
  113. package/docs/api/grid-pro.gridprov34.statepersistence.md +14 -0
  114. package/docs/api/grid-pro.gridprov34.statusbarconfig.md +21 -0
  115. package/docs/api/grid-pro.gridprov34.thememode.md +14 -0
  116. package/docs/api/grid-pro.gridprov34.withstatusbar.md +21 -0
  117. package/docs/api/grid-pro.md +29 -1
  118. package/docs/api-report.md.api.md +377 -41
  119. package/package.json +16 -14
  120. package/docs/api/grid-pro.genesisgriddatasourceelement.aggrid.md +0 -11
  121. package/docs/api/grid-pro.gridprobasedatasource.applyasyncfuncname.md +0 -11
  122. package/docs/api/grid-pro.gridprobasedatasource.applytransactionasync.md +0 -66
  123. package/docs/api/grid-pro.gridprogenesisdatasource.applyasyncfuncname.md +0 -11
  124. package/docs/api/grid-pro.gridprogenesisdatasource.applytransactionasync.md +0 -66
@@ -1,9 +1,10 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
2
  import { Datasource, DatasourceDefaults, DatasourceEventHandler, FieldTypeEnum, logger, normaliseCriteria, ResourceType, } from '@genesislcap/foundation-comms';
3
3
  import { Connect } from '@genesislcap/foundation-comms';
4
- import { attr, observable, volatile } from '@microsoft/fast-element';
4
+ import { attr, nullableNumberConverter, observable, volatile } from '@microsoft/fast-element';
5
5
  import { FoundationElement } from '@microsoft/fast-foundation';
6
6
  import { BehaviorSubject } from 'rxjs';
7
+ import { datasourceEventNames, } from '../grid-pro-genesis-datasource/datasource-events.types';
7
8
  import { dateValueFormatter, dateTimeValueFormatter, getColumnType, getFilterByFieldType, } from '../grid-pro.definitions';
8
9
  import { GridProRendererTypes, GridProStatusBarTypes } from '../grid-pro.types';
9
10
  import { baseDatasourceEventNames } from './base.types';
@@ -158,9 +159,6 @@ export class GenesisGridDatasourceElement extends DatasourceEventHandler(Foundat
158
159
  // this.isRequestServer = next.type === ResourceType.REQUEST_SERVER;
159
160
  // TODO: this is not triggered after first init :(
160
161
  }
161
- get agGrid() {
162
- return this.parentElement;
163
- }
164
162
  /**
165
163
  * Handles errors and emits appropriate error events.
166
164
  * @param errors - The error message or array of error messages
@@ -189,13 +187,11 @@ export class GenesisGridDatasourceElement extends DatasourceEventHandler(Foundat
189
187
  else {
190
188
  message = String(errors);
191
189
  }
192
- // Set visual indicator on grid if available
193
- if (this.agGrid) {
194
- this.agGrid.setAttribute('ds-disconnected', 'ds-disconnected');
195
- }
196
190
  if (message) {
197
191
  logger.error(`${type}: ${message}`);
192
+ // Emit both the old event for backward compatibility and the new event for grid handling
198
193
  this.$emit(baseDatasourceEventNames.error, { message, type });
194
+ this.$emit(datasourceEventNames.error, { message, type });
199
195
  }
200
196
  }
201
197
  /**
@@ -203,9 +199,6 @@ export class GenesisGridDatasourceElement extends DatasourceEventHandler(Foundat
203
199
  * @public
204
200
  */
205
201
  clearErrors() {
206
- if (this.agGrid) {
207
- this.agGrid.removeAttribute('ds-disconnected');
208
- }
209
202
  this.$emit(baseDatasourceEventNames.connected);
210
203
  }
211
204
  /**
@@ -292,7 +285,7 @@ __decorate([
292
285
  attr({ mode: 'boolean', attribute: 'is-snapshot' })
293
286
  ], GenesisGridDatasourceElement.prototype, "isSnapshot", void 0);
294
287
  __decorate([
295
- attr({ attribute: 'max-rows' })
288
+ attr({ attribute: 'max-rows', converter: nullableNumberConverter })
296
289
  ], GenesisGridDatasourceElement.prototype, "maxRows", void 0);
297
290
  __decorate([
298
291
  attr({ attribute: 'order-by' })
@@ -301,13 +294,13 @@ __decorate([
301
294
  attr({ attribute: 'resource-name' })
302
295
  ], GenesisGridDatasourceElement.prototype, "resourceName", void 0);
303
296
  __decorate([
304
- attr({ attribute: 'view-number' })
297
+ attr({ attribute: 'view-number', converter: nullableNumberConverter })
305
298
  ], GenesisGridDatasourceElement.prototype, "viewNumber", void 0);
306
299
  __decorate([
307
300
  attr
308
301
  ], GenesisGridDatasourceElement.prototype, "fields", void 0);
309
302
  __decorate([
310
- attr({ attribute: 'max-view' })
303
+ attr({ attribute: 'max-view', converter: nullableNumberConverter })
311
304
  ], GenesisGridDatasourceElement.prototype, "maxView", void 0);
312
305
  __decorate([
313
306
  attr({ mode: 'boolean', attribute: 'moving-view' })
@@ -319,7 +312,7 @@ __decorate([
319
312
  attr({ mode: 'boolean', attribute: 'disable-polling' })
320
313
  ], GenesisGridDatasourceElement.prototype, "disablePolling", void 0);
321
314
  __decorate([
322
- attr
315
+ attr({ converter: nullableNumberConverter })
323
316
  ], GenesisGridDatasourceElement.prototype, "offset", void 0);
324
317
  __decorate([
325
318
  attr({ attribute: 'polling-interval' })
@@ -352,19 +345,18 @@ export var OperationType;
352
345
  OperationType["Update"] = "update";
353
346
  OperationType["Remove"] = "remove";
354
347
  })(OperationType || (OperationType = {}));
355
- /**
356
- * @public
357
- */
358
348
  export class GridProBaseDatasource extends GenesisGridDatasourceElement {
359
349
  constructor() {
360
350
  super(...arguments);
361
351
  this.dataSubWasLoggedOff = false;
352
+ this.keepColDefsOnClearRowData = false;
362
353
  this.rowData = new Map();
363
- this.agTransaction = {
354
+ this.transactionData = {
364
355
  add: [],
365
356
  remove: [],
366
357
  update: [],
367
358
  };
359
+ this._isDisconnected = false;
368
360
  }
369
361
  subscribeToConnection() {
370
362
  var _a;
@@ -390,7 +382,6 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
390
382
  }
391
383
  generateColumnDefsFromMetadata(fieldsMetadata, getFilterParamsByFieldType) {
392
384
  return fieldsMetadata === null || fieldsMetadata === void 0 ? void 0 : fieldsMetadata.flatMap((field) => {
393
- var _a;
394
385
  const colDefBase = {};
395
386
  colDefBase.filterParams = getFilterParamsByFieldType(field.type);
396
387
  switch (field.type) {
@@ -401,10 +392,8 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
401
392
  colDefBase.cellEditor = GridProRendererTypes.numberEditor;
402
393
  break;
403
394
  case FieldTypeEnum.BOOLEAN:
404
- if (this.agGrid.autoCellRendererByType) {
405
- colDefBase.cellRenderer = GridProRendererTypes.boolean;
406
- colDefBase.cellEditor = GridProRendererTypes.boolean;
407
- }
395
+ colDefBase.cellRenderer = GridProRendererTypes.boolean;
396
+ colDefBase.cellEditor = GridProRendererTypes.boolean;
408
397
  break;
409
398
  case FieldTypeEnum.DATE:
410
399
  colDefBase.valueFormatter = dateValueFormatter;
@@ -433,35 +422,33 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
433
422
  default:
434
423
  break;
435
424
  }
436
- const colDefExtras = (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.getColumnDef(field.name);
425
+ // Column definition extras would be handled by the grid component now
437
426
  if (this.fields && !this.fields.includes(field.name)) {
438
427
  return [];
439
428
  }
440
- return Object.assign(Object.assign({ field: field.name, type: getColumnType(field.type), filter: getFilterByFieldType(field.type) }, colDefBase), colDefExtras);
429
+ return Object.assign({ field: field.name, type: getColumnType(field.type), filter: getFilterByFieldType(field.type) }, colDefBase);
441
430
  });
442
431
  }
443
432
  handleStreamInserts(insertedRows, addIndex = 0) {
444
433
  // Create a local counter for the insertion index when we need to do sequential inserts
445
434
  let currentAddIndex = addIndex;
446
435
  insertedRows === null || insertedRows === void 0 ? void 0 : insertedRows.forEach((insertData) => {
447
- var _a, _b;
448
436
  const rowId = insertData[this.rowId];
449
437
  if (!rowId) {
450
438
  logger.warn('Attempted to insert row without valid rowId', insertData);
451
439
  return;
452
440
  }
453
441
  const existsInInternalState = this.rowData.has(rowId);
454
- const existsInGrid = (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.getRowNode(rowId);
455
- if (existsInInternalState || existsInGrid || this.dataSubWasLoggedOff) {
456
- const existingData = existsInInternalState ? this.rowData.get(rowId) : existsInGrid.data;
442
+ if (existsInInternalState || this.dataSubWasLoggedOff) {
443
+ const existingData = this.rowData.get(rowId);
457
444
  const updatedRow = Object.assign(Object.assign({}, existingData), insertData);
458
- this.agTransaction.update.push(updatedRow);
445
+ this.transactionData.update.push(updatedRow);
459
446
  this.rowData.set(rowId, updatedRow);
460
447
  }
461
448
  else {
462
- this.agTransaction.add.push(insertData);
449
+ this.transactionData.add.push(insertData);
463
450
  // Use the current add index for this insertion
464
- this.agTransaction.addIndex = currentAddIndex;
451
+ this.transactionData.addIndex = currentAddIndex;
465
452
  this.rowData.set(rowId, insertData);
466
453
  // Only increment the index if we're not inserting at the beginning (addIndex > 0)
467
454
  // This ensures rows are inserted in sequence when appending to the end of the grid
@@ -475,11 +462,11 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
475
462
  handleStreamDeletes(deletedRows) {
476
463
  deletedRows === null || deletedRows === void 0 ? void 0 : deletedRows.forEach((deleteData) => {
477
464
  if (this.hasDefaultRowId || this.isRequestServer) {
478
- this.agTransaction.remove.push({ [this.rowId]: deleteData[this.rowId] });
465
+ this.transactionData.remove.push({ [this.rowId]: deleteData[this.rowId] });
479
466
  }
480
467
  else {
481
468
  const rowToBeDeleted = Object.values(Object.fromEntries(this.rowData)).find((obj) => obj[this.defaultRowIdByResourceType] === deleteData[this.defaultRowIdByResourceType]);
482
- this.agTransaction.remove.push({ [this.rowId]: rowToBeDeleted[this.rowId] });
469
+ this.transactionData.remove.push({ [this.rowId]: rowToBeDeleted[this.rowId] });
483
470
  }
484
471
  this.rowData.delete(deleteData[this.rowId]);
485
472
  });
@@ -490,60 +477,47 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
490
477
  if (this.hasDefaultRowId || this.isRequestServer) {
491
478
  const rowToBeUpdated = this.rowData.get(updateData[this.rowId]);
492
479
  updatedRow = Object.assign(Object.assign({}, rowToBeUpdated), updateData);
493
- this.agTransaction.update.push(updatedRow);
480
+ this.transactionData.update.push(updatedRow);
494
481
  }
495
482
  else {
496
483
  const rowToBeUpdated = Object.values(Object.fromEntries(this.rowData)).find((obj) => obj[this.defaultRowIdByResourceType] === updateData[this.defaultRowIdByResourceType]);
497
484
  updatedRow = Object.assign(Object.assign({}, rowToBeUpdated), updateData);
498
- this.agTransaction.update.push(updatedRow);
485
+ this.transactionData.update.push(updatedRow);
499
486
  }
500
487
  this.rowData.set(updateData[this.rowId], updatedRow);
501
488
  });
502
489
  }
503
- applyAllAgTransactions() {
504
- var _a, _b, _c;
505
- if (!this.agTransaction.add.length &&
506
- !this.agTransaction.update.length &&
507
- !this.agTransaction.remove.length) {
508
- this.agGrid.gridApi.hideOverlay();
490
+ applyAllTransactions() {
491
+ var _a, _b, _c, _d, _e, _f;
492
+ if (!((_a = this.transactionData.add) === null || _a === void 0 ? void 0 : _a.length) &&
493
+ !((_b = this.transactionData.update) === null || _b === void 0 ? void 0 : _b.length) &&
494
+ !((_c = this.transactionData.remove) === null || _c === void 0 ? void 0 : _c.length)) {
495
+ this.$emit(datasourceEventNames.loadingFinished);
509
496
  if (this.rowData.size === 0) {
510
- this.agGrid.gridApi.showNoRowsOverlay();
497
+ this.$emit(datasourceEventNames.noDataAvailable);
511
498
  }
512
499
  return;
513
500
  }
514
- if (((_a = this.agTransaction.add) === null || _a === void 0 ? void 0 : _a.length) > 0) {
515
- this.applyMappedAgTransaction({
516
- add: this.agTransaction.add,
517
- addIndex: this.agTransaction.addIndex,
518
- }, OperationType.Add, this.agGrid.asyncAdd);
519
- }
520
- if (((_b = this.agTransaction.remove) === null || _b === void 0 ? void 0 : _b.length) > 0) {
521
- this.applyMappedAgTransaction({ remove: this.agTransaction.remove }, OperationType.Remove, this.agGrid.asyncRemove);
522
- }
523
- if (((_c = this.agTransaction.update) === null || _c === void 0 ? void 0 : _c.length) > 0) {
524
- this.applyMappedAgTransaction({ update: this.agTransaction.update }, OperationType.Update, this.agGrid.asyncUpdate);
525
- }
526
- }
527
- flashAddedCells(rowNodes) {
528
- if (this.agGrid.enableRowFlashing && (rowNodes === null || rowNodes === void 0 ? void 0 : rowNodes.length)) {
529
- this.agGrid.gridApi.flashCells({ rowNodes });
501
+ if (((_d = this.transactionData.add) === null || _d === void 0 ? void 0 : _d.length) > 0) {
502
+ this.applyMappedTransaction({
503
+ add: this.transactionData.add,
504
+ addIndex: this.transactionData.addIndex,
505
+ }, OperationType.Add);
530
506
  }
531
- }
532
- applyMappedAgTransaction(agTransaction, operation, isAsync) {
533
- if (isAsync) {
534
- this.applyTransactionAsync(this.mapTransaction(agTransaction, [operation]), (changedNodes) => {
535
- this.flashAddedCells(changedNodes === null || changedNodes === void 0 ? void 0 : changedNodes.add);
536
- });
507
+ if (((_e = this.transactionData.remove) === null || _e === void 0 ? void 0 : _e.length) > 0) {
508
+ this.applyMappedTransaction({ remove: this.transactionData.remove }, OperationType.Remove);
537
509
  }
538
- else {
539
- const changedNodes = this.applyTransaction(this.mapTransaction(agTransaction, [operation]));
540
- this.flashAddedCells(changedNodes === null || changedNodes === void 0 ? void 0 : changedNodes.add);
510
+ if (((_f = this.transactionData.update) === null || _f === void 0 ? void 0 : _f.length) > 0) {
511
+ this.applyMappedTransaction({ update: this.transactionData.update }, OperationType.Update);
541
512
  }
542
513
  }
543
- applyTransaction(agTransaction) {
544
- throw new Error('Method not implemented.');
514
+ applyMappedTransaction(transaction, operation) {
515
+ const mappedTransaction = this.mapTransaction(transaction, [operation]);
516
+ this.$emit(datasourceEventNames.dataChanged, {
517
+ changes: mappedTransaction,
518
+ });
545
519
  }
546
- applyTransactionAsync(agTransaction, callback) {
520
+ applyTransaction(transaction) {
547
521
  throw new Error('Method not implemented.');
548
522
  }
549
523
  /**
@@ -566,13 +540,11 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
566
540
  if (operations.includes(OperationType.Update)) {
567
541
  mappedTransaction.update = this.rowDataMapper(transaction.update, this.rowData);
568
542
  }
543
+ if (transaction.addIndex !== undefined) {
544
+ mappedTransaction.addIndex = transaction.addIndex;
545
+ }
569
546
  return mappedTransaction;
570
547
  }
571
- get pagination() {
572
- var _a, _b;
573
- // This is a private property, but it's the only way to get the pagination status because grid-pro is the parent of the datasource.
574
- return (_b = (_a = this.agGrid['_pagination']) !== null && _a !== void 0 ? _a : this.agGrid.pagination) !== null && _b !== void 0 ? _b : false;
575
- }
576
548
  loadMore() {
577
549
  throw new Error('loadMore() method must be implemented by subclass');
578
550
  }
@@ -586,25 +558,26 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
586
558
  throw new Error('destroy() method must be implemented by subclass');
587
559
  }
588
560
  /**
589
- * Sets or removes the ds-disconnected attribute on the grid element.
561
+ * Sets the disconnected state and emits appropriate events.
590
562
  * @param disconnected - true to set, false to remove
591
563
  */
592
564
  setDisconnected(disconnected) {
593
- if (!this.agGrid)
594
- return;
565
+ this._isDisconnected = disconnected;
595
566
  if (disconnected) {
596
- this.agGrid.setAttribute('ds-disconnected', 'ds-disconnected');
567
+ this.$emit(datasourceEventNames.error, {
568
+ message: 'Datasource disconnected',
569
+ type: 'connection',
570
+ });
597
571
  }
598
572
  else {
599
- this.agGrid.removeAttribute('ds-disconnected');
573
+ this.clearErrors();
600
574
  }
601
575
  }
602
576
  /**
603
- * Returns true if the grid has the ds-disconnected attribute.
577
+ * Returns true if the datasource is disconnected.
604
578
  */
605
579
  isDisconnected() {
606
- var _a;
607
- return !!((_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.hasAttribute('ds-disconnected'));
580
+ return this._isDisconnected;
608
581
  }
609
582
  /**
610
583
  * Helper function to extract configuration for status bar actions
@@ -627,27 +600,27 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
627
600
  * This method should be called by the grid to get status bar panels specific to this datasource.
628
601
  * @public
629
602
  */
630
- getDatasourceStatusBarPanels(isServerSide) {
631
- var _a, _b, _c, _d, _e, _f, _g, _h;
603
+ getDatasourceStatusBarPanels(isServerSide, statusBarConfig) {
604
+ var _a, _b, _c, _d, _e, _f;
632
605
  const additionalPanels = [];
633
606
  // Extract loadMore configuration
634
- const loadMoreConfig = this.getStatusBarActionConfig((_a = this.agGrid.statusBarConfig) === null || _a === void 0 ? void 0 : _a.loadMore);
607
+ const loadMoreConfig = this.getStatusBarActionConfig(statusBarConfig === null || statusBarConfig === void 0 ? void 0 : statusBarConfig.loadMore);
635
608
  // Add load more button if enabled and not server-side
636
609
  if (loadMoreConfig.enabled && !isServerSide) {
637
610
  const loadMoreParams = {};
638
611
  // Use custom callback if provided, otherwise leave undefined for default behavior
639
- if ((_b = loadMoreConfig.config) === null || _b === void 0 ? void 0 : _b.onLoadMore) {
612
+ if ((_a = loadMoreConfig.config) === null || _a === void 0 ? void 0 : _a.onLoadMore) {
640
613
  loadMoreParams.onLoadMore = loadMoreConfig.config.onLoadMore;
641
614
  }
642
615
  else {
643
616
  loadMoreParams.onLoadMore = this.loadMore.bind(this);
644
617
  }
645
618
  // Add custom styling parameters
646
- if ((_c = loadMoreConfig.config) === null || _c === void 0 ? void 0 : _c.appearance) {
619
+ if ((_b = loadMoreConfig.config) === null || _b === void 0 ? void 0 : _b.appearance) {
647
620
  loadMoreParams.appearance = loadMoreConfig.config.appearance;
648
621
  }
649
622
  // Add tooltip - use custom tooltip if provided, otherwise use default
650
- loadMoreParams.tooltip = ((_d = loadMoreConfig.config) === null || _d === void 0 ? void 0 : _d.tooltip) || 'Load More';
623
+ loadMoreParams.tooltip = ((_c = loadMoreConfig.config) === null || _c === void 0 ? void 0 : _c.tooltip) || 'Load More';
651
624
  additionalPanels.push({
652
625
  statusPanel: GridProStatusBarTypes.loadMore,
653
626
  statusPanelParams: loadMoreParams,
@@ -655,23 +628,23 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
655
628
  });
656
629
  }
657
630
  // Extract reload configuration
658
- const reloadConfig = this.getStatusBarActionConfig((_e = this.agGrid.statusBarConfig) === null || _e === void 0 ? void 0 : _e.reload);
631
+ const reloadConfig = this.getStatusBarActionConfig(statusBarConfig === null || statusBarConfig === void 0 ? void 0 : statusBarConfig.reload);
659
632
  // Add reload button if enabled
660
633
  if (reloadConfig.enabled) {
661
634
  const reloadParams = {};
662
635
  // Use custom callback if provided, otherwise use default datasource reload
663
- if ((_f = reloadConfig.config) === null || _f === void 0 ? void 0 : _f.onReload) {
636
+ if ((_d = reloadConfig.config) === null || _d === void 0 ? void 0 : _d.onReload) {
664
637
  reloadParams.onReload = reloadConfig.config.onReload;
665
638
  }
666
639
  else {
667
640
  reloadParams.onReload = this.reloadResourceData.bind(this);
668
641
  }
669
642
  // Add custom styling parameters
670
- if ((_g = reloadConfig.config) === null || _g === void 0 ? void 0 : _g.icon) {
643
+ if ((_e = reloadConfig.config) === null || _e === void 0 ? void 0 : _e.icon) {
671
644
  reloadParams.icon = reloadConfig.config.icon;
672
645
  }
673
646
  // Add tooltip - use custom tooltip if provided, otherwise use default
674
- reloadParams.tooltip = ((_h = reloadConfig.config) === null || _h === void 0 ? void 0 : _h.tooltip) || 'Reload';
647
+ reloadParams.tooltip = ((_f = reloadConfig.config) === null || _f === void 0 ? void 0 : _f.tooltip) || 'Reload';
675
648
  additionalPanels.push({
676
649
  statusPanel: GridProStatusBarTypes.reload,
677
650
  statusPanelParams: reloadParams,
@@ -2,3 +2,4 @@ export * from './base.datasource';
2
2
  export * from './client-side.datasource';
3
3
  export * from './server-side.datasource';
4
4
  export * from './datasource.types';
5
+ export * from './error-handler.dialog';