react-dialog-polyfill
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-dialog-polyfill"]=t(require("react")):e["react-dialog-polyfill"]=t(e.react)}(this,(function(e){return function(e){function t(t){for(var r,o,u=t[0],l=t[1],c=0,a=[];c<u.length;c++)o=u[c],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&a.push(n[o][0]),n[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(i&&i(t);a.length;)a.shift()()}var r={},n={0:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var u=this.webpackJsonpreact_dialog_polyfill=this.webpackJsonpreact_dialog_polyfill||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var c=0;c<u.length;c++)t(u[c]);var i=l;return o(o.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t),r.d(t,"Modal",(function(){return f})),r.d(t,"Dialog",(function(){return s}));var n=r(0),o=r.n(n);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done)&&(r.push(l.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i=Object(n.forwardRef)((function(e,t){var r=e.children,u=e.open,i=e.ready,a=e.onCancel,f=e.onClose,s=e.useAsModal,p=c(e,["children","open","ready","onCancel","onClose","useAsModal"]);Object(n.useEffect)((function(){var e=t.current;if(e&&i&&e.open!==u){(u?s?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()}}),[i,u]);return o.a.createElement("dialog",l({},p,{ref:t,onCancel:function(e){e.preventDefault(),a(e,t.current)},onClose:function(e){f(e,t.current)}}),r)}));i.defaultProps={onClose:function(){},onCancel:function(){}};var a=function(e){var t=Object(n.createRef)(),c=u(Object(n.useState)(),2),a=c[0],f=c[1];return Object(n.useEffect)((function(){Promise.resolve().then(r.t.bind(null,2,7)).then((function(e){var r=t.current;e.default.registerDialog(r)})).catch((function(e){return console.warn("dialog-polyfill was not loaded")})).finally((function(){return f(!0)}))}),[]),o.a.createElement(i,l({},e,{ready:a,ref:t}))},f=function(e){return o.a.createElement(a,l({},e,{useAsModal:!0}))},s=function(e){return o.a.createElement(a,l({},e,{useAsModal:!1}))}},function(e,t){e.exports=require("dialog-polyfill")}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-dialog-polyfill"]=t(require("react")):e["react-dialog-polyfill"]=t(e.react)}(this,(function(e){return function(e){function t(t){for(var r,o,u=t[0],l=t[1],c=0,a=[];c<u.length;c++)o=u[c],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&a.push(n[o][0]),n[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(i&&i(t);a.length;)a.shift()()}var r={},n={0:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var u=this.webpackJsonpreact_dialog_polyfill=this.webpackJsonpreact_dialog_polyfill||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var c=0;c<u.length;c++)t(u[c]);var i=l;return o(o.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t),r.d(t,"Modal",(function(){return f})),r.d(t,"Dialog",(function(){return s}));var n=r(0),o=r.n(n);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done)&&(r.push(l.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i=Object(n.forwardRef)((function(e,t){var r=e.children,u=e.open,i=e.ready,a=e.onCancel,f=e.onClose,s=e.useAsModal,p=c(e,["children","open","ready","onCancel","onClose","useAsModal"]);Object(n.useEffect)((function(){var e=t.current;if(e&&i&&e.open!==u){(u?s?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()}}),[i,u,t,s]);return o.a.createElement("dialog",l({},p,{ref:t,onCancel:function(e){e.preventDefault(),a(e,t.current)},onClose:function(e){f(e,t.current)}}),r)}));i.defaultProps={onClose:function(){},onCancel:function(){}};var a=function(e){var t=Object(n.createRef)(),c=u(Object(n.useState)(),2),a=c[0],f=c[1];return Object(n.useEffect)((function(){var e=t.current;!a&&e&&Promise.resolve().then(r.t.bind(null,2,7)).then((function(t){t.default.registerDialog(e)})).catch((function(e){return console.warn("dialog-polyfill was not loaded")})).finally((function(){return f(!0)}))}),[t,a]),o.a.createElement(i,l({},e,{ready:a,ref:t}))},f=function(e){return o.a.createElement(a,l({},e,{useAsModal:!0}))},s=function(e){return o.a.createElement(a,l({},e,{useAsModal:!1}))}},function(e,t){e.exports=require("dialog-polyfill")}])})); |
{ | ||
"name": "react-dialog-polyfill", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "<dialog> element bundled with polyfill for React", | ||
@@ -5,0 +5,0 @@ "main": "lib/react-dialog-polyfill.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
13863