bootstrap 5.0.0.beta2 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/assets/javascripts/bootstrap-sprockets.js +8 -7
  4. data/assets/javascripts/bootstrap.js +2525 -2460
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +77 -179
  7. data/assets/javascripts/bootstrap/base-component.js +140 -38
  8. data/assets/javascripts/bootstrap/button.js +54 -100
  9. data/assets/javascripts/bootstrap/carousel.js +335 -451
  10. data/assets/javascripts/bootstrap/collapse.js +195 -303
  11. data/assets/javascripts/bootstrap/dom/data.js +34 -47
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +95 -90
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +23 -21
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +20 -28
  15. data/assets/javascripts/bootstrap/dropdown.js +323 -358
  16. data/assets/javascripts/bootstrap/modal.js +537 -489
  17. data/assets/javascripts/bootstrap/offcanvas.js +720 -0
  18. data/assets/javascripts/bootstrap/popover.js +112 -180
  19. data/assets/javascripts/bootstrap/scrollspy.js +167 -235
  20. data/assets/javascripts/bootstrap/tab.js +121 -188
  21. data/assets/javascripts/bootstrap/toast.js +166 -243
  22. data/assets/javascripts/bootstrap/tooltip.js +333 -495
  23. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  25. data/assets/stylesheets/_bootstrap.scss +2 -1
  26. data/assets/stylesheets/bootstrap/_accordion.scss +24 -32
  27. data/assets/stylesheets/bootstrap/_buttons.scss +2 -0
  28. data/assets/stylesheets/bootstrap/_card.scss +6 -6
  29. data/assets/stylesheets/bootstrap/_carousel.scss +2 -2
  30. data/assets/stylesheets/bootstrap/_dropdown.scss +14 -23
  31. data/assets/stylesheets/bootstrap/_functions.scss +61 -3
  32. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  33. data/assets/stylesheets/bootstrap/_list-group.scss +16 -5
  34. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  35. data/assets/stylesheets/bootstrap/_modal.scss +8 -24
  36. data/assets/stylesheets/bootstrap/_nav.scss +7 -0
  37. data/assets/stylesheets/bootstrap/_navbar.scss +2 -0
  38. data/assets/stylesheets/bootstrap/_offcanvas.scss +79 -0
  39. data/assets/stylesheets/bootstrap/_popover.scss +10 -10
  40. data/assets/stylesheets/bootstrap/_progress.scss +3 -0
  41. data/assets/stylesheets/bootstrap/_reboot.scss +7 -21
  42. data/assets/stylesheets/bootstrap/_spinners.scss +6 -2
  43. data/assets/stylesheets/bootstrap/_tables.scss +1 -0
  44. data/assets/stylesheets/bootstrap/_toasts.scss +1 -1
  45. data/assets/stylesheets/bootstrap/_tooltip.scss +4 -4
  46. data/assets/stylesheets/bootstrap/_transitions.scss +2 -0
  47. data/assets/stylesheets/bootstrap/_utilities.scss +65 -37
  48. data/assets/stylesheets/bootstrap/_variables.scss +162 -50
  49. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  50. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +3 -1
  51. data/assets/stylesheets/bootstrap/forms/_form-check.scss +1 -1
  52. data/assets/stylesheets/bootstrap/forms/_form-control.scss +0 -4
  53. data/assets/stylesheets/bootstrap/forms/_form-range.scss +1 -1
  54. data/assets/stylesheets/bootstrap/forms/_form-select.scss +3 -0
  55. data/assets/stylesheets/bootstrap/mixins/_alert.scss +2 -0
  56. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +2 -0
  57. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +7 -2
  58. data/assets/stylesheets/bootstrap/mixins/_caret.scss +2 -0
  59. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  60. data/assets/stylesheets/bootstrap/mixins/_forms.scss +25 -5
  61. data/assets/stylesheets/bootstrap/mixins/_grid.scss +23 -11
  62. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
  63. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -0
  64. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +55 -13
  65. data/bootstrap.gemspec +1 -1
  66. data/lib/bootstrap/version.rb +2 -2
  67. data/tasks/updater/js.rb +1 -1
  68. data/tasks/updater/network.rb +7 -1
  69. metadata +9 -6
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v5.0.0-beta2 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.2 (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('@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';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/selector-engine.js'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./base-component.js')) :
8
+ typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/selector-engine', './dom/data', './dom/event-handler', './dom/manipulator', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.SelectorEngine, global.Data, global.EventHandler, global.Manipulator, global.Base));
10
+ }(this, (function (Popper, SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
@@ -32,75 +32,24 @@
32
32
  }
33
33
 
34
34
  var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
35
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
35
36
  var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
36
37
  var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
37
38
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
38
- var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
39
39
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
40
40
 
41
- function _defineProperties(target, props) {
42
- for (var i = 0; i < props.length; i++) {
43
- var descriptor = props[i];
44
- descriptor.enumerable = descriptor.enumerable || false;
45
- descriptor.configurable = true;
46
- if ("value" in descriptor) descriptor.writable = true;
47
- Object.defineProperty(target, descriptor.key, descriptor);
48
- }
49
- }
50
-
51
- function _createClass(Constructor, protoProps, staticProps) {
52
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
53
- if (staticProps) _defineProperties(Constructor, staticProps);
54
- return Constructor;
55
- }
56
-
57
- function _extends() {
58
- _extends = Object.assign || function (target) {
59
- for (var i = 1; i < arguments.length; i++) {
60
- var source = arguments[i];
61
-
62
- for (var key in source) {
63
- if (Object.prototype.hasOwnProperty.call(source, key)) {
64
- target[key] = source[key];
65
- }
66
- }
67
- }
68
-
69
- return target;
70
- };
71
-
72
- return _extends.apply(this, arguments);
73
- }
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
-
91
41
  /**
92
42
  * --------------------------------------------------------------------------
93
- * Bootstrap (v5.0.0-beta2): util/index.js
43
+ * Bootstrap (v5.0.2): util/index.js
94
44
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
95
45
  * --------------------------------------------------------------------------
96
46
  */
97
- var MAX_UID = 1000000;
98
- var MILLISECONDS_MULTIPLIER = 1000;
99
- var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
100
47
 
101
- var toType = function toType(obj) {
48
+ const MAX_UID = 1000000;
49
+
50
+ const toType = obj => {
102
51
  if (obj === null || obj === undefined) {
103
- return "" + obj;
52
+ return `${obj}`;
104
53
  }
105
54
 
106
55
  return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
@@ -112,7 +61,7 @@
112
61
  */
113
62
 
114
63
 
115
- var getUID = function getUID(prefix) {
64
+ const getUID = prefix => {
116
65
  do {
117
66
  prefix += Math.floor(Math.random() * MAX_UID);
118
67
  } while (document.getElementById(prefix));
@@ -120,75 +69,51 @@
120
69
  return prefix;
121
70
  };
122
71
 
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
- };
72
+ const isElement = obj => {
73
+ if (!obj || typeof obj !== 'object') {
74
+ return false;
75
+ }
145
76
 
146
- var triggerTransitionEnd = function triggerTransitionEnd(element) {
147
- element.dispatchEvent(new Event(TRANSITION_END));
148
- };
77
+ if (typeof obj.jquery !== 'undefined') {
78
+ obj = obj[0];
79
+ }
149
80
 
150
- var isElement = function isElement(obj) {
151
- return (obj[0] || obj).nodeType;
81
+ return typeof obj.nodeType !== 'undefined';
152
82
  };
153
83
 
154
- var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
155
- var called = false;
156
- var durationPadding = 5;
157
- var emulatedDuration = duration + durationPadding;
84
+ const getElement = obj => {
85
+ if (isElement(obj)) {
86
+ // it's a jQuery object or a node element
87
+ return obj.jquery ? obj[0] : obj;
88
+ }
158
89
 
159
- function listener() {
160
- called = true;
161
- element.removeEventListener(TRANSITION_END, listener);
90
+ if (typeof obj === 'string' && obj.length > 0) {
91
+ return SelectorEngine__default['default'].findOne(obj);
162
92
  }
163
93
 
164
- element.addEventListener(TRANSITION_END, listener);
165
- setTimeout(function () {
166
- if (!called) {
167
- triggerTransitionEnd(element);
168
- }
169
- }, emulatedDuration);
94
+ return null;
170
95
  };
171
96
 
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);
97
+ const typeCheckConfig = (componentName, config, configTypes) => {
98
+ Object.keys(configTypes).forEach(property => {
99
+ const expectedTypes = configTypes[property];
100
+ const value = config[property];
101
+ const valueType = value && isElement(value) ? 'element' : toType(value);
177
102
 
178
103
  if (!new RegExp(expectedTypes).test(valueType)) {
179
- throw new TypeError(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
104
+ throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
180
105
  }
181
106
  });
182
107
  };
183
108
 
184
- var findShadowRoot = function findShadowRoot(element) {
109
+ const findShadowRoot = element => {
185
110
  if (!document.documentElement.attachShadow) {
186
111
  return null;
187
112
  } // Can find the shadow root otherwise it'll return the document
188
113
 
189
114
 
190
115
  if (typeof element.getRootNode === 'function') {
191
- var root = element.getRootNode();
116
+ const root = element.getRootNode();
192
117
  return root instanceof ShadowRoot ? root : null;
193
118
  }
194
119
 
@@ -204,13 +129,12 @@
204
129
  return findShadowRoot(element.parentNode);
205
130
  };
206
131
 
207
- var noop = function noop() {
208
- return function () {};
209
- };
132
+ const noop = () => {};
210
133
 
211
- var getjQuery = function getjQuery() {
212
- var _window = window,
213
- jQuery = _window.jQuery;
134
+ const getjQuery = () => {
135
+ const {
136
+ jQuery
137
+ } = window;
214
138
 
215
139
  if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
216
140
  return jQuery;
@@ -219,27 +143,37 @@
219
143
  return null;
220
144
  };
221
145
 
222
- var onDOMContentLoaded = function onDOMContentLoaded(callback) {
146
+ const DOMContentLoadedCallbacks = [];
147
+
148
+ const onDOMContentLoaded = callback => {
223
149
  if (document.readyState === 'loading') {
224
- document.addEventListener('DOMContentLoaded', callback);
150
+ // add listener on the first call when the document is in loading state
151
+ if (!DOMContentLoadedCallbacks.length) {
152
+ document.addEventListener('DOMContentLoaded', () => {
153
+ DOMContentLoadedCallbacks.forEach(callback => callback());
154
+ });
155
+ }
156
+
157
+ DOMContentLoadedCallbacks.push(callback);
225
158
  } else {
226
159
  callback();
227
160
  }
228
161
  };
229
162
 
230
- var isRTL = document.documentElement.dir === 'rtl';
163
+ const isRTL = () => document.documentElement.dir === 'rtl';
231
164
 
232
- var defineJQueryPlugin = function defineJQueryPlugin(name, plugin) {
233
- onDOMContentLoaded(function () {
234
- var $ = getjQuery();
165
+ const defineJQueryPlugin = plugin => {
166
+ onDOMContentLoaded(() => {
167
+ const $ = getjQuery();
235
168
  /* istanbul ignore if */
236
169
 
237
170
  if ($) {
238
- var JQUERY_NO_CONFLICT = $.fn[name];
171
+ const name = plugin.NAME;
172
+ const JQUERY_NO_CONFLICT = $.fn[name];
239
173
  $.fn[name] = plugin.jQueryInterface;
240
174
  $.fn[name].Constructor = plugin;
241
175
 
242
- $.fn[name].noConflict = function () {
176
+ $.fn[name].noConflict = () => {
243
177
  $.fn[name] = JQUERY_NO_CONFLICT;
244
178
  return plugin.jQueryInterface;
245
179
  };
@@ -249,29 +183,29 @@
249
183
 
250
184
  /**
251
185
  * --------------------------------------------------------------------------
252
- * Bootstrap (v5.0.0-beta2): util/sanitizer.js
186
+ * Bootstrap (v5.0.2): util/sanitizer.js
253
187
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
254
188
  * --------------------------------------------------------------------------
255
189
  */
256
- var uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
257
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
190
+ const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
191
+ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
258
192
  /**
259
193
  * A pattern that recognizes a commonly useful subset of URLs that are safe.
260
194
  *
261
195
  * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
262
196
  */
263
197
 
264
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
198
+ const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
265
199
  /**
266
200
  * A pattern that matches safe data URLs. Only matches image, video and audio types.
267
201
  *
268
202
  * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
269
203
  */
270
204
 
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;
205
+ const 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;
272
206
 
273
- var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
274
- var attrName = attr.nodeName.toLowerCase();
207
+ const allowedAttribute = (attr, allowedAttributeList) => {
208
+ const attrName = attr.nodeName.toLowerCase();
275
209
 
276
210
  if (allowedAttributeList.includes(attrName)) {
277
211
  if (uriAttrs.has(attrName)) {
@@ -281,11 +215,9 @@
281
215
  return true;
282
216
  }
283
217
 
284
- var regExp = allowedAttributeList.filter(function (attrRegex) {
285
- return attrRegex instanceof RegExp;
286
- }); // Check if a regular expression validates the attribute.
218
+ const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.
287
219
 
288
- for (var i = 0, len = regExp.length; i < len; i++) {
220
+ for (let i = 0, len = regExp.length; i < len; i++) {
289
221
  if (regExp[i].test(attrName)) {
290
222
  return true;
291
223
  }
@@ -294,7 +226,7 @@
294
226
  return false;
295
227
  };
296
228
 
297
- var DefaultAllowlist = {
229
+ const DefaultAllowlist = {
298
230
  // Global attributes allowed on any supplied element below.
299
231
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
300
232
  a: ['target', 'href', 'title', 'rel'],
@@ -328,8 +260,6 @@
328
260
  ul: []
329
261
  };
330
262
  function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
331
- var _ref;
332
-
333
263
  if (!unsafeHtml.length) {
334
264
  return unsafeHtml;
335
265
  }
@@ -338,55 +268,51 @@
338
268
  return sanitizeFn(unsafeHtml);
339
269
  }
340
270
 
341
- var domParser = new window.DOMParser();
342
- var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
343
- var allowlistKeys = Object.keys(allowList);
344
-
345
- var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
346
-
347
- var _loop = function _loop(i, len) {
348
- var _ref2;
271
+ const domParser = new window.DOMParser();
272
+ const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
273
+ const allowlistKeys = Object.keys(allowList);
274
+ const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
349
275
 
350
- var el = elements[i];
351
- var elName = el.nodeName.toLowerCase();
276
+ for (let i = 0, len = elements.length; i < len; i++) {
277
+ const el = elements[i];
278
+ const elName = el.nodeName.toLowerCase();
352
279
 
353
280
  if (!allowlistKeys.includes(elName)) {
354
- el.parentNode.removeChild(el);
355
- return "continue";
281
+ el.remove();
282
+ continue;
356
283
  }
357
284
 
358
- var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
359
-
360
- var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
361
- attributeList.forEach(function (attr) {
285
+ const attributeList = [].concat(...el.attributes);
286
+ const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
287
+ attributeList.forEach(attr => {
362
288
  if (!allowedAttribute(attr, allowedAttributes)) {
363
289
  el.removeAttribute(attr.nodeName);
364
290
  }
365
291
  });
366
- };
367
-
368
- for (var i = 0, len = elements.length; i < len; i++) {
369
- var _ret = _loop(i);
370
-
371
- if (_ret === "continue") continue;
372
292
  }
373
293
 
374
294
  return createdDocument.body.innerHTML;
375
295
  }
376
296
 
297
+ /**
298
+ * --------------------------------------------------------------------------
299
+ * Bootstrap (v5.0.2): tooltip.js
300
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
301
+ * --------------------------------------------------------------------------
302
+ */
377
303
  /**
378
304
  * ------------------------------------------------------------------------
379
305
  * Constants
380
306
  * ------------------------------------------------------------------------
381
307
  */
382
308
 
383
- var NAME = 'tooltip';
384
- var DATA_KEY = 'bs.tooltip';
385
- var EVENT_KEY = "." + DATA_KEY;
386
- var CLASS_PREFIX = 'bs-tooltip';
387
- var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
388
- var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
389
- var DefaultType = {
309
+ const NAME = 'tooltip';
310
+ const DATA_KEY = 'bs.tooltip';
311
+ const EVENT_KEY = `.${DATA_KEY}`;
312
+ const CLASS_PREFIX = 'bs-tooltip';
313
+ const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
314
+ const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
315
+ const DefaultType = {
390
316
  animation: 'boolean',
391
317
  template: 'string',
392
318
  title: '(string|element|function)',
@@ -405,14 +331,14 @@
405
331
  allowList: 'object',
406
332
  popperConfig: '(null|object|function)'
407
333
  };
408
- var AttachmentMap = {
334
+ const AttachmentMap = {
409
335
  AUTO: 'auto',
410
336
  TOP: 'top',
411
- RIGHT: isRTL ? 'left' : 'right',
337
+ RIGHT: isRTL() ? 'left' : 'right',
412
338
  BOTTOM: 'bottom',
413
- LEFT: isRTL ? 'right' : 'left'
339
+ LEFT: isRTL() ? 'right' : 'left'
414
340
  };
415
- var Default = {
341
+ const Default = {
416
342
  animation: true,
417
343
  template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
418
344
  trigger: 'hover focus',
@@ -431,83 +357,91 @@
431
357
  allowList: DefaultAllowlist,
432
358
  popperConfig: null
433
359
  };
434
- var Event$1 = {
435
- HIDE: "hide" + EVENT_KEY,
436
- HIDDEN: "hidden" + EVENT_KEY,
437
- SHOW: "show" + EVENT_KEY,
438
- SHOWN: "shown" + EVENT_KEY,
439
- INSERTED: "inserted" + EVENT_KEY,
440
- CLICK: "click" + EVENT_KEY,
441
- FOCUSIN: "focusin" + EVENT_KEY,
442
- FOCUSOUT: "focusout" + EVENT_KEY,
443
- MOUSEENTER: "mouseenter" + EVENT_KEY,
444
- MOUSELEAVE: "mouseleave" + EVENT_KEY
360
+ const Event = {
361
+ HIDE: `hide${EVENT_KEY}`,
362
+ HIDDEN: `hidden${EVENT_KEY}`,
363
+ SHOW: `show${EVENT_KEY}`,
364
+ SHOWN: `shown${EVENT_KEY}`,
365
+ INSERTED: `inserted${EVENT_KEY}`,
366
+ CLICK: `click${EVENT_KEY}`,
367
+ FOCUSIN: `focusin${EVENT_KEY}`,
368
+ FOCUSOUT: `focusout${EVENT_KEY}`,
369
+ MOUSEENTER: `mouseenter${EVENT_KEY}`,
370
+ MOUSELEAVE: `mouseleave${EVENT_KEY}`
445
371
  };
446
- var CLASS_NAME_FADE = 'fade';
447
- var CLASS_NAME_MODAL = 'modal';
448
- var CLASS_NAME_SHOW = 'show';
449
- var HOVER_STATE_SHOW = 'show';
450
- var HOVER_STATE_OUT = 'out';
451
- var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
452
- var TRIGGER_HOVER = 'hover';
453
- var TRIGGER_FOCUS = 'focus';
454
- var TRIGGER_CLICK = 'click';
455
- var TRIGGER_MANUAL = 'manual';
372
+ const CLASS_NAME_FADE = 'fade';
373
+ const CLASS_NAME_MODAL = 'modal';
374
+ const CLASS_NAME_SHOW = 'show';
375
+ const HOVER_STATE_SHOW = 'show';
376
+ const HOVER_STATE_OUT = 'out';
377
+ const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
378
+ const TRIGGER_HOVER = 'hover';
379
+ const TRIGGER_FOCUS = 'focus';
380
+ const TRIGGER_CLICK = 'click';
381
+ const TRIGGER_MANUAL = 'manual';
456
382
  /**
457
383
  * ------------------------------------------------------------------------
458
384
  * Class Definition
459
385
  * ------------------------------------------------------------------------
460
386
  */
461
387
 
462
- var Tooltip = /*#__PURE__*/function (_BaseComponent) {
463
- _inheritsLoose(Tooltip, _BaseComponent);
464
-
465
- function Tooltip(element, config) {
466
- var _this;
467
-
388
+ class Tooltip extends BaseComponent__default['default'] {
389
+ constructor(element, config) {
468
390
  if (typeof Popper__namespace === 'undefined') {
469
391
  throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
470
392
  }
471
393
 
472
- _this = _BaseComponent.call(this, element) || this; // private
394
+ super(element); // private
473
395
 
474
- _this._isEnabled = true;
475
- _this._timeout = 0;
476
- _this._hoverState = '';
477
- _this._activeTrigger = {};
478
- _this._popper = null; // Protected
479
-
480
- _this.config = _this._getConfig(config);
481
- _this.tip = null;
396
+ this._isEnabled = true;
397
+ this._timeout = 0;
398
+ this._hoverState = '';
399
+ this._activeTrigger = {};
400
+ this._popper = null; // Protected
482
401
 
483
- _this._setListeners();
402
+ this._config = this._getConfig(config);
403
+ this.tip = null;
484
404
 
485
- return _this;
405
+ this._setListeners();
486
406
  } // Getters
487
407
 
488
408
 
489
- var _proto = Tooltip.prototype;
409
+ static get Default() {
410
+ return Default;
411
+ }
412
+
413
+ static get NAME() {
414
+ return NAME;
415
+ }
416
+
417
+ static get Event() {
418
+ return Event;
419
+ }
490
420
 
491
- // Public
492
- _proto.enable = function enable() {
421
+ static get DefaultType() {
422
+ return DefaultType;
423
+ } // Public
424
+
425
+
426
+ enable() {
493
427
  this._isEnabled = true;
494
- };
428
+ }
495
429
 
496
- _proto.disable = function disable() {
430
+ disable() {
497
431
  this._isEnabled = false;
498
- };
432
+ }
499
433
 
500
- _proto.toggleEnabled = function toggleEnabled() {
434
+ toggleEnabled() {
501
435
  this._isEnabled = !this._isEnabled;
502
- };
436
+ }
503
437
 
504
- _proto.toggle = function toggle(event) {
438
+ toggle(event) {
505
439
  if (!this._isEnabled) {
506
440
  return;
507
441
  }
508
442
 
509
443
  if (event) {
510
- var context = this._initializeOnDelegatedTarget(event);
444
+ const context = this._initializeOnDelegatedTarget(event);
511
445
 
512
446
  context._activeTrigger.click = !context._activeTrigger.click;
513
447
 
@@ -525,36 +459,24 @@
525
459
 
526
460
  this._enter(null, this);
527
461
  }
528
- };
462
+ }
529
463
 
530
- _proto.dispose = function dispose() {
464
+ dispose() {
531
465
  clearTimeout(this._timeout);
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);
466
+ EventHandler__default['default'].off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
534
467
 
535
- if (this.tip && this.tip.parentNode) {
536
- this.tip.parentNode.removeChild(this.tip);
468
+ if (this.tip) {
469
+ this.tip.remove();
537
470
  }
538
471
 
539
- this._isEnabled = null;
540
- this._timeout = null;
541
- this._hoverState = null;
542
- this._activeTrigger = null;
543
-
544
472
  if (this._popper) {
545
473
  this._popper.destroy();
546
474
  }
547
475
 
548
- this._popper = null;
549
- this.config = null;
550
- this.tip = null;
551
-
552
- _BaseComponent.prototype.dispose.call(this);
553
- };
554
-
555
- _proto.show = function show() {
556
- var _this2 = this;
476
+ super.dispose();
477
+ }
557
478
 
479
+ show() {
558
480
  if (this._element.style.display === 'none') {
559
481
  throw new Error('Please use show on visible elements');
560
482
  }
@@ -563,49 +485,53 @@
563
485
  return;
564
486
  }
565
487
 
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);
488
+ const showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
489
+ const shadowRoot = findShadowRoot(this._element);
490
+ const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
569
491
 
570
492
  if (showEvent.defaultPrevented || !isInTheDom) {
571
493
  return;
572
494
  }
573
495
 
574
- var tip = this.getTipElement();
575
- var tipId = getUID(this.constructor.NAME);
496
+ const tip = this.getTipElement();
497
+ const tipId = getUID(this.constructor.NAME);
576
498
  tip.setAttribute('id', tipId);
577
499
 
578
500
  this._element.setAttribute('aria-describedby', tipId);
579
501
 
580
502
  this.setContent();
581
503
 
582
- if (this.config.animation) {
504
+ if (this._config.animation) {
583
505
  tip.classList.add(CLASS_NAME_FADE);
584
506
  }
585
507
 
586
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
508
+ const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
587
509
 
588
- var attachment = this._getAttachment(placement);
510
+ const attachment = this._getAttachment(placement);
589
511
 
590
512
  this._addAttachmentClass(attachment);
591
513
 
592
- var container = this._getContainer();
593
-
594
- Data__default['default'].setData(tip, this.constructor.DATA_KEY, this);
514
+ const {
515
+ container
516
+ } = this._config;
517
+ Data__default['default'].set(tip, this.constructor.DATA_KEY, this);
595
518
 
596
519
  if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
597
520
  container.appendChild(tip);
521
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
522
+ }
523
+
524
+ if (this._popper) {
525
+ this._popper.update();
526
+ } else {
527
+ this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
598
528
  }
599
529
 
600
- EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
601
- this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
602
530
  tip.classList.add(CLASS_NAME_SHOW);
603
- var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
531
+ const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass;
604
532
 
605
533
  if (customClass) {
606
- var _tip$classList;
607
-
608
- (_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
534
+ tip.classList.add(...customClass.split(' '));
609
535
  } // If this is a touch-enabled device we add extra
610
536
  // empty mouseover listeners to the body's immediate children;
611
537
  // only needed because of broken event delegation on iOS
@@ -613,60 +539,56 @@
613
539
 
614
540
 
615
541
  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());
542
+ [].concat(...document.body.children).forEach(element => {
543
+ EventHandler__default['default'].on(element, 'mouseover', noop);
620
544
  });
621
545
  }
622
546
 
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);
547
+ const complete = () => {
548
+ const prevHoverState = this._hoverState;
549
+ this._hoverState = null;
550
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOWN);
627
551
 
628
552
  if (prevHoverState === HOVER_STATE_OUT) {
629
- _this2._leave(null, _this2);
553
+ this._leave(null, this);
630
554
  }
631
555
  };
632
556
 
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();
639
- }
640
- };
557
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
641
558
 
642
- _proto.hide = function hide() {
643
- var _this3 = this;
559
+ this._queueCallback(complete, this.tip, isAnimated);
560
+ }
644
561
 
562
+ hide() {
645
563
  if (!this._popper) {
646
564
  return;
647
565
  }
648
566
 
649
- var tip = this.getTipElement();
567
+ const tip = this.getTipElement();
650
568
 
651
- var complete = function complete() {
652
- if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
653
- tip.parentNode.removeChild(tip);
569
+ const complete = () => {
570
+ if (this._isWithActiveTrigger()) {
571
+ return;
572
+ }
573
+
574
+ if (this._hoverState !== HOVER_STATE_SHOW) {
575
+ tip.remove();
654
576
  }
655
577
 
656
- _this3._cleanTipClass();
578
+ this._cleanTipClass();
657
579
 
658
- _this3._element.removeAttribute('aria-describedby');
580
+ this._element.removeAttribute('aria-describedby');
659
581
 
660
- EventHandler__default['default'].trigger(_this3._element, _this3.constructor.Event.HIDDEN);
582
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDDEN);
661
583
 
662
- if (_this3._popper) {
663
- _this3._popper.destroy();
584
+ if (this._popper) {
585
+ this._popper.destroy();
664
586
 
665
- _this3._popper = null;
587
+ this._popper = null;
666
588
  }
667
589
  };
668
590
 
669
- var hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
591
+ const hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
670
592
 
671
593
  if (hideEvent.defaultPrevented) {
672
594
  return;
@@ -676,68 +598,56 @@
676
598
  // empty mouseover listeners we added for iOS support
677
599
 
678
600
  if ('ontouchstart' in document.documentElement) {
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
- });
601
+ [].concat(...document.body.children).forEach(element => EventHandler__default['default'].off(element, 'mouseover', noop));
684
602
  }
685
603
 
686
604
  this._activeTrigger[TRIGGER_CLICK] = false;
687
605
  this._activeTrigger[TRIGGER_FOCUS] = false;
688
606
  this._activeTrigger[TRIGGER_HOVER] = false;
607
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
689
608
 
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);
694
- } else {
695
- complete();
696
- }
609
+ this._queueCallback(complete, this.tip, isAnimated);
697
610
 
698
611
  this._hoverState = '';
699
- };
612
+ }
700
613
 
701
- _proto.update = function update() {
614
+ update() {
702
615
  if (this._popper !== null) {
703
616
  this._popper.update();
704
617
  }
705
618
  } // Protected
706
- ;
707
619
 
708
- _proto.isWithContent = function isWithContent() {
620
+
621
+ isWithContent() {
709
622
  return Boolean(this.getTitle());
710
- };
623
+ }
711
624
 
712
- _proto.getTipElement = function getTipElement() {
625
+ getTipElement() {
713
626
  if (this.tip) {
714
627
  return this.tip;
715
628
  }
716
629
 
717
- var element = document.createElement('div');
718
- element.innerHTML = this.config.template;
630
+ const element = document.createElement('div');
631
+ element.innerHTML = this._config.template;
719
632
  this.tip = element.children[0];
720
633
  return this.tip;
721
- };
634
+ }
722
635
 
723
- _proto.setContent = function setContent() {
724
- var tip = this.getTipElement();
636
+ setContent() {
637
+ const tip = this.getTipElement();
725
638
  this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
726
639
  tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
727
- };
640
+ }
728
641
 
729
- _proto.setElementContent = function setElementContent(element, content) {
642
+ setElementContent(element, content) {
730
643
  if (element === null) {
731
644
  return;
732
645
  }
733
646
 
734
- if (typeof content === 'object' && isElement(content)) {
735
- if (content.jquery) {
736
- content = content[0];
737
- } // content is a DOM node or a jQuery
647
+ if (isElement(content)) {
648
+ content = getElement(content); // content is a DOM node or a jQuery
738
649
 
739
-
740
- if (this.config.html) {
650
+ if (this._config.html) {
741
651
  if (content.parentNode !== element) {
742
652
  element.innerHTML = '';
743
653
  element.appendChild(content);
@@ -749,28 +659,28 @@
749
659
  return;
750
660
  }
751
661
 
752
- if (this.config.html) {
753
- if (this.config.sanitize) {
754
- content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
662
+ if (this._config.html) {
663
+ if (this._config.sanitize) {
664
+ content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
755
665
  }
756
666
 
757
667
  element.innerHTML = content;
758
668
  } else {
759
669
  element.textContent = content;
760
670
  }
761
- };
671
+ }
762
672
 
763
- _proto.getTitle = function getTitle() {
764
- var title = this._element.getAttribute('data-bs-original-title');
673
+ getTitle() {
674
+ let title = this._element.getAttribute('data-bs-original-title');
765
675
 
766
676
  if (!title) {
767
- title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
677
+ title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
768
678
  }
769
679
 
770
680
  return title;
771
- };
681
+ }
772
682
 
773
- _proto.updateAttachment = function updateAttachment(attachment) {
683
+ updateAttachment(attachment) {
774
684
  if (attachment === 'right') {
775
685
  return 'end';
776
686
  }
@@ -781,50 +691,43 @@
781
691
 
782
692
  return attachment;
783
693
  } // Private
784
- ;
785
694
 
786
- _proto._initializeOnDelegatedTarget = function _initializeOnDelegatedTarget(event, context) {
787
- var dataKey = this.constructor.DATA_KEY;
788
- context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
695
+
696
+ _initializeOnDelegatedTarget(event, context) {
697
+ const dataKey = this.constructor.DATA_KEY;
698
+ context = context || Data__default['default'].get(event.delegateTarget, dataKey);
789
699
 
790
700
  if (!context) {
791
701
  context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
792
- Data__default['default'].setData(event.delegateTarget, dataKey, context);
702
+ Data__default['default'].set(event.delegateTarget, dataKey, context);
793
703
  }
794
704
 
795
705
  return context;
796
- };
797
-
798
- _proto._getOffset = function _getOffset() {
799
- var _this4 = this;
706
+ }
800
707
 
801
- var offset = this.config.offset;
708
+ _getOffset() {
709
+ const {
710
+ offset
711
+ } = this._config;
802
712
 
803
713
  if (typeof offset === 'string') {
804
- return offset.split(',').map(function (val) {
805
- return Number.parseInt(val, 10);
806
- });
714
+ return offset.split(',').map(val => Number.parseInt(val, 10));
807
715
  }
808
716
 
809
717
  if (typeof offset === 'function') {
810
- return function (popperData) {
811
- return offset(popperData, _this4._element);
812
- };
718
+ return popperData => offset(popperData, this._element);
813
719
  }
814
720
 
815
721
  return offset;
816
- };
817
-
818
- _proto._getPopperConfig = function _getPopperConfig(attachment) {
819
- var _this5 = this;
722
+ }
820
723
 
821
- var defaultBsPopperConfig = {
724
+ _getPopperConfig(attachment) {
725
+ const defaultBsPopperConfig = {
822
726
  placement: attachment,
823
727
  modifiers: [{
824
728
  name: 'flip',
825
729
  options: {
826
- altBoundary: true,
827
- fallbackPlacements: this.config.fallbackPlacements
730
+ fallbackPlacements: this._config.fallbackPlacements
828
731
  }
829
732
  }, {
830
733
  name: 'offset',
@@ -834,93 +737,74 @@
834
737
  }, {
835
738
  name: 'preventOverflow',
836
739
  options: {
837
- boundary: this.config.boundary
740
+ boundary: this._config.boundary
838
741
  }
839
742
  }, {
840
743
  name: 'arrow',
841
744
  options: {
842
- element: "." + this.constructor.NAME + "-arrow"
745
+ element: `.${this.constructor.NAME}-arrow`
843
746
  }
844
747
  }, {
845
748
  name: 'onChange',
846
749
  enabled: true,
847
750
  phase: 'afterWrite',
848
- fn: function fn(data) {
849
- return _this5._handlePopperPlacementChange(data);
850
- }
751
+ fn: data => this._handlePopperPlacementChange(data)
851
752
  }],
852
- onFirstUpdate: function onFirstUpdate(data) {
753
+ onFirstUpdate: data => {
853
754
  if (data.options.placement !== data.placement) {
854
- _this5._handlePopperPlacementChange(data);
755
+ this._handlePopperPlacementChange(data);
855
756
  }
856
757
  }
857
758
  };
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
-
865
- _proto._getContainer = function _getContainer() {
866
- if (this.config.container === false) {
867
- return document.body;
868
- }
869
-
870
- if (isElement(this.config.container)) {
871
- return this.config.container;
872
- }
759
+ return { ...defaultBsPopperConfig,
760
+ ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
761
+ };
762
+ }
873
763
 
874
- return SelectorEngine__default['default'].findOne(this.config.container);
875
- };
764
+ _addAttachmentClass(attachment) {
765
+ this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
766
+ }
876
767
 
877
- _proto._getAttachment = function _getAttachment(placement) {
768
+ _getAttachment(placement) {
878
769
  return AttachmentMap[placement.toUpperCase()];
879
- };
770
+ }
880
771
 
881
- _proto._setListeners = function _setListeners() {
882
- var _this6 = this;
772
+ _setListeners() {
773
+ const triggers = this._config.trigger.split(' ');
883
774
 
884
- var triggers = this.config.trigger.split(' ');
885
- triggers.forEach(function (trigger) {
775
+ triggers.forEach(trigger => {
886
776
  if (trigger === 'click') {
887
- EventHandler__default['default'].on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
888
- return _this6.toggle(event);
889
- });
777
+ EventHandler__default['default'].on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
890
778
  } else if (trigger !== TRIGGER_MANUAL) {
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);
898
- });
779
+ const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
780
+ const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
781
+ EventHandler__default['default'].on(this._element, eventIn, this._config.selector, event => this._enter(event));
782
+ EventHandler__default['default'].on(this._element, eventOut, this._config.selector, event => this._leave(event));
899
783
  }
900
784
  });
901
785
 
902
- this._hideModalHandler = function () {
903
- if (_this6._element) {
904
- _this6.hide();
786
+ this._hideModalHandler = () => {
787
+ if (this._element) {
788
+ this.hide();
905
789
  }
906
790
  };
907
791
 
908
- EventHandler__default['default'].on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
792
+ EventHandler__default['default'].on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
909
793
 
910
- if (this.config.selector) {
911
- this.config = _extends({}, this.config, {
794
+ if (this._config.selector) {
795
+ this._config = { ...this._config,
912
796
  trigger: 'manual',
913
797
  selector: ''
914
- });
798
+ };
915
799
  } else {
916
800
  this._fixTitle();
917
801
  }
918
- };
802
+ }
919
803
 
920
- _proto._fixTitle = function _fixTitle() {
921
- var title = this._element.getAttribute('title');
804
+ _fixTitle() {
805
+ const title = this._element.getAttribute('title');
922
806
 
923
- var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
807
+ const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
924
808
 
925
809
  if (title || originalTitleType !== 'string') {
926
810
  this._element.setAttribute('data-bs-original-title', title || '');
@@ -931,9 +815,9 @@
931
815
 
932
816
  this._element.setAttribute('title', '');
933
817
  }
934
- };
818
+ }
935
819
 
936
- _proto._enter = function _enter(event, context) {
820
+ _enter(event, context) {
937
821
  context = this._initializeOnDelegatedTarget(event, context);
938
822
 
939
823
  if (event) {
@@ -948,23 +832,23 @@
948
832
  clearTimeout(context._timeout);
949
833
  context._hoverState = HOVER_STATE_SHOW;
950
834
 
951
- if (!context.config.delay || !context.config.delay.show) {
835
+ if (!context._config.delay || !context._config.delay.show) {
952
836
  context.show();
953
837
  return;
954
838
  }
955
839
 
956
- context._timeout = setTimeout(function () {
840
+ context._timeout = setTimeout(() => {
957
841
  if (context._hoverState === HOVER_STATE_SHOW) {
958
842
  context.show();
959
843
  }
960
- }, context.config.delay.show);
961
- };
844
+ }, context._config.delay.show);
845
+ }
962
846
 
963
- _proto._leave = function _leave(event, context) {
847
+ _leave(event, context) {
964
848
  context = this._initializeOnDelegatedTarget(event, context);
965
849
 
966
850
  if (event) {
967
- context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
851
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
968
852
  }
969
853
 
970
854
  if (context._isWithActiveTrigger()) {
@@ -974,41 +858,40 @@
974
858
  clearTimeout(context._timeout);
975
859
  context._hoverState = HOVER_STATE_OUT;
976
860
 
977
- if (!context.config.delay || !context.config.delay.hide) {
861
+ if (!context._config.delay || !context._config.delay.hide) {
978
862
  context.hide();
979
863
  return;
980
864
  }
981
865
 
982
- context._timeout = setTimeout(function () {
866
+ context._timeout = setTimeout(() => {
983
867
  if (context._hoverState === HOVER_STATE_OUT) {
984
868
  context.hide();
985
869
  }
986
- }, context.config.delay.hide);
987
- };
870
+ }, context._config.delay.hide);
871
+ }
988
872
 
989
- _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
990
- for (var trigger in this._activeTrigger) {
873
+ _isWithActiveTrigger() {
874
+ for (const trigger in this._activeTrigger) {
991
875
  if (this._activeTrigger[trigger]) {
992
876
  return true;
993
877
  }
994
878
  }
995
879
 
996
880
  return false;
997
- };
881
+ }
998
882
 
999
- _proto._getConfig = function _getConfig(config) {
1000
- var dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
1001
- Object.keys(dataAttributes).forEach(function (dataAttr) {
883
+ _getConfig(config) {
884
+ const dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
885
+ Object.keys(dataAttributes).forEach(dataAttr => {
1002
886
  if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
1003
887
  delete dataAttributes[dataAttr];
1004
888
  }
1005
889
  });
1006
-
1007
- if (config && typeof config.container === 'object' && config.container.jquery) {
1008
- config.container = config.container[0];
1009
- }
1010
-
1011
- config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
890
+ config = { ...this.constructor.Default,
891
+ ...dataAttributes,
892
+ ...(typeof config === 'object' && config ? config : {})
893
+ };
894
+ config.container = config.container === false ? document.body : getElement(config.container);
1012
895
 
1013
896
  if (typeof config.delay === 'number') {
1014
897
  config.delay = {
@@ -1032,37 +915,35 @@
1032
915
  }
1033
916
 
1034
917
  return config;
1035
- };
918
+ }
1036
919
 
1037
- _proto._getDelegateConfig = function _getDelegateConfig() {
1038
- var config = {};
920
+ _getDelegateConfig() {
921
+ const config = {};
1039
922
 
1040
- if (this.config) {
1041
- for (var key in this.config) {
1042
- if (this.constructor.Default[key] !== this.config[key]) {
1043
- config[key] = this.config[key];
923
+ if (this._config) {
924
+ for (const key in this._config) {
925
+ if (this.constructor.Default[key] !== this._config[key]) {
926
+ config[key] = this._config[key];
1044
927
  }
1045
928
  }
1046
929
  }
1047
930
 
1048
931
  return config;
1049
- };
932
+ }
1050
933
 
1051
- _proto._cleanTipClass = function _cleanTipClass() {
1052
- var tip = this.getTipElement();
1053
- var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
934
+ _cleanTipClass() {
935
+ const tip = this.getTipElement();
936
+ const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
1054
937
 
1055
938
  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
- });
939
+ tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
1061
940
  }
1062
- };
941
+ }
1063
942
 
1064
- _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
1065
- var state = popperData.state;
943
+ _handlePopperPlacementChange(popperData) {
944
+ const {
945
+ state
946
+ } = popperData;
1066
947
 
1067
948
  if (!state) {
1068
949
  return;
@@ -1074,66 +955,23 @@
1074
955
 
1075
956
  this._addAttachmentClass(this._getAttachment(state.placement));
1076
957
  } // Static
1077
- ;
1078
-
1079
- Tooltip.jQueryInterface = function jQueryInterface(config) {
1080
- return this.each(function () {
1081
- var data = Data__default['default'].getData(this, DATA_KEY);
1082
958
 
1083
- var _config = typeof config === 'object' && config;
1084
959
 
1085
- if (!data && /dispose|hide/.test(config)) {
1086
- return;
1087
- }
1088
-
1089
- if (!data) {
1090
- data = new Tooltip(this, _config);
1091
- }
960
+ static jQueryInterface(config) {
961
+ return this.each(function () {
962
+ const data = Tooltip.getOrCreateInstance(this, config);
1092
963
 
1093
964
  if (typeof config === 'string') {
1094
965
  if (typeof data[config] === 'undefined') {
1095
- throw new TypeError("No method named \"" + config + "\"");
966
+ throw new TypeError(`No method named "${config}"`);
1096
967
  }
1097
968
 
1098
969
  data[config]();
1099
970
  }
1100
971
  });
1101
- };
1102
-
1103
- _createClass(Tooltip, null, [{
1104
- key: "Default",
1105
- get: function get() {
1106
- return Default;
1107
- }
1108
- }, {
1109
- key: "NAME",
1110
- get: function get() {
1111
- return NAME;
1112
- }
1113
- }, {
1114
- key: "DATA_KEY",
1115
- get: function get() {
1116
- return DATA_KEY;
1117
- }
1118
- }, {
1119
- key: "Event",
1120
- get: function get() {
1121
- return Event$1;
1122
- }
1123
- }, {
1124
- key: "EVENT_KEY",
1125
- get: function get() {
1126
- return EVENT_KEY;
1127
- }
1128
- }, {
1129
- key: "DefaultType",
1130
- get: function get() {
1131
- return DefaultType;
1132
- }
1133
- }]);
972
+ }
1134
973
 
1135
- return Tooltip;
1136
- }(BaseComponent__default['default']);
974
+ }
1137
975
  /**
1138
976
  * ------------------------------------------------------------------------
1139
977
  * jQuery
@@ -1142,7 +980,7 @@
1142
980
  */
1143
981
 
1144
982
 
1145
- defineJQueryPlugin(NAME, Tooltip);
983
+ defineJQueryPlugin(Tooltip);
1146
984
 
1147
985
  return Tooltip;
1148
986