bootstrap 5.1.0 → 5.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap/alert.js +4 -4
  4. data/assets/javascripts/bootstrap/base-component.js +4 -4
  5. data/assets/javascripts/bootstrap/button.js +3 -3
  6. data/assets/javascripts/bootstrap/carousel.js +9 -5
  7. data/assets/javascripts/bootstrap/collapse.js +4 -4
  8. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  9. data/assets/javascripts/bootstrap/dom/event-handler.js +3 -4
  10. data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
  11. data/assets/javascripts/bootstrap/dom/selector-engine.js +3 -3
  12. data/assets/javascripts/bootstrap/dropdown.js +3 -3
  13. data/assets/javascripts/bootstrap/modal.js +16 -8
  14. data/assets/javascripts/bootstrap/offcanvas.js +7 -7
  15. data/assets/javascripts/bootstrap/popover.js +3 -3
  16. data/assets/javascripts/bootstrap/scrollspy.js +3 -3
  17. data/assets/javascripts/bootstrap/tab.js +3 -3
  18. data/assets/javascripts/bootstrap/toast.js +4 -4
  19. data/assets/javascripts/bootstrap/tooltip.js +23 -12
  20. data/assets/javascripts/bootstrap-sprockets.js +6 -6
  21. data/assets/javascripts/bootstrap.js +61 -39
  22. data/assets/javascripts/bootstrap.min.js +2 -2
  23. data/assets/stylesheets/_bootstrap-grid.scss +3 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +2 -4
  25. data/assets/stylesheets/_bootstrap.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_functions.scss +8 -2
  27. data/assets/stylesheets/bootstrap/_reboot.scss +1 -1
  28. data/assets/stylesheets/bootstrap/_root.scss +2 -1
  29. data/assets/stylesheets/bootstrap/_variables.scss +19 -9
  30. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  31. data/lib/bootstrap/version.rb +2 -2
  32. metadata +2 -2
@@ -2,18 +2,18 @@
2
2
  //= require ./bootstrap/dom/data
3
3
  //= require ./bootstrap/dom/event-handler
4
4
  //= require ./bootstrap/base-component
5
- //= require ./bootstrap/alert
6
- //= require ./bootstrap/button
7
5
  //= require ./bootstrap/dom/manipulator
8
6
  //= require ./bootstrap/dom/selector-engine
7
+ //= require ./bootstrap/scrollspy
9
8
  //= require ./bootstrap/carousel
10
- //= require ./bootstrap/collapse
11
- //= require ./bootstrap/dropdown
9
+ //= require ./bootstrap/alert
12
10
  //= require ./bootstrap/modal
13
- //= require ./bootstrap/offcanvas
14
11
  //= require ./bootstrap/tooltip
15
12
  //= require ./bootstrap/popover
16
- //= require ./bootstrap/scrollspy
13
+ //= require ./bootstrap/button
14
+ //= require ./bootstrap/collapse
17
15
  //= require ./bootstrap/tab
16
+ //= require ./bootstrap/offcanvas
17
+ //= require ./bootstrap/dropdown
18
18
  //= require ./bootstrap/toast
