bootstrap 4.6.0 → 5.0.0.beta2

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