bootstrap 4.1.2 → 4.1.3

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +5 -5
  4. data/assets/javascripts/bootstrap.js +23 -23
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +159 -133
  7. data/assets/javascripts/bootstrap/button.js +149 -124
  8. data/assets/javascripts/bootstrap/carousel.js +463 -407
  9. data/assets/javascripts/bootstrap/collapse.js +338 -282
  10. data/assets/javascripts/bootstrap/dropdown.js +439 -382
  11. data/assets/javascripts/bootstrap/modal.js +502 -446
  12. data/assets/javascripts/bootstrap/popover.js +223 -163
  13. data/assets/javascripts/bootstrap/scrollspy.js +307 -251
  14. data/assets/javascripts/bootstrap/tab.js +217 -191
  15. data/assets/javascripts/bootstrap/tooltip.js +582 -525
  16. data/assets/javascripts/bootstrap/util.js +129 -116
  17. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  18. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  19. data/assets/stylesheets/_bootstrap.scss +1 -1
  20. data/assets/stylesheets/bootstrap/_buttons.scss +0 -1
  21. data/assets/stylesheets/bootstrap/_custom-forms.scss +13 -19
  22. data/assets/stylesheets/bootstrap/_forms.scss +13 -15
  23. data/assets/stylesheets/bootstrap/_input-group.scss +15 -2
  24. data/assets/stylesheets/bootstrap/_modal.scss +18 -6
  25. data/assets/stylesheets/bootstrap/_reboot.scss +4 -2
  26. data/assets/stylesheets/bootstrap/_tables.scss +0 -1
  27. data/assets/stylesheets/bootstrap/_variables.scss +10 -9
  28. data/assets/stylesheets/bootstrap/mixins/_forms.scss +7 -7
  29. data/lib/bootstrap/version.rb +2 -2
  30. metadata +2 -2
@@ -1,494 +1,551 @@
1
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
3
+ typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
4
+ (global.Dropdown = factory(global.jQuery,global.Popper,global.Util));
5
+ }(this, (function ($,Popper,Util) { 'use strict';
6
+
7
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8
+ Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
9
+ Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
10
+
11
+ function _defineProperties(target, props) {
12
+ for (var i = 0; i < props.length; i++) {
13
+ var descriptor = props[i];
14
+ descriptor.enumerable = descriptor.enumerable || false;
15
+ descriptor.configurable = true;
16
+ if ("value" in descriptor) descriptor.writable = true;
17
+ Object.defineProperty(target, descriptor.key, descriptor);
18
+ }
19
+ }
20
+
21
+ function _createClass(Constructor, protoProps, staticProps) {
22
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
23
+ if (staticProps) _defineProperties(Constructor, staticProps);
24
+ return Constructor;
25
+ }
26
+
27
+ function _defineProperty(obj, key, value) {
28
+ if (key in obj) {
29
+ Object.defineProperty(obj, key, {
30
+ value: value,
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true
34
+ });
35
+ } else {
36
+ obj[key] = value;
37
+ }
38
+
39
+ return obj;
40
+ }
41
+
42
+ function _objectSpread(target) {
43
+ for (var i = 1; i < arguments.length; i++) {
44
+ var source = arguments[i] != null ? arguments[i] : {};
45
+ var ownKeys = Object.keys(source);
46
+
47
+ if (typeof Object.getOwnPropertySymbols === 'function') {
48
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
49
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
50
+ }));
51
+ }
4
52
 
5
- 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); } }
53
+ ownKeys.forEach(function (key) {
54
+ _defineProperty(target, key, source[key]);
55
+ });
56
+ }
6
57
 
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
58
+ return target;
59
+ }
8
60
 
