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.
Files changed (27) hide show
  1. package/dist/components/FormAsync/WFormAsyncSelect.vue.js +1 -0
  2. package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +1 -0
  3. package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +1 -0
  4. package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +1 -0
  5. package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +1 -1
  6. package/dist/components/InfiniteList/components/InfiniteListPages.vue.js +1 -1
  7. package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
  8. package/dist/components/Select/WSelect.vue.js +15 -11
  9. package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
  10. package/dist/components/Select/WSelectAsync.vue.js +17 -12
  11. package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
  12. package/dist/components/Select/WSelectAsyncList.vue.js +0 -1
  13. package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
  14. package/dist/components/Select/WSelectAsyncSingle.vue.js +3 -1
  15. package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
  16. package/dist/components/Select/WSelectSingle.vue.js +3 -1
  17. package/dist/components/Select/WSelectStringified.vue.js +1 -0
  18. package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
  19. package/dist/components/Select/components/SelectAsyncList.vue.js +14 -13
  20. package/dist/components/Select/components/SelectOption.vue.js +4 -4
  21. package/dist/components/Select/types.d.ts +1 -0
  22. package/dist/components/Select/types.d.ts.map +1 -1
  23. package/dist/utils/useDefaultQuery.d.ts.map +1 -1
  24. package/dist/utils/useDefaultQuery.js +13 -15
  25. package/package.json +1 -1
  26. package/tailwind-base/plugins/default.ts +2 -1
  27. package/tailwind-base/theme/sizes.ts +1 -0
@@ -15,6 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  filterOptions: {},
16
16
  hideOptionIcon: { type: Boolean },
17
17
  createdData: {},
18
+ selectOnClose: { type: Boolean },
18
19
  mobileTitle: {},
19
20
  persist: { type: Boolean },
20
21
  type: {},
@@ -20,6 +20,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  hidePrefix: { type: Boolean },
21
21
  createOption: {},
22
22
  hideOptionIcon: { type: Boolean },
23
+ selectOnClose: { type: Boolean },
23
24
  mobileTitle: {},
24
25
  persist: { type: Boolean },
25
26
  type: {},
@@ -16,6 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  createOption: {},
17
17
  filterOptions: {},
18
18
  hideOptionIcon: { type: Boolean },
19
+ selectOnClose: { type: Boolean },
19
20
  mobileTitle: {},
20
21
  persist: { type: Boolean },
21
22
  type: {},
@@ -16,6 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  filterOptions: {},
17
17
  hideOptionIcon: { type: Boolean },
18
18
  createdData: {},
19
+ selectOnClose: { type: Boolean },
19
20
  mobileTitle: {},
20
21
  persist: { type: Boolean },
21
22
  type: {},
@@ -41,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
41
41
  toRef(props, "queryParams"),
42
42
  {
43
43
  ...props.queryOptions ?? {},
44
- refetchInterval: props.refetchInterval ? computed(() => isIntersecting.value ? props.refetchInterval : void 0) : void 0
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] !== pagesCount.value ? pages.value[pages.value.length - 1] + 1 : null);
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;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,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A2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BAncrB,MAAM,KAAG,IAAI;MAmc8B,GAAG,IAAI;WACpE,GAAG;;gBAvZD,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;;;YAjQd,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;;;;;YA+oBmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AA/pBvE,wBA+pB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -12,7 +12,7 @@ const _hoisted_1 = {
12
12
  };
