mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 20:31:26 +02:00
Dist (#31644)
This commit is contained in:
287
dist/js/bootstrap.bundle.js
vendored
287
dist/js/bootstrap.bundle.js
vendored
@@ -6,7 +6,7 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.bootstrap = factory());
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
@@ -25,53 +25,22 @@
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
function _extends() {
|
||||
_extends = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
};
|
||||
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _inheritsLoose(subClass, superClass) {
|
||||
@@ -272,22 +241,22 @@
|
||||
var id = 1;
|
||||
return {
|
||||
set: function set(element, key, data) {
|
||||
if (typeof element.key === 'undefined') {
|
||||
element.key = {
|
||||
if (typeof element.bsKey === 'undefined') {
|
||||
element.bsKey = {
|
||||
key: key,
|
||||
id: id
|
||||
};
|
||||
id++;
|
||||
}
|
||||
|
||||
storeData[element.key.id] = data;
|
||||
storeData[element.bsKey.id] = data;
|
||||
},
|
||||
get: function get(element, key) {
|
||||
if (!element || typeof element.key === 'undefined') {
|
||||
if (!element || typeof element.bsKey === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var keyProperties = element.key;
|
||||
var keyProperties = element.bsKey;
|
||||
|
||||
if (keyProperties.key === key) {
|
||||
return storeData[keyProperties.id];
|
||||
@@ -296,15 +265,15 @@
|
||||
return null;
|
||||
},
|
||||
delete: function _delete(element, key) {
|
||||
if (typeof element.key === 'undefined') {
|
||||
if (typeof element.bsKey === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var keyProperties = element.key;
|
||||
var keyProperties = element.bsKey;
|
||||
|
||||
if (keyProperties.key === key) {
|
||||
delete storeData[keyProperties.id];
|
||||
delete element.key;
|
||||
delete element.bsKey;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -437,6 +406,8 @@
|
||||
|
||||
function bootstrapHandler(element, fn) {
|
||||
return function handler(event) {
|
||||
event.delegateTarget = element;
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn);
|
||||
}
|
||||
@@ -452,6 +423,8 @@
|
||||
for (var target = event.target; target && target !== this; target = target.parentNode) {
|
||||
for (var i = domElements.length; i--;) {
|
||||
if (domElements[i] === target) {
|
||||
event.delegateTarget = target;
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn);
|
||||
}
|
||||
@@ -636,7 +609,7 @@
|
||||
bubbles: bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
} // merge custom informations in our event
|
||||
} // merge custom information in our event
|
||||
|
||||
|
||||
if (typeof args !== 'undefined') {
|
||||
@@ -711,11 +684,7 @@
|
||||
|
||||
// Public
|
||||
_proto.close = function close(element) {
|
||||
var rootElement = this._element;
|
||||
|
||||
if (element) {
|
||||
rootElement = this._getRootElement(element);
|
||||
}
|
||||
var rootElement = element ? this._getRootElement(element) : this._element;
|
||||
|
||||
var customEvent = this._triggerCloseEvent(rootElement);
|
||||
|
||||
@@ -984,7 +953,7 @@
|
||||
return {};
|
||||
}
|
||||
|
||||
var attributes = _objectSpread2({}, element.dataset);
|
||||
var attributes = _extends({}, element.dataset);
|
||||
|
||||
Object.keys(attributes).forEach(function (key) {
|
||||
attributes[key] = normalizeData(attributes[key]);
|
||||
@@ -1297,7 +1266,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default), config);
|
||||
config = _extends({}, Default, config);
|
||||
typeCheckConfig(NAME$2, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
@@ -1591,10 +1560,10 @@
|
||||
Carousel.carouselInterface = function carouselInterface(element, config) {
|
||||
var data = Data.getData(element, DATA_KEY$2);
|
||||
|
||||
var _config = _objectSpread2(_objectSpread2({}, Default), Manipulator.getDataAttributes(element));
|
||||
var _config = _extends({}, Default, Manipulator.getDataAttributes(element));
|
||||
|
||||
if (typeof config === 'object') {
|
||||
_config = _objectSpread2(_objectSpread2({}, _config), config);
|
||||
_config = _extends({}, _config, config);
|
||||
}
|
||||
|
||||
var action = typeof config === 'string' ? config : _config.slide;
|
||||
@@ -1630,7 +1599,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var config = _objectSpread2(_objectSpread2({}, Manipulator.getDataAttributes(target)), Manipulator.getDataAttributes(this));
|
||||
var config = _extends({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this));
|
||||
|
||||
var slideIndex = this.getAttribute('data-slide-to');
|
||||
|
||||
@@ -1947,7 +1916,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default$1), config);
|
||||
config = _extends({}, Default$1, config);
|
||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||
|
||||
typeCheckConfig(NAME$3, config, DefaultType$1);
|
||||
@@ -1955,9 +1924,7 @@
|
||||
};
|
||||
|
||||
_proto._getDimension = function _getDimension() {
|
||||
var hasWidth = this._element.classList.contains(WIDTH);
|
||||
|
||||
return hasWidth ? WIDTH : HEIGHT;
|
||||
return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
|
||||
};
|
||||
|
||||
_proto._getParent = function _getParent() {
|
||||
@@ -1984,28 +1951,27 @@
|
||||
};
|
||||
|
||||
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
||||
if (element) {
|
||||
var isOpen = element.classList.contains(CLASS_NAME_SHOW);
|
||||
|
||||
if (triggerArray.length) {
|
||||
triggerArray.forEach(function (elem) {
|
||||
if (isOpen) {
|
||||
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
||||
} else {
|
||||
elem.classList.add(CLASS_NAME_COLLAPSED);
|
||||
}
|
||||
|
||||
elem.setAttribute('aria-expanded', isOpen);
|
||||
});
|
||||
}
|
||||
if (!element || !triggerArray.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var isOpen = element.classList.contains(CLASS_NAME_SHOW);
|
||||
triggerArray.forEach(function (elem) {
|
||||
if (isOpen) {
|
||||
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
||||
} else {
|
||||
elem.classList.add(CLASS_NAME_COLLAPSED);
|
||||
}
|
||||
|
||||
elem.setAttribute('aria-expanded', isOpen);
|
||||
});
|
||||
} // Static
|
||||
;
|
||||
|
||||
Collapse.collapseInterface = function collapseInterface(element, config) {
|
||||
var data = Data.getData(element, DATA_KEY$3);
|
||||
|
||||
var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$1), Manipulator.getDataAttributes(element)), typeof config === 'object' && config ? config : {});
|
||||
var _config = _extends({}, Default$1, Manipulator.getDataAttributes(element), typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false;
|
||||
@@ -2106,7 +2072,7 @@
|
||||
|
||||
/**!
|
||||
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
||||
* @version 1.16.0
|
||||
* @version 1.16.1
|
||||
* @license
|
||||
* Copyright (c) 2016 Federico Zivolo and contributors
|
||||
*
|
||||
@@ -2452,7 +2418,7 @@
|
||||
var sideA = axis === 'x' ? 'Left' : 'Top';
|
||||
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
|
||||
|
||||
return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
|
||||
return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
|
||||
}
|
||||
|
||||
function getSize(axis, body, html, computedStyle) {
|
||||
@@ -2513,7 +2479,7 @@
|
||||
return obj;
|
||||
};
|
||||
|
||||
var _extends = Object.assign || function (target) {
|
||||
var _extends$1 = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
@@ -2535,7 +2501,7 @@
|
||||
* @returns {Object} ClientRect like output
|
||||
*/
|
||||
function getClientRect(offsets) {
|
||||
return _extends({}, offsets, {
|
||||
return _extends$1({}, offsets, {
|
||||
right: offsets.left + offsets.width,
|
||||
bottom: offsets.top + offsets.height
|
||||
});
|
||||
@@ -2607,8 +2573,8 @@
|
||||
var scrollParent = getScrollParent(children);
|
||||
|
||||
var styles = getStyleComputedProperty(parent);
|
||||
var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
|
||||
var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
|
||||
var borderTopWidth = parseFloat(styles.borderTopWidth);
|
||||
var borderLeftWidth = parseFloat(styles.borderLeftWidth);
|
||||
|
||||
// In cases where the parent is fixed, we must ignore negative scroll in offset calc
|
||||
if (fixedPosition && isHTML) {
|
||||
@@ -2629,8 +2595,8 @@
|
||||
// differently when margins are applied to it. The margins are included in
|
||||
// the box of the documentElement, in the other cases not.
|
||||
if (!isIE10 && isHTML) {
|
||||
var marginTop = parseFloat(styles.marginTop, 10);
|
||||
var marginLeft = parseFloat(styles.marginLeft, 10);
|
||||
var marginTop = parseFloat(styles.marginTop);
|
||||
var marginLeft = parseFloat(styles.marginLeft);
|
||||
|
||||
offsets.top -= borderTopWidth - marginTop;
|
||||
offsets.bottom -= borderTopWidth - marginTop;
|
||||
@@ -2823,7 +2789,7 @@
|
||||
};
|
||||
|
||||
var sortedAreas = Object.keys(rects).map(function (key) {
|
||||
return _extends({
|
||||
return _extends$1({
|
||||
key: key
|
||||
}, rects[key], {
|
||||
area: getArea(rects[key])
|
||||
@@ -3465,9 +3431,9 @@
|
||||
};
|
||||
|
||||
// Update `data` attributes, styles and arrowStyles
|
||||
data.attributes = _extends({}, attributes, data.attributes);
|
||||
data.styles = _extends({}, styles, data.styles);
|
||||
data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
|
||||
data.attributes = _extends$1({}, attributes, data.attributes);
|
||||
data.styles = _extends$1({}, styles, data.styles);
|
||||
data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -3569,8 +3535,8 @@
|
||||
// Compute the sideValue using the updated popper offsets
|
||||
// take popper margin in account because we don't have this info available
|
||||
var css = getStyleComputedProperty(data.instance.popper);
|
||||
var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
|
||||
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
|
||||
var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
|
||||
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
|
||||
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
|
||||
|
||||
// prevent arrowElement from being placed not contiguously to its popper
|
||||
@@ -3747,7 +3713,7 @@
|
||||
|
||||
// this object contains `position`, we want to preserve it along with
|
||||
// any additional property we may add in the future
|
||||
data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
||||
data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
||||
|
||||
data = runModifiers(data.instance.modifiers, data, 'flip');
|
||||
}
|
||||
@@ -4021,7 +3987,7 @@
|
||||
|
||||
order.forEach(function (placement) {
|
||||
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
||||
popper = _extends({}, popper, check[side](placement));
|
||||
popper = _extends$1({}, popper, check[side](placement));
|
||||
});
|
||||
|
||||
data.offsets.popper = popper;
|
||||
@@ -4056,7 +4022,7 @@
|
||||
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
||||
};
|
||||
|
||||
data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
|
||||
data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
|
||||
}
|
||||
|
||||
return data;
|
||||
@@ -4588,7 +4554,7 @@
|
||||
this.update = debounce(this.update.bind(this));
|
||||
|
||||
// with {} we create a new object with the options inside it
|
||||
this.options = _extends({}, Popper.Defaults, options);
|
||||
this.options = _extends$1({}, Popper.Defaults, options);
|
||||
|
||||
// init state
|
||||
this.state = {
|
||||
@@ -4603,13 +4569,13 @@
|
||||
|
||||
// Deep merge modifiers options
|
||||
this.options.modifiers = {};
|
||||
Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
||||
_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
||||
Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
||||
_this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
||||
});
|
||||
|
||||
// Refactoring modifiers' list (Object => Array)
|
||||
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
|
||||
return _extends({
|
||||
return _extends$1({
|
||||
name: name
|
||||
}, _this.options.modifiers[name]);
|
||||
})
|
||||
@@ -4941,7 +4907,7 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), Manipulator.getDataAttributes(this._element)), config);
|
||||
config = _extends({}, this.constructor.Default, Manipulator.getDataAttributes(this._element), config);
|
||||
typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
|
||||
return config;
|
||||
};
|
||||
@@ -4982,7 +4948,7 @@
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@@ -5012,7 +4978,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig);
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
} // Static
|
||||
;
|
||||
|
||||
@@ -5423,7 +5389,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default$3), config);
|
||||
config = _extends({}, Default$3, config);
|
||||
typeCheckConfig(NAME$5, config, DefaultType$3);
|
||||
return config;
|
||||
};
|
||||
@@ -5629,11 +5595,25 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
this._element.style.overflowY = 'hidden';
|
||||
}
|
||||
|
||||
this._element.classList.add(CLASS_NAME_STATIC);
|
||||
|
||||
var modalTransitionDuration = getTransitionDurationFromElement(this._element);
|
||||
var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
|
||||
EventHandler.off(this._element, TRANSITION_END);
|
||||
EventHandler.one(this._element, TRANSITION_END, function () {
|
||||
_this9._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
EventHandler.one(_this9._element, TRANSITION_END, function () {
|
||||
_this9._element.style.overflowY = '';
|
||||
});
|
||||
emulateTransitionEnd(_this9._element, modalTransitionDuration);
|
||||
}
|
||||
});
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration);
|
||||
|
||||
@@ -5744,7 +5724,7 @@
|
||||
return this.each(function () {
|
||||
var data = Data.getData(this, DATA_KEY$5);
|
||||
|
||||
var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$3), Manipulator.getDataAttributes(this)), typeof config === 'object' && config ? config : {});
|
||||
var _config = _extends({}, Default$3, Manipulator.getDataAttributes(this), typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (!data) {
|
||||
data = new Modal(this, _config);
|
||||
@@ -5811,7 +5791,7 @@
|
||||
var data = Data.getData(target, DATA_KEY$5);
|
||||
|
||||
if (!data) {
|
||||
var config = _objectSpread2(_objectSpread2({}, Manipulator.getDataAttributes(target)), Manipulator.getDataAttributes(this));
|
||||
var config = _extends({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this));
|
||||
|
||||
data = new Modal(target, config);
|
||||
}
|
||||
@@ -5886,7 +5866,7 @@
|
||||
return false;
|
||||
};
|
||||
|
||||
var DefaultWhitelist = {
|
||||
var DefaultAllowlist = {
|
||||
// Global attributes allowed on any supplied element below.
|
||||
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||
a: ['target', 'href', 'title', 'rel'],
|
||||
@@ -5919,7 +5899,7 @@
|
||||
u: [],
|
||||
ul: []
|
||||
};
|
||||
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
|
||||
var _ref;
|
||||
|
||||
if (!unsafeHtml.length) {
|
||||
@@ -5932,7 +5912,7 @@
|
||||
|
||||
var domParser = new window.DOMParser();
|
||||
var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
||||
var whitelistKeys = Object.keys(whiteList);
|
||||
var allowlistKeys = Object.keys(allowList);
|
||||
|
||||
var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
|
||||
|
||||
@@ -5942,16 +5922,16 @@
|
||||
var el = elements[i];
|
||||
var elName = el.nodeName.toLowerCase();
|
||||
|
||||
if (whitelistKeys.indexOf(elName) === -1) {
|
||||
if (allowlistKeys.indexOf(elName) === -1) {
|
||||
el.parentNode.removeChild(el);
|
||||
return "continue";
|
||||
}
|
||||
|
||||
var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
|
||||
|
||||
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
|
||||
var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
|
||||
attributeList.forEach(function (attr) {
|
||||
if (!allowedAttribute(attr, whitelistedAttributes)) {
|
||||
if (!allowedAttribute(attr, allowedAttributes)) {
|
||||
el.removeAttribute(attr.nodeName);
|
||||
}
|
||||
});
|
||||
@@ -5978,7 +5958,7 @@
|
||||
var EVENT_KEY$6 = "." + DATA_KEY$6;
|
||||
var CLASS_PREFIX = 'bs-tooltip';
|
||||
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
|
||||
var DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn'];
|
||||
var DefaultType$4 = {
|
||||
animation: 'boolean',
|
||||
template: 'string',
|
||||
@@ -5994,7 +5974,7 @@
|
||||
boundary: '(string|element)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
whiteList: 'object',
|
||||
allowList: 'object',
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
var AttachmentMap = {
|
||||
@@ -6019,7 +5999,7 @@
|
||||
boundary: 'scrollParent',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
whiteList: DefaultWhitelist,
|
||||
allowList: DefaultAllowlist,
|
||||
popperConfig: null
|
||||
};
|
||||
var Event$1 = {
|
||||
@@ -6095,11 +6075,11 @@
|
||||
|
||||
if (event) {
|
||||
var dataKey = this.constructor.DATA_KEY;
|
||||
var context = Data.getData(event.target, dataKey);
|
||||
var context = Data.getData(event.delegateTarget, dataKey);
|
||||
|
||||
if (!context) {
|
||||
context = new this.constructor(event.target, this._getDelegateConfig());
|
||||
Data.setData(event.target, dataKey, context);
|
||||
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
||||
Data.setData(event.delegateTarget, dataKey, context);
|
||||
}
|
||||
|
||||
context._activeTrigger.click = !context._activeTrigger.click;
|
||||
@@ -6328,7 +6308,7 @@
|
||||
|
||||
if (this.config.html) {
|
||||
if (this.config.sanitize) {
|
||||
content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
|
||||
content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
|
||||
}
|
||||
|
||||
element.innerHTML = content;
|
||||
@@ -6374,7 +6354,7 @@
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
};
|
||||
|
||||
_proto._addAttachmentClass = function _addAttachmentClass(attachment) {
|
||||
@@ -6388,7 +6368,7 @@
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@@ -6444,7 +6424,7 @@
|
||||
EventHandler.on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _objectSpread2(_objectSpread2({}, this.config), {}, {
|
||||
this.config = _extends({}, this.config, {
|
||||
trigger: 'manual',
|
||||
selector: ''
|
||||
});
|
||||
@@ -6464,11 +6444,11 @@
|
||||
|
||||
_proto._enter = function _enter(event, context) {
|
||||
var dataKey = this.constructor.DATA_KEY;
|
||||
context = context || Data.getData(event.target, dataKey);
|
||||
context = context || Data.getData(event.delegateTarget, dataKey);
|
||||
|
||||
if (!context) {
|
||||
context = new this.constructor(event.target, this._getDelegateConfig());
|
||||
Data.setData(event.target, dataKey, context);
|
||||
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
||||
Data.setData(event.delegateTarget, dataKey, context);
|
||||
}
|
||||
|
||||
if (event) {
|
||||
@@ -6497,11 +6477,11 @@
|
||||
|
||||
_proto._leave = function _leave(event, context) {
|
||||
var dataKey = this.constructor.DATA_KEY;
|
||||
context = context || Data.getData(event.target, dataKey);
|
||||
context = context || Data.getData(event.delegateTarget, dataKey);
|
||||
|
||||
if (!context) {
|
||||
context = new this.constructor(event.target, this._getDelegateConfig());
|
||||
Data.setData(event.target, dataKey, context);
|
||||
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
||||
Data.setData(event.delegateTarget, dataKey, context);
|
||||
}
|
||||
|
||||
if (event) {
|
||||
@@ -6549,7 +6529,7 @@
|
||||
config.container = config.container[0];
|
||||
}
|
||||
|
||||
config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), dataAttributes), typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (typeof config.delay === 'number') {
|
||||
config.delay = {
|
||||
@@ -6569,7 +6549,7 @@
|
||||
typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
|
||||
|
||||
if (config.sanitize) {
|
||||
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
|
||||
config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
|
||||
}
|
||||
|
||||
return config;
|
||||
@@ -6603,8 +6583,7 @@
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
var popperInstance = popperData.instance;
|
||||
this.tip = popperInstance.popper;
|
||||
this.tip = popperData.instance.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
@@ -6729,14 +6708,14 @@
|
||||
var CLASS_PREFIX$1 = 'bs-popover';
|
||||
var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
|
||||
|
||||
var Default$5 = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, {
|
||||
var Default$5 = _extends({}, Tooltip.Default, {
|
||||
placement: 'right',
|
||||
trigger: 'click',
|
||||
content: '',
|
||||
template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
|
||||
});
|
||||
|
||||
var DefaultType$5 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, {
|
||||
var DefaultType$5 = _extends({}, Tooltip.DefaultType, {
|
||||
content: '(string|element|function)'
|
||||
});
|
||||
|
||||
@@ -6789,12 +6768,12 @@
|
||||
|
||||
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
||||
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$4);
|
||||
};
|
||||
} // Private
|
||||
;
|
||||
|
||||
_proto._addAttachmentClass = function _addAttachmentClass(attachment) {
|
||||
this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
|
||||
} // Private
|
||||
;
|
||||
};
|
||||
|
||||
_proto._getContent = function _getContent() {
|
||||
return this.element.getAttribute('data-content') || this.config.content;
|
||||
@@ -6952,7 +6931,7 @@
|
||||
this._element = element;
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
this._config = this._getConfig(config);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + ", " + this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
@@ -6982,12 +6961,8 @@
|
||||
this._scrollHeight = this._getScrollHeight();
|
||||
var targets = SelectorEngine.find(this._selector);
|
||||
targets.map(function (element) {
|
||||
var target;
|
||||
var targetSelector = getSelectorFromElement(element);
|
||||
|
||||
if (targetSelector) {
|
||||
target = SelectorEngine.findOne(targetSelector);
|
||||
}
|
||||
var target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
|
||||
|
||||
if (target) {
|
||||
var targetBCR = target.getBoundingClientRect();
|
||||
@@ -7024,7 +6999,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default$6), typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, Default$6, typeof config === 'object' && config ? config : {});
|
||||
|
||||
if (typeof config.target !== 'string' && isElement(config.target)) {
|
||||
var id = config.target.id;
|
||||
@@ -7461,7 +7436,7 @@
|
||||
var Default$7 = {
|
||||
animation: true,
|
||||
autohide: true,
|
||||
delay: 500
|
||||
delay: 5000
|
||||
};
|
||||
var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
|
||||
/**
|
||||
@@ -7494,6 +7469,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._config.animation) {
|
||||
this._element.classList.add(CLASS_NAME_FADE$4);
|
||||
}
|
||||
@@ -7558,8 +7535,7 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._element.classList.contains(CLASS_NAME_SHOW$6)) {
|
||||
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
||||
@@ -7573,7 +7549,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$7), Manipulator.getDataAttributes(this._element)), typeof config === 'object' && config ? config : {});
|
||||
config = _extends({}, Default$7, Manipulator.getDataAttributes(this._element), typeof config === 'object' && config ? config : {});
|
||||
typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
|
||||
return config;
|
||||
};
|
||||
@@ -7584,6 +7560,11 @@
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
|
||||
return _this3.hide();
|
||||
});
|
||||
};
|
||||
|
||||
_proto._clearTimeout = function _clearTimeout() {
|
||||
clearTimeout(this._timeout);
|
||||
this._timeout = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
|
Reference in New Issue
Block a user