@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.
- package/LICENSE +1 -1
- package/README.md +52 -13
- package/dist/Volver.d.ts +5 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +170 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +86 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +434 -251
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
- package/dist/components/VvButton/index.d.ts +22 -67
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +38 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
- package/dist/components/VvCombobox/index.d.ts +18 -13
- package/dist/components/VvDialog/VvDialog.es.js +139 -64
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +6 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +48 -32
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +508 -344
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
- package/dist/components/VvInputText/index.d.ts +13 -2
- package/dist/components/VvProgress/VvProgress.es.js +90 -20
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +305 -125
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +371 -216
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
- package/dist/components/VvSelect/index.d.ts +5 -5
- package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1913 -1521
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +128 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +126 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2102 -1761
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +179 -11
- package/dist/resolvers/unplugin.d.ts +8 -8
- package/dist/resolvers/unplugin.es.js +51 -30
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/package.json +60 -34
- package/src/Volver.ts +12 -5
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvButton/VvButton.vue +31 -114
- package/src/components/VvButton/index.ts +6 -79
- package/src/components/VvCombobox/VvCombobox.vue +54 -42
- package/src/components/VvCombobox/index.ts +11 -9
- package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
- package/src/components/VvDropdown/index.ts +4 -9
- package/src/components/VvSelect/index.ts +2 -4
- package/src/composables/dropdown/useInjectDropdown.ts +1 -1
- package/src/composables/dropdown/useProvideDropdown.ts +7 -9
- package/src/composables/useModifiers.ts +4 -7
- package/src/constants.ts +36 -0
- package/src/props/index.ts +106 -14
- package/src/resolvers/unplugin.ts +81 -48
- package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.stories.mdx +2 -1
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],d):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=d(e.vue,e.vue$1))})(this,function(e,d){"use strict";function _(o){return Array.isArray(o)?o.filter(s=>isString(s)).join(" "):o}function j(o,s){const{invalid:t,valid:l,hint:u,loading:y}=s,{hintLabel:a,modelValue:P,valid:m,validLabel:c,invalid:r,invalidLabel:n,...p}=toRefs(o),i=resolveFieldData(p,"loading"),f=resolveFieldData(p,"loadingLabel"),g=computed(()=>r.value?!!(r.value&&t||n!=null&&n.value&&Array.isArray(n.value)&&n.value.length>0||n!=null&&n.value&&!isEmpty(n)):!1),B=computed(()=>!!(a&&a.value||u)),V=computed(()=>!!(c&&c.value||l)),v=computed(()=>!!(i!=null&&i.value&&y||i!=null&&i.value&&(f!=null&&f.value))),x=computed(()=>B.value||V.value||g.value||v.value);return{hasInvalid:g,hasHint:B,hasValid:V,hasLoading:v,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(w){const k=computed(()=>{const b=toReactive({hintLabel:a,modelValue:P,valid:m,validLabel:c,invalid:r,invalidLabel:n,loading:i,loadingLabel:f,...w.params});return r!=null&&r.value?(t==null?void 0:t(b))||_(n==null?void 0:n.value)||(a==null?void 0:a.value):m!=null&&m.value?(l==null?void 0:l(b))||_(c==null?void 0:c.value)||(a==null?void 0:a.value):i!=null&&i.value?(y==null?void 0:y(b))||_(f==null?void 0:f.value)||(a==null?void 0:a.value):(u==null?void 0:u(b))||_(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:x,hasInvalid:g,hasValid:V,hintContent:k}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const O={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]}},T={name:"VvIcon"},D=e.defineComponent({...T,props:O,setup(o){const s=o,t=ref(!0),l=useVolver(),{modifiers:u}=toRefs(s),y=useBemModifiers("vv-icon",u),a=computed(()=>s.provider||(l==null?void 0:l.provider)),P=computed(()=>{const r=s.name??"",n=`@${a.value}:${s.prefix}:${s.name}`;return d.iconExists(r)?r:d.iconExists(n)?n:(l==null?void 0:l.iconsCollections.find(p=>{const i=`@${a.value}:${p.prefix}:${r}`;if(d.iconExists(i))return i}))||r});function m(r){let n=null;if(typeof window>"u"){const{JSDOM:g}=require("jsdom");n=new g().window}return(n?new n.DOMParser:new window.DOMParser).parseFromString(r,"text/html").querySelector("svg")}function c(r){const n=m(r),p=(n==null?void 0:n.innerHTML.trim())||"";n&&p&&d.addIcon(`@${a.value}:${s.prefix}:${s.name}`,{body:p,height:n.viewBox.baseVal.height,width:n.viewBox.baseVal.width})}return l&&(s.src&&!d.iconExists(`@${a.value}:${s.prefix}:${s.name}`)?(t.value=!1,l.fetchIcon(s.src).then(r=>{r&&(c(r),t.value=!0)}).catch(r=>{throw new Error(`During fetch icon: ${r==null?void 0:r.message}`)})):s.svg&&c(s.svg)),(r,n)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(d.Icon),e.mergeProps({key:0,class:e.unref(y)},{inline:r.inline,width:r.width,height:r.height,horizontalFlip:r.horizontalFlip,verticalFlip:r.verticalFlip,flip:r.flip,rotate:r.rotate,color:r.color,onLoad:r.onLoad,icon:e.unref(P)}),null,16,["class"])):e.createCommentVNode("",!0)}});var N=(o=>(o.left="left",o.right="right",o.top="top",o.bottom="bottom",o))(N||{}),F=(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))(F||{}),E=(o=>(o.before="before",o.after="after",o))(E||{});const z={valid:Boolean,validLabel:[String,Array]},q={invalid:Boolean,invalidLabel:[String,Array]},R={loading:Boolean,loadingLabel:String},H={disabled:Boolean},M={readonly:Boolean},K={modifiers:[String,Array]},U={hintLabel:{type:String,default:""}},W={count:{type:[Boolean,String],default:!1,validator:o=>[!0,!1,"limit","countdown"].includes(o)}},J={debounce:[Number,String]},L={icon:{type:[String,Object]},iconPosition:{type:String,default:E.before,validation:o=>Object.values(E).includes(o)}},G={tabindex:{type:[String,Number],default:0}},Q={floating:Boolean},X={id:[String,Number]};N.bottom;const Y={...{...X,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...G,...H,...M,...z,...q,...U,...R,...K,...W,...J,...L,...Q,minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},Z={hard:"hard",soft:"soft"},ee={true:!0,false:!1,default:"default"},te=["update:modelValue","focus","blur","keyup"],oe={...Y,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:Z.soft},spellcheck:{type:[Boolean,String],default:ee.default},resizable:Boolean},re=["for"],ne={class:"vv-textarea__wrapper"},ae={key:0,class:"vv-textarea__input-before"},se={class:"vv-textarea__inner"},ie=["id"],le={key:1,class:"vv-textarea__input-after"},ce={key:2,class:"vv-textarea__limit"},de={name:"VvTextarea"};return e.defineComponent({...de,props:oe,emits:te,setup(o,{emit:s}){const t=o,l=useSlots(),u=ref(),{id:y,icon:a,iconPosition:P,label:m,modelValue:c,count:r,valid:n,invalid:p,loading:i,modifiers:f}=toRefs(t),g=useUniqueId(y),B=computed(()=>`${g.value}-hint`),V=computed(()=>t.floating&&isEmpty(t.placeholder)?" ":t.placeholder),v=useDebouncedInput(c,s,t.debounce),{hasIcon:x,hasIconBefore:w,hasIconAfter:k}=useComponentIcon(a,P),{focused:b}=useComponentFocus(u,s),ue=useElementVisibility(u);watch(ue,S=>{S&&t.autofocus&&(b.value=!0)});const{formatted:pe}=useTextCount(v,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),fe=computed(()=>!t.disabled&&!t.readonly),me=computed(()=>fe.value?t.tabindex:-1),ge=computed(()=>!isEmpty(c)),he=computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:ye,hasHint:ve,hasInvalid:A}=j(t,l),be=useBemModifiers("vv-textarea",f,computed(()=>({valid:n.value,invalid:p.value,loading:i.value,disabled:t.disabled,readonly:t.readonly,"icon-before":w.value,"icon-after":k.value,floating:t.floating&&!isEmpty(t.label),dirty:ge.value,focused:b.value,resizable:t.resizable}))),Se=computed(()=>({name:t.name,placeholder:V.value,tabindex:me.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":!A.value&&ve.value?B.value:void 0,"aria-errormessage":A.value?B.value:void 0})),I=computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,hintLabel:t.hintLabel,maxlength:t.maxlength,minlength:t.minlength,clear:Be})),Be=()=>{v.value=void 0};return(S,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(be))},[e.unref(m)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(g),class:"vv-textarea__label"},e.toDisplayString(e.unref(m)),9,re)):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[S.$slots.before?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(S.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(I))))])):e.createCommentVNode("",!0),e.createElementVNode("div",se,[e.unref(w)?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,class:"vv-textarea__icon"},e.unref(x)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(g),ref_key:"textarea",ref:u,"onUpdate:modelValue":C[0]||(C[0]=$=>e.isRef(v)?v.value=$:null)},e.unref(Se),{onKeyup:C[1]||(C[1]=$=>s("keyup",$))}),null,16,ie),[[e.vModelText,e.unref(v)]]),e.unref(k)?(e.openBlock(),e.createBlock(D,e.mergeProps({key:1,class:"vv-textarea__icon vv-textarea__icon-after"},e.unref(x)),null,16)):e.createCommentVNode("",!0)]),S.$slots.after?(e.openBlock(),e.createElementBlock("div",le,[e.renderSlot(S.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(I))))])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createElementBlock("span",ce,[e.renderSlot(S.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(I))),()=>[e.createTextVNode(e.toDisplayString(e.unref(pe)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(ye),{id:e.unref(B),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
|
|
1
|
+
(function(e,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("vue"),require("@vueuse/core"),require("@iconify/vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core","@iconify/vue","nanoid"],y):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=y(e.vue,e.core,e.vue$1,e.nanoid))})(this,function(e,y,_,H){"use strict";function A(t,r){if(t&&Object.keys(t).length&&r){if(r.indexOf(".")===-1)return t[r];{const n=r.split(".");let o=t;for(let i=0,u=n.length;i<u;++i){if(t==null)return null;o=o[n[i]]}return o}}else return null}function V(t){return(r=>r==null||r===""||Array.isArray(r)&&r.length===0||!(r instanceof Date)&&typeof r=="object"&&Object.keys(r).length===0)(e.unref(t))}function M(t){return typeof t=="string"||t instanceof String}function x(t){return Array.isArray(t)?t.filter(r=>M(r)).join(" "):t}function K(t,r){const{invalid:n,valid:o,hint:i,loading:u}=r,{hintLabel:s,modelValue:S,valid:f,validLabel:d,invalid:a,invalidLabel:l,...p}=e.toRefs(t),c=A(p,"loading"),m=A(p,"loadingLabel"),g=e.computed(()=>a.value?!!(a.value&&n||l!=null&&l.value&&Array.isArray(l.value)&&l.value.length>0||l!=null&&l.value&&!V(l)):!1),w=e.computed(()=>!!(s&&s.value||i)),k=e.computed(()=>!!(d&&d.value||o)),h=e.computed(()=>!!(c!=null&&c.value&&u||c!=null&&c.value&&(m!=null&&m.value))),I=e.computed(()=>w.value||k.value||g.value||h.value);return{hasInvalid:g,hasHint:w,hasValid:k,hasLoading:h,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(N){const C=e.computed(()=>{const v=y.toReactive({hintLabel:s,modelValue:S,valid:f,validLabel:d,invalid:a,invalidLabel:l,loading:c,loadingLabel:m,...N.params});return a!=null&&a.value?(n==null?void 0:n(v))||x(l==null?void 0:l.value)||(s==null?void 0:s.value):f!=null&&f.value?(o==null?void 0:o(v))||x(d==null?void 0:d.value)||(s==null?void 0:s.value):c!=null&&c.value?(u==null?void 0:u(v))||x(m==null?void 0:m.value)||(s==null?void 0:s.value):(i==null?void 0:i(v))||x(s==null?void 0:s.value)||(s==null?void 0:s.value)});return{isVisible:I,hasInvalid:g,hasValid:k,hintContent:C}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const J={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 b=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(b||{}),D=(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))(D||{}),P=(t=>(t.before="before",t.after="after",t))(P||{}),$=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))($||{}),F=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(F||{});const U=Symbol.for("volver");function W(){return e.inject(U)}function L(t,r,n){return e.computed(()=>{const o={[t]:!0},i=typeof(r==null?void 0:r.value)=="string"?r.value.split(" "):r==null?void 0:r.value;return i&&Array.isArray(i)&&i.forEach(u=>{o[`${t}--${u}`]=!0}),n&&Object.keys(n.value).forEach(u=>{o[`${t}--${u}`]=e.unref(n.value[u])}),o})}const Y={name:"VvIcon"},q=e.defineComponent({...Y,props:J,setup(t){const r=t,n=e.ref(!0),o=W(),{modifiers:i}=e.toRefs(r),u=L("vv-icon",i),s=e.computed(()=>r.provider||(o==null?void 0:o.provider)),S=e.computed(()=>{const a=r.name??"",l=`@${s.value}:${r.prefix}:${r.name}`;return _.iconExists(a)?a:_.iconExists(l)?l:(o==null?void 0:o.iconsCollections.find(p=>{const c=`@${s.value}:${p.prefix}:${a}`;if(_.iconExists(c))return c}))||a});function f(a){let l=null;if(typeof window>"u"){const{JSDOM:g}=require("jsdom");l=new g().window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(a,"text/html").querySelector("svg")}function d(a){const l=f(a),p=(l==null?void 0:l.innerHTML.trim())||"";l&&p&&_.addIcon(`@${s.value}:${r.prefix}:${r.name}`,{body:p,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return o&&(r.src&&!_.iconExists(`@${s.value}:${r.prefix}:${r.name}`)?(n.value=!1,o.fetchIcon(r.src).then(a=>{a&&(d(a),n.value=!0)}).catch(a=>{throw new Error(`During fetch icon: ${a==null?void 0:a.message}`)})):r.svg&&d(r.svg)),(a,l)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(_.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:a.inline,width:a.width,height:a.height,horizontalFlip:a.horizontalFlip,verticalFlip:a.verticalFlip,flip:a.flip,rotate:a.rotate,color:a.color,onLoad:a.onLoad,icon:e.unref(S)}),null,16,["class"])):e.createCommentVNode("",!0)}}),G={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(F).includes(t)},rel:{type:String,default:"noopener noreferrer"}},Q={valid:Boolean,validLabel:[String,Array]},X={invalid:Boolean,invalidLabel:[String,Array]},Z={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},R={disabled:Boolean},ee={active:Boolean},te={pressed:Boolean},z={label:[String,Number]},re={readonly:Boolean},ne={modifiers:[String,Array]},oe={hintLabel:{type:String,default:""}},ae={count:{type:[Boolean,String],default:!1,validator:t=>[!0,!1,"limit","countdown"].includes(t)}},le={debounce:[Number,String]},se={icon:{type:[String,Object]},iconPosition:{type:String,default:P.before,validation:t=>Object.values(P).includes(t)}},ie={tabindex:{type:[String,Number],default:0}},ue={floating:Boolean},ce={id:[String,Number]};b.bottom;const de={...{...ce,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...ie,...R,...re,...Q,...X,...oe,...Z,...ne,...ae,...le,...se,...ue,...z,minlength:Number,maxlength:Number,placeholder:String,required:Boolean};({...R,...z,...te,...ee,...G,type:$.button});const fe={hard:"hard",soft:"soft"},pe={true:!0,false:!1,default:"default"},me=["update:modelValue","focus","blur","keyup"],ge={...de,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:fe.soft},spellcheck:{type:[Boolean,String],default:pe.default},resizable:Boolean},he=t=>e.computed(()=>String((t==null?void 0:t.value)||H.nanoid()));function ye(t,r,n=0){let o;return typeof n=="string"&&(n=parseInt(n)),e.computed({get:()=>t==null?void 0:t.value,set:i=>{o&&clearTimeout(o),o=setTimeout(()=>{r("update:modelValue",i)},n)}})}function be(t,r){const n=e.computed(()=>Boolean((t==null?void 0:t.value)&&r.value===P.before)),o=e.computed(()=>Boolean((t==null?void 0:t.value)&&r.value===P.after)),i=e.computed(()=>Boolean((t==null?void 0:t.value)&&r.value===b.left)),u=e.computed(()=>Boolean((t==null?void 0:t.value)&&r.value===b.right)),s=e.computed(()=>Boolean((t==null?void 0:t.value)&&r.value===b.top)),S=e.computed(()=>Boolean((t==null?void 0:t.value)&&r.value===b.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:i,hasIconRight:u,hasIconTop:s,hasIconBottom:S,hasIconBefore:n,hasIconAfter:o}}function Se(t,r){const{focused:n}=y.useFocus(t);return e.watch(n,o=>{r(o?"focus":"blur",e.unref(t))}),{focused:n}}function ve(t,r){const n=e.computed(()=>(e.unref(t)??"").length),o=e.computed(()=>(r==null?void 0:r.lowerLimit)!==void 0&&n.value<(r==null?void 0:r.lowerLimit)?n.value-r.lowerLimit:(r==null?void 0:r.upperLimit)!==void 0&&n.value<(r==null?void 0:r.upperLimit)?r.upperLimit-n.value:0),i=e.computed(()=>(r==null?void 0:r.mode)===!1?"":(r==null?void 0:r.mode)==="limit"&&(r!=null&&r.upperLimit)?`${n.value} / ${r.lowerLimit?`${r.lowerLimit}-`:""}${r.upperLimit}`:(r==null?void 0:r.mode)==="countdown"?o.value===0?void 0:o:n.value);return{length:n,gap:o,formatted:i}}const Be=["for"],_e={class:"vv-textarea__wrapper"},we={key:0,class:"vv-textarea__input-before"},Pe={class:"vv-textarea__inner"},ke=["id"],Ve={key:1,class:"vv-textarea__input-after"},xe={key:2,class:"vv-textarea__limit"},Ie={name:"VvTextarea"};return e.defineComponent({...Ie,props:ge,emits:me,setup(t,{emit:r}){const n=t,o=e.useSlots(),i=e.ref(),{id:u,icon:s,iconPosition:S,label:f,modelValue:d,count:a,valid:l,invalid:p,loading:c,modifiers:m}=e.toRefs(n),g=he(u),w=e.computed(()=>`${g.value}-hint`),k=e.computed(()=>n.floating&&V(n.placeholder)?" ":n.placeholder),h=ye(d,r,n.debounce),{hasIcon:I,hasIconBefore:N,hasIconAfter:C}=be(s,S),{focused:v}=Se(i,r),Ne=y.useElementVisibility(i);e.watch(Ne,B=>{B&&n.autofocus&&(v.value=!0)});const{formatted:Ce}=ve(h,{mode:n.count,upperLimit:n.maxlength,lowerLimit:n.minlength}),Ee=e.computed(()=>!n.disabled&&!n.readonly),$e=e.computed(()=>Ee.value?n.tabindex:-1),je=e.computed(()=>!V(d)),Oe=e.computed(()=>{if(n.invalid===!0)return!0;if(n.valid===!0)return!1}),{HintSlot:Ae,hasHint:De,hasInvalid:T}=K(n,o),Fe=L("vv-textarea",m,e.computed(()=>({valid:l.value,invalid:p.value,loading:c.value,disabled:n.disabled,readonly:n.readonly,"icon-before":N.value,"icon-after":C.value,floating:n.floating&&!V(n.label),dirty:je.value,focused:v.value,resizable:n.resizable}))),Le=e.computed(()=>({name:n.name,placeholder:k.value,tabindex:$e.value,disabled:n.disabled,readonly:n.readonly,required:n.required,autocomplete:n.autocomplete,minlength:n.minlength,maxlength:n.maxlength,cols:n.cols,rows:n.rows,wrap:n.wrap,spellcheck:n.spellcheck,"aria-invalid":Oe.value,"aria-describedby":!T.value&&De.value?w.value:void 0,"aria-errormessage":T.value?w.value:void 0})),j=e.computed(()=>({valid:n.valid,invalid:n.invalid,modelValue:n.modelValue,hintLabel:n.hintLabel,maxlength:n.maxlength,minlength:n.minlength,clear:qe})),qe=()=>{h.value=void 0};return(B,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe))},[e.unref(f)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(g),class:"vv-textarea__label"},e.toDisplayString(e.unref(f)),9,Be)):e.createCommentVNode("",!0),e.createElementVNode("div",_e,[B.$slots.before?(e.openBlock(),e.createElementBlock("div",we,[e.renderSlot(B.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.createElementVNode("div",Pe,[e.unref(N)?(e.openBlock(),e.createBlock(q,e.mergeProps({key:0,class:"vv-textarea__icon"},e.unref(I)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(g),ref_key:"textarea",ref:i,"onUpdate:modelValue":E[0]||(E[0]=O=>e.isRef(h)?h.value=O:null)},e.unref(Le),{onKeyup:E[1]||(E[1]=O=>r("keyup",O))}),null,16,ke),[[e.vModelText,e.unref(h)]]),e.unref(C)?(e.openBlock(),e.createBlock(q,e.mergeProps({key:1,class:"vv-textarea__icon vv-textarea__icon-after"},e.unref(I)),null,16)):e.createCommentVNode("",!0)]),B.$slots.after?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(B.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.unref(a)?(e.openBlock(),e.createElementBlock("span",xe,[e.renderSlot(B.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(j))),()=>[e.createTextVNode(e.toDisplayString(e.unref(Ce)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(Ae),{id:e.unref(w),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
|
|
@@ -21,7 +21,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
21
21
|
maxlength: NumberConstructor;
|
|
22
22
|
placeholder: StringConstructor;
|
|
23
23
|
required: BooleanConstructor;
|
|
24
|
-
label: StringConstructor;
|
|
24
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
25
25
|
floating: BooleanConstructor;
|
|
26
26
|
icon: {
|
|
27
27
|
type: (StringConstructor | ObjectConstructor)[];
|
|
@@ -39,7 +39,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
39
39
|
};
|
|
40
40
|
modifiers: import("vue").PropType<string | string[]>;
|
|
41
41
|
loading: BooleanConstructor;
|
|
42
|
-
loadingLabel:
|
|
42
|
+
loadingLabel: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
43
46
|
hintLabel: {
|
|
44
47
|
type: StringConstructor;
|
|
45
48
|
default: string;
|
|
@@ -87,7 +90,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
87
90
|
maxlength: NumberConstructor;
|
|
88
91
|
placeholder: StringConstructor;
|
|
89
92
|
required: BooleanConstructor;
|
|
90
|
-
label: StringConstructor;
|
|
93
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
91
94
|
floating: BooleanConstructor;
|
|
92
95
|
icon: {
|
|
93
96
|
type: (StringConstructor | ObjectConstructor)[];
|
|
@@ -105,7 +108,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
105
108
|
};
|
|
106
109
|
modifiers: import("vue").PropType<string | string[]>;
|
|
107
110
|
loading: BooleanConstructor;
|
|
108
|
-
loadingLabel:
|
|
111
|
+
loadingLabel: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
109
115
|
hintLabel: {
|
|
110
116
|
type: StringConstructor;
|
|
111
117
|
default: string;
|
|
@@ -137,6 +143,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
137
143
|
required: boolean;
|
|
138
144
|
iconPosition: import("../../constants.js").Position;
|
|
139
145
|
loading: boolean;
|
|
146
|
+
loadingLabel: string;
|
|
140
147
|
readonly: boolean;
|
|
141
148
|
hintLabel: string;
|
|
142
149
|
invalid: boolean;
|
|
@@ -55,7 +55,7 @@ export declare const VvTextareaProps: {
|
|
|
55
55
|
maxlength: NumberConstructor;
|
|
56
56
|
placeholder: StringConstructor;
|
|
57
57
|
required: BooleanConstructor;
|
|
58
|
-
label: StringConstructor;
|
|
58
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
59
59
|
floating: BooleanConstructor;
|
|
60
60
|
icon: {
|
|
61
61
|
type: (StringConstructor | ObjectConstructor)[];
|
|
@@ -73,10 +73,10 @@ export declare const VvTextareaProps: {
|
|
|
73
73
|
};
|
|
74
74
|
modifiers: import("vue").PropType<string | string[]>;
|
|
75
75
|
loading: BooleanConstructor;
|
|
76
|
-
loadingLabel:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
loadingLabel: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
80
|
hintLabel: {
|
|
81
81
|
type: StringConstructor;
|
|
82
82
|
default: string;
|
|
@@ -1,48 +1,118 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { computed as p, unref as i, defineComponent as b, toRefs as d, openBlock as v, createElementBlock as y, normalizeClass as g, renderSlot as S, createTextVNode as j, toDisplayString as O } from "vue";
|
|
2
|
+
var l = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(l || {}), f = /* @__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))(f || {}), s = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(s || {}), u = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(u || {}), c = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(c || {});
|
|
3
|
+
const B = {
|
|
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(c).includes(t)
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Anchor rel
|
|
24
|
+
*/
|
|
25
|
+
rel: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "noopener noreferrer"
|
|
28
|
+
}
|
|
29
|
+
}, _ = {
|
|
30
|
+
/**
|
|
31
|
+
* Whether the form control is disabled
|
|
32
|
+
*/
|
|
33
|
+
disabled: Boolean
|
|
34
|
+
}, m = {
|
|
35
|
+
/**
|
|
36
|
+
* Whether the item is active
|
|
37
|
+
*/
|
|
38
|
+
active: Boolean
|
|
39
|
+
}, h = {
|
|
40
|
+
/**
|
|
41
|
+
* Whether the item is pressed
|
|
42
|
+
*/
|
|
43
|
+
pressed: Boolean
|
|
44
|
+
}, E = {
|
|
45
|
+
/**
|
|
46
|
+
* The item label
|
|
47
|
+
*/
|
|
48
|
+
label: [String, Number]
|
|
49
|
+
}, k = {
|
|
4
50
|
/**
|
|
5
51
|
* Component BEM modifiers
|
|
6
52
|
*/
|
|
7
53
|
modifiers: [String, Array]
|
|
8
54
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
55
|
+
s.before;
|
|
56
|
+
l.bottom;
|
|
57
|
+
({
|
|
58
|
+
..._,
|
|
59
|
+
...E,
|
|
60
|
+
...h,
|
|
12
61
|
...m,
|
|
62
|
+
...B,
|
|
63
|
+
/**
|
|
64
|
+
* Button type
|
|
65
|
+
*/
|
|
66
|
+
type: u.button
|
|
67
|
+
});
|
|
68
|
+
const C = {
|
|
69
|
+
...k,
|
|
13
70
|
/**
|
|
14
71
|
* Define the tooltip position
|
|
15
72
|
* @default Side.bottom
|
|
16
73
|
*/
|
|
17
74
|
position: {
|
|
18
75
|
type: String,
|
|
19
|
-
default:
|
|
76
|
+
default: l.bottom
|
|
20
77
|
},
|
|
21
78
|
value: {
|
|
22
79
|
type: String
|
|
23
80
|
}
|
|
24
|
-
}
|
|
81
|
+
};
|
|
82
|
+
function $(t, e, r) {
|
|
83
|
+
return p(() => {
|
|
84
|
+
const a = {
|
|
85
|
+
[t]: !0
|
|
86
|
+
}, o = typeof (e == null ? void 0 : e.value) == "string" ? e.value.split(" ") : e == null ? void 0 : e.value;
|
|
87
|
+
return o && Array.isArray(o) && o.forEach((n) => {
|
|
88
|
+
a[`${t}--${n}`] = !0;
|
|
89
|
+
}), r && Object.keys(r.value).forEach((n) => {
|
|
90
|
+
a[`${t}--${n}`] = i(r.value[n]);
|
|
91
|
+
}), a;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const V = /* @__PURE__ */ b({
|
|
25
95
|
__name: "VvTooltip",
|
|
26
|
-
props:
|
|
96
|
+
props: C,
|
|
27
97
|
setup(t) {
|
|
28
|
-
const
|
|
98
|
+
const e = t, { modifiers: r } = d(e), a = $(
|
|
29
99
|
"vv-tooltip",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[
|
|
100
|
+
r,
|
|
101
|
+
p(() => ({
|
|
102
|
+
[e.position]: !0
|
|
33
103
|
}))
|
|
34
104
|
);
|
|
35
|
-
return (
|
|
36
|
-
class:
|
|
105
|
+
return (o, n) => (v(), y("span", {
|
|
106
|
+
class: g(i(a)),
|
|
37
107
|
role: "tooltip",
|
|
38
108
|
inert: ""
|
|
39
109
|
}, [
|
|
40
|
-
|
|
41
|
-
|
|
110
|
+
S(o.$slots, "default", {}, () => [
|
|
111
|
+
j(O(o.value), 1)
|
|
42
112
|
])
|
|
43
113
|
], 2));
|
|
44
114
|
}
|
|
45
115
|
});
|
|
46
116
|
export {
|
|
47
|
-
|
|
117
|
+
V as default
|
|
48
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue")):typeof define=="function"&&define.amd?define(["vue"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTooltip=r(e.vue))})(this,function(e){"use strict";var r=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(r||{}),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||{}),i=(t=>(t.before="before",t.after="after",t))(i||{}),u=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(u||{}),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},y={pressed:Boolean},g={label:[String,Number]},v={modifiers:[String,Array]};i.before,r.bottom,{...c,...g,...y,...b,...d,type:u.button};const S={...v,position:{type:String,default:r.bottom},value:{type:String}};function j(t,o,a){return e.computed(()=>{const s={[t]:!0},n=typeof(o==null?void 0:o.value)=="string"?o.value.split(" "):o==null?void 0:o.value;return n&&Array.isArray(n)&&n.forEach(l=>{s[`${t}--${l}`]=!0}),a&&Object.keys(a.value).forEach(l=>{s[`${t}--${l}`]=e.unref(a.value[l])}),s})}return e.defineComponent({__name:"VvTooltip",props:S,setup(t){const o=t,{modifiers:a}=e.toRefs(o),s=j("vv-tooltip",a,e.computed(()=>({[o.position]:!0})));return(n,l)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(s)),role:"tooltip",inert:""},[e.renderSlot(n.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.value),1)])],2))}})});
|