eco-vue-js 0.10.15 → 0.10.17
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/components/FilePicker/WFilePicker.vue.js +1 -1
- package/dist/components/FilePicker/components/FilePickerItem.vue.d.ts.map +1 -1
- package/dist/components/FilePicker/components/FilePickerItem.vue.js +15 -24
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +6 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteList.vue.js +11 -3
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.js +3 -2
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +6 -0
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +4 -12
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.d.ts +6 -0
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.js +11 -3
- package/dist/components/InfiniteList/use/useInfiniteListHeader.d.ts.map +1 -1
- package/dist/components/InfiniteList/use/useInfiniteListHeader.js +0 -5
- package/dist/components/Input/WInputDate.vue.js +1 -1
- package/dist/components/Page/WPage.vue.d.ts +4 -0
- package/dist/components/Page/WPage.vue.d.ts.map +1 -1
- package/dist/components/Page/WPage.vue.js +68 -8
- package/dist/components/Page/WPageBreadcrumbs.vue.d.ts +3 -0
- package/dist/components/Page/WPageBreadcrumbs.vue.d.ts.map +1 -0
- package/dist/components/Page/WPageBreadcrumbs.vue.js +42 -0
- package/dist/components/Page/WPageBreadcrumbs.vue2.js +5 -0
- package/dist/components/Page/use/usePageBreadcrumbs.d.ts +17 -0
- package/dist/components/Page/use/usePageBreadcrumbs.d.ts.map +1 -0
- package/dist/components/Page/use/usePageBreadcrumbs.js +48 -0
- package/dist/components/Select/WSelect.vue.d.ts +2 -2
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +56 -50
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +3 -2
- package/dist/components/Select/WSelectSingle.vue.d.ts +1 -1
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectStringified.vue.d.ts +2 -2
- package/dist/components/Select/WSelectStringified.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts +3 -0
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.js +68 -49
- package/dist/components/Select/components/SelectOption.vue.d.ts +1 -0
- package/dist/components/Select/components/SelectOption.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectOption.vue.js +12 -7
- package/dist/components/Select/components/SelectOptionPrefix.vue.d.ts +4 -1
- package/dist/components/Select/components/SelectOptionPrefix.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectOptionPrefix.vue.js +7 -2
- package/dist/components/Select/types.d.ts +3 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/imports/componentsPlugin.d.ts +2 -1
- package/dist/imports/componentsPlugin.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/package.json +4 -1
- package/tailwind-base/plugins/default.ts +3 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
import { ref, readonly } from 'vue';
|
2
|
+
|
3
|
+
const breadcrumbs = ref({});
|
4
|
+
const breadcrumbsUpdateMap = ref({});
|
5
|
+
const breadcrumbsScrollToMap = ref({});
|
6
|
+
const active = ref(null);
|
7
|
+
const usePageBreadcrumbs = () => {
|
8
|
+
const resetBreadcrumbs = () => {
|
9
|
+
breadcrumbs.value = {};
|
10
|
+
breadcrumbsUpdateMap.value = {};
|
11
|
+
active.value = null;
|
12
|
+
};
|
13
|
+
const scrollTo = (title) => {
|
14
|
+
breadcrumbsScrollToMap.value[title]?.();
|
15
|
+
};
|
16
|
+
return {
|
17
|
+
resetBreadcrumbs,
|
18
|
+
scrollTo,
|
19
|
+
breadcrumbs: readonly(breadcrumbs),
|
20
|
+
active: readonly(active)
|
21
|
+
};
|
22
|
+
};
|
23
|
+
const usePageBreadcrumb = () => {
|
24
|
+
const setBreadcrumb = (title, index, update, scrollTo) => {
|
25
|
+
breadcrumbs.value[title] = index;
|
26
|
+
breadcrumbsUpdateMap.value[title] = update;
|
27
|
+
breadcrumbsScrollToMap.value[title] = scrollTo;
|
28
|
+
};
|
29
|
+
const resetBreadcrumb = (title) => {
|
30
|
+
delete breadcrumbs.value[title];
|
31
|
+
delete breadcrumbsUpdateMap.value[title];
|
32
|
+
delete breadcrumbsScrollToMap.value[title];
|
33
|
+
};
|
34
|
+
const updateBreadcrumbs = () => {
|
35
|
+
Object.values(breadcrumbsUpdateMap.value).forEach((item) => item());
|
36
|
+
};
|
37
|
+
const setActive = (value) => {
|
38
|
+
active.value = value;
|
39
|
+
};
|
40
|
+
return {
|
41
|
+
setBreadcrumb,
|
42
|
+
resetBreadcrumb,
|
43
|
+
updateBreadcrumbs,
|
44
|
+
setActive
|
45
|
+
};
|
46
|
+
};
|
47
|
+
|
48
|
+
export { usePageBreadcrumb, usePageBreadcrumbs };
|
@@ -18,7 +18,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
18
18
|
title?: () => void;
|
19
19
|
subtitle?: () => void;
|
20
20
|
option?: (props: {
|
21
|
-
option: Data | null;
|
21
|
+
option: Data | null | undefined;
|
22
22
|
index?: number;
|
23
23
|
selected: boolean;
|
24
24
|
model: boolean;
|
@@ -29,7 +29,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
29
29
|
title?: () => void;
|
30
30
|
subtitle?: () => void;
|
31
31
|
option?: (props: {
|
32
|
-
option: Data | null;
|
32
|
+
option: Data | null | undefined;
|
33
33
|
index?: number;
|
34
34
|
selected: boolean;
|
35
35
|
model: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AAkKA;AA6aA,OAAO,KAAK,EAAC,qBAAqB,EAA8B,WAAW,EAAC,MAAM,SAAS,CAAA;yBAa1E,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,eACnI,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA8oB1D,mBAAmB,CAAC;;;;;;;sSAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BArcrB,MAAM,KAAG,IAAI;MAqc8B,GAAG,IAAI;WACpE,GAAG;;gBAzZD,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE;YACf,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;YAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,QAAQ,EAAE,OAAO,CAAA;YACjB,KAAK,EAAE,OAAO,CAAA;YACd,MAAM,CAAC,EAAE,MAAM,CAAA;SAChB,KAAK,IAAI;gBACF,MAAM,IAAI;;gBATV,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE;YACf,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;YAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,QAAQ,EAAE,OAAO,CAAA;YACjB,KAAK,EAAE,OAAO,CAAA;YACd,MAAM,CAAC,EAAE,MAAM,CAAA;SAChB,KAAK,IAAI;gBACF,MAAM,IAAI;;;YAxPd,QAAQ,QAAQ,KAAK,GAAG,IAAI;YAC5B,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,MAAM,SAAS,UAAU,GAAG,IAAI;YAChC,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;;;;YAwoBmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AAxpBvE,wBAwpB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, ref, useTemplateRef, computed, toRef, watch, nextTick, createBlock, openBlock, mergeProps, unref, withModifiers, createSlots, withCtx, createElementBlock,
|
1
|
+
import { defineComponent, ref, useTemplateRef, computed, toRef, watch, nextTick, createBlock, openBlock, mergeProps, unref, withModifiers, createSlots, withCtx, createCommentVNode, createElementBlock, renderSlot, resolveDynamicComponent, createElementVNode, toDisplayString, Fragment, renderList } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Input/WInputSuggest.vue.js';
|
3
3
|
import { ApiError } from '../../utils/api.js';
|
4
4
|
import { useIsMobile } from '../../utils/mobile.js';
|
@@ -7,10 +7,14 @@ import _sfc_main$2 from './components/SelectOption.vue.js';
|
|
7
7
|
import _sfc_main$3 from './components/SelectOptionPrefix.vue.js';
|
8
8
|
|
9
9
|
const _hoisted_1 = {
|
10
|
-
key:
|
11
|
-
class: "
|
10
|
+
key: 1,
|
11
|
+
class: "text-description w-option flex items-center"
|
12
12
|
};
|
13
|
-
const _hoisted_2 = {
|
13
|
+
const _hoisted_2 = {
|
14
|
+
key: 1,
|
15
|
+
class: "w-select-option first:pt-4 last:pb-4"
|
16
|
+
};
|
17
|
+
const _hoisted_3 = { class: "w-option flex cursor-default select-none items-center" };
|
14
18
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
15
19
|
...{ inheritAttrs: false },
|
16
20
|
__name: "WSelect",
|
@@ -88,7 +92,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
88
92
|
const cursor = ref(0);
|
89
93
|
const isCursorLocked = ref(false);
|
90
94
|
const search = ref("");
|
91
|
-
const
|
95
|
+
const isModelValueSearch = computed(() => search.value && props.modelValue.includes(search.value));
|
96
|
+
const searchPrepared = computed(() => isModelValueSearch.value ? "" : search.value.trim().toLocaleLowerCase());
|
92
97
|
const enabled = computed(() => !props.disabled);
|
93
98
|
const { data, isLoading, error: queryError } = props.useQueryFnOptions ? props.queryParamsOptions === void 0 ? props.useQueryFnOptions({ enabled }) : props.useQueryFnOptions(toRef(props, "queryParamsOptions"), { enabled }) : {
|
94
99
|
data: toRef(props, "options"),
|
@@ -117,8 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
117
122
|
const loadingOptionIndex = ref(null);
|
118
123
|
const loadingCreate = ref(false);
|
119
124
|
const isDisabled = computed(() => props.loading || props.readonly || props.disabled);
|
120
|
-
const
|
121
|
-
const hasCreateOption = computed(() => props.createOption && search.value !== "" && !optionsFiltered.value.some((option) => props.valueGetter(option) === search.value));
|
125
|
+
const hasCreateOption = computed(() => props.createOption && !optionsFiltered.value.some((option) => props.valueGetter(option) === search.value));
|
122
126
|
const close = () => {
|
123
127
|
isOpen.value = false;
|
124
128
|
focused.value = false;
|
@@ -265,36 +269,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
265
269
|
})
|
266
270
|
}), createSlots({
|
267
271
|
prefix: withCtx(({ unclickable }) => [
|
268
|
-
(_ctx.hidePrefix ? unref(isMobile) ? unclickable || !focused.value : !isOpen.value : true) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(
|
272
|
+
(_ctx.hidePrefix ? unref(isMobile) ? unclickable || !focused.value : !isOpen.value : true) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.modelValue, (value, index) => {
|
269
273
|
return openBlock(), createBlock(_sfc_main$3, {
|
270
|
-
key:
|
271
|
-
option,
|
274
|
+
key: value,
|
275
|
+
option: optionsWithCreated.value.find((item) => _ctx.valueGetter(item) === value),
|
272
276
|
"option-component": _ctx.optionComponent,
|
273
277
|
"option-component-props": _ctx.optionComponentProps,
|
274
278
|
index,
|
275
279
|
loading: _ctx.loading || unref(isLoading),
|
276
280
|
disabled: _ctx.disabled,
|
277
281
|
"disable-clear": _ctx.disableClear || _ctx.readonly,
|
278
|
-
|
282
|
+
search: value,
|
283
|
+
onUnselect: ($event) => unselect(value)
|
279
284
|
}, createSlots({ _: 2 }, [
|
280
285
|
_ctx.$slots.option ? {
|
281
286
|
name: "option",
|
282
|
-
fn: withCtx(() => [
|
283
|
-
renderSlot(_ctx.$slots, "option", {
|
284
|
-
option,
|
287
|
+
fn: withCtx((optionScope) => [
|
288
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, optionScope, {
|
285
289
|
selected: true,
|
286
290
|
model: true,
|
287
291
|
index
|
288
|
-
})
|
292
|
+
}))
|
289
293
|
]),
|
290
294
|
key: "0"
|
291
295
|
} : void 0
|
292
|
-
]), 1032, ["option", "option-component", "option-component-props", "index", "loading", "disabled", "disable-clear", "onUnselect"]);
|
296
|
+
]), 1032, ["option", "option-component", "option-component-props", "index", "loading", "disabled", "disable-clear", "search", "onUnselect"]);
|
293
297
|
}), 128)) : createCommentVNode("", true)
|
294
298
|
]),
|
295
299
|
content: withCtx(() => [
|
296
|
-
|
297
|
-
|
300
|
+
hasCreateOption.value ? (openBlock(), createBlock(_sfc_main$2, {
|
301
|
+
key: 0,
|
302
|
+
"is-selected": false,
|
303
|
+
"is-cursor": cursor.value === optionsFiltered.value.length,
|
304
|
+
loading: (loadingCreate.value || loadingOptionIndex.value === optionsFiltered.value.length) && _ctx.loading,
|
305
|
+
scroll: isCursorLocked.value,
|
306
|
+
"hide-option-icon": _ctx.hideOptionIcon,
|
307
|
+
disabled: !search.value || isModelValueSearch.value,
|
308
|
+
class: "first:pt-4 last:pb-4",
|
309
|
+
onSelect: _cache[0] || (_cache[0] = ($event) => create(search.value)),
|
310
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => setCursor(optionsFiltered.value.length))
|
311
|
+
}, {
|
312
|
+
prefix: withCtx(() => _cache[7] || (_cache[7] = [
|
313
|
+
createElementVNode("div", { class: "w-option flex items-center pr-2" }, " Create: ", -1)
|
314
|
+
])),
|
315
|
+
default: withCtx(() => [
|
316
|
+
search.value && !isModelValueSearch.value ? renderSlot(_ctx.$slots, "option", {
|
317
|
+
key: 0,
|
318
|
+
option: null,
|
319
|
+
search: search.value,
|
320
|
+
selected: false,
|
321
|
+
model: false
|
322
|
+
}, () => [
|
323
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.optionComponent), mergeProps(_ctx.optionComponentProps, {
|
324
|
+
option: null,
|
325
|
+
search: search.value,
|
326
|
+
selected: false,
|
327
|
+
model: false
|
328
|
+
}), null, 16, ["search"]))
|
329
|
+
]) : (openBlock(), createElementBlock("div", _hoisted_1, " Start typing.. "))
|
330
|
+
]),
|
331
|
+
_: 3
|
332
|
+
}, 8, ["is-cursor", "loading", "scroll", "hide-option-icon", "disabled"])) : createCommentVNode("", true),
|
333
|
+
!optionsFiltered.value.length && !isModelValueSearch.value && (!_ctx.createOption || optionsWithCreated.value.length) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
334
|
+
createElementVNode("div", _hoisted_3, toDisplayString(!search.value && _ctx.emptyStub ? _ctx.emptyStub : "No match"), 1)
|
298
335
|
])) : createCommentVNode("", true),
|
299
336
|
(openBlock(true), createElementBlock(Fragment, null, renderList(optionsFiltered.value, (option, index) => {
|
300
337
|
return openBlock(), createBlock(_sfc_main$2, {
|
@@ -330,38 +367,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
330
367
|
]),
|
331
368
|
_: 2
|
332
369
|
}, 1032, ["is-selected", "is-cursor", "loading", "scroll", "hide-option-icon", "onSelect", "onUnselect", "onMouseenter"]);
|
333
|
-
}), 128))
|
334
|
-
hasCreateOption.value ? (openBlock(), createBlock(_sfc_main$2, {
|
335
|
-
key: 1,
|
336
|
-
"is-selected": false,
|
337
|
-
"is-cursor": cursor.value === optionsFiltered.value.length,
|
338
|
-
loading: (loadingCreate.value || loadingOptionIndex.value === optionsFiltered.value.length) && _ctx.loading,
|
339
|
-
scroll: isCursorLocked.value,
|
340
|
-
"hide-option-icon": _ctx.hideOptionIcon,
|
341
|
-
class: "first:pt-4 last:pb-4",
|
342
|
-
onSelect: _cache[0] || (_cache[0] = ($event) => create(search.value)),
|
343
|
-
onMouseenter: _cache[1] || (_cache[1] = ($event) => setCursor(optionsFiltered.value.length))
|
344
|
-
}, {
|
345
|
-
prefix: withCtx(() => _cache[7] || (_cache[7] = [
|
346
|
-
createElementVNode("span", { class: "w-select-field sm-not:px-3 pr-2" }, " Create: ", -1)
|
347
|
-
])),
|
348
|
-
default: withCtx(() => [
|
349
|
-
renderSlot(_ctx.$slots, "option", {
|
350
|
-
option: null,
|
351
|
-
search: search.value,
|
352
|
-
selected: false,
|
353
|
-
model: false
|
354
|
-
}, () => [
|
355
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.optionComponent), mergeProps(_ctx.optionComponentProps, {
|
356
|
-
option: null,
|
357
|
-
search: search.value,
|
358
|
-
selected: false,
|
359
|
-
model: false
|
360
|
-
}), null, 16, ["search"]))
|
361
|
-
])
|
362
|
-
]),
|
363
|
-
_: 3
|
364
|
-
}, 8, ["is-cursor", "loading", "scroll", "hide-option-icon"])) : createCommentVNode("", true)
|
370
|
+
}), 128))
|
365
371
|
]),
|
366
372
|
_: 2
|
367
373
|
}, [
|
@@ -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":"AAyHA;AA4RA,OAAO,KAAK,EAAC,gBAAgB,EAAE,qBAAqB,EAA6B,MAAM,SAAS,CAAA;yBAW/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,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA+e1D,mBAAmB,CAAC;;;;;;;2RAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BApXrB,MAAM,KAAG,IAAI;MAoX8B,GAAG,IAAI;WACpE,GAAG;;gBA1VD,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,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAC,KAAK,IAAI;;gBAH9H,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,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAC,KAAK,IAAI;;;YA3IlI,QAAQ,QAAQ,KAAK,GAAG,IAAI;YAC5B,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,mBAAmB,SAAS,KAAK,EAAE,GAAG,IAAI;YAC1C,YAAY,GAAG,IAAI;YACnB,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,MAAM,SAAS,UAAU,GAAG,IAAI;;;;;YAkeM,OAAO,CAAC,OAAO,WAAW,CAAC;;AAzfvE,wBAyf4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -236,10 +236,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
236
236
|
loading: _ctx.loading || isFetchingPrefix.value,
|
237
237
|
disabled: isDisabled.value,
|
238
238
|
"empty-stub": !search.value && _ctx.emptyStub ? _ctx.emptyStub : void 0,
|
239
|
-
"allow-create": _ctx.createOption &&
|
239
|
+
"allow-create": _ctx.createOption && !hasSearchOption.value,
|
240
240
|
"hide-option-icon": _ctx.hideOptionIcon,
|
241
241
|
"value-getter": _ctx.valueGetter,
|
242
242
|
"loading-create": loadingCreate.value,
|
243
|
+
search: search.value,
|
243
244
|
onSelect: select,
|
244
245
|
onUnselect: unselect,
|
245
246
|
"onCreate:option": create,
|
@@ -263,7 +264,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
263
264
|
])
|
264
265
|
]),
|
265
266
|
_: 3
|
266
|
-
}, 8, ["model-value", "use-query-fn", "query-params", "loading", "disabled", "empty-stub", "allow-create", "hide-option-icon", "value-getter", "loading-create"])
|
267
|
+
}, 8, ["model-value", "use-query-fn", "query-params", "loading", "disabled", "empty-stub", "allow-create", "hide-option-icon", "value-getter", "loading-create", "search"])
|
267
268
|
]),
|
268
269
|
_: 2
|
269
270
|
}, [
|
@@ -13,7 +13,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
13
13
|
title?(_: {}): any;
|
14
14
|
subtitle?(_: {}): any;
|
15
15
|
option?(_: {
|
16
|
-
option: Data | null;
|
16
|
+
option: Data | null | undefined;
|
17
17
|
selected: boolean;
|
18
18
|
model: boolean;
|
19
19
|
search: string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectSingle.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectSingle.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectSingle.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectSingle.vue"],"names":[],"mappings":"AAuDA;AAiGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;yBAMpD,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,OAAO,uBAC/J,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAoM1D,mBAAmB,CAAC;;;;8RAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;uBAnCiB,GAAG;0BACA,GAAG;;;;;;YACL,GAAG;uBACJ,GAAG;;;YA5JzB,oBAAoB,0DAAoB,IAAI;YAC5C,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;;;;YA+LmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AA9MvE,wBA8M4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -15,7 +15,7 @@ declare const _default: <Model extends string, Data extends DefaultData, QueryPa
|
|
15
15
|
subtitle?: () => VNode[];
|
16
16
|
right?: () => VNode[];
|
17
17
|
option?: (props: {
|
18
|
-
option: Data | null;
|
18
|
+
option: Data | null | undefined;
|
19
19
|
selected: boolean;
|
20
20
|
model: boolean;
|
21
21
|
search: string | undefined;
|
@@ -25,7 +25,7 @@ declare const _default: <Model extends string, Data extends DefaultData, QueryPa
|
|
25
25
|
subtitle?: () => VNode[];
|
26
26
|
right?: () => VNode[];
|
27
27
|
option?: (props: {
|
28
|
-
option: Data | null;
|
28
|
+
option: Data | null | undefined;
|
29
29
|
selected: boolean;
|
30
30
|
model: boolean;
|
31
31
|
search: string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectStringified.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectStringified.vue"],"names":[],"mappings":"AAkDA;
|
1
|
+
{"version":3,"file":"WSelectStringified.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectStringified.vue"],"names":[],"mappings":"AAkDA;AA8GA,OAAO,KAAK,EAAC,qBAAqB,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAA;AAE1E,OAAO,EAAC,KAAK,KAAK,EAA2B,MAAM,KAAK,CAAA;yBAIvC,KAAK,SAAS,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,eAC1H,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAkM1D,mBAAmB,CAAC;;;;uRAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;gBAtJD,MAAM,KAAK,EAAE;mBACV,MAAM,KAAK,EAAE;gBAChB,MAAM,KAAK,EAAE;iBACZ,CAAC,KAAK,EAAE;YACf,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;YAC/B,QAAQ,EAAE,OAAO,CAAA;YACjB,KAAK,EAAE,OAAO,CAAA;YACd,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;SAC3B,KAAK,KAAK,EAAE;;gBARL,MAAM,KAAK,EAAE;mBACV,MAAM,KAAK,EAAE;gBAChB,MAAM,KAAK,EAAE;iBACZ,CAAC,KAAK,EAAE;YACf,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;YAC/B,QAAQ,EAAE,OAAO,CAAA;YACjB,KAAK,EAAE,OAAO,CAAA;YACd,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;SAC3B,KAAK,KAAK,EAAE;;;YA9CT,oBAAoB,SAAS,KAAK,GAAG,IAAI;YACzC,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;;;;YA+LmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AA5MvE,wBA4M4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -23,6 +23,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
23
23
|
valueGetter: (data: Data) => Model;
|
24
24
|
queryOptions?: Partial<Parameters<UseQueryPaginated<Data, QueryParams>>[1]>;
|
25
25
|
loadingCreate?: boolean;
|
26
|
+
search?: string;
|
26
27
|
} & Partial<{}>> & import('vue').PublicProps;
|
27
28
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
28
29
|
cursorUp: () => void;
|
@@ -35,12 +36,14 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
35
36
|
option: Data | null;
|
36
37
|
selected: boolean;
|
37
38
|
skeleton: boolean;
|
39
|
+
search: string | undefined;
|
38
40
|
}) => void;
|
39
41
|
}> & {
|
40
42
|
default?: (props: {
|
41
43
|
option: Data | null;
|
42
44
|
selected: boolean;
|
43
45
|
skeleton: boolean;
|
46
|
+
search: string | undefined;
|
44
47
|
}) => void;
|
45
48
|
};
|
46
49
|
emit: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectAsyncList.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"SelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectAsyncList.vue"],"names":[],"mappings":"AAqHA;yBA2QiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAme1D,mBAAmB,CAAC;;;;;;;oBAhed,KAAK,EAAE;oBACP,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;2BACL,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;wBAC3D,OAAO;iBACd,MAAM;mBA+c6E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;;MAAsB,GAAG,IAAI;WACpE,GAAG;;kBAjWC,CAAC,KAAK,EAAE;YAChB,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;YACnB,QAAQ,EAAE,OAAO,CAAA;YACjB,QAAQ,EAAE,OAAO,CAAA;YACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;SAC3B,KAAK,IAAI;;kBALA,CAAC,KAAK,EAAE;YAChB,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;YACnB,QAAQ,EAAE,OAAO,CAAA;YACjB,QAAQ,EAAE,OAAO,CAAA;YACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;SAC3B,KAAK,IAAI;;;YAhHN,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;;;;;YA6cgB,OAAO,CAAC,OAAO,WAAW,CAAC;;AA7evE,wBA6e4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,8 +1,13 @@
|
|
1
|
-
import { defineComponent, ref, createElementBlock, openBlock,
|
2
|
-
import _sfc_main$
|
1
|
+
import { defineComponent, ref, computed, createElementBlock, openBlock, createBlock, createCommentVNode, createVNode, withCtx, renderSlot, createElementVNode, normalizeClass, toDisplayString } from 'vue';
|
2
|
+
import _sfc_main$2 from '../../InfiniteList/WInfiniteList.vue.js';
|
3
3
|
import { debounce } from '../../../utils/utils.js';
|
4
|
-
import _sfc_main$
|
4
|
+
import _sfc_main$1 from './SelectOption.vue.js';
|
5
5
|
|
6
|
+
const _hoisted_1 = {
|
7
|
+
key: 1,
|
8
|
+
class: "text-description w-option flex items-center"
|
9
|
+
};
|
10
|
+
const _hoisted_2 = { class: "w-option flex cursor-default select-none items-center" };
|
6
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
7
12
|
__name: "SelectAsyncList",
|
8
13
|
props: {
|
@@ -22,7 +27,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
22
27
|
hideOptionIcon: { type: Boolean },
|
23
28
|
valueGetter: { type: Function },
|
24
29
|
queryOptions: {},
|
25
|
-
loadingCreate: { type: Boolean }
|
30
|
+
loadingCreate: { type: Boolean },
|
31
|
+
search: {}
|
26
32
|
},
|
27
33
|
emits: ["select", "unselect", "update:count", "update:modelValue", "create:option"],
|
28
34
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -36,6 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
36
42
|
const firstItem = ref();
|
37
43
|
const lastItem = ref();
|
38
44
|
const count = ref(0);
|
45
|
+
const isModelValueSearch = computed(() => props.search && props.modelValue.includes(props.search));
|
39
46
|
const setLoadingOption = (value) => {
|
40
47
|
loadingOption.value = value;
|
41
48
|
};
|
@@ -98,7 +105,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
98
105
|
});
|
99
106
|
return (_ctx, _cache) => {
|
100
107
|
return openBlock(), createElementBlock("div", null, [
|
101
|
-
|
108
|
+
_ctx.allowCreate ? (openBlock(), createBlock(_sfc_main$1, {
|
109
|
+
key: 0,
|
110
|
+
"is-selected": false,
|
111
|
+
"is-cursor": cursor.value === null,
|
112
|
+
loading: _ctx.loading && (_ctx.loadingCreate || loadingOption.value === null),
|
113
|
+
scroll: isCursorLocked.value,
|
114
|
+
previous: lastItem.value,
|
115
|
+
next: firstItem.value,
|
116
|
+
first: count.value === 0,
|
117
|
+
"is-no-cursor": cursor.value === void 0,
|
118
|
+
"hide-option-icon": _ctx.hideOptionIcon,
|
119
|
+
class: "first:pt-4 last:pb-4",
|
120
|
+
onMouseenter: _cache[0] || (_cache[0] = ($event) => setCursor(null)),
|
121
|
+
"onUpdate:cursor": _cache[1] || (_cache[1] = ($event) => setCursor(null)),
|
122
|
+
onSelect: _cache[2] || (_cache[2] = ($event) => {
|
123
|
+
_ctx.$emit("create:option");
|
124
|
+
setLoadingOption(null);
|
125
|
+
}),
|
126
|
+
"onUpdate:isCursor": updateCursors,
|
127
|
+
"onUpdate:previous": _cache[3] || (_cache[3] = ($event) => cursorPrevious.value = $event),
|
128
|
+
"onUpdate:next": _cache[4] || (_cache[4] = ($event) => cursorNext.value = $event),
|
129
|
+
onUnmounted: _cache[5] || (_cache[5] = ($event) => updateCursor(void 0))
|
130
|
+
}, {
|
131
|
+
prefix: withCtx(() => _cache[11] || (_cache[11] = [
|
132
|
+
createElementVNode("span", { class: "w-option flex items-center pr-2" }, " Create: ", -1)
|
133
|
+
])),
|
134
|
+
default: withCtx(() => [
|
135
|
+
_ctx.search && !isModelValueSearch.value ? renderSlot(_ctx.$slots, "default", {
|
136
|
+
key: 0,
|
137
|
+
option: null,
|
138
|
+
selected: false,
|
139
|
+
skeleton: false,
|
140
|
+
search: _ctx.search
|
141
|
+
}) : (openBlock(), createElementBlock("div", _hoisted_1, " Start typing.. "))
|
142
|
+
]),
|
143
|
+
_: 3
|
144
|
+
}, 8, ["is-cursor", "loading", "scroll", "previous", "next", "first", "is-no-cursor", "hide-option-icon"])) : createCommentVNode("", true),
|
145
|
+
createVNode(_sfc_main$2, {
|
102
146
|
"use-query-fn": _ctx.useQueryFn,
|
103
147
|
"query-params": _ctx.queryParams,
|
104
148
|
"scrolling-element": _ctx.scrollingElement,
|
@@ -114,15 +158,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
114
158
|
"header-top-ignore": "",
|
115
159
|
"min-height": "",
|
116
160
|
"no-gap": "",
|
117
|
-
"onUpdate:count": _cache[
|
161
|
+
"onUpdate:count": _cache[9] || (_cache[9] = ($event) => {
|
118
162
|
_ctx.$emit("update:count", $event);
|
119
163
|
count.value = $event;
|
120
164
|
updateCursor(void 0);
|
121
165
|
}),
|
122
|
-
"onUpdate:selected": _cache[
|
166
|
+
"onUpdate:selected": _cache[10] || (_cache[10] = ($event) => !_ctx.disabled && _ctx.$emit("update:modelValue", $event))
|
123
167
|
}, {
|
124
168
|
default: withCtx(({ item, skeleton, previous, next, first, last }) => [
|
125
|
-
createVNode(_sfc_main$
|
169
|
+
createVNode(_sfc_main$1, {
|
126
170
|
"is-selected": !skeleton && _ctx.modelValue.includes(_ctx.valueGetter(item)),
|
127
171
|
"is-cursor": !skeleton && _ctx.valueGetter(item) === cursor.value,
|
128
172
|
loading: _ctx.loading && loadingOption.value === _ctx.valueGetter(item),
|
@@ -135,17 +179,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
135
179
|
"is-no-cursor": cursor.value === void 0,
|
136
180
|
"hide-option-icon": _ctx.hideOptionIcon,
|
137
181
|
class: normalizeClass({
|
138
|
-
"pt-4": !_ctx.noPadding && first,
|
139
|
-
"pb-4": !_ctx.noPadding && last
|
182
|
+
"pt-4": !_ctx.noPadding && first && !_ctx.allowCreate,
|
183
|
+
"pb-4": !_ctx.noPadding && last
|
140
184
|
}),
|
141
185
|
onSelect: ($event) => emitSelect(_ctx.valueGetter(item)),
|
142
186
|
onUnselect: ($event) => emitUnselect(_ctx.valueGetter(item)),
|
143
187
|
onMouseenter: ($event) => !skeleton && setCursor(_ctx.valueGetter(item)),
|
144
188
|
"onUpdate:cursor": ($event) => setCursor(_ctx.valueGetter(item)),
|
145
189
|
"onUpdate:isCursor": updateCursors,
|
146
|
-
"onUpdate:previous": _cache[
|
147
|
-
"onUpdate:next": _cache[
|
148
|
-
onUnmounted: _cache[
|
190
|
+
"onUpdate:previous": _cache[6] || (_cache[6] = ($event) => cursorPrevious.value = $event),
|
191
|
+
"onUpdate:next": _cache[7] || (_cache[7] = ($event) => cursorNext.value = $event),
|
192
|
+
onUnmounted: _cache[8] || (_cache[8] = ($event) => updateCursor(void 0)),
|
149
193
|
"onUpdate:first": ($event) => firstItem.value = _ctx.valueGetter(item),
|
150
194
|
"onUpdate:last": ($event) => lastItem.value = _ctx.valueGetter(item)
|
151
195
|
}, {
|
@@ -153,49 +197,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
153
197
|
renderSlot(_ctx.$slots, "default", {
|
154
198
|
option: item,
|
155
199
|
selected,
|
156
|
-
skeleton
|
200
|
+
skeleton,
|
201
|
+
search: void 0
|
157
202
|
})
|
158
203
|
]),
|
159
204
|
_: 2
|
160
205
|
}, 1032, ["is-selected", "is-cursor", "loading", "skeleton", "scroll", "first", "last", "previous", "next", "is-no-cursor", "hide-option-icon", "class", "onSelect", "onUnselect", "onMouseenter", "onUpdate:cursor", "onUpdate:first", "onUpdate:last"])
|
161
206
|
]),
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
previous: lastItem.value,
|
171
|
-
next: firstItem.value,
|
172
|
-
first: count.value === 0,
|
173
|
-
"is-no-cursor": cursor.value === void 0,
|
174
|
-
"hide-option-icon": _ctx.hideOptionIcon,
|
175
|
-
class: "first:pt-4 last:pb-4",
|
176
|
-
onMouseenter: _cache[5] || (_cache[5] = ($event) => setCursor(null)),
|
177
|
-
"onUpdate:cursor": _cache[6] || (_cache[6] = ($event) => setCursor(null)),
|
178
|
-
onSelect: _cache[7] || (_cache[7] = ($event) => {
|
179
|
-
_ctx.$emit("create:option");
|
180
|
-
setLoadingOption(null);
|
181
|
-
}),
|
182
|
-
"onUpdate:isCursor": updateCursors,
|
183
|
-
"onUpdate:previous": _cache[8] || (_cache[8] = ($event) => cursorPrevious.value = $event),
|
184
|
-
"onUpdate:next": _cache[9] || (_cache[9] = ($event) => cursorNext.value = $event),
|
185
|
-
onUnmounted: _cache[10] || (_cache[10] = ($event) => updateCursor(void 0))
|
186
|
-
}, {
|
187
|
-
prefix: withCtx(() => _cache[11] || (_cache[11] = [
|
188
|
-
createElementVNode("span", { class: "w-select-field sm-not:px-3 pr-2" }, " Create: ", -1)
|
189
|
-
])),
|
190
|
-
default: withCtx(() => [
|
191
|
-
renderSlot(_ctx.$slots, "default", {
|
192
|
-
option: null,
|
193
|
-
selected: false,
|
194
|
-
skeleton: false
|
195
|
-
})
|
207
|
+
empty: withCtx(() => [
|
208
|
+
createElementVNode("div", {
|
209
|
+
class: normalizeClass(["w-select-option pb-4", {
|
210
|
+
"pt-4": !_ctx.noPadding && !_ctx.allowCreate
|
211
|
+
}])
|
212
|
+
}, [
|
213
|
+
createElementVNode("div", _hoisted_2, toDisplayString(!_ctx.search && _ctx.emptyStub ? _ctx.emptyStub : "No match"), 1)
|
214
|
+
], 2)
|
196
215
|
]),
|
197
216
|
_: 3
|
198
|
-
}, 8, ["
|
217
|
+
}, 8, ["use-query-fn", "query-params", "scrolling-element", "transition", "exclude-params", "selected", "empty-stub", "value-getter", "query-options", "skeleton-length", "last-child"])
|
199
218
|
]);
|
200
219
|
};
|
201
220
|
}
|
@@ -11,6 +11,7 @@ declare const _default: <Model extends number | string>(__VLS_props: NonNullable
|
|
11
11
|
next?: Model | null;
|
12
12
|
isNoCursor?: boolean;
|
13
13
|
hideOptionIcon?: boolean;
|
14
|
+
disabled?: boolean;
|
14
15
|
} & Partial<{}>> & import('vue').PublicProps;
|
15
16
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
16
17
|
scrollIntoView: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SelectOption.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectOption.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"SelectOption.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectOption.vue"],"names":[],"mappings":"AA4CA;yBAmJiB,KAAK,SAAS,MAAM,GAAG,MAAM,eAChC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA6M1D,mBAAmB,CAAC;oBA1Md,OAAO;mBACR,OAAO;kBACR,OAAO;mBACN,OAAO;iBACT,OAAO;gBACR,OAAO;eACR,OAAO;mBACH,KAAK,GAAG,IAAI;eAChB,KAAK,GAAG,IAAI;qBACN,OAAO;yBACH,OAAO;mBACb,OAAO;mBA+L0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;iBArHA,CAAC,KAAK,EAAE;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;gBACrC,MAAM,IAAI;;iBADT,CAAC,KAAK,EAAE;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;gBACrC,MAAM,IAAI;;;YAxEd,QAAQ,GAAG,IAAI;YACf,UAAU,GAAG,IAAI;YACjB,kBAAkB,SAAS;YAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;YAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;SAAC,GAAG,IAAI;YACtG,eAAe,GAAG,IAAI;YACtB,iBAAiB,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;YACzD,aAAa,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;YACrD,WAAW,GAAG,IAAI;YAClB,cAAc,GAAG,IAAI;YACrB,aAAa,GAAG,IAAI;;;;;YAyLkB,OAAO,CAAC,OAAO,WAAW,CAAC;;AAvNvE,wBAuN4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -19,7 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
19
|
previous: {},
|
20
20
|
next: {},
|
21
21
|
isNoCursor: { type: Boolean },
|
22
|
-
hideOptionIcon: { type: Boolean }
|
22
|
+
hideOptionIcon: { type: Boolean },
|
23
|
+
disabled: { type: Boolean }
|
23
24
|
},
|
24
25
|
emits: ["select", "unselect", "update:is-cursor", "update:cursor", "update:previous", "update:next", "unmounted", "update:first", "update:last"],
|
25
26
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -27,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
28
|
const emit = __emit;
|
28
29
|
const elementRef = useTemplateRef("element");
|
29
30
|
const toggle = () => {
|
30
|
-
if (props.skeleton || props.loading) return;
|
31
|
+
if (props.skeleton || props.loading || props.disabled) return;
|
31
32
|
if (props.isSelected) emit("unselect");
|
32
33
|
else emit("select");
|
33
34
|
};
|
@@ -68,11 +69,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
68
69
|
return (_ctx, _cache) => {
|
69
70
|
return openBlock(), createElementBlock("div", {
|
70
71
|
ref: "element",
|
71
|
-
class: normalizeClass(["relative grid w-full grid-cols-[auto,1fr,2.5rem]
|
72
|
-
"bg-primary-light dark:bg-primary-darkest": _ctx.isSelected,
|
73
|
-
"before:opacity-5": !_ctx.loading && _ctx.isCursor && !_ctx.skeleton,
|
72
|
+
class: normalizeClass(["w-select-option relative grid w-full grid-cols-[auto,1fr,2.5rem]", {
|
73
|
+
"bg-primary-light/30 dark:bg-primary-darkest/30": _ctx.isSelected,
|
74
|
+
"before:opacity-5": !_ctx.loading && _ctx.isCursor && !_ctx.skeleton && !_ctx.disabled,
|
74
75
|
"cursor-progress": _ctx.loading || _ctx.skeleton,
|
75
|
-
"w-ripple": !_ctx.loading && !_ctx.skeleton
|
76
|
+
"w-ripple": !_ctx.loading && !_ctx.skeleton && !_ctx.disabled,
|
77
|
+
"cursor-not-allowed": _ctx.disabled
|
76
78
|
}]),
|
77
79
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
78
80
|
}, ["prevent", "stop"])),
|
@@ -94,7 +96,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
94
96
|
}, {
|
95
97
|
default: withCtx(() => [
|
96
98
|
!_ctx.hideOptionIcon && (_ctx.isSelected || _ctx.loading) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
97
|
-
_ctx.isSelected && !_ctx.loading ? (openBlock(), createBlock(unref(IconCheck), {
|
99
|
+
_ctx.isSelected && !_ctx.loading ? (openBlock(), createBlock(unref(IconCheck), {
|
100
|
+
key: 0,
|
101
|
+
class: "square-[1.5em]"
|
102
|
+
})) : _ctx.loading ? (openBlock(), createBlock(WSpinner, { key: 1 })) : createCommentVNode("", true)
|
98
103
|
])) : createCommentVNode("", true)
|
99
104
|
]),
|
100
105
|
_: 1
|
@@ -6,7 +6,10 @@ declare const _default: <Data extends DefaultData, OptionComponent extends Selec
|
|
6
6
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
7
7
|
attrs: any;
|
8
8
|
slots: {
|
9
|
-
option?(_: {
|
9
|
+
option?(_: {
|
10
|
+
option: Data | undefined;
|
11
|
+
search: string | undefined;
|
12
|
+
}): any;
|
10
13
|
};
|
11
14
|
emit: (e: "unselect") => void;
|
12
15
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|