release 3.7.0

This commit is contained in:
Grzegorz 2021-05-31 09:59:29 +02:00
parent 5f3c59fdab
commit ff89bd3201
118 changed files with 1423 additions and 1669 deletions

View File

@ -1,5 +1,5 @@
MDB5 MDB5
Version: FREE 3.6.0 Version: FREE 3.7.0
Documentation: Documentation:
https://mdbootstrap.com/docs/standard/ https://mdbootstrap.com/docs/standard/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10
css/mdb.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6
css/mdb.rtl.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
js/mdb.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "mdb-ui-kit", "name": "mdb-ui-kit",
"version": "3.6.0", "version": "3.7.0",
"main": "js/mdb.min.js", "main": "js/mdb.min.js",
"homepage": "https://mdbootstrap.com/docs/standard/", "homepage": "https://mdbootstrap.com/docs/standard/",
"repository": "https://github.com/mdbootstrap/mdb-ui-kit.git", "repository": "https://github.com/mdbootstrap/mdb-ui-kit.git",

View File

@ -1,20 +1,31 @@
/*! /*!
* Bootstrap alert.js v5.0.0 (https://getbootstrap.com/) * Bootstrap alert.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data', './dom/event-handler', './base-component'], factory) ? define([
'./dom/selector-engine',
'./dom/data',
'./dom/event-handler',
'./base-component',
], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Alert = factory(global.Data, global.EventHandler, global.Base))); (global.Alert = factory(
})(this, function (Data, EventHandler, BaseComponent) { global.SelectorEngine,
global.Data,
global.EventHandler,
global.Base
)));
})(this, function (SelectorEngine, Data, EventHandler, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
@ -25,15 +36,6 @@
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const getSelector = (element) => { const getSelector = (element) => {
let selector = element.getAttribute('data-bs-target'); let selector = element.getAttribute('data-bs-target');
@ -62,49 +64,6 @@
return selector ? document.querySelector(selector) : null; return selector ? document.querySelector(selector) : null;
}; };
const getTransitionDurationFromElement = (element) => {
if (!element) {
return 0;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END));
};
const emulateTransitionEnd = (element, duration) => {
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
}
element.addEventListener(TRANSITION_END, listener);
setTimeout(() => {
if (!called) {
triggerTransitionEnd(element);
}
}, emulatedDuration);
};
const getjQuery = () => { const getjQuery = () => {
const { jQuery } = window; const { jQuery } = window;
@ -123,12 +82,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -143,7 +103,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): alert.js * Bootstrap (v5.0.1): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -172,8 +132,8 @@
class Alert extends BaseComponent__default['default'] { class Alert extends BaseComponent__default['default'] {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
close(element) { close(element) {
@ -198,18 +158,9 @@
_removeElement(element) { _removeElement(element) {
element.classList.remove(CLASS_NAME_SHOW); element.classList.remove(CLASS_NAME_SHOW);
const isAnimated = element.classList.contains(CLASS_NAME_FADE);
if (!element.classList.contains(CLASS_NAME_FADE)) { this._queueCallback(() => this._destroyElement(element), element, isAnimated);
this._destroyElement(element);
return;
}
const transitionDuration = getTransitionDurationFromElement(element);
EventHandler__default['default'].one(element, 'transitionend', () =>
this._destroyElement(element)
);
emulateTransitionEnd(element, transitionDuration);
} }
_destroyElement(element) { _destroyElement(element) {
@ -263,7 +214,7 @@
* add .Alert to jQuery only if jQuery is present * add .Alert to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Alert); defineJQueryPlugin(Alert);
return Alert; return Alert;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,20 @@
/*! /*!
* Bootstrap base-component.js v5.0.0 (https://getbootstrap.com/) * Bootstrap base-component.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'))) ? (module.exports = factory(
require('./dom/data.js'),
require('./dom/selector-engine.js'),
require('./dom/event-handler.js')
))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data', './dom/event-handler'], factory) ? define(['./dom/data', './dom/selector-engine', './dom/event-handler'], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Base = factory(global.Data, global.EventHandler))); (global.Base = factory(global.Data, global.SelectorEngine, global.EventHandler)));
})(this, function (Data, EventHandler) { })(this, function (Data, SelectorEngine, EventHandler) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
@ -18,11 +22,89 @@
} }
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data); var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const getTransitionDurationFromElement = (element) => {
if (!element) {
return 0;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END));
};
const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const getElement = (obj) => {
if (isElement(obj)) {
// it's a jQuery object or a node element
return obj.jquery ? obj[0] : obj;
}
if (typeof obj === 'string' && obj.length > 0) {
return SelectorEngine__default['default'].findOne(obj);
}
return null;
};
const emulateTransitionEnd = (element, duration) => {
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
}
element.addEventListener(TRANSITION_END, listener);
setTimeout(() => {
if (!called) {
triggerTransitionEnd(element);
}
}, emulatedDuration);
};
const execute = (callback) => {
if (typeof callback === 'function') {
callback();
}
};
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): base-component.js * Bootstrap (v5.0.1): base-component.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -32,11 +114,11 @@
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
const VERSION = '5.0.0'; const VERSION = '5.0.1';
class BaseComponent { class BaseComponent {
constructor(element) { constructor(element) {
element = typeof element === 'string' ? document.querySelector(element) : element; element = getElement(element);
if (!element) { if (!element) {
return; return;
@ -48,8 +130,21 @@
dispose() { dispose() {
Data__default['default'].remove(this._element, this.constructor.DATA_KEY); Data__default['default'].remove(this._element, this.constructor.DATA_KEY);
EventHandler__default['default'].off(this._element, `.${this.constructor.DATA_KEY}`); EventHandler__default['default'].off(this._element, this.constructor.EVENT_KEY);
this._element = null; Object.getOwnPropertyNames(this).forEach((propertyName) => {
this[propertyName] = null;
});
}
_queueCallback(callback, element, isAnimated = true) {
if (!isAnimated) {
execute(callback);
return;
}
const transitionDuration = getTransitionDurationFromElement(element);
EventHandler__default['default'].one(element, 'transitionend', () => execute(callback));
emulateTransitionEnd(element, transitionDuration);
} }
/** Static */ /** Static */
@ -60,6 +155,18 @@
static get VERSION() { static get VERSION() {
return VERSION; return VERSION;
} }
static get NAME() {
throw new Error('You have to implement the static method "NAME", for each component!');
}
static get DATA_KEY() {
return `bs.${this.NAME}`;
}
static get EVENT_KEY() {
return `.${this.DATA_KEY}`;
}
} }
return BaseComponent; return BaseComponent;

File diff suppressed because one or more lines are too long

View File

