@kayord/ui 0.2.3 → 0.2.5
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/custom/data-table/DataTable.svelte +12 -3
- package/dist/components/custom/data-table/DataTable.svelte.d.ts +2 -0
- package/dist/components/custom/loader/Loader.svelte.d.ts +1 -1
- package/dist/components/ui/drawer/index.d.ts +4 -2
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/input.svelte +2 -0
- package/dist/components/ui/pagination/pagination-next-button.svelte +5 -3
- package/dist/components/ui/pagination/pagination-next-button.svelte.d.ts +3 -1
- package/dist/components/ui/pagination/pagination-prev-button.svelte +4 -2
- package/dist/components/ui/pagination/pagination-prev-button.svelte.d.ts +3 -1
- package/package.json +10 -10
|
@@ -7,7 +7,9 @@ export let tableViewModel;
|
|
|
7
7
|
export let title = "";
|
|
8
8
|
export let isLoading = false;
|
|
9
9
|
export let hideHeader = false;
|
|
10
|
-
|
|
10
|
+
export let noDataMessage = "No Data";
|
|
11
|
+
export let serverItemCount = void 0;
|
|
12
|
+
const { headerRows, pageRows, tableAttrs, tableBodyAttrs, pluginStates, rows, flatColumns } = tableViewModel;
|
|
11
13
|
const isSortEnabled = pluginStates.sort != void 0;
|
|
12
14
|
const sortKeys = isSortEnabled ? pluginStates.sort.sortKeys : void 0;
|
|
13
15
|
const isPagingEnabled = pluginStates.page != void 0;
|
|
@@ -69,7 +71,7 @@ const pageSize = isPagingEnabled ? pluginStates.page.pageSize : void 0;
|
|
|
69
71
|
{#if isLoading}
|
|
70
72
|
{#each { length: 5 } as _, i}
|
|
71
73
|
<Table.Row>
|
|
72
|
-
{#each
|
|
74
|
+
{#each flatColumns as cell}
|
|
73
75
|
<Table.Cell>
|
|
74
76
|
<Skeleton class="h-4" />
|
|
75
77
|
</Table.Cell>
|
|
@@ -77,6 +79,13 @@ const pageSize = isPagingEnabled ? pluginStates.page.pageSize : void 0;
|
|
|
77
79
|
</Table.Row>
|
|
78
80
|
{/each}
|
|
79
81
|
{:else}
|
|
82
|
+
{#if $rows.length == 0}
|
|
83
|
+
<Table.Row>
|
|
84
|
+
<Table.Cell colspan={flatColumns.length}>
|
|
85
|
+
<div class="text-center">{noDataMessage}</div>
|
|
86
|
+
</Table.Cell>
|
|
87
|
+
</Table.Row>
|
|
88
|
+
{/if}
|
|
80
89
|
{#each $pageRows as row (row.id)}
|
|
81
90
|
<Subscribe rowAttrs={row.attrs()} let:rowAttrs>
|
|
82
91
|
<Table.Row {...rowAttrs}>
|
|
@@ -95,7 +104,7 @@ const pageSize = isPagingEnabled ? pluginStates.page.pageSize : void 0;
|
|
|
95
104
|
</Table.Root>
|
|
96
105
|
</div>
|
|
97
106
|
{#if isPagingEnabled}
|
|
98
|
-
<Pagination.Root count={$rows.length} perPage={$pageSize} let:pages let:currentPage>
|
|
107
|
+
<Pagination.Root count={serverItemCount ?? $rows.length} perPage={$pageSize} let:pages let:currentPage>
|
|
99
108
|
<Pagination.Content>
|
|
100
109
|
<Pagination.Item>
|
|
101
110
|
<Pagination.PrevButton on:click={() => ($pageIndex = $pageIndex - 1)} />
|
|
@@ -7,6 +7,8 @@ declare class __sveltets_Render<T extends RowData> {
|
|
|
7
7
|
title?: string | undefined;
|
|
8
8
|
isLoading?: boolean | undefined;
|
|
9
9
|
hideHeader?: boolean | undefined;
|
|
10
|
+
noDataMessage?: string | undefined;
|
|
11
|
+
serverItemCount?: number | undefined;
|
|
10
12
|
};
|
|
11
13
|
events(): {} & {
|
|
12
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
1
3
|
import Root from "./drawer.svelte";
|
|
2
4
|
import Content from "./drawer-content.svelte";
|
|
3
5
|
import Description from "./drawer-description.svelte";
|
|
@@ -5,7 +7,7 @@ import Overlay from "./drawer-overlay.svelte";
|
|
|
5
7
|
import Footer from "./drawer-footer.svelte";
|
|
6
8
|
import Header from "./drawer-header.svelte";
|
|
7
9
|
import Title from "./drawer-title.svelte";
|
|
8
|
-
declare const Trigger: typeof
|
|
10
|
+
declare const Trigger: typeof DrawerPrimitive.Close;
|
|
9
11
|
declare const Portal: typeof import("bits-ui/dist/bits/dialog").Portal;
|
|
10
|
-
declare const Close: typeof
|
|
12
|
+
declare const Close: typeof DrawerPrimitive.Close;
|
|
11
13
|
export { Root, Content, Description, Overlay, Footer, Header, Title, Trigger, Portal, Close, Root as Drawer, Content as DrawerContent, Description as DrawerDescription, Overlay as DrawerOverlay, Footer as DrawerFooter, Header as DrawerHeader, Title as DrawerTitle, Trigger as DrawerTrigger, Portal as DrawerPortal, Close as DrawerClose };
|
|
@@ -7,6 +7,8 @@ export type InputEvents = {
|
|
|
7
7
|
change: FormInputEvent<Event>;
|
|
8
8
|
click: FormInputEvent<MouseEvent>;
|
|
9
9
|
focus: FormInputEvent<FocusEvent>;
|
|
10
|
+
focusin: FormInputEvent<FocusEvent>;
|
|
11
|
+
focusout: FormInputEvent<FocusEvent>;
|
|
10
12
|
keydown: FormInputEvent<KeyboardEvent>;
|
|
11
13
|
keypress: FormInputEvent<KeyboardEvent>;
|
|
12
14
|
keyup: FormInputEvent<KeyboardEvent>;
|
|
@@ -9,12 +9,14 @@ export { className as class };
|
|
|
9
9
|
<PaginationPrimitive.NextButton asChild let:builder>
|
|
10
10
|
<Button
|
|
11
11
|
variant="ghost"
|
|
12
|
-
class={cn("gap-1
|
|
12
|
+
class={cn("gap-1 pr-2.5", className)}
|
|
13
13
|
builders={[builder]}
|
|
14
14
|
on:click
|
|
15
15
|
{...$$restProps}
|
|
16
16
|
>
|
|
17
|
-
<
|
|
18
|
-
|
|
17
|
+
<slot>
|
|
18
|
+
<span>Next</span>
|
|
19
|
+
<ChevronRight class="h-4 w-4" />
|
|
20
|
+
</slot>
|
|
19
21
|
</Button>
|
|
20
22
|
</PaginationPrimitive.NextButton>
|
|
@@ -2,7 +2,9 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: PaginationPrimitive.NextButtonProps;
|
|
5
|
-
slots: {
|
|
5
|
+
slots: {
|
|
6
|
+
default: {};
|
|
7
|
+
};
|
|
6
8
|
events: {
|
|
7
9
|
click: import("bits-ui").CustomEventHandler<MouseEvent, HTMLDivElement>;
|
|
8
10
|
};
|
|
@@ -14,7 +14,9 @@ export { className as class };
|
|
|
14
14
|
on:click
|
|
15
15
|
{...$$restProps}
|
|
16
16
|
>
|
|
17
|
-
<
|
|
18
|
-
|
|
17
|
+
<slot>
|
|
18
|
+
<ChevronLeft class="h-4 w-4" />
|
|
19
|
+
<span>Previous</span>
|
|
20
|
+
</slot>
|
|
19
21
|
</Button>
|
|
20
22
|
</PaginationPrimitive.PrevButton>
|
|
@@ -2,7 +2,9 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: PaginationPrimitive.PrevButtonProps;
|
|
5
|
-
slots: {
|
|
5
|
+
slots: {
|
|
6
|
+
default: {};
|
|
7
|
+
};
|
|
6
8
|
events: {
|
|
7
9
|
click: import("bits-ui").CustomEventHandler<MouseEvent, HTMLDivElement>;
|
|
8
10
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -21,28 +21,28 @@
|
|
|
21
21
|
"svelte": "^4.0.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"bits-ui": "^0.13.
|
|
24
|
+
"bits-ui": "^0.13.6",
|
|
25
25
|
"clsx": "^2.1.0",
|
|
26
26
|
"cmdk-sv": "^0.0.12",
|
|
27
27
|
"formsnap": "^0.4.2",
|
|
28
|
-
"lucide-svelte": "^0.
|
|
28
|
+
"lucide-svelte": "^0.308.0",
|
|
29
29
|
"mode-watcher": "^0.1.2",
|
|
30
30
|
"svelte-headless-table": "^0.18.1",
|
|
31
|
-
"svelte-sonner": "^0.3.
|
|
32
|
-
"sveltekit-superforms": "^1.13.
|
|
31
|
+
"svelte-sonner": "^0.3.11",
|
|
32
|
+
"sveltekit-superforms": "^1.13.2",
|
|
33
33
|
"tailwind-merge": "^2.2.0",
|
|
34
34
|
"tailwind-variants": "^0.1.20",
|
|
35
|
-
"vaul-svelte": "^0.0.
|
|
35
|
+
"vaul-svelte": "^0.0.6",
|
|
36
36
|
"zod": "^3.22.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@playwright/test": "^1.40.1",
|
|
40
40
|
"@sveltejs/adapter-auto": "^3.1.0",
|
|
41
|
-
"@sveltejs/kit": "^2.
|
|
41
|
+
"@sveltejs/kit": "^2.1.2",
|
|
42
42
|
"@sveltejs/package": "^2.2.5",
|
|
43
43
|
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
45
|
-
"@typescript-eslint/parser": "^6.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
45
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
46
46
|
"autoprefixer": "^10.4.16",
|
|
47
47
|
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"publint": "^0.2.7",
|
|
55
55
|
"svelte": "^4.2.8",
|
|
56
56
|
"svelte-check": "^3.6.2",
|
|
57
|
-
"tailwindcss": "^3.4.
|
|
57
|
+
"tailwindcss": "^3.4.1",
|
|
58
58
|
"tslib": "^2.6.2",
|
|
59
59
|
"typescript": "^5.3.3",
|
|
60
60
|
"vite": "^5.0.11",
|