9
- /**
10
- * --------------------------------------------------------------------------
11
- * Bootstrap (v4.1.2): dropdown.js
12
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
13
- * --------------------------------------------------------------------------
14
- */
15
- var Dropdown = function ($) {
16
61
  /**
17
- * ------------------------------------------------------------------------
18
- * Constants
19
- * ------------------------------------------------------------------------
62
+ * --------------------------------------------------------------------------
63
+ * Bootstrap (v4.1.3): dropdown.js
64
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
65
+ * --------------------------------------------------------------------------
20
66
  */
21
- var NAME = 'dropdown';
22
- var VERSION = '4.1.2';
23
- var DATA_KEY = 'bs.dropdown';
24
- var EVENT_KEY = "." + DATA_KEY;
25
- var DATA_API_KEY = '.data-api';
26
- var JQUERY_NO_CONFLICT = $.fn[NAME];
27
- var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
28
-
29
- var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
30
-
31
- var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
32
-
33
- var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
34
-
35
- var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
36
-
37
- var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
38
-
39
- var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
40
- var Event = {
41
- HIDE: "hide" + EVENT_KEY,
42
- HIDDEN: "hidden" + EVENT_KEY,
43
- SHOW: "show" + EVENT_KEY,
44
- SHOWN: "shown" + EVENT_KEY,
45
- CLICK: "click" + EVENT_KEY,
46
- CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
47
- KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
48
- KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
49
- };
50
- var ClassName = {
51
- DISABLED: 'disabled',
52
- SHOW: 'show',
53
- DROPUP: 'dropup',
54
- DROPRIGHT: 'dropright',
55
- DROPLEFT: 'dropleft',
56
- MENURIGHT: 'dropdown-menu-right',
57
- MENULEFT: 'dropdown-menu-left',
58
- POSITION_STATIC: 'position-static'
59
- };
60
- var Selector = {
61
- DATA_TOGGLE: '[data-toggle="dropdown"]',
62
- FORM_CHILD: '.dropdown form',
63
- MENU: '.dropdown-menu',
64
- NAVBAR_NAV: '.navbar-nav',
65
- VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
66
- };
67
- var AttachmentMap = {
68
- TOP: 'top-start',
69
- TOPEND: 'top-end',
70
- BOTTOM: 'bottom-start',
71
- BOTTOMEND: 'bottom-end',
72
- RIGHT: 'right-start',
73
- RIGHTEND: 'right-end',
74
- LEFT: 'left-start',
75
- LEFTEND: 'left-end'
76
- };
77
- var Default = {
78
- offset: 0,
79
- flip: true,
80
- boundary: 'scrollParent',
81
- reference: 'toggle',
82
- display: 'dynamic'
83
- };
84
- var DefaultType = {
85
- offset: '(number|string|function)',
86
- flip: 'boolean',
87
- boundary: '(string|element)',
88
- reference: '(string|element)',
89
- display: 'string'
67
+
68
+ var Dropdown = function ($$$1) {
90
69
  /**
91
70
  * ------------------------------------------------------------------------
92
- * Class Definition
71
+ * Constants
93
72
  * ------------------------------------------------------------------------
94
73
  */
74
+ var NAME = 'dropdown';
75
+ var VERSION = '4.1.3';
76
+ var DATA_KEY = 'bs.dropdown';
77
+ var EVENT_KEY = "." + DATA_KEY;
78
+ var DATA_API_KEY = '.data-api';
79
+ var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
80
+ var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
81
+
82
+ var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
83
+
84
+ var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
85
+
86
+ var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
87
+
88
+ var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
89
+
90
+ var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
91
+
92
+ var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
93
+ var Event = {
94
+ HIDE: "hide" + EVENT_KEY,
95
+ HIDDEN: "hidden" + EVENT_KEY,
96
+ SHOW: "show" + EVENT_KEY,
97
+ SHOWN: "shown" + EVENT_KEY,
98
+ CLICK: "click" + EVENT_KEY,
99
+ CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
100
+ KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
101
+ KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
102
+ };
103
+ var ClassName = {
104
+ DISABLED: 'disabled',
105
+ SHOW: 'show',
106
+ DROPUP: 'dropup',
107
+ DROPRIGHT: 'dropright',
108
+ DROPLEFT: 'dropleft',
109
+ MENURIGHT: 'dropdown-menu-right',
110
+ MENULEFT: 'dropdown-menu-left',
111
+ POSITION_STATIC: 'position-static'
112
+ };
113
+ var Selector = {
114
+ DATA_TOGGLE: '[data-toggle="dropdown"]',
115
+ FORM_CHILD: '.dropdown form',
116
+ MENU: '.dropdown-menu',
117
+ NAVBAR_NAV: '.navbar-nav',
118
+ VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
119
+ };
120
+ var AttachmentMap = {
121
+ TOP: 'top-start',
122
+ TOPEND: 'top-end',
123
+ BOTTOM: 'bottom-start',
124
+ BOTTOMEND: 'bottom-end',
125
+ RIGHT: 'right-start',
126
+ RIGHTEND: 'right-end',
127
+ LEFT: 'left-start',
128
+ LEFTEND: 'left-end'
129
+ };
130
+ var Default = {
131
+ offset: 0,
132
+ flip: true,
133
+ boundary: 'scrollParent',
134
+ reference: 'toggle',
135
+ display: 'dynamic'
136
+ };
137
+ var DefaultType = {
138
+ offset: '(number|string|function)',
139
+ flip: 'boolean',
140
+ boundary: '(string|element)',
141
+ reference: '(string|element)',
142
+ display: 'string'
143
+ /**
144
+ * ------------------------------------------------------------------------
145
+ * Class Definition
146
+ * ------------------------------------------------------------------------
147
+ */
95
148
 
96
- };
149
+ };
97
150
 
98
- var Dropdown =
99
- /*#__PURE__*/
100
- function () {
101
- function Dropdown(element, config) {
102
- this._element = element;
103
- this._popper = null;
104
- this._config = this._getConfig(config);
105
- this._menu = this._getMenuElement();
106
- this._inNavbar = this._detectNavbar();
151
+ var Dropdown =
152
+ /*#__PURE__*/
153
+ function () {
154
+ function Dropdown(element, config) {
155
+ this._element = element;
156
+ this._popper = null;
157
+ this._config = this._getConfig(config);
158
+ this._menu = this._getMenuElement();
159
+ this._inNavbar = this._detectNavbar();
107
160
 
108
- this._addEventListeners();
109
- } // Getters
161
+ this._addEventListeners();
162
+ } // Getters
110
163
 
111
164
 
112
- var _proto = Dropdown.prototype;
165
+ var _proto = Dropdown.prototype;
113
166
 
114
- // Public
115
- _proto.toggle = function toggle() {
116
- if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
117
- return;
118
- }
167
+ // Public
168
+ _proto.toggle = function toggle() {
169
+ if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
170
+ return;
171
+ }
119
172
 
120
- var parent = Dropdown._getParentFromElement(this._element);
173
+ var parent = Dropdown._getParentFromElement(this._element);
121
174
 
122
- var isActive = $(this._menu).hasClass(ClassName.SHOW);
175
+ var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
123
176
 
124
- Dropdown._clearMenus();
177
+ Dropdown._clearMenus();
125
178
 
126
- if (isActive) {
127
- return;
128
- }
179
+ if (isActive) {
180
+ return;
181
+ }
129
182
 
130
- var relatedTarget = {
131
- relatedTarget: this._element
132
- };
133
- var showEvent = $.Event(Event.SHOW, relatedTarget);
134
- $(parent).trigger(showEvent);
183
+ var relatedTarget = {
184
+ relatedTarget: this._element
185
+ };
186
+ var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
187
+ $$$1(parent).trigger(showEvent);
135
188
 
136
- if (showEvent.isDefaultPrevented()) {
137
- return;
138
- } // Disable totally Popper.js for Dropdown in Navbar
189
+ if (showEvent.isDefaultPrevented()) {
190
+ return;
191
+ } // Disable totally Popper.js for Dropdown in Navbar
139
192
 
140
193
 
141
- if (!this._inNavbar) {
142
- /**
143
- * Check for Popper dependency
144
- * Popper - https://popper.js.org
145
- */
146
- if (typeof Popper === 'undefined') {
147
- throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
148
- }
194
+ if (!this._inNavbar) {
195
+ /**
196
+ * Check for Popper dependency
197
+ * Popper - https://popper.js.org
198
+ */
199
+ if (typeof Popper === 'undefined') {
200
+ throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
201
+ }
149
202
 
150
- var referenceElement = this._element;
203
+ var referenceElement = this._element;
151
204
 
152
- if (this._config.reference === 'parent') {
153
- referenceElement = parent;
154
- } else if (Util.isElement(this._config.reference)) {
155
- referenceElement = this._config.reference; // Check if it's jQuery element
205
+ if (this._config.reference === 'parent') {
206
+ referenceElement = parent;
207
+ } else if (Util.isElement(this._config.reference)) {
208
+ referenceElement = this._config.reference; // Check if it's jQuery element
156
209
 
157
- if (typeof this._config.reference.jquery !== 'undefined') {
158
- referenceElement = this._config.reference[0];
159
- }
160
- } // If boundary is not `scrollParent`, then set position to `static`
161
- // to allow the menu to "escape" the scroll parent's boundaries
162
- // https://github.com/twbs/bootstrap/issues/24251
210
+ if (typeof this._config.reference.jquery !== 'undefined') {
211
+ referenceElement = this._config.reference[0];
212
+ }
213
+ } // If boundary is not `scrollParent`, then set position to `static`
214
+ // to allow the menu to "escape" the scroll parent's boundaries
215
+ // https://github.com/twbs/bootstrap/issues/24251
163
216
 
164
217
 
165
- if (this._config.boundary !== 'scrollParent') {
166
- $(parent).addClass(ClassName.POSITION_STATIC);
167
- }
218
+ if (this._config.boundary !== 'scrollParent') {
219
+ $$$1(parent).addClass(ClassName.POSITION_STATIC);
220
+ }
168
221
 
169
- this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
170
- } // If this is a touch-enabled device we add extra
171
- // empty mouseover listeners to the body's immediate children;
172
- // only needed because of broken event delegation on iOS
173
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
222
+ this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
223
+ } // If this is a touch-enabled device we add extra
224
+ // empty mouseover listeners to the body's immediate children;
225
+ // only needed because of broken event delegation on iOS
226
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
174
227
 
175
228
 
176
- if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {
177
- $(document.body).children().on('mouseover', null, $.noop);
178
- }
229
+ if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
230
+ $$$1(document.body).children().on('mouseover', null, $$$1.noop);
231
+ }
179
232
 
180
- this._element.focus();
233
+ this._element.focus();
181
234
 
182
- this._element.setAttribute('aria-expanded', true);
235
+ this._element.setAttribute('aria-expanded', true);
183
236
 
184
- $(this._menu).toggleClass(ClassName.SHOW);
185
- $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
186
- };
237
+ $$$1(this._menu).toggleClass(ClassName.SHOW);
238
+ $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));
239
+ };
187
240
 
