@cloudparker/moldex.js 0.0.64 → 0.0.66
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/services/dialog/dialog-service.d.ts +11 -11
- package/dist/services/dialog/dialog-service.js +0 -1
- package/dist/services/navigation/navigation-service.d.ts +17 -0
- package/dist/services/navigation/navigation-service.js +38 -0
- package/dist/services/utils/melody-service.d.ts +5 -0
- package/dist/services/utils/melody-service.js +41 -0
- package/dist/tailwind.css +1 -1
- package/dist/views/core/button/components/button/button.svelte +84 -133
- package/dist/views/core/button/components/button/button.svelte.d.ts +8 -7
- package/dist/views/core/button/components/button-back/button-back.svelte +16 -29
- package/dist/views/core/button/components/button-close/button-close.svelte +2 -4
- package/dist/views/core/button/components/button-close/button-close.svelte.d.ts +2 -2
- package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +16 -30
- package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte +80 -0
- package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte.d.ts +38 -0
- package/dist/views/core/button/components/button-list-item/button-list-item.svelte +65 -132
- package/dist/views/core/button/components/button-list-item/button-list-item.svelte.d.ts +22 -31
- package/dist/views/core/button/components/button-menu/button-menu.svelte +72 -235
- package/dist/views/core/button/components/button-menu/button-menu.svelte.d.ts +23 -43
- package/dist/views/core/button/components/button-ok/button-ok.svelte +2 -4
- package/dist/views/core/button/components/button-ok/button-ok.svelte.d.ts +2 -2
- package/dist/views/core/button/components/button-search/button-search.svelte +39 -0
- package/dist/views/core/button/components/button-search/button-search.svelte.d.ts +31 -0
- package/dist/views/core/button/index.d.ts +8 -5
- package/dist/views/core/button/index.js +4 -2
- package/dist/views/core/content-area/components/content-area.svelte +27 -40
- package/dist/views/core/dialog/components/cropper-dialog/cropper-dialog.svelte +33 -49
- package/dist/views/core/dialog/components/dialog/dialog.svelte +164 -263
- package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +12 -12
- package/dist/views/core/dialog/components/list-dialog/list-picker-dialog.svelte +112 -158
- package/dist/views/core/dialog/components/loading-dialog/loading-dialog.svelte +18 -30
- package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +13 -22
- package/dist/views/core/dialog/components/text-field-dialog/text-field-dialog.svelte +35 -41
- package/dist/views/core/dialog/components/text-field-dialog/text-field-dialog.svelte.d.ts +2 -2
- package/dist/views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte +25 -40
- package/dist/views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte.d.ts +2 -2
- package/dist/views/core/dialog/index.d.ts +2 -2
- package/dist/views/core/drawer/components/drawer/drawer.svelte +35 -57
- package/dist/views/core/icon/components/icon/icon.svelte +14 -26
- package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte +25 -44
- package/dist/views/core/input/components/color-field/color-field.svelte +69 -81
- package/dist/views/core/input/components/color-field/color-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/combobox-field/combobox-field.svelte +256 -331
- package/dist/views/core/input/components/combobox-field/combobox-field.svelte.d.ts +18 -17
- package/dist/views/core/input/components/date-field/date-field.svelte +30 -39
- package/dist/views/core/input/components/date-field/date-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/datetime-field/datetime-field.svelte +12 -18
- package/dist/views/core/input/components/datetime-field/datetime-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/email-field/email-field.svelte +12 -17
- package/dist/views/core/input/components/email-field/email-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/file-field/file-field.svelte +64 -78
- package/dist/views/core/input/components/file-field/file-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/input-field/input-field.svelte +159 -261
- package/dist/views/core/input/components/input-field/input-field.svelte.d.ts +8 -8
- package/dist/views/core/input/components/label/label.svelte +10 -24
- package/dist/views/core/input/components/number-field/number-field.svelte +12 -18
- package/dist/views/core/input/components/number-field/number-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/password-field/password-field.svelte +57 -70
- package/dist/views/core/input/components/password-field/password-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/phone-field/phone-field.svelte +118 -172
- package/dist/views/core/input/components/phone-field/phone-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/radio-field/radio-field.svelte +53 -84
- package/dist/views/core/input/components/radio-field/radio-field.svelte.d.ts +7 -7
- package/dist/views/core/input/components/range-field/range-field.svelte +42 -66
- package/dist/views/core/input/components/range-field/range-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/search-field/search-field.svelte +45 -62
- package/dist/views/core/input/components/search-field/search-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/text-field/text-field.svelte +16 -21
- package/dist/views/core/input/components/text-field/text-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/textarea-field/textarea-field.svelte +12 -17
- package/dist/views/core/input/components/textarea-field/textarea-field.svelte.d.ts +2 -2
- package/dist/views/core/input/components/time-field/time-field.svelte +12 -17
- package/dist/views/core/input/components/time-field/time-field.svelte.d.ts +2 -2
- package/dist/views/core/input/index.d.ts +4 -3
- package/dist/views/core/navbar/components/navbar/navbar.svelte +39 -77
- package/dist/views/core/no-data/components/no-data/no-data.svelte +20 -37
- package/dist/views/core/pagination/components/pagination/pagination.svelte +73 -102
- package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +23 -37
- package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +2 -6
- package/dist/views/core/screen-detector/components/screen-detector.svelte +9 -13
- package/dist/views/core/sidebar/components/sidebar.svelte +23 -36
- package/dist/views/core/spinner/components/spinner/spinner.svelte +2 -7
- package/dist/views/core/text/components/text-await/text-await.svelte +2 -8
- package/dist/views/core/text/components/text-copy/text-copy.svelte +17 -28
- package/dist/views/core/text/components/text-country/text-country.svelte +29 -41
- package/dist/views/core/text/components/text-country-state/text-country-state.svelte +29 -37
- package/dist/views/core/text/components/text-currency/text-currency.svelte +10 -21
- package/dist/views/core/text/components/text-date/text-date.svelte +21 -33
- package/dist/views/core/text/components/text-email/text-email.svelte +4 -13
- package/dist/views/core/text/components/text-html/text-html.svelte +2 -3
- package/dist/views/core/text/components/text-phone/text-phone.svelte +4 -13
- package/dist/views/core/toast/components/toast/toast.svelte +21 -44
- package/package.json +1 -1
|
@@ -1,31 +1,18 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
id,
|
|
17
|
-
iconPath = mdiArrowLeft,
|
|
18
|
-
iconClassName = '',
|
|
19
|
-
className = '',
|
|
20
|
-
onlyMobile,
|
|
21
|
-
onClick
|
|
22
|
-
}: PropsType = $props();
|
|
23
|
-
|
|
24
|
-
let isMobileScreen = $state(false);
|
|
25
|
-
|
|
26
|
-
$effect(() => {
|
|
27
|
-
isMobileScreen = isSmallScreen();
|
|
28
|
-
});
|
|
1
|
+
<script lang="ts">import { isSmallScreen } from "../../../../../services";
|
|
2
|
+
import { mdiArrowLeft } from "../../../icon";
|
|
3
|
+
import Button from "../button/button.svelte";
|
|
4
|
+
let {
|
|
5
|
+
id,
|
|
6
|
+
iconPath = mdiArrowLeft,
|
|
7
|
+
iconClassName = "",
|
|
8
|
+
className = "",
|
|
9
|
+
onlyMobile,
|
|
10
|
+
onClick
|
|
11
|
+
} = $props();
|
|
12
|
+
let isMobileScreen = $state(false);
|
|
13
|
+
$effect(() => {
|
|
14
|
+
isMobileScreen = isSmallScreen();
|
|
15
|
+
});
|
|
29
16
|
</script>
|
|
30
17
|
|
|
31
18
|
{#snippet button()}
|
|
@@ -34,7 +21,7 @@
|
|
|
34
21
|
appearance="none"
|
|
35
22
|
size="none"
|
|
36
23
|
{iconPath}
|
|
37
|
-
className="w-12 h-12 rounded-full hover:bg-
|
|
24
|
+
className="w-12 h-12 rounded-full hover:bg-base-50 dark:hover:bg-base-900 {className}"
|
|
38
25
|
{iconClassName}
|
|
39
26
|
{onClick}
|
|
40
27
|
/>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let { className, ...props }: ButtonPropsType = $props();
|
|
1
|
+
<script lang="ts">import Button, {} from "../button/button.svelte";
|
|
2
|
+
let { className, ...props } = $props();
|
|
5
3
|
</script>
|
|
6
4
|
|
|
7
5
|
<Button {...props} size="none" className="bg-gray-100 focus:bg-gray-200 p-2 px-4 {className}" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ButtonProps } from '../button/button.svelte';
|
|
2
2
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
4
|
$$bindings?: Bindings;
|
|
@@ -12,7 +12,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
12
12
|
};
|
|
13
13
|
z_$$bindings?: Bindings;
|
|
14
14
|
}
|
|
15
|
-
declare const ButtonClose: $$__sveltets_2_IsomorphicComponent<
|
|
15
|
+
declare const ButtonClose: $$__sveltets_2_IsomorphicComponent<ButtonProps, {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
}, {}, {}, "">;
|
|
18
18
|
type ButtonClose = InstanceType<typeof ButtonClose>;
|
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let {
|
|
17
|
-
id,
|
|
18
|
-
iconPath = mdiClose,
|
|
19
|
-
iconClassName = '',
|
|
20
|
-
className = '',
|
|
21
|
-
onlyWeb,
|
|
22
|
-
onClick
|
|
23
|
-
}: PropsType = $props();
|
|
24
|
-
|
|
25
|
-
let isMobileScreen = $state(false);
|
|
26
|
-
|
|
27
|
-
$effect(() => {
|
|
28
|
-
isMobileScreen = isSmallScreen();
|
|
29
|
-
});
|
|
1
|
+
<script lang="ts">import { isSmallScreen } from "../../../../../services";
|
|
2
|
+
import { mdiArrowLeft, mdiChevronRight, mdiClose } from "../../../icon";
|
|
3
|
+
import Button from "../button/button.svelte";
|
|
4
|
+
let {
|
|
5
|
+
id,
|
|
6
|
+
iconPath = mdiClose,
|
|
7
|
+
iconClassName = "",
|
|
8
|
+
className = "",
|
|
9
|
+
onlyWeb,
|
|
10
|
+
onClick
|
|
11
|
+
} = $props();
|
|
12
|
+
let isMobileScreen = $state(false);
|
|
13
|
+
$effect(() => {
|
|
14
|
+
isMobileScreen = isSmallScreen();
|
|
15
|
+
});
|
|
30
16
|
</script>
|
|
31
17
|
|
|
32
18
|
{#snippet button()}
|
|
33
19
|
<Button
|
|
34
20
|
{id}
|
|
35
21
|
{iconPath}
|
|
36
|
-
className="w-12 h-12 rounded-full text-
|
|
22
|
+
className="w-12 h-12 rounded-full text-base-500 hover:text-base-600 hover:bg-base-50 dark:hover:bg-base-900 transition-all {className}"
|
|
37
23
|
{iconClassName}
|
|
38
24
|
{onClick}
|
|
39
25
|
/>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script lang="ts" module></script>
|
|
2
|
+
|
|
3
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
4
|
+
import Button, {
|
|
5
|
+
} from "../button/button.svelte";
|
|
6
|
+
var DropdownStateEnum = /* @__PURE__ */ ((DropdownStateEnum2) => {
|
|
7
|
+
DropdownStateEnum2[DropdownStateEnum2["OPEN"] = 0] = "OPEN";
|
|
8
|
+
DropdownStateEnum2[DropdownStateEnum2["OPENED"] = 1] = "OPENED";
|
|
9
|
+
DropdownStateEnum2[DropdownStateEnum2["CLOSE"] = 2] = "CLOSE";
|
|
10
|
+
DropdownStateEnum2[DropdownStateEnum2["CLOSED"] = 3] = "CLOSED";
|
|
11
|
+
return DropdownStateEnum2;
|
|
12
|
+
})(DropdownStateEnum || {});
|
|
13
|
+
let {
|
|
14
|
+
id,
|
|
15
|
+
appearance,
|
|
16
|
+
size,
|
|
17
|
+
label = "MY btn",
|
|
18
|
+
type,
|
|
19
|
+
children,
|
|
20
|
+
dropdownSnippet,
|
|
21
|
+
backgropClassName = "",
|
|
22
|
+
className = "",
|
|
23
|
+
containerClassName = "",
|
|
24
|
+
dropdownClassName = "",
|
|
25
|
+
dropdownCloseClassName = "",
|
|
26
|
+
dropdownOpenClassName = ""
|
|
27
|
+
} = $props();
|
|
28
|
+
let placement = $state(false);
|
|
29
|
+
let dropdownState = $state(3 /* CLOSED */);
|
|
30
|
+
export function toggleDropdown(ev) {
|
|
31
|
+
ev && ev.stopPropagation();
|
|
32
|
+
if (placement) {
|
|
33
|
+
dropdownState = 3 /* CLOSED */;
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
placement = false;
|
|
36
|
+
}, 100);
|
|
37
|
+
} else {
|
|
38
|
+
placement = true;
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
dropdownState = 1 /* OPENED */;
|
|
41
|
+
}, 1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function handleToggleDropdown(ev) {
|
|
45
|
+
toggleDropdown(ev);
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<div class="relative max-w-min {containerClassName}">
|
|
50
|
+
<Button
|
|
51
|
+
{id}
|
|
52
|
+
{type}
|
|
53
|
+
{appearance}
|
|
54
|
+
{size}
|
|
55
|
+
className="flex items-center justify-center flex-nowrap text-start {className}"
|
|
56
|
+
onClick={handleToggleDropdown}
|
|
57
|
+
{label}
|
|
58
|
+
{children}
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
{#if placement}
|
|
62
|
+
<button
|
|
63
|
+
aria-label="backdrop"
|
|
64
|
+
type="button"
|
|
65
|
+
id="{id}-dropdown-backdrop"
|
|
66
|
+
class="cursor-auto fixed inset-0 z-10 {backgropClassName}"
|
|
67
|
+
onclick={handleToggleDropdown}
|
|
68
|
+
tabindex="-1"
|
|
69
|
+
></button>
|
|
70
|
+
<div
|
|
71
|
+
class="absolute z-10 min-w-40 max-h-1/2vh overflow-y-auto origin-top right-0 rounded-md bg-white dark:bg-base-800 shadow-lg focus:outline-none transition ease-out duration-100 {dropdownClassName} {dropdownState ==
|
|
72
|
+
DropdownStateEnum.OPENED
|
|
73
|
+
? `transform opacity-100 scale-100 ${dropdownOpenClassName}`
|
|
74
|
+
: `transform opacity-0 scale-60 } ${dropdownCloseClassName}`}"
|
|
75
|
+
tabindex="-1"
|
|
76
|
+
>
|
|
77
|
+
{@render dropdownSnippet?.()}
|
|
78
|
+
</div>
|
|
79
|
+
{/if}
|
|
80
|
+
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type ButtonDropdownProps = {
|
|
2
|
+
appearance?: ButtonAppearance;
|
|
3
|
+
size?: ButtonSize;
|
|
4
|
+
label?: string;
|
|
5
|
+
type?: ButtonType;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
dropdownSnippet?: Snippet;
|
|
8
|
+
id?: string;
|
|
9
|
+
backgropClassName?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
containerClassName?: string;
|
|
12
|
+
dropdownClassName?: string;
|
|
13
|
+
dropdownCloseClassName?: string;
|
|
14
|
+
dropdownOpenClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
import '../../../../../tailwind.css';
|
|
17
|
+
import type { Snippet } from 'svelte';
|
|
18
|
+
import { type ButtonAppearance, type ButtonSize, type ButtonType } from '../button/button.svelte';
|
|
19
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
20
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
21
|
+
$$bindings?: Bindings;
|
|
22
|
+
} & Exports;
|
|
23
|
+
(internal: unknown, props: Props & {
|
|
24
|
+
$$events?: Events;
|
|
25
|
+
$$slots?: Slots;
|
|
26
|
+
}): Exports & {
|
|
27
|
+
$set?: any;
|
|
28
|
+
$on?: any;
|
|
29
|
+
};
|
|
30
|
+
z_$$bindings?: Bindings;
|
|
31
|
+
}
|
|
32
|
+
declare const ButtonDropdown: $$__sveltets_2_IsomorphicComponent<ButtonDropdownProps, {
|
|
33
|
+
[evt: string]: CustomEvent<any>;
|
|
34
|
+
}, {}, {
|
|
35
|
+
toggleDropdown: (ev: MouseEvent) => void;
|
|
36
|
+
}, "">;
|
|
37
|
+
type ButtonDropdown = InstanceType<typeof ButtonDropdown>;
|
|
38
|
+
export default ButtonDropdown;
|
|
@@ -1,123 +1,80 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
export type ListItemType = {
|
|
3
|
-
id?: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
subtitle?: string;
|
|
6
|
-
titleClassName?: string;
|
|
7
|
-
subtitleClassName?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
iconPath?: string;
|
|
11
|
-
iconClassName?: string;
|
|
12
|
-
imgSrc?: string;
|
|
13
|
-
imgClassName?: string;
|
|
14
|
-
className?: string;
|
|
15
|
-
openInNewWindow?: boolean;
|
|
16
|
-
divider?: boolean;
|
|
17
|
-
hasArrow?: boolean;
|
|
18
|
-
arrowIconPath?: string;
|
|
19
|
-
arrowClassName?: string;
|
|
20
|
-
isChecked?: boolean;
|
|
21
|
-
onclick?: (ev: MouseEvent, item: ListItemType) => void;
|
|
22
|
-
};
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<script lang="ts">
|
|
26
|
-
import '../../../../../tailwind.css';
|
|
27
|
-
import { ripple } from '../../../../../actions/ripple.js';
|
|
28
|
-
|
|
29
|
-
import type { Snippet } from 'svelte';
|
|
30
|
-
import {
|
|
31
|
-
Icon,
|
|
32
|
-
mdiCheckCircle,
|
|
33
|
-
mdiCheckCircleOutline,
|
|
34
|
-
mdiChevronRight
|
|
35
|
-
} from '../../../icon';
|
|
1
|
+
<script module lang="ts"></script>
|
|
36
2
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
arrowIconPath = mdiChevronRight,
|
|
76
|
-
arrowClassName = '',
|
|
77
|
-
onClick,
|
|
78
|
-
children
|
|
79
|
-
}: PropsType = $props();
|
|
3
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
4
|
+
import {
|
|
5
|
+
Icon,
|
|
6
|
+
mdiCheckCircle,
|
|
7
|
+
mdiCheckCircleOutline,
|
|
8
|
+
mdiChevronRight
|
|
9
|
+
} from "../../../icon";
|
|
10
|
+
import Button, {} from "../button/button.svelte";
|
|
11
|
+
let {
|
|
12
|
+
appearance,
|
|
13
|
+
size,
|
|
14
|
+
index,
|
|
15
|
+
id = "",
|
|
16
|
+
className = "",
|
|
17
|
+
checkboxIconPath = mdiCheckCircle,
|
|
18
|
+
uncheckboxIconPath = mdiCheckCircleOutline,
|
|
19
|
+
checkboxIconClassName = "",
|
|
20
|
+
uncheckboxIconClassName = "",
|
|
21
|
+
hasIcon = false,
|
|
22
|
+
iconClassName = "",
|
|
23
|
+
hasImg = false,
|
|
24
|
+
imgClassName = "",
|
|
25
|
+
iconPath,
|
|
26
|
+
imgSrc,
|
|
27
|
+
hasArrow = false,
|
|
28
|
+
arrowIconPath = mdiChevronRight,
|
|
29
|
+
arrowClassName = "",
|
|
30
|
+
title = "",
|
|
31
|
+
subtitle = "",
|
|
32
|
+
titleClassName = "",
|
|
33
|
+
subtitleClassName = "",
|
|
34
|
+
disabled = false,
|
|
35
|
+
hasCheckbox,
|
|
36
|
+
checkboxClassName = "",
|
|
37
|
+
isChecked = false,
|
|
38
|
+
onClick = (ev) => {
|
|
39
|
+
}
|
|
40
|
+
} = $props();
|
|
80
41
|
</script>
|
|
81
42
|
|
|
82
43
|
{#snippet itemInternal()}
|
|
83
44
|
<div class="flex w-full items-center gap-4">
|
|
84
|
-
{#if
|
|
45
|
+
{#if hasIcon && iconPath}
|
|
85
46
|
<div>
|
|
86
|
-
<Icon path={
|
|
47
|
+
<Icon path={iconPath} className="{iconClassName} {iconClassName}" />
|
|
87
48
|
</div>
|
|
88
49
|
{/if}
|
|
89
|
-
|
|
50
|
+
|
|
51
|
+
{#if hasImg && imgSrc}
|
|
90
52
|
<div>
|
|
91
|
-
<img
|
|
92
|
-
src={item?.imgSrc}
|
|
93
|
-
class="w-6 h-6 {imgClassName} {item?.imgClassName}"
|
|
94
|
-
alt="item-img-{index}"
|
|
95
|
-
/>
|
|
53
|
+
<img src={imgSrc} class="w-6 h-6 {imgClassName} {imgClassName}" alt="item-img-{index}" />
|
|
96
54
|
</div>
|
|
97
55
|
{/if}
|
|
98
56
|
|
|
99
57
|
<div class="flex-grow">
|
|
100
|
-
{#if
|
|
101
|
-
<div class="text-ellipsis overflow-hidden {titleClassName}
|
|
102
|
-
{
|
|
58
|
+
{#if title}
|
|
59
|
+
<div class="text-ellipsis overflow-hidden {titleClassName} }">
|
|
60
|
+
{title || ''}
|
|
103
61
|
</div>
|
|
104
62
|
{/if}
|
|
105
|
-
{#if
|
|
63
|
+
{#if subtitle}
|
|
106
64
|
<div
|
|
107
|
-
class="text-ellipsis overflow-hidden text-base-400 dark:text-base-300 text-sm font-light {subtitleClassName}
|
|
108
|
-
''}"
|
|
65
|
+
class="text-ellipsis overflow-hidden text-base-400 dark:text-base-300 text-sm font-light {subtitleClassName} }"
|
|
109
66
|
>
|
|
110
|
-
{
|
|
67
|
+
{subtitle || ''}
|
|
111
68
|
</div>
|
|
112
69
|
{/if}
|
|
113
70
|
</div>
|
|
114
71
|
{#if hasCheckbox}
|
|
115
72
|
<div>
|
|
116
73
|
<Icon
|
|
117
|
-
path={
|
|
118
|
-
className="w-5 h-5 {
|
|
119
|
-
? `text-primary ${
|
|
120
|
-
: `text-base-400 ${
|
|
74
|
+
path={isChecked ? checkboxIconPath : uncheckboxIconPath}
|
|
75
|
+
className="w-5 h-5 {checkboxClassName} {isChecked
|
|
76
|
+
? `text-primary ${checkboxIconClassName}`
|
|
77
|
+
: `text-base-400 ${uncheckboxIconClassName}`}"
|
|
121
78
|
/>
|
|
122
79
|
</div>
|
|
123
80
|
{/if}
|
|
@@ -130,38 +87,14 @@
|
|
|
130
87
|
</div>
|
|
131
88
|
{/snippet}
|
|
132
89
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</button>
|
|
145
|
-
{/snippet}
|
|
146
|
-
|
|
147
|
-
{#snippet linkSnippet()}
|
|
148
|
-
<a
|
|
149
|
-
id="{id}-item-item-{index}"
|
|
150
|
-
href={item?.url}
|
|
151
|
-
class="block select-none px-3 py-1 w-full text-start leading-normal text-base-900 dark:text-base-200 hover:bg-base-100 dark:hover:bg-base-700 focus:bg-base-50 dark:focus:bg-base-700 focus:outline-none {className} {item.className}"
|
|
152
|
-
role="menuitem"
|
|
153
|
-
target={item?.openInNewWindow ? '_blank' : ''}
|
|
154
|
-
onclick={(ev) => onClick && onClick(ev, item, index)}
|
|
155
|
-
use:ripple
|
|
156
|
-
>
|
|
157
|
-
{@render itemInternal()}
|
|
158
|
-
</a>
|
|
159
|
-
{/snippet}
|
|
160
|
-
|
|
161
|
-
{#if children}
|
|
162
|
-
{@render children(item, index)}
|
|
163
|
-
{:else if item?.url && !item?.disabled}
|
|
164
|
-
{@render linkSnippet()}
|
|
165
|
-
{:else}
|
|
166
|
-
{@render buttonSnippet()}
|
|
167
|
-
{/if}
|
|
90
|
+
<Button
|
|
91
|
+
id="{id}-list-item-{index}"
|
|
92
|
+
type="button"
|
|
93
|
+
className=" w-full text-start justify-start rounded-none {className}"
|
|
94
|
+
{onClick}
|
|
95
|
+
{disabled}
|
|
96
|
+
{appearance}
|
|
97
|
+
{size}
|
|
98
|
+
>
|
|
99
|
+
{@render itemInternal()}
|
|
100
|
+
</Button>
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type ButtonListItemProps = {
|
|
2
|
+
appearance?: ButtonAppearance;
|
|
3
|
+
size?: ButtonSize;
|
|
4
|
+
index?: number;
|
|
2
5
|
id?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
checkboxIconPath?: string;
|
|
8
|
+
uncheckboxIconPath?: string;
|
|
9
|
+
checkboxIconClassName?: string;
|
|
10
|
+
uncheckboxIconClassName?: string;
|
|
11
|
+
hasIcon?: boolean;
|
|
12
|
+
iconClassName?: string;
|
|
13
|
+
hasImg?: boolean;
|
|
14
|
+
imgClassName?: string;
|
|
15
|
+
hasArrow?: boolean;
|
|
16
|
+
arrowIconPath?: string;
|
|
17
|
+
arrowClassName?: string;
|
|
3
18
|
title?: string;
|
|
4
19
|
subtitle?: string;
|
|
5
20
|
titleClassName?: string;
|
|
@@ -7,20 +22,16 @@ export type ListItemType = {
|
|
|
7
22
|
url?: string;
|
|
8
23
|
disabled?: boolean;
|
|
9
24
|
iconPath?: string;
|
|
10
|
-
iconClassName?: string;
|
|
11
25
|
imgSrc?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
openInNewWindow?: boolean;
|
|
15
|
-
divider?: boolean;
|
|
16
|
-
hasArrow?: boolean;
|
|
17
|
-
arrowIconPath?: string;
|
|
18
|
-
arrowClassName?: string;
|
|
26
|
+
hasCheckbox?: boolean;
|
|
27
|
+
checkboxClassName?: string;
|
|
19
28
|
isChecked?: boolean;
|
|
20
|
-
|
|
29
|
+
onClick?: (ev: MouseEvent) => void;
|
|
30
|
+
children?: Snippet<[any, number]>;
|
|
21
31
|
};
|
|
22
32
|
import '../../../../../tailwind.css';
|
|
23
33
|
import type { Snippet } from 'svelte';
|
|
34
|
+
import { type ButtonAppearance, type ButtonSize } from '../button/button.svelte';
|
|
24
35
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
25
36
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
26
37
|
$$bindings?: Bindings;
|
|
@@ -34,27 +45,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
34
45
|
};
|
|
35
46
|
z_$$bindings?: Bindings;
|
|
36
47
|
}
|
|
37
|
-
declare const ButtonListItem: $$__sveltets_2_IsomorphicComponent<{
|
|
38
|
-
item: ListItemType;
|
|
39
|
-
index: number;
|
|
40
|
-
id?: string;
|
|
41
|
-
className?: string;
|
|
42
|
-
hasCheckbox?: boolean;
|
|
43
|
-
checkIconPath?: string;
|
|
44
|
-
uncheckIconPath?: string;
|
|
45
|
-
checkIconClassName?: string;
|
|
46
|
-
uncheckIconClassName?: string;
|
|
47
|
-
checkClassName?: string;
|
|
48
|
-
iconClassName?: string;
|
|
49
|
-
imgClassName?: string;
|
|
50
|
-
titleClassName?: string;
|
|
51
|
-
subtitleClassName?: string;
|
|
52
|
-
hasArrow?: boolean;
|
|
53
|
-
arrowIconPath?: string;
|
|
54
|
-
arrowClassName?: string;
|
|
55
|
-
onClick?: (ev: MouseEvent, item: ListItemType, index: number) => void;
|
|
56
|
-
children?: Snippet<[ListItemType, number]>;
|
|
57
|
-
}, {
|
|
48
|
+
declare const ButtonListItem: $$__sveltets_2_IsomorphicComponent<ButtonListItemProps, {
|
|
58
49
|
[evt: string]: CustomEvent<any>;
|
|
59
50
|
}, {}, {}, "">;
|
|
60
51
|
type ButtonListItem = InstanceType<typeof ButtonListItem>;
|