@coreui/coreui 4.3.0-alpha.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +2 -2
  2. package/dist/css/coreui-grid.css +1 -1
  3. package/dist/css/coreui-grid.css.map +1 -1
  4. package/dist/css/coreui-grid.min.css +1 -1
  5. package/dist/css/coreui-grid.min.css.map +1 -1
  6. package/dist/css/coreui-grid.rtl.css +2 -2
  7. package/dist/css/coreui-grid.rtl.css.map +1 -1
  8. package/dist/css/coreui-grid.rtl.min.css +2 -2
  9. package/dist/css/coreui-grid.rtl.min.css.map +1 -1
  10. package/dist/css/coreui-reboot.css +44 -149
  11. package/dist/css/coreui-reboot.css.map +1 -1
  12. package/dist/css/coreui-reboot.min.css +2 -2
  13. package/dist/css/coreui-reboot.min.css.map +1 -1
  14. package/dist/css/coreui-reboot.rtl.css +45 -150
  15. package/dist/css/coreui-reboot.rtl.css.map +1 -1
  16. package/dist/css/coreui-reboot.rtl.min.css +3 -3
  17. package/dist/css/coreui-reboot.rtl.min.css.map +1 -1
  18. package/dist/css/coreui-utilities.css +81 -366
  19. package/dist/css/coreui-utilities.css.map +1 -1
  20. package/dist/css/coreui-utilities.min.css +2 -2
  21. package/dist/css/coreui-utilities.min.css.map +1 -1
  22. package/dist/css/coreui-utilities.rtl.css +78 -363
  23. package/dist/css/coreui-utilities.rtl.css.map +1 -1
  24. package/dist/css/coreui-utilities.rtl.min.css +3 -3
  25. package/dist/css/coreui-utilities.rtl.min.css.map +1 -1
  26. package/dist/css/coreui.css +523 -1112
  27. package/dist/css/coreui.css.map +1 -1
  28. package/dist/css/coreui.min.css +2 -2
  29. package/dist/css/coreui.min.css.map +1 -1
  30. package/dist/css/coreui.rtl.css +537 -1140
  31. package/dist/css/coreui.rtl.css.map +1 -1
  32. package/dist/css/coreui.rtl.min.css +3 -3
  33. package/dist/css/coreui.rtl.min.css.map +1 -1
  34. package/dist/js/coreui.bundle.js +43 -47
  35. package/dist/js/coreui.bundle.js.map +1 -1
  36. package/dist/js/coreui.bundle.min.js +2 -2
  37. package/dist/js/coreui.bundle.min.js.map +1 -1
  38. package/dist/js/coreui.esm.js +37 -35
  39. package/dist/js/coreui.esm.js.map +1 -1
  40. package/dist/js/coreui.esm.min.js +2 -2
  41. package/dist/js/coreui.esm.min.js.map +1 -1
  42. package/dist/js/coreui.js +37 -35
  43. package/dist/js/coreui.js.map +1 -1
  44. package/dist/js/coreui.min.js +2 -2
  45. package/dist/js/coreui.min.js.map +1 -1
  46. package/js/dist/alert.js +1 -1
  47. package/js/dist/base-component.js +2 -2
  48. package/js/dist/base-component.js.map +1 -1
  49. package/js/dist/button.js +1 -1
  50. package/js/dist/carousel.js +1 -1
  51. package/js/dist/collapse.js +1 -1
  52. package/js/dist/dom/data.js +1 -1
  53. package/js/dist/dom/event-handler.js +1 -1
  54. package/js/dist/dom/manipulator.js +1 -1
  55. package/js/dist/dom/selector-engine.js +1 -1
  56. package/js/dist/dropdown.js +1 -1
  57. package/js/dist/modal.js +1 -1
  58. package/js/dist/navigation.js +1 -1
  59. package/js/dist/offcanvas.js +1 -1
  60. package/js/dist/popover.js +1 -1
  61. package/js/dist/scrollspy.js +3 -3
  62. package/js/dist/scrollspy.js.map +1 -1
  63. package/js/dist/sidebar.js +1 -1
  64. package/js/dist/tab.js +12 -4
  65. package/js/dist/tab.js.map +1 -1
  66. package/js/dist/toast.js +1 -1
  67. package/js/dist/tooltip.js +1 -1
  68. package/js/dist/util/backdrop.js +1 -1
  69. package/js/dist/util/component-functions.js +1 -1
  70. package/js/dist/util/config.js +1 -1
  71. package/js/dist/util/focustrap.js +1 -1
  72. package/js/dist/util/index.js +1 -1
  73. package/js/dist/util/sanitizer.js +23 -29
  74. package/js/dist/util/sanitizer.js.map +1 -1
  75. package/js/dist/util/scrollbar.js +1 -1
  76. package/js/dist/util/swipe.js +1 -1
  77. package/js/dist/util/template-factory.js +1 -1
  78. package/js/src/base-component.js +1 -1
  79. package/js/src/scrollspy.js +2 -2
  80. package/js/src/tab.js +13 -3
  81. package/js/src/util/sanitizer.js +36 -41
  82. package/package.json +35 -47
  83. package/scss/_accordion.scss +0 -9
  84. package/scss/_alert.scss +5 -5
  85. package/scss/_button-group.scss +3 -3
  86. package/scss/_buttons.scss +0 -22
  87. package/scss/_card.scss +3 -3
  88. package/scss/_carousel.scss +8 -24
  89. package/scss/_close.scss +1 -13
  90. package/scss/_dropdown.scss +4 -4
  91. package/scss/_functions.scss +22 -6
  92. package/scss/_list-group.scss +2 -11
  93. package/scss/_maps.scss +0 -123
  94. package/scss/_mixins.scss +1 -1
  95. package/scss/_nav.scss +2 -17
  96. package/scss/_navbar.scss +1 -10
  97. package/scss/_reboot.scss +4 -4
  98. package/scss/_root.scss +11 -93
  99. package/scss/_tooltip.scss +1 -1
  100. package/scss/_type.scss +1 -1
  101. package/scss/_utilities.scss +0 -16
  102. package/scss/_variables.scss +162 -115
  103. package/scss/coreui-grid.rtl.scss +1 -1
  104. package/scss/coreui-grid.scss +0 -1
  105. package/scss/coreui-reboot.rtl.scss +1 -1
  106. package/scss/coreui-reboot.scss +0 -1
  107. package/scss/coreui-utilities.rtl.scss +1 -1
  108. package/scss/coreui-utilities.scss +0 -1
  109. package/scss/coreui.scss +0 -1
  110. package/scss/forms/_floating-labels.scss +3 -2
  111. package/scss/forms/_form-check.scss +12 -20
  112. package/scss/forms/_form-control.scss +14 -11
  113. package/scss/forms/_form-range.scss +11 -11
  114. package/scss/forms/_form-select.scss +9 -16
  115. package/scss/forms/_form-text.scss +1 -1
  116. package/scss/forms/_labels.scss +2 -2
  117. package/scss/helpers/_color-bg.scss +1 -14
  118. package/scss/helpers/_vr.scss +1 -1
  119. package/scss/mixins/_banner.scss +1 -1
  120. package/scss/mixins/_caret.scss +3 -3
  121. package/scss/mixins/_list-group.scss +0 -1
  122. package/scss/mixins/_utilities.scss +15 -35
  123. package/scss/sidebar/_sidebar.scss +2 -10
  124. package/js/index.esm.js +0 -21
  125. package/js/index.umd.js +0 -38
  126. package/scss/_variables-dark.scss +0 -169
  127. package/scss/mixins/_color-mode.scss +0 -21
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * CoreUI v4.3.0-alpha.0 (https://coreui.io)
2
+ * CoreUI v4.3.0 (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
  */
@@ -666,7 +666,7 @@
666
666
  * Constants
667
667
  */
668
668
 
669
- const VERSION = '4.3.0-alpha.0';
669
+ const VERSION = '4.3.0';
670
670
 
671
671
  /**
672
672
  * Class definition
@@ -2175,7 +2175,6 @@
2175
2175
  }
2176
2176
 
2177
2177
  if (!contains(state.elements.popper, arrowElement)) {
2178
-
2179
2178
  return;
2180
2179
  }
2181
2180
 
@@ -2317,7 +2316,6 @@
2317
2316
  adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
2318
2317
  _options$roundOffsets = options.roundOffsets,
2319
2318
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
2320
-
2321
2319
  var commonStyles = {
2322
2320
  placement: getBasePlacement(state.placement),
2323
2321
  variation: getVariation(state.placement),
@@ -3385,8 +3383,7 @@
3385
3383
 
3386
3384
  state.orderedModifiers = orderedModifiers.filter(function (m) {
3387
3385
  return m.enabled;
3388
- }); // Validate the provided modifiers so that the consumer will get warned
3389
-
3386
+ });
3390
3387
  runModifierEffects();
3391
3388
  return instance.update();
3392
3389
  },
@@ -3406,7 +3403,6 @@
3406
3403
  // anymore
3407
3404
 
3408
3405
  if (!areValidElements(reference, popper)) {
3409
-
3410
3406
  return;
3411
3407
  } // Store the reference and popper rects to be read by modifiers
3412
3408
 
@@ -3431,7 +3427,6 @@
3431
3427
  });
3432
3428
 
3433
3429
  for (var index = 0; index < state.orderedModifiers.length; index++) {
3434
-
3435
3430
  if (state.reset === true) {
3436
3431
  state.reset = false;
3437
3432
  index = -1;
@@ -3469,7 +3464,6 @@
3469
3464
  };
3470
3465
 
3471
3466
  if (!areValidElements(reference, popper)) {
3472
-
3473
3467
  return instance;
3474
3468
  }
3475
3469
 
@@ -3484,11 +3478,11 @@
3484
3478
  // one.
3485
3479
 
3486
3480
  function runModifierEffects() {
3487
- state.orderedModifiers.forEach(function (_ref3) {
3488
- var name = _ref3.name,
3489
- _ref3$options = _ref3.options,
3490
- options = _ref3$options === void 0 ? {} : _ref3$options,
3491
- 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;
3492
3486
 
3493
3487
  if (typeof effect === 'function') {
3494
3488
  var cleanupFn = effect({
@@ -5078,34 +5072,6 @@
5078
5072
  * --------------------------------------------------------------------------
5079
5073
  */
5080
5074
 
5081
- const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
5082
-
5083
- /**
5084
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
5085
- *
5086
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
5087
- */
5088
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
5089
-
5090
- /**
5091
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
5092
- *
5093
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
5094
- */
5095
- 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;
5096
- const allowedAttribute = (attribute, allowedAttributeList) => {
5097
- const attributeName = attribute.nodeName.toLowerCase();
5098
- if (allowedAttributeList.includes(attributeName)) {
5099
- if (uriAttributes.has(attributeName)) {
5100
- return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
5101
- }
5102
- return true;
5103
- }
5104
-
5105
- // Check if a regular expression validates the attribute.
5106
- return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
5107
- };
5108
-
5109
5075
  // js-docs-start allow-list
5110
5076
  const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
5111
5077
  const DefaultAllowlist = {
@@ -5143,6 +5109,28 @@
5143
5109
  };
5144
5110
  // js-docs-end allow-list
5145
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
+ };
5146
5134
  function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
5147
5135
  if (!unsafeHtml.length) {
5148
5136
  return unsafeHtml;
@@ -6097,11 +6085,11 @@
6097
6085
  if (!anchor.hash || isDisabled(anchor)) {
6098
6086
  continue;
6099
6087
  }
6100
- const observableSection = SelectorEngine.findOne(anchor.hash, this._element);
6088
+ const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);
6101
6089
 
6102
6090
  // ensure that the observableSection exists & is visible
6103
6091
  if (isVisible(observableSection)) {
6104
- this._targetLinks.set(anchor.hash, anchor);
6092
+ this._targetLinks.set(decodeURI(anchor.hash), anchor);
6105
6093
  this._observableSections.set(anchor.hash, observableSection);
6106
6094
  }
6107
6095
  }
@@ -6481,6 +6469,8 @@
6481
6469
  const ARROW_RIGHT_KEY = 'ArrowRight';
6482
6470
  const ARROW_UP_KEY = 'ArrowUp';
6483
6471
  const ARROW_DOWN_KEY = 'ArrowDown';
6472
+ const HOME_KEY = 'Home';
6473
+ const END_KEY = 'End';
6484
6474
  const CLASS_NAME_ACTIVE = 'active';
6485
6475
  const CLASS_NAME_FADE$1 = 'fade';
6486
6476
  const CLASS_NAME_SHOW$1 = 'show';
@@ -6587,13 +6577,19 @@
6587
6577
  this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
6588
6578
  }
6589
6579
  _keydown(event) {
6590
- 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)) {
6591
6581
  return;
6592
6582
  }
6593
6583
  event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page
6594
6584
  event.preventDefault();
6595
- const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
6596
- 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
+ }
6597
6593
  if (nextActiveElement) {
6598
6594
  nextActiveElement.focus({
6599
6595
  preventScroll: true