sweetalert2 11.7.27 → 11.7.29
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 +16 -16
- package/dist/sweetalert2.all.js +75 -44
- package/dist/sweetalert2.all.min.js +2 -2
- package/dist/sweetalert2.js +75 -44
- package/dist/sweetalert2.min.js +2 -2
- package/package.json +3 -2
- package/src/SweetAlert.js +3 -3
- 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/utils/dom/domUtils.js +1 -1
- package/sweetalert2.d.ts +3 -3
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,62 +59,63 @@ 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://
|
|
64
|
-
<td align="center"><a href="https://
|
|
65
|
-
<td align="center"><a href="https://
|
|
66
|
-
<td align="center"><a href="https://
|
|
62
|
+
<td align="center"><a href="https://pinktoys.co.uk/pocket-pussy/"><img src="https://sweetalert2.github.io/images/sponsors/pinktoys.png" width="80"><br>Pocket pussy</a></td>
|
|
63
|
+
<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 <br> Masturbator Brand</a></td>
|
|
64
|
+
<td align="center"><a href="https://vlixa.com/"><img src="https://sweetalert2.github.io/images/sponsors/vlixa.png" width="80"><br>Vlixa</a></td>
|
|
65
|
+
<td align="center"><a href="https://taboodude.com/"><img src="https://sweetalert2.github.io/images/sponsors/taboodude.png" width="80"><br>TabooDude</a></td>
|
|
67
66
|
</tr>
|
|
68
67
|
</table>
|
|
69
68
|
<table>
|
|
70
69
|
<tr>
|
|
70
|
+
<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>
|
|
71
|
+
<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>
|
|
71
72
|
<td align="center"><a href="https://www.bestblowjobmachines.com/"><img src="https://sweetalert2.github.io/images/sponsors/best-blowjob-machines.jpg" width="80"><br>Best Blowjob Machines</a></td>
|
|
72
73
|
<td align="center"><a href="https://escortsear.ch/"><img src="https://sweetalert2.github.io/images/sponsors/escortsearch.jpg" width="80"><br>EscortSearch</a></td>
|
|
73
74
|
<td align="center"><a href="https://nakedoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/nakedoll.png" width="80"><br>NakeDoll</a></td>
|
|
74
75
|
<td align="center"><a href="https://readysetcam.com/"><img src="https://sweetalert2.github.io/images/sponsors/readysetcam.png" width="80"><br>Ready Set Cam</a></td>
|
|
75
|
-
<td align="center"><a href="https://www.onahole.com/"><img src="https://sweetalert2.github.io/images/sponsors/onahole.png" width="80"><br>hentai sex toys</a></td>
|
|
76
|
-
<td align="center"><a href="https://blowupdollshop.com/inflatable-sex-doll/"><img src="https://sweetalert2.github.io/images/sponsors/blowupdollshop.png" width="80"><br>Inflatable sex doll</a></td>
|
|
77
76
|
</tr>
|
|
78
77
|
</table>
|
|
79
78
|
<table>
|
|
80
79
|
<tr>
|
|
80
|
+
<td align="center"><a href="https://www.onahole.com/"><img src="https://sweetalert2.github.io/images/sponsors/onahole.png" width="80"><br>hentai sex toys</a></td>
|
|
81
|
+
<td align="center"><a href="https://blowupdollshop.com/inflatable-sex-doll/"><img src="https://sweetalert2.github.io/images/sponsors/blowupdollshop.png" width="80"><br>Inflatable sex doll</a></td>
|
|
81
82
|
<td align="center"><a href="https://sextoystop.com/"><img src="https://sweetalert2.github.io/images/sponsors/sextoystop.png" width="80"><br>Sex Doll Torso</a></td>
|
|
82
83
|
<td align="center"><a href="https://sexydollies.com/"><img src="https://sweetalert2.github.io/images/sponsors/sexydollies.png" width="80"><br>porn sexdoll</a></td>
|
|
83
84
|
<td align="center"><a href="https://bululusexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/bululusexdoll.png" width="80"><br>cheap sex doll</a></td>
|
|
84
85
|
<td align="center"><a href="https://bululu.shop/"><img src="https://sweetalert2.github.io/images/sponsors/bululu.png" width="80"><br>BULULU</a></td>
|
|
85
|
-
<td align="center"><a href="https://vsdoll.net/"><img src="https://sweetalert2.github.io/images/sponsors/vsdoll.png" width="80"><br>VSDoll</a></td>
|
|
86
|
-
<td align="center"><a href="https://www.xndoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/xndoll.jpeg" width="80"><br>XNDOLL</a></td>
|
|
87
86
|
</tr>
|
|
88
87
|
</table>
|
|
89
88
|
<table>
|
|
90
89
|
<tr>
|
|
90
|
+
<td align="center"><a href="https://vsdoll.net/"><img src="https://sweetalert2.github.io/images/sponsors/vsdoll.png" width="80"><br>VSDoll</a></td>
|
|
91
|
+
<td align="center"><a href="https://www.xndoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/xndoll.jpeg" width="80"><br>XNDOLL</a></td>
|
|
91
92
|
<td align="center"><a href="https://www.sextorso.com/"><img src="https://sweetalert2.github.io/images/sponsors/sextorso.png" width="80"><br>sexdoll torso</a></td>
|
|
92
93
|
<td align="center"><a href="https://www.minisexdoll.com/anime-sexdoll/"><img src="https://sweetalert2.github.io/images/sponsors/minisexdoll.png" width="80"><br>anime sexdoll</a></td>
|
|
93
94
|
<td align="center"><a href="https://www.myminisexdoll.com/cheap-sex-dolls/"><img src="https://sweetalert2.github.io/images/sponsors/myminisexdoll.png" width="80"><br>cheap sexdoll</a></td>
|
|
94
95
|
<td align="center"><a href="https://www.hugedildo.com/"><img src="https://sweetalert2.github.io/images/sponsors/hugedildo.png" width="80"><br>huge dildo</a></td>
|
|
95
|
-
<td align="center"><a href="https://www.uusexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/uusexdoll.png" width="80"><br>sexdoll</a></td>
|
|
96
|
-
<td align="center"><a href="https://cutesexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/cutesexdoll.jpg" width="80"><br>Cute Sex Doll</a></td>
|
|
97
96
|
</tr>
|
|
98
97
|
</table>
|
|
99
98
|
<table>
|
|
100
99
|
<tr>
|
|
100
|
+
<td align="center"><a href="https://www.uusexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/uusexdoll.png" width="80"><br>sexdoll</a></td>
|
|
101
|
+
<td align="center"><a href="https://cutesexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/cutesexdoll.jpg" width="80"><br>Cute Sex Doll</a></td>
|
|
101
102
|
<td align="center"><a href="https://www.uusextoy.com/best-pocket-pussy/"><img src="https://sweetalert2.github.io/images/sponsors/uusextoy.png" width="80"><br>best pocket pussy</a></td>
|
|
102
103
|
<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
104
|
<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
|
-
<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>
|
|
109
108
|
<tr>
|
|
109
|
+
<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>
|
|
110
110
|
<td align="center"><a href="https://www.sexvibrators.in/"><img src="https://sweetalert2.github.io/images/sponsors/sexvibrator.png" width="80"><br>Sex Vibrators</a></td>
|
|
111
111
|
<td align="center"><a href="https://www.viva-awa.com/"><img src="https://sweetalert2.github.io/images/sponsors/viva-awa.png" width="80"><br>Viva Awa</a></td>
|
|
112
112
|
<td align="center"><a href="https://www.sensualdolls.com/"><img src="https://sweetalert2.github.io/images/sponsors/sensualdolls.png" width="80"><br>Sensual Dolls</a></td>
|
|
113
113
|
<td align="center"><a href="https://www.bestrealdoll.com/collections/us-warehouse"><img src="https://sweetalert2.github.io/images/sponsors/bestrealdoll.jpeg" width="80"><br>BestRealDoll</a></td>
|
|
114
|
-
<td align="center"><a href="https://www.sexdolltech.com/product-category/us-warehouse/"><img src="https://sweetalert2.github.io/images/sponsors/sexdolltech.jpeg" width="80"><br>SexDollTech</a></td>
|
|
115
114
|
</tr>
|
|
116
115
|
</table>
|
|
117
116
|
<table>
|
|
118
117
|
<tr>
|
|
118
|
+
<td align="center"><a href="https://www.sexdolltech.com/product-category/us-warehouse/"><img src="https://sweetalert2.github.io/images/sponsors/sexdolltech.jpeg" width="80"><br>SexDollTech</a></td>
|
|
119
119
|
<td align="center"><a href="https://www.sexdollsoff.com/"><img src="https://sweetalert2.github.io/images/sponsors/sexdollsoff.png" width="80"><br>SexDollsOff</a></td>
|
|
120
120
|
<td align="center"><a href="https://realsexdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/realsexdoll.png" width="80"><br>RealSexDoll</a></td>
|
|
121
121
|
<td align="center"><a href="https://www.yourdoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/yourdoll.jpg" width="80"><br>Your Doll</a></td>
|
package/dist/sweetalert2.all.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sweetalert2 v11.7.
|
|
2
|
+
* sweetalert2 v11.7.29
|
|
3
3
|
* Released under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -84,21 +84,6 @@
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
/**
|
|
88
|
-
* This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has.
|
|
89
|
-
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')`
|
|
90
|
-
* This is the approach that Babel will probably take to implement private methods/fields
|
|
91
|
-
* https://github.com/tc39/proposal-private-methods
|
|
92
|
-
* https://github.com/babel/babel/pull/7555
|
|
93
|
-
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*
|
|
94
|
-
* then we can use that language feature.
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
var privateProps = {
|
|
98
|
-
innerParams: new WeakMap(),
|
|
99
|
-
domCache: new WeakMap()
|
|
100
|
-
};
|
|
101
|
-
|
|
102
87
|
const swalPrefix = 'swal2-';
|
|
103
88
|
|
|
104
89
|
/**
|
|
@@ -524,7 +509,7 @@
|
|
|
524
509
|
|
|
525
510
|
/**
|
|
526
511
|
* @param {HTMLElement} popup
|
|
527
|
-
* @param {import('./renderers/renderInput').InputClass} inputClass
|
|
512
|
+
* @param {import('./renderers/renderInput').InputClass | SweetAlertInput} inputClass
|
|
528
513
|
* @returns {HTMLInputElement | null}
|
|
529
514
|
*/
|
|
530
515
|
const getInput$1 = (popup, inputClass) => {
|
|
@@ -1093,6 +1078,21 @@
|
|
|
1093
1078
|
addClass(container, swalClasses["grow-".concat(grow)]);
|
|
1094
1079
|
}
|
|
1095
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
|
+
|
|
1096
1096
|
/// <reference path="../../../../sweetalert2.d.ts"/>
|
|
1097
1097
|
|
|
1098
1098
|
|
|
@@ -1795,15 +1795,14 @@
|
|
|
1795
1795
|
};
|
|
1796
1796
|
|
|
1797
1797
|
/**
|
|
1798
|
-
* @param {SweetAlert} instance
|
|
1799
1798
|
* @param {GlobalState} globalState
|
|
1800
1799
|
* @param {SweetAlertOptions} innerParams
|
|
1801
1800
|
* @param {*} dismissWith
|
|
1802
1801
|
*/
|
|
1803
|
-
const addKeydownHandler = (
|
|
1802
|
+
const addKeydownHandler = (globalState, innerParams, dismissWith) => {
|
|
1804
1803
|
removeKeydownHandler(globalState);
|
|
1805
1804
|
if (!innerParams.toast) {
|
|
1806
|
-
globalState.keydownHandler = e => keydownHandler(
|
|
1805
|
+
globalState.keydownHandler = e => keydownHandler(innerParams, e, dismissWith);
|
|
1807
1806
|
globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup();
|
|
1808
1807
|
globalState.keydownListenerCapture = innerParams.keydownListenerCapture;
|
|
1809
1808
|
globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, {
|
|
@@ -1818,6 +1817,7 @@
|
|
|
1818
1817
|
* @param {number} increment
|
|
1819
1818
|
*/
|
|
1820
1819
|
const setFocus = (index, increment) => {
|
|
1820
|
+
var _dom$getPopup;
|
|
1821
1821
|
const focusableElements = getFocusableElements();
|
|
1822
1822
|
// search for visible elements and select the next possible match
|
|
1823
1823
|
if (focusableElements.length) {
|
|
@@ -1835,18 +1835,17 @@
|
|
|
1835
1835
|
return;
|
|
1836
1836
|
}
|
|
1837
1837
|
// no visible focusable elements, focus the popup
|
|
1838
|
-
getPopup().focus();
|
|
1838
|
+
(_dom$getPopup = getPopup()) === null || _dom$getPopup === void 0 || _dom$getPopup.focus();
|
|
1839
1839
|
};
|
|
1840
1840
|
const arrowKeysNextButton = ['ArrowRight', 'ArrowDown'];
|
|
1841
1841
|
const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp'];
|
|
1842
1842
|
|
|
1843
1843
|
/**
|
|
1844
|
-
* @param {
|
|
1844
|
+
* @param {SweetAlertOptions} innerParams
|
|
1845
1845
|
* @param {KeyboardEvent} event
|
|
1846
1846
|
* @param {Function} dismissWith
|
|
1847
1847
|
*/
|
|
1848
|
-
const keydownHandler = (
|
|
1849
|
-
const innerParams = privateProps.innerParams.get(instance);
|
|
1848
|
+
const keydownHandler = (innerParams, event, dismissWith) => {
|
|
1850
1849
|
if (!innerParams) {
|
|
1851
1850
|
return; // This instance has already been destroyed
|
|
1852
1851
|
}
|
|
@@ -1864,7 +1863,7 @@
|
|
|
1864
1863
|
|
|
1865
1864
|
// ENTER
|
|
1866
1865
|
if (event.key === 'Enter') {
|
|
1867
|
-
handleEnter(
|
|
1866
|
+
handleEnter(event, innerParams);
|
|
1868
1867
|
}
|
|
1869
1868
|
|
|
1870
1869
|
// TAB
|
|
@@ -1884,16 +1883,16 @@
|
|
|
1884
1883
|
};
|
|
1885
1884
|
|
|
1886
1885
|
/**
|
|
1887
|
-
* @param {SweetAlert} instance
|
|
1888
1886
|
* @param {KeyboardEvent} event
|
|
1889
1887
|
* @param {SweetAlertOptions} innerParams
|
|
1890
1888
|
*/
|
|
1891
|
-
const handleEnter = (
|
|
1889
|
+
const handleEnter = (event, innerParams) => {
|
|
1892
1890
|
// https://github.com/sweetalert2/sweetalert2/issues/2386
|
|
1893
1891
|
if (!callIfFunction(innerParams.allowEnterKey)) {
|
|
1894
1892
|
return;
|
|
1895
1893
|
}
|
|
1896
|
-
|
|
1894
|
+
const input = getInput$1(getPopup(), innerParams.input);
|
|
1895
|
+
if (event.target && input && event.target instanceof HTMLElement && event.target.outerHTML === input.outerHTML) {
|
|
1897
1896
|
if (['textarea', 'file'].includes(innerParams.input)) {
|
|
1898
1897
|
return; // do not submit
|
|
1899
1898
|
}
|
|
@@ -1934,9 +1933,13 @@
|
|
|
1934
1933
|
* @param {string} key
|
|
1935
1934
|
*/
|
|
1936
1935
|
const handleArrows = key => {
|
|
1936
|
+
const actions = getActions();
|
|
1937
1937
|
const confirmButton = getConfirmButton();
|
|
1938
1938
|
const denyButton = getDenyButton();
|
|
1939
1939
|
const cancelButton = getCancelButton();
|
|
1940
|
+
if (!actions || !confirmButton || !denyButton || !cancelButton) {
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1940
1943
|
/** @type HTMLElement[] */
|
|
1941
1944
|
const buttons = [confirmButton, denyButton, cancelButton];
|
|
1942
1945
|
if (document.activeElement instanceof HTMLElement && !buttons.includes(document.activeElement)) {
|
|
@@ -1944,7 +1947,10 @@
|
|
|
1944
1947
|
}
|
|
1945
1948
|
const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling';
|
|
1946
1949
|
let buttonToFocus = document.activeElement;
|
|
1947
|
-
|
|
1950
|
+
if (!buttonToFocus) {
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
for (let i = 0; i < actions.children.length; i++) {
|
|
1948
1954
|
buttonToFocus = buttonToFocus[sibling];
|
|
1949
1955
|
if (!buttonToFocus) {
|
|
1950
1956
|
return;
|
|
@@ -2674,7 +2680,7 @@
|
|
|
2674
2680
|
|
|
2675
2681
|
/**
|
|
2676
2682
|
* @param {SweetAlert} instance
|
|
2677
|
-
* @param {SweetAlertInputValue
|
|
2683
|
+
* @param {SweetAlertInputValue} inputValue
|
|
2678
2684
|
* @param {'confirm' | 'deny'} type
|
|
2679
2685
|
*/
|
|
2680
2686
|
const handleInputValidator = (instance, inputValue, type) => {
|
|
@@ -2888,6 +2894,7 @@
|
|
|
2888
2894
|
* Show block with validation message
|
|
2889
2895
|
*
|
|
2890
2896
|
* @param {string} error
|
|
2897
|
+
* @this {SweetAlert}
|
|
2891
2898
|
*/
|
|
2892
2899
|
function showValidationMessage(error) {
|
|
2893
2900
|
const domCache = privateProps.domCache.get(this);
|
|
@@ -2900,7 +2907,7 @@
|
|
|
2900
2907
|
show(domCache.validationMessage);
|
|
2901
2908
|
const input = this.getInput();
|
|
2902
2909
|
if (input) {
|
|
2903
|
-
input.setAttribute('aria-invalid', true);
|
|
2910
|
+
input.setAttribute('aria-invalid', 'true');
|
|
2904
2911
|
input.setAttribute('aria-describedby', swalClasses['validation-message']);
|
|
2905
2912
|
focusInput(input);
|
|
2906
2913
|
addClass(input, swalClasses.inputerror);
|
|
@@ -2909,6 +2916,8 @@
|
|
|
2909
2916
|
|
|
2910
2917
|
/**
|
|
2911
2918
|
* Hide block with validation message
|
|
2919
|
+
*
|
|
2920
|
+
* @this {SweetAlert}
|
|
2912
2921
|
*/
|
|
2913
2922
|
function resetValidationMessage() {
|
|
2914
2923
|
const domCache = privateProps.domCache.get(this);
|
|
@@ -3235,10 +3244,14 @@
|
|
|
3235
3244
|
update: update
|
|
3236
3245
|
});
|
|
3237
3246
|
|
|
3238
|
-
|
|
3239
|
-
|
|
3247
|
+
/**
|
|
3248
|
+
* @param {SweetAlertOptions} innerParams
|
|
3249
|
+
* @param {DomCache} domCache
|
|
3250
|
+
* @param {Function} dismissWith
|
|
3251
|
+
*/
|
|
3252
|
+
const handlePopupClick = (innerParams, domCache, dismissWith) => {
|
|
3240
3253
|
if (innerParams.toast) {
|
|
3241
|
-
handleToastClick(
|
|
3254
|
+
handleToastClick(innerParams, domCache, dismissWith);
|
|
3242
3255
|
} else {
|
|
3243
3256
|
// Ignore click events that had mousedown on the popup but mouseup on the container
|
|
3244
3257
|
// This can happen when the user drags a slider
|
|
@@ -3246,13 +3259,18 @@
|
|
|
3246
3259
|
|
|
3247
3260
|
// Ignore click events that had mousedown on the container but mouseup on the popup
|
|
3248
3261
|
handleContainerMousedown(domCache);
|
|
3249
|
-
handleModalClick(
|
|
3262
|
+
handleModalClick(innerParams, domCache, dismissWith);
|
|
3250
3263
|
}
|
|
3251
3264
|
};
|
|
3252
|
-
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* @param {SweetAlertOptions} innerParams
|
|
3268
|
+
* @param {DomCache} domCache
|
|
3269
|
+
* @param {Function} dismissWith
|
|
3270
|
+
*/
|
|
3271
|
+
const handleToastClick = (innerParams, domCache, dismissWith) => {
|
|
3253
3272
|
// Closing toast by internal click
|
|
3254
3273
|
domCache.popup.onclick = () => {
|
|
3255
|
-
const innerParams = privateProps.innerParams.get(instance);
|
|
3256
3274
|
if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) {
|
|
3257
3275
|
return;
|
|
3258
3276
|
}
|
|
@@ -3261,13 +3279,17 @@
|
|
|
3261
3279
|
};
|
|
3262
3280
|
|
|
3263
3281
|
/**
|
|
3264
|
-
* @param {
|
|
3282
|
+
* @param {SweetAlertOptions} innerParams
|
|
3265
3283
|
* @returns {boolean}
|
|
3266
3284
|
*/
|
|
3267
3285
|
const isAnyButtonShown = innerParams => {
|
|
3268
3286
|
return innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton;
|
|
3269
3287
|
};
|
|
3270
3288
|
let ignoreOutsideClick = false;
|
|
3289
|
+
|
|
3290
|
+
/**
|
|
3291
|
+
* @param {DomCache} domCache
|
|
3292
|
+
*/
|
|
3271
3293
|
const handleModalMousedown = domCache => {
|
|
3272
3294
|
domCache.popup.onmousedown = () => {
|
|
3273
3295
|
domCache.container.onmouseup = function (e) {
|
|
@@ -3280,20 +3302,29 @@
|
|
|
3280
3302
|
};
|
|
3281
3303
|
};
|
|
3282
3304
|
};
|
|
3305
|
+
|
|
3306
|
+
/**
|
|
3307
|
+
* @param {DomCache} domCache
|
|
3308
|
+
*/
|
|
3283
3309
|
const handleContainerMousedown = domCache => {
|
|
3284
3310
|
domCache.container.onmousedown = () => {
|
|
3285
3311
|
domCache.popup.onmouseup = function (e) {
|
|
3286
3312
|
domCache.popup.onmouseup = undefined;
|
|
3287
3313
|
// We also need to check if the mouseup target is a child of the popup
|
|
3288
|
-
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)) {
|
|
3289
3315
|
ignoreOutsideClick = true;
|
|
3290
3316
|
}
|
|
3291
3317
|
};
|
|
3292
3318
|
};
|
|
3293
3319
|
};
|
|
3294
|
-
|
|
3320
|
+
|
|
3321
|
+
/**
|
|
3322
|
+
* @param {SweetAlertOptions} innerParams
|
|
3323
|
+
* @param {DomCache} domCache
|
|
3324
|
+
* @param {Function} dismissWith
|
|
3325
|
+
*/
|
|
3326
|
+
const handleModalClick = (innerParams, domCache, dismissWith) => {
|
|
3295
3327
|
domCache.container.onclick = e => {
|
|
3296
|
-
const innerParams = privateProps.innerParams.get(instance);
|
|
3297
3328
|
if (ignoreOutsideClick) {
|
|
3298
3329
|
ignoreOutsideClick = false;
|
|
3299
3330
|
return;
|
|
@@ -4065,8 +4096,8 @@
|
|
|
4065
4096
|
domCache.closeButton.onclick = () => {
|
|
4066
4097
|
dismissWith(DismissReason.close);
|
|
4067
4098
|
};
|
|
4068
|
-
handlePopupClick(
|
|
4069
|
-
addKeydownHandler(
|
|
4099
|
+
handlePopupClick(innerParams, domCache, dismissWith);
|
|
4100
|
+
addKeydownHandler(globalState, innerParams, dismissWith);
|
|
4070
4101
|
handleInputOptionsAndValue(instance, innerParams);
|
|
4071
4102
|
openPopup(innerParams);
|
|
4072
4103
|
setupTimer(globalState, innerParams, dismissWith);
|
|
@@ -4239,7 +4270,7 @@
|
|
|
4239
4270
|
};
|
|
4240
4271
|
});
|
|
4241
4272
|
SweetAlert.DismissReason = DismissReason;
|
|
4242
|
-
SweetAlert.version = '11.7.
|
|
4273
|
+
SweetAlert.version = '11.7.29';
|
|
4243
4274
|
|
|
4244
4275
|
const Swal = SweetAlert;
|
|
4245
4276
|
// @ts-ignore
|