bootstrap 4.3.1 → 4.6.2

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.

Potentially problematic release.


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

Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -1
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +1 -1
  5. data/assets/javascripts/bootstrap/alert.js +43 -55
  6. data/assets/javascripts/bootstrap/button.js +112 -70
  7. data/assets/javascripts/bootstrap/carousel.js +164 -189
  8. data/assets/javascripts/bootstrap/collapse.js +98 -129
  9. data/assets/javascripts/bootstrap/dropdown.js +165 -200
  10. data/assets/javascripts/bootstrap/modal.js +218 -205
  11. data/assets/javascripts/bootstrap/popover.js +63 -79
  12. data/assets/javascripts/bootstrap/scrollspy.js +82 -119
  13. data/assets/javascripts/bootstrap/tab.js +79 -85
  14. data/assets/javascripts/bootstrap/toast.js +100 -115
  15. data/assets/javascripts/bootstrap/tooltip.js +207 -225
  16. data/assets/javascripts/bootstrap/util.js +41 -23
  17. data/assets/javascripts/bootstrap.js +1235 -1314
  18. data/assets/javascripts/bootstrap.min.js +4 -4
  19. data/assets/stylesheets/_bootstrap-grid.scss +5 -4
  20. data/assets/stylesheets/_bootstrap-reboot.scss +4 -4
  21. data/assets/stylesheets/_bootstrap.scss +4 -4
  22. data/assets/stylesheets/bootstrap/_alert.scss +1 -0
  23. data/assets/stylesheets/bootstrap/_badge.scss +1 -1
  24. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -2
  25. data/assets/stylesheets/bootstrap/_button-group.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_buttons.scss +13 -8
  27. data/assets/stylesheets/bootstrap/_card.scss +47 -50
  28. data/assets/stylesheets/bootstrap/_carousel.scss +12 -9
  29. data/assets/stylesheets/bootstrap/_close.scss +2 -3
  30. data/assets/stylesheets/bootstrap/_code.scss +1 -1
  31. data/assets/stylesheets/bootstrap/_custom-forms.scss +43 -24
  32. data/assets/stylesheets/bootstrap/_dropdown.scss +7 -6
  33. data/assets/stylesheets/bootstrap/_forms.scss +30 -13
  34. data/assets/stylesheets/bootstrap/_functions.scss +110 -6
  35. data/assets/stylesheets/bootstrap/_grid.scss +32 -11
  36. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  37. data/assets/stylesheets/bootstrap/_input-group.scss +23 -5
  38. data/assets/stylesheets/bootstrap/_jumbotron.scss +1 -1
  39. data/assets/stylesheets/bootstrap/_list-group.scss +36 -31
  40. data/assets/stylesheets/bootstrap/_mixins.scss +3 -3
  41. data/assets/stylesheets/bootstrap/_modal.scss +26 -15
  42. data/assets/stylesheets/bootstrap/_nav.scss +12 -7
  43. data/assets/stylesheets/bootstrap/_navbar.scss +55 -17
  44. data/assets/stylesheets/bootstrap/_pagination.scss +5 -4
  45. data/assets/stylesheets/bootstrap/_popover.scss +17 -18
  46. data/assets/stylesheets/bootstrap/_print.scss +1 -10
  47. data/assets/stylesheets/bootstrap/_progress.scss +7 -3
  48. data/assets/stylesheets/bootstrap/_reboot.scss +39 -38
  49. data/assets/stylesheets/bootstrap/_spinners.scss +18 -8
  50. data/assets/stylesheets/bootstrap/_tables.scss +3 -3
  51. data/assets/stylesheets/bootstrap/_toasts.scss +4 -2
  52. data/assets/stylesheets/bootstrap/_tooltip.scss +4 -4
  53. data/assets/stylesheets/bootstrap/_transitions.scss +6 -0
  54. data/assets/stylesheets/bootstrap/_type.scss +3 -3
  55. data/assets/stylesheets/bootstrap/_utilities.scss +2 -1
  56. data/assets/stylesheets/bootstrap/_variables.scss +71 -45
  57. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +5 -3
  58. data/assets/stylesheets/bootstrap/mixins/_badge.scss +1 -1
  59. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +27 -14
  60. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +11 -8
  61. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  62. data/assets/stylesheets/bootstrap/mixins/_float.scss +3 -3
  63. data/assets/stylesheets/bootstrap/mixins/_forms.scss +52 -49
  64. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +31 -17
  65. data/assets/stylesheets/bootstrap/mixins/_grid.scss +32 -14
  66. data/assets/stylesheets/bootstrap/mixins/_hover.scss +4 -4
  67. data/assets/stylesheets/bootstrap/mixins/_image.scss +2 -2
  68. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  69. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  70. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +2 -1
  71. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  72. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +5 -4
  73. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +1 -1
  74. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +3 -2
  75. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  76. data/assets/stylesheets/bootstrap/utilities/_background.scss +2 -2
  77. data/assets/stylesheets/bootstrap/utilities/_borders.scss +1 -1
  78. data/assets/stylesheets/bootstrap/utilities/_embed.scss +1 -1
  79. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +5 -0
  80. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +1 -1
  81. data/assets/stylesheets/bootstrap/utilities/_text.scss +4 -4
  82. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +126 -102
  83. data/bootstrap.gemspec +2 -2
  84. data/lib/bootstrap/version.rb +2 -2
  85. data/tasks/updater/js.rb +18 -6
  86. data/tasks/updater/network.rb +8 -2
  87. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  88. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  89. data/test/gemfiles/rails_6_0.gemfile +7 -0
  90. data/test/support/dummy_rails_integration.rb +3 -1
  91. data/test/test_helper.rb +18 -13
  92. metadata +13 -7