188
- _proto.dispose = function dispose() {
189
- $.removeData(this._element, DATA_KEY);
190
- $(this._element).off(EVENT_KEY);
191
- this._element = null;
192
- this._menu = null;
241
+ _proto.dispose = function dispose() {
242
+ $$$1.removeData(this._element, DATA_KEY);
243
+ $$$1(this._element).off(EVENT_KEY);
244
+ this._element = null;
245
+ this._menu = null;
193
246
 
194
- if (this._popper !== null) {
195
- this._popper.destroy();
247
+ if (this._popper !== null) {
248
+ this._popper.destroy();
196
249
 
197
- this._popper = null;
198
- }
199
- };
250
+ this._popper = null;
251
+ }
252
+ };
200
253
 
201
- _proto.update = function update() {
202
- this._inNavbar = this._detectNavbar();
254
+ _proto.update = function update() {
255
+ this._inNavbar = this._detectNavbar();
203
256
 
204
- if (this._popper !== null) {
205
- this._popper.scheduleUpdate();
206
- }
207
- }; // Private
257
+ if (this._popper !== null) {
258
+ this._popper.scheduleUpdate();
259
+ }
260
+ }; // Private
208
261
 
209
262
 
210
- _proto._addEventListeners = function _addEventListeners() {
211
- var _this = this;
263
+ _proto._addEventListeners = function _addEventListeners() {
264
+ var _this = this;
212
265
 
213
- $(this._element).on(Event.CLICK, function (event) {
214
- event.preventDefault();
215
- event.stopPropagation();
266
+ $$$1(this._element).on(Event.CLICK, function (event) {
267
+ event.preventDefault();
268
+ event.stopPropagation();
216
269
 
217
- _this.toggle();
218
- });
219
- };
270
+ _this.toggle();
271
+ });
272
+ };
220
273
 
