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,228 +1,145 @@
1
1
  /*!
2
- * Bootstrap button.js v4.6.2 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
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('jquery')) :
8
- typeof define === 'function' && define.amd ? define(['jquery'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.jQuery));
10
- })(this, (function ($) { 'use strict';
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 $__default = /*#__PURE__*/_interopDefaultLegacy($);
14
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
+ var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
15
17
 
16
- function _defineProperties(target, props) {
17
- for (var i = 0; i < props.length; i++) {
18
- var descriptor = props[i];
19
- descriptor.enumerable = descriptor.enumerable || false;
20
- descriptor.configurable = true;
21
- if ("value" in descriptor) descriptor.writable = true;
22
- Object.defineProperty(target, descriptor.key, descriptor);
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
- function _createClass(Constructor, protoProps, staticProps) {
27
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
- if (staticProps) _defineProperties(Constructor, staticProps);
29
- Object.defineProperty(Constructor, "prototype", {
30
- writable: false
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
- return Constructor;
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
- var NAME = 'button';
40
- var VERSION = '4.6.2';
41
- var DATA_KEY = 'bs.button';
42
- var EVENT_KEY = "." + DATA_KEY;
43
- var DATA_API_KEY = '.data-api';
44
- var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
45
- var CLASS_NAME_ACTIVE = 'active';
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
- * Class definition
83
+ * ------------------------------------------------------------------------
84
+ * Class Definition
85
+ * ------------------------------------------------------------------------
60
86
  */
61
87
 
62
- var Button = /*#__PURE__*/function () {
63
- function Button(element) {
64
- this._element = element;
65
- this.shouldAvoidTriggerChange = false;
66
- } // Getters
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
- _proto.dispose = function dispose() {
121
- $__default["default"].removeData(this._element, DATA_KEY);
122
- this._element = null;
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
- Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {
100
+
101
+ static jQueryInterface(config) {
127
102
  return this.each(function () {
128
- var $element = $__default["default"](this);
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
- return Button;
152
- }();
115
+ }
153
116
  /**
154
- * Data API implementation
117
+ * ------------------------------------------------------------------------
118
+ * Data Api implementation
119
+ * ------------------------------------------------------------------------
155
120
  */
156
121
 
157
122
 
158
- $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
159
- var button = event.target;
160
- var initialButton = button;
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 (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) {
163
- button = $__default["default"](button).closest(SELECTOR_BUTTON)[0];
128
+ if (!data) {
129
+ data = new Button(button);
164
130
  }
165
131
 
166
- if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
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
- $__default["default"].fn[NAME] = Button._jQueryInterface;
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
+ })));