bootstrap 4.6.2.1 → 5.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +0 -4
  3. data/README.md +1 -7
  4. data/Rakefile +4 -16
  5. data/assets/javascripts/bootstrap/alert.js +148 -73
  6. data/assets/javascripts/bootstrap/button.js +71 -154
  7. data/assets/javascripts/bootstrap/carousel.js +315 -209
  8. data/assets/javascripts/bootstrap/collapse.js +307 -153
  9. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +311 -0
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +100 -0
  12. data/assets/javascripts/bootstrap/dom/polyfill.js +110 -0
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +257 -205
  15. data/assets/javascripts/bootstrap/modal.js +354 -250
  16. data/assets/javascripts/bootstrap/popover.js +85 -94
  17. data/assets/javascripts/bootstrap/scrollspy.js +179 -107
  18. data/assets/javascripts/bootstrap/tab.js +170 -99
  19. data/assets/javascripts/bootstrap/toast.js +181 -110
  20. data/assets/javascripts/bootstrap/tooltip.js +375 -226
  21. data/assets/javascripts/bootstrap-sprockets.js +5 -1
  22. data/assets/javascripts/bootstrap.js +2260 -1550
  23. data/assets/javascripts/bootstrap.min.js +3 -3
  24. data/assets/stylesheets/_bootstrap-grid.scss +53 -18
  25. data/assets/stylesheets/_bootstrap-reboot.scss +6 -3
  26. data/assets/stylesheets/_bootstrap.scss +16 -10
  27. data/assets/stylesheets/bootstrap/_alert.scss +3 -4
  28. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  29. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -17
  30. data/assets/stylesheets/bootstrap/_button-group.scss +16 -38
  31. data/assets/stylesheets/bootstrap/_buttons.scss +27 -45
  32. data/assets/stylesheets/bootstrap/_card.scss +22 -68
  33. data/assets/stylesheets/bootstrap/_carousel.scss +15 -20
  34. data/assets/stylesheets/bootstrap/_close.scss +9 -13
  35. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  36. data/assets/stylesheets/bootstrap/_dropdown.scss +12 -9
  37. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  38. data/assets/stylesheets/bootstrap/_functions.scss +82 -69
  39. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  40. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  41. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  42. data/assets/stylesheets/bootstrap/_list-group.scss +7 -4
  43. data/assets/stylesheets/bootstrap/_mixins.scss +6 -12
  44. data/assets/stylesheets/bootstrap/_modal.scss +36 -41
  45. data/assets/stylesheets/bootstrap/_nav.scss +7 -9
  46. data/assets/stylesheets/bootstrap/_navbar.scss +42 -82
  47. data/assets/stylesheets/bootstrap/_pagination.scss +7 -20
  48. data/assets/stylesheets/bootstrap/_popover.scss +14 -14
  49. data/assets/stylesheets/bootstrap/_progress.scss +3 -5
  50. data/assets/stylesheets/bootstrap/_reboot.scss +304 -172
  51. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  52. data/assets/stylesheets/bootstrap/_spinners.scss +8 -17
  53. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  54. data/assets/stylesheets/bootstrap/_toasts.scss +2 -4
  55. data/assets/stylesheets/bootstrap/_tooltip.scss +9 -9
  56. data/assets/stylesheets/bootstrap/_transitions.scss +0 -7
  57. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  58. data/assets/stylesheets/bootstrap/_utilities.scss +503 -18
  59. data/assets/stylesheets/bootstrap/_variables.scss +548 -437
  60. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  61. data/assets/stylesheets/bootstrap/forms/_form-check.scss +142 -0
  62. data/assets/stylesheets/bootstrap/forms/_form-control.scss +116 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-file.scss +91 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-range.scss +136 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-select.scss +82 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  67. data/assets/stylesheets/bootstrap/forms/_input-group.scss +140 -0
  68. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  69. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  70. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  71. data/assets/stylesheets/bootstrap/helpers/_embed.scss +31 -0
  72. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  73. data/assets/stylesheets/bootstrap/helpers/_screenreaders.scss +8 -0
  74. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  75. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  76. data/assets/stylesheets/bootstrap/mixins/_alert.scss +0 -4
  77. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +1 -1
  78. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +11 -8
  79. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +62 -47
  80. data/assets/stylesheets/bootstrap/mixins/_caret.scss +4 -4
  81. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  82. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  83. data/assets/stylesheets/bootstrap/mixins/_forms.scss +23 -85
  84. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
  85. data/assets/stylesheets/bootstrap/mixins/_grid.scss +86 -34
  86. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  87. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -1
  88. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  89. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  90. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
  91. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +18 -24
  92. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  93. data/assets/stylesheets/bootstrap/mixins/_transition.scss +2 -2
  94. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +49 -0
  95. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +214 -130
  97. data/bootstrap.gemspec +3 -1
  98. data/lib/bootstrap/engine.rb +1 -17
  99. data/lib/bootstrap/version.rb +2 -2
  100. data/tasks/updater/js.rb +6 -18
  101. data/tasks/updater/network.rb +1 -7
  102. metadata +49 -47
  103. data/assets/javascripts/bootstrap/util.js +0 -189
  104. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  105. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  106. data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
  107. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  108. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  109. data/assets/stylesheets/bootstrap/_print.scss +0 -132
  110. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  111. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  112. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  113. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  114. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  115. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  116. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  117. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  118. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  119. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  120. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  121. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  122. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  123. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  124. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  125. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  126. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  127. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  128. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  129. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  130. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  131. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  132. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  133. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  134. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  135. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  136. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  137. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  138. data/test/gemfiles/rails_7_0_dartsass.gemfile +0 -8
  139. data/test/gemfiles/rails_7_0_sassc.gemfile +0 -8
  140. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,72 +1,144 @@
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-alpha1 (https://getbootstrap.com/)
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('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';
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
- var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
16
-
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);
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js')) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/selector-engine.js'], factory) :
9
+ (global = global || self, global.Tab = factory(global.Data, global.EventHandler, global.SelectorEngine));
10
+ }(this, (function (Data, EventHandler, SelectorEngine) { 'use strict';
11
+
12
+ Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
13
+ EventHandler = EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') ? EventHandler['default'] : EventHandler;
14
+ SelectorEngine = SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default') ? SelectorEngine['default'] : SelectorEngine;
15
+
16
+ /**
17
+ * --------------------------------------------------------------------------
18
+ * Bootstrap (v5.0.0-alpha1): util/index.js
19
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
20
+ * --------------------------------------------------------------------------
21
+ */
22
+ var MILLISECONDS_MULTIPLIER = 1000;
23
+ var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
24
+
25
+ var getSelector = function getSelector(element) {
26
+ var selector = element.getAttribute('data-target');
27
+
28
+ if (!selector || selector === '#') {
29
+ var hrefAttr = element.getAttribute('href');
30
+ selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
24
31
  }
25
- }
26
32
 
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
32
- });
33
- return Constructor;
34
- }
33
+ return selector;
34
+ };
35
+
36
+ var getElementFromSelector = function getElementFromSelector(element) {
37
+ var selector = getSelector(element);
38
+ return selector ? document.querySelector(selector) : null;
39
+ };
40
+
41
+ var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
42
+ if (!element) {
43
+ return 0;
44
+ } // Get transition-duration of the element
45
+
46
+
47
+ var _window$getComputedSt = window.getComputedStyle(element),
48
+ transitionDuration = _window$getComputedSt.transitionDuration,
49
+ transitionDelay = _window$getComputedSt.transitionDelay;
50
+
51
+ var floatTransitionDuration = parseFloat(transitionDuration);
52
+ var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
53
+
54
+ if (!floatTransitionDuration && !floatTransitionDelay) {
55
+ return 0;
56
+ } // If multiple durations are defined, take the first
57
+
58
+
59
+ transitionDuration = transitionDuration.split(',')[0];
60
+ transitionDelay = transitionDelay.split(',')[0];
61
+ return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
62
+ };
63
+
64
+ var triggerTransitionEnd = function triggerTransitionEnd(element) {
65
+ element.dispatchEvent(new Event(TRANSITION_END));
66
+ };
67
+
68
+ var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
69
+ var called = false;
70
+ var durationPadding = 5;
71
+ var emulatedDuration = duration + durationPadding;
72
+
73
+ function listener() {
74
+ called = true;
75
+ element.removeEventListener(TRANSITION_END, listener);
76
+ }
77
+
78
+ element.addEventListener(TRANSITION_END, listener);
79
+ setTimeout(function () {
80
+ if (!called) {
81
+ triggerTransitionEnd(element);
82
+ }
83
+ }, emulatedDuration);
84
+ };
85
+
86
+ var reflow = function reflow(element) {
87
+ return element.offsetHeight;
88
+ };
89
+
90
+ var getjQuery = function getjQuery() {
91
+ var _window = window,
92
+ jQuery = _window.jQuery;
93
+
94
+ if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
95
+ return jQuery;
96
+ }
97
+
98
+ return null;
99
+ };
100
+
101
+ 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); } }
35
102
 
