Skip to content

Commit 3e45334

Browse files
feat(angular,solid,vue): add core signal reactivity feature (#6181)
feat: angular, solid, vue adapters with notifier reactivity feature - Table will expose a optionsStore which is a store storing the table options. This remove the necessity to call table.baseStore.setOptions(prev => ({...prev})) on every setOptions in our adapters. Since options will be reactive and patched with the notifier given by the adapter through thetableReactivityFeature, solid/vue table will update even if an option change after table construction (properties given as a getter) - Add table solid devtools - Improve solid reactivity to automatically react to changes when options change while using signals
1 parent e90baf5 commit 3e45334

File tree

61 files changed

+781
-1210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+781
-1210
lines changed

examples/angular/column-resizing-performant/src/app/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class App {
9292
debugColumns: true,
9393
}))
9494

95-
readonly columnSizing = this.table.Subscribe({
95+
readonly columnSizing = this.table.subscribe({
9696
selector: (state) => state.columnSizing,
9797
})
9898

examples/angular/expanding/src/app/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class App {
105105
JSON.stringify(this.expanded(), undefined, 2),
106106
)
107107

108-
readonly rowSelectionState = this.table.Subscribe({
108+
readonly rowSelectionState = this.table.subscribe({
109109
selector: (state) => state.rowSelection,
110110
})
111111
readonly rawRowSelectionState = computed(() =>

examples/angular/row-selection/src/app/app.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<div class="p-2">
2+
<button class="border rounded px-2" (click)="toggleEnableRowSelection()">
3+
{{ enableRowSelection() ? 'Disable' : 'Enable' }} Row selection
4+
</button>
5+
26
<div class="h-2"></div>
37

48
<table [tanStackTable]="table">

examples/angular/row-selection/src/app/app.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class App {
3232
private readonly rowSelection = signal<RowSelectionState>({})
3333
readonly globalFilter = signal<string>('')
3434
readonly data = signal(makeData(10_000))
35+
readonly enableRowSelection = signal(true)
3536

3637
readonly columns = columnHelper.columns([
3738
columnHelper.display({
@@ -93,7 +94,8 @@ export class App {
9394
state: {
9495
rowSelection: this.rowSelection(),
9596
},
96-
enableRowSelection: true, // enable row selection for all rows
97+
98+
enableRowSelection: this.enableRowSelection(), // enable row selection for all rows
9799
// enableRowSelection: row => row.original.age > 18, // or enable row selection conditionally per row
98100
onRowSelectionChange: (updaterOrValue) => {
99101
this.rowSelection.set(
@@ -104,7 +106,7 @@ export class App {
104106
},
105107
}))
106108

107-
readonly paginationState = this.table.Subscribe({
109+
readonly paginationState = this.table.subscribe({
108110
selector: (state) => state.pagination,
109111
})
110112

@@ -136,4 +138,8 @@ export class App {
136138
refreshData(): void {
137139
this.data.set(makeData(10_000))
138140
}
141+
142+
toggleEnableRowSelection() {
143+
this.enableRowSelection.update((value) => !value)
144+
}
139145
}

examples/angular/row-selection/src/app/selection-column/selection-column.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class TableHeaderSelection {
2929
<input
3030
type="checkbox"
3131
[checked]="context.row.getIsSelected()"
32+
[disabled]="!context.row.getCanSelect()"
3233
(change)="context.row.getToggleSelectedHandler()($event)"
3334
/>
3435
`,

examples/react/basic-external-state/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.9.1",
15+
"@tanstack/react-store": "^0.9.2",
1616
"@tanstack/react-table": "^9.0.0-alpha.15",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/basic-external-store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.9.1",
15+
"@tanstack/react-store": "^0.9.2",
1616
"@tanstack/react-table": "^9.0.0-alpha.15",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/composable-tables/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.9.1",
15+
"@tanstack/react-store": "^0.9.2",
1616
"@tanstack/react-table": "^9.0.0-alpha.15",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/pagination/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.9.1",
15+
"@tanstack/react-store": "^0.9.2",
1616
"@tanstack/react-table": "^9.0.0-alpha.15",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/row-selection/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.9.1",
15+
"@tanstack/react-store": "^0.9.2",
1616
"@tanstack/react-table": "^9.0.0-alpha.15",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

0 commit comments

Comments
 (0)