13
13
  const _hoisted_2 = {
14
14
  key: 1,
15
- class: "w-select-option first:pt-4 last:pb-4"
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: _cache[4] || (_cache[4] = ($event) => {
259
- close();
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[6] || (_cache[6] = ($event) => {
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:pt-4 last:pb-4",
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[7] || (_cache[7] = [
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:pt-4 last:pb-4",
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;AA4RA,OAAO,KAAK,EAAC,gBAAgB,EAAE,qBAAqB,EAA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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(search.value);
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[1] || (_cache[1] = ($event) => !_ctx.loading && !isFetchingPrefix.value && (search.value = $event ?? "")),
176
- "onKeypress:enter": _cache[2] || (_cache[2] = withModifiers(($event) => unref(listRef)?.selectCursor(), ["stop", "prevent"])),
177
- "onKeypress:up": _cache[3] || (_cache[3] = withModifiers(($event) => unref(listRef)?.cursorUp(), ["prevent"])),
178
- "onKeypress:down": _cache[4] || (_cache[4] = withModifiers(($event) => unref(listRef)?.cursorDown(), ["prevent"])),
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[5] || (_cache[5] = ($event) => isOpen.value = true),
181
- onClose: _cache[6] || (_cache[6] = ($event) => {
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":"AAyDA;yBA6GiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAA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,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;;;YAVlG,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;;;;;YAsLE,OAAO,CAAC,OAAO,WAAW,CAAC;;AAxNvE,wBAwN4E;AAC5E,KAAK,mBAAmB,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":"AAqDA;AA4FA,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,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C5F,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":"AAuDA;AAiGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,iB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U,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)),
@@ -17,6 +17,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  filterOptions: { type: Function },
18
18
  hideOptionIcon: { type: Boolean },
19
19
  createdData: {},
20
+ selectOnClose: { type: Boolean },
20
21
  mobileTitle: {},
21
22
  persist: { type: Boolean },
22
23
  type: {},
@@ -1 +1 @@
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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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
- class: "first:pt-4 last:pb-4",
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[11] || (_cache[11] = [
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[9] || (_cache[9] = ($event) => {
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[10] || (_cache[10] = ($event) => !_ctx.disabled && _ctx.$emit("update:modelValue", $event))
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 && props.allowCreate ? null : previous ? _ctx.valueGetter(previous) : void 0,
178
- next: last && props.allowCreate ? null : next ? _ctx.valueGetter(next) : void 0,
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-4": !_ctx.noPadding && first && !_ctx.allowCreate,
183
- "pb-4": !_ctx.noPadding && last
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: _cache[8] || (_cache[8] = ($event) => updateCursor(void 0)),
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-4", {
210
- "pt-4": !_ctx.noPadding && !_ctx.allowCreate
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.5em] col-start-3 flex items-center justify-center"
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,2.5rem]", {
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.5em]"
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.ts","sourceRoot":"","sources":["../../../../src/components/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,KAAK,CAAA;AAElC,MAAM,MAAM,iBAAiB,CAAC,MAAM,IAAI;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAEzH,MAAM,MAAM,qBAAqB,CAAC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;AAEhF,MAAM,WAAW,0BAA0B,CAAC,MAAM,EAAE,eAAe,SAAS,qBAAqB,CAAC,MAAM,CAAC;IACvG,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,oBAAoB,CAAC,EAAE,eAAe,SAAS,SAAS,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;CACtI;AAED,UAAU,mBAAmB,CAAC,IAAI,SAAS,WAAW;IACpD,iBAAiB,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC,CAAA;IACxC,kBAAkB,CAAC,EAAE,KAAK,CAAA;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB;AAED,UAAU,qBAAqB,CAAC,IAAI,SAAS,WAAW,EAAE,WAAW;IACnE,iBAAiB,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAA;IAC1D,kBAAkB,EAAE,WAAW,CAAA;IAC/B,OAAO,CAAC,EAAE,KAAK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options = {}) => {
14
14
  const query = useDefaultQuery({
15
15
  queryKey: [key, queryParams],
16
- queryFn: () => {
17
- return new Promise((resolve, reject) => {
18
- const currentList = getter(unref(queryParams));
19
- const current = Math.max(unref(queryParams).page ?? 1, 1);
20
- const pages_count = Math.max(Math.ceil(currentList.length / pageLength), 1);
21
- if (current > pages_count) reject(new ApiError({ status: 404 }));
22
- else resolve({
23
- count: currentList.length,
24
- pages_count,
25
- current,
26
- next: pages_count > current ? current + 1 : null,
27
- previous: current !== 1 ? current - 1 : null,
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
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.10.17",
7
+ "version": "0.10.18",
8
8
  "scripts": {
9
9
  "build": "run-p type-check \"build-only {@}\" --",
10
10
  "dev": "vite build --watch",
@@ -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: '0.5rem calc(var(--w-option-padding) + var(--w-input-gap) + 1px)',
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
 
@@ -14,6 +14,7 @@ const newValues = {
14
14
  '--w-option-padding': 'var(--w-option-padding)',
15
15
  '--w-input-height': 'var(--w-input-height)',
16
16
  '--w-input-gap': 'var(--w-input-gap)',
17
+ '--w-select-option-padding': 'var(--w-select-option-padding)',
17
18
  }
18
19
 
19
20
  const extend = {