vue-tippy 6.0.0-alpha.35 → 6.0.0-alpha.39
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{vue-tippy.cjs.js → vue-tippy.cjs} +328 -10
- package/dist/vue-tippy.d.ts +1 -0
- package/dist/{vue-tippy.esm-bundler.js → vue-tippy.esm-browser.js} +329 -11
- package/dist/vue-tippy.iife.js +328 -10
- package/dist/vue-tippy.iife.prod.js +6 -0
- package/dist/vue-tippy.mjs +4582 -0
- package/dist/{vue-tippy.cjs.prod.js → vue-tippy.prod.cjs} +328 -10
- package/index.cjs +7 -0
- package/index.js +2 -2
- package/package.json +18 -9
- package/dist/vue-tippy.global.prod.js +0 -6
- package/index.mjs +0 -1
package/dist/vue-tippy.iife.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* vue-tippy v6.0.0-alpha.
|
3
|
-
* (c) 2021
|
2
|
+
* vue-tippy v6.0.0-alpha.39
|
3
|
+
* (c) 2021
|
4
4
|
* @license MIT
|
5
5
|
*/
|
6
6
|
var VueTippy = (function (exports, vue) {
|
@@ -408,7 +408,16 @@ var VueTippy = (function (exports, vue) {
|
|
408
408
|
}
|
409
409
|
}
|
410
410
|
|
411
|
+
if (process.env.NODE_ENV !== "production") {
|
412
|
+
if (!isHTMLElement(arrowElement)) {
|
413
|
+
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(' '));
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
411
417
|
if (!contains(state.elements.popper, arrowElement)) {
|
418
|
+
if (process.env.NODE_ENV !== "production") {
|
419
|
+
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
|
420
|
+
}
|
412
421
|
|
413
422
|
return;
|
414
423
|
}
|
@@ -526,6 +535,16 @@ var VueTippy = (function (exports, vue) {
|
|
526
535
|
_options$roundOffsets = options.roundOffsets,
|
527
536
|
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
528
537
|
|
538
|
+
if (process.env.NODE_ENV !== "production") {
|
539
|
+
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
|
540
|
+
|
541
|
+
if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
|
542
|
+
return transitionProperty.indexOf(property) >= 0;
|
543
|
+
})) {
|
544
|
+
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(' '));
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
529
548
|
var commonStyles = {
|
530
549
|
placement: getBasePlacement(state.placement),
|
531
550
|
popper: state.elements.popper,
|
@@ -977,6 +996,10 @@ var VueTippy = (function (exports, vue) {
|
|
977
996
|
|
978
997
|
if (allowedPlacements.length === 0) {
|
979
998
|
allowedPlacements = placements$1;
|
999
|
+
|
1000
|
+
if (process.env.NODE_ENV !== "production") {
|
1001
|
+
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(' '));
|
1002
|
+
}
|
980
1003
|
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
981
1004
|
|
982
1005
|
|
@@ -1501,6 +1524,103 @@ var VueTippy = (function (exports, vue) {
|
|
1501
1524
|
};
|
1502
1525
|
}
|
1503
1526
|
|
1527
|
+
function format(str) {
|
1528
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1529
|
+
args[_key - 1] = arguments[_key];
|
1530
|
+
}
|
1531
|
+
|
1532
|
+
return [].concat(args).reduce(function (p, c) {
|
1533
|
+
return p.replace(/%s/, c);
|
1534
|
+
}, str);
|
1535
|
+
}
|
1536
|
+
|
1537
|
+
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
1538
|
+
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
1539
|
+
var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
|
1540
|
+
function validateModifiers(modifiers) {
|
1541
|
+
modifiers.forEach(function (modifier) {
|
1542
|
+
Object.keys(modifier).forEach(function (key) {
|
1543
|
+
switch (key) {
|
1544
|
+
case 'name':
|
1545
|
+
if (typeof modifier.name !== 'string') {
|
1546
|
+
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
|
1547
|
+
}
|
1548
|
+
|
1549
|
+
break;
|
1550
|
+
|
1551
|
+
case 'enabled':
|
1552
|
+
if (typeof modifier.enabled !== 'boolean') {
|
1553
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
|
1554
|
+
}
|
1555
|
+
|
1556
|
+
case 'phase':
|
1557
|
+
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
1558
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
break;
|
1562
|
+
|
1563
|
+
case 'fn':
|
1564
|
+
if (typeof modifier.fn !== 'function') {
|
1565
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1566
|
+
}
|
1567
|
+
|
1568
|
+
break;
|
1569
|
+
|
1570
|
+
case 'effect':
|
1571
|
+
if (typeof modifier.effect !== 'function') {
|
1572
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1573
|
+
}
|
1574
|
+
|
1575
|
+
break;
|
1576
|
+
|
1577
|
+
case 'requires':
|
1578
|
+
if (!Array.isArray(modifier.requires)) {
|
1579
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
|
1580
|
+
}
|
1581
|
+
|
1582
|
+
break;
|
1583
|
+
|
1584
|
+
case 'requiresIfExists':
|
1585
|
+
if (!Array.isArray(modifier.requiresIfExists)) {
|
1586
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
break;
|
1590
|
+
|
1591
|
+
case 'options':
|
1592
|
+
case 'data':
|
1593
|
+
break;
|
1594
|
+
|
1595
|
+
default:
|
1596
|
+
console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
|
1597
|
+
return "\"" + s + "\"";
|
1598
|
+
}).join(', ') + "; but \"" + key + "\" was provided.");
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
modifier.requires && modifier.requires.forEach(function (requirement) {
|
1602
|
+
if (modifiers.find(function (mod) {
|
1603
|
+
return mod.name === requirement;
|
1604
|
+
}) == null) {
|
1605
|
+
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
1606
|
+
}
|
1607
|
+
});
|
1608
|
+
});
|
1609
|
+
});
|
1610
|
+
}
|
1611
|
+
|
1612
|
+
function uniqueBy(arr, fn) {
|
1613
|
+
var identifiers = new Set();
|
1614
|
+
return arr.filter(function (item) {
|
1615
|
+
var identifier = fn(item);
|
1616
|
+
|
1617
|
+
if (!identifiers.has(identifier)) {
|
1618
|
+
identifiers.add(identifier);
|
1619
|
+
return true;
|
1620
|
+
}
|
1621
|
+
});
|
1622
|
+
}
|
1623
|
+
|
1504
1624
|
function mergeByName(modifiers) {
|
1505
1625
|
var merged = modifiers.reduce(function (merged, current) {
|
1506
1626
|
var existing = merged[current.name];
|
@@ -1516,6 +1636,8 @@ var VueTippy = (function (exports, vue) {
|
|
1516
1636
|
});
|
1517
1637
|
}
|
1518
1638
|
|
1639
|
+
var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
|
1640
|
+
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.';
|
1519
1641
|
var DEFAULT_OPTIONS = {
|
1520
1642
|
placement: 'bottom',
|
1521
1643
|
modifiers: [],
|
@@ -1577,6 +1699,40 @@ var VueTippy = (function (exports, vue) {
|
|
1577
1699
|
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
1578
1700
|
return m.enabled;
|
1579
1701
|
}); // Validate the provided modifiers so that the consumer will get warned
|
1702
|
+
// if one of the modifiers is invalid for any reason
|
1703
|
+
|
1704
|
+
if (process.env.NODE_ENV !== "production") {
|
1705
|
+
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
|
1706
|
+
var name = _ref.name;
|
1707
|
+
return name;
|
1708
|
+
});
|
1709
|
+
validateModifiers(modifiers);
|
1710
|
+
|
1711
|
+
if (getBasePlacement(state.options.placement) === auto) {
|
1712
|
+
var flipModifier = state.orderedModifiers.find(function (_ref2) {
|
1713
|
+
var name = _ref2.name;
|
1714
|
+
return name === 'flip';
|
1715
|
+
});
|
1716
|
+
|
1717
|
+
if (!flipModifier) {
|
1718
|
+
console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
|
1719
|
+
}
|
1720
|
+
}
|
1721
|
+
|
1722
|
+
var _getComputedStyle = getComputedStyle(popper),
|
1723
|
+
marginTop = _getComputedStyle.marginTop,
|
1724
|
+
marginRight = _getComputedStyle.marginRight,
|
1725
|
+
marginBottom = _getComputedStyle.marginBottom,
|
1726
|
+
marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
|
1727
|
+
// cause bugs with positioning, so we'll warn the consumer
|
1728
|
+
|
1729
|
+
|
1730
|
+
if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
|
1731
|
+
return parseFloat(margin);
|
1732
|
+
})) {
|
1733
|
+
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(' '));
|
1734
|
+
}
|
1735
|
+
}
|
1580
1736
|
|
1581
1737
|
runModifierEffects();
|
1582
1738
|
return instance.update();
|
@@ -1597,6 +1753,9 @@ var VueTippy = (function (exports, vue) {
|
|
1597
1753
|
// anymore
|
1598
1754
|
|
1599
1755
|
if (!areValidElements(reference, popper)) {
|
1756
|
+
if (process.env.NODE_ENV !== "production") {
|
1757
|
+
console.error(INVALID_ELEMENT_ERROR);
|
1758
|
+
}
|
1600
1759
|
|
1601
1760
|
return;
|
1602
1761
|
} // Store the reference and popper rects to be read by modifiers
|
@@ -1620,8 +1779,17 @@ var VueTippy = (function (exports, vue) {
|
|
1620
1779
|
state.orderedModifiers.forEach(function (modifier) {
|
1621
1780
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
1622
1781
|
});
|
1782
|
+
var __debug_loops__ = 0;
|
1623
1783
|
|
1624
1784
|
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
1785
|
+
if (process.env.NODE_ENV !== "production") {
|
1786
|
+
__debug_loops__ += 1;
|
1787
|
+
|
1788
|
+
if (__debug_loops__ > 100) {
|
1789
|
+
console.error(INFINITE_LOOP_ERROR);
|
1790
|
+
break;
|
1791
|
+
}
|
1792
|
+
}
|
1625
1793
|
|
1626
1794
|
if (state.reset === true) {
|
1627
1795
|
state.reset = false;
|
@@ -1660,6 +1828,9 @@ var VueTippy = (function (exports, vue) {
|
|
1660
1828
|
};
|
1661
1829
|
|
1662
1830
|
if (!areValidElements(reference, popper)) {
|
1831
|
+
if (process.env.NODE_ENV !== "production") {
|
1832
|
+
console.error(INVALID_ELEMENT_ERROR);
|
1833
|
+
}
|
1663
1834
|
|
1664
1835
|
return instance;
|
1665
1836
|
}
|
@@ -1728,6 +1899,10 @@ var VueTippy = (function (exports, vue) {
|
|
1728
1899
|
passive: true,
|
1729
1900
|
capture: true
|
1730
1901
|
};
|
1902
|
+
|
1903
|
+
function hasOwnProperty(obj, key) {
|
1904
|
+
return {}.hasOwnProperty.call(obj, key);
|
1905
|
+
}
|
1731
1906
|
function getValueAtIndexOrReturn(value, index, defaultValue) {
|
1732
1907
|
if (Array.isArray(value)) {
|
1733
1908
|
var v = value[index];
|
@@ -1951,6 +2126,61 @@ var VueTippy = (function (exports, vue) {
|
|
1951
2126
|
var ua = isBrowser ? navigator.userAgent : '';
|
1952
2127
|
var isIE = /MSIE |Trident\//.test(ua);
|
1953
2128
|
|
2129
|
+
function createMemoryLeakWarning(method) {
|
2130
|
+
var txt = method === 'destroy' ? 'n already-' : ' ';
|
2131
|
+
return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' ');
|
2132
|
+
}
|
2133
|
+
function clean(value) {
|
2134
|
+
var spacesAndTabs = /[ \t]{2,}/g;
|
2135
|
+
var lineStartWithSpaces = /^[ \t]*/gm;
|
2136
|
+
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
|
2137
|
+
}
|
2138
|
+
|
2139
|
+
function getDevMessage(message) {
|
2140
|
+
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 ");
|
2141
|
+
}
|
2142
|
+
|
2143
|
+
function getFormattedMessage(message) {
|
2144
|
+
return [getDevMessage(message), // title
|
2145
|
+
'color: #00C584; font-size: 1.3em; font-weight: bold;', // message
|
2146
|
+
'line-height: 1.5', // footer
|
2147
|
+
'color: #a6a095;'];
|
2148
|
+
} // Assume warnings and errors never have the same message
|
2149
|
+
|
2150
|
+
var visitedMessages;
|
2151
|
+
|
2152
|
+
if (process.env.NODE_ENV !== "production") {
|
2153
|
+
resetVisitedMessages();
|
2154
|
+
}
|
2155
|
+
|
2156
|
+
function resetVisitedMessages() {
|
2157
|
+
visitedMessages = new Set();
|
2158
|
+
}
|
2159
|
+
function warnWhen(condition, message) {
|
2160
|
+
if (condition && !visitedMessages.has(message)) {
|
2161
|
+
var _console;
|
2162
|
+
|
2163
|
+
visitedMessages.add(message);
|
2164
|
+
|
2165
|
+
(_console = console).warn.apply(_console, getFormattedMessage(message));
|
2166
|
+
}
|
2167
|
+
}
|
2168
|
+
function errorWhen(condition, message) {
|
2169
|
+
if (condition && !visitedMessages.has(message)) {
|
2170
|
+
var _console2;
|
2171
|
+
|
2172
|
+
visitedMessages.add(message);
|
2173
|
+
|
2174
|
+
(_console2 = console).error.apply(_console2, getFormattedMessage(message));
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
function validateTargets(targets) {
|
2178
|
+
var didPassFalsyValue = !targets;
|
2179
|
+
var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
|
2180
|
+
errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
|
2181
|
+
errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
|
2182
|
+
}
|
2183
|
+
|
1954
2184
|
var pluginProps = {
|
1955
2185
|
animateFill: false,
|
1956
2186
|
followCursor: false,
|
@@ -2009,6 +2239,10 @@ var VueTippy = (function (exports, vue) {
|
|
2009
2239
|
}, pluginProps, {}, renderProps);
|
2010
2240
|
var defaultKeys = Object.keys(defaultProps);
|
2011
2241
|
var setDefaultProps = function setDefaultProps(partialProps) {
|
2242
|
+
/* istanbul ignore else */
|
2243
|
+
if (process.env.NODE_ENV !== "production") {
|
2244
|
+
validateProps(partialProps, []);
|
2245
|
+
}
|
2012
2246
|
|
2013
2247
|
var keys = Object.keys(partialProps);
|
2014
2248
|
keys.forEach(function (key) {
|
@@ -2065,6 +2299,29 @@ var VueTippy = (function (exports, vue) {
|
|
2065
2299
|
};
|
2066
2300
|
return out;
|
2067
2301
|
}
|
2302
|
+
function validateProps(partialProps, plugins) {
|
2303
|
+
if (partialProps === void 0) {
|
2304
|
+
partialProps = {};
|
2305
|
+
}
|
2306
|
+
|
2307
|
+
if (plugins === void 0) {
|
2308
|
+
plugins = [];
|
2309
|
+
}
|
2310
|
+
|
2311
|
+
var keys = Object.keys(partialProps);
|
2312
|
+
keys.forEach(function (prop) {
|
2313
|
+
var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));
|
2314
|
+
var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins`
|
2315
|
+
|
2316
|
+
if (didPassUnknownProp) {
|
2317
|
+
didPassUnknownProp = plugins.filter(function (plugin) {
|
2318
|
+
return plugin.name === prop;
|
2319
|
+
}).length === 0;
|
2320
|
+
}
|
2321
|
+
|
2322
|
+
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(' '));
|
2323
|
+
});
|
2324
|
+
}
|
2068
2325
|
|
2069
2326
|
var innerHTML = function innerHTML() {
|
2070
2327
|
return 'innerHTML';
|
@@ -2257,6 +2514,9 @@ var VueTippy = (function (exports, vue) {
|
|
2257
2514
|
/* istanbul ignore if */
|
2258
2515
|
|
2259
2516
|
if (!props.render) {
|
2517
|
+
if (process.env.NODE_ENV !== "production") {
|
2518
|
+
errorWhen(true, 'render() function has not been supplied.');
|
2519
|
+
}
|
2260
2520
|
|
2261
2521
|
return instance;
|
2262
2522
|
} // ===========================================================================
|
@@ -2796,6 +3056,12 @@ var VueTippy = (function (exports, vue) {
|
|
2796
3056
|
}
|
2797
3057
|
|
2798
3058
|
createPopperInstance();
|
3059
|
+
/* istanbul ignore else */
|
3060
|
+
|
3061
|
+
if (process.env.NODE_ENV !== "production") {
|
3062
|
+
// Accessibility check
|
3063
|
+
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(' '));
|
3064
|
+
}
|
2799
3065
|
}
|
2800
3066
|
|
2801
3067
|
function getNestedPopperTree() {
|
@@ -2884,6 +3150,10 @@ var VueTippy = (function (exports, vue) {
|
|
2884
3150
|
}
|
2885
3151
|
|
2886
3152
|
function setProps(partialProps) {
|
3153
|
+
/* istanbul ignore else */
|
3154
|
+
if (process.env.NODE_ENV !== "production") {
|
3155
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
|
3156
|
+
}
|
2887
3157
|
|
2888
3158
|
if (instance.state.isDestroyed) {
|
2889
3159
|
return;
|
@@ -2942,6 +3212,10 @@ var VueTippy = (function (exports, vue) {
|
|
2942
3212
|
}
|
2943
3213
|
|
2944
3214
|
function show() {
|
3215
|
+
/* istanbul ignore else */
|
3216
|
+
if (process.env.NODE_ENV !== "production") {
|
3217
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
|
3218
|
+
} // Early bail-out
|
2945
3219
|
|
2946
3220
|
|
2947
3221
|
var isAlreadyVisible = instance.state.isVisible;
|
@@ -3032,6 +3306,10 @@ var VueTippy = (function (exports, vue) {
|
|
3032
3306
|
}
|
3033
3307
|
|
3034
3308
|
function hide() {
|
3309
|
+
/* istanbul ignore else */
|
3310
|
+
if (process.env.NODE_ENV !== "production") {
|
3311
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
|
3312
|
+
} // Early bail-out
|
3035
3313
|
|
3036
3314
|
|
3037
3315
|
var isAlreadyHidden = !instance.state.isVisible;
|
@@ -3086,6 +3364,10 @@ var VueTippy = (function (exports, vue) {
|
|
3086
3364
|
}
|
3087
3365
|
|
3088
3366
|
function hideWithInteractivity(event) {
|
3367
|
+
/* istanbul ignore else */
|
3368
|
+
if (process.env.NODE_ENV !== "production") {
|
3369
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
|
3370
|
+
}
|
3089
3371
|
|
3090
3372
|
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
3091
3373
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
@@ -3093,6 +3375,10 @@ var VueTippy = (function (exports, vue) {
|
|
3093
3375
|
}
|
3094
3376
|
|
3095
3377
|
function unmount() {
|
3378
|
+
/* istanbul ignore else */
|
3379
|
+
if (process.env.NODE_ENV !== "production") {
|
3380
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));
|
3381
|
+
}
|
3096
3382
|
|
3097
3383
|
if (instance.state.isVisible) {
|
3098
3384
|
instance.hide();
|
@@ -3122,6 +3408,10 @@ var VueTippy = (function (exports, vue) {
|
|
3122
3408
|
}
|
3123
3409
|
|
3124
3410
|
function destroy() {
|
3411
|
+
/* istanbul ignore else */
|
3412
|
+
if (process.env.NODE_ENV !== "production") {
|
3413
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
|
3414
|
+
}
|
3125
3415
|
|
3126
3416
|
if (instance.state.isDestroyed) {
|
3127
3417
|
return;
|
@@ -3142,12 +3432,25 @@ var VueTippy = (function (exports, vue) {
|
|
3142
3432
|
}
|
3143
3433
|
|
3144
3434
|
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
|
3435
|
+
/* istanbul ignore else */
|
3436
|
+
|
3437
|
+
if (process.env.NODE_ENV !== "production") {
|
3438
|
+
validateTargets(targets);
|
3439
|
+
validateProps(optionalProps, plugins);
|
3440
|
+
}
|
3145
3441
|
|
3146
3442
|
bindGlobalEventListeners();
|
3147
3443
|
var passedProps = Object.assign({}, optionalProps, {
|
3148
3444
|
plugins: plugins
|
3149
3445
|
});
|
3150
3446
|
var elements = getArrayOfElements(targets);
|
3447
|
+
/* istanbul ignore else */
|
3448
|
+
|
3449
|
+
if (process.env.NODE_ENV !== "production") {
|
3450
|
+
var isSingleContentElement = isElement$1(passedProps.content);
|
3451
|
+
var isMoreThanOneReferenceElement = elements.length > 1;
|
3452
|
+
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(' '));
|
3453
|
+
}
|
3151
3454
|
|
3152
3455
|
var instances = elements.reduce(function (acc, reference) {
|
3153
3456
|
var instance = reference && createTippy(reference, passedProps);
|
@@ -3202,6 +3505,11 @@ var VueTippy = (function (exports, vue) {
|
|
3202
3505
|
optionalProps = {};
|
3203
3506
|
}
|
3204
3507
|
|
3508
|
+
/* istanbul ignore else */
|
3509
|
+
if (process.env.NODE_ENV !== "production") {
|
3510
|
+
errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));
|
3511
|
+
}
|
3512
|
+
|
3205
3513
|
var individualInstances = tippyInstances;
|
3206
3514
|
var references = [];
|
3207
3515
|
var currentTarget;
|
@@ -3388,6 +3696,9 @@ var VueTippy = (function (exports, vue) {
|
|
3388
3696
|
|
3389
3697
|
// @ts-ignore
|
3390
3698
|
if (!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy)) {
|
3699
|
+
if (process.env.NODE_ENV !== "production") {
|
3700
|
+
errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');
|
3701
|
+
}
|
3391
3702
|
|
3392
3703
|
return {};
|
3393
3704
|
}
|
@@ -4084,13 +4395,17 @@ var VueTippy = (function (exports, vue) {
|
|
4084
4395
|
setup(props, { slots }) {
|
4085
4396
|
const elem = vue.ref();
|
4086
4397
|
const contentElem = vue.ref();
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4398
|
+
const mounted = vue.ref(false);
|
4399
|
+
let options = { ...props };
|
4400
|
+
for (const prop of ['to', 'tag', 'contentTag', 'contentClass']) {
|
4401
|
+
if (options.hasOwnProperty(prop)) {
|
4402
|
+
// @ts-ignore
|
4403
|
+
delete options[prop];
|
4404
|
+
}
|
4090
4405
|
}
|
4091
4406
|
let target = elem;
|
4092
4407
|
if (props.to) {
|
4093
|
-
if (props.to instanceof Element) {
|
4408
|
+
if (typeof Element !== 'undefined' && props.to instanceof Element) {
|
4094
4409
|
target = () => props.to;
|
4095
4410
|
}
|
4096
4411
|
else if (typeof props.to === 'string' || props.to instanceof String) {
|
@@ -4099,16 +4414,19 @@ var VueTippy = (function (exports, vue) {
|
|
4099
4414
|
}
|
4100
4415
|
const tippy = useTippy(target, options);
|
4101
4416
|
vue.onMounted(() => {
|
4102
|
-
|
4103
|
-
|
4417
|
+
mounted.value = true;
|
4418
|
+
vue.nextTick(() => {
|
4419
|
+
if (slots.content)
|
4420
|
+
tippy.setContent(() => contentElem.value);
|
4421
|
+
});
|
4104
4422
|
});
|
4105
|
-
return { elem, contentElem, ...tippy };
|
4423
|
+
return { elem, contentElem, mounted, ...tippy };
|
4106
4424
|
},
|
4107
4425
|
render() {
|
4108
4426
|
let slot = this.$slots.default ? this.$slots.default(this) : [];
|
4109
4427
|
return vue.h(this.tag, { ref: 'elem', 'data-v-tippy': '' }, this.$slots.content ? [
|
4110
4428
|
slot,
|
4111
|
-
vue.h(this.contentTag, { ref: 'contentElem', class: this.contentClass }, this.$slots.content(this))
|
4429
|
+
vue.h(this.contentTag, { ref: 'contentElem', style: { display: this.mounted ? 'inherit' : 'none' }, class: this.contentClass }, this.$slots.content(this)),
|
4112
4430
|
] : slot);
|
4113
4431
|
},
|
4114
4432
|
});
|