sprintify-ui 0.0.100 → 0.0.102
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/sprintify-ui.es.js +8493 -8451
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +2 -2
- package/dist/types/src/components/BaseAutocompleteDropdown.vue.d.ts +3 -1
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +9 -3
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +9 -3
- package/dist/types/src/components/BaseButtonGroup.vue.d.ts +2 -2
- package/dist/types/src/components/BaseCharacterCounter.vue.d.ts +2 -2
- package/dist/types/src/components/BaseColor.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +1 -1
- package/dist/types/src/components/BaseFieldI18n.vue.d.ts +1 -1
- package/dist/types/src/components/BaseFilePicker.vue.d.ts +1 -1
- package/dist/types/src/components/BaseFileUploader.vue.d.ts +1 -1
- package/dist/types/src/components/BaseFormField.d.ts +1 -1
- package/dist/types/src/components/BaseHasMany.vue.d.ts +9 -3
- package/dist/types/src/components/BaseInput.vue.d.ts +5 -5
- package/dist/types/src/components/BaseInputPercent.vue.d.ts +4 -4
- package/dist/types/src/components/BaseLocaleForm.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +4 -4
- package/dist/types/src/components/BaseNumberForm.vue.d.ts +2 -2
- package/dist/types/src/components/BasePassword.vue.d.ts +2 -2
- package/dist/types/src/components/BasePasswordForm.vue.d.ts +1 -1
- package/dist/types/src/components/BaseRadioGroup.vue.d.ts +1 -1
- package/dist/types/src/components/BaseRichText.vue.d.ts +2 -2
- package/dist/types/src/components/BaseSelect.vue.d.ts +2 -2
- package/dist/types/src/components/BaseTableColumn.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +2 -2
- package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +9 -3
- package/dist/types/src/components/BaseTextarea.vue.d.ts +3 -3
- package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +2 -2
- package/dist/types/src/components/BaseTextareaForm.vue.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/BaseAutocomplete.vue +7 -0
- package/src/components/BaseAutocompleteDropdown.vue +29 -25
- package/src/components/BaseAutocompleteFetch.vue +13 -1
- package/src/components/BaseBelongsTo.vue +14 -1
- package/src/components/BaseHasMany.vue +14 -1
- package/src/components/BaseTagAutocomplete.vue +7 -0
- package/src/components/BaseTagAutocompleteFetch.vue +13 -0
|
@@ -158,9 +158,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
158
158
|
loading: boolean;
|
|
159
159
|
loadingBottom: boolean;
|
|
160
160
|
size: "base" | "xs" | "sm";
|
|
161
|
-
modelValue: Option | null | undefined;
|
|
162
|
-
placeholder: string;
|
|
163
161
|
disabled: boolean;
|
|
162
|
+
placeholder: string;
|
|
163
|
+
modelValue: Option | null | undefined;
|
|
164
164
|
hasError: boolean;
|
|
165
165
|
inline: boolean;
|
|
166
166
|
dropdownShow: "focus" | "always";
|
|
@@ -29,7 +29,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
29
29
|
type: StringConstructor;
|
|
30
30
|
default: string;
|
|
31
31
|
};
|
|
32
|
-
}, {
|
|
32
|
+
}, {
|
|
33
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
34
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "scrollBottom")[], "select" | "scrollBottom", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
35
|
selected: {
|
|
34
36
|
type: PropType<NormalizedOption | NormalizedOption[] | null | undefined>;
|
|
35
37
|
default: undefined;
|
|
@@ -61,7 +61,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
61
61
|
default: boolean;
|
|
62
62
|
type: BooleanConstructor;
|
|
63
63
|
};
|
|
64
|
-
}, {
|
|
64
|
+
}, {
|
|
65
|
+
focus: (() => void) | undefined;
|
|
66
|
+
blur: (() => void) | undefined;
|
|
67
|
+
open: (() => void) | undefined;
|
|
68
|
+
close: (() => void) | undefined;
|
|
69
|
+
setKeywords: ((input: string) => void) | undefined;
|
|
70
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:modelValue" | "focus" | "scrollBottom" | "typing")[], "clear" | "update:modelValue" | "focus" | "scrollBottom" | "typing", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
65
71
|
modelValue: {
|
|
66
72
|
default: undefined;
|
|
67
73
|
type: PropType<Option | null | undefined>;
|
|
@@ -132,9 +138,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
132
138
|
required: boolean;
|
|
133
139
|
name: string;
|
|
134
140
|
size: "base" | "xs" | "sm";
|
|
135
|
-
modelValue: Option | null | undefined;
|
|
136
|
-
placeholder: string;
|
|
137
141
|
disabled: boolean;
|
|
142
|
+
placeholder: string;
|
|
143
|
+
modelValue: Option | null | undefined;
|
|
138
144
|
hasError: boolean;
|
|
139
145
|
inline: boolean;
|
|
140
146
|
dropdownShow: "focus" | "always";
|
|
@@ -65,7 +65,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
65
65
|
default: boolean;
|
|
66
66
|
type: BooleanConstructor;
|
|
67
67
|
};
|
|
68
|
-
}, {
|
|
68
|
+
}, {
|
|
69
|
+
focus: (() => void) | undefined;
|
|
70
|
+
blur: (() => void) | undefined;
|
|
71
|
+
open: (() => void) | undefined;
|
|
72
|
+
close: (() => void) | undefined;
|
|
73
|
+
setKeywords: ((input: string) => void) | undefined;
|
|
74
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
69
75
|
modelValue: {
|
|
70
76
|
default: undefined;
|
|
71
77
|
type: PropType<string | number | null | undefined>;
|
|
@@ -136,9 +142,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
136
142
|
required: boolean;
|
|
137
143
|
name: string;
|
|
138
144
|
size: "base" | "xs" | "sm";
|
|
139
|
-
modelValue: string | number | null | undefined;
|
|
140
|
-
placeholder: string;
|
|
141
145
|
disabled: boolean;
|
|
146
|
+
placeholder: string;
|
|
147
|
+
modelValue: string | number | null | undefined;
|
|
142
148
|
hasError: boolean;
|
|
143
149
|
inline: boolean;
|
|
144
150
|
dropdownShow: "focus" | "always";
|
|
@@ -119,15 +119,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
119
119
|
}, {
|
|
120
120
|
required: boolean;
|
|
121
121
|
name: string;
|
|
122
|
-
modelValue: Option | Option[] | null | undefined;
|
|
123
122
|
disabled: boolean;
|
|
123
|
+
multiple: boolean;
|
|
124
|
+
modelValue: Option | Option[] | null | undefined;
|
|
124
125
|
hasError: boolean;
|
|
125
126
|
spacing: string;
|
|
126
127
|
buttonType: "button" | "submit";
|
|
127
128
|
buttonClass: string;
|
|
128
129
|
buttonSelectedClass: string;
|
|
129
130
|
buttonUnselectedClass: string;
|
|
130
|
-
multiple: boolean;
|
|
131
131
|
}>, {
|
|
132
132
|
option: (_: {
|
|
133
133
|
selected: import("vue").ComputedRef<boolean>;
|
|
@@ -54,10 +54,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
55
55
|
}, {
|
|
56
56
|
required: boolean;
|
|
57
|
-
modelValue: Option | Option[] | null | undefined;
|
|
58
57
|
disabled: boolean;
|
|
59
|
-
buttonType: "button" | "submit";
|
|
60
58
|
multiple: boolean;
|
|
59
|
+
modelValue: Option | Option[] | null | undefined;
|
|
60
|
+
buttonType: "button" | "submit";
|
|
61
61
|
colors: string[];
|
|
62
62
|
}>;
|
|
63
63
|
export default _default;
|
|
@@ -78,8 +78,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
78
78
|
}, {
|
|
79
79
|
required: boolean;
|
|
80
80
|
name: string;
|
|
81
|
-
modelValue: string | null | undefined;
|
|
82
81
|
disabled: boolean;
|
|
82
|
+
modelValue: string | null | undefined;
|
|
83
83
|
hasError: boolean;
|
|
84
84
|
inline: boolean;
|
|
85
85
|
minDate: Date;
|
|
@@ -84,6 +84,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
84
|
required: boolean;
|
|
85
85
|
name: string;
|
|
86
86
|
label: string;
|
|
87
|
+
defaultValue: string | number | boolean;
|
|
87
88
|
modelValue: {
|
|
88
89
|
[locale: string]: string | number | boolean;
|
|
89
90
|
} | null | undefined;
|
|
@@ -91,6 +92,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
91
92
|
component: "BaseInput" | "BaseTextarea";
|
|
92
93
|
locales: Locales;
|
|
93
94
|
componentProps: Record<string, any>;
|
|
94
|
-
defaultValue: string | number | boolean;
|
|
95
95
|
}>;
|
|
96
96
|
export default _default;
|
|
@@ -72,10 +72,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
72
72
|
"onUpload:end"?: ((...args: any[]) => any) | undefined;
|
|
73
73
|
}, {
|
|
74
74
|
loading: boolean;
|
|
75
|
+
accept: string;
|
|
75
76
|
disabled: boolean;
|
|
76
77
|
url: string;
|
|
77
78
|
buttonClass: string;
|
|
78
|
-
accept: string;
|
|
79
79
|
beforeUpload: () => boolean;
|
|
80
80
|
maxSize: number;
|
|
81
81
|
acceptedExtensions: string[];
|
|
@@ -45,7 +45,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
45
45
|
default: boolean;
|
|
46
46
|
type: BooleanConstructor;
|
|
47
47
|
};
|
|
48
|
-
}, {
|
|
48
|
+
}, {
|
|
49
|
+
focus: (() => void) | undefined;
|
|
50
|
+
blur: (() => void) | undefined;
|
|
51
|
+
open: (() => void) | undefined;
|
|
52
|
+
close: (() => void) | undefined;
|
|
53
|
+
setKeywords: ((input: string) => void) | undefined;
|
|
54
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
55
|
modelValue: {
|
|
50
56
|
required: true;
|
|
51
57
|
type: PropType<Option[] | null>;
|
|
@@ -94,12 +100,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
94
100
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
95
101
|
}, {
|
|
96
102
|
required: boolean;
|
|
97
|
-
placeholder: string;
|
|
98
103
|
disabled: boolean;
|
|
104
|
+
max: number;
|
|
105
|
+
placeholder: string;
|
|
99
106
|
hasError: boolean;
|
|
100
107
|
queryKey: string;
|
|
101
108
|
primaryKey: string;
|
|
102
|
-
max: number;
|
|
103
109
|
currentModels: Option[];
|
|
104
110
|
}>, {
|
|
105
111
|
option: (_: {
|
|
@@ -153,13 +153,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
153
153
|
name: string;
|
|
154
154
|
mask: string | Function | unknown[];
|
|
155
155
|
step: number;
|
|
156
|
-
modelValue: string | number | null;
|
|
157
|
-
placeholder: string;
|
|
158
|
-
disabled: boolean;
|
|
159
|
-
hasError: boolean;
|
|
160
156
|
autocomplete: boolean;
|
|
161
|
-
|
|
157
|
+
disabled: boolean;
|
|
162
158
|
max: number;
|
|
159
|
+
min: number;
|
|
160
|
+
placeholder: string;
|
|
161
|
+
modelValue: string | number | null;
|
|
162
|
+
hasError: boolean;
|
|
163
163
|
preventSubmit: boolean;
|
|
164
164
|
iconLeft: string;
|
|
165
165
|
iconRight: string;
|
|
@@ -122,12 +122,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
122
122
|
name: string;
|
|
123
123
|
step: number;
|
|
124
124
|
icon: string;
|
|
125
|
-
modelValue: string | number | null;
|
|
126
|
-
placeholder: string;
|
|
127
125
|
disabled: boolean;
|
|
128
|
-
hasError: boolean;
|
|
129
|
-
min: number;
|
|
130
126
|
max: number;
|
|
127
|
+
min: number;
|
|
128
|
+
placeholder: string;
|
|
129
|
+
modelValue: string | number | null;
|
|
130
|
+
hasError: boolean;
|
|
131
131
|
preventSubmit: boolean;
|
|
132
132
|
}>;
|
|
133
133
|
export default _default;
|
|
@@ -395,8 +395,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
395
395
|
}, {
|
|
396
396
|
required: boolean;
|
|
397
397
|
label: string;
|
|
398
|
-
placeholder: string;
|
|
399
398
|
disabled: boolean;
|
|
399
|
+
placeholder: string;
|
|
400
400
|
preventSubmit: boolean;
|
|
401
401
|
autofocus: boolean;
|
|
402
402
|
}>, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -430,10 +430,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
430
430
|
};
|
|
431
431
|
}>>, {
|
|
432
432
|
props: Record<string, any>;
|
|
433
|
+
defaultValue: string | number | boolean;
|
|
433
434
|
inputClass: string;
|
|
434
435
|
component: string;
|
|
435
436
|
locales: Locales;
|
|
436
|
-
defaultValue: string | number | boolean;
|
|
437
437
|
layout: string;
|
|
438
438
|
}>;
|
|
439
439
|
export default _default;
|
|
@@ -99,12 +99,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
99
99
|
"onUpload:end"?: ((...args: any[]) => any) | undefined;
|
|
100
100
|
}, {
|
|
101
101
|
name: string;
|
|
102
|
-
|
|
102
|
+
accept: string;
|
|
103
103
|
disabled: boolean;
|
|
104
|
-
hasError: boolean;
|
|
105
|
-
min: number;
|
|
106
104
|
max: number;
|
|
107
|
-
|
|
105
|
+
min: number;
|
|
106
|
+
modelValue: MediaLibraryPayload | null | undefined;
|
|
107
|
+
hasError: boolean;
|
|
108
108
|
maxSize: number;
|
|
109
109
|
acceptedExtensions: string[];
|
|
110
110
|
currentMedia: Media[];
|
|
@@ -372,8 +372,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
372
372
|
}, {
|
|
373
373
|
required: boolean;
|
|
374
374
|
label: string;
|
|
375
|
-
placeholder: string;
|
|
376
375
|
disabled: boolean;
|
|
376
|
+
placeholder: string;
|
|
377
377
|
preventSubmit: boolean;
|
|
378
378
|
autofocus: boolean;
|
|
379
379
|
}>, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -395,7 +395,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
395
395
|
};
|
|
396
396
|
}>>, {
|
|
397
397
|
step: number;
|
|
398
|
-
min: number;
|
|
399
398
|
max: number;
|
|
399
|
+
min: number;
|
|
400
400
|
}>;
|
|
401
401
|
export default _default;
|
|
@@ -54,9 +54,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
}, {
|
|
55
55
|
required: boolean;
|
|
56
56
|
name: string;
|
|
57
|
-
modelValue: string | null;
|
|
58
|
-
placeholder: string;
|
|
59
57
|
disabled: boolean;
|
|
58
|
+
placeholder: string;
|
|
59
|
+
modelValue: string | null;
|
|
60
60
|
hasError: boolean;
|
|
61
61
|
}>;
|
|
62
62
|
export default _default;
|
|
@@ -365,8 +365,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
365
365
|
}, {
|
|
366
366
|
required: boolean;
|
|
367
367
|
label: string;
|
|
368
|
-
placeholder: string;
|
|
369
368
|
disabled: boolean;
|
|
369
|
+
placeholder: string;
|
|
370
370
|
preventSubmit: boolean;
|
|
371
371
|
autofocus: boolean;
|
|
372
372
|
}>, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -86,8 +86,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
86
86
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
87
87
|
}, {
|
|
88
88
|
required: boolean;
|
|
89
|
-
modelValue: Option | undefined;
|
|
90
89
|
disabled: boolean;
|
|
90
|
+
modelValue: Option | undefined;
|
|
91
91
|
hasError: boolean;
|
|
92
92
|
inputClass: string;
|
|
93
93
|
labelClass: string;
|
|
@@ -81,9 +81,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
81
|
}, {
|
|
82
82
|
required: boolean;
|
|
83
83
|
name: string;
|
|
84
|
-
modelValue: string | Delta | undefined;
|
|
85
|
-
placeholder: string;
|
|
86
84
|
disabled: boolean;
|
|
85
|
+
placeholder: string;
|
|
86
|
+
modelValue: string | Delta | undefined;
|
|
87
87
|
hasError: boolean;
|
|
88
88
|
toolbar: string | string[];
|
|
89
89
|
theme: "" | "snow" | "bubble";
|
|
@@ -54,9 +54,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
54
54
|
}, {
|
|
55
55
|
required: boolean;
|
|
56
56
|
name: string;
|
|
57
|
-
modelValue: (string | number | null) | undefined;
|
|
58
|
-
placeholder: string;
|
|
59
57
|
disabled: boolean;
|
|
58
|
+
placeholder: string;
|
|
59
|
+
modelValue: (string | number | null) | undefined;
|
|
60
60
|
hasError: boolean;
|
|
61
61
|
}>, {
|
|
62
62
|
default: (_: {}) => any;
|
|
@@ -155,8 +155,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
155
155
|
meta: Record<string, any> | unknown[];
|
|
156
156
|
label: string;
|
|
157
157
|
toggle: boolean;
|
|
158
|
-
field: string;
|
|
159
158
|
width: number;
|
|
159
|
+
field: string;
|
|
160
160
|
position: "left" | "right" | "center";
|
|
161
161
|
searchable: boolean;
|
|
162
162
|
customKey: string | number;
|
|
@@ -149,12 +149,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
149
149
|
loading: boolean;
|
|
150
150
|
loadingBottom: boolean;
|
|
151
151
|
size: "base" | "xs" | "sm";
|
|
152
|
-
placeholder: string;
|
|
153
152
|
disabled: boolean;
|
|
153
|
+
max: number;
|
|
154
|
+
placeholder: string;
|
|
154
155
|
hasError: boolean;
|
|
155
156
|
inline: boolean;
|
|
156
157
|
dropdownShow: "focus" | "always";
|
|
157
|
-
max: number;
|
|
158
158
|
}>, {
|
|
159
159
|
empty: (_: {
|
|
160
160
|
focus: () => void;
|
|
@@ -41,7 +41,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
41
41
|
default: boolean;
|
|
42
42
|
type: BooleanConstructor;
|
|
43
43
|
};
|
|
44
|
-
}, {
|
|
44
|
+
}, {
|
|
45
|
+
focus: (() => void) | undefined;
|
|
46
|
+
blur: (() => void) | undefined;
|
|
47
|
+
open: (() => void) | undefined;
|
|
48
|
+
close: (() => void) | undefined;
|
|
49
|
+
setKeywords: ((input: string) => void) | undefined;
|
|
50
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "focus" | "scrollBottom" | "typing")[], "update:modelValue" | "focus" | "scrollBottom" | "typing", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
51
|
modelValue: {
|
|
46
52
|
required: true;
|
|
47
53
|
type: PropType<Option[]>;
|
|
@@ -89,11 +95,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
89
95
|
onTyping?: ((...args: any[]) => any) | undefined;
|
|
90
96
|
}, {
|
|
91
97
|
required: boolean;
|
|
92
|
-
placeholder: string;
|
|
93
98
|
disabled: boolean;
|
|
99
|
+
max: number;
|
|
100
|
+
placeholder: string;
|
|
94
101
|
hasError: boolean;
|
|
95
102
|
queryKey: string;
|
|
96
|
-
max: number;
|
|
97
103
|
}>, {
|
|
98
104
|
option: (_: {
|
|
99
105
|
focus: () => void;
|
|
@@ -87,11 +87,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
87
|
required: boolean;
|
|
88
88
|
type: string;
|
|
89
89
|
name: string;
|
|
90
|
-
|
|
91
|
-
placeholder: string;
|
|
90
|
+
autocomplete: boolean;
|
|
92
91
|
disabled: boolean;
|
|
92
|
+
placeholder: string;
|
|
93
|
+
modelValue: string | null | undefined;
|
|
93
94
|
hasError: boolean;
|
|
94
|
-
autocomplete: boolean;
|
|
95
95
|
preventSubmit: boolean;
|
|
96
96
|
rows: number;
|
|
97
97
|
}>;
|
|
@@ -87,9 +87,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
87
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
88
88
|
}, {
|
|
89
89
|
required: boolean;
|
|
90
|
-
modelValue: string;
|
|
91
|
-
placeholder: string;
|
|
92
90
|
disabled: boolean;
|
|
91
|
+
placeholder: string;
|
|
92
|
+
modelValue: string;
|
|
93
93
|
hasError: boolean;
|
|
94
94
|
maxHeight: number;
|
|
95
95
|
rows: number;
|
|
@@ -379,8 +379,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
379
379
|
}, {
|
|
380
380
|
required: boolean;
|
|
381
381
|
label: string;
|
|
382
|
-
placeholder: string;
|
|
383
382
|
disabled: boolean;
|
|
383
|
+
placeholder: string;
|
|
384
384
|
preventSubmit: boolean;
|
|
385
385
|
autofocus: boolean;
|
|
386
386
|
}>, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -406,8 +406,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
406
406
|
};
|
|
407
407
|
}>>, {
|
|
408
408
|
type: string;
|
|
409
|
-
min: number;
|
|
410
409
|
max: number;
|
|
410
|
+
min: number;
|
|
411
411
|
rows: number;
|
|
412
412
|
}>;
|
|
413
413
|
export default _default;
|
package/package.json
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
]"
|
|
70
70
|
>
|
|
71
71
|
<BaseAutocompleteDropdown
|
|
72
|
+
ref="dropdown"
|
|
72
73
|
:selected="normalizedModelValue"
|
|
73
74
|
:options="filteredNormalizedOptions"
|
|
74
75
|
:size="size"
|
|
@@ -199,6 +200,10 @@ const hasOptions = useHasOptions(
|
|
|
199
200
|
computed(() => false)
|
|
200
201
|
);
|
|
201
202
|
|
|
203
|
+
const dropdown = ref(null) as Ref<InstanceType<
|
|
204
|
+
typeof BaseAutocompleteDropdown
|
|
205
|
+
> | null>;
|
|
206
|
+
|
|
202
207
|
let timerId = 0;
|
|
203
208
|
const keywords = ref('');
|
|
204
209
|
const autocomplete = ref(null) as Ref<HTMLElement | null>;
|
|
@@ -285,6 +290,8 @@ const onTextInput = (event: Event) => {
|
|
|
285
290
|
const onTextKeydown = (event: KeyboardEvent) => {
|
|
286
291
|
const key = event.key;
|
|
287
292
|
|
|
293
|
+
dropdown.value?.onKeydown(event);
|
|
294
|
+
|
|
288
295
|
// Prevent default behavior for up/down arrows
|
|
289
296
|
|
|
290
297
|
if (key === 'ArrowUp') {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<li
|
|
20
20
|
v-for="(option, index) in options"
|
|
21
21
|
:key="option.value"
|
|
22
|
-
|
|
22
|
+
:data-index="index"
|
|
23
23
|
class="block"
|
|
24
24
|
>
|
|
25
25
|
<button
|
|
@@ -141,7 +141,6 @@ const props = defineProps({
|
|
|
141
141
|
const emit = defineEmits(['scrollBottom', 'select']);
|
|
142
142
|
|
|
143
143
|
const dropdown = ref(null) as Ref<HTMLDivElement | null>;
|
|
144
|
-
const optionRefs = ref([]) as Ref<HTMLElement[]>;
|
|
145
144
|
|
|
146
145
|
let mouseIsMoving = false;
|
|
147
146
|
|
|
@@ -177,13 +176,7 @@ function isSelected(option: NormalizedOption): boolean {
|
|
|
177
176
|
|
|
178
177
|
// Arrow actions
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
onBeforeUnmount(() => {
|
|
183
|
-
window.removeEventListener('keydown', onKeyDown);
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
function onKeyDown(event: KeyboardEvent) {
|
|
179
|
+
function onKeydown(event: KeyboardEvent) {
|
|
187
180
|
const key = event.key;
|
|
188
181
|
|
|
189
182
|
mouseIsMoving = false;
|
|
@@ -238,11 +231,9 @@ function scrollToFocus() {
|
|
|
238
231
|
return;
|
|
239
232
|
}
|
|
240
233
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const option = optionRefs.value[focusIndex.value] ?? null;
|
|
234
|
+
const option = dropdown.value.querySelector(
|
|
235
|
+
`[data-index="${focusIndex.value}"]`
|
|
236
|
+
) as HTMLElement | null;
|
|
246
237
|
|
|
247
238
|
if (!option) {
|
|
248
239
|
return;
|
|
@@ -260,9 +251,8 @@ function scrollToFocus() {
|
|
|
260
251
|
watch(
|
|
261
252
|
() => props.options,
|
|
262
253
|
() => {
|
|
263
|
-
|
|
264
|
-
0,
|
|
265
|
-
Math.min(focusIndex.value, props.options.length - 1)
|
|
254
|
+
updateFocusIndex(
|
|
255
|
+
Math.max(0, Math.min(focusIndex.value, props.options.length - 1))
|
|
266
256
|
);
|
|
267
257
|
},
|
|
268
258
|
{ immediate: true }
|
|
@@ -273,20 +263,23 @@ watch(
|
|
|
273
263
|
watch(
|
|
274
264
|
() => props.selected,
|
|
275
265
|
() => {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
isObject(props.selected) &&
|
|
279
|
-
!isArray(props.selected)
|
|
280
|
-
) {
|
|
266
|
+
// Single selection
|
|
267
|
+
if (isObject(props.selected) && !isArray(props.selected)) {
|
|
281
268
|
const selected = props.selected as NormalizedOption;
|
|
282
269
|
const index = props.options.findIndex(
|
|
283
270
|
(option) => option.value === selected.value
|
|
284
271
|
);
|
|
285
272
|
if (index >= 0) {
|
|
286
|
-
|
|
273
|
+
updateFocusIndex(index);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// Multiple selection
|
|
277
|
+
else if (isArray(props.selected)) {
|
|
278
|
+
if (!(focusIndex.value in props.options)) {
|
|
279
|
+
updateFocusIndex(props.options.length - 1);
|
|
287
280
|
}
|
|
288
281
|
} else {
|
|
289
|
-
|
|
282
|
+
updateFocusIndex(0);
|
|
290
283
|
}
|
|
291
284
|
},
|
|
292
285
|
{ immediate: true }
|
|
@@ -301,10 +294,17 @@ watch(
|
|
|
301
294
|
dropdown.value.scrollTop = 0;
|
|
302
295
|
}
|
|
303
296
|
// Reset the focusIndex
|
|
304
|
-
|
|
297
|
+
updateFocusIndex(0);
|
|
305
298
|
}
|
|
306
299
|
);
|
|
307
300
|
|
|
301
|
+
function updateFocusIndex(index: number) {
|
|
302
|
+
if (index != focusIndex.value) {
|
|
303
|
+
focusIndex.value = index;
|
|
304
|
+
scrollToFocus();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
308
|
const onOptionMouseEnter = (index: number) => {
|
|
309
309
|
if (mouseIsMoving) {
|
|
310
310
|
focusIndex.value = index;
|
|
@@ -346,4 +346,8 @@ const optionIconClass = computed(() => {
|
|
|
346
346
|
}
|
|
347
347
|
return 'w-5 h-5';
|
|
348
348
|
});
|
|
349
|
+
|
|
350
|
+
defineExpose({
|
|
351
|
+
onKeydown,
|
|
352
|
+
});
|
|
349
353
|
</script>
|