lightweight-react-modal
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("ReactModal",["react","react-dom"],t):"object"==typeof exports?exports.ReactModal=t(require("react"),require("react-dom")):e.ReactModal=t(e.React,e.ReactDOM)}(global,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var o,r=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},o=[],r=0;r<e.length;r++){var i=e[r],l=t.base?i[0]+t.base:i[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var p=s(u),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:u,updater:y(d,t),references:1}),o.push(u)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var r=n.nc;r&&(o.nonce=r)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,p=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function d(e,t,n,o){var r=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=p(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,n){var o=n.css,r=n.media,i=n.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var h=null,m=0;function y(e,t){var n,o,r;if(t.singleton){var i=m++;n=h||(h=c(t)),o=d.bind(null,n,i,!1),r=d.bind(null,n,i,!0)}else n=c(t),o=f.bind(null,n,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var r=s(n[o]);a[r].references--}for(var i=l(e,t),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=i}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(a=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([r]).join("\n")}var a,s,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(o)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);o&&r[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,t,n){var o,r="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},i=n(16);"undefined"!=typeof document?o=document:(o=r["__GLOBAL_DOCUMENT_CACHE@4"])||(o=r["__GLOBAL_DOCUMENT_CACHE@4"]=i),e.exports=o},function(e,t,n){var o=n(1),r=n(25);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t){var n=Array.prototype.slice;e.exports=function(e,t){"length"in e||(e=[e]);e=n.call(e);for(;e.length;){var o=e.shift(),r=t(o);if(r)return r;o.childNodes&&o.childNodes.length&&(e=n.call(o.childNodes).concat(e))}}},function(e,t,n){var o=n(5),r=n(7),i=n(8),a=n(9),s=n(20),l="http://www.w3.org/1999/xhtml";function c(e,t,n){if(!(this instanceof c))return new c(e);var o=void 0===n?l:n||null;this.tagName=o===l?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=o,this._attributes={},"INPUT"===this.tagName&&(this.type="text")}e.exports=c,c.prototype.type="DOMElement",c.prototype.nodeType=1,c.prototype.appendChild=function(e){return e.parentNode&&e.parentNode.removeChild(e),this.childNodes.push(e),e.parentNode=this,e},c.prototype.replaceChild=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var n=this.childNodes.indexOf(t);return t.parentNode=null,this.childNodes[n]=e,e.parentNode=this,t},c.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);return this.childNodes.splice(t,1),e.parentNode=null,e},c.prototype.insertBefore=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var n=null==t?-1:this.childNodes.indexOf(t);return n>-1?this.childNodes.splice(n,0,e):this.childNodes.push(e),e.parentNode=this,e},c.prototype.setAttributeNS=function(e,t,n){var o=null,r=t,i=t.indexOf(":");(i>-1&&(o=t.substr(0,i),r=t.substr(i+1)),"INPUT"===this.tagName&&"type"===t)?this.type=n:(this._attributes[e]||(this._attributes[e]={}))[r]={value:n,prefix:o}},c.prototype.getAttributeNS=function(e,t){var n=this._attributes[e],o=n&&n[t]&&n[t].value;return"INPUT"===this.tagName&&"type"===t?this.type:"string"!=typeof o?null:o},c.prototype.removeAttributeNS=function(e,t){var n=this._attributes[e];n&&delete n[t]},c.prototype.hasAttributeNS=function(e,t){var n=this._attributes[e];return!!n&&t in n},c.prototype.setAttribute=function(e,t){return this.setAttributeNS(null,e,t)},c.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)},c.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)},c.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)},c.prototype.removeEventListener=a,c.prototype.addEventListener=i,c.prototype.dispatchEvent=r,c.prototype.focus=function(){},c.prototype.toString=function(){return s(this)},c.prototype.getElementsByClassName=function(e){var t=e.split(" "),n=[];return o(this,(function(e){if(1===e.nodeType){var o=(e.className||"").split(" ");t.every((function(e){return-1!==o.indexOf(e)}))&&n.push(e)}})),n},c.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var t=[];return o(this.childNodes,(function(n){1!==n.nodeType||"*"!==e&&n.tagName.toLowerCase()!==e||t.push(n)})),t},c.prototype.contains=function(e){return o(this,(function(t){return e===t}))||!1}},function(e,t){e.exports=function(e){var t=this,n=e.type;e.target||(e.target=t);t.listeners||(t.listeners={});var o=t.listeners[n];if(o)return o.forEach((function(n){e.currentTarget=t,"function"==typeof n?n(e):n.handleEvent(e)}));t.parentNode&&t.parentNode.dispatchEvent(e)}},function(e,t){e.exports=function(e,t){this.listeners||(this.listeners={});this.listeners[e]||(this.listeners[e]=[]);-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)}},function(e,t){e.exports=function(e,t){if(!this.listeners)return;if(!this.listeners[e])return;var n=this.listeners[e],o=n.indexOf(t);-1!==o&&n.splice(o,1)}},function(e,n){e.exports=t},function(e,t,n){var o=n(1),r=n(23);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(24);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(26);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(27);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(28);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(17);e.exports=new o},function(e,t,n){var o=n(5),r=n(18),i=n(19),a=n(6),s=n(21),l=n(22),c=n(7),u=n(8),p=n(9);function d(){if(!(this instanceof d))return new d;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}e.exports=d;var f=d.prototype;f.createTextNode=function(e){return new i(e,this)},f.createElementNS=function(e,t){var n=null===e?null:String(e);return new a(t,this,n)},f.createElement=function(e){return new a(e,this)},f.createDocumentFragment=function(){return new s(this)},f.createEvent=function(e){return new l(e)},f.createComment=function(e){return new r(e,this)},f.getElementById=function(e){return e=String(e),o(this.childNodes,(function(t){if(String(t.id)===e)return t}))||null},f.getElementsByClassName=a.prototype.getElementsByClassName,f.getElementsByTagName=a.prototype.getElementsByTagName,f.contains=a.prototype.contains,f.removeEventListener=p,f.addEventListener=u,f.dispatchEvent=c},function(e,t){function n(e,t){if(!(this instanceof n))return new n(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}e.exports=n,n.prototype.nodeType=8,n.prototype.nodeName="#comment",n.prototype.toString=function(){return"[object Comment]"}},function(e,t){function n(e,t){if(!(this instanceof n))return new n(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}e.exports=n,n.prototype.type="DOMTextNode",n.prototype.nodeType=3,n.prototype.nodeName="#text",n.prototype.toString=function(){return this.data},n.prototype.replaceData=function(e,t,n){var o=this.data,r=o.substring(0,e),i=o.substring(e+t,o.length);this.data=r+n+i,this.length=this.data.length}},function(e,t){e.exports=o;var n=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function o(e){switch(e.nodeType){case 3:return a(e.data);case 8:return"\x3c!--"+e.data+"--\x3e";default:return function(e){var t=[],s=e.tagName;"http://www.w3.org/1999/xhtml"===e.namespaceURI&&(s=s.toLowerCase());t.push("<"+s+function(e){var t=[];for(var n in e)r(e,n)&&t.push({name:n,value:e[n]});for(var o in e._attributes)for(var a in e._attributes[o]){var s=e._attributes[o][a],l=(s.prefix?s.prefix+":":"")+a;t.push({name:l,value:s.value})}e.className&&t.push({name:"class",value:e.className});return t.length?i(t):""}(e)+function(e){var t=e.dataset,n=[];for(var o in t)n.push({name:"data-"+o,value:t[o]});return n.length?i(n):""}(e)),n.indexOf(s)>-1?t.push(" />"):(t.push(">"),e.childNodes.length?t.push.apply(t,e.childNodes.map(o)):e.textContent||e.innerText?t.push(a(e.textContent||e.innerText)):e.innerHTML&&t.push(e.innerHTML),t.push("</"+s+">"));return t.join("")}(e)}}function r(e,t){var n=typeof e[t];return"style"===t&&Object.keys(e.style).length>0||e.hasOwnProperty(t)&&("string"===n||"boolean"===n||"number"===n)&&"nodeName"!==t&&"className"!==t&&"tagName"!==t&&"textContent"!==t&&"innerText"!==t&&"namespaceURI"!==t&&"innerHTML"!==t}function i(e){var t=[];return e.forEach((function(e){var n=e.name,o=e.value;"style"===n&&(o=function(e){if("string"==typeof e)return e;var t="";return Object.keys(e).forEach((function(n){var o=e[n];n=n.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})),t+=n+":"+o+";"})),t}(o)),t.push(n+'="'+a(o).replace(/"/g,""")+'"')})),t.length?" "+t.join(" "):""}function a(e){var t="";return"string"==typeof e?t=e:e&&(t=e.toString()),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}},function(e,t,n){var o=n(6);function r(e){if(!(this instanceof r))return new r;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}e.exports=r,r.prototype.type="DocumentFragment",r.prototype.nodeType=11,r.prototype.nodeName="#document-fragment",r.prototype.appendChild=o.prototype.appendChild,r.prototype.replaceChild=o.prototype.replaceChild,r.prototype.removeChild=o.prototype.removeChild,r.prototype.toString=function(){return this.childNodes.map((function(e){return String(e)})).join("")}},function(e,t){function n(e){}e.exports=n,n.prototype.initEvent=function(e,t,n){this.type=e,this.bubbles=t,this.cancelable=n},n.prototype.preventDefault=function(){}},function(e,t,n){(t=n(2)(!1)).push([e.i,".CloseButton__closeButton___7Ly4d {\n position: absolute;\n right: 10px;\n top: 10px;\n background: none;\n border: none;\n color: grey;\n font-size: 18px;\n font-weight: bold;\n cursor: pointer;\n &:hover {\n color: black;\n }\n &:focus {\n color: black;\n outline: 0;\n }\n}\n",""]),t.locals={closeButton:"CloseButton__closeButton___7Ly4d"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".Overlay__overlay___tUvmS {\n position: fixed;\n z-index: 99998;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n background: rgba(0, 0, 0, .4);\n}\n",""]),t.locals={overlay:"Overlay__overlay___tUvmS"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".Modal__wrapper___m_Cul {\n position: fixed;\n z-index: 99998;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.Modal__modal___2hKHM {\n position: relative;\n z-index: 99999;\n background: white;\n box-sizing: border-box;\n border: 1px solid grey;\n border-radius: 3px;\n height: 90%;\n width: 90%;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n}",""]),t.locals={wrapper:"Modal__wrapper___m_Cul",modal:"Modal__modal___2hKHM"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".ModalHeader__header___HzZTU {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1px solid grey;\n padding: 15px 20px;\n box-sizing: border-box;\n}",""]),t.locals={header:"ModalHeader__header___HzZTU"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".ModalFooter__footer___WfO3n {\n flex-shrink: 0;\n border-top: 1px solid grey;\n padding: 15px 20px;\n box-sizing: border-box;\n}\n",""]),t.locals={footer:"ModalFooter__footer___WfO3n"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".ModalContent__content___3yWji {\n flex-grow: 1;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n height: auto;\n margin: 20px 15px;\n}\n",""]),t.locals={content:"ModalContent__content___3yWji"},e.exports=t},function(e,t,n){"use strict";n.r(t),n.d(t,"Modal",(function(){return O})),n.d(t,"ModalHeader",(function(){return M})),n.d(t,"ModalFooter",(function(){return L})),n.d(t,"ModalContent",(function(){return I})),n.d(t,"ModalProvider",(function(){return z})),n.d(t,"useModalContext",(function(){return F}));var o=n(0),r=n.n(o),i=n(10),a=n(3),s=n.n(a);let l=[];const c=(e,t)=>{let n=null;return r.a.Children.map(t,t=>{var o,r;return(null==t?void 0:t.props)&&(null===(o=null==t?void 0:t.props)||void 0===o?void 0:o.children)?void((null===(r=null==t?void 0:t.type)||void 0===r?void 0:r.displayName)&&t.type.displayName===e&&(n=t)):null}),n},u=(e,t)=>{if(!e)return!1;const[n,r]=Object(o.useState)(!1),i=e=>{if(27===e.keyCode){if(!(e=>l.indexOf(e.current)===l.length-1)(t))return;r(!0)}};return Object(o.useEffect)(()=>(s.a.addEventListener("keydown",i),()=>s.a.removeEventListener("keydown",i)),[]),n},p=(...e)=>e.filter(e=>!0==!!e).join(" ");var d=n(11),f=n.n(d);const h=r.a.memo(({onClick:e=(()=>{}),icon:t=null,className:n=null})=>r.a.createElement("button",{role:"button",className:p(f.a.closeButton,n),onClick:e},t||"x"));h.displayName="CloseButton";var m=h,y=n(12),v=n.n(y);const b=r.a.memo(({onClick:e=(()=>{}),className:t=null})=>r.a.createElement("div",{onClick:e,className:p(v.a.overlay,t)}));b.displayName="Overlay";var g=b,x=n(4),N=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const _=e=>{var{onClose:t=null,fluid:n=!1,closable:a=!0,maxHeight:s=500,minHeight:d=100,maxWidth:f=500,minWidth:h=200,children:y=null,customClassNames:v={wrapper:null,modal:null,closeBtn:null,overlay:null},closeButtonIcon:b=null}=e,_=N(e,["onClose","fluid","closable","maxHeight","minHeight","maxWidth","minWidth","children","customClassNames","closeButtonIcon"]);const O=Object(o.useCallback)((e=>c("ModalHeader",e))(y),[y]),C=Object(o.useCallback)((e=>c("ModalFooter",e))(y),[y]),w=Object(o.useCallback)((e=>c("ModalContent",e))(y),[y]),j=Object(o.useRef)();Object(o.useEffect)(()=>{var e;e=j,l=[...l,e.current]},[j]);const E=u(a,j),M=Object(o.useCallback)(()=>{var e;a&&t&&(e=j,l=l.filter(t=>t!==e.current),t())},[a,t,j]);return Object(o.useEffect)(()=>{E&&M()},[E]),Object(i.createPortal)(r.a.createElement("div",Object.assign({},_,{className:p(x.wrapper,v.wrapper)}),r.a.createElement("div",{ref:j,className:p(x.modal,v.modal),style:{maxWidth:`${n?"":`${f}px`}`,minWidth:`${n?"":`${h}px`}`,maxHeight:`${n?"":`${s}px`}`,minHeight:`${n?"":`${d}px`}`}},a&&r.a.createElement(m,{className:v.closeBtn,onClick:M,icon:b}),O&&O,w&&w,C&&C),r.a.createElement(g,{onClick:M,className:v.overlay})),document.body)};_.displayName="Modal";var O=r.a.memo(_),C=n(13),w=n.n(C),j=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const E=r.a.memo(e=>{var{children:t,className:n=null}=e,o=j(e,["children","className"]);return r.a.createElement("div",Object.assign({},o,{className:p(w.a.header,n)}),t)});E.displayName="ModalHeader";var M=E,S=n(14),T=n.n(S),k=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const B=r.a.memo(e=>{var{children:t,className:n}=e,o=k(e,["children","className"]);return r.a.createElement("div",Object.assign({},o,{className:p(T.a.footer,n)}),t)});B.displayName="ModalFooter";var L=B,P=n(15),A=n.n(P),H=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const U=r.a.memo(e=>{var{children:t,className:n}=e,o=H(e,["children","className"]);return r.a.createElement("div",Object.assign({},o,{className:p(A.a.content,n)}),t)});U.displayName="ModalContent";var I=U;var R=r.a.createContext({});const D=({children:e})=>r.a.createElement(R.Consumer,null,t=>r.a.cloneElement(e,{modal:t}));D.displayName="ModalConsumer";var W=r.a.memo(D);var z=r.a.memo(({children:e})=>{const[t,n]=Object(o.useState)([]),i=e=>t.includes(e),a=e=>!t.includes(e),s=Object(o.useCallback)(e=>{i(e)||n([...t,e])},[i,t]),l=Object(o.useCallback)(e=>{if(a(e))return;const o=t.filter(t=>t!==e);n(o)},[t,a]),c=Object(o.useCallback)(()=>{t.length>0&&n([])},[t]),u=Object(o.useCallback)(e=>{i(e)?l(e):s(e)},[i]),p={open:e=>s(e),close:e=>l(e),toggle:e=>u(e),closeAll:()=>c(),isOpen:e=>i(e),isClose:e=>a(e),list:t};return r.a.createElement(R.Provider,{value:p},r.a.createElement(W,null,e))});var F=()=>Object(o.useContext)(R)}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("ReactModal",["react","react-dom"],t):"object"==typeof exports?exports.ReactModal=t(require("react"),require("react-dom")):e.ReactModal=t(e.React,e.ReactDOM)}(global,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var o,r=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},o=[],r=0;r<e.length;r++){var i=e[r],l=t.base?i[0]+t.base:i[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var p=s(u),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:u,updater:y(d,t),references:1}),o.push(u)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var r=n.nc;r&&(o.nonce=r)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,p=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function d(e,t,n,o){var r=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=p(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,n){var o=n.css,r=n.media,i=n.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var h=null,m=0;function y(e,t){var n,o,r;if(t.singleton){var i=m++;n=h||(h=c(t)),o=d.bind(null,n,i,!1),r=d.bind(null,n,i,!0)}else n=c(t),o=f.bind(null,n,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var r=s(n[o]);a[r].references--}for(var i=l(e,t),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=i}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(a=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([r]).join("\n")}var a,s,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(o)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);o&&r[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,t,n){var o,r="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},i=n(16);"undefined"!=typeof document?o=document:(o=r["__GLOBAL_DOCUMENT_CACHE@4"])||(o=r["__GLOBAL_DOCUMENT_CACHE@4"]=i),e.exports=o},function(e,t,n){var o=n(1),r=n(25);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t){var n=Array.prototype.slice;e.exports=function(e,t){"length"in e||(e=[e]);e=n.call(e);for(;e.length;){var o=e.shift(),r=t(o);if(r)return r;o.childNodes&&o.childNodes.length&&(e=n.call(o.childNodes).concat(e))}}},function(e,t,n){var o=n(5),r=n(7),i=n(8),a=n(9),s=n(20),l="http://www.w3.org/1999/xhtml";function c(e,t,n){if(!(this instanceof c))return new c(e);var o=void 0===n?l:n||null;this.tagName=o===l?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=o,this._attributes={},"INPUT"===this.tagName&&(this.type="text")}e.exports=c,c.prototype.type="DOMElement",c.prototype.nodeType=1,c.prototype.appendChild=function(e){return e.parentNode&&e.parentNode.removeChild(e),this.childNodes.push(e),e.parentNode=this,e},c.prototype.replaceChild=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var n=this.childNodes.indexOf(t);return t.parentNode=null,this.childNodes[n]=e,e.parentNode=this,t},c.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);return this.childNodes.splice(t,1),e.parentNode=null,e},c.prototype.insertBefore=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var n=null==t?-1:this.childNodes.indexOf(t);return n>-1?this.childNodes.splice(n,0,e):this.childNodes.push(e),e.parentNode=this,e},c.prototype.setAttributeNS=function(e,t,n){var o=null,r=t,i=t.indexOf(":");(i>-1&&(o=t.substr(0,i),r=t.substr(i+1)),"INPUT"===this.tagName&&"type"===t)?this.type=n:(this._attributes[e]||(this._attributes[e]={}))[r]={value:n,prefix:o}},c.prototype.getAttributeNS=function(e,t){var n=this._attributes[e],o=n&&n[t]&&n[t].value;return"INPUT"===this.tagName&&"type"===t?this.type:"string"!=typeof o?null:o},c.prototype.removeAttributeNS=function(e,t){var n=this._attributes[e];n&&delete n[t]},c.prototype.hasAttributeNS=function(e,t){var n=this._attributes[e];return!!n&&t in n},c.prototype.setAttribute=function(e,t){return this.setAttributeNS(null,e,t)},c.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)},c.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)},c.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)},c.prototype.removeEventListener=a,c.prototype.addEventListener=i,c.prototype.dispatchEvent=r,c.prototype.focus=function(){},c.prototype.toString=function(){return s(this)},c.prototype.getElementsByClassName=function(e){var t=e.split(" "),n=[];return o(this,(function(e){if(1===e.nodeType){var o=(e.className||"").split(" ");t.every((function(e){return-1!==o.indexOf(e)}))&&n.push(e)}})),n},c.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var t=[];return o(this.childNodes,(function(n){1!==n.nodeType||"*"!==e&&n.tagName.toLowerCase()!==e||t.push(n)})),t},c.prototype.contains=function(e){return o(this,(function(t){return e===t}))||!1}},function(e,t){e.exports=function(e){var t=this,n=e.type;e.target||(e.target=t);t.listeners||(t.listeners={});var o=t.listeners[n];if(o)return o.forEach((function(n){e.currentTarget=t,"function"==typeof n?n(e):n.handleEvent(e)}));t.parentNode&&t.parentNode.dispatchEvent(e)}},function(e,t){e.exports=function(e,t){this.listeners||(this.listeners={});this.listeners[e]||(this.listeners[e]=[]);-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)}},function(e,t){e.exports=function(e,t){if(!this.listeners)return;if(!this.listeners[e])return;var n=this.listeners[e],o=n.indexOf(t);-1!==o&&n.splice(o,1)}},function(e,n){e.exports=t},function(e,t,n){var o=n(1),r=n(23);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(24);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(26);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(27);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(1),r=n(28);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);e.exports=r.locals||{}},function(e,t,n){var o=n(17);e.exports=new o},function(e,t,n){var o=n(5),r=n(18),i=n(19),a=n(6),s=n(21),l=n(22),c=n(7),u=n(8),p=n(9);function d(){if(!(this instanceof d))return new d;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}e.exports=d;var f=d.prototype;f.createTextNode=function(e){return new i(e,this)},f.createElementNS=function(e,t){var n=null===e?null:String(e);return new a(t,this,n)},f.createElement=function(e){return new a(e,this)},f.createDocumentFragment=function(){return new s(this)},f.createEvent=function(e){return new l(e)},f.createComment=function(e){return new r(e,this)},f.getElementById=function(e){return e=String(e),o(this.childNodes,(function(t){if(String(t.id)===e)return t}))||null},f.getElementsByClassName=a.prototype.getElementsByClassName,f.getElementsByTagName=a.prototype.getElementsByTagName,f.contains=a.prototype.contains,f.removeEventListener=p,f.addEventListener=u,f.dispatchEvent=c},function(e,t){function n(e,t){if(!(this instanceof n))return new n(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}e.exports=n,n.prototype.nodeType=8,n.prototype.nodeName="#comment",n.prototype.toString=function(){return"[object Comment]"}},function(e,t){function n(e,t){if(!(this instanceof n))return new n(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}e.exports=n,n.prototype.type="DOMTextNode",n.prototype.nodeType=3,n.prototype.nodeName="#text",n.prototype.toString=function(){return this.data},n.prototype.replaceData=function(e,t,n){var o=this.data,r=o.substring(0,e),i=o.substring(e+t,o.length);this.data=r+n+i,this.length=this.data.length}},function(e,t){e.exports=o;var n=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function o(e){switch(e.nodeType){case 3:return a(e.data);case 8:return"\x3c!--"+e.data+"--\x3e";default:return function(e){var t=[],s=e.tagName;"http://www.w3.org/1999/xhtml"===e.namespaceURI&&(s=s.toLowerCase());t.push("<"+s+function(e){var t=[];for(var n in e)r(e,n)&&t.push({name:n,value:e[n]});for(var o in e._attributes)for(var a in e._attributes[o]){var s=e._attributes[o][a],l=(s.prefix?s.prefix+":":"")+a;t.push({name:l,value:s.value})}e.className&&t.push({name:"class",value:e.className});return t.length?i(t):""}(e)+function(e){var t=e.dataset,n=[];for(var o in t)n.push({name:"data-"+o,value:t[o]});return n.length?i(n):""}(e)),n.indexOf(s)>-1?t.push(" />"):(t.push(">"),e.childNodes.length?t.push.apply(t,e.childNodes.map(o)):e.textContent||e.innerText?t.push(a(e.textContent||e.innerText)):e.innerHTML&&t.push(e.innerHTML),t.push("</"+s+">"));return t.join("")}(e)}}function r(e,t){var n=typeof e[t];return"style"===t&&Object.keys(e.style).length>0||e.hasOwnProperty(t)&&("string"===n||"boolean"===n||"number"===n)&&"nodeName"!==t&&"className"!==t&&"tagName"!==t&&"textContent"!==t&&"innerText"!==t&&"namespaceURI"!==t&&"innerHTML"!==t}function i(e){var t=[];return e.forEach((function(e){var n=e.name,o=e.value;"style"===n&&(o=function(e){if("string"==typeof e)return e;var t="";return Object.keys(e).forEach((function(n){var o=e[n];n=n.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})),t+=n+":"+o+";"})),t}(o)),t.push(n+'="'+a(o).replace(/"/g,""")+'"')})),t.length?" "+t.join(" "):""}function a(e){var t="";return"string"==typeof e?t=e:e&&(t=e.toString()),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}},function(e,t,n){var o=n(6);function r(e){if(!(this instanceof r))return new r;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}e.exports=r,r.prototype.type="DocumentFragment",r.prototype.nodeType=11,r.prototype.nodeName="#document-fragment",r.prototype.appendChild=o.prototype.appendChild,r.prototype.replaceChild=o.prototype.replaceChild,r.prototype.removeChild=o.prototype.removeChild,r.prototype.toString=function(){return this.childNodes.map((function(e){return String(e)})).join("")}},function(e,t){function n(e){}e.exports=n,n.prototype.initEvent=function(e,t,n){this.type=e,this.bubbles=t,this.cancelable=n},n.prototype.preventDefault=function(){}},function(e,t,n){(t=n(2)(!1)).push([e.i,".CloseButton__closeButton___7Ly4d {\n position: absolute;\n right: 10px;\n top: 10px;\n background: none;\n border: none;\n color: grey;\n font-size: 18px;\n font-weight: bold;\n cursor: pointer;\n &:hover {\n color: black;\n }\n &:focus {\n color: black;\n outline: 0;\n }\n}\n",""]),t.locals={closeButton:"CloseButton__closeButton___7Ly4d"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".Overlay__overlay___tUvmS {\n position: fixed;\n z-index: 99998;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n background: rgba(0, 0, 0, .4);\n}\n",""]),t.locals={overlay:"Overlay__overlay___tUvmS"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".Modal__wrapper___m_Cul {\n position: fixed;\n z-index: 99998;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.Modal__modal___2hKHM {\n position: relative;\n z-index: 99999;\n background: white;\n box-sizing: border-box;\n border: 1px solid grey;\n border-radius: 3px;\n height: 90%;\n width: 90%;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n}",""]),t.locals={wrapper:"Modal__wrapper___m_Cul",modal:"Modal__modal___2hKHM"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".ModalHeader__header___HzZTU {\n flex-shrink: 0;\n border-bottom: 1px solid grey;\n padding: 15px 20px;\n box-sizing: border-box;\n}",""]),t.locals={header:"ModalHeader__header___HzZTU"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".ModalFooter__footer___WfO3n {\n flex-shrink: 0;\n border-top: 1px solid grey;\n padding: 15px 20px;\n box-sizing: border-box;\n}\n",""]),t.locals={footer:"ModalFooter__footer___WfO3n"},e.exports=t},function(e,t,n){(t=n(2)(!1)).push([e.i,".ModalContent__content___3yWji {\n flex-grow: 1;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n height: auto;\n margin: 20px 15px;\n}\n",""]),t.locals={content:"ModalContent__content___3yWji"},e.exports=t},function(e,t,n){"use strict";n.r(t),n.d(t,"Modal",(function(){return O})),n.d(t,"ModalHeader",(function(){return M})),n.d(t,"ModalFooter",(function(){return L})),n.d(t,"ModalContent",(function(){return I})),n.d(t,"ModalProvider",(function(){return z})),n.d(t,"useModalContext",(function(){return F}));var o=n(0),r=n.n(o),i=n(10),a=n(3),s=n.n(a);let l=[];const c=(e,t)=>{let n=null;return r.a.Children.map(t,t=>{var o,r;return(null==t?void 0:t.props)&&(null===(o=null==t?void 0:t.props)||void 0===o?void 0:o.children)?void((null===(r=null==t?void 0:t.type)||void 0===r?void 0:r.displayName)&&t.type.displayName===e&&(n=t)):null}),n},u=(e,t)=>{if(!e)return!1;const[n,r]=Object(o.useState)(!1),i=e=>{if(27===e.keyCode){if(!(e=>l.indexOf(e.current)===l.length-1)(t))return;r(!0)}};return Object(o.useEffect)(()=>(s.a.addEventListener("keydown",i),()=>s.a.removeEventListener("keydown",i)),[]),n},p=(...e)=>e.filter(e=>!0==!!e).join(" ");var d=n(11),f=n.n(d);const h=r.a.memo(({onClick:e=(()=>{}),icon:t=null,className:n=null})=>r.a.createElement("button",{role:"button",className:p(f.a.closeButton,n),onClick:e},t||"x"));h.displayName="CloseButton";var m=h,y=n(12),v=n.n(y);const b=r.a.memo(({onClick:e=(()=>{}),className:t=null})=>r.a.createElement("div",{onClick:e,className:p(v.a.overlay,t)}));b.displayName="Overlay";var g=b,x=n(4),N=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const _=e=>{var{onClose:t=null,fluid:n=!1,closable:a=!0,maxHeight:s=500,minHeight:d=100,maxWidth:f=500,minWidth:h=200,children:y=null,customClassNames:v={wrapper:null,modal:null,closeBtn:null,overlay:null},closeButtonIcon:b=null}=e,_=N(e,["onClose","fluid","closable","maxHeight","minHeight","maxWidth","minWidth","children","customClassNames","closeButtonIcon"]);const O=Object(o.useCallback)((e=>c("ModalHeader",e))(y),[y]),C=Object(o.useCallback)((e=>c("ModalFooter",e))(y),[y]),w=Object(o.useCallback)((e=>c("ModalContent",e))(y),[y]),j=Object(o.useRef)();Object(o.useEffect)(()=>{var e;e=j,l=[...l,e.current]},[j]);const E=u(a,j),M=Object(o.useCallback)(()=>{var e;a&&t&&(e=j,l=l.filter(t=>t!==e.current),t())},[a,t,j]);return Object(o.useEffect)(()=>{E&&M()},[E]),Object(i.createPortal)(r.a.createElement("div",Object.assign({},_,{className:p(x.wrapper,v.wrapper)}),r.a.createElement("div",{ref:j,className:p(x.modal,v.modal),style:{maxWidth:`${n?"":`${f}px`}`,minWidth:`${n?"":`${h}px`}`,maxHeight:`${n?"":`${s}px`}`,minHeight:`${n?"":`${d}px`}`}},a&&r.a.createElement(m,{className:v.closeBtn,onClick:M,icon:b}),O&&O,w&&w,C&&C),r.a.createElement(g,{onClick:M,className:v.overlay})),document.body)};_.displayName="Modal";var O=r.a.memo(_),C=n(13),w=n.n(C),j=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const E=r.a.memo(e=>{var{children:t,className:n=null}=e,o=j(e,["children","className"]);return r.a.createElement("div",Object.assign({},o,{className:p(w.a.header,n)}),t)});E.displayName="ModalHeader";var M=E,S=n(14),T=n.n(S),k=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const B=r.a.memo(e=>{var{children:t,className:n}=e,o=k(e,["children","className"]);return r.a.createElement("div",Object.assign({},o,{className:p(T.a.footer,n)}),t)});B.displayName="ModalFooter";var L=B,P=n(15),A=n.n(P),H=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const U=r.a.memo(e=>{var{children:t,className:n}=e,o=H(e,["children","className"]);return r.a.createElement("div",Object.assign({},o,{className:p(A.a.content,n)}),t)});U.displayName="ModalContent";var I=U;var R=r.a.createContext({});const D=({children:e})=>r.a.createElement(R.Consumer,null,t=>r.a.cloneElement(e,{modal:t}));D.displayName="ModalConsumer";var W=r.a.memo(D);var z=r.a.memo(({children:e})=>{const[t,n]=Object(o.useState)([]),i=e=>t.includes(e),a=e=>!t.includes(e),s=Object(o.useCallback)(e=>{i(e)||n([...t,e])},[i,t]),l=Object(o.useCallback)(e=>{if(a(e))return;const o=t.filter(t=>t!==e);n(o)},[t,a]),c=Object(o.useCallback)(()=>{t.length>0&&n([])},[t]),u=Object(o.useCallback)(e=>{i(e)?l(e):s(e)},[i]),p={open:e=>s(e),close:e=>l(e),toggle:e=>u(e),closeAll:()=>c(),isOpen:e=>i(e),isClose:e=>a(e),list:t};return r.a.createElement(R.Provider,{value:p},r.a.createElement(W,null,e))});var F=()=>Object(o.useContext)(R)}])})); |
{ | ||
"name": "lightweight-react-modal", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "lightweight react modal", | ||
@@ -15,3 +15,4 @@ "main": "index.js", | ||
"npm-publish": "npm test && npm run build && npm publish --access public", | ||
"bundle-report": "webpack-bundle-analyzer --port 4200 dist/stats.json" | ||
"storybook": "start-storybook -p 5000", | ||
"storybook-deploy": "storybook-to-ghpages" | ||
}, | ||
@@ -47,2 +48,4 @@ "repository": { | ||
"@babel/runtime": "^7.9.2", | ||
"@storybook/react": "^5.3.19", | ||
"@storybook/storybook-deployer": "^2.8.6", | ||
"@teamsupercell/typings-for-css-modules-loader": "^2.2.0", | ||
@@ -52,3 +55,2 @@ "@testing-library/react-hooks": "^3.3.0", | ||
"babel-loader": "^8.1.0", | ||
"babel-plugin-require-context-hook": "^1.0.0", | ||
"css-loader": "^3.6.0", | ||
@@ -55,0 +57,0 @@ "enzyme": "^3.11.0", |
# React Modal | ||
Lightweight react modal component. | ||
Lightweight react modal component. <br /> | ||
Demo can be found here: <a href="https://ladderok34.github.io/lightweight-react-modal">Click</a> | ||
## Installation | ||
```bash | ||
@@ -15,3 +14,2 @@ npm i lightweight-react-modal | ||
```jsx static | ||
@@ -39,3 +37,2 @@ import React from 'react'; | ||
## PropTypes | ||
@@ -54,6 +51,5 @@ | ||
| minWidth | number | Sets modal min width. | 200 | | ||
| customClassNames | shape({ wrapper: string, modal: string, closeBtn: string, overlay:string }) | Modal custom classNames. | null | | ||
| customClassNames | { wrapper: string, modal: string, closeBtn: string, overlay:string } | Modal custom classNames. | null | | ||
| closeButtonIcon | node | Modifies close button icon. | null | | ||
##### ModalHeader, ModalContent, ModalFooter. | ||
@@ -67,6 +63,5 @@ | ||
You can use ModalContext to get better control of modal in your application. | ||
You can use ModalContext to have better control of modal state in your application. | ||
With help of ModalContext you can trigger one or multiple modals from anywhere in our application. | ||
## Usage | ||
@@ -73,0 +68,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27297
1
24
159