@coreui/coreui 4.0.5 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/css/coreui-grid.css +254 -205
- package/dist/css/coreui-grid.css.map +1 -1
- package/dist/css/coreui-grid.min.css +2 -2
- package/dist/css/coreui-grid.min.css.map +1 -1
- package/dist/css/coreui-grid.rtl.css +255 -206
- package/dist/css/coreui-grid.rtl.css.map +1 -1
- package/dist/css/coreui-grid.rtl.min.css +3 -3
- package/dist/css/coreui-grid.rtl.min.css.map +1 -1
- package/dist/css/coreui-reboot.css +63 -8
- package/dist/css/coreui-reboot.css.map +1 -1
- package/dist/css/coreui-reboot.min.css +2 -2
- package/dist/css/coreui-reboot.min.css.map +1 -1
- package/dist/css/coreui-reboot.rtl.css +64 -9
- package/dist/css/coreui-reboot.rtl.css.map +1 -1
- package/dist/css/coreui-reboot.rtl.min.css +3 -3
- package/dist/css/coreui-reboot.rtl.min.css.map +1 -1
- package/dist/css/coreui-utilities.css +181 -81
- package/dist/css/coreui-utilities.css.map +1 -1
- package/dist/css/coreui-utilities.min.css +2 -2
- package/dist/css/coreui-utilities.min.css.map +1 -1
- package/dist/css/coreui-utilities.rtl.css +182 -82
- package/dist/css/coreui-utilities.rtl.css.map +1 -1
- package/dist/css/coreui-utilities.rtl.min.css +3 -3
- package/dist/css/coreui-utilities.rtl.min.css.map +1 -1
- package/dist/css/coreui.css +713 -346
- 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 +699 -347
- 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 +851 -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 +704 -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 +714 -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 +1 -1
- package/js/src/offcanvas.js +16 -18
- package/js/src/popover.js +7 -49
- package/js/src/scrollspy.js +1 -1
- package/js/src/sidebar.js +21 -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 +28 -33
- package/scss/mixins/_visually-hidden.scss +1 -1
- package/scss/sidebar/_sidebar-nav.scss +1 -0
package/dist/js/coreui.bundle.js
CHANGED
|
@@ -1,108 +1,33 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* CoreUI v4.
|
|
3
|
-
* Copyright
|
|
2
|
+
* CoreUI v4.1.2 (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.5): alert.js
|
|
14
|
+
* CoreUI (v4.1.2): 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.2): 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.2): 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.2): 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.2';
|
|
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.2): 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.2): 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.2): 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.2): 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.2): 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.2): 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.2): 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$
|
|
3855
|
-
} // Public
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
toggle() {
|
|
3859
|
-
if (isDisabled(this._element)) {
|
|
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
|
-
}
|
|
3900
|
+
return NAME$b;
|
|
3901
|
+
} // Public
|
|
3869
3902
|
|
|
3870
|
-
|
|
3903
|
+
|
|
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.2): 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.2): 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}`;
|
|
@@ -5009,7 +5137,7 @@
|
|
|
5009
5137
|
if (this._config.activeLinksExact && element.href === currentUrl) {
|
|
5010
5138
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
5011
5139
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
5012
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
5140
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
5013
5141
|
element.setAttribute('aria-expanded', true);
|
|
5014
5142
|
});
|
|
5015
5143
|
}
|
|
@@ -5017,7 +5145,7 @@
|
|
|
5017
5145
|
if (!this._config.activeLinksExact && element.href.startsWith(currentUrl)) {
|
|
5018
5146
|
element.classList.add(CLASS_NAME_ACTIVE$2);
|
|
5019
5147
|
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {
|
|
5020
|
-
element.classList.add(CLASS_NAME_SHOW$
|
|
5148
|
+
element.classList.add(CLASS_NAME_SHOW$5);
|
|
5021
5149
|
element.setAttribute('aria-expanded', true);
|
|
5022
5150
|
});
|
|
5023
5151
|
}
|
|
@@ -5116,28 +5244,28 @@
|
|
|
5116
5244
|
toggler = toggler.closest(SELECTOR_NAV_GROUP_TOGGLE);
|
|
5117
5245
|
}
|
|
5118
5246
|
|
|
5119
|
-
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
|
|
5120
5248
|
|
|
5121
5249
|
|
|
5122
5250
|
if (this._config.groupsAutoCollapse === true) {
|
|
5123
5251
|
this._getSiblings(toggler.parentNode, filter).forEach(element => {
|
|
5124
5252
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, element), () => {
|
|
5125
|
-
element.classList.remove(CLASS_NAME_SHOW$
|
|
5253
|
+
element.classList.remove(CLASS_NAME_SHOW$5);
|
|
5126
5254
|
element.setAttribute('aria-expanded', false);
|
|
5127
5255
|
});
|
|
5128
5256
|
});
|
|
5129
5257
|
}
|
|
5130
5258
|
|
|
5131
|
-
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$
|
|
5259
|
+
if (toggler.parentNode.classList.contains(CLASS_NAME_SHOW$5)) {
|
|
5132
5260
|
this._slideUp(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode), () => {
|
|
5133
|
-
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$
|
|
5261
|
+
toggler.parentNode.classList.remove(CLASS_NAME_SHOW$5);
|
|
5134
5262
|
toggler.parentNode.setAttribute('aria-expanded', false);
|
|
5135
5263
|
});
|
|
5136
5264
|
|
|
5137
5265
|
return;
|
|
5138
5266
|
}
|
|
5139
5267
|
|
|
5140
|
-
toggler.parentNode.classList.add(CLASS_NAME_SHOW$
|
|
5268
|
+
toggler.parentNode.classList.add(CLASS_NAME_SHOW$5);
|
|
5141
5269
|
toggler.parentNode.setAttribute('aria-expanded', true);
|
|
5142
5270
|
|
|
5143
5271
|
this._slideDown(SelectorEngine.findOne(SELECTOR_NAV_GROUP_ITEMS, toggler.parentNode));
|
|
@@ -5194,7 +5322,7 @@
|
|
|
5194
5322
|
|
|
5195
5323
|
/**
|
|
5196
5324
|
* --------------------------------------------------------------------------
|
|
5197
|
-
* CoreUI (v4.
|
|
5325
|
+
* CoreUI (v4.1.2): dropdown.js
|
|
5198
5326
|
* Licensed under MIT (https://coreui.io/license)
|
|
5199
5327
|
*
|
|
5200
5328
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
@@ -5223,17 +5351,15 @@
|
|
|
5223
5351
|
keyboard: 'boolean',
|
|
5224
5352
|
scroll: 'boolean'
|
|
5225
5353
|
};
|
|
5226
|
-
const CLASS_NAME_SHOW$
|
|
5354
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
|
5355
|
+
const CLASS_NAME_BACKDROP$1 = 'offcanvas-backdrop';
|
|
5227
5356
|
const OPEN_SELECTOR = '.offcanvas.show';
|
|
5228
5357
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
|
5229
5358
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
|
5230
5359
|
const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
|
|
5231
5360
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
|
5232
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
|
|
5233
5361
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
|
5234
|
-
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$6}`;
|
|
5235
5362
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$6}`;
|
|
5236
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-coreui-dismiss="offcanvas"]';
|
|
5237
5363
|
const SELECTOR_DATA_TOGGLE$2 = '[data-coreui-toggle="offcanvas"]';
|
|
5238
5364
|
/**
|
|
5239
5365
|
* ------------------------------------------------------------------------
|
|
@@ -5247,6 +5373,7 @@
|
|
|
5247
5373
|
this._config = this._getConfig(config);
|
|
5248
5374
|
this._isShown = false;
|
|
5249
5375
|
this._backdrop = this._initializeBackDrop();
|
|
5376
|
+
this._focustrap = this._initializeFocusTrap();
|
|
5250
5377
|
|
|
5251
5378
|
this._addEventListeners();
|
|
5252
5379
|
} // Getters
|
|
@@ -5285,8 +5412,6 @@
|
|
|
5285
5412
|
|
|
5286
5413
|
if (!this._config.scroll) {
|
|
5287
5414
|
new ScrollBarHelper().hide();
|
|
5288
|
-
|
|
5289
|
-
this._enforceFocusOnElement(this._element);
|
|
5290
5415
|
}
|
|
5291
5416
|
|
|
5292
5417
|
this._element.removeAttribute('aria-hidden');
|
|
@@ -5295,9 +5420,13 @@
|
|
|
5295
5420
|
|
|
5296
5421
|
this._element.setAttribute('role', 'dialog');
|
|
5297
5422
|
|
|
5298
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
5423
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
|
5299
5424
|
|
|
5300
5425
|
const completeCallBack = () => {
|
|
5426
|
+
if (!this._config.scroll) {
|
|
5427
|
+
this._focustrap.activate();
|
|
5428
|
+
}
|
|
5429
|
+
|
|
5301
5430
|
EventHandler.trigger(this._element, EVENT_SHOWN$3, {
|
|
5302
5431
|
relatedTarget
|
|
5303
5432
|
});
|
|
@@ -5317,13 +5446,13 @@
|
|
|
5317
5446
|
return;
|
|
5318
5447
|
}
|
|
5319
5448
|
|
|
5320
|
-
|
|
5449
|
+
this._focustrap.deactivate();
|
|
5321
5450
|
|
|
5322
5451
|
this._element.blur();
|
|
5323
5452
|
|
|
5324
5453
|
this._isShown = false;
|
|
5325
5454
|
|
|
5326
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
5455
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
|
5327
5456
|
|
|
5328
5457
|
this._backdrop.hide();
|
|
5329
5458
|
|
|
@@ -5349,8 +5478,9 @@
|
|
|
5349
5478
|
dispose() {
|
|
5350
5479
|
this._backdrop.dispose();
|
|
5351
5480
|
|
|
5481
|
+
this._focustrap.deactivate();
|
|
5482
|
+
|
|
5352
5483
|
super.dispose();
|
|
5353
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
|
5354
5484
|
} // Private
|
|
5355
5485
|
|
|
5356
5486
|
|
|
@@ -5365,6 +5495,7 @@
|
|
|
5365
5495
|
|
|
5366
5496
|
_initializeBackDrop() {
|
|
5367
5497
|
return new Backdrop({
|
|
5498
|
+
className: CLASS_NAME_BACKDROP$1,
|
|
5368
5499
|
isVisible: this._config.backdrop,
|
|
5369
5500
|
isAnimated: true,
|
|
5370
5501
|
rootElement: this._element.parentNode,
|
|
@@ -5372,19 +5503,13 @@
|
|
|
5372
5503
|
});
|
|
5373
5504
|
}
|
|
5374
5505
|
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
EventHandler.on(document, EVENT_FOCUSIN$1, event => {
|
|
5379
|
-
if (document !== event.target && element !== event.target && !element.contains(event.target)) {
|
|
5380
|
-
element.focus();
|
|
5381
|
-
}
|
|
5506
|
+
_initializeFocusTrap() {
|
|
5507
|
+
return new FocusTrap({
|
|
5508
|
+
trapElement: this._element
|
|
5382
5509
|
});
|
|
5383
|
-
element.focus();
|
|
5384
5510
|
}
|
|
5385
5511
|
|
|
5386
5512
|
_addEventListeners() {
|
|
5387
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
|
5388
5513
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
|
5389
5514
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
|
5390
5515
|
this.hide();
|
|
@@ -5445,6 +5570,7 @@
|
|
|
5445
5570
|
data.toggle(this);
|
|
5446
5571
|
});
|
|
5447
5572
|
EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
|
5573
|
+
enableDismissTrigger(Offcanvas);
|
|
5448
5574
|
/**
|
|
5449
5575
|
* ------------------------------------------------------------------------
|
|
5450
5576
|
* jQuery
|
|
@@ -5455,45 +5581,45 @@
|
|
|
5455
5581
|
|
|
5456
5582
|
/**
|
|
5457
5583
|
* --------------------------------------------------------------------------
|
|
5458
|
-
* CoreUI (v4.
|
|
5584
|
+
* CoreUI (v4.1.2): alert.js
|
|
5459
5585
|
* Licensed under MIT (https://coreui.io/license)
|
|
5460
5586
|
*
|
|
5461
5587
|
* This component is a modified version of the Bootstrap's util/sanitizer.js
|
|
5462
5588
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5463
5589
|
* --------------------------------------------------------------------------
|
|
5464
5590
|
*/
|
|
5465
|
-
const
|
|
5591
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
5466
5592
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
5467
5593
|
/**
|
|
5468
5594
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
5469
5595
|
*
|
|
5470
|
-
* Shoutout to Angular
|
|
5596
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5471
5597
|
*/
|
|
5472
5598
|
|
|
5473
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5599
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5474
5600
|
/**
|
|
5475
5601
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
5476
5602
|
*
|
|
5477
|
-
* Shoutout to Angular
|
|
5603
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5478
5604
|
*/
|
|
5479
5605
|
|
|
5480
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;
|
|
5481
5607
|
|
|
5482
|
-
const allowedAttribute = (
|
|
5483
|
-
const
|
|
5608
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
5609
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
5484
5610
|
|
|
5485
|
-
if (allowedAttributeList.includes(
|
|
5486
|
-
if (
|
|
5487
|
-
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));
|
|
5488
5614
|
}
|
|
5489
5615
|
|
|
5490
5616
|
return true;
|
|
5491
5617
|
}
|
|
5492
5618
|
|
|
5493
|
-
const regExp = allowedAttributeList.filter(
|
|
5619
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
|
5494
5620
|
|
|
5495
5621
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
|
5496
|
-
if (regExp[i].test(
|
|
5622
|
+
if (regExp[i].test(attributeName)) {
|
|
5497
5623
|
return true;
|
|
5498
5624
|
}
|
|
5499
5625
|
}
|
|
@@ -5545,23 +5671,22 @@
|
|
|
5545
5671
|
|
|
5546
5672
|
const domParser = new window.DOMParser();
|
|
5547
5673
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
5548
|
-
const allowlistKeys = Object.keys(allowList);
|
|
5549
5674
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
5550
5675
|
|
|
5551
5676
|
for (let i = 0, len = elements.length; i < len; i++) {
|
|
5552
|
-
const
|
|
5553
|
-
const
|
|
5677
|
+
const element = elements[i];
|
|
5678
|
+
const elementName = element.nodeName.toLowerCase();
|
|
5554
5679
|
|
|
5555
|
-
if (!
|
|
5556
|
-
|
|
5680
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
5681
|
+
element.remove();
|
|
5557
5682
|
continue;
|
|
5558
5683
|
}
|
|
5559
5684
|
|
|
5560
|
-
const attributeList = [].concat(...
|
|
5561
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
|
5562
|
-
attributeList.forEach(
|
|
5563
|
-
if (!allowedAttribute(
|
|
5564
|
-
|
|
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);
|
|
5565
5690
|
}
|
|
5566
5691
|
});
|
|
5567
5692
|
}
|
|
@@ -5571,7 +5696,7 @@
|
|
|
5571
5696
|
|
|
5572
5697
|
/**
|
|
5573
5698
|
* --------------------------------------------------------------------------
|
|
5574
|
-
* CoreUI (v4.
|
|
5699
|
+
* CoreUI (v4.1.2): tooltip.js
|
|
5575
5700
|
* Licensed under MIT (https://coreui.io/license)
|
|
5576
5701
|
*
|
|
5577
5702
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
@@ -5588,7 +5713,6 @@
|
|
|
5588
5713
|
const DATA_KEY$5 = 'coreui.tooltip';
|
|
5589
5714
|
const EVENT_KEY$5 = `.${DATA_KEY$5}`;
|
|
5590
5715
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
|
5591
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
|
5592
5716
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
5593
5717
|
const DefaultType$4 = {
|
|
5594
5718
|
animation: 'boolean',
|
|
@@ -5647,12 +5771,14 @@
|
|
|
5647
5771
|
MOUSEENTER: `mouseenter${EVENT_KEY$5}`,
|
|
5648
5772
|
MOUSELEAVE: `mouseleave${EVENT_KEY$5}`
|
|
5649
5773
|
};
|
|
5650
|
-
const CLASS_NAME_FADE$
|
|
5774
|
+
const CLASS_NAME_FADE$2 = 'fade';
|
|
5651
5775
|
const CLASS_NAME_MODAL = 'modal';
|
|
5652
|
-
const CLASS_NAME_SHOW$
|
|
5776
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
|
5653
5777
|
const HOVER_STATE_SHOW = 'show';
|
|
5654
5778
|
const HOVER_STATE_OUT = 'out';
|
|
5655
5779
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
5780
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
5781
|
+
const EVENT_MODAL_HIDE = 'hide.coreui.modal';
|
|
5656
5782
|
const TRIGGER_HOVER = 'hover';
|
|
5657
5783
|
const TRIGGER_FOCUS = 'focus';
|
|
5658
5784
|
const TRIGGER_CLICK = 'click';
|
|
@@ -5729,7 +5855,7 @@
|
|
|
5729
5855
|
context._leave(null, context);
|
|
5730
5856
|
}
|
|
5731
5857
|
} else {
|
|
5732
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
5858
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
|
|
5733
5859
|
this._leave(null, this);
|
|
5734
5860
|
|
|
5735
5861
|
return;
|
|
@@ -5741,15 +5867,13 @@
|
|
|
5741
5867
|
|
|
5742
5868
|
dispose() {
|
|
5743
5869
|
clearTimeout(this._timeout);
|
|
5744
|
-
EventHandler.off(this._element.closest(
|
|
5870
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
5745
5871
|
|
|
5746
5872
|
if (this.tip) {
|
|
5747
5873
|
this.tip.remove();
|
|
5748
5874
|
}
|
|
5749
5875
|
|
|
5750
|
-
|
|
5751
|
-
this._popper.destroy();
|
|
5752
|
-
}
|
|
5876
|
+
this._disposePopper();
|
|
5753
5877
|
|
|
5754
5878
|
super.dispose();
|
|
5755
5879
|
}
|
|
@@ -5769,6 +5893,15 @@
|
|
|
5769
5893
|
|
|
5770
5894
|
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
5771
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;
|
|
5772
5905
|
}
|
|
5773
5906
|
|
|
5774
5907
|
const tip = this.getTipElement();
|
|
@@ -5777,10 +5910,8 @@
|
|
|
5777
5910
|
|
|
5778
5911
|
this._element.setAttribute('aria-describedby', tipId);
|
|
5779
5912
|
|
|
5780
|
-
this.setContent();
|
|
5781
|
-
|
|
5782
5913
|
if (this._config.animation) {
|
|
5783
|
-
tip.classList.add(CLASS_NAME_FADE$
|
|
5914
|
+
tip.classList.add(CLASS_NAME_FADE$2);
|
|
5784
5915
|
}
|
|
5785
5916
|
|
|
5786
5917
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
|
@@ -5795,7 +5926,7 @@
|
|
|
5795
5926
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
|
5796
5927
|
|
|
5797
5928
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
5798
|
-
container.
|
|
5929
|
+
container.append(tip);
|
|
5799
5930
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
|
5800
5931
|
}
|
|
5801
5932
|
|
|
@@ -5805,8 +5936,9 @@
|
|
|
5805
5936
|
this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
5806
5937
|
}
|
|
5807
5938
|
|
|
5808
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
|
5809
|
-
|
|
5939
|
+
tip.classList.add(CLASS_NAME_SHOW$3);
|
|
5940
|
+
|
|
5941
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
|
5810
5942
|
|
|
5811
5943
|
if (customClass) {
|
|
5812
5944
|
tip.classList.add(...customClass.split(' '));
|
|
@@ -5832,7 +5964,7 @@
|
|
|
5832
5964
|
}
|
|
5833
5965
|
};
|
|
5834
5966
|
|
|
5835
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
5967
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
5836
5968
|
|
|
5837
5969
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5838
5970
|
}
|
|
@@ -5859,11 +5991,7 @@
|
|
|
5859
5991
|
|
|
5860
5992
|
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
|
5861
5993
|
|
|
5862
|
-
|
|
5863
|
-
this._popper.destroy();
|
|
5864
|
-
|
|
5865
|
-
this._popper = null;
|
|
5866
|
-
}
|
|
5994
|
+
this._disposePopper();
|
|
5867
5995
|
};
|
|
5868
5996
|
|
|
5869
5997
|
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
|
@@ -5872,7 +6000,7 @@
|
|
|
5872
6000
|
return;
|
|
5873
6001
|
}
|
|
5874
6002
|
|
|
5875
|
-
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
|
|
5876
6004
|
// empty mouseover listeners we added for iOS support
|
|
5877
6005
|
|
|
5878
6006
|
if ('ontouchstart' in document.documentElement) {
|
|
@@ -5882,7 +6010,7 @@
|
|
|
5882
6010
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
5883
6011
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
5884
6012
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
5885
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
6013
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
5886
6014
|
|
|
5887
6015
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5888
6016
|
|
|
@@ -5907,14 +6035,27 @@
|
|
|
5907
6035
|
|
|
5908
6036
|
const element = document.createElement('div');
|
|
5909
6037
|
element.innerHTML = this._config.template;
|
|
5910
|
-
|
|
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;
|
|
5911
6042
|
return this.tip;
|
|
5912
6043
|
}
|
|
5913
6044
|
|
|
5914
|
-
setContent() {
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
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);
|
|
5918
6059
|
}
|
|
5919
6060
|
|
|
5920
6061
|
setElementContent(element, content) {
|
|
@@ -5928,7 +6069,7 @@
|
|
|
5928
6069
|
if (this._config.html) {
|
|
5929
6070
|
if (content.parentNode !== element) {
|
|
5930
6071
|
element.innerHTML = '';
|
|
5931
|
-
element.
|
|
6072
|
+
element.append(content);
|
|
5932
6073
|
}
|
|
5933
6074
|
} else {
|
|
5934
6075
|
element.textContent = content.textContent;
|
|
@@ -5949,13 +6090,9 @@
|
|
|
5949
6090
|
}
|
|
5950
6091
|
|
|
5951
6092
|
getTitle() {
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
if (!title) {
|
|
5955
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
|
5956
|
-
}
|
|
6093
|
+
const title = this._element.getAttribute('data-coreui-original-title') || this._config.title;
|
|
5957
6094
|
|
|
5958
|
-
return title;
|
|
6095
|
+
return this._resolvePossibleFunction(title);
|
|
5959
6096
|
}
|
|
5960
6097
|
|
|
5961
6098
|
updateAttachment(attachment) {
|
|
@@ -5972,15 +6109,7 @@
|
|
|
5972
6109
|
|
|
5973
6110
|
|
|
5974
6111
|
_initializeOnDelegatedTarget(event, context) {
|
|
5975
|
-
|
|
5976
|
-
context = context || Data.get(event.delegateTarget, dataKey);
|
|
5977
|
-
|
|
5978
|
-
if (!context) {
|
|
5979
|
-
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
|
5980
|
-
Data.set(event.delegateTarget, dataKey, context);
|
|
5981
|
-
}
|
|
5982
|
-
|
|
5983
|
-
return context;
|
|
6112
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
|
5984
6113
|
}
|
|
5985
6114
|
|
|
5986
6115
|
_getOffset() {
|
|
@@ -5999,6 +6128,10 @@
|
|
|
5999
6128
|
return offset;
|
|
6000
6129
|
}
|
|
6001
6130
|
|
|
6131
|
+
_resolvePossibleFunction(content) {
|
|
6132
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
|
6133
|
+
}
|
|
6134
|
+
|
|
6002
6135
|
_getPopperConfig(attachment) {
|
|
6003
6136
|
const defaultBsPopperConfig = {
|
|
6004
6137
|
placement: attachment,
|
|
@@ -6040,7 +6173,7 @@
|
|
|
6040
6173
|
}
|
|
6041
6174
|
|
|
6042
6175
|
_addAttachmentClass(attachment) {
|
|
6043
|
-
this.getTipElement().classList.add(`${
|
|
6176
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
|
6044
6177
|
}
|
|
6045
6178
|
|
|
6046
6179
|
_getAttachment(placement) {
|
|
@@ -6067,7 +6200,7 @@
|
|
|
6067
6200
|
}
|
|
6068
6201
|
};
|
|
6069
6202
|
|
|
6070
|
-
EventHandler.on(this._element.closest(
|
|
6203
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
6071
6204
|
|
|
6072
6205
|
if (this._config.selector) {
|
|
6073
6206
|
this._config = { ...this._config,
|
|
@@ -6102,7 +6235,7 @@
|
|
|
6102
6235
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
6103
6236
|
}
|
|
6104
6237
|
|
|
6105
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
6238
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
|
|
6106
6239
|
context._hoverState = HOVER_STATE_SHOW;
|
|
6107
6240
|
return;
|
|
6108
6241
|
}
|
|
@@ -6198,26 +6331,32 @@
|
|
|
6198
6331
|
_getDelegateConfig() {
|
|
6199
6332
|
const config = {};
|
|
6200
6333
|
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
config[key] = this._config[key];
|
|
6205
|
-
}
|
|
6334
|
+
for (const key in this._config) {
|
|
6335
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
|
6336
|
+
config[key] = this._config[key];
|
|
6206
6337
|
}
|
|
6207
|
-
}
|
|
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
|
+
|
|
6208
6342
|
|
|
6209
6343
|
return config;
|
|
6210
6344
|
}
|
|
6211
6345
|
|
|
6212
6346
|
_cleanTipClass() {
|
|
6213
6347
|
const tip = this.getTipElement();
|
|
6214
|
-
const
|
|
6348
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
|
6349
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
|
6215
6350
|
|
|
6216
6351
|
if (tabClass !== null && tabClass.length > 0) {
|
|
6217
6352
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
6218
6353
|
}
|
|
6219
6354
|
}
|
|
6220
6355
|
|
|
6356
|
+
_getBasicClassPrefix() {
|
|
6357
|
+
return CLASS_PREFIX$1;
|
|
6358
|
+
}
|
|
6359
|
+
|
|
6221
6360
|
_handlePopperPlacementChange(popperData) {
|
|
6222
6361
|
const {
|
|
6223
6362
|
state
|
|
@@ -6232,6 +6371,14 @@
|
|
|
6232
6371
|
this._cleanTipClass();
|
|
6233
6372
|
|
|
6234
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
|
+
}
|
|
6235
6382
|
} // Static
|
|
6236
6383
|
|
|
6237
6384
|
|
|
@@ -6262,7 +6409,7 @@
|
|
|
6262
6409
|
|
|
6263
6410
|
/**
|
|
6264
6411
|
* --------------------------------------------------------------------------
|
|
6265
|
-
* CoreUI (v4.
|
|
6412
|
+
* CoreUI (v4.1.2): popover.js
|
|
6266
6413
|
* Licensed under MIT (https://coreui.io/license)
|
|
6267
6414
|
*
|
|
6268
6415
|
* This component is a modified version of the Bootstrap's popover.js
|
|
@@ -6279,7 +6426,6 @@
|
|
|
6279
6426
|
const DATA_KEY$4 = 'coreui.popover';
|
|
6280
6427
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
|
6281
6428
|
const CLASS_PREFIX = 'bs-popover';
|
|
6282
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
|
6283
6429
|
const Default$3 = { ...Tooltip.Default,
|
|
6284
6430
|
placement: 'right',
|
|
6285
6431
|
offset: [0, 8],
|
|
@@ -6302,8 +6448,6 @@
|
|
|
6302
6448
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
|
6303
6449
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
|
6304
6450
|
};
|
|
6305
|
-
const CLASS_NAME_FADE$3 = 'fade';
|
|
6306
|
-
const CLASS_NAME_SHOW$3 = 'show';
|
|
6307
6451
|
const SELECTOR_TITLE = '.popover-header';
|
|
6308
6452
|
const SELECTOR_CONTENT = '.popover-body';
|
|
6309
6453
|
/**
|
|
@@ -6335,55 +6479,19 @@
|
|
|
6335
6479
|
return this.getTitle() || this._getContent();
|
|
6336
6480
|
}
|
|
6337
6481
|
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
return this.tip;
|
|
6341
|
-
}
|
|
6342
|
-
|
|
6343
|
-
this.tip = super.getTipElement();
|
|
6344
|
-
|
|
6345
|
-
if (!this.getTitle()) {
|
|
6346
|
-
SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove();
|
|
6347
|
-
}
|
|
6348
|
-
|
|
6349
|
-
if (!this._getContent()) {
|
|
6350
|
-
SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove();
|
|
6351
|
-
}
|
|
6352
|
-
|
|
6353
|
-
return this.tip;
|
|
6354
|
-
}
|
|
6355
|
-
|
|
6356
|
-
setContent() {
|
|
6357
|
-
const tip = this.getTipElement(); // we use append for html objects to maintain js events
|
|
6482
|
+
setContent(tip) {
|
|
6483
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
|
6358
6484
|
|
|
6359
|
-
this.
|
|
6360
|
-
|
|
6361
|
-
let content = this._getContent();
|
|
6362
|
-
|
|
6363
|
-
if (typeof content === 'function') {
|
|
6364
|
-
content = content.call(this._element);
|
|
6365
|
-
}
|
|
6366
|
-
|
|
6367
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
|
6368
|
-
tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
|
|
6485
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
|
6369
6486
|
} // Private
|
|
6370
6487
|
|
|
6371
6488
|
|
|
6372
|
-
_addAttachmentClass(attachment) {
|
|
6373
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
|
6374
|
-
}
|
|
6375
|
-
|
|
6376
6489
|
_getContent() {
|
|
6377
|
-
return this.
|
|
6490
|
+
return this._resolvePossibleFunction(this._config.content);
|
|
6378
6491
|
}
|
|
6379
6492
|
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
|
|
6383
|
-
|
|
6384
|
-
if (tabClass !== null && tabClass.length > 0) {
|
|
6385
|
-
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
6386
|
-
}
|
|
6493
|
+
_getBasicClassPrefix() {
|
|
6494
|
+
return CLASS_PREFIX;
|
|
6387
6495
|
} // Static
|
|
6388
6496
|
|
|
6389
6497
|
|
|
@@ -6414,7 +6522,7 @@
|
|
|
6414
6522
|
|
|
6415
6523
|
/**
|
|
6416
6524
|
* --------------------------------------------------------------------------
|
|
6417
|
-
* CoreUI (v4.
|
|
6525
|
+
* CoreUI (v4.1.2): scrollspy.js
|
|
6418
6526
|
* Licensed under MIT (https://coreui.io/license)
|
|
6419
6527
|
*
|
|
6420
6528
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
@@ -6652,7 +6760,7 @@
|
|
|
6652
6760
|
|
|
6653
6761
|
/**
|
|
6654
6762
|
* --------------------------------------------------------------------------
|
|
6655
|
-
* CoreUI (v4.
|
|
6763
|
+
* CoreUI (v4.1.2): sidebar.js
|
|
6656
6764
|
* Licensed under MIT (https://coreui.io/license)
|
|
6657
6765
|
* --------------------------------------------------------------------------
|
|
6658
6766
|
*/
|
|
@@ -6669,7 +6777,6 @@
|
|
|
6669
6777
|
const Default$1 = {};
|
|
6670
6778
|
const DefaultType$1 = {};
|
|
6671
6779
|
const CLASS_NAME_BACKDROP = 'sidebar-backdrop';
|
|
6672
|
-
const CLASS_NAME_FADE$2 = 'fade';
|
|
6673
6780
|
const CLASS_NAME_HIDE$1 = 'hide';
|
|
6674
6781
|
const CLASS_NAME_SHOW$2 = 'show';
|
|
6675
6782
|
const CLASS_NAME_SIDEBAR_NARROW = 'sidebar-narrow';
|
|
@@ -6700,7 +6807,7 @@
|
|
|
6700
6807
|
this._overlaid = this._isOverlaid();
|
|
6701
6808
|
this._narrow = this._isNarrow();
|
|
6702
6809
|
this._unfoldable = this._isUnfoldable();
|
|
6703
|
-
this._backdrop =
|
|
6810
|
+
this._backdrop = this._initializeBackDrop();
|
|
6704
6811
|
|
|
6705
6812
|
this._addEventListeners();
|
|
6706
6813
|
} // Getters
|
|
@@ -6729,7 +6836,9 @@
|
|
|
6729
6836
|
if (this._isMobile()) {
|
|
6730
6837
|
this._element.classList.add(CLASS_NAME_SHOW$2);
|
|
6731
6838
|
|
|
6732
|
-
this.
|
|
6839
|
+
this._backdrop.show();
|
|
6840
|
+
|
|
6841
|
+
new ScrollBarHelper().hide();
|
|
6733
6842
|
}
|
|
6734
6843
|
|
|
6735
6844
|
const complete = () => {
|
|
@@ -6755,7 +6864,9 @@
|
|
|
6755
6864
|
}
|
|
6756
6865
|
|
|
6757
6866
|
if (this._isMobile()) {
|
|
6758
|
-
this.
|
|
6867
|
+
this._backdrop.hide();
|
|
6868
|
+
|
|
6869
|
+
new ScrollBarHelper().reset();
|
|
6759
6870
|
} else {
|
|
6760
6871
|
this._element.classList.add(CLASS_NAME_HIDE$1);
|
|
6761
6872
|
}
|
|
@@ -6844,6 +6955,16 @@
|
|
|
6844
6955
|
return config;
|
|
6845
6956
|
}
|
|
6846
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
|
+
|
|
6847
6968
|
_isMobile() {
|
|
6848
6969
|
return Boolean(window.getComputedStyle(this._element, null).getPropertyValue('--cui-is-mobile'));
|
|
6849
6970
|
}
|
|
@@ -6863,35 +6984,13 @@
|
|
|
6863
6984
|
_isVisible() {
|
|
6864
6985
|
const rect = this._element.getBoundingClientRect();
|
|
6865
6986
|
|
|
6866
|
-
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);
|
|
6867
6988
|
}
|
|
6868
6989
|
|
|
6869
6990
|
_addClassName(className) {
|
|
6870
6991
|
this._element.classList.add(className);
|
|
6871
6992
|
}
|
|
6872
6993
|
|
|
6873
|
-
_removeBackdrop() {
|
|
6874
|
-
if (this._backdrop) {
|
|
6875
|
-
this._backdrop.parentNode.removeChild(this._backdrop);
|
|
6876
|
-
|
|
6877
|
-
this._backdrop = null;
|
|
6878
|
-
}
|
|
6879
|
-
}
|
|
6880
|
-
|
|
6881
|
-
_showBackdrop() {
|
|
6882
|
-
if (!this._backdrop) {
|
|
6883
|
-
this._backdrop = document.createElement('div');
|
|
6884
|
-
this._backdrop.className = CLASS_NAME_BACKDROP;
|
|
6885
|
-
|
|
6886
|
-
this._backdrop.classList.add(CLASS_NAME_FADE$2);
|
|
6887
|
-
|
|
6888
|
-
document.body.appendChild(this._backdrop);
|
|
6889
|
-
reflow(this._backdrop);
|
|
6890
|
-
|
|
6891
|
-
this._backdrop.classList.add(CLASS_NAME_SHOW$2);
|
|
6892
|
-
}
|
|
6893
|
-
}
|
|
6894
|
-
|
|
6895
6994
|
_clickOutListener(event, sidebar) {
|
|
6896
6995
|
if (event.target.closest(SELECTOR_SIDEBAR) === null) {
|
|
6897
6996
|
event.preventDefault();
|
|
@@ -6939,6 +7038,7 @@
|
|
|
6939
7038
|
EventHandler.on(window, EVENT_RESIZE, () => {
|
|
6940
7039
|
if (this._isMobile() && this._isVisible()) {
|
|
6941
7040
|
this.hide();
|
|
7041
|
+
this._backdrop = this._initializeBackDrop();
|
|
6942
7042
|
}
|
|
6943
7043
|
});
|
|
6944
7044
|
} // Static
|
|
@@ -6985,7 +7085,7 @@
|
|
|
6985
7085
|
|
|
6986
7086
|
/**
|
|
6987
7087
|
* --------------------------------------------------------------------------
|
|
6988
|
-
* CoreUI (v4.
|
|
7088
|
+
* CoreUI (v4.1.2): tab.js
|
|
6989
7089
|
* Licensed under MIT (https://coreui.io/license)
|
|
6990
7090
|
*
|
|
6991
7091
|
* This component is a modified version of the Bootstrap's tab.js
|
|
@@ -7186,7 +7286,7 @@
|
|
|
7186
7286
|
|
|
7187
7287
|
/**
|
|
7188
7288
|
* --------------------------------------------------------------------------
|
|
7189
|
-
* CoreUI (v4.
|
|
7289
|
+
* CoreUI (v4.1.2): toast.js
|
|
7190
7290
|
* Licensed under MIT (https://coreui.io/license)
|
|
7191
7291
|
*
|
|
7192
7292
|
* This component is a modified version of the Bootstrap's toast.js
|
|
@@ -7202,7 +7302,6 @@
|
|
|
7202
7302
|
const NAME = 'toast';
|
|
7203
7303
|
const DATA_KEY = 'coreui.toast';
|
|
7204
7304
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
7205
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
|
7206
7305
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
|
7207
7306
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
|
7208
7307
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
|
@@ -7212,7 +7311,8 @@
|
|
|
7212
7311
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
7213
7312
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
7214
7313
|
const CLASS_NAME_FADE = 'fade';
|
|
7215
|
-
const CLASS_NAME_HIDE = 'hide';
|
|
7314
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
|
7315
|
+
|
|
7216
7316
|
const CLASS_NAME_SHOW = 'show';
|
|
7217
7317
|
const CLASS_NAME_SHOWING = 'showing';
|
|
7218
7318
|
const DefaultType = {
|
|
@@ -7225,7 +7325,6 @@
|
|
|
7225
7325
|
autohide: true,
|
|
7226
7326
|
delay: 5000
|
|
7227
7327
|
};
|
|
7228
|
-
const SELECTOR_DATA_DISMISS = '[data-coreui-dismiss="toast"]';
|
|
7229
7328
|
/**
|
|
7230
7329
|
* ------------------------------------------------------------------------
|
|
7231
7330
|
* Class Definition
|
|
@@ -7273,17 +7372,18 @@
|
|
|
7273
7372
|
const complete = () => {
|
|
7274
7373
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
7275
7374
|
|
|
7276
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
7277
|
-
|
|
7278
7375
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
|
7279
7376
|
|
|
7280
7377
|
this._maybeScheduleHide();
|
|
7281
7378
|
};
|
|
7282
7379
|
|
|
7283
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
|
7380
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
|
7381
|
+
|
|
7284
7382
|
|
|
7285
7383
|
reflow(this._element);
|
|
7286
7384
|
|
|
7385
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
7386
|
+
|
|
7287
7387
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
7288
7388
|
|
|
7289
7389
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
@@ -7301,12 +7401,17 @@
|
|
|
7301
7401
|
}
|
|
7302
7402
|
|
|
7303
7403
|
const complete = () => {
|
|
7304
|
-
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);
|
|
7305
7410
|
|
|
7306
7411
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
|
7307
7412
|
};
|
|
7308
7413
|
|
|
7309
|
-
this._element.classList.
|
|
7414
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
7310
7415
|
|
|
7311
7416
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
7312
7417
|
}
|
|
@@ -7374,7 +7479,6 @@
|
|
|
7374
7479
|
}
|
|
7375
7480
|
|
|
7376
7481
|
_setListeners() {
|
|
7377
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
|
7378
7482
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
|
7379
7483
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
|
7380
7484
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
|
@@ -7402,6 +7506,8 @@
|
|
|
7402
7506
|
}
|
|
7403
7507
|
|
|
7404
7508
|
}
|
|
7509
|
+
|
|
7510
|
+
enableDismissTrigger(Toast);
|
|
7405
7511
|
/**
|
|
7406
7512
|
* ------------------------------------------------------------------------
|
|
7407
7513
|
* jQuery
|
|
@@ -7409,16 +7515,15 @@
|
|
|
7409
7515
|
* add .Toast to jQuery only if jQuery is present
|
|
7410
7516
|
*/
|
|
7411
7517
|
|
|
7412
|
-
|
|
7413
7518
|
defineJQueryPlugin(Toast);
|
|
7414
7519
|
|
|
7415
7520
|
/**
|
|
7416
7521
|
* --------------------------------------------------------------------------
|
|
7417
|
-
* CoreUI (v4.
|
|
7522
|
+
* CoreUI (v4.1.2): index.esm.js
|
|
7418
7523
|
* Licensed under MIT (https://coreui.io/license)
|
|
7419
7524
|
* --------------------------------------------------------------------------
|
|
7420
7525
|
*/
|
|
7421
|
-
|
|
7526
|
+
const index_umd = {
|
|
7422
7527
|
Alert,
|
|
7423
7528
|
Button,
|
|
7424
7529
|
Carousel,
|
|
@@ -7437,5 +7542,5 @@
|
|
|
7437
7542
|
|
|
7438
7543
|
return index_umd;
|
|
7439
7544
|
|
|
7440
|
-
}))
|
|
7545
|
+
}));
|
|
7441
7546
|
//# sourceMappingURL=coreui.bundle.js.map
|