bootstrap 4.6.2 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap/alert.js +192 -115
  5. data/assets/javascripts/bootstrap/base-component.js +63 -0
  6. data/assets/javascripts/bootstrap/button.js +96 -179
  7. data/assets/javascripts/bootstrap/carousel.js +472 -359
  8. data/assets/javascripts/bootstrap/collapse.js +379 -225
  9. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  12. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  13. data/assets/javascripts/bootstrap/dropdown.js +472 -355
  14. data/assets/javascripts/bootstrap/modal.js +612 -438
  15. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  16. data/assets/javascripts/bootstrap/popover.js +138 -167
  17. data/assets/javascripts/bootstrap/scrollspy.js +250 -192
  18. data/assets/javascripts/bootstrap/tab.js +241 -144
  19. data/assets/javascripts/bootstrap/toast.js +223 -157
  20. data/assets/javascripts/bootstrap/tooltip.js +651 -487
  21. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  22. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  23. data/assets/javascripts/bootstrap-sprockets.js +8 -1
  24. data/assets/javascripts/bootstrap.js +3277 -2590
  25. data/assets/javascripts/bootstrap.min.js +3 -3
  26. data/assets/stylesheets/_bootstrap-grid.scss +53 -18
  27. data/assets/stylesheets/_bootstrap-reboot.scss +6 -3
  28. data/assets/stylesheets/_bootstrap.scss +18 -10
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +29 -60
  35. data/assets/stylesheets/bootstrap/_card.scss +20 -91
  36. data/assets/stylesheets/bootstrap/_carousel.scss +64 -35
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +84 -36
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  41. data/assets/stylesheets/bootstrap/_functions.scss +84 -69
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  45. data/assets/stylesheets/bootstrap/_list-group.scss +28 -8
  46. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  47. data/assets/stylesheets/bootstrap/_modal.scss +45 -57
  48. data/assets/stylesheets/bootstrap/_nav.scss +20 -6
  49. data/assets/stylesheets/bootstrap/_navbar.scss +45 -71
  50. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  51. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  52. data/assets/stylesheets/bootstrap/_popover.scss +24 -36
  53. data/assets/stylesheets/bootstrap/_progress.scss +5 -4
  54. data/assets/stylesheets/bootstrap/_reboot.scss +316 -179
  55. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  56. data/assets/stylesheets/bootstrap/_spinners.scss +11 -7
  57. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  58. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  59. data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
  60. data/assets/stylesheets/bootstrap/_transitions.scss +2 -7
  61. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  62. data/assets/stylesheets/bootstrap/_utilities.scss +594 -18
  63. data/assets/stylesheets/bootstrap/_variables.scss +800 -485
  64. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  65. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  71. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  72. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  73. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  74. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  75. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  76. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  77. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  78. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  79. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  80. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  81. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  82. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  83. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  84. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +71 -48
  85. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  86. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  87. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  88. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  89. data/assets/stylesheets/bootstrap/mixins/_forms.scss +39 -97
  90. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  91. data/assets/stylesheets/bootstrap/mixins/_grid.scss +90 -34
  92. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  93. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  94. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  95. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  96. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
  97. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  98. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  99. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  100. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  101. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  102. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +214 -130
  103. data/bootstrap.gemspec +1 -3
  104. data/lib/bootstrap/version.rb +2 -2
  105. data/tasks/updater/js.rb +19 -16
  106. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  107. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  108. data/test/dummy_rails/app/views/pages/root.html +89 -0
  109. data/test/dummy_rails/config/application.rb +0 -3
  110. data/test/gemfiles/rails_6_1.gemfile +7 -0
  111. metadata +45 -73
  112. data/assets/javascripts/bootstrap/util.js +0 -189
  113. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  114. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  115. data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
  116. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  117. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  118. data/assets/stylesheets/bootstrap/_print.scss +0 -132
  119. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  120. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  121. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  122. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  123. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  124. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  125. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  126. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  127. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  128. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  129. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  130. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  131. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  132. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  133. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  134. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  135. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  136. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  137. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  138. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  139. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  140. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  141. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  142. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  143. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  144. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  145. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  146. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  147. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  148. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  149. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,128 +1,241 @@
