@tanstack/table-core 9.0.0-beta.63 → 9.0.0-beta.64

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.
@@ -17,6 +17,7 @@ const globalFilteringFeature = {
17
17
  onGlobalFilterChange: makeStateUpdater("globalFilter", table),
18
18
  globalFilterFn: "auto",
19
19
  getColumnCanGlobalFilter: (column) => {
20
+ if ("enableGlobalFilter" in column.columnDef && column.columnDef.enableGlobalFilter === true) return true;
20
21
  const value = table.getCoreRowModel().flatRows[0]?.getAllCellsByColumnId()[column.id]?.getValue();
21
22
  return typeof value === "string" || typeof value === "number";
22
23
  }
@@ -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
- if (old.length && column_getCanMultiSort(column) && multi) if (existingSorting) sortAction = "toggle";
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
- else if (sortAction === "remove") newSorting = old.filter((d) => d.id !== column.id);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/table-core",
3
- "version": "9.0.0-beta.63",
3
+ "version": "9.0.0-beta.64",
4
4
  "description": "Headless UI for building powerful tables & datagrids for TS/JS.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -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.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:packages/table-core/src/index.ts'
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -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.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/row-models.md'
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'column-filtering']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'column-sizing']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'column-sizing']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: core
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  sources:
10
10
  - 'TanStack/table:docs/overview.md'
11
11
  - 'TanStack/table:docs/guide/tables.md'
@@ -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.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  requires: ['core', 'table-features', 'typescript']
10
10
  sources:
11
11
  - 'TanStack/table:docs/framework/react/guide/custom-features.md'
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server', 'column-filtering']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -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.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  requires: ['core', 'table-features', 'typescript']
10
10
  sources:
11
11
  - 'TanStack/table:docs/framework/react/guide/migrating.md'
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.63',
9
+ library_version: '9.0.0-beta.64',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -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.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  requires: ['core']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/row-models.md'
@@ -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.63'
8
+ library_version: '9.0.0-beta.64'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/helpers.md'