bootstrap 4.3.0 → 4.5.3

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 (89) 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-sprockets.js +7 -7
  6. data/assets/javascripts/bootstrap.js +1186 -1056
  7. data/assets/javascripts/bootstrap.min.js +4 -4
  8. data/assets/javascripts/bootstrap/alert.js +45 -65
  9. data/assets/javascripts/bootstrap/button.js +114 -80
  10. data/assets/javascripts/bootstrap/carousel.js +131 -186
  11. data/assets/javascripts/bootstrap/collapse.js +86 -140
  12. data/assets/javascripts/bootstrap/dropdown.js +152 -207
  13. data/assets/javascripts/bootstrap/modal.js +204 -214
  14. data/assets/javascripts/bootstrap/popover.js +41 -95
  15. data/assets/javascripts/bootstrap/scrollspy.js +69 -127
  16. data/assets/javascripts/bootstrap/tab.js +75 -95
  17. data/assets/javascripts/bootstrap/toast.js +87 -127
  18. data/assets/javascripts/bootstrap/tooltip.js +298 -198
  19. data/assets/javascripts/bootstrap/util.js +41 -20
  20. data/assets/stylesheets/_bootstrap-grid.scss +4 -4
  21. data/assets/stylesheets/_bootstrap-reboot.scss +4 -4
  22. data/assets/stylesheets/_bootstrap.scss +4 -4
  23. data/assets/stylesheets/bootstrap/_alert.scss +1 -0
  24. data/assets/stylesheets/bootstrap/_badge.scss +1 -1
  25. data/assets/stylesheets/bootstrap/_breadcrumb.scss +4 -1
  26. data/assets/stylesheets/bootstrap/_button-group.scss +1 -1
  27. data/assets/stylesheets/bootstrap/_buttons.scss +13 -8
  28. data/assets/stylesheets/bootstrap/_card.scss +42 -45
  29. data/assets/stylesheets/bootstrap/_carousel.scss +6 -6
  30. data/assets/stylesheets/bootstrap/_close.scss +2 -3
  31. data/assets/stylesheets/bootstrap/_code.scss +1 -1
  32. data/assets/stylesheets/bootstrap/_custom-forms.scss +34 -17
  33. data/assets/stylesheets/bootstrap/_dropdown.scss +6 -5
  34. data/assets/stylesheets/bootstrap/_forms.scss +26 -9
  35. data/assets/stylesheets/bootstrap/_functions.scss +63 -5
  36. data/assets/stylesheets/bootstrap/_grid.scss +32 -11
  37. data/assets/stylesheets/bootstrap/_images.scss +2 -2
  38. data/assets/stylesheets/bootstrap/_input-group.scss +1 -2
  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 +6 -3
  43. data/assets/stylesheets/bootstrap/_navbar.scss +45 -15
  44. data/assets/stylesheets/bootstrap/_pagination.scss +3 -2
  45. data/assets/stylesheets/bootstrap/_popover.scss +8 -9
  46. data/assets/stylesheets/bootstrap/_print.scss +2 -2
  47. data/assets/stylesheets/bootstrap/_progress.scss +6 -2
  48. data/assets/stylesheets/bootstrap/_reboot.scss +32 -31
  49. data/assets/stylesheets/bootstrap/_root.scss +1 -0
  50. data/assets/stylesheets/bootstrap/_spinners.scss +3 -2
  51. data/assets/stylesheets/bootstrap/_tables.scss +3 -3
  52. data/assets/stylesheets/bootstrap/_toasts.scss +4 -2
  53. data/assets/stylesheets/bootstrap/_type.scss +2 -2
  54. data/assets/stylesheets/bootstrap/_utilities.scss +2 -1
  55. data/assets/stylesheets/bootstrap/_variables.scss +51 -32
  56. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +5 -3
  57. data/assets/stylesheets/bootstrap/mixins/_badge.scss +1 -1
  58. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +27 -14
  59. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +11 -8
  60. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  61. data/assets/stylesheets/bootstrap/mixins/_float.scss +3 -3
  62. data/assets/stylesheets/bootstrap/mixins/_forms.scss +35 -49
  63. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +29 -15
  64. data/assets/stylesheets/bootstrap/mixins/_grid.scss +25 -7
  65. data/assets/stylesheets/bootstrap/mixins/_hover.scss +4 -4
  66. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -1
  67. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  68. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  69. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +2 -1
  70. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  71. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +4 -3
  72. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +1 -1
  73. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +3 -2
  74. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  75. data/assets/stylesheets/bootstrap/utilities/_background.scss +2 -2
  76. data/assets/stylesheets/bootstrap/utilities/_borders.scss +1 -1
  77. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +5 -0
  78. data/assets/stylesheets/bootstrap/utilities/_text.scss +4 -4
  79. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +0 -8
  80. data/bootstrap.gemspec +1 -1
  81. data/lib/bootstrap/version.rb +2 -2
  82. data/tasks/updater/js.rb +1 -1
  83. data/tasks/updater/network.rb +2 -2
  84. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  85. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  86. data/test/gemfiles/rails_6_0.gemfile +7 -0
  87. data/test/support/dummy_rails_integration.rb +3 -1
  88. data/test/test_helper.rb +18 -13
  89. metadata +11 -5
