Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/angular/basic-external-atoms/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ export class App {
}

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}
}
2 changes: 1 addition & 1 deletion examples/angular/basic-external-state/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData() {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-groups/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData = () => this.data.set(makeData(20))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-ordering/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

randomizeColumns() {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-pinning-split/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class App {
this.table.getRowModel().rows.slice(0, 20),
)
readonly stringifiedState = computed(() =>
JSON.stringify(this.table.state, null, 2),
JSON.stringify(this.table.store.get(), null, 2),
)

refreshData = () => this.data.set(makeData(20))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-pinning-sticky/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

readonly getCommonPinningStyles = (
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-pinning/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

randomizeColumns() {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-resizing-performant/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class App {
})

readonly stringifiedState = computed(() =>
JSON.stringify(this.table.state, null, 2),
JSON.stringify(this.table.store.get(), null, 2),
)

refreshData = () => this.data.set(makeData(200))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-resizing/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

setResizeMode(event: Event) {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-sizing/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData = () => this.data.set(makeData(20))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/column-visibility/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData = () => this.data.set(makeData(20))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export class RowCount {
<span>
Page
<strong>
{{ (table().state.pagination.pageIndex + 1).toLocaleString() }} of
{{ (table().atoms.pagination.get().pageIndex + 1).toLocaleString() }}
of
{{ pageCount() }}
</strong>
</span>
Expand All @@ -88,12 +89,12 @@ export class RowCount {
type="number"
min="1"
[max]="table().getPageCount()"
[value]="table().state.pagination.pageIndex + 1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably just be atom lookups, but fine either way

[value]="table().atoms.pagination.get().pageIndex + 1"
(change)="onPageChange($event)"
/>
</span>
<select
[value]="table().state.pagination.pageSize"
[value]="table().atoms.pagination.get().pageSize"
(change)="onPageSizeChange($event)"
>
@for (size of pageSizes; track size) {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/expanding/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

onPageInputChange(event: Event): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/filters-faceted/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

onPageInputChange(event: Event): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/filters-fuzzy/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}
refreshData = () => this.data.set(makeData(1_000))
stressTest = () => this.data.set(makeData(50_000))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/filters/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

onPageInputChange(event: Event): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/grouping/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

onPageInputChange(event: any): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/kitchen-sink/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class App {
})

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

pageIndex() {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/pagination/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData = () => this.data.set(makeData(100_000))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/row-pinning/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}
refreshData = () => this.data.set(makeData(1_000, 2, 2))
stressTest = () => this.data.set(makeData(200_000, 2, 2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class AppComponent {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

readonly rowSelectionLength = computed(
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/row-selection/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

readonly rowSelectionLength = computed(
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/sorting/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData = () => this.data.set(makeData(1_000))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/virtualized-rows/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class App {
readonly totalSize = computed(() => this.rowVirtualizer.getTotalSize())

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

refreshData = () => this.data.set(makeData(200_000))
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/with-tanstack-form/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class App {
z.array(personSchema).safeParse(this.data()),
)
stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

update(rowIndex: number, key: keyof Person, event: Event) {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/with-tanstack-query/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class App {
}))

stringifiedState() {
return JSON.stringify(this.table.state, null, 2)
return JSON.stringify(this.table.store.get(), null, 2)
}

rerender = () => this.pagination.update((pagination) => ({ ...pagination }))
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/basic-external-atoms/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function App() {
</select>
</div>
<div class="spacer-md" />
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/basic-external-state/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function App() {
</select>
</div>
<div class="spacer-md" />
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/column-ordering/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function App() {
</tfoot>
</table>
<div class="spacer-md" />
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/column-pinning-split/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function App() {
</tbody>
</table>
</div>
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/column-pinning-sticky/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function App() {
</tbody>
</table>
</div>
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/column-pinning/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function App() {
</tbody>
</table>
</div>
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/column-resizing-performant/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function App() {
</i>
<div class="spacer-md" />
<pre style={{ 'min-height': '10rem' }}>
{JSON.stringify(table.state(), null, 2)}
{JSON.stringify(table.store.get(), null, 2)}
</pre>
<div class="spacer-md" />({data().length.toLocaleString()} rows)
<div class="scroll-container">
Expand Down
4 changes: 2 additions & 2 deletions examples/solid/column-resizing/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function App() {
header: ReturnType<typeof table.getHeaderGroups>[number]['headers'][number],
) => {
if (columnResizeMode() === 'onEnd' && header.column.getIsResizing()) {
const delta = table.state().columnResizing.deltaOffset ?? 0
const delta = table.atoms.columnResizing.get().deltaOffset ?? 0
const dir = table.options.columnResizeDirection === 'rtl' ? -1 : 1
return `translateX(${dir * delta}px)`
}
Expand Down Expand Up @@ -293,7 +293,7 @@ function App() {
</div>
</div>
<div class="spacer-md" />
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/solid/column-sizing/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function App() {
value={column.getSize()}
onInput={(e) => {
table.setColumnSizing({
...table.state().columnSizing,
...table.atoms.columnSizing.get(),
[column.id]: Number(e.currentTarget.value),
})
}}
Expand Down Expand Up @@ -244,7 +244,7 @@ function App() {
</div>
</div>
<div class="spacer-md" />
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/column-visibility/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function App() {
</tfoot>
</table>
<div class="spacer-md" />
<pre>{JSON.stringify(table.state(), null, 2)}</pre>
<pre>{JSON.stringify(table.store.get(), null, 2)}</pre>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useTableContext } from '../hooks/table'
export function PaginationControls() {
const table = useTableContext()

const pagination = createMemo(() => table.state().pagination)
const pagination = createMemo(() => table.atoms.pagination.get())

return (
<div class="pagination">
Expand Down
Loading
Loading