@@ -1,17 +1,19 @@
1
1
  /*!
2
- * Bootstrap tooltip.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)
2
+ * Bootstrap tooltip.js v4.6.2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
9
- (global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
- }(this, function ($, Popper, Util) { 'use strict';
8
+ typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
+ })(this, (function ($, Popper, Util) { 'use strict';
11
11
 
12
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
- Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
14
- Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
+ var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
16
+ var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
15
17
 
16
18
  function _defineProperties(target, props) {
17
19
  for (var i = 0; i < props.length; i++) {
@@ -26,47 +28,33 @@
26
28
  function _createClass(Constructor, protoProps, staticProps) {
27
29
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
30
  if (staticProps) _defineProperties(Constructor, staticProps);
31
+ Object.defineProperty(Constructor, "prototype", {
32
+ writable: false
33
+ });
29
34
  return Constructor;
30
35
  }
31
36
 
32
- function _defineProperty(obj, key, value) {
33
- if (key in obj) {
34
- Object.defineProperty(obj, key, {
35
- value: value,
36
- enumerable: true,
37
- configurable: true,
38
- writable: true
39
- });
40
- } else {
41
- obj[key] = value;
42
- }
43
-
44
- return obj;
45
- }
46
-
47
- function _objectSpread(target) {
48
- for (var i = 1; i < arguments.length; i++) {
49
- var source = arguments[i] != null ? arguments[i] : {};
50
- var ownKeys = Object.keys(source);
37
+ function _extends() {
38
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
39
+ for (var i = 1; i < arguments.length; i++) {
40
+ var source = arguments[i];
51
41
 
52
- if (typeof Object.getOwnPropertySymbols === 'function') {
53
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
54
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
55
- }));
42
+ for (var key in source) {
43
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
44
+ target[key] = source[key];
45
+ }
46
+ }
56
47
  }
57
48
 
58
- ownKeys.forEach(function (key) {
59
- _defineProperty(target, key, source[key]);
60
- });
61
- }
62
-
63
- return target;
49
+ return target;
50
+ };
51
+ return _extends.apply(this, arguments);
64
52
  }
65
53
 
66
54
  /**
67
55
  * --------------------------------------------------------------------------
68
- * Bootstrap (v4.3.1): tools/sanitizer.js
69
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
56
+ * Bootstrap (v4.6.2): tools/sanitizer.js
57
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
70
58
  * --------------------------------------------------------------------------
71
59
  */
72
60
  var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
@@ -90,7 +78,7 @@
90
78
  h5: [],
91
79
  h6: [],
92
80
  i: [],
93
- img: ['src', 'alt', 'title', 'width', 'height'],
81
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
94
82
  li: [],
95
83
  ol: [],
96
84
  p: [],
@@ -103,28 +91,28 @@
103
91
  strong: [],
104
92
  u: [],
105
93
  ul: []
106
- /**
107
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
108
- *
109
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
110
- */
111
-
112
94
  };
