mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-22 03:23:35 +08:00
110 lines
24 KiB
JavaScript
110 lines
24 KiB
JavaScript
import{q as Go,u as _o,c as Mo,a as Lo,b as Co,d as w,_ as Ao,e as no,n as O,f as Ko,g as Vo,h as Po,j as k,k as y,l as vo,m as jo,o as So,p as L,I as No,L as Oo,s as qo,t as Qo,v as i,w as eo}from"./Loading.CYk0ZDH9.js";import{p as Y,q as Xo,h as M,ab as Yo,ac as Uo,F as uo,L as fo,ad as Jo,s as Zo,d as xo,a2 as oe,ae as ee,T as re,$ as wo,X as te,o as I,c as K,P as ne,af as se,b as co,w as ie,E as po,N as ro,K as ae}from"./framework.BNdm2jZV.js";function le(o,n){if(o===void 0)return!1;if(n){const{context:{ids:l}}=n;return l.has(o)}return Go(o)!==null}function de(o){const n=M(o),l=Y(n.value);return Xo(n,d=>{l.value=d}),typeof o=="function"?l:{__v_isRef:!0,get value(){return l.value},set value(d){o.set(d)}}}function $o(o,...n){if(Array.isArray(o))o.forEach(l=>$o(l,...n));else return o(...n)}function U(o){return o.some(n=>Yo(n)?!(n.type===Uo||n.type===uo&&!U(n.children)):!0)?o:null}function Fe(o,n){return o&&U(o())||n()}function Be(o,n,l){return o&&U(o(n))||l(n)}function yo(o,n){return n(o&&U(o())||null)}function ce(o){return!(o&&U(o()))}function ue(o,n,l){if(!n)return;const d=_o(),s=M(()=>{const{value:r}=n;if(!r)return;const a=r[o];if(a)return a}),$=fo(Mo,null),F=()=>{Zo(()=>{const{value:r}=l,a=`${r}${o}Rtl`;if(le(a,d))return;const{value:T}=s;T&&T.style.mount({id:a,head:!0,anchorMetaName:Lo,props:{bPrefix:r?`.${r}-`:void 0},ssr:d,parent:$==null?void 0:$.styleMountTarget})})};return d?F():Jo(F),s}function mo(o){return o.replace(/#|\(|\)|,|\s|\./g,"_")}var fe=xo({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(o,{slots:n}){function l(r){o.width?r.style.maxWidth=`${r.offsetWidth}px`:r.style.maxHeight=`${r.offsetHeight}px`,r.offsetWidth}function d(r){o.width?r.style.maxWidth="0":r.style.maxHeight="0",r.offsetWidth;const{onLeave:a}=o;a&&a()}function s(r){o.width?r.style.maxWidth="":r.style.maxHeight="";const{onAfterLeave:a}=o;a&&a()}function $(r){if(r.style.transition="none",o.width){const a=r.offsetWidth;r.style.maxWidth="0",r.offsetWidth,r.style.transition="",r.style.maxWidth=`${a}px`}else if(o.reverse)r.style.maxHeight=`${r.offsetHeight}px`,r.offsetHeight,r.style.transition="",r.style.maxHeight="0";else{const a=r.offsetHeight;r.style.maxHeight="0",r.offsetWidth,r.style.transition="",r.style.maxHeight=`${a}px`}r.offsetWidth}function F(r){var a;o.width?r.style.maxWidth="":o.reverse||(r.style.maxHeight=""),(a=o.onAfterEnter)==null||a.call(o)}return()=>{const{group:r,width:a,appear:T,mode:V}=o,m=r?ee:re,q={name:a?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:T,onEnter:$,onAfterEnter:F,onBeforeLeave:l,onLeave:d,onAfterLeave:s};return r||(q.mode=V),oe(m,q,n)}}});const go=Co("n-form-item");function xe(o,{defaultSize:n="medium",mergedSize:l,mergedDisabled:d}={}){const s=fo(go,null);te(go,null);const $=M(l?()=>l(s):()=>{const{size:a}=o;if(a)return a;if(s){const{mergedSize:T}=s;if(T.value!==void 0)return T.value}return n}),F=M(d?()=>d(s):()=>{const{disabled:a}=o;return a!==void 0?a:s?s.disabled.value:!1}),r=M(()=>{const{status:a}=o;return a||(s==null?void 0:s.mergedValidationStatus.value)});return wo(()=>{s&&s.restoreValidation()}),{mergedSizeRef:$,mergedDisabledRef:F,mergedStatusRef:r,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const so=typeof document<"u"&&typeof window<"u",be=so&&"chrome"in window;so&&navigator.userAgent.includes("Firefox");const he=so&&navigator.userAgent.includes("Safari")&&!be,{cubicBezierEaseInOut:A}=Ao;function ve({duration:o=".2s",delay:n=".1s"}={}){return[w("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),w("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",`
|
|
opacity: 0!important;
|
|
margin-left: 0!important;
|
|
margin-right: 0!important;
|
|
`),w("&.fade-in-width-expand-transition-leave-active",`
|
|
overflow: hidden;
|
|
transition:
|
|
opacity ${o} ${A},
|
|
max-width ${o} ${A} ${n},
|
|
margin-left ${o} ${A} ${n},
|
|
margin-right ${o} ${A} ${n};
|
|
`),w("&.fade-in-width-expand-transition-enter-active",`
|
|
overflow: hidden;
|
|
transition:
|
|
opacity ${o} ${A} ${n},
|
|
max-width ${o} ${A},
|
|
margin-left ${o} ${A},
|
|
margin-right ${o} ${A};
|
|
`)]}var pe=no("base-wave",`
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
border-radius: inherit;
|
|
`),ye=xo({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(o){Ko("-base-wave",pe,se(o,"clsPrefix"));const n=Y(null),l=Y(!1);let d=null;return wo(()=>{d!==null&&window.clearTimeout(d)}),{active:l,selfRef:n,play(){d!==null&&(window.clearTimeout(d),l.value=!1,d=null),ne(()=>{var s;(s=n.value)==null||s.offsetHeight,l.value=!0,d=window.setTimeout(()=>{l.value=!1,d=null},1e3)})}}},render(){const{clsPrefix:o}=this;return I(),K("div",{ref:"selfRef","aria-hidden":!0,class:O([`${o}-base-wave`,this.active&&`${o}-base-wave--active`])},null,2)}}),me={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"};function ge(o){const{heightTiny:n,heightSmall:l,heightMedium:d,heightLarge:s,borderRadius:$,fontSizeTiny:F,fontSizeSmall:r,fontSizeMedium:a,fontSizeLarge:T,opacityDisabled:V,textColor2:m,textColor3:q,primaryColorHover:v,primaryColorPressed:D,borderColor:J,primaryColor:B,baseColor:u,infoColor:R,infoColorHover:E,infoColorPressed:W,successColor:t,successColorHover:x,successColorPressed:e,warningColor:g,warningColorHover:C,warningColorPressed:H,errorColor:P,errorColorHover:p,errorColorPressed:G,fontWeight:_,buttonColor2:Q,buttonColor2Hover:z,buttonColor2Pressed:f,fontWeightStrong:X}=o;return{...me,heightTiny:n,heightSmall:l,heightMedium:d,heightLarge:s,borderRadiusTiny:$,borderRadiusSmall:$,borderRadiusMedium:$,borderRadiusLarge:$,fontSizeTiny:F,fontSizeSmall:r,fontSizeMedium:a,fontSizeLarge:T,opacityDisabled:V,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:Q,colorSecondaryHover:z,colorSecondaryPressed:f,colorTertiary:Q,colorTertiaryHover:z,colorTertiaryPressed:f,colorQuaternary:"#0000",colorQuaternaryHover:z,colorQuaternaryPressed:f,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:m,textColorTertiary:q,textColorHover:v,textColorPressed:D,textColorFocus:v,textColorDisabled:m,textColorText:m,textColorTextHover:v,textColorTextPressed:D,textColorTextFocus:v,textColorTextDisabled:m,textColorGhost:m,textColorGhostHover:v,textColorGhostPressed:D,textColorGhostFocus:v,textColorGhostDisabled:m,border:`1px solid ${J}`,borderHover:`1px solid ${v}`,borderPressed:`1px solid ${D}`,borderFocus:`1px solid ${v}`,borderDisabled:`1px solid ${J}`,rippleColor:B,colorPrimary:B,colorHoverPrimary:v,colorPressedPrimary:D,colorFocusPrimary:v,colorDisabledPrimary:B,textColorPrimary:u,textColorHoverPrimary:u,textColorPressedPrimary:u,textColorFocusPrimary:u,textColorDisabledPrimary:u,textColorTextPrimary:B,textColorTextHoverPrimary:v,textColorTextPressedPrimary:D,textColorTextFocusPrimary:v,textColorTextDisabledPrimary:m,textColorGhostPrimary:B,textColorGhostHoverPrimary:v,textColorGhostPressedPrimary:D,textColorGhostFocusPrimary:v,textColorGhostDisabledPrimary:B,borderPrimary:`1px solid ${B}`,borderHoverPrimary:`1px solid ${v}`,borderPressedPrimary:`1px solid ${D}`,borderFocusPrimary:`1px solid ${v}`,borderDisabledPrimary:`1px solid ${B}`,rippleColorPrimary:B,colorInfo:R,colorHoverInfo:E,colorPressedInfo:W,colorFocusInfo:E,colorDisabledInfo:R,textColorInfo:u,textColorHoverInfo:u,textColorPressedInfo:u,textColorFocusInfo:u,textColorDisabledInfo:u,textColorTextInfo:R,textColorTextHoverInfo:E,textColorTextPressedInfo:W,textColorTextFocusInfo:E,textColorTextDisabledInfo:m,textColorGhostInfo:R,textColorGhostHoverInfo:E,textColorGhostPressedInfo:W,textColorGhostFocusInfo:E,textColorGhostDisabledInfo:R,borderInfo:`1px solid ${R}`,borderHoverInfo:`1px solid ${E}`,borderPressedInfo:`1px solid ${W}`,borderFocusInfo:`1px solid ${E}`,borderDisabledInfo:`1px solid ${R}`,rippleColorInfo:R,colorSuccess:t,colorHoverSuccess:x,colorPressedSuccess:e,colorFocusSuccess:x,colorDisabledSuccess:t,textColorSuccess:u,textColorHoverSuccess:u,textColorPressedSuccess:u,textColorFocusSuccess:u,textColorDisabledSuccess:u,textColorTextSuccess:t,textColorTextHoverSuccess:x,textColorTextPressedSuccess:e,textColorTextFocusSuccess:x,textColorTextDisabledSuccess:m,textColorGhostSuccess:t,textColorGhostHoverSuccess:x,textColorGhostPressedSuccess:e,textColorGhostFocusSuccess:x,textColorGhostDisabledSuccess:t,borderSuccess:`1px solid ${t}`,borderHoverSuccess:`1px solid ${x}`,borderPressedSuccess:`1px solid ${e}`,borderFocusSuccess:`1px solid ${x}`,borderDisabledSuccess:`1px solid ${t}`,rippleColorSuccess:t,colorWarning:g,colorHoverWarning:C,colorPressedWarning:H,colorFocusWarning:C,colorDisabledWarning:g,textColorWarning:u,textColorHoverWarning:u,textColorPressedWarning:u,textColorFocusWarning:u,textColorDisabledWarning:u,textColorTextWarning:g,textColorTextHoverWarning:C,textColorTextPressedWarning:H,textColorTextFocusWarning:C,textColorTextDisabledWarning:m,textColorGhostWarning:g,textColorGhostHoverWarning:C,textColorGhostPressedWarning:H,textColorGhostFocusWarning:C,textColorGhostDisabledWarning:g,borderWarning:`1px solid ${g}`,borderHoverWarning:`1px solid ${C}`,borderPressedWarning:`1px solid ${H}`,borderFocusWarning:`1px solid ${C}`,borderDisabledWarning:`1px solid ${g}`,rippleColorWarning:g,colorError:P,colorHoverError:p,colorPressedError:G,colorFocusError:p,colorDisabledError:P,textColorError:u,textColorHoverError:u,textColorPressedError:u,textColorFocusError:u,textColorDisabledError:u,textColorTextError:P,textColorTextHoverError:p,textColorTextPressedError:G,textColorTextFocusError:p,textColorTextDisabledError:m,textColorGhostError:P,textColorGhostHoverError:p,textColorGhostPressedError:G,textColorGhostFocusError:p,textColorGhostDisabledError:P,borderError:`1px solid ${P}`,borderHoverError:`1px solid ${p}`,borderPressedError:`1px solid ${G}`,borderFocusError:`1px solid ${p}`,borderDisabledError:`1px solid ${P}`,rippleColorError:P,waveOpacity:"0.6",fontWeight:_,fontWeightStrong:X}}const Ce={name:"Button",common:Vo,self:ge};function N(o){return Po(o,[255,255,255,.16])}function to(o){return Po(o,[0,0,0,.12])}const Pe=Co("n-button-group");var Se=w([no("button",`
|
|
margin: 0;
|
|
font-weight: var(--n-font-weight);
|
|
line-height: 1;
|
|
font-family: inherit;
|
|
padding: var(--n-padding);
|
|
height: var(--n-height);
|
|
font-size: var(--n-font-size);
|
|
border-radius: var(--n-border-radius);
|
|
color: var(--n-text-color);
|
|
background-color: var(--n-color);
|
|
width: var(--n-width);
|
|
white-space: nowrap;
|
|
outline: none;
|
|
position: relative;
|
|
z-index: auto;
|
|
border: none;
|
|
display: inline-flex;
|
|
flex-wrap: nowrap;
|
|
flex-shrink: 0;
|
|
align-items: center;
|
|
justify-content: center;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
transition:
|
|
color .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier),
|
|
opacity .3s var(--n-bezier),
|
|
border-color .3s var(--n-bezier);
|
|
`,[k("color",[y("border",{borderColor:"var(--n-border-color)"}),k("disabled",[y("border",{borderColor:"var(--n-border-color-disabled)"})]),vo("disabled",[w("&:focus",[y("state-border",{borderColor:"var(--n-border-color-focus)"})]),w("&:hover",[y("state-border",{borderColor:"var(--n-border-color-hover)"})]),w("&:active",[y("state-border",{borderColor:"var(--n-border-color-pressed)"})]),k("pressed",[y("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),k("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[y("border",{border:"var(--n-border-disabled)"})]),vo("disabled",[w("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[y("state-border",{border:"var(--n-border-focus)"})]),w("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[y("state-border",{border:"var(--n-border-hover)"})]),w("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[y("state-border",{border:"var(--n-border-pressed)"})]),k("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[y("state-border",{border:"var(--n-border-pressed)"})])]),k("loading","cursor: wait;"),no("base-wave",`
|
|
pointer-events: none;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
animation-iteration-count: 1;
|
|
animation-duration: var(--n-ripple-duration);
|
|
animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
|
|
`,[k("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),so&&"MozBoxSizing"in document.createElement("div").style?w("&::moz-focus-inner",{border:0}):null,y("border, state-border",`
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
border-radius: inherit;
|
|
transition: border-color .3s var(--n-bezier);
|
|
pointer-events: none;
|
|
`),y("border",`
|
|
border: var(--n-border);
|
|
`),y("state-border",`
|
|
border: var(--n-border);
|
|
border-color: #0000;
|
|
z-index: 1;
|
|
`),y("icon",`
|
|
margin: var(--n-icon-margin);
|
|
margin-left: 0;
|
|
height: var(--n-icon-size);
|
|
width: var(--n-icon-size);
|
|
max-width: var(--n-icon-size);
|
|
font-size: var(--n-icon-size);
|
|
position: relative;
|
|
flex-shrink: 0;
|
|
`,[no("icon-slot",`
|
|
height: var(--n-icon-size);
|
|
width: var(--n-icon-size);
|
|
position: absolute;
|
|
left: 0;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
`,[jo({top:"50%",originalTransform:"translateY(-50%)"})]),ve()]),y("content",`
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: nowrap;
|
|
min-width: 0;
|
|
`,[w("~",[y("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),k("block",`
|
|
display: flex;
|
|
width: 100%;
|
|
`),k("dashed",[y("border, state-border",{borderStyle:"dashed !important"})]),k("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),w("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),w("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]);const we={...So.props,color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!he},spinProps:Object},$e=xo({name:"Button",props:we,slots:Object,setup(o){const n=Y(null),l=Y(null),d=Y(!1),s=de(()=>!o.quaternary&&!o.tertiary&&!o.secondary&&!o.text&&(!o.color||o.ghost||o.dashed)&&o.bordered),$=fo(Pe,{}),{inlineThemeDisabled:F,mergedClsPrefixRef:r,mergedRtlRef:a,mergedComponentPropsRef:T}=qo(o),{mergedSizeRef:V}=xe({},{defaultSize:"medium",mergedSize:t=>{var H,P;const{size:x}=o;if(x)return x;const{size:e}=$;if(e)return e;const{mergedSize:g}=t||{};if(g)return g.value;const C=(P=(H=T==null?void 0:T.value)==null?void 0:H.Button)==null?void 0:P.size;return C||"medium"}}),m=M(()=>o.focusable&&!o.disabled),q=t=>{var x;m.value||t.preventDefault(),!o.nativeFocusBehavior&&(t.preventDefault(),!o.disabled&&m.value&&((x=n.value)==null||x.focus({preventScroll:!0})))},v=t=>{var x;if(!o.disabled&&!o.loading){const{onClick:e}=o;e&&$o(e,t),o.text||(x=l.value)==null||x.play()}},D=t=>{switch(t.key){case"Enter":if(!o.keyboard)return;d.value=!1}},J=t=>{switch(t.key){case"Enter":if(!o.keyboard||o.loading){t.preventDefault();return}d.value=!0}},B=()=>{d.value=!1},u=So("Button","-button",Se,Ce,o,r),R=ue("Button",a,r),E=M(()=>{const{common:{cubicBezierEaseInOut:t,cubicBezierEaseOut:x},self:e}=u.value,{rippleDuration:g,opacityDisabled:C,fontWeight:H,fontWeightStrong:P}=e,p=V.value,{dashed:G,type:_,ghost:Q,text:z,color:f,round:X,circle:io,textColor:j,secondary:To,tertiary:bo,quaternary:Ho,strong:zo}=o,Fo={"--n-font-weight":zo?P:H};let b={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const Z=_==="tertiary",ho=_==="default",c=Z?"default":_;if(z){const h=j||f;b={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":h||e[i("textColorText",c)],"--n-text-color-hover":h?N(h):e[i("textColorTextHover",c)],"--n-text-color-pressed":h?to(h):e[i("textColorTextPressed",c)],"--n-text-color-focus":h?N(h):e[i("textColorTextHover",c)],"--n-text-color-disabled":h||e[i("textColorTextDisabled",c)]}}else if(Q||G){const h=j||f;b={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":f||e[i("rippleColor",c)],"--n-text-color":h||e[i("textColorGhost",c)],"--n-text-color-hover":h?N(h):e[i("textColorGhostHover",c)],"--n-text-color-pressed":h?to(h):e[i("textColorGhostPressed",c)],"--n-text-color-focus":h?N(h):e[i("textColorGhostHover",c)],"--n-text-color-disabled":h||e[i("textColorGhostDisabled",c)]}}else if(To){const h=ho?e.textColor:Z?e.textColorTertiary:e[i("color",c)],S=f||h,oo=_!=="default"&&_!=="tertiary";b={"--n-color":oo?eo(S,{alpha:Number(e.colorOpacitySecondary)}):e.colorSecondary,"--n-color-hover":oo?eo(S,{alpha:Number(e.colorOpacitySecondaryHover)}):e.colorSecondaryHover,"--n-color-pressed":oo?eo(S,{alpha:Number(e.colorOpacitySecondaryPressed)}):e.colorSecondaryPressed,"--n-color-focus":oo?eo(S,{alpha:Number(e.colorOpacitySecondaryHover)}):e.colorSecondaryHover,"--n-color-disabled":e.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":S,"--n-text-color-hover":S,"--n-text-color-pressed":S,"--n-text-color-focus":S,"--n-text-color-disabled":S}}else if(bo||Ho){const h=ho?e.textColor:Z?e.textColorTertiary:e[i("color",c)],S=f||h;bo?(b["--n-color"]=e.colorTertiary,b["--n-color-hover"]=e.colorTertiaryHover,b["--n-color-pressed"]=e.colorTertiaryPressed,b["--n-color-focus"]=e.colorSecondaryHover,b["--n-color-disabled"]=e.colorTertiary):(b["--n-color"]=e.colorQuaternary,b["--n-color-hover"]=e.colorQuaternaryHover,b["--n-color-pressed"]=e.colorQuaternaryPressed,b["--n-color-focus"]=e.colorQuaternaryHover,b["--n-color-disabled"]=e.colorQuaternary),b["--n-ripple-color"]="#0000",b["--n-text-color"]=S,b["--n-text-color-hover"]=S,b["--n-text-color-pressed"]=S,b["--n-text-color-focus"]=S,b["--n-text-color-disabled"]=S}else b={"--n-color":f||e[i("color",c)],"--n-color-hover":f?N(f):e[i("colorHover",c)],"--n-color-pressed":f?to(f):e[i("colorPressed",c)],"--n-color-focus":f?N(f):e[i("colorFocus",c)],"--n-color-disabled":f||e[i("colorDisabled",c)],"--n-ripple-color":f||e[i("rippleColor",c)],"--n-text-color":j||(f?e.textColorPrimary:Z?e.textColorTertiary:e[i("textColor",c)]),"--n-text-color-hover":j||(f?e.textColorHoverPrimary:e[i("textColorHover",c)]),"--n-text-color-pressed":j||(f?e.textColorPressedPrimary:e[i("textColorPressed",c)]),"--n-text-color-focus":j||(f?e.textColorFocusPrimary:e[i("textColorFocus",c)]),"--n-text-color-disabled":j||(f?e.textColorDisabledPrimary:e[i("textColorDisabled",c)])};let ao={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};z?ao={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:ao={"--n-border":e[i("border",c)],"--n-border-hover":e[i("borderHover",c)],"--n-border-pressed":e[i("borderPressed",c)],"--n-border-focus":e[i("borderFocus",c)],"--n-border-disabled":e[i("borderDisabled",c)]};const{[i("height",p)]:lo,[i("fontSize",p)]:Bo,[i("padding",p)]:Eo,[i("paddingRound",p)]:Wo,[i("iconSize",p)]:Io,[i("borderRadius",p)]:Do,[i("iconMargin",p)]:Ro,waveOpacity:ko}=e;return{"--n-bezier":t,"--n-bezier-ease-out":x,"--n-ripple-duration":g,"--n-opacity-disabled":C,"--n-wave-opacity":ko,...Fo,...b,...ao,...{"--n-width":io&&!z?lo:"initial","--n-height":z?"initial":lo,"--n-font-size":Bo,"--n-padding":io||z?"initial":X?Wo:Eo,"--n-icon-size":Io,"--n-icon-margin":Ro,"--n-border-radius":z?"initial":io||X?lo:Do}}}),W=F?Qo("button",M(()=>{let t="";const{dashed:x,type:e,ghost:g,text:C,color:H,round:P,circle:p,textColor:G,secondary:_,tertiary:Q,quaternary:z,strong:f}=o;x&&(t+="a"),g&&(t+="b"),C&&(t+="c"),P&&(t+="d"),p&&(t+="e"),_&&(t+="f"),Q&&(t+="g"),z&&(t+="h"),f&&(t+="i"),H&&(t+=`j${mo(H)}`),G&&(t+=`k${mo(G)}`);const{value:X}=V;return t+=`l${X[0]}`,t+=`m${e[0]}`,t}),E,o):void 0;return{selfElRef:n,waveElRef:l,mergedClsPrefix:r,mergedFocusable:m,mergedSize:V,showBorder:s,enterPressed:d,rtlEnabled:R,handleMousedown:q,handleKeydown:J,handleBlur:B,handleKeyup:D,handleClick:v,customColorCssVars:M(()=>{const{color:t}=o;if(!t)return null;const x=N(t);return{"--n-border-color":t,"--n-border-color-hover":x,"--n-border-color-pressed":to(t),"--n-border-color-focus":x,"--n-border-color-disabled":t}}),cssVars:F?void 0:E,themeClass:W==null?void 0:W.themeClass,onRender:W==null?void 0:W.onRender}},render(){const{mergedClsPrefix:o,tag:n,onRender:l}=this;l==null||l();const d=yo(this.$slots.default,s=>s&&(I(),K("span",{class:O(`${o}-button__content`)},[L(()=>s)],2)));return I(),co(n,{ref:"selfElRef",class:O([this.themeClass,`${o}-button`,`${o}-button--${this.type}-type`,`${o}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${o}-button--rtl`,this.disabled&&`${o}-button--disabled`,this.block&&`${o}-button--block`,this.enterPressed&&`${o}-button--pressed`,!this.text&&this.dashed&&`${o}-button--dashed`,this.color&&`${o}-button--color`,this.secondary&&`${o}-button--secondary`,this.loading&&`${o}-button--loading`,this.ghost&&`${o}-button--ghost`]),tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:ro(this.cssVars),disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},{default:ie(()=>[L(()=>this.iconPlacement==="right"&&d),po(fe,{width:!0},{default:()=>yo(this.$slots.icon,s=>(this.loading||this.renderIcon||s)&&(I(),K("span",{class:O(`${o}-button__icon`),style:ro({margin:ce(this.$slots.default)?"0":""})},[po(No,null,{default:()=>this.loading?(I(),co(Oo,ae({clsPrefix:o,key:"loading",class:`${o}-icon-slot`,strokeWidth:20},this.spinProps),null,16,["clsPrefix","class"])):(I(),K("div",{key:"icon",class:O(`${o}-icon-slot`),role:"none"},[this.renderIcon?(I(),K(uo,{key:0},[L(()=>this.renderIcon())],64)):(I(),K(uo,{key:1},[L(()=>s)],64))],2))},1024)],6)))},1024),L(()=>this.iconPlacement==="left"&&d),this.text?L(()=>null):(I(),co(ye,{key:0,ref:"waveElRef",clsPrefix:o},null,8,["clsPrefix"])),this.showBorder?(I(),K("div",{key:2,"aria-hidden":!0,class:O(`${o}-button__border`),style:ro(this.customColorCssVars)},null,6)):L(()=>null),this.showBorder?(I(),K("div",{key:4,"aria-hidden":!0,class:O(`${o}-button__state-border`),style:ro(this.customColorCssVars)},null,6)):L(()=>null)]),_:2},1032,["class","tabindex","type","style","disabled","onClick","onBlur","onMousedown","onKeyup","onKeydown"])}}),Ee=$e;export{$e as B,fe as F,Ee as X,de as a,Ce as b,ue as c,Fe as d,$o as e,go as f,mo as g,Be as h,ce as i,he as j,so as k,yo as r,ge as s,xe as u};
|