sweetalert2 11.7.26 → 11.7.28
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/README.md +5 -6
- package/dist/sweetalert2.all.js +129 -57
- package/dist/sweetalert2.all.min.js +2 -2
- package/dist/sweetalert2.js +129 -57
- package/dist/sweetalert2.min.js +2 -2
- package/package.json +3 -2
- package/src/SweetAlert.js +11 -9
- package/src/buttons-handlers.js +1 -1
- package/src/instanceMethods/validation-message.js +4 -1
- package/src/keydown-handler.js +18 -19
- package/src/popup-click-handler.js +28 -11
- package/src/privateProps.js +0 -1
- package/src/types.js +1 -0
- package/src/utils/dom/domUtils.js +1 -1
- package/src/utils/dom/inputUtils.js +2 -6
- package/sweetalert2.d.ts +1 -1
package/README.md
CHANGED
|
@@ -31,15 +31,15 @@ For all questions related to sponsorship please get in touch with me via email s
|
|
|
31
31
|
<table>
|
|
32
32
|
<tr>
|
|
33
33
|
<td align="center"><a href="SPONSORS.md#sponsors"><img src="https://sweetalert2.github.io/images/plus.png" width="80"><br>Become a sponsor</a></td>
|
|
34
|
+
<td align="center"><a href="https://dlxplugins.com/"><img src="https://avatars.githubusercontent.com/u/106675919?s=200&v=4" width="80"><br>DLX Plugins</a></td>
|
|
34
35
|
<td align="center"><a href="https://github.com/tiagostutz"><img src="https://avatars0.githubusercontent.com/u/3986989?s=80&v=4" width="80"><br>Tiago de Oliveira Stutz</a></td>
|
|
35
36
|
<td align="center"><a href="https://istar.tips/"><img src="https://sweetalert2.github.io/images/sponsors/istartips.png" width="80"><br>iStarTips</a>
|
|
36
37
|
<td align="center"><a href="https://refermate.com/"><img src="https://sweetalert2.github.io/images/sponsors/refermate.png" width="80"><br>Refermate</a>
|
|
37
|
-
<td align="center"><a href="https://roboflow.com/"><img src="https://sweetalert2.github.io/images/sponsors/roboflow.png" width="80"><br>Roboflow</a>
|
|
38
|
-
<td align="center"><a href="https://www.evguru.com.my/"><img src="https://sweetalert2.github.io/images/sponsors/evguru.png" width="80"><br>EvGuru EV Chargers</a></td>
|
|
39
38
|
</tr>
|
|
40
39
|
</table>
|
|
41
40
|
<table>
|
|
42
41
|
<tr>
|
|
42
|
+
<td align="center"><a href="https://roboflow.com/"><img src="https://sweetalert2.github.io/images/sponsors/roboflow.png" width="80"><br>Roboflow</a>
|
|
43
43
|
<td align="center"><a href="https://www.zezelife.com/"><img src="https://sweetalert2.github.io/images/sponsors/zezelife.png" width="80"><br>ZezeLife</a>
|
|
44
44
|
<td align="center"><a href="https://www.serpempire.com/"><img src="https://sweetalert2.github.io/images/sponsors/serpempire.png" width="80"><br>SERP Empire</a>
|
|
45
45
|
<td align="center"><a href="https://www.realspyapps.com/"><img src="https://sweetalert2.github.io/images/sponsors/realspyapps.jpeg" width="80"><br>Real Spy Apps</a>
|
|
@@ -50,7 +50,6 @@ For all questions related to sponsorship please get in touch with me via email s
|
|
|
50
50
|
<tr>
|
|
51
51
|
<td align="center"><a href="https://www.mybitcoinslots.com/"><img src="https://sweetalert2.github.io/images/sponsors/mybitcoinslots.png" width="80"><br>My Bitcoin slots</a></td>
|
|
52
52
|
<td align="center"><a href="https://www.vegega.com/"><img src="https://sweetalert2.github.io/images/sponsors/vegega.jpeg" width="80"><br>Metal Raised Garden Bed</a></td>
|
|
53
|
-
<td align="center"><a href="https://halvinlaina.fi/"><img src="https://sweetalert2.github.io/images/sponsors/halvinlaina.png" width="80"><br>Halvin Laina</a></td>
|
|
54
53
|
</tr>
|
|
55
54
|
</table>
|
|
56
55
|
|
|
@@ -60,10 +59,11 @@ NSFW Sponsors
|
|
|
60
59
|
<table>
|
|
61
60
|
<tr>
|
|
62
61
|
<td align="center"><a href="SPONSORS.md#sponsors"><img src="https://sweetalert2.github.io/images/plus.png" width="80"><br>Become a NSFW sponsor</a></td>
|
|
63
|
-
<td align="center"><a href="https://
|
|
62
|
+
<td align="center"><a href="https://www.xspacecup.com/"><img src="https://sweetalert2.github.io/images/sponsors/xspacecup.png" width="80"><br>XspaceCup - Top Male Masturbator Brand</a></td>
|
|
63
|
+
<td align="center"><a href="https://vlixa.com/"><img src="https://sweetalert2.github.io/images/sponsors/vlixa.png" width="80"><br>Vlixa</a></td>
|
|
64
|
+
<td align="center"><a href="https://taboodude.com/"><img src="https://sweetalert2.github.io/images/sponsors/taboodude.png" width="80"><br>TabooDude</a></td>
|
|
64
65
|
<td align="center"><a href="https://sexsitoys.com/lovense-games/"><img src="https://sweetalert2.github.io/images/sponsors/sexsitoys.jpg" width="80"><br>Sexsi Toys</a></td>
|
|
65
66
|
<td align="center"><a href="https://www.cheapestsexdolls.com"><img src="https://sweetalert2.github.io/images/sponsors/cheapestsexdolls.png" width="80"><br>CheapestSexDolls</a></td>
|
|
66
|
-
<td align="center"><a href="https://www.sexysexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/sexysexdoll.png" width="80"><br>Sexy Sex Doll</a></td>
|
|
67
67
|
</tr>
|
|
68
68
|
</table>
|
|
69
69
|
<table>
|
|
@@ -102,7 +102,6 @@ NSFW Sponsors
|
|
|
102
102
|
<td align="center"><a href="https://www.lovedolltorso.com/female-torso-sex-doll/"><img src="https://sweetalert2.github.io/images/sponsors/lovedolltorso.png" width="80"><br>female torso sex doll</a></td>
|
|
103
103
|
<td align="center"><a href="https://www.mymasturbators.com/"><img src="https://sweetalert2.github.io/images/sponsors/mymasturbators.png" width="80"><br>male masturbator</a></td>
|
|
104
104
|
<td align="center"><a href="https://www.buypenispump.com/"><img src="https://sweetalert2.github.io/images/sponsors/buypenispump.png" width="80"><br>penis pump</a></td>
|
|
105
|
-
<td align="center"><a href="https://toyhero.com/"><img src="https://sweetalert2.github.io/images/sponsors/toyhero.png" width="80"><br>Adult Toys</a></td>
|
|
106
105
|
</tr>
|
|
107
106
|
</table>
|
|
108
107
|
<table>
|
package/dist/sweetalert2.all.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sweetalert2 v11.7.
|
|
2
|
+
* sweetalert2 v11.7.28
|
|
3
3
|
* Released under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -8,6 +8,47 @@
|
|
|
8
8
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Sweetalert2 = factory());
|
|
9
9
|
})(this, (function () { 'use strict';
|
|
10
10
|
|
|
11
|
+
function _classPrivateFieldGet(receiver, privateMap) {
|
|
12
|
+
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");
|
|
13
|
+
return _classApplyDescriptorGet(receiver, descriptor);
|
|
14
|
+
}
|
|
15
|
+
function _classPrivateFieldSet(receiver, privateMap, value) {
|
|
16
|
+
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set");
|
|
17
|
+
_classApplyDescriptorSet(receiver, descriptor, value);
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) {
|
|
21
|
+
if (!privateMap.has(receiver)) {
|
|
22
|
+
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
23
|
+
}
|
|
24
|
+
return privateMap.get(receiver);
|
|
25
|
+
}
|
|
26
|
+
function _classApplyDescriptorGet(receiver, descriptor) {
|
|
27
|
+
if (descriptor.get) {
|
|
28
|
+
return descriptor.get.call(receiver);
|
|
29
|
+
}
|
|
30
|
+
return descriptor.value;
|
|
31
|
+
}
|
|
32
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) {
|
|
33
|
+
if (descriptor.set) {
|
|
34
|
+
descriptor.set.call(receiver, value);
|
|
35
|
+
} else {
|
|
36
|
+
if (!descriptor.writable) {
|
|
37
|
+
throw new TypeError("attempted to set read only private field");
|
|
38
|
+
}
|
|
39
|
+
descriptor.value = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function _checkPrivateRedeclaration(obj, privateCollection) {
|
|
43
|
+
if (privateCollection.has(obj)) {
|
|
44
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
48
|
+
_checkPrivateRedeclaration(obj, privateMap);
|
|
49
|
+
privateMap.set(obj, value);
|
|
50
|
+
}
|
|
51
|
+
|
|
11
52
|
const RESTORE_FOCUS_TIMEOUT = 100;
|
|
12
53
|
|
|
13
54
|
/** @type {GlobalState} */
|
|
@@ -43,22 +84,6 @@
|
|
|
43
84
|
});
|
|
44
85
|
};
|
|
45
86
|
|
|
46
|
-
/**
|
|
47
|
-
* This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has.
|
|
48
|
-
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')`
|
|
49
|
-
* This is the approach that Babel will probably take to implement private methods/fields
|
|
50
|
-
* https://github.com/tc39/proposal-private-methods
|
|
51
|
-
* https://github.com/babel/babel/pull/7555
|
|
52
|
-
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*
|
|
53
|
-
* then we can use that language feature.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
var privateProps = {
|
|
57
|
-
promise: new WeakMap(),
|
|
58
|
-
innerParams: new WeakMap(),
|
|
59
|
-
domCache: new WeakMap()
|
|
60
|
-
};
|
|
61
|
-
|
|
62
87
|
const swalPrefix = 'swal2-';
|
|
63
88
|
|
|
64
89
|
/**
|
|
@@ -484,7 +509,7 @@
|
|
|
484
509
|
|
|
485
510
|
/**
|
|
486
511
|
* @param {HTMLElement} popup
|
|
487
|
-
* @param {import('./renderers/renderInput').InputClass} inputClass
|
|
512
|
+
* @param {import('./renderers/renderInput').InputClass | SweetAlertInput} inputClass
|
|
488
513
|
* @returns {HTMLInputElement | null}
|
|
489
514
|
*/
|
|
490
515
|
const getInput$1 = (popup, inputClass) => {
|
|
@@ -1053,6 +1078,21 @@
|
|
|
1053
1078
|
addClass(container, swalClasses["grow-".concat(grow)]);
|
|
1054
1079
|
}
|
|
1055
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has.
|
|
1083
|
+
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')`
|
|
1084
|
+
* This is the approach that Babel will probably take to implement private methods/fields
|
|
1085
|
+
* https://github.com/tc39/proposal-private-methods
|
|
1086
|
+
* https://github.com/babel/babel/pull/7555
|
|
1087
|
+
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*
|
|
1088
|
+
* then we can use that language feature.
|
|
1089
|
+
*/
|
|
1090
|
+
|
|
1091
|
+
var privateProps = {
|
|
1092
|
+
innerParams: new WeakMap(),
|
|
1093
|
+
domCache: new WeakMap()
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1056
1096
|
/// <reference path="../../../../sweetalert2.d.ts"/>
|
|
1057
1097
|
|
|
1058
1098
|
|
|
@@ -1755,15 +1795,14 @@
|
|
|
1755
1795
|
};
|
|
1756
1796
|
|
|
1757
1797
|
/**
|
|
1758
|
-
* @param {SweetAlert} instance
|
|
1759
1798
|
* @param {GlobalState} globalState
|
|
1760
1799
|
* @param {SweetAlertOptions} innerParams
|
|
1761
1800
|
* @param {*} dismissWith
|
|
1762
1801
|
*/
|
|
1763
|
-
const addKeydownHandler = (
|
|
1802
|
+
const addKeydownHandler = (globalState, innerParams, dismissWith) => {
|
|
1764
1803
|
removeKeydownHandler(globalState);
|
|
1765
1804
|
if (!innerParams.toast) {
|
|
1766
|
-
globalState.keydownHandler = e => keydownHandler(
|
|
1805
|
+
globalState.keydownHandler = e => keydownHandler(innerParams, e, dismissWith);
|
|
1767
1806
|
globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup();
|
|
1768
1807
|
globalState.keydownListenerCapture = innerParams.keydownListenerCapture;
|
|
1769
1808
|
globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, {
|
|
@@ -1778,6 +1817,7 @@
|
|
|
1778
1817
|
* @param {number} increment
|
|
1779
1818
|
*/
|
|
1780
1819
|
const setFocus = (index, increment) => {
|
|
1820
|
+
var _dom$getPopup;
|
|
1781
1821
|
const focusableElements = getFocusableElements();
|
|
1782
1822
|
// search for visible elements and select the next possible match
|
|
1783
1823
|
if (focusableElements.length) {
|
|
@@ -1795,18 +1835,17 @@
|
|
|
1795
1835
|
return;
|
|
1796
1836
|
}
|
|
1797
1837
|
// no visible focusable elements, focus the popup
|
|
1798
|
-
getPopup().focus();
|
|
1838
|
+
(_dom$getPopup = getPopup()) === null || _dom$getPopup === void 0 || _dom$getPopup.focus();
|
|
1799
1839
|
};
|
|
1800
1840
|
const arrowKeysNextButton = ['ArrowRight', 'ArrowDown'];
|
|
1801
1841
|
const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp'];
|
|
1802
1842
|
|
|
1803
1843
|
/**
|
|
1804
|
-
* @param {
|
|
1844
|
+
* @param {SweetAlertOptions} innerParams
|
|
1805
1845
|
* @param {KeyboardEvent} event
|
|
1806
1846
|
* @param {Function} dismissWith
|
|
1807
1847
|
*/
|
|
1808
|
-
const keydownHandler = (
|
|
1809
|
-
const innerParams = privateProps.innerParams.get(instance);
|
|
1848
|
+
const keydownHandler = (innerParams, event, dismissWith) => {
|
|
1810
1849
|
if (!innerParams) {
|
|
1811
1850
|
return; // This instance has already been destroyed
|
|
1812
1851
|
}
|
|
@@ -1824,7 +1863,7 @@
|
|
|
1824
1863
|
|
|
1825
1864
|
// ENTER
|
|
1826
1865
|
if (event.key === 'Enter') {
|
|
1827
|
-
handleEnter(
|
|
1866
|
+
handleEnter(event, innerParams);
|
|
1828
1867
|
}
|
|
1829
1868
|
|
|
1830
1869
|
// TAB
|
|
@@ -1844,16 +1883,16 @@
|
|
|
1844
1883
|
};
|
|
1845
1884
|
|
|
1846
1885
|
/**
|
|
1847
|
-
* @param {SweetAlert} instance
|
|
1848
1886
|
* @param {KeyboardEvent} event
|
|
1849
1887
|
* @param {SweetAlertOptions} innerParams
|
|
1850
1888
|
*/
|
|
1851
|
-
const handleEnter = (
|
|
1889
|
+
const handleEnter = (event, innerParams) => {
|
|
1852
1890
|
// https://github.com/sweetalert2/sweetalert2/issues/2386
|
|
1853
1891
|
if (!callIfFunction(innerParams.allowEnterKey)) {
|
|
1854
1892
|
return;
|
|
1855
1893
|
}
|
|
1856
|
-
|
|
1894
|
+
const input = getInput$1(getPopup(), innerParams.input);
|
|
1895
|
+
if (event.target && input && event.target instanceof HTMLElement && event.target.outerHTML === input.outerHTML) {
|
|
1857
1896
|
if (['textarea', 'file'].includes(innerParams.input)) {
|
|
1858
1897
|
return; // do not submit
|
|
1859
1898
|
}
|
|
@@ -1894,9 +1933,13 @@
|
|
|
1894
1933
|
* @param {string} key
|
|
1895
1934
|
*/
|
|
1896
1935
|
const handleArrows = key => {
|
|
1936
|
+
const actions = getActions();
|
|
1897
1937
|
const confirmButton = getConfirmButton();
|
|
1898
1938
|
const denyButton = getDenyButton();
|
|
1899
1939
|
const cancelButton = getCancelButton();
|
|
1940
|
+
if (!actions || !confirmButton || !denyButton || !cancelButton) {
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1900
1943
|
/** @type HTMLElement[] */
|
|
1901
1944
|
const buttons = [confirmButton, denyButton, cancelButton];
|
|
1902
1945
|
if (document.activeElement instanceof HTMLElement && !buttons.includes(document.activeElement)) {
|
|
@@ -1904,7 +1947,10 @@
|
|
|
1904
1947
|
}
|
|
1905
1948
|
const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling';
|
|
1906
1949
|
let buttonToFocus = document.activeElement;
|
|
1907
|
-
|
|
1950
|
+
if (!buttonToFocus) {
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
for (let i = 0; i < actions.children.length; i++) {
|
|
1908
1954
|
buttonToFocus = buttonToFocus[sibling];
|
|
1909
1955
|
if (!buttonToFocus) {
|
|
1910
1956
|
return;
|
|
@@ -2345,10 +2391,6 @@
|
|
|
2345
2391
|
addClass([popup, actions], swalClasses.loading);
|
|
2346
2392
|
};
|
|
2347
2393
|
|
|
2348
|
-
/**
|
|
2349
|
-
* @typedef { string | number | boolean | undefined } InputValue
|
|
2350
|
-
*/
|
|
2351
|
-
|
|
2352
2394
|
/**
|
|
2353
2395
|
* @param {SweetAlert} instance
|
|
2354
2396
|
* @param {SweetAlertOptions} params
|
|
@@ -2365,7 +2407,7 @@
|
|
|
2365
2407
|
/**
|
|
2366
2408
|
* @param {SweetAlert} instance
|
|
2367
2409
|
* @param {SweetAlertOptions} innerParams
|
|
2368
|
-
* @returns {
|
|
2410
|
+
* @returns {SweetAlertInputValue}
|
|
2369
2411
|
*/
|
|
2370
2412
|
const getInputValue = (instance, innerParams) => {
|
|
2371
2413
|
const input = instance.getInput();
|
|
@@ -2570,7 +2612,7 @@
|
|
|
2570
2612
|
|
|
2571
2613
|
/**
|
|
2572
2614
|
* @param {string} optionValue
|
|
2573
|
-
* @param {
|
|
2615
|
+
* @param {SweetAlertInputValue} inputValue
|
|
2574
2616
|
* @returns {boolean}
|
|
2575
2617
|
*/
|
|
2576
2618
|
const isSelected = (optionValue, inputValue) => {
|
|
@@ -2638,7 +2680,7 @@
|
|
|
2638
2680
|
|
|
2639
2681
|
/**
|
|
2640
2682
|
* @param {SweetAlert} instance
|
|
2641
|
-
* @param {
|
|
2683
|
+
* @param {SweetAlertInputValue} inputValue
|
|
2642
2684
|
* @param {'confirm' | 'deny'} type
|
|
2643
2685
|
*/
|
|
2644
2686
|
const handleInputValidator = (instance, inputValue, type) => {
|
|
@@ -2852,6 +2894,7 @@
|
|
|
2852
2894
|
* Show block with validation message
|
|
2853
2895
|
*
|
|
2854
2896
|
* @param {string} error
|
|
2897
|
+
* @this {SweetAlert}
|
|
2855
2898
|
*/
|
|
2856
2899
|
function showValidationMessage(error) {
|
|
2857
2900
|
const domCache = privateProps.domCache.get(this);
|
|
@@ -2864,7 +2907,7 @@
|
|
|
2864
2907
|
show(domCache.validationMessage);
|
|
2865
2908
|
const input = this.getInput();
|
|
2866
2909
|
if (input) {
|
|
2867
|
-
input.setAttribute('aria-invalid', true);
|
|
2910
|
+
input.setAttribute('aria-invalid', 'true');
|
|
2868
2911
|
input.setAttribute('aria-describedby', swalClasses['validation-message']);
|
|
2869
2912
|
focusInput(input);
|
|
2870
2913
|
addClass(input, swalClasses.inputerror);
|
|
@@ -2873,6 +2916,8 @@
|
|
|
2873
2916
|
|
|
2874
2917
|
/**
|
|
2875
2918
|
* Hide block with validation message
|
|
2919
|
+
*
|
|
2920
|
+
* @this {SweetAlert}
|
|
2876
2921
|
*/
|
|
2877
2922
|
function resetValidationMessage() {
|
|
2878
2923
|
const domCache = privateProps.domCache.get(this);
|
|
@@ -3199,10 +3244,14 @@
|
|
|
3199
3244
|
update: update
|
|
3200
3245
|
});
|
|
3201
3246
|
|
|
3202
|
-
|
|
3203
|
-
|
|
3247
|
+
/**
|
|
3248
|
+
* @param {SweetAlertOptions} innerParams
|
|
3249
|
+
* @param {DomCache} domCache
|
|
3250
|
+
* @param {Function} dismissWith
|
|
3251
|
+
*/
|
|
3252
|
+
const handlePopupClick = (innerParams, domCache, dismissWith) => {
|
|
3204
3253
|
if (innerParams.toast) {
|
|
3205
|
-
handleToastClick(
|
|
3254
|
+
handleToastClick(innerParams, domCache, dismissWith);
|
|
3206
3255
|
} else {
|
|
3207
3256
|
// Ignore click events that had mousedown on the popup but mouseup on the container
|
|
3208
3257
|
// This can happen when the user drags a slider
|
|
@@ -3210,13 +3259,18 @@
|
|
|
3210
3259
|
|
|
3211
3260
|
// Ignore click events that had mousedown on the container but mouseup on the popup
|
|
3212
3261
|
handleContainerMousedown(domCache);
|
|
3213
|
-
handleModalClick(
|
|
3262
|
+
handleModalClick(innerParams, domCache, dismissWith);
|
|
3214
3263
|
}
|
|
3215
3264
|
};
|
|
3216
|
-
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* @param {SweetAlertOptions} innerParams
|
|
3268
|
+
* @param {DomCache} domCache
|
|
3269
|
+
* @param {Function} dismissWith
|
|
3270
|
+
*/
|
|
3271
|
+
const handleToastClick = (innerParams, domCache, dismissWith) => {
|
|
3217
3272
|
// Closing toast by internal click
|
|
3218
3273
|
domCache.popup.onclick = () => {
|
|
3219
|
-
const innerParams = privateProps.innerParams.get(instance);
|
|
3220
3274
|
if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) {
|
|
3221
3275
|
return;
|
|
3222
3276
|
}
|
|
@@ -3225,13 +3279,17 @@
|
|
|
3225
3279
|
};
|
|
3226
3280
|
|
|
3227
3281
|
/**
|
|
3228
|
-
* @param {
|
|
3282
|
+
* @param {SweetAlertOptions} innerParams
|
|
3229
3283
|
* @returns {boolean}
|
|
3230
3284
|
*/
|
|
3231
3285
|
const isAnyButtonShown = innerParams => {
|
|
3232
3286
|
return innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton;
|
|
3233
3287
|
};
|
|
3234
3288
|
let ignoreOutsideClick = false;
|
|
3289
|
+
|
|
3290
|
+
/**
|
|
3291
|
+
* @param {DomCache} domCache
|
|
3292
|
+
*/
|
|
3235
3293
|
const handleModalMousedown = domCache => {
|
|
3236
3294
|
domCache.popup.onmousedown = () => {
|
|
3237
3295
|
domCache.container.onmouseup = function (e) {
|
|
@@ -3244,20 +3302,29 @@
|
|
|
3244
3302
|
};
|
|
3245
3303
|
};
|
|
3246
3304
|
};
|
|
3305
|
+
|
|
3306
|
+
/**
|
|
3307
|
+
* @param {DomCache} domCache
|
|
3308
|
+
*/
|
|
3247
3309
|
const handleContainerMousedown = domCache => {
|
|
3248
3310
|
domCache.container.onmousedown = () => {
|
|
3249
3311
|
domCache.popup.onmouseup = function (e) {
|
|
3250
3312
|
domCache.popup.onmouseup = undefined;
|
|
3251
3313
|
// We also need to check if the mouseup target is a child of the popup
|
|
3252
|
-
if (e.target === domCache.popup || domCache.popup.contains(e.target)) {
|
|
3314
|
+
if (e.target === domCache.popup || e.target instanceof HTMLElement && domCache.popup.contains(e.target)) {
|
|
3253
3315
|
ignoreOutsideClick = true;
|
|
3254
3316
|
}
|
|
3255
3317
|
};
|
|
3256
3318
|
};
|
|
3257
3319
|
};
|
|
3258
|
-
|
|
3320
|
+
|
|
3321
|
+
/**
|
|
3322
|
+
* @param {SweetAlertOptions} innerParams
|
|
3323
|
+
* @param {DomCache} domCache
|
|
3324
|
+
* @param {Function} dismissWith
|
|
3325
|
+
*/
|
|
3326
|
+
const handleModalClick = (innerParams, domCache, dismissWith) => {
|
|
3259
3327
|
domCache.container.onclick = e => {
|
|
3260
|
-
const innerParams = privateProps.innerParams.get(instance);
|
|
3261
3328
|
if (ignoreOutsideClick) {
|
|
3262
3329
|
ignoreOutsideClick = false;
|
|
3263
3330
|
return;
|
|
@@ -3927,12 +3994,20 @@
|
|
|
3927
3994
|
|
|
3928
3995
|
/** @type {SweetAlert} */
|
|
3929
3996
|
let currentInstance;
|
|
3997
|
+
var _promise = /*#__PURE__*/new WeakMap();
|
|
3930
3998
|
class SweetAlert {
|
|
3931
3999
|
/**
|
|
3932
4000
|
* @param {...any} args
|
|
3933
4001
|
* @this {SweetAlert}
|
|
3934
4002
|
*/
|
|
3935
4003
|
constructor() {
|
|
4004
|
+
/**
|
|
4005
|
+
* @type {Promise<SweetAlertResult>}
|
|
4006
|
+
*/
|
|
4007
|
+
_classPrivateFieldInitSpec(this, _promise, {
|
|
4008
|
+
writable: true,
|
|
4009
|
+
value: void 0
|
|
4010
|
+
});
|
|
3936
4011
|
// Prevent run in Node env
|
|
3937
4012
|
if (typeof window === 'undefined') {
|
|
3938
4013
|
return;
|
|
@@ -3950,8 +4025,7 @@
|
|
|
3950
4025
|
|
|
3951
4026
|
/** @type {boolean} */
|
|
3952
4027
|
this.isAwaitingPromise = false;
|
|
3953
|
-
|
|
3954
|
-
privateProps.promise.set(this, promise);
|
|
4028
|
+
_classPrivateFieldSet(this, _promise, this._main(currentInstance.params));
|
|
3955
4029
|
}
|
|
3956
4030
|
_main(userParams) {
|
|
3957
4031
|
let mixinParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -3983,12 +4057,10 @@
|
|
|
3983
4057
|
|
|
3984
4058
|
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
3985
4059
|
then(onFulfilled) {
|
|
3986
|
-
|
|
3987
|
-
return promise.then(onFulfilled);
|
|
4060
|
+
return _classPrivateFieldGet(this, _promise).then(onFulfilled);
|
|
3988
4061
|
}
|
|
3989
4062
|
finally(onFinally) {
|
|
3990
|
-
|
|
3991
|
-
return promise.finally(onFinally);
|
|
4063
|
+
return _classPrivateFieldGet(this, _promise).finally(onFinally);
|
|
3992
4064
|
}
|
|
3993
4065
|
}
|
|
3994
4066
|
|
|
@@ -4024,8 +4096,8 @@
|
|
|
4024
4096
|
domCache.closeButton.onclick = () => {
|
|
4025
4097
|
dismissWith(DismissReason.close);
|
|
4026
4098
|
};
|
|
4027
|
-
handlePopupClick(
|
|
4028
|
-
addKeydownHandler(
|
|
4099
|
+
handlePopupClick(innerParams, domCache, dismissWith);
|
|
4100
|
+
addKeydownHandler(globalState, innerParams, dismissWith);
|
|
4029
4101
|
handleInputOptionsAndValue(instance, innerParams);
|
|
4030
4102
|
openPopup(innerParams);
|
|
4031
4103
|
setupTimer(globalState, innerParams, dismissWith);
|
|
@@ -4198,7 +4270,7 @@
|
|
|
4198
4270
|
};
|
|
4199
4271
|
});
|
|
4200
4272
|
SweetAlert.DismissReason = DismissReason;
|
|
4201
|
-
SweetAlert.version = '11.7.
|
|
4273
|
+
SweetAlert.version = '11.7.28';
|
|
4202
4274
|
|
|
4203
4275
|
const Swal = SweetAlert;
|
|
4204
4276
|
// @ts-ignore
|