react-sweetalert2
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -55,3 +55,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
var SweetAlert2 = function (props) { | ||
var show = props.show, showLoading = props.showLoading, onConfirm = props.onConfirm, onError = props.onError, willOpen = props.willOpen, children = props.children, rest = __rest(props, ["show", "showLoading", "onConfirm", "onError", "willOpen", "children"]); | ||
var show = props.show, showLoading = props.showLoading, onConfirm = props.onConfirm, onResolve = props.onResolve, onError = props.onError, willOpen = props.willOpen, children = props.children, rest = __rest(props, ["show", "showLoading", "onConfirm", "onResolve", "onError", "willOpen", "children"]); | ||
React.useEffect(function () { | ||
@@ -66,7 +66,10 @@ mount(); | ||
ReactDOM__default['default'].render(children, element); | ||
rest.html = element; | ||
} | ||
willOpen && willOpen(el); | ||
}; | ||
Swal__default['default'].fire(rest).then(function (result) { return onConfirm && onConfirm(result); }).catch(function (error) { return onError && onError(error); }); | ||
Swal__default['default'].fire(rest).then(function (result) { | ||
if (result.isConfirmed) | ||
onConfirm && onConfirm(result); | ||
onResolve && onResolve(result); | ||
}).catch(function (error) { return onError && onError(error); }); | ||
if (showLoading) | ||
@@ -73,0 +76,0 @@ Swal__default['default'].showLoading(); |
{ | ||
"name": "react-sweetalert2", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"author": { | ||
@@ -28,3 +28,2 @@ "name": "Kesse Jones" | ||
"dependencies": { | ||
"@rollup/plugin-commonjs": "^17.0.0", | ||
"react": "^17.0.1", | ||
@@ -31,0 +30,0 @@ "react-dom": "^17.0.1", |
@@ -95,3 +95,3 @@ # React sweetalert2 | ||
text: 'Swal injected', | ||
type: 'success', | ||
icon: 'success', | ||
}); | ||
@@ -121,3 +121,3 @@ } | ||
text: 'Swal injected', | ||
type: 'success', | ||
icon: 'success', | ||
}); | ||
@@ -164,6 +164,6 @@ } | ||
<SweetAlert2 {...swalProps} | ||
onOpen={() => { | ||
didOpen={() => { | ||
// run when swal is opened... | ||
}} | ||
onClose={() => { | ||
didClose={() => { | ||
// run when swal is closed... | ||
@@ -177,2 +177,5 @@ }} | ||
}} | ||
onResolve={result => { | ||
// run when promise is resolved... | ||
}} | ||
/> | ||
@@ -196,6 +199,6 @@ </div> | ||
text: 'Hello World', | ||
onOpen: () => { | ||
didOpen: () => { | ||
// run when swal is opened... | ||
}, | ||
onClose: () => { | ||
didClose: () => { | ||
// run when swal is closed... | ||
@@ -202,0 +205,0 @@ } |
import packageJson from './package.json'; | ||
import typescript from "rollup-plugin-typescript2"; | ||
// import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
// import commonjs from '@rollup/plugin-commonjs'; | ||
@@ -23,6 +21,2 @@ const external = [ | ||
plugins: [ | ||
// nodeResolve(), | ||
// commonjs({ | ||
// include: /node_modules/, | ||
// }), | ||
typescript(), | ||
@@ -29,0 +23,0 @@ ], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
23343
5
145
244
0
- Removed@rollup/plugin-commonjs@^17.0.0
- Removed@rollup/plugin-commonjs@17.1.0(transitive)
- Removed@rollup/pluginutils@3.1.0(transitive)
- Removed@types/estree@0.0.39(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcommondir@1.0.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedestree-walker@1.0.12.0.2(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedglob@7.2.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-core-module@2.13.1(transitive)
- Removedis-reference@1.2.1(transitive)
- Removedmagic-string@0.25.9(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedrollup@2.79.1(transitive)
- Removedsourcemap-codec@1.4.8(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedwrappy@1.0.2(transitive)