@volverjs/ui-vue 0.0.10-beta.11 → 0.0.10-beta.13
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/auto-imports.d.ts +1 -0
- package/dist/components/VvInputFile/VvInputFile.es.js +1529 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +141 -0
- package/dist/components/VvInputFile/index.d.ts +52 -0
- package/dist/components/VvTab/VvTab.es.js +2 -2
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.es.js +635 -312
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +77 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileModifiers.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +6 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/input-file.d.ts +14 -0
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +13 -1
- 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/VvInputFile/VvInputFile.vue +274 -0
- package/src/components/VvInputFile/index.ts +36 -0
- package/src/components/VvTab/VvTab.vue +2 -2
- package/src/components/index.ts +1 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +90 -0
- package/src/stories/InputFile/InputFileModifiers.stories.ts +51 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +25 -0
- package/src/types/blurhash.ts +21 -0
- package/src/types/index.ts +2 -0
- package/src/types/input-file.ts +16 -0
- package/src/workers/blurhash.ts +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@vueuse/core"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputFile=t(e.vue,e.core,e.vue$1,e.uid)}(this,(function(e,t,l,o){"use strict";const n={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 a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{}),s=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(s||{});const d=Symbol.for("volver"),c=Symbol.for("buttonGroup"),v=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function p(){return e.inject(d)}function m(t,l,o){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{n[`${t}--${l}`]=e.unref(o.value[l])})),n}))}const g=e.defineComponent({name:"VvIcon",props:n,setup(t){const o=t,n=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),a=e.ref(!0),i=p(),{modifiers:r}=e.toRefs(o),u=m("vv-icon",r),s=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=o.name??"",t=`@${s.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const n=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${s.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return n?`@${s.value}:${n.prefix}:${e}`:e}));function c(e){const t=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==t?void 0:t.innerHTML.trim())||"";t&&n&&l.addIcon(`@${s.value}:${o.prefix}:${o.name}`,{body:n,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${s.value}:${o.prefix}:${o.name}`)&&(a.value=!1,i.fetchIcon(o.src).then((e=>{e&&(c(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&c(o.svg),(t,o)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(n),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),b={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(s).includes(e)},rel:{type:String,default:"noopener noreferrer"}},h={valid:Boolean,validLabel:[String,Array]},y={invalid:Boolean,invalidLabel:[String,Array]},S={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},k={disabled:Boolean},B={active:Boolean},L={current:Boolean},V={pressed:Boolean},$={label:[String,Number]},_={modifiers:[String,Array]},w={hintLabel:{type:String,default:""}};i.before;const A={unselectable:{type:Boolean,default:!0}},O={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const x={...k,...$,...V,...B,...L,...b,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:u.button}},C=x;const N=e.defineComponent({name:"VvAction",props:C,emits:["click","mouseover","mouseleave"],setup(t,{expose:l,emit:o}){const n=t,a=p(),i=e.ref(null);l({$el:i});const{reference:r,bus:s,aria:d,expanded:c}=e.inject(v,{});e.watch((()=>i.value),(e=>{r&&(r.value=e)}));const m=e.computed((()=>n.pressed||(null==c?void 0:c.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case n.disabled:return u.button;case void 0!==n.to:return(null==a?void 0:a.nuxt)?u.nuxtLink:u.routerLink;case void 0!==n.href:return u.a;default:return n.defaultTag}})),h=e.computed((()=>{const e={...null==d?void 0:d.value,ariaPressed:!!m.value||void 0,ariaLabel:n.ariaLabel,role:null==g?void 0:g.value};switch(b.value){case u.a:return{...e,href:n.href,target:n.target,rel:n.rel};case u.routerLink:case u.nuxtLink:return{...e,to:n.to,target:n.target};case u.button:return{...e,type:n.type,disabled:n.disabled};default:return e}})),y=e=>{n.disabled?e.preventDefault():(null==s||s.emit("click",e),o("click",e))},S=e=>{null==s||s.emit("mouseover",e),o("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),o("mouseleave",e)};return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(h),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function E(e,t,l){return l?P(e,l)===P(t,l):j(e,t)}function j(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let n,a,i;if(l&&o){if(a=e.length,a!=t.length)return!1;for(n=a;0!=n--;)if(!j(e[n],t[n]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const s=e instanceof RegExp,d=t instanceof RegExp;if(s!=d)return!1;if(s&&d)return e.toString()==t.toString();const c=Object.keys(e);if(a=c.length,a!==Object.keys(t).length)return!1;for(n=a;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,c[n]))return!1;for(n=a;0!=n--;)if(i=c[n],!j(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function P(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function R(e,t){if(null!=e&&t&&t.length)for(const l of t)if(E(e,l))return!0;return!1}function D(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,n){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const a=e.toRef(o,t);return e.computed({get:()=>a.value,set(e){n&&n(`update:${t}`,e)}})}}}const I={...x,...O,..._,...A,...S,icon:[String,Object],iconPosition:{type:String,default:a.left,validator:e=>Object.values(a).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const F=t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))),M={key:1,class:"vv-button__label"},T={key:1,class:"vv-button__label"},z=e.defineComponent({name:"VvButton",props:I,emits:["update:modelValue"],setup(t,{expose:l,emit:o}){const n=t,i=e.useAttrs(),r=e.useSlots(),{id:u,modifiers:s,iconPosition:d,icon:v,label:f,modelValue:p,disabled:b,toggle:h,unselectable:y}=function(t,l){const{group:o,isInGroup:n,getGroupOrLocalRef:a}=D(c),{id:i,iconPosition:r,icon:u,label:s,pressed:d}=e.toRefs(t),v=a("modelValue",t,l),f=a("toggle",t),p=a("unselectable",t),m=e.computed((()=>(null==o?void 0:o.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,l=null==o?void 0:o.value.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),l&&(Array.isArray(l)||(l=l.split(" ")),l.forEach((e=>n.add(e)))),Array.from(n)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==o?void 0:o.value)?void 0:e.disabled.value))}));return{group:o,isInGroup:n,modelValue:v,toggle:f,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:r,icon:u,label:s}}(n,o),S=F(u),k=e.computed((()=>(null==i?void 0:i.name)||S.value)),B=e.ref(null);l({$el:e.computed((()=>{var e;return null==(e=B.value)?void 0:e.$el}))});const L=e.computed((()=>h.value?Array.isArray(p.value)?R(k.value,p.value):E(k.value,p.value):n.pressed)),V=m("vv-button",s,e.computed((()=>({reverse:[a.right,a.bottom].includes(d.value),column:[a.top,a.bottom].includes(d.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==f?void 0:f.value)&&!r.default)})))),$=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),_=e.computed((()=>void 0!==n.value?n.value:k.value)),w=()=>{if(h.value){if(Array.isArray(p.value))return R(_.value,p.value)?void(y.value&&(p.value=p.value.filter((e=>e!==_.value)))):void p.value.push(_.value);if(_.value===p.value&&y.value)return void(p.value=n.uncheckedValue);p.value=_.value}};return(t,l)=>(e.openBlock(),e.createBlock(N,e.mergeProps({disabled:e.unref(b),pressed:e.unref(L),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(S),ref_key:"element",ref:B,class:e.unref(V),onClick:w}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(g,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",M,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(g,e.mergeProps({key:0,class:"vv-button__icon"},e.unref($)),null,16)):e.createCommentVNode("v-if",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("span",T,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}});function q(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const H={..._,...h,...y,...w,...$,...S,name:{type:String},id:{type:String},modelValue:{type:Object,required:!0},max:[Number,String],labelButton:{type:String,default:"Image"},loading:Boolean,accept:String,placeholder:String,multiple:Boolean,iconLeft:String,iconRight:String};const G=["for"],U=["onDragenter","onDragleave","onDrop","onClick"],J={class:"vv-input-file__preview"},K=["src","alt"],Q={class:"vv-input-file__wrapper"},W=["id","placeholder","aria-describedby","aria-invalid","aria-errormessage","multiple","accept","name"],X={class:"vv-input-file__list"},Y={class:"vv-input-file__item-name"},Z={class:"vv-input-file__item-info"},ee=["onClick"];return e.defineComponent({name:"VvInputFile",props:H,emits:["update:modelValue"],setup(l,{emit:o}){const n=l,a=e.useSlots(),i=function(t,l,o){const n=p(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===a.value)return o;const e=a.value,t=l,n=o;return Object.keys(t).reduce(((l,o)=>{const a=n[o];if(l[o]=a,o in e){if(Array.isArray(t[o])){const n=t[o];n.length&&n[0]===a&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===a&&(l[o]=e[o]),"object"==typeof t[o]){let n=t[o].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(l[o]=e[o]):n===a&&(l[o]=e[o])}}return l}),{})}))}("VvInputFile",H,n),{modifiers:r,id:u}=e.toRefs(n),s=F(u),d=e.computed((()=>`${s.value}-hint`)),c=m("vv-input-file",r,e.computed((()=>({dragging:V.value,loading:n.loading,valid:!0===n.valid,invalid:!0===n.invalid,"icon-before":!!n.iconLeft,"icon-after":!!n.iconRight})))),{HintSlot:v,hasHintLabelOrSlot:f,hasInvalidLabelOrSlot:b,hintSlotScope:h}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>q(o.value.invalidLabel))),a=e.computed((()=>q(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),s=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||n.value)))),d=e.computed((()=>!u.value&&!s.value&&Boolean(o.value.valid&&(l.valid||a.value)))),c=e.computed((()=>!u.value&&!s.value&&!d.value&&Boolean(l.hint||r.value))),v=e.computed((()=>s.value||d.value||u.value||c.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,l,o,n,a,i,r,u;if(this.isVisible){let s;return this.hasInvalidLabelOrSlot&&(s="alert"),this.hasValidLabelOrSlot&&(s="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:s},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:s},(null==(n=(o=this.$slots).invalid)?void 0:n.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:s},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??this.validLabel):e.h(this.tag,{role:s},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}(i,a),y=t.useVModel(n,"modelValue",o),S=e.computed((()=>{var e;return y.value&&(Array.isArray(y.value)||(null==(e=y.value)?void 0:e.name))?Array.isArray(y.value)?y.value:[y.value]:[]})),k=e.computed((()=>"string"==typeof n.max?parseInt(n.max):n.max)),B=e.computed((()=>{var e;return null==(e=null==r?void 0:r.value)?void 0:e.includes("drop-area")})),L=e.computed((()=>!!n.multiple&&(!k.value||k.value-S.value.length>1))),V=e.ref(!1),$=e.ref(),_=()=>{V.value=!0},w=()=>{V.value=!1},A=e=>{var t,l;(null==(t=e.dataTransfer)?void 0:t.files)&&(V.value=!1,x(null==(l=e.dataTransfer)?void 0:l.files))},O=()=>{var e;(null==(e=$.value)?void 0:e.files)&&(x($.value.files),$.value.value="")},x=e=>{if(!n.multiple)return Array.isArray(y.value)?void(y.value=[...e]):void(y.value=e[0]);let t=[];t=!Array.isArray(y.value)&&y.value?[y.value]:y.value&&Array.isArray(y.value)?[...y.value]:t;for(const l of e){if(k.value&&t.length>=k.value)break;t.push(l)}y.value=t},C=()=>{$.value&&$.value.click()},N=e.computed((()=>{if(0!==S.value.length)return S.value[0]instanceof File?URL.createObjectURL(S.value[0]):S.value[0].url}));e.onBeforeUnmount((()=>{N.value&&URL.revokeObjectURL(N.value)}));const E=e=>{if(e)return Math.floor(e/1024)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(c))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(s)},e.toDisplayString(t.label),9,G)):e.createCommentVNode("v-if",!0),B.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vv-input-file__drop-area",onDragenter:e.withModifiers(_,["prevent","stop"]),onDragleave:e.withModifiers(w,["prevent","stop"]),onDrop:e.withModifiers(A,["prevent","stop"]),onDragover:l[0]||(l[0]=e.withModifiers((()=>{}),["prevent","stop"])),onClick:e.withModifiers(C,["stop"])},[e.renderSlot(t.$slots,"drop-area",{},(()=>[e.createVNode(z,{modifiers:"action","aria-label":"upload",label:N.value?void 0:t.labelButton,class:e.normalizeClass([{"absolute top-8 right-8":N.value},"z-1"]),icon:N.value?"edit":"image",onClick:e.withModifiers(C,["stop"])},null,8,["label","class","icon","onClick"]),e.createElementVNode("picture",J,[N.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:N.value,alt:S.value[0].name},null,8,K)):e.createCommentVNode("v-if",!0)])]))],40,U)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Q,[t.iconLeft?(e.openBlock(),e.createBlock(g,{key:0,name:t.iconLeft},null,8,["name"])):e.createCommentVNode("v-if",!0),e.createElementVNode("input",{id:e.unref(s),ref_key:"inputEl",ref:$,placeholder:t.placeholder,"aria-describedby":e.unref(f)?d.value:void 0,"aria-invalid":t.invalid,"aria-errormessage":e.unref(b)?d.value:void 0,multiple:L.value,accept:t.accept,type:"file",name:t.name,onChange:O},null,40,W),t.iconRight?(e.openBlock(),e.createBlock(g,{key:1,name:t.iconRight},null,8,["name"])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("ul",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,((t,l)=>(e.openBlock(),e.createElementBlock("li",{key:l,class:"vv-input-file__item"},[e.createVNode(g,{class:"vv-input-file__item-icon",name:"akar-icons:file"}),e.createElementVNode("div",Y,e.toDisplayString(t.name),1),e.createElementVNode("small",Z,e.toDisplayString(E(t.size))+" KB ",1),e.createElementVNode("button",{type:"button",class:"vv-input-file__item-remove",title:"Remove","aria-label":"remove-file",onClick:e.withModifiers((e=>(e=>{if(!Array.isArray(y.value))return void(y.value=void 0);const t=[...y.value];t.splice(e,1),y.value=t})(l)),["stop"])},null,8,ee)])))),128))]),e.createVNode(e.unref(v),{id:d.value,class:"vv-input-file__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
name: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
};
|
|
5
|
+
id: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: globalThis.PropType<{
|
|
10
|
+
name: string;
|
|
11
|
+
size: number;
|
|
12
|
+
type: string;
|
|
13
|
+
url: string;
|
|
14
|
+
lastModified?: number | undefined;
|
|
15
|
+
} | File | ({
|
|
16
|
+
name: string;
|
|
17
|
+
size: number;
|
|
18
|
+
type: string;
|
|
19
|
+
url: string;
|
|
20
|
+
lastModified?: number | undefined;
|
|
21
|
+
} | File)[]>;
|
|
22
|
+
required: boolean;
|
|
23
|
+
};
|
|
24
|
+
max: (StringConstructor | NumberConstructor)[];
|
|
25
|
+
labelButton: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
loading: BooleanConstructor;
|
|
30
|
+
accept: StringConstructor;
|
|
31
|
+
placeholder: StringConstructor;
|
|
32
|
+
multiple: BooleanConstructor;
|
|
33
|
+
iconLeft: StringConstructor;
|
|
34
|
+
iconRight: StringConstructor;
|
|
35
|
+
loadingLabel: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
40
|
+
hintLabel: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
invalid: BooleanConstructor;
|
|
45
|
+
invalidLabel: (ArrayConstructor | StringConstructor)[];
|
|
46
|
+
valid: BooleanConstructor;
|
|
47
|
+
validLabel: (ArrayConstructor | StringConstructor)[];
|
|
48
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
49
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
50
|
+
"update:modelValue": (args_0: File | undefined) => void;
|
|
51
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
52
|
+
name: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
};
|
|
55
|
+
id: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
};
|
|
58
|
+
modelValue: {
|
|
59
|
+
type: globalThis.PropType<{
|
|
60
|
+
name: string;
|
|
61
|
+
size: number;
|
|
62
|
+
type: string;
|
|
63
|
+
url: string;
|
|
64
|
+
lastModified?: number | undefined;
|
|
65
|
+
} | File | ({
|
|
66
|
+
name: string;
|
|
67
|
+
size: number;
|
|
68
|
+
type: string;
|
|
69
|
+
url: string;
|
|
70
|
+
lastModified?: number | undefined;
|
|
71
|
+
} | File)[]>;
|
|
72
|
+
required: boolean;
|
|
73
|
+
};
|
|
74
|
+
max: (StringConstructor | NumberConstructor)[];
|
|
75
|
+
labelButton: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
loading: BooleanConstructor;
|
|
80
|
+
accept: StringConstructor;
|
|
81
|
+
placeholder: StringConstructor;
|
|
82
|
+
multiple: BooleanConstructor;
|
|
83
|
+
iconLeft: StringConstructor;
|
|
84
|
+
iconRight: StringConstructor;
|
|
85
|
+
loadingLabel: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
90
|
+
hintLabel: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
invalid: BooleanConstructor;
|
|
95
|
+
invalidLabel: (ArrayConstructor | StringConstructor)[];
|
|
96
|
+
valid: BooleanConstructor;
|
|
97
|
+
validLabel: (ArrayConstructor | StringConstructor)[];
|
|
98
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
99
|
+
}>> & {
|
|
100
|
+
"onUpdate:modelValue"?: ((args_0: File | undefined) => any) | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
valid: boolean;
|
|
103
|
+
invalid: boolean;
|
|
104
|
+
multiple: boolean;
|
|
105
|
+
loading: boolean;
|
|
106
|
+
loadingLabel: string;
|
|
107
|
+
hintLabel: string;
|
|
108
|
+
labelButton: string;
|
|
109
|
+
}, {}>, {
|
|
110
|
+
"drop-area"?(_: {}): any;
|
|
111
|
+
hint?(_: {
|
|
112
|
+
modelValue: unknown;
|
|
113
|
+
valid: boolean;
|
|
114
|
+
invalid: boolean;
|
|
115
|
+
loading: boolean;
|
|
116
|
+
}): any;
|
|
117
|
+
loading?(_: {
|
|
118
|
+
modelValue: unknown;
|
|
119
|
+
valid: boolean;
|
|
120
|
+
invalid: boolean;
|
|
121
|
+
loading: boolean;
|
|
122
|
+
}): any;
|
|
123
|
+
valid?(_: {
|
|
124
|
+
modelValue: unknown;
|
|
125
|
+
valid: boolean;
|
|
126
|
+
invalid: boolean;
|
|
127
|
+
loading: boolean;
|
|
128
|
+
}): any;
|
|
129
|
+
invalid?(_: {
|
|
130
|
+
modelValue: unknown;
|
|
131
|
+
valid: boolean;
|
|
132
|
+
invalid: boolean;
|
|
133
|
+
loading: boolean;
|
|
134
|
+
}): any;
|
|
135
|
+
}>;
|
|
136
|
+
export default _default;
|
|
137
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
138
|
+
new (): {
|
|
139
|
+
$slots: S;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type VvInputFileEvents = {
|
|
2
|
+
'update:modelValue': [File | undefined];
|
|
3
|
+
};
|
|
4
|
+
export declare const VvInputFileProps: {
|
|
5
|
+
name: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
};
|
|
8
|
+
id: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
};
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: globalThis.PropType<{
|
|
13
|
+
name: string;
|
|
14
|
+
size: number;
|
|
15
|
+
type: string;
|
|
16
|
+
url: string;
|
|
17
|
+
lastModified?: number | undefined;
|
|
18
|
+
} | File | ({
|
|
19
|
+
name: string;
|
|
20
|
+
size: number;
|
|
21
|
+
type: string;
|
|
22
|
+
url: string;
|
|
23
|
+
lastModified?: number | undefined;
|
|
24
|
+
} | File)[]>;
|
|
25
|
+
required: boolean;
|
|
26
|
+
};
|
|
27
|
+
max: (StringConstructor | NumberConstructor)[];
|
|
28
|
+
labelButton: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
loading: BooleanConstructor;
|
|
33
|
+
accept: StringConstructor;
|
|
34
|
+
placeholder: StringConstructor;
|
|
35
|
+
multiple: BooleanConstructor;
|
|
36
|
+
iconLeft: StringConstructor;
|
|
37
|
+
iconRight: StringConstructor;
|
|
38
|
+
loadingLabel: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
43
|
+
hintLabel: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
invalid: BooleanConstructor;
|
|
48
|
+
invalidLabel: (ArrayConstructor | StringConstructor)[];
|
|
49
|
+
valid: BooleanConstructor;
|
|
50
|
+
validLabel: (ArrayConstructor | StringConstructor)[];
|
|
51
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
52
|
+
};
|
|
@@ -584,8 +584,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
584
584
|
modifiers: unref(hasNavModifiers)
|
|
585
585
|
}, { onClick: onNavClick }),
|
|
586
586
|
{
|
|
587
|
-
item: withCtx(({ item, index }) => [
|
|
588
|
-
renderSlot(_ctx.$slots, "nav-item", normalizeProps(guardReactiveProps({ item, index })))
|
|
587
|
+
item: withCtx(({ item, data, index }) => [
|
|
588
|
+
renderSlot(_ctx.$slots, "nav-item", normalizeProps(guardReactiveProps({ item, data, index })))
|
|
589
589
|
]),
|
|
590
590
|
_: 3
|
|
591
591
|
/* FORWARDED */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},m={current:Boolean},v={pressed:Boolean},p={label:[String,Number]},f={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...m,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},k={items:{type:Array,default:()=>[]}},g={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},y={...f,...k},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,u=e.inject(l),d=e.ref(null);o({$el:d});const{reference:c,bus:m,aria:v,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const f=e.computed((()=>n.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return(null==u?void 0:u.nuxt)?a.nuxtLink:a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}})),g=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!f.value||void 0,ariaLabel:n.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}})),y=e=>{n.disabled?e.preventDefault():(null==m||m.emit("click",e),r("click",e))},B=e=>{null==m||m.emit("mouseover",e),r("mouseover",e)},_=e=>{null==m||m.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(g),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(f),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),h={class:"vv-nav__item",role:"presentation"},x=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.createVNode(_,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});function S(t,o,r){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{a[`${t}--${o}`]=e.unref(r.value[o])})),a}))}const C=["onClick"],V=e.defineComponent({__name:"VvNav",props:y,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:a}=e.toRefs(r),n=e=>{var t;const a=e.target;if(null==a?void 0:a.dataset.index){const e=parseInt(a.dataset.index),n=null==(t=r.items)?void 0:t[e];if(!n||(null==n?void 0:n.disabled))return;o("click",n)}},l=S("vv-nav",a);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(l))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(n,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},data:r,...a},n)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:n,"data-index":n},a,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:a,data:r,index:n})))])),_:2},1040,["data-index"])))),128))]))],8,C)],2))}});return e.defineComponent({__name:"VvTab",props:g,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,{modifiers:a,items:n}=e.toRefs(r),l=e.computed((()=>n.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),i=e.ref(),s=e.computed({get:()=>{var e;return r.modelValue||i.value||(null==(e=l.value)?void 0:e[0])},set:e=>{i.value=e,o("update:modelValue",e)}}),u=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]})),d=e=>{e.tab&&(s.value=e.tab)},c=e.computed((()=>r.items.map((e=>({current:e.tab===s.value,...e}))))),m=S("vv-tab",a);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m))},[e.createVNode(V,e.mergeProps({items:e.unref(c),modifiers:e.unref(u)},{onClick:d}),{item:e.withCtx((({item:o,index:
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},m={current:Boolean},v={pressed:Boolean},p={label:[String,Number]},f={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...m,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},k={items:{type:Array,default:()=>[]}},g={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},y={...f,...k},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,u=e.inject(l),d=e.ref(null);o({$el:d});const{reference:c,bus:m,aria:v,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const f=e.computed((()=>n.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return(null==u?void 0:u.nuxt)?a.nuxtLink:a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}})),g=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!f.value||void 0,ariaLabel:n.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}})),y=e=>{n.disabled?e.preventDefault():(null==m||m.emit("click",e),r("click",e))},B=e=>{null==m||m.emit("mouseover",e),r("mouseover",e)},_=e=>{null==m||m.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(g),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(f),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),h={class:"vv-nav__item",role:"presentation"},x=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.createVNode(_,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});function S(t,o,r){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{a[`${t}--${o}`]=e.unref(r.value[o])})),a}))}const C=["onClick"],V=e.defineComponent({__name:"VvNav",props:y,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:a}=e.toRefs(r),n=e=>{var t;const a=e.target;if(null==a?void 0:a.dataset.index){const e=parseInt(a.dataset.index),n=null==(t=r.items)?void 0:t[e];if(!n||(null==n?void 0:n.disabled))return;o("click",n)}},l=S("vv-nav",a);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(l))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(n,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},data:r,...a},n)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:n,"data-index":n},a,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:a,data:r,index:n})))])),_:2},1040,["data-index"])))),128))]))],8,C)],2))}});return e.defineComponent({__name:"VvTab",props:g,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,{modifiers:a,items:n}=e.toRefs(r),l=e.computed((()=>n.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),i=e.ref(),s=e.computed({get:()=>{var e;return r.modelValue||i.value||(null==(e=l.value)?void 0:e[0])},set:e=>{i.value=e,o("update:modelValue",e)}}),u=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]})),d=e=>{e.tab&&(s.value=e.tab)},c=e.computed((()=>r.items.map((e=>({current:e.tab===s.value,...e}))))),m=S("vv-tab",a);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m))},[e.createVNode(V,e.mergeProps({items:e.unref(c),modifiers:e.unref(u)},{onClick:d}),{item:e.withCtx((({item:o,data:r,index:a})=>[e.renderSlot(t.$slots,"nav-item",e.normalizeProps(e.guardReactiveProps({item:o,data:r,index:a})))])),_:3},16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),((o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(s)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("v-if",!0)],64)))),128))],2))}})}));
|
|
@@ -31,3 +31,4 @@ export { default as VvSelect } from './VvSelect/VvSelect.vue';
|
|
|
31
31
|
export { default as VvTab } from './VvTab/VvTab.vue';
|
|
32
32
|
export { default as VvTextarea } from './VvTextarea/VvTextarea.vue';
|
|
33
33
|
export { default as VvTooltip } from './VvTooltip/VvTooltip.vue';
|
|
34
|
+
export { default as VvInputFile } from './VvInputFile/VvInputFile.vue';
|