bootstrap 5.0.0 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) 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 +329 -377
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +13 -73
  7. data/assets/javascripts/bootstrap/base-component.js +115 -10
  8. data/assets/javascripts/bootstrap/button.js +11 -17
  9. data/assets/javascripts/bootstrap/carousel.js +35 -85
  10. data/assets/javascripts/bootstrap/collapse.js +34 -82
  11. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +2 -9
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
  15. data/assets/javascripts/bootstrap/dropdown.js +41 -38
  16. data/assets/javascripts/bootstrap/modal.js +31 -43
  17. data/assets/javascripts/bootstrap/offcanvas.js +25 -25
  18. data/assets/javascripts/bootstrap/popover.js +11 -25
  19. data/assets/javascripts/bootstrap/scrollspy.js +26 -21
  20. data/assets/javascripts/bootstrap/tab.js +14 -68
  21. data/assets/javascripts/bootstrap/toast.js +69 -77
  22. data/assets/javascripts/bootstrap/tooltip.js +71 -135
  23. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  25. data/assets/stylesheets/_bootstrap.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_list-group.scss +5 -5
  27. data/assets/stylesheets/bootstrap/_modal.scss +2 -11
  28. data/assets/stylesheets/bootstrap/_tables.scss +1 -0
  29. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  30. data/assets/stylesheets/bootstrap/forms/_form-control.scss +5 -5
  31. data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -1
  32. data/lib/bootstrap/version.rb +2 -2
  33. metadata +2 -2
