@coreui/coreui 5.0.0-alpha.0 → 5.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/LICENSE +5 -5
  2. package/README.md +2 -2
  3. package/dist/css/coreui-grid.css +34 -192
  4. package/dist/css/coreui-grid.css.map +1 -1
  5. package/dist/css/coreui-grid.min.css +3 -3
  6. package/dist/css/coreui-grid.min.css.map +1 -1
  7. package/dist/css/coreui-grid.rtl.css +118 -275
  8. package/dist/css/coreui-grid.rtl.css.map +1 -1
  9. package/dist/css/coreui-grid.rtl.min.css +3 -3
  10. package/dist/css/coreui-grid.rtl.min.css.map +1 -1
  11. package/dist/css/coreui-reboot.css +166 -148
  12. package/dist/css/coreui-reboot.css.map +1 -1
  13. package/dist/css/coreui-reboot.min.css +3 -3
  14. package/dist/css/coreui-reboot.min.css.map +1 -1
  15. package/dist/css/coreui-reboot.rtl.css +170 -156
  16. package/dist/css/coreui-reboot.rtl.css.map +1 -1
  17. package/dist/css/coreui-reboot.rtl.min.css +3 -3
  18. package/dist/css/coreui-reboot.rtl.min.css.map +1 -1
  19. package/dist/css/coreui-utilities.css +653 -427
  20. package/dist/css/coreui-utilities.css.map +1 -1
  21. package/dist/css/coreui-utilities.min.css +3 -3
  22. package/dist/css/coreui-utilities.min.css.map +1 -1
  23. package/dist/css/coreui-utilities.rtl.css +824 -703
  24. package/dist/css/coreui-utilities.rtl.css.map +1 -1
  25. package/dist/css/coreui-utilities.rtl.min.css +3 -3
  26. package/dist/css/coreui-utilities.rtl.min.css.map +1 -1
  27. package/dist/css/coreui.css +2082 -1790
  28. package/dist/css/coreui.css.map +1 -1
  29. package/dist/css/coreui.min.css +3 -3
  30. package/dist/css/coreui.min.css.map +1 -1
  31. package/dist/css/coreui.rtl.css +2333 -2213
  32. package/dist/css/coreui.rtl.css.map +1 -1
  33. package/dist/css/coreui.rtl.min.css +3 -3
  34. package/dist/css/coreui.rtl.min.css.map +1 -1
  35. package/dist/js/coreui.bundle.js +313 -292
  36. package/dist/js/coreui.bundle.js.map +1 -1
  37. package/dist/js/coreui.bundle.min.js +2 -2
  38. package/dist/js/coreui.bundle.min.js.map +1 -1
  39. package/dist/js/coreui.esm.js +273 -246
  40. package/dist/js/coreui.esm.js.map +1 -1
  41. package/dist/js/coreui.esm.min.js +2 -2
  42. package/dist/js/coreui.esm.min.js.map +1 -1
  43. package/dist/js/coreui.js +276 -248
  44. package/dist/js/coreui.js.map +1 -1
  45. package/dist/js/coreui.min.js +2 -2
  46. package/dist/js/coreui.min.js.map +1 -1
  47. package/js/dist/alert.js +7 -6
  48. package/js/dist/alert.js.map +1 -1
  49. package/js/dist/base-component.js +8 -7
  50. package/js/dist/base-component.js.map +1 -1
  51. package/js/dist/button.js +7 -6
  52. package/js/dist/button.js.map +1 -1
  53. package/js/dist/carousel.js +8 -7
  54. package/js/dist/carousel.js.map +1 -1
  55. package/js/dist/collapse.js +7 -6
  56. package/js/dist/collapse.js.map +1 -1
  57. package/js/dist/dom/data.js +3 -3
  58. package/js/dist/dom/data.js.map +1 -1
  59. package/js/dist/dom/event-handler.js +7 -7
  60. package/js/dist/dom/event-handler.js.map +1 -1
  61. package/js/dist/dom/manipulator.js +4 -4
  62. package/js/dist/dom/manipulator.js.map +1 -1
  63. package/js/dist/dom/selector-engine.js +4 -3
  64. package/js/dist/dom/selector-engine.js.map +1 -1
  65. package/js/dist/dropdown.js +10 -9
  66. package/js/dist/dropdown.js.map +1 -1
  67. package/js/dist/modal.js +9 -10
  68. package/js/dist/modal.js.map +1 -1
  69. package/js/dist/navigation.js +7 -6
  70. package/js/dist/navigation.js.map +1 -1
  71. package/js/dist/offcanvas.js +11 -10
  72. package/js/dist/offcanvas.js.map +1 -1
  73. package/js/dist/popover.js +7 -6
  74. package/js/dist/popover.js.map +1 -1
  75. package/js/dist/scrollspy.js +9 -8
  76. package/js/dist/scrollspy.js.map +1 -1
  77. package/js/dist/sidebar.js +7 -6
  78. package/js/dist/sidebar.js.map +1 -1
  79. package/js/dist/tab.js +21 -12
  80. package/js/dist/tab.js.map +1 -1
  81. package/js/dist/toast.js +7 -6
  82. package/js/dist/toast.js.map +1 -1
  83. package/js/dist/tooltip.js +12 -11
  84. package/js/dist/tooltip.js.map +1 -1
  85. package/js/dist/util/backdrop.js +8 -7
  86. package/js/dist/util/backdrop.js.map +1 -1
  87. package/js/dist/util/component-functions.js +8 -7
  88. package/js/dist/util/component-functions.js.map +1 -1
  89. package/js/dist/util/config.js +8 -7
  90. package/js/dist/util/config.js.map +1 -1
  91. package/js/dist/util/focustrap.js +4 -3
  92. package/js/dist/util/focustrap.js.map +1 -1
  93. package/js/dist/util/index.js +3 -3
  94. package/js/dist/util/index.js.map +1 -1
  95. package/js/dist/util/sanitizer.js +28 -30
  96. package/js/dist/util/sanitizer.js.map +1 -1
  97. package/js/dist/util/scrollbar.js +8 -7
  98. package/js/dist/util/scrollbar.js.map +1 -1
  99. package/js/dist/util/swipe.js +8 -7
  100. package/js/dist/util/swipe.js.map +1 -1
  101. package/js/dist/util/template-factory.js +8 -7
  102. package/js/dist/util/template-factory.js.map +1 -1
  103. package/js/index.esm.js +21 -0
  104. package/js/index.umd.js +38 -0
  105. package/js/src/alert.js +3 -3
  106. package/js/src/base-component.js +3 -3
  107. package/js/src/button.js +4 -3
  108. package/js/src/carousel.js +6 -6
  109. package/js/src/collapse.js +4 -4
  110. package/js/src/dom/data.js +2 -2
  111. package/js/src/dom/event-handler.js +4 -5
  112. package/js/src/dom/manipulator.js +3 -3
  113. package/js/src/dom/selector-engine.js +2 -2
  114. package/js/src/dropdown.js +8 -8
  115. package/js/src/modal.js +8 -9
  116. package/js/src/navigation.js +3 -3
  117. package/js/src/offcanvas.js +11 -11
  118. package/js/src/popover.js +2 -2
  119. package/js/src/scrollspy.js +5 -5
  120. package/js/src/sidebar.js +4 -4
  121. package/js/src/tab.js +19 -9
  122. package/js/src/toast.js +3 -3
  123. package/js/src/tooltip.js +9 -9
  124. package/js/src/util/backdrop.js +3 -3
  125. package/js/src/util/component-functions.js +3 -3
  126. package/js/src/util/config.js +3 -3
  127. package/js/src/util/focustrap.js +2 -2
  128. package/js/src/util/index.js +2 -2
  129. package/js/src/util/sanitizer.js +40 -43
  130. package/js/src/util/scrollbar.js +3 -3
  131. package/js/src/util/swipe.js +3 -3
  132. package/js/src/util/template-factory.js +4 -5
  133. package/package.json +51 -45
  134. package/scss/_alert.scss +5 -5
  135. package/scss/_avatar.scss +4 -4
  136. package/scss/_badge.scss +11 -1
  137. package/scss/_breadcrumb.scss +9 -4
  138. package/scss/_button-group.scss +4 -4
  139. package/scss/_buttons.scss +38 -71
  140. package/scss/_callout.scss +2 -2
  141. package/scss/_card.scss +4 -3
  142. package/scss/_carousel.scss +9 -3
  143. package/scss/_close.scss +3 -0
  144. package/scss/_dropdown.scss +14 -14
  145. package/scss/_functions.scss +59 -0
  146. package/scss/_grid.scss +8 -0
  147. package/scss/_header.scss +186 -0
  148. package/scss/_helpers.scss +2 -0
  149. package/scss/_images.scss +3 -3
  150. package/scss/_list-group.scss +12 -19
  151. package/scss/_maps.scss +75 -21
  152. package/scss/_mixins.scss +6 -4
  153. package/scss/_modal.scss +2 -2
  154. package/scss/_nav.scss +8 -20
  155. package/scss/_navbar.scss +11 -8
  156. package/scss/_offcanvas.scss +8 -8
  157. package/scss/_pagination.scss +2 -2
  158. package/scss/_progress.scss +43 -0
  159. package/scss/_reboot.scss +23 -25
  160. package/scss/_root.scss +70 -63
  161. package/scss/_sidebar.scss +0 -11
  162. package/scss/_tables.scss +18 -11
  163. package/scss/_toasts.scss +2 -2
  164. package/scss/_tooltip.scss +14 -15
  165. package/scss/_type.scss +1 -1
  166. package/scss/_utilities.scss +117 -65
  167. package/scss/_variables-dark.scss +112 -61
  168. package/scss/_variables.scss +401 -268
  169. package/scss/coreui-grid.rtl.scss +4 -0
  170. package/scss/coreui-grid.scss +2 -5
  171. package/scss/coreui-reboot.rtl.scss +4 -0
  172. package/scss/coreui-reboot.scss +1 -1
  173. package/scss/coreui-utilities.rtl.scss +4 -0
  174. package/scss/coreui-utilities.scss +1 -1
  175. package/scss/coreui.rtl.scss +4 -0
  176. package/scss/coreui.scss +3 -3
  177. package/scss/forms/_floating-labels.scss +21 -16
  178. package/scss/forms/_form-check.scss +41 -20
  179. package/scss/forms/_form-control.scss +18 -5
  180. package/scss/forms/_form-range.scss +3 -3
  181. package/scss/forms/_form-select.scss +7 -8
  182. package/scss/forms/_input-group.scss +5 -5
  183. package/scss/helpers/_color-bg.scss +13 -4
  184. package/scss/helpers/_colored-links.scss +20 -2
  185. package/scss/helpers/_focus-ring.scss +5 -0
  186. package/scss/helpers/_icon-link.scss +25 -0
  187. package/scss/helpers/_ratio.scss +1 -1
  188. package/scss/helpers/_vr.scss +2 -1
  189. package/scss/mixins/_alert.scss +1 -1
  190. package/scss/mixins/_banner.scss +3 -3
  191. package/scss/mixins/_border-radius.scss +7 -7
  192. package/scss/mixins/_buttons.scss +53 -49
  193. package/scss/mixins/_caret.scss +3 -3
  194. package/scss/mixins/_forms.scss +7 -7
  195. package/scss/mixins/_grid.scss +1 -1
  196. package/scss/mixins/_list-group.scss +12 -20
  197. package/scss/mixins/_lists.scss +1 -1
  198. package/scss/mixins/_ltr-rtl.scss +87 -0
  199. package/scss/mixins/_utilities.scss +6 -1
  200. package/scss/mixins/_visually-hidden.scss +5 -1
  201. package/scss/sidebar/_sidebar-narrow.scss +37 -17
  202. package/scss/sidebar/_sidebar-nav.scss +115 -20
  203. package/scss/sidebar/_sidebar.scss +98 -139
  204. package/scss/vendor/_rfs.scss +24 -30
  205. package/scss/tests/mixins/_color-modes.test.scss +0 -69
  206. package/scss/tests/mixins/_utilities.test.scss +0 -393
  207. package/scss/tests/utilities/_api.test.scss +0 -75
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * CoreUI v5.0.0-alpha.0 (https://coreui.io)
2
+ * CoreUI v5.0.0-alpha.2 (https://coreui.io)
3
3
  * Copyright 2023 The CoreUI Team (https://github.com/orgs/coreui/people)
4
4
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5
5
  */
@@ -11,10 +11,61 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * CoreUI (v5.0.0-alpha.0): util/index.js
14
+ * CoreUI dom/data.js
15
15
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
16
16
  *
17
- * This component is a modified version of the Bootstrap's util/index.js
17
+ * This is a modified version of the Bootstrap's dom/data.js
18
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
19
+ * --------------------------------------------------------------------------
20
+ */
21
+
22
+ /**
23
+ * Constants
24
+ */
25
+
26
+ const elementMap = new Map();
27
+ const Data = {
28
+ set(element, key, instance) {
29
+ if (!elementMap.has(element)) {
30
+ elementMap.set(element, new Map());
31
+ }
32
+ const instanceMap = elementMap.get(element);
33
+
34
+ // make it clear we only want one instance per element
35
+ // can be removed later when multiple key/instances are fine to be used
36
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
37
+ // eslint-disable-next-line no-console
38
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
39
+ return;
40
+ }
41
+ instanceMap.set(key, instance);
42
+ },
43
+ get(element, key) {
44
+ if (elementMap.has(element)) {
45
+ return elementMap.get(element).get(key) || null;
46
+ }
47
+ return null;
48
+ },
49
+ remove(element, key) {
50
+ if (!elementMap.has(element)) {
51
+ return;
52
+ }
53
+ const instanceMap = elementMap.get(element);
54
+ instanceMap.delete(key);
55
+
56
+ // free up element references if there are no instances left for an element
57
+ if (instanceMap.size === 0) {
58
+ elementMap.delete(element);
59
+ }
60
+ }
61
+ };
62
+
63
+ /**
64
+ * --------------------------------------------------------------------------
65
+ * CoreUI util/index.js
66
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
67
+ *
68
+ * This is a modified version of the Bootstrap's util/index.js
18
69
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
19
70
  * --------------------------------------------------------------------------
20
71
  */
@@ -261,14 +312,15 @@
261
312
 
262
313
  /**
263
314
  * --------------------------------------------------------------------------
264
- * CoreUI (v5.0.0-alpha.0): dom/event-handler.js
315
+ * CoreUI dom/event-handler.js
265
316
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
266
317
  *
267
- * This component is a modified version of the Bootstrap's dom/event-handler.js
318
+ * This is a modified version of the Bootstrap's dom/event-handler.js
268
319
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
269
320
  * --------------------------------------------------------------------------
270
321
  */
271
322
 
323
+
272
324
  /**
273
325
  * Constants
274
326
  */
@@ -334,7 +386,7 @@
334
386
  }
335
387
  function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
336
388
  const isDelegated = typeof handler === 'string';
337
- // todo: tooltip passes `false` instead of selector, so we need to check
389
+ // TODO: tooltip passes `false` instead of selector, so we need to check
338
390
  const callable = isDelegated ? delegationFunction : handler || delegationFunction;
339
391
  let typeEvent = getTypeEvent(originalTypeEvent);
340
392
  if (!nativeEvents.has(typeEvent)) {
@@ -451,11 +503,10 @@
451
503
  nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
452
504
  defaultPrevented = jQueryEvent.isDefaultPrevented();
453
505
  }
454
- let evt = new Event(event, {
506
+ const evt = hydrateObj(new Event(event, {
455
507
  bubbles,
456
508
  cancelable: true
457
- });
458
- evt = hydrateObj(evt, args);
509
+ }), args);
459
510
  if (defaultPrevented) {
460
511
  evt.preventDefault();
461
512
  }
@@ -486,61 +537,10 @@
486
537
 
487
538
  /**
488
539
  * --------------------------------------------------------------------------
489
- * CoreUI (v5.0.0-alpha.0): dom/data.js
540
+ * CoreUI dom/manipulator.js
490
541
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
491
542
  *
492
- * This component is a modified version of the Bootstrap's dom/data.js
493
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
494
- * --------------------------------------------------------------------------
495
- */
496
-
497
- /**
498
- * Constants
499
- */
500
-
501
- const elementMap = new Map();
502
- const Data = {
503
- set(element, key, instance) {
504
- if (!elementMap.has(element)) {
505
- elementMap.set(element, new Map());
506
- }
507
- const instanceMap = elementMap.get(element);
508
-
509
- // make it clear we only want one instance per element
510
- // can be removed later when multiple key/instances are fine to be used
511
- if (!instanceMap.has(key) && instanceMap.size !== 0) {
512
- // eslint-disable-next-line no-console
513
- console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
514
- return;
515
- }
516
- instanceMap.set(key, instance);
517
- },
518
- get(element, key) {
519
- if (elementMap.has(element)) {
520
- return elementMap.get(element).get(key) || null;
521
- }
522
- return null;
523
- },
524
- remove(element, key) {
525
- if (!elementMap.has(element)) {
526
- return;
527
- }
528
- const instanceMap = elementMap.get(element);
529
- instanceMap.delete(key);
530
-
531
- // free up element references if there are no instances left for an element
532
- if (instanceMap.size === 0) {
533
- elementMap.delete(element);
534
- }
535
- }
536
- };
537
-
538
- /**
539
- * --------------------------------------------------------------------------
540
- * CoreUI (v5.0.0-alpha.0): dom/manipulator.js
541
- * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
542
- *
543
- * This component is a modified version of the Bootstrap's dom/manipulator.js
543
+ * This is a modified version of the Bootstrap's dom/manipulator.js
544
544
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
545
545
  * --------------------------------------------------------------------------
546
546
  */
@@ -582,7 +582,7 @@
582
582
  return {};
583
583
  }
