UNPKG

ayovue

Version:

A progressive vue components library designed to simplify and accelerate your web development process.

52 lines (51 loc) 30.8 kB
(function(V,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(V=typeof globalThis<"u"?globalThis:V||self,e(V.ayovue={},V.Vue))})(this,function(V,e){"use strict";const fe={type:String,default:"text",validator(t){return["","text","number","email","password","search","url","tel","date","time","range","color"].includes(t)}},L={type:[String,Number],default:16,validator(t){return Number(t)==t}},pe={type:[Number,String],default:188},F={type:String,default:""},W={type:String,default:()=>"input-"+Math.ceil(Math.random()*1e5)},me={type:[String,Number],default:""},b={type:Boolean,default:!1},K={type:[Boolean,Function],default:!1},ue={type:[String,Array,Object,Number,Date,Boolean],default:""},he={type:Array,default:[]},ye={type:[String,Function],default:"name"},ge={type:[String,Function],default:"value"},be={type:String,default:"name"},ke={type:String,default:"options"},Ve={type:String,default:"100%"},Se={type:String,default:"auto"},P={type:String,default:"primary",validator(t){return["","primary","secondary","warning","danger","success","info"].includes(t)}},Be={type:String,default:"1/1"};function U(t){var l;this.getElementsByClassName("a-ripple").length>0&&((l=this.querySelector(".a-ripple"))==null||l.remove());const a=document.createElement("span");this.appendChild(a);const s=Math.max(this.clientWidth,this.clientHeight);a.style.width=a.style.height=s+"px",a.style.left=t.offsetX-s/2+"px",a.style.top=t.offsetY-s/2+"px",a.classList.add("a-ripple"),a.addEventListener("animationend",()=>{a.remove()})}const q={mounted(t){t.addEventListener("click",U)},beforeUnmount(t){t.removeEventListener("click",U)}},j=e.defineComponent({__name:"AButton",props:{variant:P,size:L,loading:b,outlined:b,raised:b,rounded:b,flat:b,text:b,icon:b,block:b,loaderClass:{type:String,default:"a-loading"}},setup(t){const a=t,s=e.computed(()=>({"a-button":!0,[`a-${a.variant}`]:!0,[a.loaderClass]:a.loading,"a-outlined":a.outlined,"a-raised":a.raised,"a-rounded":a.rounded,"a-flat":a.flat,"a-text":a.text,"a-icon":a.icon,"a-block":a.block}));return(l,y)=>e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(s.value),style:e.normalizeStyle({"font-size":`${t.size}px`}),type:"button"},[e.renderSlot(l.$slots,"default")],6)),[[e.unref(q)]])}}),X=e.defineComponent({__name:"AButtonGroup",props:{size:L,raised:b,rounded:b,flat:b},setup(t){return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"a-button-group":!0,"a-raised":t.raised,"a-rounded":t.rounded,"a-flat":t.flat}),style:e.normalizeStyle({fontSize:t.size+"px"})},[e.renderSlot(a.$slots,"default")],6))}}),Ee=["value","disabled"],Ce={key:0},G=e.defineComponent({__name:"ACheckbox",props:{modelValue:[Boolean,Array],value:{type:[String,Number,Boolean,Array,Object,Date,Function,Symbol]},size:{type:Number,default:16},label:{type:String},variant:{type:String,default:"primary"},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},disabled:Boolean},emits:["update:modelValue","click","change"],setup(t,{emit:a}){const s=t,l=e.computed({get:()=>s.modelValue,set:p=>{a("update:modelValue",p)}}),y=e.computed(()=>({solid:!s.outlined,rounded:s.rounded}));return(p,i)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass({"a-labeled-checkbox":!0,[`a-${s.variant}`]:!0}),style:e.normalizeStyle({fontSize:t.size+"px"})},[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i[0]||(i[0]=d=>l.value=d),class:e.normalizeClass(["a-checkbox",y.value]),value:t.value,onClick:i[1]||(i[1]=d=>p.$emit("click",d)),onChange:i[2]||(i[2]=d=>p.$emit("change",d)),disabled:t.disabled},null,42,Ee),[[e.vModelCheckbox,l.value]]),t.label?(e.openBlock(),e.createElementBlock("span",Ce,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0)],6))}}),Y=e.defineComponent({__name:"ACollapse",props:{open:b},setup(t){const a=e.ref("auto");function s(l){a.value=l.scrollHeight+"px"}return(l,y)=>(e.openBlock(),e.createBlock(e.Transition,{name:"collapse",onEnter:s},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle({"--height":a.value})},[e.renderSlot(l.$slots,"default")],4),[[e.vShow,t.open]])]),_:3}))}}),$e=["onClick","onCancel"],Ne={key:0,class:"a-dialog-header"},we={class:"a-dialog-title"},xe={class:"a-dialog-close"},Te={class:"a-dialog-body"},ze={key:0,class:"a-dialog-footer"},J=e.defineComponent({__name:"ADialog",props:{modelValue:b,title:F,width:{type:String,default:"800px"},closeOnOutsideClick:b,hideHeader:b},emits:["update:modelValue"],setup(t,{expose:a,emit:s}){const l=t,y=e.useSlots(),p=e.ref(null);function i(c){var h;if(l.closeOnOutsideClick){const m=(h=p.value)==null?void 0:h.getBoundingClientRect();m.top<=c.clientY&&c.clientY<=m.top+m.height&&m.left<=c.clientX&&c.clientX<=m.left+m.width||d()}}e.watch(()=>l.modelValue,c=>{var h;c?(h=p.value)==null||h.showModal():d()});function d(){l.modelValue&&s("update:modelValue",!1)}function u(){s("update:modelValue",!0)}return a({close:d,open:u}),(c,h)=>(e.openBlock(),e.createBlock(e.Transition,{name:"dialog",onAfterLeave:h[1]||(h[1]=m=>{var w;return(w=p.value)==null?void 0:w.close()})},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("dialog",{class:"a-dialog",ref_key:"dialogEl",ref:p,onClick:e.withModifiers(i,["stop"]),style:e.normalizeStyle({width:t.width||"500px"}),onCancel:e.withModifiers(d,["prevent"])},[e.renderSlot(c.$slots,"header",{close:d},()=>[t.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",we,e.toDisplayString(t.title),1),e.createElementVNode("div",xe,[e.createElementVNode("div",{class:"a-icon-close a-action-btn",onClick:h[0]||(h[0]=m=>d())})])]))]),e.createElementVNode("div",Te,[e.renderSlot(c.$slots,"default")]),e.unref(y).footer?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(c.$slots,"footer",{close:d})])):e.createCommentVNode("",!0)],44,$e),[[e.vShow,t.modelValue]])]),_:3}))}}),Fe=["type","placeholder","disabled","name"],Q=e.defineComponent({__name:"AInput",props:{type:fe,floatingLabel:F,modelValue:me,size:L,variant:P,clearable:b,placeholder:F,disabled:b,name:W,class:F},emits:["update:modelValue"],setup(t,{expose:a,emit:s}){const l=t,y=e.ref(),p=e.ref(),i=e.ref(!1),d=e.computed(()=>l.modelValue||i.value),u=e.computed(()=>{var C,N,T;return!p.value||!y.value?{}:d.value?{top:"var(--floating-pos-top, -1.5em)",left:"var(--floating-pos-left, 0.15em)",zIndex:"1"}:{top:((C=p.value)==null?void 0:C.offsetTop)+"px",left:((N=p.value)==null?void 0:N.offsetLeft)+"px",height:((T=p.value)==null?void 0:T.clientHeight)+"px"}});function c(){s("update:modelValue","")}const h=e.computed({get(){return l.modelValue},set(C){s("update:modelValue",C)}});function m(){var C;(C=p.value)==null||C.focus()}function w(){var C;(C=p.value)==null||C.blur()}return a({clearValue:c,isFocused:i,focus:m,blur:w}),(C,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"a-input":!0,[`a-${t.variant}`]:!0,"a-input-is-floating":d.value}),ref_key:"inputParentEl",ref:y,style:e.normalizeStyle({fontSize:`${t.size||16}px`})},[t.floatingLabel?(e.openBlock(),e.createElementBlock("span",{key:0,class:"a-fl-label",style:e.normalizeStyle(u.value)},e.toDisplayString(t.floatingLabel),5)):e.createCommentVNode("",!0),e.renderSlot(C.$slots,"prepend"),e.withDirectives(e.createElementVNode("input",e.mergeProps({onFocus:N[0]||(N[0]=T=>i.value=!0),onBlur:N[1]||(N[1]=T=>i.value=!1),ref_key:"inputFieldEl",ref:p,type:t.type,class:"a-input-field",placeholder:t.placeholder,"onUpdate:modelValue":N[2]||(N[2]=T=>h.value=T),disabled:t.disabled,autocomplete:"off",name:t.name},C.$attrs),null,16,Fe),[[e.vModelDynamic,h.value]]),e.renderSlot(C.$slots,"append"),t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:1,class:"a-icon-close a-action-btn",onClick:c})):e.createCommentVNode("",!0)],6))}}),Ae=["id","name","accept","multiple"],De=["for"],_e=[e.createElementVNode("div",{class:"a-file-upload-icon a-icon-upload"},null,-1),e.createElementVNode("div",{class:""},"Drag & Drop files here",-1)],Le={key:1},Me={class:"a-file-mf-item"},Oe=["onClick"],Pe={class:"a-file-mf-item-image"},ve=["src","alt"],Re={key:1,class:"a-file-unknown-file"},He={class:"a-file-mf-name"},je={class:"a-file-mf-size"},Ie={class:"a-file-addmore"},We=["src","alt"],Ke={key:1,class:"a-file-common-preview"},Ue=e.createElementVNode("div",{class:"a-icon-file a-file-thumbnail"},null,-1),qe={class:"a-cf-size"},Xe={class:"a-file-hover-header"},Ge=["for"],Ye={key:0,class:"a-file-hover-footer"},Z=e.defineComponent({__name:"AInputFile",props:{variant:P,size:L,outlined:b,raised:b,rounded:b,accept:F,width:Ve,aspectRatio:Be,name:W,multiple:b},emits:["change","drop"],setup(t,{expose:a,emit:s}){const l=t,y=e.computed(()=>({"a-file":!0,[`a-${l.variant}`]:!0,"a-outlined":l.outlined})),p=e.ref(null);e.ref("");const i=e.ref({raw:null}),d=e.ref([]);function u(f){const S=f.target;!S.files||!S.files[0]||(c(S==null?void 0:S.files),s("change",f))}function c(f){const S=Array.from(f);if(l.multiple)S.forEach(B=>{let x=h(B);x.fileName&&d.value.push(x)});else{let B=h(f[0]);B.fileName&&(i.value=B)}}function h(f){let S={raw:f},B="";f.size>1024*1024?B=Math.ceil(f.size/1024/1024)+"MB":B=Math.ceil(f.size/1024)+"KB";const x=f.name.split(".");if(x.length==1)return S;const v=x[x.length-1];let M=x.slice(0,x.length-1).join("."),R=f.name;R.length>16&&(R=M.slice(0,10)+"..."+M.slice(-3)+"."+v);let H=f.type.split("/")[0];return S.fileSize=B,S.fileName=R,S.fileType=H,S.fileExtension=v,H==="image"&&(S.blobURL=URL.createObjectURL(f)),S}function m(){i.value={raw:null}}function w(){document.querySelector("#"+l.name)}function C(f){var B;f.preventDefault();const S=(B=f.dataTransfer)==null?void 0:B.files;c(S),s("drop",f)}function N(f){d.value.splice(f,1)}function T(){var f;(f=p.value)==null||f.click()}function A(){return g()}function g(){return l.multiple?d.value:i.value}return a({getFile:A,getFiles:g}),(f,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["",y.value]),style:e.normalizeStyle({fontSize:`${t.size||16}px`,width:t.width,aspectRatio:t.aspectRatio}),onDragover:S[0]||(S[0]=e.withModifiers(()=>{},["prevent"])),onDrop:C},[e.createElementVNode("input",{id:t.name,name:t.name,type:"file",class:"a-file-input",onChange:u,ref_key:"fileEl",ref:p,accept:t.accept,multiple:t.multiple,capture:""},null,40,Ae),!t.multiple&&!i.value.raw||t.multiple&&d.value.length===0?(e.openBlock(),e.createElementBlock("label",{key:0,class:"a-file-label",for:t.name},_e,8,De)):(e.openBlock(),e.createElementBlock("div",Le,[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(B,x)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",{class:"a-file-remove a-icon-circle-with-cross",onClick:v=>N(x)},null,8,Oe),e.createElementVNode("div",Pe,[B.fileType=="image"?(e.openBlock(),e.createElementBlock("img",{key:0,src:B.blobURL,alt:`.${B.fileExtension}`,style:{"max-width":"100%"}},null,8,ve)):(e.openBlock(),e.createElementBlock("div",Re,e.toDisplayString(B.fileExtension),1))]),e.createElementVNode("div",He,[e.createElementVNode("div",null,e.toDisplayString(B.fileName),1),e.createElementVNode("div",je,e.toDisplayString(B.fileSize),1)])]))),256)),e.createElementVNode("div",Ie,[e.createVNode(e.unref(j),{variant:"info",outlined:"",onClick:T},{default:e.withCtx(()=>[e.createTextVNode(" Add More ")]),_:1})])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.value.raw&&i.value.fileType==="image"?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value.blobURL,alt:`${i.value.fileName}`,class:"a-file-image-preview"},null,8,We)):(e.openBlock(),e.createElementBlock("div",Ke,[Ue,e.createElementVNode("div",null,e.toDisplayString(i.value.fileName),1),e.createElementVNode("div",qe,e.toDisplayString(i.value.fileSize),1)])),i.value.raw?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["a-file-hover",{"a-file-hover-forced":i.value.fileType!=="image"}])},[e.createElementVNode("div",Xe,[e.createElementVNode("label",{class:"a-icon-pencil",onClick:w,for:t.name},null,8,Ge),e.createElementVNode("div",{class:"a-icon-close a-file-close",click:"resetFile",style:{cursor:"pointer"},onClick:m})]),i.value.fileType==="image"?(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("span",null,e.toDisplayString(i.value.fileName),1),e.createElementVNode("span",null,e.toDisplayString(i.value.fileSize),1)])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))]))],38))}}),Je=["name","value","disabled"],ee=e.defineComponent({__name:"ARadio",props:{name:{type:String,required:!0},modelValue:{type:String,required:!0},label:{type:String},variant:{type:String,default:"primary"},value:{type:String,required:!0},size:{type:Number,default:16},disabled:Boolean,pt:{type:Object,default:()=>({})}},emits:["update:modelValue","click","change"],setup(t,{emit:a}){const s=t,l=e.computed({get:()=>s.modelValue,set:y=>{a("update:modelValue",y)}});return(y,p)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["a-radio",["a-"+t.variant]]),style:e.normalizeStyle({fontSize:t.size+"px"})},[e.withDirectives(e.createElementVNode("input",e.mergeProps({type:"radio",name:t.name,value:t.value,"onUpdate:modelValue":p[0]||(p[0]=i=>l.value=i),disabled:t.disabled},t.pt),null,16,Je),[[e.vModelRadio,l.value]]),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],6))}}),Qe=["aria-activedescendant"],Ze={key:0},et={key:1,class:"a-placeholder"},tt=["onClick"],lt={key:0,class:"a-select-filter d-flex ai-center jc-between"},ot=e.createElementVNode("div",{class:"a-icon-search a-select-search-icon"},null,-1),at=["id","onMouseover","onClick","aria-selected"],nt=["id","onClick","onMouseover","aria-selected"],it={key:0},te=e.defineComponent({__name:"ASelect",props:{variant:P,clearable:b,labelField:ye,valueField:ge,showSearchField:K,floatingLabel:F,modelValue:ue,size:L,isDisabled:K,width:Se,options:he,placeholder:F,autofocus:b,scrollHeight:pe,grouped:b,groupedLabelField:be,groupedOptionsField:ke,groupByField:F,loading:b},emits:["update:modelValue","aChange","blur","focus"],setup(t,{expose:a,emit:s}){const l=t,y=e.computed(()=>({"a-input":!0,"a-select":!0,[`a-${l.variant}`]:!0,"a-input-is-floating":T.value,"a-input-is-disabled":(typeof l.isDisabled=="function"?l.isDisabled(D.value):l.isDisabled)||l.loading,"a-loading":l.loading})),p=e.getCurrentInstance(),i=o=>{let n="";if(Array.isArray(o)){const r=o.map(E=>i(E));n=JSON.stringify(r)}else if(typeof o=="object"&&o!==null){const r={};Object.keys(o).sort().forEach(E=>{r[E]=i(o[E])}),n=JSON.stringify(r)}else n=o;return n},d=e.ref(null),u=e.ref(null),c=e.ref(null),h=e.ref(null),m=e.ref(!1),w=e.ref(!1),C=e.computed(()=>Number(l.scrollHeight||188));function N(){var o;(o=u.value)==null||o.focus(),S(),s("focus")}const T=e.computed(()=>l.modelValue||m.value),A=e.computed(()=>l.grouped||typeof l.options[0]=="object"?"object":"string"),g=e.computed(()=>{let o={};return l.grouped?l.options.forEach(n=>{const r=n[l.groupedLabelField],E=n[l.groupedOptionsField];o[i(r)]={_optionType:"group-title",_label:r},E.forEach($=>{const O=typeof $=="string"?{_value:$}:$;let _=$;l.labelField&&typeof l.labelField=="string"?_=$[l.labelField]:l.labelField&&typeof l.labelField=="function"&&(_=l.labelField($)),l.valueField?typeof l.valueField=="function"?o[i(l.valueField($))]={...O,_label:_}:o[i($[l.valueField])]={...O,_label:_}:o[i($)]={...O,_label:_}})}):A.value==="string"?l.options.forEach(n=>{o[i(n)]=n}):l.options.forEach(n=>{const r=typeof l.labelField=="string"?n[l.labelField]:l.labelField(n);l.valueField?typeof l.valueField=="function"?o[i(l.valueField(n))]={...n,_label:r}:o[i(n[l.valueField])]={...n,_label:r}:o[i(n)]={...n,_label:r}}),o}),f=e.computed(()=>z.value?Object.keys(g.value).filter(o=>A.value==="string"?g.value[o].toLowerCase().indexOf(z.value.toLowerCase())>-1:g.value[o]._label.toLowerCase().indexOf(z.value.toLowerCase())>-1||g.value[o]._optionType==="group-title"):Object.keys(g.value));function S(){var $;m.value=!m.value;const o=c.value,r=(($=c.value)==null?void 0:$.getBoundingClientRect()).top,E=innerHeight-r-o.offsetHeight;w.value=E<Number(l.scrollHeight)}function B(o){setTimeout(()=>{var n;(n=u.value)!=null&&n.contains(document.activeElement)||(m.value=!1),s("blur")},111)}function x(){var o;(o=u.value)==null||o.focus()}function v(o){o.stopPropagation()}function M(o){var r;if(o._optionType==="group-title")return;(r=u.value)==null||r.focus();let n=o;o&&o._value?n=o._value:A.value==="object"&&(l.valueField?typeof l.valueField=="function"?n=l.valueField(o):n=o[l.valueField]:(n={...o},delete n._key,delete n._label)),s("update:modelValue",n),s("aChange",o),m.value=!m.value,wt()}function R(o){o.key==="ArrowDown"?(o.preventDefault(),k.value=k.value<f.value.length-1?k.value+1:0,g.value[f.value[k.value]]._optionType==="group-title"&&(k.value=k.value<f.value.length-1?k.value+1:0),H()):o.key==="ArrowUp"?(o.preventDefault(),k.value=k.value>0?k.value-1:f.value.length-1,g.value[f.value[k.value]]._optionType==="group-title"&&(k.value=k.value>0?k.value-1:f.value.length-1),H()):o.key==="Enter"?k.value>-1?M(g.value[f.value[k.value]]):m.value=!m.value:(o.code.startsWith("Key")||o.code.startsWith("Digit"))&&(setTimeout(()=>{z.value||(z.value=o.key)},0),setTimeout(()=>{var n;(n=d.value)==null||n.focus()},0))}function H(){setTimeout(()=>{var O,_,re;const o=document.querySelector("#a-option"+(p==null?void 0:p.uid)+k.value);var n=(O=h.value)==null?void 0:O.getBoundingClientRect(),r={height:(_=h.value)==null?void 0:_.clientHeight,width:(re=h.value)==null?void 0:re.clientWidth},E=o==null?void 0:o.getBoundingClientRect(),$=E.top>=n.top&&E.bottom<=n.top+r.height;if(!$){const ce=E.top-n.top,de=E.bottom-n.bottom;Math.abs(ce)<Math.abs(de)?h.value.scrollTop+=ce:h.value.scrollTop+=de}},111)}e.onMounted(()=>{l.autofocus&&N()});const k=e.ref(-1),z=e.ref("");e.watch(z,(o,n)=>{k.value=-1});function wt(){z.value=""}function se(o){o.stopPropagation(),s("update:modelValue",""),s("aChange",{})}const xt=e.computed(()=>{var o,n,r;return!c.value||!u.value?{}:T.value?{top:"var(--floating-pos-top, -1.5em)",left:"var(--floating-pos-left, 0.15em)",zIndex:"1"}:{top:((o=c.value)==null?void 0:o.offsetTop)+"px",left:((n=c.value)==null?void 0:n.offsetLeft)+"px",height:((r=c.value)==null?void 0:r.clientHeight)+"px"}}),D=e.computed(()=>{if(A.value==="string"||!l.modelValue)return l.modelValue;const o=i(l.modelValue);return g.value[o]});return a({clearValue:se,isFocused:m,focus:N,blur:B}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(y.value),style:e.normalizeStyle({width:t.width||"auto",fontSize:`${t.size||16}px`}),ref_key:"inputParentEl",ref:u,"aria-label":"Select Box",tabindex:"-1",role:"listbox",onBlur:B,onClick:S,onKeydown:R,"aria-activedescendant":"a-option"+o.$.uid+k.value},[t.floatingLabel?(e.openBlock(),e.createElementBlock("span",{key:0,class:"a-fl-label",style:e.normalizeStyle(xt.value)},e.toDisplayString(t.floatingLabel),5)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"prepend"),e.createElementVNode("div",{ref_key:"inputFieldEl",ref:c,class:"a-input-field a-select-field"},[t.modelValue&&D.value?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(o.$slots,"selected",{selectedOption:D.value},()=>[e.createTextVNode(e.toDisplayString(A.value==="string"?D.value:D.value._label),1)])])):t.floatingLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",et,e.toDisplayString(t.placeholder),1))],512),e.renderSlot(o.$slots,"append"),t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:1,class:"a-icon-close a-action-btn",onClick:e.withModifiers(se,["prevent"])},null,8,tt)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["a-icon-chevron-down a-action-btn",{"a-rotated-180":m.value}])},null,2),e.createVNode(e.Transition,{name:"dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["a-select-dropdown",{"a-select-dropdown-top":w.value}]),onClick:v},[z.value||(typeof t.showSearchField=="function"?t.showSearchField(D.value):t.showSearchField)?(e.openBlock(),e.createElementBlock("div",lt,[ot,e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Search",class:"a-select-filter-input flex-1","onUpdate:modelValue":n[0]||(n[0]=r=>z.value=r),onBlur:x,ref_key:"filterInputEl",ref:d},null,544),[[e.vModelText,z.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"a-select-dropdown-fixed",ref_key:"scrollEl",ref:h,style:e.normalizeStyle({maxHeight:C.value+"px"})},[A.value==="string"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,(r,E)=>(e.openBlock(),e.createElementBlock("div",{id:"a-option"+o.$.uid+E,key:r,class:e.normalizeClass(["a-select-option",{"a-select-option-active":t.modelValue===g.value[r],"a-select-option-hovered":k.value===E}]),onMouseover:$=>k.value=E,onMouseleave:n[1]||(n[1]=$=>k.value=-1),onClick:$=>M(g.value[r]),role:"option",tabindex:"0","aria-selected":t.modelValue===g.value[r]},[e.renderSlot(o.$slots,"option",{option:g.value[r]},()=>[e.createTextVNode(e.toDisplayString(g.value[r]),1)])],42,at))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(f.value,(r,E)=>(e.openBlock(),e.createElementBlock("div",{id:"a-option"+o.$.uid+E,key:r,class:e.normalizeClass(["a-select-option",{"a-select-option-active":D.value==g.value[r],"a-select-option-hovered":k.value===E,"a-select-option-grouped":(l.grouped||l.groupByField)&&g.value[r]._optionType!=="group-title","a-select-option-grouped-title":g.value[r]._optionType==="group-title"}]),onClick:$=>M(g.value[r]),onMouseover:$=>k.value=E,tabindex:"0",onMouseleave:n[2]||(n[2]=$=>k.value=-1),role:"option","aria-selected":D.value==g.value[r]},[g.value[r]._optionType==="group-title"?(e.openBlock(),e.createElementBlock("div",it,e.toDisplayString(g.value[r]._label),1)):e.renderSlot(o.$slots,"option",{key:1,option:g.value[r]},()=>[e.createTextVNode(e.toDisplayString(g.value[r]._label),1)])],42,nt))),128)),f.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"text-center",onClick:n[3]||(n[3]=r=>m.value=!1)}," No option available ")):e.createCommentVNode("",!0)],4)],2),[[e.vShow,m.value]])]),_:3})],46,Qe))}}),le=e.defineComponent({__name:"ASpinner",props:{size:L,variant:P},emits:[],setup(t,{emit:a}){return(s,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`a-loading a-spinner a-${t.variant}`),style:e.normalizeStyle({fontSize:`${t.size||16}px`})},null,6))}}),st=["aria-checked","onKeydown","aria-disabled"],rt={class:"invisible-text"},ct={class:"invisible-text"},dt={class:"a-switch-label-wrapper"},ft={class:"a-switch-label"},pt={class:"a-switch-text"},mt={class:"a-switch-circle"},ut={class:"a-switch-text"},oe=e.defineComponent({__name:"ASwitch",props:{modelValue:{type:Boolean,default:!1},onText:{type:String,default:" "},offText:{type:String,default:" "},onVariation:{type:String,default:"primary"},offVariation:{type:String,default:"secondary"},size:{type:Number,default:16},disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:a}){const s=t,l=()=>{s.disabled||a("update:modelValue",!e.unref(s.modelValue))};return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["a-switch",{[`a-${t.onVariation}`]:t.modelValue,[`a-${t.offVariation}`]:!t.modelValue,"a-switch-off":!t.modelValue}]),tabindex:"0",onClick:l,style:e.normalizeStyle({fontSize:t.size+"px"}),role:"switch","aria-checked":t.modelValue,onKeydown:[e.withKeys(e.withModifiers(l,["prevent"]),["space"]),e.withKeys(e.withModifiers(l,["prevent"]),["enter"])],"aria-disabled":t.disabled},[e.createElementVNode("div",rt,[e.renderSlot(y.$slots,"on",{},()=>[e.createTextVNode(e.toDisplayString(t.onText),1)])]),e.createElementVNode("div",ct,[e.renderSlot(y.$slots,"off",{},()=>[e.createTextVNode(e.toDisplayString(t.offText),1)])]),e.createElementVNode("div",dt,[e.createElementVNode("div",ft,[e.createElementVNode("div",pt,[e.renderSlot(y.$slots,"on",{},()=>[e.createTextVNode(e.toDisplayString(t.onText),1)])]),e.createElementVNode("div",mt,[e.renderSlot(y.$slots,"circle",{},()=>[e.createTextVNode(" ")])]),e.createElementVNode("div",ut,[e.renderSlot(y.$slots,"off",{},()=>[e.createTextVNode(e.toDisplayString(t.offText),1)])])])])],46,st))}}),ht={class:"a-toast-icon"},yt={key:0,class:"a-icon-check"},gt={key:1,class:"a-icon-warning"},bt={key:2,class:"a-icon-danger"},kt={key:3,class:"a-icon-info"},Vt={class:"a-toast-content"},St={class:"a-toast-heading"},Bt=[e.createElementVNode("div",{class:"a-icon-close"},null,-1)],Et=e.defineComponent({__name:"AToast",props:{toast:{type:Object,default:()=>({})}},emits:["close"],setup(t,{emit:a}){const s=t,l=e.computed(()=>({"a-toast":!0}));function y(){a("close",s.toast)}return(p,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.createElementVNode("div",ht,[t.toast.type==="success"?(e.openBlock(),e.createElementBlock("div",yt)):e.createCommentVNode("",!0),t.toast.type==="warning"?(e.openBlock(),e.createElementBlock("div",gt)):e.createCommentVNode("",!0),t.toast.type==="danger"?(e.openBlock(),e.createElementBlock("div",bt)):e.createCommentVNode("",!0),t.toast.type==="info"?(e.openBlock(),e.createElementBlock("div",kt)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vt,[e.createElementVNode("div",St,e.toDisplayString(t.toast.summary),1),e.createElementVNode("div",{class:"a-toast-body",onClick:i[0]||(i[0]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(p.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.toast.detail),1)])])]),e.createElementVNode("div",{class:"a-toast-close",onClick:y},Bt)],2))}}),Ct={class:"a-toasts-container"},$t=["onAnimationend"],ae=e.defineComponent({__name:"AToasts",props:{position:{type:String,default:""},group:{type:String,default:"default"}},setup(t){const a=t,{toasts:s,removeToast:l}=ne(),y=e.computed(()=>Array.from(s).filter(c=>c.group===a.group||a.group==="default"&&!c.group)),p=e.computed(()=>({"a-toasts":!0,[`a-toasts-${a.position}`]:a.position})),i={"top-left":"slide-right","bottom-left":"slide-right","top-center":"slide-bottom","bottom-center":"slide-top"},d=e.computed(()=>i[a.position]||"slide-left");function u(c){l(c)}return(c,h)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",Ct,[e.createVNode(e.TransitionGroup,{name:d.value,tag:"div",class:e.normalizeClass(p.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.$when,class:"p-relative"},[e.createElementVNode("div",{class:e.normalizeClass(["a-toast-type",{[`a-${m.type}`]:!0}]),style:{margin:"16px 11px",position:"relative"}},[e.renderSlot(c.$slots,"default",{toast:m,close:e.unref(l)},()=>[e.createVNode(Et,{toast:m,onClose:e.unref(l)},null,8,["toast","onClose"])]),e.createElementVNode("div",{id:"progress",ref_for:!0,ref:"progress",class:"a-toast-progress",style:e.normalizeStyle({"--animation":`toastprogress ${m.duration/1e3}s`}),onAnimationend:w=>u(m)},null,44,$t)],2)]))),128))]),_:3},8,["name","class"])])]))}}),I=e.reactive(new Set),ne=()=>{function t(s){const l={...s,$when:Date.now()+Math.random()};I.add(l)}function a(s){I.delete(s)}return{toasts:I,showToast:t,removeToast:a}},Nt={mounted:(t,a)=>{if(!document.querySelector("#ayostyle")){const d=`.ayotooltip { background: red; padding: 7px 17px; width: fit-content; max-width: 200px; border-radius: 6px; background-color: #404040; opacity: 0; transition: opacity 1s; color: #f3f3f3; line-height: 1.2; position: fixed; z-index: 999999; } .ayotooltip::after { content: ""; position: absolute; left: calc(50% - 5px); top: -5px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #404040; z-index: 99999999; } .ayotooltip__left::after { left: auto; right: -10px; top: calc(50% - 5px); border-left: 5px solid #404040; border-top: 5px solid transparent; border-bottom: 5px solid transparent; } .ayotooltip__right::after { right: auto; left: -10px; top: calc(50% - 5px); border-right: 5px solid #404040; border-top: 5px solid transparent; border-bottom: 5px solid transparent; } .ayotooltip__top::after { top: auto; bottom: -10px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #404040; border-bottom: 5px solid transparent; } `,u=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.id="ayostyle",u.appendChild(c),c.appendChild(document.createTextNode(d))}const l=document.createElement("div");l.innerHTML=a.value||"Tooltip",l.classList.add("ayotooltip"),a.modifiers.left&&l.classList.add("ayotooltip__left"),a.modifiers.right&&l.classList.add("ayotooltip__right"),a.modifiers.top&&l.classList.add("ayotooltip__top");const y=d=>{document.body.appendChild(l),l.style.opacity="0",setTimeout(()=>{l.style.opacity="0.9"},1);const u=p(t);l.style.left=u.left,l.style.top=u.top},p=d=>{const u=d.getBoundingClientRect();let c="0px";if(a.modifiers.left)c=u.left-l.offsetWidth-10+"px";else if(a.modifiers.right)c=u.left+d.offsetWidth+10+"px";else{const m=u.left+d.offsetWidth/2,C=u.left+l.offsetWidth/2-m;c=u.left-C+"px"}let h="0px";return a.modifiers.top?h=u.top-l.offsetHeight-10+"px":a.modifiers.right||a.modifiers.left?h=u.top-l.offsetHeight/2+d.offsetHeight/2+"px":h=u.top+d.offsetHeight+10+"px",{left:c,top:h}},i=()=>{document.querySelectorAll(".ayotooltip").forEach(u=>{u.remove()})};t.addEventListener("mouseover",y,!1),t.addEventListener("mouseout",i,!1)},beforeMount(t){},unmounted(t){},updated(t){}},ie={install(t){t.component("AButton",j),t.component("AButtonGroup",X),t.component("ACheckbox",G),t.component("ACollapse",Y),t.component("ADialog",J),t.component("AInput",Q),t.component("AInputFile",Z),t.component("ARadio",ee),t.component("ASelect",te),t.component("ASpinner",le),t.component("ASwitch",oe),t.component("AToasts",ae)}};V.AButton=j,V.AButtonGroup=X,V.ACheckbox=G,V.ACollapse=Y,V.ADialog=J,V.AInput=Q,V.AInputFile=Z,V.ARadio=ee,V.ASelect=te,V.ASpinner=le,V.ASwitch=oe,V.AToasts=ae,V.AyoVue=ie,V.default=ie,V.useToast=ne,V.vRipple=q,V.vTooltip=Nt,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});