bootstrap 5.0.0.alpha3 → 5.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +8 -8
  4. data/assets/javascripts/bootstrap.js +597 -595
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +67 -31
  7. data/assets/javascripts/bootstrap/button.js +63 -24
  8. data/assets/javascripts/bootstrap/carousel.js +121 -74
  9. data/assets/javascripts/bootstrap/collapse.js +101 -54
  10. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +12 -10
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +12 -11
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
  14. data/assets/javascripts/bootstrap/dropdown.js +142 -99
  15. data/assets/javascripts/bootstrap/modal.js +153 -109
  16. data/assets/javascripts/bootstrap/popover.js +11 -19
  17. data/assets/javascripts/bootstrap/scrollspy.js +82 -36
  18. data/assets/javascripts/bootstrap/tab.js +67 -28
  19. data/assets/javascripts/bootstrap/toast.js +90 -42
  20. data/assets/javascripts/bootstrap/tooltip.js +227 -148
  21. data/assets/stylesheets/_bootstrap-grid.scss +7 -7
  22. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  23. data/assets/stylesheets/_bootstrap.scss +1 -1
  24. data/assets/stylesheets/bootstrap/_alert.scss +3 -3
  25. data/assets/stylesheets/bootstrap/_breadcrumb.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_button-group.scss +5 -5
  27. data/assets/stylesheets/bootstrap/_card.scss +3 -3
  28. data/assets/stylesheets/bootstrap/_carousel.scss +23 -12
  29. data/assets/stylesheets/bootstrap/_dropdown.scss +22 -23
  30. data/assets/stylesheets/bootstrap/_functions.scss +1 -2
  31. data/assets/stylesheets/bootstrap/_list-group.scss +6 -6
  32. data/assets/stylesheets/bootstrap/_navbar.scss +1 -1
  33. data/assets/stylesheets/bootstrap/_pagination.scss +1 -1
  34. data/assets/stylesheets/bootstrap/_popover.scss +17 -14
  35. data/assets/stylesheets/bootstrap/_reboot.scss +19 -3
  36. data/assets/stylesheets/bootstrap/_spinners.scss +1 -1
  37. data/assets/stylesheets/bootstrap/_tables.scss +0 -1
  38. data/assets/stylesheets/bootstrap/_toasts.scss +14 -12
  39. data/assets/stylesheets/bootstrap/_tooltip.scss +12 -12
  40. data/assets/stylesheets/bootstrap/_utilities.scss +39 -24
  41. data/assets/stylesheets/bootstrap/_variables.scss +22 -20
  42. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  43. data/assets/stylesheets/bootstrap/forms/_form-check.scss +5 -5
  44. data/assets/stylesheets/bootstrap/forms/_input-group.scss +3 -3
  45. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +6 -6
  46. data/assets/stylesheets/bootstrap/mixins/_caret.scss +6 -6
  47. data/assets/stylesheets/bootstrap/mixins/_container.scss +2 -4
  48. data/assets/stylesheets/bootstrap/mixins/_forms.scss +1 -1
  49. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +3 -3
  50. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +19 -0
  51. data/lib/bootstrap/version.rb +2 -2
  52. data/tasks/updater/js.rb +6 -4
  53. metadata +2 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap selector-engine.js v5.0.0-alpha3 (https://getbootstrap.com/)
2
+ * Bootstrap selector-engine.js v5.0.0-beta1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -11,7 +11,7 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.0-alpha3): dom/selector-engine.js
14
+ * Bootstrap (v5.0.0-beta1): dom/selector-engine.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
@@ -1,25 +1,45 @@
1
1
  /*!
2
- * Bootstrap dropdown.js v5.0.0-alpha3 (https://getbootstrap.com/)
2
+ * Bootstrap dropdown.js v5.0.0-beta1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
8
- typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', 'popper.js', './dom/selector-engine.js'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
10
- }(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
8
+ typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
10
+ }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () {
24
+ return e[k];
25
+ }
26
+ });
27
+ }
28
+ });
29
+ }
30
+ n['default'] = e;
31
+ return Object.freeze(n);
32
+ }
33
+
34
+ var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
14
35
  var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
36
  var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
37
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
- var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
18
38
  var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
19
39
 
20
40
  /**
21
41
  * --------------------------------------------------------------------------
22
- * Bootstrap (v5.0.0-alpha3): util/index.js
42
+ * Bootstrap (v5.0.0-beta1): util/index.js
23
43
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
44
  * --------------------------------------------------------------------------
25
45
  */
@@ -33,7 +53,7 @@
33
53
  };
34
54
 
