Skip to content

Commit 4857b5d

Browse files
committed
docs: update docs to include filtering
1 parent 8371464 commit 4857b5d

File tree

20 files changed

+2051
-63
lines changed

20 files changed

+2051
-63
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "svelte-reactive-table",
2+
"name": "svelte-reactive-table-monorepo",
33
"version": "1.0.0",
44
"description": "Monorepo for svelte-reactive-table",
55
"main": "index.js",

pnpm-lock.yaml

Lines changed: 38 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sites/docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"devDependencies": {
2828
"@hbsnow/rehype-sectionize": "^1.0.7",
2929
"@internationalized/date": "^3.8.2",
30-
"@lucide/svelte": "^0.516.0",
30+
"@lucide/svelte": "^0.544.0",
3131
"@shikijs/transformers": "^3.6.0",
3232
"@sveltejs/adapter-auto": "^6.0.1",
3333
"@sveltejs/adapter-vercel": "^5.7.2",
3434
"@sveltejs/kit": "^2.21.5",
3535
"@sveltejs/vite-plugin-svelte": "^5.1.0",
3636
"@tailwindcss/typography": "^0.5.16",
3737
"@tailwindcss/vite": "^4.1.10",
38-
"bits-ui": "^2.8.0",
38+
"bits-ui": "^2.14.1",
3939
"clsx": "^2.1.1",
4040
"mdsvex": "^0.12.6",
4141
"mode-watcher": "1.0.8",
@@ -44,7 +44,7 @@
4444
"shiki": "^3.6.0",
4545
"svelte": "5.34.4",
4646
"svelte-check": "^4.2.1",
47-
"svelte-reactive-table": "^0.5.0",
47+
"svelte-reactive-table": "workspace:*",
4848
"tailwind-merge": "^3.3.1",
4949
"tailwind-variants": "^1.0.0",
5050
"tailwindcss": "^4.1.10",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<script lang="ts">
2+
import { Checkbox as CheckboxPrimitive } from "bits-ui";
3+
import CheckIcon from "@lucide/svelte/icons/check";
4+
import MinusIcon from "@lucide/svelte/icons/minus";
5+
import { cn, type WithoutChildrenOrChild } from "$lib/shared/lib/shadcn.js";
6+
7+
let {
8+
ref = $bindable(null),
9+
checked = $bindable(false),
10+
indeterminate = $bindable(false),
11+
class: className,
12+
...restProps
13+
}: WithoutChildrenOrChild<CheckboxPrimitive.RootProps> = $props();
14+
</script>
15+
16+
<CheckboxPrimitive.Root
17+
bind:ref
18+
data-slot="checkbox"
19+
class={cn(
20+
"border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive shadow-xs peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border outline-none transition-shadow focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
21+
className
22+
)}
23+
bind:checked
24+
bind:indeterminate
25+
{...restProps}
26+
>
27+
{#snippet children({ checked, indeterminate })}
28+
<div data-slot="checkbox-indicator" class="text-current transition-none">
29+
{#if checked}
30+
<CheckIcon class="size-3.5" />
31+
{:else if indeterminate}
32+
<MinusIcon class="size-3.5" />
33+
{/if}
34+
</div>
35+
{/snippet}
36+
</CheckboxPrimitive.Root>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Root from "./checkbox.svelte";
2+
export {
3+
Root,
4+
//
5+
Root as Checkbox,
6+
};

sites/docs/src/lib/widgets/menu-sidebar/model/index.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export const data = {
4545
title: 'Column Visibility',
4646
url: '/docs/column-visibility'
4747
},
48+
{
49+
title: 'Filtering',
50+
url: '/docs/filtering'
51+
},
4852
{
4953
title: 'Pagination',
5054
url: '/docs/pagination'
@@ -67,6 +71,10 @@ export const data = {
6771
title: 'Column Visibility',
6872
url: '/docs/examples/column-visibility'
6973
},
74+
{
75+
title: 'Filtering',
76+
url: '/docs/examples/filtering'
77+
},
7078
{
7179
title: 'Pagination',
7280
url: '/docs/examples/pagination'
@@ -89,14 +97,18 @@ export const data = {
8997
title: 'reactiveTable',
9098
url: '/docs/api/reactive-table'
9199
},
92-
{
93-
title: 'reactivePagination',
94-
url: '/docs/api/reactive-pagination'
95-
},
96100
{
97101
title: 'reactiveColumnVisibility',
98102
url: '/docs/api/reactive-column-visibility'
99103
},
104+
{
105+
title: 'reactiveFiltering',
106+
url: '/docs/api/reactive-filtering'
107+
},
108+
{
109+
title: 'reactivePagination',
110+
url: '/docs/api/reactive-pagination'
111+
},
100112
{
101113
title: 'reactiveSorting',
102114
url: '/docs/api/reactive-sorting'

sites/docs/src/routes/docs/api/reactive-column-visibility/+page.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,31 @@ const table = reactiveTable<User>(users, columns).use(
258258
// TypeScript will infer the correct column visibility state type
259259
const { columnVisibility } = table.plugins;
260260
```
261+
262+
## Integration with Other Plugins
263+
264+
Column visibility works seamlessly with all other plugins:
265+
266+
```ts
267+
const table = reactiveTable(data, columns)
268+
.use(reactiveColumnVisibility({ hiddenColumns: ['email'] }))
269+
.use(reactiveFiltering())
270+
.use(reactiveSorting())
271+
.use(reactivePagination({ pageSize: 10 }));
272+
273+
// Column visibility affects all plugins:
274+
// - Hidden columns are not sortable
275+
// - Hidden columns are not included in table.rows cells
276+
// - All other plugins work with visible columns only
277+
```
278+
279+
When combined with other plugins:
280+
- Hidden columns are excluded from all plugin operations
281+
- Only visible columns appear in `table.columns` and `table.headers`
282+
- Hidden columns remain in `table.allColumns` for reference
283+
284+
## Related
285+
286+
- [Column Visibility Guide](/docs/column-visibility) - Comprehensive guide with examples
287+
- [Column Visibility Example](/docs/examples/column-visibility) - Interactive example
288+
- [Column Definition](/docs/column-definition) - Learn about column configuration

0 commit comments

Comments
 (0)