bootstrap 5.0.0.alpha3 → 5.0.0.beta1

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 +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +8 -8
  4. data/assets/javascripts/bootstrap.js +597 -595
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +67 -31
  7. data/assets/javascripts/bootstrap/button.js +63 -24
  8. data/assets/javascripts/bootstrap/carousel.js +121 -74
  9. data/assets/javascripts/bootstrap/collapse.js +101 -54
  10. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +12 -10
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +12 -11
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
  14. data/assets/javascripts/bootstrap/dropdown.js +142 -99
  15. data/assets/javascripts/bootstrap/modal.js +153 -109
  16. data/assets/javascripts/bootstrap/popover.js +11 -19
  17. data/assets/javascripts/bootstrap/scrollspy.js +82 -36
  18. data/assets/javascripts/bootstrap/tab.js +67 -28
  19. data/assets/javascripts/bootstrap/toast.js +90 -42
  20. data/assets/javascripts/bootstrap/tooltip.js +227 -148
  21. data/assets/stylesheets/_bootstrap-grid.scss +7 -7
  22. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  23. data/assets/stylesheets/_bootstrap.scss +1 -1
  24. data/assets/stylesheets/bootstrap/_alert.scss +3 -3
  25. data/assets/stylesheets/bootstrap/_breadcrumb.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_button-group.scss +5 -5
  27. data/assets/stylesheets/bootstrap/_card.scss +3 -3
  28. data/assets/stylesheets/bootstrap/_carousel.scss +23 -12
  29. data/assets/stylesheets/bootstrap/_dropdown.scss +22 -23
  30. data/assets/stylesheets/bootstrap/_functions.scss +1 -2
  31. data/assets/stylesheets/bootstrap/_list-group.scss +6 -6
  32. data/assets/stylesheets/bootstrap/_navbar.scss +1 -1
  33. data/assets/stylesheets/bootstrap/_pagination.scss +1 -1
  34. data/assets/stylesheets/bootstrap/_popover.scss +17 -14
  35. data/assets/stylesheets/bootstrap/_reboot.scss +19 -3
  36. data/assets/stylesheets/bootstrap/_spinners.scss +1 -1
  37. data/assets/stylesheets/bootstrap/_tables.scss +0 -1
  38. data/assets/stylesheets/bootstrap/_toasts.scss +14 -12
  39. data/assets/stylesheets/bootstrap/_tooltip.scss +12 -12
  40. data/assets/stylesheets/bootstrap/_utilities.scss +39 -24
  41. data/assets/stylesheets/bootstrap/_variables.scss +22 -20
  42. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  43. data/assets/stylesheets/bootstrap/forms/_form-check.scss +5 -5
  44. data/assets/stylesheets/bootstrap/forms/_input-group.scss +3 -3
  45. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +6 -6
  46. data/assets/stylesheets/bootstrap/mixins/_caret.scss +6 -6
  47. data/assets/stylesheets/bootstrap/mixins/_container.scss +2 -4
  48. data/assets/stylesheets/bootstrap/mixins/_forms.scss +1 -1
  49. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +3 -3
  50. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +19 -0
  51. data/lib/bootstrap/version.rb +2 -2
  52. data/tasks/updater/js.rb +6 -4
  53. metadata +2 -2
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Bootstrap toast.js v5.0.0-alpha3 (https://getbootstrap.com/)
2
+ * Bootstrap toast.js v5.0.0-beta1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 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
  */
6
6
  (function (global, factory) {
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js')) :
8
- typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js'], factory) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator'], factory) :
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.Data, global.EventHandler, global.Manipulator));
10
10
  }(this, (function (Data, EventHandler, Manipulator) { 'use strict';
11
11
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.0.0-alpha3): util/index.js
20
+ * Bootstrap (v5.0.0-beta1): util/index.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -42,8 +42,8 @@
42
42
  transitionDuration = _window$getComputedSt.transitionDuration,
43
43
  transitionDelay = _window$getComputedSt.transitionDelay;
44
44
 
45
- var floatTransitionDuration = parseFloat(transitionDuration);
46
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
45
+ var floatTransitionDuration = Number.parseFloat(transitionDuration);
46
+ var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
47
47
 
48
48
  if (!floatTransitionDuration && !floatTransitionDelay) {
49
49
  return 0;
@@ -52,7 +52,7 @@
52
52
 
53
53
  transitionDuration = transitionDuration.split(',')[0];
54
54
  transitionDelay = transitionDelay.split(',')[0];
55
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
55
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
56
56
  };
57
57
 
58
58
  var triggerTransitionEnd = function triggerTransitionEnd(element) {
@@ -101,7 +101,7 @@
101
101
  var _window = window,
102
102
  jQuery = _window.jQuery;
103
103
 
104
- if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
104
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
105
105
  return jQuery;
106
106
  }
107
107
 
@@ -116,7 +116,7 @@
116
116
  }
117
117
  };
