@volverjs/ui-vue 0.0.8 → 0.0.9-beta.10

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 (136) hide show
  1. package/README.md +4 -4
  2. package/auto-imports.d.ts +2 -0
  3. package/dist/components/VvAccordion/VvAccordion.es.js +7 -0
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
  5. package/dist/components/VvAction/VvAction.es.js +9 -1
  6. package/dist/components/VvAction/VvAction.umd.js +1 -1
  7. package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
  8. package/dist/components/VvAction/index.d.ts +4 -0
  9. package/dist/components/VvAlert/VvAlert.es.js +14 -6
  10. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  11. package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
  12. package/dist/components/VvAlert/index.d.ts +3 -3
  13. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -10
  14. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  15. package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
  16. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
  17. package/dist/components/VvBadge/VvBadge.es.js +7 -0
  18. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
  19. package/dist/components/VvButton/VvButton.es.js +11 -2
  20. package/dist/components/VvButton/VvButton.umd.js +1 -1
  21. package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
  22. package/dist/components/VvButton/index.d.ts +4 -0
  23. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
  24. package/dist/components/VvCard/VvCard.es.js +7 -0
  25. package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -14
  26. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  27. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +97 -15
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
  31. package/dist/components/VvCombobox/VvCombobox.es.js +164 -94
  32. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  33. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +35 -14
  34. package/dist/components/VvCombobox/index.d.ts +24 -7
  35. package/dist/components/VvDialog/VvDialog.es.js +67 -27
  36. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  37. package/dist/components/VvDropdown/VvDropdown.es.js +58 -20
  38. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  39. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +13 -12
  40. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
  41. package/dist/components/VvDropdown/index.d.ts +1 -7
  42. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
  43. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  44. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
  45. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
  46. package/dist/components/VvInputText/VvInputText.es.js +87 -14
  47. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  48. package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
  49. package/dist/components/VvNav/VvNav.es.js +10 -2
  50. package/dist/components/VvNav/VvNav.umd.js +1 -1
  51. package/dist/components/VvNav/index.d.ts +1 -1
  52. package/dist/components/VvProgress/VvProgress.es.js +7 -0
  53. package/dist/components/VvRadio/VvRadio.es.js +91 -14
  54. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  55. package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
  56. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +97 -15
  57. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  58. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
  59. package/dist/components/VvSelect/VvSelect.es.js +87 -14
  60. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  61. package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -4
  62. package/dist/components/VvTab/VvTab.es.js +10 -2
  63. package/dist/components/VvTab/VvTab.umd.js +1 -1
  64. package/dist/components/VvTextarea/VvTextarea.es.js +87 -14
  65. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  66. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
  67. package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
  68. package/dist/components/common/HintSlot.d.ts +4 -3
  69. package/dist/components/index.d.ts +5 -0
  70. package/dist/components/index.es.js +958 -431
  71. package/dist/components/index.umd.js +1 -1
  72. package/dist/composables/alert/useAlert.d.ts +27 -0
  73. package/dist/composables/index.d.ts +1 -0
  74. package/dist/composables/index.es.js +81 -0
  75. package/dist/composables/index.umd.js +1 -0
  76. package/dist/constants.d.ts +10 -0
  77. package/dist/directives/index.es.js +7 -0
  78. package/dist/directives/v-tooltip.es.js +7 -0
  79. package/dist/icons.es.js +3 -3
  80. package/dist/icons.umd.js +1 -1
  81. package/dist/props/index.d.ts +7 -0
  82. package/dist/resolvers/unplugin.es.js +3 -0
  83. package/dist/resolvers/unplugin.umd.js +1 -1
  84. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +43 -258
  85. package/dist/stories/Alert/Alert.settings.d.ts +3 -7
  86. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
  87. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
  88. package/dist/stories/Button/Button.settings.d.ts +3 -13
  89. package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
  90. package/dist/stories/Nav/Nav.settings.d.ts +3 -21
  91. package/package.json +54 -46
  92. package/src/assets/icons/detailed.json +1 -1
  93. package/src/assets/icons/normal.json +1 -1
  94. package/src/assets/icons/simple.json +1 -1
  95. package/src/components/VvAction/VvAction.vue +2 -1
  96. package/src/components/VvAlert/VvAlert.vue +5 -1
  97. package/src/components/VvAlert/index.ts +3 -3
  98. package/src/components/VvAlertGroup/VvAlertGroup.vue +30 -0
  99. package/src/components/VvAlertGroup/index.ts +11 -1
  100. package/src/components/VvButton/VvButton.vue +1 -0
  101. package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
  102. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
  103. package/src/components/VvCombobox/VvCombobox.vue +9 -4
  104. package/src/components/VvCombobox/index.ts +24 -0
  105. package/src/components/VvDialog/VvDialog.vue +36 -17
  106. package/src/components/VvDialog/index.ts +13 -1
  107. package/src/components/VvDropdown/VvDropdown.vue +44 -15
  108. package/src/components/VvDropdown/index.ts +2 -8
  109. package/src/components/VvInputText/VvInputText.vue +8 -1
  110. package/src/components/VvNav/VvNav.vue +1 -1
  111. package/src/components/VvNav/index.ts +1 -1
  112. package/src/components/VvRadio/VvRadio.vue +8 -1
  113. package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
  114. package/src/components/VvSelect/VvSelect.vue +8 -1
  115. package/src/components/VvTextarea/VvTextarea.vue +8 -1
  116. package/src/components/common/HintSlot.ts +26 -13
  117. package/src/components/index.ts +5 -0
  118. package/src/composables/alert/useAlert.ts +103 -0
  119. package/src/composables/index.ts +1 -0
  120. package/src/constants.ts +21 -0
  121. package/src/props/index.ts +7 -0
  122. package/src/resolvers/unplugin.ts +3 -0
  123. package/src/stories/Alert/Alert.settings.ts +3 -1
  124. package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
  125. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
  126. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
  127. package/src/stories/Button/Button.settings.ts +5 -3
  128. package/src/stories/Combobox/Combobox.settings.ts +119 -2
  129. package/src/stories/Nav/Nav.settings.ts +3 -1
  130. package/src/stories/Tab/Tab.stories.ts +3 -3
  131. package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
  132. package/src/types/alert.d.ts +20 -0
  133. /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
  134. /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
  135. /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
  136. /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
