@volverjs/ui-vue 0.0.1 → 0.0.3-beta.2

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 (118) hide show
  1. package/README.md +17 -0
  2. package/auto-imports.d.ts +289 -0
  3. package/dist/components/VvButton/VvButton.es.js +159 -147
  4. package/dist/components/VvButton/VvButton.umd.js +1 -1
  5. package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
  6. package/dist/components/VvButton/index.d.ts +4 -4
  7. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
  8. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  9. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
  10. package/dist/components/VvButtonGroup/index.d.ts +5 -5
  11. package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
  12. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  13. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
  14. package/dist/components/VvCombobox/index.d.ts +13 -1
  15. package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
  16. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  17. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
  18. package/dist/components/VvDropdown/index.d.ts +12 -0
  19. package/dist/components/VvInputText/VvInputText.es.js +221 -213
  20. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  21. package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
  22. package/dist/components/VvInputText/index.d.ts +5 -5
  23. package/dist/components/VvSelect/VvSelect.es.js +186 -167
  24. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  25. package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
  26. package/dist/components/VvSelect/index.d.ts +10 -17
  27. package/dist/components/VvTextarea/VvTextarea.es.js +241 -277
  28. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  29. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
  30. package/dist/components/VvTextarea/index.d.ts +5 -5
  31. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  32. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  33. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  34. package/dist/components/VvTooltip/index.d.ts +18 -0
  35. package/dist/components/index.es.js +1046 -976
  36. package/dist/components/index.umd.js +1 -1
  37. package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
  38. package/dist/composables/group/types/IGroupState.d.ts +1 -1
  39. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  40. package/dist/icons.es.js +3 -3
  41. package/dist/icons.umd.js +1 -1
  42. package/dist/index.es.js +1127 -1057
  43. package/dist/index.umd.js +1 -1
  44. package/dist/props/index.d.ts +35 -4
  45. package/dist/resolvers/unplugin.es.js +26 -24
  46. package/dist/resolvers/unplugin.umd.js +1 -1
  47. package/dist/stories/Button/Button.settings.d.ts +9 -11
  48. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
  49. package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
  50. package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
  51. package/dist/stories/InputText/InputText.settings.d.ts +23 -23
  52. package/dist/stories/Select/Select.settings.d.ts +42 -23
  53. package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
  54. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  55. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  56. package/dist/stories/argTypes.d.ts +50 -1
  57. package/package.json +31 -23
  58. package/src/assets/icons/detailed.json +1 -1
  59. package/src/assets/icons/normal.json +1 -1
  60. package/src/assets/icons/simple.json +1 -1
  61. package/src/components/VvButton/index.ts +28 -10
  62. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
  63. package/src/components/VvButtonGroup/index.ts +3 -6
  64. package/src/components/VvCombobox/VvCombobox.vue +45 -11
  65. package/src/components/VvCombobox/index.ts +6 -0
  66. package/src/components/VvDropdown/VvDropdown.vue +9 -6
  67. package/src/components/VvDropdown/index.ts +11 -1
  68. package/src/components/VvInputText/VvInputText.vue +10 -8
  69. package/src/components/VvSelect/VvSelect.vue +23 -1
  70. package/src/components/VvSelect/index.ts +8 -11
  71. package/src/components/VvTextarea/VvTextarea.vue +9 -21
  72. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  73. package/src/components/VvTooltip/index.ts +21 -0
  74. package/src/composables/group/types/IButtonGroupState.ts +1 -1
  75. package/src/composables/group/types/IGroupState.ts +1 -1
  76. package/src/composables/group/useInjectedGroupState.ts +3 -3
  77. package/src/composables/useTextCount.ts +1 -1
  78. package/src/props/index.ts +33 -15
  79. package/src/resolvers/unplugin.ts +22 -13
  80. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  81. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  82. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  83. package/src/stories/Badge/Badge.stories.mdx +1 -1
  84. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  85. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  86. package/src/stories/Button/Button.settings.ts +2 -7
  87. package/src/stories/Button/Button.stories.mdx +1 -1
  88. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  89. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  90. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +6 -1
  91. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  92. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
  93. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -1
  94. package/src/stories/Card/Card.stories.mdx +1 -1
  95. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  96. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  97. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  98. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  99. package/src/stories/Combobox/Combobox.settings.ts +5 -0
  100. package/src/stories/Combobox/Combobox.stories.mdx +52 -1
  101. package/src/stories/Combobox/Combobox.test.ts +7 -0
  102. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  103. package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
  104. package/src/stories/Dropdown/Dropdown.stories.mdx +18 -1
  105. package/src/stories/Icon/Icon.stories.mdx +1 -1
  106. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  107. package/src/stories/InputText/InputText.stories.mdx +1 -1
  108. package/src/stories/Progress/Progress.stories.mdx +1 -1
  109. package/src/stories/Radio/Radio.stories.mdx +1 -1
  110. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  111. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  112. package/src/stories/Select/Select.settings.ts +9 -23
  113. package/src/stories/Select/Select.stories.mdx +61 -1
  114. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  115. package/src/stories/Tooltip/Tooltip.settings.ts +26 -0
  116. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  117. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
  118. package/src/stories/argTypes.ts +46 -22
