@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.bundle.js
CHANGED
|
@@ -1,108 +1,33 @@
|
|
|
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() :
|
|
8
8
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
9
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.coreui = factory());
|
|
10
|
-
}(this, (function () { 'use strict';
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* --------------------------------------------------------------------------
|
|
14
|
-
* CoreUI (v4.
|
|
15
|
-
* Licensed under MIT (https://coreui.io/license)
|
|
16
|
-
*
|
|
17
|
-
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
18
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
19
|
-
* --------------------------------------------------------------------------
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* ------------------------------------------------------------------------
|
|
24
|
-
* Constants
|
|
25
|
-
* ------------------------------------------------------------------------
|
|
26
|
-
*/
|
|
27
|
-
const NODE_TEXT = 3;
|
|
28
|
-
const SelectorEngine = {
|
|
29
|
-
find(selector, element = document.documentElement) {
|
|
30
|
-
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
findOne(selector, element = document.documentElement) {
|
|
34
|
-
return Element.prototype.querySelector.call(element, selector);
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
children(element, selector) {
|
|
38
|
-
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
parents(element, selector) {
|
|
42
|
-
const parents = [];
|
|
43
|
-
let ancestor = element.parentNode;
|
|
44
|
-
|
|
45
|
-
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
46
|
-
if (ancestor.matches(selector)) {
|
|
47
|
-
parents.push(ancestor);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
ancestor = ancestor.parentNode;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return parents;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
prev(element, selector) {
|
|
57
|
-
let previous = element.previousElementSibling;
|
|
58
|
-
|
|
59
|
-
while (previous) {
|
|
60
|
-
if (previous.matches(selector)) {
|
|
61
|
-
return [previous];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
previous = previous.previousElementSibling;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return [];
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
next(element, selector) {
|
|
71
|
-
let next = element.nextElementSibling;
|
|
72
|
-
|
|
73
|
-
while (next) {
|
|
74
|
-
if (next.matches(selector)) {
|
|
75
|
-
return [next];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
next = next.nextElementSibling;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* --------------------------------------------------------------------------
|
|
88
|
-
* CoreUI (v4.0.4): alert.js
|
|
14
|
+
* CoreUI (v4.1.1): alert.js
|
|
89
15
|
* Licensed under MIT (https://coreui.io/license)
|
|
90
16
|
*
|
|
91
17
|
* This component is a modified version of the Bootstrap's util/index.js
|
|
92
18
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
93
19
|
* --------------------------------------------------------------------------
|
|
94
20
|
*/
|
|
95
|
-
|
|
96
21
|
const MAX_UID = 1000000;
|
|
97
22
|
const MILLISECONDS_MULTIPLIER = 1000;
|
|
98
23
|
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
|
99
24
|
|
|
100
|
-
const toType =
|
|
101
|
-
if (
|
|
102
|
-
return `${
|
|
25
|
+
const toType = object => {
|
|
26
|
+
if (object === null || object === undefined) {
|
|
27
|
+
return `${object}`;
|
|
103
28
|
}
|
|
104
29
|
|
|
105
|
-
return
|
|
30
|
+
return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
|
|
106
31
|
};
|
|
107
32
|
/**
|
|
108
33
|
* --------------------------------------------------------------------------
|
|
@@ -204,7 +129,7 @@
|
|
|
204
129
|
}
|
|
205
130
|
|
|
206
131
|
if (typeof obj === 'string' && obj.length > 0) {
|
|
207
|
-
return
|
|
132
|
+
return document.querySelector(obj);
|
|
208
133
|
}
|
|
209
134
|
|
|
210
135
|
return null;
|
|
@@ -227,7 +152,27 @@
|
|
|
227
152
|
return false;
|
|
228
153
|
}
|
|
229
154
|
|
|
230
|
-
|
|
155
|
+
const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; // Handle `details` element as its content may falsie appear visible when it is closed
|
|
156
|
+
|
|
157
|
+
const closedDetails = element.closest('details:not([open])');
|
|
158
|
+
|
|
159
|
+
if (!closedDetails) {
|
|
160
|
+
return elementIsVisible;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (closedDetails !== element) {
|
|
164
|
+
const summary = element.closest('summary');
|
|
165
|
+
|
|
166
|
+
if (summary && summary.parentNode !== closedDetails) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (summary === null) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return elementIsVisible;
|
|
231
176
|
};
|
|
232
177
|
|
|
233
178
|
const isDisabled = element => {
|
|
@@ -270,8 +215,20 @@
|
|
|
270
215
|
};
|
|
271
216
|
|
|
272
217
|
const noop = () => {};
|
|
218
|
+
/**
|
|
219
|
+
* Trick to restart an element's animation
|
|
220
|
+
*
|
|
221
|
+
* @param {HTMLElement} element
|
|
222
|
+
* @return void
|
|
223
|
+
*
|
|
224
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
|
225
|
+
*/
|
|
226
|
+
|
|
273
227
|
|
|
274
|
-
const reflow = element =>
|
|
228
|
+
const reflow = element => {
|
|
229
|
+
// eslint-disable-next-line no-unused-expressions
|
|
230
|
+
element.offsetHeight;
|
|
231
|
+
};
|
|
275
232
|
|
|
276
233
|
const getjQuery = () => {
|
|
277
234
|
const {
|
|
@@ -388,7 +345,7 @@
|
|
|
388
345
|
|
|
389
346
|
/**
|
|
390
347
|
* --------------------------------------------------------------------------
|
|
391
|
-
* CoreUI (v4.
|
|
348
|
+
* CoreUI (v4.1.1): dom/event-handler.js
|
|
392
349
|
* Licensed under MIT (https://coreui.io/license)
|
|
393
350
|
*
|
|
394
351
|
* This component is a modified version of the Bootstrap's dom/event-handler.js
|
|
@@ -454,7 +411,6 @@
|
|
|
454
411
|
event.delegateTarget = target;
|
|
455
412
|
|
|
456
413
|
if (handler.oneOff) {
|
|
457
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
458
414
|
EventHandler.off(element, event.type, selector, fn);
|
|
459
415
|
}
|
|
460
416
|
|
|
@@ -680,7 +636,7 @@
|
|
|
680
636
|
|
|
681
637
|
/**
|
|
682
638
|
* --------------------------------------------------------------------------
|
|
683
|
-
* CoreUI (v4.
|
|
639
|
+
* CoreUI (v4.1.1): dom/data.js
|
|
684
640
|
* Licensed under MIT (https://coreui.io/license)
|
|
685
641
|
*
|
|
686
642
|
* This component is a modified version of the Bootstrap's dom/data.js
|
|
@@ -694,7 +650,7 @@
|
|
|
694
650
|
* ------------------------------------------------------------------------
|
|
695
651
|
*/
|
|
696
652
|
const elementMap = new Map();
|
|
697
|
-
|
|
653
|
+
const Data = {
|
|
698
654
|
set(element, key, instance) {
|
|
699
655
|
if (!elementMap.has(element)) {
|
|
700
656
|
elementMap.set(element, new Map());
|
|
@@ -737,7 +693,7 @@
|
|
|
737
693
|
|
|
738
694
|
/**
|
|
739
695
|
* --------------------------------------------------------------------------
|
|
740
|
-
* CoreUI (v4.
|
|
696
|
+
* CoreUI (v4.1.1): alert.js
|
|
741
697
|
* Licensed under MIT (https://coreui.io/license)
|
|
742
698
|
*
|
|
743
699
|
* This component is a modified version of the Bootstrap's base-component.js
|
|
@@ -750,7 +706,7 @@
|
|
|
750
706
|
* ------------------------------------------------------------------------
|
|
751
707
|
*/
|
|
752
708
|
|
|
753
|
-
const VERSION = '4.
|
|
709
|
+
const VERSION = '4.1.1';
|
|
754
710
|
|
|
755
711
|
class BaseComponent {
|
|
756
712
|
constructor(element) {
|
|
@@ -779,7 +735,7 @@
|
|
|
779
735
|
|
|
780
736
|
|
|
781
737
|
static getInstance(element) {
|
|
782
|
-
return Data.get(element, this.DATA_KEY);
|
|
738
|
+
return Data.get(getElement(element), this.DATA_KEY);
|
|
783
739
|
}
|
|
784
740
|
|
|
785
741
|
static getOrCreateInstance(element, config = {}) {
|
|
@@ -806,7 +762,33 @@
|
|
|
806
762
|
|
|
807
763
|
/**
|
|
808
764
|
* --------------------------------------------------------------------------
|
|
809
|
-
*
|
|
765
|
+
* Bootstrap (v5.1.3): util/component-functions.js
|
|
766
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
767
|
+
* --------------------------------------------------------------------------
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
const enableDismissTrigger = (component, method = 'hide') => {
|
|
771
|
+
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
772
|
+
const name = component.NAME;
|
|
773
|
+
EventHandler.on(document, clickEvent, `[data-coreui-dismiss="${name}"]`, function (event) {
|
|
774
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
775
|
+
event.preventDefault();
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (isDisabled(this)) {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
783
|
+
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
784
|
+
|
|
785
|
+
instance[method]();
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* --------------------------------------------------------------------------
|
|
791
|
+
* CoreUI (v4.1.1): alert.js
|
|
810
792
|
* Licensed under MIT (https://coreui.io/license)
|
|
811
793
|
*
|
|
812
794
|
* This component is a modified version of the Bootstrap's alert.js
|
|
@@ -819,17 +801,13 @@
|
|
|
819
801
|
* ------------------------------------------------------------------------
|
|
820
802
|
*/
|
|
821
803
|
|
|
822
|
-
const NAME$
|
|
823
|
-
const DATA_KEY$
|
|
824
|
-
const EVENT_KEY$
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
const EVENT_CLICK_DATA_API$9 = `click${EVENT_KEY$d}${DATA_API_KEY$a}`;
|
|
830
|
-
const CLASS_NAME_ALERT = 'alert';
|
|
831
|
-
const CLASS_NAME_FADE$7 = 'fade';
|
|
832
|
-
const CLASS_NAME_SHOW$b = 'show';
|
|
804
|
+
const NAME$f = 'alert';
|
|
805
|
+
const DATA_KEY$e = 'coreui.alert';
|
|
806
|
+
const EVENT_KEY$e = `.${DATA_KEY$e}`;
|
|
807
|
+
const EVENT_CLOSE = `close${EVENT_KEY$e}`;
|
|
808
|
+
const EVENT_CLOSED = `closed${EVENT_KEY$e}`;
|
|
809
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
|
810
|
+
const CLASS_NAME_SHOW$a = 'show';
|
|
833
811
|
/**
|
|
834
812
|
* ------------------------------------------------------------------------
|
|
835
813
|
* Class Definition
|
|
@@ -839,41 +817,30 @@
|
|
|
839
817
|
class Alert extends BaseComponent {
|
|
840
818
|
// Getters
|
|
841
819
|
static get NAME() {
|
|
842
|
-
return NAME$
|
|
820
|
+
return NAME$f;
|
|
843
821
|
} // Public
|
|
844
822
|
|
|
845
823
|
|
|
846
|
-
close(
|
|
847
|
-
const
|
|
824
|
+
close() {
|
|
825
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
848
826
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
if (customEvent === null || customEvent.defaultPrevented) {
|
|
827
|
+
if (closeEvent.defaultPrevented) {
|
|
852
828
|
return;
|
|
853
829
|
}
|
|
854
830
|
|
|
855
|
-
this.
|
|
856
|
-
} // Private
|
|
831
|
+
this._element.classList.remove(CLASS_NAME_SHOW$a);
|
|
857
832
|
|
|
833
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
|
|
858
834
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
_triggerCloseEvent(element) {
|
|
864
|
-
return EventHandler.trigger(element, EVENT_CLOSE);
|
|
865
|
-
}
|
|
835
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
836
|
+
} // Private
|
|
866
837
|
|
|
867
|
-
_removeElement(element) {
|
|
868
|
-
element.classList.remove(CLASS_NAME_SHOW$b);
|
|
869
|
-
const isAnimated = element.classList.contains(CLASS_NAME_FADE$7);
|
|
870
838
|
|
|
871
|
-
|
|
872
|
-
|
|
839
|
+
_destroyElement() {
|
|
840
|
+
this._element.remove();
|
|
873
841
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
EventHandler.trigger(element, EVENT_CLOSED);
|
|
842
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
843
|
+
this.dispose();
|
|
877
844
|
} // Static
|
|
878
845
|
|
|
879
846
|
|
|
@@ -881,20 +848,16 @@
|
|
|
881
848
|
return this.each(function () {
|
|
882
849
|
const data = Alert.getOrCreateInstance(this);
|
|
883
850
|
|
|
884
|
-
if (config
|
|
885
|
-
|
|
851
|
+
if (typeof config !== 'string') {
|
|
852
|
+
return;
|
|
886
853
|
}
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
854
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
if (event) {
|
|
893
|
-
event.preventDefault();
|
|
855
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
856
|
+
throw new TypeError(`No method named "${config}"`);
|
|
894
857
|
}
|
|
895
858
|
|
|
896
|
-
|
|
897
|
-
};
|
|
859
|
+
data[config](this);
|
|
860
|
+
});
|
|
898
861
|
}
|
|
899
862
|
|
|
900
863
|
}
|
|
@@ -905,7 +868,7 @@
|
|
|
905
868
|
*/
|
|
906
869
|
|
|
907
870
|
|
|
908
|
-
|
|
871
|
+
enableDismissTrigger(Alert, 'close');
|
|
909
872
|
/**
|
|
910
873
|
* ------------------------------------------------------------------------
|
|
911
874
|
* jQuery
|
|
@@ -917,7 +880,7 @@
|
|
|
917
880
|
|
|
918
881
|
/**
|
|
919
882
|
* --------------------------------------------------------------------------
|
|
920
|
-
* CoreUI (v4.
|
|
883
|
+
* CoreUI (v4.1.1): alert.js
|
|
921
884
|
* Licensed under MIT (https://coreui.io/license)
|
|
922
885
|
*
|
|
923
886
|
* This component is a modified version of the Bootstrap's button.js
|
|
@@ -930,13 +893,13 @@
|
|
|
930
893
|
* ------------------------------------------------------------------------
|
|
931
894
|
*/
|
|
932
895
|
|
|
933
|
-
const NAME$
|
|
934
|
-
const DATA_KEY$
|
|
935
|
-
const EVENT_KEY$
|
|
896
|
+
const NAME$e = 'button';
|
|
897
|
+
const DATA_KEY$d = 'coreui.button';
|
|
898
|
+
const EVENT_KEY$d = `.${DATA_KEY$d}`;
|
|
936
899
|
const DATA_API_KEY$9 = '.data-api';
|
|
937
900
|
const CLASS_NAME_ACTIVE$4 = 'active';
|
|
938
901
|
const SELECTOR_DATA_TOGGLE$6 = '[data-coreui-toggle="button"]';
|
|
939
|
-
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$
|
|
902
|
+
const EVENT_CLICK_DATA_API$8 = `click${EVENT_KEY$d}${DATA_API_KEY$9}`;
|
|
940
903
|
/**
|
|
941
904
|
* ------------------------------------------------------------------------
|
|
942
905
|
* Class Definition
|
|
@@ -946,7 +909,7 @@
|
|
|
946
909
|
class Button extends BaseComponent {
|
|
947
910
|
// Getters
|
|
948
911
|
static get NAME() {
|
|
949
|
-
return NAME$
|
|
912
|
+
return NAME$e;
|
|
950
913
|
} // Public
|
|
951
914
|
|
|
952
915
|
|
|
@@ -991,7 +954,7 @@
|
|
|
991
954
|
|
|
992
955
|
/**
|
|
993
956
|
* --------------------------------------------------------------------------
|
|
994
|
-
* CoreUI (v4.
|
|
957
|
+
* CoreUI (v4.1.1): dom/manipulator.js
|
|
995
958
|
* Licensed under MIT (https://coreui.io/license)
|
|
996
959
|
*
|
|
997
960
|
* This component is a modified version of the Bootstrap's dom/manipulator.js
|
|
@@ -1052,8 +1015,8 @@
|
|
|
1052
1015
|
offset(element) {
|
|
1053
1016
|
const rect = element.getBoundingClientRect();
|
|
1054
1017
|
return {
|
|
1055
|
-
top: rect.top +
|
|
1056
|
-
left: rect.left +
|
|
1018
|
+
top: rect.top + window.pageYOffset,
|
|
1019
|
+
left: rect.left + window.pageXOffset
|
|
1057
1020
|
};
|
|
1058
1021
|
},
|
|
1059
1022
|
|
|
@@ -1068,7 +1031,80 @@
|
|
|
1068
1031
|
|
|
1069
1032
|
/**
|
|
1070
1033
|
* --------------------------------------------------------------------------
|
|
1071
|
-
* CoreUI (v4.
|
|
1034
|
+
* CoreUI (v4.1.1): dom/selector-engine.js
|
|
1035
|
+
* Licensed under MIT (https://coreui.io/license)
|
|
1036
|
+
*
|
|
1037
|
+
* This component is a modified version of the Bootstrap's dom/selector-engine.js
|
|
1038
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1039
|
+
* --------------------------------------------------------------------------
|
|
1040
|
+
*/
|
|
1041
|
+
const NODE_TEXT = 3;
|
|
1042
|
+
const SelectorEngine = {
|
|
1043
|
+
find(selector, element = document.documentElement) {
|
|
1044
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
1045
|
+
},
|
|
1046
|
+
|
|
1047
|
+
findOne(selector, element = document.documentElement) {
|
|
1048
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
1049
|
+
},
|
|
1050
|
+
|
|
1051
|
+
children(element, selector) {
|
|
1052
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
1053
|
+
},
|
|
1054
|
+
|
|
1055
|
+
parents(element, selector) {
|
|
1056
|
+
const parents = [];
|
|
1057
|
+
let ancestor = element.parentNode;
|
|
1058
|
+
|
|
1059
|
+
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
1060
|
+
if (ancestor.matches(selector)) {
|
|
1061
|
+
parents.push(ancestor);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
ancestor = ancestor.parentNode;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
return parents;
|
|
1068
|
+
},
|
|
1069
|
+
|
|
1070
|
+
prev(element, selector) {
|
|
1071
|
+
let previous = element.previousElementSibling;
|
|
1072
|
+
|
|
1073
|
+
while (previous) {
|
|
1074
|
+
if (previous.matches(selector)) {
|
|
1075
|
+
return [previous];
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
previous = previous.previousElementSibling;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
return [];
|
|
1082
|
+
},
|
|
1083
|
+
|
|
1084
|
+
next(element, selector) {
|
|
1085
|
+
let next = element.nextElementSibling;
|
|
1086
|
+
|
|
1087
|
+
while (next) {
|
|
1088
|
+
if (next.matches(selector)) {
|
|
1089
|
+
return [next];
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
next = next.nextElementSibling;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
return [];
|
|
1096
|
+
},
|
|
1097
|
+
|
|
1098
|
+
focusableChildren(element) {
|
|
1099
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
|
1100
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* --------------------------------------------------------------------------
|
|
1107
|
+
* CoreUI (v4.1.1): carousel.js
|
|
1072
1108
|
* Licensed under MIT (https://coreui.io/license)
|
|
1073
1109
|
*
|
|
1074
1110
|
* This component is a modified version of the Bootstrap's carousel.js
|
|
@@ -1081,16 +1117,16 @@
|
|
|
1081
1117
|
* ------------------------------------------------------------------------
|
|
1082
1118
|
*/
|
|
1083
1119
|
|
|
1084
|
-
const NAME$
|
|
1085
|
-
const DATA_KEY$
|
|
1086
|
-
const EVENT_KEY$
|
|
1120
|
+
const NAME$d = 'carousel';
|
|
1121
|
+
const DATA_KEY$c = 'coreui.carousel';
|
|
1122
|
+
const EVENT_KEY$c = `.${DATA_KEY$c}`;
|
|
1087
1123
|
const DATA_API_KEY$8 = '.data-api';
|
|
1088
1124
|
const ARROW_LEFT_KEY = 'ArrowLeft';
|
|
1089
1125
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
|
1090
1126
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
|
1091
1127
|
|
|
1092
1128
|
const SWIPE_THRESHOLD = 40;
|
|
1093
|
-
const Default$
|
|
1129
|
+
const Default$c = {
|
|
1094
1130
|
interval: 5000,
|
|
1095
1131
|
keyboard: true,
|
|
1096
1132
|
slide: false,
|
|
@@ -1098,7 +1134,7 @@
|
|
|
1098
1134
|
wrap: true,
|
|
1099
1135
|
touch: true
|
|
1100
1136
|
};
|
|
1101
|
-
const DefaultType$
|
|
1137
|
+
const DefaultType$c = {
|
|
1102
1138
|
interval: '(number|boolean)',
|
|
1103
1139
|
keyboard: 'boolean',
|
|
1104
1140
|
slide: '(boolean|string)',
|
|
@@ -1114,19 +1150,19 @@
|
|
|
1114
1150
|
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
|
1115
1151
|
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
|
1116
1152
|
};
|
|
1117
|
-
const EVENT_SLIDE = `slide${EVENT_KEY$
|
|
1118
|
-
const EVENT_SLID = `slid${EVENT_KEY$
|
|
1119
|
-
const EVENT_KEYDOWN = `keydown${EVENT_KEY$
|
|
1120
|
-
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$
|
|
1121
|
-
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$
|
|
1122
|
-
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$
|
|
1123
|
-
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$
|
|
1124
|
-
const EVENT_TOUCHEND = `touchend${EVENT_KEY$
|
|
1125
|
-
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$
|
|
1126
|
-
const EVENT_POINTERUP = `pointerup${EVENT_KEY$
|
|
1127
|
-
const EVENT_DRAG_START = `dragstart${EVENT_KEY$
|
|
1128
|
-
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$
|
|
1129
|
-
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$
|
|
1153
|
+
const EVENT_SLIDE = `slide${EVENT_KEY$c}`;
|
|
1154
|
+
const EVENT_SLID = `slid${EVENT_KEY$c}`;
|
|
1155
|
+
const EVENT_KEYDOWN = `keydown${EVENT_KEY$c}`;
|
|
1156
|
+
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$c}`;
|
|
1157
|
+
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$c}`;
|
|
1158
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$c}`;
|
|
1159
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$c}`;
|
|
1160
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY$c}`;
|
|
1161
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$c}`;
|
|
1162
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY$c}`;
|
|
1163
|
+
const EVENT_DRAG_START = `dragstart${EVENT_KEY$c}`;
|
|
1164
|
+
const EVENT_LOAD_DATA_API$4 = `load${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1165
|
+
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$c}${DATA_API_KEY$8}`;
|
|
1130
1166
|
const CLASS_NAME_CAROUSEL = 'carousel';
|
|
1131
1167
|
const CLASS_NAME_ACTIVE$3 = 'active';
|
|
1132
1168
|
const CLASS_NAME_SLIDE = 'slide';
|
|
@@ -1173,11 +1209,11 @@
|
|
|
1173
1209
|
|
|
1174
1210
|
|
|
1175
1211
|
static get Default() {
|
|
1176
|
-
return Default$
|
|
1212
|
+
return Default$c;
|
|
1177
1213
|
}
|
|
1178
1214
|
|
|
1179
1215
|
static get NAME() {
|
|
1180
|
-
return NAME$
|
|
1216
|
+
return NAME$d;
|
|
1181
1217
|
} // Public
|
|
1182
1218
|
|
|
1183
1219
|
|
|
@@ -1255,11 +1291,11 @@
|
|
|
1255
1291
|
|
|
1256
1292
|
|
|
1257
1293
|
_getConfig(config) {
|
|
1258
|
-
config = { ...Default$
|
|
1294
|
+
config = { ...Default$c,
|
|
1259
1295
|
...Manipulator.getDataAttributes(this._element),
|
|
1260
1296
|
...(typeof config === 'object' ? config : {})
|
|
1261
1297
|
};
|
|
1262
|
-
typeCheckConfig(NAME$
|
|
1298
|
+
typeCheckConfig(NAME$d, config, DefaultType$c);
|
|
1263
1299
|
return config;
|
|
1264
1300
|
}
|
|
1265
1301
|
|
|
@@ -1296,8 +1332,12 @@
|
|
|
1296
1332
|
}
|
|
1297
1333
|
|
|
1298
1334
|
_addTouchEventListeners() {
|
|
1335
|
+
const hasPointerPenTouch = event => {
|
|
1336
|
+
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1299
1339
|
const start = event => {
|
|
1300
|
-
if (
|
|
1340
|
+
if (hasPointerPenTouch(event)) {
|
|
1301
1341
|
this.touchStartX = event.clientX;
|
|
1302
1342
|
} else if (!this._pointerEvent) {
|
|
1303
1343
|
this.touchStartX = event.touches[0].clientX;
|
|
@@ -1310,7 +1350,7 @@
|
|
|
1310
1350
|
};
|
|
1311
1351
|
|
|
1312
1352
|
const end = event => {
|
|
1313
|
-
if (
|
|
1353
|
+
if (hasPointerPenTouch(event)) {
|
|
1314
1354
|
this.touchDeltaX = event.clientX - this.touchStartX;
|
|
1315
1355
|
}
|
|
1316
1356
|
|
|
@@ -1335,7 +1375,7 @@
|
|
|
1335
1375
|
};
|
|
1336
1376
|
|
|
1337
1377
|
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
|
1338
|
-
EventHandler.on(itemImg, EVENT_DRAG_START,
|
|
1378
|
+
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
|
1339
1379
|
});
|
|
1340
1380
|
|
|
1341
1381
|
if (this._pointerEvent) {
|
|
@@ -1392,7 +1432,7 @@
|
|
|
1392
1432
|
const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);
|
|
1393
1433
|
activeIndicator.classList.remove(CLASS_NAME_ACTIVE$3);
|
|
1394
1434
|
activeIndicator.removeAttribute('aria-current');
|
|
1395
|
-
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);
|
|
1435
|
+
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement); // eslint-disable-next-line unicorn/no-for-loop
|
|
1396
1436
|
|
|
1397
1437
|
for (let i = 0; i < indicators.length; i++) {
|
|
1398
1438
|
if (Number.parseInt(indicators[i].getAttribute('data-coreui-slide-to'), 10) === this._getItemIndex(element)) {
|
|
@@ -1616,7 +1656,7 @@
|
|
|
1616
1656
|
|
|
1617
1657
|
/**
|
|
1618
1658
|
* --------------------------------------------------------------------------
|
|
1619
|
-
* CoreUI (v4.
|
|
1659
|
+
* CoreUI (v4.1.1): collapse.js
|
|
1620
1660
|
* Licensed under MIT (https://coreui.io/license)
|
|
1621
1661
|
*
|
|
1622
1662
|
* This component is a modified version of the Bootstrap's collapse.js
|
|
@@ -1629,30 +1669,32 @@
|
|
|
1629
1669
|
* ------------------------------------------------------------------------
|
|
1630
1670
|
*/
|
|
1631
1671
|
|
|
1632
|
-
const NAME$
|
|
1633
|
-
const DATA_KEY$
|
|
1634
|
-
const EVENT_KEY$
|
|
1672
|
+
const NAME$c = 'collapse';
|
|
1673
|
+
const DATA_KEY$b = 'coreui.collapse';
|
|
1674
|
+
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
|
1635
1675
|
const DATA_API_KEY$7 = '.data-api';
|
|
1636
|
-
const Default$
|
|
1676
|
+
const Default$b = {
|
|
1637
1677
|
toggle: true,
|
|
1638
|
-
parent:
|
|
1678
|
+
parent: null
|
|
1639
1679
|
};
|
|
1640
|
-
const DefaultType$
|
|
1680
|
+
const DefaultType$b = {
|
|
1641
1681
|
toggle: 'boolean',
|
|
1642
|
-
parent: '(
|
|
1682
|
+
parent: '(null|element)'
|
|
1643
1683
|
};
|
|
1644
|
-
const EVENT_SHOW$6 = `show${EVENT_KEY$
|
|
1645
|
-
const EVENT_SHOWN$6 = `shown${EVENT_KEY$
|
|
1646
|
-
const EVENT_HIDE$6 = `hide${EVENT_KEY$
|
|
1647
|
-
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$
|
|
1648
|
-
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$
|
|
1649
|
-
const CLASS_NAME_SHOW$
|
|
1684
|
+
const EVENT_SHOW$6 = `show${EVENT_KEY$b}`;
|
|
1685
|
+
const EVENT_SHOWN$6 = `shown${EVENT_KEY$b}`;
|
|
1686
|
+
const EVENT_HIDE$6 = `hide${EVENT_KEY$b}`;
|
|
1687
|
+
const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$b}`;
|
|
1688
|
+
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
|
|
1689
|
+
const CLASS_NAME_SHOW$9 = 'show';
|
|
1650
1690
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
|
1651
1691
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
|
1652
1692
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
|
1693
|
+
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
|
1694
|
+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
|
1653
1695
|
const WIDTH = 'width';
|
|
1654
1696
|
const HEIGHT = 'height';
|
|
1655
|
-
const SELECTOR_ACTIVES = '.show, .collapsing';
|
|
1697
|
+
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
|
1656
1698
|
const SELECTOR_DATA_TOGGLE$5 = '[data-coreui-toggle="collapse"]';
|
|
1657
1699
|
/**
|
|
1658
1700
|
* ------------------------------------------------------------------------
|
|
@@ -1665,7 +1707,7 @@
|
|
|
1665
1707
|
super(element);
|
|
1666
1708
|
this._isTransitioning = false;
|
|
1667
1709
|
this._config = this._getConfig(config);
|
|
1668
|
-
this._triggerArray =
|
|
1710
|
+
this._triggerArray = [];
|
|
1669
1711
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$5);
|
|
1670
1712
|
|
|
1671
1713
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
|
@@ -1680,10 +1722,10 @@
|
|
|
1680
1722
|
}
|
|
1681
1723
|
}
|
|
1682
1724
|
|
|
1683
|
-
this.
|
|
1725
|
+
this._initializeChildren();
|
|
1684
1726
|
|
|
1685
1727
|
if (!this._config.parent) {
|
|
1686
|
-
this._addAriaAndCollapsedClass(this.
|
|
1728
|
+
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
|
1687
1729
|
}
|
|
1688
1730
|
|
|
1689
1731
|
if (this._config.toggle) {
|
|
@@ -1693,16 +1735,16 @@
|
|
|
1693
1735
|
|
|
1694
1736
|
|
|
1695
1737
|
static get Default() {
|
|
1696
|
-
return Default$
|
|
1738
|
+
return Default$b;
|
|
1697
1739
|
}
|
|
1698
1740
|
|
|
1699
1741
|
static get NAME() {
|
|
1700
|
-
return NAME$
|
|
1742
|
+
return NAME$c;
|
|
1701
1743
|
} // Public
|
|
1702
1744
|
|
|
1703
1745
|
|
|
1704
1746
|
toggle() {
|
|
1705
|
-
if (this.
|
|
1747
|
+
if (this._isShown()) {
|
|
1706
1748
|
this.hide();
|
|
1707
1749
|
} else {
|
|
1708
1750
|
this.show();
|
|
@@ -1710,30 +1752,21 @@
|
|
|
1710
1752
|
}
|
|
1711
1753
|
|
|
1712
1754
|
show() {
|
|
1713
|
-
if (this._isTransitioning || this.
|
|
1755
|
+
if (this._isTransitioning || this._isShown()) {
|
|
1714
1756
|
return;
|
|
1715
1757
|
}
|
|
1716
1758
|
|
|
1717
|
-
let actives;
|
|
1759
|
+
let actives = [];
|
|
1718
1760
|
let activesData;
|
|
1719
1761
|
|
|
1720
|
-
if (this.
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
return elem.getAttribute('data-coreui-parent') === this._config.parent;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
|
1727
|
-
});
|
|
1728
|
-
|
|
1729
|
-
if (actives.length === 0) {
|
|
1730
|
-
actives = null;
|
|
1731
|
-
}
|
|
1762
|
+
if (this._config.parent) {
|
|
1763
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1764
|
+
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
|
1732
1765
|
}
|
|
1733
1766
|
|
|
1734
1767
|
const container = SelectorEngine.findOne(this._selector);
|
|
1735
1768
|
|
|
1736
|
-
if (actives) {
|
|
1769
|
+
if (actives.length) {
|
|
1737
1770
|
const tempActiveData = actives.find(elem => container !== elem);
|
|
1738
1771
|
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
|
1739
1772
|
|
|
@@ -1748,17 +1781,17 @@
|
|
|
1748
1781
|
return;
|
|
1749
1782
|
}
|
|
1750
1783
|
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
}
|
|
1784
|
+
actives.forEach(elemActive => {
|
|
1785
|
+
if (container !== elemActive) {
|
|
1786
|
+
Collapse.getOrCreateInstance(elemActive, {
|
|
1787
|
+
toggle: false
|
|
1788
|
+
}).hide();
|
|
1789
|
+
}
|
|
1756
1790
|
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
}
|
|
1791
|
+
if (!activesData) {
|
|
1792
|
+
Data.set(elemActive, DATA_KEY$b, null);
|
|
1793
|
+
}
|
|
1794
|
+
});
|
|
1762
1795
|
|
|
1763
1796
|
const dimension = this._getDimension();
|
|
1764
1797
|
|
|
@@ -1768,22 +1801,18 @@
|
|
|
1768
1801
|
|
|
1769
1802
|
this._element.style[dimension] = 0;
|
|
1770
1803
|
|
|
1771
|
-
|
|
1772
|
-
this._triggerArray.forEach(element => {
|
|
1773
|
-
element.classList.remove(CLASS_NAME_COLLAPSED);
|
|
1774
|
-
element.setAttribute('aria-expanded', true);
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1804
|
+
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
|
1777
1805
|
|
|
1778
|
-
this.
|
|
1806
|
+
this._isTransitioning = true;
|
|
1779
1807
|
|
|
1780
1808
|
const complete = () => {
|
|
1809
|
+
this._isTransitioning = false;
|
|
1810
|
+
|
|
1781
1811
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1782
1812
|
|
|
1783
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1813
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1784
1814
|
|
|
1785
1815
|
this._element.style[dimension] = '';
|
|
1786
|
-
this.setTransitioning(false);
|
|
1787
1816
|
EventHandler.trigger(this._element, EVENT_SHOWN$6);
|
|
1788
1817
|
};
|
|
1789
1818
|
|
|
@@ -1796,7 +1825,7 @@
|
|
|
1796
1825
|
}
|
|
1797
1826
|
|
|
1798
1827
|
hide() {
|
|
1799
|
-
if (this._isTransitioning || !this.
|
|
1828
|
+
if (this._isTransitioning || !this._isShown()) {
|
|
1800
1829
|
return;
|
|
1801
1830
|
}
|
|
1802
1831
|
|
|
@@ -1813,26 +1842,23 @@
|
|
|
1813
1842
|
|
|
1814
1843
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
|
1815
1844
|
|
|
1816
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1845
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$9);
|
|
1817
1846
|
|
|
1818
1847
|
const triggerArrayLength = this._triggerArray.length;
|
|
1819
1848
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
const elem = getElementFromSelector(trigger);
|
|
1849
|
+
for (let i = 0; i < triggerArrayLength; i++) {
|
|
1850
|
+
const trigger = this._triggerArray[i];
|
|
1851
|
+
const elem = getElementFromSelector(trigger);
|
|
1824
1852
|
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
trigger.setAttribute('aria-expanded', false);
|
|
1828
|
-
}
|
|
1853
|
+
if (elem && !this._isShown(elem)) {
|
|
1854
|
+
this._addAriaAndCollapsedClass([trigger], false);
|
|
1829
1855
|
}
|
|
1830
1856
|
}
|
|
1831
1857
|
|
|
1832
|
-
this.
|
|
1858
|
+
this._isTransitioning = true;
|
|
1833
1859
|
|
|
1834
1860
|
const complete = () => {
|
|
1835
|
-
this.
|
|
1861
|
+
this._isTransitioning = false;
|
|
1836
1862
|
|
|
1837
1863
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1838
1864
|
|
|
@@ -1846,45 +1872,47 @@
|
|
|
1846
1872
|
this._queueCallback(complete, this._element, true);
|
|
1847
1873
|
}
|
|
1848
1874
|
|
|
1849
|
-
|
|
1850
|
-
|
|
1875
|
+
_isShown(element = this._element) {
|
|
1876
|
+
return element.classList.contains(CLASS_NAME_SHOW$9);
|
|
1851
1877
|
} // Private
|
|
1852
1878
|
|
|
1853
1879
|
|
|
1854
1880
|
_getConfig(config) {
|
|
1855
|
-
config = { ...Default$
|
|
1881
|
+
config = { ...Default$b,
|
|
1882
|
+
...Manipulator.getDataAttributes(this._element),
|
|
1856
1883
|
...config
|
|
1857
1884
|
};
|
|
1858
1885
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
|
1859
1886
|
|
|
1860
|
-
|
|
1887
|
+
config.parent = getElement(config.parent);
|
|
1888
|
+
typeCheckConfig(NAME$c, config, DefaultType$b);
|
|
1861
1889
|
return config;
|
|
1862
1890
|
}
|
|
1863
1891
|
|
|
1864
1892
|
_getDimension() {
|
|
1865
|
-
return this._element.classList.contains(
|
|
1893
|
+
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
|
1866
1894
|
}
|
|
1867
1895
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
const
|
|
1874
|
-
SelectorEngine.find(
|
|
1896
|
+
_initializeChildren() {
|
|
1897
|
+
if (!this._config.parent) {
|
|
1898
|
+
return;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1902
|
+
SelectorEngine.find(SELECTOR_DATA_TOGGLE$5, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
|
1875
1903
|
const selected = getElementFromSelector(element);
|
|
1876
1904
|
|
|
1877
|
-
|
|
1905
|
+
if (selected) {
|
|
1906
|
+
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
|
1907
|
+
}
|
|
1878
1908
|
});
|
|
1879
|
-
return parent;
|
|
1880
1909
|
}
|
|
1881
1910
|
|
|
1882
|
-
_addAriaAndCollapsedClass(
|
|
1883
|
-
if (!
|
|
1911
|
+
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
|
1912
|
+
if (!triggerArray.length) {
|
|
1884
1913
|
return;
|
|
1885
1914
|
}
|
|
1886
1915
|
|
|
1887
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$a);
|
|
1888
1916
|
triggerArray.forEach(elem => {
|
|
1889
1917
|
if (isOpen) {
|
|
1890
1918
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
|
@@ -1897,33 +1925,23 @@
|
|
|
1897
1925
|
} // Static
|
|
1898
1926
|
|
|
1899
1927
|
|
|
1900
|
-
static
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
...Manipulator.getDataAttributes(element),
|
|
1904
|
-
...(typeof config === 'object' && config ? config : {})
|
|
1905
|
-
};
|
|
1906
|
-
|
|
1907
|
-
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
|
1908
|
-
_config.toggle = false;
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
if (!data) {
|
|
1912
|
-
data = new Collapse(element, _config);
|
|
1913
|
-
}
|
|
1928
|
+
static jQueryInterface(config) {
|
|
1929
|
+
return this.each(function () {
|
|
1930
|
+
const _config = {};
|
|
1914
1931
|
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
throw new TypeError(`No method named "${config}"`);
|
|
1932
|
+
if (typeof config === 'string' && /show|hide/.test(config)) {
|
|
1933
|
+
_config.toggle = false;
|
|
1918
1934
|
}
|
|
1919
1935
|
|
|
1920
|
-
data
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1936
|
+
const data = Collapse.getOrCreateInstance(this, _config);
|
|
1923
1937
|
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1938
|
+
if (typeof config === 'string') {
|
|
1939
|
+
if (typeof data[config] === 'undefined') {
|
|
1940
|
+
throw new TypeError(`No method named "${config}"`);
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
data[config]();
|
|
1944
|
+
}
|
|
1927
1945
|
});
|
|
1928
1946
|
}
|
|
1929
1947
|
|
|
@@ -1941,26 +1959,12 @@
|
|
|
1941
1959
|
event.preventDefault();
|
|
1942
1960
|
}
|
|
1943
1961
|
|
|
1944
|
-
const triggerData = Manipulator.getDataAttributes(this);
|
|
1945
1962
|
const selector = getSelectorFromElement(this);
|
|
1946
1963
|
const selectorElements = SelectorEngine.find(selector);
|
|
1947
1964
|
selectorElements.forEach(element => {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
if (data) {
|
|
1952
|
-
// update parent attribute
|
|
1953
|
-
if (data._parent === null && typeof triggerData.parent === 'string') {
|
|
1954
|
-
data._config.parent = triggerData.parent;
|
|
1955
|
-
data._parent = data._getParent();
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
config = 'toggle';
|
|
1959
|
-
} else {
|
|
1960
|
-
config = triggerData;
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
Collapse.collapseInterface(element, config);
|
|
1965
|
+
Collapse.getOrCreateInstance(element, {
|
|
1966
|
+
toggle: false
|
|
1967
|
+
}).toggle();
|
|
1964
1968
|
});
|
|
1965
1969
|
});
|
|
1966
1970
|
/**
|
|
@@ -2115,7 +2119,7 @@
|
|
|
2115
2119
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2116
2120
|
|
|
2117
2121
|
|
|
2118
|
-
|
|
2122
|
+
const applyStyles$1 = {
|
|
2119
2123
|
name: 'applyStyles',
|
|
2120
2124
|
enabled: true,
|
|
2121
2125
|
phase: 'write',
|
|
@@ -2128,7 +2132,10 @@
|
|
|
2128
2132
|
return placement.split('-')[0];
|
|
2129
2133
|
}
|
|
2130
2134
|
|
|
2131
|
-
var
|
|
2135
|
+
var max = Math.max;
|
|
2136
|
+
var min = Math.min;
|
|
2137
|
+
var round = Math.round;
|
|
2138
|
+
|
|
2132
2139
|
function getBoundingClientRect(element, includeScale) {
|
|
2133
2140
|
if (includeScale === void 0) {
|
|
2134
2141
|
includeScale = false;
|
|
@@ -2144,23 +2151,23 @@
|
|
|
2144
2151
|
// Fallback to 1 in case both values are `0`
|
|
2145
2152
|
|
|
2146
2153
|
if (offsetWidth > 0) {
|
|
2147
|
-
scaleX = rect.width / offsetWidth || 1;
|
|
2154
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
2148
2155
|
}
|
|
2149
2156
|
|
|
2150
2157
|
if (offsetHeight > 0) {
|
|
2151
|
-
scaleY = rect.height / offsetHeight || 1;
|
|
2158
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
2152
2159
|
}
|
|
2153
2160
|
}
|
|
2154
2161
|
|
|
2155
2162
|
return {
|
|
2156
|
-
width:
|
|
2157
|
-
height:
|
|
2158
|
-
top:
|
|
2159
|
-
right:
|
|
2160
|
-
bottom:
|
|
2161
|
-
left:
|
|
2162
|
-
x:
|
|
2163
|
-
y:
|
|
2163
|
+
width: rect.width / scaleX,
|
|
2164
|
+
height: rect.height / scaleY,
|
|
2165
|
+
top: rect.top / scaleY,
|
|
2166
|
+
right: rect.right / scaleX,
|
|
2167
|
+
bottom: rect.bottom / scaleY,
|
|
2168
|
+
left: rect.left / scaleX,
|
|
2169
|
+
x: rect.left / scaleX,
|
|
2170
|
+
y: rect.top / scaleY
|
|
2164
2171
|
};
|
|
2165
2172
|
}
|
|
2166
2173
|
|
|
@@ -2305,13 +2312,13 @@
|
|
|
2305
2312
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
2306
2313
|
}
|
|
2307
2314
|
|
|
2308
|
-
var max = Math.max;
|
|
2309
|
-
var min = Math.min;
|
|
2310
|
-
var round = Math.round;
|
|
2311
|
-
|
|
2312
2315
|
function within(min$1, value, max$1) {
|
|
2313
2316
|
return max(min$1, min(value, max$1));
|
|
2314
2317
|
}
|
|
2318
|
+
function withinMaxClamp(min, value, max) {
|
|
2319
|
+
var v = within(min, value, max);
|
|
2320
|
+
return v > max ? max : v;
|
|
2321
|
+
}
|
|
2315
2322
|
|
|
2316
2323
|
function getFreshSideObject() {
|
|
2317
2324
|
return {
|
|
@@ -2405,7 +2412,7 @@
|
|
|
2405
2412
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2406
2413
|
|
|
2407
2414
|
|
|
2408
|
-
|
|
2415
|
+
const arrow$1 = {
|
|
2409
2416
|
name: 'arrow',
|
|
2410
2417
|
enabled: true,
|
|
2411
2418
|
phase: 'main',
|
|
@@ -2434,8 +2441,8 @@
|
|
|
2434
2441
|
var win = window;
|
|
2435
2442
|
var dpr = win.devicePixelRatio || 1;
|
|
2436
2443
|
return {
|
|
2437
|
-
x: round(
|
|
2438
|
-
y: round(
|
|
2444
|
+
x: round(x * dpr) / dpr || 0,
|
|
2445
|
+
y: round(y * dpr) / dpr || 0
|
|
2439
2446
|
};
|
|
2440
2447
|
}
|
|
2441
2448
|
|
|
@@ -2450,14 +2457,23 @@
|
|
|
2450
2457
|
position = _ref2.position,
|
|
2451
2458
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
2452
2459
|
adaptive = _ref2.adaptive,
|
|
2453
|
-
roundOffsets = _ref2.roundOffsets
|
|
2454
|
-
|
|
2455
|
-
var
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
+
roundOffsets = _ref2.roundOffsets,
|
|
2461
|
+
isFixed = _ref2.isFixed;
|
|
2462
|
+
var _offsets$x = offsets.x,
|
|
2463
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
2464
|
+
_offsets$y = offsets.y,
|
|
2465
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
2466
|
+
|
|
2467
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
2468
|
+
x: x,
|
|
2469
|
+
y: y
|
|
2470
|
+
}) : {
|
|
2471
|
+
x: x,
|
|
2472
|
+
y: y
|
|
2473
|
+
};
|
|
2460
2474
|
|
|
2475
|
+
x = _ref3.x;
|
|
2476
|
+
y = _ref3.y;
|
|
2461
2477
|
var hasX = offsets.hasOwnProperty('x');
|
|
2462
2478
|
var hasY = offsets.hasOwnProperty('y');
|
|
2463
2479
|
var sideX = left;
|
|
@@ -2482,16 +2498,18 @@
|
|
|
2482
2498
|
offsetParent = offsetParent;
|
|
2483
2499
|
|
|
2484
2500
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
2485
|
-
sideY = bottom;
|
|
2486
|
-
|
|
2487
|
-
|
|
2501
|
+
sideY = bottom;
|
|
2502
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
2503
|
+
offsetParent[heightProp];
|
|
2504
|
+
y -= offsetY - popperRect.height;
|
|
2488
2505
|
y *= gpuAcceleration ? 1 : -1;
|
|
2489
2506
|
}
|
|
2490
2507
|
|
|
2491
2508
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
2492
|
-
sideX = right;
|
|
2493
|
-
|
|
2494
|
-
|
|
2509
|
+
sideX = right;
|
|
2510
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
2511
|
+
offsetParent[widthProp];
|
|
2512
|
+
x -= offsetX - popperRect.width;
|
|
2495
2513
|
x *= gpuAcceleration ? 1 : -1;
|
|
2496
2514
|
}
|
|
2497
2515
|
}
|
|
@@ -2500,6 +2518,17 @@
|
|
|
2500
2518
|
position: position
|
|
2501
2519
|
}, adaptive && unsetSides);
|
|
2502
2520
|
|
|
2521
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
2522
|
+
x: x,
|
|
2523
|
+
y: y
|
|
2524
|
+
}) : {
|
|
2525
|
+
x: x,
|
|
2526
|
+
y: y
|
|
2527
|
+
};
|
|
2528
|
+
|
|
2529
|
+
x = _ref4.x;
|
|
2530
|
+
y = _ref4.y;
|
|
2531
|
+
|
|
2503
2532
|
if (gpuAcceleration) {
|
|
2504
2533
|
var _Object$assign;
|
|
2505
2534
|
|
|
@@ -2509,9 +2538,9 @@
|
|
|
2509
2538
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
2510
2539
|
}
|
|
2511
2540
|
|
|
2512
|
-
function computeStyles(
|
|
2513
|
-
var state =
|
|
2514
|
-
options =
|
|
2541
|
+
function computeStyles(_ref5) {
|
|
2542
|
+
var state = _ref5.state,
|
|
2543
|
+
options = _ref5.options;
|
|
2515
2544
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
2516
2545
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
2517
2546
|
_options$adaptive = options.adaptive,
|
|
@@ -2524,7 +2553,8 @@
|
|
|
2524
2553
|
variation: getVariation(state.placement),
|
|
2525
2554
|
popper: state.elements.popper,
|
|
2526
2555
|
popperRect: state.rects.popper,
|
|
2527
|
-
gpuAcceleration: gpuAcceleration
|
|
2556
|
+
gpuAcceleration: gpuAcceleration,
|
|
2557
|
+
isFixed: state.options.strategy === 'fixed'
|
|
2528
2558
|
};
|
|
2529
2559
|
|
|
2530
2560
|
if (state.modifiersData.popperOffsets != null) {
|
|
@@ -2551,7 +2581,7 @@
|
|
|
2551
2581
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2552
2582
|
|
|
2553
2583
|
|
|
2554
|
-
|
|
2584
|
+
const computeStyles$1 = {
|
|
2555
2585
|
name: 'computeStyles',
|
|
2556
2586
|
enabled: true,
|
|
2557
2587
|
phase: 'beforeWrite',
|
|
@@ -2598,7 +2628,7 @@
|
|
|
2598
2628
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2599
2629
|
|
|
2600
2630
|
|
|
2601
|
-
|
|
2631
|
+
const eventListeners = {
|
|
2602
2632
|
name: 'eventListeners',
|
|
2603
2633
|
enabled: true,
|
|
2604
2634
|
phase: 'write',
|
|
@@ -2782,7 +2812,7 @@
|
|
|
2782
2812
|
}
|
|
2783
2813
|
|
|
2784
2814
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
2785
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
|
2815
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
2786
2816
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
2787
2817
|
// clipping (or hiding) overflowing elements with a position different from
|
|
2788
2818
|
// `initial`
|
|
@@ -3112,7 +3142,7 @@
|
|
|
3112
3142
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3113
3143
|
|
|
3114
3144
|
|
|
3115
|
-
|
|
3145
|
+
const flip$1 = {
|
|
3116
3146
|
name: 'flip',
|
|
3117
3147
|
enabled: true,
|
|
3118
3148
|
phase: 'main',
|
|
@@ -3174,7 +3204,7 @@
|
|
|
3174
3204
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3175
3205
|
|
|
3176
3206
|
|
|
3177
|
-
|
|
3207
|
+
const hide$1 = {
|
|
3178
3208
|
name: 'hide',
|
|
3179
3209
|
enabled: true,
|
|
3180
3210
|
phase: 'main',
|
|
@@ -3226,7 +3256,7 @@
|
|
|
3226
3256
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3227
3257
|
|
|
3228
3258
|
|
|
3229
|
-
|
|
3259
|
+
const offset$1 = {
|
|
3230
3260
|
name: 'offset',
|
|
3231
3261
|
enabled: true,
|
|
3232
3262
|
phase: 'main',
|
|
@@ -3250,7 +3280,7 @@
|
|
|
3250
3280
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3251
3281
|
|
|
3252
3282
|
|
|
3253
|
-
|
|
3283
|
+
const popperOffsets$1 = {
|
|
3254
3284
|
name: 'popperOffsets',
|
|
3255
3285
|
enabled: true,
|
|
3256
3286
|
phase: 'read',
|
|
@@ -3295,6 +3325,14 @@
|
|
|
3295
3325
|
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
3296
3326
|
placement: state.placement
|
|
3297
3327
|
})) : tetherOffset;
|
|
3328
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
3329
|
+
mainAxis: tetherOffsetValue,
|
|
3330
|
+
altAxis: tetherOffsetValue
|
|
3331
|
+
} : Object.assign({
|
|
3332
|
+
mainAxis: 0,
|
|
3333
|
+
altAxis: 0
|
|
3334
|
+
}, tetherOffsetValue);
|
|
3335
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
3298
3336
|
var data = {
|
|
3299
3337
|
x: 0,
|
|
3300
3338
|
y: 0
|
|
@@ -3304,13 +3342,15 @@
|
|
|
3304
3342
|
return;
|
|
3305
3343
|
}
|
|
3306
3344
|
|
|
3307
|
-
if (checkMainAxis
|
|
3345
|
+
if (checkMainAxis) {
|
|
3346
|
+
var _offsetModifierState$;
|
|
3347
|
+
|
|
3308
3348
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
3309
3349
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
3310
3350
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
3311
3351
|
var offset = popperOffsets[mainAxis];
|
|
3312
|
-
var min$1 =
|
|
3313
|
-
var max$1 =
|
|
3352
|
+
var min$1 = offset + overflow[mainSide];
|
|
3353
|
+
var max$1 = offset - overflow[altSide];
|
|
3314
3354
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
3315
3355
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
3316
3356
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -3330,43 +3370,52 @@
|
|
|
3330
3370
|
// width or height)
|
|
3331
3371
|
|
|
3332
3372
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
3333
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
|
3334
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
|
3373
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
3374
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
3335
3375
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
3336
3376
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
3337
|
-
var offsetModifierValue =
|
|
3338
|
-
var tetherMin =
|
|
3339
|
-
var tetherMax =
|
|
3377
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
3378
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
3379
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
3380
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
3381
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
3382
|
+
data[mainAxis] = preventedOffset - offset;
|
|
3383
|
+
}
|
|
3340
3384
|
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
popperOffsets[mainAxis] = preventedOffset;
|
|
3344
|
-
data[mainAxis] = preventedOffset - offset;
|
|
3345
|
-
}
|
|
3385
|
+
if (checkAltAxis) {
|
|
3386
|
+
var _offsetModifierState$2;
|
|
3346
3387
|
|
|
3347
|
-
|
|
3348
|
-
var _mainSide = mainAxis === 'x' ? top : left;
|
|
3388
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
3349
3389
|
|
|
3350
|
-
|
|
3390
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
3351
3391
|
|
|
3352
|
-
|
|
3392
|
+
var _offset = popperOffsets[altAxis];
|
|
3353
3393
|
|
|
3354
|
-
|
|
3394
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
3355
3395
|
|
|
3356
|
-
|
|
3396
|
+
var _min = _offset + overflow[_mainSide];
|
|
3357
3397
|
|
|
3358
|
-
|
|
3398
|
+
var _max = _offset - overflow[_altSide];
|
|
3359
3399
|
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3400
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
3401
|
+
|
|
3402
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
3403
|
+
|
|
3404
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
3405
|
+
|
|
3406
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
3407
|
+
|
|
3408
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
3409
|
+
|
|
3410
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
3411
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
3363
3412
|
}
|
|
3364
3413
|
|
|
3365
3414
|
state.modifiersData[name] = data;
|
|
3366
3415
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3367
3416
|
|
|
3368
3417
|
|
|
3369
|
-
|
|
3418
|
+
const preventOverflow$1 = {
|
|
3370
3419
|
name: 'preventOverflow',
|
|
3371
3420
|
enabled: true,
|
|
3372
3421
|
phase: 'main',
|
|
@@ -3391,8 +3440,8 @@
|
|
|
3391
3440
|
|
|
3392
3441
|
function isElementScaled(element) {
|
|
3393
3442
|
var rect = element.getBoundingClientRect();
|
|
3394
|
-
var scaleX = rect.width / element.offsetWidth || 1;
|
|
3395
|
-
var scaleY = rect.height / element.offsetHeight || 1;
|
|
3443
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
3444
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
3396
3445
|
return scaleX !== 1 || scaleY !== 1;
|
|
3397
3446
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
3398
3447
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -3716,51 +3765,51 @@
|
|
|
3716
3765
|
defaultModifiers: defaultModifiers
|
|
3717
3766
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
3718
3767
|
|
|
3719
|
-
|
|
3768
|
+
const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
3720
3769
|
__proto__: null,
|
|
3721
|
-
popperGenerator
|
|
3722
|
-
detectOverflow
|
|
3770
|
+
popperGenerator,
|
|
3771
|
+
detectOverflow,
|
|
3723
3772
|
createPopperBase: createPopper$2,
|
|
3724
|
-
createPopper
|
|
3773
|
+
createPopper,
|
|
3725
3774
|
createPopperLite: createPopper$1,
|
|
3726
|
-
top
|
|
3727
|
-
bottom
|
|
3728
|
-
right
|
|
3729
|
-
left
|
|
3730
|
-
auto
|
|
3731
|
-
basePlacements
|
|
3732
|
-
start
|
|
3733
|
-
end
|
|
3734
|
-
clippingParents
|
|
3735
|
-
viewport
|
|
3736
|
-
popper
|
|
3737
|
-
reference
|
|
3738
|
-
variationPlacements
|
|
3739
|
-
placements
|
|
3740
|
-
beforeRead
|
|
3741
|
-
read
|
|
3742
|
-
afterRead
|
|
3743
|
-
beforeMain
|
|
3744
|
-
main
|
|
3745
|
-
afterMain
|
|
3746
|
-
beforeWrite
|
|
3747
|
-
write
|
|
3748
|
-
afterWrite
|
|
3749
|
-
modifierPhases
|
|
3775
|
+
top,
|
|
3776
|
+
bottom,
|
|
3777
|
+
right,
|
|
3778
|
+
left,
|
|
3779
|
+
auto,
|
|
3780
|
+
basePlacements,
|
|
3781
|
+
start,
|
|
3782
|
+
end,
|
|
3783
|
+
clippingParents,
|
|
3784
|
+
viewport,
|
|
3785
|
+
popper,
|
|
3786
|
+
reference,
|
|
3787
|
+
variationPlacements,
|
|
3788
|
+
placements,
|
|
3789
|
+
beforeRead,
|
|
3790
|
+
read,
|
|
3791
|
+
afterRead,
|
|
3792
|
+
beforeMain,
|
|
3793
|
+
main,
|
|
3794
|
+
afterMain,
|
|
3795
|
+
beforeWrite,
|
|
3796
|
+
write,
|
|
3797
|
+
afterWrite,
|
|
3798
|
+
modifierPhases,
|
|
3750
3799
|
applyStyles: applyStyles$1,
|
|
3751
3800
|
arrow: arrow$1,
|
|
3752
3801
|
computeStyles: computeStyles$1,
|
|
3753
|
-
eventListeners
|
|
3802
|
+
eventListeners,
|
|
3754
3803
|
flip: flip$1,
|
|
3755
3804
|
hide: hide$1,
|
|
3756
3805
|
offset: offset$1,
|
|
3757
3806
|
popperOffsets: popperOffsets$1,
|
|
3758
3807
|
preventOverflow: preventOverflow$1
|
|
3759
|
-
});
|
|
3808
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
3760
3809
|
|
|
3761
3810
|
/**
|
|
3762
3811
|
* --------------------------------------------------------------------------
|
|
3763
|
-
* CoreUI (v4.
|
|
3812
|
+
* CoreUI (v4.1.1): dropdown.js
|
|
3764
3813
|
* Licensed under MIT (https://coreui.io/license)
|
|
3765
3814
|
*
|
|
3766
3815
|
* This component is a modified version of the Bootstrap's dropdown.js
|
|
@@ -3773,27 +3822,26 @@
|
|
|
3773
3822
|
* ------------------------------------------------------------------------
|
|
3774
3823
|
*/
|
|
3775
3824
|
|
|
3776
|
-
const NAME$
|
|
3777
|
-
const DATA_KEY$
|
|
3778
|
-
const EVENT_KEY$
|
|
3825
|
+
const NAME$b = 'dropdown';
|
|
3826
|
+
const DATA_KEY$a = 'coreui.dropdown';
|
|
3827
|
+
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
|
3779
3828
|
const DATA_API_KEY$6 = '.data-api';
|
|
3780
3829
|
const ESCAPE_KEY$2 = 'Escape';
|
|
3781
3830
|
const SPACE_KEY = 'Space';
|
|
3782
|
-
const TAB_KEY = 'Tab';
|
|
3831
|
+
const TAB_KEY$1 = 'Tab';
|
|
3783
3832
|
const ARROW_UP_KEY = 'ArrowUp';
|
|
3784
3833
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
3785
3834
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
|
3786
3835
|
|
|
3787
3836
|
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
|
|
3788
|
-
const EVENT_HIDE$5 = `hide${EVENT_KEY$
|
|
3789
|
-
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$
|
|
3790
|
-
const EVENT_SHOW$5 = `show${EVENT_KEY$
|
|
3791
|
-
const EVENT_SHOWN$5 = `shown${EVENT_KEY$
|
|
3792
|
-
const
|
|
3793
|
-
const
|
|
3794
|
-
const
|
|
3795
|
-
const
|
|
3796
|
-
const CLASS_NAME_SHOW$9 = 'show';
|
|
3837
|
+
const EVENT_HIDE$5 = `hide${EVENT_KEY$a}`;
|
|
3838
|
+
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$a}`;
|
|
3839
|
+
const EVENT_SHOW$5 = `show${EVENT_KEY$a}`;
|
|
3840
|
+
const EVENT_SHOWN$5 = `shown${EVENT_KEY$a}`;
|
|
3841
|
+
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
3842
|
+
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
3843
|
+
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
3844
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
|
3797
3845
|
const CLASS_NAME_DROPUP = 'dropup';
|
|
3798
3846
|
const CLASS_NAME_DROPEND = 'dropend';
|
|
3799
3847
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
|
@@ -3808,7 +3856,7 @@
|
|
|
3808
3856
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
|
3809
3857
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
|
3810
3858
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
|
3811
|
-
const Default$
|
|
3859
|
+
const Default$a = {
|
|
3812
3860
|
offset: [0, 2],
|
|
3813
3861
|
boundary: 'clippingParents',
|
|
3814
3862
|
reference: 'toggle',
|
|
@@ -3816,7 +3864,7 @@
|
|
|
3816
3864
|
popperConfig: null,
|
|
3817
3865
|
autoClose: true
|
|
3818
3866
|
};
|
|
3819
|
-
const DefaultType$
|
|
3867
|
+
const DefaultType$a = {
|
|
3820
3868
|
offset: '(array|string|function)',
|
|
3821
3869
|
boundary: '(string|element)',
|
|
3822
3870
|
reference: '(string|element|object)',
|
|
@@ -3837,45 +3885,31 @@
|
|
|
3837
3885
|
this._config = this._getConfig(config);
|
|
3838
3886
|
this._menu = this._getMenuElement();
|
|
3839
3887
|
this._inNavbar = this._detectNavbar();
|
|
3840
|
-
|
|
3841
|
-
this._addEventListeners();
|
|
3842
3888
|
} // Getters
|
|
3843
3889
|
|
|
3844
3890
|
|
|
3845
3891
|
static get Default() {
|
|
3846
|
-
return Default$
|
|
3892
|
+
return Default$a;
|
|
3847
3893
|
}
|
|
3848
3894
|
|
|
3849
3895
|
static get DefaultType() {
|
|
3850
|
-
return DefaultType$
|
|
3896
|
+
return DefaultType$a;
|
|
3851
3897
|
}
|
|
3852
3898
|
|
|
3853
3899
|
static get NAME() {
|
|
3854
|
-
return NAME$
|
|
3900
|
+
return NAME$b;
|
|
3855
3901
|
} // Public
|
|
3856
3902
|
|
|
3857
3903
|
|
|
3858
|
-
toggle() {
|
|
3859
|
-
|
|
3860
|
-
return;
|
|
3861
|
-
}
|
|
3862
|
-
|
|
3863
|
-
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$9);
|
|
3864
|
-
|
|
3865
|
-
if (isActive) {
|
|
3866
|
-
this.hide();
|
|
3867
|
-
return;
|
|
3868
|
-
}
|
|
3869
|
-
|
|
3870
|
-
this.show();
|
|
3904
|
+
toggle() {
|
|
3905
|
+
return this._isShown() ? this.hide() : this.show();
|
|
3871
3906
|
}
|
|
3872
3907
|
|
|
3873
3908
|
show() {
|
|
3874
|
-
if (isDisabled(this._element) || this._menu
|
|
3909
|
+
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
|
3875
3910
|
return;
|
|
3876
3911
|
}
|
|
3877
3912
|
|
|
3878
|
-
const parent = Dropdown.getParentFromElement(this._element);
|
|
3879
3913
|
const relatedTarget = {
|
|
3880
3914
|
relatedTarget: this._element
|
|
3881
3915
|
};
|
|
@@ -3883,34 +3917,14 @@
|
|
|
3883
3917
|
|
|
3884
3918
|
if (showEvent.defaultPrevented) {
|
|
3885
3919
|
return;
|
|
3886
|
-
}
|
|
3920
|
+
}
|
|
3887
3921
|
|
|
3922
|
+
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
|
3888
3923
|
|
|
3889
3924
|
if (this._inNavbar) {
|
|
3890
3925
|
Manipulator.setDataAttribute(this._menu, 'popper', 'none');
|
|
3891
3926
|
} else {
|
|
3892
|
-
|
|
3893
|
-
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
3894
|
-
}
|
|
3895
|
-
|
|
3896
|
-
let referenceElement = this._element;
|
|
3897
|
-
|
|
3898
|
-
if (this._config.reference === 'parent') {
|
|
3899
|
-
referenceElement = parent;
|
|
3900
|
-
} else if (isElement$1(this._config.reference)) {
|
|
3901
|
-
referenceElement = getElement(this._config.reference);
|
|
3902
|
-
} else if (typeof this._config.reference === 'object') {
|
|
3903
|
-
referenceElement = this._config.reference;
|
|
3904
|
-
}
|
|
3905
|
-
|
|
3906
|
-
const popperConfig = this._getPopperConfig();
|
|
3907
|
-
|
|
3908
|
-
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
3909
|
-
this._popper = createPopper(referenceElement, this._menu, popperConfig);
|
|
3910
|
-
|
|
3911
|
-
if (isDisplayStatic) {
|
|
3912
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
3913
|
-
}
|
|
3927
|
+
this._createPopper(parent);
|
|
3914
3928
|
} // If this is a touch-enabled device we add extra
|
|
3915
3929
|
// empty mouseover listeners to the body's immediate children;
|
|
3916
3930
|
// only needed because of broken event delegation on iOS
|
|
@@ -3925,15 +3939,15 @@
|
|
|
3925
3939
|
|
|
3926
3940
|
this._element.setAttribute('aria-expanded', true);
|
|
3927
3941
|
|
|
3928
|
-
this._menu.classList.
|
|
3942
|
+
this._menu.classList.add(CLASS_NAME_SHOW$8);
|
|
3929
3943
|
|
|
3930
|
-
this._element.classList.
|
|
3944
|
+
this._element.classList.add(CLASS_NAME_SHOW$8);
|
|
3931
3945
|
|
|
3932
3946
|
EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);
|
|
3933
3947
|
}
|
|
3934
3948
|
|
|
3935
3949
|
hide() {
|
|
3936
|
-
if (isDisabled(this._element) || !this._menu
|
|
3950
|
+
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
|
3937
3951
|
return;
|
|
3938
3952
|
}
|
|
3939
3953
|
|
|
@@ -3961,13 +3975,6 @@
|
|
|
3961
3975
|
} // Private
|
|
3962
3976
|
|
|
3963
3977
|
|
|
3964
|
-
_addEventListeners() {
|
|
3965
|
-
EventHandler.on(this._element, EVENT_CLICK, event => {
|
|
3966
|
-
event.preventDefault();
|
|
3967
|
-
this.toggle();
|
|
3968
|
-
});
|
|
3969
|
-
}
|
|
3970
|
-
|
|
3971
3978
|
_completeHide(relatedTarget) {
|
|
3972
3979
|
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);
|
|
3973
3980
|
|
|
@@ -3985,9 +3992,9 @@
|
|
|
3985
3992
|
this._popper.destroy();
|
|
3986
3993
|
}
|
|
3987
3994
|
|
|
3988
|
-
this._menu.classList.remove(CLASS_NAME_SHOW$
|
|
3995
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$8);
|
|
3989
3996
|
|
|
3990
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
3997
|
+
this._element.classList.remove(CLASS_NAME_SHOW$8);
|
|
3991
3998
|
|
|
3992
3999
|
this._element.setAttribute('aria-expanded', 'false');
|
|
3993
4000
|
|
|
@@ -4000,16 +4007,45 @@
|
|
|
4000
4007
|
...Manipulator.getDataAttributes(this._element),
|
|
4001
4008
|
...config
|
|
4002
4009
|
};
|
|
4003
|
-
typeCheckConfig(NAME$
|
|
4010
|
+
typeCheckConfig(NAME$b, config, this.constructor.DefaultType);
|
|
4004
4011
|
|
|
4005
4012
|
if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
4006
4013
|
// Popper virtual elements require a getBoundingClientRect method
|
|
4007
|
-
throw new TypeError(`${NAME$
|
|
4014
|
+
throw new TypeError(`${NAME$b.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
|
4008
4015
|
}
|
|
4009
4016
|
|
|
4010
4017
|
return config;
|
|
4011
4018
|
}
|
|
4012
4019
|
|
|
4020
|
+
_createPopper(parent) {
|
|
4021
|
+
if (typeof Popper === 'undefined') {
|
|
4022
|
+
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
let referenceElement = this._element;
|
|
4026
|
+
|
|
4027
|
+
if (this._config.reference === 'parent') {
|
|
4028
|
+
referenceElement = parent;
|
|
4029
|
+
} else if (isElement$1(this._config.reference)) {
|
|
4030
|
+
referenceElement = getElement(this._config.reference);
|
|
4031
|
+
} else if (typeof this._config.reference === 'object') {
|
|
4032
|
+
referenceElement = this._config.reference;
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
const popperConfig = this._getPopperConfig();
|
|
4036
|
+
|
|
4037
|
+
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
4038
|
+
this._popper = createPopper(referenceElement, this._menu, popperConfig);
|
|
4039
|
+
|
|
4040
|
+
if (isDisplayStatic) {
|
|
4041
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
_isShown(element = this._element) {
|
|
4046
|
+
return element.classList.contains(CLASS_NAME_SHOW$8);
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4013
4049
|
_getMenuElement() {
|
|
4014
4050
|
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
|
|
4015
4051
|
}
|
|
@@ -4099,26 +4135,24 @@
|
|
|
4099
4135
|
} // Static
|
|
4100
4136
|
|
|
4101
4137
|
|
|
4102
|
-
static
|
|
4103
|
-
|
|
4138
|
+
static jQueryInterface(config) {
|
|
4139
|
+
return this.each(function () {
|
|
4140
|
+
const data = Dropdown.getOrCreateInstance(this, config);
|
|
4141
|
+
|
|
4142
|
+
if (typeof config !== 'string') {
|
|
4143
|
+
return;
|
|
4144
|
+
}
|
|
4104
4145
|
|
|
4105
|
-
if (typeof config === 'string') {
|
|
4106
4146
|
if (typeof data[config] === 'undefined') {
|
|
4107
4147
|
throw new TypeError(`No method named "${config}"`);
|
|
4108
4148
|
}
|
|
4109
4149
|
|
|
4110
4150
|
data[config]();
|
|
4111
|
-
}
|
|
4112
|
-
}
|
|
4113
|
-
|
|
4114
|
-
static jQueryInterface(config) {
|
|
4115
|
-
return this.each(function () {
|
|
4116
|
-
Dropdown.dropdownInterface(this, config);
|
|
4117
4151
|
});
|
|
4118
4152
|
}
|
|
4119
4153
|
|
|
4120
4154
|
static clearMenus(event) {
|
|
4121
|
-
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
|
4155
|
+
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
|
|
4122
4156
|
return;
|
|
4123
4157
|
}
|
|
4124
4158
|
|
|
@@ -4131,7 +4165,7 @@
|
|
|
4131
4165
|
continue;
|
|
4132
4166
|
}
|
|
4133
4167
|
|
|
4134
|
-
if (!context.
|
|
4168
|
+
if (!context._isShown()) {
|
|
4135
4169
|
continue;
|
|
4136
4170
|
}
|
|
4137
4171
|
|
|
@@ -4148,7 +4182,7 @@
|
|
|
4148
4182
|
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
|
4149
4183
|
|
|
4150
4184
|
|
|
4151
|
-
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
4185
|
+
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
4152
4186
|
continue;
|
|
4153
4187
|
}
|
|
4154
4188
|
|
|
@@ -4177,7 +4211,7 @@
|
|
|
4177
4211
|
return;
|
|
4178
4212
|
}
|
|
4179
4213
|
|
|
4180
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$
|
|
4214
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$8);
|
|
4181
4215
|
|
|
4182
4216
|
if (!isActive && event.key === ESCAPE_KEY$2) {
|
|
4183
4217
|
return;
|
|
@@ -4190,20 +4224,20 @@
|
|
|
4190
4224
|
return;
|
|
4191
4225
|
}
|
|
4192
4226
|
|
|
4193
|
-
const getToggleButton =
|
|
4227
|
+
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$4) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$4)[0];
|
|
4228
|
+
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
4194
4229
|
|
|
4195
4230
|
if (event.key === ESCAPE_KEY$2) {
|
|
4196
|
-
|
|
4197
|
-
Dropdown.clearMenus();
|
|
4231
|
+
instance.hide();
|
|
4198
4232
|
return;
|
|
4199
4233
|
}
|
|
4200
4234
|
|
|
4201
4235
|
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
|
4202
4236
|
if (!isActive) {
|
|
4203
|
-
|
|
4237
|
+
instance.show();
|
|
4204
4238
|
}
|
|
4205
4239
|
|
|
4206
|
-
|
|
4240
|
+
instance._selectMenuItem(event);
|
|
4207
4241
|
|
|
4208
4242
|
return;
|
|
4209
4243
|
}
|
|
@@ -4227,7 +4261,7 @@
|
|
|
4227
4261
|
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
|
4228
4262
|
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, function (event) {
|
|
4229
4263
|
event.preventDefault();
|
|
4230
|
-
Dropdown.
|
|
4264
|
+
Dropdown.getOrCreateInstance(this).toggle();
|
|
4231
4265
|
});
|
|
4232
4266
|
/**
|
|
4233
4267
|
* ------------------------------------------------------------------------
|
|
@@ -4240,7 +4274,7 @@
|
|
|
4240
4274
|
|
|
4241
4275
|
/**
|
|
4242
4276
|
* --------------------------------------------------------------------------
|
|
4243
|
-
* Bootstrap (v5.
|
|
4277
|
+
* Bootstrap (v5.1.3): util/scrollBar.js
|
|
4244
4278
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4245
4279
|
* --------------------------------------------------------------------------
|
|
4246
4280
|
*/
|
|
@@ -4344,11 +4378,12 @@
|
|
|
4344
4378
|
|
|
4345
4379
|
/**
|
|
4346
4380
|
* --------------------------------------------------------------------------
|
|
4347
|
-
* Bootstrap (v5.
|
|
4348
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
|
4381
|
+
* Bootstrap (v5.1.3): util/backdrop.js
|
|
4382
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4349
4383
|
* --------------------------------------------------------------------------
|
|
4350
4384
|
*/
|
|
4351
|
-
const Default$
|
|
4385
|
+
const Default$9 = {
|
|
4386
|
+
className: 'modal-backdrop',
|
|
4352
4387
|
isVisible: true,
|
|
4353
4388
|
// if false, we use the backdrop helper without adding any element to the dom
|
|
4354
4389
|
isAnimated: false,
|
|
@@ -4356,17 +4391,17 @@
|
|
|
4356
4391
|
// give the choice to place backdrop under different elements
|
|
4357
4392
|
clickCallback: null
|
|
4358
4393
|
};
|
|
4359
|
-
const DefaultType$
|
|
4394
|
+
const DefaultType$9 = {
|
|
4395
|
+
className: 'string',
|
|
4360
4396
|
isVisible: 'boolean',
|
|
4361
4397
|
isAnimated: 'boolean',
|
|
4362
4398
|
rootElement: '(element|string)',
|
|
4363
4399
|
clickCallback: '(function|null)'
|
|
4364
4400
|
};
|
|
4365
|
-
const NAME$
|
|
4366
|
-
const
|
|
4367
|
-
const
|
|
4368
|
-
const
|
|
4369
|
-
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$9}`;
|
|
4401
|
+
const NAME$a = 'backdrop';
|
|
4402
|
+
const CLASS_NAME_FADE$4 = 'fade';
|
|
4403
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
|
4404
|
+
const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$a}`;
|
|
4370
4405
|
|
|
4371
4406
|
class Backdrop {
|
|
4372
4407
|
constructor(config) {
|
|
@@ -4387,7 +4422,7 @@
|
|
|
4387
4422
|
reflow(this._getElement());
|
|
4388
4423
|
}
|
|
4389
4424
|
|
|
4390
|
-
this._getElement().classList.add(CLASS_NAME_SHOW$
|
|
4425
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$7);
|
|
4391
4426
|
|
|
4392
4427
|
this._emulateAnimation(() => {
|
|
4393
4428
|
execute(callback);
|
|
@@ -4400,7 +4435,7 @@
|
|
|
4400
4435
|
return;
|
|
4401
4436
|
}
|
|
4402
4437
|
|
|
4403
|
-
this._getElement().classList.remove(CLASS_NAME_SHOW$
|
|
4438
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$7);
|
|
4404
4439
|
|
|
4405
4440
|
this._emulateAnimation(() => {
|
|
4406
4441
|
this.dispose();
|
|
@@ -4412,10 +4447,10 @@
|
|
|
4412
4447
|
_getElement() {
|
|
4413
4448
|
if (!this._element) {
|
|
4414
4449
|
const backdrop = document.createElement('div');
|
|
4415
|
-
backdrop.className =
|
|
4450
|
+
backdrop.className = this._config.className;
|
|
4416
4451
|
|
|
4417
4452
|
if (this._config.isAnimated) {
|
|
4418
|
-
backdrop.classList.add(CLASS_NAME_FADE$
|
|
4453
|
+
backdrop.classList.add(CLASS_NAME_FADE$4);
|
|
4419
4454
|
}
|
|
4420
4455
|
|
|
4421
4456
|
this._element = backdrop;
|
|
@@ -4425,12 +4460,12 @@
|
|
|
4425
4460
|
}
|
|
4426
4461
|
|
|
4427
4462
|
_getConfig(config) {
|
|
4428
|
-
config = { ...Default$
|
|
4463
|
+
config = { ...Default$9,
|
|
4429
4464
|
...(typeof config === 'object' ? config : {})
|
|
4430
4465
|
}; // use getElement() with the default "body" to get a fresh Element on each instantiation
|
|
4431
4466
|
|
|
4432
4467
|
config.rootElement = getElement(config.rootElement);
|
|
4433
|
-
typeCheckConfig(NAME$
|
|
4468
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
|
4434
4469
|
return config;
|
|
4435
4470
|
}
|
|
4436
4471
|
|
|
@@ -4439,7 +4474,7 @@
|
|
|
4439
4474
|
return;
|
|
4440
4475
|
}
|
|
4441
4476
|
|
|
4442
|
-
this._config.rootElement.
|
|
4477
|
+
this._config.rootElement.append(this._getElement());
|
|
4443
4478
|
|
|
4444
4479
|
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
|
4445
4480
|
execute(this._config.clickCallback);
|
|
@@ -4467,7 +4502,110 @@
|
|
|
4467
4502
|
|
|
4468
4503
|
/**
|
|
4469
4504
|
* --------------------------------------------------------------------------
|
|
4470
|
-
|
|
4505
|
+
* Bootstrap (v5.1.3): util/focustrap.js
|
|
4506
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4507
|
+
* --------------------------------------------------------------------------
|
|
4508
|
+
*/
|
|
4509
|
+
const Default$8 = {
|
|
4510
|
+
trapElement: null,
|
|
4511
|
+
// The element to trap focus inside of
|
|
4512
|
+
autofocus: true
|
|
4513
|
+
};
|
|
4514
|
+
const DefaultType$8 = {
|
|
4515
|
+
trapElement: 'element',
|
|
4516
|
+
autofocus: 'boolean'
|
|
4517
|
+
};
|
|
4518
|
+
const NAME$9 = 'focustrap';
|
|
4519
|
+
const DATA_KEY$9 = 'coreui.focustrap';
|
|
4520
|
+
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
|
4521
|
+
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$9}`;
|
|
4522
|
+
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$9}`;
|
|
4523
|
+
const TAB_KEY = 'Tab';
|
|
4524
|
+
const TAB_NAV_FORWARD = 'forward';
|
|
4525
|
+
const TAB_NAV_BACKWARD = 'backward';
|
|
4526
|
+
|
|
4527
|
+
class FocusTrap {
|
|
4528
|
+
constructor(config) {
|
|
4529
|
+
this._config = this._getConfig(config);
|
|
4530
|
+
this._isActive = false;
|
|
4531
|
+
this._lastTabNavDirection = null;
|
|
4532
|
+
}
|
|
4533
|
+
|
|
4534
|
+
activate() {
|
|
4535
|
+
const {
|
|
4536
|
+
trapElement,
|
|
4537
|
+
autofocus
|
|
4538
|
+
} = this._config;
|
|
4539
|
+
|
|
4540
|
+
if (this._isActive) {
|
|
4541
|
+
return;
|
|
4542
|
+
}
|
|
4543
|
+
|
|
4544
|
+
if (autofocus) {
|
|
4545
|
+
trapElement.focus();
|
|
4546
|
+
}
|
|
4547
|
+
|
|
4548
|
+
EventHandler.off(document, EVENT_KEY$9); // guard against infinite focus loop
|
|
4549
|
+
|
|
4550
|
+
EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
|
|
4551
|
+
EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
|
|
4552
|
+
this._isActive = true;
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
deactivate() {
|
|
4556
|
+
if (!this._isActive) {
|
|
4557
|
+
return;
|
|
4558
|
+
}
|
|
4559
|
+
|
|
4560
|
+
this._isActive = false;
|
|
4561
|
+
EventHandler.off(document, EVENT_KEY$9);
|
|
4562
|
+
} // Private
|
|
4563
|
+
|
|
4564
|
+
|
|
4565
|
+
_handleFocusin(event) {
|
|
4566
|
+
const {
|
|
4567
|
+
target
|
|
4568
|
+
} = event;
|
|
4569
|
+
const {
|
|
4570
|
+
trapElement
|
|
4571
|
+
} = this._config;
|
|
4572
|
+
|
|
4573
|
+
if (target === document || target === trapElement || trapElement.contains(target)) {
|
|
4574
|
+
return;
|
|
4575
|
+
}
|
|
4576
|
+
|
|
4577
|
+
const elements = SelectorEngine.focusableChildren(trapElement);
|
|
4578
|
+
|
|
4579
|
+
if (elements.length === 0) {
|
|
4580
|
+
trapElement.focus();
|
|
4581
|
+
} else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
|
|
4582
|
+
elements[elements.length - 1].focus();
|
|
4583
|
+
} else {
|
|
4584
|
+
elements[0].focus();
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
|
|
4588
|
+
_handleKeydown(event) {
|
|
4589
|
+
if (event.key !== TAB_KEY) {
|
|
4590
|
+
return;
|
|
4591
|
+
}
|
|
4592
|
+
|
|
4593
|
+
this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4596
|
+
_getConfig(config) {
|
|
4597
|
+
config = { ...Default$8,
|
|
4598
|
+
...(typeof config === 'object' ? config : {})
|
|
4599
|
+
};
|
|
4600
|
+
typeCheckConfig(NAME$9, config, DefaultType$8);
|
|
4601
|
+
return config;
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4606
|
+
/**
|
|
4607
|
+
* --------------------------------------------------------------------------
|
|
4608
|
+
* CoreUI (v4.1.1): modal.js
|
|
4471
4609
|
* Licensed under MIT (https://coreui.io/license)
|
|
4472
4610
|
*
|
|
4473
4611
|
* This component is a modified version of the Bootstrap's modal.js
|
|
@@ -4500,21 +4638,20 @@
|
|
|
4500
4638
|
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
|
|
4501
4639
|
const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
|
|
4502
4640
|
const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
|
|
4503
|
-
const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$8}`;
|
|
4504
4641
|
const EVENT_RESIZE$1 = `resize${EVENT_KEY$8}`;
|
|
4505
|
-
const EVENT_CLICK_DISMISS
|
|
4642
|
+
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$8}`;
|
|
4506
4643
|
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$8}`;
|
|
4507
4644
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$8}`;
|
|
4508
4645
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$8}`;
|
|
4509
4646
|
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
|
|
4510
4647
|
const CLASS_NAME_OPEN = 'modal-open';
|
|
4511
|
-
const CLASS_NAME_FADE$
|
|
4512
|
-
const CLASS_NAME_SHOW$
|
|
4648
|
+
const CLASS_NAME_FADE$3 = 'fade';
|
|
4649
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
|
4513
4650
|
const CLASS_NAME_STATIC = 'modal-static';
|
|
4651
|
+
const OPEN_SELECTOR$1 = '.modal.show';
|
|
4514
4652
|
const SELECTOR_DIALOG = '.modal-dialog';
|
|
4515
4653
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
|
4516
4654
|
const SELECTOR_DATA_TOGGLE$3 = '[data-coreui-toggle="modal"]';
|
|
4517
|
-
const SELECTOR_DATA_DISMISS$2 = '[data-coreui-dismiss="modal"]';
|
|
4518
4655
|
/**
|
|
4519
4656
|
* ------------------------------------------------------------------------
|
|
4520
4657
|
* Class Definition
|
|
@@ -4527,6 +4664,7 @@
|
|
|
4527
4664
|
this._config = this._getConfig(config);
|
|
4528
4665
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
|
4529
4666
|
this._backdrop = this._initializeBackDrop();
|
|
4667
|
+
this._focustrap = this._initializeFocusTrap();
|
|
4530
4668
|
this._isShown = false;
|
|
4531
4669
|
this._ignoreBackdropClick = false;
|
|
4532
4670
|
this._isTransitioning = false;
|
|
@@ -4576,7 +4714,6 @@
|
|
|
4576
4714
|
|
|
4577
4715
|
this._setResizeEvent();
|
|
4578
4716
|
|
|
4579
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
|
|
4580
4717
|
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
|
|
4581
4718
|
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
|
|
4582
4719
|
if (event.target === this._element) {
|
|
@@ -4588,11 +4725,7 @@
|
|
|
4588
4725
|
this._showBackdrop(() => this._showElement(relatedTarget));
|
|
4589
4726
|
}
|
|
4590
4727
|
|
|
4591
|
-
hide(
|
|
4592
|
-
if (event && ['A', 'AREA'].includes(event.target.tagName)) {
|
|
4593
|
-
event.preventDefault();
|
|
4594
|
-
}
|
|
4595
|
-
|
|
4728
|
+
hide() {
|
|
4596
4729
|
if (!this._isShown || this._isTransitioning) {
|
|
4597
4730
|
return;
|
|
4598
4731
|
}
|
|
@@ -4615,11 +4748,11 @@
|
|
|
4615
4748
|
|
|
4616
4749
|
this._setResizeEvent();
|
|
4617
4750
|
|
|
4618
|
-
|
|
4751
|
+
this._focustrap.deactivate();
|
|
4619
4752
|
|
|
4620
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
4753
|
+
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
|
4621
4754
|
|
|
4622
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS
|
|
4755
|
+
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
|
4623
4756
|
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
|
|
4624
4757
|
|
|
4625
4758
|
this._queueCallback(() => this._hideModal(), this._element, isAnimated);
|
|
@@ -4630,14 +4763,9 @@
|
|
|
4630
4763
|
|
|
4631
4764
|
this._backdrop.dispose();
|
|
4632
4765
|
|
|
4633
|
-
|
|
4634
|
-
/**
|
|
4635
|
-
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
|
4636
|
-
* Do not move `document` in `htmlElements` array
|
|
4637
|
-
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
|
4638
|
-
*/
|
|
4766
|
+
this._focustrap.deactivate();
|
|
4639
4767
|
|
|
4640
|
-
|
|
4768
|
+
super.dispose();
|
|
4641
4769
|
}
|
|
4642
4770
|
|
|
4643
4771
|
handleUpdate() {
|
|
@@ -4653,6 +4781,12 @@
|
|
|
4653
4781
|
});
|
|
4654
4782
|
}
|
|
4655
4783
|
|
|
4784
|
+
_initializeFocusTrap() {
|
|
4785
|
+
return new FocusTrap({
|
|
4786
|
+
trapElement: this._element
|
|
4787
|
+
});
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4656
4790
|
_getConfig(config) {
|
|
4657
4791
|
config = { ...Default$7,
|
|
4658
4792
|
...Manipulator.getDataAttributes(this._element),
|
|
@@ -4669,7 +4803,7 @@
|
|
|
4669
4803
|
|
|
4670
4804
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
|
4671
4805
|
// Don't move modal's DOM position
|
|
4672
|
-
document.body.
|
|
4806
|
+
document.body.append(this._element);
|
|
4673
4807
|
}
|
|
4674
4808
|
|
|
4675
4809
|
this._element.style.display = 'block';
|
|
@@ -4690,15 +4824,11 @@
|
|
|
4690
4824
|
reflow(this._element);
|
|
4691
4825
|
}
|
|
4692
4826
|
|
|
4693
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
4694
|
-
|
|
4695
|
-
if (this._config.focus) {
|
|
4696
|
-
this._enforceFocus();
|
|
4697
|
-
}
|
|
4827
|
+
this._element.classList.add(CLASS_NAME_SHOW$6);
|
|
4698
4828
|
|
|
4699
4829
|
const transitionComplete = () => {
|
|
4700
4830
|
if (this._config.focus) {
|
|
4701
|
-
this.
|
|
4831
|
+
this._focustrap.activate();
|
|
4702
4832
|
}
|
|
4703
4833
|
|
|
4704
4834
|
this._isTransitioning = false;
|
|
@@ -4710,16 +4840,6 @@
|
|
|
4710
4840
|
this._queueCallback(transitionComplete, this._dialog, isAnimated);
|
|
4711
4841
|
}
|
|
4712
4842
|
|
|
4713
|
-
_enforceFocus() {
|
|
4714
|
-
EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
|
|
4715
|
-
|
|
4716
|
-
EventHandler.on(document, EVENT_FOCUSIN$2, event => {
|
|
4717
|
-
if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
|
|
4718
|
-
this._element.focus();
|
|
4719
|
-
}
|
|
4720
|
-
});
|
|
4721
|
-
}
|
|
4722
|
-
|
|
4723
4843
|
_setEscapeEvent() {
|
|
4724
4844
|
if (this._isShown) {
|
|
4725
4845
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
|
@@ -4766,7 +4886,7 @@
|
|
|
4766
4886
|
}
|
|
4767
4887
|
|
|
4768
4888
|
_showBackdrop(callback) {
|
|
4769
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS
|
|
4889
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
|
|
4770
4890
|
if (this._ignoreBackdropClick) {
|
|
4771
4891
|
this._ignoreBackdropClick = false;
|
|
4772
4892
|
return;
|
|
@@ -4787,7 +4907,7 @@
|
|
|
4787
4907
|
}
|
|
4788
4908
|
|
|
4789
4909
|
_isAnimated() {
|
|
4790
|
-
return this._element.classList.contains(CLASS_NAME_FADE$
|
|
4910
|
+
return this._element.classList.contains(CLASS_NAME_FADE$3);
|
|
4791
4911
|
}
|
|
4792
4912
|
|
|
4793
4913
|
_triggerBackdropTransition() {
|
|
@@ -4894,10 +5014,18 @@
|
|
|
4894
5014
|
this.focus();
|
|
4895
5015
|
}
|
|
4896
5016
|
});
|
|
4897
|
-
});
|
|
5017
|
+
}); // avoid conflict when clicking moddal toggler while another one is open
|
|
5018
|
+
|
|
5019
|
+
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
|
|
5020
|
+
|
|
5021
|
+
if (allReadyOpen) {
|
|
5022
|
+
Modal.getInstance(allReadyOpen).hide();
|
|
5023
|
+
}
|
|
5024
|
+
|
|
4898
5025
|
const data = Modal.getOrCreateInstance(target);
|
|
4899
5026
|
data.toggle(this);
|
|
4900
5027
|
});
|
|
5028
|
+
enableDismissTrigger(Modal);
|
|
4901
5029
|
/**
|
|
4902
5030
|
* ------------------------------------------------------------------------
|
|
4903
5031
|
* jQuery
|
|
@@ -4909,7 +5037,7 @@
|
|
|
4909
5037
|
|
|
4910
5038
|
/**
|
|
4911
5039
|
* --------------------------------------------------------------------------
|
|
4912
|
-
* CoreUI (v4.
|
|
5040
|
+
* CoreUI (v4.1.1): navigation.js
|
|
4913
5041
|
* Licensed under MIT (https://coreui.io/license)
|
|
4914
5042
|
* --------------------------------------------------------------------------
|
|
4915
5043
|
*/
|
|
@@ -4932,7 +5060,7 @@
|
|
|
4932
5060
|
groupsAutoCollapse: '(string|boolean)'
|
|
4933
5061
|
};
|
|
4934
5062
|
const CLASS_NAME_ACTIVE$2 = 'active';
|
|
4935
|
-
const CLASS_NAME_SHOW$
|
|
5063
|
+
const CLASS_NAME_SHOW$5 = 'show';
|
|
4936
5064
|
const CLASS_NAME_NAV_GROUP = 'nav-group';
|
|
4937
5065
|
const CLASS_NAME_NAV_GROUP_TOGGLE = 'nav-group-toggle';
|
|
4938
5066
|
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
|
@@ -4971,6 +5099,10 @@
|
|
|
4971
5099
|
|
|
4972
5100
|
static get DefaultType() {
|
|
4973
5101
|
return DefaultType$6;
|
|
5102
|
+
}
|
|
5103
|
+
|
|
5104
|
+
static get NAME() {
|
|
5105
|
+
return NAME$7;
|
|
4974
5106
|
} // Private
|
|
4975
5107
|
|
|
4976
5108
|
|
|
@@ -5005,7 +5137,7 @@
|
|
|
5005
5137
|
if (this._config.activeLinksExact && element.href === currentUrl) {
|
|
5006
5138
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
5007
5139
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
5008
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
5140
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
5009
5141
|
element.setAttribute('aria-expanded', true);
|
|
5010
5142
|
});
|
|
5011
5143
|
}
|
|
@@ -5013,7 +5145,7 @@
|
|
|
5013
5145
|
if (!this._config.activeLinksExact && element.href.startsWith(currentUrl)) {
|
|
5014
5146
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
5015
5147
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
5016
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
5148
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
5017
5149
|
element.setAttribute('aria-expanded', true);
|
|
5018
5150
|
});
|
|
5019
5151
|
}
|
|
@@ -5112,28 +5244,28 @@
|
|
|
5112
5244
|
toggler = toggler.closest(SELECTOR_NAV_GROUP_TOGGLE);
|
|
5113
5245
|
}
|
|
5114
5246
|
|
|
5115
|
-
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$
|
|
5247
|
+
const filter = element => Boolean(element.classList.contains(CLASS_NAME_NAV_GROUP) && element.classList.contains(CLASS_NAME_SHOW$5)); // Close other groups
|
|
5116
5248
|
|
|
5117
5249
|
|
|
5118
5250
|
if (this._config.groupsAutoCollapse === true) {
|
|
5119
5251
|
this._getSiblings(toggler.parentNode, filter).forEach(element => {
|
|
5120
5252
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, element), () => {
|
|
5121
|
-
element.classList.remove(CLASS_NAME_SHOW$
|
|
5253
|
+
element.classList.remove(CLASS_NAME_SHOW$5);
|
|
5122
5254
|
element.setAttribute('aria-expanded', false);
|
|
5123
5255
|
});
|
|
5124
5256
|
});
|
|
5125
5257
|
}
|
|
5126
5258
|
|
|
5127
|
-
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$
|
|
5259
|
+
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$5)) {
|
|
5128
5260
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode), () => {
|
|
5129
|
-
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$
|
|
5261
|
+
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$5);
|
|
5130
5262
|
toggler.parentNode.setAttribute('aria-expanded', false);
|
|
5131
5263
|
});
|
|
5132
5264
|
|
|
5133
5265
|
return;
|
|
5134
5266
|
}
|
|
5135
5267
|
|
|
5136
|
-
toggler.parentNode.classList.add(CLASS_NAME_SHOW$
|
|
5268
|
+
toggler.parentNode.classList.add(CLASS_NAME_SHOW$5);
|
|
5137
5269
|
toggler.parentNode.setAttribute('aria-expanded', true);
|
|
5138
5270
|
|
|
5139
5271
|
this._slideDown(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode));
|
|
@@ -5186,11 +5318,11 @@
|
|
|
5186
5318
|
* add .Navigation to jQuery only if jQuery is present
|
|
5187
5319
|
*/
|
|
5188
5320
|
|
|
5189
|
-
defineJQueryPlugin(
|
|
5321
|
+
defineJQueryPlugin(Navigation);
|
|
5190
5322
|
|
|
5191
5323
|
/**
|
|
5192
5324
|
* --------------------------------------------------------------------------
|
|
5193
|
-
* CoreUI (v4.
|
|
5325
|
+
* CoreUI (v4.1.1): dropdown.js
|
|
5194
5326
|
* Licensed under MIT (https://coreui.io/license)
|
|
5195
5327
|
*
|
|
5196
5328
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
@@ -5219,17 +5351,15 @@
|
|
|
5219
5351
|
keyboard: 'boolean',
|
|
5220
5352
|
scroll: 'boolean'
|
|
5221
5353
|
};
|
|
5222
|
-
const CLASS_NAME_SHOW$
|
|
5354
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
|
5355
|
+
const CLASS_NAME_BACKDROP$1 = 'offcanvas-backdrop';
|
|
5223
5356
|
const OPEN_SELECTOR = '.offcanvas.show';
|
|
5224
5357
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
|
5225
5358
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
|
5226
5359
|
const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
|
|
5227
5360
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
|
5228
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
|
|
5229
5361
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
|
5230
|
-
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$6}`;
|
|
5231
5362
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$6}`;
|
|
5232
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-coreui-dismiss="offcanvas"]';
|
|
5233
5363
|
const SELECTOR_DATA_TOGGLE$2 = '[data-coreui-toggle="offcanvas"]';
|
|
5234
5364
|
/**
|
|
5235
5365
|
* ------------------------------------------------------------------------
|
|
@@ -5243,6 +5373,7 @@
|
|
|
5243
5373
|
this._config = this._getConfig(config);
|
|
5244
5374
|
this._isShown = false;
|
|
5245
5375
|
this._backdrop = this._initializeBackDrop();
|
|
5376
|
+
this._focustrap = this._initializeFocusTrap();
|
|
5246
5377
|
|
|
5247
5378
|
this._addEventListeners();
|
|
5248
5379
|
} // Getters
|
|
@@ -5281,8 +5412,6 @@
|
|
|
5281
5412
|
|
|
5282
5413
|
if (!this._config.scroll) {
|
|
5283
5414
|
new ScrollBarHelper().hide();
|
|
5284
|
-
|
|
5285
|
-
this._enforceFocusOnElement(this._element);
|
|
5286
5415
|
}
|
|
5287
5416
|
|
|
5288
5417
|
this._element.removeAttribute('aria-hidden');
|
|
@@ -5291,9 +5420,13 @@
|
|
|
5291
5420
|
|
|
5292
5421
|
this._element.setAttribute('role', 'dialog');
|
|
5293
5422
|
|
|
5294
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
5423
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
|
5295
5424
|
|
|
5296
5425
|
const completeCallBack = () => {
|
|
5426
|
+
if (!this._config.scroll) {
|
|
5427
|
+
this._focustrap.activate();
|
|
5428
|
+
}
|
|
5429
|
+
|
|
5297
5430
|
EventHandler.trigger(this._element, EVENT_SHOWN$3, {
|
|
5298
5431
|
relatedTarget
|
|
5299
5432
|
});
|
|
@@ -5313,13 +5446,13 @@
|
|
|
5313
5446
|
return;
|
|
5314
5447
|
}
|
|
5315
5448
|
|
|
5316
|
-
|
|
5449
|
+
this._focustrap.deactivate();
|
|
5317
5450
|
|
|
5318
5451
|
this._element.blur();
|
|
5319
5452
|
|
|
5320
5453
|
this._isShown = false;
|
|
5321
5454
|
|
|
5322
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
5455
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
|
5323
5456
|
|
|
5324
5457
|
this._backdrop.hide();
|
|
5325
5458
|
|
|
@@ -5345,8 +5478,9 @@
|
|
|
5345
5478
|
dispose() {
|
|
5346
5479
|
this._backdrop.dispose();
|
|
5347
5480
|
|
|
5481
|
+
this._focustrap.deactivate();
|
|
5482
|
+
|
|
5348
5483
|
super.dispose();
|
|
5349
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
|
5350
5484
|
} // Private
|
|
5351
5485
|
|
|
5352
5486
|
|
|
@@ -5361,6 +5495,7 @@
|
|
|
5361
5495
|
|
|
5362
5496
|
_initializeBackDrop() {
|
|
5363
5497
|
return new Backdrop({
|
|
5498
|
+
className: CLASS_NAME_BACKDROP$1,
|
|
5364
5499
|
isVisible: this._config.backdrop,
|
|
5365
5500
|
isAnimated: true,
|
|
5366
5501
|
rootElement: this._element.parentNode,
|
|
@@ -5368,19 +5503,13 @@
|
|
|
5368
5503
|
});
|
|
5369
5504
|
}
|
|
5370
5505
|
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
EventHandler.on(document, EVENT_FOCUSIN$1, event => {
|
|
5375
|
-
if (document !== event.target && element !== event.target && !element.contains(event.target)) {
|
|
5376
|
-
element.focus();
|
|
5377
|
-
}
|
|
5506
|
+
_initializeFocusTrap() {
|
|
5507
|
+
return new FocusTrap({
|
|
5508
|
+
trapElement: this._element
|
|
5378
5509
|
});
|
|
5379
|
-
element.focus();
|
|
5380
5510
|
}
|
|
5381
5511
|
|
|
5382
5512
|
_addEventListeners() {
|
|
5383
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
|
5384
5513
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
|
5385
5514
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
|
5386
5515
|
this.hide();
|
|
@@ -5441,6 +5570,7 @@
|
|
|
5441
5570
|
data.toggle(this);
|
|
5442
5571
|
});
|
|
5443
5572
|
EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
|
5573
|
+
enableDismissTrigger(Offcanvas);
|
|
5444
5574
|
/**
|
|
5445
5575
|
* ------------------------------------------------------------------------
|
|
5446
5576
|
* jQuery
|
|
@@ -5451,45 +5581,45 @@
|
|
|
5451
5581
|
|
|
5452
5582
|
/**
|
|
5453
5583
|
* --------------------------------------------------------------------------
|
|
5454
|
-
* CoreUI (v4.
|
|
5584
|
+
* CoreUI (v4.1.1): alert.js
|
|
5455
5585
|
* Licensed under MIT (https://coreui.io/license)
|
|
5456
5586
|
*
|
|
5457
5587
|
* This component is a modified version of the Bootstrap's util/sanitizer.js
|
|
5458
5588
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5459
5589
|
* --------------------------------------------------------------------------
|
|
5460
5590
|
*/
|
|
5461
|
-
const
|
|
5591
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
5462
5592
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
5463
5593
|
/**
|
|
5464
5594
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
5465
5595
|
*
|
|
5466
|
-
* Shoutout to Angular
|
|
5596
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5467
5597
|
*/
|
|
5468
5598
|
|
|
5469
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5599
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5470
5600
|
/**
|
|
5471
5601
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
5472
5602
|
*
|
|
5473
|
-
* Shoutout to Angular
|
|
5603
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5474
5604
|
*/
|
|
5475
5605
|
|
|
5476
5606
|
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;
|
|
5477
5607
|
|
|
5478
|
-
const allowedAttribute = (
|
|
5479
|
-
const
|
|
5608
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
5609
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
5480
5610
|
|
|
5481
|
-
if (allowedAttributeList.includes(
|
|
5482
|
-
if (
|
|
5483
|
-
return Boolean(SAFE_URL_PATTERN.test(
|
|
5611
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
5612
|
+
if (uriAttributes.has(attributeName)) {
|
|
5613
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
|
5484
5614
|
}
|
|
5485
5615
|
|
|
5486
5616
|
return true;
|
|
5487
5617
|
}
|
|
5488
5618
|
|
|
5489
|
-
const regExp = allowedAttributeList.filter(
|
|
5619
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
|
5490
5620
|
|
|
5491
5621
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
|
5492
|
-
if (regExp[i].test(
|
|
5622
|
+
if (regExp[i].test(attributeName)) {
|
|
5493
5623
|
return true;
|
|
5494
5624
|
}
|
|
5495
5625
|
}
|
|
@@ -5541,23 +5671,22 @@
|
|
|
5541
5671
|
|
|
5542
5672
|
const domParser = new window.DOMParser();
|
|
5543
5673
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
5544
|
-
const allowlistKeys = Object.keys(allowList);
|
|
5545
5674
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
5546
5675
|
|
|
5547
5676
|
for (let i = 0, len = elements.length; i < len; i++) {
|
|
5548
|
-
const
|
|
5549
|
-
const
|
|
5677
|
+
const element = elements[i];
|
|
5678
|
+
const elementName = element.nodeName.toLowerCase();
|
|
5550
5679
|
|
|
5551
|
-
if (!
|
|
5552
|
-
|
|
5680
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
5681
|
+
element.remove();
|
|
5553
5682
|
continue;
|
|
5554
5683
|
}
|
|
5555
5684
|
|
|
5556
|
-
const attributeList = [].concat(...
|
|
5557
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
|
5558
|
-
attributeList.forEach(
|
|
5559
|
-
if (!allowedAttribute(
|
|
5560
|
-
|
|
5685
|
+
const attributeList = [].concat(...element.attributes);
|
|
5686
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
|
5687
|
+
attributeList.forEach(attribute => {
|
|
5688
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
5689
|
+
element.removeAttribute(attribute.nodeName);
|
|
5561
5690
|
}
|
|
5562
5691
|
});
|
|
5563
5692
|
}
|
|
@@ -5567,7 +5696,7 @@
|
|
|
5567
5696
|
|
|
5568
5697
|
/**
|
|
5569
5698
|
* --------------------------------------------------------------------------
|
|
5570
|
-
* CoreUI (v4.
|
|
5699
|
+
* CoreUI (v4.1.1): tooltip.js
|
|
5571
5700
|
* Licensed under MIT (https://coreui.io/license)
|
|
5572
5701
|
*
|
|
5573
5702
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
@@ -5584,7 +5713,6 @@
|
|
|
5584
5713
|
const DATA_KEY$5 = 'coreui.tooltip';
|
|
5585
5714
|
const EVENT_KEY$5 = `.${DATA_KEY$5}`;
|
|
5586
5715
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
|
5587
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
|
5588
5716
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
5589
5717
|
const DefaultType$4 = {
|
|
5590
5718
|
animation: 'boolean',
|
|
@@ -5643,12 +5771,14 @@
|
|
|
5643
5771
|
MOUSEENTER: `mouseenter${EVENT_KEY$5}`,
|
|
5644
5772
|
MOUSELEAVE: `mouseleave${EVENT_KEY$5}`
|
|
5645
5773
|
};
|
|
5646
|
-
const CLASS_NAME_FADE$
|
|
5774
|
+
const CLASS_NAME_FADE$2 = 'fade';
|
|
5647
5775
|
const CLASS_NAME_MODAL = 'modal';
|
|
5648
|
-
const CLASS_NAME_SHOW$
|
|
5776
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
|
5649
5777
|
const HOVER_STATE_SHOW = 'show';
|
|
5650
5778
|
const HOVER_STATE_OUT = 'out';
|
|
5651
5779
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
5780
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
5781
|
+
const EVENT_MODAL_HIDE = 'hide.coreui.modal';
|
|
5652
5782
|
const TRIGGER_HOVER = 'hover';
|
|
5653
5783
|
const TRIGGER_FOCUS = 'focus';
|
|
5654
5784
|
const TRIGGER_CLICK = 'click';
|
|
@@ -5725,7 +5855,7 @@
|
|
|
5725
5855
|
context._leave(null, context);
|
|
5726
5856
|
}
|
|
5727
5857
|
} else {
|
|
5728
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
5858
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
|
|
5729
5859
|
this._leave(null, this);
|
|
5730
5860
|
|
|
5731
5861
|
return;
|
|
@@ -5737,15 +5867,13 @@
|
|
|
5737
5867
|
|
|
5738
5868
|
dispose() {
|
|
5739
5869
|
clearTimeout(this._timeout);
|
|
5740
|
-
EventHandler.off(this._element.closest(
|
|
5870
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
5741
5871
|
|
|
5742
5872
|
if (this.tip) {
|
|
5743
5873
|
this.tip.remove();
|
|
5744
5874
|
}
|
|
5745
5875
|
|
|
5746
|
-
|
|
5747
|
-
this._popper.destroy();
|
|
5748
|
-
}
|
|
5876
|
+
this._disposePopper();
|
|
5749
5877
|
|
|
5750
5878
|
super.dispose();
|
|
5751
5879
|
}
|
|
@@ -5765,6 +5893,15 @@
|
|
|
5765
5893
|
|
|
5766
5894
|
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
5767
5895
|
return;
|
|
5896
|
+
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-coreui-original-title`
|
|
5897
|
+
// This will be removed later in favor of a `setContent` method
|
|
5898
|
+
|
|
5899
|
+
|
|
5900
|
+
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
|
5901
|
+
this._disposePopper();
|
|
5902
|
+
|
|
5903
|
+
this.tip.remove();
|
|
5904
|
+
this.tip = null;
|
|
5768
5905
|
}
|
|
5769
5906
|
|
|
5770
5907
|
const tip = this.getTipElement();
|
|
@@ -5773,10 +5910,8 @@
|
|
|
5773
5910
|
|
|
5774
5911
|
this._element.setAttribute('aria-describedby', tipId);
|
|
5775
5912
|
|
|
5776
|
-
this.setContent();
|
|
5777
|
-
|
|
5778
5913
|
if (this._config.animation) {
|
|
5779
|
-
tip.classList.add(CLASS_NAME_FADE$
|
|
5914
|
+
tip.classList.add(CLASS_NAME_FADE$2);
|
|
5780
5915
|
}
|
|
5781
5916
|
|
|
5782
5917
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
|
@@ -5791,7 +5926,7 @@
|
|
|
5791
5926
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
|
5792
5927
|
|
|
5793
5928
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
5794
|
-
container.
|
|
5929
|
+
container.append(tip);
|
|
5795
5930
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
|
5796
5931
|
}
|
|
5797
5932
|
|
|
@@ -5801,8 +5936,9 @@
|
|
|
5801
5936
|
this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
5802
5937
|
}
|
|
5803
5938
|
|
|
5804
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
|
5805
|
-
|
|
5939
|
+
tip.classList.add(CLASS_NAME_SHOW$3);
|
|
5940
|
+
|
|
5941
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
|
5806
5942
|
|
|
5807
5943
|
if (customClass) {
|
|
5808
5944
|
tip.classList.add(...customClass.split(' '));
|
|
@@ -5828,7 +5964,7 @@
|
|
|
5828
5964
|
}
|
|
5829
5965
|
};
|
|
5830
5966
|
|
|
5831
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
5967
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
5832
5968
|
|
|
5833
5969
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5834
5970
|
}
|
|
@@ -5855,11 +5991,7 @@
|
|
|
5855
5991
|
|
|
5856
5992
|
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
|
5857
5993
|
|
|
5858
|
-
|
|
5859
|
-
this._popper.destroy();
|
|
5860
|
-
|
|
5861
|
-
this._popper = null;
|
|
5862
|
-
}
|
|
5994
|
+
this._disposePopper();
|
|
5863
5995
|
};
|
|
5864
5996
|
|
|
5865
5997
|
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
|
@@ -5868,7 +6000,7 @@
|
|
|
5868
6000
|
return;
|
|
5869
6001
|
}
|
|
5870
6002
|
|
|
5871
|
-
tip.classList.remove(CLASS_NAME_SHOW$
|
|
6003
|
+
tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
|
|
5872
6004
|
// empty mouseover listeners we added for iOS support
|
|
5873
6005
|
|
|
5874
6006
|
if ('ontouchstart' in document.documentElement) {
|
|
@@ -5878,7 +6010,7 @@
|
|
|
5878
6010
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
5879
6011
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
5880
6012
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
5881
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
6013
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
5882
6014
|
|
|
5883
6015
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5884
6016
|
|
|
@@ -5903,14 +6035,27 @@
|
|
|
5903
6035
|
|
|
5904
6036
|
const element = document.createElement('div');
|
|
5905
6037
|
element.innerHTML = this._config.template;
|
|
5906
|
-
|
|
6038
|
+
const tip = element.children[0];
|
|
6039
|
+
this.setContent(tip);
|
|
6040
|
+
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$3);
|
|
6041
|
+
this.tip = tip;
|
|
5907
6042
|
return this.tip;
|
|
5908
6043
|
}
|
|
5909
6044
|
|
|
5910
|
-
setContent() {
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
6045
|
+
setContent(tip) {
|
|
6046
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
|
|
6047
|
+
}
|
|
6048
|
+
|
|
6049
|
+
_sanitizeAndSetContent(template, content, selector) {
|
|
6050
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
|
6051
|
+
|
|
6052
|
+
if (!content && templateElement) {
|
|
6053
|
+
templateElement.remove();
|
|
6054
|
+
return;
|
|
6055
|
+
} // we use append for html objects to maintain js events
|
|
6056
|
+
|
|
6057
|
+
|
|
6058
|
+
this.setElementContent(templateElement, content);
|
|
5914
6059
|
}
|
|
5915
6060
|
|
|
5916
6061
|
setElementContent(element, content) {
|
|
@@ -5924,7 +6069,7 @@
|
|
|
5924
6069
|
if (this._config.html) {
|
|
5925
6070
|
if (content.parentNode !== element) {
|
|
5926
6071
|
element.innerHTML = '';
|
|
5927
|
-
element.
|
|
6072
|
+
element.append(content);
|
|
5928
6073
|
}
|
|
5929
6074
|
} else {
|
|
5930
6075
|
element.textContent = content.textContent;
|
|
@@ -5945,13 +6090,9 @@
|
|
|
5945
6090
|
}
|
|
5946
6091
|
|
|
5947
6092
|
getTitle() {
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
if (!title) {
|
|
5951
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
|
5952
|
-
}
|
|
6093
|
+
const title = this._element.getAttribute('data-coreui-original-title') || this._config.title;
|
|
5953
6094
|
|
|
5954
|
-
return title;
|
|
6095
|
+
return this._resolvePossibleFunction(title);
|
|
5955
6096
|
}
|
|
5956
6097
|
|
|
5957
6098
|
updateAttachment(attachment) {
|
|
@@ -5968,15 +6109,7 @@
|
|
|
5968
6109
|
|
|
5969
6110
|
|
|
5970
6111
|
_initializeOnDelegatedTarget(event, context) {
|
|
5971
|
-
|
|
5972
|
-
context = context || Data.get(event.delegateTarget, dataKey);
|
|
5973
|
-
|
|
5974
|
-
if (!context) {
|
|
5975
|
-
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
|
5976
|
-
Data.set(event.delegateTarget, dataKey, context);
|
|
5977
|
-
}
|
|
5978
|
-
|
|
5979
|
-
return context;
|
|
6112
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
|
5980
6113
|
}
|
|
5981
6114
|
|
|
5982
6115
|
_getOffset() {
|
|
@@ -5995,6 +6128,10 @@
|
|
|
5995
6128
|
return offset;
|
|
5996
6129
|
}
|
|
5997
6130
|
|
|
6131
|
+
_resolvePossibleFunction(content) {
|
|
6132
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
|
6133
|
+
}
|
|
6134
|
+
|
|
5998
6135
|
_getPopperConfig(attachment) {
|
|
5999
6136
|
const defaultBsPopperConfig = {
|
|
6000
6137
|
placement: attachment,
|
|
@@ -6036,7 +6173,7 @@
|
|
|
6036
6173
|
}
|
|
6037
6174
|
|
|
6038
6175
|
_addAttachmentClass(attachment) {
|
|
6039
|
-
this.getTipElement().classList.add(`${
|
|
6176
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
|
6040
6177
|
}
|
|
6041
6178
|
|
|
6042
6179
|
_getAttachment(placement) {
|
|
@@ -6063,7 +6200,7 @@
|
|
|
6063
6200
|
}
|
|
6064
6201
|
};
|
|
6065
6202
|
|
|
6066
|
-
EventHandler.on(this._element.closest(
|
|
6203
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
6067
6204
|
|
|
6068
6205
|
if (this._config.selector) {
|
|
6069
6206
|
this._config = { ...this._config,
|
|
@@ -6098,7 +6235,7 @@
|
|
|
6098
6235
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
6099
6236
|
}
|
|
6100
6237
|
|
|
6101
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
6238
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
|
|
6102
6239
|
context._hoverState = HOVER_STATE_SHOW;
|
|
6103
6240
|
return;
|
|
6104
6241
|
}
|
|
@@ -6194,26 +6331,32 @@
|
|
|
6194
6331
|
_getDelegateConfig() {
|
|
6195
6332
|
const config = {};
|
|
6196
6333
|
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
config[key] = this._config[key];
|
|
6201
|
-
}
|
|
6334
|
+
for (const key in this._config) {
|
|
6335
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
|
6336
|
+
config[key] = this._config[key];
|
|
6202
6337
|
}
|
|
6203
|
-
}
|
|
6338
|
+
} // In the future can be replaced with:
|
|
6339
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
|
6340
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
|
6341
|
+
|
|
6204
6342
|
|
|
6205
6343
|
return config;
|
|
6206
6344
|
}
|
|
6207
6345
|
|
|
6208
6346
|
_cleanTipClass() {
|
|
6209
6347
|
const tip = this.getTipElement();
|
|
6210
|
-
const
|
|
6348
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
|
6349
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
|
6211
6350
|
|
|
6212
6351
|
if (tabClass !== null && tabClass.length > 0) {
|
|
6213
6352
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
6214
6353
|
}
|
|
6215
6354
|
}
|
|
6216
6355
|
|
|
6356
|
+
_getBasicClassPrefix() {
|
|
6357
|
+
return CLASS_PREFIX$1;
|
|
6358
|
+
}
|
|
6359
|
+
|
|
6217
6360
|
_handlePopperPlacementChange(popperData) {
|
|
6218
6361
|
const {
|
|
6219
6362
|
state
|
|
@@ -6228,6 +6371,14 @@
|
|
|
6228
6371
|
this._cleanTipClass();
|
|
6229
6372
|
|
|
6230
6373
|
this._addAttachmentClass(this._getAttachment(state.placement));
|
|
6374
|
+
}
|
|
6375
|
+
|
|
6376
|
+
_disposePopper() {
|
|
6377
|
+
if (this._popper) {
|
|
6378
|
+
this._popper.destroy();
|
|
6379
|
+
|
|
6380
|
+
this._popper = null;
|
|
6381
|
+
}
|
|
6231
6382
|
} // Static
|
|
6232
6383
|
|
|
6233
6384
|
|
|
@@ -6258,7 +6409,7 @@
|
|
|
6258
6409
|
|
|
6259
6410
|
/**
|
|
6260
6411
|
* --------------------------------------------------------------------------
|
|
6261
|
-
* CoreUI (v4.
|
|
6412
|
+
* CoreUI (v4.1.1): popover.js
|
|
6262
6413
|
* Licensed under MIT (https://coreui.io/license)
|
|
6263
6414
|
*
|
|
6264
6415
|
* This component is a modified version of the Bootstrap's popover.js
|
|
@@ -6275,7 +6426,6 @@
|
|
|
6275
6426
|
const DATA_KEY$4 = 'coreui.popover';
|
|
6276
6427
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
|
6277
6428
|
const CLASS_PREFIX = 'bs-popover';
|
|
6278
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
|
6279
6429
|
const Default$3 = { ...Tooltip.Default,
|
|
6280
6430
|
placement: 'right',
|
|
6281
6431
|
offset: [0, 8],
|
|
@@ -6298,8 +6448,6 @@
|
|
|
6298
6448
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
|
6299
6449
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
|
6300
6450
|
};
|
|
6301
|
-
const CLASS_NAME_FADE$3 = 'fade';
|
|
6302
|
-
const CLASS_NAME_SHOW$3 = 'show';
|
|
6303
6451
|
const SELECTOR_TITLE = '.popover-header';
|
|
6304
6452
|
const SELECTOR_CONTENT = '.popover-body';
|
|
6305
6453
|
/**
|
|
@@ -6331,55 +6479,19 @@
|
|
|
6331
6479
|
return this.getTitle() || this._getContent();
|
|
6332
6480
|
}
|
|
6333
6481
|
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
return this.tip;
|
|
6337
|
-
}
|
|
6338
|
-
|
|
6339
|
-
this.tip = super.getTipElement();
|
|
6340
|
-
|
|
6341
|
-
if (!this.getTitle()) {
|
|
6342
|
-
SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove();
|
|
6343
|
-
}
|
|
6344
|
-
|
|
6345
|
-
if (!this._getContent()) {
|
|
6346
|
-
SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove();
|
|
6347
|
-
}
|
|
6348
|
-
|
|
6349
|
-
return this.tip;
|
|
6350
|
-
}
|
|
6351
|
-
|
|
6352
|
-
setContent() {
|
|
6353
|
-
const tip = this.getTipElement(); // we use append for html objects to maintain js events
|
|
6482
|
+
setContent(tip) {
|
|
6483
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
|
6354
6484
|
|
|
6355
|
-
this.
|
|
6356
|
-
|
|
6357
|
-
let content = this._getContent();
|
|
6358
|
-
|
|
6359
|
-
if (typeof content === 'function') {
|
|
6360
|
-
content = content.call(this._element);
|
|
6361
|
-
}
|
|
6362
|
-
|
|
6363
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
|
6364
|
-
tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
|
|
6485
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
|
6365
6486
|
} // Private
|
|
6366
6487
|
|
|
6367
6488
|
|
|
6368
|
-
_addAttachmentClass(attachment) {
|
|
6369
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
|
6370
|
-
}
|
|
6371
|
-
|
|
6372
6489
|
_getContent() {
|
|
6373
|
-
return this.
|
|
6490
|
+
return this._resolvePossibleFunction(this._config.content);
|
|
6374
6491
|
}
|
|
6375
6492
|
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
|
|
6379
|
-
|
|
6380
|
-
if (tabClass !== null && tabClass.length > 0) {
|
|
6381
|
-
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
6382
|
-
}
|
|
6493
|
+
_getBasicClassPrefix() {
|
|
6494
|
+
return CLASS_PREFIX;
|
|
6383
6495
|
} // Static
|
|
6384
6496
|
|
|
6385
6497
|
|
|
@@ -6410,7 +6522,7 @@
|
|
|
6410
6522
|
|
|
6411
6523
|
/**
|
|
6412
6524
|
* --------------------------------------------------------------------------
|
|
6413
|
-
* CoreUI (v4.
|
|
6525
|
+
* CoreUI (v4.1.1): scrollspy.js
|
|
6414
6526
|
* Licensed under MIT (https://coreui.io/license)
|
|
6415
6527
|
*
|
|
6416
6528
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
@@ -6648,7 +6760,7 @@
|
|
|
6648
6760
|
|
|
6649
6761
|
/**
|
|
6650
6762
|
* --------------------------------------------------------------------------
|
|
6651
|
-
* CoreUI (v4.
|
|
6763
|
+
* CoreUI (v4.1.1): sidebar.js
|
|
6652
6764
|
* Licensed under MIT (https://coreui.io/license)
|
|
6653
6765
|
* --------------------------------------------------------------------------
|
|
6654
6766
|
*/
|
|
@@ -6665,7 +6777,6 @@
|
|
|
6665
6777
|
const Default$1 = {};
|
|
6666
6778
|
const DefaultType$1 = {};
|
|
6667
6779
|
const CLASS_NAME_BACKDROP = 'sidebar-backdrop';
|
|
6668
|
-
const CLASS_NAME_FADE$2 = 'fade';
|
|
6669
6780
|
const CLASS_NAME_HIDE$1 = 'hide';
|
|
6670
6781
|
const CLASS_NAME_SHOW$2 = 'show';
|
|
6671
6782
|
const CLASS_NAME_SIDEBAR_NARROW = 'sidebar-narrow';
|
|
@@ -6696,7 +6807,7 @@
|
|
|
6696
6807
|
this._overlaid = this._isOverlaid();
|
|
6697
6808
|
this._narrow = this._isNarrow();
|
|
6698
6809
|
this._unfoldable = this._isUnfoldable();
|
|
6699
|
-
this._backdrop =
|
|
6810
|
+
this._backdrop = this._initializeBackDrop();
|
|
6700
6811
|
|
|
6701
6812
|
this._addEventListeners();
|
|
6702
6813
|
} // Getters
|
|
@@ -6725,7 +6836,9 @@
|
|
|
6725
6836
|
if (this._isMobile()) {
|
|
6726
6837
|
this._element.classList.add(CLASS_NAME_SHOW$2);
|
|
6727
6838
|
|
|
6728
|
-
this.
|
|
6839
|
+
this._backdrop.show();
|
|
6840
|
+
|
|
6841
|
+
new ScrollBarHelper().hide();
|
|
6729
6842
|
}
|
|
6730
6843
|
|
|
6731
6844
|
const complete = () => {
|
|
@@ -6751,7 +6864,9 @@
|
|
|
6751
6864
|
}
|
|
6752
6865
|
|
|
6753
6866
|
if (this._isMobile()) {
|
|
6754
|
-
this.
|
|
6867
|
+
this._backdrop.hide();
|
|
6868
|
+
|
|
6869
|
+
new ScrollBarHelper().reset();
|
|
6755
6870
|
} else {
|
|
6756
6871
|
this._element.classList.add(CLASS_NAME_HIDE$1);
|
|
6757
6872
|
}
|
|
@@ -6840,6 +6955,16 @@
|
|
|
6840
6955
|
return config;
|
|
6841
6956
|
}
|
|
6842
6957
|
|
|
6958
|
+
_initializeBackDrop() {
|
|
6959
|
+
return new Backdrop({
|
|
6960
|
+
className: CLASS_NAME_BACKDROP,
|
|
6961
|
+
isVisible: this._isMobile(),
|
|
6962
|
+
isAnimated: true,
|
|
6963
|
+
rootElement: this._element.parentNode,
|
|
6964
|
+
clickCallback: () => this.hide()
|
|
6965
|
+
});
|
|
6966
|
+
}
|
|
6967
|
+
|
|
6843
6968
|
_isMobile() {
|
|
6844
6969
|
return Boolean(window.getComputedStyle(this._element, null).getPropertyValue('--cui-is-mobile'));
|
|
6845
6970
|
}
|
|
@@ -6859,35 +6984,13 @@
|
|
|
6859
6984
|
_isVisible() {
|
|
6860
6985
|
const rect = this._element.getBoundingClientRect();
|
|
6861
6986
|
|
|
6862
|
-
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
6987
|
+
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);
|
|
6863
6988
|
}
|
|
6864
6989
|
|
|
6865
6990
|
_addClassName(className) {
|
|
6866
6991
|
this._element.classList.add(className);
|
|
6867
6992
|
}
|
|
6868
6993
|
|
|
6869
|
-
_removeBackdrop() {
|
|
6870
|
-
if (this._backdrop) {
|
|
6871
|
-
this._backdrop.parentNode.removeChild(this._backdrop);
|
|
6872
|
-
|
|
6873
|
-
this._backdrop = null;
|
|
6874
|
-
}
|
|
6875
|
-
}
|
|
6876
|
-
|
|
6877
|
-
_showBackdrop() {
|
|
6878
|
-
if (!this._backdrop) {
|
|
6879
|
-
this._backdrop = document.createElement('div');
|
|
6880
|
-
this._backdrop.className = CLASS_NAME_BACKDROP;
|
|
6881
|
-
|
|
6882
|
-
this._backdrop.classList.add(CLASS_NAME_FADE$2);
|
|
6883
|
-
|
|
6884
|
-
document.body.appendChild(this._backdrop);
|
|
6885
|
-
reflow(this._backdrop);
|
|
6886
|
-
|
|
6887
|
-
this._backdrop.classList.add(CLASS_NAME_SHOW$2);
|
|
6888
|
-
}
|
|
6889
|
-
}
|
|
6890
|
-
|
|
6891
6994
|
_clickOutListener(event, sidebar) {
|
|
6892
6995
|
if (event.target.closest(SELECTOR_SIDEBAR) === null) {
|
|
6893
6996
|
event.preventDefault();
|
|
@@ -6935,6 +7038,7 @@
|
|
|
6935
7038
|
EventHandler.on(window, EVENT_RESIZE, () => {
|
|
6936
7039
|
if (this._isMobile() && this._isVisible()) {
|
|
6937
7040
|
this.hide();
|
|
7041
|
+
this._backdrop = this._initializeBackDrop();
|
|
6938
7042
|
}
|
|
6939
7043
|
});
|
|
6940
7044
|
} // Static
|
|
@@ -6977,11 +7081,11 @@
|
|
|
6977
7081
|
* ------------------------------------------------------------------------
|
|
6978
7082
|
*/
|
|
6979
7083
|
|
|
6980
|
-
defineJQueryPlugin(
|
|
7084
|
+
defineJQueryPlugin(Sidebar);
|
|
6981
7085
|
|
|
6982
7086
|
/**
|
|
6983
7087
|
* --------------------------------------------------------------------------
|
|
6984
|
-
* CoreUI (v4.
|
|
7088
|
+
* CoreUI (v4.1.1): tab.js
|
|
6985
7089
|
* Licensed under MIT (https://coreui.io/license)
|
|
6986
7090
|
*
|
|
6987
7091
|
* This component is a modified version of the Bootstrap's tab.js
|
|
@@ -7182,7 +7286,7 @@
|
|
|
7182
7286
|
|
|
7183
7287
|
/**
|
|
7184
7288
|
* --------------------------------------------------------------------------
|
|
7185
|
-
* CoreUI (v4.
|
|
7289
|
+
* CoreUI (v4.1.1): toast.js
|
|
7186
7290
|
* Licensed under MIT (https://coreui.io/license)
|
|
7187
7291
|
*
|
|
7188
7292
|
* This component is a modified version of the Bootstrap's toast.js
|
|
@@ -7198,7 +7302,6 @@
|
|
|
7198
7302
|
const NAME = 'toast';
|
|
7199
7303
|
const DATA_KEY = 'coreui.toast';
|
|
7200
7304
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
7201
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
|
7202
7305
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
|
7203
7306
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
|
7204
7307
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
|
@@ -7208,7 +7311,8 @@
|
|
|
7208
7311
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
7209
7312
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
7210
7313
|
const CLASS_NAME_FADE = 'fade';
|
|
7211
|
-
const CLASS_NAME_HIDE = 'hide';
|
|
7314
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
|
7315
|
+
|
|
7212
7316
|
const CLASS_NAME_SHOW = 'show';
|
|
7213
7317
|
const CLASS_NAME_SHOWING = 'showing';
|
|
7214
7318
|
const DefaultType = {
|
|
@@ -7221,7 +7325,6 @@
|
|
|
7221
7325
|
autohide: true,
|
|
7222
7326
|
delay: 5000
|
|
7223
7327
|
};
|
|
7224
|
-
const SELECTOR_DATA_DISMISS = '[data-coreui-dismiss="toast"]';
|
|
7225
7328
|
/**
|
|
7226
7329
|
* ------------------------------------------------------------------------
|
|
7227
7330
|
* Class Definition
|
|
@@ -7269,17 +7372,18 @@
|
|
|
7269
7372
|
const complete = () => {
|
|
7270
7373
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
7271
7374
|
|
|
7272
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
7273
|
-
|
|
7274
7375
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
|
7275
7376
|
|
|
7276
7377
|
this._maybeScheduleHide();
|
|
7277
7378
|
};
|
|
7278
7379
|
|
|
7279
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
|
7380
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
|
7381
|
+
|
|
7280
7382
|
|
|
7281
7383
|
reflow(this._element);
|
|
7282
7384
|
|
|
7385
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
7386
|
+
|
|
7283
7387
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
7284
7388
|
|
|
7285
7389
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
@@ -7297,12 +7401,17 @@
|
|
|
7297
7401
|
}
|
|
7298
7402
|
|
|
7299
7403
|
const complete = () => {
|
|
7300
|
-
this._element.classList.add(CLASS_NAME_HIDE);
|
|
7404
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
|
7405
|
+
|
|
7406
|
+
|
|
7407
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
7408
|
+
|
|
7409
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
7301
7410
|
|
|
7302
7411
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
|
7303
7412
|
};
|
|
7304
7413
|
|
|
7305
|
-
this._element.classList.
|
|
7414
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
7306
7415
|
|
|
7307
7416
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
7308
7417
|
}
|
|
@@ -7370,7 +7479,6 @@
|
|
|
7370
7479
|
}
|
|
7371
7480
|
|
|
7372
7481
|
_setListeners() {
|
|
7373
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
|
7374
7482
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
|
7375
7483
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
|
7376
7484
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
|
@@ -7398,6 +7506,8 @@
|
|
|
7398
7506
|
}
|
|
7399
7507
|
|
|
7400
7508
|
}
|
|
7509
|
+
|
|
7510
|
+
enableDismissTrigger(Toast);
|
|
7401
7511
|
/**
|
|
7402
7512
|
* ------------------------------------------------------------------------
|
|
7403
7513
|
* jQuery
|
|
@@ -7405,16 +7515,15 @@
|
|
|
7405
7515
|
* add .Toast to jQuery only if jQuery is present
|
|
7406
7516
|
*/
|
|
7407
7517
|
|
|
7408
|
-
|
|
7409
7518
|
defineJQueryPlugin(Toast);
|
|
7410
7519
|
|
|
7411
7520
|
/**
|
|
7412
7521
|
* --------------------------------------------------------------------------
|
|
7413
|
-
* CoreUI (v4.
|
|
7522
|
+
* CoreUI (v4.1.1): index.esm.js
|
|
7414
7523
|
* Licensed under MIT (https://coreui.io/license)
|
|
7415
7524
|
* --------------------------------------------------------------------------
|
|
7416
7525
|
*/
|
|
7417
|
-
|
|
7526
|
+
const index_umd = {
|
|
7418
7527
|
Alert,
|
|
7419
7528
|
Button,
|
|
7420
7529
|
Carousel,
|
|
@@ -7433,5 +7542,5 @@
|
|
|
7433
7542
|
|
|
7434
7543
|
return index_umd;
|
|
7435
7544
|
|
|
7436
|
-
}))
|
|
7545
|
+
}));
|
|
7437
7546
|
//# sourceMappingURL=coreui.bundle.js.map
|