sweetalert2 11.12.3 → 11.13.0

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 CHANGED
@@ -25,10 +25,6 @@ For all questions related to sponsorship please get in touch with me via email s
25
25
  <td align="center"><a href="https://roboflow.com/"><img src="https://sweetalert2.github.io/images/sponsors/roboflow.png" width="80"><br>Roboflow</a>
26
26
  <td align="center"><a href="https://www.zezelife.com/"><img src="https://sweetalert2.github.io/images/sponsors/zezelife.png" width="80"><br>ZezeLife</a>
27
27
  <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>
28
- </tr>
29
- </table>
30
- <table>
31
- <tr>
32
28
  <td align="center"><a href="https://celltrackingapps.com/"><img src="https://sweetalert2.github.io/images/sponsors/celltrackingapps.png" width="80"><br>Phone Tracking Apps</a></td>
33
29
  <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>
34
30
  </tr>
@@ -59,15 +55,6 @@ For all questions related to sponsorship please get in touch with me via email s
59
55
  <tr>
60
56
  <td align="center"><a href="https://nakedoll.com/"><img src="https://sweetalert2.github.io/images/sponsors/nakedoll.png" width="80"><br>NakeDoll</a></td>
61
57
  <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>
62
- <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>
63
- <td align="center"><a href="https://sexdollsmarket.com/"><img src="https://sweetalert2.github.io/images/sponsors/sexdollsmarket.png" width="80"><br>Sex Doll Torso</a></td>
64
- <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>
65
- </tr>
66
- </table>
67
- <table>
68
- <tr>
69
- <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>
70
- <td align="center"><a href="https://bululu.shop/"><img src="https://sweetalert2.github.io/images/sponsors/bululu.png" width="80"><br>BULULU</a></td>
71
58
  <td align="center"><a href="https://vsdoll.net/"><img src="https://sweetalert2.github.io/images/sponsors/vsdoll.png" width="80"><br>VSDoll</a></td>
72
59
  <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>
73
60
  <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>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sweetalert2 v11.12.3
2
+ * sweetalert2 v11.13.0
3
3
  * Released under the MIT License.
4
4
  */
5
5
  (function (global, factory) {
@@ -66,7 +66,7 @@
66
66
  function _createForOfIteratorHelper(r, e) {
67
67
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
68
68
  if (!t) {
69
- if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
69
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
70
70
  t && (r = t);
71
71
  var n = 0,
72
72
  F = function () {};
@@ -195,6 +195,12 @@
195
195
  for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
196
196
  return t;
197
197
  }
198
+ function _superPropGet(t, e, o, r) {
199
+ var p = _get(_getPrototypeOf(t.prototype ), e, o);
200
+ return "function" == typeof p ? function (t) {
201
+ return p.apply(o, t);
202
+ } : p;
203
+ }
198
204
  function _toConsumableArray(r) {
199
205
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
200
206
  }
@@ -202,7 +208,7 @@
202
208
  if ("object" != typeof t || !t) return t;
203
209
  var e = t[Symbol.toPrimitive];
204
210
  if (void 0 !== e) {
205
- var i = e.call(t, r );
211
+ var i = e.call(t, r);
206
212
  if ("object" != typeof i) return i;
207
213
  throw new TypeError("@@toPrimitive must return a primitive value.");
208
214
  }
@@ -607,17 +613,21 @@
607
613
  var parser = new DOMParser();
608
614
  var parsed = parser.parseFromString(html, "text/html");
609
615
  var head = parsed.querySelector('head');
610
- head && Array.from(head.childNodes).forEach(function (child) {
611
- elem.appendChild(child);
612
- });
613
- var body = parsed.querySelector('body');
614
- body && Array.from(body.childNodes).forEach(function (child) {
615
- if (child instanceof HTMLVideoElement || child instanceof HTMLAudioElement) {
616
- elem.appendChild(child.cloneNode(true)); // https://github.com/sweetalert2/sweetalert2/issues/2507
617
- } else {
616
+ if (head) {
617
+ Array.from(head.childNodes).forEach(function (child) {
618
618
  elem.appendChild(child);
619
- }
620
- });
619
+ });
620
+ }
621
+ var body = parsed.querySelector('body');
622
+ if (body) {
623
+ Array.from(body.childNodes).forEach(function (child) {
624
+ if (child instanceof HTMLVideoElement || child instanceof HTMLAudioElement) {
625
+ elem.appendChild(child.cloneNode(true)); // https://github.com/sweetalert2/sweetalert2/issues/2507
626
+ } else {
627
+ elem.appendChild(child);
628
+ }
629
+ });
630
+ }
621
631
  }
622
632
  };
623
633
 
@@ -661,7 +671,7 @@
661
671
  if (!params.customClass) {
662
672
  return;
663
673
  }
664
- var customClass = params.customClass[( /** @type {keyof SweetAlertCustomClass} */className)];
674
+ var customClass = params.customClass[(/** @type {keyof SweetAlertCustomClass} */className)];
665
675
  if (!customClass) {
666
676
  return;
667
677
  }
@@ -727,10 +737,18 @@
727
737
  classList.forEach(function (className) {
728
738
  if (Array.isArray(target)) {
729
739
  target.forEach(function (elem) {
730
- condition ? elem.classList.add(className) : elem.classList.remove(className);
740
+ if (condition) {
741
+ elem.classList.add(className);
742
+ } else {
743
+ elem.classList.remove(className);
744
+ }
731
745
  });
732
746
  } else {
733
- condition ? target.classList.add(className) : target.classList.remove(className);
747
+ if (condition) {
748
+ target.classList.add(className);
749
+ } else {
750
+ target.classList.remove(className);
751
+ }
734
752
  }
735
753
  });
736
754
  };
