prolab-api/vendor/bower-asset/bootstrap/js/dist/popover.js

103 lines
2.8 KiB
JavaScript
Raw Normal View History

2025-09-24 06:24:52 +00:00
/*!
2025-10-03 11:00:05 +00:00
* Bootstrap popover.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2025-09-24 06:24:52 +00:00
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
(function (global, factory) {
2025-10-03 11:00:05 +00:00
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index'), require('./tooltip')) :
typeof define === 'function' && define.amd ? define(['./util/index', './tooltip'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.Index, global.Tooltip));
})(this, (function (index, Tooltip) { 'use strict';
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
const Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
2025-09-24 06:24:52 +00:00
/**
* --------------------------------------------------------------------------
2025-10-03 11:00:05 +00:00
* Bootstrap (v5.2.3): popover.js
2025-09-24 06:24:52 +00:00
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
/**
* Constants
*/
const NAME = 'popover';
const SELECTOR_TITLE = '.popover-header';
const SELECTOR_CONTENT = '.popover-body';
2025-10-03 11:00:05 +00:00
const Default = { ...Tooltip__default.default.Default,
2025-09-24 06:24:52 +00:00
content: '',
offset: [0, 8],
placement: 'right',
template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>',
trigger: 'click'
};
2025-10-03 11:00:05 +00:00
const DefaultType = { ...Tooltip__default.default.DefaultType,
2025-09-24 06:24:52 +00:00
content: '(null|string|element|function)'
};
/**
* Class definition
*/
2025-10-03 11:00:05 +00:00
class Popover extends Tooltip__default.default {
2025-09-24 06:24:52 +00:00
// Getters
static get Default() {
return Default;
}
2025-10-03 11:00:05 +00:00
2025-09-24 06:24:52 +00:00
static get DefaultType() {
return DefaultType;
}
2025-10-03 11:00:05 +00:00
2025-09-24 06:24:52 +00:00
static get NAME() {
return NAME;
2025-10-03 11:00:05 +00:00
} // Overrides
2025-09-24 06:24:52 +00:00
_isWithContent() {
return this._getTitle() || this._getContent();
2025-10-03 11:00:05 +00:00
} // Private
2025-09-24 06:24:52 +00:00
_getContentForTemplate() {
return {
[SELECTOR_TITLE]: this._getTitle(),
[SELECTOR_CONTENT]: this._getContent()
};
}
2025-10-03 11:00:05 +00:00
2025-09-24 06:24:52 +00:00
_getContent() {
return this._resolvePossibleFunction(this._config.content);
2025-10-03 11:00:05 +00:00
} // Static
2025-09-24 06:24:52 +00:00
static jQueryInterface(config) {
return this.each(function () {
const data = Popover.getOrCreateInstance(this, config);
2025-10-03 11:00:05 +00:00
2025-09-24 06:24:52 +00:00
if (typeof config !== 'string') {
return;
}
2025-10-03 11:00:05 +00:00
2025-09-24 06:24:52 +00:00
if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`);
}
2025-10-03 11:00:05 +00:00
2025-09-24 06:24:52 +00:00
data[config]();
});
}
2025-10-03 11:00:05 +00:00
}
2025-09-24 06:24:52 +00:00
/**
* jQuery
*/
2025-10-03 11:00:05 +00:00
index.defineJQueryPlugin(Popover);
2025-09-24 06:24:52 +00:00
return Popover;
}));
//# sourceMappingURL=popover.js.map