@cloudparker/moldex.js 0.0.124 → 4.1.1
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/types.d.ts +6 -0
- package/dist/types.js +7 -0
- package/dist/views/core/button/components/button/button.svelte +135 -83
- package/dist/views/core/button/components/button-back/button-back.svelte +28 -15
- 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-dropdown/button-dropdown.svelte +96 -72
- package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte.d.ts +1 -1
- package/dist/views/core/button/components/button-list-item/button-list-item.svelte +98 -52
- package/dist/views/core/button/components/button-menu/button-menu.svelte +79 -43
- package/dist/views/core/button/components/button-ok/button-ok.svelte +4 -2
- package/dist/views/core/button/components/button-search/button-search.svelte +45 -21
- package/dist/views/core/button/components/switch/switch.svelte +50 -37
- package/dist/views/core/common/components/content-area/content-area.svelte +40 -27
- package/dist/views/core/common/components/loading/loading.svelte +9 -2
- package/dist/views/core/common/components/virtual-scrolling/virtual-scrolling-list.svelte +37 -20
- package/dist/views/core/dialog/components/cropper-dialog/cropper-dialog.svelte +52 -36
- package/dist/views/core/dialog/components/dialog/dialog.svelte +298 -177
- package/dist/views/core/dialog/components/loading-dialog/loading-dialog.svelte +30 -18
- package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +17 -7
- package/dist/views/core/dialog/components/number-field-dialog/number-field-dialog.svelte +41 -26
- package/dist/views/core/dialog/components/picker-dialog/picker-dialog.svelte +150 -105
- package/dist/views/core/dialog/components/text-field-dialog/text-field-dialog.svelte +40 -25
- package/dist/views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte +40 -25
- package/dist/views/core/drawer/components/drawer/drawer.svelte +58 -36
- package/dist/views/core/icon/components/icon/icon.svelte +24 -12
- package/dist/views/core/icon/components/icon-circle/icon-circle.svelte +10 -2
- package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte +44 -25
- package/dist/views/core/input/components/color-field/color-field.svelte +81 -69
- package/dist/views/core/input/components/combobox-field/combobox-field.svelte +359 -269
- package/dist/views/core/input/components/date-field/date-field.svelte +39 -30
- package/dist/views/core/input/components/datetime-field/datetime-field.svelte +18 -12
- package/dist/views/core/input/components/email-field/email-field.svelte +17 -12
- package/dist/views/core/input/components/file-field/file-field.svelte +78 -64
- package/dist/views/core/input/components/input-field/input-field.svelte +267 -164
- package/dist/views/core/input/components/label/label.svelte +24 -10
- package/dist/views/core/input/components/number-field/number-field.svelte +18 -12
- package/dist/views/core/input/components/password-field/password-field.svelte +70 -57
- package/dist/views/core/input/components/phone-field/phone-field.svelte +155 -104
- package/dist/views/core/input/components/radio-field/radio-field.svelte +83 -52
- package/dist/views/core/input/components/range-field/range-field.svelte +67 -44
- package/dist/views/core/input/components/search-field/search-field.svelte +62 -45
- package/dist/views/core/input/components/text-field/text-field.svelte +21 -16
- package/dist/views/core/input/components/textarea-field/textarea-field.svelte +17 -12
- package/dist/views/core/input/components/time-field/time-field.svelte +17 -12
- package/dist/views/core/navbar/components/navbar/navbar.svelte +76 -38
- package/dist/views/core/no-data/components/no-data/no-data.svelte +36 -19
- package/dist/views/core/pagination/components/pagination/pagination.svelte +90 -66
- package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +36 -22
- package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +5 -1
- package/dist/views/core/screen-detector/components/screen-detector.svelte +13 -9
- package/dist/views/core/sidebar/components/sidebar.svelte +36 -23
- package/dist/views/core/spinner/components/spinner/spinner.svelte +6 -1
- package/dist/views/core/text/components/text-await/text-await.svelte +9 -1
- package/dist/views/core/text/components/text-copy/text-copy.svelte +27 -16
- package/dist/views/core/text/components/text-currency/text-currency.svelte +13 -2
- package/dist/views/core/text/components/text-date/text-date.svelte +32 -20
- package/dist/views/core/text/components/text-email/text-email.svelte +12 -3
- package/dist/views/core/text/components/text-html/text-html.svelte +2 -1
- package/dist/views/core/text/components/text-phone/text-phone.svelte +12 -3
- package/dist/views/core/toast/components/toast/toast.svelte +43 -20
- package/dist/views/extra/fields/country-combobox-field.svelte +23 -15
- package/dist/views/extra/loaders/country-loader.svelte +33 -15
- package/dist/views/extra/texts/text-country-state.svelte +36 -28
- package/dist/views/extra/texts/text-country.svelte +16 -8
- package/package.json +3 -12
- package/readme.md +57 -2
- package/dist/tailwind.css +0 -1
- package/dist/theme.css +0 -27
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
$
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export function
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { dateFormat, toDate } from '../../../../../services';
|
|
3
|
+
import InputField, { type InputFieldProps } from '../input-field/input-field.svelte';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(null),
|
|
7
|
+
...props
|
|
8
|
+
}: InputFieldProps & { value?: Date | string | number | null | undefined } = $props();
|
|
9
|
+
|
|
10
|
+
let _value: string | undefined = $state(undefined);
|
|
11
|
+
|
|
12
|
+
$effect(() => {
|
|
13
|
+
if (value) {
|
|
14
|
+
_value = dateFormat(toDate(value)!, 'YYYY-MM-DD') as string;
|
|
15
|
+
console.log('_value', _value);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
let inputFieldRef: any | null = $state(null);
|
|
20
|
+
|
|
21
|
+
export function focus() {
|
|
22
|
+
inputFieldRef?.focus();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getElement() {
|
|
26
|
+
return inputFieldRef;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function select() {
|
|
30
|
+
inputFieldRef && inputFieldRef.select();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function handleInput(ev: Event) {
|
|
34
|
+
let target: HTMLInputElement = ev?.target as HTMLInputElement;
|
|
35
|
+
if (target?.value) {
|
|
36
|
+
value = toDate(target?.value) as Date;
|
|
37
|
+
console.log('handleInput value', value);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
</script>
|
|
32
41
|
|
|
33
42
|
<InputField bind:this={inputFieldRef} {...props} type="date" value={_value} onInput={handleInput} />
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputField, { type InputFieldProps } from '../input-field/input-field.svelte';
|
|
3
|
+
|
|
4
|
+
let { value = $bindable(), ...props }: InputFieldProps = $props();
|
|
5
|
+
|
|
6
|
+
let inputFieldRef: any | null = $state(null);
|
|
7
|
+
|
|
8
|
+
export function focus() {
|
|
9
|
+
inputFieldRef?.focus();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function getElement() {
|
|
13
|
+
return inputFieldRef;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function select() {
|
|
17
|
+
inputFieldRef && inputFieldRef.select();
|
|
18
|
+
}
|
|
13
19
|
</script>
|
|
14
20
|
|
|
15
21
|
<InputField bind:this={inputFieldRef} {...props} type="datetime-local" bind:value />
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputField, { type InputFieldProps } from '../input-field/input-field.svelte';
|
|
3
|
+
|
|
4
|
+
let { value = $bindable(''), ...props }: InputFieldProps = $props();
|
|
5
|
+
let inputFieldRef: any | null = $state(null);
|
|
6
|
+
|
|
7
|
+
export function focus() {
|
|
8
|
+
inputFieldRef?.focus();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getElement() {
|
|
12
|
+
return inputFieldRef;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function select() {
|
|
16
|
+
inputFieldRef && inputFieldRef.select();
|
|
17
|
+
}
|
|
13
18
|
</script>
|
|
14
19
|
|
|
15
20
|
<InputField
|
|
@@ -1,67 +1,81 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ripple } from '../../../../../actions';
|
|
3
|
+
import { openFilePickerDialog } from '../../../../../services';
|
|
4
|
+
import { mdiAttachment } from '../../../icon';
|
|
5
|
+
import Icon from '../../../icon/components/icon/icon.svelte';
|
|
6
|
+
import InputField, { type InputFieldProps } from '../input-field/input-field.svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
appearance,
|
|
10
|
+
size,
|
|
11
|
+
className,
|
|
12
|
+
accepts = '',
|
|
13
|
+
multiple = false,
|
|
14
|
+
value = $bindable(null),
|
|
15
|
+
...props
|
|
16
|
+
}: InputFieldProps & {
|
|
17
|
+
accepts?: string;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
value?: File | File[] | null;
|
|
20
|
+
} = $props();
|
|
21
|
+
|
|
22
|
+
let btnRoundedClassName = $state('');
|
|
23
|
+
let btnIconSizeClassName = $state('');
|
|
24
|
+
let fileNameDisplay = $state('');
|
|
25
|
+
|
|
26
|
+
let inputFieldRef: any | null = $state(null);
|
|
27
|
+
|
|
28
|
+
export function focus() {
|
|
29
|
+
inputFieldRef?.focus();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getElement() {
|
|
33
|
+
return inputFieldRef;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function select() {
|
|
37
|
+
inputFieldRef && inputFieldRef.select();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function handleFileAttachment<T extends File | File[]>() {
|
|
41
|
+
let res: File | File[] | null = null;
|
|
42
|
+
res = await openFilePickerDialog<T>(accepts, { multiple: multiple || false });
|
|
43
|
+
if (res) {
|
|
44
|
+
value = res;
|
|
45
|
+
if (multiple) {
|
|
46
|
+
let files: File[] = value as File[];
|
|
47
|
+
fileNameDisplay = files.map((file) => file.name).join(', ');
|
|
48
|
+
} else {
|
|
49
|
+
let file: File = value as File;
|
|
50
|
+
fileNameDisplay = file.name;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$effect(() => {
|
|
56
|
+
if (size) {
|
|
57
|
+
switch (size) {
|
|
58
|
+
case 'lg':
|
|
59
|
+
btnIconSizeClassName = '!h-7 !w-7';
|
|
60
|
+
break;
|
|
61
|
+
case 'md':
|
|
62
|
+
btnIconSizeClassName = '!h-6 !w-6';
|
|
63
|
+
break;
|
|
64
|
+
case 'sm':
|
|
65
|
+
btnIconSizeClassName = '!h-5 !w-5';
|
|
66
|
+
break;
|
|
67
|
+
case 'xs':
|
|
68
|
+
btnIconSizeClassName = '!h-4 !w-4';
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
$effect(() => {
|
|
75
|
+
if (!appearance || appearance == 'normal') {
|
|
76
|
+
btnRoundedClassName = 'rounded-tr-lg rounded-br-lg';
|
|
77
|
+
}
|
|
78
|
+
});
|
|
65
79
|
</script>
|
|
66
80
|
|
|
67
81
|
{#snippet fileButton()}
|