221
- _proto._getConfig = function _getConfig(config) {
222
- config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
223
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
224
- return config;
225
- };
274
+ _proto._getConfig = function _getConfig(config) {
275
+ config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);
276
+ Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
277
+ return config;
278
+ };
226
279
 
227
- _proto._getMenuElement = function _getMenuElement() {
228
- if (!this._menu) {
229
- var parent = Dropdown._getParentFromElement(this._element);
280
+ _proto._getMenuElement = function _getMenuElement() {
281
+ if (!this._menu) {
282
+ var parent = Dropdown._getParentFromElement(this._element);
230
283
 
231
- if (parent) {
232
- this._menu = parent.querySelector(Selector.MENU);
284
+ if (parent) {
285
+ this._menu = parent.querySelector(Selector.MENU);
286
+ }
233
287
  }
234
- }
235
288
 
236
- return this._menu;
237
- };
289
+ return this._menu;
290
+ };
238
291
 
239
- _proto._getPlacement = function _getPlacement() {
240
- var $parentDropdown = $(this._element.parentNode);
241
- var placement = AttachmentMap.BOTTOM; // Handle dropup
292
+ _proto._getPlacement = function _getPlacement() {
293
+ var $parentDropdown = $$$1(this._element.parentNode);
294
+ var placement = AttachmentMap.BOTTOM; // Handle dropup
242
295
 
243
- if ($parentDropdown.hasClass(ClassName.DROPUP)) {
244
- placement = AttachmentMap.TOP;
296
+ if ($parentDropdown.hasClass(ClassName.DROPUP)) {
297
+ placement = AttachmentMap.TOP;
245
298
 
246
- if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
247
- placement = AttachmentMap.TOPEND;
299
+ if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
300
+ placement = AttachmentMap.TOPEND;
301
+ }
302
+ } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
303
+ placement = AttachmentMap.RIGHT;
304
+ } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
305
+ placement = AttachmentMap.LEFT;
306
+ } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
307
+ placement = AttachmentMap.BOTTOMEND;
248
308
  }
