@volverjs/ui-vue 0.0.2 → 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 (53) hide show
  1. package/auto-imports.d.ts +289 -0
  2. package/dist/components/VvTextarea/VvTextarea.es.js +231 -275
  3. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  4. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  5. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  6. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  7. package/dist/components/VvTooltip/index.d.ts +18 -0
  8. package/dist/components/index.es.js +874 -874
  9. package/dist/components/index.umd.js +1 -1
  10. package/dist/icons.es.js +3 -3
  11. package/dist/icons.umd.js +1 -1
  12. package/dist/index.es.js +554 -554
  13. package/dist/index.umd.js +1 -1
  14. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  15. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  16. package/package.json +27 -20
  17. package/src/assets/icons/detailed.json +1 -1
  18. package/src/assets/icons/normal.json +1 -1
  19. package/src/assets/icons/simple.json +1 -1
  20. package/src/components/VvTextarea/VvTextarea.vue +1 -15
  21. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  22. package/src/components/VvTooltip/index.ts +21 -0
  23. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  24. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  25. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  26. package/src/stories/Badge/Badge.stories.mdx +1 -1
  27. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  28. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  29. package/src/stories/Button/Button.stories.mdx +1 -1
  30. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  31. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  32. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  33. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
  34. package/src/stories/Card/Card.stories.mdx +1 -1
  35. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  36. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  37. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  38. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  39. package/src/stories/Combobox/Combobox.stories.mdx +1 -1
  40. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  41. package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
  42. package/src/stories/Icon/Icon.stories.mdx +1 -1
  43. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  44. package/src/stories/InputText/InputText.stories.mdx +1 -1
  45. package/src/stories/Progress/Progress.stories.mdx +1 -1
  46. package/src/stories/Radio/Radio.stories.mdx +1 -1
  47. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  48. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  49. package/src/stories/Select/Select.stories.mdx +1 -1
  50. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  51. package/src/stories/Tooltip/Tooltip.settings.ts +26 -0
  52. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  53. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
