negodesign 0.0.1 → 0.0.2
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 +144 -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 +22 -22
- package/dist/components/core/form/ui/input-password-confirm.svelte +22 -22
- package/dist/components/core/form/ui/input-password.svelte +22 -22
- package/dist/components/core/form/ui/input-phone.svelte +22 -0
- package/dist/components/core/form/ui/input-phone.svelte.d.ts +4 -0
- package/dist/components/core/form/ui/input-username.svelte +21 -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 +62 -62
- package/dist/components/core/tabs/ui/tab-underline.svelte +41 -41
- package/dist/components/pages/admin/ui/admin-content.svelte +13 -13
- package/dist/components/pages/admin/ui/admin-panel.svelte +40 -40
- package/dist/components/pages/login/admin/01/data/page-props.d.ts +10 -0
- package/dist/components/pages/login/admin/01/data/page-props.js +1 -0
- package/dist/components/pages/login/admin/01/ui/AuthCard.svelte +84 -58
- package/dist/components/pages/login/admin/01/ui/AuthCard.svelte.d.ts +11 -17
- package/dist/components/pages/login/admin/01/ui/FormLogin.svelte +25 -5
- package/dist/components/pages/login/admin/01/ui/FormLogin.svelte.d.ts +6 -1
- package/dist/components/pages/login/admin/01/ui/FormLoginEmailPassword.svelte +12 -0
- package/dist/components/pages/login/admin/01/ui/FormLoginEmailPassword.svelte.d.ts +7 -0
- package/dist/components/pages/login/admin/01/ui/FormLoginPhonePassword.svelte +12 -0
- package/dist/components/pages/login/admin/01/ui/FormLoginPhonePassword.svelte.d.ts +7 -0
- package/dist/components/pages/login/admin/01/ui/FormLoginUsernamePassword.svelte +12 -0
- package/dist/components/pages/login/admin/01/ui/FormLoginUsernamePassword.svelte.d.ts +7 -0
- package/dist/components/pages/login/admin/01/ui/FormRegister.svelte +28 -28
- package/dist/components/pages/login/admin/01/ui/LeftHero.svelte +105 -105
- package/dist/components/pages/login/admin/01/ui/PageLogin.svelte +47 -49
- package/dist/components/pages/login/admin/01/ui/PageLogin.svelte.d.ts +14 -17
- 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/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/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-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/index.js +0 -1
- package/package.json +94 -88
|
@@ -1,144 +1,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
|
-
let { config, columnFilter, actions, items = [] }: DataTableItem<T> = $props();
|
|
31
|
-
|
|
32
|
-
let columns: ColumnDef<T>[] = $derived([
|
|
33
|
-
createDragColumn<T>(),
|
|
34
|
-
createSelectColumn<T>(),
|
|
35
|
-
...config.map((it) => ({
|
|
36
|
-
accessorKey: it.accessorKey,
|
|
37
|
-
header: resolveHeader(it.header),
|
|
38
|
-
cell: resolveCellBadge(it.cell, it.badge),
|
|
39
|
-
enableSorting: it.enableSorting,
|
|
40
|
-
enableHiding: it.enableHiding,
|
|
41
|
-
})),
|
|
42
|
-
...(actions
|
|
43
|
-
? [{
|
|
44
|
-
id: "actions",
|
|
45
|
-
cell: (ctx: CellContext<T, unknown>) => renderComponent(actions, ctx as any),
|
|
46
|
-
enableSorting: false,
|
|
47
|
-
enableHiding: false,
|
|
48
|
-
} satisfies ColumnDef<T>]
|
|
49
|
-
: []),
|
|
50
|
-
]);
|
|
51
|
-
|
|
52
|
-
let pagination = $state<PaginationState>({ pageIndex: 0, pageSize: 10 });
|
|
53
|
-
let columnFilters = $state<ColumnFiltersState>([]);
|
|
54
|
-
let columnVisibility = $state<VisibilityState>({});
|
|
55
|
-
let rowSelection = $state<RowSelectionState>({});
|
|
56
|
-
let sorting = $state<SortingState>([]);
|
|
57
|
-
|
|
58
|
-
let table = $derived(
|
|
59
|
-
createSvelteTable({
|
|
60
|
-
data: items,
|
|
61
|
-
columns,
|
|
62
|
-
state: {
|
|
63
|
-
get pagination() {
|
|
64
|
-
return pagination;
|
|
65
|
-
},
|
|
66
|
-
get sorting() {
|
|
67
|
-
return sorting;
|
|
68
|
-
},
|
|
69
|
-
get columnVisibility() {
|
|
70
|
-
return columnVisibility;
|
|
71
|
-
},
|
|
72
|
-
get rowSelection() {
|
|
73
|
-
return rowSelection;
|
|
74
|
-
},
|
|
75
|
-
get columnFilters() {
|
|
76
|
-
return columnFilters;
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
getCoreRowModel: getCoreRowModel(),
|
|
80
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
81
|
-
getSortedRowModel: getSortedRowModel(),
|
|
82
|
-
getFilteredRowModel: getFilteredRowModel(),
|
|
83
|
-
onPaginationChange: (
|
|
84
|
-
updater:
|
|
85
|
-
| PaginationState
|
|
86
|
-
| ((arg0: PaginationState) => PaginationState),
|
|
87
|
-
) => {
|
|
88
|
-
if (typeof updater === "function") {
|
|
89
|
-
pagination = updater(pagination);
|
|
90
|
-
} else {
|
|
91
|
-
pagination = updater;
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
onSortingChange: (
|
|
95
|
-
updater: SortingState | ((arg0: SortingState) => SortingState),
|
|
96
|
-
) => {
|
|
97
|
-
if (typeof updater === "function") {
|
|
98
|
-
sorting = updater(sorting);
|
|
99
|
-
} else {
|
|
100
|
-
sorting = updater;
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
onColumnFiltersChange: (
|
|
104
|
-
updater:
|
|
105
|
-
| ColumnFiltersState
|
|
106
|
-
| ((arg0: ColumnFiltersState) => ColumnFiltersState),
|
|
107
|
-
) => {
|
|
108
|
-
if (typeof updater === "function") {
|
|
109
|
-
columnFilters = updater(columnFilters);
|
|
110
|
-
} else {
|
|
111
|
-
columnFilters = updater;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
onColumnVisibilityChange: (
|
|
115
|
-
updater:
|
|
116
|
-
| VisibilityState
|
|
117
|
-
| ((arg0: VisibilityState) => VisibilityState),
|
|
118
|
-
) => {
|
|
119
|
-
if (typeof updater === "function") {
|
|
120
|
-
columnVisibility = updater(columnVisibility);
|
|
121
|
-
} else {
|
|
122
|
-
columnVisibility = updater;
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
onRowSelectionChange: (
|
|
126
|
-
updater:
|
|
127
|
-
| RowSelectionState
|
|
128
|
-
| ((arg0: RowSelectionState) => RowSelectionState),
|
|
129
|
-
) => {
|
|
130
|
-
if (typeof updater === "function") {
|
|
131
|
-
rowSelection = updater(rowSelection);
|
|
132
|
-
} else {
|
|
133
|
-
rowSelection = updater;
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
}),
|
|
137
|
-
);
|
|
138
|
-
</script>
|
|
139
|
-
|
|
140
|
-
<div class="-mb-8 w-full">
|
|
141
|
-
<DataTableListFilter {table} column={columnFilter} />
|
|
142
|
-
<DataTableContent {table} {columns} />
|
|
143
|
-
<DataTableListPagination {table} />
|
|
144
|
-
</div>
|
|
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
|
+
let { config, columnFilter, actions, items = [] }: DataTableItem<T> = $props();
|
|
31
|
+
|
|
32
|
+
let columns: ColumnDef<T>[] = $derived([
|
|
33
|
+
createDragColumn<T>(),
|
|
34
|
+
createSelectColumn<T>(),
|
|
35
|
+
...config.map((it) => ({
|
|
36
|
+
accessorKey: it.accessorKey,
|
|
37
|
+
header: resolveHeader(it.header),
|
|
38
|
+
cell: resolveCellBadge(it.cell, it.badge),
|
|
39
|
+
enableSorting: it.enableSorting,
|
|
40
|
+
enableHiding: it.enableHiding,
|
|
41
|
+
})),
|
|
42
|
+
...(actions
|
|
43
|
+
? [{
|
|
44
|
+
id: "actions",
|
|
45
|
+
cell: (ctx: CellContext<T, unknown>) => renderComponent(actions, ctx as any),
|
|
46
|
+
enableSorting: false,
|
|
47
|
+
enableHiding: false,
|
|
48
|
+
} satisfies ColumnDef<T>]
|
|
49
|
+
: []),
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
let pagination = $state<PaginationState>({ pageIndex: 0, pageSize: 10 });
|
|
53
|
+
let columnFilters = $state<ColumnFiltersState>([]);
|
|
54
|
+
let columnVisibility = $state<VisibilityState>({});
|
|
55
|
+
let rowSelection = $state<RowSelectionState>({});
|
|
56
|
+
let sorting = $state<SortingState>([]);
|
|
57
|
+
|
|
58
|
+
let table = $derived(
|
|
59
|
+
createSvelteTable({
|
|
60
|
+
data: items,
|
|
61
|
+
columns,
|
|
62
|
+
state: {
|
|
63
|
+
get pagination() {
|
|
64
|
+
return pagination;
|
|
65
|
+
},
|
|
66
|
+
get sorting() {
|
|
67
|
+
return sorting;
|
|
68
|
+
},
|
|
69
|
+
get columnVisibility() {
|
|
70
|
+
return columnVisibility;
|
|
71
|
+
},
|
|
72
|
+
get rowSelection() {
|
|
73
|
+
return rowSelection;
|
|
74
|
+
},
|
|
75
|
+
get columnFilters() {
|
|
76
|
+
return columnFilters;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
getCoreRowModel: getCoreRowModel(),
|
|
80
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
81
|
+
getSortedRowModel: getSortedRowModel(),
|
|
82
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
83
|
+
onPaginationChange: (
|
|
84
|
+
updater:
|
|
85
|
+
| PaginationState
|
|
86
|
+
| ((arg0: PaginationState) => PaginationState),
|
|
87
|
+
) => {
|
|
88
|
+
if (typeof updater === "function") {
|
|
89
|
+
pagination = updater(pagination);
|
|
90
|
+
} else {
|
|
91
|
+
pagination = updater;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
onSortingChange: (
|
|
95
|
+
updater: SortingState | ((arg0: SortingState) => SortingState),
|
|
96
|
+
) => {
|
|
97
|
+
if (typeof updater === "function") {
|
|
98
|
+
sorting = updater(sorting);
|
|
99
|
+
} else {
|
|
100
|
+
sorting = updater;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
onColumnFiltersChange: (
|
|
104
|
+
updater:
|
|
105
|
+
| ColumnFiltersState
|
|
106
|
+
| ((arg0: ColumnFiltersState) => ColumnFiltersState),
|
|
107
|
+
) => {
|
|
108
|
+
if (typeof updater === "function") {
|
|
109
|
+
columnFilters = updater(columnFilters);
|
|
110
|
+
} else {
|
|
111
|
+
columnFilters = updater;
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
onColumnVisibilityChange: (
|
|
115
|
+
updater:
|
|
116
|
+
| VisibilityState
|
|
117
|
+
| ((arg0: VisibilityState) => VisibilityState),
|
|
118
|
+
) => {
|
|
119
|
+
if (typeof updater === "function") {
|
|
120
|
+
columnVisibility = updater(columnVisibility);
|
|
121
|
+
} else {
|
|
122
|
+
columnVisibility = updater;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
onRowSelectionChange: (
|
|
126
|
+
updater:
|
|
127
|
+
| RowSelectionState
|
|
128
|
+
| ((arg0: RowSelectionState) => RowSelectionState),
|
|
129
|
+
) => {
|
|
130
|
+
if (typeof updater === "function") {
|
|
131
|
+
rowSelection = updater(rowSelection);
|
|
132
|
+
} else {
|
|
133
|
+
rowSelection = updater;
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<div class="-mb-8 w-full">
|
|
141
|
+
<DataTableListFilter {table} column={columnFilter} />
|
|
142
|
+
<DataTableContent {table} {columns} />
|
|
143
|
+
<DataTableListPagination {table} />
|
|
144
|
+
</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>
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Input from "../../../ui/input/input.svelte";
|
|
3
|
-
import { Label } from "../../../ui/label";
|
|
4
|
-
import { EyeIcon, EyeOffIcon } from "@hugeicons/core-free-icons";
|
|
5
|
-
import { inputIconMap } from "../data/InputIconDefault.svelte";
|
|
6
|
-
import type { InputLabelProps } from "../data/InputLabel.svelte";
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
-
|
|
9
|
-
let {
|
|
10
|
-
label,
|
|
11
|
-
isIcon,
|
|
12
|
-
isLabel,
|
|
13
|
-
value = $bindable(""),
|
|
14
|
-
...restProps
|
|
15
|
-
}: InputLabelProps = $props();
|
|
16
|
-
|
|
17
|
-
let showPassword = $state(false);
|
|
18
|
-
|
|
19
|
-
const isPassword = $derived(restProps.type == "password");
|
|
20
|
-
|
|
21
|
-
const inputType = $derived(
|
|
22
|
-
isPassword && showPassword ? "text" : restProps.type,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const currentIcon = $derived(
|
|
26
|
-
restProps.type ? inputIconMap[restProps.type] : undefined,
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
function togglePasswordVisibility() {
|
|
30
|
-
showPassword = !showPassword;
|
|
31
|
-
}
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
{#snippet renderInput()}
|
|
35
|
-
<div class="flex items-center relative w-full">
|
|
36
|
-
{#if isIcon && currentIcon}
|
|
37
|
-
<span class="absolute left-3 flex items-center pointer-events-none">
|
|
38
|
-
<HugeiconsIcon
|
|
39
|
-
icon={currentIcon}
|
|
40
|
-
size={16}
|
|
41
|
-
color="#94a3b8"
|
|
42
|
-
strokeWidth={1.5}
|
|
43
|
-
/>
|
|
44
|
-
</span>
|
|
45
|
-
{/if}
|
|
46
|
-
|
|
47
|
-
<Input
|
|
48
|
-
class="{isIcon && currentIcon ? 'pl-9' : ''} {isPassword ? 'pr-9' : ''}"
|
|
49
|
-
bind:value
|
|
50
|
-
{...restProps}
|
|
51
|
-
type={inputType}
|
|
52
|
-
/>
|
|
53
|
-
|
|
54
|
-
{#if isPassword}
|
|
55
|
-
<button
|
|
56
|
-
type="button"
|
|
57
|
-
onclick={togglePasswordVisibility}
|
|
58
|
-
class="absolute right-3 flex items-center cursor-pointer z-10 text-slate-400 hover:text-slate-600 focus:outline-none"
|
|
59
|
-
aria-label={showPassword ? "Ocultar senha" : "Ver senha"}
|
|
60
|
-
>
|
|
61
|
-
<HugeiconsIcon
|
|
62
|
-
icon={showPassword ? EyeOffIcon : EyeIcon}
|
|
63
|
-
size={16}
|
|
64
|
-
color="#94a3b8"
|
|
65
|
-
strokeWidth={1.5}
|
|
66
|
-
/>
|
|
67
|
-
</button>
|
|
68
|
-
{/if}
|
|
69
|
-
</div>
|
|
70
|
-
{/snippet}
|
|
71
|
-
|
|
72
|
-
{#if isLabel}
|
|
73
|
-
<div class="flex flex-col gap-3 w-full">
|
|
74
|
-
{#if label}
|
|
75
|
-
<Label>{label}</Label>
|
|
76
|
-
{/if}
|
|
77
|
-
{@render renderInput()}
|
|
78
|
-
</div>
|
|
79
|
-
{:else}
|
|
80
|
-
{@render renderInput()}
|
|
81
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Input from "../../../ui/input/input.svelte";
|
|
3
|
+
import { Label } from "../../../ui/label";
|
|
4
|
+
import { EyeIcon, EyeOffIcon } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { inputIconMap } from "../data/InputIconDefault.svelte";
|
|
6
|
+
import type { InputLabelProps } from "../data/InputLabel.svelte";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
label,
|
|
11
|
+
isIcon,
|
|
12
|
+
isLabel,
|
|
13
|
+
value = $bindable(""),
|
|
14
|
+
...restProps
|
|
15
|
+
}: InputLabelProps = $props();
|
|
16
|
+
|
|
17
|
+
let showPassword = $state(false);
|
|
18
|
+
|
|
19
|
+
const isPassword = $derived(restProps.type == "password");
|
|
20
|
+
|
|
21
|
+
const inputType = $derived(
|
|
22
|
+
isPassword && showPassword ? "text" : restProps.type,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const currentIcon = $derived(
|
|
26
|
+
restProps.type ? inputIconMap[restProps.type] : undefined,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
function togglePasswordVisibility() {
|
|
30
|
+
showPassword = !showPassword;
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
{#snippet renderInput()}
|
|
35
|
+
<div class="flex items-center relative w-full">
|
|
36
|
+
{#if isIcon && currentIcon}
|
|
37
|
+
<span class="absolute left-3 flex items-center pointer-events-none">
|
|
38
|
+
<HugeiconsIcon
|
|
39
|
+
icon={currentIcon}
|
|
40
|
+
size={16}
|
|
41
|
+
color="#94a3b8"
|
|
42
|
+
strokeWidth={1.5}
|
|
43
|
+
/>
|
|
44
|
+
</span>
|
|
45
|
+
{/if}
|
|
46
|
+
|
|
47
|
+
<Input
|
|
48
|
+
class="{isIcon && currentIcon ? 'pl-9' : ''} {isPassword ? 'pr-9' : ''}"
|
|
49
|
+
bind:value
|
|
50
|
+
{...restProps}
|
|
51
|
+
type={inputType}
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
{#if isPassword}
|
|
55
|
+
<button
|
|
56
|
+
type="button"
|
|
57
|
+
onclick={togglePasswordVisibility}
|
|
58
|
+
class="absolute right-3 flex items-center cursor-pointer z-10 text-slate-400 hover:text-slate-600 focus:outline-none"
|
|
59
|
+
aria-label={showPassword ? "Ocultar senha" : "Ver senha"}
|
|
60
|
+
>
|
|
61
|
+
<HugeiconsIcon
|
|
62
|
+
icon={showPassword ? EyeOffIcon : EyeIcon}
|
|
63
|
+
size={16}
|
|
64
|
+
color="#94a3b8"
|
|
65
|
+
strokeWidth={1.5}
|
|
66
|
+
/>
|
|
67
|
+
</button>
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
70
|
+
{/snippet}
|
|
71
|
+
|
|
72
|
+
{#if isLabel}
|
|
73
|
+
<div class="flex flex-col gap-3 w-full">
|
|
74
|
+
{#if label}
|
|
75
|
+
<Label>{label}</Label>
|
|
76
|
+
{/if}
|
|
77
|
+
{@render renderInput()}
|
|
78
|
+
</div>
|
|
79
|
+
{:else}
|
|
80
|
+
{@render renderInput()}
|
|
81
|
+
{/if}
|