@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
package/dist/js/coreui.js CHANGED
@@ -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
  */
@@ -30,10 +30,61 @@
30
30
 
31
31
  /**
32
32
  * --------------------------------------------------------------------------
33
- * CoreUI (v5.0.0-alpha.0): util/index.js
33
+ * CoreUI dom/data.js
34
34
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
35
35
  *
36
- * This component is a modified version of the Bootstrap's util/index.js
36
+ * This is a modified version of the Bootstrap's dom/data.js
37
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
38
+ * --------------------------------------------------------------------------
39
+ */
40
+
41
+ /**
42
+ * Constants
43
+ */
44
+
45
+ const elementMap = new Map();
46
+ const Data = {
47
+ set(element, key, instance) {
48
+ if (!elementMap.has(element)) {
49
+ elementMap.set(element, new Map());
50
+ }
51
+ const instanceMap = elementMap.get(element);
52
+
53
+ // make it clear we only want one instance per element
54
+ // can be removed later when multiple key/instances are fine to be used
55
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
56
+ // eslint-disable-next-line no-console
57
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
58
+ return;
59
+ }
60
+ instanceMap.set(key, instance);
61
+ },
62
+ get(element, key) {
63
+ if (elementMap.has(element)) {
64
+ return elementMap.get(element).get(key) || null;
65
+ }
66
+ return null;
67
+ },
68
+ remove(element, key) {
69
+ if (!elementMap.has(element)) {
70
+ return;
71
+ }
72
+ const instanceMap = elementMap.get(element);
73
+ instanceMap.delete(key);
74
+
75
+ // free up element references if there are no instances left for an element
76
+ if (instanceMap.size === 0) {
77
+ elementMap.delete(element);
78
+ }
79
+ }
80
+ };
81
+
82
+ /**
83
+ * --------------------------------------------------------------------------
84
+ * CoreUI util/index.js
85
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
86
+ *
87
+ * This is a modified version of the Bootstrap's util/index.js
37
88
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
38
89
  * --------------------------------------------------------------------------
39
90
  */
@@ -280,14 +331,15 @@
280
331
 
281
332
  /**
282
333
  * --------------------------------------------------------------------------
283
- * CoreUI (v5.0.0-alpha.0): dom/event-handler.js
334
+ * CoreUI dom/event-handler.js
284
335
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
285
336
  *
286
- * This component is a modified version of the Bootstrap's dom/event-handler.js
337
+ * This is a modified version of the Bootstrap's dom/event-handler.js
287
338
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
288
339
  * --------------------------------------------------------------------------
289
340
  */
290
341
 
342
+
291
343
  /**
292
344
  * Constants
293
345
  */
@@ -353,7 +405,7 @@
353
405
  }
354
406
  function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
355
407
  const isDelegated = typeof handler === 'string';
356
- // todo: tooltip passes `false` instead of selector, so we need to check
408
+ // TODO: tooltip passes `false` instead of selector, so we need to check
357
409
  const callable = isDelegated ? delegationFunction : handler || delegationFunction;
358
410
  let typeEvent = getTypeEvent(originalTypeEvent);
359
411
  if (!nativeEvents.has(typeEvent)) {
@@ -470,11 +522,10 @@
470
522
  nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
471
523
  defaultPrevented = jQueryEvent.isDefaultPrevented();
472
524
  }
473
- let evt = new Event(event, {
525
+ const evt = hydrateObj(new Event(event, {
474
526
  bubbles,
475
527
  cancelable: true
476
- });
477
- evt = hydrateObj(evt, args);
528
+ }), args);
478
529
  if (defaultPrevented) {
479
530
  evt.preventDefault();
480
531
  }
@@ -505,61 +556,10 @@
505
556
 
