diff --git a/apps/www/src/routes/examples/tasks/(components)/data-table-faceted-filter.svelte b/apps/www/src/routes/examples/tasks/(components)/data-table-faceted-filter.svelte index 42a92f28e..519c52d94 100644 --- a/apps/www/src/routes/examples/tasks/(components)/data-table-faceted-filter.svelte +++ b/apps/www/src/routes/examples/tasks/(components)/data-table-faceted-filter.svelte @@ -11,7 +11,7 @@ export let filterValues: string[] = []; export let title: string; export let options = [] as typeof statuses; - + export let view: "pill" | "list" = "pill"; let open = false; const handleSelect = (currentValue: string) => { @@ -29,48 +29,9 @@ }; - - - - - +{#if view === "list"} +
+ {title} @@ -91,7 +52,7 @@ : "opacity-50 [&_svg]:invisible" )} > - +
{option.label} @@ -99,18 +60,119 @@ {/each} + + + { + filterValues = + filterValues.length > 0 + ? [] + : options.map(({ value }) => value); + }} + > + {#if filterValues.length > 0} + Clear filters + {:else} + Select all + {/if} + + + + +{:else} + + + + + + + + + No results found. + + {#each options as option} + { + handleSelect(currentValue); + }} + > +
+ +
+ + {option.label} + +
+ {/each} +
+ { - filterValues = []; + filterValues = + filterValues.length > 0 + ? [] + : options.map(({ value }) => value); }} > - Clear filters + {#if filterValues.length > 0} + Clear filters + {:else} + Select all + {/if} - {/if} -
-
-
-
+ + +
+
+{/if} diff --git a/apps/www/src/routes/examples/tasks/(components)/data-table-filter-left-sidebar.svelte b/apps/www/src/routes/examples/tasks/(components)/data-table-filter-left-sidebar.svelte new file mode 100644 index 000000000..2b3facd99 --- /dev/null +++ b/apps/www/src/routes/examples/tasks/(components)/data-table-filter-left-sidebar.svelte @@ -0,0 +1,69 @@ + + + diff --git a/apps/www/src/routes/examples/tasks/(components)/data-table-filter-right-sidebar.svelte b/apps/www/src/routes/examples/tasks/(components)/data-table-filter-right-sidebar.svelte new file mode 100644 index 000000000..4efa85021 --- /dev/null +++ b/apps/www/src/routes/examples/tasks/(components)/data-table-filter-right-sidebar.svelte @@ -0,0 +1,100 @@ + + +