vue-tippy 6.0.0-alpha.38 → 6.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-tippy.cjs +274 -110
- package/dist/vue-tippy.d.ts +17 -2
- package/dist/vue-tippy.esm-browser.js +275 -111
- package/dist/vue-tippy.iife.js +274 -110
- package/dist/vue-tippy.iife.prod.js +2 -2
- package/dist/vue-tippy.mjs +275 -111
- package/dist/vue-tippy.prod.cjs +274 -110
- package/package.json +2 -2
package/dist/vue-tippy.iife.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* vue-tippy v6.0.0-alpha.
|
2
|
+
* vue-tippy v6.0.0-alpha.41
|
3
3
|
* (c) 2021
|
4
4
|
* @license MIT
|
5
5
|
*/
|
@@ -162,17 +162,42 @@ var VueTippy = (function (exports, vue) {
|
|
162
162
|
return placement.split('-')[0];
|
163
163
|
}
|
164
164
|
|
165
|
-
|
165
|
+
var max = Math.max;
|
166
|
+
var min = Math.min;
|
167
|
+
var round = Math.round;
|
168
|
+
|
169
|
+
function getBoundingClientRect(element, includeScale) {
|
170
|
+
if (includeScale === void 0) {
|
171
|
+
includeScale = false;
|
172
|
+
}
|
173
|
+
|
166
174
|
var rect = element.getBoundingClientRect();
|
175
|
+
var scaleX = 1;
|
176
|
+
var scaleY = 1;
|
177
|
+
|
178
|
+
if (isHTMLElement(element) && includeScale) {
|
179
|
+
var offsetHeight = element.offsetHeight;
|
180
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
181
|
+
// Fallback to 1 in case both values are `0`
|
182
|
+
|
183
|
+
if (offsetWidth > 0) {
|
184
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
185
|
+
}
|
186
|
+
|
187
|
+
if (offsetHeight > 0) {
|
188
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
167
192
|
return {
|
168
|
-
width: rect.width,
|
169
|
-
height: rect.height,
|
170
|
-
top: rect.top,
|
171
|
-
right: rect.right,
|
172
|
-
bottom: rect.bottom,
|
173
|
-
left: rect.left,
|
174
|
-
x: rect.left,
|
175
|
-
y: rect.top
|
193
|
+
width: rect.width / scaleX,
|
194
|
+
height: rect.height / scaleY,
|
195
|
+
top: rect.top / scaleY,
|
196
|
+
right: rect.right / scaleX,
|
197
|
+
bottom: rect.bottom / scaleY,
|
198
|
+
left: rect.left / scaleX,
|
199
|
+
x: rect.left / scaleX,
|
200
|
+
y: rect.top / scaleY
|
176
201
|
};
|
177
202
|
}
|
178
203
|
|
@@ -317,13 +342,13 @@ var VueTippy = (function (exports, vue) {
|
|
317
342
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
318
343
|
}
|
319
344
|
|
320
|
-
var max = Math.max;
|
321
|
-
var min = Math.min;
|
322
|
-
var round = Math.round;
|
323
|
-
|
324
345
|
function within(min$1, value, max$1) {
|
325
346
|
return max(min$1, min(value, max$1));
|
326
347
|
}
|
348
|
+
function withinMaxClamp(min, value, max) {
|
349
|
+
var v = within(min, value, max);
|
350
|
+
return v > max ? max : v;
|
351
|
+
}
|
327
352
|
|
328
353
|
function getFreshSideObject() {
|
329
354
|
return {
|
@@ -436,6 +461,10 @@ var VueTippy = (function (exports, vue) {
|
|
436
461
|
requiresIfExists: ['preventOverflow']
|
437
462
|
};
|
438
463
|
|
464
|
+
function getVariation(placement) {
|
465
|
+
return placement.split('-')[1];
|
466
|
+
}
|
467
|
+
|
439
468
|
var unsetSides = {
|
440
469
|
top: 'auto',
|
441
470
|
right: 'auto',
|
@@ -451,8 +480,8 @@ var VueTippy = (function (exports, vue) {
|
|
451
480
|
var win = window;
|
452
481
|
var dpr = win.devicePixelRatio || 1;
|
453
482
|
return {
|
454
|
-
x: round(
|
455
|
-
y: round(
|
483
|
+
x: round(x * dpr) / dpr || 0,
|
484
|
+
y: round(y * dpr) / dpr || 0
|
456
485
|
};
|
457
486
|
}
|
458
487
|
|
@@ -462,11 +491,13 @@ var VueTippy = (function (exports, vue) {
|
|
462
491
|
var popper = _ref2.popper,
|
463
492
|
popperRect = _ref2.popperRect,
|
464
493
|
placement = _ref2.placement,
|
494
|
+
variation = _ref2.variation,
|
465
495
|
offsets = _ref2.offsets,
|
466
496
|
position = _ref2.position,
|
467
497
|
gpuAcceleration = _ref2.gpuAcceleration,
|
468
498
|
adaptive = _ref2.adaptive,
|
469
|
-
roundOffsets = _ref2.roundOffsets
|
499
|
+
roundOffsets = _ref2.roundOffsets,
|
500
|
+
isFixed = _ref2.isFixed;
|
470
501
|
|
471
502
|
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
472
503
|
_ref3$x = _ref3.x,
|
@@ -488,7 +519,7 @@ var VueTippy = (function (exports, vue) {
|
|
488
519
|
if (offsetParent === getWindow(popper)) {
|
489
520
|
offsetParent = getDocumentElement(popper);
|
490
521
|
|
491
|
-
if (getComputedStyle(offsetParent).position !== 'static') {
|
522
|
+
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
492
523
|
heightProp = 'scrollHeight';
|
493
524
|
widthProp = 'scrollWidth';
|
494
525
|
}
|
@@ -497,17 +528,19 @@ var VueTippy = (function (exports, vue) {
|
|
497
528
|
|
498
529
|
offsetParent = offsetParent;
|
499
530
|
|
500
|
-
if (placement === top) {
|
501
|
-
sideY = bottom;
|
502
|
-
|
503
|
-
|
531
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
532
|
+
sideY = bottom;
|
533
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
534
|
+
offsetParent[heightProp];
|
535
|
+
y -= offsetY - popperRect.height;
|
504
536
|
y *= gpuAcceleration ? 1 : -1;
|
505
537
|
}
|
506
538
|
|
507
|
-
if (placement === left) {
|
508
|
-
sideX = right;
|
509
|
-
|
510
|
-
|
539
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
540
|
+
sideX = right;
|
541
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
542
|
+
offsetParent[widthProp];
|
543
|
+
x -= offsetX - popperRect.width;
|
511
544
|
x *= gpuAcceleration ? 1 : -1;
|
512
545
|
}
|
513
546
|
}
|
@@ -519,7 +552,7 @@ var VueTippy = (function (exports, vue) {
|
|
519
552
|
if (gpuAcceleration) {
|
520
553
|
var _Object$assign;
|
521
554
|
|
522
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1)
|
555
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
523
556
|
}
|
524
557
|
|
525
558
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
@@ -547,9 +580,11 @@ var VueTippy = (function (exports, vue) {
|
|
547
580
|
|
548
581
|
var commonStyles = {
|
549
582
|
placement: getBasePlacement(state.placement),
|
583
|
+
variation: getVariation(state.placement),
|
550
584
|
popper: state.elements.popper,
|
551
585
|
popperRect: state.rects.popper,
|
552
|
-
gpuAcceleration: gpuAcceleration
|
586
|
+
gpuAcceleration: gpuAcceleration,
|
587
|
+
isFixed: state.options.strategy === 'fixed'
|
553
588
|
};
|
554
589
|
|
555
590
|
if (state.modifiersData.popperOffsets != null) {
|
@@ -807,7 +842,7 @@ var VueTippy = (function (exports, vue) {
|
|
807
842
|
}
|
808
843
|
|
809
844
|
function getClientRectFromMixedType(element, clippingParent) {
|
810
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
845
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
811
846
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
812
847
|
// clipping (or hiding) overflowing elements with a position different from
|
813
848
|
// `initial`
|
@@ -824,7 +859,7 @@ var VueTippy = (function (exports, vue) {
|
|
824
859
|
|
825
860
|
|
826
861
|
return clippingParents.filter(function (clippingParent) {
|
827
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
862
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true);
|
828
863
|
});
|
829
864
|
} // Gets the maximum area that the element is visible in due to any number of
|
830
865
|
// clipping parents
|
@@ -849,10 +884,6 @@ var VueTippy = (function (exports, vue) {
|
|
849
884
|
return clippingRect;
|
850
885
|
}
|
851
886
|
|
852
|
-
function getVariation(placement) {
|
853
|
-
return placement.split('-')[1];
|
854
|
-
}
|
855
|
-
|
856
887
|
function computeOffsets(_ref) {
|
857
888
|
var reference = _ref.reference,
|
858
889
|
element = _ref.element,
|
@@ -938,11 +969,10 @@ var VueTippy = (function (exports, vue) {
|
|
938
969
|
padding = _options$padding === void 0 ? 0 : _options$padding;
|
939
970
|
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
940
971
|
var altContext = elementContext === popper ? reference : popper;
|
941
|
-
var referenceElement = state.elements.reference;
|
942
972
|
var popperRect = state.rects.popper;
|
943
973
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
944
974
|
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
945
|
-
var referenceClientRect = getBoundingClientRect(
|
975
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
946
976
|
var popperOffsets = computeOffsets({
|
947
977
|
reference: referenceClientRect,
|
948
978
|
element: popperRect,
|
@@ -1329,6 +1359,14 @@ var VueTippy = (function (exports, vue) {
|
|
1329
1359
|
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
1330
1360
|
placement: state.placement
|
1331
1361
|
})) : tetherOffset;
|
1362
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
1363
|
+
mainAxis: tetherOffsetValue,
|
1364
|
+
altAxis: tetherOffsetValue
|
1365
|
+
} : Object.assign({
|
1366
|
+
mainAxis: 0,
|
1367
|
+
altAxis: 0
|
1368
|
+
}, tetherOffsetValue);
|
1369
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
1332
1370
|
var data = {
|
1333
1371
|
x: 0,
|
1334
1372
|
y: 0
|
@@ -1338,13 +1376,15 @@ var VueTippy = (function (exports, vue) {
|
|
1338
1376
|
return;
|
1339
1377
|
}
|
1340
1378
|
|
1341
|
-
if (checkMainAxis
|
1379
|
+
if (checkMainAxis) {
|
1380
|
+
var _offsetModifierState$;
|
1381
|
+
|
1342
1382
|
var mainSide = mainAxis === 'y' ? top : left;
|
1343
1383
|
var altSide = mainAxis === 'y' ? bottom : right;
|
1344
1384
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
1345
1385
|
var offset = popperOffsets[mainAxis];
|
1346
|
-
var min$1 =
|
1347
|
-
var max$1 =
|
1386
|
+
var min$1 = offset + overflow[mainSide];
|
1387
|
+
var max$1 = offset - overflow[altSide];
|
1348
1388
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
1349
1389
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
1350
1390
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
@@ -1364,36 +1404,45 @@ var VueTippy = (function (exports, vue) {
|
|
1364
1404
|
// width or height)
|
1365
1405
|
|
1366
1406
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
1367
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
1368
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
1407
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
1408
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
1369
1409
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
1370
1410
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
1371
|
-
var offsetModifierValue =
|
1372
|
-
var tetherMin =
|
1373
|
-
var tetherMax =
|
1411
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
1412
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
1413
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
1414
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
1415
|
+
popperOffsets[mainAxis] = preventedOffset;
|
1416
|
+
data[mainAxis] = preventedOffset - offset;
|
1417
|
+
}
|
1374
1418
|
|
1375
|
-
|
1376
|
-
|
1377
|
-
popperOffsets[mainAxis] = preventedOffset;
|
1378
|
-
data[mainAxis] = preventedOffset - offset;
|
1379
|
-
}
|
1419
|
+
if (checkAltAxis) {
|
1420
|
+
var _offsetModifierState$2;
|
1380
1421
|
|
1381
|
-
|
1382
|
-
var _mainSide = mainAxis === 'x' ? top : left;
|
1422
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
1383
1423
|
|
1384
|
-
|
1424
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
1385
1425
|
|
1386
|
-
|
1426
|
+
var _offset = popperOffsets[altAxis];
|
1387
1427
|
|
1388
|
-
|
1428
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
1389
1429
|
|
1390
|
-
|
1430
|
+
var _min = _offset + overflow[_mainSide];
|
1391
1431
|
|
1392
|
-
|
1432
|
+
var _max = _offset - overflow[_altSide];
|
1393
1433
|
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1434
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
1435
|
+
|
1436
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
1437
|
+
|
1438
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
1439
|
+
|
1440
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
1441
|
+
|
1442
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
1443
|
+
|
1444
|
+
popperOffsets[altAxis] = _preventedOffset;
|
1445
|
+
data[altAxis] = _preventedOffset - _offset;
|
1397
1446
|
}
|
1398
1447
|
|
1399
1448
|
state.modifiersData[name] = data;
|
@@ -1423,16 +1472,24 @@ var VueTippy = (function (exports, vue) {
|
|
1423
1472
|
}
|
1424
1473
|
}
|
1425
1474
|
|
1475
|
+
function isElementScaled(element) {
|
1476
|
+
var rect = element.getBoundingClientRect();
|
1477
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
1478
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
1479
|
+
return scaleX !== 1 || scaleY !== 1;
|
1480
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
1426
1481
|
// Composite means it takes into account transforms as well as layout.
|
1427
1482
|
|
1483
|
+
|
1428
1484
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
1429
1485
|
if (isFixed === void 0) {
|
1430
1486
|
isFixed = false;
|
1431
1487
|
}
|
1432
1488
|
|
1433
|
-
var documentElement = getDocumentElement(offsetParent);
|
1434
|
-
var rect = getBoundingClientRect(elementOrVirtualElement);
|
1435
1489
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
1490
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
1491
|
+
var documentElement = getDocumentElement(offsetParent);
|
1492
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
1436
1493
|
var scroll = {
|
1437
1494
|
scrollLeft: 0,
|
1438
1495
|
scrollTop: 0
|
@@ -1449,7 +1506,7 @@ var VueTippy = (function (exports, vue) {
|
|
1449
1506
|
}
|
1450
1507
|
|
1451
1508
|
if (isHTMLElement(offsetParent)) {
|
1452
|
-
offsets = getBoundingClientRect(offsetParent);
|
1509
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
1453
1510
|
offsets.x += offsetParent.clientLeft;
|
1454
1511
|
offsets.y += offsetParent.clientTop;
|
1455
1512
|
} else if (documentElement) {
|
@@ -1539,7 +1596,10 @@ var VueTippy = (function (exports, vue) {
|
|
1539
1596
|
var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
|
1540
1597
|
function validateModifiers(modifiers) {
|
1541
1598
|
modifiers.forEach(function (modifier) {
|
1542
|
-
Object.keys(modifier)
|
1599
|
+
[].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
|
1600
|
+
.filter(function (value, index, self) {
|
1601
|
+
return self.indexOf(value) === index;
|
1602
|
+
}).forEach(function (key) {
|
1543
1603
|
switch (key) {
|
1544
1604
|
case 'name':
|
1545
1605
|
if (typeof modifier.name !== 'string') {
|
@@ -1553,6 +1613,8 @@ var VueTippy = (function (exports, vue) {
|
|
1553
1613
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
|
1554
1614
|
}
|
1555
1615
|
|
1616
|
+
break;
|
1617
|
+
|
1556
1618
|
case 'phase':
|
1557
1619
|
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
1558
1620
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
|
@@ -1568,14 +1630,14 @@ var VueTippy = (function (exports, vue) {
|
|
1568
1630
|
break;
|
1569
1631
|
|
1570
1632
|
case 'effect':
|
1571
|
-
if (typeof modifier.effect !== 'function') {
|
1633
|
+
if (modifier.effect != null && typeof modifier.effect !== 'function') {
|
1572
1634
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
|
1573
1635
|
}
|
1574
1636
|
|
1575
1637
|
break;
|
1576
1638
|
|
1577
1639
|
case 'requires':
|
1578
|
-
if (!Array.isArray(modifier.requires)) {
|
1640
|
+
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
1579
1641
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
|
1580
1642
|
}
|
1581
1643
|
|
@@ -1685,7 +1747,8 @@ var VueTippy = (function (exports, vue) {
|
|
1685
1747
|
var isDestroyed = false;
|
1686
1748
|
var instance = {
|
1687
1749
|
state: state,
|
1688
|
-
setOptions: function setOptions(
|
1750
|
+
setOptions: function setOptions(setOptionsAction) {
|
1751
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
1689
1752
|
cleanupModifierEffects();
|
1690
1753
|
state.options = Object.assign({}, defaultOptions, state.options, options);
|
1691
1754
|
state.scrollParents = {
|
@@ -1884,7 +1947,7 @@ var VueTippy = (function (exports, vue) {
|
|
1884
1947
|
}); // eslint-disable-next-line import/no-unused-modules
|
1885
1948
|
|
1886
1949
|
/**!
|
1887
|
-
* tippy.js v6.3.
|
1950
|
+
* tippy.js v6.3.7
|
1888
1951
|
* (c) 2017-2021 atomiks
|
1889
1952
|
* MIT License
|
1890
1953
|
*/
|
@@ -1899,6 +1962,9 @@ var VueTippy = (function (exports, vue) {
|
|
1899
1962
|
passive: true,
|
1900
1963
|
capture: true
|
1901
1964
|
};
|
1965
|
+
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
|
1966
|
+
return document.body;
|
1967
|
+
};
|
1902
1968
|
|
1903
1969
|
function hasOwnProperty(obj, key) {
|
1904
1970
|
return {}.hasOwnProperty.call(obj, key);
|
@@ -2024,7 +2090,7 @@ var VueTippy = (function (exports, vue) {
|
|
2024
2090
|
element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
|
2025
2091
|
|
2026
2092
|
|
2027
|
-
return
|
2093
|
+
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
2028
2094
|
}
|
2029
2095
|
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
|
2030
2096
|
var clientX = event.clientX,
|
@@ -2060,6 +2126,26 @@ var VueTippy = (function (exports, vue) {
|
|
2060
2126
|
box[method](event, listener);
|
2061
2127
|
});
|
2062
2128
|
}
|
2129
|
+
/**
|
2130
|
+
* Compared to xxx.contains, this function works for dom structures with shadow
|
2131
|
+
* dom
|
2132
|
+
*/
|
2133
|
+
|
2134
|
+
function actualContains(parent, child) {
|
2135
|
+
var target = child;
|
2136
|
+
|
2137
|
+
while (target) {
|
2138
|
+
var _target$getRootNode;
|
2139
|
+
|
2140
|
+
if (parent.contains(target)) {
|
2141
|
+
return true;
|
2142
|
+
}
|
2143
|
+
|
2144
|
+
target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
|
2145
|
+
}
|
2146
|
+
|
2147
|
+
return false;
|
2148
|
+
}
|
2063
2149
|
|
2064
2150
|
var currentInput = {
|
2065
2151
|
isTouch: false
|
@@ -2123,8 +2209,8 @@ var VueTippy = (function (exports, vue) {
|
|
2123
2209
|
}
|
2124
2210
|
|
2125
2211
|
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
2126
|
-
var
|
2127
|
-
|
2212
|
+
var isIE11 = isBrowser ? // @ts-ignore
|
2213
|
+
!!window.msCrypto : false;
|
2128
2214
|
|
2129
2215
|
function createMemoryLeakWarning(method) {
|
2130
2216
|
var txt = method === 'destroy' ? 'n already-' : ' ';
|
@@ -2199,9 +2285,7 @@ var VueTippy = (function (exports, vue) {
|
|
2199
2285
|
zIndex: 9999
|
2200
2286
|
};
|
2201
2287
|
var defaultProps = Object.assign({
|
2202
|
-
appendTo:
|
2203
|
-
return document.body;
|
2204
|
-
},
|
2288
|
+
appendTo: TIPPY_DEFAULT_APPEND_TO,
|
2205
2289
|
aria: {
|
2206
2290
|
content: 'auto',
|
2207
2291
|
expanded: 'auto'
|
@@ -2236,7 +2320,7 @@ var VueTippy = (function (exports, vue) {
|
|
2236
2320
|
touch: true,
|
2237
2321
|
trigger: 'mouseenter focus',
|
2238
2322
|
triggerTarget: null
|
2239
|
-
}, pluginProps,
|
2323
|
+
}, pluginProps, renderProps);
|
2240
2324
|
var defaultKeys = Object.keys(defaultProps);
|
2241
2325
|
var setDefaultProps = function setDefaultProps(partialProps) {
|
2242
2326
|
/* istanbul ignore else */
|
@@ -2256,12 +2340,14 @@ var VueTippy = (function (exports, vue) {
|
|
2256
2340
|
defaultValue = plugin.defaultValue;
|
2257
2341
|
|
2258
2342
|
if (name) {
|
2259
|
-
|
2343
|
+
var _name;
|
2344
|
+
|
2345
|
+
acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
|
2260
2346
|
}
|
2261
2347
|
|
2262
2348
|
return acc;
|
2263
2349
|
}, {});
|
2264
|
-
return Object.assign({}, passedProps,
|
2350
|
+
return Object.assign({}, passedProps, pluginProps);
|
2265
2351
|
}
|
2266
2352
|
function getDataAttributeProps(reference, plugins) {
|
2267
2353
|
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
@@ -2292,7 +2378,7 @@ var VueTippy = (function (exports, vue) {
|
|
2292
2378
|
var out = Object.assign({}, props, {
|
2293
2379
|
content: invokeWithArgsOrReturn(props.content, [reference])
|
2294
2380
|
}, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
|
2295
|
-
out.aria = Object.assign({}, defaultProps.aria,
|
2381
|
+
out.aria = Object.assign({}, defaultProps.aria, out.aria);
|
2296
2382
|
out.aria = {
|
2297
2383
|
expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
|
2298
2384
|
content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
|
@@ -2453,7 +2539,7 @@ var VueTippy = (function (exports, vue) {
|
|
2453
2539
|
|
2454
2540
|
var mountedInstances = [];
|
2455
2541
|
function createTippy(reference, passedProps) {
|
2456
|
-
var props = evaluateProps(reference, Object.assign({}, defaultProps,
|
2542
|
+
var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
|
2457
2543
|
// 🔒 Private members
|
2458
2544
|
// ===========================================================================
|
2459
2545
|
|
@@ -2553,10 +2639,9 @@ var VueTippy = (function (exports, vue) {
|
|
2553
2639
|
instance.clearDelayTimeouts();
|
2554
2640
|
}
|
2555
2641
|
});
|
2556
|
-
popper.addEventListener('mouseleave', function (
|
2642
|
+
popper.addEventListener('mouseleave', function () {
|
2557
2643
|
if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
|
2558
2644
|
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
|
2559
|
-
debouncedOnMouseMove(event);
|
2560
2645
|
}
|
2561
2646
|
});
|
2562
2647
|
return instance; // ===========================================================================
|
@@ -2576,7 +2661,7 @@ var VueTippy = (function (exports, vue) {
|
|
2576
2661
|
var _instance$props$rende;
|
2577
2662
|
|
2578
2663
|
// @ts-ignore
|
2579
|
-
return !!((_instance$props$rende = instance.props.render)
|
2664
|
+
return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
|
2580
2665
|
}
|
2581
2666
|
|
2582
2667
|
function getCurrentTarget() {
|
@@ -2603,8 +2688,12 @@ var VueTippy = (function (exports, vue) {
|
|
2603
2688
|
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
|
2604
2689
|
}
|
2605
2690
|
|
2606
|
-
function handleStyles() {
|
2607
|
-
|
2691
|
+
function handleStyles(fromHide) {
|
2692
|
+
if (fromHide === void 0) {
|
2693
|
+
fromHide = false;
|
2694
|
+
}
|
2695
|
+
|
2696
|
+
popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
|
2608
2697
|
popper.style.zIndex = "" + instance.props.zIndex;
|
2609
2698
|
}
|
2610
2699
|
|
@@ -2615,7 +2704,7 @@ var VueTippy = (function (exports, vue) {
|
|
2615
2704
|
|
2616
2705
|
pluginsHooks.forEach(function (pluginHooks) {
|
2617
2706
|
if (pluginHooks[hook]) {
|
2618
|
-
pluginHooks[hook].apply(
|
2707
|
+
pluginHooks[hook].apply(pluginHooks, args);
|
2619
2708
|
}
|
2620
2709
|
});
|
2621
2710
|
|
@@ -2681,15 +2770,18 @@ var VueTippy = (function (exports, vue) {
|
|
2681
2770
|
if (didTouchMove || event.type === 'mousedown') {
|
2682
2771
|
return;
|
2683
2772
|
}
|
2684
|
-
}
|
2773
|
+
}
|
2685
2774
|
|
2775
|
+
var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
|
2686
2776
|
|
2687
|
-
if (instance.props.interactive && popper
|
2777
|
+
if (instance.props.interactive && actualContains(popper, actualTarget)) {
|
2688
2778
|
return;
|
2689
2779
|
} // Clicked on the event listeners target
|
2690
2780
|
|
2691
2781
|
|
2692
|
-
if (
|
2782
|
+
if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
|
2783
|
+
return actualContains(el, actualTarget);
|
2784
|
+
})) {
|
2693
2785
|
if (currentInput.isTouch) {
|
2694
2786
|
return;
|
2695
2787
|
}
|
@@ -2817,7 +2909,7 @@ var VueTippy = (function (exports, vue) {
|
|
2817
2909
|
break;
|
2818
2910
|
|
2819
2911
|
case 'focus':
|
2820
|
-
on(
|
2912
|
+
on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
|
2821
2913
|
break;
|
2822
2914
|
|
2823
2915
|
case 'focusin':
|
@@ -3043,7 +3135,7 @@ var VueTippy = (function (exports, vue) {
|
|
3043
3135
|
|
3044
3136
|
var node = getCurrentTarget();
|
3045
3137
|
|
3046
|
-
if (instance.props.interactive && appendTo ===
|
3138
|
+
if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
|
3047
3139
|
parentNode = node.parentNode;
|
3048
3140
|
} else {
|
3049
3141
|
parentNode = invokeWithArgsOrReturn(appendTo, [node]);
|
@@ -3055,6 +3147,7 @@ var VueTippy = (function (exports, vue) {
|
|
3055
3147
|
parentNode.appendChild(popper);
|
3056
3148
|
}
|
3057
3149
|
|
3150
|
+
instance.state.isMounted = true;
|
3058
3151
|
createPopperInstance();
|
3059
3152
|
/* istanbul ignore else */
|
3060
3153
|
|
@@ -3162,7 +3255,7 @@ var VueTippy = (function (exports, vue) {
|
|
3162
3255
|
invokeHook('onBeforeUpdate', [instance, partialProps]);
|
3163
3256
|
removeListeners();
|
3164
3257
|
var prevProps = instance.props;
|
3165
|
-
var nextProps = evaluateProps(reference, Object.assign({},
|
3258
|
+
var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
|
3166
3259
|
ignoreAttributes: true
|
3167
3260
|
}));
|
3168
3261
|
instance.props = nextProps;
|
@@ -3291,7 +3384,6 @@ var VueTippy = (function (exports, vue) {
|
|
3291
3384
|
// popper has been positioned for the first time
|
3292
3385
|
|
3293
3386
|
(_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
|
3294
|
-
instance.state.isMounted = true;
|
3295
3387
|
invokeHook('onMount', [instance]);
|
3296
3388
|
|
3297
3389
|
if (instance.props.animation && getIsDefaultRenderFn()) {
|
@@ -3338,7 +3430,7 @@ var VueTippy = (function (exports, vue) {
|
|
3338
3430
|
|
3339
3431
|
cleanupInteractiveMouseListeners();
|
3340
3432
|
removeDocumentPress();
|
3341
|
-
handleStyles();
|
3433
|
+
handleStyles(true);
|
3342
3434
|
|
3343
3435
|
if (getIsDefaultRenderFn()) {
|
3344
3436
|
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
|
@@ -3512,11 +3604,20 @@ var VueTippy = (function (exports, vue) {
|
|
3512
3604
|
|
3513
3605
|
var individualInstances = tippyInstances;
|
3514
3606
|
var references = [];
|
3607
|
+
var triggerTargets = [];
|
3515
3608
|
var currentTarget;
|
3516
3609
|
var overrides = optionalProps.overrides;
|
3517
3610
|
var interceptSetPropsCleanups = [];
|
3518
3611
|
var shownOnCreate = false;
|
3519
3612
|
|
3613
|
+
function setTriggerTargets() {
|
3614
|
+
triggerTargets = individualInstances.map(function (instance) {
|
3615
|
+
return normalizeToArray(instance.props.triggerTarget || instance.reference);
|
3616
|
+
}).reduce(function (acc, item) {
|
3617
|
+
return acc.concat(item);
|
3618
|
+
}, []);
|
3619
|
+
}
|
3620
|
+
|
3520
3621
|
function setReferences() {
|
3521
3622
|
references = individualInstances.map(function (instance) {
|
3522
3623
|
return instance.reference;
|
@@ -3553,7 +3654,7 @@ var VueTippy = (function (exports, vue) {
|
|
3553
3654
|
|
3554
3655
|
|
3555
3656
|
function prepareInstance(singleton, target) {
|
3556
|
-
var index =
|
3657
|
+
var index = triggerTargets.indexOf(target); // bail-out
|
3557
3658
|
|
3558
3659
|
if (target === currentTarget) {
|
3559
3660
|
return;
|
@@ -3566,13 +3667,16 @@ var VueTippy = (function (exports, vue) {
|
|
3566
3667
|
}, {});
|
3567
3668
|
singleton.setProps(Object.assign({}, overrideProps, {
|
3568
3669
|
getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {
|
3569
|
-
|
3670
|
+
var _references$index;
|
3671
|
+
|
3672
|
+
return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
|
3570
3673
|
}
|
3571
3674
|
}));
|
3572
3675
|
}
|
3573
3676
|
|
3574
3677
|
enableInstances(false);
|
3575
3678
|
setReferences();
|
3679
|
+
setTriggerTargets();
|
3576
3680
|
var plugin = {
|
3577
3681
|
fn: function fn() {
|
3578
3682
|
return {
|
@@ -3602,7 +3706,7 @@ var VueTippy = (function (exports, vue) {
|
|
3602
3706
|
};
|
3603
3707
|
var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
|
3604
3708
|
plugins: [plugin].concat(optionalProps.plugins || []),
|
3605
|
-
triggerTarget:
|
3709
|
+
triggerTarget: triggerTargets,
|
3606
3710
|
popperOptions: Object.assign({}, optionalProps.popperOptions, {
|
3607
3711
|
modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
|
3608
3712
|
})
|
@@ -3629,13 +3733,13 @@ var VueTippy = (function (exports, vue) {
|
|
3629
3733
|
} // target is a child tippy instance
|
3630
3734
|
|
3631
3735
|
|
3632
|
-
if (individualInstances.
|
3736
|
+
if (individualInstances.indexOf(target) >= 0) {
|
3633
3737
|
var ref = target.reference;
|
3634
3738
|
return prepareInstance(singleton, ref);
|
3635
3739
|
} // target is a ReferenceElement
|
3636
3740
|
|
3637
3741
|
|
3638
|
-
if (references.
|
3742
|
+
if (references.indexOf(target) >= 0) {
|
3639
3743
|
return prepareInstance(singleton, target);
|
3640
3744
|
}
|
3641
3745
|
};
|
@@ -3678,9 +3782,10 @@ var VueTippy = (function (exports, vue) {
|
|
3678
3782
|
individualInstances = nextInstances;
|
3679
3783
|
enableInstances(false);
|
3680
3784
|
setReferences();
|
3681
|
-
|
3785
|
+
setTriggerTargets();
|
3786
|
+
interceptSetPropsCleanups = interceptSetProps(singleton);
|
3682
3787
|
singleton.setProps({
|
3683
|
-
triggerTarget:
|
3788
|
+
triggerTarget: triggerTargets
|
3684
3789
|
});
|
3685
3790
|
};
|
3686
3791
|
|
@@ -3695,7 +3800,7 @@ var VueTippy = (function (exports, vue) {
|
|
3695
3800
|
var _instance$props$rende;
|
3696
3801
|
|
3697
3802
|
// @ts-ignore
|
3698
|
-
if (!((_instance$props$rende = instance.props.render)
|
3803
|
+
if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
|
3699
3804
|
if (process.env.NODE_ENV !== "production") {
|
3700
3805
|
errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');
|
3701
3806
|
}
|
@@ -3820,6 +3925,7 @@ var VueTippy = (function (exports, vue) {
|
|
3820
3925
|
|
3821
3926
|
if (isCursorOverReference || !instance.props.interactive) {
|
3822
3927
|
instance.setProps({
|
3928
|
+
// @ts-ignore - unneeded DOMRect properties
|
3823
3929
|
getReferenceClientRect: function getReferenceClientRect() {
|
3824
3930
|
var rect = reference.getBoundingClientRect();
|
3825
3931
|
var x = clientX;
|
@@ -3956,6 +4062,7 @@ var VueTippy = (function (exports, vue) {
|
|
3956
4062
|
var placement;
|
3957
4063
|
var cursorRectIndex = -1;
|
3958
4064
|
var isInternalUpdate = false;
|
4065
|
+
var triedPlacements = [];
|
3959
4066
|
var modifier = {
|
3960
4067
|
name: 'tippyInlinePositioning',
|
3961
4068
|
enabled: true,
|
@@ -3964,8 +4071,14 @@ var VueTippy = (function (exports, vue) {
|
|
3964
4071
|
var state = _ref2.state;
|
3965
4072
|
|
3966
4073
|
if (isEnabled()) {
|
3967
|
-
if (placement !==
|
4074
|
+
if (triedPlacements.indexOf(state.placement) !== -1) {
|
4075
|
+
triedPlacements = [];
|
4076
|
+
}
|
4077
|
+
|
4078
|
+
if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
|
4079
|
+
triedPlacements.push(state.placement);
|
3968
4080
|
instance.setProps({
|
4081
|
+
// @ts-ignore - unneeded DOMRect properties
|
3969
4082
|
getReferenceClientRect: function getReferenceClientRect() {
|
3970
4083
|
return _getReferenceClientRect(state.placement);
|
3971
4084
|
}
|
@@ -4002,10 +4115,11 @@ var VueTippy = (function (exports, vue) {
|
|
4002
4115
|
var cursorRect = rects.find(function (rect) {
|
4003
4116
|
return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;
|
4004
4117
|
});
|
4005
|
-
|
4118
|
+
var index = rects.indexOf(cursorRect);
|
4119
|
+
cursorRectIndex = index > -1 ? index : cursorRectIndex;
|
4006
4120
|
}
|
4007
4121
|
},
|
4008
|
-
|
4122
|
+
onHidden: function onHidden() {
|
4009
4123
|
cursorRectIndex = -1;
|
4010
4124
|
}
|
4011
4125
|
};
|
@@ -4151,6 +4265,13 @@ var VueTippy = (function (exports, vue) {
|
|
4151
4265
|
function useTippy(el, opts = {}, settings = { mount: true }) {
|
4152
4266
|
const vm = vue.getCurrentInstance();
|
4153
4267
|
const instance = vue.ref();
|
4268
|
+
const state = vue.ref({
|
4269
|
+
isEnabled: false,
|
4270
|
+
isVisible: false,
|
4271
|
+
isDestroyed: false,
|
4272
|
+
isMounted: false,
|
4273
|
+
isShown: false,
|
4274
|
+
});
|
4154
4275
|
let container = null;
|
4155
4276
|
const getContainer = () => {
|
4156
4277
|
if (container)
|
@@ -4186,7 +4307,7 @@ var VueTippy = (function (exports, vue) {
|
|
4186
4307
|
const getProps = (opts) => {
|
4187
4308
|
let options = {};
|
4188
4309
|
if (vue.isRef(opts)) {
|
4189
|
-
options = opts.value;
|
4310
|
+
options = opts.value || {};
|
4190
4311
|
}
|
4191
4312
|
else if (vue.isReactive(opts)) {
|
4192
4313
|
options = { ...opts };
|
@@ -4202,6 +4323,38 @@ var VueTippy = (function (exports, vue) {
|
|
4202
4323
|
? options.triggerTarget.value
|
4203
4324
|
: options.triggerTarget;
|
4204
4325
|
}
|
4326
|
+
options.plugins.push({
|
4327
|
+
fn() {
|
4328
|
+
return {
|
4329
|
+
onCreate() {
|
4330
|
+
state.value.isEnabled = true;
|
4331
|
+
},
|
4332
|
+
onMount() {
|
4333
|
+
state.value.isMounted = true;
|
4334
|
+
},
|
4335
|
+
onShow() {
|
4336
|
+
state.value.isMounted = true;
|
4337
|
+
state.value.isVisible = true;
|
4338
|
+
},
|
4339
|
+
onShown() {
|
4340
|
+
state.value.isShown = true;
|
4341
|
+
},
|
4342
|
+
onHide() {
|
4343
|
+
state.value.isMounted = false;
|
4344
|
+
state.value.isVisible = false;
|
4345
|
+
},
|
4346
|
+
onHidden() {
|
4347
|
+
state.value.isShown = false;
|
4348
|
+
},
|
4349
|
+
onUnmounted() {
|
4350
|
+
state.value.isMounted = false;
|
4351
|
+
},
|
4352
|
+
onDestroy() {
|
4353
|
+
state.value.isDestroyed = true;
|
4354
|
+
},
|
4355
|
+
};
|
4356
|
+
}
|
4357
|
+
});
|
4205
4358
|
return options;
|
4206
4359
|
};
|
4207
4360
|
const refresh = () => {
|
@@ -4240,10 +4393,12 @@ var VueTippy = (function (exports, vue) {
|
|
4240
4393
|
const disable = () => {
|
4241
4394
|
var _a;
|
4242
4395
|
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.disable();
|
4396
|
+
state.value.isEnabled = false;
|
4243
4397
|
};
|
4244
4398
|
const enable = () => {
|
4245
4399
|
var _a;
|
4246
4400
|
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.enable();
|
4401
|
+
state.value.isEnabled = true;
|
4247
4402
|
};
|
4248
4403
|
const unmount = () => {
|
4249
4404
|
var _a;
|
@@ -4274,6 +4429,7 @@ var VueTippy = (function (exports, vue) {
|
|
4274
4429
|
enable,
|
4275
4430
|
unmount,
|
4276
4431
|
mount,
|
4432
|
+
state,
|
4277
4433
|
};
|
4278
4434
|
if (settings.mount) {
|
4279
4435
|
if (vm) {
|
@@ -4392,9 +4548,11 @@ var VueTippy = (function (exports, vue) {
|
|
4392
4548
|
};
|
4393
4549
|
const TippyComponent = vue.defineComponent({
|
4394
4550
|
props,
|
4395
|
-
|
4551
|
+
emits: ['state'],
|
4552
|
+
setup(props, { slots, emit }) {
|
4396
4553
|
const elem = vue.ref();
|
4397
4554
|
const contentElem = vue.ref();
|
4555
|
+
const mounted = vue.ref(false);
|
4398
4556
|
let options = { ...props };
|
4399
4557
|
for (const prop of ['to', 'tag', 'contentTag', 'contentClass']) {
|
4400
4558
|
if (options.hasOwnProperty(prop)) {
|
@@ -4404,7 +4562,7 @@ var VueTippy = (function (exports, vue) {
|
|
4404
4562
|
}
|
4405
4563
|
let target = elem;
|
4406
4564
|
if (props.to) {
|
4407
|
-
if (props.to instanceof Element) {
|
4565
|
+
if (typeof Element !== 'undefined' && props.to instanceof Element) {
|
4408
4566
|
target = () => props.to;
|
4409
4567
|
}
|
4410
4568
|
else if (typeof props.to === 'string' || props.to instanceof String) {
|
@@ -4413,16 +4571,22 @@ var VueTippy = (function (exports, vue) {
|
|
4413
4571
|
}
|
4414
4572
|
const tippy = useTippy(target, options);
|
4415
4573
|
vue.onMounted(() => {
|
4416
|
-
|
4417
|
-
|
4574
|
+
mounted.value = true;
|
4575
|
+
vue.nextTick(() => {
|
4576
|
+
if (slots.content)
|
4577
|
+
tippy.setContent(() => contentElem.value);
|
4578
|
+
});
|
4418
4579
|
});
|
4419
|
-
|
4580
|
+
vue.watch(tippy.state, () => {
|
4581
|
+
emit('state', vue.unref(tippy.state));
|
4582
|
+
}, { immediate: true, deep: true });
|
4583
|
+
return { elem, contentElem, mounted, ...tippy };
|
4420
4584
|
},
|
4421
4585
|
render() {
|
4422
4586
|
let slot = this.$slots.default ? this.$slots.default(this) : [];
|
4423
4587
|
return vue.h(this.tag, { ref: 'elem', 'data-v-tippy': '' }, this.$slots.content ? [
|
4424
4588
|
slot,
|
4425
|
-
vue.h(this.contentTag, { ref: 'contentElem', class: this.contentClass }, this.$slots.content(this))
|
4589
|
+
vue.h(this.contentTag, { ref: 'contentElem', style: { display: this.mounted ? 'inherit' : 'none' }, class: this.contentClass }, this.$slots.content(this)),
|
4426
4590
|
] : slot);
|
4427
4591
|
},
|
4428
4592
|
});
|