249
- } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
250
- placement = AttachmentMap.RIGHT;
251
- } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
252
- placement = AttachmentMap.LEFT;
253
- } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
254
- placement = AttachmentMap.BOTTOMEND;
255
- }
256
-
257
- return placement;
258
- };
259
309
 
260
- _proto._detectNavbar = function _detectNavbar() {
261
- return $(this._element).closest('.navbar').length > 0;
262
- };
310
+ return placement;
311
+ };
263
312
 
264
- _proto._getPopperConfig = function _getPopperConfig() {
265
- var _this2 = this;
313
+ _proto._detectNavbar = function _detectNavbar() {
314
+ return $$$1(this._element).closest('.navbar').length > 0;
315
+ };
266
316
 
267
- var offsetConf = {};
317
+ _proto._getPopperConfig = function _getPopperConfig() {
318
+ var _this2 = this;
268
319
 
269
- if (typeof this._config.offset === 'function') {
270
- offsetConf.fn = function (data) {
271
- data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
272
- return data;
273
- };
274
- } else {
275
- offsetConf.offset = this._config.offset;
276
- }
320
+ var offsetConf = {};
277
321
 
278
- var popperConfig = {
279
- placement: this._getPlacement(),
280
- modifiers: {
281
- offset: offsetConf,
282
- flip: {
283
- enabled: this._config.flip
284
- },
285
- preventOverflow: {
286
- boundariesElement: this._config.boundary
287
- }
288
- } // Disable Popper.js if we have a static display
322
+ if (typeof this._config.offset === 'function') {
323
+ offsetConf.fn = function (data) {
324
+ data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
325
+ return data;
326
+ };
327
+ } else {
328
+ offsetConf.offset = this._config.offset;
329
+ }
289
330
 
290
- };
331
+ var popperConfig = {
332
+ placement: this._getPlacement(),
333
+ modifiers: {
334
+ offset: offsetConf,
335
+ flip: {
336
+ enabled: this._config.flip
337
+ },
338
+ preventOverflow: {
339
+ boundariesElement: this._config.boundary
340
+ }
341
+ } // Disable Popper.js if we have a static display
291
342
 
292
- if (this._config.display === 'static') {
293
- popperConfig.modifiers.applyStyle = {
294
- enabled: false
295
343
  };
296
- }
297
344
 
298
- return popperConfig;
299
- }; // Static
345
+ if (this._config.display === 'static') {
346
+ popperConfig.modifiers.applyStyle = {
347
+ enabled: false
348
+ };
349
+ }
300
350
 
351
+ return popperConfig;
352
+ }; // Static
301
353
 
302
- Dropdown._jQueryInterface = function _jQueryInterface(config) {
303
- return this.each(function () {
304
- var data = $(this).data(DATA_KEY);
305
354
 
306
- var _config = typeof config === 'object' ? config : null;
355
+ Dropdown._jQueryInterface = function _jQueryInterface(config) {
356
+ return this.each(function () {
357
+ var data = $$$1(this).data(DATA_KEY);
307
358
 
308
- if (!data) {
309
- data = new Dropdown(this, _config);
310
- $(this).data(DATA_KEY, data);
311
- }
359
+ var _config = typeof config === 'object' ? config : null;
360
+
361
+ if (!data) {
362
+ data = new Dropdown(this, _config);
363
+ $$$1(this).data(DATA_KEY, data);
364
+ }
312
365
 
313
- if (typeof config === 'string') {
314
- if (typeof data[config] === 'undefined') {
315
- throw new TypeError("No method named \"" + config + "\"");
366
+ if (typeof config === 'string') {
367
+ if (typeof data[config] === 'undefined') {
368
+ throw new TypeError("No method named \"" + config + "\"");
369
+ }
370
+
371
+ data[config]();
316
372
  }
373
+ });
374
+ };
317
375
 
318
- data[config]();
376
+ Dropdown._clearMenus = function _clearMenus(event) {
377
+ if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
378
+ return;
319
379
  }
320
- });
321
- };
322
380
 
323
- Dropdown._clearMenus = function _clearMenus(event) {
324
- if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
325
- return;
326
- }
381
+ var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
327
382
 
328
- var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
383
+ for (var i = 0, len = toggles.length; i < len; i++) {
384
+ var parent = Dropdown._getParentFromElement(toggles[i]);
329
385
 
330
- for (var i = 0, len = toggles.length; i < len; i++) {
331
- var parent = Dropdown._getParentFromElement(toggles[i]);
386
+ var context = $$$1(toggles[i]).data(DATA_KEY);
387
+ var relatedTarget = {
388
+ relatedTarget: toggles[i]
389
+ };
332
390
 
333
- var context = $(toggles[i]).data(DATA_KEY);
334
- var relatedTarget = {
335
- relatedTarget: toggles[i]
336
- };
391
+ if (event && event.type === 'click') {
392
+ relatedTarget.clickEvent = event;
393
+ }
337
394
 
338
- if (event && event.type === 'click') {
339
- relatedTarget.clickEvent = event;
340
- }
395
+ if (!context) {
396
+ continue;
397
+ }
341
398
 
342
- if (!context) {
343
- continue;
344
- }
399
+ var dropdownMenu = context._menu;
345
400
 
346
- var dropdownMenu = context._menu;
401
+ if (!$$$1(parent).hasClass(ClassName.SHOW)) {
402
+ continue;
403
+ }
347
404
 
348
- if (!$(parent).hasClass(ClassName.SHOW)) {
349
- continue;
350
- }
405
+ if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
406
+ continue;
407
+ }
351
408
 
352
- if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
353
- continue;
354
- }
409
+ var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
410
+ $$$1(parent).trigger(hideEvent);
355
411
 
356
- var hideEvent = $.Event(Event.HIDE, relatedTarget);
357
- $(parent).trigger(hideEvent);
412
+ if (hideEvent.isDefaultPrevented()) {
413
+ continue;
414
+ } // If this is a touch-enabled device we remove the extra
415
+ // empty mouseover listeners we added for iOS support
358
416
 
359
- if (hideEvent.isDefaultPrevented()) {
360
- continue;
361
- } // If this is a touch-enabled device we remove the extra
362
- // empty mouseover listeners we added for iOS support
363
417
 
418
+ if ('ontouchstart' in document.documentElement) {
419
+ $$$1(document.body).children().off('mouseover', null, $$$1.noop);
420
+ }
364
421
 
365
- if ('ontouchstart' in document.documentElement) {
366
- $(document.body).children().off('mouseover', null, $.noop);
422
+ toggles[i].setAttribute('aria-expanded', 'false');
423
+ $$$1(dropdownMenu).removeClass(ClassName.SHOW);
424
+ $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
367
425
  }
426
+ };
368
427
 
369
- toggles[i].setAttribute('aria-expanded', 'false');
370
- $(dropdownMenu).removeClass(ClassName.SHOW);
371
- $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
372
- }
373
- };
428
+ Dropdown._getParentFromElement = function _getParentFromElement(element) {
429
+ var parent;
430
+ var selector = Util.getSelectorFromElement(element);
374
431
 
375
- Dropdown._getParentFromElement = function _getParentFromElement(element) {
376
- var parent;
377
- var selector = Util.getSelectorFromElement(element);
432
+ if (selector) {
433
+ parent = document.querySelector(selector);
434
+ }
378
435
 
379
- if (selector) {
380
- parent = document.querySelector(selector);
381
- }
436
+ return parent || element.parentNode;
437
+ }; // eslint-disable-next-line complexity
382
438
 
383
- return parent || element.parentNode;
384
- }; // eslint-disable-next-line complexity
385
439
 
