bootstrap 4.5.2 → 5.0.0.beta1

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 (135) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/README.md +5 -2
  4. data/assets/javascripts/bootstrap-sprockets.js +11 -8
  5. data/assets/javascripts/bootstrap.js +2170 -1572
  6. data/assets/javascripts/bootstrap.min.js +2 -2
  7. data/assets/javascripts/bootstrap/alert.js +195 -66
  8. data/assets/javascripts/bootstrap/button.js +120 -136
  9. data/assets/javascripts/bootstrap/carousel.js +390 -184
  10. data/assets/javascripts/bootstrap/collapse.js +364 -133
  11. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +309 -0
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +86 -0
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
  15. data/assets/javascripts/bootstrap/dropdown.js +357 -232
  16. data/assets/javascripts/bootstrap/modal.js +406 -211
  17. data/assets/javascripts/bootstrap/popover.js +82 -50
  18. data/assets/javascripts/bootstrap/scrollspy.js +226 -80
  19. data/assets/javascripts/bootstrap/tab.js +215 -77
  20. data/assets/javascripts/bootstrap/toast.js +239 -79
  21. data/assets/javascripts/bootstrap/tooltip.js +529 -258
  22. data/assets/stylesheets/_bootstrap-grid.scss +51 -15
  23. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  24. data/assets/stylesheets/_bootstrap.scss +15 -8
  25. data/assets/stylesheets/bootstrap/_accordion.scss +125 -0
  26. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  27. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  28. data/assets/stylesheets/bootstrap/_breadcrumb.scss +4 -20
  29. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  30. data/assets/stylesheets/bootstrap/_buttons.scss +27 -60
  31. data/assets/stylesheets/bootstrap/_card.scss +25 -96
  32. data/assets/stylesheets/bootstrap/_carousel.scss +54 -28
  33. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  34. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  35. data/assets/stylesheets/bootstrap/_dropdown.scss +74 -31
  36. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  37. data/assets/stylesheets/bootstrap/_functions.scss +87 -23
  38. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  39. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  40. data/assets/stylesheets/bootstrap/_list-group.scss +18 -9
  41. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  42. data/assets/stylesheets/bootstrap/_modal.scss +41 -46
  43. data/assets/stylesheets/bootstrap/_nav.scss +12 -8
  44. data/assets/stylesheets/bootstrap/_navbar.scss +43 -74
  45. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  46. data/assets/stylesheets/bootstrap/_popover.scss +23 -20
  47. data/assets/stylesheets/bootstrap/_progress.scss +3 -5
  48. data/assets/stylesheets/bootstrap/_reboot.scss +328 -173
  49. data/assets/stylesheets/bootstrap/_root.scss +5 -9
  50. data/assets/stylesheets/bootstrap/_spinners.scss +14 -5
  51. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  52. data/assets/stylesheets/bootstrap/_toasts.scss +19 -15
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  54. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  55. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  56. data/assets/stylesheets/bootstrap/_utilities.scss +560 -18
  57. data/assets/stylesheets/bootstrap/_variables.scss +652 -459
  58. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  59. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  60. data/assets/stylesheets/bootstrap/forms/_form-check.scss +151 -0
  61. data/assets/stylesheets/bootstrap/forms/_form-control.scss +223 -0
  62. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-select.scss +68 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  65. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  66. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  67. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  68. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  69. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  70. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  71. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  72. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  73. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  74. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  75. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -5
  76. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +9 -9
  77. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  78. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  79. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +65 -47
  80. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  81. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  82. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  83. data/assets/stylesheets/bootstrap/mixins/_forms.scss +17 -78
  84. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
  85. data/assets/stylesheets/bootstrap/mixins/_grid.scss +84 -33
  86. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  87. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  88. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  89. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  90. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  91. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  92. data/assets/stylesheets/bootstrap/mixins/_transition.scss +2 -2
  93. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  94. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +28 -0
  95. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  97. data/lib/bootstrap/version.rb +2 -2
  98. data/tasks/updater/js.rb +6 -4
  99. metadata +33 -41
  100. data/assets/javascripts/bootstrap/util.js +0 -192
  101. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  102. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -523
  103. data/assets/stylesheets/bootstrap/_input-group.scss +0 -192
  104. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  105. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  106. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  107. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  108. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  109. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  110. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  111. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  112. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  113. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  114. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  115. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  116. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  117. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  118. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  119. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  120. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  121. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  122. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  123. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  124. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  125. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  126. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  127. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  128. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  129. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  130. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  131. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  132. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  133. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  134. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  135. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
@@ -1,59 +1,191 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v4.5.2 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.0-beta1 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
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 = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
- }(this, (function ($, Popper, Util) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
8
+ typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
10
+ }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () {
24
+ return e[k];
25
+ }
26
+ });
27
+ }
28
+ });
29
+ }
30
+ n['default'] = e;
31
+ return Object.freeze(n);
32
+ }
11
33
 
12
- $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
13
- Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
14
- Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
34
+ var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
35
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
36
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
37
+ var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
38
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
15
39
 
16
40
  /**
17
41
  * --------------------------------------------------------------------------
18
- * Bootstrap (v4.5.2): tools/sanitizer.js
42
+ * Bootstrap (v5.0.0-beta1): util/index.js
19
43
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
20
44
  * --------------------------------------------------------------------------
21
45
  */