103
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
36
104
  /**
105
+ * ------------------------------------------------------------------------
37
106
  * Constants
107
+ * ------------------------------------------------------------------------
38
108
  */
39
109
 
40
110
  var NAME = 'tab';
41
- var VERSION = '4.6.2';
111
+ var VERSION = '5.0.0-alpha1';
42
112
  var DATA_KEY = 'bs.tab';
43
113
  var EVENT_KEY = "." + DATA_KEY;
44
114
  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
115
  var EVENT_HIDE = "hide" + EVENT_KEY;
52
116
  var EVENT_HIDDEN = "hidden" + EVENT_KEY;
53
117
  var EVENT_SHOW = "show" + EVENT_KEY;
54
118
  var EVENT_SHOWN = "shown" + EVENT_KEY;
55
119
  var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
120
+ var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
121
+ var CLASS_NAME_ACTIVE = 'active';
122
+ var CLASS_NAME_DISABLED = 'disabled';
123
+ var CLASS_NAME_FADE = 'fade';
124
+ var CLASS_NAME_SHOW = 'show';
56
125
  var SELECTOR_DROPDOWN = '.dropdown';
57
126
  var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
58
127
  var SELECTOR_ACTIVE = '.active';
59
- var SELECTOR_ACTIVE_UL = '> li > .active';
128
+ var SELECTOR_ACTIVE_UL = ':scope > li > .active';
60
129
  var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