1
1
  /*!
2
- * Bootstrap tab.js v4.6.2 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap tab.js v5.0.0 (https://getbootstrap.com/)
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('jquery'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', './util'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.jQuery, global.Util));
10
- })(this, (function ($, Util) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/selector-engine', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.Data, global.EventHandler, global.SelectorEngine, global.Base));
10
+ }(this, (function (Data, EventHandler, SelectorEngine, 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 $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
- var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
14
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
17
+ var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
16
18
 
17
- function _defineProperties(target, props) {
18
- for (var i = 0; i < props.length; i++) {
19
- var descriptor = props[i];
20
- descriptor.enumerable = descriptor.enumerable || false;
21
- descriptor.configurable = true;
22
- if ("value" in descriptor) descriptor.writable = true;
23
- Object.defineProperty(target, descriptor.key, descriptor);
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
+ const MILLISECONDS_MULTIPLIER = 1000;
26
+ const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
27
+
28
+ const getSelector = element => {
29
+ let selector = element.getAttribute('data-bs-target');
30
+
31
+ if (!selector || selector === '#') {
32
+ let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
33
+ // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
34
+ // `document.querySelector` will rightfully complain it is invalid.
35
+ // See https://github.com/twbs/bootstrap/issues/32273
36
+
37
+ if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
38
+ return null;
39
+ } // Just in case some CMS puts out a full URL with the anchor appended
40
+
41
+
42
+ if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
43
+ hrefAttr = `#${hrefAttr.split('#')[1]}`;
44
+ }
45
+
46
+ selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
24
47
  }
25
- }
26
48
 
27
- function _createClass(Constructor, protoProps, staticProps) {
28
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
29
- if (staticProps) _defineProperties(Constructor, staticProps);
30
- Object.defineProperty(Constructor, "prototype", {
31
- writable: false
49
+ return selector;
50
+ };
51
+
52
+ const getElementFromSelector = element => {
53
+ const selector = getSelector(element);
54
+ return selector ? document.querySelector(selector) : null;
55
+ };
56
+
57
+ const getTransitionDurationFromElement = element => {
58
+ if (!element) {
59
+ return 0;
60
+ } // Get transition-duration of the element
61
+
62
+
63
+ let {
64
+ transitionDuration,
65
+ transitionDelay
66
+ } = window.getComputedStyle(element);
67
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
68
+ const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
69
+
70
+ if (!floatTransitionDuration && !floatTransitionDelay) {
71
+ return 0;
72
+ } // If multiple durations are defined, take the first
73
+
74
+
75
+ transitionDuration = transitionDuration.split(',')[0];
76
+ transitionDelay = transitionDelay.split(',')[0];
77
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
78
+ };
79
+
80
+ const triggerTransitionEnd = element => {
81
+ element.dispatchEvent(new Event(TRANSITION_END));
82
+ };
83
+
84
+ const emulateTransitionEnd = (element, duration) => {
85
+ let called = false;
86
+ const durationPadding = 5;
87
+ const emulatedDuration = duration + durationPadding;
88
+
89
+ function listener() {
90
+ called = true;
91
+ element.removeEventListener(TRANSITION_END, listener);
92
+ }
93
+
94
+ element.addEventListener(TRANSITION_END, listener);
95
+ setTimeout(() => {
96
+ if (!called) {
97
+ triggerTransitionEnd(element);
98
+ }
99
+ }, emulatedDuration);
100
+ };
101
+
102
+ const isDisabled = element => {
103
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) {
104
+ return true;
105
+ }
106
+
107
+ if (element.classList.contains('disabled')) {
108
+ return true;
109
+ }
110
+
111
+ if (typeof element.disabled !== 'undefined') {
112
+ return element.disabled;
113
+ }
114
+
115
+ return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
116
+ };
117
+
118
+ const reflow = element => element.offsetHeight;
119
+
120
+ const getjQuery = () => {
121
+ const {
122
+ jQuery
123
+ } = window;
124
+
125
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
126
+ return jQuery;
127
+ }
128
+
129
+ return null;
130
+ };
131
+
132
+ const onDOMContentLoaded = callback => {
133
+ if (document.readyState === 'loading') {
134
+ document.addEventListener('DOMContentLoaded', callback);
135
+ } else {
136
+ callback();
137
+ }
138
+ };
139
+
140
+ const defineJQueryPlugin = (name, plugin) => {
141
+ onDOMContentLoaded(() => {
142
+ const $ = getjQuery();
143
+ /* istanbul ignore if */
144
+
145
+ if ($) {
146
+ const JQUERY_NO_CONFLICT = $.fn[name];
147
+ $.fn[name] = plugin.jQueryInterface;
148
+ $.fn[name].Constructor = plugin;
149
+
150
+ $.fn[name].noConflict = () => {
151
+ $.fn[name] = JQUERY_NO_CONFLICT;
152
+ return plugin.jQueryInterface;
153
+ };
154
+ }
32
155
  });
