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,577 +1,633 @@
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; }
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
3
+ typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
4
+ (global.Modal = factory(global.jQuery,global.Util));
5
+ }(this, (function ($,Util) { 'use strict';
6
+
7
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8
+ Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
9
+
10
+ function _defineProperties(target, props) {
11
+ for (var i = 0; i < props.length; i++) {
12
+ var descriptor = props[i];
13
+ descriptor.enumerable = descriptor.enumerable || false;
14
+ descriptor.configurable = true;
15
+ if ("value" in descriptor) descriptor.writable = true;
16
+ Object.defineProperty(target, descriptor.key, descriptor);
17
+ }
18
+ }
19
+
20
+ function _createClass(Constructor, protoProps, staticProps) {
21
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
22
+ if (staticProps) _defineProperties(Constructor, staticProps);
23
+ return Constructor;
24
+ }
25
+
26
+ function _defineProperty(obj, key, value) {
27
+ if (key in obj) {
28
+ Object.defineProperty(obj, key, {
29
+ value: value,
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true
33
+ });
34
+ } else {
35
+ obj[key] = value;
36
+ }
2
37
 
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; }
38
+ return obj;
39
+ }
4
40
 
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); } }
41
+ function _objectSpread(target) {
42
+ for (var i = 1; i < arguments.length; i++) {
43
+ var source = arguments[i] != null ? arguments[i] : {};
44
+ var ownKeys = Object.keys(source);
6
45
 
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
46
+ if (typeof Object.getOwnPropertySymbols === 'function') {
47
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
48
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
49
+ }));
50
+ }
51
+
52
+ ownKeys.forEach(function (key) {
53
+ _defineProperty(target, key, source[key]);
54
+ });
55
+ }
56
+
57
+ return target;
58
+ }
8
59
 
