bootstrap 5.2.0 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -4
  3. data/assets/javascripts/bootstrap/alert.js +2 -2
  4. data/assets/javascripts/bootstrap/base-component.js +3 -3
  5. data/assets/javascripts/bootstrap/button.js +2 -2
  6. data/assets/javascripts/bootstrap/carousel.js +2 -2
  7. data/assets/javascripts/bootstrap/collapse.js +2 -2
  8. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  9. data/assets/javascripts/bootstrap/dom/event-handler.js +2 -2
  10. data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
  11. data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
  12. data/assets/javascripts/bootstrap/dropdown.js +7 -5
  13. data/assets/javascripts/bootstrap/modal.js +16 -13
  14. data/assets/javascripts/bootstrap/offcanvas.js +2 -2
  15. data/assets/javascripts/bootstrap/popover.js +2 -2
  16. data/assets/javascripts/bootstrap/scrollspy.js +16 -12
  17. data/assets/javascripts/bootstrap/tab.js +2 -2
  18. data/assets/javascripts/bootstrap/toast.js +2 -2
  19. data/assets/javascripts/bootstrap/tooltip.js +11 -7
  20. data/assets/javascripts/bootstrap/util/backdrop.js +2 -2
  21. data/assets/javascripts/bootstrap/util/component-functions.js +2 -2
  22. data/assets/javascripts/bootstrap/util/config.js +2 -2
  23. data/assets/javascripts/bootstrap/util/focustrap.js +2 -2
  24. data/assets/javascripts/bootstrap/util/index.js +2 -2
  25. data/assets/javascripts/bootstrap/util/sanitizer.js +2 -2
  26. data/assets/javascripts/bootstrap/util/scrollbar.js +2 -2
  27. data/assets/javascripts/bootstrap/util/swipe.js +2 -2
  28. data/assets/javascripts/bootstrap/util/template-factory.js +2 -2
  29. data/assets/javascripts/bootstrap.js +71 -58
  30. data/assets/javascripts/bootstrap.min.js +2 -2
  31. data/assets/stylesheets/bootstrap/_accordion.scss +7 -4
  32. data/assets/stylesheets/bootstrap/_button-group.scss +1 -1
  33. data/assets/stylesheets/bootstrap/_buttons.scss +23 -8
  34. data/assets/stylesheets/bootstrap/_dropdown.scss +2 -1
  35. data/assets/stylesheets/bootstrap/_functions.scss +1 -1
  36. data/assets/stylesheets/bootstrap/_list-group.scss +6 -5
  37. data/assets/stylesheets/bootstrap/_modal.scss +1 -1
  38. data/assets/stylesheets/bootstrap/_nav.scss +2 -2
  39. data/assets/stylesheets/bootstrap/_navbar.scss +2 -0
  40. data/assets/stylesheets/bootstrap/_offcanvas.scss +5 -4
  41. data/assets/stylesheets/bootstrap/_pagination.scss +1 -1
  42. data/assets/stylesheets/bootstrap/_popover.scss +5 -5
  43. data/assets/stylesheets/bootstrap/_toasts.scss +3 -2
  44. data/assets/stylesheets/bootstrap/_variables.scss +17 -16
  45. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +1 -0
  46. data/assets/stylesheets/bootstrap/forms/_input-group.scss +7 -4
  47. data/assets/stylesheets/bootstrap/mixins/_banner.scss +2 -2
  48. data/assets/stylesheets/bootstrap/mixins/_forms.scss +10 -10
  49. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +1 -1
  50. data/bootstrap.gemspec +1 -1
  51. data/lib/bootstrap/version.rb +2 -2
  52. data/tasks/updater/js.rb +1 -1
  53. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49075220be31b7b440684f6a22eb7ea6fcbff5860c940589c46aecbc2d20f6c1
4
- data.tar.gz: 93841930e2afddf90c28b58a4273ea89aafd543fad464d329e7fcc255cecf479
3
+ metadata.gz: 35584b903c24d5444ccbcc115e69da218717c9ba4203ddcb127a035e9eefe6b3
4
+ data.tar.gz: fa22a6ec7eb6d3d3f96cffb07665efcdf33073e4c7bc7e1ea66ca285a5f228a4
5
5
  SHA512:
