rc-drawer
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports["rc-drawer"]=e(require("react"),require("react-dom")):t["rc-drawer"]=e(t.React,t.ReactDOM)}("undefined"!=typeof self?self:this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=39)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(4),o=n(13);t.exports=n(6)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(9),o=n(31),i=n(17),u=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(52),o=n(16);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(22)("wks"),o=n(14),i=n(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(0),o=n(2),i=n(30),u=n(3),a=n(1),c=function(t,e,n){var s,f,l,p=t&c.F,d=t&c.G,h=t&c.S,y=t&c.P,v=t&c.B,m=t&c.W,b=d?o:o[e]||(o[e]={}),g=b.prototype,x=d?r:h?r[e]:(r[e]||{}).prototype;d&&(n=e);for(s in n)(f=!p&&x&&void 0!==x[s])&&a(b,s)||(l=f?x[s]:n[s],b[s]=d&&"function"!=typeof x[s]?n[s]:v&&f?i(l,r):m&&x[s]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):y&&"function"==typeof l?i(Function.call,l):l,y&&((b.virtual||(b.virtual={}))[s]=l,t&c.R&&g&&!g[s]&&u(g,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(5);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports={}},function(t,e,n){var r=n(9),o=n(51),i=n(23),u=n(21)("IE_PROTO"),a=function(){},c=function(){var t,e=n(32)("iframe"),r=i.length;for(e.style.display="none",n(56).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[u]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(34),o=n(23);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(22)("keys"),o=n(14);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(2),o=n(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(10)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(4).f,o=n(1),i=n(8)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(8)},function(t,e,n){var r=n(0),o=n(2),i=n(10),u=n(25),a=n(4).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:u.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(45),i=r(o),u=n(63),a=r(u),c="function"==typeof a.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===c(i.default)?function(t){return void 0===t?"undefined":c(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":c(t)}},function(t,e,n){"use strict";var r=n(10),o=n(11),i=n(33),u=n(3),a=n(18),c=n(50),s=n(24),f=n(57),l=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,h,y,v,m){c(n,e,h);var b,g,x,O=function(t){if(!p&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},_=e+" Iterator",w="values"==y,S=!1,E=t.prototype,T=E[l]||E["@@iterator"]||y&&E[y],C=T||O(y),j=y?w?O("entries"):C:void 0,P="Array"==e?E.entries||T:T;if(P&&(x=f(P.call(new t)))!==Object.prototype&&x.next&&(s(x,_,!0),r||"function"==typeof x[l]||u(x,l,d)),w&&T&&"values"!==T.name&&(S=!0,C=function(){return T.call(this)}),r&&!m||!p&&!S&&E[l]||u(E,l,C),a[e]=C,a[_]=d,y)if(b={values:w?C:O("values"),keys:v?C:O("keys"),entries:j},m)for(g in b)g in E||i(E,g,b[g]);else o(o.P+o.F*(p||S),e,b);return b}},function(t,e,n){var r=n(49);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(6)&&!n(12)(function(){return 7!=Object.defineProperty(n(32)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(5),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=n(1),o=n(7),i=n(53)(!1),u=n(21)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),c=0,s=[];for(n in a)n!=u&&r(a,n)&&s.push(n);for(;e.length>c;)r(a,n=e[c++])&&(~i(s,n)||s.push(n));return s}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(34),o=n(23).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(27),o=n(13),i=n(7),u=n(17),a=n(1),c=n(31),s=Object.getOwnPropertyDescriptor;e.f=n(6)?s:function(t,e){if(t=i(t),e=u(e,!0),c)try{return s(t,e)}catch(t){}if(a(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){n(40),t.exports=n(41)},function(t,e){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(42);e.default=r.a},function(t,e,n){"use strict";var r=n(43),o=n.n(r),i=n(44),u=n.n(i),a=n(73),c=n.n(a),s=n(81),f=n.n(s),l=n(82),p=(n.n(l),n(83)),d=n.n(p),h=n(88),y=n.n(h),v=n(89),m="undefined"==typeof window,b=function(t){function e(n){o()(this,e);var r=u()(this,t.call(this,n));return g.call(r),(n.onIconClick||n.parent||n.iconChild||n.width)&&console.warn("rc-drawer-menu API has been changed, please look at the releases, https://github.com/react-component/drawer-menu/releases"),r.state={open:void 0!==n.open?n.open:!!n.defaultOpen},r}return c()(e,t),e.prototype.componentDidMount=function(){this.getParentAndLevelDom(this.props),(this.props.getContainer||this.props.parent)&&(this.container=this.defaultGetContainer()),this.forceUpdate()},e.prototype.componentWillReceiveProps=function(t){var e=t.open,n=t.placement;void 0!==e&&e!==this.props.open&&(this.isOpenChange=!0,this.setState({open:e})),n!==this.props.placement&&(this.contextDom=null),this.props.level!==t.level&&this.getParentAndLevelDom(t)},e.prototype.componentWillUnmount=function(){this.container&&(this.setLevelDomTransform(!1,!0),this.props.getContainer&&this.container.parentNode.removeChild(this.container))},e.prototype.render=function(){var t=this,e=this.getChildToRender();return this.props.getContainer?this.container?Object(l.createPortal)(e,this.container):null:f.a.createElement("div",{className:this.props.wrapperClassName,ref:function(e){t.container=e}},e)},e}(f.a.PureComponent);b.propTypes={wrapperClassName:d.a.string,open:d.a.bool,bodyStyle:d.a.object,defaultOpen:d.a.bool,placement:d.a.string,level:d.a.oneOfType([d.a.string,d.a.array]),levelTransition:d.a.string,getContainer:d.a.string,handleChild:d.a.any,handleStyle:d.a.object,onChange:d.a.func,onMaskClick:d.a.func,onHandleClick:d.a.func,showMask:d.a.bool,maskStyle:d.a.object},b.defaultProps={className:"",prefixCls:"drawer",placement:"left",getContainer:"body",level:"all",levelTransition:"transform .3s cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},onMaskClick:function(){},onHandleClick:function(){},handleChild:f.a.createElement("i",{className:"drawer-handle-icon"}),handleStyle:{},showMask:!0,maskStyle:{}};var g=function(){var t=this;this.levelDom=[],this.contextDom=null,this.maskDom=null,this.handleDom=null,this.mousePos=null,this.getParentAndLevelDom=function(e){if(!m){var n=e.level,r=e.getContainer;if(t.levelDom=[],t.parent=r&&document.querySelectorAll(r)[0]||t.container.parentNode,"all"===n){Array.prototype.slice.call(t.parent.children).forEach(function(e){"SCRIPT"!==e.nodeName&&"STYLE"!==e.nodeName&&e!==t.container&&t.levelDom.push(e)})}else n&&Object(v.a)(n).forEach(function(e){document.querySelectorAll(e).forEach(function(e){t.levelDom.push(e)})})}},this.trnasitionEnd=function(e){var n=e.target;n.removeEventListener(v.b,t.trnasitionEnd),n.style.transition=""},this.onTouchEnd=function(e,n){if(void 0===t.props.open){var r=n||t.state.open;t.isOpenChange=!0,t.setState({open:!r})}},this.onMaskTouchEnd=function(e){t.props.onMaskClick(e),t.onTouchEnd(e,!0)},this.onIconTouchEnd=function(e){t.props.onHandleClick(e),t.onTouchEnd(e)},this.setLevelDomTransform=function(e,n,r,o){var i=t.props,u=i.placement,a=i.levelTransition,c=i.onChange;t.levelDom.forEach(function(i){(t.isOpenChange||n)&&(i.style.transition=a,i.addEventListener(v.b,t.trnasitionEnd));var c="left"===u||"top"===u?o:-o;i.style.transform=e?r+"("+c+"px)":""}),m||(e?(t.bodyDefaultOverflow=document.body.style.overflow,document.body.style.overflow="hidden"):(document.body.style.overflow=t.bodyDefaultOverflow,delete t.bodyDefaultOverflow)),c&&t.isOpenChange&&(c(e),t.isOpenChange=!1)},this.getChildToRender=function(){var e,n=void 0!==t.props.open?t.props.open:t.state.open,r=t.props,o=r.className,i=r.prefixCls,u=r.style,a=r.placement,c=r.children,s=r.handleChild,l=r.handleStyle,p=r.showMask,d=r.maskStyle,h=y()(i,(e={},e[i+"-"+a]=!0,e[i+"-open"]=n,e[o]=!!o,e)),v=t.contextDom?t.contextDom.getBoundingClientRect()["left"===a||"right"===a?"width":"height"]:0,m="translate"+("left"===a||"right"===a?"X":"Y"),b=t.contextDom?v+"px":"100%",g="left"===a||"top"===a?"-"+b:b,x=n?"":m+"("+g+")";return(void 0===t.isOpenChange||t.isOpenChange)&&t.setLevelDomTransform(n,!1,m,v),f.a.createElement("div",{className:h,style:u},p&&f.a.createElement("div",{className:i+"-mask",onClick:t.onMaskTouchEnd,style:d,ref:function(e){t.maskDom=e}}),f.a.createElement("div",{className:i+"-content-wrapper",style:{transform:x}},f.a.createElement("div",{className:i+"-content",ref:function(e){t.contextDom=e}},c),s&&f.a.createElement("div",{className:i+"-handle",onClick:t.onIconTouchEnd,style:l,ref:function(e){t.handleDom=e}},s)))},this.defaultGetContainer=function(){if(m)return null;var e=document.createElement("div");return t.parent.appendChild(e),t.props.wrapperClassName&&(e.className=t.props.wrapperClassName),e}};e.a=b},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(28),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,o.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){t.exports={default:n(46),__esModule:!0}},function(t,e,n){n(47),n(59),t.exports=n(25).f("iterator")},function(t,e,n){"use strict";var r=n(48)(!0);n(29)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(15),o=n(16);t.exports=function(t){return function(e,n){var i,u,a=String(o(e)),c=r(n),s=a.length;return c<0||c>=s?t?"":void 0:(i=a.charCodeAt(c),i<55296||i>56319||c+1===s||(u=a.charCodeAt(c+1))<56320||u>57343?t?a.charAt(c):i:t?a.slice(c,c+2):u-56320+(i-55296<<10)+65536)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(19),o=n(13),i=n(24),u={};n(3)(u,n(8)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(4),o=n(9),i=n(20);t.exports=n(6)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),a=u.length,c=0;a>c;)r.f(t,n=u[c++],e[n]);return t}},function(t,e,n){var r=n(35);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(7),o=n(54),i=n(55);t.exports=function(t){return function(e,n,u){var a,c=r(e),s=o(c.length),f=i(u,s);if(t&&n!=n){for(;s>f;)if((a=c[f++])!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(15),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(15),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(1),o=n(58),i=n(21)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(16);t.exports=function(t){return Object(r(t))}},function(t,e,n){n(60);for(var r=n(0),o=n(3),i=n(18),u=n(8)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<a.length;c++){var s=a[c],f=r[s],l=f&&f.prototype;l&&!l[u]&&o(l,u,s),i[s]=i.Array}},function(t,e,n){"use strict";var r=n(61),o=n(62),i=n(18),u=n(7);t.exports=n(29)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(64),__esModule:!0}},function(t,e,n){n(65),n(70),n(71),n(72),t.exports=n(2).Symbol},function(t,e,n){"use strict";var r=n(0),o=n(1),i=n(6),u=n(11),a=n(33),c=n(66).KEY,s=n(12),f=n(22),l=n(24),p=n(14),d=n(8),h=n(25),y=n(26),v=n(67),m=n(68),b=n(9),g=n(5),x=n(7),O=n(17),_=n(13),w=n(19),S=n(69),E=n(38),T=n(4),C=n(20),j=E.f,P=T.f,k=S.f,M=r.Symbol,L=r.JSON,D=L&&L.stringify,N=d("_hidden"),A=d("toPrimitive"),R={}.propertyIsEnumerable,I=f("symbol-registry"),F=f("symbols"),G=f("op-symbols"),W=Object.prototype,q="function"==typeof M,H=r.QObject,V=!H||!H.prototype||!H.prototype.findChild,z=i&&s(function(){return 7!=w(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=j(W,e);r&&delete W[e],P(t,e,n),r&&t!==W&&P(W,e,r)}:P,B=function(t){var e=F[t]=w(M.prototype);return e._k=t,e},U=q&&"symbol"==typeof M.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof M},Y=function(t,e,n){return t===W&&Y(G,e,n),b(t),e=O(e,!0),b(n),o(F,e)?(n.enumerable?(o(t,N)&&t[N][e]&&(t[N][e]=!1),n=w(n,{enumerable:_(0,!1)})):(o(t,N)||P(t,N,_(1,{})),t[N][e]=!0),z(t,e,n)):P(t,e,n)},J=function(t,e){b(t);for(var n,r=v(e=x(e)),o=0,i=r.length;i>o;)Y(t,n=r[o++],e[n]);return t},K=function(t,e){return void 0===e?w(t):J(w(t),e)},Q=function(t){var e=R.call(this,t=O(t,!0));return!(this===W&&o(F,t)&&!o(G,t))&&(!(e||!o(this,t)||!o(F,t)||o(this,N)&&this[N][t])||e)},X=function(t,e){if(t=x(t),e=O(e,!0),t!==W||!o(F,e)||o(G,e)){var n=j(t,e);return!n||!o(F,e)||o(t,N)&&t[N][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=k(x(t)),r=[],i=0;n.length>i;)o(F,e=n[i++])||e==N||e==c||r.push(e);return r},$=function(t){for(var e,n=t===W,r=k(n?G:x(t)),i=[],u=0;r.length>u;)!o(F,e=r[u++])||n&&!o(W,e)||i.push(F[e]);return i};q||(M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===W&&e.call(G,n),o(this,N)&&o(this[N],t)&&(this[N][t]=!1),z(this,t,_(1,n))};return i&&V&&z(W,t,{configurable:!0,set:e}),B(t)},a(M.prototype,"toString",function(){return this._k}),E.f=X,T.f=Y,n(37).f=S.f=Z,n(27).f=Q,n(36).f=$,i&&!n(10)&&a(W,"propertyIsEnumerable",Q,!0),h.f=function(t){return B(d(t))}),u(u.G+u.W+u.F*!q,{Symbol:M});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)d(tt[et++]);for(var nt=C(d.store),rt=0;nt.length>rt;)y(nt[rt++]);u(u.S+u.F*!q,"Symbol",{for:function(t){return o(I,t+="")?I[t]:I[t]=M(t)},keyFor:function(t){if(!U(t))throw TypeError(t+" is not a symbol!");for(var e in I)if(I[e]===t)return e},useSetter:function(){V=!0},useSimple:function(){V=!1}}),u(u.S+u.F*!q,"Object",{create:K,defineProperty:Y,defineProperties:J,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:$}),L&&u(u.S+u.F*(!q||s(function(){var t=M();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(g(e)||void 0!==t)&&!U(t))return m(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!U(e))return e}),r[1]=e,D.apply(L,r)}}),M.prototype[A]||n(3)(M.prototype,A,M.prototype.valueOf),l(M,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(14)("meta"),o=n(5),i=n(1),u=n(4).f,a=0,c=Object.isExtensible||function(){return!0},s=!n(12)(function(){return c(Object.preventExtensions({}))}),f=function(t){u(t,r,{value:{i:"O"+ ++a,w:{}}})},l=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[r].i},p=function(t,e){if(!i(t,r)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[r].w},d=function(t){return s&&h.NEED&&c(t)&&!i(t,r)&&f(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:d}},function(t,e,n){var r=n(20),o=n(36),i=n(27);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var u,a=n(t),c=i.f,s=0;a.length>s;)c.call(t,u=a[s++])&&e.push(u);return e}},function(t,e,n){var r=n(35);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(7),o=n(37).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return o(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?a(t):o(r(t))}},function(t,e){},function(t,e,n){n(26)("asyncIterator")},function(t,e,n){n(26)("observable")},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(74),i=r(o),u=n(78),a=r(u),c=n(28),s=r(c);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,s.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(i.default?(0,i.default)(t,e):t.__proto__=e)}},function(t,e,n){t.exports={default:n(75),__esModule:!0}},function(t,e,n){n(76),t.exports=n(2).Object.setPrototypeOf},function(t,e,n){var r=n(11);r(r.S,"Object",{setPrototypeOf:n(77).set})},function(t,e,n){var r=n(5),o=n(9),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(30)(Function.call,n(38).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},function(t,e,n){t.exports={default:n(79),__esModule:!0}},function(t,e,n){n(80);var r=n(2).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(11);r(r.S,"Object",{create:n(19)})},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(84)()},function(t,e,n){"use strict";var r=n(85),o=n(86),i=n(87);t.exports=function(){function t(t,e,n,r,u,a){a!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,n){"use strict";function r(t,e,n,r,i,u,a,c){if(o(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,i,u,a,c],l=0;s=new Error(e.replace(/%s/g,function(){return f[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(t){};t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){var r,o;!function(){"use strict";function n(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var o=typeof r;if("string"===o||"number"===o)t.push(r);else if(Array.isArray(r)&&r.length){var u=n.apply(null,r);u&&t.push(u)}else if("object"===o)for(var a in r)i.call(r,a)&&r[a]&&t.push(a)}}return t.join(" ")}var i={}.hasOwnProperty;void 0!==t&&t.exports?(n.default=n,t.exports=n):(r=[],void 0!==(o=function(){return n}.apply(e,r))&&(t.exports=o))}()},function(t,e,n){"use strict";function r(t){return Array.isArray(t)?t:[t]}e.a=r,n.d(e,"b",function(){return u});var o={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(o).filter(function(t){return"undefined"!=typeof document&&t in(document.body&&document.body.style)})[0],u=o[i]}]).default}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports["rc-drawer"]=e(require("react"),require("react-dom")):t["rc-drawer"]=e(t.React,t.ReactDOM)}("undefined"!=typeof self?self:this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=39)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(4),o=n(13);t.exports=n(6)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(9),o=n(31),i=n(17),u=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(52),o=n(16);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(22)("wks"),o=n(14),i=n(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(0),o=n(2),i=n(30),u=n(3),a=n(1),c=function(t,e,n){var s,f,l,p=t&c.F,d=t&c.G,h=t&c.S,y=t&c.P,v=t&c.B,m=t&c.W,b=d?o:o[e]||(o[e]={}),g=b.prototype,x=d?r:h?r[e]:(r[e]||{}).prototype;d&&(n=e);for(s in n)(f=!p&&x&&void 0!==x[s])&&a(b,s)||(l=f?x[s]:n[s],b[s]=d&&"function"!=typeof x[s]?n[s]:v&&f?i(l,r):m&&x[s]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):y&&"function"==typeof l?i(Function.call,l):l,y&&((b.virtual||(b.virtual={}))[s]=l,t&c.R&&g&&!g[s]&&u(g,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(5);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports={}},function(t,e,n){var r=n(9),o=n(51),i=n(23),u=n(21)("IE_PROTO"),a=function(){},c=function(){var t,e=n(32)("iframe"),r=i.length;for(e.style.display="none",n(56).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[u]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(34),o=n(23);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(22)("keys"),o=n(14);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(2),o=n(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(10)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(4).f,o=n(1),i=n(8)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(8)},function(t,e,n){var r=n(0),o=n(2),i=n(10),u=n(25),a=n(4).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:u.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(45),i=r(o),u=n(63),a=r(u),c="function"==typeof a.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===c(i.default)?function(t){return void 0===t?"undefined":c(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":c(t)}},function(t,e,n){"use strict";var r=n(10),o=n(11),i=n(33),u=n(3),a=n(18),c=n(50),s=n(24),f=n(57),l=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,h,y,v,m){c(n,e,h);var b,g,x,O=function(t){if(!p&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",_="values"==y,S=!1,E=t.prototype,T=E[l]||E["@@iterator"]||y&&E[y],C=T||O(y),j=y?_?O("entries"):C:void 0,P="Array"==e?E.entries||T:T;if(P&&(x=f(P.call(new t)))!==Object.prototype&&x.next&&(s(x,w,!0),r||"function"==typeof x[l]||u(x,l,d)),_&&T&&"values"!==T.name&&(S=!0,C=function(){return T.call(this)}),r&&!m||!p&&!S&&E[l]||u(E,l,C),a[e]=C,a[w]=d,y)if(b={values:_?C:O("values"),keys:v?C:O("keys"),entries:j},m)for(g in b)g in E||i(E,g,b[g]);else o(o.P+o.F*(p||S),e,b);return b}},function(t,e,n){var r=n(49);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(6)&&!n(12)(function(){return 7!=Object.defineProperty(n(32)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(5),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=n(1),o=n(7),i=n(53)(!1),u=n(21)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),c=0,s=[];for(n in a)n!=u&&r(a,n)&&s.push(n);for(;e.length>c;)r(a,n=e[c++])&&(~i(s,n)||s.push(n));return s}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(34),o=n(23).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(27),o=n(13),i=n(7),u=n(17),a=n(1),c=n(31),s=Object.getOwnPropertyDescriptor;e.f=n(6)?s:function(t,e){if(t=i(t),e=u(e,!0),c)try{return s(t,e)}catch(t){}if(a(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){n(40),t.exports=n(41)},function(t,e){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(42);e.default=r.a},function(t,e,n){"use strict";var r=n(43),o=n.n(r),i=n(44),u=n.n(i),a=n(73),c=n.n(a),s=n(81),f=n.n(s),l=n(82),p=(n.n(l),n(83)),d=n.n(p),h=n(88),y=n.n(h),v=n(89),m="undefined"==typeof window,b=function(t){function e(n){o()(this,e);var r=u()(this,t.call(this,n));return g.call(r),r.levelDom=[],r.contextDom=null,r.maskDom=null,r.handleDom=null,r.mousePos=null,(n.onIconClick||n.parent||n.iconChild||n.width)&&console.warn("rc-drawer-menu API has been changed, please look at the releases, https://github.com/react-component/drawer-menu/releases"),r.state={open:void 0!==n.open?n.open:!!n.defaultOpen},r}return c()(e,t),e.prototype.componentDidMount=function(){this.getParentAndLevelDom(this.props),(this.props.getContainer||this.props.parent)&&(this.container=this.defaultGetContainer()),this.forceUpdate()},e.prototype.componentWillReceiveProps=function(t){var e=t.open,n=t.placement;void 0!==e&&e!==this.props.open&&(this.isOpenChange=!0,this.setState({open:e})),n!==this.props.placement&&(this.contextDom=null),this.props.level!==t.level&&this.getParentAndLevelDom(t)},e.prototype.componentWillUnmount=function(){this.container&&(this.setLevelDomTransform(!1,!0),this.props.getContainer&&this.container.parentNode.removeChild(this.container))},e.prototype.render=function(){var t=this,e=this.getChildToRender();return this.props.getContainer?this.container?Object(l.createPortal)(e,this.container):null:f.a.createElement("div",{className:this.props.wrapperClassName,ref:function(e){t.container=e}},e)},e}(f.a.PureComponent);b.propTypes={wrapperClassName:d.a.string,className:d.a.string,children:d.a.node,style:d.a.object,defaultOpen:d.a.bool,open:d.a.bool,prefixCls:d.a.string,placement:d.a.string,level:d.a.oneOfType([d.a.string,d.a.array]),levelTransition:d.a.string,getContainer:d.a.oneOfType([d.a.string,d.a.func,d.a.object]),handleChild:d.a.any,handleStyle:d.a.object,onChange:d.a.func,onMaskClick:d.a.func,onHandleClick:d.a.func,showMask:d.a.bool,maskStyle:d.a.object},b.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",level:"all",levelTransition:"transform .3s cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},onMaskClick:function(){},onHandleClick:function(){},handleChild:f.a.createElement("i",{className:"drawer-handle-icon"}),handleStyle:{},showMask:!0,maskStyle:{},wrapperClassName:"",className:""};var g=function(){var t=this;this.onMaskTouchEnd=function(e){t.props.onMaskClick(e),t.onTouchEnd(e,!0)},this.onIconTouchEnd=function(e){t.props.onHandleClick(e),t.onTouchEnd(e)},this.onTouchEnd=function(e,n){if(void 0===t.props.open){var r=n||t.state.open;t.isOpenChange=!0,t.setState({open:!r})}},this.getParentAndLevelDom=function(e){if(!m){var n=e.level,r=e.getContainer;if(t.levelDom=[],r){if("string"==typeof r){var o=document.querySelectorAll(r)[0];t.parent=o}"function"==typeof r&&(t.parent=r()),"object"==typeof r&&r instanceof window.HTMLElement&&(t.parent=r)}if(!r&&t.container&&(t.parent=t.container.parentNode),"all"===n){Array.prototype.slice.call(t.parent.children).forEach(function(e){"SCRIPT"!==e.nodeName&&"STYLE"!==e.nodeName&&e!==t.container&&t.levelDom.push(e)})}else n&&Object(v.a)(n).forEach(function(e){document.querySelectorAll(e).forEach(function(e){t.levelDom.push(e)})})}},this.setLevelDomTransform=function(e,n,r,o){var i=t.props,u=i.placement,a=i.levelTransition,c=i.onChange;t.levelDom.forEach(function(i){(t.isOpenChange||n)&&(i.style.transition=a,i.addEventListener(v.b,t.trnasitionEnd));var c="left"===u||"top"===u?o:-o;i.style.transform=e?r+"("+c+"px)":""}),m||(e?(t.bodyDefaultOverflow=document.body.style.overflow,document.body.style.overflow="hidden"):(document.body.style.overflow=t.bodyDefaultOverflow,delete t.bodyDefaultOverflow)),c&&t.isOpenChange&&(c(e),t.isOpenChange=!1)},this.getChildToRender=function(){var e,n=void 0!==t.props.open?t.props.open:t.state.open,r=t.props,o=r.className,i=r.prefixCls,u=r.style,a=r.placement,c=r.children,s=r.handleChild,l=r.handleStyle,p=r.showMask,d=r.maskStyle,h=y()(i,(e={},e[i+"-"+a]=!0,e[i+"-open"]=n,e[o]=!!o,e)),v=t.contextDom?t.contextDom.getBoundingClientRect()["left"===a||"right"===a?"width":"height"]:0,m="translate"+("left"===a||"right"===a?"X":"Y"),b=t.contextDom?v+"px":"100%",g="left"===a||"top"===a?"-"+b:b,x=n?"":m+"("+g+")";return(void 0===t.isOpenChange||t.isOpenChange)&&t.setLevelDomTransform(n,!1,m,v),f.a.createElement("div",{className:h,style:u},p&&f.a.createElement("div",{className:i+"-mask",onClick:t.onMaskTouchEnd,style:d,ref:function(e){t.maskDom=e}}),f.a.createElement("div",{className:i+"-content-wrapper",style:{transform:x}},f.a.createElement("div",{className:i+"-content",ref:function(e){t.contextDom=e}},c),s&&f.a.createElement("div",{className:i+"-handle",onClick:t.onIconTouchEnd,style:l,ref:function(e){t.handleDom=e}},s)))},this.trnasitionEnd=function(e){var n=e.target;n.removeEventListener(v.b,t.trnasitionEnd),n.style.transition=""},this.defaultGetContainer=function(){if(m)return null;var e=document.createElement("div");return t.parent.appendChild(e),t.props.wrapperClassName&&(e.className=t.props.wrapperClassName),e}};e.a=b},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(28),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,o.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){t.exports={default:n(46),__esModule:!0}},function(t,e,n){n(47),n(59),t.exports=n(25).f("iterator")},function(t,e,n){"use strict";var r=n(48)(!0);n(29)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(15),o=n(16);t.exports=function(t){return function(e,n){var i,u,a=String(o(e)),c=r(n),s=a.length;return c<0||c>=s?t?"":void 0:(i=a.charCodeAt(c),i<55296||i>56319||c+1===s||(u=a.charCodeAt(c+1))<56320||u>57343?t?a.charAt(c):i:t?a.slice(c,c+2):u-56320+(i-55296<<10)+65536)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(19),o=n(13),i=n(24),u={};n(3)(u,n(8)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(4),o=n(9),i=n(20);t.exports=n(6)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),a=u.length,c=0;a>c;)r.f(t,n=u[c++],e[n]);return t}},function(t,e,n){var r=n(35);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(7),o=n(54),i=n(55);t.exports=function(t){return function(e,n,u){var a,c=r(e),s=o(c.length),f=i(u,s);if(t&&n!=n){for(;s>f;)if((a=c[f++])!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(15),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(15),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(1),o=n(58),i=n(21)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(16);t.exports=function(t){return Object(r(t))}},function(t,e,n){n(60);for(var r=n(0),o=n(3),i=n(18),u=n(8)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<a.length;c++){var s=a[c],f=r[s],l=f&&f.prototype;l&&!l[u]&&o(l,u,s),i[s]=i.Array}},function(t,e,n){"use strict";var r=n(61),o=n(62),i=n(18),u=n(7);t.exports=n(29)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(64),__esModule:!0}},function(t,e,n){n(65),n(70),n(71),n(72),t.exports=n(2).Symbol},function(t,e,n){"use strict";var r=n(0),o=n(1),i=n(6),u=n(11),a=n(33),c=n(66).KEY,s=n(12),f=n(22),l=n(24),p=n(14),d=n(8),h=n(25),y=n(26),v=n(67),m=n(68),b=n(9),g=n(5),x=n(7),O=n(17),w=n(13),_=n(19),S=n(69),E=n(38),T=n(4),C=n(20),j=E.f,P=T.f,k=S.f,M=r.Symbol,L=r.JSON,D=L&&L.stringify,N=d("_hidden"),A=d("toPrimitive"),R={}.propertyIsEnumerable,I=f("symbol-registry"),F=f("symbols"),G=f("op-symbols"),W=Object.prototype,H="function"==typeof M,q=r.QObject,V=!q||!q.prototype||!q.prototype.findChild,z=i&&s(function(){return 7!=_(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=j(W,e);r&&delete W[e],P(t,e,n),r&&t!==W&&P(W,e,r)}:P,B=function(t){var e=F[t]=_(M.prototype);return e._k=t,e},U=H&&"symbol"==typeof M.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof M},Y=function(t,e,n){return t===W&&Y(G,e,n),b(t),e=O(e,!0),b(n),o(F,e)?(n.enumerable?(o(t,N)&&t[N][e]&&(t[N][e]=!1),n=_(n,{enumerable:w(0,!1)})):(o(t,N)||P(t,N,w(1,{})),t[N][e]=!0),z(t,e,n)):P(t,e,n)},J=function(t,e){b(t);for(var n,r=v(e=x(e)),o=0,i=r.length;i>o;)Y(t,n=r[o++],e[n]);return t},K=function(t,e){return void 0===e?_(t):J(_(t),e)},Q=function(t){var e=R.call(this,t=O(t,!0));return!(this===W&&o(F,t)&&!o(G,t))&&(!(e||!o(this,t)||!o(F,t)||o(this,N)&&this[N][t])||e)},X=function(t,e){if(t=x(t),e=O(e,!0),t!==W||!o(F,e)||o(G,e)){var n=j(t,e);return!n||!o(F,e)||o(t,N)&&t[N][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=k(x(t)),r=[],i=0;n.length>i;)o(F,e=n[i++])||e==N||e==c||r.push(e);return r},$=function(t){for(var e,n=t===W,r=k(n?G:x(t)),i=[],u=0;r.length>u;)!o(F,e=r[u++])||n&&!o(W,e)||i.push(F[e]);return i};H||(M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===W&&e.call(G,n),o(this,N)&&o(this[N],t)&&(this[N][t]=!1),z(this,t,w(1,n))};return i&&V&&z(W,t,{configurable:!0,set:e}),B(t)},a(M.prototype,"toString",function(){return this._k}),E.f=X,T.f=Y,n(37).f=S.f=Z,n(27).f=Q,n(36).f=$,i&&!n(10)&&a(W,"propertyIsEnumerable",Q,!0),h.f=function(t){return B(d(t))}),u(u.G+u.W+u.F*!H,{Symbol:M});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)d(tt[et++]);for(var nt=C(d.store),rt=0;nt.length>rt;)y(nt[rt++]);u(u.S+u.F*!H,"Symbol",{for:function(t){return o(I,t+="")?I[t]:I[t]=M(t)},keyFor:function(t){if(!U(t))throw TypeError(t+" is not a symbol!");for(var e in I)if(I[e]===t)return e},useSetter:function(){V=!0},useSimple:function(){V=!1}}),u(u.S+u.F*!H,"Object",{create:K,defineProperty:Y,defineProperties:J,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:$}),L&&u(u.S+u.F*(!H||s(function(){var t=M();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(g(e)||void 0!==t)&&!U(t))return m(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!U(e))return e}),r[1]=e,D.apply(L,r)}}),M.prototype[A]||n(3)(M.prototype,A,M.prototype.valueOf),l(M,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(14)("meta"),o=n(5),i=n(1),u=n(4).f,a=0,c=Object.isExtensible||function(){return!0},s=!n(12)(function(){return c(Object.preventExtensions({}))}),f=function(t){u(t,r,{value:{i:"O"+ ++a,w:{}}})},l=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[r].i},p=function(t,e){if(!i(t,r)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[r].w},d=function(t){return s&&h.NEED&&c(t)&&!i(t,r)&&f(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:d}},function(t,e,n){var r=n(20),o=n(36),i=n(27);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var u,a=n(t),c=i.f,s=0;a.length>s;)c.call(t,u=a[s++])&&e.push(u);return e}},function(t,e,n){var r=n(35);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(7),o=n(37).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return o(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?a(t):o(r(t))}},function(t,e){},function(t,e,n){n(26)("asyncIterator")},function(t,e,n){n(26)("observable")},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(74),i=r(o),u=n(78),a=r(u),c=n(28),s=r(c);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,s.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(i.default?(0,i.default)(t,e):t.__proto__=e)}},function(t,e,n){t.exports={default:n(75),__esModule:!0}},function(t,e,n){n(76),t.exports=n(2).Object.setPrototypeOf},function(t,e,n){var r=n(11);r(r.S,"Object",{setPrototypeOf:n(77).set})},function(t,e,n){var r=n(5),o=n(9),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(30)(Function.call,n(38).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},function(t,e,n){t.exports={default:n(79),__esModule:!0}},function(t,e,n){n(80);var r=n(2).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(11);r(r.S,"Object",{create:n(19)})},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(84)()},function(t,e,n){"use strict";var r=n(85),o=n(86),i=n(87);t.exports=function(){function t(t,e,n,r,u,a){a!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,n){"use strict";function r(t,e,n,r,i,u,a,c){if(o(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,i,u,a,c],l=0;s=new Error(e.replace(/%s/g,function(){return f[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(t){};t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){var r,o;!function(){"use strict";function n(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var o=typeof r;if("string"===o||"number"===o)t.push(r);else if(Array.isArray(r)&&r.length){var u=n.apply(null,r);u&&t.push(u)}else if("object"===o)for(var a in r)i.call(r,a)&&r[a]&&t.push(a)}}return t.join(" ")}var i={}.hasOwnProperty;void 0!==t&&t.exports?(n.default=n,t.exports=n):(r=[],void 0!==(o=function(){return n}.apply(e,r))&&(t.exports=o))}()},function(t,e,n){"use strict";function r(t){return Array.isArray(t)?t:[t]}e.a=r,n.d(e,"b",function(){return u});var o={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(o).filter(function(t){return"undefined"!=typeof document&&t in(document.body&&document.body.style)})[0],u=o[i]}]).default}); |
109
es/Drawer.js
@@ -22,3 +22,10 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
_this.levelDom = []; | ||
_this.contextDom = null; | ||
_this.maskDom = null; | ||
_this.handleDom = null; | ||
_this.mousePos = null; | ||
if (props.onIconClick || props.parent || props.iconChild || props.width) { | ||
// eslint-disable-line react/prop-types | ||
/* eslint-disable no-console */ | ||
console.warn('rc-drawer-menu API has been changed, please look at the releases, ' + 'https://github.com/react-component/drawer-menu/releases'); | ||
@@ -76,5 +83,8 @@ } | ||
'div', | ||
{ className: this.props.wrapperClassName, ref: function ref(c) { | ||
{ | ||
className: this.props.wrapperClassName, | ||
ref: function ref(c) { | ||
_this2.container = c; | ||
} }, | ||
} | ||
}, | ||
children | ||
@@ -94,9 +104,12 @@ ); | ||
wrapperClassName: PropTypes.string, | ||
className: PropTypes.string, | ||
children: PropTypes.node, | ||
style: PropTypes.object, | ||
defaultOpen: PropTypes.bool, | ||
open: PropTypes.bool, | ||
bodyStyle: PropTypes.object, | ||
defaultOpen: PropTypes.bool, | ||
prefixCls: PropTypes.string, | ||
placement: PropTypes.string, | ||
level: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), | ||
levelTransition: PropTypes.string, | ||
getContainer: PropTypes.string, | ||
getContainer: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]), | ||
handleChild: PropTypes.any, | ||
@@ -111,3 +124,2 @@ handleStyle: PropTypes.object, | ||
Drawer.defaultProps = { | ||
className: '', | ||
prefixCls: 'drawer', | ||
@@ -124,3 +136,5 @@ placement: 'left', | ||
showMask: true, | ||
maskStyle: {} | ||
maskStyle: {}, | ||
wrapperClassName: '', | ||
className: '' | ||
}; | ||
@@ -131,8 +145,24 @@ | ||
this.levelDom = []; | ||
this.contextDom = null; | ||
this.maskDom = null; | ||
this.handleDom = null; | ||
this.mousePos = null; | ||
this.onMaskTouchEnd = function (e) { | ||
_this3.props.onMaskClick(e); | ||
_this3.onTouchEnd(e, true); | ||
}; | ||
this.onIconTouchEnd = function (e) { | ||
_this3.props.onHandleClick(e); | ||
_this3.onTouchEnd(e); | ||
}; | ||
this.onTouchEnd = function (e, close) { | ||
if (_this3.props.open !== undefined) { | ||
return; | ||
} | ||
var open = close || _this3.state.open; | ||
_this3.isOpenChange = true; | ||
_this3.setState({ | ||
open: !open | ||
}); | ||
}; | ||
this.getParentAndLevelDom = function (props) { | ||
@@ -146,3 +176,17 @@ if (windowIsUndefined) { | ||
_this3.levelDom = []; | ||
_this3.parent = getContainer && document.querySelectorAll(getContainer)[0] || _this3.container.parentNode; | ||
if (getContainer) { | ||
if (typeof getContainer === 'string') { | ||
var dom = document.querySelectorAll(getContainer)[0]; | ||
_this3.parent = dom; | ||
} | ||
if (typeof getContainer === 'function') { | ||
_this3.parent = getContainer(); | ||
} | ||
if (typeof getContainer === 'object' && getContainer instanceof window.HTMLElement) { | ||
_this3.parent = getContainer; | ||
} | ||
} | ||
if (!getContainer && _this3.container) { | ||
_this3.parent = _this3.container.parentNode; | ||
} | ||
if (level === 'all') { | ||
@@ -164,29 +208,2 @@ var children = Array.prototype.slice.call(_this3.parent.children); | ||
this.trnasitionEnd = function (e) { | ||
var dom = e.target; | ||
dom.removeEventListener(transitionEnd, _this3.trnasitionEnd); | ||
dom.style.transition = ''; | ||
}; | ||
this.onTouchEnd = function (e, close) { | ||
if (_this3.props.open !== undefined) { | ||
return; | ||
} | ||
var open = close || _this3.state.open; | ||
_this3.isOpenChange = true; | ||
_this3.setState({ | ||
open: !open | ||
}); | ||
}; | ||
this.onMaskTouchEnd = function (e) { | ||
_this3.props.onMaskClick(e); | ||
_this3.onTouchEnd(e, true); | ||
}; | ||
this.onIconTouchEnd = function (e) { | ||
_this3.props.onHandleClick(e); | ||
_this3.onTouchEnd(e); | ||
}; | ||
this.setLevelDomTransform = function (open, openTransition, placementName, value) { | ||
@@ -200,2 +217,3 @@ var _props = _this3.props, | ||
if (_this3.isOpenChange || openTransition) { | ||
/* eslint no-param-reassign: "error" */ | ||
dom.style.transition = levelTransition; | ||
@@ -261,6 +279,3 @@ dom.addEventListener(transitionEnd, _this3.trnasitionEnd); | ||
'div', | ||
{ | ||
className: prefixCls + '-content-wrapper', | ||
style: { transform: transform } | ||
}, | ||
{ className: prefixCls + '-content-wrapper', style: { transform: transform } }, | ||
React.createElement( | ||
@@ -292,2 +307,8 @@ 'div', | ||
this.trnasitionEnd = function (e) { | ||
var dom = e.target; | ||
dom.removeEventListener(transitionEnd, _this3.trnasitionEnd); | ||
dom.style.transition = ''; | ||
}; | ||
this.defaultGetContainer = function () { | ||
@@ -294,0 +315,0 @@ if (windowIsUndefined) { |
@@ -47,3 +47,10 @@ 'use strict'; | ||
_this.levelDom = []; | ||
_this.contextDom = null; | ||
_this.maskDom = null; | ||
_this.handleDom = null; | ||
_this.mousePos = null; | ||
if (props.onIconClick || props.parent || props.iconChild || props.width) { | ||
// eslint-disable-line react/prop-types | ||
/* eslint-disable no-console */ | ||
console.warn('rc-drawer-menu API has been changed, please look at the releases, ' + 'https://github.com/react-component/drawer-menu/releases'); | ||
@@ -101,5 +108,8 @@ } | ||
'div', | ||
{ className: this.props.wrapperClassName, ref: function ref(c) { | ||
{ | ||
className: this.props.wrapperClassName, | ||
ref: function ref(c) { | ||
_this2.container = c; | ||
} }, | ||
} | ||
}, | ||
children | ||
@@ -119,9 +129,12 @@ ); | ||
wrapperClassName: _propTypes2['default'].string, | ||
className: _propTypes2['default'].string, | ||
children: _propTypes2['default'].node, | ||
style: _propTypes2['default'].object, | ||
defaultOpen: _propTypes2['default'].bool, | ||
open: _propTypes2['default'].bool, | ||
bodyStyle: _propTypes2['default'].object, | ||
defaultOpen: _propTypes2['default'].bool, | ||
prefixCls: _propTypes2['default'].string, | ||
placement: _propTypes2['default'].string, | ||
level: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].array]), | ||
levelTransition: _propTypes2['default'].string, | ||
getContainer: _propTypes2['default'].string, | ||
getContainer: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].object]), | ||
handleChild: _propTypes2['default'].any, | ||
@@ -136,3 +149,2 @@ handleStyle: _propTypes2['default'].object, | ||
Drawer.defaultProps = { | ||
className: '', | ||
prefixCls: 'drawer', | ||
@@ -149,3 +161,5 @@ placement: 'left', | ||
showMask: true, | ||
maskStyle: {} | ||
maskStyle: {}, | ||
wrapperClassName: '', | ||
className: '' | ||
}; | ||
@@ -156,8 +170,24 @@ | ||
this.levelDom = []; | ||
this.contextDom = null; | ||
this.maskDom = null; | ||
this.handleDom = null; | ||
this.mousePos = null; | ||
this.onMaskTouchEnd = function (e) { | ||
_this3.props.onMaskClick(e); | ||
_this3.onTouchEnd(e, true); | ||
}; | ||
this.onIconTouchEnd = function (e) { | ||
_this3.props.onHandleClick(e); | ||
_this3.onTouchEnd(e); | ||
}; | ||
this.onTouchEnd = function (e, close) { | ||
if (_this3.props.open !== undefined) { | ||
return; | ||
} | ||
var open = close || _this3.state.open; | ||
_this3.isOpenChange = true; | ||
_this3.setState({ | ||
open: !open | ||
}); | ||
}; | ||
this.getParentAndLevelDom = function (props) { | ||
@@ -171,3 +201,17 @@ if (windowIsUndefined) { | ||
_this3.levelDom = []; | ||
_this3.parent = getContainer && document.querySelectorAll(getContainer)[0] || _this3.container.parentNode; | ||
if (getContainer) { | ||
if (typeof getContainer === 'string') { | ||
var dom = document.querySelectorAll(getContainer)[0]; | ||
_this3.parent = dom; | ||
} | ||
if (typeof getContainer === 'function') { | ||
_this3.parent = getContainer(); | ||
} | ||
if (typeof getContainer === 'object' && getContainer instanceof window.HTMLElement) { | ||
_this3.parent = getContainer; | ||
} | ||
} | ||
if (!getContainer && _this3.container) { | ||
_this3.parent = _this3.container.parentNode; | ||
} | ||
if (level === 'all') { | ||
@@ -189,29 +233,2 @@ var children = Array.prototype.slice.call(_this3.parent.children); | ||
this.trnasitionEnd = function (e) { | ||
var dom = e.target; | ||
dom.removeEventListener(_utils.transitionEnd, _this3.trnasitionEnd); | ||
dom.style.transition = ''; | ||
}; | ||
this.onTouchEnd = function (e, close) { | ||
if (_this3.props.open !== undefined) { | ||
return; | ||
} | ||
var open = close || _this3.state.open; | ||
_this3.isOpenChange = true; | ||
_this3.setState({ | ||
open: !open | ||
}); | ||
}; | ||
this.onMaskTouchEnd = function (e) { | ||
_this3.props.onMaskClick(e); | ||
_this3.onTouchEnd(e, true); | ||
}; | ||
this.onIconTouchEnd = function (e) { | ||
_this3.props.onHandleClick(e); | ||
_this3.onTouchEnd(e); | ||
}; | ||
this.setLevelDomTransform = function (open, openTransition, placementName, value) { | ||
@@ -225,2 +242,3 @@ var _props = _this3.props, | ||
if (_this3.isOpenChange || openTransition) { | ||
/* eslint no-param-reassign: "error" */ | ||
dom.style.transition = levelTransition; | ||
@@ -286,6 +304,3 @@ dom.addEventListener(_utils.transitionEnd, _this3.trnasitionEnd); | ||
'div', | ||
{ | ||
className: prefixCls + '-content-wrapper', | ||
style: { transform: transform } | ||
}, | ||
{ className: prefixCls + '-content-wrapper', style: { transform: transform } }, | ||
_react2['default'].createElement( | ||
@@ -317,2 +332,8 @@ 'div', | ||
this.trnasitionEnd = function (e) { | ||
var dom = e.target; | ||
dom.removeEventListener(_utils.transitionEnd, _this3.trnasitionEnd); | ||
dom.style.transition = ''; | ||
}; | ||
this.defaultGetContainer = function () { | ||
@@ -319,0 +340,0 @@ if (windowIsUndefined) { |
{ | ||
"name": "rc-drawer", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "drawer component for react", | ||
@@ -67,3 +67,3 @@ "keywords": [ | ||
"raf": "^3.4.0", | ||
"rc-tools": "7.x", | ||
"rc-tools": "^8.1.1", | ||
"react": "^16.0.0", | ||
@@ -94,2 +94,2 @@ "react-dom": "^16.0.0" | ||
} | ||
} | ||
} |
@@ -61,3 +61,3 @@ # rc-drawer | ||
| levelTransition | string | `transform .3s cubic-bezier(0.78, 0.14, 0.15, 0.86)` | level css transition | | ||
| getContainer | string | `body` | Return the mount node for Drawer. if is `null` use React.creactElement | | ||
| getContainer | string or func or HTMLElement | `body` | Return the mount node for Drawer. if is `null` use React.creactElement | | ||
| showMask | boolean | true | mask is show | | ||
@@ -64,0 +64,0 @@ | maskStyle | object | null | mask style | |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
312189
3775