@rkosafo/cai.components 0.0.78 → 0.0.80
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 -119
- package/dist/forms/button-toggle/CheckIcon.svelte +28 -28
- 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 -70
- 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/types/index.d.ts +2 -0
- 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/notificationList/NotificationList.svelte +123 -123
- package/dist/ui/pageLoader/PageLoader.svelte +14 -14
- package/dist/ui/pageLoader/PageLoader2.svelte +99 -0
- package/dist/ui/pageLoader/PageLoader2.svelte.d.ts +24 -0
- package/dist/ui/pageLoader/index.d.ts +2 -1
- package/dist/ui/pageLoader/index.js +2 -1
- package/dist/ui/paginate/Paginate.svelte +96 -96
- package/dist/ui/speedDial/SpeedDial.svelte +77 -77
- package/dist/ui/speedDial/SpeedDialButton.svelte +75 -75
- package/dist/ui/speedDial/SpeedDialTrigger.svelte +79 -79
- package/dist/ui/tab/Tab.svelte +93 -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/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 +2 -2
- package/dist/utils/index.js +3 -3
- package/dist/utils/singleSelection.svelte.js +48 -48
- package/dist/youtube/index.svelte +12 -12
- package/package.json +1 -1
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { checkbox } from './index.js';
|
|
5
|
-
import { Label, type CheckboxItem, type CheckboxProps } from '../../index.js';
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
children,
|
|
9
|
-
color = 'primary',
|
|
10
|
-
custom,
|
|
11
|
-
inline,
|
|
12
|
-
tinted,
|
|
13
|
-
rounded,
|
|
14
|
-
group = $bindable([]),
|
|
15
|
-
choices = [],
|
|
16
|
-
checked = $bindable(false),
|
|
17
|
-
indeterminate,
|
|
18
|
-
classes,
|
|
19
|
-
class: className,
|
|
20
|
-
divClass,
|
|
21
|
-
disabled = false,
|
|
22
|
-
value,
|
|
23
|
-
labelProps = {},
|
|
24
|
-
...restProps
|
|
25
|
-
}: CheckboxProps = $props();
|
|
26
|
-
|
|
27
|
-
warnThemeDeprecation('Checkbox', { divClass }, { divClass: 'div' });
|
|
28
|
-
const styling = $derived(classes ?? { div: divClass });
|
|
29
|
-
|
|
30
|
-
const theme = getTheme('checkbox');
|
|
31
|
-
|
|
32
|
-
const disabledValue = $derived(disabled === null ? undefined : disabled);
|
|
33
|
-
const { base, div: divStyle } = $derived(
|
|
34
|
-
checkbox({ color, tinted, custom, rounded, inline, disabled: disabledValue })
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
// Separate label rendering logic
|
|
38
|
-
function renderLabel(choice?: CheckboxItem) {
|
|
39
|
-
if (!choice) return '';
|
|
40
|
-
|
|
41
|
-
if (children) {
|
|
42
|
-
return children(choice);
|
|
43
|
-
}
|
|
44
|
-
return choice.label || '';
|
|
45
|
-
}
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
{#if choices.length > 0}
|
|
49
|
-
{#each choices as choice, i}
|
|
50
|
-
<div class={divStyle({ class: clsx(theme?.div, styling.div) })}>
|
|
51
|
-
<Label show={true} {...labelProps}>
|
|
52
|
-
<input
|
|
53
|
-
type="checkbox"
|
|
54
|
-
value={choice.value}
|
|
55
|
-
checked={choice.checked ?? false}
|
|
56
|
-
{disabled}
|
|
57
|
-
bind:group
|
|
58
|
-
{...restProps}
|
|
59
|
-
class={base({ class: clsx(theme?.base, className) })}
|
|
60
|
-
/>
|
|
61
|
-
{renderLabel(choice)}
|
|
62
|
-
</Label>
|
|
63
|
-
</div>
|
|
64
|
-
{/each}
|
|
65
|
-
{:else}
|
|
66
|
-
<div class={divStyle({ class: clsx(theme?.div, styling.div) })}>
|
|
67
|
-
<Label show={true} {...labelProps}>
|
|
68
|
-
<input
|
|
69
|
-
type="checkbox"
|
|
70
|
-
{value}
|
|
71
|
-
bind:checked
|
|
72
|
-
{indeterminate}
|
|
73
|
-
{disabled}
|
|
74
|
-
{...restProps}
|
|
75
|
-
class={base({ class: clsx(theme?.base, className) })}
|
|
76
|
-
/>
|
|
77
|
-
{#if children}
|
|
78
|
-
{@render children({ value, checked, disabled })}
|
|
79
|
-
{/if}
|
|
80
|
-
</Label>
|
|
81
|
-
</div>
|
|
82
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { checkbox } from './index.js';
|
|
5
|
+
import { Label, type CheckboxItem, type CheckboxProps } from '../../index.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
color = 'primary',
|
|
10
|
+
custom,
|
|
11
|
+
inline,
|
|
12
|
+
tinted,
|
|
13
|
+
rounded,
|
|
14
|
+
group = $bindable([]),
|
|
15
|
+
choices = [],
|
|
16
|
+
checked = $bindable(false),
|
|
17
|
+
indeterminate,
|
|
18
|
+
classes,
|
|
19
|
+
class: className,
|
|
20
|
+
divClass,
|
|
21
|
+
disabled = false,
|
|
22
|
+
value,
|
|
23
|
+
labelProps = {},
|
|
24
|
+
...restProps
|
|
25
|
+
}: CheckboxProps = $props();
|
|
26
|
+
|
|
27
|
+
warnThemeDeprecation('Checkbox', { divClass }, { divClass: 'div' });
|
|
28
|
+
const styling = $derived(classes ?? { div: divClass });
|
|
29
|
+
|
|
30
|
+
const theme = getTheme('checkbox');
|
|
31
|
+
|
|
32
|
+
const disabledValue = $derived(disabled === null ? undefined : disabled);
|
|
33
|
+
const { base, div: divStyle } = $derived(
|
|
34
|
+
checkbox({ color, tinted, custom, rounded, inline, disabled: disabledValue })
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// Separate label rendering logic
|
|
38
|
+
function renderLabel(choice?: CheckboxItem) {
|
|
39
|
+
if (!choice) return '';
|
|
40
|
+
|
|
41
|
+
if (children) {
|
|
42
|
+
return children(choice);
|
|
43
|
+
}
|
|
44
|
+
return choice.label || '';
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
{#if choices.length > 0}
|
|
49
|
+
{#each choices as choice, i}
|
|
50
|
+
<div class={divStyle({ class: clsx(theme?.div, styling.div) })}>
|
|
51
|
+
<Label show={true} {...labelProps}>
|
|
52
|
+
<input
|
|
53
|
+
type="checkbox"
|
|
54
|
+
value={choice.value}
|
|
55
|
+
checked={choice.checked ?? false}
|
|
56
|
+
{disabled}
|
|
57
|
+
bind:group
|
|
58
|
+
{...restProps}
|
|
59
|
+
class={base({ class: clsx(theme?.base, className) })}
|
|
60
|
+
/>
|
|
61
|
+
{renderLabel(choice)}
|
|
62
|
+
</Label>
|
|
63
|
+
</div>
|
|
64
|
+
{/each}
|
|
65
|
+
{:else}
|
|
66
|
+
<div class={divStyle({ class: clsx(theme?.div, styling.div) })}>
|
|
67
|
+
<Label show={true} {...labelProps}>
|
|
68
|
+
<input
|
|
69
|
+
type="checkbox"
|
|
70
|
+
{value}
|
|
71
|
+
bind:checked
|
|
72
|
+
{indeterminate}
|
|
73
|
+
{disabled}
|
|
74
|
+
{...restProps}
|
|
75
|
+
class={base({ class: clsx(theme?.base, className) })}
|
|
76
|
+
/>
|
|
77
|
+
{#if children}
|
|
78
|
+
{@render children({ value, checked, disabled })}
|
|
79
|
+
{/if}
|
|
80
|
+
</Label>
|
|
81
|
+
</div>
|
|
82
|
+
{/if}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Button, getTheme, type CheckboxButtonProps } from '../../index.js';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { checkboxButton } from './index.js';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children,
|
|
8
|
-
class: className,
|
|
9
|
-
group = $bindable([]),
|
|
10
|
-
value,
|
|
11
|
-
checked,
|
|
12
|
-
inline,
|
|
13
|
-
pill,
|
|
14
|
-
outline,
|
|
15
|
-
size,
|
|
16
|
-
color,
|
|
17
|
-
shadow,
|
|
18
|
-
...restProps
|
|
19
|
-
}: CheckboxButtonProps = $props();
|
|
20
|
-
|
|
21
|
-
const theme = getTheme('checkboxButton');
|
|
22
|
-
|
|
23
|
-
// react on external group changes
|
|
24
|
-
function init(_: HTMLElement, _group: (string | number)[]) {
|
|
25
|
-
group = _group ?? [];
|
|
26
|
-
|
|
27
|
-
if (checked === undefined && value !== undefined) checked = group.includes(value);
|
|
28
|
-
onChange();
|
|
29
|
-
|
|
30
|
-
$effect(() => {
|
|
31
|
-
if (value !== undefined) {
|
|
32
|
-
checked = group.includes(value);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function onChange() {
|
|
38
|
-
if (!value) return;
|
|
39
|
-
|
|
40
|
-
// There's a bug in Svelte and bind:group is not working with wrapped checkbox
|
|
41
|
-
// This workaround is taken from:
|
|
42
|
-
// https://svelte.dev/repl/de117399559f4e7e9e14e2fc9ab243cc?version=3.12.1
|
|
43
|
-
const index = group.indexOf(value);
|
|
44
|
-
|
|
45
|
-
if (checked === undefined) checked = index >= 0;
|
|
46
|
-
|
|
47
|
-
if (checked) {
|
|
48
|
-
if (index < 0) {
|
|
49
|
-
group.push(value);
|
|
50
|
-
group = group;
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
if (index >= 0) {
|
|
54
|
-
group.splice(index, 1);
|
|
55
|
-
group = group;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let buttonClass: string = $derived(
|
|
61
|
-
checkboxButton({ inline, checked, class: clsx(theme, className) })
|
|
62
|
-
);
|
|
63
|
-
</script>
|
|
64
|
-
|
|
65
|
-
<Button tag="label" {checked} {pill} {outline} {size} {color} {shadow} class={buttonClass}>
|
|
66
|
-
<input
|
|
67
|
-
use:init={group}
|
|
68
|
-
type="checkbox"
|
|
69
|
-
bind:checked
|
|
70
|
-
{value}
|
|
71
|
-
{...restProps}
|
|
72
|
-
class="sr-only"
|
|
73
|
-
onchange={onChange}
|
|
74
|
-
/>
|
|
75
|
-
{@render children?.()}
|
|
76
|
-
</Button>
|
|
77
|
-
|
|
78
|
-
<!--
|
|
79
|
-
@component
|
|
80
|
-
@prop children
|
|
81
|
-
@prop class: className
|
|
82
|
-
@prop group = $bindable([])
|
|
83
|
-
@prop value
|
|
84
|
-
@prop checked
|
|
85
|
-
@prop inline
|
|
86
|
-
@prop pill
|
|
87
|
-
@prop outline
|
|
88
|
-
@prop size
|
|
89
|
-
@prop color
|
|
90
|
-
@prop shadow
|
|
91
|
-
@prop ...restProps
|
|
92
|
-
-->
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Button, getTheme, type CheckboxButtonProps } from '../../index.js';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { checkboxButton } from './index.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
group = $bindable([]),
|
|
10
|
+
value,
|
|
11
|
+
checked,
|
|
12
|
+
inline,
|
|
13
|
+
pill,
|
|
14
|
+
outline,
|
|
15
|
+
size,
|
|
16
|
+
color,
|
|
17
|
+
shadow,
|
|
18
|
+
...restProps
|
|
19
|
+
}: CheckboxButtonProps = $props();
|
|
20
|
+
|
|
21
|
+
const theme = getTheme('checkboxButton');
|
|
22
|
+
|
|
23
|
+
// react on external group changes
|
|
24
|
+
function init(_: HTMLElement, _group: (string | number)[]) {
|
|
25
|
+
group = _group ?? [];
|
|
26
|
+
|
|
27
|
+
if (checked === undefined && value !== undefined) checked = group.includes(value);
|
|
28
|
+
onChange();
|
|
29
|
+
|
|
30
|
+
$effect(() => {
|
|
31
|
+
if (value !== undefined) {
|
|
32
|
+
checked = group.includes(value);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function onChange() {
|
|
38
|
+
if (!value) return;
|
|
39
|
+
|
|
40
|
+
// There's a bug in Svelte and bind:group is not working with wrapped checkbox
|
|
41
|
+
// This workaround is taken from:
|
|
42
|
+
// https://svelte.dev/repl/de117399559f4e7e9e14e2fc9ab243cc?version=3.12.1
|
|
43
|
+
const index = group.indexOf(value);
|
|
44
|
+
|
|
45
|
+
if (checked === undefined) checked = index >= 0;
|
|
46
|
+
|
|
47
|
+
if (checked) {
|
|
48
|
+
if (index < 0) {
|
|
49
|
+
group.push(value);
|
|
50
|
+
group = group;
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
if (index >= 0) {
|
|
54
|
+
group.splice(index, 1);
|
|
55
|
+
group = group;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let buttonClass: string = $derived(
|
|
61
|
+
checkboxButton({ inline, checked, class: clsx(theme, className) })
|
|
62
|
+
);
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<Button tag="label" {checked} {pill} {outline} {size} {color} {shadow} class={buttonClass}>
|
|
66
|
+
<input
|
|
67
|
+
use:init={group}
|
|
68
|
+
type="checkbox"
|
|
69
|
+
bind:checked
|
|
70
|
+
{value}
|
|
71
|
+
{...restProps}
|
|
72
|
+
class="sr-only"
|
|
73
|
+
onchange={onChange}
|
|
74
|
+
/>
|
|
75
|
+
{@render children?.()}
|
|
76
|
+
</Button>
|
|
77
|
+
|
|
78
|
+
<!--
|
|
79
|
+
@component
|
|
80
|
+
@prop children
|
|
81
|
+
@prop class: className
|
|
82
|
+
@prop group = $bindable([])
|
|
83
|
+
@prop value
|
|
84
|
+
@prop checked
|
|
85
|
+
@prop inline
|
|
86
|
+
@prop pill
|
|
87
|
+
@prop outline
|
|
88
|
+
@prop size
|
|
89
|
+
@prop color
|
|
90
|
+
@prop shadow
|
|
91
|
+
@prop ...restProps
|
|
92
|
+
-->
|