@coreui/coreui 4.0.2 → 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 +5 -8
- package/dist/css/coreui-grid.css +255 -206
- 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 +256 -207
- 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 +725 -350
- 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 +733 -373
- 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 +782 -704
- 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 +663 -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 +673 -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 +6 -4
- 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 +6 -4
- 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 +29 -10
- package/scss/mixins/_ltr-rtl.scss +21 -0
- package/scss/mixins/_utilities.scss +26 -26
- package/scss/mixins/_visually-hidden.scss +1 -1
- package/scss/sidebar/_sidebar.scss +22 -16
package/dist/js/coreui.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,114 +7,37 @@
|
|
|
7
7
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) :
|
|
8
8
|
typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) :
|
|
9
9
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.coreui = factory(global.Popper));
|
|
10
|
-
}(this, (function (Popper) { 'use strict';
|
|
10
|
+
})(this, (function (Popper) { 'use strict';
|
|
11
11
|
|
|
12
12
|
function _interopNamespace(e) {
|
|
13
13
|
if (e && e.__esModule) return e;
|
|
14
|
-
|
|
14
|
+
const n = Object.create(null);
|
|
15
15
|
if (e) {
|
|
16
|
-
|
|
16
|
+
for (const k in e) {
|
|
17
17
|
if (k !== 'default') {
|
|
18
|
-
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
19
|
Object.defineProperty(n, k, d.get ? d : {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get:
|
|
22
|
-
return e[k];
|
|
23
|
-
}
|
|
21
|
+
get: () => e[k]
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
|
-
}
|
|
24
|
+
}
|
|
27
25
|
}
|
|
28
|
-
n
|
|
26
|
+
n.default = e;
|
|
29
27
|
return Object.freeze(n);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* --------------------------------------------------------------------------
|
|
36
|
-
* CoreUI (v4.0.2): dom/selector-engine.js
|
|
37
|
-
* Licensed under MIT (https://coreui.io/license)
|
|
38
|
-
*
|
|
39
|
-
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
40
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
41
|
-
* --------------------------------------------------------------------------
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* ------------------------------------------------------------------------
|
|
46
|
-
* Constants
|
|
47
|
-
* ------------------------------------------------------------------------
|
|
48
|
-
*/
|
|
49
|
-
const NODE_TEXT = 3;
|
|
50
|
-
const SelectorEngine = {
|
|
51
|
-
find(selector, element = document.documentElement) {
|
|
52
|
-
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
findOne(selector, element = document.documentElement) {
|
|
56
|
-
return Element.prototype.querySelector.call(element, selector);
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
children(element, selector) {
|
|
60
|
-
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
parents(element, selector) {
|
|
64
|
-
const parents = [];
|
|
65
|
-
let ancestor = element.parentNode;
|
|
66
|
-
|
|
67
|
-
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
68
|
-
if (ancestor.matches(selector)) {
|
|
69
|
-
parents.push(ancestor);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
ancestor = ancestor.parentNode;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return parents;
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
prev(element, selector) {
|
|
79
|
-
let previous = element.previousElementSibling;
|
|
80
|
-
|
|
81
|
-
while (previous) {
|
|
82
|
-
if (previous.matches(selector)) {
|
|
83
|
-
return [previous];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
previous = previous.previousElementSibling;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return [];
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
next(element, selector) {
|
|
93
|
-
let next = element.nextElementSibling;
|
|
94
|
-
|
|
95
|
-
while (next) {
|
|
96
|
-
if (next.matches(selector)) {
|
|
97
|
-
return [next];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
next = next.nextElementSibling;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
};
|
|
30
|
+
const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
|
107
31
|
|
|
108
32
|
/**
|
|
109
33
|
* --------------------------------------------------------------------------
|
|
110
|
-
* CoreUI (v4.0
|
|
34
|
+
* CoreUI (v4.1.0): alert.js
|
|
111
35
|
* Licensed under MIT (https://coreui.io/license)
|
|
112
36
|
*
|
|
113
37
|
* This component is a modified version of the Bootstrap's util/index.js
|
|
114
38
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
115
39
|
* --------------------------------------------------------------------------
|
|
116
40
|
*/
|
|
117
|
-
|
|
118
41
|
const MAX_UID = 1000000;
|
|
119
42
|
const MILLISECONDS_MULTIPLIER = 1000;
|
|
120
43
|
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
|
@@ -226,7 +149,7 @@
|
|
|
226
149
|
}
|
|
227
150
|
|
|
228
151
|
if (typeof obj === 'string' && obj.length > 0) {
|
|
229
|
-
return
|
|
152
|
+
return document.querySelector(obj);
|
|
230
153
|
}
|
|
231
154
|
|
|
232
155
|
return null;
|
|
@@ -292,8 +215,20 @@
|
|
|
292
215
|
};
|
|
293
216
|
|
|
294
217
|
const noop = () => {};
|
|
218
|
+
/**
|
|
219
|
+
* Trick to restart an element's animation
|
|
220
|
+
*
|
|
221
|
+
* @param {HTMLElement} element
|
|
222
|
+
* @return void
|
|
223
|
+
*
|
|
224
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
|
225
|
+
*/
|
|
295
226
|
|
|
296
|
-
|
|
227
|
+
|
|
228
|
+
const reflow = element => {
|
|
229
|
+
// eslint-disable-next-line no-unused-expressions
|
|
230
|
+
element.offsetHeight;
|
|
231
|
+
};
|
|
297
232
|
|
|
298
233
|
const getjQuery = () => {
|
|
299
234
|
const {
|
|
@@ -410,7 +345,7 @@
|
|
|
410
345
|
|
|
411
346
|
/**
|
|
412
347
|
* --------------------------------------------------------------------------
|
|
413
|
-
* CoreUI (v4.0
|
|
348
|
+
* CoreUI (v4.1.0): dom/event-handler.js
|
|
414
349
|
* Licensed under MIT (https://coreui.io/license)
|
|
415
350
|
*
|
|
416
351
|
* This component is a modified version of the Bootstrap's dom/event-handler.js
|
|
@@ -476,7 +411,6 @@
|
|
|
476
411
|
event.delegateTarget = target;
|
|
477
412
|
|
|
478
413
|
if (handler.oneOff) {
|
|
479
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
480
414
|
EventHandler.off(element, event.type, selector, fn);
|
|
481
415
|
}
|
|
482
416
|
|
|
@@ -702,7 +636,7 @@
|
|
|
702
636
|
|
|
703
637
|
/**
|
|
704
638
|
* --------------------------------------------------------------------------
|
|
705
|
-
* CoreUI (v4.0
|
|
639
|
+
* CoreUI (v4.1.0): dom/data.js
|
|
706
640
|
* Licensed under MIT (https://coreui.io/license)
|
|
707
641
|
*
|
|
708
642
|
* This component is a modified version of the Bootstrap's dom/data.js
|
|
@@ -716,7 +650,7 @@
|
|
|
716
650
|
* ------------------------------------------------------------------------
|
|
717
651
|
*/
|
|
718
652
|
const elementMap = new Map();
|
|
719
|
-
|
|
653
|
+
const Data = {
|
|
720
654
|
set(element, key, instance) {
|
|
721
655
|
if (!elementMap.has(element)) {
|
|
722
656
|
elementMap.set(element, new Map());
|
|
@@ -759,7 +693,7 @@
|
|
|
759
693
|
|
|
760
694
|
/**
|
|
761
695
|
* --------------------------------------------------------------------------
|
|
762
|
-
* CoreUI (v4.0
|
|
696
|
+
* CoreUI (v4.1.0): alert.js
|
|
763
697
|
* Licensed under MIT (https://coreui.io/license)
|
|
764
698
|
*
|
|
765
699
|
* This component is a modified version of the Bootstrap's base-component.js
|
|
@@ -772,7 +706,7 @@
|
|
|
772
706
|
* ------------------------------------------------------------------------
|
|
773
707
|
*/
|
|
774
708
|
|
|
775
|
-
const VERSION = '4.0
|
|
709
|
+
const VERSION = '4.1.0';
|
|
776
710
|
|
|
777
711
|
class BaseComponent {
|
|
778
712
|
constructor(element) {
|
|
@@ -801,7 +735,7 @@
|
|
|
801
735
|
|
|
802
736
|
|
|
803
737
|
static getInstance(element) {
|
|
804
|
-
return Data.get(element, this.DATA_KEY);
|
|
738
|
+
return Data.get(getElement(element), this.DATA_KEY);
|
|
805
739
|
}
|
|
806
740
|
|
|
807
741
|
static getOrCreateInstance(element, config = {}) {
|
|
@@ -828,7 +762,33 @@
|
|
|
828
762
|
|
|
829
763
|
/**
|
|
830
764
|
* --------------------------------------------------------------------------
|
|
831
|
-
*
|
|
765
|
+
* Bootstrap (v5.1.3): util/component-functions.js
|
|
766
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
767
|
+
* --------------------------------------------------------------------------
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
const enableDismissTrigger = (component, method = 'hide') => {
|
|
771
|
+
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
772
|
+
const name = component.NAME;
|
|
773
|
+
EventHandler.on(document, clickEvent, `[data-coreui-dismiss="${name}"]`, function (event) {
|
|
774
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
775
|
+
event.preventDefault();
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (isDisabled(this)) {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
783
|
+
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
784
|
+
|
|
785
|
+
instance[method]();
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* --------------------------------------------------------------------------
|
|
791
|
+
* CoreUI (v4.1.0): alert.js
|
|
832
792
|
* Licensed under MIT (https://coreui.io/license)
|
|
833
793
|
*
|
|
834
794
|
* This component is a modified version of the Bootstrap's alert.js
|
|
@@ -841,17 +801,13 @@
|
|
|
841
801
|
* ------------------------------------------------------------------------
|
|
842
802
|
*/
|
|
843
803
|
|
|
844
|
-
const NAME$
|
|
845
|
-
const DATA_KEY$
|
|
846
|
-
const EVENT_KEY$
|
|
847
|
-
const
|
|
848
|
-
const
|
|
849
|
-
const
|
|
850
|
-
const
|
|
851
|
-
const EVENT_CLICK_DATA_API$9 = `click${EVENT_KEY$d}${DATA_API_KEY$a}`;
|
|
852
|
-
const CLASS_NAME_ALERT = 'alert';
|
|
853
|
-
const CLASS_NAME_FADE$7 = 'fade';
|
|
854
|
-
const CLASS_NAME_SHOW$b = 'show';
|
|
804
|
+
const NAME$f = 'alert';
|
|
805
|
+
const DATA_KEY$e = 'coreui.alert';
|
|
806
|
+
const EVENT_KEY$e = `.${DATA_KEY$e}`;
|
|
807
|
+
const EVENT_CLOSE = `close${EVENT_KEY$e}`;
|
|
808
|
+
const EVENT_CLOSED = `closed${EVENT_KEY$e}`;
|
|
809
|
+
const CLASS_NAME_FADE$6 = 'fade';
|
|
810
|
+
const CLASS_NAME_SHOW$a = 'show';
|
|
855
811
|
/**
|
|
856
812
|
* ------------------------------------------------------------------------
|
|
857
813
|
* Class Definition
|
|
@@ -861,41 +817,30 @@
|
|
|
861
817
|
class Alert extends BaseComponent {
|
|
862
818
|
// Getters
|
|
863
819
|
static get NAME() {
|
|
864
|
-
return NAME$
|
|
820
|
+
return NAME$f;
|
|
865
821
|
} // Public
|
|
866
822
|
|
|
867
823
|
|
|
868
|
-
close(
|
|
869
|
-
const
|
|
824
|
+
close() {
|
|
825
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
870
826
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
if (customEvent === null || customEvent.defaultPrevented) {
|
|
827
|
+
if (closeEvent.defaultPrevented) {
|
|
874
828
|
return;
|
|
875
829
|
}
|
|
876
830
|
|
|
877
|
-
this.
|
|
878
|
-
} // Private
|
|
831
|
+
this._element.classList.remove(CLASS_NAME_SHOW$a);
|
|
879
832
|
|
|
833
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$6);
|
|
880
834
|
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
_triggerCloseEvent(element) {
|
|
886
|
-
return EventHandler.trigger(element, EVENT_CLOSE);
|
|
887
|
-
}
|
|
835
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
836
|
+
} // Private
|
|
888
837
|
|
|
889
|
-
_removeElement(element) {
|
|
890
|
-
element.classList.remove(CLASS_NAME_SHOW$b);
|
|
891
|
-
const isAnimated = element.classList.contains(CLASS_NAME_FADE$7);
|
|
892
838
|
|
|
893
|
-
|
|
894
|
-
|
|
839
|
+
_destroyElement() {
|
|
840
|
+
this._element.remove();
|
|
895
841
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
EventHandler.trigger(element, EVENT_CLOSED);
|
|
842
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
843
|
+
this.dispose();
|
|
899
844
|
} // Static
|
|
900
845
|
|
|
901
846
|
|
|
@@ -903,20 +848,16 @@
|
|
|
903
848
|
return this.each(function () {
|
|
904
849
|
const data = Alert.getOrCreateInstance(this);
|
|
905
850
|
|
|
906
|
-
if (config
|
|
907
|
-
|
|
851
|
+
if (typeof config !== 'string') {
|
|
852
|
+
return;
|
|
908
853
|
}
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
854
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
if (event) {
|
|
915
|
-
event.preventDefault();
|
|
855
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
856
|
+
throw new TypeError(`No method named "${config}"`);
|
|
916
857
|
}
|
|
917
858
|
|
|
918
|
-
|
|
919
|
-
};
|
|
859
|
+
data[config](this);
|
|
860
|
+
});
|
|
920
861
|
}
|
|
921
862
|
|
|
922
863
|
}
|
|
@@ -927,7 +868,7 @@
|
|
|
927
868
|
*/
|
|
928
869
|
|
|
929
870
|
|
|
930
|
-
|
|
871
|
+
enableDismissTrigger(Alert, 'close');
|
|
931
872
|
/**
|
|
932
873
|
* ------------------------------------------------------------------------
|
|
933
874
|
* jQuery
|
|
@@ -939,7 +880,7 @@
|
|
|
939
880
|
|
|
940
881
|
/**
|
|
941
882
|
* --------------------------------------------------------------------------
|
|
942
|
-
* CoreUI (v4.0
|
|
883
|
+
* CoreUI (v4.1.0): alert.js
|
|
943
884
|
* Licensed under MIT (https://coreui.io/license)
|
|
944
885
|
*
|
|
945
886
|
* This component is a modified version of the Bootstrap's button.js
|
|
@@ -952,13 +893,13 @@
|
|
|
952
893
|
* ------------------------------------------------------------------------
|
|
953
894
|
*/
|
|
954
895
|
|
|
955
|
-
const NAME$
|
|
956
|
-
const DATA_KEY$
|
|
957
|
-
const EVENT_KEY$
|
|
896
|
+
const NAME$e = 'button';
|
|
897
|
+
const DATA_KEY$d = 'coreui.button';
|
|
898
|
+
const EVENT_KEY$d = `.${DATA_KEY$d}`;
|
|
958
899
|
const DATA_API_KEY$9 = '.data-api';
|
|
959
900
|
const CLASS_NAME_ACTIVE$4 = 'active';
|
|
960
901
|
const SELECTOR_DATA_TOGGLE$6 = '[data-coreui-toggle="button"]';
|
|
961
|
-
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$
|
|
902
|
+
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$d}${DATA_API_KEY$9}`;
|
|
962
903
|
/**
|
|
963
904
|
* ------------------------------------------------------------------------
|
|
964
905
|
* Class Definition
|
|
@@ -968,7 +909,7 @@
|
|
|
968
909
|
class Button extends BaseComponent {
|
|
969
910
|
// Getters
|
|
970
911
|
static get NAME() {
|
|
971
|
-
return NAME$
|
|
912
|
+
return NAME$e;
|
|
972
913
|
} // Public
|
|
973
914
|
|
|
974
915
|
|
|
@@ -1013,7 +954,7 @@
|
|
|
1013
954
|
|
|
1014
955
|
/**
|
|
1015
956
|
* --------------------------------------------------------------------------
|
|
1016
|
-
* CoreUI (v4.0
|
|
957
|
+
* CoreUI (v4.1.0): dom/manipulator.js
|
|
1017
958
|
* Licensed under MIT (https://coreui.io/license)
|
|
1018
959
|
*
|
|
1019
960
|
* This component is a modified version of the Bootstrap's dom/manipulator.js
|
|
@@ -1074,8 +1015,8 @@
|
|
|
1074
1015
|
offset(element) {
|
|
1075
1016
|
const rect = element.getBoundingClientRect();
|
|
1076
1017
|
return {
|
|
1077
|
-
top: rect.top +
|
|
1078
|
-
left: rect.left +
|
|
1018
|
+
top: rect.top + window.pageYOffset,
|
|
1019
|
+
left: rect.left + window.pageXOffset
|
|
1079
1020
|
};
|
|
1080
1021
|
},
|
|
1081
1022
|
|
|
@@ -1090,7 +1031,80 @@
|
|
|
1090
1031
|
|
|
1091
1032
|
/**
|
|
1092
1033
|
* --------------------------------------------------------------------------
|
|
1093
|
-
* CoreUI (v4.0
|
|
1034
|
+
* CoreUI (v4.1.0): dom/selector-engine.js
|
|
1035
|
+
* Licensed under MIT (https://coreui.io/license)
|
|
1036
|
+
*
|
|
1037
|
+
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
1038
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1039
|
+
* --------------------------------------------------------------------------
|
|
1040
|
+
*/
|
|
1041
|
+
const NODE_TEXT = 3;
|
|
1042
|
+
const SelectorEngine = {
|
|
1043
|
+
find(selector, element = document.documentElement) {
|
|
1044
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
1045
|
+
},
|
|
1046
|
+
|
|
1047
|
+
findOne(selector, element = document.documentElement) {
|
|
1048
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
1049
|
+
},
|
|
1050
|
+
|
|
1051
|
+
children(element, selector) {
|
|
1052
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
1053
|
+
},
|
|
1054
|
+
|
|
1055
|
+
parents(element, selector) {
|
|
1056
|
+
const parents = [];
|
|
1057
|
+
let ancestor = element.parentNode;
|
|
1058
|
+
|
|
1059
|
+
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
1060
|
+
if (ancestor.matches(selector)) {
|
|
1061
|
+
parents.push(ancestor);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
ancestor = ancestor.parentNode;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
return parents;
|
|
1068
|
+
},
|
|
1069
|
+
|
|
1070
|
+
prev(element, selector) {
|
|
1071
|
+
let previous = element.previousElementSibling;
|
|
1072
|
+
|
|
1073
|
+
while (previous) {
|
|
1074
|
+
if (previous.matches(selector)) {
|
|
1075
|
+
return [previous];
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
previous = previous.previousElementSibling;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
return [];
|
|
1082
|
+
},
|
|
1083
|
+
|
|
1084
|
+
next(element, selector) {
|
|
1085
|
+
let next = element.nextElementSibling;
|
|
1086
|
+
|
|
1087
|
+
while (next) {
|
|
1088
|
+
if (next.matches(selector)) {
|
|
1089
|
+
return [next];
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
next = next.nextElementSibling;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
return [];
|
|
1096
|
+
},
|
|
1097
|
+
|
|
1098
|
+
focusableChildren(element) {
|
|
1099
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
|
1100
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* --------------------------------------------------------------------------
|
|
1107
|
+
* CoreUI (v4.1.0): carousel.js
|
|
1094
1108
|
* Licensed under MIT (https://coreui.io/license)
|
|
1095
1109
|
*
|
|
1096
1110
|
* This component is a modified version of the Bootstrap's carousel.js
|
|
@@ -1103,16 +1117,16 @@
|
|
|
1103
1117
|
* ------------------------------------------------------------------------
|
|
1104
1118
|
*/
|
|
1105
1119
|
|
|
1106
|
-
const NAME$
|
|
1107
|
-
const DATA_KEY$
|
|
1108
|
-
const EVENT_KEY$
|
|
1120
|
+
const NAME$d = 'carousel';
|
|
1121
|
+
const DATA_KEY$c = 'coreui.carousel';
|
|
1122
|
+
const EVENT_KEY$c = `.${DATA_KEY$c}`;
|
|
1109
1123
|
const DATA_API_KEY$8 = '.data-api';
|
|
1110
1124
|
const ARROW_LEFT_KEY = 'ArrowLeft';
|
|
1111
1125
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
|
1112
1126
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
|
1113
1127
|
|
|
1114
1128
|
const SWIPE_THRESHOLD = 40;
|
|
1115
|
-
const Default$
|
|
1129
|
+
const Default$c = {
|
|
1116
1130
|
interval: 5000,
|
|
1117
1131
|
keyboard: true,
|
|
1118
1132
|
slide: false,
|
|
@@ -1120,7 +1134,7 @@
|
|
|
1120
1134
|
wrap: true,
|
|
1121
1135
|
touch: true
|
|
1122
1136
|
};
|
|
1123
|
-
const DefaultType$
|
|
1137
|
+
const DefaultType$c = {
|
|
1124
1138
|
interval: '(number|boolean)',
|
|
1125
1139
|
keyboard: 'boolean',
|
|
1126
1140
|
slide: '(boolean|string)',
|
|
@@ -1136,19 +1150,19 @@
|
|
|
1136
1150
|
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
|
1137
1151
|
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
|
1138
1152
|
};
|
|
1139
|
-
const EVENT_SLIDE = `slide${EVENT_KEY$
|
|
1140
|
-
const EVENT_SLID = `slid${EVENT_KEY$
|
|
1141
|
-
const EVENT_KEYDOWN = `keydown${EVENT_KEY$
|
|
1142
|
-
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$
|
|
1143
|
-
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$
|
|
1144
|
-
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$
|
|
1145
|
-
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$
|
|
1146
|
-
const EVENT_TOUCHEND = `touchend${EVENT_KEY$
|
|
1147
|
-
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$
|
|
1148
|
-
const EVENT_POINTERUP = `pointerup${EVENT_KEY$
|
|
1149
|
-
const EVENT_DRAG_START = `dragstart${EVENT_KEY$
|
|
1150
|
-
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$
|
|
1151
|
-
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$
|
|
1153
|
+
const EVENT_SLIDE = `slide${EVENT_KEY$c}`;
|
|
1154
|
+
const EVENT_SLID = `slid${EVENT_KEY$c}`;
|
|
1155
|
+
const EVENT_KEYDOWN = `keydown${EVENT_KEY$c}`;
|
|
1156
|
+
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$c}`;
|
|
1157
|
+
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$c}`;
|
|
1158
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$c}`;
|
|
1159
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$c}`;
|
|
1160
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY$c}`;
|
|
1161
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$c}`;
|
|
1162
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY$c}`;
|
|
1163
|
+
const EVENT_DRAG_START = `dragstart${EVENT_KEY$c}`;
|
|
1164
|
+
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1165
|
+
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1152
1166
|
const CLASS_NAME_CAROUSEL = 'carousel';
|
|
1153
1167
|
const CLASS_NAME_ACTIVE$3 = 'active';
|
|
1154
1168
|
const CLASS_NAME_SLIDE = 'slide';
|
|
@@ -1195,11 +1209,11 @@
|
|
|
1195
1209
|
|
|
1196
1210
|
|
|
1197
1211
|
static get Default() {
|
|
1198
|
-
return Default$
|
|
1212
|
+
return Default$c;
|
|
1199
1213
|
}
|
|
1200
1214
|
|
|
1201
1215
|
static get NAME() {
|
|
1202
|
-
return NAME$
|
|
1216
|
+
return NAME$d;
|
|
1203
1217
|
} // Public
|
|
1204
1218
|
|
|
1205
1219
|
|
|
@@ -1277,11 +1291,11 @@
|
|
|
1277
1291
|
|
|
1278
1292
|
|
|
1279
1293
|
_getConfig(config) {
|
|
1280
|
-
config = { ...Default$
|
|
1294
|
+
config = { ...Default$c,
|
|
1281
1295
|
...Manipulator.getDataAttributes(this._element),
|
|
1282
1296
|
...(typeof config === 'object' ? config : {})
|
|
1283
1297
|
};
|
|
1284
|
-
typeCheckConfig(NAME$
|
|
1298
|
+
typeCheckConfig(NAME$d, config, DefaultType$c);
|
|
1285
1299
|
return config;
|
|
1286
1300
|
}
|
|
1287
1301
|
|
|
@@ -1318,8 +1332,12 @@
|
|
|
1318
1332
|
}
|
|
1319
1333
|
|
|
1320
1334
|
_addTouchEventListeners() {
|
|
1335
|
+
const hasPointerPenTouch = event => {
|
|
1336
|
+
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1321
1339
|
const start = event => {
|
|
1322
|
-
if (
|
|
1340
|
+
if (hasPointerPenTouch(event)) {
|
|
1323
1341
|
this.touchStartX = event.clientX;
|
|
1324
1342
|
} else if (!this._pointerEvent) {
|
|
1325
1343
|
this.touchStartX = event.touches[0].clientX;
|
|
@@ -1332,7 +1350,7 @@
|
|
|
1332
1350
|
};
|
|
1333
1351
|
|
|
1334
1352
|
const end = event => {
|
|
1335
|
-
if (
|
|
1353
|
+
if (hasPointerPenTouch(event)) {
|
|
1336
1354
|
this.touchDeltaX = event.clientX - this.touchStartX;
|
|
1337
1355
|
}
|
|
1338
1356
|
|
|
@@ -1357,7 +1375,7 @@
|
|
|
1357
1375
|
};
|
|
1358
1376
|
|
|
1359
1377
|
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
|
1360
|
-
EventHandler.on(itemImg, EVENT_DRAG_START,
|
|
1378
|
+
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
|
1361
1379
|
});
|
|
1362
1380
|
|
|
1363
1381
|
if (this._pointerEvent) {
|
|
@@ -1638,7 +1656,7 @@
|
|
|
1638
1656
|
|
|
1639
1657
|
/**
|
|
1640
1658
|
* --------------------------------------------------------------------------
|
|
1641
|
-
* CoreUI (v4.0
|
|
1659
|
+
* CoreUI (v4.1.0): collapse.js
|
|
1642
1660
|
* Licensed under MIT (https://coreui.io/license)
|
|
1643
1661
|
*
|
|
1644
1662
|
* This component is a modified version of the Bootstrap's collapse.js
|
|
@@ -1651,30 +1669,32 @@
|
|
|
1651
1669
|
* ------------------------------------------------------------------------
|
|
1652
1670
|
*/
|
|
1653
1671
|
|
|
1654
|
-
const NAME$
|
|
1655
|
-
const DATA_KEY$
|
|
1656
|
-
const EVENT_KEY$
|
|
1672
|
+
const NAME$c = 'collapse';
|
|
1673
|
+
const DATA_KEY$b = 'coreui.collapse';
|
|
1674
|
+
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
|
1657
1675
|
const DATA_API_KEY$7 = '.data-api';
|
|
1658
|
-
const Default$
|
|
1676
|
+
const Default$b = {
|
|
1659
1677
|
toggle: true,
|
|
1660
|
-
parent:
|
|
1678
|
+
parent: null
|
|
1661
1679
|
};
|
|
1662
|
-
const DefaultType$
|
|
1680
|
+
const DefaultType$b = {
|
|
1663
1681
|
toggle: 'boolean',
|
|
1664
|
-
parent: '(
|
|
1682
|
+
parent: '(null|element)'
|
|
1665
1683
|
};
|
|
1666
|
-
const EVENT_SHOW$6 = `show${EVENT_KEY$
|
|
1667
|
-
const EVENT_SHOWN$6 = `shown${EVENT_KEY$
|
|
1668
|
-
const EVENT_HIDE$6 = `hide${EVENT_KEY$
|
|
1669
|
-
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$
|
|
1670
|
-
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$
|
|
1671
|
-
const CLASS_NAME_SHOW$
|
|
1684
|
+
const EVENT_SHOW$6 = `show${EVENT_KEY$b}`;
|
|
1685
|
+
const EVENT_SHOWN$6 = `shown${EVENT_KEY$b}`;
|
|
1686
|
+
const EVENT_HIDE$6 = `hide${EVENT_KEY$b}`;
|
|
1687
|
+
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$b}`;
|
|
1688
|
+
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
|
|
1689
|
+
const CLASS_NAME_SHOW$9 = 'show';
|
|
1672
1690
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
|
1673
1691
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
|
1674
1692
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
|
1693
|
+
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
|
1694
|
+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
|
1675
1695
|
const WIDTH = 'width';
|
|
1676
1696
|
const HEIGHT = 'height';
|
|
1677
|
-
const SELECTOR_ACTIVES = '.show, .collapsing';
|
|
1697
|
+
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
|
1678
1698
|
const SELECTOR_DATA_TOGGLE$5 = '[data-coreui-toggle="collapse"]';
|
|
1679
1699
|
/**
|
|
1680
1700
|
* ------------------------------------------------------------------------
|
|
@@ -1687,7 +1707,7 @@
|
|
|
1687
1707
|
super(element);
|
|
1688
1708
|
this._isTransitioning = false;
|
|
1689
1709
|
this._config = this._getConfig(config);
|
|
1690
|
-
this._triggerArray =
|
|
1710
|
+
this._triggerArray = [];
|
|
1691
1711
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$5);
|
|
1692
1712
|
|
|
1693
1713
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
|
@@ -1702,10 +1722,10 @@
|
|
|
1702
1722
|
}
|
|
1703
1723
|
}
|
|
1704
1724
|
|
|
1705
|
-
this.
|
|
1725
|
+
this._initializeChildren();
|
|
1706
1726
|
|
|
1707
1727
|
if (!this._config.parent) {
|
|
1708
|
-
this._addAriaAndCollapsedClass(this.
|
|
1728
|
+
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
|
1709
1729
|
}
|
|
1710
1730
|
|
|
1711
1731
|
if (this._config.toggle) {
|
|
@@ -1715,16 +1735,16 @@
|
|
|
1715
1735
|
|
|
1716
1736
|
|
|
1717
1737
|
static get Default() {
|
|
1718
|
-
return Default$
|
|
1738
|
+
return Default$b;
|
|
1719
1739
|
}
|
|
1720
1740
|
|
|
1721
1741
|
static get NAME() {
|
|
1722
|
-
return NAME$
|
|
1742
|
+
return NAME$c;
|
|
1723
1743
|
} // Public
|
|
1724
1744
|
|
|
1725
1745
|
|
|
1726
1746
|
toggle() {
|
|
1727
|
-
if (this.
|
|
1747
|
+
if (this._isShown()) {
|
|
1728
1748
|
this.hide();
|
|
1729
1749
|
} else {
|
|
1730
1750
|
this.show();
|
|
@@ -1732,30 +1752,21 @@
|
|
|
1732
1752
|
}
|
|
1733
1753
|
|
|
1734
1754
|
show() {
|
|
1735
|
-
if (this._isTransitioning || this.
|
|
1755
|
+
if (this._isTransitioning || this._isShown()) {
|
|
1736
1756
|
return;
|
|
1737
1757
|
}
|
|
1738
1758
|
|
|
1739
|
-
let actives;
|
|
1759
|
+
let actives = [];
|
|
1740
1760
|
let activesData;
|
|
1741
1761
|
|
|
1742
|
-
if (this.
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
return elem.getAttribute('data-coreui-parent') === this._config.parent;
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
|
-
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
|
1749
|
-
});
|
|
1750
|
-
|
|
1751
|
-
if (actives.length === 0) {
|
|
1752
|
-
actives = null;
|
|
1753
|
-
}
|
|
1762
|
+
if (this._config.parent) {
|
|
1763
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1764
|
+
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
|
1754
1765
|
}
|
|
1755
1766
|
|
|
1756
1767
|
const container = SelectorEngine.findOne(this._selector);
|
|
1757
1768
|
|
|
1758
|
-
if (actives) {
|
|
1769
|
+
if (actives.length) {
|
|
1759
1770
|
const tempActiveData = actives.find(elem => container !== elem);
|
|
1760
1771
|
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
|
1761
1772
|
|
|
@@ -1770,17 +1781,17 @@
|
|
|
1770
1781
|
return;
|
|
1771
1782
|
}
|
|
1772
1783
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
}
|
|
1784
|
+
actives.forEach(elemActive => {
|
|
1785
|
+
if (container !== elemActive) {
|
|
1786
|
+
Collapse.getOrCreateInstance(elemActive, {
|
|
1787
|
+
toggle: false
|
|
1788
|
+
}).hide();
|
|
1789
|
+
}
|
|
1778
1790
|
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
}
|
|
1791
|
+
if (!activesData) {
|
|
1792
|
+
Data.set(elemActive, DATA_KEY$b, null);
|
|
1793
|
+
}
|
|
1794
|
+
});
|
|
1784
1795
|
|
|
1785
1796
|
const dimension = this._getDimension();
|
|
1786
1797
|
|
|
@@ -1790,22 +1801,18 @@
|
|
|
1790
1801
|
|
|
1791
1802
|
this._element.style[dimension] = 0;
|
|
1792
1803
|
|
|
1793
|
-
|
|
1794
|
-
this._triggerArray.forEach(element => {
|
|
1795
|
-
element.classList.remove(CLASS_NAME_COLLAPSED);
|
|
1796
|
-
element.setAttribute('aria-expanded', true);
|
|
1797
|
-
});
|
|
1798
|
-
}
|
|
1804
|
+
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
|
1799
1805
|
|
|
1800
|
-
this.
|
|
1806
|
+
this._isTransitioning = true;
|
|
1801
1807
|
|
|
1802
1808
|
const complete = () => {
|
|
1809
|
+
this._isTransitioning = false;
|
|
1810
|
+
|
|
1803
1811
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1804
1812
|
|
|
1805
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1813
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1806
1814
|
|
|
1807
1815
|
this._element.style[dimension] = '';
|
|
1808
|
-
this.setTransitioning(false);
|
|
1809
1816
|
EventHandler.trigger(this._element, EVENT_SHOWN$6);
|
|
1810
1817
|
};
|
|
1811
1818
|
|
|
@@ -1818,7 +1825,7 @@
|
|
|
1818
1825
|
}
|
|
1819
1826
|
|
|
1820
1827
|
hide() {
|
|
1821
|
-
if (this._isTransitioning || !this.
|
|
1828
|
+
if (this._isTransitioning || !this._isShown()) {
|
|
1822
1829
|
return;
|
|
1823
1830
|
}
|
|
1824
1831
|
|
|
@@ -1835,26 +1842,23 @@
|
|
|
1835
1842
|
|
|
1836
1843
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
|
1837
1844
|
|
|
1838
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1845
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1839
1846
|
|
|
1840
1847
|
const triggerArrayLength = this._triggerArray.length;
|
|
1841
1848
|
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
const elem = getElementFromSelector(trigger);
|
|
1849
|
+
for (let i = 0; i < triggerArrayLength; i++) {
|
|
1850
|
+
const trigger = this._triggerArray[i];
|
|
1851
|
+
const elem = getElementFromSelector(trigger);
|
|
1846
1852
|
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
trigger.setAttribute('aria-expanded', false);
|
|
1850
|
-
}
|
|
1853
|
+
if (elem && !this._isShown(elem)) {
|
|
1854
|
+
this._addAriaAndCollapsedClass([trigger], false);
|
|
1851
1855
|
}
|
|
1852
1856
|
}
|
|
1853
1857
|
|
|
1854
|
-
this.
|
|
1858
|
+
this._isTransitioning = true;
|
|
1855
1859
|
|
|
1856
1860
|
const complete = () => {
|
|
1857
|
-
this.
|
|
1861
|
+
this._isTransitioning = false;
|
|
1858
1862
|
|
|
1859
1863
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1860
1864
|
|
|
@@ -1868,45 +1872,47 @@
|
|
|
1868
1872
|
this._queueCallback(complete, this._element, true);
|
|
1869
1873
|
}
|
|
1870
1874
|
|
|
1871
|
-
|
|
1872
|
-
|
|
1875
|
+
_isShown(element = this._element) {
|
|
1876
|
+
return element.classList.contains(CLASS_NAME_SHOW$9);
|
|
1873
1877
|
} // Private
|
|
1874
1878
|
|
|
1875
1879
|
|
|
1876
1880
|
_getConfig(config) {
|
|
1877
|
-
config = { ...Default$
|
|
1881
|
+
config = { ...Default$b,
|
|
1882
|
+
...Manipulator.getDataAttributes(this._element),
|
|
1878
1883
|
...config
|
|
1879
1884
|
};
|
|
1880
1885
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
|
1881
1886
|
|
|
1882
|
-
|
|
1887
|
+
config.parent = getElement(config.parent);
|
|
1888
|
+
typeCheckConfig(NAME$c, config, DefaultType$b);
|
|
1883
1889
|
return config;
|
|
1884
1890
|
}
|
|
1885
1891
|
|
|
1886
1892
|
_getDimension() {
|
|
1887
|
-
return this._element.classList.contains(
|
|
1893
|
+
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
|
1888
1894
|
}
|
|
1889
1895
|
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
const
|
|
1896
|
-
SelectorEngine.find(
|
|
1896
|
+
_initializeChildren() {
|
|
1897
|
+
if (!this._config.parent) {
|
|
1898
|
+
return;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1902
|
+
SelectorEngine.find(SELECTOR_DATA_TOGGLE$5, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
|
1897
1903
|
const selected = getElementFromSelector(element);
|
|
1898
1904
|
|
|
1899
|
-
|
|
1905
|
+
if (selected) {
|
|
1906
|
+
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
|
1907
|
+
}
|
|
1900
1908
|
});
|
|
1901
|
-
return parent;
|
|
1902
1909
|
}
|
|
1903
1910
|
|
|
1904
|
-
_addAriaAndCollapsedClass(
|
|
1905
|
-
if (!
|
|
1911
|
+
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
|
1912
|
+
if (!triggerArray.length) {
|
|
1906
1913
|
return;
|
|
1907
1914
|
}
|
|
1908
1915
|
|
|
1909
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$a);
|
|
1910
1916
|
triggerArray.forEach(elem => {
|
|
1911
1917
|
if (isOpen) {
|
|
1912
1918
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
|
@@ -1919,33 +1925,23 @@
|
|
|
1919
1925
|
} // Static
|
|
1920
1926
|
|
|
1921
1927
|
|
|
1922
|
-
static
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
...Manipulator.getDataAttributes(element),
|
|
1926
|
-
...(typeof config === 'object' && config ? config : {})
|
|
1927
|
-
};
|
|
1928
|
-
|
|
1929
|
-
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
|
1930
|
-
_config.toggle = false;
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
if (!data) {
|
|
1934
|
-
data = new Collapse(element, _config);
|
|
1935
|
-
}
|
|
1928
|
+
static jQueryInterface(config) {
|
|
1929
|
+
return this.each(function () {
|
|
1930
|
+
const _config = {};
|
|
1936
1931
|
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
throw new TypeError(`No method named "${config}"`);
|
|
1932
|
+
if (typeof config === 'string' && /show|hide/.test(config)) {
|
|
1933
|
+
_config.toggle = false;
|
|
1940
1934
|
}
|
|
1941
1935
|
|
|
1942
|
-
data
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1936
|
+
const data = Collapse.getOrCreateInstance(this, _config);
|
|
1945
1937
|
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1938
|
+
if (typeof config === 'string') {
|
|
1939
|
+
if (typeof data[config] === 'undefined') {
|
|
1940
|
+
throw new TypeError(`No method named "${config}"`);
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
data[config]();
|
|
1944
|
+
}
|
|
1949
1945
|
});
|
|
1950
1946
|
}
|
|
1951
1947
|
|
|
@@ -1963,26 +1959,12 @@
|
|
|
1963
1959
|
event.preventDefault();
|
|
1964
1960
|
}
|
|
1965
1961
|
|
|
1966
|
-
const triggerData = Manipulator.getDataAttributes(this);
|
|
1967
1962
|
const selector = getSelectorFromElement(this);
|
|
1968
1963
|
const selectorElements = SelectorEngine.find(selector);
|
|
1969
1964
|
selectorElements.forEach(element => {
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
if (data) {
|
|
1974
|
-
// update parent attribute
|
|
1975
|
-
if (data._parent === null && typeof triggerData.parent === 'string') {
|
|
1976
|
-
data._config.parent = triggerData.parent;
|
|
1977
|
-
data._parent = data._getParent();
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
config = 'toggle';
|
|
1981
|
-
} else {
|
|
1982
|
-
config = triggerData;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
Collapse.collapseInterface(element, config);
|
|
1965
|
+
Collapse.getOrCreateInstance(element, {
|
|
1966
|
+
toggle: false
|
|
1967
|
+
}).toggle();
|
|
1986
1968
|
});
|
|
1987
1969
|
});
|
|
1988
1970
|
/**
|
|
@@ -1996,7 +1978,7 @@
|
|
|
1996
1978
|
|
|
1997
1979
|
/**
|
|
1998
1980
|
* --------------------------------------------------------------------------
|
|
1999
|
-
* CoreUI (v4.0
|
|
1981
|
+
* CoreUI (v4.1.0): dropdown.js
|
|
2000
1982
|
* Licensed under MIT (https://coreui.io/license)
|
|
2001
1983
|
*
|
|
2002
1984
|
* This component is a modified version of the Bootstrap's dropdown.js
|
|
@@ -2009,27 +1991,26 @@
|
|
|
2009
1991
|
* ------------------------------------------------------------------------
|
|
2010
1992
|
*/
|
|
2011
1993
|
|
|
2012
|
-
const NAME$
|
|
2013
|
-
const DATA_KEY$
|
|
2014
|
-
const EVENT_KEY$
|
|
1994
|
+
const NAME$b = 'dropdown';
|
|
1995
|
+
const DATA_KEY$a = 'coreui.dropdown';
|
|
1996
|
+
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
|
2015
1997
|
const DATA_API_KEY$6 = '.data-api';
|
|
2016
1998
|
const ESCAPE_KEY$2 = 'Escape';
|
|
2017
1999
|
const SPACE_KEY = 'Space';
|
|
2018
|
-
const TAB_KEY = 'Tab';
|
|
2000
|
+
const TAB_KEY$1 = 'Tab';
|
|
2019
2001
|
const ARROW_UP_KEY = 'ArrowUp';
|
|
2020
2002
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
2021
2003
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
|
2022
2004
|
|
|
2023
2005
|
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
|
|
2024
|
-
const EVENT_HIDE$5 = `hide${EVENT_KEY$
|
|
2025
|
-
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$
|
|
2026
|
-
const EVENT_SHOW$5 = `show${EVENT_KEY$
|
|
2027
|
-
const EVENT_SHOWN$5 = `shown${EVENT_KEY$
|
|
2028
|
-
const
|
|
2029
|
-
const
|
|
2030
|
-
const
|
|
2031
|
-
const
|
|
2032
|
-
const CLASS_NAME_SHOW$9 = 'show';
|
|
2006
|
+
const EVENT_HIDE$5 = `hide${EVENT_KEY$a}`;
|
|
2007
|
+
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$a}`;
|
|
2008
|
+
const EVENT_SHOW$5 = `show${EVENT_KEY$a}`;
|
|
2009
|
+
const EVENT_SHOWN$5 = `shown${EVENT_KEY$a}`;
|
|
2010
|
+
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
2011
|
+
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
2012
|
+
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
2013
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
|
2033
2014
|
const CLASS_NAME_DROPUP = 'dropup';
|
|
2034
2015
|
const CLASS_NAME_DROPEND = 'dropend';
|
|
2035
2016
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
|
@@ -2044,7 +2025,7 @@
|
|
|
2044
2025
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
|
2045
2026
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
|
2046
2027
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
|
2047
|
-
const Default$
|
|
2028
|
+
const Default$a = {
|
|
2048
2029
|
offset: [0, 2],
|
|
2049
2030
|
boundary: 'clippingParents',
|
|
2050
2031
|
reference: 'toggle',
|
|
@@ -2052,7 +2033,7 @@
|
|
|
2052
2033
|
popperConfig: null,
|
|
2053
2034
|
autoClose: true
|
|
2054
2035
|
};
|
|
2055
|
-
const DefaultType$
|
|
2036
|
+
const DefaultType$a = {
|
|
2056
2037
|
offset: '(array|string|function)',
|
|
2057
2038
|
boundary: '(string|element)',
|
|
2058
2039
|
reference: '(string|element|object)',
|
|
@@ -2073,45 +2054,31 @@
|
|
|
2073
2054
|
this._config = this._getConfig(config);
|
|
2074
2055
|
this._menu = this._getMenuElement();
|
|
2075
2056
|
this._inNavbar = this._detectNavbar();
|
|
2076
|
-
|
|
2077
|
-
this._addEventListeners();
|
|
2078
2057
|
} // Getters
|
|
2079
2058
|
|
|
2080
2059
|
|
|
2081
2060
|
static get Default() {
|
|
2082
|
-
return Default$
|
|
2061
|
+
return Default$a;
|
|
2083
2062
|
}
|
|
2084
2063
|
|
|
2085
2064
|
static get DefaultType() {
|
|
2086
|
-
return DefaultType$
|
|
2065
|
+
return DefaultType$a;
|
|
2087
2066
|
}
|
|
2088
2067
|
|
|
2089
2068
|
static get NAME() {
|
|
2090
|
-
return NAME$
|
|
2069
|
+
return NAME$b;
|
|
2091
2070
|
} // Public
|
|
2092
2071
|
|
|
2093
2072
|
|
|
2094
2073
|
toggle() {
|
|
2095
|
-
|
|
2096
|
-
return;
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
|
-
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$9);
|
|
2100
|
-
|
|
2101
|
-
if (isActive) {
|
|
2102
|
-
this.hide();
|
|
2103
|
-
return;
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
this.show();
|
|
2074
|
+
return this._isShown() ? this.hide() : this.show();
|
|
2107
2075
|
}
|
|
2108
2076
|
|
|
2109
2077
|
show() {
|
|
2110
|
-
if (isDisabled(this._element) || this._menu
|
|
2078
|
+
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
|
2111
2079
|
return;
|
|
2112
2080
|
}
|
|
2113
2081
|
|
|
2114
|
-
const parent = Dropdown.getParentFromElement(this._element);
|
|
2115
2082
|
const relatedTarget = {
|
|
2116
2083
|
relatedTarget: this._element
|
|
2117
2084
|
};
|
|
@@ -2119,34 +2086,14 @@
|
|
|
2119
2086
|
|
|
2120
2087
|
if (showEvent.defaultPrevented) {
|
|
2121
2088
|
return;
|
|
2122
|
-
}
|
|
2089
|
+
}
|
|
2123
2090
|
|
|
2091
|
+
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
|
2124
2092
|
|
|
2125
2093
|
if (this._inNavbar) {
|
|
2126
2094
|
Manipulator.setDataAttribute(this._menu, 'popper', 'none');
|
|
2127
2095
|
} else {
|
|
2128
|
-
|
|
2129
|
-
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
let referenceElement = this._element;
|
|
2133
|
-
|
|
2134
|
-
if (this._config.reference === 'parent') {
|
|
2135
|
-
referenceElement = parent;
|
|
2136
|
-
} else if (isElement(this._config.reference)) {
|
|
2137
|
-
referenceElement = getElement(this._config.reference);
|
|
2138
|
-
} else if (typeof this._config.reference === 'object') {
|
|
2139
|
-
referenceElement = this._config.reference;
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
const popperConfig = this._getPopperConfig();
|
|
2143
|
-
|
|
2144
|
-
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
2145
|
-
this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
|
|
2146
|
-
|
|
2147
|
-
if (isDisplayStatic) {
|
|
2148
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
2149
|
-
}
|
|
2096
|
+
this._createPopper(parent);
|
|
2150
2097
|
} // If this is a touch-enabled device we add extra
|
|
2151
2098
|
// empty mouseover listeners to the body's immediate children;
|
|
2152
2099
|
// only needed because of broken event delegation on iOS
|
|
@@ -2161,15 +2108,15 @@
|
|
|
2161
2108
|
|
|
2162
2109
|
this._element.setAttribute('aria-expanded', true);
|
|
2163
2110
|
|
|
2164
|
-
this._menu.classList.
|
|
2111
|
+
this._menu.classList.add(CLASS_NAME_SHOW$8);
|
|
2165
2112
|
|
|
2166
|
-
this._element.classList.
|
|
2113
|
+
this._element.classList.add(CLASS_NAME_SHOW$8);
|
|
2167
2114
|
|
|
2168
2115
|
EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);
|
|
2169
2116
|
}
|
|
2170
2117
|
|
|
2171
2118
|
hide() {
|
|
2172
|
-
if (isDisabled(this._element) || !this._menu
|
|
2119
|
+
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
|
2173
2120
|
return;
|
|
2174
2121
|
}
|
|
2175
2122
|
|
|
@@ -2197,13 +2144,6 @@
|
|
|
2197
2144
|
} // Private
|
|
2198
2145
|
|
|
2199
2146
|
|
|
2200
|
-
_addEventListeners() {
|
|
2201
|
-
EventHandler.on(this._element, EVENT_CLICK, event => {
|
|
2202
|
-
event.preventDefault();
|
|
2203
|
-
this.toggle();
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
2147
|
_completeHide(relatedTarget) {
|
|
2208
2148
|
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);
|
|
2209
2149
|
|
|
@@ -2221,9 +2161,9 @@
|
|
|
2221
2161
|
this._popper.destroy();
|
|
2222
2162
|
}
|
|
2223
2163
|
|
|
2224
|
-
this._menu.classList.remove(CLASS_NAME_SHOW$
|
|
2164
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$8);
|
|
2225
2165
|
|
|
2226
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
2166
|
+
this._element.classList.remove(CLASS_NAME_SHOW$8);
|
|
2227
2167
|
|
|
2228
2168
|
this._element.setAttribute('aria-expanded', 'false');
|
|
2229
2169
|
|
|
@@ -2236,16 +2176,45 @@
|
|
|
2236
2176
|
...Manipulator.getDataAttributes(this._element),
|
|
2237
2177
|
...config
|
|
2238
2178
|
};
|
|
2239
|
-
typeCheckConfig(NAME$
|
|
2179
|
+
typeCheckConfig(NAME$b, config, this.constructor.DefaultType);
|
|
2240
2180
|
|
|
2241
2181
|
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
2242
2182
|
// Popper virtual elements require a getBoundingClientRect method
|
|
2243
|
-
throw new TypeError(`${NAME$
|
|
2183
|
+
throw new TypeError(`${NAME$b.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
|
2244
2184
|
}
|
|
2245
2185
|
|
|
2246
2186
|
return config;
|
|
2247
2187
|
}
|
|
2248
2188
|
|
|
2189
|
+
_createPopper(parent) {
|
|
2190
|
+
if (typeof Popper__namespace === 'undefined') {
|
|
2191
|
+
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
let referenceElement = this._element;
|
|
2195
|
+
|
|
2196
|
+
if (this._config.reference === 'parent') {
|
|
2197
|
+
referenceElement = parent;
|
|
2198
|
+
} else if (isElement(this._config.reference)) {
|
|
2199
|
+
referenceElement = getElement(this._config.reference);
|
|
2200
|
+
} else if (typeof this._config.reference === 'object') {
|
|
2201
|
+
referenceElement = this._config.reference;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
const popperConfig = this._getPopperConfig();
|
|
2205
|
+
|
|
2206
|
+
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
2207
|
+
this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
|
|
2208
|
+
|
|
2209
|
+
if (isDisplayStatic) {
|
|
2210
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
_isShown(element = this._element) {
|
|
2215
|
+
return element.classList.contains(CLASS_NAME_SHOW$8);
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2249
2218
|
_getMenuElement() {
|
|
2250
2219
|
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
|
|
2251
2220
|
}
|
|
@@ -2335,26 +2304,24 @@
|
|
|
2335
2304
|
} // Static
|
|
2336
2305
|
|
|
2337
2306
|
|
|
2338
|
-
static
|
|
2339
|
-
|
|
2307
|
+
static jQueryInterface(config) {
|
|
2308
|
+
return this.each(function () {
|
|
2309
|
+
const data = Dropdown.getOrCreateInstance(this, config);
|
|
2310
|
+
|
|
2311
|
+
if (typeof config !== 'string') {
|
|
2312
|
+
return;
|
|
2313
|
+
}
|
|
2340
2314
|
|
|
2341
|
-
if (typeof config === 'string') {
|
|
2342
2315
|
if (typeof data[config] === 'undefined') {
|
|
2343
2316
|
throw new TypeError(`No method named "${config}"`);
|
|
2344
2317
|
}
|
|
2345
2318
|
|
|
2346
2319
|
data[config]();
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
static jQueryInterface(config) {
|
|
2351
|
-
return this.each(function () {
|
|
2352
|
-
Dropdown.dropdownInterface(this, config);
|
|
2353
2320
|
});
|
|
2354
2321
|
}
|
|
2355
2322
|
|
|
2356
2323
|
static clearMenus(event) {
|
|
2357
|
-
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
|
2324
|
+
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
|
|
2358
2325
|
return;
|
|
2359
2326
|
}
|
|
2360
2327
|
|
|
@@ -2367,7 +2334,7 @@
|
|
|
2367
2334
|
continue;
|
|
2368
2335
|
}
|
|
2369
2336
|
|
|
2370
|
-
if (!context.
|
|
2337
|
+
if (!context._isShown()) {
|
|
2371
2338
|
continue;
|
|
2372
2339
|
}
|
|
2373
2340
|
|
|
@@ -2384,7 +2351,7 @@
|
|
|
2384
2351
|
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
|
2385
2352
|
|
|
2386
2353
|
|
|
2387
|
-
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
2354
|
+
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
2388
2355
|
continue;
|
|
2389
2356
|
}
|
|
2390
2357
|
|
|
@@ -2413,7 +2380,7 @@
|
|
|
2413
2380
|
return;
|
|
2414
2381
|
}
|
|
2415
2382
|
|
|
2416
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$
|
|
2383
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$8);
|
|
2417
2384
|
|
|
2418
2385
|
if (!isActive && event.key === ESCAPE_KEY$2) {
|
|
2419
2386
|
return;
|
|
@@ -2426,20 +2393,20 @@
|
|
|
2426
2393
|
return;
|
|
2427
2394
|
}
|
|
2428
2395
|
|
|
2429
|
-
const getToggleButton =
|
|
2396
|
+
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$4) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$4)[0];
|
|
2397
|
+
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
2430
2398
|
|
|
2431
2399
|
if (event.key === ESCAPE_KEY$2) {
|
|
2432
|
-
|
|
2433
|
-
Dropdown.clearMenus();
|
|
2400
|
+
instance.hide();
|
|
2434
2401
|
return;
|
|
2435
2402
|
}
|
|
2436
2403
|
|
|
2437
2404
|
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
|
2438
2405
|
if (!isActive) {
|
|
2439
|
-
|
|
2406
|
+
instance.show();
|
|
2440
2407
|
}
|
|
2441
2408
|
|
|
2442
|
-
|
|
2409
|
+
instance._selectMenuItem(event);
|
|
2443
2410
|
|
|
2444
2411
|
return;
|
|
2445
2412
|
}
|
|
@@ -2463,7 +2430,7 @@
|
|
|
2463
2430
|
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
|
2464
2431
|
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, function (event) {
|
|
2465
2432
|
event.preventDefault();
|
|
2466
|
-
Dropdown.
|
|
2433
|
+
Dropdown.getOrCreateInstance(this).toggle();
|
|
2467
2434
|
});
|
|
2468
2435
|
/**
|
|
2469
2436
|
* ------------------------------------------------------------------------
|
|
@@ -2476,7 +2443,7 @@
|
|
|
2476
2443
|
|
|
2477
2444
|
/**
|
|
2478
2445
|
* --------------------------------------------------------------------------
|
|
2479
|
-
* Bootstrap (v5.
|
|
2446
|
+
* Bootstrap (v5.1.3): util/scrollBar.js
|
|
2480
2447
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2481
2448
|
* --------------------------------------------------------------------------
|
|
2482
2449
|
*/
|
|
@@ -2580,11 +2547,12 @@
|
|
|
2580
2547
|
|
|
2581
2548
|
/**
|
|
2582
2549
|
* --------------------------------------------------------------------------
|
|
2583
|
-
* Bootstrap (v5.
|
|
2584
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
|
2550
|
+
* Bootstrap (v5.1.3): util/backdrop.js
|
|
2551
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2585
2552
|
* --------------------------------------------------------------------------
|
|
2586
2553
|
*/
|
|
2587
|
-
const Default$
|
|
2554
|
+
const Default$9 = {
|
|
2555
|
+
className: 'modal-backdrop',
|
|
2588
2556
|
isVisible: true,
|
|
2589
2557
|
// if false, we use the backdrop helper without adding any element to the dom
|
|
2590
2558
|
isAnimated: false,
|
|
@@ -2592,17 +2560,17 @@
|
|
|
2592
2560
|
// give the choice to place backdrop under different elements
|
|
2593
2561
|
clickCallback: null
|
|
2594
2562
|
};
|
|
2595
|
-
const DefaultType$
|
|
2563
|
+
const DefaultType$9 = {
|
|
2564
|
+
className: 'string',
|
|
2596
2565
|
isVisible: 'boolean',
|
|
2597
2566
|
isAnimated: 'boolean',
|
|
2598
2567
|
rootElement: '(element|string)',
|
|
2599
2568
|
clickCallback: '(function|null)'
|
|
2600
2569
|
};
|
|
2601
|
-
const NAME$
|
|
2602
|
-
const
|
|
2603
|
-
const
|
|
2604
|
-
const
|
|
2605
|
-
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$9}`;
|
|
2570
|
+
const NAME$a = 'backdrop';
|
|
2571
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
|
2572
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
|
2573
|
+
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$a}`;
|
|
2606
2574
|
|
|
2607
2575
|
class Backdrop {
|
|
2608
2576
|
constructor(config) {
|
|
@@ -2623,7 +2591,7 @@
|
|
|
2623
2591
|
reflow(this._getElement());
|
|
2624
2592
|
}
|
|
2625
2593
|
|
|
2626
|
-
this._getElement().classList.add(CLASS_NAME_SHOW$
|
|
2594
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$7);
|
|
2627
2595
|
|
|
2628
2596
|
this._emulateAnimation(() => {
|
|
2629
2597
|
execute(callback);
|
|
@@ -2636,7 +2604,7 @@
|
|
|
2636
2604
|
return;
|
|
2637
2605
|
}
|
|
2638
2606
|
|
|
2639
|
-
this._getElement().classList.remove(CLASS_NAME_SHOW$
|
|
2607
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$7);
|
|
2640
2608
|
|
|
2641
2609
|
this._emulateAnimation(() => {
|
|
2642
2610
|
this.dispose();
|
|
@@ -2648,10 +2616,10 @@
|
|
|
2648
2616
|
_getElement() {
|
|
2649
2617
|
if (!this._element) {
|
|
2650
2618
|
const backdrop = document.createElement('div');
|
|
2651
|
-
backdrop.className =
|
|
2619
|
+
backdrop.className = this._config.className;
|
|
2652
2620
|
|
|
2653
2621
|
if (this._config.isAnimated) {
|
|
2654
|
-
backdrop.classList.add(CLASS_NAME_FADE$
|
|
2622
|
+
backdrop.classList.add(CLASS_NAME_FADE$5);
|
|
2655
2623
|
}
|
|
2656
2624
|
|
|
2657
2625
|
this._element = backdrop;
|
|
@@ -2661,12 +2629,12 @@
|
|
|
2661
2629
|
}
|
|
2662
2630
|
|
|
2663
2631
|
_getConfig(config) {
|
|
2664
|
-
config = { ...Default$
|
|
2632
|
+
config = { ...Default$9,
|
|
2665
2633
|
...(typeof config === 'object' ? config : {})
|
|
2666
2634
|
}; // use getElement() with the default "body" to get a fresh Element on each instantiation
|
|
2667
2635
|
|
|
2668
2636
|
config.rootElement = getElement(config.rootElement);
|
|
2669
|
-
typeCheckConfig(NAME$
|
|
2637
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
|
2670
2638
|
return config;
|
|
2671
2639
|
}
|
|
2672
2640
|
|
|
@@ -2675,7 +2643,7 @@
|
|
|
2675
2643
|
return;
|
|
2676
2644
|
}
|
|
2677
2645
|
|
|
2678
|
-
this._config.rootElement.
|
|
2646
|
+
this._config.rootElement.append(this._getElement());
|
|
2679
2647
|
|
|
2680
2648
|
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
|
2681
2649
|
execute(this._config.clickCallback);
|
|
@@ -2703,7 +2671,110 @@
|
|
|
2703
2671
|
|
|
2704
2672
|
/**
|
|
2705
2673
|
* --------------------------------------------------------------------------
|
|
2706
|
-
|
|
2674
|
+
* Bootstrap (v5.1.3): util/focustrap.js
|
|
2675
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2676
|
+
* --------------------------------------------------------------------------
|
|
2677
|
+
*/
|
|
2678
|
+
const Default$8 = {
|
|
2679
|
+
trapElement: null,
|
|
2680
|
+
// The element to trap focus inside of
|
|
2681
|
+
autofocus: true
|
|
2682
|
+
};
|
|
2683
|
+
const DefaultType$8 = {
|
|
2684
|
+
trapElement: 'element',
|
|
2685
|
+
autofocus: 'boolean'
|
|
2686
|
+
};
|
|
2687
|
+
const NAME$9 = 'focustrap';
|
|
2688
|
+
const DATA_KEY$9 = 'coreui.focustrap';
|
|
2689
|
+
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
|
2690
|
+
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$9}`;
|
|
2691
|
+
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$9}`;
|
|
2692
|
+
const TAB_KEY = 'Tab';
|
|
2693
|
+
const TAB_NAV_FORWARD = 'forward';
|
|
2694
|
+
const TAB_NAV_BACKWARD = 'backward';
|
|
2695
|
+
|
|
2696
|
+
class FocusTrap {
|
|
2697
|
+
constructor(config) {
|
|
2698
|
+
this._config = this._getConfig(config);
|
|
2699
|
+
this._isActive = false;
|
|
2700
|
+
this._lastTabNavDirection = null;
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
activate() {
|
|
2704
|
+
const {
|
|
2705
|
+
trapElement,
|
|
2706
|
+
autofocus
|
|
2707
|
+
} = this._config;
|
|
2708
|
+
|
|
2709
|
+
if (this._isActive) {
|
|
2710
|
+
return;
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
if (autofocus) {
|
|
2714
|
+
trapElement.focus();
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
EventHandler.off(document, EVENT_KEY$9); // guard against infinite focus loop
|
|
2718
|
+
|
|
2719
|
+
EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
|
|
2720
|
+
EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
|
|
2721
|
+
this._isActive = true;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
deactivate() {
|
|
2725
|
+
if (!this._isActive) {
|
|
2726
|
+
return;
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
this._isActive = false;
|
|
2730
|
+
EventHandler.off(document, EVENT_KEY$9);
|
|
2731
|
+
} // Private
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
_handleFocusin(event) {
|
|
2735
|
+
const {
|
|
2736
|
+
target
|
|
2737
|
+
} = event;
|
|
2738
|
+
const {
|
|
2739
|
+
trapElement
|
|
2740
|
+
} = this._config;
|
|
2741
|
+
|
|
2742
|
+
if (target === document || target === trapElement || trapElement.contains(target)) {
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
const elements = SelectorEngine.focusableChildren(trapElement);
|
|
2747
|
+
|
|
2748
|
+
if (elements.length === 0) {
|
|
2749
|
+
trapElement.focus();
|
|
2750
|
+
} else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
|
|
2751
|
+
elements[elements.length - 1].focus();
|
|
2752
|
+
} else {
|
|
2753
|
+
elements[0].focus();
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
_handleKeydown(event) {
|
|
2758
|
+
if (event.key !== TAB_KEY) {
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
_getConfig(config) {
|
|
2766
|
+
config = { ...Default$8,
|
|
2767
|
+
...(typeof config === 'object' ? config : {})
|
|
2768
|
+
};
|
|
2769
|
+
typeCheckConfig(NAME$9, config, DefaultType$8);
|
|
2770
|
+
return config;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
/**
|
|
2776
|
+
* --------------------------------------------------------------------------
|
|
2777
|
+
* CoreUI (v4.1.0): modal.js
|
|
2707
2778
|
* Licensed under MIT (https://coreui.io/license)
|
|
2708
2779
|
*
|
|
2709
2780
|
* This component is a modified version of the Bootstrap's modal.js
|
|
@@ -2736,21 +2807,20 @@
|
|
|
2736
2807
|
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
|
|
2737
2808
|
const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
|
|
2738
2809
|
const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
|
|
2739
|
-
const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$8}`;
|
|
2740
2810
|
const EVENT_RESIZE$1 = `resize${EVENT_KEY$8}`;
|
|
2741
|
-
const EVENT_CLICK_DISMISS
|
|
2811
|
+
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$8}`;
|
|
2742
2812
|
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$8}`;
|
|
2743
2813
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$8}`;
|
|
2744
2814
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$8}`;
|
|
2745
2815
|
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
|
|
2746
2816
|
const CLASS_NAME_OPEN = 'modal-open';
|
|
2747
|
-
const CLASS_NAME_FADE$
|
|
2748
|
-
const CLASS_NAME_SHOW$
|
|
2817
|
+
const CLASS_NAME_FADE$4 = 'fade';
|
|
2818
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
|
2749
2819
|
const CLASS_NAME_STATIC = 'modal-static';
|
|
2820
|
+
const OPEN_SELECTOR$1 = '.modal.show';
|
|
2750
2821
|
const SELECTOR_DIALOG = '.modal-dialog';
|
|
2751
2822
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
|
2752
2823
|
const SELECTOR_DATA_TOGGLE$3 = '[data-coreui-toggle="modal"]';
|
|
2753
|
-
const SELECTOR_DATA_DISMISS$2 = '[data-coreui-dismiss="modal"]';
|
|
2754
2824
|
/**
|
|
2755
2825
|
* ------------------------------------------------------------------------
|
|
2756
2826
|
* Class Definition
|
|
@@ -2763,6 +2833,7 @@
|
|
|
2763
2833
|
this._config = this._getConfig(config);
|
|
2764
2834
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
|
2765
2835
|
this._backdrop = this._initializeBackDrop();
|
|
2836
|
+
this._focustrap = this._initializeFocusTrap();
|
|
2766
2837
|
this._isShown = false;
|
|
2767
2838
|
this._ignoreBackdropClick = false;
|
|
2768
2839
|
this._isTransitioning = false;
|
|
@@ -2812,7 +2883,6 @@
|
|
|
2812
2883
|
|
|
2813
2884
|
this._setResizeEvent();
|
|
2814
2885
|
|
|
2815
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
|
|
2816
2886
|
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
|
|
2817
2887
|
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
|
|
2818
2888
|
if (event.target === this._element) {
|
|
@@ -2824,11 +2894,7 @@
|
|
|
2824
2894
|
this._showBackdrop(() => this._showElement(relatedTarget));
|
|
2825
2895
|
}
|
|
2826
2896
|
|
|
2827
|
-
hide(
|
|
2828
|
-
if (event && ['A', 'AREA'].includes(event.target.tagName)) {
|
|
2829
|
-
event.preventDefault();
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2897
|
+
hide() {
|
|
2832
2898
|
if (!this._isShown || this._isTransitioning) {
|
|
2833
2899
|
return;
|
|
2834
2900
|
}
|
|
@@ -2851,11 +2917,11 @@
|
|
|
2851
2917
|
|
|
2852
2918
|
this._setResizeEvent();
|
|
2853
2919
|
|
|
2854
|
-
|
|
2920
|
+
this._focustrap.deactivate();
|
|
2855
2921
|
|
|
2856
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
2922
|
+
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
|
2857
2923
|
|
|
2858
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS
|
|
2924
|
+
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
|
2859
2925
|
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
|
|
2860
2926
|
|
|
2861
2927
|
this._queueCallback(() => this._hideModal(), this._element, isAnimated);
|
|
@@ -2866,14 +2932,9 @@
|
|
|
2866
2932
|
|
|
2867
2933
|
this._backdrop.dispose();
|
|
2868
2934
|
|
|
2869
|
-
|
|
2870
|
-
/**
|
|
2871
|
-
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
|
2872
|
-
* Do not move `document` in `htmlElements` array
|
|
2873
|
-
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
|
2874
|
-
*/
|
|
2935
|
+
this._focustrap.deactivate();
|
|
2875
2936
|
|
|
2876
|
-
|
|
2937
|
+
super.dispose();
|
|
2877
2938
|
}
|
|
2878
2939
|
|
|
2879
2940
|
handleUpdate() {
|
|
@@ -2889,6 +2950,12 @@
|
|
|
2889
2950
|
});
|
|
2890
2951
|
}
|
|
2891
2952
|
|
|
2953
|
+
_initializeFocusTrap() {
|
|
2954
|
+
return new FocusTrap({
|
|
2955
|
+
trapElement: this._element
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2892
2959
|
_getConfig(config) {
|
|
2893
2960
|
config = { ...Default$7,
|
|
2894
2961
|
...Manipulator.getDataAttributes(this._element),
|
|
@@ -2905,7 +2972,7 @@
|
|
|
2905
2972
|
|
|
2906
2973
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
|
2907
2974
|
// Don't move modal's DOM position
|
|
2908
|
-
document.body.
|
|
2975
|
+
document.body.append(this._element);
|
|
2909
2976
|
}
|
|
2910
2977
|
|
|
2911
2978
|
this._element.style.display = 'block';
|
|
@@ -2926,15 +2993,11 @@
|
|
|
2926
2993
|
reflow(this._element);
|
|
2927
2994
|
}
|
|
2928
2995
|
|
|
2929
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
2930
|
-
|
|
2931
|
-
if (this._config.focus) {
|
|
2932
|
-
this._enforceFocus();
|
|
2933
|
-
}
|
|
2996
|
+
this._element.classList.add(CLASS_NAME_SHOW$6);
|
|
2934
2997
|
|
|
2935
2998
|
const transitionComplete = () => {
|
|
2936
2999
|
if (this._config.focus) {
|
|
2937
|
-
this.
|
|
3000
|
+
this._focustrap.activate();
|
|
2938
3001
|
}
|
|
2939
3002
|
|
|
2940
3003
|
this._isTransitioning = false;
|
|
@@ -2946,16 +3009,6 @@
|
|
|
2946
3009
|
this._queueCallback(transitionComplete, this._dialog, isAnimated);
|
|
2947
3010
|
}
|
|
2948
3011
|
|
|
2949
|
-
_enforceFocus() {
|
|
2950
|
-
EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
|
|
2951
|
-
|
|
2952
|
-
EventHandler.on(document, EVENT_FOCUSIN$2, event => {
|
|
2953
|
-
if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
|
|
2954
|
-
this._element.focus();
|
|
2955
|
-
}
|
|
2956
|
-
});
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
3012
|
_setEscapeEvent() {
|
|
2960
3013
|
if (this._isShown) {
|
|
2961
3014
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
|
@@ -3002,7 +3055,7 @@
|
|
|
3002
3055
|
}
|
|
3003
3056
|
|
|
3004
3057
|
_showBackdrop(callback) {
|
|
3005
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS
|
|
3058
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
|
|
3006
3059
|
if (this._ignoreBackdropClick) {
|
|
3007
3060
|
this._ignoreBackdropClick = false;
|
|
3008
3061
|
return;
|
|
@@ -3023,7 +3076,7 @@
|
|
|
3023
3076
|
}
|
|
3024
3077
|
|
|
3025
3078
|
_isAnimated() {
|
|
3026
|
-
return this._element.classList.contains(CLASS_NAME_FADE$
|
|
3079
|
+
return this._element.classList.contains(CLASS_NAME_FADE$4);
|
|
3027
3080
|
}
|
|
3028
3081
|
|
|
3029
3082
|
_triggerBackdropTransition() {
|
|
@@ -3130,10 +3183,18 @@
|
|
|
3130
3183
|
this.focus();
|
|
3131
3184
|
}
|
|
3132
3185
|
});
|
|
3133
|
-
});
|
|
3186
|
+
}); // avoid conflict when clicking moddal toggler while another one is open
|
|
3187
|
+
|
|
3188
|
+
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
|
|
3189
|
+
|
|
3190
|
+
if (allReadyOpen) {
|
|
3191
|
+
Modal.getInstance(allReadyOpen).hide();
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3134
3194
|
const data = Modal.getOrCreateInstance(target);
|
|
3135
3195
|
data.toggle(this);
|
|
3136
3196
|
});
|
|
3197
|
+
enableDismissTrigger(Modal);
|
|
3137
3198
|
/**
|
|
3138
3199
|
* ------------------------------------------------------------------------
|
|
3139
3200
|
* jQuery
|
|
@@ -3145,7 +3206,7 @@
|
|
|
3145
3206
|
|
|
3146
3207
|
/**
|
|
3147
3208
|
* --------------------------------------------------------------------------
|
|
3148
|
-
* CoreUI (v4.0
|
|
3209
|
+
* CoreUI (v4.1.0): navigation.js
|
|
3149
3210
|
* Licensed under MIT (https://coreui.io/license)
|
|
3150
3211
|
* --------------------------------------------------------------------------
|
|
3151
3212
|
*/
|
|
@@ -3168,7 +3229,7 @@
|
|
|
3168
3229
|
groupsAutoCollapse: '(string|boolean)'
|
|
3169
3230
|
};
|
|
3170
3231
|
const CLASS_NAME_ACTIVE$2 = 'active';
|
|
3171
|
-
const CLASS_NAME_SHOW$
|
|
3232
|
+
const CLASS_NAME_SHOW$5 = 'show';
|
|
3172
3233
|
const CLASS_NAME_NAV_GROUP = 'nav-group';
|
|
3173
3234
|
const CLASS_NAME_NAV_GROUP_TOGGLE = 'nav-group-toggle';
|
|
3174
3235
|
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
|
@@ -3207,6 +3268,10 @@
|
|
|
3207
3268
|
|
|
3208
3269
|
static get DefaultType() {
|
|
3209
3270
|
return DefaultType$6;
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
static get NAME() {
|
|
3274
|
+
return NAME$7;
|
|
3210
3275
|
} // Private
|
|
3211
3276
|
|
|
3212
3277
|
|
|
@@ -3241,7 +3306,7 @@
|
|
|
3241
3306
|
if (this._config.activeLinksExact && element.href === currentUrl) {
|
|
3242
3307
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
3243
3308
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
3244
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
3309
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
3245
3310
|
element.setAttribute('aria-expanded', true);
|
|
3246
3311
|
});
|
|
3247
3312
|
}
|
|
@@ -3249,7 +3314,7 @@
|
|
|
3249
3314
|
if (!this._config.activeLinksExact && element.href.startsWith(currentUrl)) {
|
|
3250
3315
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
3251
3316
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
3252
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
3317
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
3253
3318
|
element.setAttribute('aria-expanded', true);
|
|
3254
3319
|
});
|
|
3255
3320
|
}
|
|
@@ -3348,28 +3413,28 @@
|
|
|
3348
3413
|
toggler = toggler.closest(SELECTOR_NAV_GROUP_TOGGLE);
|
|
3349
3414
|
}
|
|
3350
3415
|
|
|
3351
|
-
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$
|
|
3416
|
+
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$5)); // Close other groups
|
|
3352
3417
|
|
|
3353
3418
|
|
|
3354
3419
|
if (this._config.groupsAutoCollapse === true) {
|
|
3355
3420
|
this._getSiblings(toggler.parentNode, filter).forEach(element => {
|
|
3356
3421
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, element), () => {
|
|
3357
|
-
element.classList.remove(CLASS_NAME_SHOW$
|
|
3422
|
+
element.classList.remove(CLASS_NAME_SHOW$5);
|
|
3358
3423
|
element.setAttribute('aria-expanded', false);
|
|
3359
3424
|
});
|
|
3360
3425
|
});
|
|
3361
3426
|
}
|
|
3362
3427
|
|
|
3363
|
-
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$
|
|
3428
|
+
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$5)) {
|
|
3364
3429
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode), () => {
|
|
3365
|
-
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$
|
|
3430
|
+
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$5);
|
|
3366
3431
|
toggler.parentNode.setAttribute('aria-expanded', false);
|
|
3367
3432
|
});
|
|
3368
3433
|
|
|
3369
3434
|
return;
|
|
3370
3435
|
}
|
|
3371
3436
|
|
|
3372
|
-
toggler.parentNode.classList.add(CLASS_NAME_SHOW$
|
|
3437
|
+
toggler.parentNode.classList.add(CLASS_NAME_SHOW$5);
|
|
3373
3438
|
toggler.parentNode.setAttribute('aria-expanded', true);
|
|
3374
3439
|
|
|
3375
3440
|
this._slideDown(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode));
|
|
@@ -3422,11 +3487,11 @@
|
|
|
3422
3487
|
* add .Navigation to jQuery only if jQuery is present
|
|
3423
3488
|
*/
|
|
3424
3489
|
|
|
3425
|
-
defineJQueryPlugin(
|
|
3490
|
+
defineJQueryPlugin(Navigation);
|
|
3426
3491
|
|
|
3427
3492
|
/**
|
|
3428
3493
|
* --------------------------------------------------------------------------
|
|
3429
|
-
* CoreUI (v4.0
|
|
3494
|
+
* CoreUI (v4.1.0): dropdown.js
|
|
3430
3495
|
* Licensed under MIT (https://coreui.io/license)
|
|
3431
3496
|
*
|
|
3432
3497
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
@@ -3455,17 +3520,15 @@
|
|
|
3455
3520
|
keyboard: 'boolean',
|
|
3456
3521
|
scroll: 'boolean'
|
|
3457
3522
|
};
|
|
3458
|
-
const CLASS_NAME_SHOW$
|
|
3523
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
|
3524
|
+
const CLASS_NAME_BACKDROP$1 = 'offcanvas-backdrop';
|
|
3459
3525
|
const OPEN_SELECTOR = '.offcanvas.show';
|
|
3460
3526
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
|
3461
3527
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
|
3462
3528
|
const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
|
|
3463
3529
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
|
3464
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
|
|
3465
3530
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
|
3466
|
-
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$6}`;
|
|
3467
3531
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$6}`;
|
|
3468
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-coreui-dismiss="offcanvas"]';
|
|
3469
3532
|
const SELECTOR_DATA_TOGGLE$2 = '[data-coreui-toggle="offcanvas"]';
|
|
3470
3533
|
/**
|
|
3471
3534
|
* ------------------------------------------------------------------------
|
|
@@ -3479,6 +3542,7 @@
|
|
|
3479
3542
|
this._config = this._getConfig(config);
|
|
3480
3543
|
this._isShown = false;
|
|
3481
3544
|
this._backdrop = this._initializeBackDrop();
|
|
3545
|
+
this._focustrap = this._initializeFocusTrap();
|
|
3482
3546
|
|
|
3483
3547
|
this._addEventListeners();
|
|
3484
3548
|
} // Getters
|
|
@@ -3517,8 +3581,6 @@
|
|
|
3517
3581
|
|
|
3518
3582
|
if (!this._config.scroll) {
|
|
3519
3583
|
new ScrollBarHelper().hide();
|
|
3520
|
-
|
|
3521
|
-
this._enforceFocusOnElement(this._element);
|
|
3522
3584
|
}
|
|
3523
3585
|
|
|
3524
3586
|
this._element.removeAttribute('aria-hidden');
|
|
@@ -3527,9 +3589,13 @@
|
|
|
3527
3589
|
|
|
3528
3590
|
this._element.setAttribute('role', 'dialog');
|
|
3529
3591
|
|
|
3530
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
3592
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
|
3531
3593
|
|
|
3532
3594
|
const completeCallBack = () => {
|
|
3595
|
+
if (!this._config.scroll) {
|
|
3596
|
+
this._focustrap.activate();
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3533
3599
|
EventHandler.trigger(this._element, EVENT_SHOWN$3, {
|
|
3534
3600
|
relatedTarget
|
|
3535
3601
|
});
|
|
@@ -3549,13 +3615,13 @@
|
|
|
3549
3615
|
return;
|
|
3550
3616
|
}
|
|
3551
3617
|
|
|
3552
|
-
|
|
3618
|
+
this._focustrap.deactivate();
|
|
3553
3619
|
|
|
3554
3620
|
this._element.blur();
|
|
3555
3621
|
|
|
3556
3622
|
this._isShown = false;
|
|
3557
3623
|
|
|
3558
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
3624
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
|
3559
3625
|
|
|
3560
3626
|
this._backdrop.hide();
|
|
3561
3627
|
|
|
@@ -3581,8 +3647,9 @@
|
|
|
3581
3647
|
dispose() {
|
|
3582
3648
|
this._backdrop.dispose();
|
|
3583
3649
|
|
|
3650
|
+
this._focustrap.deactivate();
|
|
3651
|
+
|
|
3584
3652
|
super.dispose();
|
|
3585
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
|
3586
3653
|
} // Private
|
|
3587
3654
|
|
|
3588
3655
|
|
|
@@ -3597,6 +3664,7 @@
|
|
|
3597
3664
|
|
|
3598
3665
|
_initializeBackDrop() {
|
|
3599
3666
|
return new Backdrop({
|
|
3667
|
+
className: CLASS_NAME_BACKDROP$1,
|
|
3600
3668
|
isVisible: this._config.backdrop,
|
|
3601
3669
|
isAnimated: true,
|
|
3602
3670
|
rootElement: this._element.parentNode,
|
|
@@ -3604,19 +3672,13 @@
|
|
|
3604
3672
|
});
|
|
3605
3673
|
}
|
|
3606
3674
|
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
EventHandler.on(document, EVENT_FOCUSIN$1, event => {
|
|
3611
|
-
if (document !== event.target && element !== event.target && !element.contains(event.target)) {
|
|
3612
|
-
element.focus();
|
|
3613
|
-
}
|
|
3675
|
+
_initializeFocusTrap() {
|
|
3676
|
+
return new FocusTrap({
|
|
3677
|
+
trapElement: this._element
|
|
3614
3678
|
});
|
|
3615
|
-
element.focus();
|
|
3616
3679
|
}
|
|
3617
3680
|
|
|
3618
3681
|
_addEventListeners() {
|
|
3619
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
|
3620
3682
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
|
3621
3683
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
|
3622
3684
|
this.hide();
|
|
@@ -3677,6 +3739,7 @@
|
|
|
3677
3739
|
data.toggle(this);
|
|
3678
3740
|
});
|
|
3679
3741
|
EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
|
3742
|
+
enableDismissTrigger(Offcanvas);
|
|
3680
3743
|
/**
|
|
3681
3744
|
* ------------------------------------------------------------------------
|
|
3682
3745
|
* jQuery
|
|
@@ -3687,45 +3750,45 @@
|
|
|
3687
3750
|
|
|
3688
3751
|
/**
|
|
3689
3752
|
* --------------------------------------------------------------------------
|
|
3690
|
-
* CoreUI (v4.0
|
|
3753
|
+
* CoreUI (v4.1.0): alert.js
|
|
3691
3754
|
* Licensed under MIT (https://coreui.io/license)
|
|
3692
3755
|
*
|
|
3693
3756
|
* This component is a modified version of the Bootstrap's util/sanitizer.js
|
|
3694
3757
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3695
3758
|
* --------------------------------------------------------------------------
|
|
3696
3759
|
*/
|
|
3697
|
-
const
|
|
3760
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
3698
3761
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
3699
3762
|
/**
|
|
3700
3763
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
3701
3764
|
*
|
|
3702
|
-
* Shoutout to Angular
|
|
3765
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
3703
3766
|
*/
|
|
3704
3767
|
|
|
3705
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
3768
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
3706
3769
|
/**
|
|
3707
3770
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
3708
3771
|
*
|
|
3709
|
-
* Shoutout to Angular
|
|
3772
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
3710
3773
|
*/
|
|
3711
3774
|
|
|
3712
3775
|
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;
|
|
3713
3776
|
|
|
3714
|
-
const allowedAttribute = (
|
|
3715
|
-
const
|
|
3777
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
3778
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
3716
3779
|
|
|
3717
|
-
if (allowedAttributeList.includes(
|
|
3718
|
-
if (
|
|
3719
|
-
return Boolean(SAFE_URL_PATTERN.test(
|
|
3780
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
3781
|
+
if (uriAttributes.has(attributeName)) {
|
|
3782
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
|
3720
3783
|
}
|
|
3721
3784
|
|
|
3722
3785
|
return true;
|
|
3723
3786
|
}
|
|
3724
3787
|
|
|
3725
|
-
const regExp = allowedAttributeList.filter(
|
|
3788
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
|
3726
3789
|
|
|
3727
3790
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
|
3728
|
-
if (regExp[i].test(
|
|
3791
|
+
if (regExp[i].test(attributeName)) {
|
|
3729
3792
|
return true;
|
|
3730
3793
|
}
|
|
3731
3794
|
}
|
|
@@ -3777,23 +3840,22 @@
|
|
|
3777
3840
|
|
|
3778
3841
|
const domParser = new window.DOMParser();
|
|
3779
3842
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
3780
|
-
const allowlistKeys = Object.keys(allowList);
|
|
3781
3843
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
3782
3844
|
|
|
3783
3845
|
for (let i = 0, len = elements.length; i < len; i++) {
|
|
3784
|
-
const
|
|
3785
|
-
const
|
|
3846
|
+
const element = elements[i];
|
|
3847
|
+
const elementName = element.nodeName.toLowerCase();
|
|
3786
3848
|
|
|
3787
|
-
if (!
|
|
3788
|
-
|
|
3849
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
3850
|
+
element.remove();
|
|
3789
3851
|
continue;
|
|
3790
3852
|
}
|
|
3791
3853
|
|
|
3792
|
-
const attributeList = [].concat(...
|
|
3793
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
|
3794
|
-
attributeList.forEach(
|
|
3795
|
-
if (!allowedAttribute(
|
|
3796
|
-
|
|
3854
|
+
const attributeList = [].concat(...element.attributes);
|
|
3855
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
|
3856
|
+
attributeList.forEach(attribute => {
|
|
3857
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
3858
|
+
element.removeAttribute(attribute.nodeName);
|
|
3797
3859
|
}
|
|
3798
3860
|
});
|
|
3799
3861
|
}
|
|
@@ -3803,7 +3865,7 @@
|
|
|
3803
3865
|
|
|
3804
3866
|
/**
|
|
3805
3867
|
* --------------------------------------------------------------------------
|
|
3806
|
-
* CoreUI (v4.0
|
|
3868
|
+
* CoreUI (v4.1.0): tooltip.js
|
|
3807
3869
|
* Licensed under MIT (https://coreui.io/license)
|
|
3808
3870
|
*
|
|
3809
3871
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
@@ -3820,7 +3882,6 @@
|
|
|
3820
3882
|
const DATA_KEY$5 = 'coreui.tooltip';
|
|
3821
3883
|
const EVENT_KEY$5 = `.${DATA_KEY$5}`;
|
|
3822
3884
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
|
3823
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
|
3824
3885
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
3825
3886
|
const DefaultType$4 = {
|
|
3826
3887
|
animation: 'boolean',
|
|
@@ -3879,12 +3940,14 @@
|
|
|
3879
3940
|
MOUSEENTER: `mouseenter${EVENT_KEY$5}`,
|
|
3880
3941
|
MOUSELEAVE: `mouseleave${EVENT_KEY$5}`
|
|
3881
3942
|
};
|
|
3882
|
-
const CLASS_NAME_FADE$
|
|
3943
|
+
const CLASS_NAME_FADE$3 = 'fade';
|
|
3883
3944
|
const CLASS_NAME_MODAL = 'modal';
|
|
3884
|
-
const CLASS_NAME_SHOW$
|
|
3945
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
|
3885
3946
|
const HOVER_STATE_SHOW = 'show';
|
|
3886
3947
|
const HOVER_STATE_OUT = 'out';
|
|
3887
3948
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
3949
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
3950
|
+
const EVENT_MODAL_HIDE = 'hide.coreui.modal';
|
|
3888
3951
|
const TRIGGER_HOVER = 'hover';
|
|
3889
3952
|
const TRIGGER_FOCUS = 'focus';
|
|
3890
3953
|
const TRIGGER_CLICK = 'click';
|
|
@@ -3961,7 +4024,7 @@
|
|
|
3961
4024
|
context._leave(null, context);
|
|
3962
4025
|
}
|
|
3963
4026
|
} else {
|
|
3964
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
4027
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
|
|
3965
4028
|
this._leave(null, this);
|
|
3966
4029
|
|
|
3967
4030
|
return;
|
|
@@ -3973,15 +4036,13 @@
|
|
|
3973
4036
|
|
|
3974
4037
|
dispose() {
|
|
3975
4038
|
clearTimeout(this._timeout);
|
|
3976
|
-
EventHandler.off(this._element.closest(
|
|
4039
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
3977
4040
|
|
|
3978
4041
|
if (this.tip) {
|
|
3979
4042
|
this.tip.remove();
|
|
3980
4043
|
}
|
|
3981
4044
|
|
|
3982
|
-
|
|
3983
|
-
this._popper.destroy();
|
|
3984
|
-
}
|
|
4045
|
+
this._disposePopper();
|
|
3985
4046
|
|
|
3986
4047
|
super.dispose();
|
|
3987
4048
|
}
|
|
@@ -4001,6 +4062,15 @@
|
|
|
4001
4062
|
|
|
4002
4063
|
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
4003
4064
|
return;
|
|
4065
|
+
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-coreui-original-title`
|
|
4066
|
+
// This will be removed later in favor of a `setContent` method
|
|
4067
|
+
|
|
4068
|
+
|
|
4069
|
+
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
|
4070
|
+
this._disposePopper();
|
|
4071
|
+
|
|
4072
|
+
this.tip.remove();
|
|
4073
|
+
this.tip = null;
|
|
4004
4074
|
}
|
|
4005
4075
|
|
|
4006
4076
|
const tip = this.getTipElement();
|
|
@@ -4009,10 +4079,8 @@
|
|
|
4009
4079
|
|
|
4010
4080
|
this._element.setAttribute('aria-describedby', tipId);
|
|
4011
4081
|
|
|
4012
|
-
this.setContent();
|
|
4013
|
-
|
|
4014
4082
|
if (this._config.animation) {
|
|
4015
|
-
tip.classList.add(CLASS_NAME_FADE$
|
|
4083
|
+
tip.classList.add(CLASS_NAME_FADE$3);
|
|
4016
4084
|
}
|
|
4017
4085
|
|
|
4018
4086
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
|
@@ -4027,7 +4095,7 @@
|
|
|
4027
4095
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
|
4028
4096
|
|
|
4029
4097
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
4030
|
-
container.
|
|
4098
|
+
container.append(tip);
|
|
4031
4099
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
|
4032
4100
|
}
|
|
4033
4101
|
|
|
@@ -4037,8 +4105,9 @@
|
|
|
4037
4105
|
this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
4038
4106
|
}
|
|
4039
4107
|
|
|
4040
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
|
4041
|
-
|
|
4108
|
+
tip.classList.add(CLASS_NAME_SHOW$3);
|
|
4109
|
+
|
|
4110
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
|
4042
4111
|
|
|
4043
4112
|
if (customClass) {
|
|
4044
4113
|
tip.classList.add(...customClass.split(' '));
|
|
@@ -4064,7 +4133,7 @@
|
|
|
4064
4133
|
}
|
|
4065
4134
|
};
|
|
4066
4135
|
|
|
4067
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
4136
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
|
|
4068
4137
|
|
|
4069
4138
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
4070
4139
|
}
|
|
@@ -4091,11 +4160,7 @@
|
|
|
4091
4160
|
|
|
4092
4161
|
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
|
4093
4162
|
|
|
4094
|
-
|
|
4095
|
-
this._popper.destroy();
|
|
4096
|
-
|
|
4097
|
-
this._popper = null;
|
|
4098
|
-
}
|
|
4163
|
+
this._disposePopper();
|
|
4099
4164
|
};
|
|
4100
4165
|
|
|
4101
4166
|
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
|
@@ -4104,7 +4169,7 @@
|
|
|
4104
4169
|
return;
|
|
4105
4170
|
}
|
|
4106
4171
|
|
|
4107
|
-
tip.classList.remove(CLASS_NAME_SHOW$
|
|
4172
|
+
tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
|
|
4108
4173
|
// empty mouseover listeners we added for iOS support
|
|
4109
4174
|
|
|
4110
4175
|
if ('ontouchstart' in document.documentElement) {
|
|
@@ -4114,7 +4179,7 @@
|
|
|
4114
4179
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
4115
4180
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
4116
4181
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
4117
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
4182
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
|
|
4118
4183
|
|
|
4119
4184
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
4120
4185
|
|
|
@@ -4139,14 +4204,27 @@
|
|
|
4139
4204
|
|
|
4140
4205
|
const element = document.createElement('div');
|
|
4141
4206
|
element.innerHTML = this._config.template;
|
|
4142
|
-
|
|
4207
|
+
const tip = element.children[0];
|
|
4208
|
+
this.setContent(tip);
|
|
4209
|
+
tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
|
|
4210
|
+
this.tip = tip;
|
|
4143
4211
|
return this.tip;
|
|
4144
4212
|
}
|
|
4145
4213
|
|
|
4146
|
-
setContent() {
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4214
|
+
setContent(tip) {
|
|
4215
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
_sanitizeAndSetContent(template, content, selector) {
|
|
4219
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
|
4220
|
+
|
|
4221
|
+
if (!content && templateElement) {
|
|
4222
|
+
templateElement.remove();
|
|
4223
|
+
return;
|
|
4224
|
+
} // we use append for html objects to maintain js events
|
|
4225
|
+
|
|
4226
|
+
|
|
4227
|
+
this.setElementContent(templateElement, content);
|
|
4150
4228
|
}
|
|
4151
4229
|
|
|
4152
4230
|
setElementContent(element, content) {
|
|
@@ -4160,7 +4238,7 @@
|
|
|
4160
4238
|
if (this._config.html) {
|
|
4161
4239
|
if (content.parentNode !== element) {
|
|
4162
4240
|
element.innerHTML = '';
|
|
4163
|
-
element.
|
|
4241
|
+
element.append(content);
|
|
4164
4242
|
}
|
|
4165
4243
|
} else {
|
|
4166
4244
|
element.textContent = content.textContent;
|
|
@@ -4181,13 +4259,9 @@
|
|
|
4181
4259
|
}
|
|
4182
4260
|
|
|
4183
4261
|
getTitle() {
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
if (!title) {
|
|
4187
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
|
4188
|
-
}
|
|
4262
|
+
const title = this._element.getAttribute('data-coreui-original-title') || this._config.title;
|
|
4189
4263
|
|
|
4190
|
-
return title;
|
|
4264
|
+
return this._resolvePossibleFunction(title);
|
|
4191
4265
|
}
|
|
4192
4266
|
|
|
4193
4267
|
updateAttachment(attachment) {
|
|
@@ -4204,15 +4278,7 @@
|
|
|
4204
4278
|
|
|
4205
4279
|
|
|
4206
4280
|
_initializeOnDelegatedTarget(event, context) {
|
|
4207
|
-
|
|
4208
|
-
context = context || Data.get(event.delegateTarget, dataKey);
|
|
4209
|
-
|
|
4210
|
-
if (!context) {
|
|
4211
|
-
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
|
4212
|
-
Data.set(event.delegateTarget, dataKey, context);
|
|
4213
|
-
}
|
|
4214
|
-
|
|
4215
|
-
return context;
|
|
4281
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
|
4216
4282
|
}
|
|
4217
4283
|
|
|
4218
4284
|
_getOffset() {
|
|
@@ -4231,6 +4297,10 @@
|
|
|
4231
4297
|
return offset;
|
|
4232
4298
|
}
|
|
4233
4299
|
|
|
4300
|
+
_resolvePossibleFunction(content) {
|
|
4301
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
|
4302
|
+
}
|
|
4303
|
+
|
|
4234
4304
|
_getPopperConfig(attachment) {
|
|
4235
4305
|
const defaultBsPopperConfig = {
|
|
4236
4306
|
placement: attachment,
|
|
@@ -4272,7 +4342,7 @@
|
|
|
4272
4342
|
}
|
|
4273
4343
|
|
|
4274
4344
|
_addAttachmentClass(attachment) {
|
|
4275
|
-
this.getTipElement().classList.add(`${
|
|
4345
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
|
4276
4346
|
}
|
|
4277
4347
|
|
|
4278
4348
|
_getAttachment(placement) {
|
|
@@ -4299,7 +4369,7 @@
|
|
|
4299
4369
|
}
|
|
4300
4370
|
};
|
|
4301
4371
|
|
|
4302
|
-
EventHandler.on(this._element.closest(
|
|
4372
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
4303
4373
|
|
|
4304
4374
|
if (this._config.selector) {
|
|
4305
4375
|
this._config = { ...this._config,
|
|
@@ -4334,7 +4404,7 @@
|
|
|
4334
4404
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
4335
4405
|
}
|
|
4336
4406
|
|
|
4337
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
4407
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
|
|
4338
4408
|
context._hoverState = HOVER_STATE_SHOW;
|
|
4339
4409
|
return;
|
|
4340
4410
|
}
|
|
@@ -4430,26 +4500,32 @@
|
|
|
4430
4500
|
_getDelegateConfig() {
|
|
4431
4501
|
const config = {};
|
|
4432
4502
|
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
config[key] = this._config[key];
|
|
4437
|
-
}
|
|
4503
|
+
for (const key in this._config) {
|
|
4504
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
|
4505
|
+
config[key] = this._config[key];
|
|
4438
4506
|
}
|
|
4439
|
-
}
|
|
4507
|
+
} // In the future can be replaced with:
|
|
4508
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
|
4509
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
|
4510
|
+
|
|
4440
4511
|
|
|
4441
4512
|
return config;
|
|
4442
4513
|
}
|
|
4443
4514
|
|
|
4444
4515
|
_cleanTipClass() {
|
|
4445
4516
|
const tip = this.getTipElement();
|
|
4446
|
-
const
|
|
4517
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
|
4518
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
|
4447
4519
|
|
|
4448
4520
|
if (tabClass !== null && tabClass.length > 0) {
|
|
4449
4521
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
4450
4522
|
}
|
|
4451
4523
|
}
|
|
4452
4524
|
|
|
4525
|
+
_getBasicClassPrefix() {
|
|
4526
|
+
return CLASS_PREFIX$1;
|
|
4527
|
+
}
|
|
4528
|
+
|
|
4453
4529
|
_handlePopperPlacementChange(popperData) {
|
|
4454
4530
|
const {
|
|
4455
4531
|
state
|
|
@@ -4464,6 +4540,14 @@
|
|
|
4464
4540
|
this._cleanTipClass();
|
|
4465
4541
|
|
|
4466
4542
|
this._addAttachmentClass(this._getAttachment(state.placement));
|
|
4543
|
+
}
|
|
4544
|
+
|
|
4545
|
+
_disposePopper() {
|
|
4546
|
+
if (this._popper) {
|
|
4547
|
+
this._popper.destroy();
|
|
4548
|
+
|
|
4549
|
+
this._popper = null;
|
|
4550
|
+
}
|
|
4467
4551
|
} // Static
|
|
4468
4552
|
|
|
4469
4553
|
|
|
@@ -4494,7 +4578,7 @@
|
|
|
4494
4578
|
|
|
4495
4579
|
/**
|
|
4496
4580
|
* --------------------------------------------------------------------------
|
|
4497
|
-
* CoreUI (v4.0
|
|
4581
|
+
* CoreUI (v4.1.0): popover.js
|
|
4498
4582
|
* Licensed under MIT (https://coreui.io/license)
|
|
4499
4583
|
*
|
|
4500
4584
|
* This component is a modified version of the Bootstrap's popover.js
|
|
@@ -4511,7 +4595,6 @@
|
|
|
4511
4595
|
const DATA_KEY$4 = 'coreui.popover';
|
|
4512
4596
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
|
4513
4597
|
const CLASS_PREFIX = 'bs-popover';
|
|
4514
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
|
4515
4598
|
const Default$3 = { ...Tooltip.Default,
|
|
4516
4599
|
placement: 'right',
|
|
4517
4600
|
offset: [0, 8],
|
|
@@ -4534,8 +4617,6 @@
|
|
|
4534
4617
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
|
4535
4618
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
|
4536
4619
|
};
|
|
4537
|
-
const CLASS_NAME_FADE$3 = 'fade';
|
|
4538
|
-
const CLASS_NAME_SHOW$3 = 'show';
|
|
4539
4620
|
const SELECTOR_TITLE = '.popover-header';
|
|
4540
4621
|
const SELECTOR_CONTENT = '.popover-body';
|
|
4541
4622
|
/**
|
|
@@ -4567,55 +4648,19 @@
|
|
|
4567
4648
|
return this.getTitle() || this._getContent();
|
|
4568
4649
|
}
|
|
4569
4650
|
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
return this.tip;
|
|
4573
|
-
}
|
|
4574
|
-
|
|
4575
|
-
this.tip = super.getTipElement();
|
|
4576
|
-
|
|
4577
|
-
if (!this.getTitle()) {
|
|
4578
|
-
SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove();
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
|
-
if (!this._getContent()) {
|
|
4582
|
-
SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove();
|
|
4583
|
-
}
|
|
4584
|
-
|
|
4585
|
-
return this.tip;
|
|
4586
|
-
}
|
|
4587
|
-
|
|
4588
|
-
setContent() {
|
|
4589
|
-
const tip = this.getTipElement(); // we use append for html objects to maintain js events
|
|
4590
|
-
|
|
4591
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
|
|
4592
|
-
|
|
4593
|
-
let content = this._getContent();
|
|
4651
|
+
setContent(tip) {
|
|
4652
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
|
4594
4653
|
|
|
4595
|
-
|
|
4596
|
-
content = content.call(this._element);
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
|
4600
|
-
tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
|
|
4654
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
|
4601
4655
|
} // Private
|
|
4602
4656
|
|
|
4603
4657
|
|
|
4604
|
-
_addAttachmentClass(attachment) {
|
|
4605
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
|
4606
|
-
}
|
|
4607
|
-
|
|
4608
4658
|
_getContent() {
|
|
4609
|
-
return this.
|
|
4659
|
+
return this._resolvePossibleFunction(this._config.content);
|
|
4610
4660
|
}
|
|
4611
4661
|
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
|
|
4615
|
-
|
|
4616
|
-
if (tabClass !== null && tabClass.length > 0) {
|
|
4617
|
-
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
4618
|
-
}
|
|
4662
|
+
_getBasicClassPrefix() {
|
|
4663
|
+
return CLASS_PREFIX;
|
|
4619
4664
|
} // Static
|
|
4620
4665
|
|
|
4621
4666
|
|
|
@@ -4646,7 +4691,7 @@
|
|
|
4646
4691
|
|
|
4647
4692
|
/**
|
|
4648
4693
|
* --------------------------------------------------------------------------
|
|
4649
|
-
* CoreUI (v4.0
|
|
4694
|
+
* CoreUI (v4.1.0): scrollspy.js
|
|
4650
4695
|
* Licensed under MIT (https://coreui.io/license)
|
|
4651
4696
|
*
|
|
4652
4697
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
@@ -4884,7 +4929,7 @@
|
|
|
4884
4929
|
|
|
4885
4930
|
/**
|
|
4886
4931
|
* --------------------------------------------------------------------------
|
|
4887
|
-
* CoreUI (v4.0
|
|
4932
|
+
* CoreUI (v4.1.0): sidebar.js
|
|
4888
4933
|
* Licensed under MIT (https://coreui.io/license)
|
|
4889
4934
|
* --------------------------------------------------------------------------
|
|
4890
4935
|
*/
|
|
@@ -5104,7 +5149,7 @@
|
|
|
5104
5149
|
|
|
5105
5150
|
_removeBackdrop() {
|
|
5106
5151
|
if (this._backdrop) {
|
|
5107
|
-
this._backdrop.
|
|
5152
|
+
this._backdrop.remove();
|
|
5108
5153
|
|
|
5109
5154
|
this._backdrop = null;
|
|
5110
5155
|
}
|
|
@@ -5117,7 +5162,7 @@
|
|
|
5117
5162
|
|
|
5118
5163
|
this._backdrop.classList.add(CLASS_NAME_FADE$2);
|
|
5119
5164
|
|
|
5120
|
-
document.body.
|
|
5165
|
+
document.body.append(this._backdrop);
|
|
5121
5166
|
reflow(this._backdrop);
|
|
5122
5167
|
|
|
5123
5168
|
this._backdrop.classList.add(CLASS_NAME_SHOW$2);
|
|
@@ -5213,11 +5258,11 @@
|
|
|
5213
5258
|
* ------------------------------------------------------------------------
|
|
5214
5259
|
*/
|
|
5215
5260
|
|
|
5216
|
-
defineJQueryPlugin(
|
|
5261
|
+
defineJQueryPlugin(Sidebar);
|
|
5217
5262
|
|
|
5218
5263
|
/**
|
|
5219
5264
|
* --------------------------------------------------------------------------
|
|
5220
|
-
* CoreUI (v4.0
|
|
5265
|
+
* CoreUI (v4.1.0): tab.js
|
|
5221
5266
|
* Licensed under MIT (https://coreui.io/license)
|
|
5222
5267
|
*
|
|
5223
5268
|
* This component is a modified version of the Bootstrap's tab.js
|
|
@@ -5418,7 +5463,7 @@
|
|
|
5418
5463
|
|
|
5419
5464
|
/**
|
|
5420
5465
|
* --------------------------------------------------------------------------
|
|
5421
|
-
* CoreUI (v4.0
|
|
5466
|
+
* CoreUI (v4.1.0): toast.js
|
|
5422
5467
|
* Licensed under MIT (https://coreui.io/license)
|
|
5423
5468
|
*
|
|
5424
5469
|
* This component is a modified version of the Bootstrap's toast.js
|
|
@@ -5434,7 +5479,6 @@
|
|
|
5434
5479
|
const NAME = 'toast';
|
|
5435
5480
|
const DATA_KEY = 'coreui.toast';
|
|
5436
5481
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
5437
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
|
5438
5482
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
|
5439
5483
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
|
5440
5484
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
|
@@ -5444,7 +5488,8 @@
|
|
|
5444
5488
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
5445
5489
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
5446
5490
|
const CLASS_NAME_FADE = 'fade';
|
|
5447
|
-
const CLASS_NAME_HIDE = 'hide';
|
|
5491
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
|
5492
|
+
|
|
5448
5493
|
const CLASS_NAME_SHOW = 'show';
|
|
5449
5494
|
const CLASS_NAME_SHOWING = 'showing';
|
|
5450
5495
|
const DefaultType = {
|
|
@@ -5457,7 +5502,6 @@
|
|
|
5457
5502
|
autohide: true,
|
|
5458
5503
|
delay: 5000
|
|
5459
5504
|
};
|
|
5460
|
-
const SELECTOR_DATA_DISMISS = '[data-coreui-dismiss="toast"]';
|
|
5461
5505
|
/**
|
|
5462
5506
|
* ------------------------------------------------------------------------
|
|
5463
5507
|
* Class Definition
|
|
@@ -5505,17 +5549,18 @@
|
|
|
5505
5549
|
const complete = () => {
|
|
5506
5550
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
5507
5551
|
|
|
5508
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
5509
|
-
|
|
5510
5552
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
|
5511
5553
|
|
|
5512
5554
|
this._maybeScheduleHide();
|
|
5513
5555
|
};
|
|
5514
5556
|
|
|
5515
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
|
5557
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
|
5558
|
+
|
|
5516
5559
|
|
|
5517
5560
|
reflow(this._element);
|
|
5518
5561
|
|
|
5562
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
5563
|
+
|
|
5519
5564
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
5520
5565
|
|
|
5521
5566
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
@@ -5533,12 +5578,17 @@
|
|
|
5533
5578
|
}
|
|
5534
5579
|
|
|
5535
5580
|
const complete = () => {
|
|
5536
|
-
this._element.classList.add(CLASS_NAME_HIDE);
|
|
5581
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
|
5582
|
+
|
|
5583
|
+
|
|
5584
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
5585
|
+
|
|
5586
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
5537
5587
|
|
|
5538
5588
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
|
5539
5589
|
};
|
|
5540
5590
|
|
|
5541
|
-
this._element.classList.
|
|
5591
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
5542
5592
|
|
|
5543
5593
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
5544
5594
|
}
|
|
@@ -5606,7 +5656,6 @@
|
|
|
5606
5656
|
}
|
|
5607
5657
|
|
|
5608
5658
|
_setListeners() {
|
|
5609
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
|
5610
5659
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
|
5611
5660
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
|
5612
5661
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
|
@@ -5634,6 +5683,8 @@
|
|
|
5634
5683
|
}
|
|
5635
5684
|
|
|
5636
5685
|
}
|
|
5686
|
+
|
|
5687
|
+
enableDismissTrigger(Toast);
|
|
5637
5688
|
/**
|
|
5638
5689
|
* ------------------------------------------------------------------------
|
|
5639
5690
|
* jQuery
|
|
@@ -5641,16 +5692,15 @@
|
|
|
5641
5692
|
* add .Toast to jQuery only if jQuery is present
|
|
5642
5693
|
*/
|
|
5643
5694
|
|
|
5644
|
-
|
|
5645
5695
|
defineJQueryPlugin(Toast);
|
|
5646
5696
|
|
|
5647
5697
|
/**
|
|
5648
5698
|
* --------------------------------------------------------------------------
|
|
5649
|
-
* CoreUI (v4.0
|
|
5699
|
+
* CoreUI (v4.1.0): index.esm.js
|
|
5650
5700
|
* Licensed under MIT (https://coreui.io/license)
|
|
5651
5701
|
* --------------------------------------------------------------------------
|
|
5652
5702
|
*/
|
|
5653
|
-
|
|
5703
|
+
const index_umd = {
|
|
5654
5704
|
Alert,
|
|
5655
5705
|
Button,
|
|
5656
5706
|
Carousel,
|
|
@@ -5669,5 +5719,5 @@
|
|
|
5669
5719
|
|
|
5670
5720
|
return index_umd;
|
|
5671
5721
|
|
|
5672
|
-
}))
|
|
5722
|
+
}));
|
|
5673
5723
|
//# sourceMappingURL=coreui.js.map
|