-
Notifications
You must be signed in to change notification settings - Fork 1
/
467-52c0a521bd531d95bb23.js
1 lines (1 loc) · 57.2 KB
/
467-52c0a521bd531d95bb23.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[467],{467:(n,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>C});var t=a(73450),p=a(27378),e=a(57318),o=a(8434),c=a(3454),l=a(24246);function u(n,s){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable}))),a.push.apply(a,t)}return a}function r(n){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?u(Object(a),!0).forEach((function(s){(0,t.Z)(n,s,a[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s))}))}return n}var i=function(){class n extends p.Component{render(){return(0,l.jsx)("div",{className:"zent-progress-demo",children:(0,l.jsx)(o.E,{percent:70})})}}return(0,l.jsx)(n,{})},k=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{value:10}),(0,t.Z)(this,"increase",(()=>{var n=this.state.value+10;n>=100&&(n=100),this.setState({value:n})})),(0,t.Z)(this,"decrease",(()=>{var n=this.state.value-10;n<0&&(n=0),this.setState({value:n})}))}render(){var n=this.state.value;return(0,l.jsxs)("div",{className:"zent-progress-demo",children:[(0,l.jsx)(o.E,{percent:n}),(0,l.jsxs)("div",{children:[(0,l.jsx)(c.z,{onClick:this.decrease,children:"-"}),(0,l.jsx)(c.z,{onClick:this.increase,children:"+"})]})]})}}return(0,l.jsx)(n,{})},d=function(){class n extends p.Component{render(){return(0,l.jsx)("div",{className:"zent-progress-demo",children:(0,l.jsx)(o.E,{percent:70,width:300,strokeWidth:5})})}}return(0,l.jsx)(n,{})},m=function(){class n extends p.Component{render(){return(0,l.jsxs)("div",{className:"zent-progress-demo",children:[(0,l.jsx)(o.E,{percent:70,status:"normal"}),(0,l.jsx)(o.E,{percent:80,status:"success"}),(0,l.jsx)(o.E,{percent:30,status:"exception"})]})}}return(0,l.jsx)(n,{})},g=function(){class n extends p.Component{render(){return(0,l.jsxs)("div",{className:"zent-progress-demo",children:[(0,l.jsx)(o.E,{percent:70,showInfo:!1}),(0,l.jsx)(o.E,{percent:100,showInfo:!1})]})}}return(0,l.jsx)(n,{})},h=function(){class n extends p.Component{render(){return(0,l.jsx)("div",{className:"zent-progress-demo",children:(0,l.jsx)(o.E,{percent:70,format:n=>"进度 ".concat(n,"%")})})}}return(0,l.jsx)(n,{})},v=function(){var n={bgColor:"#fff",normalColor:"#38f",successColor:"#0a0",exceptionColor:"#f85"};class s extends p.Component{render(){return(0,l.jsxs)("div",{className:"zent-progress-demo",children:[(0,l.jsx)(o.E,r({percent:70},n)),(0,l.jsx)(o.E,r({percent:100},n)),(0,l.jsx)(o.E,r({percent:80,status:"exception"},n))]})}}return(0,l.jsx)(s,{})},y=function(){class n extends p.Component{render(){return(0,l.jsxs)("div",{className:"zent-progress-demo",children:[(0,l.jsx)(o.E,{type:"circle",percent:80,width:76,strokeWidth:5}),(0,l.jsx)(o.E,{type:"circle",percent:70}),(0,l.jsx)(o.E,{type:"circle",percent:80,status:"success"}),(0,l.jsx)(o.E,{type:"circle",percent:30,status:"exception"})]})}}return(0,l.jsx)(n,{})},f=function(){class n extends p.Component{render(){return(0,l.jsxs)("div",{className:"zent-progress-demo",children:[(0,l.jsx)(o.E,{percent:70}),(0,l.jsx)(o.E,{percent:70,strokeLinecap:"square"}),(0,l.jsx)(o.E,{percent:100,strokeLinecap:"square"}),(0,l.jsx)(o.E,{percent:70,type:"circle"}),(0,l.jsx)(o.E,{percent:70,type:"circle",strokeLinecap:"square"}),(0,l.jsx)(o.E,{percent:100,type:"circle",strokeLinecap:"square"})]})}}return(0,l.jsx)(n,{})};function j(n){return(0,l.jsx)(n.tag,r(r({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function x(n){return(0,l.jsx)(j,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function w(n){return(0,l.jsx)(j,{tag:"style",html:n.style})}function b(n,s){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(s+=n.offsetTop),b(n.parentNode,s);return s}class z extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{showCode:!1}),(0,t.Z)(this,"toggle",(()=>{this.setState({showCode:!this.state.showCode})}))}render(){var n=this.state.showCode,s=this.props,a=s.title,t=s.src,p=s.children;return(0,l.jsxs)("div",{className:"zandoc-react-demo",children:[(0,l.jsx)("div",{className:"zandoc-react-demo__preview",children:p}),(0,l.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,l.jsx)("div",{className:"zandoc-react-demo__title",children:(0,l.jsx)("p",{children:a||""})}),(0,l.jsx)("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle ".concat(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})]}),n&&(0,l.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,l.jsx)(j,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class C extends p.Component{componentDidMount(){var n=location.hash;if(n){var s=document.querySelector('a[href="'.concat(n,'"]'));s&&(0,e.l)(document.documentElement,0,b(s,-9))}}render(){return p.createElement("div",{className:"zandoc-react-container"},p.createElement(w,{style:".zent-progress-demo .zent-progress {\n\t\tmargin-bottom: 10px;\n\t}\n\t.zent-progress-demo .zent-progress-type__circle {\n\t\tmargin-right: 10px;\n\t}\n\n.zent-progress-demo .zent-progress {\n\t\tmargin-bottom: 10px;\n\t}\n\n.zent-progress-demo .zent-progress-type__circle {\n\t\tmargin-right: 10px;\n\t}\n\n.zent-progress-demo .zent-progress {\n\t\tmargin-bottom: 10px;\n\t}\n\n.zent-progress-demo .zent-progress-type__circle {\n\t\tmargin-right: 10px;\n\t}"}),p.createElement(x,{html:'<h2 class="anchor-heading"><a href="#progress-jin-du-tiao">¶</a><a href="javascript:void(0)" id="progress-jin-du-tiao" class="anchor-point"></a>Progress 进度条</h2>\n<p>在操作需要较长时间才能完成时,展示操作的当前进度。</p>\n<h3 class="anchor-heading"><a href="#jian-yi">¶</a><a href="javascript:void(0)" id="jian-yi" class="anchor-point"></a>建议</h3>\n<ul>\n<li>需要较长时间才能完成</li>\n<li>在后台运行,且耗时可能超过 4 秒时</li>\n<li>操作需要展示一个完成进度的百分比</li>\n</ul>\n<h3 class="anchor-heading"><a href="#zhu-yi">¶</a><a href="javascript:void(0)" id="zhu-yi" class="anchor-point"></a>注意</h3>\n<ul>\n<li>无法预估进程的时间,建议使用「加载 Loading」</li>\n<li>进程确定在 4 秒内的操作不推荐使用</li>\n</ul>\n<h3 class="anchor-heading"><a href="#dai-ma-yan-shi">¶</a><a href="javascript:void(0)" id="dai-ma-yan-shi" class="anchor-point"></a>代码演示</h3>'}),p.createElement(z,{title:"基础用法",id:"Demobasic",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(i)),p.createElement(z,{title:"动态效果",id:"Demodynamic",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">value</span><span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">increase</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">let</span> value <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">.</span><span class="token property-access">value</span> <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>value <span class="token operator">>=</span> <span class="token number">100</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n value <span class="token operator">=</span> <span class="token number">100</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> value <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">decrease</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">let</span> value <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">.</span><span class="token property-access">value</span> <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>value <span class="token operator"><</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n value <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> value <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> <span class="token punctuation">{</span> value <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>value<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">decrease</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token operator">-</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">increase</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token operator">+</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(k)),p.createElement(z,{title:"自定义尺寸",id:"Demosize",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token attr-name">width</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">300</span><span class="token punctuation">}</span></span> <span class="token attr-name">strokeWidth</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">5</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(d)),p.createElement(z,{title:"支持手动设置状态",id:"Demostatus",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Slider</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>normal<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">80</span><span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>success<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">30</span><span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>exception<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(m)),p.createElement(z,{title:"隐藏进度信息",id:"Demoinfo",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Slider</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token attr-name">showInfo</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">100</span><span class="token punctuation">}</span></span> <span class="token attr-name">showInfo</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(g)),p.createElement(z,{title:"自定义信息",id:"Demoformat",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Slider</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span>\n <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">format</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token parameter">percent</span> <span class="token arrow operator">=></span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">进度 </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>percent<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">%</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">}</span></span>\n <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(h)),p.createElement(z,{title:"自定义色彩",id:"Democustomcolor",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> colors <span class="token operator">=</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">bgColor</span><span class="token operator">:</span> <span class="token string">\'#fff\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">normalColor</span><span class="token operator">:</span> <span class="token string">\'#38f\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">successColor</span><span class="token operator">:</span> <span class="token string">\'#0a0\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">exceptionColor</span><span class="token operator">:</span> <span class="token string">\'#f85\'</span><span class="token punctuation">,</span>\n<span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token spread"><span class="token punctuation">{</span><span class="token spread operator">...</span>colors<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">100</span><span class="token punctuation">}</span></span> <span class="token spread"><span class="token punctuation">{</span><span class="token spread operator">...</span>colors<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">80</span><span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>exception<span class="token punctuation">"</span></span> <span class="token spread"><span class="token punctuation">{</span><span class="token spread operator">...</span>colors<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(v)),p.createElement(x,{html:'<h3 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h3>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>默认值</th>\n<th>可选值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>className</td>\n<td>自定义额外类名</td>\n<td>string</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>type</td>\n<td>进度条样式</td>\n<td>string</td>\n<td><code>\'line\'</code></td>\n<td><code>\'circle\'</code></td>\n</tr>\n<tr>\n<td>percent</td>\n<td>百分比</td>\n<td>number</td>\n<td><code>0</code></td>\n<td></td>\n</tr>\n<tr>\n<td>status</td>\n<td>进度条状态, 优先级比 percent 高</td>\n<td>string</td>\n<td></td>\n<td><code>\'normal\'</code>\n \n|\n \n<code>\'success\'</code>\n \n|\n \n<code>\'exception\'</code></td>\n</tr>\n<tr>\n<td>showInfo</td>\n<td>是否显示状态信息</td>\n<td>boolean</td>\n<td><code>true</code></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>format</td>\n<td>文字模板函数, 只会在 normal 状态下显示</td>\n<td>(percent: number) => ReactNode</td>\n<td>内置函数</td>\n<td></td>\n</tr>\n<tr>\n<td>strokeWidth</td>\n<td>线条宽度,单位 px</td>\n<td>number</td>\n<td><code>10</code></td>\n<td></td>\n</tr>\n<tr>\n<td>width</td>\n<td>圆形进度条直径/条形进度条总长度</td>\n<td>number</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>bgColor</td>\n<td>背景颜色</td>\n<td>string</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>normalColor</td>\n<td>正常状态下的颜色</td>\n<td>string</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>successColor</td>\n<td>成功状态下的颜色</td>\n<td>string</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>exceptionColor</td>\n<td>错误状态的颜色</td>\n<td>string</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>strokeLinecap</td>\n<td>进度条边缘形状</td>\n<td>string</td>\n<td><code>\'round\'</code></td>\n<td><code>\'round\'</code>\n \n|\n \n<code>\'square\'</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#yi-xia-gong-neng-xin-ban-she-ji-yu-yan-yi-fei-qi-jin-zuo-wei-lao-ban-shi-yong-de-can-kao">¶</a><a href="javascript:void(0)" id="yi-xia-gong-neng-xin-ban-she-ji-yu-yan-yi-fei-qi-jin-zuo-wei-lao-ban-shi-yong-de-can-kao" class="anchor-point"></a>以下功能新版设计语言已废弃,仅作为老版使用的参考</h4>'}),p.createElement(z,{title:"圈型进度条",id:"Democircle",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">80</span><span class="token punctuation">}</span></span> <span class="token attr-name">width</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">76</span><span class="token punctuation">}</span></span> <span class="token attr-name">strokeWidth</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">5</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">80</span><span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>success<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">30</span><span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>exception<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(y)),p.createElement(z,{title:"改变进度条边缘的形状",id:"Demolinecap",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Progress</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">App</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-progress-demo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token attr-name">strokeLinecap</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>square<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">100</span><span class="token punctuation">}</span></span> <span class="token attr-name">strokeLinecap</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>square<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">70</span><span class="token punctuation">}</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token attr-name">strokeLinecap</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>square<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Progress</span></span> <span class="token attr-name">percent</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">100</span><span class="token punctuation">}</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>circle<span class="token punctuation">"</span></span> <span class="token attr-name">strokeLinecap</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>square<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(f)))}}},8434:(n,s,a)=>{"use strict";a.d(s,{E:()=>v});var t=a(59312),p=a(24246),e=a(27378),o=a(60042),c=a.n(o),l=["normal","success","exception"],u=(0,a(70453).Z)("zentAnimatedArcStrokeGradient"),r={},i={WebkitTransition:"none",MozTransition:"none",OTransition:"none",msTransition:"none",transition:"none"},k=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.state={opacity:0,rotate:0,transition:r},s.startAnimation=function(){s.animationDelayTimerId&&clearTimeout(s.animationDelayTimerId);var n=s.props,a=n.arcLength,t=n.radius,p=(a-s.getMaskArcLength())/t;s.setState({rotate:p,transition:r,opacity:.2},s.queueAnimationEnd)},s.finishAnimation=function(){s.transitionEndTimerId&&clearTimeout(s.transitionEndTimerId),s.setState({rotate:0,transition:i,opacity:0}),s.animationDelayTimerId=setTimeout(s.startAnimation,1e3)},s.queueAnimationEnd=function(){s.transitionEndTimerId=setTimeout(s.finishAnimation,400)},s}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.getPath(),s=this.props,a=s.className,e=s.strokeWidth,o=this.state,c=o.rotate,l=o.transition,r=o.opacity;return(0,p.jsxs)("g",(0,t.pi)({"data-zv":"10.0.10"},{children:[(0,p.jsx)("defs",(0,t.pi)({"data-zv":"10.0.10"},{children:(0,p.jsxs)("linearGradient",(0,t.pi)({id:u},{children:[(0,p.jsx)("stop",{offset:"0%",stopColor:"rgba(255, 255, 255, 0)","data-zv":"10.0.10"},void 0),(0,p.jsx)("stop",{offset:"100%",stopColor:"#fff","data-zv":"10.0.10"},void 0)]}),void 0)}),void 0),(0,p.jsx)("path",{className:a,d:n,stroke:"url(#"+u+")",strokeOpacity:r,strokeWidth:e,style:(0,t.pi)({transform:"rotate("+c+"rad)"},l),"data-zv":"10.0.10"},void 0)]}),void 0)},s.prototype.componentDidMount=function(){this.startAnimation()},s.prototype.componentWillUnmount=function(){clearTimeout(this.animationDelayTimerId),clearTimeout(this.transitionEndTimerId),this.animationDelayTimerId=null,this.transitionEndTimerId=null},s.prototype.getMaskArcLength=function(){return.2*this.props.arcLength},s.prototype.getMaskTheta=function(){var n=this.props.radius;return this.getMaskArcLength()/n},s.prototype.getArcStartPoint=function(){var n=this.props,s=n.radius,a=n.strokeWidth/2;return[s+a,a]},s.prototype.getArcEndPoint=function(){var n=this.props,s=n.radius,a=s+n.strokeWidth/2,t=this.getMaskTheta();return[a+Math.sin(t)*s,a-Math.cos(t)*s]},s.prototype.getPath=function(){var n=this.getArcStartPoint(),s=this.getArcEndPoint(),a=this.props.radius;return"M"+n.join(",")+" A"+a+","+a+" 0 0 1 "+s.join(",")},s}(e.PureComponent),d=a(39215),m=function(n){var s=n.type,a=n.percent,t=n.format,e=n.state,o=n.color;return"success"===e?(0,p.jsx)(d.J,{type:"circle"===s?"check":"check-circle",style:{color:o}},void 0):"exception"===e?(0,p.jsx)(d.J,{type:"circle"===s?"close":"close-circle",style:{color:o}},void 0):(0,p.jsx)(p.Fragment,{children:t(a)},void 0)},g=function(n){var s=n.percent,a=n.showInfo,e=n.format,o=n.strokeWidth,l=n.width,u=n.bgColor,r=n.color,i=n.state,d=n.strokeLinecap,g=l||132,h=g/2,v=g-o,y=v/2,f=v*Math.PI,j=f*(100-s)/100;return(0,p.jsxs)("div",(0,t.pi)({className:"zent-progress-container",style:{width:g,height:g},"data-zv":"10.0.10"},{children:[(0,p.jsx)("div",{className:"zent-progress-wrapper",style:{borderWidth:o,borderColor:u,width:g,height:g},"data-zv":"10.0.10"},void 0),(0,p.jsxs)("svg",(0,t.pi)({className:"zent-progress-inner",viewBox:"0 0 "+g+" "+g,width:g,height:g,"data-zv":"10.0.10"},{children:[(0,p.jsx)("g",(0,t.pi)({transform:"rotate(-90 "+h+" "+h+")","data-zv":"10.0.10"},{children:(0,p.jsx)("circle",{className:c()("zent-progress-inner-path","zent-progress-inner-path--"+d),cx:h,cy:h,r:y,style:{stroke:r,strokeWidth:o},strokeDasharray:f,strokeDashoffset:j,"data-zv":"10.0.10"},void 0)}),void 0),"normal"===i&&(0,p.jsx)(k,{className:c()("zent-progress-path-mask","zent-progress-path-mask--"+d),radius:y,arcLength:f-j,strokeWidth:o},void 0)]}),void 0),a&&(0,p.jsx)("div",(0,t.pi)({className:"zent-progress-info","data-zv":"10.0.10"},{children:(0,p.jsx)(m,{type:"circle",percent:s,format:e,state:i,color:r},void 0)}),void 0)]}),void 0)},h=function(n){var s=n.format,a=n.width,e=n.percent,o=n.showInfo,l=n.strokeWidth,u=n.bgColor,r=n.color,i=n.state,k=n.strokeLinecap,d=a||"100%",g=o&&(0,p.jsx)("div",(0,t.pi)({className:"zent-progress-info","data-zv":"10.0.10"},{children:(0,p.jsx)(m,{type:"line",percent:e,format:s,state:i,color:r},void 0)}),void 0);return(0,p.jsxs)("div",(0,t.pi)({className:"zent-progress-container","data-zv":"10.0.10"},{children:[(0,p.jsx)("div",(0,t.pi)({className:c()("zent-progress-wrapper","zent-progress-wrapper--"+k,{"zent-progress-wrapper--finished":100===e}),style:{background:u,width:d,height:l},"data-zv":"10.0.10"},{children:(0,p.jsx)("div",{className:"zent-progress-inner",style:{background:r,width:e+"%",height:l},"data-zv":"10.0.10"},void 0)}),void 0),g]}),void 0)},v=function(n){var s,a=n,o=a.type,u=a.status,r=a.percent,i=a.className,k=a.normalColor,d=a.successColor,m=a.exceptionColor,v=a.bgColor,y=a.format,f=a.showInfo,j=a.strokeWidth,x=a.width,w=a.strokeLinecap,b=(0,t._T)(a,["type","status","percent","className","normalColor","successColor","exceptionColor","bgColor","format","showInfo","strokeWidth","width","strokeLinecap"]),z=(0,e.useMemo)((function(){return-1!==l.indexOf(u)?u:r>=100?"success":"normal"}),[u,r]),C={exception:m,success:d,normal:k}[z],E=(0,e.useMemo)((function(){return r<0?0:r>100?100:r}),[r]);switch(o){case"circle":s=g;break;case"line":default:s=h}var N=c()("zent-progress","zent-progress-type__"+o,"zent-progress-state__"+z,i);return(0,p.jsx)("div",(0,t.pi)({className:N},b,{"data-zv":"10.0.10"},{children:(0,p.jsx)(s,{percent:E,showInfo:f,strokeWidth:j,width:x,bgColor:v,format:y,color:C,state:z,strokeLinecap:w},void 0)}),void 0)};v.defaultProps={type:"line",percent:0,showInfo:!0,strokeWidth:8,strokeLinecap:"round",format:function(n){return n+"%"}}}}]);