@cloudparker/moldex.js 0.0.43 → 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/tailwind.css +1 -1
- 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 +6 -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/pagination/components/pagination/pagination.svelte +3 -3
- package/package.json +1 -1
|
@@ -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;
|