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