19
19
  //= require ./bootstrap-global-this-undefine
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v5.1.0 (https://getbootstrap.com/)
2
+ * Bootstrap v5.1.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -33,7 +33,7 @@
33
33
 
34
34
  /**
35
35
  * --------------------------------------------------------------------------
36
- * Bootstrap (v5.1.0): util/index.js
36
+ * Bootstrap (v5.1.1): util/index.js
37
37
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
38
38
  * --------------------------------------------------------------------------
39
39
  */
@@ -344,7 +344,7 @@
344
344
 
345
345
  /**
346
346
  * --------------------------------------------------------------------------
347
- * Bootstrap (v5.1.0): dom/event-handler.js
347
+ * Bootstrap (v5.1.1): dom/event-handler.js
348
348
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
349
349
  * --------------------------------------------------------------------------
350
350
  */
@@ -407,7 +407,6 @@
407
407
  event.delegateTarget = target;
408
408
 
409
409
  if (handler.oneOff) {
410
- // eslint-disable-next-line unicorn/consistent-destructuring
411
410
  EventHandler.off(element, event.type, selector, fn);
412
411
  }
413
412
 
@@ -633,7 +632,7 @@
633
632
 
634
633
  /**
635
634
  * --------------------------------------------------------------------------
636
- * Bootstrap (v5.1.0): dom/data.js
635
+ * Bootstrap (v5.1.1): dom/data.js
637
636
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
638
637
  * --------------------------------------------------------------------------
639
638
  */
@@ -687,7 +686,7 @@
687
686
 
688
687
  /**
689
688
  * --------------------------------------------------------------------------
690
- * Bootstrap (v5.1.0): base-component.js
689
+ * Bootstrap (v5.1.1): base-component.js
691
690
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
692
691
  * --------------------------------------------------------------------------
693
692
  */
@@ -697,7 +696,7 @@
697
696
  * ------------------------------------------------------------------------
698
697
  */
699
698
 
700
- const VERSION = '5.1.0';
699
+ const VERSION = '5.1.1';
701
700
 
702
701
  class BaseComponent {
703
702
  constructor(element) {
@@ -753,7 +752,7 @@
753
752
 
754
753
  /**
755
754
  * --------------------------------------------------------------------------
756
- * Bootstrap (v5.1.0): util/component-functions.js
755
+ * Bootstrap (v5.1.1): util/component-functions.js
757
756
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
758
757
  * --------------------------------------------------------------------------
759
758
  */
@@ -779,7 +778,7 @@
779
778
 
780
779
  /**
781
780
  * --------------------------------------------------------------------------
782
- * Bootstrap (v5.1.0): alert.js
781
+ * Bootstrap (v5.1.1): alert.js
783
782
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
784
783
  * --------------------------------------------------------------------------
785
784
  */
@@ -868,7 +867,7 @@
868
867
 
869
868
  /**
870
869
  * --------------------------------------------------------------------------
871
- * Bootstrap (v5.1.0): button.js
870
+ * Bootstrap (v5.1.1): button.js
872
871
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
873
872
  * --------------------------------------------------------------------------
874
873
  */
@@ -939,7 +938,7 @@
939
938
 
940
939
  /**
941
940
  * --------------------------------------------------------------------------
942
- * Bootstrap (v5.1.0): dom/manipulator.js
941
+ * Bootstrap (v5.1.1): dom/manipulator.js
943
942
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
944
943
  * --------------------------------------------------------------------------
945
944
  */
@@ -1013,7 +1012,7 @@
1013
1012
 
1014
1013
  /**
1015
1014
  * --------------------------------------------------------------------------
1016
- * Bootstrap (v5.1.0): dom/selector-engine.js
1015
+ * Bootstrap (v5.1.1): dom/selector-engine.js
1017
1016
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1018
1017
  * --------------------------------------------------------------------------
1019
1018
  */
@@ -1083,7 +1082,7 @@
1083
1082
 
1084
1083
  /**
1085
1084
  * --------------------------------------------------------------------------
1086
- * Bootstrap (v5.1.0): carousel.js
1085
+ * Bootstrap (v5.1.1): carousel.js
1087
1086
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1088
1087
  * --------------------------------------------------------------------------
1089
1088
  */
@@ -1308,8 +1307,12 @@
1308
1307
  }
1309
1308
 
1310
1309
  _addTouchEventListeners() {
1310
+ const hasPointerPenTouch = event => {
1311
+ return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
1312
+ };
1313
+
1311
1314
  const start = event => {
1312
- if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
1315
+ if (hasPointerPenTouch(event)) {
1313
1316
  this.touchStartX = event.clientX;
1314
1317
  } else if (!this._pointerEvent) {
1315
1318
  this.touchStartX = event.touches[0].clientX;
@@ -1322,7 +1325,7 @@
1322
1325
  };
1323
1326
 
1324
1327
  const end = event => {
1325
- if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
1328
+ if (hasPointerPenTouch(event)) {
1326
1329
  this.touchDeltaX = event.clientX - this.touchStartX;
1327
1330
  }
1328
1331
 
@@ -1628,7 +1631,7 @@
1628
1631
 
1629
1632
  /**
1630
1633
  * --------------------------------------------------------------------------
1631
- * Bootstrap (v5.1.0): collapse.js
1634
+ * Bootstrap (v5.1.1): collapse.js
1632
1635
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1633
1636
  * --------------------------------------------------------------------------
1634
1637
  */
@@ -1662,7 +1665,7 @@
1662
1665
  const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
1663
1666
  const WIDTH = 'width';
1664
1667
  const HEIGHT = 'height';
1665
- const SELECTOR_ACTIVES = '.show, .collapsing';
1668
+ const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
1666
1669
  const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]';
1667
1670
  /**
1668
1671
  * ------------------------------------------------------------------------
@@ -1946,7 +1949,7 @@
1946
1949
 
1947
1950
  /**
1948
1951
  * --------------------------------------------------------------------------
1949
- * Bootstrap (v5.1.0): dropdown.js
1952
+ * Bootstrap (v5.1.1): dropdown.js
1950
1953
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1951
1954
  * --------------------------------------------------------------------------
1952
1955
  */
@@ -2408,7 +2411,7 @@
2408
2411
 
2409
2412
  /**
2410
2413
  * --------------------------------------------------------------------------
2411
- * Bootstrap (v5.1.0): util/scrollBar.js
2414
+ * Bootstrap (v5.1.1): util/scrollBar.js
2412
2415
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2413
2416
  * --------------------------------------------------------------------------
2414
2417
  */
@@ -2512,7 +2515,7 @@
2512
2515
 
2513
2516
  /**
2514
2517
  * --------------------------------------------------------------------------
2515
- * Bootstrap (v5.1.0): util/backdrop.js
2518
+ * Bootstrap (v5.1.1): util/backdrop.js
2516
2519
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2517
2520
  * --------------------------------------------------------------------------
2518
2521
  */
@@ -2636,7 +2639,7 @@
2636
2639
 
2637
2640
  /**
2638
2641
  * --------------------------------------------------------------------------
2639
- * Bootstrap (v5.1.0): util/focustrap.js
2642
+ * Bootstrap (v5.1.1): util/focustrap.js
2640
2643
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2641
2644
  * --------------------------------------------------------------------------
2642
2645
  */
@@ -2739,7 +2742,7 @@
2739
2742
 
2740
2743
  /**
2741
2744
  * --------------------------------------------------------------------------
2742
- * Bootstrap (v5.1.0): modal.js
2745
+ * Bootstrap (v5.1.1): modal.js
2743
2746
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2744
2747
  * --------------------------------------------------------------------------
2745
2748
  */
@@ -2779,6 +2782,7 @@
2779
2782
  const CLASS_NAME_FADE$3 = 'fade';
2780
2783
  const CLASS_NAME_SHOW$4 = 'show';
2781
2784
  const CLASS_NAME_STATIC = 'modal-static';
2785
+ const OPEN_SELECTOR$1 = '.modal.show';
2782
2786
  const SELECTOR_DIALOG = '.modal-dialog';
2783
2787
  const SELECTOR_MODAL_BODY = '.modal-body';
2784
2788
  const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
@@ -3144,7 +3148,14 @@
3144
3148
  this.focus();
3145
3149
  }
3146
3150
  });
3147
- });
3151
+ }); // avoid conflict when clicking moddal toggler while another one is open
3152
+
3153
+ const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
3154
+
3155
+ if (allReadyOpen) {
3156
+ Modal.getInstance(allReadyOpen).hide();
3157
+ }
3158
+
3148
3159
  const data = Modal.getOrCreateInstance(target);
