@tanstack/vue-table 8.9.1 → 8.9.3
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/build/lib/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export declare const FlexRender: import("vue").DefineComponent<Readonly<{
|
|
|
9
9
|
}>>>, {
|
|
10
10
|
readonly props?: any;
|
|
11
11
|
readonly render?: any;
|
|
12
|
-
}>;
|
|
12
|
+
}, {}>;
|
|
13
13
|
export declare function useVueTable<TData extends RowData>(options: TableOptions<TData>): import("@tanstack/table-core").Table<TData>;
|
|
@@ -2320,7 +2320,8 @@
|
|
|
2320
2320
|
},
|
|
2321
2321
|
getDefaultColumnDef: () => {
|
|
2322
2322
|
return {
|
|
2323
|
-
sortingFn: 'auto'
|
|
2323
|
+
sortingFn: 'auto',
|
|
2324
|
+
sortUndefined: 1
|
|
2324
2325
|
};
|
|
2325
2326
|
},
|
|
2326
2327
|
getDefaultOptions: table => {
|
|
@@ -3367,18 +3368,23 @@
|
|
|
3367
3368
|
const sortEntry = availableSorting[i];
|
|
3368
3369
|
const columnInfo = columnInfoById[sortEntry.id];
|
|
3369
3370
|
const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
|
|
3371
|
+
let sortInt = 0;
|
|
3372
|
+
|
|
3373
|
+
// All sorting ints should always return in ascending order
|
|
3370
3374
|
if (columnInfo.sortUndefined) {
|
|
3371
3375
|
const aValue = rowA.getValue(sortEntry.id);
|
|
3372
3376
|
const bValue = rowB.getValue(sortEntry.id);
|
|
3373
|
-
const aUndefined =
|
|
3374
|
-
const bUndefined =
|
|
3377
|
+
const aUndefined = aValue === undefined;
|
|
3378
|
+
const bUndefined = bValue === undefined;
|
|
3375
3379
|
if (aUndefined || bUndefined) {
|
|
3376
|
-
|
|
3380
|
+
sortInt = aUndefined && bUndefined ? 0 : aUndefined ? columnInfo.sortUndefined : -columnInfo.sortUndefined;
|
|
3377
3381
|
}
|
|
3378
3382
|
}
|
|
3383
|
+
if (sortInt === 0) {
|
|
3384
|
+
sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
|
|
3385
|
+
}
|
|
3379
3386
|
|
|
3380
|
-
//
|
|
3381
|
-
let sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
|
|
3387
|
+
// If sorting is non-zero, take care of desc and inversion
|
|
3382
3388
|
if (sortInt !== 0) {
|
|
3383
3389
|
if (isDesc) {
|
|
3384
3390
|
sortInt *= -1;
|