@cdmx/wappler_ag_grid 1.4.6 → 1.4.8
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.
- package/dmx-ag-grid.js +13 -14
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -768,7 +768,7 @@ dmx.Component('ag-grid', {
|
|
|
768
768
|
hasText = true;
|
|
769
769
|
} else if (!isNaN(Number(value)) && !(typeof value === "string")) {
|
|
770
770
|
hasNumber = true;
|
|
771
|
-
} else if ((new Date(value)).getTime() > 0) {
|
|
771
|
+
} else if (((new Date(value)).getTime() > 0) && (value.includes('-') || value.includes('/'))) {
|
|
772
772
|
hasDate = true;
|
|
773
773
|
} else {
|
|
774
774
|
hasText = true;
|
|
@@ -1402,27 +1402,26 @@ dmx.Component('ag-grid', {
|
|
|
1402
1402
|
if (columnsToCount) {
|
|
1403
1403
|
columnsToCount.forEach(function (colObj) {
|
|
1404
1404
|
const col = colObj.field;
|
|
1405
|
-
const uniqueValuesToCount = colObj.unique_values.split(',');
|
|
1405
|
+
const uniqueValuesToCount = new Set(colObj.unique_values.split(','));
|
|
1406
1406
|
result[0][col] = 0;
|
|
1407
|
-
|
|
1408
|
-
|
|
1407
|
+
const countedValues = new Set();
|
|
1408
|
+
const uniqueValues = new Set();
|
|
1409
|
+
|
|
1409
1410
|
rowData.forEach(function (line) {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1411
|
+
const value = line.data[col];
|
|
1412
|
+
|
|
1413
|
+
if (line.index < rowData.length && value !== undefined) {
|
|
1414
|
+
if (uniqueValuesToCount.has(value.toString()) && !countedValues.has(value)) {
|
|
1414
1415
|
result[0][col]++;
|
|
1416
|
+
countedValues.add(value);
|
|
1415
1417
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
result[0][col]++;
|
|
1419
|
-
} else if (typeof value === 'string' && uniqueValuesToCount.includes(value) && !uniqueValues.has(value)) {
|
|
1418
|
+
|
|
1419
|
+
if (!uniqueValues.has(value)) {
|
|
1420
1420
|
uniqueValues.add(value);
|
|
1421
|
-
result[0][col]++;
|
|
1422
1421
|
}
|
|
1423
1422
|
}
|
|
1424
1423
|
});
|
|
1425
|
-
|
|
1424
|
+
|
|
1426
1425
|
result[0][col + '_unique_count'] = uniqueValues.size;
|
|
1427
1426
|
});
|
|
1428
1427
|
}
|