33
- return Constructor;
34
- }
156
+ };
35
157
 
36
158
  /**
159
+ * --------------------------------------------------------------------------
160
+ * Bootstrap (v5.0.0): tab.js
161
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
162
+ * --------------------------------------------------------------------------
163
+ */
164
+ /**
165
+ * ------------------------------------------------------------------------
37
166
  * Constants
167
+ * ------------------------------------------------------------------------
38
168
  */
39
169
 
40
- var NAME = 'tab';
41
- var VERSION = '4.6.2';
42
- var DATA_KEY = 'bs.tab';
43
- var EVENT_KEY = "." + DATA_KEY;
44
- var DATA_API_KEY = '.data-api';
45
- var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
46
- var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
47
- var CLASS_NAME_ACTIVE = 'active';
48
- var CLASS_NAME_DISABLED = 'disabled';
49
- var CLASS_NAME_FADE = 'fade';
50
- var CLASS_NAME_SHOW = 'show';
51
- var EVENT_HIDE = "hide" + EVENT_KEY;
52
- var EVENT_HIDDEN = "hidden" + EVENT_KEY;
53
- var EVENT_SHOW = "show" + EVENT_KEY;
54
- var EVENT_SHOWN = "shown" + EVENT_KEY;
55
- var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
56
- var SELECTOR_DROPDOWN = '.dropdown';
57
- var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
58
- var SELECTOR_ACTIVE = '.active';
59
- var SELECTOR_ACTIVE_UL = '> li > .active';
60
- var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
61
- var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
62
- var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
170
+ const NAME = 'tab';
171
+ const DATA_KEY = 'bs.tab';
172
+ const EVENT_KEY = `.${DATA_KEY}`;
173
+ const DATA_API_KEY = '.data-api';
174
+ const EVENT_HIDE = `hide${EVENT_KEY}`;
175
+ const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
176
+ const EVENT_SHOW = `show${EVENT_KEY}`;
177
+ const EVENT_SHOWN = `shown${EVENT_KEY}`;
178
+ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
179
+ const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
180
+ const CLASS_NAME_ACTIVE = 'active';
181
+ const CLASS_NAME_FADE = 'fade';
182
+ const CLASS_NAME_SHOW = 'show';
183
+ const SELECTOR_DROPDOWN = '.dropdown';
184
+ const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
185
+ const SELECTOR_ACTIVE = '.active';
186
+ const SELECTOR_ACTIVE_UL = ':scope > li > .active';
187
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
188
+ const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
189
+ const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
63
190
  /**
64
- * Class definition
191
+ * ------------------------------------------------------------------------
192
+ * Class Definition
193
+ * ------------------------------------------------------------------------
65
194
  */
66
195
 
