sweetalert2 11.7.23 → 11.7.25
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 +2 -2
- package/dist/sweetalert2.all.js +79 -126
- package/dist/sweetalert2.all.min.js +2 -2
- package/dist/sweetalert2.js +79 -126
- package/dist/sweetalert2.min.js +2 -2
- package/package.json +1 -1
- package/src/SweetAlert.js +1 -1
- package/src/staticMethods/dom.js +3 -3
- package/src/utils/scrollbarFix.js +6 -2
package/README.md
CHANGED
|
@@ -60,15 +60,15 @@ NSFW Sponsors
|
|
|
60
60
|
<table>
|
|
61
61
|
<tr>
|
|
62
62
|
<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://faplux.com/"><img src="https://sweetalert2.github.io/images/sponsors/faplux.png" width="80"><br>Faplux</a></td>
|
|
63
64
|
<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>
|
|
64
65
|
<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>
|
|
65
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>
|
|
66
|
-
<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>
|
|
67
67
|
</tr>
|
|
68
68
|
</table>
|
|
69
69
|
<table>
|
|
70
70
|
<tr>
|
|
71
|
-
<td align="center"><a href="https://
|
|
71
|
+
<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
72
|
<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
73
|
<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
74
|
<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>
|
package/dist/sweetalert2.all.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sweetalert2 v11.7.
|
|
2
|
+
* sweetalert2 v11.7.25
|
|
3
3
|
* Released under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
* @param {string | string[]} message
|
|
172
172
|
*/
|
|
173
173
|
const warn = message => {
|
|
174
|
-
console.warn(
|
|
174
|
+
console.warn("".concat(consolePrefix, " ").concat(typeof message === 'object' ? message.join(' ') : message));
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
/**
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
* @param {string} message
|
|
181
181
|
*/
|
|
182
182
|
const error = message => {
|
|
183
|
-
console.error(
|
|
183
|
+
console.error("".concat(consolePrefix, " ").concat(message));
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
/**
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
* @param {string} useInstead
|
|
211
211
|
*/
|
|
212
212
|
const warnAboutDeprecation = (deprecatedParam, useInstead) => {
|
|
213
|
-
warnOnce(
|
|
213
|
+
warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead."));
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
/**
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
*
|
|
246
246
|
* @returns {HTMLElement | null}
|
|
247
247
|
*/
|
|
248
|
-
const getContainer = () => document.body.querySelector(
|
|
248
|
+
const getContainer = () => document.body.querySelector(".".concat(swalClasses.container));
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
251
|
* @param {string} selectorString
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
* @returns {HTMLElement | null}
|
|
262
262
|
*/
|
|
263
263
|
const elementByClass = className => {
|
|
264
|
-
return elementBySelector(
|
|
264
|
+
return elementBySelector(".".concat(className));
|
|
265
265
|
};
|
|
266
266
|
|
|
267
267
|
/**
|
|
@@ -307,17 +307,17 @@
|
|
|
307
307
|
/**
|
|
308
308
|
* @returns {HTMLButtonElement | null}
|
|
309
309
|
*/
|
|
310
|
-
const getConfirmButton = () => /** @type {HTMLButtonElement} */elementBySelector(
|
|
310
|
+
const getConfirmButton = () => /** @type {HTMLButtonElement} */elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm));
|
|
311
311
|
|
|
312
312
|
/**
|
|
313
313
|
* @returns {HTMLButtonElement | null}
|
|
314
314
|
*/
|
|
315
|
-
const getCancelButton = () => /** @type {HTMLButtonElement} */elementBySelector(
|
|
315
|
+
const getCancelButton = () => /** @type {HTMLButtonElement} */elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel));
|
|
316
316
|
|
|
317
317
|
/**
|
|
318
318
|
* @returns {HTMLButtonElement | null}
|
|
319
319
|
*/
|
|
320
|
-
const getDenyButton = () => /** @type {HTMLButtonElement} */elementBySelector(
|
|
320
|
+
const getDenyButton = () => /** @type {HTMLButtonElement} */elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.deny));
|
|
321
321
|
|
|
322
322
|
/**
|
|
323
323
|
* @returns {HTMLElement | null}
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
/**
|
|
328
328
|
* @returns {HTMLElement | null}
|
|
329
329
|
*/
|
|
330
|
-
const getLoader = () => elementBySelector(
|
|
330
|
+
const getLoader = () => elementBySelector(".".concat(swalClasses.loader));
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
333
|
* @returns {HTMLElement | null}
|
|
@@ -350,22 +350,7 @@
|
|
|
350
350
|
const getCloseButton = () => elementByClass(swalClasses.close);
|
|
351
351
|
|
|
352
352
|
// https://github.com/jkup/focusable/blob/master/index.js
|
|
353
|
-
const focusable =
|
|
354
|
-
a[href],
|
|
355
|
-
area[href],
|
|
356
|
-
input:not([disabled]),
|
|
357
|
-
select:not([disabled]),
|
|
358
|
-
textarea:not([disabled]),
|
|
359
|
-
button:not([disabled]),
|
|
360
|
-
iframe,
|
|
361
|
-
object,
|
|
362
|
-
embed,
|
|
363
|
-
[tabindex="0"],
|
|
364
|
-
[contenteditable],
|
|
365
|
-
audio[controls],
|
|
366
|
-
video[controls],
|
|
367
|
-
summary
|
|
368
|
-
`;
|
|
353
|
+
const focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n";
|
|
369
354
|
/**
|
|
370
355
|
* @returns {HTMLElement[]}
|
|
371
356
|
*/
|
|
@@ -435,7 +420,7 @@
|
|
|
435
420
|
elem.textContent = '';
|
|
436
421
|
if (html) {
|
|
437
422
|
const parser = new DOMParser();
|
|
438
|
-
const parsed = parser.parseFromString(html,
|
|
423
|
+
const parsed = parser.parseFromString(html, "text/html");
|
|
439
424
|
const head = parsed.querySelector('head');
|
|
440
425
|
head && Array.from(head.childNodes).forEach(child => {
|
|
441
426
|
elem.appendChild(child);
|
|
@@ -490,7 +475,7 @@
|
|
|
490
475
|
removeCustomClasses(elem, params);
|
|
491
476
|
if (params.customClass && params.customClass[className]) {
|
|
492
477
|
if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) {
|
|
493
|
-
warn(
|
|
478
|
+
warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(typeof params.customClass[className], "\""));
|
|
494
479
|
return;
|
|
495
480
|
}
|
|
496
481
|
addClass(elem, params.customClass[className]);
|
|
@@ -510,15 +495,15 @@
|
|
|
510
495
|
case 'select':
|
|
511
496
|
case 'textarea':
|
|
512
497
|
case 'file':
|
|
513
|
-
return popup.querySelector(
|
|
498
|
+
return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses[inputClass]));
|
|
514
499
|
case 'checkbox':
|
|
515
|
-
return popup.querySelector(
|
|
500
|
+
return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.checkbox, " input"));
|
|
516
501
|
case 'radio':
|
|
517
|
-
return popup.querySelector(
|
|
502
|
+
return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.radio, " input:checked")) || popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.radio, " input:first-child"));
|
|
518
503
|
case 'range':
|
|
519
|
-
return popup.querySelector(
|
|
504
|
+
return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.range, " input"));
|
|
520
505
|
default:
|
|
521
|
-
return popup.querySelector(
|
|
506
|
+
return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.input));
|
|
522
507
|
}
|
|
523
508
|
};
|
|
524
509
|
|
|
@@ -599,11 +584,11 @@
|
|
|
599
584
|
* @param {*} value
|
|
600
585
|
*/
|
|
601
586
|
const applyNumericalStyle = (elem, property, value) => {
|
|
602
|
-
if (value ===
|
|
587
|
+
if (value === "".concat(parseInt(value))) {
|
|
603
588
|
value = parseInt(value);
|
|
604
589
|
}
|
|
605
590
|
if (value || parseInt(value) === 0) {
|
|
606
|
-
elem.style[property] = typeof value === 'number' ?
|
|
591
|
+
elem.style[property] = typeof value === 'number' ? "".concat(value, "px") : value;
|
|
607
592
|
} else {
|
|
608
593
|
elem.style.removeProperty(property);
|
|
609
594
|
}
|
|
@@ -697,7 +682,7 @@
|
|
|
697
682
|
timerProgressBar.style.width = '100%';
|
|
698
683
|
}
|
|
699
684
|
setTimeout(() => {
|
|
700
|
-
timerProgressBar.style.transition =
|
|
685
|
+
timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear");
|
|
701
686
|
timerProgressBar.style.width = '0%';
|
|
702
687
|
}, 10);
|
|
703
688
|
}
|
|
@@ -712,7 +697,7 @@
|
|
|
712
697
|
timerProgressBar.style.width = '100%';
|
|
713
698
|
const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width);
|
|
714
699
|
const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100;
|
|
715
|
-
timerProgressBar.style.width =
|
|
700
|
+
timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%");
|
|
716
701
|
};
|
|
717
702
|
|
|
718
703
|
/**
|
|
@@ -722,40 +707,7 @@
|
|
|
722
707
|
*/
|
|
723
708
|
const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined';
|
|
724
709
|
|
|
725
|
-
const sweetHTML =
|
|
726
|
-
<div aria-labelledby="${swalClasses.title}" aria-describedby="${swalClasses['html-container']}" class="${swalClasses.popup}" tabindex="-1">
|
|
727
|
-
<button type="button" class="${swalClasses.close}"></button>
|
|
728
|
-
<ul class="${swalClasses['progress-steps']}"></ul>
|
|
729
|
-
<div class="${swalClasses.icon}"></div>
|
|
730
|
-
<img class="${swalClasses.image}" />
|
|
731
|
-
<h2 class="${swalClasses.title}" id="${swalClasses.title}"></h2>
|
|
732
|
-
<div class="${swalClasses['html-container']}" id="${swalClasses['html-container']}"></div>
|
|
733
|
-
<input class="${swalClasses.input}" id="${swalClasses.input}" />
|
|
734
|
-
<input type="file" class="${swalClasses.file}" />
|
|
735
|
-
<div class="${swalClasses.range}">
|
|
736
|
-
<input type="range" />
|
|
737
|
-
<output></output>
|
|
738
|
-
</div>
|
|
739
|
-
<select class="${swalClasses.select}" id="${swalClasses.select}"></select>
|
|
740
|
-
<div class="${swalClasses.radio}"></div>
|
|
741
|
-
<label class="${swalClasses.checkbox}">
|
|
742
|
-
<input type="checkbox" id="${swalClasses.checkbox}" />
|
|
743
|
-
<span class="${swalClasses.label}"></span>
|
|
744
|
-
</label>
|
|
745
|
-
<textarea class="${swalClasses.textarea}" id="${swalClasses.textarea}"></textarea>
|
|
746
|
-
<div class="${swalClasses['validation-message']}" id="${swalClasses['validation-message']}"></div>
|
|
747
|
-
<div class="${swalClasses.actions}">
|
|
748
|
-
<div class="${swalClasses.loader}"></div>
|
|
749
|
-
<button type="button" class="${swalClasses.confirm}"></button>
|
|
750
|
-
<button type="button" class="${swalClasses.deny}"></button>
|
|
751
|
-
<button type="button" class="${swalClasses.cancel}"></button>
|
|
752
|
-
</div>
|
|
753
|
-
<div class="${swalClasses.footer}"></div>
|
|
754
|
-
<div class="${swalClasses['timer-progress-bar-container']}">
|
|
755
|
-
<div class="${swalClasses['timer-progress-bar']}"></div>
|
|
756
|
-
</div>
|
|
757
|
-
</div>
|
|
758
|
-
`.replace(/(^|\n)\s*/g, '');
|
|
710
|
+
const sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses['html-container'], "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <button type=\"button\" class=\"").concat(swalClasses.close, "\"></button>\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, "\"></div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <div class=\"").concat(swalClasses['html-container'], "\" id=\"").concat(swalClasses['html-container'], "\"></div>\n <input class=\"").concat(swalClasses.input, "\" id=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\" id=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" id=\"").concat(swalClasses.checkbox, "\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\" id=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n <div class=\"").concat(swalClasses.actions, "\">\n <div class=\"").concat(swalClasses.loader, "\"></div>\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\"></button>\n <button type=\"button\" class=\"").concat(swalClasses.deny, "\"></button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\"></div>\n <div class=\"").concat(swalClasses['timer-progress-bar-container'], "\">\n <div class=\"").concat(swalClasses['timer-progress-bar'], "\"></div>\n </div>\n </div>\n").replace(/(^|\n)\s*/g, '');
|
|
759
711
|
|
|
760
712
|
/**
|
|
761
713
|
* @returns {boolean}
|
|
@@ -777,12 +729,12 @@
|
|
|
777
729
|
const input = getDirectChildByClass(popup, swalClasses.input);
|
|
778
730
|
const file = getDirectChildByClass(popup, swalClasses.file);
|
|
779
731
|
/** @type {HTMLInputElement} */
|
|
780
|
-
const range = popup.querySelector(
|
|
732
|
+
const range = popup.querySelector(".".concat(swalClasses.range, " input"));
|
|
781
733
|
/** @type {HTMLOutputElement} */
|
|
782
|
-
const rangeOutput = popup.querySelector(
|
|
734
|
+
const rangeOutput = popup.querySelector(".".concat(swalClasses.range, " output"));
|
|
783
735
|
const select = getDirectChildByClass(popup, swalClasses.select);
|
|
784
736
|
/** @type {HTMLInputElement} */
|
|
785
|
-
const checkbox = popup.querySelector(
|
|
737
|
+
const checkbox = popup.querySelector(".".concat(swalClasses.checkbox, " input"));
|
|
786
738
|
const textarea = getDirectChildByClass(popup, swalClasses.textarea);
|
|
787
739
|
input.oninput = resetValidationMessage$1;
|
|
788
740
|
file.onchange = resetValidationMessage$1;
|
|
@@ -1019,13 +971,13 @@
|
|
|
1019
971
|
*/
|
|
1020
972
|
function renderButton(button, buttonType, params) {
|
|
1021
973
|
const buttonName = /** @type {'Confirm' | 'Deny' | 'Cancel'} */capitalizeFirstLetter(buttonType);
|
|
1022
|
-
toggle(button, params[
|
|
1023
|
-
setInnerHtml(button, params[
|
|
1024
|
-
button.setAttribute('aria-label', params[
|
|
974
|
+
toggle(button, params["show".concat(buttonName, "Button")], 'inline-block');
|
|
975
|
+
setInnerHtml(button, params["".concat(buttonType, "ButtonText")] || ''); // Set caption text
|
|
976
|
+
button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")] || ''); // ARIA label
|
|
1025
977
|
|
|
1026
978
|
// Add buttons custom classes
|
|
1027
979
|
button.className = swalClasses[buttonType];
|
|
1028
|
-
applyCustomClass(button, params,
|
|
980
|
+
applyCustomClass(button, params, "".concat(buttonType, "Button"));
|
|
1029
981
|
}
|
|
1030
982
|
|
|
1031
983
|
/**
|
|
@@ -1098,7 +1050,7 @@
|
|
|
1098
1050
|
if (!grow) {
|
|
1099
1051
|
return;
|
|
1100
1052
|
}
|
|
1101
|
-
addClass(container, swalClasses[
|
|
1053
|
+
addClass(container, swalClasses["grow-".concat(grow)]);
|
|
1102
1054
|
}
|
|
1103
1055
|
|
|
1104
1056
|
/// <reference path="../../../../sweetalert2.d.ts"/>
|
|
@@ -1150,7 +1102,7 @@
|
|
|
1150
1102
|
return;
|
|
1151
1103
|
}
|
|
1152
1104
|
if (!renderInputType[params.input]) {
|
|
1153
|
-
error(
|
|
1105
|
+
error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\""));
|
|
1154
1106
|
return;
|
|
1155
1107
|
}
|
|
1156
1108
|
const inputContainer = getInputContainer(params.input);
|
|
@@ -1245,9 +1197,9 @@
|
|
|
1245
1197
|
*/
|
|
1246
1198
|
const checkAndSetInputValue = (input, inputValue) => {
|
|
1247
1199
|
if (['string', 'number'].includes(typeof inputValue)) {
|
|
1248
|
-
input.value =
|
|
1200
|
+
input.value = "".concat(inputValue);
|
|
1249
1201
|
} else if (!isPromise(inputValue)) {
|
|
1250
|
-
warn(
|
|
1202
|
+
warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(typeof inputValue, "\""));
|
|
1251
1203
|
}
|
|
1252
1204
|
};
|
|
1253
1205
|
|
|
@@ -1363,7 +1315,7 @@
|
|
|
1363
1315
|
}
|
|
1364
1316
|
const textareaWidth = textarea.offsetWidth + getMargin(textarea);
|
|
1365
1317
|
if (textareaWidth > initialPopupWidth) {
|
|
1366
|
-
getPopup().style.width =
|
|
1318
|
+
getPopup().style.width = "".concat(textareaWidth, "px");
|
|
1367
1319
|
} else {
|
|
1368
1320
|
applyNumericalStyle(getPopup(), 'width', params.width);
|
|
1369
1321
|
}
|
|
@@ -1448,7 +1400,7 @@
|
|
|
1448
1400
|
return;
|
|
1449
1401
|
}
|
|
1450
1402
|
if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) {
|
|
1451
|
-
error(
|
|
1403
|
+
error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\""));
|
|
1452
1404
|
hide(icon);
|
|
1453
1405
|
return;
|
|
1454
1406
|
}
|
|
@@ -1497,18 +1449,8 @@
|
|
|
1497
1449
|
successIconParts[i].style.backgroundColor = popupBackgroundColor;
|
|
1498
1450
|
}
|
|
1499
1451
|
};
|
|
1500
|
-
const successIconHtml =
|
|
1501
|
-
<
|
|
1502
|
-
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
1503
|
-
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
1504
|
-
<div class="swal2-success-circular-line-right"></div>
|
|
1505
|
-
`;
|
|
1506
|
-
const errorIconHtml = `
|
|
1507
|
-
<span class="swal2-x-mark">
|
|
1508
|
-
<span class="swal2-x-mark-line-left"></span>
|
|
1509
|
-
<span class="swal2-x-mark-line-right"></span>
|
|
1510
|
-
</span>
|
|
1511
|
-
`;
|
|
1452
|
+
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";
|
|
1453
|
+
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";
|
|
1512
1454
|
|
|
1513
1455
|
/**
|
|
1514
1456
|
* @param {HTMLElement} icon
|
|
@@ -1560,7 +1502,7 @@
|
|
|
1560
1502
|
* @param {string} content
|
|
1561
1503
|
* @returns {string}
|
|
1562
1504
|
*/
|
|
1563
|
-
const iconContent = content =>
|
|
1505
|
+
const iconContent = content => "<div class=\"".concat(swalClasses['icon-content'], "\">").concat(content, "</div>");
|
|
1564
1506
|
|
|
1565
1507
|
/**
|
|
1566
1508
|
* @param {SweetAlert} instance
|
|
@@ -1637,7 +1579,7 @@
|
|
|
1637
1579
|
const addClasses$1 = (popup, params) => {
|
|
1638
1580
|
const showClass = params.showClass || {};
|
|
1639
1581
|
// Default Class + showClass when updating Swal.update({})
|
|
1640
|
-
popup.className =
|
|
1582
|
+
popup.className = "".concat(swalClasses.popup, " ").concat(isVisible$1(popup) ? showClass.popup : '');
|
|
1641
1583
|
if (params.toast) {
|
|
1642
1584
|
addClass([document.documentElement, document.body], swalClasses['toast-shown']);
|
|
1643
1585
|
addClass(popup, swalClasses.toast);
|
|
@@ -1653,7 +1595,7 @@
|
|
|
1653
1595
|
|
|
1654
1596
|
// Icon class (#1842)
|
|
1655
1597
|
if (params.icon) {
|
|
1656
|
-
addClass(popup, swalClasses[
|
|
1598
|
+
addClass(popup, swalClasses["icon-".concat(params.icon)]);
|
|
1657
1599
|
}
|
|
1658
1600
|
};
|
|
1659
1601
|
|
|
@@ -1768,17 +1710,26 @@
|
|
|
1768
1710
|
/*
|
|
1769
1711
|
* Global function to click 'Confirm' button
|
|
1770
1712
|
*/
|
|
1771
|
-
const clickConfirm = () =>
|
|
1713
|
+
const clickConfirm = () => {
|
|
1714
|
+
var _dom$getConfirmButton;
|
|
1715
|
+
return (_dom$getConfirmButton = getConfirmButton()) === null || _dom$getConfirmButton === void 0 ? void 0 : _dom$getConfirmButton.click();
|
|
1716
|
+
};
|
|
1772
1717
|
|
|
1773
1718
|
/*
|
|
1774
1719
|
* Global function to click 'Deny' button
|
|
1775
1720
|
*/
|
|
1776
|
-
const clickDeny = () =>
|
|
1721
|
+
const clickDeny = () => {
|
|
1722
|
+
var _dom$getDenyButton;
|
|
1723
|
+
return (_dom$getDenyButton = getDenyButton()) === null || _dom$getDenyButton === void 0 ? void 0 : _dom$getDenyButton.click();
|
|
1724
|
+
};
|
|
1777
1725
|
|
|
1778
1726
|
/*
|
|
1779
1727
|
* Global function to click 'Cancel' button
|
|
1780
1728
|
*/
|
|
1781
|
-
const clickCancel = () =>
|
|
1729
|
+
const clickCancel = () => {
|
|
1730
|
+
var _dom$getCancelButton;
|
|
1731
|
+
return (_dom$getCancelButton = getCancelButton()) === null || _dom$getCancelButton === void 0 ? void 0 : _dom$getCancelButton.click();
|
|
1732
|
+
};
|
|
1782
1733
|
|
|
1783
1734
|
/** @typedef {'cancel' | 'backdrop' | 'close' | 'esc' | 'timer'} DismissReason */
|
|
1784
1735
|
|
|
@@ -2033,7 +1984,7 @@
|
|
|
2033
1984
|
const iOSfix = () => {
|
|
2034
1985
|
if (isSafariOrIOS && !hasClass(document.body, swalClasses.iosfix)) {
|
|
2035
1986
|
const offset = document.body.scrollTop;
|
|
2036
|
-
document.body.style.top =
|
|
1987
|
+
document.body.style.top = "".concat(offset * -1, "px");
|
|
2037
1988
|
addClass(document.body, swalClasses.iosfix);
|
|
2038
1989
|
lockBodyScroll();
|
|
2039
1990
|
}
|
|
@@ -2144,20 +2095,22 @@
|
|
|
2144
2095
|
*/
|
|
2145
2096
|
let previousBodyPadding = null;
|
|
2146
2097
|
const fixScrollbar = () => {
|
|
2098
|
+
const bodyStyles = window.getComputedStyle(document.body);
|
|
2147
2099
|
// for queues, do not do this more than once
|
|
2148
2100
|
if (previousBodyPadding !== null) {
|
|
2149
2101
|
return;
|
|
2150
2102
|
}
|
|
2151
2103
|
// if the body has overflow
|
|
2152
|
-
if (document.body.scrollHeight > window.innerHeight
|
|
2104
|
+
if (document.body.scrollHeight > window.innerHeight || bodyStyles.overflowY === 'scroll' // https://github.com/sweetalert2/sweetalert2/issues/2663
|
|
2105
|
+
) {
|
|
2153
2106
|
// add padding so the content doesn't shift after removal of scrollbar
|
|
2154
|
-
previousBodyPadding = parseInt(
|
|
2155
|
-
document.body.style.paddingRight =
|
|
2107
|
+
previousBodyPadding = parseInt(bodyStyles.getPropertyValue('padding-right'));
|
|
2108
|
+
document.body.style.paddingRight = "".concat(previousBodyPadding + measureScrollbar(), "px");
|
|
2156
2109
|
}
|
|
2157
2110
|
};
|
|
2158
2111
|
const undoScrollbar = () => {
|
|
2159
2112
|
if (previousBodyPadding !== null) {
|
|
2160
|
-
document.body.style.paddingRight =
|
|
2113
|
+
document.body.style.paddingRight = "".concat(previousBodyPadding, "px");
|
|
2161
2114
|
previousBodyPadding = null;
|
|
2162
2115
|
}
|
|
2163
2116
|
};
|
|
@@ -2474,7 +2427,7 @@
|
|
|
2474
2427
|
} else if (typeof params.inputOptions === 'object') {
|
|
2475
2428
|
processInputOptions(params.inputOptions);
|
|
2476
2429
|
} else {
|
|
2477
|
-
error(
|
|
2430
|
+
error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof params.inputOptions));
|
|
2478
2431
|
}
|
|
2479
2432
|
};
|
|
2480
2433
|
|
|
@@ -2489,12 +2442,12 @@
|
|
|
2489
2442
|
}
|
|
2490
2443
|
hide(input);
|
|
2491
2444
|
asPromise(params.inputValue).then(inputValue => {
|
|
2492
|
-
input.value = params.input === 'number' ?
|
|
2445
|
+
input.value = params.input === 'number' ? "".concat(parseFloat(inputValue) || 0) : "".concat(inputValue);
|
|
2493
2446
|
show(input);
|
|
2494
2447
|
input.focus();
|
|
2495
2448
|
instance.hideLoading();
|
|
2496
2449
|
}).catch(err => {
|
|
2497
|
-
error(
|
|
2450
|
+
error("Error in inputValue promise: ".concat(err));
|
|
2498
2451
|
input.value = '';
|
|
2499
2452
|
show(input);
|
|
2500
2453
|
input.focus();
|
|
@@ -2663,7 +2616,7 @@
|
|
|
2663
2616
|
const handleConfirmOrDenyWithInput = (instance, type) => {
|
|
2664
2617
|
const innerParams = privateProps.innerParams.get(instance);
|
|
2665
2618
|
if (!innerParams.input) {
|
|
2666
|
-
error(
|
|
2619
|
+
error("The \"input\" parameter is needed to be set when using returnInputValueOn".concat(capitalizeFirstLetter(type)));
|
|
2667
2620
|
return;
|
|
2668
2621
|
}
|
|
2669
2622
|
const input = instance.getInput();
|
|
@@ -2851,7 +2804,7 @@
|
|
|
2851
2804
|
}
|
|
2852
2805
|
if (input.type === 'radio') {
|
|
2853
2806
|
/** @type {NodeListOf<HTMLInputElement>} */
|
|
2854
|
-
const radios = popup.querySelectorAll(
|
|
2807
|
+
const radios = popup.querySelectorAll("[name=\"".concat(swalClasses.radio, "\"]"));
|
|
2855
2808
|
for (let i = 0; i < radios.length; i++) {
|
|
2856
2809
|
radios[i].disabled = disabled;
|
|
2857
2810
|
}
|
|
@@ -3062,7 +3015,7 @@
|
|
|
3062
3015
|
*/
|
|
3063
3016
|
const checkIfParamIsValid = param => {
|
|
3064
3017
|
if (!isValidParameter(param)) {
|
|
3065
|
-
warn(
|
|
3018
|
+
warn("Unknown parameter \"".concat(param, "\""));
|
|
3066
3019
|
}
|
|
3067
3020
|
};
|
|
3068
3021
|
|
|
@@ -3071,7 +3024,7 @@
|
|
|
3071
3024
|
*/
|
|
3072
3025
|
const checkIfToastParamIsValid = param => {
|
|
3073
3026
|
if (toastIncompatibleParams.includes(param)) {
|
|
3074
|
-
warn(
|
|
3027
|
+
warn("The parameter \"".concat(param, "\" is incompatible with toasts"));
|
|
3075
3028
|
}
|
|
3076
3029
|
};
|
|
3077
3030
|
|
|
@@ -3112,7 +3065,7 @@
|
|
|
3112
3065
|
const popup = getPopup();
|
|
3113
3066
|
const innerParams = privateProps.innerParams.get(this);
|
|
3114
3067
|
if (!popup || hasClass(popup, innerParams.hideClass.popup)) {
|
|
3115
|
-
warn(
|
|
3068
|
+
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.");
|
|
3116
3069
|
return;
|
|
3117
3070
|
}
|
|
3118
3071
|
const validUpdatableParams = filterValidParams(params);
|
|
@@ -3138,7 +3091,7 @@
|
|
|
3138
3091
|
if (isUpdatableParameter(param)) {
|
|
3139
3092
|
validUpdatableParams[param] = params[param];
|
|
3140
3093
|
} else {
|
|
3141
|
-
warn(
|
|
3094
|
+
warn("Invalid parameter to update: ".concat(param));
|
|
3142
3095
|
}
|
|
3143
3096
|
});
|
|
3144
3097
|
return validUpdatableParams;
|
|
@@ -3324,7 +3277,7 @@
|
|
|
3324
3277
|
if (typeof arg === 'string' || isElement(arg)) {
|
|
3325
3278
|
params[name] = arg;
|
|
3326
3279
|
} else if (arg !== undefined) {
|
|
3327
|
-
error(
|
|
3280
|
+
error("Unexpected type of ".concat(name, "! Expected \"string\" or \"Element\", got ").concat(typeof arg));
|
|
3328
3281
|
}
|
|
3329
3282
|
});
|
|
3330
3283
|
}
|
|
@@ -3643,7 +3596,7 @@
|
|
|
3643
3596
|
swalFunctions.forEach(param => {
|
|
3644
3597
|
const paramName = param.getAttribute('name');
|
|
3645
3598
|
const value = param.getAttribute('value');
|
|
3646
|
-
result[paramName] = new Function(
|
|
3599
|
+
result[paramName] = new Function("return ".concat(value))();
|
|
3647
3600
|
});
|
|
3648
3601
|
return result;
|
|
3649
3602
|
};
|
|
@@ -3659,13 +3612,13 @@
|
|
|
3659
3612
|
swalButtons.forEach(button => {
|
|
3660
3613
|
showWarningsForAttributes(button, ['type', 'color', 'aria-label']);
|
|
3661
3614
|
const type = button.getAttribute('type');
|
|
3662
|
-
result[
|
|
3663
|
-
result[
|
|
3615
|
+
result["".concat(type, "ButtonText")] = button.innerHTML;
|
|
3616
|
+
result["show".concat(capitalizeFirstLetter(type), "Button")] = true;
|
|
3664
3617
|
if (button.hasAttribute('color')) {
|
|
3665
|
-
result[
|
|
3618
|
+
result["".concat(type, "ButtonColor")] = button.getAttribute('color');
|
|
3666
3619
|
}
|
|
3667
3620
|
if (button.hasAttribute('aria-label')) {
|
|
3668
|
-
result[
|
|
3621
|
+
result["".concat(type, "ButtonAriaLabel")] = button.getAttribute('aria-label');
|
|
3669
3622
|
}
|
|
3670
3623
|
});
|
|
3671
3624
|
return result;
|
|
@@ -3784,7 +3737,7 @@
|
|
|
3784
3737
|
Array.from(templateContent.children).forEach(el => {
|
|
3785
3738
|
const tagName = el.tagName.toLowerCase();
|
|
3786
3739
|
if (!allowedElements.includes(tagName)) {
|
|
3787
|
-
warn(
|
|
3740
|
+
warn("Unrecognized element <".concat(tagName, ">"));
|
|
3788
3741
|
}
|
|
3789
3742
|
});
|
|
3790
3743
|
};
|
|
@@ -3796,7 +3749,7 @@
|
|
|
3796
3749
|
const showWarningsForAttributes = (el, allowedAttributes) => {
|
|
3797
3750
|
Array.from(el.attributes).forEach(attribute => {
|
|
3798
3751
|
if (allowedAttributes.indexOf(attribute.name) === -1) {
|
|
3799
|
-
warn([
|
|
3752
|
+
warn(["Unrecognized attribute \"".concat(attribute.name, "\" on <").concat(el.tagName.toLowerCase(), ">."), "".concat(allowedAttributes.length ? "Allowed attributes are: ".concat(allowedAttributes.join(', ')) : 'To set the value, use HTML within the element.')]);
|
|
3800
3753
|
}
|
|
3801
3754
|
});
|
|
3802
3755
|
};
|
|
@@ -4190,7 +4143,7 @@
|
|
|
4190
4143
|
const now = new Date();
|
|
4191
4144
|
const initiationDate = localStorage.getItem('swal-initiation');
|
|
4192
4145
|
if (!initiationDate) {
|
|
4193
|
-
localStorage.setItem('swal-initiation',
|
|
4146
|
+
localStorage.setItem('swal-initiation', "".concat(now));
|
|
4194
4147
|
} else if ((now.getTime() - Date.parse(initiationDate)) / (1000 * 60 * 60 * 24) > 3) {
|
|
4195
4148
|
setTimeout(() => {
|
|
4196
4149
|
document.body.style.pointerEvents = 'none';
|
|
@@ -4242,7 +4195,7 @@
|
|
|
4242
4195
|
};
|
|
4243
4196
|
});
|
|
4244
4197
|
SweetAlert.DismissReason = DismissReason;
|
|
4245
|
-
SweetAlert.version = '11.7.
|
|
4198
|
+
SweetAlert.version = '11.7.25';
|
|
4246
4199
|
|
|
4247
4200
|
const Swal = SweetAlert;
|
|
4248
4201
|
// @ts-ignore
|