@cdmx/wappler_ag_grid 1.9.13 → 1.9.15

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.
@@ -52,6 +52,11 @@
52
52
  "name": "selectedRows",
53
53
  "title": "selectedRows",
54
54
  "type": "array"
55
+ },
56
+ {
57
+ "name": "columnState",
58
+ "title": "columnState",
59
+ "type": "array"
55
60
  }
56
61
  ],
57
62
  "outputType": "object",
package/dmx-ag-grid.js CHANGED
@@ -6,6 +6,7 @@ dmx.Component('ag-grid', {
6
6
  fields: {},
7
7
  fileData: [],
8
8
  selectedRows: [],
9
+ columnState: [],
9
10
  state: {
10
11
  gridReady: !1,
11
12
  firstDataRendered: !1,
@@ -313,9 +314,10 @@ dmx.Component('ag-grid', {
313
314
  resetColumnState: function () {
314
315
  dmx.nextTick(function() {
315
316
  const idValue = this.$node.querySelector('dmx-ag-grid > div')?.getAttribute('id') ?? 'Grid not found';
316
- const currentPageUrl = window.location.origin + window.location.pathname;
317
+ const currentPageUrl = window.location.pathname;
317
318
  const uniqueId = `${currentPageUrl}_${idValue}`;
318
- localStorage.removeItem(`columnState_${uniqueId}`);
319
+ const storageKey = options.column_state_storage_key || uniqueId;
320
+ localStorage.removeItem(`dmxState-${storageKey}`);
319
321
  let gridInstance = this.refreshGrid();
320
322
  this.set('gridInstance', gridInstance);
321
323
  }, this);
@@ -1651,13 +1653,14 @@ dmx.Component('ag-grid', {
1651
1653
  const columnState = columnApi.getColumnState();
1652
1654
  const pageId = getPageId();
1653
1655
  const storageKey = options.column_state_storage_key || pageId;
1654
- localStorage.setItem(`columnState_${storageKey}`, JSON.stringify(columnState));
1656
+ localStorage.setItem(`dmxState-${storageKey}`, JSON.stringify(columnState));
1657
+ this.set('columnState', columnState);
1655
1658
  }
1656
1659
 
1657
1660
  function restoreColumnState() {
1658
1661
  const pageId = getPageId();
1659
1662
  const storageKey = options.column_state_storage_key || pageId;
1660
- const savedColumnState = localStorage.getItem(`columnState_${storageKey}`);
1663
+ const savedColumnState = localStorage.getItem(`dmxState-${storageKey}`);
1661
1664
 
1662
1665
  if (savedColumnState) {
1663
1666
  try {
@@ -1668,7 +1671,7 @@ dmx.Component('ag-grid', {
1668
1671
  applyVisibility: true,
1669
1672
  });
1670
1673
  } catch (err) {
1671
- console.warn(`Failed to parse column state for key: columnState_${storageKey}`, err);
1674
+ console.warn(`Failed to parse column state for key: dmxState-${storageKey}`, err);
1672
1675
  }
1673
1676
  }
1674
1677
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.9.13",
3
+ "version": "1.9.15",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",
@@ -14,8 +14,8 @@
14
14
  "ag-grid"
15
15
  ],
16
16
  "dependencies": {
17
- "@ag-grid-community/locale": "~33.2.4",
18
- "ag-grid-community": "~33.2.4",
17
+ "@ag-grid-community/locale": "~32.3.7",
18
+ "ag-grid-community": "~32.3.7",
19
19
  "papaparse": "~5.5.2",
20
20
  "pdfmake": "~0.2.18",
21
21
  "read-excel-file": "~5.8.7"