jsl-ui 9.28.4 → 9.28.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.
@@ -11,6 +11,7 @@ export class ExcelFilter {
11
11
  this.grid = grid;
12
12
  }
13
13
  async show(col) {
14
+ var _a;
14
15
  let values;
15
16
  const filters = this.grid.getFilters();
16
17
  const currentFilters = filters.filter((f) => f.columnId === col.id);
@@ -73,7 +74,11 @@ export class ExcelFilter {
73
74
  const sortedValues = [];
74
75
  if (Array.isArray(values)) {
75
76
  for (const x of values) {
76
- sortedValues.push({ id: [x], txt: x !== null && x !== void 0 ? x : "" });
77
+ let x_txt = x;
78
+ if (col.sortByVisibleValue) {
79
+ x_txt = (_a = this.grid.getFormattedValue(col, x)) !== null && _a !== void 0 ? _a : "";
80
+ }
81
+ sortedValues.push({ id: [x], txt: x_txt !== null && x_txt !== void 0 ? x_txt : "" });
77
82
  }
78
83
  }
79
84
  else {
@@ -84,7 +89,12 @@ export class ExcelFilter {
84
89
  }
85
90
  }
86
91
  // TODO: use custom comparer when available
87
- sortedValues.sort((a, b) => a.txt.toLocaleLowerCase() < b.txt.toLocaleLowerCase() ? -1 : (a.txt.toLocaleLowerCase() > b.txt.toLocaleLowerCase() ? 1 : 0));
92
+ try {
93
+ sortedValues.sort((a, b) => a.txt.toLocaleLowerCase() < b.txt.toLocaleLowerCase() ? -1 : (a.txt.toLocaleLowerCase() > b.txt.toLocaleLowerCase() ? 1 : 0));
94
+ }
95
+ catch (e) {
96
+ // some things are not sortable or not toLocalLowerCase-able
97
+ }
88
98
  let visibleValues = sortedValues;
89
99
  const checkedValues = { ...oldCheckedValues };
90
100
  const cbContainer = document.createElement("div");