22
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
23
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
24
- var DefaultWhitelist = {
25
- // Global attributes allowed on any supplied element below.
26
- '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
27
- a: ['target', 'href', 'title', 'rel'],
28
- area: [],
29
- b: [],
30
- br: [],
31
- col: [],
32
- code: [],
33
- div: [],
34
- em: [],
35
- hr: [],
36
- h1: [],
37
- h2: [],
38
- h3: [],
39
- h4: [],
40
- h5: [],
41
- h6: [],
42
- i: [],
43
- img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
44
- li: [],
45
- ol: [],
46
- p: [],
47
- pre: [],
48
- s: [],
49
- small: [],
50
- span: [],
51
- sub: [],
52
- sup: [],
53
- strong: [],
54
- u: [],
55
- ul: []
46
+ var MAX_UID = 1000000;
47
+ var MILLISECONDS_MULTIPLIER = 1000;
48
+ var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
49
+
50
+ var toType = function toType(obj) {
51
+ if (obj === null || obj === undefined) {
52
+ return "" + obj;
53
+ }
54
+
55
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
56
56
  };
57
+ /**
58
+ * --------------------------------------------------------------------------
59
+ * Public Util Api
60
+ * --------------------------------------------------------------------------
61
+ */
62
+
63
+
64
+ var getUID = function getUID(prefix) {
65
+ do {
66
+ prefix += Math.floor(Math.random() * MAX_UID);
67
+ } while (document.getElementById(prefix));
68
+
69
+ return prefix;
70
+ };
71
+
72
+ var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
73
+ if (!element) {
74
+ return 0;
75
+ } // Get transition-duration of the element
76
+
77
+
78
+ var _window$getComputedSt = window.getComputedStyle(element),
79
+ transitionDuration = _window$getComputedSt.transitionDuration,
80
+ transitionDelay = _window$getComputedSt.transitionDelay;
81
+
82
+ var floatTransitionDuration = Number.parseFloat(transitionDuration);
83
+ var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
84
+
85
+ if (!floatTransitionDuration && !floatTransitionDelay) {
86
+ return 0;
87
+ } // If multiple durations are defined, take the first
88
+
89
+
90
+ transitionDuration = transitionDuration.split(',')[0];
91
+ transitionDelay = transitionDelay.split(',')[0];
92
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
93
+ };
94
+
95
+ var triggerTransitionEnd = function triggerTransitionEnd(element) {
96
+ element.dispatchEvent(new Event(TRANSITION_END));
97
+ };
98
+
99
+ var isElement = function isElement(obj) {
100
+ return (obj[0] || obj).nodeType;
101
+ };
102
+
103
+ var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
104
+ var called = false;
105
+ var durationPadding = 5;
106
+ var emulatedDuration = duration + durationPadding;
107
+
108
+ function listener() {
109
+ called = true;
110
+ element.removeEventListener(TRANSITION_END, listener);
111
+ }
112
+
113
+ element.addEventListener(TRANSITION_END, listener);
114
+ setTimeout(function () {
115
+ if (!called) {
116
+ triggerTransitionEnd(element);
117
+ }
118
+ }, emulatedDuration);
119
+ };
120
+
121
+ var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
122
+ Object.keys(configTypes).forEach(function (property) {
123
+ var expectedTypes = configTypes[property];
124
+ var value = config[property];
125
+ var valueType = value && isElement(value) ? 'element' : toType(value);
126
+
127
+ if (!new RegExp(expectedTypes).test(valueType)) {
128
+ throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
129
+ }
130
+ });
131
+ };
132
+
133
+ var findShadowRoot = function findShadowRoot(element) {
134
+ if (!document.documentElement.attachShadow) {
135
+ return null;
136
+ } // Can find the shadow root otherwise it'll return the document
137
+
138
+
139
+ if (typeof element.getRootNode === 'function') {
140
+ var root = element.getRootNode();
141
+ return root instanceof ShadowRoot ? root : null;
142
+ }
143
+
144
+ if (element instanceof ShadowRoot) {
145
+ return element;
146
+ } // when we don't find a shadow root
147
+
148
+
149
+ if (!element.parentNode) {
150
+ return null;
151
+ }
152
+
153
+ return findShadowRoot(element.parentNode);
154
+ };
155
+
156
+ var noop = function noop() {
157
+ return function () {};
158
+ };
159
+
160
+ var getjQuery = function getjQuery() {
161
+ var _window = window,
162
+ jQuery = _window.jQuery;
163
+
164
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
165
+ return jQuery;
166
+ }
167
+
168
+ return null;
169
+ };
170
+
171
+ var onDOMContentLoaded = function onDOMContentLoaded(callback) {
172
+ if (document.readyState === 'loading') {
173
+ document.addEventListener('DOMContentLoaded', callback);
174
+ } else {
175
+ callback();
176
+ }
177
+ };
178
+
179
+ var isRTL = document.documentElement.dir === 'rtl';
180
+
181
+ /**
182
+ * --------------------------------------------------------------------------
183
+ * Bootstrap (v5.0.0-beta1): util/sanitizer.js
184
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
185
+ * --------------------------------------------------------------------------
186
+ */
187
+ var uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
188
+ var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
57
189
  /**
58
190
  * A pattern that recognizes a commonly useful subset of URLs that are safe.
59
191
  *
@@ -69,11 +201,11 @@
69
201
 
70
202
  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;
71
203
 
72
- function allowedAttribute(attr, allowedAttributeList) {
204
+ var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
73
205
  var attrName = attr.nodeName.toLowerCase();
74
206
 
75
- if (allowedAttributeList.indexOf(attrName) !== -1) {
76
- if (uriAttrs.indexOf(attrName) !== -1) {
207
+ if (allowedAttributeList.includes(attrName)) {
208
+ if (uriAttrs.has(attrName)) {
77
209
  return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
78
210
  }
79
211
 
@@ -91,10 +223,45 @@
91
223
  }
92
224
 
93
225
  return false;
94
- }
226
+ };
95
227
 
96
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
97
- if (unsafeHtml.length === 0) {
228
+ var DefaultAllowlist = {
229
+ // Global attributes allowed on any supplied element below.
230
+ '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
231
+ a: ['target', 'href', 'title', 'rel'],
232
+ area: [],
233
+ b: [],
234
+ br: [],
235
+ col: [],
236
+ code: [],
237
+ div: [],
238
+ em: [],
239
+ hr: [],
240
+ h1: [],
241
+ h2: [],
242
+ h3: [],
243
+ h4: [],
244
+ h5: [],
245
+ h6: [],
246
+ i: [],
247
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
248
+ li: [],
249
+ ol: [],
250
+ p: [],
251
+ pre: [],
252
+ s: [],
253
+ small: [],
254
+ span: [],
255
+ sub: [],
256
+ sup: [],
257
+ strong: [],
258
+ u: [],
259
+ ul: []
260
+ };
261
+ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
262
+ var _ref;
263
+
264
+ if (!unsafeHtml.length) {
98
265
  return unsafeHtml;
99
266
  }
100
267
 
@@ -104,22 +271,26 @@
104
271
 
105
272
  var domParser = new window.DOMParser();
106
273
  var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
107
- var whitelistKeys = Object.keys(whiteList);
108
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
274
+ var allowlistKeys = Object.keys(allowList);
275
+
276
+ var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
109
277
 
110
278
  var _loop = function _loop(i, len) {
279
+ var _ref2;
280
+
111
281
  var el = elements[i];
112
282
  var elName = el.nodeName.toLowerCase();
113
283
 
114
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
284
+ if (!allowlistKeys.includes(elName)) {
115
285
  el.parentNode.removeChild(el);
116
286
  return "continue";
117
287
  }
118
288
 
119
- var attributeList = [].slice.call(el.attributes);
120
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
289
+ var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
290
+
291
+ var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
121
292
  attributeList.forEach(function (attr) {
122
- if (!allowedAttribute(attr, whitelistedAttributes)) {
293
+ if (!allowedAttribute(attr, allowedAttributes)) {
123
294
  el.removeAttribute(attr.nodeName);
124
295
  }
125
296
  });
@@ -134,8 +305,6 @@
134
305
  return createdDocument.body.innerHTML;
135
306
  }
136
307
 
137
- 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); }
138
-
139
308
  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); } }
140
309
 
141
310
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
@@ -145,14 +314,60 @@
145
314
  * ------------------------------------------------------------------------
146
315
  */
