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,32 +1,32 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as Breadcrumb from "../../ui/breadcrumb/index.js";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
items: {
|
|
6
|
-
url?: string;
|
|
7
|
-
label: string;
|
|
8
|
-
}[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
let { items }: Props = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<Breadcrumb.Root>
|
|
15
|
-
<Breadcrumb.List>
|
|
16
|
-
{#each items as item, i (item.label)}
|
|
17
|
-
{@const isLast = i === items.length - 1}
|
|
18
|
-
|
|
19
|
-
<Breadcrumb.Item class={isLast ? "" : "hidden md:block"}>
|
|
20
|
-
{#if isLast}
|
|
21
|
-
<Breadcrumb.Page>{item.label}</Breadcrumb.Page>
|
|
22
|
-
{:else}
|
|
23
|
-
<Breadcrumb.Link href={item.url ?? "##"}>{item.label}</Breadcrumb.Link>
|
|
24
|
-
{/if}
|
|
25
|
-
</Breadcrumb.Item>
|
|
26
|
-
|
|
27
|
-
{#if !isLast}
|
|
28
|
-
<Breadcrumb.Separator class="hidden md:block" />
|
|
29
|
-
{/if}
|
|
30
|
-
{/each}
|
|
31
|
-
</Breadcrumb.List>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as Breadcrumb from "../../ui/breadcrumb/index.js";
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
items: {
|
|
6
|
+
url?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
let { items }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Breadcrumb.Root>
|
|
15
|
+
<Breadcrumb.List>
|
|
16
|
+
{#each items as item, i (item.label)}
|
|
17
|
+
{@const isLast = i === items.length - 1}
|
|
18
|
+
|
|
19
|
+
<Breadcrumb.Item class={isLast ? "" : "hidden md:block"}>
|
|
20
|
+
{#if isLast}
|
|
21
|
+
<Breadcrumb.Page>{item.label}</Breadcrumb.Page>
|
|
22
|
+
{:else}
|
|
23
|
+
<Breadcrumb.Link href={item.url ?? "##"}>{item.label}</Breadcrumb.Link>
|
|
24
|
+
{/if}
|
|
25
|
+
</Breadcrumb.Item>
|
|
26
|
+
|
|
27
|
+
{#if !isLast}
|
|
28
|
+
<Breadcrumb.Separator class="hidden md:block" />
|
|
29
|
+
{/if}
|
|
30
|
+
{/each}
|
|
31
|
+
</Breadcrumb.List>
|
|
32
32
|
</Breadcrumb.Root>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button from "../../ui/button/button.svelte";
|
|
3
|
-
import { ArrowLeft01Icon } from "@hugeicons/core-free-icons";
|
|
4
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
5
|
-
import { t } from "../../../i18n";
|
|
6
|
-
import type { ButtonProps } from "../../ui/button";
|
|
7
|
-
|
|
8
|
-
let { ...restProps }: ButtonProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<Button
|
|
12
|
-
variant="outline"
|
|
13
|
-
class="inline-flex items-center gap-1 text-sm text-slate-600 hover:text-slate-900 transition-colors rounded-full bg-input"
|
|
14
|
-
{...restProps}
|
|
15
|
-
>
|
|
16
|
-
<HugeiconsIcon icon={ArrowLeft01Icon} size={16} />
|
|
17
|
-
<span class="sr-only">{$t("button.back")}</span>
|
|
18
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from "../../ui/button/button.svelte";
|
|
3
|
+
import { ArrowLeft01Icon } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
5
|
+
import { t } from "../../../i18n";
|
|
6
|
+
import type { ButtonProps } from "../../ui/button";
|
|
7
|
+
|
|
8
|
+
let { ...restProps }: ButtonProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<Button
|
|
12
|
+
variant="outline"
|
|
13
|
+
class="inline-flex items-center gap-1 text-sm text-slate-600 hover:text-slate-900 transition-colors rounded-full bg-input"
|
|
14
|
+
{...restProps}
|
|
15
|
+
>
|
|
16
|
+
<HugeiconsIcon icon={ArrowLeft01Icon} size={16} />
|
|
17
|
+
<span class="sr-only">{$t("button.back")}</span>
|
|
18
|
+
</Button>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button, {
|
|
3
|
-
type ButtonProps,
|
|
4
|
-
} from "../../ui/button/button.svelte";
|
|
5
|
-
import { t } from "../../../i18n";
|
|
6
|
-
import { Login02Icon } from "@hugeicons/core-free-icons";
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
-
|
|
9
|
-
let { ...restProps }: ButtonProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Button class="w-full flex items-center gap-2" {...restProps}>
|
|
13
|
-
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
14
|
-
{$t("button.login")}
|
|
15
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button, {
|
|
3
|
+
type ButtonProps,
|
|
4
|
+
} from "../../ui/button/button.svelte";
|
|
5
|
+
import { t } from "../../../i18n";
|
|
6
|
+
import { Login02Icon } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
+
|
|
9
|
+
let { ...restProps }: ButtonProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Button class="w-full flex items-center gap-2" {...restProps}>
|
|
13
|
+
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
14
|
+
{$t("button.login")}
|
|
15
|
+
</Button>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button, {
|
|
3
|
-
type ButtonProps,
|
|
4
|
-
} from "../../ui/button/button.svelte";
|
|
5
|
-
import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/svelte";
|
|
6
|
-
import { t } from "../../../i18n";
|
|
7
|
-
import {
|
|
8
|
-
GoogleIcon,
|
|
9
|
-
Facebook01Icon as Facebook,
|
|
10
|
-
Linkedin01Icon as Linkedin,
|
|
11
|
-
} from "@hugeicons/core-free-icons";
|
|
12
|
-
import type { Snippet } from "svelte";
|
|
13
|
-
|
|
14
|
-
type IconDefault = "GOOGLE" | "FACEBOOK" | "LINKEDLN";
|
|
15
|
-
|
|
16
|
-
type Props = {
|
|
17
|
-
icon?: IconSvgElement | IconDefault | Snippet;
|
|
18
|
-
label?: string;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
let { icon, label, ...restProps }: Props & ButtonProps = $props();
|
|
22
|
-
|
|
23
|
-
const defaultIconMap: Record<IconDefault, IconSvgElement> = {
|
|
24
|
-
GOOGLE: GoogleIcon,
|
|
25
|
-
FACEBOOK: Facebook,
|
|
26
|
-
LINKEDLN: Linkedin,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const defaultLabelMap: Record<IconDefault, string> = {
|
|
30
|
-
GOOGLE: "Google",
|
|
31
|
-
FACEBOOK: "Facebook",
|
|
32
|
-
LINKEDLN: "Linkedin",
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function isIconDefault(value: unknown): value is IconDefault {
|
|
36
|
-
return typeof value === "string" && value in defaultLabelMap;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let resolvedIcon = $derived(
|
|
40
|
-
isIconDefault(icon) ? defaultIconMap[icon] : icon,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
let resolvedLabel = $derived(
|
|
44
|
-
label ?? (isIconDefault(icon) ? defaultLabelMap[icon] : ""),
|
|
45
|
-
);
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<Button variant="outline" class="w-full flex items-center gap-2" {...restProps}>
|
|
49
|
-
{#if resolvedIcon}
|
|
50
|
-
{#if typeof resolvedIcon === "function"}
|
|
51
|
-
{@render resolvedIcon()}
|
|
52
|
-
{:else}
|
|
53
|
-
<HugeiconsIcon icon={resolvedIcon} size={16} />
|
|
54
|
-
{/if}
|
|
55
|
-
{/if}
|
|
56
|
-
{$t("button.login.with", { name: resolvedLabel })}
|
|
57
|
-
</Button>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button, {
|
|
3
|
+
type ButtonProps,
|
|
4
|
+
} from "../../ui/button/button.svelte";
|
|
5
|
+
import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/svelte";
|
|
6
|
+
import { t } from "../../../i18n";
|
|
7
|
+
import {
|
|
8
|
+
GoogleIcon,
|
|
9
|
+
Facebook01Icon as Facebook,
|
|
10
|
+
Linkedin01Icon as Linkedin,
|
|
11
|
+
} from "@hugeicons/core-free-icons";
|
|
12
|
+
import type { Snippet } from "svelte";
|
|
13
|
+
|
|
14
|
+
type IconDefault = "GOOGLE" | "FACEBOOK" | "LINKEDLN";
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
icon?: IconSvgElement | IconDefault | Snippet;
|
|
18
|
+
label?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
let { icon, label, ...restProps }: Props & ButtonProps = $props();
|
|
22
|
+
|
|
23
|
+
const defaultIconMap: Record<IconDefault, IconSvgElement> = {
|
|
24
|
+
GOOGLE: GoogleIcon,
|
|
25
|
+
FACEBOOK: Facebook,
|
|
26
|
+
LINKEDLN: Linkedin,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const defaultLabelMap: Record<IconDefault, string> = {
|
|
30
|
+
GOOGLE: "Google",
|
|
31
|
+
FACEBOOK: "Facebook",
|
|
32
|
+
LINKEDLN: "Linkedin",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function isIconDefault(value: unknown): value is IconDefault {
|
|
36
|
+
return typeof value === "string" && value in defaultLabelMap;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let resolvedIcon = $derived(
|
|
40
|
+
isIconDefault(icon) ? defaultIconMap[icon] : icon,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
let resolvedLabel = $derived(
|
|
44
|
+
label ?? (isIconDefault(icon) ? defaultLabelMap[icon] : ""),
|
|
45
|
+
);
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<Button variant="outline" class="w-full flex items-center gap-2" {...restProps}>
|
|
49
|
+
{#if resolvedIcon}
|
|
50
|
+
{#if typeof resolvedIcon === "function"}
|
|
51
|
+
{@render resolvedIcon()}
|
|
52
|
+
{:else}
|
|
53
|
+
<HugeiconsIcon icon={resolvedIcon} size={16} />
|
|
54
|
+
{/if}
|
|
55
|
+
{/if}
|
|
56
|
+
{$t("button.login.with", { name: resolvedLabel })}
|
|
57
|
+
</Button>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type CarouselItemType = "NUMBER" | "DOT" | "POINTER";
|
|
1
2
|
export interface CarouselItem {
|
|
2
3
|
title: string;
|
|
3
4
|
description: string;
|
|
@@ -6,5 +7,5 @@ export interface CarouselItem {
|
|
|
6
7
|
}
|
|
7
8
|
export interface CarouselProps {
|
|
8
9
|
items: CarouselItem[];
|
|
9
|
-
varient:
|
|
10
|
+
varient: CarouselItemType;
|
|
10
11
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<script lang="ts" generics="T">
|
|
2
|
-
import type { CellContext } from "@tanstack/table-core";
|
|
3
|
-
import * as DropdownMenu from "../../../ui/dropdown-menu/index.js";
|
|
4
|
-
import Button from "../../../button.svelte";
|
|
5
|
-
import { MoreHorizontalIcon } from "@hugeicons/core-free-icons";
|
|
6
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
7
|
-
|
|
8
|
-
let { row }: CellContext<T, unknown> = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<DropdownMenu.Root>
|
|
12
|
-
<DropdownMenu.Trigger>
|
|
13
|
-
{#snippet child({ props })}
|
|
14
|
-
<Button {...props} variant="ghost" class="size-8 p-0">
|
|
15
|
-
<HugeiconsIcon icon={MoreHorizontalIcon} class="size-4" />
|
|
16
|
-
<span class="sr-only">Open menu</span>
|
|
17
|
-
</Button>
|
|
18
|
-
{/snippet}
|
|
19
|
-
</DropdownMenu.Trigger>
|
|
20
|
-
<DropdownMenu.Content align="end">
|
|
21
|
-
<DropdownMenu.Item onclick={() => console.log(row.original)}
|
|
22
|
-
>Copy</DropdownMenu.Item
|
|
23
|
-
>
|
|
24
|
-
<DropdownMenu.Item onclick={() => console.log(row.original)}
|
|
25
|
-
>Delete</DropdownMenu.Item
|
|
26
|
-
>
|
|
27
|
-
</DropdownMenu.Content>
|
|
28
|
-
</DropdownMenu.Root>
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import type { CellContext } from "@tanstack/table-core";
|
|
3
|
+
import * as DropdownMenu from "../../../ui/dropdown-menu/index.js";
|
|
4
|
+
import Button from "../../../button.svelte";
|
|
5
|
+
import { MoreHorizontalIcon } from "@hugeicons/core-free-icons";
|
|
6
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
7
|
+
|
|
8
|
+
let { row }: CellContext<T, unknown> = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenu.Root>
|
|
12
|
+
<DropdownMenu.Trigger>
|
|
13
|
+
{#snippet child({ props })}
|
|
14
|
+
<Button {...props} variant="ghost" class="size-8 p-0">
|
|
15
|
+
<HugeiconsIcon icon={MoreHorizontalIcon} class="size-4" />
|
|
16
|
+
<span class="sr-only">Open menu</span>
|
|
17
|
+
</Button>
|
|
18
|
+
{/snippet}
|
|
19
|
+
</DropdownMenu.Trigger>
|
|
20
|
+
<DropdownMenu.Content align="end">
|
|
21
|
+
<DropdownMenu.Item onclick={() => console.log(row.original)}
|
|
22
|
+
>Copy</DropdownMenu.Item
|
|
23
|
+
>
|
|
24
|
+
<DropdownMenu.Item onclick={() => console.log(row.original)}
|
|
25
|
+
>Delete</DropdownMenu.Item
|
|
26
|
+
>
|
|
27
|
+
</DropdownMenu.Content>
|
|
28
|
+
</DropdownMenu.Root>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Checkbox } from "../../../ui/checkbox";
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
checked = $bindable(false),
|
|
6
|
-
indeterminate = $bindable(false),
|
|
7
|
-
onCheckedChange,
|
|
8
|
-
...restProps
|
|
9
|
-
}: {
|
|
10
|
-
checked?: boolean;
|
|
11
|
-
indeterminate?: boolean;
|
|
12
|
-
onCheckedChange?: (value: boolean) => void;
|
|
13
|
-
[key: string]: unknown;
|
|
14
|
-
} = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<Checkbox
|
|
18
|
-
bind:checked
|
|
19
|
-
bind:indeterminate
|
|
20
|
-
onCheckedChange={(v) => onCheckedChange?.(!!v)}
|
|
21
|
-
{...restProps}
|
|
22
|
-
/>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Checkbox } from "../../../ui/checkbox";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
checked = $bindable(false),
|
|
6
|
+
indeterminate = $bindable(false),
|
|
7
|
+
onCheckedChange,
|
|
8
|
+
...restProps
|
|
9
|
+
}: {
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
onCheckedChange?: (value: boolean) => void;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Checkbox
|
|
18
|
+
bind:checked
|
|
19
|
+
bind:indeterminate
|
|
20
|
+
onCheckedChange={(v) => onCheckedChange?.(!!v)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
/>
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
<script lang="ts" generics="T">
|
|
2
|
-
import type {
|
|
3
|
-
ColumnDef,
|
|
4
|
-
Table as TanstackTable,
|
|
5
|
-
} from "@tanstack/table-core";
|
|
6
|
-
import * as Table from "../../../ui/table/index.js";
|
|
7
|
-
import FlexRender from "../../../ui/data-table/flex-render.svelte";
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
table: TanstackTable<T>;
|
|
11
|
-
columns: ColumnDef<T>[];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
let { table, columns }: Props = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class="rounded-md border">
|
|
18
|
-
<Table.Root>
|
|
19
|
-
<Table.Header>
|
|
20
|
-
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
|
|
21
|
-
<Table.Row>
|
|
22
|
-
{#each headerGroup.headers as header (header.id)}
|
|
23
|
-
<Table.Head class="[&:has([role=checkbox])]:ps-3">
|
|
24
|
-
{#if !header.isPlaceholder}
|
|
25
|
-
<FlexRender
|
|
26
|
-
content={header.column.columnDef.header}
|
|
27
|
-
context={header.getContext()}
|
|
28
|
-
/>
|
|
29
|
-
{/if}
|
|
30
|
-
</Table.Head>
|
|
31
|
-
{/each}
|
|
32
|
-
</Table.Row>
|
|
33
|
-
{/each}
|
|
34
|
-
</Table.Header>
|
|
35
|
-
<Table.Body>
|
|
36
|
-
{#each table.getRowModel().rows as row (row.id)}
|
|
37
|
-
<Table.Row data-state={row.getIsSelected() && "selected"}>
|
|
38
|
-
{#each row.getVisibleCells() as cell (cell.id)}
|
|
39
|
-
<Table.Cell class="[&:has([role=checkbox])]:ps-3">
|
|
40
|
-
<FlexRender
|
|
41
|
-
content={cell.column.columnDef.cell}
|
|
42
|
-
context={cell.getContext()}
|
|
43
|
-
/>
|
|
44
|
-
</Table.Cell>
|
|
45
|
-
{/each}
|
|
46
|
-
</Table.Row>
|
|
47
|
-
{:else}
|
|
48
|
-
<Table.Row>
|
|
49
|
-
<Table.Cell
|
|
50
|
-
colspan={columns.length}
|
|
51
|
-
class="h-24 text-center"
|
|
52
|
-
>
|
|
53
|
-
No results.
|
|
54
|
-
</Table.Cell>
|
|
55
|
-
</Table.Row>
|
|
56
|
-
{/each}
|
|
57
|
-
</Table.Body>
|
|
58
|
-
</Table.Root>
|
|
59
|
-
</div>
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import type {
|
|
3
|
+
ColumnDef,
|
|
4
|
+
Table as TanstackTable,
|
|
5
|
+
} from "@tanstack/table-core";
|
|
6
|
+
import * as Table from "../../../ui/table/index.js";
|
|
7
|
+
import FlexRender from "../../../ui/data-table/flex-render.svelte";
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
table: TanstackTable<T>;
|
|
11
|
+
columns: ColumnDef<T>[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let { table, columns }: Props = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="rounded-md border">
|
|
18
|
+
<Table.Root>
|
|
19
|
+
<Table.Header>
|
|
20
|
+
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
|
|
21
|
+
<Table.Row>
|
|
22
|
+
{#each headerGroup.headers as header (header.id)}
|
|
23
|
+
<Table.Head class="[&:has([role=checkbox])]:ps-3">
|
|
24
|
+
{#if !header.isPlaceholder}
|
|
25
|
+
<FlexRender
|
|
26
|
+
content={header.column.columnDef.header}
|
|
27
|
+
context={header.getContext()}
|
|
28
|
+
/>
|
|
29
|
+
{/if}
|
|
30
|
+
</Table.Head>
|
|
31
|
+
{/each}
|
|
32
|
+
</Table.Row>
|
|
33
|
+
{/each}
|
|
34
|
+
</Table.Header>
|
|
35
|
+
<Table.Body>
|
|
36
|
+
{#each table.getRowModel().rows as row (row.id)}
|
|
37
|
+
<Table.Row data-state={row.getIsSelected() && "selected"}>
|
|
38
|
+
{#each row.getVisibleCells() as cell (cell.id)}
|
|
39
|
+
<Table.Cell class="[&:has([role=checkbox])]:ps-3">
|
|
40
|
+
<FlexRender
|
|
41
|
+
content={cell.column.columnDef.cell}
|
|
42
|
+
context={cell.getContext()}
|
|
43
|
+
/>
|
|
44
|
+
</Table.Cell>
|
|
45
|
+
{/each}
|
|
46
|
+
</Table.Row>
|
|
47
|
+
{:else}
|
|
48
|
+
<Table.Row>
|
|
49
|
+
<Table.Cell
|
|
50
|
+
colspan={columns.length}
|
|
51
|
+
class="h-24 text-center"
|
|
52
|
+
>
|
|
53
|
+
No results.
|
|
54
|
+
</Table.Cell>
|
|
55
|
+
</Table.Row>
|
|
56
|
+
{/each}
|
|
57
|
+
</Table.Body>
|
|
58
|
+
</Table.Root>
|
|
59
|
+
</div>
|