eco-vue-js 0.11.62 → 0.11.63

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.
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
22
  };
23
23
  return (_ctx, _cache) => {
24
24
  return openBlock(), createElementBlock("div", {
25
- class: "bg-default dark:bg-default-dark no-scrollbar sticky top-0 z-[2] col-span-full -mb-2 flex overflow-x-auto overscroll-x-contain border-b border-solid border-gray-50 text-xs dark:border-gray-800/50",
25
+ class: "bg-default dark:bg-default-dark no-scrollbar sticky top-0 z-[2] col-span-full flex overflow-x-auto overscroll-x-contain border-b border-solid border-gray-50 text-xs dark:border-gray-800/50",
26
26
  onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
27
27
  }, ["prevent"]))
28
28
  }, [
@@ -1,7 +1,7 @@
1
1
  import { SelectOptionComponent, SelectOptionProps, SelectProps } from './types';
2
2
  declare const _default: <Model extends number | string, Data extends DefaultData, QueryParamsOptions, OptionComponent extends SelectOptionComponent<Data>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
- readonly onSelect?: ((item: Model) => any) | undefined;
4
+ readonly onSelect?: ((item: Model, data: Data) => any) | undefined;
5
5
  readonly onBlur?: ((value: FocusEvent) => any) | undefined;
6
6
  readonly onFocus?: ((value: FocusEvent | undefined) => any) | undefined;
7
7
  readonly onUnselect?: ((item: Model) => any) | undefined;
@@ -30,7 +30,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
30
30
  content?: () => void;
31
31
  };
32
32
  emit: {
33
- (e: "select", item: Model): void;
33
+ (e: "select", item: Model, data: Data): void;
34
34
  (e: "unselect", item: Model): void;
35
35
  (e: "focus", value: FocusEvent | undefined): void;
36
36
  (e: "blur", value: FocusEvent): void;
@@ -1 +1 @@
1
- {"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AAqLA;AA2dA,OAAO,KAAK,EAAC,qBAAqB,EAA8B,iBAAiB,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA;yBAc7F,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAChJ,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAysBO,mBAAmB,CAAC;;;;;;;sSAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BA9erB,MAAM,KAAG,IAAI;MA8e8B,GAAG,IAAI;WACpE,GAAG;;gBAvbD,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;gBACrD,MAAM,IAAI;iBACT,MAAM,IAAI;kBACT,MAAM,IAAI;;gBALZ,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;gBACrD,MAAM,IAAI;iBACT,MAAM,IAAI;kBACT,MAAM,IAAI;;;YA3QhB,QAAQ,QAAQ,KAAK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AM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;gBACrD,MAAM,IAAI;iBACT,MAAM,IAAI;kBACT,MAAM,IAAI;;gBALZ,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;gBACrD,MAAM,IAAI;iBACT,MAAM,IAAI;kBACT,MAAM,IAAI;;;YA3QhB,QAAQ,QAAQ,KAAK,QAAQ,IAAI,GAAG,IAAI;YACxC,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,OAAO,SAAS,UAAU,GAAG,SAAS,GAAG,IAAI;YAC7C,MAAM,SAAS,UAAU,GAAG,IAAI;YAChC,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;EAksBrB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA1tBzE,wBA0tB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -103,6 +103,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
103
  const { isReadonly, isDisabled } = useComponentStates(props);
104
104
  const { isMobile } = useIsMobile();
105
105
  const isOpen = ref(false);
106
+ const optionRef = useTemplateRef("option");
106
107
  const inputRef = useTemplateRef("input");
107
108
  const cursor = ref(0);
108
109
  const isCursorLocked = ref(false);
@@ -140,7 +141,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
140
141
  const close = () => {
141
142
  if (props.selectOnClose && focused.value && !isModelValueSearch.value) {
142
143
  const optionExact = optionsFiltered.value.find((option) => props.valueGetter(option) === search.value);
143
- if (optionExact) select(props.valueGetter(optionExact));
144
+ if (optionExact) select(props.valueGetter(optionExact), optionExact);
144
145
  else if (search.value) create(search.value);
145
146
  else if (props.modelValue.length) unselect(props.modelValue[props.modelValue.length - 1]);
146
147
  }
@@ -183,8 +184,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
183
184
  const value = option ? props.valueGetter(option) : void 0;
184
185
  if (!value) return;
185
186
  setLoadingOptionIndex(cursor.value);
186
- if (props.modelValue.includes(value)) unselect(value);
187
- else select(value);
187
+ optionRef.value?.forEach((item) => item?.toggleCursor());
188
188
  };
189
189
  let deletePressTimeout = null;
190
190
  const captureDoubleDelete = () => {
@@ -199,9 +199,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
199
199
  }, 500);
200
200
  }
201
201
  };