3149
3160
  data.toggle(this);
3150
3161
  });
@@ -3160,7 +3171,7 @@
3160
3171
 
3161
3172
  /**
3162
3173
  * --------------------------------------------------------------------------
3163
- * Bootstrap (v5.1.0): offcanvas.js
3174
+ * Bootstrap (v5.1.1): offcanvas.js
3164
3175
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3165
3176
  * --------------------------------------------------------------------------
3166
3177
  */
@@ -3416,7 +3427,7 @@
3416
3427
 
3417
3428
  /**
3418
3429
  * --------------------------------------------------------------------------
3419
- * Bootstrap (v5.1.0): util/sanitizer.js
3430
+ * Bootstrap (v5.1.1): util/sanitizer.js
3420
3431
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3421
3432
  * --------------------------------------------------------------------------
3422
3433
  */
@@ -3529,7 +3540,7 @@
3529
3540
 
3530
3541
  /**
3531
3542
  * --------------------------------------------------------------------------
3532
- * Bootstrap (v5.1.0): tooltip.js
3543
+ * Bootstrap (v5.1.1): tooltip.js
3533
3544
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3534
3545
  * --------------------------------------------------------------------------
3535
3546
  */
@@ -3703,9 +3714,7 @@
3703
3714
  this.tip.remove();
