evui 3.3.1 → 3.3.2
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/dist/evui.common.js +33 -19
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +33 -19
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/grid/style/grid.scss +1 -1
- package/src/components/grid/uses.js +26 -15
- package/src/components/treeGrid/style/treeGrid.scss +1 -1
package/package.json
CHANGED
|
@@ -496,21 +496,32 @@ export const sortEvent = (params) => {
|
|
|
496
496
|
const index = getColumnIndex(sortInfo.sortField);
|
|
497
497
|
const type = props.columns[index]?.type || 'string';
|
|
498
498
|
const sortFn = sortInfo.sortOrder === 'desc' ? setDesc : setAsc;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
499
|
+
switch (type) {
|
|
500
|
+
case 'string':
|
|
501
|
+
stores.store.sort((a, b) => {
|
|
502
|
+
if (typeof a[ROW_DATA_INDEX][index] === 'string') {
|
|
503
|
+
return sortFn(a[ROW_DATA_INDEX][index]?.toLowerCase(),
|
|
504
|
+
b[ROW_DATA_INDEX][index]?.toLowerCase());
|
|
505
|
+
}
|
|
506
|
+
return 0;
|
|
507
|
+
});
|
|
508
|
+
break;
|
|
509
|
+
case 'stringNumber':
|
|
510
|
+
stores.store.sort((a, b) => {
|
|
511
|
+
if (typeof a[ROW_DATA_INDEX][index] === 'string' || typeof a[ROW_DATA_INDEX][index] === 'number') {
|
|
512
|
+
return sortFn(Number(a[ROW_DATA_INDEX][index]), Number(b[ROW_DATA_INDEX][index]));
|
|
513
|
+
}
|
|
514
|
+
return 0;
|
|
515
|
+
});
|
|
516
|
+
break;
|
|
517
|
+
default:
|
|
518
|
+
stores.store.sort((a, b) => {
|
|
519
|
+
if (typeof a[ROW_DATA_INDEX][index] === 'number' || typeof a[ROW_DATA_INDEX][index] === 'boolean') {
|
|
520
|
+
return sortFn(a[ROW_DATA_INDEX][index], b[ROW_DATA_INDEX][index]);
|
|
521
|
+
}
|
|
522
|
+
return 0;
|
|
523
|
+
});
|
|
524
|
+
break;
|
|
514
525
|
}
|
|
515
526
|
};
|
|
516
527
|
return { onSort, setSort };
|