@@ -1,68 +1,146 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v4.3.0 (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.5.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2020 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
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';
11
-
12
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
- Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
14
- Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
15
-
16
- function _defineProperties(target, props) {
17
- for (var i = 0; i < props.length; i++) {
18
- var descriptor = props[i];
19
- descriptor.enumerable = descriptor.enumerable || false;
20
- descriptor.configurable = true;
21
- if ("value" in descriptor) descriptor.writable = true;
22
- Object.defineProperty(target, descriptor.key, descriptor);
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
+
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);
17
+
18
+ /**
19
+ * --------------------------------------------------------------------------
20
+ * Bootstrap (v4.5.3): tools/sanitizer.js
21
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
+ * --------------------------------------------------------------------------
23
+ */
24
+ var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
25
+ var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
26
+ var DefaultWhitelist = {
27
+ // Global attributes allowed on any supplied element below.
28
+ '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
29
+ a: ['target', 'href', 'title', 'rel'],
30
+ area: [],
31
+ b: [],
32
+ br: [],
33
+ col: [],
34
+ code: [],
35
+ div: [],
36
+ em: [],
37
+ hr: [],
38
+ h1: [],
39
+ h2: [],
40
+ h3: [],
41
+ h4: [],
42
+ h5: [],
43
+ h6: [],
44
+ i: [],
45
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
46
+ li: [],
47
+ ol: [],
48
+ p: [],
49
+ pre: [],
50
+ s: [],
51
+ small: [],
52
+ span: [],
53
+ sub: [],
54
+ sup: [],
55
+ strong: [],
56
+ u: [],
57
+ ul: []
58
+ };
59
+ /**
60
+ * A pattern that recognizes a commonly useful subset of URLs that are safe.
61
+ *
62
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
63
+ */
64
+
65
+ var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
66
+ /**
67
+ * A pattern that matches safe data URLs. Only matches image, video and audio types.
68
+ *
69
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
70
+ */
71
+
72
+ 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;
73
+
74
+ function allowedAttribute(attr, allowedAttributeList) {
75
+ var attrName = attr.nodeName.toLowerCase();
76
+
77
+ if (allowedAttributeList.indexOf(attrName) !== -1) {
78
+ if (uriAttrs.indexOf(attrName) !== -1) {
79
+ return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
80
+ }
81
+
82
+ return true;
23
83
  }
24
- }
25
84
 
26
- function _createClass(Constructor, protoProps, staticProps) {
27
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
- if (staticProps) _defineProperties(Constructor, staticProps);
29
- return Constructor;
30
- }
85
+ var regExp = allowedAttributeList.filter(function (attrRegex) {
86
+ return attrRegex instanceof RegExp;
87
+ }); // Check if a regular expression validates the attribute.
31
88
 
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;
89
+ for (var i = 0, len = regExp.length; i < len; i++) {
90
+ if (attrName.match(regExp[i])) {
91
+ return true;
92
+ }
42
93
  }
43
94
 
44
- return obj;
95
+ return false;
45
96
  }
46
97
 
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);
98
+ function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
99
+ if (unsafeHtml.length === 0) {
100
+ return unsafeHtml;
101
+ }
102
+
103
+ if (sanitizeFn && typeof sanitizeFn === 'function') {
104
+ return sanitizeFn(unsafeHtml);
105
+ }
106
+
107
+ var domParser = new window.DOMParser();
108
+ var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
109
+ var whitelistKeys = Object.keys(whiteList);
110
+ var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
51
111
 