9
- /**
10
- * --------------------------------------------------------------------------
11
- * Bootstrap (v4.1.2): modal.js
12
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
13
- * --------------------------------------------------------------------------
14
- */
15
- var Modal = function ($) {
16
60
  /**
17
- * ------------------------------------------------------------------------
18
- * Constants
19
- * ------------------------------------------------------------------------
61
+ * --------------------------------------------------------------------------
62
+ * Bootstrap (v4.1.3): modal.js
63
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
64
+ * --------------------------------------------------------------------------
20
65
  */
21
- var NAME = 'modal';
22
- var VERSION = '4.1.2';
23
- var DATA_KEY = 'bs.modal';
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 Default = {
30
- backdrop: true,
31
- keyboard: true,
32
- focus: true,
33
- show: true
34
- };
35
- var DefaultType = {
36
- backdrop: '(boolean|string)',
37
- keyboard: 'boolean',
38
- focus: 'boolean',
39
- show: 'boolean'
40
- };
41
- var Event = {
42
- HIDE: "hide" + EVENT_KEY,
43
- HIDDEN: "hidden" + EVENT_KEY,
44
- SHOW: "show" + EVENT_KEY,
45
- SHOWN: "shown" + EVENT_KEY,
46
- FOCUSIN: "focusin" + EVENT_KEY,
47
- RESIZE: "resize" + EVENT_KEY,
48
- CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
49
- KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
50
- MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
51
- MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
52
- CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
53
- };
54
- var ClassName = {
55
- SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
56
- BACKDROP: 'modal-backdrop',
57
- OPEN: 'modal-open',
58
- FADE: 'fade',
59
- SHOW: 'show'
60
- };
61
- var Selector = {
62
- DIALOG: '.modal-dialog',
63
- DATA_TOGGLE: '[data-toggle="modal"]',
64
- DATA_DISMISS: '[data-dismiss="modal"]',
65
- FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
66
- STICKY_CONTENT: '.sticky-top'
66
+
67
+ var Modal = function ($$$1) {
67
68
  /**
68
69
  * ------------------------------------------------------------------------
69
- * Class Definition
70
+ * Constants
70
71
  * ------------------------------------------------------------------------
71
72
  */
73
+ var NAME = 'modal';
74
+ var VERSION = '4.1.3';
75
+ var DATA_KEY = 'bs.modal';
76
+ var EVENT_KEY = "." + DATA_KEY;
77
+ var DATA_API_KEY = '.data-api';
78
+ var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
79
+ var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
80
+
81
+ var Default = {
82
+ backdrop: true,
83
+ keyboard: true,
84
+ focus: true,
85
+ show: true
86
+ };
87
+ var DefaultType = {
88
+ backdrop: '(boolean|string)',
89
+ keyboard: 'boolean',
90
+ focus: 'boolean',
91
+ show: 'boolean'
92
+ };
93
+ var Event = {
94
+ HIDE: "hide" + EVENT_KEY,
95
+ HIDDEN: "hidden" + EVENT_KEY,
96
+ SHOW: "show" + EVENT_KEY,
97
+ SHOWN: "shown" + EVENT_KEY,
98
+ FOCUSIN: "focusin" + EVENT_KEY,
99
+ RESIZE: "resize" + EVENT_KEY,
100
+ CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
101
+ KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
102
+ MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
103
+ MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
104
+ CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
105
+ };
106
+ var ClassName = {
107
+ SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
108
+ BACKDROP: 'modal-backdrop',
109
+ OPEN: 'modal-open',
110
+ FADE: 'fade',
111
+ SHOW: 'show'
112
+ };
113
+ var Selector = {
114
+ DIALOG: '.modal-dialog',
115
+ DATA_TOGGLE: '[data-toggle="modal"]',
116
+ DATA_DISMISS: '[data-dismiss="modal"]',
117
+ FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
118
+ STICKY_CONTENT: '.sticky-top'
119
+ /**
120
+ * ------------------------------------------------------------------------
121
+ * Class Definition
122
+ * ------------------------------------------------------------------------
123
+ */
72
124
 
73
- };
125
+ };
74
126
 
75
- var Modal =
76
- /*#__PURE__*/
77
- function () {
78
- function Modal(element, config) {
79
- this._config = this._getConfig(config);
80
- this._element = element;
81
- this._dialog = element.querySelector(Selector.DIALOG);
82
- this._backdrop = null;
83
- this._isShown = false;
84
- this._isBodyOverflowing = false;
85
- this._ignoreBackdropClick = false;
86
- this._scrollbarWidth = 0;
87
- } // Getters
127
+ var Modal =
128
+ /*#__PURE__*/
129
+ function () {
130
+ function Modal(element, config) {
131
+ this._config = this._getConfig(config);
132
+ this._element = element;
133
+ this._dialog = element.querySelector(Selector.DIALOG);
134
+ this._backdrop = null;
135
+ this._isShown = false;
136
+ this._isBodyOverflowing = false;
137
+ this._ignoreBackdropClick = false;
138
+ this._scrollbarWidth = 0;
139
+ } // Getters
88
140
 
89
141
 
90
- var _proto = Modal.prototype;
142
+ var _proto = Modal.prototype;
91
143
 
92
- // Public
93
- _proto.toggle = function toggle(relatedTarget) {
94
- return this._isShown ? this.hide() : this.show(relatedTarget);
95
- };
144
+ // Public
145
+ _proto.toggle = function toggle(relatedTarget) {
146
+ return this._isShown ? this.hide() : this.show(relatedTarget);
147
+ };
96
148
 
97
- _proto.show = function show(relatedTarget) {
98
- var _this = this;
149
+ _proto.show = function show(relatedTarget) {
150
+ var _this = this;
99
151
 
100
- if (this._isTransitioning || this._isShown) {
101
- return;
102
- }
152
+ if (this._isTransitioning || this._isShown) {
153
+ return;
154
+ }
103
155
 
104
- if ($(this._element).hasClass(ClassName.FADE)) {
105
- this._isTransitioning = true;
106
- }
156
+ if ($$$1(this._element).hasClass(ClassName.FADE)) {
157
+ this._isTransitioning = true;
158
+ }
107
159
 
108
- var showEvent = $.Event(Event.SHOW, {
109
- relatedTarget: relatedTarget
110
- });
111
- $(this._element).trigger(showEvent);
160
+ var showEvent = $$$1.Event(Event.SHOW, {
161
+ relatedTarget: relatedTarget
162
+ });
163
+ $$$1(this._element).trigger(showEvent);
112
164
 
113
- if (this._isShown || showEvent.isDefaultPrevented()) {
114
- return;
115
- }
165
+ if (this._isShown || showEvent.isDefaultPrevented()) {
166
+ return;
167
+ }
116
168
 
117
- this._isShown = true;
169
+ this._isShown = true;
118
170
 
119
- this._checkScrollbar();
171
+ this._checkScrollbar();
120
172
 
121
- this._setScrollbar();
173
+ this._setScrollbar();
122
174
 
123
- this._adjustDialog();
175
+ this._adjustDialog();
124
176
 
125
- $(document.body).addClass(ClassName.OPEN);
177
+ $$$1(document.body).addClass(ClassName.OPEN);
126
178
 
127
- this._setEscapeEvent();
179
+ this._setEscapeEvent();
128
180
 
129
- this._setResizeEvent();
181
+ this._setResizeEvent();
130
182
 
131
- $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
132
- return _this.hide(event);
133
- });
134
- $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
135
- $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
136
- if ($(event.target).is(_this._element)) {
137
- _this._ignoreBackdropClick = true;
138
- }
183
+ $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
184
+ return _this.hide(event);
185
+ });
186
+ $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
187
+ $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
188
+ if ($$$1(event.target).is(_this._element)) {
189
+ _this._ignoreBackdropClick = true;
190
+ }
191
+ });
139
192
  });