584
584
  const attributes = {};
585
- const coreuiKeys = Object.keys(element.dataset).filter(key => key.startsWith('coreu') && !key.startsWith('coreuiConfig'));
585
+ const coreuiKeys = Object.keys(element.dataset).filter(key => key.startsWith('coreui') && !key.startsWith('coreuiConfig'));
586
586
  for (const key of coreuiKeys) {
587
587
  let pureKey = key.replace(/^coreui/, '');
588
588
  pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
@@ -597,14 +597,15 @@
597
597
 
598
598
  /**
599
599
  * --------------------------------------------------------------------------
600
- * CoreUI (v5.0.0-alpha.0): util/config.js
600
+ * CoreUI util/config.js
601
601
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
602
602
  *
603
- * This component is a modified version of the Bootstrap's util/config.js
603
+ * This is a modified version of the Bootstrap's util/config.js
604
604
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
605
605
  * --------------------------------------------------------------------------
606
606
  */
607
607
 
608
+
608
609
  /**
609
610
  * Class definition
610
611
  */
@@ -652,7 +653,7 @@
652
653
 
653
654
  /**
654
655
  * --------------------------------------------------------------------------
655
- * CoreUI (v5.0.0-alpha.0): base-component.js
656
+ * CoreUI base-component.js
656
657
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
657
658
  *
658
659
  * This component is a modified version of the Bootstrap's base-component.js
@@ -660,11 +661,12 @@
660
661
  * --------------------------------------------------------------------------
661
662
  */
662
663
 
664
+
663
665
  /**
664
666
  * Constants
665
667
  */
666
668
 
667
- const VERSION = '5.0.0-alpha.0';
669
+ const VERSION = '5.0.0-alpha.2';
668
670
 
669
671
  /**
670
672
  * Class definition
@@ -723,13 +725,14 @@
723
725
 
724
726
  /**
725
727
  * --------------------------------------------------------------------------
726
- * CoreUI (v5.0.0-alpha.0): dom/selector-engine.js
728
+ * CoreUI dom/selector-engine.js
727
729
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
728
730
  *
729
- * This component is a modified version of the Bootstrap's dom/selector-engine.js
731
+ * This is a modified version of the Bootstrap's dom/selector-engine.js
730
732
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
731
733
  * --------------------------------------------------------------------------
732
734
  */
735
+
733
736
  const getSelector = element => {
734
737
  let selector = element.getAttribute('data-coreui-target');
735
738
  if (!selector || selector === '#') {
@@ -814,13 +817,14 @@
814
817
 
815
818
  /**
816
819
  * --------------------------------------------------------------------------
817
- * CoreUI (v5.0.0-alpha.0): util/component-functions.js
820
+ * CoreUI util/component-functions.js
818
821
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
819
822
  *
820
- * This component is a modified version of the Bootstrap's util/component-functions.js
823
+ * This is a modified version of the Bootstrap's util/component-functions.js
821
824
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
822
825
  * --------------------------------------------------------------------------
823
826
  */
827
+
824
828
  const enableDismissTrigger = (component, method = 'hide') => {
825
829
  const clickEvent = `click.dismiss${component.EVENT_KEY}`;
826
830
  const name = component.NAME;
@@ -841,7 +845,7 @@
841
845
 
842
846
  /**
843
847
  * --------------------------------------------------------------------------
844
- * CoreUI (v5.0.0-alpha.0): alert.js
848
+ * CoreUI alert.js
845
849
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
846
850
  *
847
851
  * This component is a modified version of the Bootstrap's alert.js
@@ -849,6 +853,7 @@
849
853
  * --------------------------------------------------------------------------
850
854
  */
851
855
 
856
+
852
857
  /**
853
858
  * Constants
854
859
  */
@@ -918,7 +923,7 @@
918
923
 
919
924
  /**
920
925
  * --------------------------------------------------------------------------
921
- * CoreUI (v5.0.0-alpha.0): button.js
926
+ * CoreUI button.js
922
927
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
923
928
  *
924
929
  * This component is a modified version of the Bootstrap's button.js
@@ -926,6 +931,7 @@
926
931
  * --------------------------------------------------------------------------
927
932
  */
928
933
 
934
+
929
935
  /**
930
936
  * Constants
931
937
  */
@@ -984,14 +990,15 @@
984
990
 
985
991
  /**
986
992
  * --------------------------------------------------------------------------
987
- * CoreUI (v5.0.0-alpha.0): util/swipe.js
993
+ * CoreUI util/swipe.js
988
994
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
989
995
  *
990
- * This component is a modified version of the Bootstrap's util/swipe.js
996
+ * This is a modified version of the Bootstrap's util/swipe.js
991
997
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
992
998
  * --------------------------------------------------------------------------
993
999
  */
994
1000
 
1001
+
995
1002
  /**
996
1003
  * Constants
997
1004
  */
@@ -1106,7 +1113,7 @@
1106
1113
 
1107
1114
  /**
1108
1115
  * --------------------------------------------------------------------------
1109
- * CoreUI (v5.0.0-alpha.0): carousel.js
1116
+ * CoreUI carousel.js
1110
1117
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
1111
1118
  *
1112
1119
  * This component is a modified version of the Bootstrap's carousel.js
@@ -1114,6 +1121,7 @@
1114
1121
  * --------------------------------------------------------------------------
1115
1122
  */
1116
1123
 
1124
+
1117
1125
  /**
1118
1126
  * Constants
1119
1127
  */
@@ -1369,7 +1377,7 @@
1369
1377
  }
1370
1378
  if (!activeElement || !nextElement) {
1371
1379
  // Some weirdness is happening, so we bail
1372
- // todo: change tests that use empty divs to avoid this check
1380
+ // TODO: change tests that use empty divs to avoid this check
1373
1381
  return;
1374
1382
  }
1375
1383
  const isCycling = Boolean(this._interval);
@@ -1481,7 +1489,7 @@
1481
1489
 
1482
1490
  /**
1483
1491
  * --------------------------------------------------------------------------
1484
- * CoreUI (v5.0.0-alpha.0): collapse.js
1492
+ * CoreUI collapse.js
1485
1493
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
1486
1494
  *
1487
1495
  * This component is a modified version of the Bootstrap's collapse.js
@@ -1489,6 +1497,7 @@
1489
1497
  * --------------------------------------------------------------------------
1490
1498
  */
1491
1499
 
1500
+
1492
1501
  /**
1493
1502
  * Constants
1494
1503
  */
@@ -1878,7 +1887,7 @@
1878
1887
  function getUAString() {
1879
1888
  var uaData = navigator.userAgentData;
1880
1889
 
1881
- if (uaData != null && uaData.brands) {
1890
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
1882
1891
  return uaData.brands.map(function (item) {
1883
1892
  return item.brand + "/" + item.version;
1884
1893
  }).join(' ');
@@ -2166,7 +2175,6 @@
2166
2175
  }
2167
2176
 
2168
2177
  if (!contains(state.elements.popper, arrowElement)) {
2169
-
2170
2178
  return;
2171
2179
  }
2172
2180
 
@@ -2197,10 +2205,9 @@
2197
2205
  // Zooming can change the DPR, but it seems to report a value that will
2198
2206
  // cleanly divide the values into the appropriate subpixels.
2199
2207
 
2200
- function roundOffsetsByDPR(_ref) {
2208
+ function roundOffsetsByDPR(_ref, win) {
2201
2209
  var x = _ref.x,
2202
2210
  y = _ref.y;
2203
- var win = window;
2204
2211
  var dpr = win.devicePixelRatio || 1;
2205
2212
  return {
2206
2213
  x: round(x * dpr) / dpr || 0,
@@ -2283,7 +2290,7 @@
2283
2290
  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
2284
2291
  x: x,
2285
2292
  y: y
2286
- }) : {
2293
+ }, getWindow(popper)) : {
2287
2294
  x: x,
2288
2295
  y: y
2289
2296
  };
@@ -2309,7 +2316,6 @@
2309
2316
  adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
2310
2317
  _options$roundOffsets = options.roundOffsets,
2311
2318
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
2312
-
2313
2319
  var commonStyles = {
2314
2320
  placement: getBasePlacement(state.placement),
2315
2321
  variation: getVariation(state.placement),
@@ -3377,8 +3383,7 @@
3377
3383
 
3378
3384
  state.orderedModifiers = orderedModifiers.filter(function (m) {
3379
3385
  return m.enabled;
3380
- }); // Validate the provided modifiers so that the consumer will get warned
3381
-
3386
+ });
3382
3387
  runModifierEffects();
3383
3388
  return instance.update();
3384
3389
  },
@@ -3398,7 +3403,6 @@
3398
3403
  // anymore
3399
3404
 
3400
3405
  if (!areValidElements(reference, popper)) {
3401
-
3402
3406
  return;
3403
3407
  } // Store the reference and popper rects to be read by modifiers
3404
3408
 
@@ -3423,7 +3427,6 @@
3423
3427
  });