202
- const select = (item) => {
202
+ const select = (item, data2) => {
203
203
  if (isDisabledComputed.value) return;
204
- emit("select", item);
204
+ emit("select", item, data2);
205
205
  search.value = "";
206
206
  };
207
207
  const unselect = (item) => {
@@ -219,7 +219,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
219
219
  if (option) {
220
220
  createdOptions.value.push(option);
221
221
  setLoadingOptionIndex(optionsFiltered.value.length);
222
- select(props.valueGetter(option));
222
+ select(props.valueGetter(option), option);
223
223
  search.value = "";
224
224
  }
225
225
  loadingCreate.value = false;
@@ -238,7 +238,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
238
238
  const { data: defaultData } = props.useQueryFnDefault({ enabled: computed(() => !props.disabled) });
239
239
  watch(defaultData, (value) => {
240
240
  if (value && props.modelValue.length === 0) {
241
- select(props.valueGetter(value));
241
+ select(props.valueGetter(value), value);
242
242
  emit("init-model");
243
243
  }
244
244
  }, { immediate: true });
@@ -246,7 +246,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
246
246
  if (props.useFirstDefault) {
247
247
  watch(data, (value) => {
248
248
  if (value && props.modelValue.length === 0 && value[0]) {
249
- select(props.valueGetter(value[0]));
249
+ select(props.valueGetter(value[0]), value[0]);
250
250
  emit("init-model");
251
251
  }
252
252
  }, { immediate: true });
@@ -377,6 +377,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
377
377
  (openBlock(true), createElementBlock(Fragment, null, renderList(optionsFiltered.value, (option, index) => {
378
378
  return openBlock(), createBlock(_sfc_main$2, {
379
379
  key: __props.valueGetter(option),
380
+ ref_for: true,
381
+ ref: "option",
380
382
  "is-selected": __props.modelValue.includes(__props.valueGetter(option)),
381
383
  "is-cursor": index === cursor.value,
382
384
  loading: loadingOptionIndex.value === index && __props.loading,
@@ -384,7 +386,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
384
386
  "hide-option-icon": __props.hideOptionIcon,
385
387
  class: "first:-pt--w-select-option-padding last:-pb--w-select-option-padding",
386
388
  onSelect: ($event) => {
387
- select(__props.valueGetter(option));
389
+ select(__props.valueGetter(option), option);
388
390
  setLoadingOptionIndex(index);
389
391
  },
390
392
  onUnselect: ($event) => {
@@ -1,7 +1,7 @@
1
1
  import { SelectAsyncProps, SelectOptionComponent, SelectOptionProps } from './types';
2
2
  declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams, OptionComponent extends SelectOptionComponent<Data>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
- readonly onSelect?: ((item: Model) => any) | undefined;
4
+ readonly onSelect?: ((item: Model, data: Data) => any) | undefined;
5
5
  readonly onBlur?: ((value: FocusEvent) => any) | undefined;
6
6
  readonly onFocus?: ((value: FocusEvent | undefined) => any) | undefined;
7
7
  readonly "onUpdate:model-value"?: ((value: Model[]) => any) | undefined;
@@ -28,7 +28,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
28
28
  content?: () => void;
29
29
  };
30
30
  emit: {
31
- (e: "select", item: Model): void;
31
+ (e: "select", item: Model, data: Data): void;
32
32
  (e: "unselect", item: Model): void;
33
33
  (e: "update:model-value", value: Model[]): void;
34
34
  (e: "init-model"): void;
@@ -1 +1 @@
1
- {"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AAiIA;AA6TA,OAAO,KAAK,EAAC,gBAAgB,EAAE,qBAAqB,EAA8B,iBAAiB,EAAC,MAAM,SAAS,CAAA;yBAYlG,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EACzI,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAyhBO,mBAAmB,CAAC;;;;;;;4RAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BAhZrB,MAAM,KAAG,IAAI;MAgZ8B,GAAG,IAAI;WACpE,GAAG;;gBA9WD,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;kBACnD,MAAM,IAAI;;gBAJZ,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,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C,EACjE;WAyhBO,mBAAmB,CAAC;;;;;;;4RAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BAhZrB,MAAM,KAAG,IAAI;MAgZ8B,GAAG,IAAI;WACpE,GAAG;;gBA9WD,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;kBACnD,MAAM,IAAI;;gBAJZ,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;kBACnD,MAAM,IAAI;;;YAhKhB,QAAQ,QAAQ,KAAK,QAAQ,IAAI,GAAG,IAAI;YACxC,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,oBAAoB,SAAS,KAAK,EAAE,GAAG,IAAI;YAC3C,YAAY,GAAG,IAAI;YACnB,OAAO,SAAS,UAAU,GAAG,SAAS,GAAG,IAAI;YAC7C,MAAM,SAAS,UAAU,GAAG,IAAI;;EAygBlC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AApiBzE,wBAoiB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -112,7 +112,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
112
112
  focused.value = false;
113
113
  if (props.selectOnClose && search.value && !isModelValueSearch.value) {
114
114
  const optionExact = firstPageData.value?.results.find((option) => props.valueGetter(option) === search.value);
115
- if (optionExact) select(props.valueGetter(optionExact));
115
+ if (optionExact) select(props.valueGetter(optionExact), optionExact);
116
116
  else if (search.value) create(search.value);
117
117
  else if (props.modelValue.length) unselect(props.modelValue[props.modelValue.length - 1]);
118
118
  }
@@ -131,9 +131,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
131
131
  }, 500);
132
132
  }
133
133
  };
134
- const select = (item) => {
134
+ const select = (item, data) => {
135
135
  if (isDisabledComputed.value) return;
136
- emit("select", item);
136
+ emit("select", item, data);
137
137
  search.value = "";
138
138
  };
139
139
  const unselect = (item) => {
@@ -147,7 +147,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
147
147
  loadingCreate.value = true;
148
148
  const option = await props.createOption(value);
149
149
  if (option) {
150
- select(props.valueGetter(option));
150
+ select(props.valueGetter(option), option);
151
151
  search.value = "";
152
152
  }
153
153
  loadingCreate.value = false;
@@ -174,7 +174,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
174
174
  const { data: defaultData } = props.useQueryFnDefault({ enabled: computed(() => !props.disabled) });
175
175
  watch(defaultData, (value) => {
176
176
  if (value && props.modelValue.length === 0) {
177
- select(props.valueGetter(value));
177
+ select(props.valueGetter(value), value);
178
178
  emit("init-model");
179
179
  }
180
180
  }, { immediate: true });
@@ -1,7 +1,7 @@
1
1
  import { SelectOptionProps } from '../types';
2
2
  declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
- readonly onSelect?: ((value: Model) => any) | undefined;
4
+ readonly onSelect?: ((value: Model, data: Data) => any) | undefined;
5
5
  readonly "onUpdate:model-value"?: ((value: Model[]) => any) | undefined;
6
6
  readonly onUnselect?: ((value: Model) => any) | undefined;
7
7
  readonly "onUpdate:count"?: ((value: number) => any) | undefined;
@@ -37,7 +37,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
37
37
  default?: (props: PartialNot<SelectOptionProps<Data>>) => void;
38
38
  };
39
39
  emit: {
40
- (e: "select", value: Model): void;
40
+ (e: "select", value: Model, data: Data): void;
41
41
  (e: "unselect", value: Model): void;
42
42
  (e: "update:count", value: number): void;
43
43
  (e: "update:model-value", value: Model[]): void;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAsyncList.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectAsyncList.vue"],"names":[],"mappings":"AAsHA;AAgQA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;yBAU9B,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EACpF,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAsdO,mBAAmB,CAAC;;;;;;;oBApdd,KAAK,EAAE;oBACP,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;kBACd,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,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,4 +1,4 @@
1
- import { defineComponent, ref, computed, createElementBlock, openBlock, createBlock, createCommentVNode, createVNode, withCtx, renderSlot, createElementVNode, normalizeClass, toDisplayString } from 'vue';
1
+ import { defineComponent, useTemplateRef, ref, computed, createElementBlock, openBlock, createBlock, createCommentVNode, createVNode, withCtx, renderSlot, createElementVNode, normalizeClass, toDisplayString } from 'vue';
2
2
  import _sfc_main$2 from '../../InfiniteList/WInfiniteList.vue.js';
3
3
  import { debounce } from '../../../utils/utils.js';
4
4
  import _sfc_main$1 from './SelectOption.vue.js';
@@ -33,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
33
33
  setup(__props, { expose: __expose, emit: __emit }) {
34
34
  const props = __props;
35
35
  const emit = __emit;
36
+ const optionRef = useTemplateRef("option");
36
37
  const cursor = ref(void 0);
37
38
  const cursorPrevious = ref(void 0);
38
39
  const cursorNext = ref(void 0);
@@ -79,16 +80,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
79
80
  if (props.allowCreate) emit("create:option");
80
81
  return;
81
82
  }
82
- if (cursor.value) {
83
- setLoadingOption(cursor.value);
84
- if (props.modelValue.includes(cursor.value)) emit("unselect", cursor.value);
85
- else emit("select", cursor.value);
86
- }
83
+ if (cursor.value) optionRef.value?.forEach((item) => item.toggleCursor());
87
84
  };
88
- const emitSelect = (value) => {
85
+ const emitSelect = (value, data) => {
89
86
  if (props.disabled || props.loading) return;
90
87
  if (props.unselectOnly) return;
91
- emit("select", value);
88
+ emit("select", value, data);
92
89
  setLoadingOption(value);
93
90
  };
94
91
  const emitUnselect = (value) => {
@@ -165,6 +162,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
165
162
  }, {
166
163
  default: withCtx(({ item, skeleton, previous, next, first, last, index }) => [
167
164
  createVNode(_sfc_main$1, {
165
+ ref: "option",
168
166
  "is-selected": !skeleton && __props.modelValue.includes(__props.valueGetter(item)),
169
167
  "is-cursor": !skeleton && __props.valueGetter(item) === cursor.value,
170
168
  loading: __props.loading && loadingOption.value === __props.valueGetter(item),
@@ -180,7 +178,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
180
178
  "-pt--w-select-option-padding": !__props.noPadding && first && !__props.allowCreate,
181
179
  "-pb--w-select-option-padding": !__props.noPadding && last
182
180
  }),
183
- onSelect: ($event) => emitSelect(__props.valueGetter(item)),
181
+ onSelect: ($event) => emitSelect(__props.valueGetter(item), item),
184
182
  onUnselect: ($event) => emitUnselect(__props.valueGetter(item)),
185
183
  onMouseenter: ($event) => !skeleton && setCursor(__props.valueGetter(item)),
186
184
  "onUpdate:cursor": ($event) => setCursor(__props.valueGetter(item)),
@@ -29,6 +29,7 @@ declare const _default: <Model extends number | string>(__VLS_props: NonNullable
29
29
  } & Partial<{}>> & import('vue').PublicProps;
30
30
  expose(exposed: import('vue').ShallowUnwrapRef<{
31
31
  scrollIntoView: () => void;
32
+ toggleCursor: () => void;
32
33
  }>): void;
33
34
  attrs: any;
34
35
  slots: Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"SelectOption.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectOption.vue"],"names":[],"mappings":"AA6CA;yBAqJiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAgNO,mBAAmB,CAAC;;;;;;;sBA5LgB,KAAK,GAAG,IAAI,GAAG,SAAS;kBAAQ,KAAK,GAAG,IAAI,GAAG,SAAS;;;;;;;oBAlBtF,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;mBAmM0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;iBAxHA,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;;;YAzEd,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;YACpB,YAAY,SAAS,UAAU,GAAG,IAAI;;EA2LxC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA3NzE,wBA2N4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"SelectOption.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/SelectOption.vue"],"names":[],"mappings":"AA6CA;yBA4JiB,KAAK,SAAS,MAAM,G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G,IAAI;YACrD,WAAW,GAAG,IAAI;YAClB,cAAc,GAAG,IAAI;YACrB,aAAa,GAAG,IAAI;YACpB,YAAY,SAAS,UAAU,GAAG,IAAI;;EAmMxC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAnOzE,wBAmO4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -32,6 +32,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
32
  if (props.isSelected) emit("unselect");
33
33
  else emit("select");
34
34
  };
35
+ const toggleCursor = () => {
36
+ if (props.isCursor) return;
37
+ toggle();
38
+ };
35
39
  const scrollIntoView = () => {
36
40
  elementRef.value?.scrollIntoView({ behavior: "auto", block: "center" });
37
41
  };
@@ -64,7 +68,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
68
  if (props.isCursor) emit("unmounted");
65
69
  });
66
70
  __expose({
67
- scrollIntoView
71
+ scrollIntoView,
72
+ toggleCursor
68
73
  });
69
74
  return (_ctx, _cache) => {
70
75
  return openBlock(), createElementBlock("div", {
@@ -59,10 +59,10 @@ declare type UseQueryDefault<TQueryFnData = unknown, TData = TQueryFnData, TQuer
59
59
 
60
60
  declare type QueryOptions<Data> = Partial<Parameters<typeof import('../utils/useDefaultQuery').useDefaultQuery<Data>>[0]>
61
61
 
62
- declare type UseQueryEmpty<Model> = (options?: QueryOptions<Model>) => ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model>>
62
+ declare type UseQueryEmpty<Model> = (options?: QueryOptions<Model>) => Omit<ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model>>, 'isError'> & {isError: import('vue').Ref<boolean>}
63
63
 
64
64
  declare type UseQueryWithParams<Model, QueryParams> =
65
- (queryParams: import('vue').MaybeRef<QueryParams>, options?: QueryOptions<Model>) => ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model>>
65
+ (queryParams: import('vue').MaybeRef<QueryParams>, options?: QueryOptions<Model>) => Omit<ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model>>, 'isError'> & {isError: import('vue').Ref<boolean>}
66
66
 
67
67
  declare type UseQueryPaginated<Model, QueryParams> = UseQueryWithParams<PaginatedResponse<Model>, QueryParams>
68
68
 
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.11.62",
7
+ "version": "0.11.63",
8
8
  "dependencies": {
9
9
  "@stylistic/eslint-plugin": "5.6.1",
10
10
  "@tanstack/eslint-plugin-query": "5.91.2",