440
+ Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
441
+ // If not input/textarea:
442
+ // - And not a key in REGEXP_KEYDOWN => not a dropdown command
443
+ // If input/textarea:
444
+ // - If space key => not a dropdown command
445
+ // - If key is other than escape
446
+ // - If key is not up or down => not a dropdown command
447
+ // - If trigger inside the menu => not a dropdown command
448
+ if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
449
+ return;
450
+ }
386
451
 
387
- Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
388
- // If not input/textarea:
389
- // - And not a key in REGEXP_KEYDOWN => not a dropdown command
390
- // If input/textarea:
391
- // - If space key => not a dropdown command
392
- // - If key is other than escape
393
- // - If key is not up or down => not a dropdown command
394
- // - If trigger inside the menu => not a dropdown command
395
- if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
396
- return;
397
- }
452
+ event.preventDefault();
453
+ event.stopPropagation();
398
454
 
399
- event.preventDefault();
400
- event.stopPropagation();
455
+ if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
456
+ return;
457
+ }
401
458
 
402
- if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
403
- return;
404
- }
459
+ var parent = Dropdown._getParentFromElement(this);
405
460
 
406
- var parent = Dropdown._getParentFromElement(this);
461
+ var isActive = $$$1(parent).hasClass(ClassName.SHOW);
407
462
 