3424
3428
 
3425
3429
  for (var index = 0; index < state.orderedModifiers.length; index++) {
3426
-
3427
3430
  if (state.reset === true) {
3428
3431
  state.reset = false;
3429
3432
  index = -1;
@@ -3461,7 +3464,6 @@
3461
3464
  };
3462
3465
 
3463
3466
  if (!areValidElements(reference, popper)) {
3464
-
3465
3467
  return instance;
3466
3468
  }
3467
3469
 
@@ -3476,11 +3478,11 @@
3476
3478
  // one.
3477
3479
 
3478
3480
  function runModifierEffects() {
3479
- state.orderedModifiers.forEach(function (_ref3) {
3480
- var name = _ref3.name,
3481
- _ref3$options = _ref3.options,
3482
- options = _ref3$options === void 0 ? {} : _ref3$options,
3483
- effect = _ref3.effect;
3481
+ state.orderedModifiers.forEach(function (_ref) {
3482
+ var name = _ref.name,
3483
+ _ref$options = _ref.options,
3484
+ options = _ref$options === void 0 ? {} : _ref$options,
3485
+ effect = _ref.effect;
3484
3486
 
3485
3487
  if (typeof effect === 'function') {
3486
3488
  var cleanupFn = effect({
@@ -3521,49 +3523,49 @@
3521
3523
 
3522
3524
  const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
3523
3525
  __proto__: null,
3524
- popperGenerator,
3525
- detectOverflow,
3526
- createPopperBase: createPopper$2,
3527
- createPopper,
3528
- createPopperLite: createPopper$1,
3529
- top,
3530
- bottom,
3531
- right,
3532
- left,
3533
- auto,
3534
- basePlacements,
3535
- start,
3536
- end,
3537
- clippingParents,
3538
- viewport,
3539
- popper,
3540
- reference,
3541
- variationPlacements,
3542
- placements,
3543
- beforeRead,
3544
- read,
3545
- afterRead,
3546
- beforeMain,
3547
- main,
3548
3526
  afterMain,
3549
- beforeWrite,
3550
- write,
3527
+ afterRead,
3551
3528
  afterWrite,
3552
- modifierPhases,
3553
3529
  applyStyles: applyStyles$1,
3554
3530
  arrow: arrow$1,
3531
+ auto,
3532
+ basePlacements,
3533
+ beforeMain,
3534
+ beforeRead,
3535
+ beforeWrite,
3536
+ bottom,
3537
+ clippingParents,
3555
3538
  computeStyles: computeStyles$1,
3539
+ createPopper,
3540
+ createPopperBase: createPopper$2,
3541
+ createPopperLite: createPopper$1,
3542
+ detectOverflow,
3543
+ end,
3556
3544
  eventListeners,
3557
3545
  flip: flip$1,
3558
3546
  hide: hide$1,
3547
+ left,
3548
+ main,
3549
+ modifierPhases,
3559
3550
  offset: offset$1,
3551
+ placements,
3552
+ popper,
3553
+ popperGenerator,
3560
3554
  popperOffsets: popperOffsets$1,
3561
- preventOverflow: preventOverflow$1
3555
+ preventOverflow: preventOverflow$1,
3556
+ read,
3557
+ reference,
3558
+ right,
3559
+ start,
3560
+ top,
3561
+ variationPlacements,
3562
+ viewport,
3563
+ write
3562
3564
  }, Symbol.toStringTag, { value: 'Module' }));
3563
3565
 
3564
3566
  /**
3565
3567
  * --------------------------------------------------------------------------
3566
- * CoreUI (v5.0.0-alpha.0): dropdown.js
3568
+ * CoreUI dropdown.js
3567
3569
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3568
3570
  *
3569
3571
  * This component is a modified version of the Bootstrap's dropdown.js
@@ -3571,6 +3573,7 @@
3571
3573
  * --------------------------------------------------------------------------
3572
3574
  */
3573
3575
 
3576
+
3574
3577
  /**
3575
3578
  * Constants
3576
3579
  */
@@ -3638,7 +3641,7 @@
3638
3641
  super(element, config);
3639
3642
  this._popper = null;
3640
3643
  this._parent = this._element.parentNode; // dropdown wrapper
3641
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
3644
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
3642
3645
  this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
3643
3646
  this._inNavbar = this._detectNavbar();
3644
3647
  }
@@ -3812,7 +3815,7 @@
3812
3815
 
3813
3816
  // Disable Popper if we have a static display or Dropdown is in Navbar
3814
3817
  if (this._inNavbar || this._config.display === 'static') {
3815
- Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
3818
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
3816
3819
  defaultBsPopperConfig.modifiers = [{
3817
3820
  name: 'applyStyles',
3818
3821
  enabled: false
@@ -3894,7 +3897,7 @@
3894
3897
  }
3895
3898
  event.preventDefault();
3896
3899
 
3897
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
3900
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
3898
3901
  const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$4) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$4)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$4)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$4, event.delegateTarget.parentNode);
3899
3902
  const instance = Dropdown.getOrCreateInstance(getToggleButton);
3900
3903
  if (isUpOrDownEvent) {
@@ -3933,113 +3936,14 @@
3933
3936
 
3934
3937
  /**
3935
3938
  * --------------------------------------------------------------------------
3936
- * CoreUI (v5.0.0-alpha.0): util/scrollBar.js
3939
+ * CoreUI util/backdrop.js
3937
3940
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3938
3941
  *
3939
- * This component is a modified version of the Bootstrap's util/scrollBar.js
3942
+ * This is a modified version of the Bootstrap's util/backdrop.js
3940
3943
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3941
3944
  * --------------------------------------------------------------------------
3942
3945
  */
3943
3946
 
3944
- /**
3945
- * Constants
3946
- */
3947
-
3948
- const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
3949
- const SELECTOR_STICKY_CONTENT = '.sticky-top';
3950
- const PROPERTY_PADDING = 'padding-right';
3951
- const PROPERTY_MARGIN = 'margin-right';
3952
-
3953
- /**
3954
- * Class definition
3955
- */
3956
-
3957
- class ScrollBarHelper {
3958
- constructor() {
3959
- this._element = document.body;
3960
- }
3961
-
3962
- // Public
3963
- getWidth() {
3964
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
3965
- const documentWidth = document.documentElement.clientWidth;
3966
- return Math.abs(window.innerWidth - documentWidth);
3967
- }
3968
- hide() {
3969
- const width = this.getWidth();
3970
- this._disableOverFlow();
3971
- // give padding to element to balance the hidden scrollbar width
3972
- this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
3973
- // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
3974
- this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
3975
- this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
3976
- }
3977
- reset() {
3978
- this._resetElementAttributes(this._element, 'overflow');
3979
- this._resetElementAttributes(this._element, PROPERTY_PADDING);
3980
- this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
3981
- this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
3982
- }
3983
- isOverflowing() {
3984
- return this.getWidth() > 0;
3985
- }
3986
-
3987
- // Private
3988
- _disableOverFlow() {
3989
- this._saveInitialAttribute(this._element, 'overflow');
3990
- this._element.style.overflow = 'hidden';
3991
- }
3992
- _setElementAttributes(selector, styleProperty, callback) {
3993
- const scrollbarWidth = this.getWidth();
3994
- const manipulationCallBack = element => {
3995
- if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
3996
- return;
3997
- }
3998
- this._saveInitialAttribute(element, styleProperty);
3999
- const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
4000
- element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
4001
- };
4002
- this._applyManipulationCallback(selector, manipulationCallBack);
4003
- }
4004
- _saveInitialAttribute(element, styleProperty) {
4005
- const actualValue = element.style.getPropertyValue(styleProperty);
4006
- if (actualValue) {
4007
- Manipulator.setDataAttribute(element, styleProperty, actualValue);
4008
- }
4009
- }
4010
- _resetElementAttributes(selector, styleProperty) {
4011
- const manipulationCallBack = element => {
4012
- const value = Manipulator.getDataAttribute(element, styleProperty);
4013
- // We only want to remove the property if the value is `null`; the value can also be zero
4014
- if (value === null) {
4015
- element.style.removeProperty(styleProperty);
4016
- return;
4017
- }
4018
- Manipulator.removeDataAttribute(element, styleProperty);
4019
- element.style.setProperty(styleProperty, value);
4020
- };
4021
- this._applyManipulationCallback(selector, manipulationCallBack);
4022
- }
4023
- _applyManipulationCallback(selector, callBack) {
4024
- if (isElement$1(selector)) {
4025
- callBack(selector);
4026
- return;
4027
- }
4028
- for (const sel of SelectorEngine.find(selector, this._element)) {
4029
- callBack(sel);
4030
- }
4031
- }
4032
- }
4033
-
4034
- /**
4035
- * --------------------------------------------------------------------------
4036
- * CoreUI (v5.0.0-alpha.0): util/backdrop.js
4037
- * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4038
- *
4039
- * This component is a modified version of the Bootstrap's util/backdrop.js
4040
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4041
- * --------------------------------------------------------------------------
4042
- */
4043
3947
 
4044
3948
  /**
4045
3949
  * Constants
@@ -4160,14 +4064,15 @@
4160
4064
 
4161
4065
  /**
4162
4066
  * --------------------------------------------------------------------------
4163
- * CoreUI (v5.0.0-alpha.0): util/focustrap.js
4067
+ * CoreUI util/focustrap.js
4164
4068
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4165
4069
  *
4166
- * This component is a modified version of the Bootstrap's util/focustrap.js
4070
+ * This is a modified version of the Bootstrap's util/focustrap.js
4167
4071
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4168
4072
  * --------------------------------------------------------------------------
4169
4073
  */
4170
4074
 
4075
+
4171
4076
  /**
4172
4077
  * Constants
4173
4078
  */
@@ -4261,7 +4166,108 @@
4261
4166
 
4262
4167
  /**
4263
4168
  * --------------------------------------------------------------------------
4264
- * CoreUI (v5.0.0-alpha.0): modal.js
4169
+ * CoreUI util/scrollBar.js
4170
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4171
+ *
4172
+ * This is a modified version of the Bootstrap's util/scrollBar.js
4173
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4174
+ * --------------------------------------------------------------------------
4175
+ */
4176
+
4177
+
4178
+ /**
4179
+ * Constants
4180
+ */
4181
+
4182
+ const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
4183
+ const SELECTOR_STICKY_CONTENT = '.sticky-top';
4184
+ const PROPERTY_PADDING = 'padding-right';
4185
+ const PROPERTY_MARGIN = 'margin-right';
4186
+
4187
+ /**
4188
+ * Class definition
4189
+ */
4190
+
4191
+ class ScrollBarHelper {
4192
+ constructor() {
4193
+ this._element = document.body;
4194
+ }
4195
+
4196
+ // Public
4197
+ getWidth() {
4198
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
4199
+ const documentWidth = document.documentElement.clientWidth;
4200
+ return Math.abs(window.innerWidth - documentWidth);
4201
+ }
4202
+ hide() {
4203
+ const width = this.getWidth();
4204
+ this._disableOverFlow();
4205
+ // give padding to element to balance the hidden scrollbar width
4206
+ this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
4207
+ // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
4208
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
4209
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
4210
+ }
4211
+ reset() {
4212
+ this._resetElementAttributes(this._element, 'overflow');
4213
+ this._resetElementAttributes(this._element, PROPERTY_PADDING);
4214
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
4215
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
4216
+ }
4217
+ isOverflowing() {
4218
+ return this.getWidth() > 0;
4219
+ }
4220
+
4221
+ // Private
4222
+ _disableOverFlow() {
4223
+ this._saveInitialAttribute(this._element, 'overflow');
4224
+ this._element.style.overflow = 'hidden';
4225
+ }
4226
+ _setElementAttributes(selector, styleProperty, callback) {
4227
+ const scrollbarWidth = this.getWidth();
4228
+ const manipulationCallBack = element => {
4229
+ if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
4230
+ return;
4231
+ }
4232
+ this._saveInitialAttribute(element, styleProperty);
4233
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
4234
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
4235
+ };
4236
+ this._applyManipulationCallback(selector, manipulationCallBack);
4237
+ }
4238
+ _saveInitialAttribute(element, styleProperty) {
4239
+ const actualValue = element.style.getPropertyValue(styleProperty);
4240
+ if (actualValue) {
4241
+ Manipulator.setDataAttribute(element, styleProperty, actualValue);
4242
+ }
4243
+ }
4244
+ _resetElementAttributes(selector, styleProperty) {
4245
+ const manipulationCallBack = element => {
4246
+ const value = Manipulator.getDataAttribute(element, styleProperty);
4247
+ // We only want to remove the property if the value is `null`; the value can also be zero
4248
+ if (value === null) {
4249
+ element.style.removeProperty(styleProperty);
4250
+ return;
4251
+ }
4252
+ Manipulator.removeDataAttribute(element, styleProperty);
4253
+ element.style.setProperty(styleProperty, value);
4254
+ };
4255
+ this._applyManipulationCallback(selector, manipulationCallBack);
4256
+ }
4257
+ _applyManipulationCallback(selector, callBack) {
4258
+ if (isElement$1(selector)) {
4259
+ callBack(selector);
4260
+ return;
4261
+ }
4262
+ for (const sel of SelectorEngine.find(selector, this._element)) {
4263
+ callBack(sel);
4264
+ }
4265
+ }
4266
+ }
4267
+
4268
+ /**
4269
+ * --------------------------------------------------------------------------
4270
+ * CoreUI modal.js
4265
4271
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4266
4272
  *
4267
4273
  * This component is a modified version of the Bootstrap's modal.js
@@ -4269,6 +4275,7 @@
4269
4275
  * --------------------------------------------------------------------------
4270
4276
  */
4271
4277
 
4278
+
4272
4279
  /**
4273
4280
  * Constants
4274
4281
  */
@@ -4370,9 +4377,8 @@
4370
4377
  this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
4371
4378
  }
4372
4379
  dispose() {
4373
- for (const htmlElement of [window, this._dialog]) {
4374
- EventHandler.off(htmlElement, EVENT_KEY$6);
4375
- }
4380
+ EventHandler.off(window, EVENT_KEY$6);
4381
+ EventHandler.off(this._dialog, EVENT_KEY$6);
4376
4382
  this._backdrop.dispose();
4377
4383
  this._focustrap.deactivate();
4378
4384
  super.dispose();
@@ -4427,7 +4433,6 @@
4427
4433
  return;
4428
4434
  }
4429
4435
  if (this._config.keyboard) {
4430
- event.preventDefault();
4431
4436
  this.hide();
4432
4437
  return;
4433
4438
  }
@@ -4570,11 +4575,12 @@
4570
4575
 
4571
4576
  /**
4572
4577
  * --------------------------------------------------------------------------
4573
- * CoreUI (v5.0.0-alpha.0): navigation.js
4578
+ * CoreUI navigation.js
4574
4579
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4575
4580
  * --------------------------------------------------------------------------
4576
4581
  */
4577
4582
 
4583
+
4578
4584
  /**
4579
4585
  * ------------------------------------------------------------------------
4580
4586
  * Constants
@@ -4824,14 +4830,15 @@
4824
4830
 
4825
4831
  /**
4826
4832
  * --------------------------------------------------------------------------
4827
- * CoreUI (v5.0.0-alpha.0): offcanvas.js
4833
+ * CoreUI offcanvas.js
4828
4834
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4829
4835
  *
4830
4836
  * This component is a modified version of the Bootstrap's offcanvas.js
4831
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4837
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4832
4838
  * --------------------------------------------------------------------------
4833
4839
  */
4834
4840
 
4841
+
4835
4842
  /**
4836
4843
  * Constants
4837
4844
  */
@@ -4985,11 +4992,11 @@
4985
4992
  if (event.key !== ESCAPE_KEY) {
4986
4993
  return;
4987
4994
  }
4988
- if (!this._config.keyboard) {
4989
- EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
4995
+ if (this._config.keyboard) {
4996
+ this.hide();
4990
4997
  return;
4991
4998
  }
4992
- this.hide();
4999
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
4993
5000
  });
