@cloudparker/moldex.js 0.0.42 → 0.0.44
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 +55 -21
- package/dist/views/core/button/components/button/button.svelte.d.ts +7 -2
- package/dist/views/core/button/components/button-back/button-back.svelte +7 -2
- package/dist/views/core/button/components/button-back/button-back.svelte.d.ts +1 -0
- package/dist/views/core/button/components/button-close/button-close.svelte +1 -1
- package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +3 -2
- package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte.d.ts +1 -1
- package/dist/views/core/icon/components/icon/icon.svelte +4 -2
- package/dist/views/core/icon/components/icon/icon.svelte.d.ts +1 -0
- package/dist/views/core/icon/services/icon-path-service.d.ts +1 -0
- package/dist/views/core/icon/services/icon-path-service.js +1 -0
- package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte +12 -1
- package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte.d.ts +4 -1
- package/dist/views/core/input/components/color-field/color-field.svelte +11 -3
- package/dist/views/core/input/components/color-field/color-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/combobox-field/combobox-field.svelte +5 -5
- package/dist/views/core/input/components/date-field/date-field.svelte +8 -0
- package/dist/views/core/input/components/date-field/date-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/datetime-field/datetime-field.svelte +8 -0
- package/dist/views/core/input/components/datetime-field/datetime-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/email-field/email-field.svelte +8 -0
- package/dist/views/core/input/components/email-field/email-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/file-field/file-field.svelte +8 -0
- package/dist/views/core/input/components/file-field/file-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/input-field/input-field.svelte +65 -57
- package/dist/views/core/input/components/input-field/input-field.svelte.d.ts +16 -14
- package/dist/views/core/input/components/number-field/number-field.svelte +8 -0
- package/dist/views/core/input/components/number-field/number-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/password-field/password-field.svelte +9 -1
- package/dist/views/core/input/components/password-field/password-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/phone-field/phone-field.svelte +10 -2
- package/dist/views/core/input/components/phone-field/phone-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/radio-field/radio-field.svelte +2 -1
- package/dist/views/core/input/components/range-field/range-field.svelte +19 -6
- package/dist/views/core/input/components/range-field/range-field.svelte.d.ts +5 -1
- package/dist/views/core/input/components/search-field/search-field.svelte +15 -5
- package/dist/views/core/input/components/search-field/search-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/text-field/text-field.svelte +8 -0
- package/dist/views/core/input/components/text-field/text-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/textarea-field/textarea-field.svelte +8 -0
- package/dist/views/core/input/components/textarea-field/textarea-field.svelte.d.ts +11 -0
- package/dist/views/core/input/components/time-field/time-field.svelte +8 -0
- package/dist/views/core/input/components/time-field/time-field.svelte.d.ts +11 -0
- package/dist/views/core/navbar/components/navbar/navbar.svelte +3 -1
- package/dist/views/core/navbar/components/navbar/navbar.svelte.d.ts +1 -0
- package/dist/views/core/pagination/components/pagination/pagination.svelte +3 -3
- package/package.json +1 -1
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
| 'border'
|
|
7
7
|
| 'border-base'
|
|
8
8
|
| 'border-primary';
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
export type ButtonSizeType = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
11
|
+
|
|
10
12
|
export type ButtonPropsType = {
|
|
11
13
|
id?: string;
|
|
12
14
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -27,15 +29,20 @@
|
|
|
27
29
|
hasRipple?: boolean;
|
|
28
30
|
rippleColor?: string | 'light' | 'dark';
|
|
29
31
|
onClick?: (ev: MouseEvent) => void;
|
|
32
|
+
url?: string;
|
|
33
|
+
target?: string;
|
|
34
|
+
hasOpenInNew?: boolean;
|
|
35
|
+
openInNewIconClassName?: string;
|
|
36
|
+
openInNewIcon?: string;
|
|
30
37
|
};
|
|
31
38
|
</script>
|
|
32
39
|
|
|
33
40
|
<script lang="ts">
|
|
34
|
-
import '../../../../../tailwind.css';
|
|
35
41
|
import { ripple, type RipplePropsType } from '../../../../../actions/ripple.js';
|
|
36
|
-
import
|
|
42
|
+
import { Icon, mdiOpenInNew } from '../../../icon';
|
|
37
43
|
import { Spinner } from '../../../spinner';
|
|
38
|
-
import {
|
|
44
|
+
import type { Snippet } from 'svelte';
|
|
45
|
+
import '../../../../../tailwind.css';
|
|
39
46
|
|
|
40
47
|
let {
|
|
41
48
|
appearance = 'none',
|
|
@@ -56,7 +63,12 @@
|
|
|
56
63
|
children,
|
|
57
64
|
hasRipple = true,
|
|
58
65
|
rippleColor,
|
|
59
|
-
onClick = (ev: MouseEvent) => {}
|
|
66
|
+
onClick = (ev: MouseEvent) => {},
|
|
67
|
+
url,
|
|
68
|
+
target,
|
|
69
|
+
hasOpenInNew,
|
|
70
|
+
openInNewIconClassName,
|
|
71
|
+
openInNewIcon = mdiOpenInNew
|
|
60
72
|
}: ButtonPropsType = $props();
|
|
61
73
|
|
|
62
74
|
let btnAppearanceClassName = $derived.by(() => {
|
|
@@ -77,6 +89,8 @@
|
|
|
77
89
|
|
|
78
90
|
let btnSizeClassName = $derived.by(() => {
|
|
79
91
|
switch (size) {
|
|
92
|
+
case 'none':
|
|
93
|
+
return '';
|
|
80
94
|
case 'xs':
|
|
81
95
|
return 'px-1 py-0 text-xs';
|
|
82
96
|
case 'sm':
|
|
@@ -92,7 +106,7 @@
|
|
|
92
106
|
}
|
|
93
107
|
});
|
|
94
108
|
|
|
95
|
-
function
|
|
109
|
+
function handleRipple(node: HTMLElement, options?: RipplePropsType) {
|
|
96
110
|
if (hasRipple) {
|
|
97
111
|
options = options || { color: rippleColor };
|
|
98
112
|
return ripple(node, options);
|
|
@@ -120,18 +134,38 @@
|
|
|
120
134
|
{/if}
|
|
121
135
|
{/snippet}
|
|
122
136
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
{#if url}
|
|
138
|
+
<a
|
|
139
|
+
{id}
|
|
140
|
+
href={url}
|
|
141
|
+
{target}
|
|
142
|
+
class="relative flex items-center justify-center gap-2 focus:outline-primary dark:focus:outline-primary rounded {btnSizeClassName} {btnAppearanceClassName} {className}"
|
|
143
|
+
onclick={onClick}
|
|
144
|
+
use:handleRipple
|
|
145
|
+
>
|
|
146
|
+
{#if children}
|
|
147
|
+
{@render children()}
|
|
148
|
+
{:else}
|
|
149
|
+
{@render buttonContent()}
|
|
150
|
+
{/if}
|
|
151
|
+
{#if hasOpenInNew}
|
|
152
|
+
<Icon path={openInNewIcon} className=" {openInNewIconClassName}" sizeClassName="w-4 h-4" />
|
|
153
|
+
{/if}
|
|
154
|
+
</a>
|
|
155
|
+
{:else}
|
|
156
|
+
<button
|
|
157
|
+
{id}
|
|
158
|
+
{type}
|
|
159
|
+
{form}
|
|
160
|
+
class="relative flex items-center justify-center gap-2 focus:outline-primary dark:focus:outline-primary rounded {btnSizeClassName} {btnAppearanceClassName} {className}"
|
|
161
|
+
onclick={onClick}
|
|
162
|
+
{disabled}
|
|
163
|
+
use:handleRipple
|
|
164
|
+
>
|
|
165
|
+
{#if children}
|
|
166
|
+
{@render children()}
|
|
167
|
+
{:else}
|
|
168
|
+
{@render buttonContent()}
|
|
169
|
+
{/if}
|
|
170
|
+
</button>
|
|
171
|
+
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ButtonAppearanceType = 'none' | 'primary' | 'base' | 'border' | 'border-base' | 'border-primary';
|
|
2
|
-
export type ButtonSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
2
|
+
export type ButtonSizeType = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
3
|
export type ButtonPropsType = {
|
|
4
4
|
id?: string;
|
|
5
5
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -20,9 +20,14 @@ export type ButtonPropsType = {
|
|
|
20
20
|
hasRipple?: boolean;
|
|
21
21
|
rippleColor?: string | 'light' | 'dark';
|
|
22
22
|
onClick?: (ev: MouseEvent) => void;
|
|
23
|
+
url?: string;
|
|
24
|
+
target?: string;
|
|
25
|
+
hasOpenInNew?: boolean;
|
|
26
|
+
openInNewIconClassName?: string;
|
|
27
|
+
openInNewIcon?: string;
|
|
23
28
|
};
|
|
24
|
-
import '../../../../../tailwind.css';
|
|
25
29
|
import type { Snippet } from 'svelte';
|
|
30
|
+
import '../../../../../tailwind.css';
|
|
26
31
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
27
32
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
28
33
|
$$bindings?: Bindings;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { isSmallScreen } from '../../../../../services';
|
|
3
|
-
import { mdiArrowLeft
|
|
3
|
+
import { mdiArrowLeft } from '../../../icon';
|
|
4
4
|
import Button from '../button/button.svelte';
|
|
5
5
|
|
|
6
6
|
type PropsType = {
|
|
7
|
+
id?: string;
|
|
7
8
|
iconPath?: string;
|
|
8
9
|
iconClassName?: string;
|
|
9
10
|
className?: string;
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
let {
|
|
16
|
+
id,
|
|
15
17
|
iconPath = mdiArrowLeft,
|
|
16
18
|
iconClassName = '',
|
|
17
19
|
className = '',
|
|
@@ -28,8 +30,11 @@
|
|
|
28
30
|
|
|
29
31
|
{#snippet button()}
|
|
30
32
|
<Button
|
|
33
|
+
{id}
|
|
34
|
+
appearance="none"
|
|
35
|
+
size="none"
|
|
31
36
|
{iconPath}
|
|
32
|
-
className="w-12 h-12
|
|
37
|
+
className="w-12 h-12 rounded-full hover:bg-gray-50 dark:hover:bg-gray-900 {className}"
|
|
33
38
|
{iconClassName}
|
|
34
39
|
{onClick}
|
|
35
40
|
/>
|
|
@@ -12,6 +12,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
14
|
declare const ButtonBack: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
id?: string;
|
|
15
16
|
iconPath?: string;
|
|
16
17
|
iconClassName?: string;
|
|
17
18
|
className?: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import Button from '../button/button.svelte';
|
|
5
5
|
|
|
6
6
|
type PropsType = {
|
|
7
|
-
|
|
7
|
+
id?: string;
|
|
8
8
|
iconPath?: string;
|
|
9
9
|
iconClassName?: string;
|
|
10
10
|
className?: string;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
let {
|
|
17
|
-
|
|
17
|
+
id,
|
|
18
18
|
iconPath = mdiClose,
|
|
19
19
|
iconClassName = '',
|
|
20
20
|
className = '',
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
{#snippet button()}
|
|
33
33
|
<Button
|
|
34
|
+
{id}
|
|
34
35
|
{iconPath}
|
|
35
36
|
className="w-12 h-12 rounded-full text-gray-500 hover:text-gray-600 hover:bg-gray-50 {className}"
|
|
36
37
|
{iconClassName}
|
|
@@ -12,7 +12,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
14
|
declare const ButtonCloseIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
|
|
15
|
+
id?: string;
|
|
16
16
|
iconPath?: string;
|
|
17
17
|
iconClassName?: string;
|
|
18
18
|
className?: string;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
type IconPropsType = {
|
|
5
5
|
path: string;
|
|
6
6
|
className?: string;
|
|
7
|
+
sizeClassName?: string;
|
|
7
8
|
size?: number;
|
|
8
9
|
fill?: string;
|
|
9
10
|
viewBox?: string;
|
|
@@ -16,7 +17,8 @@
|
|
|
16
17
|
size = 24,
|
|
17
18
|
fill = 'currentColor',
|
|
18
19
|
viewBox = '',
|
|
19
|
-
color
|
|
20
|
+
color,
|
|
21
|
+
sizeClassName = 'w-6 h-6'
|
|
20
22
|
}: IconPropsType = $props();
|
|
21
23
|
|
|
22
24
|
$effect(() => {
|
|
@@ -24,6 +26,6 @@
|
|
|
24
26
|
});
|
|
25
27
|
</script>
|
|
26
28
|
|
|
27
|
-
<svg class="
|
|
29
|
+
<svg class="align-middle {sizeClassName} {className}" {viewBox} fill={color || fill}>
|
|
28
30
|
<path d={path} />
|
|
29
31
|
</svg>
|
|
@@ -15,6 +15,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
15
15
|
declare const Icon: $$__sveltets_2_IsomorphicComponent<{
|
|
16
16
|
path: string;
|
|
17
17
|
className?: string;
|
|
18
|
+
sizeClassName?: string;
|
|
18
19
|
size?: number;
|
|
19
20
|
fill?: string;
|
|
20
21
|
viewBox?: string;
|
|
@@ -19,3 +19,4 @@ export declare const mdiPageLast = "M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,
|
|
|
19
19
|
export declare const mdiPhone = "M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z";
|
|
20
20
|
export declare const mdiSquare = "M3,3V21H21V3";
|
|
21
21
|
export declare const mdiUnfoldMoreHorizontal = "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z";
|
|
22
|
+
export declare const mdiOpenInNew = "M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";
|
|
@@ -20,3 +20,4 @@ export const mdiPageLast = "M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7
|
|
|
20
20
|
export const mdiPhone = "M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z";
|
|
21
21
|
export const mdiSquare = "M3,3V21H21V3";
|
|
22
22
|
export const mdiUnfoldMoreHorizontal = "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z";
|
|
23
|
+
export const mdiOpenInNew = "M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
value = $bindable(false)
|
|
28
28
|
}: CheckboxPropsType = $props();
|
|
29
29
|
|
|
30
|
+
let inputRef: HTMLInputElement | null = $state(null);
|
|
31
|
+
|
|
32
|
+
export function getElement() {
|
|
33
|
+
return inputRef;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function select() {
|
|
37
|
+
return inputRef && (inputRef as HTMLInputElement).select();
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
function handleChange(ev: Event) {
|
|
31
41
|
if (onChange) {
|
|
32
42
|
onChange(value);
|
|
@@ -48,12 +58,13 @@
|
|
|
48
58
|
{@render labelSnippet()}
|
|
49
59
|
{/if}
|
|
50
60
|
<input
|
|
61
|
+
bind:this={inputRef}
|
|
51
62
|
bind:checked={value}
|
|
52
63
|
id={id || name}
|
|
53
64
|
aria-describedby="comments-description"
|
|
54
65
|
name={name || id}
|
|
55
66
|
type="checkbox"
|
|
56
|
-
class="h-6 w-6 appearance-none rounded bg-base-200 dark:bg-base-700 dark:checked:bg-primary checked:bg-primary outline-primary border-base-300 dark:border-base-600
|
|
67
|
+
class="h-6 w-6 appearance-none rounded bg-base-200 dark:bg-base-700 dark:checked:bg-primary checked:bg-primary outline-primary border-base-300 dark:border-base-600 {className}"
|
|
57
68
|
onchange={(ev) => handleChange(ev)}
|
|
58
69
|
/>
|
|
59
70
|
{#if position == 'left'}
|
|
@@ -25,6 +25,9 @@ declare const CheckboxField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
25
25
|
value?: boolean;
|
|
26
26
|
}, {
|
|
27
27
|
[evt: string]: CustomEvent<any>;
|
|
28
|
-
}, {}, {
|
|
28
|
+
}, {}, {
|
|
29
|
+
getElement: () => HTMLInputElement | null;
|
|
30
|
+
select: () => void | null;
|
|
31
|
+
}, "value">;
|
|
29
32
|
type CheckboxField = InstanceType<typeof CheckboxField>;
|
|
30
33
|
export default CheckboxField;
|
|
@@ -19,10 +19,18 @@
|
|
|
19
19
|
let btnRoundedClassName: string = $state('');
|
|
20
20
|
let colorValue: string = $state('#000000');
|
|
21
21
|
|
|
22
|
-
let
|
|
22
|
+
let inputRef: InputField | null = $state(null);
|
|
23
23
|
|
|
24
24
|
export function focus() {
|
|
25
|
-
|
|
25
|
+
inputRef?.focus();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getElement() {
|
|
29
|
+
return inputRef;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function select() {
|
|
33
|
+
return inputRef && (inputRef as InputField).select();
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
function handleColorBtnClick() {
|
|
@@ -91,7 +99,7 @@
|
|
|
91
99
|
type="text"
|
|
92
100
|
{id}
|
|
93
101
|
{name}
|
|
94
|
-
bind:this={
|
|
102
|
+
bind:this={inputRef}
|
|
95
103
|
className="pr-8 {props?.className}"
|
|
96
104
|
rightSnippet={colorButton}
|
|
97
105
|
maxlength={9}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -18,6 +19,16 @@ declare const ColorField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType
|
|
|
18
19
|
[evt: string]: CustomEvent<any>;
|
|
19
20
|
}, {}, {
|
|
20
21
|
focus: () => void;
|
|
22
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {}> & {
|
|
25
|
+
$$bindings?: "value" | undefined;
|
|
26
|
+
} & {
|
|
27
|
+
focus: () => void;
|
|
28
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
29
|
+
select: () => void | null;
|
|
30
|
+
}) | null;
|
|
31
|
+
select: () => void | null;
|
|
21
32
|
}, "value">;
|
|
22
33
|
type ColorField = InstanceType<typeof ColorField>;
|
|
23
34
|
export default ColorField;
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
{#if hasComboboxIcon}
|
|
336
336
|
<Icon
|
|
337
337
|
path={comboboxIconPath}
|
|
338
|
-
className=" text-
|
|
338
|
+
className=" text-base-500 {comboboxIconSizeClassName} {comboboxIconClassName}"
|
|
339
339
|
/>
|
|
340
340
|
{/if}
|
|
341
341
|
</div>
|
|
@@ -348,13 +348,13 @@
|
|
|
348
348
|
<div class="flex items-center {displayClassName}" title={displayItemsTitle}>
|
|
349
349
|
{#each displayItems?.slice(0, displayItemsCount) as item, index}
|
|
350
350
|
<div
|
|
351
|
-
class="inline-flex items-center bg-
|
|
351
|
+
class="inline-flex items-center bg-base-200 text-base-700 text-sm font-medium px-2 mx-1 rounded-full text-nowrap {chipClassName}"
|
|
352
352
|
>
|
|
353
353
|
{item}
|
|
354
354
|
</div>
|
|
355
355
|
{/each}
|
|
356
356
|
{#if displayItemsCount && displayItems?.length > (displayItemsCount || 1)}
|
|
357
|
-
<div class="px-2 text-
|
|
357
|
+
<div class="px-2 text-base-400">+ {displayItems?.length - (displayItemsCount || 1)}</div>
|
|
358
358
|
{/if}
|
|
359
359
|
</div>
|
|
360
360
|
{:else}
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
value={_value}
|
|
372
372
|
type="text"
|
|
373
373
|
role="combobox"
|
|
374
|
-
|
|
374
|
+
onClick={handleInputClick}
|
|
375
375
|
className="pr-8 text-transparent {className}"
|
|
376
376
|
rightSnippet={rightIcon}
|
|
377
377
|
rightSnippetContainerClassName="pointer-events-none"
|
|
@@ -382,7 +382,7 @@
|
|
|
382
382
|
{appearance}
|
|
383
383
|
ariaControls="options"
|
|
384
384
|
ariaExpanded={isPlaced}
|
|
385
|
-
|
|
385
|
+
onKeyDown={handleKeyDown}
|
|
386
386
|
contentSnippet={comboboxContentSnippet}
|
|
387
387
|
title={displayItemsTitle || ''}
|
|
388
388
|
/>
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
export function focus() {
|
|
9
9
|
inputFieldRef?.focus();
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
export function getElement(){
|
|
13
|
+
return inputFieldRef;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function select(){
|
|
17
|
+
inputFieldRef && inputFieldRef.select();
|
|
18
|
+
}
|
|
11
19
|
</script>
|
|
12
20
|
|
|
13
21
|
<InputField bind:this={inputFieldRef} {...props} type="date" bind:value />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const DateField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType,
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type DateField = InstanceType<typeof DateField>;
|
|
21
32
|
export default DateField;
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
export function focus() {
|
|
9
9
|
inputFieldRef?.focus();
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
export function getElement(){
|
|
13
|
+
return inputFieldRef;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function select(){
|
|
17
|
+
inputFieldRef && inputFieldRef.select();
|
|
18
|
+
}
|
|
11
19
|
</script>
|
|
12
20
|
|
|
13
21
|
<InputField bind:this={inputFieldRef} {...props} type="datetime-local" bind:value />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const DatetimeField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsT
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type DatetimeField = InstanceType<typeof DatetimeField>;
|
|
21
32
|
export default DatetimeField;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const EmailField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type EmailField = InstanceType<typeof EmailField>;
|
|
21
32
|
export default EmailField;
|
|
@@ -29,6 +29,14 @@
|
|
|
29
29
|
inputFieldRef?.focus();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export function getElement(){
|
|
33
|
+
return inputFieldRef;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function select(){
|
|
37
|
+
inputFieldRef && inputFieldRef.select();
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
async function handleFileAttachment() {
|
|
33
41
|
let res: File | File[] = await openFilePicker({ accept, multiple });
|
|
34
42
|
if (res) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -20,6 +21,16 @@ declare const FileField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType
|
|
|
20
21
|
[evt: string]: CustomEvent<any>;
|
|
21
22
|
}, {}, {
|
|
22
23
|
focus: () => void;
|
|
24
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {}> & {
|
|
27
|
+
$$bindings?: "value" | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
focus: () => void;
|
|
30
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
31
|
+
select: () => void | null;
|
|
32
|
+
}) | null;
|
|
33
|
+
select: () => void;
|
|
23
34
|
}, "value">;
|
|
24
35
|
type FileField = InstanceType<typeof FileField>;
|
|
25
36
|
export default FileField;
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
multiple?: boolean;
|
|
48
48
|
name?: string;
|
|
49
49
|
title?: string;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
onBlur?: (ev: any) => void;
|
|
51
|
+
onChange?: (ev: any) => void;
|
|
52
|
+
onClick?: (ev: MouseEvent) => void;
|
|
53
|
+
onDblClick?: (ev: MouseEvent) => void;
|
|
54
|
+
onDrag?: (ev: DragEvent) => void;
|
|
55
|
+
onDragOver?: (ev: DragEvent) => void;
|
|
56
|
+
onDrop?: (ev: DragEvent) => void;
|
|
57
|
+
onFocus?: (ev: any) => void;
|
|
58
|
+
onInput?: (ev: any) => void;
|
|
59
|
+
onKeyDown?: (ev: KeyboardEvent) => void;
|
|
60
|
+
onKeyPress?: (ev: KeyboardEvent) => void;
|
|
61
|
+
onKeyUp?: (ev: KeyboardEvent) => void;
|
|
62
|
+
onMouseDown?: (ev: MouseEvent) => void;
|
|
63
|
+
onMouseUp?: (ev: MouseEvent) => void;
|
|
64
64
|
pattern?: string;
|
|
65
65
|
placeholder?: string;
|
|
66
66
|
readonly?: boolean;
|
|
@@ -108,20 +108,20 @@
|
|
|
108
108
|
multiple = false,
|
|
109
109
|
name = '',
|
|
110
110
|
title,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
onBlur,
|
|
112
|
+
onChange,
|
|
113
|
+
onClick,
|
|
114
|
+
onDblClick,
|
|
115
|
+
onDrag,
|
|
116
|
+
onDragOver,
|
|
117
|
+
onDrop,
|
|
118
|
+
onFocus,
|
|
119
|
+
onInput,
|
|
120
|
+
onKeyDown,
|
|
121
|
+
onKeyPress,
|
|
122
|
+
onKeyUp,
|
|
123
|
+
onMouseDown,
|
|
124
|
+
onMouseUp,
|
|
125
125
|
pattern,
|
|
126
126
|
placeholder = '',
|
|
127
127
|
readonly = false,
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
value = $bindable()
|
|
139
139
|
}: InputFieldPropsType = $props();
|
|
140
140
|
|
|
141
|
-
let inputRef: HTMLInputElement | HTMLTextAreaElement |
|
|
141
|
+
let inputRef: HTMLInputElement | HTMLTextAreaElement | null = $state(null);
|
|
142
142
|
|
|
143
143
|
let sizeClassName = $state('');
|
|
144
144
|
let appearanceClassName = $state('');
|
|
@@ -150,6 +150,14 @@
|
|
|
150
150
|
inputRef && inputRef.focus();
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
export function getElement() {
|
|
154
|
+
return inputRef;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function select() {
|
|
158
|
+
return inputRef && (inputRef as HTMLInputElement).select();
|
|
159
|
+
}
|
|
160
|
+
|
|
153
161
|
$effect(() => {
|
|
154
162
|
if (floatingLabel || leftSnippet != null || rightSnippet != null) {
|
|
155
163
|
containerClassName = (containerClassName || '') + ' relative';
|
|
@@ -292,20 +300,20 @@
|
|
|
292
300
|
{minlength}
|
|
293
301
|
{rows}
|
|
294
302
|
{cols}
|
|
295
|
-
{
|
|
296
|
-
{
|
|
297
|
-
{
|
|
298
|
-
{
|
|
299
|
-
{
|
|
300
|
-
{
|
|
301
|
-
{
|
|
302
|
-
{
|
|
303
|
-
{
|
|
304
|
-
{
|
|
305
|
-
{
|
|
306
|
-
{
|
|
307
|
-
{
|
|
308
|
-
{
|
|
303
|
+
onchange={onChange}
|
|
304
|
+
oninput={onInput}
|
|
305
|
+
onfocus={onFocus}
|
|
306
|
+
onblur={onBlur}
|
|
307
|
+
ondblclick={onDblClick}
|
|
308
|
+
onclick={onClick}
|
|
309
|
+
onmousedown={onMouseDown}
|
|
310
|
+
onmouseup={onMouseUp}
|
|
311
|
+
onkeydown={onKeyDown}
|
|
312
|
+
onkeyup={onKeyUp}
|
|
313
|
+
onkeypress={onKeyPress}
|
|
314
|
+
ondrop={onDrop}
|
|
315
|
+
ondrag={onDrag}
|
|
316
|
+
ondragover={onDragOver}
|
|
309
317
|
></textarea>
|
|
310
318
|
{:else}
|
|
311
319
|
<input
|
|
@@ -328,20 +336,20 @@
|
|
|
328
336
|
{pattern}
|
|
329
337
|
{multiple}
|
|
330
338
|
{role}
|
|
331
|
-
{
|
|
332
|
-
{
|
|
333
|
-
{
|
|
334
|
-
{
|
|
335
|
-
{
|
|
336
|
-
{
|
|
337
|
-
{
|
|
338
|
-
{
|
|
339
|
-
{
|
|
340
|
-
{
|
|
341
|
-
{
|
|
342
|
-
{
|
|
343
|
-
{
|
|
344
|
-
{
|
|
339
|
+
onchange={onChange}
|
|
340
|
+
oninput={onInput}
|
|
341
|
+
onfocus={onFocus}
|
|
342
|
+
onblur={onBlur}
|
|
343
|
+
ondblclick={onDblClick}
|
|
344
|
+
onclick={onClick}
|
|
345
|
+
onmousedown={onMouseDown}
|
|
346
|
+
onmouseup={onMouseUp}
|
|
347
|
+
onkeydown={onKeyDown}
|
|
348
|
+
onkeyup={onKeyUp}
|
|
349
|
+
onkeypress={onKeyPress}
|
|
350
|
+
ondrop={onDrop}
|
|
351
|
+
ondrag={onDrag}
|
|
352
|
+
ondragover={onDragOver}
|
|
345
353
|
aria-controls={ariaControls}
|
|
346
354
|
aria-expanded={ariaExpanded}
|
|
347
355
|
/>
|
|
@@ -28,20 +28,20 @@ export type InputFieldPropsType = {
|
|
|
28
28
|
multiple?: boolean;
|
|
29
29
|
name?: string;
|
|
30
30
|
title?: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
onBlur?: (ev: any) => void;
|
|
32
|
+
onChange?: (ev: any) => void;
|
|
33
|
+
onClick?: (ev: MouseEvent) => void;
|
|
34
|
+
onDblClick?: (ev: MouseEvent) => void;
|
|
35
|
+
onDrag?: (ev: DragEvent) => void;
|
|
36
|
+
onDragOver?: (ev: DragEvent) => void;
|
|
37
|
+
onDrop?: (ev: DragEvent) => void;
|
|
38
|
+
onFocus?: (ev: any) => void;
|
|
39
|
+
onInput?: (ev: any) => void;
|
|
40
|
+
onKeyDown?: (ev: KeyboardEvent) => void;
|
|
41
|
+
onKeyPress?: (ev: KeyboardEvent) => void;
|
|
42
|
+
onKeyUp?: (ev: KeyboardEvent) => void;
|
|
43
|
+
onMouseDown?: (ev: MouseEvent) => void;
|
|
44
|
+
onMouseUp?: (ev: MouseEvent) => void;
|
|
45
45
|
pattern?: string;
|
|
46
46
|
placeholder?: string;
|
|
47
47
|
readonly?: boolean;
|
|
@@ -76,6 +76,8 @@ declare const InputField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType
|
|
|
76
76
|
[evt: string]: CustomEvent<any>;
|
|
77
77
|
}, {}, {
|
|
78
78
|
focus: () => void;
|
|
79
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
80
|
+
select: () => void | null;
|
|
79
81
|
}, "value">;
|
|
80
82
|
type InputField = InstanceType<typeof InputField>;
|
|
81
83
|
export default InputField;
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
export function focus() {
|
|
9
9
|
inputFieldRef?.focus();
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
export function getElement(){
|
|
13
|
+
return inputFieldRef;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function select(){
|
|
17
|
+
inputFieldRef && inputFieldRef.select();
|
|
18
|
+
}
|
|
11
19
|
</script>
|
|
12
20
|
|
|
13
21
|
<InputField bind:this={inputFieldRef} {...props} type="number" bind:value />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const NumberField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsTyp
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type NumberField = InstanceType<typeof NumberField>;
|
|
21
32
|
export default NumberField;
|
|
@@ -28,6 +28,14 @@
|
|
|
28
28
|
inputFieldRef?.focus();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export function getElement(){
|
|
32
|
+
return inputFieldRef;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function select(){
|
|
36
|
+
inputFieldRef && inputFieldRef.select();
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
function handleTogglePassword() {
|
|
32
40
|
if (type == 'password') {
|
|
33
41
|
type = 'text';
|
|
@@ -66,7 +74,7 @@
|
|
|
66
74
|
<button
|
|
67
75
|
id="btn-eye-{name || id}"
|
|
68
76
|
type="button"
|
|
69
|
-
class="px-3 h-full hover:bg-
|
|
77
|
+
class="px-3 h-full hover:bg-base-100 focus:outline-primary {btnRoundedClassName} {buttonClassName}"
|
|
70
78
|
use:ripple
|
|
71
79
|
onclick={handleTogglePassword}
|
|
72
80
|
>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -19,6 +20,16 @@ declare const PasswordField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsT
|
|
|
19
20
|
[evt: string]: CustomEvent<any>;
|
|
20
21
|
}, {}, {
|
|
21
22
|
focus: () => void;
|
|
23
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {}> & {
|
|
26
|
+
$$bindings?: "value" | undefined;
|
|
27
|
+
} & {
|
|
28
|
+
focus: () => void;
|
|
29
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
30
|
+
select: () => void | null;
|
|
31
|
+
}) | null;
|
|
32
|
+
select: () => void;
|
|
22
33
|
}, "value">;
|
|
23
34
|
type PasswordField = InstanceType<typeof PasswordField>;
|
|
24
35
|
export default PasswordField;
|
|
@@ -79,6 +79,14 @@
|
|
|
79
79
|
inputFieldRef?.focus();
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
export function getElement(){
|
|
83
|
+
return inputFieldRef;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function select(){
|
|
87
|
+
inputFieldRef && inputFieldRef.select();
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
function formatDialCode(dialcode: string) {
|
|
83
91
|
dialcode = `${dialCode}`.trim();
|
|
84
92
|
if (!dialCode.startsWith('+')) {
|
|
@@ -202,6 +210,6 @@
|
|
|
202
210
|
{floatingLabel}
|
|
203
211
|
className="pl-16 {className}"
|
|
204
212
|
labelClassName=" {floatingLabel ? 'peer-placeholder-shown:ps-16' : ''} {labelClassName}"
|
|
205
|
-
|
|
206
|
-
|
|
213
|
+
onInput={handleNumberInput}
|
|
214
|
+
onKeyDown={handleNumberKeyDown}
|
|
207
215
|
/>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
export type LibPhoneNumberParseType = {
|
|
2
3
|
isValid: () => boolean;
|
|
3
4
|
nationalNumber: string;
|
|
@@ -40,6 +41,16 @@ declare const PhoneField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType
|
|
|
40
41
|
[evt: string]: CustomEvent<any>;
|
|
41
42
|
}, {}, {
|
|
42
43
|
focus: () => void;
|
|
44
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
45
|
+
[evt: string]: CustomEvent<any>;
|
|
46
|
+
}, {}> & {
|
|
47
|
+
$$bindings?: "value" | undefined;
|
|
48
|
+
} & {
|
|
49
|
+
focus: () => void;
|
|
50
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
51
|
+
select: () => void | null;
|
|
52
|
+
}) | null;
|
|
53
|
+
select: () => void;
|
|
43
54
|
}, "value" | "dialCode">;
|
|
44
55
|
type PhoneField = InstanceType<typeof PhoneField>;
|
|
45
56
|
export default PhoneField;
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
descClassName,
|
|
47
47
|
onChange
|
|
48
48
|
}: RadioPropsType = $props();
|
|
49
|
+
|
|
49
50
|
|
|
50
51
|
let hasPrimitiveItemsData = $derived.by(() => {
|
|
51
52
|
if (items?.length) {
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
}
|
|
76
77
|
return [];
|
|
77
78
|
});
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
function handleChange(ev: Event, item: RadioItemType) {
|
|
80
81
|
value = item.value;
|
|
81
82
|
if (onChange && value) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import InputField, {
|
|
3
|
-
type InputFieldSizeType
|
|
4
|
-
} from '../input-field/input-field.svelte';
|
|
2
|
+
import InputField, { type InputFieldSizeType } from '../input-field/input-field.svelte';
|
|
5
3
|
|
|
6
4
|
type RangeFieldPropsType = {
|
|
7
5
|
id?: string;
|
|
@@ -33,7 +31,7 @@
|
|
|
33
31
|
|
|
34
32
|
let rangeSizeClassName = $state('');
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
$effect(() => {
|
|
37
35
|
switch (size) {
|
|
38
36
|
case 'lg':
|
|
39
37
|
rangeSizeClassName = 'h-3 ';
|
|
@@ -49,9 +47,25 @@
|
|
|
49
47
|
break;
|
|
50
48
|
}
|
|
51
49
|
});
|
|
50
|
+
|
|
51
|
+
let inputRef: HTMLInputElement | null = $state(null);
|
|
52
|
+
|
|
53
|
+
export function getElement() {
|
|
54
|
+
return inputRef;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function focus() {
|
|
58
|
+
return inputRef && inputRef.focus();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function select() {
|
|
62
|
+
return inputRef && inputRef.select();
|
|
63
|
+
}
|
|
52
64
|
</script>
|
|
53
65
|
|
|
54
66
|
<input
|
|
67
|
+
bind:this={inputRef}
|
|
68
|
+
bind:value
|
|
55
69
|
{id}
|
|
56
70
|
{name}
|
|
57
71
|
type="range"
|
|
@@ -59,8 +73,7 @@
|
|
|
59
73
|
{min}
|
|
60
74
|
{max}
|
|
61
75
|
{step}
|
|
62
|
-
|
|
63
|
-
{oninput}
|
|
76
|
+
{oninput}
|
|
64
77
|
{onfocus}
|
|
65
78
|
{onblur}
|
|
66
79
|
/>
|
|
@@ -26,6 +26,10 @@ declare const RangeField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
26
26
|
onblur?: (ev: any) => void;
|
|
27
27
|
}, {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
29
|
-
}, {}, {
|
|
29
|
+
}, {}, {
|
|
30
|
+
getElement: () => HTMLInputElement | null;
|
|
31
|
+
focus: () => void | null;
|
|
32
|
+
select: () => void | null;
|
|
33
|
+
}, "value">;
|
|
30
34
|
type RangeField = InstanceType<typeof RangeField>;
|
|
31
35
|
export default RangeField;
|
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
className,
|
|
8
8
|
placeholder,
|
|
9
9
|
iconClassName,
|
|
10
|
-
value
|
|
10
|
+
value = $bindable(''),
|
|
11
11
|
onSearch,
|
|
12
12
|
...props
|
|
13
|
-
}: InputFieldPropsType & {
|
|
13
|
+
}: InputFieldPropsType & {
|
|
14
|
+
iconClassName?: string;
|
|
15
|
+
onSearch?: (value: string) => void;
|
|
16
|
+
} = $props();
|
|
14
17
|
|
|
15
18
|
const debouncedSearch = debounce(search, 300);
|
|
16
19
|
let lastQuery: string;
|
|
@@ -21,6 +24,13 @@ value=$bindable(''),
|
|
|
21
24
|
inputFieldRef?.focus();
|
|
22
25
|
}
|
|
23
26
|
|
|
27
|
+
export function getElement() {
|
|
28
|
+
return inputFieldRef;
|
|
29
|
+
}
|
|
30
|
+
export function select() {
|
|
31
|
+
inputFieldRef && inputFieldRef.select();
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
function handleInput(ev: any) {
|
|
25
35
|
// console.log(ev);
|
|
26
36
|
let input: HTMLInputElement = ev?.target;
|
|
@@ -56,13 +66,13 @@ value=$bindable(''),
|
|
|
56
66
|
<Icon path={mdiMagnify} className="mx-3 text-gray-400 {iconClassName}"></Icon>
|
|
57
67
|
{/snippet}
|
|
58
68
|
<InputField
|
|
69
|
+
bind:value
|
|
59
70
|
bind:this={inputFieldRef}
|
|
60
71
|
{...props}
|
|
61
72
|
type="search"
|
|
62
73
|
maxlength={props?.maxlength || 200}
|
|
63
74
|
leftSnippet={searchIcon}
|
|
64
|
-
className="
|
|
75
|
+
className="pl-12 {className}"
|
|
65
76
|
{placeholder}
|
|
66
|
-
|
|
67
|
-
bind:value
|
|
77
|
+
onInput={handleInput}
|
|
68
78
|
/>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -19,6 +20,16 @@ declare const SearchField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsTyp
|
|
|
19
20
|
[evt: string]: CustomEvent<any>;
|
|
20
21
|
}, {}, {
|
|
21
22
|
focus: () => void;
|
|
23
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {}> & {
|
|
26
|
+
$$bindings?: "value" | undefined;
|
|
27
|
+
} & {
|
|
28
|
+
focus: () => void;
|
|
29
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
30
|
+
select: () => void | null;
|
|
31
|
+
}) | null;
|
|
32
|
+
select: () => void;
|
|
22
33
|
}, "value">;
|
|
23
34
|
type SearchField = InstanceType<typeof SearchField>;
|
|
24
35
|
export default SearchField;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const TextField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType,
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void | null;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type TextField = InstanceType<typeof TextField>;
|
|
21
32
|
export default TextField;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const TextareaField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsT
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void | null;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type TextareaField = InstanceType<typeof TextareaField>;
|
|
21
32
|
export default TextareaField;
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
export function focus() {
|
|
8
8
|
inputFieldRef?.focus();
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export function getElement(){
|
|
12
|
+
return inputFieldRef;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function select(){
|
|
16
|
+
return inputFieldRef && inputFieldRef.select();
|
|
17
|
+
}
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<InputField bind:this={inputFieldRef} {...props} type="time" bind:value />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
1
2
|
import { type InputFieldPropsType } from '../input-field/input-field.svelte';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -16,6 +17,16 @@ declare const TimeField: $$__sveltets_2_IsomorphicComponent<InputFieldPropsType,
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
}, {}, {
|
|
18
19
|
focus: () => void;
|
|
20
|
+
getElement: () => (SvelteComponent<InputFieldPropsType, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> & {
|
|
23
|
+
$$bindings?: "value" | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
focus: () => void;
|
|
26
|
+
getElement: () => HTMLInputElement | HTMLTextAreaElement | null;
|
|
27
|
+
select: () => void | null;
|
|
28
|
+
}) | null;
|
|
29
|
+
select: () => void | null;
|
|
19
30
|
}, "value">;
|
|
20
31
|
type TimeField = InstanceType<typeof TimeField>;
|
|
21
32
|
export default TimeField;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import '../../../../../tailwind.css';
|
|
7
7
|
|
|
8
8
|
type PropsType = {
|
|
9
|
+
disabledLogo?: boolean;
|
|
9
10
|
backIconPath?: string;
|
|
10
11
|
backButtonClassName?: string;
|
|
11
12
|
centerContainerClassName?: string;
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
let {
|
|
44
|
+
disabledLogo,
|
|
43
45
|
backButtonClassName,
|
|
44
46
|
backIconPath,
|
|
45
47
|
centerContainerClassName = '',
|
|
@@ -91,7 +93,7 @@
|
|
|
91
93
|
<button
|
|
92
94
|
type="button"
|
|
93
95
|
class="h-full px-2 text-base-800 dark:text-base-100 {drawerButtonClassName}"
|
|
94
|
-
disabled={
|
|
96
|
+
disabled={disabledLogo}
|
|
95
97
|
onclick={onMore}
|
|
96
98
|
>
|
|
97
99
|
<Icon path={moreIconPath} />
|
|
@@ -14,6 +14,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
14
14
|
z_$$bindings?: Bindings;
|
|
15
15
|
}
|
|
16
16
|
declare const Navbar: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
disabledLogo?: boolean;
|
|
17
18
|
backIconPath?: string;
|
|
18
19
|
backButtonClassName?: string;
|
|
19
20
|
centerContainerClassName?: string;
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
});
|
|
101
101
|
</script>
|
|
102
102
|
|
|
103
|
-
{#snippet pageButton({
|
|
103
|
+
{#snippet pageButton({ onClick, disabled, icon }: any)}
|
|
104
104
|
<Button
|
|
105
105
|
className="hover:bg-gray-100 p-1 px-2 outline-none focus:bg-gray-200 disabled:bg-white disabled:text-gray-400 rounded"
|
|
106
106
|
{disabled}
|
|
107
|
-
{
|
|
107
|
+
onClick={onClick}
|
|
108
108
|
iconPath={icon}
|
|
109
109
|
/>
|
|
110
110
|
{/snippet}
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class="">
|
|
117
117
|
<ButtonMenu
|
|
118
118
|
className="px-3 py-2 rounded hover:bg-gray-100 outline-none focus:bg-gray-200"
|
|
119
|
-
|
|
119
|
+
title={pageSize}
|
|
120
120
|
dropdownClassName="w-20"
|
|
121
121
|
>
|
|
122
122
|
{#each pageSizeOptions as opt, index (index)}
|