408
- var isActive = $(parent).hasClass(ClassName.SHOW);
463
+ if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
464
+ if (event.which === ESCAPE_KEYCODE) {
465
+ var toggle = parent.querySelector(Selector.DATA_TOGGLE);
466
+ $$$1(toggle).trigger('focus');
467
+ }
409
468
 
410
- if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
411
- if (event.which === ESCAPE_KEYCODE) {
412
- var toggle = parent.querySelector(Selector.DATA_TOGGLE);
413
- $(toggle).trigger('focus');
469
+ $$$1(this).trigger('click');
470
+ return;
414
471
  }
415
472
 
416
- $(this).trigger('click');
417
- return;
418
- }
473
+ var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
419
474
 
420
- var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
475
+ if (items.length === 0) {
476
+ return;
477
+ }
421
478
 
422
- if (items.length === 0) {
423
- return;
424
- }
479
+ var index = items.indexOf(event.target);
425
480
 
426
- var index = items.indexOf(event.target);
481
+ if (event.which === ARROW_UP_KEYCODE && index > 0) {
482
+ // Up
483
+ index--;
484
+ }
427
485
 
428
- if (event.which === ARROW_UP_KEYCODE && index > 0) {
429
- // Up
430
- index--;
431
- }
486
+ if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
487
+ // Down
488
+ index++;
489
+ }
432
490
 