140
- });
141
193
 
142
- this._showBackdrop(function () {
143
- return _this._showElement(relatedTarget);
144
- });
145
- };
194
+ this._showBackdrop(function () {
195
+ return _this._showElement(relatedTarget);
196
+ });
197
+ };
146
198
 
147
- _proto.hide = function hide(event) {
148
- var _this2 = this;
199
+ _proto.hide = function hide(event) {
200
+ var _this2 = this;
149
201
 
150
- if (event) {
151
- event.preventDefault();
152
- }
202
+ if (event) {
203
+ event.preventDefault();
204
+ }
153
205
 
154
- if (this._isTransitioning || !this._isShown) {
155
- return;
156
- }
206
+ if (this._isTransitioning || !this._isShown) {
207
+ return;
208
+ }
157
209
 
158
- var hideEvent = $.Event(Event.HIDE);
159
- $(this._element).trigger(hideEvent);
210
+ var hideEvent = $$$1.Event(Event.HIDE);
211
+ $$$1(this._element).trigger(hideEvent);
160
212
 
161
- if (!this._isShown || hideEvent.isDefaultPrevented()) {
162
- return;
163
- }
213
+ if (!this._isShown || hideEvent.isDefaultPrevented()) {
214
+ return;
215
+ }
164
216
 
165
- this._isShown = false;
166
- var transition = $(this._element).hasClass(ClassName.FADE);
217
+ this._isShown = false;
218
+ var transition = $$$1(this._element).hasClass(ClassName.FADE);
167
219
 
168
- if (transition) {
169
- this._isTransitioning = true;
170
- }
220
+ if (transition) {
221
+ this._isTransitioning = true;
222
+ }
171
223
 
172
- this._setEscapeEvent();
224
+ this._setEscapeEvent();
173
225
 
174
- this._setResizeEvent();
226
+ this._setResizeEvent();
175
227
 
176
- $(document).off(Event.FOCUSIN);
177
- $(this._element).removeClass(ClassName.SHOW);
178
- $(this._element).off(Event.CLICK_DISMISS);
179
- $(this._dialog).off(Event.MOUSEDOWN_DISMISS);
228
+ $$$1(document).off(Event.FOCUSIN);
229
+ $$$1(this._element).removeClass(ClassName.SHOW);
230
+ $$$1(this._element).off(Event.CLICK_DISMISS);
231
+ $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
180
232
 
181
- if (transition) {
182
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
183
- $(this._element).one(Util.TRANSITION_END, function (event) {
184
- return _this2._hideModal(event);
185
- }).emulateTransitionEnd(transitionDuration);
186
- } else {
187
- this._hideModal();
188
- }
189
- };
233
+ if (transition) {
234
+ var transitionDuration = Util.getTransitionDurationFromElement(this._element);
235
+ $$$1(this._element).one(Util.TRANSITION_END, function (event) {
236
+ return _this2._hideModal(event);
237
+ }).emulateTransitionEnd(transitionDuration);
238
+ } else {
239
+ this._hideModal();
240
+ }
241
+ };
190
242
 
191
- _proto.dispose = function dispose() {
192
- $.removeData(this._element, DATA_KEY);
193
- $(window, document, this._element, this._backdrop).off(EVENT_KEY);
194
- this._config = null;
195
- this._element = null;
196
- this._dialog = null;
197
- this._backdrop = null;
198
- this._isShown = null;
199
- this._isBodyOverflowing = null;
200
- this._ignoreBackdropClick = null;
201
- this._scrollbarWidth = null;
202
- };
243
+ _proto.dispose = function dispose() {
244
+ $$$1.removeData(this._element, DATA_KEY);
245
+ $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
246
+ this._config = null;
247
+ this._element = null;
248
+ this._dialog = null;
249
+ this._backdrop = null;
250
+ this._isShown = null;
251
+ this._isBodyOverflowing = null;
252
+ this._ignoreBackdropClick = null;
253
+ this._scrollbarWidth = null;
254
+ };
203
255
 