67
- var Tab = /*#__PURE__*/function () {
68
- function Tab(element) {
69
- this._element = element;
70
- } // Getters
71
-
196
+ class Tab extends BaseComponent__default['default'] {
197
+ // Getters
198
+ static get DATA_KEY() {
199
+ return DATA_KEY;
200
+ } // Public
72
201
 
73
- var _proto = Tab.prototype;
74
202
 
75
- // Public
76
- _proto.show = function show() {
77
- var _this = this;
78
-
79
- if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute('disabled')) {
203
+ show() {
204
+ if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
80
205
  return;
81
206
  }
82
207
 
83
- var target;
84
- var previous;
85
- var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
86
- var selector = Util__default["default"].getSelectorFromElement(this._element);
208
+ let previous;
209
+ const target = getElementFromSelector(this._element);
210
+
211
+ const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
87
212
 
88
213
  if (listElement) {
89
- var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
90
- previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector));
214
+ const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
215
+ previous = SelectorEngine__default['default'].find(itemSelector, listElement);
91
216
  previous = previous[previous.length - 1];
92
217
  }
93
218
 
94
- var hideEvent = $__default["default"].Event(EVENT_HIDE, {
219
+ const hideEvent = previous ? EventHandler__default['default'].trigger(previous, EVENT_HIDE, {
95
220
  relatedTarget: this._element
96
- });
97
- var showEvent = $__default["default"].Event(EVENT_SHOW, {
221
+ }) : null;
222
+ const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
98
223
  relatedTarget: previous
99
224
  });
100
225
 
101
- if (previous) {
102
- $__default["default"](previous).trigger(hideEvent);
103
- }
104
-
105
- $__default["default"](this._element).trigger(showEvent);
106
-
107
- if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
226
+ if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
108
227
  return;
109
228
  }
110
229
 
111
- if (selector) {
112
- target = document.querySelector(selector);
113
- }
114
-
115
230
  this._activate(this._element, listElement);
116
231
 
117
- var complete = function complete() {
118
- var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN, {
119
- relatedTarget: _this._element
232
+ const complete = () => {
233
+ EventHandler__default['default'].trigger(previous, EVENT_HIDDEN, {
234
+ relatedTarget: this._element
120
235
  });
121
- var shownEvent = $__default["default"].Event(EVENT_SHOWN, {
236
+ EventHandler__default['default'].trigger(this._element, EVENT_SHOWN, {
122
237
  relatedTarget: previous
123
238
  });
124
- $__default["default"](previous).trigger(hiddenEvent);
125
- $__default["default"](_this._element).trigger(shownEvent);
126
239
  };
127
240
 
128
241
  if (target) {
@@ -130,40 +243,33 @@
130
243
  } else {
131
244
  complete();
132
245
  }
133
- };
134
-
135
- _proto.dispose = function dispose() {
136
- $__default["default"].removeData(this._element, DATA_KEY);
137
- this._element = null;
138
246
  } // Private
139
- ;
140
247
 
141
- _proto._activate = function _activate(element, container, callback) {
142
- var _this2 = this;
143
248
 
144
- var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE);
145
- var active = activeElements[0];
146
- var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE);
249
+ _activate(element, container, callback) {
250
+ const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine__default['default'].find(SELECTOR_ACTIVE_UL, container) : SelectorEngine__default['default'].children(container, SELECTOR_ACTIVE);
251
+ const active = activeElements[0];
252
+ const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE);
147
253
 
148
- var complete = function complete() {
149
- return _this2._transitionComplete(element, active, callback);
150
- };
254
+ const complete = () => this._transitionComplete(element, active, callback);
151
255
 
152
256
  if (active && isTransitioning) {
153
- var transitionDuration = Util__default["default"].getTransitionDurationFromElement(active);
154
- $__default["default"](active).removeClass(CLASS_NAME_SHOW).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
257
+ const transitionDuration = getTransitionDurationFromElement(active);
258
+ active.classList.remove(CLASS_NAME_SHOW);
259
+ EventHandler__default['default'].one(active, 'transitionend', complete);
260
+ emulateTransitionEnd(active, transitionDuration);
155
261
  } else {
156
262
  complete();
157
263
  }
158
- };
264
+ }
159
265
 
