cilog-lib 1.13.17 → 1.13.18

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.
@@ -1727,7 +1727,27 @@ class CilogGridComponent {
1727
1727
  fontWeight: params.data[params.colDef.field].bold ? 'bold' : null,
1728
1728
  fontStyle: params.data[params.colDef.field].italic ? 'italic' : null
1729
1729
  };
1730
- }
1730
+ },
1731
+ comparator: (valueA, valueB, nodeA, nodeB, isDescending) => {
1732
+ if (!valueA && !valueB)
1733
+ return 0;
1734
+ if (!valueA)
1735
+ return -1;
1736
+ if (!valueB)
1737
+ return 1;
1738
+ switch (col.type) {
1739
+ case ColType.Number:
1740
+ return valueA - valueB;
1741
+ case ColType.Dropdown:
1742
+ const labelA = valueA[col.options['optionLabel']];
1743
+ const labelB = valueB[col.options['optionLabel']];
1744
+ return labelA.localeCompare(labelB);
1745
+ case ColType.Date:
1746
+ return new Date(valueA).getTime() - new Date(valueB).getTime();
1747
+ default:
1748
+ return String(valueA).localeCompare(String(valueB));
1749
+ }
1750
+ },
1731
1751
  };
1732
1752
  cols.push(colDef);
1733
1753
  });