material-ui-confirm
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -70,2 +70,14 @@ 'use strict'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
} | ||
function _arrayWithHoles(arr) { | ||
@@ -75,2 +87,6 @@ if (Array.isArray(arr)) return arr; | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
@@ -102,2 +118,6 @@ var _arr = []; | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
} | ||
function _nonIterableRest() { | ||
@@ -129,2 +149,7 @@ throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
var _useState5 = React.useState([]), | ||
_useState6 = _slicedToArray(_useState5, 2), | ||
args = _useState6[0], | ||
setArgs = _useState6[1]; | ||
var title = options.title, | ||
@@ -146,6 +171,6 @@ description = options.description, | ||
var handleConfirm = React.useCallback(function () { | ||
onConfirm.apply(void 0, arguments); | ||
onConfirm.apply(void 0, _toConsumableArray(args)); | ||
handleClose(); | ||
}, [onConfirm, handleClose]); | ||
/* Function opening the dialog, passed to the wrapped component. */ | ||
}, [onConfirm, args, handleClose]); | ||
/* Returns function opening the dialog, passed to the wrapped component. */ | ||
@@ -159,2 +184,8 @@ var confirm = React.useCallback(function (onConfirm) { | ||
setOptions(_objectSpread({}, defaultOptions, options)); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
setArgs(args); | ||
}; | ||
@@ -161,0 +192,0 @@ }, []); |
@@ -65,2 +65,14 @@ import React, { useState, useCallback, Fragment } from 'react'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
} | ||
function _arrayWithHoles(arr) { | ||
@@ -70,2 +82,6 @@ if (Array.isArray(arr)) return arr; | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
@@ -97,2 +113,6 @@ var _arr = []; | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
} | ||
function _nonIterableRest() { | ||
@@ -124,2 +144,7 @@ throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
var _useState5 = useState([]), | ||
_useState6 = _slicedToArray(_useState5, 2), | ||
args = _useState6[0], | ||
setArgs = _useState6[1]; | ||
var title = options.title, | ||
@@ -141,6 +166,6 @@ description = options.description, | ||
var handleConfirm = useCallback(function () { | ||
onConfirm.apply(void 0, arguments); | ||
onConfirm.apply(void 0, _toConsumableArray(args)); | ||
handleClose(); | ||
}, [onConfirm, handleClose]); | ||
/* Function opening the dialog, passed to the wrapped component. */ | ||
}, [onConfirm, args, handleClose]); | ||
/* Returns function opening the dialog, passed to the wrapped component. */ | ||
@@ -154,2 +179,8 @@ var confirm = useCallback(function (onConfirm) { | ||
setOptions(_objectSpread({}, defaultOptions, options)); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
setArgs(args); | ||
}; | ||
@@ -156,0 +187,0 @@ }, []); |
{ | ||
"name": "material-ui-confirm", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Higher order component for straightforward use of @material-ui/core confirmation dialogs.", | ||
@@ -57,5 +57,5 @@ "keywords": [ | ||
"react-dom": "^16.8.0", | ||
"@material-ui/core": "^3.0.0" | ||
"@material-ui/core": ">= 3.0.0" | ||
}, | ||
"dependencies": {} | ||
} |
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
16998
338