bootstrap 4.6.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +7 -4
- data/assets/javascripts/bootstrap/alert.js +192 -115
- data/assets/javascripts/bootstrap/base-component.js +63 -0
- data/assets/javascripts/bootstrap/button.js +96 -179
- data/assets/javascripts/bootstrap/carousel.js +472 -359
- data/assets/javascripts/bootstrap/collapse.js +379 -225
- data/assets/javascripts/bootstrap/dom/data.js +68 -0
- data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
- data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
- data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
- data/assets/javascripts/bootstrap/dropdown.js +472 -355
- data/assets/javascripts/bootstrap/modal.js +612 -438
- data/assets/javascripts/bootstrap/offcanvas.js +671 -0
- data/assets/javascripts/bootstrap/popover.js +138 -167
- data/assets/javascripts/bootstrap/scrollspy.js +250 -192
- data/assets/javascripts/bootstrap/tab.js +241 -144
- data/assets/javascripts/bootstrap/toast.js +223 -157
- data/assets/javascripts/bootstrap/tooltip.js +651 -487
- data/assets/javascripts/bootstrap-global-this-define.js +6 -0
- data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
- data/assets/javascripts/bootstrap-sprockets.js +8 -1
- data/assets/javascripts/bootstrap.js +3277 -2590
- 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 +18 -10
- data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
- data/assets/stylesheets/bootstrap/_alert.scss +15 -10
- data/assets/stylesheets/bootstrap/_badge.scss +2 -27
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
- data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
- data/assets/stylesheets/bootstrap/_buttons.scss +29 -60
- data/assets/stylesheets/bootstrap/_card.scss +20 -91
- data/assets/stylesheets/bootstrap/_carousel.scss +64 -35
- data/assets/stylesheets/bootstrap/_close.scss +30 -30
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +84 -36
- data/assets/stylesheets/bootstrap/_forms.scss +9 -347
- data/assets/stylesheets/bootstrap/_functions.scss +84 -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 +28 -8
- data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
- data/assets/stylesheets/bootstrap/_modal.scss +45 -57
- data/assets/stylesheets/bootstrap/_nav.scss +20 -6
- data/assets/stylesheets/bootstrap/_navbar.scss +45 -71
- data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
- data/assets/stylesheets/bootstrap/_popover.scss +24 -36
- data/assets/stylesheets/bootstrap/_progress.scss +5 -4
- data/assets/stylesheets/bootstrap/_reboot.scss +316 -179
- data/assets/stylesheets/bootstrap/_root.scss +5 -8
- data/assets/stylesheets/bootstrap/_spinners.scss +11 -7
- data/assets/stylesheets/bootstrap/_tables.scss +79 -114
- data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
- data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
- data/assets/stylesheets/bootstrap/_transitions.scss +2 -7
- data/assets/stylesheets/bootstrap/_type.scss +38 -59
- data/assets/stylesheets/bootstrap/_utilities.scss +594 -18
- data/assets/stylesheets/bootstrap/_variables.scss +800 -485
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
- data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -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/_position.scss +30 -0
- data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -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/helpers/_visually-hidden.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
- data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +71 -48
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +39 -97
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +90 -34
- data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
- data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
- data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +214 -130
- data/bootstrap.gemspec +1 -3
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +19 -16
- data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
- data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
- data/test/dummy_rails/app/views/pages/root.html +89 -0
- data/test/dummy_rails/config/application.rb +0 -3
- data/test/gemfiles/rails_6_1.gemfile +7 -0
- metadata +45 -73
- 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/_screen-reader.scss +0 -34
- 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/dummy_rails/app/views/pages/root.html.slim +0 -58
- /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,228 +1,145 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap button.js
|
3
|
-
* Copyright 2011-
|
2
|
+
* Bootstrap button.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('
|
8
|
-
typeof define === 'function' && define.amd ? define(['
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.
|
10
|
-
}
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./base-component.js')) :
|
8
|
+
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './base-component'], factory) :
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.Data, global.EventHandler, global.Base));
|
10
|
+
}(this, (function (Data, EventHandler, 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
|
14
|
+
var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
15
|
+
var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
16
|
+
var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
/**
|
19
|
+
* --------------------------------------------------------------------------
|
20
|
+
* Bootstrap (v5.0.0): util/index.js
|
21
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
22
|
+
* --------------------------------------------------------------------------
|
23
|
+
*/
|
24
|
+
|
25
|
+
const getjQuery = () => {
|
26
|
+
const {
|
27
|
+
jQuery
|
28
|
+
} = window;
|
29
|
+
|
30
|
+
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
31
|
+
return jQuery;
|
23
32
|
}
|
24
|
-
}
|
25
33
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
34
|
+
return null;
|
35
|
+
};
|
36
|
+
|
37
|
+
const onDOMContentLoaded = callback => {
|
38
|
+
if (document.readyState === 'loading') {
|
39
|
+
document.addEventListener('DOMContentLoaded', callback);
|
40
|
+
} else {
|
41
|
+
callback();
|
42
|
+
}
|
43
|
+
};
|
44
|
+
|
45
|
+
const defineJQueryPlugin = (name, plugin) => {
|
46
|
+
onDOMContentLoaded(() => {
|
47
|
+
const $ = getjQuery();
|
48
|
+
/* istanbul ignore if */
|
49
|
+
|
50
|
+
if ($) {
|
51
|
+
const JQUERY_NO_CONFLICT = $.fn[name];
|
52
|
+
$.fn[name] = plugin.jQueryInterface;
|
53
|
+
$.fn[name].Constructor = plugin;
|
54
|
+
|
55
|
+
$.fn[name].noConflict = () => {
|
56
|
+
$.fn[name] = JQUERY_NO_CONFLICT;
|
57
|
+
return plugin.jQueryInterface;
|
58
|
+
};
|
59
|
+
}
|
31
60
|
});
|
32
|
-
|
33
|
-
}
|
61
|
+
};
|
34
62
|
|
35
63
|
/**
|
64
|
+
* --------------------------------------------------------------------------
|
65
|
+
* Bootstrap (v5.0.0): button.js
|
66
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
67
|
+
* --------------------------------------------------------------------------
|
68
|
+
*/
|
69
|
+
/**
|
70
|
+
* ------------------------------------------------------------------------
|
36
71
|
* Constants
|
72
|
+
* ------------------------------------------------------------------------
|
37
73
|
*/
|
38
74
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
var CLASS_NAME_BUTTON = 'btn';
|
47
|
-
var CLASS_NAME_FOCUS = 'focus';
|
48
|
-
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
49
|
-
var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY);
|
50
|
-
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
51
|
-
var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
|
52
|
-
var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
|
53
|
-
var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
|
54
|
-
var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
|
55
|
-
var SELECTOR_INPUT = 'input:not([type="hidden"])';
|
56
|
-
var SELECTOR_ACTIVE = '.active';
|
57
|
-
var SELECTOR_BUTTON = '.btn';
|
75
|
+
const NAME = 'button';
|
76
|
+
const DATA_KEY = 'bs.button';
|
77
|
+
const EVENT_KEY = `.${DATA_KEY}`;
|
78
|
+
const DATA_API_KEY = '.data-api';
|
79
|
+
const CLASS_NAME_ACTIVE = 'active';
|
80
|
+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
|
81
|
+
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
58
82
|
/**
|
59
|
-
*
|
83
|
+
* ------------------------------------------------------------------------
|
84
|
+
* Class Definition
|
85
|
+
* ------------------------------------------------------------------------
|
60
86
|
*/
|
61
87
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
} //
|
67
|
-
|
68
|
-
|
69
|
-
var _proto = Button.prototype;
|
70
|
-
|
71
|
-
// Public
|
72
|
-
_proto.toggle = function toggle() {
|
73
|
-
var triggerChangeEvent = true;
|
74
|
-
var addAriaPressed = true;
|
75
|
-
var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0];
|
76
|
-
|
77
|
-
if (rootElement) {
|
78
|
-
var input = this._element.querySelector(SELECTOR_INPUT);
|
79
|
-
|
80
|
-
if (input) {
|
81
|
-
if (input.type === 'radio') {
|
82
|
-
if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
83
|
-
triggerChangeEvent = false;
|
84
|
-
} else {
|
85
|
-
var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
|
86
|
-
|
87
|
-
if (activeElement) {
|
88
|
-
$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
|
-
if (triggerChangeEvent) {
|
94
|
-
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
95
|
-
if (input.type === 'checkbox' || input.type === 'radio') {
|
96
|
-
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
|
97
|
-
}
|
98
|
-
|
99
|
-
if (!this.shouldAvoidTriggerChange) {
|
100
|
-
$__default["default"](input).trigger('change');
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
|
-
input.focus();
|
105
|
-
addAriaPressed = false;
|
106
|
-
}
|
107
|
-
}
|
108
|
-
|
109
|
-
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
110
|
-
if (addAriaPressed) {
|
111
|
-
this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
|
112
|
-
}
|
88
|
+
class Button extends BaseComponent__default['default'] {
|
89
|
+
// Getters
|
90
|
+
static get DATA_KEY() {
|
91
|
+
return DATA_KEY;
|
92
|
+
} // Public
|
113
93
|
|
114
|
-
if (triggerChangeEvent) {
|
115
|
-
$__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
};
|
119
94
|
|
120
|
-
|
121
|
-
|
122
|
-
this._element
|
95
|
+
toggle() {
|
96
|
+
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
97
|
+
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
123
98
|
} // Static
|
124
|
-
;
|
125
99
|
|
126
|
-
|
100
|
+
|
101
|
+
static jQueryInterface(config) {
|
127
102
|
return this.each(function () {
|
128
|
-
|
129
|
-
var data = $element.data(DATA_KEY);
|
103
|
+
let data = Data__default['default'].get(this, DATA_KEY);
|
130
104
|
|
131
105
|
if (!data) {
|
132
106
|
data = new Button(this);
|
133
|
-
$element.data(DATA_KEY, data);
|
134
107
|
}
|
135
108
|
|
136
|
-
data.shouldAvoidTriggerChange = avoidTriggerChange;
|
137
|
-
|
138
109
|
if (config === 'toggle') {
|
139
110
|
data[config]();
|
140
111
|
}
|
141
112
|
});
|
142
|
-
}
|
143
|
-
|
144
|
-
_createClass(Button, null, [{
|
145
|
-
key: "VERSION",
|
146
|
-
get: function get() {
|
147
|
-
return VERSION;
|
148
|
-
}
|
149
|
-
}]);
|
113
|
+
}
|
150
114
|
|
151
|
-
|
152
|
-
}();
|
115
|
+
}
|
153
116
|
/**
|
154
|
-
*
|
117
|
+
* ------------------------------------------------------------------------
|
118
|
+
* Data Api implementation
|
119
|
+
* ------------------------------------------------------------------------
|
155
120
|
*/
|
156
121
|
|
157
122
|
|
158
|
-
|
159
|
-
|
160
|
-
|
123
|
+
EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
124
|
+
event.preventDefault();
|
125
|
+
const button = event.target.closest(SELECTOR_DATA_TOGGLE);
|
126
|
+
let data = Data__default['default'].get(button, DATA_KEY);
|
161
127
|
|
162
|
-
if (
|
163
|
-
|
128
|
+
if (!data) {
|
129
|
+
data = new Button(button);
|
164
130
|
}
|
165
131
|
|
166
|
-
|
167
|
-
event.preventDefault(); // work around Firefox bug #1540995
|
168
|
-
} else {
|
169
|
-
var inputBtn = button.querySelector(SELECTOR_INPUT);
|
170
|
-
|
171
|
-
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
172
|
-
event.preventDefault(); // work around Firefox bug #1540995
|
173
|
-
|
174
|
-
return;
|
175
|
-
}
|
176
|
-
|
177
|
-
if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
|
178
|
-
Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT');
|
179
|
-
}
|
180
|
-
}
|
181
|
-
}).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
182
|
-
var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0];
|
183
|
-
$__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
|
184
|
-
});
|
185
|
-
$__default["default"](window).on(EVENT_LOAD_DATA_API, function () {
|
186
|
-
// ensure correct active class is set to match the controls' actual values/states
|
187
|
-
// find all checkboxes/readio buttons inside data-toggle groups
|
188
|
-
var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
|
189
|
-
|
190
|
-
for (var i = 0, len = buttons.length; i < len; i++) {
|
191
|
-
var button = buttons[i];
|
192
|
-
var input = button.querySelector(SELECTOR_INPUT);
|
193
|
-
|
194
|
-
if (input.checked || input.hasAttribute('checked')) {
|
195
|
-
button.classList.add(CLASS_NAME_ACTIVE);
|
196
|
-
} else {
|
197
|
-
button.classList.remove(CLASS_NAME_ACTIVE);
|
198
|
-
}
|
199
|
-
} // find all button toggles
|
200
|
-
|
201
|
-
|
202
|
-
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
203
|
-
|
204
|
-
for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
|
205
|
-
var _button = buttons[_i];
|
206
|
-
|
207
|
-
if (_button.getAttribute('aria-pressed') === 'true') {
|
208
|
-
_button.classList.add(CLASS_NAME_ACTIVE);
|
209
|
-
} else {
|
210
|
-
_button.classList.remove(CLASS_NAME_ACTIVE);
|
211
|
-
}
|
212
|
-
}
|
132
|
+
data.toggle();
|
213
133
|
});
|
214
134
|
/**
|
135
|
+
* ------------------------------------------------------------------------
|
215
136
|
* jQuery
|
137
|
+
* ------------------------------------------------------------------------
|
138
|
+
* add .Button to jQuery only if jQuery is present
|
216
139
|
*/
|
217
140
|
|
218
|
-
|
219
|
-
$__default["default"].fn[NAME].Constructor = Button;
|
220
|
-
|
221
|
-
$__default["default"].fn[NAME].noConflict = function () {
|
222
|
-
$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
|
223
|
-
return Button._jQueryInterface;
|
224
|
-
};
|
141
|
+
defineJQueryPlugin(NAME, Button);
|
225
142
|
|
226
143
|
return Button;
|
227
144
|
|
228
|
-
}));
|
145
|
+
})));
|