mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 20:31:26 +02:00
Dist (#31644)
This commit is contained in:
@@ -6,10 +6,12 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('popper.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['popper.js'], factory) :
|
||||
(global = global || self, global.bootstrap = factory(global.Popper));
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper));
|
||||
}(this, (function (Popper) { 'use strict';
|
||||
|
||||
Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@@ -27,53 +29,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) {
|
||||
@@ -274,22 +245,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];
|
||||
@@ -298,15 +269,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;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -439,6 +410,8 @@
|
||||
|
||||
function bootstrapHandler(element, fn) {
|
||||
return function handler(event) {
|
||||
event.delegateTarget = element;
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn);
|
||||
}
|
||||
@@ -454,6 +427,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);
|
||||
}
|
||||
@@ -638,7 +613,7 @@
|
||||
bubbles: bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
} // merge custom informations in our event
|
||||
} // merge custom information in our event
|
||||
|
||||
|
||||
if (typeof args !== 'undefined') {
|
||||
@@ -713,11 +688,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);
|
||||
|
||||
@@ -986,7 +957,7 @@
|
||||
return {};
|
||||
}
|
||||
|
||||
var attributes = _objectSpread2({}, element.dataset);
|
||||
var attributes = _extends({}, element.dataset);
|
||||
|
||||
Object.keys(attributes).forEach(function (key) {
|
||||
attributes[key] = normalizeData(attributes[key]);
|
||||
@@ -1299,7 +1270,7 @@
|
||||
;
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
config = _objectSpread2(_objectSpread2({}, Default), config);
|
||||
config = _extends({}, Default, config);
|
||||
typeCheckConfig(NAME$2, config, DefaultType);
|
||||
return config;
|
||||
};
|
||||
@@ -1593,10 +1564,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;
|
||||
@@ -1632,7 +1603,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');
|
||||
|
||||
@@ -1949,7 +1920,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);
|
||||
@@ -1957,9 +1928,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() {
|
||||
@@ -1986,28 +1955,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;
|
||||
@@ -2224,7 +2192,7 @@
|
||||
|
||||
|
||||
if (!this._inNavbar) {
|
||||
if (typeof Popper === 'undefined') {
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org)');
|
||||
}
|
||||
|
||||
@@ -2247,7 +2215,7 @@
|
||||
parent.classList.add(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
|
||||
this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
@@ -2329,7 +2297,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;
|
||||
};
|
||||
@@ -2370,7 +2338,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 {
|
||||
@@ -2400,7 +2368,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig);
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
} // Static
|
||||
;
|
||||
|
||||
@@ -2811,7 +2779,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;
|
||||
};
|
||||
@@ -3017,11 +2985,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);
|
||||
|
||||
@@ -3132,7 +3114,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);
|
||||
@@ -3199,7 +3181,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);
|
||||
}
|
||||
@@ -3274,7 +3256,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'],
|
||||
@@ -3307,7 +3289,7 @@
|
||||
u: [],
|
||||
ul: []
|
||||
};
|
||||
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
|
||||
var _ref;
|
||||
|
||||
if (!unsafeHtml.length) {
|
||||
@@ -3320,7 +3302,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('*'));
|
||||
|
||||
@@ -3330,16 +3312,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);
|
||||
}
|
||||
});
|
||||
@@ -3366,7 +3348,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',
|
||||
@@ -3382,7 +3364,7 @@
|
||||
boundary: '(string|element)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
whiteList: 'object',
|
||||
allowList: 'object',
|
||||
popperConfig: '(null|object)'
|
||||
};
|
||||
var AttachmentMap = {
|
||||
@@ -3407,7 +3389,7 @@
|
||||
boundary: 'scrollParent',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
whiteList: DefaultWhitelist,
|
||||
allowList: DefaultAllowlist,
|
||||
popperConfig: null
|
||||
};
|
||||
var Event$1 = {
|
||||
@@ -3440,7 +3422,7 @@
|
||||
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
function Tooltip(element, config) {
|
||||
if (typeof Popper === 'undefined') {
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
|
||||
} // private
|
||||
|
||||
@@ -3483,11 +3465,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;
|
||||
@@ -3574,7 +3556,7 @@
|
||||
}
|
||||
|
||||
EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
|
||||
this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
@@ -3716,7 +3698,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;
|
||||
@@ -3762,7 +3744,7 @@
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
};
|
||||
|
||||
_proto._addAttachmentClass = function _addAttachmentClass(attachment) {
|
||||
@@ -3776,7 +3758,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 {
|
||||
@@ -3832,7 +3814,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: ''
|
||||
});
|
||||
@@ -3852,11 +3834,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) {
|
||||
@@ -3885,11 +3867,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) {
|
||||
@@ -3937,7 +3919,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 = {
|
||||
@@ -3957,7 +3939,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;
|
||||
@@ -3991,8 +3973,7 @@
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
var popperInstance = popperData.instance;
|
||||
this.tip = popperInstance.popper;
|
||||
this.tip = popperData.instance.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
@@ -4117,14 +4098,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)'
|
||||
});
|
||||
|
||||
@@ -4177,12 +4158,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;
|
||||
@@ -4340,7 +4321,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;
|
||||
@@ -4370,12 +4351,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();
|
||||
@@ -4412,7 +4389,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;
|
||||
@@ -4849,7 +4826,7 @@
|
||||
var Default$7 = {
|
||||
animation: true,
|
||||
autohide: true,
|
||||
delay: 500
|
||||
delay: 5000
|
||||
};
|
||||
var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
|
||||
/**
|
||||
@@ -4882,6 +4859,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
this._clearTimeout();
|
||||
|
||||
if (this._config.animation) {
|
||||
this._element.classList.add(CLASS_NAME_FADE$4);
|
||||
}
|
||||
@@ -4946,8 +4925,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);
|
||||
@@ -4961,7 +4939,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;
|
||||
};
|
||||
@@ -4972,6 +4950,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