6
- metadata.gz: a9b0c4f2b4b41fd480484a246866b26762e9f5850b63b1c60eb12b1e7c180f70703254bf07aae93390a4b38a63db25f670fbf46eca0fec2f731a829825340459
7
- data.tar.gz: 6737dd3980d44c004a05f1910aeec8f7b8e068235db3e2371622744e9e8d1a617e8c1a91d138ee86225cc521102d49c2d6cf28d02bf366c11d3a0e3f6c56ccfd
6
+ metadata.gz: 89f3ba0eae753449d28a1df745dd115a74f1be60369569810a51534ed7febf8ca606d2397904cd17d01010572670fc198417b9e3038e03363ec852b51bffb9ad
7
+ data.tar.gz: 8b181219cb0f2758ad9e98bf5aa5980a41f215ec711d7f987416bd3dd035f3bc2ed7659016dab35a4099b5eef2bb744893723b4103320e9f730c1f748c6811ee
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Bootstrap Ruby Gem [![Build Status](https://travis-ci.org/twbs/bootstrap-rubygem.svg?branch=master)](https://travis-ci.org/twbs/bootstrap-rubygem) [![Gem](https://img.shields.io/gem/v/bootstrap.svg)](https://rubygems.org/gems/bootstrap)
2
2
 
3
- [Bootstrap 5][bootstrap-home] ruby gem for Ruby on Rails (*Sprockets*) and Hanami (formerly Lotus).
3
+ [Bootstrap 5][bootstrap-home] ruby gem for Ruby on Rails (*Sprockets*/*Importmaps*) and Hanami (formerly Lotus).
4
4
 
5
5
  For Sass versions of Bootstrap 3 and 2 see [bootstrap-sass](https://github.com/twbs/bootstrap-sass) instead.
6
6
 
7
- **Ruby on Rails 6 Note:**:
8
- With the release of Rails 6 there have been some minor changes made to the default configuration for The Asset Pipeline. In specific, by default _Sprockets no longer processes JavaScript_ and instead Webpack is set as the default. The `twbs/bootstrap-rubygem` is for use with Sprockets not Webpack.
7
+ **Ruby on Rails Note**: Newer releases of Rails have added additional ways for
8
+ assets to be processed. The `twbs/bootstrap-rubygem` is for use with Importmaps
9
+ or Sprockets, but not Webpack.
9
10
 
10
11
  ## Installation
11
12
 
@@ -20,7 +21,7 @@ Please see the appropriate guide for your environment of choice:
20
21
  Add `bootstrap` to your Gemfile:
21
22
 
22
23
  ```ruby
23
- gem 'bootstrap', '~> 5.2.0'
24
+ gem 'bootstrap', '~> 5.2.1'
24
25
  ```
25
26
 
26
27
  Ensure that `sprockets-rails` is at least v2.3.2.
@@ -58,6 +59,25 @@ Bootstrap tooltips and popovers depend on [popper.js] for positioning.
58
59
  The `bootstrap` gem already depends on the
59
60
  [popper_js](https://github.com/glebm/popper_js-rubygem) gem.
60
61
 
62
+ #### Importmaps
63
+
64
+ You can pin either `bootstrap.js` or `bootstrap.min.js` in `config/importmap.rb`
65
+ as well as `popper.js`:
66
+
67
+ ```ruby
68
+ pin "bootstrap", to: "bootstrap.min.js", preload: true
69
+ pin "@popperjs/core", to: "popper.js", preload: true
70
+ ```
71
+
72
+ Whichever files you pin will need to be added to `config.assets.precompile`:
73
+
74
+ ```ruby
75
+ # config/initializers/assets.rb
76
+ Rails.application.config.assets.precompile += %w(bootstrap.min.js popper.js)
77
+ ```
78
+
79
+ #### Sprockets
80
+
61
81
  Add Bootstrap dependencies and Bootstrap to your `application.js`:
62
82
 
63
83
  ```js
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap alert.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap alert.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -16,7 +16,7 @@
16
16
 
17
17
  /**
18
18
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.0): alert.js
19
+ * Bootstrap (v5.2.1): alert.js
20
20
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
21
  * --------------------------------------------------------------------------
22
22
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap base-component.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap base-component.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.2.0): base-component.js
20
+ * Bootstrap (v5.2.1): base-component.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -25,7 +25,7 @@
25
25
  * Constants
26
26
  */
27
27
 
28
- const VERSION = '5.2.0';
28
+ const VERSION = '5.2.1';
29
29
  /**
30
30
  * Class definition
31
31
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap button.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap button.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -16,7 +16,7 @@
16
16
 
17
17
  /**
18
18
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.0): button.js
19
+ * Bootstrap (v5.2.1): button.js
20
20
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
21
  * --------------------------------------------------------------------------
22
22
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap carousel.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap carousel.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -19,7 +19,7 @@
19
19
 
20
20
  /**
21
21
  * --------------------------------------------------------------------------
22
- * Bootstrap (v5.2.0): carousel.js
22
+ * Bootstrap (v5.2.1): carousel.js
23
23
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
24
  * --------------------------------------------------------------------------
25
25
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap collapse.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap collapse.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.2.0): collapse.js
20
+ * Bootstrap (v5.2.1): collapse.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap data.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap data.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.2.0): dom/data.js
14
+ * Bootstrap (v5.2.1): dom/data.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap event-handler.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap event-handler.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.2.0): dom/event-handler.js
14
+ * Bootstrap (v5.2.1): dom/event-handler.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap manipulator.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap manipulator.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.2.0): dom/manipulator.js
14
+ * Bootstrap (v5.2.1): dom/manipulator.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap selector-engine.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap selector-engine.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.2.0): dom/selector-engine.js
14
+ * Bootstrap (v5.2.1): dom/selector-engine.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap dropdown.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap dropdown.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -37,7 +37,7 @@
37
37
 
38
38
  /**
39
39
  * --------------------------------------------------------------------------
40
- * Bootstrap (v5.2.0): dropdown.js
40
+ * Bootstrap (v5.2.1): dropdown.js
41
41
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
42
42
  * --------------------------------------------------------------------------
43
43
  */
@@ -107,8 +107,9 @@
107
107
  super(element, config);
108
108
  this._popper = null;
109
109
  this._parent = this._element.parentNode; // dropdown wrapper
110
+ // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.2/forms/input-group/
110
111
 
111
- this._menu = SelectorEngine__default.default.findOne(SELECTOR_MENU, this._parent);
112
+ this._menu = SelectorEngine__default.default.next(this._element, SELECTOR_MENU)[0] || SelectorEngine__default.default.prev(this._element, SELECTOR_MENU)[0];
112
113
  this._inNavbar = this._detectNavbar();
113
114
  } // Getters
114
115
 
@@ -424,8 +425,9 @@
424
425
  return;
425
426
  }
426
427
 
427
- event.preventDefault();
428
- const getToggleButton = SelectorEngine__default.default.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode);
428
+ event.preventDefault(); // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.2/forms/input-group/
429
+
430
+ const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine__default.default.prev(this, SELECTOR_DATA_TOGGLE)[0] || SelectorEngine__default.default.next(this, SELECTOR_DATA_TOGGLE)[0];
429
431
  const instance = Dropdown.getOrCreateInstance(getToggleButton);
