diff options
Diffstat (limited to 'js/dist/popover.js')
-rw-r--r-- | js/dist/popover.js | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/js/dist/popover.js b/js/dist/popover.js index e172faed4d..0c6a8fd25b 100644 --- a/js/dist/popover.js +++ b/js/dist/popover.js @@ -6,12 +6,14 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/selector-engine.js'), require('./tooltip.js')) : typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/selector-engine.js', './tooltip.js'], factory) : - (global = global || self, global.Popover = factory(global.Data, global.SelectorEngine, global.Tooltip)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.Data, global.SelectorEngine, global.Tooltip)); }(this, (function (Data, SelectorEngine, Tooltip) { 'use strict'; - Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; - SelectorEngine = SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default') ? SelectorEngine['default'] : SelectorEngine; - Tooltip = Tooltip && Object.prototype.hasOwnProperty.call(Tooltip, 'default') ? Tooltip['default'] : Tooltip; + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + + var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data); + var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine); + var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip); /** * -------------------------------------------------------------------------- @@ -37,11 +39,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + 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); } /** * ------------------------------------------------------------------------ * Constants @@ -55,14 +53,14 @@ var CLASS_PREFIX = 'bs-popover'; var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); - var Default = _objectSpread(_objectSpread({}, Tooltip.Default), {}, { + var Default = _extends({}, Tooltip__default['default'].Default, { placement: 'right', trigger: 'click', content: '', template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' }); - var DefaultType = _objectSpread(_objectSpread({}, Tooltip.DefaultType), {}, { + var DefaultType = _extends({}, Tooltip__default['default'].DefaultType, { content: '(string|element|function)' }); @@ -105,7 +103,7 @@ _proto.setContent = function setContent() { var tip = this.getTipElement(); // we use append for html objects to maintain js events - this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle()); + this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TITLE, tip), this.getTitle()); var content = this._getContent(); @@ -113,14 +111,14 @@ content = content.call(this.element); } - this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content); + this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_CONTENT, tip), content); tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW); - }; + } // Private + ; _proto._addAttachmentClass = function _addAttachmentClass(attachment) { this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment); - } // Private - ; + }; _proto._getContent = function _getContent() { return this.element.getAttribute('data-content') || this.config.content; @@ -142,7 +140,7 @@ Popover.jQueryInterface = function jQueryInterface(config) { return this.each(function () { - var data = Data.getData(this, DATA_KEY); + var data = Data__default['default'].getData(this, DATA_KEY); var _config = typeof config === 'object' ? config : null; @@ -152,7 +150,7 @@ if (!data) { data = new Popover(this, _config); - Data.setData(this, DATA_KEY, data); + Data__default['default'].setData(this, DATA_KEY, data); } if (typeof config === 'string') { @@ -166,7 +164,7 @@ }; Popover.getInstance = function getInstance(element) { - return Data.getData(element, DATA_KEY); + return Data__default['default'].getData(element, DATA_KEY); }; _createClass(Popover, null, [{ @@ -208,7 +206,7 @@ }]); return Popover; - }(Tooltip); + }(Tooltip__default['default']); var $ = getjQuery(); /** |