147
316
 
317
+ var VERSION = '5.0.0-beta1';
318
+
319
+ var BaseComponent = /*#__PURE__*/function () {
320
+ function BaseComponent(element) {
321
+ if (!element) {
322
+ return;
323
+ }
324
+
325
+ this._element = element;
326
+ Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
327
+ }
328
+
329
+ var _proto = BaseComponent.prototype;
330
+
331
+ _proto.dispose = function dispose() {
332
+ Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
333
+ this._element = null;
334
+ }
335
+ /** Static */
336
+ ;
337
+
338
+ BaseComponent.getInstance = function getInstance(element) {
339
+ return Data__default['default'].getData(element, this.DATA_KEY);
340
+ };
341
+
342
+ _createClass(BaseComponent, null, [{
343
+ key: "VERSION",
344
+ get: function get() {
345
+ return VERSION;
346
+ }
347
+ }]);
348
+
349
+ return BaseComponent;
350
+ }();
351
+
352
+ 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); }
353
+
354
+ function _defineProperties$1(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); } }
355
+
356
+ function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
357
+
358
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
359
+ /**
360
+ * ------------------------------------------------------------------------
361
+ * Constants
362
+ * ------------------------------------------------------------------------
363
+ */
364
+
148
365
  var NAME = 'tooltip';
149
- var VERSION = '4.5.2';
150
366
  var DATA_KEY = 'bs.tooltip';
151
367
  var EVENT_KEY = "." + DATA_KEY;
152
- var JQUERY_NO_CONFLICT = $.fn[NAME];
153
368
  var CLASS_PREFIX = 'bs-tooltip';
154
369
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
155
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
370
+ var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
156
371
  var DefaultType = {
157
372
  animation: 'boolean',
158
373
  template: 'string',
@@ -162,43 +377,41 @@
162
377
  html: 'boolean',
163
378
  selector: '(string|boolean)',
164
379
  placement: '(string|function)',
165
- offset: '(number|string|function)',
166
380
  container: '(string|element|boolean)',
167
- fallbackPlacement: '(string|array)',
381
+ fallbackPlacements: '(null|array)',
168
382
  boundary: '(string|element)',
383
+ customClass: '(string|function)',
169
384
  sanitize: 'boolean',
170
385
  sanitizeFn: '(null|function)',
171
- whiteList: 'object',
386
+ allowList: 'object',
172
387
  popperConfig: '(null|object)'
173
388
  };