4994
5001
  }
4995
5002
 
@@ -5057,42 +5064,16 @@
5057
5064
 
5058
5065
  /**
5059
5066
  * --------------------------------------------------------------------------
5060
- * CoreUI (v5.0.0-alpha.0): util/sanitizer.js
5067
+ * CoreUI util/sanitizer.js
5061
5068
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5062
5069
  *
5063
- * This component is a modified version of the Bootstrap's util/sanitizer.js
5070
+ * This is a modified version of the Bootstrap's util/sanitizer.js
5064
5071
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5065
5072
  * --------------------------------------------------------------------------
5066
5073
  */
5067
5074
 
5068
- const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
5075
+ // js-docs-start allow-list
5069
5076
  const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
5070
-
5071
- /**
5072
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
5073
- *
5074
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
5075
- */
5076
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
5077
-
5078
- /**
5079
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
5080
- *
5081
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
5082
- */
5083
- 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;
5084
- const allowedAttribute = (attribute, allowedAttributeList) => {
5085
- const attributeName = attribute.nodeName.toLowerCase();
5086
- if (allowedAttributeList.includes(attributeName)) {
5087
- if (uriAttributes.has(attributeName)) {
5088
- return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
5089
- }
5090
- return true;
5091
- }
5092
-
5093
- // Check if a regular expression validates the attribute.
5094
- return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
5095
- };
5096
5077
  const DefaultAllowlist = {
5097
5078
  // Global attributes allowed on any supplied element below.
5098
5079
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
@@ -5126,6 +5107,30 @@
5126
5107
  u: [],
5127
5108
  ul: []
5128
5109
  };
