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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -4
- data/README.md +1 -7
- data/Rakefile +4 -16
- data/assets/javascripts/bootstrap/alert.js +148 -73
- data/assets/javascripts/bootstrap/button.js +71 -154
- data/assets/javascripts/bootstrap/carousel.js +315 -209
- data/assets/javascripts/bootstrap/collapse.js +307 -153
- data/assets/javascripts/bootstrap/dom/data.js +81 -0
- data/assets/javascripts/bootstrap/dom/event-handler.js +311 -0
- data/assets/javascripts/bootstrap/dom/manipulator.js +100 -0
- data/assets/javascripts/bootstrap/dom/polyfill.js +110 -0
- data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
- data/assets/javascripts/bootstrap/dropdown.js +257 -205
- data/assets/javascripts/bootstrap/modal.js +354 -250
- data/assets/javascripts/bootstrap/popover.js +85 -94
- data/assets/javascripts/bootstrap/scrollspy.js +179 -107
- data/assets/javascripts/bootstrap/tab.js +170 -99
- data/assets/javascripts/bootstrap/toast.js +181 -110
- data/assets/javascripts/bootstrap/tooltip.js +375 -226
- data/assets/javascripts/bootstrap-sprockets.js +5 -1
- data/assets/javascripts/bootstrap.js +2260 -1550
- data/assets/javascripts/bootstrap.min.js +3 -3
- data/assets/stylesheets/_bootstrap-grid.scss +53 -18
- data/assets/stylesheets/_bootstrap-reboot.scss +6 -3
- data/assets/stylesheets/_bootstrap.scss +16 -10
- data/assets/stylesheets/bootstrap/_alert.scss +3 -4
- data/assets/stylesheets/bootstrap/_badge.scss +2 -27
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -17
- data/assets/stylesheets/bootstrap/_button-group.scss +16 -38
- data/assets/stylesheets/bootstrap/_buttons.scss +27 -45
- data/assets/stylesheets/bootstrap/_card.scss +22 -68
- data/assets/stylesheets/bootstrap/_carousel.scss +15 -20
- data/assets/stylesheets/bootstrap/_close.scss +9 -13
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +12 -9
- data/assets/stylesheets/bootstrap/_forms.scss +9 -347
- data/assets/stylesheets/bootstrap/_functions.scss +82 -69
- data/assets/stylesheets/bootstrap/_grid.scss +3 -54
- data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
- data/assets/stylesheets/bootstrap/_images.scss +1 -1
- data/assets/stylesheets/bootstrap/_list-group.scss +7 -4
- data/assets/stylesheets/bootstrap/_mixins.scss +6 -12
- data/assets/stylesheets/bootstrap/_modal.scss +36 -41
- data/assets/stylesheets/bootstrap/_nav.scss +7 -9
- data/assets/stylesheets/bootstrap/_navbar.scss +42 -82
- data/assets/stylesheets/bootstrap/_pagination.scss +7 -20
- data/assets/stylesheets/bootstrap/_popover.scss +14 -14
- data/assets/stylesheets/bootstrap/_progress.scss +3 -5
- data/assets/stylesheets/bootstrap/_reboot.scss +304 -172
- data/assets/stylesheets/bootstrap/_root.scss +5 -8
- data/assets/stylesheets/bootstrap/_spinners.scss +8 -17
- data/assets/stylesheets/bootstrap/_tables.scss +80 -114
- data/assets/stylesheets/bootstrap/_toasts.scss +2 -4
- data/assets/stylesheets/bootstrap/_tooltip.scss +9 -9
- data/assets/stylesheets/bootstrap/_transitions.scss +0 -7
- data/assets/stylesheets/bootstrap/_type.scss +38 -59
- data/assets/stylesheets/bootstrap/_utilities.scss +503 -18
- data/assets/stylesheets/bootstrap/_variables.scss +548 -437
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +142 -0
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +116 -0
- data/assets/stylesheets/bootstrap/forms/_form-file.scss +91 -0
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +136 -0
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +82 -0
- data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +140 -0
- data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
- data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
- data/assets/stylesheets/bootstrap/helpers/_embed.scss +31 -0
- data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
- data/assets/stylesheets/bootstrap/helpers/_screenreaders.scss +8 -0
- data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +0 -4
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +11 -8
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +62 -47
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +23 -85
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +86 -34
- data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +18 -24
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_transition.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +49 -0
- data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +214 -130
- data/bootstrap.gemspec +3 -1
- data/lib/bootstrap/engine.rb +1 -17
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +6 -18
- data/tasks/updater/network.rb +1 -7
- metadata +49 -47
- data/assets/javascripts/bootstrap/util.js +0 -189
- data/assets/stylesheets/bootstrap/_code.scss +0 -48
- data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
- data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
- data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
- data/assets/stylesheets/bootstrap/_media.scss +0 -8
- data/assets/stylesheets/bootstrap/_print.scss +0 -132
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
- data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
- data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
- data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
- data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
- data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
- data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
- data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
- data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
- data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
- data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
- data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
- data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
- data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
- data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
- data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
- data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
- data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
- data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
- data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
- data/test/gemfiles/rails_7_0_dartsass.gemfile +0 -8
- data/test/gemfiles/rails_7_0_sassc.gemfile +0 -8
- /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,72 +1,144 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap tab.js
|
3
|
-
* Copyright 2011-
|
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('
|
8
|
-
typeof define === 'function' && define.amd ? define(['
|
9
|
-
(global =
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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 = '
|
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
|
-
*
|
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 &&
|
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
|
86
|
-
|
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 =
|
162
|
+
previous = SelectorEngine.find(itemSelector, listElement);
|
91
163
|
previous = previous[previous.length - 1];
|
92
164
|
}
|
93
165
|
|
94
|
-
var hideEvent =
|
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
|
-
|
169
|
+
hideEvent = EventHandler.trigger(previous, EVENT_HIDE, {
|
170
|
+
relatedTarget: this._element
|
171
|
+
});
|
103
172
|
}
|
104
173
|
|
105
|
-
|
174
|
+
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
|
175
|
+
relatedTarget: previous
|
176
|
+
});
|
106
177
|
|
107
|
-
if (showEvent.
|
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
|
-
|
185
|
+
EventHandler.trigger(previous, EVENT_HIDDEN, {
|
119
186
|
relatedTarget: _this._element
|
120
187
|
});
|
121
|
-
|
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
|
-
|
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') ?
|
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 &&
|
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 =
|
154
|
-
|
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
|
-
|
163
|
-
var dropdownChild =
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
197
|
-
|
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.
|
271
|
+
Tab.jQueryInterface = function jQueryInterface(config) {
|
210
272
|
return this.each(function () {
|
211
|
-
var
|
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
|
-
*
|
299
|
+
* ------------------------------------------------------------------------
|
300
|
+
* Data Api implementation
|
301
|
+
* ------------------------------------------------------------------------
|
240
302
|
*/
|
241
303
|
|
242
304
|
|
243
|
-
|
305
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
244
306
|
event.preventDefault();
|
245
|
-
|
246
|
-
|
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
|
-
|
253
|
-
$__default["default"].fn[NAME].Constructor = Tab;
|
318
|
+
/* istanbul ignore if */
|
254
319
|
|
255
|
-
|
256
|
-
|
257
|
-
|
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
|
+
})));
|