@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,51 +1,62 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ripple } from '../../../../../actions';
|
|
3
|
+
import { mdiEyeOffOutline, mdiEyeOutline } from '../../../icon';
|
|
4
|
+
import Icon from '../../../icon/components/icon/icon.svelte';
|
|
5
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
type = 'password',
|
|
9
|
+
size,
|
|
10
|
+
appearance,
|
|
11
|
+
buttonClassName,
|
|
12
|
+
iconClassName,
|
|
13
|
+
...props
|
|
14
|
+
}: InputFieldPropsType & {
|
|
15
|
+
buttonClassName?: string;
|
|
16
|
+
iconClassName?: string;
|
|
17
|
+
} = $props();
|
|
18
|
+
|
|
19
|
+
let btnRoundedClassName = $state('');
|
|
20
|
+
let btnIconSizeClassName = $state('');
|
|
21
|
+
|
|
22
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
23
|
+
|
|
24
|
+
export function focus() {
|
|
25
|
+
inputFieldRef?.focus();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function handleTogglePassword() {
|
|
29
|
+
if (type == 'password') {
|
|
30
|
+
type = 'text';
|
|
31
|
+
} else {
|
|
32
|
+
type = 'password';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$effect(() => {
|
|
37
|
+
if (size) {
|
|
38
|
+
switch (size) {
|
|
39
|
+
case 'lg':
|
|
40
|
+
btnIconSizeClassName = '!h-7 !w-7';
|
|
41
|
+
break;
|
|
42
|
+
case 'md':
|
|
43
|
+
btnIconSizeClassName = '!h-6 !w-6';
|
|
44
|
+
break;
|
|
45
|
+
case 'sm':
|
|
46
|
+
btnIconSizeClassName = '!h-5 !w-5';
|
|
47
|
+
break;
|
|
48
|
+
case 'xs':
|
|
49
|
+
btnIconSizeClassName = '!h-4 !w-4';
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
$effect(() => {
|
|
56
|
+
if (!appearance || appearance == 'normal') {
|
|
57
|
+
btnRoundedClassName = 'rounded-tr-lg rounded-br-lg';
|
|
58
|
+
}
|
|
59
|
+
});
|
|
49
60
|
</script>
|
|
50
61
|
|
|
51
62
|
{#snippet showPasswordButton()}
|
|
@@ -1,51 +1,65 @@
|
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ripple } from '../../../../../actions';
|
|
3
|
+
import EasyScriptLoader from '@cloudparker/easy-script-loader-svelte';
|
|
4
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
5
|
+
import { isMobileScreen, openListPickerDialog } from '../../../../../services';
|
|
6
|
+
import type { DialogSizeType } from '../../../dialog';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
value,
|
|
10
|
+
size,
|
|
11
|
+
appearance,
|
|
12
|
+
buttonClassName,
|
|
13
|
+
className,
|
|
14
|
+
dialCode = $bindable('+1'),
|
|
15
|
+
...props
|
|
16
|
+
}: InputFieldPropsType & {
|
|
17
|
+
buttonClassName?: string;
|
|
18
|
+
dialCode?: string;
|
|
19
|
+
} = $props();
|
|
20
|
+
|
|
21
|
+
let btnRoundedClassName = $state('');
|
|
22
|
+
|
|
23
|
+
let EasyCountryData: any;
|
|
24
|
+
|
|
25
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
26
|
+
|
|
27
|
+
export function focus() {
|
|
28
|
+
inputFieldRef?.focus();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function hanleDialCodePicker() {
|
|
32
|
+
if (EasyCountryData) {
|
|
33
|
+
let items = EasyCountryData.getCountries();
|
|
34
|
+
// console.log('Countries', items);
|
|
35
|
+
let size: DialogSizeType = isMobileScreen() ? 'full' : 'sm';
|
|
36
|
+
let res: string = await openListPickerDialog<string>({
|
|
37
|
+
items,
|
|
38
|
+
itemTitle: 'dialCode',
|
|
39
|
+
itemSubtitle: 'name',
|
|
40
|
+
size,
|
|
41
|
+
hasCheck: true,
|
|
42
|
+
identity: 'dialCode'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
console.log(res);
|
|
46
|
+
if (res) {
|
|
47
|
+
dialCode = res;
|
|
48
|
+
inputFieldRef && inputFieldRef.focus();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function handleScriptLoad(lib: any) {
|
|
54
|
+
console.log(lib);
|
|
55
|
+
EasyCountryData = lib;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
$effect(() => {
|
|
59
|
+
if (!appearance || appearance == 'normal') {
|
|
60
|
+
btnRoundedClassName = 'rounded-tl-lg rounded-bl-lg';
|
|
61
|
+
}
|
|
62
|
+
});
|
|
49
63
|
</script>
|
|
50
64
|
|
|
51
65
|
{#snippet showPasswordButton()}
|
|
@@ -1,35 +1,54 @@
|
|
|
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
|
-
});
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputField, {
|
|
3
|
+
type InputFieldSizeType
|
|
4
|
+
} from '../input-field/input-field.svelte';
|
|
5
|
+
|
|
6
|
+
type RangeFieldPropsType = {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
size?: InputFieldSizeType;
|
|
11
|
+
value?: number;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
step?: number;
|
|
15
|
+
oninput?: (ev: any) => void;
|
|
16
|
+
onfocus?: (ev: any) => void;
|
|
17
|
+
onblur?: (ev: any) => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
id,
|
|
22
|
+
value = $bindable(50),
|
|
23
|
+
size = 'md',
|
|
24
|
+
min = 0,
|
|
25
|
+
max = 100,
|
|
26
|
+
name,
|
|
27
|
+
step,
|
|
28
|
+
className,
|
|
29
|
+
oninput,
|
|
30
|
+
onblur,
|
|
31
|
+
onfocus
|
|
32
|
+
}: RangeFieldPropsType = $props();
|
|
33
|
+
|
|
34
|
+
let rangeSizeClassName = $state('');
|
|
35
|
+
|
|
36
|
+
$effect(() => {
|
|
37
|
+
switch (size) {
|
|
38
|
+
case 'lg':
|
|
39
|
+
rangeSizeClassName = 'h-3 ';
|
|
40
|
+
break;
|
|
41
|
+
case 'md':
|
|
42
|
+
rangeSizeClassName = 'h-2 ';
|
|
43
|
+
break;
|
|
44
|
+
case 'sm':
|
|
45
|
+
rangeSizeClassName = 'h-1 ';
|
|
46
|
+
break;
|
|
47
|
+
case 'xs':
|
|
48
|
+
rangeSizeClassName = 'h-2-px ';
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
33
52
|
</script>
|
|
34
53
|
|
|
35
54
|
<input
|
|
@@ -1,41 +1,55 @@
|
|
|
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
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiMagnify } from '../../../icon';
|
|
3
|
+
import Icon from '../../../icon/components/icon/icon.svelte';
|
|
4
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
className,
|
|
8
|
+
placeholder,
|
|
9
|
+
iconClassName,
|
|
10
|
+
onSearch,
|
|
11
|
+
...props
|
|
12
|
+
}: InputFieldPropsType & { iconClassName?: string; onSearch?: (value: string) => void } =
|
|
13
|
+
$props();
|
|
14
|
+
|
|
15
|
+
const debouncedSearch = debounce(search, 300);
|
|
16
|
+
let lastQuery: string;
|
|
17
|
+
|
|
18
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
19
|
+
|
|
20
|
+
export function focus() {
|
|
21
|
+
inputFieldRef?.focus();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function handleInput(ev: any) {
|
|
25
|
+
// console.log(ev);
|
|
26
|
+
let input: HTMLInputElement = ev?.target;
|
|
27
|
+
if (input) {
|
|
28
|
+
let searchText = (input.value || '').toLowerCase().trim();
|
|
29
|
+
debouncedSearch(searchText);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function search(query: string) {
|
|
34
|
+
if (lastQuery != query) {
|
|
35
|
+
onSearch && onSearch(query);
|
|
36
|
+
lastQuery = query;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function debounce<T extends (...args: any[]) => void>(
|
|
41
|
+
func: T,
|
|
42
|
+
wait: number
|
|
43
|
+
): (...args: Parameters<T>) => void {
|
|
44
|
+
let timeout: ReturnType<typeof setTimeout>;
|
|
45
|
+
|
|
46
|
+
return function (...args: Parameters<T>) {
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
timeout = setTimeout(() => {
|
|
49
|
+
func(...args);
|
|
50
|
+
}, wait);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
39
53
|
</script>
|
|
40
54
|
|
|
41
55
|
{#snippet searchIcon()}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
3
|
+
|
|
4
|
+
let { maxlength, ...props }: InputFieldPropsType = $props();
|
|
5
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
6
|
+
|
|
7
|
+
export function focus() {
|
|
8
|
+
inputFieldRef?.focus();
|
|
9
|
+
}
|
|
7
10
|
</script>
|
|
8
11
|
|
|
9
12
|
<InputField bind:this={inputFieldRef} {...props} type="text" maxlength={maxlength || 200} />
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
3
|
+
|
|
4
|
+
let props: InputFieldPropsType = $props();
|
|
5
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
6
|
+
|
|
7
|
+
export function focus() {
|
|
8
|
+
inputFieldRef?.focus();
|
|
9
|
+
}
|
|
7
10
|
</script>
|
|
8
11
|
|
|
9
12
|
<InputField bind:this={inputFieldRef} {...props} type="textarea" maxlength={props?.maxlength || 200} />
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputField, { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
3
|
+
|
|
4
|
+
let props: InputFieldPropsType = $props();
|
|
5
|
+
let inputFieldRef: InputField | null = $state(null);
|
|
6
|
+
|
|
7
|
+
export function focus() {
|
|
8
|
+
inputFieldRef?.focus();
|
|
9
|
+
}
|
|
7
10
|
</script>
|
|
8
11
|
|
|
9
12
|
<InputField bind:this={inputFieldRef} {...props} type="time" />
|
|
@@ -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
|