430
432
 
431
433
  if (isUpOrDownEvent) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap modal.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap modal.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -20,7 +20,7 @@
20
20
 
21
21
  /**
22
22
  * --------------------------------------------------------------------------
23
- * Bootstrap (v5.2.0): modal.js
23
+ * Bootstrap (v5.2.1): modal.js
24
24
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
25
25
  * --------------------------------------------------------------------------
26
26
  */
@@ -39,6 +39,7 @@
39
39
  const EVENT_SHOW = `show${EVENT_KEY}`;
40
40
  const EVENT_SHOWN = `shown${EVENT_KEY}`;
41
41
  const EVENT_RESIZE = `resize${EVENT_KEY}`;
42
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
42
43
  const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`;
43
44
  const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`;
44
45
  const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
@@ -231,20 +232,22 @@
231
232
  }
232
233
  });
233
234
  EventHandler__default.default.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {
234
- if (event.target !== event.currentTarget) {
235
- // click is inside modal-dialog
236
- return;
237
- }
235
+ EventHandler__default.default.one(this._element, EVENT_CLICK_DISMISS, event2 => {
236
+ // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks
237
+ if (this._dialog.contains(event.target) || this._dialog.contains(event2.target)) {
238
+ return;
239
+ }
238
240
 
239
- if (this._config.backdrop === 'static') {
240
- this._triggerBackdropTransition();
241
+ if (this._config.backdrop === 'static') {
242
+ this._triggerBackdropTransition();
241
243
 
242
- return;
243
- }
244
+ return;
245
+ }
244
246
 
245
- if (this._config.backdrop) {
246
- this.hide();
247
- }
247
+ if (this._config.backdrop) {
248
+ this.hide();
249
+ }
250
+ });
248
251
  });