118
118
 
119
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
119
+ var isRTL = document.documentElement.dir === 'rtl';
120
120
 
121
121
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
122
122
 
@@ -127,8 +127,55 @@
127
127
  * ------------------------------------------------------------------------
128
128
  */
129
129
 
130
+ var VERSION = '5.0.0-beta1';
131
+
132
+ var BaseComponent = /*#__PURE__*/function () {
133
+ function BaseComponent(element) {
134
+ if (!element) {
135
+ return;
136
+ }
137
+
138
+ this._element = element;
139
+ Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
140
+ }
141
+
142
+ var _proto = BaseComponent.prototype;
143
+
144
+ _proto.dispose = function dispose() {
145
+ Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
146
+ this._element = null;
147
+ }
148
+ /** Static */
149
+ ;
150
+
151
+ BaseComponent.getInstance = function getInstance(element) {
152
+ return Data__default['default'].getData(element, this.DATA_KEY);
153
+ };
154
+
155
+ _createClass(BaseComponent, null, [{
156
+ key: "VERSION",
157
+ get: function get() {
158
+ return VERSION;
159
+ }
160
+ }]);
161
+
162
+ return BaseComponent;
163
+ }();
164
+
165
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
166
+
167
+ function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
168
+
169
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
170
+
171
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
172
+ /**
173
+ * ------------------------------------------------------------------------
174
+ * Constants
175
+ * ------------------------------------------------------------------------
176
+ */
177
+
130
178
  var NAME = 'toast';
131
- var VERSION = '5.0.0-alpha3';
132
179
  var DATA_KEY = 'bs.toast';
133
180
  var EVENT_KEY = "." + DATA_KEY;
134
181
  var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
@@ -150,22 +197,26 @@
150
197
  autohide: true,
151
198
  delay: 5000
152
199
  };
153
- var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
200
+ var SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
154
201
  /**
155
202
  * ------------------------------------------------------------------------
156
203
  * Class Definition
157
204
  * ------------------------------------------------------------------------
158
205
  */
159
206
 
160
- var Toast = /*#__PURE__*/function () {
207
+ var Toast = /*#__PURE__*/function (_BaseComponent) {
208
+ _inheritsLoose(Toast, _BaseComponent);
209
+
161
210
  function Toast(element, config) {
162
- this._element = element;
163
- this._config = this._getConfig(config);
164
- this._timeout = null;
211
+ var _this;
165
212
 
166
- this._setListeners();
213
+ _this = _BaseComponent.call(this, element) || this;
214
+ _this._config = _this._getConfig(config);
215
+ _this._timeout = null;
167
216
 
168
- Data__default['default'].setData(element, DATA_KEY, this);
217
+ _this._setListeners();
218
+
219
+ return _this;
169
220
  } // Getters
170
221
 
171
222
 
@@ -173,7 +224,7 @@
173
224
 
174
225
  // Public
175
226
  _proto.show = function show() {
176
- var _this = this;
227
+ var _this2 = this;
177
228
 
178
229
  var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
179
230
 
@@ -188,16 +239,16 @@
188
239
  }
189
240
 
190
241
  var complete = function complete() {
191
- _this._element.classList.remove(CLASS_NAME_SHOWING);
242
+ _this2._element.classList.remove(CLASS_NAME_SHOWING);
192
243
 
193
- _this._element.classList.add(CLASS_NAME_SHOW);
244
+ _this2._element.classList.add(CLASS_NAME_SHOW);
194
245
 
195
- EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN);
246
+ EventHandler__default['default'].trigger(_this2._element, EVENT_SHOWN);
196
247
 
197
- if (_this._config.autohide) {
198
- _this._timeout = setTimeout(function () {
199
- _this.hide();
200
- }, _this._config.delay);
248
+ if (_this2._config.autohide) {
249
+ _this2._timeout = setTimeout(function () {
250
+ _this2.hide();
251
+ }, _this2._config.delay);
201
252
  }
202
253
  };
203
254
 
@@ -217,7 +268,7 @@
217
268
  };
218
269
 
219
270
  _proto.hide = function hide() {
220
- var _this2 = this;
271
+ var _this3 = this;
221
272
 
222
273
  if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
223
274
  return;
@@ -230,9 +281,9 @@
230
281
  }
231
282
 
232
283
  var complete = function complete() {
233
- _this2._element.classList.add(CLASS_NAME_HIDE);
284
+ _this3._element.classList.add(CLASS_NAME_HIDE);
234
285
 
235
- EventHandler__default['default'].trigger(_this2._element, EVENT_HIDDEN);
286
+ EventHandler__default['default'].trigger(_this3._element, EVENT_HIDDEN);
236
287
  };
237
288
 
238
289
  this._element.classList.remove(CLASS_NAME_SHOW);
@@ -254,8 +305,9 @@
254
305
  }
