@cloudparker/moldex.js 0.0.65 → 0.0.67
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/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 +86 -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/icon/services/icon-path-service.d.ts +1 -0
- package/dist/views/core/icon/services/icon-path-service.js +1 -0
- 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,242 +1,79 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
export type ButtonMenuProps = {
|
|
3
|
-
innerClassName?: string;
|
|
4
|
-
backgropClassName?: string;
|
|
5
|
-
buttonSnippet?: Snippet;
|
|
6
|
-
checkClassName?: string;
|
|
7
|
-
checkIconClassName?: string;
|
|
8
|
-
checkIconPath?: string;
|
|
9
|
-
children?: Snippet;
|
|
10
|
-
className?: string;
|
|
11
|
-
containerClassName?: string;
|
|
12
|
-
disabled?: boolean | undefined | null;
|
|
13
|
-
dividerClassName?: string;
|
|
14
|
-
dropdownClassName?: string;
|
|
15
|
-
dropdownCloseClassName?: string;
|
|
16
|
-
dropdownOpenClassName?: string;
|
|
17
|
-
dropdownStyle?: string;
|
|
18
|
-
dropIconClassName?: string;
|
|
19
|
-
dropIconPath?: string;
|
|
20
|
-
hasCheckbox?: boolean;
|
|
21
|
-
id?: string;
|
|
22
|
-
imgAlt?: string;
|
|
23
|
-
imgClassName?: string;
|
|
24
|
-
imgSrc?: string;
|
|
25
|
-
leftIconClassName?: string;
|
|
26
|
-
leftIconPath?: string;
|
|
27
|
-
listIconClassName?: string;
|
|
28
|
-
listImgClassName?: string;
|
|
29
|
-
listSubtitleClassName?: string;
|
|
30
|
-
listTitleClassName?: string;
|
|
31
|
-
menuItemClassName?: string;
|
|
32
|
-
menuItemInnerSnippet?: Snippet<[ListItemType, number]>;
|
|
33
|
-
menuItemSnippet?: Snippet<[ListItemType, number]>;
|
|
34
|
-
menus?: string[] | ListItemType[];
|
|
35
|
-
onMenu?: (ev: MouseEvent, menu: string | ListItemType, index?: number) => void;
|
|
36
|
-
rightIconClassName?: string;
|
|
37
|
-
rightIconPath?: string;
|
|
38
|
-
screenOnlyDesc?: string;
|
|
1
|
+
<script lang="ts" module></script>
|
|
39
2
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
3
|
+
<script lang="ts">import { mdiDotsHorizontal } from "../../../../..";
|
|
4
|
+
import ButtonDropdown from "../button-dropdown/button-dropdown.svelte";
|
|
5
|
+
import Icon from "../../../icon/components/icon/icon.svelte";
|
|
6
|
+
import ButtonListItem from "../button-list-item/button-list-item.svelte";
|
|
7
|
+
let {
|
|
8
|
+
label,
|
|
9
|
+
className,
|
|
10
|
+
appearance,
|
|
11
|
+
size,
|
|
12
|
+
children,
|
|
13
|
+
iconPath = mdiDotsHorizontal,
|
|
14
|
+
iconClassName,
|
|
15
|
+
menus,
|
|
16
|
+
onMenu,
|
|
17
|
+
dropdownClassName,
|
|
18
|
+
menuIconClassName
|
|
19
|
+
} = $props();
|
|
20
|
+
let buttonDropdownRef;
|
|
21
|
+
let items = $derived.by(() => {
|
|
22
|
+
if (menus && typeof menus[0] == "string") {
|
|
23
|
+
let array = menus.map((name) => {
|
|
24
|
+
return {
|
|
25
|
+
_id: name,
|
|
26
|
+
title: name
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return array;
|
|
30
|
+
}
|
|
31
|
+
return menus || [];
|
|
32
|
+
});
|
|
33
|
+
function handleItemClick(ev, menuItem, index) {
|
|
34
|
+
let menu = (menus || [])[index];
|
|
35
|
+
if (menu) {
|
|
36
|
+
onMenu && onMenu(ev, menu);
|
|
37
|
+
buttonDropdownRef && buttonDropdownRef.toggleDropdown(ev);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
45
40
|
</script>
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import {
|
|
53
|
-
Icon,
|
|
54
|
-
mdiCheckCircle,
|
|
55
|
-
mdiCheckCircleOutline,
|
|
56
|
-
mdiChevronDown
|
|
57
|
-
} from '../../../icon';
|
|
58
|
-
import type { Snippet } from 'svelte';
|
|
59
|
-
import type { ListItemType } from '../button-list-item/button-list-item.svelte';
|
|
60
|
-
import ButtonListItem from '../button-list-item/button-list-item.svelte';
|
|
61
|
-
import Button from '../button/button.svelte';
|
|
62
|
-
import { stopPropagation } from 'svelte/legacy';
|
|
63
|
-
|
|
64
|
-
class MenuStateEnum {
|
|
65
|
-
static OPENED = 'OPENED';
|
|
66
|
-
static CLOSED = 'CLOSED';
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
let {
|
|
70
|
-
backgropClassName = '',
|
|
71
|
-
buttonSnippet,
|
|
72
|
-
checkClassName = '',
|
|
73
|
-
checkIconClassName = '',
|
|
74
|
-
checkIconPath = mdiCheckCircle,
|
|
75
|
-
children,
|
|
76
|
-
className = '',
|
|
77
|
-
innerClassName = '',
|
|
78
|
-
containerClassName = '',
|
|
79
|
-
dividerClassName = '',
|
|
80
|
-
dropdownClassName = '',
|
|
81
|
-
dropdownCloseClassName = '',
|
|
82
|
-
dropdownOpenClassName = '',
|
|
83
|
-
dropdownStyle = '',
|
|
84
|
-
dropIconClassName = '',
|
|
85
|
-
dropIconPath = mdiChevronDown,
|
|
86
|
-
hasCheckbox = false,
|
|
87
|
-
id = 'menu',
|
|
88
|
-
imgAlt = 'Menu',
|
|
89
|
-
imgClassName = '',
|
|
90
|
-
imgSrc = '',
|
|
91
|
-
leftIconClassName = '',
|
|
92
|
-
leftIconPath = '',
|
|
93
|
-
listIconClassName = '',
|
|
94
|
-
listImgClassName = '',
|
|
95
|
-
listSubtitleClassName = '',
|
|
96
|
-
listTitleClassName = '',
|
|
97
|
-
menuItemClassName = '',
|
|
98
|
-
menuItemInnerSnippet,
|
|
99
|
-
menuItemSnippet,
|
|
100
|
-
menus = [],
|
|
101
|
-
onMenu = (ev: MouseEvent, menu: string | ListItemType, index?: number) => {},
|
|
102
|
-
rightIconClassName = '',
|
|
103
|
-
rightIconPath = '',
|
|
104
|
-
screenOnlyDesc = 'Menu',
|
|
105
|
-
|
|
106
|
-
title = '',
|
|
107
|
-
titleClassName = '',
|
|
108
|
-
uncheckIconClassName = '',
|
|
109
|
-
uncheckIconPath = mdiCheckCircleOutline
|
|
110
|
-
}: ButtonMenuProps = $props();
|
|
111
|
-
|
|
112
|
-
let expanded = $state(false);
|
|
113
|
-
let dropdownState: MenuStateEnum = $state(MenuStateEnum.CLOSED);
|
|
114
|
-
|
|
115
|
-
let selectedMenu: ListItemType | null | undefined = $state(null);
|
|
116
|
-
|
|
117
|
-
let options: ListItemType[] = $derived.by(() => {
|
|
118
|
-
if (menus?.length) {
|
|
119
|
-
let item = menus[0];
|
|
120
|
-
if (typeof item == 'string') {
|
|
121
|
-
return menus.map((str) => {
|
|
122
|
-
if (str == '-' || str == '') {
|
|
123
|
-
return { divider: true } as ListItemType;
|
|
124
|
-
} else {
|
|
125
|
-
return { title: str } as ListItemType;
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
} else {
|
|
129
|
-
return [...menus] as ListItemType[];
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return [];
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
function handleToggleDropdown(ev: MouseEvent) {
|
|
136
|
-
ev && ev.stopPropagation();
|
|
137
|
-
if (dropdownState == MenuStateEnum.CLOSED) {
|
|
138
|
-
dropdownState = MenuStateEnum.OPENED;
|
|
139
|
-
} else {
|
|
140
|
-
dropdownState = MenuStateEnum.CLOSED;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function handlemenuItemClick(ev: MouseEvent, menu: ListItemType, index: number) {
|
|
145
|
-
handleToggleDropdown(ev);
|
|
146
|
-
if (onMenu) {
|
|
147
|
-
let item = menus[index];
|
|
148
|
-
|
|
149
|
-
if (item) {
|
|
150
|
-
onMenu(ev, item, index);
|
|
151
|
-
}
|
|
152
|
-
selectedMenu = menu;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
</script>
|
|
156
|
-
|
|
157
|
-
<div class="relative min-h-max {containerClassName}">
|
|
158
|
-
<Button
|
|
159
|
-
type="button"
|
|
160
|
-
className="flex items-center justify-center flex-nowrap text-start {className}"
|
|
161
|
-
{id}
|
|
162
|
-
onClick={handleToggleDropdown}
|
|
163
|
-
>
|
|
164
|
-
<span class="sr-only">{screenOnlyDesc}</span>
|
|
165
|
-
<div class="flex items-center flex-nowrap {innerClassName}">
|
|
166
|
-
{#if buttonSnippet}
|
|
167
|
-
{@render buttonSnippet()}
|
|
42
|
+
{#snippet dropdownSearch()}
|
|
43
|
+
<div class="py-2">
|
|
44
|
+
{#each items as item, index}
|
|
45
|
+
{#if item.title == '-'}
|
|
46
|
+
<hr />
|
|
168
47
|
{:else}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
{#if title}
|
|
176
|
-
<span class="text-nowrap {titleClassName}">
|
|
177
|
-
{@html title}
|
|
178
|
-
</span>
|
|
179
|
-
{/if}
|
|
180
|
-
{#if rightIconPath}
|
|
181
|
-
<Icon path={rightIconPath} className=" {rightIconClassName}" />
|
|
182
|
-
{/if}
|
|
183
|
-
{#if dropIconPath}
|
|
184
|
-
<Icon path={dropIconPath} className="w-5 h-5 text-gray-400 {dropIconClassName}" />
|
|
185
|
-
{/if}
|
|
48
|
+
<ButtonListItem
|
|
49
|
+
{...item}
|
|
50
|
+
className="hover:bg-base-50 "
|
|
51
|
+
iconClassName={menuIconClassName}
|
|
52
|
+
onClick={(ev) => handleItemClick(ev, item, index)}
|
|
53
|
+
/>
|
|
186
54
|
{/if}
|
|
55
|
+
{/each}
|
|
56
|
+
</div>
|
|
57
|
+
{/snippet}
|
|
58
|
+
|
|
59
|
+
<ButtonDropdown
|
|
60
|
+
bind:this={buttonDropdownRef}
|
|
61
|
+
dropdownSnippet={dropdownSearch}
|
|
62
|
+
{className}
|
|
63
|
+
{appearance}
|
|
64
|
+
{size}
|
|
65
|
+
{dropdownClassName}
|
|
66
|
+
>
|
|
67
|
+
{#if children}
|
|
68
|
+
{@render children()}
|
|
69
|
+
{:else}
|
|
70
|
+
{#if label}
|
|
71
|
+
<div>
|
|
72
|
+
{label || ''}
|
|
73
|
+
</div>
|
|
74
|
+
{/if}
|
|
75
|
+
<div>
|
|
76
|
+
<Icon path={iconPath} className={iconClassName} />
|
|
187
77
|
</div>
|
|
188
|
-
</Button>
|
|
189
|
-
{#if dropdownState == MenuStateEnum.OPENED}
|
|
190
|
-
<button
|
|
191
|
-
aria-label="backdrop"
|
|
192
|
-
type="button"
|
|
193
|
-
id="{id}-menu-backdrop"
|
|
194
|
-
class="cursor-auto fixed inset-0 z-10 {backgropClassName}"
|
|
195
|
-
use:ripple
|
|
196
|
-
onclick={handleToggleDropdown}
|
|
197
|
-
tabindex="-1"
|
|
198
|
-
></button>
|
|
199
78
|
{/if}
|
|
200
|
-
|
|
201
|
-
class="absolute mt-1 z-10 min-w-40 max-h-1/2vh overflow-y-auto origin-top-right right-0 rounded-md bg-base-50 dark:bg-base-800 py-2 shadow-lg ring-1 ring-gray-900/5 focus:outline-none transition ease-out duration-100 {dropdownClassName} {dropdownState ==
|
|
202
|
-
MenuStateEnum.CLOSED
|
|
203
|
-
? `invisible transform opacity-0 scale-95 ${dropdownOpenClassName}`
|
|
204
|
-
: `transform opacity-100 scale-100 ${dropdownCloseClassName}`}"
|
|
205
|
-
style={dropdownStyle}
|
|
206
|
-
role="menu"
|
|
207
|
-
aria-orientation="vertical"
|
|
208
|
-
aria-labelledby={id}
|
|
209
|
-
tabindex="-1"
|
|
210
|
-
>
|
|
211
|
-
{#if children}
|
|
212
|
-
{@render children()}
|
|
213
|
-
{:else}
|
|
214
|
-
{#each options as menu, index (menu.id || index)}
|
|
215
|
-
{#if menu?.divider}
|
|
216
|
-
<div class="border-t border-gray-200 dark:border-gray-700 {dividerClassName}"></div>
|
|
217
|
-
{:else if menuItemSnippet}
|
|
218
|
-
{@render menuItemSnippet(menu, index)}
|
|
219
|
-
{:else}
|
|
220
|
-
<ButtonListItem
|
|
221
|
-
item={menu}
|
|
222
|
-
{index}
|
|
223
|
-
{hasCheckbox}
|
|
224
|
-
{id}
|
|
225
|
-
className={menuItemClassName}
|
|
226
|
-
{uncheckIconPath}
|
|
227
|
-
{checkIconPath}
|
|
228
|
-
{checkIconClassName}
|
|
229
|
-
{uncheckIconClassName}
|
|
230
|
-
{checkClassName}
|
|
231
|
-
iconClassName={listIconClassName}
|
|
232
|
-
imgClassName={listImgClassName}
|
|
233
|
-
titleClassName={listTitleClassName}
|
|
234
|
-
subtitleClassName={listSubtitleClassName}
|
|
235
|
-
children={menuItemInnerSnippet}
|
|
236
|
-
onClick={handlemenuItemClick}
|
|
237
|
-
/>
|
|
238
|
-
{/if}
|
|
239
|
-
{/each}
|
|
240
|
-
{/if}
|
|
241
|
-
</div>
|
|
242
|
-
</div>
|
|
79
|
+
</ButtonDropdown>
|
|
@@ -1,48 +1,16 @@
|
|
|
1
|
-
export type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
children?: Snippet;
|
|
9
|
-
className?: string;
|
|
10
|
-
containerClassName?: string;
|
|
11
|
-
disabled?: boolean | undefined | null;
|
|
12
|
-
dividerClassName?: string;
|
|
13
|
-
dropdownClassName?: string;
|
|
14
|
-
dropdownCloseClassName?: string;
|
|
15
|
-
dropdownOpenClassName?: string;
|
|
16
|
-
dropdownStyle?: string;
|
|
17
|
-
dropIconClassName?: string;
|
|
18
|
-
dropIconPath?: string;
|
|
1
|
+
export type Menu = {
|
|
2
|
+
_id?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
hasIcon?: boolean;
|
|
6
|
+
iconPath?: string;
|
|
7
|
+
iconClassName?: string;
|
|
19
8
|
hasCheckbox?: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
imgClassName?: string;
|
|
23
|
-
imgSrc?: string;
|
|
24
|
-
leftIconClassName?: string;
|
|
25
|
-
leftIconPath?: string;
|
|
26
|
-
listIconClassName?: string;
|
|
27
|
-
listImgClassName?: string;
|
|
28
|
-
listSubtitleClassName?: string;
|
|
29
|
-
listTitleClassName?: string;
|
|
30
|
-
menuItemClassName?: string;
|
|
31
|
-
menuItemInnerSnippet?: Snippet<[ListItemType, number]>;
|
|
32
|
-
menuItemSnippet?: Snippet<[ListItemType, number]>;
|
|
33
|
-
menus?: string[] | ListItemType[];
|
|
34
|
-
onMenu?: (ev: MouseEvent, menu: string | ListItemType, index?: number) => void;
|
|
35
|
-
rightIconClassName?: string;
|
|
36
|
-
rightIconPath?: string;
|
|
37
|
-
screenOnlyDesc?: string;
|
|
38
|
-
title?: string | any;
|
|
39
|
-
titleClassName?: string;
|
|
40
|
-
uncheckIconClassName?: string;
|
|
41
|
-
uncheckIconPath?: string;
|
|
9
|
+
checkboxClassName?: string;
|
|
10
|
+
isChecked?: boolean;
|
|
42
11
|
};
|
|
43
|
-
import '
|
|
12
|
+
import { type ButtonAppearance, type ButtonSize } from '../../../../..';
|
|
44
13
|
import type { Snippet } from 'svelte';
|
|
45
|
-
import type { ListItemType } from '../button-list-item/button-list-item.svelte';
|
|
46
14
|
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> {
|
|
47
15
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
48
16
|
$$bindings?: Bindings;
|
|
@@ -56,7 +24,19 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
56
24
|
};
|
|
57
25
|
z_$$bindings?: Bindings;
|
|
58
26
|
}
|
|
59
|
-
declare const ButtonMenu: $$__sveltets_2_IsomorphicComponent<
|
|
27
|
+
declare const ButtonMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
28
|
+
label?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
appearance?: ButtonAppearance;
|
|
31
|
+
size?: ButtonSize;
|
|
32
|
+
children?: Snippet;
|
|
33
|
+
iconPath?: string;
|
|
34
|
+
iconClassName?: string;
|
|
35
|
+
menus?: string[] | Menu[];
|
|
36
|
+
onMenu?: (ev: MouseEvent, menu: string | Menu) => void;
|
|
37
|
+
dropdownClassName?: string;
|
|
38
|
+
menuIconClassName?: string;
|
|
39
|
+
}, {
|
|
60
40
|
[evt: string]: CustomEvent<any>;
|
|
61
41
|
}, {}, {}, "">;
|
|
62
42
|
type ButtonMenu = InstanceType<typeof ButtonMenu>;
|
|
@@ -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} className="bg-indigo-600 focus:bg-indigo-700 text-white 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 ButtonOk: $$__sveltets_2_IsomorphicComponent<
|
|
15
|
+
declare const ButtonOk: $$__sveltets_2_IsomorphicComponent<ButtonProps, {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
}, {}, {}, "">;
|
|
18
18
|
type ButtonOk = InstanceType<typeof ButtonOk>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">import {
|
|
2
|
+
mdiMagnify
|
|
3
|
+
} from "../../../../..";
|
|
4
|
+
import ButtonDropdown from "../button-dropdown/button-dropdown.svelte";
|
|
5
|
+
import Icon from "../../../icon/components/icon/icon.svelte";
|
|
6
|
+
import SearchField from "../../../input/components/search-field/search-field.svelte";
|
|
7
|
+
let {
|
|
8
|
+
searchClassName,
|
|
9
|
+
searchAppearance,
|
|
10
|
+
searchSize,
|
|
11
|
+
onSearch,
|
|
12
|
+
className,
|
|
13
|
+
appearance,
|
|
14
|
+
size,
|
|
15
|
+
children,
|
|
16
|
+
iconClassName,
|
|
17
|
+
dropdownClassName
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#snippet dropdownSearch()}
|
|
22
|
+
<div class="p-4">
|
|
23
|
+
<SearchField
|
|
24
|
+
{onSearch}
|
|
25
|
+
autofocus
|
|
26
|
+
className="min-w-52 {searchClassName}"
|
|
27
|
+
appearance={searchAppearance}
|
|
28
|
+
size={searchSize}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
{/snippet}
|
|
32
|
+
|
|
33
|
+
<ButtonDropdown dropdownSnippet={dropdownSearch} {className} {appearance} {size} {dropdownClassName}>
|
|
34
|
+
{#if children}
|
|
35
|
+
{@render children()}
|
|
36
|
+
{:else}
|
|
37
|
+
<Icon path={mdiMagnify} className={iconClassName} />
|
|
38
|
+
{/if}
|
|
39
|
+
</ButtonDropdown>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ButtonAppearance, type ButtonSize, type InputFieldAppearance, type InputFieldSize } from '../../../../..';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
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> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
declare const ButtonSearch: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
searchAppearance?: InputFieldAppearance;
|
|
18
|
+
searchClassName?: string;
|
|
19
|
+
searchSize?: InputFieldSize;
|
|
20
|
+
onSearch?: (searchText: string) => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
appearance?: ButtonAppearance;
|
|
23
|
+
size?: ButtonSize;
|
|
24
|
+
children?: Snippet;
|
|
25
|
+
iconClassName?: string;
|
|
26
|
+
dropdownClassName?: string;
|
|
27
|
+
}, {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
}, {}, {}, "">;
|
|
30
|
+
type ButtonSearch = InstanceType<typeof ButtonSearch>;
|
|
31
|
+
export default ButtonSearch;
|
|
@@ -2,10 +2,13 @@ import ButtonBack from './components/button-back/button-back.svelte';
|
|
|
2
2
|
import ButtonCloseIcon from './components/button-close-icon/button-close-icon.svelte';
|
|
3
3
|
import ButtonClose from './components/button-close/button-close.svelte';
|
|
4
4
|
import ButtonListItem from './components/button-list-item/button-list-item.svelte';
|
|
5
|
-
import
|
|
5
|
+
import ButtonDropdown from './components/button-dropdown/button-dropdown.svelte';
|
|
6
6
|
import ButtonOk from './components/button-ok/button-ok.svelte';
|
|
7
7
|
import Button from './components/button/button.svelte';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import ButtonSearch from './components/button-search/button-search.svelte';
|
|
9
|
+
import ButtonMenu from './components/button-menu/button-menu.svelte';
|
|
10
|
+
import type { ButtonListItemProps } from './components/button-list-item/button-list-item.svelte';
|
|
11
|
+
import type { ButtonDropdownProps } from './components/button-dropdown/button-dropdown.svelte';
|
|
12
|
+
import type { ButtonAppearance, ButtonProps, ButtonSize } from './components/button/button.svelte';
|
|
13
|
+
export type { ButtonDropdownProps, ButtonListItemProps, ButtonAppearance, ButtonProps, ButtonSize };
|
|
14
|
+
export { Button, ButtonBack, ButtonClose, ButtonCloseIcon, ButtonListItem, ButtonDropdown, ButtonOk, ButtonSearch, ButtonMenu, };
|
|
@@ -2,7 +2,9 @@ import ButtonBack from './components/button-back/button-back.svelte';
|
|
|
2
2
|
import ButtonCloseIcon from './components/button-close-icon/button-close-icon.svelte';
|
|
3
3
|
import ButtonClose from './components/button-close/button-close.svelte';
|
|
4
4
|
import ButtonListItem from './components/button-list-item/button-list-item.svelte';
|
|
5
|
-
import
|
|
5
|
+
import ButtonDropdown from './components/button-dropdown/button-dropdown.svelte';
|
|
6
6
|
import ButtonOk from './components/button-ok/button-ok.svelte';
|
|
7
7
|
import Button from './components/button/button.svelte';
|
|
8
|
-
|
|
8
|
+
import ButtonSearch from './components/button-search/button-search.svelte';
|
|
9
|
+
import ButtonMenu from './components/button-menu/button-menu.svelte';
|
|
10
|
+
export { Button, ButtonBack, ButtonClose, ButtonCloseIcon, ButtonListItem, ButtonDropdown, ButtonOk, ButtonSearch, ButtonMenu, };
|
|
@@ -1,43 +1,30 @@
|
|
|
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
|
-
case 'sm':
|
|
29
|
-
return sidebarPosition === 'left' ? 'sm:pl-72' : 'sm:pr-72';
|
|
30
|
-
case 'md':
|
|
31
|
-
return sidebarPosition === 'left' ? 'md:pl-72' : 'md:pr-72';
|
|
32
|
-
case 'lg':
|
|
33
|
-
return sidebarPosition === 'left' ? 'lg:pl-72' : 'lg:pr-72';
|
|
34
|
-
case 'xl':
|
|
35
|
-
return sidebarPosition === 'left' ? 'xl:pl-72' : 'xl:pr-72';
|
|
36
|
-
case '2xl':
|
|
37
|
-
return sidebarPosition === 'left' ? '2xl:pl-72' : '2xl:pr-72';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
1
|
+
<script lang="ts">let {
|
|
2
|
+
children,
|
|
3
|
+
className,
|
|
4
|
+
id,
|
|
5
|
+
responsiveBreakpoint = "md",
|
|
6
|
+
sidebarPosition = "none"
|
|
7
|
+
} = $props();
|
|
8
|
+
let responsiveClassName = $derived.by(() => {
|
|
9
|
+
if (sidebarPosition === "none") {
|
|
10
|
+
return "";
|
|
11
|
+
} else {
|
|
12
|
+
switch (responsiveBreakpoint) {
|
|
13
|
+
case "xs":
|
|
14
|
+
return sidebarPosition === "left" ? "xs:pl-72" : "xs:pr-72";
|
|
15
|
+
case "sm":
|
|
16
|
+
return sidebarPosition === "left" ? "sm:pl-72" : "sm:pr-72";
|
|
17
|
+
case "md":
|
|
18
|
+
return sidebarPosition === "left" ? "md:pl-72" : "md:pr-72";
|
|
19
|
+
case "lg":
|
|
20
|
+
return sidebarPosition === "left" ? "lg:pl-72" : "lg:pr-72";
|
|
21
|
+
case "xl":
|
|
22
|
+
return sidebarPosition === "left" ? "xl:pl-72" : "xl:pr-72";
|
|
23
|
+
case "2xl":
|
|
24
|
+
return sidebarPosition === "left" ? "2xl:pl-72" : "2xl:pr-72";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
41
28
|
</script>
|
|
42
29
|
|
|
43
30
|
<div {id} class="{responsiveClassName} {className}">
|
|
@@ -1,53 +1,37 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
export type CropperDialogPropsType = {
|
|
3
|
-
outputAspectRatio?: number;
|
|
4
|
-
outputWidth?: number;
|
|
5
|
-
outputFormat?: 'png' | 'jpeg' | 'webp';
|
|
6
|
-
outputQuality?: number;
|
|
7
|
-
outputType?: 'file' | 'base64';
|
|
8
|
-
inputImageFile?: File | null;
|
|
9
|
-
className?: string;
|
|
10
|
-
};
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<script lang="ts">
|
|
14
|
-
import EasyCropperjs from '@cloudparker/easy-cropperjs-svelte';
|
|
15
|
-
import type { DialogExportsType } from '../dialog/dialog.svelte';
|
|
16
|
-
|
|
17
|
-
let {
|
|
18
|
-
outputWidth,
|
|
19
|
-
outputFormat = 'webp',
|
|
20
|
-
outputQuality = 0.8,
|
|
21
|
-
outputType = 'file',
|
|
22
|
-
inputImageFile,
|
|
23
|
-
className,
|
|
24
|
-
setOnOkClick,
|
|
25
|
-
setResult,
|
|
26
|
-
closeDialog,
|
|
27
|
-
setOnData,
|
|
28
|
-
...props
|
|
29
|
-
}: CropperDialogPropsType & DialogExportsType = $props();
|
|
30
|
-
|
|
31
|
-
let easyCropperjsRef: EasyCropperjs | null = $state(null);
|
|
32
|
-
|
|
33
|
-
setOnOkClick(async () => {
|
|
34
|
-
console.log('setOnOkClick', easyCropperjsRef);
|
|
35
|
-
if (easyCropperjsRef) {
|
|
36
|
-
let res = await easyCropperjsRef.crop({
|
|
37
|
-
outputWidth,
|
|
38
|
-
outputFormat,
|
|
39
|
-
outputQuality,
|
|
40
|
-
outputType
|
|
41
|
-
});
|
|
42
|
-
console.log('res', res);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
1
|
+
<script module lang="ts"></script>
|
|
45
2
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
3
|
+
<script lang="ts">import EasyCropperjs from "@cloudparker/easy-cropperjs-svelte";
|
|
4
|
+
let {
|
|
5
|
+
outputWidth,
|
|
6
|
+
outputFormat = "webp",
|
|
7
|
+
outputQuality = 0.8,
|
|
8
|
+
outputType = "file",
|
|
9
|
+
inputImageFile,
|
|
10
|
+
className,
|
|
11
|
+
setOnOkClick,
|
|
12
|
+
setResult,
|
|
13
|
+
closeDialog,
|
|
14
|
+
setOnData,
|
|
15
|
+
...props
|
|
16
|
+
} = $props();
|
|
17
|
+
let easyCropperjsRef = $state(null);
|
|
18
|
+
setOnOkClick(async () => {
|
|
19
|
+
console.log("setOnOkClick", easyCropperjsRef);
|
|
20
|
+
if (easyCropperjsRef) {
|
|
21
|
+
let res = await easyCropperjsRef.crop({
|
|
22
|
+
outputWidth,
|
|
23
|
+
outputFormat,
|
|
24
|
+
outputQuality,
|
|
25
|
+
outputType
|
|
26
|
+
});
|
|
27
|
+
console.log("res", res);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function handleCropped(result) {
|
|
31
|
+
console.log("handleCropped", result);
|
|
32
|
+
setResult(result);
|
|
33
|
+
closeDialog();
|
|
34
|
+
}
|
|
51
35
|
</script>
|
|
52
36
|
|
|
53
37
|
<div class="h-full w-full overflow-hidden {className}">
|