@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,103 +1,74 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
hasFirst = true;
|
|
73
|
-
hasPrev = true;
|
|
74
|
-
|
|
75
|
-
hasNext = true;
|
|
76
|
-
hasLast = true;
|
|
77
|
-
|
|
78
|
-
length = length || 0;
|
|
79
|
-
pageSize = pageSize || 10;
|
|
80
|
-
pageCount = Math.ceil(length / pageSize);
|
|
81
|
-
|
|
82
|
-
if (pageIndex <= 0) {
|
|
83
|
-
pageIndex = 0;
|
|
84
|
-
hasPrev = false;
|
|
85
|
-
hasFirst = false;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (pageCount && pageIndex >= pageCount - 1) {
|
|
89
|
-
pageIndex = pageCount - 1;
|
|
90
|
-
hasNext = false;
|
|
91
|
-
hasLast = false;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
onPageSizeChange && onPageSizeChange(pageSize);
|
|
95
|
-
onPageIndexChange && onPageIndexChange(pageIndex);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
$effect(() => {
|
|
99
|
-
BROWSER && preparePage(length, pageSize, pageIndex, pageCount);
|
|
100
|
-
});
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
import { ripple } from "../../../../../actions";
|
|
3
|
+
import ButtonDropdown from "../../../button/components/button-dropdown/button-dropdown.svelte";
|
|
4
|
+
import Button from "../../../button/components/button/button.svelte";
|
|
5
|
+
import { BROWSER } from "esm-env";
|
|
6
|
+
import { mdiChevronLeft, mdiChevronRight, mdiPageFirst, mdiPageLast } from "../../../icon";
|
|
7
|
+
let {
|
|
8
|
+
length = 0,
|
|
9
|
+
pageIndex = 0,
|
|
10
|
+
pageSize = 10,
|
|
11
|
+
pageSizeOptions = [5, 10, 25, 50, 100, 200],
|
|
12
|
+
itemsText = "Items",
|
|
13
|
+
pageSizeText = "Page Size",
|
|
14
|
+
pageText = "Page",
|
|
15
|
+
onPageSizeChange,
|
|
16
|
+
onPageIndexChange
|
|
17
|
+
} = $props();
|
|
18
|
+
let pageCount = $state(0);
|
|
19
|
+
let hasFirst = $state(true);
|
|
20
|
+
let hasLast = $state(true);
|
|
21
|
+
let hasNext = $state(true);
|
|
22
|
+
let hasPrev = $state(true);
|
|
23
|
+
const handlePageSize = (size) => {
|
|
24
|
+
pageSize = size;
|
|
25
|
+
};
|
|
26
|
+
const handlePage = (type) => {
|
|
27
|
+
let index = 0;
|
|
28
|
+
switch (type) {
|
|
29
|
+
case "first":
|
|
30
|
+
index = 0;
|
|
31
|
+
break;
|
|
32
|
+
case "last":
|
|
33
|
+
index = pageCount - 1;
|
|
34
|
+
break;
|
|
35
|
+
case "next":
|
|
36
|
+
index = pageIndex;
|
|
37
|
+
index++;
|
|
38
|
+
break;
|
|
39
|
+
case "prev":
|
|
40
|
+
index = pageIndex;
|
|
41
|
+
index--;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
if (index <= 0) index = 0;
|
|
45
|
+
if (index >= pageCount) index = pageCount - 1;
|
|
46
|
+
pageIndex = index;
|
|
47
|
+
};
|
|
48
|
+
function preparePage(..._) {
|
|
49
|
+
hasFirst = true;
|
|
50
|
+
hasPrev = true;
|
|
51
|
+
hasNext = true;
|
|
52
|
+
hasLast = true;
|
|
53
|
+
length = length || 0;
|
|
54
|
+
pageSize = pageSize || 10;
|
|
55
|
+
pageCount = Math.ceil(length / pageSize);
|
|
56
|
+
if (pageIndex <= 0) {
|
|
57
|
+
pageIndex = 0;
|
|
58
|
+
hasPrev = false;
|
|
59
|
+
hasFirst = false;
|
|
60
|
+
}
|
|
61
|
+
if (pageCount && pageIndex >= pageCount - 1) {
|
|
62
|
+
pageIndex = pageCount - 1;
|
|
63
|
+
hasNext = false;
|
|
64
|
+
hasLast = false;
|
|
65
|
+
}
|
|
66
|
+
onPageSizeChange && onPageSizeChange(pageSize);
|
|
67
|
+
onPageIndexChange && onPageIndexChange(pageIndex);
|
|
68
|
+
}
|
|
69
|
+
$effect(() => {
|
|
70
|
+
BROWSER && preparePage(length, pageSize, pageIndex, pageCount);
|
|
71
|
+
});
|
|
101
72
|
</script>
|
|
102
73
|
|
|
103
74
|
{#snippet pageButton({ onClick, disabled, icon }: any)}
|
|
@@ -114,7 +85,7 @@
|
|
|
114
85
|
<div class="flex items-center flex-nowrap gap-2">
|
|
115
86
|
<div>{pageSizeText}</div>
|
|
116
87
|
<div class="">
|
|
117
|
-
<
|
|
88
|
+
<ButtonDropdown
|
|
118
89
|
className="px-3 py-2 rounded hover:bg-gray-100 outline-none focus:bg-gray-200"
|
|
119
90
|
title={pageSize}
|
|
120
91
|
dropdownClassName="w-20"
|
|
@@ -130,7 +101,7 @@
|
|
|
130
101
|
</button>
|
|
131
102
|
</div>
|
|
132
103
|
{/each}
|
|
133
|
-
</
|
|
104
|
+
</ButtonDropdown>
|
|
134
105
|
</div>
|
|
135
106
|
<div class="text-gray-500">
|
|
136
107
|
<span>
|
|
@@ -1,40 +1,26 @@
|
|
|
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
|
-
if (!className) {
|
|
25
|
-
className = 'h-4';
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
$effect(() => {
|
|
30
|
-
if (value < 0) {
|
|
31
|
-
progressValue = 0;
|
|
32
|
-
} else if (value >= 100) {
|
|
33
|
-
progressValue = 100;
|
|
34
|
-
} else {
|
|
35
|
-
progressValue = value;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
let {
|
|
3
|
+
backgroundClassName = "",
|
|
4
|
+
className = "h-4",
|
|
5
|
+
value = 0,
|
|
6
|
+
showValue = false,
|
|
7
|
+
children
|
|
8
|
+
} = $props();
|
|
9
|
+
let progressValue = $state(0);
|
|
10
|
+
$effect(() => {
|
|
11
|
+
if (!className) {
|
|
12
|
+
className = "h-4";
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
$effect(() => {
|
|
16
|
+
if (value < 0) {
|
|
17
|
+
progressValue = 0;
|
|
18
|
+
} else if (value >= 100) {
|
|
19
|
+
progressValue = 100;
|
|
20
|
+
} else {
|
|
21
|
+
progressValue = value;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
38
24
|
</script>
|
|
39
25
|
|
|
40
26
|
<div class="w-full bg-gray-200 rounded-full progressbar-container {backgroundClassName}" style="">
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
type PropsType = {
|
|
4
|
-
className?: string;
|
|
5
|
-
};
|
|
6
|
-
let { className = '' }: PropsType = $props();
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
let { className = "" } = $props();
|
|
7
3
|
</script>
|
|
8
4
|
|
|
9
5
|
<div class="h-6 lg:w-px lg:bg-gray-200 {className}" aria-hidden="true"></div>
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
$effect(() => {
|
|
12
|
-
BROWSER && screenSizeChanged(innerWidth);
|
|
13
|
-
});
|
|
1
|
+
<script lang="ts">import { handleScreenSizeUpdate } from "../../../../services";
|
|
2
|
+
import { BROWSER } from "esm-env";
|
|
3
|
+
let innerWidth = $state(0);
|
|
4
|
+
function screenSizeChanged(size) {
|
|
5
|
+
handleScreenSizeUpdate(size);
|
|
6
|
+
}
|
|
7
|
+
$effect(() => {
|
|
8
|
+
BROWSER && screenSizeChanged(innerWidth);
|
|
9
|
+
});
|
|
14
10
|
</script>
|
|
15
11
|
|
|
16
12
|
<svelte:window bind:innerWidth />
|
|
@@ -1,39 +1,26 @@
|
|
|
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
|
-
return 'xs:fixed xs:inset-y-0 xs:flex xs:w-72 xs:flex-col';
|
|
25
|
-
case 'sm':
|
|
26
|
-
return 'sm:fixed sm:inset-y-0 sm:flex sm:w-72 sm:flex-col';
|
|
27
|
-
case 'md':
|
|
28
|
-
return 'md:fixed md:inset-y-0 md:flex md:w-72 md:flex-col';
|
|
29
|
-
case 'lg':
|
|
30
|
-
return 'lg:fixed lg:inset-y-0 lg:flex lg:w-72 lg:flex-col';
|
|
31
|
-
case 'xl':
|
|
32
|
-
return 'xl:fixed xl:inset-y-0 xl:flex xl:w-72 xl:flex-col';
|
|
33
|
-
case '2xl':
|
|
34
|
-
return '2xl:fixed 2xl:inset-y-0 2xl:flex 2xl:w-72 2xl:flex-col';
|
|
35
|
-
}
|
|
36
|
-
});
|
|
1
|
+
<script lang="ts">let {
|
|
2
|
+
children,
|
|
3
|
+
className,
|
|
4
|
+
id,
|
|
5
|
+
responsiveBreakpoint = "md",
|
|
6
|
+
position = "left"
|
|
7
|
+
} = $props();
|
|
8
|
+
let responsiveClassName = $derived.by(() => {
|
|
9
|
+
switch (responsiveBreakpoint) {
|
|
10
|
+
case "xs":
|
|
11
|
+
return "xs:fixed xs:inset-y-0 xs:flex xs:w-72 xs:flex-col";
|
|
12
|
+
case "sm":
|
|
13
|
+
return "sm:fixed sm:inset-y-0 sm:flex sm:w-72 sm:flex-col";
|
|
14
|
+
case "md":
|
|
15
|
+
return "md:fixed md:inset-y-0 md:flex md:w-72 md:flex-col";
|
|
16
|
+
case "lg":
|
|
17
|
+
return "lg:fixed lg:inset-y-0 lg:flex lg:w-72 lg:flex-col";
|
|
18
|
+
case "xl":
|
|
19
|
+
return "xl:fixed xl:inset-y-0 xl:flex xl:w-72 xl:flex-col";
|
|
20
|
+
case "2xl":
|
|
21
|
+
return "2xl:fixed 2xl:inset-y-0 2xl:flex 2xl:w-72 2xl:flex-col";
|
|
22
|
+
}
|
|
23
|
+
});
|
|
37
24
|
</script>
|
|
38
25
|
|
|
39
26
|
<div
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
type PropsType = {
|
|
4
|
-
className?: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
let { className = '' }: PropsType = $props();
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
let { className = "" } = $props();
|
|
8
3
|
</script>
|
|
9
4
|
|
|
10
5
|
<svg
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
type PropsType = {
|
|
4
|
-
input?: Promise<any | null> | undefined;
|
|
5
|
-
key?: string;
|
|
6
|
-
hasTitle?: string;
|
|
7
|
-
};
|
|
8
|
-
let { input, key, hasTitle }: PropsType = $props();
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
let { input, key, hasTitle } = $props();
|
|
9
3
|
</script>
|
|
10
4
|
|
|
11
5
|
{#if input}
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
buttonClassName = '',
|
|
19
|
-
iconClassName = '',
|
|
20
|
-
iconPath = mdiContentCopy
|
|
21
|
-
}: PropsType = $props();
|
|
22
|
-
|
|
23
|
-
function handleCopy() {
|
|
24
|
-
if (input) {
|
|
25
|
-
copyToClipboard(input);
|
|
26
|
-
showToast('Copied!');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
import Button from "../../../button/components/button/button.svelte";
|
|
3
|
+
import { copyToClipboard, showToast } from "../../../../../services/index.js";
|
|
4
|
+
import { mdiContentCopy } from "../../../icon";
|
|
5
|
+
let {
|
|
6
|
+
input,
|
|
7
|
+
containerClassName = "",
|
|
8
|
+
buttonClassName = "",
|
|
9
|
+
iconClassName = "",
|
|
10
|
+
iconPath = mdiContentCopy
|
|
11
|
+
} = $props();
|
|
12
|
+
function handleCopy() {
|
|
13
|
+
if (input) {
|
|
14
|
+
copyToClipboard(input);
|
|
15
|
+
showToast("Copied!");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
29
18
|
</script>
|
|
30
19
|
|
|
31
20
|
<span class="flex items-center {containerClassName}">
|
|
@@ -1,44 +1,32 @@
|
|
|
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
|
-
if (input) {
|
|
31
|
-
if (countries?.length) {
|
|
32
|
-
country = countries.find((o) => o.isoCode == input);
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
country = null;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
$effect(() => {
|
|
40
|
-
BROWSER && prepare(input, countries);
|
|
41
|
-
});
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
import EasyScriptLoader from "@cloudparker/easy-script-loader-svelte";
|
|
3
|
+
import { BROWSER } from "esm-env";
|
|
4
|
+
let { input } = $props();
|
|
5
|
+
let countries = $state([]);
|
|
6
|
+
let country = $state(null);
|
|
7
|
+
let EasyCountryData;
|
|
8
|
+
async function init() {
|
|
9
|
+
if (EasyCountryData) {
|
|
10
|
+
countries = EasyCountryData.getCountries();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function handleScriptLoad(lib) {
|
|
14
|
+
EasyCountryData = lib;
|
|
15
|
+
console.log("EasyCountryData", EasyCountryData);
|
|
16
|
+
init();
|
|
17
|
+
}
|
|
18
|
+
async function prepare(..._) {
|
|
19
|
+
if (input) {
|
|
20
|
+
if (countries?.length) {
|
|
21
|
+
country = countries.find((o) => o.isoCode == input);
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
country = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
$effect(() => {
|
|
28
|
+
BROWSER && prepare(input, countries);
|
|
29
|
+
});
|
|
42
30
|
</script>
|
|
43
31
|
|
|
44
32
|
<EasyScriptLoader
|
|
@@ -1,40 +1,32 @@
|
|
|
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
|
-
function handleScriptLoad(ev: CustomEvent) {
|
|
31
|
-
EasyCountryStateData = ev.detail;
|
|
32
|
-
init();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
$effect(() => {
|
|
36
|
-
BROWSER && prepare(input, states);
|
|
37
|
-
});
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
import EasyScriptLoader from "@cloudparker/easy-script-loader-svelte";
|
|
3
|
+
import { BROWSER } from "esm-env";
|
|
4
|
+
let { input } = $props();
|
|
5
|
+
let states = $state([]);
|
|
6
|
+
let state = $state(null);
|
|
7
|
+
let EasyCountryStateData;
|
|
8
|
+
async function init() {
|
|
9
|
+
if (EasyCountryStateData) {
|
|
10
|
+
states = EasyCountryStateData.getStates() || [];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function prepare(..._) {
|
|
14
|
+
if (input) {
|
|
15
|
+
await init();
|
|
16
|
+
if (states?.length) {
|
|
17
|
+
state = states.find((o) => o._id == input);
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
state = null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function handleScriptLoad(ev) {
|
|
24
|
+
EasyCountryStateData = ev.detail;
|
|
25
|
+
init();
|
|
26
|
+
}
|
|
27
|
+
$effect(() => {
|
|
28
|
+
BROWSER && prepare(input, states);
|
|
29
|
+
});
|
|
38
30
|
</script>
|
|
39
31
|
|
|
40
32
|
<EasyScriptLoader
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let { input, symbol = '$', hasSymbol = true }: PropsType = $props();
|
|
12
|
-
|
|
13
|
-
let value: string = $state('');
|
|
14
|
-
|
|
15
|
-
function prepare(..._: any) {
|
|
16
|
-
value = Math.abs(input || 0).toFixed(2);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
$effect(() => {
|
|
20
|
-
BROWSER && prepare(input);
|
|
21
|
-
});
|
|
1
|
+
<script lang="ts">import "../../../../../tailwind.css";
|
|
2
|
+
import { BROWSER } from "esm-env";
|
|
3
|
+
let { input, symbol = "$", hasSymbol = true } = $props();
|
|
4
|
+
let value = $state("");
|
|
5
|
+
function prepare(..._) {
|
|
6
|
+
value = Math.abs(input || 0).toFixed(2);
|
|
7
|
+
}
|
|
8
|
+
$effect(() => {
|
|
9
|
+
BROWSER && prepare(input);
|
|
10
|
+
});
|
|
22
11
|
</script>
|
|
23
12
|
|
|
24
13
|
<span>
|