506
557
  /**
507
558
  * --------------------------------------------------------------------------
508
- * CoreUI (v5.0.0-alpha.0): dom/data.js
559
+ * CoreUI dom/manipulator.js
509
560
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
510
561
  *
511
- * This component is a modified version of the Bootstrap's dom/data.js
512
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
513
- * --------------------------------------------------------------------------
514
- */
515
-
516
- /**
517
- * Constants
518
- */
519
-
520
- const elementMap = new Map();
521
- const Data = {
522
- set(element, key, instance) {
523
- if (!elementMap.has(element)) {
524
- elementMap.set(element, new Map());
525
- }
526
- const instanceMap = elementMap.get(element);
527
-
528
- // make it clear we only want one instance per element
529
- // can be removed later when multiple key/instances are fine to be used
530
- if (!instanceMap.has(key) && instanceMap.size !== 0) {
531
- // eslint-disable-next-line no-console
532
- console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
533
- return;
534
- }
535
- instanceMap.set(key, instance);
536
- },
537
- get(element, key) {
538
- if (elementMap.has(element)) {
539
- return elementMap.get(element).get(key) || null;
540
- }
541
- return null;
542
- },
543
- remove(element, key) {
544
- if (!elementMap.has(element)) {
545
- return;
546
- }
547
- const instanceMap = elementMap.get(element);
548
- instanceMap.delete(key);
549
-
550
- // free up element references if there are no instances left for an element
551
- if (instanceMap.size === 0) {
552
- elementMap.delete(element);
553
- }
554
- }
555
- };
556
-
557
- /**
558
- * --------------------------------------------------------------------------
559
- * CoreUI (v5.0.0-alpha.0): dom/manipulator.js
560
- * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
561
- *
562
- * This component is a modified version of the Bootstrap's dom/manipulator.js
562
+ * This is a modified version of the Bootstrap's dom/manipulator.js
563
563
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
564
564
  * --------------------------------------------------------------------------
565
565
  */
@@ -601,7 +601,7 @@
601
601
  return {};
602
602
  }
603
603
  const attributes = {};
