@coreui/coreui 4.0.4 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -8
- package/dist/css/coreui-grid.css +254 -205
- package/dist/css/coreui-grid.css.map +1 -1
- package/dist/css/coreui-grid.min.css +2 -2
- package/dist/css/coreui-grid.min.css.map +1 -1
- package/dist/css/coreui-grid.rtl.css +411 -362
- 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 +380 -280
- 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 +712 -345
- 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 +893 -541
- 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 +855 -746
- package/dist/js/coreui.bundle.js.map +1 -1
- package/dist/js/coreui.bundle.min.js +3 -3
- package/dist/js/coreui.bundle.min.js.map +1 -1
- package/dist/js/coreui.esm.js +708 -644
- package/dist/js/coreui.esm.js.map +1 -1
- package/dist/js/coreui.esm.min.js +3 -3
- package/dist/js/coreui.esm.min.js.map +1 -1
- package/dist/js/coreui.js +718 -656
- package/dist/js/coreui.js.map +1 -1
- package/dist/js/coreui.min.js +3 -3
- package/dist/js/coreui.min.js.map +1 -1
- package/js/dist/alert.js +82 -49
- package/js/dist/alert.js.map +1 -1
- package/js/dist/base-component.js +26 -18
- package/js/dist/base-component.js.map +1 -1
- package/js/dist/button.js +23 -13
- package/js/dist/button.js.map +1 -1
- package/js/dist/carousel.js +95 -50
- package/js/dist/carousel.js.map +1 -1
- package/js/dist/collapse.js +125 -139
- package/js/dist/collapse.js.map +1 -1
- package/js/dist/dom/data.js +6 -6
- package/js/dist/dom/data.js.map +1 -1
- package/js/dist/dom/event-handler.js +15 -6
- package/js/dist/dom/event-handler.js.map +1 -1
- package/js/dist/dom/manipulator.js +7 -7
- package/js/dist/dom/manipulator.js.map +1 -1
- package/js/dist/dom/selector-engine.js +74 -9
- package/js/dist/dom/selector-engine.js.map +1 -1
- package/js/dist/dropdown.js +125 -112
- package/js/dist/dropdown.js.map +1 -1
- package/js/dist/modal.js +270 -93
- package/js/dist/modal.js.map +1 -1
- package/js/dist/offcanvas.js +231 -62
- package/js/dist/offcanvas.js.map +1 -1
- package/js/dist/popover.js +29 -59
- package/js/dist/popover.js.map +1 -1
- package/js/dist/scrollspy.js +45 -35
- package/js/dist/scrollspy.js.map +1 -1
- package/js/dist/tab.js +45 -23
- package/js/dist/tab.js.map +1 -1
- package/js/dist/toast.js +132 -34
- package/js/dist/toast.js.map +1 -1
- package/js/dist/tooltip.js +127 -109
- 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 +10 -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 +23 -27
- 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 +39 -11
- package/js/src/util/sanitizer.js +21 -22
- package/js/src/util/scrollbar.js +1 -1
- package/package.json +54 -55
- 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 +2 -12
- package/scss/_nav.scss +1 -2
- 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 +188 -13
- package/scss/coreui-grid.rtl.scss +1 -1
- package/scss/coreui-grid.scss +3 -1
- package/scss/coreui-reboot.rtl.scss +1 -1
- package/scss/coreui-reboot.scss +2 -4
- package/scss/coreui-utilities.rtl.scss +1 -1
- package/scss/coreui-utilities.scss +1 -1
- package/scss/coreui.rtl.scss +1 -1
- package/scss/coreui.scss +2 -1
- package/scss/forms/_form-control.scss +1 -1
- package/scss/forms/_form-select.scss +2 -0
- package/scss/helpers/_stacks.scss +15 -0
- package/scss/helpers/_vr.scss +8 -0
- package/scss/mixins/_backdrop.scss +14 -0
- package/scss/mixins/_grid.scss +26 -7
- package/scss/mixins/_ltr-rtl.scss +21 -0
- package/scss/mixins/_reset-text.scss +1 -1
- package/scss/mixins/_utilities.scss +27 -39
- package/scss/mixins/_visually-hidden.scss +1 -1
- package/scss/sidebar/_sidebar-nav.scss +1 -0
- package/scss/sidebar/_sidebar.scss +17 -17
package/dist/js/coreui.js
CHANGED
|
@@ -1,130 +1,53 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* CoreUI v4.
|
|
3
|
-
* Copyright
|
|
2
|
+
* CoreUI v4.1.1 (https://coreui.io)
|
|
3
|
+
* Copyright 2022 The CoreUI Team (https://github.com/orgs/coreui/people)
|
|
4
4
|
* Licensed under MIT (https://coreui.io)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
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, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
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
|
-
|
|
30
|
+
const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
|
33
31
|
|
|
34
32
|
/**
|
|
35
33
|
* --------------------------------------------------------------------------
|
|
36
|
-
* CoreUI (v4.
|
|
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
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* --------------------------------------------------------------------------
|
|
110
|
-
* CoreUI (v4.0.4): alert.js
|
|
34
|
+
* CoreUI (v4.1.1): 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)
|
|
121
44
|
|
|
122
|
-
const toType =
|
|
123
|
-
if (
|
|
124
|
-
return `${
|
|
45
|
+
const toType = object => {
|
|
46
|
+
if (object === null || object === undefined) {
|
|
47
|
+
return `${object}`;
|
|
125
48
|
}
|
|
126
49
|
|
|
127
|
-
return
|
|
50
|
+
return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
|
|
128
51
|
};
|
|
129
52
|
/**
|
|
130
53
|
* --------------------------------------------------------------------------
|
|
@@ -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;
|
|
@@ -249,7 +172,27 @@
|
|
|
249
172
|
return false;
|
|
250
173
|
}
|
|
251
174
|
|
|
252
|
-
|
|
175
|
+
const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; // Handle `details` element as its content may falsie appear visible when it is closed
|
|
176
|
+
|
|
177
|
+
const closedDetails = element.closest('details:not([open])');
|
|
178
|
+
|
|
179
|
+
if (!closedDetails) {
|
|
180
|
+
return elementIsVisible;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (closedDetails !== element) {
|
|
184
|
+
const summary = element.closest('summary');
|
|
185
|
+
|
|
186
|
+
if (summary && summary.parentNode !== closedDetails) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (summary === null) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return elementIsVisible;
|
|
253
196
|
};
|
|
254
197
|
|
|
255
198
|
const isDisabled = element => {
|
|
@@ -292,8 +235,20 @@
|
|
|
292
235
|
};
|
|
293
236
|
|
|
294
237
|
const noop = () => {};
|
|
238
|
+
/**
|
|
239
|
+
* Trick to restart an element's animation
|
|
240
|
+
*
|
|
241
|
+
* @param {HTMLElement} element
|
|
242
|
+
* @return void
|
|
243
|
+
*
|
|
244
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
|
245
|
+
*/
|
|
246
|
+
|
|
295
247
|
|
|
296
|
-
const reflow = element =>
|
|
248
|
+
const reflow = element => {
|
|
249
|
+
// eslint-disable-next-line no-unused-expressions
|
|
250
|
+
element.offsetHeight;
|
|
251
|
+
};
|
|
297
252
|
|
|
298
253
|
const getjQuery = () => {
|
|
299
254
|
const {
|
|
@@ -410,7 +365,7 @@
|
|
|
410
365
|
|
|
411
366
|
/**
|
|
412
367
|
* --------------------------------------------------------------------------
|
|
413
|
-
* CoreUI (v4.
|
|
368
|
+
* CoreUI (v4.1.1): dom/event-handler.js
|
|
414
369
|
* Licensed under MIT (https://coreui.io/license)
|
|
415
370
|
*
|
|
416
371
|
* This component is a modified version of the Bootstrap's dom/event-handler.js
|
|
@@ -476,7 +431,6 @@
|
|
|
476
431
|
event.delegateTarget = target;
|
|
477
432
|
|
|
478
433
|
if (handler.oneOff) {
|
|
479
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
480
434
|
EventHandler.off(element, event.type, selector, fn);
|
|
481
435
|
}
|
|
482
436
|
|
|
@@ -702,7 +656,7 @@
|
|
|
702
656
|
|
|
703
657
|
/**
|
|
704
658
|
* --------------------------------------------------------------------------
|
|
705
|
-
* CoreUI (v4.
|
|
659
|
+
* CoreUI (v4.1.1): dom/data.js
|
|
706
660
|
* Licensed under MIT (https://coreui.io/license)
|
|
707
661
|
*
|
|
708
662
|
* This component is a modified version of the Bootstrap's dom/data.js
|
|
@@ -716,7 +670,7 @@
|
|
|
716
670
|
* ------------------------------------------------------------------------
|
|
717
671
|
*/
|
|
718
672
|
const elementMap = new Map();
|
|
719
|
-
|
|
673
|
+
const Data = {
|
|
720
674
|
set(element, key, instance) {
|
|
721
675
|
if (!elementMap.has(element)) {
|
|
722
676
|
elementMap.set(element, new Map());
|
|
@@ -759,7 +713,7 @@
|
|
|
759
713
|
|
|
760
714
|
/**
|
|
761
715
|
* --------------------------------------------------------------------------
|
|
762
|
-
* CoreUI (v4.
|
|
716
|
+
* CoreUI (v4.1.1): alert.js
|
|
763
717
|
* Licensed under MIT (https://coreui.io/license)
|
|
764
718
|
*
|
|
765
719
|
* This component is a modified version of the Bootstrap's base-component.js
|
|
@@ -772,7 +726,7 @@
|
|
|
772
726
|
* ------------------------------------------------------------------------
|
|
773
727
|
*/
|
|
774
728
|
|
|
775
|
-
const VERSION = '4.
|
|
729
|
+
const VERSION = '4.1.1';
|
|
776
730
|
|
|
777
731
|
class BaseComponent {
|
|
778
732
|
constructor(element) {
|
|
@@ -801,7 +755,7 @@
|
|
|
801
755
|
|
|
802
756
|
|
|
803
757
|
static getInstance(element) {
|
|
804
|
-
return Data.get(element, this.DATA_KEY);
|
|
758
|
+
return Data.get(getElement(element), this.DATA_KEY);
|
|
805
759
|
}
|
|
806
760
|
|
|
807
761
|
static getOrCreateInstance(element, config = {}) {
|
|
@@ -828,7 +782,33 @@
|
|
|
828
782
|
|
|
829
783
|
/**
|
|
830
784
|
* --------------------------------------------------------------------------
|
|
831
|
-
*
|
|
785
|
+
* Bootstrap (v5.1.3): util/component-functions.js
|
|
786
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
787
|
+
* --------------------------------------------------------------------------
|
|
788
|
+
*/
|
|
789
|
+
|
|
790
|
+
const enableDismissTrigger = (component, method = 'hide') => {
|
|
791
|
+
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
792
|
+
const name = component.NAME;
|
|
793
|
+
EventHandler.on(document, clickEvent, `[data-coreui-dismiss="${name}"]`, function (event) {
|
|
794
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
795
|
+
event.preventDefault();
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
if (isDisabled(this)) {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
803
|
+
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
804
|
+
|
|
805
|
+
instance[method]();
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* --------------------------------------------------------------------------
|
|
811
|
+
* CoreUI (v4.1.1): alert.js
|
|
832
812
|
* Licensed under MIT (https://coreui.io/license)
|
|
833
813
|
*
|
|
834
814
|
* This component is a modified version of the Bootstrap's alert.js
|
|
@@ -841,17 +821,13 @@
|
|
|
841
821
|
* ------------------------------------------------------------------------
|
|
842
822
|
*/
|
|
843
823
|
|
|
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';
|
|
824
|
+
const NAME$f = 'alert';
|
|
825
|
+
const DATA_KEY$e = 'coreui.alert';
|
|
826
|
+
const EVENT_KEY$e = `.${DATA_KEY$e}`;
|
|
827
|
+
const EVENT_CLOSE = `close${EVENT_KEY$e}`;
|
|
828
|
+
const EVENT_CLOSED = `closed${EVENT_KEY$e}`;
|
|
829
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
|
830
|
+
const CLASS_NAME_SHOW$a = 'show';
|
|
855
831
|
/**
|
|
856
832
|
* ------------------------------------------------------------------------
|
|
857
833
|
* Class Definition
|
|
@@ -861,41 +837,30 @@
|
|
|
861
837
|
class Alert extends BaseComponent {
|
|
862
838
|
// Getters
|
|
863
839
|
static get NAME() {
|
|
864
|
-
return NAME$
|
|
840
|
+
return NAME$f;
|
|
865
841
|
} // Public
|
|
866
842
|
|
|
867
843
|
|
|
868
|
-
close(
|
|
869
|
-
const
|
|
844
|
+
close() {
|
|
845
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
870
846
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
if (customEvent === null || customEvent.defaultPrevented) {
|
|
847
|
+
if (closeEvent.defaultPrevented) {
|
|
874
848
|
return;
|
|
875
849
|
}
|
|
876
850
|
|
|
877
|
-
this.
|
|
878
|
-
} // Private
|
|
851
|
+
this._element.classList.remove(CLASS_NAME_SHOW$a);
|
|
879
852
|
|
|
853
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
|
|
880
854
|
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
_triggerCloseEvent(element) {
|
|
886
|
-
return EventHandler.trigger(element, EVENT_CLOSE);
|
|
887
|
-
}
|
|
855
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
856
|
+
} // Private
|
|
888
857
|
|
|
889
|
-
_removeElement(element) {
|
|
890
|
-
element.classList.remove(CLASS_NAME_SHOW$b);
|
|
891
|
-
const isAnimated = element.classList.contains(CLASS_NAME_FADE$7);
|
|
892
858
|
|
|
893
|
-
|
|
894
|
-
|
|
859
|
+
_destroyElement() {
|
|
860
|
+
this._element.remove();
|
|
895
861
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
EventHandler.trigger(element, EVENT_CLOSED);
|
|
862
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
863
|
+
this.dispose();
|
|
899
864
|
} // Static
|
|
900
865
|
|
|
901
866
|
|
|
@@ -903,20 +868,16 @@
|
|
|
903
868
|
return this.each(function () {
|
|
904
869
|
const data = Alert.getOrCreateInstance(this);
|
|
905
870
|
|
|
906
|
-
if (config
|
|
907
|
-
|
|
871
|
+
if (typeof config !== 'string') {
|
|
872
|
+
return;
|
|
908
873
|
}
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
874
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
if (event) {
|
|
915
|
-
event.preventDefault();
|
|
875
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
876
|
+
throw new TypeError(`No method named "${config}"`);
|
|
916
877
|
}
|
|
917
878
|
|
|
918
|
-
|
|
919
|
-
};
|
|
879
|
+
data[config](this);
|
|
880
|
+
});
|
|
920
881
|
}
|
|
921
882
|
|
|
922
883
|
}
|
|
@@ -927,7 +888,7 @@
|
|
|
927
888
|
*/
|
|
928
889
|
|
|
929
890
|
|
|
930
|
-
|
|
891
|
+
enableDismissTrigger(Alert, 'close');
|
|
931
892
|
/**
|
|
932
893
|
* ------------------------------------------------------------------------
|
|
933
894
|
* jQuery
|
|
@@ -939,7 +900,7 @@
|
|
|
939
900
|
|
|
940
901
|
/**
|
|
941
902
|
* --------------------------------------------------------------------------
|
|
942
|
-
* CoreUI (v4.
|
|
903
|
+
* CoreUI (v4.1.1): alert.js
|
|
943
904
|
* Licensed under MIT (https://coreui.io/license)
|
|
944
905
|
*
|
|
945
906
|
* This component is a modified version of the Bootstrap's button.js
|
|
@@ -952,13 +913,13 @@
|
|
|
952
913
|
* ------------------------------------------------------------------------
|
|
953
914
|
*/
|
|
954
915
|
|
|
955
|
-
const NAME$
|
|
956
|
-
const DATA_KEY$
|
|
957
|
-
const EVENT_KEY$
|
|
916
|
+
const NAME$e = 'button';
|
|
917
|
+
const DATA_KEY$d = 'coreui.button';
|
|
918
|
+
const EVENT_KEY$d = `.${DATA_KEY$d}`;
|
|
958
919
|
const DATA_API_KEY$9 = '.data-api';
|
|
959
920
|
const CLASS_NAME_ACTIVE$4 = 'active';
|
|
960
921
|
const SELECTOR_DATA_TOGGLE$6 = '[data-coreui-toggle="button"]';
|
|
961
|
-
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$
|
|
922
|
+
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$d}${DATA_API_KEY$9}`;
|
|
962
923
|
/**
|
|
963
924
|
* ------------------------------------------------------------------------
|
|
964
925
|
* Class Definition
|
|
@@ -968,7 +929,7 @@
|
|
|
968
929
|
class Button extends BaseComponent {
|
|
969
930
|
// Getters
|
|
970
931
|
static get NAME() {
|
|
971
|
-
return NAME$
|
|
932
|
+
return NAME$e;
|
|
972
933
|
} // Public
|
|
973
934
|
|
|
974
935
|
|
|
@@ -1013,7 +974,7 @@
|
|
|
1013
974
|
|
|
1014
975
|
/**
|
|
1015
976
|
* --------------------------------------------------------------------------
|
|
1016
|
-
* CoreUI (v4.
|
|
977
|
+
* CoreUI (v4.1.1): dom/manipulator.js
|
|
1017
978
|
* Licensed under MIT (https://coreui.io/license)
|
|
1018
979
|
*
|
|
1019
980
|
* This component is a modified version of the Bootstrap's dom/manipulator.js
|
|
@@ -1074,8 +1035,8 @@
|
|
|
1074
1035
|
offset(element) {
|
|
1075
1036
|
const rect = element.getBoundingClientRect();
|
|
1076
1037
|
return {
|
|
1077
|
-
top: rect.top +
|
|
1078
|
-
left: rect.left +
|
|
1038
|
+
top: rect.top + window.pageYOffset,
|
|
1039
|
+
left: rect.left + window.pageXOffset
|
|
1079
1040
|
};
|
|
1080
1041
|
},
|
|
1081
1042
|
|
|
@@ -1090,7 +1051,80 @@
|
|
|
1090
1051
|
|
|
1091
1052
|
/**
|
|
1092
1053
|
* --------------------------------------------------------------------------
|
|
1093
|
-
* CoreUI (v4.
|
|
1054
|
+
* CoreUI (v4.1.1): dom/selector-engine.js
|
|
1055
|
+
* Licensed under MIT (https://coreui.io/license)
|
|
1056
|
+
*
|
|
1057
|
+
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
1058
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1059
|
+
* --------------------------------------------------------------------------
|
|
1060
|
+
*/
|
|
1061
|
+
const NODE_TEXT = 3;
|
|
1062
|
+
const SelectorEngine = {
|
|
1063
|
+
find(selector, element = document.documentElement) {
|
|
1064
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
1065
|
+
},
|
|
1066
|
+
|
|
1067
|
+
findOne(selector, element = document.documentElement) {
|
|
1068
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
1069
|
+
},
|
|
1070
|
+
|
|
1071
|
+
children(element, selector) {
|
|
1072
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
1073
|
+
},
|
|
1074
|
+
|
|
1075
|
+
parents(element, selector) {
|
|
1076
|
+
const parents = [];
|
|
1077
|
+
let ancestor = element.parentNode;
|
|
1078
|
+
|
|
1079
|
+
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
1080
|
+
if (ancestor.matches(selector)) {
|
|
1081
|
+
parents.push(ancestor);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
ancestor = ancestor.parentNode;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
return parents;
|
|
1088
|
+
},
|
|
1089
|
+
|
|
1090
|
+
prev(element, selector) {
|
|
1091
|
+
let previous = element.previousElementSibling;
|
|
1092
|
+
|
|
1093
|
+
while (previous) {
|
|
1094
|
+
if (previous.matches(selector)) {
|
|
1095
|
+
return [previous];
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
previous = previous.previousElementSibling;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
return [];
|
|
1102
|
+
},
|
|
1103
|
+
|
|
1104
|
+
next(element, selector) {
|
|
1105
|
+
let next = element.nextElementSibling;
|
|
1106
|
+
|
|
1107
|
+
while (next) {
|
|
1108
|
+
if (next.matches(selector)) {
|
|
1109
|
+
return [next];
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
next = next.nextElementSibling;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
return [];
|
|
1116
|
+
},
|
|
1117
|
+
|
|
1118
|
+
focusableChildren(element) {
|
|
1119
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
|
1120
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
};
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* --------------------------------------------------------------------------
|
|
1127
|
+
* CoreUI (v4.1.1): carousel.js
|
|
1094
1128
|
* Licensed under MIT (https://coreui.io/license)
|
|
1095
1129
|
*
|
|
1096
1130
|
* This component is a modified version of the Bootstrap's carousel.js
|
|
@@ -1103,16 +1137,16 @@
|
|
|
1103
1137
|
* ------------------------------------------------------------------------
|
|
1104
1138
|
*/
|
|
1105
1139
|
|
|
1106
|
-
const NAME$
|
|
1107
|
-
const DATA_KEY$
|
|
1108
|
-
const EVENT_KEY$
|
|
1140
|
+
const NAME$d = 'carousel';
|
|
1141
|
+
const DATA_KEY$c = 'coreui.carousel';
|
|
1142
|
+
const EVENT_KEY$c = `.${DATA_KEY$c}`;
|
|
1109
1143
|
const DATA_API_KEY$8 = '.data-api';
|
|
1110
1144
|
const ARROW_LEFT_KEY = 'ArrowLeft';
|
|
1111
1145
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
|
1112
1146
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
|
1113
1147
|
|
|
1114
1148
|
const SWIPE_THRESHOLD = 40;
|
|
1115
|
-
const Default$
|
|
1149
|
+
const Default$c = {
|
|
1116
1150
|
interval: 5000,
|
|
1117
1151
|
keyboard: true,
|
|
1118
1152
|
slide: false,
|
|
@@ -1120,7 +1154,7 @@
|
|
|
1120
1154
|
wrap: true,
|
|
1121
1155
|
touch: true
|
|
1122
1156
|
};
|
|
1123
|
-
const DefaultType$
|
|
1157
|
+
const DefaultType$c = {
|
|
1124
1158
|
interval: '(number|boolean)',
|
|
1125
1159
|
keyboard: 'boolean',
|
|
1126
1160
|
slide: '(boolean|string)',
|
|
@@ -1136,19 +1170,19 @@
|
|
|
1136
1170
|
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
|
1137
1171
|
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
|
1138
1172
|
};
|
|
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$
|
|
1173
|
+
const EVENT_SLIDE = `slide${EVENT_KEY$c}`;
|
|
1174
|
+
const EVENT_SLID = `slid${EVENT_KEY$c}`;
|
|
1175
|
+
const EVENT_KEYDOWN = `keydown${EVENT_KEY$c}`;
|
|
1176
|
+
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$c}`;
|
|
1177
|
+
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$c}`;
|
|
1178
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$c}`;
|
|
1179
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$c}`;
|
|
1180
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY$c}`;
|
|
1181
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$c}`;
|
|
1182
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY$c}`;
|
|
1183
|
+
const EVENT_DRAG_START = `dragstart${EVENT_KEY$c}`;
|
|
1184
|
+
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1185
|
+
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1152
1186
|
const CLASS_NAME_CAROUSEL = 'carousel';
|
|
1153
1187
|
const CLASS_NAME_ACTIVE$3 = 'active';
|
|
1154
1188
|
const CLASS_NAME_SLIDE = 'slide';
|
|
@@ -1195,11 +1229,11 @@
|
|
|
1195
1229
|
|
|
1196
1230
|
|
|
1197
1231
|
static get Default() {
|
|
1198
|
-
return Default$
|
|
1232
|
+
return Default$c;
|
|
1199
1233
|
}
|
|
1200
1234
|
|
|
1201
1235
|
static get NAME() {
|
|
1202
|
-
return NAME$
|
|
1236
|
+
return NAME$d;
|
|
1203
1237
|
} // Public
|
|
1204
1238
|
|
|
1205
1239
|
|
|
@@ -1277,11 +1311,11 @@
|
|
|
1277
1311
|
|
|
1278
1312
|
|
|
1279
1313
|
_getConfig(config) {
|
|
1280
|
-
config = { ...Default$
|
|
1314
|
+
config = { ...Default$c,
|
|
1281
1315
|
...Manipulator.getDataAttributes(this._element),
|
|
1282
1316
|
...(typeof config === 'object' ? config : {})
|
|
1283
1317
|
};
|
|
1284
|
-
typeCheckConfig(NAME$
|
|
1318
|
+
typeCheckConfig(NAME$d, config, DefaultType$c);
|
|
1285
1319
|
return config;
|
|
1286
1320
|
}
|
|
1287
1321
|
|
|
@@ -1318,8 +1352,12 @@
|
|
|
1318
1352
|
}
|
|
1319
1353
|
|
|
1320
1354
|
_addTouchEventListeners() {
|
|
1355
|
+
const hasPointerPenTouch = event => {
|
|
1356
|
+
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1321
1359
|
const start = event => {
|
|
1322
|
-
if (
|
|
1360
|
+
if (hasPointerPenTouch(event)) {
|
|
1323
1361
|
this.touchStartX = event.clientX;
|
|
1324
1362
|
} else if (!this._pointerEvent) {
|
|
1325
1363
|
this.touchStartX = event.touches[0].clientX;
|
|
@@ -1332,7 +1370,7 @@
|
|
|
1332
1370
|
};
|
|
1333
1371
|
|
|
1334
1372
|
const end = event => {
|
|
1335
|
-
if (
|
|
1373
|
+
if (hasPointerPenTouch(event)) {
|
|
1336
1374
|
this.touchDeltaX = event.clientX - this.touchStartX;
|
|
1337
1375
|
}
|
|
1338
1376
|
|
|
@@ -1357,7 +1395,7 @@
|
|
|
1357
1395
|
};
|
|
1358
1396
|
|
|
1359
1397
|
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
|
1360
|
-
EventHandler.on(itemImg, EVENT_DRAG_START,
|
|
1398
|
+
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
|
1361
1399
|
});
|
|
1362
1400
|
|
|
1363
1401
|
if (this._pointerEvent) {
|
|
@@ -1414,7 +1452,7 @@
|
|
|
1414
1452
|
const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);
|
|
1415
1453
|
activeIndicator.classList.remove(CLASS_NAME_ACTIVE$3);
|
|
1416
1454
|
activeIndicator.removeAttribute('aria-current');
|
|
1417
|
-
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);
|
|
1455
|
+
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement); // eslint-disable-next-line unicorn/no-for-loop
|
|
1418
1456
|
|
|
1419
1457
|
for (let i = 0; i < indicators.length; i++) {
|
|
1420
1458
|
if (Number.parseInt(indicators[i].getAttribute('data-coreui-slide-to'), 10) === this._getItemIndex(element)) {
|
|
@@ -1638,7 +1676,7 @@
|
|
|
1638
1676
|
|
|
1639
1677
|
/**
|
|
1640
1678
|
* --------------------------------------------------------------------------
|
|
1641
|
-
* CoreUI (v4.
|
|
1679
|
+
* CoreUI (v4.1.1): collapse.js
|
|
1642
1680
|
* Licensed under MIT (https://coreui.io/license)
|
|
1643
1681
|
*
|
|
1644
1682
|
* This component is a modified version of the Bootstrap's collapse.js
|
|
@@ -1651,30 +1689,32 @@
|
|
|
1651
1689
|
* ------------------------------------------------------------------------
|
|
1652
1690
|
*/
|
|
1653
1691
|
|
|
1654
|
-
const NAME$
|
|
1655
|
-
const DATA_KEY$
|
|
1656
|
-
const EVENT_KEY$
|
|
1692
|
+
const NAME$c = 'collapse';
|
|
1693
|
+
const DATA_KEY$b = 'coreui.collapse';
|
|
1694
|
+
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
|
1657
1695
|
const DATA_API_KEY$7 = '.data-api';
|
|
1658
|
-
const Default$
|
|
1696
|
+
const Default$b = {
|
|
1659
1697
|
toggle: true,
|
|
1660
|
-
parent:
|
|
1698
|
+
parent: null
|
|
1661
1699
|
};
|
|
1662
|
-
const DefaultType$
|
|
1700
|
+
const DefaultType$b = {
|
|
1663
1701
|
toggle: 'boolean',
|
|
1664
|
-
parent: '(
|
|
1702
|
+
parent: '(null|element)'
|
|
1665
1703
|
};
|
|
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$
|
|
1704
|
+
const EVENT_SHOW$6 = `show${EVENT_KEY$b}`;
|
|
1705
|
+
const EVENT_SHOWN$6 = `shown${EVENT_KEY$b}`;
|
|
1706
|
+
const EVENT_HIDE$6 = `hide${EVENT_KEY$b}`;
|
|
1707
|
+
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$b}`;
|
|
1708
|
+
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
|
|
1709
|
+
const CLASS_NAME_SHOW$9 = 'show';
|
|
1672
1710
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
|
1673
1711
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
|
1674
1712
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
|
1713
|
+
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
|
1714
|
+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
|
1675
1715
|
const WIDTH = 'width';
|
|
1676
1716
|
const HEIGHT = 'height';
|
|
1677
|
-
const SELECTOR_ACTIVES = '.show, .collapsing';
|
|
1717
|
+
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
|
1678
1718
|
const SELECTOR_DATA_TOGGLE$5 = '[data-coreui-toggle="collapse"]';
|
|
1679
1719
|
/**
|
|
1680
1720
|
* ------------------------------------------------------------------------
|
|
@@ -1687,7 +1727,7 @@
|
|
|
1687
1727
|
super(element);
|
|
1688
1728
|
this._isTransitioning = false;
|
|
1689
1729
|
this._config = this._getConfig(config);
|
|
1690
|
-
this._triggerArray =
|
|
1730
|
+
this._triggerArray = [];
|
|
1691
1731
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$5);
|
|
1692
1732
|
|
|
1693
1733
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
|
@@ -1702,10 +1742,10 @@
|
|
|
1702
1742
|
}
|
|
1703
1743
|
}
|
|
1704
1744
|
|
|
1705
|
-
this.
|
|
1745
|
+
this._initializeChildren();
|
|
1706
1746
|
|
|
1707
1747
|
if (!this._config.parent) {
|
|
1708
|
-
this._addAriaAndCollapsedClass(this.
|
|
1748
|
+
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
|
1709
1749
|
}
|
|
1710
1750
|
|
|
1711
1751
|
if (this._config.toggle) {
|
|
@@ -1715,16 +1755,16 @@
|
|
|
1715
1755
|
|
|
1716
1756
|
|
|
1717
1757
|
static get Default() {
|
|
1718
|
-
return Default$
|
|
1758
|
+
return Default$b;
|
|
1719
1759
|
}
|
|
1720
1760
|
|
|
1721
1761
|
static get NAME() {
|
|
1722
|
-
return NAME$
|
|
1762
|
+
return NAME$c;
|
|
1723
1763
|
} // Public
|
|
1724
1764
|
|
|
1725
1765
|
|
|
1726
1766
|
toggle() {
|
|
1727
|
-
if (this.
|
|
1767
|
+
if (this._isShown()) {
|
|
1728
1768
|
this.hide();
|
|
1729
1769
|
} else {
|
|
1730
1770
|
this.show();
|
|
@@ -1732,30 +1772,21 @@
|
|
|
1732
1772
|
}
|
|
1733
1773
|
|
|
1734
1774
|
show() {
|
|
1735
|
-
if (this._isTransitioning || this.
|
|
1775
|
+
if (this._isTransitioning || this._isShown()) {
|
|
1736
1776
|
return;
|
|
1737
1777
|
}
|
|
1738
1778
|
|
|
1739
|
-
let actives;
|
|
1779
|
+
let actives = [];
|
|
1740
1780
|
let activesData;
|
|
1741
1781
|
|
|
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
|
-
}
|
|
1782
|
+
if (this._config.parent) {
|
|
1783
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1784
|
+
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
|
1754
1785
|
}
|
|
1755
1786
|
|
|
1756
1787
|
const container = SelectorEngine.findOne(this._selector);
|
|
1757
1788
|
|
|
1758
|
-
if (actives) {
|
|
1789
|
+
if (actives.length) {
|
|
1759
1790
|
const tempActiveData = actives.find(elem => container !== elem);
|
|
1760
1791
|
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
|
1761
1792
|
|
|
@@ -1770,17 +1801,17 @@
|
|
|
1770
1801
|
return;
|
|
1771
1802
|
}
|
|
1772
1803
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
}
|
|
1804
|
+
actives.forEach(elemActive => {
|
|
1805
|
+
if (container !== elemActive) {
|
|
1806
|
+
Collapse.getOrCreateInstance(elemActive, {
|
|
1807
|
+
toggle: false
|
|
1808
|
+
}).hide();
|
|
1809
|
+
}
|
|
1778
1810
|
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
}
|
|
1811
|
+
if (!activesData) {
|
|
1812
|
+
Data.set(elemActive, DATA_KEY$b, null);
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1784
1815
|
|
|
1785
1816
|
const dimension = this._getDimension();
|
|
1786
1817
|
|
|
@@ -1790,22 +1821,18 @@
|
|
|
1790
1821
|
|
|
1791
1822
|
this._element.style[dimension] = 0;
|
|
1792
1823
|
|
|
1793
|
-
|
|
1794
|
-
this._triggerArray.forEach(element => {
|
|
1795
|
-
element.classList.remove(CLASS_NAME_COLLAPSED);
|
|
1796
|
-
element.setAttribute('aria-expanded', true);
|
|
1797
|
-
});
|
|
1798
|
-
}
|
|
1824
|
+
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
|
1799
1825
|
|
|
1800
|
-
this.
|
|
1826
|
+
this._isTransitioning = true;
|
|
1801
1827
|
|
|
1802
1828
|
const complete = () => {
|
|
1829
|
+
this._isTransitioning = false;
|
|
1830
|
+
|
|
1803
1831
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1804
1832
|
|
|
1805
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1833
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1806
1834
|
|
|
1807
1835
|
this._element.style[dimension] = '';
|
|
1808
|
-
this.setTransitioning(false);
|
|
1809
1836
|
EventHandler.trigger(this._element, EVENT_SHOWN$6);
|
|
1810
1837
|
};
|
|
1811
1838
|
|
|
@@ -1818,7 +1845,7 @@
|
|
|
1818
1845
|
}
|
|
1819
1846
|
|
|
1820
1847
|
hide() {
|
|
1821
|
-
if (this._isTransitioning || !this.
|
|
1848
|
+
if (this._isTransitioning || !this._isShown()) {
|
|
1822
1849
|
return;
|
|
1823
1850
|
}
|
|
1824
1851
|
|
|
@@ -1835,26 +1862,23 @@
|
|
|
1835
1862
|
|
|
1836
1863
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
|
1837
1864
|
|
|
1838
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1865
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1839
1866
|
|
|
1840
1867
|
const triggerArrayLength = this._triggerArray.length;
|
|
1841
1868
|
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
const elem = getElementFromSelector(trigger);
|
|
1869
|
+
for (let i = 0; i < triggerArrayLength; i++) {
|
|
1870
|
+
const trigger = this._triggerArray[i];
|
|
1871
|
+
const elem = getElementFromSelector(trigger);
|
|
1846
1872
|
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
trigger.setAttribute('aria-expanded', false);
|
|
1850
|
-
}
|
|
1873
|
+
if (elem && !this._isShown(elem)) {
|
|
1874
|
+
this._addAriaAndCollapsedClass([trigger], false);
|
|
1851
1875
|
}
|
|
1852
1876
|
}
|
|
1853
1877
|
|
|
1854
|
-
this.
|
|
1878
|
+
this._isTransitioning = true;
|
|
1855
1879
|
|
|
1856
1880
|
const complete = () => {
|
|
1857
|
-
this.
|
|
1881
|
+
this._isTransitioning = false;
|
|
1858
1882
|
|
|
1859
1883
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1860
1884
|
|
|
@@ -1868,45 +1892,47 @@
|
|
|
1868
1892
|
this._queueCallback(complete, this._element, true);
|
|
1869
1893
|
}
|
|
1870
1894
|
|
|
1871
|
-
|
|
1872
|
-
|
|
1895
|
+
_isShown(element = this._element) {
|
|
1896
|
+
return element.classList.contains(CLASS_NAME_SHOW$9);
|
|
1873
1897
|
} // Private
|
|
1874
1898
|
|
|
1875
1899
|
|
|
1876
1900
|
_getConfig(config) {
|
|
1877
|
-
config = { ...Default$
|
|
1901
|
+
config = { ...Default$b,
|
|
1902
|
+
...Manipulator.getDataAttributes(this._element),
|
|
1878
1903
|
...config
|
|
1879
1904
|
};
|
|
1880
1905
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
|
1881
1906
|
|
|
1882
|
-
|
|
1907
|
+
config.parent = getElement(config.parent);
|
|
1908
|
+
typeCheckConfig(NAME$c, config, DefaultType$b);
|
|
1883
1909
|
return config;
|
|
1884
1910
|
}
|
|
1885
1911
|
|
|
1886
1912
|
_getDimension() {
|
|
1887
|
-
return this._element.classList.contains(
|
|
1913
|
+
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
|
1888
1914
|
}
|
|
1889
1915
|
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
const
|
|
1896
|
-
SelectorEngine.find(
|
|
1916
|
+
_initializeChildren() {
|
|
1917
|
+
if (!this._config.parent) {
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1922
|
+
SelectorEngine.find(SELECTOR_DATA_TOGGLE$5, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
|
1897
1923
|
const selected = getElementFromSelector(element);
|
|
1898
1924
|
|
|
1899
|
-
|
|
1925
|
+
if (selected) {
|
|
1926
|
+
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
|
1927
|
+
}
|
|
1900
1928
|
});
|
|
1901
|
-
return parent;
|
|
1902
1929
|
}
|
|
1903
1930
|
|
|
1904
|
-
_addAriaAndCollapsedClass(
|
|
1905
|
-
if (!
|
|
1931
|
+
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
|
1932
|
+
if (!triggerArray.length) {
|
|
1906
1933
|
return;
|
|
1907
1934
|
}
|
|
1908
1935
|
|
|
1909
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$a);
|
|
1910
1936
|
triggerArray.forEach(elem => {
|
|
1911
1937
|
if (isOpen) {
|
|
1912
1938
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
|
@@ -1919,33 +1945,23 @@
|
|
|
1919
1945
|
} // Static
|
|
1920
1946
|
|
|
1921
1947
|
|
|
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
|
-
}
|
|
1948
|
+
static jQueryInterface(config) {
|
|
1949
|
+
return this.each(function () {
|
|
1950
|
+
const _config = {};
|
|
1936
1951
|
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
throw new TypeError(`No method named "${config}"`);
|
|
1952
|
+
if (typeof config === 'string' && /show|hide/.test(config)) {
|
|
1953
|
+
_config.toggle = false;
|
|
1940
1954
|
}
|
|
1941
1955
|
|
|
1942
|
-
data
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1956
|
+
const data = Collapse.getOrCreateInstance(this, _config);
|
|
1945
1957
|
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1958
|
+
if (typeof config === 'string') {
|
|
1959
|
+
if (typeof data[config] === 'undefined') {
|
|
1960
|
+
throw new TypeError(`No method named "${config}"`);
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
data[config]();
|
|
1964
|
+
}
|
|
1949
1965
|
});
|
|
1950
1966
|
}
|
|
1951
1967
|
|
|
@@ -1963,26 +1979,12 @@
|
|
|
1963
1979
|
event.preventDefault();
|
|
1964
1980
|
}
|
|
1965
1981
|
|
|
1966
|
-
const triggerData = Manipulator.getDataAttributes(this);
|
|
1967
1982
|
const selector = getSelectorFromElement(this);
|
|
1968
1983
|
const selectorElements = SelectorEngine.find(selector);
|
|
1969
1984
|
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);
|
|
1985
|
+
Collapse.getOrCreateInstance(element, {
|
|
1986
|
+
toggle: false
|
|
1987
|
+
}).toggle();
|
|
1986
1988
|
});
|
|
1987
1989
|
});
|
|
1988
1990
|
/**
|
|
@@ -1996,7 +1998,7 @@
|
|
|
1996
1998
|
|
|
1997
1999
|
/**
|
|
1998
2000
|
* --------------------------------------------------------------------------
|
|
1999
|
-
* CoreUI (v4.
|
|
2001
|
+
* CoreUI (v4.1.1): dropdown.js
|
|
2000
2002
|
* Licensed under MIT (https://coreui.io/license)
|
|
2001
2003
|
*
|
|
2002
2004
|
* This component is a modified version of the Bootstrap's dropdown.js
|
|
@@ -2009,27 +2011,26 @@
|
|
|
2009
2011
|
* ------------------------------------------------------------------------
|
|
2010
2012
|
*/
|
|
2011
2013
|
|
|
2012
|
-
const NAME$
|
|
2013
|
-
const DATA_KEY$
|
|
2014
|
-
const EVENT_KEY$
|
|
2014
|
+
const NAME$b = 'dropdown';
|
|
2015
|
+
const DATA_KEY$a = 'coreui.dropdown';
|
|
2016
|
+
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
|
2015
2017
|
const DATA_API_KEY$6 = '.data-api';
|
|
2016
2018
|
const ESCAPE_KEY$2 = 'Escape';
|
|
2017
2019
|
const SPACE_KEY = 'Space';
|
|
2018
|
-
const TAB_KEY = 'Tab';
|
|
2020
|
+
const TAB_KEY$1 = 'Tab';
|
|
2019
2021
|
const ARROW_UP_KEY = 'ArrowUp';
|
|
2020
2022
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
2021
2023
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
|
2022
2024
|
|
|
2023
2025
|
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';
|
|
2026
|
+
const EVENT_HIDE$5 = `hide${EVENT_KEY$a}`;
|
|
2027
|
+
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$a}`;
|
|
2028
|
+
const EVENT_SHOW$5 = `show${EVENT_KEY$a}`;
|
|
2029
|
+
const EVENT_SHOWN$5 = `shown${EVENT_KEY$a}`;
|
|
2030
|
+
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
2031
|
+
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
2032
|
+
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
2033
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
|
2033
2034
|
const CLASS_NAME_DROPUP = 'dropup';
|
|
2034
2035
|
const CLASS_NAME_DROPEND = 'dropend';
|
|
2035
2036
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
|
@@ -2044,7 +2045,7 @@
|
|
|
2044
2045
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
|
2045
2046
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
|
2046
2047
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
|
2047
|
-
const Default$
|
|
2048
|
+
const Default$a = {
|
|
2048
2049
|
offset: [0, 2],
|
|
2049
2050
|
boundary: 'clippingParents',
|
|
2050
2051
|
reference: 'toggle',
|
|
@@ -2052,7 +2053,7 @@
|
|
|
2052
2053
|
popperConfig: null,
|
|
2053
2054
|
autoClose: true
|
|
2054
2055
|
};
|
|
2055
|
-
const DefaultType$
|
|
2056
|
+
const DefaultType$a = {
|
|
2056
2057
|
offset: '(array|string|function)',
|
|
2057
2058
|
boundary: '(string|element)',
|
|
2058
2059
|
reference: '(string|element|object)',
|
|
@@ -2073,45 +2074,31 @@
|
|
|
2073
2074
|
this._config = this._getConfig(config);
|
|
2074
2075
|
this._menu = this._getMenuElement();
|
|
2075
2076
|
this._inNavbar = this._detectNavbar();
|
|
2076
|
-
|
|
2077
|
-
this._addEventListeners();
|
|
2078
2077
|
} // Getters
|
|
2079
2078
|
|
|
2080
2079
|
|
|
2081
2080
|
static get Default() {
|
|
2082
|
-
return Default$
|
|
2081
|
+
return Default$a;
|
|
2083
2082
|
}
|
|
2084
2083
|
|
|
2085
2084
|
static get DefaultType() {
|
|
2086
|
-
return DefaultType$
|
|
2085
|
+
return DefaultType$a;
|
|
2087
2086
|
}
|
|
2088
2087
|
|
|
2089
2088
|
static get NAME() {
|
|
2090
|
-
return NAME$
|
|
2089
|
+
return NAME$b;
|
|
2091
2090
|
} // Public
|
|
2092
2091
|
|
|
2093
2092
|
|
|
2094
|
-
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();
|
|
2093
|
+
toggle() {
|
|
2094
|
+
return this._isShown() ? this.hide() : this.show();
|
|
2107
2095
|
}
|
|
2108
2096
|
|
|
2109
2097
|
show() {
|
|
2110
|
-
if (isDisabled(this._element) || this._menu
|
|
2098
|
+
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
|
2111
2099
|
return;
|
|
2112
2100
|
}
|
|
2113
2101
|
|
|
2114
|
-
const parent = Dropdown.getParentFromElement(this._element);
|
|
2115
2102
|
const relatedTarget = {
|
|
2116
2103
|
relatedTarget: this._element
|
|
2117
2104
|
};
|
|
@@ -2119,34 +2106,14 @@
|
|
|
2119
2106
|
|
|
2120
2107
|
if (showEvent.defaultPrevented) {
|
|
2121
2108
|
return;
|
|
2122
|
-
}
|
|
2109
|
+
}
|
|
2123
2110
|
|
|
2111
|
+
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
|
2124
2112
|
|
|
2125
2113
|
if (this._inNavbar) {
|
|
2126
2114
|
Manipulator.setDataAttribute(this._menu, 'popper', 'none');
|
|
2127
2115
|
} 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
|
-
}
|
|
2116
|
+
this._createPopper(parent);
|
|
2150
2117
|
} // If this is a touch-enabled device we add extra
|
|
2151
2118
|
// empty mouseover listeners to the body's immediate children;
|
|
2152
2119
|
// only needed because of broken event delegation on iOS
|
|
@@ -2161,15 +2128,15 @@
|
|
|
2161
2128
|
|
|
2162
2129
|
this._element.setAttribute('aria-expanded', true);
|
|
2163
2130
|
|
|
2164
|
-
this._menu.classList.
|
|
2131
|
+
this._menu.classList.add(CLASS_NAME_SHOW$8);
|
|
2165
2132
|
|
|
2166
|
-
this._element.classList.
|
|
2133
|
+
this._element.classList.add(CLASS_NAME_SHOW$8);
|
|
2167
2134
|
|
|
2168
2135
|
EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);
|
|
2169
2136
|
}
|
|
2170
2137
|
|
|
2171
2138
|
hide() {
|
|
2172
|
-
if (isDisabled(this._element) || !this._menu
|
|
2139
|
+
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
|
2173
2140
|
return;
|
|
2174
2141
|
}
|
|
2175
2142
|
|
|
@@ -2197,13 +2164,6 @@
|
|
|
2197
2164
|
} // Private
|
|
2198
2165
|
|
|
2199
2166
|
|
|
2200
|
-
_addEventListeners() {
|
|
2201
|
-
EventHandler.on(this._element, EVENT_CLICK, event => {
|
|
2202
|
-
event.preventDefault();
|
|
2203
|
-
this.toggle();
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
2167
|
_completeHide(relatedTarget) {
|
|
2208
2168
|
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);
|
|
2209
2169
|
|
|
@@ -2221,9 +2181,9 @@
|
|
|
2221
2181
|
this._popper.destroy();
|
|
2222
2182
|
}
|
|
2223
2183
|
|
|
2224
|
-
this._menu.classList.remove(CLASS_NAME_SHOW$
|
|
2184
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$8);
|
|
2225
2185
|
|
|
2226
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
2186
|
+
this._element.classList.remove(CLASS_NAME_SHOW$8);
|
|
2227
2187
|
|
|
2228
2188
|
this._element.setAttribute('aria-expanded', 'false');
|
|
2229
2189
|
|
|
@@ -2236,16 +2196,45 @@
|
|
|
2236
2196
|
...Manipulator.getDataAttributes(this._element),
|
|
2237
2197
|
...config
|
|
2238
2198
|
};
|
|
2239
|
-
typeCheckConfig(NAME$
|
|
2199
|
+
typeCheckConfig(NAME$b, config, this.constructor.DefaultType);
|
|
2240
2200
|
|
|
2241
2201
|
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
2242
2202
|
// Popper virtual elements require a getBoundingClientRect method
|
|
2243
|
-
throw new TypeError(`${NAME$
|
|
2203
|
+
throw new TypeError(`${NAME$b.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
|
2244
2204
|
}
|
|
2245
2205
|
|
|
2246
2206
|
return config;
|
|
2247
2207
|
}
|
|
2248
2208
|
|
|
2209
|
+
_createPopper(parent) {
|
|
2210
|
+
if (typeof Popper__namespace === 'undefined') {
|
|
2211
|
+
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
let referenceElement = this._element;
|
|
2215
|
+
|
|
2216
|
+
if (this._config.reference === 'parent') {
|
|
2217
|
+
referenceElement = parent;
|
|
2218
|
+
} else if (isElement(this._config.reference)) {
|
|
2219
|
+
referenceElement = getElement(this._config.reference);
|
|
2220
|
+
} else if (typeof this._config.reference === 'object') {
|
|
2221
|
+
referenceElement = this._config.reference;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
const popperConfig = this._getPopperConfig();
|
|
2225
|
+
|
|
2226
|
+
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
2227
|
+
this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
|
|
2228
|
+
|
|
2229
|
+
if (isDisplayStatic) {
|
|
2230
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
_isShown(element = this._element) {
|
|
2235
|
+
return element.classList.contains(CLASS_NAME_SHOW$8);
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2249
2238
|
_getMenuElement() {
|
|
2250
2239
|
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
|
|
2251
2240
|
}
|
|
@@ -2335,26 +2324,24 @@
|
|
|
2335
2324
|
} // Static
|
|
2336
2325
|
|
|
2337
2326
|
|
|
2338
|
-
static
|
|
2339
|
-
|
|
2327
|
+
static jQueryInterface(config) {
|
|
2328
|
+
return this.each(function () {
|
|
2329
|
+
const data = Dropdown.getOrCreateInstance(this, config);
|
|
2330
|
+
|
|
2331
|
+
if (typeof config !== 'string') {
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2340
2334
|
|
|
2341
|
-
if (typeof config === 'string') {
|
|
2342
2335
|
if (typeof data[config] === 'undefined') {
|
|
2343
2336
|
throw new TypeError(`No method named "${config}"`);
|
|
2344
2337
|
}
|
|
2345
2338
|
|
|
2346
2339
|
data[config]();
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
static jQueryInterface(config) {
|
|
2351
|
-
return this.each(function () {
|
|
2352
|
-
Dropdown.dropdownInterface(this, config);
|
|
2353
2340
|
});
|
|
2354
2341
|
}
|
|
2355
2342
|
|
|
2356
2343
|
static clearMenus(event) {
|
|
2357
|
-
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
|
2344
|
+
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
|
|
2358
2345
|
return;
|
|
2359
2346
|
}
|
|
2360
2347
|
|
|
@@ -2367,7 +2354,7 @@
|
|
|
2367
2354
|
continue;
|
|
2368
2355
|
}
|
|
2369
2356
|
|
|
2370
|
-
if (!context.
|
|
2357
|
+
if (!context._isShown()) {
|
|
2371
2358
|
continue;
|
|
2372
2359
|
}
|
|
2373
2360
|
|
|
@@ -2384,7 +2371,7 @@
|
|
|
2384
2371
|
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
|
2385
2372
|
|
|
2386
2373
|
|
|
2387
|
-
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
2374
|
+
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
2375
|
continue;
|
|
2389
2376
|
}
|
|
2390
2377
|
|
|
@@ -2413,7 +2400,7 @@
|
|
|
2413
2400
|
return;
|
|
2414
2401
|
}
|
|
2415
2402
|
|
|
2416
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$
|
|
2403
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$8);
|
|
2417
2404
|
|
|
2418
2405
|
if (!isActive && event.key === ESCAPE_KEY$2) {
|
|
2419
2406
|
return;
|
|
@@ -2426,20 +2413,20 @@
|
|
|
2426
2413
|
return;
|
|
2427
2414
|
}
|
|
2428
2415
|
|
|
2429
|
-
const getToggleButton =
|
|
2416
|
+
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$4) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$4)[0];
|
|
2417
|
+
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
2430
2418
|
|
|
2431
2419
|
if (event.key === ESCAPE_KEY$2) {
|
|
2432
|
-
|
|
2433
|
-
Dropdown.clearMenus();
|
|
2420
|
+
instance.hide();
|
|
2434
2421
|
return;
|
|
2435
2422
|
}
|
|
2436
2423
|
|
|
2437
2424
|
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
|
2438
2425
|
if (!isActive) {
|
|
2439
|
-
|
|
2426
|
+
instance.show();
|
|
2440
2427
|
}
|
|
2441
2428
|
|
|
2442
|
-
|
|
2429
|
+
instance._selectMenuItem(event);
|
|
2443
2430
|
|
|
2444
2431
|
return;
|
|
2445
2432
|
}
|
|
@@ -2463,7 +2450,7 @@
|
|
|
2463
2450
|
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
|
2464
2451
|
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, function (event) {
|
|
2465
2452
|
event.preventDefault();
|
|
2466
|
-
Dropdown.
|
|
2453
|
+
Dropdown.getOrCreateInstance(this).toggle();
|
|
2467
2454
|
});
|
|
2468
2455
|
/**
|
|
2469
2456
|
* ------------------------------------------------------------------------
|
|
@@ -2476,7 +2463,7 @@
|
|
|
2476
2463
|
|
|
2477
2464
|
/**
|
|
2478
2465
|
* --------------------------------------------------------------------------
|
|
2479
|
-
* Bootstrap (v5.
|
|
2466
|
+
* Bootstrap (v5.1.3): util/scrollBar.js
|
|
2480
2467
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2481
2468
|
* --------------------------------------------------------------------------
|
|
2482
2469
|
*/
|
|
@@ -2580,11 +2567,12 @@
|
|
|
2580
2567
|
|
|
2581
2568
|
/**
|
|
2582
2569
|
* --------------------------------------------------------------------------
|
|
2583
|
-
* Bootstrap (v5.
|
|
2584
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
|
2570
|
+
* Bootstrap (v5.1.3): util/backdrop.js
|
|
2571
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2585
2572
|
* --------------------------------------------------------------------------
|
|
2586
2573
|
*/
|
|
2587
|
-
const Default$
|
|
2574
|
+
const Default$9 = {
|
|
2575
|
+
className: 'modal-backdrop',
|
|
2588
2576
|
isVisible: true,
|
|
2589
2577
|
// if false, we use the backdrop helper without adding any element to the dom
|
|
2590
2578
|
isAnimated: false,
|
|
@@ -2592,17 +2580,17 @@
|
|
|
2592
2580
|
// give the choice to place backdrop under different elements
|
|
2593
2581
|
clickCallback: null
|
|
2594
2582
|
};
|
|
2595
|
-
const DefaultType$
|
|
2583
|
+
const DefaultType$9 = {
|
|
2584
|
+
className: 'string',
|
|
2596
2585
|
isVisible: 'boolean',
|
|
2597
2586
|
isAnimated: 'boolean',
|
|
2598
2587
|
rootElement: '(element|string)',
|
|
2599
2588
|
clickCallback: '(function|null)'
|
|
2600
2589
|
};
|
|
2601
|
-
const NAME$
|
|
2602
|
-
const
|
|
2603
|
-
const
|
|
2604
|
-
const
|
|
2605
|
-
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$9}`;
|
|
2590
|
+
const NAME$a = 'backdrop';
|
|
2591
|
+
const CLASS_NAME_FADE$4 = 'fade';
|
|
2592
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
|
2593
|
+
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$a}`;
|
|
2606
2594
|
|
|
2607
2595
|
class Backdrop {
|
|
2608
2596
|
constructor(config) {
|
|
@@ -2623,7 +2611,7 @@
|
|
|
2623
2611
|
reflow(this._getElement());
|
|
2624
2612
|
}
|
|
2625
2613
|
|
|
2626
|
-
this._getElement().classList.add(CLASS_NAME_SHOW$
|
|
2614
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$7);
|
|
2627
2615
|
|
|
2628
2616
|
this._emulateAnimation(() => {
|
|
2629
2617
|
execute(callback);
|
|
@@ -2636,7 +2624,7 @@
|
|
|
2636
2624
|
return;
|
|
2637
2625
|
}
|
|
2638
2626
|
|
|
2639
|
-
this._getElement().classList.remove(CLASS_NAME_SHOW$
|
|
2627
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$7);
|
|
2640
2628
|
|
|
2641
2629
|
this._emulateAnimation(() => {
|
|
2642
2630
|
this.dispose();
|
|
@@ -2648,10 +2636,10 @@
|
|
|
2648
2636
|
_getElement() {
|
|
2649
2637
|
if (!this._element) {
|
|
2650
2638
|
const backdrop = document.createElement('div');
|
|
2651
|
-
backdrop.className =
|
|
2639
|
+
backdrop.className = this._config.className;
|
|
2652
2640
|
|
|
2653
2641
|
if (this._config.isAnimated) {
|
|
2654
|
-
backdrop.classList.add(CLASS_NAME_FADE$
|
|
2642
|
+
backdrop.classList.add(CLASS_NAME_FADE$4);
|
|
2655
2643
|
}
|
|
2656
2644
|
|
|
2657
2645
|
this._element = backdrop;
|
|
@@ -2661,12 +2649,12 @@
|
|
|
2661
2649
|
}
|
|
2662
2650
|
|
|
2663
2651
|
_getConfig(config) {
|
|
2664
|
-
config = { ...Default$
|
|
2652
|
+
config = { ...Default$9,
|
|
2665
2653
|
...(typeof config === 'object' ? config : {})
|
|
2666
2654
|
}; // use getElement() with the default "body" to get a fresh Element on each instantiation
|
|
2667
2655
|
|
|
2668
2656
|
config.rootElement = getElement(config.rootElement);
|
|
2669
|
-
typeCheckConfig(NAME$
|
|
2657
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
|
2670
2658
|
return config;
|
|
2671
2659
|
}
|
|
2672
2660
|
|
|
@@ -2675,7 +2663,7 @@
|
|
|
2675
2663
|
return;
|
|
2676
2664
|
}
|
|
2677
2665
|
|
|
2678
|
-
this._config.rootElement.
|
|
2666
|
+
this._config.rootElement.append(this._getElement());
|
|
2679
2667
|
|
|
2680
2668
|
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
|
2681
2669
|
execute(this._config.clickCallback);
|
|
@@ -2703,7 +2691,110 @@
|
|
|
2703
2691
|
|
|
2704
2692
|
/**
|
|
2705
2693
|
* --------------------------------------------------------------------------
|
|
2706
|
-
|
|
2694
|
+
* Bootstrap (v5.1.3): util/focustrap.js
|
|
2695
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2696
|
+
* --------------------------------------------------------------------------
|
|
2697
|
+
*/
|
|
2698
|
+
const Default$8 = {
|
|
2699
|
+
trapElement: null,
|
|
2700
|
+
// The element to trap focus inside of
|
|
2701
|
+
autofocus: true
|
|
2702
|
+
};
|
|
2703
|
+
const DefaultType$8 = {
|
|
2704
|
+
trapElement: 'element',
|
|
2705
|
+
autofocus: 'boolean'
|
|
2706
|
+
};
|
|
2707
|
+
const NAME$9 = 'focustrap';
|
|
2708
|
+
const DATA_KEY$9 = 'coreui.focustrap';
|
|
2709
|
+
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
|
2710
|
+
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$9}`;
|
|
2711
|
+
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$9}`;
|
|
2712
|
+
const TAB_KEY = 'Tab';
|
|
2713
|
+
const TAB_NAV_FORWARD = 'forward';
|
|
2714
|
+
const TAB_NAV_BACKWARD = 'backward';
|
|
2715
|
+
|
|
2716
|
+
class FocusTrap {
|
|
2717
|
+
constructor(config) {
|
|
2718
|
+
this._config = this._getConfig(config);
|
|
2719
|
+
this._isActive = false;
|
|
2720
|
+
this._lastTabNavDirection = null;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
activate() {
|
|
2724
|
+
const {
|
|
2725
|
+
trapElement,
|
|
2726
|
+
autofocus
|
|
2727
|
+
} = this._config;
|
|
2728
|
+
|
|
2729
|
+
if (this._isActive) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
if (autofocus) {
|
|
2734
|
+
trapElement.focus();
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
EventHandler.off(document, EVENT_KEY$9); // guard against infinite focus loop
|
|
2738
|
+
|
|
2739
|
+
EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
|
|
2740
|
+
EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
|
|
2741
|
+
this._isActive = true;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
deactivate() {
|
|
2745
|
+
if (!this._isActive) {
|
|
2746
|
+
return;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
this._isActive = false;
|
|
2750
|
+
EventHandler.off(document, EVENT_KEY$9);
|
|
2751
|
+
} // Private
|
|
2752
|
+
|
|
2753
|
+
|
|
2754
|
+
_handleFocusin(event) {
|
|
2755
|
+
const {
|
|
2756
|
+
target
|
|
2757
|
+
} = event;
|
|
2758
|
+
const {
|
|
2759
|
+
trapElement
|
|
2760
|
+
} = this._config;
|
|
2761
|
+
|
|
2762
|
+
if (target === document || target === trapElement || trapElement.contains(target)) {
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
const elements = SelectorEngine.focusableChildren(trapElement);
|
|
2767
|
+
|
|
2768
|
+
if (elements.length === 0) {
|
|
2769
|
+
trapElement.focus();
|
|
2770
|
+
} else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
|
|
2771
|
+
elements[elements.length - 1].focus();
|
|
2772
|
+
} else {
|
|
2773
|
+
elements[0].focus();
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
_handleKeydown(event) {
|
|
2778
|
+
if (event.key !== TAB_KEY) {
|
|
2779
|
+
return;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
_getConfig(config) {
|
|
2786
|
+
config = { ...Default$8,
|
|
2787
|
+
...(typeof config === 'object' ? config : {})
|
|
2788
|
+
};
|
|
2789
|
+
typeCheckConfig(NAME$9, config, DefaultType$8);
|
|
2790
|
+
return config;
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
/**
|
|
2796
|
+
* --------------------------------------------------------------------------
|
|
2797
|
+
* CoreUI (v4.1.1): modal.js
|
|
2707
2798
|
* Licensed under MIT (https://coreui.io/license)
|
|
2708
2799
|
*
|
|
2709
2800
|
* This component is a modified version of the Bootstrap's modal.js
|
|
@@ -2736,21 +2827,20 @@
|
|
|
2736
2827
|
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
|
|
2737
2828
|
const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
|
|
2738
2829
|
const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
|
|
2739
|
-
const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$8}`;
|
|
2740
2830
|
const EVENT_RESIZE$1 = `resize${EVENT_KEY$8}`;
|
|
2741
|
-
const EVENT_CLICK_DISMISS
|
|
2831
|
+
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$8}`;
|
|
2742
2832
|
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$8}`;
|
|
2743
2833
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$8}`;
|
|
2744
2834
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$8}`;
|
|
2745
2835
|
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
|
|
2746
2836
|
const CLASS_NAME_OPEN = 'modal-open';
|
|
2747
|
-
const CLASS_NAME_FADE$
|
|
2748
|
-
const CLASS_NAME_SHOW$
|
|
2837
|
+
const CLASS_NAME_FADE$3 = 'fade';
|
|
2838
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
|
2749
2839
|
const CLASS_NAME_STATIC = 'modal-static';
|
|
2840
|
+
const OPEN_SELECTOR$1 = '.modal.show';
|
|
2750
2841
|
const SELECTOR_DIALOG = '.modal-dialog';
|
|
2751
2842
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
|
2752
2843
|
const SELECTOR_DATA_TOGGLE$3 = '[data-coreui-toggle="modal"]';
|
|
2753
|
-
const SELECTOR_DATA_DISMISS$2 = '[data-coreui-dismiss="modal"]';
|
|
2754
2844
|
/**
|
|
2755
2845
|
* ------------------------------------------------------------------------
|
|
2756
2846
|
* Class Definition
|
|
@@ -2763,6 +2853,7 @@
|
|
|
2763
2853
|
this._config = this._getConfig(config);
|
|
2764
2854
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
|
2765
2855
|
this._backdrop = this._initializeBackDrop();
|
|
2856
|
+
this._focustrap = this._initializeFocusTrap();
|
|
2766
2857
|
this._isShown = false;
|
|
2767
2858
|
this._ignoreBackdropClick = false;
|
|
2768
2859
|
this._isTransitioning = false;
|
|
@@ -2812,7 +2903,6 @@
|
|
|
2812
2903
|
|
|
2813
2904
|
this._setResizeEvent();
|
|
2814
2905
|
|
|
2815
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
|
|
2816
2906
|
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
|
|
2817
2907
|
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
|
|
2818
2908
|
if (event.target === this._element) {
|
|
@@ -2824,11 +2914,7 @@
|
|
|
2824
2914
|
this._showBackdrop(() => this._showElement(relatedTarget));
|
|
2825
2915
|
}
|
|
2826
2916
|
|
|
2827
|
-
hide(
|
|
2828
|
-
if (event && ['A', 'AREA'].includes(event.target.tagName)) {
|
|
2829
|
-
event.preventDefault();
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2917
|
+
hide() {
|
|
2832
2918
|
if (!this._isShown || this._isTransitioning) {
|
|
2833
2919
|
return;
|
|
2834
2920
|
}
|
|
@@ -2851,11 +2937,11 @@
|
|
|
2851
2937
|
|
|
2852
2938
|
this._setResizeEvent();
|
|
2853
2939
|
|
|
2854
|
-
|
|
2940
|
+
this._focustrap.deactivate();
|
|
2855
2941
|
|
|
2856
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
2942
|
+
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
|
2857
2943
|
|
|
2858
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS
|
|
2944
|
+
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
|
2859
2945
|
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
|
|
2860
2946
|
|
|
2861
2947
|
this._queueCallback(() => this._hideModal(), this._element, isAnimated);
|
|
@@ -2866,14 +2952,9 @@
|
|
|
2866
2952
|
|
|
2867
2953
|
this._backdrop.dispose();
|
|
2868
2954
|
|
|
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
|
-
*/
|
|
2955
|
+
this._focustrap.deactivate();
|
|
2875
2956
|
|
|
2876
|
-
|
|
2957
|
+
super.dispose();
|
|
2877
2958
|
}
|
|
2878
2959
|
|
|
2879
2960
|
handleUpdate() {
|
|
@@ -2889,6 +2970,12 @@
|
|
|
2889
2970
|
});
|
|
2890
2971
|
}
|
|
2891
2972
|
|
|
2973
|
+
_initializeFocusTrap() {
|
|
2974
|
+
return new FocusTrap({
|
|
2975
|
+
trapElement: this._element
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2892
2979
|
_getConfig(config) {
|
|
2893
2980
|
config = { ...Default$7,
|
|
2894
2981
|
...Manipulator.getDataAttributes(this._element),
|
|
@@ -2905,7 +2992,7 @@
|
|
|
2905
2992
|
|
|
2906
2993
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
|
2907
2994
|
// Don't move modal's DOM position
|
|
2908
|
-
document.body.
|
|
2995
|
+
document.body.append(this._element);
|
|
2909
2996
|
}
|
|
2910
2997
|
|
|
2911
2998
|
this._element.style.display = 'block';
|
|
@@ -2926,15 +3013,11 @@
|
|
|
2926
3013
|
reflow(this._element);
|
|
2927
3014
|
}
|
|
2928
3015
|
|
|
2929
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
2930
|
-
|
|
2931
|
-
if (this._config.focus) {
|
|
2932
|
-
this._enforceFocus();
|
|
2933
|
-
}
|
|
3016
|
+
this._element.classList.add(CLASS_NAME_SHOW$6);
|
|
2934
3017
|
|
|
2935
3018
|
const transitionComplete = () => {
|
|
2936
3019
|
if (this._config.focus) {
|
|
2937
|
-
this.
|
|
3020
|
+
this._focustrap.activate();
|
|
2938
3021
|
}
|
|
2939
3022
|
|
|
2940
3023
|
this._isTransitioning = false;
|
|
@@ -2946,16 +3029,6 @@
|
|
|
2946
3029
|
this._queueCallback(transitionComplete, this._dialog, isAnimated);
|
|
2947
3030
|
}
|
|
2948
3031
|
|
|
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
3032
|
_setEscapeEvent() {
|
|
2960
3033
|
if (this._isShown) {
|
|
2961
3034
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
|
@@ -3002,7 +3075,7 @@
|
|
|
3002
3075
|
}
|
|
3003
3076
|
|
|
3004
3077
|
_showBackdrop(callback) {
|
|
3005
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS
|
|
3078
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
|
|
3006
3079
|
if (this._ignoreBackdropClick) {
|
|
3007
3080
|
this._ignoreBackdropClick = false;
|
|
3008
3081
|
return;
|
|
@@ -3023,7 +3096,7 @@
|
|
|
3023
3096
|
}
|
|
3024
3097
|
|
|
3025
3098
|
_isAnimated() {
|
|
3026
|
-
return this._element.classList.contains(CLASS_NAME_FADE$
|
|
3099
|
+
return this._element.classList.contains(CLASS_NAME_FADE$3);
|
|
3027
3100
|
}
|
|
3028
3101
|
|
|
3029
3102
|
_triggerBackdropTransition() {
|
|
@@ -3130,10 +3203,18 @@
|
|
|
3130
3203
|
this.focus();
|
|
3131
3204
|
}
|
|
3132
3205
|
});
|
|
3133
|
-
});
|
|
3206
|
+
}); // avoid conflict when clicking moddal toggler while another one is open
|
|
3207
|
+
|
|
3208
|
+
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
|
|
3209
|
+
|
|
3210
|
+
if (allReadyOpen) {
|
|
3211
|
+
Modal.getInstance(allReadyOpen).hide();
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3134
3214
|
const data = Modal.getOrCreateInstance(target);
|
|
3135
3215
|
data.toggle(this);
|
|
3136
3216
|
});
|
|
3217
|
+
enableDismissTrigger(Modal);
|
|
3137
3218
|
/**
|
|
3138
3219
|
* ------------------------------------------------------------------------
|
|
3139
3220
|
* jQuery
|
|
@@ -3145,7 +3226,7 @@
|
|
|
3145
3226
|
|
|
3146
3227
|
/**
|
|
3147
3228
|
* --------------------------------------------------------------------------
|
|
3148
|
-
* CoreUI (v4.
|
|
3229
|
+
* CoreUI (v4.1.1): navigation.js
|
|
3149
3230
|
* Licensed under MIT (https://coreui.io/license)
|
|
3150
3231
|
* --------------------------------------------------------------------------
|
|
3151
3232
|
*/
|
|
@@ -3168,7 +3249,7 @@
|
|
|
3168
3249
|
groupsAutoCollapse: '(string|boolean)'
|
|
3169
3250
|
};
|
|
3170
3251
|
const CLASS_NAME_ACTIVE$2 = 'active';
|
|
3171
|
-
const CLASS_NAME_SHOW$
|
|
3252
|
+
const CLASS_NAME_SHOW$5 = 'show';
|
|
3172
3253
|
const CLASS_NAME_NAV_GROUP = 'nav-group';
|
|
3173
3254
|
const CLASS_NAME_NAV_GROUP_TOGGLE = 'nav-group-toggle';
|
|
3174
3255
|
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
|
@@ -3207,6 +3288,10 @@
|
|
|
3207
3288
|
|
|
3208
3289
|
static get DefaultType() {
|
|
3209
3290
|
return DefaultType$6;
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
static get NAME() {
|
|
3294
|
+
return NAME$7;
|
|
3210
3295
|
} // Private
|
|
3211
3296
|
|
|
3212
3297
|
|
|
@@ -3241,7 +3326,7 @@
|
|
|
3241
3326
|
if (this._config.activeLinksExact && element.href === currentUrl) {
|
|
3242
3327
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
3243
3328
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
3244
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
3329
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
3245
3330
|
element.setAttribute('aria-expanded', true);
|
|
3246
3331
|
});
|
|
3247
3332
|
}
|
|
@@ -3249,7 +3334,7 @@
|
|
|
3249
3334
|
if (!this._config.activeLinksExact && element.href.startsWith(currentUrl)) {
|
|
3250
3335
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
3251
3336
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
3252
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
3337
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
3253
3338
|
element.setAttribute('aria-expanded', true);
|
|
3254
3339
|
});
|
|
3255
3340
|
}
|
|
@@ -3348,28 +3433,28 @@
|
|
|
3348
3433
|
toggler = toggler.closest(SELECTOR_NAV_GROUP_TOGGLE);
|
|
3349
3434
|
}
|
|
3350
3435
|
|
|
3351
|
-
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$
|
|
3436
|
+
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$5)); // Close other groups
|
|
3352
3437
|
|
|
3353
3438
|
|
|
3354
3439
|
if (this._config.groupsAutoCollapse === true) {
|
|
3355
3440
|
this._getSiblings(toggler.parentNode, filter).forEach(element => {
|
|
3356
3441
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, element), () => {
|
|
3357
|
-
element.classList.remove(CLASS_NAME_SHOW$
|
|
3442
|
+
element.classList.remove(CLASS_NAME_SHOW$5);
|
|
3358
3443
|
element.setAttribute('aria-expanded', false);
|
|
3359
3444
|
});
|
|
3360
3445
|
});
|
|
3361
3446
|
}
|
|
3362
3447
|
|
|
3363
|
-
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$
|
|
3448
|
+
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$5)) {
|
|
3364
3449
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode), () => {
|
|
3365
|
-
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$
|
|
3450
|
+
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$5);
|
|
3366
3451
|
toggler.parentNode.setAttribute('aria-expanded', false);
|
|
3367
3452
|
});
|
|
3368
3453
|
|
|
3369
3454
|
return;
|
|
3370
3455
|
}
|
|
3371
3456
|
|
|
3372
|
-
toggler.parentNode.classList.add(CLASS_NAME_SHOW$
|
|
3457
|
+
toggler.parentNode.classList.add(CLASS_NAME_SHOW$5);
|
|
3373
3458
|
toggler.parentNode.setAttribute('aria-expanded', true);
|
|
3374
3459
|
|
|
3375
3460
|
this._slideDown(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode));
|
|
@@ -3422,11 +3507,11 @@
|
|
|
3422
3507
|
* add .Navigation to jQuery only if jQuery is present
|
|
3423
3508
|
*/
|
|
3424
3509
|
|
|
3425
|
-
defineJQueryPlugin(
|
|
3510
|
+
defineJQueryPlugin(Navigation);
|
|
3426
3511
|
|
|
3427
3512
|
/**
|
|
3428
3513
|
* --------------------------------------------------------------------------
|
|
3429
|
-
* CoreUI (v4.
|
|
3514
|
+
* CoreUI (v4.1.1): dropdown.js
|
|
3430
3515
|
* Licensed under MIT (https://coreui.io/license)
|
|
3431
3516
|
*
|
|
3432
3517
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
@@ -3455,17 +3540,15 @@
|
|
|
3455
3540
|
keyboard: 'boolean',
|
|
3456
3541
|
scroll: 'boolean'
|
|
3457
3542
|
};
|
|
3458
|
-
const CLASS_NAME_SHOW$
|
|
3543
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
|
3544
|
+
const CLASS_NAME_BACKDROP$1 = 'offcanvas-backdrop';
|
|
3459
3545
|
const OPEN_SELECTOR = '.offcanvas.show';
|
|
3460
3546
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
|
3461
3547
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
|
3462
3548
|
const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
|
|
3463
3549
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
|
3464
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
|
|
3465
3550
|
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
3551
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$6}`;
|
|
3468
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-coreui-dismiss="offcanvas"]';
|
|
3469
3552
|
const SELECTOR_DATA_TOGGLE$2 = '[data-coreui-toggle="offcanvas"]';
|
|
3470
3553
|
/**
|
|
3471
3554
|
* ------------------------------------------------------------------------
|
|
@@ -3479,6 +3562,7 @@
|
|
|
3479
3562
|
this._config = this._getConfig(config);
|
|
3480
3563
|
this._isShown = false;
|
|
3481
3564
|
this._backdrop = this._initializeBackDrop();
|
|
3565
|
+
this._focustrap = this._initializeFocusTrap();
|
|
3482
3566
|
|
|
3483
3567
|
this._addEventListeners();
|
|
3484
3568
|
} // Getters
|
|
@@ -3517,8 +3601,6 @@
|
|
|
3517
3601
|
|
|
3518
3602
|
if (!this._config.scroll) {
|
|
3519
3603
|
new ScrollBarHelper().hide();
|
|
3520
|
-
|
|
3521
|
-
this._enforceFocusOnElement(this._element);
|
|
3522
3604
|
}
|
|
3523
3605
|
|
|
3524
3606
|
this._element.removeAttribute('aria-hidden');
|
|
@@ -3527,9 +3609,13 @@
|
|
|
3527
3609
|
|
|
3528
3610
|
this._element.setAttribute('role', 'dialog');
|
|
3529
3611
|
|
|
3530
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
3612
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
|
3531
3613
|
|
|
3532
3614
|
const completeCallBack = () => {
|
|
3615
|
+
if (!this._config.scroll) {
|
|
3616
|
+
this._focustrap.activate();
|
|
3617
|
+
}
|
|
3618
|
+
|
|
3533
3619
|
EventHandler.trigger(this._element, EVENT_SHOWN$3, {
|
|
3534
3620
|
relatedTarget
|
|
3535
3621
|
});
|
|
@@ -3549,13 +3635,13 @@
|
|
|
3549
3635
|
return;
|
|
3550
3636
|
}
|
|
3551
3637
|
|
|
3552
|
-
|
|
3638
|
+
this._focustrap.deactivate();
|
|
3553
3639
|
|
|
3554
3640
|
this._element.blur();
|
|
3555
3641
|
|
|
3556
3642
|
this._isShown = false;
|
|
3557
3643
|
|
|
3558
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
3644
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
|
3559
3645
|
|
|
3560
3646
|
this._backdrop.hide();
|
|
3561
3647
|
|
|
@@ -3581,8 +3667,9 @@
|
|
|
3581
3667
|
dispose() {
|
|
3582
3668
|
this._backdrop.dispose();
|
|
3583
3669
|
|
|
3670
|
+
this._focustrap.deactivate();
|
|
3671
|
+
|
|
3584
3672
|
super.dispose();
|
|
3585
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
|
3586
3673
|
} // Private
|
|
3587
3674
|
|
|
3588
3675
|
|
|
@@ -3597,6 +3684,7 @@
|
|
|
3597
3684
|
|
|
3598
3685
|
_initializeBackDrop() {
|
|
3599
3686
|
return new Backdrop({
|
|
3687
|
+
className: CLASS_NAME_BACKDROP$1,
|
|
3600
3688
|
isVisible: this._config.backdrop,
|
|
3601
3689
|
isAnimated: true,
|
|
3602
3690
|
rootElement: this._element.parentNode,
|
|
@@ -3604,19 +3692,13 @@
|
|
|
3604
3692
|
});
|
|
3605
3693
|
}
|
|
3606
3694
|
|
|
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
|
-
}
|
|
3695
|
+
_initializeFocusTrap() {
|
|
3696
|
+
return new FocusTrap({
|
|
3697
|
+
trapElement: this._element
|
|
3614
3698
|
});
|
|
3615
|
-
element.focus();
|
|
3616
3699
|
}
|
|
3617
3700
|
|
|
3618
3701
|
_addEventListeners() {
|
|
3619
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
|
3620
3702
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
|
3621
3703
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
|
3622
3704
|
this.hide();
|
|
@@ -3677,6 +3759,7 @@
|
|
|
3677
3759
|
data.toggle(this);
|
|
3678
3760
|
});
|
|
3679
3761
|
EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
|
3762
|
+
enableDismissTrigger(Offcanvas);
|
|
3680
3763
|
/**
|
|
3681
3764
|
* ------------------------------------------------------------------------
|
|
3682
3765
|
* jQuery
|
|
@@ -3687,45 +3770,45 @@
|
|
|
3687
3770
|
|
|
3688
3771
|
/**
|
|
3689
3772
|
* --------------------------------------------------------------------------
|
|
3690
|
-
* CoreUI (v4.
|
|
3773
|
+
* CoreUI (v4.1.1): alert.js
|
|
3691
3774
|
* Licensed under MIT (https://coreui.io/license)
|
|
3692
3775
|
*
|
|
3693
3776
|
* This component is a modified version of the Bootstrap's util/sanitizer.js
|
|
3694
3777
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3695
3778
|
* --------------------------------------------------------------------------
|
|
3696
3779
|
*/
|
|
3697
|
-
const
|
|
3780
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
3698
3781
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
3699
3782
|
/**
|
|
3700
3783
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
3701
3784
|
*
|
|
3702
|
-
* Shoutout to Angular
|
|
3785
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
3703
3786
|
*/
|
|
3704
3787
|
|
|
3705
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
3788
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
3706
3789
|
/**
|
|
3707
3790
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
3708
3791
|
*
|
|
3709
|
-
* Shoutout to Angular
|
|
3792
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
3710
3793
|
*/
|
|
3711
3794
|
|
|
3712
3795
|
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
3796
|
|
|
3714
|
-
const allowedAttribute = (
|
|
3715
|
-
const
|
|
3797
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
3798
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
3716
3799
|
|
|
3717
|
-
if (allowedAttributeList.includes(
|
|
3718
|
-
if (
|
|
3719
|
-
return Boolean(SAFE_URL_PATTERN.test(
|
|
3800
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
3801
|
+
if (uriAttributes.has(attributeName)) {
|
|
3802
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
|
3720
3803
|
}
|
|
3721
3804
|
|
|
3722
3805
|
return true;
|
|
3723
3806
|
}
|
|
3724
3807
|
|
|
3725
|
-
const regExp = allowedAttributeList.filter(
|
|
3808
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
|
3726
3809
|
|
|
3727
3810
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
|
3728
|
-
if (regExp[i].test(
|
|
3811
|
+
if (regExp[i].test(attributeName)) {
|
|
3729
3812
|
return true;
|
|
3730
3813
|
}
|
|
3731
3814
|
}
|
|
@@ -3777,23 +3860,22 @@
|
|
|
3777
3860
|
|
|
3778
3861
|
const domParser = new window.DOMParser();
|
|
3779
3862
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
3780
|
-
const allowlistKeys = Object.keys(allowList);
|
|
3781
3863
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
3782
3864
|
|
|
3783
3865
|
for (let i = 0, len = elements.length; i < len; i++) {
|
|
3784
|
-
const
|
|
3785
|
-
const
|
|
3866
|
+
const element = elements[i];
|
|
3867
|
+
const elementName = element.nodeName.toLowerCase();
|
|
3786
3868
|
|
|
3787
|
-
if (!
|
|
3788
|
-
|
|
3869
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
3870
|
+
element.remove();
|
|
3789
3871
|
continue;
|
|
3790
3872
|
}
|
|
3791
3873
|
|
|
3792
|
-
const attributeList = [].concat(...
|
|
3793
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
|
3794
|
-
attributeList.forEach(
|
|
3795
|
-
if (!allowedAttribute(
|
|
3796
|
-
|
|
3874
|
+
const attributeList = [].concat(...element.attributes);
|
|
3875
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
|
3876
|
+
attributeList.forEach(attribute => {
|
|
3877
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
3878
|
+
element.removeAttribute(attribute.nodeName);
|
|
3797
3879
|
}
|
|
3798
3880
|
});
|
|
3799
3881
|
}
|
|
@@ -3803,7 +3885,7 @@
|
|
|
3803
3885
|
|
|
3804
3886
|
/**
|
|
3805
3887
|
* --------------------------------------------------------------------------
|
|
3806
|
-
* CoreUI (v4.
|
|
3888
|
+
* CoreUI (v4.1.1): tooltip.js
|
|
3807
3889
|
* Licensed under MIT (https://coreui.io/license)
|
|
3808
3890
|
*
|
|
3809
3891
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
@@ -3820,7 +3902,6 @@
|
|
|
3820
3902
|
const DATA_KEY$5 = 'coreui.tooltip';
|
|
3821
3903
|
const EVENT_KEY$5 = `.${DATA_KEY$5}`;
|
|
3822
3904
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
|
3823
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
|
3824
3905
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
3825
3906
|
const DefaultType$4 = {
|
|
3826
3907
|
animation: 'boolean',
|
|
@@ -3879,12 +3960,14 @@
|
|
|
3879
3960
|
MOUSEENTER: `mouseenter${EVENT_KEY$5}`,
|
|
3880
3961
|
MOUSELEAVE: `mouseleave${EVENT_KEY$5}`
|
|
3881
3962
|
};
|
|
3882
|
-
const CLASS_NAME_FADE$
|
|
3963
|
+
const CLASS_NAME_FADE$2 = 'fade';
|
|
3883
3964
|
const CLASS_NAME_MODAL = 'modal';
|
|
3884
|
-
const CLASS_NAME_SHOW$
|
|
3965
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
|
3885
3966
|
const HOVER_STATE_SHOW = 'show';
|
|
3886
3967
|
const HOVER_STATE_OUT = 'out';
|
|
3887
3968
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
3969
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
3970
|
+
const EVENT_MODAL_HIDE = 'hide.coreui.modal';
|
|
3888
3971
|
const TRIGGER_HOVER = 'hover';
|
|
3889
3972
|
const TRIGGER_FOCUS = 'focus';
|
|
3890
3973
|
const TRIGGER_CLICK = 'click';
|
|
@@ -3961,7 +4044,7 @@
|
|
|
3961
4044
|
context._leave(null, context);
|
|
3962
4045
|
}
|
|
3963
4046
|
} else {
|
|
3964
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
4047
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
|
|
3965
4048
|
this._leave(null, this);
|
|
3966
4049
|
|
|
3967
4050
|
return;
|
|
@@ -3973,15 +4056,13 @@
|
|
|
3973
4056
|
|
|
3974
4057
|
dispose() {
|
|
3975
4058
|
clearTimeout(this._timeout);
|
|
3976
|
-
EventHandler.off(this._element.closest(
|
|
4059
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
3977
4060
|
|
|
3978
4061
|
if (this.tip) {
|
|
3979
4062
|
this.tip.remove();
|
|
3980
4063
|
}
|
|
3981
4064
|
|
|
3982
|
-
|
|
3983
|
-
this._popper.destroy();
|
|
3984
|
-
}
|
|
4065
|
+
this._disposePopper();
|
|
3985
4066
|
|
|
3986
4067
|
super.dispose();
|
|
3987
4068
|
}
|
|
@@ -4001,6 +4082,15 @@
|
|
|
4001
4082
|
|
|
4002
4083
|
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
4003
4084
|
return;
|
|
4085
|
+
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-coreui-original-title`
|
|
4086
|
+
// This will be removed later in favor of a `setContent` method
|
|
4087
|
+
|
|
4088
|
+
|
|
4089
|
+
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
|
4090
|
+
this._disposePopper();
|
|
4091
|
+
|
|
4092
|
+
this.tip.remove();
|
|
4093
|
+
this.tip = null;
|
|
4004
4094
|
}
|
|
4005
4095
|
|
|
4006
4096
|
const tip = this.getTipElement();
|
|
@@ -4009,10 +4099,8 @@
|
|
|
4009
4099
|
|
|
4010
4100
|
this._element.setAttribute('aria-describedby', tipId);
|
|
4011
4101
|
|
|
4012
|
-
this.setContent();
|
|
4013
|
-
|
|
4014
4102
|
if (this._config.animation) {
|
|
4015
|
-
tip.classList.add(CLASS_NAME_FADE$
|
|
4103
|
+
tip.classList.add(CLASS_NAME_FADE$2);
|
|
4016
4104
|
}
|
|
4017
4105
|
|
|
4018
4106
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
|
@@ -4027,7 +4115,7 @@
|
|
|
4027
4115
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
|
4028
4116
|
|
|
4029
4117
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
4030
|
-
container.
|
|
4118
|
+
container.append(tip);
|
|
4031
4119
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
|
4032
4120
|
}
|
|
4033
4121
|
|
|
@@ -4037,8 +4125,9 @@
|
|
|
4037
4125
|
this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
4038
4126
|
}
|
|
4039
4127
|
|
|
4040
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
|
4041
|
-
|
|
4128
|
+
tip.classList.add(CLASS_NAME_SHOW$3);
|
|
4129
|
+
|
|
4130
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
|
4042
4131
|
|
|
4043
4132
|
if (customClass) {
|
|
4044
4133
|
tip.classList.add(...customClass.split(' '));
|
|
@@ -4064,7 +4153,7 @@
|
|
|
4064
4153
|
}
|
|
4065
4154
|
};
|
|
4066
4155
|
|
|
4067
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
4156
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
4068
4157
|
|
|
4069
4158
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
4070
4159
|
}
|
|
@@ -4091,11 +4180,7 @@
|
|
|
4091
4180
|
|
|
4092
4181
|
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
|
4093
4182
|
|
|
4094
|
-
|
|
4095
|
-
this._popper.destroy();
|
|
4096
|
-
|
|
4097
|
-
this._popper = null;
|
|
4098
|
-
}
|
|
4183
|
+
this._disposePopper();
|
|
4099
4184
|
};
|
|
4100
4185
|
|
|
4101
4186
|
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
|
@@ -4104,7 +4189,7 @@
|
|
|
4104
4189
|
return;
|
|
4105
4190
|
}
|
|
4106
4191
|
|
|
4107
|
-
tip.classList.remove(CLASS_NAME_SHOW$
|
|
4192
|
+
tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
|
|
4108
4193
|
// empty mouseover listeners we added for iOS support
|
|
4109
4194
|
|
|
4110
4195
|
if ('ontouchstart' in document.documentElement) {
|
|
@@ -4114,7 +4199,7 @@
|
|
|
4114
4199
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
4115
4200
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
4116
4201
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
4117
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
4202
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
4118
4203
|
|
|
4119
4204
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
4120
4205
|
|
|
@@ -4139,14 +4224,27 @@
|
|
|
4139
4224
|
|
|
4140
4225
|
const element = document.createElement('div');
|
|
4141
4226
|
element.innerHTML = this._config.template;
|
|
4142
|
-
|
|
4227
|
+
const tip = element.children[0];
|
|
4228
|
+
this.setContent(tip);
|
|
4229
|
+
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$3);
|
|
4230
|
+
this.tip = tip;
|
|
4143
4231
|
return this.tip;
|
|
4144
4232
|
}
|
|
4145
4233
|
|
|
4146
|
-
setContent() {
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4234
|
+
setContent(tip) {
|
|
4235
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
|
|
4236
|
+
}
|
|
4237
|
+
|
|
4238
|
+
_sanitizeAndSetContent(template, content, selector) {
|
|
4239
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
|
4240
|
+
|
|
4241
|
+
if (!content && templateElement) {
|
|
4242
|
+
templateElement.remove();
|
|
4243
|
+
return;
|
|
4244
|
+
} // we use append for html objects to maintain js events
|
|
4245
|
+
|
|
4246
|
+
|
|
4247
|
+
this.setElementContent(templateElement, content);
|
|
4150
4248
|
}
|
|
4151
4249
|
|
|
4152
4250
|
setElementContent(element, content) {
|
|
@@ -4160,7 +4258,7 @@
|
|
|
4160
4258
|
if (this._config.html) {
|
|
4161
4259
|
if (content.parentNode !== element) {
|
|
4162
4260
|
element.innerHTML = '';
|
|
4163
|
-
element.
|
|
4261
|
+
element.append(content);
|
|
4164
4262
|
}
|
|
4165
4263
|
} else {
|
|
4166
4264
|
element.textContent = content.textContent;
|
|
@@ -4181,13 +4279,9 @@
|
|
|
4181
4279
|
}
|
|
4182
4280
|
|
|
4183
4281
|
getTitle() {
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
if (!title) {
|
|
4187
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
|
4188
|
-
}
|
|
4282
|
+
const title = this._element.getAttribute('data-coreui-original-title') || this._config.title;
|
|
4189
4283
|
|
|
4190
|
-
return title;
|
|
4284
|
+
return this._resolvePossibleFunction(title);
|
|
4191
4285
|
}
|
|
4192
4286
|
|
|
4193
4287
|
updateAttachment(attachment) {
|
|
@@ -4204,15 +4298,7 @@
|
|
|
4204
4298
|
|
|
4205
4299
|
|
|
4206
4300
|
_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;
|
|
4301
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
|
4216
4302
|
}
|
|
4217
4303
|
|
|
4218
4304
|
_getOffset() {
|
|
@@ -4231,6 +4317,10 @@
|
|
|
4231
4317
|
return offset;
|
|
4232
4318
|
}
|
|
4233
4319
|
|
|
4320
|
+
_resolvePossibleFunction(content) {
|
|
4321
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
|
4322
|
+
}
|
|
4323
|
+
|
|
4234
4324
|
_getPopperConfig(attachment) {
|
|
4235
4325
|
const defaultBsPopperConfig = {
|
|
4236
4326
|
placement: attachment,
|
|
@@ -4272,7 +4362,7 @@
|
|
|
4272
4362
|
}
|
|
4273
4363
|
|
|
4274
4364
|
_addAttachmentClass(attachment) {
|
|
4275
|
-
this.getTipElement().classList.add(`${
|
|
4365
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
|
4276
4366
|
}
|
|
4277
4367
|
|
|
4278
4368
|
_getAttachment(placement) {
|
|
@@ -4299,7 +4389,7 @@
|
|
|
4299
4389
|
}
|
|
4300
4390
|
};
|
|
4301
4391
|
|
|
4302
|
-
EventHandler.on(this._element.closest(
|
|
4392
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
4303
4393
|
|
|
4304
4394
|
if (this._config.selector) {
|
|
4305
4395
|
this._config = { ...this._config,
|
|
@@ -4334,7 +4424,7 @@
|
|
|
4334
4424
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
4335
4425
|
}
|
|
4336
4426
|
|
|
4337
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
4427
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
|
|
4338
4428
|
context._hoverState = HOVER_STATE_SHOW;
|
|
4339
4429
|
return;
|
|
4340
4430
|
}
|
|
@@ -4430,26 +4520,32 @@
|
|
|
4430
4520
|
_getDelegateConfig() {
|
|
4431
4521
|
const config = {};
|
|
4432
4522
|
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
config[key] = this._config[key];
|
|
4437
|
-
}
|
|
4523
|
+
for (const key in this._config) {
|
|
4524
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
|
4525
|
+
config[key] = this._config[key];
|
|
4438
4526
|
}
|
|
4439
|
-
}
|
|
4527
|
+
} // In the future can be replaced with:
|
|
4528
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
|
4529
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
|
4530
|
+
|
|
4440
4531
|
|
|
4441
4532
|
return config;
|
|
4442
4533
|
}
|
|
4443
4534
|
|
|
4444
4535
|
_cleanTipClass() {
|
|
4445
4536
|
const tip = this.getTipElement();
|
|
4446
|
-
const
|
|
4537
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
|
4538
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
|
4447
4539
|
|
|
4448
4540
|
if (tabClass !== null && tabClass.length > 0) {
|
|
4449
4541
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
4450
4542
|
}
|
|
4451
4543
|
}
|
|
4452
4544
|
|
|
4545
|
+
_getBasicClassPrefix() {
|
|
4546
|
+
return CLASS_PREFIX$1;
|
|
4547
|
+
}
|
|
4548
|
+
|
|
4453
4549
|
_handlePopperPlacementChange(popperData) {
|
|
4454
4550
|
const {
|
|
4455
4551
|
state
|
|
@@ -4464,6 +4560,14 @@
|
|
|
4464
4560
|
this._cleanTipClass();
|
|
4465
4561
|
|
|
4466
4562
|
this._addAttachmentClass(this._getAttachment(state.placement));
|
|
4563
|
+
}
|
|
4564
|
+
|
|
4565
|
+
_disposePopper() {
|
|
4566
|
+
if (this._popper) {
|
|
4567
|
+
this._popper.destroy();
|
|
4568
|
+
|
|
4569
|
+
this._popper = null;
|
|
4570
|
+
}
|
|
4467
4571
|
} // Static
|
|
4468
4572
|
|
|
4469
4573
|
|
|
@@ -4494,7 +4598,7 @@
|
|
|
4494
4598
|
|
|
4495
4599
|
/**
|
|
4496
4600
|
* --------------------------------------------------------------------------
|
|
4497
|
-
* CoreUI (v4.
|
|
4601
|
+
* CoreUI (v4.1.1): popover.js
|
|
4498
4602
|
* Licensed under MIT (https://coreui.io/license)
|
|
4499
4603
|
*
|
|
4500
4604
|
* This component is a modified version of the Bootstrap's popover.js
|
|
@@ -4511,7 +4615,6 @@
|
|
|
4511
4615
|
const DATA_KEY$4 = 'coreui.popover';
|
|
4512
4616
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
|
4513
4617
|
const CLASS_PREFIX = 'bs-popover';
|
|
4514
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
|
4515
4618
|
const Default$3 = { ...Tooltip.Default,
|
|
4516
4619
|
placement: 'right',
|
|
4517
4620
|
offset: [0, 8],
|
|
@@ -4534,8 +4637,6 @@
|
|
|
4534
4637
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
|
4535
4638
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
|
4536
4639
|
};
|
|
4537
|
-
const CLASS_NAME_FADE$3 = 'fade';
|
|
4538
|
-
const CLASS_NAME_SHOW$3 = 'show';
|
|
4539
4640
|
const SELECTOR_TITLE = '.popover-header';
|
|
4540
4641
|
const SELECTOR_CONTENT = '.popover-body';
|
|
4541
4642
|
/**
|
|
@@ -4567,55 +4668,19 @@
|
|
|
4567
4668
|
return this.getTitle() || this._getContent();
|
|
4568
4669
|
}
|
|
4569
4670
|
|
|
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
|
|
4671
|
+
setContent(tip) {
|
|
4672
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
|
4590
4673
|
|
|
4591
|
-
this.
|
|
4592
|
-
|
|
4593
|
-
let content = this._getContent();
|
|
4594
|
-
|
|
4595
|
-
if (typeof content === 'function') {
|
|
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);
|
|
4674
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
|
4601
4675
|
} // Private
|
|
4602
4676
|
|
|
4603
4677
|
|
|
4604
|
-
_addAttachmentClass(attachment) {
|
|
4605
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
|
4606
|
-
}
|
|
4607
|
-
|
|
4608
4678
|
_getContent() {
|
|
4609
|
-
return this.
|
|
4679
|
+
return this._resolvePossibleFunction(this._config.content);
|
|
4610
4680
|
}
|
|
4611
4681
|
|
|
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
|
-
}
|
|
4682
|
+
_getBasicClassPrefix() {
|
|
4683
|
+
return CLASS_PREFIX;
|
|
4619
4684
|
} // Static
|
|
4620
4685
|
|
|
4621
4686
|
|
|
@@ -4646,7 +4711,7 @@
|
|
|
4646
4711
|
|
|
4647
4712
|
/**
|
|
4648
4713
|
* --------------------------------------------------------------------------
|
|
4649
|
-
* CoreUI (v4.
|
|
4714
|
+
* CoreUI (v4.1.1): scrollspy.js
|
|
4650
4715
|
* Licensed under MIT (https://coreui.io/license)
|
|
4651
4716
|
*
|
|
4652
4717
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
@@ -4884,7 +4949,7 @@
|
|
|
4884
4949
|
|
|
4885
4950
|
/**
|
|
4886
4951
|
* --------------------------------------------------------------------------
|
|
4887
|
-
* CoreUI (v4.
|
|
4952
|
+
* CoreUI (v4.1.1): sidebar.js
|
|
4888
4953
|
* Licensed under MIT (https://coreui.io/license)
|
|
4889
4954
|
* --------------------------------------------------------------------------
|
|
4890
4955
|
*/
|
|
@@ -4901,7 +4966,6 @@
|
|
|
4901
4966
|
const Default$1 = {};
|
|
4902
4967
|
const DefaultType$1 = {};
|
|
4903
4968
|
const CLASS_NAME_BACKDROP = 'sidebar-backdrop';
|
|
4904
|
-
const CLASS_NAME_FADE$2 = 'fade';
|
|
4905
4969
|
const CLASS_NAME_HIDE$1 = 'hide';
|
|
4906
4970
|
const CLASS_NAME_SHOW$2 = 'show';
|
|
4907
4971
|
const CLASS_NAME_SIDEBAR_NARROW = 'sidebar-narrow';
|
|
@@ -4932,7 +4996,7 @@
|
|
|
4932
4996
|
this._overlaid = this._isOverlaid();
|
|
4933
4997
|
this._narrow = this._isNarrow();
|
|
4934
4998
|
this._unfoldable = this._isUnfoldable();
|
|
4935
|
-
this._backdrop =
|
|
4999
|
+
this._backdrop = this._initializeBackDrop();
|
|
4936
5000
|
|
|
4937
5001
|
this._addEventListeners();
|
|
4938
5002
|
} // Getters
|
|
@@ -4961,7 +5025,9 @@
|
|
|
4961
5025
|
if (this._isMobile()) {
|
|
4962
5026
|
this._element.classList.add(CLASS_NAME_SHOW$2);
|
|
4963
5027
|
|
|
4964
|
-
this.
|
|
5028
|
+
this._backdrop.show();
|
|
5029
|
+
|
|
5030
|
+
new ScrollBarHelper().hide();
|
|
4965
5031
|
}
|
|
4966
5032
|
|
|
4967
5033
|
const complete = () => {
|
|
@@ -4987,7 +5053,9 @@
|
|
|
4987
5053
|
}
|
|
4988
5054
|
|
|
4989
5055
|
if (this._isMobile()) {
|
|
4990
|
-
this.
|
|
5056
|
+
this._backdrop.hide();
|
|
5057
|
+
|
|
5058
|
+
new ScrollBarHelper().reset();
|
|
4991
5059
|
} else {
|
|
4992
5060
|
this._element.classList.add(CLASS_NAME_HIDE$1);
|
|
4993
5061
|
}
|
|
@@ -5076,6 +5144,16 @@
|
|
|
5076
5144
|
return config;
|
|
5077
5145
|
}
|
|
5078
5146
|
|
|
5147
|
+
_initializeBackDrop() {
|
|
5148
|
+
return new Backdrop({
|
|
5149
|
+
className: CLASS_NAME_BACKDROP,
|
|
5150
|
+
isVisible: this._isMobile(),
|
|
5151
|
+
isAnimated: true,
|
|
5152
|
+
rootElement: this._element.parentNode,
|
|
5153
|
+
clickCallback: () => this.hide()
|
|
5154
|
+
});
|
|
5155
|
+
}
|
|
5156
|
+
|
|
5079
5157
|
_isMobile() {
|
|
5080
5158
|
return Boolean(window.getComputedStyle(this._element, null).getPropertyValue('--cui-is-mobile'));
|
|
5081
5159
|
}
|
|
@@ -5095,35 +5173,13 @@
|
|
|
5095
5173
|
_isVisible() {
|
|
5096
5174
|
const rect = this._element.getBoundingClientRect();
|
|
5097
5175
|
|
|
5098
|
-
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
5176
|
+
return rect.top >= 0 && rect.left >= 0 && Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) && Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth);
|
|
5099
5177
|
}
|
|
5100
5178
|
|
|
5101
5179
|
_addClassName(className) {
|
|
5102
5180
|
this._element.classList.add(className);
|
|
5103
5181
|
}
|
|
5104
5182
|
|
|
5105
|
-
_removeBackdrop() {
|
|
5106
|
-
if (this._backdrop) {
|
|
5107
|
-
this._backdrop.parentNode.removeChild(this._backdrop);
|
|
5108
|
-
|
|
5109
|
-
this._backdrop = null;
|
|
5110
|
-
}
|
|
5111
|
-
}
|
|
5112
|
-
|
|
5113
|
-
_showBackdrop() {
|
|
5114
|
-
if (!this._backdrop) {
|
|
5115
|
-
this._backdrop = document.createElement('div');
|
|
5116
|
-
this._backdrop.className = CLASS_NAME_BACKDROP;
|
|
5117
|
-
|
|
5118
|
-
this._backdrop.classList.add(CLASS_NAME_FADE$2);
|
|
5119
|
-
|
|
5120
|
-
document.body.appendChild(this._backdrop);
|
|
5121
|
-
reflow(this._backdrop);
|
|
5122
|
-
|
|
5123
|
-
this._backdrop.classList.add(CLASS_NAME_SHOW$2);
|
|
5124
|
-
}
|
|
5125
|
-
}
|
|
5126
|
-
|
|
5127
5183
|
_clickOutListener(event, sidebar) {
|
|
5128
5184
|
if (event.target.closest(SELECTOR_SIDEBAR) === null) {
|
|
5129
5185
|
event.preventDefault();
|
|
@@ -5171,6 +5227,7 @@
|
|
|
5171
5227
|
EventHandler.on(window, EVENT_RESIZE, () => {
|
|
5172
5228
|
if (this._isMobile() && this._isVisible()) {
|
|
5173
5229
|
this.hide();
|
|
5230
|
+
this._backdrop = this._initializeBackDrop();
|
|
5174
5231
|
}
|
|
5175
5232
|
});
|
|
5176
5233
|
} // Static
|
|
@@ -5213,11 +5270,11 @@
|
|
|
5213
5270
|
* ------------------------------------------------------------------------
|
|
5214
5271
|
*/
|
|
5215
5272
|
|
|
5216
|
-
defineJQueryPlugin(
|
|
5273
|
+
defineJQueryPlugin(Sidebar);
|
|
5217
5274
|
|
|
5218
5275
|
/**
|
|
5219
5276
|
* --------------------------------------------------------------------------
|
|
5220
|
-
* CoreUI (v4.
|
|
5277
|
+
* CoreUI (v4.1.1): tab.js
|
|
5221
5278
|
* Licensed under MIT (https://coreui.io/license)
|
|
5222
5279
|
*
|
|
5223
5280
|
* This component is a modified version of the Bootstrap's tab.js
|
|
@@ -5418,7 +5475,7 @@
|
|
|
5418
5475
|
|
|
5419
5476
|
/**
|
|
5420
5477
|
* --------------------------------------------------------------------------
|
|
5421
|
-
* CoreUI (v4.
|
|
5478
|
+
* CoreUI (v4.1.1): toast.js
|
|
5422
5479
|
* Licensed under MIT (https://coreui.io/license)
|
|
5423
5480
|
*
|
|
5424
5481
|
* This component is a modified version of the Bootstrap's toast.js
|
|
@@ -5434,7 +5491,6 @@
|
|
|
5434
5491
|
const NAME = 'toast';
|
|
5435
5492
|
const DATA_KEY = 'coreui.toast';
|
|
5436
5493
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
5437
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
|
5438
5494
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
|
5439
5495
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
|
5440
5496
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
|
@@ -5444,7 +5500,8 @@
|
|
|
5444
5500
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
5445
5501
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
5446
5502
|
const CLASS_NAME_FADE = 'fade';
|
|
5447
|
-
const CLASS_NAME_HIDE = 'hide';
|
|
5503
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
|
5504
|
+
|
|
5448
5505
|
const CLASS_NAME_SHOW = 'show';
|
|
5449
5506
|
const CLASS_NAME_SHOWING = 'showing';
|
|
5450
5507
|
const DefaultType = {
|
|
@@ -5457,7 +5514,6 @@
|
|
|
5457
5514
|
autohide: true,
|
|
5458
5515
|
delay: 5000
|
|
5459
5516
|
};
|
|
5460
|
-
const SELECTOR_DATA_DISMISS = '[data-coreui-dismiss="toast"]';
|
|
5461
5517
|
/**
|
|
5462
5518
|
* ------------------------------------------------------------------------
|
|
5463
5519
|
* Class Definition
|
|
@@ -5505,17 +5561,18 @@
|
|
|
5505
5561
|
const complete = () => {
|
|
5506
5562
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
5507
5563
|
|
|
5508
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
5509
|
-
|
|
5510
5564
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
|
5511
5565
|
|
|
5512
5566
|
this._maybeScheduleHide();
|
|
5513
5567
|
};
|
|
5514
5568
|
|
|
5515
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
|
5569
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
|
5570
|
+
|
|
5516
5571
|
|
|
5517
5572
|
reflow(this._element);
|
|
5518
5573
|
|
|
5574
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
5575
|
+
|
|
5519
5576
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
5520
5577
|
|
|
5521
5578
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
@@ -5533,12 +5590,17 @@
|
|
|
5533
5590
|
}
|
|
5534
5591
|
|
|
5535
5592
|
const complete = () => {
|
|
5536
|
-
this._element.classList.add(CLASS_NAME_HIDE);
|
|
5593
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
|
5594
|
+
|
|
5595
|
+
|
|
5596
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
5597
|
+
|
|
5598
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
5537
5599
|
|
|
5538
5600
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
|
5539
5601
|
};
|
|
5540
5602
|
|
|
5541
|
-
this._element.classList.
|
|
5603
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
5542
5604
|
|
|
5543
5605
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
5544
5606
|
}
|
|
@@ -5606,7 +5668,6 @@
|
|
|
5606
5668
|
}
|
|
5607
5669
|
|
|
5608
5670
|
_setListeners() {
|
|
5609
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
|
5610
5671
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
|
5611
5672
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
|
5612
5673
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
|
@@ -5634,6 +5695,8 @@
|
|
|
5634
5695
|
}
|
|
5635
5696
|
|
|
5636
5697
|
}
|
|
5698
|
+
|
|
5699
|
+
enableDismissTrigger(Toast);
|
|
5637
5700
|
/**
|
|
5638
5701
|
* ------------------------------------------------------------------------
|
|
5639
5702
|
* jQuery
|
|
@@ -5641,16 +5704,15 @@
|
|
|
5641
5704
|
* add .Toast to jQuery only if jQuery is present
|
|
5642
5705
|
*/
|
|
5643
5706
|
|
|
5644
|
-
|
|
5645
5707
|
defineJQueryPlugin(Toast);
|
|
5646
5708
|
|
|
5647
5709
|
/**
|
|
5648
5710
|
* --------------------------------------------------------------------------
|
|
5649
|
-
* CoreUI (v4.
|
|
5711
|
+
* CoreUI (v4.1.1): index.esm.js
|
|
5650
5712
|
* Licensed under MIT (https://coreui.io/license)
|
|
5651
5713
|
* --------------------------------------------------------------------------
|
|
5652
5714
|
*/
|
|
5653
|
-
|
|
5715
|
+
const index_umd = {
|
|
5654
5716
|
Alert,
|
|
5655
5717
|
Button,
|
|
5656
5718
|
Carousel,
|
|
@@ -5669,5 +5731,5 @@
|
|
|
5669
5731
|
|
|
5670
5732
|
return index_umd;
|
|
5671
5733
|
|
|
5672
|
-
}))
|
|
5734
|
+
}));
|
|
5673
5735
|
//# sourceMappingURL=coreui.js.map
|