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.
Files changed (51) hide show
  1. package/CHANGELOG.md +2257 -0
  2. package/dist/sweetalert2.all.js +77 -44
  3. package/dist/sweetalert2.all.min.js +1 -1
  4. package/dist/sweetalert2.js +77 -44
  5. package/dist/sweetalert2.min.js +1 -1
  6. package/package.json +5 -2
  7. package/src/SweetAlert.js +12 -11
  8. package/src/buttons-handlers.js +27 -27
  9. package/src/globalState.js +1 -1
  10. package/src/instanceMethods/_destroy.js +1 -1
  11. package/src/instanceMethods/close.js +25 -23
  12. package/src/instanceMethods/enable-disable-elements.js +7 -7
  13. package/src/instanceMethods/getInput.js +1 -1
  14. package/src/instanceMethods/hideLoading.js +2 -5
  15. package/src/instanceMethods/progress-steps.js +1 -1
  16. package/src/instanceMethods/update.js +20 -13
  17. package/src/instanceMethods/validation-message.js +2 -2
  18. package/src/keydown-handler.js +22 -16
  19. package/src/popup-click-handler.js +3 -1
  20. package/src/privateMethods.js +1 -1
  21. package/src/privateProps.js +1 -1
  22. package/src/staticMethods/argsToParams.js +1 -1
  23. package/src/staticMethods/bindClickHandler.js +1 -1
  24. package/src/staticMethods/dom.js +1 -1
  25. package/src/staticMethods/fire.js +2 -2
  26. package/src/staticMethods/mixin.js +2 -2
  27. package/src/staticMethods/showLoading.js +1 -4
  28. package/src/staticMethods.js +1 -5
  29. package/src/utils/DismissReason.js +1 -1
  30. package/src/utils/Timer.js +6 -6
  31. package/src/utils/aria.js +2 -2
  32. package/src/utils/classes.js +1 -7
  33. package/src/utils/defaultInputValidators.js +1 -1
  34. package/src/utils/dom/animationEndEvent.js +1 -1
  35. package/src/utils/dom/domUtils.js +16 -9
  36. package/src/utils/dom/getters.js +7 -7
  37. package/src/utils/dom/init.js +3 -7
  38. package/src/utils/dom/inputUtils.js +26 -19
  39. package/src/utils/dom/parseHtmlToContainer.js +14 -3
  40. package/src/utils/dom/renderers/renderActions.js +3 -3
  41. package/src/utils/dom/renderers/renderContainer.js +3 -3
  42. package/src/utils/dom/renderers/renderContent.js +4 -2
  43. package/src/utils/dom/renderers/renderIcon.js +24 -15
  44. package/src/utils/dom/renderers/renderInput.js +30 -21
  45. package/src/utils/dom/renderers/renderPopup.js +2 -1
  46. package/src/utils/dom/renderers/renderProgressSteps.js +1 -1
  47. package/src/utils/getTemplateParams.js +7 -3
  48. package/src/utils/iosFix.js +16 -5
  49. package/src/utils/params.js +2 -2
  50. package/src/utils/setParameters.js +5 -5
  51. 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 (params) {
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 (params) {
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 (params) {
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
- 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' +
41
- 'https://sweetalert2.github.io/#ajax-request'
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
 
@@ -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(`"${deprecatedParam}" is deprecated and will be removed in the next major release. Please use "${useInstead}" instead.`)
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