604
- const coreuiKeys = Object.keys(element.dataset).filter(key => key.startsWith('coreu') && !key.startsWith('coreuiConfig'));
604
+ const coreuiKeys = Object.keys(element.dataset).filter(key => key.startsWith('coreui') && !key.startsWith('coreuiConfig'));
605
605
  for (const key of coreuiKeys) {
606
606
  let pureKey = key.replace(/^coreui/, '');
607
607
  pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
@@ -616,14 +616,15 @@
616
616
 
617
617
  /**
618
618
  * --------------------------------------------------------------------------
619
- * CoreUI (v5.0.0-alpha.0): util/config.js
619
+ * CoreUI util/config.js
620
620
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
621
621
  *
622
- * This component is a modified version of the Bootstrap's util/config.js
622
+ * This is a modified version of the Bootstrap's util/config.js
623
623
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
624
624
  * --------------------------------------------------------------------------
625
625
  */
626
626
 
627
+
627
628
  /**
628
629
  * Class definition
629
630
  */
@@ -671,7 +672,7 @@
671
672
 
672
673
  /**
673
674
  * --------------------------------------------------------------------------
674
- * CoreUI (v5.0.0-alpha.0): base-component.js
675
+ * CoreUI base-component.js
675
676
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
676
677
  *
677
678
  * This component is a modified version of the Bootstrap's base-component.js
@@ -679,11 +680,12 @@
679
680
  * --------------------------------------------------------------------------
680
681
  */
681
682
 
683
+
682
684
  /**
683
685
  * Constants
684
686
  */
685
687
 
686
- const VERSION = '5.0.0-alpha.0';
688
+ const VERSION = '5.0.0-alpha.2';
687
689
 
688
690
  /**
689
691
  * Class definition
@@ -742,13 +744,14 @@
742
744
 
743
745
  /**
744
746
  * --------------------------------------------------------------------------
745
- * CoreUI (v5.0.0-alpha.0): dom/selector-engine.js
747
+ * CoreUI dom/selector-engine.js
746
748
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
747
749
  *
748
- * This component is a modified version of the Bootstrap's dom/selector-engine.js
750
+ * This is a modified version of the Bootstrap's dom/selector-engine.js
749
751
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
750
752
  * --------------------------------------------------------------------------
751
753
  */
754
+
752
755
  const getSelector = element => {
753
756
  let selector = element.getAttribute('data-coreui-target');
754
757
  if (!selector || selector === '#') {
@@ -833,13 +836,14 @@
833
836
 
834
837
  /**
835
838
  * --------------------------------------------------------------------------
836
- * CoreUI (v5.0.0-alpha.0): util/component-functions.js
839
+ * CoreUI util/component-functions.js
837
840
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
838
841
  *
839
- * This component is a modified version of the Bootstrap's util/component-functions.js
842
+ * This is a modified version of the Bootstrap's util/component-functions.js
840
843
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
841
844
  * --------------------------------------------------------------------------
842
845
  */
846
+
843
847
  const enableDismissTrigger = (component, method = 'hide') => {
844
848
  const clickEvent = `click.dismiss${component.EVENT_KEY}`;
845
849
  const name = component.NAME;
@@ -860,7 +864,7 @@
860
864
 
861
865
  /**
862
866
  * --------------------------------------------------------------------------
863
- * CoreUI (v5.0.0-alpha.0): alert.js
867
+ * CoreUI alert.js
864
868
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
865
869
  *
866
870
  * This component is a modified version of the Bootstrap's alert.js
@@ -868,6 +872,7 @@
868
872
  * --------------------------------------------------------------------------
869
873
  */
870
874
 
875
+
871
876
  /**
872
877
  * Constants
873
878
  */
@@ -937,7 +942,7 @@
937
942
 
938
943
  /**
939
944
  * --------------------------------------------------------------------------
940
- * CoreUI (v5.0.0-alpha.0): button.js
945
+ * CoreUI button.js
941
946
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
942
947
  *
943
948
  * This component is a modified version of the Bootstrap's button.js
@@ -945,6 +950,7 @@
945
950
  * --------------------------------------------------------------------------
946
951
  */
947
952
 
953
+
948
954
  /**
949
955
  * Constants
950
956
  */
@@ -1003,14 +1009,15 @@
1003
1009
 
1004
1010
  /**
1005
1011
  * --------------------------------------------------------------------------
1006
- * CoreUI (v5.0.0-alpha.0): util/swipe.js
1012
+ * CoreUI util/swipe.js
1007
1013
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
1008
1014
  *
1009
- * This component is a modified version of the Bootstrap's util/swipe.js
1015
+ * This is a modified version of the Bootstrap's util/swipe.js
1010
1016
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1011
1017
  * --------------------------------------------------------------------------
1012
1018
  */
1013
1019
 
1020
+
1014
1021
  /**
1015
1022
  * Constants
1016
1023
  */
@@ -1125,7 +1132,7 @@
1125
1132
 
1126
1133
  /**
1127
1134
  * --------------------------------------------------------------------------
1128
- * CoreUI (v5.0.0-alpha.0): carousel.js
1135
+ * CoreUI carousel.js
1129
1136
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
1130
1137
  *
1131
1138
  * This component is a modified version of the Bootstrap's carousel.js
@@ -1133,6 +1140,7 @@
1133
1140
  * --------------------------------------------------------------------------
1134
1141
  */
1135
1142
 
1143
+
1136
1144
  /**
1137
1145
  * Constants
1138
1146
  */
@@ -1388,7 +1396,7 @@
1388
1396
  }
1389
1397
  if (!activeElement || !nextElement) {
1390
1398
  // Some weirdness is happening, so we bail
1391
- // todo: change tests that use empty divs to avoid this check
1399
+ // TODO: change tests that use empty divs to avoid this check
1392
1400
  return;
1393
1401
  }
1394
1402
  const isCycling = Boolean(this._interval);
@@ -1500,7 +1508,7 @@
1500
1508
 
1501
1509
  /**
1502
1510
  * --------------------------------------------------------------------------
1503
- * CoreUI (v5.0.0-alpha.0): collapse.js
1511
+ * CoreUI collapse.js
1504
1512
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
1505
1513
  *
1506
1514
  * This component is a modified version of the Bootstrap's collapse.js
@@ -1508,6 +1516,7 @@
1508
1516
  * --------------------------------------------------------------------------
1509
1517
  */
1510
1518
 
1519
+
1511
1520
  /**
1512
1521
  * Constants
1513
1522
  */
@@ -1736,7 +1745,7 @@
1736
1745
 
1737
1746
  /**
1738
1747
  * --------------------------------------------------------------------------
1739
- * CoreUI (v5.0.0-alpha.0): dropdown.js
1748
+ * CoreUI dropdown.js
1740
1749
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
1741
1750
  *
1742
1751
  * This component is a modified version of the Bootstrap's dropdown.js
@@ -1744,6 +1753,7 @@
1744
1753
  * --------------------------------------------------------------------------
1745
1754
  */
1746
1755
 
1756
+
1747
1757
  /**
1748
1758
  * Constants
1749
1759
  */
@@ -1811,7 +1821,7 @@
1811
1821
  super(element, config);
1812
1822
  this._popper = null;
1813
1823
  this._parent = this._element.parentNode; // dropdown wrapper
1814
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
1824
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
1815
1825
  this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
1816
1826
  this._inNavbar = this._detectNavbar();
1817
1827
  }
@@ -1985,7 +1995,7 @@
1985
1995
 
1986
1996
  // Disable Popper if we have a static display or Dropdown is in Navbar
1987
1997
  if (this._inNavbar || this._config.display === 'static') {
1988
- Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
1998
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
1989
1999
  defaultBsPopperConfig.modifiers = [{
1990
2000
  name: 'applyStyles',
1991
2001
  enabled: false
@@ -2067,7 +2077,7 @@
2067
2077
  }
2068
2078
  event.preventDefault();
2069
2079
 
2070
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
2080
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
2071
2081
  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);
2072
2082
  const instance = Dropdown.getOrCreateInstance(getToggleButton);
2073
2083
  if (isUpOrDownEvent) {
@@ -2106,113 +2116,14 @@
2106
2116
 
2107
2117
  /**
2108
2118
  * --------------------------------------------------------------------------
2109
- * CoreUI (v5.0.0-alpha.0): util/scrollBar.js
2119
+ * CoreUI util/backdrop.js
2110
2120
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
2111
2121
  *
2112
- * This component is a modified version of the Bootstrap's util/scrollBar.js
2122
+ * This is a modified version of the Bootstrap's util/backdrop.js
2113
2123
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2114
2124
  * --------------------------------------------------------------------------
2115
2125
  */
2116
2126
 
2117
- /**
2118
- * Constants
2119
- */
2120
-
2121
- const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
2122
- const SELECTOR_STICKY_CONTENT = '.sticky-top';
2123
- const PROPERTY_PADDING = 'padding-right';
2124
- const PROPERTY_MARGIN = 'margin-right';
2125
-
2126
- /**
2127
- * Class definition
2128
- */
2129
-
2130
- class ScrollBarHelper {
2131
- constructor() {
2132
- this._element = document.body;
2133
- }
2134
-
2135
- // Public
2136
- getWidth() {
2137
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
2138
- const documentWidth = document.documentElement.clientWidth;
2139
- return Math.abs(window.innerWidth - documentWidth);
2140
- }
2141
- hide() {
2142
- const width = this.getWidth();
2143
- this._disableOverFlow();
2144
- // give padding to element to balance the hidden scrollbar width
2145
- this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2146
- // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
2147
- this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2148
- this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
2149
- }
2150
- reset() {
2151
- this._resetElementAttributes(this._element, 'overflow');
2152
- this._resetElementAttributes(this._element, PROPERTY_PADDING);
2153
- this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
2154
- this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
2155
- }
2156
- isOverflowing() {
2157
- return this.getWidth() > 0;
2158
- }
2159
-
2160
- // Private
2161
- _disableOverFlow() {
2162
- this._saveInitialAttribute(this._element, 'overflow');
2163
- this._element.style.overflow = 'hidden';
2164
- }
2165
- _setElementAttributes(selector, styleProperty, callback) {
2166
- const scrollbarWidth = this.getWidth();
2167
- const manipulationCallBack = element => {
2168
- if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
2169
- return;
2170
- }
2171
- this._saveInitialAttribute(element, styleProperty);
2172
- const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
2173
- element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
2174
- };
2175
- this._applyManipulationCallback(selector, manipulationCallBack);
2176
- }
2177
- _saveInitialAttribute(element, styleProperty) {
2178
- const actualValue = element.style.getPropertyValue(styleProperty);
2179
- if (actualValue) {
2180
- Manipulator.setDataAttribute(element, styleProperty, actualValue);
2181
- }
2182
- }
2183
- _resetElementAttributes(selector, styleProperty) {
2184
- const manipulationCallBack = element => {
2185
- const value = Manipulator.getDataAttribute(element, styleProperty);
2186
- // We only want to remove the property if the value is `null`; the value can also be zero
2187
- if (value === null) {
2188
- element.style.removeProperty(styleProperty);
2189
- return;
2190
- }
2191
- Manipulator.removeDataAttribute(element, styleProperty);
2192
- element.style.setProperty(styleProperty, value);
2193
- };
2194
- this._applyManipulationCallback(selector, manipulationCallBack);
2195
- }
2196
- _applyManipulationCallback(selector, callBack) {
2197
- if (isElement(selector)) {
2198
- callBack(selector);
2199
- return;
2200
- }
2201
- for (const sel of SelectorEngine.find(selector, this._element)) {
2202
- callBack(sel);
2203
- }
2204
- }
2205
- }
2206
-
2207
- /**
2208
- * --------------------------------------------------------------------------
2209
- * CoreUI (v5.0.0-alpha.0): util/backdrop.js
2210
- * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
2211
- *
2212
- * This component is a modified version of the Bootstrap's util/backdrop.js
2213
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2214
- * --------------------------------------------------------------------------
2215
- */
2216
2127
 
2217
2128
  /**
2218
2129
  * Constants
@@ -2333,14 +2244,15 @@
2333
2244
 
2334
2245
  /**
2335
2246
  * --------------------------------------------------------------------------
2336
- * CoreUI (v5.0.0-alpha.0): util/focustrap.js
2247
+ * CoreUI util/focustrap.js
2337
2248
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
2338
2249
  *
2339
- * This component is a modified version of the Bootstrap's util/focustrap.js
2250
+ * This is a modified version of the Bootstrap's util/focustrap.js
2340
2251
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2341
2252
  * --------------------------------------------------------------------------
2342
2253
  */
2343
2254
 
2255
+
2344
2256
  /**
2345
2257
  * Constants
2346
2258
  */
@@ -2434,7 +2346,108 @@
2434
2346
 
2435
2347
  /**
2436
2348
  * --------------------------------------------------------------------------
2437
- * CoreUI (v5.0.0-alpha.0): modal.js
2349
+ * CoreUI util/scrollBar.js
2350
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
2351
+ *
2352
+ * This is a modified version of the Bootstrap's util/scrollBar.js
2353
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2354
+ * --------------------------------------------------------------------------
2355
+ */
2356
+
2357
+
2358
+ /**
2359
+ * Constants
2360
+ */
2361
+
2362
+ const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
2363
+ const SELECTOR_STICKY_CONTENT = '.sticky-top';
2364
+ const PROPERTY_PADDING = 'padding-right';
2365
+ const PROPERTY_MARGIN = 'margin-right';
2366
+
2367
+ /**
2368
+ * Class definition
2369
+ */
2370
+
2371
+ class ScrollBarHelper {
2372
+ constructor() {
2373
+ this._element = document.body;
2374
+ }
2375
+
2376
+ // Public
2377
+ getWidth() {
2378
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
2379
+ const documentWidth = document.documentElement.clientWidth;
2380
+ return Math.abs(window.innerWidth - documentWidth);
2381
+ }
2382
+ hide() {
2383
+ const width = this.getWidth();
2384
+ this._disableOverFlow();
2385
+ // give padding to element to balance the hidden scrollbar width
2386
+ this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2387
+ // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
2388
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2389
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
2390
+ }
2391
+ reset() {
2392
+ this._resetElementAttributes(this._element, 'overflow');
2393
+ this._resetElementAttributes(this._element, PROPERTY_PADDING);
2394
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
2395
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
2396
+ }
2397
+ isOverflowing() {
2398
+ return this.getWidth() > 0;
2399
+ }
2400
+
2401
+ // Private
2402
+ _disableOverFlow() {
2403
+ this._saveInitialAttribute(this._element, 'overflow');
2404
+ this._element.style.overflow = 'hidden';
2405
+ }
2406
+ _setElementAttributes(selector, styleProperty, callback) {
2407
+ const scrollbarWidth = this.getWidth();
2408
+ const manipulationCallBack = element => {
2409
+ if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
2410
+ return;
2411
+ }
2412
+ this._saveInitialAttribute(element, styleProperty);
2413
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
2414
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
2415
+ };
2416
+ this._applyManipulationCallback(selector, manipulationCallBack);
2417
+ }
2418
+ _saveInitialAttribute(element, styleProperty) {
2419
+ const actualValue = element.style.getPropertyValue(styleProperty);
2420
+ if (actualValue) {
2421
+ Manipulator.setDataAttribute(element, styleProperty, actualValue);
2422
+ }
2423
+ }
2424
+ _resetElementAttributes(selector, styleProperty) {
2425
+ const manipulationCallBack = element => {
2426
+ const value = Manipulator.getDataAttribute(element, styleProperty);
2427
+ // We only want to remove the property if the value is `null`; the value can also be zero
2428
+ if (value === null) {
2429
+ element.style.removeProperty(styleProperty);
2430
+ return;
2431
+ }
2432
+ Manipulator.removeDataAttribute(element, styleProperty);
2433
+ element.style.setProperty(styleProperty, value);
2434
+ };
2435
+ this._applyManipulationCallback(selector, manipulationCallBack);
2436
+ }
2437
+ _applyManipulationCallback(selector, callBack) {
2438
+ if (isElement(selector)) {
2439
+ callBack(selector);
2440
+ return;
2441
+ }
2442
+ for (const sel of SelectorEngine.find(selector, this._element)) {
2443
+ callBack(sel);
2444
+ }
2445
+ }
2446
+ }
2447
+
2448
+ /**
2449
+ * --------------------------------------------------------------------------
2450
+ * CoreUI modal.js
2438
2451
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
2439
2452
  *
2440
2453
  * This component is a modified version of the Bootstrap's modal.js
@@ -2442,6 +2455,7 @@
2442
2455
  * --------------------------------------------------------------------------
2443
2456
  */
2444
2457
 
2458
+
2445
2459
  /**
2446
2460
  * Constants
2447
2461
  */
@@ -2543,9 +2557,8 @@
2543
2557
  this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
2544
2558
  }
2545
2559
  dispose() {
2546
- for (const htmlElement of [window, this._dialog]) {
2547
- EventHandler.off(htmlElement, EVENT_KEY$6);
2548
- }
2560
+ EventHandler.off(window, EVENT_KEY$6);
2561
+ EventHandler.off(this._dialog, EVENT_KEY$6);
2549
2562
  this._backdrop.dispose();
2550
2563
  this._focustrap.deactivate();
2551
2564
  super.dispose();
@@ -2600,7 +2613,6 @@
2600
2613
  return;
2601
2614
  }
2602
2615
  if (this._config.keyboard) {
2603
- event.preventDefault();
2604
2616
  this.hide();
2605
2617
  return;
2606
2618
  }
@@ -2743,11 +2755,12 @@
2743
2755
 
2744
2756
  /**
2745
2757
  * --------------------------------------------------------------------------
2746
- * CoreUI (v5.0.0-alpha.0): navigation.js
2758
+ * CoreUI navigation.js
2747
2759
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
2748
2760
  * --------------------------------------------------------------------------
2749
2761
  */
2750
2762
 
2763
+
2751
2764
  /**
2752
2765
  * ------------------------------------------------------------------------
2753
2766
  * Constants
@@ -2997,14 +3010,15 @@
2997
3010
 
2998
3011
  /**
2999
3012
  * --------------------------------------------------------------------------
3000
- * CoreUI (v5.0.0-alpha.0): offcanvas.js
3013
+ * CoreUI offcanvas.js
3001
3014
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3002
3015
  *
3003
3016
  * This component is a modified version of the Bootstrap's offcanvas.js
3004
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3017
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3005
3018
  * --------------------------------------------------------------------------
3006
3019
  */
3007
3020
 
3021
+
3008
3022
  /**
3009
3023
  * Constants
3010
3024
  */
@@ -3158,11 +3172,11 @@
3158
3172
  if (event.key !== ESCAPE_KEY) {
3159
3173
  return;
3160
3174
  }
3161
- if (!this._config.keyboard) {
3162
- EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
3175
+ if (this._config.keyboard) {
3176
+ this.hide();
3163
3177
  return;
3164
3178
  }
3165
- this.hide();
3179
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
3166
3180
  });
