vue-tippy 6.0.0-alpha.42 → 6.0.0-alpha.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * vue-tippy v6.0.0-alpha.42
3
- * (c) 2021
2
+ * vue-tippy v6.0.0-alpha.46
3
+ * (c) 2022
4
4
  * @license MIT
5
5
  */
6
6
  'use strict';
@@ -436,14 +436,14 @@ function effect$1(_ref2) {
436
436
  }
437
437
  }
438
438
 
439
- if (process.env.NODE_ENV !== "production") {
439
+ {
440
440
  if (!isHTMLElement(arrowElement)) {
441
441
  console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
442
442
  }
443
443
  }
444
444
 
445
445
  if (!contains(state.elements.popper, arrowElement)) {
446
- if (process.env.NODE_ENV !== "production") {
446
+ {
447
447
  console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
448
448
  }
449
449
 
@@ -571,7 +571,7 @@ function computeStyles(_ref4) {
571
571
  _options$roundOffsets = options.roundOffsets,
572
572
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
573
573
 
574
- if (process.env.NODE_ENV !== "production") {
574
+ {
575
575
  var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
576
576
 
577
577
  if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
@@ -1030,7 +1030,7 @@ function computeAutoPlacement(state, options) {
1030
1030
  if (allowedPlacements.length === 0) {
1031
1031
  allowedPlacements = placements$1;
1032
1032
 
1033
- if (process.env.NODE_ENV !== "production") {
1033
+ {
1034
1034
  console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
1035
1035
  }
1036
1036
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
@@ -1767,7 +1767,7 @@ function popperGenerator(generatorOptions) {
1767
1767
  }); // Validate the provided modifiers so that the consumer will get warned
1768
1768
  // if one of the modifiers is invalid for any reason
1769
1769
 
1770
- if (process.env.NODE_ENV !== "production") {
1770
+ {
1771
1771
  var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
1772
1772
  var name = _ref.name;
1773
1773
  return name;
@@ -1819,7 +1819,7 @@ function popperGenerator(generatorOptions) {
1819
1819
  // anymore
1820
1820
 
1821
1821
  if (!areValidElements(reference, popper)) {
1822
- if (process.env.NODE_ENV !== "production") {
1822
+ {
1823
1823
  console.error(INVALID_ELEMENT_ERROR);
1824
1824
  }
1825
1825
 
@@ -1848,7 +1848,7 @@ function popperGenerator(generatorOptions) {
1848
1848
  var __debug_loops__ = 0;
1849
1849
 
1850
1850
  for (var index = 0; index < state.orderedModifiers.length; index++) {
1851
- if (process.env.NODE_ENV !== "production") {
1851
+ {
1852
1852
  __debug_loops__ += 1;
1853
1853
 
1854
1854
  if (__debug_loops__ > 100) {
@@ -1894,7 +1894,7 @@ function popperGenerator(generatorOptions) {
1894
1894
  };
1895
1895
 
1896
1896
  if (!areValidElements(reference, popper)) {
1897
- if (process.env.NODE_ENV !== "production") {
1897
+ {
1898
1898
  console.error(INVALID_ELEMENT_ERROR);
1899
1899
  }
1900
1900
 
@@ -2238,7 +2238,7 @@ function getFormattedMessage(message) {
2238
2238
 
2239
2239
  var visitedMessages;
2240
2240
 
2241
- if (process.env.NODE_ENV !== "production") {
2241
+ {
2242
2242
  resetVisitedMessages();
2243
2243
  }
2244
2244
 
@@ -2327,7 +2327,7 @@ var defaultProps = Object.assign({
2327
2327
  var defaultKeys = Object.keys(defaultProps);
2328
2328
  var setDefaultProps = function setDefaultProps(partialProps) {
2329
2329
  /* istanbul ignore else */
2330
- if (process.env.NODE_ENV !== "production") {
2330
+ {
2331
2331
  validateProps(partialProps, []);
2332
2332
  }
2333
2333
 
@@ -2603,7 +2603,7 @@ function createTippy(reference, passedProps) {
2603
2603
  /* istanbul ignore if */
2604
2604
 
2605
2605
  if (!props.render) {
2606
- if (process.env.NODE_ENV !== "production") {
2606
+ {
2607
2607
  errorWhen(true, 'render() function has not been supplied.');
2608
2608
  }
2609
2609
 
@@ -3154,7 +3154,7 @@ function createTippy(reference, passedProps) {
3154
3154
  createPopperInstance();
3155
3155
  /* istanbul ignore else */
3156
3156
 
3157
- if (process.env.NODE_ENV !== "production") {
3157
+ {
3158
3158
  // Accessibility check
3159
3159
  warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard', 'navigation because it is not directly after the reference element', 'in the DOM source order.', '\n\n', 'Using a wrapper <div> or <span> tag around the reference element', 'solves this by creating a new parentNode context.', '\n\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle', 'keyboard navigation.', '\n\n', 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));
3160
3160
  }
@@ -3247,7 +3247,7 @@ function createTippy(reference, passedProps) {
3247
3247
 
3248
3248
  function setProps(partialProps) {
3249
3249
  /* istanbul ignore else */
3250
- if (process.env.NODE_ENV !== "production") {
3250
+ {
3251
3251
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
3252
3252
  }
3253
3253
 
@@ -3309,7 +3309,7 @@ function createTippy(reference, passedProps) {
3309
3309
 
3310
3310
  function show() {
3311
3311
  /* istanbul ignore else */
3312
- if (process.env.NODE_ENV !== "production") {
3312
+ {
3313
3313
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
3314
3314
  } // Early bail-out
3315
3315
 
@@ -3402,7 +3402,7 @@ function createTippy(reference, passedProps) {
3402
3402
 
3403
3403
  function hide() {
3404
3404
  /* istanbul ignore else */
3405
- if (process.env.NODE_ENV !== "production") {
3405
+ {
3406
3406
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
3407
3407
  } // Early bail-out
3408
3408
 
@@ -3460,7 +3460,7 @@ function createTippy(reference, passedProps) {
3460
3460
 
3461
3461
  function hideWithInteractivity(event) {
3462
3462
  /* istanbul ignore else */
3463
- if (process.env.NODE_ENV !== "production") {
3463
+ {
3464
3464
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
3465
3465
  }
3466
3466
 
@@ -3471,7 +3471,7 @@ function createTippy(reference, passedProps) {
3471
3471
 
3472
3472
  function unmount() {
3473
3473
  /* istanbul ignore else */
3474
- if (process.env.NODE_ENV !== "production") {
3474
+ {
3475
3475
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));
3476
3476
  }
3477
3477
 
@@ -3504,7 +3504,7 @@ function createTippy(reference, passedProps) {
3504
3504
 
3505
3505
  function destroy() {
3506
3506
  /* istanbul ignore else */
3507
- if (process.env.NODE_ENV !== "production") {
3507
+ {
3508
3508
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
3509
3509
  }
3510
3510
 
@@ -3529,7 +3529,7 @@ function tippy(targets, optionalProps) {
3529
3529
  var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
3530
3530
  /* istanbul ignore else */
3531
3531
 
3532
- if (process.env.NODE_ENV !== "production") {
3532
+ {
3533
3533
  validateTargets(targets);
3534
3534
  validateProps(optionalProps, plugins);
3535
3535
  }
@@ -3541,7 +3541,7 @@ function tippy(targets, optionalProps) {
3541
3541
  var elements = getArrayOfElements(targets);
3542
3542
  /* istanbul ignore else */
3543
3543
 
3544
- if (process.env.NODE_ENV !== "production") {
3544
+ {
3545
3545
  var isSingleContentElement = isElement$1(passedProps.content);
3546
3546
  var isMoreThanOneReferenceElement = elements.length > 1;
3547
3547
  warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than', 'one tippy instance was created by this invocation. This means the', 'content element will only be appended to the last tippy instance.', '\n\n', 'Instead, pass the .innerHTML of the element, or use a function that', 'returns a cloned version of the element instead.', '\n\n', '1) content: element.innerHTML\n', '2) content: () => element.cloneNode(true)'].join(' '));
@@ -3601,7 +3601,7 @@ var createSingleton = function createSingleton(tippyInstances, optionalProps) {
3601
3601
  }
3602
3602
 
3603
3603
  /* istanbul ignore else */
3604
- if (process.env.NODE_ENV !== "production") {
3604
+ {
3605
3605
  errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));
3606
3606
  }
3607
3607
 
@@ -3804,7 +3804,7 @@ var animateFill = {
3804
3804
 
3805
3805
  // @ts-ignore
3806
3806
  if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
3807
- if (process.env.NODE_ENV !== "production") {
3807
+ {
3808
3808
  errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');
3809
3809
  }
3810
3810
 
@@ -4329,8 +4329,10 @@ function useTippy(el, opts = {}, settings = { mount: true }) {
4329
4329
  if (!options.plugins || !Array.isArray(options.plugins)) {
4330
4330
  options.plugins = [];
4331
4331
  }
4332
+ options.plugins = options.plugins.filter((plugin) => plugin.name !== 'vueTippyReactiveState');
4332
4333
  options.plugins.push({
4333
- fn() {
4334
+ name: 'vueTippyReactiveState',
4335
+ fn: () => {
4334
4336
  return {
4335
4337
  onCreate() {
4336
4338
  state.value.isEnabled = true;
@@ -4586,6 +4588,9 @@ const TippyComponent = vue.defineComponent({
4586
4588
  vue.watch(tippy.state, () => {
4587
4589
  emit('state', vue.unref(tippy.state));
4588
4590
  }, { immediate: true, deep: true });
4591
+ vue.watch(props, () => {
4592
+ tippy.setProps(props);
4593
+ });
4589
4594
  return { elem, contentElem, mounted, ...tippy };
4590
4595
  },
4591
4596
  render() {