bootstrap 5.0.0 → 5.0.1

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +8 -8
  4. data/assets/javascripts/bootstrap.js +329 -377
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +13 -73
  7. data/assets/javascripts/bootstrap/base-component.js +115 -10
  8. data/assets/javascripts/bootstrap/button.js +11 -17
  9. data/assets/javascripts/bootstrap/carousel.js +35 -85
  10. data/assets/javascripts/bootstrap/collapse.js +34 -82
  11. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +2 -9
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
  15. data/assets/javascripts/bootstrap/dropdown.js +41 -38
  16. data/assets/javascripts/bootstrap/modal.js +31 -43
  17. data/assets/javascripts/bootstrap/offcanvas.js +25 -25
  18. data/assets/javascripts/bootstrap/popover.js +11 -25
  19. data/assets/javascripts/bootstrap/scrollspy.js +26 -21
  20. data/assets/javascripts/bootstrap/tab.js +14 -68
  21. data/assets/javascripts/bootstrap/toast.js +69 -77
  22. data/assets/javascripts/bootstrap/tooltip.js +71 -135
  23. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  25. data/assets/stylesheets/_bootstrap.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_list-group.scss +5 -5
  27. data/assets/stylesheets/bootstrap/_modal.scss +2 -11
  28. data/assets/stylesheets/bootstrap/_tables.scss +1 -0
  29. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  30. data/assets/stylesheets/bootstrap/forms/_form-control.scss +5 -5
  31. data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -1
  32. data/lib/bootstrap/version.rb +2 -2
  33. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab3cae7213a21110421a1bff463a4f8bccfdc085ce03953a9add6330fcc52f6f
4
- data.tar.gz: f5e9f214138024c8adafcc459b934119657f9a0989b83c43dacf783ddd01a8a6
3
+ metadata.gz: e00e53f08ddcb226fbc4ba5d5d0803e9040879a2d260d3597304550b6a9bff0b
4
+ data.tar.gz: 0f239d578988e6faa40b51476f065b64f2b6ba84f291f2a71209aa1609bc6d91
5
5
  SHA512:
6
- metadata.gz: a54dd7911c5a617cce35d57e7e8543859cd891e82fa919a85e74a7242337c6258175c7cacf09957b016d24a77957d85731a9373e948a9cfd1e85311513b05184
7
- data.tar.gz: 63aac9f119c570a9826c14f6e1fefdf1c472bdd3befeac525c1d86c75a01e73e36c85bb238916ba09968b12541472c6f8727f3ca701366c7a72c161a32ff8c18
6
+ metadata.gz: 40448c17c92f5767dc6791b559a129d2842f74ad667d8cb21402058383bad293dbd37cd0173fae40ecf1b8f8620ff3d37f932631056bcdae1ac7b99275d6a2b8
7
+ data.tar.gz: 79518238b77d51ece52c474e17aeba9a1dc6af2567c376e22e1f45fb0b43e95966b6d184837aceb5dd33b7825fcd514e5f6ae9f60537262707a0464974599f8d
data/README.md CHANGED
@@ -20,7 +20,7 @@ Please see the appropriate guide for your environment of choice:
20
20
  Add `bootstrap` to your Gemfile:
21
21
 
22
22
  ```ruby
23
- gem 'bootstrap', '~> 5.0.0'
23
+ gem 'bootstrap', '~> 5.0.1'
24
24
  ```
25
25
 
26
26
  Ensure that `sprockets-rails` is at least v2.3.2.
@@ -2,18 +2,18 @@
2
2
  //= require ./bootstrap/dom/data
3
3
  //= require ./bootstrap/dom/event-handler
4
4
  //= require ./bootstrap/base-component
5
- //= require ./bootstrap/alert
6
- //= require ./bootstrap/button
7
5
  //= require ./bootstrap/dom/manipulator
8
6
  //= require ./bootstrap/dom/selector-engine
9
- //= require ./bootstrap/carousel
10
- //= require ./bootstrap/collapse
11
7
  //= require ./bootstrap/dropdown
12
- //= require ./bootstrap/modal
13
- //= require ./bootstrap/offcanvas
8
+ //= require ./bootstrap/scrollspy
9
+ //= require ./bootstrap/alert
10
+ //= require ./bootstrap/collapse
11
+ //= require ./bootstrap/toast
14
12
  //= require ./bootstrap/tooltip
13
+ //= require ./bootstrap/offcanvas
15
14
  //= require ./bootstrap/popover
16
- //= require ./bootstrap/scrollspy
15
+ //= require ./bootstrap/button
16
+ //= require ./bootstrap/modal
17
17
  //= require ./bootstrap/tab
18
- //= require ./bootstrap/toast
18
+ //= require ./bootstrap/carousel
19
19
  //= require ./bootstrap-global-this-undefine
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -33,10 +33,82 @@
33
33
 
34
34
  /**
35
35
  * --------------------------------------------------------------------------
36
- * Bootstrap (v5.0.0): util/index.js
36
+ * Bootstrap (v5.0.1): dom/selector-engine.js
37
37
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
38
38
  * --------------------------------------------------------------------------
39
39
  */
40
+
41
+ /**
42
+ * ------------------------------------------------------------------------
43
+ * Constants
44
+ * ------------------------------------------------------------------------
45
+ */
46
+ const NODE_TEXT = 3;
47
+ const SelectorEngine = {
48
+ find(selector, element = document.documentElement) {
49
+ return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
50
+ },
51
+
52
+ findOne(selector, element = document.documentElement) {
53
+ return Element.prototype.querySelector.call(element, selector);
54
+ },
55
+
56
+ children(element, selector) {
57
+ return [].concat(...element.children).filter(child => child.matches(selector));
58
+ },
59
+
60
+ parents(element, selector) {
61
+ const parents = [];
62
+ let ancestor = element.parentNode;
63
+
64
+ while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
65
+ if (ancestor.matches(selector)) {
66
+ parents.push(ancestor);
67
+ }
68
+
69
+ ancestor = ancestor.parentNode;
70
+ }
71
+
72
+ return parents;
73
+ },
74
+
75
+ prev(element, selector) {
76
+ let previous = element.previousElementSibling;
77
+
78
+ while (previous) {
79
+ if (previous.matches(selector)) {
80
+ return [previous];
81
+ }
82
+
83
+ previous = previous.previousElementSibling;
84
+ }
85
+
86
+ return [];
87
+ },
88
+
89
+ next(element, selector) {
90
+ let next = element.nextElementSibling;
91
+
92
+ while (next) {
93
+ if (next.matches(selector)) {
94
+ return [next];
95
+ }
96
+
97
+ next = next.nextElementSibling;
98
+ }
99
+
100
+ return [];
101
+ }
102
+
103
+ };
104
+
105
+ /**
106
+ * --------------------------------------------------------------------------
107
+ * Bootstrap (v5.0.1): util/index.js
108
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
109
+ * --------------------------------------------------------------------------
110
+ */
111
+
40
112
  const MAX_UID = 1000000;
41
113
  const MILLISECONDS_MULTIPLIER = 1000;
42
114
  const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
@@ -129,7 +201,30 @@
129
201
  element.dispatchEvent(new Event(TRANSITION_END));
130
202
  };
131
203
 
