@coreui/coreui 4.0.5 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/css/coreui-grid.css +254 -205
- package/dist/css/coreui-grid.css.map +1 -1
- package/dist/css/coreui-grid.min.css +2 -2
- package/dist/css/coreui-grid.min.css.map +1 -1
- package/dist/css/coreui-grid.rtl.css +255 -206
- package/dist/css/coreui-grid.rtl.css.map +1 -1
- package/dist/css/coreui-grid.rtl.min.css +3 -3
- package/dist/css/coreui-grid.rtl.min.css.map +1 -1
- package/dist/css/coreui-reboot.css +63 -8
- package/dist/css/coreui-reboot.css.map +1 -1
- package/dist/css/coreui-reboot.min.css +2 -2
- package/dist/css/coreui-reboot.min.css.map +1 -1
- package/dist/css/coreui-reboot.rtl.css +64 -9
- package/dist/css/coreui-reboot.rtl.css.map +1 -1
- package/dist/css/coreui-reboot.rtl.min.css +3 -3
- package/dist/css/coreui-reboot.rtl.min.css.map +1 -1
- package/dist/css/coreui-utilities.css +181 -81
- package/dist/css/coreui-utilities.css.map +1 -1
- package/dist/css/coreui-utilities.min.css +2 -2
- package/dist/css/coreui-utilities.min.css.map +1 -1
- package/dist/css/coreui-utilities.rtl.css +182 -82
- package/dist/css/coreui-utilities.rtl.css.map +1 -1
- package/dist/css/coreui-utilities.rtl.min.css +3 -3
- package/dist/css/coreui-utilities.rtl.min.css.map +1 -1
- package/dist/css/coreui.css +693 -327
- package/dist/css/coreui.css.map +1 -1
- package/dist/css/coreui.min.css +2 -2
- package/dist/css/coreui.min.css.map +1 -1
- package/dist/css/coreui.rtl.css +676 -325
- package/dist/css/coreui.rtl.css.map +1 -1
- package/dist/css/coreui.rtl.min.css +3 -3
- package/dist/css/coreui.rtl.min.css.map +1 -1
- package/dist/js/coreui.bundle.js +776 -702
- package/dist/js/coreui.bundle.js.map +1 -1
- package/dist/js/coreui.bundle.min.js +2 -2
- package/dist/js/coreui.bundle.min.js.map +1 -1
- package/dist/js/coreui.esm.js +659 -611
- package/dist/js/coreui.esm.js.map +1 -1
- package/dist/js/coreui.esm.min.js +2 -2
- package/dist/js/coreui.esm.min.js.map +1 -1
- package/dist/js/coreui.js +669 -623
- package/dist/js/coreui.js.map +1 -1
- package/dist/js/coreui.min.js +2 -2
- package/dist/js/coreui.min.js.map +1 -1
- package/js/dist/alert.js +81 -48
- package/js/dist/alert.js.map +1 -1
- package/js/dist/base-component.js +25 -17
- package/js/dist/base-component.js.map +1 -1
- package/js/dist/button.js +22 -12
- package/js/dist/button.js.map +1 -1
- package/js/dist/carousel.js +69 -44
- package/js/dist/carousel.js.map +1 -1
- package/js/dist/collapse.js +117 -131
- package/js/dist/collapse.js.map +1 -1
- package/js/dist/dom/data.js +5 -5
- package/js/dist/dom/data.js.map +1 -1
- package/js/dist/dom/event-handler.js +14 -5
- package/js/dist/dom/event-handler.js.map +1 -1
- package/js/dist/dom/manipulator.js +6 -6
- package/js/dist/dom/manipulator.js.map +1 -1
- package/js/dist/dom/selector-engine.js +53 -8
- package/js/dist/dom/selector-engine.js.map +1 -1
- package/js/dist/dropdown.js +99 -106
- package/js/dist/dropdown.js.map +1 -1
- package/js/dist/modal.js +244 -87
- package/js/dist/modal.js.map +1 -1
- package/js/dist/offcanvas.js +205 -56
- package/js/dist/offcanvas.js.map +1 -1
- package/js/dist/popover.js +28 -58
- package/js/dist/popover.js.map +1 -1
- package/js/dist/scrollspy.js +40 -30
- package/js/dist/scrollspy.js.map +1 -1
- package/js/dist/tab.js +44 -22
- package/js/dist/tab.js.map +1 -1
- package/js/dist/toast.js +127 -29
- package/js/dist/toast.js.map +1 -1
- package/js/dist/tooltip.js +122 -104
- package/js/dist/tooltip.js.map +1 -1
- package/js/src/alert.js +21 -47
- package/js/src/base-component.js +3 -3
- package/js/src/button.js +1 -1
- package/js/src/carousel.js +9 -4
- package/js/src/collapse.js +66 -119
- package/js/src/dom/data.js +1 -1
- package/js/src/dom/event-handler.js +1 -2
- package/js/src/dom/manipulator.js +3 -3
- package/js/src/dom/selector-engine.js +18 -1
- package/js/src/dropdown.js +53 -68
- package/js/src/modal.js +24 -35
- package/js/src/navigation.js +1 -1
- package/js/src/offcanvas.js +16 -18
- package/js/src/popover.js +7 -49
- package/js/src/scrollspy.js +1 -1
- package/js/src/sidebar.js +3 -3
- package/js/src/tab.js +1 -1
- package/js/src/toast.js +11 -11
- package/js/src/tooltip.js +66 -50
- package/js/src/util/backdrop.js +6 -5
- package/js/src/util/component-functions.js +34 -0
- package/js/src/util/focustrap.js +105 -0
- package/js/src/util/index.js +14 -5
- package/js/src/util/sanitizer.js +21 -22
- package/js/src/util/scrollbar.js +1 -1
- package/package.json +47 -44
- package/scss/_buttons.scss +1 -2
- package/scss/_card.scss +2 -1
- package/scss/_dropdown.scss +1 -1
- package/scss/_functions.scss +51 -12
- package/scss/_grid.scss +0 -23
- package/scss/_helpers.scss +2 -0
- package/scss/_mixins.scss +1 -0
- package/scss/_modal.scss +1 -11
- package/scss/_navbar.scss +30 -1
- package/scss/_offcanvas.scss +6 -2
- package/scss/_placeholders.scss +51 -0
- package/scss/_reboot.scss +12 -8
- package/scss/_root.scss +36 -7
- package/scss/_tables.scss +9 -5
- package/scss/_toasts.scss +2 -2
- package/scss/_transitions.scss +6 -0
- package/scss/_utilities.scss +31 -8
- package/scss/_variables.scss +184 -12
- package/scss/coreui-grid.rtl.scss +1 -1
- package/scss/coreui-grid.scss +3 -1
- package/scss/coreui-reboot.rtl.scss +1 -1
- package/scss/coreui-reboot.scss +2 -4
- package/scss/coreui-utilities.rtl.scss +1 -1
- package/scss/coreui-utilities.scss +1 -1
- package/scss/coreui.rtl.scss +1 -1
- package/scss/coreui.scss +2 -1
- package/scss/forms/_form-control.scss +1 -1
- package/scss/forms/_form-select.scss +2 -0
- package/scss/helpers/_stacks.scss +15 -0
- package/scss/helpers/_vr.scss +8 -0
- package/scss/mixins/_backdrop.scss +14 -0
- package/scss/mixins/_grid.scss +26 -7
- package/scss/mixins/_ltr-rtl.scss +21 -0
- package/scss/mixins/_utilities.scss +26 -26
- package/scss/mixins/_visually-hidden.scss +1 -1
package/dist/js/coreui.bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* CoreUI v4.0
|
|
2
|
+
* CoreUI v4.1.0 (https://coreui.io)
|
|
3
3
|
* Copyright 2021 The CoreUI Team (https://github.com/orgs/coreui/people)
|
|
4
4
|
* Licensed under MIT (https://coreui.io)
|
|
5
5
|
*/
|
|
@@ -7,92 +7,17 @@
|
|
|
7
7
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
8
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
9
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.coreui = factory());
|
|
10
|
-
}(this, (function () { 'use strict';
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* --------------------------------------------------------------------------
|
|
14
|
-
* CoreUI (v4.0
|
|
15
|
-
* Licensed under MIT (https://coreui.io/license)
|
|
16
|
-
*
|
|
17
|
-
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
18
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
19
|
-
* --------------------------------------------------------------------------
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* ------------------------------------------------------------------------
|
|
24
|
-
* Constants
|
|
25
|
-
* ------------------------------------------------------------------------
|
|
26
|
-
*/
|
|
27
|
-
const NODE_TEXT = 3;
|
|
28
|
-
const SelectorEngine = {
|
|
29
|
-
find(selector, element = document.documentElement) {
|
|
30
|
-
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
findOne(selector, element = document.documentElement) {
|
|
34
|
-
return Element.prototype.querySelector.call(element, selector);
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
children(element, selector) {
|
|
38
|
-
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
parents(element, selector) {
|
|
42
|
-
const parents = [];
|
|
43
|
-
let ancestor = element.parentNode;
|
|
44
|
-
|
|
45
|
-
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
46
|
-
if (ancestor.matches(selector)) {
|
|
47
|
-
parents.push(ancestor);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
ancestor = ancestor.parentNode;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return parents;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
prev(element, selector) {
|
|
57
|
-
let previous = element.previousElementSibling;
|
|
58
|
-
|
|
59
|
-
while (previous) {
|
|
60
|
-
if (previous.matches(selector)) {
|
|
61
|
-
return [previous];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
previous = previous.previousElementSibling;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return [];
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
next(element, selector) {
|
|
71
|
-
let next = element.nextElementSibling;
|
|
72
|
-
|
|
73
|
-
while (next) {
|
|
74
|
-
if (next.matches(selector)) {
|
|
75
|
-
return [next];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
next = next.nextElementSibling;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* --------------------------------------------------------------------------
|
|
88
|
-
* CoreUI (v4.0.5): alert.js
|
|
14
|
+
* CoreUI (v4.1.0): alert.js
|
|
89
15
|
* Licensed under MIT (https://coreui.io/license)
|
|
90
16
|
*
|
|
91
17
|
* This component is a modified version of the Bootstrap's util/index.js
|
|
92
18
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
93
19
|
* --------------------------------------------------------------------------
|
|
94
20
|
*/
|
|
95
|
-
|
|
96
21
|
const MAX_UID = 1000000;
|
|
97
22
|
const MILLISECONDS_MULTIPLIER = 1000;
|
|
98
23
|
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
|
@@ -204,7 +129,7 @@
|
|
|
204
129
|
}
|
|
205
130
|
|
|
206
131
|
if (typeof obj === 'string' && obj.length > 0) {
|
|
207
|
-
return
|
|
132
|
+
return document.querySelector(obj);
|
|
208
133
|
}
|
|
209
134
|
|
|
210
135
|
return null;
|
|
@@ -270,8 +195,20 @@
|
|
|
270
195
|
};
|
|
271
196
|
|
|
272
197
|
const noop = () => {};
|
|
198
|
+
/**
|
|
199
|
+
* Trick to restart an element's animation
|
|
200
|
+
*
|
|
201
|
+
* @param {HTMLElement} element
|
|
202
|
+
* @return void
|
|
203
|
+
*
|
|
204
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
|
205
|
+
*/
|
|
273
206
|
|
|
274
|
-
|
|
207
|
+
|
|
208
|
+
const reflow = element => {
|
|
209
|
+
// eslint-disable-next-line no-unused-expressions
|
|
210
|
+
element.offsetHeight;
|
|
211
|
+
};
|
|
275
212
|
|
|
276
213
|
const getjQuery = () => {
|
|
277
214
|
const {
|
|
@@ -388,7 +325,7 @@
|
|
|
388
325
|
|
|
389
326
|
/**
|
|
390
327
|
* --------------------------------------------------------------------------
|
|
391
|
-
* CoreUI (v4.0
|
|
328
|
+
* CoreUI (v4.1.0): dom/event-handler.js
|
|
392
329
|
* Licensed under MIT (https://coreui.io/license)
|
|
393
330
|
*
|
|
394
331
|
* This component is a modified version of the Bootstrap's dom/event-handler.js
|
|
@@ -454,7 +391,6 @@
|
|
|
454
391
|
event.delegateTarget = target;
|
|
455
392
|
|
|
456
393
|
if (handler.oneOff) {
|
|
457
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
458
394
|
EventHandler.off(element, event.type, selector, fn);
|
|
459
395
|
}
|
|
460
396
|
|
|
@@ -680,7 +616,7 @@
|
|
|
680
616
|
|
|
681
617
|
/**
|
|
682
618
|
* --------------------------------------------------------------------------
|
|
683
|
-
* CoreUI (v4.0
|
|
619
|
+
* CoreUI (v4.1.0): dom/data.js
|
|
684
620
|
* Licensed under MIT (https://coreui.io/license)
|
|
685
621
|
*
|
|
686
622
|
* This component is a modified version of the Bootstrap's dom/data.js
|
|
@@ -694,7 +630,7 @@
|
|
|
694
630
|
* ------------------------------------------------------------------------
|
|
695
631
|
*/
|
|
696
632
|
const elementMap = new Map();
|
|
697
|
-
|
|
633
|
+
const Data = {
|
|
698
634
|
set(element, key, instance) {
|
|
699
635
|
if (!elementMap.has(element)) {
|
|
700
636
|
elementMap.set(element, new Map());
|
|
@@ -737,7 +673,7 @@
|
|
|
737
673
|
|
|
738
674
|
/**
|
|
739
675
|
* --------------------------------------------------------------------------
|
|
740
|
-
* CoreUI (v4.0
|
|
676
|
+
* CoreUI (v4.1.0): alert.js
|
|
741
677
|
* Licensed under MIT (https://coreui.io/license)
|
|
742
678
|
*
|
|
743
679
|
* This component is a modified version of the Bootstrap's base-component.js
|
|
@@ -750,7 +686,7 @@
|
|
|
750
686
|
* ------------------------------------------------------------------------
|
|
751
687
|
*/
|
|
752
688
|
|
|
753
|
-
const VERSION = '4.0
|
|
689
|
+
const VERSION = '4.1.0';
|
|
754
690
|
|
|
755
691
|
class BaseComponent {
|
|
756
692
|
constructor(element) {
|
|
@@ -779,7 +715,7 @@
|
|
|
779
715
|
|
|
780
716
|
|
|
781
717
|
static getInstance(element) {
|
|
782
|
-
return Data.get(element, this.DATA_KEY);
|
|
718
|
+
return Data.get(getElement(element), this.DATA_KEY);
|
|
783
719
|
}
|
|
784
720
|
|
|
785
721
|
static getOrCreateInstance(element, config = {}) {
|
|
@@ -806,7 +742,33 @@
|
|
|
806
742
|
|
|
807
743
|
/**
|
|
808
744
|
* --------------------------------------------------------------------------
|
|
809
|
-
*
|
|
745
|
+
* Bootstrap (v5.1.3): util/component-functions.js
|
|
746
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
747
|
+
* --------------------------------------------------------------------------
|
|
748
|
+
*/
|
|
749
|
+
|
|
750
|
+
const enableDismissTrigger = (component, method = 'hide') => {
|
|
751
|
+
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
752
|
+
const name = component.NAME;
|
|
753
|
+
EventHandler.on(document, clickEvent, `[data-coreui-dismiss="${name}"]`, function (event) {
|
|
754
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
755
|
+
event.preventDefault();
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (isDisabled(this)) {
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
763
|
+
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
764
|
+
|
|
765
|
+
instance[method]();
|
|
766
|
+
});
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* --------------------------------------------------------------------------
|
|
771
|
+
* CoreUI (v4.1.0): alert.js
|
|
810
772
|
* Licensed under MIT (https://coreui.io/license)
|
|
811
773
|
*
|
|
812
774
|
* This component is a modified version of the Bootstrap's alert.js
|
|
@@ -819,17 +781,13 @@
|
|
|
819
781
|
* ------------------------------------------------------------------------
|
|
820
782
|
*/
|
|
821
783
|
|
|
822
|
-
const NAME$
|
|
823
|
-
const DATA_KEY$
|
|
824
|
-
const EVENT_KEY$
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
const EVENT_CLICK_DATA_API$9 = `click${EVENT_KEY$d}${DATA_API_KEY$a}`;
|
|
830
|
-
const CLASS_NAME_ALERT = 'alert';
|
|
831
|
-
const CLASS_NAME_FADE$7 = 'fade';
|
|
832
|
-
const CLASS_NAME_SHOW$b = 'show';
|
|
784
|
+
const NAME$f = 'alert';
|
|
785
|
+
const DATA_KEY$e = 'coreui.alert';
|
|
786
|
+
const EVENT_KEY$e = `.${DATA_KEY$e}`;
|
|
787
|
+
const EVENT_CLOSE = `close${EVENT_KEY$e}`;
|
|
788
|
+
const EVENT_CLOSED = `closed${EVENT_KEY$e}`;
|
|
789
|
+
const CLASS_NAME_FADE$6 = 'fade';
|
|
790
|
+
const CLASS_NAME_SHOW$a = 'show';
|
|
833
791
|
/**
|
|
834
792
|
* ------------------------------------------------------------------------
|
|
835
793
|
* Class Definition
|
|
@@ -839,41 +797,30 @@
|
|
|
839
797
|
class Alert extends BaseComponent {
|
|
840
798
|
// Getters
|
|
841
799
|
static get NAME() {
|
|
842
|
-
return NAME$
|
|
800
|
+
return NAME$f;
|
|
843
801
|
} // Public
|
|
844
802
|
|
|
845
803
|
|
|
846
|
-
close(
|
|
847
|
-
const
|
|
804
|
+
close() {
|
|
805
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
848
806
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
if (customEvent === null || customEvent.defaultPrevented) {
|
|
807
|
+
if (closeEvent.defaultPrevented) {
|
|
852
808
|
return;
|
|
853
809
|
}
|
|
854
810
|
|
|
855
|
-
this.
|
|
856
|
-
} // Private
|
|
811
|
+
this._element.classList.remove(CLASS_NAME_SHOW$a);
|
|
857
812
|
|
|
813
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$6);
|
|
858
814
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
_triggerCloseEvent(element) {
|
|
864
|
-
return EventHandler.trigger(element, EVENT_CLOSE);
|
|
865
|
-
}
|
|
815
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
816
|
+
} // Private
|
|
866
817
|
|
|
867
|
-
_removeElement(element) {
|
|
868
|
-
element.classList.remove(CLASS_NAME_SHOW$b);
|
|
869
|
-
const isAnimated = element.classList.contains(CLASS_NAME_FADE$7);
|
|
870
818
|
|
|
871
|
-
|
|
872
|
-
|
|
819
|
+
_destroyElement() {
|
|
820
|
+
this._element.remove();
|
|
873
821
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
EventHandler.trigger(element, EVENT_CLOSED);
|
|
822
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
823
|
+
this.dispose();
|
|
877
824
|
} // Static
|
|
878
825
|
|
|
879
826
|
|
|
@@ -881,20 +828,16 @@
|
|
|
881
828
|
return this.each(function () {
|
|
882
829
|
const data = Alert.getOrCreateInstance(this);
|
|
883
830
|
|
|
884
|
-
if (config
|
|
885
|
-
|
|
831
|
+
if (typeof config !== 'string') {
|
|
832
|
+
return;
|
|
886
833
|
}
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
834
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
if (event) {
|
|
893
|
-
event.preventDefault();
|
|
835
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
836
|
+
throw new TypeError(`No method named "${config}"`);
|
|
894
837
|
}
|
|
895
838
|
|
|
896
|
-
|
|
897
|
-
};
|
|
839
|
+
data[config](this);
|
|
840
|
+
});
|
|
898
841
|
}
|
|
899
842
|
|
|
900
843
|
}
|
|
@@ -905,7 +848,7 @@
|
|
|
905
848
|
*/
|
|
906
849
|
|
|
907
850
|
|
|
908
|
-
|
|
851
|
+
enableDismissTrigger(Alert, 'close');
|
|
909
852
|
/**
|
|
910
853
|
* ------------------------------------------------------------------------
|
|
911
854
|
* jQuery
|
|
@@ -917,7 +860,7 @@
|
|
|
917
860
|
|
|
918
861
|
/**
|
|
919
862
|
* --------------------------------------------------------------------------
|
|
920
|
-
* CoreUI (v4.0
|
|
863
|
+
* CoreUI (v4.1.0): alert.js
|
|
921
864
|
* Licensed under MIT (https://coreui.io/license)
|
|
922
865
|
*
|
|
923
866
|
* This component is a modified version of the Bootstrap's button.js
|
|
@@ -930,13 +873,13 @@
|
|
|
930
873
|
* ------------------------------------------------------------------------
|
|
931
874
|
*/
|
|
932
875
|
|
|
933
|
-
const NAME$
|
|
934
|
-
const DATA_KEY$
|
|
935
|
-
const EVENT_KEY$
|
|
876
|
+
const NAME$e = 'button';
|
|
877
|
+
const DATA_KEY$d = 'coreui.button';
|
|
878
|
+
const EVENT_KEY$d = `.${DATA_KEY$d}`;
|
|
936
879
|
const DATA_API_KEY$9 = '.data-api';
|
|
937
880
|
const CLASS_NAME_ACTIVE$4 = 'active';
|
|
938
881
|
const SELECTOR_DATA_TOGGLE$6 = '[data-coreui-toggle="button"]';
|
|
939
|
-
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$
|
|
882
|
+
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$d}${DATA_API_KEY$9}`;
|
|
940
883
|
/**
|
|
941
884
|
* ------------------------------------------------------------------------
|
|
942
885
|
* Class Definition
|
|
@@ -946,7 +889,7 @@
|
|
|
946
889
|
class Button extends BaseComponent {
|
|
947
890
|
// Getters
|
|
948
891
|
static get NAME() {
|
|
949
|
-
return NAME$
|
|
892
|
+
return NAME$e;
|
|
950
893
|
} // Public
|
|
951
894
|
|
|
952
895
|
|
|
@@ -991,7 +934,7 @@
|
|
|
991
934
|
|
|
992
935
|
/**
|
|
993
936
|
* --------------------------------------------------------------------------
|
|
994
|
-
* CoreUI (v4.0
|
|
937
|
+
* CoreUI (v4.1.0): dom/manipulator.js
|
|
995
938
|
* Licensed under MIT (https://coreui.io/license)
|
|
996
939
|
*
|
|
997
940
|
* This component is a modified version of the Bootstrap's dom/manipulator.js
|
|
@@ -1052,8 +995,8 @@
|
|
|
1052
995
|
offset(element) {
|
|
1053
996
|
const rect = element.getBoundingClientRect();
|
|
1054
997
|
return {
|
|
1055
|
-
top: rect.top +
|
|
1056
|
-
left: rect.left +
|
|
998
|
+
top: rect.top + window.pageYOffset,
|
|
999
|
+
left: rect.left + window.pageXOffset
|
|
1057
1000
|
};
|
|
1058
1001
|
},
|
|
1059
1002
|
|
|
@@ -1068,7 +1011,80 @@
|
|
|
1068
1011
|
|
|
1069
1012
|
/**
|
|
1070
1013
|
* --------------------------------------------------------------------------
|
|
1071
|
-
* CoreUI (v4.0
|
|
1014
|
+
* CoreUI (v4.1.0): dom/selector-engine.js
|
|
1015
|
+
* Licensed under MIT (https://coreui.io/license)
|
|
1016
|
+
*
|
|
1017
|
+
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
1018
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1019
|
+
* --------------------------------------------------------------------------
|
|
1020
|
+
*/
|
|
1021
|
+
const NODE_TEXT = 3;
|
|
1022
|
+
const SelectorEngine = {
|
|
1023
|
+
find(selector, element = document.documentElement) {
|
|
1024
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
1025
|
+
},
|
|
1026
|
+
|
|
1027
|
+
findOne(selector, element = document.documentElement) {
|
|
1028
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
1029
|
+
},
|
|
1030
|
+
|
|
1031
|
+
children(element, selector) {
|
|
1032
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
1033
|
+
},
|
|
1034
|
+
|
|
1035
|
+
parents(element, selector) {
|
|
1036
|
+
const parents = [];
|
|
1037
|
+
let ancestor = element.parentNode;
|
|
1038
|
+
|
|
1039
|
+
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
1040
|
+
if (ancestor.matches(selector)) {
|
|
1041
|
+
parents.push(ancestor);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
ancestor = ancestor.parentNode;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
return parents;
|
|
1048
|
+
},
|
|
1049
|
+
|
|
1050
|
+
prev(element, selector) {
|
|
1051
|
+
let previous = element.previousElementSibling;
|
|
1052
|
+
|
|
1053
|
+
while (previous) {
|
|
1054
|
+
if (previous.matches(selector)) {
|
|
1055
|
+
return [previous];
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
previous = previous.previousElementSibling;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
return [];
|
|
1062
|
+
},
|
|
1063
|
+
|
|
1064
|
+
next(element, selector) {
|
|
1065
|
+
let next = element.nextElementSibling;
|
|
1066
|
+
|
|
1067
|
+
while (next) {
|
|
1068
|
+
if (next.matches(selector)) {
|
|
1069
|
+
return [next];
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
next = next.nextElementSibling;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
return [];
|
|
1076
|
+
},
|
|
1077
|
+
|
|
1078
|
+
focusableChildren(element) {
|
|
1079
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
|
1080
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* --------------------------------------------------------------------------
|
|
1087
|
+
* CoreUI (v4.1.0): carousel.js
|
|
1072
1088
|
* Licensed under MIT (https://coreui.io/license)
|
|
1073
1089
|
*
|
|
1074
1090
|
* This component is a modified version of the Bootstrap's carousel.js
|
|
@@ -1081,16 +1097,16 @@
|
|
|
1081
1097
|
* ------------------------------------------------------------------------
|
|
1082
1098
|
*/
|
|
1083
1099
|
|
|
1084
|
-
const NAME$
|
|
1085
|
-
const DATA_KEY$
|
|
1086
|
-
const EVENT_KEY$
|
|
1100
|
+
const NAME$d = 'carousel';
|
|
1101
|
+
const DATA_KEY$c = 'coreui.carousel';
|
|
1102
|
+
const EVENT_KEY$c = `.${DATA_KEY$c}`;
|
|
1087
1103
|
const DATA_API_KEY$8 = '.data-api';
|
|
1088
1104
|
const ARROW_LEFT_KEY = 'ArrowLeft';
|
|
1089
1105
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
|
1090
1106
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
|
1091
1107
|
|
|
1092
1108
|
const SWIPE_THRESHOLD = 40;
|
|
1093
|
-
const Default$
|
|
1109
|
+
const Default$c = {
|
|
1094
1110
|
interval: 5000,
|
|
1095
1111
|
keyboard: true,
|
|
1096
1112
|
slide: false,
|
|
@@ -1098,7 +1114,7 @@
|
|
|
1098
1114
|
wrap: true,
|
|
1099
1115
|
touch: true
|
|
1100
1116
|
};
|
|
1101
|
-
const DefaultType$
|
|
1117
|
+
const DefaultType$c = {
|
|
1102
1118
|
interval: '(number|boolean)',
|
|
1103
1119
|
keyboard: 'boolean',
|
|
1104
1120
|
slide: '(boolean|string)',
|
|
@@ -1114,19 +1130,19 @@
|
|
|
1114
1130
|
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
|
1115
1131
|
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
|
1116
1132
|
};
|
|
1117
|
-
const EVENT_SLIDE = `slide${EVENT_KEY$
|
|
1118
|
-
const EVENT_SLID = `slid${EVENT_KEY$
|
|
1119
|
-
const EVENT_KEYDOWN = `keydown${EVENT_KEY$
|
|
1120
|
-
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$
|
|
1121
|
-
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$
|
|
1122
|
-
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$
|
|
1123
|
-
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$
|
|
1124
|
-
const EVENT_TOUCHEND = `touchend${EVENT_KEY$
|
|
1125
|
-
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$
|
|
1126
|
-
const EVENT_POINTERUP = `pointerup${EVENT_KEY$
|
|
1127
|
-
const EVENT_DRAG_START = `dragstart${EVENT_KEY$
|
|
1128
|
-
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$
|
|
1129
|
-
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$
|
|
1133
|
+
const EVENT_SLIDE = `slide${EVENT_KEY$c}`;
|
|
1134
|
+
const EVENT_SLID = `slid${EVENT_KEY$c}`;
|
|
1135
|
+
const EVENT_KEYDOWN = `keydown${EVENT_KEY$c}`;
|
|
1136
|
+
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$c}`;
|
|
1137
|
+
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$c}`;
|
|
1138
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$c}`;
|
|
1139
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$c}`;
|
|
1140
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY$c}`;
|
|
1141
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$c}`;
|
|
1142
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY$c}`;
|
|
1143
|
+
const EVENT_DRAG_START = `dragstart${EVENT_KEY$c}`;
|
|
1144
|
+
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1145
|
+
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1130
1146
|
const CLASS_NAME_CAROUSEL = 'carousel';
|
|
1131
1147
|
const CLASS_NAME_ACTIVE$3 = 'active';
|
|
1132
1148
|
const CLASS_NAME_SLIDE = 'slide';
|
|
@@ -1173,11 +1189,11 @@
|
|
|
1173
1189
|
|
|
1174
1190
|
|
|
1175
1191
|
static get Default() {
|
|
1176
|
-
return Default$
|
|
1192
|
+
return Default$c;
|
|
1177
1193
|
}
|
|
1178
1194
|
|
|
1179
1195
|
static get NAME() {
|
|
1180
|
-
return NAME$
|
|
1196
|
+
return NAME$d;
|
|
1181
1197
|
} // Public
|
|
1182
1198
|
|
|
1183
1199
|
|
|
@@ -1255,11 +1271,11 @@
|
|
|
1255
1271
|
|
|
1256
1272
|
|
|
1257
1273
|
_getConfig(config) {
|
|
1258
|
-
config = { ...Default$
|
|
1274
|
+
config = { ...Default$c,
|
|
1259
1275
|
...Manipulator.getDataAttributes(this._element),
|
|
1260
1276
|
...(typeof config === 'object' ? config : {})
|
|
1261
1277
|
};
|
|
1262
|
-
typeCheckConfig(NAME$
|
|
1278
|
+
typeCheckConfig(NAME$d, config, DefaultType$c);
|
|
1263
1279
|
return config;
|
|
1264
1280
|
}
|
|
1265
1281
|
|
|
@@ -1296,8 +1312,12 @@
|
|
|
1296
1312
|
}
|
|
1297
1313
|
|
|
1298
1314
|
_addTouchEventListeners() {
|
|
1315
|
+
const hasPointerPenTouch = event => {
|
|
1316
|
+
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1299
1319
|
const start = event => {
|
|
1300
|
-
if (
|
|
1320
|
+
if (hasPointerPenTouch(event)) {
|
|
1301
1321
|
this.touchStartX = event.clientX;
|
|
1302
1322
|
} else if (!this._pointerEvent) {
|
|
1303
1323
|
this.touchStartX = event.touches[0].clientX;
|
|
@@ -1310,7 +1330,7 @@
|
|
|
1310
1330
|
};
|
|
1311
1331
|
|
|
1312
1332
|
const end = event => {
|
|
1313
|
-
if (
|
|
1333
|
+
if (hasPointerPenTouch(event)) {
|
|
1314
1334
|
this.touchDeltaX = event.clientX - this.touchStartX;
|
|
1315
1335
|
}
|
|
1316
1336
|
|
|
@@ -1335,7 +1355,7 @@
|
|
|
1335
1355
|
};
|
|
1336
1356
|
|
|
1337
1357
|
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
|
1338
|
-
EventHandler.on(itemImg, EVENT_DRAG_START,
|
|
1358
|
+
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
|
1339
1359
|
});
|
|
1340
1360
|
|
|
1341
1361
|
if (this._pointerEvent) {
|
|
@@ -1616,7 +1636,7 @@
|
|
|
1616
1636
|
|
|
1617
1637
|
/**
|
|
1618
1638
|
* --------------------------------------------------------------------------
|
|
1619
|
-
* CoreUI (v4.0
|
|
1639
|
+
* CoreUI (v4.1.0): collapse.js
|
|
1620
1640
|
* Licensed under MIT (https://coreui.io/license)
|
|
1621
1641
|
*
|
|
1622
1642
|
* This component is a modified version of the Bootstrap's collapse.js
|
|
@@ -1629,30 +1649,32 @@
|
|
|
1629
1649
|
* ------------------------------------------------------------------------
|
|
1630
1650
|
*/
|
|
1631
1651
|
|
|
1632
|
-
const NAME$
|
|
1633
|
-
const DATA_KEY$
|
|
1634
|
-
const EVENT_KEY$
|
|
1652
|
+
const NAME$c = 'collapse';
|
|
1653
|
+
const DATA_KEY$b = 'coreui.collapse';
|
|
1654
|
+
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
|
1635
1655
|
const DATA_API_KEY$7 = '.data-api';
|
|
1636
|
-
const Default$
|
|
1656
|
+
const Default$b = {
|
|
1637
1657
|
toggle: true,
|
|
1638
|
-
parent:
|
|
1658
|
+
parent: null
|
|
1639
1659
|
};
|
|
1640
|
-
const DefaultType$
|
|
1660
|
+
const DefaultType$b = {
|
|
1641
1661
|
toggle: 'boolean',
|
|
1642
|
-
parent: '(
|
|
1662
|
+
parent: '(null|element)'
|
|
1643
1663
|
};
|
|
1644
|
-
const EVENT_SHOW$6 = `show${EVENT_KEY$
|
|
1645
|
-
const EVENT_SHOWN$6 = `shown${EVENT_KEY$
|
|
1646
|
-
const EVENT_HIDE$6 = `hide${EVENT_KEY$
|
|
1647
|
-
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$
|
|
1648
|
-
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$
|
|
1649
|
-
const CLASS_NAME_SHOW$
|
|
1664
|
+
const EVENT_SHOW$6 = `show${EVENT_KEY$b}`;
|
|
1665
|
+
const EVENT_SHOWN$6 = `shown${EVENT_KEY$b}`;
|
|
1666
|
+
const EVENT_HIDE$6 = `hide${EVENT_KEY$b}`;
|
|
1667
|
+
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$b}`;
|
|
1668
|
+
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
|
|
1669
|
+
const CLASS_NAME_SHOW$9 = 'show';
|
|
1650
1670
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
|
1651
1671
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
|
1652
1672
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
|
1673
|
+
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
|
1674
|
+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
|
1653
1675
|
const WIDTH = 'width';
|
|
1654
1676
|
const HEIGHT = 'height';
|
|
1655
|
-
const SELECTOR_ACTIVES = '.show, .collapsing';
|
|
1677
|
+
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
|
1656
1678
|
const SELECTOR_DATA_TOGGLE$5 = '[data-coreui-toggle="collapse"]';
|
|
1657
1679
|
/**
|
|
1658
1680
|
* ------------------------------------------------------------------------
|
|
@@ -1665,7 +1687,7 @@
|
|
|
1665
1687
|
super(element);
|
|
1666
1688
|
this._isTransitioning = false;
|
|
1667
1689
|
this._config = this._getConfig(config);
|
|
1668
|
-
this._triggerArray =
|
|
1690
|
+
this._triggerArray = [];
|
|
1669
1691
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$5);
|
|
1670
1692
|
|
|
1671
1693
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
|
@@ -1680,10 +1702,10 @@
|
|
|
1680
1702
|
}
|
|
1681
1703
|
}
|
|
1682
1704
|
|
|
1683
|
-
this.
|
|
1705
|
+
this._initializeChildren();
|
|
1684
1706
|
|
|
1685
1707
|
if (!this._config.parent) {
|
|
1686
|
-
this._addAriaAndCollapsedClass(this.
|
|
1708
|
+
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
|
1687
1709
|
}
|
|
1688
1710
|
|
|
1689
1711
|
if (this._config.toggle) {
|
|
@@ -1693,16 +1715,16 @@
|
|
|
1693
1715
|
|
|
1694
1716
|
|
|
1695
1717
|
static get Default() {
|
|
1696
|
-
return Default$
|
|
1718
|
+
return Default$b;
|
|
1697
1719
|
}
|
|
1698
1720
|
|
|
1699
1721
|
static get NAME() {
|
|
1700
|
-
return NAME$
|
|
1722
|
+
return NAME$c;
|
|
1701
1723
|
} // Public
|
|
1702
1724
|
|
|
1703
1725
|
|
|
1704
1726
|
toggle() {
|
|
1705
|
-
if (this.
|
|
1727
|
+
if (this._isShown()) {
|
|
1706
1728
|
this.hide();
|
|
1707
1729
|
} else {
|
|
1708
1730
|
this.show();
|
|
@@ -1710,30 +1732,21 @@
|
|
|
1710
1732
|
}
|
|
1711
1733
|
|
|
1712
1734
|
show() {
|
|
1713
|
-
if (this._isTransitioning || this.
|
|
1735
|
+
if (this._isTransitioning || this._isShown()) {
|
|
1714
1736
|
return;
|
|
1715
1737
|
}
|
|
1716
1738
|
|
|
1717
|
-
let actives;
|
|
1739
|
+
let actives = [];
|
|
1718
1740
|
let activesData;
|
|
1719
1741
|
|
|
1720
|
-
if (this.
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
return elem.getAttribute('data-coreui-parent') === this._config.parent;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
|
1727
|
-
});
|
|
1728
|
-
|
|
1729
|
-
if (actives.length === 0) {
|
|
1730
|
-
actives = null;
|
|
1731
|
-
}
|
|
1742
|
+
if (this._config.parent) {
|
|
1743
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1744
|
+
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
|
1732
1745
|
}
|
|
1733
1746
|
|
|
1734
1747
|
const container = SelectorEngine.findOne(this._selector);
|
|
1735
1748
|
|
|
1736
|
-
if (actives) {
|
|
1749
|
+
if (actives.length) {
|
|
1737
1750
|
const tempActiveData = actives.find(elem => container !== elem);
|
|
1738
1751
|
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
|
1739
1752
|
|
|
@@ -1748,17 +1761,17 @@
|
|
|
1748
1761
|
return;
|
|
1749
1762
|
}
|
|
1750
1763
|
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
}
|
|
1764
|
+
actives.forEach(elemActive => {
|
|
1765
|
+
if (container !== elemActive) {
|
|
1766
|
+
Collapse.getOrCreateInstance(elemActive, {
|
|
1767
|
+
toggle: false
|
|
1768
|
+
}).hide();
|
|
1769
|
+
}
|
|
1756
1770
|
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
}
|
|
1771
|
+
if (!activesData) {
|
|
1772
|
+
Data.set(elemActive, DATA_KEY$b, null);
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1762
1775
|
|
|
1763
1776
|
const dimension = this._getDimension();
|
|
1764
1777
|
|
|
@@ -1768,22 +1781,18 @@
|
|
|
1768
1781
|
|
|
1769
1782
|
this._element.style[dimension] = 0;
|
|
1770
1783
|
|
|
1771
|
-
|
|
1772
|
-
this._triggerArray.forEach(element => {
|
|
1773
|
-
element.classList.remove(CLASS_NAME_COLLAPSED);
|
|
1774
|
-
element.setAttribute('aria-expanded', true);
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1784
|
+
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
|
1777
1785
|
|
|
1778
|
-
this.
|
|
1786
|
+
this._isTransitioning = true;
|
|
1779
1787
|
|
|
1780
1788
|
const complete = () => {
|
|
1789
|
+
this._isTransitioning = false;
|
|
1790
|
+
|
|
1781
1791
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1782
1792
|
|
|
1783
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1793
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1784
1794
|
|
|
1785
1795
|
this._element.style[dimension] = '';
|
|
1786
|
-
this.setTransitioning(false);
|
|
1787
1796
|
EventHandler.trigger(this._element, EVENT_SHOWN$6);
|
|
1788
1797
|
};
|
|
1789
1798
|
|
|
@@ -1796,7 +1805,7 @@
|
|
|
1796
1805
|
}
|
|
1797
1806
|
|
|
1798
1807
|
hide() {
|
|
1799
|
-
if (this._isTransitioning || !this.
|
|
1808
|
+
if (this._isTransitioning || !this._isShown()) {
|
|
1800
1809
|
return;
|
|
1801
1810
|
}
|
|
1802
1811
|
|
|
@@ -1813,26 +1822,23 @@
|
|
|
1813
1822
|
|
|
1814
1823
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
|
1815
1824
|
|
|
1816
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1825
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1817
1826
|
|
|
1818
1827
|
const triggerArrayLength = this._triggerArray.length;
|
|
1819
1828
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
const elem = getElementFromSelector(trigger);
|
|
1829
|
+
for (let i = 0; i < triggerArrayLength; i++) {
|
|
1830
|
+
const trigger = this._triggerArray[i];
|
|
1831
|
+
const elem = getElementFromSelector(trigger);
|
|
1824
1832
|
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
trigger.setAttribute('aria-expanded', false);
|
|
1828
|
-
}
|
|
1833
|
+
if (elem && !this._isShown(elem)) {
|
|
1834
|
+
this._addAriaAndCollapsedClass([trigger], false);
|
|
1829
1835
|
}
|
|
1830
1836
|
}
|
|
1831
1837
|
|
|
1832
|
-
this.
|
|
1838
|
+
this._isTransitioning = true;
|
|
1833
1839
|
|
|
1834
1840
|
const complete = () => {
|
|
1835
|
-
this.
|
|
1841
|
+
this._isTransitioning = false;
|
|
1836
1842
|
|
|
1837
1843
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1838
1844
|
|
|
@@ -1846,45 +1852,47 @@
|
|
|
1846
1852
|
this._queueCallback(complete, this._element, true);
|
|
1847
1853
|
}
|
|
1848
1854
|
|
|
1849
|
-
|
|
1850
|
-
|
|
1855
|
+
_isShown(element = this._element) {
|
|
1856
|
+
return element.classList.contains(CLASS_NAME_SHOW$9);
|
|
1851
1857
|
} // Private
|
|
1852
1858
|
|
|
1853
1859
|
|
|
1854
1860
|
_getConfig(config) {
|
|
1855
|
-
config = { ...Default$
|
|
1861
|
+
config = { ...Default$b,
|
|
1862
|
+
...Manipulator.getDataAttributes(this._element),
|
|
1856
1863
|
...config
|
|
1857
1864
|
};
|
|
1858
1865
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
|
1859
1866
|
|
|
1860
|
-
|
|
1867
|
+
config.parent = getElement(config.parent);
|
|
1868
|
+
typeCheckConfig(NAME$c, config, DefaultType$b);
|
|
1861
1869
|
return config;
|
|
1862
1870
|
}
|
|
1863
1871
|
|
|
1864
1872
|
_getDimension() {
|
|
1865
|
-
return this._element.classList.contains(
|
|
1873
|
+
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
|
1866
1874
|
}
|
|
1867
1875
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
const
|
|
1874
|
-
SelectorEngine.find(
|
|
1876
|
+
_initializeChildren() {
|
|
1877
|
+
if (!this._config.parent) {
|
|
1878
|
+
return;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1882
|
+
SelectorEngine.find(SELECTOR_DATA_TOGGLE$5, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
|
1875
1883
|
const selected = getElementFromSelector(element);
|
|
1876
1884
|
|
|
1877
|
-
|
|
1885
|
+
if (selected) {
|
|
1886
|
+
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
|
1887
|
+
}
|
|
1878
1888
|
});
|
|
1879
|
-
return parent;
|
|
1880
1889
|
}
|
|
1881
1890
|
|
|
1882
|
-
_addAriaAndCollapsedClass(
|
|
1883
|
-
if (!
|
|
1891
|
+
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
|
1892
|
+
if (!triggerArray.length) {
|
|
1884
1893
|
return;
|
|
1885
1894
|
}
|
|
1886
1895
|
|
|
1887
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$a);
|
|
1888
1896
|
triggerArray.forEach(elem => {
|
|
1889
1897
|
if (isOpen) {
|
|
1890
1898
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
|
@@ -1897,33 +1905,23 @@
|
|
|
1897
1905
|
} // Static
|
|
1898
1906
|
|
|
1899
1907
|
|
|
1900
|
-
static
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
...Manipulator.getDataAttributes(element),
|
|
1904
|
-
...(typeof config === 'object' && config ? config : {})
|
|
1905
|
-
};
|
|
1906
|
-
|
|
1907
|
-
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
|
1908
|
-
_config.toggle = false;
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
if (!data) {
|
|
1912
|
-
data = new Collapse(element, _config);
|
|
1913
|
-
}
|
|
1908
|
+
static jQueryInterface(config) {
|
|
1909
|
+
return this.each(function () {
|
|
1910
|
+
const _config = {};
|
|
1914
1911
|
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
throw new TypeError(`No method named "${config}"`);
|
|
1912
|
+
if (typeof config === 'string' && /show|hide/.test(config)) {
|
|
1913
|
+
_config.toggle = false;
|
|
1918
1914
|
}
|
|
1919
1915
|
|
|
1920
|
-
data
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1916
|
+
const data = Collapse.getOrCreateInstance(this, _config);
|
|
1923
1917
|
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1918
|
+
if (typeof config === 'string') {
|
|
1919
|
+
if (typeof data[config] === 'undefined') {
|
|
1920
|
+
throw new TypeError(`No method named "${config}"`);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
data[config]();
|
|
1924
|
+
}
|
|
1927
1925
|
});
|
|
1928
1926
|
}
|
|
1929
1927
|
|
|
@@ -1941,26 +1939,12 @@
|
|
|
1941
1939
|
event.preventDefault();
|
|
1942
1940
|
}
|
|
1943
1941
|
|
|
1944
|
-
const triggerData = Manipulator.getDataAttributes(this);
|
|
1945
1942
|
const selector = getSelectorFromElement(this);
|
|
1946
1943
|
const selectorElements = SelectorEngine.find(selector);
|
|
1947
1944
|
selectorElements.forEach(element => {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
if (data) {
|
|
1952
|
-
// update parent attribute
|
|
1953
|
-
if (data._parent === null && typeof triggerData.parent === 'string') {
|
|
1954
|
-
data._config.parent = triggerData.parent;
|
|
1955
|
-
data._parent = data._getParent();
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
config = 'toggle';
|
|
1959
|
-
} else {
|
|
1960
|
-
config = triggerData;
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
Collapse.collapseInterface(element, config);
|
|
1945
|
+
Collapse.getOrCreateInstance(element, {
|
|
1946
|
+
toggle: false
|
|
1947
|
+
}).toggle();
|
|
1964
1948
|
});
|
|
1965
1949
|
});
|
|
1966
1950
|
/**
|
|
@@ -2115,7 +2099,7 @@
|
|
|
2115
2099
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2116
2100
|
|
|
2117
2101
|
|
|
2118
|
-
|
|
2102
|
+
const applyStyles$1 = {
|
|
2119
2103
|
name: 'applyStyles',
|
|
2120
2104
|
enabled: true,
|
|
2121
2105
|
phase: 'write',
|
|
@@ -2128,7 +2112,10 @@
|
|
|
2128
2112
|
return placement.split('-')[0];
|
|
2129
2113
|
}
|
|
2130
2114
|
|
|
2131
|
-
var
|
|
2115
|
+
var max = Math.max;
|
|
2116
|
+
var min = Math.min;
|
|
2117
|
+
var round = Math.round;
|
|
2118
|
+
|
|
2132
2119
|
function getBoundingClientRect(element, includeScale) {
|
|
2133
2120
|
if (includeScale === void 0) {
|
|
2134
2121
|
includeScale = false;
|
|
@@ -2144,23 +2131,23 @@
|
|
|
2144
2131
|
// Fallback to 1 in case both values are `0`
|
|
2145
2132
|
|
|
2146
2133
|
if (offsetWidth > 0) {
|
|
2147
|
-
scaleX = rect.width / offsetWidth || 1;
|
|
2134
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
2148
2135
|
}
|
|
2149
2136
|
|
|
2150
2137
|
if (offsetHeight > 0) {
|
|
2151
|
-
scaleY = rect.height / offsetHeight || 1;
|
|
2138
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
2152
2139
|
}
|
|
2153
2140
|
}
|
|
2154
2141
|
|
|
2155
2142
|
return {
|
|
2156
|
-
width:
|
|
2157
|
-
height:
|
|
2158
|
-
top:
|
|
2159
|
-
right:
|
|
2160
|
-
bottom:
|
|
2161
|
-
left:
|
|
2162
|
-
x:
|
|
2163
|
-
y:
|
|
2143
|
+
width: rect.width / scaleX,
|
|
2144
|
+
height: rect.height / scaleY,
|
|
2145
|
+
top: rect.top / scaleY,
|
|
2146
|
+
right: rect.right / scaleX,
|
|
2147
|
+
bottom: rect.bottom / scaleY,
|
|
2148
|
+
left: rect.left / scaleX,
|
|
2149
|
+
x: rect.left / scaleX,
|
|
2150
|
+
y: rect.top / scaleY
|
|
2164
2151
|
};
|
|
2165
2152
|
}
|
|
2166
2153
|
|
|
@@ -2305,13 +2292,13 @@
|
|
|
2305
2292
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
2306
2293
|
}
|
|
2307
2294
|
|
|
2308
|
-
var max = Math.max;
|
|
2309
|
-
var min = Math.min;
|
|
2310
|
-
var round = Math.round;
|
|
2311
|
-
|
|
2312
2295
|
function within(min$1, value, max$1) {
|
|
2313
2296
|
return max(min$1, min(value, max$1));
|
|
2314
2297
|
}
|
|
2298
|
+
function withinMaxClamp(min, value, max) {
|
|
2299
|
+
var v = within(min, value, max);
|
|
2300
|
+
return v > max ? max : v;
|
|
2301
|
+
}
|
|
2315
2302
|
|
|
2316
2303
|
function getFreshSideObject() {
|
|
2317
2304
|
return {
|
|
@@ -2405,7 +2392,7 @@
|
|
|
2405
2392
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2406
2393
|
|
|
2407
2394
|
|
|
2408
|
-
|
|
2395
|
+
const arrow$1 = {
|
|
2409
2396
|
name: 'arrow',
|
|
2410
2397
|
enabled: true,
|
|
2411
2398
|
phase: 'main',
|
|
@@ -2434,8 +2421,8 @@
|
|
|
2434
2421
|
var win = window;
|
|
2435
2422
|
var dpr = win.devicePixelRatio || 1;
|
|
2436
2423
|
return {
|
|
2437
|
-
x: round(
|
|
2438
|
-
y: round(
|
|
2424
|
+
x: round(x * dpr) / dpr || 0,
|
|
2425
|
+
y: round(y * dpr) / dpr || 0
|
|
2439
2426
|
};
|
|
2440
2427
|
}
|
|
2441
2428
|
|
|
@@ -2450,7 +2437,8 @@
|
|
|
2450
2437
|
position = _ref2.position,
|
|
2451
2438
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
2452
2439
|
adaptive = _ref2.adaptive,
|
|
2453
|
-
roundOffsets = _ref2.roundOffsets
|
|
2440
|
+
roundOffsets = _ref2.roundOffsets,
|
|
2441
|
+
isFixed = _ref2.isFixed;
|
|
2454
2442
|
|
|
2455
2443
|
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
|
2456
2444
|
_ref3$x = _ref3.x,
|
|
@@ -2482,16 +2470,18 @@
|
|
|
2482
2470
|
offsetParent = offsetParent;
|
|
2483
2471
|
|
|
2484
2472
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
2485
|
-
sideY = bottom;
|
|
2486
|
-
|
|
2487
|
-
|
|
2473
|
+
sideY = bottom;
|
|
2474
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
2475
|
+
offsetParent[heightProp];
|
|
2476
|
+
y -= offsetY - popperRect.height;
|
|
2488
2477
|
y *= gpuAcceleration ? 1 : -1;
|
|
2489
2478
|
}
|
|
2490
2479
|
|
|
2491
2480
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
2492
|
-
sideX = right;
|
|
2493
|
-
|
|
2494
|
-
|
|
2481
|
+
sideX = right;
|
|
2482
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
2483
|
+
offsetParent[widthProp];
|
|
2484
|
+
x -= offsetX - popperRect.width;
|
|
2495
2485
|
x *= gpuAcceleration ? 1 : -1;
|
|
2496
2486
|
}
|
|
2497
2487
|
}
|
|
@@ -2524,7 +2514,8 @@
|
|
|
2524
2514
|
variation: getVariation(state.placement),
|
|
2525
2515
|
popper: state.elements.popper,
|
|
2526
2516
|
popperRect: state.rects.popper,
|
|
2527
|
-
gpuAcceleration: gpuAcceleration
|
|
2517
|
+
gpuAcceleration: gpuAcceleration,
|
|
2518
|
+
isFixed: state.options.strategy === 'fixed'
|
|
2528
2519
|
};
|
|
2529
2520
|
|
|
2530
2521
|
if (state.modifiersData.popperOffsets != null) {
|
|
@@ -2551,7 +2542,7 @@
|
|
|
2551
2542
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2552
2543
|
|
|
2553
2544
|
|
|
2554
|
-
|
|
2545
|
+
const computeStyles$1 = {
|
|
2555
2546
|
name: 'computeStyles',
|
|
2556
2547
|
enabled: true,
|
|
2557
2548
|
phase: 'beforeWrite',
|
|
@@ -2598,7 +2589,7 @@
|
|
|
2598
2589
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2599
2590
|
|
|
2600
2591
|
|
|
2601
|
-
|
|
2592
|
+
const eventListeners = {
|
|
2602
2593
|
name: 'eventListeners',
|
|
2603
2594
|
enabled: true,
|
|
2604
2595
|
phase: 'write',
|
|
@@ -2782,7 +2773,7 @@
|
|
|
2782
2773
|
}
|
|
2783
2774
|
|
|
2784
2775
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
2785
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
|
2776
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
2786
2777
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
2787
2778
|
// clipping (or hiding) overflowing elements with a position different from
|
|
2788
2779
|
// `initial`
|
|
@@ -2799,7 +2790,7 @@
|
|
|
2799
2790
|
|
|
2800
2791
|
|
|
2801
2792
|
return clippingParents.filter(function (clippingParent) {
|
|
2802
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
2793
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle$1(clippingParent).position !== 'static' : true);
|
|
2803
2794
|
});
|
|
2804
2795
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
2805
2796
|
// clipping parents
|
|
@@ -3112,7 +3103,7 @@
|
|
|
3112
3103
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3113
3104
|
|
|
3114
3105
|
|
|
3115
|
-
|
|
3106
|
+
const flip$1 = {
|
|
3116
3107
|
name: 'flip',
|
|
3117
3108
|
enabled: true,
|
|
3118
3109
|
phase: 'main',
|
|
@@ -3174,7 +3165,7 @@
|
|
|
3174
3165
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3175
3166
|
|
|
3176
3167
|
|
|
3177
|
-
|
|
3168
|
+
const hide$1 = {
|
|
3178
3169
|
name: 'hide',
|
|
3179
3170
|
enabled: true,
|
|
3180
3171
|
phase: 'main',
|
|
@@ -3226,7 +3217,7 @@
|
|
|
3226
3217
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3227
3218
|
|
|
3228
3219
|
|
|
3229
|
-
|
|
3220
|
+
const offset$1 = {
|
|
3230
3221
|
name: 'offset',
|
|
3231
3222
|
enabled: true,
|
|
3232
3223
|
phase: 'main',
|
|
@@ -3250,7 +3241,7 @@
|
|
|
3250
3241
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3251
3242
|
|
|
3252
3243
|
|
|
3253
|
-
|
|
3244
|
+
const popperOffsets$1 = {
|
|
3254
3245
|
name: 'popperOffsets',
|
|
3255
3246
|
enabled: true,
|
|
3256
3247
|
phase: 'read',
|
|
@@ -3295,6 +3286,14 @@
|
|
|
3295
3286
|
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
3296
3287
|
placement: state.placement
|
|
3297
3288
|
})) : tetherOffset;
|
|
3289
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
3290
|
+
mainAxis: tetherOffsetValue,
|
|
3291
|
+
altAxis: tetherOffsetValue
|
|
3292
|
+
} : Object.assign({
|
|
3293
|
+
mainAxis: 0,
|
|
3294
|
+
altAxis: 0
|
|
3295
|
+
}, tetherOffsetValue);
|
|
3296
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
3298
3297
|
var data = {
|
|
3299
3298
|
x: 0,
|
|
3300
3299
|
y: 0
|
|
@@ -3304,13 +3303,15 @@
|
|
|
3304
3303
|
return;
|
|
3305
3304
|
}
|
|
3306
3305
|
|
|
3307
|
-
if (checkMainAxis
|
|
3306
|
+
if (checkMainAxis) {
|
|
3307
|
+
var _offsetModifierState$;
|
|
3308
|
+
|
|
3308
3309
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
3309
3310
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
3310
3311
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
3311
3312
|
var offset = popperOffsets[mainAxis];
|
|
3312
|
-
var min$1 =
|
|
3313
|
-
var max$1 =
|
|
3313
|
+
var min$1 = offset + overflow[mainSide];
|
|
3314
|
+
var max$1 = offset - overflow[altSide];
|
|
3314
3315
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
3315
3316
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
3316
3317
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -3330,43 +3331,52 @@
|
|
|
3330
3331
|
// width or height)
|
|
3331
3332
|
|
|
3332
3333
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
3333
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
|
3334
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
|
3334
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
3335
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
3335
3336
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
3336
3337
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
3337
|
-
var offsetModifierValue =
|
|
3338
|
-
var tetherMin =
|
|
3339
|
-
var tetherMax =
|
|
3338
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
3339
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
3340
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
3341
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
3342
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
3343
|
+
data[mainAxis] = preventedOffset - offset;
|
|
3344
|
+
}
|
|
3340
3345
|
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
+
if (checkAltAxis) {
|
|
3347
|
+
var _offsetModifierState$2;
|
|
3348
|
+
|
|
3349
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
3350
|
+
|
|
3351
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
3352
|
+
|
|
3353
|
+
var _offset = popperOffsets[altAxis];
|
|
3354
|
+
|
|
3355
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
3356
|
+
|
|
3357
|
+
var _min = _offset + overflow[_mainSide];
|
|
3346
3358
|
|
|
3347
|
-
|
|
3348
|
-
var _mainSide = mainAxis === 'x' ? top : left;
|
|
3359
|
+
var _max = _offset - overflow[_altSide];
|
|
3349
3360
|
|
|
3350
|
-
|
|
3361
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
3351
3362
|
|
|
3352
|
-
|
|
3363
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
3353
3364
|
|
|
3354
|
-
|
|
3365
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
3355
3366
|
|
|
3356
|
-
|
|
3367
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
3357
3368
|
|
|
3358
|
-
|
|
3369
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
3359
3370
|
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
}
|
|
3371
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
3372
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
3363
3373
|
}
|
|
3364
3374
|
|
|
3365
3375
|
state.modifiersData[name] = data;
|
|
3366
3376
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3367
3377
|
|
|
3368
3378
|
|
|
3369
|
-
|
|
3379
|
+
const preventOverflow$1 = {
|
|
3370
3380
|
name: 'preventOverflow',
|
|
3371
3381
|
enabled: true,
|
|
3372
3382
|
phase: 'main',
|
|
@@ -3391,8 +3401,8 @@
|
|
|
3391
3401
|
|
|
3392
3402
|
function isElementScaled(element) {
|
|
3393
3403
|
var rect = element.getBoundingClientRect();
|
|
3394
|
-
var scaleX = rect.width / element.offsetWidth || 1;
|
|
3395
|
-
var scaleY = rect.height / element.offsetHeight || 1;
|
|
3404
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
3405
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
3396
3406
|
return scaleX !== 1 || scaleY !== 1;
|
|
3397
3407
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
3398
3408
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -3716,41 +3726,41 @@
|
|
|
3716
3726
|
defaultModifiers: defaultModifiers
|
|
3717
3727
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
3718
3728
|
|
|
3719
|
-
|
|
3729
|
+
const Popper = /*#__PURE__*/Object.freeze({
|
|
3720
3730
|
__proto__: null,
|
|
3721
|
-
popperGenerator
|
|
3722
|
-
detectOverflow
|
|
3731
|
+
popperGenerator,
|
|
3732
|
+
detectOverflow,
|
|
3723
3733
|
createPopperBase: createPopper$2,
|
|
3724
|
-
createPopper
|
|
3734
|
+
createPopper,
|
|
3725
3735
|
createPopperLite: createPopper$1,
|
|
3726
|
-
top
|
|
3727
|
-
bottom
|
|
3728
|
-
right
|
|
3729
|
-
left
|
|
3730
|
-
auto
|
|
3731
|
-
basePlacements
|
|
3732
|
-
start
|
|
3733
|
-
end
|
|
3734
|
-
clippingParents
|
|
3735
|
-
viewport
|
|
3736
|
-
popper
|
|
3737
|
-
reference
|
|
3738
|
-
variationPlacements
|
|
3739
|
-
placements
|
|
3740
|
-
beforeRead
|
|
3741
|
-
read
|
|
3742
|
-
afterRead
|
|
3743
|
-
beforeMain
|
|
3744
|
-
main
|
|
3745
|
-
afterMain
|
|
3746
|
-
beforeWrite
|
|
3747
|
-
write
|
|
3748
|
-
afterWrite
|
|
3749
|
-
modifierPhases
|
|
3736
|
+
top,
|
|
3737
|
+
bottom,
|
|
3738
|
+
right,
|
|
3739
|
+
left,
|
|
3740
|
+
auto,
|
|
3741
|
+
basePlacements,
|
|
3742
|
+
start,
|
|
3743
|
+
end,
|
|
3744
|
+
clippingParents,
|
|
3745
|
+
viewport,
|
|
3746
|
+
popper,
|
|
3747
|
+
reference,
|
|
3748
|
+
variationPlacements,
|
|
3749
|
+
placements,
|
|
3750
|
+
beforeRead,
|
|
3751
|
+
read,
|
|
3752
|
+
afterRead,
|
|
3753
|
+
beforeMain,
|
|
3754
|
+
main,
|
|
3755
|
+
afterMain,
|
|
3756
|
+
beforeWrite,
|
|
3757
|
+
write,
|
|
3758
|
+
afterWrite,
|
|
3759
|
+
modifierPhases,
|
|
3750
3760
|
applyStyles: applyStyles$1,
|
|
3751
3761
|
arrow: arrow$1,
|
|
3752
3762
|
computeStyles: computeStyles$1,
|
|
3753
|
-
eventListeners
|
|
3763
|
+
eventListeners,
|
|
3754
3764
|
flip: flip$1,
|
|
3755
3765
|
hide: hide$1,
|
|
3756
3766
|
offset: offset$1,
|
|
@@ -3760,7 +3770,7 @@
|
|
|
3760
3770
|
|
|
3761
3771
|
/**
|
|
3762
3772
|
* --------------------------------------------------------------------------
|
|
3763
|
-
* CoreUI (v4.0
|
|
3773
|
+
* CoreUI (v4.1.0): dropdown.js
|
|
3764
3774
|
* Licensed under MIT (https://coreui.io/license)
|
|
3765
3775
|
*
|
|
3766
3776
|
* This component is a modified version of the Bootstrap's dropdown.js
|
|
@@ -3773,27 +3783,26 @@
|
|
|
3773
3783
|
* ------------------------------------------------------------------------
|
|
3774
3784
|
*/
|
|
3775
3785
|
|
|
3776
|
-
const NAME$
|
|
3777
|
-
const DATA_KEY$
|
|
3778
|
-
const EVENT_KEY$
|
|
3786
|
+
const NAME$b = 'dropdown';
|
|
3787
|
+
const DATA_KEY$a = 'coreui.dropdown';
|
|
3788
|
+
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
|
3779
3789
|
const DATA_API_KEY$6 = '.data-api';
|
|
3780
3790
|
const ESCAPE_KEY$2 = 'Escape';
|
|
3781
3791
|
const SPACE_KEY = 'Space';
|
|
3782
|
-
const TAB_KEY = 'Tab';
|
|
3792
|
+
const TAB_KEY$1 = 'Tab';
|
|
3783
3793
|
const ARROW_UP_KEY = 'ArrowUp';
|
|
3784
3794
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
3785
3795
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
|
3786
3796
|
|
|
3787
3797
|
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
|
|
3788
|
-
const EVENT_HIDE$5 = `hide${EVENT_KEY$
|
|
3789
|
-
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$
|
|
3790
|
-
const EVENT_SHOW$5 = `show${EVENT_KEY$
|
|
3791
|
-
const EVENT_SHOWN$5 = `shown${EVENT_KEY$
|
|
3792
|
-
const
|
|
3793
|
-
const
|
|
3794
|
-
const
|
|
3795
|
-
const
|
|
3796
|
-
const CLASS_NAME_SHOW$9 = 'show';
|
|
3798
|
+
const EVENT_HIDE$5 = `hide${EVENT_KEY$a}`;
|
|
3799
|
+
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$a}`;
|
|
3800
|
+
const EVENT_SHOW$5 = `show${EVENT_KEY$a}`;
|
|
3801
|
+
const EVENT_SHOWN$5 = `shown${EVENT_KEY$a}`;
|
|
3802
|
+
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
3803
|
+
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
3804
|
+
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
3805
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
|
3797
3806
|
const CLASS_NAME_DROPUP = 'dropup';
|
|
3798
3807
|
const CLASS_NAME_DROPEND = 'dropend';
|
|
3799
3808
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
|
@@ -3808,7 +3817,7 @@
|
|
|
3808
3817
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
|
3809
3818
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
|
3810
3819
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
|
3811
|
-
const Default$
|
|
3820
|
+
const Default$a = {
|
|
3812
3821
|
offset: [0, 2],
|
|
3813
3822
|
boundary: 'clippingParents',
|
|
3814
3823
|
reference: 'toggle',
|
|
@@ -3816,7 +3825,7 @@
|
|
|
3816
3825
|
popperConfig: null,
|
|
3817
3826
|
autoClose: true
|
|
3818
3827
|
};
|
|
3819
|
-
const DefaultType$
|
|
3828
|
+
const DefaultType$a = {
|
|
3820
3829
|
offset: '(array|string|function)',
|
|
3821
3830
|
boundary: '(string|element)',
|
|
3822
3831
|
reference: '(string|element|object)',
|
|
@@ -3837,45 +3846,31 @@
|
|
|
3837
3846
|
this._config = this._getConfig(config);
|
|
3838
3847
|
this._menu = this._getMenuElement();
|
|
3839
3848
|
this._inNavbar = this._detectNavbar();
|
|
3840
|
-
|
|
3841
|
-
this._addEventListeners();
|
|
3842
3849
|
} // Getters
|
|
3843
3850
|
|
|
3844
3851
|
|
|
3845
3852
|
static get Default() {
|
|
3846
|
-
return Default$
|
|
3853
|
+
return Default$a;
|
|
3847
3854
|
}
|
|
3848
3855
|
|
|
3849
3856
|
static get DefaultType() {
|
|
3850
|
-
return DefaultType$
|
|
3857
|
+
return DefaultType$a;
|
|
3851
3858
|
}
|
|
3852
3859
|
|
|
3853
3860
|
static get NAME() {
|
|
3854
|
-
return NAME$
|
|
3861
|
+
return NAME$b;
|
|
3855
3862
|
} // Public
|
|
3856
3863
|
|
|
3857
3864
|
|
|
3858
3865
|
toggle() {
|
|
3859
|
-
|
|
3860
|
-
return;
|
|
3861
|
-
}
|
|
3862
|
-
|
|
3863
|
-
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$9);
|
|
3864
|
-
|
|
3865
|
-
if (isActive) {
|
|
3866
|
-
this.hide();
|
|
3867
|
-
return;
|
|
3868
|
-
}
|
|
3869
|
-
|
|
3870
|
-
this.show();
|
|
3866
|
+
return this._isShown() ? this.hide() : this.show();
|
|
3871
3867
|
}
|
|
3872
3868
|
|
|
3873
3869
|
show() {
|
|
3874
|
-
if (isDisabled(this._element) || this._menu
|
|
3870
|
+
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
|
3875
3871
|
return;
|
|
3876
3872
|
}
|
|
3877
3873
|
|
|
3878
|
-
const parent = Dropdown.getParentFromElement(this._element);
|
|
3879
3874
|
const relatedTarget = {
|
|
3880
3875
|
relatedTarget: this._element
|
|
3881
3876
|
};
|
|
@@ -3883,34 +3878,14 @@
|
|
|
3883
3878
|
|
|
3884
3879
|
if (showEvent.defaultPrevented) {
|
|
3885
3880
|
return;
|
|
3886
|
-
}
|
|
3881
|
+
}
|
|
3887
3882
|
|
|
3883
|
+
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
|
3888
3884
|
|
|
3889
3885
|
if (this._inNavbar) {
|
|
3890
3886
|
Manipulator.setDataAttribute(this._menu, 'popper', 'none');
|
|
3891
3887
|
} else {
|
|
3892
|
-
|
|
3893
|
-
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
3894
|
-
}
|
|
3895
|
-
|
|
3896
|
-
let referenceElement = this._element;
|
|
3897
|
-
|
|
3898
|
-
if (this._config.reference === 'parent') {
|
|
3899
|
-
referenceElement = parent;
|
|
3900
|
-
} else if (isElement$1(this._config.reference)) {
|
|
3901
|
-
referenceElement = getElement(this._config.reference);
|
|
3902
|
-
} else if (typeof this._config.reference === 'object') {
|
|
3903
|
-
referenceElement = this._config.reference;
|
|
3904
|
-
}
|
|
3905
|
-
|
|
3906
|
-
const popperConfig = this._getPopperConfig();
|
|
3907
|
-
|
|
3908
|
-
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
3909
|
-
this._popper = createPopper(referenceElement, this._menu, popperConfig);
|
|
3910
|
-
|
|
3911
|
-
if (isDisplayStatic) {
|
|
3912
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
3913
|
-
}
|
|
3888
|
+
this._createPopper(parent);
|
|
3914
3889
|
} // If this is a touch-enabled device we add extra
|
|
3915
3890
|
// empty mouseover listeners to the body's immediate children;
|
|
3916
3891
|
// only needed because of broken event delegation on iOS
|
|
@@ -3925,15 +3900,15 @@
|
|
|
3925
3900
|
|
|
3926
3901
|
this._element.setAttribute('aria-expanded', true);
|
|
3927
3902
|
|
|
3928
|
-
this._menu.classList.
|
|
3903
|
+
this._menu.classList.add(CLASS_NAME_SHOW$8);
|
|
3929
3904
|
|
|
3930
|
-
this._element.classList.
|
|
3905
|
+
this._element.classList.add(CLASS_NAME_SHOW$8);
|
|
3931
3906
|
|
|
3932
3907
|
EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);
|
|
3933
3908
|
}
|
|
3934
3909
|
|
|
3935
3910
|
hide() {
|
|
3936
|
-
if (isDisabled(this._element) || !this._menu
|
|
3911
|
+
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
|
3937
3912
|
return;
|
|
3938
3913
|
}
|
|
3939
3914
|
|
|
@@ -3961,13 +3936,6 @@
|
|
|
3961
3936
|
} // Private
|
|
3962
3937
|
|
|
3963
3938
|
|
|
3964
|
-
_addEventListeners() {
|
|
3965
|
-
EventHandler.on(this._element, EVENT_CLICK, event => {
|
|
3966
|
-
event.preventDefault();
|
|
3967
|
-
this.toggle();
|
|
3968
|
-
});
|
|
3969
|
-
}
|
|
3970
|
-
|
|
3971
3939
|
_completeHide(relatedTarget) {
|
|
3972
3940
|
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);
|
|
3973
3941
|
|
|
@@ -3985,9 +3953,9 @@
|
|
|
3985
3953
|
this._popper.destroy();
|
|
3986
3954
|
}
|
|
3987
3955
|
|
|
3988
|
-
this._menu.classList.remove(CLASS_NAME_SHOW$
|
|
3956
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$8);
|
|
3989
3957
|
|
|
3990
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
3958
|
+
this._element.classList.remove(CLASS_NAME_SHOW$8);
|
|
3991
3959
|
|
|
3992
3960
|
this._element.setAttribute('aria-expanded', 'false');
|
|
3993
3961
|
|
|
@@ -4000,16 +3968,45 @@
|
|
|
4000
3968
|
...Manipulator.getDataAttributes(this._element),
|
|
4001
3969
|
...config
|
|
4002
3970
|
};
|
|
4003
|
-
typeCheckConfig(NAME$
|
|
3971
|
+
typeCheckConfig(NAME$b, config, this.constructor.DefaultType);
|
|
4004
3972
|
|
|
4005
3973
|
if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
4006
3974
|
// Popper virtual elements require a getBoundingClientRect method
|
|
4007
|
-
throw new TypeError(`${NAME$
|
|
3975
|
+
throw new TypeError(`${NAME$b.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
|
4008
3976
|
}
|
|
4009
3977
|
|
|
4010
3978
|
return config;
|
|
4011
3979
|
}
|
|
4012
3980
|
|
|
3981
|
+
_createPopper(parent) {
|
|
3982
|
+
if (typeof Popper === 'undefined') {
|
|
3983
|
+
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
3984
|
+
}
|
|
3985
|
+
|
|
3986
|
+
let referenceElement = this._element;
|
|
3987
|
+
|
|
3988
|
+
if (this._config.reference === 'parent') {
|
|
3989
|
+
referenceElement = parent;
|
|
3990
|
+
} else if (isElement$1(this._config.reference)) {
|
|
3991
|
+
referenceElement = getElement(this._config.reference);
|
|
3992
|
+
} else if (typeof this._config.reference === 'object') {
|
|
3993
|
+
referenceElement = this._config.reference;
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3996
|
+
const popperConfig = this._getPopperConfig();
|
|
3997
|
+
|
|
3998
|
+
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
3999
|
+
this._popper = createPopper(referenceElement, this._menu, popperConfig);
|
|
4000
|
+
|
|
4001
|
+
if (isDisplayStatic) {
|
|
4002
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
4003
|
+
}
|
|
4004
|
+
}
|
|
4005
|
+
|
|
4006
|
+
_isShown(element = this._element) {
|
|
4007
|
+
return element.classList.contains(CLASS_NAME_SHOW$8);
|
|
4008
|
+
}
|
|
4009
|
+
|
|
4013
4010
|
_getMenuElement() {
|
|
4014
4011
|
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
|
|
4015
4012
|
}
|
|
@@ -4099,26 +4096,24 @@
|
|
|
4099
4096
|
} // Static
|
|
4100
4097
|
|
|
4101
4098
|
|
|
4102
|
-
static
|
|
4103
|
-
|
|
4099
|
+
static jQueryInterface(config) {
|
|
4100
|
+
return this.each(function () {
|
|
4101
|
+
const data = Dropdown.getOrCreateInstance(this, config);
|
|
4102
|
+
|
|
4103
|
+
if (typeof config !== 'string') {
|
|
4104
|
+
return;
|
|
4105
|
+
}
|
|
4104
4106
|
|
|
4105
|
-
if (typeof config === 'string') {
|
|
4106
4107
|
if (typeof data[config] === 'undefined') {
|
|
4107
4108
|
throw new TypeError(`No method named "${config}"`);
|
|
4108
4109
|
}
|
|
4109
4110
|
|
|
4110
4111
|
data[config]();
|
|
4111
|
-
}
|
|
4112
|
-
}
|
|
4113
|
-
|
|
4114
|
-
static jQueryInterface(config) {
|
|
4115
|
-
return this.each(function () {
|
|
4116
|
-
Dropdown.dropdownInterface(this, config);
|
|
4117
4112
|
});
|
|
4118
4113
|
}
|
|
4119
4114
|
|
|
4120
4115
|
static clearMenus(event) {
|
|
4121
|
-
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
|
4116
|
+
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
|
|
4122
4117
|
return;
|
|
4123
4118
|
}
|
|
4124
4119
|
|
|
@@ -4131,7 +4126,7 @@
|
|
|
4131
4126
|
continue;
|
|
4132
4127
|
}
|
|
4133
4128
|
|
|
4134
|
-
if (!context.
|
|
4129
|
+
if (!context._isShown()) {
|
|
4135
4130
|
continue;
|
|
4136
4131
|
}
|
|
4137
4132
|
|
|
@@ -4148,7 +4143,7 @@
|
|
|
4148
4143
|
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
|
4149
4144
|
|
|
4150
4145
|
|
|
4151
|
-
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
4146
|
+
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
4152
4147
|
continue;
|
|
4153
4148
|
}
|
|
4154
4149
|
|
|
@@ -4177,7 +4172,7 @@
|
|
|
4177
4172
|
return;
|
|
4178
4173
|
}
|
|
4179
4174
|
|
|
4180
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$
|
|
4175
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$8);
|
|
4181
4176
|
|
|
4182
4177
|
if (!isActive && event.key === ESCAPE_KEY$2) {
|
|
4183
4178
|
return;
|
|
@@ -4190,20 +4185,20 @@
|
|
|
4190
4185
|
return;
|
|
4191
4186
|
}
|
|
4192
4187
|
|
|
4193
|
-
const getToggleButton =
|
|
4188
|
+
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$4) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$4)[0];
|
|
4189
|
+
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
4194
4190
|
|
|
4195
4191
|
if (event.key === ESCAPE_KEY$2) {
|
|
4196
|
-
|
|
4197
|
-
Dropdown.clearMenus();
|
|
4192
|
+
instance.hide();
|
|
4198
4193
|
return;
|
|
4199
4194
|
}
|
|
4200
4195
|
|
|
4201
4196
|
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
|
4202
4197
|
if (!isActive) {
|
|
4203
|
-
|
|
4198
|
+
instance.show();
|
|
4204
4199
|
}
|
|
4205
4200
|
|
|
4206
|
-
|
|
4201
|
+
instance._selectMenuItem(event);
|
|
4207
4202
|
|
|
4208
4203
|
return;
|
|
4209
4204
|
}
|
|
@@ -4227,7 +4222,7 @@
|
|
|
4227
4222
|
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
|
4228
4223
|
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, function (event) {
|
|
4229
4224
|
event.preventDefault();
|
|
4230
|
-
Dropdown.
|
|
4225
|
+
Dropdown.getOrCreateInstance(this).toggle();
|
|
4231
4226
|
});
|
|
4232
4227
|
/**
|
|
4233
4228
|
* ------------------------------------------------------------------------
|
|
@@ -4240,7 +4235,7 @@
|
|
|
4240
4235
|
|
|
4241
4236
|
/**
|
|
4242
4237
|
* --------------------------------------------------------------------------
|
|
4243
|
-
* Bootstrap (v5.
|
|
4238
|
+
* Bootstrap (v5.1.3): util/scrollBar.js
|
|
4244
4239
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4245
4240
|
* --------------------------------------------------------------------------
|
|
4246
4241
|
*/
|
|
@@ -4344,11 +4339,12 @@
|
|
|
4344
4339
|
|
|
4345
4340
|
/**
|
|
4346
4341
|
* --------------------------------------------------------------------------
|
|
4347
|
-
* Bootstrap (v5.
|
|
4348
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
|
4342
|
+
* Bootstrap (v5.1.3): util/backdrop.js
|
|
4343
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4349
4344
|
* --------------------------------------------------------------------------
|
|
4350
4345
|
*/
|
|
4351
|
-
const Default$
|
|
4346
|
+
const Default$9 = {
|
|
4347
|
+
className: 'modal-backdrop',
|
|
4352
4348
|
isVisible: true,
|
|
4353
4349
|
// if false, we use the backdrop helper without adding any element to the dom
|
|
4354
4350
|
isAnimated: false,
|
|
@@ -4356,17 +4352,17 @@
|
|
|
4356
4352
|
// give the choice to place backdrop under different elements
|
|
4357
4353
|
clickCallback: null
|
|
4358
4354
|
};
|
|
4359
|
-
const DefaultType$
|
|
4355
|
+
const DefaultType$9 = {
|
|
4356
|
+
className: 'string',
|
|
4360
4357
|
isVisible: 'boolean',
|
|
4361
4358
|
isAnimated: 'boolean',
|
|
4362
4359
|
rootElement: '(element|string)',
|
|
4363
4360
|
clickCallback: '(function|null)'
|
|
4364
4361
|
};
|
|
4365
|
-
const NAME$
|
|
4366
|
-
const
|
|
4367
|
-
const
|
|
4368
|
-
const
|
|
4369
|
-
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$9}`;
|
|
4362
|
+
const NAME$a = 'backdrop';
|
|
4363
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
|
4364
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
|
4365
|
+
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$a}`;
|
|
4370
4366
|
|
|
4371
4367
|
class Backdrop {
|
|
4372
4368
|
constructor(config) {
|
|
@@ -4387,7 +4383,7 @@
|
|
|
4387
4383
|
reflow(this._getElement());
|
|
4388
4384
|
}
|
|
4389
4385
|
|
|
4390
|
-
this._getElement().classList.add(CLASS_NAME_SHOW$
|
|
4386
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$7);
|
|
4391
4387
|
|
|
4392
4388
|
this._emulateAnimation(() => {
|
|
4393
4389
|
execute(callback);
|
|
@@ -4400,7 +4396,7 @@
|
|
|
4400
4396
|
return;
|
|
4401
4397
|
}
|
|
4402
4398
|
|
|
4403
|
-
this._getElement().classList.remove(CLASS_NAME_SHOW$
|
|
4399
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$7);
|
|
4404
4400
|
|
|
4405
4401
|
this._emulateAnimation(() => {
|
|
4406
4402
|
this.dispose();
|
|
@@ -4412,10 +4408,10 @@
|
|
|
4412
4408
|
_getElement() {
|
|
4413
4409
|
if (!this._element) {
|
|
4414
4410
|
const backdrop = document.createElement('div');
|
|
4415
|
-
backdrop.className =
|
|
4411
|
+
backdrop.className = this._config.className;
|
|
4416
4412
|
|
|
4417
4413
|
if (this._config.isAnimated) {
|
|
4418
|
-
backdrop.classList.add(CLASS_NAME_FADE$
|
|
4414
|
+
backdrop.classList.add(CLASS_NAME_FADE$5);
|
|
4419
4415
|
}
|
|
4420
4416
|
|
|
4421
4417
|
this._element = backdrop;
|
|
@@ -4425,12 +4421,12 @@
|
|
|
4425
4421
|
}
|
|
4426
4422
|
|
|
4427
4423
|
_getConfig(config) {
|
|
4428
|
-
config = { ...Default$
|
|
4424
|
+
config = { ...Default$9,
|
|
4429
4425
|
...(typeof config === 'object' ? config : {})
|
|
4430
4426
|
}; // use getElement() with the default "body" to get a fresh Element on each instantiation
|
|
4431
4427
|
|
|
4432
4428
|
config.rootElement = getElement(config.rootElement);
|
|
4433
|
-
typeCheckConfig(NAME$
|
|
4429
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
|
4434
4430
|
return config;
|
|
4435
4431
|
}
|
|
4436
4432
|
|
|
@@ -4439,7 +4435,7 @@
|
|
|
4439
4435
|
return;
|
|
4440
4436
|
}
|
|
4441
4437
|
|
|
4442
|
-
this._config.rootElement.
|
|
4438
|
+
this._config.rootElement.append(this._getElement());
|
|
4443
4439
|
|
|
4444
4440
|
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
|
4445
4441
|
execute(this._config.clickCallback);
|
|
@@ -4467,7 +4463,110 @@
|
|
|
4467
4463
|
|
|
4468
4464
|
/**
|
|
4469
4465
|
* --------------------------------------------------------------------------
|
|
4470
|
-
|
|
4466
|
+
* Bootstrap (v5.1.3): util/focustrap.js
|
|
4467
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4468
|
+
* --------------------------------------------------------------------------
|
|
4469
|
+
*/
|
|
4470
|
+
const Default$8 = {
|
|
4471
|
+
trapElement: null,
|
|
4472
|
+
// The element to trap focus inside of
|
|
4473
|
+
autofocus: true
|
|
4474
|
+
};
|
|
4475
|
+
const DefaultType$8 = {
|
|
4476
|
+
trapElement: 'element',
|
|
4477
|
+
autofocus: 'boolean'
|
|
4478
|
+
};
|
|
4479
|
+
const NAME$9 = 'focustrap';
|
|
4480
|
+
const DATA_KEY$9 = 'coreui.focustrap';
|
|
4481
|
+
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
|
4482
|
+
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$9}`;
|
|
4483
|
+
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$9}`;
|
|
4484
|
+
const TAB_KEY = 'Tab';
|
|
4485
|
+
const TAB_NAV_FORWARD = 'forward';
|
|
4486
|
+
const TAB_NAV_BACKWARD = 'backward';
|
|
4487
|
+
|
|
4488
|
+
class FocusTrap {
|
|
4489
|
+
constructor(config) {
|
|
4490
|
+
this._config = this._getConfig(config);
|
|
4491
|
+
this._isActive = false;
|
|
4492
|
+
this._lastTabNavDirection = null;
|
|
4493
|
+
}
|
|
4494
|
+
|
|
4495
|
+
activate() {
|
|
4496
|
+
const {
|
|
4497
|
+
trapElement,
|
|
4498
|
+
autofocus
|
|
4499
|
+
} = this._config;
|
|
4500
|
+
|
|
4501
|
+
if (this._isActive) {
|
|
4502
|
+
return;
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
if (autofocus) {
|
|
4506
|
+
trapElement.focus();
|
|
4507
|
+
}
|
|
4508
|
+
|
|
4509
|
+
EventHandler.off(document, EVENT_KEY$9); // guard against infinite focus loop
|
|
4510
|
+
|
|
4511
|
+
EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
|
|
4512
|
+
EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
|
|
4513
|
+
this._isActive = true;
|
|
4514
|
+
}
|
|
4515
|
+
|
|
4516
|
+
deactivate() {
|
|
4517
|
+
if (!this._isActive) {
|
|
4518
|
+
return;
|
|
4519
|
+
}
|
|
4520
|
+
|
|
4521
|
+
this._isActive = false;
|
|
4522
|
+
EventHandler.off(document, EVENT_KEY$9);
|
|
4523
|
+
} // Private
|
|
4524
|
+
|
|
4525
|
+
|
|
4526
|
+
_handleFocusin(event) {
|
|
4527
|
+
const {
|
|
4528
|
+
target
|
|
4529
|
+
} = event;
|
|
4530
|
+
const {
|
|
4531
|
+
trapElement
|
|
4532
|
+
} = this._config;
|
|
4533
|
+
|
|
4534
|
+
if (target === document || target === trapElement || trapElement.contains(target)) {
|
|
4535
|
+
return;
|
|
4536
|
+
}
|
|
4537
|
+
|
|
4538
|
+
const elements = SelectorEngine.focusableChildren(trapElement);
|
|
4539
|
+
|
|
4540
|
+
if (elements.length === 0) {
|
|
4541
|
+
trapElement.focus();
|
|
4542
|
+
} else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
|
|
4543
|
+
elements[elements.length - 1].focus();
|
|
4544
|
+
} else {
|
|
4545
|
+
elements[0].focus();
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
|
|
4549
|
+
_handleKeydown(event) {
|
|
4550
|
+
if (event.key !== TAB_KEY) {
|
|
4551
|
+
return;
|
|
4552
|
+
}
|
|
4553
|
+
|
|
4554
|
+
this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
|
|
4555
|
+
}
|
|
4556
|
+
|
|
4557
|
+
_getConfig(config) {
|
|
4558
|
+
config = { ...Default$8,
|
|
4559
|
+
...(typeof config === 'object' ? config : {})
|
|
4560
|
+
};
|
|
4561
|
+
typeCheckConfig(NAME$9, config, DefaultType$8);
|
|
4562
|
+
return config;
|
|
4563
|
+
}
|
|
4564
|
+
|
|
4565
|
+
}
|
|
4566
|
+
|
|
4567
|
+
/**
|
|
4568
|
+
* --------------------------------------------------------------------------
|
|
4569
|
+
* CoreUI (v4.1.0): modal.js
|
|
4471
4570
|
* Licensed under MIT (https://coreui.io/license)
|
|
4472
4571
|
*
|
|
4473
4572
|
* This component is a modified version of the Bootstrap's modal.js
|
|
@@ -4500,21 +4599,20 @@
|
|
|
4500
4599
|
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
|
|
4501
4600
|
const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
|
|
4502
4601
|
const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
|
|
4503
|
-
const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$8}`;
|
|
4504
4602
|
const EVENT_RESIZE$1 = `resize${EVENT_KEY$8}`;
|
|
4505
|
-
const EVENT_CLICK_DISMISS
|
|
4603
|
+
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$8}`;
|
|
4506
4604
|
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$8}`;
|
|
4507
4605
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$8}`;
|
|
4508
4606
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$8}`;
|
|
4509
4607
|
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
|
|
4510
4608
|
const CLASS_NAME_OPEN = 'modal-open';
|
|
4511
|
-
const CLASS_NAME_FADE$
|
|
4512
|
-
const CLASS_NAME_SHOW$
|
|
4609
|
+
const CLASS_NAME_FADE$4 = 'fade';
|
|
4610
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
|
4513
4611
|
const CLASS_NAME_STATIC = 'modal-static';
|
|
4612
|
+
const OPEN_SELECTOR$1 = '.modal.show';
|
|
4514
4613
|
const SELECTOR_DIALOG = '.modal-dialog';
|
|
4515
4614
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
|
4516
4615
|
const SELECTOR_DATA_TOGGLE$3 = '[data-coreui-toggle="modal"]';
|
|
4517
|
-
const SELECTOR_DATA_DISMISS$2 = '[data-coreui-dismiss="modal"]';
|
|
4518
4616
|
/**
|
|
4519
4617
|
* ------------------------------------------------------------------------
|
|
4520
4618
|
* Class Definition
|
|
@@ -4527,6 +4625,7 @@
|
|
|
4527
4625
|
this._config = this._getConfig(config);
|
|
4528
4626
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
|
4529
4627
|
this._backdrop = this._initializeBackDrop();
|
|
4628
|
+
this._focustrap = this._initializeFocusTrap();
|
|
4530
4629
|
this._isShown = false;
|
|
4531
4630
|
this._ignoreBackdropClick = false;
|
|
4532
4631
|
this._isTransitioning = false;
|
|
@@ -4576,7 +4675,6 @@
|
|
|
4576
4675
|
|
|
4577
4676
|
this._setResizeEvent();
|
|
4578
4677
|
|
|
4579
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
|
|
4580
4678
|
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
|
|
4581
4679
|
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
|
|
4582
4680
|
if (event.target === this._element) {
|
|
@@ -4588,11 +4686,7 @@
|
|
|
4588
4686
|
this._showBackdrop(() => this._showElement(relatedTarget));
|
|
4589
4687
|
}
|
|
4590
4688
|
|
|
4591
|
-
hide(
|
|
4592
|
-
if (event && ['A', 'AREA'].includes(event.target.tagName)) {
|
|
4593
|
-
event.preventDefault();
|
|
4594
|
-
}
|
|
4595
|
-
|
|
4689
|
+
hide() {
|
|
4596
4690
|
if (!this._isShown || this._isTransitioning) {
|
|
4597
4691
|
return;
|
|
4598
4692
|
}
|
|
@@ -4615,11 +4709,11 @@
|
|
|
4615
4709
|
|
|
4616
4710
|
this._setResizeEvent();
|
|
4617
4711
|
|
|
4618
|
-
|
|
4712
|
+
this._focustrap.deactivate();
|
|
4619
4713
|
|
|
4620
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
4714
|
+
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
|
4621
4715
|
|
|
4622
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS
|
|
4716
|
+
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
|
4623
4717
|
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
|
|
4624
4718
|
|
|
4625
4719
|
this._queueCallback(() => this._hideModal(), this._element, isAnimated);
|
|
@@ -4630,14 +4724,9 @@
|
|
|
4630
4724
|
|
|
4631
4725
|
this._backdrop.dispose();
|
|
4632
4726
|
|
|
4633
|
-
|
|
4634
|
-
/**
|
|
4635
|
-
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
|
4636
|
-
* Do not move `document` in `htmlElements` array
|
|
4637
|
-
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
|
4638
|
-
*/
|
|
4727
|
+
this._focustrap.deactivate();
|
|
4639
4728
|
|
|
4640
|
-
|
|
4729
|
+
super.dispose();
|
|
4641
4730
|
}
|
|
4642
4731
|
|
|
4643
4732
|
handleUpdate() {
|
|
@@ -4653,6 +4742,12 @@
|
|
|
4653
4742
|
});
|
|
4654
4743
|
}
|
|
4655
4744
|
|
|
4745
|
+
_initializeFocusTrap() {
|
|
4746
|
+
return new FocusTrap({
|
|
4747
|
+
trapElement: this._element
|
|
4748
|
+
});
|
|
4749
|
+
}
|
|
4750
|
+
|
|
4656
4751
|
_getConfig(config) {
|
|
4657
4752
|
config = { ...Default$7,
|
|
4658
4753
|
...Manipulator.getDataAttributes(this._element),
|
|
@@ -4669,7 +4764,7 @@
|
|
|
4669
4764
|
|
|
4670
4765
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
|
4671
4766
|
// Don't move modal's DOM position
|
|
4672
|
-
document.body.
|
|
4767
|
+
document.body.append(this._element);
|
|
4673
4768
|
}
|
|
4674
4769
|
|
|
4675
4770
|
this._element.style.display = 'block';
|
|
@@ -4690,15 +4785,11 @@
|
|
|
4690
4785
|
reflow(this._element);
|
|
4691
4786
|
}
|
|
4692
4787
|
|
|
4693
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
4694
|
-
|
|
4695
|
-
if (this._config.focus) {
|
|
4696
|
-
this._enforceFocus();
|
|
4697
|
-
}
|
|
4788
|
+
this._element.classList.add(CLASS_NAME_SHOW$6);
|
|
4698
4789
|
|
|
4699
4790
|
const transitionComplete = () => {
|
|
4700
4791
|
if (this._config.focus) {
|
|
4701
|
-
this.
|
|
4792
|
+
this._focustrap.activate();
|
|
4702
4793
|
}
|
|
4703
4794
|
|
|
4704
4795
|
this._isTransitioning = false;
|
|
@@ -4710,16 +4801,6 @@
|
|
|
4710
4801
|
this._queueCallback(transitionComplete, this._dialog, isAnimated);
|
|
4711
4802
|
}
|
|
4712
4803
|
|
|
4713
|
-
_enforceFocus() {
|
|
4714
|
-
EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
|
|
4715
|
-
|
|
4716
|
-
EventHandler.on(document, EVENT_FOCUSIN$2, event => {
|
|
4717
|
-
if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
|
|
4718
|
-
this._element.focus();
|
|
4719
|
-
}
|
|
4720
|
-
});
|
|
4721
|
-
}
|
|
4722
|
-
|
|
4723
4804
|
_setEscapeEvent() {
|
|
4724
4805
|
if (this._isShown) {
|
|
4725
4806
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
|
@@ -4766,7 +4847,7 @@
|
|
|
4766
4847
|
}
|
|
4767
4848
|
|
|
4768
4849
|
_showBackdrop(callback) {
|
|
4769
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS
|
|
4850
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
|
|
4770
4851
|
if (this._ignoreBackdropClick) {
|
|
4771
4852
|
this._ignoreBackdropClick = false;
|
|
4772
4853
|
return;
|
|
@@ -4787,7 +4868,7 @@
|
|
|
4787
4868
|
}
|
|
4788
4869
|
|
|
4789
4870
|
_isAnimated() {
|
|
4790
|
-
return this._element.classList.contains(CLASS_NAME_FADE$
|
|
4871
|
+
return this._element.classList.contains(CLASS_NAME_FADE$4);
|
|
4791
4872
|
}
|
|
4792
4873
|
|
|
4793
4874
|
_triggerBackdropTransition() {
|
|
@@ -4894,10 +4975,18 @@
|
|
|
4894
4975
|
this.focus();
|
|
4895
4976
|
}
|
|
4896
4977
|
});
|
|
4897
|
-
});
|
|
4978
|
+
}); // avoid conflict when clicking moddal toggler while another one is open
|
|
4979
|
+
|
|
4980
|
+
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
|
|
4981
|
+
|
|
4982
|
+
if (allReadyOpen) {
|
|
4983
|
+
Modal.getInstance(allReadyOpen).hide();
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4898
4986
|
const data = Modal.getOrCreateInstance(target);
|
|
4899
4987
|
data.toggle(this);
|
|
4900
4988
|
});
|
|
4989
|
+
enableDismissTrigger(Modal);
|
|
4901
4990
|
/**
|
|
4902
4991
|
* ------------------------------------------------------------------------
|
|
4903
4992
|
* jQuery
|
|
@@ -4909,7 +4998,7 @@
|
|
|
4909
4998
|
|
|
4910
4999
|
/**
|
|
4911
5000
|
* --------------------------------------------------------------------------
|
|
4912
|
-
* CoreUI (v4.0
|
|
5001
|
+
* CoreUI (v4.1.0): navigation.js
|
|
4913
5002
|
* Licensed under MIT (https://coreui.io/license)
|
|
4914
5003
|
* --------------------------------------------------------------------------
|
|
4915
5004
|
*/
|
|
@@ -4932,7 +5021,7 @@
|
|
|
4932
5021
|
groupsAutoCollapse: '(string|boolean)'
|
|
4933
5022
|
};
|
|
4934
5023
|
const CLASS_NAME_ACTIVE$2 = 'active';
|
|
4935
|
-
const CLASS_NAME_SHOW$
|
|
5024
|
+
const CLASS_NAME_SHOW$5 = 'show';
|
|
4936
5025
|
const CLASS_NAME_NAV_GROUP = 'nav-group';
|
|
4937
5026
|
const CLASS_NAME_NAV_GROUP_TOGGLE = 'nav-group-toggle';
|
|
4938
5027
|
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
|
@@ -5009,7 +5098,7 @@
|
|
|
5009
5098
|
if (this._config.activeLinksExact && element.href === currentUrl) {
|
|
5010
5099
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
5011
5100
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
5012
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
5101
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
5013
5102
|
element.setAttribute('aria-expanded', true);
|
|
5014
5103
|
});
|
|
5015
5104
|
}
|
|
@@ -5017,7 +5106,7 @@
|
|
|
5017
5106
|
if (!this._config.activeLinksExact && element.href.startsWith(currentUrl)) {
|
|
5018
5107
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
5019
5108
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
5020
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
5109
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
5021
5110
|
element.setAttribute('aria-expanded', true);
|
|
5022
5111
|
});
|
|
5023
5112
|
}
|
|
@@ -5116,28 +5205,28 @@
|
|
|
5116
5205
|
toggler = toggler.closest(SELECTOR_NAV_GROUP_TOGGLE);
|
|
5117
5206
|
}
|
|
5118
5207
|
|
|
5119
|
-
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$
|
|
5208
|
+
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$5)); // Close other groups
|
|
5120
5209
|
|
|
5121
5210
|
|
|
5122
5211
|
if (this._config.groupsAutoCollapse === true) {
|
|
5123
5212
|
this._getSiblings(toggler.parentNode, filter).forEach(element => {
|
|
5124
5213
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, element), () => {
|
|
5125
|
-
element.classList.remove(CLASS_NAME_SHOW$
|
|
5214
|
+
element.classList.remove(CLASS_NAME_SHOW$5);
|
|
5126
5215
|
element.setAttribute('aria-expanded', false);
|
|
5127
5216
|
});
|
|
5128
5217
|
});
|
|
5129
5218
|
}
|
|
5130
5219
|
|
|
5131
|
-
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$
|
|
5220
|
+
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$5)) {
|
|
5132
5221
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode), () => {
|
|
5133
|
-
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$
|
|
5222
|
+
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$5);
|
|
5134
5223
|
toggler.parentNode.setAttribute('aria-expanded', false);
|
|
5135
5224
|
});
|
|
5136
5225
|
|
|
5137
5226
|
return;
|
|
5138
5227
|
}
|
|
5139
5228
|
|
|
5140
|
-
toggler.parentNode.classList.add(CLASS_NAME_SHOW$
|
|
5229
|
+
toggler.parentNode.classList.add(CLASS_NAME_SHOW$5);
|
|
5141
5230
|
toggler.parentNode.setAttribute('aria-expanded', true);
|
|
5142
5231
|
|
|
5143
5232
|
this._slideDown(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode));
|
|
@@ -5194,7 +5283,7 @@
|
|
|
5194
5283
|
|
|
5195
5284
|
/**
|
|
5196
5285
|
* --------------------------------------------------------------------------
|
|
5197
|
-
* CoreUI (v4.0
|
|
5286
|
+
* CoreUI (v4.1.0): dropdown.js
|
|
5198
5287
|
* Licensed under MIT (https://coreui.io/license)
|
|
5199
5288
|
*
|
|
5200
5289
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
@@ -5223,17 +5312,15 @@
|
|
|
5223
5312
|
keyboard: 'boolean',
|
|
5224
5313
|
scroll: 'boolean'
|
|
5225
5314
|
};
|
|
5226
|
-
const CLASS_NAME_SHOW$
|
|
5315
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
|
5316
|
+
const CLASS_NAME_BACKDROP$1 = 'offcanvas-backdrop';
|
|
5227
5317
|
const OPEN_SELECTOR = '.offcanvas.show';
|
|
5228
5318
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
|
5229
5319
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
|
5230
5320
|
const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
|
|
5231
5321
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
|
5232
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
|
|
5233
5322
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
|
5234
|
-
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$6}`;
|
|
5235
5323
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$6}`;
|
|
5236
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-coreui-dismiss="offcanvas"]';
|
|
5237
5324
|
const SELECTOR_DATA_TOGGLE$2 = '[data-coreui-toggle="offcanvas"]';
|
|
5238
5325
|
/**
|
|
5239
5326
|
* ------------------------------------------------------------------------
|
|
@@ -5247,6 +5334,7 @@
|
|
|
5247
5334
|
this._config = this._getConfig(config);
|
|
5248
5335
|
this._isShown = false;
|
|
5249
5336
|
this._backdrop = this._initializeBackDrop();
|
|
5337
|
+
this._focustrap = this._initializeFocusTrap();
|
|
5250
5338
|
|
|
5251
5339
|
this._addEventListeners();
|
|
5252
5340
|
} // Getters
|
|
@@ -5285,8 +5373,6 @@
|
|
|
5285
5373
|
|
|
5286
5374
|
if (!this._config.scroll) {
|
|
5287
5375
|
new ScrollBarHelper().hide();
|
|
5288
|
-
|
|
5289
|
-
this._enforceFocusOnElement(this._element);
|
|
5290
5376
|
}
|
|
5291
5377
|
|
|
5292
5378
|
this._element.removeAttribute('aria-hidden');
|
|
@@ -5295,9 +5381,13 @@
|
|
|
5295
5381
|
|
|
5296
5382
|
this._element.setAttribute('role', 'dialog');
|
|
5297
5383
|
|
|
5298
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
5384
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
|
5299
5385
|
|
|
5300
5386
|
const completeCallBack = () => {
|
|
5387
|
+
if (!this._config.scroll) {
|
|
5388
|
+
this._focustrap.activate();
|
|
5389
|
+
}
|
|
5390
|
+
|
|
5301
5391
|
EventHandler.trigger(this._element, EVENT_SHOWN$3, {
|
|
5302
5392
|
relatedTarget
|
|
5303
5393
|
});
|
|
@@ -5317,13 +5407,13 @@
|
|
|
5317
5407
|
return;
|
|
5318
5408
|
}
|
|
5319
5409
|
|
|
5320
|
-
|
|
5410
|
+
this._focustrap.deactivate();
|
|
5321
5411
|
|
|
5322
5412
|
this._element.blur();
|
|
5323
5413
|
|
|
5324
5414
|
this._isShown = false;
|
|
5325
5415
|
|
|
5326
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
5416
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
|
5327
5417
|
|
|
5328
5418
|
this._backdrop.hide();
|
|
5329
5419
|
|
|
@@ -5349,8 +5439,9 @@
|
|
|
5349
5439
|
dispose() {
|
|
5350
5440
|
this._backdrop.dispose();
|
|
5351
5441
|
|
|
5442
|
+
this._focustrap.deactivate();
|
|
5443
|
+
|
|
5352
5444
|
super.dispose();
|
|
5353
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
|
5354
5445
|
} // Private
|
|
5355
5446
|
|
|
5356
5447
|
|
|
@@ -5365,6 +5456,7 @@
|
|
|
5365
5456
|
|
|
5366
5457
|
_initializeBackDrop() {
|
|
5367
5458
|
return new Backdrop({
|
|
5459
|
+
className: CLASS_NAME_BACKDROP$1,
|
|
5368
5460
|
isVisible: this._config.backdrop,
|
|
5369
5461
|
isAnimated: true,
|
|
5370
5462
|
rootElement: this._element.parentNode,
|
|
@@ -5372,19 +5464,13 @@
|
|
|
5372
5464
|
});
|
|
5373
5465
|
}
|
|
5374
5466
|
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
EventHandler.on(document, EVENT_FOCUSIN$1, event => {
|
|
5379
|
-
if (document !== event.target && element !== event.target && !element.contains(event.target)) {
|
|
5380
|
-
element.focus();
|
|
5381
|
-
}
|
|
5467
|
+
_initializeFocusTrap() {
|
|
5468
|
+
return new FocusTrap({
|
|
5469
|
+
trapElement: this._element
|
|
5382
5470
|
});
|
|
5383
|
-
element.focus();
|
|
5384
5471
|
}
|
|
5385
5472
|
|
|
5386
5473
|
_addEventListeners() {
|
|
5387
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
|
5388
5474
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
|
5389
5475
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
|
5390
5476
|
this.hide();
|
|
@@ -5445,6 +5531,7 @@
|
|
|
5445
5531
|
data.toggle(this);
|
|
5446
5532
|
});
|
|
5447
5533
|
EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
|
5534
|
+
enableDismissTrigger(Offcanvas);
|
|
5448
5535
|
/**
|
|
5449
5536
|
* ------------------------------------------------------------------------
|
|
5450
5537
|
* jQuery
|
|
@@ -5455,45 +5542,45 @@
|
|
|
5455
5542
|
|
|
5456
5543
|
/**
|
|
5457
5544
|
* --------------------------------------------------------------------------
|
|
5458
|
-
* CoreUI (v4.0
|
|
5545
|
+
* CoreUI (v4.1.0): alert.js
|
|
5459
5546
|
* Licensed under MIT (https://coreui.io/license)
|
|
5460
5547
|
*
|
|
5461
5548
|
* This component is a modified version of the Bootstrap's util/sanitizer.js
|
|
5462
5549
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5463
5550
|
* --------------------------------------------------------------------------
|
|
5464
5551
|
*/
|
|
5465
|
-
const
|
|
5552
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
5466
5553
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
5467
5554
|
/**
|
|
5468
5555
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
5469
5556
|
*
|
|
5470
|
-
* Shoutout to Angular
|
|
5557
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5471
5558
|
*/
|
|
5472
5559
|
|
|
5473
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5560
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5474
5561
|
/**
|
|
5475
5562
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
5476
5563
|
*
|
|
5477
|
-
* Shoutout to Angular
|
|
5564
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5478
5565
|
*/
|
|
5479
5566
|
|
|
5480
5567
|
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
|
|
5481
5568
|
|
|
5482
|
-
const allowedAttribute = (
|
|
5483
|
-
const
|
|
5569
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
5570
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
5484
5571
|
|
|
5485
|
-
if (allowedAttributeList.includes(
|
|
5486
|
-
if (
|
|
5487
|
-
return Boolean(SAFE_URL_PATTERN.test(
|
|
5572
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
5573
|
+
if (uriAttributes.has(attributeName)) {
|
|
5574
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
|
5488
5575
|
}
|
|
5489
5576
|
|
|
5490
5577
|
return true;
|
|
5491
5578
|
}
|
|
5492
5579
|
|
|
5493
|
-
const regExp = allowedAttributeList.filter(
|
|
5580
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
|
5494
5581
|
|
|
5495
5582
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
|
5496
|
-
if (regExp[i].test(
|
|
5583
|
+
if (regExp[i].test(attributeName)) {
|
|
5497
5584
|
return true;
|
|
5498
5585
|
}
|
|
5499
5586
|
}
|
|
@@ -5545,23 +5632,22 @@
|
|
|
5545
5632
|
|
|
5546
5633
|
const domParser = new window.DOMParser();
|
|
5547
5634
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
5548
|
-
const allowlistKeys = Object.keys(allowList);
|
|
5549
5635
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
5550
5636
|
|
|
5551
5637
|
for (let i = 0, len = elements.length; i < len; i++) {
|
|
5552
|
-
const
|
|
5553
|
-
const
|
|
5638
|
+
const element = elements[i];
|
|
5639
|
+
const elementName = element.nodeName.toLowerCase();
|
|
5554
5640
|
|
|
5555
|
-
if (!
|
|
5556
|
-
|
|
5641
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
5642
|
+
element.remove();
|
|
5557
5643
|
continue;
|
|
5558
5644
|
}
|
|
5559
5645
|
|
|
5560
|
-
const attributeList = [].concat(...
|
|
5561
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
|
5562
|
-
attributeList.forEach(
|
|
5563
|
-
if (!allowedAttribute(
|
|
5564
|
-
|
|
5646
|
+
const attributeList = [].concat(...element.attributes);
|
|
5647
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
|
5648
|
+
attributeList.forEach(attribute => {
|
|
5649
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
5650
|
+
element.removeAttribute(attribute.nodeName);
|
|
5565
5651
|
}
|
|
5566
5652
|
});
|
|
5567
5653
|
}
|
|
@@ -5571,7 +5657,7 @@
|
|
|
5571
5657
|
|
|
5572
5658
|
/**
|
|
5573
5659
|
* --------------------------------------------------------------------------
|
|
5574
|
-
* CoreUI (v4.0
|
|
5660
|
+
* CoreUI (v4.1.0): tooltip.js
|
|
5575
5661
|
* Licensed under MIT (https://coreui.io/license)
|
|
5576
5662
|
*
|
|
5577
5663
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
@@ -5588,7 +5674,6 @@
|
|
|
5588
5674
|
const DATA_KEY$5 = 'coreui.tooltip';
|
|
5589
5675
|
const EVENT_KEY$5 = `.${DATA_KEY$5}`;
|
|
5590
5676
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
|
5591
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
|
5592
5677
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
5593
5678
|
const DefaultType$4 = {
|
|
5594
5679
|
animation: 'boolean',
|
|
@@ -5647,12 +5732,14 @@
|
|
|
5647
5732
|
MOUSEENTER: `mouseenter${EVENT_KEY$5}`,
|
|
5648
5733
|
MOUSELEAVE: `mouseleave${EVENT_KEY$5}`
|
|
5649
5734
|
};
|
|
5650
|
-
const CLASS_NAME_FADE$
|
|
5735
|
+
const CLASS_NAME_FADE$3 = 'fade';
|
|
5651
5736
|
const CLASS_NAME_MODAL = 'modal';
|
|
5652
|
-
const CLASS_NAME_SHOW$
|
|
5737
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
|
5653
5738
|
const HOVER_STATE_SHOW = 'show';
|
|
5654
5739
|
const HOVER_STATE_OUT = 'out';
|
|
5655
5740
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
5741
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
5742
|
+
const EVENT_MODAL_HIDE = 'hide.coreui.modal';
|
|
5656
5743
|
const TRIGGER_HOVER = 'hover';
|
|
5657
5744
|
const TRIGGER_FOCUS = 'focus';
|
|
5658
5745
|
const TRIGGER_CLICK = 'click';
|
|
@@ -5729,7 +5816,7 @@
|
|
|
5729
5816
|
context._leave(null, context);
|
|
5730
5817
|
}
|
|
5731
5818
|
} else {
|
|
5732
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
5819
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
|
|
5733
5820
|
this._leave(null, this);
|
|
5734
5821
|
|
|
5735
5822
|
return;
|
|
@@ -5741,15 +5828,13 @@
|
|
|
5741
5828
|
|
|
5742
5829
|
dispose() {
|
|
5743
5830
|
clearTimeout(this._timeout);
|
|
5744
|
-
EventHandler.off(this._element.closest(
|
|
5831
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
5745
5832
|
|
|
5746
5833
|
if (this.tip) {
|
|
5747
5834
|
this.tip.remove();
|
|
5748
5835
|
}
|
|
5749
5836
|
|
|
5750
|
-
|
|
5751
|
-
this._popper.destroy();
|
|
5752
|
-
}
|
|
5837
|
+
this._disposePopper();
|
|
5753
5838
|
|
|
5754
5839
|
super.dispose();
|
|
5755
5840
|
}
|
|
@@ -5769,6 +5854,15 @@
|
|
|
5769
5854
|
|
|
5770
5855
|
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
5771
5856
|
return;
|
|
5857
|
+
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-coreui-original-title`
|
|
5858
|
+
// This will be removed later in favor of a `setContent` method
|
|
5859
|
+
|
|
5860
|
+
|
|
5861
|
+
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
|
5862
|
+
this._disposePopper();
|
|
5863
|
+
|
|
5864
|
+
this.tip.remove();
|
|
5865
|
+
this.tip = null;
|
|
5772
5866
|
}
|
|
5773
5867
|
|
|
5774
5868
|
const tip = this.getTipElement();
|
|
@@ -5777,10 +5871,8 @@
|
|
|
5777
5871
|
|
|
5778
5872
|
this._element.setAttribute('aria-describedby', tipId);
|
|
5779
5873
|
|
|
5780
|
-
this.setContent();
|
|
5781
|
-
|
|
5782
5874
|
if (this._config.animation) {
|
|
5783
|
-
tip.classList.add(CLASS_NAME_FADE$
|
|
5875
|
+
tip.classList.add(CLASS_NAME_FADE$3);
|
|
5784
5876
|
}
|
|
5785
5877
|
|
|
5786
5878
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
|
@@ -5795,7 +5887,7 @@
|
|
|
5795
5887
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
|
5796
5888
|
|
|
5797
5889
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
5798
|
-
container.
|
|
5890
|
+
container.append(tip);
|
|
5799
5891
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
|
5800
5892
|
}
|
|
5801
5893
|
|
|
@@ -5805,8 +5897,9 @@
|
|
|
5805
5897
|
this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
5806
5898
|
}
|
|
5807
5899
|
|
|
5808
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
|
5809
|
-
|
|
5900
|
+
tip.classList.add(CLASS_NAME_SHOW$3);
|
|
5901
|
+
|
|
5902
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
|
5810
5903
|
|
|
5811
5904
|
if (customClass) {
|
|
5812
5905
|
tip.classList.add(...customClass.split(' '));
|
|
@@ -5832,7 +5925,7 @@
|
|
|
5832
5925
|
}
|
|
5833
5926
|
};
|
|
5834
5927
|
|
|
5835
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
5928
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
|
|
5836
5929
|
|
|
5837
5930
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5838
5931
|
}
|
|
@@ -5859,11 +5952,7 @@
|
|
|
5859
5952
|
|
|
5860
5953
|
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
|
5861
5954
|
|
|
5862
|
-
|
|
5863
|
-
this._popper.destroy();
|
|
5864
|
-
|
|
5865
|
-
this._popper = null;
|
|
5866
|
-
}
|
|
5955
|
+
this._disposePopper();
|
|
5867
5956
|
};
|
|
5868
5957
|
|
|
5869
5958
|
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
|
@@ -5872,7 +5961,7 @@
|
|
|
5872
5961
|
return;
|
|
5873
5962
|
}
|
|
5874
5963
|
|
|
5875
|
-
tip.classList.remove(CLASS_NAME_SHOW$
|
|
5964
|
+
tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
|
|
5876
5965
|
// empty mouseover listeners we added for iOS support
|
|
5877
5966
|
|
|
5878
5967
|
if ('ontouchstart' in document.documentElement) {
|
|
@@ -5882,7 +5971,7 @@
|
|
|
5882
5971
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
5883
5972
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
5884
5973
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
5885
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
5974
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
|
|
5886
5975
|
|
|
5887
5976
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5888
5977
|
|
|
@@ -5907,14 +5996,27 @@
|
|
|
5907
5996
|
|
|
5908
5997
|
const element = document.createElement('div');
|
|
5909
5998
|
element.innerHTML = this._config.template;
|
|
5910
|
-
|
|
5999
|
+
const tip = element.children[0];
|
|
6000
|
+
this.setContent(tip);
|
|
6001
|
+
tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
|
|
6002
|
+
this.tip = tip;
|
|
5911
6003
|
return this.tip;
|
|
5912
6004
|
}
|
|
5913
6005
|
|
|
5914
|
-
setContent() {
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
6006
|
+
setContent(tip) {
|
|
6007
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
|
|
6008
|
+
}
|
|
6009
|
+
|
|
6010
|
+
_sanitizeAndSetContent(template, content, selector) {
|
|
6011
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
|
6012
|
+
|
|
6013
|
+
if (!content && templateElement) {
|
|
6014
|
+
templateElement.remove();
|
|
6015
|
+
return;
|
|
6016
|
+
} // we use append for html objects to maintain js events
|
|
6017
|
+
|
|
6018
|
+
|
|
6019
|
+
this.setElementContent(templateElement, content);
|
|
5918
6020
|
}
|
|
5919
6021
|
|
|
5920
6022
|
setElementContent(element, content) {
|
|
@@ -5928,7 +6030,7 @@
|
|
|
5928
6030
|
if (this._config.html) {
|
|
5929
6031
|
if (content.parentNode !== element) {
|
|
5930
6032
|
element.innerHTML = '';
|
|
5931
|
-
element.
|
|
6033
|
+
element.append(content);
|
|
5932
6034
|
}
|
|
5933
6035
|
} else {
|
|
5934
6036
|
element.textContent = content.textContent;
|
|
@@ -5949,13 +6051,9 @@
|
|
|
5949
6051
|
}
|
|
5950
6052
|
|
|
5951
6053
|
getTitle() {
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
if (!title) {
|
|
5955
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
|
5956
|
-
}
|
|
6054
|
+
const title = this._element.getAttribute('data-coreui-original-title') || this._config.title;
|
|
5957
6055
|
|
|
5958
|
-
return title;
|
|
6056
|
+
return this._resolvePossibleFunction(title);
|
|
5959
6057
|
}
|
|
5960
6058
|
|
|
5961
6059
|
updateAttachment(attachment) {
|
|
@@ -5972,15 +6070,7 @@
|
|
|
5972
6070
|
|
|
5973
6071
|
|
|
5974
6072
|
_initializeOnDelegatedTarget(event, context) {
|
|
5975
|
-
|
|
5976
|
-
context = context || Data.get(event.delegateTarget, dataKey);
|
|
5977
|
-
|
|
5978
|
-
if (!context) {
|
|
5979
|
-
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
|
5980
|
-
Data.set(event.delegateTarget, dataKey, context);
|
|
5981
|
-
}
|
|
5982
|
-
|
|
5983
|
-
return context;
|
|
6073
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
|
5984
6074
|
}
|
|
5985
6075
|
|
|
5986
6076
|
_getOffset() {
|
|
@@ -5999,6 +6089,10 @@
|
|
|
5999
6089
|
return offset;
|
|
6000
6090
|
}
|
|
6001
6091
|
|
|
6092
|
+
_resolvePossibleFunction(content) {
|
|
6093
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
|
6094
|
+
}
|
|
6095
|
+
|
|
6002
6096
|
_getPopperConfig(attachment) {
|
|
6003
6097
|
const defaultBsPopperConfig = {
|
|
6004
6098
|
placement: attachment,
|
|
@@ -6040,7 +6134,7 @@
|
|
|
6040
6134
|
}
|
|
6041
6135
|
|
|
6042
6136
|
_addAttachmentClass(attachment) {
|
|
6043
|
-
this.getTipElement().classList.add(`${
|
|
6137
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
|
6044
6138
|
}
|
|
6045
6139
|
|
|
6046
6140
|
_getAttachment(placement) {
|
|
@@ -6067,7 +6161,7 @@
|
|
|
6067
6161
|
}
|
|
6068
6162
|
};
|
|
6069
6163
|
|
|
6070
|
-
EventHandler.on(this._element.closest(
|
|
6164
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
6071
6165
|
|
|
6072
6166
|
if (this._config.selector) {
|
|
6073
6167
|
this._config = { ...this._config,
|
|
@@ -6102,7 +6196,7 @@
|
|
|
6102
6196
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
6103
6197
|
}
|
|
6104
6198
|
|
|
6105
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
6199
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
|
|
6106
6200
|
context._hoverState = HOVER_STATE_SHOW;
|
|
6107
6201
|
return;
|
|
6108
6202
|
}
|
|
@@ -6198,26 +6292,32 @@
|
|
|
6198
6292
|
_getDelegateConfig() {
|
|
6199
6293
|
const config = {};
|
|
6200
6294
|
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
config[key] = this._config[key];
|
|
6205
|
-
}
|
|
6295
|
+
for (const key in this._config) {
|
|
6296
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
|
6297
|
+
config[key] = this._config[key];
|
|
6206
6298
|
}
|
|
6207
|
-
}
|
|
6299
|
+
} // In the future can be replaced with:
|
|
6300
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
|
6301
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
|
6302
|
+
|
|
6208
6303
|
|
|
6209
6304
|
return config;
|
|
6210
6305
|
}
|
|
6211
6306
|
|
|
6212
6307
|
_cleanTipClass() {
|
|
6213
6308
|
const tip = this.getTipElement();
|
|
6214
|
-
const
|
|
6309
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
|
6310
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
|
6215
6311
|
|
|
6216
6312
|
if (tabClass !== null && tabClass.length > 0) {
|
|
6217
6313
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
6218
6314
|
}
|
|
6219
6315
|
}
|
|
6220
6316
|
|
|
6317
|
+
_getBasicClassPrefix() {
|
|
6318
|
+
return CLASS_PREFIX$1;
|
|
6319
|
+
}
|
|
6320
|
+
|
|
6221
6321
|
_handlePopperPlacementChange(popperData) {
|
|
6222
6322
|
const {
|
|
6223
6323
|
state
|
|
@@ -6232,6 +6332,14 @@
|
|
|
6232
6332
|
this._cleanTipClass();
|
|
6233
6333
|
|
|
6234
6334
|
this._addAttachmentClass(this._getAttachment(state.placement));
|
|
6335
|
+
}
|
|
6336
|
+
|
|
6337
|
+
_disposePopper() {
|
|
6338
|
+
if (this._popper) {
|
|
6339
|
+
this._popper.destroy();
|
|
6340
|
+
|
|
6341
|
+
this._popper = null;
|
|
6342
|
+
}
|
|
6235
6343
|
} // Static
|
|
6236
6344
|
|
|
6237
6345
|
|
|
@@ -6262,7 +6370,7 @@
|
|
|
6262
6370
|
|
|
6263
6371
|
/**
|
|
6264
6372
|
* --------------------------------------------------------------------------
|
|
6265
|
-
* CoreUI (v4.0
|
|
6373
|
+
* CoreUI (v4.1.0): popover.js
|
|
6266
6374
|
* Licensed under MIT (https://coreui.io/license)
|
|
6267
6375
|
*
|
|
6268
6376
|
* This component is a modified version of the Bootstrap's popover.js
|
|
@@ -6279,7 +6387,6 @@
|
|
|
6279
6387
|
const DATA_KEY$4 = 'coreui.popover';
|
|
6280
6388
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
|
6281
6389
|
const CLASS_PREFIX = 'bs-popover';
|
|
6282
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
|
6283
6390
|
const Default$3 = { ...Tooltip.Default,
|
|
6284
6391
|
placement: 'right',
|
|
6285
6392
|
offset: [0, 8],
|
|
@@ -6302,8 +6409,6 @@
|
|
|
6302
6409
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
|
6303
6410
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
|
6304
6411
|
};
|
|
6305
|
-
const CLASS_NAME_FADE$3 = 'fade';
|
|
6306
|
-
const CLASS_NAME_SHOW$3 = 'show';
|
|
6307
6412
|
const SELECTOR_TITLE = '.popover-header';
|
|
6308
6413
|
const SELECTOR_CONTENT = '.popover-body';
|
|
6309
6414
|
/**
|
|
@@ -6335,55 +6440,19 @@
|
|
|
6335
6440
|
return this.getTitle() || this._getContent();
|
|
6336
6441
|
}
|
|
6337
6442
|
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
return this.tip;
|
|
6341
|
-
}
|
|
6342
|
-
|
|
6343
|
-
this.tip = super.getTipElement();
|
|
6344
|
-
|
|
6345
|
-
if (!this.getTitle()) {
|
|
6346
|
-
SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove();
|
|
6347
|
-
}
|
|
6348
|
-
|
|
6349
|
-
if (!this._getContent()) {
|
|
6350
|
-
SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove();
|
|
6351
|
-
}
|
|
6352
|
-
|
|
6353
|
-
return this.tip;
|
|
6354
|
-
}
|
|
6355
|
-
|
|
6356
|
-
setContent() {
|
|
6357
|
-
const tip = this.getTipElement(); // we use append for html objects to maintain js events
|
|
6358
|
-
|
|
6359
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
|
|
6360
|
-
|
|
6361
|
-
let content = this._getContent();
|
|
6443
|
+
setContent(tip) {
|
|
6444
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
|
6362
6445
|
|
|
6363
|
-
|
|
6364
|
-
content = content.call(this._element);
|
|
6365
|
-
}
|
|
6366
|
-
|
|
6367
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
|
6368
|
-
tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
|
|
6446
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
|
6369
6447
|
} // Private
|
|
6370
6448
|
|
|
6371
6449
|
|
|
6372
|
-
_addAttachmentClass(attachment) {
|
|
6373
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
|
6374
|
-
}
|
|
6375
|
-
|
|
6376
6450
|
_getContent() {
|
|
6377
|
-
return this.
|
|
6451
|
+
return this._resolvePossibleFunction(this._config.content);
|
|
6378
6452
|
}
|
|
6379
6453
|
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
|
|
6383
|
-
|
|
6384
|
-
if (tabClass !== null && tabClass.length > 0) {
|
|
6385
|
-
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
6386
|
-
}
|
|
6454
|
+
_getBasicClassPrefix() {
|
|
6455
|
+
return CLASS_PREFIX;
|
|
6387
6456
|
} // Static
|
|
6388
6457
|
|
|
6389
6458
|
|
|
@@ -6414,7 +6483,7 @@
|
|
|
6414
6483
|
|
|
6415
6484
|
/**
|
|
6416
6485
|
* --------------------------------------------------------------------------
|
|
6417
|
-
* CoreUI (v4.0
|
|
6486
|
+
* CoreUI (v4.1.0): scrollspy.js
|
|
6418
6487
|
* Licensed under MIT (https://coreui.io/license)
|
|
6419
6488
|
*
|
|
6420
6489
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
@@ -6652,7 +6721,7 @@
|
|
|
6652
6721
|
|
|
6653
6722
|
/**
|
|
6654
6723
|
* --------------------------------------------------------------------------
|
|
6655
|
-
* CoreUI (v4.0
|
|
6724
|
+
* CoreUI (v4.1.0): sidebar.js
|
|
6656
6725
|
* Licensed under MIT (https://coreui.io/license)
|
|
6657
6726
|
* --------------------------------------------------------------------------
|
|
6658
6727
|
*/
|
|
@@ -6872,7 +6941,7 @@
|
|
|
6872
6941
|
|
|
6873
6942
|
_removeBackdrop() {
|
|
6874
6943
|
if (this._backdrop) {
|
|
6875
|
-
this._backdrop.
|
|
6944
|
+
this._backdrop.remove();
|
|
6876
6945
|
|
|
6877
6946
|
this._backdrop = null;
|
|
6878
6947
|
}
|
|
@@ -6885,7 +6954,7 @@
|
|
|
6885
6954
|
|
|
6886
6955
|
this._backdrop.classList.add(CLASS_NAME_FADE$2);
|
|
6887
6956
|
|
|
6888
|
-
document.body.
|
|
6957
|
+
document.body.append(this._backdrop);
|
|
6889
6958
|
reflow(this._backdrop);
|
|
6890
6959
|
|
|
6891
6960
|
this._backdrop.classList.add(CLASS_NAME_SHOW$2);
|
|
@@ -6985,7 +7054,7 @@
|
|
|
6985
7054
|
|
|
6986
7055
|
/**
|
|
6987
7056
|
* --------------------------------------------------------------------------
|
|
6988
|
-
* CoreUI (v4.0
|
|
7057
|
+
* CoreUI (v4.1.0): tab.js
|
|
6989
7058
|
* Licensed under MIT (https://coreui.io/license)
|
|
6990
7059
|
*
|
|
6991
7060
|
* This component is a modified version of the Bootstrap's tab.js
|
|
@@ -7186,7 +7255,7 @@
|
|
|
7186
7255
|
|
|
7187
7256
|
/**
|
|
7188
7257
|
* --------------------------------------------------------------------------
|
|
7189
|
-
* CoreUI (v4.0
|
|
7258
|
+
* CoreUI (v4.1.0): toast.js
|
|
7190
7259
|
* Licensed under MIT (https://coreui.io/license)
|
|
7191
7260
|
*
|
|
7192
7261
|
* This component is a modified version of the Bootstrap's toast.js
|
|
@@ -7202,7 +7271,6 @@
|
|
|
7202
7271
|
const NAME = 'toast';
|
|
7203
7272
|
const DATA_KEY = 'coreui.toast';
|
|
7204
7273
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
7205
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
|
7206
7274
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
|
7207
7275
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
|
7208
7276
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
|
@@ -7212,7 +7280,8 @@
|
|
|
7212
7280
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
7213
7281
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
7214
7282
|
const CLASS_NAME_FADE = 'fade';
|
|
7215
|
-
const CLASS_NAME_HIDE = 'hide';
|
|
7283
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
|
7284
|
+
|
|
7216
7285
|
const CLASS_NAME_SHOW = 'show';
|
|
7217
7286
|
const CLASS_NAME_SHOWING = 'showing';
|
|
7218
7287
|
const DefaultType = {
|
|
@@ -7225,7 +7294,6 @@
|
|
|
7225
7294
|
autohide: true,
|
|
7226
7295
|
delay: 5000
|
|
7227
7296
|
};
|
|
7228
|
-
const SELECTOR_DATA_DISMISS = '[data-coreui-dismiss="toast"]';
|
|
7229
7297
|
/**
|
|
7230
7298
|
* ------------------------------------------------------------------------
|
|
7231
7299
|
* Class Definition
|
|
@@ -7273,17 +7341,18 @@
|
|
|
7273
7341
|
const complete = () => {
|
|
7274
7342
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
7275
7343
|
|
|
7276
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
7277
|
-
|
|
7278
7344
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
|
7279
7345
|
|
|
7280
7346
|
this._maybeScheduleHide();
|
|
7281
7347
|
};
|
|
7282
7348
|
|
|
7283
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
|
7349
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
|
7350
|
+
|
|
7284
7351
|
|
|
7285
7352
|
reflow(this._element);
|
|
7286
7353
|
|
|
7354
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
7355
|
+
|
|
7287
7356
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
7288
7357
|
|
|
7289
7358
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
@@ -7301,12 +7370,17 @@
|
|
|
7301
7370
|
}
|
|
7302
7371
|
|
|
7303
7372
|
const complete = () => {
|
|
7304
|
-
this._element.classList.add(CLASS_NAME_HIDE);
|
|
7373
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
|
7374
|
+
|
|
7375
|
+
|
|
7376
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
7377
|
+
|
|
7378
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
7305
7379
|
|
|
7306
7380
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
|
7307
7381
|
};
|
|
7308
7382
|
|
|
7309
|
-
this._element.classList.
|
|
7383
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
7310
7384
|
|
|
7311
7385
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
7312
7386
|
}
|
|
@@ -7374,7 +7448,6 @@
|
|
|
7374
7448
|
}
|
|
7375
7449
|
|
|
7376
7450
|
_setListeners() {
|
|
7377
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
|
7378
7451
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
|
7379
7452
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
|
7380
7453
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
|
@@ -7402,6 +7475,8 @@
|
|
|
7402
7475
|
}
|
|
7403
7476
|
|
|
7404
7477
|
}
|
|
7478
|
+
|
|
7479
|
+
enableDismissTrigger(Toast);
|
|
7405
7480
|
/**
|
|
7406
7481
|
* ------------------------------------------------------------------------
|
|
7407
7482
|
* jQuery
|
|
@@ -7409,16 +7484,15 @@
|
|
|
7409
7484
|
* add .Toast to jQuery only if jQuery is present
|
|
7410
7485
|
*/
|
|
7411
7486
|
|
|
7412
|
-
|
|
7413
7487
|
defineJQueryPlugin(Toast);
|
|
7414
7488
|
|
|
7415
7489
|
/**
|
|
7416
7490
|
* --------------------------------------------------------------------------
|
|
7417
|
-
* CoreUI (v4.0
|
|
7491
|
+
* CoreUI (v4.1.0): index.esm.js
|
|
7418
7492
|
* Licensed under MIT (https://coreui.io/license)
|
|
7419
7493
|
* --------------------------------------------------------------------------
|
|
7420
7494
|
*/
|
|
7421
|
-
|
|
7495
|
+
const index_umd = {
|
|
7422
7496
|
Alert,
|
|
7423
7497
|
Button,
|
|
7424
7498
|
Carousel,
|
|
@@ -7437,5 +7511,5 @@
|
|
|
7437
7511
|
|
|
7438
7512
|
return index_umd;
|
|
7439
7513
|
|
|
7440
|
-
}))
|
|
7514
|
+
}));
|
|
7441
7515
|
//# sourceMappingURL=coreui.bundle.js.map
|