bootstrap 5.0.2 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/javascripts/bootstrap-sprockets.js +7 -7
- data/assets/javascripts/bootstrap.js +590 -580
- data/assets/javascripts/bootstrap.min.js +2 -2
- data/assets/javascripts/bootstrap/alert.js +73 -43
- data/assets/javascripts/bootstrap/base-component.js +15 -10
- data/assets/javascripts/bootstrap/button.js +13 -6
- data/assets/javascripts/bootstrap/carousel.js +26 -8
- data/assets/javascripts/bootstrap/collapse.js +96 -114
- data/assets/javascripts/bootstrap/dom/data.js +2 -2
- data/assets/javascripts/bootstrap/dom/event-handler.js +9 -2
- data/assets/javascripts/bootstrap/dom/manipulator.js +4 -4
- data/assets/javascripts/bootstrap/dom/selector-engine.js +47 -5
- data/assets/javascripts/bootstrap/dropdown.js +66 -74
- data/assets/javascripts/bootstrap/modal.js +198 -52
- data/assets/javascripts/bootstrap/offcanvas.js +177 -31
- data/assets/javascripts/bootstrap/popover.js +19 -52
- data/assets/javascripts/bootstrap/scrollspy.js +28 -47
- data/assets/javascripts/bootstrap/tab.js +27 -8
- data/assets/javascripts/bootstrap/toast.js +108 -13
- data/assets/javascripts/bootstrap/tooltip.js +57 -47
- data/assets/stylesheets/_bootstrap-grid.scss +1 -1
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
- data/assets/stylesheets/_bootstrap.scss +2 -1
- data/assets/stylesheets/bootstrap/_card.scss +2 -1
- data/assets/stylesheets/bootstrap/_functions.scss +45 -12
- data/assets/stylesheets/bootstrap/_grid.scss +11 -0
- data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
- data/assets/stylesheets/bootstrap/_modal.scss +1 -11
- data/assets/stylesheets/bootstrap/_navbar.scss +30 -1
- data/assets/stylesheets/bootstrap/_offcanvas.scss +4 -0
- data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
- data/assets/stylesheets/bootstrap/_reboot.scss +12 -8
- data/assets/stylesheets/bootstrap/_root.scss +39 -2
- data/assets/stylesheets/bootstrap/_toasts.scss +2 -2
- data/assets/stylesheets/bootstrap/_transitions.scss +6 -0
- data/assets/stylesheets/bootstrap/_utilities.scss +44 -8
- data/assets/stylesheets/bootstrap/_variables.scss +167 -6
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +1 -1
- data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +25 -7
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +27 -6
- data/bootstrap.gemspec +3 -3
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +6 -2
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac9843149cd951a77a337af9060986d2d4bbf280433e8029acc9beb4803e127
|
4
|
+
data.tar.gz: 94246dd7243f819c6355cddc6cb4a1a70cfa8f7091081b85eed0308e170a64a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2038973a9443b949dd806f9e4cf6aa11db3945b21ff73475054041784d21f0b925ac507ac1e6857fc6c3eb3337668522d55c3525ed4183e8502a3dadfa6e540f
|
7
|
+
data.tar.gz: 6ea2cde5c13fb286f58d14e20703356e6f614987de86d8f44487cb8441e4123ed877c59d417d5c9cd2889ad10299f38b5985b3cd5537402cbf3a048088dd44a7
|
data/README.md
CHANGED
@@ -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
|
5
7
|
//= require ./bootstrap/dom/manipulator
|
6
8
|
//= require ./bootstrap/dom/selector-engine
|
7
9
|
//= require ./bootstrap/carousel
|
8
10
|
//= require ./bootstrap/collapse
|
9
|
-
//= require ./bootstrap/
|
10
|
-
//= require ./bootstrap/
|
11
|
-
//= require ./bootstrap/
|
11
|
+
//= require ./bootstrap/dropdown
|
12
|
+
//= require ./bootstrap/modal
|
13
|
+
//= require ./bootstrap/offcanvas
|
12
14
|
//= require ./bootstrap/tooltip
|
13
15
|
//= require ./bootstrap/popover
|
14
|
-
//= require ./bootstrap/alert
|
15
|
-
//= require ./bootstrap/offcanvas
|
16
16
|
//= require ./bootstrap/scrollspy
|
17
|
-
//= require ./bootstrap/
|
18
|
-
//= require ./bootstrap/
|
17
|
+
//= require ./bootstrap/tab
|
18
|
+
//= require ./bootstrap/toast
|
19
19
|
//= require ./bootstrap-global-this-undefine
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap v5.0
|
2
|
+
* Bootstrap v5.1.0 (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,82 +33,10 @@
|
|
33
33
|
|
34
34
|
/**
|
35
35
|
* --------------------------------------------------------------------------
|
36
|
-
* Bootstrap (v5.0
|
36
|
+
* Bootstrap (v5.1.0): util/index.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.2): util/index.js
|
108
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
109
|
-
* --------------------------------------------------------------------------
|
110
|
-
*/
|
111
|
-
|
112
40
|
const MAX_UID = 1000000;
|
113
41
|
const MILLISECONDS_MULTIPLIER = 1000;
|
114
42
|
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
@@ -220,7 +148,7 @@
|
|
220
148
|
}
|
221
149
|
|
222
150
|
if (typeof obj === 'string' && obj.length > 0) {
|
223
|
-
return
|
151
|
+
return document.querySelector(obj);
|
224
152
|
}
|
225
153
|
|
226
154
|
return null;
|
@@ -286,8 +214,20 @@
|
|
286
214
|
};
|
287
215
|
|
288
216
|
const noop = () => {};
|
217
|
+
/**
|
218
|
+
* Trick to restart an element's animation
|
219
|
+
*
|
220
|
+
* @param {HTMLElement} element
|
221
|
+
* @return void
|
222
|
+
*
|
223
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
224
|
+
*/
|
289
225
|
|
290
|
-
|
226
|
+
|
227
|
+
const reflow = element => {
|
228
|
+
// eslint-disable-next-line no-unused-expressions
|
229
|
+
element.offsetHeight;
|
230
|
+
};
|
291
231
|
|
292
232
|
const getjQuery = () => {
|
293
233
|
const {
|
@@ -404,7 +344,7 @@
|
|
404
344
|
|
405
345
|
/**
|
406
346
|
* --------------------------------------------------------------------------
|
407
|
-
* Bootstrap (v5.0
|
347
|
+
* Bootstrap (v5.1.0): dom/event-handler.js
|
408
348
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
409
349
|
* --------------------------------------------------------------------------
|
410
350
|
*/
|
@@ -693,7 +633,7 @@
|
|
693
633
|
|
694
634
|
/**
|
695
635
|
* --------------------------------------------------------------------------
|
696
|
-
* Bootstrap (v5.0
|
636
|
+
* Bootstrap (v5.1.0): dom/data.js
|
697
637
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
698
638
|
* --------------------------------------------------------------------------
|
699
639
|
*/
|
@@ -747,7 +687,7 @@
|
|
747
687
|
|
748
688
|
/**
|
749
689
|
* --------------------------------------------------------------------------
|
750
|
-
* Bootstrap (v5.0
|
690
|
+
* Bootstrap (v5.1.0): base-component.js
|
751
691
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
752
692
|
* --------------------------------------------------------------------------
|
753
693
|
*/
|
@@ -757,7 +697,7 @@
|
|
757
697
|
* ------------------------------------------------------------------------
|
758
698
|
*/
|
759
699
|
|
760
|
-
const VERSION = '5.0
|
700
|
+
const VERSION = '5.1.0';
|
761
701
|
|
762
702
|
class BaseComponent {
|
763
703
|
constructor(element) {
|
@@ -786,7 +726,7 @@
|
|
786
726
|
|
787
727
|
|
788
728
|
static getInstance(element) {
|
789
|
-
return Data.get(element, this.DATA_KEY);
|
729
|
+
return Data.get(getElement(element), this.DATA_KEY);
|
790
730
|
}
|
791
731
|
|
792
732
|
static getOrCreateInstance(element, config = {}) {
|
@@ -813,7 +753,33 @@
|
|
813
753
|
|
814
754
|
/**
|
815
755
|
* --------------------------------------------------------------------------
|
816
|
-
* Bootstrap (v5.0
|
756
|
+
* Bootstrap (v5.1.0): util/component-functions.js
|
757
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
758
|
+
* --------------------------------------------------------------------------
|
759
|
+
*/
|
760
|
+
|
761
|
+
const enableDismissTrigger = (component, method = 'hide') => {
|
762
|
+
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
763
|
+
const name = component.NAME;
|
764
|
+
EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
|
765
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
766
|
+
event.preventDefault();
|
767
|
+
}
|
768
|
+
|
769
|
+
if (isDisabled(this)) {
|
770
|
+
return;
|
771
|
+
}
|
772
|
+
|
773
|
+
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
774
|
+
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
775
|
+
|
776
|
+
instance[method]();
|
777
|
+
});
|
778
|
+
};
|
779
|
+
|
780
|
+
/**
|
781
|
+
* --------------------------------------------------------------------------
|
782
|
+
* Bootstrap (v5.1.0): alert.js
|
817
783
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
818
784
|
* --------------------------------------------------------------------------
|
819
785
|
*/
|
@@ -823,17 +789,13 @@
|
|
823
789
|
* ------------------------------------------------------------------------
|
824
790
|
*/
|
825
791
|
|
826
|
-
const NAME$
|
827
|
-
const DATA_KEY$
|
828
|
-
const EVENT_KEY$
|
829
|
-
const
|
830
|
-
const
|
831
|
-
const
|
832
|
-
const
|
833
|
-
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$b}${DATA_API_KEY$8}`;
|
834
|
-
const CLASS_NAME_ALERT = 'alert';
|
835
|
-
const CLASS_NAME_FADE$6 = 'fade';
|
836
|
-
const CLASS_NAME_SHOW$9 = 'show';
|
792
|
+
const NAME$d = 'alert';
|
793
|
+
const DATA_KEY$c = 'bs.alert';
|
794
|
+
const EVENT_KEY$c = `.${DATA_KEY$c}`;
|
795
|
+
const EVENT_CLOSE = `close${EVENT_KEY$c}`;
|
796
|
+
const EVENT_CLOSED = `closed${EVENT_KEY$c}`;
|
797
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
798
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
837
799
|
/**
|
838
800
|
* ------------------------------------------------------------------------
|
839
801
|
* Class Definition
|
@@ -843,41 +805,30 @@
|
|
843
805
|
class Alert extends BaseComponent {
|
844
806
|
// Getters
|
845
807
|
static get NAME() {
|
846
|
-
return NAME$
|
808
|
+
return NAME$d;
|
847
809
|
} // Public
|
848
810
|
|
849
811
|
|
850
|
-
close(
|
851
|
-
const
|
852
|
-
|
853
|
-
const customEvent = this._triggerCloseEvent(rootElement);
|
812
|
+
close() {
|
813
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
854
814
|
|
855
|
-
if (
|
815
|
+
if (closeEvent.defaultPrevented) {
|
856
816
|
return;
|
857
817
|
}
|
858
818
|
|
859
|
-
this.
|
860
|
-
} // Private
|
861
|
-
|
819
|
+
this._element.classList.remove(CLASS_NAME_SHOW$8);
|
862
820
|
|
863
|
-
|
864
|
-
return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`);
|
865
|
-
}
|
821
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
|
866
822
|
|
867
|
-
|
868
|
-
|
869
|
-
}
|
823
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
824
|
+
} // Private
|
870
825
|
|
871
|
-
_removeElement(element) {
|
872
|
-
element.classList.remove(CLASS_NAME_SHOW$9);
|
873
|
-
const isAnimated = element.classList.contains(CLASS_NAME_FADE$6);
|
874
826
|
|
875
|
-
|
876
|
-
|
827
|
+
_destroyElement() {
|
828
|
+
this._element.remove();
|
877
829
|
|
878
|
-
|
879
|
-
|
880
|
-
EventHandler.trigger(element, EVENT_CLOSED);
|
830
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
831
|
+
this.dispose();
|
881
832
|
} // Static
|
882
833
|
|
883
834
|
|
@@ -885,20 +836,16 @@
|
|
885
836
|
return this.each(function () {
|
886
837
|
const data = Alert.getOrCreateInstance(this);
|
887
838
|
|
888
|
-
if (config
|
889
|
-
|
839
|
+
if (typeof config !== 'string') {
|
840
|
+
return;
|
890
841
|
}
|
891
|
-
});
|
892
|
-
}
|
893
842
|
|
894
|
-
|
895
|
-
|
896
|
-
if (event) {
|
897
|
-
event.preventDefault();
|
843
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
844
|
+
throw new TypeError(`No method named "${config}"`);
|
898
845
|
}
|
899
846
|
|
900
|
-
|
901
|
-
};
|
847
|
+
data[config](this);
|
848
|
+
});
|
902
849
|
}
|
903
850
|
|
904
851
|
}
|
@@ -909,7 +856,7 @@
|
|
909
856
|
*/
|
910
857
|
|
911
858
|
|
912
|
-
|
859
|
+
enableDismissTrigger(Alert, 'close');
|
913
860
|
/**
|
914
861
|
* ------------------------------------------------------------------------
|
915
862
|
* jQuery
|
@@ -921,7 +868,7 @@
|
|
921
868
|
|
922
869
|
/**
|
923
870
|
* --------------------------------------------------------------------------
|
924
|
-
* Bootstrap (v5.0
|
871
|
+
* Bootstrap (v5.1.0): button.js
|
925
872
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
926
873
|
* --------------------------------------------------------------------------
|
927
874
|
*/
|
@@ -931,13 +878,13 @@
|
|
931
878
|
* ------------------------------------------------------------------------
|
932
879
|
*/
|
933
880
|
|
934
|
-
const NAME$
|
935
|
-
const DATA_KEY$
|
936
|
-
const EVENT_KEY$
|
881
|
+
const NAME$c = 'button';
|
882
|
+
const DATA_KEY$b = 'bs.button';
|
883
|
+
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
937
884
|
const DATA_API_KEY$7 = '.data-api';
|
938
885
|
const CLASS_NAME_ACTIVE$3 = 'active';
|
939
886
|
const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]';
|
940
|
-
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$
|
887
|
+
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
|
941
888
|
/**
|
942
889
|
* ------------------------------------------------------------------------
|
943
890
|
* Class Definition
|
@@ -947,7 +894,7 @@
|
|
947
894
|
class Button extends BaseComponent {
|
948
895
|
// Getters
|
949
896
|
static get NAME() {
|
950
|
-
return NAME$
|
897
|
+
return NAME$c;
|
951
898
|
} // Public
|
952
899
|
|
953
900
|
|
@@ -992,7 +939,7 @@
|
|
992
939
|
|
993
940
|
/**
|
994
941
|
* --------------------------------------------------------------------------
|
995
|
-
* Bootstrap (v5.0
|
942
|
+
* Bootstrap (v5.1.0): dom/manipulator.js
|
996
943
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
997
944
|
* --------------------------------------------------------------------------
|
998
945
|
*/
|
@@ -1050,8 +997,8 @@
|
|
1050
997
|
offset(element) {
|
1051
998
|
const rect = element.getBoundingClientRect();
|
1052
999
|
return {
|
1053
|
-
top: rect.top +
|
1054
|
-
left: rect.left +
|
1000
|
+
top: rect.top + window.pageYOffset,
|
1001
|
+
left: rect.left + window.pageXOffset
|
1055
1002
|
};
|
1056
1003
|
},
|
1057
1004
|
|
@@ -1066,7 +1013,77 @@
|
|
1066
1013
|
|
1067
1014
|
/**
|
1068
1015
|
* --------------------------------------------------------------------------
|
1069
|
-
* Bootstrap (v5.0
|
1016
|
+
* Bootstrap (v5.1.0): dom/selector-engine.js
|
1017
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
1018
|
+
* --------------------------------------------------------------------------
|
1019
|
+
*/
|
1020
|
+
const NODE_TEXT = 3;
|
1021
|
+
const SelectorEngine = {
|
1022
|
+
find(selector, element = document.documentElement) {
|
1023
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
1024
|
+
},
|
1025
|
+
|
1026
|
+
findOne(selector, element = document.documentElement) {
|
1027
|
+
return Element.prototype.querySelector.call(element, selector);
|
1028
|
+
},
|
1029
|
+
|
1030
|
+
children(element, selector) {
|
1031
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
1032
|
+
},
|
1033
|
+
|
1034
|
+
parents(element, selector) {
|
1035
|
+
const parents = [];
|
1036
|
+
let ancestor = element.parentNode;
|
1037
|
+
|
1038
|
+
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
1039
|
+
if (ancestor.matches(selector)) {
|
1040
|
+
parents.push(ancestor);
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
ancestor = ancestor.parentNode;
|
1044
|
+
}
|
1045
|
+
|
1046
|
+
return parents;
|
1047
|
+
},
|
1048
|
+
|
1049
|
+
prev(element, selector) {
|
1050
|
+
let previous = element.previousElementSibling;
|
1051
|
+
|
1052
|
+
while (previous) {
|
1053
|
+
if (previous.matches(selector)) {
|
1054
|
+
return [previous];
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
previous = previous.previousElementSibling;
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
return [];
|
1061
|
+
},
|
1062
|
+
|
1063
|
+
next(element, selector) {
|
1064
|
+
let next = element.nextElementSibling;
|
1065
|
+
|
1066
|
+
while (next) {
|
1067
|
+
if (next.matches(selector)) {
|
1068
|
+
return [next];
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
next = next.nextElementSibling;
|
1072
|
+
}
|
1073
|
+
|
1074
|
+
return [];
|
1075
|
+
},
|
1076
|
+
|
1077
|
+
focusableChildren(element) {
|
1078
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
1079
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
};
|
1083
|
+
|
1084
|
+
/**
|
1085
|
+
* --------------------------------------------------------------------------
|
1086
|
+
* Bootstrap (v5.1.0): carousel.js
|
1070
1087
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
1071
1088
|
* --------------------------------------------------------------------------
|
1072
1089
|
*/
|
@@ -1076,16 +1093,16 @@
|
|
1076
1093
|
* ------------------------------------------------------------------------
|
1077
1094
|
*/
|
1078
1095
|
|
1079
|
-
const NAME$
|
1080
|
-
const DATA_KEY$
|
1081
|
-
const EVENT_KEY$
|
1096
|
+
const NAME$b = 'carousel';
|
1097
|
+
const DATA_KEY$a = 'bs.carousel';
|
1098
|
+
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
1082
1099
|
const DATA_API_KEY$6 = '.data-api';
|
1083
1100
|
const ARROW_LEFT_KEY = 'ArrowLeft';
|
1084
1101
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
1085
1102
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
1086
1103
|
|
1087
1104
|
const SWIPE_THRESHOLD = 40;
|
1088
|
-
const Default$
|
1105
|
+
const Default$a = {
|
1089
1106
|
interval: 5000,
|
1090
1107
|
keyboard: true,
|
1091
1108
|
slide: false,
|
@@ -1093,7 +1110,7 @@
|
|
1093
1110
|
wrap: true,
|
1094
1111
|
touch: true
|
1095
1112
|
};
|
1096
|
-
const DefaultType$
|
1113
|
+
const DefaultType$a = {
|
1097
1114
|
interval: '(number|boolean)',
|
1098
1115
|
keyboard: 'boolean',
|
1099
1116
|
slide: '(boolean|string)',
|
@@ -1109,19 +1126,19 @@
|
|
1109
1126
|
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
1110
1127
|
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
1111
1128
|
};
|
1112
|
-
const EVENT_SLIDE = `slide${EVENT_KEY$
|
1113
|
-
const EVENT_SLID = `slid${EVENT_KEY$
|
1114
|
-
const EVENT_KEYDOWN = `keydown${EVENT_KEY$
|
1115
|
-
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$
|
1116
|
-
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$
|
1117
|
-
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$
|
1118
|
-
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$
|
1119
|
-
const EVENT_TOUCHEND = `touchend${EVENT_KEY$
|
1120
|
-
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$
|
1121
|
-
const EVENT_POINTERUP = `pointerup${EVENT_KEY$
|
1122
|
-
const EVENT_DRAG_START = `dragstart${EVENT_KEY$
|
1123
|
-
const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$
|
1124
|
-
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$
|
1129
|
+
const EVENT_SLIDE = `slide${EVENT_KEY$a}`;
|
1130
|
+
const EVENT_SLID = `slid${EVENT_KEY$a}`;
|
1131
|
+
const EVENT_KEYDOWN = `keydown${EVENT_KEY$a}`;
|
1132
|
+
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$a}`;
|
1133
|
+
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$a}`;
|
1134
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$a}`;
|
1135
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$a}`;
|
1136
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY$a}`;
|
1137
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$a}`;
|
1138
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY$a}`;
|
1139
|
+
const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`;
|
1140
|
+
const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
1141
|
+
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
1125
1142
|
const CLASS_NAME_CAROUSEL = 'carousel';
|
1126
1143
|
const CLASS_NAME_ACTIVE$2 = 'active';
|
1127
1144
|
const CLASS_NAME_SLIDE = 'slide';
|
@@ -1168,11 +1185,11 @@
|
|
1168
1185
|
|
1169
1186
|
|
1170
1187
|
static get Default() {
|
1171
|
-
return Default$
|
1188
|
+
return Default$a;
|
1172
1189
|
}
|
1173
1190
|
|
1174
1191
|
static get NAME() {
|
1175
|
-
return NAME$
|
1192
|
+
return NAME$b;
|
1176
1193
|
} // Public
|
1177
1194
|
|
1178
1195
|
|
@@ -1250,11 +1267,11 @@
|
|
1250
1267
|
|
1251
1268
|
|
1252
1269
|
_getConfig(config) {
|
1253
|
-
config = { ...Default$
|
1270
|
+
config = { ...Default$a,
|
1254
1271
|
...Manipulator.getDataAttributes(this._element),
|
1255
1272
|
...(typeof config === 'object' ? config : {})
|
1256
1273
|
};
|
1257
|
-
typeCheckConfig(NAME$
|
1274
|
+
typeCheckConfig(NAME$b, config, DefaultType$a);
|
1258
1275
|
return config;
|
1259
1276
|
}
|
1260
1277
|
|
@@ -1611,7 +1628,7 @@
|
|
1611
1628
|
|
1612
1629
|
/**
|
1613
1630
|
* --------------------------------------------------------------------------
|
1614
|
-
* Bootstrap (v5.0
|
1631
|
+
* Bootstrap (v5.1.0): collapse.js
|
1615
1632
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
1616
1633
|
* --------------------------------------------------------------------------
|
1617
1634
|
*/
|
@@ -1621,27 +1638,28 @@
|
|
1621
1638
|
* ------------------------------------------------------------------------
|
1622
1639
|
*/
|
1623
1640
|
|
1624
|
-
const NAME$
|
1625
|
-
const DATA_KEY$
|
1626
|
-
const EVENT_KEY$
|
1641
|
+
const NAME$a = 'collapse';
|
1642
|
+
const DATA_KEY$9 = 'bs.collapse';
|
1643
|
+
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
1627
1644
|
const DATA_API_KEY$5 = '.data-api';
|
1628
|
-
const Default$
|
1645
|
+
const Default$9 = {
|
1629
1646
|
toggle: true,
|
1630
|
-
parent:
|
1647
|
+
parent: null
|
1631
1648
|
};
|
1632
|
-
const DefaultType$
|
1649
|
+
const DefaultType$9 = {
|
1633
1650
|
toggle: 'boolean',
|
1634
|
-
parent: '(
|
1651
|
+
parent: '(null|element)'
|
1635
1652
|
};
|
1636
|
-
const EVENT_SHOW$5 = `show${EVENT_KEY$
|
1637
|
-
const EVENT_SHOWN$5 = `shown${EVENT_KEY$
|
1638
|
-
const EVENT_HIDE$5 = `hide${EVENT_KEY$
|
1639
|
-
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$
|
1640
|
-
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$
|
1641
|
-
const CLASS_NAME_SHOW$
|
1653
|
+
const EVENT_SHOW$5 = `show${EVENT_KEY$9}`;
|
1654
|
+
const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`;
|
1655
|
+
const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`;
|
1656
|
+
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`;
|
1657
|
+
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`;
|
1658
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
1642
1659
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
1643
1660
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
1644
1661
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
1662
|
+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
1645
1663
|
const WIDTH = 'width';
|
1646
1664
|
const HEIGHT = 'height';
|
1647
1665
|
const SELECTOR_ACTIVES = '.show, .collapsing';
|
@@ -1657,7 +1675,7 @@
|
|
1657
1675
|
super(element);
|
1658
1676
|
this._isTransitioning = false;
|
1659
1677
|
this._config = this._getConfig(config);
|
1660
|
-
this._triggerArray =
|
1678
|
+
this._triggerArray = [];
|
1661
1679
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
|
1662
1680
|
|
1663
1681
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
@@ -1672,10 +1690,10 @@
|
|
1672
1690
|
}
|
1673
1691
|
}
|
1674
1692
|
|
1675
|
-
this.
|
1693
|
+
this._initializeChildren();
|
1676
1694
|
|
1677
1695
|
if (!this._config.parent) {
|
1678
|
-
this._addAriaAndCollapsedClass(this.
|
1696
|
+
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
1679
1697
|
}
|
1680
1698
|
|
1681
1699
|
if (this._config.toggle) {
|
@@ -1685,16 +1703,16 @@
|
|
1685
1703
|
|
1686
1704
|
|
1687
1705
|
static get Default() {
|
1688
|
-
return Default$
|
1706
|
+
return Default$9;
|
1689
1707
|
}
|
1690
1708
|
|
1691
1709
|
static get NAME() {
|
1692
|
-
return NAME$
|
1710
|
+
return NAME$a;
|
1693
1711
|
} // Public
|
1694
1712
|
|
1695
1713
|
|
1696
1714
|
toggle() {
|
1697
|
-
if (this.
|
1715
|
+
if (this._isShown()) {
|
1698
1716
|
this.hide();
|
1699
1717
|
} else {
|
1700
1718
|
this.show();
|
@@ -1702,30 +1720,21 @@
|
|
1702
1720
|
}
|
1703
1721
|
|
1704
1722
|
show() {
|
1705
|
-
if (this._isTransitioning || this.
|
1723
|
+
if (this._isTransitioning || this._isShown()) {
|
1706
1724
|
return;
|
1707
1725
|
}
|
1708
1726
|
|
1709
|
-
let actives;
|
1727
|
+
let actives = [];
|
1710
1728
|
let activesData;
|
1711
1729
|
|
1712
|
-
if (this.
|
1713
|
-
|
1714
|
-
|
1715
|
-
return elem.getAttribute('data-bs-parent') === this._config.parent;
|
1716
|
-
}
|
1717
|
-
|
1718
|
-
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
1719
|
-
});
|
1720
|
-
|
1721
|
-
if (actives.length === 0) {
|
1722
|
-
actives = null;
|
1723
|
-
}
|
1730
|
+
if (this._config.parent) {
|
1731
|
+
const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);
|
1732
|
+
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
1724
1733
|
}
|
1725
1734
|
|
1726
1735
|
const container = SelectorEngine.findOne(this._selector);
|
1727
1736
|
|
1728
|
-
if (actives) {
|
1737
|
+
if (actives.length) {
|
1729
1738
|
const tempActiveData = actives.find(elem => container !== elem);
|
1730
1739
|
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
1731
1740
|
|
@@ -1740,17 +1749,17 @@
|
|
1740
1749
|
return;
|
1741
1750
|
}
|
1742
1751
|
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
}
|
1752
|
+
actives.forEach(elemActive => {
|
1753
|
+
if (container !== elemActive) {
|
1754
|
+
Collapse.getOrCreateInstance(elemActive, {
|
1755
|
+
toggle: false
|
1756
|
+
}).hide();
|
1757
|
+
}
|
1748
1758
|
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
}
|
1759
|
+
if (!activesData) {
|
1760
|
+
Data.set(elemActive, DATA_KEY$9, null);
|
1761
|
+
}
|
1762
|
+
});
|
1754
1763
|
|
1755
1764
|
const dimension = this._getDimension();
|
1756
1765
|
|
@@ -1760,22 +1769,18 @@
|
|
1760
1769
|
|
1761
1770
|
this._element.style[dimension] = 0;
|
1762
1771
|
|
1763
|
-
|
1764
|
-
this._triggerArray.forEach(element => {
|
1765
|
-
element.classList.remove(CLASS_NAME_COLLAPSED);
|
1766
|
-
element.setAttribute('aria-expanded', true);
|
1767
|
-
});
|
1768
|
-
}
|
1772
|
+
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
1769
1773
|
|
1770
|
-
this.
|
1774
|
+
this._isTransitioning = true;
|
1771
1775
|
|
1772
1776
|
const complete = () => {
|
1777
|
+
this._isTransitioning = false;
|
1778
|
+
|
1773
1779
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
1774
1780
|
|
1775
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
1781
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
|
1776
1782
|
|
1777
1783
|
this._element.style[dimension] = '';
|
1778
|
-
this.setTransitioning(false);
|
1779
1784
|
EventHandler.trigger(this._element, EVENT_SHOWN$5);
|
1780
1785
|
};
|
1781
1786
|
|
@@ -1788,7 +1793,7 @@
|
|
1788
1793
|
}
|
1789
1794
|
|
1790
1795
|
hide() {
|
1791
|
-
if (this._isTransitioning || !this.
|
1796
|
+
if (this._isTransitioning || !this._isShown()) {
|
1792
1797
|
return;
|
1793
1798
|
}
|
1794
1799
|
|
@@ -1805,26 +1810,23 @@
|
|
1805
1810
|
|
1806
1811
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
1807
1812
|
|
1808
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
1813
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
|
1809
1814
|
|
1810
1815
|
const triggerArrayLength = this._triggerArray.length;
|
1811
1816
|
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
const elem = getElementFromSelector(trigger);
|
1817
|
+
for (let i = 0; i < triggerArrayLength; i++) {
|
1818
|
+
const trigger = this._triggerArray[i];
|
1819
|
+
const elem = getElementFromSelector(trigger);
|
1816
1820
|
|
1817
|
-
|
1818
|
-
|
1819
|
-
trigger.setAttribute('aria-expanded', false);
|
1820
|
-
}
|
1821
|
+
if (elem && !this._isShown(elem)) {
|
1822
|
+
this._addAriaAndCollapsedClass([trigger], false);
|
1821
1823
|
}
|
1822
1824
|
}
|
1823
1825
|
|
1824
|
-
this.
|
1826
|
+
this._isTransitioning = true;
|
1825
1827
|
|
1826
1828
|
const complete = () => {
|
1827
|
-
this.
|
1829
|
+
this._isTransitioning = false;
|
1828
1830
|
|
1829
1831
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
1830
1832
|
|
@@ -1838,45 +1840,47 @@
|
|
1838
1840
|
this._queueCallback(complete, this._element, true);
|
1839
1841
|
}
|
1840
1842
|
|
1841
|
-
|
1842
|
-
|
1843
|
+
_isShown(element = this._element) {
|
1844
|
+
return element.classList.contains(CLASS_NAME_SHOW$7);
|
1843
1845
|
} // Private
|
1844
1846
|
|
1845
1847
|
|
1846
1848
|
_getConfig(config) {
|
1847
|
-
config = { ...Default$
|
1849
|
+
config = { ...Default$9,
|
1850
|
+
...Manipulator.getDataAttributes(this._element),
|
1848
1851
|
...config
|
1849
1852
|
};
|
1850
1853
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
1851
1854
|
|
1852
|
-
|
1855
|
+
config.parent = getElement(config.parent);
|
1856
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
1853
1857
|
return config;
|
1854
1858
|
}
|
1855
1859
|
|
1856
1860
|
_getDimension() {
|
1857
|
-
return this._element.classList.contains(
|
1861
|
+
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
1858
1862
|
}
|
1859
1863
|
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
}
|
1864
|
-
|
1865
|
-
const
|
1866
|
-
SelectorEngine.find(
|
1864
|
+
_initializeChildren() {
|
1865
|
+
if (!this._config.parent) {
|
1866
|
+
return;
|
1867
|
+
}
|
1868
|
+
|
1869
|
+
const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);
|
1870
|
+
SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
1867
1871
|
const selected = getElementFromSelector(element);
|
1868
1872
|
|
1869
|
-
|
1873
|
+
if (selected) {
|
1874
|
+
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
1875
|
+
}
|
1870
1876
|
});
|
1871
|
-
return parent;
|
1872
1877
|
}
|
1873
1878
|
|
1874
|
-
_addAriaAndCollapsedClass(
|
1875
|
-
if (!
|
1879
|
+
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
1880
|
+
if (!triggerArray.length) {
|
1876
1881
|
return;
|
1877
1882
|
}
|
1878
1883
|
|
1879
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$8);
|
1880
1884
|
triggerArray.forEach(elem => {
|
1881
1885
|
if (isOpen) {
|
1882
1886
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
@@ -1889,33 +1893,23 @@
|
|
1889
1893
|
} // Static
|
1890
1894
|
|
1891
1895
|
|
1892
|
-
static
|
1893
|
-
|
1894
|
-
|
1895
|
-
...Manipulator.getDataAttributes(element),
|
1896
|
-
...(typeof config === 'object' && config ? config : {})
|
1897
|
-
};
|
1898
|
-
|
1899
|
-
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
1900
|
-
_config.toggle = false;
|
1901
|
-
}
|
1902
|
-
|
1903
|
-
if (!data) {
|
1904
|
-
data = new Collapse(element, _config);
|
1905
|
-
}
|
1896
|
+
static jQueryInterface(config) {
|
1897
|
+
return this.each(function () {
|
1898
|
+
const _config = {};
|
1906
1899
|
|
1907
|
-
|
1908
|
-
|
1909
|
-
throw new TypeError(`No method named "${config}"`);
|
1900
|
+
if (typeof config === 'string' && /show|hide/.test(config)) {
|
1901
|
+
_config.toggle = false;
|
1910
1902
|
}
|
1911
1903
|
|
1912
|
-
data
|
1913
|
-
}
|
1914
|
-
}
|
1904
|
+
const data = Collapse.getOrCreateInstance(this, _config);
|
1915
1905
|
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1906
|
+
if (typeof config === 'string') {
|
1907
|
+
if (typeof data[config] === 'undefined') {
|
1908
|
+
throw new TypeError(`No method named "${config}"`);
|
1909
|
+
}
|
1910
|
+
|
1911
|
+
data[config]();
|
1912
|
+
}
|
1919
1913
|
});
|
1920
1914
|
}
|
1921
1915
|
|
@@ -1933,26 +1927,12 @@
|
|
1933
1927
|
event.preventDefault();
|
1934
1928
|
}
|
1935
1929
|
|
1936
|
-
const triggerData = Manipulator.getDataAttributes(this);
|
1937
1930
|
const selector = getSelectorFromElement(this);
|
1938
1931
|
const selectorElements = SelectorEngine.find(selector);
|
1939
1932
|
selectorElements.forEach(element => {
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
if (data) {
|
1944
|
-
// update parent attribute
|
1945
|
-
if (data._parent === null && typeof triggerData.parent === 'string') {
|
1946
|
-
data._config.parent = triggerData.parent;
|
1947
|
-
data._parent = data._getParent();
|
1948
|
-
}
|
1949
|
-
|
1950
|
-
config = 'toggle';
|
1951
|
-
} else {
|
1952
|
-
config = triggerData;
|
1953
|
-
}
|
1954
|
-
|
1955
|
-
Collapse.collapseInterface(element, config);
|
1933
|
+
Collapse.getOrCreateInstance(element, {
|
1934
|
+
toggle: false
|
1935
|
+
}).toggle();
|
1956
1936
|
});
|
1957
1937
|
});
|
1958
1938
|
/**
|
@@ -1966,7 +1946,7 @@
|
|
1966
1946
|
|
1967
1947
|
/**
|
1968
1948
|
* --------------------------------------------------------------------------
|
1969
|
-
* Bootstrap (v5.0
|
1949
|
+
* Bootstrap (v5.1.0): dropdown.js
|
1970
1950
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
1971
1951
|
* --------------------------------------------------------------------------
|
1972
1952
|
*/
|
@@ -1976,27 +1956,26 @@
|
|
1976
1956
|
* ------------------------------------------------------------------------
|
1977
1957
|
*/
|
1978
1958
|
|
1979
|
-
const NAME$
|
1980
|
-
const DATA_KEY$
|
1981
|
-
const EVENT_KEY$
|
1959
|
+
const NAME$9 = 'dropdown';
|
1960
|
+
const DATA_KEY$8 = 'bs.dropdown';
|
1961
|
+
const EVENT_KEY$8 = `.${DATA_KEY$8}`;
|
1982
1962
|
const DATA_API_KEY$4 = '.data-api';
|
1983
1963
|
const ESCAPE_KEY$2 = 'Escape';
|
1984
1964
|
const SPACE_KEY = 'Space';
|
1985
|
-
const TAB_KEY = 'Tab';
|
1965
|
+
const TAB_KEY$1 = 'Tab';
|
1986
1966
|
const ARROW_UP_KEY = 'ArrowUp';
|
1987
1967
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
1988
1968
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
1989
1969
|
|
1990
1970
|
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
|
1991
|
-
const EVENT_HIDE$4 = `hide${EVENT_KEY$
|
1992
|
-
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$
|
1993
|
-
const EVENT_SHOW$4 = `show${EVENT_KEY$
|
1994
|
-
const EVENT_SHOWN$4 = `shown${EVENT_KEY$
|
1995
|
-
const
|
1996
|
-
const
|
1997
|
-
const
|
1998
|
-
const
|
1999
|
-
const CLASS_NAME_SHOW$7 = 'show';
|
1971
|
+
const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`;
|
1972
|
+
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
|
1973
|
+
const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
|
1974
|
+
const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
|
1975
|
+
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`;
|
1976
|
+
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`;
|
1977
|
+
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`;
|
1978
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
2000
1979
|
const CLASS_NAME_DROPUP = 'dropup';
|
2001
1980
|
const CLASS_NAME_DROPEND = 'dropend';
|
2002
1981
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
@@ -2011,7 +1990,7 @@
|
|
2011
1990
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
2012
1991
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
2013
1992
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
2014
|
-
const Default$
|
1993
|
+
const Default$8 = {
|
2015
1994
|
offset: [0, 2],
|
2016
1995
|
boundary: 'clippingParents',
|
2017
1996
|
reference: 'toggle',
|
@@ -2019,7 +1998,7 @@
|
|
2019
1998
|
popperConfig: null,
|
2020
1999
|
autoClose: true
|
2021
2000
|
};
|
2022
|
-
const DefaultType$
|
2001
|
+
const DefaultType$8 = {
|
2023
2002
|
offset: '(array|string|function)',
|
2024
2003
|
boundary: '(string|element)',
|
2025
2004
|
reference: '(string|element|object)',
|
@@ -2040,45 +2019,31 @@
|
|
2040
2019
|
this._config = this._getConfig(config);
|
2041
2020
|
this._menu = this._getMenuElement();
|
2042
2021
|
this._inNavbar = this._detectNavbar();
|
2043
|
-
|
2044
|
-
this._addEventListeners();
|
2045
2022
|
} // Getters
|
2046
2023
|
|
2047
2024
|
|
2048
2025
|
static get Default() {
|
2049
|
-
return Default$
|
2026
|
+
return Default$8;
|
2050
2027
|
}
|
2051
2028
|
|
2052
2029
|
static get DefaultType() {
|
2053
|
-
return DefaultType$
|
2030
|
+
return DefaultType$8;
|
2054
2031
|
}
|
2055
2032
|
|
2056
2033
|
static get NAME() {
|
2057
|
-
return NAME$
|
2034
|
+
return NAME$9;
|
2058
2035
|
} // Public
|
2059
2036
|
|
2060
2037
|
|
2061
2038
|
toggle() {
|
2062
|
-
|
2063
|
-
return;
|
2064
|
-
}
|
2065
|
-
|
2066
|
-
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$7);
|
2067
|
-
|
2068
|
-
if (isActive) {
|
2069
|
-
this.hide();
|
2070
|
-
return;
|
2071
|
-
}
|
2072
|
-
|
2073
|
-
this.show();
|
2039
|
+
return this._isShown() ? this.hide() : this.show();
|
2074
2040
|
}
|
2075
2041
|
|
2076
2042
|
show() {
|
2077
|
-
if (isDisabled(this._element) || this._menu
|
2043
|
+
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
2078
2044
|
return;
|
2079
2045
|
}
|
2080
2046
|
|
2081
|
-
const parent = Dropdown.getParentFromElement(this._element);
|
2082
2047
|
const relatedTarget = {
|
2083
2048
|
relatedTarget: this._element
|
2084
2049
|
};
|
@@ -2086,34 +2051,14 @@
|
|
2086
2051
|
|
2087
2052
|
if (showEvent.defaultPrevented) {
|
2088
2053
|
return;
|
2089
|
-
}
|
2054
|
+
}
|
2090
2055
|
|
2056
|
+
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
2091
2057
|
|
2092
2058
|
if (this._inNavbar) {
|
2093
2059
|
Manipulator.setDataAttribute(this._menu, 'popper', 'none');
|
2094
2060
|
} else {
|
2095
|
-
|
2096
|
-
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
2097
|
-
}
|
2098
|
-
|
2099
|
-
let referenceElement = this._element;
|
2100
|
-
|
2101
|
-
if (this._config.reference === 'parent') {
|
2102
|
-
referenceElement = parent;
|
2103
|
-
} else if (isElement(this._config.reference)) {
|
2104
|
-
referenceElement = getElement(this._config.reference);
|
2105
|
-
} else if (typeof this._config.reference === 'object') {
|
2106
|
-
referenceElement = this._config.reference;
|
2107
|
-
}
|
2108
|
-
|
2109
|
-
const popperConfig = this._getPopperConfig();
|
2110
|
-
|
2111
|
-
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
2112
|
-
this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
|
2113
|
-
|
2114
|
-
if (isDisplayStatic) {
|
2115
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
2116
|
-
}
|
2061
|
+
this._createPopper(parent);
|
2117
2062
|
} // If this is a touch-enabled device we add extra
|
2118
2063
|
// empty mouseover listeners to the body's immediate children;
|
2119
2064
|
// only needed because of broken event delegation on iOS
|
@@ -2128,15 +2073,15 @@
|
|
2128
2073
|
|
2129
2074
|
this._element.setAttribute('aria-expanded', true);
|
2130
2075
|
|
2131
|
-
this._menu.classList.
|
2076
|
+
this._menu.classList.add(CLASS_NAME_SHOW$6);
|
2132
2077
|
|
2133
|
-
this._element.classList.
|
2078
|
+
this._element.classList.add(CLASS_NAME_SHOW$6);
|
2134
2079
|
|
2135
2080
|
EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);
|
2136
2081
|
}
|
2137
2082
|
|
2138
2083
|
hide() {
|
2139
|
-
if (isDisabled(this._element) || !this._menu
|
2084
|
+
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
2140
2085
|
return;
|
2141
2086
|
}
|
2142
2087
|
|
@@ -2164,13 +2109,6 @@
|
|
2164
2109
|
} // Private
|
2165
2110
|
|
2166
2111
|
|
2167
|
-
_addEventListeners() {
|
2168
|
-
EventHandler.on(this._element, EVENT_CLICK, event => {
|
2169
|
-
event.preventDefault();
|
2170
|
-
this.toggle();
|
2171
|
-
});
|
2172
|
-
}
|
2173
|
-
|
2174
2112
|
_completeHide(relatedTarget) {
|
2175
2113
|
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
|
2176
2114
|
|
@@ -2188,9 +2126,9 @@
|
|
2188
2126
|
this._popper.destroy();
|
2189
2127
|
}
|
2190
2128
|
|
2191
|
-
this._menu.classList.remove(CLASS_NAME_SHOW$
|
2129
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$6);
|
2192
2130
|
|
2193
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
2131
|
+
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
2194
2132
|
|
2195
2133
|
this._element.setAttribute('aria-expanded', 'false');
|
2196
2134
|
|
@@ -2203,16 +2141,45 @@
|
|
2203
2141
|
...Manipulator.getDataAttributes(this._element),
|
2204
2142
|
...config
|
2205
2143
|
};
|
2206
|
-
typeCheckConfig(NAME$
|
2144
|
+
typeCheckConfig(NAME$9, config, this.constructor.DefaultType);
|
2207
2145
|
|
2208
2146
|
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
2209
2147
|
// Popper virtual elements require a getBoundingClientRect method
|
2210
|
-
throw new TypeError(`${NAME$
|
2148
|
+
throw new TypeError(`${NAME$9.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
2211
2149
|
}
|
2212
2150
|
|
2213
2151
|
return config;
|
2214
2152
|
}
|
2215
2153
|
|
2154
|
+
_createPopper(parent) {
|
2155
|
+
if (typeof Popper__namespace === 'undefined') {
|
2156
|
+
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
2157
|
+
}
|
2158
|
+
|
2159
|
+
let referenceElement = this._element;
|
2160
|
+
|
2161
|
+
if (this._config.reference === 'parent') {
|
2162
|
+
referenceElement = parent;
|
2163
|
+
} else if (isElement(this._config.reference)) {
|
2164
|
+
referenceElement = getElement(this._config.reference);
|
2165
|
+
} else if (typeof this._config.reference === 'object') {
|
2166
|
+
referenceElement = this._config.reference;
|
2167
|
+
}
|
2168
|
+
|
2169
|
+
const popperConfig = this._getPopperConfig();
|
2170
|
+
|
2171
|
+
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
2172
|
+
this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
|
2173
|
+
|
2174
|
+
if (isDisplayStatic) {
|
2175
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
2176
|
+
}
|
2177
|
+
}
|
2178
|
+
|
2179
|
+
_isShown(element = this._element) {
|
2180
|
+
return element.classList.contains(CLASS_NAME_SHOW$6);
|
2181
|
+
}
|
2182
|
+
|
2216
2183
|
_getMenuElement() {
|
2217
2184
|
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
|
2218
2185
|
}
|
@@ -2302,26 +2269,24 @@
|
|
2302
2269
|
} // Static
|
2303
2270
|
|
2304
2271
|
|
2305
|
-
static
|
2306
|
-
|
2272
|
+
static jQueryInterface(config) {
|
2273
|
+
return this.each(function () {
|
2274
|
+
const data = Dropdown.getOrCreateInstance(this, config);
|
2275
|
+
|
2276
|
+
if (typeof config !== 'string') {
|
2277
|
+
return;
|
2278
|
+
}
|
2307
2279
|
|
2308
|
-
if (typeof config === 'string') {
|
2309
2280
|
if (typeof data[config] === 'undefined') {
|
2310
2281
|
throw new TypeError(`No method named "${config}"`);
|
2311
2282
|
}
|
2312
2283
|
|
2313
2284
|
data[config]();
|
2314
|
-
}
|
2315
|
-
}
|
2316
|
-
|
2317
|
-
static jQueryInterface(config) {
|
2318
|
-
return this.each(function () {
|
2319
|
-
Dropdown.dropdownInterface(this, config);
|
2320
2285
|
});
|
2321
2286
|
}
|
2322
2287
|
|
2323
2288
|
static clearMenus(event) {
|
2324
|
-
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
2289
|
+
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
|
2325
2290
|
return;
|
2326
2291
|
}
|
2327
2292
|
|
@@ -2334,7 +2299,7 @@
|
|
2334
2299
|
continue;
|
2335
2300
|
}
|
2336
2301
|
|
2337
|
-
if (!context.
|
2302
|
+
if (!context._isShown()) {
|
2338
2303
|
continue;
|
2339
2304
|
}
|
2340
2305
|
|
@@ -2351,7 +2316,7 @@
|
|
2351
2316
|
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
2352
2317
|
|
2353
2318
|
|
2354
|
-
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
2319
|
+
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
2355
2320
|
continue;
|
2356
2321
|
}
|
2357
2322
|
|
@@ -2380,7 +2345,7 @@
|
|
2380
2345
|
return;
|
2381
2346
|
}
|
2382
2347
|
|
2383
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$
|
2348
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$6);
|
2384
2349
|
|
2385
2350
|
if (!isActive && event.key === ESCAPE_KEY$2) {
|
2386
2351
|
return;
|
@@ -2393,20 +2358,20 @@
|
|
2393
2358
|
return;
|
2394
2359
|
}
|
2395
2360
|
|
2396
|
-
const getToggleButton =
|
2361
|
+
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
|
2362
|
+
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
2397
2363
|
|
2398
2364
|
if (event.key === ESCAPE_KEY$2) {
|
2399
|
-
|
2400
|
-
Dropdown.clearMenus();
|
2365
|
+
instance.hide();
|
2401
2366
|
return;
|
2402
2367
|
}
|
2403
2368
|
|
2404
2369
|
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
2405
2370
|
if (!isActive) {
|
2406
|
-
|
2371
|
+
instance.show();
|
2407
2372
|
}
|
2408
2373
|
|
2409
|
-
|
2374
|
+
instance._selectMenuItem(event);
|
2410
2375
|
|
2411
2376
|
return;
|
2412
2377
|
}
|
@@ -2430,7 +2395,7 @@
|
|
2430
2395
|
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
2431
2396
|
EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {
|
2432
2397
|
event.preventDefault();
|
2433
|
-
Dropdown.
|
2398
|
+
Dropdown.getOrCreateInstance(this).toggle();
|
2434
2399
|
});
|
2435
2400
|
/**
|
2436
2401
|
* ------------------------------------------------------------------------
|
@@ -2443,7 +2408,7 @@
|
|
2443
2408
|
|
2444
2409
|
/**
|
2445
2410
|
* --------------------------------------------------------------------------
|
2446
|
-
* Bootstrap (v5.0
|
2411
|
+
* Bootstrap (v5.1.0): util/scrollBar.js
|
2447
2412
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2448
2413
|
* --------------------------------------------------------------------------
|
2449
2414
|
*/
|
@@ -2547,11 +2512,12 @@
|
|
2547
2512
|
|
2548
2513
|
/**
|
2549
2514
|
* --------------------------------------------------------------------------
|
2550
|
-
* Bootstrap (v5.0
|
2515
|
+
* Bootstrap (v5.1.0): util/backdrop.js
|
2551
2516
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2552
2517
|
* --------------------------------------------------------------------------
|
2553
2518
|
*/
|
2554
|
-
const Default$
|
2519
|
+
const Default$7 = {
|
2520
|
+
className: 'modal-backdrop',
|
2555
2521
|
isVisible: true,
|
2556
2522
|
// if false, we use the backdrop helper without adding any element to the dom
|
2557
2523
|
isAnimated: false,
|
@@ -2559,17 +2525,17 @@
|
|
2559
2525
|
// give the choice to place backdrop under different elements
|
2560
2526
|
clickCallback: null
|
2561
2527
|
};
|
2562
|
-
const DefaultType$
|
2528
|
+
const DefaultType$7 = {
|
2529
|
+
className: 'string',
|
2563
2530
|
isVisible: 'boolean',
|
2564
2531
|
isAnimated: 'boolean',
|
2565
2532
|
rootElement: '(element|string)',
|
2566
2533
|
clickCallback: '(function|null)'
|
2567
2534
|
};
|
2568
|
-
const NAME$
|
2569
|
-
const
|
2570
|
-
const
|
2571
|
-
const
|
2572
|
-
const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$7}`;
|
2535
|
+
const NAME$8 = 'backdrop';
|
2536
|
+
const CLASS_NAME_FADE$4 = 'fade';
|
2537
|
+
const CLASS_NAME_SHOW$5 = 'show';
|
2538
|
+
const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`;
|
2573
2539
|
|
2574
2540
|
class Backdrop {
|
2575
2541
|
constructor(config) {
|
@@ -2590,7 +2556,7 @@
|
|
2590
2556
|
reflow(this._getElement());
|
2591
2557
|
}
|
2592
2558
|
|
2593
|
-
this._getElement().classList.add(CLASS_NAME_SHOW$
|
2559
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$5);
|
2594
2560
|
|
2595
2561
|
this._emulateAnimation(() => {
|
2596
2562
|
execute(callback);
|
@@ -2603,7 +2569,7 @@
|
|
2603
2569
|
return;
|
2604
2570
|
}
|
2605
2571
|
|
2606
|
-
this._getElement().classList.remove(CLASS_NAME_SHOW$
|
2572
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$5);
|
2607
2573
|
|
2608
2574
|
this._emulateAnimation(() => {
|
2609
2575
|
this.dispose();
|
@@ -2615,10 +2581,10 @@
|
|
2615
2581
|
_getElement() {
|
2616
2582
|
if (!this._element) {
|
2617
2583
|
const backdrop = document.createElement('div');
|
2618
|
-
backdrop.className =
|
2584
|
+
backdrop.className = this._config.className;
|
2619
2585
|
|
2620
2586
|
if (this._config.isAnimated) {
|
2621
|
-
backdrop.classList.add(CLASS_NAME_FADE$
|
2587
|
+
backdrop.classList.add(CLASS_NAME_FADE$4);
|
2622
2588
|
}
|
2623
2589
|
|
2624
2590
|
this._element = backdrop;
|
@@ -2628,12 +2594,12 @@
|
|
2628
2594
|
}
|
2629
2595
|
|
2630
2596
|
_getConfig(config) {
|
2631
|
-
config = { ...Default$
|
2597
|
+
config = { ...Default$7,
|
2632
2598
|
...(typeof config === 'object' ? config : {})
|
2633
2599
|
}; // use getElement() with the default "body" to get a fresh Element on each instantiation
|
2634
2600
|
|
2635
2601
|
config.rootElement = getElement(config.rootElement);
|
2636
|
-
typeCheckConfig(NAME$
|
2602
|
+
typeCheckConfig(NAME$8, config, DefaultType$7);
|
2637
2603
|
return config;
|
2638
2604
|
}
|
2639
2605
|
|
@@ -2642,7 +2608,7 @@
|
|
2642
2608
|
return;
|
2643
2609
|
}
|
2644
2610
|
|
2645
|
-
this._config.rootElement.
|
2611
|
+
this._config.rootElement.append(this._getElement());
|
2646
2612
|
|
2647
2613
|
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
2648
2614
|
execute(this._config.clickCallback);
|
@@ -2670,7 +2636,110 @@
|
|
2670
2636
|
|
2671
2637
|
/**
|
2672
2638
|
* --------------------------------------------------------------------------
|
2673
|
-
* Bootstrap (v5.0
|
2639
|
+
* Bootstrap (v5.1.0): util/focustrap.js
|
2640
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2641
|
+
* --------------------------------------------------------------------------
|
2642
|
+
*/
|
2643
|
+
const Default$6 = {
|
2644
|
+
trapElement: null,
|
2645
|
+
// The element to trap focus inside of
|
2646
|
+
autofocus: true
|
2647
|
+
};
|
2648
|
+
const DefaultType$6 = {
|
2649
|
+
trapElement: 'element',
|
2650
|
+
autofocus: 'boolean'
|
2651
|
+
};
|
2652
|
+
const NAME$7 = 'focustrap';
|
2653
|
+
const DATA_KEY$7 = 'bs.focustrap';
|
2654
|
+
const EVENT_KEY$7 = `.${DATA_KEY$7}`;
|
2655
|
+
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`;
|
2656
|
+
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;
|
2657
|
+
const TAB_KEY = 'Tab';
|
2658
|
+
const TAB_NAV_FORWARD = 'forward';
|
2659
|
+
const TAB_NAV_BACKWARD = 'backward';
|
2660
|
+
|
2661
|
+
class FocusTrap {
|
2662
|
+
constructor(config) {
|
2663
|
+
this._config = this._getConfig(config);
|
2664
|
+
this._isActive = false;
|
2665
|
+
this._lastTabNavDirection = null;
|
2666
|
+
}
|
2667
|
+
|
2668
|
+
activate() {
|
2669
|
+
const {
|
2670
|
+
trapElement,
|
2671
|
+
autofocus
|
2672
|
+
} = this._config;
|
2673
|
+
|
2674
|
+
if (this._isActive) {
|
2675
|
+
return;
|
2676
|
+
}
|
2677
|
+
|
2678
|
+
if (autofocus) {
|
2679
|
+
trapElement.focus();
|
2680
|
+
}
|
2681
|
+
|
2682
|
+
EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop
|
2683
|
+
|
2684
|
+
EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
|
2685
|
+
EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
|
2686
|
+
this._isActive = true;
|
2687
|
+
}
|
2688
|
+
|
2689
|
+
deactivate() {
|
2690
|
+
if (!this._isActive) {
|
2691
|
+
return;
|
2692
|
+
}
|
2693
|
+
|
2694
|
+
this._isActive = false;
|
2695
|
+
EventHandler.off(document, EVENT_KEY$7);
|
2696
|
+
} // Private
|
2697
|
+
|
2698
|
+
|
2699
|
+
_handleFocusin(event) {
|
2700
|
+
const {
|
2701
|
+
target
|
2702
|
+
} = event;
|
2703
|
+
const {
|
2704
|
+
trapElement
|
2705
|
+
} = this._config;
|
2706
|
+
|
2707
|
+
if (target === document || target === trapElement || trapElement.contains(target)) {
|
2708
|
+
return;
|
2709
|
+
}
|
2710
|
+
|
2711
|
+
const elements = SelectorEngine.focusableChildren(trapElement);
|
2712
|
+
|
2713
|
+
if (elements.length === 0) {
|
2714
|
+
trapElement.focus();
|
2715
|
+
} else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
|
2716
|
+
elements[elements.length - 1].focus();
|
2717
|
+
} else {
|
2718
|
+
elements[0].focus();
|
2719
|
+
}
|
2720
|
+
}
|
2721
|
+
|
2722
|
+
_handleKeydown(event) {
|
2723
|
+
if (event.key !== TAB_KEY) {
|
2724
|
+
return;
|
2725
|
+
}
|
2726
|
+
|
2727
|
+
this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
|
2728
|
+
}
|
2729
|
+
|
2730
|
+
_getConfig(config) {
|
2731
|
+
config = { ...Default$6,
|
2732
|
+
...(typeof config === 'object' ? config : {})
|
2733
|
+
};
|
2734
|
+
typeCheckConfig(NAME$7, config, DefaultType$6);
|
2735
|
+
return config;
|
2736
|
+
}
|
2737
|
+
|
2738
|
+
}
|
2739
|
+
|
2740
|
+
/**
|
2741
|
+
* --------------------------------------------------------------------------
|
2742
|
+
* Bootstrap (v5.1.0): modal.js
|
2674
2743
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2675
2744
|
* --------------------------------------------------------------------------
|
2676
2745
|
*/
|
@@ -2700,21 +2769,19 @@
|
|
2700
2769
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
2701
2770
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
2702
2771
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
2703
|
-
const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`;
|
2704
2772
|
const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
|
2705
|
-
const EVENT_CLICK_DISMISS
|
2773
|
+
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;
|
2706
2774
|
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
|
2707
2775
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;
|
2708
2776
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
|
2709
2777
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
2710
2778
|
const CLASS_NAME_OPEN = 'modal-open';
|
2711
|
-
const CLASS_NAME_FADE$
|
2712
|
-
const CLASS_NAME_SHOW$
|
2779
|
+
const CLASS_NAME_FADE$3 = 'fade';
|
2780
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
2713
2781
|
const CLASS_NAME_STATIC = 'modal-static';
|
2714
2782
|
const SELECTOR_DIALOG = '.modal-dialog';
|
2715
2783
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
2716
2784
|
const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
|
2717
|
-
const SELECTOR_DATA_DISMISS$2 = '[data-bs-dismiss="modal"]';
|
2718
2785
|
/**
|
2719
2786
|
* ------------------------------------------------------------------------
|
2720
2787
|
* Class Definition
|
@@ -2727,6 +2794,7 @@
|
|
2727
2794
|
this._config = this._getConfig(config);
|
2728
2795
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
2729
2796
|
this._backdrop = this._initializeBackDrop();
|
2797
|
+
this._focustrap = this._initializeFocusTrap();
|
2730
2798
|
this._isShown = false;
|
2731
2799
|
this._ignoreBackdropClick = false;
|
2732
2800
|
this._isTransitioning = false;
|
@@ -2776,7 +2844,6 @@
|
|
2776
2844
|
|
2777
2845
|
this._setResizeEvent();
|
2778
2846
|
|
2779
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
|
2780
2847
|
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
|
2781
2848
|
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
|
2782
2849
|
if (event.target === this._element) {
|
@@ -2788,11 +2855,7 @@
|
|
2788
2855
|
this._showBackdrop(() => this._showElement(relatedTarget));
|
2789
2856
|
}
|
2790
2857
|
|
2791
|
-
hide(
|
2792
|
-
if (event && ['A', 'AREA'].includes(event.target.tagName)) {
|
2793
|
-
event.preventDefault();
|
2794
|
-
}
|
2795
|
-
|
2858
|
+
hide() {
|
2796
2859
|
if (!this._isShown || this._isTransitioning) {
|
2797
2860
|
return;
|
2798
2861
|
}
|
@@ -2815,11 +2878,11 @@
|
|
2815
2878
|
|
2816
2879
|
this._setResizeEvent();
|
2817
2880
|
|
2818
|
-
|
2881
|
+
this._focustrap.deactivate();
|
2819
2882
|
|
2820
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
2883
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
2821
2884
|
|
2822
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS
|
2885
|
+
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
2823
2886
|
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
|
2824
2887
|
|
2825
2888
|
this._queueCallback(() => this._hideModal(), this._element, isAnimated);
|
@@ -2830,14 +2893,9 @@
|
|
2830
2893
|
|
2831
2894
|
this._backdrop.dispose();
|
2832
2895
|
|
2833
|
-
|
2834
|
-
/**
|
2835
|
-
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
2836
|
-
* Do not move `document` in `htmlElements` array
|
2837
|
-
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
2838
|
-
*/
|
2896
|
+
this._focustrap.deactivate();
|
2839
2897
|
|
2840
|
-
|
2898
|
+
super.dispose();
|
2841
2899
|
}
|
2842
2900
|
|
2843
2901
|
handleUpdate() {
|
@@ -2853,6 +2911,12 @@
|
|
2853
2911
|
});
|
2854
2912
|
}
|
2855
2913
|
|
2914
|
+
_initializeFocusTrap() {
|
2915
|
+
return new FocusTrap({
|
2916
|
+
trapElement: this._element
|
2917
|
+
});
|
2918
|
+
}
|
2919
|
+
|
2856
2920
|
_getConfig(config) {
|
2857
2921
|
config = { ...Default$5,
|
2858
2922
|
...Manipulator.getDataAttributes(this._element),
|
@@ -2869,7 +2933,7 @@
|
|
2869
2933
|
|
2870
2934
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
2871
2935
|
// Don't move modal's DOM position
|
2872
|
-
document.body.
|
2936
|
+
document.body.append(this._element);
|
2873
2937
|
}
|
2874
2938
|
|
2875
2939
|
this._element.style.display = 'block';
|
@@ -2890,15 +2954,11 @@
|
|
2890
2954
|
reflow(this._element);
|
2891
2955
|
}
|
2892
2956
|
|
2893
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
2894
|
-
|
2895
|
-
if (this._config.focus) {
|
2896
|
-
this._enforceFocus();
|
2897
|
-
}
|
2957
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
2898
2958
|
|
2899
2959
|
const transitionComplete = () => {
|
2900
2960
|
if (this._config.focus) {
|
2901
|
-
this.
|
2961
|
+
this._focustrap.activate();
|
2902
2962
|
}
|
2903
2963
|
|
2904
2964
|
this._isTransitioning = false;
|
@@ -2910,16 +2970,6 @@
|
|
2910
2970
|
this._queueCallback(transitionComplete, this._dialog, isAnimated);
|
2911
2971
|
}
|
2912
2972
|
|
2913
|
-
_enforceFocus() {
|
2914
|
-
EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
|
2915
|
-
|
2916
|
-
EventHandler.on(document, EVENT_FOCUSIN$2, event => {
|
2917
|
-
if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
|
2918
|
-
this._element.focus();
|
2919
|
-
}
|
2920
|
-
});
|
2921
|
-
}
|
2922
|
-
|
2923
2973
|
_setEscapeEvent() {
|
2924
2974
|
if (this._isShown) {
|
2925
2975
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
@@ -2966,7 +3016,7 @@
|
|
2966
3016
|
}
|
2967
3017
|
|
2968
3018
|
_showBackdrop(callback) {
|
2969
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS
|
3019
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
|
2970
3020
|
if (this._ignoreBackdropClick) {
|
2971
3021
|
this._ignoreBackdropClick = false;
|
2972
3022
|
return;
|
@@ -2987,7 +3037,7 @@
|
|
2987
3037
|
}
|
2988
3038
|
|
2989
3039
|
_isAnimated() {
|
2990
|
-
return this._element.classList.contains(CLASS_NAME_FADE$
|
3040
|
+
return this._element.classList.contains(CLASS_NAME_FADE$3);
|
2991
3041
|
}
|
2992
3042
|
|
2993
3043
|
_triggerBackdropTransition() {
|
@@ -3098,6 +3148,7 @@
|
|
3098
3148
|
const data = Modal.getOrCreateInstance(target);
|
3099
3149
|
data.toggle(this);
|
3100
3150
|
});
|
3151
|
+
enableDismissTrigger(Modal);
|
3101
3152
|
/**
|
3102
3153
|
* ------------------------------------------------------------------------
|
3103
3154
|
* jQuery
|
@@ -3109,7 +3160,7 @@
|
|
3109
3160
|
|
3110
3161
|
/**
|
3111
3162
|
* --------------------------------------------------------------------------
|
3112
|
-
* Bootstrap (v5.0
|
3163
|
+
* Bootstrap (v5.1.0): offcanvas.js
|
3113
3164
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
3114
3165
|
* --------------------------------------------------------------------------
|
3115
3166
|
*/
|
@@ -3135,17 +3186,15 @@
|
|
3135
3186
|
keyboard: 'boolean',
|
3136
3187
|
scroll: 'boolean'
|
3137
3188
|
};
|
3138
|
-
const CLASS_NAME_SHOW$
|
3189
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
3190
|
+
const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
|
3139
3191
|
const OPEN_SELECTOR = '.offcanvas.show';
|
3140
3192
|
const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;
|
3141
3193
|
const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
|
3142
3194
|
const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
|
3143
3195
|
const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;
|
3144
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$5}`;
|
3145
3196
|
const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
|
3146
|
-
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`;
|
3147
3197
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
|
3148
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="offcanvas"]';
|
3149
3198
|
const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
|
3150
3199
|
/**
|
3151
3200
|
* ------------------------------------------------------------------------
|
@@ -3159,6 +3208,7 @@
|
|
3159
3208
|
this._config = this._getConfig(config);
|
3160
3209
|
this._isShown = false;
|
3161
3210
|
this._backdrop = this._initializeBackDrop();
|
3211
|
+
this._focustrap = this._initializeFocusTrap();
|
3162
3212
|
|
3163
3213
|
this._addEventListeners();
|
3164
3214
|
} // Getters
|
@@ -3197,8 +3247,6 @@
|
|
3197
3247
|
|
3198
3248
|
if (!this._config.scroll) {
|
3199
3249
|
new ScrollBarHelper().hide();
|
3200
|
-
|
3201
|
-
this._enforceFocusOnElement(this._element);
|
3202
3250
|
}
|
3203
3251
|
|
3204
3252
|
this._element.removeAttribute('aria-hidden');
|
@@ -3207,9 +3255,13 @@
|
|
3207
3255
|
|
3208
3256
|
this._element.setAttribute('role', 'dialog');
|
3209
3257
|
|
3210
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
3258
|
+
this._element.classList.add(CLASS_NAME_SHOW$3);
|
3211
3259
|
|
3212
3260
|
const completeCallBack = () => {
|
3261
|
+
if (!this._config.scroll) {
|
3262
|
+
this._focustrap.activate();
|
3263
|
+
}
|
3264
|
+
|
3213
3265
|
EventHandler.trigger(this._element, EVENT_SHOWN$2, {
|
3214
3266
|
relatedTarget
|
3215
3267
|
});
|
@@ -3229,13 +3281,13 @@
|
|
3229
3281
|
return;
|
3230
3282
|
}
|
3231
3283
|
|
3232
|
-
|
3284
|
+
this._focustrap.deactivate();
|
3233
3285
|
|
3234
3286
|
this._element.blur();
|
3235
3287
|
|
3236
3288
|
this._isShown = false;
|
3237
3289
|
|
3238
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
3290
|
+
this._element.classList.remove(CLASS_NAME_SHOW$3);
|
3239
3291
|
|
3240
3292
|
this._backdrop.hide();
|
3241
3293
|
|
@@ -3261,8 +3313,9 @@
|
|
3261
3313
|
dispose() {
|
3262
3314
|
this._backdrop.dispose();
|
3263
3315
|
|
3316
|
+
this._focustrap.deactivate();
|
3317
|
+
|
3264
3318
|
super.dispose();
|
3265
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
3266
3319
|
} // Private
|
3267
3320
|
|
3268
3321
|
|
@@ -3277,6 +3330,7 @@
|
|
3277
3330
|
|
3278
3331
|
_initializeBackDrop() {
|
3279
3332
|
return new Backdrop({
|
3333
|
+
className: CLASS_NAME_BACKDROP,
|
3280
3334
|
isVisible: this._config.backdrop,
|
3281
3335
|
isAnimated: true,
|
3282
3336
|
rootElement: this._element.parentNode,
|
@@ -3284,19 +3338,13 @@
|
|
3284
3338
|
});
|
3285
3339
|
}
|
3286
3340
|
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3290
|
-
EventHandler.on(document, EVENT_FOCUSIN$1, event => {
|
3291
|
-
if (document !== event.target && element !== event.target && !element.contains(event.target)) {
|
3292
|
-
element.focus();
|
3293
|
-
}
|
3341
|
+
_initializeFocusTrap() {
|
3342
|
+
return new FocusTrap({
|
3343
|
+
trapElement: this._element
|
3294
3344
|
});
|
3295
|
-
element.focus();
|
3296
3345
|
}
|
3297
3346
|
|
3298
3347
|
_addEventListeners() {
|
3299
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
3300
3348
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
3301
3349
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
3302
3350
|
this.hide();
|
@@ -3357,6 +3405,7 @@
|
|
3357
3405
|
data.toggle(this);
|
3358
3406
|
});
|
3359
3407
|
EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
3408
|
+
enableDismissTrigger(Offcanvas);
|
3360
3409
|
/**
|
3361
3410
|
* ------------------------------------------------------------------------
|
3362
3411
|
* jQuery
|
@@ -3367,7 +3416,7 @@
|
|
3367
3416
|
|
3368
3417
|
/**
|
3369
3418
|
* --------------------------------------------------------------------------
|
3370
|
-
* Bootstrap (v5.0
|
3419
|
+
* Bootstrap (v5.1.0): util/sanitizer.js
|
3371
3420
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
3372
3421
|
* --------------------------------------------------------------------------
|
3373
3422
|
*/
|
@@ -3480,7 +3529,7 @@
|
|
3480
3529
|
|
3481
3530
|
/**
|
3482
3531
|
* --------------------------------------------------------------------------
|
3483
|
-
* Bootstrap (v5.0
|
3532
|
+
* Bootstrap (v5.1.0): tooltip.js
|
3484
3533
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
3485
3534
|
* --------------------------------------------------------------------------
|
3486
3535
|
*/
|
@@ -3494,7 +3543,6 @@
|
|
3494
3543
|
const DATA_KEY$4 = 'bs.tooltip';
|
3495
3544
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
3496
3545
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
3497
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
3498
3546
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
3499
3547
|
const DefaultType$3 = {
|
3500
3548
|
animation: 'boolean',
|
@@ -3553,12 +3601,14 @@
|
|
3553
3601
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
3554
3602
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
3555
3603
|
};
|
3556
|
-
const CLASS_NAME_FADE$
|
3604
|
+
const CLASS_NAME_FADE$2 = 'fade';
|
3557
3605
|
const CLASS_NAME_MODAL = 'modal';
|
3558
|
-
const CLASS_NAME_SHOW$
|
3606
|
+
const CLASS_NAME_SHOW$2 = 'show';
|
3559
3607
|
const HOVER_STATE_SHOW = 'show';
|
3560
3608
|
const HOVER_STATE_OUT = 'out';
|
3561
3609
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
3610
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
3611
|
+
const EVENT_MODAL_HIDE = 'hide.bs.modal';
|
3562
3612
|
const TRIGGER_HOVER = 'hover';
|
3563
3613
|
const TRIGGER_FOCUS = 'focus';
|
3564
3614
|
const TRIGGER_CLICK = 'click';
|
@@ -3635,7 +3685,7 @@
|
|
3635
3685
|
context._leave(null, context);
|
3636
3686
|
}
|
3637
3687
|
} else {
|
3638
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
3688
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$2)) {
|
3639
3689
|
this._leave(null, this);
|
3640
3690
|
|
3641
3691
|
return;
|
@@ -3647,7 +3697,7 @@
|
|
3647
3697
|
|
3648
3698
|
dispose() {
|
3649
3699
|
clearTimeout(this._timeout);
|
3650
|
-
EventHandler.off(this._element.closest(
|
3700
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
3651
3701
|
|
3652
3702
|
if (this.tip) {
|
3653
3703
|
this.tip.remove();
|
@@ -3683,10 +3733,8 @@
|
|
3683
3733
|
|
3684
3734
|
this._element.setAttribute('aria-describedby', tipId);
|
3685
3735
|
|
3686
|
-
this.setContent();
|
3687
|
-
|
3688
3736
|
if (this._config.animation) {
|
3689
|
-
tip.classList.add(CLASS_NAME_FADE$
|
3737
|
+
tip.classList.add(CLASS_NAME_FADE$2);
|
3690
3738
|
}
|
3691
3739
|
|
3692
3740
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
@@ -3701,7 +3749,7 @@
|
|
3701
3749
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
3702
3750
|
|
3703
3751
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
3704
|
-
container.
|
3752
|
+
container.append(tip);
|
3705
3753
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
3706
3754
|
}
|
3707
3755
|
|
@@ -3711,8 +3759,9 @@
|
|
3711
3759
|
this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
|
3712
3760
|
}
|
3713
3761
|
|
3714
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
3715
|
-
|
3762
|
+
tip.classList.add(CLASS_NAME_SHOW$2);
|
3763
|
+
|
3764
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
3716
3765
|
|
3717
3766
|
if (customClass) {
|
3718
3767
|
tip.classList.add(...customClass.split(' '));
|
@@ -3738,7 +3787,7 @@
|
|
3738
3787
|
}
|
3739
3788
|
};
|
3740
3789
|
|
3741
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
3790
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
3742
3791
|
|
3743
3792
|
this._queueCallback(complete, this.tip, isAnimated);
|
3744
3793
|
}
|
@@ -3778,7 +3827,7 @@
|
|
3778
3827
|
return;
|
3779
3828
|
}
|
3780
3829
|
|
3781
|
-
tip.classList.remove(CLASS_NAME_SHOW$
|
3830
|
+
tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra
|
3782
3831
|
// empty mouseover listeners we added for iOS support
|
3783
3832
|
|
3784
3833
|
if ('ontouchstart' in document.documentElement) {
|
@@ -3788,7 +3837,7 @@
|
|
3788
3837
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
3789
3838
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
3790
3839
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
3791
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
3840
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
3792
3841
|
|
3793
3842
|
this._queueCallback(complete, this.tip, isAnimated);
|
3794
3843
|
|
@@ -3813,14 +3862,27 @@
|
|
3813
3862
|
|
3814
3863
|
const element = document.createElement('div');
|
3815
3864
|
element.innerHTML = this._config.template;
|
3816
|
-
|
3865
|
+
const tip = element.children[0];
|
3866
|
+
this.setContent(tip);
|
3867
|
+
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
3868
|
+
this.tip = tip;
|
3817
3869
|
return this.tip;
|
3818
3870
|
}
|
3819
3871
|
|
3820
|
-
setContent() {
|
3821
|
-
|
3822
|
-
|
3823
|
-
|
3872
|
+
setContent(tip) {
|
3873
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
|
3874
|
+
}
|
3875
|
+
|
3876
|
+
_sanitizeAndSetContent(template, content, selector) {
|
3877
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
3878
|
+
|
3879
|
+
if (!content && templateElement) {
|
3880
|
+
templateElement.remove();
|
3881
|
+
return;
|
3882
|
+
} // we use append for html objects to maintain js events
|
3883
|
+
|
3884
|
+
|
3885
|
+
this.setElementContent(templateElement, content);
|
3824
3886
|
}
|
3825
3887
|
|
3826
3888
|
setElementContent(element, content) {
|
@@ -3834,7 +3896,7 @@
|
|
3834
3896
|
if (this._config.html) {
|
3835
3897
|
if (content.parentNode !== element) {
|
3836
3898
|
element.innerHTML = '';
|
3837
|
-
element.
|
3899
|
+
element.append(content);
|
3838
3900
|
}
|
3839
3901
|
} else {
|
3840
3902
|
element.textContent = content.textContent;
|
@@ -3855,13 +3917,9 @@
|
|
3855
3917
|
}
|
3856
3918
|
|
3857
3919
|
getTitle() {
|
3858
|
-
|
3859
|
-
|
3860
|
-
if (!title) {
|
3861
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
3862
|
-
}
|
3920
|
+
const title = this._element.getAttribute('data-bs-original-title') || this._config.title;
|
3863
3921
|
|
3864
|
-
return title;
|
3922
|
+
return this._resolvePossibleFunction(title);
|
3865
3923
|
}
|
3866
3924
|
|
3867
3925
|
updateAttachment(attachment) {
|
@@ -3878,15 +3936,7 @@
|
|
3878
3936
|
|
3879
3937
|
|
3880
3938
|
_initializeOnDelegatedTarget(event, context) {
|
3881
|
-
|
3882
|
-
context = context || Data.get(event.delegateTarget, dataKey);
|
3883
|
-
|
3884
|
-
if (!context) {
|
3885
|
-
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
3886
|
-
Data.set(event.delegateTarget, dataKey, context);
|
3887
|
-
}
|
3888
|
-
|
3889
|
-
return context;
|
3939
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
3890
3940
|
}
|
3891
3941
|
|
3892
3942
|
_getOffset() {
|
@@ -3905,6 +3955,10 @@
|
|
3905
3955
|
return offset;
|
3906
3956
|
}
|
3907
3957
|
|
3958
|
+
_resolvePossibleFunction(content) {
|
3959
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
3960
|
+
}
|
3961
|
+
|
3908
3962
|
_getPopperConfig(attachment) {
|
3909
3963
|
const defaultBsPopperConfig = {
|
3910
3964
|
placement: attachment,
|
@@ -3946,7 +4000,7 @@
|
|
3946
4000
|
}
|
3947
4001
|
|
3948
4002
|
_addAttachmentClass(attachment) {
|
3949
|
-
this.getTipElement().classList.add(`${
|
4003
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
3950
4004
|
}
|
3951
4005
|
|
3952
4006
|
_getAttachment(placement) {
|
@@ -3973,7 +4027,7 @@
|
|
3973
4027
|
}
|
3974
4028
|
};
|
3975
4029
|
|
3976
|
-
EventHandler.on(this._element.closest(
|
4030
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
3977
4031
|
|
3978
4032
|
if (this._config.selector) {
|
3979
4033
|
this._config = { ...this._config,
|
@@ -4008,7 +4062,7 @@
|
|
4008
4062
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
4009
4063
|
}
|
4010
4064
|
|
4011
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
4065
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) {
|
4012
4066
|
context._hoverState = HOVER_STATE_SHOW;
|
4013
4067
|
return;
|
4014
4068
|
}
|
@@ -4104,26 +4158,32 @@
|
|
4104
4158
|
_getDelegateConfig() {
|
4105
4159
|
const config = {};
|
4106
4160
|
|
4107
|
-
|
4108
|
-
|
4109
|
-
|
4110
|
-
config[key] = this._config[key];
|
4111
|
-
}
|
4161
|
+
for (const key in this._config) {
|
4162
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
4163
|
+
config[key] = this._config[key];
|
4112
4164
|
}
|
4113
|
-
}
|
4165
|
+
} // In the future can be replaced with:
|
4166
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
4167
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
4168
|
+
|
4114
4169
|
|
4115
4170
|
return config;
|
4116
4171
|
}
|
4117
4172
|
|
4118
4173
|
_cleanTipClass() {
|
4119
4174
|
const tip = this.getTipElement();
|
4120
|
-
const
|
4175
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
4176
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
4121
4177
|
|
4122
4178
|
if (tabClass !== null && tabClass.length > 0) {
|
4123
4179
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
4124
4180
|
}
|
4125
4181
|
}
|
4126
4182
|
|
4183
|
+
_getBasicClassPrefix() {
|
4184
|
+
return CLASS_PREFIX$1;
|
4185
|
+
}
|
4186
|
+
|
4127
4187
|
_handlePopperPlacementChange(popperData) {
|
4128
4188
|
const {
|
4129
4189
|
state
|
@@ -4168,7 +4228,7 @@
|
|
4168
4228
|
|
4169
4229
|
/**
|
4170
4230
|
* --------------------------------------------------------------------------
|
4171
|
-
* Bootstrap (v5.0
|
4231
|
+
* Bootstrap (v5.1.0): popover.js
|
4172
4232
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4173
4233
|
* --------------------------------------------------------------------------
|
4174
4234
|
*/
|
@@ -4182,7 +4242,6 @@
|
|
4182
4242
|
const DATA_KEY$3 = 'bs.popover';
|
4183
4243
|
const EVENT_KEY$3 = `.${DATA_KEY$3}`;
|
4184
4244
|
const CLASS_PREFIX = 'bs-popover';
|
4185
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
4186
4245
|
const Default$2 = { ...Tooltip.Default,
|
4187
4246
|
placement: 'right',
|
4188
4247
|
offset: [0, 8],
|
@@ -4205,8 +4264,6 @@
|
|
4205
4264
|
MOUSEENTER: `mouseenter${EVENT_KEY$3}`,
|
4206
4265
|
MOUSELEAVE: `mouseleave${EVENT_KEY$3}`
|
4207
4266
|
};
|
4208
|
-
const CLASS_NAME_FADE$2 = 'fade';
|
4209
|
-
const CLASS_NAME_SHOW$2 = 'show';
|
4210
4267
|
const SELECTOR_TITLE = '.popover-header';
|
4211
4268
|
const SELECTOR_CONTENT = '.popover-body';
|
4212
4269
|
/**
|
@@ -4238,55 +4295,19 @@
|
|
4238
4295
|
return this.getTitle() || this._getContent();
|
4239
4296
|
}
|
4240
4297
|
|
4241
|
-
|
4242
|
-
|
4243
|
-
return this.tip;
|
4244
|
-
}
|
4245
|
-
|
4246
|
-
this.tip = super.getTipElement();
|
4247
|
-
|
4248
|
-
if (!this.getTitle()) {
|
4249
|
-
SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove();
|
4250
|
-
}
|
4251
|
-
|
4252
|
-
if (!this._getContent()) {
|
4253
|
-
SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove();
|
4254
|
-
}
|
4255
|
-
|
4256
|
-
return this.tip;
|
4257
|
-
}
|
4258
|
-
|
4259
|
-
setContent() {
|
4260
|
-
const tip = this.getTipElement(); // we use append for html objects to maintain js events
|
4261
|
-
|
4262
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
|
4263
|
-
|
4264
|
-
let content = this._getContent();
|
4298
|
+
setContent(tip) {
|
4299
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
4265
4300
|
|
4266
|
-
|
4267
|
-
content = content.call(this._element);
|
4268
|
-
}
|
4269
|
-
|
4270
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
4271
|
-
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
4301
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
4272
4302
|
} // Private
|
4273
4303
|
|
4274
4304
|
|
4275
|
-
_addAttachmentClass(attachment) {
|
4276
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
4277
|
-
}
|
4278
|
-
|
4279
4305
|
_getContent() {
|
4280
|
-
return this.
|
4306
|
+
return this._resolvePossibleFunction(this._config.content);
|
4281
4307
|
}
|
4282
4308
|
|
4283
|
-
|
4284
|
-
|
4285
|
-
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
|
4286
|
-
|
4287
|
-
if (tabClass !== null && tabClass.length > 0) {
|
4288
|
-
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
4289
|
-
}
|
4309
|
+
_getBasicClassPrefix() {
|
4310
|
+
return CLASS_PREFIX;
|
4290
4311
|
} // Static
|
4291
4312
|
|
4292
4313
|
|
@@ -4317,7 +4338,7 @@
|
|
4317
4338
|
|
4318
4339
|
/**
|
4319
4340
|
* --------------------------------------------------------------------------
|
4320
|
-
* Bootstrap (v5.0
|
4341
|
+
* Bootstrap (v5.1.0): scrollspy.js
|
4321
4342
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4322
4343
|
* --------------------------------------------------------------------------
|
4323
4344
|
*/
|
@@ -4351,6 +4372,7 @@
|
|
4351
4372
|
const SELECTOR_NAV_LINKS = '.nav-link';
|
4352
4373
|
const SELECTOR_NAV_ITEMS = '.nav-item';
|
4353
4374
|
const SELECTOR_LIST_ITEMS = '.list-group-item';
|
4375
|
+
const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`;
|
4354
4376
|
const SELECTOR_DROPDOWN$1 = '.dropdown';
|
4355
4377
|
const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
|
4356
4378
|
const METHOD_OFFSET = 'offset';
|
@@ -4366,7 +4388,6 @@
|
|
4366
4388
|
super(element);
|
4367
4389
|
this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;
|
4368
4390
|
this._config = this._getConfig(config);
|
4369
|
-
this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`;
|
4370
4391
|
this._offsets = [];
|
4371
4392
|
this._targets = [];
|
4372
4393
|
this._activeTarget = null;
|
@@ -4394,7 +4415,7 @@
|
|
4394
4415
|
this._offsets = [];
|
4395
4416
|
this._targets = [];
|
4396
4417
|
this._scrollHeight = this._getScrollHeight();
|
4397
|
-
const targets = SelectorEngine.find(this.
|
4418
|
+
const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target);
|
4398
4419
|
targets.map(element => {
|
4399
4420
|
const targetSelector = getSelectorFromElement(element);
|
4400
4421
|
const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
|
@@ -4426,20 +4447,7 @@
|
|
4426
4447
|
...Manipulator.getDataAttributes(this._element),
|
4427
4448
|
...(typeof config === 'object' && config ? config : {})
|
4428
4449
|
};
|
4429
|
-
|
4430
|
-
if (typeof config.target !== 'string' && isElement(config.target)) {
|
4431
|
-
let {
|
4432
|
-
id
|
4433
|
-
} = config.target;
|
4434
|
-
|
4435
|
-
if (!id) {
|
4436
|
-
id = getUID(NAME$2);
|
4437
|
-
config.target.id = id;
|
4438
|
-
}
|
4439
|
-
|
4440
|
-
config.target = `#${id}`;
|
4441
|
-
}
|
4442
|
-
|
4450
|
+
config.target = getElement(config.target) || document.documentElement;
|
4443
4451
|
typeCheckConfig(NAME$2, config, DefaultType$1);
|
4444
4452
|
return config;
|
4445
4453
|
}
|
@@ -4499,16 +4507,13 @@
|
|
4499
4507
|
|
4500
4508
|
this._clear();
|
4501
4509
|
|
4502
|
-
const queries =
|
4503
|
-
|
4504
|
-
|
4510
|
+
const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);
|
4511
|
+
const link = SelectorEngine.findOne(queries.join(','), this._config.target);
|
4512
|
+
link.classList.add(CLASS_NAME_ACTIVE$1);
|
4505
4513
|
|
4506
4514
|
if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
|
4507
4515
|
SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);
|
4508
|
-
link.classList.add(CLASS_NAME_ACTIVE$1);
|
4509
4516
|
} else {
|
4510
|
-
// Set triggered link as active
|
4511
|
-
link.classList.add(CLASS_NAME_ACTIVE$1);
|
4512
4517
|
SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {
|
4513
4518
|
// Set triggered links parents as active
|
4514
4519
|
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
@@ -4526,7 +4531,7 @@
|
|
4526
4531
|
}
|
4527
4532
|
|
4528
4533
|
_clear() {
|
4529
|
-
SelectorEngine.find(this.
|
4534
|
+
SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));
|
4530
4535
|
} // Static
|
4531
4536
|
|
4532
4537
|
|
@@ -4568,7 +4573,7 @@
|
|
4568
4573
|
|
4569
4574
|
/**
|
4570
4575
|
* --------------------------------------------------------------------------
|
4571
|
-
* Bootstrap (v5.0
|
4576
|
+
* Bootstrap (v5.1.0): tab.js
|
4572
4577
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4573
4578
|
* --------------------------------------------------------------------------
|
4574
4579
|
*/
|
@@ -4766,7 +4771,7 @@
|
|
4766
4771
|
|
4767
4772
|
/**
|
4768
4773
|
* --------------------------------------------------------------------------
|
4769
|
-
* Bootstrap (v5.0
|
4774
|
+
* Bootstrap (v5.1.0): toast.js
|
4770
4775
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4771
4776
|
* --------------------------------------------------------------------------
|
4772
4777
|
*/
|
@@ -4779,7 +4784,6 @@
|
|
4779
4784
|
const NAME = 'toast';
|
4780
4785
|
const DATA_KEY = 'bs.toast';
|
4781
4786
|
const EVENT_KEY = `.${DATA_KEY}`;
|
4782
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
4783
4787
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
4784
4788
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
4785
4789
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
@@ -4789,7 +4793,8 @@
|
|
4789
4793
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
4790
4794
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
4791
4795
|
const CLASS_NAME_FADE = 'fade';
|
4792
|
-
const CLASS_NAME_HIDE = 'hide';
|
4796
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
4797
|
+
|
4793
4798
|
const CLASS_NAME_SHOW = 'show';
|
4794
4799
|
const CLASS_NAME_SHOWING = 'showing';
|
4795
4800
|
const DefaultType = {
|
@@ -4802,7 +4807,6 @@
|
|
4802
4807
|
autohide: true,
|
4803
4808
|
delay: 5000
|
4804
4809
|
};
|
4805
|
-
const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
|
4806
4810
|
/**
|
4807
4811
|
* ------------------------------------------------------------------------
|
4808
4812
|
* Class Definition
|
@@ -4850,17 +4854,18 @@
|
|
4850
4854
|
const complete = () => {
|
4851
4855
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
4852
4856
|
|
4853
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
4854
|
-
|
4855
4857
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
4856
4858
|
|
4857
4859
|
this._maybeScheduleHide();
|
4858
4860
|
};
|
4859
4861
|
|
4860
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
4862
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
4863
|
+
|
4861
4864
|
|
4862
4865
|
reflow(this._element);
|
4863
4866
|
|
4867
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
4868
|
+
|
4864
4869
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
4865
4870
|
|
4866
4871
|
this._queueCallback(complete, this._element, this._config.animation);
|
@@ -4878,12 +4883,17 @@
|
|
4878
4883
|
}
|
4879
4884
|
|
4880
4885
|
const complete = () => {
|
4881
|
-
this._element.classList.add(CLASS_NAME_HIDE);
|
4886
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
4887
|
+
|
4888
|
+
|
4889
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
4890
|
+
|
4891
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
4882
4892
|
|
4883
4893
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
4884
4894
|
};
|
4885
4895
|
|
4886
|
-
this._element.classList.
|
4896
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
4887
4897
|
|
4888
4898
|
this._queueCallback(complete, this._element, this._config.animation);
|
4889
4899
|
}
|
@@ -4951,7 +4961,6 @@
|
|
4951
4961
|
}
|
4952
4962
|
|
4953
4963
|
_setListeners() {
|
4954
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
4955
4964
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
4956
4965
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
4957
4966
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
@@ -4979,6 +4988,8 @@
|
|
4979
4988
|
}
|
4980
4989
|
|
4981
4990
|
}
|
4991
|
+
|
4992
|
+
enableDismissTrigger(Toast);
|
4982
4993
|
/**
|
4983
4994
|
* ------------------------------------------------------------------------
|
4984
4995
|
* jQuery
|
@@ -4986,12 +4997,11 @@
|
|
4986
4997
|
* add .Toast to jQuery only if jQuery is present
|
4987
4998
|
*/
|
4988
4999
|
|
4989
|
-
|
4990
5000
|
defineJQueryPlugin(Toast);
|
4991
5001
|
|
4992
5002
|
/**
|
4993
5003
|
* --------------------------------------------------------------------------
|
4994
|
-
* Bootstrap (v5.0
|
5004
|
+
* Bootstrap (v5.1.0): index.umd.js
|
4995
5005
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4996
5006
|
* --------------------------------------------------------------------------
|
4997
5007
|
*/
|