vue-tippy 6.0.0-alpha.41 → 6.0.0-alpha.45
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/vue-tippy.cjs +30 -25
- package/dist/vue-tippy.esm-browser.js +8 -319
- package/dist/vue-tippy.iife.js +30 -25
- package/dist/vue-tippy.iife.prod.js +3 -3
- package/dist/vue-tippy.mjs +8 -319
- package/dist/vue-tippy.prod.cjs +8 -319
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* vue-tippy v6.0.0-alpha.
|
3
|
-
* (c)
|
2
|
+
* vue-tippy v6.0.0-alpha.45
|
3
|
+
* (c) 2022
|
4
4
|
* @license MIT
|
5
5
|
*/
|
6
6
|
import { getCurrentInstance, ref, onMounted, onUnmounted, isRef, isReactive, watch, isVNode, render as render$1, h, defineComponent, nextTick, unref } from 'vue';
|
@@ -432,16 +432,7 @@ function effect$1(_ref2) {
|
|
432
432
|
}
|
433
433
|
}
|
434
434
|
|
435
|
-
if (process.env.NODE_ENV !== "production") {
|
436
|
-
if (!isHTMLElement(arrowElement)) {
|
437
|
-
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(' '));
|
438
|
-
}
|
439
|
-
}
|
440
|
-
|
441
435
|
if (!contains(state.elements.popper, arrowElement)) {
|
442
|
-
if (process.env.NODE_ENV !== "production") {
|
443
|
-
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
|
444
|
-
}
|
445
436
|
|
446
437
|
return;
|
447
438
|
}
|
@@ -567,16 +558,6 @@ function computeStyles(_ref4) {
|
|
567
558
|
_options$roundOffsets = options.roundOffsets,
|
568
559
|
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
569
560
|
|
570
|
-
if (process.env.NODE_ENV !== "production") {
|
571
|
-
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
|
572
|
-
|
573
|
-
if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
|
574
|
-
return transitionProperty.indexOf(property) >= 0;
|
575
|
-
})) {
|
576
|
-
console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
|
577
|
-
}
|
578
|
-
}
|
579
|
-
|
580
561
|
var commonStyles = {
|
581
562
|
placement: getBasePlacement(state.placement),
|
582
563
|
variation: getVariation(state.placement),
|
@@ -1025,10 +1006,6 @@ function computeAutoPlacement(state, options) {
|
|
1025
1006
|
|
1026
1007
|
if (allowedPlacements.length === 0) {
|
1027
1008
|
allowedPlacements = placements$1;
|
1028
|
-
|
1029
|
-
if (process.env.NODE_ENV !== "production") {
|
1030
|
-
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(' '));
|
1031
|
-
}
|
1032
1009
|
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
1033
1010
|
|
1034
1011
|
|
@@ -1580,108 +1557,6 @@ function debounce(fn) {
|
|
1580
1557
|
};
|
1581
1558
|
}
|
1582
1559
|
|
1583
|
-
function format(str) {
|
1584
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1585
|
-
args[_key - 1] = arguments[_key];
|
1586
|
-
}
|
1587
|
-
|
1588
|
-
return [].concat(args).reduce(function (p, c) {
|
1589
|
-
return p.replace(/%s/, c);
|
1590
|
-
}, str);
|
1591
|
-
}
|
1592
|
-
|
1593
|
-
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
1594
|
-
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
1595
|
-
var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
|
1596
|
-
function validateModifiers(modifiers) {
|
1597
|
-
modifiers.forEach(function (modifier) {
|
1598
|
-
[].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
|
1599
|
-
.filter(function (value, index, self) {
|
1600
|
-
return self.indexOf(value) === index;
|
1601
|
-
}).forEach(function (key) {
|
1602
|
-
switch (key) {
|
1603
|
-
case 'name':
|
1604
|
-
if (typeof modifier.name !== 'string') {
|
1605
|
-
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
|
1606
|
-
}
|
1607
|
-
|
1608
|
-
break;
|
1609
|
-
|
1610
|
-
case 'enabled':
|
1611
|
-
if (typeof modifier.enabled !== 'boolean') {
|
1612
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
|
1613
|
-
}
|
1614
|
-
|
1615
|
-
break;
|
1616
|
-
|
1617
|
-
case 'phase':
|
1618
|
-
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
1619
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
|
1620
|
-
}
|
1621
|
-
|
1622
|
-
break;
|
1623
|
-
|
1624
|
-
case 'fn':
|
1625
|
-
if (typeof modifier.fn !== 'function') {
|
1626
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1627
|
-
}
|
1628
|
-
|
1629
|
-
break;
|
1630
|
-
|
1631
|
-
case 'effect':
|
1632
|
-
if (modifier.effect != null && typeof modifier.effect !== 'function') {
|
1633
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1634
|
-
}
|
1635
|
-
|
1636
|
-
break;
|
1637
|
-
|
1638
|
-
case 'requires':
|
1639
|
-
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
1640
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
|
1641
|
-
}
|
1642
|
-
|
1643
|
-
break;
|
1644
|
-
|
1645
|
-
case 'requiresIfExists':
|
1646
|
-
if (!Array.isArray(modifier.requiresIfExists)) {
|
1647
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
|
1648
|
-
}
|
1649
|
-
|
1650
|
-
break;
|
1651
|
-
|
1652
|
-
case 'options':
|
1653
|
-
case 'data':
|
1654
|
-
break;
|
1655
|
-
|
1656
|
-
default:
|
1657
|
-
console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
|
1658
|
-
return "\"" + s + "\"";
|
1659
|
-
}).join(', ') + "; but \"" + key + "\" was provided.");
|
1660
|
-
}
|
1661
|
-
|
1662
|
-
modifier.requires && modifier.requires.forEach(function (requirement) {
|
1663
|
-
if (modifiers.find(function (mod) {
|
1664
|
-
return mod.name === requirement;
|
1665
|
-
}) == null) {
|
1666
|
-
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
1667
|
-
}
|
1668
|
-
});
|
1669
|
-
});
|
1670
|
-
});
|
1671
|
-
}
|
1672
|
-
|
1673
|
-
function uniqueBy(arr, fn) {
|
1674
|
-
var identifiers = new Set();
|
1675
|
-
return arr.filter(function (item) {
|
1676
|
-
var identifier = fn(item);
|
1677
|
-
|
1678
|
-
if (!identifiers.has(identifier)) {
|
1679
|
-
identifiers.add(identifier);
|
1680
|
-
return true;
|
1681
|
-
}
|
1682
|
-
});
|
1683
|
-
}
|
1684
|
-
|
1685
1560
|
function mergeByName(modifiers) {
|
1686
1561
|
var merged = modifiers.reduce(function (merged, current) {
|
1687
1562
|
var existing = merged[current.name];
|
@@ -1697,8 +1572,6 @@ function mergeByName(modifiers) {
|
|
1697
1572
|
});
|
1698
1573
|
}
|
1699
1574
|
|
1700
|
-
var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
|
1701
|
-
var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
|
1702
1575
|
var DEFAULT_OPTIONS = {
|
1703
1576
|
placement: 'bottom',
|
1704
1577
|
modifiers: [],
|
@@ -1761,40 +1634,6 @@ function popperGenerator(generatorOptions) {
|
|
1761
1634
|
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
1762
1635
|
return m.enabled;
|
1763
1636
|
}); // Validate the provided modifiers so that the consumer will get warned
|
1764
|
-
// if one of the modifiers is invalid for any reason
|
1765
|
-
|
1766
|
-
if (process.env.NODE_ENV !== "production") {
|
1767
|
-
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
|
1768
|
-
var name = _ref.name;
|
1769
|
-
return name;
|
1770
|
-
});
|
1771
|
-
validateModifiers(modifiers);
|
1772
|
-
|
1773
|
-
if (getBasePlacement(state.options.placement) === auto) {
|
1774
|
-
var flipModifier = state.orderedModifiers.find(function (_ref2) {
|
1775
|
-
var name = _ref2.name;
|
1776
|
-
return name === 'flip';
|
1777
|
-
});
|
1778
|
-
|
1779
|
-
if (!flipModifier) {
|
1780
|
-
console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
|
1781
|
-
}
|
1782
|
-
}
|
1783
|
-
|
1784
|
-
var _getComputedStyle = getComputedStyle(popper),
|
1785
|
-
marginTop = _getComputedStyle.marginTop,
|
1786
|
-
marginRight = _getComputedStyle.marginRight,
|
1787
|
-
marginBottom = _getComputedStyle.marginBottom,
|
1788
|
-
marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
|
1789
|
-
// cause bugs with positioning, so we'll warn the consumer
|
1790
|
-
|
1791
|
-
|
1792
|
-
if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
|
1793
|
-
return parseFloat(margin);
|
1794
|
-
})) {
|
1795
|
-
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
|
1796
|
-
}
|
1797
|
-
}
|
1798
1637
|
|
1799
1638
|
runModifierEffects();
|
1800
1639
|
return instance.update();
|
@@ -1815,9 +1654,6 @@ function popperGenerator(generatorOptions) {
|
|
1815
1654
|
// anymore
|
1816
1655
|
|
1817
1656
|
if (!areValidElements(reference, popper)) {
|
1818
|
-
if (process.env.NODE_ENV !== "production") {
|
1819
|
-
console.error(INVALID_ELEMENT_ERROR);
|
1820
|
-
}
|
1821
1657
|
|
1822
1658
|
return;
|
1823
1659
|
} // Store the reference and popper rects to be read by modifiers
|
@@ -1841,17 +1677,8 @@ function popperGenerator(generatorOptions) {
|
|
1841
1677
|
state.orderedModifiers.forEach(function (modifier) {
|
1842
1678
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
1843
1679
|
});
|
1844
|
-
var __debug_loops__ = 0;
|
1845
1680
|
|
1846
1681
|
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
1847
|
-
if (process.env.NODE_ENV !== "production") {
|
1848
|
-
__debug_loops__ += 1;
|
1849
|
-
|
1850
|
-
if (__debug_loops__ > 100) {
|
1851
|
-
console.error(INFINITE_LOOP_ERROR);
|
1852
|
-
break;
|
1853
|
-
}
|
1854
|
-
}
|
1855
1682
|
|
1856
1683
|
if (state.reset === true) {
|
1857
1684
|
state.reset = false;
|
@@ -1890,9 +1717,6 @@ function popperGenerator(generatorOptions) {
|
|
1890
1717
|
};
|
1891
1718
|
|
1892
1719
|
if (!areValidElements(reference, popper)) {
|
1893
|
-
if (process.env.NODE_ENV !== "production") {
|
1894
|
-
console.error(INVALID_ELEMENT_ERROR);
|
1895
|
-
}
|
1896
1720
|
|
1897
1721
|
return instance;
|
1898
1722
|
}
|
@@ -1964,10 +1788,6 @@ var TOUCH_OPTIONS = {
|
|
1964
1788
|
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
|
1965
1789
|
return document.body;
|
1966
1790
|
};
|
1967
|
-
|
1968
|
-
function hasOwnProperty(obj, key) {
|
1969
|
-
return {}.hasOwnProperty.call(obj, key);
|
1970
|
-
}
|
1971
1791
|
function getValueAtIndexOrReturn(value, index, defaultValue) {
|
1972
1792
|
if (Array.isArray(value)) {
|
1973
1793
|
var v = value[index];
|
@@ -2211,61 +2031,6 @@ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'
|
|
2211
2031
|
var isIE11 = isBrowser ? // @ts-ignore
|
2212
2032
|
!!window.msCrypto : false;
|
2213
2033
|
|
2214
|
-
function createMemoryLeakWarning(method) {
|
2215
|
-
var txt = method === 'destroy' ? 'n already-' : ' ';
|
2216
|
-
return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' ');
|
2217
|
-
}
|
2218
|
-
function clean(value) {
|
2219
|
-
var spacesAndTabs = /[ \t]{2,}/g;
|
2220
|
-
var lineStartWithSpaces = /^[ \t]*/gm;
|
2221
|
-
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
|
2222
|
-
}
|
2223
|
-
|
2224
|
-
function getDevMessage(message) {
|
2225
|
-
return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n ");
|
2226
|
-
}
|
2227
|
-
|
2228
|
-
function getFormattedMessage(message) {
|
2229
|
-
return [getDevMessage(message), // title
|
2230
|
-
'color: #00C584; font-size: 1.3em; font-weight: bold;', // message
|
2231
|
-
'line-height: 1.5', // footer
|
2232
|
-
'color: #a6a095;'];
|
2233
|
-
} // Assume warnings and errors never have the same message
|
2234
|
-
|
2235
|
-
var visitedMessages;
|
2236
|
-
|
2237
|
-
if (process.env.NODE_ENV !== "production") {
|
2238
|
-
resetVisitedMessages();
|
2239
|
-
}
|
2240
|
-
|
2241
|
-
function resetVisitedMessages() {
|
2242
|
-
visitedMessages = new Set();
|
2243
|
-
}
|
2244
|
-
function warnWhen(condition, message) {
|
2245
|
-
if (condition && !visitedMessages.has(message)) {
|
2246
|
-
var _console;
|
2247
|
-
|
2248
|
-
visitedMessages.add(message);
|
2249
|
-
|
2250
|
-
(_console = console).warn.apply(_console, getFormattedMessage(message));
|
2251
|
-
}
|
2252
|
-
}
|
2253
|
-
function errorWhen(condition, message) {
|
2254
|
-
if (condition && !visitedMessages.has(message)) {
|
2255
|
-
var _console2;
|
2256
|
-
|
2257
|
-
visitedMessages.add(message);
|
2258
|
-
|
2259
|
-
(_console2 = console).error.apply(_console2, getFormattedMessage(message));
|
2260
|
-
}
|
2261
|
-
}
|
2262
|
-
function validateTargets(targets) {
|
2263
|
-
var didPassFalsyValue = !targets;
|
2264
|
-
var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
|
2265
|
-
errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
|
2266
|
-
errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
|
2267
|
-
}
|
2268
|
-
|
2269
2034
|
var pluginProps = {
|
2270
2035
|
animateFill: false,
|
2271
2036
|
followCursor: false,
|
@@ -2322,10 +2087,6 @@ var defaultProps = Object.assign({
|
|
2322
2087
|
}, pluginProps, renderProps);
|
2323
2088
|
var defaultKeys = Object.keys(defaultProps);
|
2324
2089
|
var setDefaultProps = function setDefaultProps(partialProps) {
|
2325
|
-
/* istanbul ignore else */
|
2326
|
-
if (process.env.NODE_ENV !== "production") {
|
2327
|
-
validateProps(partialProps, []);
|
2328
|
-
}
|
2329
2090
|
|
2330
2091
|
var keys = Object.keys(partialProps);
|
2331
2092
|
keys.forEach(function (key) {
|
@@ -2384,29 +2145,6 @@ function evaluateProps(reference, props) {
|
|
2384
2145
|
};
|
2385
2146
|
return out;
|
2386
2147
|
}
|
2387
|
-
function validateProps(partialProps, plugins) {
|
2388
|
-
if (partialProps === void 0) {
|
2389
|
-
partialProps = {};
|
2390
|
-
}
|
2391
|
-
|
2392
|
-
if (plugins === void 0) {
|
2393
|
-
plugins = [];
|
2394
|
-
}
|
2395
|
-
|
2396
|
-
var keys = Object.keys(partialProps);
|
2397
|
-
keys.forEach(function (prop) {
|
2398
|
-
var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));
|
2399
|
-
var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins`
|
2400
|
-
|
2401
|
-
if (didPassUnknownProp) {
|
2402
|
-
didPassUnknownProp = plugins.filter(function (plugin) {
|
2403
|
-
return plugin.name === prop;
|
2404
|
-
}).length === 0;
|
2405
|
-
}
|
2406
|
-
|
2407
|
-
warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", 'a plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));
|
2408
|
-
});
|
2409
|
-
}
|
2410
2148
|
|
2411
2149
|
var innerHTML = function innerHTML() {
|
2412
2150
|
return 'innerHTML';
|
@@ -2599,9 +2337,6 @@ function createTippy(reference, passedProps) {
|
|
2599
2337
|
/* istanbul ignore if */
|
2600
2338
|
|
2601
2339
|
if (!props.render) {
|
2602
|
-
if (process.env.NODE_ENV !== "production") {
|
2603
|
-
errorWhen(true, 'render() function has not been supplied.');
|
2604
|
-
}
|
2605
2340
|
|
2606
2341
|
return instance;
|
2607
2342
|
} // ===========================================================================
|
@@ -3148,12 +2883,6 @@ function createTippy(reference, passedProps) {
|
|
3148
2883
|
|
3149
2884
|
instance.state.isMounted = true;
|
3150
2885
|
createPopperInstance();
|
3151
|
-
/* istanbul ignore else */
|
3152
|
-
|
3153
|
-
if (process.env.NODE_ENV !== "production") {
|
3154
|
-
// Accessibility check
|
3155
|
-
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(' '));
|
3156
|
-
}
|
3157
2886
|
}
|
3158
2887
|
|
3159
2888
|
function getNestedPopperTree() {
|
@@ -3242,10 +2971,6 @@ function createTippy(reference, passedProps) {
|
|
3242
2971
|
}
|
3243
2972
|
|
3244
2973
|
function setProps(partialProps) {
|
3245
|
-
/* istanbul ignore else */
|
3246
|
-
if (process.env.NODE_ENV !== "production") {
|
3247
|
-
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
|
3248
|
-
}
|
3249
2974
|
|
3250
2975
|
if (instance.state.isDestroyed) {
|
3251
2976
|
return;
|
@@ -3304,10 +3029,6 @@ function createTippy(reference, passedProps) {
|
|
3304
3029
|
}
|
3305
3030
|
|
3306
3031
|
function show() {
|
3307
|
-
/* istanbul ignore else */
|
3308
|
-
if (process.env.NODE_ENV !== "production") {
|
3309
|
-
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
|
3310
|
-
} // Early bail-out
|
3311
3032
|
|
3312
3033
|
|
3313
3034
|
var isAlreadyVisible = instance.state.isVisible;
|
@@ -3397,10 +3118,6 @@ function createTippy(reference, passedProps) {
|
|
3397
3118
|
}
|
3398
3119
|
|
3399
3120
|
function hide() {
|
3400
|
-
/* istanbul ignore else */
|
3401
|
-
if (process.env.NODE_ENV !== "production") {
|
3402
|
-
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
|
3403
|
-
} // Early bail-out
|
3404
3121
|
|
3405
3122
|
|
3406
3123
|
var isAlreadyHidden = !instance.state.isVisible;
|
@@ -3455,10 +3172,6 @@ function createTippy(reference, passedProps) {
|
|
3455
3172
|
}
|
3456
3173
|
|
3457
3174
|
function hideWithInteractivity(event) {
|
3458
|
-
/* istanbul ignore else */
|
3459
|
-
if (process.env.NODE_ENV !== "production") {
|
3460
|
-
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
|
3461
|
-
}
|
3462
3175
|
|
3463
3176
|
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
3464
3177
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
@@ -3466,10 +3179,6 @@ function createTippy(reference, passedProps) {
|
|
3466
3179
|
}
|
3467
3180
|
|
3468
3181
|
function unmount() {
|
3469
|
-
/* istanbul ignore else */
|
3470
|
-
if (process.env.NODE_ENV !== "production") {
|
3471
|
-
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));
|
3472
|
-
}
|
3473
3182
|
|
3474
3183
|
if (instance.state.isVisible) {
|
3475
3184
|
instance.hide();
|
@@ -3499,10 +3208,6 @@ function createTippy(reference, passedProps) {
|
|
3499
3208
|
}
|
3500
3209
|
|
3501
3210
|
function destroy() {
|
3502
|
-
/* istanbul ignore else */
|
3503
|
-
if (process.env.NODE_ENV !== "production") {
|
3504
|
-
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
|
3505
|
-
}
|
3506
3211
|
|
3507
3212
|
if (instance.state.isDestroyed) {
|
3508
3213
|
return;
|
@@ -3523,25 +3228,12 @@ function tippy(targets, optionalProps) {
|
|
3523
3228
|
}
|
3524
3229
|
|
3525
3230
|
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
|
3526
|
-
/* istanbul ignore else */
|
3527
|
-
|
3528
|
-
if (process.env.NODE_ENV !== "production") {
|
3529
|
-
validateTargets(targets);
|
3530
|
-
validateProps(optionalProps, plugins);
|
3531
|
-
}
|
3532
3231
|
|
3533
3232
|
bindGlobalEventListeners();
|
3534
3233
|
var passedProps = Object.assign({}, optionalProps, {
|
3535
3234
|
plugins: plugins
|
3536
3235
|
});
|
3537
3236
|
var elements = getArrayOfElements(targets);
|
3538
|
-
/* istanbul ignore else */
|
3539
|
-
|
3540
|
-
if (process.env.NODE_ENV !== "production") {
|
3541
|
-
var isSingleContentElement = isElement$1(passedProps.content);
|
3542
|
-
var isMoreThanOneReferenceElement = elements.length > 1;
|
3543
|
-
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(' '));
|
3544
|
-
}
|
3545
3237
|
|
3546
3238
|
var instances = elements.reduce(function (acc, reference) {
|
3547
3239
|
var instance = reference && createTippy(reference, passedProps);
|
@@ -3596,11 +3288,6 @@ var createSingleton = function createSingleton(tippyInstances, optionalProps) {
|
|
3596
3288
|
optionalProps = {};
|
3597
3289
|
}
|
3598
3290
|
|
3599
|
-
/* istanbul ignore else */
|
3600
|
-
if (process.env.NODE_ENV !== "production") {
|
3601
|
-
errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));
|
3602
|
-
}
|
3603
|
-
|
3604
3291
|
var individualInstances = tippyInstances;
|
3605
3292
|
var references = [];
|
3606
3293
|
var triggerTargets = [];
|
@@ -3800,9 +3487,6 @@ var animateFill = {
|
|
3800
3487
|
|
3801
3488
|
// @ts-ignore
|
3802
3489
|
if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
|
3803
|
-
if (process.env.NODE_ENV !== "production") {
|
3804
|
-
errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');
|
3805
|
-
}
|
3806
3490
|
|
3807
3491
|
return {};
|
3808
3492
|
}
|
@@ -4322,8 +4006,13 @@ function useTippy(el, opts = {}, settings = { mount: true }) {
|
|
4322
4006
|
? options.triggerTarget.value
|
4323
4007
|
: options.triggerTarget;
|
4324
4008
|
}
|
4009
|
+
if (!options.plugins || !Array.isArray(options.plugins)) {
|
4010
|
+
options.plugins = [];
|
4011
|
+
}
|
4012
|
+
options.plugins = options.plugins.filter((plugin) => plugin.name !== 'vueTippyReactiveState');
|
4325
4013
|
options.plugins.push({
|
4326
|
-
|
4014
|
+
name: 'vueTippyReactiveState',
|
4015
|
+
fn: () => {
|
4327
4016
|
return {
|
4328
4017
|
onCreate() {
|
4329
4018
|
state.value.isEnabled = true;
|