-
Notifications
You must be signed in to change notification settings - Fork 1
/
2124-517651e75834b1254684.js
1 lines (1 loc) · 46 KB
/
2124-517651e75834b1254684.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[2124],{92124:(n,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>w});var t=a(73450),p=a(27378),e=a(57318),o=a(37162),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{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:2,status:"process"}),(0,t.Z)(this,"nextStep",(()=>{var n=this.state,s=n.current,a=n.status;3===s&&"process"===a?a="finish":(++s>3&&(s%=3),a="process"),this.setState({current:s,status:a})}))}render(){var n=this.state,s=n.current,a=n.status;return(0,l.jsxs)("div",{children:[(0,l.jsxs)(o.z,{current:s,status:a,children:[(0,l.jsx)(o.z.Step,{title:"Step One",description:"Share invitation code for friends"}),(0,l.jsx)(o.z.Step,{title:"Step Two",description:"Enter your invitation code when ordering"}),(0,l.jsx)(o.z.Step,{title:"Step Three",description:"Get a reward for the Youzan E-card"})]}),(0,l.jsx)(c.z,{style:{margin:"10px 0 0 50px"},onClick:this.nextStep,children:"Next"})]})}}return(0,l.jsx)(n,{})},k=function(){return(0,l.jsxs)(o.z,{current:2,status:"error",children:[(0,l.jsx)(o.z.Step,{title:"Step One",description:"Share invitation code for friends"}),(0,l.jsx)(o.z.Step,{title:"Step Two",description:"Enter your invitation code when ordering"}),(0,l.jsx)(o.z.Step,{title:"Step Three",description:"Get a reward for the Youzan E-card"})]})},d=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:2,status:"process"}),(0,t.Z)(this,"nextStep",(()=>{var n=this.state,s=n.current,a=n.status;3===s&&"process"===a?a="finish":(++s>3&&(s%=3),a="process"),this.setState({current:s,status:a})}))}render(){var n=this.state,s=n.current,a=n.status;return(0,l.jsxs)("div",{children:[(0,l.jsxs)(o.z,{current:s,status:a,children:[(0,l.jsx)(o.z.Step,{title:"Step One",description:"Share invitation code for friends",icon:"capital-o"}),(0,l.jsx)(o.z.Step,{title:"Step Two",description:"Enter your invitation code when ordering",icon:"clock-o"}),(0,l.jsx)(o.z.Step,{title:"Step Three",description:"Get a reward for the Youzan E-card",icon:"mini-apps-o"})]}),(0,l.jsx)(c.z,{style:{margin:"10px 0 0 50px"},onClick:this.nextStep,children:"Next"})]})}}return(0,l.jsx)(n,{})},m=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:1,status:"process"}),(0,t.Z)(this,"nextStep",(()=>{var n=this.state,s=n.current,a=n.status;3===s&&"process"===a?a="finish":(++s>3&&(s%=3),a="process"),this.setState({current:s,status:a})}))}render(){var n=this.state,s=n.current,a=n.status;return(0,l.jsxs)("div",{children:[(0,l.jsxs)(o.z,{current:s,status:a,direction:"vertical",children:[(0,l.jsx)(o.z.Step,{title:"Step One",description:"Share invitation code for friends"}),(0,l.jsx)(o.z.Step,{title:"Step Two",description:"Enter your invitation code when ordering"}),(0,l.jsx)(o.z.Step,{title:"Step Three",description:"Get a reward for the Youzan E-card"})]}),(0,l.jsx)(c.z,{onClick:this.nextStep,children:"Next"})]})}}return(0,l.jsx)(n,{})};function h(n){return(0,l.jsx)(n.tag,r(r({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function g(n){return(0,l.jsx)(h,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function v(n){return(0,l.jsx)(h,{tag:"style",html:n.style})}function f(n,s){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(s+=n.offsetTop),f(n.parentNode,s);return s}class y 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)(h,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class w 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,f(s,-9))}}render(){return p.createElement("div",{className:"zandoc-react-container"},p.createElement(v,{style:""}),p.createElement(g,{html:'<h2 class="anchor-heading"><a href="#progress-indicator">¶</a><a href="javascript:void(0)" id="progress-indicator" class="anchor-point"></a>Progress Indicator</h2>\n<p>Feedback the complete process information objectively in order and mark the current process or node and state.</p>\n<h3 class="anchor-heading"><a href="#suggestion">¶</a><a href="javascript:void(0)" id="suggestion" class="anchor-point"></a>Suggestion</h3>\n<ul>\n<li>When the task is complex or has a sequential relationship, the progress indicator will decompose it into multiple nodes, simplifying the user\'s cognition and operation cost of each step and feedback the current state.</li>\n<li>When a task contains multiple nodes with contextual relationship and needs to feedback the task flow status, the progress indicator is used.</li>\n<li>When a complex task needs to be broken down into multiple tasks, use the navigation step bar.</li>\n<li>If only the progress of a task does not contain multiple nodes, use the progress bar.</li>\n<li>If the content can be split into multiple sub-contents without any logical relationship, use tabs.</li>\n</ul>\n<h3 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h3>'}),p.createElement(y,{title:"Basic usage",id:"Demo1",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Indicator</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">StepsExample</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">current</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">status</span><span class="token operator">:</span> <span class="token string">\'process\'</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">nextStep</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> <span class="token punctuation">{</span> current<span class="token punctuation">,</span> status <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">if</span> <span class="token punctuation">(</span>current <span class="token operator">===</span> <span class="token number">3</span> <span class="token operator">&&</span> status <span class="token operator">===</span> <span class="token string">\'process\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n status <span class="token operator">=</span> <span class="token string">\'finish\'</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span> <span class="token keyword control-flow">else</span> <span class="token punctuation">{</span>\n current<span class="token operator">++</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>current <span class="token operator">></span> <span class="token number">3</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n current <span class="token operator">=</span> current <span class="token operator">%</span> <span class="token number">3</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n status <span class="token operator">=</span> <span class="token string">\'process\'</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\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>\n current<span class="token punctuation">,</span>\n status<span class="token punctuation">,</span>\n <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">let</span> <span class="token punctuation">{</span> current<span class="token punctuation">,</span> status <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 punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Indicator</span></span> <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>status<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">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step One<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Share invitation code for friends<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><span class="token class-name">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Two<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Enter your invitation code when ordering<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><span class="token class-name">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Three<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Get a reward for the Youzan E-card<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><span class="token class-name">Indicator</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">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> <span class="token literal-property property">margin</span><span class="token operator">:</span> <span class="token string">\'10px 0 0 50px\'</span> <span class="token punctuation">}</span><span class="token punctuation">}</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">nextStep</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token maybe-class-name">Next</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 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">StepsExample</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(y,{title:"Failure Status",id:"Demo2",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Indicator</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 maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Indicator</span></span> <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">2</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>error<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">Indicator.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step One<span class="token punctuation">"</span></span> <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Share invitation code for friends<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">Indicator.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Two<span class="token punctuation">"</span></span> <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Enter your invitation code when ordering<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">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Three<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Get a reward for the Youzan E-card<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><span class="token class-name">Indicator</span></span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(k)),p.createElement(y,{title:"Custom Step Icon",id:"Demo3",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Indicator</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">StepsExample</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">current</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">status</span><span class="token operator">:</span> <span class="token string">\'process\'</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">nextStep</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> <span class="token punctuation">{</span> current<span class="token punctuation">,</span> status <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">if</span> <span class="token punctuation">(</span>current <span class="token operator">===</span> <span class="token number">3</span> <span class="token operator">&&</span> status <span class="token operator">===</span> <span class="token string">\'process\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n status <span class="token operator">=</span> <span class="token string">\'finish\'</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span> <span class="token keyword control-flow">else</span> <span class="token punctuation">{</span>\n current<span class="token operator">++</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>current <span class="token operator">></span> <span class="token number">3</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n current <span class="token operator">=</span> current <span class="token operator">%</span> <span class="token number">3</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n status <span class="token operator">=</span> <span class="token string">\'process\'</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\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>\n current<span class="token punctuation">,</span>\n status<span class="token punctuation">,</span>\n <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">let</span> <span class="token punctuation">{</span> current<span class="token punctuation">,</span> status <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 punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Indicator</span></span> <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>status<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">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step One<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Share invitation code for friends<span class="token punctuation">"</span></span>\n <span class="token attr-name">icon</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>capital-o<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><span class="token class-name">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Two<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Enter your invitation code when ordering<span class="token punctuation">"</span></span>\n <span class="token attr-name">icon</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>clock-o<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><span class="token class-name">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Three<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Get a reward for the Youzan E-card<span class="token punctuation">"</span></span>\n <span class="token attr-name">icon</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>mini-apps-o<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><span class="token class-name">Indicator</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">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> <span class="token literal-property property">margin</span><span class="token operator">:</span> <span class="token string">\'10px 0 0 50px\'</span> <span class="token punctuation">}</span><span class="token punctuation">}</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">nextStep</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token maybe-class-name">Next</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 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">StepsExample</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(g,{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>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n<th>Alternative</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>current</td>\n<td>The curren step which starts from 1. When this property is not passed, \n<code>current</code>\n is 0 and steps is in status of \n<code>wait</code>\n.</td>\n<td>number</td>\n<td><code>0</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>status</td>\n<td>The status of indicator.</td>\n<td>string</td>\n<td><code>\'process\'</code></td>\n<td><code>\'wait\'</code>\n, \n<code>\'finish\'</code>\n, \n<code>\'error\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>sequence</td>\n<td>Whether to use the default number or not</td>\n<td>boolean</td>\n<td><code>true</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onStepChange</td>\n<td>The callback function that is triggered when the steps in clicked and changed, especially for steps of card type, breadcrumb type and tabs type.</td>\n<td>func</td>\n<td><code>\'\'</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>direction</td>\n<td>The direction of steps, especially for steps of number type.</td>\n<td>string</td>\n<td><code>\'horizontal\'</code></td>\n<td><code>\'vertical\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>className</td>\n<td>The custom classname</td>\n<td>string</td>\n<td><code>\'\'</code></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#the-following-functions-is-obs">¶</a><a href="javascript:void(0)" id="the-following-functions-is-obs" class="anchor-point"></a>The following functions is obsolete in the new design system and is only used as a reference for the old version</h4>'}),p.createElement(y,{title:"Vertical direction",id:"Demo4",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Indicator</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">StepsExample</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">current</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">status</span><span class="token operator">:</span> <span class="token string">\'process\'</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">nextStep</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> <span class="token punctuation">{</span> current<span class="token punctuation">,</span> status <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">if</span> <span class="token punctuation">(</span>current <span class="token operator">===</span> <span class="token number">3</span> <span class="token operator">&&</span> status <span class="token operator">===</span> <span class="token string">\'process\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n status <span class="token operator">=</span> <span class="token string">\'finish\'</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span> <span class="token keyword control-flow">else</span> <span class="token punctuation">{</span>\n current<span class="token operator">++</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>current <span class="token operator">></span> <span class="token number">3</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n current <span class="token operator">=</span> current <span class="token operator">%</span> <span class="token number">3</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n status <span class="token operator">=</span> <span class="token string">\'process\'</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\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>\n current<span class="token punctuation">,</span>\n status<span class="token punctuation">,</span>\n <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">let</span> <span class="token punctuation">{</span> current<span class="token punctuation">,</span> status <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 punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Indicator</span></span> <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</span></span> <span class="token attr-name">status</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>status<span class="token punctuation">}</span></span> <span class="token attr-name">direction</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>vertical<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">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step One<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Share invitation code for friends<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><span class="token class-name">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Two<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Enter your invitation code when ordering<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><span class="token class-name">Indicator.Step</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Step Three<span class="token punctuation">"</span></span>\n <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Get a reward for the Youzan E-card<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><span class="token class-name">Indicator</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">nextStep</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Next</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 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">StepsExample</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)))}}},37162:(n,s,a)=>{"use strict";a.d(s,{z:()=>o});var t=a(59312),p=a(24246),e=a(37424),o=function(n){return(0,p.jsx)(e.R,(0,t.pi)({type:"number"},n),void 0)};o.Step=e.R.Step},37424:(n,s,a)=>{"use strict";a.d(s,{R:()=>d});var t=a(59312),p=a(24246),e=a(27378),o=a(60042),c=a.n(o),l=a(27036),u=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.renderIconNode=function(){var n=s.props,a=n.stepNumber,e=n.sequence,o=n.status,c=void 0===o?"wait":o,u=n.icon;if(u){var r="string"==typeof u?(0,p.jsx)(l.Z,{type:u},void 0):u;return(0,p.jsx)(p.Fragment,{children:r},void 0)}return"finish"===c?(0,p.jsx)(l.Z,{type:"check-circle-o"},void 0):"error"===c?(0,p.jsx)(l.Z,{type:"error-circle"},void 0):(0,p.jsx)("span",(0,t.pi)({className:"zent-icon zent-steps-sequence","data-zv":"10.0.10"},{children:e?a:""}),void 0)},s}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.props,s=n.isCurrentStep,a=n.status,e=void 0===a?"wait":a,o=n.isLastFinishStep,l=n.stepLast,u=n.title,r=n.description,i=c()("zent-steps-item","zent-steps-status-"+e,{"zent-steps-item--current":s,"zent-steps-item--last-finished":o});return(0,p.jsxs)("div",(0,t.pi)({className:i,"data-zv":"10.0.10"},{children:[!l&&(0,p.jsx)("div",(0,t.pi)({className:"zent-steps-tail","data-zv":"10.0.10"},{children:(0,p.jsx)("i",{"data-zv":"10.0.10"},void 0)}),void 0),(0,p.jsxs)("div",(0,t.pi)({className:"zent-steps-step","data-zv":"10.0.10"},{children:[(0,p.jsx)("div",(0,t.pi)({className:"zent-step-head","data-zv":"10.0.10"},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-step-head-inner","data-zv":"10.0.10"},{children:this.renderIconNode()}),void 0)}),void 0),(0,p.jsxs)("div",(0,t.pi)({className:"zent-step-main","data-zv":"10.0.10"},{children:[(0,p.jsx)("div",(0,t.pi)({className:"zent-step-title","data-zv":"10.0.10"},{children:u}),void 0),r&&(0,p.jsx)("div",(0,t.pi)({className:"zent-step-description","data-zv":"10.0.10"},{children:r}),void 0)]}),void 0)]}),void 0)]}),void 0)},s.defaultProps={description:""},s}(e.Component),r=a(19185),i=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.props,s=n.className,a=n.children,o=n.current,l=n.status,u=n.direction,i=n.sequence,k=e.Children.count(a)-1,d=c()(s,"zent-steps","zent-steps__"+u);return(0,p.jsx)("div",(0,t.pi)({className:d,"data-zv":"10.0.10"},{children:e.Children.map(a,(function(n,s){var a={sequence:i,stepNumber:(s+1).toString(),stepLast:s===k,isCurrentStep:s===o-1,isLastFinishStep:"error"===l&&s===o-2,status:"wait"};return(0,r.isElement)(n)?(n.props.status||(a.status=s===o-1?l:s<o-1?"finish":"wait"),(0,e.cloneElement)(n,a)):null}))}),void 0)},s}(e.Component),k=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.onStepChange=function(n){var a=s.props.onStepChange;a&&a(n)},s.renderStepTitle=function(n,a){var e=s.props,o=e.sequence,c=e.ghost,u=n.icon,r=n.title;if(u){var i="string"==typeof u?(0,p.jsx)(l.Z,{type:u,className:"zent-steps-item__icon"},void 0):u;return(0,p.jsxs)(p.Fragment,{children:[i,r]},void 0)}return o?(0,p.jsxs)(p.Fragment,{children:[c?(0,p.jsx)("span",(0,t.pi)({className:"zent-steps-sequence","data-zv":"10.0.10"},{children:a+1}),void 0):a+1+". ",r]},void 0):r},s}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this,s=this.props,a=s.className,o=s.children,l=s.current,u=s.onStepChange,i=s.type,k=s.ghost,d=100/e.Children.count(o)+"%",m="breadcrumb"===i,h="card"===i,g="tabs"===i,v=k&&m,f=c()("zent-steps",a,{"zent-steps-breadcrumb":m,"zent-steps-card":h,"zent-steps-tabs":g,"zent-steps-breadcrumb-ghost":v});return(0,p.jsx)("div",(0,t.pi)({className:f,"data-zv":"10.0.10"},{children:e.Children.map(o,(function(s,a){if(!(0,r.isElement)(s))return null;var e=s.props.disabled&&v,o=c()("zent-steps-item",{"zent-steps-item--finished":m&&a<=l-1,"zent-steps-item--current":(h||g||v)&&a===l-1,"zent-steps-item--clickable":Boolean(u),"zent-steps-item--disabled":e});return(0,p.jsx)("div",(0,t.pi)({className:o,style:{width:d},onClick:function(){return!e&&n.onStepChange(a+1)},"data-zv":"10.0.10"},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-steps-step","data-zv":"10.0.10"},{children:n.renderStepTitle(s.props,a)}),void 0)}),void 0)}))}),void 0)},s}(e.Component),d=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.props,s=n.type,a=n.children,e=(0,t._T)(n,["type","children"]),o={number:i,card:k,breadcrumb:k,tabs:k}[s];return(0,p.jsx)(o,(0,t.pi)({},e,{type:s},{children:a}),void 0)},s.defaultProps={className:"",type:"number",current:0,direction:"horizontal",size:"normal",status:"process",sequence:!0,ghost:!1},s.Step=u,s}(e.Component)}}]);