@ -1,20 +1,31 @@
/*! /*!
* Bootstrap button.js v5.0.0 (https://getbootstrap.com/) * Bootstrap button.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data', './dom/event-handler', './base-component'], factory) ? define([
'./dom/selector-engine',
'./dom/data',
'./dom/event-handler',
'./base-component',
], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Button = factory(global.Data, global.EventHandler, global.Base))); (global.Button = factory(
})(this, function (Data, EventHandler, BaseComponent) { global.SelectorEngine,
global.Data,
global.EventHandler,
global.Base
)));
})(this, function (SelectorEngine, Data, EventHandler, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
@ -25,13 +36,6 @@
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const getjQuery = () => { const getjQuery = () => {
const { jQuery } = window; const { jQuery } = window;
@ -50,12 +54,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -70,7 +75,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): button.js * Bootstrap (v5.0.1): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -95,8 +100,8 @@
class Button extends BaseComponent__default['default'] { class Button extends BaseComponent__default['default'] {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
toggle() { toggle() {
@ -147,7 +152,7 @@
* add .Button to jQuery only if jQuery is present * add .Button to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Button); defineJQueryPlugin(Button);
return Button; return Button;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,53 +1,46 @@
/*! /*!
* Bootstrap carousel.js v5.0.0 (https://getbootstrap.com/) * Bootstrap carousel.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/manipulator.js'), require('./dom/manipulator.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'./dom/selector-engine',
'./dom/data', './dom/data',
'./dom/event-handler', './dom/event-handler',
'./dom/manipulator', './dom/manipulator',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Carousel = factory( (global.Carousel = factory(
global.SelectorEngine,
global.Data, global.Data,
global.EventHandler, global.EventHandler,
global.Manipulator, global.Manipulator,
global.SelectorEngine,
global.Base global.Base
))); )));
})(this, function (Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { })(this, function (SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }; return e && typeof e === 'object' && 'default' in e ? e : { default: e };
} }
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data); var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp) const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const toType = (obj) => { const toType = (obj) => {
@ -89,49 +82,20 @@
return selector ? document.querySelector(selector) : null; return selector ? document.querySelector(selector) : null;
}; };
const getTransitionDurationFromElement = (element) => {
if (!element) {
return 0;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => { const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END)); element.dispatchEvent(new Event(TRANSITION_END));
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
const emulateTransitionEnd = (element, duration) => { return false;
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
} }
element.addEventListener(TRANSITION_END, listener); if (typeof obj.jquery !== 'undefined') {
setTimeout(() => { obj = obj[0];
if (!called) {
triggerTransitionEnd(element);
} }
}, emulatedDuration);
return typeof obj.nodeType !== 'undefined';
}; };
const typeCheckConfig = (componentName, config, configTypes) => { const typeCheckConfig = (componentName, config, configTypes) => {
@ -188,12 +152,13 @@
const isRTL = () => document.documentElement.dir === 'rtl'; const isRTL = () => document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -208,7 +173,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): carousel.js * Bootstrap (v5.0.1): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -312,8 +277,8 @@
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
next() { next() {
@ -396,17 +361,6 @@
const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;
this._slide(order, this._items[index]); this._slide(order, this._items[index]);
}
dispose() {
this._items = null;
this._config = null;
this._interval = null;
this._isPaused = null;
this._isSliding = null;
this._activeElement = null;
this._indicatorsElement = null;
super.dispose();
} // Private } // Private
_getConfig(config) { _getConfig(config) {
@ -676,37 +630,35 @@
this._activeElement = nextElement; this._activeElement = nextElement;
const triggerSlidEvent = () => {
EventHandler__default['default'].trigger(this._element, EVENT_SLID, {
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
};
if (this._element.classList.contains(CLASS_NAME_SLIDE)) { if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
nextElement.classList.add(orderClassName); nextElement.classList.add(orderClassName);
reflow(nextElement); reflow(nextElement);
activeElement.classList.add(directionalClassName); activeElement.classList.add(directionalClassName);
nextElement.classList.add(directionalClassName); nextElement.classList.add(directionalClassName);
const transitionDuration = getTransitionDurationFromElement(activeElement);
EventHandler__default['default'].one(activeElement, 'transitionend', () => { const completeCallBack = () => {
nextElement.classList.remove(directionalClassName, orderClassName); nextElement.classList.remove(directionalClassName, orderClassName);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName); activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
this._isSliding = false; this._isSliding = false;
setTimeout(() => { setTimeout(triggerSlidEvent, 0);
EventHandler__default['default'].trigger(this._element, EVENT_SLID, { };
relatedTarget: nextElement,
direction: eventDirectionName, this._queueCallback(completeCallBack, activeElement, true);
from: activeElementIndex,
to: nextElementIndex,
});
}, 0);
});
emulateTransitionEnd(activeElement, transitionDuration);
} else { } else {
activeElement.classList.remove(CLASS_NAME_ACTIVE); activeElement.classList.remove(CLASS_NAME_ACTIVE);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
this._isSliding = false; this._isSliding = false;
EventHandler__default['default'].trigger(this._element, EVENT_SLID, { triggerSlidEvent();
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
} }
if (isCycling) { if (isCycling) {
@ -827,7 +779,7 @@
* add .Carousel to jQuery only if jQuery is present * add .Carousel to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Carousel); defineJQueryPlugin(Carousel);
return Carousel; return Carousel;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,55 +1,46 @@
/*! /*!
* Bootstrap collapse.js v5.0.0 (https://getbootstrap.com/) * Bootstrap collapse.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/manipulator.js'), require('./dom/manipulator.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'./dom/selector-engine',
'./dom/data', './dom/data',
'./dom/event-handler', './dom/event-handler',
'./dom/manipulator', './dom/manipulator',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Collapse = factory( (global.Collapse = factory(
global.SelectorEngine,
global.Data, global.Data,
global.EventHandler, global.EventHandler,
global.Manipulator, global.Manipulator,
global.SelectorEngine,
global.Base global.Base
))); )));
})(this, function (Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { })(this, function (SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }; return e && typeof e === 'object' && 'default' in e ? e : { default: e };
} }
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data); var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const toType = (obj) => { const toType = (obj) => {
if (obj === null || obj === undefined) { if (obj === null || obj === undefined) {
return `${obj}`; return `${obj}`;
@ -99,49 +90,29 @@
return selector ? document.querySelector(selector) : null; return selector ? document.querySelector(selector) : null;
}; };
const getTransitionDurationFromElement = (element) => { const isElement = (obj) => {
if (!element) { if (!obj || typeof obj !== 'object') {
return 0; return false;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END));
};
const isElement = (obj) => (obj[0] || obj).nodeType;
const emulateTransitionEnd = (element, duration) => {
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
} }
element.addEventListener(TRANSITION_END, listener); if (typeof obj.jquery !== 'undefined') {
setTimeout(() => { obj = obj[0];
if (!called) {
triggerTransitionEnd(element);
} }
}, emulatedDuration);
return typeof obj.nodeType !== 'undefined';
};
const getElement = (obj) => {
if (isElement(obj)) {
// it's a jQuery object or a node element
return obj.jquery ? obj[0] : obj;
}
if (typeof obj === 'string' && obj.length > 0) {
return SelectorEngine__default['default'].findOne(obj);
}
return null;
}; };
const typeCheckConfig = (componentName, config, configTypes) => { const typeCheckConfig = (componentName, config, configTypes) => {
@ -178,12 +149,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -198,7 +170,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): collapse.js * Bootstrap (v5.0.1): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -279,8 +251,8 @@
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
toggle() { toggle() {
@ -375,9 +347,9 @@
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
const scrollSize = `scroll${capitalizedDimension}`; const scrollSize = `scroll${capitalizedDimension}`;
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler__default['default'].one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, true);
emulateTransitionEnd(this._element, transitionDuration);
this._element.style[dimension] = `${this._element[scrollSize]}px`; this._element.style[dimension] = `${this._element[scrollSize]}px`;
} }
@ -428,21 +400,12 @@
}; };
this._element.style[dimension] = ''; this._element.style[dimension] = '';
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler__default['default'].one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, true);
emulateTransitionEnd(this._element, transitionDuration);
} }
setTransitioning(isTransitioning) { setTransitioning(isTransitioning) {
this._isTransitioning = isTransitioning; this._isTransitioning = isTransitioning;
}
dispose() {
super.dispose();
this._config = null;
this._parent = null;
this._triggerArray = null;
this._isTransitioning = null;
} // Private } // Private
_getConfig(config) { _getConfig(config) {
@ -459,16 +422,7 @@
_getParent() { _getParent() {
let { parent } = this._config; let { parent } = this._config;
parent = getElement(parent);
if (isElement(parent)) {
// it's a jQuery object
if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
parent = parent[0];
}
} else {
parent = SelectorEngine__default['default'].findOne(parent);
}
const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`; const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`;
SelectorEngine__default['default'].find(selector, parent).forEach((element) => { SelectorEngine__default['default'].find(selector, parent).forEach((element) => {
const selected = getElementFromSelector(element); const selected = getElementFromSelector(element);
@ -575,7 +529,7 @@
* add .Collapse to jQuery only if jQuery is present * add .Collapse to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Collapse); defineJQueryPlugin(Collapse);
return Collapse; return Collapse;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap data.js v5.0.0 (https://getbootstrap.com/) * Bootstrap data.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -15,7 +15,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/data.js * Bootstrap (v5.0.1): dom/data.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1 +1 @@
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n"],"names":["elementMap","Map","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,UAAU,GAAG,IAAIC,GAAJ,EAAnB;AAEA,aAAe;EACbC,EAAAA,GAAG,CAACC,OAAD,EAAUC,GAAV,EAAeC,QAAf,EAAyB;EAC1B,QAAI,CAACL,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5BH,MAAAA,UAAU,CAACE,GAAX,CAAeC,OAAf,EAAwB,IAAIF,GAAJ,EAAxB;EACD;;EAED,UAAMM,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB,CAL0B;EAQ1B;;EACA,QAAI,CAACI,WAAW,CAACD,GAAZ,CAAgBF,GAAhB,CAAD,IAAyBG,WAAW,CAACE,IAAZ,KAAqB,CAAlD,EAAqD;EACnD;EACAC,MAAAA,OAAO,CAACC,KAAR,CAAe,+EAA8EC,KAAK,CAACC,IAAN,CAAWN,WAAW,CAACO,IAAZ,EAAX,EAA+B,CAA/B,CAAkC,GAA/H;EACA;EACD;;EAEDP,IAAAA,WAAW,CAACL,GAAZ,CAAgBE,GAAhB,EAAqBC,QAArB;EACD,GAjBY;;EAmBbG,EAAAA,GAAG,CAACL,OAAD,EAAUC,GAAV,EAAe;EAChB,QAAIJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAJ,EAA6B;EAC3B,aAAOH,UAAU,CAACQ,GAAX,CAAeL,OAAf,EAAwBK,GAAxB,CAA4BJ,GAA5B,KAAoC,IAA3C;EACD;;EAED,WAAO,IAAP;EACD,GAzBY;;EA2BbW,EAAAA,MAAM,CAACZ,OAAD,EAAUC,GAAV,EAAe;EACnB,QAAI,CAACJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5B;EACD;;EAED,UAAMI,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB;EAEAI,IAAAA,WAAW,CAACS,MAAZ,CAAmBZ,GAAnB,EAPmB;;EAUnB,QAAIG,WAAW,CAACE,IAAZ,KAAqB,CAAzB,EAA4B;EAC1BT,MAAAA,UAAU,CAACgB,MAAX,CAAkBb,OAAlB;EACD;EACF;;EAxCY,CAAf;;;;;;;;"} {"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n"],"names":["elementMap","Map","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,UAAU,GAAG,IAAIC,GAAJ,EAAnB;AAEA,aAAe;EACbC,EAAAA,GAAG,CAACC,OAAD,EAAUC,GAAV,EAAeC,QAAf,EAAyB;EAC1B,QAAI,CAACL,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5BH,MAAAA,UAAU,CAACE,GAAX,CAAeC,OAAf,EAAwB,IAAIF,GAAJ,EAAxB;EACD;;EAED,UAAMM,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB,CAL0B;EAQ1B;;EACA,QAAI,CAACI,WAAW,CAACD,GAAZ,CAAgBF,GAAhB,CAAD,IAAyBG,WAAW,CAACE,IAAZ,KAAqB,CAAlD,EAAqD;EACnD;EACAC,MAAAA,OAAO,CAACC,KAAR,CAAe,+EAA8EC,KAAK,CAACC,IAAN,CAAWN,WAAW,CAACO,IAAZ,EAAX,EAA+B,CAA/B,CAAkC,GAA/H;EACA;EACD;;EAEDP,IAAAA,WAAW,CAACL,GAAZ,CAAgBE,GAAhB,EAAqBC,QAArB;EACD,GAjBY;;EAmBbG,EAAAA,GAAG,CAACL,OAAD,EAAUC,GAAV,EAAe;EAChB,QAAIJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAJ,EAA6B;EAC3B,aAAOH,UAAU,CAACQ,GAAX,CAAeL,OAAf,EAAwBK,GAAxB,CAA4BJ,GAA5B,KAAoC,IAA3C;EACD;;EAED,WAAO,IAAP;EACD,GAzBY;;EA2BbW,EAAAA,MAAM,CAACZ,OAAD,EAAUC,GAAV,EAAe;EACnB,QAAI,CAACJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5B;EACD;;EAED,UAAMI,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB;EAEAI,IAAAA,WAAW,CAACS,MAAZ,CAAmBZ,GAAnB,EAPmB;;EAUnB,QAAIG,WAAW,CAACE,IAAZ,KAAqB,CAAzB,EAA4B;EAC1BT,MAAAA,UAAU,CAACgB,MAAX,CAAkBb,OAAlB;EACD;EACF;;EAxCY,CAAf;;;;;;;;"}

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap event-handler.js v5.0.0 (https://getbootstrap.com/) * Bootstrap event-handler.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -13,13 +13,6 @@
})(this, function () { })(this, function () {
'use strict'; 'use strict';
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const getjQuery = () => { const getjQuery = () => {
const { jQuery } = window; const { jQuery } = window;
@ -32,7 +25,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/event-handler.js * Bootstrap (v5.0.1): dom/event-handler.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap manipulator.js v5.0.0 (https://getbootstrap.com/) * Bootstrap manipulator.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -15,7 +15,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/manipulator.js * Bootstrap (v5.0.1): dom/manipulator.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1 +1 @@
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n\n Object.keys(element.dataset)\n .filter(key => key.startsWith('bs'))\n .forEach(key => {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","Object","keys","dataset","filter","startsWith","forEach","pureKey","charAt","slice","length","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAEA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsBC,GAAG,IAAK,IAAGA,GAAG,CAACC,WAAJ,EAAkB,EAAnD,CAAP;EACD;;QAEKC,WAAW,GAAG;EAClBC,EAAAA,gBAAgB,CAACC,OAAD,EAAUN,GAAV,EAAeO,KAAf,EAAsB;EACpCD,IAAAA,OAAO,CAACE,YAAR,CAAsB,WAAUT,gBAAgB,CAACC,GAAD,CAAM,EAAtD,EAAyDO,KAAzD;EACD,GAHiB;;EAKlBE,EAAAA,mBAAmB,CAACH,OAAD,EAAUN,GAAV,EAAe;EAChCM,IAAAA,OAAO,CAACI,eAAR,CAAyB,WAAUX,gBAAgB,CAACC,GAAD,CAAM,EAAzD;EACD,GAPiB;;EASlBW,EAAAA,iBAAiB,CAACL,OAAD,EAAU;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,UAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACUhB,GAAG,IAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CADjB,EAEGC,OAFH,CAEWlB,GAAG,IAAI;EACd,UAAImB,OAAO,GAAGnB,GAAG,CAACC,OAAJ,CAAY,KAAZ,EAAmB,EAAnB,CAAd;EACAkB,MAAAA,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,CAAf,EAAkBjB,WAAlB,KAAkCgB,OAAO,CAACE,KAAR,CAAc,CAAd,EAAiBF,OAAO,CAACG,MAAzB,CAA5C;EACAV,MAAAA,UAAU,CAACO,OAAD,CAAV,GAAsBxB,aAAa,CAACW,OAAO,CAACS,OAAR,CAAgBf,GAAhB,CAAD,CAAnC;EACD,KANH;EAQA,WAAOY,UAAP;EACD,GAzBiB;;EA2BlBW,EAAAA,gBAAgB,CAACjB,OAAD,EAAUN,GAAV,EAAe;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,CAAsB,WAAUzB,gBAAgB,CAACC,GAAD,CAAM,EAAtD,CAAD,CAApB;EACD,GA7BiB;;EA+BlByB,EAAAA,MAAM,CAACnB,OAAD,EAAU;EACd,UAAMoB,IAAI,GAAGpB,OAAO,CAACqB,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GAtCiB;;EAwClBC,EAAAA,QAAQ,CAAC5B,OAAD,EAAU;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC6B,SADR;EAELH,MAAAA,IAAI,EAAE1B,OAAO,CAAC8B;EAFT,KAAP;EAID;;EA7CiB;;;;;;;;"} {"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.1): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n\n Object.keys(element.dataset)\n .filter(key => key.startsWith('bs'))\n .forEach(key => {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","Object","keys","dataset","filter","startsWith","forEach","pureKey","charAt","slice","length","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAEA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsBC,GAAG,IAAK,IAAGA,GAAG,CAACC,WAAJ,EAAkB,EAAnD,CAAP;EACD;;QAEKC,WAAW,GAAG;EAClBC,EAAAA,gBAAgB,CAACC,OAAD,EAAUN,GAAV,EAAeO,KAAf,EAAsB;EACpCD,IAAAA,OAAO,CAACE,YAAR,CAAsB,WAAUT,gBAAgB,CAACC,GAAD,CAAM,EAAtD,EAAyDO,KAAzD;EACD,GAHiB;;EAKlBE,EAAAA,mBAAmB,CAACH,OAAD,EAAUN,GAAV,EAAe;EAChCM,IAAAA,OAAO,CAACI,eAAR,CAAyB,WAAUX,gBAAgB,CAACC,GAAD,CAAM,EAAzD;EACD,GAPiB;;EASlBW,EAAAA,iBAAiB,CAACL,OAAD,EAAU;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,UAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACUhB,GAAG,IAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CADjB,EAEGC,OAFH,CAEWlB,GAAG,IAAI;EACd,UAAImB,OAAO,GAAGnB,GAAG,CAACC,OAAJ,CAAY,KAAZ,EAAmB,EAAnB,CAAd;EACAkB,MAAAA,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,CAAf,EAAkBjB,WAAlB,KAAkCgB,OAAO,CAACE,KAAR,CAAc,CAAd,EAAiBF,OAAO,CAACG,MAAzB,CAA5C;EACAV,MAAAA,UAAU,CAACO,OAAD,CAAV,GAAsBxB,aAAa,CAACW,OAAO,CAACS,OAAR,CAAgBf,GAAhB,CAAD,CAAnC;EACD,KANH;EAQA,WAAOY,UAAP;EACD,GAzBiB;;EA2BlBW,EAAAA,gBAAgB,CAACjB,OAAD,EAAUN,GAAV,EAAe;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,CAAsB,WAAUzB,gBAAgB,CAACC,GAAD,CAAM,EAAtD,CAAD,CAApB;EACD,GA7BiB;;EA+BlByB,EAAAA,MAAM,CAACnB,OAAD,EAAU;EACd,UAAMoB,IAAI,GAAGpB,OAAO,CAACqB,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GAtCiB;;EAwClBC,EAAAA,QAAQ,CAAC5B,OAAD,EAAU;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC6B,SADR;EAELH,MAAAA,IAAI,EAAE1B,OAAO,CAAC8B;EAFT,KAAP;EAID;;EA7CiB;;;;;;;;"}

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap selector-engine.js v5.0.0 (https://getbootstrap.com/) * Bootstrap selector-engine.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -15,7 +15,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/selector-engine.js * Bootstrap (v5.0.1): dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1 +1 @@
{"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children)\n .filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n }\n}\n\nexport default SelectorEngine\n"],"names":["NODE_TEXT","SelectorEngine","find","selector","element","document","documentElement","concat","Element","prototype","querySelectorAll","call","findOne","querySelector","children","filter","child","matches","parents","ancestor","parentNode","nodeType","Node","ELEMENT_NODE","push","prev","previous","previousElementSibling","next","nextElementSibling"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,SAAS,GAAG,CAAlB;QAEMC,cAAc,GAAG;EACrBC,EAAAA,IAAI,CAACC,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACjD,WAAO,GAAGC,MAAH,CAAU,GAAGC,OAAO,CAACC,SAAR,CAAkBC,gBAAlB,CAAmCC,IAAnC,CAAwCP,OAAxC,EAAiDD,QAAjD,CAAb,CAAP;EACD,GAHoB;;EAKrBS,EAAAA,OAAO,CAACT,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACpD,WAAOE,OAAO,CAACC,SAAR,CAAkBI,aAAlB,CAAgCF,IAAhC,CAAqCP,OAArC,EAA8CD,QAA9C,CAAP;EACD,GAPoB;;EASrBW,EAAAA,QAAQ,CAACV,OAAD,EAAUD,QAAV,EAAoB;EAC1B,WAAO,GAAGI,MAAH,CAAU,GAAGH,OAAO,CAACU,QAArB,EACJC,MADI,CACGC,KAAK,IAAIA,KAAK,CAACC,OAAN,CAAcd,QAAd,CADZ,CAAP;EAED,GAZoB;;EAcrBe,EAAAA,OAAO,CAACd,OAAD,EAAUD,QAAV,EAAoB;EACzB,UAAMe,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGf,OAAO,CAACgB,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBrB,SAApF,EAA+F;EAC7F,UAAImB,QAAQ,CAACF,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9Be,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GA5BoB;;EA8BrBO,EAAAA,IAAI,CAACrB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIuB,QAAQ,GAAGtB,OAAO,CAACuB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACT,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACuB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA1CoB;;EA4CrBC,EAAAA,IAAI,CAACxB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIyB,IAAI,GAAGxB,OAAO,CAACyB,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAIA,IAAI,CAACX,OAAL,CAAad,QAAb,CAAJ,EAA4B;EAC1B,eAAO,CAACyB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;;EAxDoB;;;;;;;;"} {"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.1): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children)\n .filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n }\n}\n\nexport default SelectorEngine\n"],"names":["NODE_TEXT","SelectorEngine","find","selector","element","document","documentElement","concat","Element","prototype","querySelectorAll","call","findOne","querySelector","children","filter","child","matches","parents","ancestor","parentNode","nodeType","Node","ELEMENT_NODE","push","prev","previous","previousElementSibling","next","nextElementSibling"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,SAAS,GAAG,CAAlB;QAEMC,cAAc,GAAG;EACrBC,EAAAA,IAAI,CAACC,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACjD,WAAO,GAAGC,MAAH,CAAU,GAAGC,OAAO,CAACC,SAAR,CAAkBC,gBAAlB,CAAmCC,IAAnC,CAAwCP,OAAxC,EAAiDD,QAAjD,CAAb,CAAP;EACD,GAHoB;;EAKrBS,EAAAA,OAAO,CAACT,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACpD,WAAOE,OAAO,CAACC,SAAR,CAAkBI,aAAlB,CAAgCF,IAAhC,CAAqCP,OAArC,EAA8CD,QAA9C,CAAP;EACD,GAPoB;;EASrBW,EAAAA,QAAQ,CAACV,OAAD,EAAUD,QAAV,EAAoB;EAC1B,WAAO,GAAGI,MAAH,CAAU,GAAGH,OAAO,CAACU,QAArB,EACJC,MADI,CACGC,KAAK,IAAIA,KAAK,CAACC,OAAN,CAAcd,QAAd,CADZ,CAAP;EAED,GAZoB;;EAcrBe,EAAAA,OAAO,CAACd,OAAD,EAAUD,QAAV,EAAoB;EACzB,UAAMe,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGf,OAAO,CAACgB,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBrB,SAApF,EAA+F;EAC7F,UAAImB,QAAQ,CAACF,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9Be,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GA5BoB;;EA8BrBO,EAAAA,IAAI,CAACrB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIuB,QAAQ,GAAGtB,OAAO,CAACuB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACT,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACuB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA1CoB;;EA4CrBC,EAAAA,IAAI,CAACxB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIyB,IAAI,GAAGxB,OAAO,CAACyB,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAIA,IAAI,CAACX,OAAL,CAAad,QAAb,CAAJ,EAA4B;EAC1B,eAAO,CAACyB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;;EAxDoB;;;;;;;;"}

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap dropdown.js v5.0.0 (https://getbootstrap.com/) * Bootstrap dropdown.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -7,31 +7,31 @@
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('@popperjs/core'), require('@popperjs/core'),
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/manipulator.js'), require('./dom/manipulator.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'@popperjs/core', '@popperjs/core',
'./dom/selector-engine',
'./dom/data', './dom/data',
'./dom/event-handler', './dom/event-handler',
'./dom/manipulator', './dom/manipulator',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Dropdown = factory( (global.Dropdown = factory(
global.Popper, global.Popper,
global.SelectorEngine,
global.Data, global.Data,
global.EventHandler, global.EventHandler,
global.Manipulator, global.Manipulator,
global.SelectorEngine,
global.Base global.Base
))); )));
})(this, function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { })(this, function (Popper, SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
@ -65,19 +65,12 @@
} }
var Popper__namespace = /*#__PURE__*/ _interopNamespace(Popper); var Popper__namespace = /*#__PURE__*/ _interopNamespace(Popper);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data); var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const toType = (obj) => { const toType = (obj) => {
if (obj === null || obj === undefined) { if (obj === null || obj === undefined) {
return `${obj}`; return `${obj}`;
@ -117,7 +110,30 @@
return selector ? document.querySelector(selector) : null; return selector ? document.querySelector(selector) : null;
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const getElement = (obj) => {
if (isElement(obj)) {
// it's a jQuery object or a node element
return obj.jquery ? obj[0] : obj;
}
if (typeof obj === 'string' && obj.length > 0) {
return SelectorEngine__default['default'].findOne(obj);
}
return null;
};
const typeCheckConfig = (componentName, config, configTypes) => { const typeCheckConfig = (componentName, config, configTypes) => {
Object.keys(configTypes).forEach((property) => { Object.keys(configTypes).forEach((property) => {
@ -189,12 +205,13 @@
const isRTL = () => document.documentElement.dir === 'rtl'; const isRTL = () => document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -209,7 +226,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dropdown.js * Bootstrap (v5.0.1): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -295,8 +312,8 @@
return DefaultType; return DefaultType;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
toggle() { toggle() {
@ -345,11 +362,7 @@
if (this._config.reference === 'parent') { if (this._config.reference === 'parent') {
referenceElement = parent; referenceElement = parent;
} else if (isElement(this._config.reference)) { } else if (isElement(this._config.reference)) {
referenceElement = this._config.reference; // Check if it's jQuery element referenceElement = getElement(this._config.reference);
if (typeof this._config.reference.jquery !== 'undefined') {
referenceElement = this._config.reference[0];
}
} else if (typeof this._config.reference === 'object') { } else if (typeof this._config.reference === 'object') {
referenceElement = this._config.reference; referenceElement = this._config.reference;
} }
@ -399,12 +412,8 @@
} }
dispose() { dispose() {
this._menu = null;
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
this._popper = null;
} }
super.dispose(); super.dispose();
@ -605,19 +614,13 @@
} }
static clearMenus(event) { static clearMenus(event) {
if (event) {
if ( if (
event.button === RIGHT_MOUSE_BUTTON || event &&
(event.type === 'keyup' && event.key !== TAB_KEY) (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY))
) { ) {
return; return;
} }
if (/input|select|option|textarea|form/i.test(event.target.tagName)) {
return;
}
}
const toggles = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE); const toggles = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
for (let i = 0, len = toggles.length; i < len; i++) { for (let i = 0, len = toggles.length; i < len; i++) {
@ -645,12 +648,12 @@
(context._config.autoClose === 'outside' && isMenuTarget) (context._config.autoClose === 'outside' && isMenuTarget)
) { ) {
continue; continue;
} // Tab navigation through the dropdown menu shouldn't close the menu } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
if ( if (
event.type === 'keyup' && context._menu.contains(event.target) &&
event.key === TAB_KEY && ((event.type === 'keyup' && event.key === TAB_KEY) ||
context._menu.contains(event.target) /input|select|option|textarea|form/i.test(event.target.tagName))
) { ) {
continue; continue;
} }
@ -760,7 +763,7 @@
* add .Dropdown to jQuery only if jQuery is present * add .Dropdown to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Dropdown); defineJQueryPlugin(Dropdown);
return Dropdown; return Dropdown;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,48 +1,42 @@
/*! /*!
* Bootstrap modal.js v5.0.0 (https://getbootstrap.com/) * Bootstrap modal.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/manipulator.js'), require('./dom/manipulator.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'./dom/selector-engine',
'./dom/event-handler', './dom/event-handler',
'./dom/manipulator', './dom/manipulator',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Modal = factory( (global.Modal = factory(
global.SelectorEngine,
global.EventHandler, global.EventHandler,
global.Manipulator, global.Manipulator,
global.SelectorEngine,
global.Base global.Base
))); )));
})(this, function (EventHandler, Manipulator, SelectorEngine, BaseComponent) { })(this, function (SelectorEngine, EventHandler, Manipulator, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }; return e && typeof e === 'object' && 'default' in e ? e : { default: e };
} }
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000; const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp) const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
@ -110,7 +104,17 @@
element.dispatchEvent(new Event(TRANSITION_END)); element.dispatchEvent(new Event(TRANSITION_END));
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const emulateTransitionEnd = (element, duration) => { const emulateTransitionEnd = (element, duration) => {
let called = false; let called = false;
@ -184,12 +188,13 @@
const isRTL = () => document.documentElement.dir === 'rtl'; const isRTL = () => document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -210,7 +215,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/scrollBar.js * Bootstrap (v5.0.1): util/scrollBar.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -290,7 +295,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/backdrop.js * Bootstrap (v5.0.1): util/backdrop.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -371,6 +376,7 @@
_getConfig(config) { _getConfig(config) {
config = { ...Default$1, ...(typeof config === 'object' ? config : {}) }; config = { ...Default$1, ...(typeof config === 'object' ? config : {}) };
config.rootElement = config.rootElement || document.body;
typeCheckConfig(NAME$1, config, DefaultType$1); typeCheckConfig(NAME$1, config, DefaultType$1);
return config; return config;
} }
@ -416,7 +422,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): modal.js * Bootstrap (v5.0.1): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -482,8 +488,8 @@
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
toggle(relatedTarget) { toggle(relatedTarget) {
@ -568,21 +574,16 @@
EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS); EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
EventHandler__default['default'].off(this._dialog, EVENT_MOUSEDOWN_DISMISS); EventHandler__default['default'].off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
if (isAnimated) { this._queueCallback(() => this._hideModal(), this._element, isAnimated);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler__default['default'].one(this._element, 'transitionend', (event) =>
this._hideModal(event)
);
emulateTransitionEnd(this._element, transitionDuration);
} else {
this._hideModal();
}
} }
dispose() { dispose() {
[window, this._dialog].forEach((htmlElement) => [window, this._dialog].forEach((htmlElement) =>
EventHandler__default['default'].off(htmlElement, EVENT_KEY) EventHandler__default['default'].off(htmlElement, EVENT_KEY)
); );
this._backdrop.dispose();
super.dispose(); super.dispose();
/** /**
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
@ -591,15 +592,6 @@
*/ */
EventHandler__default['default'].off(document, EVENT_FOCUSIN); EventHandler__default['default'].off(document, EVENT_FOCUSIN);
this._config = null;
this._dialog = null;
this._backdrop.dispose();
this._backdrop = null;
this._isShown = null;
this._ignoreBackdropClick = null;
this._isTransitioning = null;
} }
handleUpdate() { handleUpdate() {
@ -672,13 +664,7 @@
}); });
}; };
if (isAnimated) { this._queueCallback(transitionComplete, this._dialog, isAnimated);
const transitionDuration = getTransitionDurationFromElement(this._dialog);
EventHandler__default['default'].one(this._dialog, 'transitionend', transitionComplete);
emulateTransitionEnd(this._dialog, transitionDuration);
} else {
transitionComplete();
}
} }
_enforceFocus() { _enforceFocus() {
@ -883,7 +869,7 @@
* add .Modal to jQuery only if jQuery is present * add .Modal to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Modal); defineJQueryPlugin(Modal);
return Modal; return Modal;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap offcanvas.js v5.0.0 (https://getbootstrap.com/) * Bootstrap offcanvas.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -41,12 +41,6 @@
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000; const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp) const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
@ -114,7 +108,17 @@
element.dispatchEvent(new Event(TRANSITION_END)); element.dispatchEvent(new Event(TRANSITION_END));
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const emulateTransitionEnd = (element, duration) => { const emulateTransitionEnd = (element, duration) => {
let called = false; let called = false;
@ -202,12 +206,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -228,7 +233,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/scrollBar.js * Bootstrap (v5.0.1): util/scrollBar.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -308,7 +313,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/backdrop.js * Bootstrap (v5.0.1): util/backdrop.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -389,6 +394,7 @@
_getConfig(config) { _getConfig(config) {
config = { ...Default$1, ...(typeof config === 'object' ? config : {}) }; config = { ...Default$1, ...(typeof config === 'object' ? config : {}) };
config.rootElement = config.rootElement || document.body;
typeCheckConfig(NAME$1, config, DefaultType$1); typeCheckConfig(NAME$1, config, DefaultType$1);
return config; return config;
} }
@ -434,7 +440,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): offcanvas.js * Bootstrap (v5.0.1): offcanvas.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -488,12 +494,12 @@
this._addEventListeners(); this._addEventListeners();
} // Getters } // Getters
static get Default() { static get NAME() {
return Default; return NAME;
} }
static get DATA_KEY() { static get Default() {
return DATA_KEY; return Default;
} // Public } // Public
toggle(relatedTarget) { toggle(relatedTarget) {
@ -538,9 +544,7 @@
}); });
}; };
const transitionDuration = getTransitionDurationFromElement(this._element); this._queueCallback(completeCallBack, this._element, true);
EventHandler__default['default'].one(this._element, 'transitionend', completeCallBack);
emulateTransitionEnd(this._element, transitionDuration);
} }
hide() { hide() {
@ -580,9 +584,7 @@
EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN); EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN);
}; };
const transitionDuration = getTransitionDurationFromElement(this._element); this._queueCallback(completeCallback, this._element, true);
EventHandler__default['default'].one(this._element, 'transitionend', completeCallback);
emulateTransitionEnd(this._element, transitionDuration);
} }
dispose() { dispose() {
@ -590,8 +592,6 @@
super.dispose(); super.dispose();
EventHandler__default['default'].off(document, EVENT_FOCUSIN); EventHandler__default['default'].off(document, EVENT_FOCUSIN);
this._config = null;
this._backdrop = null;
} // Private } // Private
_getConfig(config) { _getConfig(config) {
@ -709,7 +709,7 @@
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
defineJQueryPlugin(NAME, Offcanvas); defineJQueryPlugin(Offcanvas);
return Offcanvas; return Offcanvas;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,37 +1,30 @@
/*! /*!
* Bootstrap popover.js v5.0.0 (https://getbootstrap.com/) * Bootstrap popover.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/data.js'),
require('./dom/selector-engine.js'), require('./dom/selector-engine.js'),
require('./dom/data.js'),
require('./tooltip.js') require('./tooltip.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data', './dom/selector-engine', './tooltip'], factory) ? define(['./dom/selector-engine', './dom/data', './tooltip'], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Popover = factory(global.Data, global.SelectorEngine, global.Tooltip))); (global.Popover = factory(global.SelectorEngine, global.Data, global.Tooltip)));
})(this, function (Data, SelectorEngine, Tooltip) { })(this, function (SelectorEngine, Data, Tooltip) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }; return e && typeof e === 'object' && 'default' in e ? e : { default: e };
} }
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine); var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var Tooltip__default = /*#__PURE__*/ _interopDefaultLegacy(Tooltip); var Tooltip__default = /*#__PURE__*/ _interopDefaultLegacy(Tooltip);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const getjQuery = () => { const getjQuery = () => {
const { jQuery } = window; const { jQuery } = window;
@ -50,12 +43,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -70,7 +64,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): popover.js * Bootstrap (v5.0.1): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -134,18 +128,10 @@
return NAME; return NAME;
} }
static get DATA_KEY() {
return DATA_KEY;
}
static get Event() { static get Event() {
return Event; return Event;
} }
static get EVENT_KEY() {
return EVENT_KEY;
}
static get DefaultType() { static get DefaultType() {
return DefaultType; return DefaultType;
} // Overrides } // Overrides
@ -180,7 +166,7 @@
} }
_getContent() { _getContent() {
return this._element.getAttribute('data-bs-content') || this.config.content; return this._element.getAttribute('data-bs-content') || this._config.content;
} }
_cleanTipClass() { _cleanTipClass() {
@ -224,7 +210,7 @@
* add .Popover to jQuery only if jQuery is present * add .Popover to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Popover); defineJQueryPlugin(Popover);
return Popover; return Popover;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,48 +1,49 @@
/*! /*!
* Bootstrap scrollspy.js v5.0.0 (https://getbootstrap.com/) * Bootstrap scrollspy.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/manipulator.js'), require('./dom/manipulator.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'./dom/selector-engine',
'./dom/event-handler', './dom/event-handler',
'./dom/manipulator', './dom/manipulator',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.ScrollSpy = factory( (global.ScrollSpy = factory(
global.SelectorEngine,
global.EventHandler, global.EventHandler,
global.Manipulator, global.Manipulator,
global.SelectorEngine,
global.Base global.Base
))); )));
})(this, function (EventHandler, Manipulator, SelectorEngine, BaseComponent) { })(this, function (SelectorEngine, EventHandler, Manipulator, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }; return e && typeof e === 'object' && 'default' in e ? e : { default: e };
} }
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js * Bootstrap (v5.0.1): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const MAX_UID = 1000000; const MAX_UID = 1000000;
const toType = (obj) => { const toType = (obj) => {
@ -102,7 +103,17 @@
return null; return null;
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const typeCheckConfig = (componentName, config, configTypes) => { const typeCheckConfig = (componentName, config, configTypes) => {
Object.keys(configTypes).forEach((property) => { Object.keys(configTypes).forEach((property) => {
@ -136,12 +147,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -156,7 +168,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): scrollspy.js * Bootstrap (v5.0.1): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -220,8 +232,8 @@
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
refresh() { refresh() {
@ -263,15 +275,8 @@
} }
dispose() { dispose() {
super.dispose();
EventHandler__default['default'].off(this._scrollElement, EVENT_KEY); EventHandler__default['default'].off(this._scrollElement, EVENT_KEY);
this._scrollElement = null; super.dispose();
this._config = null;
this._selector = null;
this._offsets = null;
this._targets = null;
this._activeTarget = null;
this._scrollHeight = null;
} // Private } // Private
_getConfig(config) { _getConfig(config) {
@ -440,7 +445,7 @@
* add .ScrollSpy to jQuery only if jQuery is present * add .ScrollSpy to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, ScrollSpy); defineJQueryPlugin(ScrollSpy);
return ScrollSpy; return ScrollSpy;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,46 +1,37 @@
/*! /*!
* Bootstrap tab.js v5.0.0 (https://getbootstrap.com/) * Bootstrap tab.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'./dom/selector-engine',
'./dom/data', './dom/data',
'./dom/event-handler', './dom/event-handler',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Tab = factory(global.Data, global.EventHandler, global.SelectorEngine, global.Base))); (global.Tab = factory(global.SelectorEngine, global.Data, global.EventHandler, global.Base)));
})(this, function (Data, EventHandler, SelectorEngine, BaseComponent) { })(this, function (SelectorEngine, Data, EventHandler, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }; return e && typeof e === 'object' && 'default' in e ? e : { default: e };
} }
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data); var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const getSelector = (element) => { const getSelector = (element) => {
let selector = element.getAttribute('data-bs-target'); let selector = element.getAttribute('data-bs-target');
@ -69,49 +60,6 @@
return selector ? document.querySelector(selector) : null; return selector ? document.querySelector(selector) : null;
}; };
const getTransitionDurationFromElement = (element) => {
if (!element) {
return 0;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END));
};
const emulateTransitionEnd = (element, duration) => {
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
}
element.addEventListener(TRANSITION_END, listener);
setTimeout(() => {
if (!called) {
triggerTransitionEnd(element);
}
}, emulatedDuration);
};
const isDisabled = (element) => { const isDisabled = (element) => {
if (!element || element.nodeType !== Node.ELEMENT_NODE) { if (!element || element.nodeType !== Node.ELEMENT_NODE) {
return true; return true;
@ -148,12 +96,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -168,7 +117,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): tab.js * Bootstrap (v5.0.1): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -207,8 +156,8 @@
class Tab extends BaseComponent__default['default'] { class Tab extends BaseComponent__default['default'] {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
show() { show() {
@ -276,10 +225,9 @@
const complete = () => this._transitionComplete(element, active, callback); const complete = () => this._transitionComplete(element, active, callback);
if (active && isTransitioning) { if (active && isTransitioning) {
const transitionDuration = getTransitionDurationFromElement(active);
active.classList.remove(CLASS_NAME_SHOW); active.classList.remove(CLASS_NAME_SHOW);
EventHandler__default['default'].one(active, 'transitionend', complete);
emulateTransitionEnd(active, transitionDuration); this._queueCallback(complete, element, true);
} else { } else {
complete(); complete();
} }
@ -381,7 +329,7 @@
* add .Tab to jQuery only if jQuery is present * add .Tab to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Tab); defineJQueryPlugin(Tab);
return Tab; return Tab;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap toast.js v5.0.0 (https://getbootstrap.com/) * Bootstrap toast.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -32,15 +32,6 @@
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const toType = (obj) => { const toType = (obj) => {
if (obj === null || obj === undefined) { if (obj === null || obj === undefined) {
return `${obj}`; return `${obj}`;
@ -52,49 +43,16 @@
.toLowerCase(); .toLowerCase();
}; };
const getTransitionDurationFromElement = (element) => { const isElement = (obj) => {
if (!element) { if (!obj || typeof obj !== 'object') {
return 0; return false;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END));
};
const isElement = (obj) => (obj[0] || obj).nodeType;
const emulateTransitionEnd = (element, duration) => {
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
} }
element.addEventListener(TRANSITION_END, listener); if (typeof obj.jquery !== 'undefined') {
setTimeout(() => { obj = obj[0];
if (!called) {
triggerTransitionEnd(element);
} }
}, emulatedDuration);
return typeof obj.nodeType !== 'undefined';
}; };
const typeCheckConfig = (componentName, config, configTypes) => { const typeCheckConfig = (componentName, config, configTypes) => {
@ -131,12 +89,13 @@
} }
}; };
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -151,7 +110,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): toast.js * Bootstrap (v5.0.1): toast.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -165,6 +124,10 @@
const DATA_KEY = 'bs.toast'; const DATA_KEY = 'bs.toast';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`; const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
const EVENT_HIDE = `hide${EVENT_KEY}`; const EVENT_HIDE = `hide${EVENT_KEY}`;
const EVENT_HIDDEN = `hidden${EVENT_KEY}`; const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
const EVENT_SHOW = `show${EVENT_KEY}`; const EVENT_SHOW = `show${EVENT_KEY}`;
@ -195,6 +158,8 @@
super(element); super(element);
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._timeout = null; this._timeout = null;
this._hasMouseInteraction = false;
this._hasKeyboardInteraction = false;
this._setListeners(); this._setListeners();
} // Getters } // Getters
@ -207,8 +172,8 @@
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} // Public } // Public
show() { show() {
@ -231,11 +196,7 @@
EventHandler__default['default'].trigger(this._element, EVENT_SHOWN); EventHandler__default['default'].trigger(this._element, EVENT_SHOWN);
if (this._config.autohide) { this._maybeScheduleHide();
this._timeout = setTimeout(() => {
this.hide();
}, this._config.delay);
}
}; };
this._element.classList.remove(CLASS_NAME_HIDE); this._element.classList.remove(CLASS_NAME_HIDE);
@ -244,13 +205,7 @@
this._element.classList.add(CLASS_NAME_SHOWING); this._element.classList.add(CLASS_NAME_SHOWING);
if (this._config.animation) { this._queueCallback(complete, this._element, this._config.animation);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler__default['default'].one(this._element, 'transitionend', complete);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
}
} }
hide() { hide() {
@ -272,13 +227,7 @@
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
if (this._config.animation) { this._queueCallback(complete, this._element, this._config.animation);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler__default['default'].one(this._element, 'transitionend', complete);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
}
} }
dispose() { dispose() {
@ -289,7 +238,6 @@
} }
super.dispose(); super.dispose();
this._config = null;
} // Private } // Private
_getConfig(config) { _getConfig(config) {
@ -302,6 +250,48 @@
return config; return config;
} }
_maybeScheduleHide() {
if (!this._config.autohide) {
return;
}
if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
return;
}
this._timeout = setTimeout(() => {
this.hide();
}, this._config.delay);
}
_onInteraction(event, isInteracting) {
switch (event.type) {
case 'mouseover':
case 'mouseout':
this._hasMouseInteraction = isInteracting;
break;
case 'focusin':
case 'focusout':
this._hasKeyboardInteraction = isInteracting;
break;
}
if (isInteracting) {
this._clearTimeout();
return;
}
const nextElement = event.relatedTarget;
if (this._element === nextElement || this._element.contains(nextElement)) {
return;
}
this._maybeScheduleHide();
}
_setListeners() { _setListeners() {
EventHandler__default['default'].on( EventHandler__default['default'].on(
this._element, this._element,
@ -309,6 +299,18 @@
SELECTOR_DATA_DISMISS, SELECTOR_DATA_DISMISS,
() => this.hide() () => this.hide()
); );
EventHandler__default['default'].on(this._element, EVENT_MOUSEOVER, (event) =>
this._onInteraction(event, true)
);
EventHandler__default['default'].on(this._element, EVENT_MOUSEOUT, (event) =>
this._onInteraction(event, false)
);
EventHandler__default['default'].on(this._element, EVENT_FOCUSIN, (event) =>
this._onInteraction(event, true)
);
EventHandler__default['default'].on(this._element, EVENT_FOCUSOUT, (event) =>
this._onInteraction(event, false)
);
} }
_clearTimeout() { _clearTimeout() {
@ -343,7 +345,7 @@
* add .Toast to jQuery only if jQuery is present * add .Toast to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Toast); defineJQueryPlugin(Toast);
return Toast; return Toast;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap tooltip.js v5.0.0 (https://getbootstrap.com/) * Bootstrap tooltip.js v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -7,31 +7,31 @@
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory( ? (module.exports = factory(
require('@popperjs/core'), require('@popperjs/core'),
require('./dom/selector-engine.js'),
require('./dom/data.js'), require('./dom/data.js'),
require('./dom/event-handler.js'), require('./dom/event-handler.js'),
require('./dom/manipulator.js'), require('./dom/manipulator.js'),
require('./dom/selector-engine.js'),
require('./base-component.js') require('./base-component.js')
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define([ ? define([
'@popperjs/core', '@popperjs/core',
'./dom/selector-engine',
'./dom/data', './dom/data',
'./dom/event-handler', './dom/event-handler',
'./dom/manipulator', './dom/manipulator',
'./dom/selector-engine',
'./base-component', './base-component',
], factory) ], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Tooltip = factory( (global.Tooltip = factory(
global.Popper, global.Popper,
global.SelectorEngine,
global.Data, global.Data,
global.EventHandler, global.EventHandler,
global.Manipulator, global.Manipulator,
global.SelectorEngine,
global.Base global.Base
))); )));
})(this, function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { })(this, function (Popper, SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) {
'use strict'; 'use strict';
function _interopDefaultLegacy(e) { function _interopDefaultLegacy(e) {
@ -65,21 +65,20 @@
} }
var Popper__namespace = /*#__PURE__*/ _interopNamespace(Popper); var Popper__namespace = /*#__PURE__*/ _interopNamespace(Popper);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data); var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler); var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator); var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent); var BaseComponent__default = /*#__PURE__*/ _interopDefaultLegacy(BaseComponent);
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js * Bootstrap (v5.0.1): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const MAX_UID = 1000000; const MAX_UID = 1000000;
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
const toType = (obj) => { const toType = (obj) => {
if (obj === null || obj === undefined) { if (obj === null || obj === undefined) {
@ -105,49 +104,29 @@
return prefix; return prefix;
}; };
const getTransitionDurationFromElement = (element) => { const isElement = (obj) => {
if (!element) { if (!obj || typeof obj !== 'object') {
return 0; return false;
} // Get transition-duration of the element
let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
const floatTransitionDuration = Number.parseFloat(transitionDuration);
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (
(Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *
MILLISECONDS_MULTIPLIER
);
};
const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END));
};
const isElement = (obj) => (obj[0] || obj).nodeType;
const emulateTransitionEnd = (element, duration) => {
let called = false;
const durationPadding = 5;
const emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
} }
element.addEventListener(TRANSITION_END, listener); if (typeof obj.jquery !== 'undefined') {
setTimeout(() => { obj = obj[0];
if (!called) {
triggerTransitionEnd(element);
} }
}, emulatedDuration);
return typeof obj.nodeType !== 'undefined';
};
const getElement = (obj) => {
if (isElement(obj)) {
// it's a jQuery object or a node element
return obj.jquery ? obj[0] : obj;
}
if (typeof obj === 'string' && obj.length > 0) {
return SelectorEngine__default['default'].findOne(obj);
}
return null;
}; };
const typeCheckConfig = (componentName, config, configTypes) => { const typeCheckConfig = (componentName, config, configTypes) => {
@ -207,12 +186,13 @@
const isRTL = () => document.documentElement.dir === 'rtl'; const isRTL = () => document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -227,7 +207,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/sanitizer.js * Bootstrap (v5.0.1): util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -351,7 +331,7 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): tooltip.js * Bootstrap (v5.0.1): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -416,7 +396,7 @@
allowList: DefaultAllowlist, allowList: DefaultAllowlist,
popperConfig: null, popperConfig: null,
}; };
const Event$1 = { const Event = {
HIDE: `hide${EVENT_KEY}`, HIDE: `hide${EVENT_KEY}`,
HIDDEN: `hidden${EVENT_KEY}`, HIDDEN: `hidden${EVENT_KEY}`,
SHOW: `show${EVENT_KEY}`, SHOW: `show${EVENT_KEY}`,
@ -458,7 +438,7 @@
this._activeTrigger = {}; this._activeTrigger = {};
this._popper = null; // Protected this._popper = null; // Protected
this.config = this._getConfig(config); this._config = this._getConfig(config);
this.tip = null; this.tip = null;
this._setListeners(); this._setListeners();
@ -472,16 +452,8 @@
return NAME; return NAME;
} }
static get DATA_KEY() {
return DATA_KEY;
}
static get Event() { static get Event() {
return Event$1; return Event;
}
static get EVENT_KEY() {
return EVENT_KEY;
} }
static get DefaultType() { static get DefaultType() {
@ -538,18 +510,10 @@
this.tip.parentNode.removeChild(this.tip); this.tip.parentNode.removeChild(this.tip);
} }
this._isEnabled = null;
this._timeout = null;
this._hoverState = null;
this._activeTrigger = null;
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
} }
this._popper = null;
this.config = null;
this.tip = null;
super.dispose(); super.dispose();
} }
@ -584,21 +548,20 @@
this.setContent(); this.setContent();
if (this.config.animation) { if (this._config.animation) {
tip.classList.add(CLASS_NAME_FADE); tip.classList.add(CLASS_NAME_FADE);
} }
const placement = const placement =
typeof this.config.placement === 'function' typeof this._config.placement === 'function'
? this.config.placement.call(this, tip, this._element) ? this._config.placement.call(this, tip, this._element)
: this.config.placement; : this._config.placement;
const attachment = this._getAttachment(placement); const attachment = this._getAttachment(placement);
this._addAttachmentClass(attachment); this._addAttachmentClass(attachment);
const container = this._getContainer(); const { container } = this._config;
Data__default['default'].set(tip, this.constructor.DATA_KEY, this); Data__default['default'].set(tip, this.constructor.DATA_KEY, this);
if (!this._element.ownerDocument.documentElement.contains(this.tip)) { if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
@ -618,9 +581,9 @@
tip.classList.add(CLASS_NAME_SHOW); tip.classList.add(CLASS_NAME_SHOW);
const customClass = const customClass =
typeof this.config.customClass === 'function' typeof this._config.customClass === 'function'
? this.config.customClass() ? this._config.customClass()
: this.config.customClass; : this._config.customClass;
if (customClass) { if (customClass) {
tip.classList.add(...customClass.split(' ')); tip.classList.add(...customClass.split(' '));
@ -645,13 +608,9 @@
} }
}; };
if (this.tip.classList.contains(CLASS_NAME_FADE)) { const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
const transitionDuration = getTransitionDurationFromElement(this.tip);
EventHandler__default['default'].one(this.tip, 'transitionend', complete); this._queueCallback(complete, this.tip, isAnimated);
emulateTransitionEnd(this.tip, transitionDuration);
} else {
complete();
}
} }
hide() { hide() {
@ -704,14 +663,9 @@
this._activeTrigger[TRIGGER_CLICK] = false; this._activeTrigger[TRIGGER_CLICK] = false;
this._activeTrigger[TRIGGER_FOCUS] = false; this._activeTrigger[TRIGGER_FOCUS] = false;
this._activeTrigger[TRIGGER_HOVER] = false; this._activeTrigger[TRIGGER_HOVER] = false;
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
if (this.tip.classList.contains(CLASS_NAME_FADE)) { this._queueCallback(complete, this.tip, isAnimated);
const transitionDuration = getTransitionDurationFromElement(tip);
EventHandler__default['default'].one(tip, 'transitionend', complete);
emulateTransitionEnd(tip, transitionDuration);
} else {
complete();
}
this._hoverState = ''; this._hoverState = '';
} }
@ -732,7 +686,7 @@
} }
const element = document.createElement('div'); const element = document.createElement('div');
element.innerHTML = this.config.template; element.innerHTML = this._config.template;
this.tip = element.children[0]; this.tip = element.children[0];
return this.tip; return this.tip;
} }
@ -751,12 +705,10 @@
return; return;
} }
if (typeof content === 'object' && isElement(content)) { if (isElement(content)) {
if (content.jquery) { content = getElement(content); // content is a DOM node or a jQuery
content = content[0];
} // content is a DOM node or a jQuery
if (this.config.html) { if (this._config.html) {
if (content.parentNode !== element) { if (content.parentNode !== element) {
element.innerHTML = ''; element.innerHTML = '';
element.appendChild(content); element.appendChild(content);
@ -768,9 +720,9 @@
return; return;
} }
if (this.config.html) { if (this._config.html) {
if (this.config.sanitize) { if (this._config.sanitize) {
content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn); content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
} }
element.innerHTML = content; element.innerHTML = content;
@ -784,9 +736,9 @@
if (!title) { if (!title) {
title = title =
typeof this.config.title === 'function' typeof this._config.title === 'function'
? this.config.title.call(this._element) ? this._config.title.call(this._element)
: this.config.title; : this._config.title;
} }
return title; return title;
@ -817,7 +769,7 @@
} }
_getOffset() { _getOffset() {
const { offset } = this.config; const { offset } = this._config;
if (typeof offset === 'string') { if (typeof offset === 'string') {
return offset.split(',').map((val) => Number.parseInt(val, 10)); return offset.split(',').map((val) => Number.parseInt(val, 10));
@ -837,7 +789,7 @@
{ {
name: 'flip', name: 'flip',
options: { options: {
fallbackPlacements: this.config.fallbackPlacements, fallbackPlacements: this._config.fallbackPlacements,
}, },
}, },
{ {
@ -849,7 +801,7 @@
{ {
name: 'preventOverflow', name: 'preventOverflow',
options: { options: {
boundary: this.config.boundary, boundary: this._config.boundary,
}, },
}, },
{ {
@ -873,9 +825,9 @@
}; };
return { return {
...defaultBsPopperConfig, ...defaultBsPopperConfig,
...(typeof this.config.popperConfig === 'function' ...(typeof this._config.popperConfig === 'function'
? this.config.popperConfig(defaultBsPopperConfig) ? this._config.popperConfig(defaultBsPopperConfig)
: this.config.popperConfig), : this._config.popperConfig),
}; };
} }
@ -883,30 +835,19 @@
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`); this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
} }
_getContainer() {
if (this.config.container === false) {
return document.body;
}
if (isElement(this.config.container)) {
return this.config.container;
}
return SelectorEngine__default['default'].findOne(this.config.container);
}
_getAttachment(placement) { _getAttachment(placement) {
return AttachmentMap[placement.toUpperCase()]; return AttachmentMap[placement.toUpperCase()];
} }
_setListeners() { _setListeners() {
const triggers = this.config.trigger.split(' '); const triggers = this._config.trigger.split(' ');
triggers.forEach((trigger) => { triggers.forEach((trigger) => {
if (trigger === 'click') { if (trigger === 'click') {
EventHandler__default['default'].on( EventHandler__default['default'].on(
this._element, this._element,
this.constructor.Event.CLICK, this.constructor.Event.CLICK,
this.config.selector, this._config.selector,
(event) => this.toggle(event) (event) => this.toggle(event)
); );
} else if (trigger !== TRIGGER_MANUAL) { } else if (trigger !== TRIGGER_MANUAL) {
@ -921,13 +862,13 @@
EventHandler__default['default'].on( EventHandler__default['default'].on(
this._element, this._element,
eventIn, eventIn,
this.config.selector, this._config.selector,
(event) => this._enter(event) (event) => this._enter(event)
); );
EventHandler__default['default'].on( EventHandler__default['default'].on(
this._element, this._element,
eventOut, eventOut,
this.config.selector, this._config.selector,
(event) => this._leave(event) (event) => this._leave(event)
); );
} }
@ -945,8 +886,8 @@
this._hideModalHandler this._hideModalHandler
); );
if (this.config.selector) { if (this._config.selector) {
this.config = { ...this.config, trigger: 'manual', selector: '' }; this._config = { ...this._config, trigger: 'manual', selector: '' };
} else { } else {
this._fixTitle(); this._fixTitle();
} }
@ -986,7 +927,7 @@
clearTimeout(context._timeout); clearTimeout(context._timeout);
context._hoverState = HOVER_STATE_SHOW; context._hoverState = HOVER_STATE_SHOW;
if (!context.config.delay || !context.config.delay.show) { if (!context._config.delay || !context._config.delay.show) {
context.show(); context.show();
return; return;
} }
@ -995,7 +936,7 @@
if (context._hoverState === HOVER_STATE_SHOW) { if (context._hoverState === HOVER_STATE_SHOW) {
context.show(); context.show();
} }
}, context.config.delay.show); }, context._config.delay.show);
} }
_leave(event, context) { _leave(event, context) {
@ -1014,7 +955,7 @@
clearTimeout(context._timeout); clearTimeout(context._timeout);
context._hoverState = HOVER_STATE_OUT; context._hoverState = HOVER_STATE_OUT;
if (!context.config.delay || !context.config.delay.hide) { if (!context._config.delay || !context._config.delay.hide) {
context.hide(); context.hide();
return; return;
} }
@ -1023,7 +964,7 @@
if (context._hoverState === HOVER_STATE_OUT) { if (context._hoverState === HOVER_STATE_OUT) {
context.hide(); context.hide();
} }
}, context.config.delay.hide); }, context._config.delay.hide);
} }
_isWithActiveTrigger() { _isWithActiveTrigger() {
@ -1043,16 +984,12 @@
delete dataAttributes[dataAttr]; delete dataAttributes[dataAttr];
} }
}); });
if (config && typeof config.container === 'object' && config.container.jquery) {
config.container = config.container[0];
}
config = { config = {
...this.constructor.Default, ...this.constructor.Default,
...dataAttributes, ...dataAttributes,
...(typeof config === 'object' && config ? config : {}), ...(typeof config === 'object' && config ? config : {}),
}; };
config.container = config.container === false ? document.body : getElement(config.container);
if (typeof config.delay === 'number') { if (typeof config.delay === 'number') {
config.delay = { config.delay = {
@ -1081,10 +1018,10 @@
_getDelegateConfig() { _getDelegateConfig() {
const config = {}; const config = {};
if (this.config) { if (this._config) {
for (const key in this.config) { for (const key in this._config) {
if (this.constructor.Default[key] !== this.config[key]) { if (this.constructor.Default[key] !== this._config[key]) {
config[key] = this.config[key]; config[key] = this._config[key];
} }
} }
} }
@ -1146,7 +1083,7 @@
* add .Tooltip to jQuery only if jQuery is present * add .Tooltip to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Tooltip); defineJQueryPlugin(Tooltip);
return Tooltip; return Tooltip;
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,11 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): alert.js * Bootstrap (v5.0.1): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import { defineJQueryPlugin, getElementFromSelector } from './util/index';
defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
} from './util/index';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import BaseComponent from './base-component'; import BaseComponent from './base-component';
@ -45,8 +40,8 @@ const CLASS_NAME_SHOW = 'show';
class Alert extends BaseComponent { class Alert extends BaseComponent {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -75,15 +70,8 @@ class Alert extends BaseComponent {
_removeElement(element) { _removeElement(element) {
element.classList.remove(CLASS_NAME_SHOW); element.classList.remove(CLASS_NAME_SHOW);
if (!element.classList.contains(CLASS_NAME_FADE)) { const isAnimated = element.classList.contains(CLASS_NAME_FADE);
this._destroyElement(element); this._queueCallback(() => this._destroyElement(element), element, isAnimated);
return;
}
const transitionDuration = getTransitionDurationFromElement(element);
EventHandler.one(element, 'transitionend', () => this._destroyElement(element));
emulateTransitionEnd(element, transitionDuration);
} }
_destroyElement(element) { _destroyElement(element) {
@ -136,6 +124,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDi
* add .Alert to jQuery only if jQuery is present * add .Alert to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Alert); defineJQueryPlugin(Alert);
export default Alert; export default Alert;

View File

@ -1,11 +1,17 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): base-component.js * Bootstrap (v5.0.1): base-component.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import Data from './dom/data'; import Data from './dom/data';
import {
emulateTransitionEnd,
execute,
getElement,
getTransitionDurationFromElement,
} from './util/index';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
/** /**
@ -14,11 +20,11 @@ import EventHandler from './dom/event-handler';
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
const VERSION = '5.0.0'; const VERSION = '5.0.1';
class BaseComponent { class BaseComponent {
constructor(element) { constructor(element) {
element = typeof element === 'string' ? document.querySelector(element) : element; element = getElement(element);
if (!element) { if (!element) {
return; return;
@ -30,8 +36,23 @@ class BaseComponent {
dispose() { dispose() {
Data.remove(this._element, this.constructor.DATA_KEY); Data.remove(this._element, this.constructor.DATA_KEY);
EventHandler.off(this._element, `.${this.constructor.DATA_KEY}`); EventHandler.off(this._element, this.constructor.EVENT_KEY);
this._element = null;
Object.getOwnPropertyNames(this).forEach((propertyName) => {
this[propertyName] = null;
});
}
_queueCallback(callback, element, isAnimated = true) {
if (!isAnimated) {
execute(callback);
return;
}
const transitionDuration = getTransitionDurationFromElement(element);
EventHandler.one(element, 'transitionend', () => execute(callback));
emulateTransitionEnd(element, transitionDuration);
} }
/** Static */ /** Static */
@ -43,6 +64,18 @@ class BaseComponent {
static get VERSION() { static get VERSION() {
return VERSION; return VERSION;
} }
static get NAME() {
throw new Error('You have to implement the static method "NAME", for each component!');
}
static get DATA_KEY() {
return `bs.${this.NAME}`;
}
static get EVENT_KEY() {
return `.${this.DATA_KEY}`;
}
} }
export default BaseComponent; export default BaseComponent;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): button.js * Bootstrap (v5.0.1): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -36,8 +36,8 @@ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
class Button extends BaseComponent { class Button extends BaseComponent {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -90,6 +90,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, (event) =>
* add .Button to jQuery only if jQuery is present * add .Button to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Button); defineJQueryPlugin(Button);
export default Button; export default Button;

View File

@ -1,15 +1,13 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): carousel.js * Bootstrap (v5.0.1): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector, getElementFromSelector,
getTransitionDurationFromElement,
isRTL, isRTL,
isVisible, isVisible,
reflow, reflow,
@ -130,8 +128,8 @@ class Carousel extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -214,18 +212,6 @@ class Carousel extends BaseComponent {
this._slide(order, this._items[index]); this._slide(order, this._items[index]);
} }
dispose() {
this._items = null;
this._config = null;
this._interval = null;
this._isPaused = null;
this._isSliding = null;
this._activeElement = null;
this._indicatorsElement = null;
super.dispose();
}
// Private // Private
_getConfig(config) { _getConfig(config) {
@ -465,6 +451,15 @@ class Carousel extends BaseComponent {
this._setActiveIndicatorElement(nextElement); this._setActiveIndicatorElement(nextElement);
this._activeElement = nextElement; this._activeElement = nextElement;
const triggerSlidEvent = () => {
EventHandler.trigger(this._element, EVENT_SLID, {
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
};
if (this._element.classList.contains(CLASS_NAME_SLIDE)) { if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
nextElement.classList.add(orderClassName); nextElement.classList.add(orderClassName);
@ -473,9 +468,7 @@ class Carousel extends BaseComponent {
activeElement.classList.add(directionalClassName); activeElement.classList.add(directionalClassName);
nextElement.classList.add(directionalClassName); nextElement.classList.add(directionalClassName);
const transitionDuration = getTransitionDurationFromElement(activeElement); const completeCallBack = () => {
EventHandler.one(activeElement, 'transitionend', () => {
nextElement.classList.remove(directionalClassName, orderClassName); nextElement.classList.remove(directionalClassName, orderClassName);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
@ -483,28 +476,16 @@ class Carousel extends BaseComponent {
this._isSliding = false; this._isSliding = false;
setTimeout(() => { setTimeout(triggerSlidEvent, 0);
EventHandler.trigger(this._element, EVENT_SLID, { };
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
}, 0);
});
emulateTransitionEnd(activeElement, transitionDuration); this._queueCallback(completeCallBack, activeElement, true);
} else { } else {
activeElement.classList.remove(CLASS_NAME_ACTIVE); activeElement.classList.remove(CLASS_NAME_ACTIVE);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
this._isSliding = false; this._isSliding = false;
EventHandler.trigger(this._element, EVENT_SLID, { triggerSlidEvent();
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
} }
if (isCycling) { if (isCycling) {
@ -628,6 +609,6 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
* add .Carousel to jQuery only if jQuery is present * add .Carousel to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Carousel); defineJQueryPlugin(Carousel);
export default Carousel; export default Carousel;

View File

@ -1,17 +1,15 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): collapse.js * Bootstrap (v5.0.1): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd, getElement,
getSelectorFromElement, getSelectorFromElement,
getElementFromSelector, getElementFromSelector,
getTransitionDurationFromElement,
isElement,
reflow, reflow,
typeCheckConfig, typeCheckConfig,
} from './util/index'; } from './util/index';
@ -108,8 +106,8 @@ class Collapse extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -200,11 +198,8 @@ class Collapse extends BaseComponent {
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
const scrollSize = `scroll${capitalizedDimension}`; const scrollSize = `scroll${capitalizedDimension}`;
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, true);
emulateTransitionEnd(this._element, transitionDuration);
this._element.style[dimension] = `${this._element[scrollSize]}px`; this._element.style[dimension] = `${this._element[scrollSize]}px`;
} }
@ -250,24 +245,14 @@ class Collapse extends BaseComponent {
}; };
this._element.style[dimension] = ''; this._element.style[dimension] = '';
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, true);
emulateTransitionEnd(this._element, transitionDuration);
} }
setTransitioning(isTransitioning) { setTransitioning(isTransitioning) {
this._isTransitioning = isTransitioning; this._isTransitioning = isTransitioning;
} }
dispose() {
super.dispose();
this._config = null;
this._parent = null;
this._triggerArray = null;
this._isTransitioning = null;
}
// Private // Private
_getConfig(config) { _getConfig(config) {
@ -287,14 +272,7 @@ class Collapse extends BaseComponent {
_getParent() { _getParent() {
let { parent } = this._config; let { parent } = this._config;
if (isElement(parent)) { parent = getElement(parent);
// it's a jQuery object
if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
parent = parent[0];
}
} else {
parent = SelectorEngine.findOne(parent);
}
const selector = `${SELECTOR_DATA_TOGGLE}[data-mdb-parent="${parent}"]`; const selector = `${SELECTOR_DATA_TOGGLE}[data-mdb-parent="${parent}"]`;
@ -404,6 +382,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Collapse to jQuery only if jQuery is present * add .Collapse to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Collapse); defineJQueryPlugin(Collapse);
export default Collapse; export default Collapse;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/data.js * Bootstrap (v5.0.1): dom/data.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/event-handler.js * Bootstrap (v5.0.1): dom/event-handler.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/manipulator.js * Bootstrap (v5.0.1): dom/manipulator.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -46,9 +46,9 @@ const Manipulator = {
const attributes = {}; const attributes = {};
Object.keys(element.dataset) Object.keys(element.dataset)
.filter((key) => key.startsWith('mdb')) .filter((key) => key.startsWith('bs'))
.forEach((key) => { .forEach((key) => {
let pureKey = key.replace(/^mdb/, ''); let pureKey = key.replace(/^bs/, '');
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
attributes[pureKey] = normalizeData(element.dataset[key]); attributes[pureKey] = normalizeData(element.dataset[key]);
}); });

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/selector-engine.js * Bootstrap (v5.0.1): dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dropdown.js * Bootstrap (v5.0.1): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -9,6 +9,7 @@ import * as Popper from '@popperjs/core';
import { import {
defineJQueryPlugin, defineJQueryPlugin,
getElement,
getElementFromSelector, getElementFromSelector,
isDisabled, isDisabled,
isElement, isElement,
@ -116,8 +117,8 @@ class Dropdown extends BaseComponent {
return DefaultType; return DefaultType;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -166,12 +167,7 @@ class Dropdown extends BaseComponent {
if (this._config.reference === 'parent') { if (this._config.reference === 'parent') {
referenceElement = parent; referenceElement = parent;
} else if (isElement(this._config.reference)) { } else if (isElement(this._config.reference)) {
referenceElement = this._config.reference; referenceElement = getElement(this._config.reference);
// Check if it's jQuery element
if (typeof this._config.reference.jquery !== 'undefined') {
referenceElement = this._config.reference[0];
}
} else if (typeof this._config.reference === 'object') { } else if (typeof this._config.reference === 'object') {
referenceElement = this._config.reference; referenceElement = this._config.reference;
} }
@ -219,11 +215,8 @@ class Dropdown extends BaseComponent {
} }
dispose() { dispose() {
this._menu = null;
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
this._popper = null;
} }
super.dispose(); super.dispose();
@ -424,19 +417,13 @@ class Dropdown extends BaseComponent {
} }
static clearMenus(event) { static clearMenus(event) {
if (event) {
if ( if (
event.button === RIGHT_MOUSE_BUTTON || event &&
(event.type === 'keyup' && event.key !== TAB_KEY) (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY))
) { ) {
return; return;
} }
if (/input|select|option|textarea|form/i.test(event.target.tagName)) {
return;
}
}
const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE); const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
for (let i = 0, len = toggles.length; i < len; i++) { for (let i = 0, len = toggles.length; i < len; i++) {
@ -464,11 +451,11 @@ class Dropdown extends BaseComponent {
continue; continue;
} }
// Tab navigation through the dropdown menu shouldn't close the menu // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
if ( if (
event.type === 'keyup' && context._menu.contains(event.target) &&
event.key === TAB_KEY && ((event.type === 'keyup' && event.key === TAB_KEY) ||
context._menu.contains(event.target) /input|select|option|textarea|form/i.test(event.target.tagName))
) { ) {
continue; continue;
} }
@ -570,6 +557,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Dropdown to jQuery only if jQuery is present * add .Dropdown to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Dropdown); defineJQueryPlugin(Dropdown);
export default Dropdown; export default Dropdown;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): modal.js * Bootstrap (v5.0.1): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -97,8 +97,8 @@ class Modal extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -182,19 +182,13 @@ class Modal extends BaseComponent {
EventHandler.off(this._element, EVENT_CLICK_DISMISS); EventHandler.off(this._element, EVENT_CLICK_DISMISS);
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS); EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
if (isAnimated) { this._queueCallback(() => this._hideModal(), this._element, isAnimated);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', (event) => this._hideModal(event));
emulateTransitionEnd(this._element, transitionDuration);
} else {
this._hideModal();
}
} }
dispose() { dispose() {
[window, this._dialog].forEach((htmlElement) => EventHandler.off(htmlElement, EVENT_KEY)); [window, this._dialog].forEach((htmlElement) => EventHandler.off(htmlElement, EVENT_KEY));
this._backdrop.dispose();
super.dispose(); super.dispose();
/** /**
@ -203,14 +197,6 @@ class Modal extends BaseComponent {
* It will remove `EVENT_CLICK_DATA_API` event that should remain * It will remove `EVENT_CLICK_DATA_API` event that should remain
*/ */
EventHandler.off(document, EVENT_FOCUSIN); EventHandler.off(document, EVENT_FOCUSIN);
this._config = null;
this._dialog = null;
this._backdrop.dispose();
this._backdrop = null;
this._isShown = null;
this._ignoreBackdropClick = null;
this._isTransitioning = null;
} }
handleUpdate() { handleUpdate() {
@ -276,14 +262,7 @@ class Modal extends BaseComponent {
}); });
}; };
if (isAnimated) { this._queueCallback(transitionComplete, this._dialog, isAnimated);
const transitionDuration = getTransitionDurationFromElement(this._dialog);
EventHandler.one(this._dialog, 'transitionend', transitionComplete);
emulateTransitionEnd(this._dialog, transitionDuration);
} else {
transitionComplete();
}
} }
_enforceFocus() { _enforceFocus() {
@ -476,6 +455,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Modal to jQuery only if jQuery is present * add .Modal to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Modal); defineJQueryPlugin(Modal);
export default Modal; export default Modal;

View File

@ -1,15 +1,13 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): offcanvas.js * Bootstrap (v5.0.1): offcanvas.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector, getElementFromSelector,
getTransitionDurationFromElement,
isDisabled, isDisabled,
isVisible, isVisible,
typeCheckConfig, typeCheckConfig,
@ -80,12 +78,12 @@ class Offcanvas extends BaseComponent {
// Getters // Getters
static get Default() { static get NAME() {
return Default; return NAME;
} }
static get DATA_KEY() { static get Default() {
return DATA_KEY; return Default;
} }
// Public // Public
@ -124,9 +122,7 @@ class Offcanvas extends BaseComponent {
EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget }); EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget });
}; };
const transitionDuration = getTransitionDurationFromElement(this._element); this._queueCallback(completeCallBack, this._element, true);
EventHandler.one(this._element, 'transitionend', completeCallBack);
emulateTransitionEnd(this._element, transitionDuration);
} }
hide() { hide() {
@ -159,18 +155,13 @@ class Offcanvas extends BaseComponent {
EventHandler.trigger(this._element, EVENT_HIDDEN); EventHandler.trigger(this._element, EVENT_HIDDEN);
}; };
const transitionDuration = getTransitionDurationFromElement(this._element); this._queueCallback(completeCallback, this._element, true);
EventHandler.one(this._element, 'transitionend', completeCallback);
emulateTransitionEnd(this._element, transitionDuration);
} }
dispose() { dispose() {
this._backdrop.dispose(); this._backdrop.dispose();
super.dispose(); super.dispose();
EventHandler.off(document, EVENT_FOCUSIN); EventHandler.off(document, EVENT_FOCUSIN);
this._config = null;
this._backdrop = null;
} }
// Private // Private
@ -285,6 +276,6 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
defineJQueryPlugin(NAME, Offcanvas); defineJQueryPlugin(Offcanvas);
export default Offcanvas; export default Offcanvas;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): popover.js * Bootstrap (v5.0.1): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -77,18 +77,10 @@ class Popover extends Tooltip {
return NAME; return NAME;
} }
static get DATA_KEY() {
return DATA_KEY;
}
static get Event() { static get Event() {
return Event; return Event;
} }
static get EVENT_KEY() {
return EVENT_KEY;
}
static get DefaultType() { static get DefaultType() {
return DefaultType; return DefaultType;
} }
@ -121,7 +113,7 @@ class Popover extends Tooltip {
} }
_getContent() { _getContent() {
return this._element.getAttribute('data-mdb-content') || this.config.content; return this._element.getAttribute('data-mdb-content') || this._config.content;
} }
_cleanTipClass() { _cleanTipClass() {
@ -166,6 +158,6 @@ class Popover extends Tooltip {
* add .Popover to jQuery only if jQuery is present * add .Popover to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Popover); defineJQueryPlugin(Popover);
export default Popover; export default Popover;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): scrollspy.js * Bootstrap (v5.0.1): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -87,8 +87,8 @@ class ScrollSpy extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -130,16 +130,8 @@ class ScrollSpy extends BaseComponent {
} }
dispose() { dispose() {
super.dispose();
EventHandler.off(this._scrollElement, EVENT_KEY); EventHandler.off(this._scrollElement, EVENT_KEY);
super.dispose();
this._scrollElement = null;
this._config = null;
this._selector = null;
this._offsets = null;
this._targets = null;
this._activeTarget = null;
this._scrollHeight = null;
} }
// Private // Private
@ -310,6 +302,6 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
* add .ScrollSpy to jQuery only if jQuery is present * add .ScrollSpy to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, ScrollSpy); defineJQueryPlugin(ScrollSpy);
export default ScrollSpy; export default ScrollSpy;

View File

@ -1,18 +1,11 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): tab.js * Bootstrap (v5.0.1): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import { defineJQueryPlugin, getElementFromSelector, isDisabled, reflow } from './util/index';
defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
isDisabled,
reflow,
} from './util/index';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import SelectorEngine from './dom/selector-engine'; import SelectorEngine from './dom/selector-engine';
@ -58,8 +51,8 @@ const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
class Tab extends BaseComponent { class Tab extends BaseComponent {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -132,11 +125,8 @@ class Tab extends BaseComponent {
const complete = () => this._transitionComplete(element, active, callback); const complete = () => this._transitionComplete(element, active, callback);
if (active && isTransitioning) { if (active && isTransitioning) {
const transitionDuration = getTransitionDurationFromElement(active);
active.classList.remove(CLASS_NAME_SHOW); active.classList.remove(CLASS_NAME_SHOW);
this._queueCallback(complete, element, true);
EventHandler.one(active, 'transitionend', complete);
emulateTransitionEnd(active, transitionDuration);
} else { } else {
complete(); complete();
} }
@ -236,6 +226,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Tab to jQuery only if jQuery is present * add .Tab to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Tab); defineJQueryPlugin(Tab);
export default Tab; export default Tab;

View File

@ -1,17 +1,11 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): toast.js * Bootstrap (v5.0.1): toast.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import { defineJQueryPlugin, reflow, typeCheckConfig } from './util/index';
defineJQueryPlugin,
emulateTransitionEnd,
getTransitionDurationFromElement,
reflow,
typeCheckConfig,
} from './util/index';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import Manipulator from './dom/manipulator'; import Manipulator from './dom/manipulator';
@ -28,6 +22,10 @@ const DATA_KEY = 'bs.toast';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`; const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
const EVENT_HIDE = `hide${EVENT_KEY}`; const EVENT_HIDE = `hide${EVENT_KEY}`;
const EVENT_HIDDEN = `hidden${EVENT_KEY}`; const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
const EVENT_SHOW = `show${EVENT_KEY}`; const EVENT_SHOW = `show${EVENT_KEY}`;
@ -64,6 +62,8 @@ class Toast extends BaseComponent {
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._timeout = null; this._timeout = null;
this._hasMouseInteraction = false;
this._hasKeyboardInteraction = false;
this._setListeners(); this._setListeners();
} }
@ -77,8 +77,8 @@ class Toast extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -102,24 +102,14 @@ class Toast extends BaseComponent {
EventHandler.trigger(this._element, EVENT_SHOWN); EventHandler.trigger(this._element, EVENT_SHOWN);
if (this._config.autohide) { this._maybeScheduleHide();
this._timeout = setTimeout(() => {
this.hide();
}, this._config.delay);
}
}; };
this._element.classList.remove(CLASS_NAME_HIDE); this._element.classList.remove(CLASS_NAME_HIDE);
reflow(this._element); reflow(this._element);
this._element.classList.add(CLASS_NAME_SHOWING); this._element.classList.add(CLASS_NAME_SHOWING);
if (this._config.animation) {
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, this._config.animation);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
}
} }
hide() { hide() {
@ -139,14 +129,7 @@ class Toast extends BaseComponent {
}; };
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
if (this._config.animation) { this._queueCallback(complete, this._element, this._config.animation);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
}
} }
dispose() { dispose() {
@ -157,7 +140,6 @@ class Toast extends BaseComponent {
} }
super.dispose(); super.dispose();
this._config = null;
} }
// Private // Private
@ -174,8 +156,53 @@ class Toast extends BaseComponent {
return config; return config;
} }
_maybeScheduleHide() {
if (!this._config.autohide) {
return;
}
if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
return;
}
this._timeout = setTimeout(() => {
this.hide();
}, this._config.delay);
}
_onInteraction(event, isInteracting) {
switch (event.type) {
case 'mouseover':
case 'mouseout':
this._hasMouseInteraction = isInteracting;
break;
case 'focusin':
case 'focusout':
this._hasKeyboardInteraction = isInteracting;
break;
default:
break;
}
if (isInteracting) {
this._clearTimeout();
return;
}
const nextElement = event.relatedTarget;
if (this._element === nextElement || this._element.contains(nextElement)) {
return;
}
this._maybeScheduleHide();
}
_setListeners() { _setListeners() {
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide()); EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
EventHandler.on(this._element, EVENT_MOUSEOVER, (event) => this._onInteraction(event, true));
EventHandler.on(this._element, EVENT_MOUSEOUT, (event) => this._onInteraction(event, false));
EventHandler.on(this._element, EVENT_FOCUSIN, (event) => this._onInteraction(event, true));
EventHandler.on(this._element, EVENT_FOCUSOUT, (event) => this._onInteraction(event, false));
} }
_clearTimeout() { _clearTimeout() {
@ -212,6 +239,6 @@ class Toast extends BaseComponent {
* add .Toast to jQuery only if jQuery is present * add .Toast to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Toast); defineJQueryPlugin(Toast);
export default Toast; export default Toast;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): tooltip.js * Bootstrap (v5.0.1): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -9,9 +9,8 @@ import * as Popper from '@popperjs/core';
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd,
findShadowRoot, findShadowRoot,
getTransitionDurationFromElement, getElement,
getUID, getUID,
isElement, isElement,
isRTL, isRTL,
@ -139,7 +138,7 @@ class Tooltip extends BaseComponent {
this._popper = null; this._popper = null;
// Protected // Protected
this.config = this._getConfig(config); this._config = this._getConfig(config);
this.tip = null; this.tip = null;
this._setListeners(); this._setListeners();
@ -155,18 +154,10 @@ class Tooltip extends BaseComponent {
return NAME; return NAME;
} }
static get DATA_KEY() {
return DATA_KEY;
}
static get Event() { static get Event() {
return Event; return Event;
} }
static get EVENT_KEY() {
return EVENT_KEY;
}
static get DefaultType() { static get DefaultType() {
return DefaultType; return DefaultType;
} }
@ -223,17 +214,10 @@ class Tooltip extends BaseComponent {
this.tip.parentNode.removeChild(this.tip); this.tip.parentNode.removeChild(this.tip);
} }
this._isEnabled = null;
this._timeout = null;
this._hoverState = null;
this._activeTrigger = null;
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
} }
this._popper = null;
this.config = null;
this.tip = null;
super.dispose(); super.dispose();
} }
@ -265,19 +249,19 @@ class Tooltip extends BaseComponent {
this.setContent(); this.setContent();
if (this.config.animation) { if (this._config.animation) {
tip.classList.add(CLASS_NAME_FADE); tip.classList.add(CLASS_NAME_FADE);
} }
const placement = const placement =
typeof this.config.placement === 'function' typeof this._config.placement === 'function'
? this.config.placement.call(this, tip, this._element) ? this._config.placement.call(this, tip, this._element)
: this.config.placement; : this._config.placement;
const attachment = this._getAttachment(placement); const attachment = this._getAttachment(placement);
this._addAttachmentClass(attachment); this._addAttachmentClass(attachment);
const container = this._getContainer(); const { container } = this._config;
Data.set(tip, this.constructor.DATA_KEY, this); Data.set(tip, this.constructor.DATA_KEY, this);
if (!this._element.ownerDocument.documentElement.contains(this.tip)) { if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
@ -294,9 +278,9 @@ class Tooltip extends BaseComponent {
tip.classList.add(CLASS_NAME_SHOW); tip.classList.add(CLASS_NAME_SHOW);
const customClass = const customClass =
typeof this.config.customClass === 'function' typeof this._config.customClass === 'function'
? this.config.customClass() ? this._config.customClass()
: this.config.customClass; : this._config.customClass;
if (customClass) { if (customClass) {
tip.classList.add(...customClass.split(' ')); tip.classList.add(...customClass.split(' '));
} }
@ -322,13 +306,8 @@ class Tooltip extends BaseComponent {
} }
}; };
if (this.tip.classList.contains(CLASS_NAME_FADE)) { const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
const transitionDuration = getTransitionDurationFromElement(this.tip); this._queueCallback(complete, this.tip, isAnimated);
EventHandler.one(this.tip, 'transitionend', complete);
emulateTransitionEnd(this.tip, transitionDuration);
} else {
complete();
}
} }
hide() { hide() {
@ -375,15 +354,8 @@ class Tooltip extends BaseComponent {
this._activeTrigger[TRIGGER_FOCUS] = false; this._activeTrigger[TRIGGER_FOCUS] = false;
this._activeTrigger[TRIGGER_HOVER] = false; this._activeTrigger[TRIGGER_HOVER] = false;
if (this.tip.classList.contains(CLASS_NAME_FADE)) { const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
const transitionDuration = getTransitionDurationFromElement(tip); this._queueCallback(complete, this.tip, isAnimated);
EventHandler.one(tip, 'transitionend', complete);
emulateTransitionEnd(tip, transitionDuration);
} else {
complete();
}
this._hoverState = ''; this._hoverState = '';
} }
@ -405,7 +377,7 @@ class Tooltip extends BaseComponent {
} }
const element = document.createElement('div'); const element = document.createElement('div');
element.innerHTML = this.config.template; element.innerHTML = this._config.template;
this.tip = element.children[0]; this.tip = element.children[0];
return this.tip; return this.tip;
@ -422,13 +394,11 @@ class Tooltip extends BaseComponent {
return; return;
} }
if (typeof content === 'object' && isElement(content)) { if (isElement(content)) {
if (content.jquery) { content = getElement(content);
content = content[0];
}
// content is a DOM node or a jQuery // content is a DOM node or a jQuery
if (this.config.html) { if (this._config.html) {
if (content.parentNode !== element) { if (content.parentNode !== element) {
element.innerHTML = ''; element.innerHTML = '';
element.appendChild(content); element.appendChild(content);
@ -440,9 +410,9 @@ class Tooltip extends BaseComponent {
return; return;
} }
if (this.config.html) { if (this._config.html) {
if (this.config.sanitize) { if (this._config.sanitize) {
content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn); content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
} }
element.innerHTML = content; element.innerHTML = content;
@ -456,9 +426,9 @@ class Tooltip extends BaseComponent {
if (!title) { if (!title) {
title = title =
typeof this.config.title === 'function' typeof this._config.title === 'function'
? this.config.title.call(this._element) ? this._config.title.call(this._element)
: this.config.title; : this._config.title;
} }
return title; return title;
@ -491,7 +461,7 @@ class Tooltip extends BaseComponent {
} }
_getOffset() { _getOffset() {
const { offset } = this.config; const { offset } = this._config;
if (typeof offset === 'string') { if (typeof offset === 'string') {
return offset.split(',').map((val) => Number.parseInt(val, 10)); return offset.split(',').map((val) => Number.parseInt(val, 10));
@ -511,7 +481,7 @@ class Tooltip extends BaseComponent {
{ {
name: 'flip', name: 'flip',
options: { options: {
fallbackPlacements: this.config.fallbackPlacements, fallbackPlacements: this._config.fallbackPlacements,
}, },
}, },
{ {
@ -523,7 +493,7 @@ class Tooltip extends BaseComponent {
{ {
name: 'preventOverflow', name: 'preventOverflow',
options: { options: {
boundary: this.config.boundary, boundary: this._config.boundary,
}, },
}, },
{ {
@ -548,9 +518,9 @@ class Tooltip extends BaseComponent {
return { return {
...defaultBsPopperConfig, ...defaultBsPopperConfig,
...(typeof this.config.popperConfig === 'function' ...(typeof this._config.popperConfig === 'function'
? this.config.popperConfig(defaultBsPopperConfig) ? this._config.popperConfig(defaultBsPopperConfig)
: this.config.popperConfig), : this._config.popperConfig),
}; };
} }
@ -558,31 +528,19 @@ class Tooltip extends BaseComponent {
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`); this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
} }
_getContainer() {
if (this.config.container === false) {
return document.body;
}
if (isElement(this.config.container)) {
return this.config.container;
}
return SelectorEngine.findOne(this.config.container);
}
_getAttachment(placement) { _getAttachment(placement) {
return AttachmentMap[placement.toUpperCase()]; return AttachmentMap[placement.toUpperCase()];
} }
_setListeners() { _setListeners() {
const triggers = this.config.trigger.split(' '); const triggers = this._config.trigger.split(' ');
triggers.forEach((trigger) => { triggers.forEach((trigger) => {
if (trigger === 'click') { if (trigger === 'click') {
EventHandler.on( EventHandler.on(
this._element, this._element,
this.constructor.Event.CLICK, this.constructor.Event.CLICK,
this.config.selector, this._config.selector,
(event) => this.toggle(event) (event) => this.toggle(event)
); );
} else if (trigger !== TRIGGER_MANUAL) { } else if (trigger !== TRIGGER_MANUAL) {
@ -595,10 +553,10 @@ class Tooltip extends BaseComponent {
? this.constructor.Event.MOUSELEAVE ? this.constructor.Event.MOUSELEAVE
: this.constructor.Event.FOCUSOUT; : this.constructor.Event.FOCUSOUT;
EventHandler.on(this._element, eventIn, this.config.selector, (event) => EventHandler.on(this._element, eventIn, this._config.selector, (event) =>
this._enter(event) this._enter(event)
); );
EventHandler.on(this._element, eventOut, this.config.selector, (event) => EventHandler.on(this._element, eventOut, this._config.selector, (event) =>
this._leave(event) this._leave(event)
); );
} }
@ -616,9 +574,9 @@ class Tooltip extends BaseComponent {
this._hideModalHandler this._hideModalHandler
); );
if (this.config.selector) { if (this._config.selector) {
this.config = { this._config = {
...this.config, ...this._config,
trigger: 'manual', trigger: 'manual',
selector: '', selector: '',
}; };
@ -660,7 +618,7 @@ class Tooltip extends BaseComponent {
context._hoverState = HOVER_STATE_SHOW; context._hoverState = HOVER_STATE_SHOW;
if (!context.config.delay || !context.config.delay.show) { if (!context._config.delay || !context._config.delay.show) {
context.show(); context.show();
return; return;
} }
@ -669,7 +627,7 @@ class Tooltip extends BaseComponent {
if (context._hoverState === HOVER_STATE_SHOW) { if (context._hoverState === HOVER_STATE_SHOW) {
context.show(); context.show();
} }
}, context.config.delay.show); }, context._config.delay.show);
} }
_leave(event, context) { _leave(event, context) {
@ -689,7 +647,7 @@ class Tooltip extends BaseComponent {
context._hoverState = HOVER_STATE_OUT; context._hoverState = HOVER_STATE_OUT;
if (!context.config.delay || !context.config.delay.hide) { if (!context._config.delay || !context._config.delay.hide) {
context.hide(); context.hide();
return; return;
} }
@ -698,7 +656,7 @@ class Tooltip extends BaseComponent {
if (context._hoverState === HOVER_STATE_OUT) { if (context._hoverState === HOVER_STATE_OUT) {
context.hide(); context.hide();
} }
}, context.config.delay.hide); }, context._config.delay.hide);
} }
_isWithActiveTrigger() { _isWithActiveTrigger() {
@ -720,16 +678,14 @@ class Tooltip extends BaseComponent {
} }
}); });
if (config && typeof config.container === 'object' && config.container.jquery) {
config.container = config.container[0];
}
config = { config = {
...this.constructor.Default, ...this.constructor.Default,
...dataAttributes, ...dataAttributes,
...(typeof config === 'object' && config ? config : {}), ...(typeof config === 'object' && config ? config : {}),
}; };
config.container = config.container === false ? document.body : getElement(config.container);
if (typeof config.delay === 'number') { if (typeof config.delay === 'number') {
config.delay = { config.delay = {
show: config.delay, show: config.delay,
@ -757,10 +713,10 @@ class Tooltip extends BaseComponent {
_getDelegateConfig() { _getDelegateConfig() {
const config = {}; const config = {};
if (this.config) { if (this._config) {
for (const key in this.config) { for (const key in this._config) {
if (this.constructor.Default[key] !== this.config[key]) { if (this.constructor.Default[key] !== this._config[key]) {
config[key] = this.config[key]; config[key] = this._config[key];
} }
} }
} }
@ -821,6 +777,6 @@ class Tooltip extends BaseComponent {
* add .Tooltip to jQuery only if jQuery is present * add .Tooltip to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Tooltip); defineJQueryPlugin(Tooltip);
export default Tooltip; export default Tooltip;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/backdrop.js * Bootstrap (v5.0.1): util/backdrop.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -95,6 +95,8 @@ class Backdrop {
...Default, ...Default,
...(typeof config === 'object' ? config : {}), ...(typeof config === 'object' ? config : {}),
}; };
config.rootElement = config.rootElement || document.body;
typeCheckConfig(NAME, config, DefaultType); typeCheckConfig(NAME, config, DefaultType);
return config; return config;
} }

View File

@ -1,6 +1,8 @@
import SelectorEngine from '../dom/selector-engine';
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js * Bootstrap (v5.0.1): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -106,7 +108,30 @@ const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END)); element.dispatchEvent(new Event(TRANSITION_END));
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const getElement = (obj) => {
if (isElement(obj)) {
// it's a jQuery object or a node element
return obj.jquery ? obj[0] : obj;
}
if (typeof obj === 'string' && obj.length > 0) {
return SelectorEngine.findOne(obj);
}
return null;
};
const emulateTransitionEnd = (element, duration) => { const emulateTransitionEnd = (element, duration) => {
let called = false; let called = false;
@ -222,11 +247,12 @@ const onDOMContentLoaded = (callback) => {
const isRTL = () => document.documentElement.dir === 'rtl'; const isRTL = () => document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -245,6 +271,7 @@ const execute = (callback) => {
}; };
export { export {
getElement,
getUID, getUID,
getSelectorFromElement, getSelectorFromElement,
getElementFromSelector, getElementFromSelector,

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/sanitizer.js * Bootstrap (v5.0.1): util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/scrollBar.js * Bootstrap (v5.0.1): util/scrollBar.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,16 +1,11 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): alert.js * Bootstrap (v5.0.1): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import { defineJQueryPlugin, getElementFromSelector } from './util/index';
defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
} from './util/index';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import BaseComponent from './base-component'; import BaseComponent from './base-component';
@ -45,8 +40,8 @@ const CLASS_NAME_SHOW = 'show';
class Alert extends BaseComponent { class Alert extends BaseComponent {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -75,15 +70,8 @@ class Alert extends BaseComponent {
_removeElement(element) { _removeElement(element) {
element.classList.remove(CLASS_NAME_SHOW); element.classList.remove(CLASS_NAME_SHOW);
if (!element.classList.contains(CLASS_NAME_FADE)) { const isAnimated = element.classList.contains(CLASS_NAME_FADE);
this._destroyElement(element); this._queueCallback(() => this._destroyElement(element), element, isAnimated);
return;
}
const transitionDuration = getTransitionDurationFromElement(element);
EventHandler.one(element, 'transitionend', () => this._destroyElement(element));
emulateTransitionEnd(element, transitionDuration);
} }
_destroyElement(element) { _destroyElement(element) {
@ -136,6 +124,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDi
* add .Alert to jQuery only if jQuery is present * add .Alert to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Alert); defineJQueryPlugin(Alert);
export default Alert; export default Alert;

View File

@ -1,11 +1,17 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): base-component.js * Bootstrap (v5.0.1): base-component.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import Data from './dom/data'; import Data from './dom/data';
import {
emulateTransitionEnd,
execute,
getElement,
getTransitionDurationFromElement,
} from './util/index';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
/** /**
@ -14,11 +20,11 @@ import EventHandler from './dom/event-handler';
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
const VERSION = '5.0.0'; const VERSION = '5.0.1';
class BaseComponent { class BaseComponent {
constructor(element) { constructor(element) {
element = typeof element === 'string' ? document.querySelector(element) : element; element = getElement(element);
if (!element) { if (!element) {
return; return;
@ -30,8 +36,23 @@ class BaseComponent {
dispose() { dispose() {
Data.remove(this._element, this.constructor.DATA_KEY); Data.remove(this._element, this.constructor.DATA_KEY);
EventHandler.off(this._element, `.${this.constructor.DATA_KEY}`); EventHandler.off(this._element, this.constructor.EVENT_KEY);
this._element = null;
Object.getOwnPropertyNames(this).forEach((propertyName) => {
this[propertyName] = null;
});
}
_queueCallback(callback, element, isAnimated = true) {
if (!isAnimated) {
execute(callback);
return;
}
const transitionDuration = getTransitionDurationFromElement(element);
EventHandler.one(element, 'transitionend', () => execute(callback));
emulateTransitionEnd(element, transitionDuration);
} }
/** Static */ /** Static */
@ -43,6 +64,18 @@ class BaseComponent {
static get VERSION() { static get VERSION() {
return VERSION; return VERSION;
} }
static get NAME() {
throw new Error('You have to implement the static method "NAME", for each component!');
}
static get DATA_KEY() {
return `bs.${this.NAME}`;
}
static get EVENT_KEY() {
return `.${this.DATA_KEY}`;
}
} }
export default BaseComponent; export default BaseComponent;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): button.js * Bootstrap (v5.0.1): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -36,8 +36,8 @@ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
class Button extends BaseComponent { class Button extends BaseComponent {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -90,6 +90,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, (event) =>
* add .Button to jQuery only if jQuery is present * add .Button to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Button); defineJQueryPlugin(Button);
export default Button; export default Button;

View File

@ -1,15 +1,13 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): carousel.js * Bootstrap (v5.0.1): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector, getElementFromSelector,
getTransitionDurationFromElement,
isRTL, isRTL,
isVisible, isVisible,
reflow, reflow,
@ -130,8 +128,8 @@ class Carousel extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -214,18 +212,6 @@ class Carousel extends BaseComponent {
this._slide(order, this._items[index]); this._slide(order, this._items[index]);
} }
dispose() {
this._items = null;
this._config = null;
this._interval = null;
this._isPaused = null;
this._isSliding = null;
this._activeElement = null;
this._indicatorsElement = null;
super.dispose();
}
// Private // Private
_getConfig(config) { _getConfig(config) {
@ -465,6 +451,15 @@ class Carousel extends BaseComponent {
this._setActiveIndicatorElement(nextElement); this._setActiveIndicatorElement(nextElement);
this._activeElement = nextElement; this._activeElement = nextElement;
const triggerSlidEvent = () => {
EventHandler.trigger(this._element, EVENT_SLID, {
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
};
if (this._element.classList.contains(CLASS_NAME_SLIDE)) { if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
nextElement.classList.add(orderClassName); nextElement.classList.add(orderClassName);
@ -473,9 +468,7 @@ class Carousel extends BaseComponent {
activeElement.classList.add(directionalClassName); activeElement.classList.add(directionalClassName);
nextElement.classList.add(directionalClassName); nextElement.classList.add(directionalClassName);
const transitionDuration = getTransitionDurationFromElement(activeElement); const completeCallBack = () => {
EventHandler.one(activeElement, 'transitionend', () => {
nextElement.classList.remove(directionalClassName, orderClassName); nextElement.classList.remove(directionalClassName, orderClassName);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
@ -483,28 +476,16 @@ class Carousel extends BaseComponent {
this._isSliding = false; this._isSliding = false;
setTimeout(() => { setTimeout(triggerSlidEvent, 0);
EventHandler.trigger(this._element, EVENT_SLID, { };
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
}, 0);
});
emulateTransitionEnd(activeElement, transitionDuration); this._queueCallback(completeCallBack, activeElement, true);
} else { } else {
activeElement.classList.remove(CLASS_NAME_ACTIVE); activeElement.classList.remove(CLASS_NAME_ACTIVE);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
this._isSliding = false; this._isSliding = false;
EventHandler.trigger(this._element, EVENT_SLID, { triggerSlidEvent();
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
to: nextElementIndex,
});
} }
if (isCycling) { if (isCycling) {
@ -628,6 +609,6 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
* add .Carousel to jQuery only if jQuery is present * add .Carousel to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Carousel); defineJQueryPlugin(Carousel);
export default Carousel; export default Carousel;

View File

@ -1,17 +1,15 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): collapse.js * Bootstrap (v5.0.1): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd, getElement,
getSelectorFromElement, getSelectorFromElement,
getElementFromSelector, getElementFromSelector,
getTransitionDurationFromElement,
isElement,
reflow, reflow,
typeCheckConfig, typeCheckConfig,
} from './util/index'; } from './util/index';
@ -108,8 +106,8 @@ class Collapse extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -200,11 +198,8 @@ class Collapse extends BaseComponent {
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
const scrollSize = `scroll${capitalizedDimension}`; const scrollSize = `scroll${capitalizedDimension}`;
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, true);
emulateTransitionEnd(this._element, transitionDuration);
this._element.style[dimension] = `${this._element[scrollSize]}px`; this._element.style[dimension] = `${this._element[scrollSize]}px`;
} }
@ -250,24 +245,14 @@ class Collapse extends BaseComponent {
}; };
this._element.style[dimension] = ''; this._element.style[dimension] = '';
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, true);
emulateTransitionEnd(this._element, transitionDuration);
} }
setTransitioning(isTransitioning) { setTransitioning(isTransitioning) {
this._isTransitioning = isTransitioning; this._isTransitioning = isTransitioning;
} }
dispose() {
super.dispose();
this._config = null;
this._parent = null;
this._triggerArray = null;
this._isTransitioning = null;
}
// Private // Private
_getConfig(config) { _getConfig(config) {
@ -287,14 +272,7 @@ class Collapse extends BaseComponent {
_getParent() { _getParent() {
let { parent } = this._config; let { parent } = this._config;
if (isElement(parent)) { parent = getElement(parent);
// it's a jQuery object
if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
parent = parent[0];
}
} else {
parent = SelectorEngine.findOne(parent);
}
const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`; const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`;
@ -404,6 +382,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Collapse to jQuery only if jQuery is present * add .Collapse to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Collapse); defineJQueryPlugin(Collapse);
export default Collapse; export default Collapse;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/data.js * Bootstrap (v5.0.1): dom/data.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/event-handler.js * Bootstrap (v5.0.1): dom/event-handler.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/manipulator.js * Bootstrap (v5.0.1): dom/manipulator.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dom/selector-engine.js * Bootstrap (v5.0.1): dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): dropdown.js * Bootstrap (v5.0.1): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -9,6 +9,7 @@ import * as Popper from '@popperjs/core';
import { import {
defineJQueryPlugin, defineJQueryPlugin,
getElement,
getElementFromSelector, getElementFromSelector,
isDisabled, isDisabled,
isElement, isElement,
@ -116,8 +117,8 @@ class Dropdown extends BaseComponent {
return DefaultType; return DefaultType;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -166,12 +167,7 @@ class Dropdown extends BaseComponent {
if (this._config.reference === 'parent') { if (this._config.reference === 'parent') {
referenceElement = parent; referenceElement = parent;
} else if (isElement(this._config.reference)) { } else if (isElement(this._config.reference)) {
referenceElement = this._config.reference; referenceElement = getElement(this._config.reference);
// Check if it's jQuery element
if (typeof this._config.reference.jquery !== 'undefined') {
referenceElement = this._config.reference[0];
}
} else if (typeof this._config.reference === 'object') { } else if (typeof this._config.reference === 'object') {
referenceElement = this._config.reference; referenceElement = this._config.reference;
} }
@ -219,11 +215,8 @@ class Dropdown extends BaseComponent {
} }
dispose() { dispose() {
this._menu = null;
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
this._popper = null;
} }
super.dispose(); super.dispose();
@ -424,19 +417,13 @@ class Dropdown extends BaseComponent {
} }
static clearMenus(event) { static clearMenus(event) {
if (event) {
if ( if (
event.button === RIGHT_MOUSE_BUTTON || event &&
(event.type === 'keyup' && event.key !== TAB_KEY) (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY))
) { ) {
return; return;
} }
if (/input|select|option|textarea|form/i.test(event.target.tagName)) {
return;
}
}
const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE); const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
for (let i = 0, len = toggles.length; i < len; i++) { for (let i = 0, len = toggles.length; i < len; i++) {
@ -464,11 +451,11 @@ class Dropdown extends BaseComponent {
continue; continue;
} }
// Tab navigation through the dropdown menu shouldn't close the menu // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
if ( if (
event.type === 'keyup' && context._menu.contains(event.target) &&
event.key === TAB_KEY && ((event.type === 'keyup' && event.key === TAB_KEY) ||
context._menu.contains(event.target) /input|select|option|textarea|form/i.test(event.target.tagName))
) { ) {
continue; continue;
} }
@ -570,6 +557,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Dropdown to jQuery only if jQuery is present * add .Dropdown to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Dropdown); defineJQueryPlugin(Dropdown);
export default Dropdown; export default Dropdown;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): modal.js * Bootstrap (v5.0.1): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -97,8 +97,8 @@ class Modal extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -182,19 +182,13 @@ class Modal extends BaseComponent {
EventHandler.off(this._element, EVENT_CLICK_DISMISS); EventHandler.off(this._element, EVENT_CLICK_DISMISS);
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS); EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
if (isAnimated) { this._queueCallback(() => this._hideModal(), this._element, isAnimated);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', (event) => this._hideModal(event));
emulateTransitionEnd(this._element, transitionDuration);
} else {
this._hideModal();
}
} }
dispose() { dispose() {
[window, this._dialog].forEach((htmlElement) => EventHandler.off(htmlElement, EVENT_KEY)); [window, this._dialog].forEach((htmlElement) => EventHandler.off(htmlElement, EVENT_KEY));
this._backdrop.dispose();
super.dispose(); super.dispose();
/** /**
@ -203,14 +197,6 @@ class Modal extends BaseComponent {
* It will remove `EVENT_CLICK_DATA_API` event that should remain * It will remove `EVENT_CLICK_DATA_API` event that should remain
*/ */
EventHandler.off(document, EVENT_FOCUSIN); EventHandler.off(document, EVENT_FOCUSIN);
this._config = null;
this._dialog = null;
this._backdrop.dispose();
this._backdrop = null;
this._isShown = null;
this._ignoreBackdropClick = null;
this._isTransitioning = null;
} }
handleUpdate() { handleUpdate() {
@ -276,14 +262,7 @@ class Modal extends BaseComponent {
}); });
}; };
if (isAnimated) { this._queueCallback(transitionComplete, this._dialog, isAnimated);
const transitionDuration = getTransitionDurationFromElement(this._dialog);
EventHandler.one(this._dialog, 'transitionend', transitionComplete);
emulateTransitionEnd(this._dialog, transitionDuration);
} else {
transitionComplete();
}
} }
_enforceFocus() { _enforceFocus() {
@ -476,6 +455,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Modal to jQuery only if jQuery is present * add .Modal to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Modal); defineJQueryPlugin(Modal);
export default Modal; export default Modal;

View File

@ -1,15 +1,13 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): offcanvas.js * Bootstrap (v5.0.1): offcanvas.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector, getElementFromSelector,
getTransitionDurationFromElement,
isDisabled, isDisabled,
isVisible, isVisible,
typeCheckConfig, typeCheckConfig,
@ -80,12 +78,12 @@ class Offcanvas extends BaseComponent {
// Getters // Getters
static get Default() { static get NAME() {
return Default; return NAME;
} }
static get DATA_KEY() { static get Default() {
return DATA_KEY; return Default;
} }
// Public // Public
@ -124,9 +122,7 @@ class Offcanvas extends BaseComponent {
EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget }); EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget });
}; };
const transitionDuration = getTransitionDurationFromElement(this._element); this._queueCallback(completeCallBack, this._element, true);
EventHandler.one(this._element, 'transitionend', completeCallBack);
emulateTransitionEnd(this._element, transitionDuration);
} }
hide() { hide() {
@ -159,18 +155,13 @@ class Offcanvas extends BaseComponent {
EventHandler.trigger(this._element, EVENT_HIDDEN); EventHandler.trigger(this._element, EVENT_HIDDEN);
}; };
const transitionDuration = getTransitionDurationFromElement(this._element); this._queueCallback(completeCallback, this._element, true);
EventHandler.one(this._element, 'transitionend', completeCallback);
emulateTransitionEnd(this._element, transitionDuration);
} }
dispose() { dispose() {
this._backdrop.dispose(); this._backdrop.dispose();
super.dispose(); super.dispose();
EventHandler.off(document, EVENT_FOCUSIN); EventHandler.off(document, EVENT_FOCUSIN);
this._config = null;
this._backdrop = null;
} }
// Private // Private
@ -285,6 +276,6 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
defineJQueryPlugin(NAME, Offcanvas); defineJQueryPlugin(Offcanvas);
export default Offcanvas; export default Offcanvas;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): popover.js * Bootstrap (v5.0.1): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -77,18 +77,10 @@ class Popover extends Tooltip {
return NAME; return NAME;
} }
static get DATA_KEY() {
return DATA_KEY;
}
static get Event() { static get Event() {
return Event; return Event;
} }
static get EVENT_KEY() {
return EVENT_KEY;
}
static get DefaultType() { static get DefaultType() {
return DefaultType; return DefaultType;
} }
@ -121,7 +113,7 @@ class Popover extends Tooltip {
} }
_getContent() { _getContent() {
return this._element.getAttribute('data-bs-content') || this.config.content; return this._element.getAttribute('data-bs-content') || this._config.content;
} }
_cleanTipClass() { _cleanTipClass() {
@ -166,6 +158,6 @@ class Popover extends Tooltip {
* add .Popover to jQuery only if jQuery is present * add .Popover to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Popover); defineJQueryPlugin(Popover);
export default Popover; export default Popover;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): scrollspy.js * Bootstrap (v5.0.1): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -87,8 +87,8 @@ class ScrollSpy extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -130,16 +130,8 @@ class ScrollSpy extends BaseComponent {
} }
dispose() { dispose() {
super.dispose();
EventHandler.off(this._scrollElement, EVENT_KEY); EventHandler.off(this._scrollElement, EVENT_KEY);
super.dispose();
this._scrollElement = null;
this._config = null;
this._selector = null;
this._offsets = null;
this._targets = null;
this._activeTarget = null;
this._scrollHeight = null;
} }
// Private // Private
@ -310,6 +302,6 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
* add .ScrollSpy to jQuery only if jQuery is present * add .ScrollSpy to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, ScrollSpy); defineJQueryPlugin(ScrollSpy);
export default ScrollSpy; export default ScrollSpy;

View File

@ -1,18 +1,11 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): tab.js * Bootstrap (v5.0.1): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import { defineJQueryPlugin, getElementFromSelector, isDisabled, reflow } from './util/index';
defineJQueryPlugin,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
isDisabled,
reflow,
} from './util/index';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import SelectorEngine from './dom/selector-engine'; import SelectorEngine from './dom/selector-engine';
@ -58,8 +51,8 @@ const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
class Tab extends BaseComponent { class Tab extends BaseComponent {
// Getters // Getters
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -132,11 +125,8 @@ class Tab extends BaseComponent {
const complete = () => this._transitionComplete(element, active, callback); const complete = () => this._transitionComplete(element, active, callback);
if (active && isTransitioning) { if (active && isTransitioning) {
const transitionDuration = getTransitionDurationFromElement(active);
active.classList.remove(CLASS_NAME_SHOW); active.classList.remove(CLASS_NAME_SHOW);
this._queueCallback(complete, element, true);
EventHandler.one(active, 'transitionend', complete);
emulateTransitionEnd(active, transitionDuration);
} else { } else {
complete(); complete();
} }
@ -236,6 +226,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
* add .Tab to jQuery only if jQuery is present * add .Tab to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Tab); defineJQueryPlugin(Tab);
export default Tab; export default Tab;

View File

@ -1,17 +1,11 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): toast.js * Bootstrap (v5.0.1): toast.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import { import { defineJQueryPlugin, reflow, typeCheckConfig } from './util/index';
defineJQueryPlugin,
emulateTransitionEnd,
getTransitionDurationFromElement,
reflow,
typeCheckConfig,
} from './util/index';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import Manipulator from './dom/manipulator'; import Manipulator from './dom/manipulator';
@ -28,6 +22,10 @@ const DATA_KEY = 'bs.toast';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`; const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
const EVENT_HIDE = `hide${EVENT_KEY}`; const EVENT_HIDE = `hide${EVENT_KEY}`;
const EVENT_HIDDEN = `hidden${EVENT_KEY}`; const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
const EVENT_SHOW = `show${EVENT_KEY}`; const EVENT_SHOW = `show${EVENT_KEY}`;
@ -64,6 +62,8 @@ class Toast extends BaseComponent {
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._timeout = null; this._timeout = null;
this._hasMouseInteraction = false;
this._hasKeyboardInteraction = false;
this._setListeners(); this._setListeners();
} }
@ -77,8 +77,8 @@ class Toast extends BaseComponent {
return Default; return Default;
} }
static get DATA_KEY() { static get NAME() {
return DATA_KEY; return NAME;
} }
// Public // Public
@ -102,24 +102,14 @@ class Toast extends BaseComponent {
EventHandler.trigger(this._element, EVENT_SHOWN); EventHandler.trigger(this._element, EVENT_SHOWN);
if (this._config.autohide) { this._maybeScheduleHide();
this._timeout = setTimeout(() => {
this.hide();
}, this._config.delay);
}
}; };
this._element.classList.remove(CLASS_NAME_HIDE); this._element.classList.remove(CLASS_NAME_HIDE);
reflow(this._element); reflow(this._element);
this._element.classList.add(CLASS_NAME_SHOWING); this._element.classList.add(CLASS_NAME_SHOWING);
if (this._config.animation) {
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete); this._queueCallback(complete, this._element, this._config.animation);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
}
} }
hide() { hide() {
@ -139,14 +129,7 @@ class Toast extends BaseComponent {
}; };
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
if (this._config.animation) { this._queueCallback(complete, this._element, this._config.animation);
const transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, 'transitionend', complete);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
}
} }
dispose() { dispose() {
@ -157,7 +140,6 @@ class Toast extends BaseComponent {
} }
super.dispose(); super.dispose();
this._config = null;
} }
// Private // Private
@ -174,8 +156,53 @@ class Toast extends BaseComponent {
return config; return config;
} }
_maybeScheduleHide() {
if (!this._config.autohide) {
return;
}
if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
return;
}
this._timeout = setTimeout(() => {
this.hide();
}, this._config.delay);
}
_onInteraction(event, isInteracting) {
switch (event.type) {
case 'mouseover':
case 'mouseout':
this._hasMouseInteraction = isInteracting;
break;
case 'focusin':
case 'focusout':
this._hasKeyboardInteraction = isInteracting;
break;
default:
break;
}
if (isInteracting) {
this._clearTimeout();
return;
}
const nextElement = event.relatedTarget;
if (this._element === nextElement || this._element.contains(nextElement)) {
return;
}
this._maybeScheduleHide();
}
_setListeners() { _setListeners() {
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide()); EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
EventHandler.on(this._element, EVENT_MOUSEOVER, (event) => this._onInteraction(event, true));
EventHandler.on(this._element, EVENT_MOUSEOUT, (event) => this._onInteraction(event, false));
EventHandler.on(this._element, EVENT_FOCUSIN, (event) => this._onInteraction(event, true));
EventHandler.on(this._element, EVENT_FOCUSOUT, (event) => this._onInteraction(event, false));
} }
_clearTimeout() { _clearTimeout() {
@ -212,6 +239,6 @@ class Toast extends BaseComponent {
* add .Toast to jQuery only if jQuery is present * add .Toast to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Toast); defineJQueryPlugin(Toast);
export default Toast; export default Toast;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): tooltip.js * Bootstrap (v5.0.1): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -9,9 +9,8 @@ import * as Popper from '@popperjs/core';
import { import {
defineJQueryPlugin, defineJQueryPlugin,
emulateTransitionEnd,
findShadowRoot, findShadowRoot,
getTransitionDurationFromElement, getElement,
getUID, getUID,
isElement, isElement,
isRTL, isRTL,
@ -139,7 +138,7 @@ class Tooltip extends BaseComponent {
this._popper = null; this._popper = null;
// Protected // Protected
this.config = this._getConfig(config); this._config = this._getConfig(config);
this.tip = null; this.tip = null;
this._setListeners(); this._setListeners();
@ -155,18 +154,10 @@ class Tooltip extends BaseComponent {
return NAME; return NAME;
} }
static get DATA_KEY() {
return DATA_KEY;
}
static get Event() { static get Event() {
return Event; return Event;
} }
static get EVENT_KEY() {
return EVENT_KEY;
}
static get DefaultType() { static get DefaultType() {
return DefaultType; return DefaultType;
} }
@ -223,17 +214,10 @@ class Tooltip extends BaseComponent {
this.tip.parentNode.removeChild(this.tip); this.tip.parentNode.removeChild(this.tip);
} }
this._isEnabled = null;
this._timeout = null;
this._hoverState = null;
this._activeTrigger = null;
if (this._popper) { if (this._popper) {
this._popper.destroy(); this._popper.destroy();
} }
this._popper = null;
this.config = null;
this.tip = null;
super.dispose(); super.dispose();
} }
@ -265,19 +249,19 @@ class Tooltip extends BaseComponent {
this.setContent(); this.setContent();
if (this.config.animation) { if (this._config.animation) {
tip.classList.add(CLASS_NAME_FADE); tip.classList.add(CLASS_NAME_FADE);
} }
const placement = const placement =
typeof this.config.placement === 'function' typeof this._config.placement === 'function'
? this.config.placement.call(this, tip, this._element) ? this._config.placement.call(this, tip, this._element)
: this.config.placement; : this._config.placement;
const attachment = this._getAttachment(placement); const attachment = this._getAttachment(placement);
this._addAttachmentClass(attachment); this._addAttachmentClass(attachment);
const container = this._getContainer(); const { container } = this._config;
Data.set(tip, this.constructor.DATA_KEY, this); Data.set(tip, this.constructor.DATA_KEY, this);
if (!this._element.ownerDocument.documentElement.contains(this.tip)) { if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
@ -294,9 +278,9 @@ class Tooltip extends BaseComponent {
tip.classList.add(CLASS_NAME_SHOW); tip.classList.add(CLASS_NAME_SHOW);
const customClass = const customClass =
typeof this.config.customClass === 'function' typeof this._config.customClass === 'function'
? this.config.customClass() ? this._config.customClass()
: this.config.customClass; : this._config.customClass;
if (customClass) { if (customClass) {
tip.classList.add(...customClass.split(' ')); tip.classList.add(...customClass.split(' '));
} }
@ -322,13 +306,8 @@ class Tooltip extends BaseComponent {
} }
}; };
if (this.tip.classList.contains(CLASS_NAME_FADE)) { const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
const transitionDuration = getTransitionDurationFromElement(this.tip); this._queueCallback(complete, this.tip, isAnimated);
EventHandler.one(this.tip, 'transitionend', complete);
emulateTransitionEnd(this.tip, transitionDuration);
} else {
complete();
}
} }
hide() { hide() {
@ -375,15 +354,8 @@ class Tooltip extends BaseComponent {
this._activeTrigger[TRIGGER_FOCUS] = false; this._activeTrigger[TRIGGER_FOCUS] = false;
this._activeTrigger[TRIGGER_HOVER] = false; this._activeTrigger[TRIGGER_HOVER] = false;
if (this.tip.classList.contains(CLASS_NAME_FADE)) { const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
const transitionDuration = getTransitionDurationFromElement(tip); this._queueCallback(complete, this.tip, isAnimated);
EventHandler.one(tip, 'transitionend', complete);
emulateTransitionEnd(tip, transitionDuration);
} else {
complete();
}
this._hoverState = ''; this._hoverState = '';
} }
@ -405,7 +377,7 @@ class Tooltip extends BaseComponent {
} }
const element = document.createElement('div'); const element = document.createElement('div');
element.innerHTML = this.config.template; element.innerHTML = this._config.template;
this.tip = element.children[0]; this.tip = element.children[0];
return this.tip; return this.tip;
@ -422,13 +394,11 @@ class Tooltip extends BaseComponent {
return; return;
} }
if (typeof content === 'object' && isElement(content)) { if (isElement(content)) {
if (content.jquery) { content = getElement(content);
content = content[0];
}
// content is a DOM node or a jQuery // content is a DOM node or a jQuery
if (this.config.html) { if (this._config.html) {
if (content.parentNode !== element) { if (content.parentNode !== element) {
element.innerHTML = ''; element.innerHTML = '';
element.appendChild(content); element.appendChild(content);
@ -440,9 +410,9 @@ class Tooltip extends BaseComponent {
return; return;
} }
if (this.config.html) { if (this._config.html) {
if (this.config.sanitize) { if (this._config.sanitize) {
content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn); content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
} }
element.innerHTML = content; element.innerHTML = content;
@ -456,9 +426,9 @@ class Tooltip extends BaseComponent {
if (!title) { if (!title) {
title = title =
typeof this.config.title === 'function' typeof this._config.title === 'function'
? this.config.title.call(this._element) ? this._config.title.call(this._element)
: this.config.title; : this._config.title;
} }
return title; return title;
@ -491,7 +461,7 @@ class Tooltip extends BaseComponent {
} }
_getOffset() { _getOffset() {
const { offset } = this.config; const { offset } = this._config;
if (typeof offset === 'string') { if (typeof offset === 'string') {
return offset.split(',').map((val) => Number.parseInt(val, 10)); return offset.split(',').map((val) => Number.parseInt(val, 10));
@ -511,7 +481,7 @@ class Tooltip extends BaseComponent {
{ {
name: 'flip', name: 'flip',
options: { options: {
fallbackPlacements: this.config.fallbackPlacements, fallbackPlacements: this._config.fallbackPlacements,
}, },
}, },
{ {
@ -523,7 +493,7 @@ class Tooltip extends BaseComponent {
{ {
name: 'preventOverflow', name: 'preventOverflow',
options: { options: {
boundary: this.config.boundary, boundary: this._config.boundary,
}, },
}, },
{ {
@ -548,9 +518,9 @@ class Tooltip extends BaseComponent {
return { return {
...defaultBsPopperConfig, ...defaultBsPopperConfig,
...(typeof this.config.popperConfig === 'function' ...(typeof this._config.popperConfig === 'function'
? this.config.popperConfig(defaultBsPopperConfig) ? this._config.popperConfig(defaultBsPopperConfig)
: this.config.popperConfig), : this._config.popperConfig),
}; };
} }
@ -558,31 +528,19 @@ class Tooltip extends BaseComponent {
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`); this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
} }
_getContainer() {
if (this.config.container === false) {
return document.body;
}
if (isElement(this.config.container)) {
return this.config.container;
}
return SelectorEngine.findOne(this.config.container);
}
_getAttachment(placement) { _getAttachment(placement) {
return AttachmentMap[placement.toUpperCase()]; return AttachmentMap[placement.toUpperCase()];
} }
_setListeners() { _setListeners() {
const triggers = this.config.trigger.split(' '); const triggers = this._config.trigger.split(' ');
triggers.forEach((trigger) => { triggers.forEach((trigger) => {
if (trigger === 'click') { if (trigger === 'click') {
EventHandler.on( EventHandler.on(
this._element, this._element,
this.constructor.Event.CLICK, this.constructor.Event.CLICK,
this.config.selector, this._config.selector,
(event) => this.toggle(event) (event) => this.toggle(event)
); );
} else if (trigger !== TRIGGER_MANUAL) { } else if (trigger !== TRIGGER_MANUAL) {
@ -595,10 +553,10 @@ class Tooltip extends BaseComponent {
? this.constructor.Event.MOUSELEAVE ? this.constructor.Event.MOUSELEAVE
: this.constructor.Event.FOCUSOUT; : this.constructor.Event.FOCUSOUT;
EventHandler.on(this._element, eventIn, this.config.selector, (event) => EventHandler.on(this._element, eventIn, this._config.selector, (event) =>
this._enter(event) this._enter(event)
); );
EventHandler.on(this._element, eventOut, this.config.selector, (event) => EventHandler.on(this._element, eventOut, this._config.selector, (event) =>
this._leave(event) this._leave(event)
); );
} }
@ -616,9 +574,9 @@ class Tooltip extends BaseComponent {
this._hideModalHandler this._hideModalHandler
); );
if (this.config.selector) { if (this._config.selector) {
this.config = { this._config = {
...this.config, ...this._config,
trigger: 'manual', trigger: 'manual',
selector: '', selector: '',
}; };
@ -660,7 +618,7 @@ class Tooltip extends BaseComponent {
context._hoverState = HOVER_STATE_SHOW; context._hoverState = HOVER_STATE_SHOW;
if (!context.config.delay || !context.config.delay.show) { if (!context._config.delay || !context._config.delay.show) {
context.show(); context.show();
return; return;
} }
@ -669,7 +627,7 @@ class Tooltip extends BaseComponent {
if (context._hoverState === HOVER_STATE_SHOW) { if (context._hoverState === HOVER_STATE_SHOW) {
context.show(); context.show();
} }
}, context.config.delay.show); }, context._config.delay.show);
} }
_leave(event, context) { _leave(event, context) {
@ -689,7 +647,7 @@ class Tooltip extends BaseComponent {
context._hoverState = HOVER_STATE_OUT; context._hoverState = HOVER_STATE_OUT;
if (!context.config.delay || !context.config.delay.hide) { if (!context._config.delay || !context._config.delay.hide) {
context.hide(); context.hide();
return; return;
} }
@ -698,7 +656,7 @@ class Tooltip extends BaseComponent {
if (context._hoverState === HOVER_STATE_OUT) { if (context._hoverState === HOVER_STATE_OUT) {
context.hide(); context.hide();
} }
}, context.config.delay.hide); }, context._config.delay.hide);
} }
_isWithActiveTrigger() { _isWithActiveTrigger() {
@ -720,16 +678,14 @@ class Tooltip extends BaseComponent {
} }
}); });
if (config && typeof config.container === 'object' && config.container.jquery) {
config.container = config.container[0];
}
config = { config = {
...this.constructor.Default, ...this.constructor.Default,
...dataAttributes, ...dataAttributes,
...(typeof config === 'object' && config ? config : {}), ...(typeof config === 'object' && config ? config : {}),
}; };
config.container = config.container === false ? document.body : getElement(config.container);
if (typeof config.delay === 'number') { if (typeof config.delay === 'number') {
config.delay = { config.delay = {
show: config.delay, show: config.delay,
@ -757,10 +713,10 @@ class Tooltip extends BaseComponent {
_getDelegateConfig() { _getDelegateConfig() {
const config = {}; const config = {};
if (this.config) { if (this._config) {
for (const key in this.config) { for (const key in this._config) {
if (this.constructor.Default[key] !== this.config[key]) { if (this.constructor.Default[key] !== this._config[key]) {
config[key] = this.config[key]; config[key] = this._config[key];
} }
} }
} }
@ -821,6 +777,6 @@ class Tooltip extends BaseComponent {
* add .Tooltip to jQuery only if jQuery is present * add .Tooltip to jQuery only if jQuery is present
*/ */
defineJQueryPlugin(NAME, Tooltip); defineJQueryPlugin(Tooltip);
export default Tooltip; export default Tooltip;

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/backdrop.js * Bootstrap (v5.0.1): util/backdrop.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -95,6 +95,8 @@ class Backdrop {
...Default, ...Default,
...(typeof config === 'object' ? config : {}), ...(typeof config === 'object' ? config : {}),
}; };
config.rootElement = config.rootElement || document.body;
typeCheckConfig(NAME, config, DefaultType); typeCheckConfig(NAME, config, DefaultType);
return config; return config;
} }

View File

@ -1,6 +1,8 @@
import SelectorEngine from '../dom/selector-engine';
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/index.js * Bootstrap (v5.0.1): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -106,7 +108,30 @@ const triggerTransitionEnd = (element) => {
element.dispatchEvent(new Event(TRANSITION_END)); element.dispatchEvent(new Event(TRANSITION_END));
}; };
const isElement = (obj) => (obj[0] || obj).nodeType; const isElement = (obj) => {
if (!obj || typeof obj !== 'object') {
return false;
}
if (typeof obj.jquery !== 'undefined') {
obj = obj[0];
}
return typeof obj.nodeType !== 'undefined';
};
const getElement = (obj) => {
if (isElement(obj)) {
// it's a jQuery object or a node element
return obj.jquery ? obj[0] : obj;
}
if (typeof obj === 'string' && obj.length > 0) {
return SelectorEngine.findOne(obj);
}
return null;
};
const emulateTransitionEnd = (element, duration) => { const emulateTransitionEnd = (element, duration) => {
let called = false; let called = false;
@ -222,11 +247,12 @@ const onDOMContentLoaded = (callback) => {
const isRTL = () => document.documentElement.dir === 'rtl'; const isRTL = () => document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (name, plugin) => { const defineJQueryPlugin = (plugin) => {
onDOMContentLoaded(() => { onDOMContentLoaded(() => {
const $ = getjQuery(); const $ = getjQuery();
/* istanbul ignore if */ /* istanbul ignore if */
if ($) { if ($) {
const name = plugin.NAME;
const JQUERY_NO_CONFLICT = $.fn[name]; const JQUERY_NO_CONFLICT = $.fn[name];
$.fn[name] = plugin.jQueryInterface; $.fn[name] = plugin.jQueryInterface;
$.fn[name].Constructor = plugin; $.fn[name].Constructor = plugin;
@ -245,6 +271,7 @@ const execute = (callback) => {
}; };
export { export {
getElement,
getUID, getUID,
getSelectorFromElement, getSelectorFromElement,
getElementFromSelector, getElementFromSelector,

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/sanitizer.js * Bootstrap (v5.0.1): util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -1,6 +1,6 @@
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v5.0.0): util/scrollBar.js * Bootstrap (v5.0.1): util/scrollBar.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */

View File

@ -158,16 +158,16 @@
// Organizationally, this must come after the `:hover` states. // Organizationally, this must come after the `:hover` states.
@each $state, $value in $theme-colors { @each $state, $value in $theme-colors {
$list-group-background: shift-color($value, $list-group-item-bg-scale); $list-group-variant-bg: shift-color($value, $list-group-item-bg-scale);
$list-group-color: shift-color($value, $list-group-item-color-scale); $list-group-variant-color: shift-color($value, $list-group-item-color-scale);
@if (contrast-ratio($list-group-background, $list-group-color) < $min-contrast-ratio) { @if (contrast-ratio($list-group-variant-bg, $list-group-variant-color) < $min-contrast-ratio) {
$list-group-color: mix( $list-group-variant-color: mix(
$value, $value,
color-contrast($list-group-background), color-contrast($list-group-variant-bg),
abs($list-group-item-color-scale) abs($list-group-item-color-scale)
); );
} }
@include list-group-item-variant($state, $list-group-background, $list-group-color); @include list-group-item-variant($state, $list-group-variant-bg, $list-group-variant-color);
} }
// scss-docs-end list-group-modifiers // scss-docs-end list-group-modifiers

View File

@ -3,16 +3,6 @@
// .modal-dialog - positioning shell for the actual modal // .modal-dialog - positioning shell for the actual modal
// .modal-content - actual modal w/ bg and corners and stuff // .modal-content - actual modal w/ bg and corners and stuff
.modal-open {
// Kill the scroll on the body
overflow: hidden;
.modal {
overflow-x: hidden;
overflow-y: auto;
}
}
// Container that the modal scrolls within // Container that the modal scrolls within
.modal { .modal {
position: fixed; position: fixed;
@ -22,7 +12,8 @@
display: none; display: none;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow-x: hidden;
overflow-y: auto;
// Prevent Chrome on Windows from adding a focus outline. For details, see // Prevent Chrome on Windows from adding a focus outline. For details, see
// https://github.com/twbs/bootstrap/pull/10951. // https://github.com/twbs/bootstrap/pull/10951.
outline: 0; outline: 0;

View File

@ -4,6 +4,7 @@
.table { .table {
--#{$variable-prefix}table-bg: #{$table-bg}; --#{$variable-prefix}table-bg: #{$table-bg};
--#{$variable-prefix}table-accent-bg: #{$table-bg};
--#{$variable-prefix}table-striped-color: #{$table-striped-color}; --#{$variable-prefix}table-striped-color: #{$table-striped-color};
--#{$variable-prefix}table-striped-bg: #{$table-striped-bg}; --#{$variable-prefix}table-striped-bg: #{$table-striped-bg};
--#{$variable-prefix}table-active-color: #{$table-active-color}; --#{$variable-prefix}table-active-color: #{$table-active-color};

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap Grid v5.0.0 (https://getbootstrap.com/) * Bootstrap Grid v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc. * Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap Reboot v5.0.0 (https://getbootstrap.com/) * Bootstrap Reboot v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc. * Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap Utilities v5.0.0 (https://getbootstrap.com/) * Bootstrap Utilities v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc. * Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap v5.0.0 (https://getbootstrap.com/) * Bootstrap v5.0.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc. * Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -25,7 +25,7 @@
&[type='file'] { &[type='file'] {
overflow: hidden; // prevent pseudo element button overlap overflow: hidden; // prevent pseudo element button overlap
&:not(:disabled):not(:read-only) { &:not(:disabled):not([readonly]) {
cursor: pointer; cursor: pointer;
} }
} }
@ -65,7 +65,7 @@
// disabled if the fieldset is disabled. Due to implementation difficulty, we // disabled if the fieldset is disabled. Due to implementation difficulty, we
// don't honor that edge case; we style them as disabled anyway. // don't honor that edge case; we style them as disabled anyway.
&:disabled, &:disabled,
&:read-only { &[readonly] {
background-color: $input-disabled-bg; background-color: $input-disabled-bg;
border-color: $input-disabled-border-color; border-color: $input-disabled-border-color;
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
@ -88,7 +88,7 @@
@include transition($btn-transition); @include transition($btn-transition);
} }
&:hover:not(:disabled):not(:read-only)::file-selector-button { &:hover:not(:disabled):not([readonly])::file-selector-button {
background-color: $form-file-button-hover-bg; background-color: $form-file-button-hover-bg;
} }
@ -107,7 +107,7 @@
@include transition($btn-transition); @include transition($btn-transition);
} }
&:hover:not(:disabled):not(:read-only)::-webkit-file-upload-button { &:hover:not(:disabled):not([readonly])::-webkit-file-upload-button {
background-color: $form-file-button-hover-bg; background-color: $form-file-button-hover-bg;
} }
} }
@ -203,7 +203,7 @@ textarea {
height: auto; // Override fixed browser height height: auto; // Override fixed browser height
padding: $input-padding-y; padding: $input-padding-y;
&:not(:disabled):not(:read-only) { &:not(:disabled):not([readonly]) {
cursor: pointer; cursor: pointer;
} }

View File

@ -131,8 +131,15 @@
.input-group .form-control, .input-group .form-control,
.input-group .form-select { .input-group .form-select {
@include form-validation-state-selector($state) { @include form-validation-state-selector($state) {
@if $state == 'valid' {
z-index: 1;
} @else if $state == 'invalid' {
z-index: 2;
}
&:focus {
z-index: 3; z-index: 3;
} }
} }
} }
}
// scss-docs-end form-validation-mixins // scss-docs-end form-validation-mixins

View File

@ -158,16 +158,16 @@
// Organizationally, this must come after the `:hover` states. // Organizationally, this must come after the `:hover` states.
@each $state, $value in $theme-colors { @each $state, $value in $theme-colors {
$list-group-background: shift-color($value, $list-group-item-bg-scale); $list-group-variant-bg: shift-color($value, $list-group-item-bg-scale);
$list-group-color: shift-color($value, $list-group-item-color-scale); $list-group-variant-color: shift-color($value, $list-group-item-color-scale);
@if (contrast-ratio($list-group-background, $list-group-color) < $min-contrast-ratio) { @if (contrast-ratio($list-group-variant-bg, $list-group-variant-color) < $min-contrast-ratio) {
$list-group-color: mix( $list-group-variant-color: mix(
$value, $value,
color-contrast($list-group-background), color-contrast($list-group-variant-bg),
abs($list-group-item-color-scale) abs($list-group-item-color-scale)
); );
} }
@include list-group-item-variant($state, $list-group-background, $list-group-color); @include list-group-item-variant($state, $list-group-variant-bg, $list-group-variant-color);
} }
// scss-docs-end list-group-modifiers // scss-docs-end list-group-modifiers

View File

@ -3,16 +3,6 @@
// .modal-dialog - positioning shell for the actual modal // .modal-dialog - positioning shell for the actual modal
// .modal-content - actual modal w/ bg and corners and stuff // .modal-content - actual modal w/ bg and corners and stuff
.modal-open {
// Kill the scroll on the body
overflow: hidden;
.modal {
overflow-x: hidden;
overflow-y: auto;
}
}
// Container that the modal scrolls within // Container that the modal scrolls within
.modal { .modal {
position: fixed; position: fixed;
@ -22,7 +12,8 @@
display: none; display: none;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow-x: hidden;
overflow-y: auto;
// Prevent Chrome on Windows from adding a focus outline. For details, see // Prevent Chrome on Windows from adding a focus outline. For details, see
// https://github.com/twbs/bootstrap/pull/10951. // https://github.com/twbs/bootstrap/pull/10951.
outline: 0; outline: 0;

View File

@ -4,6 +4,7 @@
.table { .table {
--#{$variable-prefix}table-bg: #{$table-bg}; --#{$variable-prefix}table-bg: #{$table-bg};
--#{$variable-prefix}table-accent-bg: #{$table-bg};
--#{$variable-prefix}table-striped-color: #{$table-striped-color}; --#{$variable-prefix}table-striped-color: #{$table-striped-color};
--#{$variable-prefix}table-striped-bg: #{$table-striped-bg}; --#{$variable-prefix}table-striped-bg: #{$table-striped-bg};
--#{$variable-prefix}table-active-color: #{$table-active-color}; --#{$variable-prefix}table-active-color: #{$table-active-color};

Some files were not shown because too many files have changed in this diff Show More