mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-21 13:29:00 +01:00
parent
bb369ca813
commit
cfd00b5eeb
@ -59,7 +59,6 @@ const getConfigByPluginKey = pluginKey => {
|
||||
pluginKey === 'Data' ||
|
||||
pluginKey === 'Manipulator' ||
|
||||
pluginKey === 'EventHandler' ||
|
||||
pluginKey === 'Polyfill' ||
|
||||
pluginKey === 'SelectorEngine' ||
|
||||
pluginKey === 'Util' ||
|
||||
pluginKey === 'Sanitizer'
|
||||
|
@ -12,7 +12,7 @@ let fileDest = `bootstrap${ESM ? '.esm' : ''}`
|
||||
const external = ['popper.js']
|
||||
const plugins = [
|
||||
babel({
|
||||
// Only transpile our source code
|
||||
// Only transpile our source code
|
||||
exclude: 'node_modules/**',
|
||||
// Include the helpers in the bundle, at most one copy of each
|
||||
babelHelpers: 'bundled'
|
||||
|
111
js/dist/dom/polyfill.js
vendored
111
js/dist/dom/polyfill.js
vendored
@ -1,111 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap polyfill.js v5.0.0-alpha2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Polyfill = {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha2): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
var MAX_UID = 1000000;
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Public Util Api
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
var getUID = function getUID(prefix) {
|
||||
do {
|
||||
prefix += Math.floor(Math.random() * MAX_UID);
|
||||
} while (document.getElementById(prefix));
|
||||
|
||||
return prefix;
|
||||
};
|
||||
|
||||
/* istanbul ignore file */
|
||||
exports.find = Element.prototype.querySelectorAll;
|
||||
exports.findOne = Element.prototype.querySelector; // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
|
||||
|
||||
var defaultPreventedPreservedOnDispatch = function () {
|
||||
var e = new CustomEvent('Bootstrap', {
|
||||
cancelable: true
|
||||
});
|
||||
var element = document.createElement('div');
|
||||
element.addEventListener('Bootstrap', function () {
|
||||
return null;
|
||||
});
|
||||
e.preventDefault();
|
||||
element.dispatchEvent(e);
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
|
||||
var scopeSelectorRegex = /:scope\b/;
|
||||
|
||||
var supportScopeQuery = function () {
|
||||
var element = document.createElement('div');
|
||||
|
||||
try {
|
||||
element.querySelectorAll(':scope *');
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}();
|
||||
|
||||
if (!supportScopeQuery) {
|
||||
exports.find = function find(selector) {
|
||||
if (!scopeSelectorRegex.test(selector)) {
|
||||
return this.querySelectorAll(selector);
|
||||
}
|
||||
|
||||
var hasId = Boolean(this.id);
|
||||
|
||||
if (!hasId) {
|
||||
this.id = getUID('scope');
|
||||
}
|
||||
|
||||
var nodeList = null;
|
||||
|
||||
try {
|
||||
selector = selector.replace(scopeSelectorRegex, "#" + this.id);
|
||||
nodeList = this.querySelectorAll(selector);
|
||||
} finally {
|
||||
if (!hasId) {
|
||||
this.removeAttribute('id');
|
||||
}
|
||||
}
|
||||
|
||||
return nodeList;
|
||||
};
|
||||
|
||||
exports.findOne = function findOne(selector) {
|
||||
if (!scopeSelectorRegex.test(selector)) {
|
||||
return this.querySelector(selector);
|
||||
}
|
||||
|
||||
var matches = exports.find.call(this, selector);
|
||||
|
||||
if (typeof matches[0] !== 'undefined') {
|
||||
return matches[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
exports.defaultPreventedPreservedOnDispatch = defaultPreventedPreservedOnDispatch;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=polyfill.js.map
|
1
js/dist/dom/polyfill.js.map
vendored
1
js/dist/dom/polyfill.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user