@tanstack/table-core 9.0.0-beta.63 → 9.0.0-beta.65
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/features/global-filtering/globalFilteringFeature.js +2 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
- package/package.json +1 -1
- package/skills/aggregation/SKILL.md +1 -1
- package/skills/api-not-found/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +1 -1
- package/skills/client-vs-server/SKILL.md +1 -1
- package/skills/column-faceting/SKILL.md +1 -1
- package/skills/column-filtering/SKILL.md +1 -1
- package/skills/column-ordering/SKILL.md +1 -1
- package/skills/column-pinning/SKILL.md +1 -1
- package/skills/column-resizing/SKILL.md +1 -1
- package/skills/column-sizing/SKILL.md +1 -1
- package/skills/column-visibility/SKILL.md +1 -1
- package/skills/core/SKILL.md +1 -1
- package/skills/custom-features/SKILL.md +1 -1
- package/skills/expanding/SKILL.md +1 -1
- package/skills/global-filtering/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/migrate-v8-to-v9/SKILL.md +1 -1
- package/skills/pagination/SKILL.md +1 -1
- package/skills/row-pinning/SKILL.md +1 -1
- package/skills/row-selection/SKILL.md +1 -1
- package/skills/sorting/SKILL.md +1 -1
- package/skills/table-features/SKILL.md +1 -1
- package/skills/typescript/SKILL.md +1 -1
|
@@ -17,7 +17,8 @@ const globalFilteringFeature = {
|
|
|
17
17
|
onGlobalFilterChange: makeStateUpdater("globalFilter", table),
|
|
18
18
|
globalFilterFn: "auto",
|
|
19
19
|
getColumnCanGlobalFilter: (column) => {
|
|
20
|
-
|
|
20
|
+
if ("enableGlobalFilter" in column.columnDef && column.columnDef.enableGlobalFilter === true) return true;
|
|
21
|
+
const value = table.getCoreRowModel().flatRows.find((row) => row.getAllCellsByColumnId()[column.id]?.getValue() != null)?.getAllCellsByColumnId()[column.id]?.getValue();
|
|
21
22
|
return typeof value === "string" || typeof value === "number";
|
|
22
23
|
}
|
|
23
24
|
};
|
|
@@ -144,9 +144,9 @@ function column_toggleSorting(column, desc, multi) {
|
|
|
144
144
|
let newSorting = [];
|
|
145
145
|
let sortAction;
|
|
146
146
|
const nextDesc = hasManualValue ? desc : nextSortingOrder === "desc";
|
|
147
|
-
|
|
147
|
+
const isMultiMode = !!(old.length && column_getCanMultiSort(column) && multi);
|
|
148
|
+
if (isMultiMode) if (existingSorting) sortAction = "toggle";
|
|
148
149
|
else sortAction = "add";
|
|
149
|
-
else if (old.length && existingIndex !== old.length - 1) sortAction = "replace";
|
|
150
150
|
else if (existingSorting) sortAction = "toggle";
|
|
151
151
|
else sortAction = "replace";
|
|
152
152
|
if (sortAction === "toggle") {
|
|
@@ -160,14 +160,17 @@ function column_toggleSorting(column, desc, multi) {
|
|
|
160
160
|
desc: nextDesc
|
|
161
161
|
}];
|
|
162
162
|
newSorting.splice(0, newSorting.length - (column.table.options.maxMultiSortColCount ?? Number.MAX_SAFE_INTEGER));
|
|
163
|
-
} else if (sortAction === "toggle") newSorting = old.map((d) => {
|
|
163
|
+
} else if (sortAction === "toggle") newSorting = isMultiMode ? old.map((d) => {
|
|
164
164
|
if (d.id === column.id) return {
|
|
165
165
|
...d,
|
|
166
166
|
desc: nextDesc
|
|
167
167
|
};
|
|
168
168
|
return d;
|
|
169
|
-
})
|
|
170
|
-
|
|
169
|
+
}) : [{
|
|
170
|
+
id: column.id,
|
|
171
|
+
desc: nextDesc
|
|
172
|
+
}];
|
|
173
|
+
else if (sortAction === "remove") newSorting = isMultiMode ? old.filter((d) => d.id !== column.id) : [];
|
|
171
174
|
else newSorting = [{
|
|
172
175
|
id: column.id,
|
|
173
176
|
desc: nextDesc
|
package/package.json
CHANGED
package/skills/core/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: sub-skill
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.65'
|
|
9
9
|
requires: ['core', 'table-features', 'typescript']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/framework/react/guide/custom-features.md'
|
package/skills/grouping/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: lifecycle
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.65'
|
|
9
9
|
requires: ['core', 'table-features', 'typescript']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/framework/react/guide/migrating.md'
|
package/skills/sorting/SKILL.md
CHANGED