react-dialog-polyfill
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e||self).reactDialogPolyfill={},e.react)}(this,function(e,n){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/t(n);function r(){return r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},r.apply(this,arguments)}var f=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},u=0,i="_rdp",l=function(){return"undefined"!=typeof document&&document.head},c=["children","open","_rd","onCancel","onClose","_md"],a=n.forwardRef(function(e,t){var a=e.children,d=e.open,s=e._rd,p=e.onCancel,m=e.onClose,h=e._md,y=function(e,n){if(null==e)return{};var t,o,r={},f=Object.keys(e);for(o=0;o<f.length;o++)n.indexOf(t=f[o])>=0||(r[t]=e[t]);return r}(e,c);return n.useEffect(function(){if(l()&&!f()){if(u<=0){var e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=i,document.head.appendChild(e)}return u++,function(){if(u--,l()&&!(u>0)){var e=document.getElementById(i);elelement&&document.head.removeChild(e)}}}},[]),n.useEffect(function(){var e=t.current;e&&s&&e.open!==d&&(d?h?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()},[s,d,t,h]),/*#__PURE__*/o.default.createElement("dialog",r({},y,{ref:t,onCancel:function(e){e.preventDefault(),p(e,t.current)},onClose:function(e){m(e,t.current)}}),a)});a.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(e){var t=n.createRef(),u=n.useState(),i=u[0],l=u[1];return n.useEffect(function(){var e=t.current;if(!i&&e){var n=!0;return(f()?Promise.resolve():import("dialog-polyfill")).then(function(n){n&&n.default.registerDialog(e)}).catch(function(e){console.warn("dialog-polyfill could not be loaded",e)}).finally(function(){n&&l(!0)}),function(){return n=!1}}},[t,i]),/*#__PURE__*/o.default.createElement(a,r({},e,{_rd:i,ref:t}))};e.Dialog=function(e){/*#__PURE__*/return o.default.createElement(d,r({},e,{_md:!1}))},e.Modal=function(e){/*#__PURE__*/return o.default.createElement(d,r({},e,{_md:!0}))}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e||self).reactDialogPolyfill={},e.react)}(this,function(e,n){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/t(n);function r(){return r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},r.apply(this,arguments)}var f=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},u=0,i="_rdp",l=function(){return"undefined"!=typeof document&&document.head},c=["children","open","_rd","onCancel","onClose","_md"],a=n.forwardRef(function(e,t){var a=e.children,d=e.open,s=e._rd,p=e.onCancel,m=e.onClose,h=e._md,y=function(e,n){if(null==e)return{};var t,o,r={},f=Object.keys(e);for(o=0;o<f.length;o++)n.indexOf(t=f[o])>=0||(r[t]=e[t]);return r}(e,c);return n.useEffect(function(){if(l()&&!f()){if(u<=0){var e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=i,document.head.appendChild(e)}return u++,function(){if(u--,l()&&!(u>0)){var e=document.getElementById(i);e&&document.head.removeChild(e)}}}},[]),n.useEffect(function(){var e=t.current;e&&s&&e.open!==d&&(d?h?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()},[s,d,t,h]),/*#__PURE__*/o.default.createElement("dialog",r({},y,{ref:t,onCancel:function(e){e.preventDefault(),p(e,t.current)},onClose:function(e){m(e,t.current)}}),a)});a.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(e){var t=n.createRef(),u=n.useState(),i=u[0],l=u[1];return n.useEffect(function(){var e=t.current;if(!i&&e){var n=!0;return(f()?Promise.resolve():import("dialog-polyfill")).then(function(n){n&&n.default.registerDialog(e)}).catch(function(e){console.warn("dialog-polyfill could not be loaded",e)}).finally(function(){n&&l(!0)}),function(){return n=!1}}},[t,i]),/*#__PURE__*/o.default.createElement(a,r({},e,{_rd:i,ref:t}))};e.Dialog=function(e){/*#__PURE__*/return o.default.createElement(d,r({},e,{_md:!1}))},e.Modal=function(e){/*#__PURE__*/return o.default.createElement(d,r({},e,{_md:!0}))}}); |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e||self).reactDialogPolyfill={},e.react)}(this,function(e,n){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/t(n);function o(){return o=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(this,arguments)}var f=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},u=0,i="_rdp",c=function(){return"undefined"!=typeof document&&document.head},l=["children","open","_rd","onCancel","onClose","_md"],a=n.forwardRef(function(e,t){var a=e.children,d=e.open,s=e._rd,p=e.onCancel,m=e.onClose,h=e._md,v=function(e,n){if(null==e)return{};var t,r,o={},f=Object.keys(e);for(r=0;r<f.length;r++)n.indexOf(t=f[r])>=0||(o[t]=e[t]);return o}(e,l);return n.useEffect(function(){if(c()&&!f()){if(u<=0){var e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=i,document.head.appendChild(e)}return u++,function(){if(u--,c()&&!(u>0)){var e=document.getElementById(i);elelement&&document.head.removeChild(e)}}}},[]),n.useEffect(function(){var e=t.current;e&&s&&e.open!==d&&(d?h?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()},[s,d,t,h]),/*#__PURE__*/r.default.createElement("dialog",o({},v,{ref:t,onCancel:function(e){e.preventDefault(),p(e,t.current)},onClose:function(e){m(e,t.current)}}),a)});a.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(e){var t=n.createRef(),u=n.useState(),i=u[0],c=u[1];return n.useEffect(function(){var e=t.current;if(!i&&e){var n=!0;return(f()?Promise.resolve():import("dialog-polyfill")).then(function(n){n&&n.default.registerDialog(e)}).catch(function(e){}).finally(function(){n&&c(!0)}),function(){return n=!1}}},[t,i]),/*#__PURE__*/r.default.createElement(a,o({},e,{_rd:i,ref:t}))};e.Dialog=function(e){/*#__PURE__*/return r.default.createElement(d,o({},e,{_md:!1}))},e.Modal=function(e){/*#__PURE__*/return r.default.createElement(d,o({},e,{_md:!0}))}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e||self).reactDialogPolyfill={},e.react)}(this,function(e,n){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/t(n);function o(){return o=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(this,arguments)}var f=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},u=0,i="_rdp",c=function(){return"undefined"!=typeof document&&document.head},a=["children","open","_rd","onCancel","onClose","_md"],l=n.forwardRef(function(e,t){var l=e.children,d=e.open,s=e._rd,p=e.onCancel,m=e.onClose,h=e._md,v=function(e,n){if(null==e)return{};var t,r,o={},f=Object.keys(e);for(r=0;r<f.length;r++)n.indexOf(t=f[r])>=0||(o[t]=e[t]);return o}(e,a);return n.useEffect(function(){if(c()&&!f()){if(u<=0){var e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=i,document.head.appendChild(e)}return u++,function(){if(u--,c()&&!(u>0)){var e=document.getElementById(i);e&&document.head.removeChild(e)}}}},[]),n.useEffect(function(){var e=t.current;e&&s&&e.open!==d&&(d?h?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()},[s,d,t,h]),/*#__PURE__*/r.default.createElement("dialog",o({},v,{ref:t,onCancel:function(e){e.preventDefault(),p(e,t.current)},onClose:function(e){m(e,t.current)}}),l)});l.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(e){var t=n.createRef(),u=n.useState(),i=u[0],c=u[1];return n.useEffect(function(){var e=t.current;if(!i&&e){var n=!0;return(f()?Promise.resolve():import("dialog-polyfill")).then(function(n){n&&n.default.registerDialog(e)}).catch(function(e){}).finally(function(){n&&c(!0)}),function(){return n=!1}}},[t,i]),/*#__PURE__*/r.default.createElement(l,o({},e,{_rd:i,ref:t}))};e.Dialog=function(e){/*#__PURE__*/return r.default.createElement(d,o({},e,{_md:!1}))},e.Modal=function(e){/*#__PURE__*/return r.default.createElement(d,o({},e,{_md:!0}))}}); |
@@ -1,1 +0,1 @@ | ||
import n,{useEffect as e,forwardRef as t,createRef as r,useState as o}from"react";function i(){return i=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},i.apply(this,arguments)}var u=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},c=0,l=function(){return"undefined"!=typeof document&&document.head},a=["children","open","_rd","onCancel","onClose","_md"],f=t(function(t,r){var o=t.children,f=t.open,d=t._rd,m=t.onCancel,p=t.onClose,s=t._md,v=function(n,e){if(null==n)return{};var t,r,o={},i=Object.keys(n);for(r=0;r<i.length;r++)e.indexOf(t=i[r])>=0||(o[t]=n[t]);return o}(t,a);return e(function(){if(l()&&!u()){if(c<=0){var n=document.createElement("style");n.innerHTML="dialog:not([open]){display: none;}",n.id="_rdp",document.head.appendChild(n)}return c++,function(){if(c--,l()&&!(c>0)){var n=document.getElementById("_rdp");elelement&&document.head.removeChild(n)}}}},[]),e(function(){var n=r.current;n&&d&&n.open!==f&&(f?s?function(){return n.showModal()}:function(){return n.show()}:function(){return n.close()})()},[d,f,r,s]),/*#__PURE__*/n.createElement("dialog",i({},v,{ref:r,onCancel:function(n){n.preventDefault(),m(n,r.current)},onClose:function(n){p(n,r.current)}}),o)});f.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(t){var c=r(),l=o(),a=l[0],d=l[1];return e(function(){var n=c.current;if(!a&&n){var e=!0;return(u()?Promise.resolve():import("dialog-polyfill")).then(function(e){e&&e.default.registerDialog(n)}).catch(function(n){console.warn("dialog-polyfill could not be loaded",n)}).finally(function(){e&&d(!0)}),function(){return e=!1}}},[c,a]),/*#__PURE__*/n.createElement(f,i({},t,{_rd:a,ref:c}))},m=function(e){/*#__PURE__*/return n.createElement(d,i({},e,{_md:!0}))},p=function(e){/*#__PURE__*/return n.createElement(d,i({},e,{_md:!1}))};export{p as Dialog,m as Modal}; | ||
import n,{useEffect as e,forwardRef as t,createRef as r,useState as o}from"react";function i(){return i=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},i.apply(this,arguments)}var u=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},c=0,l=function(){return"undefined"!=typeof document&&document.head},a=["children","open","_rd","onCancel","onClose","_md"],f=t(function(t,r){var o=t.children,f=t.open,d=t._rd,p=t.onCancel,m=t.onClose,s=t._md,v=function(n,e){if(null==n)return{};var t,r,o={},i=Object.keys(n);for(r=0;r<i.length;r++)e.indexOf(t=i[r])>=0||(o[t]=n[t]);return o}(t,a);return e(function(){if(l()&&!u()){if(c<=0){var n=document.createElement("style");n.innerHTML="dialog:not([open]){display: none;}",n.id="_rdp",document.head.appendChild(n)}return c++,function(){if(c--,l()&&!(c>0)){var n=document.getElementById("_rdp");n&&document.head.removeChild(n)}}}},[]),e(function(){var n=r.current;n&&d&&n.open!==f&&(f?s?function(){return n.showModal()}:function(){return n.show()}:function(){return n.close()})()},[d,f,r,s]),/*#__PURE__*/n.createElement("dialog",i({},v,{ref:r,onCancel:function(n){n.preventDefault(),p(n,r.current)},onClose:function(n){m(n,r.current)}}),o)});f.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(t){var c=r(),l=o(),a=l[0],d=l[1];return e(function(){var n=c.current;if(!a&&n){var e=!0;return(u()?Promise.resolve():import("dialog-polyfill")).then(function(e){e&&e.default.registerDialog(n)}).catch(function(n){console.warn("dialog-polyfill could not be loaded",n)}).finally(function(){e&&d(!0)}),function(){return e=!1}}},[c,a]),/*#__PURE__*/n.createElement(f,i({},t,{_rd:a,ref:c}))},p=function(e){/*#__PURE__*/return n.createElement(d,i({},e,{_md:!0}))},m=function(e){/*#__PURE__*/return n.createElement(d,i({},e,{_md:!1}))};export{m as Dialog,p as Modal}; |
@@ -1,1 +0,1 @@ | ||
import n,{useEffect as e,forwardRef as t,createRef as r,useState as o}from"react";function u(){return u=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},u.apply(this,arguments)}var i=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},c=0,l=function(){return"undefined"!=typeof document&&document.head},f=["children","open","_rd","onCancel","onClose","_md"],a=t(function(t,r){var o=t.children,a=t.open,d=t._rd,m=t.onCancel,p=t.onClose,s=t._md,v=function(n,e){if(null==n)return{};var t,r,o={},u=Object.keys(n);for(r=0;r<u.length;r++)e.indexOf(t=u[r])>=0||(o[t]=n[t]);return o}(t,f);return e(function(){if(l()&&!i()){if(c<=0){var n=document.createElement("style");n.innerHTML="dialog:not([open]){display: none;}",n.id="_rdp",document.head.appendChild(n)}return c++,function(){if(c--,l()&&!(c>0)){var n=document.getElementById("_rdp");elelement&&document.head.removeChild(n)}}}},[]),e(function(){var n=r.current;n&&d&&n.open!==a&&(a?s?function(){return n.showModal()}:function(){return n.show()}:function(){return n.close()})()},[d,a,r,s]),/*#__PURE__*/n.createElement("dialog",u({},v,{ref:r,onCancel:function(n){n.preventDefault(),m(n,r.current)},onClose:function(n){p(n,r.current)}}),o)});a.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(t){var c=r(),l=o(),f=l[0],d=l[1];return e(function(){var n=c.current;if(!f&&n){var e=!0;return(i()?Promise.resolve():import("dialog-polyfill")).then(function(e){e&&e.default.registerDialog(n)}).catch(function(n){}).finally(function(){e&&d(!0)}),function(){return e=!1}}},[c,f]),/*#__PURE__*/n.createElement(a,u({},t,{_rd:f,ref:c}))},m=function(e){/*#__PURE__*/return n.createElement(d,u({},e,{_md:!0}))},p=function(e){/*#__PURE__*/return n.createElement(d,u({},e,{_md:!1}))};export{p as Dialog,m as Modal}; | ||
import n,{useEffect as e,forwardRef as t,createRef as r,useState as o}from"react";function u(){return u=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},u.apply(this,arguments)}var i=function(){return"undefined"!=typeof window&&!!window.HTMLDialogElement},c=0,f=function(){return"undefined"!=typeof document&&document.head},l=["children","open","_rd","onCancel","onClose","_md"],a=t(function(t,r){var o=t.children,a=t.open,d=t._rd,m=t.onCancel,p=t.onClose,s=t._md,v=function(n,e){if(null==n)return{};var t,r,o={},u=Object.keys(n);for(r=0;r<u.length;r++)e.indexOf(t=u[r])>=0||(o[t]=n[t]);return o}(t,l);return e(function(){if(f()&&!i()){if(c<=0){var n=document.createElement("style");n.innerHTML="dialog:not([open]){display: none;}",n.id="_rdp",document.head.appendChild(n)}return c++,function(){if(c--,f()&&!(c>0)){var n=document.getElementById("_rdp");n&&document.head.removeChild(n)}}}},[]),e(function(){var n=r.current;n&&d&&n.open!==a&&(a?s?function(){return n.showModal()}:function(){return n.show()}:function(){return n.close()})()},[d,a,r,s]),/*#__PURE__*/n.createElement("dialog",u({},v,{ref:r,onCancel:function(n){n.preventDefault(),m(n,r.current)},onClose:function(n){p(n,r.current)}}),o)});a.defaultProps={onClose:function(){},onCancel:function(){}};var d=function(t){var c=r(),f=o(),l=f[0],d=f[1];return e(function(){var n=c.current;if(!l&&n){var e=!0;return(i()?Promise.resolve():import("dialog-polyfill")).then(function(e){e&&e.default.registerDialog(n)}).catch(function(n){}).finally(function(){e&&d(!0)}),function(){return e=!1}}},[c,l]),/*#__PURE__*/n.createElement(a,u({},t,{_rd:l,ref:c}))},m=function(e){/*#__PURE__*/return n.createElement(d,u({},e,{_md:!0}))},p=function(e){/*#__PURE__*/return n.createElement(d,u({},e,{_md:!1}))};export{p as Dialog,m as Modal}; |
{ | ||
"name": "react-dialog-polyfill", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "<dialog> element bundled with polyfill for React", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
19866