@validol4ik/uikit 0.2.1 → 0.2.11
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/dist/components/index.d.ts +102 -1
- package/dist/index-BuLE-ZhW.cjs +1 -0
- package/dist/index-DEsA-4tX.js +869 -0
- package/dist/index-DpdgtaB8.js +152 -0
- package/dist/index-wHwlJait.cjs +1 -0
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +5 -1010
- package/package.json +1 -1
- /package/dist/{main.css → index.css} +0 -0
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
import { default as AppButton } from './buttons/AppButton/index.vue';
|
|
2
|
-
import { default as CopyButton } from './buttons/CopyButton/index.vue';
|
|
3
2
|
import { default as AppIcon } from './AppIcon/index.vue';
|
|
4
3
|
|
|
4
|
+
declare const CopyButton: import('vue').DefineComponent<{
|
|
5
|
+
size: {
|
|
6
|
+
type: import('vue').PropType<"sm" | "md" | "lg">;
|
|
7
|
+
};
|
|
8
|
+
color: {
|
|
9
|
+
type: import('vue').PropType<string>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
text: {
|
|
13
|
+
type: import('vue').PropType<string>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
loading: {
|
|
17
|
+
type: import('vue').PropType<boolean | null>;
|
|
18
|
+
};
|
|
19
|
+
to: {
|
|
20
|
+
type: import('vue').PropType<any>;
|
|
21
|
+
};
|
|
22
|
+
href: {
|
|
23
|
+
type: import('vue').PropType<string>;
|
|
24
|
+
};
|
|
25
|
+
target: {
|
|
26
|
+
type: import('vue').PropType<string>;
|
|
27
|
+
};
|
|
28
|
+
transparent: {
|
|
29
|
+
type: import('vue').PropType<boolean>;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
rounded: {
|
|
33
|
+
type: import('vue').PropType<boolean>;
|
|
34
|
+
};
|
|
35
|
+
iconLeft: {
|
|
36
|
+
type: import('vue').PropType<import('./AppIcon/types').AppIconNames>;
|
|
37
|
+
};
|
|
38
|
+
iconRight: {
|
|
39
|
+
type: import('vue').PropType<import('./AppIcon/types').AppIconNames>;
|
|
40
|
+
};
|
|
41
|
+
iconMiddle: {
|
|
42
|
+
type: import('vue').PropType<import('./AppIcon/types').AppIconNames>;
|
|
43
|
+
};
|
|
44
|
+
disabled: {
|
|
45
|
+
type: import('vue').PropType<boolean>;
|
|
46
|
+
};
|
|
47
|
+
submit: {
|
|
48
|
+
type: import('vue').PropType<boolean>;
|
|
49
|
+
};
|
|
50
|
+
ariaLabel: {
|
|
51
|
+
type: import('vue').PropType<string>;
|
|
52
|
+
};
|
|
53
|
+
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
54
|
+
size: {
|
|
55
|
+
type: import('vue').PropType<"sm" | "md" | "lg">;
|
|
56
|
+
};
|
|
57
|
+
color: {
|
|
58
|
+
type: import('vue').PropType<string>;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
text: {
|
|
62
|
+
type: import('vue').PropType<string>;
|
|
63
|
+
required: true;
|
|
64
|
+
};
|
|
65
|
+
loading: {
|
|
66
|
+
type: import('vue').PropType<boolean | null>;
|
|
67
|
+
};
|
|
68
|
+
to: {
|
|
69
|
+
type: import('vue').PropType<any>;
|
|
70
|
+
};
|
|
71
|
+
href: {
|
|
72
|
+
type: import('vue').PropType<string>;
|
|
73
|
+
};
|
|
74
|
+
target: {
|
|
75
|
+
type: import('vue').PropType<string>;
|
|
76
|
+
};
|
|
77
|
+
transparent: {
|
|
78
|
+
type: import('vue').PropType<boolean>;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
81
|
+
rounded: {
|
|
82
|
+
type: import('vue').PropType<boolean>;
|
|
83
|
+
};
|
|
84
|
+
iconLeft: {
|
|
85
|
+
type: import('vue').PropType<import('./AppIcon/types').AppIconNames>;
|
|
86
|
+
};
|
|
87
|
+
iconRight: {
|
|
88
|
+
type: import('vue').PropType<import('./AppIcon/types').AppIconNames>;
|
|
89
|
+
};
|
|
90
|
+
iconMiddle: {
|
|
91
|
+
type: import('vue').PropType<import('./AppIcon/types').AppIconNames>;
|
|
92
|
+
};
|
|
93
|
+
disabled: {
|
|
94
|
+
type: import('vue').PropType<boolean>;
|
|
95
|
+
};
|
|
96
|
+
submit: {
|
|
97
|
+
type: import('vue').PropType<boolean>;
|
|
98
|
+
};
|
|
99
|
+
ariaLabel: {
|
|
100
|
+
type: import('vue').PropType<string>;
|
|
101
|
+
};
|
|
102
|
+
}>>, {
|
|
103
|
+
color: string;
|
|
104
|
+
transparent: boolean;
|
|
105
|
+
}, {}>;
|
|
5
106
|
export { AppButton, AppIcon, CopyButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),A={SM:"sm",MD:"md",LG:"lg"};var ne=(e=>(e.sm="3px 9px",e.md="5px 12px",e.lg="9px 20px",e))(ne||{});const ae={PRIMARY:"primary",INFO:"info",NEGATIVE:"negative",POSITIVE:"positive"},V={xs:18,sm:24,md:32,lg:38,xl:46},re={size:String};function oe(e,t=V){return a.computed(()=>e.size!==void 0?{fontSize:e.size in t?`${t[e.size]}px`:e.size}:null)}function Q(e){return a.markRaw(a.defineComponent(e))}function fe(e){return a.markRaw(e)}function ve(e,t){return e!==void 0&&e()||t}function j(e,t){return e!==void 0?t.concat(e()):t}const U="0 0 24 24",Y=e=>e,K=e=>`ionicons ${e}`,ie={"mdi-":e=>`mdi ${e}`,"icon-":Y,"bt-":e=>`bt ${e}`,"eva-":e=>`eva ${e}`,"ion-md":K,"ion-ios":K,"ion-logo":K,"iconfont ":Y,"ti-":e=>`themify-icon ${e}`,"bi-":e=>`bootstrap-icons ${e}`},ue={o_:"-outlined",r_:"-round",s_:"-sharp"},le={sym_o_:"-outlined",sym_r_:"-rounded",sym_s_:"-sharp"},me=new RegExp("^("+Object.keys(ie).join("|")+")"),pe=new RegExp("^("+Object.keys(ue).join("|")+")"),G=new RegExp("^("+Object.keys(le).join("|")+")"),ge=/^[Mm]\s?[-+]?\.?\d/,he=/^img:/,be=/^svguse:/,ye=/^ion-/,ke=/^(fa-(sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /,H=Q({name:"QIcon",props:{...re,tag:{type:String,default:"i"},name:String,color:String,left:Boolean,right:Boolean},setup(e,{slots:t}){const{proxy:{$q:r}}=a.getCurrentInstance(),n=oe(e),i=a.computed(()=>"q-icon"+(e.left===!0?" on-left":"")+(e.right===!0?" on-right":"")+(e.color!==void 0?` text-${e.color}`:"")),d=a.computed(()=>{let c,u=e.name;if(u==="none"||!u)return{none:!0};if(r.iconMapFn!==null){const s=r.iconMapFn(u);if(s!==void 0)if(s.icon!==void 0){if(u=s.icon,u==="none"||!u)return{none:!0}}else return{cls:s.cls,content:s.content!==void 0?s.content:" "}}if(ge.test(u)===!0){const[s,h=U]=u.split("|");return{svg:!0,viewBox:h,nodes:s.split("&&").map(l=>{const[b,p,y]=l.split("@@");return a.h("path",{style:p,d:b,transform:y})})}}if(he.test(u)===!0)return{img:!0,src:u.substring(4)};if(be.test(u)===!0){const[s,h=U]=u.split("|");return{svguse:!0,src:s.substring(7),viewBox:h}}let $=" ";const g=u.match(me);if(g!==null)c=ie[g[1]](u);else if(ke.test(u)===!0)c=u;else if(ye.test(u)===!0)c=`ionicons ion-${r.platform.is.ios===!0?"ios":"md"}${u.substring(3)}`;else if(G.test(u)===!0){c="notranslate material-symbols";const s=u.match(G);s!==null&&(u=u.substring(6),c+=le[s[1]]),$=u}else{c="notranslate material-icons";const s=u.match(pe);s!==null&&(u=u.substring(2),c+=ue[s[1]]),$=u}return{cls:c,content:$}});return()=>{const c={class:i.value,style:n.value,"aria-hidden":"true",role:"presentation"};return d.value.none===!0?a.h(e.tag,c,ve(t.default)):d.value.img===!0?a.h(e.tag,c,j(t.default,[a.h("img",{src:d.value.src})])):d.value.svg===!0?a.h(e.tag,c,j(t.default,[a.h("svg",{viewBox:d.value.viewBox||"0 0 24 24"},d.value.nodes)])):d.value.svguse===!0?a.h(e.tag,c,j(t.default,[a.h("svg",{viewBox:d.value.viewBox},[a.h("use",{"xlink:href":d.value.src})])])):(d.value.cls!==void 0&&(c.class+=" "+d.value.cls),a.h(e.tag,c,j(t.default,[d.value.content])))}}}),$e={size:{type:[String,Number],default:"1em"},color:String};function qe(e){return{cSize:a.computed(()=>e.size in V?`${V[e.size]}px`:e.size),classes:a.computed(()=>"q-spinner"+(e.color?` text-${e.color}`:""))}}const Ce=Q({name:"QSpinner",props:{...$e,thickness:{type:Number,default:5}},setup(e){const{cSize:t,classes:r}=qe(e);return()=>a.h("svg",{class:r.value+" q-spinner-mat",width:t.value,height:t.value,viewBox:"25 25 50 50"},[a.h("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none",stroke:"currentColor","stroke-width":e.thickness,"stroke-miterlimit":"10"})])}});function Ee(e,t){const r=e.style;for(const n in t)r[n]=t[n]}const D={hasPassive:!1,passiveCapture:!0,notPassiveCapture:!0};try{const e=Object.defineProperty({},"passive",{get(){Object.assign(D,{hasPassive:!0,passive:{passive:!0},notPassive:{passive:!1},passiveCapture:{passive:!0,capture:!0},notPassiveCapture:{passive:!1,capture:!0}})}});window.addEventListener("qtest",null,e),window.removeEventListener("qtest",null,e)}catch{}function _e(e){return e.touches&&e.touches[0]?e=e.touches[0]:e.changedTouches&&e.changedTouches[0]?e=e.changedTouches[0]:e.targetTouches&&e.targetTouches[0]&&(e=e.targetTouches[0]),{top:e.clientY,left:e.clientX}}function se(e){e.stopPropagation()}function Be(e){e.cancelable!==!1&&e.preventDefault()}function w(e){e.cancelable!==!1&&e.preventDefault(),e.stopPropagation()}function Le(e,t,r){const n=`__q_${t}_evt`;e[n]=e[n]!==void 0?e[n].concat(r):r,r.forEach(i=>{i[0].addEventListener(i[1],e[i[2]],D[i[3]])})}function Re(e,t){const r=`__q_${t}_evt`;e[r]!==void 0&&(e[r].forEach(n=>{n[0].removeEventListener(n[1],e[n[2]],D[n[3]])}),e[r]=void 0)}function Se(e){return e!==Object(e)||e.isComposing===!0||e.qKeyEvent===!0}function F(e,t){return Se(e)===!0?!1:[].concat(t).includes(e.keyCode)}function xe(e,t=250){let r=!1,n;return function(){return r===!1&&(r=!0,setTimeout(()=>{r=!1},t),n=e.apply(this,arguments)),n}}function W(e,t,r,n){r.modifiers.stop===!0&&se(e);const i=r.modifiers.color;let d=r.modifiers.center;d=d===!0||n===!0;const c=document.createElement("span"),u=document.createElement("span"),$=_e(e),{left:g,top:s,width:h,height:l}=t.getBoundingClientRect(),b=Math.sqrt(h*h+l*l),p=b/2,y=`${(h-b)/2}px`,f=d?y:`${$.left-g-p}px`,k=`${(l-b)/2}px`,x=d?k:`${$.top-s-p}px`;u.className="q-ripple__inner",Ee(u,{height:`${b}px`,width:`${b}px`,transform:`translate3d(${f},${x},0) scale3d(.2,.2,1)`,opacity:0}),c.className=`q-ripple${i?" text-"+i:""}`,c.setAttribute("dir","ltr"),c.appendChild(u),t.appendChild(c);const R=()=>{c.remove(),clearTimeout(S)};r.abort.push(R);let S=setTimeout(()=>{u.classList.add("q-ripple__inner--enter"),u.style.transform=`translate3d(${y},${k},0) scale3d(1,1,1)`,u.style.opacity=.2,S=setTimeout(()=>{u.classList.remove("q-ripple__inner--enter"),u.classList.add("q-ripple__inner--leave"),u.style.opacity=0,S=setTimeout(()=>{c.remove(),r.abort.splice(r.abort.indexOf(R),1)},275)},250)},50)}function X(e,{modifiers:t,value:r,arg:n}){const i=Object.assign({},e.cfg.ripple,t,r);e.modifiers={early:i.early===!0,stop:i.stop===!0,center:i.center===!0,color:i.color||n,keyCodes:[].concat(i.keyCodes||13)}}const we=fe({name:"ripple",beforeMount(e,t){const r=t.instance.$.appContext.config.globalProperties.$q.config||{};if(r.ripple===!1)return;const n={cfg:r,enabled:t.value!==!1,modifiers:{},abort:[],start(i){n.enabled===!0&&i.qSkipRipple!==!0&&i.type===(n.modifiers.early===!0?"pointerdown":"click")&&W(i,e,n,i.qKeyEvent===!0)},keystart:xe(i=>{n.enabled===!0&&i.qSkipRipple!==!0&&F(i,n.modifiers.keyCodes)===!0&&i.type===`key${n.modifiers.early===!0?"down":"up"}`&&W(i,e,n,!0)},300)};X(n,t),e.__qripple=n,Le(n,"main",[[e,"pointerdown","start","passive"],[e,"click","start","passive"],[e,"keydown","keystart","passive"],[e,"keyup","keystart","passive"]])},updated(e,t){if(t.oldValue!==t.value){const r=e.__qripple;r!==void 0&&(r.enabled=t.value!==!1,r.enabled===!0&&Object(t.value)===t.value&&X(r,t))}},beforeUnmount(e){const t=e.__qripple;t!==void 0&&(t.abort.forEach(r=>{r()}),Re(t,"main"),delete e._qripple)}}),ce={left:"start",center:"center",right:"end",between:"between",around:"around",evenly:"evenly",stretch:"stretch"},Pe=Object.keys(ce),Te={align:{type:String,validator:e=>Pe.includes(e)}};function Me(e){return a.computed(()=>{const t=e.align===void 0?e.vertical===!0?"stretch":"left":e.align;return`${e.vertical===!0?"items":"justify"}-${ce[t]}`})}function Oe(e){return e.appContext.config.globalProperties.$router!==void 0}function Z(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}function J(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ze(e,t){for(const r in t){const n=t[r],i=e[r];if(typeof n=="string"){if(n!==i)return!1}else if(Array.isArray(i)===!1||i.length!==n.length||n.some((d,c)=>d!==i[c]))return!1}return!0}function ee(e,t){return Array.isArray(t)===!0?e.length===t.length&&e.every((r,n)=>r===t[n]):e.length===1&&e[0]===t}function Ae(e,t){return Array.isArray(e)===!0?ee(e,t):Array.isArray(t)===!0?ee(t,e):e===t}function je(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(Ae(e[r],t[r])===!1)return!1;return!0}const Ie={to:[String,Object],replace:Boolean,href:String,target:String,disable:Boolean};function Ne({fallbackTag:e,useDisableForRouterLinkProps:t=!0}={}){const r=a.getCurrentInstance(),{props:n,proxy:i,emit:d}=r,c=Oe(r),u=a.computed(()=>n.disable!==!0&&n.href!==void 0),$=t===!0?a.computed(()=>c===!0&&n.disable!==!0&&u.value!==!0&&n.to!==void 0&&n.to!==null&&n.to!==""):a.computed(()=>c===!0&&u.value!==!0&&n.to!==void 0&&n.to!==null&&n.to!==""),g=a.computed(()=>$.value===!0?x(n.to):null),s=a.computed(()=>g.value!==null),h=a.computed(()=>u.value===!0||s.value===!0),l=a.computed(()=>n.type==="a"||h.value===!0?"a":n.tag||e||"div"),b=a.computed(()=>u.value===!0?{href:n.href,target:n.target}:s.value===!0?{href:g.value.href,target:n.target}:{}),p=a.computed(()=>{if(s.value===!1)return-1;const{matched:v}=g.value,{length:q}=v,E=v[q-1];if(E===void 0)return-1;const B=i.$route.matched;if(B.length===0)return-1;const L=B.findIndex(J.bind(null,E));if(L!==-1)return L;const I=Z(v[q-2]);return q>1&&Z(E)===I&&B[B.length-1].path!==I?B.findIndex(J.bind(null,v[q-2])):L}),y=a.computed(()=>s.value===!0&&p.value!==-1&&ze(i.$route.params,g.value.params)),f=a.computed(()=>y.value===!0&&p.value===i.$route.matched.length-1&&je(i.$route.params,g.value.params)),k=a.computed(()=>s.value===!0?f.value===!0?` ${n.exactActiveClass} ${n.activeClass}`:n.exact===!0?"":y.value===!0?` ${n.activeClass}`:"":"");function x(v){try{return i.$router.resolve(v)}catch{}return null}function R(v,{returnRouterError:q,to:E=n.to,replace:B=n.replace}={}){if(n.disable===!0)return v.preventDefault(),Promise.resolve(!1);if(v.metaKey||v.altKey||v.ctrlKey||v.shiftKey||v.button!==void 0&&v.button!==0||n.target==="_blank")return Promise.resolve(!1);v.preventDefault();const L=i.$router[B===!0?"replace":"push"](E);return q===!0?L:L.then(()=>{}).catch(()=>{})}function S(v){if(s.value===!0){const q=E=>R(v,E);d("click",v,q),v.defaultPrevented!==!0&&q()}else d("click",v)}return{hasRouterLink:s,hasHrefLink:u,hasLink:h,linkTag:l,resolvedLink:g,linkIsActive:y,linkIsExactActive:f,linkClass:k,linkAttrs:b,getLink:x,navigateToRouterLink:R,navigateOnClick:S}}const te={none:0,xs:4,sm:8,md:16,lg:24,xl:32},De={xs:8,sm:10,md:14,lg:20,xl:24},Ke=["button","submit","reset"],Ve=/[^\s]\/[^\s]/,Fe=["flat","outline","push","unelevated"];function Qe(e,t){return e.flat===!0?"flat":e.outline===!0?"outline":e.push===!0?"push":e.unelevated===!0?"unelevated":t}const Ue={...re,...Ie,type:{type:String,default:"button"},label:[Number,String],icon:String,iconRight:String,...Fe.reduce((e,t)=>(e[t]=Boolean)&&e,{}),square:Boolean,rounded:Boolean,glossy:Boolean,size:String,fab:Boolean,fabMini:Boolean,padding:String,color:String,textColor:String,noCaps:Boolean,noWrap:Boolean,dense:Boolean,tabindex:[Number,String],ripple:{type:[Boolean,Object],default:!0},align:{...Te.align,default:"center"},stack:Boolean,stretch:Boolean,loading:{type:Boolean,default:null},disable:Boolean},Ye={...Ue,round:Boolean};function Ge(e){const t=oe(e,De),r=Me(e),{hasRouterLink:n,hasLink:i,linkTag:d,linkAttrs:c,navigateOnClick:u}=Ne({fallbackTag:"button"}),$=a.computed(()=>{const f=e.fab===!1&&e.fabMini===!1?t.value:{};return e.padding!==void 0?Object.assign({},f,{padding:e.padding.split(/\s+/).map(k=>k in te?te[k]+"px":k).join(" "),minWidth:"0",minHeight:"0"}):f}),g=a.computed(()=>e.rounded===!0||e.fab===!0||e.fabMini===!0),s=a.computed(()=>e.disable!==!0&&e.loading!==!0),h=a.computed(()=>s.value===!0?e.tabindex||0:-1),l=a.computed(()=>Qe(e,"standard")),b=a.computed(()=>{const f={tabindex:h.value};return i.value===!0?Object.assign(f,c.value):Ke.includes(e.type)===!0&&(f.type=e.type),d.value==="a"?(e.disable===!0?f["aria-disabled"]="true":f.href===void 0&&(f.role="button"),n.value!==!0&&Ve.test(e.type)===!0&&(f.type=e.type)):e.disable===!0&&(f.disabled="",f["aria-disabled"]="true"),e.loading===!0&&e.percentage!==void 0&&Object.assign(f,{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.percentage}),f}),p=a.computed(()=>{let f;e.color!==void 0?e.flat===!0||e.outline===!0?f=`text-${e.textColor||e.color}`:f=`bg-${e.color} text-${e.textColor||"white"}`:e.textColor&&(f=`text-${e.textColor}`);const k=e.round===!0?"round":`rectangle${g.value===!0?" q-btn--rounded":e.square===!0?" q-btn--square":""}`;return`q-btn--${l.value} q-btn--${k}`+(f!==void 0?" "+f:"")+(s.value===!0?" q-btn--actionable q-focusable q-hoverable":e.disable===!0?" disabled":"")+(e.fab===!0?" q-btn--fab":e.fabMini===!0?" q-btn--fab-mini":"")+(e.noCaps===!0?" q-btn--no-uppercase":"")+(e.dense===!0?" q-btn--dense":"")+(e.stretch===!0?" no-border-radius self-stretch":"")+(e.glossy===!0?" glossy":"")+(e.square?" q-btn--square":"")}),y=a.computed(()=>r.value+(e.stack===!0?" column":" row")+(e.noWrap===!0?" no-wrap text-no-wrap":"")+(e.loading===!0?" q-btn__content--hidden":""));return{classes:p,style:$,innerClasses:y,attributes:b,hasLink:i,linkTag:d,navigateOnClick:u,isActionable:s}}const{passiveCapture:C}=D;let P=null,T=null,M=null;const He=Q({name:"QBtn",props:{...Ye,percentage:Number,darkPercentage:Boolean,onTouchstart:[Function,Array]},emits:["click","keydown","mousedown","keyup"],setup(e,{slots:t,emit:r}){const{proxy:n}=a.getCurrentInstance(),{classes:i,style:d,innerClasses:c,attributes:u,hasLink:$,linkTag:g,navigateOnClick:s,isActionable:h}=Ge(e),l=a.ref(null),b=a.ref(null);let p=null,y,f=null;const k=a.computed(()=>e.label!==void 0&&e.label!==null&&e.label!==""),x=a.computed(()=>e.disable===!0||e.ripple===!1?!1:{keyCodes:$.value===!0?[13,32]:[13],...e.ripple===!0?{}:e.ripple}),R=a.computed(()=>({center:e.round})),S=a.computed(()=>{const o=Math.max(0,Math.min(100,e.percentage));return o>0?{transition:"transform 0.6s",transform:`translateX(${o-100}%)`}:{}}),v=a.computed(()=>{if(e.loading===!0)return{onMousedown:z,onTouchstart:z,onClick:z,onKeydown:z,onKeyup:z};if(h.value===!0){const o={onClick:E,onKeydown:B,onMousedown:I};if(n.$q.platform.has.touch===!0){const m=e.onTouchstart!==void 0?"":"Passive";o[`onTouchstart${m}`]=L}return o}return{onClick:w}}),q=a.computed(()=>({ref:l,class:"q-btn q-btn-item non-selectable no-outline "+i.value,style:d.value,...u.value,...v.value}));function E(o){if(l.value!==null){if(o!==void 0){if(o.defaultPrevented===!0)return;const m=document.activeElement;if(e.type==="submit"&&m!==document.body&&l.value.contains(m)===!1&&m.contains(l.value)===!1){l.value.focus();const N=()=>{document.removeEventListener("keydown",w,!0),document.removeEventListener("keyup",N,C),l.value!==null&&l.value.removeEventListener("blur",N,C)};document.addEventListener("keydown",w,!0),document.addEventListener("keyup",N,C),l.value.addEventListener("blur",N,C)}}s(o)}}function B(o){l.value!==null&&(r("keydown",o),F(o,[13,32])===!0&&T!==l.value&&(T!==null&&O(),o.defaultPrevented!==!0&&(l.value.focus(),T=l.value,l.value.classList.add("q-btn--active"),document.addEventListener("keyup",_,!0),l.value.addEventListener("blur",_,C)),w(o)))}function L(o){l.value!==null&&(r("touchstart",o),o.defaultPrevented!==!0&&(P!==l.value&&(P!==null&&O(),P=l.value,p=o.target,p.addEventListener("touchcancel",_,C),p.addEventListener("touchend",_,C)),y=!0,f!==null&&clearTimeout(f),f=setTimeout(()=>{f=null,y=!1},200)))}function I(o){l.value!==null&&(o.qSkipRipple=y===!0,r("mousedown",o),o.defaultPrevented!==!0&&M!==l.value&&(M!==null&&O(),M=l.value,l.value.classList.add("q-btn--active"),document.addEventListener("mouseup",_,C)))}function _(o){if(l.value!==null&&!(o!==void 0&&o.type==="blur"&&document.activeElement===l.value)){if(o!==void 0&&o.type==="keyup"){if(T===l.value&&F(o,[13,32])===!0){const m=new MouseEvent("click",o);m.qKeyEvent=!0,o.defaultPrevented===!0&&Be(m),o.cancelBubble===!0&&se(m),l.value.dispatchEvent(m),w(o),o.qKeyEvent=!0}r("keyup",o)}O()}}function O(o){const m=b.value;o!==!0&&(P===l.value||M===l.value)&&m!==null&&m!==document.activeElement&&(m.setAttribute("tabindex",-1),m.focus()),P===l.value&&(p!==null&&(p.removeEventListener("touchcancel",_,C),p.removeEventListener("touchend",_,C)),P=p=null),M===l.value&&(document.removeEventListener("mouseup",_,C),M=null),T===l.value&&(document.removeEventListener("keyup",_,!0),l.value!==null&&l.value.removeEventListener("blur",_,C),T=null),l.value!==null&&l.value.classList.remove("q-btn--active")}function z(o){w(o),o.qSkipRipple=!0}return a.onBeforeUnmount(()=>{O(!0)}),Object.assign(n,{click:o=>{h.value===!0&&E(o)}}),()=>{let o=[];e.icon!==void 0&&o.push(a.h(H,{name:e.icon,left:e.stack!==!0&&k.value===!0,role:"img","aria-hidden":"true"})),k.value===!0&&o.push(a.h("span",{class:"block"},[e.label])),o=j(t.default,o),e.iconRight!==void 0&&e.round===!1&&o.push(a.h(H,{name:e.iconRight,right:e.stack!==!0&&k.value===!0,role:"img","aria-hidden":"true"}));const m=[a.h("span",{class:"q-focus-helper",ref:b})];return e.loading===!0&&e.percentage!==void 0&&m.push(a.h("span",{class:"q-btn__progress absolute-full overflow-hidden"+(e.darkPercentage===!0?" q-btn__progress--dark":"")},[a.h("span",{class:"q-btn__progress-indicator fit block",style:S.value})])),m.push(a.h("span",{class:"q-btn__content text-center col items-center q-anchor--skip "+c.value},o)),e.loading!==null&&m.push(a.h(a.Transition,{name:"q-transition--fade"},()=>e.loading===!0?[a.h("span",{key:"loading",class:"absolute-full flex flex-center"},t.loading!==void 0?t.loading():[a.h(Ce)])]:null)),a.withDirectives(a.h(g.value,q.value,m),[[we,x.value,void 0,R.value]])}}}),We=a.defineComponent({__name:"index",props:{size:{default:A.MD},transparent:{type:Boolean},rounded:{type:Boolean},color:{default:ae.PRIMARY},iconLeft:{},iconRight:{},iconMiddle:{},disabled:{type:Boolean},loading:{type:[Boolean,null]},to:{},href:{},target:{},submit:{type:Boolean},ariaLabel:{}},emits:["click"],setup(e){const t=e,r=a.computed(()=>["app-btn",{"app-btn_default":!t.transparent,"app-btn_trans":t.transparent,"app-btn_rounded":t.rounded,"app-btn_sm":t.size===A.SM,"app-btn_md":t.size===A.MD,"app-btn_lg":t.size===A.LG,"app-btn_icon-left":t.iconLeft,"app-btn_icon-right":t.iconRight,"app-btn_icon-middle":t.iconMiddle},`app-btn_${t.color}`]);return(n,i)=>(a.openBlock(),a.createBlock(a.unref(He),{"no-caps":"",unelevated:"",class:a.normalizeClass(r.value),padding:a.unref(ne)[t.size||a.unref(A).MD],loading:n.loading,disabled:n.disabled||void 0,to:n.to,href:n.href,target:n.target,type:n.submit?"submit":void 0,"aria-label":n.ariaLabel,onClick:i[0]||(i[0]=d=>n.$emit("click",d))},{default:a.withCtx(()=>[n.iconLeft||n.iconMiddle?(a.openBlock(),a.createElementBlock("i",{key:0,class:a.normalizeClass(["icon-kl",n.iconLeft?"icon-kl_left":"icon-kl_middle",`icon-kl-${n.iconLeft||n.iconMiddle}`,n.transparent?`text-${n.color}`:"text-secondary"])},null,2)):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default",{},void 0,!0),n.iconRight?(a.openBlock(),a.createElementBlock("i",{key:1,class:a.normalizeClass(["icon-kl","icon-kl_right",`icon-kl-${n.iconRight}`,n.transparent?`text-${n.color}`:"text-secondary"])},null,2)):a.createCommentVNode("",!0)]),_:3},8,["class","padding","loading","disabled","to","href","target","type","aria-label"]))}}),de=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Xe=de(We,[["__scopeId","data-v-5b3b0602"]]),Ze=a.defineComponent({__name:"index",props:{name:{},size:{},color:{}},setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("i",{class:a.normalizeClass(["icon-kl",`icon-kl-${t.name}`,t.color?`text-${t.color}`:""]),style:a.normalizeStyle(t.size?`font-size: ${t.size}`:void 0)},null,6))}}),Je=de(Ze,[["__scopeId","data-v-73419357"]]),et=a.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-wHwlJait.cjs")));exports.AppButton=Xe;exports.COLORS=ae;exports.CopyButton=et;exports.index=Je;
|