255
306
 
256
307
  EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
257
- Data__default['default'].removeData(this._element, DATA_KEY);
258
- this._element = null;
308
+
309
+ _BaseComponent.prototype.dispose.call(this);
310
+
259
311
  this._config = null;
260
312
  } // Private
261
313
  ;
@@ -267,10 +319,10 @@
267
319
  };
268
320
 
269
321
  _proto._setListeners = function _setListeners() {
270
- var _this3 = this;
322
+ var _this4 = this;
271
323
 
272
324
  EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
273
- return _this3.hide();
325
+ return _this4.hide();
274
326
  });
275
327
  };
276
328
 
@@ -300,16 +352,7 @@
300
352
  });
301
353
  };
302
354
 
303
- Toast.getInstance = function getInstance(element) {
304
- return Data__default['default'].getData(element, DATA_KEY);
305
- };
306
-
307
- _createClass(Toast, null, [{
308
- key: "VERSION",
309
- get: function get() {
310
- return VERSION;
311
- }
312
- }, {
355
+ _createClass$1(Toast, null, [{
313
356
  key: "DefaultType",
314
357
  get: function get() {
315
358
  return DefaultType;
@@ -319,10 +362,15 @@
319
362
  get: function get() {
320
363
  return Default;
321
364
  }
365
+ }, {
366
+ key: "DATA_KEY",
367
+ get: function get() {
368
+ return DATA_KEY;
369
+ }
322
370
  }]);
323
371
 
324
372
  return Toast;
325
- }();
373
+ }(BaseComponent);
326
374
  /**
327
375
  * ------------------------------------------------------------------------
328
376
  * jQuery
@@ -1,25 +1,45 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v5.0.0-alpha3 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.0-beta1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 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
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
8
- typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', 'popper.js', './dom/selector-engine.js'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
10
- }(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
8
+ typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
10
+ }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () {
24
+ return e[k];
25
+ }
26
+ });
27
+ }
28
+ });
29
+ }
30
+ n['default'] = e;
31
+ return Object.freeze(n);
32
+ }
33
+
34
+ var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
14
35
  var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
36
  var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
37
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
- var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
18
38
  var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
19
39
 
20
40
  /**
21
41
  * --------------------------------------------------------------------------
22
- * Bootstrap (v5.0.0-alpha3): util/index.js
42
+ * Bootstrap (v5.0.0-beta1): util/index.js
23
43
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
44
  * --------------------------------------------------------------------------
25
45
  */
@@ -59,8 +79,8 @@
59
79
  transitionDuration = _window$getComputedSt.transitionDuration,
60
80
  transitionDelay = _window$getComputedSt.transitionDelay;
61
81
 
62
- var floatTransitionDuration = parseFloat(transitionDuration);
63
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
82
+ var floatTransitionDuration = Number.parseFloat(transitionDuration);
83
+ var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
64
84
 
65
85
  if (!floatTransitionDuration && !floatTransitionDelay) {
66
86
  return 0;
@@ -69,7 +89,7 @@
69
89
 
70
90
  transitionDuration = transitionDuration.split(',')[0];
71
91
  transitionDelay = transitionDelay.split(',')[0];
72
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
92
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
73
93
  };
74
94
 
75
95
  var triggerTransitionEnd = function triggerTransitionEnd(element) {
@@ -141,7 +161,7 @@
141
161
  var _window = window,
142
162
  jQuery = _window.jQuery;
143
163
 
144
- if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
164
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
145
165
  return jQuery;
146
166
  }
147
167
 
@@ -156,13 +176,15 @@
156
176
  }
157
177
  };
