sweetalert2 11.3.4 → 11.3.8
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 +2264 -0
- package/README.md +6 -6
- package/dist/sweetalert2.all.js +127 -47
- package/dist/sweetalert2.all.min.js +1 -1
- package/dist/sweetalert2.js +127 -47
- package/dist/sweetalert2.min.js +1 -1
- package/package.json +10 -6
- package/src/SweetAlert.js +12 -11
- package/src/buttons-handlers.js +30 -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 +36 -5
- package/src/utils/iosFix.js +16 -5
- package/src/utils/isNodeEnv.js +5 -1
- package/src/utils/params.js +2 -2
- package/src/utils/setParameters.js +5 -5
- package/src/utils/utils.js +5 -3
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ Sponsors
|
|
|
19
19
|
|
|
20
20
|
For all questions related to sponsorship please contact me via email limon.monte@protonmail.com
|
|
21
21
|
|
|
22
|
-
[<img src="https://sweetalert2.github.io/images/plus.png" width="80">](SPONSORS.md#sponsors) | [<img src="https://avatars2.githubusercontent.com/u/28631236?s=80&v=4" width="80">](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/phatoil.png" width="80">](https://phatoil.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/celltrackingapps.png" width="80">](https://celltrackingapps.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/mybitcoinslots.png" width="80">](https://www.mybitcoinslots.com/?utm_source=sweetalert2&utm_medium=logo)
|
|
23
|
-
|
|
24
|
-
[Become a sponsor](SPONSORS.md) | [FlowCrypt](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [Pure Essential Oil](https://phatoil.com/) | [Phone Tracking Apps](https://celltrackingapps.com) | [My Bitcoin slots](https://www.mybitcoinslots.com/?utm_source=sweetalert2&utm_medium=logo)
|
|
22
|
+
[<img src="https://sweetalert2.github.io/images/plus.png" width="80">](SPONSORS.md#sponsors) | [<img src="https://avatars2.githubusercontent.com/u/28631236?s=80&v=4" width="80">](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/vegega.jpeg" width="80">](https://www.vegega.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/phatoil.png" width="80">](https://phatoil.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/celltrackingapps.png" width="80">](https://celltrackingapps.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/mybitcoinslots.png" width="80">](https://www.mybitcoinslots.com/?utm_source=sweetalert2&utm_medium=logo)
|
|
23
|
+
-|-|-|-|-|-
|
|
24
|
+
[Become a sponsor](SPONSORS.md#sponsors) | [FlowCrypt](https://flowcrypt.com/?utm_source=sweetalert2&utm_medium=logo) | [Metal Raised Garden Bed](https://www.vegega.com/) | [Pure Essential Oil](https://phatoil.com/) | [Phone Tracking Apps](https://celltrackingapps.com) | [My Bitcoin slots](https://www.mybitcoinslots.com/?utm_source=sweetalert2&utm_medium=logo)
|
|
25
25
|
|
|
26
26
|
[<img src="https://sweetalert2.github.io/images/sponsors/torc-stark.png" width="80">](https://torcstark.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/coderubik.png" width="80">](https://coderubik.com/?utm_source=sweetalert2&utm_medium=logo) | [<img src="https://sweetalert2.github.io/images/sponsors/halvinlaina.png" width="80">](https://halvinlaina.fi/) | [<img src="https://avatars0.githubusercontent.com/u/3986989?s=80&v=4" width="80">](https://github.com/tiagostutz) | [<img src="https://sweetalert2.github.io/images/sponsors/sebaebc.png" width="80">](https://github.com/sebaebc)
|
|
27
27
|
-|-|-|-|-
|
|
@@ -30,9 +30,9 @@ For all questions related to sponsorship please contact me via email limon.monte
|
|
|
30
30
|
NSFW Sponsors
|
|
31
31
|
-------------
|
|
32
32
|
|
|
33
|
-
[<img src="https://sweetalert2.github.io/images/sponsors/
|
|
34
|
-
|
|
35
|
-
[
|
|
33
|
+
[<img src="https://sweetalert2.github.io/images/plus.png" width="80">](SPONSORS.md#sponsors) | [<img src="https://sweetalert2.github.io/images/sponsors/sensualdolls.png" width="80">](https://www.sensualdolls.com) | [<img src="https://sweetalert2.github.io/images/sponsors/bestrealdoll.jpeg" width="80">](https://www.bestrealdoll.com/collections/us-warehouse) | [<img src="https://sweetalert2.github.io/images/sponsors/sexdolltech.jpeg" width="80">](https://www.sexdolltech.com/product-category/us-warehouse/) | [<img src="https://sweetalert2.github.io/images/sponsors/rosewives.png" width="80">](https://rosewives.com/)
|
|
34
|
+
-|-|-|-|-
|
|
35
|
+
[Become a NSFW sponsor](SPONSORS.md#sponsors) | [Sensual Dolls](https://www.sensualdolls.com) | [BestRealDoll](https://www.bestrealdoll.com/collections/us-warehouse) | [SexDollTech](https://www.sexdolltech.com/product-category/us-warehouse/) | [Rose Wives](https://rosewives.com/)
|
|
36
36
|
|
|
37
37
|
[<img src="https://sweetalert2.github.io/images/sponsors/sexdollsoff.png" width="80">](https://www.sexdollsoff.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/realsexdoll.png" width="80">](https://realsexdoll.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/yourdoll.jpg" width="80">](https://www.yourdoll.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/annies-dollhouse.png" width="80">](https://anniesdollhouse.com/) | [<img src="https://sweetalert2.github.io/images/sponsors/sexdollcenter.png" width="80">](https://sexdollcenter.vip/) |
|
|
38
38
|
-|-|-|-|-
|
package/dist/sweetalert2.all.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sweetalert2 v11.3.
|
|
2
|
+
* sweetalert2 v11.3.8
|
|
3
3
|
* Released under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -570,7 +570,11 @@
|
|
|
570
570
|
timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%");
|
|
571
571
|
};
|
|
572
572
|
|
|
573
|
-
|
|
573
|
+
/**
|
|
574
|
+
* Detect Node env
|
|
575
|
+
*
|
|
576
|
+
* @returns {boolean}
|
|
577
|
+
*/
|
|
574
578
|
const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined';
|
|
575
579
|
|
|
576
580
|
const RESTORE_FOCUS_TIMEOUT = 100;
|
|
@@ -695,22 +699,34 @@
|
|
|
695
699
|
addInputChangeListeners();
|
|
696
700
|
};
|
|
697
701
|
|
|
702
|
+
/**
|
|
703
|
+
* @param {HTMLElement | object | string} param
|
|
704
|
+
* @param {HTMLElement} target
|
|
705
|
+
*/
|
|
706
|
+
|
|
698
707
|
const parseHtmlToContainer = (param, target) => {
|
|
699
708
|
// DOM element
|
|
700
709
|
if (param instanceof HTMLElement) {
|
|
701
|
-
target.appendChild(param);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
|
|
710
|
+
target.appendChild(param);
|
|
711
|
+
} // Object
|
|
712
|
+
else if (typeof param === 'object') {
|
|
713
|
+
handleObject(param, target);
|
|
714
|
+
} // Plain string
|
|
715
|
+
else if (param) {
|
|
705
716
|
setInnerHtml(target, param);
|
|
706
717
|
}
|
|
707
718
|
};
|
|
719
|
+
/**
|
|
720
|
+
* @param {object} param
|
|
721
|
+
* @param {HTMLElement} target
|
|
722
|
+
*/
|
|
708
723
|
|
|
709
724
|
const handleObject = (param, target) => {
|
|
710
725
|
// JQuery element(s)
|
|
711
726
|
if (param.jquery) {
|
|
712
|
-
handleJqueryElem(target, param);
|
|
713
|
-
}
|
|
727
|
+
handleJqueryElem(target, param);
|
|
728
|
+
} // For other objects use their string representation
|
|
729
|
+
else {
|
|
714
730
|
setInnerHtml(target, param.toString());
|
|
715
731
|
}
|
|
716
732
|
};
|
|
@@ -1062,12 +1078,12 @@
|
|
|
1062
1078
|
setInputPlaceholder(textarea, params);
|
|
1063
1079
|
setInputLabel(textarea, textarea, params);
|
|
1064
1080
|
|
|
1065
|
-
const getMargin = el => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight);
|
|
1081
|
+
const getMargin = el => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight); // https://github.com/sweetalert2/sweetalert2/issues/2291
|
|
1082
|
+
|
|
1066
1083
|
|
|
1067
1084
|
setTimeout(() => {
|
|
1068
|
-
//
|
|
1085
|
+
// https://github.com/sweetalert2/sweetalert2/issues/1699
|
|
1069
1086
|
if ('MutationObserver' in window) {
|
|
1070
|
-
// #1699
|
|
1071
1087
|
const initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width);
|
|
1072
1088
|
|
|
1073
1089
|
const textareaResizeHandler = () => {
|
|
@@ -1095,11 +1111,13 @@
|
|
|
1095
1111
|
|
|
1096
1112
|
if (params.html) {
|
|
1097
1113
|
parseHtmlToContainer(params.html, htmlContainer);
|
|
1098
|
-
show(htmlContainer, 'block');
|
|
1099
|
-
}
|
|
1114
|
+
show(htmlContainer, 'block');
|
|
1115
|
+
} // Content as plain text
|
|
1116
|
+
else if (params.text) {
|
|
1100
1117
|
htmlContainer.textContent = params.text;
|
|
1101
|
-
show(htmlContainer, 'block');
|
|
1102
|
-
}
|
|
1118
|
+
show(htmlContainer, 'block');
|
|
1119
|
+
} // No content
|
|
1120
|
+
else {
|
|
1103
1121
|
hide(htmlContainer);
|
|
1104
1122
|
}
|
|
1105
1123
|
|
|
@@ -1182,15 +1200,18 @@
|
|
|
1182
1200
|
}
|
|
1183
1201
|
};
|
|
1184
1202
|
|
|
1203
|
+
const successIconHtml = "\n <div class=\"swal2-success-circular-line-left\"></div>\n <span class=\"swal2-success-line-tip\"></span> <span class=\"swal2-success-line-long\"></span>\n <div class=\"swal2-success-ring\"></div> <div class=\"swal2-success-fix\"></div>\n <div class=\"swal2-success-circular-line-right\"></div>\n";
|
|
1204
|
+
const errorIconHtml = "\n <span class=\"swal2-x-mark\">\n <span class=\"swal2-x-mark-line-left\"></span>\n <span class=\"swal2-x-mark-line-right\"></span>\n </span>\n";
|
|
1205
|
+
|
|
1185
1206
|
const setContent = (icon, params) => {
|
|
1186
1207
|
icon.textContent = '';
|
|
1187
1208
|
|
|
1188
1209
|
if (params.iconHtml) {
|
|
1189
1210
|
setInnerHtml(icon, iconContent(params.iconHtml));
|
|
1190
1211
|
} else if (params.icon === 'success') {
|
|
1191
|
-
setInnerHtml(icon,
|
|
1212
|
+
setInnerHtml(icon, successIconHtml);
|
|
1192
1213
|
} else if (params.icon === 'error') {
|
|
1193
|
-
setInnerHtml(icon,
|
|
1214
|
+
setInnerHtml(icon, errorIconHtml);
|
|
1194
1215
|
} else {
|
|
1195
1216
|
const defaultIconHtml = {
|
|
1196
1217
|
question: '?',
|
|
@@ -1303,9 +1324,9 @@
|
|
|
1303
1324
|
const renderPopup = (instance, params) => {
|
|
1304
1325
|
const container = getContainer();
|
|
1305
1326
|
const popup = getPopup(); // Width
|
|
1327
|
+
// https://github.com/sweetalert2/sweetalert2/issues/2170
|
|
1306
1328
|
|
|
1307
1329
|
if (params.toast) {
|
|
1308
|
-
// #2170
|
|
1309
1330
|
applyNumericalStyle(container, 'width', params.width);
|
|
1310
1331
|
popup.style.width = '100%';
|
|
1311
1332
|
popup.insertBefore(getLoader(), getIcon());
|
|
@@ -1416,12 +1437,17 @@
|
|
|
1416
1437
|
if (!template) {
|
|
1417
1438
|
return {};
|
|
1418
1439
|
}
|
|
1440
|
+
/** @type {DocumentFragment} */
|
|
1441
|
+
|
|
1419
1442
|
|
|
1420
1443
|
const templateContent = template.content;
|
|
1421
1444
|
showWarningsForElements(templateContent);
|
|
1422
1445
|
const result = Object.assign(getSwalParams(templateContent), getSwalButtons(templateContent), getSwalImage(templateContent), getSwalIcon(templateContent), getSwalInput(templateContent), getSwalStringParams(templateContent, swalStringParams));
|
|
1423
1446
|
return result;
|
|
1424
1447
|
};
|
|
1448
|
+
/**
|
|
1449
|
+
* @param {DocumentFragment} templateContent
|
|
1450
|
+
*/
|
|
1425
1451
|
|
|
1426
1452
|
const getSwalParams = templateContent => {
|
|
1427
1453
|
const result = {};
|
|
@@ -1440,6 +1466,10 @@
|
|
|
1440
1466
|
});
|
|
1441
1467
|
return result;
|
|
1442
1468
|
};
|
|
1469
|
+
/**
|
|
1470
|
+
* @param {DocumentFragment} templateContent
|
|
1471
|
+
*/
|
|
1472
|
+
|
|
1443
1473
|
|
|
1444
1474
|
const getSwalButtons = templateContent => {
|
|
1445
1475
|
const result = {};
|
|
@@ -1459,9 +1489,15 @@
|
|
|
1459
1489
|
});
|
|
1460
1490
|
return result;
|
|
1461
1491
|
};
|
|
1492
|
+
/**
|
|
1493
|
+
* @param {DocumentFragment} templateContent
|
|
1494
|
+
*/
|
|
1495
|
+
|
|
1462
1496
|
|
|
1463
1497
|
const getSwalImage = templateContent => {
|
|
1464
1498
|
const result = {};
|
|
1499
|
+
/** @type {HTMLElement} */
|
|
1500
|
+
|
|
1465
1501
|
const image = templateContent.querySelector('swal-image');
|
|
1466
1502
|
|
|
1467
1503
|
if (image) {
|
|
@@ -1486,9 +1522,15 @@
|
|
|
1486
1522
|
|
|
1487
1523
|
return result;
|
|
1488
1524
|
};
|
|
1525
|
+
/**
|
|
1526
|
+
* @param {DocumentFragment} templateContent
|
|
1527
|
+
*/
|
|
1528
|
+
|
|
1489
1529
|
|
|
1490
1530
|
const getSwalIcon = templateContent => {
|
|
1491
1531
|
const result = {};
|
|
1532
|
+
/** @type {HTMLElement} */
|
|
1533
|
+
|
|
1492
1534
|
const icon = templateContent.querySelector('swal-icon');
|
|
1493
1535
|
|
|
1494
1536
|
if (icon) {
|
|
@@ -1507,9 +1549,15 @@
|
|
|
1507
1549
|
|
|
1508
1550
|
return result;
|
|
1509
1551
|
};
|
|
1552
|
+
/**
|
|
1553
|
+
* @param {DocumentFragment} templateContent
|
|
1554
|
+
*/
|
|
1555
|
+
|
|
1510
1556
|
|
|
1511
1557
|
const getSwalInput = templateContent => {
|
|
1512
1558
|
const result = {};
|
|
1559
|
+
/** @type {HTMLElement} */
|
|
1560
|
+
|
|
1513
1561
|
const input = templateContent.querySelector('swal-input');
|
|
1514
1562
|
|
|
1515
1563
|
if (input) {
|
|
@@ -1543,12 +1591,19 @@
|
|
|
1543
1591
|
|
|
1544
1592
|
return result;
|
|
1545
1593
|
};
|
|
1594
|
+
/**
|
|
1595
|
+
* @param {DocumentFragment} templateContent
|
|
1596
|
+
* @param {string[]} paramNames
|
|
1597
|
+
*/
|
|
1598
|
+
|
|
1546
1599
|
|
|
1547
1600
|
const getSwalStringParams = (templateContent, paramNames) => {
|
|
1548
1601
|
const result = {};
|
|
1549
1602
|
|
|
1550
1603
|
for (const i in paramNames) {
|
|
1551
1604
|
const paramName = paramNames[i];
|
|
1605
|
+
/** @type {HTMLElement} */
|
|
1606
|
+
|
|
1552
1607
|
const tag = templateContent.querySelector(paramName);
|
|
1553
1608
|
|
|
1554
1609
|
if (tag) {
|
|
@@ -1559,10 +1614,14 @@
|
|
|
1559
1614
|
|
|
1560
1615
|
return result;
|
|
1561
1616
|
};
|
|
1617
|
+
/**
|
|
1618
|
+
* @param {DocumentFragment} templateContent
|
|
1619
|
+
*/
|
|
1620
|
+
|
|
1562
1621
|
|
|
1563
|
-
const showWarningsForElements =
|
|
1622
|
+
const showWarningsForElements = templateContent => {
|
|
1564
1623
|
const allowedElements = swalStringParams.concat(['swal-param', 'swal-button', 'swal-image', 'swal-icon', 'swal-input', 'swal-input-option']);
|
|
1565
|
-
toArray(
|
|
1624
|
+
toArray(templateContent.children).forEach(el => {
|
|
1566
1625
|
const tagName = el.tagName.toLowerCase();
|
|
1567
1626
|
|
|
1568
1627
|
if (allowedElements.indexOf(tagName) === -1) {
|
|
@@ -1717,8 +1776,8 @@
|
|
|
1717
1776
|
/* istanbul ignore file */
|
|
1718
1777
|
|
|
1719
1778
|
const iOSfix = () => {
|
|
1720
|
-
// @ts-ignore
|
|
1721
|
-
|
|
1779
|
+
const iOS = // @ts-ignore
|
|
1780
|
+
/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;
|
|
1722
1781
|
|
|
1723
1782
|
if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
|
|
1724
1783
|
const offset = document.body.scrollTop;
|
|
@@ -1746,9 +1805,12 @@
|
|
|
1746
1805
|
}
|
|
1747
1806
|
}
|
|
1748
1807
|
};
|
|
1808
|
+
/**
|
|
1809
|
+
* https://github.com/sweetalert2/sweetalert2/issues/1246
|
|
1810
|
+
*/
|
|
1811
|
+
|
|
1749
1812
|
|
|
1750
1813
|
const lockBodyScroll = () => {
|
|
1751
|
-
// #1246
|
|
1752
1814
|
const container = getContainer();
|
|
1753
1815
|
let preventTouchMove;
|
|
1754
1816
|
|
|
@@ -1796,9 +1858,15 @@
|
|
|
1796
1858
|
const isStylus = event => {
|
|
1797
1859
|
return event.touches && event.touches.length && event.touches[0].touchType === 'stylus';
|
|
1798
1860
|
};
|
|
1861
|
+
/**
|
|
1862
|
+
* https://github.com/sweetalert2/sweetalert2/issues/1891
|
|
1863
|
+
*
|
|
1864
|
+
* @param {TouchEvent} event
|
|
1865
|
+
* @returns {boolean}
|
|
1866
|
+
*/
|
|
1867
|
+
|
|
1799
1868
|
|
|
1800
1869
|
const isZoom = event => {
|
|
1801
|
-
// #1891
|
|
1802
1870
|
return event.touches && event.touches.length > 1;
|
|
1803
1871
|
};
|
|
1804
1872
|
|
|
@@ -2151,6 +2219,11 @@
|
|
|
2151
2219
|
/* 'confirm' | 'deny' */
|
|
2152
2220
|
) => {
|
|
2153
2221
|
const innerParams = privateProps.innerParams.get(instance);
|
|
2222
|
+
|
|
2223
|
+
if (!innerParams.input) {
|
|
2224
|
+
return error("The \"input\" parameter is needed to be set when using returnInputValueOn".concat(capitalizeFirstLetter(type)));
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2154
2227
|
const inputValue = getInputValue(instance, innerParams);
|
|
2155
2228
|
|
|
2156
2229
|
if (innerParams.inputValidator) {
|
|
@@ -2405,19 +2478,22 @@
|
|
|
2405
2478
|
|
|
2406
2479
|
|
|
2407
2480
|
if (e.key === 'Enter') {
|
|
2408
|
-
handleEnter(instance, e, innerParams);
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2481
|
+
handleEnter(instance, e, innerParams);
|
|
2482
|
+
} // TAB
|
|
2483
|
+
else if (e.key === 'Tab') {
|
|
2484
|
+
handleTab(e, innerParams);
|
|
2485
|
+
} // ARROWS - switch focus between buttons
|
|
2486
|
+
else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(e.key)) {
|
|
2487
|
+
handleArrows(e.key);
|
|
2488
|
+
} // ESC
|
|
2489
|
+
else if (e.key === 'Escape') {
|
|
2414
2490
|
handleEsc(e, innerParams, dismissWith);
|
|
2415
2491
|
}
|
|
2416
2492
|
};
|
|
2417
2493
|
|
|
2418
2494
|
const handleEnter = (instance, e, innerParams) => {
|
|
2419
|
-
// #720 #721
|
|
2420
|
-
if (e.isComposing) {
|
|
2495
|
+
// #2386 #720 #721
|
|
2496
|
+
if (!callIfFunction(innerParams.allowEnterKey) || e.isComposing) {
|
|
2421
2497
|
return;
|
|
2422
2498
|
}
|
|
2423
2499
|
|
|
@@ -2441,13 +2517,13 @@
|
|
|
2441
2517
|
btnIndex = i;
|
|
2442
2518
|
break;
|
|
2443
2519
|
}
|
|
2444
|
-
}
|
|
2520
|
+
} // Cycle to the next button
|
|
2521
|
+
|
|
2445
2522
|
|
|
2446
2523
|
if (!e.shiftKey) {
|
|
2447
|
-
// Cycle to the next button
|
|
2448
2524
|
setFocus(innerParams, btnIndex, 1);
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2525
|
+
} // Cycle to the prev button
|
|
2526
|
+
else {
|
|
2451
2527
|
setFocus(innerParams, btnIndex, -1);
|
|
2452
2528
|
}
|
|
2453
2529
|
|
|
@@ -2504,7 +2580,7 @@
|
|
|
2504
2580
|
};
|
|
2505
2581
|
|
|
2506
2582
|
function fire() {
|
|
2507
|
-
const Swal = this;
|
|
2583
|
+
const Swal = this; // eslint-disable-line @typescript-eslint/no-this-alias
|
|
2508
2584
|
|
|
2509
2585
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2510
2586
|
args[_key] = arguments[_key];
|
|
@@ -2990,15 +3066,7 @@
|
|
|
2990
3066
|
return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
|
|
2991
3067
|
}
|
|
2992
3068
|
|
|
2993
|
-
const validUpdatableParams =
|
|
2994
|
-
|
|
2995
|
-
Object.keys(params).forEach(param => {
|
|
2996
|
-
if (isUpdatableParameter(param)) {
|
|
2997
|
-
validUpdatableParams[param] = params[param];
|
|
2998
|
-
} else {
|
|
2999
|
-
warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md"));
|
|
3000
|
-
}
|
|
3001
|
-
});
|
|
3069
|
+
const validUpdatableParams = filterValidParams(params);
|
|
3002
3070
|
const updatedParams = Object.assign({}, innerParams, validUpdatableParams);
|
|
3003
3071
|
render(this, updatedParams);
|
|
3004
3072
|
privateProps.innerParams.set(this, updatedParams);
|
|
@@ -3011,6 +3079,18 @@
|
|
|
3011
3079
|
});
|
|
3012
3080
|
}
|
|
3013
3081
|
|
|
3082
|
+
const filterValidParams = params => {
|
|
3083
|
+
const validUpdatableParams = {};
|
|
3084
|
+
Object.keys(params).forEach(param => {
|
|
3085
|
+
if (isUpdatableParameter(param)) {
|
|
3086
|
+
validUpdatableParams[param] = params[param];
|
|
3087
|
+
} else {
|
|
3088
|
+
warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md"));
|
|
3089
|
+
}
|
|
3090
|
+
});
|
|
3091
|
+
return validUpdatableParams;
|
|
3092
|
+
};
|
|
3093
|
+
|
|
3014
3094
|
function _destroy() {
|
|
3015
3095
|
const domCache = privateProps.domCache.get(this);
|
|
3016
3096
|
const innerParams = privateProps.innerParams.get(this);
|
|
@@ -3298,7 +3378,7 @@
|
|
|
3298
3378
|
};
|
|
3299
3379
|
});
|
|
3300
3380
|
SweetAlert.DismissReason = DismissReason;
|
|
3301
|
-
SweetAlert.version = '11.3.
|
|
3381
|
+
SweetAlert.version = '11.3.8';
|
|
3302
3382
|
|
|
3303
3383
|
const Swal = SweetAlert; // @ts-ignore
|
|
3304
3384
|
|