@coreui/coreui 4.1.0 → 4.1.1

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 (115) hide show
  1. package/README.md +3 -3
  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 +158 -158
  7. package/dist/css/coreui-grid.rtl.css.map +1 -1
  8. package/dist/css/coreui-grid.rtl.min.css +3 -3
  9. package/dist/css/coreui-grid.rtl.min.css.map +1 -1
  10. package/dist/css/coreui-reboot.css +1 -1
  11. package/dist/css/coreui-reboot.css.map +1 -1
  12. package/dist/css/coreui-reboot.min.css +1 -1
  13. package/dist/css/coreui-reboot.min.css.map +1 -1
  14. package/dist/css/coreui-reboot.rtl.css +2 -2
  15. package/dist/css/coreui-reboot.rtl.css.map +1 -1
  16. package/dist/css/coreui-reboot.rtl.min.css +2 -2
  17. package/dist/css/coreui-reboot.rtl.min.css.map +1 -1
  18. package/dist/css/coreui-utilities.css +1 -1
  19. package/dist/css/coreui-utilities.css.map +1 -1
  20. package/dist/css/coreui-utilities.min.css +1 -1
  21. package/dist/css/coreui-utilities.min.css.map +1 -1
  22. package/dist/css/coreui-utilities.rtl.css +218 -218
  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 +6 -5
  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 +223 -222
  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 +111 -80
  35. package/dist/js/coreui.bundle.js.map +1 -1
  36. package/dist/js/coreui.bundle.min.js +3 -3
  37. package/dist/js/coreui.bundle.min.js.map +1 -1
  38. package/dist/js/coreui.esm.js +80 -68
  39. package/dist/js/coreui.esm.js.map +1 -1
  40. package/dist/js/coreui.esm.min.js +3 -3
  41. package/dist/js/coreui.esm.min.js.map +1 -1
  42. package/dist/js/coreui.js +82 -70
  43. package/dist/js/coreui.js.map +1 -1
  44. package/dist/js/coreui.min.js +3 -3
  45. package/dist/js/coreui.min.js.map +1 -1
  46. package/js/dist/alert.js +4 -4
  47. package/js/dist/alert.js.map +1 -1
  48. package/js/dist/base-component.js +5 -5
  49. package/js/dist/base-component.js.map +1 -1
  50. package/js/dist/button.js +4 -4
  51. package/js/dist/button.js.map +1 -1
  52. package/js/dist/carousel.js +30 -10
  53. package/js/dist/carousel.js.map +1 -1
  54. package/js/dist/collapse.js +8 -8
  55. package/js/dist/collapse.js.map +1 -1
  56. package/js/dist/dom/data.js +3 -3
  57. package/js/dist/dom/data.js.map +1 -1
  58. package/js/dist/dom/event-handler.js +4 -4
  59. package/js/dist/dom/event-handler.js.map +1 -1
  60. package/js/dist/dom/manipulator.js +3 -3
  61. package/js/dist/dom/manipulator.js.map +1 -1
  62. package/js/dist/dom/selector-engine.js +25 -5
  63. package/js/dist/dom/selector-engine.js.map +1 -1
  64. package/js/dist/dropdown.js +30 -10
  65. package/js/dist/dropdown.js.map +1 -1
  66. package/js/dist/modal.js +29 -9
  67. package/js/dist/modal.js.map +1 -1
  68. package/js/dist/offcanvas.js +29 -9
  69. package/js/dist/offcanvas.js.map +1 -1
  70. package/js/dist/popover.js +4 -4
  71. package/js/dist/popover.js.map +1 -1
  72. package/js/dist/scrollspy.js +8 -8
  73. package/js/dist/scrollspy.js.map +1 -1
  74. package/js/dist/tab.js +4 -4
  75. package/js/dist/tab.js.map +1 -1
  76. package/js/dist/toast.js +8 -8
  77. package/js/dist/toast.js.map +1 -1
  78. package/js/dist/tooltip.js +10 -10
  79. package/js/dist/tooltip.js.map +1 -1
  80. package/js/src/alert.js +1 -1
  81. package/js/src/base-component.js +2 -2
  82. package/js/src/button.js +1 -1
  83. package/js/src/carousel.js +2 -1
  84. package/js/src/collapse.js +1 -1
  85. package/js/src/dom/data.js +1 -1
  86. package/js/src/dom/event-handler.js +1 -1
  87. package/js/src/dom/manipulator.js +1 -1
  88. package/js/src/dom/selector-engine.js +1 -1
  89. package/js/src/dropdown.js +1 -1
  90. package/js/src/modal.js +1 -1
  91. package/js/src/navigation.js +1 -1
  92. package/js/src/offcanvas.js +1 -1
  93. package/js/src/popover.js +1 -1
  94. package/js/src/scrollspy.js +1 -1
  95. package/js/src/sidebar.js +21 -27
  96. package/js/src/tab.js +1 -1
  97. package/js/src/toast.js +1 -1
  98. package/js/src/tooltip.js +1 -1
  99. package/js/src/util/index.js +26 -7
  100. package/js/src/util/sanitizer.js +1 -1
  101. package/package.json +36 -40
  102. package/scss/_modal.scss +1 -1
  103. package/scss/_nav.scss +1 -2
  104. package/scss/_variables.scss +4 -1
  105. package/scss/coreui-grid.rtl.scss +1 -1
  106. package/scss/coreui-grid.scss +1 -1
  107. package/scss/coreui-reboot.rtl.scss +1 -1
  108. package/scss/coreui-reboot.scss +1 -1
  109. package/scss/coreui-utilities.rtl.scss +1 -1
  110. package/scss/coreui-utilities.scss +1 -1
  111. package/scss/coreui.rtl.scss +1 -1
  112. package/scss/coreui.scss +1 -1
  113. package/scss/mixins/_reset-text.scss +1 -1
  114. package/scss/mixins/_utilities.scss +8 -20
  115. package/scss/sidebar/_sidebar-nav.scss +1 -0
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * CoreUI v4.1.0 (https://coreui.io)
3
- * Copyright 2021 The CoreUI Team (https://github.com/orgs/coreui/people)
2
+ * CoreUI v4.1.1 (https://coreui.io)
3
+ * Copyright 2022 The CoreUI Team (https://github.com/orgs/coreui/people)
4
4
  * Licensed under MIT (https://coreui.io)
5
5
  */
6
6
  import * as Popper from '@popperjs/core';
7
7
 
8
8
  /**
9
9
  * --------------------------------------------------------------------------
10
- * CoreUI (v4.1.0): alert.js
10
+ * CoreUI (v4.1.1): alert.js
11
11
  * Licensed under MIT (https://coreui.io/license)
12
12
  *
13
13
  * This component is a modified version of the Bootstrap's util/index.js
@@ -18,12 +18,12 @@ const MAX_UID = 1000000;
18
18
  const MILLISECONDS_MULTIPLIER = 1000;
19
19
  const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
20
20
 
21
- const toType = obj => {
22
- if (obj === null || obj === undefined) {
23
- return `${obj}`;
21
+ const toType = object => {
22
+ if (object === null || object === undefined) {
23
+ return `${object}`;
24
24
  }
25
25
 
26
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
26
+ return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
27
27
  };
28
28
  /**
29
29
  * --------------------------------------------------------------------------
@@ -148,7 +148,27 @@ const isVisible = element => {
148
148
  return false;
149
149
  }
150
150
 
151
- return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
151
+ const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; // Handle `details` element as its content may falsie appear visible when it is closed
152
+
153
+ const closedDetails = element.closest('details:not([open])');
154
+
155
+ if (!closedDetails) {
156
+ return elementIsVisible;
157
+ }
158
+
159
+ if (closedDetails !== element) {
160
+ const summary = element.closest('summary');
161
+
162
+ if (summary && summary.parentNode !== closedDetails) {
163
+ return false;
164
+ }
165
+
166
+ if (summary === null) {
167
+ return false;
168
+ }
169
+ }
170
+
171
+ return elementIsVisible;
152
172
  };
153
173
 
154
174
  const isDisabled = element => {
@@ -321,7 +341,7 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
321
341
 
322
342
  /**
323
343
  * --------------------------------------------------------------------------
324
- * CoreUI (v4.1.0): dom/event-handler.js
344
+ * CoreUI (v4.1.1): dom/event-handler.js
325
345
  * Licensed under MIT (https://coreui.io/license)
326
346
  *
327
347
  * This component is a modified version of the Bootstrap's dom/event-handler.js
@@ -612,7 +632,7 @@ const EventHandler = {
612
632
 
613
633
  /**
614
634
  * --------------------------------------------------------------------------
615
- * CoreUI (v4.1.0): dom/data.js
635
+ * CoreUI (v4.1.1): dom/data.js
616
636
  * Licensed under MIT (https://coreui.io/license)
617
637
  *
618
638
  * This component is a modified version of the Bootstrap's dom/data.js
@@ -669,7 +689,7 @@ const Data = {
669
689
 
670
690
  /**
671
691
  * --------------------------------------------------------------------------
672
- * CoreUI (v4.1.0): alert.js
692
+ * CoreUI (v4.1.1): alert.js
673
693
  * Licensed under MIT (https://coreui.io/license)
674
694
  *
675
695
  * This component is a modified version of the Bootstrap's base-component.js
@@ -682,7 +702,7 @@ const Data = {
682
702
  * ------------------------------------------------------------------------
683
703
  */
684
704
 
685
- const VERSION = '4.1.0';
705
+ const VERSION = '4.1.1';
686
706
 
687
707
  class BaseComponent {
688
708
  constructor(element) {
@@ -764,7 +784,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
764
784
 
765
785
  /**
766
786
  * --------------------------------------------------------------------------
767
- * CoreUI (v4.1.0): alert.js
787
+ * CoreUI (v4.1.1): alert.js
768
788
  * Licensed under MIT (https://coreui.io/license)
769
789
  *
770
790
  * This component is a modified version of the Bootstrap's alert.js
@@ -782,7 +802,7 @@ const DATA_KEY$e = 'coreui.alert';
782
802
  const EVENT_KEY$e = `.${DATA_KEY$e}`;
783
803
  const EVENT_CLOSE = `close${EVENT_KEY$e}`;
784
804
  const EVENT_CLOSED = `closed${EVENT_KEY$e}`;
785
- const CLASS_NAME_FADE$6 = 'fade';
805
+ const CLASS_NAME_FADE$5 = 'fade';
786
806
  const CLASS_NAME_SHOW$a = 'show';
787
807
  /**
788
808
  * ------------------------------------------------------------------------
@@ -806,7 +826,7 @@ class Alert extends BaseComponent {
806
826
 
807
827
  this._element.classList.remove(CLASS_NAME_SHOW$a);
808
828
 
809
- const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$6);
829
+ const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
810
830
 
811
831
  this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
812
832
  } // Private
@@ -856,7 +876,7 @@ defineJQueryPlugin(Alert);
856
876
 
857
877
  /**
858
878
  * --------------------------------------------------------------------------
859
- * CoreUI (v4.1.0): alert.js
879
+ * CoreUI (v4.1.1): alert.js
860
880
  * Licensed under MIT (https://coreui.io/license)
861
881
  *
862
882
  * This component is a modified version of the Bootstrap's button.js
@@ -930,7 +950,7 @@ defineJQueryPlugin(Button);
930
950
 
931
951
  /**
932
952
  * --------------------------------------------------------------------------
933
- * CoreUI (v4.1.0): dom/manipulator.js
953
+ * CoreUI (v4.1.1): dom/manipulator.js
934
954
  * Licensed under MIT (https://coreui.io/license)
935
955
  *
936
956
  * This component is a modified version of the Bootstrap's dom/manipulator.js
@@ -1007,7 +1027,7 @@ const Manipulator = {
1007
1027
 
1008
1028
  /**
1009
1029
  * --------------------------------------------------------------------------
1010
- * CoreUI (v4.1.0): dom/selector-engine.js
1030
+ * CoreUI (v4.1.1): dom/selector-engine.js
1011
1031
  * Licensed under MIT (https://coreui.io/license)
1012
1032
  *
1013
1033
  * This component is a modified version of the Bootstrap's dom/selector-engine.js
@@ -1080,7 +1100,7 @@ const SelectorEngine = {
1080
1100
 
1081
1101
  /**
1082
1102
  * --------------------------------------------------------------------------
1083
- * CoreUI (v4.1.0): carousel.js
1103
+ * CoreUI (v4.1.1): carousel.js
1084
1104
  * Licensed under MIT (https://coreui.io/license)
1085
1105
  *
1086
1106
  * This component is a modified version of the Bootstrap's carousel.js
@@ -1408,7 +1428,7 @@ class Carousel extends BaseComponent {
1408
1428
  const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);
1409
1429
  activeIndicator.classList.remove(CLASS_NAME_ACTIVE$3);
1410
1430
  activeIndicator.removeAttribute('aria-current');
1411
- const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);
1431
+ const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement); // eslint-disable-next-line unicorn/no-for-loop
1412
1432
 
1413
1433
  for (let i = 0; i < indicators.length; i++) {
1414
1434
  if (Number.parseInt(indicators[i].getAttribute('data-coreui-slide-to'), 10) === this._getItemIndex(element)) {
@@ -1632,7 +1652,7 @@ defineJQueryPlugin(Carousel);
1632
1652
 
1633
1653
  /**
1634
1654
  * --------------------------------------------------------------------------
1635
- * CoreUI (v4.1.0): collapse.js
1655
+ * CoreUI (v4.1.1): collapse.js
1636
1656
  * Licensed under MIT (https://coreui.io/license)
1637
1657
  *
1638
1658
  * This component is a modified version of the Bootstrap's collapse.js
@@ -1954,7 +1974,7 @@ defineJQueryPlugin(Collapse);
1954
1974
 
1955
1975
  /**
1956
1976
  * --------------------------------------------------------------------------
1957
- * CoreUI (v4.1.0): dropdown.js
1977
+ * CoreUI (v4.1.1): dropdown.js
1958
1978
  * Licensed under MIT (https://coreui.io/license)
1959
1979
  *
1960
1980
  * This component is a modified version of the Bootstrap's dropdown.js
@@ -2544,7 +2564,7 @@ const DefaultType$9 = {
2544
2564
  clickCallback: '(function|null)'
2545
2565
  };
2546
2566
  const NAME$a = 'backdrop';
2547
- const CLASS_NAME_FADE$5 = 'fade';
2567
+ const CLASS_NAME_FADE$4 = 'fade';
2548
2568
  const CLASS_NAME_SHOW$7 = 'show';
2549
2569
  const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME$a}`;
2550
2570
 
@@ -2595,7 +2615,7 @@ class Backdrop {
2595
2615
  backdrop.className = this._config.className;
2596
2616
 
2597
2617
  if (this._config.isAnimated) {
2598
- backdrop.classList.add(CLASS_NAME_FADE$5);
2618
+ backdrop.classList.add(CLASS_NAME_FADE$4);
2599
2619
  }
2600
2620
 
2601
2621
  this._element = backdrop;
@@ -2750,7 +2770,7 @@ class FocusTrap {
2750
2770
 
2751
2771
  /**
2752
2772
  * --------------------------------------------------------------------------
2753
- * CoreUI (v4.1.0): modal.js
2773
+ * CoreUI (v4.1.1): modal.js
2754
2774
  * Licensed under MIT (https://coreui.io/license)
2755
2775
  *
2756
2776
  * This component is a modified version of the Bootstrap's modal.js
@@ -2790,7 +2810,7 @@ const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$8}`;
2790
2810
  const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$8}`;
2791
2811
  const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
2792
2812
  const CLASS_NAME_OPEN = 'modal-open';
2793
- const CLASS_NAME_FADE$4 = 'fade';
2813
+ const CLASS_NAME_FADE$3 = 'fade';
2794
2814
  const CLASS_NAME_SHOW$6 = 'show';
2795
2815
  const CLASS_NAME_STATIC = 'modal-static';
2796
2816
  const OPEN_SELECTOR$1 = '.modal.show';
@@ -3052,7 +3072,7 @@ class Modal extends BaseComponent {
3052
3072
  }
3053
3073
 
3054
3074
  _isAnimated() {
3055
- return this._element.classList.contains(CLASS_NAME_FADE$4);
3075
+ return this._element.classList.contains(CLASS_NAME_FADE$3);
3056
3076
  }
3057
3077
 
3058
3078
  _triggerBackdropTransition() {
@@ -3182,7 +3202,7 @@ defineJQueryPlugin(Modal);
3182
3202
 
3183
3203
  /**
3184
3204
  * --------------------------------------------------------------------------
3185
- * CoreUI (v4.1.0): navigation.js
3205
+ * CoreUI (v4.1.1): navigation.js
3186
3206
  * Licensed under MIT (https://coreui.io/license)
3187
3207
  * --------------------------------------------------------------------------
3188
3208
  */
@@ -3467,7 +3487,7 @@ defineJQueryPlugin(Navigation);
3467
3487
 
3468
3488
  /**
3469
3489
  * --------------------------------------------------------------------------
3470
- * CoreUI (v4.1.0): dropdown.js
3490
+ * CoreUI (v4.1.1): dropdown.js
3471
3491
  * Licensed under MIT (https://coreui.io/license)
3472
3492
  *
3473
3493
  * This component is a modified version of the Bootstrap's offcanvas.js
@@ -3726,7 +3746,7 @@ defineJQueryPlugin(Offcanvas);
3726
3746
 
3727
3747
  /**
3728
3748
  * --------------------------------------------------------------------------
3729
- * CoreUI (v4.1.0): alert.js
3749
+ * CoreUI (v4.1.1): alert.js
3730
3750
  * Licensed under MIT (https://coreui.io/license)
3731
3751
  *
3732
3752
  * This component is a modified version of the Bootstrap's util/sanitizer.js
@@ -3841,7 +3861,7 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
3841
3861
 
3842
3862
  /**
3843
3863
  * --------------------------------------------------------------------------
3844
- * CoreUI (v4.1.0): tooltip.js
3864
+ * CoreUI (v4.1.1): tooltip.js
3845
3865
  * Licensed under MIT (https://coreui.io/license)
3846
3866
  *
3847
3867
  * This component is a modified version of the Bootstrap's tooltip.js
@@ -3916,7 +3936,7 @@ const Event$2 = {
3916
3936
  MOUSEENTER: `mouseenter${EVENT_KEY$5}`,
3917
3937
  MOUSELEAVE: `mouseleave${EVENT_KEY$5}`
3918
3938
  };
3919
- const CLASS_NAME_FADE$3 = 'fade';
3939
+ const CLASS_NAME_FADE$2 = 'fade';
3920
3940
  const CLASS_NAME_MODAL = 'modal';
3921
3941
  const CLASS_NAME_SHOW$3 = 'show';
3922
3942
  const HOVER_STATE_SHOW = 'show';
@@ -4056,7 +4076,7 @@ class Tooltip extends BaseComponent {
4056
4076
  this._element.setAttribute('aria-describedby', tipId);
4057
4077
 
4058
4078
  if (this._config.animation) {
4059
- tip.classList.add(CLASS_NAME_FADE$3);
4079
+ tip.classList.add(CLASS_NAME_FADE$2);
4060
4080
  }
4061
4081
 
4062
4082
  const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
@@ -4109,7 +4129,7 @@ class Tooltip extends BaseComponent {
4109
4129
  }
4110
4130
  };
4111
4131
 
4112
- const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
4132
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
4113
4133
 
4114
4134
  this._queueCallback(complete, this.tip, isAnimated);
4115
4135
  }
@@ -4155,7 +4175,7 @@ class Tooltip extends BaseComponent {
4155
4175
  this._activeTrigger[TRIGGER_CLICK] = false;
4156
4176
  this._activeTrigger[TRIGGER_FOCUS] = false;
4157
4177
  this._activeTrigger[TRIGGER_HOVER] = false;
4158
- const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
4178
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
4159
4179
 
4160
4180
  this._queueCallback(complete, this.tip, isAnimated);
4161
4181
 
@@ -4182,7 +4202,7 @@ class Tooltip extends BaseComponent {
4182
4202
  element.innerHTML = this._config.template;
4183
4203
  const tip = element.children[0];
4184
4204
  this.setContent(tip);
4185
- tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
4205
+ tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$3);
4186
4206
  this.tip = tip;
4187
4207
  return this.tip;
4188
4208
  }
@@ -4554,7 +4574,7 @@ defineJQueryPlugin(Tooltip);
4554
4574
 
4555
4575
  /**
4556
4576
  * --------------------------------------------------------------------------
4557
- * CoreUI (v4.1.0): popover.js
4577
+ * CoreUI (v4.1.1): popover.js
4558
4578
  * Licensed under MIT (https://coreui.io/license)
4559
4579
  *
4560
4580
  * This component is a modified version of the Bootstrap's popover.js
@@ -4667,7 +4687,7 @@ defineJQueryPlugin(Popover);
4667
4687
 
4668
4688
  /**
4669
4689
  * --------------------------------------------------------------------------
4670
- * CoreUI (v4.1.0): scrollspy.js
4690
+ * CoreUI (v4.1.1): scrollspy.js
4671
4691
  * Licensed under MIT (https://coreui.io/license)
4672
4692
  *
4673
4693
  * This component is a modified version of the Bootstrap's scrollspy.js
@@ -4905,7 +4925,7 @@ defineJQueryPlugin(ScrollSpy);
4905
4925
 
4906
4926
  /**
4907
4927
  * --------------------------------------------------------------------------
4908
- * CoreUI (v4.1.0): sidebar.js
4928
+ * CoreUI (v4.1.1): sidebar.js
4909
4929
  * Licensed under MIT (https://coreui.io/license)
4910
4930
  * --------------------------------------------------------------------------
4911
4931
  */
@@ -4922,7 +4942,6 @@ const DATA_API_KEY$1 = '.data-api';
4922
4942
  const Default$1 = {};
4923
4943
  const DefaultType$1 = {};
4924
4944
  const CLASS_NAME_BACKDROP = 'sidebar-backdrop';
4925
- const CLASS_NAME_FADE$2 = 'fade';
4926
4945
  const CLASS_NAME_HIDE$1 = 'hide';
4927
4946
  const CLASS_NAME_SHOW$2 = 'show';
4928
4947
  const CLASS_NAME_SIDEBAR_NARROW = 'sidebar-narrow';
@@ -4953,7 +4972,7 @@ class Sidebar extends BaseComponent {
4953
4972
  this._overlaid = this._isOverlaid();
4954
4973
  this._narrow = this._isNarrow();
4955
4974
  this._unfoldable = this._isUnfoldable();
4956
- this._backdrop = null;
4975
+ this._backdrop = this._initializeBackDrop();
4957
4976
 
4958
4977
  this._addEventListeners();
4959
4978
  } // Getters
@@ -4982,7 +5001,9 @@ class Sidebar extends BaseComponent {
4982
5001
  if (this._isMobile()) {
4983
5002
  this._element.classList.add(CLASS_NAME_SHOW$2);
4984
5003
 
4985
- this._showBackdrop();
5004
+ this._backdrop.show();
5005
+
5006
+ new ScrollBarHelper().hide();
4986
5007
  }
4987
5008
 
4988
5009
  const complete = () => {
@@ -5008,7 +5029,9 @@ class Sidebar extends BaseComponent {
5008
5029
  }
5009
5030
 
5010
5031
  if (this._isMobile()) {
5011
- this._removeBackdrop();
5032
+ this._backdrop.hide();
5033
+
5034
+ new ScrollBarHelper().reset();
5012
5035
  } else {
5013
5036
  this._element.classList.add(CLASS_NAME_HIDE$1);
5014
5037
  }
@@ -5097,6 +5120,16 @@ class Sidebar extends BaseComponent {
5097
5120
  return config;
5098
5121
  }
5099
5122
 
5123
+ _initializeBackDrop() {
5124
+ return new Backdrop({
5125
+ className: CLASS_NAME_BACKDROP,
5126
+ isVisible: this._isMobile(),
5127
+ isAnimated: true,
5128
+ rootElement: this._element.parentNode,
5129
+ clickCallback: () => this.hide()
5130
+ });
5131
+ }
5132
+
5100
5133
  _isMobile() {
5101
5134
  return Boolean(window.getComputedStyle(this._element, null).getPropertyValue('--cui-is-mobile'));
5102
5135
  }
@@ -5116,35 +5149,13 @@ class Sidebar extends BaseComponent {
5116
5149
  _isVisible() {
5117
5150
  const rect = this._element.getBoundingClientRect();
5118
5151
 
5119
- return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
5152
+ return rect.top >= 0 && rect.left >= 0 && Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) && Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth);
5120
5153
  }
5121
5154
 
5122
5155
  _addClassName(className) {
5123
5156
  this._element.classList.add(className);
5124
5157
  }
5125
5158
 
5126
- _removeBackdrop() {
5127
- if (this._backdrop) {
5128
- this._backdrop.remove();
5129
-
5130
- this._backdrop = null;
5131
- }
5132
- }
5133
-
5134
- _showBackdrop() {
5135
- if (!this._backdrop) {
5136
- this._backdrop = document.createElement('div');
5137
- this._backdrop.className = CLASS_NAME_BACKDROP;
5138
-
5139
- this._backdrop.classList.add(CLASS_NAME_FADE$2);
5140
-
5141
- document.body.append(this._backdrop);
5142
- reflow(this._backdrop);
5143
-
5144
- this._backdrop.classList.add(CLASS_NAME_SHOW$2);
5145
- }
5146
- }
5147
-
5148
5159
  _clickOutListener(event, sidebar) {
5149
5160
  if (event.target.closest(SELECTOR_SIDEBAR) === null) {
5150
5161
  event.preventDefault();
@@ -5192,6 +5203,7 @@ class Sidebar extends BaseComponent {
5192
5203
  EventHandler.on(window, EVENT_RESIZE, () => {
5193
5204
  if (this._isMobile() && this._isVisible()) {
5194
5205
  this.hide();
5206
+ this._backdrop = this._initializeBackDrop();
5195
5207
  }
5196
5208
  });
5197
5209
  } // Static
@@ -5238,7 +5250,7 @@ defineJQueryPlugin(Sidebar);
5238
5250
 
5239
5251
  /**
5240
5252
  * --------------------------------------------------------------------------
5241
- * CoreUI (v4.1.0): tab.js
5253
+ * CoreUI (v4.1.1): tab.js
5242
5254
  * Licensed under MIT (https://coreui.io/license)
5243
5255
  *
5244
5256
  * This component is a modified version of the Bootstrap's tab.js
@@ -5439,7 +5451,7 @@ defineJQueryPlugin(Tab);
5439
5451
 
5440
5452
  /**
5441
5453
  * --------------------------------------------------------------------------
5442
- * CoreUI (v4.1.0): toast.js
5454
+ * CoreUI (v4.1.1): toast.js
5443
5455
  * Licensed under MIT (https://coreui.io/license)
5444
5456
  *
5445
5457
  * This component is a modified version of the Bootstrap's toast.js