From bd84ff483887c55c6ede4ba94e1a9175e34090b8 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jun 2023 16:36:57 +0000 Subject: update bootstrap to version 5.3 --- vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js | 99 +++++++++++++---------- 1 file changed, 55 insertions(+), 44 deletions(-) (limited to 'vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js') diff --git a/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js b/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js index 8c4766422..dceaa8114 100644 --- a/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js +++ b/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js @@ -1,5 +1,5 @@ /*! - * Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/) + * Bootstrap v5.3.0 (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) */ @@ -311,6 +311,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -589,6 +590,7 @@ * -------------------------------------------------------------------------- */ + /** * Class definition */ @@ -641,11 +643,12 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ - const VERSION = '5.3.0-alpha2'; + const VERSION = '5.3.0'; /** * Class definition @@ -708,6 +711,7 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ + const getSelector = element => { let selector = element.getAttribute('data-bs-target'); if (!selector || selector === '#') { @@ -796,6 +800,7 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ + const enableDismissTrigger = (component, method = 'hide') => { const clickEvent = `click.dismiss${component.EVENT_KEY}`; const name = component.NAME; @@ -821,6 +826,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -895,6 +901,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -958,6 +965,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -1077,6 +1085,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -1449,6 +1458,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -2126,7 +2136,6 @@ } if (!contains(state.elements.popper, arrowElement)) { - return; } @@ -2268,7 +2277,6 @@ adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - var commonStyles = { placement: getBasePlacement(state.placement), variation: getVariation(state.placement), @@ -3336,8 +3344,7 @@ state.orderedModifiers = orderedModifiers.filter(function (m) { return m.enabled; - }); // Validate the provided modifiers so that the consumer will get warned - + }); runModifierEffects(); return instance.update(); }, @@ -3357,7 +3364,6 @@ // anymore if (!areValidElements(reference, popper)) { - return; } // Store the reference and popper rects to be read by modifiers @@ -3382,7 +3388,6 @@ }); for (var index = 0; index < state.orderedModifiers.length; index++) { - if (state.reset === true) { state.reset = false; index = -1; @@ -3420,7 +3425,6 @@ }; if (!areValidElements(reference, popper)) { - return instance; } @@ -3435,11 +3439,11 @@ // one. function runModifierEffects() { - state.orderedModifiers.forEach(function (_ref3) { - var name = _ref3.name, - _ref3$options = _ref3.options, - options = _ref3$options === void 0 ? {} : _ref3$options, - effect = _ref3.effect; + state.orderedModifiers.forEach(function (_ref) { + var name = _ref.name, + _ref$options = _ref.options, + options = _ref$options === void 0 ? {} : _ref$options, + effect = _ref.effect; if (typeof effect === 'function') { var cleanupFn = effect({ @@ -3527,6 +3531,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -3894,6 +3899,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -4018,6 +4024,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -4116,6 +4123,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -4213,6 +4221,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -4517,6 +4526,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -4747,34 +4757,6 @@ * -------------------------------------------------------------------------- */ - const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); - - /** - * A pattern that recognizes a commonly useful subset of URLs that are safe. - * - * Shout-out 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|sms):|[^#&/:?]*(?:[#/?]|$))/i; - - /** - * A pattern that matches safe data URLs. Only matches image, video and audio types. - * - * Shout-out 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 = (attribute, allowedAttributeList) => { - const attributeName = attribute.nodeName.toLowerCase(); - if (allowedAttributeList.includes(attributeName)) { - if (uriAttributes.has(attributeName)) { - return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue)); - } - return true; - } - - // 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 = { @@ -4812,6 +4794,28 @@ }; // js-docs-end allow-list + const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); + + /** + * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation + * contexts. + * + * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 + */ + // eslint-disable-next-line unicorn/better-regex + const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; + const allowedAttribute = (attribute, allowedAttributeList) => { + const attributeName = attribute.nodeName.toLowerCase(); + if (allowedAttributeList.includes(attributeName)) { + if (uriAttributes.has(attributeName)) { + return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); + } + return true; + } + + // Check if a regular expression validates the attribute. + return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); + }; function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { if (!unsafeHtml.length) { return unsafeHtml; @@ -4846,6 +4850,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -4981,6 +4986,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -5492,6 +5498,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -5572,6 +5579,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -5750,11 +5758,11 @@ if (!anchor.hash || isDisabled(anchor)) { continue; } - const observableSection = SelectorEngine.findOne(anchor.hash, this._element); + const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); // ensure that the observableSection exists & is visible if (isVisible(observableSection)) { - this._targetLinks.set(anchor.hash, anchor); + this._targetLinks.set(decodeURI(anchor.hash), anchor); this._observableSections.set(anchor.hash, observableSection); } } @@ -5831,6 +5839,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -6092,6 +6101,7 @@ * -------------------------------------------------------------------------- */ + /** * Constants */ @@ -6274,6 +6284,7 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ + const index_umd = { Alert, Button, -- cgit v1.2.3