@@ -1,4 +1,4 @@
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";
1
+ import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, isRef, h, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, Fragment, renderList, vModelSelect, createVNode, createSlots, withCtx } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
3
  import { nanoid } from "nanoid";
4
4
  import { useFocus, useElementVisibility } from "@vueuse/core";
@@ -268,19 +268,27 @@ function joinLines(items) {
268
268
  }
269
269
  return items;
270
270
  }
271
- function HintSlotFactory(props, slots) {
272
- const invalidLabel = computed(() => joinLines(props.invalidLabel));
273
- const validLabel = computed(() => joinLines(props.validLabel));
274
- const loadingLabel = computed(() => props.loadingLabel);
275
- const hintLabel = computed(() => props.hintLabel);
271
+ function HintSlotFactory(propsOrRef, slots) {
272
+ const props = computed(() => {
273
+ if (isRef(propsOrRef)) {
274
+ return propsOrRef.value;
275
+ }
276
+ return propsOrRef;
277
+ });
278
+ const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
279
+ const validLabel = computed(() => joinLines(props.value.validLabel));
280
+ const loadingLabel = computed(() => props.value.loadingLabel);
281
+ const hintLabel = computed(() => props.value.hintLabel);
276
282
  const hasLoadingLabelOrSlot = computed(
277
- () => Boolean(props.loading && (slots.loading || loadingLabel.value))
283
+ () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
278
284
  );
279
285
  const hasInvalidLabelOrSlot = computed(
280
- () => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
286
+ () => !hasLoadingLabelOrSlot.value && Boolean(
287
+ props.value.invalid && (slots.invalid || invalidLabel.value)
288
+ )
281
289
  );
282
290
  const hasValidLabelOrSlot = computed(
283
- () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
291
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
284
292
  );
285
293
  const hasHintLabelOrSlot = computed(
286
294
  () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
@@ -289,10 +297,10 @@ function HintSlotFactory(props, slots) {
289
297
  () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
290
298
  );
291
299
  const hintSlotScope = computed(() => ({
292
- modelValue: props.modelValue,
293
- valid: props.valid,
294
- invalid: props.invalid,
295
- loading: props.loading
300
+ modelValue: props.value.modelValue,
301
+ valid: props.value.valid,
302
+ invalid: props.value.invalid,
303
+ loading: props.value.loading
296
304
  }));
297
305
  const HintSlot = defineComponent({
298
306
  name: "HintSlot",
@@ -665,6 +673,13 @@ const AutocompleteProps = {
665
673
  type: String,
666
674
  default: ButtonType.button,
667
675
  validator: (value) => Object.values(ButtonType).includes(value)
676
+ },
677
+ /**
678
+ * Button aria-label
679
+ */
680
+ ariaLabel: {
681
+ type: String,
682
+ default: void 0
668
683
  }
669
684
  });
670
685
  const VvSelectProps = {
@@ -716,6 +731,59 @@ const VvSelectProps = {
716
731
  placeholder: String
717
732
  };
718
733
  const VvSelectEmits = ["update:modelValue", "focus", "blur"];
734
+ function useDefaults(componentName, propsDefinition, props) {
735
+ const volver = useVolver();
736
+ const volverComponentDefaults = computed(() => {
737
+ var _a;
738
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
739
+ return void 0;
740
+ }
741
+ return volver.defaults.value[componentName];
742
+ });
743
+ return computed(() => {
744
+ if (volverComponentDefaults.value === void 0) {
745
+ return props;
746
+ }
747
+ const componentDefaults = volverComponentDefaults.value;
748
+ const simplifiedPropsDefinition = propsDefinition;
749
+ const simplifiedProps = props;
750
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
751
+ const propValue = simplifiedProps[key];
752
+ acc[key] = propValue;
753
+ if (key in componentDefaults) {
754
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
755
+ const typeArray = simplifiedPropsDefinition[key];
756
+ if (typeArray.length) {
757
+ const typeFunction = typeArray[0];
758
+ if (typeFunction === propValue) {
759
+ acc[key] = componentDefaults[key];
760
+ }
761
+ }
762
+ }
763
+ if (typeof simplifiedPropsDefinition[key] === "function") {
764
+ const typeFunction = simplifiedPropsDefinition[key];
765
+ if (typeFunction() === propValue) {
766
+ acc[key] = componentDefaults[key];
767
+ }
768
+ }
769
+ if (typeof simplifiedPropsDefinition[key] === "object") {
770
+ let defaultValue = simplifiedPropsDefinition[key].default;
771
+ if (typeof defaultValue === "function") {
772
+ defaultValue = defaultValue();
773
+ }
774
+ if (typeof defaultValue === "object") {
775
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
776
+ acc[key] = componentDefaults[key];
777
+ }
778
+ } else if (defaultValue === propValue) {
779
+ acc[key] = componentDefaults[key];
780
+ }
781
+ }
782
+ }
783
+ return acc;
784
+ }, {});
785
+ });
786
+ }
719
787
  const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