249
252
  }
250
253
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap offcanvas.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap offcanvas.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -20,7 +20,7 @@
20
20
 
21
21
  /**
22
22
  * --------------------------------------------------------------------------
23
- * Bootstrap (v5.2.0): offcanvas.js
23
+ * Bootstrap (v5.2.1): offcanvas.js
24
24
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
25
25
  * --------------------------------------------------------------------------
26
26
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap popover.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap popover.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -15,7 +15,7 @@
15
15
 
16
16
  /**
17
17
  * --------------------------------------------------------------------------
18
- * Bootstrap (v5.2.0): popover.js
18
+ * Bootstrap (v5.2.1): popover.js
19
19
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
20
20
  * --------------------------------------------------------------------------
21
21
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap scrollspy.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap scrollspy.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.2.0): scrollspy.js
20
+ * Bootstrap (v5.2.1): scrollspy.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -48,14 +48,16 @@
48
48
  // TODO: v6 @deprecated, keep it for backwards compatibility reasons
49
49
  rootMargin: '0px 0px -25%',
50
50
  smoothScroll: false,
51
- target: null
51
+ target: null,
52
+ threshold: [0.1, 0.5, 1]
52
53
  };
53
54
  const DefaultType = {
54
55
  offset: '(number|null)',
55
56
  // TODO v6 @deprecated, keep it for backwards compatibility reasons
56
57
  rootMargin: 'string',
57
58
  smoothScroll: 'boolean',
58
- target: 'element'
59
+ target: 'element',
60
+ threshold: 'array'
59
61
  };
60
62
  /**
61
63
  * Class definition
@@ -116,7 +118,14 @@
116
118
 
117
119
  _configAfterMerge(config) {
118
120
  // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case
119
- config.target = index.getElement(config.target) || document.body;
121
+ config.target = index.getElement(config.target) || document.body; // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
122
+
123
+ config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;
124
+
125
+ if (typeof config.threshold === 'string') {
126
+ config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));
127
+ }
128
+
120
129
  return config;
121
130
  }
122
131
 
@@ -152,8 +161,8 @@
152
161
  _getNewObserver() {
153
162
  const options = {
154
163
  root: this._rootElement,
155
- threshold: [0.1, 0.5, 1],
156
- rootMargin: this._getRootMargin()
164
+ threshold: this._config.threshold,
165
+ rootMargin: this._config.rootMargin
157
166
  };
158
167
  return new IntersectionObserver(entries => this._observerCallback(entries), options);
159
168
  } // The logic of selection
@@ -198,11 +207,6 @@
198
207
  activate(entry);
199
208
  }
200
209
  }
201
- } // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
202
-
203
-
204
- _getRootMargin() {
205
- return this._config.offset ? `${this._config.offset}px 0px -30%` : this._config.rootMargin;
206
210
  }
207
211
 
208
212
  _initializeTargetsAndObservables() {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap tab.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap tab.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.2.0): tab.js
20
+ * Bootstrap (v5.2.1): tab.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap toast.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap toast.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -16,7 +16,7 @@
16
16
 
17
17
  /**
18
18
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.0): toast.js
19
+ * Bootstrap (v5.2.1): toast.js
20
20
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
21
  * --------------------------------------------------------------------------
22
22
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -37,7 +37,7 @@
37
37
 
38
38
  /**
39
39
  * --------------------------------------------------------------------------
40
- * Bootstrap (v5.2.0): tooltip.js
40
+ * Bootstrap (v5.2.1): tooltip.js
41
41
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
42
42
  * --------------------------------------------------------------------------
43
43
  */