35
55
  var getSelector = function getSelector(element) {
36
- var selector = element.getAttribute('data-target');
56
+ var selector = element.getAttribute('data-bs-target');
37
57
 
38
58
  if (!selector || selector === '#') {
39
59
  var hrefAttr = element.getAttribute('href');
@@ -86,7 +106,7 @@
86
106
  var _window = window,
87
107
  jQuery = _window.jQuery;
88
108
 
89
- if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
109
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
90
110
  return jQuery;
91
111
  }
92
112
 
@@ -101,7 +121,7 @@
101
121
  }
102
122
  };
103
123
 
104
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
124
+ var isRTL = document.documentElement.dir === 'rtl';
105
125
 
106
126
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
107
127
 
@@ -112,8 +132,55 @@
112
132
  * ------------------------------------------------------------------------
113
133
  */
114
134
 
135
+ var VERSION = '5.0.0-beta1';
136
+
137
+ var BaseComponent = /*#__PURE__*/function () {
138
+ function BaseComponent(element) {
139
+ if (!element) {
140
+ return;
141
+ }
142
+
143
+ this._element = element;
144
+ Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
145
+ }
146
+
147
+ var _proto = BaseComponent.prototype;
148
+
149
+ _proto.dispose = function dispose() {
150
+ Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
151
+ this._element = null;
152
+ }
153
+ /** Static */
154
+ ;
155
+
156
+ BaseComponent.getInstance = function getInstance(element) {
157
+ return Data__default['default'].getData(element, this.DATA_KEY);
158
+ };
159
+
160
+ _createClass(BaseComponent, null, [{
161
+ key: "VERSION",
162
+ get: function get() {
163
+ return VERSION;
164
+ }
165
+ }]);
166
+
167
+ return BaseComponent;
168
+ }();
169
+
170
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
171
+
172
+ function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
173
+
174
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
175
+
176
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
177
+ /**
178
+ * ------------------------------------------------------------------------
179
+ * Constants
180
+ * ------------------------------------------------------------------------
181
+ */
182
+
115
183
  var NAME = 'dropdown';
116
- var VERSION = '5.0.0-alpha3';
117
184
  var DATA_KEY = 'bs.dropdown';
118
185
  var EVENT_KEY = "." + DATA_KEY;
119
186
  var DATA_API_KEY = '.data-api';
@@ -136,26 +203,24 @@
136
203
  var CLASS_NAME_DISABLED = 'disabled';
137
204
  var CLASS_NAME_SHOW = 'show';
138
205
  var CLASS_NAME_DROPUP = 'dropup';
139
- var CLASS_NAME_DROPRIGHT = 'dropright';
140
- var CLASS_NAME_DROPLEFT = 'dropleft';
141
- var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
206
+ var CLASS_NAME_DROPEND = 'dropend';
207
+ var CLASS_NAME_DROPSTART = 'dropstart';
142
208
  var CLASS_NAME_NAVBAR = 'navbar';
143
- var CLASS_NAME_POSITION_STATIC = 'position-static';
144
- var SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]';
209
+ var SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]';
145
210
  var SELECTOR_FORM_CHILD = '.dropdown form';
146
211
  var SELECTOR_MENU = '.dropdown-menu';
147
212
  var SELECTOR_NAVBAR_NAV = '.navbar-nav';
148
213
  var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
