bootstrap 4.0.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +2 -2
  5. data/Rakefile +4 -2
  6. data/assets/javascripts/bootstrap/alert.js +45 -22
  7. data/assets/javascripts/bootstrap/button.js +39 -19
  8. data/assets/javascripts/bootstrap/carousel.js +213 -51
  9. data/assets/javascripts/bootstrap/collapse.js +105 -52
  10. data/assets/javascripts/bootstrap/dropdown.js +169 -45
  11. data/assets/javascripts/bootstrap/modal.js +139 -71
  12. data/assets/javascripts/bootstrap/popover.js +77 -20
  13. data/assets/javascripts/bootstrap/scrollspy.js +87 -29
  14. data/assets/javascripts/bootstrap/tab.js +50 -32
  15. data/assets/javascripts/bootstrap/toast.js +282 -0
  16. data/assets/javascripts/bootstrap/tooltip.js +295 -59
  17. data/assets/javascripts/bootstrap/util.js +78 -45
  18. data/assets/javascripts/bootstrap-sprockets.js +7 -6
  19. data/assets/javascripts/bootstrap.js +1537 -996
  20. data/assets/javascripts/bootstrap.min.js +3 -3
  21. data/assets/stylesheets/_bootstrap-grid.scss +4 -7
  22. data/assets/stylesheets/_bootstrap-reboot.scss +3 -3
  23. data/assets/stylesheets/_bootstrap.scss +5 -3
  24. data/assets/stylesheets/bootstrap/_alert.scss +1 -1
  25. data/assets/stylesheets/bootstrap/_badge.scss +8 -1
  26. data/assets/stylesheets/bootstrap/_breadcrumb.scss +9 -6
  27. data/assets/stylesheets/bootstrap/_button-group.scss +16 -19
  28. data/assets/stylesheets/bootstrap/_buttons.scss +10 -16
  29. data/assets/stylesheets/bootstrap/_card.scss +53 -34
  30. data/assets/stylesheets/bootstrap/_carousel.scss +66 -60
  31. data/assets/stylesheets/bootstrap/_close.scss +15 -8
  32. data/assets/stylesheets/bootstrap/_code.scss +5 -13
  33. data/assets/stylesheets/bootstrap/_custom-forms.scss +250 -40
  34. data/assets/stylesheets/bootstrap/_dropdown.scss +65 -5
  35. data/assets/stylesheets/bootstrap/_forms.scss +32 -35
  36. data/assets/stylesheets/bootstrap/_functions.scss +9 -9
  37. data/assets/stylesheets/bootstrap/_images.scss +2 -2
  38. data/assets/stylesheets/bootstrap/_input-group.scss +45 -11
  39. data/assets/stylesheets/bootstrap/_jumbotron.scss +1 -0
  40. data/assets/stylesheets/bootstrap/_list-group.scss +39 -5
  41. data/assets/stylesheets/bootstrap/_mixins.scss +6 -1
  42. data/assets/stylesheets/bootstrap/_modal.scss +80 -19
  43. data/assets/stylesheets/bootstrap/_nav.scss +2 -0
  44. data/assets/stylesheets/bootstrap/_navbar.scss +9 -26
  45. data/assets/stylesheets/bootstrap/_pagination.scss +2 -6
  46. data/assets/stylesheets/bootstrap/_popover.scss +47 -59
  47. data/assets/stylesheets/bootstrap/_print.scss +23 -6
  48. data/assets/stylesheets/bootstrap/_progress.scss +16 -6
  49. data/assets/stylesheets/bootstrap/_reboot.scss +51 -50
  50. data/assets/stylesheets/bootstrap/_spinners.scss +55 -0
  51. data/assets/stylesheets/bootstrap/_tables.scss +16 -11
  52. data/assets/stylesheets/bootstrap/_toasts.scss +44 -0
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +1 -1
  54. data/assets/stylesheets/bootstrap/_transitions.scss +4 -20
  55. data/assets/stylesheets/bootstrap/_type.scss +16 -16
  56. data/assets/stylesheets/bootstrap/_utilities.scss +3 -0
  57. data/assets/stylesheets/bootstrap/_variables.scss +430 -201
  58. data/assets/stylesheets/bootstrap/mixins/_badge.scss +7 -2
  59. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +29 -1
  60. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +16 -1
  61. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +3 -3
  62. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +12 -14
  63. data/assets/stylesheets/bootstrap/mixins/_caret.scss +5 -8
  64. data/assets/stylesheets/bootstrap/mixins/_deprecate.scss +10 -0
  65. data/assets/stylesheets/bootstrap/mixins/_float.scss +3 -0
  66. data/assets/stylesheets/bootstrap/mixins/_forms.scss +68 -13
  67. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +7 -7
  68. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +3 -4
  69. data/assets/stylesheets/bootstrap/mixins/_grid.scss +9 -10
  70. data/assets/stylesheets/bootstrap/mixins/_hover.scss +3 -5
  71. data/assets/stylesheets/bootstrap/mixins/_image.scss +2 -2
  72. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  73. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +2 -2
  74. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +1 -1
  75. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  76. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +1 -3
  77. data/assets/stylesheets/bootstrap/mixins/_size.scss +1 -0
  78. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +10 -1
  79. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +5 -3
  80. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +3 -1
  81. data/assets/stylesheets/bootstrap/mixins/_transition.scss +7 -0
  82. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +1 -0
  83. data/assets/stylesheets/bootstrap/utilities/_borders.scss +17 -1
  84. data/assets/stylesheets/bootstrap/utilities/_display.scss +6 -18
  85. data/assets/stylesheets/bootstrap/utilities/_embed.scss +7 -20
  86. data/assets/stylesheets/bootstrap/utilities/_flex.scss +5 -0
  87. data/assets/stylesheets/bootstrap/utilities/_float.scss +5 -3
  88. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +5 -0
  89. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -4
  90. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +6 -0
  91. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +8 -0
  92. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +23 -1
  93. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +19 -0
  94. data/assets/stylesheets/bootstrap/utilities/_text.scss +26 -6
  95. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +4 -2
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +204 -0
  97. data/bootstrap.gemspec +6 -3
  98. data/lib/bootstrap/engine.rb +3 -0
  99. data/lib/bootstrap/version.rb +4 -2
  100. data/lib/bootstrap.rb +10 -7
  101. data/tasks/updater/js.rb +1 -1
  102. data/test/test_helper.rb +7 -6
  103. metadata +19 -12
  104. data/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +0 -10
