@volverjs/ui-vue 0.0.3 → 0.0.4

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 (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +52 -13
  3. package/dist/Volver.d.ts +5 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +170 -0
  9. package/dist/components/VvAction/VvAction.umd.js +1 -0
  10. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  11. package/dist/components/VvAction/index.d.ts +24 -0
  12. package/dist/components/VvBadge/VvBadge.es.js +86 -16
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +434 -251
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
  19. package/dist/components/VvButton/index.d.ts +22 -67
  20. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
  21. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.es.js +38 -25
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  27. package/dist/components/VvCheckbox/index.d.ts +1 -1
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
  35. package/dist/components/VvCombobox/index.d.ts +18 -13
  36. package/dist/components/VvDialog/VvDialog.es.js +139 -64
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  42. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  43. package/dist/components/VvDropdown/index.d.ts +6 -9
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
  47. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  50. package/dist/components/VvIcon/VvIcon.es.js +48 -32
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputText/VvInputText.es.js +508 -344
  53. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
  55. package/dist/components/VvInputText/index.d.ts +13 -2
  56. package/dist/components/VvProgress/VvProgress.es.js +90 -20
  57. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.es.js +305 -125
  59. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  60. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  61. package/dist/components/VvRadio/index.d.ts +1 -1
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +371 -216
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
  69. package/dist/components/VvSelect/index.d.ts +5 -5
  70. package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
  73. package/dist/components/VvTextarea/index.d.ts +5 -5
  74. package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
  75. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  76. package/dist/components/index.es.js +1913 -1521
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  79. package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
  80. package/dist/constants.d.ts +30 -0
  81. package/dist/directives/index.es.js +128 -0
  82. package/dist/directives/index.umd.js +1 -0
  83. package/dist/directives/v-tooltip.es.js +126 -0
  84. package/dist/directives/v-tooltip.umd.js +1 -0
  85. package/dist/icons.es.js +3 -3
  86. package/dist/icons.umd.js +1 -1
  87. package/dist/index.es.js +2102 -1761
  88. package/dist/index.umd.js +1 -1
  89. package/dist/props/index.d.ts +179 -11
  90. package/dist/resolvers/unplugin.d.ts +8 -8
  91. package/dist/resolvers/unplugin.es.js +51 -30
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  94. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  95. package/package.json +60 -34
  96. package/src/Volver.ts +12 -5
  97. package/src/assets/icons/detailed.json +1 -1
  98. package/src/assets/icons/normal.json +1 -1
  99. package/src/assets/icons/simple.json +1 -1
  100. package/src/components/VvAction/VvAction.vue +144 -0
  101. package/src/components/VvAction/index.ts +5 -0
  102. package/src/components/VvButton/VvButton.vue +31 -114
  103. package/src/components/VvButton/index.ts +6 -79
  104. package/src/components/VvCombobox/VvCombobox.vue +54 -42
  105. package/src/components/VvCombobox/index.ts +11 -9
  106. package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
  107. package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
  108. package/src/components/VvDropdown/index.ts +4 -9
  109. package/src/components/VvSelect/index.ts +2 -4
  110. package/src/composables/dropdown/useInjectDropdown.ts +1 -1
  111. package/src/composables/dropdown/useProvideDropdown.ts +7 -9
  112. package/src/composables/useModifiers.ts +4 -7
  113. package/src/constants.ts +36 -0
  114. package/src/props/index.ts +106 -14
  115. package/src/resolvers/unplugin.ts +81 -48
  116. package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
  117. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
  118. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  119. package/src/stories/Button/Button.stories.mdx +4 -2
  120. package/src/stories/Button/Button.test.ts +3 -1
  121. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  122. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  123. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  124. package/src/stories/Card/Card.stories.mdx +2 -1
  125. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  126. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  127. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  128. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  129. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  130. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  131. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  132. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  133. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  134. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  135. package/src/stories/Icon/Icon.stories.mdx +2 -1
  136. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  137. package/src/stories/InputText/InputText.stories.mdx +2 -1
  138. package/src/stories/Progress/Progress.stories.mdx +2 -1
  139. package/src/stories/Radio/Radio.stories.mdx +2 -1
  140. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  141. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  142. package/src/stories/Select/Select.stories.mdx +2 -1
  143. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  144. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  145. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
@@ -1 +1 @@
1
- (function(e,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],y):(e=typeof globalThis<"u"?globalThis:e||self,e.VvInputText=y(e.vue,e.vue$1))})(this,function(e,y){"use strict";function D(o){return Array.isArray(o)?o.filter(s=>isString(s)).join(" "):o}function G(o,s){const{invalid:t,valid:r,hint:d,loading:f}=s,{hintLabel:c,modelValue:I,valid:v,validLabel:m,invalid:i,invalidLabel:a,...b}=toRefs(o),u=resolveFieldData(b,"loading"),S=resolveFieldData(b,"loadingLabel"),w=computed(()=>i.value?!!(i.value&&t||a!=null&&a.value&&Array.isArray(a.value)&&a.value.length>0||a!=null&&a.value&&!isEmpty(a)):!1),T=computed(()=>!!(c&&c.value||d)),g=computed(()=>!!(m&&m.value||r)),P=computed(()=>!!(u!=null&&u.value&&f||u!=null&&u.value&&(S!=null&&S.value))),R=computed(()=>T.value||g.value||w.value||P.value);return{hasInvalid:w,hasHint:T,hasValid:g,hasLoading:P,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(_){const B=computed(()=>{const C=toReactive({hintLabel:c,modelValue:I,valid:v,validLabel:m,invalid:i,invalidLabel:a,loading:u,loadingLabel:S,..._.params});return i!=null&&i.value?(t==null?void 0:t(C))||D(a==null?void 0:a.value)||(c==null?void 0:c.value):v!=null&&v.value?(r==null?void 0:r(C))||D(m==null?void 0:m.value)||(c==null?void 0:c.value):u!=null&&u.value?(f==null?void 0:f(C))||D(S==null?void 0:S.value)||(c==null?void 0:c.value):(d==null?void 0:d(C))||D(c==null?void 0:c.value)||(c==null?void 0:c.value)});return{isVisible:R,hasInvalid:w,hasValid:g,hintContent:B}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const Q={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]}},Z={name:"VvIcon"},E=e.defineComponent({...Z,props:Q,setup(o){const s=o,t=ref(!0),r=useVolver(),{modifiers:d}=toRefs(s),f=useBemModifiers("vv-icon",d),c=computed(()=>s.provider||(r==null?void 0:r.provider)),I=computed(()=>{const i=s.name??"",a=`@${c.value}:${s.prefix}:${s.name}`;return y.iconExists(i)?i:y.iconExists(a)?a:(r==null?void 0:r.iconsCollections.find(b=>{const u=`@${c.value}:${b.prefix}:${i}`;if(y.iconExists(u))return u}))||i});function v(i){let a=null;if(typeof window>"u"){const{JSDOM:w}=require("jsdom");a=new w().window}return(a?new a.DOMParser:new window.DOMParser).parseFromString(i,"text/html").querySelector("svg")}function m(i){const a=v(i),b=(a==null?void 0:a.innerHTML.trim())||"";a&&b&&y.addIcon(`@${c.value}:${s.prefix}:${s.name}`,{body:b,height:a.viewBox.baseVal.height,width:a.viewBox.baseVal.width})}return r&&(s.src&&!y.iconExists(`@${c.value}:${s.prefix}:${s.name}`)?(t.value=!1,r.fetchIcon(s.src).then(i=>{i&&(m(i),t.value=!0)}).catch(i=>{throw new Error(`During fetch icon: ${i==null?void 0:i.message}`)})):s.svg&&m(s.svg)),(i,a)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(y.Icon),e.mergeProps({key:0,class:e.unref(f)},{inline:i.inline,width:i.width,height:i.height,horizontalFlip:i.horizontalFlip,verticalFlip:i.verticalFlip,flip:i.flip,rotate:i.rotate,color:i.color,onLoad:i.onLoad,icon:e.unref(I)}),null,16,["class"])):e.createCommentVNode("",!0)}});var k=(o=>(o.left="left",o.right="right",o.top="top",o.bottom="bottom",o))(k||{}),W=(o=>(o.topStart="top-start",o.topEnd="top-end",o.bottomStart="bottom-start",o.bottomEnd="bottom-end",o.leftStart="left-start",o.leftEnd="left-end",o.rightStart="right-start",o.rightEnd="right-end",o))(W||{}),V=(o=>(o.before="before",o.after="after",o))(V||{});const ee={valid:Boolean,validLabel:[String,Array]},te={invalid:Boolean,invalidLabel:[String,Array]},oe={loading:Boolean,loadingLabel:String},ne={disabled:Boolean},se={readonly:Boolean},ie={modifiers:[String,Array]},ae={hintLabel:{type:String,default:""}},re={count:{type:[Boolean,String],default:!1,validator:o=>[!0,!1,"limit","countdown"].includes(o)}},le={debounce:[Number,String]},ce={icon:{type:[String,Object]},iconPosition:{type:String,default:V.before,validation:o=>Object.values(V).includes(o)}},de={tabindex:{type:[String,Number],default:0}},ue={floating:Boolean},pe={id:[String,Number]};k.bottom;const fe={...{...pe,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...de,...ne,...se,...ee,...te,...ae,...oe,...ie,...re,...le,...ce,...ue,minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},n={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},A={PASSWORD_SHOW:"eye-on",PASSWORD_HIDE:"eye-off",DATE:"calendar",TIME:"time",COLOR:"color",SEARCH:"close"},me=["update:modelValue","focus","blur","keyup"],he={...fe,modelValue:[String,Number],type:{type:String,default:n.TEXT,validator:o=>Object.values(n).includes(o)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:A.PASSWORD_SHOW},iconHidePassword:{type:String,default:A.PASSWORD_HIDE},iconClear:{type:String,default:A.SEARCH},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"}},$=defineComponent({components:{VvIcon:E},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:A.PASSWORD_SHOW},iconHide:{type:String,default:A.PASSWORD_HIDE}},emits:["toggle-password"],setup(o,{emit:s}){const t=ref(!1),r=computed(()=>t.value?o.iconHide:o.iconShow);function d(f){f==null||f.stopPropagation(),o.disabled||(t.value=!t.value,s("toggle-password",t.value))}return{active:t,activeIcon:r,onClick:d}},render(){const o=h(E,{name:this.activeIcon,class:"vv-input-text__action-icon"});return h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},o)}}),O=defineComponent({components:{VvIcon:E},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:o=>["up","down"].includes(o),default:"up"}},emits:["step-up","step-down"],setup(o,{emit:s}){const t=computed(()=>o.mode==="up");return{isUp:t,onClick:d=>{d==null||d.stopPropagation(),o.disabled||s(t.value?"step-up":"step-down")}}},render(){return h("button",{class:["vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,onClick:this.onClick})}}),F=defineComponent({components:{VvIcon:E},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup(o,{emit:s}){function t(r){r==null||r.stopPropagation(),o.disabled||s("clear")}return{onClick:t}},render(){const o=h(E,{name:this.icon,class:"vv-input-text__action-icon"});return h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},o)}});function x(o,s){return{name:"VvInputTextActions",components:{VvIcon:E,VvInputPasswordAction:$,VvInputStepAction:O,VvInputClearAction:F},setup(){return{isDisabled:computed(()=>s.disabled||s.readonly),labelStepUp:s.labelStepUp,labelStepDown:s.labelStepDown,labelShowPassword:s.labelShowPassword,labelHidePassword:s.labelHidePassword,labelClear:s.labelClear,iconShowPassword:s.iconShowPassword,iconHidePassword:s.iconHidePassword}},render(){let t=null;switch(o){case n.SEARCH:{const{onClear:r}=this.$attrs;t=[h(F,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:r})];break}case n.PASSWORD:{const{onTogglePassword:r}=this.$attrs;t=[h($,{disabled:this.isDisabled,onTogglePassword:r,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case n.NUMBER:{const{onStepUp:r,onStepDown:d}=this.$attrs;t=[h(O,{mode:"up",disabled:this.isDisabled||s.max!==void 0&&s.modelValue===s.max,label:this.labelStepUp,onStepUp:r,onStepDown:d}),h(O,{mode:"down",disabled:this.isDisabled||s.min!==void 0&&s.modelValue===s.min,label:this.labelStepDown,onStepUp:r,onStepDown:d})];break}}return Array.isArray(t)?h("div",{class:"vv-input-text__actions-group"},t):t}}}const Se=["for"],be={class:"vv-input-text__wrapper"},ge={key:0,class:"vv-input-text__input-before"},ye={class:"vv-input-text__inner"},ve=["id"],we={key:1,class:"vv-input-text__input-after"},Ee={key:2,class:"vv-input-text__limit"},Ae={name:"VvInputText"};return e.defineComponent({...Ae,props:he,emits:me,setup(o,{emit:s}){const t=o,r=useSlots(),d=ref(),{id:f,icon:c,iconPosition:I,label:v,modelValue:m,count:i,valid:a,invalid:b,loading:u}=toRefs(t),S=useUniqueId(f),w=computed(()=>`${S.value}-hint`),T=computed(()=>t.floating&&isEmpty(t.placeholder)?" ":t.placeholder),g=useDebouncedInput(m,s,t.debounce),{focused:P}=useComponentFocus(d,s),R=useElementVisibility(d);watch(R,l=>{l&&t.autofocus&&(P.value=!0)});const _=ref(!1),B=computed(()=>t.type===n.PASSWORD),C=()=>{_.value=!_.value},Ce=computed(()=>t.type===n.TIME||t.type===n.DATETIME_LOCAL||t.type===n.DATE||t.type===n.WEEK||t.type===n.MONTH),Pe=computed(()=>t.type===n.NUMBER),j=()=>{M.value&&(d.value.stepUp(),g.value=unref(d).value)},q=()=>{M.value&&(d.value.stepDown(),g.value=unref(d).value)},Ie=computed(()=>t.type===n.SEARCH),z=()=>{g.value=void 0},{hasIcon:X,hasIconBefore:K,hasIconAfter:N}=useComponentIcon(c,I),H=computed(()=>{switch(t.type){case n.COLOR:return{name:A.COLOR};case n.DATE:case n.DATETIME_LOCAL:case n.WEEK:case n.MONTH:return{name:A.DATE};case n.TIME:return{name:A.TIME};default:return""}}),{formatted:_e}=useTextCount(g,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),M=computed(()=>!t.disabled&&!t.readonly),De=computed(()=>M.value?t.tabindex:-1),Y=computed(()=>!isEmpty(m)),Te=computed(()=>{if(b.value===!0)return!0;if(a.value===!0)return!1}),{modifiers:Be}=toRefs(t),ke=useBemModifiers("vv-input-text",Be,computed(()=>({valid:a.value,invalid:b.value,loading:u.value,disabled:t.disabled,readonly:t.readonly,"icon-before":K.value,"icon-after":N.value||!isEmpty(H),floating:t.floating&&!isEmpty(t.label),dirty:Y.value,focus:P.value}))),Ve=computed(()=>{const l=(()=>B.value&&_.value||Ce.value&&!Y.value&&!P.value?n.TEXT:t.type)(),p={type:l,name:t.name,tabindex:De.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,"aria-invalid":Te.value,"aria-describedby":!J.value&&xe.value?w.value:void 0,"aria-errormessage":J.value?w.value:void 0};return(l===n.DATE||l===n.MONTH||l===n.WEEK||l===n.TIME||l===n.DATETIME_LOCAL||l===n.NUMBER)&&(p.step=t.step,p.max=String(t.max),p.min=String(t.min)),(l===n.TEXT||l===n.SEARCH||l===n.URL||l===n.TEL||l===n.EMAIL||l===n.PASSWORD||l===n.NUMBER)&&(p.placeholder=T.value),(l===n.TEXT||l===n.SEARCH||l===n.URL||l===n.TEL||l===n.EMAIL||l===n.PASSWORD)&&(p.minlength=t.minlength,p.maxlength=t.maxlength,p.pattern=t.pattern),l===n.EMAIL&&(p.multiple=t.multiple),p}),L=computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,togglePassword:C,stepUp:j,stepDown:q,clear:z})),{HintSlot:Oe,hasHint:xe,hasInvalid:J}=G(t,r),Re=x(n.PASSWORD,t),Ne=x(n.NUMBER,t),He=x(n.SEARCH,t);return(l,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ke))},[e.unref(v)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(S),class:"vv-input-text__label"},e.toDisplayString(e.unref(v)),9,Se)):e.createCommentVNode("",!0),e.createElementVNode("div",be,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",ge,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])):e.createCommentVNode("",!0),e.createElementVNode("div",ye,[e.unref(K)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(X)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(S),ref_key:"input",ref:d,"onUpdate:modelValue":p[0]||(p[0]=U=>e.isRef(g)?g.value=U:null)},e.unref(Ve),{onKeyup:p[1]||(p[1]=U=>s("keyup",U))}),null,16,ve),[[e.vModelDynamic,e.unref(g)]]),e.unref(N)||e.unref(H)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(N)?e.unref(X):e.unref(H)),null,16)):e.unref(B)?(e.openBlock(),e.createBlock(e.unref(Re),{key:2,onTogglePassword:C})):e.unref(Pe)?(e.openBlock(),e.createBlock(e.unref(Ne),{key:3,onStepUp:j,onStepDown:q})):e.unref(Ie)?(e.openBlock(),e.createBlock(e.unref(He),{key:4,onClear:z})):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",we,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])):e.createCommentVNode("",!0),e.unref(i)?(e.openBlock(),e.createElementBlock("span",Ee,[e.renderSlot(l.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(L))),()=>[e.createTextVNode(e.toDisplayString(e.unref(_e)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(Oe),{id:e.unref(w),class:"vv-input-text__hint"},null,8,["id"])],2))}})});
1
+ (function(e,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("vue"),require("@vueuse/core"),require("@iconify/vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core","@iconify/vue","nanoid"],v):(e=typeof globalThis<"u"?globalThis:e||self,e.VvInputText=v(e.vue,e.core,e.vue$1,e.nanoid))})(this,function(e,v,B,re){"use strict";function W(t,n){if(t&&Object.keys(t).length&&n){if(n.indexOf(".")===-1)return t[n];{const o=n.split(".");let r=t;for(let l=0,d=o.length;l<d;++l){if(t==null)return null;r=r[o[l]]}return r}}else return null}function P(t){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(t))}function ae(t){return typeof t=="string"||t instanceof String}function k(t){return Array.isArray(t)?t.filter(n=>ae(n)).join(" "):t}function le(t,n){const{invalid:o,valid:r,hint:l,loading:d}=n,{hintLabel:u,modelValue:_,valid:g,validLabel:m,invalid:s,invalidLabel:i,...b}=e.toRefs(t),p=W(b,"loading"),h=W(b,"loadingLabel"),y=e.computed(()=>s.value?!!(s.value&&o||i!=null&&i.value&&Array.isArray(i.value)&&i.value.length>0||i!=null&&i.value&&!P(i)):!1),O=e.computed(()=>!!(u&&u.value||l)),S=e.computed(()=>!!(m&&m.value||r)),C=e.computed(()=>!!(p!=null&&p.value&&d||p!=null&&p.value&&(h!=null&&h.value))),H=e.computed(()=>O.value||S.value||y.value||C.value);return{hasInvalid:y,hasHint:O,hasValid:S,hasLoading:C,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(T){const N=e.computed(()=>{const A=v.toReactive({hintLabel:u,modelValue:_,valid:g,validLabel:m,invalid:s,invalidLabel:i,loading:p,loadingLabel:h,...T.params});return s!=null&&s.value?(o==null?void 0:o(A))||k(i==null?void 0:i.value)||(u==null?void 0:u.value):g!=null&&g.value?(r==null?void 0:r(A))||k(m==null?void 0:m.value)||(u==null?void 0:u.value):p!=null&&p.value?(d==null?void 0:d(A))||k(h==null?void 0:h.value)||(u==null?void 0:u.value):(l==null?void 0:l(A))||k(u==null?void 0:u.value)||(u==null?void 0:u.value)});return{isVisible:H,hasInvalid:y,hasValid:S,hintContent:N}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const se={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=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(I||{}),F=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(F||{}),D=(t=>(t.before="before",t.after="after",t))(D||{}),R=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(R||{}),q=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(q||{});const ie=Symbol.for("volver");function ce(){return e.inject(ie)}function z(t,n,o){return e.computed(()=>{const r={[t]:!0},l=typeof(n==null?void 0:n.value)=="string"?n.value.split(" "):n==null?void 0:n.value;return l&&Array.isArray(l)&&l.forEach(d=>{r[`${t}--${d}`]=!0}),o&&Object.keys(o.value).forEach(d=>{r[`${t}--${d}`]=e.unref(o.value[d])}),r})}const ue={name:"VvIcon"},w=e.defineComponent({...ue,props:se,setup(t){const n=t,o=e.ref(!0),r=ce(),{modifiers:l}=e.toRefs(n),d=z("vv-icon",l),u=e.computed(()=>n.provider||(r==null?void 0:r.provider)),_=e.computed(()=>{const s=n.name??"",i=`@${u.value}:${n.prefix}:${n.name}`;return B.iconExists(s)?s:B.iconExists(i)?i:(r==null?void 0:r.iconsCollections.find(b=>{const p=`@${u.value}:${b.prefix}:${s}`;if(B.iconExists(p))return p}))||s});function g(s){let i=null;if(typeof window>"u"){const{JSDOM:y}=require("jsdom");i=new y().window}return(i?new i.DOMParser:new window.DOMParser).parseFromString(s,"text/html").querySelector("svg")}function m(s){const i=g(s),b=(i==null?void 0:i.innerHTML.trim())||"";i&&b&&B.addIcon(`@${u.value}:${n.prefix}:${n.name}`,{body:b,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return r&&(n.src&&!B.iconExists(`@${u.value}:${n.prefix}:${n.name}`)?(o.value=!1,r.fetchIcon(n.src).then(s=>{s&&(m(s),o.value=!0)}).catch(s=>{throw new Error(`During fetch icon: ${s==null?void 0:s.message}`)})):n.svg&&m(n.svg)),(s,i)=>e.unref(o)?(e.openBlock(),e.createBlock(e.unref(B.Icon),e.mergeProps({key:0,class:e.unref(d)},{inline:s.inline,width:s.width,height:s.height,horizontalFlip:s.horizontalFlip,verticalFlip:s.verticalFlip,flip:s.flip,rotate:s.rotate,color:s.color,onLoad:s.onLoad,icon:e.unref(_)}),null,16,["class"])):e.createCommentVNode("",!0)}}),de={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(q).includes(t)},rel:{type:String,default:"noopener noreferrer"}},pe={valid:Boolean,validLabel:[String,Array]},fe={invalid:Boolean,invalidLabel:[String,Array]},me={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},K={disabled:Boolean},he={active:Boolean},be={pressed:Boolean},X={label:[String,Number]},Se={readonly:Boolean},ge={modifiers:[String,Array]},ye={hintLabel:{type:String,default:""}},we={count:{type:[Boolean,String],default:!1,validator:t=>[!0,!1,"limit","countdown"].includes(t)}},Ee={debounce:[Number,String]},ve={icon:{type:[String,Object]},iconPosition:{type:String,default:D.before,validation:t=>Object.values(D).includes(t)}},Ie={tabindex:{type:[String,Number],default:0}},_e={floating:Boolean},Ae={id:[String,Number]};I.bottom;const Be={...{...Ae,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...Ie,...K,...Se,...pe,...fe,...ye,...me,...ge,...we,...Ee,...ve,..._e,...X,minlength:Number,maxlength:Number,placeholder:String,required:Boolean};({...K,...X,...be,...he,...de,type:R.button});const a={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},E={PASSWORD_SHOW:"eye-on",PASSWORD_HIDE:"eye-off",DATE:"calendar",TIME:"time",COLOR:"color",SEARCH:"close"},Ce=["update:modelValue","focus","blur","keyup"],Pe={...Be,modelValue:[String,Number],type:{type:String,default:a.TEXT,validator:t=>Object.values(a).includes(t)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:E.PASSWORD_SHOW},iconHidePassword:{type:String,default:E.PASSWORD_HIDE},iconClear:{type:String,default:E.SEARCH},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"}},Y=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:E.PASSWORD_SHOW},iconHide:{type:String,default:E.PASSWORD_HIDE}},emits:["toggle-password"],setup(t,{emit:n}){const o=e.ref(!1),r=e.computed(()=>o.value?t.iconHide:t.iconShow);function l(d){d==null||d.stopPropagation(),t.disabled||(o.value=!o.value,n("toggle-password",o.value))}return{active:o,activeIcon:r,onClick:l}},render(){const t=e.h(w,{name:this.activeIcon,class:"vv-input-text__action-icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),V=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:t=>["up","down"].includes(t),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:n}){const o=e.computed(()=>t.mode==="up");return{isUp:o,onClick:l=>{l==null||l.stopPropagation(),t.disabled||n(o.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,onClick:this.onClick})}}),J=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup(t,{emit:n}){function o(r){r==null||r.stopPropagation(),t.disabled||n("clear")}return{onClick:o}},render(){const t=e.h(w,{name:this.icon,class:"vv-input-text__action-icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function x(t,n){return{name:"VvInputTextActions",components:{VvIcon:w,VvInputPasswordAction:Y,VvInputStepAction:V,VvInputClearAction:J},setup(){return{isDisabled:e.computed(()=>n.disabled||n.readonly),labelStepUp:n.labelStepUp,labelStepDown:n.labelStepDown,labelShowPassword:n.labelShowPassword,labelHidePassword:n.labelHidePassword,labelClear:n.labelClear,iconShowPassword:n.iconShowPassword,iconHidePassword:n.iconHidePassword}},render(){let o=null;switch(t){case a.SEARCH:{const{onClear:r}=this.$attrs;o=[e.h(J,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:r})];break}case a.PASSWORD:{const{onTogglePassword:r}=this.$attrs;o=[e.h(Y,{disabled:this.isDisabled,onTogglePassword:r,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case a.NUMBER:{const{onStepUp:r,onStepDown:l}=this.$attrs;o=[e.h(V,{mode:"up",disabled:this.isDisabled||n.max!==void 0&&n.modelValue===n.max,label:this.labelStepUp,onStepUp:r,onStepDown:l}),e.h(V,{mode:"down",disabled:this.isDisabled||n.min!==void 0&&n.modelValue===n.min,label:this.labelStepDown,onStepUp:r,onStepDown:l})];break}}return Array.isArray(o)?e.h("div",{class:"vv-input-text__actions-group"},o):o}}}const De=t=>e.computed(()=>String((t==null?void 0:t.value)||re.nanoid()));function Te(t,n,o=0){let r;return typeof o=="string"&&(o=parseInt(o)),e.computed({get:()=>t==null?void 0:t.value,set:l=>{r&&clearTimeout(r),r=setTimeout(()=>{n("update:modelValue",l)},o)}})}function ke(t,n){const{focused:o}=v.useFocus(t);return e.watch(o,r=>{n(r?"focus":"blur",e.unref(t))}),{focused:o}}function Oe(t,n){const o=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===D.before)),r=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===D.after)),l=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.left)),d=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.right)),u=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.top)),_=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.bottom));return{hasIcon:e.computed(()=>typeof(t==null?void 0:t.value)=="string"?{name:t==null?void 0:t.value}:t==null?void 0:t.value),hasIconLeft:l,hasIconRight:d,hasIconTop:u,hasIconBottom:_,hasIconBefore:o,hasIconAfter:r}}function Ne(t,n){const o=e.computed(()=>(e.unref(t)??"").length),r=e.computed(()=>(n==null?void 0:n.lowerLimit)!==void 0&&o.value<(n==null?void 0:n.lowerLimit)?o.value-n.lowerLimit:(n==null?void 0:n.upperLimit)!==void 0&&o.value<(n==null?void 0:n.upperLimit)?n.upperLimit-o.value:0),l=e.computed(()=>(n==null?void 0:n.mode)===!1?"":(n==null?void 0:n.mode)==="limit"&&(n!=null&&n.upperLimit)?`${o.value} / ${n.lowerLimit?`${n.lowerLimit}-`:""}${n.upperLimit}`:(n==null?void 0:n.mode)==="countdown"?r.value===0?void 0:r:o.value);return{length:o,gap:r,formatted:l}}const Re=["for"],Ve={class:"vv-input-text__wrapper"},xe={key:0,class:"vv-input-text__input-before"},He={class:"vv-input-text__inner"},Le=["id"],Me={key:1,class:"vv-input-text__input-after"},$e={key:2,class:"vv-input-text__limit"},je={name:"VvInputText"};return e.defineComponent({...je,props:Pe,emits:Ce,setup(t,{emit:n}){const o=t,r=e.useSlots(),l=e.ref(),{id:d,icon:u,iconPosition:_,label:g,modelValue:m,count:s,valid:i,invalid:b,loading:p}=e.toRefs(o),h=De(d),y=e.computed(()=>`${h.value}-hint`),O=e.computed(()=>o.floating&&P(o.placeholder)?" ":o.placeholder),S=Te(m,n,o.debounce),{focused:C}=ke(l,n),H=v.useElementVisibility(l);e.watch(H,c=>{c&&o.autofocus&&(C.value=!0)});const T=e.ref(!1),N=e.computed(()=>o.type===a.PASSWORD),A=()=>{T.value=!T.value},Ue=e.computed(()=>o.type===a.TIME||o.type===a.DATETIME_LOCAL||o.type===a.DATE||o.type===a.WEEK||o.type===a.MONTH),We=e.computed(()=>o.type===a.NUMBER),G=()=>{$.value&&(l.value.stepUp(),S.value=e.unref(l).value)},Q=()=>{$.value&&(l.value.stepDown(),S.value=e.unref(l).value)},Fe=e.computed(()=>o.type===a.SEARCH),Z=()=>{S.value=void 0},{hasIcon:ee,hasIconBefore:te,hasIconAfter:L}=Oe(u,_),M=e.computed(()=>{switch(o.type){case a.COLOR:return{name:E.COLOR};case a.DATE:case a.DATETIME_LOCAL:case a.WEEK:case a.MONTH:return{name:E.DATE};case a.TIME:return{name:E.TIME};default:return""}}),{formatted:qe}=Ne(S,{mode:o.count,upperLimit:o.maxlength,lowerLimit:o.minlength}),$=e.computed(()=>!o.disabled&&!o.readonly),ze=e.computed(()=>$.value?o.tabindex:-1),ne=e.computed(()=>!P(m)),Ke=e.computed(()=>{if(b.value===!0)return!0;if(i.value===!0)return!1}),{modifiers:Xe}=e.toRefs(o),Ye=z("vv-input-text",Xe,e.computed(()=>({valid:i.value,invalid:b.value,loading:p.value,disabled:o.disabled,readonly:o.readonly,"icon-before":te.value,"icon-after":L.value||!P(M),floating:o.floating&&!P(o.label),dirty:ne.value,focus:C.value}))),Je=e.computed(()=>{const c=(()=>N.value&&T.value||Ue.value&&!ne.value&&!C.value?a.TEXT:o.type)(),f={type:c,name:o.name,tabindex:ze.value,disabled:o.disabled,readonly:o.readonly,required:o.required,autocomplete:o.autocomplete,"aria-invalid":Ke.value,"aria-describedby":!oe.value&&Qe.value?y.value:void 0,"aria-errormessage":oe.value?y.value:void 0};return(c===a.DATE||c===a.MONTH||c===a.WEEK||c===a.TIME||c===a.DATETIME_LOCAL||c===a.NUMBER)&&(f.step=o.step,f.max=String(o.max),f.min=String(o.min)),(c===a.TEXT||c===a.SEARCH||c===a.URL||c===a.TEL||c===a.EMAIL||c===a.PASSWORD||c===a.NUMBER)&&(f.placeholder=O.value),(c===a.TEXT||c===a.SEARCH||c===a.URL||c===a.TEL||c===a.EMAIL||c===a.PASSWORD)&&(f.minlength=o.minlength,f.maxlength=o.maxlength,f.pattern=o.pattern),c===a.EMAIL&&(f.multiple=o.multiple),f}),j=e.computed(()=>({valid:o.valid,invalid:o.invalid,modelValue:o.modelValue,togglePassword:A,stepUp:G,stepDown:Q,clear:Z})),{HintSlot:Ge,hasHint:Qe,hasInvalid:oe}=le(o,r),Ze=x(a.PASSWORD,o),et=x(a.NUMBER,o),tt=x(a.SEARCH,o);return(c,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ye))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(h),class:"vv-input-text__label"},e.toDisplayString(e.unref(g)),9,Re)):e.createCommentVNode("",!0),e.createElementVNode("div",Ve,[c.$slots.before?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(c.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.unref(te)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(ee)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(h),ref_key:"input",ref:l,"onUpdate:modelValue":f[0]||(f[0]=U=>e.isRef(S)?S.value=U:null)},e.unref(Je),{onKeyup:f[1]||(f[1]=U=>n("keyup",U))}),null,16,Le),[[e.vModelDynamic,e.unref(S)]]),e.unref(L)||e.unref(M)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(L)?e.unref(ee):e.unref(M)),null,16)):e.unref(N)?(e.openBlock(),e.createBlock(e.unref(Ze),{key:2,onTogglePassword:A})):e.unref(We)?(e.openBlock(),e.createBlock(e.unref(et),{key:3,onStepUp:G,onStepDown:Q})):e.unref(Fe)?(e.openBlock(),e.createBlock(e.unref(tt),{key:4,onClear:Z})):e.createCommentVNode("",!0)]),c.$slots.after?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(c.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.unref(s)?(e.openBlock(),e.createElementBlock("span",$e,[e.renderSlot(c.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(j))),()=>[e.createTextVNode(e.toDisplayString(e.unref(qe)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(Ge),{id:e.unref(y),class:"vv-input-text__hint"},null,8,["id"])],2))}})});
@@ -49,7 +49,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
49
49
  maxlength: NumberConstructor;
50
50
  placeholder: StringConstructor;
51
51
  required: BooleanConstructor;
52
- label: StringConstructor;
52
+ label: (StringConstructor | NumberConstructor)[];
53
53
  floating: BooleanConstructor;
54
54
  icon: {
55
55
  type: (StringConstructor | ObjectConstructor)[];
@@ -67,7 +67,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
67
67
  };
68
68
  modifiers: import("vue").PropType<string | string[]>;
69
69
  loading: BooleanConstructor;
70
- loadingLabel: StringConstructor;
70
+ loadingLabel: {
71
+ type: StringConstructor;
72
+ default: string;
73
+ };
71
74
  hintLabel: {
72
75
  type: StringConstructor;
73
76
  default: string;
@@ -143,7 +146,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
143
146
  maxlength: NumberConstructor;
144
147
  placeholder: StringConstructor;
145
148
  required: BooleanConstructor;
146
- label: StringConstructor;
149
+ label: (StringConstructor | NumberConstructor)[];
147
150
  floating: BooleanConstructor;
148
151
  icon: {
149
152
  type: (StringConstructor | ObjectConstructor)[];
@@ -161,7 +164,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
161
164
  };
162
165
  modifiers: import("vue").PropType<string | string[]>;
163
166
  loading: BooleanConstructor;
164
- loadingLabel: StringConstructor;
167
+ loadingLabel: {
168
+ type: StringConstructor;
169
+ default: string;
170
+ };
165
171
  hintLabel: {
166
172
  type: StringConstructor;
167
173
  default: string;
@@ -194,6 +200,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
194
200
  required: boolean;
195
201
  iconPosition: import("../../constants.js").Position;
196
202
  loading: boolean;
203
+ loadingLabel: string;
197
204
  multiple: boolean;
198
205
  readonly: boolean;
199
206
  hintLabel: string;
@@ -135,7 +135,11 @@ export declare const VvInputTextProps: {
135
135
  maxlength: NumberConstructor;
136
136
  placeholder: StringConstructor;
137
137
  required: BooleanConstructor;
138
- label: StringConstructor;
138
+ label: (StringConstructor | NumberConstructor)[]; /**
139
+ * Pattern the value must match to be valid
140
+ * Available for input types: text, search, url, tel, email and password
141
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
142
+ */
139
143
  floating: BooleanConstructor;
140
144
  icon: {
141
145
  type: (StringConstructor | ObjectConstructor)[];
@@ -153,7 +157,14 @@ export declare const VvInputTextProps: {
153
157
  };
154
158
  modifiers: PropType<string | string[]>;
155
159
  loading: BooleanConstructor;
156
- loadingLabel: StringConstructor;
160
+ loadingLabel: {
161
+ type: StringConstructor;
162
+ default: string; /**
163
+ * Maximum value
164
+ * Available for input types: date, month, week, time, datetime-local, number, range.
165
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
166
+ */
167
+ };
157
168
  hintLabel: {
158
169
  type: StringConstructor;
159
170
  default: string;
@@ -1,15 +1,72 @@
1
- import { defineComponent as d, openBlock as c, createElementBlock as b, mergeProps as g, unref as e } from "vue";
2
- var o = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(o || {}), s = /* @__PURE__ */ ((t) => (t.topStart = "top-start", t.topEnd = "top-end", t.bottomStart = "bottom-start", t.bottomEnd = "bottom-end", t.leftStart = "left-start", t.leftEnd = "left-end", t.rightStart = "right-start", t.rightEnd = "right-end", t))(s || {}), a = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(a || {});
3
- const m = {
1
+ import { computed as l, unref as s, defineComponent as g, toRefs as b, openBlock as y, createElementBlock as m, mergeProps as S } from "vue";
2
+ var u = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(u || {}), c = /* @__PURE__ */ ((t) => (t.topStart = "top-start", t.topEnd = "top-end", t.bottomStart = "bottom-start", t.bottomEnd = "bottom-end", t.leftStart = "left-start", t.leftEnd = "left-end", t.rightStart = "right-start", t.rightEnd = "right-end", t))(c || {}), p = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(p || {}), i = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(i || {}), f = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(f || {});
3
+ const _ = {
4
+ /**
5
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
6
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
7
+ */
8
+ to: {
9
+ type: [String, Object]
10
+ },
11
+ /**
12
+ * Anchor href
13
+ */
14
+ href: String,
15
+ /**
16
+ * Anchor target
17
+ */
18
+ target: {
19
+ type: String,
20
+ validator: (t) => Object.values(f).includes(t)
21
+ },
22
+ /**
23
+ * Anchor rel
24
+ */
25
+ rel: {
26
+ type: String,
27
+ default: "noopener noreferrer"
28
+ }
29
+ }, j = {
30
+ /**
31
+ * Whether the form control is disabled
32
+ */
33
+ disabled: Boolean
34
+ }, O = {
35
+ /**
36
+ * Whether the item is active
37
+ */
38
+ active: Boolean
39
+ }, B = {
40
+ /**
41
+ * Whether the item is pressed
42
+ */
43
+ pressed: Boolean
44
+ }, h = {
45
+ /**
46
+ * The item label
47
+ */
48
+ label: [String, Number]
49
+ }, E = {
4
50
  /**
5
51
  * Component BEM modifiers
6
52
  */
7
53
  modifiers: [String, Array]
8
54
  };
9
- a.before;
10
- o.bottom;
11
- const v = {
12
- ...m,
55
+ p.before;
56
+ u.bottom;
57
+ ({
58
+ ...j,
59
+ ...h,
60
+ ...B,
61
+ ...O,
62
+ ..._,
63
+ /**
64
+ * Button type
65
+ */
66
+ type: i.button
67
+ });
68
+ const k = {
69
+ ...E,
13
70
  /**
14
71
  * Progress value
15
72
  * This attribute specifies how much of the task that has been completed.
@@ -37,25 +94,38 @@ const v = {
37
94
  type: String,
38
95
  required: !0
39
96
  }
40
- }, y = {
97
+ };
98
+ function N(t, e, o) {
99
+ return l(() => {
100
+ const a = {
101
+ [t]: !0
102
+ }, n = typeof (e == null ? void 0 : e.value) == "string" ? e.value.split(" ") : e == null ? void 0 : e.value;
103
+ return n && Array.isArray(n) && n.forEach((r) => {
104
+ a[`${t}--${r}`] = !0;
105
+ }), o && Object.keys(o.value).forEach((r) => {
106
+ a[`${t}--${r}`] = s(o.value[r]);
107
+ }), a;
108
+ });
109
+ }
110
+ const P = {
41
111
  name: "VvProgress"
42
- }, j = /* @__PURE__ */ d({
43
- ...y,
44
- props: v,
112
+ }, x = /* @__PURE__ */ g({
113
+ ...P,
114
+ props: k,
45
115
  setup(t) {
46
- const r = t, { value: n, max: l, label: i } = toRefs(r), u = computed(() => r.value === void 0), { modifiers: f } = toRefs(r), p = useBemModifiers(
116
+ const e = t, { value: o, max: a, label: n } = b(e), r = l(() => e.value === void 0), { modifiers: d } = b(e), v = N(
47
117
  "vv-progress",
48
- f,
49
- computed(() => ({ indeterminate: u.value }))
118
+ d,
119
+ l(() => ({ indeterminate: r.value }))
50
120
  );
51
- return (B, S) => (c(), b("progress", g({ role: "progressbar" }, {
52
- class: e(p),
53
- ariaLabel: e(i),
54
- max: e(l),
55
- value: e(n)
121
+ return (C, L) => (y(), m("progress", S({ role: "progressbar" }, {
122
+ class: s(v),
123
+ ariaLabel: s(n),
124
+ max: s(a),
125
+ value: s(o)
56
126
  }), null, 16));
57
127
  }
58
128
  });
59
129
  export {
60
- j as default
130
+ x as default
61
131
  };
@@ -1 +1 @@
1
- (function(t,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue")):typeof define=="function"&&define.amd?define(["vue"],r):(t=typeof globalThis<"u"?globalThis:t||self,t.VvProgress=r(t.vue))})(this,function(t){"use strict";var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),s=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(s||{}),o=(e=>(e.before="before",e.after="after",e))(o||{});const a={modifiers:[String,Array]};o.before,r.bottom;const i={...a,value:{type:[Number,String],default:void 0},max:{type:[Number,String]},label:{type:String,required:!0}},f={name:"VvProgress"};return t.defineComponent({...f,props:i,setup(e){const n=e,{value:u,max:l,label:d}=toRefs(n),p=computed(()=>n.value===void 0),{modifiers:c}=toRefs(n),b=useBemModifiers("vv-progress",c,computed(()=>({indeterminate:p.value})));return(g,y)=>(t.openBlock(),t.createElementBlock("progress",t.mergeProps({role:"progressbar"},{class:t.unref(b),ariaLabel:t.unref(d),max:t.unref(l),value:t.unref(u)}),null,16))}})});
1
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.VvProgress=o(e.vue))})(this,function(e){"use strict";var o=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(o||{}),p=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(p||{}),u=(t=>(t.before="before",t.after="after",t))(u||{}),i=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(i||{}),f=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(f||{});const d={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(f).includes(t)},rel:{type:String,default:"noopener noreferrer"}},c={disabled:Boolean},b={active:Boolean},g={pressed:Boolean},y={label:[String,Number]},v={modifiers:[String,Array]};u.before,o.bottom,{...c,...y,...g,...b,...d,type:i.button};const m={...v,value:{type:[Number,String],default:void 0},max:{type:[Number,String]},label:{type:String,required:!0}};function _(t,r,a){return e.computed(()=>{const s={[t]:!0},l=typeof(r==null?void 0:r.value)=="string"?r.value.split(" "):r==null?void 0:r.value;return l&&Array.isArray(l)&&l.forEach(n=>{s[`${t}--${n}`]=!0}),a&&Object.keys(a.value).forEach(n=>{s[`${t}--${n}`]=e.unref(a.value[n])}),s})}const S={name:"VvProgress"};return e.defineComponent({...S,props:m,setup(t){const r=t,{value:a,max:s,label:l}=e.toRefs(r),n=e.computed(()=>r.value===void 0),{modifiers:j}=e.toRefs(r),O=_("vv-progress",j,e.computed(()=>({indeterminate:n.value})));return(h,E)=>(e.openBlock(),e.createElementBlock("progress",e.mergeProps({role:"progressbar"},{class:e.unref(O),ariaLabel:e.unref(l),max:e.unref(s),value:e.unref(a)}),null,16))}})});