@tanstack/svelte-table 8.15.3 → 8.16.0
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.
|
@@ -3480,17 +3480,20 @@
|
|
|
3480
3480
|
var _sortEntry$desc;
|
|
3481
3481
|
const sortEntry = availableSorting[i];
|
|
3482
3482
|
const columnInfo = columnInfoById[sortEntry.id];
|
|
3483
|
+
const sortUndefined = columnInfo.sortUndefined;
|
|
3483
3484
|
const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
|
|
3484
3485
|
let sortInt = 0;
|
|
3485
3486
|
|
|
3486
3487
|
// All sorting ints should always return in ascending order
|
|
3487
|
-
if (
|
|
3488
|
+
if (sortUndefined) {
|
|
3488
3489
|
const aValue = rowA.getValue(sortEntry.id);
|
|
3489
3490
|
const bValue = rowB.getValue(sortEntry.id);
|
|
3490
3491
|
const aUndefined = aValue === undefined;
|
|
3491
3492
|
const bUndefined = bValue === undefined;
|
|
3492
3493
|
if (aUndefined || bUndefined) {
|
|
3493
|
-
|
|
3494
|
+
if (sortUndefined === 'first') return aUndefined ? -1 : 1;
|
|
3495
|
+
if (sortUndefined === 'last') return aUndefined ? 1 : -1;
|
|
3496
|
+
sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
|
|
3494
3497
|
}
|
|
3495
3498
|
}
|
|
3496
3499
|
if (sortInt === 0) {
|