3167
3181
  }
3168
3182
 
@@ -3230,42 +3244,16 @@
3230
3244
 
3231
3245
  /**
3232
3246
  * --------------------------------------------------------------------------
3233
- * CoreUI (v5.0.0-alpha.0): util/sanitizer.js
3247
+ * CoreUI util/sanitizer.js
3234
3248
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3235
3249
  *
3236
- * This component is a modified version of the Bootstrap's util/sanitizer.js
3250
+ * This is a modified version of the Bootstrap's util/sanitizer.js
3237
3251
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3238
3252
  * --------------------------------------------------------------------------
3239
3253
  */
3240
3254
 
3241
- const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
3255
+ // js-docs-start allow-list
3242
3256
  const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
3243
-
3244
- /**
3245
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
3246
- *
3247
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
3248
- */
3249
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
3250
-
3251
- /**
3252
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
3253
- *
3254
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
3255
- */
3256
- 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;
3257
- const allowedAttribute = (attribute, allowedAttributeList) => {
3258
- const attributeName = attribute.nodeName.toLowerCase();
3259
- if (allowedAttributeList.includes(attributeName)) {
3260
- if (uriAttributes.has(attributeName)) {
3261
- return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
3262
- }
3263
- return true;
3264
- }
3265
-
3266
- // Check if a regular expression validates the attribute.
3267
- return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
3268
- };
3269
3257
  const DefaultAllowlist = {
3270
3258
  // Global attributes allowed on any supplied element below.
3271
3259
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
@@ -3299,6 +3287,30 @@
3299
3287
  u: [],
3300
3288
  ul: []
3301
3289
  };