720
788
  function useComponentFocus(inputTemplateRef, emit) {
721
789
  const { focused } = useFocus(inputTemplateRef);
@@ -819,13 +887,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
819
887
  setup(__props, { emit }) {
820
888
  const props = __props;
821
889
  const slots = useSlots();
890
+ const propsDefaults = useDefaults(
891
+ "VvSelect",
892
+ VvSelectProps,
893
+ props
894
+ );
822
895
  const select = ref();
823
896
  const {
824
897
  HintSlot,
825
898
  hasHintLabelOrSlot,
826
899
  hasInvalidLabelOrSlot,
827
900
  hintSlotScope
828
- } = HintSlotFactory(props, slots);
901
+ } = HintSlotFactory(propsDefaults, slots);
829
902
  const {
830
903
  id,
831
904
  modifiers,
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={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 i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const d=Symbol.for("volver");function s(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 c=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=e.inject(d),{modifiers:r}=e.toRefs(t),u=s("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(u)},{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 v(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const p={valid:Boolean,validLabel:[String,Array]},f={invalid:Boolean,invalidLabel:[String,Array]},m={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},y={modifiers:[String,Array]},S={hintLabel:{type:String,default:""}},B={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},k={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},L={tabindex:{type:[String,Number],default:0}},$={floating:Boolean},V={unselectable:{type:Boolean,default:!0}},O={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...O,name:{type:String,required:!0}},E={autofocus:Boolean},P={autocomplete:{type:String,default:"off"}};u.button;const x={...w,...E,...P,...L,...p,...f,...S,...m,...g,...h,...y,...B,...k,...$,...V,...b,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],N={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},A={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],j=["disabled","value"],z=["disabled","label"],q=["disabled","value"],D={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:x,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),p=e.ref(),{HintSlot:f,hasHintLabelOrSlot:m,hasInvalidLabelOrSlot:g,hintSlotScope:b}=function(l,o){const t=e.computed((()=>v(l.invalidLabel))),n=e.computed((()=>v(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))),c=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:c,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}}(u,d),{id:h,modifiers:y,disabled:S,readonly:B,loading:k,icon:L,iconPosition:$,invalid:V,valid:O,floating:w,multiple:E}=e.toRefs(u),P=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.nanoid()))))(h),x=e.computed((()=>`${P.value}-hint`)),{focused:R}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(p,a),H=t.useElementVisibility(p);e.watch(H,(e=>{e&&u.autofocus&&(R.value=!0)}));const{hasIcon:K,hasIconBefore:M,hasIconAfter:T}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.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:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(L,$),G=e.computed((()=>{return l=u.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})),J=e.computed((()=>u.disabled||u.readonly)),U=e.computed((()=>J.value?-1:u.tabindex)),Q=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),W=s("vv-select",y,e.computed((()=>({valid:O.value,invalid:V.value,loading:k.value,disabled:S.value,readonly:B.value,"icon-before":M.value,"icon-after":T.value,dirty:G.value,focus:R.value,floating:w.value,multiple:E.value})))),X=e.computed((()=>({name:u.name,tabindex:U.value,disabled:J.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Q.value,"aria-describedby":m.value?x.value:void 0,"aria-errormessage":g.value?x.value:void 0}))),Y=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:Z,getOptionValue:ee,getOptionDisabled:le,getOptionGrouped:oe}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),te=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),ne=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(P)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",N,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0),e.createElementVNode("div",A,[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(P),ref_key:"select",ref:p,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(te)?te.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,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[ne(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,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,q)))),128))],8,z)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,j))],64)))),256))],16,C),[[e.vModelSelect,e.unref(te)]]),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",D,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(f),{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(b))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"3"}:void 0]),1032,["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"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={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 i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const d=Symbol.for("volver");function s(){return e.inject(d)}function c(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 v=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(t),u=c("vv-icon",r),d=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${d.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${d.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${d.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(`@${d.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${d.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(u)},{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 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},h=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={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"}},L={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...w,name:{type:String,required:!0}},P={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};u.button;const N={...E,...P,...x,...$,...f,...m,...B,...g,...b,...y,...S,...k,...L,...V,...O,...h,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],A={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},j={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],q=["disabled","label"],D=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),f=function(l,o,t){const n=s(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===a.value)return t;const e=a.value,l=o,n=t;return Object.keys(l).reduce(((o,t)=>{const a=n[t];if(o[t]=a,t in e){if(Array.isArray(l[t])){const n=l[t];n.length&&n[0]===a&&(o[t]=e[t])}if("function"==typeof l[t]&&(0,l[t])()===a&&(o[t]=e[t]),"object"==typeof l[t]){let n=l[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(o[t]=e[t]):n===a&&(o[t]=e[t])}}return o}),{})}))}("VvSelect",N,u),m=e.ref(),{HintSlot:g,hasHintLabelOrSlot:b,hasInvalidLabelOrSlot:h,hintSlotScope:y}=function(l,o){const t=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>p(t.value.invalidLabel))),a=e.computed((()=>p(t.value.validLabel))),i=e.computed((()=>t.value.loadingLabel)),r=e.computed((()=>t.value.hintLabel)),u=e.computed((()=>Boolean(t.value.loading&&(o.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.value.invalid&&(o.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.value.valid&&(o.valid||a.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(o.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),f=e.computed((()=>({modelValue:t.value.modelValue,valid:t.value.valid,invalid:t.value.invalid,loading:t.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),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:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:m}}(f,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:E,floating:P,multiple:x}=e.toRefs(u),H=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.nanoid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(m,a),T=t.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIcon:J,hasIconBefore:G,hasIconAfter:U}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.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:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(V,O),Q=e.computed((()=>{return l=u.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})),W=e.computed((()=>u.disabled||u.readonly)),X=e.computed((()=>W.value?-1:u.tabindex)),Y=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Z=c("vv-select",B,e.computed((()=>({valid:E.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":G.value,"icon-after":U.value,dirty:Q.value,focus:M.value,floating:P.value,multiple:x.value})))),ee=e.computed((()=>({name:u.name,tabindex:X.value,disabled:W.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Y.value,"aria-describedby":b.value?K.value:void 0,"aria-errormessage":h.value?K.value:void 0}))),le=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:oe,getOptionValue:te,getOptionDisabled:ne,getOptionGrouped:ae}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ie=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",A,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0),e.createElementVNode("div",j,[e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(J)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(H),ref_key:"select",ref:m,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ie)?ie.value=l:null)},e.unref(ee)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ne)(l),label:e.unref(oe)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,D)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(J)),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(le))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(g),{id:e.unref(K),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(y))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -172,25 +172,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
172
172
  modelValue: string | number | boolean | unknown[] | Record<string, any> | undefined;
173
173
  }): any;
174
174
  hint?(_: {
175
- modelValue: any;
175
+ modelValue: unknown;
176
176
  valid: boolean;
177
177
  invalid: boolean;
178
178
  loading: boolean;
179
179
  }): any;
180
180
  loading?(_: {
181
- modelValue: any;
181
+ modelValue: unknown;
182
182
  valid: boolean;
183
183
  invalid: boolean;
184
184
  loading: boolean;
185
185
  }): any;
186
186
  valid?(_: {
187
- modelValue: any;
187
+ modelValue: unknown;
188
188
  valid: boolean;
189
189
  invalid: boolean;
190
190
  loading: boolean;
191
191
  }): any;
192
192
  invalid?(_: {
193
- modelValue: any;
193
+ modelValue: unknown;
194
194
  valid: boolean;
195
195
  invalid: boolean;
196
196
  loading: boolean;
@@ -230,6 +230,13 @@ const ActionProps = {
230
230
  type: String,
231
231
  default: ButtonType.button,
232
232
  validator: (value) => Object.values(ButtonType).includes(value)
233
+ },
234
+ /**
235
+ * Button aria-label
236
+ */
237
+ ariaLabel: {
238
+ type: String,
239
+ default: void 0
233
240
  }
234
241
  };
235
242
  const VvTabProps = {
@@ -306,7 +313,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
306
313
  const hasProps = computed(() => {
307
314
  const toReturn = {
308
315
  ...dropdownAria == null ? void 0 : dropdownAria.value,
309
- "aria-pressed": pressed.value ? true : void 0,
316
+ ariaPressed: pressed.value ? true : void 0,
317
+ ariaLabel: props.ariaLabel,
310
318
  role: role == null ? void 0 : role.value
311
319
  };
312
320
  switch (hasTag.value) {
@@ -443,7 +451,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
443
451
  current: unref(activeItem) == navItem.id,
444
452
  disabled: navItem.disabled
445
453
  }, "vv-nav__item-label"]
446
- }, toHandlers(navItem.on || {}), {
454
+ }, toHandlers(navItem.on), {
447
455
  onClick: ($event) => onClick(navItem)
448
456
  }), {
449
457
  default: withCtx(() => [
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),r=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(r||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(r).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={pressed:Boolean},f={label:[String,Number]},m={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const p={...d,...f,...v,...c,...u,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)}},b={...m,items:{type:Array,required:!0,default:()=>[]}},k={...m,items:{type:Array,required:!0,default:()=>[]}},y=p;const g=e.defineComponent({name:"VvAction",props:y,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:l}){const r=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:m}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const p=e.computed((()=>r.pressed||(null==m?void 0:m.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case r.disabled:return n.button;case void 0!==r.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==r.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==f?void 0:f.value,"aria-pressed":!!p.value||void 0,role:null==b?void 0:b.value};switch(k.value){case n.a:return{...e,href:r.href,target:r.target,rel:r.rel};case n.routerLink:case n.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),g=e=>{r.disabled?e.preventDefault():(null==v||v.emit("click",e),l("click",e))},B=e=>{null==v||v.emit("mouseover",e),l("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),l("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:g,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function B(t,o,l){return e.computed((()=>{const n={[t]:!0},r="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{n[`${t}--${o}`]=e.unref(l.value[o])})),n}))}const _={class:"vv-nav__menu",role:"menu","aria-busy":"true"},h=e.defineComponent({__name:"VvNav",props:k,emits:["click"],setup(t,{emit:o}){const l=t,{modifiers:n,items:r}=e.toRefs(l),a=e.ref(null),i=B("vv-nav",n),s=e.computed((()=>r.value.map(((e,t)=>({...e,id:e.id||`nav-item_${t}`})))));return(t,l)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createElementBlock("li",{key:t.id,class:"vv-nav__item",role:"presentation"},[e.createVNode(g,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(a)==t.id,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on||{}),{onClick:e=>{var l;(l=t).disabled||(o("click",l),a.value=l.id)}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}}),x=["id"];return e.defineComponent({__name:"VvTab",props:b,emits:["click"],setup(t,{emit:o}){const l=t,{modifiers:n,items:r}=e.toRefs(l),a=e.ref(null),i=B("vv-tab",n),s=e.computed((()=>r.value.map(((e,t)=>({...e,id:e.id||`tab-item_${t}`})))));function u(e){e.disabled||(o("click",e),a.value=e.id)}return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(i))},[e.createVNode(h,{items:e.unref(s),modifiers:"tabs full",onClick:u},null,8,["items"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(o=>(e.openBlock(),e.createElementBlock("article",{id:o.id,key:o.id,class:e.normalizeClass([{target:e.unref(a)===o.id},"vv-tab__panel"])},[e.renderSlot(t.$slots,`${o.id}`)],10,x)))),128))],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={pressed:Boolean},f={label:[String,Number]},m={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const p={...d,...f,...v,...c,...u,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0}},b={...m,items:{type:Array,required:!0,default:()=>[]}},k={...m,items:{type:Array,required:!0,default:()=>[]}},y=p;const g=e.defineComponent({name:"VvAction",props:y,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:l}){const n=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:m}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const p=e.computed((()=>n.pressed||(null==m?void 0:m.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case n.disabled:return r.button;case void 0!==n.to:return(null==u?void 0:u.nuxt)?r.nuxtLink:r.routerLink;case void 0!==n.href:return r.a;default:return r.button}})),y=e.computed((()=>{const e={...null==f?void 0:f.value,ariaPressed:!!p.value||void 0,ariaLabel:n.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case r.a:return{...e,href:n.href,target:n.target,rel:n.rel};case r.routerLink:case r.nuxtLink:return{...e,to:n.to,target:n.target};default:return{...e,type:n.type,disabled:n.disabled}}})),g=e=>{n.disabled?e.preventDefault():(null==v||v.emit("click",e),l("click",e))},B=e=>{null==v||v.emit("mouseover",e),l("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),l("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:g,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function B(t,o,l){return e.computed((()=>{const r={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{r[`${t}--${o}`]=e.unref(l.value[o])})),r}))}const _={class:"vv-nav__menu",role:"menu","aria-busy":"true"},h=e.defineComponent({__name:"VvNav",props:k,emits:["click"],setup(t,{emit:o}){const l=t,{modifiers:r,items:n}=e.toRefs(l),a=e.ref(null),i=B("vv-nav",r),s=e.computed((()=>n.value.map(((e,t)=>({...e,id:e.id||`nav-item_${t}`})))));return(t,l)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createElementBlock("li",{key:t.id,class:"vv-nav__item",role:"presentation"},[e.createVNode(g,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(a)==t.id,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on),{onClick:e=>{var l;(l=t).disabled||(o("click",l),a.value=l.id)}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}}),S=["id"];return e.defineComponent({__name:"VvTab",props:b,emits:["click"],setup(t,{emit:o}){const l=t,{modifiers:r,items:n}=e.toRefs(l),a=e.ref(null),i=B("vv-tab",r),s=e.computed((()=>n.value.map(((e,t)=>({...e,id:e.id||`tab-item_${t}`})))));function u(e){e.disabled||(o("click",e),a.value=e.id)}return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(i))},[e.createVNode(h,{items:e.unref(s),modifiers:"tabs full",onClick:u},null,8,["items"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(o=>(e.openBlock(),e.createElementBlock("article",{id:o.id,key:o.id,class:e.normalizeClass([{target:e.unref(a)===o.id},"vv-tab__panel"])},[e.renderSlot(t.$slots,`${o.id}`)],10,S)))),128))],2))}})}));
@@ -1,4 +1,4 @@
1
- import { unref, computed, defineComponent, h, inject, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, isRef, vModelText, createTextVNode, createVNode, createSlots, withCtx } from "vue";
1
+ import { unref, computed, isRef, defineComponent, h, inject, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, vModelText, createTextVNode, createVNode, createSlots, withCtx } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
3
  import { nanoid } from "nanoid";
4
4
  import { useFocus, useElementVisibility } from "@vueuse/core";
@@ -14,19 +14,27 @@ function joinLines(items) {
14
14
  }
15
15
  return items;
16
16
  }
17
- function HintSlotFactory(props, slots) {
18
- const invalidLabel = computed(() => joinLines(props.invalidLabel));
19
- const validLabel = computed(() => joinLines(props.validLabel));
20
- const loadingLabel = computed(() => props.loadingLabel);
21
- const hintLabel = computed(() => props.hintLabel);
17
+ function HintSlotFactory(propsOrRef, slots) {
18
+ const props = computed(() => {
19
+ if (isRef(propsOrRef)) {
20
+ return propsOrRef.value;
21
+ }
22
+ return propsOrRef;
23
+ });
24
+ const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
25
+ const validLabel = computed(() => joinLines(props.value.validLabel));
26
+ const loadingLabel = computed(() => props.value.loadingLabel);
27
+ const hintLabel = computed(() => props.value.hintLabel);
22
28
  const hasLoadingLabelOrSlot = computed(
23
- () => Boolean(props.loading && (slots.loading || loadingLabel.value))
29
+ () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
24
30
  );
25
31
  const hasInvalidLabelOrSlot = computed(
26
- () => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
32
+ () => !hasLoadingLabelOrSlot.value && Boolean(
33
+ props.value.invalid && (slots.invalid || invalidLabel.value)
34
+ )
27
35
  );
28
36
  const hasValidLabelOrSlot = computed(
29
- () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
37
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
30
38
  );
31
39
  const hasHintLabelOrSlot = computed(
32
40
  () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
@@ -35,10 +43,10 @@ function HintSlotFactory(props, slots) {
35
43
  () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
36
44
  );
37
45
  const hintSlotScope = computed(() => ({
38
- modelValue: props.modelValue,
39
- valid: props.valid,
40
- invalid: props.invalid,
41
- loading: props.loading
46
+ modelValue: props.value.modelValue,
47
+ valid: props.value.valid,
48
+ invalid: props.value.invalid,
49
+ loading: props.value.loading
42
50
  }));
43
51
  const HintSlot = defineComponent({
44
52
  name: "HintSlot",
@@ -699,6 +707,13 @@ const InputTextareaProps = {
699
707
  type: String,
700
708
  default: ButtonType.button,
701
709
  validator: (value) => Object.values(ButtonType).includes(value)
710
+ },
711
+ /**
712
+ * Button aria-label
713
+ */
714
+ ariaLabel: {
715
+ type: String,
716
+ default: void 0
702
717
  }
703
718
  });
704
719
  const WRAP = {
@@ -743,6 +758,59 @@ const VvTextareaProps = {
743
758
  */
744
759
  resizable: Boolean
745
760
  };
761
+ function useDefaults(componentName, propsDefinition, props) {
762
+ const volver = useVolver();
763
+ const volverComponentDefaults = computed(() => {
764
+ var _a;
765
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
766
+ return void 0;
767
+ }
768
+ return volver.defaults.value[componentName];
769
+ });
770
+ return computed(() => {
771
+ if (volverComponentDefaults.value === void 0) {
772
+ return props;
773
+ }
774
+ const componentDefaults = volverComponentDefaults.value;
775
+ const simplifiedPropsDefinition = propsDefinition;
776
+ const simplifiedProps = props;
777
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
778
+ const propValue = simplifiedProps[key];
779
+ acc[key] = propValue;
780
+ if (key in componentDefaults) {
781
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
782
+ const typeArray = simplifiedPropsDefinition[key];
783
+ if (typeArray.length) {
784
+ const typeFunction = typeArray[0];
785
+ if (typeFunction === propValue) {
786
+ acc[key] = componentDefaults[key];
787
+ }
788
+ }
789
+ }
790
+ if (typeof simplifiedPropsDefinition[key] === "function") {
791
+ const typeFunction = simplifiedPropsDefinition[key];
792
+ if (typeFunction() === propValue) {
793
+ acc[key] = componentDefaults[key];
794
+ }
795
+ }
796
+ if (typeof simplifiedPropsDefinition[key] === "object") {
797
+ let defaultValue = simplifiedPropsDefinition[key].default;
798
+ if (typeof defaultValue === "function") {
799
+ defaultValue = defaultValue();
800
+ }
801
+ if (typeof defaultValue === "object") {
802
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
803
+ acc[key] = componentDefaults[key];
804
+ }
805
+ } else if (defaultValue === propValue) {
806
+ acc[key] = componentDefaults[key];
807
+ }
808
+ }
809
+ }
810
+ return acc;
811
+ }, {});
812
+ });
813
+ }
746
814
  const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
747
815
  function useDebouncedInput(modelValue, emit, ms = 0, {
748
816
  getter = (value) => value,
@@ -868,6 +936,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
868
936
  setup(__props, { emit }) {
869
937
  const props = __props;
870
938
  const slots = useSlots();
939
+ const propsDefaults = useDefaults(
940
+ "VvTextarea",
941
+ VvTextareaProps,
942
+ props
943
+ );
871
944
  const textarea = ref();
872
945
  const {
873
946
  id,
@@ -922,7 +995,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
922
995
  hasHintLabelOrSlot,
923
996
  hasInvalidLabelOrSlot,
924
997
  hintSlotScope
925
- } = HintSlotFactory(props, slots);
998
+ } = HintSlotFactory(propsDefaults, slots);
926
999
  const bemCssClasses = useModifiers(
927
1000
  "vv-textarea",
928
1001
  modifiers,
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.nanoid,e.core)}(this,(function(e,t,o,l){"use strict";function a(t){return null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function n(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const i={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 r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{});const s=Symbol.for("volver");function c(t,o,l){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{a[`${t}--${o}`]=e.unref(l.value[o])})),a}))}const v=e.defineComponent({name:"VvIcon",props:i,setup(o){const l=o,a=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),n=e.ref(!0),i=e.inject(s),{modifiers:r}=e.toRefs(l),u=c("vv-icon",r),d=e.computed((()=>l.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=l.name??"",o=`@${d.value}:${l.prefix}:${e}`;if(t.iconExists(o))return o;const a=null==i?void 0:i.iconsCollections.find((o=>{const l=`@${d.value}:${o.prefix}:${e}`;return t.iconExists(l)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function m(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==o?void 0:o.innerHTML.trim())||"";o&&a&&t.addIcon(`@${d.value}:${l.prefix}:${l.name}`,{body:a,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&l.src&&!t.iconExists(`@${d.value}:${l.prefix}:${l.name}`)&&(n.value=!1,i.fetchIcon(l.src).then((e=>{e&&(m(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),l.svg&&m(l.svg),(o,l)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(a),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}}),m={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},f={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},h={disabled:Boolean},g=(Boolean,Boolean,{label:[String,Number]}),b={readonly:Boolean},S={modifiers:[String,Array]},y={hintLabel:{type:String,default:""}},B={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},L={debounce:[Number,String]},$={icon:{type:[String,Object]},iconPosition:{type:String,default:u.before,validation:e=>Object.values(u).includes(e)}},x={tabindex:{type:[String,Number],default:0}},w={floating:Boolean},k={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...k,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...x,...h,...b,...m,...p,...y,...f,...S,...B,...L,...$,...w,...g,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button;const N={...V,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:"soft"},spellcheck:{type:[Boolean,String],default:"default"},resizable:Boolean};const P=["for"],O={class:"vv-textarea__wrapper"},_={key:0,class:"vv-textarea__input-before"},I={class:"vv-textarea__inner"},C=["id"],E={key:1,class:"vv-textarea__input-after"},z={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:N,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:i}){const d=t,s=e.useSlots(),m=e.ref(),{id:p,icon:f,iconPosition:h,label:g,modelValue:b,count:S,valid:y,invalid:B,loading:L,modifiers:$}=e.toRefs(d),x=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(p),w=e.computed((()=>`${x.value}-hint`)),k=e.computed((()=>d.floating&&a(d.placeholder)?" ":d.placeholder)),V=function(t,o,l=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof l&&(l=parseInt(l)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{o("update:modelValue",n(e))}),l)}})}(b,i,d.debounce),{hasIcon:N,hasIconBefore:A,hasIconAfter:q}=function(t,o){const l=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.right))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.top))),s=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:i,hasIconTop:d,hasIconBottom:s,hasIconBefore:l,hasIconAfter:a}}(f,h),{focused:R}=function(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:a}}(m,i),F=l.useElementVisibility(m);e.watch(F,(e=>{e&&d.autofocus&&(R.value=!0)}));const{formatted:T}=function(t,o){const l=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==o?void 0:o.lowerLimit)&&l.value<(null==o?void 0:o.lowerLimit)?l.value-o.lowerLimit:void 0!==(null==o?void 0:o.upperLimit)&&l.value<(null==o?void 0:o.upperLimit)?o.upperLimit-l.value:0)),n=e.computed((()=>{if(!1===(null==o?void 0:o.mode))return"";if("limit"===(null==o?void 0:o.mode)&&(null==o?void 0:o.upperLimit))return`${l.value} / ${o.lowerLimit?`${o.lowerLimit}-`:""}${o.upperLimit}`;if("countdown"===(null==o?void 0:o.mode)){if(0===a.value)return;return a}return l.value}));return{length:l,gap:a,formatted:n}}(V,{mode:d.count,upperLimit:Number(d.maxlength),lowerLimit:Number(d.minlength)}),j=e.computed((()=>!d.disabled&&!d.readonly)),D=e.computed((()=>j.value?d.tabindex:-1)),H=e.computed((()=>!a(b))),M=e.computed((()=>!0===d.invalid||!0!==d.valid&&void 0)),{HintSlot:J,hasHintLabelOrSlot:K,hasInvalidLabelOrSlot:U,hintSlotScope:G}=function(t,o){const l=e.computed((()=>n(t.invalidLabel))),a=e.computed((()=>n(t.validLabel))),i=e.computed((()=>t.loadingLabel)),r=e.computed((()=>t.hintLabel)),u=e.computed((()=>Boolean(t.loading&&(o.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.invalid&&(o.invalid||l.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.valid&&(o.valid||a.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(o.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),m=e.computed((()=>({modelValue:t.modelValue,valid:t.valid,invalid:t.invalid,loading:t.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:l,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,o,l,a,n,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=(t=this.$slots).loading)?void 0:o.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(l=this.$slots).invalid)?void 0:a.call(l))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:m,HintSlot:p}}(d,s),Q=c("vv-textarea",$,e.computed((()=>({valid:y.value,invalid:B.value,loading:L.value,disabled:d.disabled,readonly:d.readonly,"icon-before":A.value,"icon-after":q.value,floating:d.floating&&!a(d.label),dirty:H.value,focused:R.value,resizable:d.resizable})))),W=e.computed((()=>({name:d.name,placeholder:k.value,tabindex:D.value,disabled:d.disabled,readonly:d.readonly,required:d.required,autocomplete:d.autocomplete,minlength:d.minlength,maxlength:d.maxlength,cols:d.cols,rows:d.rows,wrap:d.wrap,spellcheck:d.spellcheck,"aria-invalid":M.value,"aria-describedby":K.value?w.value:void 0,"aria-errormessage":U.value?w.value:void 0}))),X=e.computed((()=>({valid:d.valid,invalid:d.invalid,modelValue:d.modelValue,hintLabel:d.hintLabel,maxlength:d.maxlength,minlength:d.minlength,clear:Y}))),Y=()=>{V.value=void 0};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Q))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(x),class:"vv-textarea__label"},e.toDisplayString(e.unref(g)),9,P)):e.createCommentVNode("",!0),e.createElementVNode("div",O,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])):e.createCommentVNode("",!0),e.createElementVNode("div",I,[e.unref(A)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-textarea__icon"},e.unref(N)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(x),ref_key:"textarea",ref:m,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(V)?V.value=t:null)},e.unref(W),{onKeyup:o[1]||(o[1]=e=>i("keyup",e))}),null,16,C),[[e.vModelText,e.unref(V)]]),e.unref(q)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-textarea__icon vv-textarea__icon-after"},e.unref(N)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",E,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])):e.createCommentVNode("",!0),e.unref(S)?(e.openBlock(),e.createElementBlock("span",z,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(X))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(T)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(J),{id:e.unref(w),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.nanoid,e.core)}(this,(function(e,t,o,l){"use strict";function a(t){return null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function n(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const i={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 r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{});const s=Symbol.for("volver");function c(){return e.inject(s)}function v(t,o,l){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{a[`${t}--${o}`]=e.unref(l.value[o])})),a}))}const f=e.defineComponent({name:"VvIcon",props:i,setup(o){const l=o,a=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),n=e.ref(!0),i=c(),{modifiers:r}=e.toRefs(l),u=v("vv-icon",r),d=e.computed((()=>l.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=l.name??"",o=`@${d.value}:${l.prefix}:${e}`;if(t.iconExists(o))return o;const a=null==i?void 0:i.iconsCollections.find((o=>{const l=`@${d.value}:${o.prefix}:${e}`;return t.iconExists(l)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function f(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==o?void 0:o.innerHTML.trim())||"";o&&a&&t.addIcon(`@${d.value}:${l.prefix}:${l.name}`,{body:a,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&l.src&&!t.iconExists(`@${d.value}:${l.prefix}:${l.name}`)&&(n.value=!1,i.fetchIcon(l.src).then((e=>{e&&(f(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),l.svg&&f(l.svg),(o,l)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(a),color:o.color,onLoad:o.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}}),p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},h={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},L={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},x={debounce:[Number,String]},$={icon:{type:[String,Object]},iconPosition:{type:String,default:u.before,validation:e=>Object.values(u).includes(e)}},w={tabindex:{type:[String,Number],default:0}},k={floating:Boolean},V={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...{...V,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...w,...g,...y,...p,...m,...B,...h,...S,...L,...x,...$,...k,...b,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button;const O={...N,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:"soft"},spellcheck:{type:[Boolean,String],default:"default"},resizable:Boolean};const P=["for"],_={class:"vv-textarea__wrapper"},I={key:0,class:"vv-textarea__input-before"},C={class:"vv-textarea__inner"},E=["id"],z={key:1,class:"vv-textarea__input-after"},A={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:O,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:i}){const d=t,s=e.useSlots(),p=function(t,o,l){const a=c(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return l;const e=n.value,t=o,a=l;return Object.keys(t).reduce(((o,l)=>{const n=a[l];if(o[l]=n,l in e){if(Array.isArray(t[l])){const a=t[l];a.length&&a[0]===n&&(o[l]=e[l])}if("function"==typeof t[l]&&(0,t[l])()===n&&(o[l]=e[l]),"object"==typeof t[l]){let a=t[l].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(o[l]=e[l]):a===n&&(o[l]=e[l])}}return o}),{})}))}("VvTextarea",O,d),m=e.ref(),{id:h,icon:g,iconPosition:b,label:y,modelValue:S,count:B,valid:L,invalid:x,loading:$,modifiers:w}=e.toRefs(d),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(h),V=e.computed((()=>`${k.value}-hint`)),N=e.computed((()=>d.floating&&a(d.placeholder)?" ":d.placeholder)),j=function(t,o,l=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof l&&(l=parseInt(l)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{o("update:modelValue",n(e))}),l)}})}(S,i,d.debounce),{hasIcon:R,hasIconBefore:q,hasIconAfter:T}=function(t,o){const l=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.right))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.top))),s=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===r.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:i,hasIconTop:d,hasIconBottom:s,hasIconBefore:l,hasIconAfter:a}}(g,b),{focused:F}=function(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:a}}(m,i),D=l.useElementVisibility(m);e.watch(D,(e=>{e&&d.autofocus&&(F.value=!0)}));const{formatted:H}=function(t,o){const l=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==o?void 0:o.lowerLimit)&&l.value<(null==o?void 0:o.lowerLimit)?l.value-o.lowerLimit:void 0!==(null==o?void 0:o.upperLimit)&&l.value<(null==o?void 0:o.upperLimit)?o.upperLimit-l.value:0)),n=e.computed((()=>{if(!1===(null==o?void 0:o.mode))return"";if("limit"===(null==o?void 0:o.mode)&&(null==o?void 0:o.upperLimit))return`${l.value} / ${o.lowerLimit?`${o.lowerLimit}-`:""}${o.upperLimit}`;if("countdown"===(null==o?void 0:o.mode)){if(0===a.value)return;return a}return l.value}));return{length:l,gap:a,formatted:n}}(j,{mode:d.count,upperLimit:Number(d.maxlength),lowerLimit:Number(d.minlength)}),M=e.computed((()=>!d.disabled&&!d.readonly)),J=e.computed((()=>M.value?d.tabindex:-1)),K=e.computed((()=>!a(S))),U=e.computed((()=>!0===d.invalid||!0!==d.valid&&void 0)),{HintSlot:G,hasHintLabelOrSlot:Q,hasInvalidLabelOrSlot:W,hintSlotScope:X}=function(t,o){const l=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>n(l.value.invalidLabel))),i=e.computed((()=>n(l.value.validLabel))),r=e.computed((()=>l.value.loadingLabel)),u=e.computed((()=>l.value.hintLabel)),d=e.computed((()=>Boolean(l.value.loading&&(o.loading||r.value)))),s=e.computed((()=>!d.value&&Boolean(l.value.invalid&&(o.invalid||a.value)))),c=e.computed((()=>!d.value&&!s.value&&Boolean(l.value.valid&&(o.valid||i.value)))),v=e.computed((()=>!d.value&&!s.value&&!c.value&&Boolean(o.hint||u.value))),f=e.computed((()=>s.value||c.value||d.value||v.value)),p=e.computed((()=>({modelValue:l.value.modelValue,valid:l.value.valid,invalid:l.value.invalid,loading:l.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:i,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:v}),render(){var t,o,l,a,n,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=(t=this.$slots).loading)?void 0:o.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(l=this.$slots).invalid)?void 0:a.call(l))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:s,hasHintLabelOrSlot:v,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:d,hintSlotScope:p,HintSlot:m}}(p,s),Y=v("vv-textarea",w,e.computed((()=>({valid:L.value,invalid:x.value,loading:$.value,disabled:d.disabled,readonly:d.readonly,"icon-before":q.value,"icon-after":T.value,floating:d.floating&&!a(d.label),dirty:K.value,focused:F.value,resizable:d.resizable})))),Z=e.computed((()=>({name:d.name,placeholder:N.value,tabindex:J.value,disabled:d.disabled,readonly:d.readonly,required:d.required,autocomplete:d.autocomplete,minlength:d.minlength,maxlength:d.maxlength,cols:d.cols,rows:d.rows,wrap:d.wrap,spellcheck:d.spellcheck,"aria-invalid":U.value,"aria-describedby":Q.value?V.value:void 0,"aria-errormessage":W.value?V.value:void 0}))),ee=e.computed((()=>({valid:d.valid,invalid:d.invalid,modelValue:d.modelValue,hintLabel:d.hintLabel,maxlength:d.maxlength,minlength:d.minlength,clear:te}))),te=()=>{j.value=void 0};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Y))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(k),class:"vv-textarea__label"},e.toDisplayString(e.unref(y)),9,P)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])):e.createCommentVNode("",!0),e.createElementVNode("div",C,[e.unref(q)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:0,class:"vv-textarea__icon"},e.unref(R)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(k),ref_key:"textarea",ref:m,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(j)?j.value=t:null)},e.unref(Z),{onKeyup:o[1]||(o[1]=e=>i("keyup",e))}),null,16,E),[[e.vModelText,e.unref(j)]]),e.unref(T)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:1,class:"vv-textarea__icon vv-textarea__icon-after"},e.unref(R)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])):e.createCommentVNode("",!0),e.unref(B)?(e.openBlock(),e.createElementBlock("span",A,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(ee))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(H)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(G),{id:e.unref(V),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(X))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -187,25 +187,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
187
187
  clear: () => void;
188
188
  }): any;
189
189
  hint?(_: {
190
- modelValue: any;
190
+ modelValue: unknown;
191
191
  valid: boolean;
192
192
  invalid: boolean;
193
193
  loading: boolean;
194
194
  }): any;
195
195
  loading?(_: {
196
- modelValue: any;
196
+ modelValue: unknown;
197
197
  valid: boolean;
198
198
  invalid: boolean;
199
199
  loading: boolean;
200
200
  }): any;
201
201
  valid?(_: {
202
- modelValue: any;
202
+ modelValue: unknown;
203
203
  valid: boolean;
204
204
  invalid: boolean;
205
205
  loading: boolean;
206
206
  }): any;
207
207
  invalid?(_: {
208
- modelValue: any;
208
+ modelValue: unknown;
209
209
  valid: boolean;
210
210
  invalid: boolean;
211
211
  loading: boolean;
@@ -216,6 +216,13 @@ const ModifiersProps = {
216
216
  type: String,
217
217
  default: ButtonType.button,
218
218
  validator: (value) => Object.values(ButtonType).includes(value)
219
+ },
220
+ /**
221
+ * Button aria-label
222
+ */
223
+ ariaLabel: {
224
+ type: String,
225
+ default: void 0
219
226
  }
220
227
  });
221
228
  const VvTooltipProps = {
@@ -1,11 +1,12 @@
1
1
  import type { ExtractPropTypes, Slots } from 'vue';
2
+ import type { Ref } from 'vue';
2
3
  export type HintSlotProps = Readonly<ExtractPropTypes<{
3
4
  hintLabel: {
4
5
  type: StringConstructor;
5
6
  default: '';
6
7
  required: true;
7
8
  };
8
- modelValue: null;
9
+ modelValue: unknown;
9
10
  valid: BooleanConstructor;
10
11
  validLabel: (StringConstructor | ArrayConstructor)[];
11
12
  invalid: BooleanConstructor;
@@ -19,13 +20,13 @@ export type HintSlotProps = Readonly<ExtractPropTypes<{
19
20
  * @param {Slots} parentSlots vue slots
20
21
  * @returns {Component} vue component
21
22
  */
22
- export declare function HintSlotFactory(props: HintSlotProps, slots: Slots): {
23
+ export declare function HintSlotFactory(propsOrRef: HintSlotProps | Ref<HintSlotProps>, slots: Slots): {
23
24
  hasInvalidLabelOrSlot: globalThis.ComputedRef<boolean>;
24
25
  hasHintLabelOrSlot: globalThis.ComputedRef<boolean>;
25
26
  hasValidLabelOrSlot: globalThis.ComputedRef<boolean>;
26
27
  hasLoadingLabelOrSlot: globalThis.ComputedRef<boolean>;
27
28
  hintSlotScope: globalThis.ComputedRef<{
28
- modelValue: any;
29
+ modelValue: unknown;
29
30
  valid: boolean;
30
31
  invalid: boolean;
31
32
  loading: boolean;
@@ -1,5 +1,7 @@
1
1
  export { default as VvAccordion } from './VvAccordion/VvAccordion.vue';
2
2
  export { default as VvAccordionGroup } from './VvAccordionGroup/VvAccordionGroup.vue';
3
+ export { default as VvAction } from './VvAction/VvAction.vue';
4
+ export { default as VvAlert } from './VvAlert/VvAlert.vue';
3
5
  export { default as VvBadge } from './VvBadge/VvBadge.vue';
4
6
  export { default as VvBreadcrumb } from './VvBreadcrumb/VvBreadcrumb.vue';
5
7
  export { default as VvButton } from './VvButton/VvButton.vue';
@@ -12,8 +14,11 @@ export { default as VvDialog } from './VvDialog/VvDialog.vue';
12
14
  export { default as VvDropdown } from './VvDropdown/VvDropdown.vue';
13
15
  export { default as VvIcon } from './VvIcon/VvIcon.vue';
14
16
  export { default as VvInputText } from './VvInputText/VvInputText.vue';
17
+ export { default as VvNav } from './VvNav/VvNav.vue';
15
18
  export { default as VvProgress } from './VvProgress/VvProgress.vue';
16
19
  export { default as VvRadio } from './VvRadio/VvRadio.vue';
17
20
  export { default as VvRadioGroup } from './VvRadioGroup/VvRadioGroup.vue';
18
21
  export { default as VvSelect } from './VvSelect/VvSelect.vue';
22
+ export { default as VvTab } from './VvTab/VvTab.vue';
19
23
  export { default as VvTextarea } from './VvTextarea/VvTextarea.vue';
24
+ export { default as VvTooltip } from './VvTooltip/VvTooltip.vue';