204
- _proto.handleUpdate = function handleUpdate() {
205
- this._adjustDialog();
206
- }; // Private
256
+ _proto.handleUpdate = function handleUpdate() {
257
+ this._adjustDialog();
258
+ }; // Private
207
259
 
208
260
 
209
- _proto._getConfig = function _getConfig(config) {
210
- config = _objectSpread({}, Default, config);
211
- Util.typeCheckConfig(NAME, config, DefaultType);
212
- return config;
213
- };
261
+ _proto._getConfig = function _getConfig(config) {
262
+ config = _objectSpread({}, Default, config);
263
+ Util.typeCheckConfig(NAME, config, DefaultType);
264
+ return config;
265
+ };
214
266
 
215
- _proto._showElement = function _showElement(relatedTarget) {
216
- var _this3 = this;
267
+ _proto._showElement = function _showElement(relatedTarget) {
268
+ var _this3 = this;
217
269
 
218
- var transition = $(this._element).hasClass(ClassName.FADE);
270
+ var transition = $$$1(this._element).hasClass(ClassName.FADE);
219
271
 
220
- if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
221
- // Don't move modal's DOM position
222
- document.body.appendChild(this._element);
223
- }
272
+ if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
273
+ // Don't move modal's DOM position
274
+ document.body.appendChild(this._element);
275
+ }
224
276
 
225
- this._element.style.display = 'block';
277
+ this._element.style.display = 'block';
226
278
 
227
- this._element.removeAttribute('aria-hidden');
279
+ this._element.removeAttribute('aria-hidden');
228
280
 
229
- this._element.scrollTop = 0;
281
+ this._element.scrollTop = 0;
230
282
 
231
- if (transition) {
232
- Util.reflow(this._element);
233
- }
283
+ if (transition) {
284
+ Util.reflow(this._element);
285
+ }
234
286
 
235
- $(this._element).addClass(ClassName.SHOW);
287
+ $$$1(this._element).addClass(ClassName.SHOW);
236
288
 
237
- if (this._config.focus) {
238
- this._enforceFocus();
239
- }
289
+ if (this._config.focus) {
290
+ this._enforceFocus();
291
+ }
240
292
 
241
- var shownEvent = $.Event(Event.SHOWN, {
242
- relatedTarget: relatedTarget
243
- });
293
+ var shownEvent = $$$1.Event(Event.SHOWN, {
294
+ relatedTarget: relatedTarget
295
+ });
296
+
297
+ var transitionComplete = function transitionComplete() {
298
+ if (_this3._config.focus) {
299
+ _this3._element.focus();
300
+ }
244
301
 
245
- var transitionComplete = function transitionComplete() {
246
- if (_this3._config.focus) {
247
- _this3._element.focus();
302
+ _this3._isTransitioning = false;
303
+ $$$1(_this3._element).trigger(shownEvent);
304
+ };
305
+
306
+ if (transition) {
307
+ var transitionDuration = Util.getTransitionDurationFromElement(this._element);
308
+ $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
309
+ } else {
310
+ transitionComplete();
248
311
  }
312
+ };
313
+
314
+ _proto._enforceFocus = function _enforceFocus() {
315
+ var _this4 = this;
249
316
 
250
- _this3._isTransitioning = false;
251
- $(_this3._element).trigger(shownEvent);
317
+ $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
318
+ .on(Event.FOCUSIN, function (event) {
319
+ if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
320
+ _this4._element.focus();
321
+ }
322
+ });
252
323
  };
253
324
 
254
- if (transition) {
255
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
256
- $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
257
- } else {
258
- transitionComplete();
259
- }
260
- };
325
+ _proto._setEscapeEvent = function _setEscapeEvent() {
326
+ var _this5 = this;
261
327
 
262
- _proto._enforceFocus = function _enforceFocus() {
263
- var _this4 = this;
328
+ if (this._isShown && this._config.keyboard) {
329
+ $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
330
+ if (event.which === ESCAPE_KEYCODE) {
331
+ event.preventDefault();
264
332
 
265
- $(document).off(Event.FOCUSIN) // Guard against infinite focus loop
266
- .on(Event.FOCUSIN, function (event) {
267
- if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
268
- _this4._element.focus();
333
+ _this5.hide();
334
+ }
335
+ });
336
+ } else if (!this._isShown) {
337
+ $$$1(this._element).off(Event.KEYDOWN_DISMISS);
269
338
  }
270
- });
271
- };
272
-
273
- _proto._setEscapeEvent = function _setEscapeEvent() {
274
- var _this5 = this;
339
+ };
275
340
 