113
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
95
+ /**
96
+ * A pattern that recognizes a commonly useful subset of URLs that are safe.
97
+ *
98
+ * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
99
+ */
100
+
101
+ var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
114
102
  /**
115
103
  * A pattern that matches safe data URLs. Only matches image, video and audio types.
116
104
  *
117
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
105
+ * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
118
106
  */
119
107
 
120
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
108
+ var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
121
109
 
122
110
  function allowedAttribute(attr, allowedAttributeList) {
123
111
  var attrName = attr.nodeName.toLowerCase();
124
112
 
125
113
  if (allowedAttributeList.indexOf(attrName) !== -1) {
126
114
  if (uriAttrs.indexOf(attrName) !== -1) {
127
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
115
+ return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
128
116
  }
129
117
 
130
118
  return true;
@@ -134,8 +122,8 @@
134
122
  return attrRegex instanceof RegExp;
135
123
  }); // Check if a regular expression validates the attribute.
136
124
 
137
- for (var i = 0, l = regExp.length; i < l; i++) {
138
- if (attrName.match(regExp[i])) {
125
+ for (var i = 0, len = regExp.length; i < len; i++) {
126
+ if (regExp[i].test(attrName)) {
139
127
  return true;
140
128
  }
141
129
  }
@@ -166,7 +154,8 @@
166
154
  return "continue";
167
155
  }
168
156
 
169
- var attributeList = [].slice.call(el.attributes);
157
+ var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread
158
+
170
159
  var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
171
160
  attributeList.forEach(function (attr) {
172
161
  if (!allowedAttribute(attr, whitelistedAttributes)) {
@@ -176,7 +165,7 @@
176
165
  };
177
166
 
178
167
  for (var i = 0, len = elements.length; i < len; i++) {
179
- var _ret = _loop(i, len);
168
+ var _ret = _loop(i);
180
169
 
181
170
  if (_ret === "continue") continue;
182
171
  }
@@ -185,36 +174,27 @@
185
174
  }
186
175
 
187
176
  /**
188
- * ------------------------------------------------------------------------
189
177
  * Constants
190
- * ------------------------------------------------------------------------
191
178
  */
192
179
 
193
180
  var NAME = 'tooltip';
194
- var VERSION = '4.3.1';
181
+ var VERSION = '4.6.2';
195
182
  var DATA_KEY = 'bs.tooltip';
196
183
  var EVENT_KEY = "." + DATA_KEY;
197
- var JQUERY_NO_CONFLICT = $.fn[NAME];
184
+ var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
198
185
  var CLASS_PREFIX = 'bs-tooltip';
199
186
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
200
187
  var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
201
- var DefaultType = {
202
- animation: 'boolean',
203
- template: 'string',
204
- title: '(string|element|function)',
205
- trigger: 'string',
206
- delay: '(number|object)',
207
- html: 'boolean',
208
- selector: '(string|boolean)',
209
- placement: '(string|function)',
210
- offset: '(number|string|function)',
211
- container: '(string|element|boolean)',
212
- fallbackPlacement: '(string|array)',
213
- boundary: '(string|element)',
214
- sanitize: 'boolean',
215
- sanitizeFn: '(null|function)',
216
- whiteList: 'object'
217
- };
188
+ var CLASS_NAME_FADE = 'fade';
189
+ var CLASS_NAME_SHOW = 'show';
190
+ var HOVER_STATE_SHOW = 'show';
191
+ var HOVER_STATE_OUT = 'out';
192
+ var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
193
+ var SELECTOR_ARROW = '.arrow';
194
+ var TRIGGER_HOVER = 'hover';
195
+ var TRIGGER_FOCUS = 'focus';
196
+ var TRIGGER_CLICK = 'click';
197
+ var TRIGGER_MANUAL = 'manual';
218
198
  var AttachmentMap = {
219
199
  AUTO: 'auto',
220
200
  TOP: 'top',
@@ -235,13 +215,30 @@
235
215
  container: false,
236
216
  fallbackPlacement: 'flip',
237
217
  boundary: 'scrollParent',
218
+ customClass: '',
238
219
  sanitize: true,
239
220
  sanitizeFn: null,
240
- whiteList: DefaultWhitelist
221
+ whiteList: DefaultWhitelist,
222
+ popperConfig: null
241
223
  };
242
- var HoverState = {
243
- SHOW: 'show',
244
- OUT: 'out'
224
+ var DefaultType = {
225
+ animation: 'boolean',
226
+ template: 'string',
227
+ title: '(string|element|function)',
228
+ trigger: 'string',
229
+ delay: '(number|object)',
230
+ html: 'boolean',
231
+ selector: '(string|boolean)',
232
+ placement: '(string|function)',
233
+ offset: '(number|string|function)',
234
+ container: '(string|element|boolean)',
235
+ fallbackPlacement: '(string|array)',
236
+ boundary: '(string|element)',
237
+ customClass: '(string|function)',
238
+ sanitize: 'boolean',
239
+ sanitizeFn: '(null|function)',
240
+ whiteList: 'object',
241
+ popperConfig: '(null|object)'
245
242
  };
246
243
  var Event = {
247
244
  HIDE: "hide" + EVENT_KEY,
@@ -255,39 +252,15 @@
255
252
  MOUSEENTER: "mouseenter" + EVENT_KEY,
256
253
  MOUSELEAVE: "mouseleave" + EVENT_KEY
257
254
  };
258
- var ClassName = {
259
- FADE: 'fade',
260
- SHOW: 'show'
261
- };
262
- var Selector = {
263
- TOOLTIP: '.tooltip',
264
- TOOLTIP_INNER: '.tooltip-inner',
265
- ARROW: '.arrow'
266
- };
267
- var Trigger = {
268
- HOVER: 'hover',
269
- FOCUS: 'focus',
270
- CLICK: 'click',
271
- MANUAL: 'manual'
272
- /**
273
- * ------------------------------------------------------------------------
274
- * Class Definition
275
- * ------------------------------------------------------------------------
276
- */
277
-
278
- };
255
+ /**
256
+ * Class definition
257
+ */
279
258
 
280
- var Tooltip =
281
- /*#__PURE__*/
282
- function () {
259
+ var Tooltip = /*#__PURE__*/function () {
283
260
  function Tooltip(element, config) {
284
- /**
285
- * Check for Popper dependency
286
- * Popper - https://popper.js.org
287
- */
288
- if (typeof Popper === 'undefined') {
289
- throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
290
- } // private
261
+ if (typeof Popper__default["default"] === 'undefined') {
262
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
263
+ } // Private
291
264
 
292
265
 
293
266
  this._isEnabled = true;
@@ -326,11 +299,11 @@
326
299
 
327
300
  if (event) {
328
301
  var dataKey = this.constructor.DATA_KEY;
329
- var context = $(event.currentTarget).data(dataKey);
302
+ var context = $__default["default"](event.currentTarget).data(dataKey);
330
303
 
331
304
  if (!context) {
332
305
  context = new this.constructor(event.currentTarget, this._getDelegateConfig());
333
- $(event.currentTarget).data(dataKey, context);
306
+ $__default["default"](event.currentTarget).data(dataKey, context);
334
307
  }
335
308
 
336
309
  context._activeTrigger.click = !context._activeTrigger.click;
@@ -341,7 +314,7 @@
341
314
  context._leave(null, context);
342
315
  }
343
316
  } else {
344
- if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
317
+ if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
345
318
  this._leave(null, this);
346
319
 
347
320
  return;
@@ -353,12 +326,12 @@
353
326
 
354
327
  _proto.dispose = function dispose() {
355
328
  clearTimeout(this._timeout);
356
- $.removeData(this.element, this.constructor.DATA_KEY);
357
- $(this.element).off(this.constructor.EVENT_KEY);
358
- $(this.element).closest('.modal').off('hide.bs.modal');
329
+ $__default["default"].removeData(this.element, this.constructor.DATA_KEY);
330
+ $__default["default"](this.element).off(this.constructor.EVENT_KEY);
331
+ $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
359
332
 
360
333
  if (this.tip) {
361
- $(this.tip).remove();
334
+ $__default["default"](this.tip).remove();
362
335
  }
363
336
 
364
337
  this._isEnabled = null;
@@ -366,7 +339,7 @@
366
339
  this._hoverState = null;
367
340
  this._activeTrigger = null;
368
341
 
369
- if (this._popper !== null) {
342
+ if (this._popper) {
370
343
  this._popper.destroy();
371
344
  }
372
345
 
@@ -379,29 +352,29 @@
379
352
  _proto.show = function show() {
380
353
  var _this = this;
381
354
 
382
- if ($(this.element).css('display') === 'none') {
355
+ if ($__default["default"](this.element).css('display') === 'none') {
383
356
  throw new Error('Please use show on visible elements');
384
357
  }
385
358
 
386
- var showEvent = $.Event(this.constructor.Event.SHOW);
359
+ var showEvent = $__default["default"].Event(this.constructor.Event.SHOW);
387
360
 
388
361
  if (this.isWithContent() && this._isEnabled) {
389
- $(this.element).trigger(showEvent);
390
- var shadowRoot = Util.findShadowRoot(this.element);
391
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
362
+ $__default["default"](this.element).trigger(showEvent);
363
+ var shadowRoot = Util__default["default"].findShadowRoot(this.element);
364
+ var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
392
365
 
393
366
  if (showEvent.isDefaultPrevented() || !isInTheDom) {
394
367
  return;
395
368
  }
396
369
 
397
370
  var tip = this.getTipElement();
398
- var tipId = Util.getUID(this.constructor.NAME);
371
+ var tipId = Util__default["default"].getUID(this.constructor.NAME);
399
372
  tip.setAttribute('id', tipId);
400
373
  this.element.setAttribute('aria-describedby', tipId);
401
374
  this.setContent();
402
375
 
403
376
  if (this.config.animation) {
404
- $(tip).addClass(ClassName.FADE);
377
+ $__default["default"](tip).addClass(CLASS_NAME_FADE);
405
378
  }
406
379
 
407
380
  var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
@@ -412,43 +385,22 @@
412
385
 
413
386
  var container = this._getContainer();
414
387
 
415
- $(tip).data(this.constructor.DATA_KEY, this);
388
+ $__default["default"](tip).data(this.constructor.DATA_KEY, this);
416
389
 
417
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
418
- $(tip).appendTo(container);
390
+ if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) {
391
+ $__default["default"](tip).appendTo(container);
419
392
  }
420
393
 
421
- $(this.element).trigger(this.constructor.Event.INSERTED);
422
- this._popper = new Popper(this.element, tip, {
423
- placement: attachment,
424
- modifiers: {
425
- offset: this._getOffset(),
426
- flip: {
427
- behavior: this.config.fallbackPlacement
428
- },
429
- arrow: {
430
- element: Selector.ARROW
431
- },
432
- preventOverflow: {
433
- boundariesElement: this.config.boundary
434
- }
435
- },
436
- onCreate: function onCreate(data) {
437
- if (data.originalPlacement !== data.placement) {
438
- _this._handlePopperPlacementChange(data);
439
- }
440
- },
441
- onUpdate: function onUpdate(data) {
442
- return _this._handlePopperPlacementChange(data);
443
- }
444
- });
445
- $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
394
+ $__default["default"](this.element).trigger(this.constructor.Event.INSERTED);
395
+ this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment));
396
+ $__default["default"](tip).addClass(CLASS_NAME_SHOW);
397
+ $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra
446
398
  // empty mouseover listeners to the body's immediate children;
447
399
  // only needed because of broken event delegation on iOS
448
400
  // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
449
401
 
450
402
  if ('ontouchstart' in document.documentElement) {
451
- $(document.body).children().on('mouseover', null, $.noop);
403
+ $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);
452
404
  }
453
405
 
454
406
  var complete = function complete() {
@@ -458,16 +410,16 @@
458
410
 
459
411
  var prevHoverState = _this._hoverState;
460
412
  _this._hoverState = null;
461
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
413
+ $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN);
462
414
 
463
- if (prevHoverState === HoverState.OUT) {
415
+ if (prevHoverState === HOVER_STATE_OUT) {
464
416
  _this._leave(null, _this);
465
417
  }
466
418
  };
467
419
 
468
- if ($(this.tip).hasClass(ClassName.FADE)) {
469
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
470
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
420
+ if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
421
+ var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this.tip);
422
+ $__default["default"](this.tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
471
423
  } else {
472
424
  complete();
473
425
  }
@@ -478,10 +430,10 @@
478
430
  var _this2 = this;
479
431
 
480
432
  var tip = this.getTipElement();
481
- var hideEvent = $.Event(this.constructor.Event.HIDE);
433
+ var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE);
482
434
 
483
435
  var complete = function complete() {
484
- if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
436
+ if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
485
437
  tip.parentNode.removeChild(tip);
486
438
  }
487
439
 
@@ -489,7 +441,7 @@
489
441
 
490
442
  _this2.element.removeAttribute('aria-describedby');
491
443
 
492
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
444
+ $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
493
445
 
494
446
  if (_this2._popper !== null) {
495
447
  _this2._popper.destroy();
@@ -500,26 +452,26 @@
500
452
  }
501
453
  };
502
454
 
503
- $(this.element).trigger(hideEvent);
455
+ $__default["default"](this.element).trigger(hideEvent);
504
456
 
505
457
  if (hideEvent.isDefaultPrevented()) {
506
458
  return;
507
459
  }
508
460
 
509
- $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
461
+ $__default["default"](tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
510
462
  // empty mouseover listeners we added for iOS support
511
463
 
512
464
  if ('ontouchstart' in document.documentElement) {
513
- $(document.body).children().off('mouseover', null, $.noop);
465
+ $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);
514
466
  }
515
467
 
516
- this._activeTrigger[Trigger.CLICK] = false;
517
- this._activeTrigger[Trigger.FOCUS] = false;
518
- this._activeTrigger[Trigger.HOVER] = false;
468
+ this._activeTrigger[TRIGGER_CLICK] = false;
469
+ this._activeTrigger[TRIGGER_FOCUS] = false;
470
+ this._activeTrigger[TRIGGER_HOVER] = false;
519
471
 
520
- if ($(this.tip).hasClass(ClassName.FADE)) {
521
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
522
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
472
+ if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
473
+ var transitionDuration = Util__default["default"].getTransitionDurationFromElement(tip);
474
+ $__default["default"](tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
523
475
  } else {
524
476
  complete();
525
477
  }
@@ -539,29 +491,29 @@
539
491
  };
540
492
 
541
493
  _proto.addAttachmentClass = function addAttachmentClass(attachment) {
542
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
494
+ $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
543
495
  };
544
496
 
545
497
  _proto.getTipElement = function getTipElement() {
546
- this.tip = this.tip || $(this.config.template)[0];
498
+ this.tip = this.tip || $__default["default"](this.config.template)[0];
547
499
  return this.tip;
548
500
  };
549
501
 
550
502
  _proto.setContent = function setContent() {
551
503
  var tip = this.getTipElement();
552
- this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
553
- $(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
504
+ this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
505
+ $__default["default"](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
554
506
  };
555
507
 
556
508
  _proto.setElementContent = function setElementContent($element, content) {
557
509
  if (typeof content === 'object' && (content.nodeType || content.jquery)) {
558
510
  // Content is a DOM node or a jQuery
559
511
  if (this.config.html) {
560
- if (!$(content).parent().is($element)) {
512
+ if (!$__default["default"](content).parent().is($element)) {
561
513
  $element.empty().append(content);
562
514
  }
563
515
  } else {
564
- $element.text($(content).text());
516
+ $element.text($__default["default"](content).text());
565
517
  }
566
518
 
567
519
  return;
@@ -589,14 +541,43 @@
589
541
  } // Private
590
542
  ;
591
543
 
592
- _proto._getOffset = function _getOffset() {
544
+ _proto._getPopperConfig = function _getPopperConfig(attachment) {
593
545
  var _this3 = this;
594
546
 
547
+ var defaultBsConfig = {
548
+ placement: attachment,
549
+ modifiers: {
550
+ offset: this._getOffset(),
551
+ flip: {
552
+ behavior: this.config.fallbackPlacement
553
+ },
554
+ arrow: {
555
+ element: SELECTOR_ARROW
556
+ },
557
+ preventOverflow: {
558
+ boundariesElement: this.config.boundary
559
+ }
560
+ },
561
+ onCreate: function onCreate(data) {
562
+ if (data.originalPlacement !== data.placement) {
563
+ _this3._handlePopperPlacementChange(data);
564
+ }
565
+ },
566
+ onUpdate: function onUpdate(data) {
567
+ return _this3._handlePopperPlacementChange(data);
568
+ }
569
+ };
570
+ return _extends({}, defaultBsConfig, this.config.popperConfig);
571
+ };
572
+
573
+ _proto._getOffset = function _getOffset() {
574
+ var _this4 = this;
575
+
595
576
  var offset = {};
596
577
 
597
578
  if (typeof this.config.offset === 'function') {
598
579
  offset.fn = function (data) {
599
- data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
580
+ data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element));
600
581
  return data;
601
582
  };
602
583
  } else {
@@ -611,11 +592,11 @@
611
592
  return document.body;
612
593
  }
613
594
 
614
- if (Util.isElement(this.config.container)) {
615
- return $(this.config.container);
595
+ if (Util__default["default"].isElement(this.config.container)) {
596
+ return $__default["default"](this.config.container);
616
597
  }
617
598
 
618
- return $(document).find(this.config.container);
599
+ return $__default["default"](document).find(this.config.container);
619
600
  };
620
601
 
621
602
  _proto._getAttachment = function _getAttachment(placement) {
@@ -623,32 +604,35 @@
623
604
  };
624
605
 
625
606
  _proto._setListeners = function _setListeners() {
626
- var _this4 = this;
607
+ var _this5 = this;
627
608
 
628
609
  var triggers = this.config.trigger.split(' ');
629
610
  triggers.forEach(function (trigger) {
630
611
  if (trigger === 'click') {
631
- $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
632
- return _this4.toggle(event);
612
+ $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
613
+ return _this5.toggle(event);
633
614
  });
634
- } else if (trigger !== Trigger.MANUAL) {
635
- var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
636
- var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
637
- $(_this4.element).on(eventIn, _this4.config.selector, function (event) {
638
- return _this4._enter(event);
639
- }).on(eventOut, _this4.config.selector, function (event) {
640
- return _this4._leave(event);
615
+ } else if (trigger !== TRIGGER_MANUAL) {
616
+ var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
617
+ var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
618
+ $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) {
619
+ return _this5._enter(event);
620
+ }).on(eventOut, _this5.config.selector, function (event) {
621
+ return _this5._leave(event);
641
622
  });
642
623
  }
643
624
  });
644
- $(this.element).closest('.modal').on('hide.bs.modal', function () {
645
- if (_this4.element) {
646
- _this4.hide();
625
+
626
+ this._hideModalHandler = function () {
627
+ if (_this5.element) {
628
+ _this5.hide();
647
629
  }
648
- });
630
+ };
631
+
632
+ $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
649
633
 
650
634
  if (this.config.selector) {
651
- this.config = _objectSpread({}, this.config, {
635
+ this.config = _extends({}, this.config, {
652
636
  trigger: 'manual',
653
637
  selector: ''
654
638
  });
@@ -668,24 +652,24 @@
668
652
 
669
653
  _proto._enter = function _enter(event, context) {
670
654
  var dataKey = this.constructor.DATA_KEY;
671
- context = context || $(event.currentTarget).data(dataKey);
655
+ context = context || $__default["default"](event.currentTarget).data(dataKey);
672
656
 
673
657
  if (!context) {
674
658
  context = new this.constructor(event.currentTarget, this._getDelegateConfig());
675
- $(event.currentTarget).data(dataKey, context);
659
+ $__default["default"](event.currentTarget).data(dataKey, context);
676
660
  }
677
661
 
678
662
  if (event) {
679
- context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
663
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
680
664
  }
681
665
 
682
- if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
683
- context._hoverState = HoverState.SHOW;
666
+ if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
667
+ context._hoverState = HOVER_STATE_SHOW;
684
668
  return;
685
669
  }
686
670
 
687
671
  clearTimeout(context._timeout);
688
- context._hoverState = HoverState.SHOW;
672
+ context._hoverState = HOVER_STATE_SHOW;
689
673
 
690
674
  if (!context.config.delay || !context.config.delay.show) {
691
675
  context.show();
@@ -693,7 +677,7 @@
693
677
  }
694
678
 
695
679
  context._timeout = setTimeout(function () {
696
- if (context._hoverState === HoverState.SHOW) {
680
+ if (context._hoverState === HOVER_STATE_SHOW) {
697
681
  context.show();
698
682
  }
699
683
  }, context.config.delay.show);
@@ -701,15 +685,15 @@
701
685
 
702
686
  _proto._leave = function _leave(event, context) {
703
687
  var dataKey = this.constructor.DATA_KEY;
704
- context = context || $(event.currentTarget).data(dataKey);
688
+ context = context || $__default["default"](event.currentTarget).data(dataKey);
705
689
 
706
690
  if (!context) {
707
691
  context = new this.constructor(event.currentTarget, this._getDelegateConfig());
708
- $(event.currentTarget).data(dataKey, context);
692
+ $__default["default"](event.currentTarget).data(dataKey, context);
709
693
  }
710
694
 
711
695
  if (event) {
712
- context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
696
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
713
697
  }
714
698
 
715
699
  if (context._isWithActiveTrigger()) {
@@ -717,7 +701,7 @@
717
701
  }
718
702
 
719
703
  clearTimeout(context._timeout);
720
- context._hoverState = HoverState.OUT;
704
+ context._hoverState = HOVER_STATE_OUT;
721
705
 
722
706
  if (!context.config.delay || !context.config.delay.hide) {
723
707
  context.hide();
@@ -725,7 +709,7 @@
725
709
  }
726
710
 
727
711
  context._timeout = setTimeout(function () {
728
- if (context._hoverState === HoverState.OUT) {
712
+ if (context._hoverState === HOVER_STATE_OUT) {
729
713
  context.hide();
730
714
  }
731
715
  }, context.config.delay.hide);
@@ -742,13 +726,13 @@
742
726
  };
743
727
 
744
728
  _proto._getConfig = function _getConfig(config) {
745
- var dataAttributes = $(this.element).data();
729
+ var dataAttributes = $__default["default"](this.element).data();
746
730
  Object.keys(dataAttributes).forEach(function (dataAttr) {
747
731
  if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
748
732
  delete dataAttributes[dataAttr];
749
733
  }
750
734
  });
751
- config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
735
+ config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
752
736
 
753
737
  if (typeof config.delay === 'number') {
754
738
  config.delay = {
@@ -765,7 +749,7 @@
765
749
  config.content = config.content.toString();
766
750
  }
767
751
 
768
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
752
+ Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
769
753
 
770
754
  if (config.sanitize) {
771
755
  config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
@@ -789,7 +773,7 @@
789
773
  };
790
774
 
791
775
  _proto._cleanTipClass = function _cleanTipClass() {
792
- var $tip = $(this.getTipElement());
776
+ var $tip = $__default["default"](this.getTipElement());
793
777
  var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
794
778
 
795
779
  if (tabClass !== null && tabClass.length) {
@@ -798,8 +782,7 @@
798
782
  };
799
783
 
800
784
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
801
- var popperInstance = popperData.instance;
802
- this.tip = popperInstance.popper;
785
+ this.tip = popperData.instance.popper;
803
786
 
804
787
  this._cleanTipClass();
805
788
 
@@ -814,7 +797,7 @@
814
797
  return;
815
798
  }
816
799
 
817
- $(tip).removeClass(ClassName.FADE);
800
+ $__default["default"](tip).removeClass(CLASS_NAME_FADE);
818
801
  this.config.animation = false;
819
802
  this.hide();
820
803
  this.show();
@@ -824,7 +807,8 @@
824
807
 
825
808
  Tooltip._jQueryInterface = function _jQueryInterface(config) {
826
809
  return this.each(function () {
827
- var data = $(this).data(DATA_KEY);
810
+ var $element = $__default["default"](this);
811
+ var data = $element.data(DATA_KEY);
828
812
 
829
813
  var _config = typeof config === 'object' && config;
830
814
 
@@ -834,7 +818,7 @@
834
818
 
835
819
  if (!data) {
836
820
  data = new Tooltip(this, _config);
837
- $(this).data(DATA_KEY, data);
821
+ $element.data(DATA_KEY, data);
838
822
  }
839
823
 
840
824
  if (typeof config === 'string') {
@@ -887,17 +871,15 @@
887
871
  return Tooltip;
888
872
  }();
889
873
  /**
890
- * ------------------------------------------------------------------------
891
874
  * jQuery
892
- * ------------------------------------------------------------------------
893
875
  */
894
876
 
895
877
 
896
- $.fn[NAME] = Tooltip._jQueryInterface;
897
- $.fn[NAME].Constructor = Tooltip;
878
+ $__default["default"].fn[NAME] = Tooltip._jQueryInterface;
879
+ $__default["default"].fn[NAME].Constructor = Tooltip;
898
880
 
899
- $.fn[NAME].noConflict = function () {
900
- $.fn[NAME] = JQUERY_NO_CONFLICT;
881
+ $__default["default"].fn[NAME].noConflict = function () {
882
+ $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
901
883
  return Tooltip._jQueryInterface;
902
884
  };
903
885