bootstrap 4.1.3 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap might be problematic. Click here for more details.

Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +2 -2
  5. data/assets/javascripts/bootstrap-sprockets.js +6 -5
  6. data/assets/javascripts/bootstrap.js +3290 -2985
  7. data/assets/javascripts/bootstrap.min.js +2 -2
  8. data/assets/javascripts/bootstrap/alert.js +127 -132
  9. data/assets/javascripts/bootstrap/button.js +119 -124
  10. data/assets/javascripts/bootstrap/carousel.js +492 -393
  11. data/assets/javascripts/bootstrap/collapse.js +276 -279
  12. data/assets/javascripts/bootstrap/dropdown.js +413 -374
  13. data/assets/javascripts/bootstrap/modal.js +455 -445
  14. data/assets/javascripts/bootstrap/popover.js +155 -160
  15. data/assets/javascripts/bootstrap/scrollspy.js +246 -250
  16. data/assets/javascripts/bootstrap/tab.js +180 -192
  17. data/assets/javascripts/bootstrap/toast.js +277 -0
  18. data/assets/javascripts/bootstrap/tooltip.js +533 -522
  19. data/assets/javascripts/bootstrap/util.js +140 -116
  20. data/assets/stylesheets/_bootstrap-grid.scss +2 -5
  21. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  22. data/assets/stylesheets/_bootstrap.scss +3 -1
  23. data/assets/stylesheets/bootstrap/_alert.scss +1 -1
  24. data/assets/stylesheets/bootstrap/_badge.scss +6 -0
  25. data/assets/stylesheets/bootstrap/_button-group.scss +9 -18
  26. data/assets/stylesheets/bootstrap/_buttons.scss +7 -10
  27. data/assets/stylesheets/bootstrap/_card.scss +30 -21
  28. data/assets/stylesheets/bootstrap/_carousel.scss +36 -74
  29. data/assets/stylesheets/bootstrap/_close.scss +15 -6
  30. data/assets/stylesheets/bootstrap/_custom-forms.scss +103 -29
  31. data/assets/stylesheets/bootstrap/_dropdown.scss +30 -5
  32. data/assets/stylesheets/bootstrap/_forms.scss +12 -11
  33. data/assets/stylesheets/bootstrap/_functions.scss +4 -4
  34. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  35. data/assets/stylesheets/bootstrap/_input-group.scss +24 -4
  36. data/assets/stylesheets/bootstrap/_list-group.scss +6 -0
  37. data/assets/stylesheets/bootstrap/_modal.scss +16 -10
  38. data/assets/stylesheets/bootstrap/_nav.scss +2 -0
  39. data/assets/stylesheets/bootstrap/_navbar.scss +4 -4
  40. data/assets/stylesheets/bootstrap/_popover.scss +1 -1
  41. data/assets/stylesheets/bootstrap/_reboot.scss +14 -35
  42. data/assets/stylesheets/bootstrap/_spinners.scss +53 -0
  43. data/assets/stylesheets/bootstrap/_tables.scss +2 -2
  44. data/assets/stylesheets/bootstrap/_toasts.scss +43 -0
  45. data/assets/stylesheets/bootstrap/_type.scss +2 -2
  46. data/assets/stylesheets/bootstrap/_utilities.scss +1 -0
  47. data/assets/stylesheets/bootstrap/_variables.scss +220 -81
  48. data/assets/stylesheets/bootstrap/mixins/_badge.scss +1 -2
  49. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +2 -2
  50. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +9 -7
  51. data/assets/stylesheets/bootstrap/mixins/_caret.scss +0 -4
  52. data/assets/stylesheets/bootstrap/mixins/_forms.scss +61 -10
  53. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +3 -4
  54. data/assets/stylesheets/bootstrap/mixins/_grid.scss +9 -10
  55. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +10 -1
  56. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +1 -1
  57. data/assets/stylesheets/bootstrap/mixins/_transition.scss +5 -2
  58. data/assets/stylesheets/bootstrap/utilities/_borders.scss +4 -0
  59. data/assets/stylesheets/bootstrap/utilities/_embed.scss +7 -20
  60. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +5 -0
  61. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -5
  62. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +8 -0
  63. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +23 -1
  64. data/assets/stylesheets/bootstrap/utilities/_text.scss +13 -4
  65. data/bootstrap.gemspec +6 -3
  66. data/lib/bootstrap.rb +10 -7
  67. data/lib/bootstrap/engine.rb +3 -0
  68. data/lib/bootstrap/version.rb +4 -2
  69. metadata +15 -11
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * Bootstrap collapse.js v4.2.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ */
1
6
  (function (global, factory) {
2
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
3
8
  typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
@@ -58,372 +63,364 @@
58
63
  }
59
64
 
60
65
  /**
61
- * --------------------------------------------------------------------------
62
- * Bootstrap (v4.1.3): collapse.js
63
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
64
- * --------------------------------------------------------------------------
66
+ * ------------------------------------------------------------------------
67
+ * Constants
68
+ * ------------------------------------------------------------------------
65
69
  */
66
70
 
67
- var Collapse = function ($$$1) {
71
+ var NAME = 'collapse';
72
+ var VERSION = '4.2.1';
73
+ var DATA_KEY = 'bs.collapse';
74
+ var EVENT_KEY = "." + DATA_KEY;
75
+ var DATA_API_KEY = '.data-api';
76
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
77
+ var Default = {
78
+ toggle: true,
79
+ parent: ''
80
+ };
81
+ var DefaultType = {
82
+ toggle: 'boolean',
83
+ parent: '(string|element)'
84
+ };
85
+ var Event = {
86
+ SHOW: "show" + EVENT_KEY,
87
+ SHOWN: "shown" + EVENT_KEY,
88
+ HIDE: "hide" + EVENT_KEY,
89
+ HIDDEN: "hidden" + EVENT_KEY,
90
+ CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
91
+ };
92
+ var ClassName = {
93
+ SHOW: 'show',
94
+ COLLAPSE: 'collapse',
95
+ COLLAPSING: 'collapsing',
96
+ COLLAPSED: 'collapsed'
97
+ };
98
+ var Dimension = {
99
+ WIDTH: 'width',
100
+ HEIGHT: 'height'
101
+ };
102
+ var Selector = {
103
+ ACTIVES: '.show, .collapsing',
104
+ DATA_TOGGLE: '[data-toggle="collapse"]'
68
105
  /**
69
106
  * ------------------------------------------------------------------------
70
- * Constants
107
+ * Class Definition
71
108
  * ------------------------------------------------------------------------
72
109
  */
73
- var NAME = 'collapse';
74
- var VERSION = '4.1.3';
75
- var DATA_KEY = 'bs.collapse';
76
- var EVENT_KEY = "." + DATA_KEY;
77
- var DATA_API_KEY = '.data-api';
78
- var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
79
- var Default = {
80
- toggle: true,
81
- parent: ''
82
- };
83
- var DefaultType = {
84
- toggle: 'boolean',
85
- parent: '(string|element)'
86
- };
87
- var Event = {
88
- SHOW: "show" + EVENT_KEY,
89
- SHOWN: "shown" + EVENT_KEY,
90
- HIDE: "hide" + EVENT_KEY,
91
- HIDDEN: "hidden" + EVENT_KEY,
92
- CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
93
- };
94
- var ClassName = {
95
- SHOW: 'show',
96
- COLLAPSE: 'collapse',
97
- COLLAPSING: 'collapsing',
98
- COLLAPSED: 'collapsed'
99
- };
100
- var Dimension = {
101
- WIDTH: 'width',
102
- HEIGHT: 'height'
103
- };
104
- var Selector = {
105
- ACTIVES: '.show, .collapsing',
106
- DATA_TOGGLE: '[data-toggle="collapse"]'
107
- /**
108
- * ------------------------------------------------------------------------
109
- * Class Definition
110
- * ------------------------------------------------------------------------
111
- */
112
110
 
113
- };
111
+ };
112
+
113
+ var Collapse =
114
+ /*#__PURE__*/
115
+ function () {
116
+ function Collapse(element, config) {
117
+ this._isTransitioning = false;
118
+ this._element = element;
119
+ this._config = this._getConfig(config);
120
+ this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
121
+ var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
122
+
123
+ for (var i = 0, len = toggleList.length; i < len; i++) {
124
+ var elem = toggleList[i];
125
+ var selector = Util.getSelectorFromElement(elem);
126
+ var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
127
+ return foundElem === element;
128
+ });
114
129
 
115
- var Collapse =
116
- /*#__PURE__*/
117
- function () {
118
- function Collapse(element, config) {
119
- this._isTransitioning = false;
120
- this._element = element;
121
- this._config = this._getConfig(config);
122
- this._triggerArray = $$$1.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
123
- var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
124
-
125
- for (var i = 0, len = toggleList.length; i < len; i++) {
126
- var elem = toggleList[i];
127
- var selector = Util.getSelectorFromElement(elem);
128
- var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
129
- return foundElem === element;
130
- });
131
-
132
- if (selector !== null && filterElement.length > 0) {
133
- this._selector = selector;
134
-
135
- this._triggerArray.push(elem);
136
- }
130
+ if (selector !== null && filterElement.length > 0) {
131
+ this._selector = selector;
132
+
133
+ this._triggerArray.push(elem);
137
134
  }
135
+ }
138
136
 
139
- this._parent = this._config.parent ? this._getParent() : null;
137
+ this._parent = this._config.parent ? this._getParent() : null;
140
138
 
141
- if (!this._config.parent) {
142
- this._addAriaAndCollapsedClass(this._element, this._triggerArray);
143
- }
139
+ if (!this._config.parent) {
140
+ this._addAriaAndCollapsedClass(this._element, this._triggerArray);
141
+ }
144
142
 
145
- if (this._config.toggle) {
146
- this.toggle();
147
- }
148
- } // Getters
143
+ if (this._config.toggle) {
144
+ this.toggle();
145
+ }
146
+ } // Getters
149
147
 
150
148
 
151
- var _proto = Collapse.prototype;
149
+ var _proto = Collapse.prototype;
152
150
 
153
- // Public
154
- _proto.toggle = function toggle() {
155
- if ($$$1(this._element).hasClass(ClassName.SHOW)) {
156
- this.hide();
157
- } else {
158
- this.show();
159
- }
160
- };
151
+ // Public
152
+ _proto.toggle = function toggle() {
153
+ if ($(this._element).hasClass(ClassName.SHOW)) {
154
+ this.hide();
155
+ } else {
156
+ this.show();
157
+ }
158
+ };
161
159
 
162
- _proto.show = function show() {
163
- var _this = this;
160
+ _proto.show = function show() {
161
+ var _this = this;
164
162
 
165
- if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
166
- return;
167
- }
163
+ if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {
164
+ return;
165
+ }
168
166
 
169
- var actives;
170
- var activesData;
167
+ var actives;
168
+ var activesData;
171
169
 
172
- if (this._parent) {
173
- actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
170
+ if (this._parent) {
171
+ actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
172
+ if (typeof _this._config.parent === 'string') {
174
173
  return elem.getAttribute('data-parent') === _this._config.parent;
175
- });
176
-
177
- if (actives.length === 0) {
178
- actives = null;
179
174
  }
180
- }
181
175
 
182
- if (actives) {
183
- activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
176
+ return elem.classList.contains(ClassName.COLLAPSE);
177
+ });
184
178
 
185
- if (activesData && activesData._isTransitioning) {
186
- return;
187
- }
179
+ if (actives.length === 0) {
180
+ actives = null;
188
181
  }
182
+ }
189
183
 
