aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-04-28 19:02:23 +0000
committerMario <mario@mariovavti.com>2023-04-28 19:02:23 +0000
commit2a1341b910dfb1187dd9fceebd2b3be14e825e28 (patch)
treef2f5a26394d0a1a905823dd71b620e9c964fb155 /vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js
parent1ed8b9dd149b9d2cb2fe30dc56ddc24cc523255c (diff)
downloadvolse-hubzilla-2a1341b910dfb1187dd9fceebd2b3be14e825e28.tar.gz
volse-hubzilla-2a1341b910dfb1187dd9fceebd2b3be14e825e28.tar.bz2
volse-hubzilla-2a1341b910dfb1187dd9fceebd2b3be14e825e28.zip
update bootstrap
Diffstat (limited to 'vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js')
-rw-r--r--vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js456
1 files changed, 228 insertions, 228 deletions
diff --git a/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js b/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js
index 4274d968c..8c4766422 100644
--- a/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js
+++ b/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js
@@ -1,6 +1,6 @@
/*!
- * Bootstrap v5.3.0-alpha1 (https://getbootstrap.com/)
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
+ * Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/)
+ * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
(function (global, factory) {
@@ -11,7 +11,55 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/index.js
+ * Bootstrap dom/data.js
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
+ * --------------------------------------------------------------------------
+ */
+
+ /**
+ * Constants
+ */
+
+ const elementMap = new Map();
+ const Data = {
+ set(element, key, instance) {
+ if (!elementMap.has(element)) {
+ elementMap.set(element, new Map());
+ }
+ const instanceMap = elementMap.get(element);
+
+ // make it clear we only want one instance per element
+ // can be removed later when multiple key/instances are fine to be used
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
+ // eslint-disable-next-line no-console
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
+ return;
+ }
+ instanceMap.set(key, instance);
+ },
+ get(element, key) {
+ if (elementMap.has(element)) {
+ return elementMap.get(element).get(key) || null;
+ }
+ return null;
+ },
+ remove(element, key) {
+ if (!elementMap.has(element)) {
+ return;
+ }
+ const instanceMap = elementMap.get(element);
+ instanceMap.delete(key);
+
+ // free up element references if there are no instances left for an element
+ if (instanceMap.size === 0) {
+ elementMap.delete(element);
+ }
+ }
+ };
+
+ /**
+ * --------------------------------------------------------------------------
+ * Bootstrap util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -258,7 +306,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): dom/event-handler.js
+ * Bootstrap dom/event-handler.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -328,7 +376,7 @@
}
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
const isDelegated = typeof handler === 'string';
- // todo: tooltip passes `false` instead of selector, so we need to check
+ // TODO: tooltip passes `false` instead of selector, so we need to check
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
let typeEvent = getTypeEvent(originalTypeEvent);
if (!nativeEvents.has(typeEvent)) {
@@ -445,11 +493,10 @@
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
defaultPrevented = jQueryEvent.isDefaultPrevented();
}
- let evt = new Event(event, {
+ const evt = hydrateObj(new Event(event, {
bubbles,
cancelable: true
- });
- evt = hydrateObj(evt, args);
+ }), args);
if (defaultPrevented) {
evt.preventDefault();
}
@@ -480,55 +527,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): dom/data.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- * --------------------------------------------------------------------------
- */
-
- /**
- * Constants
- */
-
- const elementMap = new Map();
- const Data = {
- set(element, key, instance) {
- if (!elementMap.has(element)) {
- elementMap.set(element, new Map());
- }
- const instanceMap = elementMap.get(element);
-
- // make it clear we only want one instance per element
- // can be removed later when multiple key/instances are fine to be used
- if (!instanceMap.has(key) && instanceMap.size !== 0) {
- // eslint-disable-next-line no-console
- console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
- return;
- }
- instanceMap.set(key, instance);
- },
- get(element, key) {
- if (elementMap.has(element)) {
- return elementMap.get(element).get(key) || null;
- }
- return null;
- },
- remove(element, key) {
- if (!elementMap.has(element)) {
- return;
- }
- const instanceMap = elementMap.get(element);
- instanceMap.delete(key);
-
- // free up element references if there are no instances left for an element
- if (instanceMap.size === 0) {
- elementMap.delete(element);
- }
- }
- };
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): dom/manipulator.js
+ * Bootstrap dom/manipulator.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -585,7 +584,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/config.js
+ * Bootstrap util/config.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -637,7 +636,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): base-component.js
+ * Bootstrap base-component.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -646,7 +645,7 @@
* Constants
*/
- const VERSION = '5.3.0-alpha1';
+ const VERSION = '5.3.0-alpha2';
/**
* Class definition
@@ -705,7 +704,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): dom/selector-engine.js
+ * Bootstrap dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -793,7 +792,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/component-functions.js
+ * Bootstrap util/component-functions.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -817,7 +816,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): alert.js
+ * Bootstrap alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -891,7 +890,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): button.js
+ * Bootstrap button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -954,7 +953,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/swipe.js
+ * Bootstrap util/swipe.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -1073,7 +1072,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): carousel.js
+ * Bootstrap carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -1333,7 +1332,7 @@
}
if (!activeElement || !nextElement) {
// Some weirdness is happening, so we bail
- // todo: change tests that use empty divs to avoid this check
+ // TODO: change tests that use empty divs to avoid this check
return;
}
const isCycling = Boolean(this._interval);
@@ -1445,7 +1444,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): collapse.js
+ * Bootstrap collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -1839,7 +1838,7 @@
function getUAString() {
var uaData = navigator.userAgentData;
- if (uaData != null && uaData.brands) {
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
return uaData.brands.map(function (item) {
return item.brand + "/" + item.version;
}).join(' ');
@@ -2158,10 +2157,9 @@
// Zooming can change the DPR, but it seems to report a value that will
// cleanly divide the values into the appropriate subpixels.
- function roundOffsetsByDPR(_ref) {
+ function roundOffsetsByDPR(_ref, win) {
var x = _ref.x,
y = _ref.y;
- var win = window;
var dpr = win.devicePixelRatio || 1;
return {
x: round(x * dpr) / dpr || 0,
@@ -2244,7 +2242,7 @@
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
x: x,
y: y
- }) : {
+ }, getWindow(popper)) : {
x: x,
y: y
};
@@ -3482,49 +3480,49 @@
const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
- popperGenerator,
- detectOverflow,
- createPopperBase: createPopper$2,
- createPopper,
- createPopperLite: createPopper$1,
- top,
- bottom,
- right,
- left,
- auto,
- basePlacements,
- start,
- end,
- clippingParents,
- viewport,
- popper,
- reference,
- variationPlacements,
- placements,
- beforeRead,
- read,
- afterRead,
- beforeMain,
- main,
afterMain,
- beforeWrite,
- write,
+ afterRead,
afterWrite,
- modifierPhases,
applyStyles: applyStyles$1,
arrow: arrow$1,
+ auto,
+ basePlacements,
+ beforeMain,
+ beforeRead,
+ beforeWrite,
+ bottom,
+ clippingParents,
computeStyles: computeStyles$1,
+ createPopper,
+ createPopperBase: createPopper$2,
+ createPopperLite: createPopper$1,
+ detectOverflow,
+ end,
eventListeners,
flip: flip$1,
hide: hide$1,
+ left,
+ main,
+ modifierPhases,
offset: offset$1,
+ placements,
+ popper,
+ popperGenerator,
popperOffsets: popperOffsets$1,
- preventOverflow: preventOverflow$1
+ preventOverflow: preventOverflow$1,
+ read,
+ reference,
+ right,
+ start,
+ top,
+ variationPlacements,
+ viewport,
+ write
}, Symbol.toStringTag, { value: 'Module' }));
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): dropdown.js
+ * Bootstrap dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -3596,7 +3594,7 @@
super(element, config);
this._popper = null;
this._parent = this._element.parentNode; // dropdown wrapper
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
this._inNavbar = this._detectNavbar();
}
@@ -3770,7 +3768,7 @@
// Disable Popper if we have a static display or Dropdown is in Navbar
if (this._inNavbar || this._config.display === 'static') {
- Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
defaultBsPopperConfig.modifiers = [{
name: 'applyStyles',
enabled: false
@@ -3852,7 +3850,7 @@
}
event.preventDefault();
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
const instance = Dropdown.getOrCreateInstance(getToggleButton);
if (isUpOrDownEvent) {
@@ -3891,104 +3889,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/scrollBar.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- * --------------------------------------------------------------------------
- */
-
- /**
- * Constants
- */
-
- const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
- const SELECTOR_STICKY_CONTENT = '.sticky-top';
- const PROPERTY_PADDING = 'padding-right';
- const PROPERTY_MARGIN = 'margin-right';
-
- /**
- * Class definition
- */
-
- class ScrollBarHelper {
- constructor() {
- this._element = document.body;
- }
-
- // Public
- getWidth() {
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
- const documentWidth = document.documentElement.clientWidth;
- return Math.abs(window.innerWidth - documentWidth);
- }
- hide() {
- const width = this.getWidth();
- this._disableOverFlow();
- // give padding to element to balance the hidden scrollbar width
- this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
- // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
- this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
- this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
- }
- reset() {
- this._resetElementAttributes(this._element, 'overflow');
- this._resetElementAttributes(this._element, PROPERTY_PADDING);
- this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
- this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
- }
- isOverflowing() {
- return this.getWidth() > 0;
- }
-
- // Private
- _disableOverFlow() {
- this._saveInitialAttribute(this._element, 'overflow');
- this._element.style.overflow = 'hidden';
- }
- _setElementAttributes(selector, styleProperty, callback) {
- const scrollbarWidth = this.getWidth();
- const manipulationCallBack = element => {
- if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
- return;
- }
- this._saveInitialAttribute(element, styleProperty);
- const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
- element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
- };
- this._applyManipulationCallback(selector, manipulationCallBack);
- }
- _saveInitialAttribute(element, styleProperty) {
- const actualValue = element.style.getPropertyValue(styleProperty);
- if (actualValue) {
- Manipulator.setDataAttribute(element, styleProperty, actualValue);
- }
- }
- _resetElementAttributes(selector, styleProperty) {
- const manipulationCallBack = element => {
- const value = Manipulator.getDataAttribute(element, styleProperty);
- // We only want to remove the property if the value is `null`; the value can also be zero
- if (value === null) {
- element.style.removeProperty(styleProperty);
- return;
- }
- Manipulator.removeDataAttribute(element, styleProperty);
- element.style.setProperty(styleProperty, value);
- };
- this._applyManipulationCallback(selector, manipulationCallBack);
- }
- _applyManipulationCallback(selector, callBack) {
- if (isElement$1(selector)) {
- callBack(selector);
- return;
- }
- for (const sel of SelectorEngine.find(selector, this._element)) {
- callBack(sel);
- }
- }
- }
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/backdrop.js
+ * Bootstrap util/backdrop.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -4112,7 +4013,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/focustrap.js
+ * Bootstrap util/focustrap.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -4210,7 +4111,104 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): modal.js
+ * Bootstrap util/scrollBar.js
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
+ * --------------------------------------------------------------------------
+ */
+
+ /**
+ * Constants
+ */
+
+ const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
+ const SELECTOR_STICKY_CONTENT = '.sticky-top';
+ const PROPERTY_PADDING = 'padding-right';
+ const PROPERTY_MARGIN = 'margin-right';
+
+ /**
+ * Class definition
+ */
+
+ class ScrollBarHelper {
+ constructor() {
+ this._element = document.body;
+ }
+
+ // Public
+ getWidth() {
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
+ const documentWidth = document.documentElement.clientWidth;
+ return Math.abs(window.innerWidth - documentWidth);
+ }
+ hide() {
+ const width = this.getWidth();
+ this._disableOverFlow();
+ // give padding to element to balance the hidden scrollbar width
+ this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
+ // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
+ }
+ reset() {
+ this._resetElementAttributes(this._element, 'overflow');
+ this._resetElementAttributes(this._element, PROPERTY_PADDING);
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
+ }
+ isOverflowing() {
+ return this.getWidth() > 0;
+ }
+
+ // Private
+ _disableOverFlow() {
+ this._saveInitialAttribute(this._element, 'overflow');
+ this._element.style.overflow = 'hidden';
+ }
+ _setElementAttributes(selector, styleProperty, callback) {
+ const scrollbarWidth = this.getWidth();
+ const manipulationCallBack = element => {
+ if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
+ return;
+ }
+ this._saveInitialAttribute(element, styleProperty);
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
+ };
+ this._applyManipulationCallback(selector, manipulationCallBack);
+ }
+ _saveInitialAttribute(element, styleProperty) {
+ const actualValue = element.style.getPropertyValue(styleProperty);
+ if (actualValue) {
+ Manipulator.setDataAttribute(element, styleProperty, actualValue);
+ }
+ }
+ _resetElementAttributes(selector, styleProperty) {
+ const manipulationCallBack = element => {
+ const value = Manipulator.getDataAttribute(element, styleProperty);
+ // We only want to remove the property if the value is `null`; the value can also be zero
+ if (value === null) {
+ element.style.removeProperty(styleProperty);
+ return;
+ }
+ Manipulator.removeDataAttribute(element, styleProperty);
+ element.style.setProperty(styleProperty, value);
+ };
+ this._applyManipulationCallback(selector, manipulationCallBack);
+ }
+ _applyManipulationCallback(selector, callBack) {
+ if (isElement$1(selector)) {
+ callBack(selector);
+ return;
+ }
+ for (const sel of SelectorEngine.find(selector, this._element)) {
+ callBack(sel);
+ }
+ }
+ }
+
+ /**
+ * --------------------------------------------------------------------------
+ * Bootstrap modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -4316,9 +4314,8 @@
this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
}
dispose() {
- for (const htmlElement of [window, this._dialog]) {
- EventHandler.off(htmlElement, EVENT_KEY$4);
- }
+ EventHandler.off(window, EVENT_KEY$4);
+ EventHandler.off(this._dialog, EVENT_KEY$4);
this._backdrop.dispose();
this._focustrap.deactivate();
super.dispose();
@@ -4373,7 +4370,6 @@
return;
}
if (this._config.keyboard) {
- event.preventDefault();
this.hide();
return;
}
@@ -4516,7 +4512,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): offcanvas.js
+ * Bootstrap offcanvas.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -4674,11 +4670,11 @@
if (event.key !== ESCAPE_KEY) {
return;
}
- if (!this._config.keyboard) {
- EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
+ if (this._config.keyboard) {
+ this.hide();
return;
}
- this.hide();
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
});
}
@@ -4746,13 +4742,12 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/sanitizer.js
+ * Bootstrap util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
- const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
/**
* A pattern that recognizes a commonly useful subset of URLs that are safe.
@@ -4779,6 +4774,9 @@
// Check if a regular expression validates the attribute.
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
};
+
+ // js-docs-start allow-list
+ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
const DefaultAllowlist = {
// Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
@@ -4812,6 +4810,8 @@
u: [],
ul: []
};
+ // js-docs-end allow-list
+
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
if (!unsafeHtml.length) {
return unsafeHtml;
@@ -4841,7 +4841,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): util/template-factory.js
+ * Bootstrap util/template-factory.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -4976,7 +4976,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): tooltip.js
+ * Bootstrap tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -5023,7 +5023,7 @@
delay: 0,
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
html: false,
- offset: [0, 0],
+ offset: [0, 6],
placement: 'top',
popperConfig: null,
sanitize: true,
@@ -5136,7 +5136,7 @@
return;
}
- // todo v6 remove this OR make it optional
+ // TODO: v6 remove this or make it optional
this._disposePopper();
const tip = this._getTipElement();
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
@@ -5222,12 +5222,12 @@
_createTipElement(content) {
const tip = this._getTemplateFactory(content).toHtml();
- // todo: remove this check on v6
+ // TODO: remove this check in v6
if (!tip) {
return null;
}
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
- // todo: on v6 the following can be achieved with CSS only
+ // TODO: v6 the following can be achieved with CSS only
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
const tipId = getUID(this.constructor.NAME).toString();
tip.setAttribute('id', tipId);
@@ -5487,7 +5487,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): popover.js
+ * Bootstrap popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -5567,7 +5567,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): scrollspy.js
+ * Bootstrap scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -5826,7 +5826,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): tab.js
+ * Bootstrap tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -5859,7 +5859,7 @@
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
const SELECTOR_OUTER = '.nav-item, .list-group-item';
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
- const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // todo:v6: could be only `tab`
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
@@ -5873,7 +5873,7 @@
this._parent = this._element.closest(SELECTOR_TAB_PANEL);
if (!this._parent) {
return;
- // todo: should Throw exception on v6
+ // TODO: should throw exception in v6
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
}
@@ -6005,7 +6005,7 @@
}
this._setAttributeIfNotExists(target, 'role', 'tabpanel');
if (child.id) {
- this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
+ this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
}
}
_toggleDropDown(element, open) {
@@ -6087,7 +6087,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): toast.js
+ * Bootstrap toast.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -6270,7 +6270,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.3.0-alpha1): index.umd.js
+ * Bootstrap index.umd.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/