UNPKG

ayovue

Version:

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

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