0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00
Bootstrap/js/dist/tooltip.js

547 lines
18 KiB
JavaScript
Raw Normal View History

2018-11-13 07:41:12 +01:00
/*!
* Bootstrap tooltip.js v5.3.2 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2020-06-16 20:50:01 +02:00
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2018-11-13 07:41:12 +01:00
*/
2018-07-24 02:51:14 +02:00
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./base-component.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./util/index.js'), require('./util/sanitizer.js'), require('./util/template-factory.js')) :
typeof define === 'function' && define.amd ? define(['@popperjs/core', './base-component', './dom/event-handler', './dom/manipulator', './util/index', './util/sanitizer', './util/template-factory'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global["@popperjs/core"], global.BaseComponent, global.EventHandler, global.Manipulator, global.Index, global.Sanitizer, global.TemplateFactory));
})(this, (function (Popper, BaseComponent, EventHandler, Manipulator, index_js, sanitizer_js, TemplateFactory) { 'use strict';
2019-03-01 17:31:34 +01:00
function _interopNamespaceDefault(e) {
2022-05-13 08:07:23 +02:00
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
2020-12-07 16:50:24 +01:00
if (e) {
2021-10-05 17:50:18 +02:00
for (const k in e) {
2020-12-07 16:50:24 +01:00
if (k !== 'default') {
2021-10-05 17:50:18 +02:00
const d = Object.getOwnPropertyDescriptor(e, k);
2020-12-07 16:50:24 +01:00
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
2021-10-05 17:50:18 +02:00
get: () => e[k]
2020-12-07 16:50:24 +01:00
});
}
2021-10-05 17:50:18 +02:00
}
2020-12-07 16:50:24 +01:00
}
2021-10-05 17:50:18 +02:00
n.default = e;
2020-12-07 16:50:24 +01:00
return Object.freeze(n);
}
const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper);
2019-02-13 17:01:40 +01:00
/**
* --------------------------------------------------------------------------
* Bootstrap tooltip.js
2020-06-16 20:50:01 +02:00
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2019-03-01 17:31:34 +01:00
* --------------------------------------------------------------------------
*/
2019-03-01 17:31:34 +01:00
/**
2020-12-03 15:18:59 +01:00
* Constants
*/
2021-03-23 17:26:54 +01:00
const NAME = 'tooltip';
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
2022-05-13 08:07:23 +02:00
const CLASS_NAME_FADE = 'fade';
const CLASS_NAME_MODAL = 'modal';
const CLASS_NAME_SHOW = 'show';
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
const EVENT_MODAL_HIDE = 'hide.bs.modal';
const TRIGGER_HOVER = 'hover';
const TRIGGER_FOCUS = 'focus';
const TRIGGER_CLICK = 'click';
const TRIGGER_MANUAL = 'manual';
const EVENT_HIDE = 'hide';
const EVENT_HIDDEN = 'hidden';
const EVENT_SHOW = 'show';
const EVENT_SHOWN = 'shown';
const EVENT_INSERTED = 'inserted';
const EVENT_CLICK = 'click';
const EVENT_FOCUSIN = 'focusin';
const EVENT_FOCUSOUT = 'focusout';
const EVENT_MOUSEENTER = 'mouseenter';
const EVENT_MOUSELEAVE = 'mouseleave';
2021-03-23 17:26:54 +01:00
const AttachmentMap = {
2018-11-13 07:41:12 +01:00
AUTO: 'auto',
TOP: 'top',
RIGHT: index_js.isRTL() ? 'left' : 'right',
2018-11-13 07:41:12 +01:00
BOTTOM: 'bottom',
LEFT: index_js.isRTL() ? 'right' : 'left'
2018-11-13 07:41:12 +01:00
};
2021-03-23 17:26:54 +01:00
const Default = {
allowList: sanitizer_js.DefaultAllowlist,
2018-11-13 07:41:12 +01:00
animation: true,
boundary: 'clippingParents',
container: false,
customClass: '',
2018-11-13 07:41:12 +01:00
delay: 0,
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
2018-11-13 07:41:12 +01:00
html: false,
offset: [0, 6],
placement: 'top',
popperConfig: null,
2019-02-13 17:01:40 +01:00
sanitize: true,
sanitizeFn: null,
selector: false,
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
title: '',
trigger: 'hover focus'
2018-11-13 07:41:12 +01:00
};
2022-05-13 08:07:23 +02:00
const DefaultType = {
allowList: 'object',
2022-05-13 08:07:23 +02:00
animation: 'boolean',
boundary: '(string|element)',
container: '(string|element|boolean)',
customClass: '(string|function)',
2022-05-13 08:07:23 +02:00
delay: '(number|object)',
fallbackPlacements: 'array',
2022-05-13 08:07:23 +02:00
html: 'boolean',
offset: '(array|string|function)',
placement: '(string|function)',
popperConfig: '(null|object|function)',
2022-05-13 08:07:23 +02:00
sanitize: 'boolean',
sanitizeFn: '(null|function)',
selector: '(string|boolean)',
template: 'string',
title: '(string|element|function)',
trigger: 'string'
2018-11-13 07:41:12 +01:00
};
2019-10-08 08:39:10 +02:00
/**
2022-05-13 08:07:23 +02:00
* Class definition
2019-10-08 08:39:10 +02:00
*/
2018-11-13 07:41:12 +01:00
class Tooltip extends BaseComponent {
2021-03-23 17:26:54 +01:00
constructor(element, config) {
2020-12-07 16:50:24 +01:00
if (typeof Popper__namespace === 'undefined') {
2020-11-23 14:17:16 +01:00
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
2020-12-03 15:18:59 +01:00
}
super(element, config);
2017-10-30 00:19:14 +01:00
// Private
2021-03-23 17:26:54 +01:00
this._isEnabled = true;
this._timeout = 0;
this._isHovered = null;
2021-03-23 17:26:54 +01:00
this._activeTrigger = {};
2022-05-13 08:07:23 +02:00
this._popper = null;
this._templateFactory = null;
this._newContent = null;
// Protected
2021-03-23 17:26:54 +01:00
this.tip = null;
this._setListeners();
if (!this._config.selector) {
this._fixTitle();
}
}
2015-08-13 06:12:03 +02:00
// Getters
2021-03-23 17:26:54 +01:00
static get Default() {
return Default;
}
static get DefaultType() {
return DefaultType;
2022-05-13 08:07:23 +02:00
}
static get NAME() {
return NAME;
}
2021-03-23 17:26:54 +01:00
// Public
2021-03-23 17:26:54 +01:00
enable() {
2018-11-13 07:41:12 +01:00
this._isEnabled = true;
2021-03-23 17:26:54 +01:00
}
disable() {
2018-11-13 07:41:12 +01:00
this._isEnabled = false;
2021-03-23 17:26:54 +01:00
}
toggleEnabled() {
2018-11-13 07:41:12 +01:00
this._isEnabled = !this._isEnabled;
2021-03-23 17:26:54 +01:00
}
toggle() {
2018-11-13 07:41:12 +01:00
if (!this._isEnabled) {
return;
}
this._activeTrigger.click = !this._activeTrigger.click;
2022-05-13 08:07:23 +02:00
if (this._isShown()) {
this._leave();
return;
2018-11-13 07:41:12 +01:00
}
2022-05-13 08:07:23 +02:00
this._enter();
2021-03-23 17:26:54 +01:00
}
dispose() {
2018-11-13 07:41:12 +01:00
clearTimeout(this._timeout);
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
if (this._element.getAttribute('data-bs-original-title')) {
this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));
}
this._disposePopper();
2021-03-23 17:26:54 +01:00
super.dispose();
}
show() {
2020-12-03 15:18:59 +01:00
if (this._element.style.display === 'none') {
2018-11-13 07:41:12 +01:00
throw new Error('Please use show on visible elements');
}
2022-05-13 08:07:23 +02:00
if (!(this._isWithContent() && this._isEnabled)) {
return;
}
const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW));
const shadowRoot = index_js.findShadowRoot(this._element);
2022-05-13 08:07:23 +02:00
const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);
if (showEvent.defaultPrevented || !isInTheDom) {
return;
}
// TODO: v6 remove this or make it optional
2022-11-21 19:19:01 +01:00
this._disposePopper();
2022-05-13 08:07:23 +02:00
const tip = this._getTipElement();
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
const {
container
} = this._config;
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
2021-08-04 17:41:51 +02:00
container.append(tip);
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));
2021-03-23 17:26:54 +01:00
}
2022-11-21 19:19:01 +01:00
this._popper = this._createPopper(tip);
tip.classList.add(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
if ('ontouchstart' in document.documentElement) {
2022-05-13 08:07:23 +02:00
for (const element of [].concat(...document.body.children)) {
EventHandler.on(element, 'mouseover', index_js.noop);
2022-05-13 08:07:23 +02:00
}
}
2021-03-23 17:26:54 +01:00
const complete = () => {
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN));
if (this._isHovered === false) {
2022-05-13 08:07:23 +02:00
this._leave();
}
this._isHovered = false;
};
2022-05-13 08:07:23 +02:00
this._queueCallback(complete, this.tip, this._isAnimated());
2021-03-23 17:26:54 +01:00
}
hide() {
2022-05-13 08:07:23 +02:00
if (!this._isShown()) {
2020-09-29 17:33:00 +02:00
return;
}
const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE));
2019-03-01 17:31:34 +01:00
if (hideEvent.defaultPrevented) {
2018-11-13 07:41:12 +01:00
return;
}
2022-05-13 08:07:23 +02:00
const tip = this._getTipElement();
tip.classList.remove(CLASS_NAME_SHOW);
2022-05-13 08:07:23 +02:00
// If this is a touch-enabled device we remove the extra
2018-11-13 07:41:12 +01:00
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
2022-05-13 08:07:23 +02:00
for (const element of [].concat(...document.body.children)) {
EventHandler.off(element, 'mouseover', index_js.noop);
2022-05-13 08:07:23 +02:00
}
2018-11-13 07:41:12 +01:00
}
2020-03-28 11:29:08 +01:00
this._activeTrigger[TRIGGER_CLICK] = false;
this._activeTrigger[TRIGGER_FOCUS] = false;
this._activeTrigger[TRIGGER_HOVER] = false;
this._isHovered = null; // it is a trick to support manual triggering
2017-09-30 23:28:03 +02:00
2022-05-13 08:07:23 +02:00
const complete = () => {
if (this._isWithActiveTrigger()) {
return;
}
if (!this._isHovered) {
2022-11-21 19:19:01 +01:00
this._disposePopper();
2022-05-13 08:07:23 +02:00
}
this._element.removeAttribute('aria-describedby');
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN));
2022-05-13 08:07:23 +02:00
};
this._queueCallback(complete, this.tip, this._isAnimated());
2021-03-23 17:26:54 +01:00
}
update() {
2022-05-13 08:07:23 +02:00
if (this._popper) {
2020-12-07 16:50:24 +01:00
this._popper.update();
2018-11-13 07:41:12 +01:00
}
}
2021-03-23 17:26:54 +01:00
// Protected
2022-05-13 08:07:23 +02:00
_isWithContent() {
return Boolean(this._getTitle());
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_getTipElement() {
if (!this.tip) {
this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());
2019-03-01 17:31:34 +01:00
}
2018-11-13 07:41:12 +01:00
return this.tip;
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_createTipElement(content) {
const tip = this._getTemplateFactory(content).toHtml();
2021-08-04 17:41:51 +02:00
// TODO: remove this check in v6
2022-05-13 08:07:23 +02:00
if (!tip) {
return null;
}
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
// TODO: v6 the following can be achieved with CSS only
2022-05-13 08:07:23 +02:00
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
const tipId = index_js.getUID(this.constructor.NAME).toString();
2022-05-13 08:07:23 +02:00
tip.setAttribute('id', tipId);
if (this._isAnimated()) {
tip.classList.add(CLASS_NAME_FADE);
2019-03-01 17:31:34 +01:00
}
2022-05-13 08:07:23 +02:00
return tip;
}
setContent(content) {
this._newContent = content;
if (this._isShown()) {
this._disposePopper();
2022-05-13 08:07:23 +02:00
this.show();
2018-11-13 07:41:12 +01:00
}
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_getTemplateFactory(content) {
if (this._templateFactory) {
this._templateFactory.changeContent(content);
} else {
this._templateFactory = new TemplateFactory({
...this._config,
2022-05-13 08:07:23 +02:00
// the `content` var has to be after `this._config`
// to override config.content in case of popover
content,
extraClass: this._resolvePossibleFunction(this._config.customClass)
});
}
return this._templateFactory;
}
_getContentForTemplate() {
return {
[SELECTOR_TOOLTIP_INNER]: this._getTitle()
};
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_getTitle() {
return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');
}
2020-12-03 14:08:31 +01:00
// Private
2022-05-13 08:07:23 +02:00
_initializeOnDelegatedTarget(event) {
return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
}
_isAnimated() {
return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE);
}
_isShown() {
return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW);
}
_createPopper(tip) {
const placement = index_js.execute(this._config.placement, [this, tip, this._element]);
2022-05-13 08:07:23 +02:00
const attachment = AttachmentMap[placement.toUpperCase()];
return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
2021-03-23 17:26:54 +01:00
}
_getOffset() {
const {
offset
} = this._config;
if (typeof offset === 'string') {
2022-05-13 08:07:23 +02:00
return offset.split(',').map(value => Number.parseInt(value, 10));
2020-12-07 16:50:24 +01:00
}
if (typeof offset === 'function') {
2021-03-23 17:26:54 +01:00
return popperData => offset(popperData, this._element);
}
return offset;
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_resolvePossibleFunction(arg) {
return index_js.execute(arg, [this._element]);
2021-08-04 17:41:51 +02:00
}
2021-03-23 17:26:54 +01:00
_getPopperConfig(attachment) {
const defaultBsPopperConfig = {
2019-08-27 15:03:21 +02:00
placement: attachment,
modifiers: [{
name: 'flip',
options: {
fallbackPlacements: this._config.fallbackPlacements
}
}, {
name: 'offset',
options: {
offset: this._getOffset()
}
}, {
2020-12-07 16:50:24 +01:00
name: 'preventOverflow',
options: {
boundary: this._config.boundary
2020-12-07 16:50:24 +01:00
}
}, {
name: 'arrow',
options: {
2021-03-23 17:26:54 +01:00
element: `.${this.constructor.NAME}-arrow`
2019-08-27 15:03:21 +02:00
}
2020-12-07 16:50:24 +01:00
}, {
2022-05-13 08:07:23 +02:00
name: 'preSetPlacement',
2020-12-07 16:50:24 +01:00
enabled: true,
2022-05-13 08:07:23 +02:00
phase: 'beforeMain',
fn: data => {
// Pre-set Popper's placement attribute in order to read the arrow sizes properly.
// Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
this._getTipElement().setAttribute('data-popper-placement', data.state.placement);
2019-08-27 15:03:21 +02:00
}
2022-05-13 08:07:23 +02:00
}]
2019-08-27 15:03:21 +02:00
};
return {
...defaultBsPopperConfig,
...index_js.execute(this._config.popperConfig, [defaultBsPopperConfig])
2021-03-23 17:26:54 +01:00
};
}
_setListeners() {
const triggers = this._config.trigger.split(' ');
2022-05-13 08:07:23 +02:00
for (const trigger of triggers) {
2018-11-13 07:41:12 +01:00
if (trigger === 'click') {
EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {
const context = this._initializeOnDelegatedTarget(event);
context.toggle();
});
2020-03-28 11:29:08 +01:00
} else if (trigger !== TRIGGER_MANUAL) {
2022-05-13 08:07:23 +02:00
const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN);
const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT);
EventHandler.on(this._element, eventIn, this._config.selector, event => {
2022-05-13 08:07:23 +02:00
const context = this._initializeOnDelegatedTarget(event);
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
context._enter();
});
EventHandler.on(this._element, eventOut, this._config.selector, event => {
2022-05-13 08:07:23 +02:00
const context = this._initializeOnDelegatedTarget(event);
context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
context._leave();
});
2017-09-06 06:05:12 +02:00
}
2022-05-13 08:07:23 +02:00
}
2021-03-23 17:26:54 +01:00
this._hideModalHandler = () => {
if (this._element) {
this.hide();
2018-11-13 07:41:12 +01:00
}
2019-07-12 23:56:26 +02:00
};
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
2021-03-23 17:26:54 +01:00
}
_fixTitle() {
const title = this._element.getAttribute('title');
2022-05-13 08:07:23 +02:00
if (!title) {
return;
2018-11-13 07:41:12 +01:00
}
if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
2022-05-13 08:07:23 +02:00
this._element.setAttribute('aria-label', title);
2018-11-13 07:41:12 +01:00
}
this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility
2022-05-13 08:07:23 +02:00
this._element.removeAttribute('title');
}
_enter() {
if (this._isShown() || this._isHovered) {
this._isHovered = true;
2018-11-13 07:41:12 +01:00
return;
}
2022-05-13 08:07:23 +02:00
this._isHovered = true;
this._setTimeout(() => {
if (this._isHovered) {
this.show();
}
2022-05-13 08:07:23 +02:00
}, this._config.delay.show);
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_leave() {
if (this._isWithActiveTrigger()) {
2018-11-13 07:41:12 +01:00
return;
}
2022-05-13 08:07:23 +02:00
this._isHovered = false;
this._setTimeout(() => {
if (!this._isHovered) {
this.hide();
}
2022-05-13 08:07:23 +02:00
}, this._config.delay.hide);
2021-03-23 17:26:54 +01:00
}
2022-05-13 08:07:23 +02:00
_setTimeout(handler, timeout) {
clearTimeout(this._timeout);
this._timeout = setTimeout(handler, timeout);
}
_isWithActiveTrigger() {
return Object.values(this._activeTrigger).includes(true);
2021-03-23 17:26:54 +01:00
}
_getConfig(config) {
const dataAttributes = Manipulator.getDataAttributes(this._element);
2022-05-13 08:07:23 +02:00
for (const dataAttribute of Object.keys(dataAttributes)) {
if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {
delete dataAttributes[dataAttribute];
2019-02-13 17:01:40 +01:00
}
2022-05-13 08:07:23 +02:00
}
config = {
...dataAttributes,
2021-03-23 17:26:54 +01:00
...(typeof config === 'object' && config ? config : {})
};
2022-05-13 08:07:23 +02:00
config = this._mergeConfigObj(config);
config = this._configAfterMerge(config);
this._typeCheckConfig(config);
return config;
}
_configAfterMerge(config) {
config.container = config.container === false ? document.body : index_js.getElement(config.container);
2018-11-13 07:41:12 +01:00
if (typeof config.delay === 'number') {
config.delay = {
show: config.delay,
hide: config.delay
};
}
if (typeof config.title === 'number') {
config.title = config.title.toString();
}
if (typeof config.content === 'number') {
config.content = config.content.toString();
}
return config;
2021-03-23 17:26:54 +01:00
}
_getDelegateConfig() {
const config = {};
for (const [key, value] of Object.entries(this._config)) {
if (this.constructor.Default[key] !== value) {
config[key] = value;
}
}
config.selector = false;
config.trigger = 'manual';
// In the future can be replaced with:
2021-08-04 17:41:51 +02:00
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
// `Object.fromEntries(keysWithDifferentValues)`
2018-11-13 07:41:12 +01:00
return config;
2021-03-23 17:26:54 +01:00
}
_disposePopper() {
if (this._popper) {
this._popper.destroy();
this._popper = null;
}
2022-11-21 19:19:01 +01:00
if (this.tip) {
this.tip.remove();
this.tip = null;
}
}
2021-03-23 17:26:54 +01:00
// Static
2021-03-23 17:26:54 +01:00
static jQueryInterface(config) {
2018-11-13 07:41:12 +01:00
return this.each(function () {
const data = Tooltip.getOrCreateInstance(this, config);
2022-05-13 08:07:23 +02:00
if (typeof config !== 'string') {
return;
}
if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`);
2018-07-24 02:51:14 +02:00
}
2022-05-13 08:07:23 +02:00
data[config]();
2018-11-13 07:41:12 +01:00
});
2021-03-23 17:26:54 +01:00
}
}
2018-11-13 07:41:12 +01:00
/**
* jQuery
*/
index_js.defineJQueryPlugin(Tooltip);
return Tooltip;
2018-07-24 02:51:14 +02:00
2021-10-05 17:50:18 +02:00
}));
2018-07-24 02:51:14 +02:00
//# sourceMappingURL=tooltip.js.map