52
- if (typeof Object.getOwnPropertySymbols === 'function') {
53
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
54
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
55
- }));
112
+ var _loop = function _loop(i, len) {
113
+ var el = elements[i];
114
+ var elName = el.nodeName.toLowerCase();
115
+
116
+ if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
117
+ el.parentNode.removeChild(el);
118
+ return "continue";
56
119
  }
57
120
 
58
- ownKeys.forEach(function (key) {
59
- _defineProperty(target, key, source[key]);
121
+ var attributeList = [].slice.call(el.attributes);
122
+ var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
123
+ attributeList.forEach(function (attr) {
124
+ if (!allowedAttribute(attr, whitelistedAttributes)) {
125
+ el.removeAttribute(attr.nodeName);
126
+ }
60
127
  });
128
+ };
129
+
130
+ for (var i = 0, len = elements.length; i < len; i++) {
131
+ var _ret = _loop(i);
132
+
133
+ if (_ret === "continue") continue;
61
134
  }
62
135
 
63
- return target;
136
+ return createdDocument.body.innerHTML;
64
137
  }
65
138
 
139
+ 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); }
140
+
141
+ 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); } }
142
+
143
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
66
144
  /**
67
145
  * ------------------------------------------------------------------------
68
146
  * Constants
@@ -70,12 +148,13 @@
70
148
  */
71
149
 
72
150
  var NAME = 'tooltip';
73
- var VERSION = '4.3.0';
151
+ var VERSION = '4.5.3';
74
152
  var DATA_KEY = 'bs.tooltip';
75
153
  var EVENT_KEY = "." + DATA_KEY;
76
- var JQUERY_NO_CONFLICT = $.fn[NAME];
154
+ var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
77
155
  var CLASS_PREFIX = 'bs-tooltip';
78
156
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
157
+ var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
79
158
  var DefaultType = {
80
159
  animation: 'boolean',
81
160
  template: 'string',
@@ -88,7 +167,11 @@
88
167
  offset: '(number|string|function)',
89
168
  container: '(string|element|boolean)',
90
169
  fallbackPlacement: '(string|array)',
91
- boundary: '(string|element)'
170
+ boundary: '(string|element)',
171
+ sanitize: 'boolean',
172
+ sanitizeFn: '(null|function)',
173
+ whiteList: 'object',
174
+ popperConfig: '(null|object)'
92
175
  };
93
176
  var AttachmentMap = {
94
177
  AUTO: 'auto',
@@ -109,12 +192,14 @@
109
192
  offset: 0,
110
193
  container: false,
111
194
  fallbackPlacement: 'flip',
112
- boundary: 'scrollParent'
113
- };
114
- var HoverState = {
115
- SHOW: 'show',
116
- OUT: 'out'
195
+ boundary: 'scrollParent',
196
+ sanitize: true,
197
+ sanitizeFn: null,
198
+ whiteList: DefaultWhitelist,
199
+ popperConfig: null
117
200
  };
201
+ var HOVER_STATE_SHOW = 'show';
202
+ var HOVER_STATE_OUT = 'out';
118
203
  var Event = {
119
204
  HIDE: "hide" + EVENT_KEY,
120
205
  HIDDEN: "hidden" + EVENT_KEY,
@@ -127,37 +212,23 @@
127
212
  MOUSEENTER: "mouseenter" + EVENT_KEY,
128
213
  MOUSELEAVE: "mouseleave" + EVENT_KEY
129
214
  };