174
389
  var AttachmentMap = {
175
390
  AUTO: 'auto',
176
391
  TOP: 'top',
177
- RIGHT: 'right',
392
+ RIGHT: isRTL ? 'left' : 'right',
178
393
  BOTTOM: 'bottom',
179
- LEFT: 'left'
394
+ LEFT: isRTL ? 'right' : 'left'
180
395
  };
181
396
  var Default = {
182
397
  animation: true,
183
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
398
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
184
399
  trigger: 'hover focus',
185
400
  title: '',
186
401
  delay: 0,
187
402
  html: false,
188
403
  selector: false,
189
404
  placement: 'top',
190
- offset: 0,
191
405
  container: false,
192
- fallbackPlacement: 'flip',
193
- boundary: 'scrollParent',
406
+ fallbackPlacements: null,
407
+ boundary: 'clippingParents',
408
+ customClass: '',
194
409
  sanitize: true,
195
410
  sanitizeFn: null,
196
- whiteList: DefaultWhitelist,
411
+ allowList: DefaultAllowlist,
197
412
  popperConfig: null
198
413
  };
199
- var HOVER_STATE_SHOW = 'show';
200
- var HOVER_STATE_OUT = 'out';
201
- var Event = {
414
+ var Event$1 = {
202
415
  HIDE: "hide" + EVENT_KEY,
203
416
  HIDDEN: "hidden" + EVENT_KEY,
204
417
  SHOW: "show" + EVENT_KEY,
@@ -211,9 +424,11 @@
211
424
  MOUSELEAVE: "mouseleave" + EVENT_KEY
212
425
  };
213
426
  var CLASS_NAME_FADE = 'fade';
427
+ var CLASS_NAME_MODAL = 'modal';
214
428
  var CLASS_NAME_SHOW = 'show';
429
+ var HOVER_STATE_SHOW = 'show';
430
+ var HOVER_STATE_OUT = 'out';
215
431
  var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
216
- var SELECTOR_ARROW = '.arrow';
217
432
  var TRIGGER_HOVER = 'hover';
218
433
  var TRIGGER_FOCUS = 'focus';
219
434
  var TRIGGER_CLICK = 'click';
@@ -224,24 +439,30 @@
224
439
  * ------------------------------------------------------------------------
225
440
  */
226
441
 
227
- var Tooltip = /*#__PURE__*/function () {
442
+ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
443
+ _inheritsLoose(Tooltip, _BaseComponent);
444
+
228
445
  function Tooltip(element, config) {
229
- if (typeof Popper === 'undefined') {
230
- throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
231
- } // private
446
+ var _this;
232
447
 
448
+ if (typeof Popper__namespace === 'undefined') {
449
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
450
+ }
233
451
 
234
- this._isEnabled = true;
235
- this._timeout = 0;
236
- this._hoverState = '';
237
- this._activeTrigger = {};
238
- this._popper = null; // Protected
452
+ _this = _BaseComponent.call(this, element) || this; // private
239
453
 
240
- this.element = element;
241
- this.config = this._getConfig(config);
242
- this.tip = null;
454
+ _this._isEnabled = true;
455
+ _this._timeout = 0;
456
+ _this._hoverState = '';
457
+ _this._activeTrigger = {};
458
+ _this._popper = null; // Protected
459
+
460
+ _this.config = _this._getConfig(config);
461
+ _this.tip = null;
462
+
463
+ _this._setListeners();
243
464
 
244
- this._setListeners();
465
+ return _this;
245
466
  } // Getters
246
467
 
247
468
 
@@ -267,11 +488,11 @@
267
488
 
268
489
  if (event) {
269
490
  var dataKey = this.constructor.DATA_KEY;
270
- var context = $(event.currentTarget).data(dataKey);
491
+ var context = Data__default['default'].getData(event.delegateTarget, dataKey);
271
492
 
272
493
  if (!context) {
273
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
274
- $(event.currentTarget).data(dataKey, context);
494
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
495
+ Data__default['default'].setData(event.delegateTarget, dataKey, context);
275
496
  }
276
497
 
277
498
  context._activeTrigger.click = !context._activeTrigger.click;
@@ -282,7 +503,7 @@
282
503
  context._leave(null, context);
283
504
  }
284
505
  } else {
285
- if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
506
+ if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {
286
507
  this._leave(null, this);
287
508
 
288
509
  return;
@@ -294,12 +515,11 @@
294
515
 
295
516
  _proto.dispose = function dispose() {
296
517
  clearTimeout(this._timeout);
297
- $.removeData(this.element, this.constructor.DATA_KEY);
298
- $(this.element).off(this.constructor.EVENT_KEY);
299
- $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
518
+ EventHandler__default['default'].off(this._element, this.constructor.EVENT_KEY);
519
+ EventHandler__default['default'].off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
300
520
 
301
521
  if (this.tip) {
302
- $(this.tip).remove();
522
+ this.tip.parentNode.removeChild(this.tip);
303
523
  }
304
524
 
305
525
  this._isEnabled = null;
@@ -312,133 +532,149 @@
312
532
  }
313
533
 
314
534
  this._popper = null;
315
- this.element = null;
316
535
  this.config = null;
317
536
  this.tip = null;
537
+
538
+ _BaseComponent.prototype.dispose.call(this);
318
539
  };
319
540
 
320
541
  _proto.show = function show() {
321
- var _this = this;
542
+ var _this2 = this;
322
543
 
323
- if ($(this.element).css('display') === 'none') {
544
+ if (this._element.style.display === 'none') {
324
545
  throw new Error('Please use show on visible elements');
325
546
  }
326
547
 
327
- var showEvent = $.Event(this.constructor.Event.SHOW);
328
-
329
548
  if (this.isWithContent() && this._isEnabled) {
330
- $(this.element).trigger(showEvent);
331
- var shadowRoot = Util.findShadowRoot(this.element);
332
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
549
+ var showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
550
+ var shadowRoot = findShadowRoot(this._element);
551
+ var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
333
552
 
334
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
553
+ if (showEvent.defaultPrevented || !isInTheDom) {
335
554
  return;
336
555
  }
337
556
 
338
557
  var tip = this.getTipElement();
339
- var tipId = Util.getUID(this.constructor.NAME);
558
+ var tipId = getUID(this.constructor.NAME);
340
559
  tip.setAttribute('id', tipId);
341
- this.element.setAttribute('aria-describedby', tipId);
560
+
561
+ this._element.setAttribute('aria-describedby', tipId);
562
+
342
563
  this.setContent();
343
564
 
344
565
  if (this.config.animation) {
345
- $(tip).addClass(CLASS_NAME_FADE);
566
+ tip.classList.add(CLASS_NAME_FADE);
346
567
  }
347
568
 
348
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
569
+ var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
349
570
 
350
571
  var attachment = this._getAttachment(placement);
351
572
 
352
- this.addAttachmentClass(attachment);
573
+ this._addAttachmentClass(attachment);
353
574
 
354
575
  var container = this._getContainer();
355
576
 
356
- $(tip).data(this.constructor.DATA_KEY, this);
577
+ Data__default['default'].setData(tip, this.constructor.DATA_KEY, this);
357
578
 
358
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
359
- $(tip).appendTo(container);
579
+ if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
580
+ container.appendChild(tip);
360
581
  }
361
582
 
362
- $(this.element).trigger(this.constructor.Event.INSERTED);
363
- this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
364
- $(tip).addClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
583
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
584
+ this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
585
+ tip.classList.add(CLASS_NAME_SHOW);
586
+ var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
587
+
588
+ if (customClass) {
589
+ var _tip$classList;
590
+
591
+ (_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
592
+ } // If this is a touch-enabled device we add extra
365
593
  // empty mouseover listeners to the body's immediate children;
366
594
  // only needed because of broken event delegation on iOS
367
595
  // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
368
596
 
597
+
369
598
  if ('ontouchstart' in document.documentElement) {
370
- $(document.body).children().on('mouseover', null, $.noop);
599
+ var _ref;
600
+
601
+ (_ref = []).concat.apply(_ref, document.body.children).forEach(function (element) {
602
+ EventHandler__default['default'].on(element, 'mouseover', noop());
603
+ });
371
604
  }
372
605
 
373
606
  var complete = function complete() {
374
- if (_this.config.animation) {
375
- _this._fixTransition();
376
- }
377
-
378
- var prevHoverState = _this._hoverState;
379
- _this._hoverState = null;
380
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
607
+ var prevHoverState = _this2._hoverState;
608
+ _this2._hoverState = null;
609
+ EventHandler__default['default'].trigger(_this2._element, _this2.constructor.Event.SHOWN);
381
610
 
382
611
  if (prevHoverState === HOVER_STATE_OUT) {
383
- _this._leave(null, _this);
612
+ _this2._leave(null, _this2);
384
613
  }
385
614
  };
386
615
 
387
- if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
388
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
389
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
616
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
617
+ var transitionDuration = getTransitionDurationFromElement(this.tip);
618
+ EventHandler__default['default'].one(this.tip, TRANSITION_END, complete);
619
+ emulateTransitionEnd(this.tip, transitionDuration);
390
620
  } else {
391
621
  complete();
392
622
  }
393
623
  }
394
624
  };
395
625
 
396
- _proto.hide = function hide(callback) {
397
- var _this2 = this;
626
+ _proto.hide = function hide() {
627
+ var _this3 = this;
628
+
629
+ if (!this._popper) {
630
+ return;
631
+ }
398
632
 
399
633
  var tip = this.getTipElement();
400
- var hideEvent = $.Event(this.constructor.Event.HIDE);
401
634
 
402
635
  var complete = function complete() {
403
- if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
636
+ if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
404
637
  tip.parentNode.removeChild(tip);
405
638
  }
406
639
 
407
- _this2._cleanTipClass();
640
+ _this3._cleanTipClass();
408
641
 
409
- _this2.element.removeAttribute('aria-describedby');
642
+ _this3._element.removeAttribute('aria-describedby');
410
643
 
411
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
644
+ EventHandler__default['default'].trigger(_this3._element, _this3.constructor.Event.HIDDEN);
412
645
 
413
- if (_this2._popper !== null) {
414
- _this2._popper.destroy();
415
- }
646
+ if (_this3._popper) {
647
+ _this3._popper.destroy();
416
648
 
417
- if (callback) {
418
- callback();
649
+ _this3._popper = null;
419
650
  }
420
651
  };
421
652
 
422
- $(this.element).trigger(hideEvent);
653
+ var hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
423
654
 
424
- if (hideEvent.isDefaultPrevented()) {
655
+ if (hideEvent.defaultPrevented) {
425
656
  return;
426
657
  }
427
658
 
428
- $(tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
659
+ tip.classList.remove(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
429
660
  // empty mouseover listeners we added for iOS support
430
661
 
431
662
  if ('ontouchstart' in document.documentElement) {
432
- $(document.body).children().off('mouseover', null, $.noop);
663
+ var _ref2;
664
+
665
+ (_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (element) {
666
+ return EventHandler__default['default'].off(element, 'mouseover', noop);
667
+ });
433
668
  }
434
669
 
435
670
  this._activeTrigger[TRIGGER_CLICK] = false;
436
671
  this._activeTrigger[TRIGGER_FOCUS] = false;
437
672
  this._activeTrigger[TRIGGER_HOVER] = false;
438
673
 
439
- if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
440
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
441
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
674
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
675
+ var transitionDuration = getTransitionDurationFromElement(tip);
676
+ EventHandler__default['default'].one(tip, TRANSITION_END, complete);
677
+ emulateTransitionEnd(tip, transitionDuration);
442
678
  } else {
443
679
  complete();
444
680
  }
@@ -448,7 +684,7 @@
448
684
 
449
685
  _proto.update = function update() {
450
686
  if (this._popper !== null) {
451
- this._popper.scheduleUpdate();
687
+ this._popper.update();
452
688
  }
453
689
  } // Protected
454
690
  ;
@@ -457,30 +693,41 @@
457
693
  return Boolean(this.getTitle());
458
694
  };
459
695
 
460
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
461
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
462
- };
463
-
464
696
  _proto.getTipElement = function getTipElement() {
465
- this.tip = this.tip || $(this.config.template)[0];
697
+ if (this.tip) {
698
+ return this.tip;
699
+ }
700
+
701
+ var element = document.createElement('div');
702
+ element.innerHTML = this.config.template;
703
+ this.tip = element.children[0];
466
704
  return this.tip;
467
705
  };
468
706
 
469
707
  _proto.setContent = function setContent() {
470
708
  var tip = this.getTipElement();
471
- this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
472
- $(tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
709
+ this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
710
+ tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
473
711
  };
474
712
 
475
- _proto.setElementContent = function setElementContent($element, content) {
476
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
477
- // Content is a DOM node or a jQuery
713
+ _proto.setElementContent = function setElementContent(element, content) {
714
+ if (element === null) {
715
+ return;
716
+ }
717
+
718
+ if (typeof content === 'object' && isElement(content)) {
719
+ if (content.jquery) {
720
+ content = content[0];
721
+ } // content is a DOM node or a jQuery
722
+
723
+
478
724
  if (this.config.html) {
479
- if (!$(content).parent().is($element)) {
480
- $element.empty().append(content);
725
+ if (content.parentNode !== element) {
726
+ element.innerHTML = '';
727
+ element.appendChild(content);
481
728
  }
482
729
  } else {
483
- $element.text($(content).text());
730
+ element.textContent = content.textContent;
484
731
  }
485
732
 
486
733
  return;
@@ -488,70 +735,83 @@
488
735
 
489
736
  if (this.config.html) {
490
737
  if (this.config.sanitize) {
491
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
738
+ content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
492
739
  }
493
740
 
494
- $element.html(content);
741
+ element.innerHTML = content;
495
742
  } else {
496
- $element.text(content);
743
+ element.textContent = content;
497
744
  }
498
745
  };
499
746
 
500
747
  _proto.getTitle = function getTitle() {
501
- var title = this.element.getAttribute('data-original-title');
748
+ var title = this._element.getAttribute('data-bs-original-title');
502
749
 
503
750
  if (!title) {
504
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
751
+ title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
505
752
  }
506
753
 
507
754
  return title;
755
+ };
756
+
757
+ _proto.updateAttachment = function updateAttachment(attachment) {
758
+ if (attachment === 'right') {
759
+ return 'end';
760
+ }
761
+
762
+ if (attachment === 'left') {
763
+ return 'start';
764
+ }
765
+
766
+ return attachment;
508
767
  } // Private
509
768
  ;
510
769
 
511
770
  _proto._getPopperConfig = function _getPopperConfig(attachment) {
512
- var _this3 = this;
771
+ var _this4 = this;
772
+
773
+ var flipModifier = {
774
+ name: 'flip',
775
+ options: {
776
+ altBoundary: true
777
+ }
778
+ };
779
+
780
+ if (this.config.fallbackPlacements) {
781
+ flipModifier.options.fallbackPlacements = this.config.fallbackPlacements;
782
+ }
513
783
 
514
784
  var defaultBsConfig = {
515
785
  placement: attachment,
516
- modifiers: {
517
- offset: this._getOffset(),
518
- flip: {
519
- behavior: this.config.fallbackPlacement
520
- },
521
- arrow: {
522
- element: SELECTOR_ARROW
523
- },
524
- preventOverflow: {
525
- boundariesElement: this.config.boundary
786
+ modifiers: [flipModifier, {
787
+ name: 'preventOverflow',
788
+ options: {
789
+ rootBoundary: this.config.boundary
790
+ }
791
+ }, {
792
+ name: 'arrow',
793
+ options: {
794
+ element: "." + this.constructor.NAME + "-arrow"
795
+ }
796
+ }, {
797
+ name: 'onChange',
798
+ enabled: true,
799
+ phase: 'afterWrite',
800
+ fn: function fn(data) {
801
+ return _this4._handlePopperPlacementChange(data);
526
802
  }
527
- },
528
- onCreate: function onCreate(data) {
529
- if (data.originalPlacement !== data.placement) {
530
- _this3._handlePopperPlacementChange(data);
803
+ }],
804
+ onFirstUpdate: function onFirstUpdate(data) {
805
+ if (data.options.placement !== data.placement) {
806
+ _this4._handlePopperPlacementChange(data);
531
807
  }
532
- },
533
- onUpdate: function onUpdate(data) {
534
- return _this3._handlePopperPlacementChange(data);
535
808
  }
536
809
  };
537
810
  return _extends({}, defaultBsConfig, this.config.popperConfig);
538
811
  };
539
812
 
540
- _proto._getOffset = function _getOffset() {
541
- var _this4 = this;
542
-
543
- var offset = {};
544
-
545
- if (typeof this.config.offset === 'function') {
546
- offset.fn = function (data) {
547
- data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
548
- return data;
549
- };
550
- } else {
551
- offset.offset = this.config.offset;
552
- }
553
-
554
- return offset;
813
+ _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
814
+ this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
555
815
  };
556
816
 
557
817
  _proto._getContainer = function _getContainer() {
@@ -559,11 +819,11 @@
559
819
  return document.body;
560
820
  }
561
821
 
562
- if (Util.isElement(this.config.container)) {
563
- return $(this.config.container);
822
+ if (isElement(this.config.container)) {
823
+ return this.config.container;
564
824
  }
565
825
 
566
- return $(document).find(this.config.container);
826
+ return SelectorEngine__default['default'].findOne(this.config.container);
567
827
  };
568
828
 
569
829
  _proto._getAttachment = function _getAttachment(placement) {
@@ -576,27 +836,28 @@
576
836
  var triggers = this.config.trigger.split(' ');
577
837
  triggers.forEach(function (trigger) {
578
838
  if (trigger === 'click') {
579
- $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
839
+ EventHandler__default['default'].on(_this5._element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
580
840
  return _this5.toggle(event);
581
841
  });
582
842
  } else if (trigger !== TRIGGER_MANUAL) {
583
843
  var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
584
844
  var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
585
- $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
845
+ EventHandler__default['default'].on(_this5._element, eventIn, _this5.config.selector, function (event) {
586
846
  return _this5._enter(event);
587
- }).on(eventOut, _this5.config.selector, function (event) {
847
+ });
848
+ EventHandler__default['default'].on(_this5._element, eventOut, _this5.config.selector, function (event) {
588
849
  return _this5._leave(event);
589
850
  });
590
851
  }
591
852
  });
592
853
 
593
854
  this._hideModalHandler = function () {
594
- if (_this5.element) {
855
+ if (_this5._element) {
595
856
  _this5.hide();
596
857
  }
597
858
  };
598
859
 
599
- $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
860
+ EventHandler__default['default'].on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
600
861
 
601
862
  if (this.config.selector) {
602
863
  this.config = _extends({}, this.config, {
@@ -609,28 +870,35 @@
609
870
  };
610
871
 
611
872
  _proto._fixTitle = function _fixTitle() {
612
- var titleType = typeof this.element.getAttribute('data-original-title');
873
+ var title = this._element.getAttribute('title');
874
+
875
+ var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
876
+
877
+ if (title || originalTitleType !== 'string') {
878
+ this._element.setAttribute('data-bs-original-title', title || '');
879
+
880
+ if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
881
+ this._element.setAttribute('aria-label', title);
882
+ }
613
883
 
614
- if (this.element.getAttribute('title') || titleType !== 'string') {
615
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
616
- this.element.setAttribute('title', '');
884
+ this._element.setAttribute('title', '');
617
885
  }
618
886
  };
619
887
 
620
888
  _proto._enter = function _enter(event, context) {
621
889
  var dataKey = this.constructor.DATA_KEY;
622
- context = context || $(event.currentTarget).data(dataKey);
890
+ context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
623
891
 
624
892
  if (!context) {
625
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
626
- $(event.currentTarget).data(dataKey, context);
893
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
894
+ Data__default['default'].setData(event.delegateTarget, dataKey, context);
627
895
  }
628
896
 
629
897
  if (event) {
630
898
  context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
631
899
  }
632
900
 
633
- if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
901
+ if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
634
902
  context._hoverState = HOVER_STATE_SHOW;
635
903
  return;
636
904
  }
@@ -652,11 +920,11 @@
652
920
 
653
921
  _proto._leave = function _leave(event, context) {
654
922
  var dataKey = this.constructor.DATA_KEY;
655
- context = context || $(event.currentTarget).data(dataKey);
923
+ context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
656
924
 
657
925
  if (!context) {
658
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
659
- $(event.currentTarget).data(dataKey, context);
926
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
927
+ Data__default['default'].setData(event.delegateTarget, dataKey, context);
660
928
  }
661
929
 
662
930
  if (event) {
@@ -693,12 +961,17 @@
693
961
  };
694
962
 
695
963
  _proto._getConfig = function _getConfig(config) {
696
- var dataAttributes = $(this.element).data();
964
+ var dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
697
965
  Object.keys(dataAttributes).forEach(function (dataAttr) {
698
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
966
+ if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
699
967
  delete dataAttributes[dataAttr];
700
968
  }
701
969
  });
970
+
971
+ if (config && typeof config.container === 'object' && config.container.jquery) {
972
+ config.container = config.container[0];
973
+ }
974
+
702
975
  config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
703
976
 
704
977
  if (typeof config.delay === 'number') {
@@ -716,10 +989,10 @@
716
989
  config.content = config.content.toString();
717
990
  }
718
991
 
719
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
992
+ typeCheckConfig(NAME, config, this.constructor.DefaultType);
720
993
 
721
994
  if (config.sanitize) {
722
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
995
+ config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
723
996
  }
724
997
 
725
998
  return config;
@@ -740,41 +1013,36 @@
740
1013
  };
741
1014
 
742
1015
  _proto._cleanTipClass = function _cleanTipClass() {
743
- var $tip = $(this.getTipElement());
744
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
1016
+ var tip = this.getTipElement();
1017
+ var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
745
1018
 
746
- if (tabClass !== null && tabClass.length) {
747
- $tip.removeClass(tabClass.join(''));
1019
+ if (tabClass !== null && tabClass.length > 0) {
1020
+ tabClass.map(function (token) {
1021
+ return token.trim();
1022
+ }).forEach(function (tClass) {
1023
+ return tip.classList.remove(tClass);
1024
+ });
748
1025
  }
749
1026
  };
750
1027
 
751
1028
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
752
- this.tip = popperData.instance.popper;
753
-
754
- this._cleanTipClass();
755
-
756
- this.addAttachmentClass(this._getAttachment(popperData.placement));
757
- };
758
-
759
- _proto._fixTransition = function _fixTransition() {
760
- var tip = this.getTipElement();
761
- var initConfigAnimation = this.config.animation;
1029
+ var state = popperData.state;
762
1030
 
763
- if (tip.getAttribute('x-placement') !== null) {
1031
+ if (!state) {
764
1032
  return;
765
1033
  }
766
1034
 
767
- $(tip).removeClass(CLASS_NAME_FADE);
768
- this.config.animation = false;
769
- this.hide();
770
- this.show();
771
- this.config.animation = initConfigAnimation;
1035
+ this.tip = state.elements.popper;
1036
+
1037
+ this._cleanTipClass();
1038
+
1039
+ this._addAttachmentClass(this._getAttachment(state.placement));
772
1040
  } // Static
773
1041
  ;
774
1042
 
775
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
1043
+ Tooltip.jQueryInterface = function jQueryInterface(config) {
776
1044
  return this.each(function () {
777
- var data = $(this).data(DATA_KEY);
1045
+ var data = Data__default['default'].getData(this, DATA_KEY);
778
1046
 
779
1047
  var _config = typeof config === 'object' && config;
780
1048
 
@@ -784,7 +1052,6 @@
784
1052
 
785
1053
  if (!data) {
786
1054
  data = new Tooltip(this, _config);
787
- $(this).data(DATA_KEY, data);
788
1055
  }
789
1056
 
790
1057
  if (typeof config === 'string') {
@@ -797,12 +1064,7 @@
797
1064
  });
798
1065
  };
799
1066
 
800
- _createClass(Tooltip, null, [{
801
- key: "VERSION",
802
- get: function get() {
803
- return VERSION;
804
- }
805
- }, {
1067
+ _createClass$1(Tooltip, null, [{
806
1068
  key: "Default",
807
1069
  get: function get() {
808
1070
  return Default;
@@ -820,7 +1082,7 @@
820
1082
  }, {
821
1083
  key: "Event",
822
1084
  get: function get() {
823
- return Event;
1085
+ return Event$1;
824
1086
  }
825
1087
  }, {
826
1088
  key: "EVENT_KEY",
@@ -835,21 +1097,30 @@
835
1097
  }]);
836
1098
 
837
1099
  return Tooltip;
838
- }();
1100
+ }(BaseComponent);
839
1101
  /**
840
1102
  * ------------------------------------------------------------------------
841
1103
  * jQuery
842
1104
  * ------------------------------------------------------------------------
1105
+ * add .Tooltip to jQuery only if jQuery is present
843
1106
  */
844
1107
 
845
1108
 
846
- $.fn[NAME] = Tooltip._jQueryInterface;
847
- $.fn[NAME].Constructor = Tooltip;
1109
+ onDOMContentLoaded(function () {
1110
+ var $ = getjQuery();
1111
+ /* istanbul ignore if */
848
1112
 
849
- $.fn[NAME].noConflict = function () {
850
- $.fn[NAME] = JQUERY_NO_CONFLICT;
851
- return Tooltip._jQueryInterface;
852
- };
1113
+ if ($) {
1114
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
1115
+ $.fn[NAME] = Tooltip.jQueryInterface;
1116
+ $.fn[NAME].Constructor = Tooltip;
1117
+
1118
+ $.fn[NAME].noConflict = function () {
1119
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
1120
+ return Tooltip.jQueryInterface;
1121
+ };
1122
+ }
1123
+ });
853
1124
 
854
1125
  return Tooltip;
855
1126