158
178
 
179
+ var isRTL = document.documentElement.dir === 'rtl';
180
+
159
181
  /**
160
182
  * --------------------------------------------------------------------------
161
- * Bootstrap (v5.0.0-alpha3): util/sanitizer.js
183
+ * Bootstrap (v5.0.0-beta1): util/sanitizer.js
162
184
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
163
185
  * --------------------------------------------------------------------------
164
186
  */
165
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
187
+ var uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
166
188
  var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
167
189
  /**
168
190
  * A pattern that recognizes a commonly useful subset of URLs that are safe.
@@ -182,8 +204,8 @@
182
204
  var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
183
205
  var attrName = attr.nodeName.toLowerCase();
184
206
 
185
- if (allowedAttributeList.indexOf(attrName) !== -1) {
186
- if (uriAttrs.indexOf(attrName) !== -1) {
207
+ if (allowedAttributeList.includes(attrName)) {
208
+ if (uriAttrs.has(attrName)) {
187
209
  return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
188
210
  }
189
211
 
@@ -259,7 +281,7 @@
259
281
  var el = elements[i];
260
282
  var elName = el.nodeName.toLowerCase();
261
283
 
262
- if (allowlistKeys.indexOf(elName) === -1) {
284
+ if (!allowlistKeys.includes(elName)) {
263
285
  el.parentNode.removeChild(el);
264
286
  return "continue";
265
287
  }
@@ -283,8 +305,6 @@
283
305
  return createdDocument.body.innerHTML;
284
306
  }
285
307
 
286
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
287
-
288
308
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
289
309
 
290
310
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
@@ -294,13 +314,60 @@
294
314
  * ------------------------------------------------------------------------
295
315
  */
296
316
 
317
+ var VERSION = '5.0.0-beta1';
318
+
319
+ var BaseComponent = /*#__PURE__*/function () {
320
+ function BaseComponent(element) {
321
+ if (!element) {
322
+ return;
323
+ }
324
+
325
+ this._element = element;
326
+ Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
327
+ }
328
+
329
+ var _proto = BaseComponent.prototype;
330
+
331
+ _proto.dispose = function dispose() {
332
+ Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
333
+ this._element = null;
334
+ }
335
+ /** Static */
336
+ ;
337
+
338
+ BaseComponent.getInstance = function getInstance(element) {
339
+ return Data__default['default'].getData(element, this.DATA_KEY);
340
+ };
341
+
342
+ _createClass(BaseComponent, null, [{
343
+ key: "VERSION",
344
+ get: function get() {
345
+ return VERSION;
346
+ }
347
+ }]);
348
+
349
+ return BaseComponent;
350
+ }();
351
+
352
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
353
+
354
+ function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
355
+
356
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
357
+
358
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
359
+ /**
360
+ * ------------------------------------------------------------------------
361
+ * Constants
362
+ * ------------------------------------------------------------------------
363
+ */
364
+
297
365
  var NAME = 'tooltip';
298
- var VERSION = '5.0.0-alpha3';
299
366
  var DATA_KEY = 'bs.tooltip';
300
367
  var EVENT_KEY = "." + DATA_KEY;
301
368
  var CLASS_PREFIX = 'bs-tooltip';
