-
Notifications
You must be signed in to change notification settings - Fork 0
/
48-a28f22da2d828c0b81f9.js
1 lines (1 loc) · 29.8 KB
/
48-a28f22da2d828c0b81f9.js
1
webpackJsonp([48],{1599:function(n,t,a){"use strict";function s(n){return n&&n.__esModule?n:{default:n}}function e(n){return b.default.createElement(n.tag,(0,d.default)({},n.attributes,{dangerouslySetInnerHTML:{__html:n.html}}))}function o(n){return b.default.createElement(e,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function p(n){return b.default.createElement(e,{tag:"style",html:n.style})}function c(n,t){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(t+=n.offsetTop),c(n.parentNode,t);return t}Object.defineProperty(t,"__esModule",{value:!0});var l=a(7),d=s(l),r=a(1),i=s(r),u=a(4),k=s(u),h=a(2),f=s(h),y=a(3),g=s(y),m=a(0),b=s(m),P=a(232),v=s(P),w=a(359),N=function(){var n=w.Portal.PurePortal,t=w.Portal.withNonScrollable(w.Portal.withESCToClose(w.Portal)),a=function(a){function s(){var n,t,a,e;(0,i.default)(this,s);for(var o=arguments.length,p=Array(o),c=0;c<o;c++)p[c]=arguments[c];return t=a=(0,f.default)(this,(n=s.__proto__||Object.getPrototypeOf(s)).call.apply(n,[this].concat(p))),a.state={bodyPortalVisible:!1,purePortalVisible:!1},a.togglePurePortal=function(){return a.setState({purePortalVisible:!a.state.purePortalVisible})},a.showBodyPortal=function(){return a.setState({bodyPortalVisible:!0})},a.hideBodyPortal=function(){return a.setState({bodyPortalVisible:!1})},e=t,(0,f.default)(a,e)}return(0,g.default)(s,a),(0,k.default)(s,[{key:"render",value:function(){return b.default.createElement("div",{className:"zent-doc-portal-container"},b.default.createElement("div",{className:"zent-doc-portal-mount-node"},"Original content"),b.default.createElement(w.Portal,{selector:".zent-doc-portal-mount-node"},b.default.createElement("div",{className:"zent-doc-portal-content"},"Content that Portal inserts dynamically")),b.default.createElement("div",{className:"zent-doc-pure-portal-mount-node",key:this.state.purePortalVisible},"content to be overwritten"),this.state.purePortalVisible?b.default.createElement(n,{selector:".zent-doc-pure-portal-mount-node"},b.default.createElement("div",{className:"zent-doc-portal-content"},"Content that PurePortal inserts dynamically, overwrites the original content inside the container")):null,b.default.createElement(w.Button,{onClick:this.togglePurePortal},"Toggle PurePortal"),b.default.createElement(w.Button,{onClick:this.showBodyPortal},"Append a Portal with curtain to body"),b.default.createElement(t,{visible:this.state.bodyPortalVisible,onClickAway:this.hideBodyPortal,onClose:this.hideBodyPortal,className:"layer",style:{background:"rgba(0, 0, 0, 0.2)"},useLayerForClickAway:!0},b.default.createElement("div",{className:"zent-doc-portal-content",style:{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 0)",border:"1px solid #d3d3d3",borderRadius:"3px",padding:"50px",background:"white"}},"The content is appended to body by default, and a curtain is set for closing")))}}]),s}(m.Component);return b.default.createElement(a,null)},C=function(n){function t(){var n,a,s,e;(0,i.default)(this,t);for(var o=arguments.length,p=Array(o),c=0;c<o;c++)p[c]=arguments[c];return a=s=(0,f.default)(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(p))),s.state={showCode:!1},s.toggle=function(){s.setState({showCode:!s.state.showCode})},e=a,(0,f.default)(s,e)}return(0,g.default)(t,n),(0,k.default)(t,[{key:"render",value:function(){var n=this.state.showCode,t=this.props,a=t.title,s=t.src,o=t.children;return b.default.createElement("div",{className:"zandoc-react-demo"},b.default.createElement("div",{className:"zandoc-react-demo__preview"},o),b.default.createElement("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle},b.default.createElement("div",{className:"zandoc-react-demo__title"},b.default.createElement("p",null,a||"")),b.default.createElement("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle "+(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})),n&&b.default.createElement("pre",{className:"zandoc-react-demo__code"},b.default.createElement(e,{tag:"code",html:s,attributes:{className:"language-jsx"}})))}}]),t}(m.Component),E=function(n){function t(){return(0,i.default)(this,t),(0,f.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,g.default)(t,n),(0,k.default)(t,[{key:"componentDidMount",value:function(){var n=location.hash;if(n){var t=document.querySelector('a[href="'+n+'"]');t&&(0,v.default)(document.documentElement,0,c(t,-9))}}},{key:"render",value:function(){return b.default.createElement("div",{className:"zandoc-react-container",key:null},b.default.createElement(p,{style:""}),b.default.createElement(o,{html:'<h2 class="anchor-heading"><a href="#portal">¶</a><a href="javascript:void(0)" id="portal" class="anchor-point"></a>Portal</h2>\n<p>Portal widget</p>\n<h3 class="anchor-heading"><a href="#guides">¶</a><a href="javascript:void(0)" id="guides" class="anchor-point"></a>Guides</h3>\n<p>Portal provides a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.</p>\n<h3 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h3>'}),b.default.createElement(C,{title:"Basic usage",id:"Demobasic",src:'<span class="token keyword">import</span> <span class="token punctuation">{</span> Portal<span class="token punctuation">,</span> Button <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> PurePortal <span class="token operator">=</span> Portal<span class="token punctuation">.</span>PurePortal<span class="token punctuation">;</span>\n<span class="token keyword">const</span> WrappedPortal <span class="token operator">=</span> Portal<span class="token punctuation">.</span><span class="token function">withNonScrollable</span><span class="token punctuation">(</span>Portal<span class="token punctuation">.</span><span class="token function">withESCToClose</span><span class="token punctuation">(</span>Portal<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">PortalBasic</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 bodyPortalVisible<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n purePortalVisible<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span>\n <span class="token function-variable function">togglePurePortal</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> purePortalVisible<span class="token punctuation">:</span> <span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>purePortalVisible<span class="token punctuation">}</span><span class="token punctuation">)</span>\n <span class="token function-variable function">showBodyPortal</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> bodyPortalVisible<span class="token punctuation">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>\n <span class="token function-variable function">hideBodyPortal</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> bodyPortalVisible<span class="token punctuation">:</span> <span class="token boolean">false</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>\n <span class="token function">render</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>zent-doc-portal-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>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>zent-doc-portal-mount-node<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Original 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>Portal</span> <span class="token attr-name">selector</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>.zent-doc-portal-mount-node<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">=</span><span class="token punctuation">"</span>zent-doc-portal-content<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Content that Portal inserts dynamically<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>Portal</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">=</span><span class="token punctuation">"</span>zent-doc-pure-portal-mount-node<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>purePortalVisible<span class="token punctuation">}</span></span><span class="token punctuation">></span></span>content to be overwritten<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 keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>purePortalVisible <span class="token operator">?</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>PurePortal</span> <span class="token attr-name">selector</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>.zent-doc-pure-portal-mount-node<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">=</span><span class="token punctuation">"</span>zent-doc-portal-content<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Content that PurePortal inserts dynamically<span class="token punctuation">,</span> overwrites the original content inside the container<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>PurePortal</span><span class="token punctuation">></span></span> <span class="token punctuation">:</span> <span class="token keyword">null</span> <span class="token punctuation">}</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Button</span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>togglePurePortal<span class="token punctuation">}</span></span><span class="token punctuation">></span></span>Toggle PurePortal<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Button</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Button</span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>showBodyPortal<span class="token punctuation">}</span></span><span class="token punctuation">></span></span>Append a Portal <span class="token keyword">with</span> curtain to body<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Button</span><span class="token punctuation">></span></span>\n <span class="token operator"><</span>WrappedPortal\n visible<span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>bodyPortalVisible<span class="token punctuation">}</span>\n onClickAway<span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>hideBodyPortal<span class="token punctuation">}</span>\n onClose<span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>hideBodyPortal<span class="token punctuation">}</span>\n className<span class="token operator">=</span><span class="token string">"layer"</span>\n style<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> background<span class="token punctuation">:</span> <span class="token string">\'rgba(0, 0, 0, 0.2)\'</span> <span class="token punctuation">}</span><span class="token punctuation">}</span>\n useLayerForClickAway\n <span class="token operator">></span>\n <span class="token operator"><</span>div className<span class="token operator">=</span><span class="token string">"zent-doc-portal-content"</span> style<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span>\n position<span class="token punctuation">:</span> <span class="token string">\'absolute\'</span><span class="token punctuation">,</span>\n left<span class="token punctuation">:</span> <span class="token string">\'50%\'</span><span class="token punctuation">,</span>\n top<span class="token punctuation">:</span> <span class="token string">\'50%\'</span><span class="token punctuation">,</span>\n transform<span class="token punctuation">:</span> <span class="token string">\'translate3d(-50%, -50%, 0)\'</span><span class="token punctuation">,</span>\n border<span class="token punctuation">:</span> <span class="token string">\'1px solid #d3d3d3\'</span><span class="token punctuation">,</span>\n borderRadius<span class="token punctuation">:</span> <span class="token string">\'3px\'</span><span class="token punctuation">,</span>\n padding<span class="token punctuation">:</span> <span class="token string">\'50px\'</span><span class="token punctuation">,</span>\n background<span class="token punctuation">:</span> <span class="token string">\'white\'</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">></span>The content is appended to body by <span class="token keyword">default</span><span class="token punctuation">,</span> and a curtain is <span class="token keyword">set</span> <span class="token keyword">for</span> closing<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>WrappedPortal</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>PortalBasic</span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span>\n mountNode<span class="token punctuation">,</span>\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},b.default.createElement(N)),b.default.createElement(o,{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>children</td>\n<td>Only supports one child</td>\n<td>string</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>selector</td>\n<td>DOM node to render child</td>\n<td>string or DOM Element</td>\n<td>No</td>\n<td><code>\'body\'</code></td>\n<td>legal CSS selector or certain DOM node</td>\n</tr>\n<tr>\n<td>visible</td>\n<td>Whether to render child</td>\n<td>bool</td>\n<td>No</td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onMount</td>\n<td>Callback after child is mounted</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onUnmount</td>\n<td>Callback after child is unmounted</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>layer</td>\n<td>The layer curtain tag name</td>\n<td>string</td>\n<td>No</td>\n<td><code>div</code></td>\n<td></td>\n</tr>\n<tr>\n<td>useLayerForClickAway</td>\n<td>Whether to use a layer for click away from \n<code>Portal</code></td>\n<td>boolean</td>\n<td>No</td>\n<td>false</td>\n<td></td>\n</tr>\n<tr>\n<td>onClickAway</td>\n<td>The callback when user clicks away from \n<code>Portal</code></td>\n<td>function</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onLayerReady</td>\n<td>The hook when layer is ready</td>\n<td>function</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>className</td>\n<td>The layer class name</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>style</td>\n<td>The layer style</td>\n<td>object</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>css</td>\n<td>(Deprecated, use style instead) Extra css style. such as, \n<code>{ \'margin-left\': \'10px\' }</code></td>\n<td>object</td>\n<td>No</td>\n<td><code>{}</code></td>\n<td></td>\n</tr>\n<tr>\n<td>prefix</td>\n<td>Custom prefix</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'zent\'</code></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p><code>Portal</code> provides some high-level components(HOC),including some logics that are generally used in popovers.</p>\n<h4 class="anchor-heading"><a href="#withesctoclose">¶</a><a href="javascript:void(0)" id="withesctoclose" class="anchor-point"></a>withESCToClose</h4>\n<p>Implements close on ESC.</p>\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>visible</td>\n<td>Is portal visible</td>\n<td>bool</td>\n<td>Yes</td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>onClose</td>\n<td>Callback when portal closes</td>\n<td>func</td>\n<td>Yes</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<pre><code class="language-jsx"><span class="token keyword">import</span> <span class="token punctuation">{</span> Portal <span class="token keyword">as</span> _Portal <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n<span class="token keyword">const</span> <span class="token punctuation">{</span> withESCToClose <span class="token punctuation">}</span> <span class="token operator">=</span> _Portal<span class="token punctuation">;</span>\n<span class="token keyword">const</span> Portal <span class="token operator">=</span> <span class="token function">withESCToClose</span><span class="token punctuation">(</span>_Portal<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>\n<h4 class="anchor-heading"><a href="#withnonscrollable">¶</a><a href="javascript:void(0)" id="withnonscrollable" class="anchor-point"></a>withNonScrollable</h4>\n<p>Disable scroll on body when portal is open.</p>\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>visible</td>\n<td>Is Portal visible</td>\n<td>bool</td>\n<td>Yes</td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>\n<pre><code class="language-jsx"><span class="token keyword">import</span> <span class="token punctuation">{</span> Portal <span class="token keyword">as</span> _Portal <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n<span class="token keyword">const</span> <span class="token punctuation">{</span> withNonScrollable <span class="token punctuation">}</span> <span class="token operator">=</span> _Portal<span class="token punctuation">;</span>\n<span class="token keyword">const</span> Portal <span class="token operator">=</span> <span class="token function">withNonScrollable</span><span class="token punctuation">(</span>_Portal<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>\n<h3 class="anchor-heading"><a href="#principle">¶</a><a href="javascript:void(0)" id="principle" class="anchor-point"></a>Principle</h3>\n<ul>\n<li>The widget is mainly used to insert it\'s <code>child</code> to given DOM node, and it is removed from DOM when component is unmounted.</li>\n<li>A certain degree of repaint occurs when any props are modified, and <code>children</code>, <code>selector</code>\'s change will trigger component <code>unmount</code> to <code>mount</code>; when other props is modified, only existing DOM node attributes update.</li>\n</ul>\n<h3 class="anchor-heading"><a href="#known-issues">¶</a><a href="javascript:void(0)" id="known-issues" class="anchor-point"></a>Known issues</h3>\n<ul>\n<li>\n<p>Using string <code>ref</code> on Portal\'s <code>children</code> throws error, to avoid this question, you can use functional <code>ref</code>. the reason is Portal\'s <code>chilren</code> has no owner, if you want to read more detail about this issue, click <a href="https://github.com/facebook/react/blob/v15.0.2/src/renderers/shared/reconciler/ReactRef.js#L18"> Here</a>. Using string <code>ref</code> on Portal\'s <code>children</code> is also not encouraged by official react team.</p>\n</li>\n<li>\n<p>On <code>15.0.2</code> version, React has a bug that the <code>context</code> rely on <code>state</code> does not update in some case(refer to example: 02-context), please wait React version updates</p>\n</li>\n</ul>\n<h2 class="anchor-heading"><a href="#layeredportal">¶</a><a href="javascript:void(0)" id="layeredportal" class="anchor-point"></a>LayeredPortal</h2>\n<p>Layered portal widget。</p>\n<h3 class="anchor-heading"><a href="#guides">¶</a><a href="javascript:void(0)" id="guides" class="anchor-point"></a>Guides</h3>\n<p>This component is which <code>Portal</code> depends on internally, the difference against <code>Portal</code> is that <code>LayeredPortal</code> does not contain any pre-defined classNames such as prefix</p>\n<h3 class="anchor-heading"><a href="#layeredportal-api">¶</a><a href="javascript:void(0)" id="layeredportal-api" class="anchor-point"></a>LayeredPortal-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>children</td>\n<td>Only supports one child</td>\n<td>string</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>render</td>\n<td>Render the content of \n<code>LayeredPortal</code>\n, prior to children</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>selector</td>\n<td>DOM node to render child</td>\n<td>string or DOM Element</td>\n<td>No</td>\n<td><code>\'body\'</code></td>\n<td>legal CSS selector or certain DOM node</td>\n</tr>\n<tr>\n<td>visible</td>\n<td>Whether to render child</td>\n<td>bool</td>\n<td>No</td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onMount</td>\n<td>Callback after child is mounted</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onUnmount</td>\n<td>Callback after child is unmounted</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>layer</td>\n<td>The layer curtain tag name</td>\n<td>string</td>\n<td>No</td>\n<td><code>div</code></td>\n<td></td>\n</tr>\n<tr>\n<td>useLayerForClickAway</td>\n<td>Whether to use a layer for click away from \n<code>Portal</code></td>\n<td>boolean</td>\n<td>No</td>\n<td>false</td>\n<td></td>\n</tr>\n<tr>\n<td>onClickAway</td>\n<td>The callback when user clicks away from \n<code>Portal</code></td>\n<td>function</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onLayerReady</td>\n<td>The hook when layer is ready</td>\n<td>function</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>className</td>\n<td>The layer class name</td>\n<td>string</td>\n<td>No</td>\n<td><code>\'\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>style</td>\n<td>The layer style</td>\n<td>object</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>css</td>\n<td>(Deprecated, use style instead) Extra css style. such as, \n<code>{ \'margin-left\': \'10px\' }</code></td>\n<td>object</td>\n<td>No</td>\n<td><code>{}</code></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h2 class="anchor-heading"><a href="#pureportal">¶</a><a href="javascript:void(0)" id="pureportal" class="anchor-point"></a>PurePortal</h2>\n<p>Pure portal widget。</p>\n<h3 class="anchor-heading"><a href="#guides">¶</a><a href="javascript:void(0)" id="guides" class="anchor-point"></a>Guides</h3>\n<p>Portal behaves like React 16 Portal,which will overwrite all content inside its container.</p>\n<h3 class="anchor-heading"><a href="#pureportal-api">¶</a><a href="javascript:void(0)" id="pureportal-api" class="anchor-point"></a>PurePortal-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>children</td>\n<td>Only supports one child</td>\n<td>string</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>render</td>\n<td>Render the content of \n<code>LayeredPortal</code>\n, prior to children</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>selector</td>\n<td>DOM node to render child</td>\n<td>string or DOM Element</td>\n<td>No</td>\n<td><code>\'body\'</code></td>\n<td>legal CSS selector or certain DOM node</td>\n</tr>\n<tr>\n<td>onMount</td>\n<td>Callback after child is mounted</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onUnmount</td>\n<td>Callback after child is unmounted</td>\n<td>func</td>\n<td>No</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>'}))}}]),t}(m.Component);t.default=E}});