@@ -126,7 +126,7 @@
126
126
 
127
127
  this._isEnabled = true;
128
128
  this._timeout = 0;
129
- this._isHovered = false;
129
+ this._isHovered = null;
130
130
  this._activeTrigger = {};
131
131
  this._popper = null;
132
132
  this._templateFactory = null;
@@ -199,6 +199,10 @@
199
199
  this.tip.remove();
200
200
  }
201
201
 
202
+ if (this._config.originalTitle) {
203
+ this._element.setAttribute('title', this._config.originalTitle);
204
+ }
205
+
202
206
  this._disposePopper();
203
207
 
204
208
  super.dispose();
@@ -259,13 +263,13 @@
259
263
  }
260
264
 
261
265
  const complete = () => {
262
- const previousHoverState = this._isHovered;
263
- this._isHovered = false;
264
266
  EventHandler__default.default.trigger(this._element, this.constructor.eventName(EVENT_SHOWN));
265
267
 
266
- if (previousHoverState) {
268
+ if (this._isHovered === false) {
267
269
  this._leave();
268
270
  }
271
+
272
+ this._isHovered = false;
269
273
  };
270
274
 
271
275
  this._queueCallback(complete, this.tip, this._isAnimated());
@@ -296,7 +300,7 @@
296
300
  this._activeTrigger[TRIGGER_CLICK] = false;
297
301
  this._activeTrigger[TRIGGER_FOCUS] = false;
298
302
  this._activeTrigger[TRIGGER_HOVER] = false;
299
- this._isHovered = false;
303
+ this._isHovered = null; // it is a trick to support manual triggering
300
304
 
301
305
  const complete = () => {
302
306
  if (this._isWithActiveTrigger()) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap backdrop.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap backdrop.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -16,7 +16,7 @@
16
16
 
17
17
  /**
18
18
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.0): util/backdrop.js
19
+ * Bootstrap (v5.2.1): util/backdrop.js
20
20
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
21
  * --------------------------------------------------------------------------
22
22
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap component-functions.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap component-functions.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -15,7 +15,7 @@
15
15
 
16
16
  /**
17
17
  * --------------------------------------------------------------------------
18
- * Bootstrap (v5.2.0): util/component-functions.js
18
+ * Bootstrap (v5.2.1): util/component-functions.js
19
19
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
20
20
  * --------------------------------------------------------------------------
21
21
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap config.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap config.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -15,7 +15,7 @@
15
15
 
16
16
  /**
17
17
  * --------------------------------------------------------------------------
18
- * Bootstrap (v5.2.0): util/config.js
18
+ * Bootstrap (v5.2.1): util/config.js
19
19
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
20
20
  * --------------------------------------------------------------------------
21
21
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap focustrap.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap focustrap.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.2.0): util/focustrap.js
20
+ * Bootstrap (v5.2.1): util/focustrap.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap index.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap index.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.2.0): util/index.js
14
+ * Bootstrap (v5.2.1): util/index.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap sanitizer.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap sanitizer.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.2.0): util/sanitizer.js
14
+ * Bootstrap (v5.2.1): util/sanitizer.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap scrollbar.js v5.2.0 (https://getbootstrap.com/)
2
+ * Bootstrap scrollbar.js v5.2.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2022 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
  */
@@ -16,7 +16,7 @@
16
16
 
17
17
  /**
18
18
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.0): util/scrollBar.js
19
+ * Bootstrap (v5.2.1): util/scrollBar.js
20
20
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
21
  * --------------------------------------------------------------------------
22
22
  */