5110
+ // js-docs-end allow-list
5111
+
5112
+ const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
5113
+
5114
+ /**
5115
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
5116
+ * contexts.
5117
+ *
5118
+ * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
5119
+ */
5120
+ // eslint-disable-next-line unicorn/better-regex
5121
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
5122
+ const allowedAttribute = (attribute, allowedAttributeList) => {
5123
+ const attributeName = attribute.nodeName.toLowerCase();
5124
+ if (allowedAttributeList.includes(attributeName)) {
5125
+ if (uriAttributes.has(attributeName)) {
5126
+ return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
5127
+ }
5128
+ return true;
5129
+ }
5130
+
5131
+ // Check if a regular expression validates the attribute.
5132
+ return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
5133
+ };
5129
5134
  function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
5130
5135
  if (!unsafeHtml.length) {
5131
5136
  return unsafeHtml;
@@ -5155,14 +5160,15 @@
5155
5160
 
5156
5161
  /**
5157
5162
  * --------------------------------------------------------------------------
5158
- * CoreUI (v5.0.0-alpha.0): util/template-factory.js
5163
+ * CoreUI util/template-factory.js
5159
5164
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5160
5165
  *
5161
- * This component is a modified version of the Bootstrap's util/template-factory.js
5166
+ * This is a modified version of the Bootstrap's util/template-factory.js
5162
5167
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5163
5168
  * --------------------------------------------------------------------------
5164
5169
  */
5165
5170
 
5171
+
5166
5172
  /**
5167
5173
  * Constants
5168
5174
  */
@@ -5293,7 +5299,7 @@
5293
5299
 
5294
5300
  /**
5295
5301
  * --------------------------------------------------------------------------
5296
- * CoreUI (v5.0.0-alpha.0): tooltip.js
5302
+ * CoreUI tooltip.js
5297
5303
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5298
5304
  *
5299
5305
  * This component is a modified version of the Bootstrap's tooltip.js
@@ -5301,6 +5307,7 @@
5301
5307
  * --------------------------------------------------------------------------
5302
5308
  */
5303
5309
 
5310
+
5304
5311
  /**
5305
5312
  * Constants
5306
5313
  */
@@ -5343,7 +5350,7 @@
5343
5350
  delay: 0,
5344
5351
  fallbackPlacements: ['top', 'right', 'bottom', 'left'],
5345
5352
  html: false,
5346
- offset: [0, 0],
5353
+ offset: [0, 6],
5347
5354
  placement: 'top',
5348
5355
  popperConfig: null,
5349
5356
  sanitize: true,
@@ -5456,7 +5463,7 @@
5456
5463
  return;
5457
5464
  }