3290
+ // js-docs-end allow-list
3291
+
3292
+ const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
3293
+
3294
+ /**
3295
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
3296
+ * contexts.
3297
+ *
3298
+ * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
3299
+ */
3300
+ // eslint-disable-next-line unicorn/better-regex
3301
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
3302
+ const allowedAttribute = (attribute, allowedAttributeList) => {
3303
+ const attributeName = attribute.nodeName.toLowerCase();
3304
+ if (allowedAttributeList.includes(attributeName)) {
3305
+ if (uriAttributes.has(attributeName)) {
3306
+ return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
3307
+ }
3308
+ return true;
3309
+ }
3310
+
3311
+ // Check if a regular expression validates the attribute.
3312
+ return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
3313
+ };
3302
3314
  function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
3303
3315
  if (!unsafeHtml.length) {
3304
3316
  return unsafeHtml;
@@ -3328,14 +3340,15 @@
3328
3340
 
3329
3341
  /**
3330
3342
  * --------------------------------------------------------------------------
3331
- * CoreUI (v5.0.0-alpha.0): util/template-factory.js
3343
+ * CoreUI util/template-factory.js
3332
3344
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3333
3345
  *
3334
- * This component is a modified version of the Bootstrap's util/template-factory.js
3346
+ * This is a modified version of the Bootstrap's util/template-factory.js
3335
3347
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3336
3348
  * --------------------------------------------------------------------------
3337
3349
  */
3338
3350
 
3351
+
3339
3352
  /**
3340
3353
  * Constants
3341
3354
  */
@@ -3466,7 +3479,7 @@
3466
3479
 
3467
3480
  /**
3468
3481
  * --------------------------------------------------------------------------
3469
- * CoreUI (v5.0.0-alpha.0): tooltip.js
3482
+ * CoreUI tooltip.js
3470
3483
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3471
3484
  *
3472
3485
  * This component is a modified version of the Bootstrap's tooltip.js
@@ -3474,6 +3487,7 @@
3474
3487
  * --------------------------------------------------------------------------
3475
3488
  */
3476
3489
 
3490
+
3477
3491
  /**
3478
3492
  * Constants
3479
3493
  */
@@ -3516,7 +3530,7 @@
3516
3530
  delay: 0,
3517
3531
  fallbackPlacements: ['top', 'right', 'bottom', 'left'],
3518
3532
  html: false,
3519
- offset: [0, 0],
3533
+ offset: [0, 6],
3520
3534
  placement: 'top',
3521
3535
  popperConfig: null,
3522
3536
  sanitize: true,
@@ -3629,7 +3643,7 @@
3629
3643
  return;
3630
3644
  }