276
- if (this._isShown && this._config.keyboard) {
277
- $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
278
- if (event.which === ESCAPE_KEYCODE) {
279
- event.preventDefault();
341
+ _proto._setResizeEvent = function _setResizeEvent() {
342
+ var _this6 = this;
280
343
 
281
- _this5.hide();
282
- }
283
- });
284
- } else if (!this._isShown) {
285
- $(this._element).off(Event.KEYDOWN_DISMISS);
286
- }
287
- };
344
+ if (this._isShown) {
345
+ $$$1(window).on(Event.RESIZE, function (event) {
346
+ return _this6.handleUpdate(event);
347
+ });
348
+ } else {
349
+ $$$1(window).off(Event.RESIZE);
350
+ }
351
+ };
288
352
 
289
- _proto._setResizeEvent = function _setResizeEvent() {
290
- var _this6 = this;
353
+ _proto._hideModal = function _hideModal() {
354
+ var _this7 = this;
291
355
 
292
- if (this._isShown) {
293
- $(window).on(Event.RESIZE, function (event) {
294
- return _this6.handleUpdate(event);
295
- });
296
- } else {
297
- $(window).off(Event.RESIZE);
298
- }
299
- };
356
+ this._element.style.display = 'none';
300
357
 
301
- _proto._hideModal = function _hideModal() {
302
- var _this7 = this;
358
+ this._element.setAttribute('aria-hidden', true);
303
359
 
304
- this._element.style.display = 'none';
360
+ this._isTransitioning = false;
305
361
 
306
- this._element.setAttribute('aria-hidden', true);
362
+ this._showBackdrop(function () {
363
+ $$$1(document.body).removeClass(ClassName.OPEN);
307
364
 
308
- this._isTransitioning = false;
365
+ _this7._resetAdjustments();
309
366
 
310
- this._showBackdrop(function () {
311
- $(document.body).removeClass(ClassName.OPEN);
367
+ _this7._resetScrollbar();
312
368
 
313
- _this7._resetAdjustments();
369
+ $$$1(_this7._element).trigger(Event.HIDDEN);
370
+ });
371
+ };
314
372
 
315
- _this7._resetScrollbar();
373
+ _proto._removeBackdrop = function _removeBackdrop() {
374
+ if (this._backdrop) {
375
+ $$$1(this._backdrop).remove();
376
+ this._backdrop = null;
377
+ }
378
+ };
316
379
 
317
- $(_this7._element).trigger(Event.HIDDEN);
318
- });
319
- };
380
+ _proto._showBackdrop = function _showBackdrop(callback) {
381
+ var _this8 = this;
320
382
 
321
- _proto._removeBackdrop = function _removeBackdrop() {
322
- if (this._backdrop) {
323
- $(this._backdrop).remove();
324
- this._backdrop = null;
325
- }
326
- };
383
+ var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
327
384
 
328
- _proto._showBackdrop = function _showBackdrop(callback) {
329
- var _this8 = this;
385
+ if (this._isShown && this._config.backdrop) {
386
+ this._backdrop = document.createElement('div');
387
+ this._backdrop.className = ClassName.BACKDROP;
330
388
 
331
- var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
389
+ if (animate) {
390
+ this._backdrop.classList.add(animate);
391
+ }
332
392
 
333
- if (this._isShown && this._config.backdrop) {
334
- this._backdrop = document.createElement('div');
335
- this._backdrop.className = ClassName.BACKDROP;
393
+ $$$1(this._backdrop).appendTo(document.body);
394
+ $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
395
+ if (_this8._ignoreBackdropClick) {
396
+ _this8._ignoreBackdropClick = false;
397
+ return;
398
+ }
399
+
400
+ if (event.target !== event.currentTarget) {
401
+ return;
402
+ }
403
+
404
+ if (_this8._config.backdrop === 'static') {
405
+ _this8._element.focus();
406
+ } else {
407
+ _this8.hide();
408
+ }
409
+ });
410
+
411
+ if (animate) {
412
+ Util.reflow(this._backdrop);
413
+ }
336
414
 
337
- if (animate) {
338
- this._backdrop.classList.add(animate);
339
- }
415
+ $$$1(this._backdrop).addClass(ClassName.SHOW);
340
416
 
341
- $(this._backdrop).appendTo(document.body);
342
- $(this._element).on(Event.CLICK_DISMISS, function (event) {
343
- if (_this8._ignoreBackdropClick) {
344
- _this8._ignoreBackdropClick = false;
417
+ if (!callback) {
345
418
  return;
346
419
  }
347
420
 
348
- if (event.target !== event.currentTarget) {
421
+ if (!animate) {
422
+ callback();
349
423
  return;
350
424
  }
351
425
 
352
- if (_this8._config.backdrop === 'static') {
353
- _this8._element.focus();
354
- } else {
355
- _this8.hide();
356
- }
357
- });
426
+ var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
427
+ $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
428
+ } else if (!this._isShown && this._backdrop) {
429
+ $$$1(this._backdrop).removeClass(ClassName.SHOW);
358
430
 
359
- if (animate) {
360
- Util.reflow(this._backdrop);
361
- }
431
+ var callbackRemove = function callbackRemove() {
432
+ _this8._removeBackdrop();
362
433
 
363
- $(this._backdrop).addClass(ClassName.SHOW);
434
+ if (callback) {
435
+ callback();
436
+ }
437
+ };
364
438
 
365
- if (!callback) {
366
- return;
367
- }
439
+ if ($$$1(this._element).hasClass(ClassName.FADE)) {
440
+ var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
368
441
 
369
- if (!animate) {
442
+ $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
443
+ } else {
444
+ callbackRemove();
445
+ }
446
+ } else if (callback) {
370
447
  callback();
371
- return;
372
448
  }
449
+ }; // ----------------------------------------------------------------------
450
+ // the following methods are used to handle overflowing modals
451
+ // todo (fat): these should probably be refactored out of modal.js
452
+ // ----------------------------------------------------------------------
373
453
 
374
- var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
375
- $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
376
- } else if (!this._isShown && this._backdrop) {
377
- $(this._backdrop).removeClass(ClassName.SHOW);
378
-
379
- var callbackRemove = function callbackRemove() {
380
- _this8._removeBackdrop();
381
454
 
382
- if (callback) {
383
- callback();
384
- }
385
- };
455
+ _proto._adjustDialog = function _adjustDialog() {
456
+ var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
386
457
 
387
- if ($(this._element).hasClass(ClassName.FADE)) {
388
- var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
389
-
390
- $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
391
- } else {
392
- callbackRemove();
458
+ if (!this._isBodyOverflowing && isModalOverflowing) {
459
+ this._element.style.paddingLeft = this._scrollbarWidth + "px";
393
460
  }
394
- } else if (callback) {
395
- callback();
396
- }
397
- }; // ----------------------------------------------------------------------
398
- // the following methods are used to handle overflowing modals
399
- // todo (fat): these should probably be refactored out of modal.js
400
- // ----------------------------------------------------------------------
401
-
402
-
403
- _proto._adjustDialog = function _adjustDialog() {
404
- var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
405
461
 
406
- if (!this._isBodyOverflowing && isModalOverflowing) {
407
- this._element.style.paddingLeft = this._scrollbarWidth + "px";
408
- }
409
-
410
- if (this._isBodyOverflowing && !isModalOverflowing) {
411
- this._element.style.paddingRight = this._scrollbarWidth + "px";
412
- }
413
- };
462
+ if (this._isBodyOverflowing && !isModalOverflowing) {
463
+ this._element.style.paddingRight = this._scrollbarWidth + "px";
464
+ }
465
+ };
414
466
 
415
- _proto._resetAdjustments = function _resetAdjustments() {
416
- this._element.style.paddingLeft = '';
417
- this._element.style.paddingRight = '';
418
- };
467
+ _proto._resetAdjustments = function _resetAdjustments() {
468
+ this._element.style.paddingLeft = '';
469
+ this._element.style.paddingRight = '';
470
+ };
419
471
 
420
- _proto._checkScrollbar = function _checkScrollbar() {
421
- var rect = document.body.getBoundingClientRect();
422
- this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
423
- this._scrollbarWidth = this._getScrollbarWidth();
424
- };
472
+ _proto._checkScrollbar = function _checkScrollbar() {
473
+ var rect = document.body.getBoundingClientRect();
474
+ this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
475
+ this._scrollbarWidth = this._getScrollbarWidth();
476
+ };
425
477
 
426
- _proto._setScrollbar = function _setScrollbar() {
427
- var _this9 = this;
478
+ _proto._setScrollbar = function _setScrollbar() {
479
+ var _this9 = this;
480
+
481
+ if (this._isBodyOverflowing) {
482
+ // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
483
+ // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
484
+ var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
485
+ var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
486
+
487
+ $$$1(fixedContent).each(function (index, element) {
488
+ var actualPadding = element.style.paddingRight;
489
+ var calculatedPadding = $$$1(element).css('padding-right');
490
+ $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
491
+ }); // Adjust sticky content margin
492
+
493
+ $$$1(stickyContent).each(function (index, element) {
494
+ var actualMargin = element.style.marginRight;
495
+ var calculatedMargin = $$$1(element).css('margin-right');
496
+ $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
497
+ }); // Adjust body padding
498
+
499
+ var actualPadding = document.body.style.paddingRight;
500
+ var calculatedPadding = $$$1(document.body).css('padding-right');
501
+ $$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
502
+ }
503
+ };
428
504
 
429
- if (this._isBodyOverflowing) {
430
- // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
431
- // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
505
+ _proto._resetScrollbar = function _resetScrollbar() {
506
+ // Restore fixed content padding
432
507
  var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
433
- var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
434
-
435
- $(fixedContent).each(function (index, element) {
436
- var actualPadding = element.style.paddingRight;
437
- var calculatedPadding = $(element).css('padding-right');
438
- $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
439
- }); // Adjust sticky content margin
440
-
441
- $(stickyContent).each(function (index, element) {
442
- var actualMargin = element.style.marginRight;
443
- var calculatedMargin = $(element).css('margin-right');
444
- $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
445
- }); // Adjust body padding
446
-
447
- var actualPadding = document.body.style.paddingRight;
448
- var calculatedPadding = $(document.body).css('padding-right');
449
- $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
450
- }
451
- };
508
+ $$$1(fixedContent).each(function (index, element) {
509
+ var padding = $$$1(element).data('padding-right');
510
+ $$$1(element).removeData('padding-right');
511
+ element.style.paddingRight = padding ? padding : '';
512
+ }); // Restore sticky content
513
+
514
+ var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
515
+ $$$1(elements).each(function (index, element) {
516
+ var margin = $$$1(element).data('margin-right');
517
+
518
+ if (typeof margin !== 'undefined') {
519
+ $$$1(element).css('margin-right', margin).removeData('margin-right');
520
+ }
521
+ }); // Restore body padding
452
522
 
453
- _proto._resetScrollbar = function _resetScrollbar() {
454
- // Restore fixed content padding
455
- var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
456
- $(fixedContent).each(function (index, element) {
457
- var padding = $(element).data('padding-right');
458
- $(element).removeData('padding-right');
459
- element.style.paddingRight = padding ? padding : '';
460
- }); // Restore sticky content
461
-
462
- var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
463
- $(elements).each(function (index, element) {
464
- var margin = $(element).data('margin-right');
465
-
466
- if (typeof margin !== 'undefined') {
467
- $(element).css('margin-right', margin).removeData('margin-right');
468
- }
469
- }); // Restore body padding
523
+ var padding = $$$1(document.body).data('padding-right');
524
+ $$$1(document.body).removeData('padding-right');
525
+ document.body.style.paddingRight = padding ? padding : '';
526
+ };
470
527
 
471
- var padding = $(document.body).data('padding-right');
472
- $(document.body).removeData('padding-right');
473
- document.body.style.paddingRight = padding ? padding : '';
474
- };
528
+ _proto._getScrollbarWidth = function _getScrollbarWidth() {
529
+ // thx d.walsh
530
+ var scrollDiv = document.createElement('div');
531
+ scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
532
+ document.body.appendChild(scrollDiv);
533
+ var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
534
+ document.body.removeChild(scrollDiv);
535
+ return scrollbarWidth;
536
+ }; // Static
475
537
 
476
- _proto._getScrollbarWidth = function _getScrollbarWidth() {
477
- // thx d.walsh
478
- var scrollDiv = document.createElement('div');
479
- scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
480
- document.body.appendChild(scrollDiv);
481
- var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
482
- document.body.removeChild(scrollDiv);
483
- return scrollbarWidth;
484
- }; // Static
485
538
 
539
+ Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
540
+ return this.each(function () {
541
+ var data = $$$1(this).data(DATA_KEY);
486
542
 
487
- Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
488
- return this.each(function () {
489
- var data = $(this).data(DATA_KEY);
543
+ var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {});
490
544
 
491
- var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});
545
+ if (!data) {
546
+ data = new Modal(this, _config);
547
+ $$$1(this).data(DATA_KEY, data);
548
+ }
492
549
 
493
- if (!data) {
494
- data = new Modal(this, _config);
495
- $(this).data(DATA_KEY, data);
496
- }
550
+ if (typeof config === 'string') {
551
+ if (typeof data[config] === 'undefined') {
552
+ throw new TypeError("No method named \"" + config + "\"");
553
+ }
497
554
 
498
- if (typeof config === 'string') {
499
- if (typeof data[config] === 'undefined') {
500
- throw new TypeError("No method named \"" + config + "\"");
555
+ data[config](relatedTarget);
556
+ } else if (_config.show) {
557
+ data.show(relatedTarget);
501
558
  }
559
+ });
560
+ };
502
561
 
503
- data[config](relatedTarget);
504
- } else if (_config.show) {
505
- data.show(relatedTarget);
562
+ _createClass(Modal, null, [{
563
+ key: "VERSION",
564
+ get: function get() {
565
+ return VERSION;
506
566
  }
507
- });
508
- };
509
-
510
- _createClass(Modal, null, [{
511
- key: "VERSION",
512
- get: function get() {
513
- return VERSION;
514
- }
515
- }, {
516
- key: "Default",
517
- get: function get() {
518
- return Default;
519
- }
520
- }]);
521
-
522
- return Modal;
523
- }();
524
- /**
525
- * ------------------------------------------------------------------------
526
- * Data Api implementation
527
- * ------------------------------------------------------------------------
528
- */
567
+ }, {
568
+ key: "Default",
569
+ get: function get() {
570
+ return Default;
571
+ }
572
+ }]);
529
573
 