5458
5465
 
5459
- // todo v6 remove this OR make it optional
5466
+ // TODO: v6 remove this or make it optional
5460
5467
  this._disposePopper();
5461
5468
  const tip = this._getTipElement();
5462
5469
  this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
@@ -5542,13 +5549,13 @@
5542
5549
  _createTipElement(content) {
5543
5550
  const tip = this._getTemplateFactory(content).toHtml();
5544
5551
 
5545
- // todo: remove this check on v6
5552
+ // TODO: remove this check in v6
5546
5553
  if (!tip) {
5547
5554
  return null;
5548
5555
  }
5549
5556
  tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$3);
5550
- // todo: on v6 the following can be achieved with CSS only
5551
- tip.classList.add(`cui-${this.constructor.NAME}-auto`);
5557
+ // TODO: v6 the following can be achieved with CSS only
5558
+ tip.classList.add(`bs-${this.constructor.NAME}-auto`);
5552
5559
  const tipId = getUID(this.constructor.NAME).toString();
5553
5560
  tip.setAttribute('id', tipId);
5554
5561
  if (this._isAnimated()) {
@@ -5807,7 +5814,7 @@
5807
5814
 
5808
5815
  /**
5809
5816
  * --------------------------------------------------------------------------
5810
- * CoreUI (v5.0.0-alpha.0): popover.js
5817
+ * CoreUI popover.js
5811
5818
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5812
5819
  *
5813
5820
  * This component is a modified version of the Bootstrap's popover.js
@@ -5815,6 +5822,7 @@
5815
5822
  * --------------------------------------------------------------------------
5816
5823
  */
5817
5824
 
5825
+
5818
5826
  /**
5819
5827
  * Constants
5820
5828
  */
@@ -5890,7 +5898,7 @@
5890
5898
 
5891
5899
  /**
5892
5900
  * --------------------------------------------------------------------------
5893
- * CoreUI (v5.0.0-alpha.0): scrollspy.js
5901
+ * CoreUI scrollspy.js
5894
5902
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5895
5903
  *
5896
5904
  * This component is a modified version of the Bootstrap's scrollspy.js
@@ -5898,6 +5906,7 @@
5898
5906
  * --------------------------------------------------------------------------
5899
5907
  */
5900
5908
 
5909
+
5901
5910
  /**
5902
5911
  * Constants
5903
5912
  */
@@ -6076,11 +6085,11 @@
6076
6085
  if (!anchor.hash || isDisabled(anchor)) {
6077
6086
  continue;
6078
6087
  }
6079
- const observableSection = SelectorEngine.findOne(anchor.hash, this._element);
6088
+ const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);
6080
6089
 
