sprintify-ui 0.0.101 → 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 +6172 -6135
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +2 -2
- 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/BaseAutocompleteDropdown.vue +24 -18
- package/src/components/BaseAutocompleteFetch.vue +13 -1
- package/src/components/BaseBelongsTo.vue +14 -1
- package/src/components/BaseHasMany.vue +14 -1
- 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";
|
|
@@ -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
|
@@ -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
|
|
|
@@ -232,11 +231,9 @@ function scrollToFocus() {
|
|
|
232
231
|
return;
|
|
233
232
|
}
|
|
234
233
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const option = optionRefs.value[focusIndex.value] ?? null;
|
|
234
|
+
const option = dropdown.value.querySelector(
|
|
235
|
+
`[data-index="${focusIndex.value}"]`
|
|
236
|
+
) as HTMLElement | null;
|
|
240
237
|
|
|
241
238
|
if (!option) {
|
|
242
239
|
return;
|
|
@@ -254,9 +251,8 @@ function scrollToFocus() {
|
|
|
254
251
|
watch(
|
|
255
252
|
() => props.options,
|
|
256
253
|
() => {
|
|
257
|
-
|
|
258
|
-
0,
|
|
259
|
-
Math.min(focusIndex.value, props.options.length - 1)
|
|
254
|
+
updateFocusIndex(
|
|
255
|
+
Math.max(0, Math.min(focusIndex.value, props.options.length - 1))
|
|
260
256
|
);
|
|
261
257
|
},
|
|
262
258
|
{ immediate: true }
|
|
@@ -267,20 +263,23 @@ watch(
|
|
|
267
263
|
watch(
|
|
268
264
|
() => props.selected,
|
|
269
265
|
() => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
isObject(props.selected) &&
|
|
273
|
-
!isArray(props.selected)
|
|
274
|
-
) {
|
|
266
|
+
// Single selection
|
|
267
|
+
if (isObject(props.selected) && !isArray(props.selected)) {
|
|
275
268
|
const selected = props.selected as NormalizedOption;
|
|
276
269
|
const index = props.options.findIndex(
|
|
277
270
|
(option) => option.value === selected.value
|
|
278
271
|
);
|
|
279
272
|
if (index >= 0) {
|
|
280
|
-
|
|
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);
|
|
281
280
|
}
|
|
282
281
|
} else {
|
|
283
|
-
|
|
282
|
+
updateFocusIndex(0);
|
|
284
283
|
}
|
|
285
284
|
},
|
|
286
285
|
{ immediate: true }
|
|
@@ -295,10 +294,17 @@ watch(
|
|
|
295
294
|
dropdown.value.scrollTop = 0;
|
|
296
295
|
}
|
|
297
296
|
// Reset the focusIndex
|
|
298
|
-
|
|
297
|
+
updateFocusIndex(0);
|
|
299
298
|
}
|
|
300
299
|
);
|
|
301
300
|
|
|
301
|
+
function updateFocusIndex(index: number) {
|
|
302
|
+
if (index != focusIndex.value) {
|
|
303
|
+
focusIndex.value = index;
|
|
304
|
+
scrollToFocus();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
302
308
|
const onOptionMouseEnter = (index: number) => {
|
|
303
309
|
if (mouseIsMoving) {
|
|
304
310
|
focusIndex.value = index;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BaseAutocomplete
|
|
3
|
-
ref="
|
|
3
|
+
ref="autocomplete"
|
|
4
4
|
:loading="showLoading && page == 1"
|
|
5
5
|
:loading-bottom="showLoading && page > 1"
|
|
6
6
|
:model-value="modelValue"
|
|
@@ -140,6 +140,10 @@ const keywords = ref('');
|
|
|
140
140
|
const page = ref(1);
|
|
141
141
|
const options = ref([]) as Ref<Option[]>;
|
|
142
142
|
|
|
143
|
+
const autocomplete = ref(null) as Ref<InstanceType<
|
|
144
|
+
typeof BaseAutocomplete
|
|
145
|
+
> | null>;
|
|
146
|
+
|
|
143
147
|
const onTyping = (query: string) => {
|
|
144
148
|
page.value = 1;
|
|
145
149
|
reachedEnd.value = false;
|
|
@@ -212,4 +216,12 @@ function search() {
|
|
|
212
216
|
const debouncedSearch = debounce(() => {
|
|
213
217
|
search();
|
|
214
218
|
}, 300);
|
|
219
|
+
|
|
220
|
+
defineExpose({
|
|
221
|
+
focus: autocomplete.value?.focus,
|
|
222
|
+
blur: autocomplete.value?.blur,
|
|
223
|
+
open: autocomplete.value?.open,
|
|
224
|
+
close: autocomplete.value?.close,
|
|
225
|
+
setKeywords: autocomplete.value?.setKeywords,
|
|
226
|
+
});
|
|
215
227
|
</script>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BaseAutocompleteFetch
|
|
3
|
+
ref="autocompleteFetch"
|
|
3
4
|
:model-value="model"
|
|
4
5
|
:url="url"
|
|
5
6
|
:disabled="disabled"
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
</template>
|
|
30
31
|
|
|
31
32
|
<script lang="ts" setup>
|
|
32
|
-
import { PropType } from 'vue';
|
|
33
|
+
import { PropType, Ref } from 'vue';
|
|
33
34
|
import { AxiosResponse } from 'axios';
|
|
34
35
|
import { config } from '@/index';
|
|
35
36
|
import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
|
|
@@ -108,6 +109,10 @@ const http = config.http;
|
|
|
108
109
|
|
|
109
110
|
const emit = defineEmits(['update:modelValue']);
|
|
110
111
|
|
|
112
|
+
const autocompleteFetch = ref(null) as Ref<InstanceType<
|
|
113
|
+
typeof BaseAutocompleteFetch
|
|
114
|
+
> | null>;
|
|
115
|
+
|
|
111
116
|
const model = ref(props.currentModel);
|
|
112
117
|
|
|
113
118
|
watch(
|
|
@@ -153,4 +158,12 @@ function onUpdate(newModel: Option | null) {
|
|
|
153
158
|
emit('update:modelValue', newModel[props.primaryKey]);
|
|
154
159
|
}
|
|
155
160
|
}
|
|
161
|
+
|
|
162
|
+
defineExpose({
|
|
163
|
+
focus: autocompleteFetch.value?.focus,
|
|
164
|
+
blur: autocompleteFetch.value?.blur,
|
|
165
|
+
open: autocompleteFetch.value?.open,
|
|
166
|
+
close: autocompleteFetch.value?.close,
|
|
167
|
+
setKeywords: autocompleteFetch.value?.setKeywords,
|
|
168
|
+
});
|
|
156
169
|
</script>
|