3704
3715
  }
3705
3716
 
3706
- if (this._popper) {
3707
- this._popper.destroy();
3708
- }
3717
+ this._disposePopper();
3709
3718
 
3710
3719
  super.dispose();
3711
3720
  }
@@ -3725,6 +3734,15 @@
3725
3734
 
3726
3735
  if (showEvent.defaultPrevented || !isInTheDom) {
3727
3736
  return;
3737
+ } // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`
3738
+ // This will be removed later in favor of a `setContent` method
3739
+
3740
+
3741
+ if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
3742
+ this._disposePopper();
3743
+
3744
+ this.tip.remove();
3745
+ this.tip = null;
3728
3746
  }
3729
3747
 
3730
3748
  const tip = this.getTipElement();
@@ -3814,11 +3832,7 @@
3814
3832
 
3815
3833
  EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
3816
3834
 
3817
- if (this._popper) {
3818
- this._popper.destroy();
3819
-
3820
- this._popper = null;
3821
- }
3835
+ this._disposePopper();
3822
3836
  };
3823
3837
 
3824
3838
  const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
@@ -4198,6 +4212,14 @@
4198
4212
  this._cleanTipClass();
4199
4213
 
4200
4214
  this._addAttachmentClass(this._getAttachment(state.placement));
4215
+ }
4216
+
4217
+ _disposePopper() {
4218
+ if (this._popper) {
4219
+ this._popper.destroy();
4220
+
4221
+ this._popper = null;
4222
+ }
4201
4223
  } // Static
4202
4224
 
4203
4225
 
@@ -4228,7 +4250,7 @@
4228
4250
 
4229
4251
  /**
4230
4252
  * --------------------------------------------------------------------------
4231
- * Bootstrap (v5.1.0): popover.js
4253
+ * Bootstrap (v5.1.1): popover.js
4232
4254
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4233
4255
  * --------------------------------------------------------------------------
4234
4256
  */
@@ -4338,7 +4360,7 @@
4338
4360
 
4339
4361
  /**
4340
4362
  * --------------------------------------------------------------------------
4341
- * Bootstrap (v5.1.0): scrollspy.js
4363
+ * Bootstrap (v5.1.1): scrollspy.js
4342
4364
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4343
4365
  * --------------------------------------------------------------------------
4344
4366
  */
@@ -4573,7 +4595,7 @@
4573
4595
 
4574
4596
  /**
4575
4597
  * --------------------------------------------------------------------------
4576
- * Bootstrap (v5.1.0): tab.js
4598
+ * Bootstrap (v5.1.1): tab.js
4577
4599
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4578
4600
  * --------------------------------------------------------------------------
4579
4601
  */
@@ -4771,7 +4793,7 @@
4771
4793
 
4772
4794
  /**
4773
4795
  * --------------------------------------------------------------------------
4774
- * Bootstrap (v5.1.0): toast.js
4796
+ * Bootstrap (v5.1.1): toast.js
4775
4797
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4776
4798
  * --------------------------------------------------------------------------
4777
4799
  */
@@ -5001,7 +5023,7 @@
5001
5023
 
5002
5024
  /**
5003
5025
  * --------------------------------------------------------------------------
5004
- * Bootstrap (v5.1.0): index.umd.js
5026
+ * Bootstrap (v5.1.1): index.umd.js
5005
5027
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5006
5028
  * --------------------------------------------------------------------------
5007
5029
  */