eco-vue-js 0.10.17 → 0.10.18
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/FormAsync/WFormAsyncSelect.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +1 -0
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.js +1 -1
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +15 -11
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +17 -12
- package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncList.vue.js +0 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.js +3 -1
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +3 -1
- package/dist/components/Select/WSelectStringified.vue.js +1 -0
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.js +14 -13
- package/dist/components/Select/components/SelectOption.vue.js +4 -4
- package/dist/components/Select/types.d.ts +1 -0
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/utils/useDefaultQuery.d.ts.map +1 -1
- package/dist/utils/useDefaultQuery.js +13 -15
- package/package.json +1 -1
- package/tailwind-base/plugins/default.ts +2 -1
- package/tailwind-base/theme/sizes.ts +1 -0
@@ -41,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
41
41
|
toRef(props, "queryParams"),
|
42
42
|
{
|
43
43
|
...props.queryOptions ?? {},
|
44
|
-
refetchInterval: props.refetchInterval ?
|
44
|
+
refetchInterval: props.refetchInterval ? () => isIntersecting.value ? props.refetchInterval : void 0 : void 0
|
45
45
|
}
|
46
46
|
);
|
47
47
|
const nextPage = computed(() => data.value?.next);
|
@@ -35,7 +35,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
35
|
const pages = ref([props.queryParams.page ?? 1]);
|
36
36
|
const pagesCount = ref(1);
|
37
37
|
const count = ref(0);
|
38
|
-
const nextPage = computed(() => pages.value[pages.value.length - 1]
|
38
|
+
const nextPage = computed(() => pages.value[pages.value.length - 1] < pagesCount.value ? pages.value[pages.value.length - 1] + 1 : null);
|
39
39
|
const previousPage = computed(() => pages.value[0] !== 1 ? pages.value[0] - 1 : null);
|
40
40
|
const isResettingPage = ref(false);
|
41
41
|
const getSkeletonLength = (pagesBefore) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AAkKA;
|
1
|
+
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AAkKA;AAsbA,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;WAqpB1D,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
class: "w-select-option first
|
15
|
+
class: "w-select-option first:-pt--w-select-option-padding last:-pb--w-select-option-padding"
|
16
16
|
};
|
17
17
|
const _hoisted_3 = { class: "w-option flex cursor-default select-none items-center" };
|
18
18
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -30,6 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
30
30
|
filterOptions: { type: Function },
|
31
31
|
hideOptionIcon: { type: Boolean },
|
32
32
|
createdData: {},
|
33
|
+
selectOnClose: { type: Boolean },
|
33
34
|
mobileTitle: {},
|
34
35
|
persist: { type: Boolean },
|
35
36
|
type: {},
|
@@ -92,7 +93,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
92
93
|
const cursor = ref(0);
|
93
94
|
const isCursorLocked = ref(false);
|
94
95
|
const search = ref("");
|
95
|
-
const isModelValueSearch = computed(() => search.value && props.modelValue.includes(search.value));
|
96
|
+
const isModelValueSearch = computed(() => !!search.value && props.modelValue.includes(search.value));
|
96
97
|
const searchPrepared = computed(() => isModelValueSearch.value ? "" : search.value.trim().toLocaleLowerCase());
|
97
98
|
const enabled = computed(() => !props.disabled);
|
98
99
|
const { data, isLoading, error: queryError } = props.useQueryFnOptions ? props.queryParamsOptions === void 0 ? props.useQueryFnOptions({ enabled }) : props.useQueryFnOptions(toRef(props, "queryParamsOptions"), { enabled }) : {
|
@@ -126,6 +127,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
126
127
|
const close = () => {
|
127
128
|
isOpen.value = false;
|
128
129
|
focused.value = false;
|
130
|
+
if (props.selectOnClose && search.value && !isModelValueSearch.value) {
|
131
|
+
const optionExact = optionsFiltered.value.find((option) => props.valueGetter(option) === search.value);
|
132
|
+
if (optionExact) select(props.valueGetter(optionExact));
|
133
|
+
else create(search.value);
|
134
|
+
}
|
135
|
+
search.value = "";
|
129
136
|
};
|
130
137
|
const setLoadingOptionIndex = (value) => {
|
131
138
|
if (isDisabled.value) return;
|
@@ -255,15 +262,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
255
262
|
"onKeypress:down": withModifiers(cursorDown, ["prevent"]),
|
256
263
|
"onKeypress:delete": captureDoubleDelete,
|
257
264
|
onOpen: _cache[3] || (_cache[3] = ($event) => isOpen.value = true),
|
258
|
-
onClose:
|
259
|
-
|
260
|
-
search.value = "";
|
261
|
-
}),
|
262
|
-
onFocus: _cache[5] || (_cache[5] = ($event) => {
|
265
|
+
onClose: close,
|
266
|
+
onFocus: _cache[4] || (_cache[4] = ($event) => {
|
263
267
|
focused.value = true;
|
264
268
|
_ctx.$emit("focus", $event);
|
265
269
|
}),
|
266
|
-
onBlur: _cache[
|
270
|
+
onBlur: _cache[5] || (_cache[5] = ($event) => {
|
267
271
|
focused.value = false;
|
268
272
|
_ctx.$emit("blur", $event);
|
269
273
|
})
|
@@ -305,11 +309,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
305
309
|
scroll: isCursorLocked.value,
|
306
310
|
"hide-option-icon": _ctx.hideOptionIcon,
|
307
311
|
disabled: !search.value || isModelValueSearch.value,
|
308
|
-
class: "first
|
312
|
+
class: "first:-pt--w-select-option-padding last:-pb--w-select-option-padding",
|
309
313
|
onSelect: _cache[0] || (_cache[0] = ($event) => create(search.value)),
|
310
314
|
onMouseenter: _cache[1] || (_cache[1] = ($event) => setCursor(optionsFiltered.value.length))
|
311
315
|
}, {
|
312
|
-
prefix: withCtx(() => _cache[
|
316
|
+
prefix: withCtx(() => _cache[6] || (_cache[6] = [
|
313
317
|
createElementVNode("div", { class: "w-option flex items-center pr-2" }, " Create: ", -1)
|
314
318
|
])),
|
315
319
|
default: withCtx(() => [
|
@@ -341,7 +345,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
341
345
|
loading: loadingOptionIndex.value === index && _ctx.loading,
|
342
346
|
scroll: isCursorLocked.value,
|
343
347
|
"hide-option-icon": _ctx.hideOptionIcon,
|
344
|
-
class: "first
|
348
|
+
class: "first:-pt--w-select-option-padding last:-pb--w-select-option-padding",
|
345
349
|
onSelect: ($event) => {
|
346
350
|
select(_ctx.valueGetter(option));
|
347
351
|
setLoadingOptionIndex(index);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AAyHA;
|
1
|
+
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AAyHA;AAsSA,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;WAyf1D,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;;;YArJlI,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;;;;;YA4eM,OAAO,CAAC,OAAO,WAAW,CAAC;;AAngBvE,wBAmgB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -23,6 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
23
|
createOption: {},
|
24
24
|
hideOptionIcon: { type: Boolean },
|
25
25
|
createdData: {},
|
26
|
+
selectOnClose: { type: Boolean },
|
26
27
|
mobileTitle: {},
|
27
28
|
persist: { type: Boolean },
|
28
29
|
type: {},
|
@@ -85,6 +86,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
85
86
|
const search = ref("");
|
86
87
|
const loadingCreate = ref(false);
|
87
88
|
const isDisabled = computed(() => props.loading || props.readonly || props.disabled);
|
89
|
+
const isModelValueSearch = computed(() => !!search.value && props.modelValue.includes(search.value));
|
88
90
|
const enabled = computed(() => !props.disabled);
|
89
91
|
const queryParams = computed(() => ({ ...props.queryParamsOptions, [props.searchField ?? "search"]: search.value }));
|
90
92
|
const queryParamsFirstPage = computed(() => ({ ...queryParams.value, page: 1 }));
|
@@ -96,6 +98,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
96
98
|
const close = () => {
|
97
99
|
isOpen.value = false;
|
98
100
|
focused.value = false;
|
101
|
+
if (props.selectOnClose && search.value && !isModelValueSearch.value) {
|
102
|
+
const optionExact = firstPageData.value?.results.find((option) => props.valueGetter(option) === search.value);
|
103
|
+
if (optionExact) select(props.valueGetter(optionExact));
|
104
|
+
else create(search.value);
|
105
|
+
}
|
106
|
+
search.value = "";
|
99
107
|
};
|
100
108
|
let deletePressTimeout = null;
|
101
109
|
const captureDoubleDelete = () => {
|
@@ -120,11 +128,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
120
128
|
emit("unselect", item);
|
121
129
|
search.value = "";
|
122
130
|
};
|
123
|
-
const create = async () => {
|
131
|
+
const create = async (value) => {
|
124
132
|
if (isDisabled.value) return;
|
125
133
|
if (!props.createOption) return;
|
126
134
|
loadingCreate.value = true;
|
127
|
-
const option = await props.createOption(
|
135
|
+
const option = await props.createOption(value);
|
128
136
|
if (option) {
|
129
137
|
select(props.valueGetter(option));
|
130
138
|
search.value = "";
|
@@ -172,16 +180,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
172
180
|
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
173
181
|
}, {
|
174
182
|
class: _ctx.$attrs.class,
|
175
|
-
"onUpdate:modelValue": _cache[
|
176
|
-
"onKeypress:enter": _cache[
|
177
|
-
"onKeypress:up": _cache[
|
178
|
-
"onKeypress:down": _cache[
|
183
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => !_ctx.loading && !isFetchingPrefix.value && (search.value = $event ?? "")),
|
184
|
+
"onKeypress:enter": _cache[3] || (_cache[3] = withModifiers(($event) => unref(listRef)?.selectCursor(), ["stop", "prevent"])),
|
185
|
+
"onKeypress:up": _cache[4] || (_cache[4] = withModifiers(($event) => unref(listRef)?.cursorUp(), ["prevent"])),
|
186
|
+
"onKeypress:down": _cache[5] || (_cache[5] = withModifiers(($event) => unref(listRef)?.cursorDown(), ["prevent"])),
|
179
187
|
"onKeypress:delete": captureDoubleDelete,
|
180
|
-
onOpen: _cache[
|
181
|
-
onClose:
|
182
|
-
close();
|
183
|
-
search.value = "";
|
184
|
-
}),
|
188
|
+
onOpen: _cache[6] || (_cache[6] = ($event) => isOpen.value = true),
|
189
|
+
onClose: close,
|
185
190
|
onFocus: _cache[7] || (_cache[7] = ($event) => {
|
186
191
|
focused.value = true;
|
187
192
|
_ctx.$emit("focus", $event);
|
@@ -243,7 +248,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
243
248
|
search: search.value,
|
244
249
|
onSelect: select,
|
245
250
|
onUnselect: unselect,
|
246
|
-
"onCreate:option": create,
|
251
|
+
"onCreate:option": _cache[1] || (_cache[1] = ($event) => create(search.value)),
|
247
252
|
"onUpdate:modelValue": updateSelected
|
248
253
|
}, {
|
249
254
|
default: withCtx(({ option, selected, skeleton: skeletonList }) => [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsyncList.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsyncList.vue"],"names":[],"mappings":"AAwDA;yBA4GiB,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,CAA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AAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -54,7 +54,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
54
54
|
"value-getter": _ctx.valueGetter,
|
55
55
|
"query-options": _ctx.queryOptions,
|
56
56
|
transition: "",
|
57
|
-
"no-padding": "",
|
58
57
|
onSelect: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("select", $event)),
|
59
58
|
onUnselect: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("unselect", $event)),
|
60
59
|
"onUpdate:count": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:count", $event)),
|
@@ -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":"AAsDA;AA6FA,OAAO,KAAK,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;yBAMzD,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,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;WA2L1D,mBAAmB,CAAC;;;0PAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;uBAnCiB,GAAG;0BACA,GAAG;;;;;;YACL,GAAG;uBACJ,GAAG;;;YAnJzB,mBAAmB,0DAAoB,IAAI;YAC3C,YAAY,GAAG,IAAI;;;;;YAuLmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AArMvE,wBAqM4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -21,6 +21,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
21
|
hidePrefix: { type: Boolean },
|
22
22
|
createOption: { type: Function },
|
23
23
|
hideOptionIcon: { type: Boolean },
|
24
|
+
selectOnClose: { type: Boolean },
|
24
25
|
mobileTitle: {},
|
25
26
|
persist: { type: Boolean },
|
26
27
|
type: {},
|
@@ -94,7 +95,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
94
95
|
previewData: _ctx.previewData ? [_ctx.previewData] : void 0,
|
95
96
|
createdData: _ctx.createdData ? [_ctx.createdData] : void 0,
|
96
97
|
hidePrefix: true,
|
97
|
-
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
98
|
+
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue,
|
99
|
+
selectOnClose: props.searchModel ? props.searchModel : props.selectOnClose
|
98
100
|
}, {
|
99
101
|
class: _ctx.$attrs.class,
|
100
102
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event)),
|
@@ -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":"AAsDA;AAgGA,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;WAkM1D,mBAAmB,CAAC;;;;8RAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;uBAnCiB,GAAG;0BACA,GAAG;;;;;;YACL,GAAG;uBACJ,GAAG;;;YA1JzB,oBAAoB,0DAAoB,IAAI;YAC5C,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;;;;YA6LmB,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"}
|
@@ -17,6 +17,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
17
|
createOption: { type: Function },
|
18
18
|
filterOptions: { type: Function },
|
19
19
|
hideOptionIcon: { type: Boolean },
|
20
|
+
selectOnClose: { type: Boolean },
|
20
21
|
mobileTitle: {},
|
21
22
|
persist: { type: Boolean },
|
22
23
|
type: {},
|
@@ -93,7 +94,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
93
94
|
disableClear: !_ctx.allowClear,
|
94
95
|
createdData: _ctx.createdData ? [_ctx.createdData] : void 0,
|
95
96
|
hidePrefix: true,
|
96
|
-
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
97
|
+
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue,
|
98
|
+
selectOnClose: props.searchModel ? props.searchModel : props.selectOnClose
|
97
99
|
}, {
|
98
100
|
class: _ctx.$attrs.class,
|
99
101
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event)),
|
@@ -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":"AAsHA;yBA4QiB,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;WAqe1D,mBAAmB,CAAC;;;;;;;oBAled,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;mBAid6E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;;MAAsB,GAAG,IAAI;WACpE,GAAG;;kBAnWC,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;;;;;YA+cgB,OAAO,CAAC,OAAO,WAAW,CAAC;;AA/evE,wBA+e4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -116,7 +116,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
116
116
|
first: count.value === 0,
|
117
117
|
"is-no-cursor": cursor.value === void 0,
|
118
118
|
"hide-option-icon": _ctx.hideOptionIcon,
|
119
|
-
|
119
|
+
disabled: !_ctx.search || isModelValueSearch.value,
|
120
|
+
class: "first:-pt--w-select-option-padding last:-pb--w-select-option-padding",
|
120
121
|
onMouseenter: _cache[0] || (_cache[0] = ($event) => setCursor(null)),
|
121
122
|
"onUpdate:cursor": _cache[1] || (_cache[1] = ($event) => setCursor(null)),
|
122
123
|
onSelect: _cache[2] || (_cache[2] = ($event) => {
|
@@ -128,7 +129,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
128
129
|
"onUpdate:next": _cache[4] || (_cache[4] = ($event) => cursorNext.value = $event),
|
129
130
|
onUnmounted: _cache[5] || (_cache[5] = ($event) => updateCursor(void 0))
|
130
131
|
}, {
|
131
|
-
prefix: withCtx(() => _cache[
|
132
|
+
prefix: withCtx(() => _cache[10] || (_cache[10] = [
|
132
133
|
createElementVNode("span", { class: "w-option flex items-center pr-2" }, " Create: ", -1)
|
133
134
|
])),
|
134
135
|
default: withCtx(() => [
|
@@ -141,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
141
142
|
}) : (openBlock(), createElementBlock("div", _hoisted_1, " Start typing.. "))
|
142
143
|
]),
|
143
144
|
_: 3
|
144
|
-
}, 8, ["is-cursor", "loading", "scroll", "previous", "next", "first", "is-no-cursor", "hide-option-icon"])) : createCommentVNode("", true),
|
145
|
+
}, 8, ["is-cursor", "loading", "scroll", "previous", "next", "first", "is-no-cursor", "hide-option-icon", "disabled"])) : createCommentVNode("", true),
|
145
146
|
createVNode(_sfc_main$2, {
|
146
147
|
"use-query-fn": _ctx.useQueryFn,
|
147
148
|
"query-params": _ctx.queryParams,
|
@@ -158,12 +159,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
158
159
|
"header-top-ignore": "",
|
159
160
|
"min-height": "",
|
160
161
|
"no-gap": "",
|
161
|
-
"onUpdate:count": _cache[
|
162
|
+
"onUpdate:count": _cache[8] || (_cache[8] = ($event) => {
|
162
163
|
_ctx.$emit("update:count", $event);
|
163
164
|
count.value = $event;
|
164
165
|
updateCursor(void 0);
|
165
166
|
}),
|
166
|
-
"onUpdate:selected": _cache[
|
167
|
+
"onUpdate:selected": _cache[9] || (_cache[9] = ($event) => !_ctx.disabled && _ctx.$emit("update:modelValue", $event))
|
167
168
|
}, {
|
168
169
|
default: withCtx(({ item, skeleton, previous, next, first, last }) => [
|
169
170
|
createVNode(_sfc_main$1, {
|
@@ -174,13 +175,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
174
175
|
scroll: isCursorLocked.value,
|
175
176
|
first,
|
176
177
|
last,
|
177
|
-
previous: first &&
|
178
|
-
next: last &&
|
178
|
+
previous: first && _ctx.allowCreate ? null : previous ? _ctx.valueGetter(previous) : void 0,
|
179
|
+
next: last && _ctx.allowCreate ? null : next ? _ctx.valueGetter(next) : void 0,
|
179
180
|
"is-no-cursor": cursor.value === void 0,
|
180
181
|
"hide-option-icon": _ctx.hideOptionIcon,
|
181
182
|
class: normalizeClass({
|
182
|
-
"pt-
|
183
|
-
"pb-
|
183
|
+
"-pt--w-select-option-padding": !_ctx.noPadding && first && !_ctx.allowCreate,
|
184
|
+
"-pb--w-select-option-padding": !_ctx.noPadding && last
|
184
185
|
}),
|
185
186
|
onSelect: ($event) => emitSelect(_ctx.valueGetter(item)),
|
186
187
|
onUnselect: ($event) => emitUnselect(_ctx.valueGetter(item)),
|
@@ -189,7 +190,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
189
190
|
"onUpdate:isCursor": updateCursors,
|
190
191
|
"onUpdate:previous": _cache[6] || (_cache[6] = ($event) => cursorPrevious.value = $event),
|
191
192
|
"onUpdate:next": _cache[7] || (_cache[7] = ($event) => cursorNext.value = $event),
|
192
|
-
onUnmounted:
|
193
|
+
onUnmounted: ($event) => updateCursor(next ? _ctx.valueGetter(next) : void 0),
|
193
194
|
"onUpdate:first": ($event) => firstItem.value = _ctx.valueGetter(item),
|
194
195
|
"onUpdate:last": ($event) => lastItem.value = _ctx.valueGetter(item)
|
195
196
|
}, {
|
@@ -202,12 +203,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
202
203
|
})
|
203
204
|
]),
|
204
205
|
_: 2
|
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"])
|
206
|
+
}, 1032, ["is-selected", "is-cursor", "loading", "skeleton", "scroll", "first", "last", "previous", "next", "is-no-cursor", "hide-option-icon", "class", "onSelect", "onUnselect", "onMouseenter", "onUpdate:cursor", "onUnmounted", "onUpdate:first", "onUpdate:last"])
|
206
207
|
]),
|
207
208
|
empty: withCtx(() => [
|
208
209
|
createElementVNode("div", {
|
209
|
-
class: normalizeClass(["w-select-option pb-
|
210
|
-
"pt-
|
210
|
+
class: normalizeClass(["w-select-option -pb--w-select-option-padding", {
|
211
|
+
"-pt--w-select-option-padding": !_ctx.noPadding && !_ctx.allowCreate
|
211
212
|
}])
|
212
213
|
}, [
|
213
214
|
createElementVNode("div", _hoisted_2, toDisplayString(!_ctx.search && _ctx.emptyStub ? _ctx.emptyStub : "No match"), 1)
|
@@ -4,7 +4,7 @@ import IconCheck from '../../../assets/icons/default/IconCheck.svg.js';
|
|
4
4
|
|
5
5
|
const _hoisted_1 = {
|
6
6
|
key: 0,
|
7
|
-
class: "text-primary-default dark:text-primary-dark w-spinner-size-[1.
|
7
|
+
class: "text-primary-default dark:text-primary-dark w-spinner-size-[1.25em] col-start-3 flex items-center justify-self-end"
|
8
8
|
};
|
9
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
10
10
|
__name: "SelectOption",
|
@@ -69,7 +69,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
69
69
|
return (_ctx, _cache) => {
|
70
70
|
return openBlock(), createElementBlock("div", {
|
71
71
|
ref: "element",
|
72
|
-
class: normalizeClass(["w-select-option relative grid w-full grid-cols-[auto,1fr,
|
72
|
+
class: normalizeClass(["w-select-option relative grid w-full grid-cols-[auto,1fr,1.25em]", {
|
73
73
|
"bg-primary-light/30 dark:bg-primary-darkest/30": _ctx.isSelected,
|
74
74
|
"before:opacity-5": !_ctx.loading && _ctx.isCursor && !_ctx.skeleton && !_ctx.disabled,
|
75
75
|
"cursor-progress": _ctx.loading || _ctx.skeleton,
|
@@ -82,7 +82,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
82
82
|
}, [
|
83
83
|
renderSlot(_ctx.$slots, "prefix"),
|
84
84
|
createElementVNode("div", {
|
85
|
-
class: normalizeClass(["col-start-2 flex items-center overflow-hidden", {
|
85
|
+
class: normalizeClass(["-pr--w-option-padding col-start-2 flex items-center overflow-hidden", {
|
86
86
|
"col-span-2": _ctx.hideOptionIcon
|
87
87
|
}])
|
88
88
|
}, [
|
@@ -98,7 +98,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
98
98
|
!_ctx.hideOptionIcon && (_ctx.isSelected || _ctx.loading) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
99
99
|
_ctx.isSelected && !_ctx.loading ? (openBlock(), createBlock(unref(IconCheck), {
|
100
100
|
key: 0,
|
101
|
-
class: "square-[1.
|
101
|
+
class: "square-[1.25em]"
|
102
102
|
})) : _ctx.loading ? (openBlock(), createBlock(WSpinner, { key: 1 })) : createCommentVNode("", true)
|
103
103
|
])) : createCommentVNode("", true)
|
104
104
|
]),
|
@@ -39,6 +39,7 @@ export interface SelectProps<Model extends number | string, Data extends Default
|
|
39
39
|
filterOptions?: (option: Data) => boolean;
|
40
40
|
hideOptionIcon?: boolean;
|
41
41
|
createdData?: Data[];
|
42
|
+
selectOnClose?: boolean;
|
42
43
|
}
|
43
44
|
export interface SelectPrefixProps<Data extends DefaultData, OptionComponent extends SelectOptionComponent<Data>> extends SelectOptionComponentProps<Data, OptionComponent> {
|
44
45
|
option: Data | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.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AE9B,KAAK,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAEvD,KAAK,OAAO,CAAC,YAAY,GAAG,OAAO,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAEhI,KAAK,yBAAyB,CAAC,YAAY,GAAG,OAAO,EAAE,KAAK,GAAG,YAAY,IAAI,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG;IACnH,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,YAAY,YACZ,KAAK,iBACL,SAAS,SAAS,QAAQ;;;+EACuD,yBAAyB,CAAC,YAAY,EAAE,KAAK,CAO/H,CAAA;AAED,eAAO,MAAM,WAAW,KAAK,CAAA;AAE7B,eAAO,MAAM,kBAAkB,GAAI,IAAI,EAAE,WAAW,SAAS;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAC,OAAO,MAAM,UAAU,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,0BAA6B,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAoDvO,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,IAAI,EAAE,WAAW,SAAS;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAC,OAAO,MAAM,WAAW,eAAe,CAAC,IAAI,EAAE,CAAC,KAAG,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAYnK,CAAA"}
|
@@ -13,22 +13,20 @@ const makeQueryPaginated = (key, getter, setter, pageLength = PAGE_LENGTH) => {
|
|
13
13
|
return (queryParams, options = {}) => {
|
14
14
|
const query = useDefaultQuery({
|
15
15
|
queryKey: [key, queryParams],
|
16
|
-
queryFn: () => {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
results: currentList.slice(pageLength * (current - 1), pageLength * current)
|
29
|
-
});
|
16
|
+
queryFn: () => new Promise((resolve, reject) => {
|
17
|
+
const currentList = getter(unref(queryParams));
|
18
|
+
const current = Math.max(unref(queryParams).page ?? 1, 1);
|
19
|
+
const pages_count = Math.max(Math.ceil(currentList.length / pageLength), 1);
|
20
|
+
if (current > pages_count) reject(new ApiError({ status: 404 }));
|
21
|
+
else resolve({
|
22
|
+
count: currentList.length,
|
23
|
+
pages_count,
|
24
|
+
current,
|
25
|
+
next: pages_count > current ? current + 1 : null,
|
26
|
+
previous: current !== 1 ? current - 1 : null,
|
27
|
+
results: currentList.slice(pageLength * (current - 1), pageLength * current)
|
30
28
|
});
|
31
|
-
},
|
29
|
+
}),
|
32
30
|
...options
|
33
31
|
});
|
34
32
|
const setDataOld = query.setData;
|
package/package.json
CHANGED
@@ -184,12 +184,13 @@ const pluginDefault = plugin(function ({matchUtilities, addVariant, addUtilities
|
|
184
184
|
'margin-right': 'calc(var(--w-option-rounded) * -1)',
|
185
185
|
},
|
186
186
|
'.w-select-option': {
|
187
|
-
padding: '
|
187
|
+
padding: 'calc(var(--w-select-option-padding) / 2) var(--w-select-option-padding)',
|
188
188
|
},
|
189
189
|
body: {
|
190
190
|
'--w-option-height': 'calc(var(--w-input-height,2.75rem) - (var(--w-input-gap,0.25rem) * 2) - 2px)',
|
191
191
|
'--w-option-rounded': 'calc(var(--w-input-rounded,0.75rem) - var(--w-input-gap,0.25rem))',
|
192
192
|
'--w-option-padding': 'var(--w-input-rounded,0.75rem)',
|
193
|
+
'--w-select-option-padding': 'calc(var(--w-option-padding) + var(--w-input-gap) + 1px)',
|
193
194
|
},
|
194
195
|
})
|
195
196
|
|