149
- var PLACEMENT_TOP = 'top-start';
150
- var PLACEMENT_TOPEND = 'top-end';
151
- var PLACEMENT_BOTTOM = 'bottom-start';
152
- var PLACEMENT_BOTTOMEND = 'bottom-end';
153
- var PLACEMENT_RIGHT = 'right-start';
154
- var PLACEMENT_LEFT = 'left-start';
214
+ var PLACEMENT_TOP = isRTL ? 'top-end' : 'top-start';
215
+ var PLACEMENT_TOPEND = isRTL ? 'top-start' : 'top-end';
216
+ var PLACEMENT_BOTTOM = isRTL ? 'bottom-end' : 'bottom-start';
217
+ var PLACEMENT_BOTTOMEND = isRTL ? 'bottom-start' : 'bottom-end';
218
+ var PLACEMENT_RIGHT = isRTL ? 'left-start' : 'right-start';
219
+ var PLACEMENT_LEFT = isRTL ? 'right-start' : 'left-start';
155
220
  var Default = {
156
221
  offset: 0,
157
222
  flip: true,
158
- boundary: 'scrollParent',
223
+ boundary: 'clippingParents',
159
224
  reference: 'toggle',
160
225
  display: 'dynamic',
161
226
  popperConfig: null
@@ -174,17 +239,21 @@
174
239
  * ------------------------------------------------------------------------
175
240
  */
176
241
 
177
- var Dropdown = /*#__PURE__*/function () {
242
+ var Dropdown = /*#__PURE__*/function (_BaseComponent) {
243
+ _inheritsLoose(Dropdown, _BaseComponent);
244
+
178
245
  function Dropdown(element, config) {
179
- this._element = element;
180
- this._popper = null;
181
- this._config = this._getConfig(config);
182
- this._menu = this._getMenuElement();
183
- this._inNavbar = this._detectNavbar();
246
+ var _this;
184
247
 
185
- this._addEventListeners();
248
+ _this = _BaseComponent.call(this, element) || this;
249
+ _this._popper = null;
250
+ _this._config = _this._getConfig(config);
251
+ _this._menu = _this._getMenuElement();
252
+ _this._inNavbar = _this._detectNavbar();
186
253
 
187
- Data__default['default'].setData(element, DATA_KEY, this);
254
+ _this._addEventListeners();
255
+
256
+ return _this;
188
257
  } // Getters
189
258
 
190
259
 
@@ -220,12 +289,12 @@
220
289
 
221
290
  if (showEvent.defaultPrevented) {
222
291
  return;
223
- } // Disable totally Popper.js for Dropdown in Navbar
292
+ } // Totally disable Popper for Dropdowns in Navbar
224
293
 
225
294
 
226
295
  if (!this._inNavbar) {
227
- if (typeof Popper__default['default'] === 'undefined') {
228
- throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org)');
296
+ if (typeof Popper__namespace === 'undefined') {
297
+ throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
229
298
  }
230
299
 
231
300
  var referenceElement = this._element;
@@ -238,16 +307,9 @@
238
307
  if (typeof this._config.reference.jquery !== 'undefined') {
239
308
  referenceElement = this._config.reference[0];
240
309
  }
241
- } // If boundary is not `scrollParent`, then set position to `static`
242
- // to allow the menu to "escape" the scroll parent's boundaries
243
- // https://github.com/twbs/bootstrap/issues/24251
244
-
245
-
246
- if (this._config.boundary !== 'scrollParent') {
247
- parent.classList.add(CLASS_NAME_POSITION_STATIC);
248
310
  }
249
311
 
250
- this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
312
+ this._popper = Popper.createPopper(referenceElement, this._menu, this._getPopperConfig());
251
313
  } // If this is a touch-enabled device we add extra
252
314
  // empty mouseover listeners to the body's immediate children;
253
315
  // only needed because of broken event delegation on iOS
@@ -300,9 +362,9 @@
300
362
  };
301
363
 
302
364
  _proto.dispose = function dispose() {
303
- Data__default['default'].removeData(this._element, DATA_KEY);
365
+ _BaseComponent.prototype.dispose.call(this);
366
+
304
367
  EventHandler__default['default'].off(this._element, EVENT_KEY);
305
- this._element = null;
306
368
  this._menu = null;
307
369
 
308
370
  if (this._popper) {
@@ -316,19 +378,19 @@
316
378
  this._inNavbar = this._detectNavbar();
317
379
 
318
380
  if (this._popper) {
319
- this._popper.scheduleUpdate();
381
+ this._popper.update();
320
382
  }
321
383
  } // Private
322
384
  ;
323
385
 
324
386
  _proto._addEventListeners = function _addEventListeners() {
325
- var _this = this;
387
+ var _this2 = this;
326
388
 
327
389
  EventHandler__default['default'].on(this._element, EVENT_CLICK, function (event) {
328
390
  event.preventDefault();
329
391
  event.stopPropagation();
330
392
 
331
- _this.toggle();
393
+ _this2.toggle();
332
394
  });
333
395
  };
334
396
 
@@ -344,60 +406,46 @@
344
406
 
345
407
  _proto._getPlacement = function _getPlacement() {
346
408
  var parentDropdown = this._element.parentNode;
347
- var placement = PLACEMENT_BOTTOM; // Handle dropup
348
409
 
349
- if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
350
- placement = this._menu.classList.contains(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
351
- } else if (parentDropdown.classList.contains(CLASS_NAME_DROPRIGHT)) {
352
- placement = PLACEMENT_RIGHT;
353
- } else if (parentDropdown.classList.contains(CLASS_NAME_DROPLEFT)) {
354
- placement = PLACEMENT_LEFT;
355
- } else if (this._menu.classList.contains(CLASS_NAME_MENURIGHT)) {
356
- placement = PLACEMENT_BOTTOMEND;
410
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
411
+ return PLACEMENT_RIGHT;
357
412
  }
358
413
 
359
- return placement;
360
- };
414
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
415
+ return PLACEMENT_LEFT;
416
+ } // We need to trim the value because custom properties can also include spaces
361
417
 
362
- _proto._detectNavbar = function _detectNavbar() {
363
- return Boolean(this._element.closest("." + CLASS_NAME_NAVBAR));
364
- };
365
418
 
366
- _proto._getOffset = function _getOffset() {
367
- var _this2 = this;
368
-
369
- var offset = {};
419
+ var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
370
420
 
371
- if (typeof this._config.offset === 'function') {
372
- offset.fn = function (data) {
373
- data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
374
- return data;
375
- };
376
- } else {
377
- offset.offset = this._config.offset;
421
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
422
+ return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
378
423
  }
379
424
 
380
- return offset;
425
+ return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
426
+ };
427
+
428
+ _proto._detectNavbar = function _detectNavbar() {
429
+ return this._element.closest("." + CLASS_NAME_NAVBAR) !== null;
381
430
  };
