react-popout
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["react","react-dom"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom")):t(e.React,e.ReactDOM);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){m&&d&&(m=!1,d.length?y=d.concat(y):h=-1,y.length&&u())}function u(){if(!m){var e=o(a);m=!0;for(var t=y.length;t;){for(d=y,y=[];++h<t;)d&&d[h].run();h=-1,t=y.length}d=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function s(){}var f,l,p=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var d,y=[],m=!1,h=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new c(e,t)),1!==y.length||m||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=s,p.addListener=s,p.once=s,p.off=s,p.removeListener=s,p.removeAllListeners=s,p.emit=s,p.prependListener=s,p.prependOnceListener=s,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";(function(t){"production"===t.env.NODE_ENV?e.exports=n(10):e.exports=n(11)}).call(t,n(0))},function(e,t){e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(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 a(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=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(6),s=r(c),f=n(7),l=n(9),p=r(l),d={toolbar:"no",location:"no",directories:"no",status:"no",menubar:"no",scrollbars:"yes",resizable:"yes",width:500,height:400,top:function(e,t){return(t.innerHeight-e.height)/2+t.screenY},left:function(e,t){return(t.innerWidth-e.width)/2+t.screenX}},y=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.mainWindowClosed=n.mainWindowClosed.bind(n),n.popoutWindowUnloading=n.popoutWindowUnloading.bind(n),n.popoutWindowLoaded=n.popoutWindowLoaded.bind(n),n.state={openedWindowComponent:null,popoutWindow:null,container:null},n}return a(t,e),u(t,[{key:"createOptions",value:function(e){var t=this,n=Object.assign({},d,this.props.options);return Object.keys(n).map(function(r){return r+"="+("function"==typeof n[r]?n[r].call(t,n,e):n[r])}).join(",")}},{key:"componentDidMount",value:function(){var e=this.props.window||window;e&&(this.openPopoutWindow(e),e.addEventListener("unload",this.mainWindowClosed))}},{key:"componentWillReceiveProps",value:function(e){e.title!==this.props.title&&this.state.popoutWindow&&(this.state.popoutWindow.document.title=e.title)}},{key:"componentDidUpdate",value:function(){this.renderToContainer(this.state.container,this.state.popoutWindow,this.props.children)}},{key:"componentWillUnmount",value:function(){this.mainWindowClosed()}},{key:"popoutWindowLoaded",value:function(e){if(!this.state.container){e=this.state.popoutWindow||e,e.document.title=this.props.title;var t=e.document.createElement("div");t.id=this.props.containerId,e.document.body.appendChild(t),this.setState({container:t}),this.renderToContainer(t,e,this.props.children)}}},{key:"openPopoutWindow",value:function(e){var t=e.open(this.props.url,this.props.name||this.props.title,this.createOptions(e));if(!t)return void this.props.onError();this.setState({popoutWindow:t}),t.addEventListener("load",this.popoutWindowLoaded),t.addEventListener("unload",this.popoutWindowUnloading),"about:blank"===this.props.url?"complete"===t.document.readyState&&this.popoutWindowLoaded(t):this.checkForPopoutWindowClosure(t)}},{key:"closeWindow",value:function(){this.mainWindowClosed()}},{key:"checkForPopoutWindowClosure",value:function(e){var t=this;this.interval=setInterval(function(){e.closed&&(clearInterval(t.interval),t.props.onClosing&&t.props.onClosing())},500)}},{key:"mainWindowClosed",value:function(){this.state.popoutWindow&&this.state.popoutWindow.close(),(this.props.window||window).removeEventListener("unload",this.mainWindowClosed)}},{key:"popoutWindowUnloading",value:function(){this.state.container&&(clearInterval(this.interval),this.root.unmount(this.state.container),this.props.onClosing&&this.props.onClosing())}},{key:"renderToContainer",value:function(e,t,n){if(e){var r=n;"function"==typeof n&&(r=n(t)),this.root||(this.root=(0,f.createRoot)(e)),this.root.render(r)}}},{key:"render",value:function(){return null}}]),t}(s.default.Component);y.defaultProps={url:"about:blank",containerId:"popout-content-container",onError:function(){}},y.propTypes={title:p.default.string.isRequired,url:p.default.string,onClosing:p.default.func,options:p.default.object,window:p.default.object,containerId:p.default.string,children:p.default.oneOfType([p.default.element,p.default.func]),onError:p.default.func},t.default=y},function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e){var r=n(8);if("production"===e.env.NODE_ENV)t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot;else{var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t.createRoot=function(e,t){o.usingClientEntryPoint=!0;try{return r.createRoot(e,t)}finally{o.usingClientEntryPoint=!1}},t.hydrateRoot=function(e,t,n){o.usingClientEntryPoint=!0;try{return r.hydrateRoot(e,t,n)}finally{o.usingClientEntryPoint=!1}}}}).call(t,n(0))},function(e,n){e.exports=t},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r=n(2);e.exports=n(12)(r.isElement,!0)}else e.exports=n(15)()}).call(t,n(0))},function(e,t,n){"use strict";function r(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case d:case y:case c:case f:case s:case h:return e;default:switch(e=e&&e.$$typeof){case p:case m:case w:case b:case l:return e;default:return t}}case u:return t}}}function o(e){return r(e)===y}/** @license React v16.13.1 | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["react","react-dom"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom")):t(e.React,e.ReactDOM);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){m&&d&&(m=!1,d.length?y=d.concat(y):h=-1,y.length&&u())}function u(){if(!m){var e=o(a);m=!0;for(var t=y.length;t;){for(d=y,y=[];++h<t;)d&&d[h].run();h=-1,t=y.length}d=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function s(){}var f,l,p=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var d,y=[],m=!1,h=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new c(e,t)),1!==y.length||m||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=s,p.addListener=s,p.once=s,p.off=s,p.removeListener=s,p.removeAllListeners=s,p.emit=s,p.prependListener=s,p.prependOnceListener=s,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";(function(t){"production"===t.env.NODE_ENV?e.exports=n(10):e.exports=n(11)}).call(t,n(0))},function(e,t){e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(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 a(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=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(6),s=r(c),f=n(7),l=n(9),p=r(l),d={toolbar:"no",location:"no",directories:"no",status:"no",menubar:"no",scrollbars:"yes",resizable:"yes",width:500,height:400,top:function(e,t){return(t.innerHeight-e.height)/2+t.screenY},left:function(e,t){return(t.innerWidth-e.width)/2+t.screenX}},y=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.mainWindowClosed=n.mainWindowClosed.bind(n),n.popoutWindowUnloading=n.popoutWindowUnloading.bind(n),n.popoutWindowLoaded=n.popoutWindowLoaded.bind(n),n.state={openedWindowComponent:null,popoutWindow:null,container:null},n}return a(t,e),u(t,[{key:"createOptions",value:function(e){var t=this,n=Object.assign({},d,this.props.options);return Object.keys(n).map(function(r){return r+"="+("function"==typeof n[r]?n[r].call(t,n,e):n[r])}).join(",")}},{key:"componentDidMount",value:function(){var e=this.props.window||window;e&&(this.openPopoutWindow(e),e.addEventListener("unload",this.mainWindowClosed))}},{key:"componentWillReceiveProps",value:function(e){e.title!==this.props.title&&this.state.popoutWindow&&(this.state.popoutWindow.document.title=e.title)}},{key:"componentDidUpdate",value:function(){this.renderToContainer(this.state.container,this.state.popoutWindow,this.props.children)}},{key:"componentWillUnmount",value:function(){this.mainWindowClosed()}},{key:"popoutWindowLoaded",value:function(e){if(!this.state.container){e=this.state.popoutWindow||e,e.document.title=this.props.title;var t=e.document.createElement("div");t.id=this.props.containerId,t.className=this.props.containerClassName,e.document.body.appendChild(t),this.setState({container:t}),this.renderToContainer(t,e,this.props.children)}}},{key:"openPopoutWindow",value:function(e){var t=e.open(this.props.url,this.props.name||this.props.title,this.createOptions(e));if(!t)return void this.props.onError();this.setState({popoutWindow:t}),t.addEventListener("load",this.popoutWindowLoaded),t.addEventListener("unload",this.popoutWindowUnloading),"about:blank"===this.props.url?"complete"===t.document.readyState&&this.popoutWindowLoaded(t):this.checkForPopoutWindowClosure(t)}},{key:"closeWindow",value:function(){this.mainWindowClosed()}},{key:"checkForPopoutWindowClosure",value:function(e){var t=this;this.interval=setInterval(function(){e.closed&&(clearInterval(t.interval),t.props.onClosing&&t.props.onClosing())},500)}},{key:"mainWindowClosed",value:function(){this.state.popoutWindow&&this.state.popoutWindow.close(),(this.props.window||window).removeEventListener("unload",this.mainWindowClosed)}},{key:"popoutWindowUnloading",value:function(){this.state.container&&(clearInterval(this.interval),this.root.unmount(this.state.container),this.props.onClosing&&this.props.onClosing())}},{key:"renderToContainer",value:function(e,t,n){if(e){var r=n;"function"==typeof n&&(r=n(t)),this.root||(this.root=(0,f.createRoot)(e)),this.root.render(r)}}},{key:"render",value:function(){return null}}]),t}(s.default.Component);y.defaultProps={url:"about:blank",containerId:"popout-content-container",containerClassName:"",onError:function(){}},y.propTypes={title:p.default.string.isRequired,url:p.default.string,onClosing:p.default.func,options:p.default.object,window:p.default.object,containerId:p.default.string,containerClassName:p.default.string,children:p.default.oneOfType([p.default.element,p.default.func]),onError:p.default.func},t.default=y},function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e){var r=n(8);if("production"===e.env.NODE_ENV)t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot;else{var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t.createRoot=function(e,t){o.usingClientEntryPoint=!0;try{return r.createRoot(e,t)}finally{o.usingClientEntryPoint=!1}},t.hydrateRoot=function(e,t,n){o.usingClientEntryPoint=!0;try{return r.hydrateRoot(e,t,n)}finally{o.usingClientEntryPoint=!1}}}}).call(t,n(0))},function(e,n){e.exports=t},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r=n(2);e.exports=n(12)(r.isElement,!0)}else e.exports=n(15)()}).call(t,n(0))},function(e,t,n){"use strict";function r(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case d:case y:case c:case f:case s:case h:return e;default:switch(e=e&&e.$$typeof){case p:case m:case w:case b:case l:return e;default:return t}}case u:return t}}}function o(e){return r(e)===y}/** @license React v16.13.1 | ||
* react-is.production.min.js | ||
@@ -17,3 +17,3 @@ * | ||
*/ | ||
"production"!==e.env.NODE_ENV&&function(){function e(e){return"string"==typeof e||"function"==typeof e||e===w||e===T||e===O||e===g||e===_||e===P||"object"==typeof e&&null!==e&&(e.$$typeof===$||e.$$typeof===C||e.$$typeof===E||e.$$typeof===S||e.$$typeof===j||e.$$typeof===W||e.$$typeof===R||e.$$typeof===I||e.$$typeof===k)}function n(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case v:var n=e.type;switch(n){case x:case T:case w:case O:case g:case _:return n;default:var r=n&&n.$$typeof;switch(r){case S:case j:case $:case C:case E:return r;default:return t}}case b:return t}}}function r(e){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),o(e)||n(e)===x}function o(e){return n(e)===T}function i(e){return n(e)===S}function a(e){return n(e)===E}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===v}function c(e){return n(e)===j}function s(e){return n(e)===w}function f(e){return n(e)===$}function l(e){return n(e)===C}function p(e){return n(e)===b}function d(e){return n(e)===O}function y(e){return n(e)===g}function m(e){return n(e)===_}var h="function"==typeof Symbol&&Symbol.for,v=h?Symbol.for("react.element"):60103,b=h?Symbol.for("react.portal"):60106,w=h?Symbol.for("react.fragment"):60107,g=h?Symbol.for("react.strict_mode"):60108,O=h?Symbol.for("react.profiler"):60114,E=h?Symbol.for("react.provider"):60109,S=h?Symbol.for("react.context"):60110,x=h?Symbol.for("react.async_mode"):60111,T=h?Symbol.for("react.concurrent_mode"):60111,j=h?Symbol.for("react.forward_ref"):60112,_=h?Symbol.for("react.suspense"):60113,P=h?Symbol.for("react.suspense_list"):60120,C=h?Symbol.for("react.memo"):60115,$=h?Symbol.for("react.lazy"):60116,k=h?Symbol.for("react.block"):60121,W=h?Symbol.for("react.fundamental"):60117,R=h?Symbol.for("react.responder"):60118,I=h?Symbol.for("react.scope"):60119,N=x,L=T,M=S,A=E,D=v,V=j,F=w,q=$,U=C,z=b,Y=O,B=g,J=_,H=!1;t.AsyncMode=N,t.ConcurrentMode=L,t.ContextConsumer=M,t.ContextProvider=A,t.Element=D,t.ForwardRef=V,t.Fragment=F,t.Lazy=q,t.Memo=U,t.Portal=z,t.Profiler=Y,t.StrictMode=B,t.Suspense=J,t.isAsyncMode=r,t.isConcurrentMode=o,t.isContextConsumer=i,t.isContextProvider=a,t.isElement=u,t.isForwardRef=c,t.isFragment=s,t.isLazy=f,t.isMemo=l,t.isPortal=p,t.isProfiler=d,t.isStrictMode=y,t.isSuspense=m,t.isValidElementType=e,t.typeOf=n}()}).call(t,n(0))},function(e,t,n){"use strict";(function(t){function r(){return null}var o=n(2),i=n(13),a=n(1),u=n(3),c=n(14),s=function(){};"production"!==t.env.NODE_ENV&&(s=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),e.exports=function(e,n){function f(e){var t=e&&(C&&e[C]||e[$]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function d(e){function r(r,u,c,f,l,d,y){if(f=f||k,d=d||c,y!==a){if(n){var m=new Error("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");throw m.name="Invariant Violation",m}if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var h=f+":"+c;!o[h]&&i<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+f+"`. 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."),o[h]=!0,i++)}}return null==u[c]?r?new p(null===u[c]?"The "+l+" `"+d+"` is marked as required in `"+f+"`, but its value is `null`.":"The "+l+" `"+d+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(u,c,f,l,d)}if("production"!==t.env.NODE_ENV)var o={},i=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function y(e){function t(t,n,r,o,i,a){var u=t[n];if(T(u)!==e)return new p("Invalid "+o+" `"+i+"` of type `"+j(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e});return null}return d(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){return new p("Invalid "+o+" `"+i+"` of type `"+T(u)+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<u.length;c++){var s=e(u,c,r,o,i+"["+c+"]",a);if(s instanceof Error)return s}return null}return d(t)}function h(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||k;return new p("Invalid "+o+" `"+i+"` of type `"+P(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return d(t)}function v(e){function n(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(l(a,e[u]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===j(t)?String(t):t});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+c+".")}return Array.isArray(e)?d(n):("production"!==t.env.NODE_ENV&&s(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),r)}function b(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],s=T(c);if("object"!==s)return new p("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var f in c)if(u(c,f)){var l=e(c,f,r,o,i+"."+f,a);if(l instanceof Error)return l}return null}return d(t)}function w(e){function n(t,n,r,o,i){for(var c=[],s=0;s<e.length;s++){var f=e[s],l=f(t,n,r,o,i,a);if(null==l)return null;l.data&&u(l.data,"expectedType")&&c.push(l.data.expectedType)}return new p("Invalid "+o+" `"+i+"` supplied to `"+r+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&s("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var o=0;o<e.length;o++){var i=e[o];if("function"!=typeof i)return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(i)+" at index "+o+"."),r}return d(n)}function g(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function O(e){function t(t,n,r,o,i){var u=t[n],c=T(u);if("object"!==c)return new p("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var s in e){var f=e[s];if("function"!=typeof f)return g(r,o,i,s,j(f));var l=f(u,s,r,o,i+"."+s,a);if(l)return l}return null}return d(t)}function E(e){function t(t,n,r,o,c){var s=t[n],f=T(s);if("object"!==f)return new p("Invalid "+o+" `"+c+"` of type `"+f+"` supplied to `"+r+"`, expected `object`.");var l=i({},t[n],e);for(var d in l){var y=e[d];if(u(e,d)&&"function"!=typeof y)return g(r,o,c,d,j(y));if(!y)return new p("Invalid "+o+" `"+c+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=y(s,d,r,o,c+"."+d,a);if(m)return m}return null}return d(t)}function S(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(S);if(null===t||e(t))return!0;var n=f(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!S(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!S(i[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function j(e){if(void 0===e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=j(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function P(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var C="function"==typeof Symbol&&Symbol.iterator,$="@@iterator",k="<<anonymous>>",W={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:function(){return d(r)}(),arrayOf:m,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new p("Invalid "+o+" `"+i+"` of type `"+T(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return d(t)}(),elementType:function(){function e(e,t,n,r,i){var a=e[t];if(!o.isValidElementType(a)){return new p("Invalid "+r+" `"+i+"` of type `"+T(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}return null}return d(e)}(),instanceOf:h,node:function(){function e(e,t,n,r,o){return S(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return d(e)}(),objectOf:b,oneOf:v,oneOfType:w,shape:O,exact:E};return p.prototype=Error.prototype,W.checkPropTypes=c,W.resetWarningCache=c.resetWarningCache,W.PropTypes=W,W}}).call(t,n(0))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* | ||
"production"!==e.env.NODE_ENV&&function(){function e(e){return"string"==typeof e||"function"==typeof e||e===w||e===T||e===O||e===g||e===_||e===C||"object"==typeof e&&null!==e&&(e.$$typeof===$||e.$$typeof===P||e.$$typeof===E||e.$$typeof===S||e.$$typeof===j||e.$$typeof===W||e.$$typeof===R||e.$$typeof===N||e.$$typeof===k)}function n(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case v:var n=e.type;switch(n){case x:case T:case w:case O:case g:case _:return n;default:var r=n&&n.$$typeof;switch(r){case S:case j:case $:case P:case E:return r;default:return t}}case b:return t}}}function r(e){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),o(e)||n(e)===x}function o(e){return n(e)===T}function i(e){return n(e)===S}function a(e){return n(e)===E}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===v}function c(e){return n(e)===j}function s(e){return n(e)===w}function f(e){return n(e)===$}function l(e){return n(e)===P}function p(e){return n(e)===b}function d(e){return n(e)===O}function y(e){return n(e)===g}function m(e){return n(e)===_}var h="function"==typeof Symbol&&Symbol.for,v=h?Symbol.for("react.element"):60103,b=h?Symbol.for("react.portal"):60106,w=h?Symbol.for("react.fragment"):60107,g=h?Symbol.for("react.strict_mode"):60108,O=h?Symbol.for("react.profiler"):60114,E=h?Symbol.for("react.provider"):60109,S=h?Symbol.for("react.context"):60110,x=h?Symbol.for("react.async_mode"):60111,T=h?Symbol.for("react.concurrent_mode"):60111,j=h?Symbol.for("react.forward_ref"):60112,_=h?Symbol.for("react.suspense"):60113,C=h?Symbol.for("react.suspense_list"):60120,P=h?Symbol.for("react.memo"):60115,$=h?Symbol.for("react.lazy"):60116,k=h?Symbol.for("react.block"):60121,W=h?Symbol.for("react.fundamental"):60117,R=h?Symbol.for("react.responder"):60118,N=h?Symbol.for("react.scope"):60119,I=x,L=T,M=S,A=E,D=v,V=j,F=w,q=$,U=P,z=b,Y=O,B=g,J=_,H=!1;t.AsyncMode=I,t.ConcurrentMode=L,t.ContextConsumer=M,t.ContextProvider=A,t.Element=D,t.ForwardRef=V,t.Fragment=F,t.Lazy=q,t.Memo=U,t.Portal=z,t.Profiler=Y,t.StrictMode=B,t.Suspense=J,t.isAsyncMode=r,t.isConcurrentMode=o,t.isContextConsumer=i,t.isContextProvider=a,t.isElement=u,t.isForwardRef=c,t.isFragment=s,t.isLazy=f,t.isMemo=l,t.isPortal=p,t.isProfiler=d,t.isStrictMode=y,t.isSuspense=m,t.isValidElementType=e,t.typeOf=n}()}).call(t,n(0))},function(e,t,n){"use strict";(function(t){function r(){return null}var o=n(2),i=n(13),a=n(1),u=n(3),c=n(14),s=function(){};"production"!==t.env.NODE_ENV&&(s=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),e.exports=function(e,n){function f(e){var t=e&&(P&&e[P]||e[$]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function d(e){function r(r,u,c,f,l,d,y){if(f=f||k,d=d||c,y!==a){if(n){var m=new Error("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");throw m.name="Invariant Violation",m}if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var h=f+":"+c;!o[h]&&i<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+f+"`. 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."),o[h]=!0,i++)}}return null==u[c]?r?new p(null===u[c]?"The "+l+" `"+d+"` is marked as required in `"+f+"`, but its value is `null`.":"The "+l+" `"+d+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(u,c,f,l,d)}if("production"!==t.env.NODE_ENV)var o={},i=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function y(e){function t(t,n,r,o,i,a){var u=t[n];if(T(u)!==e)return new p("Invalid "+o+" `"+i+"` of type `"+j(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e});return null}return d(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){return new p("Invalid "+o+" `"+i+"` of type `"+T(u)+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<u.length;c++){var s=e(u,c,r,o,i+"["+c+"]",a);if(s instanceof Error)return s}return null}return d(t)}function h(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||k;return new p("Invalid "+o+" `"+i+"` of type `"+C(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return d(t)}function v(e){function n(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(l(a,e[u]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===j(t)?String(t):t});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+c+".")}return Array.isArray(e)?d(n):("production"!==t.env.NODE_ENV&&s(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),r)}function b(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],s=T(c);if("object"!==s)return new p("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var f in c)if(u(c,f)){var l=e(c,f,r,o,i+"."+f,a);if(l instanceof Error)return l}return null}return d(t)}function w(e){function n(t,n,r,o,i){for(var c=[],s=0;s<e.length;s++){var f=e[s],l=f(t,n,r,o,i,a);if(null==l)return null;l.data&&u(l.data,"expectedType")&&c.push(l.data.expectedType)}return new p("Invalid "+o+" `"+i+"` supplied to `"+r+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&s("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var o=0;o<e.length;o++){var i=e[o];if("function"!=typeof i)return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(i)+" at index "+o+"."),r}return d(n)}function g(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function O(e){function t(t,n,r,o,i){var u=t[n],c=T(u);if("object"!==c)return new p("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var s in e){var f=e[s];if("function"!=typeof f)return g(r,o,i,s,j(f));var l=f(u,s,r,o,i+"."+s,a);if(l)return l}return null}return d(t)}function E(e){function t(t,n,r,o,c){var s=t[n],f=T(s);if("object"!==f)return new p("Invalid "+o+" `"+c+"` of type `"+f+"` supplied to `"+r+"`, expected `object`.");var l=i({},t[n],e);for(var d in l){var y=e[d];if(u(e,d)&&"function"!=typeof y)return g(r,o,c,d,j(y));if(!y)return new p("Invalid "+o+" `"+c+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=y(s,d,r,o,c+"."+d,a);if(m)return m}return null}return d(t)}function S(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(S);if(null===t||e(t))return!0;var n=f(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!S(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!S(i[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function j(e){if(void 0===e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=j(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function C(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var P="function"==typeof Symbol&&Symbol.iterator,$="@@iterator",k="<<anonymous>>",W={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:function(){return d(r)}(),arrayOf:m,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new p("Invalid "+o+" `"+i+"` of type `"+T(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return d(t)}(),elementType:function(){function e(e,t,n,r,i){var a=e[t];if(!o.isValidElementType(a)){return new p("Invalid "+r+" `"+i+"` of type `"+T(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}return null}return d(e)}(),instanceOf:h,node:function(){function e(e,t,n,r,o){return S(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return d(e)}(),objectOf:b,oneOf:v,oneOfType:w,shape:O,exact:E};return p.prototype=Error.prototype,W.checkPropTypes=c,W.resetWarningCache=c.resetWarningCache,W.PropTypes=W,W}}).call(t,n(0))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* | ||
object-assign | ||
@@ -20,0 +20,0 @@ (c) Sindre Sorhus |
@@ -28,2 +28,3 @@ import React from 'react'; | ||
containerId: 'popout-content-container', | ||
containerClassName: '', | ||
onError: () => {} | ||
@@ -43,2 +44,3 @@ }; | ||
containerId: PropTypes.string, | ||
containerClassName: PropTypes.string, | ||
children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]), | ||
@@ -115,2 +117,3 @@ onError: PropTypes.func | ||
container.id = this.props.containerId; | ||
container.className = this.props.containerClassName; | ||
popoutWindow.document.body.appendChild(container); | ||
@@ -117,0 +120,0 @@ |
{ | ||
"name": "react-popout", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Wraps window.open in a react component, allowing the contents to be part of your react render tree", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-popout.min.js", |
249323
27
1239