wordHelper/dist/js/205.b608513d.js
2026-01-05 18:49:29 +08:00

2 lines
15 KiB
JavaScript

"use strict";(self["webpackChunkwordhelper"]=self["webpackChunkwordhelper"]||[]).push([[205],{78205:function(e,r,i){i.d(r,{A:function(){return B}});var n=i(56768),t=i(79882),o=i(88733),l=i(25216),s=i(34350),a=i(26812),c=(i(33110),i(2702)),p=i(84279),d=i(4660),g=i(98351),h=i(73921),u=i(31603);const f={success:(0,n.h)(d.A,null),error:(0,n.h)(g.A,null),warning:(0,n.h)(h.A,null),info:(0,n.h)(u.A,null)};var v=(0,n.pM)({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:[String,Object],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}){const i=(0,n.EW)(()=>{const r="gradient",{fillColor:i}=e;return"object"===typeof i?`${r}-${(0,c.A)(JSON.stringify(i))}`:r});function t(r,n,t,o){const{gapDegree:l,viewBoxWidth:s,strokeWidth:a}=e,c=50,p=0,d=c,g=0,h=2*c,u=50+a/2,f=`M ${u},${u} m ${p},${d}\n a ${c},${c} 0 1 1 ${g},${-h}\n a ${c},${c} 0 1 1 ${-g},${h}`,v=2*Math.PI*c,y={stroke:"rail"===o?t:"object"===typeof e.fillColor?`url(#${i.value})`:t,strokeDasharray:`${Math.min(r,100)/100*(v-l)}px ${8*s}px`,strokeDashoffset:`-${l/2}px`,transformOrigin:n?"center":void 0,transform:n?`rotate(${n}deg)`:void 0};return{pathString:f,pathStyle:y}}const o=()=>{const r="object"===typeof e.fillColor,t=r?e.fillColor.stops[0]:"",o=r?e.fillColor.stops[1]:"";return r&&(0,n.h)("defs",null,(0,n.h)("linearGradient",{id:i.value,x1:"0%",y1:"100%",x2:"100%",y2:"0%"},(0,n.h)("stop",{offset:"0%","stop-color":t}),(0,n.h)("stop",{offset:"100%","stop-color":o})))};return()=>{const{fillColor:i,railColor:l,strokeWidth:s,offsetDegree:a,status:c,percentage:d,showIndicator:g,indicatorTextColor:h,unit:u,gapOffsetDegree:v,clsPrefix:y}=e,{pathString:b,pathStyle:x}=t(100,0,l,"rail"),{pathString:m,pathStyle:$}=t(d,a,i,"fill"),C=100+s;return(0,n.h)("div",{class:`${y}-progress-content`,role:"none"},(0,n.h)("div",{class:`${y}-progress-graph`,"aria-hidden":!0},(0,n.h)("div",{class:`${y}-progress-graph-circle`,style:{transform:v?`rotate(${v}deg)`:void 0}},(0,n.h)("svg",{viewBox:`0 0 ${C} ${C}`},o(),(0,n.h)("g",null,(0,n.h)("path",{class:`${y}-progress-graph-circle-rail`,d:b,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:x})),(0,n.h)("g",null,(0,n.h)("path",{class:[`${y}-progress-graph-circle-fill`,0===d&&`${y}-progress-graph-circle-fill--empty`],d:m,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:$}))))),g?(0,n.h)("div",null,r.default?(0,n.h)("div",{class:`${y}-progress-custom-content`,role:"none"},r.default()):"default"!==c?(0,n.h)("div",{class:`${y}-progress-icon`,"aria-hidden":!0},(0,n.h)(p.A,{clsPrefix:y},{default:()=>f[c]})):(0,n.h)("div",{class:`${y}-progress-text`,style:{color:h},role:"none"},(0,n.h)("span",{class:`${y}-progress-text__percentage`},d),(0,n.h)("span",{class:`${y}-progress-text__unit`},u))):null)}}}),y=i(35444);const b={success:(0,n.h)(d.A,null),error:(0,n.h)(g.A,null),warning:(0,n.h)(h.A,null),info:(0,n.h)(u.A,null)};var x=(0,n.pM)({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:[String,Object],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 i=(0,n.EW)(()=>(0,y.i)(e.height)),t=(0,n.EW)(()=>{var r,i;return"object"===typeof e.fillColor?`linear-gradient(to right, ${null===(r=e.fillColor)||void 0===r?void 0:r.stops[0]} , ${null===(i=e.fillColor)||void 0===i?void 0:i.stops[1]})`:e.fillColor}),o=(0,n.EW)(()=>void 0!==e.railBorderRadius?(0,y.i)(e.railBorderRadius):void 0!==e.height?(0,y.i)(e.height,{c:.5}):""),l=(0,n.EW)(()=>void 0!==e.fillBorderRadius?(0,y.i)(e.fillBorderRadius):void 0!==e.railBorderRadius?(0,y.i)(e.railBorderRadius):void 0!==e.height?(0,y.i)(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:s,railColor:a,railStyle:c,percentage:d,unit:g,indicatorTextColor:h,status:u,showIndicator:f,processing:v,clsPrefix:y}=e;return(0,n.h)("div",{class:`${y}-progress-content`,role:"none"},(0,n.h)("div",{class:`${y}-progress-graph`,"aria-hidden":!0},(0,n.h)("div",{class:[`${y}-progress-graph-line`,{[`${y}-progress-graph-line--indicator-${s}`]:!0}]},(0,n.h)("div",{class:`${y}-progress-graph-line-rail`,style:[{backgroundColor:a,height:i.value,borderRadius:o.value},c]},(0,n.h)("div",{class:[`${y}-progress-graph-line-fill`,v&&`${y}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,background:t.value,height:i.value,lineHeight:i.value,borderRadius:l.value}},"inside"===s?(0,n.h)("div",{class:`${y}-progress-graph-line-indicator`,style:{color:h}},r.default?r.default():`${d}${g}`):null)))),f&&"outside"===s?(0,n.h)("div",null,r.default?(0,n.h)("div",{class:`${y}-progress-custom-content`,style:{color:h},role:"none"},r.default()):"default"===u?(0,n.h)("div",{role:"none",class:`${y}-progress-icon ${y}-progress-icon--as-text`,style:{color:h}},d,g):(0,n.h)("div",{class:`${y}-progress-icon`,"aria-hidden":!0},(0,n.h)(p.A,{clsPrefix:y},{default:()=>b[u]}))):null)}}});i(18111),i(61701);function m(e,r,i=100){return`m ${i/2} ${i/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}var $=(0,n.pM)({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 i=(0,n.EW)(()=>{const r=e.percentage.map((r,i)=>`${Math.PI*r/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*i)-e.circleGap*i)*2}, ${8*e.viewBoxWidth}`);return r}),t=(r,i)=>{const t=e.fillColor[i],o="object"===typeof t?t.stops[0]:"",l="object"===typeof t?t.stops[1]:"";return"object"===typeof e.fillColor[i]&&(0,n.h)("linearGradient",{id:`gradient-${i}`,x1:"100%",y1:"0%",x2:"0%",y2:"100%"},(0,n.h)("stop",{offset:"0%","stop-color":o}),(0,n.h)("stop",{offset:"100%","stop-color":l}))};return()=>{const{viewBoxWidth:o,strokeWidth:l,circleGap:s,showIndicator:a,fillColor:c,railColor:p,railStyle:d,percentage:g,clsPrefix:h}=e;return(0,n.h)("div",{class:`${h}-progress-content`,role:"none"},(0,n.h)("div",{class:`${h}-progress-graph`,"aria-hidden":!0},(0,n.h)("div",{class:`${h}-progress-graph-circle`},(0,n.h)("svg",{viewBox:`0 0 ${o} ${o}`},(0,n.h)("defs",null,g.map((e,r)=>t(e,r))),g.map((e,r)=>(0,n.h)("g",{key:r},(0,n.h)("path",{class:`${h}-progress-graph-circle-rail`,d:m(o/2-l/2*(1+2*r)-s*r,l,o),"stroke-width":l,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:p[r]},d[r]]}),(0,n.h)("path",{class:[`${h}-progress-graph-circle-fill`,0===e&&`${h}-progress-graph-circle-fill--empty`],d:m(o/2-l/2*(1+2*r)-s*r,l,o),"stroke-width":l,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:i.value[r],strokeDashoffset:0,stroke:"object"===typeof c[r]?`url(#gradient-${r})`:c[r]}})))))),a&&r.default?(0,n.h)("div",null,(0,n.h)("div",{class:`${h}-progress-text`},r.default())):null)}}}),C=(0,s.c)([(0,s.cB)("progress",{display:"inline-block"},[(0,s.cB)("progress-icon","\n color: var(--n-icon-color);\n transition: color .3s var(--n-bezier);\n "),(0,s.cM)("line","\n width: 100%;\n display: block;\n ",[(0,s.cB)("progress-content","\n display: flex;\n align-items: center;\n ",[(0,s.cB)("progress-graph",{flex:1})]),(0,s.cB)("progress-custom-content",{marginLeft:"14px"}),(0,s.cB)("progress-icon","\n width: 30px;\n padding-left: 14px;\n height: var(--n-icon-size-line);\n line-height: var(--n-icon-size-line);\n font-size: var(--n-icon-size-line);\n ",[(0,s.cM)("as-text","\n color: var(--n-text-color-line-outer);\n text-align: center;\n width: 40px;\n font-size: var(--n-font-size);\n padding-left: 4px;\n transition: color .3s var(--n-bezier);\n ")])]),(0,s.cM)("circle, dashboard",{width:"120px"},[(0,s.cB)("progress-custom-content","\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n "),(0,s.cB)("progress-text","\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n display: flex;\n align-items: center;\n color: inherit;\n font-size: var(--n-font-size-circle);\n color: var(--n-text-color-circle);\n font-weight: var(--n-font-weight-circle);\n transition: color .3s var(--n-bezier);\n white-space: nowrap;\n "),(0,s.cB)("progress-icon","\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n display: flex;\n align-items: center;\n color: var(--n-icon-color);\n font-size: var(--n-icon-size-circle);\n ")]),(0,s.cM)("multiple-circle","\n width: 200px;\n color: inherit;\n ",[(0,s.cB)("progress-text","\n font-weight: var(--n-font-weight-circle);\n color: var(--n-text-color-circle);\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n transition: color .3s var(--n-bezier);\n ")]),(0,s.cB)("progress-content",{position:"relative"}),(0,s.cB)("progress-graph",{position:"relative"},[(0,s.cB)("progress-graph-circle",[(0,s.c)("svg",{verticalAlign:"bottom"}),(0,s.cB)("progress-graph-circle-fill","\n stroke: var(--n-fill-color);\n transition:\n opacity .3s var(--n-bezier),\n stroke .3s var(--n-bezier),\n stroke-dasharray .3s var(--n-bezier);\n ",[(0,s.cM)("empty",{opacity:0})]),(0,s.cB)("progress-graph-circle-rail","\n transition: stroke .3s var(--n-bezier);\n overflow: hidden;\n stroke: var(--n-rail-color);\n ")]),(0,s.cB)("progress-graph-line",[(0,s.cM)("indicator-inside",[(0,s.cB)("progress-graph-line-rail","\n height: 16px;\n line-height: 16px;\n border-radius: 10px;\n ",[(0,s.cB)("progress-graph-line-fill","\n height: inherit;\n border-radius: 10px;\n "),(0,s.cB)("progress-graph-line-indicator","\n background: #0000;\n white-space: nowrap;\n text-align: right;\n margin-left: 14px;\n margin-right: 14px;\n height: inherit;\n font-size: 12px;\n color: var(--n-text-color-line-inner);\n transition: color .3s var(--n-bezier);\n ")])]),(0,s.cM)("indicator-inside-label","\n height: 16px;\n display: flex;\n align-items: center;\n ",[(0,s.cB)("progress-graph-line-rail","\n flex: 1;\n transition: background-color .3s var(--n-bezier);\n "),(0,s.cB)("progress-graph-line-indicator","\n background: var(--n-fill-color);\n font-size: 12px;\n transform: translateZ(0);\n display: flex;\n vertical-align: middle;\n height: 16px;\n line-height: 16px;\n padding: 0 10px;\n border-radius: 10px;\n position: absolute;\n white-space: nowrap;\n color: var(--n-text-color-line-inner);\n transition:\n right .2s var(--n-bezier),\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n ")]),(0,s.cB)("progress-graph-line-rail","\n position: relative;\n overflow: hidden;\n height: var(--n-rail-height);\n border-radius: 5px;\n background-color: var(--n-rail-color);\n transition: background-color .3s var(--n-bezier);\n ",[(0,s.cB)("progress-graph-line-fill","\n background: var(--n-fill-color);\n position: relative;\n border-radius: 5px;\n height: inherit;\n width: 100%;\n max-width: 0%;\n transition:\n background-color .3s var(--n-bezier),\n max-width .2s var(--n-bezier);\n ",[(0,s.cM)("processing",[(0,s.c)("&::after",'\n content: "";\n background-image: var(--n-line-bg-processing);\n animation: progress-processing-animation 2s var(--n-bezier) infinite;\n ')])])])])])]),(0,s.c)("@keyframes progress-processing-animation","\n 0% {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 100%;\n opacity: 1;\n }\n 66% {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n }\n 100% {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n }\n ")]);const w=Object.assign(Object.assign({},t.A.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,Object],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});var B=(0,n.pM)({name:"Progress",props:w,setup(e){const r=(0,n.EW)(()=>e.indicatorPlacement||e.indicatorPosition),i=(0,n.EW)(()=>e.gapDegree||0===e.gapDegree?e.gapDegree:"dashboard"===e.type?75:void 0),{mergedClsPrefixRef:c,inlineThemeDisabled:p}=(0,o.Ay)(e),d=(0,t.A)("Progress","-progress",C,a.A,e,c),g=(0,n.EW)(()=>{const{status:r}=e,{common:{cubicBezierEaseInOut:i},self:{fontSize:n,fontSizeCircle:t,railColor:o,railHeight:l,iconSizeCircle:a,iconSizeLine:c,textColorCircle:p,textColorLineInner:g,textColorLineOuter:h,lineBgProcessing:u,fontWeightCircle:f,[(0,s.cF)("iconColor",r)]:v,[(0,s.cF)("fillColor",r)]:y}}=d.value;return{"--n-bezier":i,"--n-fill-color":y,"--n-font-size":n,"--n-font-size-circle":t,"--n-font-weight-circle":f,"--n-icon-color":v,"--n-icon-size-circle":a,"--n-icon-size-line":c,"--n-line-bg-processing":u,"--n-rail-color":o,"--n-rail-height":l,"--n-text-color-circle":p,"--n-text-color-line-inner":g,"--n-text-color-line-outer":h}}),h=p?(0,l.R)("progress",(0,n.EW)(()=>e.status[0]),g,e):void 0;return{mergedClsPrefix:c,mergedIndicatorPlacement:r,gapDeg:i,cssVars:p?void 0:g,themeClass:null===h||void 0===h?void 0:h.themeClass,onRender:null===h||void 0===h?void 0:h.onRender}},render(){const{type:e,cssVars:r,indicatorTextColor:i,showIndicator:t,status:o,railColor:l,railStyle:s,color:a,percentage:c,viewBoxWidth:p,strokeWidth:d,mergedIndicatorPlacement:g,unit:h,borderRadius:u,fillBorderRadius:f,height:y,processing:b,circleGap:m,mergedClsPrefix:C,gapDeg:w,gapOffsetDegree:B,themeClass:S,$slots:k,onRender:z}=this;return null===z||void 0===z||z(),(0,n.h)("div",{class:[S,`${C}-progress`,`${C}-progress--${e}`,`${C}-progress--${o}`],style:r,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,role:"circle"===e||"line"===e||"dashboard"===e?"progressbar":"none"},"circle"===e||"dashboard"===e?(0,n.h)(v,{clsPrefix:C,status:o,showIndicator:t,indicatorTextColor:i,railColor:l,fillColor:a,railStyle:s,offsetDegree:this.offsetDegree,percentage:c,viewBoxWidth:p,strokeWidth:d,gapDegree:void 0===w?"dashboard"===e?75:0:w,gapOffsetDegree:B,unit:h},k):"line"===e?(0,n.h)(x,{clsPrefix:C,status:o,showIndicator:t,indicatorTextColor:i,railColor:l,fillColor:a,railStyle:s,percentage:c,processing:b,indicatorPlacement:g,unit:h,fillBorderRadius:f,railBorderRadius:u,height:y},k):"multiple-circle"===e?(0,n.h)($,{clsPrefix:C,strokeWidth:d,railColor:l,fillColor:a,railStyle:s,viewBoxWidth:p,percentage:c,showIndicator:t,circleGap:m},k):null)}})}}]);
//# sourceMappingURL=205.b608513d.js.map