382
431
 
383
432
  _proto._getPopperConfig = function _getPopperConfig() {
384
433
  var popperConfig = {
385
434
  placement: this._getPlacement(),
386
- modifiers: {
387
- offset: this._getOffset(),
388
- flip: {
389
- enabled: this._config.flip
390
- },
391
- preventOverflow: {
392
- boundariesElement: this._config.boundary
435
+ modifiers: [{
436
+ name: 'preventOverflow',
437
+ options: {
438
+ altBoundary: this._config.flip,
439
+ rootBoundary: this._config.boundary
393
440
  }
394
- }
395
- }; // Disable Popper.js if we have a static display
441
+ }]
442
+ }; // Disable Popper if we have a static display
396
443
 
397
444
  if (this._config.display === 'static') {
398
- popperConfig.modifiers.applyStyle = {
445
+ popperConfig.modifiers = [{
446
+ name: 'applyStyles',
399
447
  enabled: false
400
- };
448
+ }];
401
449
  }
402
450
 
403
451
  return _extends({}, popperConfig, this._config.popperConfig);
@@ -532,15 +580,14 @@
532
580
  return;
533
581
  }
534
582
 
535
- var index = items.indexOf(event.target);
583
+ var index = items.indexOf(event.target); // Up
536
584
 
537
585
  if (event.key === ARROW_UP_KEY && index > 0) {
538
- // Up
539
586
  index--;
540
- }
587
+ } // Down
588
+
541
589
 
542
590
  if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
543
- // Down
544
591
  index++;
545
592
  } // index is -1 if the first keydown is an ArrowUp
546
593
 
@@ -549,16 +596,7 @@
549
596
  items[index].focus();
550
597
  };
551
598
 
