mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 06:20:15 +02:00
Add v5.1.1 docs (#34870)
This commit is contained in:
98
docs/5.1/dist/js/bootstrap.esm.js
vendored
98
docs/5.1/dist/js/bootstrap.esm.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap v5.1.0 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.1.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@@ -7,7 +7,7 @@ import * as Popper from '@popperjs/core';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/index.js
|
||||
* Bootstrap (v5.1.1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -318,7 +318,7 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): dom/event-handler.js
|
||||
* Bootstrap (v5.1.1): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -381,7 +381,6 @@ function bootstrapDelegationHandler(element, selector, fn) {
|
||||
event.delegateTarget = target;
|
||||
|
||||
if (handler.oneOff) {
|
||||
// eslint-disable-next-line unicorn/consistent-destructuring
|
||||
EventHandler.off(element, event.type, selector, fn);
|
||||
}
|
||||
|
||||
@@ -607,7 +606,7 @@ const EventHandler = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): dom/data.js
|
||||
* Bootstrap (v5.1.1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -661,7 +660,7 @@ var Data = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): base-component.js
|
||||
* Bootstrap (v5.1.1): base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -671,7 +670,7 @@ var Data = {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const VERSION = '5.1.0';
|
||||
const VERSION = '5.1.1';
|
||||
|
||||
class BaseComponent {
|
||||
constructor(element) {
|
||||
@@ -727,7 +726,7 @@ class BaseComponent {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/component-functions.js
|
||||
* Bootstrap (v5.1.1): util/component-functions.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -753,7 +752,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): alert.js
|
||||
* Bootstrap (v5.1.1): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -842,7 +841,7 @@ defineJQueryPlugin(Alert);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): button.js
|
||||
* Bootstrap (v5.1.1): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -913,7 +912,7 @@ defineJQueryPlugin(Button);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): dom/manipulator.js
|
||||
* Bootstrap (v5.1.1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -987,7 +986,7 @@ const Manipulator = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): dom/selector-engine.js
|
||||
* Bootstrap (v5.1.1): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1057,7 +1056,7 @@ const SelectorEngine = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): carousel.js
|
||||
* Bootstrap (v5.1.1): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1282,8 +1281,12 @@ class Carousel extends BaseComponent {
|
||||
}
|
||||
|
||||
_addTouchEventListeners() {
|
||||
const hasPointerPenTouch = event => {
|
||||
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
||||
};
|
||||
|
||||
const start = event => {
|
||||
if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
|
||||
if (hasPointerPenTouch(event)) {
|
||||
this.touchStartX = event.clientX;
|
||||
} else if (!this._pointerEvent) {
|
||||
this.touchStartX = event.touches[0].clientX;
|
||||
@@ -1296,7 +1299,7 @@ class Carousel extends BaseComponent {
|
||||
};
|
||||
|
||||
const end = event => {
|
||||
if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
|
||||
if (hasPointerPenTouch(event)) {
|
||||
this.touchDeltaX = event.clientX - this.touchStartX;
|
||||
}
|
||||
|
||||
@@ -1602,7 +1605,7 @@ defineJQueryPlugin(Carousel);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): collapse.js
|
||||
* Bootstrap (v5.1.1): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1636,7 +1639,7 @@ const CLASS_NAME_COLLAPSED = 'collapsed';
|
||||
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
||||
const WIDTH = 'width';
|
||||
const HEIGHT = 'height';
|
||||
const SELECTOR_ACTIVES = '.show, .collapsing';
|
||||
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
||||
const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]';
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -1920,7 +1923,7 @@ defineJQueryPlugin(Collapse);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): dropdown.js
|
||||
* Bootstrap (v5.1.1): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2382,7 +2385,7 @@ defineJQueryPlugin(Dropdown);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/scrollBar.js
|
||||
* Bootstrap (v5.1.1): util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2486,7 +2489,7 @@ class ScrollBarHelper {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/backdrop.js
|
||||
* Bootstrap (v5.1.1): util/backdrop.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2610,7 +2613,7 @@ class Backdrop {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/focustrap.js
|
||||
* Bootstrap (v5.1.1): util/focustrap.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2713,7 +2716,7 @@ class FocusTrap {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): modal.js
|
||||
* Bootstrap (v5.1.1): modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2753,6 +2756,7 @@ const CLASS_NAME_OPEN = 'modal-open';
|
||||
const CLASS_NAME_FADE$3 = 'fade';
|
||||
const CLASS_NAME_SHOW$4 = 'show';
|
||||
const CLASS_NAME_STATIC = 'modal-static';
|
||||
const OPEN_SELECTOR$1 = '.modal.show';
|
||||
const SELECTOR_DIALOG = '.modal-dialog';
|
||||
const SELECTOR_MODAL_BODY = '.modal-body';
|
||||
const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
|
||||
@@ -3118,7 +3122,14 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, functi
|
||||
this.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
}); // avoid conflict when clicking moddal toggler while another one is open
|
||||
|
||||
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
|
||||
|
||||
if (allReadyOpen) {
|
||||
Modal.getInstance(allReadyOpen).hide();
|
||||
}
|
||||
|
||||
const data = Modal.getOrCreateInstance(target);
|
||||
data.toggle(this);
|
||||
});
|
||||
@@ -3134,7 +3145,7 @@ defineJQueryPlugin(Modal);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): offcanvas.js
|
||||
* Bootstrap (v5.1.1): offcanvas.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3390,7 +3401,7 @@ defineJQueryPlugin(Offcanvas);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/sanitizer.js
|
||||
* Bootstrap (v5.1.1): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3503,7 +3514,7 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): tooltip.js
|
||||
* Bootstrap (v5.1.1): tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3677,9 +3688,7 @@ class Tooltip extends BaseComponent {
|
||||
this.tip.remove();
|
||||
}
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
this._disposePopper();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
@@ -3699,6 +3708,15 @@ class Tooltip extends BaseComponent {
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return;
|
||||
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`
|
||||
// This will be removed later in favor of a `setContent` method
|
||||
|
||||
|
||||
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
||||
this._disposePopper();
|
||||
|
||||
this.tip.remove();
|
||||
this.tip = null;
|
||||
}
|
||||
|
||||
const tip = this.getTipElement();
|
||||
@@ -3788,11 +3806,7 @@ class Tooltip extends BaseComponent {
|
||||
|
||||
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
|
||||
this._popper = null;
|
||||
}
|
||||
this._disposePopper();
|
||||
};
|
||||
|
||||
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
@@ -4172,6 +4186,14 @@ class Tooltip extends BaseComponent {
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(state.placement));
|
||||
}
|
||||
|
||||
_disposePopper() {
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
|
||||
this._popper = null;
|
||||
}
|
||||
} // Static
|
||||
|
||||
|
||||
@@ -4202,7 +4224,7 @@ defineJQueryPlugin(Tooltip);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): popover.js
|
||||
* Bootstrap (v5.1.1): popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4312,7 +4334,7 @@ defineJQueryPlugin(Popover);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): scrollspy.js
|
||||
* Bootstrap (v5.1.1): scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4547,7 +4569,7 @@ defineJQueryPlugin(ScrollSpy);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): tab.js
|
||||
* Bootstrap (v5.1.1): tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4745,7 +4767,7 @@ defineJQueryPlugin(Tab);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): toast.js
|
||||
* Bootstrap (v5.1.1): toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
Reference in New Issue
Block a user