@@ -1,31 +1,22 @@
1
1
  /*!
2
- * Bootstrap collapse.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap collapse.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
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('./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';
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';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
14
15
  var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
16
  var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
17
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
- var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
18
18
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
19
19
 
20
- /**
21
- * --------------------------------------------------------------------------
22
- * Bootstrap (v5.0.0): util/index.js
23
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
- * --------------------------------------------------------------------------
25
- */
26
- const MILLISECONDS_MULTIPLIER = 1000;
27
- const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
28
-
29
20
  const toType = obj => {
30
21
  if (obj === null || obj === undefined) {
31
22
  return `${obj}`;
@@ -73,51 +64,29 @@
73
64
  return selector ? document.querySelector(selector) : null;
74
65
  };
75
66
 
76
- const getTransitionDurationFromElement = element => {
77
- if (!element) {
78
- return 0;
79
- } // Get transition-duration of the element
80
-
81
-
82
- let {
83
- transitionDuration,
84
- transitionDelay
85
- } = window.getComputedStyle(element);
86
- const floatTransitionDuration = Number.parseFloat(transitionDuration);
87
- const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
88
-
89
- if (!floatTransitionDuration && !floatTransitionDelay) {
90
- return 0;
91
- } // If multiple durations are defined, take the first
92
-
67
+ const isElement = obj => {
68
+ if (!obj || typeof obj !== 'object') {
69
+ return false;
70
+ }
93
71
 
94
- transitionDuration = transitionDuration.split(',')[0];
95
- transitionDelay = transitionDelay.split(',')[0];
96
- return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
97
- };
72
+ if (typeof obj.jquery !== 'undefined') {
73
+ obj = obj[0];
74
+ }
98
75
 
99
- const triggerTransitionEnd = element => {
100
- element.dispatchEvent(new Event(TRANSITION_END));
76
+ return typeof obj.nodeType !== 'undefined';
101
77
  };
102
78
 
103
- const isElement = obj => (obj[0] || obj).nodeType;
104
-
105
- const emulateTransitionEnd = (element, duration) => {
106
- let called = false;
107
- const durationPadding = 5;
108
- const emulatedDuration = duration + durationPadding;
79
+ const getElement = obj => {
80
+ if (isElement(obj)) {
81
+ // it's a jQuery object or a node element
82
+ return obj.jquery ? obj[0] : obj;
83
+ }
109
84
 
110
- function listener() {
111
- called = true;
112
- element.removeEventListener(TRANSITION_END, listener);
85
+ if (typeof obj === 'string' && obj.length > 0) {
86
+ return SelectorEngine__default['default'].findOne(obj);
113
87
  }
114
88
 
115
- element.addEventListener(TRANSITION_END, listener);
116
- setTimeout(() => {
117
- if (!called) {
118
- triggerTransitionEnd(element);
119
- }
120
- }, emulatedDuration);
89
+ return null;
121
90
  };
122
91
 
123
92
  const typeCheckConfig = (componentName, config, configTypes) => {
@@ -154,12 +123,13 @@
154
123
  }
155
124
  };
156
125
 
157
- const defineJQueryPlugin = (name, plugin) => {
126
+ const defineJQueryPlugin = plugin => {
158
127
  onDOMContentLoaded(() => {
159
128
  const $ = getjQuery();
160
129
  /* istanbul ignore if */
161
130
 
162
131
  if ($) {
132
+ const name = plugin.NAME;
163
133
  const JQUERY_NO_CONFLICT = $.fn[name];
164
134
  $.fn[name] = plugin.jQueryInterface;
165
135
  $.fn[name].Constructor = plugin;
@@ -174,7 +144,7 @@
174
144
 
175
145
  /**
176
146
  * --------------------------------------------------------------------------
177
- * Bootstrap (v5.0.0): collapse.js
147
+ * Bootstrap (v5.0.1): collapse.js
178
148
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
179
149
  * --------------------------------------------------------------------------
180
150
  */
@@ -251,8 +221,8 @@
251
221
  return Default;
252
222
  }
253
223
 
254
- static get DATA_KEY() {
255
- return DATA_KEY;
224
+ static get NAME() {
225
+ return NAME;
256
226
  } // Public
257
227
 
258
228
 
@@ -344,9 +314,9 @@
344
314
 
345
315
  const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
346
316
  const scrollSize = `scroll${capitalizedDimension}`;
347
- const transitionDuration = getTransitionDurationFromElement(this._element);
348
- EventHandler__default['default'].one(this._element, 'transitionend', complete);
349
- emulateTransitionEnd(this._element, transitionDuration);
317
+
318
+ this._queueCallback(complete, this._element, true);
319
+
350
320
  this._element.style[dimension] = `${this._element[scrollSize]}px`;
351
321
  }
352
322
 
@@ -397,21 +367,12 @@
397
367
  };
398
368
 
399
369
  this._element.style[dimension] = '';
400
- const transitionDuration = getTransitionDurationFromElement(this._element);
401
- EventHandler__default['default'].one(this._element, 'transitionend', complete);
402
- emulateTransitionEnd(this._element, transitionDuration);
370
+
371
+ this._queueCallback(complete, this._element, true);
403
372
  }
404
373
 
405
374
  setTransitioning(isTransitioning) {
406
375
  this._isTransitioning = isTransitioning;
407
- }
408
-
409
- dispose() {
410
- super.dispose();
411
- this._config = null;
412
- this._parent = null;
413
- this._triggerArray = null;
414
- this._isTransitioning = null;
415
376
  } // Private
416
377
 
417
378
 
@@ -433,16 +394,7 @@
433
394
  let {
434
395
  parent
435
396
  } = this._config;
436
-
437
- if (isElement(parent)) {
438
- // it's a jQuery object
439
- if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
440
- parent = parent[0];
441
- }
442
- } else {
443
- parent = SelectorEngine__default['default'].findOne(parent);
444
- }
445
-
397
+ parent = getElement(parent);
446
398
  const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`;
447
399
  SelectorEngine__default['default'].find(selector, parent).forEach(element => {
448
400
  const selected = getElementFromSelector(element);
@@ -543,7 +495,7 @@
543
495
  * add .Collapse to jQuery only if jQuery is present
544
496
  */
545
497
 
546
- defineJQueryPlugin(NAME, Collapse);
498
+ defineJQueryPlugin(Collapse);
547
499
 
548
500
  return Collapse;
549
501
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap data.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap data.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.0): dom/data.js
14
+ * Bootstrap (v5.0.1): dom/data.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap event-handler.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap event-handler.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -9,13 +9,6 @@
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventHandler = factory());
10
10
  }(this, (function () { 'use strict';
11
11
 
12
- /**
13
- * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.0): util/index.js
15
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
- * --------------------------------------------------------------------------
17
- */
18
-
19
12
  const getjQuery = () => {
20
13
  const {
21
14
  jQuery
@@ -30,7 +23,7 @@
30
23
 
31
24
  /**
32
25
  * --------------------------------------------------------------------------
33
- * Bootstrap (v5.0.0): dom/event-handler.js
26
+ * Bootstrap (v5.0.1): dom/event-handler.js
34
27
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
35
28
  * --------------------------------------------------------------------------
36
29
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap manipulator.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap manipulator.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.0): dom/manipulator.js
14
+ * Bootstrap (v5.0.1): dom/manipulator.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap selector-engine.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap selector-engine.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.0): dom/selector-engine.js
14
+ * Bootstrap (v5.0.1): dom/selector-engine.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * Bootstrap dropdown.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap dropdown.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
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'), require('./base-component.js')) :
8
- typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
- }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), 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(['@popperjs/core', './dom/selector-engine', './dom/data', './dom/event-handler', './dom/manipulator', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Popper, global.SelectorEngine, global.Data, global.EventHandler, global.Manipulator, global.Base));
10
+ }(this, (function (Popper, SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
@@ -32,19 +32,12 @@
32
32
  }
33
33
 
34
34
  var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
35
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
35
36
  var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
36
37
  var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
37
38
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
38
- var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
39
39
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
40
40
 
41
- /**
42
- * --------------------------------------------------------------------------
43
- * Bootstrap (v5.0.0): util/index.js
44
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
45
- * --------------------------------------------------------------------------
46
- */
47
-
48
41
  const toType = obj => {
49
42
  if (obj === null || obj === undefined) {
50
43
  return `${obj}`;
@@ -82,7 +75,30 @@
82
75
  return selector ? document.querySelector(selector) : null;
83
76
  };
84
77
 
85
- const isElement = obj => (obj[0] || obj).nodeType;
78
+ const isElement = obj => {
79
+ if (!obj || typeof obj !== 'object') {
80
+ return false;
81
+ }
82
+
83
+ if (typeof obj.jquery !== 'undefined') {
84
+ obj = obj[0];
85
+ }
86
+
87
+ return typeof obj.nodeType !== 'undefined';
88
+ };
89
+
90
+ const getElement = obj => {
91
+ if (isElement(obj)) {
92
+ // it's a jQuery object or a node element
93
+ return obj.jquery ? obj[0] : obj;
94
+ }
95
+
96
+ if (typeof obj === 'string' && obj.length > 0) {
97
+ return SelectorEngine__default['default'].findOne(obj);
98
+ }
99
+
100
+ return null;
101
+ };
86
102
 
87
103
  const typeCheckConfig = (componentName, config, configTypes) => {
88
104
  Object.keys(configTypes).forEach(property => {
@@ -150,12 +166,13 @@
150
166
 
151
167
  const isRTL = () => document.documentElement.dir === 'rtl';
152
168
 
153
- const defineJQueryPlugin = (name, plugin) => {
169
+ const defineJQueryPlugin = plugin => {
154
170
  onDOMContentLoaded(() => {
155
171
  const $ = getjQuery();
156
172
  /* istanbul ignore if */
157
173
 
158
174
  if ($) {
175
+ const name = plugin.NAME;
159
176
  const JQUERY_NO_CONFLICT = $.fn[name];
160
177
  $.fn[name] = plugin.jQueryInterface;
161
178
  $.fn[name].Constructor = plugin;
@@ -170,7 +187,7 @@
170
187
 
171
188
  /**
172
189
  * --------------------------------------------------------------------------
173
- * Bootstrap (v5.0.0): dropdown.js
190
+ * Bootstrap (v5.0.1): dropdown.js
174
191
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
175
192
  * --------------------------------------------------------------------------
176
193
  */
@@ -257,8 +274,8 @@
257
274
  return DefaultType;
258
275
  }
259
276
 
260
- static get DATA_KEY() {
261
- return DATA_KEY;
277
+ static get NAME() {
278
+ return NAME;
262
279
  } // Public
263
280
 
264
281
 
@@ -305,11 +322,7 @@
305
322
  if (this._config.reference === 'parent') {
306
323
  referenceElement = parent;
307
324
  } else if (isElement(this._config.reference)) {
308
- referenceElement = this._config.reference; // Check if it's jQuery element
309
-
310
- if (typeof this._config.reference.jquery !== 'undefined') {
311
- referenceElement = this._config.reference[0];
312
- }
325
+ referenceElement = getElement(this._config.reference);
313
326
  } else if (typeof this._config.reference === 'object') {
314
327
  referenceElement = this._config.reference;
315
328
  }
@@ -356,12 +369,8 @@
356
369
  }
357
370
 
358
371
  dispose() {
359
- this._menu = null;
360
-
361
372
  if (this._popper) {
362
373
  this._popper.destroy();
363
-
364
- this._popper = null;
365
374
  }
366
375
 
367
376
  super.dispose();
@@ -547,14 +556,8 @@
547
556
  }
548
557
 
549
558
  static clearMenus(event) {
550
- if (event) {
551
- if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY) {
552
- return;
553
- }
554
-
555
- if (/input|select|option|textarea|form/i.test(event.target.tagName)) {
556
- return;
557
- }
559
+ if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
560
+ return;
558
561
  }
559
562
 
560
563
  const toggles = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
@@ -580,10 +583,10 @@
580
583
 
581
584
  if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
582
585
  continue;
583
- } // Tab navigation through the dropdown menu shouldn't close the menu
586
+ } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
584
587
 
585
588
 
586
- if (event.type === 'keyup' && event.key === TAB_KEY && context._menu.contains(event.target)) {
589
+ if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
587
590
  continue;
588
591
  }
589
592
 
@@ -669,7 +672,7 @@
669
672
  * add .Dropdown to jQuery only if jQuery is present
670
673
  */
671
674
 
672
- defineJQueryPlugin(NAME, Dropdown);
675
+ defineJQueryPlugin(Dropdown);
673
676
 
674
677
  return Dropdown;
675
678
 
@@ -1,27 +1,21 @@
1
1
  /*!
2
- * Bootstrap modal.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap modal.js v5.0.1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(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/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
- }(this, (function (EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/selector-engine.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/event-handler', './dom/manipulator', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.SelectorEngine, global.EventHandler, global.Manipulator, global.Base));
10
+ }(this, (function (SelectorEngine, EventHandler, Manipulator, BaseComponent) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
14
15
  var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
15
16
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
16
- var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
17
17
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
18
18
 
19
- /**
20
- * --------------------------------------------------------------------------
21
- * Bootstrap (v5.0.0): util/index.js
22
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
23
- * --------------------------------------------------------------------------
24
- */
25
19
  const MILLISECONDS_MULTIPLIER = 1000;
26
20
  const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
27
21
 
@@ -89,7 +83,17 @@
89
83
  element.dispatchEvent(new Event(TRANSITION_END));
90
84
  };
91
85
 
92
- const isElement = obj => (obj[0] || obj).nodeType;
86
+ const isElement = obj => {
87
+ if (!obj || typeof obj !== 'object') {
88
+ return false;
89
+ }
90
+
91
+ if (typeof obj.jquery !== 'undefined') {
92
+ obj = obj[0];
93
+ }
94
+
95
+ return typeof obj.nodeType !== 'undefined';
96
+ };
93
97
 
94
98
  const emulateTransitionEnd = (element, duration) => {
95
99
  let called = false;
@@ -159,12 +163,13 @@
159
163
 
160
164
  const isRTL = () => document.documentElement.dir === 'rtl';
161
165
 
162
- const defineJQueryPlugin = (name, plugin) => {
166
+ const defineJQueryPlugin = plugin => {
163
167
  onDOMContentLoaded(() => {
164
168
  const $ = getjQuery();
165
169
  /* istanbul ignore if */
166
170
 
167
171
  if ($) {
172
+ const name = plugin.NAME;
168
173
  const JQUERY_NO_CONFLICT = $.fn[name];
169
174
  $.fn[name] = plugin.jQueryInterface;
170
175
  $.fn[name].Constructor = plugin;
@@ -185,7 +190,7 @@
185
190
 
186
191
  /**
187
192
  * --------------------------------------------------------------------------
188
- * Bootstrap (v5.0.0): util/scrollBar.js
193
+ * Bootstrap (v5.0.1): util/scrollBar.js
189
194
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
190
195
  * --------------------------------------------------------------------------
191
196
  */
@@ -259,7 +264,7 @@
259
264
 
260
265
  /**
261
266
  * --------------------------------------------------------------------------
262
- * Bootstrap (v5.0.0): util/backdrop.js
267
+ * Bootstrap (v5.0.1): util/backdrop.js
263
268
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
264
269
  * --------------------------------------------------------------------------
265
270
  */
@@ -343,6 +348,7 @@
343
348
  config = { ...Default$1,
344
349
  ...(typeof config === 'object' ? config : {})
345
350
  };
351
+ config.rootElement = config.rootElement || document.body;
346
352
  typeCheckConfig(NAME$1, config, DefaultType$1);
347
353
  return config;
348
354
  }
@@ -387,7 +393,7 @@
387
393
 
388
394
  /**
389
395
  * --------------------------------------------------------------------------
390
- * Bootstrap (v5.0.0): modal.js
396
+ * Bootstrap (v5.0.1): modal.js
391
397
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
392
398
  * --------------------------------------------------------------------------
393
399
  */
@@ -454,8 +460,8 @@
454
460
  return Default;
455
461
  }
456
462
 
457
- static get DATA_KEY() {
458
- return DATA_KEY;
463
+ static get NAME() {
464
+ return NAME;
459
465
  } // Public
460
466
 
461
467
 
@@ -536,17 +542,14 @@
536
542
  EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
537
543
  EventHandler__default['default'].off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
538
544
 
539
- if (isAnimated) {
540
- const transitionDuration = getTransitionDurationFromElement(this._element);
541
- EventHandler__default['default'].one(this._element, 'transitionend', event => this._hideModal(event));
542
- emulateTransitionEnd(this._element, transitionDuration);
543
- } else {
544
- this._hideModal();
545
- }
545
+ this._queueCallback(() => this._hideModal(), this._element, isAnimated);
546
546
  }
547
547
 
548
548
  dispose() {
549
549
  [window, this._dialog].forEach(htmlElement => EventHandler__default['default'].off(htmlElement, EVENT_KEY));
550
+
551
+ this._backdrop.dispose();
552
+
550
553
  super.dispose();
551
554
  /**
552
555
  * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
@@ -555,15 +558,6 @@
555
558
  */
556
559
 
557
560
  EventHandler__default['default'].off(document, EVENT_FOCUSIN);
558
- this._config = null;
559
- this._dialog = null;
560
-
561
- this._backdrop.dispose();
562
-
563
- this._backdrop = null;
564
- this._isShown = null;
565
- this._ignoreBackdropClick = null;
566
- this._isTransitioning = null;
567
561
  }
568
562
 
569
563
  handleUpdate() {
@@ -633,13 +627,7 @@
633
627
  });
634
628
  };
635
629
 
636
- if (isAnimated) {
637
- const transitionDuration = getTransitionDurationFromElement(this._dialog);
638
- EventHandler__default['default'].one(this._dialog, 'transitionend', transitionComplete);
639
- emulateTransitionEnd(this._dialog, transitionDuration);
640
- } else {
641
- transitionComplete();
642
- }
630
+ this._queueCallback(transitionComplete, this._dialog, isAnimated);
643
631
  }
644
632
 
645
633
  _enforceFocus() {
@@ -829,7 +817,7 @@
829
817
  * add .Modal to jQuery only if jQuery is present
830
818
  */
831
819
 
832
- defineJQueryPlugin(NAME, Modal);
820
+ defineJQueryPlugin(Modal);
833
821
 
834
822
  return Modal;
835
823