-
Notifications
You must be signed in to change notification settings - Fork 1
/
1663-735a3020c28315b6c925.js
1 lines (1 loc) · 13.9 KB
/
1663-735a3020c28315b6c925.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[1663],{90218:(e,n,t)=>{"use strict";t.d(n,{v:()=>f,Z:()=>b});var i=t(59312),o=t(24246),s=t(60042),r=t.n(s),l=t(27378),d=t(17949),a=t(42690),u=t(53090),p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return(0,i.ZT)(n,e),n.prototype.renderCommonMenuItem=function(e,n,t,o){var s=(0,i.pi)({specKey:(0,u.o)(e,n,t),onClick:this.handleClick},o);return(0,l.cloneElement)(e,s)},n}(l.PureComponent),c=t(80736),h=t(27036),v=t(79737),m=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.handleClick=function(e,t){(0,n.props.onClick)(e,t)},n.onSubMenuClick=function(){n.props.onSubMenuClick&&n.props.onSubMenuClick(n.props.specKey)},n.renderSubMenuItems=function(e,t){if(!e)return null;var i=n.props.specKey;return n.renderCommonMenuItem(e,t,i)},n}return(0,i.ZT)(n,e),n.prototype.render=function(){var e=this.props,n=e.children,t=e.visible,s=e.overlayCx;return t?(0,o.jsx)("ul",(0,i.pi)({className:r()("zent-menu","zent-submenu-content",s),onClick:this.onSubMenuClick,"data-zv":"10.0.10"},{children:l.Children.map(n,this.renderSubMenuItems)}),void 0):null},n}(p),y=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.state={subMenuVisible:!1},n.getEventHanders=function(e,t){var i={};return e||t||(i={onMouseEnter:n.onMouseEnter,onMouseLeave:n.onMouseLeave}),i},n.handleClick=function(e,t){var i=n.props,o=i.onClick;!i.isInline&&n.setState({subMenuVisible:!1}),o(e,t)},n.titleClickHandler=function(e){var t,i,o=n.props,s=o.isInline,r=o.specKey,l=o.toggleExpand;null===(i=(t=n.props).onSubMenuClick)||void 0===i||i.call(t,r),s&&l(r),e.stopPropagation()},n.onMouseEnter=function(){n.leaveTimer&&clearTimeout(n.leaveTimer),n.enterTimer=setTimeout((function(){n.setState({subMenuVisible:!0})}),200)},n.onMouseLeave=function(){n.enterTimer&&clearTimeout(n.enterTimer),n.leaveTimer=setTimeout((function(){n.setState({subMenuVisible:!1})}),200)},n.renderInlineChild=function(e,t){var i=n.props,o=i.depth,s=i.isInline,r=i.inlineIndent,l=i.selectedKey,d=i.expandKeys,a=i.handleSelect,u=i.toggleExpand,p=i.specKey;return n.renderCommonMenuItem(e,t,p,{depth:o+1,isInline:s,inlineIndent:r,selectedKey:l,expandKeys:d,handleSelect:a,toggleExpand:u,onSubMenuClick:n.props.onSubMenuClick})},n}return(0,i.ZT)(n,e),n.prototype.renderContent=function(){var e=this.props,n=e.children,t=e.specKey,s=e.overlayClassName,r=e.isInline,d=e.expandKeys,a=d&&-1!==d.indexOf(t);return r?(0,o.jsx)(v.H,(0,i.pi)({duration:200,height:a?"auto":0},{children:(0,o.jsx)("ul",(0,i.pi)({className:"zent-menu__inner","data-zv":"10.0.10"},{children:l.Children.map(n,this.renderInlineChild)}),void 0)}),void 0):(0,o.jsx)(m,(0,i.pi)({visible:this.state.subMenuVisible,onClick:this.handleClick,specKey:t,overlayCx:s,onSubMenuClick:this.props.onSubMenuClick},{children:n}),void 0)},n.prototype.render=function(){var e=this.props,n=e.className,t=e.disabled,s=e.title,l=e.isInline,d=e.depth,a=e.inlineIndent,p=e.expandKeys,c=e.specKey,v=p&&-1!==p.indexOf(c),m=this.getEventHanders(t,l),y=(0,u.g)({isInline:l,depth:d,inlineIndent:a}),f=r()(n,{"zent-menu-item":!l,"zent-menu-item-disabled":t,"zent-submenu":!l,"zent-menu__inline-submenu":l,"zent-menu__inline-item-disabled":t&&l});return(0,o.jsxs)("li",(0,i.pi)({className:f},m,{"data-zv":"10.0.10"},{children:[(0,o.jsxs)("div",(0,i.pi)({className:r()({"zent-submenu-title":!l,"zent-menu__inline-submenu-title":l,"zent-submenu-disabled":t}),style:y,onClick:this.titleClickHandler,"data-zv":"10.0.10"},{children:[s,!t&&(0,o.jsx)(h.Z,{className:r()("zent-submenu-title-operate-icon",{"zent-menu__inline-submenu-icon--expand":l&&v}),type:"right"},void 0)]}),void 0),!t&&this.renderContent()]}),void 0)},n.defaultProps={className:""},n}(p),f=function(e){function n(n){var t,o,s,r=e.call(this,n)||this;return r.toggleExpand=function(e){var n,t,o=r.state.expandedKeys,s=-1!==o.indexOf(e)?o.filter((function(n){return n!==e})):(0,i.ev)([e],o);r.setState({expandedKeys:s}),null===(t=(n=r.props).onExpandChange)||void 0===t||t.call(n,s)},r.handleSelect=function(e){var n,t;r.setState({selectedKey:e}),null===(t=(n=r.props).onSelectChange)||void 0===t||t.call(n,e)},r.handleClick=function(e,n){var t=r.props.onClick;t&&t(e,n)},r.renderMenuItem=function(e,n){return e?r.renderCommonMenuItem(e,n,void 0,{depth:1,isInline:"inline"===r.props.mode,inlineIndent:r.props.inlineIndent,selectedKey:r.state.selectedKey,expandKeys:r.state.expandedKeys,handleSelect:r.handleSelect,toggleExpand:r.toggleExpand,onSubMenuClick:r.props.onSubMenuClick}):null},"inline"===n.mode?r.state={selectedKey:null!==(t=n.selectedKey)&&void 0!==t?t:n.defaultSelectedKey,expandedKeys:null!==(s=null!==(o=n.expandedKeys)&&void 0!==o?o:n.defaultExpandedKeys)&&void 0!==s?s:n.defaultExpandKeys,prevExpandedKeysProp:n.expandedKeys,prevSelectedKeyProp:n.selectedKey}:r.state={},r}return(0,i.ZT)(n,e),n.getDerivedStateFromProps=function(e,n){if("inline"!==e.mode)return null;var t={prevSelectedKeyProp:e.selectedKey,prevExpandedKeysProp:e.expandedKeys};return e.selectedKey!==n.prevSelectedKeyProp&&e.selectedKey!==n.selectedKey&&(t.selectedKey=e.selectedKey),(0,d.Z)(e.expandedKeys,n.prevExpandedKeysProp)||(0,d.Z)(e.expandedKeys,n.expandedKeys)||(t.expandedKeys=e.expandedKeys),t},n.prototype.render=function(){var e=this.props,n=e.children,t=e.className,s=e.style,d="inline"===e.mode,a=r()("zent-menu",t,{"zent-menu__inline":d});return(0,o.jsx)("ul",(0,i.pi)({className:a,style:s,"data-zv":"10.0.10"},{children:l.Children.map(n,this.renderMenuItem)}),void 0)},n.MenuItem=c.Z,n.SubMenu=y,n.defaultProps={onClick:a.Z,mode:"pop",inlineIndent:24,defaultExpandKeys:[],onSubMenuClick:a.Z},n}(p),b=f},80736:(e,n,t)=>{"use strict";t.d(n,{s:()=>a});var i=t(59312),o=t(24246),s=t(27378),r=t(60042),l=t.n(r),d=t(53090),a=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.handleClick=function(e){var t=n.props,i=t.specKey,o=t.onClick,s=t.disabled,r=t.isInline,l=t.handleSelect;s||(r&&l(i),o(e,i))},n}return(0,i.ZT)(n,e),n.prototype.render=function(){var e=this.props,n=e.specKey,t=e.className,s=e.children,r=e.disabled,a=e.isInline,u=e.selectedKey,p=e.depth,c=e.inlineIndent,h=u===n,v=(0,d.g)({isInline:a,depth:p,inlineIndent:c});return(0,o.jsx)("li",(0,i.pi)({className:l()("zent-menu-item",t,{"zent-menu__inline-item":a,"zent-menu__inline-item-selected":h,"zent-menu-item-disabled":r}),style:v,onClick:this.handleClick,"data-zv":"10.0.10"},{children:s}),void 0)},n}(s.Component);n.Z=a},68347:(e,n,t)=>{"use strict";var i=t(90218);n.ZP=i.Z},53090:(e,n,t)=>{"use strict";function i(e,n,t){return void 0===t&&(t="item"),e.key||t+"_"+n}function o(e){var n=e.isInline,t=e.depth,i=e.inlineIndent,o={};return n&&(o={paddingLeft:t*i+"px"}),o}t.d(n,{o:()=>i,g:()=>o})},4246:(e,n,t)=>{"use strict";t.d(n,{E:()=>u});var i=t(59312),o=t(24246),s=t(60042),r=t.n(s),l=t(27378),d=t(57961),a=t(1348);function u(e){var n=(0,l.useContext)(a.d),t=e.value,s=e.disabled,u=void 0===s?n.value:s,p=e.readOnly,c=void 0!==p&&p,h=e.isValueEqual,v=void 0===h?Object.is:h,m=e.className,y=e.style,f=e.children,b=e.onChange,x=(0,l.useMemo)((function(){return{value:t,disabled:u,readOnly:c,isValueEqual:v,onRadioChange:b}}),[t,u,c,v,b]);return(0,o.jsx)(d.Z.Provider,(0,i.pi)({value:x},{children:(0,o.jsx)("div",(0,i.pi)({className:r()("zent-radio-group",m),style:y,"data-zv":"10.0.10"},{children:f}),void 0)}),void 0)}n.Z=u},57961:(e,n,t)=>{"use strict";var i=(0,t(27378).createContext)(null);i.displayName="RadioGroupContext",n.Z=i},71457:(e,n,t)=>{"use strict";t.d(n,{Y:()=>v,Z:()=>m});var i=t(59312),o=t(24246),s=t(60042),r=t.n(s),l=t(1535),d=t(27378);function a(e,n){var t=(0,d.useRef)(n);t.current=n;var o=e&&e.onRadioChange;return(0,d.useCallback)((function(e){var n=function(e,n){var t=Object.create(e);return t.target=(0,i.pi)((0,i.pi)({},n),{type:"radio",checked:e.target.checked}),t}(e,t.current);if(o)o(n);else{var s=t.current.onChange;s&&s(n)}}),[o])}function u(e,n,t){var i=function(e,n,t){return"boolean"==typeof t.disabled?t.disabled:n&&"boolean"==typeof n.disabled?n.disabled:e.value}(e,n,t),o=function(e,n){return"boolean"==typeof n.readOnly?n.readOnly:!!e&&e.readOnly}(n,t);return{checked:n?n.isValueEqual(n.value,t.value):!!t.checked,disabled:i,readOnly:o}}var p=t(4246),c=t(1348),h=t(57961);function v(e){var n=e.className,t=e.style,s=e.children,p=(e.value,e.width),v=e.labelStyle,m=(e.onMouseEnter,e.onMouseLeave,(0,i._T)(e,["className","style","children","value","width","labelStyle","onMouseEnter","onMouseLeave"])),y=(0,d.useContext)(c.d),f=(0,d.useContext)(h.Z),b=u(y,f,e),x=b.checked,g=b.disabled,C=b.readOnly,z=a(f,e),K=r()(n,"zent-radio-wrap",{"zent-radio-checked":!!x,"zent-radio-disabled":g||C}),k=(0,l.Z)(p),M=(0,i.pi)((0,i.pi)({},t),k);return(0,o.jsxs)("label",(0,i.pi)({className:K,style:M,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,"data-zv":"10.0.10"},{children:[(0,o.jsxs)("span",(0,i.pi)({className:"zent-radio","data-zv":"10.0.10"},{children:[(0,o.jsx)("span",{className:"zent-radio-inner","data-zv":"10.0.10"},void 0),(0,o.jsx)("input",(0,i.pi)({},m,{type:"radio",checked:!!x,disabled:g,readOnly:C,onChange:z,"data-zv":"10.0.10"}),void 0)]}),void 0),void 0!==s&&(0,o.jsx)("span",(0,i.pi)({className:"zent-radio-label",style:v,"data-zv":"10.0.10"},{children:s}),void 0)]}),void 0)}v.Button=function(e){var n=e.className,t=e.style,s=e.children,p=(e.value,e.width),v=e.onMouseEnter,m=e.onMouseLeave,y=(0,i._T)(e,["className","style","children","value","width","onMouseEnter","onMouseLeave"]),f=(0,d.useContext)(c.d),b=(0,d.useContext)(h.Z);if(!b)throw new Error("Radio.Button must be nested within Radio.Group");var x=u(f,b,e),g=x.checked,C=x.disabled,z=x.readOnly,K=a(b,e),k=r()(n,"zent-radio-button",{"zent-radio-button--checked":!!g,"zent-radio-button--disabled":C||z}),M=(0,l.Z)(p),w=(0,i.pi)((0,i.pi)({},t),M);return(0,o.jsxs)("label",(0,i.pi)({className:k,style:w,onMouseEnter:v,onMouseLeave:m,"data-zv":"10.0.10"},{children:[(0,o.jsx)("input",(0,i.pi)({},y,{type:"radio",checked:!!g,disabled:C,readOnly:z,onChange:K,"data-zv":"10.0.10"}),void 0),(0,o.jsx)("span",(0,i.pi)({className:"zent-radio-button__content","data-zv":"10.0.10"},{children:s}),void 0)]}),void 0)},v.Group=p.Z;var m=v},12176:(e,n,t)=>{"use strict";t.d(n,{a:()=>m});var i=t(59312),o=t(24246),s=t(27378),r=t(60042),l=t.n(r),d=t(19832),a=t(90347),u=t(33806),p=t(68347),c=t(27036),h=t(1348),v=p.ZP.MenuItem,m=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.splitButton=(0,s.createRef)(),n.state={isShowDropdown:!1},n.toggleDropdown=function(e){n.setState({isShowDropdown:e})},n.handleSelect=function(e,t){n.props.onSelect&&n.props.onSelect(t),n.toggleDropdown(!1)},n}return(0,i.ZT)(n,e),n.prototype.render=function(){var e=this,n=this.props,t=n.type,s=n.size,r=n.disabled,h=void 0===r?this.context.value:r,m=n.loading,y=n.dropdownTrigger,f=n.dropdownData,b=n.dropdownValue,x=n.dropdownText,g=n.dropdownPosition,C=n.dropdownIcon,z=n.className,K=n.children,k=n.onClick,M=l()("zent-split-button",z),w=(0,d.Z)(y),S=h||m?u.ZP.Trigger.Base:u.ZP.Trigger[w],_=g.split("-").map((function(e){return(0,d.Z)(e)})).join("");return(0,o.jsxs)("div",(0,i.pi)({ref:this.splitButton,className:M,"data-zv":"10.0.10"},{children:[K&&(0,o.jsx)(a.ZP,(0,i.pi)({className:"zent-split-button__main",type:t,size:s,onClick:k,disabled:h,loading:m},{children:K}),void 0),(0,o.jsx)("div",(0,i.pi)({className:l()("zent-split-button__dropdown-wrapper",{"zent-split-button__dropdown-wrapper-text":"text"===t}),"data-zv":"10.0.10"},{children:(0,o.jsxs)(u.ZP,(0,i.pi)({visible:this.state.isShowDropdown,onVisibleChange:function(n){return e.toggleDropdown(n)},position:u.ZP.Position[_],cushion:5},{children:[(0,o.jsx)(S,{children:(0,o.jsx)(a.ZP,(0,i.pi)({className:l()("zent-split-button__dropdown",{"zent-split-button__dropdown-disabled":m,"zent-split-button__dropdown-icononly":!K}),type:t,size:s,disabled:h},{children:(0,o.jsx)(c.Z,{className:"zent-split-button__dropdown-icon",type:C},void 0)}),void 0)},void 0),(0,o.jsx)(u.ZP.Content,{children:(0,o.jsx)(p.ZP,(0,i.pi)({className:"zent-split-button__dropdown-menu",onClick:this.handleSelect},{children:f.map((function(e){return(0,o.jsx)(v,(0,i.pi)({className:"zent-split-button__dropdown-menu-item-"+t},{children:e[x]}),""+e[b])}))}),void 0)},void 0)]}),void 0)}),void 0)]}),void 0)},n.defaultProps={type:"default",size:"medium",dropdownTrigger:"click",dropdownData:[],dropdownValue:"value",dropdownText:"text",dropdownIcon:"down",dropdownPosition:"auto-bottom-right"},n.contextType=h.d,n}(s.Component)},79737:(e,n,t)=>{"use strict";t.d(n,{H:()=>d});var i=t(59312),o=t(24246),s=t(27378),r=t(17127);function l(e,n){e.style.height="number"==typeof n?n+"px":n}var d=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.ref=(0,s.createRef)(),n.timer=null,n}return(0,i.ZT)(n,e),n.prototype.componentDidMount=function(){var e=this,n=this.props,t=n.appear,i=n.height,o=n.duration,s=this.ref.current;if(t&&"auto"===i){var d=s.offsetHeight;s.style.height="0px",(0,r.tA)((function(){e.props.height===i&&(s.style.height=d+"px",e.timer=setTimeout((function(){e.timer=null,e.props.height===i&&(s.style.height="auto")}),o))}))}else l(s,i)},n.prototype.componentDidUpdate=function(e){var n=this,t=this.props,i=t.height,o=t.duration;if(e.height!==i){null!==this.timer&&(clearTimeout(this.timer),this.timer=null);var s=this.ref.current;if("auto"===e.height)s.style.height=s.offsetHeight+"px",(0,r.tA)((function(){n.props.height===i&&l(s,i)}));else if("auto"===i){var d=s.offsetHeight;s.style.height="auto";var a=s.offsetHeight;s.style.height=d+"px",(0,r.tA)((function(){s.style.height=a+"px",n.timer=setTimeout((function(){n.timer=null,n.props.height===i&&(s.style.height=i)}),o)}))}else l(s,i)}},n.prototype.render=function(){var e=this.props,n=e.duration,t=e.className,s=e.style,r=e.easing,l=e.overflow,d=e.children,a=e.transitionPrototype;return(0,o.jsx)("div",(0,i.pi)({ref:this.ref,className:t,style:(0,i.pi)((0,i.pi)({},s),{transition:a+" "+n+"ms "+r,overflow:l}),"data-zv":"10.0.10"},{children:d}),void 0)},n.defaultProps={appear:!1,duration:200,easing:"ease",overflow:"hidden",transitionPrototype:"height"},n}(s.Component)}}]);