bootstrap 5.0.0.beta2 → 5.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +1 -0
  4. data/assets/javascripts/bootstrap.js +2051 -2009
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +75 -118
  7. data/assets/javascripts/bootstrap/base-component.js +23 -37
  8. data/assets/javascripts/bootstrap/button.js +39 -78
  9. data/assets/javascripts/bootstrap/carousel.js +284 -364
  10. data/assets/javascripts/bootstrap/collapse.js +178 -247
  11. data/assets/javascripts/bootstrap/dom/data.js +34 -47
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +71 -77
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +23 -21
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +20 -28
  15. data/assets/javascripts/bootstrap/dropdown.js +195 -265
  16. data/assets/javascripts/bootstrap/modal.js +256 -344
  17. data/assets/javascripts/bootstrap/offcanvas.js +508 -0
  18. data/assets/javascripts/bootstrap/popover.js +88 -157
  19. data/assets/javascripts/bootstrap/scrollspy.js +134 -212
  20. data/assets/javascripts/bootstrap/tab.js +108 -142
  21. data/assets/javascripts/bootstrap/toast.js +113 -183
  22. data/assets/javascripts/bootstrap/tooltip.js +297 -392
  23. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  25. data/assets/stylesheets/_bootstrap.scss +2 -1
  26. data/assets/stylesheets/bootstrap/_accordion.scss +22 -32
  27. data/assets/stylesheets/bootstrap/_buttons.scss +2 -0
  28. data/assets/stylesheets/bootstrap/_card.scss +1 -1
  29. data/assets/stylesheets/bootstrap/_dropdown.scss +3 -6
  30. data/assets/stylesheets/bootstrap/_list-group.scss +11 -0
  31. data/assets/stylesheets/bootstrap/_modal.scss +2 -0
  32. data/assets/stylesheets/bootstrap/_nav.scss +7 -0
  33. data/assets/stylesheets/bootstrap/_navbar.scss +2 -0
  34. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  35. data/assets/stylesheets/bootstrap/_progress.scss +3 -0
  36. data/assets/stylesheets/bootstrap/_reboot.scss +7 -21
  37. data/assets/stylesheets/bootstrap/_spinners.scss +4 -0
  38. data/assets/stylesheets/bootstrap/_transitions.scss +2 -0
  39. data/assets/stylesheets/bootstrap/_utilities.scss +65 -37
  40. data/assets/stylesheets/bootstrap/_variables.scss +138 -30
  41. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  42. data/assets/stylesheets/bootstrap/forms/_form-control.scss +0 -4
  43. data/assets/stylesheets/bootstrap/mixins/_alert.scss +2 -0
  44. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +2 -0
  45. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +6 -1
  46. data/assets/stylesheets/bootstrap/mixins/_caret.scss +2 -0
  47. data/assets/stylesheets/bootstrap/mixins/_forms.scss +11 -1
  48. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
  49. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -0
  50. data/bootstrap.gemspec +1 -1
  51. data/lib/bootstrap/version.rb +2 -2
  52. data/tasks/updater/js.rb +1 -1
  53. data/tasks/updater/network.rb +7 -1
  54. metadata +6 -4
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap tab.js v5.0.0-beta2 (https://getbootstrap.com/)
2
+ * Bootstrap tab.js v5.0.0-beta3 (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
  */
@@ -16,52 +16,20 @@
16
16
  var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
17
17
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
18
18
 
19
- function _defineProperties(target, props) {
20
- for (var i = 0; i < props.length; i++) {
21
- var descriptor = props[i];
22
- descriptor.enumerable = descriptor.enumerable || false;
23
- descriptor.configurable = true;
24
- if ("value" in descriptor) descriptor.writable = true;
25
- Object.defineProperty(target, descriptor.key, descriptor);
26
- }
27
- }
28
-
29
- function _createClass(Constructor, protoProps, staticProps) {
30
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
31
- if (staticProps) _defineProperties(Constructor, staticProps);
32
- return Constructor;
33
- }
34
-
35
- function _inheritsLoose(subClass, superClass) {
36
- subClass.prototype = Object.create(superClass.prototype);
37
- subClass.prototype.constructor = subClass;
38
-
39
- _setPrototypeOf(subClass, superClass);
40
- }
41
-
42
- function _setPrototypeOf(o, p) {
43
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
44
- o.__proto__ = p;
45
- return o;
46
- };
47
-
48
- return _setPrototypeOf(o, p);
49
- }
50
-
51
19
  /**
52
20
  * --------------------------------------------------------------------------
53
- * Bootstrap (v5.0.0-beta2): util/index.js
21
+ * Bootstrap (v5.0.0-beta3): util/index.js
54
22
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
55
23
  * --------------------------------------------------------------------------
56
24
  */
57
- var MILLISECONDS_MULTIPLIER = 1000;
58
- var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
25
+ const MILLISECONDS_MULTIPLIER = 1000;
26
+ const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
59
27
 
60
- var getSelector = function getSelector(element) {
61
- var selector = element.getAttribute('data-bs-target');
28
+ const getSelector = element => {
29
+ let selector = element.getAttribute('data-bs-target');
62
30
 
63
31
  if (!selector || selector === '#') {
64
- var hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
32
+ let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
65
33
  // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
66
34
  // `document.querySelector` will rightfully complain it is invalid.
67
35
  // See https://github.com/twbs/bootstrap/issues/32273
@@ -81,23 +49,23 @@
81
49
  return selector;
82
50
  };
83
51
 
84
- var getElementFromSelector = function getElementFromSelector(element) {
85
- var selector = getSelector(element);
52
+ const getElementFromSelector = element => {
53
+ const selector = getSelector(element);
86
54
  return selector ? document.querySelector(selector) : null;
87
55
  };
88
56
 
89
- var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
57
+ const getTransitionDurationFromElement = element => {
90
58
  if (!element) {
91
59
  return 0;
92
60
  } // Get transition-duration of the element
93
61
 
94
62
 
95
- var _window$getComputedSt = window.getComputedStyle(element),
96
- transitionDuration = _window$getComputedSt.transitionDuration,
97
- transitionDelay = _window$getComputedSt.transitionDelay;
98
-
99
- var floatTransitionDuration = Number.parseFloat(transitionDuration);
100
- var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
63
+ let {
64
+ transitionDuration,
65
+ transitionDelay
66
+ } = window.getComputedStyle(element);
67
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
68
+ const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
101
69
 
102
70
  if (!floatTransitionDuration && !floatTransitionDelay) {
103
71
  return 0;
@@ -109,14 +77,14 @@
109
77
  return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
110
78
  };
111
79
 
112
- var triggerTransitionEnd = function triggerTransitionEnd(element) {
80
+ const triggerTransitionEnd = element => {
113
81
  element.dispatchEvent(new Event(TRANSITION_END));
114
82
  };
115
83
 
116
- var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
117
- var called = false;
118
- var durationPadding = 5;
119
- var emulatedDuration = duration + durationPadding;
84
+ const emulateTransitionEnd = (element, duration) => {
85
+ let called = false;
86
+ const durationPadding = 5;
87
+ const emulatedDuration = duration + durationPadding;
120
88
 
121
89
  function listener() {
122
90
  called = true;
@@ -124,20 +92,35 @@
124
92
  }
125
93
 
126
94
  element.addEventListener(TRANSITION_END, listener);
127
- setTimeout(function () {
95
+ setTimeout(() => {
128
96
  if (!called) {
129
97
  triggerTransitionEnd(element);
130
98
  }
131
99
  }, emulatedDuration);
132
100
  };
133
101
 
134
- var reflow = function reflow(element) {
135
- return element.offsetHeight;
102
+ const isDisabled = element => {
103
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) {
104
+ return true;
105
+ }
106
+
107
+ if (element.classList.contains('disabled')) {
108
+ return true;
109
+ }
110
+
111
+ if (typeof element.disabled !== 'undefined') {
112
+ return element.disabled;
113
+ }
114
+
115
+ return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
136
116
  };
137
117
 
138
- var getjQuery = function getjQuery() {
139
- var _window = window,
140
- jQuery = _window.jQuery;
118
+ const reflow = element => element.offsetHeight;
119
+
120
+ const getjQuery = () => {
121
+ const {
122
+ jQuery
123
+ } = window;
141
124
 
142
125
  if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
143
126
  return jQuery;
@@ -146,7 +129,7 @@
146
129
  return null;
147
130
  };
148
131
 
149
- var onDOMContentLoaded = function onDOMContentLoaded(callback) {
132
+ const onDOMContentLoaded = callback => {
150
133
  if (document.readyState === 'loading') {
151
134
  document.addEventListener('DOMContentLoaded', callback);
152
135
  } else {
@@ -154,19 +137,17 @@
154
137
  }
155
138
  };
156
139
 
157
- document.documentElement.dir === 'rtl';
158
-
159
- var defineJQueryPlugin = function defineJQueryPlugin(name, plugin) {
160
- onDOMContentLoaded(function () {
161
- var $ = getjQuery();
140
+ const defineJQueryPlugin = (name, plugin) => {
141
+ onDOMContentLoaded(() => {
142
+ const $ = getjQuery();
162
143
  /* istanbul ignore if */
163
144
 
164
145
  if ($) {
165
- var JQUERY_NO_CONFLICT = $.fn[name];
146
+ const JQUERY_NO_CONFLICT = $.fn[name];
166
147
  $.fn[name] = plugin.jQueryInterface;
167
148
  $.fn[name].Constructor = plugin;
168
149
 
169
- $.fn[name].noConflict = function () {
150
+ $.fn[name].noConflict = () => {
170
151
  $.fn[name] = JQUERY_NO_CONFLICT;
171
152
  return plugin.jQueryInterface;
172
153
  };
@@ -174,71 +155,71 @@
174
155
  });
175
156
  };
176
157
 
158
+ /**
159
+ * --------------------------------------------------------------------------
160
+ * Bootstrap (v5.0.0-beta3): tab.js
161
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
162
+ * --------------------------------------------------------------------------
163
+ */
177
164
  /**
178
165
  * ------------------------------------------------------------------------
179
166
  * Constants
180
167
  * ------------------------------------------------------------------------
181
168
  */
182
169
 
183
- var NAME = 'tab';
184
- var DATA_KEY = 'bs.tab';
185
- var EVENT_KEY = "." + DATA_KEY;
186
- var DATA_API_KEY = '.data-api';
187
- var EVENT_HIDE = "hide" + EVENT_KEY;
188
- var EVENT_HIDDEN = "hidden" + EVENT_KEY;
189
- var EVENT_SHOW = "show" + EVENT_KEY;
190
- var EVENT_SHOWN = "shown" + EVENT_KEY;
191
- var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
192
- var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
193
- var CLASS_NAME_ACTIVE = 'active';
194
- var CLASS_NAME_DISABLED = 'disabled';
195
- var CLASS_NAME_FADE = 'fade';
196
- var CLASS_NAME_SHOW = 'show';
197
- var SELECTOR_DROPDOWN = '.dropdown';
198
- var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
199
- var SELECTOR_ACTIVE = '.active';
200
- var SELECTOR_ACTIVE_UL = ':scope > li > .active';
201
- var SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
202
- var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
203
- var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
170
+ const NAME = 'tab';
171
+ const DATA_KEY = 'bs.tab';
172
+ const EVENT_KEY = `.${DATA_KEY}`;
173
+ const DATA_API_KEY = '.data-api';
174
+ const EVENT_HIDE = `hide${EVENT_KEY}`;
175
+ const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
176
+ const EVENT_SHOW = `show${EVENT_KEY}`;
177
+ const EVENT_SHOWN = `shown${EVENT_KEY}`;
178
+ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
179
+ const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
180
+ const CLASS_NAME_ACTIVE = 'active';
181
+ const CLASS_NAME_FADE = 'fade';
182
+ const CLASS_NAME_SHOW = 'show';
183
+ const SELECTOR_DROPDOWN = '.dropdown';
184
+ const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
185
+ const SELECTOR_ACTIVE = '.active';
186
+ const SELECTOR_ACTIVE_UL = ':scope > li > .active';
187
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
188
+ const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
189
+ const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
204
190
  /**
205
191
  * ------------------------------------------------------------------------
206
192
  * Class Definition
207
193
  * ------------------------------------------------------------------------
208
194
  */
209
195
 
210
- var Tab = /*#__PURE__*/function (_BaseComponent) {
211
- _inheritsLoose(Tab, _BaseComponent);
212
-
213
- function Tab() {
214
- return _BaseComponent.apply(this, arguments) || this;
215
- }
196
+ class Tab extends BaseComponent__default['default'] {
197
+ // Getters
198
+ static get DATA_KEY() {
199
+ return DATA_KEY;
200
+ } // Public
216
201
 
217
- var _proto = Tab.prototype;
218
202
 
219
- // Public
220
- _proto.show = function show() {
221
- var _this = this;
222
-
223
- if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE) || this._element.classList.contains(CLASS_NAME_DISABLED)) {
203
+ show() {
204
+ if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE) || isDisabled(this._element)) {
224
205
  return;
225
206
  }
226
207
 
227
- var previous;
228
- var target = getElementFromSelector(this._element);
208
+ let previous;
209
+ const target = getElementFromSelector(this._element);
229
210
 
230
- var listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
211
+ const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
231
212
 
232
213
  if (listElement) {
233
- var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
214
+ const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
234
215
  previous = SelectorEngine__default['default'].find(itemSelector, listElement);
235
216
  previous = previous[previous.length - 1];
236
217
  }
237
218
 
238
- var hideEvent = previous ? EventHandler__default['default'].trigger(previous, EVENT_HIDE, {
219
+ const hideEvent = previous ? EventHandler__default['default'].trigger(previous, EVENT_HIDE, {
239
220
  relatedTarget: this._element
240
221
  }) : null;
241
- var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
222
+ const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
242
223
  relatedTarget: previous
243
224
  });
244
225
 
@@ -248,11 +229,11 @@
248
229
 
249
230
  this._activate(this._element, listElement);
250
231
 
251
- var complete = function complete() {
232
+ const complete = () => {
252
233
  EventHandler__default['default'].trigger(previous, EVENT_HIDDEN, {
253
- relatedTarget: _this._element
234
+ relatedTarget: this._element
254
235
  });
255
- EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN, {
236
+ EventHandler__default['default'].trigger(this._element, EVENT_SHOWN, {
256
237
  relatedTarget: previous
257
238
  });
258
239
  };
@@ -263,33 +244,29 @@
263
244
  complete();
264
245
  }
265
246
  } // Private
266
- ;
267
247
 
268
- _proto._activate = function _activate(element, container, callback) {
269
- var _this2 = this;
270
248
 
271
- var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine__default['default'].find(SELECTOR_ACTIVE_UL, container) : SelectorEngine__default['default'].children(container, SELECTOR_ACTIVE);
272
- var active = activeElements[0];
273
- var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE);
249
+ _activate(element, container, callback) {
250
+ const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine__default['default'].find(SELECTOR_ACTIVE_UL, container) : SelectorEngine__default['default'].children(container, SELECTOR_ACTIVE);
251
+ const active = activeElements[0];
252
+ const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE);
274
253
 
275
- var complete = function complete() {
276
- return _this2._transitionComplete(element, active, callback);
277
- };
254
+ const complete = () => this._transitionComplete(element, active, callback);
278
255
 
279
256
  if (active && isTransitioning) {
280
- var transitionDuration = getTransitionDurationFromElement(active);
257
+ const transitionDuration = getTransitionDurationFromElement(active);
281
258
  active.classList.remove(CLASS_NAME_SHOW);
282
259
  EventHandler__default['default'].one(active, 'transitionend', complete);
283
260
  emulateTransitionEnd(active, transitionDuration);
284
261
  } else {
285
262
  complete();
286
263
  }
287
- };
264
+ }
288
265
 
289
- _proto._transitionComplete = function _transitionComplete(element, active, callback) {
266
+ _transitionComplete(element, active, callback) {
290
267
  if (active) {
291
268
  active.classList.remove(CLASS_NAME_ACTIVE);
292
- var dropdownChild = SelectorEngine__default['default'].findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
269
+ const dropdownChild = SelectorEngine__default['default'].findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
293
270
 
294
271
  if (dropdownChild) {
295
272
  dropdownChild.classList.remove(CLASS_NAME_ACTIVE);
@@ -313,12 +290,10 @@
313
290
  }
314
291
 
315
292
  if (element.parentNode && element.parentNode.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
316
- var dropdownElement = element.closest(SELECTOR_DROPDOWN);
293
+ const dropdownElement = element.closest(SELECTOR_DROPDOWN);
317
294
 
318
295
  if (dropdownElement) {
319
- SelectorEngine__default['default'].find(SELECTOR_DROPDOWN_TOGGLE).forEach(function (dropdown) {
320
- return dropdown.classList.add(CLASS_NAME_ACTIVE);
321
- });
296
+ SelectorEngine__default['default'].find(SELECTOR_DROPDOWN_TOGGLE).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
322
297
  }
323
298
 
324
299
  element.setAttribute('aria-expanded', true);
@@ -328,32 +303,23 @@
328
303
  callback();
329
304
  }
330
305
  } // Static
331
- ;
332
306
 
333
- Tab.jQueryInterface = function jQueryInterface(config) {
307
+
308
+ static jQueryInterface(config) {
334
309
  return this.each(function () {
335
- var data = Data__default['default'].getData(this, DATA_KEY) || new Tab(this);
310
+ const data = Data__default['default'].get(this, DATA_KEY) || new Tab(this);
336
311
 
337
312
  if (typeof config === 'string') {
338
313
  if (typeof data[config] === 'undefined') {
339
- throw new TypeError("No method named \"" + config + "\"");
314
+ throw new TypeError(`No method named "${config}"`);
340
315
  }
341
316
 
342
317
  data[config]();
343
318
  }
344
319
  });
345
- };
346
-
347
- _createClass(Tab, null, [{
348
- key: "DATA_KEY",
349
- get: // Getters
350
- function get() {
351
- return DATA_KEY;
352
- }
353
- }]);
320
+ }
354
321
 
355
- return Tab;
356
- }(BaseComponent__default['default']);
322
+ }
357
323
  /**
358
324
  * ------------------------------------------------------------------------
359
325
  * Data Api implementation
@@ -363,7 +329,7 @@
363
329
 
364
330
  EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
365
331
  event.preventDefault();
366
- var data = Data__default['default'].getData(this, DATA_KEY) || new Tab(this);
332
+ const data = Data__default['default'].get(this, DATA_KEY) || new Tab(this);
367
333
  data.show();
368
334
  });
369
335
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap toast.js v5.0.0-beta2 (https://getbootstrap.com/)
2
+ * Bootstrap toast.js v5.0.0-beta3 (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
  */
@@ -16,85 +16,35 @@
16
16
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
17
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
18
18
 
19
- function _defineProperties(target, props) {
20
- for (var i = 0; i < props.length; i++) {
21
- var descriptor = props[i];
22
- descriptor.enumerable = descriptor.enumerable || false;
23
- descriptor.configurable = true;
24
- if ("value" in descriptor) descriptor.writable = true;
25
- Object.defineProperty(target, descriptor.key, descriptor);
26
- }
27
- }
28
-
29
- function _createClass(Constructor, protoProps, staticProps) {
30
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
31
- if (staticProps) _defineProperties(Constructor, staticProps);
32
- return Constructor;
33
- }
34
-
35
- function _extends() {
36
- _extends = Object.assign || function (target) {
37
- for (var i = 1; i < arguments.length; i++) {
38
- var source = arguments[i];
39
-
40
- for (var key in source) {
41
- if (Object.prototype.hasOwnProperty.call(source, key)) {
42
- target[key] = source[key];
43
- }
44
- }
45
- }
46
-
47
- return target;
48
- };
49
-
50
- return _extends.apply(this, arguments);
51
- }
52
-
53
- function _inheritsLoose(subClass, superClass) {
54
- subClass.prototype = Object.create(superClass.prototype);
55
- subClass.prototype.constructor = subClass;
56
-
57
- _setPrototypeOf(subClass, superClass);
58
- }
59
-
60
- function _setPrototypeOf(o, p) {
61
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
62
- o.__proto__ = p;
63
- return o;
64
- };
65
-
66
- return _setPrototypeOf(o, p);
67
- }
68
-
69
19
  /**
70
20
  * --------------------------------------------------------------------------
71
- * Bootstrap (v5.0.0-beta2): util/index.js
21
+ * Bootstrap (v5.0.0-beta3): util/index.js
72
22
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
73
23
  * --------------------------------------------------------------------------
74
24
  */
75
- var MILLISECONDS_MULTIPLIER = 1000;
76
- var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
25
+ const MILLISECONDS_MULTIPLIER = 1000;
26
+ const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
77
27
 
78
- var toType = function toType(obj) {
28
+ const toType = obj => {
79
29
  if (obj === null || obj === undefined) {
80
- return "" + obj;
30
+ return `${obj}`;
81
31
  }
82
32
 
83
33
  return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
84
34
  };
85
35
 
86
- var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
36
+ const getTransitionDurationFromElement = element => {
87
37
  if (!element) {
88
38
  return 0;
89
39
  } // Get transition-duration of the element
90
40
 
91
41
 
92
- var _window$getComputedSt = window.getComputedStyle(element),
93
- transitionDuration = _window$getComputedSt.transitionDuration,
94
- transitionDelay = _window$getComputedSt.transitionDelay;
95
-
96
- var floatTransitionDuration = Number.parseFloat(transitionDuration);
97
- var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
42
+ let {
43
+ transitionDuration,
44
+ transitionDelay
45
+ } = window.getComputedStyle(element);
46
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
47
+ const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
98
48
 
99
49
  if (!floatTransitionDuration && !floatTransitionDelay) {
100
50
  return 0;
@@ -106,18 +56,16 @@
106
56
  return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
107
57
  };
108
58
 
109
- var triggerTransitionEnd = function triggerTransitionEnd(element) {
59
+ const triggerTransitionEnd = element => {
110
60
  element.dispatchEvent(new Event(TRANSITION_END));
111
61
  };
112
62
 
113
- var isElement = function isElement(obj) {
114
- return (obj[0] || obj).nodeType;
115
- };
63
+ const isElement = obj => (obj[0] || obj).nodeType;
116
64
 
117
- var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
118
- var called = false;
119
- var durationPadding = 5;
120
- var emulatedDuration = duration + durationPadding;
65
+ const emulateTransitionEnd = (element, duration) => {
66
+ let called = false;
67
+ const durationPadding = 5;
68
+ const emulatedDuration = duration + durationPadding;
121
69
 
122
70
  function listener() {
123
71
  called = true;
@@ -125,32 +73,31 @@
125
73
  }
126
74
 
127
75
  element.addEventListener(TRANSITION_END, listener);
128
- setTimeout(function () {
76
+ setTimeout(() => {
129
77
  if (!called) {
130
78
  triggerTransitionEnd(element);
131
79
  }
132
80
  }, emulatedDuration);
133
81
  };
134
82
 
135
- var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
136
- Object.keys(configTypes).forEach(function (property) {
137
- var expectedTypes = configTypes[property];
138
- var value = config[property];
139
- var valueType = value && isElement(value) ? 'element' : toType(value);
83
+ const typeCheckConfig = (componentName, config, configTypes) => {
84
+ Object.keys(configTypes).forEach(property => {
85
+ const expectedTypes = configTypes[property];
86
+ const value = config[property];
87
+ const valueType = value && isElement(value) ? 'element' : toType(value);
140
88
 
141
89
  if (!new RegExp(expectedTypes).test(valueType)) {
142
- throw new TypeError(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
90
+ throw new TypeError(`${componentName.toUpperCase()}: ` + `Option "${property}" provided type "${valueType}" ` + `but expected type "${expectedTypes}".`);
143
91
  }
144
92
  });
145
93
  };
146
94
 
147
- var reflow = function reflow(element) {
148
- return element.offsetHeight;
149
- };
95
+ const reflow = element => element.offsetHeight;
150
96
 
151
- var getjQuery = function getjQuery() {
152
- var _window = window,
153
- jQuery = _window.jQuery;
97
+ const getjQuery = () => {
98
+ const {
99
+ jQuery
100
+ } = window;
154
101
 
155
102
  if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
156
103
  return jQuery;
@@ -159,7 +106,7 @@
159
106
  return null;
160
107
  };
161
108
 
162
- var onDOMContentLoaded = function onDOMContentLoaded(callback) {
109
+ const onDOMContentLoaded = callback => {
163
110
  if (document.readyState === 'loading') {
164
111
  document.addEventListener('DOMContentLoaded', callback);
165
112
  } else {
@@ -167,19 +114,17 @@
167
114
  }
168
115
  };
169
116
 
170
- document.documentElement.dir === 'rtl';
171
-
172
- var defineJQueryPlugin = function defineJQueryPlugin(name, plugin) {
173
- onDOMContentLoaded(function () {
174
- var $ = getjQuery();
117
+ const defineJQueryPlugin = (name, plugin) => {
118
+ onDOMContentLoaded(() => {
119
+ const $ = getjQuery();
175
120
  /* istanbul ignore if */
176
121
 
177
122
  if ($) {
178
- var JQUERY_NO_CONFLICT = $.fn[name];
123
+ const JQUERY_NO_CONFLICT = $.fn[name];
179
124
  $.fn[name] = plugin.jQueryInterface;
180
125
  $.fn[name].Constructor = plugin;
181
126
 
182
- $.fn[name].noConflict = function () {
127
+ $.fn[name].noConflict = () => {
183
128
  $.fn[name] = JQUERY_NO_CONFLICT;
184
129
  return plugin.jQueryInterface;
185
130
  };
@@ -187,64 +132,72 @@
187
132
  });
188
133
  };
189
134
 
135
+ /**
136
+ * --------------------------------------------------------------------------
137
+ * Bootstrap (v5.0.0-beta3): toast.js
138
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
139
+ * --------------------------------------------------------------------------
140
+ */
190
141
  /**
191
142
  * ------------------------------------------------------------------------
192
143
  * Constants
193
144
  * ------------------------------------------------------------------------
194
145
  */
195
146
 
196
- var NAME = 'toast';
197
- var DATA_KEY = 'bs.toast';
198
- var EVENT_KEY = "." + DATA_KEY;
199
- var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
200
- var EVENT_HIDE = "hide" + EVENT_KEY;
201
- var EVENT_HIDDEN = "hidden" + EVENT_KEY;
202
- var EVENT_SHOW = "show" + EVENT_KEY;
203
- var EVENT_SHOWN = "shown" + EVENT_KEY;
204
- var CLASS_NAME_FADE = 'fade';
205
- var CLASS_NAME_HIDE = 'hide';
206
- var CLASS_NAME_SHOW = 'show';
207
- var CLASS_NAME_SHOWING = 'showing';
208
- var DefaultType = {
147
+ const NAME = 'toast';
148
+ const DATA_KEY = 'bs.toast';
149
+ const EVENT_KEY = `.${DATA_KEY}`;
150
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
151
+ const EVENT_HIDE = `hide${EVENT_KEY}`;
152
+ const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
153
+ const EVENT_SHOW = `show${EVENT_KEY}`;
154
+ const EVENT_SHOWN = `shown${EVENT_KEY}`;
155
+ const CLASS_NAME_FADE = 'fade';
156
+ const CLASS_NAME_HIDE = 'hide';
157
+ const CLASS_NAME_SHOW = 'show';
158
+ const CLASS_NAME_SHOWING = 'showing';
159
+ const DefaultType = {
209
160
  animation: 'boolean',
210
161
  autohide: 'boolean',
211
162
  delay: 'number'
212
163
  };
213
- var Default = {
164
+ const Default = {
214
165
  animation: true,
215
166
  autohide: true,
216
167
  delay: 5000
217
168
  };
218
- var SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
169
+ const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
219
170
  /**
220
171
  * ------------------------------------------------------------------------
221
172
  * Class Definition
222
173
  * ------------------------------------------------------------------------
223
174
  */
224
175
 
225
- var Toast = /*#__PURE__*/function (_BaseComponent) {
226
- _inheritsLoose(Toast, _BaseComponent);
227
-
228
- function Toast(element, config) {
229
- var _this;
176
+ class Toast extends BaseComponent__default['default'] {
177
+ constructor(element, config) {
178
+ super(element);
179
+ this._config = this._getConfig(config);
180
+ this._timeout = null;
230
181
 
231
- _this = _BaseComponent.call(this, element) || this;
232
- _this._config = _this._getConfig(config);
233
- _this._timeout = null;
182
+ this._setListeners();
183
+ } // Getters
234
184
 
235
- _this._setListeners();
236
185
 
237
- return _this;
238
- } // Getters
186
+ static get DefaultType() {
187
+ return DefaultType;
188
+ }
239
189
 
190
+ static get Default() {
191
+ return Default;
192
+ }
240
193
 
241
- var _proto = Toast.prototype;
194
+ static get DATA_KEY() {
195
+ return DATA_KEY;
196
+ } // Public
242
197
 
243
- // Public
244
- _proto.show = function show() {
245
- var _this2 = this;
246
198
 
247
- var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
199
+ show() {
200
+ const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
248
201
 
249
202
  if (showEvent.defaultPrevented) {
250
203
  return;
@@ -256,17 +209,17 @@
256
209
  this._element.classList.add(CLASS_NAME_FADE);
257
210
  }
258
211
 
259
- var complete = function complete() {
260
- _this2._element.classList.remove(CLASS_NAME_SHOWING);
212
+ const complete = () => {
213
+ this._element.classList.remove(CLASS_NAME_SHOWING);
261
214
 
262
- _this2._element.classList.add(CLASS_NAME_SHOW);
215
+ this._element.classList.add(CLASS_NAME_SHOW);
263
216
 
264
- EventHandler__default['default'].trigger(_this2._element, EVENT_SHOWN);
217
+ EventHandler__default['default'].trigger(this._element, EVENT_SHOWN);
265
218
 
266
- if (_this2._config.autohide) {
267
- _this2._timeout = setTimeout(function () {
268
- _this2.hide();
269
- }, _this2._config.delay);
219
+ if (this._config.autohide) {
220
+ this._timeout = setTimeout(() => {
221
+ this.hide();
222
+ }, this._config.delay);
270
223
  }
271
224
  };
272
225
 
@@ -277,45 +230,43 @@
277
230
  this._element.classList.add(CLASS_NAME_SHOWING);
278
231
 
279
232
  if (this._config.animation) {
280
- var transitionDuration = getTransitionDurationFromElement(this._element);
233
+ const transitionDuration = getTransitionDurationFromElement(this._element);
281
234
  EventHandler__default['default'].one(this._element, 'transitionend', complete);
282
235
  emulateTransitionEnd(this._element, transitionDuration);
283
236
  } else {
284
237
  complete();
285
238
  }
286
- };
287
-
288
- _proto.hide = function hide() {
289
- var _this3 = this;
239
+ }
290
240
 
241
+ hide() {
291
242
  if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
292
243
  return;
293
244
  }
294
245
 
295
- var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
246
+ const hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
296
247
 
297
248
  if (hideEvent.defaultPrevented) {
298
249
  return;
299
250
  }
300
251
 
301
- var complete = function complete() {
302
- _this3._element.classList.add(CLASS_NAME_HIDE);
252
+ const complete = () => {
253
+ this._element.classList.add(CLASS_NAME_HIDE);
303
254
 
304
- EventHandler__default['default'].trigger(_this3._element, EVENT_HIDDEN);
255
+ EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN);
305
256
  };
306
257
 
307
258
  this._element.classList.remove(CLASS_NAME_SHOW);
308
259
 
309
260
  if (this._config.animation) {
310
- var transitionDuration = getTransitionDurationFromElement(this._element);
261
+ const transitionDuration = getTransitionDurationFromElement(this._element);
311
262
  EventHandler__default['default'].one(this._element, 'transitionend', complete);
312
263
  emulateTransitionEnd(this._element, transitionDuration);
313
264
  } else {
314
265
  complete();
315
266
  }
316
- };
267
+ }
317
268
 
318
- _proto.dispose = function dispose() {
269
+ dispose() {
319
270
  this._clearTimeout();
320
271
 
321
272
  if (this._element.classList.contains(CLASS_NAME_SHOW)) {
@@ -323,38 +274,35 @@
323
274
  }
324
275
 
325
276
  EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
326
-
327
- _BaseComponent.prototype.dispose.call(this);
328
-
277
+ super.dispose();
329
278
  this._config = null;
330
279
  } // Private
331
- ;
332
280
 
333
- _proto._getConfig = function _getConfig(config) {
334
- config = _extends({}, Default, Manipulator__default['default'].getDataAttributes(this._element), typeof config === 'object' && config ? config : {});
281
+
282
+ _getConfig(config) {
283
+ config = { ...Default,
284
+ ...Manipulator__default['default'].getDataAttributes(this._element),
285
+ ...(typeof config === 'object' && config ? config : {})
286
+ };
335
287
  typeCheckConfig(NAME, config, this.constructor.DefaultType);
336
288
  return config;
337
- };
338
-
339
- _proto._setListeners = function _setListeners() {
340
- var _this4 = this;
289
+ }
341
290
 
342
- EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
343
- return _this4.hide();
344
- });
345
- };
291
+ _setListeners() {
292
+ EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
293
+ }
346
294
 
347
- _proto._clearTimeout = function _clearTimeout() {
295
+ _clearTimeout() {
348
296
  clearTimeout(this._timeout);
349
297
  this._timeout = null;
350
298
  } // Static
351
- ;
352
299
 
353
- Toast.jQueryInterface = function jQueryInterface(config) {
300
+
301
+ static jQueryInterface(config) {
354
302
  return this.each(function () {
355
- var data = Data__default['default'].getData(this, DATA_KEY);
303
+ let data = Data__default['default'].get(this, DATA_KEY);
356
304
 
357
- var _config = typeof config === 'object' && config;
305
+ const _config = typeof config === 'object' && config;
358
306
 
359
307
  if (!data) {
360
308
  data = new Toast(this, _config);
@@ -362,33 +310,15 @@
362
310
 
363
311
  if (typeof config === 'string') {
364
312
  if (typeof data[config] === 'undefined') {
365
- throw new TypeError("No method named \"" + config + "\"");
313
+ throw new TypeError(`No method named "${config}"`);
366
314
  }
367
315
 
368
316
  data[config](this);
369
317
  }
370
318
  });
371
- };
372
-
373
- _createClass(Toast, null, [{
374
- key: "DefaultType",
375
- get: function get() {
376
- return DefaultType;
377
- }
378
- }, {
379
- key: "Default",
380
- get: function get() {
381
- return Default;
382
- }
383
- }, {
384
- key: "DATA_KEY",
385
- get: function get() {
386
- return DATA_KEY;
387
- }
388
- }]);
319
+ }
389
320
 
390
- return Toast;
391
- }(BaseComponent__default['default']);
321
+ }
392
322
  /**
393
323
  * ------------------------------------------------------------------------
394
324
  * jQuery