@volverjs/ui-vue 0.0.10-beta.13 → 0.0.10-beta.14
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/README.md +2 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/index.es.js +1 -1
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/package.json +1 -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 +1 -1
package/README.md
CHANGED
|
@@ -232,9 +232,10 @@ The following features are planned for the next releases:
|
|
|
232
232
|
- [x] (v0.0.6) `VvAvatar` and `VvAvatarGroup` component;
|
|
233
233
|
- [x] (v0.0.6) Menus, navigation and tabs with `VvNav` and `VvTab`;
|
|
234
234
|
- [x] (v0.0.6) Alerts, notifications and toasts with `VvAlert` and `VvAlertGroup` component;
|
|
235
|
+
- [x] Multiple uploads with `VvInputFile`;
|
|
236
|
+
- [ ] Image crop and file previews;
|
|
235
237
|
- [ ] Loaders with `VvLoader` and `VvSkeleton`;
|
|
236
238
|
- [ ] `VvTable` component with sort, filters, pagination and cell editing;
|
|
237
|
-
- [ ] Multiple uploads, image crop and file previews with `VvInputFile`;
|
|
238
239
|
- [ ] Carousel and galleries with `VvCarousel` component;
|
|
239
240
|
- [ ] Calendar and date picker with `VvCalendar` component.
|
|
240
241
|
|
|
@@ -1334,7 +1334,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1334
1334
|
toReturn = localModelValue.value && Array.isArray(localModelValue.value) ? [...localModelValue.value] : toReturn;
|
|
1335
1335
|
}
|
|
1336
1336
|
for (const file of uploadedFiles) {
|
|
1337
|
-
if (hasMax.value && toReturn.length
|
|
1337
|
+
if (hasMax.value && toReturn.length > hasMax.value) {
|
|
1338
1338
|
break;
|
|
1339
1339
|
}
|
|
1340
1340
|
toReturn.push(file);
|
|
@@ -1 +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))}})}));
|
|
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))}})}));
|
|
@@ -7103,7 +7103,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7103
7103
|
toReturn = localModelValue.value && Array.isArray(localModelValue.value) ? [...localModelValue.value] : toReturn;
|
|
7104
7104
|
}
|
|
7105
7105
|
for (const file of uploadedFiles) {
|
|
7106
|
-
if (hasMax.value && toReturn.length
|
|
7106
|
+
if (hasMax.value && toReturn.length > hasMax.value) {
|
|
7107
7107
|
break;
|
|
7108
7108
|
}
|
|
7109
7109
|
toReturn.push(file);
|