-
Notifications
You must be signed in to change notification settings - Fork 1
/
5353-602ecd81659283594bc2.js
1 lines (1 loc) · 32.3 KB
/
5353-602ecd81659283594bc2.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[5353],{35353:(n,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>b});var t=a(73450),e=a(27378),p=a(57318),o=a(61773),c=a(80964),l=a(24246);function i(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?i(Object(a),!0).forEach((function(s){(0,t.Z)(n,s,a[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s))}))}return n}var u=function(){return(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{children:"横向"}),(0,l.jsx)(o.T.Legend,{children:"样例"}),(0,l.jsxs)(o.T,{type:"horizontal",children:[(0,l.jsx)(o.T.Item,{label:"Time 1"}),(0,l.jsx)(o.T.Item,{label:"Time 2",tip:"hello"}),(0,l.jsx)(o.T.Item,{label:"Time 3"}),(0,l.jsx)(o.T.Item,{size:0,label:"自定义长度"})]}),(0,l.jsx)("h3",{children:"纵向"}),(0,l.jsx)(o.T.Legend,{children:"样例"}),(0,l.jsxs)(o.T,{type:"vertical",children:[(0,l.jsx)(o.T.Item,{label:"Time 1"}),(0,l.jsx)(o.T.Item,{label:"Time 2",tip:"hello"}),(0,l.jsx)(o.T.Item,{label:"Time 3"}),(0,l.jsx)(o.T.Item,{label:"不显示圆点,自定义颜色",showDot:!1,lineColor:"red"}),(0,l.jsx)(o.T.Item,{label:"不显示标签",showLabel:!1}),(0,l.jsx)(o.T.Item,{label:"自定义圆点颜色",dotColor:"#5197FF"}),(0,l.jsx)(o.T.Item,{size:0,label:"自定义长度"})]})]})},k=function(){return(0,l.jsx)("div",{children:(0,l.jsx)(o.T,{type:"horizontal",timeline:["hello","world",{label:"blue",dotColor:"#5197FF"},{label:"red",lineColor:"#E70000"},{label:"color",color:"#E70000"}]})})},d=function(){var n=[{label:"online",color:"#00b90e",percent:.3},{label:"unknown",percent:.2,showDot:!1,showLabel:!1},{label:"offline",color:"#E70000",percent:.5}];class s extends e.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{size:500}),(0,t.Z)(this,"onChange",(n=>{this.setState({size:n})}))}render(){var s=this.state.size;return(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Y,{value:s,onChange:this.onChange,showStepper:!0}),(0,l.jsx)(o.T,{size:s,timeline:n})]})}}return(0,l.jsx)(s,{})};function m(n){return(0,l.jsx)(n.tag,r(r({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function h(n){return(0,l.jsx)(m,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function g(n){return(0,l.jsx)(m,{tag:"style",html:n.style})}function y(n,s){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(s+=n.offsetTop),y(n.parentNode,s);return s}class v extends e.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,e=s.children;return(0,l.jsxs)("div",{className:"zandoc-react-demo",children:[(0,l.jsx)("div",{className:"zandoc-react-demo__preview",children:e}),(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)(m,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class b extends e.Component{componentDidMount(){var n=location.hash;if(n){var s=document.querySelector('a[href="'.concat(n,'"]'));s&&(0,p.l)(document.documentElement,0,y(s,-9))}}render(){return e.createElement("div",{className:"zandoc-react-container"},e.createElement(g,{style:""}),e.createElement(h,{html:'<h2 class="anchor-heading"><a href="#timeline">¶</a><a href="javascript:void(0)" id="timeline" class="anchor-point"></a>Timeline</h2>\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>'}),e.createElement(v,{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">Timeline</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>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>h3</span><span class="token punctuation">></span></span>横向<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>h3</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">Timeline.Legend</span></span><span class="token punctuation">></span></span>样例<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Timeline.Legend</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">Timeline</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>horizontal<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Time 1<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Time 2<span class="token punctuation">"</span></span> <span class="token attr-name">tip</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hello<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Time 3<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">Timeline.Item</span></span> <span class="token attr-name">size</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">0</span><span class="token punctuation">}</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</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">Timeline</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>h3</span><span class="token punctuation">></span></span>纵向<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>h3</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">Timeline.Legend</span></span><span class="token punctuation">></span></span>样例<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Timeline.Legend</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">Timeline</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>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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Time 1<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Time 2<span class="token punctuation">"</span></span> <span class="token attr-name">tip</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hello<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Time 3<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>不显示圆点,自定义颜色<span class="token punctuation">"</span></span> <span class="token attr-name">showDot</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 attr-name">lineColor</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>red<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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>不显示标签<span class="token punctuation">"</span></span> <span class="token attr-name">showLabel</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">Timeline.Item</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>自定义圆点颜色<span class="token punctuation">"</span></span> <span class="token attr-name">dotColor</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#5197FF<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">Timeline.Item</span></span> <span class="token attr-name">size</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">0</span><span class="token punctuation">}</span></span> <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</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">Timeline</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><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(u)),e.createElement(v,{title:"数组",id:"Demoarray",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Timeline</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> timeline <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token string">\'hello\'</span><span class="token punctuation">,</span>\n <span class="token string">\'world\'</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">label</span><span class="token operator">:</span> <span class="token string">\'blue\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">dotColor</span><span class="token operator">:</span> <span class="token string">\'#5197FF\'</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">label</span><span class="token operator">:</span> <span class="token string">\'red\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">lineColor</span><span class="token operator">:</span> <span class="token string">\'#E70000\'</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">label</span><span class="token operator">:</span> <span class="token string">\'color\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">color</span><span class="token operator">:</span> <span class="token string">\'#E70000\'</span><span class="token punctuation">,</span>\n <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 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>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">Timeline</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>horizontal<span class="token punctuation">"</span></span> <span class="token attr-name">timeline</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>timeline<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><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(k)),e.createElement(v,{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">Timeline</span><span class="token punctuation">,</span> <span class="token maybe-class-name">NumberInput</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> timeline <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">label</span><span class="token operator">:</span> <span class="token string">\'online\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">color</span><span class="token operator">:</span> <span class="token string">\'#00b90e\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">percent</span><span class="token operator">:</span> <span class="token number">0.3</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">label</span><span class="token operator">:</span> <span class="token string">\'unknown\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">percent</span><span class="token operator">:</span> <span class="token number">0.2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">showDot</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token literal-property property">showLabel</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">label</span><span class="token operator">:</span> <span class="token string">\'offline\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">color</span><span class="token operator">:</span> <span class="token string">\'#E70000\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">percent</span><span class="token operator">:</span> <span class="token number">0.5</span>\n <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">React<span class="token punctuation">.</span>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">size</span><span class="token operator">:</span> <span class="token number">500</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">size</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <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>\n size<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>\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> size <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\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">NumberInput</span></span> <span class="token attr-name">value</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>size<span class="token punctuation">}</span></span> <span class="token attr-name">onChange</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">onChange</span><span class="token punctuation">}</span></span> <span class="token attr-name">showStepper</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">Timeline</span></span> <span class="token attr-name">size</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>size<span class="token punctuation">}</span></span> <span class="token attr-name">timeline</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>timeline<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>\n <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>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(d)),e.createElement(h,{html:'<h2 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h2>\n<h3 class="anchor-heading"><a href="#timeline">¶</a><a href="javascript:void(0)" id="timeline" class="anchor-point"></a>Timeline</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<th>可选</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>水平或垂直</td>\n<td>string</td>\n<td><code>\'horizontal\'</code></td>\n<td><code>\'horizontal\' | \'vertical\'</code></td>\n<td>是</td>\n</tr>\n<tr>\n<td>size</td>\n<td>大小</td>\n<td>number</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>timeline</td>\n<td>时间轴数组</td>\n<td>Array</td>\n<td></td>\n<td>是</td>\n<td>是</td>\n</tr>\n<tr>\n<td>className</td>\n<td>自定义额外类名</td>\n<td>string</td>\n<td><code>\'\'</code></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>style</td>\n<td>自定义样式</td>\n<td>object</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n</tbody>\n</table>\n<h3 class="anchor-heading"><a href="#timeline-item">¶</a><a href="javascript:void(0)" id="timeline-item" class="anchor-point"></a>Timeline Item</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<th>可选</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>label</td>\n<td>标签</td>\n<td>node</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>tip</td>\n<td>hover 时的弹层提示</td>\n<td>node</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>color</td>\n<td>颜色,优先于\n<code>lineColor</code>\n和\n<code>dotColor</code></td>\n<td>string</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>lineColor</td>\n<td>线颜色</td>\n<td>string</td>\n<td><code>#999</code></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>dotColor</td>\n<td>圆点颜色</td>\n<td>string</td>\n<td><code>#00B90E</code></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>\'horizontal\'</code></td>\n<td><code>\'horizontal\' | \'vertical\'</code></td>\n<td>是</td>\n</tr>\n<tr>\n<td>showLabel</td>\n<td>是否显示标签</td>\n<td>boolean</td>\n<td><code>true</code></td>\n<td><code>true | false</code></td>\n<td>是</td>\n</tr>\n<tr>\n<td>showDot</td>\n<td>是否显示圆点</td>\n<td>boolean</td>\n<td><code>true</code></td>\n<td><code>true | false</code></td>\n<td>是</td>\n</tr>\n<tr>\n<td>size</td>\n<td>大小</td>\n<td>number</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>className</td>\n<td>自定义额外类名</td>\n<td>string</td>\n<td><code>\'\'</code></td>\n<td></td>\n<td>是</td>\n</tr>\n<tr>\n<td>style</td>\n<td>自定义样式</td>\n<td>object</td>\n<td></td>\n<td></td>\n<td>是</td>\n</tr>\n</tbody>\n</table>\n<h3 class="anchor-heading"><a href="#timeline-shu-zu">¶</a><a href="javascript:void(0)" id="timeline-shu-zu" class="anchor-point"></a>Timeline 数组</h3>\n<p>支持<code>Timeline Item</code>的全部字段</p>\n<table class="table">\n<thead>\n<tr>\n<th>额外字段</th>\n<th>说明</th>\n<th>类型</th>\n<th>可选</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id</td>\n<td>默认的\n<code>key</code>\n,若没有会采用数组下标为\n<code>key</code></td>\n<td>string</td>\n<td>是</td>\n</tr>\n<tr>\n<td>percent</td>\n<td>动态大小时占用的比例(0 <= percent <= 1)</td>\n<td>number</td>\n<td>是</td>\n</tr>\n</tbody>\n</table>'}))}}},61773:(n,s,a)=>{"use strict";a.d(s,{T:()=>m});var t=a(59312),e=a(24246),p=a(27378),o=a(60042),c=a.n(o),l=a(19185),i=a(33806),r=function(n){var s=n.color,a=void 0===s?"":s,p=(0,t._T)(n,["color"]);return(0,e.jsx)("div",(0,t.pi)({},p,{className:"zent-timeline-dot",style:{borderColor:a},"data-zv":"10.0.10"}),void 0)},u=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.color,a=n.children,p=n.style,o=n.className;return(0,e.jsxs)("div",(0,t.pi)({className:c()("zent-timeline-legend",o),style:p,"data-zv":"10.0.10"},{children:[(0,e.jsx)("div",(0,t.pi)({className:"zent-timeline-legend-line",style:{backgroundColor:s},"data-zv":"10.0.10"},{children:(0,e.jsx)(r,{color:s},void 0)}),void 0),(0,e.jsx)("label",(0,t.pi)({className:"zent-timeline-legend-label","data-zv":"10.0.10"},{children:a}),void 0)]}),void 0)},s.defaultProps={className:""},s}(p.Component),k=function(n){var s=n.children,a=n.tip,p=n.position,o=n.popoverRef;return a?(0,e.jsxs)(i.ZP,(0,t.pi)({ref:o,className:"zent-timeline-tip",position:p,cushion:20},{children:[(0,e.jsx)(i.ZP.Trigger.Hover,{children:s},void 0),(0,e.jsx)(i.ZP.Content,{children:a},void 0)]}),void 0):s},d=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.popover=null,s.mousePosition={x:0,y:0},s.onMouseMove=function(n){s.mousePosition.x=n.clientX,s.mousePosition.y=n.clientY,s.popover&&s.popover.adjustPosition()},s.position=function(n){var a=n.anchorRect,t=n.contentRect,e=n.containerRect,p=s.props.type,o=a.left,c=(a.top+a.bottom)/2-t.height/2;return{style:"horizontal"===p?{position:"absolute",left:Math.round(s.mousePosition.x-e.left)+"px",top:Math.round(c-40)+"px"}:{position:"absolute",left:Math.round(o+20)+"px",top:Math.round(s.mousePosition.y-e.top)+"px"}}},s.popoverRef=function(n){return s.popover=n},s}return(0,t.ZT)(s,n),s.prototype.render=function(){var n,s=this.props,a=s.size,p=s.showLabel,o=void 0===p||p,l=s.showDot,i=void 0===l||l,u=s.color,d=s.label,m=s.tip,h=s.className,g=s.style,y=s.type,v=s.lineColor,b=s.dotColor,f="vertical"===y?"height":"width";return(0,e.jsxs)("li",(0,t.pi)({className:c()("zent-timeline-item",h),style:g,onMouseMove:this.onMouseMove,"data-zv":"10.0.10"},{children:[(0,e.jsx)(k,(0,t.pi)({tip:m,position:this.position,popoverRef:this.popoverRef},{children:(0,e.jsx)("div",(0,t.pi)({className:"zent-timeline-item-hover","data-zv":"10.0.10"},{children:(0,e.jsx)("div",(0,t.pi)({className:"zent-timeline-item-line",style:(n={},n[f]=a,n.backgroundColor=u||v,n),"data-zv":"10.0.10"},{children:i&&(0,e.jsx)(r,{color:u||b},void 0)}),void 0)}),void 0)}),void 0),o&&(0,e.jsx)("label",(0,t.pi)({className:"zent-timeline-item-label","data-zv":"10.0.10"},{children:d}),void 0)]}),void 0)},s.defaultProps={showLabel:!0,showDot:!0,lineColor:"#f2f3f5",dotColor:"#155BD4"},s}(p.PureComponent),m=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return(0,t.ZT)(s,n),s.prototype.renderChildren=function(){var n=this.props,s=n.children,a=n.timeline,o=n.type,c=n.size;return a&&a.length?function(n,s){return n.map((function(n,a){if("string"==typeof n)return{key:n,label:n};var e=n.id,p=n.percent,o=(0,t._T)(n,["id","percent"]);return(0,t.pi)({key:e||a,size:p&&p*s},o)}))}(a,c).reduce((function(n,s){return n.push((0,e.jsx)(d,(0,t.pi)({},s,{type:o}),void 0)),n}),[]):p.Children.map(s,(function(n){return(0,l.isElement)(n)?(0,p.cloneElement)(n,{type:o}):null}))},s.prototype.render=function(){var n,s=this.props,a=s.size,p=s.type,o=s.className,l="horizontal"===p?"width":"height",i=(0,t.pi)((0,t.pi)({},this.props.style),((n={})[l]=a,n));return(0,e.jsx)("ul",(0,t.pi)({className:c()("zent-timeline","zent-timeline-"+p,{"zent-timeline-dynamic":Boolean(a)},o),style:i,"data-zv":"10.0.10"},{children:this.renderChildren()}),void 0)},s.defaultProps={type:"horizontal",size:"100%",style:{}},s.Item=d,s.Legend=u,s}(p.PureComponent)}}]);