@cloudparker/moldex.js 0.0.69 → 0.0.70
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 +1 -1
- package/dist/services/dialog/dialog-service.js +6 -5
- package/dist/views/core/button/components/button/button.svelte +3 -0
- package/dist/views/core/button/components/button/button.svelte.d.ts +1 -0
- package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte +5 -1
- package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte.d.ts +3 -2
- package/dist/views/core/button/components/button-menu/button-menu.svelte +5 -1
- package/dist/views/core/button/components/button-menu/button-menu.svelte.d.ts +3 -2
- package/dist/views/core/button/components/button-search/button-search.svelte +10 -2
- package/dist/views/core/button/components/button-search/button-search.svelte.d.ts +2 -2
- package/dist/views/core/dialog/components/dialog/dialog.svelte +4 -9
- package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export declare function openConfirmDialog(params?: DialogProps & {
|
|
|
23
23
|
export declare function openAlertDialog(params?: DialogProps & {
|
|
24
24
|
msg?: string;
|
|
25
25
|
}): Promise<unknown>;
|
|
26
|
-
export declare function openDeleteConfirmDialog(params?: DialogProps & {
|
|
26
|
+
export declare function openDeleteConfirmDialog({ msg, title, footerOkButtonLable, footerOkButtonClassName, ...params }?: DialogProps & {
|
|
27
27
|
msg?: string;
|
|
28
28
|
}): Promise<unknown>;
|
|
29
29
|
export declare function openPickerDialog<R>({ items, value, multiple, hasCheckbox, hasArrow, maxlength, maxlengthMsg, identityFieldName, titleFieldName, searchFieldName, subtitleFieldName, ...params }: DialogProps & PickerDialogProps): Promise<R>;
|
|
@@ -62,12 +62,13 @@ export async function openAlertDialog(params = {}) {
|
|
|
62
62
|
footerCloseButtonLabel: 'OK'
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
export async function openDeleteConfirmDialog(params = {}) {
|
|
65
|
+
export async function openDeleteConfirmDialog({ msg = 'Are you sure to delete?', title = 'Delete', footerOkButtonLable = 'Delete', footerOkButtonClassName = 'bg-red-500 hover:bg-red-700 focus:bg-red-700', ...params } = {}) {
|
|
66
66
|
return await openConfirmDialog({
|
|
67
|
-
msg
|
|
68
|
-
title
|
|
69
|
-
footerOkButtonLable
|
|
70
|
-
footerOkButtonClassName
|
|
67
|
+
msg,
|
|
68
|
+
title,
|
|
69
|
+
footerOkButtonLable,
|
|
70
|
+
footerOkButtonClassName,
|
|
71
|
+
...params,
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
export async function openPickerDialog({ items, value, multiple, hasCheckbox = true, hasArrow, maxlength, maxlengthMsg, identityFieldName, titleFieldName, searchFieldName, subtitleFieldName, ...params }) {
|
|
@@ -5,6 +5,7 @@ import { Icon, mdiOpenInNew } from "../../../icon";
|
|
|
5
5
|
import { Spinner } from "../../../spinner";
|
|
6
6
|
import "../../../../../tailwind.css";
|
|
7
7
|
let {
|
|
8
|
+
title,
|
|
8
9
|
appearance = "none",
|
|
9
10
|
id = "",
|
|
10
11
|
form = void 0,
|
|
@@ -117,6 +118,7 @@ function handleRipple(node, options) {
|
|
|
117
118
|
ondragenter={onDragEnter}
|
|
118
119
|
ondragleave={onDragLeave}
|
|
119
120
|
ondragover={onDragOver}
|
|
121
|
+
{title}
|
|
120
122
|
>
|
|
121
123
|
{#if children}
|
|
122
124
|
{@render children()}
|
|
@@ -132,6 +134,7 @@ function handleRipple(node, options) {
|
|
|
132
134
|
{id}
|
|
133
135
|
{type}
|
|
134
136
|
{form}
|
|
137
|
+
{title}
|
|
135
138
|
class="relative flex items-center justify-center gap-2 focus:outline-primary dark:focus:outline-primary rounded {btnSizeClassName} {btnAppearanceClassName} {className}"
|
|
136
139
|
{disabled}
|
|
137
140
|
use:handleRipple
|
|
@@ -2,6 +2,7 @@ export type ButtonAppearance = 'none' | 'primary' | 'base' | 'border' | 'border-
|
|
|
2
2
|
export type ButtonSize = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
3
|
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
4
4
|
export type ButtonProps = {
|
|
5
|
+
title?: string;
|
|
5
6
|
id?: string;
|
|
6
7
|
type?: ButtonType;
|
|
7
8
|
appearance?: ButtonAppearance;
|
|
@@ -23,7 +23,9 @@ let {
|
|
|
23
23
|
containerClassName = "",
|
|
24
24
|
dropdownClassName = "",
|
|
25
25
|
dropdownCloseClassName = "",
|
|
26
|
-
dropdownOpenClassName = ""
|
|
26
|
+
dropdownOpenClassName = "",
|
|
27
|
+
disabled,
|
|
28
|
+
...others
|
|
27
29
|
} = $props();
|
|
28
30
|
let placement = $state(false);
|
|
29
31
|
let dropdownState = $state(3 /* CLOSED */);
|
|
@@ -59,6 +61,8 @@ function handleBackdropEvent(ev) {
|
|
|
59
61
|
onClick={handleToggleDropdown}
|
|
60
62
|
{label}
|
|
61
63
|
{children}
|
|
64
|
+
{disabled}
|
|
65
|
+
{...others}
|
|
62
66
|
/>
|
|
63
67
|
|
|
64
68
|
{#if placement}
|
|
@@ -12,10 +12,11 @@ export type ButtonDropdownProps = {
|
|
|
12
12
|
dropdownClassName?: string;
|
|
13
13
|
dropdownCloseClassName?: string;
|
|
14
14
|
dropdownOpenClassName?: string;
|
|
15
|
+
disabled?: boolean;
|
|
15
16
|
};
|
|
16
17
|
import '../../../../../tailwind.css';
|
|
17
18
|
import type { Snippet } from 'svelte';
|
|
18
|
-
import { type ButtonAppearance, type ButtonSize, type ButtonType } from '../button/button.svelte';
|
|
19
|
+
import { type ButtonAppearance, type ButtonProps, type ButtonSize, type ButtonType } from '../button/button.svelte';
|
|
19
20
|
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
21
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
21
22
|
$$bindings?: Bindings;
|
|
@@ -29,7 +30,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
29
30
|
};
|
|
30
31
|
z_$$bindings?: Bindings;
|
|
31
32
|
}
|
|
32
|
-
declare const ButtonDropdown: $$__sveltets_2_IsomorphicComponent<ButtonDropdownProps, {
|
|
33
|
+
declare const ButtonDropdown: $$__sveltets_2_IsomorphicComponent<ButtonProps & ButtonDropdownProps, {
|
|
33
34
|
[evt: string]: CustomEvent<any>;
|
|
34
35
|
}, {}, {
|
|
35
36
|
toggleDropdown: (ev: MouseEvent) => void;
|
|
@@ -15,7 +15,9 @@ let {
|
|
|
15
15
|
menus,
|
|
16
16
|
onMenu,
|
|
17
17
|
dropdownClassName,
|
|
18
|
-
menuIconClassName
|
|
18
|
+
menuIconClassName,
|
|
19
|
+
disabled,
|
|
20
|
+
...others
|
|
19
21
|
} = $props();
|
|
20
22
|
let buttonDropdownRef;
|
|
21
23
|
let items = $derived.by(() => {
|
|
@@ -63,6 +65,8 @@ function handleItemClick(ev, menuItem, index) {
|
|
|
63
65
|
{appearance}
|
|
64
66
|
{size}
|
|
65
67
|
{dropdownClassName}
|
|
68
|
+
{disabled}
|
|
69
|
+
{...others}
|
|
66
70
|
>
|
|
67
71
|
{#if children}
|
|
68
72
|
{@render children()}
|
|
@@ -9,7 +9,7 @@ export type Menu = {
|
|
|
9
9
|
checkboxClassName?: string;
|
|
10
10
|
isChecked?: boolean;
|
|
11
11
|
};
|
|
12
|
-
import { type ButtonAppearance, type ButtonSize } from '../../../../..';
|
|
12
|
+
import { type ButtonAppearance, type ButtonProps, type ButtonSize } from '../../../../..';
|
|
13
13
|
import type { Snippet } from 'svelte';
|
|
14
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> {
|
|
15
15
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -24,7 +24,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
24
24
|
};
|
|
25
25
|
z_$$bindings?: Bindings;
|
|
26
26
|
}
|
|
27
|
-
declare const ButtonMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
27
|
+
declare const ButtonMenu: $$__sveltets_2_IsomorphicComponent<ButtonProps & {
|
|
28
28
|
label?: string;
|
|
29
29
|
className?: string;
|
|
30
30
|
appearance?: ButtonAppearance;
|
|
@@ -36,6 +36,7 @@ declare const ButtonMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
|
36
36
|
onMenu?: (ev: MouseEvent, menu: string | Menu) => void;
|
|
37
37
|
dropdownClassName?: string;
|
|
38
38
|
menuIconClassName?: string;
|
|
39
|
+
disabled?: boolean;
|
|
39
40
|
}, {
|
|
40
41
|
[evt: string]: CustomEvent<any>;
|
|
41
42
|
}, {}, {}, "">;
|
|
@@ -14,7 +14,8 @@ let {
|
|
|
14
14
|
size,
|
|
15
15
|
children,
|
|
16
16
|
iconClassName,
|
|
17
|
-
dropdownClassName
|
|
17
|
+
dropdownClassName,
|
|
18
|
+
...others
|
|
18
19
|
} = $props();
|
|
19
20
|
</script>
|
|
20
21
|
|
|
@@ -30,7 +31,14 @@ let {
|
|
|
30
31
|
</div>
|
|
31
32
|
{/snippet}
|
|
32
33
|
|
|
33
|
-
<ButtonDropdown
|
|
34
|
+
<ButtonDropdown
|
|
35
|
+
dropdownSnippet={dropdownSearch}
|
|
36
|
+
{className}
|
|
37
|
+
{appearance}
|
|
38
|
+
{size}
|
|
39
|
+
{dropdownClassName}
|
|
40
|
+
{...others}
|
|
41
|
+
>
|
|
34
42
|
{#if children}
|
|
35
43
|
{@render children()}
|
|
36
44
|
{:else}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonAppearance, type ButtonSize, type InputFieldAppearance, type InputFieldSize } from '../../../../..';
|
|
1
|
+
import { type ButtonAppearance, type ButtonProps, type ButtonSize, type InputFieldAppearance, type InputFieldSize } from '../../../../..';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
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
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -13,7 +13,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
13
13
|
};
|
|
14
14
|
z_$$bindings?: Bindings;
|
|
15
15
|
}
|
|
16
|
-
declare const ButtonSearch: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
declare const ButtonSearch: $$__sveltets_2_IsomorphicComponent<ButtonProps & {
|
|
17
17
|
searchAppearance?: InputFieldAppearance;
|
|
18
18
|
searchClassName?: string;
|
|
19
19
|
searchSize?: InputFieldSize;
|
|
@@ -12,6 +12,7 @@ let {
|
|
|
12
12
|
bodyClassName = "",
|
|
13
13
|
bodyComponent,
|
|
14
14
|
cancelable = true,
|
|
15
|
+
scrollable = true,
|
|
15
16
|
children,
|
|
16
17
|
className = "",
|
|
17
18
|
component,
|
|
@@ -71,8 +72,8 @@ let isPlaced = $state(false);
|
|
|
71
72
|
let isOpened = $state(false);
|
|
72
73
|
let headerSnippet = $state(null);
|
|
73
74
|
let footerSnippet = $state(null);
|
|
74
|
-
let CustomComponent = $
|
|
75
|
-
let BodyComponent = $
|
|
75
|
+
let CustomComponent = $derived(component);
|
|
76
|
+
let BodyComponent = $derived(bodyComponent);
|
|
76
77
|
let result;
|
|
77
78
|
let xsSizeClassName = "w-64";
|
|
78
79
|
let smSizeClassName = "w-96";
|
|
@@ -170,12 +171,6 @@ function handleOkClick(event) {
|
|
|
170
171
|
onOkClick(event, dialogExports);
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
$effect(() => {
|
|
174
|
-
BodyComponent = bodyComponent;
|
|
175
|
-
});
|
|
176
|
-
$effect(() => {
|
|
177
|
-
CustomComponent = component;
|
|
178
|
-
});
|
|
179
174
|
</script>
|
|
180
175
|
|
|
181
176
|
{#snippet dialogContent()}
|
|
@@ -241,7 +236,7 @@ $effect(() => {
|
|
|
241
236
|
</div>
|
|
242
237
|
{/if}
|
|
243
238
|
|
|
244
|
-
<div class="flex-grow overflow-y-auto {bodyClassName}">
|
|
239
|
+
<div class="flex-grow {scrollable ? 'overflow-y-auto' : ''} {bodyClassName}">
|
|
245
240
|
{#if children}
|
|
246
241
|
{@render children()}
|
|
247
242
|
{:else if BodyComponent?.length == 2}
|