dist/v-tooltip.esm.js
function Tooltip(_reference, _options) {
    var _this = this;

    _classCallCheck(this, Tooltip);

    _defineProperty(this, "_events", []);

    _defineProperty(this, "_setTooltipNodeEvent", function (evt, reference, delay, options) {
      var relatedreference = evt.relatedreference || evt.toElement || evt.relatedTarget;

      var callback = function callback(evt2) {
        var relatedreference2 = evt2.relatedreference || evt2.toElement || evt2.relatedTarget; // Remove event listener after call

        _this._tooltipNode.removeEventListener(evt.type, callback); // If the new reference is not the reference element


        if (!reference.contains(relatedreference2)) {
          // Schedule to hide tooltip
          _this._scheduleHide(reference, options.delay, options, evt2);
        }
      };

      if (_this._tooltipNode.contains(relatedreference)) {
        // listen to mouseleave on the tooltip element to be able to hide the tooltip
        _this._tooltipNode.addEventListener(evt.type, callback);

        return true;
      }

      return false;
    });

    // apply user options over default ones
    _options = _objectSpread({}, DEFAULT_OPTIONS, _options);
    _reference.jquery && (_reference = _reference[0]);
    this.show = this.show.bind(this);
    this.hide = this.hide.bind(this); // cache reference and options

    this.reference = _reference;
    this.options = _options; // set initial state

    this._isOpen = false;

    this._init();
  }
function Tooltip(_reference, _options) {
    var _this = this;

    _classCallCheck(this, Tooltip);

    _defineProperty(this, "_events", []);

    _defineProperty(this, "_setTooltipNodeEvent", function (evt, reference, delay, options) {
      var relatedreference = evt.relatedreference || evt.toElement || evt.relatedTarget;

      var callback = function callback(evt2) {
        var relatedreference2 = evt2.relatedreference || evt2.toElement || evt2.relatedTarget; // Remove event listener after call

        _this._tooltipNode.removeEventListener(evt.type, callback); // If the new reference is not the reference element


        if (!reference.contains(relatedreference2)) {
          // Schedule to hide tooltip
          _this._scheduleHide(reference, options.delay, options, evt2);
        }
      };

      if (_this._tooltipNode.contains(relatedreference)) {
        // listen to mouseleave on the tooltip element to be able to hide the tooltip
        _this._tooltipNode.addEventListener(evt.type, callback);

        return true;
      }

      return false;
    });

    // apply user options over default ones
    _options = _objectSpread({}, DEFAULT_OPTIONS, _options);
    _reference.jquery && (_reference = _reference[0]);
    this.show = this.show.bind(this);
    this.hide = this.hide.bind(this); // cache reference and options

    this.reference = _reference;
    this.options = _options; // set initial state

    this._isOpen = false;

    this._init();
  }
function Tooltip ( _reference , _options ) { var _this = this ; _classCallCheck ( this , Tooltip ) ; _defineProperty ( this , "_events" , [ ] ) ; _defineProperty ( this , "_setTooltipNodeEvent" , function ( evt , reference , delay , options ) { var relatedreference = evt . relatedreference || evt . toElement || evt . relatedTarget ; var callback = function callback ( evt2 ) { var relatedreference2 = evt2 . relatedreference || evt2 . toElement || evt2 . relatedTarget ; // Remove event listener after call _this . _tooltipNode . removeEventListener ( evt . type , callback ) ; // If the new reference is not the reference element if ( ! reference . contains ( relatedreference2 ) ) { // Schedule to hide tooltip _this . _scheduleHide ( reference , options . delay , options , evt2 ) ; } } ; if ( _this . _tooltipNode . contains ( relatedreference ) ) { // listen to mouseleave on the tooltip element to be able to hide the tooltip _this . _tooltipNode . addEventListener ( evt . type , callback ) ; return true ; } return false ; } ) ; // apply user options over default ones _options = _objectSpread ( { } , DEFAULT_OPTIONS , _options ) ; _reference . jquery && ( _reference = _reference [ 0 ] ) ; this . show = this . show . bind ( this ) ; this . hide = this . hide . bind ( this ) ; // cache reference and options this . reference = _reference ; this . options = _options ; // set initial state this . _isOpen = false ; this . _init ( ) ; }
Create a new Tooltip.js instance
@class Tooltip
@param {HTMLElement} reference - The DOM node used as reference of the tooltip (it can be a jQuery element).
@param {Object} options
@param {String} options.placement=bottom
Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -end),
left(-start, -end)`
@param {HTMLElement|String|false} options.container=false - Append the tooltip to a specific element.
@param {Number|Object} options.delay=0
Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type.
If a number is supplied, delay is applied to both hide/show.
Object structure is: `{ show: 500, hide: 100 }`
@param {Boolean} options.html=false - Insert HTML into the tooltip. If false, the content will inserted with `innerText`.
@param {String|PlacementFunction} options.placement='top' - One of the allowed placements, or a function returning one of them.
@param {String} [options.template='<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>']
Base HTML to used when creating the tooltip.
The tooltip's `title` will be injected into the `.tooltip-inner` or `.tooltip__inner`.
`.tooltip-arrow` or `.tooltip__arrow` will become the tooltip's arrow.
The outermost wrapper element should have the `.tooltip` class.
@param {String|HTMLElement|TitleFunction} options.title='' - Default title value if `title` attribute isn't present.
@param {String} [options.trigger='hover focus']
How tooltip is triggered - click, hover, focus, manual.
You may pass multiple triggers; separate them with a space. `manual` cannot be combined with any other trigger.
@param {HTMLElement} options.boundariesElement
The element used as boundaries for the tooltip. For more information refer to Popper.js'
[boundariesElement docs](https://popper.js.org/popper-documentation.html)
@param {Number|String} options.offset=0 - Offset of the tooltip relative to its reference. For more information refer to Popper.js'
[offset docs](https://popper.js.org/popper-documentation.html)
@param {Object} options.popperOptions={} - Popper options, will be passed directly to popper instance. For more information refer to Popper.js'
[options docs](https://popper.js.org/popper-documentation.html)
@return {Object} instance - The generated tooltip instance
Create a new Tooltip . js instance