Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2021-01-26 16:07:14 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2021-01-26 16:07:15 +0300
commite9e5b38bbb88b7b28b902b172ed8c6382478ebd2 (patch)
treec10085b817f310a5cb23210d26cdc414cb66789f /assets/javascripts/bootstrap/tooltip.js
parentca9e27946b00f0600ed3ca346e09ca0bb7e12899 (diff)
Update to 4.6.0v4.6.0
1. rake 'update[v4.6.0]' 2. Bump version in lib/boostrap/version.rb and README.md
Diffstat (limited to 'assets/javascripts/bootstrap/tooltip.js')
-rw-r--r--assets/javascripts/bootstrap/tooltip.js187
1 files changed, 111 insertions, 76 deletions
diff --git a/assets/javascripts/bootstrap/tooltip.js b/assets/javascripts/bootstrap/tooltip.js
index f1e7779..085b14a 100644
--- a/assets/javascripts/bootstrap/tooltip.js
+++ b/assets/javascripts/bootstrap/tooltip.js
@@ -1,21 +1,57 @@
/*!
- * Bootstrap tooltip.js v4.5.2 (https://getbootstrap.com/)
- * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
+ * Bootstrap tooltip.js v4.6.0 (https://getbootstrap.com/)
+ * Copyright 2011-2021 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' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
- typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
+ typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
}(this, (function ($, Popper, Util) { 'use strict';
- $ = $ && 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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
+ var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
+ var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
+
+ function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.5.2): tools/sanitizer.js
+ * Bootstrap (v4.6.0): tools/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -134,11 +170,6 @@
return createdDocument.body.innerHTML;
}
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
/**
* ------------------------------------------------------------------------
* Constants
@@ -146,10 +177,10 @@
*/
var NAME = 'tooltip';
- var VERSION = '4.5.2';
+ var VERSION = '4.6.0';
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = "." + DATA_KEY;
- var JQUERY_NO_CONFLICT = $.fn[NAME];
+ var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
@@ -166,6 +197,7 @@
container: '(string|element|boolean)',
fallbackPlacement: '(string|array)',
boundary: '(string|element)',
+ customClass: '(string|function)',
sanitize: 'boolean',
sanitizeFn: '(null|function)',
whiteList: 'object',
@@ -191,6 +223,7 @@
container: false,
fallbackPlacement: 'flip',
boundary: 'scrollParent',
+ customClass: '',
sanitize: true,
sanitizeFn: null,
whiteList: DefaultWhitelist,
@@ -226,8 +259,8 @@
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/)');
+ if (typeof Popper__default['default'] === 'undefined') {
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
} // private
@@ -267,11 +300,11 @@
if (event) {
var dataKey = this.constructor.DATA_KEY;
- var context = $(event.currentTarget).data(dataKey);
+ var context = $__default['default'](event.currentTarget).data(dataKey);
if (!context) {
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $(event.currentTarget).data(dataKey, context);
+ $__default['default'](event.currentTarget).data(dataKey, context);
}
context._activeTrigger.click = !context._activeTrigger.click;
@@ -282,7 +315,7 @@
context._leave(null, context);
}
} else {
- if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
+ if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
this._leave(null, this);
return;
@@ -294,12 +327,12 @@
_proto.dispose = function dispose() {
clearTimeout(this._timeout);
- $.removeData(this.element, this.constructor.DATA_KEY);
- $(this.element).off(this.constructor.EVENT_KEY);
- $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
+ $__default['default'].removeData(this.element, this.constructor.DATA_KEY);
+ $__default['default'](this.element).off(this.constructor.EVENT_KEY);
+ $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
if (this.tip) {
- $(this.tip).remove();
+ $__default['default'](this.tip).remove();
}
this._isEnabled = null;
@@ -320,29 +353,29 @@
_proto.show = function show() {
var _this = this;
- if ($(this.element).css('display') === 'none') {
+ if ($__default['default'](this.element).css('display') === 'none') {
throw new Error('Please use show on visible elements');
}
- var showEvent = $.Event(this.constructor.Event.SHOW);
+ var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);
if (this.isWithContent() && this._isEnabled) {
- $(this.element).trigger(showEvent);
- var shadowRoot = Util.findShadowRoot(this.element);
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
+ $__default['default'](this.element).trigger(showEvent);
+ var shadowRoot = Util__default['default'].findShadowRoot(this.element);
+ var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
if (showEvent.isDefaultPrevented() || !isInTheDom) {
return;
}
var tip = this.getTipElement();
- var tipId = Util.getUID(this.constructor.NAME);
+ var tipId = Util__default['default'].getUID(this.constructor.NAME);
tip.setAttribute('id', tipId);
this.element.setAttribute('aria-describedby', tipId);
this.setContent();
if (this.config.animation) {
- $(tip).addClass(CLASS_NAME_FADE);
+ $__default['default'](tip).addClass(CLASS_NAME_FADE);
}
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
@@ -353,21 +386,22 @@
var container = this._getContainer();
- $(tip).data(this.constructor.DATA_KEY, this);
+ $__default['default'](tip).data(this.constructor.DATA_KEY, this);
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
- $(tip).appendTo(container);
+ if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {
+ $__default['default'](tip).appendTo(container);
}
- $(this.element).trigger(this.constructor.Event.INSERTED);
- this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
- $(tip).addClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
+ $__default['default'](this.element).trigger(this.constructor.Event.INSERTED);
+ this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
+ $__default['default'](tip).addClass(CLASS_NAME_SHOW);
+ $__default['default'](tip).addClass(this.config.customClass); // 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
if ('ontouchstart' in document.documentElement) {
- $(document.body).children().on('mouseover', null, $.noop);
+ $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
}
var complete = function complete() {
@@ -377,16 +411,16 @@
var prevHoverState = _this._hoverState;
_this._hoverState = null;
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
+ $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);
if (prevHoverState === HOVER_STATE_OUT) {
_this._leave(null, _this);
}
};
- if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
+ if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
+ var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this.tip);
+ $__default['default'](this.tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@@ -397,7 +431,7 @@
var _this2 = this;
var tip = this.getTipElement();
- var hideEvent = $.Event(this.constructor.Event.HIDE);
+ var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);
var complete = function complete() {
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
@@ -408,7 +442,7 @@
_this2.element.removeAttribute('aria-describedby');
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
+ $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
if (_this2._popper !== null) {
_this2._popper.destroy();
@@ -419,26 +453,26 @@
}
};
- $(this.element).trigger(hideEvent);
+ $__default['default'](this.element).trigger(hideEvent);
if (hideEvent.isDefaultPrevented()) {
return;
}
- $(tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
+ $__default['default'](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);
+ $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
}
this._activeTrigger[TRIGGER_CLICK] = false;
this._activeTrigger[TRIGGER_FOCUS] = false;
this._activeTrigger[TRIGGER_HOVER] = false;
- if ($(this.tip).hasClass(CLASS_NAME_FADE)) {
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
+ if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
+ var transitionDuration = Util__default['default'].getTransitionDurationFromElement(tip);
+ $__default['default'](tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@@ -458,29 +492,29 @@
};
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
+ $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
};
_proto.getTipElement = function getTipElement() {
- this.tip = this.tip || $(this.config.template)[0];
+ this.tip = this.tip || $__default['default'](this.config.template)[0];
return this.tip;
};
_proto.setContent = function setContent() {
var tip = this.getTipElement();
- this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
- $(tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
+ this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
+ $__default['default'](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
};
_proto.setElementContent = function setElementContent($element, content) {
if (typeof content === 'object' && (content.nodeType || content.jquery)) {
// Content is a DOM node or a jQuery
if (this.config.html) {
- if (!$(content).parent().is($element)) {
+ if (!$__default['default'](content).parent().is($element)) {
$element.empty().append(content);
}
} else {
- $element.text($(content).text());
+ $element.text($__default['default'](content).text());
}
return;
@@ -559,11 +593,11 @@
return document.body;
}
- if (Util.isElement(this.config.container)) {
- return $(this.config.container);
+ if (Util__default['default'].isElement(this.config.container)) {
+ return $__default['default'](this.config.container);
}
- return $(document).find(this.config.container);
+ return $__default['default'](document).find(this.config.container);
};
_proto._getAttachment = function _getAttachment(placement) {
@@ -576,13 +610,13 @@
var triggers = this.config.trigger.split(' ');
triggers.forEach(function (trigger) {
if (trigger === 'click') {
- $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
+ $__default['default'](_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;
- $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
+ $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {
return _this5._enter(event);
}).on(eventOut, _this5.config.selector, function (event) {
return _this5._leave(event);
@@ -596,7 +630,7 @@
}
};
- $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
+ $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
if (this.config.selector) {
this.config = _extends({}, this.config, {
@@ -619,18 +653,18 @@
_proto._enter = function _enter(event, context) {
var dataKey = this.constructor.DATA_KEY;
- context = context || $(event.currentTarget).data(dataKey);
+ context = context || $__default['default'](event.currentTarget).data(dataKey);
if (!context) {
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $(event.currentTarget).data(dataKey, context);
+ $__default['default'](event.currentTarget).data(dataKey, context);
}
if (event) {
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
}
- if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
+ if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
context._hoverState = HOVER_STATE_SHOW;
return;
}
@@ -652,11 +686,11 @@
_proto._leave = function _leave(event, context) {
var dataKey = this.constructor.DATA_KEY;
- context = context || $(event.currentTarget).data(dataKey);
+ context = context || $__default['default'](event.currentTarget).data(dataKey);
if (!context) {
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $(event.currentTarget).data(dataKey, context);
+ $__default['default'](event.currentTarget).data(dataKey, context);
}
if (event) {
@@ -693,7 +727,7 @@
};
_proto._getConfig = function _getConfig(config) {
- var dataAttributes = $(this.element).data();
+ var dataAttributes = $__default['default'](this.element).data();
Object.keys(dataAttributes).forEach(function (dataAttr) {
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
delete dataAttributes[dataAttr];
@@ -716,7 +750,7 @@
config.content = config.content.toString();
}
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
+ Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
if (config.sanitize) {
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
@@ -740,7 +774,7 @@
};
_proto._cleanTipClass = function _cleanTipClass() {
- var $tip = $(this.getTipElement());
+ var $tip = $__default['default'](this.getTipElement());
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
if (tabClass !== null && tabClass.length) {
@@ -764,7 +798,7 @@
return;
}
- $(tip).removeClass(CLASS_NAME_FADE);
+ $__default['default'](tip).removeClass(CLASS_NAME_FADE);
this.config.animation = false;
this.hide();
this.show();
@@ -774,7 +808,8 @@
Tooltip._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
- var data = $(this).data(DATA_KEY);
+ var $element = $__default['default'](this);
+ var data = $element.data(DATA_KEY);
var _config = typeof config === 'object' && config;
@@ -784,7 +819,7 @@
if (!data) {
data = new Tooltip(this, _config);
- $(this).data(DATA_KEY, data);
+ $element.data(DATA_KEY, data);
}
if (typeof config === 'string') {
@@ -843,11 +878,11 @@
*/
- $.fn[NAME] = Tooltip._jQueryInterface;
- $.fn[NAME].Constructor = Tooltip;
+ $__default['default'].fn[NAME] = Tooltip._jQueryInterface;
+ $__default['default'].fn[NAME].Constructor = Tooltip;
- $.fn[NAME].noConflict = function () {
- $.fn[NAME] = JQUERY_NO_CONFLICT;
+ $__default['default'].fn[NAME].noConflict = function () {
+ $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
return Tooltip._jQueryInterface;
};