@cloudparker/moldex.js 0.0.29 → 0.0.31
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/tailwind.css +1 -1
- 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/combobox-field/combobox-field.svelte.d.ts +1 -1
- 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/radio-field/radio-field.svelte +120 -0
- package/dist/views/core/input/components/radio-field/radio-field.svelte.d.ts +45 -0
- 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/input/index.d.ts +4 -2
- package/dist/views/core/input/index.js +2 -2
- 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/no-data/components/no-data/no-data.svelte.d.ts +1 -1
- 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
|
@@ -10,10 +10,10 @@ import Label from "./components/label/label.svelte";
|
|
|
10
10
|
import NumberField from "./components/number-field/number-field.svelte";
|
|
11
11
|
import PasswordField from "./components/password-field/password-field.svelte";
|
|
12
12
|
import PhoneField from "./components/phone-field/phone-field.svelte";
|
|
13
|
+
import RadioField from "./components/radio-field/radio-field.svelte";
|
|
13
14
|
import RangeField from "./components/range-field/range-field.svelte";
|
|
14
15
|
import SearchField from "./components/search-field/search-field.svelte";
|
|
15
16
|
import TextField from "./components/text-field/text-field.svelte";
|
|
16
17
|
import TextareaField from "./components/textarea-field/textarea-field.svelte";
|
|
17
18
|
import TimeField from "./components/time-field/time-field.svelte";
|
|
18
|
-
export {};
|
|
19
|
-
export { ColorField, ComboboxField, DateField, DatetimeField, EmailField, FileField, InputField, Label, NumberField, PasswordField, PhoneField, RangeField, SearchField, TextareaField, TextField, TimeField };
|
|
19
|
+
export { ColorField, ComboboxField, DateField, DatetimeField, EmailField, FileField, InputField, Label, NumberField, PasswordField, PhoneField, RadioField, RangeField, SearchField, TextareaField, TextField, TimeField };
|
|
@@ -1,34 +1,66 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import Button from '../../../button/components/button/button.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import { Icon, mdiMenu } from '../../../icon';
|
|
6
|
+
|
|
7
|
+
type PropsType = {
|
|
8
|
+
id?: string;
|
|
9
|
+
className?: String;
|
|
10
|
+
hasDrawer?: boolean;
|
|
11
|
+
drawerIconPath?: string;
|
|
12
|
+
drawerButtonClassName?: string;
|
|
13
|
+
logoButtonClassName?: string;
|
|
14
|
+
hasLogo?: boolean;
|
|
15
|
+
logoIconPath?: string;
|
|
16
|
+
logoIconClassName?: string;
|
|
17
|
+
logoImgSrc?: string;
|
|
18
|
+
logoImgClassName?: string;
|
|
19
|
+
leftContainerClassName?: string;
|
|
20
|
+
centerContainerClassName?: string;
|
|
21
|
+
rightContainerClassName?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
titleClassName?: string;
|
|
25
|
+
subtitleClassName?: string;
|
|
26
|
+
hasTitle?: boolean;
|
|
27
|
+
hasSubtitle?: boolean;
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
leftSnippet?: Snippet;
|
|
30
|
+
centerSnippet?: Snippet;
|
|
31
|
+
rightSnippet?: Snippet;
|
|
32
|
+
ondrawer?: () => void;
|
|
33
|
+
onlogo?: () => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
let {
|
|
37
|
+
id = '',
|
|
38
|
+
children,
|
|
39
|
+
leftSnippet,
|
|
40
|
+
centerSnippet,
|
|
41
|
+
rightSnippet,
|
|
42
|
+
className = '',
|
|
43
|
+
drawerIconPath = mdiMenu,
|
|
44
|
+
drawerButtonClassName = '',
|
|
45
|
+
hasDrawer = false,
|
|
46
|
+
hasLogo = false,
|
|
47
|
+
logoButtonClassName = '',
|
|
48
|
+
logoIconPath,
|
|
49
|
+
logoIconClassName = 'text-indigo-600',
|
|
50
|
+
logoImgSrc,
|
|
51
|
+
logoImgClassName = '',
|
|
52
|
+
leftContainerClassName = '',
|
|
53
|
+
centerContainerClassName = '',
|
|
54
|
+
rightContainerClassName = '',
|
|
55
|
+
title = '',
|
|
56
|
+
subtitle = '',
|
|
57
|
+
titleClassName = '',
|
|
58
|
+
subtitleClassName = '',
|
|
59
|
+
hasTitle = false,
|
|
60
|
+
hasSubtitle = false,
|
|
61
|
+
ondrawer,
|
|
62
|
+
onlogo
|
|
63
|
+
}: PropsType = $props();
|
|
32
64
|
</script>
|
|
33
65
|
|
|
34
66
|
<div
|
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Icon from '../../../icon/components/icon/icon.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import '../../../../../tailwind.css';
|
|
5
|
+
|
|
6
|
+
type PlacementType = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
|
|
8
|
+
type PropsType = {
|
|
9
|
+
message?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
iconPath?: string;
|
|
12
|
+
iconClassName?: string;
|
|
13
|
+
iconPlacement?: PlacementType;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
message = 'No data found!',
|
|
19
|
+
className = '',
|
|
20
|
+
iconPath = '',
|
|
21
|
+
iconClassName = '',
|
|
22
|
+
iconPlacement = 'top',
|
|
23
|
+
children
|
|
24
|
+
}: PropsType = $props();
|
|
25
|
+
|
|
26
|
+
const iconPlacementClassNameMap: any = {
|
|
27
|
+
top: 'flex-col',
|
|
28
|
+
bottom: 'flex-col-reverse',
|
|
29
|
+
left: 'flex-row',
|
|
30
|
+
right: 'flex-row-reverse'
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
let iconPlacementClassName: string = $state('');
|
|
34
|
+
|
|
35
|
+
$effect(() => {
|
|
36
|
+
iconPlacementClassName = iconPlacementClassNameMap[iconPlacement];
|
|
37
|
+
});
|
|
21
38
|
</script>
|
|
22
39
|
|
|
23
40
|
<div
|
|
@@ -18,7 +18,7 @@ declare const NoData: $$__sveltets_2_IsomorphicComponent<{
|
|
|
18
18
|
className?: string;
|
|
19
19
|
iconPath?: string;
|
|
20
20
|
iconClassName?: string;
|
|
21
|
-
iconPlacement?: "
|
|
21
|
+
iconPlacement?: "left" | "right" | "top" | "bottom";
|
|
22
22
|
children?: Snippet;
|
|
23
23
|
}, {
|
|
24
24
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,74 +1,103 @@
|
|
|
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
|
-
let
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import { ripple } from '../../../../../actions';
|
|
4
|
+
import ButtonMenu from '../../../button/components/button-menu/button-menu.svelte';
|
|
5
|
+
import Button from '../../../button/components/button/button.svelte';
|
|
6
|
+
import { BROWSER } from 'esm-env';
|
|
7
|
+
import { mdiChevronLeft, mdiChevronRight, mdiPageFirst, mdiPageLast } from '../../../icon';
|
|
8
|
+
|
|
9
|
+
type PropsType = {
|
|
10
|
+
length?: number;
|
|
11
|
+
pageIndex?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
pageSizeOptions?: number[];
|
|
14
|
+
itemsText?: string;
|
|
15
|
+
pageSizeText?: string;
|
|
16
|
+
pageText?: string;
|
|
17
|
+
onPageSizeChange?: (size: number) => void;
|
|
18
|
+
onPageIndexChange?: (index: number) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
length = 0,
|
|
23
|
+
pageIndex = 0,
|
|
24
|
+
pageSize = 10,
|
|
25
|
+
pageSizeOptions = [5, 10, 25, 50, 100, 200],
|
|
26
|
+
itemsText = 'Items',
|
|
27
|
+
pageSizeText = 'Page Size',
|
|
28
|
+
pageText = 'Page',
|
|
29
|
+
onPageSizeChange,
|
|
30
|
+
onPageIndexChange
|
|
31
|
+
}: PropsType = $props();
|
|
32
|
+
|
|
33
|
+
let pageCount: number = $state(0);
|
|
34
|
+
|
|
35
|
+
let hasFirst: boolean = $state(true);
|
|
36
|
+
let hasLast: boolean = $state(true);
|
|
37
|
+
let hasNext: boolean = $state(true);
|
|
38
|
+
let hasPrev: boolean = $state(true);
|
|
39
|
+
|
|
40
|
+
const handlePageSize = (size: any) => {
|
|
41
|
+
// console.log('handlePageSize', size);
|
|
42
|
+
pageSize = size;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handlePage = (type?: string) => {
|
|
46
|
+
// console.log('handlePage');
|
|
47
|
+
let index = 0;
|
|
48
|
+
switch (type) {
|
|
49
|
+
case 'first':
|
|
50
|
+
index = 0;
|
|
51
|
+
break;
|
|
52
|
+
case 'last':
|
|
53
|
+
index = pageCount - 1;
|
|
54
|
+
break;
|
|
55
|
+
case 'next':
|
|
56
|
+
index = pageIndex;
|
|
57
|
+
index++;
|
|
58
|
+
break;
|
|
59
|
+
case 'prev':
|
|
60
|
+
index = pageIndex;
|
|
61
|
+
index--;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
if (index <= 0) index = 0;
|
|
65
|
+
if (index >= pageCount) index = pageCount - 1;
|
|
66
|
+
|
|
67
|
+
pageIndex = index;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
function preparePage(..._: any) {
|
|
71
|
+
// console.log('preparePage');
|
|
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
|
+
});
|
|
72
101
|
</script>
|
|
73
102
|
|
|
74
103
|
{#snippet pageButton({ onclick, disabled, icon }: any)}
|
|
@@ -1,26 +1,40 @@
|
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type PropsType = {
|
|
6
|
+
className?: string;
|
|
7
|
+
backgroundClassName?: string;
|
|
8
|
+
value?: number;
|
|
9
|
+
showValue?: boolean;
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
backgroundClassName = '',
|
|
15
|
+
className = 'h-4',
|
|
16
|
+
value = 0,
|
|
17
|
+
showValue = false,
|
|
18
|
+
children
|
|
19
|
+
}: PropsType = $props();
|
|
20
|
+
|
|
21
|
+
let progressValue: number = $state(0);
|
|
22
|
+
|
|
23
|
+
$effect(() => {
|
|
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
|
+
});
|
|
24
38
|
</script>
|
|
25
39
|
|
|
26
40
|
<div class="w-full bg-gray-200 rounded-full progressbar-container {backgroundClassName}" style="">
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '$app/stores';
|
|
3
|
+
import { referrer } from '../../../../services/navigation/navigation-service';
|
|
4
|
+
import { BROWSER } from 'esm-env';
|
|
5
|
+
|
|
6
|
+
$effect(() => {
|
|
7
|
+
if (BROWSER) {
|
|
8
|
+
const unsubscribe = page.subscribe((_) => {
|
|
9
|
+
referrer.referer = referrer.referer === location.href ? referrer.referer : location.href;
|
|
10
|
+
});
|
|
11
|
+
return () => {
|
|
12
|
+
unsubscribe && unsubscribe();
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
});
|
|
14
16
|
</script>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
type PropsType = {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
let { className = '' }: PropsType = $props();
|
|
3
7
|
</script>
|
|
4
8
|
|
|
5
9
|
<div class="h-6 lg:w-px lg:bg-gray-200 {className}" aria-hidden="true"></div>
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { handleScreenSizeUpdate } from '../../../../services';
|
|
3
|
+
import { BROWSER } from 'esm-env';
|
|
4
|
+
|
|
5
|
+
let innerWidth: number = $state(0);
|
|
6
|
+
|
|
7
|
+
function screenSizeChanged(size: number) {
|
|
8
|
+
handleScreenSizeUpdate(size);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
$effect(() => {
|
|
12
|
+
BROWSER && screenSizeChanged(innerWidth);
|
|
13
|
+
});
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
<svelte:window bind:innerWidth />
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
type PropsType = {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
let { className = '' }: PropsType = $props();
|
|
3
8
|
</script>
|
|
4
9
|
|
|
5
10
|
<svg
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
type PropsType = {
|
|
4
|
+
input?: Promise<any | null> | undefined;
|
|
5
|
+
key?: string;
|
|
6
|
+
hasTitle?: string;
|
|
7
|
+
};
|
|
8
|
+
let { input, key, hasTitle }: PropsType = $props();
|
|
3
9
|
</script>
|
|
4
10
|
|
|
5
11
|
{#if input}
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import Button from '../../../button/components/button/button.svelte';
|
|
4
|
+
import { copyText, showToast } from '../../../../../services/index.js';
|
|
5
|
+
import { mdiContentCopy } from '../../../icon';
|
|
6
|
+
|
|
7
|
+
type PropsType = {
|
|
8
|
+
input: string;
|
|
9
|
+
containerClassName?: string;
|
|
10
|
+
buttonClassName?: string;
|
|
11
|
+
iconClassName?: string;
|
|
12
|
+
iconPath?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
input,
|
|
17
|
+
containerClassName = '',
|
|
18
|
+
buttonClassName = '',
|
|
19
|
+
iconClassName = '',
|
|
20
|
+
iconPath = mdiContentCopy
|
|
21
|
+
}: PropsType = $props();
|
|
22
|
+
|
|
23
|
+
function handleCopy() {
|
|
24
|
+
if (input) {
|
|
25
|
+
copyText(input);
|
|
26
|
+
showToast('Copied!');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
18
29
|
</script>
|
|
19
30
|
|
|
20
31
|
<span class="flex items-center {containerClassName}">
|
|
@@ -1,32 +1,44 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import EasyScriptLoader from '@cloudparker/easy-script-loader-svelte';
|
|
4
|
+
import { BROWSER } from 'esm-env';
|
|
5
|
+
|
|
6
|
+
type PropsType = {
|
|
7
|
+
input?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
let { input }: PropsType = $props();
|
|
11
|
+
|
|
12
|
+
let countries: any[] = $state([]);
|
|
13
|
+
let country: any | null = $state(null);
|
|
14
|
+
|
|
15
|
+
let EasyCountryData: any;
|
|
16
|
+
|
|
17
|
+
async function init() {
|
|
18
|
+
if (EasyCountryData) {
|
|
19
|
+
countries = EasyCountryData.getCountries();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function handleScriptLoad(lib: CustomEvent) {
|
|
24
|
+
EasyCountryData = lib;
|
|
25
|
+
console.log('EasyCountryData', EasyCountryData);
|
|
26
|
+
init();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function prepare(..._: any) {
|
|
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
|
+
});
|
|
30
42
|
</script>
|
|
31
43
|
|
|
32
44
|
<EasyScriptLoader
|