Skip to content

Commit df81835

Browse files
committed
fix some type errors in examples
1 parent 9af64a2 commit df81835

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

examples/angular/column-pinning-sticky/src/app/app.component.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
columnSizingFeature,
88
columnVisibilityFeature,
99
injectTable,
10+
tableFeatures,
1011
} from '@tanstack/angular-table'
1112
import { faker } from '@faker-js/faker'
1213
import { NgStyle } from '@angular/common'
@@ -28,7 +29,15 @@ type Person = {
2829
progress: number
2930
}
3031

31-
const defaultColumns: Array<ColumnDef<any, Person>> = [
32+
const _features = tableFeatures({
33+
columnOrderingFeature,
34+
columnPinningFeature,
35+
columnResizingFeature,
36+
columnSizingFeature,
37+
columnVisibilityFeature,
38+
})
39+
40+
const defaultColumns: Array<ColumnDef<typeof _features, Person>> = [
3241
{
3342
accessorKey: 'firstName',
3443
id: 'firstName',
@@ -92,13 +101,7 @@ export class AppComponent {
92101
readonly split = signal(false)
93102

94103
table = injectTable(() => ({
95-
_features: {
96-
columnOrderingFeature,
97-
columnPinningFeature,
98-
columnResizingFeature,
99-
columnSizingFeature,
100-
columnVisibilityFeature,
101-
},
104+
_features,
102105
columns: this.columns(),
103106
data: this.data(),
104107
enableExperimentalReactivity: true,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export class AppComponent {
106106
},
107107
]
108108

109-
table = injectTable(() => ({
109+
// TODO make this generic infer without passing in manually
110+
table = injectTable<typeof _features, Person>(() => ({
110111
_features,
111112
_rowModels: {
112113
filteredRowModel: createFilteredRowModel(filterFns),

examples/svelte/basic-table-helper/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
4545
// 3. New in V9! Tell the table which features and row models we want to use. In this case, this will be a basic table with no additional features
4646
const tableHelper = createTableHelper({
47-
_features: { columnSizingFeature: {} },
47+
_features: {},
4848
_rowModels: {}, // client-side row models. `Core` row model is now included by default, but you can still override it here
4949
debugTable: true,
5050
// TData: {} as Person, // optionally, set the TData type for the table helper. Omit if this will be a table helper for multiple tables of all different data types

examples/svelte/basic/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @ts-ignore
1+
// @ts-ignore - Svelte type definitions are not properly recognized
22
import { mount } from 'svelte'
33
import App from './App.svelte'
44

examples/svelte/filtering/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
_features,
6363
_rowModels: {
6464
filteredRowModel: createFilteredRowModel({
65-
filterFns: { ...filterFns, fuzzy: fuzzyFilter },
65+
...filterFns, fuzzy: fuzzyFilter
6666
}),
6767
paginatedRowModel: createPaginatedRowModel(),
6868
},

packages/svelte-table/src/createTable.svelte.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ export function createTable<
3535
},
3636
)
3737

38-
console.log(statefulOptions)
39-
4038
const table = constructTable(statefulOptions)
4139

4240
function updateOptions() {

0 commit comments

Comments
 (0)