react-modal-global
Advanced tools
Comparing version 0.9.13 to 0.9.14
@@ -10,5 +10,5 @@ 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react"),extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var e in c)Object.prototype.hasOwnProperty.call(c,e)&&(a[e]=c[e])};return extendStatics(d,b)}; | ||
a),{forkedQueue:c})}):modalPrivate.dispatch(function(a){var c=a.queue.filter(function(e){return e!==b});return b.params.weak||0!==c.length?__assign(__assign({},a),{queue:c,active:!1}):__assign(__assign({},a),{active:!1,queue:[b]})})};d.closeAll=function(){modalPrivate.dispatch(function(b){b.queue.forEach(function(a){return a.close()});return DEFAULT_STATE})};return d}(),modalContext=react.createContext(null),ModalContainer=function(d){function b(a){a=d.call(this,a)||this;a.state={active:!1,queue:[], | ||
forkedQueue:[]};modalPrivate.dispatch=a.setState.bind(a);return a}__extends(b,d);Object.defineProperty(b.prototype,"className",{get:function(){return this.props.className||"modal"},enumerable:!1,configurable:!0});b.prototype.render=function(){var a,c,e=this.state,f=e.active;e=e.queue;e=e[e.length-1];var g=(null===(a=null===e||void 0===e?void 0:e.params)||void 0===a?0:a.closable)?stopPropagation(close):void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",__assign({className:classWithModifiers(this.className, | ||
forkedQueue:[]};modalPrivate.dispatch=a.setState.bind(a);return a}__extends(b,d);Object.defineProperty(b.prototype,"className",{get:function(){return this.props.className||"modal"},enumerable:!1,configurable:!0});b.prototype.render=function(){var a,c,e=this.state,f=e.active;e=e.queue;e=e[e.length-1];var g=(null===(a=null===e||void 0===e?void 0:e.params)||void 0===a?0:a.closable)?stopPropagation(e.close):void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",__assign({className:classWithModifiers(this.className, | ||
f&&"active"),"aria-modal":!0,"aria-hidden":!f},{children:jsxRuntime.jsx("div",__assign({className:this.className+"__container",onClick:g},{children:jsxRuntime.jsx(modalContext.Provider,__assign({value:e||null},{children:(null===e||void 0===e?void 0:e.component)&&jsxRuntime.jsx(e.component,__assign({},e.params))}))}))}),null===(c=null===e||void 0===e?void 0:e.params)||void 0===c?void 0:c.id),this.renderForks()]})};b.prototype.renderForks=function(){var a=this;return this.state.forkedQueue.map(function(c){var e; | ||
return jsxRuntime.jsx("div",__assign({className:a.className,"aria-modal":!0},{children:jsxRuntime.jsx("div",__assign({className:a.className+"__container",onClick:(null===(e=c.params)||void 0===e?0:e.closable)?stopPropagation(c.close):void 0},{children:jsxRuntime.jsx(modalContext.Provider,__assign({value:c},{children:jsxRuntime.jsx(c.component,__assign({},c.params))}))}))}),c.params.id)})};return b}(react.Component); | ||
function useModalContext(){var d=react.useContext(modalContext);if(!d)throw Error("ModalError: Out of Modal context");return d}exports.Modal=Modal;exports.ModalContainer=ModalContainer;exports.useModalContext=useModalContext |
{ | ||
"name": "react-modal-global", | ||
"version": "0.9.13", | ||
"version": "0.9.14", | ||
"description": "React Modal but Global", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15940
4