forked from Gitlink/forgeplus
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[6],{"7Lfq":function(e,t,n){},aIZi:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("7Lfq"),n("L/Qf")},"jsC+":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n.n(r),i=n("17x9"),a=n.n(i),l=n("i8i4"),c=n.n(l),s=n("uciX"),p=n("TSYQ"),f=n.n(p),u={adjustX:1,adjustY:1},y=[0,0],b={topLeft:{points:["bl","tl"],overflow:u,offset:[0,-4],targetOffset:y},topCenter:{points:["bc","tc"],overflow:u,offset:[0,-4],targetOffset:y},topRight:{points:["br","tr"],overflow:u,offset:[0,-4],targetOffset:y},bottomLeft:{points:["tl","bl"],overflow:u,offset:[0,4],targetOffset:y},bottomCenter:{points:["tc","bc"],overflow:u,offset:[0,4],targetOffset:y},bottomRight:{points:["tr","br"],overflow:u,offset:[0,4],targetOffset:y}},g=n("VCL8"),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var m=function(e){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return v.call(r),r.state="visible"in n?{visible:n.visible}:{visible:n.defaultVisible},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.getDerivedStateFromProps=function(e){return"visible"in e?{visible:e.visible}:null},t.prototype.getOverlayElement=function(){var e=this.props.overlay;return"function"==typeof e?e():e},t.prototype.getMenuElementOrLambda=function(){return"function"==typeof this.props.overlay?this.getMenuElement:this.getMenuElement()},t.prototype.getPopupDomNode=function(){return this.trigger.getPopupDomNode()},t.prototype.getOpenClassName=function(){var e=this.props,t=e.openClassName,n=e.prefixCls;return void 0!==t?t:n+"-open"},t.prototype.renderChildren=function(){var e=this.props.children,t=this.state.visible,n=e.props?e.props:{},o=f()(n.className,this.getOpenClassName());return t&&e?Object(r.cloneElement)(e,{className:o}):e},t.prototype.render=function(){var e=this.props,t=e.prefixCls,n=e.transitionName,r=e.animation,i=e.align,a=e.placement,l=e.getPopupContainer,c=e.showAction,p=e.hideAction,f=e.overlayClassName,u=e.overlayStyle,y=e.trigger,g=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["prefixCls","transitionName","animation","align","placement","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","trigger"]),m=p;return m||-1===y.indexOf("contextMenu")||(m=["click"]),o.a.createElement(s.a,h({},g,{prefixCls:t,ref:this.saveTrigger,popupClassName:f,popupStyle:u,builtinPlacements:b,action:y,showAction:c,hideAction:m||[],popupPlacement:a,popupAlign:i,popupTransitionName:n,popupAnimation:r,popupVisible:this.state.visible,afterPopupVisibleChange:this.afterVisibleChange,popup:this.getMenuElementOrLambda(),onPopupVisibleChange:this.onVisibleChange,getPopupContainer:l}),this.renderChildren())},t}(r.Component);m.propTypes={minOverlayWidthMatchTrigger:a.a.bool,onVisibleChange:a.a.func,onOverlayClick:a.a.func,prefixCls:a.a.string,children:a.a.any,transitionName:a.a.string,overlayClassName:a.a.string,openClassName:a.a.string,animation:a.a.any,align:a.a.object,overlayStyle:a.a.object,placement:a.a.string,overlay:a.a.oneOfType([a.a.node,a.a.func]),trigger:a.a.array,alignPoint:a.a.bool,showAction:a.a.array,hideAction:a.a.array,getPopupContainer:a.a.func,visible:a.a.bool,defaultVisible:a.a.bool},m.defaultProps={prefixCls:"rc-dropdown",trigger:["hover"],showAction:[],overlayClassName:"",overlayStyle:{},defaultVisible:!1,onVisibleChange:function(){},placement:"bottomLeft"};var v=function(){var e=this;this.onClick=function(t){var n=e.props,r=e.getOverlayElement().props;"visible"in n||e.setState({visible:!1}),n.onOverlayClick&&n.onOverlayClick(t),r.onClick&&r.onClick(t)},this.onVisibleChange=function(t){var n=e.props;"visible"in n||e.setState({visible:t}),n.onVisibleChange(t)},this.getMinOverlayWidthMatchTrigger=function(){var t=e.props,n=t.minOverlayWidthMatchTrigger,r=t.alignPoint;return"minOverlayWidthMatchTrigger"in e.props?n:!r},this.getMenuElement=function(){var t=e.props.prefixCls,n=e.getOverlayElement(),r={prefixCls:t+"-menu",onClick:e.onClick};return"string"==typeof n.type&&delete r.prefixCls,o.a.cloneElement(n,r)},this.afterVisibleChange=function(t){if(t&&e.getMinOverlayWidthMatchTrigger()){var n=e.getPopupDomNode(),r=c.a.findDOMNode(e);r&&n&&r.offsetWidth>n.offsetWidth&&(n.style.minWidth=r.offsetWidth+"px",e.trigger&&e.trigger._component&&e.trigger._component.alignInstance&&e.trigger._component.alignInstance.forceAlign())}},this.saveTrigger=function(t){e.trigger=t}};Object(g.polyfill)(m);var d=m,O=n("H84U"),C=n("6CfX"),w=n("CtXQ"),P=n("CWQg");function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=k(e);if(t){var o=k(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return T(this,n)}}function T(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object(P.a)("topLeft","topCenter","topRight","bottomLeft","bottomCenter","bottomRight");var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(a,e);var t,n,o,i=_(a);function a(){var e;return x(this,a),(e=i.apply(this,arguments)).renderOverlay=function(t){var n,o=e.props.overlay;n="function"==typeof o?o():o;var i=(n=r.Children.only(n)).props;Object(C.a)(!i.mode||"vertical"===i.mode,"Dropdown",'mode="'.concat(i.mode,"\" is not supported for Dropdown's Menu."));var a=i.selectable,l=void 0!==a&&a,c=i.focusable,s=void 0===c||c,p=r.createElement("span",{className:"".concat(t,"-menu-submenu-arrow")},r.createElement(w.default,{type:"right",className:"".concat(t,"-menu-submenu-arrow-icon")}));return"string"==typeof n.type?o:r.cloneElement(n,{mode:"vertical",selectable:l,focusable:s,expandIcon:p})},e.renderDropDown=function(t){var n,o=t.getPopupContainer,i=t.getPrefixCls,a=e.props,l=a.prefixCls,c=a.children,s=a.trigger,p=a.disabled,u=a.getPopupContainer,y=i("dropdown",l),b=r.Children.only(c),g=r.cloneElement(b,{className:f()(b.props.className,"".concat(y,"-trigger")),disabled:p}),h=p?[]:s;return h&&-1!==h.indexOf("contextMenu")&&(n=!0),r.createElement(d,E({alignPoint:n},e.props,{prefixCls:y,getPopupContainer:u||o,transitionName:e.getTransitionName(),trigger:h,overlay:function(){return e.renderOverlay(y)}}),g)},e}return t=a,(n=[{key:"getTransitionName",value:function(){var e=this.props,t=e.placement,n=void 0===t?"":t,r=e.transitionName;return void 0!==r?r:n.indexOf("top")>=0?"slide-down":"slide-up"}},{key:"render",value:function(){return r.createElement(O.a,null,this.renderDropDown)}}])&&N(t.prototype,n),o&&N(t,o),a}(r.Component);R.defaultProps={mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft"};var D=n("2/Rp");function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=X(e);if(t){var o=X(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(e,t){return!t||"object"!==V(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function X(e){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},B=D.default.Group,J=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(a,e);var t,n,o,i=I(a);function a(){var e;return L(this,a),(e=i.apply(this,arguments)).renderButton=function(t){var n=t.getPopupContainer,o=t.getPrefixCls,i=e.props,a=i.prefixCls,l=i.type,c=i.disabled,s=i.onClick,p=i.htmlType,u=i.children,y=i.className,b=i.overlay,g=i.trigger,h=i.align,m=i.visible,v=i.onVisibleChange,d=i.placement,O=i.getPopupContainer,C=i.href,P=i.icon,j=void 0===P?r.createElement(w.default,{type:"ellipsis"}):P,E=i.title,x=q(i,["prefixCls","type","disabled","onClick","htmlType","children","className","overlay","trigger","align","visible","onVisibleChange","placement","getPopupContainer","href","icon","title"]),N=o("dropdown-button",a),S={align:h,overlay:b,disabled:c,trigger:c?[]:g,onVisibleChange:v,placement:d,getPopupContainer:O||n};return"visible"in e.props&&(S.visible=m),r.createElement(B,M({},x,{className:f()(N,y)}),r.createElement(D.default,{type:l,disabled:c,onClick:s,htmlType:p,href:C,title:E},u),r.createElement(R,S,r.createElement(D.default,{type:l},j)))},e}return t=a,(n=[{key:"render",value:function(){return r.createElement(O.a,null,this.renderButton)}}])&&A(t.prototype,n),o&&A(t,o),a}(r.Component);J.defaultProps={placement:"bottomRight",type:"default"},R.Button=J;t.default=R}}]); |