@volverjs/ui-vue 0.0.6-beta.6 → 0.0.6-beta.7

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 (65) hide show
  1. package/auto-imports.d.ts +9 -0
  2. package/dist/components/VvButton/VvButton.es.js +25 -19
  3. package/dist/components/VvButton/VvButton.umd.js +1 -1
  4. package/dist/components/VvCheckbox/VvCheckbox.es.js +151 -98
  5. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  6. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +36 -0
  7. package/dist/components/VvCheckbox/index.d.ts +5 -0
  8. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +187 -101
  9. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  10. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +36 -0
  11. package/dist/components/VvCheckboxGroup/index.d.ts +5 -0
  12. package/dist/components/VvCombobox/VvCombobox.es.js +236 -140
  13. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  14. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +25 -1
  15. package/dist/components/VvDialog/VvDialog.es.js +25 -19
  16. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  17. package/dist/components/VvDropdown/VvDropdown.es.js +19 -4
  18. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  19. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +5 -1
  20. package/dist/components/VvIcon/VvIcon.es.js +25 -19
  21. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  22. package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -2
  23. package/dist/components/VvIcon/index.d.ts +2 -2
  24. package/dist/components/VvInputText/VvInputText.es.js +160 -136
  25. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  26. package/dist/components/VvInputText/VvInputText.vue.d.ts +24 -0
  27. package/dist/components/VvRadio/VvRadio.es.js +151 -98
  28. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  29. package/dist/components/VvRadio/VvRadio.vue.d.ts +36 -0
  30. package/dist/components/VvRadio/index.d.ts +5 -0
  31. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +187 -101
  32. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  33. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +36 -0
  34. package/dist/components/VvRadioGroup/index.d.ts +5 -0
  35. package/dist/components/VvSelect/VvSelect.es.js +163 -137
  36. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  37. package/dist/components/VvSelect/VvSelect.vue.d.ts +24 -0
  38. package/dist/components/VvTextarea/VvTextarea.es.js +160 -136
  39. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  40. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +24 -0
  41. package/dist/components/common/HintSlot.d.ts +38 -12
  42. package/dist/components/index.es.js +466 -168
  43. package/dist/components/index.umd.js +1 -1
  44. package/dist/composables/useOptions.d.ts +2 -2
  45. package/dist/icons.es.js +3 -3
  46. package/dist/icons.umd.js +1 -1
  47. package/dist/props/index.d.ts +22 -0
  48. package/package.json +29 -29
  49. package/src/assets/icons/detailed.json +1 -1
  50. package/src/assets/icons/normal.json +1 -1
  51. package/src/assets/icons/simple.json +1 -1
  52. package/src/components/VvCheckbox/VvCheckbox.vue +23 -2
  53. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +15 -2
  54. package/src/components/VvCombobox/VvCombobox.vue +40 -16
  55. package/src/components/VvDropdown/VvDropdown.vue +20 -2
  56. package/src/components/VvIcon/VvIcon.vue +37 -34
  57. package/src/components/VvIcon/index.ts +2 -2
  58. package/src/components/VvInputText/VvInputText.vue +26 -9
  59. package/src/components/VvRadio/VvRadio.vue +23 -2
  60. package/src/components/VvRadioGroup/VvRadioGroup.vue +15 -2
  61. package/src/components/VvSelect/VvSelect.vue +26 -9
  62. package/src/components/VvTextarea/VvTextarea.vue +26 -9
  63. package/src/components/common/HintSlot.ts +129 -170
  64. package/src/composables/useOptions.ts +9 -7
  65. package/src/props/index.ts +2 -0
@@ -1,7 +1,7 @@
1
- import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, h, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, isRef, Fragment, renderList, vModelSelect, createVNode } from "vue";
1
+ import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, h, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, isRef, Fragment, renderList, vModelSelect, createVNode, createSlots, withCtx } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
- import { toReactive, useFocus, useElementVisibility } from "@vueuse/core";
4
3
  import { nanoid } from "nanoid";