160
- _proto._transitionComplete = function _transitionComplete(element, active, callback) {
266
+ _transitionComplete(element, active, callback) {
161
267
  if (active) {
162
- $__default["default"](active).removeClass(CLASS_NAME_ACTIVE);
163
- var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
268
+ active.classList.remove(CLASS_NAME_ACTIVE);
269
+ const dropdownChild = SelectorEngine__default['default'].findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
164
270
 
165
271
  if (dropdownChild) {
166
- $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE);
272
+ dropdownChild.classList.remove(CLASS_NAME_ACTIVE);
167
273
  }
168
274
 
169
275
  if (active.getAttribute('role') === 'tab') {
@@ -171,30 +277,29 @@
171
277
  }
172
278
  }
173
279
 
174
- $__default["default"](element).addClass(CLASS_NAME_ACTIVE);
280
+ element.classList.add(CLASS_NAME_ACTIVE);
175
281
 
176
282
  if (element.getAttribute('role') === 'tab') {
177
283
  element.setAttribute('aria-selected', true);
178
284
  }
179
285
 
180
- Util__default["default"].reflow(element);
286
+ reflow(element);
181
287
 
182
288
  if (element.classList.contains(CLASS_NAME_FADE)) {
183
289
  element.classList.add(CLASS_NAME_SHOW);
184
290
  }
185
291
 
186
- var parent = element.parentNode;
292
+ let parent = element.parentNode;
187
293
 
188
294
  if (parent && parent.nodeName === 'LI') {
189
295
  parent = parent.parentNode;
190
296
  }
191
297
 
192
- if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
193
- var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0];
298
+ if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
299
+ const dropdownElement = element.closest(SELECTOR_DROPDOWN);
194
300
 
195
301
  if (dropdownElement) {
196
- var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));
197
- $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
302
+ SelectorEngine__default['default'].find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
198
303
  }
199
304
 
200
305
  element.setAttribute('aria-expanded', true);
@@ -204,59 +309,51 @@
204
309
  callback();
205
310
  }
206
311
  } // Static
207
- ;
208
312
 
209
- Tab._jQueryInterface = function _jQueryInterface(config) {
210
- return this.each(function () {
211
- var $this = $__default["default"](this);
212
- var data = $this.data(DATA_KEY);
213
313
 
214
- if (!data) {
215
- data = new Tab(this);
216
- $this.data(DATA_KEY, data);
217
- }
314
+ static jQueryInterface(config) {
315
+ return this.each(function () {
316
+ const data = Data__default['default'].get(this, DATA_KEY) || new Tab(this);
218
317
 
219
318
  if (typeof config === 'string') {
220
319
  if (typeof data[config] === 'undefined') {
221
- throw new TypeError("No method named \"" + config + "\"");
320
+ throw new TypeError(`No method named "${config}"`);
222
321
  }
223
322
 
224
323
  data[config]();
225
324
  }
226
325
  });
227
- };
228
-
229
- _createClass(Tab, null, [{
230
- key: "VERSION",
231
- get: function get() {
232
- return VERSION;
233
- }
234
- }]);
326
+ }
235
327
 
236
- return Tab;
237
- }();
328
+ }
238
329
  /**
239
- * Data API implementation
330
+ * ------------------------------------------------------------------------
331
+ * Data Api implementation
332
+ * ------------------------------------------------------------------------
240
333
  */
241
334
 
242
335
 
243
- $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
244
- event.preventDefault();
336
+ EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
337
+ if (['A', 'AREA'].includes(this.tagName)) {
338
+ event.preventDefault();
339
+ }
245
340
 
246
- Tab._jQueryInterface.call($__default["default"](this), 'show');
341
+ if (isDisabled(this)) {
342
+ return;
343
+ }
344
+
345
+ const data = Data__default['default'].get(this, DATA_KEY) || new Tab(this);
346
+ data.show();
247
347
  });
248
348
  /**
349
+ * ------------------------------------------------------------------------
249
350
  * jQuery
351
+ * ------------------------------------------------------------------------
352
+ * add .Tab to jQuery only if jQuery is present
250
353
  */
251
354
 
252
- $__default["default"].fn[NAME] = Tab._jQueryInterface;
253
- $__default["default"].fn[NAME].Constructor = Tab;
254
-
255
- $__default["default"].fn[NAME].noConflict = function () {
256
- $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
257
- return Tab._jQueryInterface;
258
- };
355
+ defineJQueryPlugin(NAME, Tab);
259
356
 
260
357
  return Tab;
261
358
 
262
- }));
359
+ })));