@@ -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,_,b){"use strict";function T(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 l=0,u=t.length;l<u;++l){if(n==null)return null;s=s[t[l]]}return s}}else return null}function x(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 B(n){return Array.isArray(n)?n.filter(r=>O(r)).join(" "):n}function j(n,r){const{invalid:t,valid:s,hint:l,loading:u}=r,{hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:i,...p}=e.toRefs(n),c=T(p,"loading"),f=T(p,"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&&!x(i)):!1),h=e.computed(()=>!!(a&&a.value||l)),S=e.computed(()=>!!(d&&d.value||s)),I=e.computed(()=>!!(c!=null&&c.value&&u||c!=null&&c.value&&(f!=null&&f.value))),V=e.computed(()=>h.value||S.value||y.value||I.value);return{hasInvalid:y,hasHint:h,hasValid:S,hasLoading:I,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(k){const N=e.computed(()=>{const P=_.toReactive({hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:i,loading:c,loadingLabel:f,...k.params});return o!=null&&o.value?(t==null?void 0:t(P))||B(i==null?void 0:i.value)||(a==null?void 0:a.value):m!=null&&m.value?(s==null?void 0:s(P))||B(d==null?void 0:d.value)||(a==null?void 0:a.value):c!=null&&c.value?(u==null?void 0:u(P))||B(f==null?void 0:f.value)||(a==null?void 0:a.value):(l==null?void 0:l(P))||B(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:V,hasInvalid:y,hasValid:S,hintContent:N}},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)),l=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:l,hasIconTop:u,hasIconBottom:a}}function q(n,r){const{focused: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:l=>{s&&clearTimeout(s),s=setTimeout(()=>{r("update:modelValue",l)},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),l=e.computed(()=>(r==null?void 0:r.mode)===!1?"":(r==null?void 0:r.mode)==="limit"&&(r!=null&&r.upperLimit)?`${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:l}}function F(n,r){const t={[`${n}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((l,u)=>{const a=e.unref(r[u])||!1;if(!a)return l;if(u==="modifiers"){const g=Array.isArray(a)?a:a.split(" ");return{...l,...g.reduce((m,d)=>({...m,[`${n}--${E(d)}`]:!0}),{})}}else return{...l,[`${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"},L=e.defineComponent({...K,props:G,setup(n){const r=n,t=e.ref(!0),{modifiers:s}=e.toRefs(r),l=e.inject(Z),{bemCssClasses:u}=F("vv-icon",{modifiers:s}),a=e.computed(()=>r.provider||(l==null?void 0:l.provider)),g=e.computed(()=>{const o=r.name??"",i=`@${a.value}:${r.prefix}:${r.name}`;return b.iconExists(o)?o:b.iconExists(i)?i:(l==null?void 0:l.iconsCollections.find(p=>{const c=`@${a.value}:${p.prefix}:${o}`;if(b.iconExists(c))return c}))||o});function m(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 d(o){const i=m(o),p=(i==null?void 0:i.innerHTML.trim())||"";i&&p&&b.addIcon(`@${a.value}:${r.prefix}:${r.name}`,{body:p,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return l&&(r.src&&!b.iconExists(`@${a.value}:${r.prefix}:${r.name}`)?(t.value=!1,l.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,i)=>t.value?(e.openBlock(),e.createBlock(e.unref(b.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]},R={LEFT:"left",RIGHT:"right"},ne={icon:{type:[String,Object]},iconPosition:{type:String,validation:n=>Object.values(R).includes(n),default:R.RIGHT}},oe={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...X,...Q,...J,...U,...ee,...W,...Y,...te,...re,...ne,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},ae={hard:"hard",soft:"soft"},le={true:!0,false:!1,default:"default"},ie=["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:le.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:ie,setup(n,{emit:r}){const t=n,s=e.useSlots(),l=e.ref(),{icon:u,iconPosition:a,label:g,modelValue:m,count:d,valid:o,invalid:i,loading:p}=e.toRefs(t),c=e.computed(()=>String(t.id||w.nanoid())),f=e.computed(()=>`${c.value}-hint`),y=e.computed(()=>t.floating&&x(t.placeholder)?" ":t.placeholder),h=H(m,r,t.debounce),{hasIcon:S,hasIconLeft:I,hasIconRight:V}=z(u,a),{focused:k}=q(l,r),N=_.useElementVisibility(l);e.watch(N,C=>{C&&t.autofocus&&(k.value=!0)});const{formatted:P}=M(h,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),pe=e.computed(()=>!t.disabled&&!t.readonly),ge=e.computed(()=>pe.value?t.tabindex:-1),he=e.computed(()=>!x(m)),ye=e.computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:be,hasHint:Se,hasInvalid:D}=j(t,s),{bemCssClasses:Pe}=F("vv-textarea",{modifiers:t.modifiers,valid:o,invalid:i,loading:p,disabled:t.disabled,readonly:t.readonly,iconLeft:I,iconRight:V,floating:t.floating&&!x(t.label),dirty:he,focused:k,resizable:t.resizable}),we=e.computed(()=>({name:t.name,placeholder:y.value,tabindex:ge.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":ye.value,"aria-describedby":!D.value&&Se.value?f.value:void 0,"aria-errormessage":D.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:Ie})),Ie=()=>{h.value=void 0};return(C,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Pe))},[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(C.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.unref(I)?(e.openBlock(),e.createBlock(L,e.mergeProps({key:0,class:"vv-textarea__icon-left"},e.unref(S)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(c),ref_key:"textarea",ref:l,"onUpdate:modelValue":v[0]||(v[0]=A=>e.isRef(h)?h.value=A:null)},e.unref(we),{onKeyup:v[1]||(v[1]=A=>r("keyup",A))}),null,16,de),[[e.vModelText,e.unref(h)]]),e.renderSlot(C.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.unref(V)?(e.openBlock(),e.createBlock(L,e.normalizeProps(e.mergeProps({key:0},e.unref(S))),null,16)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("span",fe,[e.renderSlot(C.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.createTextVNode(e.toDisplayString(e.unref(P)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(be),{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))}})});
@@ -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
+ };