From 1d3e8bc79566f58ce92223517f161c954fec04bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Tue, 7 Nov 2023 19:43:13 -0300 Subject: [PATCH 1/6] fix(lib): rename className attr to class --- apps/www/src/lib/registry/default/example/button-icon.svelte | 2 +- apps/www/src/lib/registry/new-york/example/button-icon.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/src/lib/registry/default/example/button-icon.svelte b/apps/www/src/lib/registry/default/example/button-icon.svelte index 858bc0aa1..cb9552d67 100644 --- a/apps/www/src/lib/registry/default/example/button-icon.svelte +++ b/apps/www/src/lib/registry/default/example/button-icon.svelte @@ -4,5 +4,5 @@ diff --git a/apps/www/src/lib/registry/new-york/example/button-icon.svelte b/apps/www/src/lib/registry/new-york/example/button-icon.svelte index 74a1f6f2d..28fb63b81 100644 --- a/apps/www/src/lib/registry/new-york/example/button-icon.svelte +++ b/apps/www/src/lib/registry/new-york/example/button-icon.svelte @@ -4,5 +4,5 @@ From 0b4843f7461d3ed0c5f206dd7d024794ba4ea979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Tue, 7 Nov 2023 19:43:32 -0300 Subject: [PATCH 2/6] fix(lib): make table full height --- apps/www/src/lib/registry/default/ui/table/table.svelte | 2 +- apps/www/src/lib/registry/new-york/ui/table/table.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/table/table.svelte b/apps/www/src/lib/registry/default/ui/table/table.svelte index 99a093b6a..f945a244c 100644 --- a/apps/www/src/lib/registry/default/ui/table/table.svelte +++ b/apps/www/src/lib/registry/default/ui/table/table.svelte @@ -8,7 +8,7 @@ export { className as class }; -
+
-
+
Date: Tue, 7 Nov 2023 19:44:13 -0300 Subject: [PATCH 3/6] feat(example): add icons for sort column header --- .../(components)/data-table-column-header.svelte | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/www/src/routes/examples/tasks/(components)/data-table-column-header.svelte b/apps/www/src/routes/examples/tasks/(components)/data-table-column-header.svelte index 48b84e17d..24b149108 100644 --- a/apps/www/src/routes/examples/tasks/(components)/data-table-column-header.svelte +++ b/apps/www/src/routes/examples/tasks/(components)/data-table-column-header.svelte @@ -53,12 +53,14 @@ - Asc - Desc + + + Asc + + + + Desc + From e5375d6ca4998bc71bc58c0dbb07768641cc84f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Tue, 7 Nov 2023 19:56:20 -0300 Subject: [PATCH 4/6] feat(example): add sidebars on tasks examples --- .../data-table-faceted-filter.svelte | 164 +++++++++---- .../data-table-filter-left-sidebar.svelte | 69 ++++++ .../data-table-filter-right-sidebar.svelte | 100 ++++++++ .../(components)/data-table-pagination.svelte | 2 +- .../(components)/data-table-toolbar.svelte | 98 +++++--- .../tasks/(components)/data-table.svelte | 220 +++++++++++++----- .../examples/tasks/(components)/index.ts | 2 + 7 files changed, 506 insertions(+), 149 deletions(-) create mode 100644 apps/www/src/routes/examples/tasks/(components)/data-table-filter-left-sidebar.svelte create mode 100644 apps/www/src/routes/examples/tasks/(components)/data-table-filter-right-sidebar.svelte 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 @@ + + +