574
+ return Modal;
575
+ }();
576
+ /**
577
+ * ------------------------------------------------------------------------
578
+ * Data Api implementation
579
+ * ------------------------------------------------------------------------
580
+ */
530
581
 
531
- $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
532
- var _this10 = this;
533
582
 
534
- var target;
535
- var selector = Util.getSelectorFromElement(this);
583
+ $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
584
+ var _this10 = this;
536
585
 
537
- if (selector) {
538
- target = document.querySelector(selector);
539
- }
586
+ var target;
587
+ var selector = Util.getSelectorFromElement(this);
540
588
 
541
- var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
589
+ if (selector) {
590
+ target = document.querySelector(selector);
591
+ }
542
592
 
543
- if (this.tagName === 'A' || this.tagName === 'AREA') {
544
- event.preventDefault();
545
- }
593
+ var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());
546
594
 
547
- var $target = $(target).one(Event.SHOW, function (showEvent) {
548
- if (showEvent.isDefaultPrevented()) {
549
- // Only register focus restorer if modal will actually get shown
550
- return;
595
+ if (this.tagName === 'A' || this.tagName === 'AREA') {
596
+ event.preventDefault();
551
597
  }
552
598
 
553
- $target.one(Event.HIDDEN, function () {
554
- if ($(_this10).is(':visible')) {
555
- _this10.focus();
599
+ var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
600
+ if (showEvent.isDefaultPrevented()) {
601
+ // Only register focus restorer if modal will actually get shown
602
+ return;
556
603
  }
604
+
605
+ $target.one(Event.HIDDEN, function () {
606
+ if ($$$1(_this10).is(':visible')) {
607
+ _this10.focus();
608
+ }
609
+ });
557
610
  });
611
+
612
+ Modal._jQueryInterface.call($$$1(target), config, this);
558
613
  });
614
+ /**
615
+ * ------------------------------------------------------------------------
616
+ * jQuery
617
+ * ------------------------------------------------------------------------
618
+ */
559
619
 
560
- Modal._jQueryInterface.call($(target), config, this);
561
- });
562
- /**
563
- * ------------------------------------------------------------------------
564
- * jQuery
565
- * ------------------------------------------------------------------------
566
- */
620
+ $$$1.fn[NAME] = Modal._jQueryInterface;
621
+ $$$1.fn[NAME].Constructor = Modal;
567
622
 
568
- $.fn[NAME] = Modal._jQueryInterface;
569
- $.fn[NAME].Constructor = Modal;
623
+ $$$1.fn[NAME].noConflict = function () {
624
+ $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
625
+ return Modal._jQueryInterface;
626
+ };
570
627
 
571
- $.fn[NAME].noConflict = function () {
572
- $.fn[NAME] = JQUERY_NO_CONFLICT;
573
- return Modal._jQueryInterface;
574
- };
628
+ return Modal;
629
+ }($);
575
630
 
576
631
  return Modal;
577
- }($);
632
+
633
+ })));