@rkosafo/cai.components 0.0.75 → 0.0.78
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/README.md +8 -8
- package/dist/baseEditor/index.svelte +32 -32
- package/dist/builders/filters/FilterBuilder.svelte +641 -641
- package/dist/forms/FormCheckbox/FormCheckbox.svelte +53 -53
- package/dist/forms/FormClEditor/ClEdito.svelte +68 -68
- package/dist/forms/FormDatepicker/FormDatepicker.svelte +159 -159
- package/dist/forms/FormFileUpload/FormFileUplad.svelte +134 -134
- package/dist/forms/FormInput/FormInput.svelte +87 -87
- package/dist/forms/FormRadio/FormRadio.svelte +53 -53
- package/dist/forms/FormSelect/FormSelect.svelte +88 -88
- package/dist/forms/FormTextarea/FormTextarea.svelte +78 -78
- package/dist/forms/button-toggle/ButtonToggle.svelte +119 -0
- package/dist/forms/button-toggle/ButtonToggle.svelte.d.ts +139 -0
- package/dist/forms/button-toggle/ButtonToggleGroup.svelte +0 -0
- package/dist/forms/button-toggle/ButtonToggleGroup.svelte.d.ts +26 -0
- package/dist/forms/button-toggle/CheckIcon.svelte +28 -0
- package/dist/forms/button-toggle/CheckIcon.svelte.d.ts +4 -0
- package/dist/forms/button-toggle/index.d.ts +4 -0
- package/dist/forms/button-toggle/index.js +4 -0
- package/dist/forms/button-toggle/theme.d.ts +347 -0
- package/dist/forms/button-toggle/theme.js +129 -0
- package/dist/forms/checkbox/Checkbox.svelte +82 -82
- package/dist/forms/checkbox/CheckboxButton.svelte +92 -92
- package/dist/forms/datepicker/Datepicker.svelte +707 -707
- package/dist/forms/form/Form.svelte +69 -69
- package/dist/forms/input/Input.svelte +363 -363
- package/dist/forms/label/Label.svelte +38 -38
- package/dist/forms/radio/Radio.svelte +48 -48
- package/dist/forms/radio/RadioButton.svelte +22 -22
- package/dist/forms/select/Select.svelte +56 -56
- package/dist/forms/textarea/Textarea.svelte +165 -165
- package/dist/forms/toggle/Toggle.svelte +70 -0
- package/dist/forms/toggle/Toggle.svelte.d.ts +3 -0
- package/dist/forms/toggle/index.d.ts +2 -0
- package/dist/forms/toggle/index.js +2 -0
- package/dist/forms/toggle/theme.d.ts +280 -0
- package/dist/forms/toggle/theme.js +97 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/layout/Chat/CategorySelector.svelte +52 -52
- package/dist/layout/Chat/ChatEntry.svelte +246 -246
- package/dist/layout/Chat/ChatEntrySkeleton.svelte +81 -81
- package/dist/layout/Chat/ChatHeader.svelte +172 -172
- package/dist/layout/Chat/ChatInput.svelte +207 -207
- package/dist/layout/Chat/DraggableWindow.svelte +230 -230
- package/dist/layout/Chat/PreviewPage.svelte +182 -182
- package/dist/layout/Chat/RichText.svelte +216 -216
- package/dist/layout/ComponentCanvas/Canvas.svelte +40 -40
- package/dist/layout/ComponentCanvas/ComponentRenderer.svelte +85 -85
- package/dist/layout/TF/Content/Content.svelte +21 -21
- package/dist/layout/TF/Header/Header.svelte +166 -166
- package/dist/layout/TF/Sidebar/Sidebar.svelte +148 -148
- package/dist/layout/TF/Wrapper/Wrapper.svelte +17 -17
- package/dist/layout/mailing/MailPaginator.svelte +36 -36
- package/dist/layout/mailing/MailSidebar.svelte +39 -39
- package/dist/layout/mailing/MailToolBar.svelte +174 -174
- package/dist/layout/mailing/MailingContent.svelte +10 -10
- package/dist/layout/mailing/MailingHeader.svelte +55 -55
- package/dist/layout/mailing/MailingMessageCard.svelte +112 -112
- package/dist/layout/mailing/MailingMessageViewer.svelte +87 -87
- package/dist/layout/mailing/MailingModule.svelte +448 -448
- package/dist/styles/docs.css +615 -615
- package/dist/styles/tf-layout.css +185 -185
- package/dist/themes/ThemeProvider.svelte +20 -20
- package/dist/themes/themes.d.ts +3 -0
- package/dist/themes/themes.js +3 -0
- package/dist/types/index.d.ts +57 -1
- package/dist/typography/heading/Heading.svelte +35 -35
- package/dist/ui/accordion/Accordion.svelte +49 -49
- package/dist/ui/accordion/AccordionItem.svelte +173 -173
- package/dist/ui/alert/Alert.svelte +83 -83
- package/dist/ui/alertDialog/AlertDialog.svelte +40 -40
- package/dist/ui/avatar/Avatar.svelte +77 -77
- package/dist/ui/box/Box.svelte +28 -28
- package/dist/ui/breadcrumb/Breadcrumb.svelte +39 -39
- package/dist/ui/buttons/ActionButton.svelte +234 -234
- package/dist/ui/buttons/Button.svelte +102 -102
- package/dist/ui/buttons/GradientButton.svelte +59 -59
- package/dist/ui/datatable/Datatable.svelte +525 -525
- package/dist/ui/drawer/Drawer.svelte +300 -300
- package/dist/ui/dropdown/Dropdown.svelte +36 -36
- package/dist/ui/dropdown/DropdownDivider.svelte +11 -11
- package/dist/ui/dropdown/DropdownGroup.svelte +14 -14
- package/dist/ui/dropdown/DropdownHeader.svelte +14 -14
- package/dist/ui/dropdown/DropdownItem.svelte +52 -52
- package/dist/ui/footer/Footer.svelte +15 -15
- package/dist/ui/footer/FooterBrand.svelte +37 -37
- package/dist/ui/footer/FooterCopyright.svelte +45 -45
- package/dist/ui/footer/FooterIcon.svelte +22 -22
- package/dist/ui/footer/FooterLink.svelte +33 -33
- package/dist/ui/footer/FooterLinkGroup.svelte +13 -13
- package/dist/ui/icons/IconifyIcon.svelte +7 -7
- package/dist/ui/indicator/Indicator.svelte +42 -42
- package/dist/ui/modal/Modal.svelte +265 -265
- package/dist/ui/modal/theme.d.ts +26 -26
- package/dist/ui/modal/theme.js +25 -25
- package/dist/ui/notificationList/NotificationList.svelte +123 -123
- package/dist/ui/pageLoader/PageLoader.svelte +14 -14
- package/dist/ui/paginate/Paginate.svelte +96 -96
- package/dist/ui/speedDial/SpeedDial.svelte +77 -0
- package/dist/ui/speedDial/SpeedDial.svelte.d.ts +21 -0
- package/dist/ui/speedDial/SpeedDialButton.svelte +75 -0
- package/dist/ui/speedDial/SpeedDialButton.svelte.d.ts +20 -0
- package/dist/ui/speedDial/SpeedDialTrigger.svelte +79 -0
- package/dist/ui/speedDial/SpeedDialTrigger.svelte.d.ts +18 -0
- package/dist/ui/speedDial/index.d.ts +4 -0
- package/dist/ui/speedDial/index.js +4 -0
- package/dist/ui/speedDial/theme.d.ts +75 -0
- package/dist/ui/speedDial/theme.js +35 -0
- package/dist/ui/tab/Tab.svelte +67 -67
- package/dist/ui/table/Table.svelte +396 -396
- package/dist/ui/tableLoader/TableLoader.svelte +24 -24
- package/dist/ui/toast/Toast.svelte +337 -337
- package/dist/ui/toast/Toast.svelte.d.ts +10 -10
- package/dist/ui/toast/index.d.ts +1 -2
- package/dist/ui/toast/index.js +3 -1
- package/dist/ui/toolbar/Toolbar.svelte +59 -59
- package/dist/ui/toolbar/ToolbarButton.svelte +56 -56
- package/dist/ui/toolbar/ToolbarGroup.svelte +43 -43
- package/dist/ui/tooltip/Tooltip.svelte +51 -51
- package/dist/utils/Popper.svelte +257 -257
- package/dist/utils/closeButton/CloseButton.svelte +88 -88
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.js +13 -3
- package/dist/utils/singleSelection.svelte.js +48 -48
- package/dist/youtube/index.svelte +12 -12
- package/package.json +2 -1
package/dist/ui/modal/theme.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const modal = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base:
|
|
5
|
-
form:
|
|
6
|
-
header:
|
|
7
|
-
footer:
|
|
8
|
-
body:
|
|
9
|
-
close:
|
|
4
|
+
base: 'backdrop:bg-black/80 open:flex flex-col w-full max-h-[90hv] rounded-lg divide-y text-gray-500 dark:text-gray-400 border-gray-300 dark:border-gray-800 divide-gray-300 dark:divide-gray-700 bg-white dark:bg-gray-800 pointer-events-auto',
|
|
5
|
+
form: 'flex flex-col rounded-lg divide-y',
|
|
6
|
+
header: 'flex items-center p-4 md:p-5 justify-between rounded-t-lg shrink-0 text-xl font-semibold text-gray-900 dark:text-white',
|
|
7
|
+
footer: 'flex items-center p-4 md:p-5 space-x-3 rtl:space-x-reverse rounded-b-lg shrink-0',
|
|
8
|
+
body: 'p-4 md:p-5 space-y-4 overflow-y-auto overscroll-contain',
|
|
9
|
+
close: 'absolute top-3 end-2.5'
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
12
|
fullscreen: {
|
|
13
13
|
true: {
|
|
14
|
-
base:
|
|
14
|
+
base: 'fixed inset-0 w-screen h-screen max-w-none max-h-none m-0 p-0 border-none rounded-none bg-white dark:bg-gray-900'
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
placement: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
center: { base:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
'top-left': { base: 'top-0 left-0' },
|
|
19
|
+
'top-center': { base: 'top-0 left-1/2 -translate-x-1/2' },
|
|
20
|
+
'top-right': { base: 'top-0 left-full -translate-x-full' },
|
|
21
|
+
'center-left': { base: 'top-1/2 left-0 -translate-y-1/2' },
|
|
22
|
+
center: { base: 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2' },
|
|
23
|
+
'center-right': { base: 'top-1/2 left-full -translate-x-full -translate-y-1/2' },
|
|
24
|
+
'bottom-left': { base: 'top-full -translate-y-full left-0' },
|
|
25
|
+
'bottom-center': { base: 'top-full -translate-y-full left-1/2 -translate-x-1/2' },
|
|
26
|
+
'bottom-right': { base: 'top-full -translate-y-full left-full -translate-x-full' }
|
|
27
27
|
},
|
|
28
28
|
size: {
|
|
29
|
-
none: { base:
|
|
30
|
-
xs: { base:
|
|
31
|
-
sm: { base:
|
|
32
|
-
md: { base:
|
|
33
|
-
lg: { base:
|
|
34
|
-
xl: { base:
|
|
29
|
+
none: { base: '' },
|
|
30
|
+
xs: { base: 'max-w-md' },
|
|
31
|
+
sm: { base: 'max-w-lg' },
|
|
32
|
+
md: { base: 'max-w-2xl' },
|
|
33
|
+
lg: { base: 'max-w-4xl' },
|
|
34
|
+
xl: { base: 'max-w-7xl' }
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
placement:
|
|
39
|
-
size:
|
|
38
|
+
placement: 'center',
|
|
39
|
+
size: 'md'
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<script lang="ts" generics="T extends NotificationItem">
|
|
4
|
-
import { Dropdown, DropdownItem } from '../dropdown/index.js';
|
|
5
|
-
import { Avatar } from '../avatar/index.js';
|
|
6
|
-
import { PageLoader, type NotificationItem, type NotificationListProps } from '../../index.js';
|
|
7
|
-
import { onDestroy, onMount } from 'svelte';
|
|
8
|
-
|
|
9
|
-
let {
|
|
10
|
-
open = $bindable(false),
|
|
11
|
-
onClearNotifications,
|
|
12
|
-
header,
|
|
13
|
-
busy = false,
|
|
14
|
-
data: initialData = [],
|
|
15
|
-
onclick,
|
|
16
|
-
footer,
|
|
17
|
-
read
|
|
18
|
-
}: NotificationListProps<T> = $props();
|
|
19
|
-
|
|
20
|
-
let data = $state(initialData);
|
|
21
|
-
let internalOpen = $state(false);
|
|
22
|
-
|
|
23
|
-
$effect(() => {
|
|
24
|
-
if (open !== undefined) {
|
|
25
|
-
internalOpen = open;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
async function fetchData() {
|
|
30
|
-
if (!read) return;
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
busy = true;
|
|
34
|
-
const result = await read();
|
|
35
|
-
data = result;
|
|
36
|
-
} finally {
|
|
37
|
-
busy = false;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
$effect(() => {
|
|
42
|
-
if (internalOpen) {
|
|
43
|
-
data = [];
|
|
44
|
-
fetchData();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
onMount(() => {
|
|
49
|
-
if (initialData && initialData.length > 0) {
|
|
50
|
-
data = initialData;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
onDestroy(() => {
|
|
55
|
-
data = [];
|
|
56
|
-
});
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<Dropdown
|
|
60
|
-
bind:isOpen={internalOpen}
|
|
61
|
-
class="w-full max-w-sm divide-gray-100 rounded shadow dark:divide-gray-700 dark:bg-gray-800"
|
|
62
|
-
>
|
|
63
|
-
{#if header}
|
|
64
|
-
{@render header()}
|
|
65
|
-
{:else}
|
|
66
|
-
<div class="py-2 text-center font-bold">Notifications</div>
|
|
67
|
-
{/if}
|
|
68
|
-
<div
|
|
69
|
-
class="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch flex max-h-80 flex-col divide-y divide-gray-300 overflow-y-auto"
|
|
70
|
-
>
|
|
71
|
-
{#if busy}
|
|
72
|
-
<div class="flex h-52 w-96 items-center justify-center">
|
|
73
|
-
<PageLoader size={40} />
|
|
74
|
-
</div>
|
|
75
|
-
{:else if data.length}
|
|
76
|
-
{#each data as item, index}
|
|
77
|
-
<DropdownItem class="flex w-full space-x-4" onclick={() => onclick?.(item)}>
|
|
78
|
-
<Avatar cornerStyle="rounded">
|
|
79
|
-
<iconify-icon icon={item.icon} style="font-size: 20px;"></iconify-icon>
|
|
80
|
-
</Avatar>
|
|
81
|
-
<div class="w-full pl-3 text-start">
|
|
82
|
-
<div class="mb-1.5 text-sm text-gray-500 dark:text-gray-400">
|
|
83
|
-
<span class="font-semibold text-gray-900 dark:text-white">{item.sender}</span>: "{item.content}"
|
|
84
|
-
</div>
|
|
85
|
-
<div class="flex items-center justify-between">
|
|
86
|
-
<div class="text-xs text-primary-600 dark:text-primary-500">{item.time}</div>
|
|
87
|
-
<div class="flex items-center gap-1">
|
|
88
|
-
{#if item.isRead}
|
|
89
|
-
<span class="text-xs font-light text-gray-400">Read</span>
|
|
90
|
-
{/if}
|
|
91
|
-
<iconify-icon
|
|
92
|
-
icon={item.isRead ? 'ri:check-double-line' : 'uim:check'}
|
|
93
|
-
class={item.isRead ? 'text-blue-700' : 'text-gray-500'}
|
|
94
|
-
style="font-size: 18px;"
|
|
95
|
-
></iconify-icon>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</DropdownItem>
|
|
100
|
-
{/each}
|
|
101
|
-
{:else}
|
|
102
|
-
<div class="flex h-32 w-80 items-center justify-center space-x-4">
|
|
103
|
-
<p>No Notifications</p>
|
|
104
|
-
</div>
|
|
105
|
-
{/if}
|
|
106
|
-
</div>
|
|
107
|
-
{#if footer}
|
|
108
|
-
{@render footer()}
|
|
109
|
-
{:else}
|
|
110
|
-
<div
|
|
111
|
-
class="-my-1 block bg-gray-50 py-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700"
|
|
112
|
-
>
|
|
113
|
-
{#if data.length}
|
|
114
|
-
<button class="w-full" onclick={onClearNotifications}>
|
|
115
|
-
<div class="inline-flex items-center gap-2">
|
|
116
|
-
<iconify-icon icon="ic:round-close"></iconify-icon>
|
|
117
|
-
Clear all
|
|
118
|
-
</div>
|
|
119
|
-
</button>
|
|
120
|
-
{/if}
|
|
121
|
-
</div>
|
|
122
|
-
{/if}
|
|
123
|
-
</Dropdown>
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<script lang="ts" generics="T extends NotificationItem">
|
|
4
|
+
import { Dropdown, DropdownItem } from '../dropdown/index.js';
|
|
5
|
+
import { Avatar } from '../avatar/index.js';
|
|
6
|
+
import { PageLoader, type NotificationItem, type NotificationListProps } from '../../index.js';
|
|
7
|
+
import { onDestroy, onMount } from 'svelte';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
open = $bindable(false),
|
|
11
|
+
onClearNotifications,
|
|
12
|
+
header,
|
|
13
|
+
busy = false,
|
|
14
|
+
data: initialData = [],
|
|
15
|
+
onclick,
|
|
16
|
+
footer,
|
|
17
|
+
read
|
|
18
|
+
}: NotificationListProps<T> = $props();
|
|
19
|
+
|
|
20
|
+
let data = $state(initialData);
|
|
21
|
+
let internalOpen = $state(false);
|
|
22
|
+
|
|
23
|
+
$effect(() => {
|
|
24
|
+
if (open !== undefined) {
|
|
25
|
+
internalOpen = open;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
async function fetchData() {
|
|
30
|
+
if (!read) return;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
busy = true;
|
|
34
|
+
const result = await read();
|
|
35
|
+
data = result;
|
|
36
|
+
} finally {
|
|
37
|
+
busy = false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$effect(() => {
|
|
42
|
+
if (internalOpen) {
|
|
43
|
+
data = [];
|
|
44
|
+
fetchData();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
onMount(() => {
|
|
49
|
+
if (initialData && initialData.length > 0) {
|
|
50
|
+
data = initialData;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
onDestroy(() => {
|
|
55
|
+
data = [];
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<Dropdown
|
|
60
|
+
bind:isOpen={internalOpen}
|
|
61
|
+
class="w-full max-w-sm divide-gray-100 rounded shadow dark:divide-gray-700 dark:bg-gray-800"
|
|
62
|
+
>
|
|
63
|
+
{#if header}
|
|
64
|
+
{@render header()}
|
|
65
|
+
{:else}
|
|
66
|
+
<div class="py-2 text-center font-bold">Notifications</div>
|
|
67
|
+
{/if}
|
|
68
|
+
<div
|
|
69
|
+
class="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch flex max-h-80 flex-col divide-y divide-gray-300 overflow-y-auto"
|
|
70
|
+
>
|
|
71
|
+
{#if busy}
|
|
72
|
+
<div class="flex h-52 w-96 items-center justify-center">
|
|
73
|
+
<PageLoader size={40} />
|
|
74
|
+
</div>
|
|
75
|
+
{:else if data.length}
|
|
76
|
+
{#each data as item, index}
|
|
77
|
+
<DropdownItem class="flex w-full space-x-4" onclick={() => onclick?.(item)}>
|
|
78
|
+
<Avatar cornerStyle="rounded">
|
|
79
|
+
<iconify-icon icon={item.icon} style="font-size: 20px;"></iconify-icon>
|
|
80
|
+
</Avatar>
|
|
81
|
+
<div class="w-full pl-3 text-start">
|
|
82
|
+
<div class="mb-1.5 text-sm text-gray-500 dark:text-gray-400">
|
|
83
|
+
<span class="font-semibold text-gray-900 dark:text-white">{item.sender}</span>: "{item.content}"
|
|
84
|
+
</div>
|
|
85
|
+
<div class="flex items-center justify-between">
|
|
86
|
+
<div class="text-xs text-primary-600 dark:text-primary-500">{item.time}</div>
|
|
87
|
+
<div class="flex items-center gap-1">
|
|
88
|
+
{#if item.isRead}
|
|
89
|
+
<span class="text-xs font-light text-gray-400">Read</span>
|
|
90
|
+
{/if}
|
|
91
|
+
<iconify-icon
|
|
92
|
+
icon={item.isRead ? 'ri:check-double-line' : 'uim:check'}
|
|
93
|
+
class={item.isRead ? 'text-blue-700' : 'text-gray-500'}
|
|
94
|
+
style="font-size: 18px;"
|
|
95
|
+
></iconify-icon>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</DropdownItem>
|
|
100
|
+
{/each}
|
|
101
|
+
{:else}
|
|
102
|
+
<div class="flex h-32 w-80 items-center justify-center space-x-4">
|
|
103
|
+
<p>No Notifications</p>
|
|
104
|
+
</div>
|
|
105
|
+
{/if}
|
|
106
|
+
</div>
|
|
107
|
+
{#if footer}
|
|
108
|
+
{@render footer()}
|
|
109
|
+
{:else}
|
|
110
|
+
<div
|
|
111
|
+
class="-my-1 block bg-gray-50 py-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700"
|
|
112
|
+
>
|
|
113
|
+
{#if data.length}
|
|
114
|
+
<button class="w-full" onclick={onClearNotifications}>
|
|
115
|
+
<div class="inline-flex items-center gap-2">
|
|
116
|
+
<iconify-icon icon="ic:round-close"></iconify-icon>
|
|
117
|
+
Clear all
|
|
118
|
+
</div>
|
|
119
|
+
</button>
|
|
120
|
+
{/if}
|
|
121
|
+
</div>
|
|
122
|
+
{/if}
|
|
123
|
+
</Dropdown>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { PageLoaderProps } from '../../index.js';
|
|
3
|
-
import IconifyIcon from '../icons/IconifyIcon.svelte';
|
|
4
|
-
|
|
5
|
-
let { size = 70, iconColor = 'text-blue-400' }: PageLoaderProps = $props();
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<div class="grid h-full w-full items-center justify-center">
|
|
9
|
-
<IconifyIcon
|
|
10
|
-
class={iconColor}
|
|
11
|
-
icon="svg-spinners:blocks-shuffle-3"
|
|
12
|
-
style="font-size: {size}px;"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { PageLoaderProps } from '../../index.js';
|
|
3
|
+
import IconifyIcon from '../icons/IconifyIcon.svelte';
|
|
4
|
+
|
|
5
|
+
let { size = 70, iconColor = 'text-blue-400' }: PageLoaderProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class="grid h-full w-full items-center justify-center">
|
|
9
|
+
<IconifyIcon
|
|
10
|
+
class={iconColor}
|
|
11
|
+
icon="svg-spinners:blocks-shuffle-3"
|
|
12
|
+
style="font-size: {size}px;"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Dropdown, type PaginateProps } from '../../index.js';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
currentPage,
|
|
6
|
-
hasNextPage,
|
|
7
|
-
hasPreviousPage,
|
|
8
|
-
onNextPage,
|
|
9
|
-
onPreviousPage,
|
|
10
|
-
refresh = null,
|
|
11
|
-
totalPages,
|
|
12
|
-
hiddenColumns = $bindable([]),
|
|
13
|
-
tableColumns = [],
|
|
14
|
-
textSmall = false,
|
|
15
|
-
hideLabel = true,
|
|
16
|
-
recordCount = 0
|
|
17
|
-
}: PaginateProps = $props();
|
|
18
|
-
|
|
19
|
-
// let hideState = tableColumns.map(x => )
|
|
20
|
-
let hideState = $state<Record<string, boolean>>({});
|
|
21
|
-
hiddenColumns.forEach((x) => (hideState[x] = true));
|
|
22
|
-
// $: hiddenColumns = Object.keys(hideState).filter((x) => hideState[x]);
|
|
23
|
-
// let hiddenColumns
|
|
24
|
-
|
|
25
|
-
let open = $state(false);
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<div class:text-sm={textSmall} class="flex w-full items-center justify-between gap-2 text-gray-600">
|
|
29
|
-
<button
|
|
30
|
-
class=" items-center justify-center gap-1 p-2 text-sm font-semibold"
|
|
31
|
-
class:hidden={!totalPages}
|
|
32
|
-
class:flex={totalPages}
|
|
33
|
-
onclick={onPreviousPage}
|
|
34
|
-
disabled={!hasPreviousPage}
|
|
35
|
-
class:active={hasPreviousPage}
|
|
36
|
-
class:hover:bg-gray-200={hasPreviousPage}
|
|
37
|
-
class:rounded-md={hasPreviousPage}
|
|
38
|
-
class:text-gray-300={!hasPreviousPage}
|
|
39
|
-
>
|
|
40
|
-
<iconify-icon icon="material-symbols:arrow-back" style="font-size: 18px"></iconify-icon>
|
|
41
|
-
{#if !hideLabel}
|
|
42
|
-
<span>PREV</span>
|
|
43
|
-
{/if}
|
|
44
|
-
</button>
|
|
45
|
-
<div class="text-sm font-semibold">
|
|
46
|
-
{#if !hideLabel}
|
|
47
|
-
<span>Page</span>
|
|
48
|
-
{/if}
|
|
49
|
-
<span class:hidden={!totalPages} class:flex={totalPages}>{currentPage}/{totalPages}</span>
|
|
50
|
-
</div>
|
|
51
|
-
<span class:hidden={!recordCount} class:flex={recordCount}>({recordCount})</span>
|
|
52
|
-
|
|
53
|
-
<button
|
|
54
|
-
class="flex items-center justify-center gap-1 p-2 text-sm font-semibold"
|
|
55
|
-
class:hidden={!totalPages}
|
|
56
|
-
class:flex={totalPages}
|
|
57
|
-
onclick={onNextPage}
|
|
58
|
-
disabled={!hasNextPage}
|
|
59
|
-
class:active={hasNextPage}
|
|
60
|
-
class:hover:bg-gray-200={hasNextPage}
|
|
61
|
-
class:rounded-md={hasNextPage}
|
|
62
|
-
class:text-gray-300={!hasNextPage}
|
|
63
|
-
>
|
|
64
|
-
{#if !hideLabel}
|
|
65
|
-
<span>NEXT</span>
|
|
66
|
-
{/if}
|
|
67
|
-
<iconify-icon icon="material-symbols:arrow-forward" style="font-size: 18px"></iconify-icon>
|
|
68
|
-
</button>
|
|
69
|
-
<button
|
|
70
|
-
type="button"
|
|
71
|
-
aria-label="arrows-clockwise"
|
|
72
|
-
class="rotate-2 font-bold hover:text-gray-600"
|
|
73
|
-
class:hidden={!refresh}
|
|
74
|
-
onclick={refresh}
|
|
75
|
-
>
|
|
76
|
-
<iconify-icon icon="ph:arrows-clockwise" class="hover:animate-spin hover:text-gray-400"
|
|
77
|
-
></iconify-icon>
|
|
78
|
-
</button>
|
|
79
|
-
<div class:hidden={!tableColumns.length} class:flex={tableColumns}>
|
|
80
|
-
<button onclick={() => (open = !open)}>
|
|
81
|
-
<iconify-icon icon="ph:columns" class="text-red-500 hover:text-red-800"></iconify-icon>
|
|
82
|
-
<!-- <Tooltip>Toggle Columns</Tooltip> -->
|
|
83
|
-
</button>
|
|
84
|
-
<Dropdown
|
|
85
|
-
bind:isOpen={open}
|
|
86
|
-
class="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch h-56 min-w-40 overflow-y-auto px-3 pb-3 text-sm"
|
|
87
|
-
>
|
|
88
|
-
{#each tableColumns as column}
|
|
89
|
-
<li class="flex w-full px-2 py-1.5 whitespace-nowrap">
|
|
90
|
-
<!-- <Toggle bind:checked={hideState[column.id]} class="cursor-pointer" /> -->
|
|
91
|
-
{column.header}
|
|
92
|
-
</li>
|
|
93
|
-
{/each}
|
|
94
|
-
</Dropdown>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dropdown, type PaginateProps } from '../../index.js';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
currentPage,
|
|
6
|
+
hasNextPage,
|
|
7
|
+
hasPreviousPage,
|
|
8
|
+
onNextPage,
|
|
9
|
+
onPreviousPage,
|
|
10
|
+
refresh = null,
|
|
11
|
+
totalPages,
|
|
12
|
+
hiddenColumns = $bindable([]),
|
|
13
|
+
tableColumns = [],
|
|
14
|
+
textSmall = false,
|
|
15
|
+
hideLabel = true,
|
|
16
|
+
recordCount = 0
|
|
17
|
+
}: PaginateProps = $props();
|
|
18
|
+
|
|
19
|
+
// let hideState = tableColumns.map(x => )
|
|
20
|
+
let hideState = $state<Record<string, boolean>>({});
|
|
21
|
+
hiddenColumns.forEach((x) => (hideState[x] = true));
|
|
22
|
+
// $: hiddenColumns = Object.keys(hideState).filter((x) => hideState[x]);
|
|
23
|
+
// let hiddenColumns
|
|
24
|
+
|
|
25
|
+
let open = $state(false);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class:text-sm={textSmall} class="flex w-full items-center justify-between gap-2 text-gray-600">
|
|
29
|
+
<button
|
|
30
|
+
class=" items-center justify-center gap-1 p-2 text-sm font-semibold"
|
|
31
|
+
class:hidden={!totalPages}
|
|
32
|
+
class:flex={totalPages}
|
|
33
|
+
onclick={onPreviousPage}
|
|
34
|
+
disabled={!hasPreviousPage}
|
|
35
|
+
class:active={hasPreviousPage}
|
|
36
|
+
class:hover:bg-gray-200={hasPreviousPage}
|
|
37
|
+
class:rounded-md={hasPreviousPage}
|
|
38
|
+
class:text-gray-300={!hasPreviousPage}
|
|
39
|
+
>
|
|
40
|
+
<iconify-icon icon="material-symbols:arrow-back" style="font-size: 18px"></iconify-icon>
|
|
41
|
+
{#if !hideLabel}
|
|
42
|
+
<span>PREV</span>
|
|
43
|
+
{/if}
|
|
44
|
+
</button>
|
|
45
|
+
<div class="text-sm font-semibold">
|
|
46
|
+
{#if !hideLabel}
|
|
47
|
+
<span>Page</span>
|
|
48
|
+
{/if}
|
|
49
|
+
<span class:hidden={!totalPages} class:flex={totalPages}>{currentPage}/{totalPages}</span>
|
|
50
|
+
</div>
|
|
51
|
+
<span class:hidden={!recordCount} class:flex={recordCount}>({recordCount})</span>
|
|
52
|
+
|
|
53
|
+
<button
|
|
54
|
+
class="flex items-center justify-center gap-1 p-2 text-sm font-semibold"
|
|
55
|
+
class:hidden={!totalPages}
|
|
56
|
+
class:flex={totalPages}
|
|
57
|
+
onclick={onNextPage}
|
|
58
|
+
disabled={!hasNextPage}
|
|
59
|
+
class:active={hasNextPage}
|
|
60
|
+
class:hover:bg-gray-200={hasNextPage}
|
|
61
|
+
class:rounded-md={hasNextPage}
|
|
62
|
+
class:text-gray-300={!hasNextPage}
|
|
63
|
+
>
|
|
64
|
+
{#if !hideLabel}
|
|
65
|
+
<span>NEXT</span>
|
|
66
|
+
{/if}
|
|
67
|
+
<iconify-icon icon="material-symbols:arrow-forward" style="font-size: 18px"></iconify-icon>
|
|
68
|
+
</button>
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
aria-label="arrows-clockwise"
|
|
72
|
+
class="rotate-2 font-bold hover:text-gray-600"
|
|
73
|
+
class:hidden={!refresh}
|
|
74
|
+
onclick={refresh}
|
|
75
|
+
>
|
|
76
|
+
<iconify-icon icon="ph:arrows-clockwise" class="hover:animate-spin hover:text-gray-400"
|
|
77
|
+
></iconify-icon>
|
|
78
|
+
</button>
|
|
79
|
+
<div class:hidden={!tableColumns.length} class:flex={tableColumns}>
|
|
80
|
+
<button onclick={() => (open = !open)}>
|
|
81
|
+
<iconify-icon icon="ph:columns" class="text-red-500 hover:text-red-800"></iconify-icon>
|
|
82
|
+
<!-- <Tooltip>Toggle Columns</Tooltip> -->
|
|
83
|
+
</button>
|
|
84
|
+
<Dropdown
|
|
85
|
+
bind:isOpen={open}
|
|
86
|
+
class="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch h-56 min-w-40 overflow-y-auto px-3 pb-3 text-sm"
|
|
87
|
+
>
|
|
88
|
+
{#each tableColumns as column}
|
|
89
|
+
<li class="flex w-full px-2 py-1.5 whitespace-nowrap">
|
|
90
|
+
<!-- <Toggle bind:checked={hideState[column.id]} class="cursor-pointer" /> -->
|
|
91
|
+
{column.header}
|
|
92
|
+
</li>
|
|
93
|
+
{/each}
|
|
94
|
+
</Dropdown>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Popper from '../../utils/Popper.svelte';
|
|
4
|
+
import { getSideAxis } from '@floating-ui/utils';
|
|
5
|
+
import { setContext, untrack } from 'svelte';
|
|
6
|
+
import { speedDial } from './theme.js';
|
|
7
|
+
import type { SpeedDialProps, SpeedCtxType } from '../../index.js';
|
|
8
|
+
import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
children,
|
|
12
|
+
popperClass,
|
|
13
|
+
placement = 'top',
|
|
14
|
+
pill = true,
|
|
15
|
+
tooltip = 'left',
|
|
16
|
+
trigger = 'hover',
|
|
17
|
+
textOutside = false,
|
|
18
|
+
class: className,
|
|
19
|
+
classes,
|
|
20
|
+
isOpen = $bindable(false),
|
|
21
|
+
...restProps
|
|
22
|
+
}: SpeedDialProps = $props();
|
|
23
|
+
|
|
24
|
+
warnThemeDeprecation(
|
|
25
|
+
'SpeedDial',
|
|
26
|
+
untrack(() => ({ popperClass })),
|
|
27
|
+
{ popperClass: 'popper' }
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const styling = $derived(
|
|
31
|
+
classes ?? {
|
|
32
|
+
popper: popperClass
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const theme = $derived(getTheme('speedDial'));
|
|
37
|
+
|
|
38
|
+
$effect(() => {
|
|
39
|
+
setContext<SpeedCtxType>('speed-dial', { pill, tooltip, textOutside });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
let vertical: boolean = $derived(getSideAxis(placement) === 'y');
|
|
43
|
+
|
|
44
|
+
let { base, popper } = $derived(speedDial({ vertical }));
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<Popper
|
|
48
|
+
{...restProps}
|
|
49
|
+
bind:isOpen
|
|
50
|
+
{trigger}
|
|
51
|
+
arrow={false}
|
|
52
|
+
{placement}
|
|
53
|
+
class={base({ class: clsx(theme?.base, className) })}
|
|
54
|
+
>
|
|
55
|
+
<div class={popper({ class: clsx(theme?.popper, styling.popper) })}>
|
|
56
|
+
{@render children()}
|
|
57
|
+
</div>
|
|
58
|
+
</Popper>
|
|
59
|
+
|
|
60
|
+
<!--
|
|
61
|
+
@component
|
|
62
|
+
[Go to docs](https://flowbite-svelte.com/)
|
|
63
|
+
## Type
|
|
64
|
+
[SpeedDialProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1598)
|
|
65
|
+
## Props
|
|
66
|
+
@prop children
|
|
67
|
+
@prop popperClass
|
|
68
|
+
@prop placement = "top"
|
|
69
|
+
@prop pill = true
|
|
70
|
+
@prop tooltip = "left"
|
|
71
|
+
@prop trigger = "hover"
|
|
72
|
+
@prop textOutside = false
|
|
73
|
+
@prop class: className
|
|
74
|
+
@prop classes
|
|
75
|
+
@prop isOpen = $bindable(false)
|
|
76
|
+
@prop ...restProps
|
|
77
|
+
-->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SpeedDialProps } from '../../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
|
+
* ## Type
|
|
5
|
+
* [SpeedDialProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1598)
|
|
6
|
+
* ## Props
|
|
7
|
+
* @prop children
|
|
8
|
+
* @prop popperClass
|
|
9
|
+
* @prop placement = "top"
|
|
10
|
+
* @prop pill = true
|
|
11
|
+
* @prop tooltip = "left"
|
|
12
|
+
* @prop trigger = "hover"
|
|
13
|
+
* @prop textOutside = false
|
|
14
|
+
* @prop class: className
|
|
15
|
+
* @prop classes
|
|
16
|
+
* @prop isOpen = $bindable(false)
|
|
17
|
+
* @prop ...restProps
|
|
18
|
+
*/
|
|
19
|
+
declare const SpeedDial: import("svelte").Component<SpeedDialProps, {}, "isOpen">;
|
|
20
|
+
type SpeedDial = ReturnType<typeof SpeedDial>;
|
|
21
|
+
export default SpeedDial;
|