bootstrap 5.0.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap/alert.js +78 -48
  4. data/assets/javascripts/bootstrap/base-component.js +22 -17
  5. data/assets/javascripts/bootstrap/button.js +19 -12
  6. data/assets/javascripts/bootstrap/carousel.js +66 -44
  7. data/assets/javascripts/bootstrap/collapse.js +114 -131
  8. data/assets/javascripts/bootstrap/dom/data.js +5 -5
  9. data/assets/javascripts/bootstrap/dom/event-handler.js +11 -5
  10. data/assets/javascripts/bootstrap/dom/manipulator.js +6 -6
  11. data/assets/javascripts/bootstrap/dom/selector-engine.js +49 -7
  12. data/assets/javascripts/bootstrap/dropdown.js +96 -106
  13. data/assets/javascripts/bootstrap/modal.js +241 -87
  14. data/assets/javascripts/bootstrap/offcanvas.js +203 -57
  15. data/assets/javascripts/bootstrap/popover.js +25 -58
  16. data/assets/javascripts/bootstrap/scrollspy.js +47 -66
  17. data/assets/javascripts/bootstrap/tab.js +41 -22
  18. data/assets/javascripts/bootstrap/toast.js +124 -29
  19. data/assets/javascripts/bootstrap/tooltip.js +122 -104
  20. data/assets/javascripts/bootstrap-sprockets.js +7 -7
  21. data/assets/javascripts/bootstrap.js +660 -630
  22. data/assets/javascripts/bootstrap.min.js +2 -2
  23. data/assets/stylesheets/_bootstrap-grid.scss +3 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +2 -4
  25. data/assets/stylesheets/_bootstrap.scss +2 -1
  26. data/assets/stylesheets/bootstrap/_card.scss +2 -1
  27. data/assets/stylesheets/bootstrap/_functions.scss +51 -12
  28. data/assets/stylesheets/bootstrap/_grid.scss +11 -0
  29. data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
  30. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  31. data/assets/stylesheets/bootstrap/_modal.scss +1 -11
  32. data/assets/stylesheets/bootstrap/_navbar.scss +30 -1
  33. data/assets/stylesheets/bootstrap/_offcanvas.scss +4 -0
  34. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  35. data/assets/stylesheets/bootstrap/_reboot.scss +12 -8
  36. data/assets/stylesheets/bootstrap/_root.scss +40 -2
  37. data/assets/stylesheets/bootstrap/_tables.scss +8 -4
  38. data/assets/stylesheets/bootstrap/_toasts.scss +2 -2
  39. data/assets/stylesheets/bootstrap/_transitions.scss +6 -0
  40. data/assets/stylesheets/bootstrap/_utilities.scss +44 -8
  41. data/assets/stylesheets/bootstrap/_variables.scss +184 -11
  42. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  43. data/assets/stylesheets/bootstrap/forms/_form-control.scss +1 -1
  44. data/assets/stylesheets/bootstrap/forms/_form-select.scss +2 -0
  45. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  46. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  47. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  48. data/assets/stylesheets/bootstrap/mixins/_grid.scss +29 -10
  49. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +27 -6
  50. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +1 -1
  51. data/bootstrap.gemspec +3 -3
  52. data/lib/bootstrap/version.rb +2 -2
  53. data/tasks/updater/js.rb +6 -2
  54. metadata +12 -8
@@ -1,21 +1,28 @@
1
1
  /*!
2
- * Bootstrap collapse.js v5.0.2 (https://getbootstrap.com/)
2
+ * Bootstrap collapse.js v5.1.3 (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
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/selector-engine.js'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./base-component.js')) :
8
- typeof define === 'function' && define.amd ? define(['./dom/selector-engine', './dom/data', './dom/event-handler', './dom/manipulator', './base-component'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.SelectorEngine, global.Data, global.EventHandler, global.Manipulator, global.Base));
10
- }(this, (function (SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
+ })(this, (function (Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
11
11
 
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+ const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
13
13
 
14
- var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
15
- var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
16
- var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
17
- var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
18
- var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
14
+ const Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
+ const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
+ const Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
+ const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
18
+ const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
19
+
20
+ /**
21
+ * --------------------------------------------------------------------------
22
+ * Bootstrap (v5.1.3): util/index.js
23
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
+ * --------------------------------------------------------------------------
25
+ */
19
26
 