4
+ import { useFocus, useElementVisibility } from "@vueuse/core";
5
5
  const VvIconProps = {
6
6
  /**
7
7
  * Color
@@ -167,6 +167,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
167
167
  props: VvIconProps,
168
168
  setup(__props) {
169
169
  const props = __props;
170
+ const hasRotate = computed(() => {
171
+ if (typeof props.rotate === "string") {
172
+ return parseFloat(props.rotate);
173
+ }
174
+ return props.rotate;
175
+ });
170
176
  const show = ref(true);
171
177
  const volver = useVolver();
172
178
  const { modifiers } = toRefs(props);
@@ -175,25 +181,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
175
181
  return props.provider || (volver == null ? void 0 : volver.iconsProvider);
176
182
  });
177
183
  const icon = computed(() => {
178
- const _name = props.name ?? "";
179
- const iconName = `@${provider.value}:${props.prefix}:${props.name}`;
180
- if (iconExists(_name)) {
181
- return _name;
182
- } else if (iconExists(iconName)) {
184
+ const name = props.name ?? "";
185
+ const iconName = `@${provider.value}:${props.prefix}:${name}`;
186
+ if (iconExists(iconName)) {
183
187
  return iconName;
184
- } else {
185
- return (volver == null ? void 0 : volver.iconsCollections.find(
186
- (iconsCollection) => {
187
- const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
188
- if (iconExists(icon2)) {
189
- return icon2;
190
- }
191
- }
192
- )) || _name;
193
188
  }
189
+ const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
190
+ (iconsCollection2) => {
191
+ const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
192
+ return iconExists(icon2);
193
+ }
194
+ );
195
+ if (iconsCollection) {
196
+ return `@${provider.value}:${iconsCollection.prefix}:${name}`;
197
+ }
198
+ return name;
194
199
  });
195
200
  function getSvgContent(svg) {
196
- let dom = null;
201
+ let dom;
197
202
  if (typeof window === "undefined") {
198
203
  const { JSDOM } = require("jsdom");
199
204
  dom = new JSDOM().window;
@@ -224,12 +229,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
224
229
  show.value = true;
225
230
  }
226
231
  }).catch((e) => {
227
- throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
232
+ throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
228
233
  });
229
- } else if (props.svg) {
230
- addIconFromSvg(props.svg);
231
234
  }
232
235
  }
236
+ if (props.svg) {
237
+ addIconFromSvg(props.svg);
238
+ }
233
239
  return (_ctx, _cache) => {
234
240
  return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
235
241
  key: 0,
@@ -241,7 +247,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
241
247
  horizontalFlip: _ctx.horizontalFlip,
242
248
  verticalFlip: _ctx.verticalFlip,
243
249
  flip: _ctx.flip,
244
- rotate: _ctx.rotate,
250
+ rotate: unref(hasRotate),
245
251
  color: _ctx.color,
246
252
  onLoad: _ctx.onLoad,
247
253
  icon: unref(icon)
@@ -249,136 +255,120 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
249
255
  };
250
256
  }
251
257
  });
252
- function resolveFieldData(data, field) {
253
- if (data && Object.keys(data).length && field) {
254
- if (field.indexOf(".") === -1) {
255
- return data[field];
256
- } else {
257
- const fields = field.split(".");
258
- let value = data;
259
- for (let i = 0, len = fields.length; i < len; ++i) {
260
- if (data == null) {
261
- return null;
262
- }
263
- value = value[fields[i]];
264
- }
265
- return value;
266
- }
267
- } else {
268
- return null;
269
- }
270
- }
271
258
  function isEmpty(value) {
272
259
  return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
273
260
  }
274
261
  function isString(value) {
275
262
  return typeof value === "string" || value instanceof String;
276
263
  }
277
- function joinLines(errors) {
278
- if (Array.isArray(errors)) {
279
- return errors.filter((e) => isString(e)).join(" ");
264
+ function joinLines(items) {
265
+ if (Array.isArray(items)) {
266
+ return items.filter((item) => isString(item)).join(" ");
280
267
  }
281
- return errors;
268
+ return items;
282
269
  }
283
- function HintSlotFactory(parentProps, parentSlots) {
284
- const {
285
- invalid: invalidSlot,
286
- valid: validSlot,
287
- hint: hintSlot,
288
- loading: loadingSlot
289
- } = parentSlots;
290
- const {
291
- hintLabel,
292
- modelValue,
293
- valid,
294
- validLabel,
295
- invalid,
296
- invalidLabel,
297
- ...otherProps
298
- } = toRefs(parentProps);
299
- const loading = resolveFieldData(otherProps, "loading");
300
- const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
301
- const hasInvalid = computed(() => {
302
- if (!invalid.value) {
303
- return false;
304
- }
305
- if (invalid.value && invalidSlot) {
306
- return true;
307
- }
308
- if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
309
- return true;
310
- }
311
- if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
312
- return true;
313
- }
314
- return false;
315
- });
316
- const hasHint = computed(
317
- () => !!(hintLabel && hintLabel.value || hintSlot)
270
+ function HintSlotFactory(props, slots) {
271
+ const invalidLabel = computed(() => joinLines(props.invalidLabel));
272
+ const validLabel = computed(() => joinLines(props.validLabel));
273
+ const loadingLabel = computed(() => props.loadingLabel);
274
+ const hintLabel = computed(() => props.hintLabel);
275
+ const hasLoadingLabelOrSlot = computed(
276
+ () => Boolean(props.loading && (slots.loading || loadingLabel.value))
277
+ );
278
+ const hasInvalidLabelOrSlot = computed(
279
+ () => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
318
280
  );
319
- const hasValid = computed(
320
- () => !!(validLabel && validLabel.value || validSlot)
281
+ const hasValidLabelOrSlot = computed(
282
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
321
283
  );
322
- const hasLoading = computed(
323
- () => !!((loading == null ? void 0 : loading.value) && loadingSlot || (loading == null ? void 0 : loading.value) && (loadingLabel == null ? void 0 : loadingLabel.value))
284
+ const hasHintLabelOrSlot = computed(
285
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
324
286
  );
325
287
  const isVisible = computed(
326
- () => hasHint.value || hasValid.value || hasInvalid.value || hasLoading.value
288
+ () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
327
289
  );
328
- return {
329
- hasInvalid,
330
- hasHint,
331
- hasValid,
332
- hasLoading,
333
- HintSlot: {
334
- name: "HintSlot",
335
- props: {
336
- params: {
337
- type: Object,
338
- default: () => ({})
290
+ const hintSlotScope = computed(() => ({
291
+ modelValue: props.modelValue,
292
+ valid: props.valid,
293
+ invalid: props.invalid,
294
+ loading: props.loading
295
+ }));
296
+ const HintSlot = defineComponent({
297
+ name: "HintSlot",
298
+ props: {
299
+ tag: {
300
+ type: String,
301
+ default: "small"
302
+ }
303
+ },
304
+ setup() {
305
+ return {
306
+ isVisible,
307
+ invalidLabel,
308
+ validLabel,
309
+ loadingLabel,
310
+ hintLabel,
311
+ hasInvalidLabelOrSlot,
312
+ hasValidLabelOrSlot,
313
+ hasLoadingLabelOrSlot,
314
+ hasHintLabelOrSlot
315
+ };
316
+ },
317
+ render() {
318
+ var _a, _b, _c, _d, _e, _f, _g, _h;
319
+ if (this.isVisible) {
320
+ let role;
321
+ if (this.hasInvalidLabelOrSlot) {
322
+ role = "alert";
339
323
  }
340
- },
341
- setup(props) {
342
- const hintContent = computed(() => {
343
- const slotProps = toReactive({
344
- hintLabel,
345
- modelValue,
346
- valid,
347
- validLabel,
348
- invalid,
349
- invalidLabel,
350
- loading,
351
- loadingLabel,
352
- ...props.params
353
- });
354
- if (invalid == null ? void 0 : invalid.value) {
355
- return (invalidSlot == null ? void 0 : invalidSlot(slotProps)) || joinLines(invalidLabel == null ? void 0 : invalidLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
356
- }
357
- if (valid == null ? void 0 : valid.value)
358
- return (validSlot == null ? void 0 : validSlot(slotProps)) || joinLines(validLabel == null ? void 0 : validLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
359
- if (loading == null ? void 0 : loading.value)
360
- return (loadingSlot == null ? void 0 : loadingSlot(slotProps)) || joinLines(loadingLabel == null ? void 0 : loadingLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
361
- return (hintSlot == null ? void 0 : hintSlot(slotProps)) || joinLines(hintLabel == null ? void 0 : hintLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
362
- });
363
- return {
364
- isVisible,
365
- hasInvalid,
366
- hasValid,
367
- hintContent
368
- };
369
- },
370
- render() {
371
- if (this.isVisible) {
324
+ if (this.hasValidLabelOrSlot) {
325
+ role = "status";
326
+ }
327
+ if (this.hasLoadingLabelOrSlot) {
328
+ return h(
329
+ this.tag,
330
+ {
331
+ role
332
+ },
333
+ ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
334
+ );
335
+ }
336
+ if (this.hasInvalidLabelOrSlot) {
337
+ return h(
338
+ this.tag,
339
+ {
340
+ role
341
+ },
342
+ ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
343
+ );
344
+ }
345
+ if (this.hasValidLabelOrSlot) {
372
346
  return h(
373
- "small",
347
+ this.tag,
374
348
  {
375
- role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
349
+ role
376
350
  },
377
- this.hintContent
351
+ ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
378
352
  );
379
353
  }
354
+ return h(
355
+ this.tag,
356
+ {
357
+ role
358
+ },
359
+ ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
360
+ );
380
361
  }
362
+ return null;
381
363
  }
364
+ });
365
+ return {
366
+ hasInvalidLabelOrSlot,
367
+ hasHintLabelOrSlot,
368
+ hasValidLabelOrSlot,
369
+ hasLoadingLabelOrSlot,
370
+ hintSlotScope,
371
+ HintSlot
382
372
  };
383
373
  }
384
374
  const LinkProps = {
@@ -775,7 +765,9 @@ function useOptions(props) {
775
765
  const getOptionLabel = (option) => {
776
766
  if (typeof option !== "object" && option !== null)
777
767
  return option;
778
- return typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value];
768
+ return String(
769
+ typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value]
770
+ );
779
771
  };
780
772
  const getOptionValue = (option) => {
781
773
  if (typeof option !== "object" && option !== null)
@@ -827,7 +819,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
827
819
  const props = __props;
828
820
  const slots = useSlots();
829
821
  const select = ref();
830
- const { HintSlot, hasHint, hasInvalid } = HintSlotFactory(props, slots);
822
+ const {
823
+ HintSlot,
824
+ hasHintLabelOrSlot,
825
+ hasInvalidLabelOrSlot,
826
+ hintSlotScope
827
+ } = HintSlotFactory(props, slots);
831
828
  const {
832
829
  id,
833
830
  modifiers,
@@ -842,7 +839,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
842
839
  multiple
843
840
  } = toRefs(props);
844
841
  const hasId = useUniqueId(id);
845
- const hasDescribedBy = computed(() => `${hasId.value}-hint`);
842
+ const hasHintId = computed(() => `${hasId.value}-hint`);
846
843
  const { focused } = useComponentFocus(select, emit);
847
844
  const isVisible = useElementVisibility(select);
848
845
  watch(isVisible, (newValue) => {
@@ -895,8 +892,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
895
892
  autocomplete: props.autocomplete,
896
893
  multiple: props.multiple,
897
894
  "aria-invalid": isInvalid.value,
898
- "aria-describedby": !hasInvalid.value && hasHint.value ? hasDescribedBy.value : void 0,
899
- "aria-errormessage": hasInvalid.value ? hasDescribedBy.value : void 0
895
+ "aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
896
+ "aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
900
897
  };
901
898
  });
902
899
  const slotProps = computed(() => ({
@@ -989,9 +986,38 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
989
986
  ])) : createCommentVNode("", true)
990
987
  ]),
991
988
  createVNode(unref(HintSlot), {
992
- id: unref(hasDescribedBy),
989
+ id: unref(hasHintId),
993
990
  class: "vv-select__hint"
994
- }, null, 8, ["id"])
991
+ }, createSlots({ _: 2 }, [
992
+ _ctx.$slots.hint ? {
993
+ name: "hint",
994
+ fn: withCtx(() => [
995
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
996
+ ]),
997
+ key: "0"
998
+ } : void 0,
999
+ _ctx.$slots.loading ? {
1000
+ name: "loading",
1001
+ fn: withCtx(() => [
1002
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1003
+ ]),
1004
+ key: "1"
1005
+ } : void 0,
1006
+ _ctx.$slots.valid ? {
1007
+ name: "valid",
1008
+ fn: withCtx(() => [
1009
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1010
+ ]),
1011
+ key: "2"
1012
+ } : void 0,
1013
+ _ctx.$slots.invalid ? {
1014
+ name: "invalid",
1015
+ fn: withCtx(() => [
1016
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1017
+ ]),
1018
+ key: "3"
1019
+ } : void 0
1020
+ ]), 1032, ["id"])
995
1021
  ], 2);
996
1022
  };
997
1023
  }
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.core,e.nanoid)}(this,(function(e,l,o,n){"use strict";const t={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{});const u=Symbol.for("volver");function d(l,o,n){return e.computed((()=>{const t={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(t[`${l}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{t[`${l}--${o}`]=e.unref(n.value[o])})),t}))}const c=e.defineComponent({name:"VvIcon",props:t,setup(o){const n=o,t=e.ref(!0),a=e.inject(u),{modifiers:i}=e.toRefs(n),r=d("vv-icon",i),c=e.computed((()=>n.provider||(null==a?void 0:a.iconsProvider))),s=e.computed((()=>{const e=n.name??"",o=`@${c.value}:${n.prefix}:${n.name}`;return l.iconExists(e)?e:l.iconExists(o)?o:(null==a?void 0:a.iconsCollections.find((o=>{const n=`@${c.value}:${o.prefix}:${e}`;if(l.iconExists(n))return n})))||e}));function v(e){const o=function(e){let l=null;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),t=(null==o?void 0:o.innerHTML.trim())||"";o&&t&&l.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:t,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return a&&(n.src&&!l.iconExists(`@${c.value}:${n.prefix}:${n.name}`)?(t.value=!1,a.fetchIcon(n.src).then((e=>{e&&(v(e),t.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):n.svg&&v(n.svg)),(o,n)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(r)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}});function s(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const o=l.split(".");let n=e;for(let l=0,t=o.length;l<t;++l){if(null==e)return null;n=n[o[l]]}return n}}return null}function v(l){return null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const f={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},y=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},B={modifiers:[String,Array]},S={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},V={icon:{type:[String,Object]},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},$={tabindex:{type:[String,Number],default:0}},L={floating:Boolean},w={unselectable:{type:Boolean,default:!0}},E={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...E,name:{type:String,required:!0}},O={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};r.button;const A={...N,...O,...x,...$,...f,...m,...S,...g,...b,...h,...B,...k,...V,...L,...w,...y,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],_={class:"vv-select__wrapper"},j={key:0,class:"vv-select__input-before"},F={class:"vv-select__inner"},C=["id"],P=["disabled","hidden"],D=["disabled","value"],q=["disabled","label"],z=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:A,emits:["update:modelValue","focus","blur"],setup(l,{emit:t}){const r=l,u=e.useSlots(),f=e.ref(),{HintSlot:m,hasHint:g,hasInvalid:b}=function(l,n){const{invalid:t,valid:a,hint:i,loading:r}=n,{hintLabel:u,modelValue:d,valid:c,validLabel:f,invalid:m,invalidLabel:g,...b}=e.toRefs(l),y=s(b,"loading"),h=s(b,"loadingLabel"),B=e.computed((()=>!(!m.value||(!m.value||!t)&&!((null==g?void 0:g.value)&&Array.isArray(g.value)&&g.value.length>0)&&(!(null==g?void 0:g.value)||v(g))))),S=e.computed((()=>!!(u&&u.value||i))),k=e.computed((()=>!!(f&&f.value||a))),V=e.computed((()=>!!((null==y?void 0:y.value)&&r||(null==y?void 0:y.value)&&(null==h?void 0:h.value)))),$=e.computed((()=>S.value||k.value||B.value||V.value));return{hasInvalid:B,hasHint:S,hasValid:k,hasLoading:V,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(l){const n=e.computed((()=>{const e=o.toReactive({hintLabel:u,modelValue:d,valid:c,validLabel:f,invalid:m,invalidLabel:g,loading:y,loadingLabel:h,...l.params});return(null==m?void 0:m.value)?(null==t?void 0:t(e))||p(null==g?void 0:g.value)||(null==u?void 0:u.value):(null==c?void 0:c.value)?(null==a?void 0:a(e))||p(null==f?void 0:f.value)||(null==u?void 0:u.value):(null==y?void 0:y.value)?(null==r?void 0:r(e))||p(null==h?void 0:h.value)||(null==u?void 0:u.value):(null==i?void 0:i(e))||p(null==u?void 0:u.value)||(null==u?void 0:u.value)}));return{isVisible:$,hasInvalid:B,hasValid:k,hintContent:n}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}(r,u),{id:y,modifiers:h,disabled:B,readonly:S,loading:k,icon:V,iconPosition:$,invalid:L,valid:w,floating:E,multiple:N}=e.toRefs(r),O=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(y),x=e.computed((()=>`${O.value}-hint`)),{focused:A}=function(l,n){const{focused:t}=o.useFocus(l);return e.watch(t,(o=>{n(o?"focus":"blur",e.unref(l))})),{focused:t}}(f,t),H=o.useElementVisibility(f);e.watch(H,(e=>{e&&r.autofocus&&(A.value=!0)}));const{hasIcon:K,hasIconBefore:M,hasIconAfter:T}=function(l,o){const n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.before))),t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.after))),r=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.top))),c=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:r,hasIconRight:u,hasIconTop:d,hasIconBottom:c,hasIconBefore:n,hasIconAfter:t}}(V,$),G=e.computed((()=>!v(r.modelValue))),J=e.computed((()=>r.disabled||r.readonly)),U=e.computed((()=>J.value?-1:r.tabindex)),Q=e.computed((()=>!0===r.invalid||!0!==r.valid&&void 0)),W=d("vv-select",h,e.computed((()=>({valid:w.value,invalid:L.value,loading:k.value,disabled:B.value,readonly:S.value,"icon-before":M.value,"icon-after":T.value,dirty:G.value,focus:A.value,floating:E.value,multiple:N.value})))),X=e.computed((()=>({name:r.name,tabindex:U.value,disabled:J.value,required:r.required,size:r.size,autocomplete:r.autocomplete,multiple:r.multiple,"aria-invalid":Q.value,"aria-describedby":!b.value&&g.value?x.value:void 0,"aria-errormessage":b.value?x.value:void 0}))),Y=e.computed((()=>({valid:r.valid,invalid:r.invalid,modelValue:r.modelValue}))),{getOptionLabel:Z,getOptionValue:ee,getOptionDisabled:le,getOptionGrouped:oe}=function(l){const{options:o,labelKey:n,valueKey:t,disabledKey:a}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):e[n.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof a.value?a.value(e):e[a.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(r),ne=e.computed({get:()=>r.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),t("update:modelValue",e)}}),te=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(W))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(O)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0),e.createElementVNode("div",F,[e.unref(M)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(K)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(O),ref_key:"select",ref:f,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ne)?ne.value=l:null)},e.unref(X)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,P)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[te(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(le)(l),label:e.unref(Z)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(oe)(l),((l,n)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${n}`,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,z)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,D))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ne)]]),e.unref(T)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(K)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(m),{id:e.unref(x),class:"vv-select__hint"},null,8,["id"])],2))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.nanoid,e.core)}(this,(function(e,l,o,t){"use strict";const n={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{});const u=Symbol.for("volver");function d(l,o,t){return e.computed((()=>{const n={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((o=>{n[`${l}--${o}`]=e.unref(t.value[o])})),n}))}const s=e.defineComponent({name:"VvIcon",props:n,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=e.inject(u),{modifiers:r}=e.toRefs(t),s=d("vv-icon",r),c=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${c.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${c.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${c.value}:${n.prefix}:${e}`:e}));function p(e){const o=function(e){let l;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==o?void 0:o.innerHTML.trim())||"";o&&n&&l.addIcon(`@${c.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${c.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(o,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(s)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(n),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}});function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const v={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},f={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},m={disabled:Boolean},g=(Boolean,Boolean,{label:[String,Number]}),b={readonly:Boolean},h={modifiers:[String,Array]},y={hintLabel:{type:String,default:""}},S={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},B={icon:{type:[String,Object]},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},k={tabindex:{type:[String,Number],default:0}},L={floating:Boolean},$={unselectable:{type:Boolean,default:!0}},V={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const O={...V,name:{type:String,required:!0}},w={autofocus:Boolean},E={autocomplete:{type:String,default:"off"}};r.button;const x={...O,...w,...E,...k,...v,...p,...y,...f,...m,...b,...h,...S,...B,...L,...$,...g,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const P=["for"],I={class:"vv-select__wrapper"},N={key:0,class:"vv-select__input-before"},_={class:"vv-select__inner"},A=["id"],C=["disabled","hidden"],F=["disabled","value"],j=["disabled","label"],z=["disabled","value"],q={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:x,emits:["update:modelValue","focus","blur"],setup(l,{emit:n}){const r=l,u=e.useSlots(),v=e.ref(),{HintSlot:p,hasHintLabelOrSlot:f,hasInvalidLabelOrSlot:m,hintSlotScope:g}=function(l,o){const t=e.computed((()=>c(l.invalidLabel))),n=e.computed((()=>c(l.validLabel))),a=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(o.loading||a.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(o.invalid||t.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(o.valid||n.value)))),s=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(o.hint||i.value))),v=e.computed((()=>u.value||d.value||r.value||s.value)),p=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:t,validLabel:n,loadingLabel:a,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:s}),render(){var l,o,t,n,a,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(l=this.$slots).loading)?void 0:o.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:u,hasHintLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:p,HintSlot:f}}(r,u),{id:b,modifiers:h,disabled:y,readonly:S,loading:B,icon:k,iconPosition:L,invalid:$,valid:V,floating:O,multiple:w}=e.toRefs(r),E=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.nanoid()))))(b),x=e.computed((()=>`${E.value}-hint`)),{focused:D}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(v,n),R=t.useElementVisibility(v);e.watch(R,(e=>{e&&r.autofocus&&(D.value=!0)}));const{hasIcon:H,hasIconBefore:K,hasIconAfter:M}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.after))),r=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:r,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(k,L),T=e.computed((()=>{return l=r.modelValue,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o})),G=e.computed((()=>r.disabled||r.readonly)),J=e.computed((()=>G.value?-1:r.tabindex)),U=e.computed((()=>!0===r.invalid||!0!==r.valid&&void 0)),Q=d("vv-select",h,e.computed((()=>({valid:V.value,invalid:$.value,loading:B.value,disabled:y.value,readonly:S.value,"icon-before":K.value,"icon-after":M.value,dirty:T.value,focus:D.value,floating:O.value,multiple:w.value})))),W=e.computed((()=>({name:r.name,tabindex:J.value,disabled:G.value,required:r.required,size:r.size,autocomplete:r.autocomplete,multiple:r.multiple,"aria-invalid":U.value,"aria-describedby":f.value?x.value:void 0,"aria-errormessage":m.value?x.value:void 0}))),X=e.computed((()=>({valid:r.valid,invalid:r.invalid,modelValue:r.modelValue}))),{getOptionLabel:Y,getOptionValue:Z,getOptionDisabled:ee,getOptionGrouped:le}=function(l){const{options:o,labelKey:t,valueKey:n,disabledKey:a}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):e[t.value]),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):e[n.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof a.value?a.value(e):e[a.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(r),oe=e.computed({get:()=>r.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),n("update:modelValue",e)}}),te=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Q))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(E)},e.toDisplayString(l.label),9,P)):e.createCommentVNode("",!0),e.createElementVNode("div",I,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",N,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])):e.createCommentVNode("",!0),e.createElementVNode("div",_,[e.unref(K)?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(H)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(E),ref_key:"select",ref:v,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(oe)?oe.value=l:null)},e.unref(W)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,C)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[te(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ee)(l),label:e.unref(Y)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(le)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(ee)(l),value:e.unref(Z)(l)},e.toDisplayString(e.unref(Y)(l)),9,z)))),128))],8,j)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ee)(l),value:e.unref(Z)(l)},e.toDisplayString(e.unref(Y)(l)),9,F))],64)))),256))],16,A),[[e.vModelSelect,e.unref(oe)]]),e.unref(M)?(e.openBlock(),e.createBlock(s,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(H)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(p),{id:e.unref(x),class:"vv-select__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(g))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(g))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(g))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(g))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -171,6 +171,30 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
171
171
  invalid: boolean;
172
172
  modelValue: string | number | boolean | unknown[] | Record<string, any> | undefined;
173
173
  }) => any;
174
+ hint: (_: {
175
+ modelValue: any;
176
+ valid: boolean;
177
+ invalid: boolean;
178
+ loading: boolean;
179
+ }) => any;
180
+ loading: (_: {
181
+ modelValue: any;
182
+ valid: boolean;
183
+ invalid: boolean;
184
+ loading: boolean;
185
+ }) => any;
186
+ valid: (_: {
187
+ modelValue: any;
188
+ valid: boolean;
189
+ invalid: boolean;
190
+ loading: boolean;
191
+ }) => any;
192
+ invalid: (_: {
193
+ modelValue: any;
194
+ valid: boolean;
195
+ invalid: boolean;
196
+ loading: boolean;
197
+ }) => any;
174
198
  }>;
175
199
  export default _default;
176
200
  type __VLS_WithTemplateSlots<T, S> = T & {