@cloudparker/moldex.js 0.0.29 → 0.0.30
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/views/core/button/components/button/button.svelte +54 -33
- package/dist/views/core/button/components/button-back/button-back.svelte +26 -14
- package/dist/views/core/button/components/button-close/button-close.svelte +4 -2
- package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +29 -15
- package/dist/views/core/button/components/button-list-item/button-list-item.svelte +78 -30
- package/dist/views/core/button/components/button-menu/button-menu.svelte +143 -90
- package/dist/views/core/button/components/button-ok/button-ok.svelte +4 -2
- package/dist/views/core/dialog/components/dialog/dialog.svelte +245 -158
- package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +2 -7
- package/dist/views/core/dialog/components/list-dialog/list-picker-dialog.svelte +152 -108
- package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +22 -13
- package/dist/views/core/dialog/index.d.ts +4 -2
- package/dist/views/core/dialog/index.js +2 -2
- package/dist/views/core/drawer/components/drawer/drawer.svelte +52 -34
- package/dist/views/core/icon/components/icon/icon.svelte +24 -13
- package/dist/views/core/input/components/color-field/color-field.svelte +71 -61
- package/dist/views/core/input/components/combobox-field/combobox-field.svelte +330 -248
- package/dist/views/core/input/components/date-field/date-field.svelte +10 -6
- package/dist/views/core/input/components/datetime-field/datetime-field.svelte +10 -6
- package/dist/views/core/input/components/email-field/email-field.svelte +9 -6
- package/dist/views/core/input/components/file-field/file-field.svelte +69 -57
- package/dist/views/core/input/components/input-field/input-field.svelte +251 -151
- package/dist/views/core/input/components/label/label.svelte +24 -10
- package/dist/views/core/input/components/number-field/number-field.svelte +10 -6
- package/dist/views/core/input/components/password-field/password-field.svelte +59 -48
- package/dist/views/core/input/components/phone-field/phone-field.svelte +62 -48
- package/dist/views/core/input/components/range-field/range-field.svelte +51 -32
- package/dist/views/core/input/components/search-field/search-field.svelte +52 -38
- package/dist/views/core/input/components/text-field/text-field.svelte +9 -6
- package/dist/views/core/input/components/textarea-field/textarea-field.svelte +9 -6
- package/dist/views/core/input/components/time-field/time-field.svelte +9 -6
- package/dist/views/core/navbar/components/navbar/navbar.svelte +63 -31
- package/dist/views/core/no-data/components/no-data/no-data.svelte +37 -20
- package/dist/views/core/pagination/components/pagination/pagination.svelte +100 -71
- package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +37 -23
- package/dist/views/core/referrer/components/referrer.svelte +15 -13
- package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +6 -2
- package/dist/views/core/screen-detector/components/screen-detector.svelte +13 -9
- package/dist/views/core/spinner/components/spinner/spinner.svelte +7 -2
- package/dist/views/core/text/components/text-await/text-await.svelte +8 -2
- package/dist/views/core/text/components/text-copy/text-copy.svelte +28 -17
- package/dist/views/core/text/components/text-country/text-country.svelte +41 -29
- package/dist/views/core/text/components/text-country-state/text-country-state.svelte +37 -29
- package/dist/views/core/text/components/text-currency/text-currency.svelte +21 -10
- package/dist/views/core/text/components/text-date/text-date.svelte +33 -21
- package/dist/views/core/text/components/text-email/text-email.svelte +13 -4
- package/dist/views/core/text/components/text-html/text-html.svelte +3 -2
- package/dist/views/core/text/components/text-phone/text-phone.svelte +13 -4
- package/dist/views/core/toast/components/toast/toast.svelte +44 -21
- package/package.json +1 -1
|
@@ -1,111 +1,155 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
let
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ButtonListItem } from '../../..';
|
|
3
|
+
import ButtonBack from '../../../button/components/button-back/button-back.svelte';
|
|
4
|
+
import ButtonCloseIcon from '../../../button/components/button-close-icon/button-close-icon.svelte';
|
|
5
|
+
import ButtonClose from '../../../button/components/button-close/button-close.svelte';
|
|
6
|
+
import type { ListItemType } from '../../../button/components/button-list-item/button-list-item.svelte';
|
|
7
|
+
import ButtonOk from '../../../button/components/button-ok/button-ok.svelte';
|
|
8
|
+
import SearchField from '../../../input/components/search-field/search-field.svelte';
|
|
9
|
+
import type { Snippet } from 'svelte';
|
|
10
|
+
import type { DialogExportsType } from '../dialog/dialog.svelte';
|
|
11
|
+
|
|
12
|
+
type PropsType = {
|
|
13
|
+
value?: any | any[];
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
items?: any[];
|
|
16
|
+
itemSnippet?: Snippet<[any, number]>;
|
|
17
|
+
itemTitle?: string;
|
|
18
|
+
itemSubtitle?: string;
|
|
19
|
+
search?: string;
|
|
20
|
+
identity?: string;
|
|
21
|
+
iconPath?: string;
|
|
22
|
+
hasCheckbox?: boolean;
|
|
23
|
+
hasArrow?: boolean;
|
|
24
|
+
itemTitleClassName?: string;
|
|
25
|
+
itemSubtitleClassName?: string;
|
|
26
|
+
okButtonLable?: string;
|
|
27
|
+
okButtonClassName?: string;
|
|
28
|
+
closeButtonLabel?: string;
|
|
29
|
+
closeButtonClassName?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
value,
|
|
34
|
+
multiple = false,
|
|
35
|
+
items,
|
|
36
|
+
itemTitle,
|
|
37
|
+
itemSubtitle,
|
|
38
|
+
hasCheckbox,
|
|
39
|
+
hasArrow,
|
|
40
|
+
search,
|
|
41
|
+
identity,
|
|
42
|
+
itemTitleClassName,
|
|
43
|
+
itemSubtitleClassName,
|
|
44
|
+
okButtonLable = 'Select',
|
|
45
|
+
okButtonClassName = '',
|
|
46
|
+
closeButtonLabel = 'Close',
|
|
47
|
+
closeButtonClassName = '',
|
|
48
|
+
itemSnippet,
|
|
49
|
+
closeDialog,
|
|
50
|
+
setResult
|
|
51
|
+
}: PropsType &
|
|
52
|
+
DialogExportsType & {
|
|
53
|
+
items?: any[];
|
|
54
|
+
itemSnippet?: Snippet<[any, number]>;
|
|
55
|
+
} = $props();
|
|
56
|
+
|
|
57
|
+
let searchText: string = $state('');
|
|
58
|
+
|
|
59
|
+
let idField = Symbol('_id');
|
|
60
|
+
let searchField = Symbol('_search');
|
|
61
|
+
|
|
62
|
+
type CustomListItemType = ListItemType & { [key: symbol]: string };
|
|
63
|
+
|
|
64
|
+
let selectedItemsSet: Set<any> = $derived.by(() => {
|
|
65
|
+
let set = new Set<any>();
|
|
66
|
+
if (value != null) {
|
|
67
|
+
if (Array.isArray(value)) {
|
|
68
|
+
value.forEach((v) => set.add(v));
|
|
69
|
+
} else {
|
|
70
|
+
set.add(value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return set;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
let preparedItems: any[] = $derived.by(() => {
|
|
77
|
+
return (items || []).map((item: any, index) => {
|
|
78
|
+
let res: CustomListItemType = {
|
|
79
|
+
[idField]: identity && item.hasOwnProperty(identity) ? item[identity] : index
|
|
80
|
+
};
|
|
81
|
+
if (itemTitle) {
|
|
82
|
+
res.title = item.hasOwnProperty(itemTitle) ? item[itemTitle] : itemTitle;
|
|
83
|
+
}
|
|
84
|
+
if (itemSubtitle) {
|
|
85
|
+
res.subtitle = item.hasOwnProperty(itemSubtitle) ? item[itemSubtitle] : itemSubtitle;
|
|
86
|
+
}
|
|
87
|
+
if (search) {
|
|
88
|
+
res[searchField] = (item[search] || '').trim().toLowerCase();
|
|
89
|
+
} else {
|
|
90
|
+
res[searchField] = `${res.title || ''} ${res.subtitle || ''}`.trim().toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
if (selectedItemsSet.has(res[idField])) {
|
|
93
|
+
res.isChecked = true;
|
|
94
|
+
} else {
|
|
95
|
+
res.isChecked = false;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return res;
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
let filteredItems: any[] = $derived.by(() => {
|
|
103
|
+
if (searchText) {
|
|
104
|
+
return preparedItems.filter((item: any) => {
|
|
105
|
+
return item[searchField].indexOf(searchText) >= 0;
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
return [...preparedItems];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
function handleSearch(text: string) {
|
|
113
|
+
searchText = text;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function handleItemSelected(ev: MouseEvent, item: CustomListItemType, index: number) {
|
|
117
|
+
let id = item[idField];
|
|
118
|
+
if (multiple) {
|
|
119
|
+
if (selectedItemsSet.has(id)) {
|
|
120
|
+
selectedItemsSet.delete(id);
|
|
121
|
+
} else {
|
|
122
|
+
selectedItemsSet.add(id);
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
selectedItemsSet.clear();
|
|
126
|
+
selectedItemsSet.add(id);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
items = [...(items || [])];
|
|
130
|
+
|
|
131
|
+
if (!multiple) {
|
|
132
|
+
if (selectedItemsSet.size) {
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
setResult(Array.from(selectedItemsSet)[0]);
|
|
135
|
+
closeDialog();
|
|
136
|
+
}, 300);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function handleClose() {
|
|
142
|
+
closeDialog();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function handleOk() {
|
|
146
|
+
setResult(Array.from(selectedItemsSet));
|
|
147
|
+
closeDialog();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
$effect(() => {
|
|
151
|
+
setResult(null);
|
|
152
|
+
});
|
|
109
153
|
</script>
|
|
110
154
|
|
|
111
155
|
<div class="flex gap-3 p-3">
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { DialogExportsType } from '../dialog/dialog.svelte';
|
|
3
|
+
|
|
4
|
+
type PropsType = {
|
|
5
|
+
className?: string;
|
|
6
|
+
msg?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
className,
|
|
11
|
+
msg,
|
|
12
|
+
setOnOkClick,
|
|
13
|
+
setResult,
|
|
14
|
+
closeDialog,
|
|
15
|
+
}: PropsType & DialogExportsType = $props();
|
|
16
|
+
|
|
17
|
+
$effect(() => {
|
|
18
|
+
setOnOkClick(() => {
|
|
19
|
+
setResult(true);
|
|
20
|
+
closeDialog();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
14
23
|
</script>
|
|
15
24
|
|
|
16
25
|
<div class="p-6 {className}">
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { DialogExportsType, DialogPropsType, DialogSizeType } from './components/dialog/dialog.svelte';
|
|
2
|
+
import Dialog from './components/dialog/dialog.svelte';
|
|
1
3
|
import MsgDialog from "./components/msg-dialog/msg-dialog.svelte";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
+
export { Dialog, MsgDialog };
|
|
5
|
+
export type { DialogExportsType, DialogPropsType, DialogSizeType };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import Dialog from './components/dialog/dialog.svelte';
|
|
1
2
|
import MsgDialog from "./components/msg-dialog/msg-dialog.svelte";
|
|
2
|
-
|
|
3
|
-
export { Dialog, DialogSizeEnum, MsgDialog, };
|
|
3
|
+
export { Dialog, MsgDialog };
|
|
@@ -1,37 +1,55 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import '../../../../../tailwind.css';
|
|
4
|
+
|
|
5
|
+
type PropsType = {
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
id?: string;
|
|
8
|
+
backdropClassName?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
drawerContainerClassName?: string;
|
|
12
|
+
drawerClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
id = '',
|
|
17
|
+
children,
|
|
18
|
+
backdropClassName = '',
|
|
19
|
+
className = 'bg-indigo-600 text-white',
|
|
20
|
+
containerClassName = '',
|
|
21
|
+
drawerContainerClassName = '',
|
|
22
|
+
drawerClassName = ''
|
|
23
|
+
}: PropsType = $props();
|
|
24
|
+
|
|
25
|
+
let isPlaced: boolean = $state(false);
|
|
26
|
+
let isOpened: boolean = $state(false);
|
|
27
|
+
|
|
28
|
+
function handelBackdropClick() {
|
|
29
|
+
toggleDrawer();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function toggleDrawer() {
|
|
33
|
+
if (!isPlaced) {
|
|
34
|
+
openDrawer();
|
|
35
|
+
} else {
|
|
36
|
+
closeDrawer();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function openDrawer() {
|
|
41
|
+
isPlaced = true;
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
isOpened = true;
|
|
44
|
+
}, 0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function closeDrawer() {
|
|
48
|
+
isOpened = false;
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
isPlaced = false;
|
|
51
|
+
}, 300);
|
|
52
|
+
}
|
|
35
53
|
</script>
|
|
36
54
|
|
|
37
55
|
{#if isPlaced}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ColorField from '../../../input/components/color-field/color-field.svelte';
|
|
3
|
+
import '../../../../../tailwind.css';
|
|
4
|
+
type IconPropsType = {
|
|
5
|
+
path: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
fill?: string;
|
|
9
|
+
viewBox?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
path,
|
|
15
|
+
className = '',
|
|
16
|
+
size = 24,
|
|
17
|
+
fill = 'currentColor',
|
|
18
|
+
viewBox = '',
|
|
19
|
+
color
|
|
20
|
+
}: IconPropsType = $props();
|
|
21
|
+
|
|
22
|
+
$effect(() => {
|
|
23
|
+
viewBox = viewBox || `0 0 ${size} ${size}`;
|
|
24
|
+
});
|
|
14
25
|
</script>
|
|
15
26
|
|
|
16
27
|
<svg class="w-6 h-6 align-middle {className}" {viewBox} fill={color || fill}>
|
|
@@ -1,64 +1,74 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
$effect(() => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ripple } from '../../../../../actions';
|
|
3
|
+
import { colorToHex, isValidHexColor } from '../../../../../services';
|
|
4
|
+
import { mdiSquare } from '../../../icon';
|
|
5
|
+
import Icon from '../../../icon/components/icon/icon.svelte';
|
|
6
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
size,
|
|
10
|
+
appearance,
|
|
11
|
+
value = $bindable('#000000'),
|
|
12
|
+
...props
|
|
13
|
+
}: InputFieldPropsType & { value?: string } = $props();
|
|
14
|
+
|
|
15
|
+
let colorRef: HTMLInputElement;
|
|
16
|
+
let btnIconSizeClassName: string = $state('');
|
|
17
|
+
let btnRoundedClassName: string = $state('');
|
|
18
|
+
let colorValue: string = $state('#000000');
|
|
19
|
+
|
|
20
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
21
|
+
|
|
22
|
+
export function focus() {
|
|
23
|
+
inputFieldRef?.focus();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function handleColorBtnClick() {
|
|
27
|
+
if (colorRef) {
|
|
28
|
+
colorRef.click();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function handleColorPickerChange(ev: any) {
|
|
33
|
+
let input: HTMLInputElement = ev?.target;
|
|
34
|
+
if (input) {
|
|
35
|
+
value = input.value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$effect(() => {
|
|
40
|
+
if (isValidHexColor(value)) {
|
|
41
|
+
colorValue = value;
|
|
42
|
+
if (colorRef) {
|
|
43
|
+
colorRef.value = colorToHex(value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
$effect(() => {
|
|
49
|
+
if (size) {
|
|
50
|
+
switch (size) {
|
|
51
|
+
case 'lg':
|
|
52
|
+
btnIconSizeClassName = '!h-7 !w-7';
|
|
53
|
+
break;
|
|
54
|
+
case 'md':
|
|
55
|
+
btnIconSizeClassName = '!h-6 !w-6';
|
|
56
|
+
break;
|
|
57
|
+
case 'sm':
|
|
58
|
+
btnIconSizeClassName = '!h-5 !w-5';
|
|
59
|
+
break;
|
|
60
|
+
case 'xs':
|
|
61
|
+
btnIconSizeClassName = '!h-4 !w-4';
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
$effect(() => {
|
|
68
|
+
if (!appearance || appearance == 'normal') {
|
|
69
|
+
btnRoundedClassName = 'rounded-tr-lg rounded-br-lg';
|
|
70
|
+
}
|
|
71
|
+
});
|
|
62
72
|
</script>
|
|
63
73
|
|
|
64
74
|
{#snippet colorButton()}
|