20
27
  const toType = obj => {
21
28
  if (obj === null || obj === undefined) {
@@ -83,7 +90,7 @@
83
90
  }
84
91
 
85
92
  if (typeof obj === 'string' && obj.length > 0) {
86
- return SelectorEngine__default['default'].findOne(obj);
93
+ return document.querySelector(obj);
87
94
  }
88
95
 
89
96
  return null;
@@ -100,8 +107,20 @@
100
107
  }
101
108
  });
102
109
  };
110
+ /**
111
+ * Trick to restart an element's animation
112
+ *
113
+ * @param {HTMLElement} element
114
+ * @return void
115
+ *
116
+ * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
117
+ */
118
+
103
119
 
104
- const reflow = element => element.offsetHeight;
120
+ const reflow = element => {
121
+ // eslint-disable-next-line no-unused-expressions
122
+ element.offsetHeight;
123
+ };
105
124
 
106
125
  const getjQuery = () => {
107
126
  const {
@@ -153,7 +172,7 @@
153
172
 
154
173
  /**
155
174
  * --------------------------------------------------------------------------
156
- * Bootstrap (v5.0.2): collapse.js
175
+ * Bootstrap (v5.1.3): collapse.js
157
176
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
158
177
  * --------------------------------------------------------------------------
159
178
  */
@@ -169,11 +188,11 @@
169
188
  const DATA_API_KEY = '.data-api';
170
189
  const Default = {
171
190
  toggle: true,
172
- parent: ''
191
+ parent: null
173
192
  };
174
193
  const DefaultType = {
175
194
  toggle: 'boolean',
176
- parent: '(string|element)'
195
+ parent: '(null|element)'
177
196
  };
178
197
  const EVENT_SHOW = `show${EVENT_KEY}`;
179
198
  const EVENT_SHOWN = `shown${EVENT_KEY}`;
@@ -184,9 +203,11 @@
184
203
  const CLASS_NAME_COLLAPSE = 'collapse';
185
204
  const CLASS_NAME_COLLAPSING = 'collapsing';
186
205
  const CLASS_NAME_COLLAPSED = 'collapsed';
206
+ const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
207
+ const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
187
208
  const WIDTH = 'width';
188
209
  const HEIGHT = 'height';
189
- const SELECTOR_ACTIVES = '.show, .collapsing';
210
+ const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
190
211
  const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]';
191
212
  /**
192
213
  * ------------------------------------------------------------------------
@@ -194,18 +215,18 @@
194
215
  * ------------------------------------------------------------------------
195
216
  */
196
217
 
197
- class Collapse extends BaseComponent__default['default'] {
218
+ class Collapse extends BaseComponent__default.default {
198
219
  constructor(element, config) {
199
220
  super(element);
200
221
  this._isTransitioning = false;
201
222
  this._config = this._getConfig(config);
202
- this._triggerArray = SelectorEngine__default['default'].find(`${SELECTOR_DATA_TOGGLE}[href="#${this._element.id}"],` + `${SELECTOR_DATA_TOGGLE}[data-bs-target="#${this._element.id}"]`);
203
- const toggleList = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
223
+ this._triggerArray = [];
224
+ const toggleList = SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE);
204
225
 
205
226
  for (let i = 0, len = toggleList.length; i < len; i++) {
206
227
  const elem = toggleList[i];
207
228
  const selector = getSelectorFromElement(elem);
208
- const filterElement = SelectorEngine__default['default'].find(selector).filter(foundElem => foundElem === this._element);
229
+ const filterElement = SelectorEngine__default.default.find(selector).filter(foundElem => foundElem === this._element);
209
230
 
210
231
  if (selector !== null && filterElement.length) {
211
232
  this._selector = selector;
@@ -214,10 +235,10 @@
214
235
  }
215
236
  }
216
237
 
217
- this._parent = this._config.parent ? this._getParent() : null;
238
+ this._initializeChildren();
218
239
 
219
240
  if (!this._config.parent) {
220
- this._addAriaAndCollapsedClass(this._element, this._triggerArray);
241
+ this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
221
242
  }
222
243
 
223
244
  if (this._config.toggle) {
@@ -236,7 +257,7 @@
236
257
 
237
258
 
238
259
  toggle() {
239
- if (this._element.classList.contains(CLASS_NAME_SHOW)) {
260
+ if (this._isShown()) {
240
261
  this.hide();
241
262
  } else {
242
263
  this.show();
@@ -244,30 +265,21 @@
244
265
  }
245
266
 
246
267
  show() {
247
- if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
268
+ if (this._isTransitioning || this._isShown()) {
248
269
  return;
249
270
  }
250
271
 
251
- let actives;
272
+ let actives = [];
252
273
  let activesData;
253
274
 
254
- if (this._parent) {
255
- actives = SelectorEngine__default['default'].find(SELECTOR_ACTIVES, this._parent).filter(elem => {
256
- if (typeof this._config.parent === 'string') {
257
- return elem.getAttribute('data-bs-parent') === this._config.parent;
258
- }
259
-
260
- return elem.classList.contains(CLASS_NAME_COLLAPSE);
261
- });
262
-
263
- if (actives.length === 0) {
264
- actives = null;
265
- }
275
+ if (this._config.parent) {
276
+ const children = SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
277
+ actives = SelectorEngine__default.default.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
266
278
  }
267
279
 
268
- const container = SelectorEngine__default['default'].findOne(this._selector);
280
+ const container = SelectorEngine__default.default.findOne(this._selector);
269
281
 
270
- if (actives) {
282
+ if (actives.length) {
271
283
  const tempActiveData = actives.find(elem => container !== elem);
272
284
  activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
273
285
 
@@ -276,23 +288,23 @@
276
288
  }
277
289
  }
278
290
 
279
- const startEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
291
+ const startEvent = EventHandler__default.default.trigger(this._element, EVENT_SHOW);
280
292
 
281
293
  if (startEvent.defaultPrevented) {
282
294
  return;
283
295
  }
284
296
 
285
- if (actives) {
286
- actives.forEach(elemActive => {
287
- if (container !== elemActive) {
288
- Collapse.collapseInterface(elemActive, 'hide');
289
- }
297
+ actives.forEach(elemActive => {
298
+ if (container !== elemActive) {
299
+ Collapse.getOrCreateInstance(elemActive, {
300
+ toggle: false
301
+ }).hide();
302
+ }
290
303
 
291
- if (!activesData) {
292
- Data__default['default'].set(elemActive, DATA_KEY, null);
293
- }
294
- });
295
- }
304
+ if (!activesData) {
305
+ Data__default.default.set(elemActive, DATA_KEY, null);
306
+ }
307
+ });
296
308
 
297
309
  const dimension = this._getDimension();
298
310
 
@@ -302,23 +314,19 @@
302
314
 
303
315
  this._element.style[dimension] = 0;
304
316
 
305
- if (this._triggerArray.length) {
306
- this._triggerArray.forEach(element => {
307
- element.classList.remove(CLASS_NAME_COLLAPSED);
308
- element.setAttribute('aria-expanded', true);
309
- });
310
- }
317
+ this._addAriaAndCollapsedClass(this._triggerArray, true);
311
318
 
312
- this.setTransitioning(true);
319
+ this._isTransitioning = true;
313
320
 
314
321
  const complete = () => {
322
+ this._isTransitioning = false;
323
+
315
324
  this._element.classList.remove(CLASS_NAME_COLLAPSING);
316
325
 
317
326
  this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
318
327
 
319
328
  this._element.style[dimension] = '';
320
- this.setTransitioning(false);
321
- EventHandler__default['default'].trigger(this._element, EVENT_SHOWN);
329
+ EventHandler__default.default.trigger(this._element, EVENT_SHOWN);
322
330
  };
323
331
 
324
332
  const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
@@ -330,11 +338,11 @@
330
338
  }
331
339
 
332
340
  hide() {
333
- if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
341
+ if (this._isTransitioning || !this._isShown()) {
334
342
  return;
335
343
  }
336
344
 
337
- const startEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
345
+ const startEvent = EventHandler__default.default.trigger(this._element, EVENT_HIDE);
338
346
 
339
347
  if (startEvent.defaultPrevented) {
340
348
  return;
@@ -351,28 +359,25 @@
351
359
 
352
360
  const triggerArrayLength = this._triggerArray.length;
353
361
 
354
- if (triggerArrayLength > 0) {
355
- for (let i = 0; i < triggerArrayLength; i++) {
356
- const trigger = this._triggerArray[i];
357
- const elem = getElementFromSelector(trigger);
362
+ for (let i = 0; i < triggerArrayLength; i++) {
363
+ const trigger = this._triggerArray[i];
364
+ const elem = getElementFromSelector(trigger);
358
365
 
359
- if (elem && !elem.classList.contains(CLASS_NAME_SHOW)) {
360
- trigger.classList.add(CLASS_NAME_COLLAPSED);
361
- trigger.setAttribute('aria-expanded', false);
362
- }
366
+ if (elem && !this._isShown(elem)) {
367
+ this._addAriaAndCollapsedClass([trigger], false);
363
368
  }
364
369
  }
365
370
 
366
- this.setTransitioning(true);
371
+ this._isTransitioning = true;
367
372
 
368
373
  const complete = () => {
369
- this.setTransitioning(false);
374
+ this._isTransitioning = false;
370
375
 
371
376
  this._element.classList.remove(CLASS_NAME_COLLAPSING);
372
377
 
373
378
  this._element.classList.add(CLASS_NAME_COLLAPSE);
374
379
 
375
- EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN);
380
+ EventHandler__default.default.trigger(this._element, EVENT_HIDDEN);
376
381
  };
377
382
 
378
383
  this._element.style[dimension] = '';
@@ -380,45 +385,47 @@
380
385
  this._queueCallback(complete, this._element, true);
381
386
  }
382
387
 
383
- setTransitioning(isTransitioning) {
384
- this._isTransitioning = isTransitioning;
388
+ _isShown(element = this._element) {
389
+ return element.classList.contains(CLASS_NAME_SHOW);
385
390
  } // Private
386
391
 
387
392
 
388
393
  _getConfig(config) {
389
394
  config = { ...Default,
395
+ ...Manipulator__default.default.getDataAttributes(this._element),
390
396
  ...config
391
397
  };
392
398
  config.toggle = Boolean(config.toggle); // Coerce string values
393
399
 
400
+ config.parent = getElement(config.parent);
394
401
  typeCheckConfig(NAME, config, DefaultType);
395
402
  return config;
396
403
  }
397
404
 
398
405
  _getDimension() {
399
- return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
406
+ return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
400
407
  }
401
408
 
402
- _getParent() {
403
- let {
404
- parent
405
- } = this._config;
406
- parent = getElement(parent);
407
- const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`;
408
- SelectorEngine__default['default'].find(selector, parent).forEach(element => {
409
+ _initializeChildren() {
410
+ if (!this._config.parent) {
411
+ return;
412
+ }
413
+
414
+ const children = SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
415
+ SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
409
416
  const selected = getElementFromSelector(element);
410
417
 
411
- this._addAriaAndCollapsedClass(selected, [element]);
418
+ if (selected) {
419
+ this._addAriaAndCollapsedClass([element], this._isShown(selected));
420
+ }
412
421
  });
413
- return parent;
414
422
  }
415
423
 
416
- _addAriaAndCollapsedClass(element, triggerArray) {
417
- if (!element || !triggerArray.length) {
424
+ _addAriaAndCollapsedClass(triggerArray, isOpen) {
425
+ if (!triggerArray.length) {
418
426
  return;
419
427
  }
420
428
 
421
- const isOpen = element.classList.contains(CLASS_NAME_SHOW);
422
429
  triggerArray.forEach(elem => {
423
430
  if (isOpen) {
424
431
  elem.classList.remove(CLASS_NAME_COLLAPSED);
@@ -431,33 +438,23 @@
431
438
  } // Static
432
439
 
433
440
 
434
- static collapseInterface(element, config) {
435
- let data = Collapse.getInstance(element);
436
- const _config = { ...Default,
437
- ...Manipulator__default['default'].getDataAttributes(element),
438
- ...(typeof config === 'object' && config ? config : {})
439
- };
440
-
441
- if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
442
- _config.toggle = false;
443
- }
444
-
445
- if (!data) {
446
- data = new Collapse(element, _config);
447
- }
441
+ static jQueryInterface(config) {
442
+ return this.each(function () {
443
+ const _config = {};
448
444
 
449
- if (typeof config === 'string') {
450
- if (typeof data[config] === 'undefined') {
451
- throw new TypeError(`No method named "${config}"`);
445
+ if (typeof config === 'string' && /show|hide/.test(config)) {
446
+ _config.toggle = false;
452
447
  }
453
448
 
454
- data[config]();
455
- }
456
- }
449
+ const data = Collapse.getOrCreateInstance(this, _config);
457
450
 
458
- static jQueryInterface(config) {
459
- return this.each(function () {
460
- Collapse.collapseInterface(this, config);
451
+ if (typeof config === 'string') {
452
+ if (typeof data[config] === 'undefined') {
453
+ throw new TypeError(`No method named "${config}"`);
454
+ }
455
+
456
+ data[config]();
457
+ }
461
458
  });
462
459
  }
463
460
 
@@ -469,32 +466,18 @@
469
466
  */
470
467
 
471
468
 
472
- EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
469
+ EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
473
470
  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
474
471
  if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
475
472
  event.preventDefault();
476
473
  }
477
474
 
478
- const triggerData = Manipulator__default['default'].getDataAttributes(this);
479
475
  const selector = getSelectorFromElement(this);
480
- const selectorElements = SelectorEngine__default['default'].find(selector);
476
+ const selectorElements = SelectorEngine__default.default.find(selector);
481
477
  selectorElements.forEach(element => {
482
- const data = Collapse.getInstance(element);
483
- let config;
484
-
485
- if (data) {
486
- // update parent attribute
487
- if (data._parent === null && typeof triggerData.parent === 'string') {
488
- data._config.parent = triggerData.parent;
489
- data._parent = data._getParent();
490
- }
491
-
492
- config = 'toggle';
493
- } else {
494
- config = triggerData;
495
- }
496
-
497
- Collapse.collapseInterface(element, config);
478
+ Collapse.getOrCreateInstance(element, {
479
+ toggle: false
480
+ }).toggle();
498
481
  });
499
482
  });
500
483
  /**
@@ -508,4 +491,4 @@
508
491
 
509
492
  return Collapse;
510
493
 
511
- })));
494
+ }));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap data.js v5.0.2 (https://getbootstrap.com/)
2
+ * Bootstrap data.js v5.1.3 (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
  */
@@ -7,11 +7,11 @@
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
8
  typeof define === 'function' && define.amd ? define(factory) :
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Data = factory());
10
- }(this, (function () { 'use strict';
10
+ })(this, (function () { 'use strict';
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.2): dom/data.js
14
+ * Bootstrap (v5.1.3): dom/data.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -22,7 +22,7 @@
22
22
  * ------------------------------------------------------------------------
23
23
  */
24
24
  const elementMap = new Map();
25
- var data = {
25
+ const data = {
26
26
  set(element, key, instance) {
27
27
  if (!elementMap.has(element)) {
28
28
  elementMap.set(element, new Map());
@@ -65,4 +65,4 @@
65
65
 
66
66
  return data;
67
67
 
68
- })));
68
+ }));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap event-handler.js v5.0.2 (https://getbootstrap.com/)
2
+ * Bootstrap event-handler.js v5.1.3 (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
  */
@@ -7,7 +7,14 @@
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
8
  typeof define === 'function' && define.amd ? define(factory) :
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory());
10
- }(this, (function () { 'use strict';
10
+ })(this, (function () { 'use strict';
11
+
12
+ /**
13
+ * --------------------------------------------------------------------------
14
+ * Bootstrap (v5.1.3): util/index.js
15
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
+ * --------------------------------------------------------------------------
17
+ */
11
18
 
12
19
  const getjQuery = () => {
13
20
  const {
@@ -23,7 +30,7 @@
23
30
 
24
31
  /**
25
32
  * --------------------------------------------------------------------------
26
- * Bootstrap (v5.0.2): dom/event-handler.js
33
+ * Bootstrap (v5.1.3): dom/event-handler.js
27
34
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
28
35
  * --------------------------------------------------------------------------
29
36
  */
@@ -86,7 +93,6 @@
86
93
  event.delegateTarget = target;
87
94
 
88
95
  if (handler.oneOff) {
89
- // eslint-disable-next-line unicorn/consistent-destructuring
90
96
  EventHandler.off(element, event.type, selector, fn);
91
97
  }
92
98
 
@@ -312,4 +318,4 @@
312
318
 
313
319
  return EventHandler;
314
320
 
315
- })));
321
+ }));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap manipulator.js v5.0.2 (https://getbootstrap.com/)
2
+ * Bootstrap manipulator.js v5.1.3 (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
  */
@@ -7,11 +7,11 @@
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
8
  typeof define === 'function' && define.amd ? define(factory) :
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Manipulator = factory());
10
- }(this, (function () { 'use strict';
10
+ })(this, (function () { 'use strict';
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.2): dom/manipulator.js
14
+ * Bootstrap (v5.1.3): dom/manipulator.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -69,8 +69,8 @@
69
69
  offset(element) {
70
70
  const rect = element.getBoundingClientRect();
71
71
  return {
72
- top: rect.top + document.body.scrollTop,
73
- left: rect.left + document.body.scrollLeft
72
+ top: rect.top + window.pageYOffset,
73
+ left: rect.left + window.pageXOffset
74
74
  };
75
75
  },
76
76
 
@@ -85,4 +85,4 @@
85
85
 
86
86
  return Manipulator;
87
87
 
88
- })));
88
+ }));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap selector-engine.js v5.0.2 (https://getbootstrap.com/)
2
+ * Bootstrap selector-engine.js v5.1.3 (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
  */
@@ -7,19 +7,56 @@
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
8
  typeof define === 'function' && define.amd ? define(factory) :
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory());
10
- }(this, (function () { 'use strict';
10
+ })(this, (function () { 'use strict';
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.2): dom/selector-engine.js
14
+ * Bootstrap (v5.1.3): util/index.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
18
18
 
19
+ const isElement = obj => {
20
+ if (!obj || typeof obj !== 'object') {
21
+ return false;
22
+ }
23
+
24
+ if (typeof obj.jquery !== 'undefined') {
25
+ obj = obj[0];
26
+ }
27
+
28
+ return typeof obj.nodeType !== 'undefined';
29
+ };
30
+
31
+ const isVisible = element => {
32
+ if (!isElement(element) || element.getClientRects().length === 0) {
33
+ return false;
34
+ }
35
+
36
+ return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
37
+ };
38
+
39
+ const isDisabled = element => {
40
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) {
41
+ return true;
42
+ }
43
+
44
+ if (element.classList.contains('disabled')) {
45
+ return true;
46
+ }
47
+
48
+ if (typeof element.disabled !== 'undefined') {
49
+ return element.disabled;
50
+ }
51
+
52
+ return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
53
+ };
54
+
19
55
  /**
20
- * ------------------------------------------------------------------------
21
- * Constants
22
- * ------------------------------------------------------------------------
56
+ * --------------------------------------------------------------------------
57
+ * Bootstrap (v5.1.3): dom/selector-engine.js
58
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
59
+ * --------------------------------------------------------------------------
23
60
  */
24
61
  const NODE_TEXT = 3;
25
62
  const SelectorEngine = {
@@ -76,10 +113,15 @@
76
113
  }
77
114
 
78
115
  return [];
116
+ },
117
+
118
+ focusableChildren(element) {
119
+ const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
120
+ return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
79
121
  }
80
122
 
81
123
  };
82
124
 
83
125
  return SelectorEngine;
84
126
 
85
- })));
127
+ }));