6081
6090
  // ensure that the observableSection exists & is visible
6082
6091
  if (isVisible(observableSection)) {
6083
- this._targetLinks.set(anchor.hash, anchor);
6092
+ this._targetLinks.set(decodeURI(anchor.hash), anchor);
6084
6093
  this._observableSections.set(anchor.hash, observableSection);
6085
6094
  }
6086
6095
  }
@@ -6152,11 +6161,12 @@
6152
6161
 
6153
6162
  /**
6154
6163
  * --------------------------------------------------------------------------
6155
- * CoreUI (v5.0.0-alpha.0): sidebar.js
6164
+ * CoreUI sidebar.js
6156
6165
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
6157
6166
  * --------------------------------------------------------------------------
6158
6167
  */
6159
6168
 
6169
+
6160
6170
  /**
6161
6171
  * ------------------------------------------------------------------------
6162
6172
  * Constants
@@ -6432,7 +6442,7 @@
6432
6442
 
6433
6443
  /**
6434
6444
  * --------------------------------------------------------------------------
6435
- * CoreUI (v5.0.0-alpha.0): tab.js
6445
+ * CoreUI tab.js
6436
6446
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
6437
6447
  *
6438
6448
  * This component is a modified version of the Bootstrap's tab.js
@@ -6440,6 +6450,7 @@
6440
6450
  * --------------------------------------------------------------------------
6441
6451
  */