@@ -790,14 +808,20 @@
790
808
  */
791
809
  var show = function show(elem) {
792
810
  var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex';
793
- elem && (elem.style.display = display);
811
+ if (!elem) {
812
+ return;
813
+ }
814
+ elem.style.display = display;
794
815
  };
795
816
 
796
817
  /**
797
818
  * @param {HTMLElement | null} elem
798
819
  */
799
820
  var hide = function hide(elem) {
800
- elem && (elem.style.display = 'none');
821
+ if (!elem) {
822
+ return;
823
+ }
824
+ elem.style.display = 'none';
801
825
  };
802
826
 
803
827
  /**
@@ -838,7 +862,11 @@
838
862
  */
839
863
  var toggle = function toggle(elem, condition) {
840
864
  var display = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'flex';
841
- condition ? show(elem, display) : hide(elem);
865
+ if (condition) {
866
+ show(elem, display);
867
+ } else {
868
+ hide(elem);
869
+ }
842
870
  };
843
871
 
844
872
  /**
@@ -1064,7 +1092,7 @@
1064
1092
  var handleJqueryElem = function handleJqueryElem(target, elem) {
1065
1093
  target.textContent = '';
1066
1094
  if (0 in elem) {
1067
- for (var i = 0; (i in elem); i++) {
1095
+ for (var i = 0; i in elem; i++) {
1068
1096
  target.appendChild(elem[i].cloneNode(true));
1069
1097
  }
1070
1098
  } else {
@@ -1431,7 +1459,7 @@
1431
1459
  if (!popup) {
1432
1460
  return;
1433
1461
  }
1434
- return getDirectChildByClass(popup, swalClasses[( /** @type {SwalClass} */inputType)] || swalClasses.input);
1462
+ return getDirectChildByClass(popup, swalClasses[(/** @type {SwalClass} */inputType)] || swalClasses.input);
1435
1463
  };
1436
1464
 
1437
1465
  /**
@@ -1803,7 +1831,9 @@
1803
1831
  applyNumericalStyle(container, 'width', params.width);
1804
1832
  popup.style.width = '100%';
1805
1833
  var loader = getLoader();
1806
- loader && popup.insertBefore(loader, getIcon());
1834
+ if (loader) {
1835
+ popup.insertBefore(loader, getIcon());
1836
+ }
1807
1837
  } else {
1808
1838
  applyNumericalStyle(popup, 'width', params.width);
1809
1839
  }
@@ -2568,7 +2598,7 @@
2568
2598
  var showLoading = function showLoading(buttonToReplace) {
2569
2599
  var popup = getPopup();
2570
2600
  if (!popup) {
2571
- new Swal(); // eslint-disable-line no-new
2601
+ new Swal();
2572
2602
  }
2573
2603
  popup = getPopup();
2574
2604
  if (!popup) {
@@ -2683,9 +2713,9 @@
2683
2713
  */
2684
2714
  var processInputOptions = function processInputOptions(inputOptions) {
2685
2715
  if (params.input === 'select') {
2686
- populateSelectOptions(popup, formatInputOptions(inputOptions), params);
2716
+ populateSelectOptions(popup, _formatInputOptions(inputOptions), params);
2687
2717
  } else if (params.input === 'radio') {
2688
- populateRadioOptions(popup, formatInputOptions(inputOptions), params);
2718
+ populateRadioOptions(popup, _formatInputOptions(inputOptions), params);
2689
2719
  }
2690
2720
  };
