物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

12 lines
2.9 KiB

import{d as y,c as o,G as S,B as v,p as z,o as k,b as C,q as $,w as _,J as w,K as T,n as u}from"./index-bVOhw2NF.js";import{c as R,u as B,f as h,g as p,h as I}from"./light-Cua7cqmF.js";import{u as O}from"./use-houdini-BLG-ZGPq.js";import{f as j}from"./format-length-B-p6aW7q.js";import{g as E}from"./light-JlT3L7BR.js";import"./context-KbjOeZY_.js";import"./_initCloneObject-K-Y0ueWp.js";import"./_baseFor-mOzdmxoL.js";import"./is-browser-DqcmxZSF.js";const N=R("gradient-text",`
display: inline-block;
font-weight: var(--n-font-weight);
-webkit-background-clip: text;
background-clip: text;
color: #0000;
white-space: nowrap;
background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%);
transition:
--n-color-start .3s var(--n-bezier),
--n-color-end .3s var(--n-bezier);
`),V=Object.assign(Object.assign({},h.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]}),F=y({name:"GradientText",props:V,setup(e){O();const{mergedClsPrefixRef:n,inlineThemeDisabled:s}=B(e),i=o(()=>{const{type:t}=e;return t==="danger"?"error":t}),g=o(()=>{let t=e.size||e.fontSize;return t&&(t=j(t)),t||void 0}),f=o(()=>{const t=e.color||e.gradient;if(typeof t=="string")return t;if(t){const l=t.deg||0,c=t.from,d=t.to;return`linear-gradient(${l}deg, ${c} 0%, ${d} 100%)`}}),a=h("GradientText","-gradient-text",N,E,e,n),m=o(()=>{const{value:t}=i,{common:{cubicBezierEaseInOut:l},self:{rotate:c,[p("colorStart",t)]:d,[p("colorEnd",t)]:x,fontWeight:b}}=a.value;return{"--n-bezier":l,"--n-rotate":c,"--n-color-start":d,"--n-color-end":x,"--n-font-weight":b}}),r=s?I("gradient-text",o(()=>i.value[0]),m,e):void 0;return{mergedClsPrefix:n,compatibleType:i,styleFontSize:g,styleBgImage:f,cssVars:s?void 0:m,themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender}},render(){const{mergedClsPrefix:e,onRender:n}=this;return n==null||n(),S("span",{class:[`${e}-gradient-text`,`${e}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}}),G=y({name:"EsGradientText",components:{},props:{options:{type:Object,default:()=>({})},datasets:{type:[String,Boolean,Number],default:""}},setup(e){const n=o(()=>({width:"100%",height:"100%"})),s=o(()=>({fontSize:`${e.options["font-size"]}px`,fontWeight:`${e.options["font-weight"]}`,fontFamily:`${e.options["font-family"]}`})),i=()=>{e.options.link&&window.open(e.options.link,"_blank")};return{...v(e.options),textContainerStyle:n,textStyle:s,clickHandle:i}}});function H(e,n,s,i,g,f){const a=F;return k(),C("div",{class:"es-text",style:u(e.textContainerStyle)},[$(a,{class:"es-text-content",gradient:e.options.gradient,style:u(e.textStyle),onClick:e.clickHandle},{default:_(()=>[w(T(e.options.text),1)]),_:1},8,["gradient","style","onClick"])],4)}const Q=z(G,[["render",H]]);export{Q as default};