@vingy/vueltip 1.3.0 → 1.3.1
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/index.mjs +16 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __reExport, t as __exportAll } from "./chunk-CtajNgzt.mjs";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import { computed, createApp,
|
|
3
|
+
import { computed, createApp, ref, watch } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
6
6
|
const min = Math.min;
|
|
@@ -1448,11 +1448,21 @@ const sideMap = {
|
|
|
1448
1448
|
};
|
|
1449
1449
|
const useVueltip = ({ tooltipElement, arrowElement, offset: _offset, padding, arrowSize, floatingOptions }) => {
|
|
1450
1450
|
let initialParent;
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1451
|
+
const show = computed(() => !!debouncedHoveredElement.value);
|
|
1452
|
+
watch(show, (value, _, onCleanup) => {
|
|
1453
|
+
if (!value) return;
|
|
1454
|
+
const el = tooltipElement.value;
|
|
1455
|
+
if (!el) return;
|
|
1456
|
+
initialParent = el.parentElement;
|
|
1457
|
+
const onEnter = () => hoveredElement.value = debouncedHoveredElement.value;
|
|
1458
|
+
const onLeave = () => hoveredElement.value = void 0;
|
|
1459
|
+
el.addEventListener("mouseenter", onEnter);
|
|
1460
|
+
el.addEventListener("mouseleave", onLeave);
|
|
1461
|
+
onCleanup(() => {
|
|
1462
|
+
el.removeEventListener("mouseenter", onEnter);
|
|
1463
|
+
el.removeEventListener("mouseleave", onLeave);
|
|
1464
|
+
});
|
|
1465
|
+
}, { flush: "post" });
|
|
1456
1466
|
const middleware = [
|
|
1457
1467
|
offset(_offset),
|
|
1458
1468
|
flip(),
|
|
@@ -1481,7 +1491,6 @@ const useVueltip = ({ tooltipElement, arrowElement, offset: _offset, padding, ar
|
|
|
1481
1491
|
[staticSide.value]: `-${size / 2}px`
|
|
1482
1492
|
};
|
|
1483
1493
|
});
|
|
1484
|
-
const show = computed(() => !!debouncedHoveredElement.value);
|
|
1485
1494
|
if (getOption("handleDialogModals")) watch(show, (value) => {
|
|
1486
1495
|
if (!value || !tooltipElement.value || !debouncedHoveredElement.value || !initialParent) return;
|
|
1487
1496
|
const dialogEl = debouncedHoveredElement.value.closest("dialog");
|