552
- Dropdown.getInstance = function getInstance(element) {
553
- return Data__default['default'].getData(element, DATA_KEY);
554
- };
555
-
556
- _createClass(Dropdown, null, [{
557
- key: "VERSION",
558
- get: function get() {
559
- return VERSION;
560
- }
561
- }, {
599
+ _createClass$1(Dropdown, null, [{
562
600
  key: "Default",
563
601
  get: function get() {
564
602
  return Default;
@@ -568,10 +606,15 @@
568
606
  get: function get() {
569
607
  return DefaultType;
570
608
  }
609
+ }, {
610
+ key: "DATA_KEY",
611
+ get: function get() {
612
+ return DATA_KEY;
613
+ }
571
614
  }]);
572
615
 
573
616
  return Dropdown;
574
- }();
617
+ }(BaseComponent);
575
618
  /**
576
619
  * ------------------------------------------------------------------------
577
620
  * Data Api implementation
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Bootstrap modal.js v5.0.0-alpha3 (https://getbootstrap.com/)
2
+ * Bootstrap modal.js v5.0.0-beta1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
8
- typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', './dom/selector-engine.js'], factory) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
9
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
10
10
  }(this, (function (Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
11
11
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  /**
20
20
  * --------------------------------------------------------------------------
21
- * Bootstrap (v5.0.0-alpha3): util/index.js
21
+ * Bootstrap (v5.0.0-beta1): util/index.js
22
22
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
23
23
  * --------------------------------------------------------------------------
24
24
  */
@@ -34,7 +34,7 @@
34
34
  };
35
35
 
36
36
  var getSelector = function getSelector(element) {
37
- var selector = element.getAttribute('data-target');
37
+ var selector = element.getAttribute('data-bs-target');
38
38
 
39
39
  if (!selector || selector === '#') {
40
40
  var hrefAttr = element.getAttribute('href');
@@ -59,8 +59,8 @@
59
59
  transitionDuration = _window$getComputedSt.transitionDuration,
60
60
  transitionDelay = _window$getComputedSt.transitionDelay;
61
61
 
62
- var floatTransitionDuration = parseFloat(transitionDuration);
63
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
62
+ var floatTransitionDuration = Number.parseFloat(transitionDuration);
63
+ var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
64
64
 
65
65
  if (!floatTransitionDuration && !floatTransitionDelay) {
66
66
  return 0;
@@ -69,7 +69,7 @@
69
69
 
70
70
  transitionDuration = transitionDuration.split(',')[0];
71
71
  transitionDelay = transitionDelay.split(',')[0];
72
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
72
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
73
73
  };
74
74
 
75
75
  var triggerTransitionEnd = function triggerTransitionEnd(element) {
@@ -132,7 +132,7 @@
132
132
  var _window = window,
133
133
  jQuery = _window.jQuery;
134
134
 
135
- if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
135
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
136
136
  return jQuery;
137
137
  }
138
138
 
@@ -147,7 +147,7 @@
147
147
  }
148
148
  };
149
149
 
150
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
150
+ var isRTL = document.documentElement.dir === 'rtl';
151
151
 
152
152
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
153
153
 
@@ -158,8 +158,55 @@
158
158
  * ------------------------------------------------------------------------
159
159
  */
160
160
 
161
+ var VERSION = '5.0.0-beta1';
162
+
163
+ var BaseComponent = /*#__PURE__*/function () {
164
+ function BaseComponent(element) {
165
+ if (!element) {
166
+ return;
167
+ }
168
+
169
+ this._element = element;
170
+ Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
171
+ }
172
+
173
+ var _proto = BaseComponent.prototype;
174
+
175
+ _proto.dispose = function dispose() {
176
+ Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
177
+ this._element = null;
178
+ }
179
+ /** Static */
180
+ ;
181
+
182
+ BaseComponent.getInstance = function getInstance(element) {
183
+ return Data__default['default'].getData(element, this.DATA_KEY);
184
+ };
185
+
186
+ _createClass(BaseComponent, null, [{
187
+ key: "VERSION",
188
+ get: function get() {
189
+ return VERSION;
190
+ }
191
+ }]);
192
+
193
+ return BaseComponent;
194
+ }();
195
+
196
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
197
+
198
+ function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
199
+
200
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
201
+
202
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
203
+ /**
204
+ * ------------------------------------------------------------------------
205
+ * Constants
206
+ * ------------------------------------------------------------------------
207
+ */
208
+
161
209
  var NAME = 'modal';
162
- var VERSION = '5.0.0-alpha3';
163
210
  var DATA_KEY = 'bs.modal';
164
211
  var EVENT_KEY = "." + DATA_KEY;
165
212
  var DATA_API_KEY = '.data-api';
@@ -167,14 +214,12 @@
167
214
  var Default = {
168
215
  backdrop: true,
169
216
  keyboard: true,
170
- focus: true,
171
- show: true
217
+ focus: true
172
218
  };
173
219
  var DefaultType = {
174
220
  backdrop: '(boolean|string)',
175
221
  keyboard: 'boolean',
176
- focus: 'boolean',
177
- show: 'boolean'
222
+ focus: 'boolean'
178
223
  };
179
224
  var EVENT_HIDE = "hide" + EVENT_KEY;
180
225
  var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY;
@@ -196,8 +241,8 @@
196
241
  var CLASS_NAME_STATIC = 'modal-static';
197
242
  var SELECTOR_DIALOG = '.modal-dialog';
198
243
  var SELECTOR_MODAL_BODY = '.modal-body';
199
- var SELECTOR_DATA_TOGGLE = '[data-toggle="modal"]';
200
- var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
244
+ var SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]';
245
+ var SELECTOR_DATA_DISMISS = '[data-bs-dismiss="modal"]';
201
246
  var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
202
247
  var SELECTOR_STICKY_CONTENT = '.sticky-top';
203
248
  /**
@@ -206,18 +251,22 @@
206
251
  * ------------------------------------------------------------------------
207
252
  */
208
253
 
