negodesign 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/breadcrumb/breadcrumb-list.svelte +31 -31
- package/dist/components/core/button/ButtonBack.svelte +18 -18
- package/dist/components/core/button/ButtonLogin.svelte +15 -15
- package/dist/components/core/button/ButtonLoginWith.svelte +57 -57
- package/dist/components/core/carousel/data/CarouselModel.d.ts +2 -1
- package/dist/components/core/datatable/ui/DataTableActions.svelte +28 -28
- package/dist/components/core/datatable/ui/DataTableCheckbox.svelte +22 -22
- package/dist/components/core/datatable/ui/DataTableContent.svelte +59 -59
- package/dist/components/core/datatable/ui/DataTableCore.svelte +151 -144
- package/dist/components/core/datatable/ui/DataTableDragHandle.svelte +8 -8
- package/dist/components/core/datatable/ui/DataTableListFilter.svelte +59 -59
- package/dist/components/core/datatable/ui/DataTableListPagination.svelte +35 -35
- package/dist/components/core/form/ui/input-base.svelte +81 -81
- package/dist/components/core/form/ui/input-email.svelte +23 -22
- package/dist/components/core/form/ui/input-password-confirm.svelte +23 -22
- package/dist/components/core/form/ui/input-password.svelte +23 -22
- package/dist/components/core/form/ui/input-phone.svelte +23 -0
- package/dist/components/core/form/ui/input-phone.svelte.d.ts +4 -0
- package/dist/components/core/form/ui/input-username.svelte +22 -21
- package/dist/components/core/label/LabelOr.svelte +25 -25
- package/dist/components/core/link/link-forget-password.svelte +12 -12
- package/dist/components/core/link/link-privacy-polity.svelte +12 -12
- package/dist/components/core/link/link-terms-of-service.svelte +12 -12
- package/dist/components/core/nav/ui/nav-menu-bar.svelte +97 -97
- package/dist/components/core/nav/ui/nav-menu-bottom-bar.svelte +33 -33
- package/dist/components/core/nav/ui/nav-menu-top-bar.svelte +103 -103
- package/dist/components/core/sidebar/{menu-bar-sidebar.svelte → MenuBarSidebar.svelte} +70 -62
- package/dist/components/core/sidebar/{menu-bar-sidebar.svelte.d.ts → MenuBarSidebar.svelte.d.ts} +8 -0
- package/dist/components/core/tabs/ui/tab-underline.svelte +41 -41
- package/dist/components/pages/admin/ui/{admin-content.svelte → AdminContent.svelte} +14 -13
- package/dist/components/pages/admin/ui/{admin-content.svelte.d.ts → AdminContent.svelte.d.ts} +1 -0
- package/dist/components/pages/admin/ui/{admin-panel.svelte → AdminPanel.svelte} +46 -40
- package/dist/components/pages/admin/ui/{admin-panel.svelte.d.ts → AdminPanel.svelte.d.ts} +6 -0
- package/dist/components/pages/login/01/data/page-props.d.ts +21 -0
- package/dist/components/pages/login/01/data/page-props.js +1 -0
- package/dist/components/pages/login/01/ui/AuthCard.svelte +91 -0
- package/dist/components/pages/login/01/ui/AuthCard.svelte.d.ts +20 -0
- package/dist/components/pages/login/01/ui/FormLogin.svelte +56 -0
- package/dist/components/pages/login/01/ui/FormLogin.svelte.d.ts +13 -0
- package/dist/components/pages/login/01/ui/FormLoginEmailPassword.svelte +13 -0
- package/dist/components/pages/login/01/ui/FormLoginEmailPassword.svelte.d.ts +8 -0
- package/dist/components/pages/login/01/ui/FormLoginPhonePassword.svelte +13 -0
- package/dist/components/pages/login/01/ui/FormLoginPhonePassword.svelte.d.ts +8 -0
- package/dist/components/pages/login/01/ui/FormLoginUsernamePassword.svelte +13 -0
- package/dist/components/pages/login/01/ui/FormLoginUsernamePassword.svelte.d.ts +8 -0
- package/dist/components/pages/login/{admin/01 → 01}/ui/FormRegister.svelte +28 -28
- package/dist/components/pages/login/{admin/01 → 01}/ui/LeftHero.svelte +105 -105
- package/dist/components/pages/login/{admin/01 → 01}/ui/LeftHero.svelte.d.ts +1 -1
- package/dist/components/pages/login/01/ui/PageLogin01.svelte +49 -0
- package/dist/components/pages/login/01/ui/PageLogin01.svelte.d.ts +4 -0
- package/dist/components/pages/login/PageLogin.svelte +21 -0
- package/dist/components/pages/login/PageLogin.svelte.d.ts +17 -0
- package/dist/components/ui/badge/badge.svelte +49 -49
- package/dist/components/ui/chart/chart-container.svelte +80 -80
- package/dist/components/ui/chart/chart-style.svelte +37 -37
- package/dist/components/ui/chart/chart-tooltip.svelte +184 -184
- package/dist/components/ui/checkbox/checkbox.svelte +40 -40
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/components/ui/data-table/flex-render.svelte +40 -40
- package/dist/components/ui/drawer/drawer-close.svelte +7 -7
- package/dist/components/ui/drawer/drawer-content.svelte +33 -33
- package/dist/components/ui/drawer/drawer-description.svelte +17 -17
- package/dist/components/ui/drawer/drawer-footer.svelte +20 -20
- package/dist/components/ui/drawer/drawer-header.svelte +20 -20
- package/dist/components/ui/drawer/drawer-nested.svelte +12 -12
- package/dist/components/ui/drawer/drawer-overlay.svelte +17 -17
- package/dist/components/ui/drawer/drawer-portal.svelte +7 -7
- package/dist/components/ui/drawer/drawer-title.svelte +17 -17
- package/dist/components/ui/drawer/drawer-trigger.svelte +7 -7
- package/dist/components/ui/drawer/drawer.svelte +12 -12
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/input/input.svelte.d.ts +1 -1
- package/dist/components/ui/select/select-content.svelte +45 -45
- package/dist/components/ui/select/select-group-heading.svelte +21 -21
- package/dist/components/ui/select/select-group.svelte +17 -17
- package/dist/components/ui/select/select-item.svelte +41 -41
- package/dist/components/ui/select/select-label.svelte +20 -20
- package/dist/components/ui/select/select-portal.svelte +7 -7
- package/dist/components/ui/select/select-scroll-down-button.svelte +21 -21
- package/dist/components/ui/select/select-scroll-up-button.svelte +21 -21
- package/dist/components/ui/select/select-separator.svelte +18 -18
- package/dist/components/ui/select/select-trigger.svelte +30 -30
- package/dist/components/ui/select/select.svelte +11 -11
- package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +2 -2
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
- package/dist/components/ui/table/table-body.svelte +15 -15
- package/dist/components/ui/table/table-caption.svelte +20 -20
- package/dist/components/ui/table/table-cell.svelte +15 -15
- package/dist/components/ui/table/table-footer.svelte +20 -20
- package/dist/components/ui/table/table-head.svelte +15 -15
- package/dist/components/ui/table/table-header.svelte +20 -20
- package/dist/components/ui/table/table-row.svelte +15 -15
- package/dist/components/ui/table/table.svelte +17 -17
- package/dist/components/ui/tabs/tabs-content.svelte +17 -17
- package/dist/components/ui/tabs/tabs-list.svelte +40 -40
- package/dist/components/ui/tabs/tabs-trigger.svelte +23 -23
- package/dist/components/ui/tabs/tabs.svelte +19 -19
- package/dist/components/ui/tabs/tabs.svelte.d.ts +1 -1
- package/dist/components/ui/underline-tabs/underline-tabs.svelte.d.ts +1 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.js +30 -2
- package/package.json +94 -88
- package/dist/components/pages/login/admin/01/ui/AuthCard.svelte +0 -58
- package/dist/components/pages/login/admin/01/ui/AuthCard.svelte.d.ts +0 -18
- package/dist/components/pages/login/admin/01/ui/FormLogin.svelte +0 -31
- package/dist/components/pages/login/admin/01/ui/FormLogin.svelte.d.ts +0 -3
- package/dist/components/pages/login/admin/01/ui/PageLogin.svelte +0 -49
- package/dist/components/pages/login/admin/01/ui/PageLogin.svelte.d.ts +0 -18
- package/dist/components/pages/login/admin/index.d.ts +0 -0
- package/dist/components/pages/login/admin/index.js +0 -1
- package/dist/components/pages/login/index.d.ts +0 -0
- package/dist/components/pages/login/index.js +0 -1
- /package/dist/components/pages/login/{admin/01 → 01}/ui/FormRegister.svelte.d.ts +0 -0
|
@@ -1,144 +1,151 @@
|
|
|
1
|
-
<script lang="ts" generics="T">
|
|
2
|
-
import {
|
|
3
|
-
type CellContext,
|
|
4
|
-
type ColumnDef,
|
|
5
|
-
type ColumnFiltersState,
|
|
6
|
-
type PaginationState,
|
|
7
|
-
type RowSelectionState,
|
|
8
|
-
type SortingState,
|
|
9
|
-
type VisibilityState,
|
|
10
|
-
getCoreRowModel,
|
|
11
|
-
getFilteredRowModel,
|
|
12
|
-
getPaginationRowModel,
|
|
13
|
-
getSortedRowModel,
|
|
14
|
-
} from "@tanstack/table-core";
|
|
15
|
-
import type { DataTableItem } from "../data/data-table";
|
|
16
|
-
import { resolveHeader } from "../data/resolve-header.svelte";
|
|
17
|
-
import { resolveCellBadge } from "../data/resolve-cell-badge.svelte";
|
|
18
|
-
import {
|
|
19
|
-
createDragColumn,
|
|
20
|
-
createSelectColumn,
|
|
21
|
-
} from "../data/columns-create";
|
|
22
|
-
import {
|
|
23
|
-
createSvelteTable,
|
|
24
|
-
renderComponent,
|
|
25
|
-
} from "../../../ui/data-table";
|
|
26
|
-
import DataTableListFilter from "./DataTableListFilter.svelte";
|
|
27
|
-
import DataTableContent from "./DataTableContent.svelte";
|
|
28
|
-
import DataTableListPagination from "./DataTableListPagination.svelte";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
...(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
updater
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
updater
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
updater
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import {
|
|
3
|
+
type CellContext,
|
|
4
|
+
type ColumnDef,
|
|
5
|
+
type ColumnFiltersState,
|
|
6
|
+
type PaginationState,
|
|
7
|
+
type RowSelectionState,
|
|
8
|
+
type SortingState,
|
|
9
|
+
type VisibilityState,
|
|
10
|
+
getCoreRowModel,
|
|
11
|
+
getFilteredRowModel,
|
|
12
|
+
getPaginationRowModel,
|
|
13
|
+
getSortedRowModel,
|
|
14
|
+
} from "@tanstack/table-core";
|
|
15
|
+
import type { DataTableItem } from "../data/data-table";
|
|
16
|
+
import { resolveHeader } from "../data/resolve-header.svelte";
|
|
17
|
+
import { resolveCellBadge } from "../data/resolve-cell-badge.svelte";
|
|
18
|
+
import {
|
|
19
|
+
createDragColumn,
|
|
20
|
+
createSelectColumn,
|
|
21
|
+
} from "../data/columns-create";
|
|
22
|
+
import {
|
|
23
|
+
createSvelteTable,
|
|
24
|
+
renderComponent,
|
|
25
|
+
} from "../../../ui/data-table";
|
|
26
|
+
import DataTableListFilter from "./DataTableListFilter.svelte";
|
|
27
|
+
import DataTableContent from "./DataTableContent.svelte";
|
|
28
|
+
import DataTableListPagination from "./DataTableListPagination.svelte";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Tabela de dados genérica com paginação, ordenação e filtros.
|
|
32
|
+
* @property {DataTableItem<T>["config"]} config - Definição das colunas
|
|
33
|
+
* @property {keyof T} columnFilter - Chave para filtro por coluna
|
|
34
|
+
* @property {Component} actions - Componente de ações por linha
|
|
35
|
+
* @property {T[]} items - Dados da tabela
|
|
36
|
+
*/
|
|
37
|
+
let { config, columnFilter, actions, items = [] }: DataTableItem<T> = $props();
|
|
38
|
+
|
|
39
|
+
let columns: ColumnDef<T>[] = $derived([
|
|
40
|
+
createDragColumn<T>(),
|
|
41
|
+
createSelectColumn<T>(),
|
|
42
|
+
...config.map((it) => ({
|
|
43
|
+
accessorKey: it.accessorKey,
|
|
44
|
+
header: resolveHeader(it.header),
|
|
45
|
+
cell: resolveCellBadge(it.cell, it.badge),
|
|
46
|
+
enableSorting: it.enableSorting,
|
|
47
|
+
enableHiding: it.enableHiding,
|
|
48
|
+
})),
|
|
49
|
+
...(actions
|
|
50
|
+
? [{
|
|
51
|
+
id: "actions",
|
|
52
|
+
cell: (ctx: CellContext<T, unknown>) => renderComponent(actions, ctx as unknown),
|
|
53
|
+
enableSorting: false,
|
|
54
|
+
enableHiding: false,
|
|
55
|
+
} satisfies ColumnDef<T>]
|
|
56
|
+
: []),
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
let pagination = $state<PaginationState>({ pageIndex: 0, pageSize: 10 });
|
|
60
|
+
let columnFilters = $state<ColumnFiltersState>([]);
|
|
61
|
+
let columnVisibility = $state<VisibilityState>({});
|
|
62
|
+
let rowSelection = $state<RowSelectionState>({});
|
|
63
|
+
let sorting = $state<SortingState>([]);
|
|
64
|
+
|
|
65
|
+
let table = $derived(
|
|
66
|
+
createSvelteTable({
|
|
67
|
+
data: items,
|
|
68
|
+
columns,
|
|
69
|
+
state: {
|
|
70
|
+
get pagination() {
|
|
71
|
+
return pagination;
|
|
72
|
+
},
|
|
73
|
+
get sorting() {
|
|
74
|
+
return sorting;
|
|
75
|
+
},
|
|
76
|
+
get columnVisibility() {
|
|
77
|
+
return columnVisibility;
|
|
78
|
+
},
|
|
79
|
+
get rowSelection() {
|
|
80
|
+
return rowSelection;
|
|
81
|
+
},
|
|
82
|
+
get columnFilters() {
|
|
83
|
+
return columnFilters;
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
getCoreRowModel: getCoreRowModel(),
|
|
87
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
88
|
+
getSortedRowModel: getSortedRowModel(),
|
|
89
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
90
|
+
onPaginationChange: (
|
|
91
|
+
updater:
|
|
92
|
+
| PaginationState
|
|
93
|
+
| ((arg0: PaginationState) => PaginationState),
|
|
94
|
+
) => {
|
|
95
|
+
if (typeof updater === "function") {
|
|
96
|
+
pagination = updater(pagination);
|
|
97
|
+
} else {
|
|
98
|
+
pagination = updater;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
onSortingChange: (
|
|
102
|
+
updater: SortingState | ((arg0: SortingState) => SortingState),
|
|
103
|
+
) => {
|
|
104
|
+
if (typeof updater === "function") {
|
|
105
|
+
sorting = updater(sorting);
|
|
106
|
+
} else {
|
|
107
|
+
sorting = updater;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
onColumnFiltersChange: (
|
|
111
|
+
updater:
|
|
112
|
+
| ColumnFiltersState
|
|
113
|
+
| ((arg0: ColumnFiltersState) => ColumnFiltersState),
|
|
114
|
+
) => {
|
|
115
|
+
if (typeof updater === "function") {
|
|
116
|
+
columnFilters = updater(columnFilters);
|
|
117
|
+
} else {
|
|
118
|
+
columnFilters = updater;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
onColumnVisibilityChange: (
|
|
122
|
+
updater:
|
|
123
|
+
| VisibilityState
|
|
124
|
+
| ((arg0: VisibilityState) => VisibilityState),
|
|
125
|
+
) => {
|
|
126
|
+
if (typeof updater === "function") {
|
|
127
|
+
columnVisibility = updater(columnVisibility);
|
|
128
|
+
} else {
|
|
129
|
+
columnVisibility = updater;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
onRowSelectionChange: (
|
|
133
|
+
updater:
|
|
134
|
+
| RowSelectionState
|
|
135
|
+
| ((arg0: RowSelectionState) => RowSelectionState),
|
|
136
|
+
) => {
|
|
137
|
+
if (typeof updater === "function") {
|
|
138
|
+
rowSelection = updater(rowSelection);
|
|
139
|
+
} else {
|
|
140
|
+
rowSelection = updater;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
);
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<div class="-mb-8 w-full">
|
|
148
|
+
<DataTableListFilter {table} column={columnFilter} />
|
|
149
|
+
<DataTableContent {table} {columns} />
|
|
150
|
+
<DataTableListPagination {table} />
|
|
151
|
+
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { GripVerticalIcon } from "@hugeicons/core-free-icons";
|
|
3
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<button class="cursor-grab opacity-60 hover:opacity-100 w-min">
|
|
7
|
-
<HugeiconsIcon icon={GripVerticalIcon} class="size-4" />
|
|
8
|
-
</button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { GripVerticalIcon } from "@hugeicons/core-free-icons";
|
|
3
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<button class="cursor-grab opacity-60 hover:opacity-100 w-min">
|
|
7
|
+
<HugeiconsIcon icon={GripVerticalIcon} class="size-4" />
|
|
8
|
+
</button>
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
<script lang="ts" generics="T">
|
|
2
|
-
import Button from "../../../button.svelte";
|
|
3
|
-
import * as DropdownMenu from "../../../ui/dropdown-menu/index.js";
|
|
4
|
-
import { Input } from "../../../ui/input/index.js";
|
|
5
|
-
import { ArrowDown01Icon } from "@hugeicons/core-free-icons";
|
|
6
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
7
|
-
import type { Table } from "@tanstack/table-core";
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
table: Table<T>;
|
|
11
|
-
column?: keyof T & string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
let { table, column }: Props = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class="flex items-center py-4">
|
|
18
|
-
<Input
|
|
19
|
-
placeholder="Filter emails..."
|
|
20
|
-
value={(column
|
|
21
|
-
? (table.getColumn(column)?.getFilterValue() as string)
|
|
22
|
-
: "") ?? ""}
|
|
23
|
-
oninput={(e) =>
|
|
24
|
-
column &&
|
|
25
|
-
table.getColumn(column)?.setFilterValue(e.currentTarget.value)}
|
|
26
|
-
onchange={(e) => {
|
|
27
|
-
column &&
|
|
28
|
-
table.getColumn(column)?.setFilterValue(e.currentTarget.value);
|
|
29
|
-
}}
|
|
30
|
-
class="max-w-sm"
|
|
31
|
-
/>
|
|
32
|
-
<DropdownMenu.Root>
|
|
33
|
-
<DropdownMenu.Trigger>
|
|
34
|
-
{#snippet child({ props })}
|
|
35
|
-
<Button {...props} variant="outline" class="ms-auto">
|
|
36
|
-
Columns <HugeiconsIcon
|
|
37
|
-
icon={ArrowDown01Icon}
|
|
38
|
-
class="ms-2 size-4"
|
|
39
|
-
/>
|
|
40
|
-
</Button>
|
|
41
|
-
{/snippet}
|
|
42
|
-
</DropdownMenu.Trigger>
|
|
43
|
-
<DropdownMenu.Content align="end">
|
|
44
|
-
{#each table
|
|
45
|
-
.getAllColumns()
|
|
46
|
-
.filter((col) => col.getCanHide()) as col (col.id)}
|
|
47
|
-
<DropdownMenu.CheckboxItem
|
|
48
|
-
class="capitalize"
|
|
49
|
-
bind:checked={
|
|
50
|
-
() => col.getIsVisible(),
|
|
51
|
-
(v) => col.toggleVisibility(!!v)
|
|
52
|
-
}
|
|
53
|
-
>
|
|
54
|
-
{col.id}
|
|
55
|
-
</DropdownMenu.CheckboxItem>
|
|
56
|
-
{/each}
|
|
57
|
-
</DropdownMenu.Content>
|
|
58
|
-
</DropdownMenu.Root>
|
|
59
|
-
</div>
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import Button from "../../../button.svelte";
|
|
3
|
+
import * as DropdownMenu from "../../../ui/dropdown-menu/index.js";
|
|
4
|
+
import { Input } from "../../../ui/input/index.js";
|
|
5
|
+
import { ArrowDown01Icon } from "@hugeicons/core-free-icons";
|
|
6
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
7
|
+
import type { Table } from "@tanstack/table-core";
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
table: Table<T>;
|
|
11
|
+
column?: keyof T & string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let { table, column }: Props = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="flex items-center py-4">
|
|
18
|
+
<Input
|
|
19
|
+
placeholder="Filter emails..."
|
|
20
|
+
value={(column
|
|
21
|
+
? (table.getColumn(column)?.getFilterValue() as string)
|
|
22
|
+
: "") ?? ""}
|
|
23
|
+
oninput={(e) =>
|
|
24
|
+
column &&
|
|
25
|
+
table.getColumn(column)?.setFilterValue(e.currentTarget.value)}
|
|
26
|
+
onchange={(e) => {
|
|
27
|
+
column &&
|
|
28
|
+
table.getColumn(column)?.setFilterValue(e.currentTarget.value);
|
|
29
|
+
}}
|
|
30
|
+
class="max-w-sm"
|
|
31
|
+
/>
|
|
32
|
+
<DropdownMenu.Root>
|
|
33
|
+
<DropdownMenu.Trigger>
|
|
34
|
+
{#snippet child({ props })}
|
|
35
|
+
<Button {...props} variant="outline" class="ms-auto">
|
|
36
|
+
Columns <HugeiconsIcon
|
|
37
|
+
icon={ArrowDown01Icon}
|
|
38
|
+
class="ms-2 size-4"
|
|
39
|
+
/>
|
|
40
|
+
</Button>
|
|
41
|
+
{/snippet}
|
|
42
|
+
</DropdownMenu.Trigger>
|
|
43
|
+
<DropdownMenu.Content align="end">
|
|
44
|
+
{#each table
|
|
45
|
+
.getAllColumns()
|
|
46
|
+
.filter((col) => col.getCanHide()) as col (col.id)}
|
|
47
|
+
<DropdownMenu.CheckboxItem
|
|
48
|
+
class="capitalize"
|
|
49
|
+
bind:checked={
|
|
50
|
+
() => col.getIsVisible(),
|
|
51
|
+
(v) => col.toggleVisibility(!!v)
|
|
52
|
+
}
|
|
53
|
+
>
|
|
54
|
+
{col.id}
|
|
55
|
+
</DropdownMenu.CheckboxItem>
|
|
56
|
+
{/each}
|
|
57
|
+
</DropdownMenu.Content>
|
|
58
|
+
</DropdownMenu.Root>
|
|
59
|
+
</div>
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
<script lang="ts" generics="T">
|
|
2
|
-
import Button from "../../../button.svelte";
|
|
3
|
-
import type { Table } from "@tanstack/table-core";
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
table: Table<T>;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
let { table }: Props = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div class="flex items-center justify-end space-x-2 pt-4">
|
|
13
|
-
<div class="text-muted-foreground flex-1 text-sm">
|
|
14
|
-
{table.getFilteredSelectedRowModel().rows.length} of
|
|
15
|
-
{table.getFilteredRowModel().rows.length} row(s) selected.
|
|
16
|
-
</div>
|
|
17
|
-
<div class="space-x-2">
|
|
18
|
-
<Button
|
|
19
|
-
variant="outline"
|
|
20
|
-
size="sm"
|
|
21
|
-
onclick={() => table.previousPage()}
|
|
22
|
-
disabled={!table.getCanPreviousPage()}
|
|
23
|
-
>
|
|
24
|
-
Previous
|
|
25
|
-
</Button>
|
|
26
|
-
<Button
|
|
27
|
-
variant="outline"
|
|
28
|
-
size="sm"
|
|
29
|
-
onclick={() => table.nextPage()}
|
|
30
|
-
disabled={!table.getCanNextPage()}
|
|
31
|
-
>
|
|
32
|
-
Next
|
|
33
|
-
</Button>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import Button from "../../../button.svelte";
|
|
3
|
+
import type { Table } from "@tanstack/table-core";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
table: Table<T>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
let { table }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="flex items-center justify-end space-x-2 pt-4">
|
|
13
|
+
<div class="text-muted-foreground flex-1 text-sm">
|
|
14
|
+
{table.getFilteredSelectedRowModel().rows.length} of
|
|
15
|
+
{table.getFilteredRowModel().rows.length} row(s) selected.
|
|
16
|
+
</div>
|
|
17
|
+
<div class="space-x-2">
|
|
18
|
+
<Button
|
|
19
|
+
variant="outline"
|
|
20
|
+
size="sm"
|
|
21
|
+
onclick={() => table.previousPage()}
|
|
22
|
+
disabled={!table.getCanPreviousPage()}
|
|
23
|
+
>
|
|
24
|
+
Previous
|
|
25
|
+
</Button>
|
|
26
|
+
<Button
|
|
27
|
+
variant="outline"
|
|
28
|
+
size="sm"
|
|
29
|
+
onclick={() => table.nextPage()}
|
|
30
|
+
disabled={!table.getCanNextPage()}
|
|
31
|
+
>
|
|
32
|
+
Next
|
|
33
|
+
</Button>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|