yuyeon 0.3.0-rc.8 → 0.3.0
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/yuyeon.js
CHANGED
|
@@ -722,13 +722,13 @@ const Nr = "YSpinnerRing", Va = /* @__PURE__ */ V({
|
|
|
722
722
|
disabled: e.disabled ? !0 : void 0
|
|
723
723
|
}, {
|
|
724
724
|
default: () => {
|
|
725
|
-
var x, C;
|
|
725
|
+
var x, C, w;
|
|
726
726
|
return [d("span", {
|
|
727
727
|
class: ["y-button__content"]
|
|
728
|
-
}, [e.loading && d(Va, W({
|
|
728
|
+
}, [e.loading && (n.loading ? (x = n.loading) == null ? void 0 : x.call(n) : d(Va, W({
|
|
729
729
|
width: "24",
|
|
730
730
|
height: "24"
|
|
731
|
-
}), null), (
|
|
731
|
+
}), null)), (C = n.default) == null ? void 0 : C.call(n)]), (w = n.append) == null ? void 0 : w.call(n)];
|
|
732
732
|
}
|
|
733
733
|
}), [[Mt("plate-wave"), !e.noWave && !e.loading]]);
|
|
734
734
|
}), {
|
package/dist/yuyeon.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ee,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(ee=typeof globalThis<"u"?globalThis:ee||self,n(ee.yuyeon={},ee.Vue))})(this,function(ee,n){"use strict";var cc=Object.defineProperty;var sc=(ee,n,re)=>n in ee?cc(ee,n,{enumerable:!0,configurable:!0,writable:!0,value:re}):ee[n]=re;var ie=(ee,n,re)=>sc(ee,typeof n!="symbol"?n+"":n,re);function re(e,t){return e?Object.prototype.hasOwnProperty.call(e,t):!1}function xn(e,t,a){const r=t.length-1;let o=e;if(r<0)return o===void 0?a:o;for(let i=0;i<r;i+=1){if(o==null)return a;o=o[t[i]]}return o==null||o[t[r]]===void 0?a:o[t[r]]}function le(e={},t={},a){const r={...e};for(const o in t){const i=r[o],l=t[o];if(typeof i=="object"&&typeof l=="object"){r[o]=le(i,l);continue}r[o]=l}return r}function z(e,t,a){let r=t;return e==null||!r||typeof r!="string"?a:e[r]!==void 0?e[r]:(r=r.replace(/\[(\w+)\]/g,".$1"),r=r.replace(/^\./,""),xn(e,r.split("."),a))}function fe(e,t,a){if(t==null)return e===void 0?a:e;if(e!==Object(e)){if(typeof t!="function")return a;const o=t(e,a);return typeof o>"u"?a:o}if(typeof t=="string")return z(e,t,a);if(Array.isArray(t))return xn(e,t,a);if(typeof t!="function")return a;const r=t(e,a);return typeof r>"u"?a:r}function Ne(e,t=0,a=1){return Math.max(t,Math.min(a,e))}function me(e,t=0){return Array.from({length:e},(a,r)=>t+r)}function ce(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date&&e.getTime()!==t.getTime()||e!==Object(e)||t!==Object(t))return!1;const a=Object.keys(e);return a.length!==Object.keys(t).length?!1:a.every(r=>ce(e[r],t[r]))}function Mr(e){const t=typeof e;return e!==null&&(t==="object"||t==="function")}function ze(e){return e==null||(e==null?void 0:e.trim())===""}function ye(e,t){const a={...e};return t.forEach(r=>delete a[r]),a}function Pr(e,t=n.getCurrentInstance()){const a=t==null?void 0:t.provides;if(a&&e in a)return a[e]}function Ue(e,t="camel"){let a="";for(let r=0;r<e.length;r+=1){const o=e[r],i=o.charCodeAt(0);i>=65&&i<=90?a+=`${r===0&&t==="camel"?"":"-"}${o.toLowerCase()}`:a+=o}return a}function Sn(e){let t="",a=0;for(;a<e.length;){const r=e[a];r==="-"?(a+=1,t+=e[a].toUpperCase()):t+=r,a+=1}return t}function Ir(e){const t=/\{([^{}]+)\}/g,a=[];let r,o=0;for(;(r=t.exec(e))!==null;){const i=r[1],l=r.index,c=t.lastIndex;if(l>0){const u=e.substring(o,l);a.push({type:"text",content:u})}i.trim()&&a.push({type:"variable",content:i.trim()}),o=c}return a.push({type:"text",content:e.substring(o,e.length)}),a}function $(e,t){return a=>Object.keys(e).reduce((r,o)=>{const i=e[o],c=typeof i=="object"&&i!=null&&!Array.isArray(i)?i:{type:i};return a&&o in a?r[o]={...c,default:a[o]}:r[o]=c,t&&!r[o].source&&(r[o].source=t),r},{})}function G(e,t){return Object.keys(t).reduce((a,r)=>(e&&r in e&&(a[r]=e[r]),a),{})}function bt(e,t){const a=`on${n.capitalize(t)}`;return!!(e[a]||e[`${a}Once`]||e[`${a}Capture`]||e[`${a}OnceCapture`]||e[`${a}CaptureOnce`])}function Yr(e,t){var a,r;return typeof((a=e.props)==null?void 0:a[t])<"u"||typeof((r=e.props)==null?void 0:r[Ue(t)])<"u"}const qe=Symbol.for("yuyeon.defaults");function Br(e){return n.ref(e)}function $r(e){return Br(e)}function Nn(){const e=n.inject(qe);if(!e)throw new Error('【yuyeon】 Not found provided "DefaultsModule"');return e}function Rr(e={},t,a=Nn()){var u,d;const r=n.getCurrentInstance();if(t=t||((u=r==null?void 0:r.type)==null?void 0:u.name)||((d=r==null?void 0:r.type)==null?void 0:d.__name),!t)throw new Error("Missing component name");const o=n.computed(()=>{var s;return(s=a.value)==null?void 0:s[t]}),i=n.shallowRef(),l=new Proxy(e,{get(s,v){var x,N,w,y,f,b,p;const h=Reflect.get(s,v);return v==="class"||v==="style"?[(x=o.value)==null?void 0:x[v],h].filter(m=>m!=null):typeof v=="string"&&!Yr(r.vnode,v)?((N=o.value)==null?void 0:N[v])!==void 0?(w=o.value)==null?void 0:w[v]:((f=(y=a.value)==null?void 0:y.global)==null?void 0:f[v])!==void 0?(p=(b=a.value)==null?void 0:b.global)==null?void 0:p[v]:h:h}});n.watchEffect(()=>{if(o.value){const s=Object.entries(o.value).filter(([v])=>v.startsWith(v[0].toUpperCase()));i.value=s.length?Object.fromEntries(s):void 0}else i.value=void 0});function c(){const s=Pr(qe,r);n.provide(qe,n.computed(()=>i.value?le((s==null?void 0:s.value)??{},i.value):s==null?void 0:s.value))}return{props:l,provideSubDefaults:c}}function Y(e){return e._setup=e._setup??e.setup,e._setup&&(e.setup=function(t,a){const r=Nn();if(!r.value)return e._setup(t,a);const{props:o,provideSubDefaults:i}=Rr(t,e.name,r),l=e._setup(o,a);return i(),l}),e}function Ce(){const e=n.getCurrentInstance();return e==null?void 0:e.uid}function he(e){const t={};return typeof e=="string"?t[e]=!0:Array.isArray(e)?e.reduce((a,r)=>(a[r]=!0,a),t):typeof e=="object"&&Object.keys(e).reduce((a,r)=>(a[r]=!!e[r],a),t),t}function pt(e){if(e&&"$el"in e){const t=e.$el;return t.nodeType===Node.TEXT_NODE?t.nextElementSibling:t}return e}function Ge(e,t){if(!t||typeof t!="object")return[];if(Array.isArray(t))return t.map(a=>Ge(e,a)).flat(1);if(Array.isArray(t.children))return t.children.map(a=>Ge(e,a)).flat(1);if(t.component){if(Object.getOwnPropertySymbols(t.component.provides).includes(e))return[t.component];if(t.component.subTree)return Ge(e,t.component.subTree).flat(1)}return[]}const Lr=Y({name:"YApp",setup(e,{slots:t}){return()=>n.h("div",{class:"y-app"},n.h("div",{class:"y-app__container"},t))}});function Cn(e,t){const a=[];for(const r of t)e.includes(r)||a.push(r);return a}function ge(e){return Array.isArray(e)?e:[e]}function wt(e,t){let a;function r(){a=n.effectScope(),a.run(()=>t.length?t(()=>{a==null||a.stop(),r()}):t())}n.watch(e,o=>{o&&!a?r():o||(a==null||a.stop(),a=void 0)},{immediate:!0}),n.onScopeDispose(()=>{a==null||a.stop()})}function W(e,t="modelValue",a,r=i=>i,o=i=>i){const i=n.getCurrentInstance(),l=Ue(t),c=l===t?Sn(t):t,u=n.ref(e[c]!==void 0?e[c]:a);function d(){return e[c]}const s=n.computed(()=>{d();const h=i.vnode.props;return(re(h,l)||re(h,c))&&(re(h,`onUpdate:${l}`)||re(h,`onUpdate:${c}`))});wt(()=>!s.value,()=>{n.watch(()=>d(),h=>{u.value=h})});const v=n.computed({get(){return r(s.value?d():u.value)},set(h){const x=o(h),N=n.toRaw(s.value?d():u.value);N===x||r(N)===h||(u.value=x,i==null||i.emit(`update:${c}`,x))}});return Object.defineProperty(v,"rxValue",{get:()=>s.value?d():u.value}),v}function xt(e,t,a){const r=W(e,t,e[t]??a.value);return n.watch(a,o=>{e[t]==null&&(r.value=o)}),r}const Fr=$({modelValue:{type:null,default:void 0},multiple:Boolean,mandatory:[Boolean,String],max:Number,selectedClass:String,disabled:Boolean,returnItem:Boolean},"choice"),jr=$({value:null,disabled:Boolean,selectedClass:String},"choice-item");function Kr(e,t,a=!0){const r=n.getCurrentInstance();if(!r)throw new Error('"useChoiceItem" must be used inside a component setup function');const o=Ce();n.provide(Symbol.for(`${t.description}:id`),o);const i=n.inject(t,null);if(!i){if(!a)return i;throw new Error("Not found provider")}const l=n.toRef(e,"value"),c=n.computed(()=>!!(i.disabled.value||e.disabled));i.register({id:o,value:l,disabled:c},r),n.onBeforeUnmount(()=>{i.unregister(o)});const u=n.computed(()=>i.isSelected(o)),d=n.computed(()=>u.value&&[i.selectedClass.value,e.selectedClass]);return n.watch(u,s=>{r.emit("choice:selected",{value:s})}),{id:o,isSelected:u,toggle:()=>i.select(o,!u.value),select:s=>i.select(o,s),selectedClass:d,value:l,disabled:c,provider:i}}function Hr(e,t){let a=!1;const r=n.reactive([]),o=W(e,"modelValue",[],h=>h==null?[]:Vn(r,ge(h)),h=>{const x=zr(r,h);return e.multiple?x:x[0]}),i=n.getCurrentInstance();function l(h,x){const N=h,w=Symbol.for(`${t.description}:id`),f=Ge(w,i==null?void 0:i.vnode).indexOf(x);f>-1?r.splice(f,0,N):r.push(N)}function c(h){if(a)return;u();const x=r.findIndex(N=>N.id===h);r.splice(x,1)}function u(){const h=r.find(x=>!x.disabled);h&&e.mandatory==="force"&&!o.value.length&&(o.value=[h.id])}n.onMounted(()=>{u()}),n.onBeforeUnmount(()=>{a=!0});function d(h,x){const N=r.find(w=>w.id===h);if(!(x&&(N!=null&&N.disabled)))if(e.multiple){const w=o.value.slice(),y=w.findIndex(b=>b===h),f=~y;if(x=x??!f,f&&e.mandatory&&w.length<=1||!f&&e.max!=null&&w.length+1>e.max)return;y<0&&x?w.push(h):y>=0&&!x&&w.splice(y,1),o.value=w}else{const w=o.value.includes(h);if(e.mandatory&&w)return;o.value=x??!w?[h]:[]}}function s(h){if(e.multiple,o.value.length){const x=o.value[0],N=r.findIndex(f=>f.id===x);let w=(N+h)%r.length,y=r[w];for(;y.disabled&&w!==N;)w=(w+h)%r.length,y=r[w];if(y.disabled)return;o.value=[r[w].id]}else{const x=r.find(N=>!N.disabled);x&&(o.value=[x.id])}}const v={register:l,unregister:c,selected:o,select:d,disabled:n.toRef(e,"disabled"),prev:()=>s(r.length-1),next:()=>s(1),isSelected:h=>o.value.includes(h),selectedClass:n.computed(()=>e.selectedClass),items:n.computed(()=>r),getItemIndex:h=>Wr(r,h)};return n.provide(t,v),v}function Wr(e,t){const a=Vn(e,[t]);return a.length?e.findIndex(r=>r.id===a[0]):-1}function Vn(e,t){const a=[];return t.forEach(r=>{const o=e.find(l=>ce(r,l.value)),i=e[r];(o==null?void 0:o.value)!=null?a.push(o.id):i!=null&&a.push(i.id)}),a}function zr(e,t){const a=[];return t.forEach(r=>{const o=e.findIndex(i=>i.id===r);if(~o){const i=e[o];a.push(i.value!=null?i.value:o)}}),a}function Ur(e,t){n.watch(()=>{var a;return(a=e.isActive)==null?void 0:a.value},a=>{e.isLink.value&&a&&t&&n.nextTick(()=>{t(!0)})},{immediate:!0})}function L(e){const t=n.getCurrentInstance();t&&(t.render=e)}const qr=$({href:String,replace:Boolean,to:[String,Object],exact:Boolean},"VueRouter");function Gr(e,t){const a=n.resolveDynamicComponent("RouterLink"),r=n.computed(()=>!!(e.href||e.to)),o=n.computed(()=>(r==null?void 0:r.value)||bt(t,"click")||bt(e,"click"));if(typeof a=="string")return{isLink:r,isClickable:o,href:n.toRef(e,"href")};const i=e.to?a.useLink(e):void 0;return{isLink:r,isClickable:o,route:i==null?void 0:i.route,navigate:i==null?void 0:i.navigate,isActive:i&&n.computed(()=>{var l,c;return e.exact?(l=i.isExactActive)==null?void 0:l.value:(c=i.isActive)==null?void 0:c.value}),href:n.computed(()=>e.to?i==null?void 0:i.route.value.href:e.href)}}const kn="y-plate-wave__animation";function _n(e){if(!e)return;const t=document.createElement("span");t.className=kn,e.appendChild(t),t.dataset.activated=String(performance.now())}function St(e){if(!e)return;const t=e.getElementsByClassName(kn);if(t.length===0)return;const a=t[t.length-1];if(a.dataset.isHiding)return;a.dataset.isHiding="true";const r=performance.now()-Number(a.dataset.activated),o=Math.max(250-r,0);setTimeout(()=>{a&&e.removeChild(a)},o+300)}let Nt=!1;function Tn(e){_n(e.currentTarget)}function Ye(e){St(e.currentTarget)}function Xr(e){}function Dn(e){!Nt&&(e.key==="Enter"||e.key==="Space")&&(Nt=!0,_n(e.currentTarget))}function An(e){Nt=!1,St(e.currentTarget)}function En(e){e.removeEventListener("mousedown",Tn),e.removeEventListener("mouseup",Ye),e.removeEventListener("mouseleave",Ye),e.removeEventListener("keydown",Dn),e.removeEventListener("keyup",An)}function On(e,t,a=!1){const{value:r,modifiers:o}=t;let i=r??!0;if(typeof r=="boolean"&&(i=r),i||St(e),i&&a){if(o.stop){e.addEventListener("mousedown",Xr);return}e.addEventListener("mousedown",Tn),e.addEventListener("mouseup",Ye),e.addEventListener("mouseleave",Ye),e.addEventListener("keydown",Dn),e.addEventListener("keyup",An),e.addEventListener("blur",Ye)}else!i&&!a&&En(e)}const Mn={mounted(e,t){On(e,t,!0)},updated(e,t){t.value!==t.oldValue&&On(e,t)},unmount(e){En(e)}},Zr=/rgb(a?)\((?<v>.*)\)/,Jr=/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/;function Ct(e){if(e&&e[0]==="#"){const t=e.substring(1,e.length),a=t.length,r=[];if(a===3||a===6){const o=a===6?2:1;for(let i=0;i<3;i+=1){const l=t.substring(i*o,i*o+o);r.push(Number.parseInt(l,16))}return r}}}function Ve(e){return Zr.test(e)||Jr.test(e)}const Pn=Y({name:"YSpinnerRing",render(){return n.createVNode("svg",{class:"y-spinner-ring",width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},[n.createVNode("circle",{class:"y-spinner-ring__circle",cx:"24",cy:"24",r:"18","stroke-width":"4","stroke-dasharray":"113.097","stroke-dashoffset":"113.097"},null)])}}),Qr=Symbol.for("yuyeon.y-toggle-button"),te="y-button",Xe=$({loading:Boolean,active:{type:Boolean,default:void 0},injectSymbol:{type:null,default:Qr},variation:{type:String},small:Boolean,icon:Boolean,outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},filled:{type:Boolean,default:!1},color:{type:String},noWave:{type:Boolean,default:!1},...qr(),...jr()},"YButton"),q=Y({name:"YButton",directives:{PlateWave:Mn},props:Xe(),emits:{click:e=>!0,"choice:selected":e=>!0},setup(e,{attrs:t,slots:a,emit:r}){const o=Kr(e,e.injectSymbol,!1),i=Gr(e,t);Ur(i,o==null?void 0:o.select);const l=n.computed(()=>{var h;return e.active!==void 0?e.active:i.isLink.value?(h=i.isActive)==null?void 0:h.value:o==null?void 0:o.isSelected.value}),c=n.computed(()=>{const{variation:h}=e;return typeof h=="string"?h.split(",").map(x=>x.trim()):[]}),u=n.computed(()=>{const{outlined:h,rounded:x,filled:N,small:w,icon:y}=e;return{[`${te}--outlined`]:c.value.includes("outlined")||h,[`${te}--rounded`]:c.value.includes("rounded")||x,[`${te}--filled`]:c.value.includes("filled")||N,[`${te}--text`]:c.value.includes("text"),[`${te}--small`]:c.value.includes("small")||w,[`${te}--x-small`]:c.value.includes("x-small")||w,[`${te}--icon`]:c.value.includes("icon")||y,[`${te}--color`]:e.color,[`${te}--loading`]:e.loading,[`${te}--disabled`]:e.disabled,[`${te}--active`]:l.value}}),d=n.computed(()=>{let{color:h}=e,x;return h&&!Ve(h)&&(h=`var(--y-theme-${h})`,x=`var(--y-theme-on-${e.color})`),{"--y-button__color":h,"--y-button__text-color":x}}),s=n.computed(()=>(o==null?void 0:o.disabled.value)||e.disabled);function v(h){var x;s.value||e.loading||i.isLink.value&&(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey||h.button!==0||t.target==="_blank")||(r("click",h),(x=i.navigate)==null||x.call(i,h),o==null||o.toggle())}return L(()=>{const h=i.isLink.value?"a":"button";return n.withDirectives(n.createVNode(h,{type:h==="a"?void 0:"button",class:[`${te}`,o==null?void 0:o.selectedClass.value,{...u.value}],href:e.disabled?void 0:i.href.value,style:d.value,onClick:v,disabled:e.disabled?!0:void 0},{default:()=>{var x,N;return[n.createVNode("span",{class:["y-button__content"]},[e.loading&&n.createVNode(Pn,n.mergeProps({width:"24",height:"24"}),null),(x=a.default)==null?void 0:x.call(a)]),(N=a.append)==null?void 0:N.call(a)]}}),[[n.resolveDirective("plate-wave"),!e.noWave&&!e.loading]])}),{link:i}}}),eo=$({focused:Boolean,"onUpdate:focused":Function},"focus");function Vt(e,t){const a=W(e,"focused");function r(){a.value=!0}function o(){a.value=!1}const i=n.computed(()=>({[`${t}--focused`]:a.value}));return{focused:a,whenFocus:r,whenBlur:o,focusedClasses:i}}const to=(e,t,a)=>{function r(o){e.classList.forEach(i=>{i.startsWith("y-theme--")&&i!==o&&e.classList.remove(i)}),e.classList.add(o)}n.watchEffect(()=>{var c,u,d,s,v;const o=((u=(c=t.instance)==null?void 0:c.$yuyeon)==null?void 0:u.theme)??((v=(s=(d=a==null?void 0:a.ctx)==null?void 0:d.root.appContext.config.globalProperties)==null?void 0:s.$yuyeon)==null?void 0:v.theme),i=t.value??n.unref(o.currentThemeKey)??"";if(!i)return;const l=`y-theme--${i}`;r(l)},{flush:"post"})};/** @preserve
|
|
1
|
+
(function(ee,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(ee=typeof globalThis<"u"?globalThis:ee||self,n(ee.yuyeon={},ee.Vue))})(this,function(ee,n){"use strict";var cc=Object.defineProperty;var sc=(ee,n,re)=>n in ee?cc(ee,n,{enumerable:!0,configurable:!0,writable:!0,value:re}):ee[n]=re;var ie=(ee,n,re)=>sc(ee,typeof n!="symbol"?n+"":n,re);function re(e,t){return e?Object.prototype.hasOwnProperty.call(e,t):!1}function xn(e,t,a){const r=t.length-1;let o=e;if(r<0)return o===void 0?a:o;for(let i=0;i<r;i+=1){if(o==null)return a;o=o[t[i]]}return o==null||o[t[r]]===void 0?a:o[t[r]]}function le(e={},t={},a){const r={...e};for(const o in t){const i=r[o],l=t[o];if(typeof i=="object"&&typeof l=="object"){r[o]=le(i,l);continue}r[o]=l}return r}function z(e,t,a){let r=t;return e==null||!r||typeof r!="string"?a:e[r]!==void 0?e[r]:(r=r.replace(/\[(\w+)\]/g,".$1"),r=r.replace(/^\./,""),xn(e,r.split("."),a))}function fe(e,t,a){if(t==null)return e===void 0?a:e;if(e!==Object(e)){if(typeof t!="function")return a;const o=t(e,a);return typeof o>"u"?a:o}if(typeof t=="string")return z(e,t,a);if(Array.isArray(t))return xn(e,t,a);if(typeof t!="function")return a;const r=t(e,a);return typeof r>"u"?a:r}function Ne(e,t=0,a=1){return Math.max(t,Math.min(a,e))}function me(e,t=0){return Array.from({length:e},(a,r)=>t+r)}function ce(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date&&e.getTime()!==t.getTime()||e!==Object(e)||t!==Object(t))return!1;const a=Object.keys(e);return a.length!==Object.keys(t).length?!1:a.every(r=>ce(e[r],t[r]))}function Mr(e){const t=typeof e;return e!==null&&(t==="object"||t==="function")}function ze(e){return e==null||(e==null?void 0:e.trim())===""}function ye(e,t){const a={...e};return t.forEach(r=>delete a[r]),a}function Pr(e,t=n.getCurrentInstance()){const a=t==null?void 0:t.provides;if(a&&e in a)return a[e]}function Ue(e,t="camel"){let a="";for(let r=0;r<e.length;r+=1){const o=e[r],i=o.charCodeAt(0);i>=65&&i<=90?a+=`${r===0&&t==="camel"?"":"-"}${o.toLowerCase()}`:a+=o}return a}function Sn(e){let t="",a=0;for(;a<e.length;){const r=e[a];r==="-"?(a+=1,t+=e[a].toUpperCase()):t+=r,a+=1}return t}function Ir(e){const t=/\{([^{}]+)\}/g,a=[];let r,o=0;for(;(r=t.exec(e))!==null;){const i=r[1],l=r.index,c=t.lastIndex;if(l>0){const u=e.substring(o,l);a.push({type:"text",content:u})}i.trim()&&a.push({type:"variable",content:i.trim()}),o=c}return a.push({type:"text",content:e.substring(o,e.length)}),a}function $(e,t){return a=>Object.keys(e).reduce((r,o)=>{const i=e[o],c=typeof i=="object"&&i!=null&&!Array.isArray(i)?i:{type:i};return a&&o in a?r[o]={...c,default:a[o]}:r[o]=c,t&&!r[o].source&&(r[o].source=t),r},{})}function G(e,t){return Object.keys(t).reduce((a,r)=>(e&&r in e&&(a[r]=e[r]),a),{})}function bt(e,t){const a=`on${n.capitalize(t)}`;return!!(e[a]||e[`${a}Once`]||e[`${a}Capture`]||e[`${a}OnceCapture`]||e[`${a}CaptureOnce`])}function Yr(e,t){var a,r;return typeof((a=e.props)==null?void 0:a[t])<"u"||typeof((r=e.props)==null?void 0:r[Ue(t)])<"u"}const qe=Symbol.for("yuyeon.defaults");function Br(e){return n.ref(e)}function $r(e){return Br(e)}function Nn(){const e=n.inject(qe);if(!e)throw new Error('【yuyeon】 Not found provided "DefaultsModule"');return e}function Rr(e={},t,a=Nn()){var u,d;const r=n.getCurrentInstance();if(t=t||((u=r==null?void 0:r.type)==null?void 0:u.name)||((d=r==null?void 0:r.type)==null?void 0:d.__name),!t)throw new Error("Missing component name");const o=n.computed(()=>{var s;return(s=a.value)==null?void 0:s[t]}),i=n.shallowRef(),l=new Proxy(e,{get(s,v){var x,N,w,y,f,b,p;const h=Reflect.get(s,v);return v==="class"||v==="style"?[(x=o.value)==null?void 0:x[v],h].filter(m=>m!=null):typeof v=="string"&&!Yr(r.vnode,v)?((N=o.value)==null?void 0:N[v])!==void 0?(w=o.value)==null?void 0:w[v]:((f=(y=a.value)==null?void 0:y.global)==null?void 0:f[v])!==void 0?(p=(b=a.value)==null?void 0:b.global)==null?void 0:p[v]:h:h}});n.watchEffect(()=>{if(o.value){const s=Object.entries(o.value).filter(([v])=>v.startsWith(v[0].toUpperCase()));i.value=s.length?Object.fromEntries(s):void 0}else i.value=void 0});function c(){const s=Pr(qe,r);n.provide(qe,n.computed(()=>i.value?le((s==null?void 0:s.value)??{},i.value):s==null?void 0:s.value))}return{props:l,provideSubDefaults:c}}function Y(e){return e._setup=e._setup??e.setup,e._setup&&(e.setup=function(t,a){const r=Nn();if(!r.value)return e._setup(t,a);const{props:o,provideSubDefaults:i}=Rr(t,e.name,r),l=e._setup(o,a);return i(),l}),e}function Ce(){const e=n.getCurrentInstance();return e==null?void 0:e.uid}function he(e){const t={};return typeof e=="string"?t[e]=!0:Array.isArray(e)?e.reduce((a,r)=>(a[r]=!0,a),t):typeof e=="object"&&Object.keys(e).reduce((a,r)=>(a[r]=!!e[r],a),t),t}function pt(e){if(e&&"$el"in e){const t=e.$el;return t.nodeType===Node.TEXT_NODE?t.nextElementSibling:t}return e}function Ge(e,t){if(!t||typeof t!="object")return[];if(Array.isArray(t))return t.map(a=>Ge(e,a)).flat(1);if(Array.isArray(t.children))return t.children.map(a=>Ge(e,a)).flat(1);if(t.component){if(Object.getOwnPropertySymbols(t.component.provides).includes(e))return[t.component];if(t.component.subTree)return Ge(e,t.component.subTree).flat(1)}return[]}const Lr=Y({name:"YApp",setup(e,{slots:t}){return()=>n.h("div",{class:"y-app"},n.h("div",{class:"y-app__container"},t))}});function Cn(e,t){const a=[];for(const r of t)e.includes(r)||a.push(r);return a}function ge(e){return Array.isArray(e)?e:[e]}function wt(e,t){let a;function r(){a=n.effectScope(),a.run(()=>t.length?t(()=>{a==null||a.stop(),r()}):t())}n.watch(e,o=>{o&&!a?r():o||(a==null||a.stop(),a=void 0)},{immediate:!0}),n.onScopeDispose(()=>{a==null||a.stop()})}function W(e,t="modelValue",a,r=i=>i,o=i=>i){const i=n.getCurrentInstance(),l=Ue(t),c=l===t?Sn(t):t,u=n.ref(e[c]!==void 0?e[c]:a);function d(){return e[c]}const s=n.computed(()=>{d();const h=i.vnode.props;return(re(h,l)||re(h,c))&&(re(h,`onUpdate:${l}`)||re(h,`onUpdate:${c}`))});wt(()=>!s.value,()=>{n.watch(()=>d(),h=>{u.value=h})});const v=n.computed({get(){return r(s.value?d():u.value)},set(h){const x=o(h),N=n.toRaw(s.value?d():u.value);N===x||r(N)===h||(u.value=x,i==null||i.emit(`update:${c}`,x))}});return Object.defineProperty(v,"rxValue",{get:()=>s.value?d():u.value}),v}function xt(e,t,a){const r=W(e,t,e[t]??a.value);return n.watch(a,o=>{e[t]==null&&(r.value=o)}),r}const Fr=$({modelValue:{type:null,default:void 0},multiple:Boolean,mandatory:[Boolean,String],max:Number,selectedClass:String,disabled:Boolean,returnItem:Boolean},"choice"),jr=$({value:null,disabled:Boolean,selectedClass:String},"choice-item");function Kr(e,t,a=!0){const r=n.getCurrentInstance();if(!r)throw new Error('"useChoiceItem" must be used inside a component setup function');const o=Ce();n.provide(Symbol.for(`${t.description}:id`),o);const i=n.inject(t,null);if(!i){if(!a)return i;throw new Error("Not found provider")}const l=n.toRef(e,"value"),c=n.computed(()=>!!(i.disabled.value||e.disabled));i.register({id:o,value:l,disabled:c},r),n.onBeforeUnmount(()=>{i.unregister(o)});const u=n.computed(()=>i.isSelected(o)),d=n.computed(()=>u.value&&[i.selectedClass.value,e.selectedClass]);return n.watch(u,s=>{r.emit("choice:selected",{value:s})}),{id:o,isSelected:u,toggle:()=>i.select(o,!u.value),select:s=>i.select(o,s),selectedClass:d,value:l,disabled:c,provider:i}}function Hr(e,t){let a=!1;const r=n.reactive([]),o=W(e,"modelValue",[],h=>h==null?[]:Vn(r,ge(h)),h=>{const x=zr(r,h);return e.multiple?x:x[0]}),i=n.getCurrentInstance();function l(h,x){const N=h,w=Symbol.for(`${t.description}:id`),f=Ge(w,i==null?void 0:i.vnode).indexOf(x);f>-1?r.splice(f,0,N):r.push(N)}function c(h){if(a)return;u();const x=r.findIndex(N=>N.id===h);r.splice(x,1)}function u(){const h=r.find(x=>!x.disabled);h&&e.mandatory==="force"&&!o.value.length&&(o.value=[h.id])}n.onMounted(()=>{u()}),n.onBeforeUnmount(()=>{a=!0});function d(h,x){const N=r.find(w=>w.id===h);if(!(x&&(N!=null&&N.disabled)))if(e.multiple){const w=o.value.slice(),y=w.findIndex(b=>b===h),f=~y;if(x=x??!f,f&&e.mandatory&&w.length<=1||!f&&e.max!=null&&w.length+1>e.max)return;y<0&&x?w.push(h):y>=0&&!x&&w.splice(y,1),o.value=w}else{const w=o.value.includes(h);if(e.mandatory&&w)return;o.value=x??!w?[h]:[]}}function s(h){if(e.multiple,o.value.length){const x=o.value[0],N=r.findIndex(f=>f.id===x);let w=(N+h)%r.length,y=r[w];for(;y.disabled&&w!==N;)w=(w+h)%r.length,y=r[w];if(y.disabled)return;o.value=[r[w].id]}else{const x=r.find(N=>!N.disabled);x&&(o.value=[x.id])}}const v={register:l,unregister:c,selected:o,select:d,disabled:n.toRef(e,"disabled"),prev:()=>s(r.length-1),next:()=>s(1),isSelected:h=>o.value.includes(h),selectedClass:n.computed(()=>e.selectedClass),items:n.computed(()=>r),getItemIndex:h=>Wr(r,h)};return n.provide(t,v),v}function Wr(e,t){const a=Vn(e,[t]);return a.length?e.findIndex(r=>r.id===a[0]):-1}function Vn(e,t){const a=[];return t.forEach(r=>{const o=e.find(l=>ce(r,l.value)),i=e[r];(o==null?void 0:o.value)!=null?a.push(o.id):i!=null&&a.push(i.id)}),a}function zr(e,t){const a=[];return t.forEach(r=>{const o=e.findIndex(i=>i.id===r);if(~o){const i=e[o];a.push(i.value!=null?i.value:o)}}),a}function Ur(e,t){n.watch(()=>{var a;return(a=e.isActive)==null?void 0:a.value},a=>{e.isLink.value&&a&&t&&n.nextTick(()=>{t(!0)})},{immediate:!0})}function L(e){const t=n.getCurrentInstance();t&&(t.render=e)}const qr=$({href:String,replace:Boolean,to:[String,Object],exact:Boolean},"VueRouter");function Gr(e,t){const a=n.resolveDynamicComponent("RouterLink"),r=n.computed(()=>!!(e.href||e.to)),o=n.computed(()=>(r==null?void 0:r.value)||bt(t,"click")||bt(e,"click"));if(typeof a=="string")return{isLink:r,isClickable:o,href:n.toRef(e,"href")};const i=e.to?a.useLink(e):void 0;return{isLink:r,isClickable:o,route:i==null?void 0:i.route,navigate:i==null?void 0:i.navigate,isActive:i&&n.computed(()=>{var l,c;return e.exact?(l=i.isExactActive)==null?void 0:l.value:(c=i.isActive)==null?void 0:c.value}),href:n.computed(()=>e.to?i==null?void 0:i.route.value.href:e.href)}}const kn="y-plate-wave__animation";function _n(e){if(!e)return;const t=document.createElement("span");t.className=kn,e.appendChild(t),t.dataset.activated=String(performance.now())}function St(e){if(!e)return;const t=e.getElementsByClassName(kn);if(t.length===0)return;const a=t[t.length-1];if(a.dataset.isHiding)return;a.dataset.isHiding="true";const r=performance.now()-Number(a.dataset.activated),o=Math.max(250-r,0);setTimeout(()=>{a&&e.removeChild(a)},o+300)}let Nt=!1;function Tn(e){_n(e.currentTarget)}function Ye(e){St(e.currentTarget)}function Xr(e){}function Dn(e){!Nt&&(e.key==="Enter"||e.key==="Space")&&(Nt=!0,_n(e.currentTarget))}function An(e){Nt=!1,St(e.currentTarget)}function En(e){e.removeEventListener("mousedown",Tn),e.removeEventListener("mouseup",Ye),e.removeEventListener("mouseleave",Ye),e.removeEventListener("keydown",Dn),e.removeEventListener("keyup",An)}function On(e,t,a=!1){const{value:r,modifiers:o}=t;let i=r??!0;if(typeof r=="boolean"&&(i=r),i||St(e),i&&a){if(o.stop){e.addEventListener("mousedown",Xr);return}e.addEventListener("mousedown",Tn),e.addEventListener("mouseup",Ye),e.addEventListener("mouseleave",Ye),e.addEventListener("keydown",Dn),e.addEventListener("keyup",An),e.addEventListener("blur",Ye)}else!i&&!a&&En(e)}const Mn={mounted(e,t){On(e,t,!0)},updated(e,t){t.value!==t.oldValue&&On(e,t)},unmount(e){En(e)}},Zr=/rgb(a?)\((?<v>.*)\)/,Jr=/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/;function Ct(e){if(e&&e[0]==="#"){const t=e.substring(1,e.length),a=t.length,r=[];if(a===3||a===6){const o=a===6?2:1;for(let i=0;i<3;i+=1){const l=t.substring(i*o,i*o+o);r.push(Number.parseInt(l,16))}return r}}}function Ve(e){return Zr.test(e)||Jr.test(e)}const Pn=Y({name:"YSpinnerRing",render(){return n.createVNode("svg",{class:"y-spinner-ring",width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},[n.createVNode("circle",{class:"y-spinner-ring__circle",cx:"24",cy:"24",r:"18","stroke-width":"4","stroke-dasharray":"113.097","stroke-dashoffset":"113.097"},null)])}}),Qr=Symbol.for("yuyeon.y-toggle-button"),te="y-button",Xe=$({loading:Boolean,active:{type:Boolean,default:void 0},injectSymbol:{type:null,default:Qr},variation:{type:String},small:Boolean,icon:Boolean,outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},filled:{type:Boolean,default:!1},color:{type:String},noWave:{type:Boolean,default:!1},...qr(),...jr()},"YButton"),q=Y({name:"YButton",directives:{PlateWave:Mn},props:Xe(),emits:{click:e=>!0,"choice:selected":e=>!0},setup(e,{attrs:t,slots:a,emit:r}){const o=Kr(e,e.injectSymbol,!1),i=Gr(e,t);Ur(i,o==null?void 0:o.select);const l=n.computed(()=>{var h;return e.active!==void 0?e.active:i.isLink.value?(h=i.isActive)==null?void 0:h.value:o==null?void 0:o.isSelected.value}),c=n.computed(()=>{const{variation:h}=e;return typeof h=="string"?h.split(",").map(x=>x.trim()):[]}),u=n.computed(()=>{const{outlined:h,rounded:x,filled:N,small:w,icon:y}=e;return{[`${te}--outlined`]:c.value.includes("outlined")||h,[`${te}--rounded`]:c.value.includes("rounded")||x,[`${te}--filled`]:c.value.includes("filled")||N,[`${te}--text`]:c.value.includes("text"),[`${te}--small`]:c.value.includes("small")||w,[`${te}--x-small`]:c.value.includes("x-small")||w,[`${te}--icon`]:c.value.includes("icon")||y,[`${te}--color`]:e.color,[`${te}--loading`]:e.loading,[`${te}--disabled`]:e.disabled,[`${te}--active`]:l.value}}),d=n.computed(()=>{let{color:h}=e,x;return h&&!Ve(h)&&(h=`var(--y-theme-${h})`,x=`var(--y-theme-on-${e.color})`),{"--y-button__color":h,"--y-button__text-color":x}}),s=n.computed(()=>(o==null?void 0:o.disabled.value)||e.disabled);function v(h){var x;s.value||e.loading||i.isLink.value&&(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey||h.button!==0||t.target==="_blank")||(r("click",h),(x=i.navigate)==null||x.call(i,h),o==null||o.toggle())}return L(()=>{const h=i.isLink.value?"a":"button";return n.withDirectives(n.createVNode(h,{type:h==="a"?void 0:"button",class:[`${te}`,o==null?void 0:o.selectedClass.value,{...u.value}],href:e.disabled?void 0:i.href.value,style:d.value,onClick:v,disabled:e.disabled?!0:void 0},{default:()=>{var x,N,w;return[n.createVNode("span",{class:["y-button__content"]},[e.loading&&(a.loading?(x=a.loading)==null?void 0:x.call(a):n.createVNode(Pn,n.mergeProps({width:"24",height:"24"}),null)),(N=a.default)==null?void 0:N.call(a)]),(w=a.append)==null?void 0:w.call(a)]}}),[[n.resolveDirective("plate-wave"),!e.noWave&&!e.loading]])}),{link:i}}}),eo=$({focused:Boolean,"onUpdate:focused":Function},"focus");function Vt(e,t){const a=W(e,"focused");function r(){a.value=!0}function o(){a.value=!1}const i=n.computed(()=>({[`${t}--focused`]:a.value}));return{focused:a,whenFocus:r,whenBlur:o,focusedClasses:i}}const to=(e,t,a)=>{function r(o){e.classList.forEach(i=>{i.startsWith("y-theme--")&&i!==o&&e.classList.remove(i)}),e.classList.add(o)}n.watchEffect(()=>{var c,u,d,s,v;const o=((u=(c=t.instance)==null?void 0:c.$yuyeon)==null?void 0:u.theme)??((v=(s=(d=a==null?void 0:a.ctx)==null?void 0:d.root.appContext.config.globalProperties)==null?void 0:s.$yuyeon)==null?void 0:v.theme),i=t.value??n.unref(o.currentThemeKey)??"";if(!i)return;const l=`y-theme--${i}`;r(l)},{flush:"post"})};/** @preserve
|
|
2
2
|
///// SAPC APCA - Advanced Perceptual Contrast Algorithm
|
|
3
3
|
///// Beta 0.1.9 W3 • contrast function only
|
|
4
4
|
///// DIST: W3 • Revision date: July 3, 2022
|
|
@@ -9,8 +9,8 @@ import { isColorValue } from "../../util/color/index.mjs";
|
|
|
9
9
|
import { defineComponent, propsFactory } from "../../util/component/index.mjs";
|
|
10
10
|
import { YSpinnerRing } from "../loading/YSpinnerRing.mjs";
|
|
11
11
|
import { Y_TOGGLE_BUTTON_KEY } from "../toggle-button/index.mjs";
|
|
12
|
-
/**
|
|
13
|
-
* Style
|
|
12
|
+
/**
|
|
13
|
+
* Style
|
|
14
14
|
*/
|
|
15
15
|
import "./YButton.scss";
|
|
16
16
|
const NAME = 'y-button';
|
|
@@ -155,10 +155,10 @@ export const YButton = defineComponent({
|
|
|
155
155
|
}, {
|
|
156
156
|
default: () => [_createVNode("span", {
|
|
157
157
|
"class": ['y-button__content']
|
|
158
|
-
}, [props.loading && _createVNode(YSpinnerRing, mergeProps({
|
|
158
|
+
}, [props.loading && (slots.loading ? slots.loading?.() : _createVNode(YSpinnerRing, mergeProps({
|
|
159
159
|
width: '24',
|
|
160
160
|
height: '24'
|
|
161
|
-
}), null), slots.default?.()]), slots.append?.()]
|
|
161
|
+
}), null)), slots.default?.()]), slots.append?.()]
|
|
162
162
|
}), [[_resolveDirective("plate-wave"), !props.noWave && !props.loading]]);
|
|
163
163
|
});
|
|
164
164
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YButton.mjs","names":["computed","mergeProps","pressChoiceItemPropsOptions","useChoiceItem","useChoiceByLink","useRender","pressVueRouterPropsOptions","useLink","PlateWave","isColorValue","defineComponent","propsFactory","YSpinnerRing","Y_TOGGLE_BUTTON_KEY","NAME","pressYButtonProps","loading","Boolean","active","type","default","undefined","injectSymbol","variation","String","small","icon","outlined","rounded","filled","color","noWave","YButton","name","directives","props","emits","click","event","choice","setup","_ref","attrs","slots","emit","link","select","isActive","isLink","value","isSelected","variations","split","map","trim","classes","includes","disabled","styles","textColor","isDisabled","onClick","e","metaKey","altKey","ctrlKey","shiftKey","button","target","navigate","toggle","Tag","_withDirectives","_createVNode","selectedClass","href","width","height","append","_resolveDirective"],"sources":["../../../src/components/button/YButton.tsx"],"sourcesContent":["import type { PropType } from 'vue';\r\nimport { computed, mergeProps } from 'vue';\r\n\r\nimport {\r\n pressChoiceItemPropsOptions,\r\n useChoiceItem,\r\n} from '@/composables/choice';\r\nimport { useChoiceByLink } from '@/composables/choice-link';\r\nimport { useRender } from '@/composables/component';\r\nimport { pressVueRouterPropsOptions, useLink } from '@/composables/vue-router';\r\nimport { PlateWave } from '@/directives/plate-wave';\r\nimport { isColorValue } from '@/util/color';\r\nimport { defineComponent, propsFactory } from '@/util/component';\r\n\r\nimport { YSpinnerRing } from '../loading/YSpinnerRing';\r\nimport { Y_TOGGLE_BUTTON_KEY } from '../toggle-button';\r\n\r\n/**\r\n * Style\r\n */\r\nimport './YButton.scss';\r\n\r\nconst NAME = 'y-button';\r\n\r\nexport const pressYButtonProps = propsFactory(\r\n {\r\n loading: Boolean,\r\n active: { type: Boolean, default: undefined },\r\n injectSymbol: { type: null, default: Y_TOGGLE_BUTTON_KEY },\r\n //\r\n variation: {\r\n type: String as PropType<string>,\r\n },\r\n small: Boolean,\r\n icon: Boolean,\r\n outlined: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n rounded: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n filled: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n //\r\n color: {\r\n type: String,\r\n },\r\n noWave: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n ...pressVueRouterPropsOptions(),\r\n ...pressChoiceItemPropsOptions(),\r\n },\r\n 'YButton',\r\n);\r\n\r\nexport const YButton = defineComponent({\r\n name: 'YButton',\r\n directives: {\r\n PlateWave,\r\n },\r\n props: pressYButtonProps(),\r\n emits: {\r\n click: (event: MouseEvent) => true,\r\n 'choice:selected': (choice: { value: boolean }) => true,\r\n },\r\n setup(props, { attrs, slots, emit }) {\r\n const choice = useChoiceItem(props, props.injectSymbol, false);\r\n const link = useLink(props, attrs);\r\n useChoiceByLink(link, choice?.select);\r\n\r\n const isActive = computed(() => {\r\n if (props.active !== undefined) {\r\n return props.active;\r\n }\r\n if (link.isLink.value) {\r\n return link.isActive?.value;\r\n }\r\n return choice?.isSelected.value;\r\n });\r\n\r\n const variations = computed(() => {\r\n const { variation } = props;\r\n if (typeof variation === 'string') {\r\n return variation.split(',').map((value) => {\r\n return value.trim();\r\n });\r\n }\r\n return [];\r\n });\r\n\r\n const classes = computed(() => {\r\n const { outlined, rounded, filled, small, icon } = props;\r\n return {\r\n [`${NAME}--outlined`]:\r\n variations.value.includes('outlined') || outlined,\r\n [`${NAME}--rounded`]: variations.value.includes('rounded') || rounded,\r\n [`${NAME}--filled`]: variations.value.includes('filled') || filled,\r\n [`${NAME}--text`]: variations.value.includes('text'),\r\n [`${NAME}--small`]: variations.value.includes('small') || small,\r\n [`${NAME}--x-small`]: variations.value.includes('x-small') || small,\r\n [`${NAME}--icon`]: variations.value.includes('icon') || icon,\r\n [`${NAME}--color`]: props.color,\r\n [`${NAME}--loading`]: props.loading,\r\n [`${NAME}--disabled`]: props.disabled,\r\n [`${NAME}--active`]: isActive.value,\r\n };\r\n });\r\n\r\n const styles = computed(() => {\r\n let { color } = props;\r\n let textColor: string | undefined;\r\n if (color && !isColorValue(color)) {\r\n color = `var(--y-theme-${color})`;\r\n textColor = `var(--y-theme-on-${props.color})`;\r\n }\r\n return {\r\n [`--y-button__color`]: color,\r\n [`--y-button__text-color`]: textColor,\r\n };\r\n });\r\n\r\n const isDisabled = computed(() => {\r\n return choice?.disabled.value || props.disabled;\r\n });\r\n\r\n /// Events\r\n function onClick(e: MouseEvent) {\r\n if (\r\n isDisabled.value ||\r\n props.loading ||\r\n (link.isLink.value &&\r\n (e.metaKey ||\r\n e.altKey ||\r\n e.ctrlKey ||\r\n e.shiftKey ||\r\n e.button !== 0 ||\r\n attrs.target === '_blank'))\r\n ) {\r\n return;\r\n }\r\n emit('click', e);\r\n link.navigate?.(e);\r\n choice?.toggle();\r\n }\r\n\r\n useRender(() => {\r\n const Tag = link.isLink.value ? 'a' : 'button';\r\n return (\r\n <Tag\r\n type={Tag === 'a' ? undefined : 'button'}\r\n class={[\r\n `${NAME}`,\r\n choice?.selectedClass.value,\r\n {\r\n ...classes.value,\r\n },\r\n ]}\r\n href={props.disabled ? undefined : link.href.value}\r\n style={styles.value}\r\n onClick={onClick}\r\n disabled={props.disabled ? true : undefined}\r\n v-plate-wave={!props.noWave && !props.loading}\r\n >\r\n <span class={['y-button__content']}>\r\n {props.loading && (\r\n <YSpinnerRing\r\n {...mergeProps({ width: '24', height: '24' })}\r\n ></YSpinnerRing>\r\n )}\r\n {slots.default?.()}\r\n </span>\r\n {slots.append?.()}\r\n </Tag>\r\n );\r\n });\r\n\r\n return {\r\n link,\r\n };\r\n },\r\n});\r\n\r\nexport type YButton = InstanceType<typeof YButton>;\r\n"],"mappings":";AACA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAGzCC,2BAA2B,EAC3BC,aAAa;AAAA,SAENC,eAAe;AAAA,SACfC,SAAS;AAAA,SACTC,0BAA0B,EAAEC,OAAO;AAAA,SACnCC,SAAS;AAAA,SACTC,YAAY;AAAA,SACZC,eAAe,EAAEC,YAAY;AAAA,SAE7BC,YAAY;AAAA,SACZC,mBAAmB;AAE5B;AACA;AACA;AACA;AAEA,MAAMC,IAAI,GAAG,UAAU;AAEvB,OAAO,MAAMC,iBAAiB,GAAGJ,YAAY,CAC3C;EACEK,OAAO,EAAEC,OAAO;EAChBC,MAAM,EAAE;IAAEC,IAAI,EAAEF,OAAO;IAAEG,OAAO,EAAEC;EAAU,CAAC;EAC7CC,YAAY,EAAE;IAAEH,IAAI,EAAE,IAAI;IAAEC,OAAO,EAAEP;EAAoB,CAAC;EAC1D;EACAU,SAAS,EAAE;IACTJ,IAAI,EAAEK;EACR,CAAC;EACDC,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ChoiceByLink","useRender","pressVueRouterPropsOptions","useLink","PlateWave","isColorValue","defineComponent","propsFactory","YSpinnerRing","Y_TOGGLE_BUTTON_KEY","NAME","pressYButtonProps","loading","Boolean","active","type","default","undefined","injectSymbol","variation","String","small","icon","outlined","rounded","filled","color","noWave","YButton","name","directives","props","emits","click","event","choice","setup","_ref","attrs","slots","emit","link","select","isActive","isLink","value","isSelected","variations","split","map","trim","classes","includes","disabled","styles","textColor","isDisabled","onClick","e","metaKey","altKey","ctrlKey","shiftKey","button","target","navigate","toggle","Tag","_withDirectives","_createVNode","selectedClass","href","width","height","append","_resolveDirective"],"sources":["../../../src/components/button/YButton.tsx"],"sourcesContent":["import type { PropType } from 'vue';\nimport { computed, mergeProps } from 'vue';\n\nimport {\n pressChoiceItemPropsOptions,\n useChoiceItem,\n} from '@/composables/choice';\nimport { useChoiceByLink } from '@/composables/choice-link';\nimport { useRender } from '@/composables/component';\nimport { pressVueRouterPropsOptions, useLink } from '@/composables/vue-router';\nimport { PlateWave } from '@/directives/plate-wave';\nimport { isColorValue } from '@/util/color';\nimport { defineComponent, propsFactory } from '@/util/component';\n\nimport { YSpinnerRing } from '../loading/YSpinnerRing';\nimport { Y_TOGGLE_BUTTON_KEY } from '../toggle-button';\n\n/**\n * Style\n */\nimport './YButton.scss';\n\nconst NAME = 'y-button';\n\nexport const pressYButtonProps = propsFactory(\n {\n loading: Boolean,\n active: { type: Boolean, default: undefined },\n injectSymbol: { type: null, default: Y_TOGGLE_BUTTON_KEY },\n //\n variation: {\n type: String as PropType<string>,\n },\n small: Boolean,\n icon: Boolean,\n outlined: {\n type: Boolean,\n default: false,\n },\n rounded: {\n type: Boolean,\n default: false,\n },\n filled: {\n type: Boolean,\n default: false,\n },\n //\n color: {\n type: String,\n },\n noWave: {\n type: Boolean,\n default: false,\n },\n ...pressVueRouterPropsOptions(),\n ...pressChoiceItemPropsOptions(),\n },\n 'YButton',\n);\n\nexport const YButton = defineComponent({\n name: 'YButton',\n directives: {\n PlateWave,\n },\n props: pressYButtonProps(),\n emits: {\n click: (event: MouseEvent) => true,\n 'choice:selected': (choice: { value: boolean }) => true,\n },\n setup(props, { attrs, slots, emit }) {\n const choice = useChoiceItem(props, props.injectSymbol, false);\n const link = useLink(props, attrs);\n useChoiceByLink(link, choice?.select);\n\n const isActive = computed(() => {\n if (props.active !== undefined) {\n return props.active;\n }\n if (link.isLink.value) {\n return link.isActive?.value;\n }\n return choice?.isSelected.value;\n });\n\n const variations = computed(() => {\n const { variation } = props;\n if (typeof variation === 'string') {\n return variation.split(',').map((value) => {\n return value.trim();\n });\n }\n return [];\n });\n\n const classes = computed(() => {\n const { outlined, rounded, filled, small, icon } = props;\n return {\n [`${NAME}--outlined`]:\n variations.value.includes('outlined') || outlined,\n [`${NAME}--rounded`]: variations.value.includes('rounded') || rounded,\n [`${NAME}--filled`]: variations.value.includes('filled') || filled,\n [`${NAME}--text`]: variations.value.includes('text'),\n [`${NAME}--small`]: variations.value.includes('small') || small,\n [`${NAME}--x-small`]: variations.value.includes('x-small') || small,\n [`${NAME}--icon`]: variations.value.includes('icon') || icon,\n [`${NAME}--color`]: props.color,\n [`${NAME}--loading`]: props.loading,\n [`${NAME}--disabled`]: props.disabled,\n [`${NAME}--active`]: isActive.value,\n };\n });\n\n const styles = computed(() => {\n let { color } = props;\n let textColor: string | undefined;\n if (color && !isColorValue(color)) {\n color = `var(--y-theme-${color})`;\n textColor = `var(--y-theme-on-${props.color})`;\n }\n return {\n [`--y-button__color`]: color,\n [`--y-button__text-color`]: textColor,\n };\n });\n\n const isDisabled = computed(() => {\n return choice?.disabled.value || props.disabled;\n });\n\n /// Events\n function onClick(e: MouseEvent) {\n if (\n isDisabled.value ||\n props.loading ||\n (link.isLink.value &&\n (e.metaKey ||\n e.altKey ||\n e.ctrlKey ||\n e.shiftKey ||\n e.button !== 0 ||\n attrs.target === '_blank'))\n ) {\n return;\n }\n emit('click', e);\n link.navigate?.(e);\n choice?.toggle();\n }\n\n useRender(() => {\n const Tag = link.isLink.value ? 'a' : 'button';\n return (\n <Tag\n type={Tag === 'a' ? undefined : 'button'}\n class={[\n `${NAME}`,\n choice?.selectedClass.value,\n {\n ...classes.value,\n },\n ]}\n href={props.disabled ? undefined : link.href.value}\n style={styles.value}\n onClick={onClick}\n disabled={props.disabled ? true : undefined}\n v-plate-wave={!props.noWave && !props.loading}\n >\n <span class={['y-button__content']}>\n {props.loading &&\n (slots.loading ? (\n slots.loading?.()\n ) : (\n <YSpinnerRing\n {...mergeProps({ width: '24', height: '24' })}\n ></YSpinnerRing>\n ))}\n {slots.default?.()}\n </span>\n {slots.append?.()}\n </Tag>\n );\n });\n\n return {\n link,\n };\n },\n});\n\nexport type YButton = InstanceType<typeof YButton>;\n"],"mappings":";AACA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAGzCC,2BAA2B,EAC3BC,aAAa;AAAA,SAENC,eAAe;AAAA,SACfC,SAAS;AAAA,SACTC,0BAA0B,EAAEC,OAAO;AAAA,SACnCC,SAAS;AAAA,SACTC,YAAY;AAAA,SACZC,eAAe,EAAEC,YAAY;AAAA,SAE7BC,YAAY;AAAA,SACZC,mBAAmB;AAE5B;AACA;AACA;AACA;AAEA,MAAMC,IAAI,GAAG,UAAU;AAEvB,OAAO,MAAMC,iBAAiB,GAAGJ,YAAY,CAC3C;EACEK,OAAO,EAAEC,OAAO;EAChBC,MAAM,EAAE;IAAEC,IAAI,EAAEF,OAAO;IAAEG,OAAO,EAAEC;EAAU,CAAC;EAC7CC,YAAY,EAAE;IAAEH,IAAI,EAAE,IAAI;IAAEC,OAAO,EAAEP;EAAoB,CAAC;EAC1D;EACAU,SAAS,EAAE;IACTJ,IAAI,EAAEK;EACR,CAAC;EACDC,KAAK,EAAER,OAAO;EACdS,IAAI,EAAET,OAAO;EACbU,QAAQ,EAAE;IACRR,IAAI,EAAEF,OAAO;IACbG,OAAO,EAAE;EACX,CAAC;EACDQ,OAAO,EAAE;IACPT,IAAI,EAAEF,OAAO;I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