@@ -1 +1 @@
1
- (function(e,w){typeof exports=="object"&&typeof module<"u"?module.exports=w(require("vue"),require("nanoid"),require("@vueuse/core"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core","@iconify/vue"],w):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=w(e.vue,e.nanoid,e.core,e.vue$1))})(this,function(e,w,T,S){"use strict";function A(n,r){if(n&&Object.keys(n).length&&r){if(r.indexOf(".")===-1)return n[r];{const t=r.split(".");let s=n;for(let i=0,u=t.length;i<u;++i){if(n==null)return null;s=s[t[i]]}return s}}else return null}function C(n){return(r=>r==null||r===""||Array.isArray(r)&&r.length===0||!(r instanceof Date)&&typeof r=="object"&&Object.keys(r).length===0)(e.unref(n))}function O(n){return typeof n=="string"||n instanceof String}function E(n){var r,t;if(n)return(t=(r=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:r.join("-"))==null?void 0:t.toLowerCase()}function x(n){return Array.isArray(n)?n.filter(r=>O(r)).join(" "):n}function j(n,r){const{invalid:t,valid:s,hint:i,loading:u}=r,{hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:l,...p}=e.toRefs(n),c=A(p,"loading"),f=A(p,"loadingLabel"),y=e.computed(()=>o.value?!!(o.value&&t||l!=null&&l.value&&Array.isArray(l.value)&&l.value.length>0||l!=null&&l.value&&!C(l)):!1),h=e.computed(()=>!!(a&&a.value||i)),b=e.computed(()=>!!(d&&d.value||s)),I=e.computed(()=>!!(c!=null&&c.value&&u||c!=null&&c.value&&(f!=null&&f.value))),B=e.computed(()=>h.value||b.value||y.value||I.value);return{hasInvalid:y,hasHint:h,hasValid:b,hasLoading:I,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(V){const v=e.computed(()=>{const P=T.toReactive({hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:l,loading:c,loadingLabel:f,...V.params});return o!=null&&o.value?(t==null?void 0:t(P))||x(l==null?void 0:l.value)||(a==null?void 0:a.value):m!=null&&m.value?(s==null?void 0:s(P))||x(d==null?void 0:d.value)||(a==null?void 0:a.value):c!=null&&c.value?(u==null?void 0:u(P))||x(f==null?void 0:f.value)||(a==null?void 0:a.value):(i==null?void 0:i(P))||x(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:B,hasInvalid:y,hasValid:b,hintContent:v}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}function z(n,r,t){const s=e.computed(()=>!!(n!=null&&n.value&&r.value==="left"||t!=null&&t.iconLeft)),i=e.computed(()=>!!(n!=null&&n.value&&r.value==="right"||t!=null&&t.iconRight)),u=e.computed(()=>!!(n!=null&&n.value&&r.value==="top"||t!=null&&t.iconTop)),a=e.computed(()=>!!(n!=null&&n.value&&r.value==="bottom"||t!=null&&t.iconBottom));return{hasIcon:e.computed(()=>typeof(n==null?void 0:n.value)=="string"?{name:n==null?void 0:n.value}:n==null?void 0:n.value),hasIconLeft:s,hasIconRight:i,hasIconTop:u,hasIconBottom:a}}function q(n,r){const{focused:t}=T.useFocus(n);return e.watch(t,s=>{r(s?"focus":"blur",e.unref(n))}),{focused:t}}function H(n,r,t=0){let s;return typeof t=="string"&&(t=parseInt(t)),e.computed({get:()=>n==null?void 0:n.value,set:i=>{s&&clearTimeout(s),s=setTimeout(()=>{r("update:modelValue",i)},t)}})}function M(n,r){const t=e.computed(()=>(e.unref(n)??"").length),s=e.computed(()=>(r==null?void 0:r.lowerLimit)!==void 0&&t.value<(r==null?void 0:r.lowerLimit)?t.value-r.lowerLimit:(r==null?void 0:r.upperLimit)!==void 0&&t.value<(r==null?void 0:r.upperLimit)?r.upperLimit-t.value:0),i=e.computed(()=>(r==null?void 0:r.mode)===!1?"":(r==null?void 0:r.mode)==="limit"?`${t.value} / ${r.lowerLimit?`${r.lowerLimit}-`:""}${r.upperLimit}`:(r==null?void 0:r.mode)==="countdown"?s.value===0?void 0:s:t.value);return{length:t,gap:s,formatted:i}}function R(n,r){const t={[`${n}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((i,u)=>{const a=e.unref(r[u])||!1;if(!a)return i;if(u==="modifiers"){const g=Array.isArray(a)?a:a.split(" ");return{...i,...g.reduce((m,d)=>({...m,[`${n}--${E(d)}`]:!0}),{})}}else return{...i,[`${n}--${E(u)}`]:a}},t)||{})}}const Z="ds",G={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]}},K={name:"VvIcon"},D=e.defineComponent({...K,props:G,setup(n){const r=n,t=e.ref(!0),{modifiers:s}=e.toRefs(r),i=e.inject(Z),{bemCssClasses:u}=R("vv-icon",{modifiers:s}),a=e.computed(()=>r.provider||(i==null?void 0:i.provider)),g=e.computed(()=>{const o=r.name??"",l=`@${a.value}:${r.prefix}:${r.name}`;return S.iconExists(o)?o:S.iconExists(l)?l:(i==null?void 0:i.iconsCollections.find(p=>{const c=`@${a.value}:${p.prefix}:${o}`;if(S.iconExists(c))return c}))||o});function m(o){let l=null;if(typeof window>"u"){const{JSDOM:y}=require("jsdom");l=new y().window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(o,"text/html").querySelector("svg")}function d(o){const l=m(o),p=(l==null?void 0:l.innerHTML.trim())||"";l&&p&&S.addIcon(`@${a.value}:${r.prefix}:${r.name}`,{body:p,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return i&&(r.src&&!S.iconExists(`@${a.value}:${r.prefix}:${r.name}`)?(t.value=!1,i.fetchIcon(r.src).then(o=>{o&&(d(o),t.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):r.svg&&d(r.svg)),(o,l)=>t.value?(e.openBlock(),e.createBlock(e.unref(S.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:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(g)}),null,16,["class"])):e.createCommentVNode("",!0)}}),J={valid:Boolean,validLabel:[String,Array]},U={invalid:Boolean,invalidLabel:[String,Array]},W={loading:Boolean,loadingLabel:String},X={disabled:Boolean},Q={readonly:Boolean},Y={modifiers:[String,Array]},ee={hintLabel:{type:String,default:""}},te={count:{type:[Boolean,String],default:!1,validator:n=>[!0,!1,"limit","countdown"].includes(n)}},re={debounce:[Number,String]},F={LEFT:"left",RIGHT:"right"},ne={icon:{type:[String,Object]},iconPosition:{type:String,validation:n=>Object.values(F).includes(n),default:F.RIGHT}},oe={...{id:[String,Number],name:{type:String,required:!0}},...{tabindex:{type:[String,Number],default:0}},...X,...Q,...J,...U,...ee,...W,...Y,...te,...re,...ne,autofocus:Boolean,autocomplete:{type:String,default:"off"},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String,floating:Boolean},ae={hard:"hard",soft:"soft"},ie={true:!0,false:!1,default:"default"},le=["update:modelValue","focus","blur","keyup"],se={...oe,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:ae.soft},spellcheck:{type:[Boolean,String],default:ie.default},resizable:Boolean},ce=["for"],ue={class:"vv-textarea__wrapper"},de=["id"],fe={key:0,class:"vv-textarea__limit"},me={name:"VvTextarea"};return e.defineComponent({...me,props:se,emits:le,setup(n,{emit:r}){const t=n,s=e.useSlots(),i=e.ref(),{icon:u,iconPosition:a,label:g,modelValue:m,count:d,valid:o,invalid:l,loading:p}=e.toRefs(t),c=e.computed(()=>String(t.id||w.nanoid())),f=e.computed(()=>`${c.value}-hint`),y=e.computed(()=>t.floating&&C(t.placeholder)?" ":t.placeholder),h=H(m,r,t.debounce),{hasIcon:b,hasIconLeft:I,hasIconRight:B}=z(u,a),{focused:V}=q(i,r),{formatted:v}=M(h,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),P=e.computed(()=>!t.disabled&&!t.readonly),pe=e.computed(()=>P.value?t.tabindex:-1),ge=e.computed(()=>!C(m)),he=e.computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:ye,hasHint:Se,hasInvalid:L}=j(t,s),{bemCssClasses:be}=R("vv-textarea",{modifiers:t.modifiers,valid:o,invalid:l,loading:p,disabled:t.disabled,readonly:t.readonly,iconLeft:I,iconRight:B,floating:t.floating&&!C(t.label),dirty:ge,focused:V,resizable:t.resizable}),Pe=e.computed(()=>({name:t.name,placeholder:y.value,tabindex:pe.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,minlength:t.minlength,maxlength:t.maxlength,cols:t.cols,rows:t.rows,wrap:t.wrap,spellcheck:t.spellcheck,"aria-invalid":he.value,"aria-describedby":!L.value&&Se.value?f.value:void 0,"aria-errormessage":L.value?f.value:void 0})),_=e.computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,hintLabel:t.hintLabel,maxlength:t.maxlength,minlength:t.minlength,clear:we})),we=()=>{h.value=void 0};return e.onMounted(()=>{t.autofocus&&(V.value=!0)}),(N,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(be))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(c),class:"vv-textarea__label"},e.toDisplayString(e.unref(g)),9,ce)):e.createCommentVNode("",!0),e.createElementVNode("div",ue,[e.renderSlot(N.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.unref(I)?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,class:"vv-textarea__icon-left"},e.unref(b)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(c),ref_key:"textarea",ref:i,"onUpdate:modelValue":k[0]||(k[0]=$=>e.isRef(h)?h.value=$:null)},e.unref(Pe),{onKeyup:k[1]||(k[1]=$=>r("keyup",$))}),null,16,de),[[e.vModelText,e.unref(h)]]),e.renderSlot(N.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.unref(B)?(e.openBlock(),e.createBlock(D,e.normalizeProps(e.mergeProps({key:0},e.unref(b))),null,16)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("span",fe,[e.renderSlot(N.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(ye),{id:e.unref(f),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
1
+ (function(e,V){typeof exports=="object"&&typeof module<"u"?module.exports=V(require("vue"),require("nanoid"),require("@vueuse/core"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core","@iconify/vue"],V):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=V(e.vue,e.nanoid,e.core,e.vue$1))})(this,function(e,V,D,S){"use strict";function A(r,n){if(r&&Object.keys(r).length&&n){if(n.indexOf(".")===-1)return r[n];{const t=n.split(".");let d=r;for(let a=0,c=t.length;a<c;++a){if(r==null)return null;d=d[t[a]]}return d}}else return null}function R(r){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(r))}function O(r){return typeof r=="string"||r instanceof String}function E(r){var n,t;if(r)return(t=(n=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:n.join("-"))==null?void 0:t.toLowerCase()}function w(r){return Array.isArray(r)?r.filter(n=>O(n)).join(" "):r}function j(r,n){const{invalid:t,valid:d,hint:a,loading:c}=n,{hintLabel:s,modelValue:g,valid:p,validLabel:u,invalid:o,invalidLabel:i,...m}=e.toRefs(r),l=A(m,"loading"),f=A(m,"loadingLabel"),y=e.computed(()=>o.value?!!(o.value&&t||i!=null&&i.value&&Array.isArray(i.value)&&i.value.length>0||i!=null&&i.value&&!R(i)):!1),h=e.computed(()=>!!(s&&s.value||a)),b=e.computed(()=>!!(u&&u.value||d)),C=e.computed(()=>!!(l!=null&&l.value&&c||l!=null&&l.value&&(f!=null&&f.value))),B=e.computed(()=>h.value||b.value||y.value||C.value);return{hasInvalid:y,hasHint:h,hasValid:b,hasLoading:C,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(v){const I=e.computed(()=>{const P=D.toReactive({hintLabel:s,modelValue:g,valid:p,validLabel:u,invalid:o,invalidLabel:i,loading:l,loadingLabel:f,...v.params});return o!=null&&o.value?(t==null?void 0:t(P))||w(i==null?void 0:i.value)||(s==null?void 0:s.value):p!=null&&p.value?(d==null?void 0:d(P))||w(u==null?void 0:u.value)||(s==null?void 0:s.value):l!=null&&l.value?(c==null?void 0:c(P))||w(f==null?void 0:f.value)||(s==null?void 0:s.value):(a==null?void 0:a(P))||w(s==null?void 0:s.value)||(s==null?void 0:s.value)});return{isVisible:B,hasInvalid:y,hasValid:b,hintContent:I}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const z="ds",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]}};function H(r,n){const t={[`${r}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(n).reduce((a,c)=>{const s=e.unref(n[c])||!1;if(!s)return a;if(c==="modifiers"){const g=Array.isArray(s)?s:s.split(" ");return{...a,...g.reduce((p,u)=>({...p,[`${r}--${E(u)}`]:!0}),{})}}else return{...a,[`${r}--${E(c)}`]:s}},t)||{})}}const M={name:"VvIcon"},$=e.defineComponent({...M,props:q,setup(r){const n=r,t=e.ref(!0),{modifiers:d}=e.toRefs(n),a=e.inject(z),{bemCssClasses:c}=H("vv-icon",{modifiers:d}),s=e.computed(()=>n.provider||(a==null?void 0:a.provider)),g=e.computed(()=>{const o=n.name??"",i=`@${s.value}:${n.prefix}:${n.name}`;return S.iconExists(o)?o:S.iconExists(i)?i:(a==null?void 0:a.iconsCollections.find(m=>{const l=`@${s.value}:${m.prefix}:${o}`;if(S.iconExists(l))return l}))||o});function p(o){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(o,"text/html").querySelector("svg")}function u(o){const i=p(o),m=(i==null?void 0:i.innerHTML.trim())||"";i&&m&&S.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:m,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return a&&(n.src&&!S.iconExists(`@${s.value}:${n.prefix}:${n.name}`)?(t.value=!1,a.fetchIcon(n.src).then(o=>{o&&(u(o),t.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):n.svg&&u(n.svg)),(o,i)=>t.value?(e.openBlock(),e.createBlock(e.unref(S.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(g)}),null,16,["class"])):e.createCommentVNode("",!0)}}),L={valid:Boolean,validLabel:[String,Array]},Z={invalid:Boolean,invalidLabel:[String,Array]},G={loading:Boolean,loadingLabel:String},K={disabled:Boolean},J={readonly:Boolean},U={modifiers:[String,Array]},W={hintLabel:{type:String,default:""}},X={count:{type:[Boolean,String],default:!1,validator:r=>[!0,!1,"limit","countdown"].includes(r)}},Q={debounce:[Number,String]},T={LEFT:"left",RIGHT:"right"},Y={icon:{type:[String,Object]},iconPosition:{type:String,validation:r=>Object.values(T).includes(r),default:T.RIGHT}},ee={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...K,...J,...L,...Z,...W,...G,...U,...X,...Q,...Y,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},te={hard:"hard",soft:"soft"},ne={true:!0,false:!1,default:"default"},oe=["update:modelValue","focus","blur","keyup"],re={...ee,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:te.soft},spellcheck:{type:[Boolean,String],default:ne.default},resizable:Boolean},se=["for"],ie={class:"vv-textarea__wrapper"},ae=["id"],le={key:0,class:"vv-textarea__limit"},ce={name:"VvTextarea"};return e.defineComponent({...ce,props:re,emits:oe,setup(r,{emit:n}){const t=r,d=useSlots(),a=ref(),{icon:c,iconPosition:s,label:g,modelValue:p,count:u,valid:o,invalid:i,loading:m}=toRefs(t),l=computed(()=>String(t.id||V.nanoid())),f=computed(()=>`${l.value}-hint`),y=computed(()=>t.floating&&isEmpty(t.placeholder)?" ":t.placeholder),h=useDebouncedInput(p,n,t.debounce),{hasIcon:b,hasIconLeft:C,hasIconRight:B}=useComponentIcon(c,s),{focused:v}=useComponentFocus(a,n),I=useElementVisibility(a);watch(I,x=>{x&&t.autofocus&&(v.value=!0)});const{formatted:P}=useTextCount(h,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),de=computed(()=>!t.disabled&&!t.readonly),ue=computed(()=>de.value?t.tabindex:-1),fe=computed(()=>!isEmpty(p)),pe=computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:me,hasHint:ge,hasInvalid:F}=j(t,d),{bemCssClasses:he}=useBemModifiers("vv-textarea",{modifiers:t.modifiers,valid:o,invalid:i,loading:m,disabled:t.disabled,readonly:t.readonly,iconLeft:C,iconRight:B,floating:t.floating&&!isEmpty(t.label),dirty:fe,focused:v,resizable:t.resizable}),ye=computed(()=>({name:t.name,placeholder:y.value,tabindex:ue.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,minlength:t.minlength,maxlength:t.maxlength,cols:t.cols,rows:t.rows,wrap:t.wrap,spellcheck:t.spellcheck,"aria-invalid":pe.value,"aria-describedby":!F.value&&ge.value?f.value:void 0,"aria-errormessage":F.value?f.value:void 0})),_=computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,hintLabel:t.hintLabel,maxlength:t.maxlength,minlength:t.minlength,clear:Se})),Se=()=>{h.value=void 0};return(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(he))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(l),class:"vv-textarea__label"},e.toDisplayString(e.unref(g)),9,se)):e.createCommentVNode("",!0),e.createElementVNode("div",ie,[e.renderSlot(x.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.unref(C)?(e.openBlock(),e.createBlock($,e.mergeProps({key:0,class:"vv-textarea__icon-left"},e.unref(b)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(l),ref_key:"textarea",ref:a,"onUpdate:modelValue":k[0]||(k[0]=N=>e.isRef(h)?h.value=N:null)},e.unref(ye),{onKeyup:k[1]||(k[1]=N=>n("keyup",N))}),null,16,ae),[[e.vModelText,e.unref(h)]]),e.renderSlot(x.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.unref(B)?(e.openBlock(),e.createBlock($,e.normalizeProps(e.mergeProps({key:0},e.unref(b))),null,16)):e.createCommentVNode("",!0)]),e.unref(u)?(e.openBlock(),e.createElementBlock("span",le,[e.renderSlot(x.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.createTextVNode(e.toDisplayString(e.unref(P)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(me),{id:e.unref(f),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
@@ -17,11 +17,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
17
17
  default: string;
18
18
  };
19
19
  resizable: BooleanConstructor;
20
- autofocus: BooleanConstructor;
21
- autocomplete: {
22
- type: StringConstructor;
23
- default: string;
24
- };
25
20
  minlength: NumberConstructor;
26
21
  maxlength: NumberConstructor;
27
22
  placeholder: StringConstructor;
@@ -59,6 +54,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
59
54
  type: (StringConstructor | NumberConstructor)[];
60
55
  default: number;
61
56
  };
57
+ autocomplete: {
58
+ type: StringConstructor;
59
+ default: string;
60
+ };
61
+ autofocus: BooleanConstructor;
62
62
  id: (StringConstructor | NumberConstructor)[];
63
63
  name: {
64
64
  type: StringConstructor;
@@ -83,11 +83,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
83
83
  default: string;
84
84
  };
85
85
  resizable: BooleanConstructor;
86
- autofocus: BooleanConstructor;
87
- autocomplete: {
88
- type: StringConstructor;
89
- default: string;
90
- };
91
86
  minlength: NumberConstructor;
92
87
  maxlength: NumberConstructor;
93
88
  placeholder: StringConstructor;
@@ -125,6 +120,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
125
120
  type: (StringConstructor | NumberConstructor)[];
126
121
  default: number;
127
122
  };
123
+ autocomplete: {
124
+ type: StringConstructor;
125
+ default: string;
126
+ };
127
+ autofocus: BooleanConstructor;
128
128
  id: (StringConstructor | NumberConstructor)[];
129
129
  name: {
130
130
  type: StringConstructor;
@@ -142,9 +142,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
142
142
  invalid: boolean;
143
143
  valid: boolean;
144
144
  tabindex: string | number;
145
- autofocus: boolean;
146
- autocomplete: string;
147
145
  floating: boolean;
146
+ autocomplete: string;
147
+ autofocus: boolean;
148
148
  count: string | boolean;
149
149
  cols: string | number;
150
150
  rows: string | number;
@@ -51,11 +51,6 @@ export declare const VvTextareaProps: {
51
51
  * If true, the textarea will be resizable
52
52
  */
53
53
  resizable: BooleanConstructor;
54
- autofocus: BooleanConstructor;
55
- autocomplete: {
56
- type: StringConstructor;
57
- default: string;
58
- };
59
54
  minlength: NumberConstructor;
60
55
  maxlength: NumberConstructor;
61
56
  placeholder: StringConstructor;
@@ -93,6 +88,11 @@ export declare const VvTextareaProps: {
93
88
  type: (StringConstructor | NumberConstructor)[];
94
89
  default: number;
95
90
  };
91
+ autocomplete: {
92
+ type: StringConstructor;
93
+ default: string;
94
+ };
95
+ autofocus: BooleanConstructor;
96
96
  id: (StringConstructor | NumberConstructor)[];
97
97
  name: {
98
98
  type: StringConstructor;
@@ -0,0 +1,28 @@
1
+ import { defineComponent as i, openBlock as n, createElementBlock as p, normalizeClass as l, unref as a, renderSlot as c } from "vue";
2
+ const f = {
3
+ modifiers: [String, Array]
4
+ }, m = {
5
+ ...f,
6
+ position: {
7
+ type: String,
8
+ default: "bottom"
9
+ }
10
+ }, v = /* @__PURE__ */ i({
11
+ __name: "VvTooltip",
12
+ props: m,
13
+ setup(t) {
14
+ const o = t, { modifiers: s } = toRefs(o), { bemCssClasses: e } = useBemModifiers("vv-tooltip", {
15
+ modifiers: s
16
+ });
17
+ return (r, d) => (n(), p("span", {
18
+ class: l([a(e), `vv-tooltip--${o.position}`]),
19
+ role: "tooltip",
20
+ inert: ""
21
+ }, [
22
+ c(r.$slots, "default")
23
+ ], 2));
24
+ }
25
+ });
26
+ export {
27
+ v as default
28
+ };
@@ -0,0 +1 @@
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?module.exports=e(require("vue")):typeof define=="function"&&define.amd?define(["vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,o.VvTooltip=e(o.vue))})(this,function(o){"use strict";const s={...{modifiers:[String,Array]},position:{type:String,default:"bottom"}};return o.defineComponent({__name:"VvTooltip",props:s,setup(i){const t=i,{modifiers:n}=toRefs(t),{bemCssClasses:r}=useBemModifiers("vv-tooltip",{modifiers:n});return(p,l)=>(o.openBlock(),o.createElementBlock("span",{class:o.normalizeClass([o.unref(r),`vv-tooltip--${t.position}`]),role:"tooltip",inert:""},[o.renderSlot(p.$slots,"default")],2))}})});
@@ -0,0 +1,23 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ position: {
3
+ type: import("vue").PropType<import("@/components/VvTooltip").TooltipPosition>;
4
+ default: import("@/components/VvTooltip").TooltipPosition;
5
+ };
6
+ modifiers: import("vue").PropType<string | string[]>;
7
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ position: {
9
+ type: import("vue").PropType<import("@/components/VvTooltip").TooltipPosition>;
10
+ default: import("@/components/VvTooltip").TooltipPosition;
11
+ };
12
+ modifiers: import("vue").PropType<string | string[]>;
13
+ }>>, {
14
+ position: import("@/components/VvTooltip").TooltipPosition;
15
+ }>, {
16
+ default: (_: {}) => any;
17
+ }>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,18 @@
1
+ import type { PropType } from 'vue';
2
+ export declare enum TooltipPosition {
3
+ left = "left",
4
+ right = "right",
5
+ top = "top",
6
+ bottom = "bottom"
7
+ }
8
+ export declare const VvTooltipProps: {
9
+ /**
10
+ * Define the tooltip position
11
+ * @default TooltipPosition.bottom
12
+ */
13
+ position: {
14
+ type: PropType<TooltipPosition>;
15
+ default: TooltipPosition;
16
+ };
17
+ modifiers: PropType<string | string[]>;
18
+ };