mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-21 04:41:36 +02:00
Release v5.1.2 (#35114)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap v5.1.1 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.1.2 (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,33 +7,31 @@
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) :
|
||||
typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper));
|
||||
}(this, (function (Popper) { 'use strict';
|
||||
})(this, (function (Popper) { 'use strict';
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
const n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
for (const k in e) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
const d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return e[k];
|
||||
}
|
||||
get: () => e[k]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
n['default'] = e;
|
||||
n.default = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
||||
const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): util/index.js
|
||||
* Bootstrap (v5.1.2): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -344,7 +342,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): dom/event-handler.js
|
||||
* Bootstrap (v5.1.2): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -632,7 +630,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): dom/data.js
|
||||
* Bootstrap (v5.1.2): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -643,7 +641,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
const elementMap = new Map();
|
||||
var Data = {
|
||||
const Data = {
|
||||
set(element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map());
|
||||
@@ -686,7 +684,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): base-component.js
|
||||
* Bootstrap (v5.1.2): base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -696,7 +694,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const VERSION = '5.1.1';
|
||||
const VERSION = '5.1.2';
|
||||
|
||||
class BaseComponent {
|
||||
constructor(element) {
|
||||
@@ -752,7 +750,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): util/component-functions.js
|
||||
* Bootstrap (v5.1.2): util/component-functions.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -778,7 +776,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): alert.js
|
||||
* Bootstrap (v5.1.2): alert.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -867,7 +865,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): button.js
|
||||
* Bootstrap (v5.1.2): button.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -938,7 +936,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): dom/manipulator.js
|
||||
* Bootstrap (v5.1.2): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1012,7 +1010,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): dom/selector-engine.js
|
||||
* Bootstrap (v5.1.2): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1082,7 +1080,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): carousel.js
|
||||
* Bootstrap (v5.1.2): carousel.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1350,7 +1348,7 @@
|
||||
};
|
||||
|
||||
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
||||
EventHandler.on(itemImg, EVENT_DRAG_START, e => e.preventDefault());
|
||||
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
||||
});
|
||||
|
||||
if (this._pointerEvent) {
|
||||
@@ -1631,7 +1629,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): collapse.js
|
||||
* Bootstrap (v5.1.2): collapse.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1662,6 +1660,7 @@
|
||||
const CLASS_NAME_COLLAPSE = 'collapse';
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing';
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed';
|
||||
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
||||
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
||||
const WIDTH = 'width';
|
||||
const HEIGHT = 'height';
|
||||
@@ -1731,7 +1730,7 @@
|
||||
let activesData;
|
||||
|
||||
if (this._config.parent) {
|
||||
const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);
|
||||
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
||||
}
|
||||
|
||||
@@ -1869,7 +1868,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);
|
||||
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
||||
const selected = getElementFromSelector(element);
|
||||
|
||||
@@ -1949,7 +1948,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): dropdown.js
|
||||
* Bootstrap (v5.1.2): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2411,7 +2410,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): util/scrollBar.js
|
||||
* Bootstrap (v5.1.2): util/scrollBar.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2515,8 +2514,8 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): util/backdrop.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v5.1.2): util/backdrop.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const Default$7 = {
|
||||
@@ -2639,8 +2638,8 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): util/focustrap.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v5.1.2): util/focustrap.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const Default$6 = {
|
||||
@@ -2742,7 +2741,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): modal.js
|
||||
* Bootstrap (v5.1.2): modal.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3171,8 +3170,8 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): offcanvas.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Bootstrap (v5.1.2): offcanvas.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
@@ -3427,42 +3426,42 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): util/sanitizer.js
|
||||
* Bootstrap (v5.1.2): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
||||
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.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
|
||||
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
||||
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
||||
/**
|
||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
|
||||
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
|
||||
|
||||
const allowedAttribute = (attr, allowedAttributeList) => {
|
||||
const attrName = attr.nodeName.toLowerCase();
|
||||
const allowedAttribute = (attribute, allowedAttributeList) => {
|
||||
const attributeName = attribute.nodeName.toLowerCase();
|
||||
|
||||
if (allowedAttributeList.includes(attrName)) {
|
||||
if (uriAttrs.has(attrName)) {
|
||||
return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
|
||||
if (allowedAttributeList.includes(attributeName)) {
|
||||
if (uriAttributes.has(attributeName)) {
|
||||
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
||||
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
||||
|
||||
for (let i = 0, len = regExp.length; i < len; i++) {
|
||||
if (regExp[i].test(attrName)) {
|
||||
if (regExp[i].test(attributeName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3514,23 +3513,22 @@
|
||||
|
||||
const domParser = new window.DOMParser();
|
||||
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
||||
const allowlistKeys = Object.keys(allowList);
|
||||
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
||||
|
||||
for (let i = 0, len = elements.length; i < len; i++) {
|
||||
const el = elements[i];
|
||||
const elName = el.nodeName.toLowerCase();
|
||||
const element = elements[i];
|
||||
const elementName = element.nodeName.toLowerCase();
|
||||
|
||||
if (!allowlistKeys.includes(elName)) {
|
||||
el.remove();
|
||||
if (!Object.keys(allowList).includes(elementName)) {
|
||||
element.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
const attributeList = [].concat(...el.attributes);
|
||||
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
|
||||
attributeList.forEach(attr => {
|
||||
if (!allowedAttribute(attr, allowedAttributes)) {
|
||||
el.removeAttribute(attr.nodeName);
|
||||
const attributeList = [].concat(...element.attributes);
|
||||
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
||||
attributeList.forEach(attribute => {
|
||||
if (!allowedAttribute(attribute, allowedAttributes)) {
|
||||
element.removeAttribute(attribute.nodeName);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3540,7 +3538,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): tooltip.js
|
||||
* Bootstrap (v5.1.2): tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4250,7 +4248,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): popover.js
|
||||
* Bootstrap (v5.1.2): popover.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4360,7 +4358,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): scrollspy.js
|
||||
* Bootstrap (v5.1.2): scrollspy.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4595,7 +4593,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): tab.js
|
||||
* Bootstrap (v5.1.2): tab.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4793,7 +4791,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): toast.js
|
||||
* Bootstrap (v5.1.2): toast.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -5023,11 +5021,11 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.1): index.umd.js
|
||||
* Bootstrap (v5.1.2): index.umd.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
var index_umd = {
|
||||
const index_umd = {
|
||||
Alert,
|
||||
Button,
|
||||
Carousel,
|
||||
@@ -5044,5 +5042,5 @@
|
||||
|
||||
return index_umd;
|
||||
|
||||
})));
|
||||
}));
|
||||
//# sourceMappingURL=bootstrap.js.map
|
||||
|
Reference in New Issue
Block a user