-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3653-f15d278a6a92923658ec.js
1 lines (1 loc) · 118 KB
/
3653-f15d278a6a92923658ec.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[3653],{4792:(n,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>T});var t=s(73450),p=s(73118),e=s(27378),o=s(57318),c=s(56377),l=s(69916),r=s(71457),u=s(39215),i=s(24246);function k(n,a){var s=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.push.apply(s,t)}return s}function d(n){for(var a=1;a<arguments.length;a++){var s=null!=arguments[a]?arguments[a]:{};a%2?k(Object(s),!0).forEach((function(a){(0,t.Z)(n,a,s[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):k(Object(s)).forEach((function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(s,a))}))}return n}var y=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}],a=()=>{var a=(0,e.useState)(!1),s=(0,p.Z)(a,2),t=s[0],o=s[1];return(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"zent-demo-tree-basic-switch-wrapper",children:["Auto Expand On Select:",(0,i.jsx)(c.r,{checked:t,onChange:n=>o(n)})]}),(0,i.jsx)(l.m,{data:n,autoExpandOnSelect:t})]})};return(0,i.jsx)(a,{})},m=function(){return(0,i.jsx)(l.m,{dataType:"plain",data:[{id:1,title:"Hangzhou Youzan Technology Co. Ltd"},{id:2,title:"Engineer",parentId:1},{id:3,title:"Back End Engineer",parentId:2},{id:4,title:"Front End Engineer",parentId:2},{id:5,title:"Operations Engineer",parentId:2},{id:6,title:"Product",parentId:1}]})},h=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer",children:[{id:7,title:"JAVA"},{id:8,title:"PHP"},{id:9,title:"GO"},{id:10,title:".NET"}]},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}];class a extends e.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{checkedKeys:[3,5,22],disabledCheckedKeys:[4,7,9,22]}),(0,t.Z)(this,"onCheck",((n,a)=>{this.setState({checkedKeys:n})}))}render(){var a=this.state,s=a.checkedKeys,t=a.disabledCheckedKeys;return(0,i.jsx)("div",{children:(0,i.jsx)(l.m,{checkable:!0,size:"small",data:n,onCheck:this.onCheck,checkedKeys:s,disabledCheckedKeys:t})})}}return(0,i.jsx)(a,{})},g=function(){var n=(n,a)=>{n.level<4?setTimeout((()=>{for(var s=[],t=Number(n.title.split("-")[0]),p=Math.pow(10,3-n.level),e=n.level+1,o=0,c="",l=!1;o<=9;o++)4===e?(c=String(t+o),l=!0):(c="".concat(t+p*o,"-").concat(t+p*(o+1)),l=!1),s.push({id:c,level:e,title:c,isLeaf:l});a(s)}),200):setTimeout((()=>a([])),200)};class a extends e.Component{constructor(...a){super(...a),(0,t.Z)(this,"state",{treeData:[]}),(0,t.Z)(this,"loadMore",(a=>new Promise(((s,t)=>{n(a,(n=>{var t=n.map((n=>d(d({},n),{},{parentId:a.id})));this.setState({treeData:[...this.state.treeData,...t]}),s()}))}))))}componentDidMount(){var a={id:"1-0-10000",title:"0-10000",level:0,expand:!0};n(a,(n=>{var s=n.map((n=>d(d({},n),{},{parentId:a.id})));this.setState({treeData:[a,...s]})}))}render(){var n=this.state.treeData;return(0,i.jsx)(l.m,{dataType:"plain",data:n,loadMore:this.loadMore})}}return(0,i.jsx)(a,{})},b=function(){var n=[2],a=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}];return(0,i.jsxs)("div",{className:"zent-demo-tree-disable-select-wrapper",children:[(0,i.jsx)(l.m,{data:a,disabledSelectedKeys:n}),(0,i.jsx)(l.m,{data:a,disabledSelectedKeys:n,disableSelectedStrictly:!0})]})},f=function(){return(0,i.jsx)(l.m,{dataType:"plain",data:[{id:1,title:"Hangzhou Youzan Technology Co. Ltd"},{id:2,title:"Engineer",parentId:1},{id:3,title:"Back End Engineer",parentId:2},{id:4,title:"Front End Engineer",parentId:2},{id:5,title:"Operations Engineer",parentId:2},{id:6,title:"Product",parentId:1}]})},v=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}];return(0,i.jsxs)("div",{className:"zent-demo-tree-wrapper",children:[(0,i.jsx)(l.m,{data:n,size:"small"}),(0,i.jsx)(l.m,{data:n}),(0,i.jsx)(l.m,{data:n,size:"large"})]})},w=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",content:"great company",children:[{id:2,title:"Engineer",content:"job http://job.youzan.com",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product",content:(0,i.jsx)("a",{href:"http://job.youzan.com",children:"'send resume to [email protected]'"})}]}];return(0,i.jsx)(l.m,{data:n,render:n=>(0,i.jsxs)("span",{style:{fontSize:16,margin:0,lineHeight:1},children:[n.title,n.content?(0,i.jsx)("small",{style:{display:"block",fontSize:10},children:n.content}):""]})})},E=function(){var n=r.Y.Group,a=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd"},{id:2,title:"Engineer",parentId:1},{id:3,title:"Back End Engineer",parentId:2},{id:4,title:"Front End Engineer",parentId:2},{id:5,title:"Operations Engineer",parentId:2},{id:6,title:"Product",parentId:1}],s=(n,a=0,t=[])=>{var p={id:String(Math.random()).replace("0.",""),parentId:a,title:n.title};t.push(p);for(var e=0,o=n.children&&n.children.length||0;e<o;e++)s(n.children[e],p.id,t);return t};class p extends e.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{treeData:a,copyType:"shallow"}),(0,t.Z)(this,"onDelete",(n=>{this.setState({treeData:this.state.treeData.filter((a=>a.id!==n.id))})})),(0,t.Z)(this,"onClone",(n=>{var a=this.state.copyType;if("shallow"===a){var t=Object.assign({},n,{id:Date.now()});this.setState({treeData:[...this.state.treeData,t]})}else if("deep"===a){var p=s(n,n.parentId);this.setState({treeData:[...this.state.treeData,...p]})}})),(0,t.Z)(this,"onCopyTypeChange",(n=>this.setState({copyType:n.target.value})))}render(){var a=this.state,s=a.copyType,t=a.treeData,p=[{name:"Delete",icon:(0,i.jsx)(u.J,{type:"close"}),action:this.onDelete},{name:"Clone",icon:(0,i.jsx)(u.J,{type:"plus"}),action:this.onClone}];return(0,i.jsxs)("div",{children:[(0,i.jsxs)(n,{onChange:this.onCopyTypeChange,value:s,children:[(0,i.jsx)(r.Y,{value:"shallow",children:"浅拷贝"}),(0,i.jsx)(r.Y,{value:"deep",children:"深拷贝"})]}),(0,i.jsx)("hr",{}),(0,i.jsx)(l.m,{data:t,dataType:"plain",operations:p})]})}}return(0,i.jsx)(p,{})};function x(n){return(0,i.jsx)(n.tag,d(d({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function j(n){return(0,i.jsx)(x,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function z(n){return(0,i.jsx)(x,{tag:"style",html:n.style})}function D(n,a){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(a+=n.offsetTop),D(n.parentNode,a);return a}class C 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,a=this.props,s=a.title,t=a.src,p=a.children;return(0,i.jsxs)("div",{className:"zandoc-react-demo",children:[(0,i.jsx)("div",{className:"zandoc-react-demo__preview",children:p}),(0,i.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,i.jsx)("div",{className:"zandoc-react-demo__title",children:(0,i.jsx)("p",{children:s||""})}),(0,i.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,i.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,i.jsx)(x,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class T extends e.Component{componentDidMount(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&(0,o.l)(document.documentElement,0,D(a,-9))}}render(){return e.createElement("div",{className:"zandoc-react-container"},e.createElement(z,{style:".zent-demo-tree-basic-switch-wrapper {\n\t\tmargin-bottom: 16px;\n\t\tdisplay: flex;\n\t}\n\t.zent-demo-tree-basic-switch-wrapper .zent-switch {\n\t\tmargin-left: 12px;\n\t}\n\n.zent-demo-tree-disable-select-wrapper {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t}\n\t.zent-demo-tree-disable-select-wrapper > ul {\n\t\twidth: 45%;\n\t}\n\n.zent-demo-tree-wrapper > .zent-tree {\n\t\tmargin-bottom: 16px;\n\t}"}),e.createElement(j,{html:'<h2 class="anchor-heading"><a href="#tree">¶</a><a href="javascript:void(0)" id="tree" class="anchor-point"></a>Tree</h2>\n<p>Visually display multilevel content, supporting expansion and collapse.</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>Use the <code>Tree</code> component when hierarchical information needs to be displayed in a window.</li>\n</ul>\n<h3 class="anchor-heading"><a href="#note">¶</a><a href="javascript:void(0)" id="note" class="anchor-point"></a>Note</h3>\n<ul>\n<li>Do not use <code>Tree</code> when non-hierarchical or hierarchical information does not need to be displayed in a window.</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>'}),e.createElement(C,{title:"Basic Usage",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">Tree</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Switch</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<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> useState <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'react\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> treeData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</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 <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</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 <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 keyword">const</span> <span class="token function-variable function"><span class="token maybe-class-name">Demo</span></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">const</span> <span class="token punctuation">[</span>autoExpandOnSelect<span class="token punctuation">,</span> setAutoExpandOnSelect<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token function">useState</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</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>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-demo-tree-basic-switch-wrapper<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token maybe-class-name">Auto</span> <span class="token maybe-class-name">Expand</span> <span class="token maybe-class-name">On</span> <span class="token maybe-class-name">Select</span><span class="token operator">:</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Switch</span></span>\n <span class="token attr-name">checked</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>autoExpandOnSelect<span class="token punctuation">}</span></span>\n <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 parameter">checked</span> <span class="token arrow operator">=></span> <span class="token function">setAutoExpandOnSelect</span><span class="token punctuation">(</span>checked<span class="token punctuation">)</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 tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">autoExpandOnSelect</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>autoExpandOnSelect<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><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">Demo</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(y)),e.createElement(C,{title:"Array data",id:"Demoarraydata",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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> treeData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</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">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">1</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">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</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">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</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">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">1</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><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tree</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(m)),e.createElement(C,{title:"Optional Tree",id:"Demooption",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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> treeData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'JAVA\'</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">id</span><span class="token operator">:</span> <span class="token number">8</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'PHP\'</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">id</span><span class="token operator">:</span> <span class="token number">9</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'GO\'</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">id</span><span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'.NET\'</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 <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</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 <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</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 <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 keyword">class</span> <span class="token class-name">TreeExample</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">checkedKeys</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">22</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token literal-property property">disabledCheckedKeys</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">9</span><span class="token punctuation">,</span> <span class="token number">22</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">onCheck</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">checked<span class="token punctuation">,</span> helpInfo</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span>checked<span class="token punctuation">,</span> helpInfo<span class="token punctuation">)</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 <span class="token literal-property property">checkedKeys</span><span class="token operator">:</span> checked<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">const</span> <span class="token punctuation">{</span> checkedKeys<span class="token punctuation">,</span> disabledCheckedKeys <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">Tree</span></span>\n <span class="token attr-name">checkable</span>\n <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>small<span class="token punctuation">"</span></span>\n <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span>\n <span class="token attr-name">onCheck</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">onCheck</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">checkedKeys</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>checkedKeys<span class="token punctuation">}</span></span>\n <span class="token attr-name">disabledCheckedKeys</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>disabledCheckedKeys<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">TreeExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(h)),e.createElement(C,{title:"Async Loading",id:"Demoasync",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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> <span class="token function-variable function">fetchData</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data<span class="token punctuation">,</span> callback</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>data<span class="token punctuation">.</span><span class="token property-access">level</span> <span class="token operator"><</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token function">setTimeout</span><span class="token punctuation">(</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">const</span> resData <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n <span class="token keyword">const</span> base <span class="token operator">=</span> <span class="token known-class-name class-name">Number</span><span class="token punctuation">(</span>data<span class="token punctuation">.</span><span class="token property-access">title</span><span class="token punctuation">.</span><span class="token method function property-access">split</span><span class="token punctuation">(</span><span class="token string">\'-\'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token keyword">const</span> step <span class="token operator">=</span> <span class="token known-class-name class-name">Math</span><span class="token punctuation">.</span><span class="token method function property-access">pow</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">3</span> <span class="token operator">-</span> data<span class="token punctuation">.</span><span class="token property-access">level</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token keyword">const</span> level <span class="token operator">=</span> data<span class="token punctuation">.</span><span class="token property-access">level</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> id <span class="token operator">=</span> <span class="token string">\'\'</span><span class="token punctuation">,</span> isLeaf <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span> i <span class="token operator"><=</span> <span class="token number">9</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>level <span class="token operator">===</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n id <span class="token operator">=</span> <span class="token known-class-name class-name">String</span><span class="token punctuation">(</span>base <span class="token operator">+</span> i<span class="token punctuation">)</span><span class="token punctuation">;</span>\n isLeaf <span class="token operator">=</span> <span class="token boolean">true</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 id <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>base <span class="token operator">+</span> step <span class="token operator">*</span> i<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">-</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>base <span class="token operator">+</span> step <span class="token operator">*</span> <span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>\n isLeaf <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n resData<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span> id<span class="token punctuation">,</span> level<span class="token punctuation">,</span> <span class="token literal-property property">title</span><span class="token operator">:</span> id<span class="token punctuation">,</span> isLeaf <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token function">callback</span><span class="token punctuation">(</span>resData<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">)</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 <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token function">callback</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">;</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">TreeExample</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">treeData</span><span class="token operator">:</span> <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">componentDidMount</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> rootData <span class="token operator">=</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token string">\'1-0-10000\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'0-10000\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">level</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token literal-property property">expand</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n <span class="token function">fetchData</span><span class="token punctuation">(</span>rootData<span class="token punctuation">,</span> <span class="token parameter">resData</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> newData <span class="token operator">=</span> resData<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> <span class="token punctuation">(</span><span class="token punctuation">{</span>\n <span class="token spread operator">...</span>item<span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> rootData<span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</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 <span class="token literal-property property">treeData</span><span class="token operator">:</span> <span class="token punctuation">[</span>rootData<span class="token punctuation">,</span> <span class="token spread operator">...</span>newData<span class="token punctuation">]</span><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><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">loadMore</span> <span class="token operator">=</span> <span class="token parameter">data</span> <span class="token arrow operator">=></span>\n <span class="token keyword">new</span> <span class="token class-name">Promise</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">resolve<span class="token punctuation">,</span> reject</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token function">fetchData</span><span class="token punctuation">(</span>data<span class="token punctuation">,</span> <span class="token parameter">resData</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> newData <span class="token operator">=</span> resData<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> <span class="token punctuation">(</span><span class="token punctuation">{</span>\n <span class="token spread operator">...</span>item<span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</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> <span class="token literal-property property">treeData</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token spread 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">treeData</span><span class="token punctuation">,</span> <span class="token spread operator">...</span>newData<span class="token punctuation">]</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token function">resolve</span><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><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><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> treeData <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 tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tree</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">loadMore</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">loadMore</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></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">TreeExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(g)),e.createElement(C,{title:"Disable select",id:"Demodisableselect",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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> disabledSelectedKeys <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> treeData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</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 <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</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 <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 attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-demo-tree-disable-select-wrapper<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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">disabledSelectedKeys</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>disabledSelectedKeys<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">Tree</span></span>\n <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span>\n <span class="token attr-name">disabledSelectedKeys</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>disabledSelectedKeys<span class="token punctuation">}</span></span>\n <span class="token attr-name">disableSelectedStrictly</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">true</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><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(b)),e.createElement(j,{html:'<h3 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h3>\n<h4 class="anchor-heading"><a href="#tree">¶</a><a href="javascript:void(0)" id="tree" class="anchor-point"></a>Tree</h4>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n<th>Alternative</th>\n<th></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>dataType</td>\n<td>data structure, default is tree</td>\n<td>string</td>\n<td><code>\'tree\'</code></td>\n<td><code>\'plain\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>data</td>\n<td>required, input data, identified by dataType</td>\n<td>array</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>renderKey</td>\n<td>the key map for render node, see the following table</td>\n<td>object</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>render</td>\n<td>you can customize function to render tree , the parameter is node data (includings children tree)</td>\n<td>func(data)</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>operations</td>\n<td>custom operate, includes \n<code>name</code>\n, \n<code>icon</code>\n, \n<code>action</code>\n, \n<code>shouldRender</code>\n attributes</td>\n<td>array\n[\nobject\n]</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>foldable</td>\n<td>whether to support item show and hide</td>\n<td>bool</td>\n<td><code>true</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onCheck</td>\n<td>when you click checkbox, callback function will call, params is a checked id list and help info</td>\n<td>func(ids, helpInfo)</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>checkable</td>\n<td>whether to support checkbox</td>\n<td>bool</td>\n<td><code>true</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>checkedKeys</td>\n<td>checked node id array</td>\n<td>array</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>disabledCheckedKeys</td>\n<td>default disabled selected node id array</td>\n<td>array</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>size</td>\n<td>size</td>\n<td>string</td>\n<td><code>\'medium\'</code></td>\n<td><code>\'small\'</code>\n, \n<code>\'large\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>commonStyle</td>\n<td>set entire tree style</td>\n<td>object</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>expandAll</td>\n<td>whether to expand all nodes</td>\n<td>bool</td>\n<td><code>false</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onExpand</td>\n<td>after node expands, callback is trigger</td>\n<td>func(data, config)</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>autoExpandOnSelect</td>\n<td>node auto expands when you select it</td>\n<td>bool</td>\n<td><code>false</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onSelect</td>\n<td>the callback when you choose tree node</td>\n<td>func(data, target)</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>isRoot</td>\n<td>plain data, to determine whether the node is the api of the root node</td>\n<td>func(node)</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>loadMore</td>\n<td>return Promise func, support thenable callback, be used to asynchronously load more content</td>\n<td>func(data)</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>selectable</td>\n<td>whether the node is selectable</td>\n<td>bool</td>\n<td><code>true</code></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>selectedKey</td>\n<td>The currently selected node</td>\n<td><code>string</code>\n|\n<code>number</code></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>disabledSelectedKeys</td>\n<td>A collection of forbidden nodes id</td>\n<td><code>(string | number)[]</code></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>disableSelectedStrictly</td>\n<td>Whether the parent is prohibited from selecting its children at the same time</td>\n<td><code>boolean</code></td>\n<td><code>false</code></td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onlyShowOneLine</td>\n<td>Title Whether only show one line</td>\n<td><code>boolean</code></td>\n<td><code>false</code></td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#renderkey">¶</a><a href="javascript:void(0)" id="renderkey" class="anchor-point"></a>renderKey</h4>\n<p>The Key for customized for <code>data</code>.</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id</td>\n<td>key for unique key</td>\n<td>string</td>\n<td><code>\'id\'</code></td>\n</tr>\n<tr>\n<td>title</td>\n<td>key for show title</td>\n<td>string</td>\n<td><code>\'title\'</code></td>\n</tr>\n<tr>\n<td>children</td>\n<td>key for children tree (\n<code>dataType="tree"</code>\n it works)</td>\n<td>string</td>\n<td><code>\'children\'</code></td>\n</tr>\n<tr>\n<td>parentId</td>\n<td>key for parent Id (\n<code>dataType="plain"</code>\n it works)</td>\n<td>string</td>\n<td><code>\'parentId\'</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#data">¶</a><a href="javascript:void(0)" id="data" class="anchor-point"></a>data</h4>\n<p>Except for key-value below, you can add attributes on any node, the callback will get entire data that user input.\nYou can customize key through <code>renderKey</code>.</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id</td>\n<td>required, unique key</td>\n<td>number/string</td>\n<td></td>\n</tr>\n<tr>\n<td>title</td>\n<td>required, show title</td>\n<td>string</td>\n<td></td>\n</tr>\n<tr>\n<td>children</td>\n<td>children tree (\n<code>dataType="tree"</code>\n it works)</td>\n<td>array\n[\nobject\n]</td>\n<td></td>\n</tr>\n<tr>\n<td>parentId</td>\n<td>parent Id (\n<code>dataType="plain"</code>\n it works), root node is 0 or undefined</td>\n<td>number/string</td>\n<td></td>\n</tr>\n<tr>\n<td>expand</td>\n<td>whether to expand or not</td>\n<td>bool</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>isLeaf</td>\n<td>whether is leaf node or not</td>\n<td>bool</td>\n<td><code>false</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#operations">¶</a><a href="javascript:void(0)" id="operations" class="anchor-point"></a>operations</h4>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>required, show content</td>\n<td>string</td>\n<td></td>\n</tr>\n<tr>\n<td>icon</td>\n<td>display icon className, or ReactNode</td>\n<td>string/ReactNode</td>\n<td></td>\n</tr>\n<tr>\n<td>action</td>\n<td>required, click callback, the parameter is children tree</td>\n<td>func(data)</td>\n<td></td>\n</tr>\n<tr>\n<td>shouldRender</td>\n<td>is it need to update, return true/false</td>\n<td>func(data)</td>\n<td><code>true</code></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>'}),e.createElement(C,{title:"Array data",id:"Demodisableddata",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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> treeData <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><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 literal-property property">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">1</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">1</span>\n<span class="token punctuation">}</span><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><span class="token class-name">Tree</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span>'},e.createElement(f)),e.createElement(C,{title:"Three Size",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">Tree</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> treeData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</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 <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</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 <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 attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-demo-tree-wrapper<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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>small<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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>large<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(v)),e.createElement(C,{title:"Custom Node Display",id:"Democustomnode",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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> treeData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">content</span><span class="token operator">:</span> <span class="token string">\'great company\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">content</span><span class="token operator">:</span> <span class="token string">\'job http://job.youzan.com\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</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 <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">content</span><span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://job.youzan.com<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token string">\'send resume to [email protected]\'</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></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 <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 keyword">const</span> <span class="token function-variable function">customRender</span> <span class="token operator">=</span> <span class="token parameter">data</span> <span class="token arrow operator">=></span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>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">fontSize</span><span class="token operator">:</span> <span class="token number">16</span><span class="token punctuation">,</span> <span class="token literal-property property">margin</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token literal-property property">lineHeight</span><span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token punctuation">{</span>data<span class="token punctuation">.</span><span class="token property-access">title</span><span class="token punctuation">}</span>\n <span class="token punctuation">{</span>data<span class="token punctuation">.</span><span class="token property-access">content</span> <span class="token operator">?</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>small</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">display</span><span class="token operator">:</span> <span class="token string">\'block\'</span><span class="token punctuation">,</span> <span class="token literal-property property">fontSize</span><span class="token operator">:</span> <span class="token number">10</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token punctuation">{</span>data<span class="token punctuation">.</span><span class="token property-access">content</span><span class="token punctuation">}</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>small</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span> <span class="token operator">:</span> <span class="token punctuation">(</span>\n <span class="token string">\'\'</span>\n <span class="token punctuation">)</span><span class="token punctuation">}</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></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><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">render</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>customRender<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(w)),e.createElement(C,{title:"Custom Operate",id:"Democustomoperate",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Icon</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Radio</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> <span class="token maybe-class-name">RadioGroup</span> <span class="token operator">=</span> <span class="token maybe-class-name">Radio</span><span class="token punctuation">.</span><span class="token property-access"><span class="token maybe-class-name">Group</span></span><span class="token punctuation">;</span>\n<span class="token keyword">const</span> originData <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</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">id</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">1</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">id</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</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">id</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</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">id</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">2</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">id</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentId</span><span class="token operator">:</span> <span class="token number">1</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 keyword">const</span> <span class="token function-variable function">deepClone</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">node<span class="token punctuation">,</span> parentId <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> nodeArray <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span></span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> copyNode <span class="token operator">=</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token known-class-name class-name">String</span><span class="token punctuation">(</span><span class="token known-class-name class-name">Math</span><span class="token punctuation">.</span><span class="token method function property-access">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">replace</span><span class="token punctuation">(</span><span class="token string">\'0.\'</span><span class="token punctuation">,</span> <span class="token string">\'\'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>\n parentId<span class="token punctuation">,</span>\n <span class="token literal-property property">title</span><span class="token operator">:</span> node<span class="token punctuation">.</span><span class="token property-access">title</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n nodeArray<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>copyNode<span class="token punctuation">)</span><span class="token punctuation">;</span>\n\n <span class="token keyword control-flow">for</span> <span class="token punctuation">(</span>\n <span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> l <span class="token operator">=</span> <span class="token punctuation">(</span>node<span class="token punctuation">.</span><span class="token property-access">children</span> <span class="token operator">&&</span> node<span class="token punctuation">.</span><span class="token property-access">children</span><span class="token punctuation">.</span><span class="token property-access">length</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token number">0</span><span class="token punctuation">;</span>\n i <span class="token operator"><</span> l<span class="token punctuation">;</span>\n i<span class="token operator">++</span>\n <span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token function">deepClone</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span><span class="token property-access">children</span><span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span> copyNode<span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span> nodeArray<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token keyword control-flow">return</span> nodeArray<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">TreeExample</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">treeData</span><span class="token operator">:</span> originData<span class="token punctuation">,</span>\n <span class="token literal-property property">copyType</span><span class="token operator">:</span> <span class="token string">\'shallow\'</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">onDelete</span> <span class="token operator">=</span> <span class="token parameter">data</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 <span class="token literal-property property">treeData</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><span class="token property-access">treeData</span><span class="token punctuation">.</span><span class="token method function property-access">filter</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span> <span class="token operator">!==</span> data<span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">)</span><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-variable function">onClone</span> <span class="token operator">=</span> <span class="token parameter">data</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> <span class="token punctuation">{</span> copyType <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">if</span> <span class="token punctuation">(</span>copyType <span class="token operator">===</span> <span class="token string">\'shallow\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> node <span class="token operator">=</span> <span class="token known-class-name class-name">Object</span><span class="token punctuation">.</span><span class="token method function property-access">assign</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> data<span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token known-class-name class-name">Date</span><span class="token punctuation">.</span><span class="token method function property-access">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">}</span><span class="token punctuation">)</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 <span class="token literal-property property">treeData</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token spread 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">treeData</span><span class="token punctuation">,</span> node<span class="token punctuation">]</span><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 keyword control-flow">else</span> <span class="token keyword control-flow">if</span> <span class="token punctuation">(</span>copyType <span class="token operator">===</span> <span class="token string">\'deep\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> nodeArray <span class="token operator">=</span> <span class="token function">deepClone</span><span class="token punctuation">(</span>data<span class="token punctuation">,</span> data<span class="token punctuation">.</span><span class="token property-access">parentId</span><span class="token punctuation">)</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 <span class="token literal-property property">treeData</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token spread 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">treeData</span><span class="token punctuation">,</span> <span class="token spread operator">...</span>nodeArray<span class="token punctuation">]</span><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 <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">onCopyTypeChange</span> <span class="token operator">=</span> <span class="token parameter">e</span> <span class="token arrow operator">=></span> <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> <span class="token literal-property property">copyType</span><span class="token operator">:</span> e<span class="token punctuation">.</span><span class="token property-access">target</span><span class="token punctuation">.</span><span class="token property-access">value</span> <span class="token punctuation">}</span><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> copyType<span class="token punctuation">,</span> treeData <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">const</span> operations <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">\'Delete\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">icon</span><span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Icon</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>close<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span>\n <span class="token literal-property property">action</span><span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">onDelete</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">name</span><span class="token operator">:</span> <span class="token string">\'Clone\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">icon</span><span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Icon</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>plus<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span>\n <span class="token literal-property property">action</span><span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">onClone</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 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">RadioGroup</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">onCopyTypeChange</span><span class="token punctuation">}</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>copyType<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">Radio</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>shallow<span class="token punctuation">"</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">Radio</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">Radio</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>deep<span class="token punctuation">"</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">Radio</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">RadioGroup</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>hr</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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">operations</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>operations<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">TreeExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(E)))}}},33938:(n,a,s)=>{"use strict";s.d(a,{X:()=>k});var t=s(59312),p=s(24246),e=s(60042),o=s.n(e),c=s(27378),l=s(1535),r=s(23130),u=s(1348),i=s(4008);function k(n){var a=(0,c.useContext)(u.d),s=(0,c.useContext)(r.Z),e=(0,c.useRef)(n);e.current=n;var i,k=s&&s.onChange,d=(0,c.useCallback)((function(n){var a=e.current,s=a.value,p=a.onChange;if(k)k(s);else if(p){var o=Object.create(n);o.target=(0,t.pi)((0,t.pi)({},e.current),{type:"checkbox",checked:n.target.checked}),p(o)}}),[k]),y=(n.checked,n.className),m=n.style,h=(n.disabled,n.readOnly,n.children),g=n.indeterminate,b=n.width,f=(n.value,n.labelStyle),v=n.onMouseEnter,w=n.onMouseLeave,E=(0,t._T)(n,["checked","className","style","disabled","readOnly","children","indeterminate","width","value","labelStyle","onMouseEnter","onMouseLeave"]),x=function(n,a){return"boolean"==typeof a.readOnly?a.readOnly:!!n&&n.readOnly}(s,n),j=function(n,a,s){return"boolean"==typeof s.disabled?s.disabled:a?a.disabled:n.value}(a,s,n);if(s){var z=s.value,D=s.isValueEqual;i=-1!==z.findIndex((function(a){return D(a,n.value)}))}else i=!!n.checked;return(0,p.jsxs)("label",(0,t.pi)({className:o()("zent-checkbox-wrap",y,{"zent-checkbox-checked":!!i,"zent-checkbox-disabled":j||x,"zent-checkbox-indeterminate":g}),style:(0,t.pi)((0,t.pi)({},m),(0,l.Z)(b)),onMouseEnter:v,onMouseLeave:w,"data-zv":"10.0.10"},{children:[(0,p.jsxs)("span",(0,t.pi)({className:"zent-checkbox","data-zv":"10.0.10"},{children:[(0,p.jsx)("span",{className:"zent-checkbox-inner","data-zv":"10.0.10"},void 0),(0,p.jsx)("input",(0,t.pi)({},E,{type:"checkbox",checked:i&&!g,disabled:j,readOnly:x,onChange:d,"data-zv":"10.0.10"}),void 0)]}),void 0),null!=h&&!0!==h&&!1!==h?(0,p.jsx)("div",(0,t.pi)({className:"zent-checkbox-label",style:f,"data-zv":"10.0.10"},{children:h}),void 0):null]}),void 0)}k.Group=i.Z,a.Z=k},4008:(n,a,s)=>{"use strict";s.d(a,{c:()=>k});var t=s(59312),p=s(24246),e=s(27378),o=s(60042),c=s.n(o),l=s(41925),r=s(23130),u=s(1348),i=r.Z.Provider,k=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.getGroupContext=(0,l.Z)((function(n,s,t,p){return{value:Array.isArray(n)?n:[],disabled:s,readOnly:t,isValueEqual:p,onChange:a.onCheckboxChange}})),a.onCheckboxChange=function(n){var s=a.props,t=s.isValueEqual,p=s.onChange,e=s.value;if(p){var o=e?e.slice():[],c=o.findIndex((function(a){return t(a,n)}));-1!==c?o.splice(c,1):o.push(n),p(o)}},a}return(0,t.ZT)(a,n),a.prototype.render=function(){var n=this.props,a=n.className,s=n.style,e=n.children,o=n.value,l=n.disabled,r=void 0===l?this.context.value:l,u=n.readOnly,k=void 0!==u&&u,d=n.isValueEqual,y=c()("zent-checkbox-group",a);return(0,p.jsx)(i,(0,t.pi)({value:this.getGroupContext(o,r,k,d)},{children:(0,p.jsx)("div",(0,t.pi)({className:y,style:s,"data-zv":"10.0.10"},{children:e}),void 0)}),void 0)},a.defaultProps={isValueEqual:Object.is,value:[]},a.contextType=u.d,a}(e.Component);a.Z=k},23130:(n,a,s)=>{"use strict";var t=s(27378);a.Z=(0,t.createContext)(null)},68150:(n,a,s)=>{"use strict";var t=s(33938);a.ZP=t.Z},85883:(n,a,s)=>{"use strict";var t=s(92497);a.Z=t.Z},4246:(n,a,s)=>{"use strict";s.d(a,{E:()=>u});var t=s(59312),p=s(24246),e=s(60042),o=s.n(e),c=s(27378),l=s(57961),r=s(1348);function u(n){var a=(0,c.useContext)(r.d),s=n.value,e=n.disabled,u=void 0===e?a.value:e,i=n.readOnly,k=void 0!==i&&i,d=n.isValueEqual,y=void 0===d?Object.is:d,m=n.className,h=n.style,g=n.children,b=n.onChange,f=(0,c.useMemo)((function(){return{value:s,disabled:u,readOnly:k,isValueEqual:y,onRadioChange:b}}),[s,u,k,y,b]);return(0,p.jsx)(l.Z.Provider,(0,t.pi)({value:f},{children:(0,p.jsx)("div",(0,t.pi)({className:o()("zent-radio-group",m),style:h,"data-zv":"10.0.10"},{children:g}),void 0)}),void 0)}a.Z=u},57961:(n,a,s)=>{"use strict";var t=(0,s(27378).createContext)(null);t.displayName="RadioGroupContext",a.Z=t},71457:(n,a,s)=>{"use strict";s.d(a,{Y:()=>y,Z:()=>m});var t=s(59312),p=s(24246),e=s(60042),o=s.n(e),c=s(1535),l=s(27378);function r(n,a){var s=(0,l.useRef)(a);s.current=a;var p=n&&n.onRadioChange;return(0,l.useCallback)((function(n){var a=function(n,a){var s=Object.create(n);return s.target=(0,t.pi)((0,t.pi)({},a),{type:"radio",checked:n.target.checked}),s}(n,s.current);if(p)p(a);else{var e=s.current.onChange;e&&e(a)}}),[p])}function u(n,a,s){var t=function(n,a,s){return"boolean"==typeof s.disabled?s.disabled:a&&"boolean"==typeof a.disabled?a.disabled:n.value}(n,a,s),p=function(n,a){return"boolean"==typeof a.readOnly?a.readOnly:!!n&&n.readOnly}(a,s);return{checked:a?a.isValueEqual(a.value,s.value):!!s.checked,disabled:t,readOnly:p}}var i=s(4246),k=s(1348),d=s(57961);function y(n){var a=n.className,s=n.style,e=n.children,i=(n.value,n.width),y=n.labelStyle,m=(n.onMouseEnter,n.onMouseLeave,(0,t._T)(n,["className","style","children","value","width","labelStyle","onMouseEnter","onMouseLeave"])),h=(0,l.useContext)(k.d),g=(0,l.useContext)(d.Z),b=u(h,g,n),f=b.checked,v=b.disabled,w=b.readOnly,E=r(g,n),x=o()(a,"zent-radio-wrap",{"zent-radio-checked":!!f,"zent-radio-disabled":v||w}),j=(0,c.Z)(i),z=(0,t.pi)((0,t.pi)({},s),j);return(0,p.jsxs)("label",(0,t.pi)({className:x,style:z,onMouseEnter:n.onMouseEnter,onMouseLeave:n.onMouseLeave,"data-zv":"10.0.10"},{children:[(0,p.jsxs)("span",(0,t.pi)({className:"zent-radio","data-zv":"10.0.10"},{children:[(0,p.jsx)("span",{className:"zent-radio-inner","data-zv":"10.0.10"},void 0),(0,p.jsx)("input",(0,t.pi)({},m,{type:"radio",checked:!!f,disabled:v,readOnly:w,onChange:E,"data-zv":"10.0.10"}),void 0)]}),void 0),void 0!==e&&(0,p.jsx)("span",(0,t.pi)({className:"zent-radio-label",style:y,"data-zv":"10.0.10"},{children:e}),void 0)]}),void 0)}y.Button=function(n){var a=n.className,s=n.style,e=n.children,i=(n.value,n.width),y=n.onMouseEnter,m=n.onMouseLeave,h=(0,t._T)(n,["className","style","children","value","width","onMouseEnter","onMouseLeave"]),g=(0,l.useContext)(k.d),b=(0,l.useContext)(d.Z);if(!b)throw new Error("Radio.Button must be nested within Radio.Group");var f=u(g,b,n),v=f.checked,w=f.disabled,E=f.readOnly,x=r(b,n),j=o()(a,"zent-radio-button",{"zent-radio-button--checked":!!v,"zent-radio-button--disabled":w||E}),z=(0,c.Z)(i),D=(0,t.pi)((0,t.pi)({},s),z);return(0,p.jsxs)("label",(0,t.pi)({className:j,style:D,onMouseEnter:y,onMouseLeave:m,"data-zv":"10.0.10"},{children:[(0,p.jsx)("input",(0,t.pi)({},h,{type:"radio",checked:!!v,disabled:w,readOnly:E,onChange:x,"data-zv":"10.0.10"}),void 0),(0,p.jsx)("span",(0,t.pi)({className:"zent-radio-button__content","data-zv":"10.0.10"},{children:e}),void 0)]}),void 0)},y.Group=i.Z;var m=y},1535:(n,a,s)=>{"use strict";function t(n){return"string"==typeof n||"number"==typeof n?{width:n}:{}}s.d(a,{Z:()=>t})}}]);