209
- var Modal = /*#__PURE__*/function () {
254
+ var Modal = /*#__PURE__*/function (_BaseComponent) {
255
+ _inheritsLoose(Modal, _BaseComponent);
256
+
210
257
  function Modal(element, config) {
211
- this._config = this._getConfig(config);
212
- this._element = element;
213
- this._dialog = SelectorEngine__default['default'].findOne(SELECTOR_DIALOG, element);
214
- this._backdrop = null;
215
- this._isShown = false;
216
- this._isBodyOverflowing = false;
217
- this._ignoreBackdropClick = false;
218
- this._isTransitioning = false;
219
- this._scrollbarWidth = 0;
220
- Data__default['default'].setData(element, DATA_KEY, this);
258
+ var _this;
259
+
260
+ _this = _BaseComponent.call(this, element) || this;
261
+ _this._config = _this._getConfig(config);
262
+ _this._dialog = SelectorEngine__default['default'].findOne(SELECTOR_DIALOG, element);
263
+ _this._backdrop = null;
264
+ _this._isShown = false;
265
+ _this._isBodyOverflowing = false;
266
+ _this._ignoreBackdropClick = false;
267
+ _this._isTransitioning = false;
268
+ _this._scrollbarWidth = 0;
269
+ return _this;
221
270
  } // Getters
222
271
 
223
272
 
@@ -229,7 +278,7 @@
229
278
  };
230
279
 
231
280
  _proto.show = function show(relatedTarget) {
232
- var _this = this;
281
+ var _this2 = this;
233
282
 
234
283
  if (this._isShown || this._isTransitioning) {
235
284
  return;
@@ -260,23 +309,23 @@
260
309
  this._setResizeEvent();
261
310
 
262
311
  EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
263
- return _this.hide(event);
312
+ return _this2.hide(event);
264
313
  });
265
314
  EventHandler__default['default'].on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
266
- EventHandler__default['default'].one(_this._element, EVENT_MOUSEUP_DISMISS, function (event) {
267
- if (event.target === _this._element) {
268
- _this._ignoreBackdropClick = true;
315
+ EventHandler__default['default'].one(_this2._element, EVENT_MOUSEUP_DISMISS, function (event) {
316
+ if (event.target === _this2._element) {
317
+ _this2._ignoreBackdropClick = true;
269
318
  }
270
319
  });
271
320
  });
272
321
 
273
322
  this._showBackdrop(function () {
274
- return _this._showElement(relatedTarget);
323
+ return _this2._showElement(relatedTarget);
275
324
  });
276
325
  };
277
326
 
278
327
  _proto.hide = function hide(event) {
279
- var _this2 = this;
328
+ var _this3 = this;
280
329
 
281
330
  if (event) {
282
331
  event.preventDefault();
@@ -314,7 +363,7 @@
314
363
  if (transition) {
315
364
  var transitionDuration = getTransitionDurationFromElement(this._element);
316
365
  EventHandler__default['default'].one(this._element, TRANSITION_END, function (event) {
317
- return _this2._hideModal(event);
366
+ return _this3._hideModal(event);
318
367
  });
319
368
  emulateTransitionEnd(this._element, transitionDuration);
320
369
  } else {
@@ -326,16 +375,17 @@
326
375
  [window, this._element, this._dialog].forEach(function (htmlElement) {
327
376
  return EventHandler__default['default'].off(htmlElement, EVENT_KEY);
328
377
  });
378
+
379
+ _BaseComponent.prototype.dispose.call(this);
329
380
  /**
330
381
  * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
331
382
  * Do not move `document` in `htmlElements` array
332
383
  * It will remove `EVENT_CLICK_DATA_API` event that should remain
333
384
  */
334
385
 
386
+
335
387
  EventHandler__default['default'].off(document, EVENT_FOCUSIN);
336
- Data__default['default'].removeData(this._element, DATA_KEY);
337
388
  this._config = null;
338
- this._element = null;
339
389
  this._dialog = null;
340
390
  this._backdrop = null;
341
391
  this._isShown = null;
@@ -357,7 +407,7 @@
357
407
  };
358
408
 
359
409
  _proto._showElement = function _showElement(relatedTarget) {
360
- var _this3 = this;
410
+ var _this4 = this;
361
411
 
362
412
  var transition = this._element.classList.contains(CLASS_NAME_FADE);
363
413
 
@@ -393,12 +443,12 @@
393
443
  }
394
444
 
395
445
  var transitionComplete = function transitionComplete() {
396
- if (_this3._config.focus) {
397
- _this3._element.focus();
446
+ if (_this4._config.focus) {
447
+ _this4._element.focus();
398
448
  }
399
449
 
400
- _this3._isTransitioning = false;
401
- EventHandler__default['default'].trigger(_this3._element, EVENT_SHOWN, {
450
+ _this4._isTransitioning = false;
451
+ EventHandler__default['default'].trigger(_this4._element, EVENT_SHOWN, {
402
452
  relatedTarget: relatedTarget
403
453
  });
404
454
  };
@@ -413,28 +463,28 @@
413
463
  };
414
464
 
415
465
  _proto._enforceFocus = function _enforceFocus() {
416
- var _this4 = this;
466
+ var _this5 = this;
417
467
 
418
468
  EventHandler__default['default'].off(document, EVENT_FOCUSIN); // guard against infinite focus loop
419
469
 
420
470
  EventHandler__default['default'].on(document, EVENT_FOCUSIN, function (event) {
421
- if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
422
- _this4._element.focus();
471
+ if (document !== event.target && _this5._element !== event.target && !_this5._element.contains(event.target)) {
472
+ _this5._element.focus();
423
473
  }
424
474
  });
425
475
  };
426
476
 
427
477
  _proto._setEscapeEvent = function _setEscapeEvent() {
428
- var _this5 = this;
478
+ var _this6 = this;
429
479
 
430
480
  if (this._isShown) {
431
481
  EventHandler__default['default'].on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
432
- if (_this5._config.keyboard && event.key === ESCAPE_KEY) {
482
+ if (_this6._config.keyboard && event.key === ESCAPE_KEY) {
433
483
  event.preventDefault();
434
484
 
435
- _this5.hide();
436
- } else if (!_this5._config.keyboard && event.key === ESCAPE_KEY) {
437
- _this5._triggerBackdropTransition();
485
+ _this6.hide();
486
+ } else if (!_this6._config.keyboard && event.key === ESCAPE_KEY) {
487
+ _this6._triggerBackdropTransition();
438
488
  }
439
489
  });
440
490
  } else {
@@ -443,11 +493,11 @@
443
493
  };
444
494
 
445
495
  _proto._setResizeEvent = function _setResizeEvent() {
446
- var _this6 = this;
496
+ var _this7 = this;
447
497
 
448
498
  if (this._isShown) {
449
499
  EventHandler__default['default'].on(window, EVENT_RESIZE, function () {
450
- return _this6._adjustDialog();
500
+ return _this7._adjustDialog();
451
501
  });
452
502
  } else {
453
503
  EventHandler__default['default'].off(window, EVENT_RESIZE);
@@ -455,7 +505,7 @@
455
505
  };
456
506
 
457
507
  _proto._hideModal = function _hideModal() {
458
- var _this7 = this;
508
+ var _this8 = this;
459
509
 
460
510
  this._element.style.display = 'none';
461
511
 
@@ -470,11 +520,11 @@
470
520
  this._showBackdrop(function () {
471
521
  document.body.classList.remove(CLASS_NAME_OPEN);
472
522
 
473
- _this7._resetAdjustments();
523
+ _this8._resetAdjustments();
474
524
 
475
- _this7._resetScrollbar();
525
+ _this8._resetScrollbar();
476
526
 
477
- EventHandler__default['default'].trigger(_this7._element, EVENT_HIDDEN);
527
+ EventHandler__default['default'].trigger(_this8._element, EVENT_HIDDEN);
478
528
  });
479
529
  };
480
530
 
@@ -485,7 +535,7 @@
485
535
  };
486
536
 
487
537
  _proto._showBackdrop = function _showBackdrop(callback) {
488
- var _this8 = this;
538
+ var _this9 = this;
489
539
 
490
540
  var animate = this._element.classList.contains(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
491
541
 
@@ -499,8 +549,8 @@
499
549
 
500
550
  document.body.appendChild(this._backdrop);
501
551
  EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, function (event) {
502
- if (_this8._ignoreBackdropClick) {
503
- _this8._ignoreBackdropClick = false;
552
+ if (_this9._ignoreBackdropClick) {
553
+ _this9._ignoreBackdropClick = false;
504
554
  return;
505
555
  }
506
556
 
@@ -508,7 +558,11 @@
508
558
  return;
509
559
  }
510
560
 
511
- _this8._triggerBackdropTransition();
561
+ if (_this9._config.backdrop === 'static') {
562
+ _this9._triggerBackdropTransition();
563
+ } else {
564
+ _this9.hide();
565
+ }
512
566
  });
513
567
 
514
568
  if (animate) {
@@ -529,7 +583,7 @@
529
583
  this._backdrop.classList.remove(CLASS_NAME_SHOW);
530
584
 
531
585
  var callbackRemove = function callbackRemove() {
532
- _this8._removeBackdrop();
586
+ _this9._removeBackdrop();
533
587
 
534
588
  callback();
535
589
  };
@@ -548,41 +602,37 @@
548
602
  };
549
603
 
550
604
  _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
551
- var _this9 = this;
605
+ var _this10 = this;
552
606
 
553
- if (this._config.backdrop === 'static') {
554
- var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE_PREVENTED);
607
+ var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE_PREVENTED);
555
608
 
556
- if (hideEvent.defaultPrevented) {
557
- return;
558
- }
609
+ if (hideEvent.defaultPrevented) {
610
+ return;
611
+ }
559
612
 
560
- var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
613
+ var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
561
614
 
562
- if (!isModalOverflowing) {
563
- this._element.style.overflowY = 'hidden';
564
- }
615
+ if (!isModalOverflowing) {
616
+ this._element.style.overflowY = 'hidden';
617
+ }
565
618
 
566
- this._element.classList.add(CLASS_NAME_STATIC);
619
+ this._element.classList.add(CLASS_NAME_STATIC);
567
620
 
568
- var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
569
- EventHandler__default['default'].off(this._element, TRANSITION_END);
570
- EventHandler__default['default'].one(this._element, TRANSITION_END, function () {
571
- _this9._element.classList.remove(CLASS_NAME_STATIC);
621
+ var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
622
+ EventHandler__default['default'].off(this._element, TRANSITION_END);
623
+ EventHandler__default['default'].one(this._element, TRANSITION_END, function () {
624
+ _this10._element.classList.remove(CLASS_NAME_STATIC);
572
625
 
573
- if (!isModalOverflowing) {
574
- EventHandler__default['default'].one(_this9._element, TRANSITION_END, function () {
575
- _this9._element.style.overflowY = '';
576
- });
577
- emulateTransitionEnd(_this9._element, modalTransitionDuration);
578
- }
579
- });
580
- emulateTransitionEnd(this._element, modalTransitionDuration);
626
+ if (!isModalOverflowing) {
627
+ EventHandler__default['default'].one(_this10._element, TRANSITION_END, function () {
628
+ _this10._element.style.overflowY = '';
629
+ });
630
+ emulateTransitionEnd(_this10._element, modalTransitionDuration);
631
+ }
632
+ });
633
+ emulateTransitionEnd(this._element, modalTransitionDuration);
581
634
 
582
- this._element.focus();
583
- } else {
584
- this.hide();
585
- }
635
+ this._element.focus();
586
636
  } // ----------------------------------------------------------------------
587
637
  // the following methods are used to handle overflowing modals
588
638
  // ----------------------------------------------------------------------
@@ -591,11 +641,11 @@
591
641
  _proto._adjustDialog = function _adjustDialog() {
592
642
  var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
593
643
 
594
- if (!this._isBodyOverflowing && isModalOverflowing) {
644
+ if (!this._isBodyOverflowing && isModalOverflowing && !isRTL || this._isBodyOverflowing && !isModalOverflowing && isRTL) {
595
645
  this._element.style.paddingLeft = this._scrollbarWidth + "px";
596
646
  }
597
647
 
598
- if (this._isBodyOverflowing && !isModalOverflowing) {
648
+ if (this._isBodyOverflowing && !isModalOverflowing && !isRTL || !this._isBodyOverflowing && isModalOverflowing && isRTL) {
599
649
  this._element.style.paddingRight = this._scrollbarWidth + "px";
600
650
  }
601
651
  };
@@ -612,7 +662,7 @@
612
662
  };
613
663
 
614
664
  _proto._setScrollbar = function _setScrollbar() {
615
- var _this10 = this;
665
+ var _this11 = this;
616
666
 
617
667
  if (this._isBodyOverflowing) {
618
668
  // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
@@ -622,20 +672,20 @@
622
672
  var actualPadding = element.style.paddingRight;
623
673
  var calculatedPadding = window.getComputedStyle(element)['padding-right'];
624
674
  Manipulator__default['default'].setDataAttribute(element, 'padding-right', actualPadding);
625
- element.style.paddingRight = parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
675
+ element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this11._scrollbarWidth + "px";
626
676
  }); // Adjust sticky content margin
627
677
 
628
678
  SelectorEngine__default['default'].find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
629
679
  var actualMargin = element.style.marginRight;
630
680
  var calculatedMargin = window.getComputedStyle(element)['margin-right'];
631
681
  Manipulator__default['default'].setDataAttribute(element, 'margin-right', actualMargin);
632
- element.style.marginRight = parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
682
+ element.style.marginRight = Number.parseFloat(calculatedMargin) - _this11._scrollbarWidth + "px";
633
683
  }); // Adjust body padding
634
684
 
635
685
  var actualPadding = document.body.style.paddingRight;
636
686
  var calculatedPadding = window.getComputedStyle(document.body)['padding-right'];
637
687
  Manipulator__default['default'].setDataAttribute(document.body, 'padding-right', actualPadding);
638
- document.body.style.paddingRight = parseFloat(calculatedPadding) + this._scrollbarWidth + "px";
688
+ document.body.style.paddingRight = Number.parseFloat(calculatedPadding) + this._scrollbarWidth + "px";
639
689
  }
640
690
 
641
691
  document.body.classList.add(CLASS_NAME_OPEN);
@@ -698,30 +748,24 @@
698
748
  }
