eco-vue-js 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Button/WButtonGroup.vue.d.ts +5 -4
- package/dist/components/Button/WButtonGroup.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonGroup.vue.js +12 -4
- package/dist/components/Button/types.d.ts +17 -6
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Form/WFormValidator.vue.d.ts.map +1 -1
- package/dist/components/Form/WFormValidator.vue.js +3 -4
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.d.ts +25 -0
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.d.ts.map +1 -0
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.js +101 -0
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue2.js +5 -0
- package/dist/components/FormAsync/WFormAsyncInput.vue.d.ts +26 -0
- package/dist/components/FormAsync/WFormAsyncInput.vue.d.ts.map +1 -0
- package/dist/components/FormAsync/WFormAsyncInput.vue.js +131 -0
- package/dist/components/FormAsync/WFormAsyncInput.vue2.js +5 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.d.ts +27 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.d.ts.map +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +139 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue2.js +5 -0
- package/dist/components/FormAsync/WFormAsyncToggle.vue.d.ts +22 -0
- package/dist/components/FormAsync/WFormAsyncToggle.vue.d.ts.map +1 -0
- package/dist/components/FormAsync/WFormAsyncToggle.vue.js +89 -0
- package/dist/components/FormAsync/WFormAsyncToggle.vue2.js +5 -0
- package/dist/components/FormAsync/types.d.ts +85 -0
- package/dist/components/FormAsync/types.d.ts.map +1 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +3 -3
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts +3 -3
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +6 -6
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.d.ts +2 -2
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +2 -2
- package/dist/components/Select/WSelect.vue.d.ts +12 -13
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +44 -33
- package/dist/components/Select/WSelectAsync.vue.d.ts +4 -5
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +20 -15
- package/dist/components/Select/WSelectAsyncList.vue.d.ts +3 -3
- package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts +2 -5
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.js +4 -7
- package/dist/components/Select/WSelectSingle.vue.d.ts +8 -8
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +3 -2
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts +3 -3
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncPrefix.vue.d.ts +4 -2
- package/dist/components/Select/components/SelectAsyncPrefix.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncPrefix.vue.js +2 -1
- package/dist/components/Select/components/SelectAsyncPrefixPage.vue.d.ts +4 -2
- package/dist/components/Select/components/SelectAsyncPrefixPage.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncPrefixPage.vue.js +4 -2
- package/dist/components/Select/components/SelectOptionPrefix.vue.d.ts +2 -2
- package/dist/components/Select/components/SelectOptionPrefix.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectOptionPrefix.vue.js +3 -1
- package/dist/components/Select/types.d.ts +22 -20
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Tabs/WTabs.vue.d.ts +2 -2
- package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
- package/dist/components/Tabs/WTabs.vue.js +3 -3
- package/dist/components/Toggle/WToggle.vue.d.ts +3 -12
- package/dist/components/Toggle/WToggle.vue.d.ts.map +1 -1
- package/dist/components/Toggle/WToggle.vue.js +3 -1
- package/dist/components/Toggle/types.d.ts +13 -0
- package/dist/components/Toggle/types.d.ts.map +1 -0
- package/dist/imports/componentsPlugin.d.ts +5 -1
- package/dist/imports/componentsPlugin.d.ts.map +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +8 -1
- package/dist/types/global.d.ts +98 -10
- package/dist/utils/api.d.ts +16 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/api.js +28 -0
- package/dist/utils/useDefaultQuery.d.ts +2 -1
- package/dist/utils/useDefaultQuery.d.ts.map +1 -1
- package/dist/utils/useQueryUpdater.d.ts +12 -0
- package/dist/utils/useQueryUpdater.d.ts.map +1 -0
- package/dist/utils/useQueryUpdater.js +56 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +13 -1
- package/dist/utils/validate.d.ts +2 -0
- package/dist/utils/validate.d.ts.map +1 -0
- package/dist/utils/validate.js +3 -0
- package/package.json +28 -1
@@ -16,8 +16,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
16
|
__name: "WSelect",
|
17
17
|
props: {
|
18
18
|
modelValue: {},
|
19
|
-
|
20
|
-
|
19
|
+
useQueryFnOptions: {},
|
20
|
+
valueGetter: { type: Function },
|
21
|
+
searchFn: { type: Function },
|
21
22
|
emptyStub: {},
|
22
23
|
disableClear: { type: Boolean },
|
23
24
|
hidePrefix: { type: Boolean },
|
@@ -62,7 +63,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
62
63
|
optionComponent: {},
|
63
64
|
optionComponentProps: {}
|
64
65
|
},
|
65
|
-
emits: ["select", "unselect", "
|
66
|
+
emits: ["select", "unselect", "create:option", "focus", "blur"],
|
66
67
|
setup(__props, { expose: __expose, emit: __emit }) {
|
67
68
|
const props = __props;
|
68
69
|
const emit = __emit;
|
@@ -70,11 +71,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
70
71
|
const input = ref();
|
71
72
|
const cursor = ref(-1);
|
72
73
|
const isCursorLocked = ref(false);
|
73
|
-
const
|
74
|
+
const search = ref("");
|
75
|
+
const { data, isLoading } = props.useQueryFnOptions();
|
76
|
+
const filteredOptions = computed(() => !data.value ? [] : search.value === "" ? data.value : data.value.filter((option) => props.searchFn(option, search.value)));
|
77
|
+
const lastIndex = computed(() => props.allowCreate ? filteredOptions.value.length : filteredOptions.value.length - 1);
|
74
78
|
const isMobile = getIsMobile();
|
75
79
|
const focused = ref(false);
|
76
80
|
const loadingOptionIndex = ref(null);
|
77
81
|
const isDisabled = computed(() => props.loading || props.readonly || props.disabled);
|
82
|
+
const prefixList = computed(() => props.modelValue.map((value) => data.value?.find((item) => props.valueGetter(item) === value)).filter((item) => item !== void 0));
|
78
83
|
const close = () => {
|
79
84
|
isOpen.value = false;
|
80
85
|
focused.value = false;
|
@@ -97,27 +102,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
97
102
|
const cursorUp = () => {
|
98
103
|
if (isDisabled.value) return;
|
99
104
|
lockCursor();
|
100
|
-
cursor.value = !
|
105
|
+
cursor.value = !filteredOptions.value.length ? 0 : cursor.value < 1 ? lastIndex.value : cursor.value - 1;
|
101
106
|
};
|
102
107
|
const cursorDown = () => {
|
103
108
|
if (isDisabled.value) return;
|
104
109
|
lockCursor();
|
105
|
-
cursor.value = !
|
110
|
+
cursor.value = !filteredOptions.value.length ? 0 : cursor.value >= lastIndex.value ? 0 : cursor.value + 1;
|
106
111
|
};
|
107
112
|
const selectCursor = () => {
|
108
113
|
if (isDisabled.value) return;
|
109
|
-
const value = cursor.value !== -1 ? props.
|
114
|
+
const value = cursor.value !== -1 ? props.valueGetter(filteredOptions.value[cursor.value]) : void 0;
|
110
115
|
if (value) {
|
111
116
|
setLoadingOptionIndex(cursor.value);
|
112
117
|
if (props.modelValue.includes(value)) unselect(value);
|
113
118
|
else select(value);
|
114
119
|
} else {
|
115
|
-
if (
|
120
|
+
if (search.value) createOption(search.value);
|
116
121
|
}
|
117
122
|
};
|
118
123
|
let deletePressTimeout = null;
|
119
124
|
const captureDoubleDelete = () => {
|
120
|
-
if (!props.modelValue.length ||
|
125
|
+
if (!props.modelValue.length || search.value.length) return;
|
121
126
|
if (deletePressTimeout) {
|
122
127
|
unselect(props.modelValue[props.modelValue.length - 1]);
|
123
128
|
clearTimeout(deletePressTimeout);
|
@@ -131,16 +136,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
131
136
|
const select = (item) => {
|
132
137
|
if (isDisabled.value) return;
|
133
138
|
emit("select", item);
|
139
|
+
search.value = "";
|
134
140
|
};
|
135
141
|
const unselect = (item) => {
|
136
142
|
if (isDisabled.value) return;
|
137
143
|
emit("unselect", item);
|
144
|
+
search.value = "";
|
138
145
|
};
|
139
146
|
const createOption = (item) => {
|
140
147
|
if (isDisabled.value) return;
|
141
148
|
if (!props.allowCreate) return;
|
142
|
-
setLoadingOptionIndex(
|
149
|
+
setLoadingOptionIndex(filteredOptions.value.length);
|
143
150
|
emit("create:option", item);
|
151
|
+
search.value = "";
|
144
152
|
};
|
145
153
|
const focus = () => {
|
146
154
|
input.value?.focus();
|
@@ -162,11 +170,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
162
170
|
ref: input
|
163
171
|
}, {
|
164
172
|
...props,
|
165
|
-
modelValue:
|
166
|
-
hideInput: _ctx.modelValue.length === 0 ? false : unref(isMobile) ? !focused.value : !isOpen.value
|
173
|
+
modelValue: search.value,
|
174
|
+
hideInput: _ctx.modelValue.length === 0 ? false : unref(isMobile) ? !focused.value : !isOpen.value,
|
175
|
+
loading: _ctx.loading || unref(isLoading)
|
167
176
|
}, {
|
168
177
|
class: _ctx.$attrs.class,
|
169
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => !_ctx.loading &&
|
178
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => !_ctx.loading && !unref(isLoading) && (search.value = $event ?? "")),
|
170
179
|
"onKeypress:enter": withModifiers(selectCursor, ["stop", "prevent"]),
|
171
180
|
"onKeypress:up": withModifiers(cursorUp, ["prevent"]),
|
172
181
|
"onKeypress:down": withModifiers(cursorDown, ["prevent"]),
|
@@ -174,7 +183,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
174
183
|
onOpen: _cache[3] || (_cache[3] = ($event) => isOpen.value = true),
|
175
184
|
onClose: _cache[4] || (_cache[4] = ($event) => {
|
176
185
|
close();
|
177
|
-
|
186
|
+
search.value = "";
|
178
187
|
}),
|
179
188
|
onFocus: _cache[5] || (_cache[5] = ($event) => {
|
180
189
|
focused.value = true;
|
@@ -186,47 +195,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
186
195
|
})
|
187
196
|
}), createSlots({
|
188
197
|
prefix: withCtx(({ unclickable }) => [
|
189
|
-
(_ctx.hidePrefix ? unref(isMobile) ? unclickable || !focused.value : !isOpen.value : true) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(
|
198
|
+
(_ctx.hidePrefix ? unref(isMobile) ? unclickable || !focused.value : !isOpen.value : true) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(prefixList.value, (option, index) => {
|
190
199
|
return openBlock(), createBlock(_sfc_main$2, {
|
191
|
-
key: option,
|
200
|
+
key: _ctx.valueGetter(option),
|
192
201
|
option,
|
193
202
|
"option-component": _ctx.optionComponent,
|
194
203
|
"option-component-props": _ctx.optionComponentProps,
|
195
|
-
|
204
|
+
index,
|
205
|
+
loading: _ctx.loading || unref(isLoading),
|
196
206
|
disabled: _ctx.disabled,
|
197
207
|
"disable-clear": _ctx.disableClear,
|
198
|
-
onUnselect: ($event) => unselect(option)
|
208
|
+
onUnselect: ($event) => unselect(_ctx.valueGetter(option))
|
199
209
|
}, {
|
200
210
|
option: withCtx(() => [
|
201
211
|
renderSlot(_ctx.$slots, "option", {
|
202
212
|
option,
|
203
213
|
selected: true,
|
204
|
-
model: true
|
214
|
+
model: true,
|
215
|
+
index
|
205
216
|
})
|
206
217
|
]),
|
207
218
|
_: 2
|
208
|
-
}, 1032, ["option", "option-component", "option-component-props", "loading", "disabled", "disable-clear", "onUnselect"]);
|
219
|
+
}, 1032, ["option", "option-component", "option-component-props", "index", "loading", "disabled", "disable-clear", "onUnselect"]);
|
209
220
|
}), 128)) : createCommentVNode("", true)
|
210
221
|
]),
|
211
222
|
content: withCtx(() => [
|
212
|
-
!
|
223
|
+
!filteredOptions.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
213
224
|
createElementVNode("div", _hoisted_2, toDisplayString(_ctx.emptyStub ?? "No match"), 1)
|
214
225
|
])) : createCommentVNode("", true),
|
215
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
226
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
|
216
227
|
return openBlock(), createBlock(_sfc_main$3, {
|
217
|
-
key: option,
|
218
|
-
"is-selected": _ctx.modelValue.includes(option),
|
228
|
+
key: _ctx.valueGetter(option),
|
229
|
+
"is-selected": _ctx.modelValue.includes(_ctx.valueGetter(option)),
|
219
230
|
"is-cursor": index === cursor.value,
|
220
231
|
loading: loadingOptionIndex.value === index && _ctx.loading,
|
221
232
|
scroll: isCursorLocked.value,
|
222
233
|
"hide-option-icon": _ctx.hideOptionIcon,
|
223
234
|
class: "first:pt-4 last:pb-4",
|
224
235
|
onSelect: ($event) => {
|
225
|
-
select(option);
|
236
|
+
select(_ctx.valueGetter(option));
|
226
237
|
setLoadingOptionIndex(index);
|
227
238
|
},
|
228
239
|
onUnselect: ($event) => {
|
229
|
-
unselect(option);
|
240
|
+
unselect(_ctx.valueGetter(option));
|
230
241
|
setLoadingOptionIndex(index);
|
231
242
|
},
|
232
243
|
onMouseenter: ($event) => setCursor(index)
|
@@ -247,28 +258,28 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
247
258
|
_: 2
|
248
259
|
}, 1032, ["is-selected", "is-cursor", "loading", "scroll", "hide-option-icon", "onSelect", "onUnselect", "onMouseenter"]);
|
249
260
|
}), 128)),
|
250
|
-
_ctx.allowCreate &&
|
261
|
+
_ctx.allowCreate && search.value !== "" ? (openBlock(), createBlock(_sfc_main$3, {
|
251
262
|
key: 1,
|
252
263
|
"is-selected": false,
|
253
|
-
"is-cursor": cursor.value ===
|
254
|
-
loading: loadingOptionIndex.value ===
|
264
|
+
"is-cursor": cursor.value === filteredOptions.value.length,
|
265
|
+
loading: loadingOptionIndex.value === filteredOptions.value.length && _ctx.loading,
|
255
266
|
scroll: isCursorLocked.value,
|
256
267
|
"hide-option-icon": _ctx.hideOptionIcon,
|
257
268
|
class: "first:pt-4 last:pb-4",
|
258
|
-
onSelect: _cache[0] || (_cache[0] = ($event) => createOption(
|
259
|
-
onMouseenter: _cache[1] || (_cache[1] = ($event) => setCursor(
|
269
|
+
onSelect: _cache[0] || (_cache[0] = ($event) => createOption(search.value)),
|
270
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => setCursor(filteredOptions.value.length))
|
260
271
|
}, {
|
261
272
|
prefix: withCtx(() => [
|
262
273
|
_hoisted_3
|
263
274
|
]),
|
264
275
|
default: withCtx(() => [
|
265
276
|
renderSlot(_ctx.$slots, "option", {
|
266
|
-
option:
|
277
|
+
option: search.value,
|
267
278
|
selected: false,
|
268
279
|
model: false
|
269
280
|
}, () => [
|
270
281
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.optionComponent), mergeProps(_ctx.optionComponentProps, {
|
271
|
-
option:
|
282
|
+
option: search.value,
|
272
283
|
selected: false,
|
273
284
|
model: false
|
274
285
|
}), null, 16, ["option"]))
|
@@ -1,19 +1,17 @@
|
|
1
1
|
import { SelectAsyncProps, SelectOptionComponent } from './types';
|
2
2
|
|
3
|
-
declare const _default: <Model extends number | string, Data extends DefaultData,
|
3
|
+
declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams, OptionComponent extends SelectOptionComponent<Data>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
4
|
props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
|
5
5
|
onSelect?: ((item: Model) => any) | undefined;
|
6
6
|
"onUpdate:modelValue"?: ((value: Model[]) => any) | undefined;
|
7
7
|
onUnselect?: ((item: Model) => any) | undefined;
|
8
|
-
"onUpdate:search"?: ((value: string) => any) | undefined;
|
9
8
|
"onCreate:option"?: ((value: string) => any) | undefined;
|
10
9
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
|
11
10
|
onSelect?: ((item: Model) => any) | undefined;
|
12
11
|
"onUpdate:modelValue"?: ((value: Model[]) => any) | undefined;
|
13
12
|
onUnselect?: ((item: Model) => any) | undefined;
|
14
|
-
"onUpdate:search"?: ((value: string) => any) | undefined;
|
15
13
|
"onCreate:option"?: ((value: string) => any) | undefined;
|
16
|
-
}, never>, "onSelect" | "onUpdate:modelValue" | "onUnselect" | "
|
14
|
+
}, never>, "onSelect" | "onUpdate:modelValue" | "onUnselect" | "onCreate:option"> & SelectAsyncProps<Model, Data, QueryParams, OptionComponent>> & import('vue').PublicProps;
|
17
15
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
18
16
|
focus: () => void;
|
19
17
|
blur: () => void;
|
@@ -25,6 +23,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
25
23
|
right?: (props: Record<string, never>) => void;
|
26
24
|
option?: (props: {
|
27
25
|
option: Data | null;
|
26
|
+
index?: number;
|
28
27
|
selected: boolean;
|
29
28
|
skeleton: boolean;
|
30
29
|
model: boolean;
|
@@ -35,6 +34,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
35
34
|
right?: (props: Record<string, never>) => void;
|
36
35
|
option?: (props: {
|
37
36
|
option: Data | null;
|
37
|
+
index?: number;
|
38
38
|
selected: boolean;
|
39
39
|
skeleton: boolean;
|
40
40
|
model: boolean;
|
@@ -43,7 +43,6 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
43
43
|
emit: {
|
44
44
|
(e: "select", item: Model): void;
|
45
45
|
(e: "unselect", item: Model): void;
|
46
|
-
(e: "update:search", value: string): void;
|
47
46
|
(e: "update:modelValue", value: Model[]): void;
|
48
47
|
(e: "create:option", value: string): void;
|
49
48
|
} & {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AAiPA,OAAO,KAAK,EAAC,gBAAgB,EAAE,qBAAqB,EAA6B,MAAM,SAAS,CAAA;yBAG/E,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,eAC5H,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAwgBxD,cAAc,CAAC;;;;;;;;;;mJAAyD,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB;;;MAAsB,GAAG,IAAI;WACpE,GAAG;WACH,UAAU;gBA7ZV,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE;YAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;gBAH7G,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE;YAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;MA0Z5E;UAClC;YA5fH,QAAQ,QAAQ,KAAK,GAAG,IAAI;YAC5B,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,mBAAmB,SAAS,KAAK,EAAE,GAAG,IAAI;YAC1C,eAAe,SAAS,MAAM,GAAG,IAAI;UAyfA;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAlhBvE,wBAkhB4E;AAY5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -8,17 +8,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
...{ inheritAttrs: false },
|
9
9
|
__name: "WSelectAsync",
|
10
10
|
props: {
|
11
|
-
|
11
|
+
useQueryFnOptions: {},
|
12
12
|
useQueryFnPrefix: {},
|
13
13
|
isInvalidPage: {},
|
14
14
|
queryParams: {},
|
15
15
|
previewData: {},
|
16
16
|
createdData: {},
|
17
|
-
valueGetter: { type: Function, default: (data) => data.id },
|
18
17
|
valueQueryKey: { default: "id__in" },
|
19
18
|
queryOptions: {},
|
20
19
|
modelValue: {},
|
21
|
-
|
20
|
+
valueGetter: { type: Function, default: (data) => data.id },
|
22
21
|
emptyStub: { default: "No match" },
|
23
22
|
disableClear: { type: Boolean },
|
24
23
|
hidePrefix: { type: Boolean },
|
@@ -63,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
63
62
|
optionComponent: {},
|
64
63
|
optionComponentProps: {}
|
65
64
|
},
|
66
|
-
emits: ["select", "unselect", "update:
|
65
|
+
emits: ["select", "unselect", "update:modelValue", "create:option"],
|
67
66
|
setup(__props, { expose: __expose, emit: __emit }) {
|
68
67
|
const props = __props;
|
69
68
|
const emit = __emit;
|
@@ -73,6 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
73
72
|
const isMobile = getIsMobile();
|
74
73
|
const focused = ref(false);
|
75
74
|
const isFetchingPrefix = ref(false);
|
75
|
+
const search = ref("");
|
76
76
|
const isDisabled = computed(() => props.loading || props.readonly || props.disabled);
|
77
77
|
const close = () => {
|
78
78
|
isOpen.value = false;
|
@@ -80,7 +80,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
80
80
|
};
|
81
81
|
let deletePressTimeout = null;
|
82
82
|
const captureDoubleDelete = () => {
|
83
|
-
if (!props.modelValue.length ||
|
83
|
+
if (!props.modelValue.length || search.value.length) return;
|
84
84
|
if (deletePressTimeout) {
|
85
85
|
unselect(props.modelValue[props.modelValue.length - 1]);
|
86
86
|
clearTimeout(deletePressTimeout);
|
@@ -94,18 +94,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
94
94
|
const select = (item) => {
|
95
95
|
if (isDisabled.value) return;
|
96
96
|
emit("select", item);
|
97
|
+
search.value = "";
|
97
98
|
};
|
98
99
|
const unselect = (item) => {
|
99
100
|
if (isDisabled.value) return;
|
100
101
|
emit("unselect", item);
|
102
|
+
search.value = "";
|
101
103
|
};
|
102
104
|
const create = () => {
|
103
105
|
if (isDisabled.value) return;
|
104
|
-
emit("create:option",
|
106
|
+
emit("create:option", search.value);
|
107
|
+
search.value = "";
|
105
108
|
};
|
106
109
|
const updateSelected = (value) => {
|
107
110
|
if (isDisabled.value) return;
|
108
111
|
emit("update:modelValue", value);
|
112
|
+
search.value = "";
|
109
113
|
};
|
110
114
|
const focus = () => {
|
111
115
|
input.value?.focus();
|
@@ -127,12 +131,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
127
131
|
ref: input
|
128
132
|
}, {
|
129
133
|
...props,
|
130
|
-
modelValue:
|
134
|
+
modelValue: search.value,
|
131
135
|
loading: _ctx.loading || isFetchingPrefix.value,
|
132
136
|
hideInput: unref(isMobile) ? !focused.value : !isOpen.value
|
133
137
|
}, {
|
134
138
|
class: _ctx.$attrs.class,
|
135
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => !_ctx.loading && !isFetchingPrefix.value &&
|
139
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => !_ctx.loading && !isFetchingPrefix.value && (search.value = $event ?? "")),
|
136
140
|
"onKeypress:enter": _cache[2] || (_cache[2] = withModifiers(($event) => list.value?.selectCursor(), ["stop", "prevent"])),
|
137
141
|
"onKeypress:up": _cache[3] || (_cache[3] = withModifiers(($event) => list.value?.cursorUp(), ["prevent"])),
|
138
142
|
"onKeypress:down": _cache[4] || (_cache[4] = withModifiers(($event) => list.value?.cursorDown(), ["prevent"])),
|
@@ -140,7 +144,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
140
144
|
onOpen: _cache[5] || (_cache[5] = ($event) => isOpen.value = true),
|
141
145
|
onClose: _cache[6] || (_cache[6] = ($event) => {
|
142
146
|
close();
|
143
|
-
|
147
|
+
search.value = "";
|
144
148
|
}),
|
145
149
|
onFocus: _cache[7] || (_cache[7] = ($event) => focused.value = true),
|
146
150
|
onBlur: _cache[8] || (_cache[8] = ($event) => focused.value = false)
|
@@ -148,7 +152,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
148
152
|
prefix: withCtx(({ unclickable }) => [
|
149
153
|
(_ctx.hidePrefix ? unref(isMobile) ? unclickable || !focused.value : !isOpen.value : true) ? (openBlock(), createBlock(_sfc_main$2, {
|
150
154
|
key: 0,
|
151
|
-
"use-query-fn": _ctx.useQueryFnPrefix ?? _ctx.
|
155
|
+
"use-query-fn": _ctx.useQueryFnPrefix ?? _ctx.useQueryFnOptions,
|
152
156
|
"model-value": _ctx.modelValue,
|
153
157
|
disabled: _ctx.disabled,
|
154
158
|
loading: _ctx.loading || isFetchingPrefix.value,
|
@@ -166,9 +170,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
166
170
|
}),
|
167
171
|
"onUpdate:modelValue": updateSelected
|
168
172
|
}, {
|
169
|
-
default: withCtx(({ option, skeleton: skeletonPrefix }) => [
|
173
|
+
default: withCtx(({ option, skeleton: skeletonPrefix, index }) => [
|
170
174
|
renderSlot(_ctx.$slots, "option", {
|
171
175
|
option,
|
176
|
+
index,
|
172
177
|
selected: true,
|
173
178
|
model: true,
|
174
179
|
skeleton: skeletonPrefix
|
@@ -182,13 +187,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
182
187
|
ref_key: "list",
|
183
188
|
ref: list,
|
184
189
|
"model-value": _ctx.modelValue,
|
185
|
-
"use-query-fn": _ctx.
|
186
|
-
"query-params": _ctx.queryParams,
|
190
|
+
"use-query-fn": _ctx.useQueryFnOptions,
|
191
|
+
"query-params": { ..._ctx.queryParams, search: search.value },
|
187
192
|
"is-invalid-page": _ctx.isInvalidPage,
|
188
193
|
loading: _ctx.loading || isFetchingPrefix.value,
|
189
194
|
disabled: isDisabled.value,
|
190
195
|
"empty-stub": _ctx.emptyStub,
|
191
|
-
"allow-create": _ctx.allowCreate &&
|
196
|
+
"allow-create": _ctx.allowCreate && search.value !== "",
|
192
197
|
"hide-option-icon": _ctx.hideOptionIcon,
|
193
198
|
"value-getter": _ctx.valueGetter,
|
194
199
|
"query-options": _ctx.queryOptions,
|
@@ -209,7 +214,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
209
214
|
selected,
|
210
215
|
skeleton: skeletonList,
|
211
216
|
model: false,
|
212
|
-
search:
|
217
|
+
search: search.value
|
213
218
|
}), null, 16, ["option", "selected", "skeleton", "search"]))
|
214
219
|
])
|
215
220
|
]),
|
@@ -1,4 +1,4 @@
|
|
1
|
-
declare const _default: <Model extends number | string, Data extends DefaultData,
|
1
|
+
declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
2
2
|
props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
|
3
3
|
onSelect?: ((value: Model) => any) | undefined;
|
4
4
|
"onUpdate:count"?: ((value: number) => any) | undefined;
|
@@ -13,7 +13,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
13
13
|
title?: string;
|
14
14
|
emptyStub?: string;
|
15
15
|
modelValue: Model[];
|
16
|
-
useQueryFn: UseQueryPaginated<Data,
|
16
|
+
useQueryFn: UseQueryPaginated<Data, QueryParams>;
|
17
17
|
isInvalidPage: (error: unknown) => boolean;
|
18
18
|
queryParams: QueryParams;
|
19
19
|
skeleton?: boolean;
|
@@ -22,7 +22,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
22
22
|
unselectOnly?: boolean;
|
23
23
|
hideOptionIcon?: boolean;
|
24
24
|
valueGetter?: (data: Data) => Model;
|
25
|
-
queryOptions?: Partial<Parameters<UseQueryPaginated<Data,
|
25
|
+
queryOptions?: Partial<Parameters<UseQueryPaginated<Data, QueryParams>>[1]>;
|
26
26
|
}> & import('vue').PublicProps;
|
27
27
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
28
28
|
attrs: any;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsyncList.vue"],"names":[],"mappings":"yBA2GiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"WSelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsyncList.vue"],"names":[],"mappings":"yBA2GiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAgOxD,cAAc,CAAC;;;;;;;;;;;gBA5Nb,MAAM;oBACF,MAAM;oBACN,KAAK,EAAE;oBACP,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;uBACjC,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO;qBAC7B,WAAW;mBACb,OAAO;wBACF,CAAC,MAAM,WAAW,CAAC,EAAE;qBACxB,OAAO;uBACL,OAAO;yBACL,OAAO;sBACV,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK;uBACpB,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAgNG,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;WACH,UAAU;kBA5LR,CAAC,KAAK,EAAE;YAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;kBAA5F,CAAC,KAAK,EAAE;YAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;MA4L7D;UAClC;YAtMH,QAAQ,SAAS,KAAK,GAAG,IAAI;YAC7B,UAAU,SAAS,KAAK,GAAG,IAAI;YAC/B,oBAAoB,SAAS,KAAK,EAAE,GAAG,IAAI;YAC3C,cAAc,SAAS,MAAM,GAAG,IAAI;UAmMO;;;;YAGL,OAAO,CAAC,OAAO,WAAW,CAAC;;AA1OvE,wBA0O4E;AAY5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,15 +1,13 @@
|
|
1
1
|
import { SelectAsyncSingleProps, SelectOptionComponent } from './types';
|
2
2
|
|
3
|
-
declare const _default: <Model extends number | string, Data extends DefaultData,
|
3
|
+
declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams, OptionComponent extends SelectOptionComponent<Data>, AllowClear extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
4
|
props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
|
5
5
|
"onUpdate:modelValue"?: ((value: AllowClear extends true ? Model | null : Model) => any) | undefined;
|
6
|
-
"onUpdate:search"?: ((value: string) => any) | undefined;
|
7
6
|
"onCreate:option"?: ((value: string) => any) | undefined;
|
8
7
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
|
9
8
|
"onUpdate:modelValue"?: ((value: AllowClear extends true ? Model | null : Model) => any) | undefined;
|
10
|
-
"onUpdate:search"?: ((value: string) => any) | undefined;
|
11
9
|
"onCreate:option"?: ((value: string) => any) | undefined;
|
12
|
-
}, never>, "onUpdate:modelValue" | "
|
10
|
+
}, never>, "onUpdate:modelValue" | "onCreate:option"> & SelectAsyncSingleProps<Model, Data, QueryParams, OptionComponent, AllowClear>> & import('vue').PublicProps;
|
13
11
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
14
12
|
blur: () => void;
|
15
13
|
}>): void;
|
@@ -26,7 +24,6 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
26
24
|
}>;
|
27
25
|
emit: {
|
28
26
|
(e: "update:modelValue", value: AllowClear extends true ? Model | null : Model): void;
|
29
|
-
(e: "update:search", value: string): void;
|
30
27
|
(e: "create:option", value: string): void;
|
31
28
|
} & {};
|
32
29
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsyncSingle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsyncSingle.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectAsyncSingle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsyncSingle.vue"],"names":[],"mappings":"AA2FA,OAAO,KAAK,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;yBAGzD,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,OAAO,uBACxJ,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA0MxD,cAAc,CAAC;;;;;;yIAAyD,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;WACH,UAAU;uBA5BO,GAAG;0BACC,GAAG;;;;;YACL,GAAG;uBACJ,GAAG;MAyBY;UAClC;YAnMH,mBAAmB,0DAAoB,IAAI;YAC3C,eAAe,SAAS,MAAM,GAAG,IAAI;UAkMA;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AApNvE,wBAoN4E;AAM5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -10,14 +10,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
10
|
searchModel: { type: Boolean },
|
11
11
|
previewData: {},
|
12
12
|
createdData: {},
|
13
|
-
|
13
|
+
useQueryFnOptions: {},
|
14
14
|
useQueryFnPrefix: {},
|
15
15
|
isInvalidPage: { type: Function },
|
16
16
|
queryParams: {},
|
17
|
-
valueGetter: { type: Function },
|
18
17
|
valueQueryKey: {},
|
19
18
|
queryOptions: {},
|
20
|
-
|
19
|
+
valueGetter: { type: Function },
|
21
20
|
emptyStub: {},
|
22
21
|
hidePrefix: { type: Boolean },
|
23
22
|
allowCreate: { type: Boolean },
|
@@ -61,7 +60,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
61
60
|
optionComponent: {},
|
62
61
|
optionComponentProps: {}
|
63
62
|
},
|
64
|
-
emits: ["update:modelValue", "
|
63
|
+
emits: ["update:modelValue", "create:option"],
|
65
64
|
setup(__props, { expose: __expose, emit: __emit }) {
|
66
65
|
const props = __props;
|
67
66
|
const emit = __emit;
|
@@ -75,7 +74,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
75
74
|
};
|
76
75
|
const blur = () => {
|
77
76
|
selectComponent.value?.blur();
|
78
|
-
emit("update:search", "");
|
79
77
|
};
|
80
78
|
watch(toRef(props, "modelValue"), blur);
|
81
79
|
__expose({
|
@@ -96,8 +94,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
96
94
|
class: _ctx.$attrs.class,
|
97
95
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event)),
|
98
96
|
onUnselect: _cache[1] || (_cache[1] = ($event) => _ctx.allowClear && updateModelValue(null)),
|
99
|
-
"
|
100
|
-
"onCreate:option": _cache[3] || (_cache[3] = ($event) => createOption($event))
|
97
|
+
"onCreate:option": _cache[2] || (_cache[2] = ($event) => createOption($event))
|
101
98
|
}), createSlots({
|
102
99
|
option: withCtx(({ option, selected, model }) => [
|
103
100
|
renderSlot(_ctx.$slots, "option", {
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { SelectSingleProps, SelectOptionComponent } from './types';
|
2
2
|
|
3
|
-
declare const _default: <
|
3
|
+
declare const _default: <Model extends number | string, Data extends DefaultData, OptionComponent extends SelectOptionComponent<Data>, AllowClear extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
4
|
props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
|
5
|
-
"onUpdate:modelValue"?: ((value: AllowClear extends true ?
|
6
|
-
"onUpdate:search"?: ((value: string) => any) | undefined;
|
5
|
+
"onUpdate:modelValue"?: ((value: AllowClear extends true ? Model | null : Model) => any) | undefined;
|
7
6
|
"onCreate:option"?: ((value: string) => any) | undefined;
|
8
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
|
9
|
-
"onUpdate:modelValue"?: ((value: AllowClear extends true ? Option | null : Option) => any) | undefined;
|
10
7
|
"onUpdate:search"?: ((value: string) => any) | undefined;
|
8
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
|
9
|
+
"onUpdate:modelValue"?: ((value: AllowClear extends true ? Model | null : Model) => any) | undefined;
|
11
10
|
"onCreate:option"?: ((value: string) => any) | undefined;
|
12
|
-
|
11
|
+
"onUpdate:search"?: ((value: string) => any) | undefined;
|
12
|
+
}, never>, "onUpdate:modelValue" | "onCreate:option" | "onUpdate:search"> & SelectSingleProps<Model, Data, OptionComponent, AllowClear>> & import('vue').PublicProps;
|
13
13
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
14
14
|
blur: () => void;
|
15
15
|
}>): void;
|
@@ -18,14 +18,14 @@ declare const _default: <Option extends string | number, OptionComponent extends
|
|
18
18
|
title?(_: {}): any;
|
19
19
|
subtitle?(_: {}): any;
|
20
20
|
option?(_: {
|
21
|
-
option: string |
|
21
|
+
option: string | Data;
|
22
22
|
selected: boolean;
|
23
23
|
model: boolean;
|
24
24
|
}): any;
|
25
25
|
right?(_: {}): any;
|
26
26
|
}>;
|
27
27
|
emit: {
|
28
|
-
(e: "update:modelValue", value: AllowClear extends true ?
|
28
|
+
(e: "update:modelValue", value: AllowClear extends true ? Model | null : Model): void;
|
29
29
|
(e: "update:search", value: string): void;
|
30
30
|
(e: "create:option", value: string): void;
|
31
31
|
} & {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectSingle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectSingle.vue"],"names":[],"mappings":"AA+FA,OAAO,KAAK,EAAC,iBAAiB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;yBAGpD,
|
1
|
+
{"version":3,"file":"WSelectSingle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectSingle.vue"],"names":[],"mappings":"AA+FA,OAAO,KAAK,EAAC,iBAAiB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;yBAGpD,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,OAAO,uBAC3I,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAuOxD,cAAc,CAAC;;;;;;;;2IAAyD,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;WACH,UAAU;uBA7BQ,GAAG;0BACA,GAAG;;;;;YACL,GAAG;uBACJ,GAAG;MA0BY;UAClC;YAhOH,mBAAmB,0DAAoB,IAAI;YAC3C,eAAe,SAAS,MAAM,GAAG,IAAI;YACrC,eAAe,SAAS,MAAM,GAAG,IAAI;UA8NA;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAjPvE,wBAiP4E;AAM5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -8,8 +8,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
modelValue: {},
|
9
9
|
allowClear: { type: Boolean },
|
10
10
|
searchModel: { type: Boolean },
|
11
|
-
|
12
|
-
|
11
|
+
useQueryFnOptions: {},
|
12
|
+
valueGetter: { type: Function },
|
13
|
+
searchFn: { type: Function },
|
13
14
|
emptyStub: {},
|
14
15
|
hidePrefix: { type: Boolean },
|
15
16
|
allowCreate: { type: Boolean },
|
@@ -1,4 +1,4 @@
|
|
1
|
-
declare const _default: <Model extends number | string, Data extends DefaultData,
|
1
|
+
declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
2
2
|
props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
|
3
3
|
onSelect?: ((value: Model) => any) | undefined;
|
4
4
|
"onUpdate:count"?: ((value: number) => any) | undefined;
|
@@ -13,7 +13,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
13
13
|
"onCreate:option"?: (() => any) | undefined;
|
14
14
|
}, never>, "onSelect" | "onUpdate:count" | "onUpdate:modelValue" | "onUnselect" | "onCreate:option"> & {
|
15
15
|
modelValue: Model[];
|
16
|
-
useQueryFn: UseQueryPaginated<Data,
|
16
|
+
useQueryFn: UseQueryPaginated<Data, QueryParams>;
|
17
17
|
queryParams: QueryParams;
|
18
18
|
isInvalidPage: (error: unknown) => boolean;
|
19
19
|
scrollingElement?: Element | null;
|
@@ -28,7 +28,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
28
28
|
allowCreate?: boolean;
|
29
29
|
hideOptionIcon?: boolean;
|
30
30
|
valueGetter: (data: Data) => Model;
|
31
|
-
queryOptions?: Partial<Parameters<UseQueryPaginated<Data,
|
31
|
+
queryOptions?: Partial<Parameters<UseQueryPaginated<Data, QueryParams>>[1]>;
|
32
32
|
}> & import('vue').PublicProps;
|
33
33
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
34
34
|
cursorUp: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/components/SelectAsyncList.vue"],"names":[],"mappings":"yBAwNiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"SelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/components/SelectAsyncList.vue"],"names":[],"mappings":"yBAwNiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA4gBxD,cAAc,CAAC;;;;;;;;;;;;;oBAxgBX,KAAK,EAAE;oBACP,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;uBACT,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO;2BACvB,OAAO,GAAG,IAAI;kBACvB,OAAO;mBACN,OAAO;qBACL,OAAO;wBACJ,CAAC,MAAM,WAAW,CAAC,EAAE;oBACzB,OAAO;oBACP,MAAM;qBACL,OAAO;uBACL,OAAO;sBACR,OAAO;yBACJ,OAAO;qBACX,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK;uBACnB,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAwfK,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB;;;;MAAsB,GAAG,IAAI;WACpE,GAAG;WACH,UAAU;kBAjaR,CAAC,KAAK,EAAE;YAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;kBAA5E,CAAC,KAAK,EAAE;YAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;MAia7C;UAClC;YAvfH,QAAQ,SAAS,KAAK,GAAG,IAAI;YAC7B,UAAU,SAAS,KAAK,GAAG,IAAI;YAC/B,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,mBAAmB,SAAS,KAAK,EAAE,GAAG,IAAI;YAC1C,eAAe,GAAG,IAAI;UAmfe;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAthBvE,wBAshB4E;AAM5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|