sweetalert2 11.3.6 → 11.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2257 -0
- package/dist/sweetalert2.all.js +77 -44
- package/dist/sweetalert2.all.min.js +1 -1
- package/dist/sweetalert2.js +77 -44
- package/dist/sweetalert2.min.js +1 -1
- package/package.json +5 -2
- package/src/SweetAlert.js +12 -11
- package/src/buttons-handlers.js +27 -27
- package/src/globalState.js +1 -1
- package/src/instanceMethods/_destroy.js +1 -1
- package/src/instanceMethods/close.js +25 -23
- package/src/instanceMethods/enable-disable-elements.js +7 -7
- package/src/instanceMethods/getInput.js +1 -1
- package/src/instanceMethods/hideLoading.js +2 -5
- package/src/instanceMethods/progress-steps.js +1 -1
- package/src/instanceMethods/update.js +20 -13
- package/src/instanceMethods/validation-message.js +2 -2
- package/src/keydown-handler.js +22 -16
- package/src/popup-click-handler.js +3 -1
- package/src/privateMethods.js +1 -1
- package/src/privateProps.js +1 -1
- package/src/staticMethods/argsToParams.js +1 -1
- package/src/staticMethods/bindClickHandler.js +1 -1
- package/src/staticMethods/dom.js +1 -1
- package/src/staticMethods/fire.js +2 -2
- package/src/staticMethods/mixin.js +2 -2
- package/src/staticMethods/showLoading.js +1 -4
- package/src/staticMethods.js +1 -5
- package/src/utils/DismissReason.js +1 -1
- package/src/utils/Timer.js +6 -6
- package/src/utils/aria.js +2 -2
- package/src/utils/classes.js +1 -7
- package/src/utils/defaultInputValidators.js +1 -1
- package/src/utils/dom/animationEndEvent.js +1 -1
- package/src/utils/dom/domUtils.js +16 -9
- package/src/utils/dom/getters.js +7 -7
- package/src/utils/dom/init.js +3 -7
- package/src/utils/dom/inputUtils.js +26 -19
- package/src/utils/dom/parseHtmlToContainer.js +14 -3
- package/src/utils/dom/renderers/renderActions.js +3 -3
- package/src/utils/dom/renderers/renderContainer.js +3 -3
- package/src/utils/dom/renderers/renderContent.js +4 -2
- package/src/utils/dom/renderers/renderIcon.js +24 -15
- package/src/utils/dom/renderers/renderInput.js +30 -21
- package/src/utils/dom/renderers/renderPopup.js +2 -1
- package/src/utils/dom/renderers/renderProgressSteps.js +1 -1
- package/src/utils/getTemplateParams.js +7 -3
- package/src/utils/iosFix.js +16 -5
- package/src/utils/params.js +2 -2
- package/src/utils/setParameters.js +5 -5
- package/src/utils/utils.js +5 -3
|
@@ -2,7 +2,7 @@ import { warn } from './utils.js'
|
|
|
2
2
|
import * as dom from './dom/index.js'
|
|
3
3
|
import defaultInputValidators from './defaultInputValidators.js'
|
|
4
4
|
|
|
5
|
-
function setDefaultInputValidators
|
|
5
|
+
function setDefaultInputValidators(params) {
|
|
6
6
|
// Use default `inputValidator` for supported input types if not provided
|
|
7
7
|
if (!params.inputValidator) {
|
|
8
8
|
Object.keys(defaultInputValidators).forEach((key) => {
|
|
@@ -13,7 +13,7 @@ function setDefaultInputValidators (params) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function validateCustomTargetElement
|
|
16
|
+
function validateCustomTargetElement(params) {
|
|
17
17
|
// Determine if the custom target element is valid
|
|
18
18
|
if (
|
|
19
19
|
!params.target ||
|
|
@@ -30,15 +30,15 @@ function validateCustomTargetElement (params) {
|
|
|
30
30
|
*
|
|
31
31
|
* @param params
|
|
32
32
|
*/
|
|
33
|
-
export default function setParameters
|
|
33
|
+
export default function setParameters(params) {
|
|
34
34
|
setDefaultInputValidators(params)
|
|
35
35
|
|
|
36
36
|
// showLoaderOnConfirm && preConfirm
|
|
37
37
|
if (params.showLoaderOnConfirm && !params.preConfirm) {
|
|
38
38
|
warn(
|
|
39
39
|
'showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' +
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' +
|
|
41
|
+
'https://sweetalert2.github.io/#ajax-request'
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
|
package/src/utils/utils.js
CHANGED
|
@@ -65,7 +65,9 @@ export const warnOnce = (message) => {
|
|
|
65
65
|
* Show a one-time console warning about deprecated params/methods
|
|
66
66
|
*/
|
|
67
67
|
export const warnAboutDeprecation = (deprecatedParam, useInstead) => {
|
|
68
|
-
warnOnce(
|
|
68
|
+
warnOnce(
|
|
69
|
+
`"${deprecatedParam}" is deprecated and will be removed in the next major release. Please use "${useInstead}" instead.`
|
|
70
|
+
)
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
/**
|
|
@@ -73,10 +75,10 @@ export const warnAboutDeprecation = (deprecatedParam, useInstead) => {
|
|
|
73
75
|
* Otherwise, just pass the value through
|
|
74
76
|
* @param arg
|
|
75
77
|
*/
|
|
76
|
-
export const callIfFunction = (arg) => typeof arg === 'function' ? arg() : arg
|
|
78
|
+
export const callIfFunction = (arg) => (typeof arg === 'function' ? arg() : arg)
|
|
77
79
|
|
|
78
80
|
export const hasToPromiseFn = (arg) => arg && typeof arg.toPromise === 'function'
|
|
79
81
|
|
|
80
|
-
export const asPromise = (arg) => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg)
|
|
82
|
+
export const asPromise = (arg) => (hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg))
|
|
81
83
|
|
|
82
84
|
export const isPromise = (arg) => arg && Promise.resolve(arg) === arg
|