3631
3645
 
3632
- // todo v6 remove this OR make it optional
3646
+ // TODO: v6 remove this or make it optional
3633
3647
  this._disposePopper();
3634
3648
  const tip = this._getTipElement();
3635
3649
  this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
@@ -3715,13 +3729,13 @@
3715
3729
  _createTipElement(content) {
3716
3730
  const tip = this._getTemplateFactory(content).toHtml();
3717
3731
 
3718
- // todo: remove this check on v6
3732
+ // TODO: remove this check in v6
3719
3733
  if (!tip) {
3720
3734
  return null;
3721
3735
  }
3722
3736
  tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$3);
3723
- // todo: on v6 the following can be achieved with CSS only
3724
- tip.classList.add(`cui-${this.constructor.NAME}-auto`);
3737
+ // TODO: v6 the following can be achieved with CSS only
3738
+ tip.classList.add(`bs-${this.constructor.NAME}-auto`);
3725
3739
  const tipId = getUID(this.constructor.NAME).toString();
3726
3740
  tip.setAttribute('id', tipId);
3727
3741
  if (this._isAnimated()) {
@@ -3980,7 +3994,7 @@
3980
3994
 
3981
3995
  /**
3982
3996
  * --------------------------------------------------------------------------
3983
- * CoreUI (v5.0.0-alpha.0): popover.js
3997
+ * CoreUI popover.js
3984
3998
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
3985
3999
  *
3986
4000
  * This component is a modified version of the Bootstrap's popover.js
@@ -3988,6 +4002,7 @@
3988
4002
  * --------------------------------------------------------------------------
3989
4003
  */
3990
4004
 
4005
+
3991
4006
  /**
3992
4007
  * Constants
3993
4008
  */
@@ -4063,7 +4078,7 @@
4063
4078
 
4064
4079
  /**
4065
4080
  * --------------------------------------------------------------------------
4066
- * CoreUI (v5.0.0-alpha.0): scrollspy.js
4081
+ * CoreUI scrollspy.js
4067
4082
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4068
4083
  *
4069
4084
  * This component is a modified version of the Bootstrap's scrollspy.js
@@ -4071,6 +4086,7 @@
4071
4086
  * --------------------------------------------------------------------------
4072
4087
  */
4073
4088
 
4089
+
4074
4090
  /**
4075
4091
  * Constants
4076
4092
  */
@@ -4249,11 +4265,11 @@
4249
4265
  if (!anchor.hash || isDisabled(anchor)) {
4250
4266
  continue;
4251
4267
  }
4252
- const observableSection = SelectorEngine.findOne(anchor.hash, this._element);
4268
+ const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);
4253
4269
 