132
- const isElement = obj => (obj[0] || obj).nodeType;
204
+ const isElement = obj => {
205
+ if (!obj || typeof obj !== 'object') {
206
+ return false;
207
+ }
208
+
209
+ if (typeof obj.jquery !== 'undefined') {
210
+ obj = obj[0];
211
+ }
212
+
213
+ return typeof obj.nodeType !== 'undefined';
214
+ };
215
+
216
+ const getElement = obj => {
217
+ if (isElement(obj)) {
218
+ // it's a jQuery object or a node element
219
+ return obj.jquery ? obj[0] : obj;
220
+ }
221
+
222
+ if (typeof obj === 'string' && obj.length > 0) {
223
+ return SelectorEngine.findOne(obj);
224
+ }
225
+
226
+ return null;
227
+ };
133
228
 
134
229
  const emulateTransitionEnd = (element, duration) => {
135
230
  let called = false;
@@ -240,12 +335,13 @@
240
335
 
241
336
  const isRTL = () => document.documentElement.dir === 'rtl';
242
337
 
243
- const defineJQueryPlugin = (name, plugin) => {
338
+ const defineJQueryPlugin = plugin => {
244
339
  onDOMContentLoaded(() => {
245
340
  const $ = getjQuery();
246
341
  /* istanbul ignore if */
247
342
 
248
343
  if ($) {
344
+ const name = plugin.NAME;
249
345
  const JQUERY_NO_CONFLICT = $.fn[name];
250
346
  $.fn[name] = plugin.jQueryInterface;
251
347
  $.fn[name].Constructor = plugin;
@@ -266,7 +362,7 @@
266
362
 
267
363
  /**
268
364
  * --------------------------------------------------------------------------
269
- * Bootstrap (v5.0.0): dom/data.js
365
+ * Bootstrap (v5.0.1): dom/data.js
270
366
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
271
367
  * --------------------------------------------------------------------------
272
368
  */
@@ -320,7 +416,7 @@
320
416
 
321
417
  /**
322
418
  * --------------------------------------------------------------------------
323
- * Bootstrap (v5.0.0): dom/event-handler.js
419
+ * Bootstrap (v5.0.1): dom/event-handler.js
324
420
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
325
421
  * --------------------------------------------------------------------------
326
422
  */
@@ -609,7 +705,7 @@
609
705
 
610
706
  /**
611
707
  * --------------------------------------------------------------------------
612
- * Bootstrap (v5.0.0): base-component.js
708
+ * Bootstrap (v5.0.1): base-component.js
613
709
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
614
710
  * --------------------------------------------------------------------------
615
711
  */
@@ -619,11 +715,11 @@
619
715
  * ------------------------------------------------------------------------
620
716
  */
621
717
 
622
- const VERSION = '5.0.0';
718
+ const VERSION = '5.0.1';
623
719
 
624
720
  class BaseComponent {
625
721
  constructor(element) {
626
- element = typeof element === 'string' ? document.querySelector(element) : element;
722
+ element = getElement(element);
627
723
 
628
724
  if (!element) {
629
725
  return;
@@ -635,8 +731,21 @@
635
731
 
636
732
  dispose() {
637
733
  Data.remove(this._element, this.constructor.DATA_KEY);
638
- EventHandler.off(this._element, `.${this.constructor.DATA_KEY}`);
639
- this._element = null;
734
+ EventHandler.off(this._element, this.constructor.EVENT_KEY);
735
+ Object.getOwnPropertyNames(this).forEach(propertyName => {
736
+ this[propertyName] = null;
737
+ });
738
+ }
739
+
740
+ _queueCallback(callback, element, isAnimated = true) {
741
+ if (!isAnimated) {
742
+ execute(callback);
743
+ return;
744
+ }
745
+
746
+ const transitionDuration = getTransitionDurationFromElement(element);
747
+ EventHandler.one(element, 'transitionend', () => execute(callback));
748
+ emulateTransitionEnd(element, transitionDuration);
640
749
  }
641
750
  /** Static */
642
751
 
@@ -649,11 +758,23 @@
649
758
  return VERSION;
650
759
  }
651
760
 
761
+ static get NAME() {
762
+ throw new Error('You have to implement the static method "NAME", for each component!');
763
+ }
764
+
765
+ static get DATA_KEY() {
766
+ return `bs.${this.NAME}`;
767
+ }
768
+
769
+ static get EVENT_KEY() {
770
+ return `.${this.DATA_KEY}`;
771
+ }
772
+
652
773
  }
653
774
 
654
775
  /**
655
776
  * --------------------------------------------------------------------------
656
- * Bootstrap (v5.0.0): alert.js
777
+ * Bootstrap (v5.0.1): alert.js
657
778
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
658
779
  * --------------------------------------------------------------------------
659
780
  */
@@ -682,8 +803,8 @@
682
803
 
683
804
  class Alert extends BaseComponent {
684
805
  // Getters
685
- static get DATA_KEY() {
686
- return DATA_KEY$b;
806
+ static get NAME() {
807
+ return NAME$c;
687
808
  } // Public
688
809
 
689
810
 
@@ -710,16 +831,9 @@
710
831
 
711
832
  _removeElement(element) {
712
833
  element.classList.remove(CLASS_NAME_SHOW$9);
834
+ const isAnimated = element.classList.contains(CLASS_NAME_FADE$6);
713
835
 
714
- if (!element.classList.contains(CLASS_NAME_FADE$6)) {
715
- this._destroyElement(element);
716
-
717
- return;
718
- }
719
-
720
- const transitionDuration = getTransitionDurationFromElement(element);
721
- EventHandler.one(element, 'transitionend', () => this._destroyElement(element));
722
- emulateTransitionEnd(element, transitionDuration);
836
+ this._queueCallback(() => this._destroyElement(element), element, isAnimated);
723
837
  }
724
838
 
725
839
  _destroyElement(element) {
@@ -771,11 +885,11 @@
771
885
  * add .Alert to jQuery only if jQuery is present
772
886
  */
773
887
 
774
- defineJQueryPlugin(NAME$c, Alert);
888
+ defineJQueryPlugin(Alert);
775
889
 
776
890
  /**
777
891
  * --------------------------------------------------------------------------
778
- * Bootstrap (v5.0.0): button.js
892
+ * Bootstrap (v5.0.1): button.js
779
893
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
780
894
  * --------------------------------------------------------------------------
781
895
  */
@@ -800,8 +914,8 @@
800
914
 
801
915
  class Button extends BaseComponent {
802
916
  // Getters
803
- static get DATA_KEY() {
804
- return DATA_KEY$a;
917
+ static get NAME() {
918
+ return NAME$b;
805
919
  } // Public
806
920
 
807
921
 
@@ -851,11 +965,11 @@
851
965
  * add .Button to jQuery only if jQuery is present
852
966
  */
853
967
 
854
- defineJQueryPlugin(NAME$b, Button);
968
+ defineJQueryPlugin(Button);
855
969
 
856
970
  /**
857
971
  * --------------------------------------------------------------------------
858
- * Bootstrap (v5.0.0): dom/manipulator.js
972
+ * Bootstrap (v5.0.1): dom/manipulator.js
859
973
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
860
974
  * --------------------------------------------------------------------------
861
975
  */
@@ -929,78 +1043,7 @@
929
1043
 
930
1044
  /**
931
1045
  * --------------------------------------------------------------------------
932
- * Bootstrap (v5.0.0): dom/selector-engine.js
933
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
934
- * --------------------------------------------------------------------------
935
- */
936
-
937
- /**
938
- * ------------------------------------------------------------------------
939
- * Constants
940
- * ------------------------------------------------------------------------
941
- */
942
- const NODE_TEXT = 3;
943
- const SelectorEngine = {
944
- find(selector, element = document.documentElement) {
945
- return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
946
- },
947
-
948
- findOne(selector, element = document.documentElement) {
949
- return Element.prototype.querySelector.call(element, selector);
950
- },
951
-
952
- children(element, selector) {
953
- return [].concat(...element.children).filter(child => child.matches(selector));
954
- },
955
-
956
- parents(element, selector) {
957
- const parents = [];
958
- let ancestor = element.parentNode;
959
-
960
- while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
961
- if (ancestor.matches(selector)) {
962
- parents.push(ancestor);
963
- }
964
-
965
- ancestor = ancestor.parentNode;
966
- }
967
-
968
- return parents;
969
- },
970
-
971
- prev(element, selector) {
972
- let previous = element.previousElementSibling;
973
-
974
- while (previous) {
975
- if (previous.matches(selector)) {
976
- return [previous];
977
- }
978
-
979
- previous = previous.previousElementSibling;
980
- }
981
-
982
- return [];
983
- },
984
-
985
- next(element, selector) {
986
- let next = element.nextElementSibling;
987
-
988
- while (next) {
989
- if (next.matches(selector)) {
990
- return [next];
991
- }
992
-
993
- next = next.nextElementSibling;
994
- }
995
-
996
- return [];
997
- }
998
-
999
- };
1000
-
1001
- /**
1002
- * --------------------------------------------------------------------------
1003
- * Bootstrap (v5.0.0): carousel.js
1046
+ * Bootstrap (v5.0.1): carousel.js
1004
1047
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1005
1048
  * --------------------------------------------------------------------------
1006
1049
  */
@@ -1101,8 +1144,8 @@
1101
1144
  return Default$9;
1102
1145
  }
1103
1146
 
1104
- static get DATA_KEY() {
1105
- return DATA_KEY$9;
1147
+ static get NAME() {
1148
+ return NAME$a;
1106
1149
  } // Public
1107
1150
 
1108
1151
 
@@ -1180,17 +1223,6 @@
1180
1223
  const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;
1181
1224
 
1182
1225
  this._slide(order, this._items[index]);
1183
- }
1184
-
1185
- dispose() {
1186
- this._items = null;
1187
- this._config = null;
1188
- this._interval = null;
1189
- this._isPaused = null;
1190
- this._isSliding = null;
1191
- this._activeElement = null;
1192
- this._indicatorsElement = null;
1193
- super.dispose();
1194
1226
  } // Private
1195
1227
 
1196
1228
 
@@ -1419,37 +1451,35 @@
1419
1451
 
1420
1452
  this._activeElement = nextElement;
1421
1453
 
1454
+ const triggerSlidEvent = () => {
1455
+ EventHandler.trigger(this._element, EVENT_SLID, {
1456
+ relatedTarget: nextElement,
1457
+ direction: eventDirectionName,
1458
+ from: activeElementIndex,
1459
+ to: nextElementIndex
1460
+ });
1461
+ };
1462
+
1422
1463
  if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
1423
1464
  nextElement.classList.add(orderClassName);
1424
1465
  reflow(nextElement);
1425
1466
  activeElement.classList.add(directionalClassName);
1426
1467
  nextElement.classList.add(directionalClassName);
1427
- const transitionDuration = getTransitionDurationFromElement(activeElement);
1428
- EventHandler.one(activeElement, 'transitionend', () => {
1468
+
1469
+ const completeCallBack = () => {
1429
1470
  nextElement.classList.remove(directionalClassName, orderClassName);
1430
1471
  nextElement.classList.add(CLASS_NAME_ACTIVE$2);
1431
1472
  activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);
1432
1473
  this._isSliding = false;
1433
- setTimeout(() => {
1434
- EventHandler.trigger(this._element, EVENT_SLID, {
1435
- relatedTarget: nextElement,
1436
- direction: eventDirectionName,
1437
- from: activeElementIndex,
1438
- to: nextElementIndex
1439
- });
1440
- }, 0);
1441
- });
1442
- emulateTransitionEnd(activeElement, transitionDuration);
1474
+ setTimeout(triggerSlidEvent, 0);
1475
+ };
1476
+
1477
+ this._queueCallback(completeCallBack, activeElement, true);
1443
1478
  } else {
1444
1479
  activeElement.classList.remove(CLASS_NAME_ACTIVE$2);
1445
1480
  nextElement.classList.add(CLASS_NAME_ACTIVE$2);
1446
1481
  this._isSliding = false;
1447
- EventHandler.trigger(this._element, EVENT_SLID, {
1448
- relatedTarget: nextElement,
1449
- direction: eventDirectionName,
1450
- from: activeElementIndex,
1451
- to: nextElementIndex
1452
- });
1482
+ triggerSlidEvent();
1453
1483
  }
1454
1484
 
1455
1485
  if (isCycling) {
@@ -1568,11 +1598,11 @@
1568
1598
  * add .Carousel to jQuery only if jQuery is present
1569
1599
  */
1570
1600
 
1571
- defineJQueryPlugin(NAME$a, Carousel);
1601
+ defineJQueryPlugin(Carousel);
1572
1602
 
1573
1603
  /**
1574
1604
  * --------------------------------------------------------------------------
1575
- * Bootstrap (v5.0.0): collapse.js
1605
+ * Bootstrap (v5.0.1): collapse.js
1576
1606
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1577
1607
  * --------------------------------------------------------------------------
1578
1608
  */
@@ -1649,8 +1679,8 @@
1649
1679
  return Default$8;
1650
1680
  }
1651
1681
 
1652
- static get DATA_KEY() {
1653
- return DATA_KEY$8;
1682
+ static get NAME() {
1683
+ return NAME$9;
1654
1684
  } // Public
1655
1685
 
1656
1686
 
@@ -1742,9 +1772,9 @@
1742
1772
 
1743
1773
  const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1744
1774
  const scrollSize = `scroll${capitalizedDimension}`;
1745
- const transitionDuration = getTransitionDurationFromElement(this._element);
1746
- EventHandler.one(this._element, 'transitionend', complete);
1747
- emulateTransitionEnd(this._element, transitionDuration);
1775
+
1776
+ this._queueCallback(complete, this._element, true);
1777
+
1748
1778
  this._element.style[dimension] = `${this._element[scrollSize]}px`;
1749
1779
  }
1750
1780
 
@@ -1795,21 +1825,12 @@
1795
1825
  };
1796
1826
 
1797
1827
  this._element.style[dimension] = '';
1798
- const transitionDuration = getTransitionDurationFromElement(this._element);
1799
- EventHandler.one(this._element, 'transitionend', complete);
1800
- emulateTransitionEnd(this._element, transitionDuration);
1828
+
1829
+ this._queueCallback(complete, this._element, true);
1801
1830
  }
1802
1831
 
1803
1832
  setTransitioning(isTransitioning) {
1804
1833
  this._isTransitioning = isTransitioning;
1805
- }
1806
-
1807
- dispose() {
1808
- super.dispose();
1809
- this._config = null;
1810
- this._parent = null;
1811
- this._triggerArray = null;
1812
- this._isTransitioning = null;
1813
1834
  } // Private
1814
1835
 
1815
1836
 
@@ -1831,16 +1852,7 @@
1831
1852
  let {
1832
1853
  parent
1833
1854
  } = this._config;
1834
-
1835
- if (isElement(parent)) {
1836
- // it's a jQuery object
1837
- if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
1838
- parent = parent[0];
1839
- }
1840
- } else {
1841
- parent = SelectorEngine.findOne(parent);
1842
- }
1843
-
1855
+ parent = getElement(parent);
1844
1856
  const selector = `${SELECTOR_DATA_TOGGLE$4}[data-bs-parent="${parent}"]`;
1845
1857
  SelectorEngine.find(selector, parent).forEach(element => {
1846
1858
  const selected = getElementFromSelector(element);
@@ -1941,11 +1953,11 @@
1941
1953
  * add .Collapse to jQuery only if jQuery is present
1942
1954
  */
1943
1955
 
1944
- defineJQueryPlugin(NAME$9, Collapse);
1956
+ defineJQueryPlugin(Collapse);
1945
1957
 
1946
1958
  /**
1947
1959
  * --------------------------------------------------------------------------
1948
- * Bootstrap (v5.0.0): dropdown.js
1960
+ * Bootstrap (v5.0.1): dropdown.js
1949
1961
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1950
1962
  * --------------------------------------------------------------------------
1951
1963
  */
@@ -2032,8 +2044,8 @@
2032
2044
  return DefaultType$7;
2033
2045
  }
2034
2046
 
2035
- static get DATA_KEY() {
2036
- return DATA_KEY$7;
2047
+ static get NAME() {
2048
+ return NAME$8;
2037
2049
  } // Public
2038
2050
 
2039
2051
 
@@ -2080,11 +2092,7 @@
2080
2092
  if (this._config.reference === 'parent') {
2081
2093
  referenceElement = parent;
2082
2094
  } else if (isElement(this._config.reference)) {
2083
- referenceElement = this._config.reference; // Check if it's jQuery element
2084
-
2085
- if (typeof this._config.reference.jquery !== 'undefined') {
2086
- referenceElement = this._config.reference[0];
2087
- }
2095
+ referenceElement = getElement(this._config.reference);
2088
2096
  } else if (typeof this._config.reference === 'object') {
2089
2097
  referenceElement = this._config.reference;
2090
2098
  }
@@ -2131,12 +2139,8 @@
2131
2139
  }
2132
2140
 
2133
2141
  dispose() {
2134
- this._menu = null;
2135
-
2136
2142
  if (this._popper) {
2137
2143
  this._popper.destroy();
2138
-
2139
- this._popper = null;
2140
2144
  }
2141
2145
 
2142
2146
  super.dispose();
@@ -2322,14 +2326,8 @@
2322
2326
  }
2323
2327
 
2324
2328
  static clearMenus(event) {
2325
- if (event) {
2326
- if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY) {
2327
- return;
2328
- }
2329
-
2330
- if (/input|select|option|textarea|form/i.test(event.target.tagName)) {
2331
- return;
2332
- }
2329
+ if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
2330
+ return;
2333
2331
  }
2334
2332
 
2335
2333
  const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);
@@ -2355,10 +2353,10 @@
2355
2353
 
2356
2354
  if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
2357
2355
  continue;
2358
- } // Tab navigation through the dropdown menu shouldn't close the menu
2356
+ } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
2359
2357
 
2360
2358
 
2361
- if (event.type === 'keyup' && event.key === TAB_KEY && context._menu.contains(event.target)) {
2359
+ if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
2362
2360
  continue;
2363
2361
  }
2364
2362
 
@@ -2444,11 +2442,11 @@
2444
2442
  * add .Dropdown to jQuery only if jQuery is present
2445
2443
  */
2446
2444
 
2447
- defineJQueryPlugin(NAME$8, Dropdown);
2445
+ defineJQueryPlugin(Dropdown);
2448
2446
 
2449
2447
  /**
2450
2448
  * --------------------------------------------------------------------------
2451
- * Bootstrap (v5.0.0): util/scrollBar.js
2449
+ * Bootstrap (v5.0.1): util/scrollBar.js
2452
2450
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2453
2451
  * --------------------------------------------------------------------------
2454
2452
  */
@@ -2522,7 +2520,7 @@
2522
2520
 
2523
2521
  /**
2524
2522
  * --------------------------------------------------------------------------
2525
- * Bootstrap (v5.0.0): util/backdrop.js
2523
+ * Bootstrap (v5.0.1): util/backdrop.js
2526
2524
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2527
2525
  * --------------------------------------------------------------------------
2528
2526
  */
@@ -2606,6 +2604,7 @@
2606
2604
  config = { ...Default$6,
2607
2605
  ...(typeof config === 'object' ? config : {})
2608
2606
  };
2607
+ config.rootElement = config.rootElement || document.body;
2609
2608
  typeCheckConfig(NAME$7, config, DefaultType$6);
2610
2609
  return config;
2611
2610
  }
@@ -2650,7 +2649,7 @@
2650
2649
 
2651
2650
  /**
2652
2651
  * --------------------------------------------------------------------------
2653
- * Bootstrap (v5.0.0): modal.js
2652
+ * Bootstrap (v5.0.1): modal.js
2654
2653
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2655
2654
  * --------------------------------------------------------------------------
2656
2655
  */
@@ -2680,7 +2679,7 @@
2680
2679
  const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
2681
2680
  const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
2682
2681
  const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
2683
- const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
2682
+ const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`;
2684
2683
  const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
2685
2684
  const EVENT_CLICK_DISMISS$2 = `click.dismiss${EVENT_KEY$6}`;
2686
2685
  const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
@@ -2717,8 +2716,8 @@
2717
2716
  return Default$5;
2718
2717
  }
2719
2718
 
2720
- static get DATA_KEY() {
2721
- return DATA_KEY$6;
2719
+ static get NAME() {
2720
+ return NAME$6;
2722
2721
  } // Public
2723
2722
 
2724
2723
 
@@ -2792,24 +2791,21 @@
2792
2791
 
2793
2792
  this._setResizeEvent();
2794
2793
 
2795
- EventHandler.off(document, EVENT_FOCUSIN$1);
2794
+ EventHandler.off(document, EVENT_FOCUSIN$2);
2796
2795
 
2797
2796
  this._element.classList.remove(CLASS_NAME_SHOW$5);
2798
2797
 
2799
2798
  EventHandler.off(this._element, EVENT_CLICK_DISMISS$2);
2800
2799
  EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
2801
2800
 
2802
- if (isAnimated) {
2803
- const transitionDuration = getTransitionDurationFromElement(this._element);
2804
- EventHandler.one(this._element, 'transitionend', event => this._hideModal(event));
2805
- emulateTransitionEnd(this._element, transitionDuration);
2806
- } else {
2807
- this._hideModal();
2808
- }
2801
+ this._queueCallback(() => this._hideModal(), this._element, isAnimated);
2809
2802
  }
2810
2803
 
2811
2804
  dispose() {
2812
2805
  [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6));
2806
+
2807
+ this._backdrop.dispose();
2808
+
2813
2809
  super.dispose();
2814
2810
  /**
2815
2811
  * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
@@ -2817,16 +2813,7 @@
2817
2813
  * It will remove `EVENT_CLICK_DATA_API` event that should remain
2818
2814
  */
2819
2815
 
2820
- EventHandler.off(document, EVENT_FOCUSIN$1);
2821
- this._config = null;
2822
- this._dialog = null;
2823
-
2824
- this._backdrop.dispose();
2825
-
2826
- this._backdrop = null;
2827
- this._isShown = null;
2828
- this._ignoreBackdropClick = null;
2829
- this._isTransitioning = null;
2816
+ EventHandler.off(document, EVENT_FOCUSIN$2);
2830
2817
  }
2831
2818
 
2832
2819
  handleUpdate() {
@@ -2896,19 +2883,13 @@
2896
2883
  });
2897
2884
  };
2898
2885
 
2899
- if (isAnimated) {
2900
- const transitionDuration = getTransitionDurationFromElement(this._dialog);
2901
- EventHandler.one(this._dialog, 'transitionend', transitionComplete);
2902
- emulateTransitionEnd(this._dialog, transitionDuration);
2903
- } else {
2904
- transitionComplete();
2905
- }
2886
+ this._queueCallback(transitionComplete, this._dialog, isAnimated);
2906
2887
  }
2907
2888
 
2908
2889
  _enforceFocus() {
2909
- EventHandler.off(document, EVENT_FOCUSIN$1); // guard against infinite focus loop
2890
+ EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
2910
2891
 
2911
- EventHandler.on(document, EVENT_FOCUSIN$1, event => {
2892
+ EventHandler.on(document, EVENT_FOCUSIN$2, event => {
2912
2893
  if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
2913
2894
  this._element.focus();
2914
2895
  }
@@ -3092,11 +3073,11 @@
3092
3073
  * add .Modal to jQuery only if jQuery is present
3093
3074
  */
3094
3075
 
3095
- defineJQueryPlugin(NAME$6, Modal);
3076
+ defineJQueryPlugin(Modal);
3096
3077
 
3097
3078
  /**
3098
3079
  * --------------------------------------------------------------------------
3099
- * Bootstrap (v5.0.0): offcanvas.js
3080
+ * Bootstrap (v5.0.1): offcanvas.js
3100
3081
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3101
3082
  * --------------------------------------------------------------------------
3102
3083
  */
@@ -3128,7 +3109,7 @@
3128
3109
  const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
3129
3110
  const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
3130
3111
  const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;
3131
- const EVENT_FOCUSIN = `focusin${EVENT_KEY$5}`;
3112
+ const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$5}`;
3132
3113
  const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
3133
3114
  const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`;
3134
3115
  const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
@@ -3151,12 +3132,12 @@
3151
3132
  } // Getters
3152
3133
 
3153
3134
 
3154
- static get Default() {
3155
- return Default$4;
3135
+ static get NAME() {
3136
+ return NAME$5;
3156
3137
  }
3157
3138
 
3158
- static get DATA_KEY() {
3159
- return DATA_KEY$5;
3139
+ static get Default() {
3140
+ return Default$4;
3160
3141
  } // Public
3161
3142
 
3162
3143
 
@@ -3202,9 +3183,7 @@
3202
3183
  });
3203
3184
  };
3204
3185
 
3205
- const transitionDuration = getTransitionDurationFromElement(this._element);
3206
- EventHandler.one(this._element, 'transitionend', completeCallBack);
3207
- emulateTransitionEnd(this._element, transitionDuration);
3186
+ this._queueCallback(completeCallBack, this._element, true);
3208
3187
  }
3209
3188
 
3210
3189
  hide() {
@@ -3218,7 +3197,7 @@
3218
3197
  return;
3219
3198
  }
3220
3199
 
3221
- EventHandler.off(document, EVENT_FOCUSIN);
3200
+ EventHandler.off(document, EVENT_FOCUSIN$1);
3222
3201
 
3223
3202
  this._element.blur();
3224
3203
 
@@ -3244,18 +3223,14 @@
3244
3223
  EventHandler.trigger(this._element, EVENT_HIDDEN$2);
3245
3224
  };
3246
3225
 
3247
- const transitionDuration = getTransitionDurationFromElement(this._element);
3248
- EventHandler.one(this._element, 'transitionend', completeCallback);
3249
- emulateTransitionEnd(this._element, transitionDuration);
3226
+ this._queueCallback(completeCallback, this._element, true);
3250
3227
  }
3251
3228
 
3252
3229
  dispose() {
3253
3230
  this._backdrop.dispose();
3254
3231
 
3255
3232
  super.dispose();
3256
- EventHandler.off(document, EVENT_FOCUSIN);
3257
- this._config = null;
3258
- this._backdrop = null;
3233
+ EventHandler.off(document, EVENT_FOCUSIN$1);
3259
3234
  } // Private
3260
3235
 
3261
3236
 
@@ -3278,9 +3253,9 @@
3278
3253
  }
3279
3254
 
3280
3255
  _enforceFocusOnElement(element) {
3281
- EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
3256
+ EventHandler.off(document, EVENT_FOCUSIN$1); // guard against infinite focus loop
3282
3257
 
3283
- EventHandler.on(document, EVENT_FOCUSIN, event => {
3258
+ EventHandler.on(document, EVENT_FOCUSIN$1, event => {
3284
3259
  if (document !== event.target && element !== event.target && !element.contains(event.target)) {
3285
3260
  element.focus();
3286
3261
  }
@@ -3358,11 +3333,11 @@
3358
3333
  * ------------------------------------------------------------------------
3359
3334
  */
3360
3335
 
3361
- defineJQueryPlugin(NAME$5, Offcanvas);
3336
+ defineJQueryPlugin(Offcanvas);
3362
3337
 
3363
3338
  /**
3364
3339
  * --------------------------------------------------------------------------
3365
- * Bootstrap (v5.0.0): util/sanitizer.js
3340
+ * Bootstrap (v5.0.1): util/sanitizer.js
3366
3341
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3367
3342
  * --------------------------------------------------------------------------
3368
3343
  */
@@ -3475,7 +3450,7 @@
3475
3450
 
3476
3451
  /**
3477
3452
  * --------------------------------------------------------------------------
3478
- * Bootstrap (v5.0.0): tooltip.js
3453
+ * Bootstrap (v5.0.1): tooltip.js
3479
3454
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3480
3455
  * --------------------------------------------------------------------------
3481
3456
  */
@@ -3578,7 +3553,7 @@
3578
3553
  this._activeTrigger = {};
3579
3554
  this._popper = null; // Protected
3580
3555
 
3581
- this.config = this._getConfig(config);
3556
+ this._config = this._getConfig(config);
3582
3557
  this.tip = null;
3583
3558
 
3584
3559
  this._setListeners();
@@ -3593,18 +3568,10 @@
3593
3568
  return NAME$4;
3594
3569
  }
3595
3570
 
3596
- static get DATA_KEY() {
3597
- return DATA_KEY$4;
3598
- }
3599
-
3600
3571
  static get Event() {
3601
3572
  return Event$2;
3602
3573
  }
3603
3574
 
3604
- static get EVENT_KEY() {
3605
- return EVENT_KEY$4;
3606
- }
3607
-
3608
3575
  static get DefaultType() {
3609
3576
  return DefaultType$3;
3610
3577
  } // Public
@@ -3656,18 +3623,10 @@
3656
3623
  this.tip.parentNode.removeChild(this.tip);
3657
3624
  }
3658
3625
 
3659
- this._isEnabled = null;
3660
- this._timeout = null;
3661
- this._hoverState = null;
3662
- this._activeTrigger = null;
3663
-
3664
3626
  if (this._popper) {
3665
3627
  this._popper.destroy();
3666
3628
  }
3667
3629
 
3668
- this._popper = null;
3669
- this.config = null;
3670
- this.tip = null;
3671
3630
  super.dispose();
3672
3631
  }
3673
3632
 
@@ -3696,18 +3655,19 @@
3696
3655
 
3697
3656
  this.setContent();
3698
3657
 
3699
- if (this.config.animation) {
3658
+ if (this._config.animation) {
3700
3659
  tip.classList.add(CLASS_NAME_FADE$3);
3701
3660
  }
3702
3661
 
3703
- const placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
3662
+ const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
3704
3663
 
3705
3664
  const attachment = this._getAttachment(placement);
3706
3665
 
3707
3666
  this._addAttachmentClass(attachment);
3708
3667
 
3709
- const container = this._getContainer();
3710
-
3668
+ const {
3669
+ container
3670
+ } = this._config;
3711
3671
  Data.set(tip, this.constructor.DATA_KEY, this);
3712
3672
 
3713
3673
  if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
@@ -3722,7 +3682,7 @@
3722
3682
  }
3723
3683
 
3724
3684
  tip.classList.add(CLASS_NAME_SHOW$3);
3725
- const customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
3685
+ const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass;
3726
3686
 
3727
3687
  if (customClass) {
3728
3688
  tip.classList.add(...customClass.split(' '));
@@ -3748,13 +3708,9 @@
3748
3708
  }
3749
3709
  };
3750
3710
 
3751
- if (this.tip.classList.contains(CLASS_NAME_FADE$3)) {
3752
- const transitionDuration = getTransitionDurationFromElement(this.tip);
3753
- EventHandler.one(this.tip, 'transitionend', complete);
3754
- emulateTransitionEnd(this.tip, transitionDuration);
3755
- } else {
3756
- complete();
3757
- }
3711
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
3712
+
3713
+ this._queueCallback(complete, this.tip, isAnimated);
3758
3714
  }
3759
3715
 
3760
3716
  hide() {
@@ -3802,14 +3758,9 @@
3802
3758
  this._activeTrigger[TRIGGER_CLICK] = false;
3803
3759
  this._activeTrigger[TRIGGER_FOCUS] = false;
3804
3760
  this._activeTrigger[TRIGGER_HOVER] = false;
3761
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
3805
3762
 
3806
- if (this.tip.classList.contains(CLASS_NAME_FADE$3)) {
3807
- const transitionDuration = getTransitionDurationFromElement(tip);
3808
- EventHandler.one(tip, 'transitionend', complete);
3809
- emulateTransitionEnd(tip, transitionDuration);
3810
- } else {
3811
- complete();
3812
- }
3763
+ this._queueCallback(complete, this.tip, isAnimated);
3813
3764
 
3814
3765
  this._hoverState = '';
3815
3766
  }
@@ -3831,7 +3782,7 @@
3831
3782
  }
3832
3783
 
3833
3784
  const element = document.createElement('div');
3834
- element.innerHTML = this.config.template;
3785
+ element.innerHTML = this._config.template;
3835
3786
  this.tip = element.children[0];
3836
3787
  return this.tip;
3837
3788
  }
@@ -3847,13 +3798,10 @@
3847
3798
  return;
3848
3799
  }
3849
3800
 
3850
- if (typeof content === 'object' && isElement(content)) {
3851
- if (content.jquery) {
3852
- content = content[0];
3853
- } // content is a DOM node or a jQuery
3801
+ if (isElement(content)) {
3802
+ content = getElement(content); // content is a DOM node or a jQuery
3854
3803
 
3855
-
3856
- if (this.config.html) {
3804
+ if (this._config.html) {
3857
3805
  if (content.parentNode !== element) {
3858
3806
  element.innerHTML = '';
3859
3807
  element.appendChild(content);
@@ -3865,9 +3813,9 @@
3865
3813
  return;
3866
3814
  }
3867
3815
 
3868
- if (this.config.html) {
3869
- if (this.config.sanitize) {
3870
- content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
3816
+ if (this._config.html) {
3817
+ if (this._config.sanitize) {
3818
+ content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
3871
3819
  }
3872
3820
 
3873
3821
  element.innerHTML = content;
@@ -3880,7 +3828,7 @@
3880
3828
  let title = this._element.getAttribute('data-bs-original-title');
3881
3829
 
3882
3830
  if (!title) {
3883
- title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
3831
+ title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
3884
3832
  }
3885
3833
 
3886
3834
  return title;
@@ -3914,7 +3862,7 @@
3914
3862
  _getOffset() {
3915
3863
  const {
3916
3864
  offset
3917
- } = this.config;
3865
+ } = this._config;
3918
3866
 
3919
3867
  if (typeof offset === 'string') {
3920
3868
  return offset.split(',').map(val => Number.parseInt(val, 10));
@@ -3933,7 +3881,7 @@
3933
3881
  modifiers: [{
3934
3882
  name: 'flip',
3935
3883
  options: {
3936
- fallbackPlacements: this.config.fallbackPlacements
3884
+ fallbackPlacements: this._config.fallbackPlacements
3937
3885
  }
3938
3886
  }, {
3939
3887
  name: 'offset',
@@ -3943,7 +3891,7 @@
3943
3891
  }, {
3944
3892
  name: 'preventOverflow',
3945
3893
  options: {
3946
- boundary: this.config.boundary
3894
+ boundary: this._config.boundary
3947
3895
  }
3948
3896
  }, {
3949
3897
  name: 'arrow',
@@ -3963,7 +3911,7 @@
3963
3911
  }
3964
3912
  };
3965
3913
  return { ...defaultBsPopperConfig,
3966
- ...(typeof this.config.popperConfig === 'function' ? this.config.popperConfig(defaultBsPopperConfig) : this.config.popperConfig)
3914
+ ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
3967
3915
  };
3968
3916
  }
3969
3917
 
@@ -3971,32 +3919,21 @@
3971
3919
  this.getTipElement().classList.add(`${CLASS_PREFIX$1}-${this.updateAttachment(attachment)}`);
3972
3920
  }
3973
3921
 
3974
- _getContainer() {
3975
- if (this.config.container === false) {
3976
- return document.body;
3977
- }
3978
-
3979
- if (isElement(this.config.container)) {
3980
- return this.config.container;
3981
- }
3982
-
3983
- return SelectorEngine.findOne(this.config.container);
3984
- }
3985
-
3986
3922
  _getAttachment(placement) {
3987
3923
  return AttachmentMap[placement.toUpperCase()];
3988
3924
  }
3989
3925
 
3990
3926
  _setListeners() {
3991
- const triggers = this.config.trigger.split(' ');
3927
+ const triggers = this._config.trigger.split(' ');
3928
+
3992
3929
  triggers.forEach(trigger => {
3993
3930
  if (trigger === 'click') {
3994
- EventHandler.on(this._element, this.constructor.Event.CLICK, this.config.selector, event => this.toggle(event));
3931
+ EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
3995
3932
  } else if (trigger !== TRIGGER_MANUAL) {
3996
3933
  const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
3997
3934
  const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
3998
- EventHandler.on(this._element, eventIn, this.config.selector, event => this._enter(event));
3999
- EventHandler.on(this._element, eventOut, this.config.selector, event => this._leave(event));
3935
+ EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event));
3936
+ EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event));
4000
3937
  }
4001
3938
  });
4002
3939
 
@@ -4008,8 +3945,8 @@
4008
3945
 
4009
3946
  EventHandler.on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
4010
3947
 
4011
- if (this.config.selector) {
4012
- this.config = { ...this.config,
3948
+ if (this._config.selector) {
3949
+ this._config = { ...this._config,
4013
3950
  trigger: 'manual',
4014
3951
  selector: ''
4015
3952
  };
@@ -4049,7 +3986,7 @@
4049
3986
  clearTimeout(context._timeout);
4050
3987
  context._hoverState = HOVER_STATE_SHOW;
4051
3988
 
4052
- if (!context.config.delay || !context.config.delay.show) {
3989
+ if (!context._config.delay || !context._config.delay.show) {
4053
3990
  context.show();
4054
3991
  return;
4055
3992
  }
@@ -4058,7 +3995,7 @@
4058
3995
  if (context._hoverState === HOVER_STATE_SHOW) {
4059
3996
  context.show();
4060
3997
  }
4061
- }, context.config.delay.show);
3998
+ }, context._config.delay.show);
4062
3999
  }
4063
4000
 
4064
4001
  _leave(event, context) {
@@ -4075,7 +4012,7 @@
4075
4012
  clearTimeout(context._timeout);
4076
4013
  context._hoverState = HOVER_STATE_OUT;
4077
4014
 
4078
- if (!context.config.delay || !context.config.delay.hide) {
4015
+ if (!context._config.delay || !context._config.delay.hide) {
4079
4016
  context.hide();
4080
4017
  return;
4081
4018
  }
@@ -4084,7 +4021,7 @@
4084
4021
  if (context._hoverState === HOVER_STATE_OUT) {
4085
4022
  context.hide();
4086
4023
  }
4087
- }, context.config.delay.hide);
4024
+ }, context._config.delay.hide);
4088
4025
  }
4089
4026
 
4090
4027
  _isWithActiveTrigger() {
@@ -4104,15 +4041,11 @@
4104
4041
  delete dataAttributes[dataAttr];
4105
4042
  }
4106
4043
  });
4107
-
4108
- if (config && typeof config.container === 'object' && config.container.jquery) {
4109
- config.container = config.container[0];
4110
- }
4111
-
4112
4044
  config = { ...this.constructor.Default,
4113
4045
  ...dataAttributes,
4114
4046
  ...(typeof config === 'object' && config ? config : {})
4115
4047
  };
4048
+ config.container = config.container === false ? document.body : getElement(config.container);
4116
4049
 
4117
4050
  if (typeof config.delay === 'number') {
4118
4051
  config.delay = {
@@ -4141,10 +4074,10 @@
4141
4074
  _getDelegateConfig() {
4142
4075
  const config = {};
4143
4076
 
4144
- if (this.config) {
4145
- for (const key in this.config) {
4146
- if (this.constructor.Default[key] !== this.config[key]) {
4147
- config[key] = this.config[key];
4077
+ if (this._config) {
4078
+ for (const key in this._config) {
4079
+ if (this.constructor.Default[key] !== this._config[key]) {
4080
+ config[key] = this._config[key];
4148
4081
  }
4149
4082
  }
4150
4083
  }
@@ -4211,11 +4144,11 @@
4211
4144
  */
4212
4145
 
4213
4146
 
4214
- defineJQueryPlugin(NAME$4, Tooltip);
4147
+ defineJQueryPlugin(Tooltip);
4215
4148
 
4216
4149
  /**
4217
4150
  * --------------------------------------------------------------------------
4218
- * Bootstrap (v5.0.0): popover.js
4151
+ * Bootstrap (v5.0.1): popover.js
4219
4152
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4220
4153
  * --------------------------------------------------------------------------
4221
4154
  */
@@ -4272,18 +4205,10 @@
4272
4205
  return NAME$3;
4273
4206
  }
4274
4207
 
4275
- static get DATA_KEY() {
4276
- return DATA_KEY$3;
4277
- }
4278
-
4279
4208
  static get Event() {
4280
4209
  return Event$1;
4281
4210
  }
4282
4211
 
4283
- static get EVENT_KEY() {
4284
- return EVENT_KEY$3;
4285
- }
4286
-
4287
4212
  static get DefaultType() {
4288
4213
  return DefaultType$2;
4289
4214
  } // Overrides
@@ -4314,7 +4239,7 @@
4314
4239
  }
4315
4240
 
4316
4241
  _getContent() {
4317
- return this._element.getAttribute('data-bs-content') || this.config.content;
4242
+ return this._element.getAttribute('data-bs-content') || this._config.content;
4318
4243
  }
4319
4244
 
4320
4245
  _cleanTipClass() {
@@ -4361,11 +4286,11 @@
4361
4286
  */
4362
4287
 
4363
4288
 
4364
- defineJQueryPlugin(NAME$3, Popover);
4289
+ defineJQueryPlugin(Popover);
4365
4290
 
4366
4291
  /**
4367
4292
  * --------------------------------------------------------------------------
4368
- * Bootstrap (v5.0.0): scrollspy.js
4293
+ * Bootstrap (v5.0.1): scrollspy.js
4369
4294
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4370
4295
  * --------------------------------------------------------------------------
4371
4296
  */
@@ -4430,8 +4355,8 @@
4430
4355
  return Default$1;
4431
4356
  }
4432
4357
 
4433
- static get DATA_KEY() {
4434
- return DATA_KEY$2;
4358
+ static get NAME() {
4359
+ return NAME$2;
4435
4360
  } // Public
4436
4361
 
4437
4362
 
@@ -4464,15 +4389,8 @@
4464
4389
  }
4465
4390
 
4466
4391
  dispose() {
4467
- super.dispose();
4468
4392
  EventHandler.off(this._scrollElement, EVENT_KEY$2);
4469
- this._scrollElement = null;
4470
- this._config = null;
4471
- this._selector = null;
4472
- this._offsets = null;
4473
- this._targets = null;
4474
- this._activeTarget = null;
4475
- this._scrollHeight = null;
4393
+ super.dispose();
4476
4394
  } // Private
4477
4395
 
4478
4396
 
@@ -4619,11 +4537,11 @@
4619
4537
  * add .ScrollSpy to jQuery only if jQuery is present
4620
4538
  */
4621
4539
 
4622
- defineJQueryPlugin(NAME$2, ScrollSpy);
4540
+ defineJQueryPlugin(ScrollSpy);
4623
4541
 
4624
4542
  /**
4625
4543
  * --------------------------------------------------------------------------
4626
- * Bootstrap (v5.0.0): tab.js
4544
+ * Bootstrap (v5.0.1): tab.js
4627
4545
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4628
4546
  * --------------------------------------------------------------------------
4629
4547
  */
@@ -4661,8 +4579,8 @@
4661
4579
 
4662
4580
  class Tab extends BaseComponent {
4663
4581
  // Getters
4664
- static get DATA_KEY() {
4665
- return DATA_KEY$1;
4582
+ static get NAME() {
4583
+ return NAME$1;
4666
4584
  } // Public
4667
4585
 
4668
4586
 
@@ -4720,10 +4638,9 @@
4720
4638
  const complete = () => this._transitionComplete(element, active, callback);
4721
4639
 
4722
4640
  if (active && isTransitioning) {
4723
- const transitionDuration = getTransitionDurationFromElement(active);
4724
4641
  active.classList.remove(CLASS_NAME_SHOW$1);
4725
- EventHandler.one(active, 'transitionend', complete);
4726
- emulateTransitionEnd(active, transitionDuration);
4642
+
4643
+ this._queueCallback(complete, element, true);
4727
4644
  } else {
4728
4645
  complete();
4729
4646
  }
@@ -4818,11 +4735,11 @@
4818
4735
  * add .Tab to jQuery only if jQuery is present
4819
4736
  */
4820
4737
 
4821
- defineJQueryPlugin(NAME$1, Tab);
4738
+ defineJQueryPlugin(Tab);
4822
4739
 
4823
4740
  /**
4824
4741
  * --------------------------------------------------------------------------
4825
- * Bootstrap (v5.0.0): toast.js
4742
+ * Bootstrap (v5.0.1): toast.js
4826
4743
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4827
4744
  * --------------------------------------------------------------------------
4828
4745
  */
@@ -4836,6 +4753,10 @@
4836
4753
  const DATA_KEY = 'bs.toast';
4837
4754
  const EVENT_KEY = `.${DATA_KEY}`;
4838
4755
  const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
4756
+ const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
4757
+ const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
4758
+ const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
4759
+ const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
4839
4760
  const EVENT_HIDE = `hide${EVENT_KEY}`;
4840
4761
  const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
4841
4762
  const EVENT_SHOW = `show${EVENT_KEY}`;
@@ -4866,6 +4787,8 @@
4866
4787
  super(element);
4867
4788
  this._config = this._getConfig(config);
4868
4789
  this._timeout = null;
4790
+ this._hasMouseInteraction = false;
4791
+ this._hasKeyboardInteraction = false;
4869
4792
 
4870
4793
  this._setListeners();
4871
4794
  } // Getters
@@ -4879,8 +4802,8 @@
4879
4802
  return Default;
4880
4803
  }
4881
4804
 
4882
- static get DATA_KEY() {
4883
- return DATA_KEY;
4805
+ static get NAME() {
4806
+ return NAME;
4884
4807
  } // Public
4885
4808
 
4886
4809
 
@@ -4904,11 +4827,7 @@
4904
4827
 
4905
4828
  EventHandler.trigger(this._element, EVENT_SHOWN);
4906
4829
 
4907
- if (this._config.autohide) {
4908
- this._timeout = setTimeout(() => {
4909
- this.hide();
4910
- }, this._config.delay);
4911
- }
4830
+ this._maybeScheduleHide();
4912
4831
  };
4913
4832
 
4914
4833
  this._element.classList.remove(CLASS_NAME_HIDE);
@@ -4917,13 +4836,7 @@
4917
4836
 
4918
4837
  this._element.classList.add(CLASS_NAME_SHOWING);
4919
4838
 
4920
- if (this._config.animation) {
4921
- const transitionDuration = getTransitionDurationFromElement(this._element);
4922
- EventHandler.one(this._element, 'transitionend', complete);
4923
- emulateTransitionEnd(this._element, transitionDuration);
4924
- } else {
4925
- complete();
4926
- }
4839
+ this._queueCallback(complete, this._element, this._config.animation);
4927
4840
  }
4928
4841
 
4929
4842
  hide() {
@@ -4945,13 +4858,7 @@
4945
4858
 
4946
4859
  this._element.classList.remove(CLASS_NAME_SHOW);
4947
4860
 
4948
- if (this._config.animation) {
4949
- const transitionDuration = getTransitionDurationFromElement(this._element);
4950
- EventHandler.one(this._element, 'transitionend', complete);
4951
- emulateTransitionEnd(this._element, transitionDuration);
4952
- } else {
4953
- complete();
4954
- }
4861
+ this._queueCallback(complete, this._element, this._config.animation);
4955
4862
  }
4956
4863
 
4957
4864
  dispose() {
@@ -4962,7 +4869,6 @@
4962
4869
  }
4963
4870
 
4964
4871
  super.dispose();
4965
- this._config = null;
4966
4872
  } // Private
4967
4873
 
4968
4874
 
@@ -4975,8 +4881,54 @@
4975
4881
  return config;
4976
4882
  }
4977
4883
 
4884
+ _maybeScheduleHide() {
4885
+ if (!this._config.autohide) {
4886
+ return;
4887
+ }
4888
+
4889
+ if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
4890
+ return;
4891
+ }
4892
+
4893
+ this._timeout = setTimeout(() => {
4894
+ this.hide();
4895
+ }, this._config.delay);
4896
+ }
4897
+
4898
+ _onInteraction(event, isInteracting) {
4899
+ switch (event.type) {
4900
+ case 'mouseover':
4901
+ case 'mouseout':
4902
+ this._hasMouseInteraction = isInteracting;
4903
+ break;
4904
+
4905
+ case 'focusin':
4906
+ case 'focusout':
4907
+ this._hasKeyboardInteraction = isInteracting;
4908
+ break;
4909
+ }
4910
+
4911
+ if (isInteracting) {
4912
+ this._clearTimeout();
4913
+
4914
+ return;
4915
+ }
4916
+
4917
+ const nextElement = event.relatedTarget;
4918
+
4919
+ if (this._element === nextElement || this._element.contains(nextElement)) {
4920
+ return;
4921
+ }
4922
+
4923
+ this._maybeScheduleHide();
4924
+ }
4925
+
4978
4926
  _setListeners() {
4979
4927
  EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
4928
+ EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
4929
+ EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
4930
+ EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
4931
+ EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
4980
4932
  }
4981
4933
 
4982
4934
  _clearTimeout() {
@@ -5014,11 +4966,11 @@
5014
4966
  */
5015
4967
 
5016
4968
 
5017
- defineJQueryPlugin(NAME, Toast);
4969
+ defineJQueryPlugin(Toast);
5018
4970
 
5019
4971
  /**
5020
4972
  * --------------------------------------------------------------------------
5021
- * Bootstrap (v5.0.0): index.umd.js
4973
+ * Bootstrap (v5.0.1): index.umd.js
5022
4974
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5023
4975
  * --------------------------------------------------------------------------
5024
4976
  */