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