61
130
  var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
62
- var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
131
+ var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
63
132
  /**
64
- * Class definition
133
+ * ------------------------------------------------------------------------
134
+ * Class Definition
135
+ * ------------------------------------------------------------------------
65
136
  */
66
137
 
67
138
  var Tab = /*#__PURE__*/function () {
68
139
  function Tab(element) {
69
140
  this._element = element;
141
+ Data.setData(this._element, DATA_KEY, this);
70
142
  } // Getters
71
143
 
72
144
 
@@ -76,53 +148,46 @@
76
148
  _proto.show = function show() {
77
149
  var _this = this;
78
150
 
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')) {
151
+ if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE) || this._element.classList.contains(CLASS_NAME_DISABLED)) {
80
152
  return;
81
153
  }
82
154
 
83
- var target;
84
155
  var previous;
85
- var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
86
- var selector = Util__default["default"].getSelectorFromElement(this._element);
156
+ var target = getElementFromSelector(this._element);
157
+
158
+ var listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
87
159
 
88
160
  if (listElement) {
89
161
  var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
90
- previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector));
162
+ previous = SelectorEngine.find(itemSelector, listElement);
91
163
  previous = previous[previous.length - 1];
92
164
  }
93
165
 
94
- var hideEvent = $__default["default"].Event(EVENT_HIDE, {
95
- relatedTarget: this._element
96
- });
97
- var showEvent = $__default["default"].Event(EVENT_SHOW, {
98
- relatedTarget: previous
99
- });
166
+ var hideEvent = null;
100
167
 
101
168
  if (previous) {
102
- $__default["default"](previous).trigger(hideEvent);
169
+ hideEvent = EventHandler.trigger(previous, EVENT_HIDE, {
170
+ relatedTarget: this._element
171
+ });
103
172
  }
104
173
 
105
- $__default["default"](this._element).trigger(showEvent);
174
+ var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
175
+ relatedTarget: previous
176
+ });
106
177
 
107
- if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
178
+ if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
108
179
  return;
109
180
  }
110
181
 
111
- if (selector) {
112
- target = document.querySelector(selector);
113
- }
114
-
115
182
  this._activate(this._element, listElement);
116
183
 
117
184
  var complete = function complete() {
118
- var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN, {
185
+ EventHandler.trigger(previous, EVENT_HIDDEN, {
119
186
  relatedTarget: _this._element
120
187
  });
121
- var shownEvent = $__default["default"].Event(EVENT_SHOWN, {
188
+ EventHandler.trigger(_this._element, EVENT_SHOWN, {
122
189
  relatedTarget: previous
123
190
  });
124
- $__default["default"](previous).trigger(hiddenEvent);
125
- $__default["default"](_this._element).trigger(shownEvent);
126
191
  };
127
192
 
128
193
  if (target) {
@@ -133,7 +198,7 @@
133
198
  };
134
199
 
135
200
  _proto.dispose = function dispose() {
136
- $__default["default"].removeData(this._element, DATA_KEY);
201
+ Data.removeData(this._element, DATA_KEY);
137
202
  this._element = null;
138
203
  } // Private
139
204
  ;
@@ -141,17 +206,19 @@
141
206
  _proto._activate = function _activate(element, container, callback) {
142
207
  var _this2 = this;
143
208
 
144
- var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE);
209
+ var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE);
145
210
  var active = activeElements[0];
146
- var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE);
211
+ var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE);
147
212
 
148
213
  var complete = function complete() {
149
214
  return _this2._transitionComplete(element, active, callback);
150
215
  };
151
216
 
152
217
  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);