699
749
 
700
750
  data[config](relatedTarget);
701
- } else if (_config.show) {
702
- data.show(relatedTarget);
703
751
  }
704
752
  });
705
753
  };
706
754
 
707
- Modal.getInstance = function getInstance(element) {
708
- return Data__default['default'].getData(element, DATA_KEY);
709
- };
710
-
711
- _createClass(Modal, null, [{
712
- key: "VERSION",
755
+ _createClass$1(Modal, null, [{
756
+ key: "Default",
713
757
  get: function get() {
714
- return VERSION;
758
+ return Default;
715
759
  }
716
760
  }, {
717
- key: "Default",
761
+ key: "DATA_KEY",
718
762
  get: function get() {
719
- return Default;
763
+ return DATA_KEY;
720
764
  }
721
765
  }]);
722
766
 
723
767
  return Modal;
724
- }();
768
+ }(BaseComponent);
725
769
  /**
726
770
  * ------------------------------------------------------------------------
727
771
  * Data Api implementation
@@ -730,7 +774,7 @@
730
774
 
731
775
 
732
776
  EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
733
- var _this11 = this;
777
+ var _this12 = this;
734
778
 
735
779
  var target = getElementFromSelector(this);
736
780
 
@@ -745,8 +789,8 @@
745
789
  }
746
790
 
747
791
  EventHandler__default['default'].one(target, EVENT_HIDDEN, function () {
748
- if (isVisible(_this11)) {
749
- _this11.focus();
792
+ if (isVisible(_this12)) {
793
+ _this12.focus();
750
794
  }
751
795
  });
752
796
  });