diff --git a/CHANGELOG.md b/CHANGELOG.md index f586af73..2848dd3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v2.0.7 - Sun, 25 Jun 2017 17:44:29 UTC +-------------------------------------- + + + + v2.0.7 - Sun, 25 Jun 2017 17:43:35 UTC -------------------------------------- diff --git a/bower.json b/bower.json index 57c39a98..95ce832b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-modal", - "version": "2.0.7", + "version": "2.1.0", "homepage": "https://github.com/reactjs/react-modal", "authors": [ "Ryan Florence", diff --git a/dist/react-modal.js b/dist/react-modal.js index 226a5cf6..615a955d 100644 --- a/dist/react-modal.js +++ b/dist/react-modal.js @@ -77,6 +77,7 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); + exports.bodyOpenClassName = exports.portalClassName = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -94,25 +95,17 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _exenv = __webpack_require__(12); - - var _exenv2 = _interopRequireDefault(_exenv); - - var _elementClass = __webpack_require__(13); - - var _elementClass2 = _interopRequireDefault(_elementClass); - - var _ModalPortal = __webpack_require__(14); + var _ModalPortal = __webpack_require__(12); var _ModalPortal2 = _interopRequireDefault(_ModalPortal); - var _ariaAppHider = __webpack_require__(18); + var _ariaAppHider = __webpack_require__(17); var ariaAppHider = _interopRequireWildcard(_ariaAppHider); - var _refCount = __webpack_require__(19); + var _safeHTMLElement = __webpack_require__(19); - var refCount = _interopRequireWildcard(_refCount); + var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -124,10 +117,10 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var EE = _exenv2.default; - var renderSubtreeIntoContainer = _reactDom2.default.unstable_renderSubtreeIntoContainer; + var portalClassName = exports.portalClassName = 'ReactModalPortal'; + var bodyOpenClassName = exports.bodyOpenClassName = 'ReactModal__Body--open'; - var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {}; + var renderSubtreeIntoContainer = _reactDom2.default.unstable_renderSubtreeIntoContainer; function getParentElement(parentSelector) { return parentSelector(); @@ -151,21 +144,7 @@ return /******/ (function(modules) { // webpackBootstrap _reactDom2.default.unmountComponentAtNode(_this.node); var parent = getParentElement(_this.props.parentSelector); parent.removeChild(_this.node); - - if (refCount.count() === 0) { - (0, _elementClass2.default)(document.body).remove(_this.props.bodyOpenClassName); - } }, _this.renderPortal = function (props) { - if (props.isOpen || refCount.count() > 0) { - (0, _elementClass2.default)(document.body).add(_this.props.bodyOpenClassName); - } else { - (0, _elementClass2.default)(document.body).remove(_this.props.bodyOpenClassName); - } - - if (props.ariaHideApp) { - ariaAppHider.toggle(props.isOpen, props.appElement); - } - _this.portal = renderSubtreeIntoContainer(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node); }, _temp), _possibleConstructorReturn(_this, _ret); } @@ -176,10 +155,9 @@ return /******/ (function(modules) { // webpackBootstrap this.node = document.createElement('div'); this.node.className = this.props.portalClassName; - if (this.props.isOpen) refCount.add(this); - var parent = getParentElement(this.props.parentSelector); parent.appendChild(this.node); + this.renderPortal(this.props); } }, { @@ -190,8 +168,6 @@ return /******/ (function(modules) { // webpackBootstrap if (!this.props.isOpen && !isOpen) return; - if (isOpen) refCount.add(this); - if (!isOpen) refCount.remove(this); var currentParent = getParentElement(this.props.parentSelector); var newParent = getParentElement(newProps.parentSelector); @@ -216,12 +192,6 @@ return /******/ (function(modules) { // webpackBootstrap if (!this.node) return; - refCount.remove(this); - - if (this.props.ariaHideApp) { - ariaAppHider.show(this.props.appElement); - } - var state = this.portal.state; var now = Date.now(); var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS); @@ -277,7 +247,7 @@ return /******/ (function(modules) { // webpackBootstrap bodyOpenClassName: _propTypes2.default.string, className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), - appElement: _propTypes2.default.instanceOf(SafeHTMLElement), + appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default), onAfterOpen: _propTypes2.default.func, onRequestClose: _propTypes2.default.func, closeTimeoutMS: _propTypes2.default.number, @@ -289,8 +259,8 @@ return /******/ (function(modules) { // webpackBootstrap }; Modal.defaultProps = { isOpen: false, - portalClassName: 'ReactModalPortal', - bodyOpenClassName: 'ReactModal__Body--open', + portalClassName: portalClassName, + bodyOpenClassName: bodyOpenClassName, ariaHideApp: true, closeTimeoutMS: 0, shouldCloseOnOverlayClick: true, @@ -1218,116 +1188,6 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2015 Jed Watson. - Based on code that is Copyright 2013-2015, Facebook, Inc. - All rights reserved. - */ - - (function () { - 'use strict'; - - var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement - ); - - var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: - canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen - - }; - - if (true) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { - return ExecutionEnvironment; - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module !== 'undefined' && module.exports) { - module.exports = ExecutionEnvironment; - } else { - window.ExecutionEnvironment = ExecutionEnvironment; - } - - }()); - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - - module.exports = function(opts) { - return new ElementClass(opts) - } - - function indexOf(arr, prop) { - if (arr.indexOf) return arr.indexOf(prop) - for (var i = 0, len = arr.length; i < len; i++) - if (arr[i] === prop) return i - return -1 - } - - function ElementClass(opts) { - if (!(this instanceof ElementClass)) return new ElementClass(opts) - var self = this - if (!opts) opts = {} - - // similar doing instanceof HTMLElement but works in IE8 - if (opts.nodeType) opts = {el: opts} - - this.opts = opts - this.el = opts.el || document.body - if (typeof this.el !== 'object') this.el = document.querySelector(this.el) - } - - ElementClass.prototype.add = function(className) { - var el = this.el - if (!el) return - if (el.className === "") return el.className = className - var classes = el.className.split(' ') - if (indexOf(classes, className) > -1) return classes - classes.push(className) - el.className = classes.join(' ') - return classes - } - - ElementClass.prototype.remove = function(className) { - var el = this.el - if (!el) return - if (el.className === "") return - var classes = el.className.split(' ') - var idx = indexOf(classes, className) - if (idx > -1) classes.splice(idx, 1) - el.className = classes.join(' ') - return classes - } - - ElementClass.prototype.has = function(className) { - var el = this.el - if (!el) return - var classes = el.className.split(' ') - return indexOf(classes, className) > -1 - } - - ElementClass.prototype.toggle = function(className) { - var el = this.el - if (!el) return - if (this.has(className)) this.remove(className) - else this.add(className) - } - - -/***/ }), -/* 14 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -1348,14 +1208,30 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes = __webpack_require__(4); - var _focusManager = __webpack_require__(15); + var _elementClass = __webpack_require__(13); + + var _elementClass2 = _interopRequireDefault(_elementClass); + + var _focusManager = __webpack_require__(14); var focusManager = _interopRequireWildcard(_focusManager); - var _scopeTab = __webpack_require__(17); + var _scopeTab = __webpack_require__(16); var _scopeTab2 = _interopRequireDefault(_scopeTab); + var _ariaAppHider = __webpack_require__(17); + + var ariaAppHider = _interopRequireWildcard(_ariaAppHider); + + var _refCount = __webpack_require__(18); + + var refCount = _interopRequireWildcard(_refCount); + + var _safeHTMLElement = __webpack_require__(19); + + var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1401,6 +1277,7 @@ return /******/ (function(modules) { // webpackBootstrap }; _this.open = function () { + _this.beforeOpen(); if (_this.state.afterOpen && _this.state.beforeClose) { clearTimeout(_this.closeTimer); _this.setState({ beforeClose: false }); @@ -1418,6 +1295,7 @@ return /******/ (function(modules) { // webpackBootstrap }; _this.close = function () { + _this.beforeClose(); if (_this.props.closeTimeoutMS > 0) { _this.closeWithTimeout(); } else { @@ -1527,6 +1405,12 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(newProps) { + if ((undefined) !== "production") { + if (newProps.bodyOpenClassName !== this.props.bodyOpenClassName) { + // eslint-disable-next-line no-console + console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + 'This may cause unexpected behavior when multiple modals are open.'); + } + } // Focus only needs to be set once when the modal is being opened if (!this.props.isOpen && newProps.isOpen) { this.setFocusAfterRender(true); @@ -1546,18 +1430,53 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'componentWillUnmount', value: function componentWillUnmount() { + this.beforeClose(); clearTimeout(this.closeTimer); } + }, { + key: 'beforeOpen', + value: function beforeOpen() { + var _props = this.props, + appElement = _props.appElement, + ariaHideApp = _props.ariaHideApp, + bodyOpenClassName = _props.bodyOpenClassName; + + refCount.add(bodyOpenClassName); + // Add body class + (0, _elementClass2.default)(document.body).add(bodyOpenClassName); + // Add aria-hidden to appElement + if (ariaHideApp) { + ariaAppHider.hide(appElement); + } + } + }, { + key: 'beforeClose', + value: function beforeClose() { + var _props2 = this.props, + appElement = _props2.appElement, + ariaHideApp = _props2.ariaHideApp, + bodyOpenClassName = _props2.bodyOpenClassName; + + refCount.remove(bodyOpenClassName); + // Remove class if no more modals are open + if (refCount.count(bodyOpenClassName) === 0) { + (0, _elementClass2.default)(document.body).remove(bodyOpenClassName); + } + // Reset aria-hidden attribute if all modals have been removed + if (ariaHideApp && refCount.totalCount() < 1) { + ariaAppHider.show(appElement); + } + } // Don't steal focus from inner elements }, { key: 'render', value: function render() { - var _props = this.props, - className = _props.className, - overlayClassName = _props.overlayClassName, - defaultStyles = _props.defaultStyles; + var _props3 = this.props, + className = _props3.className, + overlayClassName = _props3.overlayClassName, + defaultStyles = _props3.defaultStyles; var contentStyles = className ? {} : defaultStyles.content; var overlayStyles = overlayClassName ? {} : defaultStyles.overlay; @@ -1607,6 +1526,9 @@ return /******/ (function(modules) { // webpackBootstrap }), className: _propTypes.PropTypes.oneOfType([_propTypes.PropTypes.string, _propTypes.PropTypes.object]), overlayClassName: _propTypes.PropTypes.oneOfType([_propTypes.PropTypes.string, _propTypes.PropTypes.object]), + bodyOpenClassName: _propTypes.PropTypes.string, + ariaHideApp: _propTypes.PropTypes.bool, + appElement: _propTypes.PropTypes.instanceOf(_safeHTMLElement2.default), onAfterOpen: _propTypes.PropTypes.func, onRequestClose: _propTypes.PropTypes.func, closeTimeoutMS: _propTypes.PropTypes.number, @@ -1618,7 +1540,72 @@ return /******/ (function(modules) { // webpackBootstrap exports.default = ModalPortal; /***/ }), -/* 15 */ +/* 13 */ +/***/ (function(module, exports) { + + module.exports = function(opts) { + return new ElementClass(opts) + } + + function indexOf(arr, prop) { + if (arr.indexOf) return arr.indexOf(prop) + for (var i = 0, len = arr.length; i < len; i++) + if (arr[i] === prop) return i + return -1 + } + + function ElementClass(opts) { + if (!(this instanceof ElementClass)) return new ElementClass(opts) + var self = this + if (!opts) opts = {} + + // similar doing instanceof HTMLElement but works in IE8 + if (opts.nodeType) opts = {el: opts} + + this.opts = opts + this.el = opts.el || document.body + if (typeof this.el !== 'object') this.el = document.querySelector(this.el) + } + + ElementClass.prototype.add = function(className) { + var el = this.el + if (!el) return + if (el.className === "") return el.className = className + var classes = el.className.split(' ') + if (indexOf(classes, className) > -1) return classes + classes.push(className) + el.className = classes.join(' ') + return classes + } + + ElementClass.prototype.remove = function(className) { + var el = this.el + if (!el) return + if (el.className === "") return + var classes = el.className.split(' ') + var idx = indexOf(classes, className) + if (idx > -1) classes.splice(idx, 1) + el.className = classes.join(' ') + return classes + } + + ElementClass.prototype.has = function(className) { + var el = this.el + if (!el) return + var classes = el.className.split(' ') + return indexOf(classes, className) > -1 + } + + ElementClass.prototype.toggle = function(className) { + var el = this.el + if (!el) return + if (this.has(className)) this.remove(className) + else this.add(className) + } + + +/***/ }), +/* 14 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -1633,7 +1620,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.setupScopedFocus = setupScopedFocus; exports.teardownScopedFocus = teardownScopedFocus; - var _tabbable = __webpack_require__(16); + var _tabbable = __webpack_require__(15); var _tabbable2 = _interopRequireDefault(_tabbable); @@ -1710,7 +1697,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }), -/* 16 */ +/* 15 */ /***/ (function(module, exports) { 'use strict'; @@ -1765,7 +1752,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }), -/* 17 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -1775,7 +1762,7 @@ return /******/ (function(modules) { // webpackBootstrap }); exports.default = scopeTab; - var _tabbable = __webpack_require__(16); + var _tabbable = __webpack_require__(15); var _tabbable2 = _interopRequireDefault(_tabbable); @@ -1798,7 +1785,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }), -/* 18 */ +/* 17 */ /***/ (function(module, exports) { 'use strict'; @@ -1812,7 +1799,6 @@ return /******/ (function(modules) { // webpackBootstrap exports.validateElement = validateElement; exports.hide = hide; exports.show = show; - exports.toggle = toggle; exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting; exports.resetForTesting = resetForTesting; var globalElement = null; @@ -1859,11 +1845,6 @@ return /******/ (function(modules) { // webpackBootstrap (appElement || globalElement).removeAttribute('aria-hidden'); } - function toggle(shouldHide, appElement) { - var apply = shouldHide ? hide : show; - apply(appElement); - } - function documentNotReadyOrSSRTesting() { globalElement = null; } @@ -1873,7 +1854,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }), -/* 19 */ +/* 18 */ /***/ (function(module, exports) { "use strict"; @@ -1884,26 +1865,100 @@ return /******/ (function(modules) { // webpackBootstrap exports.add = add; exports.remove = remove; exports.count = count; - var modals = []; + exports.totalCount = totalCount; + var modals = {}; - function add(element) { - if (modals.indexOf(element) === -1) { - modals.push(element); + function add(bodyClass) { + // Set variable and default if none + if (!modals[bodyClass]) { + modals[bodyClass] = 0; } + modals[bodyClass] += 1; } - function remove(element) { - var index = modals.indexOf(element); - if (index === -1) { - return; + function remove(bodyClass) { + if (modals[bodyClass]) { + modals[bodyClass] -= 1; } - modals.splice(index, 1); } - function count() { - return modals.length; + function count(bodyClass) { + return modals[bodyClass]; } + function totalCount() { + return Object.keys(modals).reduce(function (acc, curr) { + return acc + modals[curr]; + }, 0); + } + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _exenv = __webpack_require__(20); + + var _exenv2 = _interopRequireDefault(_exenv); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var EE = _exenv2.default; + + var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {}; + + exports.default = SafeHTMLElement; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. + */ + + (function () { + 'use strict'; + + var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement + ); + + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: + canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen + + }; + + if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return ExecutionEnvironment; + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = ExecutionEnvironment; + } else { + window.ExecutionEnvironment = ExecutionEnvironment; + } + + }()); + + /***/ }) /******/ ]) }); diff --git a/dist/react-modal.min.js b/dist/react-modal.min.js index ecc7e65f..4ea38801 100644 --- a/dist/react-modal.min.js +++ b/dist/react-modal.min.js @@ -1,9 +1,4 @@ -!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";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=o(r);t.default=a.default},function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return e()}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0?(0,w.default)(document.body).add(o.props.bodyOpenClassName):(0,w.default)(document.body).remove(o.props.bodyOpenClassName),e.ariaHideApp&&P.toggle(e.isOpen,e.appElement),o.portal=S(o,p.default.createElement(C.default,l({defaultStyles:t.defaultStyles},e)),o.node)},r=n,i(o,r)}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this.node=document.createElement("div"),this.node.className=this.props.portalClassName,this.props.isOpen&&_.add(this);var e=u(this.props.parentSelector);e.appendChild(this.node),this.renderPortal(this.props)}},{key:"componentWillReceiveProps",value:function(e){var t=e.isOpen;if(this.props.isOpen||t){t&&_.add(this),t||_.remove(this);var n=u(this.props.parentSelector),o=u(e.parentSelector);o!==n&&(n.removeChild(this.node),o.appendChild(this.node)),this.renderPortal(e)}}},{key:"componentWillUpdate",value:function(e){e.portalClassName!==this.props.portalClassName&&(this.node.className=e.portalClassName)}},{key:"componentWillUnmount",value:function(){var e=this;if(this.node){_.remove(this),this.props.ariaHideApp&&P.show(this.props.appElement);var t=this.portal.state,n=Date.now(),o=t.isOpen&&this.props.closeTimeoutMS&&(t.closesAt||n+this.props.closeTimeoutMS);o?(t.beforeClose||this.portal.closeWithTimeout(),setTimeout(function(){return e.removePortal},o-n)):this.removePortal()}}},{key:"render",value:function(){return null}}],[{key:"setAppElement",value:function(e){P.setElement(e)}},{key:"injectCSS",value:function(){console.warn("React-Modal: injectCSS has been deprecated and no longer has any effect. It will be removed in a later version")}}]),t}(f.Component);R.propTypes={isOpen:h.default.bool.isRequired,style:h.default.shape({content:h.default.object,overlay:h.default.object}),portalClassName:h.default.string,bodyOpenClassName:h.default.string,className:h.default.oneOfType([h.default.string,h.default.object]),overlayClassName:h.default.oneOfType([h.default.string,h.default.object]),appElement:h.default.instanceOf(x),onAfterOpen:h.default.func,onRequestClose:h.default.func,closeTimeoutMS:h.default.number,ariaHideApp:h.default.bool,shouldCloseOnOverlayClick:h.default.bool,parentSelector:h.default.func,role:h.default.string,contentLabel:h.default.string.isRequired},R.defaultProps={isOpen:!1,portalClassName:"ReactModalPortal",bodyOpenClassName:"ReactModal__Body--open",ariaHideApp:!0,closeTimeoutMS:0,shouldCloseOnOverlayClick:!0,parentSelector:function(){return document.body}},R.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"}},t.default=R},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},a=!0;e.exports=n(5)(r,a)},function(e,t,n){"use strict";var o=n(6),r=n(7),a=n(8),i=n(9),s=n(10);e.exports=function(e,t){function n(e){var t=e&&(E&&e[E]||e[S]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function c(e){function n(n,u,c,f,p,d,y){if(f=f||x,d=d||c,y!==i)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 v=f+":"+c;!o[v]&&s<3&&(a(!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.",d,f),o[v]=!0,s++)}return null==u[c]?n?new l(null===u[c]?"The "+p+" `"+d+"` is marked as required "+("in `"+f+"`, but its value is `null`."):"The "+p+" `"+d+"` is marked as required in "+("`"+f+"`, but its value is `undefined`.")):null:e(u,c,f,p,d)}var o={},s=0,u=n.bind(null,!1);return u.isRequired=n.bind(null,!0),u}function f(e){function t(t,n,o,r,a,i){var s=t[n],u=T(s);if(u!==e){var c=P(s);return new l("Invalid "+r+" `"+a+"` of type "+("`"+c+"` supplied to `"+o+"`, expected ")+("`"+e+"`."))}return null}return c(t)}function p(){return c(o.thatReturnsNull)}function d(e){function t(t,n,o,r,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var u=T(s);return new l("Invalid "+r+" `"+a+"` of type "+("`"+u+"` supplied to `"+o+"`, expected an array."))}for(var c=0;c1?t-1:0),o=1;o2?o-2:0),a=2;a-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(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus()},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())})},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){e.keyCode===O&&(0,m.default)(n.content,e),e.keyCode===w&&(e.preventDefault(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnClick=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var o="object"===("undefined"==typeof t?"undefined":l(t))?t:{base:b[e],afterOpen:b[e]+"--after-open",beforeClose:b[e]+"--before-close"},r=o.base;return n.state.afterOpen&&(r=r+" "+o.afterOpen),n.state.beforeClose&&(r=r+" "+o.beforeClose),"string"==typeof t&&t?r+" "+t:r},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())}},{key:"componentWillReceiveProps",value:function(e){!this.props.isOpen&&e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()}},{key:"componentDidUpdate",value:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.closeTimer)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.overlayClassName,o=e.defaultStyles,r=t?{}:o.content,a=n?{}:o.overlay;return this.shouldBeClosed()?p.default.createElement("div",null):p.default.createElement("div",{ref:this.setOverlayRef,className:this.buildClassName("overlay",n),style:u({},a,this.props.style.overlay),onClick:this.handleOverlayOnClick},p.default.createElement("div",{ref:this.setContentRef,style:u({},r,this.props.style.content),className:this.buildClassName("content",t),tabIndex:"-1",onKeyDown:this.handleKeyDown,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.props.children))}}]),t}(f.Component);g.defaultProps={style:{overlay:{},content:{}}},g.propTypes={isOpen:d.PropTypes.bool.isRequired,defaultStyles:d.PropTypes.shape({content:d.PropTypes.object,overlay:d.PropTypes.object}),style:d.PropTypes.shape({content:d.PropTypes.object,overlay:d.PropTypes.object}),className:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.object]),overlayClassName:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.object]),onAfterOpen:d.PropTypes.func,onRequestClose:d.PropTypes.func,closeTimeoutMS:d.PropTypes.number,shouldCloseOnOverlayClick:d.PropTypes.bool,role:d.PropTypes.string,contentLabel:d.PropTypes.string,children:d.PropTypes.node},t.default=g},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(){y=!0}function a(){if(y){if(y=!1,!d)return;setTimeout(function(){if(!d.contains(document.activeElement)){var e=(0,f.default)(d)[0]||d;e.focus()}},0)}}function i(){p.push(document.activeElement)}function s(){var e=null;try{return e=p.pop(),void e.focus()}catch(t){console.warn(["You tried to return focus to",e,"but it is not in the DOM anymore"].join(" "))}}function u(e){d=e,window.addEventListener?(window.addEventListener("blur",r,!1),document.addEventListener("focus",a,!0)):(window.attachEvent("onBlur",r),document.attachEvent("onFocus",a))}function l(){d=null,window.addEventListener?(window.removeEventListener("blur",r),document.removeEventListener("focus",a)):(window.detachEvent("onBlur",r),document.detachEvent("onFocus",a))}Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlur=r,t.handleFocus=a,t.markForFocusLater=i,t.returnFocus=s,t.setupScopedFocus=u,t.teardownScopedFocus=l;var c=n(16),f=o(c),p=[],d=null,y=!1},function(e,t){"use strict";function n(e){return e.offsetWidth<=0&&e.offsetHeight<=0||"none"===e.style.display}function o(e){for(var t=e;t&&t!==document.body;){if(n(t))return!1;t=t.parentNode}return!0}function r(e,t){var n=e.nodeName.toLowerCase(),r=s.test(n)&&!e.disabled||("a"===n?e.href||t:t);return r&&o(e)}function a(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&r(e,!n)}function i(e){return[].slice.call(e.querySelectorAll("*"),0).filter(a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;/*! +!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";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=o(r);t.default=a.default},function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return e()}Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var l=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o2?o-2:0),a=2;a0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus()},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())})},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){e.keyCode===E&&(0,O.default)(n.content,e),e.keyCode===S&&(e.preventDefault(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnClick=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var o="object"===("undefined"==typeof t?"undefined":l(t))?t:{base:j[e],afterOpen:j[e]+"--after-open",beforeClose:j[e]+"--before-close"},r=o.base;return n.state.afterOpen&&(r=r+" "+o.afterOpen),n.state.beforeClose&&(r=r+" "+o.beforeClose),"string"==typeof t&&t?r+" "+t:r},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())}},{key:"componentWillReceiveProps",value:function(e){e.bodyOpenClassName!==this.props.bodyOpenClassName&&console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'),!this.props.isOpen&&e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()}},{key:"componentDidUpdate",value:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))}},{key:"componentWillUnmount",value:function(){this.beforeClose(),clearTimeout(this.closeTimer)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,o=e.bodyOpenClassName;T.add(o),(0,v.default)(document.body).add(o),n&&C.hide(t)}},{key:"beforeClose",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,o=e.bodyOpenClassName;T.remove(o),0===T.count(o)&&(0,v.default)(document.body).remove(o),n&&T.totalCount()<1&&C.show(t)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.overlayClassName,o=e.defaultStyles,r=t?{}:o.content,a=n?{}:o.overlay;return this.shouldBeClosed()?p.default.createElement("div",null):p.default.createElement("div",{ref:this.setOverlayRef,className:this.buildClassName("overlay",n),style:u({},a,this.props.style.overlay),onClick:this.handleOverlayOnClick},p.default.createElement("div",{ref:this.setContentRef,style:u({},r,this.props.style.content),className:this.buildClassName("content",t),tabIndex:"-1",onKeyDown:this.handleKeyDown,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.props.children))}}]),t}(f.Component);R.defaultProps={style:{overlay:{},content:{}}},R.propTypes={isOpen:d.PropTypes.bool.isRequired,defaultStyles:d.PropTypes.shape({content:d.PropTypes.object,overlay:d.PropTypes.object}),style:d.PropTypes.shape({content:d.PropTypes.object,overlay:d.PropTypes.object}),className:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.object]),overlayClassName:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.object]),bodyOpenClassName:d.PropTypes.string,ariaHideApp:d.PropTypes.bool,appElement:d.PropTypes.instanceOf(_.default),onAfterOpen:d.PropTypes.func,onRequestClose:d.PropTypes.func,closeTimeoutMS:d.PropTypes.number,shouldCloseOnOverlayClick:d.PropTypes.bool,role:d.PropTypes.string,contentLabel:d.PropTypes.string,children:d.PropTypes.node},t.default=R},function(e,t){function n(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n-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(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(){y=!0}function a(){if(y){if(y=!1,!d)return;setTimeout(function(){if(!d.contains(document.activeElement)){var e=(0,f.default)(d)[0]||d;e.focus()}},0)}}function i(){p.push(document.activeElement)}function s(){var e=null;try{return e=p.pop(),void e.focus()}catch(t){console.warn(["You tried to return focus to",e,"but it is not in the DOM anymore"].join(" "))}}function u(e){d=e,window.addEventListener?(window.addEventListener("blur",r,!1),document.addEventListener("focus",a,!0)):(window.attachEvent("onBlur",r),document.attachEvent("onFocus",a))}function l(){d=null,window.addEventListener?(window.removeEventListener("blur",r),document.removeEventListener("focus",a)):(window.detachEvent("onBlur",r),document.detachEvent("onFocus",a))}Object.defineProperty(t,"__esModule",{value:!0}),t.handleBlur=r,t.handleFocus=a,t.markForFocusLater=i,t.returnFocus=s,t.setupScopedFocus=u,t.teardownScopedFocus=l;var c=n(15),f=o(c),p=[],d=null,y=!1},function(e,t){"use strict";function n(e){return e.offsetWidth<=0&&e.offsetHeight<=0||"none"===e.style.display}function o(e){for(var t=e;t&&t!==document.body;){if(n(t))return!1;t=t.parentNode}return!0}function r(e,t){var n=e.nodeName.toLowerCase(),r=s.test(n)&&!e.disabled||("a"===n?e.href||t:t);return r&&o(e)}function a(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&r(e,!n)}function i(e){return[].slice.call(e.querySelectorAll("*"),0).filter(a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;/*! * Adapted from jQuery UI core * * http://jqueryui.com @@ -14,4 +9,9 @@ * * http://api.jqueryui.com/category/ui-core/ */ -var s=/input|select|textarea|button|object/},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=(0,i.default)(e);if(!n.length)return void t.preventDefault();var o=n[t.shiftKey?0:n.length-1],r=o===document.activeElement||e===document.activeElement;if(r){t.preventDefault();var a=n[t.shiftKey?n.length-1:0];a.focus()}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var a=n(16),i=o(a)},function(e,t){"use strict";function n(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function o(e){var t=e;if("string"==typeof t){var o=document.querySelectorAll(t);n(o,t),t="length"in o?o[0]:o}return f=t||f}function r(){return!(!document||!document.body)&&(o(document.body),!0)}function a(e){if(!e&&!f&&!r())throw new Error(["react-modal: Cannot fallback to `document.body`, because it's not ready or available.","If you are doing server-side rendering, use this function to defined an element.","`Modal.setAppElement(el)` to make this accessible"])}function i(e){a(e),(e||f).setAttribute("aria-hidden","true")}function s(e){a(e),(e||f).removeAttribute("aria-hidden")}function u(e,t){var n=e?i:s;n(t)}function l(){f=null}function c(){f=document.body}Object.defineProperty(t,"__esModule",{value:!0}),t.assertNodeList=n,t.setElement=o,t.tryForceFallback=r,t.validateElement=a,t.hide=i,t.show=s,t.toggle=u,t.documentNotReadyOrSSRTesting=l,t.resetForTesting=c;var f=null},function(e,t){"use strict";function n(e){a.indexOf(e)===-1&&a.push(e)}function o(e){var t=a.indexOf(e);t!==-1&&a.splice(t,1)}function r(){return a.length}Object.defineProperty(t,"__esModule",{value:!0}),t.add=n,t.remove=o,t.count=r;var a=[]}])}); \ No newline at end of file +var s=/input|select|textarea|button|object/},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=(0,i.default)(e);if(!n.length)return void t.preventDefault();var o=n[t.shiftKey?0:n.length-1],r=o===document.activeElement||e===document.activeElement;if(r){t.preventDefault();var a=n[t.shiftKey?n.length-1:0];a.focus()}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var a=n(15),i=o(a)},function(e,t){"use strict";function n(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function o(e){var t=e;if("string"==typeof t){var o=document.querySelectorAll(t);n(o,t),t="length"in o?o[0]:o}return c=t||c}function r(){return!(!document||!document.body)&&(o(document.body),!0)}function a(e){if(!e&&!c&&!r())throw new Error(["react-modal: Cannot fallback to `document.body`, because it's not ready or available.","If you are doing server-side rendering, use this function to defined an element.","`Modal.setAppElement(el)` to make this accessible"])}function i(e){a(e),(e||c).setAttribute("aria-hidden","true")}function s(e){a(e),(e||c).removeAttribute("aria-hidden")}function u(){c=null}function l(){c=document.body}Object.defineProperty(t,"__esModule",{value:!0}),t.assertNodeList=n,t.setElement=o,t.tryForceFallback=r,t.validateElement=a,t.hide=i,t.show=s,t.documentNotReadyOrSSRTesting=u,t.resetForTesting=l;var c=null},function(e,t){"use strict";function n(e){i[e]||(i[e]=0),i[e]+=1}function o(e){i[e]&&(i[e]-=1)}function r(e){return i[e]}function a(){return Object.keys(i).reduce(function(e,t){return e+i[t]},0)}Object.defineProperty(t,"__esModule",{value:!0}),t.add=n,t.remove=o,t.count=r,t.totalCount=a;var i={}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(20),a=o(r),i=a.default,s=i.canUseDOM?window.HTMLElement:{};t.default=s},function(e,t,n){var o;/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. + */ +!function(){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),a={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen};o=function(){return a}.call(t,n,t,e),!(void 0!==o&&(e.exports=o))}()}])}); \ No newline at end of file diff --git a/package.json b/package.json index 5021374d..13236abb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-modal", - "version": "2.0.7", + "version": "2.1.0", "description": "Accessible modal dialog component for React.JS", "main": "./lib/index.js", "repository": {