218
+ var transitionDuration = getTransitionDurationFromElement(active);
219
+ active.classList.remove(CLASS_NAME_SHOW);
220
+ EventHandler.one(active, TRANSITION_END, complete);
221
+ emulateTransitionEnd(active, transitionDuration);
155
222
  } else {
156
223
  complete();
157
224
  }
@@ -159,11 +226,11 @@
159
226
 
160
227
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
161
228
  if (active) {
162
- $__default["default"](active).removeClass(CLASS_NAME_ACTIVE);
163
- var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
229
+ active.classList.remove(CLASS_NAME_ACTIVE);
230
+ var dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
164
231
 
165
232
  if (dropdownChild) {
166
- $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE);
233
+ dropdownChild.classList.remove(CLASS_NAME_ACTIVE);
167
234
  }
168
235
 
169
236
  if (active.getAttribute('role') === 'tab') {
@@ -171,30 +238,25 @@
171
238
  }
172
239
  }
173
240
 
174
- $__default["default"](element).addClass(CLASS_NAME_ACTIVE);
241
+ element.classList.add(CLASS_NAME_ACTIVE);
175
242
 
176
243
  if (element.getAttribute('role') === 'tab') {
177
244
  element.setAttribute('aria-selected', true);
178
245
  }
179
246
 
180
- Util__default["default"].reflow(element);
247
+ reflow(element);
181
248
 
182
249
  if (element.classList.contains(CLASS_NAME_FADE)) {
183
250
  element.classList.add(CLASS_NAME_SHOW);
184
251
  }
185
252
 
186
- var parent = element.parentNode;
187
-
188
- if (parent && parent.nodeName === 'LI') {
189
- parent = parent.parentNode;
190
- }
191
-
192
- if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
193
- var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0];
253
+ if (element.parentNode && element.parentNode.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
254
+ var dropdownElement = element.closest(SELECTOR_DROPDOWN);
194
255
 
195
256
  if (dropdownElement) {
196
- var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));
197
- $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
257
+ SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE).forEach(function (dropdown) {
258
+ return dropdown.classList.add(CLASS_NAME_ACTIVE);
259
+ });
198
260
  }
199
261
 
200
262
  element.setAttribute('aria-expanded', true);
@@ -206,15 +268,9 @@
206
268
  } // Static
207
269
  ;
208
270
 
209
- Tab._jQueryInterface = function _jQueryInterface(config) {
271
+ Tab.jQueryInterface = function jQueryInterface(config) {
210
272
  return this.each(function () {
211
- var $this = $__default["default"](this);
212
- var data = $this.data(DATA_KEY);
213
-
214
- if (!data) {
215
- data = new Tab(this);
216
- $this.data(DATA_KEY, data);
217
- }
273
+ var data = Data.getData(this, DATA_KEY) || new Tab(this);
218
274
 
219
275
  if (typeof config === 'string') {
220
276
  if (typeof data[config] === 'undefined') {
@@ -226,6 +282,10 @@
226
282
  });
227
283
  };
228
284
 
285
+ Tab.getInstance = function getInstance(element) {
286
+ return Data.getData(element, DATA_KEY);
287
+ };
288
+
229
289
  _createClass(Tab, null, [{
230
290
  key: "VERSION",
231
291
  get: function get() {
@@ -236,27 +296,38 @@
236
296
  return Tab;
237
297
  }();
238
298
  /**
239
- * Data API implementation
299
+ * ------------------------------------------------------------------------
300
+ * Data Api implementation
301
+ * ------------------------------------------------------------------------
240
302
  */
241
303
 
242
304
 
243
- $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
305
+ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
244
306
  event.preventDefault();
245
-
246
- Tab._jQueryInterface.call($__default["default"](this), 'show');
307
+ var data = Data.getData(this, DATA_KEY) || new Tab(this);
308
+ data.show();
247
309
  });
310
+ var $ = getjQuery();
248
311
  /**
312
+ * ------------------------------------------------------------------------
249
313
  * jQuery
314
+ * ------------------------------------------------------------------------
315
+ * add .tab to jQuery only if jQuery is present
250
316
  */
251
317
 
252
- $__default["default"].fn[NAME] = Tab._jQueryInterface;
253
- $__default["default"].fn[NAME].Constructor = Tab;
318
+ /* istanbul ignore if */
254
319
 
255
- $__default["default"].fn[NAME].noConflict = function () {
256
- $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
257
- return Tab._jQueryInterface;
258
- };
320
+ if ($) {
321
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
322
+ $.fn[NAME] = Tab.jQueryInterface;
323
+ $.fn[NAME].Constructor = Tab;
324
+
325
+ $.fn[NAME].noConflict = function () {
326
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
327
+ return Tab.jQueryInterface;
328
+ };
329
+ }
259
330
 
260
331
  return Tab;
261
332
 
262
- }));
333
+ })));