1 (function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) :
3 typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) :
4 (global.Popover = factory(global.jQuery,global.Tooltip));
5 }(this, (function ($,Tooltip) { 'use strict';
7 $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8 Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip;
10 function _defineProperties(target, props) {
11 for (var i = 0; i < props.length; i++) {
12 var descriptor = props[i];
13 descriptor.enumerable = descriptor.enumerable || false;
14 descriptor.configurable = true;
15 if ("value" in descriptor) descriptor.writable = true;
16 Object.defineProperty(target, descriptor.key, descriptor);
20 function _createClass(Constructor, protoProps, staticProps) {
21 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
22 if (staticProps) _defineProperties(Constructor, staticProps);
26 function _defineProperty(obj, key, value) {
28 Object.defineProperty(obj, key, {
41 function _objectSpread(target) {
42 for (var i = 1; i < arguments.length; i++) {
43 var source = arguments[i] != null ? arguments[i] : {};
44 var ownKeys = Object.keys(source);
46 if (typeof Object.getOwnPropertySymbols === 'function') {
47 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
48 return Object.getOwnPropertyDescriptor(source, sym).enumerable;
52 ownKeys.forEach(function (key) {
53 _defineProperty(target, key, source[key]);
60 function _inheritsLoose(subClass, superClass) {
61 subClass.prototype = Object.create(superClass.prototype);
62 subClass.prototype.constructor = subClass;
63 subClass.__proto__ = superClass;
67 * --------------------------------------------------------------------------
68 * Bootstrap (v4.1.3): popover.js
69 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
70 * --------------------------------------------------------------------------
73 var Popover = function ($$$1) {
75 * ------------------------------------------------------------------------
77 * ------------------------------------------------------------------------
80 var VERSION = '4.1.3';
81 var DATA_KEY = 'bs.popover';
82 var EVENT_KEY = "." + DATA_KEY;
83 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
84 var CLASS_PREFIX = 'bs-popover';
85 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
87 var Default = _objectSpread({}, Tooltip.Default, {
91 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
94 var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
95 content: '(string|element|function)'
103 TITLE: '.popover-header',
104 CONTENT: '.popover-body'
107 HIDE: "hide" + EVENT_KEY,
108 HIDDEN: "hidden" + EVENT_KEY,
109 SHOW: "show" + EVENT_KEY,
110 SHOWN: "shown" + EVENT_KEY,
111 INSERTED: "inserted" + EVENT_KEY,
112 CLICK: "click" + EVENT_KEY,
113 FOCUSIN: "focusin" + EVENT_KEY,
114 FOCUSOUT: "focusout" + EVENT_KEY,
115 MOUSEENTER: "mouseenter" + EVENT_KEY,
116 MOUSELEAVE: "mouseleave" + EVENT_KEY
118 * ------------------------------------------------------------------------
120 * ------------------------------------------------------------------------
127 function (_Tooltip) {
128 _inheritsLoose(Popover, _Tooltip);
131 return _Tooltip.apply(this, arguments) || this;
134 var _proto = Popover.prototype;
137 _proto.isWithContent = function isWithContent() {
138 return this.getTitle() || this._getContent();
141 _proto.addAttachmentClass = function addAttachmentClass(attachment) {
142 $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
145 _proto.getTipElement = function getTipElement() {
146 this.tip = this.tip || $$$1(this.config.template)[0];
150 _proto.setContent = function setContent() {
151 var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
153 this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
155 var content = this._getContent();
157 if (typeof content === 'function') {
158 content = content.call(this.element);
161 this.setElementContent($tip.find(Selector.CONTENT), content);
162 $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
166 _proto._getContent = function _getContent() {
167 return this.element.getAttribute('data-content') || this.config.content;
170 _proto._cleanTipClass = function _cleanTipClass() {
171 var $tip = $$$1(this.getTipElement());
172 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
174 if (tabClass !== null && tabClass.length > 0) {
175 $tip.removeClass(tabClass.join(''));
180 Popover._jQueryInterface = function _jQueryInterface(config) {
181 return this.each(function () {
182 var data = $$$1(this).data(DATA_KEY);
184 var _config = typeof config === 'object' ? config : null;
186 if (!data && /destroy|hide/.test(config)) {
191 data = new Popover(this, _config);
192 $$$1(this).data(DATA_KEY, data);
195 if (typeof config === 'string') {
196 if (typeof data[config] === 'undefined') {
197 throw new TypeError("No method named \"" + config + "\"");
205 _createClass(Popover, null, [{
208 get: function get() {
213 get: function get() {
218 get: function get() {
223 get: function get() {
228 get: function get() {
233 get: function get() {
238 get: function get() {
246 * ------------------------------------------------------------------------
248 * ------------------------------------------------------------------------
252 $$$1.fn[NAME] = Popover._jQueryInterface;
253 $$$1.fn[NAME].Constructor = Popover;
255 $$$1.fn[NAME].noConflict = function () {
256 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
257 return Popover._jQueryInterface;
266 //# sourceMappingURL=popover.js.map