-
Notifications
You must be signed in to change notification settings - Fork 1
/
464-dcad482a87b99b6bfa34.js
1 lines (1 loc) · 92.4 KB
/
464-dcad482a87b99b6bfa34.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[464],{80464:(n,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>O});var t=s(73450),p=s(27378),e=s(57318),o=s(92497),c=s(3454),l=s(82285),i=s(11497),u=s(71457),r=s(33938),k=s(24246);function d(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 m(n){for(var a=1;a<arguments.length;a++){var s=null!=arguments[a]?arguments[a]:{};a%2?d(Object(s),!0).forEach((function(a){(0,t.Z)(n,a,s[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):d(Object(s)).forEach((function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(s,a))}))}return n}var g=function(){return(0,k.jsxs)("div",{className:"zent-doc-pop-container",children:[(0,k.jsx)(o.X,{trigger:"hover",content:"Hover Trigger",children:(0,k.jsx)(c.z,{type:"primary",children:"Hover"})}),(0,k.jsx)(o.X,{trigger:"click",content:"Click Trigger",children:(0,k.jsx)(c.z,{type:"primary",children:"Click"})}),(0,k.jsx)(o.X,{trigger:"focus",content:"Focus Trigger",children:(0,k.jsx)(l.I,{defaultValue:"Focus",inline:!0})})]})},h=function(){var n="hover";return(0,k.jsxs)("div",{className:"zent-doc-pop-positions",children:[(0,k.jsxs)("div",{className:"zent-doc-pop-positions-top-row",children:[(0,k.jsx)(o.X,{trigger:n,position:"top-left",content:"TL",children:(0,k.jsx)(c.z,{children:"TopLeft"})}),(0,k.jsx)(o.X,{trigger:n,position:"top-center",content:"TC",children:(0,k.jsx)(c.z,{children:"TopCenter"})}),(0,k.jsx)(o.X,{trigger:n,position:"top-right",content:"TR",children:(0,k.jsx)(c.z,{children:"TopRight"})})]}),(0,k.jsxs)("div",{className:"zent-doc-pop-positions-bottom-row",children:[(0,k.jsx)(o.X,{trigger:n,position:"bottom-left",content:"BL",children:(0,k.jsx)(c.z,{children:"BottomLeft"})}),(0,k.jsx)(o.X,{trigger:n,position:"bottom-center",content:"BC",children:(0,k.jsx)(c.z,{children:"BottomCenter"})}),(0,k.jsx)(o.X,{trigger:n,position:"bottom-right",content:"BR",children:(0,k.jsx)(c.z,{children:"BottomRight"})})]}),(0,k.jsx)("div",{className:"zent-doc-pop-positions-left-col",children:(0,k.jsx)(o.X,{trigger:n,position:"left-center",content:"LC",children:(0,k.jsx)(c.z,{children:"LeftCenter"})})}),(0,k.jsx)("div",{className:"zent-doc-pop-positions-right-col",children:(0,k.jsx)(o.X,{trigger:n,position:"right-center",content:"RC",children:(0,k.jsx)(c.z,{children:"RightCenter"})})})]})},v=function(){return(0,k.jsxs)("div",{className:"zent-doc-pop-container",children:[(0,k.jsx)(o.X,{centerArrow:!0,trigger:"hover",position:"top-left",content:"centerArrow is true",children:(0,k.jsx)("div",{className:"zent-doc-pop-tag",children:"Y"})}),(0,k.jsx)(o.X,{trigger:"hover",position:"top-left",content:"centerArrow is false",children:(0,k.jsx)("div",{className:"zent-doc-pop-tag",children:"N"})})]})},f=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"confirmHandler",(()=>{i.Hj.alert({content:"Pop Closed",parentComponent:this})}))}render(){return(0,k.jsx)(o.X,{trigger:"click",content:(0,k.jsx)("span",{style:{maxWidth:100,wordBreak:"break-all",display:"inline-block"},children:"1111d kdsalkdsa kdsklda kdslkda kdanmcmdj 9209 kjfslk kdslkd"}),onConfirm:this.confirmHandler,children:(0,k.jsx)(c.z,{type:"primary",children:"Open"})})}}return(0,k.jsx)(n,{})},y=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"confirmHandler",(()=>{i.Hj.alert({content:"Pop opened",parentComponent:this})}))}render(){return(0,k.jsx)(o.X,{trigger:"click",header:"Pop title",content:"Pop content",type:"primary",confirmText:"Error",cancelText:"Close",onConfirm:this.confirmHandler,children:(0,k.jsx)(c.z,{type:"primary",children:"Open"})})}}return(0,k.jsx)(n,{})},b=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{visible:!1}),(0,t.Z)(this,"onBeforeClose",(()=>new Promise((n=>{setTimeout(n,500)}))))}onBeforeShow(n){setTimeout(n,500)}render(){return(0,k.jsx)(o.X,{content:"Delay 500ms to close",trigger:"click",onBeforeShow:this.onBeforeShow,onBeforeClose:this.onBeforeClose,children:(0,k.jsx)(c.z,{type:"primary",children:"Delay 500ms to open"})})}}return(0,k.jsx)(n,{})},x=function(){var n=o.X.withPop((function({pop:n}){return(0,k.jsxs)("div",{children:[(0,k.jsx)("div",{style:{marginBottom:16},children:"Pop content"}),(0,k.jsx)(c.z,{onClick:n.close,children:"Close"})]})}));return(0,k.jsx)(o.X,{trigger:"click",content:(0,k.jsx)(n,{}),children:(0,k.jsx)(c.z,{type:"primary",children:"Open"})})},C=function(){return(0,k.jsxs)("div",{className:"zent-doc-pop-container",children:[(0,k.jsx)(o.X,{centerArrow:!0,trigger:"hover",position:"top-left",content:"content",children:(0,k.jsx)(u.Y,{disabled:!0})}),(0,k.jsx)(o.X,{centerArrow:!0,trigger:"hover",position:"top-left",content:"content",children:(0,k.jsx)(r.X,{disabled:!0})}),(0,k.jsx)(o.X,{trigger:"hover",position:"top-center",content:"content",children:(0,k.jsx)(l.I,{disabled:!0,className:"zent-pop-disabled-mr"})}),(0,k.jsx)(o.X,{trigger:"hover",position:"top-center",content:"content",fixMouseEventsOnDisabledChildren:!0,children:(0,k.jsx)(c.z,{type:"primary",disabled:!0,children:"Button"})}),(0,k.jsx)(o.X,{trigger:"hover",position:"top-center",content:"content",fixMouseEventsOnDisabledChildren:!0,children:(0,k.jsx)(c.z.Directive,{type:"primary",disabled:!0,children:(0,k.jsx)("a",{href:"",children:" ButtonDirective "})})})]})};function w(n){return(0,k.jsx)(n.tag,m(m({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function j(n){return(0,k.jsx)(w,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function z(n){return(0,k.jsx)(w,{tag:"style",html:n.style})}function P(n,a){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(a+=n.offsetTop),P(n.parentNode,a);return a}class N extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{showCode:!1}),(0,t.Z)(this,"toggle",(()=>{this.setState({showCode:!this.state.showCode})}))}render(){var n=this.state.showCode,a=this.props,s=a.title,t=a.src,p=a.children;return(0,k.jsxs)("div",{className:"zandoc-react-demo",children:[(0,k.jsx)("div",{className:"zandoc-react-demo__preview",children:p}),(0,k.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,k.jsx)("div",{className:"zandoc-react-demo__title",children:(0,k.jsx)("p",{children:s||""})}),(0,k.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,k.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,k.jsx)(w,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class O extends p.Component{componentDidMount(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&(0,e.l)(document.documentElement,0,P(a,-9))}}render(){return p.createElement("div",{className:"zandoc-react-container"},p.createElement(z,{style:".zent-doc-pop-container {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t.zent-doc-pop-container .zent-input-wrapper {\n\t\t\tmargin-left: 10px;\n\t\t}\n\n.zent-doc-pop-positions {\n position: relative;\n }\n\n.zent-doc-pop-positions-top-row,\n\t\t.zent-doc-pop-positions-bottom-row {\n text-align: center;\n }\n\n.zent-doc-pop-positions-top-row .zent-pop-wrapper:not(:last-child), .zent-doc-pop-positions-bottom-row .zent-pop-wrapper:not(:last-child) {\n margin-right: 10px;\n }\n\n.zent-doc-pop-positions-bottom-row {\n margin-top: 200px;\n }\n\n.zent-doc-pop-positions-left-col, .zent-doc-pop-positions-right-col {\n position: absolute;\n top: 0;\n display: flex;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n }\n\n.zent-doc-pop-positions-left-col >*, .zent-doc-pop-positions-right-col >* {\n\t\t\t\tmargin-left: 0 !important;\n\t\t\t}\n\n.zent-doc-pop-positions-left-col >*:not(:last-child), .zent-doc-pop-positions-right-col >*:not(:last-child) {\n\t\t\t\tmargin-bottom: 10px;\n }\n\n.zent-doc-pop-positions-left-col {\n left: 0;\n }\n\n.zent-doc-pop-positions-right-col {\n right: 0;\n }\n\n.zent-doc-pop-positions .zent-pop-wrapper .zent-btn {\n width: 120px;\n }\n\n.zent-doc-pop-tag {\n\twidth: 20px;\n\theight: 20px;\n\ttext-align: center;\n\tline-height: 20px;\n\tborder: 1px solid #e5e5e5;\n\tborder-radius: 5px;\n\tmargin-right: 10px;\n}\n\n.zent-pop-disabled-mr {\n\t\tmargin-right:16px;\n\t}"}),p.createElement(j,{html:'<h2 class="anchor-heading"><a href="#pop">¶</a><a href="javascript:void(0)" id="pop" class="anchor-point"></a>Pop</h2>\n<p>The modeless window that follows the target element is often used for lightweight information display and data input.</p>\n<h3 class="anchor-heading"><a href="#guides">¶</a><a href="javascript:void(0)" id="guides" class="anchor-point"></a>Guides</h3>\n<ul>\n<li>Triggers: click, hover and focus</li>\n<li>Supports arbitary content in popup</li>\n</ul>\n<h3 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h3>'}),p.createElement(N,{title:"Three trigger modes: click, hover and focus",id:"Demotrigger",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Input</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-container<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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Hover Trigger<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">Button</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>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Hover</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>click<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Click Trigger<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">Button</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>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Click</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>focus<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Focus Trigger<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">Input</span></span> <span class="token attr-name">defaultValue</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Focus<span class="token punctuation">"</span></span> <span class="token attr-name">inline</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">Pop</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> mountNode\n<span class="token punctuation">)</span>'},p.createElement(g)),p.createElement(N,{title:"8 positions",id:"Demopositions",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> trigger <span class="token operator">=</span> <span class="token string">\'hover\'</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-doc-pop-positions<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 attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-positions-top-row<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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>TL<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">TopLeft</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-center<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>TC<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">TopCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-right<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>TR<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">TopRight</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-positions-bottom-row<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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bottom-left<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>BL<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">BottomLeft</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bottom-center<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>BC<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">BottomCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bottom-right<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>BR<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">BottomRight</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-positions-left-col<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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>left-center<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>LC<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">LeftCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-positions-right-col<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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>right-center<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>RC<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">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">RightCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(h)),p.createElement(N,{title:"Use `centerArrow` to control arrow position",id:"Democenterarrow",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Input</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-container<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">Pop</span></span> <span class="token attr-name">centerArrow</span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>centerArrow is true<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 attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-tag<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token constant">Y</span><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">Pop</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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>centerArrow is false<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 attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-tag<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token constant">N</span><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">Pop</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> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(v)),p.createElement(N,{title:"Confirm Pop",id:"Democonfirm",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Sweetalert</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Wrapper</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 <span class="token function-variable function">confirmHandler</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 maybe-class-name">Sweetalert</span><span class="token punctuation">.</span><span class="token method function property-access">alert</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n <span class="token literal-property property">content</span><span class="token operator">:</span> <span class="token string">\'Pop Closed\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentComponent</span><span class="token operator">:</span> <span class="token keyword">this</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">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Pop</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>click<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span>\n <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>\n <span class="token literal-property property">maxWidth</span><span class="token operator">:</span> <span class="token number">100</span><span class="token punctuation">,</span>\n <span class="token literal-property property">wordBreak</span><span class="token operator">:</span> <span class="token string">\'break-all\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">display</span><span class="token operator">:</span> <span class="token string">\'inline-block\'</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 1111d kdsalkdsa kdsklda kdslkda kdanmcmdj <span class="token number">9209</span> kjfslk kdslkd\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>\n <span class="token attr-name">onConfirm</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">confirmHandler</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><span class="token class-name">Button</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>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Open</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></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">Wrapper</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(f)),p.createElement(N,{title:"Custom confirm pop",id:"Democustomconfirm",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Sweetalert</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Wrapper</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 <span class="token function-variable function">confirmHandler</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 maybe-class-name">Sweetalert</span><span class="token punctuation">.</span><span class="token method function property-access">alert</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n <span class="token literal-property property">content</span><span class="token operator">:</span> <span class="token string">\'Pop opened\'</span><span class="token punctuation">,</span>\n <span class="token literal-property property">parentComponent</span><span class="token operator">:</span> <span class="token keyword">this</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</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">Pop</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>click<span class="token punctuation">"</span></span>\n <span class="token attr-name">header</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Pop title<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Pop content<span class="token punctuation">"</span></span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span>\n <span class="token attr-name">confirmText</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Error<span class="token punctuation">"</span></span>\n <span class="token attr-name">cancelText</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>\n <span class="token attr-name">onConfirm</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">confirmHandler</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><span class="token class-name">Button</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>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Open</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></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">Wrapper</span></span><span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(y)),p.createElement(N,{title:"Delayed open / close",id:"Demodelay",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Controlled</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n <span class="token literal-property property">visible</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">onBeforeShow</span><span class="token punctuation">(</span><span class="token parameter">cont</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token function">setTimeout</span><span class="token punctuation">(</span>cont<span class="token punctuation">,</span> <span class="token number">500</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">onBeforeClose</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 control-flow">return</span> <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><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token function">setTimeout</span><span class="token punctuation">(</span>resolve<span class="token punctuation">,</span> <span class="token number">500</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">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Pop</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Delay 500ms to close<span class="token punctuation">"</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>click<span class="token punctuation">"</span></span>\n <span class="token attr-name">onBeforeShow</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">onBeforeShow</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">onBeforeClose</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">onBeforeClose</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><span class="token class-name">Button</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>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Delay</span> 500ms to open<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Controlled</span></span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(b)),p.createElement(N,{title:"withPop High Order Component",id:"Demowithpop",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token comment">// 点击 close 按钮可以关闭弹层</span>\n<span class="token keyword">const</span> <span class="token maybe-class-name">Content</span> <span class="token operator">=</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">.</span><span class="token method function property-access">withPop</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token function"><span class="token maybe-class-name">Content</span></span><span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span> pop <span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</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">marginBottom</span><span class="token operator">:</span> <span class="token number">16</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Pop</span> content<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>pop<span class="token punctuation">.</span><span class="token property-access">close</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Close</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n<span class="token punctuation">}</span><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">Pop</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>click<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Content</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</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>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Open</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</span></span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(x)),p.createElement(N,{title:"Disabled form inputs",id:"Demodisabled",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Button</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Pop</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Radio</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Checkbox</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Input</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-pop-container<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">Pop</span></span>\n <span class="token attr-name">centerArrow</span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content<span class="token punctuation">"</span></span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Radio</span></span> <span class="token attr-name">disabled</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">Pop</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">Pop</span></span>\n <span class="token attr-name">centerArrow</span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content<span class="token punctuation">"</span></span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Checkbox</span></span> <span class="token attr-name">disabled</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">Checkbox</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">Pop</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">Pop</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-center<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content<span class="token punctuation">"</span></span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Input</span></span> <span class="token attr-name">disabled</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-pop-disabled-mr<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">Pop</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">Pop</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-center<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content<span class="token punctuation">"</span></span>\n <span class="token attr-name">fixMouseEventsOnDisabledChildren</span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</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>primary<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span><span class="token punctuation">></span></span>\n <span class="token maybe-class-name">Button</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Pop</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">Pop</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-center<span class="token punctuation">"</span></span>\n <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content<span class="token punctuation">"</span></span>\n <span class="token attr-name">fixMouseEventsOnDisabledChildren</span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button.Directive</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>primary<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span><span class="token punctuation">></span></span>\n <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><span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token maybe-class-name">ButtonDirective</span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button.Directive</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">Pop</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>'},p.createElement(C)),p.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<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n<th>Alternative</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>content</td>\n<td>Pop content</td>\n<td><code>node</code></td>\n<td>Yes</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>trigger</td>\n<td>Trigger method</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'none\'</code></td>\n<td><code>\'click\'</code>\n, \n<code>\'hover\'</code>\n, \n<code>\'focus\'</code></td>\n</tr>\n<tr>\n<td>position</td>\n<td>Pop content position, naming rule: content position relative to trigger + arrow position relative to Pop. Can be a placement function, see \n<code>Popover.Position.create</code></td>\n<td>string \n|\n func</td>\n<td>No</td>\n<td><code>\'top-center\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>centerArrow</td>\n<td>Always center arrow to trigger</td>\n<td>bool</td>\n<td>No</td>\n<td><code>false</code></td>\n<td></td>\n</tr>\n<tr>\n<td>cushion</td>\n<td>Same as the \n<code>cushion</code>\n in Popover, which is usually the distance between the edge of the Pop and the trigger element</td>\n<td>number</td>\n<td>No</td>\n<td><code>10</code></td>\n<td></td>\n</tr>\n<tr>\n<td>header</td>\n<td>Pop header</td>\n<td>node</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>block</td>\n<td>Is trigger a block element</td>\n<td>bool</td>\n<td>No</td>\n<td><code>false</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onShow</td>\n<td>Callback after Pop has opened</td>\n<td>func</td>\n<td>No</td>\n<td><code>noop</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onClose</td>\n<td>Callback after Pop has closed</td>\n<td>func</td>\n<td>No</td>\n<td><code>noop</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onBeforeShow</td>\n<td>Callback before Pop has opened, only user actions can trigger this callback, setting \n<code>visible</code>\n won\'t trigger this callback</td>\n<td>func</td>\n<td>No</td>\n<td><code>noop</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onBeforeClose</td>\n<td>Callback before Pop has closed, only user actions can trigger this callback, setting \n<code>visible</code>\n won\'t trigger this callback</td>\n<td>func</td>\n<td>No</td>\n<td><code>noop</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onConfirm</td>\n<td>Confirm callback</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onCancel</td>\n<td>Cancel callback</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>confirmText</td>\n<td>Confirm button text</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'Confirm\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>cancelText</td>\n<td>Cancel button text</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'Cancel\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>type</td>\n<td>Confirm button type</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'primary\'</code></td>\n<td><code>\'default\'</code></td>\n</tr>\n<tr>\n<td>visible</td>\n<td>Pop switch to controlled mode if this prop is set, must be used with \n<code>onVisibleChange</code></td>\n<td>bool</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onVisibleChange</td>\n<td>Must be used with \n<code>visible</code></td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onPositionUpdated</td>\n<td>callback after position updates, a position update does not imply a position change</td>\n<td>func</td>\n<td>No</td>\n<td><code>noop</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onPositionReady</td>\n<td>callback after content enter viewport, only called once within the life cycle</td>\n<td>func</td>\n<td>No</td>\n<td><code>noop</code></td>\n<td></td>\n</tr>\n<tr>\n<td>containerSelector</td>\n<td>pop\'s parent node CSS selector</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'body\'</code></td>\n<td>all legal CSS selector</td>\n</tr>\n<tr>\n<td>className</td>\n<td>Custom content class name</td>\n<td>string</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>style</td>\n<td>Custom content style</td>\n<td><code>CSSProperties</code></td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p><code>Pop</code> has some additional props depends on different triggers.</p>\n<h4 class="anchor-heading"><a href="#click">¶</a><a href="javascript:void(0)" id="click" class="anchor-point"></a>Click</h4>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>closeOnClickOutside</td>\n<td>Close Pop when click outside trigger and content</td>\n<td>bool</td>\n<td>No</td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#hover">¶</a><a href="javascript:void(0)" id="hover" class="anchor-point"></a>Hover</h4>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>mouseEnterDelay</td>\n<td>Hover open delay(in ms)</td>\n<td>number</td>\n<td>No</td>\n<td><code>200</code></td>\n</tr>\n<tr>\n<td>mouseLeaveDelay</td>\n<td>Hover close delay(in ms)</td>\n<td>number</td>\n<td>No</td>\n<td><code>200</code></td>\n</tr>\n<tr>\n<td>anchorOnly</td>\n<td>Only use trigger as hot area</td>\n<td>boolean</td>\n<td>No</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>fixMouseEventsOnDisabledChildren</td>\n<td>Fix mouse events on disabled children</td>\n<td>boolean</td>\n<td>No</td>\n<td><code>false</code></td>\n</tr>\n</tbody>\n</table>\n<p><strong>PS:</strong><code>fixMouseEventsOnDisabledChildren</code> is only effective on Zent components.</p>\n<p>Why</p>\n<ul>\n<li><a href="https://github.com/youzan/zent/issues/142">Mouse events don\'t trigger on disabled button</a></li>\n</ul>\n<p>Workaround</p>\n<ul>\n<li>Wrap the disabled button/input in another element.</li>\n<li>Then add {pointer-events: none} style to the disabled button/input.</li>\n</ul>\n<h4 class="anchor-heading"><a href="#none">¶</a><a href="javascript:void(0)" id="none" class="anchor-point"></a>None</h4>\n<p>When using this trigger, <code>onConfirm</code> and <code>onCancel</code> will not close <code>Pop</code> automatically, you are responsible for controlling <code>visible</code> to close <code>Pop</code>.</p>\n<h4 class="anchor-heading"><a href="#withpop-hoc">¶</a><a href="javascript:void(0)" id="withpop-hoc" class="anchor-point"></a>withPop HOC</h4>\n<p>This HOC exposes some useful <code>Pop</code> methods.</p>\n<p>Possible senario: close <code>Pop</code> within its content.</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>open</td>\n<td>Open Pop</td>\n<td>func</td>\n</tr>\n<tr>\n<td>close</td>\n<td>Close Pop</td>\n<td>func</td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#adjustposition">¶</a><a href="javascript:void(0)" id="adjustposition" class="anchor-point"></a><code>adjustPosition</code></h4>\n<p>Use this function to manually adjust <code>Pop</code> position.</p>\n<h4 class="anchor-heading"><a href="#getwrappedpopover">¶</a><a href="javascript:void(0)" id="getwrappedpopover" class="anchor-point"></a><code>getWrappedPopover</code></h4>\n<p>Use this function to get the internal <code>Popover</code> instance.</p>\n<h3 class="anchor-heading"><a href="#faq">¶</a><a href="javascript:void(0)" id="faq" class="anchor-point"></a>FAQ</h3>\n<h4 class="anchor-heading"><a href="#wrong-popup-position-with-long">¶</a><a href="javascript:void(0)" id="wrong-popup-position-with-long" class="anchor-point"></a>Wrong popup position with long text content</h4>\n<p>It is likely you are passing a long string directly into <code>content</code> if this happens. Give <code>content</code> a width to make sure <code>Pop</code> can get the right width.</p>\n<h4 class="anchor-heading"><a href="#centerarrow">¶</a><a href="javascript:void(0)" id="centerarrow" class="anchor-point"></a>centerArrow</h4>\n<p><code>Pop</code> aligns edges of its content and trigger by default, the distance between the arrow and content edge is fixed except when <code>position</code> is set to <code>\'*-center\'</code>. The arrow will appear outside of trigger\'s edge when trigger size is small. When this happens you can set <code>centerArrow</code> to <code>true</code> to always align arrow to trigger\'s center.</p>\n<h4 class="anchor-heading"><a href="#onconfirm-and-oncancel">¶</a><a href="javascript:void(0)" id="onconfirm-and-oncancel" class="anchor-point"></a>onConfirm and onCancel</h4>\n<p>These two callbacks supports asynchronous mode, buttons will change into loading state when pending on result.</p>\n<ul>\n<li>If return value is a <code>Promise</code>, <code>Pop</code> will close on <code>Promise</code> <code>resolve</code>.</li>\n<li>If callback has parameters, it will be called with a <code>close</code> argument, <code>Pop</code> will not close until you call <code>close</code>.</li>\n</ul>'}))}}},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),i=s(23130),u=s(1348),r=s(4008);function k(n){var a=(0,c.useContext)(u.d),s=(0,c.useContext)(i.Z),e=(0,c.useRef)(n);e.current=n;var r,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]),m=(n.checked,n.className),g=n.style,h=(n.disabled,n.readOnly,n.children),v=n.indeterminate,f=n.width,y=(n.value,n.labelStyle),b=n.onMouseEnter,x=n.onMouseLeave,C=(0,t._T)(n,["checked","className","style","disabled","readOnly","children","indeterminate","width","value","labelStyle","onMouseEnter","onMouseLeave"]),w=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,P=s.isValueEqual;r=-1!==z.findIndex((function(a){return P(a,n.value)}))}else r=!!n.checked;return(0,p.jsxs)("label",(0,t.pi)({className:o()("zent-checkbox-wrap",m,{"zent-checkbox-checked":!!r,"zent-checkbox-disabled":j||w,"zent-checkbox-indeterminate":v}),style:(0,t.pi)((0,t.pi)({},g),(0,l.Z)(f)),onMouseEnter:b,onMouseLeave:x,"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)({},C,{type:"checkbox",checked:r&&!v,disabled:j,readOnly:w,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:y,"data-zv":"10.0.10"},{children:h}),void 0):null]}),void 0)}k.Group=r.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),i=s(23130),u=s(1348),r=i.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,i=void 0===l?this.context.value:l,u=n.readOnly,k=void 0!==u&&u,d=n.isValueEqual,m=c()("zent-checkbox-group",a);return(0,p.jsx)(r,(0,t.pi)({value:this.getGroupContext(o,i,k,d)},{children:(0,p.jsx)("div",(0,t.pi)({className:m,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)},97701:(n,a,s)=>{"use strict";s.d(a,{V:()=>P,Z:()=>N});var t=s(59312),p=s(24246),e=s(27378),o=s(14623),c=s(53552),l=s(79352),i=s(60042),u=s.n(i),r=s(58801),k=s(27036),d=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.dialogEl=null,a.onClickClose=function(n){var s=a.props.onClose;s&&s(n)},a}return(0,t.ZT)(a,n),a.prototype.componentDidMount=function(){this.resetTransformOrigin()},a.prototype.componentDidUpdate=function(){this.resetTransformOrigin()},a.prototype.setTransformOrigin=function(n,a){["Webkit","Moz","Ms","ms"].forEach((function(s){n[s+"TransformOrigin"]=a})),n.transformOrigin=a},a.prototype.resetTransformOrigin=function(n){void 0===n&&(n=this.props);var a=n.mousePosition,s=function(n,a){switch(n){case"center":return"center center 0";case"auto":default:return}}(n.position,this.dialogEl);if(void 0===s&&a&&a.x>=0&&a.y>=0&&this.dialogEl&&this.dialogEl.getBoundingClientRect){var t=this.dialogEl.getBoundingClientRect(),p=t.left,e=t.top;s=a.x-p+"px "+(a.y-e)+"px 0"}s&&this.dialogEl&&this.setTransformOrigin(this.dialogEl.style,s)},a.prototype.renderHeader=function(){var n=this.props.title;return n?(n="number"==typeof n||"string"==typeof n?(0,p.jsx)("span",(0,t.pi)({className:"zent-dialog-r-title-text","data-zv":"10.0.10"},{children:n}),void 0):n,(0,p.jsx)("div",(0,t.pi)({className:"zent-dialog-r-header","data-zv":"10.0.10"},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-dialog-r-title","data-zv":"10.0.10"},{children:n}),void 0)}),void 0)):null},a.prototype.render=function(){var n=this,a=this.props,s=a.className,e=a.closeBtn,o=a.footer,c=a.style,l=a.children,i=this.renderHeader(),r=u()("zent-dialog-r-close",{"zent-dialog-r-has-title":!!i}),d=e&&(0,p.jsx)("button",(0,t.pi)({type:"button",className:r,onClick:this.onClickClose,"data-zv":"10.0.10"},{children:(0,p.jsx)(k.Z,{type:"close"},void 0)}),void 0),m=o&&(0,p.jsx)("div",(0,t.pi)({className:"zent-dialog-r-footer","data-zv":"10.0.10"},{children:o}),void 0);return(0,p.jsxs)("div",(0,t.pi)({className:u()("zent-dialog-r",s,{"zent-dialog-r--has-header":!!i,"zent-dialog-r--has-footer":!!m,"zent-dialog-r--no-close-btn":!d}),style:c,ref:function(a){return n.dialogEl=a},"data-zv":"10.0.10"},{children:[d,i,(0,p.jsx)("div",(0,t.pi)({className:"zent-dialog-r-body","data-zv":"10.0.10"},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-dialog-r-body-content","data-zv":"10.0.10"},{children:l}),void 0)}),void 0),m]}),void 0)},a}(e.Component),m=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.rootRef=(0,e.createRef)(),a.onMaskClick=function(n){n.target===n.currentTarget&&a.props.mask&&a.props.maskClosable&&a.props.onClose(n)},a}return(0,t.ZT)(a,n),a.prototype.componentDidMount=function(){var n=document.activeElement,a=this.rootRef.current;a!==n&&a&&!a.contains(n)&&function(n){if(n){var a=(0,r.Z)();n.focus(),window.scroll(a.x,a.y)}}(a)},a.prototype.render=function(){var n=this.props,a=n.mask,s=n.visible,e=n.children;return(0,p.jsxs)("div",(0,t.pi)({ref:this.rootRef,tabIndex:-1,className:"zent-dialog-r-root","data-zv":"10.0.10"},{children:[s&&a&&(0,p.jsx)("div",{className:"zent-dialog-r-backdrop","data-zv":"10.0.10"},void 0),(0,p.jsx)("div",(0,t.pi)({className:"zent-dialog-r-wrap",onClick:this.onMaskClick,"data-zv":"10.0.10"},{children:e}),void 0)]}),void 0)},a}(e.Component),g=s(31542),h=s.t(g,2),v=s(70453),f=s(42690),y=s(14805),b=new Map,x=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.state={visible:!0},a.closeOptions={},a.onClosed=function(){var n=a.props,s=n.options.onClose,t=n.container,p=a.closeOptions.triggerOnClose;(void 0===p||p)&&s&&s(),g.unmountComponentAtNode(t)},a.onClose=function(n){a.close({triggerOnClose:!1!==n})},a}return(0,t.ZT)(a,n),a.prototype.close=function(n){void 0===n&&(n={}),this.closeOptions=n,this.setState({visible:!1})},a.prototype.componentWillUnmount=function(){var n=this.props.options.dialogId;b.delete(n)},a.prototype.render=function(){var n=this.props.options,a=this.state.visible;return(0,p.jsx)(N,(0,t.pi)({},n,{onClose:this.onClose,onClosed:this.onClosed,visible:a}),void 0)},a}(e.Component);function C(n,a){void 0===a&&(a={});var s=b.get(n);if(s){var t=s.current;t&&t.close(a)}}function w(n){if(void 0===n&&(n={}),!l.Z)return f.Z;var a=n.dialogId,s=void 0===a?(0,v.Z)("__zent-dialog__"):a,o=n.parentComponent;!function(n){if(b.has(n))throw new Error("Duplicate dialog id found: "+n)}(s);var c=(0,y.Z)("div"),i=o?g.unstable_renderSubtreeIntoContainer.bind(h,o):g.render,u=(0,e.createRef)();return i((0,p.jsx)(x,{ref:u,options:(0,t.pi)((0,t.pi)({},n),{dialogId:s}),container:c},void 0),c),function(n,a){b.set(n,a)}(s,u),function(n){void 0===n&&(n=!0),C(s,{triggerOnClose:!1!==n})}}var j=s(49744),z=null;l.Z&&(0,j.Oo)(document.documentElement,"click",(function(n){0!==n.clientX&&0!==n.clientY&&(z={x:n.clientX,y:n.clientY})}),{capture:!0});var P=function(n){function a(a){var s=n.call(this,a)||this;return s.lastMousePosition=null,s.onClose=function(n){var a=s.props.onClose;a&&a(n)},s.onExited=function(){var n=s.props.onClosed;s.setState({exiting:!1}),n&&n()},s.state={prevOpen:a.visible,exiting:!1},s}return(0,t.ZT)(a,n),a.getDerivedStateFromProps=function(n,a){var s=a.prevOpen;return n.visible===s?null:n.visible?{prevOpen:n.visible,exiting:!1}:{prevOpen:n.visible,exiting:!0}},a.prototype.render=function(){var n=this.props,a=n.visible,s=n.closeBtn,e=n.style,l=n.position,i=n.onOpened,u=(n.onClosed,n.mask),r=n.maskClosable,k=n.children,g=(0,t._T)(n,["visible","closeBtn","style","position","onOpened","onClosed","mask","maskClosable","children"]),h=this.state.exiting;return this.lastMousePosition=a?this.lastMousePosition||z:null,(0,p.jsx)(c.ZP,(0,t.pi)({visible:a||h,onClose:this.onClose,className:"zent-dialog-r-anchor",closeOnESC:s,blockPageScroll:!0},{children:(0,p.jsx)(m,(0,t.pi)({mask:u,maskClosable:r,visible:a,onClose:this.onClose},{children:(0,p.jsx)(o.Z,(0,t.pi)({appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:a,timeout:300,classNames:"zent-zoom",onEntered:i,onExited:this.onExited},{children:(0,p.jsx)(d,(0,t.pi)({},g,{style:e,closeBtn:s,position:l,mousePosition:this.lastMousePosition},{children:k}),void 0)}),void 0)}),void 0)}),void 0)},a.defaultProps={onClose:function(){},visible:!1,className:"",style:{},position:"auto",title:"",closeBtn:!0,mask:!0,maskClosable:!0,footer:null},a.openDialog=w,a.closeDialog=C,a}(e.Component),N=P},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),i=s(1348);function u(n){var a=(0,c.useContext)(i.d),s=n.value,e=n.disabled,u=void 0===e?a.value:e,r=n.readOnly,k=void 0!==r&&r,d=n.isValueEqual,m=void 0===d?Object.is:d,g=n.className,h=n.style,v=n.children,f=n.onChange,y=(0,c.useMemo)((function(){return{value:s,disabled:u,readOnly:k,isValueEqual:m,onRadioChange:f}}),[s,u,k,m,f]);return(0,p.jsx)(l.Z.Provider,(0,t.pi)({value:y},{children:(0,p.jsx)("div",(0,t.pi)({className:o()("zent-radio-group",g),style:h,"data-zv":"10.0.10"},{children:v}),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:()=>m,Z:()=>g});var t=s(59312),p=s(24246),e=s(60042),o=s.n(e),c=s(1535),l=s(27378);function i(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 r=s(4246),k=s(1348),d=s(57961);function m(n){var a=n.className,s=n.style,e=n.children,r=(n.value,n.width),m=n.labelStyle,g=(n.onMouseEnter,n.onMouseLeave,(0,t._T)(n,["className","style","children","value","width","labelStyle","onMouseEnter","onMouseLeave"])),h=(0,l.useContext)(k.d),v=(0,l.useContext)(d.Z),f=u(h,v,n),y=f.checked,b=f.disabled,x=f.readOnly,C=i(v,n),w=o()(a,"zent-radio-wrap",{"zent-radio-checked":!!y,"zent-radio-disabled":b||x}),j=(0,c.Z)(r),z=(0,t.pi)((0,t.pi)({},s),j);return(0,p.jsxs)("label",(0,t.pi)({className:w,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)({},g,{type:"radio",checked:!!y,disabled:b,readOnly:x,onChange:C,"data-zv":"10.0.10"}),void 0)]}),void 0),void 0!==e&&(0,p.jsx)("span",(0,t.pi)({className:"zent-radio-label",style:m,"data-zv":"10.0.10"},{children:e}),void 0)]}),void 0)}m.Button=function(n){var a=n.className,s=n.style,e=n.children,r=(n.value,n.width),m=n.onMouseEnter,g=n.onMouseLeave,h=(0,t._T)(n,["className","style","children","value","width","onMouseEnter","onMouseLeave"]),v=(0,l.useContext)(k.d),f=(0,l.useContext)(d.Z);if(!f)throw new Error("Radio.Button must be nested within Radio.Group");var y=u(v,f,n),b=y.checked,x=y.disabled,C=y.readOnly,w=i(f,n),j=o()(a,"zent-radio-button",{"zent-radio-button--checked":!!b,"zent-radio-button--disabled":x||C}),z=(0,c.Z)(r),P=(0,t.pi)((0,t.pi)({},s),z);return(0,p.jsxs)("label",(0,t.pi)({className:j,style:P,onMouseEnter:m,onMouseLeave:g,"data-zv":"10.0.10"},{children:[(0,p.jsx)("input",(0,t.pi)({},h,{type:"radio",checked:!!b,disabled:x,readOnly:C,onChange:w,"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)},m.Group=r.Z;var g=m},11497:(n,a,s)=>{"use strict";s.d(a,{Hj:()=>f});var t=s(59312),p=s(24246),e=s(60042),o=s.n(e),c=s(52074),l=s(97701).Z,i=s(27036),u=s(27378),r=s(90347),k=s(65436),d=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.state={loading:!1},a.onClick=function(){var n=a.props,s=n.onClick,t=(0,n.getClose)();if(!s)return t();var p=s.length>0,e=p?s(t):s();if((0,k.Z)(e))return a.setState({loading:!0}),void e.then((function(){t()}),(function(){a.setState({loading:!1})}));p||!1===e||t()},a}return(0,t.ZT)(a,n),a.prototype.render=function(){var n=this.props,a=n.className,s=n.type,e=n.text,o=this.state.loading;return(0,p.jsx)(r.ZP,(0,t.pi)({type:s,className:a,loading:o,onClick:this.onClick},{children:e}),void 0)},a}(u.Component),m={info:"info-circle-o",success:"check-circle-o",error:"close-circle-o",warning:"warning-o"},g=l.openDialog;function h(n,a){var s,e=n.className,l=void 0===e?"":e,u=n.confirmType,r=void 0===u?"primary":u,k=n.closeBtn,h=void 0!==k&&k,v=n.maskClosable,f=void 0!==v&&v,y=n.title,b=n.type,x=n.content,C=n.onConfirm,w=n.onCancel,j=n.confirmText,z=n.cancelText,P=n.parentComponent,N=n.onClose,O=null;return O=g({closeBtn:h,maskClosable:f,className:o()("zent-sweetalert-"+a,(s={},s[l]=!!l,s)),title:(0,p.jsx)(c.Z,(0,t.pi)({componentName:"Sweetalert"},{children:function(n){var a=m[b];return(0,p.jsxs)("div",(0,t.pi)({className:"zent-sweetalert-"+(b?"icon-":"")+"title","data-zv":"10.0.10"},{children:[b&&(0,p.jsx)(i.Z,{className:"zent-sweetalert-type-icon",type:a},void 0),y||n.title]}),void 0)}}),void 0),children:x,footer:(0,p.jsx)(c.Z,(0,t.pi)({componentName:"Sweetalert"},{children:function(n){var s="alert"===a;return(0,p.jsxs)("div",(0,t.pi)({className:"sweet-"+a+"-actions","data-zv":"10.0.10"},{children:[!s&&(0,p.jsx)(d,{type:"default",className:"zent-sweetalert-"+a+"-btn-cancel",getClose:function(){return O},onClick:w,text:z||n.cancel},"sweetalert-cancel"),(0,p.jsx)(d,{type:r,className:"zent-sweetalert-"+a+"-btn-confirm",getClose:function(){return O},onClick:C,text:j||(s?n.ok:n.confirm)},"sweetalert-confirm")]}),void 0)}}),void 0),parentComponent:P,onClose:N})}function v(n){return void 0===n&&(n={}),h(n,"alert")}var f={alert:v,info:v,confirm:function(n){return void 0===n&&(n={}),h(n,"confirm")}}},58801:(n,a,s)=>{"use strict";function t(){var n=window.pageXOffset,a=window.pageYOffset;return{x:void 0!==n?n:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==a?a:(document.documentElement||document.body.parentNode||document.body).scrollTop}}s.d(a,{Z:()=>t})},1535:(n,a,s)=>{"use strict";function t(n){return"string"==typeof n||"number"==typeof n?{width:n}:{}}s.d(a,{Z:()=>t})}}]);