4254
4270
  // ensure that the observableSection exists & is visible
4255
4271
  if (isVisible(observableSection)) {
4256
- this._targetLinks.set(anchor.hash, anchor);
4272
+ this._targetLinks.set(decodeURI(anchor.hash), anchor);
4257
4273
  this._observableSections.set(anchor.hash, observableSection);
4258
4274
  }
4259
4275
  }
@@ -4325,11 +4341,12 @@
4325
4341
 
4326
4342
  /**
4327
4343
  * --------------------------------------------------------------------------
4328
- * CoreUI (v5.0.0-alpha.0): sidebar.js
4344
+ * CoreUI sidebar.js
4329
4345
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4330
4346
  * --------------------------------------------------------------------------
4331
4347
  */
4332
4348
 
4349
+
4333
4350
  /**
4334
4351
  * ------------------------------------------------------------------------
4335
4352
  * Constants
@@ -4605,7 +4622,7 @@
4605
4622
 
4606
4623
  /**
4607
4624
  * --------------------------------------------------------------------------
4608
- * CoreUI (v5.0.0-alpha.0): tab.js
4625
+ * CoreUI tab.js
4609
4626
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4610
4627
  *
4611
4628
  * This component is a modified version of the Bootstrap's tab.js
@@ -4613,6 +4630,7 @@
4613
4630
  * --------------------------------------------------------------------------
4614
4631
  */