6442
6452
 
6453
+
6443
6454
  /**
6444
6455
  * Constants
6445
6456
  */
@@ -6458,6 +6469,8 @@
6458
6469
  const ARROW_RIGHT_KEY = 'ArrowRight';
6459
6470
  const ARROW_UP_KEY = 'ArrowUp';
6460
6471
  const ARROW_DOWN_KEY = 'ArrowDown';
6472
+ const HOME_KEY = 'Home';
6473
+ const END_KEY = 'End';
6461
6474
  const CLASS_NAME_ACTIVE = 'active';
6462
6475
  const CLASS_NAME_FADE$1 = 'fade';
6463
6476
  const CLASS_NAME_SHOW$1 = 'show';
@@ -6468,7 +6481,7 @@
6468
6481
  const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
6469
6482
  const SELECTOR_OUTER = '.nav-item, .list-group-item';
6470
6483
  const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
6471
- const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]'; // todo:v6: could be only `tab`
6484
+ const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]'; // TODO: could only be `tab` in v6
6472
6485
  const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
6473
6486
  const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-coreui-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-coreui-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-coreui-toggle="list"]`;
6474
6487
 
@@ -6482,7 +6495,7 @@
6482
6495
  this._parent = this._element.closest(SELECTOR_TAB_PANEL);
6483
6496
  if (!this._parent) {
6484
6497
  return;
6485
- // todo: should Throw exception on v6
6498
+ // TODO: should throw exception in v6
6486
6499
  // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
6487
6500
  }
6488
6501
 
@@ -6564,13 +6577,19 @@
6564
6577
  this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
6565
6578
  }
6566
6579
  _keydown(event) {
6567
- if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) {
6580
+ if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {
6568
6581
  return;
6569
6582
  }
6570
6583
  event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page
6571
6584
  event.preventDefault();
6572
- const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
6573
- const nextActiveElement = getNextActiveElement(this._getChildren().filter(element => !isDisabled(element)), event.target, isNext, true);
6585
+ const children = this._getChildren().filter(element => !isDisabled(element));
6586
+ let nextActiveElement;
6587
+ if ([HOME_KEY, END_KEY].includes(event.key)) {
6588
+ nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];
6589
+ } else {
6590
+ const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
6591
+ nextActiveElement = getNextActiveElement(children, event.target, isNext, true);
6592
+ }
6574
6593
  if (nextActiveElement) {
6575
6594
  nextActiveElement.focus({
6576
6595
  preventScroll: true
@@ -6614,7 +6633,7 @@
6614
6633
  }
6615
6634
  this._setAttributeIfNotExists(target, 'role', 'tabpanel');
6616
6635
  if (child.id) {
6617
- this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
6636
+ this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
6618
6637
  }
6619
6638
  }
6620
6639
  _toggleDropDown(element, open) {
@@ -6696,7 +6715,7 @@
6696
6715
 
6697
6716
  /**
6698
6717
  * --------------------------------------------------------------------------
6699
- * CoreUI (v5.0.0-alpha.0): toast.js
6718
+ * CoreUI toast.js
6700
6719
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
6701
6720
  *
6702
6721
  * This component is a modified version of the Bootstrap's toast.js
@@ -6704,6 +6723,7 @@
6704
6723
  * --------------------------------------------------------------------------
6705
6724
  */
6706
6725
 
6726
+
6707
6727
  /**
6708
6728
  * Constants
6709
6729
  */
@@ -6882,10 +6902,11 @@
6882
6902
 
6883
6903
  /**
6884
6904
  * --------------------------------------------------------------------------
6885
- * CoreUI (v5.0.0-alpha.0): index.esm.js
6886
- * https://github.com/coreui/coreui/blob/main/LICENSE
6905
+ * CoreUI index.esm.js
6906
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
6887
6907
  * --------------------------------------------------------------------------
6888
6908
  */
6909
+
6889
6910
  const index_umd = {
6890
6911
  Alert,
6891
6912
  Button,