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
|
@@ -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>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BaseTagAutocompleteFetch
|
|
3
|
+
ref="tagAutocompleteFetch"
|
|
3
4
|
:model-value="models"
|
|
4
5
|
:url="url"
|
|
5
6
|
:disabled="disabled"
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
</template>
|
|
26
27
|
|
|
27
28
|
<script lang="ts" setup>
|
|
28
|
-
import { PropType } from 'vue';
|
|
29
|
+
import { PropType, Ref } from 'vue';
|
|
29
30
|
import { Option } from '@/types';
|
|
30
31
|
import BaseTagAutocompleteFetch from './BaseTagAutocompleteFetch.vue';
|
|
31
32
|
|
|
@@ -80,6 +81,10 @@ const props = defineProps({
|
|
|
80
81
|
|
|
81
82
|
const emit = defineEmits(['update:modelValue']);
|
|
82
83
|
|
|
84
|
+
const tagAutocompleteFetch = ref(null) as Ref<InstanceType<
|
|
85
|
+
typeof BaseTagAutocompleteFetch
|
|
86
|
+
> | null>;
|
|
87
|
+
|
|
83
88
|
const models = ref(props.currentModels);
|
|
84
89
|
|
|
85
90
|
watch(
|
|
@@ -97,4 +102,12 @@ function onUpdate(newModels: Option[]) {
|
|
|
97
102
|
newModels.map((m) => m[props.primaryKey])
|
|
98
103
|
);
|
|
99
104
|
}
|
|
105
|
+
|
|
106
|
+
defineExpose({
|
|
107
|
+
focus: tagAutocompleteFetch.value?.focus,
|
|
108
|
+
blur: tagAutocompleteFetch.value?.blur,
|
|
109
|
+
open: tagAutocompleteFetch.value?.open,
|
|
110
|
+
close: tagAutocompleteFetch.value?.close,
|
|
111
|
+
setKeywords: tagAutocompleteFetch.value?.setKeywords,
|
|
112
|
+
});
|
|
100
113
|
</script>
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
]"
|
|
62
62
|
>
|
|
63
63
|
<BaseAutocompleteDropdown
|
|
64
|
+
ref="dropdown"
|
|
64
65
|
:selected="normalizedModelValue"
|
|
65
66
|
:options="filteredNormalizedOptions"
|
|
66
67
|
:size="size"
|
|
@@ -189,6 +190,10 @@ const hasOptions = useHasOptions(
|
|
|
189
190
|
computed(() => true)
|
|
190
191
|
);
|
|
191
192
|
|
|
193
|
+
const dropdown = ref(null) as Ref<InstanceType<
|
|
194
|
+
typeof BaseAutocompleteDropdown
|
|
195
|
+
> | null>;
|
|
196
|
+
|
|
192
197
|
const keywords = ref('');
|
|
193
198
|
const autocomplete = ref(null) as Ref<HTMLElement | null>;
|
|
194
199
|
const inputElement = ref(null) as Ref<HTMLInputElement | null>;
|
|
@@ -254,6 +259,8 @@ const onTextInput = (event: Event) => {
|
|
|
254
259
|
const onTextKeydown = (event: KeyboardEvent) => {
|
|
255
260
|
const key = event.key;
|
|
256
261
|
|
|
262
|
+
dropdown.value?.onKeydown(event);
|
|
263
|
+
|
|
257
264
|
// Prevent default behavior for up/down arrows
|
|
258
265
|
|
|
259
266
|
if (key === 'ArrowUp') {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BaseTagAutocomplete
|
|
3
|
+
ref="tagAutocomplete"
|
|
3
4
|
:loading="showLoading && page == 1"
|
|
4
5
|
:loading-bottom="showLoading && page > 1"
|
|
5
6
|
:model-value="modelValue"
|
|
@@ -89,6 +90,10 @@ const props = defineProps({
|
|
|
89
90
|
|
|
90
91
|
defineEmits(['update:modelValue', 'typing', 'focus', 'scrollBottom']);
|
|
91
92
|
|
|
93
|
+
const tagAutocomplete = ref(null) as Ref<InstanceType<
|
|
94
|
+
typeof BaseTagAutocomplete
|
|
95
|
+
> | null>;
|
|
96
|
+
|
|
92
97
|
const http = config.http;
|
|
93
98
|
|
|
94
99
|
const showLoading = ref(false);
|
|
@@ -167,4 +172,12 @@ const search = () => {
|
|
|
167
172
|
const debouncedSearch = debounce(() => {
|
|
168
173
|
search();
|
|
169
174
|
}, 300);
|
|
175
|
+
|
|
176
|
+
defineExpose({
|
|
177
|
+
focus: tagAutocomplete.value?.focus,
|
|
178
|
+
blur: tagAutocomplete.value?.blur,
|
|
179
|
+
open: tagAutocomplete.value?.open,
|
|
180
|
+
close: tagAutocomplete.value?.close,
|
|
181
|
+
setKeywords: tagAutocomplete.value?.setKeywords,
|
|
182
|
+
});
|
|
170
183
|
</script>
|