@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,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
|
+
return inputFieldRef && inputFieldRef.select();
|
|
17
|
+
}
|
|
13
18
|
</script>
|
|
14
19
|
|
|
15
20
|
<InputField
|
|
@@ -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
|
+
return inputFieldRef && inputFieldRef.select();
|
|
17
|
+
}
|
|
13
18
|
</script>
|
|
14
19
|
|
|
15
20
|
<InputField bind:this={inputFieldRef} {...props} type="time" bind:value />
|
|
@@ -1,42 +1,80 @@
|
|
|
1
|
-
<script module lang="ts"
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export type NavbarProps = {
|
|
3
|
+
disabledLogo?: boolean;
|
|
4
|
+
backIconPath?: string;
|
|
5
|
+
backButtonClassName?: string;
|
|
6
|
+
centerContainerClassName?: string;
|
|
7
|
+
centerSnippet?: Snippet<[]>;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
className?: String;
|
|
10
|
+
drawerButtonClassName?: string;
|
|
11
|
+
hasBack?: boolean;
|
|
12
|
+
hasLogo?: boolean;
|
|
13
|
+
hasMore?: boolean;
|
|
14
|
+
hasSubtitle?: boolean;
|
|
15
|
+
hasTitle?: boolean;
|
|
16
|
+
id?: string;
|
|
17
|
+
leftContainerClassName?: string;
|
|
18
|
+
leftSnippet?: Snippet<[]>;
|
|
19
|
+
logoButtonClassName?: string;
|
|
20
|
+
logoIconClassName?: string;
|
|
21
|
+
logoIconPath?: string;
|
|
22
|
+
logoImgClassName?: string;
|
|
23
|
+
logoImgSrc?: string;
|
|
24
|
+
moreIconPath?: string;
|
|
25
|
+
morePosition?: 'left' | 'right';
|
|
26
|
+
onLogo?: () => void;
|
|
27
|
+
onMore?: () => void;
|
|
28
|
+
onBack?: () => void;
|
|
29
|
+
rightContainerClassName?: string;
|
|
30
|
+
rightSnippet?: Snippet<[]>;
|
|
31
|
+
subtitle?: string;
|
|
32
|
+
subtitleClassName?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
titleClassName?: string;
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
import ButtonBack from '../../../button/components/button-back/button-back.svelte';
|
|
40
|
+
import Button from '../../../button/components/button/button.svelte';
|
|
41
|
+
import { Icon, mdiMenu } from '../../../icon';
|
|
42
|
+
import type { Snippet } from 'svelte';
|
|
2
43
|
|
|
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
|
-
title = "",
|
|
38
|
-
titleClassName = ""
|
|
39
|
-
} = $props();
|
|
44
|
+
let {
|
|
45
|
+
disabledLogo,
|
|
46
|
+
backButtonClassName,
|
|
47
|
+
backIconPath,
|
|
48
|
+
centerContainerClassName = '',
|
|
49
|
+
centerSnippet,
|
|
50
|
+
children,
|
|
51
|
+
className = '',
|
|
52
|
+
drawerButtonClassName = '',
|
|
53
|
+
hasBack = false,
|
|
54
|
+
hasLogo = false,
|
|
55
|
+
hasMore = false,
|
|
56
|
+
hasSubtitle = false,
|
|
57
|
+
hasTitle = false,
|
|
58
|
+
id = '',
|
|
59
|
+
leftContainerClassName = '',
|
|
60
|
+
leftSnippet,
|
|
61
|
+
logoButtonClassName = '',
|
|
62
|
+
logoIconClassName = 'text-indigo-600',
|
|
63
|
+
logoIconPath,
|
|
64
|
+
logoImgClassName = '',
|
|
65
|
+
logoImgSrc,
|
|
66
|
+
moreIconPath = mdiMenu,
|
|
67
|
+
morePosition = 'left',
|
|
68
|
+
onLogo,
|
|
69
|
+
onMore,
|
|
70
|
+
onBack,
|
|
71
|
+
rightContainerClassName = '',
|
|
72
|
+
rightSnippet,
|
|
73
|
+
subtitle = '',
|
|
74
|
+
subtitleClassName = '',
|
|
75
|
+
title = '',
|
|
76
|
+
titleClassName = ''
|
|
77
|
+
}: NavbarProps = $props();
|
|
40
78
|
</script>
|
|
41
79
|
|
|
42
80
|
<nav
|
|
@@ -1,22 +1,39 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Icon from '../../../icon/components/icon/icon.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type PlacementType = 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
|
|
7
|
+
type PropsType = {
|
|
8
|
+
message?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
iconPath?: string;
|
|
11
|
+
iconClassName?: string;
|
|
12
|
+
iconPlacement?: PlacementType;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
message = 'No data found!',
|
|
18
|
+
className = '',
|
|
19
|
+
iconPath = '',
|
|
20
|
+
iconClassName = '',
|
|
21
|
+
iconPlacement = 'top',
|
|
22
|
+
children
|
|
23
|
+
}: PropsType = $props();
|
|
24
|
+
|
|
25
|
+
const iconPlacementClassNameMap: any = {
|
|
26
|
+
top: 'flex-col',
|
|
27
|
+
bottom: 'flex-col-reverse',
|
|
28
|
+
left: 'flex-row',
|
|
29
|
+
right: 'flex-row-reverse'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
let iconPlacementClassName: string = $state('');
|
|
33
|
+
|
|
34
|
+
$effect(() => {
|
|
35
|
+
iconPlacementClassName = iconPlacementClassNameMap[iconPlacement];
|
|
36
|
+
});
|
|
20
37
|
</script>
|
|
21
38
|
|
|
22
39
|
<div
|
|
@@ -1,69 +1,93 @@
|
|
|
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
|
-
let
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ButtonMenu from '../../../button/components/button-menu/button-menu.svelte';
|
|
3
|
+
import Button from '../../../button/components/button/button.svelte';
|
|
4
|
+
import {
|
|
5
|
+
mdiChevronDown,
|
|
6
|
+
mdiChevronLeft,
|
|
7
|
+
mdiChevronRight,
|
|
8
|
+
mdiPageFirst,
|
|
9
|
+
mdiPageLast
|
|
10
|
+
} from '../../../icon';
|
|
11
|
+
|
|
12
|
+
type PropsType = {
|
|
13
|
+
itemsCount?: number;
|
|
14
|
+
pageIndex?: number;
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
pageSizeOptions?: number[];
|
|
17
|
+
itemsText?: string;
|
|
18
|
+
pageSizeText?: string;
|
|
19
|
+
pageText?: string;
|
|
20
|
+
dropPosition?: 'top' | 'bottom' | 'middle' | undefined;
|
|
21
|
+
disableSizeMenuButton?: boolean;
|
|
22
|
+
onPageSizeChange?: (size: number) => void;
|
|
23
|
+
onPageIndexChange?: (index: number) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
let {
|
|
27
|
+
itemsCount = $bindable(0),
|
|
28
|
+
pageIndex = $bindable(0),
|
|
29
|
+
pageSize = $bindable(10),
|
|
30
|
+
pageSizeOptions = [5, 10, 25, 50, 100, 200],
|
|
31
|
+
itemsText = 'Items',
|
|
32
|
+
pageSizeText = 'Page Size',
|
|
33
|
+
pageText = 'Page',
|
|
34
|
+
dropPosition = 'bottom',
|
|
35
|
+
disableSizeMenuButton,
|
|
36
|
+
onPageSizeChange,
|
|
37
|
+
onPageIndexChange
|
|
38
|
+
}: PropsType = $props();
|
|
39
|
+
|
|
40
|
+
let pageCount: number = $derived(Math.ceil(itemsCount / pageSize));
|
|
41
|
+
|
|
42
|
+
let hasFirst: boolean = $derived(pageIndex > 0);
|
|
43
|
+
let hasPrev: boolean = $derived(pageIndex > 0);
|
|
44
|
+
|
|
45
|
+
let hasLast: boolean = $derived(pageIndex < pageCount - 1);
|
|
46
|
+
let hasNext: boolean = $derived(pageIndex < pageCount - 1);
|
|
47
|
+
|
|
48
|
+
const handlePageSize = (size: any) => {
|
|
49
|
+
pageIndex = 0;
|
|
50
|
+
if (pageSize != size) {
|
|
51
|
+
pageSize = size;
|
|
52
|
+
onPageSizeChange?.(pageSize);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handlePage = (type?: string) => {
|
|
57
|
+
// console.log('handlePage');
|
|
58
|
+
let index = 0;
|
|
59
|
+
switch (type) {
|
|
60
|
+
case 'first':
|
|
61
|
+
index = 0;
|
|
62
|
+
break;
|
|
63
|
+
case 'last':
|
|
64
|
+
index = pageCount - 1;
|
|
65
|
+
break;
|
|
66
|
+
case 'next':
|
|
67
|
+
index = pageIndex;
|
|
68
|
+
index++;
|
|
69
|
+
break;
|
|
70
|
+
case 'prev':
|
|
71
|
+
index = pageIndex;
|
|
72
|
+
index--;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (index <= 0) index = 0;
|
|
77
|
+
if (index >= pageCount) index = pageCount - 1;
|
|
78
|
+
|
|
79
|
+
if (pageIndex != index) {
|
|
80
|
+
pageIndex = index;
|
|
81
|
+
onPageIndexChange?.(pageIndex);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
function handlePageSizeMenu(ev: Event, menu: string) {
|
|
86
|
+
try {
|
|
87
|
+
let size = parseInt(menu);
|
|
88
|
+
handlePageSize(size);
|
|
89
|
+
} catch (error) {}
|
|
90
|
+
}
|
|
67
91
|
</script>
|
|
68
92
|
|
|
69
93
|
{#snippet pageButton({ onClick, disabled, icon }: any)}
|
|
@@ -1,25 +1,39 @@
|
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type PropsType = {
|
|
5
|
+
className?: string;
|
|
6
|
+
backgroundClassName?: string;
|
|
7
|
+
value?: number;
|
|
8
|
+
showValue?: boolean;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
backgroundClassName = '',
|
|
14
|
+
className = 'h-4',
|
|
15
|
+
value = 0,
|
|
16
|
+
showValue = false,
|
|
17
|
+
children
|
|
18
|
+
}: PropsType = $props();
|
|
19
|
+
|
|
20
|
+
let progressValue: number = $state(0);
|
|
21
|
+
|
|
22
|
+
$effect(() => {
|
|
23
|
+
if (!className) {
|
|
24
|
+
className = 'h-4';
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
$effect(() => {
|
|
29
|
+
if (value < 0) {
|
|
30
|
+
progressValue = 0;
|
|
31
|
+
} else if (value >= 100) {
|
|
32
|
+
progressValue = 100;
|
|
33
|
+
} else {
|
|
34
|
+
progressValue = value;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
23
37
|
</script>
|
|
24
38
|
|
|
25
39
|
<div class="w-full bg-gray-200 rounded-full progressbar-container {backgroundClassName}" style="">
|
|
@@ -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,26 +1,39 @@
|
|
|
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 type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type BreakpointType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
|
|
6
|
+
type PropsType = {
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
className?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
responsiveBreakpoint?: BreakpointType;
|
|
11
|
+
position?: 'left' | 'right';
|
|
12
|
+
};
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
id,
|
|
17
|
+
responsiveBreakpoint = 'md',
|
|
18
|
+
position = 'left'
|
|
19
|
+
}: PropsType = $props();
|
|
20
|
+
|
|
21
|
+
let responsiveClassName = $derived.by(() => {
|
|
22
|
+
switch (responsiveBreakpoint) {
|
|
23
|
+
case 'xs':
|
|
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
|
+
});
|
|
24
37
|
</script>
|
|
25
38
|
|
|
26
39
|
<div
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
type PropsType = {
|
|
3
|
+
input?: Promise<any | null> | undefined;
|
|
4
|
+
key?: string;
|
|
5
|
+
hasTitle?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
emptyText?: string;
|
|
8
|
+
};
|
|
9
|
+
let { input, key, hasTitle, placeholder, emptyText = '-' }: PropsType = $props();
|
|
2
10
|
</script>
|
|
3
11
|
|
|
4
12
|
{#if input}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from '../../../button/components/button/button.svelte';
|
|
3
|
+
import { copyToClipboard, showToast } from '../../../../../services/index.js';
|
|
4
|
+
import { mdiContentCopy } from '../../../icon';
|
|
5
|
+
|
|
6
|
+
type PropsType = {
|
|
7
|
+
input: string;
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
buttonClassName?: string;
|
|
10
|
+
iconClassName?: string;
|
|
11
|
+
iconPath?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
input,
|
|
16
|
+
containerClassName = '',
|
|
17
|
+
buttonClassName = '',
|
|
18
|
+
iconClassName = '',
|
|
19
|
+
iconPath = mdiContentCopy
|
|
20
|
+
}: PropsType = $props();
|
|
21
|
+
|
|
22
|
+
function handleCopy() {
|
|
23
|
+
if (input) {
|
|
24
|
+
copyToClipboard(input);
|
|
25
|
+
showToast('Copied!');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
17
28
|
</script>
|
|
18
29
|
|
|
19
30
|
<span class="flex items-center {containerClassName}">
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CurrencySymbols } from '../../../../../services';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
input: number;
|
|
6
|
+
symbol?: CurrencySymbols | string;
|
|
7
|
+
hasSymbol?: boolean;
|
|
8
|
+
empty?: string;
|
|
9
|
+
decimal?: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let { input, symbol = '$', hasSymbol = true, empty = '-', decimal = 2 }: Props = $props();
|
|
13
|
+
let value: string = $derived(Math.abs(input || 0).toFixed(decimal));
|
|
3
14
|
</script>
|
|
4
15
|
|
|
5
16
|
<span class="text-nowrap">
|