it-tools/dist/client/assets/chunks/chunk-bfb518da.js

167 lines
20 KiB
JavaScript
Raw Normal View History

2024-04-28 00:48:29 +08:00
import{_ as oe}from"./chunk-6deddc2e.js";import{a as ie,_ as Y}from"./chunk-a740628f.js";import{d as z,c as S,h as t,j as G,D as j,E as _,G as ne,m as x,l as C,ak as M,z as D,M as W,q as d,K as F,aM as se,u as ae,r as le,S as ce,F as de,W as pe,X as ue,_ as ge}from"./chunk-449c23a2.js";import{u as fe,_ as he}from"./chunk-def49e3c.js";import{c as R}from"./chunk-0c1b4166.js";import{c as me}from"./chunk-f537339f.js";import{u as H}from"./chunk-767079b6.js";import{_ as N}from"./chunk-3fb34e39.js";import{c as ve}from"./chunk-ca3460ec.js";import{n as T,o as h,q as k,U as B,u as xe,v as J,w as L,x as ye,_ as be}from"../entries/src_pages_Home.page.16dc467b.js";import{N as K}from"./chunk-9519e52e.js";import{S as Z,E as Q,W as ee,I as te}from"./chunk-6e5bd8af.js";import{p as _e}from"./chunk-bee0cc36.js";import"./chunk-9a43cce8.js";import"./chunk-340feaf0.js";import"./chunk-fc34c9a6.js";import"./chunk-051b56e8.js";import"./chunk-66ac4853.js";import"./chunk-f94e2689.js";import"./chunk-e933942f.js";import"./chunk-302442b1.js";import"./chunk-44692048.js";import"./chunk-3db18d93.js";import"./chunk-cf010ec4.js";import"./chunk-ee54c1e8.js";import"./chunk-416dc92c.js";const Se=T([h("progress",{display:"inline-block"},[h("progress-icon",`
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
`),k("line",`
width: 100%;
display: block;
`,[h("progress-content",`
display: flex;
align-items: center;
`,[h("progress-graph",{flex:1})]),h("progress-custom-content",{marginLeft:"14px"}),h("progress-icon",`
width: 30px;
padding-left: 14px;
height: var(--n-icon-size-line);
line-height: var(--n-icon-size-line);
font-size: var(--n-icon-size-line);
`,[k("as-text",`
color: var(--n-text-color-line-outer);
text-align: center;
width: 40px;
font-size: var(--n-font-size);
padding-left: 4px;
transition: color .3s var(--n-bezier);
`)])]),k("circle, dashboard",{width:"120px"},[h("progress-custom-content",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
`),h("progress-text",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
color: inherit;
font-size: var(--n-font-size-circle);
color: var(--n-text-color-circle);
font-weight: var(--n-font-weight-circle);
transition: color .3s var(--n-bezier);
white-space: nowrap;
`),h("progress-icon",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
color: var(--n-icon-color);
font-size: var(--n-icon-size-circle);
`)]),k("multiple-circle",`
width: 200px;
color: inherit;
`,[h("progress-text",`
font-weight: var(--n-font-weight-circle);
color: var(--n-text-color-circle);
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
transition: color .3s var(--n-bezier);
`)]),h("progress-content",{position:"relative"}),h("progress-graph",{position:"relative"},[h("progress-graph-circle",[T("svg",{verticalAlign:"bottom"}),h("progress-graph-circle-fill",`
stroke: var(--n-fill-color);
transition:
opacity .3s var(--n-bezier),
stroke .3s var(--n-bezier),
stroke-dasharray .3s var(--n-bezier);
`,[k("empty",{opacity:0})]),h("progress-graph-circle-rail",`
transition: stroke .3s var(--n-bezier);
overflow: hidden;
stroke: var(--n-rail-color);
`)]),h("progress-graph-line",[k("indicator-inside",[h("progress-graph-line-rail",`
height: 16px;
line-height: 16px;
border-radius: 10px;
`,[h("progress-graph-line-fill",`
height: inherit;
border-radius: 10px;
`),h("progress-graph-line-indicator",`
background: #0000;
white-space: nowrap;
text-align: right;
margin-left: 14px;
margin-right: 14px;
height: inherit;
font-size: 12px;
color: var(--n-text-color-line-inner);
transition: color .3s var(--n-bezier);
`)])]),k("indicator-inside-label",`
height: 16px;
display: flex;
align-items: center;
`,[h("progress-graph-line-rail",`
flex: 1;
transition: background-color .3s var(--n-bezier);
`),h("progress-graph-line-indicator",`
background: var(--n-fill-color);
font-size: 12px;
transform: translateZ(0);
display: flex;
vertical-align: middle;
height: 16px;
line-height: 16px;
padding: 0 10px;
border-radius: 10px;
position: absolute;
white-space: nowrap;
color: var(--n-text-color-line-inner);
transition:
right .2s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`)]),h("progress-graph-line-rail",`
position: relative;
overflow: hidden;
height: var(--n-rail-height);
border-radius: 5px;
background-color: var(--n-rail-color);
transition: background-color .3s var(--n-bezier);
`,[h("progress-graph-line-fill",`
background: var(--n-fill-color);
position: relative;
border-radius: 5px;
height: inherit;
width: 100%;
max-width: 0%;
transition:
background-color .3s var(--n-bezier),
max-width .2s var(--n-bezier);
`,[k("processing",[T("&::after",`
content: "";
background-image: var(--n-line-bg-processing);
animation: progress-processing-animation 2s var(--n-bezier) infinite;
`)])])])])])]),T("@keyframes progress-processing-animation",`
0% {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 100%;
opacity: 1;
}
66% {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
opacity: 0;
}
100% {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
opacity: 0;
}
`)]),Ce={success:t(Z,null),error:t(Q,null),warning:t(ee,null),info:t(te,null)},$e=z({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:r}){const l=S(()=>B(e.height)),s=S(()=>e.railBorderRadius!==void 0?B(e.railBorderRadius):e.height!==void 0?B(e.height,{c:.5}):""),o=S(()=>e.fillBorderRadius!==void 0?B(e.fillBorderRadius):e.railBorderRadius!==void 0?B(e.railBorderRadius):e.height!==void 0?B(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:i,railColor:m,railStyle:p,percentage:a,unit:u,indicatorTextColor:g,status:c,showIndicator:v,fillColor:n,processing:y,clsPrefix:f}=e;return t("div",{class:`${f}-progress-content`,role:"none"},t("div",{class:`${f}-progress-graph`,"aria-hidden":!0},t("div",{class:[`${f}-progress-graph-line`,{[`${f}-progress-graph-line--indicator-${i}`]:!0}]},t("div",{class:`${f}-progress-graph-line-rail`,style:[{backgroundColor:m,height:l.value,borderRadius:s.value},p]},t("div",{class:[`${f}-progress-graph-line-fill`,y&&`${f}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:n,height:l.value,lineHeight:l.value,borderRadius:o.value}},i==="inside"?t("div",{class:`${f}-progress-graph-line-indicator`,style:{color:g}},r.default?r.default():`${a}${u}`):null)))),v&&i==="outside"?t("div",null,r.default?t("div",{class:`${f}-progress-custom-content`,style:{color:g},role:"none"},r.default()):c==="default"?t("div",{role:"none",class:`${f}-progress-icon ${f}-progress-icon--as-text`,style:{color:g}},a,u):t("div",{class:`${f}-progress-icon`,"aria-hidden":!0},t(K,{clsPrefix:f},{default:()=>Ce[c]}))):null)}}}),we={success:t(Z,null),error:t(Q,null),warning:t(ee,null),info:t(te,null)},ke=z({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:r}){function l(s,o,i){const{gapDegree:m,viewBoxWidth:p,strokeWidth:a}=e,u=50,g=0,c=u,v=0,n=2*u,y=50+a/2,f=`M ${y},${y} m ${g},${c}
a ${u},${u} 0 1 1 ${v},${-n}
a ${u},${u} 0 1 1 ${-v},${n}`,$=Math.PI*2*u,w={stroke:i,strokeDasharray:`${s/100*($-m)}px ${p*8}px`,strokeDashoffset:`-${m/2}px`,transformOrigin:o?"center":void 0,transform:o?`rotate(${o}deg)`:void 0};return{pathString:f,pathStyle:w}}return()=>{const{fillColor:s,railColor:o,strokeWidth:i,offsetDegree:m,status:p,percentage:a,showIndicator:u,indicatorTextColor:g,unit:c,gapOffsetDegree:v,clsPrefix:n}=e,{pathString:y,pathStyle:f}=l(100,0,o),{pathString:$,pathStyle:w}=l(a,m,s),b=100+i;return t("div",{class:`${n}-progress-content`,role:"none"},t("div",{class:`${n}-progress-graph`,"aria-hidden":!0},t("div",{class:`${n}-progress-graph-circle`,style:{transform:v?`rotate(${v}deg)`:void 0}},t("svg",{viewBox:`0 0 ${b} ${b}`},t("g",null,t("path",{class:`${n}-progress-graph-circle-rail`,d:y,"stroke-width":i,"stroke-linecap":"round",fill:"none",style:f})),t("g",null,t("path",{class:[`${n}-progress-graph-circle-fill`,a===0&&`${n}-progress-graph-circle-fill--empty`],d:$,"stroke-width":i,"stroke-linecap":"round",fill:"none",style:w}))))),u?t("div",null,r.default?t("div",{class:`${n}-progress-custom-content`,role:"none"},r.default()):p!=="default"?t("div",{class:`${n}-progress-icon`,"aria-hidden":!0},t(K,{clsPrefix:n},{default:()=>we[p]})):t("div",{class:`${n}-progress-text`,style:{color:g},role:"none"},t("span",{class:`${n}-progress-text__percentage`},a),t("span",{class:`${n}-progress-text__unit`},c))):null)}}});function E(e,r,l=100){return`m ${l/2} ${l/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const Pe=z({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:r}){const l=S(()=>e.percentage.map((o,i)=>`${Math.PI*o/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*i)-e.circleGap*i)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:s,strokeWidth:o,circleGap:i,showIndicator:m,fillColor:p,railColor:a,railStyle:u,percentage:g,clsPrefix:c}=e;return t("div",{class:`${c}-progress-content`,role:"none"},t("div",{class:`${c}-progress-graph`,"aria-hidden":!0},t("div",{class:`${c}-progress-graph-circle`},t("svg",{viewBox:`0 0 ${s} ${s}`},g.map((v,n)=>t("g",{key:n},t("path",{class:`${c}-progress-graph-circle-rail`,d:E(s/2-o/2*(1+2*n)-i*n,o,s),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:a[n]},u[n]]}),t("path",{class:[`${c}-progress-graph-circle-fill`,v===0&&`${c}-progress-graph-circle-fill--empty`],d:E(s/2-o/2*(1+2*n)-i*n,o,s),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:l.value[n],strokeDashoffset:0,stroke:p[n]}})))))),m&&r.default?t("div",null,t("div",{class:`${c}-progress-text`},r.default())):null)}}}),Be=Object.assign(Object.assign({},J.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),ze=z({name:"Progress",props:Be,setup(e){const r=S(()=>e.indicatorPlacement||e.indicatorPosition),l=S(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:s,inlineThemeDisabled:o}=xe(e),i=J("Progress","-progress",Se,_e,e,s),m=S(()=>{const{status:a}=e,{common:{cubicBezierEaseInOut:u},self:{fontSize:g,fontSizeCircle:c,railColor:v,railHeight:n,iconSizeCircle:y,iconSizeLine:f,textColorCircle:$,textColor