4615
4632
 
4633
+
4616
4634
  /**
4617
4635
  * Constants
4618
4636
  */
@@ -4631,6 +4649,8 @@
4631
4649
  const ARROW_RIGHT_KEY = 'ArrowRight';
4632
4650
  const ARROW_UP_KEY = 'ArrowUp';
4633
4651
  const ARROW_DOWN_KEY = 'ArrowDown';
4652
+ const HOME_KEY = 'Home';
4653
+ const END_KEY = 'End';
4634
4654
  const CLASS_NAME_ACTIVE = 'active';
4635
4655
  const CLASS_NAME_FADE$1 = 'fade';
4636
4656
  const CLASS_NAME_SHOW$1 = 'show';
@@ -4641,7 +4661,7 @@
4641
4661
  const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
4642
4662
  const SELECTOR_OUTER = '.nav-item, .list-group-item';
4643
4663
  const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
4644
- const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]'; // todo:v6: could be only `tab`
4664
+ const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]'; // TODO: could only be `tab` in v6
4645
4665
  const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
4646
4666
  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"]`;
4647
4667
 
@@ -4655,7 +4675,7 @@
4655
4675
  this._parent = this._element.closest(SELECTOR_TAB_PANEL);
4656
4676
  if (!this._parent) {
4657
4677
  return;
4658
- // todo: should Throw exception on v6
4678
+ // TODO: should throw exception in v6
4659
4679
  // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
4660
4680
  }
4661
4681
 
@@ -4737,13 +4757,19 @@
4737
4757
  this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
4738
4758
  }
4739
4759
  _keydown(event) {
4740
- if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) {
4760
+ if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {
4741
4761
  return;
4742
4762
  }
4743
4763
  event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page
4744
4764
  event.preventDefault();
4745
- const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
4746
- const nextActiveElement = getNextActiveElement(this._getChildren().filter(element => !isDisabled(element)), event.target, isNext, true);
4765
+ const children = this._getChildren().filter(element => !isDisabled(element));
4766
+ let nextActiveElement;
4767
+ if ([HOME_KEY, END_KEY].includes(event.key)) {
4768
+ nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];
4769
+ } else {
4770
+ const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
4771
+ nextActiveElement = getNextActiveElement(children, event.target, isNext, true);
4772
+ }
4747
4773
  if (nextActiveElement) {
4748
4774
  nextActiveElement.focus({
4749
4775
  preventScroll: true
@@ -4787,7 +4813,7 @@
4787
4813
  }
4788
4814
  this._setAttributeIfNotExists(target, 'role', 'tabpanel');
4789
4815
  if (child.id) {
4790
- this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
4816
+ this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
4791
4817
  }
4792
4818
  }
4793
4819
  _toggleDropDown(element, open) {
@@ -4869,7 +4895,7 @@
4869
4895
 
4870
4896
  /**
4871
4897
  * --------------------------------------------------------------------------
4872
- * CoreUI (v5.0.0-alpha.0): toast.js
4898
+ * CoreUI toast.js
4873
4899
  * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
4874
4900
  *
4875
4901
  * This component is a modified version of the Bootstrap's toast.js
@@ -4877,6 +4903,7 @@
4877
4903
  * --------------------------------------------------------------------------
4878
4904
  */
4879
4905
 
4906
+
4880
4907
  /**
4881
4908
  * Constants
4882
4909
  */
@@ -5055,10 +5082,11 @@
5055
5082
 
5056
5083
  /**
5057
5084
  * --------------------------------------------------------------------------
5058
- * CoreUI (v5.0.0-alpha.0): index.esm.js
5059
- * https://github.com/coreui/coreui/blob/main/LICENSE
5085
+ * CoreUI index.esm.js
5086
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5060
5087
  * --------------------------------------------------------------------------
5061
5088
  */
5089
+
5062
5090
  const index_umd = {
5063
5091
  Alert,
5064
5092
  Button,