433
- if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
434
- // Down
435
- index++;
436
- }
491
+ if (index < 0) {
492
+ index = 0;
493
+ }
437
494
 
438
- if (index < 0) {
439
- index = 0;
440
- }
495
+ items[index].focus();
496
+ };
441
497
 
442
- items[index].focus();
443
- };
498
+ _createClass(Dropdown, null, [{
499
+ key: "VERSION",
500
+ get: function get() {
501
+ return VERSION;
502
+ }
503
+ }, {
504
+ key: "Default",
505
+ get: function get() {
506
+ return Default;
507
+ }
508
+ }, {
509
+ key: "DefaultType",
510
+ get: function get() {
511
+ return DefaultType;
512
+ }
513
+ }]);
444
514
 
445
- _createClass(Dropdown, null, [{
446
- key: "VERSION",
447
- get: function get() {
448
- return VERSION;
449
- }
450
- }, {
451
- key: "Default",
452
- get: function get() {
453
- return Default;
454
- }
455
- }, {
456
- key: "DefaultType",
457
- get: function get() {
458
- return DefaultType;
459
- }
460
- }]);
515
+ return Dropdown;
516
+ }();
517
+ /**
518
+ * ------------------------------------------------------------------------
519
+ * Data Api implementation
520
+ * ------------------------------------------------------------------------
521
+ */
461
522
 
462
- return Dropdown;
463
- }();
464
- /**
465
- * ------------------------------------------------------------------------
466
- * Data Api implementation
467
- * ------------------------------------------------------------------------
468
- */
469
523
 
524
+ $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
525
+ event.preventDefault();
526
+ event.stopPropagation();
470
527
 
471
- $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
472
- event.preventDefault();
473
- event.stopPropagation();
528
+ Dropdown._jQueryInterface.call($$$1(this), 'toggle');
529
+ }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
530
+ e.stopPropagation();
531
+ });
532
+ /**
533
+ * ------------------------------------------------------------------------
534
+ * jQuery
535
+ * ------------------------------------------------------------------------
536
+ */
474
537
 
475
- Dropdown._jQueryInterface.call($(this), 'toggle');
476
- }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
477
- e.stopPropagation();
478
- });
479
- /**
480
- * ------------------------------------------------------------------------
481
- * jQuery
482
- * ------------------------------------------------------------------------
483
- */
538
+ $$$1.fn[NAME] = Dropdown._jQueryInterface;
539
+ $$$1.fn[NAME].Constructor = Dropdown;
484
540
 
485
- $.fn[NAME] = Dropdown._jQueryInterface;
486
- $.fn[NAME].Constructor = Dropdown;
541
+ $$$1.fn[NAME].noConflict = function () {
542
+ $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
543
+ return Dropdown._jQueryInterface;
544
+ };
487
545
 
488
- $.fn[NAME].noConflict = function () {
489
- $.fn[NAME] = JQUERY_NO_CONFLICT;
490
- return Dropdown._jQueryInterface;
491
- };
546
+ return Dropdown;
547
+ }($, Popper);
492
548
 
493
549
  return Dropdown;
494
- }($, Popper);
550
+
551
+ })));