@@ -1,29 +1,79 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ /*!
2
+ * Bootstrap modal.js v4.3.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ */
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
8
+ typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
9
+ (global = global || self, global.Modal = factory(global.jQuery, global.Util));
10
+ }(this, function ($, Util) { 'use strict';
11
+
12
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
+ Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
14
+
15
+ function _defineProperties(target, props) {
16
+ for (var i = 0; i < props.length; i++) {
17
+ var descriptor = props[i];
18
+ descriptor.enumerable = descriptor.enumerable || false;
19
+ descriptor.configurable = true;
20
+ if ("value" in descriptor) descriptor.writable = true;
21
+ Object.defineProperty(target, descriptor.key, descriptor);
22
+ }
23
+ }
24
+
25
+ function _createClass(Constructor, protoProps, staticProps) {
26
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
+ if (staticProps) _defineProperties(Constructor, staticProps);
28
+ return Constructor;
29
+ }
30
+
31
+ function _defineProperty(obj, key, value) {
32
+ if (key in obj) {
33
+ Object.defineProperty(obj, key, {
34
+ value: value,
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true
38
+ });
39
+ } else {
40
+ obj[key] = value;
41
+ }
42
+
43
+ return obj;
44
+ }
45
+
46
+ function _objectSpread(target) {
47
+ for (var i = 1; i < arguments.length; i++) {
48
+ var source = arguments[i] != null ? arguments[i] : {};
49
+ var ownKeys = Object.keys(source);
2
50
 
3
- 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); } }
51
+ if (typeof Object.getOwnPropertySymbols === 'function') {
52
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
53
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
54
+ }));
55
+ }
56
+
57
+ ownKeys.forEach(function (key) {
58
+ _defineProperty(target, key, source[key]);
59
+ });
60
+ }
4
61
 