130
- var ClassName = {
131
- FADE: 'fade',
132
- SHOW: 'show'
133
- };
134
- var Selector = {
135
- TOOLTIP: '.tooltip',
136
- TOOLTIP_INNER: '.tooltip-inner',
137
- ARROW: '.arrow'
138
- };
139
- var Trigger = {
140
- HOVER: 'hover',
141
- FOCUS: 'focus',
142
- CLICK: 'click',
143
- MANUAL: 'manual'
144
- /**
145
- * ------------------------------------------------------------------------
146
- * Class Definition
147
- * ------------------------------------------------------------------------
148
- */
149
-
150
- };
215
+ var CLASS_NAME_FADE = 'fade';
216
+ var CLASS_NAME_SHOW = 'show';
217
+ var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
218
+ var SELECTOR_ARROW = '.arrow';
219
+ var TRIGGER_HOVER = 'hover';
220
+ var TRIGGER_FOCUS = 'focus';
221
+ var TRIGGER_CLICK = 'click';
222
+ var TRIGGER_MANUAL = 'manual';
223
+ /**
224
+ * ------------------------------------------------------------------------
225
+ * Class Definition
226
+ * ------------------------------------------------------------------------
227
+ */
151
228
 
152
- var Tooltip =
153
- /*#__PURE__*/
154
- function () {
229
+ var Tooltip = /*#__PURE__*/function () {
155
230
  function Tooltip(element, config) {
156
- /**
157
- * Check for Popper dependency
158
- * Popper - https://popper.js.org
159
- */
160
- if (typeof Popper === 'undefined') {
231
+ if (typeof Popper__default['default'] === 'undefined') {
161
232
  throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
162
233
  } // private
163
234
 
@@ -198,11 +269,11 @@
198
269
 
199
270
  if (event) {
200
271
  var dataKey = this.constructor.DATA_KEY;
201
- var context = $(event.currentTarget).data(dataKey);
272
+ var context = $__default['default'](event.currentTarget).data(dataKey);
202
273
 
203
274
  if (!context) {
204
275
  context = new this.constructor(event.currentTarget, this._getDelegateConfig());
205
- $(event.currentTarget).data(dataKey, context);
276
+ $__default['default'](event.currentTarget).data(dataKey, context);
206
277
  }
207
278
 
208
279
  context._activeTrigger.click = !context._activeTrigger.click;
@@ -213,7 +284,7 @@
213
284
  context._leave(null, context);
214
285
  }
215
286
  } else {
216
- if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
287
+ if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
217
288
  this._leave(null, this);
218
289
 
219
290
  return;
@@ -225,12 +296,12 @@
225
296
 
226
297
  _proto.dispose = function dispose() {
227
298
  clearTimeout(this._timeout);
228
- $.removeData(this.element, this.constructor.DATA_KEY);
229
- $(this.element).off(this.constructor.EVENT_KEY);
230
- $(this.element).closest('.modal').off('hide.bs.modal');
299
+ $__default['default'].removeData(this.element, this.constructor.DATA_KEY);
300
+ $__default['default'](this.element).off(this.constructor.EVENT_KEY);
301
+ $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
231
302
 
232
303
  if (this.tip) {
233
- $(this.tip).remove();
304
+ $__default['default'](this.tip).remove();
234
305
  }
235
306
 
236
307
  this._isEnabled = null;
@@ -238,7 +309,7 @@
238
309
  this._hoverState = null;
239
310
  this._activeTrigger = null;
240
311
 
241
- if (this._popper !== null) {
312
+ if (this._popper) {
242
313
  this._popper.destroy();
243
314
  }
244
315
 
@@ -251,29 +322,29 @@
251
322
  _proto.show = function show() {
252
323
  var _this = this;
253
324
 
254
- if ($(this.element).css('display') === 'none') {
325
+ if ($__default['default'](this.element).css('display') === 'none') {
255
326
  throw new Error('Please use show on visible elements');
256
327
  }
257
328
 
258
- var showEvent = $.Event(this.constructor.Event.SHOW);
329
+ var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);
259
330
 
260
331
  if (this.isWithContent() && this._isEnabled) {
261
- $(this.element).trigger(showEvent);
262
- var shadowRoot = Util.findShadowRoot(this.element);
263
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
332
+ $__default['default'](this.element).trigger(showEvent);
333
+ var shadowRoot = Util__default['default'].findShadowRoot(this.element);
334
+ var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
264
335
 
265
336
  if (showEvent.isDefaultPrevented() || !isInTheDom) {
266
337
  return;
267
338
  }
268
339
 
269
340
  var tip = this.getTipElement();
270
- var tipId = Util.getUID(this.constructor.NAME);
341
+ var tipId = Util__default['default'].getUID(this.constructor.NAME);
271
342
  tip.setAttribute('id', tipId);
272
343
  this.element.setAttribute('aria-describedby', tipId);
273
344
  this.setContent();
274
345
 
275
346
  if (this.config.animation) {
276
- $(tip).addClass(ClassName.FADE);
347
+ $__default['default'](tip).addClass(CLASS_NAME_FADE);
277
348
  }
278
349
 
279
350
  var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
@@ -284,43 +355,21 @@
284
355
 
285
356
  var container = this._getContainer();
286
357
 
287
- $(tip).data(this.constructor.DATA_KEY, this);
358
+ $__default['default'](tip).data(this.constructor.DATA_KEY, this);
288
359
 
289
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
290
- $(tip).appendTo(container);
360
+ if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {
361
+ $__default['default'](tip).appendTo(container);
291
362
  }
292
363
 
293
- $(this.element).trigger(this.constructor.Event.INSERTED);
294
- this._popper = new Popper(this.element, tip, {
295
- placement: attachment,
296
- modifiers: {
297
- offset: this._getOffset(),
298
- flip: {
299
- behavior: this.config.fallbackPlacement
300
- },
301
- arrow: {
302
- element: Selector.ARROW
303
- },
304
- preventOverflow: {
305
- boundariesElement: this.config.boundary
306
- }
307
- },
308
- onCreate: function onCreate(data) {
309
- if (data.originalPlacement !== data.placement) {
310
- _this._handlePopperPlacementChange(data);
311
- }
312
- },
313
- onUpdate: function onUpdate(data) {
314
- return _this._handlePopperPlacementChange(data);
315
- }
316
- });
317
- $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
364
+ $__default['default'](this.element).trigger(this.constructor.Event.INSERTED);
365
+ this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
366
+ $__default['default'](tip).addClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
318
367
  // empty mouseover listeners to the body's immediate children;
319
368
  // only needed because of broken event delegation on iOS
320
369
  // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
321
370
 
322
371
  if ('ontouchstart' in document.documentElement) {
323
- $(document.body).children().on('mouseover', null, $.noop);
372
+ $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
324
373
  }
325
374
 
326
375
  var complete = function complete() {
@@ -330,16 +379,16 @@
330
379
 
331
380
  var prevHoverState = _this._hoverState;
332
381
  _this._hoverState = null;
333
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
382
+ $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);
334
383
 
335
- if (prevHoverState === HoverState.OUT) {
384
+ if (prevHoverState === HOVER_STATE_OUT) {
336
385
  _this._leave(null, _this);
337
386
  }
338
387
  };
339
388
 
340
- if ($(this.tip).hasClass(ClassName.FADE)) {
341
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
342
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
389
+ if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
390
+ var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this.tip);
391
+ $__default['default'](this.tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
343
392
  } else {
344
393
  complete();
345
394
  }
@@ -350,10 +399,10 @@
350
399
  var _this2 = this;
351
400
 
352
401
  var tip = this.getTipElement();
353
- var hideEvent = $.Event(this.constructor.Event.HIDE);
402
+ var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);
354
403
 
355
404
  var complete = function complete() {
356
- if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
405
+ if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
357
406
  tip.parentNode.removeChild(tip);
358
407
  }
359
408
 
@@ -361,7 +410,7 @@
361
410
 
362
411
  _this2.element.removeAttribute('aria-describedby');
363
412
 
364
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
413
+ $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
365
414
 
366
415
  if (_this2._popper !== null) {
367
416
  _this2._popper.destroy();
@@ -372,26 +421,26 @@
372
421
  }
373
422
  };
374
423
 
375
- $(this.element).trigger(hideEvent);
424
+ $__default['default'](this.element).trigger(hideEvent);
376
425
 
377
426
  if (hideEvent.isDefaultPrevented()) {
378
427
  return;
379
428
  }
380
429
 
381
- $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
430
+ $__default['default'](tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
382
431
  // empty mouseover listeners we added for iOS support
383
432
 
384
433
  if ('ontouchstart' in document.documentElement) {
385
- $(document.body).children().off('mouseover', null, $.noop);
434
+ $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
386
435
  }
387
436
 
388
- this._activeTrigger[Trigger.CLICK] = false;
389
- this._activeTrigger[Trigger.FOCUS] = false;
390
- this._activeTrigger[Trigger.HOVER] = false;
437
+ this._activeTrigger[TRIGGER_CLICK] = false;
438
+ this._activeTrigger[TRIGGER_FOCUS] = false;
439
+ this._activeTrigger[TRIGGER_HOVER] = false;
391
440
 
392
- if ($(this.tip).hasClass(ClassName.FADE)) {
393
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
394
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
441
+ if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
442
+ var transitionDuration = Util__default['default'].getTransitionDurationFromElement(tip);
443
+ $__default['default'](tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
395
444
  } else {
396
445
  complete();
397
446
  }
@@ -411,34 +460,42 @@
411
460
  };
412
461
 
413
462
  _proto.addAttachmentClass = function addAttachmentClass(attachment) {
414
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
463
+ $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
415
464
  };
416
465
 
417
466
  _proto.getTipElement = function getTipElement() {
418
- this.tip = this.tip || $(this.config.template)[0];
467
+ this.tip = this.tip || $__default['default'](this.config.template)[0];
419
468
  return this.tip;
420
469
  };
421
470
 
422
471
  _proto.setContent = function setContent() {
423
472
  var tip = this.getTipElement();
424
- this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
425
- $(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
473
+ this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
474
+ $__default['default'](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
426
475
  };
427
476
 
428
477
  _proto.setElementContent = function setElementContent($element, content) {
429
- var html = this.config.html;
430
-
431
478
  if (typeof content === 'object' && (content.nodeType || content.jquery)) {
432
479
  // Content is a DOM node or a jQuery
433
- if (html) {
434
- if (!$(content).parent().is($element)) {
480
+ if (this.config.html) {
481
+ if (!$__default['default'](content).parent().is($element)) {
435
482
  $element.empty().append(content);
436
483
  }
437
484
  } else {
438
- $element.text($(content).text());
485
+ $element.text($__default['default'](content).text());
439
486
  }
487
+
488
+ return;
489
+ }
490
+
491
+ if (this.config.html) {
492
+ if (this.config.sanitize) {
493
+ content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
494
+ }
495
+
496
+ $element.html(content);
440
497
  } else {
441
- $element[html ? 'html' : 'text'](content);
498
+ $element.text(content);
442
499
  }
443
500
  };
444
501
 
@@ -453,14 +510,43 @@
453
510
  } // Private
454
511
  ;
455
512
 
456
- _proto._getOffset = function _getOffset() {
513
+ _proto._getPopperConfig = function _getPopperConfig(attachment) {
457
514
  var _this3 = this;
458
515
 
516
+ var defaultBsConfig = {
517
+ placement: attachment,
518
+ modifiers: {
519
+ offset: this._getOffset(),
520
+ flip: {
521
+ behavior: this.config.fallbackPlacement
522
+ },
523
+ arrow: {
524
+ element: SELECTOR_ARROW
525
+ },
526
+ preventOverflow: {
527
+ boundariesElement: this.config.boundary
528
+ }
529
+ },
530
+ onCreate: function onCreate(data) {
531
+ if (data.originalPlacement !== data.placement) {
532
+ _this3._handlePopperPlacementChange(data);
533
+ }
534
+ },
535
+ onUpdate: function onUpdate(data) {
536
+ return _this3._handlePopperPlacementChange(data);
537
+ }
538
+ };
539
+ return _extends({}, defaultBsConfig, this.config.popperConfig);
540
+ };
541
+
542
+ _proto._getOffset = function _getOffset() {
543
+ var _this4 = this;
544
+
459
545
  var offset = {};
460
546
 
461
547
  if (typeof this.config.offset === 'function') {
462
548
  offset.fn = function (data) {
463
- data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
549
+ data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
464
550
  return data;
465
551
  };
466
552
  } else {
@@ -475,11 +561,11 @@
475
561
  return document.body;
476
562
  }
477
563
 
478
- if (Util.isElement(this.config.container)) {
479
- return $(this.config.container);
564
+ if (Util__default['default'].isElement(this.config.container)) {
565
+ return $__default['default'](this.config.container);
480
566
  }
481
567
 
482
- return $(document).find(this.config.container);
568
+ return $__default['default'](document).find(this.config.container);
483
569
  };
484
570
 
485
571
  _proto._getAttachment = function _getAttachment(placement) {
@@ -487,32 +573,35 @@
487
573
  };
488
574
 
489
575
  _proto._setListeners = function _setListeners() {
490
- var _this4 = this;
576
+ var _this5 = this;
491
577
 
492
578
  var triggers = this.config.trigger.split(' ');
493
579
  triggers.forEach(function (trigger) {
494
580
  if (trigger === 'click') {
495
- $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
496
- return _this4.toggle(event);
581
+ $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
582
+ return _this5.toggle(event);
497
583
  });
498
- } else if (trigger !== Trigger.MANUAL) {
499
- var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
500
- var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
501
- $(_this4.element).on(eventIn, _this4.config.selector, function (event) {
502
- return _this4._enter(event);
503
- }).on(eventOut, _this4.config.selector, function (event) {
504
- return _this4._leave(event);
584
+ } else if (trigger !== TRIGGER_MANUAL) {
585
+ var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
586
+ var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
587
+ $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {
588
+ return _this5._enter(event);
589
+ }).on(eventOut, _this5.config.selector, function (event) {
590
+ return _this5._leave(event);
505
591
  });
506
592
  }
507
593
  });
508
- $(this.element).closest('.modal').on('hide.bs.modal', function () {
509
- if (_this4.element) {
510
- _this4.hide();
594
+
595
+ this._hideModalHandler = function () {
596
+ if (_this5.element) {
597
+ _this5.hide();
511
598
  }
512
- });
599
+ };
600
+
601
+ $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
513
602
 
514
603
  if (this.config.selector) {
515
- this.config = _objectSpread({}, this.config, {
604
+ this.config = _extends({}, this.config, {
516
605
  trigger: 'manual',
517
606
  selector: ''
518
607
  });
@@ -532,24 +621,24 @@
532
621
 
533
622
  _proto._enter = function _enter(event, context) {
534
623
  var dataKey = this.constructor.DATA_KEY;
535
- context = context || $(event.currentTarget).data(dataKey);
624
+ context = context || $__default['default'](event.currentTarget).data(dataKey);
536
625
 
537
626
  if (!context) {
538
627
  context = new this.constructor(event.currentTarget, this._getDelegateConfig());
539
- $(event.currentTarget).data(dataKey, context);
628
+ $__default['default'](event.currentTarget).data(dataKey, context);
540
629
  }
541
630
 
542
631
  if (event) {
543
- context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
632
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
544
633
  }
545
634
 
546
- if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
547
- context._hoverState = HoverState.SHOW;
635
+ if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
636
+ context._hoverState = HOVER_STATE_SHOW;
548
637
  return;
549
638
  }
550
639
 
551
640
  clearTimeout(context._timeout);
552
- context._hoverState = HoverState.SHOW;
641
+ context._hoverState = HOVER_STATE_SHOW;
553
642
 
554
643
  if (!context.config.delay || !context.config.delay.show) {
555
644
  context.show();
@@ -557,7 +646,7 @@
557
646
  }
558
647
 
559
648
  context._timeout = setTimeout(function () {
560
- if (context._hoverState === HoverState.SHOW) {
649
+ if (context._hoverState === HOVER_STATE_SHOW) {
561
650
  context.show();
562
651
  }
563
652
  }, context.config.delay.show);
@@ -565,15 +654,15 @@
565
654
 
566
655
  _proto._leave = function _leave(event, context) {
567
656
  var dataKey = this.constructor.DATA_KEY;
568
- context = context || $(event.currentTarget).data(dataKey);
657
+ context = context || $__default['default'](event.currentTarget).data(dataKey);
569
658
 
570
659
  if (!context) {
571
660
  context = new this.constructor(event.currentTarget, this._getDelegateConfig());
572
- $(event.currentTarget).data(dataKey, context);
661
+ $__default['default'](event.currentTarget).data(dataKey, context);
573
662
  }
574
663
 
575
664
  if (event) {
576
- context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
665
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
577
666
  }
578
667
 
579
668
  if (context._isWithActiveTrigger()) {
@@ -581,7 +670,7 @@
581
670
  }
582
671
 
583
672
  clearTimeout(context._timeout);
584
- context._hoverState = HoverState.OUT;
673
+ context._hoverState = HOVER_STATE_OUT;
585
674
 
586
675
  if (!context.config.delay || !context.config.delay.hide) {
587
676
  context.hide();
@@ -589,7 +678,7 @@
589
678
  }
590
679
 
591
680
  context._timeout = setTimeout(function () {
592
- if (context._hoverState === HoverState.OUT) {
681
+ if (context._hoverState === HOVER_STATE_OUT) {
593
682
  context.hide();
594
683
  }
595
684
  }, context.config.delay.hide);
@@ -606,7 +695,13 @@
606
695
  };
607
696
 
608
697
  _proto._getConfig = function _getConfig(config) {
609
- config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});
698
+ var dataAttributes = $__default['default'](this.element).data();
699
+ Object.keys(dataAttributes).forEach(function (dataAttr) {
700
+ if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
701
+ delete dataAttributes[dataAttr];
702
+ }
703
+ });
704
+ config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
610
705
 
611
706
  if (typeof config.delay === 'number') {
612
707
  config.delay = {
@@ -623,7 +718,12 @@
623
718
  config.content = config.content.toString();
624
719
  }
625
720
 
626
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
721
+ Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
722
+
723
+ if (config.sanitize) {
724
+ config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
725
+ }
726
+
627
727
  return config;
628
728
  };
629
729
 
@@ -642,7 +742,7 @@
642
742
  };
643
743
 
644
744
  _proto._cleanTipClass = function _cleanTipClass() {
645
- var $tip = $(this.getTipElement());
745
+ var $tip = $__default['default'](this.getTipElement());
646
746
  var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
647
747
 
648
748
  if (tabClass !== null && tabClass.length) {
@@ -651,8 +751,7 @@
651
751
  };
652
752
 
653
753
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
654
- var popperInstance = popperData.instance;
655
- this.tip = popperInstance.popper;
754
+ this.tip = popperData.instance.popper;
656
755
 
657
756
  this._cleanTipClass();
658
757
 
@@ -667,7 +766,7 @@
667
766
  return;
668
767
  }
669
768
 
670
- $(tip).removeClass(ClassName.FADE);
769
+ $__default['default'](tip).removeClass(CLASS_NAME_FADE);
671
770
  this.config.animation = false;
672
771
  this.hide();
673
772
  this.show();
@@ -677,7 +776,8 @@
677
776
 
678
777
  Tooltip._jQueryInterface = function _jQueryInterface(config) {
679
778
  return this.each(function () {
680
- var data = $(this).data(DATA_KEY);
779
+ var $element = $__default['default'](this);
780
+ var data = $element.data(DATA_KEY);
681
781
 
682
782
  var _config = typeof config === 'object' && config;
683
783
 
@@ -687,7 +787,7 @@
687
787
 
688
788
  if (!data) {
689
789
  data = new Tooltip(this, _config);
690
- $(this).data(DATA_KEY, data);
790
+ $element.data(DATA_KEY, data);
691
791
  }
692
792
 
693
793
  if (typeof config === 'string') {
@@ -746,14 +846,14 @@
746
846
  */
747
847
 
748
848
 
749
- $.fn[NAME] = Tooltip._jQueryInterface;
750
- $.fn[NAME].Constructor = Tooltip;
849
+ $__default['default'].fn[NAME] = Tooltip._jQueryInterface;
850
+ $__default['default'].fn[NAME].Constructor = Tooltip;
751
851
 
752
- $.fn[NAME].noConflict = function () {
753
- $.fn[NAME] = JQUERY_NO_CONFLICT;
852
+ $__default['default'].fn[NAME].noConflict = function () {
853
+ $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
754
854
  return Tooltip._jQueryInterface;
755
855
  };
756
856
 
757
857
  return Tooltip;
758
858
 
759
- }));
859
+ })));