302
369
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
303
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn'];
370
+ var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
304
371
  var DefaultType = {
305
372
  animation: 'boolean',
306
373
  template: 'string',
@@ -310,10 +377,10 @@
310
377
  html: 'boolean',
311
378
  selector: '(string|boolean)',
312
379
  placement: '(string|function)',
313
- offset: '(number|string|function)',
314
380
  container: '(string|element|boolean)',
315
- fallbackPlacement: '(string|array)',
381
+ fallbackPlacements: '(null|array)',
316
382
  boundary: '(string|element)',
383
+ customClass: '(string|function)',
317
384
  sanitize: 'boolean',
318
385
  sanitizeFn: '(null|function)',
319
386
  allowList: 'object',
@@ -322,23 +389,23 @@
322
389
  var AttachmentMap = {
323
390
  AUTO: 'auto',
324
391
  TOP: 'top',
325
- RIGHT: 'right',
392
+ RIGHT: isRTL ? 'left' : 'right',
326
393
  BOTTOM: 'bottom',
327
- LEFT: 'left'
394
+ LEFT: isRTL ? 'right' : 'left'
328
395
  };
329
396
  var Default = {
330
397
  animation: true,
331
- template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
398
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
332
399
  trigger: 'hover focus',
333
400
  title: '',
334
401
  delay: 0,
335
402
  html: false,
336
403
  selector: false,
337
404
  placement: 'top',
338
- offset: 0,
339
405
  container: false,
340
- fallbackPlacement: 'flip',
341
- boundary: 'scrollParent',
406
+ fallbackPlacements: null,
407
+ boundary: 'clippingParents',
408
+ customClass: '',
342
409
  sanitize: true,
343
410
  sanitizeFn: null,
344
411
  allowList: DefaultAllowlist,
@@ -372,26 +439,30 @@
372
439
  * ------------------------------------------------------------------------
373
440
  */
374
441
 
375
- var Tooltip = /*#__PURE__*/function () {
442
+ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
443
+ _inheritsLoose(Tooltip, _BaseComponent);
444
+
376
445
  function Tooltip(element, config) {
377
- if (typeof Popper__default['default'] === 'undefined') {
378
- throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
379
- } // private
446
+ var _this;
380
447
 
448
+ if (typeof Popper__namespace === 'undefined') {
449
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
450
+ }
381
451
 
382
- this._isEnabled = true;
383
- this._timeout = 0;
384
- this._hoverState = '';
385
- this._activeTrigger = {};
386
- this._popper = null; // Protected
452
+ _this = _BaseComponent.call(this, element) || this; // private
387
453
 
388
- this.element = element;
389
- this.config = this._getConfig(config);
390
- this.tip = null;
454
+ _this._isEnabled = true;
455
+ _this._timeout = 0;
456
+ _this._hoverState = '';
457
+ _this._activeTrigger = {};
458
+ _this._popper = null; // Protected
391
459
 
392
- this._setListeners();
460
+ _this.config = _this._getConfig(config);
461
+ _this.tip = null;
393
462
 
394
- Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
463
+ _this._setListeners();
464
+
465
+ return _this;
395
466
  } // Getters
396
467
 
397
468
 
@@ -444,9 +515,8 @@
444
515
 
445
516
  _proto.dispose = function dispose() {
446
517
  clearTimeout(this._timeout);
447
- Data__default['default'].removeData(this.element, this.constructor.DATA_KEY);
448
- EventHandler__default['default'].off(this.element, this.constructor.EVENT_KEY);
449
- EventHandler__default['default'].off(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
518
+ EventHandler__default['default'].off(this._element, this.constructor.EVENT_KEY);
519
+ EventHandler__default['default'].off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
450
520
 
451
521
  if (this.tip) {
452
522
  this.tip.parentNode.removeChild(this.tip);
@@ -462,22 +532,23 @@
462
532
  }
463
533
 
464
534
  this._popper = null;
465
- this.element = null;
466
535
  this.config = null;
467
536
  this.tip = null;
537
+
538
+ _BaseComponent.prototype.dispose.call(this);
468
539
  };
469
540
 
470
541
  _proto.show = function show() {
471
- var _this = this;
542
+ var _this2 = this;
472
543
 
473
- if (this.element.style.display === 'none') {
544
+ if (this._element.style.display === 'none') {
474
545
  throw new Error('Please use show on visible elements');
475
546
  }
476
547
 
477
548
  if (this.isWithContent() && this._isEnabled) {
478
- var showEvent = EventHandler__default['default'].trigger(this.element, this.constructor.Event.SHOW);
479
- var shadowRoot = findShadowRoot(this.element);
480
- var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
549
+ var showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
550
+ var shadowRoot = findShadowRoot(this._element);
551
+ var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
481
552
 
482
553
  if (showEvent.defaultPrevented || !isInTheDom) {
483
554
  return;
@@ -486,14 +557,16 @@
486
557
  var tip = this.getTipElement();
487
558
  var tipId = getUID(this.constructor.NAME);
488
559
  tip.setAttribute('id', tipId);
489
- this.element.setAttribute('aria-describedby', tipId);
560
+
561
+ this._element.setAttribute('aria-describedby', tipId);
562
+
490
563
  this.setContent();
491
564
 
492
565
  if (this.config.animation) {
493
566
  tip.classList.add(CLASS_NAME_FADE);
494
567
  }
495
568
 
496
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
569
+ var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
497
570
 
498
571
  var attachment = this._getAttachment(placement);
499
572
 
@@ -503,17 +576,25 @@
503
576
 
504
577
  Data__default['default'].setData(tip, this.constructor.DATA_KEY, this);
505
578
 
506
- if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
579
+ if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
507
580
  container.appendChild(tip);
508
581
  }
509
582
 
510
- EventHandler__default['default'].trigger(this.element, this.constructor.Event.INSERTED);
511
- this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
512
- tip.classList.add(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
583
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
584
+ this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
585
+ tip.classList.add(CLASS_NAME_SHOW);
586
+ var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
587
+
588
+ if (customClass) {
589
+ var _tip$classList;
590
+
591
+ (_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
592
+ } // If this is a touch-enabled device we add extra
513
593
  // empty mouseover listeners to the body's immediate children;
514
594
  // only needed because of broken event delegation on iOS
515
595
  // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
516
596
 
597
+
517
598
  if ('ontouchstart' in document.documentElement) {
518
599
  var _ref;
519
600
 
@@ -523,16 +604,12 @@
523
604
  }
524
605
 
525
606
  var complete = function complete() {
526
- if (_this.config.animation) {
527
- _this._fixTransition();
528
- }
529
-
530
- var prevHoverState = _this._hoverState;
531
- _this._hoverState = null;
532
- EventHandler__default['default'].trigger(_this.element, _this.constructor.Event.SHOWN);
607
+ var prevHoverState = _this2._hoverState;
608
+ _this2._hoverState = null;
609
+ EventHandler__default['default'].trigger(_this2._element, _this2.constructor.Event.SHOWN);
533
610
 
534
611
  if (prevHoverState === HOVER_STATE_OUT) {
535
- _this._leave(null, _this);
612
+ _this2._leave(null, _this2);
536
613
  }
537
614
  };
538
615
 
@@ -547,7 +624,7 @@
547
624
  };
548
625
 
549
626
  _proto.hide = function hide() {
550
- var _this2 = this;
627
+ var _this3 = this;
551
628
 
552
629
  if (!this._popper) {
553
630
  return;
@@ -556,20 +633,24 @@
556
633
  var tip = this.getTipElement();
557
634
 
558
635
  var complete = function complete() {
559
- if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
636
+ if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
560
637
  tip.parentNode.removeChild(tip);
561
638
  }
562
639
 
563
- _this2._cleanTipClass();
640
+ _this3._cleanTipClass();
641
+
642
+ _this3._element.removeAttribute('aria-describedby');
564
643
 
565
- _this2.element.removeAttribute('aria-describedby');
644
+ EventHandler__default['default'].trigger(_this3._element, _this3.constructor.Event.HIDDEN);
566
645
 
567
- EventHandler__default['default'].trigger(_this2.element, _this2.constructor.Event.HIDDEN);
646
+ if (_this3._popper) {
647
+ _this3._popper.destroy();
568
648
 
569
- _this2._popper.destroy();
649
+ _this3._popper = null;
650
+ }
570
651
  };
571
652
 
572
- var hideEvent = EventHandler__default['default'].trigger(this.element, this.constructor.Event.HIDE);
653
+ var hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
573
654
 
574
655
  if (hideEvent.defaultPrevented) {
575
656
  return;
@@ -603,7 +684,7 @@
603
684
 
604
685
  _proto.update = function update() {
605
686
  if (this._popper !== null) {
606
- this._popper.scheduleUpdate();
687
+ this._popper.update();
607
688
  }
608
689
  } // Protected
609
690
  ;
@@ -664,64 +745,73 @@
664
745
  };
665
746
 
666
747
  _proto.getTitle = function getTitle() {
667
- var title = this.element.getAttribute('data-original-title');
748
+ var title = this._element.getAttribute('data-bs-original-title');
668
749
 
669
750
  if (!title) {
670
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
751
+ title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
671
752
  }
672
753
 
673
754
  return title;
755
+ };
756
+
757
+ _proto.updateAttachment = function updateAttachment(attachment) {
758
+ if (attachment === 'right') {
759
+ return 'end';
760
+ }
761
+
762
+ if (attachment === 'left') {
763
+ return 'start';
764
+ }
765
+
766
+ return attachment;
674
767
  } // Private
675
768
  ;
676
769
 
677
770
  _proto._getPopperConfig = function _getPopperConfig(attachment) {
678
- var _this3 = this;
771
+ var _this4 = this;
772
+
773
+ var flipModifier = {
774
+ name: 'flip',
775
+ options: {
776
+ altBoundary: true
777
+ }
778
+ };
779
+
780
+ if (this.config.fallbackPlacements) {
781
+ flipModifier.options.fallbackPlacements = this.config.fallbackPlacements;
782
+ }
679
783
 
680
784
  var defaultBsConfig = {
681
785
  placement: attachment,
682
- modifiers: {
683
- offset: this._getOffset(),
684
- flip: {
685
- behavior: this.config.fallbackPlacement
686
- },
687
- arrow: {
786
+ modifiers: [flipModifier, {
787
+ name: 'preventOverflow',
788
+ options: {
789
+ rootBoundary: this.config.boundary
790
+ }
791
+ }, {
792
+ name: 'arrow',
793
+ options: {
688
794
  element: "." + this.constructor.NAME + "-arrow"
689
- },
690
- preventOverflow: {
691
- boundariesElement: this.config.boundary
692
795
  }
693
- },
694
- onCreate: function onCreate(data) {
695
- if (data.originalPlacement !== data.placement) {
696
- _this3._handlePopperPlacementChange(data);
796
+ }, {
797
+ name: 'onChange',
798
+ enabled: true,
799
+ phase: 'afterWrite',
800
+ fn: function fn(data) {
801
+ return _this4._handlePopperPlacementChange(data);
802
+ }
803
+ }],
804
+ onFirstUpdate: function onFirstUpdate(data) {
805
+ if (data.options.placement !== data.placement) {
806
+ _this4._handlePopperPlacementChange(data);
697
807
  }
698
- },
699
- onUpdate: function onUpdate(data) {
700
- return _this3._handlePopperPlacementChange(data);
701
808
  }
702
809
  };
703
810
  return _extends({}, defaultBsConfig, this.config.popperConfig);
704
811
  };
705
812
 
706
813
  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
707
- this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
708
- };
709
-
710
- _proto._getOffset = function _getOffset() {
711
- var _this4 = this;
712
-
713
- var offset = {};
714
-
715
- if (typeof this.config.offset === 'function') {
716
- offset.fn = function (data) {
717
- data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
718
- return data;
719
- };
720
- } else {
721
- offset.offset = this.config.offset;
722
- }
723
-
724
- return offset;
814
+ this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
725
815
  };
726
816
 
727
817
  _proto._getContainer = function _getContainer() {
@@ -746,28 +836,28 @@
746
836
  var triggers = this.config.trigger.split(' ');
747
837
  triggers.forEach(function (trigger) {
748
838
  if (trigger === 'click') {
749
- EventHandler__default['default'].on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
839
+ EventHandler__default['default'].on(_this5._element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
750
840
  return _this5.toggle(event);
751
841
  });
752
842
  } else if (trigger !== TRIGGER_MANUAL) {
753
843
  var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
754
844
  var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
755
- EventHandler__default['default'].on(_this5.element, eventIn, _this5.config.selector, function (event) {
845
+ EventHandler__default['default'].on(_this5._element, eventIn, _this5.config.selector, function (event) {
756
846
  return _this5._enter(event);
757
847
  });
758
- EventHandler__default['default'].on(_this5.element, eventOut, _this5.config.selector, function (event) {
848
+ EventHandler__default['default'].on(_this5._element, eventOut, _this5.config.selector, function (event) {
759
849
  return _this5._leave(event);
760
850
  });
761
851
  }
762
852
  });
763
853
 
764
854
  this._hideModalHandler = function () {
765
- if (_this5.element) {
855
+ if (_this5._element) {
766
856
  _this5.hide();
767
857
  }
768
858
  };
769
859
 
770
- EventHandler__default['default'].on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
860
+ EventHandler__default['default'].on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
771
861
 
772
862
  if (this.config.selector) {
773
863
  this.config = _extends({}, this.config, {
@@ -780,11 +870,18 @@
780
870
  };
781
871
 
782
872
  _proto._fixTitle = function _fixTitle() {
783
- var titleType = typeof this.element.getAttribute('data-original-title');
873
+ var title = this._element.getAttribute('title');
874
+
875
+ var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
876
+
877
+ if (title || originalTitleType !== 'string') {
878
+ this._element.setAttribute('data-bs-original-title', title || '');
784
879
 
785
- if (this.element.getAttribute('title') || titleType !== 'string') {
786
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
787
- this.element.setAttribute('title', '');
880
+ if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
881
+ this._element.setAttribute('aria-label', title);
882
+ }
883
+
884
+ this._element.setAttribute('title', '');
788
885
  }
789
886
  };
790
887
 
@@ -864,9 +961,9 @@
864
961
  };
865
962
 
866
963
  _proto._getConfig = function _getConfig(config) {
867
- var dataAttributes = Manipulator__default['default'].getDataAttributes(this.element);
964
+ var dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
868
965
  Object.keys(dataAttributes).forEach(function (dataAttr) {
869
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
966
+ if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
870
967
  delete dataAttributes[dataAttr];
871
968
  }
872
969
  });
@@ -929,26 +1026,17 @@
929
1026
  };
930
1027
 
931
1028
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
932
- this.tip = popperData.instance.popper;
933
-
934
- this._cleanTipClass();
935
-
936
- this._addAttachmentClass(this._getAttachment(popperData.placement));
937
- };
1029
+ var state = popperData.state;
938
1030
 
939
- _proto._fixTransition = function _fixTransition() {
940
- var tip = this.getTipElement();
941
- var initConfigAnimation = this.config.animation;
942
-
943
- if (tip.getAttribute('x-placement') !== null) {
1031
+ if (!state) {
944
1032
  return;
945
1033
  }
946
1034
 
947
- tip.classList.remove(CLASS_NAME_FADE);
948
- this.config.animation = false;
949
- this.hide();
950
- this.show();
951
- this.config.animation = initConfigAnimation;
1035
+ this.tip = state.elements.popper;
1036
+
1037
+ this._cleanTipClass();
1038
+
1039
+ this._addAttachmentClass(this._getAttachment(state.placement));
952
1040
  } // Static
953
1041
  ;
954
1042
 
@@ -976,16 +1064,7 @@
976
1064
  });
977
1065
  };
978
1066
 
979
- Tooltip.getInstance = function getInstance(element) {
980
- return Data__default['default'].getData(element, DATA_KEY);
981
- };
982
-
983
- _createClass(Tooltip, null, [{
984
- key: "VERSION",
985
- get: function get() {
986
- return VERSION;
987
- }
988
- }, {
1067
+ _createClass$1(Tooltip, null, [{
989
1068
  key: "Default",
990
1069
  get: function get() {
991
1070
  return Default;
@@ -1018,7 +1097,7 @@
1018
1097
  }]);
1019
1098
 
1020
1099
  return Tooltip;
1021
- }();
1100
+ }(BaseComponent);
1022
1101
  /**
1023
1102
  * ------------------------------------------------------------------------
1024
1103
  * jQuery