bootstrap 5.0.0 → 5.0.1

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +8 -8
  4. data/assets/javascripts/bootstrap.js +329 -377
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +13 -73
  7. data/assets/javascripts/bootstrap/base-component.js +115 -10
  8. data/assets/javascripts/bootstrap/button.js +11 -17
  9. data/assets/javascripts/bootstrap/carousel.js +35 -85
  10. data/assets/javascripts/bootstrap/collapse.js +34 -82
  11. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +2 -9
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
  15. data/assets/javascripts/bootstrap/dropdown.js +41 -38
  16. data/assets/javascripts/bootstrap/modal.js +31 -43
  17. data/assets/javascripts/bootstrap/offcanvas.js +25 -25
  18. data/assets/javascripts/bootstrap/popover.js +11 -25
  19. data/assets/javascripts/bootstrap/scrollspy.js +26 -21
  20. data/assets/javascripts/bootstrap/tab.js +14 -68
  21. data/assets/javascripts/bootstrap/toast.js +69 -77
  22. data/assets/javascripts/bootstrap/tooltip.js +71 -135
  23. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  25. data/assets/stylesheets/_bootstrap.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_list-group.scss +5 -5
  27. data/assets/stylesheets/bootstrap/_modal.scss +2 -11
  28. data/assets/stylesheets/bootstrap/_tables.scss +1 -0
  29. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  30. data/assets/stylesheets/bootstrap/forms/_form-control.scss +5 -5
  31. data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -1
  32. data/lib/bootstrap/version.rb +2 -2
  33. metadata +2 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap toast.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap toast.js v5.0.1 (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
  */
@@ -16,15 +16,6 @@
16
16
  var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
17
  var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
18
18
 
19
- /**
20
- * --------------------------------------------------------------------------
21
- * Bootstrap (v5.0.0): util/index.js
22
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
23
- * --------------------------------------------------------------------------
24
- */
25
- const MILLISECONDS_MULTIPLIER = 1000;
26
- const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
27
-
28
19
  const toType = obj => {
29
20
  if (obj === null || obj === undefined) {
30
21
  return `${obj}`;
@@ -33,51 +24,16 @@
33
24
  return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
34
25
  };
35
26
 
36
- const getTransitionDurationFromElement = element => {
37
- if (!element) {
38
- return 0;
39
- } // Get transition-duration of the element
40
-
41
-
42
- let {
43
- transitionDuration,
44
- transitionDelay
45
- } = window.getComputedStyle(element);
46
- const floatTransitionDuration = Number.parseFloat(transitionDuration);
47
- const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
48
-
49
- if (!floatTransitionDuration && !floatTransitionDelay) {
50
- return 0;
51
- } // If multiple durations are defined, take the first
52
-
53
-
54
- transitionDuration = transitionDuration.split(',')[0];
55
- transitionDelay = transitionDelay.split(',')[0];
56
- return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
57
- };
58
-
59
- const triggerTransitionEnd = element => {
60
- element.dispatchEvent(new Event(TRANSITION_END));
61
- };
62
-
63
- const isElement = obj => (obj[0] || obj).nodeType;
64
-
65
- const emulateTransitionEnd = (element, duration) => {
66
- let called = false;
67
- const durationPadding = 5;
68
- const emulatedDuration = duration + durationPadding;
27
+ const isElement = obj => {
28
+ if (!obj || typeof obj !== 'object') {
29
+ return false;
30
+ }
69
31
 
70
- function listener() {
71
- called = true;
72
- element.removeEventListener(TRANSITION_END, listener);
32
+ if (typeof obj.jquery !== 'undefined') {
33
+ obj = obj[0];
73
34
  }
74
35
 
75
- element.addEventListener(TRANSITION_END, listener);
76
- setTimeout(() => {
77
- if (!called) {
78
- triggerTransitionEnd(element);
79
- }
80
- }, emulatedDuration);
36
+ return typeof obj.nodeType !== 'undefined';
81
37
  };
82
38
 
83
39
  const typeCheckConfig = (componentName, config, configTypes) => {
@@ -114,12 +70,13 @@
114
70
  }
115
71
  };
116
72
 
117
- const defineJQueryPlugin = (name, plugin) => {
73
+ const defineJQueryPlugin = plugin => {
118
74
  onDOMContentLoaded(() => {
119
75
  const $ = getjQuery();
120
76
  /* istanbul ignore if */
121
77
 
122
78
  if ($) {
79
+ const name = plugin.NAME;
123
80
  const JQUERY_NO_CONFLICT = $.fn[name];
124
81
  $.fn[name] = plugin.jQueryInterface;
125
82
  $.fn[name].Constructor = plugin;
@@ -134,7 +91,7 @@
134
91
 
135
92
  /**
136
93
  * --------------------------------------------------------------------------
137
- * Bootstrap (v5.0.0): toast.js
94
+ * Bootstrap (v5.0.1): toast.js
138
95
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
139
96
  * --------------------------------------------------------------------------
140
97
  */
@@ -148,6 +105,10 @@
148
105
  const DATA_KEY = 'bs.toast';
149
106
  const EVENT_KEY = `.${DATA_KEY}`;
150
107
  const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
108
+ const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
109
+ const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
110
+ const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
111
+ const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
151
112
  const EVENT_HIDE = `hide${EVENT_KEY}`;
152
113
  const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
153
114
  const EVENT_SHOW = `show${EVENT_KEY}`;
@@ -178,6 +139,8 @@
178
139
  super(element);
179
140
  this._config = this._getConfig(config);
180
141
  this._timeout = null;
142
+ this._hasMouseInteraction = false;
143
+ this._hasKeyboardInteraction = false;
181
144
 
182
145
  this._setListeners();
183
146
  } // Getters
@@ -191,8 +154,8 @@
191
154
  return Default;
192
155
  }
193
156
 
194
- static get DATA_KEY() {
195
- return DATA_KEY;
157
+ static get NAME() {
158
+ return NAME;
196
159
  } // Public
197
160
 
198
161
 
@@ -216,11 +179,7 @@
216
179
 
217
180
  EventHandler__default['default'].trigger(this._element, EVENT_SHOWN);
218
181
 
219
- if (this._config.autohide) {
220
- this._timeout = setTimeout(() => {
221
- this.hide();
222
- }, this._config.delay);
223
- }
182
+ this._maybeScheduleHide();
224
183
  };
225
184
 
226
185
  this._element.classList.remove(CLASS_NAME_HIDE);
@@ -229,13 +188,7 @@
229
188
 
230
189
  this._element.classList.add(CLASS_NAME_SHOWING);
231
190
 
232
- if (this._config.animation) {
233
- const transitionDuration = getTransitionDurationFromElement(this._element);
234
- EventHandler__default['default'].one(this._element, 'transitionend', complete);
235
- emulateTransitionEnd(this._element, transitionDuration);
236
- } else {
237
- complete();
238
- }
191
+ this._queueCallback(complete, this._element, this._config.animation);
239
192
  }
240
193
 
241
194
  hide() {
@@ -257,13 +210,7 @@
257
210
 
258
211
  this._element.classList.remove(CLASS_NAME_SHOW);
259
212
 
260
- if (this._config.animation) {
261
- const transitionDuration = getTransitionDurationFromElement(this._element);
262
- EventHandler__default['default'].one(this._element, 'transitionend', complete);
263
- emulateTransitionEnd(this._element, transitionDuration);
264
- } else {
265
- complete();
266
- }
213
+ this._queueCallback(complete, this._element, this._config.animation);
267
214
  }
268
215
 
269
216
  dispose() {
@@ -274,7 +221,6 @@
274
221
  }
275
222
 
276
223
  super.dispose();
277
- this._config = null;
278
224
  } // Private
279
225
 
280
226
 
@@ -287,8 +233,54 @@
287
233
  return config;
288
234
  }
289
235
 
236
+ _maybeScheduleHide() {
237
+ if (!this._config.autohide) {
238
+ return;
239
+ }
240
+
241
+ if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
242
+ return;
243
+ }
244
+
245
+ this._timeout = setTimeout(() => {
246
+ this.hide();
247
+ }, this._config.delay);
248
+ }
249
+
250
+ _onInteraction(event, isInteracting) {
251
+ switch (event.type) {
252
+ case 'mouseover':
253
+ case 'mouseout':
254
+ this._hasMouseInteraction = isInteracting;
255
+ break;
256
+
257
+ case 'focusin':
258
+ case 'focusout':
259
+ this._hasKeyboardInteraction = isInteracting;
260
+ break;
261
+ }
262
+
263
+ if (isInteracting) {
264
+ this._clearTimeout();
265
+
266
+ return;
267
+ }
268
+
269
+ const nextElement = event.relatedTarget;
270
+
271
+ if (this._element === nextElement || this._element.contains(nextElement)) {
272
+ return;
273
+ }
274
+
275
+ this._maybeScheduleHide();
276
+ }
277
+
290
278
  _setListeners() {
291
279
  EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
280
+ EventHandler__default['default'].on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
281
+ EventHandler__default['default'].on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
282
+ EventHandler__default['default'].on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
283
+ EventHandler__default['default'].on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
292
284
  }
293
285
 
294
286
  _clearTimeout() {
@@ -326,7 +318,7 @@
326
318
  */
327
319
 
328
320
 
329
- defineJQueryPlugin(NAME, Toast);
321
+ defineJQueryPlugin(Toast);
330
322
 
331
323
  return Toast;
332
324
 
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v5.0.0 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.1 (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,21 +32,20 @@
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
41
  /**
42
42
  * --------------------------------------------------------------------------
43
- * Bootstrap (v5.0.0): util/index.js
43
+ * Bootstrap (v5.0.1): util/index.js
44
44
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
45
45
  * --------------------------------------------------------------------------
46
46
  */
47
+
47
48
  const MAX_UID = 1000000;
48
- const MILLISECONDS_MULTIPLIER = 1000;
49
- const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
50
49
 
51
50
  const toType = obj => {
52
51
  if (obj === null || obj === undefined) {
@@ -70,51 +69,29 @@
70
69
  return prefix;
71
70
  };
72
71
 
73
- const getTransitionDurationFromElement = element => {
74
- if (!element) {
75
- return 0;
76
- } // Get transition-duration of the element
77
-
78
-
79
- let {
80
- transitionDuration,
81
- transitionDelay
82
- } = window.getComputedStyle(element);
83
- const floatTransitionDuration = Number.parseFloat(transitionDuration);
84
- const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
85
-
86
- if (!floatTransitionDuration && !floatTransitionDelay) {
87
- return 0;
88
- } // If multiple durations are defined, take the first
89
-
72
+ const isElement = obj => {
73
+ if (!obj || typeof obj !== 'object') {
74
+ return false;
75
+ }
90
76
 
91
- transitionDuration = transitionDuration.split(',')[0];
92
- transitionDelay = transitionDelay.split(',')[0];
93
- return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
94
- };
77
+ if (typeof obj.jquery !== 'undefined') {
78
+ obj = obj[0];
79
+ }
95
80
 
96
- const triggerTransitionEnd = element => {
97
- element.dispatchEvent(new Event(TRANSITION_END));
81
+ return typeof obj.nodeType !== 'undefined';
98
82
  };
99
83
 
100
- const isElement = obj => (obj[0] || obj).nodeType;
101
-
102
- const emulateTransitionEnd = (element, duration) => {
103
- let called = false;
104
- const durationPadding = 5;
105
- const 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
+ }
106
89
 
107
- function listener() {
108
- called = true;
109
- element.removeEventListener(TRANSITION_END, listener);
90
+ if (typeof obj === 'string' && obj.length > 0) {
91
+ return SelectorEngine__default['default'].findOne(obj);
110
92
  }
111
93
 
112
- element.addEventListener(TRANSITION_END, listener);
113
- setTimeout(() => {
114
- if (!called) {
115
- triggerTransitionEnd(element);
116
- }
117
- }, emulatedDuration);
94
+ return null;
118
95
  };
119
96
 
120
97
  const typeCheckConfig = (componentName, config, configTypes) => {
@@ -176,12 +153,13 @@
176
153
 
177
154
  const isRTL = () => document.documentElement.dir === 'rtl';
178
155
 
179
- const defineJQueryPlugin = (name, plugin) => {
156
+ const defineJQueryPlugin = plugin => {
180
157
  onDOMContentLoaded(() => {
181
158
  const $ = getjQuery();
182
159
  /* istanbul ignore if */
183
160
 
184
161
  if ($) {
162
+ const name = plugin.NAME;
185
163
  const JQUERY_NO_CONFLICT = $.fn[name];
186
164
  $.fn[name] = plugin.jQueryInterface;
187
165
  $.fn[name].Constructor = plugin;
@@ -196,7 +174,7 @@
196
174
 
197
175
  /**
198
176
  * --------------------------------------------------------------------------
199
- * Bootstrap (v5.0.0): util/sanitizer.js
177
+ * Bootstrap (v5.0.1): util/sanitizer.js
200
178
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
201
179
  * --------------------------------------------------------------------------
202
180
  */
@@ -309,7 +287,7 @@
309
287
 
310
288
  /**
311
289
  * --------------------------------------------------------------------------
312
- * Bootstrap (v5.0.0): tooltip.js
290
+ * Bootstrap (v5.0.1): tooltip.js
313
291
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
314
292
  * --------------------------------------------------------------------------
315
293
  */
@@ -370,7 +348,7 @@
370
348
  allowList: DefaultAllowlist,
371
349
  popperConfig: null
372
350
  };
373
- const Event$1 = {
351
+ const Event = {
374
352
  HIDE: `hide${EVENT_KEY}`,
375
353
  HIDDEN: `hidden${EVENT_KEY}`,
376
354
  SHOW: `show${EVENT_KEY}`,
@@ -412,7 +390,7 @@
412
390
  this._activeTrigger = {};
413
391
  this._popper = null; // Protected
414
392
 
415
- this.config = this._getConfig(config);
393
+ this._config = this._getConfig(config);
416
394
  this.tip = null;
417
395
 
418
396
  this._setListeners();
@@ -427,16 +405,8 @@
427
405
  return NAME;
428
406
  }
429
407
 
430
- static get DATA_KEY() {
431
- return DATA_KEY;
432
- }
433
-
434
408
  static get Event() {
435
- return Event$1;
436
- }
437
-
438
- static get EVENT_KEY() {
439
- return EVENT_KEY;
409
+ return Event;
440
410
  }
441
411
 
442
412
  static get DefaultType() {
@@ -490,18 +460,10 @@
490
460
  this.tip.parentNode.removeChild(this.tip);
491
461
  }
492
462
 
493
- this._isEnabled = null;
494
- this._timeout = null;
495
- this._hoverState = null;
496
- this._activeTrigger = null;
497
-
498
463
  if (this._popper) {
499
464
  this._popper.destroy();
500
465
  }
501
466
 
502
- this._popper = null;
503
- this.config = null;
504
- this.tip = null;
505
467
  super.dispose();
506
468
  }
507
469
 
@@ -530,18 +492,19 @@
530
492
 
531
493
  this.setContent();
532
494
 
533
- if (this.config.animation) {
495
+ if (this._config.animation) {
534
496
  tip.classList.add(CLASS_NAME_FADE);
535
497
  }
536
498
 
537
- const placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
499
+ const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
538
500
 
539
501
  const attachment = this._getAttachment(placement);
540
502
 
541
503
  this._addAttachmentClass(attachment);
542
504
 
543
- const container = this._getContainer();
544
-
505
+ const {
506
+ container
507
+ } = this._config;
545
508
  Data__default['default'].set(tip, this.constructor.DATA_KEY, this);
546
509
 
547
510
  if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
@@ -556,7 +519,7 @@
556
519
  }
557
520
 
558
521
  tip.classList.add(CLASS_NAME_SHOW);
559
- const customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
522
+ const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass;
560
523
 
561
524
  if (customClass) {
562
525
  tip.classList.add(...customClass.split(' '));
@@ -582,13 +545,9 @@
582
545
  }
583
546
  };
584
547
 
585
- if (this.tip.classList.contains(CLASS_NAME_FADE)) {
586
- const transitionDuration = getTransitionDurationFromElement(this.tip);
587
- EventHandler__default['default'].one(this.tip, 'transitionend', complete);
588
- emulateTransitionEnd(this.tip, transitionDuration);
589
- } else {
590
- complete();
591
- }
548
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
549
+
550
+ this._queueCallback(complete, this.tip, isAnimated);
592
551
  }
593
552
 
594
553
  hide() {
@@ -636,14 +595,9 @@
636
595
  this._activeTrigger[TRIGGER_CLICK] = false;
637
596
  this._activeTrigger[TRIGGER_FOCUS] = false;
638
597
  this._activeTrigger[TRIGGER_HOVER] = false;
598
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
639
599
 
640
- if (this.tip.classList.contains(CLASS_NAME_FADE)) {
641
- const transitionDuration = getTransitionDurationFromElement(tip);
642
- EventHandler__default['default'].one(tip, 'transitionend', complete);
643
- emulateTransitionEnd(tip, transitionDuration);
644
- } else {
645
- complete();
646
- }
600
+ this._queueCallback(complete, this.tip, isAnimated);
647
601
 
648
602
  this._hoverState = '';
649
603
  }
@@ -665,7 +619,7 @@
665
619
  }
666
620
 
667
621
  const element = document.createElement('div');
668
- element.innerHTML = this.config.template;
622
+ element.innerHTML = this._config.template;
669
623
  this.tip = element.children[0];
670
624
  return this.tip;
671
625
  }
@@ -681,13 +635,10 @@
681
635
  return;
682
636
  }
683
637
 
684
- if (typeof content === 'object' && isElement(content)) {
685
- if (content.jquery) {
686
- content = content[0];
687
- } // content is a DOM node or a jQuery
638
+ if (isElement(content)) {
639
+ content = getElement(content); // content is a DOM node or a jQuery
688
640
 
689
-
690
- if (this.config.html) {
641
+ if (this._config.html) {
691
642
  if (content.parentNode !== element) {
692
643
  element.innerHTML = '';
693
644
  element.appendChild(content);
@@ -699,9 +650,9 @@
699
650
  return;
700
651
  }
701
652
 
702
- if (this.config.html) {
703
- if (this.config.sanitize) {
704
- content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
653
+ if (this._config.html) {
654
+ if (this._config.sanitize) {
655
+ content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
705
656
  }
706
657
 
707
658
  element.innerHTML = content;
@@ -714,7 +665,7 @@
714
665
  let title = this._element.getAttribute('data-bs-original-title');
715
666
 
716
667
  if (!title) {
717
- title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
668
+ title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
718
669
  }
719
670
 
720
671
  return title;
@@ -748,7 +699,7 @@
748
699
  _getOffset() {
749
700
  const {
750
701
  offset
751
- } = this.config;
702
+ } = this._config;
752
703
 
753
704
  if (typeof offset === 'string') {
754
705
  return offset.split(',').map(val => Number.parseInt(val, 10));
@@ -767,7 +718,7 @@
767
718
  modifiers: [{
768
719
  name: 'flip',
769
720
  options: {
770
- fallbackPlacements: this.config.fallbackPlacements
721
+ fallbackPlacements: this._config.fallbackPlacements
771
722
  }
772
723
  }, {
773
724
  name: 'offset',
@@ -777,7 +728,7 @@
777
728
  }, {
778
729
  name: 'preventOverflow',
779
730
  options: {
780
- boundary: this.config.boundary
731
+ boundary: this._config.boundary
781
732
  }
782
733
  }, {
783
734
  name: 'arrow',
@@ -797,7 +748,7 @@
797
748
  }
798
749
  };
799
750
  return { ...defaultBsPopperConfig,
800
- ...(typeof this.config.popperConfig === 'function' ? this.config.popperConfig(defaultBsPopperConfig) : this.config.popperConfig)
751
+ ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
801
752
  };
802
753
  }
803
754
 
@@ -805,32 +756,21 @@
805
756
  this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
806
757
  }
807
758
 
808
- _getContainer() {
809
- if (this.config.container === false) {
810
- return document.body;
811
- }
812
-
813
- if (isElement(this.config.container)) {
814
- return this.config.container;
815
- }
816
-
817
- return SelectorEngine__default['default'].findOne(this.config.container);
818
- }
819
-
820
759
  _getAttachment(placement) {
821
760
  return AttachmentMap[placement.toUpperCase()];
822
761
  }
823
762
 
824
763
  _setListeners() {
825
- const triggers = this.config.trigger.split(' ');
764
+ const triggers = this._config.trigger.split(' ');
765
+
826
766
  triggers.forEach(trigger => {
827
767
  if (trigger === 'click') {
828
- EventHandler__default['default'].on(this._element, this.constructor.Event.CLICK, this.config.selector, event => this.toggle(event));
768
+ EventHandler__default['default'].on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
829
769
  } else if (trigger !== TRIGGER_MANUAL) {
830
770
  const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
831
771
  const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
832
- EventHandler__default['default'].on(this._element, eventIn, this.config.selector, event => this._enter(event));
833
- EventHandler__default['default'].on(this._element, eventOut, this.config.selector, event => this._leave(event));
772
+ EventHandler__default['default'].on(this._element, eventIn, this._config.selector, event => this._enter(event));
773
+ EventHandler__default['default'].on(this._element, eventOut, this._config.selector, event => this._leave(event));
834
774
  }
835
775
  });
836
776
 
@@ -842,8 +782,8 @@
842
782
 
843
783
  EventHandler__default['default'].on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
844
784
 
845
- if (this.config.selector) {
846
- this.config = { ...this.config,
785
+ if (this._config.selector) {
786
+ this._config = { ...this._config,
847
787
  trigger: 'manual',
848
788
  selector: ''
849
789
  };
@@ -883,7 +823,7 @@
883
823
  clearTimeout(context._timeout);
884
824
  context._hoverState = HOVER_STATE_SHOW;
885
825
 
886
- if (!context.config.delay || !context.config.delay.show) {
826
+ if (!context._config.delay || !context._config.delay.show) {
887
827
  context.show();
888
828
  return;
889
829
  }
@@ -892,7 +832,7 @@
892
832
  if (context._hoverState === HOVER_STATE_SHOW) {
893
833
  context.show();
894
834
  }
895
- }, context.config.delay.show);
835
+ }, context._config.delay.show);
896
836
  }
897
837
 
898
838
  _leave(event, context) {
@@ -909,7 +849,7 @@
909
849
  clearTimeout(context._timeout);
910
850
  context._hoverState = HOVER_STATE_OUT;
911
851
 
912
- if (!context.config.delay || !context.config.delay.hide) {
852
+ if (!context._config.delay || !context._config.delay.hide) {
913
853
  context.hide();
914
854
  return;
915
855
  }
@@ -918,7 +858,7 @@
918
858
  if (context._hoverState === HOVER_STATE_OUT) {
919
859
  context.hide();
920
860
  }
921
- }, context.config.delay.hide);
861
+ }, context._config.delay.hide);
922
862
  }
923
863
 
924
864
  _isWithActiveTrigger() {
@@ -938,15 +878,11 @@
938
878
  delete dataAttributes[dataAttr];
939
879
  }
940
880
  });
941
-
942
- if (config && typeof config.container === 'object' && config.container.jquery) {
943
- config.container = config.container[0];
944
- }
945
-
946
881
  config = { ...this.constructor.Default,
947
882
  ...dataAttributes,
948
883
  ...(typeof config === 'object' && config ? config : {})
949
884
  };
885
+ config.container = config.container === false ? document.body : getElement(config.container);
950
886
 
951
887
  if (typeof config.delay === 'number') {
952
888
  config.delay = {
@@ -975,10 +911,10 @@
975
911
  _getDelegateConfig() {
976
912
  const config = {};
977
913
 
978
- if (this.config) {
979
- for (const key in this.config) {
980
- if (this.constructor.Default[key] !== this.config[key]) {
981
- config[key] = this.config[key];
914
+ if (this._config) {
915
+ for (const key in this._config) {
916
+ if (this.constructor.Default[key] !== this._config[key]) {
917
+ config[key] = this._config[key];
982
918
  }
983
919
  }
984
920
  }
@@ -1045,7 +981,7 @@
1045
981
  */
1046
982
 
1047
983
 
1048
- defineJQueryPlugin(NAME, Tooltip);
984
+ defineJQueryPlugin(Tooltip);
1049
985
 
1050
986
  return Tooltip;
1051
987