react-modal
Advanced tools
Comparing version 1.7.3 to 1.7.4
@@ -0,1 +1,7 @@ | ||
v1.7.4 - Thu, 13 Apr 2017 13:37:19 GMT | ||
-------------------------------------- | ||
- | ||
v1.7.3 - Tue, 14 Mar 2017 01:22:00 GMT | ||
@@ -2,0 +8,0 @@ -------------------------------------- |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactModal=t(require("react"),require("react-dom")):e.ReactModal=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";e.exports=n(1)},function(e,t,n){"use strict";function o(e){return e()}var r=n(2),s=n(3),i=n(4),c=r.createFactory(n(5)),a=n(10),l=n(11),u=n(3).unstable_renderSubtreeIntoContainer,p=n(9),f=i.canUseDOM?window.HTMLElement:{},d=i.canUseDOM?document.body:{appendChild:function(){}},h=r.createClass({displayName:"Modal",statics:{setAppElement:function(e){d=a.setElement(e)},injectCSS:function(){console.warn("React-Modal: injectCSS has been deprecated and no longer has any effect. It will be removed in a later version")}},propTypes:{isOpen:r.PropTypes.bool.isRequired,style:r.PropTypes.shape({content:r.PropTypes.object,overlay:r.PropTypes.object}),portalClassName:r.PropTypes.string,appElement:r.PropTypes.instanceOf(f),onAfterOpen:r.PropTypes.func,onRequestClose:r.PropTypes.func,closeTimeoutMS:r.PropTypes.number,ariaHideApp:r.PropTypes.bool,shouldCloseOnOverlayClick:r.PropTypes.bool,parentSelector:r.PropTypes.func,role:r.PropTypes.string,contentLabel:r.PropTypes.string.isRequired},getDefaultProps:function(){return{isOpen:!1,portalClassName:"ReactModalPortal",ariaHideApp:!0,closeTimeoutMS:0,shouldCloseOnOverlayClick:!0,parentSelector:function(){return document.body}}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className=this.props.portalClassName;var e=o(this.props.parentSelector);e.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){var t=o(this.props.parentSelector),n=o(e.parentSelector);n!==t&&(t.removeChild(this.node),n.appendChild(this.node)),this.renderPortal(e)},componentWillUnmount:function(){this.props.ariaHideApp&&a.show(this.props.appElement);var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);if(n){e.beforeClose||this.portal.closeWithTimeout();var o=this;setTimeout(function(){o.removePortal()},n-t)}else this.removePortal()},removePortal:function(){s.unmountComponentAtNode(this.node);var e=o(this.props.parentSelector);e.removeChild(this.node),l(document.body).remove("ReactModal__Body--open")},renderPortal:function(e){e.isOpen?l(document.body).add("ReactModal__Body--open"):l(document.body).remove("ReactModal__Body--open"),e.ariaHideApp&&a.toggle(e.isOpen,e.appElement),this.portal=u(this,c(p({},e,{defaultStyles:h.defaultStyles})),this.node)},render:function(){return r.DOM.noscript()}});h.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},e.exports=h},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){var o;/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactModal=t(require("react"),require("react-dom")):e.ReactModal=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";e.exports=n(1)},function(e,t,n){"use strict";function o(e){return e()}var r=n(2),i=n(3),s=n(4),a=n(12),u=r.createFactory(n(13)),c=n(22),l=n(23),p=n(24),f=n(3).unstable_renderSubtreeIntoContainer,d=n(17),h=n(18),m=a.canUseDOM?window.HTMLElement:{},y=a.canUseDOM?document.body:{appendChild:function(){}},v=h({displayName:"Modal",statics:{setAppElement:function(e){y=c.setElement(e)},injectCSS:function(){console.warn("React-Modal: injectCSS has been deprecated and no longer has any effect. It will be removed in a later version")}},propTypes:{isOpen:s.bool.isRequired,style:s.shape({content:s.object,overlay:s.object}),portalClassName:s.string,appElement:s.instanceOf(m),onAfterOpen:s.func,onRequestClose:s.func,closeTimeoutMS:s.number,ariaHideApp:s.bool,shouldCloseOnOverlayClick:s.bool,parentSelector:s.func,role:s.string,contentLabel:s.string.isRequired},getDefaultProps:function(){return{isOpen:!1,portalClassName:"ReactModalPortal",ariaHideApp:!0,closeTimeoutMS:0,shouldCloseOnOverlayClick:!0,parentSelector:function(){return document.body}}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className=this.props.portalClassName,this.props.isOpen&&l.add(this);var e=o(this.props.parentSelector);e.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){e.isOpen&&l.add(this),e.isOpen||l.remove(this);var t=o(this.props.parentSelector),n=o(e.parentSelector);n!==t&&(t.removeChild(this.node),n.appendChild(this.node)),this.renderPortal(e)},componentWillUnmount:function(){l.remove(this),this.props.ariaHideApp&&c.show(this.props.appElement);var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);if(n){e.beforeClose||this.portal.closeWithTimeout();var o=this;setTimeout(function(){o.removePortal()},n-t)}else this.removePortal()},removePortal:function(){i.unmountComponentAtNode(this.node);var e=o(this.props.parentSelector);e.removeChild(this.node),0===l.count()&&p(document.body).remove("ReactModal__Body--open")},renderPortal:function(e){e.isOpen||l.count()>0?p(document.body).add("ReactModal__Body--open"):p(document.body).remove("ReactModal__Body--open"),e.ariaHideApp&&c.toggle(e.isOpen,e.appElement),this.portal=f(this,u(d({},e,{defaultStyles:v.defaultStyles})),this.node)},render:function(){return r.DOM.noscript()}});v.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},e.exports=v},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){var o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,r=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},i=!0;e.exports=n(5)(r,i)},function(e,t,n){"use strict";var o=n(6),r=n(7),i=n(8),s=n(9),a=n(10);e.exports=function(e,t){function n(e){var t=e&&(_&&e[_]||e[R]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function l(e){function n(n,a,u,l,p,f,d){if(l=l||A,f=f||u,d!==s)if(t)r(!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");else if("undefined"!=typeof console){var h=l+":"+u;o[h]||(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",f,l),o[h]=!0)}return null==a[u]?n?new c(null===a[u]?"The "+p+" `"+f+"` is marked as required "+("in `"+l+"`, but its value is `null`."):"The "+p+" `"+f+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(a,u,l,p,f)}var o={},a=n.bind(null,!1);return a.isRequired=n.bind(null,!0),a}function p(e){function t(t,n,o,r,i,s){var a=t[n],u=C(a);if(u!==e){var l=x(a);return new c("Invalid "+r+" `"+i+"` of type "+("`"+l+"` supplied to `"+o+"`, expected ")+("`"+e+"`."))}return null}return l(t)}function f(){return l(o.thatReturnsNull)}function d(e){function t(t,n,o,r,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){var u=C(a);return new c("Invalid "+r+" `"+i+"` of type "+("`"+u+"` supplied to `"+o+"`, expected an array."))}for(var l=0;l<a.length;l++){var p=e(a,l,o,r,i+"["+l+"]",s);if(p instanceof Error)return p}return null}return l(t)}function h(){function t(t,n,o,r,i){var s=t[n];if(!e(s)){var a=C(s);return new c("Invalid "+r+" `"+i+"` of type "+("`"+a+"` supplied to `"+o+"`, expected a single ReactElement."))}return null}return l(t)}function m(e){function t(t,n,o,r,i){if(!(t[n]instanceof e)){var s=e.name||A,a=N(t[n]);return new c("Invalid "+r+" `"+i+"` of type "+("`"+a+"` supplied to `"+o+"`, expected ")+("instance of `"+s+"`."))}return null}return l(t)}function y(e){function t(t,n,o,r,i){for(var s=t[n],a=0;a<e.length;a++)if(u(s,e[a]))return null;var l=JSON.stringify(e);return new c("Invalid "+r+" `"+i+"` of value `"+s+"` "+("supplied to `"+o+"`, expected one of "+l+"."))}return Array.isArray(e)?l(t):(i(!1,"Invalid argument supplied to oneOf, expected an instance of array."),o.thatReturnsNull)}function v(e){function t(t,n,o,r,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],u=C(a);if("object"!==u)return new c("Invalid "+r+" `"+i+"` of type "+("`"+u+"` supplied to `"+o+"`, expected an object."));for(var l in a)if(a.hasOwnProperty(l)){var p=e(a,l,o,r,i+"."+l,s);if(p instanceof Error)return p}return null}return l(t)}function b(e){function t(t,n,o,r,i){for(var a=0;a<e.length;a++){var u=e[a];if(null==u(t,n,o,r,i,s))return null}return new c("Invalid "+r+" `"+i+"` supplied to "+("`"+o+"`."))}return Array.isArray(e)?l(t):(i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),o.thatReturnsNull)}function g(){function e(e,t,n,o,r){return E(e[t])?null:new c("Invalid "+o+" `"+r+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return l(e)}function O(e){function t(t,n,o,r,i){var a=t[n],u=C(a);if("object"!==u)return new c("Invalid "+r+" `"+i+"` of type `"+u+"` "+("supplied to `"+o+"`, expected `object`."));for(var l in e){var p=e[l];if(p){var f=p(a,l,o,r,i+"."+l,s);if(f)return f}}return null}return l(t)}function E(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(E);if(null===t||e(t))return!0;var o=n(t);if(!o)return!1;var r,i=o.call(t);if(o!==t.entries){for(;!(r=i.next()).done;)if(!E(r.value))return!1}else for(;!(r=i.next()).done;){var s=r.value;if(s&&!E(s[1]))return!1}return!0;default:return!1}}function w(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function C(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":w(t,e)?"symbol":t}function x(e){var t=C(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function N(e){return e.constructor&&e.constructor.name?e.constructor.name:A}var _="function"==typeof Symbol&&Symbol.iterator,R="@@iterator",A="<<anonymous>>",S={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:f(),arrayOf:d,element:h(),instanceOf:m,node:g(),objectOf:v,oneOf:y,oneOfType:b,shape:O};return c.prototype=Error.prototype,S.checkPropTypes=a,S.PropTypes=S,S}},function(e,t){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function o(e,t,n,o,i,s,a,u){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,s,a,u],p=0;c=new Error(t.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var r=function(e){};r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")},e.exports=o},function(e,t,n){"use strict";var o=n(6),r=o;!function(){var e=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=0,i="Warning: "+e.replace(/%s/g,function(){return n[r++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};r=function(t,n){if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==n.indexOf("Failed Composite propType: ")&&!t){for(var o=arguments.length,r=Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];e.apply(void 0,[n].concat(r))}}}(),e.exports=r},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){"use strict";function o(e,t,n,o,u){for(var c in e)if(e.hasOwnProperty(c)){var l;try{r("function"==typeof e[c],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",o||"React class",n,c),l=e[c](t,c,o,n,null,s)}catch(e){l=e}if(i(!l||l instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",n,c,typeof l),l instanceof Error&&!(l.message in a)){a[l.message]=!0;var p=u?u():"";i(!1,"Failed %s type: %s%s",n,l.message,null!=p?p:"")}}}var r=n(7),i=n(8),s=n(9),a={};e.exports=o},function(e,t,n){"use strict";var o=n(6),r=n(7);e.exports=function(){function e(){r(!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 t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){var o;/*! | ||
Copyright (c) 2015 Jed Watson. | ||
@@ -6,3 +6,3 @@ Based on code that is Copyright 2013-2015, Facebook, Inc. | ||
*/ | ||
!function(){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),s={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen};o=function(){return s}.call(t,n,t,e),!(void 0!==o&&(e.exports=o))}()},function(e,t,n){"use strict";var o=n(2),r=o.DOM.div,s=n(6),i=n(8),c=n(9),a={overlay:{base:"ReactModal__Overlay",afterOpen:"ReactModal__Overlay--after-open",beforeClose:"ReactModal__Overlay--before-close"},content:{base:"ReactModal__Content",afterOpen:"ReactModal__Content--after-open",beforeClose:"ReactModal__Content--before-close"}};e.exports=o.createClass({displayName:"ModalPortal",shouldClose:null,getDefaultProps:function(){return{style:{overlay:{},content:{}}}},getInitialState:function(){return{afterOpen:!1,beforeClose:!1}},componentDidMount:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())},componentWillUnmount:function(){clearTimeout(this.closeTimer)},componentWillReceiveProps:function(e){!this.props.isOpen&&e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()},componentDidUpdate:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))},setFocusAfterRender:function(e){this.focusAfterRender=e},afterClose:function(){s.returnFocus(),s.teardownScopedFocus()},open:function(){this.state.afterOpen&&this.state.beforeClose?(clearTimeout(this.closeTimer),this.setState({beforeClose:!1})):(s.setupScopedFocus(this.node),s.markForFocusLater(),this.setState({isOpen:!0},function(){this.setState({afterOpen:!0}),this.props.isOpen&&this.props.onAfterOpen&&this.props.onAfterOpen()}.bind(this)))},close:function(){this.props.closeTimeoutMS>0?this.closeWithTimeout():this.closeWithoutTimeout()},focusContent:function(){this.contentHasFocus()||this.refs.content.focus()},closeWithTimeout:function(){var e=Date.now()+this.props.closeTimeoutMS;this.setState({beforeClose:!0,closesAt:e},function(){this.closeTimer=setTimeout(this.closeWithoutTimeout,this.state.closesAt-Date.now())}.bind(this))},closeWithoutTimeout:function(){this.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},this.afterClose)},handleKeyDown:function(e){9==e.keyCode&&i(this.refs.content,e),27==e.keyCode&&(e.preventDefault(),this.requestClose(e))},handleOverlayOnClick:function(e){null===this.shouldClose&&(this.shouldClose=!0),this.shouldClose&&this.props.shouldCloseOnOverlayClick&&(this.ownerHandlesClose()?this.requestClose(e):this.focusContent()),this.shouldClose=null},handleContentOnClick:function(){this.shouldClose=!1},requestClose:function(e){this.ownerHandlesClose()&&this.props.onRequestClose(e)},ownerHandlesClose:function(){return this.props.onRequestClose},shouldBeClosed:function(){return!this.state.isOpen&&!this.state.beforeClose},contentHasFocus:function(){return document.activeElement===this.refs.content||this.refs.content.contains(document.activeElement)},buildClassName:function(e,t){var n=a[e].base;return this.state.afterOpen&&(n+=" "+a[e].afterOpen),this.state.beforeClose&&(n+=" "+a[e].beforeClose),t?n+" "+t:n},render:function(){var e=this.props.className?{}:this.props.defaultStyles.content,t=this.props.overlayClassName?{}:this.props.defaultStyles.overlay;return this.shouldBeClosed()?r():r({ref:"overlay",className:this.buildClassName("overlay",this.props.overlayClassName),style:c({},t,this.props.style.overlay||{}),onClick:this.handleOverlayOnClick},r({ref:"content",style:c({},e,this.props.style.content||{}),className:this.buildClassName("content",this.props.className),tabIndex:"-1",onKeyDown:this.handleKeyDown,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.props.children))}})},function(e,t,n){"use strict";function o(e){a=!0}function r(e){if(a){if(a=!1,!c)return;setTimeout(function(){if(!c.contains(document.activeElement)){var e=s(c)[0]||c;e.focus()}},0)}}var s=n(7),i=[],c=null,a=!1;t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=null;try{return e=i.pop(),void e.focus()}catch(t){console.warn("You tried to return focus to "+e+" but it is not in the DOM anymore")}},t.setupScopedFocus=function(e){c=e,window.addEventListener?(window.addEventListener("blur",o,!1),document.addEventListener("focus",r,!0)):(window.attachEvent("onBlur",o),document.attachEvent("onFocus",r))},t.teardownScopedFocus=function(){c=null,window.addEventListener?(window.removeEventListener("blur",o),document.removeEventListener("focus",r)):(window.detachEvent("onBlur",o),document.detachEvent("onFocus",r))}},function(e,t){"use strict";/*! | ||
!function(){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen};o=function(){return i}.call(t,n,t,e),!(void 0!==o&&(e.exports=o))}()},function(e,t,n){"use strict";var o=n(2),r=o.DOM.div,i=n(14),s=n(16),a=n(17),u=n(18),c={overlay:{base:"ReactModal__Overlay",afterOpen:"ReactModal__Overlay--after-open",beforeClose:"ReactModal__Overlay--before-close"},content:{base:"ReactModal__Content",afterOpen:"ReactModal__Content--after-open",beforeClose:"ReactModal__Content--before-close"}};e.exports=u({displayName:"ModalPortal",shouldClose:null,getDefaultProps:function(){return{style:{overlay:{},content:{}}}},getInitialState:function(){return{afterOpen:!1,beforeClose:!1}},componentDidMount:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())},componentWillUnmount:function(){clearTimeout(this.closeTimer)},componentWillReceiveProps:function(e){!this.props.isOpen&&e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()},componentDidUpdate:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))},setFocusAfterRender:function(e){this.focusAfterRender=e},afterClose:function(){i.returnFocus(),i.teardownScopedFocus()},open:function(){this.state.afterOpen&&this.state.beforeClose?(clearTimeout(this.closeTimer),this.setState({beforeClose:!1})):(i.setupScopedFocus(this.node),i.markForFocusLater(),this.setState({isOpen:!0},function(){this.setState({afterOpen:!0}),this.props.isOpen&&this.props.onAfterOpen&&this.props.onAfterOpen()}.bind(this)))},close:function(){this.props.closeTimeoutMS>0?this.closeWithTimeout():this.closeWithoutTimeout()},focusContent:function(){this.contentHasFocus()||this.refs.content.focus()},closeWithTimeout:function(){var e=Date.now()+this.props.closeTimeoutMS;this.setState({beforeClose:!0,closesAt:e},function(){this.closeTimer=setTimeout(this.closeWithoutTimeout,this.state.closesAt-Date.now())}.bind(this))},closeWithoutTimeout:function(){this.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},this.afterClose)},handleKeyDown:function(e){9==e.keyCode&&s(this.refs.content,e),27==e.keyCode&&(e.preventDefault(),this.requestClose(e))},handleOverlayOnClick:function(e){null===this.shouldClose&&(this.shouldClose=!0),this.shouldClose&&this.props.shouldCloseOnOverlayClick&&(this.ownerHandlesClose()?this.requestClose(e):this.focusContent()),this.shouldClose=null},handleContentOnClick:function(){this.shouldClose=!1},requestClose:function(e){this.ownerHandlesClose()&&this.props.onRequestClose(e)},ownerHandlesClose:function(){return this.props.onRequestClose},shouldBeClosed:function(){return!this.state.isOpen&&!this.state.beforeClose},contentHasFocus:function(){return document.activeElement===this.refs.content||this.refs.content.contains(document.activeElement)},buildClassName:function(e,t){var n=c[e].base;return this.state.afterOpen&&(n+=" "+c[e].afterOpen),this.state.beforeClose&&(n+=" "+c[e].beforeClose),t?n+" "+t:n},render:function(){var e=this.props.className?{}:this.props.defaultStyles.content,t=this.props.overlayClassName?{}:this.props.defaultStyles.overlay;return this.shouldBeClosed()?r():r({ref:"overlay",className:this.buildClassName("overlay",this.props.overlayClassName),style:a({},t,this.props.style.overlay||{}),onClick:this.handleOverlayOnClick},r({ref:"content",style:a({},e,this.props.style.content||{}),className:this.buildClassName("content",this.props.className),tabIndex:"-1",onKeyDown:this.handleKeyDown,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.props.children))}})},function(e,t,n){"use strict";function o(e){u=!0}function r(e){if(u){if(u=!1,!a)return;setTimeout(function(){if(!a.contains(document.activeElement)){var e=i(a)[0]||a;e.focus()}},0)}}var i=n(15),s=[],a=null,u=!1;t.markForFocusLater=function(){s.push(document.activeElement)},t.returnFocus=function(){var e=null;try{return e=s.pop(),void e.focus()}catch(t){console.warn("You tried to return focus to "+e+" but it is not in the DOM anymore")}},t.setupScopedFocus=function(e){a=e,window.addEventListener?(window.addEventListener("blur",o,!1),document.addEventListener("focus",r,!0)):(window.attachEvent("onBlur",o),document.attachEvent("onFocus",r))},t.teardownScopedFocus=function(){a=null,window.addEventListener?(window.removeEventListener("blur",o),document.removeEventListener("focus",r)):(window.detachEvent("onBlur",o),document.detachEvent("onFocus",r))}},function(e,t){"use strict";/*! | ||
* Adapted from jQuery UI core | ||
@@ -18,2 +18,7 @@ * | ||
*/ | ||
function n(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&r(e)}function o(e){return e.offsetWidth<=0&&e.offsetHeight<=0||"none"===e.style.display}function r(e){for(;e&&e!==document.body;){if(o(e))return!1;e=e.parentNode}return!0}function s(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var o=isNaN(t);return(o||t>=0)&&n(e,!o)}function i(e){return[].slice.call(e.querySelectorAll("*"),0).filter(function(e){return s(e)})}e.exports=i},function(e,t,n){"use strict";var o=n(7);e.exports=function(e,t){var n=o(e);if(!n.length)return void t.preventDefault();var r=n[t.shiftKey?0:n.length-1],s=r===document.activeElement||e===document.activeElement;if(s){t.preventDefault();var i=n[t.shiftKey?n.length-1:0];i.focus()}}},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function o(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}function r(e,t){return function(n){return e(t(n))}}function s(e,t){var n=k(e)||m(e)?o(e.length,String):[],r=n.length,s=!!r;for(var i in e)!t&&!R.call(e,i)||s&&("length"==i||p(i,r))||n.push(i);return n}function i(e,t,n){var o=e[t];R.call(e,t)&&h(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function c(e){if(!d(e))return F(e);var t=[];for(var n in Object(e))R.call(e,n)&&"constructor"!=n&&t.push(n);return t}function a(e,t){return t=j(void 0===t?e.length-1:t,0),function(){for(var o=arguments,r=-1,s=j(o.length-t,0),i=Array(s);++r<s;)i[r]=o[t+r];r=-1;for(var c=Array(t+1);++r<t;)c[r]=o[r];return c[t]=i,n(e,this,c)}}function l(e,t,n,o){n||(n={});for(var r=-1,s=t.length;++r<s;){var c=t[r],a=o?o(n[c],e[c],c,n,e):void 0;i(n,c,void 0===a?e[c]:a)}return n}function u(e){return a(function(t,n){var o=-1,r=n.length,s=r>1?n[r-1]:void 0,i=r>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(r--,s):void 0,i&&f(n[0],n[1],i)&&(s=r<3?void 0:s,r=1),t=Object(t);++o<r;){var c=n[o];c&&e(t,c,o,s)}return t})}function p(e,t){return t=null==t?S:t,!!t&&("number"==typeof e||A.test(e))&&e>-1&&e%1==0&&e<t}function f(e,t,n){if(!O(n))return!1;var o=typeof t;return!!("number"==o?v(n)&&p(t,n.length):"string"==o&&t in n)&&h(n[t],e)}function d(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||E;return e===n}function h(e,t){return e===t||e!==e&&t!==t}function m(e){return y(e)&&R.call(e,"callee")&&(!P.call(e,"callee")||N.call(e)==T)}function v(e){return null!=e&&C(e.length)&&!b(e)}function y(e){return w(e)&&v(e)}function b(e){var t=O(e)?N.call(e):"";return t==x||t==M}function C(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function O(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){return!!e&&"object"==typeof e}function g(e){return v(e)?s(e):c(e)}var S=9007199254740991,T="[object Arguments]",x="[object Function]",M="[object GeneratorFunction]",A=/^(?:0|[1-9]\d*)$/,E=Object.prototype,R=E.hasOwnProperty,N=E.toString,P=E.propertyIsEnumerable,F=r(Object.keys,Object),j=Math.max,D=!P.call({valueOf:1},"valueOf"),k=Array.isArray,_=u(function(e,t){if(D||d(t)||v(t))return void l(t,g(t),e);for(var n in t)R.call(t,n)&&i(e,n,t[n])});e.exports=_},function(e,t){"use strict";function n(e){if("string"==typeof e){var t=document.querySelectorAll(e);e="length"in t?t[0]:t}return a=e||a}function o(e){i(e),(e||a).setAttribute("aria-hidden","true")}function r(e){i(e),(e||a).removeAttribute("aria-hidden")}function s(e,t){e?o(t):r(t)}function i(e){if(!e&&!a)throw new Error("react-modal: You must set an element with `Modal.setAppElement(el)` to make this accessible")}function c(){a=document.body}var a="undefined"!=typeof document?document.body:null;t.toggle=s,t.setElement=n,t.show=r,t.hide=o,t.resetForTesting=c},function(e,t){function n(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1}function o(e){if(!(this instanceof o))return new o(e);e||(e={}),e.nodeType&&(e={el:e}),this.opts=e,this.el=e.el||document.body,"object"!=typeof this.el&&(this.el=document.querySelector(this.el))}e.exports=function(e){return new o(e)},o.prototype.add=function(e){var t=this.el;if(t){if(""===t.className)return t.className=e;var o=t.className.split(" ");return n(o,e)>-1?o:(o.push(e),t.className=o.join(" "),o)}},o.prototype.remove=function(e){var t=this.el;if(t&&""!==t.className){var o=t.className.split(" "),r=n(o,e);return r>-1&&o.splice(r,1),t.className=o.join(" "),o}},o.prototype.has=function(e){var t=this.el;if(t){var o=t.className.split(" ");return n(o,e)>-1}},o.prototype.toggle=function(e){var t=this.el;t&&(this.has(e)?this.remove(e):this.add(e))}}])}); | ||
function n(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&r(e)}function o(e){return e.offsetWidth<=0&&e.offsetHeight<=0||"none"===e.style.display}function r(e){for(;e&&e!==document.body;){if(o(e))return!1;e=e.parentNode}return!0}function i(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var o=isNaN(t);return(o||t>=0)&&n(e,!o)}function s(e){return[].slice.call(e.querySelectorAll("*"),0).filter(function(e){return i(e)})}e.exports=s},function(e,t,n){"use strict";var o=n(15);e.exports=function(e,t){var n=o(e);if(!n.length)return void t.preventDefault();var r=n[t.shiftKey?0:n.length-1],i=r===document.activeElement||e===document.activeElement;if(i){t.preventDefault();var s=n[t.shiftKey?n.length-1:0];s.focus()}}},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function o(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}function r(e,t){return function(n){return e(t(n))}}function i(e,t){var n=I(e)||m(e)?o(e.length,String):[],r=n.length,i=!!r;for(var s in e)!t&&!S.call(e,s)||i&&("length"==s||p(s,r))||n.push(s);return n}function s(e,t,n){var o=e[t];S.call(e,t)&&h(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function a(e){if(!d(e))return T(e);var t=[];for(var n in Object(e))S.call(e,n)&&"constructor"!=n&&t.push(n);return t}function u(e,t){return t=P(void 0===t?e.length-1:t,0),function(){for(var o=arguments,r=-1,i=P(o.length-t,0),s=Array(i);++r<i;)s[r]=o[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=o[r];return a[t]=s,n(e,this,a)}}function c(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r],u=o?o(n[a],e[a],a,n,e):void 0;s(n,a,void 0===u?e[a]:u)}return n}function l(e){return u(function(t,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,s&&f(n[0],n[1],s)&&(i=r<3?void 0:i,r=1),t=Object(t);++o<r;){var a=n[o];a&&e(t,a,o,i)}return t})}function p(e,t){return t=null==t?C:t,!!t&&("number"==typeof e||R.test(e))&&e>-1&&e%1==0&&e<t}function f(e,t,n){if(!O(n))return!1;var o=typeof t;return!!("number"==o?y(n)&&p(t,n.length):"string"==o&&t in n)&&h(n[t],e)}function d(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||A;return e===n}function h(e,t){return e===t||e!==e&&t!==t}function m(e){return v(e)&&S.call(e,"callee")&&(!D.call(e,"callee")||M.call(e)==x)}function y(e){return null!=e&&g(e.length)&&!b(e)}function v(e){return E(e)&&y(e)}function b(e){var t=O(e)?M.call(e):"";return t==N||t==_}function g(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=C}function O(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function E(e){return!!e&&"object"==typeof e}function w(e){return y(e)?i(e):a(e)}var C=9007199254740991,x="[object Arguments]",N="[object Function]",_="[object GeneratorFunction]",R=/^(?:0|[1-9]\d*)$/,A=Object.prototype,S=A.hasOwnProperty,M=A.toString,D=A.propertyIsEnumerable,T=r(Object.keys,Object),P=Math.max,j=!D.call({valueOf:1},"valueOf"),I=Array.isArray,F=l(function(e,t){if(j||d(t)||y(t))return void c(t,w(t),e);for(var n in t)S.call(t,n)&&s(e,n,t[n])});e.exports=F},function(e,t,n){"use strict";var o=n(2),r=n(19),i=(new o.Component).updater;e.exports=r(o.Component,o.isValidElement,i)},function(e,t,n){"use strict";function o(e){return e}function r(e,t,n){function r(e,t,n){for(var o in t)t.hasOwnProperty(o)&&c("function"==typeof t[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",i[n],o)}function p(e,t){var n=E.hasOwnProperty(t)?E[t]:null;x.hasOwnProperty(t)&&u("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&u("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,n){if(!n){var o=typeof n,r="object"===o&&null!==n;return void c(r,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:o)}u("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),u(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var i=e.prototype,s=i.__reactAutoBindPairs;n.hasOwnProperty(l)&&w.mixins(e,n.mixins);for(var a in n)if(n.hasOwnProperty(a)&&a!==l){var f=n[a],d=i.hasOwnProperty(a);if(p(d,a),w.hasOwnProperty(a))w[a](e,f);else{var h=E.hasOwnProperty(a),v="function"==typeof f,b=v&&!h&&!d&&n.autobind!==!1;if(b)s.push(a,f),i[a]=f;else if(d){var g=E[a];u(h&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,a),"DEFINE_MANY_MERGED"===g?i[a]=m(i[a],f):"DEFINE_MANY"===g&&(i[a]=y(i[a],f))}else i[a]=f,"function"==typeof f&&n.displayName&&(i[a].displayName=n.displayName+"_"+a)}}}function d(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;u(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;u(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function h(e,t){u(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(u(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return h(r,n),h(r,o),r}}function y(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){var n=t.bind(e);n.__reactBoundContext=e,n.__reactBoundMethod=t,n.__reactBoundArguments=null;var o=e.constructor.displayName,r=n.bind;return n.bind=function(i){for(var s=arguments.length,a=Array(s>1?s-1:0),u=1;u<s;u++)a[u-1]=arguments[u];if(i!==e&&null!==i)c(!1,"bind(): React component methods may only be bound to the component instance. See %s",o);else if(!a.length)return c(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",o),n;var l=r.apply(n,arguments);return l.__reactBoundContext=e,l.__reactBoundMethod=t,l.__reactBoundArguments=a,l},n}function b(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var o=t[n],r=t[n+1];e[o]=v(e,r)}}function g(e){var t=o(function(e,o,r){c(this instanceof t,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"),this.__reactAutoBindPairs.length&&b(this),this.props=e,this.context=o,this.refs=a,this.updater=r||n,this.state=null;var i=this.getInitialState?this.getInitialState():null;void 0===i&&this.getInitialState._isMockFunction&&(i=null),u("object"==typeof i&&!Array.isArray(i),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=i});t.prototype=new N,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],O.forEach(f.bind(null,t)),f(t,C),f(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved={}),t.prototype.getInitialState&&(t.prototype.getInitialState.isReactClassApproved={}),u(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),c(!t.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"),c(!t.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component");for(var r in E)t.prototype[r]||(t.prototype[r]=null);return t}var O=[],E={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},w={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,t){r(e,t,"childContext"),e.childContextTypes=s({},e.childContextTypes,t)},contextTypes:function(e,t){r(e,t,"context"),e.contextTypes=s({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=m(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){r(e,t,"prop"),e.propTypes=s({},e.propTypes,t)},statics:function(e,t){d(e,t)},autobind:function(){}},C={componentDidMount:function(){this.__isMounted=!0},componentWillUnmount:function(){this.__isMounted=!1}},x={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return c(this.__didWarnIsMounted,"%s: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.",this.constructor&&this.constructor.displayName||this.name||"Component"),this.__didWarnIsMounted=!0,!!this.__isMounted}},N=function(){};return s(N.prototype,e.prototype,x),g}var i,s=n(20),a=n(21),u=n(7),c=n(8),l="mixins";i={prop:"prop",context:"context",childContext:"child context"},e.exports=r},function(e,t){/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var o=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==o.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(e,t){for(var o,a,u=n(e),c=1;c<arguments.length;c++){o=Object(arguments[c]);for(var l in o)i.call(o,l)&&(u[l]=o[l]);if(r){a=r(o);for(var p=0;p<a.length;p++)s.call(o,a[p])&&(u[a[p]]=o[a[p]])}}return u}},function(e,t,n){"use strict";var o={};Object.freeze(o),e.exports=o},function(e,t){"use strict";function n(e){if("string"==typeof e){var t=document.querySelectorAll(e);e="length"in t?t[0]:t}return u=e||u}function o(e){s(e),(e||u).setAttribute("aria-hidden","true")}function r(e){s(e),(e||u).removeAttribute("aria-hidden")}function i(e,t){e?o(t):r(t)}function s(e){if(!e&&!u)throw new Error("react-modal: You must set an element with `Modal.setAppElement(el)` to make this accessible")}function a(){u=document.body}var u="undefined"!=typeof document?document.body:null;t.toggle=i,t.setElement=n,t.show=r,t.hide=o,t.resetForTesting=a},function(e,t){"use strict";function n(e){i.indexOf(e)===-1&&i.push(e)}function o(e){var t=i.indexOf(e);t!==-1&&i.splice(t,1)}function r(){return i.length}Object.defineProperty(t,"__esModule",{value:!0}),t.add=n,t.remove=o,t.count=r;var i=[]},function(e,t){function n(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1}function o(e){if(!(this instanceof o))return new o(e);e||(e={}),e.nodeType&&(e={el:e}),this.opts=e,this.el=e.el||document.body,"object"!=typeof this.el&&(this.el=document.querySelector(this.el))}e.exports=function(e){return new o(e)},o.prototype.add=function(e){var t=this.el;if(t){if(""===t.className)return t.className=e;var o=t.className.split(" ");return n(o,e)>-1?o:(o.push(e),t.className=o.join(" "),o)}},o.prototype.remove=function(e){var t=this.el;if(t&&""!==t.className){var o=t.className.split(" "),r=n(o,e);return r>-1&&o.splice(r,1),t.className=o.join(" "),o}},o.prototype.has=function(e){var t=this.el;if(t){var o=t.className.split(" ");return n(o,e)>-1}},o.prototype.toggle=function(e){var t=this.el;t&&(this.has(e)?this.remove(e):this.add(e))}}])}); |
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
var PropTypes = require('prop-types'); | ||
var ExecutionEnvironment = require('exenv'); | ||
var ModalPortal = React.createFactory(require('./ModalPortal')); | ||
var ariaAppHider = require('../helpers/ariaAppHider'); | ||
var refCount = require('../helpers/refCount'); | ||
var elementClass = require('element-class'); | ||
var renderSubtreeIntoContainer = require("react-dom").unstable_renderSubtreeIntoContainer; | ||
var Assign = require('lodash.assign'); | ||
var createReactClass = require('create-react-class') | ||
@@ -17,3 +20,3 @@ var SafeHTMLElement = ExecutionEnvironment.canUseDOM ? window.HTMLElement : {}; | ||
var Modal = React.createClass({ | ||
var Modal = createReactClass({ | ||
@@ -33,17 +36,17 @@ displayName: 'Modal', | ||
propTypes: { | ||
isOpen: React.PropTypes.bool.isRequired, | ||
style: React.PropTypes.shape({ | ||
content: React.PropTypes.object, | ||
overlay: React.PropTypes.object | ||
isOpen: PropTypes.bool.isRequired, | ||
style: PropTypes.shape({ | ||
content: PropTypes.object, | ||
overlay: PropTypes.object | ||
}), | ||
portalClassName: React.PropTypes.string, | ||
appElement: React.PropTypes.instanceOf(SafeHTMLElement), | ||
onAfterOpen: React.PropTypes.func, | ||
onRequestClose: React.PropTypes.func, | ||
closeTimeoutMS: React.PropTypes.number, | ||
ariaHideApp: React.PropTypes.bool, | ||
shouldCloseOnOverlayClick: React.PropTypes.bool, | ||
parentSelector: React.PropTypes.func, | ||
role: React.PropTypes.string, | ||
contentLabel: React.PropTypes.string.isRequired | ||
portalClassName: PropTypes.string, | ||
appElement: PropTypes.instanceOf(SafeHTMLElement), | ||
onAfterOpen: PropTypes.func, | ||
onRequestClose: PropTypes.func, | ||
closeTimeoutMS: PropTypes.number, | ||
ariaHideApp: PropTypes.bool, | ||
shouldCloseOnOverlayClick: PropTypes.bool, | ||
parentSelector: PropTypes.func, | ||
role: PropTypes.string, | ||
contentLabel: PropTypes.string.isRequired | ||
}, | ||
@@ -66,2 +69,4 @@ | ||
if (this.props.isOpen) refCount.add(this); | ||
var parent = getParentElement(this.props.parentSelector); | ||
@@ -73,2 +78,4 @@ parent.appendChild(this.node); | ||
componentWillReceiveProps: function(newProps) { | ||
if (newProps.isOpen) refCount.add(this); | ||
if (!newProps.isOpen) refCount.remove(this); | ||
var currentParent = getParentElement(this.props.parentSelector); | ||
@@ -86,2 +93,4 @@ var newParent = getParentElement(newProps.parentSelector); | ||
componentWillUnmount: function() { | ||
refCount.remove(this); | ||
if (this.props.ariaHideApp) { | ||
@@ -113,7 +122,9 @@ ariaAppHider.show(this.props.appElement); | ||
parent.removeChild(this.node); | ||
elementClass(document.body).remove('ReactModal__Body--open'); | ||
if (refCount.count() === 0) { | ||
elementClass(document.body).remove('ReactModal__Body--open'); | ||
} | ||
}, | ||
renderPortal: function(props) { | ||
if (props.isOpen) { | ||
if (props.isOpen || refCount.count() > 0) { | ||
elementClass(document.body).add('ReactModal__Body--open'); | ||
@@ -120,0 +131,0 @@ } else { |
@@ -6,2 +6,3 @@ var React = require('react'); | ||
var Assign = require('lodash.assign'); | ||
var createReactClass = require('create-react-class'); | ||
@@ -22,3 +23,3 @@ // so that our CSS is statically analyzable | ||
var ModalPortal = module.exports = React.createClass({ | ||
var ModalPortal = module.exports = createReactClass({ | ||
@@ -25,0 +26,0 @@ displayName: 'ModalPortal', |
{ | ||
"name": "react-modal", | ||
"version": "1.7.3", | ||
"version": "1.7.4", | ||
"description": "Accessible modal dialog component for React.JS", | ||
@@ -59,5 +59,7 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"create-react-class": "^15.5.2", | ||
"element-class": "^0.2.0", | ||
"exenv": "1.2.0", | ||
"lodash.assign": "^4.2.0" | ||
"lodash.assign": "^4.2.0", | ||
"prop-types": "^15.5.7" | ||
}, | ||
@@ -64,0 +66,0 @@ "peerDependencies": { |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
333404
37
3483
7
1
+ Addedcreate-react-class@^15.5.2
+ Addedprop-types@^15.5.7