@cloudparker/moldex.js 0.0.29 → 0.0.30
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/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/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/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/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/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
|
@@ -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
|
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async function
|
|
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
|
+
let { input }: { input: string } = $props();
|
|
7
|
+
|
|
8
|
+
let states: any[] = $state([]);
|
|
9
|
+
let state: any | null = $state(null);
|
|
10
|
+
|
|
11
|
+
let EasyCountryStateData: any;
|
|
12
|
+
|
|
13
|
+
async function init() {
|
|
14
|
+
if (EasyCountryStateData) {
|
|
15
|
+
states = EasyCountryStateData.getStates() || [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function prepare(..._: any) {
|
|
20
|
+
if (input) {
|
|
21
|
+
await init();
|
|
22
|
+
if (states?.length) {
|
|
23
|
+
state = states.find((o) => o._id == input);
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
state = null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function handleScriptLoad(ev: CustomEvent) {
|
|
31
|
+
EasyCountryStateData = ev.detail;
|
|
32
|
+
init();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
$effect(() => {
|
|
36
|
+
BROWSER && prepare(input, states);
|
|
37
|
+
});
|
|
30
38
|
</script>
|
|
31
39
|
|
|
32
40
|
<EasyScriptLoader
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import { BROWSER } from 'esm-env';
|
|
4
|
+
|
|
5
|
+
type PropsType = {
|
|
6
|
+
input: number;
|
|
7
|
+
symbol: string;
|
|
8
|
+
hasSymbol: boolean;
|
|
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
|
+
});
|
|
11
22
|
</script>
|
|
12
23
|
|
|
13
24
|
<span>
|
|
@@ -1,24 +1,36 @@
|
|
|
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
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import { dateFormat, dateToAgo, toDate } from '../../../../../services';
|
|
4
|
+
|
|
5
|
+
import { BROWSER } from 'esm-env';
|
|
6
|
+
|
|
7
|
+
type PropsType = {
|
|
8
|
+
input: Date | number | string | { seconds: number; nanoseconds: number };
|
|
9
|
+
format?: 'ago' | string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let { input, format = 'DD-MM-YYYY hh:mm a' }: PropsType = $props();
|
|
13
|
+
|
|
14
|
+
let dateString: string = $state('');
|
|
15
|
+
|
|
16
|
+
function prepareDate(..._: any) {
|
|
17
|
+
// console.log('date data', data);
|
|
18
|
+
let date: Date | undefined;
|
|
19
|
+
if (input) {
|
|
20
|
+
date = toDate(input);
|
|
21
|
+
}
|
|
22
|
+
if (date) {
|
|
23
|
+
if (format == 'ago') {
|
|
24
|
+
dateString = dateToAgo(date)!;
|
|
25
|
+
} else {
|
|
26
|
+
dateString = dateFormat(date, format)!;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
$effect(() => {
|
|
32
|
+
BROWSER && prepareDate(input);
|
|
33
|
+
});
|
|
22
34
|
</script>
|
|
23
35
|
|
|
24
36
|
<span>
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../../../../../tailwind.css';
|
|
3
|
+
import { ripple } from '../../../../../actions';
|
|
4
|
+
import { Icon, mdiEmailOutline } from '../../../icon';
|
|
5
|
+
|
|
6
|
+
type PropsType = {
|
|
7
|
+
input: string;
|
|
8
|
+
buttonClassName?: string;
|
|
9
|
+
iconPath?: string;
|
|
10
|
+
iconClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let { input, buttonClassName, iconClassName, iconPath = mdiEmailOutline }: PropsType = $props();
|
|
5
14
|
</script>
|
|
6
15
|
|
|
7
16
|
<span class="flex items-center">
|