aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/dist/tooltip.js
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twbs/bootstrap/js/dist/tooltip.js')
-rw-r--r--vendor/twbs/bootstrap/js/dist/tooltip.js118
1 files changed, 53 insertions, 65 deletions
diff --git a/vendor/twbs/bootstrap/js/dist/tooltip.js b/vendor/twbs/bootstrap/js/dist/tooltip.js
index 5608e9531..84d0b0502 100644
--- a/vendor/twbs/bootstrap/js/dist/tooltip.js
+++ b/vendor/twbs/bootstrap/js/dist/tooltip.js
@@ -1,6 +1,6 @@
/*!
- * Bootstrap tooltip.js v4.4.1 (https://getbootstrap.com/)
- * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
+ * Bootstrap tooltip.js v4.5.0 (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/master/LICENSE)
*/
(function (global, factory) {
@@ -9,9 +9,9 @@
(global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
}(this, (function ($, Popper, Util) { 'use strict';
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
- Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
- Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
+ $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
+ Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
+ Util = Util && Object.prototype.hasOwnProperty.call(Util, 'default') ? Util['default'] : Util;
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
@@ -80,7 +80,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.4.1): tools/sanitizer.js
+ * Bootstrap (v4.5.0): tools/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -105,7 +105,7 @@
h5: [],
h6: [],
i: [],
- img: ['src', 'alt', 'title', 'width', 'height'],
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
li: [],
ol: [],
p: [],
@@ -125,14 +125,14 @@
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
*/
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
+ var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
/**
* 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
*/
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
+ var 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;
function allowedAttribute(attr, allowedAttributeList) {
var attrName = attr.nodeName.toLowerCase();
@@ -149,7 +149,7 @@
return attrRegex instanceof RegExp;
}); // Check if a regular expression validates the attribute.
- for (var i = 0, l = regExp.length; i < l; i++) {
+ for (var i = 0, len = regExp.length; i < len; i++) {
if (attrName.match(regExp[i])) {
return true;
}
@@ -206,7 +206,7 @@
*/
var NAME = 'tooltip';
- var VERSION = '4.4.1';
+ var VERSION = '4.5.0';
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = "." + DATA_KEY;
var JQUERY_NO_CONFLICT = $.fn[NAME];
@@ -256,10 +256,8 @@
whiteList: DefaultWhitelist,
popperConfig: null
};
- var HoverState = {
- SHOW: 'show',
- OUT: 'out'
- };
+ var HOVER_STATE_SHOW = 'show';
+ var HOVER_STATE_OUT = 'out';
var Event = {
HIDE: "hide" + EVENT_KEY,
HIDDEN: "hidden" + EVENT_KEY,
@@ -272,30 +270,21 @@
MOUSEENTER: "mouseenter" + EVENT_KEY,
MOUSELEAVE: "mouseleave" + EVENT_KEY
};
- var ClassName = {
- FADE: 'fade',
- SHOW: 'show'
- };
- var Selector = {
- TOOLTIP: '.tooltip',
- TOOLTIP_INNER: '.tooltip-inner',
- ARROW: '.arrow'
- };
- var Trigger = {
- HOVER: 'hover',
- FOCUS: 'focus',
- CLICK: 'click',
- MANUAL: 'manual'
- };
+ var CLASS_NAME_FADE = 'fade';
+ var CLASS_NAME_SHOW = 'show';
+ var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
+ var SELECTOR_ARROW = '.arrow';
+ var TRIGGER_HOVER = 'hover';
+ var TRIGGER_FOCUS = 'focus';
+ var TRIGGER_CLICK = 'click';
+ var TRIGGER_MANUAL = 'manual';
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
- var Tooltip =
- /*#__PURE__*/
- function () {
+ var Tooltip = /*#__PURE__*/function () {
function Tooltip(element, config) {
if (typeof Popper === 'undefined') {
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
@@ -353,7 +342,7 @@
context._leave(null, context);
}
} else {
- if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
+ if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
this._leave(null, this);
return;
@@ -413,7 +402,7 @@
this.setContent();
if (this.config.animation) {
- $(tip).addClass(ClassName.FADE);
+ $(tip).addClass(CLASS_NAME_FADE);
}
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
@@ -432,7 +421,7 @@
$(this.element).trigger(this.constructor.Event.INSERTED);
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
- $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
+ $(tip).addClass(CLASS_NAME_SHOW); // 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
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
@@ -450,12 +439,12 @@
_this._hoverState = null;
$(_this.element).trigger(_this.constructor.Event.SHOWN);
- if (prevHoverState === HoverState.OUT) {
+ if (prevHoverState === HOVER_STATE_OUT) {
_this._leave(null, _this);
}
};
- if ($(this.tip).hasClass(ClassName.FADE)) {
+ if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
@@ -471,7 +460,7 @@
var hideEvent = $.Event(this.constructor.Event.HIDE);
var complete = function complete() {
- if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
+ if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
tip.parentNode.removeChild(tip);
}
@@ -496,18 +485,18 @@
return;
}
- $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
+ $(tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
$(document.body).children().off('mouseover', null, $.noop);
}
- this._activeTrigger[Trigger.CLICK] = false;
- this._activeTrigger[Trigger.FOCUS] = false;
- this._activeTrigger[Trigger.HOVER] = false;
+ this._activeTrigger[TRIGGER_CLICK] = false;
+ this._activeTrigger[TRIGGER_FOCUS] = false;
+ this._activeTrigger[TRIGGER_HOVER] = false;
- if ($(this.tip).hasClass(ClassName.FADE)) {
+ if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
var transitionDuration = Util.getTransitionDurationFromElement(tip);
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
@@ -539,8 +528,8 @@
_proto.setContent = function setContent() {
var tip = this.getTipElement();
- this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
- $(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
+ this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
+ $(tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
};
_proto.setElementContent = function setElementContent($element, content) {
@@ -590,7 +579,7 @@
behavior: this.config.fallbackPlacement
},
arrow: {
- element: Selector.ARROW
+ element: SELECTOR_ARROW
},
preventOverflow: {
boundariesElement: this.config.boundary
@@ -605,7 +594,7 @@
return _this3._handlePopperPlacementChange(data);
}
};
- return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
+ return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
};
_proto._getOffset = function _getOffset() {
@@ -615,7 +604,7 @@
if (typeof this.config.offset === 'function') {
offset.fn = function (data) {
- data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
+ data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {});
return data;
};
} else {
@@ -650,9 +639,9 @@
$(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
return _this5.toggle(event);
});
- } else if (trigger !== Trigger.MANUAL) {
- var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
- var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
+ } else if (trigger !== TRIGGER_MANUAL) {
+ var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
+ var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
$(_this5.element).on(eventIn, _this5.config.selector, function (event) {
return _this5._enter(event);
}).on(eventOut, _this5.config.selector, function (event) {
@@ -670,7 +659,7 @@
$(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
if (this.config.selector) {
- this.config = _objectSpread2({}, this.config, {
+ this.config = _objectSpread2(_objectSpread2({}, this.config), {}, {
trigger: 'manual',
selector: ''
});
@@ -698,16 +687,16 @@
}
if (event) {
- context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
}
- if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
- context._hoverState = HoverState.SHOW;
+ if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
+ context._hoverState = HOVER_STATE_SHOW;
return;
}
clearTimeout(context._timeout);
- context._hoverState = HoverState.SHOW;
+ context._hoverState = HOVER_STATE_SHOW;
if (!context.config.delay || !context.config.delay.show) {
context.show();
@@ -715,7 +704,7 @@
}
context._timeout = setTimeout(function () {
- if (context._hoverState === HoverState.SHOW) {
+ if (context._hoverState === HOVER_STATE_SHOW) {
context.show();
}
}, context.config.delay.show);
@@ -731,7 +720,7 @@
}
if (event) {
- context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
}
if (context._isWithActiveTrigger()) {
@@ -739,7 +728,7 @@
}
clearTimeout(context._timeout);
- context._hoverState = HoverState.OUT;
+ context._hoverState = HOVER_STATE_OUT;
if (!context.config.delay || !context.config.delay.hide) {
context.hide();
@@ -747,7 +736,7 @@
}
context._timeout = setTimeout(function () {
- if (context._hoverState === HoverState.OUT) {
+ if (context._hoverState === HOVER_STATE_OUT) {
context.hide();
}
}, context.config.delay.hide);
@@ -770,7 +759,7 @@
delete dataAttributes[dataAttr];
}
});
- config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
+ config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), dataAttributes), typeof config === 'object' && config ? config : {});
if (typeof config.delay === 'number') {
config.delay = {
@@ -820,8 +809,7 @@
};
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
- var popperInstance = popperData.instance;
- this.tip = popperInstance.popper;
+ this.tip = popperData.instance.popper;
this._cleanTipClass();
@@ -836,7 +824,7 @@
return;
}
- $(tip).removeClass(ClassName.FADE);
+ $(tip).removeClass(CLASS_NAME_FADE);
this.config.animation = false;
this.hide();
this.show();