@cdmx/wappler_ag_grid 1.5.4 → 1.5.6

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 (2) hide show
  1. package/dmx-ag-grid.js +6 -3
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -257,6 +257,9 @@ dmx.Component('ag-grid', {
257
257
  return;
258
258
  }
259
259
  }
260
+ if (!gridInstance) {
261
+ return;
262
+ }
260
263
  const oldRowData = [];
261
264
  gridInstance.forEachNode(node => {
262
265
  if (node.data) {
@@ -764,7 +767,7 @@ dmx.Component('ag-grid', {
764
767
  const matchingType = ctypes.find((ct) => ct.field === key);
765
768
  return matchingType ? matchingType.type : null;
766
769
  }
767
- function detectDataType(values) {
770
+ function detectDataType(values) {
768
771
  let hasDate = false;
769
772
  let hasNumber = false;
770
773
  let hasText = false;
@@ -775,7 +778,7 @@ dmx.Component('ag-grid', {
775
778
  } else if (!isNaN(Number(value)) && !(typeof value === "string")) {
776
779
  hasNumber = true;
777
780
  } else if (((new Date(value)).getTime() > 0) && (value.includes('-') || value.includes('/'))) {
778
- hasDate = true;
781
+ hasDate = true;
779
782
  } else {
780
783
  hasText = true;
781
784
  }
@@ -952,7 +955,7 @@ dmx.Component('ag-grid', {
952
955
  // Assuming rowData is an array of objects
953
956
  const values = rowData.map(row => row[key]);
954
957
  const nonNullValues = values.filter(value => value !== null);
955
- const dataType = (ctypes.length>0 ? getCustomDataTypes(key) : detectDataType(nonNullValues));
958
+ const dataType = (ctypes.length > 0 && getCustomDataTypes(key) !== null) ? getCustomDataTypes(key) : detectDataType(nonNullValues);
956
959
  let filter;
957
960
  let valueGetter;
958
961
  let filterValueGetter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",