5
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
62
+ return target;
63
+ }
6
64
 
7
- /**
8
- * --------------------------------------------------------------------------
9
- * Bootstrap (v4.0.0): modal.js
10
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
11
- * --------------------------------------------------------------------------
12
- */
13
- var Modal = function ($) {
14
65
  /**
15
66
  * ------------------------------------------------------------------------
16
67
  * Constants
17
68
  * ------------------------------------------------------------------------
18
69
  */
70
+
19
71
  var NAME = 'modal';
20
- var VERSION = '4.0.0';
72
+ var VERSION = '4.3.1';
21
73
  var DATA_KEY = 'bs.modal';
22
74
  var EVENT_KEY = "." + DATA_KEY;
23
75
  var DATA_API_KEY = '.data-api';
24
76
  var JQUERY_NO_CONFLICT = $.fn[NAME];
25
- var TRANSITION_DURATION = 300;
26
- var BACKDROP_TRANSITION_DURATION = 150;
27
77
  var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
28
78
 
29
79
  var Default = {
@@ -52,6 +102,7 @@ var Modal = function ($) {
52
102
  CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
53
103
  };
54
104
  var ClassName = {
105
+ SCROLLABLE: 'modal-dialog-scrollable',
55
106
  SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
56
107
  BACKDROP: 'modal-backdrop',
57
108
  OPEN: 'modal-open',
@@ -60,11 +111,11 @@ var Modal = function ($) {
60
111
  };
61
112
  var Selector = {
62
113
  DIALOG: '.modal-dialog',
114
+ MODAL_BODY: '.modal-body',
63
115
  DATA_TOGGLE: '[data-toggle="modal"]',
64
116
  DATA_DISMISS: '[data-dismiss="modal"]',
65
117
  FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
66
- STICKY_CONTENT: '.sticky-top',
67
- NAVBAR_TOGGLER: '.navbar-toggler'
118
+ STICKY_CONTENT: '.sticky-top'
68
119
  /**
69
120
  * ------------------------------------------------------------------------
70
121
  * Class Definition
@@ -79,12 +130,12 @@ var Modal = function ($) {
79
130
  function Modal(element, config) {
80
131
  this._config = this._getConfig(config);
81
132
  this._element = element;
82
- this._dialog = $(element).find(Selector.DIALOG)[0];
133
+ this._dialog = element.querySelector(Selector.DIALOG);
83
134
  this._backdrop = null;
84
135
  this._isShown = false;
85
136
  this._isBodyOverflowing = false;
86
137
  this._ignoreBackdropClick = false;
87
- this._originalBodyPadding = 0;
138
+ this._isTransitioning = false;
88
139
  this._scrollbarWidth = 0;
89
140
  } // Getters
90
141
 
@@ -99,11 +150,11 @@ var Modal = function ($) {
99
150
  _proto.show = function show(relatedTarget) {
100
151
  var _this = this;
101
152
 
102
- if (this._isTransitioning || this._isShown) {
153
+ if (this._isShown || this._isTransitioning) {
103
154
  return;
104
155
  }
105
156
 
106
- if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
157
+ if ($(this._element).hasClass(ClassName.FADE)) {
107
158
  this._isTransitioning = true;
108
159
  }
109
160
 
@@ -124,8 +175,6 @@ var Modal = function ($) {
124
175
 
125
176
  this._adjustDialog();
126
177
 
127
- $(document.body).addClass(ClassName.OPEN);
128
-
129
178
  this._setEscapeEvent();
130
179
 
131
180
  this._setResizeEvent();
@@ -153,7 +202,7 @@ var Modal = function ($) {
153
202
  event.preventDefault();
154
203
  }
155
204
 
156
- if (this._isTransitioning || !this._isShown) {
205
+ if (!this._isShown || this._isTransitioning) {
157
206
  return;
158
207
  }
159
208
 
@@ -165,7 +214,7 @@ var Modal = function ($) {
165
214
  }
166
215
 
167
216
  this._isShown = false;
168
- var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
217
+ var transition = $(this._element).hasClass(ClassName.FADE);
169
218
 
170
219
  if (transition) {
171
220
  this._isTransitioning = true;
@@ -181,17 +230,27 @@ var Modal = function ($) {
181
230
  $(this._dialog).off(Event.MOUSEDOWN_DISMISS);
182
231
 
183
232
  if (transition) {
233
+ var transitionDuration = Util.getTransitionDurationFromElement(this._element);
184
234
  $(this._element).one(Util.TRANSITION_END, function (event) {
185
235
  return _this2._hideModal(event);
186
- }).emulateTransitionEnd(TRANSITION_DURATION);
236
+ }).emulateTransitionEnd(transitionDuration);
187
237
  } else {
188
238
  this._hideModal();
189
239
  }
190
240
  };
191
241
 
192
242
  _proto.dispose = function dispose() {
243
+ [window, this._element, this._dialog].forEach(function (htmlElement) {
244
+ return $(htmlElement).off(EVENT_KEY);
245
+ });
246
+ /**
247
+ * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
248
+ * Do not move `document` in `htmlElements` array
249
+ * It will remove `Event.CLICK_DATA_API` event that should remain
250
+ */
251
+
252
+ $(document).off(Event.FOCUSIN);
193
253
  $.removeData(this._element, DATA_KEY);
194
- $(window, document, this._element, this._backdrop).off(EVENT_KEY);
195
254
  this._config = null;
196
255
  this._element = null;
197
256
  this._dialog = null;
@@ -199,16 +258,17 @@ var Modal = function ($) {
199
258
  this._isShown = null;
200
259
  this._isBodyOverflowing = null;
201
260
  this._ignoreBackdropClick = null;
261
+ this._isTransitioning = null;
202
262
  this._scrollbarWidth = null;
203
263
  };
204
264
 
205
265
  _proto.handleUpdate = function handleUpdate() {
206
266
  this._adjustDialog();
207
- }; // Private
208
-
267
+ } // Private
268
+ ;
209
269
 
210
270
  _proto._getConfig = function _getConfig(config) {
211
- config = _extends({}, Default, config);
271
+ config = _objectSpread({}, Default, config);
212
272
  Util.typeCheckConfig(NAME, config, DefaultType);
213
273
  return config;
214
274
  };
@@ -216,7 +276,7 @@ var Modal = function ($) {
216
276
  _proto._showElement = function _showElement(relatedTarget) {
217
277
  var _this3 = this;
218
278
 
219
- var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
279
+ var transition = $(this._element).hasClass(ClassName.FADE);
220
280
 
221
281
  if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
222
282
  // Don't move modal's DOM position
@@ -227,7 +287,13 @@ var Modal = function ($) {
227
287
 
228
288
  this._element.removeAttribute('aria-hidden');
229
289
 
230
- this._element.scrollTop = 0;
290
+ this._element.setAttribute('aria-modal', true);
291
+
292
+ if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) {
293
+ this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0;
294
+ } else {
295
+ this._element.scrollTop = 0;
296
+ }
231
297
 
232
298
  if (transition) {
233
299
  Util.reflow(this._element);
@@ -253,7 +319,8 @@ var Modal = function ($) {
253
319
  };
254
320
 
255
321
  if (transition) {
256
- $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
322
+ var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
323
+ $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
257
324
  } else {
258
325
  transitionComplete();
259
326
  }
@@ -305,6 +372,8 @@ var Modal = function ($) {
305
372
 
306
373
  this._element.setAttribute('aria-hidden', true);
307
374
 
375
+ this._element.removeAttribute('aria-modal');
376
+
308
377
  this._isTransitioning = false;
309
378
 
310
379
  this._showBackdrop(function () {
@@ -331,12 +400,11 @@ var Modal = function ($) {
331
400
  var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
332
401
 
333
402
  if (this._isShown && this._config.backdrop) {
334
- var doAnimate = Util.supportsTransitionEnd() && animate;
335
403
  this._backdrop = document.createElement('div');
336
404
  this._backdrop.className = ClassName.BACKDROP;
337
405
 
338
406
  if (animate) {
339
- $(this._backdrop).addClass(animate);
407
+ this._backdrop.classList.add(animate);
340
408
  }
341
409
 
342
410
  $(this._backdrop).appendTo(document.body);
@@ -357,7 +425,7 @@ var Modal = function ($) {
357
425
  }
358
426
  });
359
427
 
360
- if (doAnimate) {
428
+ if (animate) {
361
429
  Util.reflow(this._backdrop);
362
430
  }
363
431
 
@@ -367,12 +435,13 @@ var Modal = function ($) {
367
435
  return;
368
436
  }
369
437
 
370
- if (!doAnimate) {
438
+ if (!animate) {
371
439
  callback();
372
440
  return;
373
441
  }
374
442
 
375
- $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
443
+ var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
444
+ $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
376
445
  } else if (!this._isShown && this._backdrop) {
377
446
  $(this._backdrop).removeClass(ClassName.SHOW);
378
447
 
@@ -384,19 +453,21 @@ var Modal = function ($) {
384
453
  }
385
454
  };
386
455
 
387
- if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
388
- $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
456
+ if ($(this._element).hasClass(ClassName.FADE)) {
457
+ var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
458
+
459
+ $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
389
460
  } else {
390
461
  callbackRemove();
391
462
  }
392
463
  } else if (callback) {
393
464
  callback();
394
465
  }
395
- }; // ----------------------------------------------------------------------
466
+ } // ----------------------------------------------------------------------
396
467
  // the following methods are used to handle overflowing modals
397
468
  // todo (fat): these should probably be refactored out of modal.js
398
469
  // ----------------------------------------------------------------------
399
-
470
+ ;
400
471
 
401
472
  _proto._adjustDialog = function _adjustDialog() {
402
473
  var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
@@ -427,42 +498,40 @@ var Modal = function ($) {
427
498
  if (this._isBodyOverflowing) {
428
499
  // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
429
500
  // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
430
- // Adjust fixed content padding
431
- $(Selector.FIXED_CONTENT).each(function (index, element) {
432
- var actualPadding = $(element)[0].style.paddingRight;
501
+ var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
502
+ var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
503
+
504
+ $(fixedContent).each(function (index, element) {
505
+ var actualPadding = element.style.paddingRight;
433
506
  var calculatedPadding = $(element).css('padding-right');
434
507
  $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
435
508
  }); // Adjust sticky content margin
436
509
 
437
- $(Selector.STICKY_CONTENT).each(function (index, element) {
438
- var actualMargin = $(element)[0].style.marginRight;
510
+ $(stickyContent).each(function (index, element) {
511
+ var actualMargin = element.style.marginRight;
439
512
  var calculatedMargin = $(element).css('margin-right');
440
513
  $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
441
- }); // Adjust navbar-toggler margin
442
-
443
- $(Selector.NAVBAR_TOGGLER).each(function (index, element) {
444
- var actualMargin = $(element)[0].style.marginRight;
445
- var calculatedMargin = $(element).css('margin-right');
446
- $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + "px");
447
514
  }); // Adjust body padding
448
515
 
449
516
  var actualPadding = document.body.style.paddingRight;
450
- var calculatedPadding = $('body').css('padding-right');
451
- $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
517
+ var calculatedPadding = $(document.body).css('padding-right');
518
+ $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
452
519
  }
520
+
521
+ $(document.body).addClass(ClassName.OPEN);
453
522
  };
454
523
 
455
524
  _proto._resetScrollbar = function _resetScrollbar() {
456
525
  // Restore fixed content padding
457
- $(Selector.FIXED_CONTENT).each(function (index, element) {
526
+ var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
527
+ $(fixedContent).each(function (index, element) {
458
528
  var padding = $(element).data('padding-right');
529
+ $(element).removeData('padding-right');
530
+ element.style.paddingRight = padding ? padding : '';
531
+ }); // Restore sticky content
459
532
 
460
- if (typeof padding !== 'undefined') {
461
- $(element).css('padding-right', padding).removeData('padding-right');
462
- }
463
- }); // Restore sticky content and navbar-toggler margin
464
-
465
- $(Selector.STICKY_CONTENT + ", " + Selector.NAVBAR_TOGGLER).each(function (index, element) {
533
+ var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
534
+ $(elements).each(function (index, element) {
466
535
  var margin = $(element).data('margin-right');
467
536
 
468
537
  if (typeof margin !== 'undefined') {
@@ -470,11 +539,9 @@ var Modal = function ($) {
470
539
  }
471
540
  }); // Restore body padding
472
541
 
473
- var padding = $('body').data('padding-right');
474
-
475
- if (typeof padding !== 'undefined') {
476
- $('body').css('padding-right', padding).removeData('padding-right');
477
- }
542
+ var padding = $(document.body).data('padding-right');
543
+ $(document.body).removeData('padding-right');
544
+ document.body.style.paddingRight = padding ? padding : '';
478
545
  };
479
546
 
480
547
  _proto._getScrollbarWidth = function _getScrollbarWidth() {
@@ -485,14 +552,14 @@ var Modal = function ($) {
485
552
  var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
486
553
  document.body.removeChild(scrollDiv);
487
554
  return scrollbarWidth;
488
- }; // Static
489
-
555
+ } // Static
556
+ ;
490
557
 
491
558
  Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
492
559
  return this.each(function () {
493
560
  var data = $(this).data(DATA_KEY);
494
561
 
495
- var _config = _extends({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
562
+ var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});
496
563
 
497
564
  if (!data) {
498
565
  data = new Modal(this, _config);
@@ -539,10 +606,10 @@ var Modal = function ($) {
539
606
  var selector = Util.getSelectorFromElement(this);
540
607
 
541
608
  if (selector) {
542
- target = $(selector)[0];
609
+ target = document.querySelector(selector);
543
610
  }
544
611
 
545
- var config = $(target).data(DATA_KEY) ? 'toggle' : _extends({}, $(target).data(), $(this).data());
612
+ var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
546
613
 
547
614
  if (this.tagName === 'A' || this.tagName === 'AREA') {
548
615
  event.preventDefault();
@@ -578,4 +645,5 @@ var Modal = function ($) {
578
645
  };
579
646
 
580
647
  return Modal;
581
- }($);
648
+
649
+ }));
@@ -1,39 +1,95 @@
1
- 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); } }
1
+ /*!
2
+ * Bootstrap popover.js v4.3.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ */
6
+ (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) :
8
+ typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) :
9
+ (global = global || self, global.Popover = factory(global.jQuery, global.Tooltip));
10
+ }(this, function ($, Tooltip) { 'use strict';
11
+
12
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
+ Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip;
14
+
15
+ function _defineProperties(target, props) {
16
+ for (var i = 0; i < props.length; i++) {
17
+ var descriptor = props[i];
18
+ descriptor.enumerable = descriptor.enumerable || false;
19
+ descriptor.configurable = true;
20
+ if ("value" in descriptor) descriptor.writable = true;
21
+ Object.defineProperty(target, descriptor.key, descriptor);
22
+ }
23
+ }
24
+
25
+ function _createClass(Constructor, protoProps, staticProps) {
26
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
+ if (staticProps) _defineProperties(Constructor, staticProps);
28
+ return Constructor;
29
+ }
30
+
31
+ function _defineProperty(obj, key, value) {
32
+ if (key in obj) {
33
+ Object.defineProperty(obj, key, {
34
+ value: value,
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true
38
+ });
39
+ } else {
40
+ obj[key] = value;
41
+ }
2
42
 
3
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
43
+ return obj;
44
+ }
4
45
 
5
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
46
+ function _objectSpread(target) {
47
+ for (var i = 1; i < arguments.length; i++) {
48
+ var source = arguments[i] != null ? arguments[i] : {};
49
+ var ownKeys = Object.keys(source);
6
50
 
7
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
51
+ if (typeof Object.getOwnPropertySymbols === 'function') {
52
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
53
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
54
+ }));
55
+ }
56
+
57
+ ownKeys.forEach(function (key) {
58
+ _defineProperty(target, key, source[key]);
59
+ });
60
+ }
61
+
62
+ return target;
63
+ }
64
+
65
+ function _inheritsLoose(subClass, superClass) {
66
+ subClass.prototype = Object.create(superClass.prototype);
67
+ subClass.prototype.constructor = subClass;
68
+ subClass.__proto__ = superClass;
69
+ }
8
70
 
9
- /**
10
- * --------------------------------------------------------------------------
11
- * Bootstrap (v4.0.0): popover.js
12
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
13
- * --------------------------------------------------------------------------
14
- */
15
- var Popover = function ($) {
16
71
  /**
17
72
  * ------------------------------------------------------------------------
18
73
  * Constants
19
74
  * ------------------------------------------------------------------------
20
75
  */
76
+
21
77
  var NAME = 'popover';
22
- var VERSION = '4.0.0';
78
+ var VERSION = '4.3.1';
23
79
  var DATA_KEY = 'bs.popover';
24
80
  var EVENT_KEY = "." + DATA_KEY;
25
81
  var JQUERY_NO_CONFLICT = $.fn[NAME];
26
82
  var CLASS_PREFIX = 'bs-popover';
27
83
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
28
84
 
29
- var Default = _extends({}, Tooltip.Default, {
85
+ var Default = _objectSpread({}, Tooltip.Default, {
30
86
  placement: 'right',
31
87
  trigger: 'click',
32
88
  content: '',
33
89
  template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
34
90
  });
35
91
 
36
- var DefaultType = _extends({}, Tooltip.DefaultType, {
92
+ var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
37
93
  content: '(string|element|function)'
38
94
  });
39
95
 
@@ -102,8 +158,8 @@ var Popover = function ($) {
102
158
 
103
159
  this.setElementContent($tip.find(Selector.CONTENT), content);
104
160
  $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
105
- }; // Private
106
-
161
+ } // Private
162
+ ;
107
163
 
108
164
  _proto._getContent = function _getContent() {
109
165
  return this.element.getAttribute('data-content') || this.config.content;
@@ -116,8 +172,8 @@ var Popover = function ($) {
116
172
  if (tabClass !== null && tabClass.length > 0) {
117
173
  $tip.removeClass(tabClass.join(''));
118
174
  }
119
- }; // Static
120
-
175
+ } // Static
176
+ ;
121
177
 
122
178
  Popover._jQueryInterface = function _jQueryInterface(config) {
123
179
  return this.each(function () {
@@ -125,7 +181,7 @@ var Popover = function ($) {
125
181
 
126
182
  var _config = typeof config === 'object' ? config : null;
127
183
 
128
- if (!data && /destroy|hide/.test(config)) {
184
+ if (!data && /dispose|hide/.test(config)) {
129
185
  return;
130
186
  }
131
187
 
@@ -200,4 +256,5 @@ var Popover = function ($) {
200
256
  };
201
257
 
202
258
  return Popover;
203
- }($);
259
+
260
+ }));