Skip to content

Commit f5d2857

Browse files
committed
docs: update documentation for latest version of library
1 parent 99fff82 commit f5d2857

File tree

142 files changed

+2588
-1553
lines changed

Some content is hidden

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

142 files changed

+2588
-1553
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ Svelte Reactive Table is designed to give you complete control over your data ta
1717
1818
// Your data array
1919
const data = [
20-
{ name: 'John Doe', age: 30, city: 'New York' },
21-
{ name: 'Jane Smith', age: 25, city: 'Los Angeles' },
20+
{ id: 1, name: 'John Doe', age: 30, city: 'New York' },
21+
{ id: 2, name: 'Jane Smith', age: 25, city: 'Los Angeles' },
2222
];
2323
2424
// Define your columns
2525
const columns = [
26+
{ accessor: 'id', header: 'ID', isIdentifier: true },
2627
{ accessor: 'name', header: 'Name' },
2728
{ accessor: 'age', header: 'Age' },
2829
{ accessor: 'city', header: 'City' }
@@ -63,18 +64,18 @@ Svelte Reactive Table is designed to give you complete control over your data ta
6364
- ⬜ Custom header rendering
6465
-**Reactive Core**
6566
- ✅ Reactive data binding
66-
-Column visibility control
67+
-Plugin architecture
6768
- ⬜ Dynamic column updates
6869
- ⬜ Computed columns
69-
- 🔄 **Sorting**
70+
- 🔄 **Sorting Plugin**
7071
- ✅ Column-based sorting
7172
- ✅ Multi-column sort
7273
- ✅ Custom comparators
7374
- 🔍 **Filtering**
7475
- ⬜ Global search
7576
- ⬜ Column filters
7677
- ⬜ Custom filter functions
77-
- 📊 **Pagination**
78+
- 📊 **Pagination Plugin**
7879
- ✅ Page size control
7980
- ✅ Page navigation
8081
- ✅ First/last page navigation
@@ -86,7 +87,7 @@ Svelte Reactive Table is designed to give you complete control over your data ta
8687
- 🔗 **Column Management**
8788
- ⬜ Column resizing
8889
- ⬜ Column reordering
89-
- ✅ Column visibility toggle
90+
- ✅ Column visibility plugin
9091

9192
## Project Structure
9293

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939
]
4040
},
4141
"devDependencies": {
42-
"@changesets/cli": "^2.27.1",
43-
"@eslint/compat": "^1.2.5",
44-
"@eslint/js": "^9.18.0",
45-
"eslint": "^9.18.0",
46-
"eslint-config-prettier": "^10.0.1",
47-
"eslint-plugin-svelte": "^3.0.0",
48-
"globals": "^16.0.0",
42+
"@changesets/cli": "^2.29.4",
43+
"@eslint/compat": "^1.2.9",
44+
"@eslint/js": "^9.27.0",
45+
"eslint": "^9.27.0",
46+
"eslint-config-prettier": "^10.1.5",
47+
"eslint-plugin-svelte": "^3.9.0",
48+
"globals": "^16.1.0",
4949
"prettier": "^3.5.3",
50-
"prettier-plugin-svelte": "^3.3.3",
51-
"turbo": "^2.5.2",
52-
"typescript-eslint": "^8.20.0"
50+
"prettier-plugin-svelte": "^3.4.0",
51+
"turbo": "^2.5.3",
52+
"typescript-eslint": "^8.32.1"
5353
}
5454
}

packages/svelte-reactive-table/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ Svelte Reactive Table is designed to give you complete control over your data ta
1717
1818
// Your data array
1919
const data = [
20-
{ name: 'John Doe', age: 30, city: 'New York' },
21-
{ name: 'Jane Smith', age: 25, city: 'Los Angeles' }
20+
{ id: 1, name: 'John Doe', age: 30, city: 'New York' },
21+
{ id: 2, name: 'Jane Smith', age: 25, city: 'Los Angeles' }
2222
];
2323
2424
// Define your columns
2525
const columns = [
26+
{ accessor: 'id', header: 'ID', isIdentifier: true },
2627
{ accessor: 'name', header: 'Name' },
2728
{ accessor: 'age', header: 'Age' },
2829
{ accessor: 'city', header: 'City' }
@@ -63,18 +64,18 @@ Svelte Reactive Table is designed to give you complete control over your data ta
6364
- ⬜ Custom header rendering
6465
-**Reactive Core**
6566
- ✅ Reactive data binding
66-
-Column visibility control
67+
-Plugin architecture
6768
- ⬜ Dynamic column updates
6869
- ⬜ Computed columns
69-
- 🔄 **Sorting**
70+
- 🔄 **Sorting Plugin**
7071
- ✅ Column-based sorting
7172
- ✅ Multi-column sort
7273
- ✅ Custom comparators
7374
- 🔍 **Filtering**
7475
- ⬜ Global search
7576
- ⬜ Column filters
7677
- ⬜ Custom filter functions
77-
- 📊 **Pagination**
78+
- 📊 **Pagination Plugin**
7879
- ✅ Page size control
7980
- ✅ Page navigation
8081
- ✅ First/last page navigation
@@ -86,7 +87,7 @@ Svelte Reactive Table is designed to give you complete control over your data ta
8687
- 🔗 **Column Management**
8788
- ⬜ Column resizing
8889
- ⬜ Column reordering
89-
- ✅ Column visibility toggle
90+
- ✅ Column visibility plugin
9091

9192
## License
9293

packages/svelte-reactive-table/src/lib/core/types/plugin.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ export interface TablePlugin<T, TPluginState, TPluginId extends string = string>
1414
readonly id: TPluginId;
1515

1616
/**
17-
* Initialize the plugin and attach it to the table
17+
* Initialize the plugin state
1818
*
19-
* @param table - The table instance to attach to
19+
* @param getRows - Function to retrieve the current rows of the table
20+
* @param getColumns - Function to retrieve the current columns of the table
2021
* @returns The plugin state and any enhancements to the table
2122
*/
2223
init(getRows: () => Row<T>[], getColumns: () => Column<T>[]): PluginOutput<T, TPluginState>;
@@ -33,9 +34,14 @@ export interface PluginOutput<T, TPluginState = unknown> {
3334
* The state of the plugin which will be accessible via table.plugins[id]
3435
*/
3536
state: TPluginState;
36-
37+
/**
38+
* The rows transformed by the plugin
39+
*/
3740
rows: Row<T>[];
3841

42+
/**
43+
* The columns transformed by the plugin
44+
*/
3945
columns: Column<T>[];
4046
}
4147

packages/svelte-reactive-table/src/lib/plugins/sorting/sorting.svelte.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ describe('reactiveSorting', () => {
148148
expect(multiSortOutput.rows[1].original.rating).toBe(4);
149149
expect(multiSortOutput.rows[2].original.rating).toBe(5);
150150
expect(multiSortOutput.rows[3].original.rating).toBe(null);
151-
152151
});
153152

154153
it('should cycle through asc, desc, then remove in multi-sort mode', () => {

packages/svelte-reactive-table/src/routes/components/Sorting.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// Optional: Set initial sorting
2929
columnSortings: [{ key: 'age', direction: 'desc' }],
3030
// Disable multi-column sorting
31-
multiSort: false,
31+
multiSort: false
3232
})
3333
);
3434

0 commit comments

Comments
 (0)