190
- var startEvent = $$$1.Event(Event.SHOW);
191
- $$$1(this._element).trigger(startEvent);
184
+ if (actives) {
185
+ activesData = $(actives).not(this._selector).data(DATA_KEY);
192
186
 
193
- if (startEvent.isDefaultPrevented()) {
187
+ if (activesData && activesData._isTransitioning) {
194
188
  return;
195
189
  }
190
+ }
196
191
 
197
- if (actives) {
198
- Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
199
-
200
- if (!activesData) {
201
- $$$1(actives).data(DATA_KEY, null);
202
- }
203
- }
192
+ var startEvent = $.Event(Event.SHOW);
193
+ $(this._element).trigger(startEvent);
204
194
 
205
- var dimension = this._getDimension();
195
+ if (startEvent.isDefaultPrevented()) {
196
+ return;
197
+ }
206
198
 
207
- $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
208
- this._element.style[dimension] = 0;
199
+ if (actives) {
200
+ Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
209
201
 
210
- if (this._triggerArray.length) {
211
- $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
202
+ if (!activesData) {
203
+ $(actives).data(DATA_KEY, null);
212
204
  }
205
+ }
206
+
207
+ var dimension = this._getDimension();
208
+
209
+ $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
210
+ this._element.style[dimension] = 0;
213
211
 
214
- this.setTransitioning(true);
212
+ if (this._triggerArray.length) {
213
+ $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
214
+ }
215
215
 
216
- var complete = function complete() {
217
- $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
218
- _this._element.style[dimension] = '';
216
+ this.setTransitioning(true);
219
217
 
220
- _this.setTransitioning(false);
218
+ var complete = function complete() {
219
+ $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
220
+ _this._element.style[dimension] = '';
221
221
 
222
- $$$1(_this._element).trigger(Event.SHOWN);
223
- };
222
+ _this.setTransitioning(false);
224
223
 
225
- var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
226
- var scrollSize = "scroll" + capitalizedDimension;
227
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
228
- $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
229
- this._element.style[dimension] = this._element[scrollSize] + "px";
224
+ $(_this._element).trigger(Event.SHOWN);
230
225
  };
231
226
 
232
- _proto.hide = function hide() {
233
- var _this2 = this;
227
+ var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
228
+ var scrollSize = "scroll" + capitalizedDimension;
229
+ var transitionDuration = Util.getTransitionDurationFromElement(this._element);
230
+ $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
231
+ this._element.style[dimension] = this._element[scrollSize] + "px";
232
+ };
234
233
 
235
- if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
236
- return;
237
- }
234
+ _proto.hide = function hide() {
235
+ var _this2 = this;
238
236
 
239
- var startEvent = $$$1.Event(Event.HIDE);
240
- $$$1(this._element).trigger(startEvent);
237
+ if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {
238
+ return;
239
+ }
241
240
 
242
- if (startEvent.isDefaultPrevented()) {
243
- return;
244
- }
241
+ var startEvent = $.Event(Event.HIDE);
242
+ $(this._element).trigger(startEvent);
243
+
244
+ if (startEvent.isDefaultPrevented()) {
245
+ return;
246
+ }
245
247
 
246
- var dimension = this._getDimension();
248
+ var dimension = this._getDimension();
247
249
 
248
- this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
249
- Util.reflow(this._element);
250
- $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
251
- var triggerArrayLength = this._triggerArray.length;
250
+ this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
251
+ Util.reflow(this._element);
252
+ $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
253
+ var triggerArrayLength = this._triggerArray.length;
252
254
 
253
- if (triggerArrayLength > 0) {
254
- for (var i = 0; i < triggerArrayLength; i++) {
255
- var trigger = this._triggerArray[i];
256
- var selector = Util.getSelectorFromElement(trigger);
255
+ if (triggerArrayLength > 0) {
256
+ for (var i = 0; i < triggerArrayLength; i++) {
257
+ var trigger = this._triggerArray[i];
258
+ var selector = Util.getSelectorFromElement(trigger);
257
259
 
258
- if (selector !== null) {
259
- var $elem = $$$1([].slice.call(document.querySelectorAll(selector)));
260
+ if (selector !== null) {
261
+ var $elem = $([].slice.call(document.querySelectorAll(selector)));
260
262
 
261
- if (!$elem.hasClass(ClassName.SHOW)) {
262
- $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
263
- }
263
+ if (!$elem.hasClass(ClassName.SHOW)) {
264
+ $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
264
265
  }
265
266
  }
266
267
  }
268
+ }
267
269
 
268
- this.setTransitioning(true);
269
-
270
- var complete = function complete() {
271
- _this2.setTransitioning(false);
270
+ this.setTransitioning(true);
272
271
 
273
- $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
274
- };
272
+ var complete = function complete() {
273
+ _this2.setTransitioning(false);
275
274
 
276
- this._element.style[dimension] = '';
277
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
278
- $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
275
+ $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
279
276
  };
280
277
 
281
- _proto.setTransitioning = function setTransitioning(isTransitioning) {
282
- this._isTransitioning = isTransitioning;
283
- };
278
+ this._element.style[dimension] = '';
279
+ var transitionDuration = Util.getTransitionDurationFromElement(this._element);
280
+ $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
281
+ };
284
282
 
285
- _proto.dispose = function dispose() {
286
- $$$1.removeData(this._element, DATA_KEY);
287
- this._config = null;
288
- this._parent = null;
289
- this._element = null;
290
- this._triggerArray = null;
291
- this._isTransitioning = null;
292
- }; // Private
283
+ _proto.setTransitioning = function setTransitioning(isTransitioning) {
284
+ this._isTransitioning = isTransitioning;
285
+ };
293
286
 
287
+ _proto.dispose = function dispose() {
288
+ $.removeData(this._element, DATA_KEY);
289
+ this._config = null;
290
+ this._parent = null;
291
+ this._element = null;
292
+ this._triggerArray = null;
293
+ this._isTransitioning = null;
294
+ }; // Private
294
295
 
295
- _proto._getConfig = function _getConfig(config) {
296
- config = _objectSpread({}, Default, config);
297
- config.toggle = Boolean(config.toggle); // Coerce string values
298
296
 
299
- Util.typeCheckConfig(NAME, config, DefaultType);
300
- return config;
301
- };
297
+ _proto._getConfig = function _getConfig(config) {
298
+ config = _objectSpread({}, Default, config);
299
+ config.toggle = Boolean(config.toggle); // Coerce string values
302
300
 
303
- _proto._getDimension = function _getDimension() {
304
- var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
305
- return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
306
- };
301
+ Util.typeCheckConfig(NAME, config, DefaultType);
302
+ return config;
303
+ };
307
304
 
308
- _proto._getParent = function _getParent() {
309
- var _this3 = this;
305
+ _proto._getDimension = function _getDimension() {
306
+ var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
307
+ return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
308
+ };
310
309
 
311
- var parent = null;
310
+ _proto._getParent = function _getParent() {
311
+ var _this3 = this;
312
312
 
313
- if (Util.isElement(this._config.parent)) {
314
- parent = this._config.parent; // It's a jQuery object
313
+ var parent;
315
314
 
316
- if (typeof this._config.parent.jquery !== 'undefined') {
317
- parent = this._config.parent[0];
318
- }
319
- } else {
320
- parent = document.querySelector(this._config.parent);
321
- }
315
+ if (Util.isElement(this._config.parent)) {
316
+ parent = this._config.parent; // It's a jQuery object
322
317
 
323
- var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
324
- var children = [].slice.call(parent.querySelectorAll(selector));
325
- $$$1(children).each(function (i, element) {
326
- _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
327
- });
328
- return parent;
329
- };
318
+ if (typeof this._config.parent.jquery !== 'undefined') {
319
+ parent = this._config.parent[0];
320
+ }
321
+ } else {
322
+ parent = document.querySelector(this._config.parent);
323
+ }
330
324
 
331
- _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
332
- if (element) {
333
- var isOpen = $$$1(element).hasClass(ClassName.SHOW);
325
+ var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
326
+ var children = [].slice.call(parent.querySelectorAll(selector));
327
+ $(children).each(function (i, element) {
328
+ _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
329
+ });
330
+ return parent;
331
+ };
334
332
 
335
- if (triggerArray.length) {
336
- $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
337
- }
338
- }
339
- }; // Static
333
+ _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
334
+ var isOpen = $(element).hasClass(ClassName.SHOW);
340
335
 
336
+ if (triggerArray.length) {
337
+ $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
338
+ }
339
+ }; // Static
341
340
 
342
- Collapse._getTargetFromElement = function _getTargetFromElement(element) {
343
- var selector = Util.getSelectorFromElement(element);
344
- return selector ? document.querySelector(selector) : null;
345
- };
346
341
 
347
- Collapse._jQueryInterface = function _jQueryInterface(config) {
348
- return this.each(function () {
349
- var $this = $$$1(this);
350
- var data = $this.data(DATA_KEY);
342
+ Collapse._getTargetFromElement = function _getTargetFromElement(element) {
343
+ var selector = Util.getSelectorFromElement(element);
344
+ return selector ? document.querySelector(selector) : null;
345
+ };
351
346
 
352
- var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
347
+ Collapse._jQueryInterface = function _jQueryInterface(config) {
348
+ return this.each(function () {
349
+ var $this = $(this);
350
+ var data = $this.data(DATA_KEY);
353
351
 
354
- if (!data && _config.toggle && /show|hide/.test(config)) {
355
- _config.toggle = false;
356
- }
352
+ var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
357
353
 
358
- if (!data) {
359
- data = new Collapse(this, _config);
360
- $this.data(DATA_KEY, data);
361
- }
354
+ if (!data && _config.toggle && /show|hide/.test(config)) {
355
+ _config.toggle = false;
356
+ }
362
357
 
363
- if (typeof config === 'string') {
364
- if (typeof data[config] === 'undefined') {
365
- throw new TypeError("No method named \"" + config + "\"");
366
- }
358
+ if (!data) {
359
+ data = new Collapse(this, _config);
360
+ $this.data(DATA_KEY, data);
361
+ }
367
362
 
368
- data[config]();
363
+ if (typeof config === 'string') {
364
+ if (typeof data[config] === 'undefined') {
365
+ throw new TypeError("No method named \"" + config + "\"");
369
366
  }
370
- });
371
- };
372
367
 
373
- _createClass(Collapse, null, [{
374
- key: "VERSION",
375
- get: function get() {
376
- return VERSION;
377
- }
378
- }, {
379
- key: "Default",
380
- get: function get() {
381
- return Default;
368
+ data[config]();
382
369
  }
383
- }]);
370
+ });
371
+ };
384
372
 
385
- return Collapse;
386
- }();
387
- /**
388
- * ------------------------------------------------------------------------
389
- * Data Api implementation
390
- * ------------------------------------------------------------------------
391
- */
373
+ _createClass(Collapse, null, [{
374
+ key: "VERSION",
375
+ get: function get() {
376
+ return VERSION;
377
+ }
378
+ }, {
379
+ key: "Default",
380
+ get: function get() {
381
+ return Default;
382
+ }
383
+ }]);
392
384
 
385
+ return Collapse;
386
+ }();
387
+ /**
388
+ * ------------------------------------------------------------------------
389
+ * Data Api implementation
390
+ * ------------------------------------------------------------------------
391
+ */
393
392
 
394
- $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
395
- // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
396
- if (event.currentTarget.tagName === 'A') {
397
- event.preventDefault();
398
- }
399
393
 
400
- var $trigger = $$$1(this);
401
- var selector = Util.getSelectorFromElement(this);
402
- var selectors = [].slice.call(document.querySelectorAll(selector));
403
- $$$1(selectors).each(function () {
404
- var $target = $$$1(this);
405
- var data = $target.data(DATA_KEY);
406
- var config = data ? 'toggle' : $trigger.data();
394
+ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
395
+ // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
396
+ if (event.currentTarget.tagName === 'A') {
397
+ event.preventDefault();
398
+ }
407
399
 
408
- Collapse._jQueryInterface.call($target, config);
409
- });
410
- });
411
- /**
412
- * ------------------------------------------------------------------------
413
- * jQuery
414
- * ------------------------------------------------------------------------
415
- */
400
+ var $trigger = $(this);
401
+ var selector = Util.getSelectorFromElement(this);
402
+ var selectors = [].slice.call(document.querySelectorAll(selector));
403
+ $(selectors).each(function () {
404
+ var $target = $(this);
405
+ var data = $target.data(DATA_KEY);
406
+ var config = data ? 'toggle' : $trigger.data();
416
407
 
417
- $$$1.fn[NAME] = Collapse._jQueryInterface;
418
- $$$1.fn[NAME].Constructor = Collapse;
408
+ Collapse._jQueryInterface.call($target, config);
409
+ });
410
+ });
411
+ /**
412
+ * ------------------------------------------------------------------------
413
+ * jQuery
414
+ * ------------------------------------------------------------------------
415
+ */
419
416
 
420
- $$$1.fn[NAME].noConflict = function () {
421
- $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
422
- return Collapse._jQueryInterface;
423
- };
417
+ $.fn[NAME] = Collapse._jQueryInterface;
418
+ $.fn[NAME].Constructor = Collapse;
424
419
 
425
- return Collapse;
426
- }($);
420
+ $.fn[NAME].noConflict = function () {
421
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
422
+ return Collapse._jQueryInterface;
423
+ };
427
424
 
428
425
  return Collapse;
429
426