2691
2721
  if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) {
@@ -2812,7 +2842,7 @@
2812
2842
  * @typedef {string[]} InputOptionFlattened
2813
2843
  * @returns {InputOptionFlattened[]}
2814
2844
  */
2815
- var formatInputOptions = function formatInputOptions(inputOptions) {
2845
+ var _formatInputOptions = function formatInputOptions(inputOptions) {
2816
2846
  /** @type {InputOptionFlattened[]} */
2817
2847
  var result = [];
2818
2848
  if (inputOptions instanceof Map) {
@@ -2820,7 +2850,7 @@
2820
2850
  var valueFormatted = value;
2821
2851
  if (_typeof(valueFormatted) === 'object') {
2822
2852
  // case of <optgroup>
2823
- valueFormatted = formatInputOptions(valueFormatted);
2853
+ valueFormatted = _formatInputOptions(valueFormatted);
2824
2854
  }
2825
2855
  result.push([key, valueFormatted]);
2826
2856
  });
@@ -2829,7 +2859,7 @@
2829
2859
  var valueFormatted = inputOptions[key];
2830
2860
  if (_typeof(valueFormatted) === 'object') {
2831
2861
  // case of <optgroup>
2832
- valueFormatted = formatInputOptions(valueFormatted);
2862
+ valueFormatted = _formatInputOptions(valueFormatted);
2833
2863
  }
2834
2864
  result.push([key, valueFormatted]);
2835
2865
  });
@@ -3611,11 +3641,10 @@
3611
3641
  * @returns {Promise<SweetAlertResult>}
3612
3642
  */
3613
3643
  function fire() {
3614
- var Swal = this; // eslint-disable-line @typescript-eslint/no-this-alias
3615
3644
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3616
3645
  args[_key] = arguments[_key];
3617
3646
  }
3618
- return _construct(Swal, args);
3647
+ return _construct(this, args);
3619
3648
  }
3620
3649
 
3621
3650
  /**
@@ -3647,7 +3676,7 @@
3647
3676
  return _createClass(MixinSwal, [{
3648
3677
  key: "_main",
3649
3678
  value: function _main(params, priorityMixinParams) {
3650
- return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, params, Object.assign({}, mixinParams, priorityMixinParams));
3679
+ return _superPropGet(MixinSwal, "_main", this)([params, Object.assign({}, mixinParams, priorityMixinParams)]);
3651
3680
  }
3652
3681
  }]);
3653
3682
  }(this); // @ts-ignore
@@ -3889,7 +3918,7 @@
3889
3918
  * @returns {SweetAlertOptions}
3890
3919
  */
3891
3920
  var getTemplateParams = function getTemplateParams(params) {
3892
- var template = typeof params.template === 'string' ? ( /** @type {HTMLTemplateElement} */document.querySelector(params.template)) : params.template;
3921
+ var template = typeof params.template === 'string' ? (/** @type {HTMLTemplateElement} */document.querySelector(params.template)) : params.template;
3893
3922
  if (!template) {
3894
3923
  return {};
3895
3924
  }
@@ -4144,13 +4173,13 @@
4144
4173
  /**
4145
4174
  * @param {AnimationEvent} event
4146
4175
  */
4147
- var swalOpenAnimationFinished = function swalOpenAnimationFinished(event) {
4176
+ var _swalOpenAnimationFinished = function swalOpenAnimationFinished(event) {
4148
4177
  var popup = getPopup();
4149
4178
  if (event.target !== popup || !animationEndEvent) {
4150
4179
  return;
4151
4180
  }
4152
4181
  var container = getContainer();
4153
- popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished);
4182
+ popup.removeEventListener(animationEndEvent, _swalOpenAnimationFinished);
4154
4183
  container.style.overflowY = 'auto';
4155
4184
  };
4156
4185
 
@@ -4161,7 +4190,7 @@
4161
4190
  var setScrollingVisibility = function setScrollingVisibility(container, popup) {
4162
4191
  if (animationEndEvent && hasCssAnimation(popup)) {
4163
4192
  container.style.overflowY = 'hidden';
4164
- popup.addEventListener(animationEndEvent, swalOpenAnimationFinished);
4193
+ popup.addEventListener(animationEndEvent, _swalOpenAnimationFinished);
4165
4194
  } else {
4166
4195
  container.style.overflowY = 'auto';
4167
4196
  }
@@ -4614,7 +4643,7 @@
4614
4643
  };
4615
4644
  });
4616
4645
  SweetAlert.DismissReason = DismissReason;
4617
- SweetAlert.version = '11.12.3';
4646
+ SweetAlert.version = '11.13.0';
4618
4647
 
4619
4648
  var Swal = SweetAlert;
4620
4649
  // @ts-ignore