@vingy/vueltip 2.1.0 → 2.2.0

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/README.md CHANGED
@@ -202,50 +202,67 @@ Define your own theme by setting CSS variables:
202
202
 
203
203
  ### Plugin Options
204
204
 
205
- The `vueltipPlugin` accepts the following options:
206
-
207
- | Option | Type | Default | Description |
208
- | -------------------------- | -------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
209
- | `component` | `Component` | Required | The Vue component to render as the tooltip |
210
- | `showDelay` | `number` | `0` | Delay in milliseconds before the tooltip appears on hover |
211
- | `hideDelay` | `number` | `200` | Delay in milliseconds before the tooltip disappears when the cursor leaves |
212
- | `defaultPlacement` | `Placement` | `'top'` | Default tooltip placement: `'top'`, `'bottom'`, `'left'`, `'right'`, etc. |
213
- | `defaultTruncateDetection` | `'x' \| 'y' \| 'both' \| 'none'` | `'both'` | Direction(s) to check for text truncation (`'x'` for horizontal, `'y'` for vertical, `'both'`, or `'none'` to disable) |
214
- | `handleDialogModals` | `boolean` | `false` | Whether to handle tooltips within HTML `<dialog>` elements with the `open` attribute (modal dialogs) |
215
- | `placementAttribute` | `string` | `'data-vueltip-placement'` | HTML attribute name for tooltip placement overrides |
216
- | `keyAttribute` | `string` | `'data-vueltip-key'` | HTML attribute name for tooltip identification |
217
- | `truncateAttribute` | `string` | `'data-vueltip-truncate'` | HTML attribute name for truncate detection overrides |
218
-
219
- ### useVueltip Composable Options
220
-
221
- The `useVueltip` composable accepts the following options:
222
-
223
- | Option | Type | Default | Description |
224
- | ----------------- | -------------------------- | -------- | ---------------------------------------------------------- |
225
- | `tooltipElement` | `Ref<HTMLElement \| null>` | Required | Reference to the tooltip container element |
226
- | `arrowElement` | `Ref<HTMLElement \| null>` | Optional | Reference to the arrow element for positioning |
227
- | `offset` | `number` | `0` | Offset distance between the tooltip and the target element |
228
- | `padding` | `number` | `0` | Padding between the tooltip and the viewport edges |
229
- | `arrowSize` | `number` | `0` | Size of the arrow element (used for proper positioning) |
230
- | `floatingOptions` | `UseFloatingOptions` | `{}` | Advanced options for the underlying Floating UI library |
205
+ | Option | Type | Default | Description |
206
+ | -------------------------- | -------------------------------- | -------------------------- | ------------------------------------------------------------------ |
207
+ | `component` | `Component` | Required | The Vue component to render as the tooltip |
208
+ | `showDelay` | `number` | `0` | Delay in ms before the tooltip appears |
209
+ | `hideDelay` | `number` | `200` | Delay in ms before the tooltip disappears |
210
+ | `defaultPlacement` | `Placement` | `'top'` | Default placement: `'top'`, `'bottom'`, `'left'`, `'right'`, etc. |
211
+ | `defaultTruncateDetection` | `'x' \| 'y' \| 'both' \| 'none'` | `'both'` | Axis to check for text truncation |
212
+ | `handleDialogModals` | `boolean` | `false` | Move the tooltip inside `<dialog>` elements when they are modal |
213
+ | `placementAttribute` | `string` | `'data-vueltip-placement'` | HTML attribute name for per-element placement overrides |
214
+ | `keyAttribute` | `string` | `'data-vueltip-key'` | HTML attribute name used to identify tooltip targets |
215
+ | `truncateAttribute` | `string` | `'data-vueltip-truncate'` | HTML attribute name for per-element truncation detection overrides |
216
+
217
+ ### useVueltip Options
218
+
219
+ | Option | Type | Default | Description |
220
+ | ----------------- | -------------------------- | -------- | ---------------------------------------------------- |
221
+ | `tooltipElement` | `Ref<HTMLElement \| null>` | Required | Reference to the tooltip container element |
222
+ | `arrowElement` | `Ref<HTMLElement \| null>` | — | Reference to the arrow element for positioning |
223
+ | `offset` | `number` | `0` | Distance between the tooltip and the target element |
224
+ | `padding` | `number` | `0` | Minimum space between the tooltip and viewport edges |
225
+ | `arrowSize` | `number` | `0` | Size of the arrow element |
226
+ | `floatingOptions` | `UseFloatingOptions` | `{}` | Advanced options passed to Floating UI |
231
227
 
232
228
  ### Directive Options
233
229
 
234
- The `v-tooltip` directive accepts bindings in two formats:
230
+ The directive accepts a simple string or an object:
235
231
 
236
- **Simple string (text only):**
232
+ ```
233
+ v-tooltip="'text'"
234
+ v-tooltip="{ text, placement, custom }"
235
+ ```
236
+
237
+ | Option | Type | Default | Description |
238
+ | ----------- | ----------- | ------- | -------------------------------------------------------- |
239
+ | `text` | `string` | — | Tooltip text |
240
+ | `placement` | `Placement` | `'top'` | Placement override for this element |
241
+ | `custom` | `object` | — | Arbitrary typed data accessible in the tooltip component |
242
+
243
+ **Placement via directive arg:**
244
+
245
+ Placement can also be set as a directive argument instead of inside the object:
237
246
 
238
- ```ts
239
- v-tooltip="'Tooltip text'"
247
+ ```
248
+ v-tooltip:right="'text'"
240
249
  ```
241
250
 
242
- **Object with options:**
251
+ **Truncation detection modifiers:**
243
252
 
244
- ```ts
245
- v-tooltip="{
246
- text: 'Tooltip text',
247
- placement: 'right' // Placement: 'top', 'bottom', 'left', 'right', etc.
248
- }"
253
+ Control which axis is checked for text overflow. When the element is not truncated and the tooltip text matches the element content, the tooltip is suppressed.
254
+
255
+ | Modifier | Description |
256
+ | -------- | ------------------------------------ |
257
+ | `x` | Check horizontal overflow only |
258
+ | `y` | Check vertical overflow only |
259
+ | `both` | Check both axes (default) |
260
+ | `none` | Always show regardless of truncation |
261
+
262
+ ```
263
+ v-tooltip.x="'text'"
264
+ v-tooltip.y="'text'"
265
+ v-tooltip.none="'Always visible'"
249
266
  ```
250
267
 
251
268
  ## Custom Data
@@ -0,0 +1 @@
1
+ export declare const BasicTooltip: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
@@ -1,42 +1 @@
1
- .vueltip-theme {
2
- isolation: isolate;
3
-
4
- --vueltip-bg: rgb(241, 245, 249);
5
- --vueltip-text: rgb(15, 23, 42);
6
- --vueltip-shadow:
7
- 0 10px 15px -3px rgba(0, 0, 0, 0.1),
8
- 0 4px 6px -4px rgba(0, 0, 0, 0.1);
9
- --vueltip-border-radius: 4px;
10
- --vueltip-padding: 4px 8px;
11
- --vueltip-font-size: 14px;
12
- --vueltip-font-weight: 600;
13
- }
14
-
15
- @media (prefers-color-scheme: dark) {
16
- .vueltip-theme {
17
- --vueltip-bg: rgb(30, 41, 59);
18
- --vueltip-text: rgb(248, 250, 252);
19
- --vueltip-shadow:
20
- 0 10px 15px -3px rgba(0, 0, 0, 0.5),
21
- 0 4px 6px -4px rgba(0, 0, 0, 0.5);
22
- }
23
- }
24
-
25
- .vueltip-arrow {
26
- pointer-events: none;
27
- position: absolute;
28
- z-index: 0;
29
- background: var(--vueltip-bg);
30
- }
31
-
32
- .vueltip-content {
33
- position: relative;
34
- z-index: 10;
35
- border-radius: var(--vueltip-border-radius);
36
- background: var(--vueltip-bg);
37
- padding: var(--vueltip-padding);
38
- font-size: var(--vueltip-font-size);
39
- font-weight: var(--vueltip-font-weight);
40
- color: var(--vueltip-text);
41
- box-shadow: var(--vueltip-shadow);
42
- }
1
+ .vueltip-theme{isolation:isolate;--vueltip-bg:#f1f5f9;--vueltip-text:#0f172a;--vueltip-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--vueltip-border-radius:4px;--vueltip-padding:4px 8px;--vueltip-font-size:14px;--vueltip-font-weight:600}@media (prefers-color-scheme:dark){.vueltip-theme{--vueltip-bg:#1e293b;--vueltip-text:#f8fafc;--vueltip-shadow:0 10px 15px -3px #00000080, 0 4px 6px -4px #00000080}}.vueltip-arrow{pointer-events:none;z-index:0;background:var(--vueltip-bg);position:absolute}.vueltip-content{z-index:10;border-radius:var(--vueltip-border-radius);background:var(--vueltip-bg);padding:var(--vueltip-padding);font-size:var(--vueltip-font-size);font-weight:var(--vueltip-font-weight);color:var(--vueltip-text);box-shadow:var(--vueltip-shadow);position:relative}
@@ -0,0 +1,21 @@
1
+ import { Maybe } from '@vingy/shared/types';
2
+ import { StyleValue } from 'vue';
3
+ import { UseTooltipOptions } from './types.ts';
4
+ export declare const useVueltip: ({ tooltipElement, arrowElement, offset: _offset, padding, arrowSize, floatingOptions, }: UseTooltipOptions) => {
5
+ tooltipStyles: Readonly<import('vue').Ref<{
6
+ position: import('@floating-ui/vue').Strategy;
7
+ top: string;
8
+ left: string;
9
+ transform?: string;
10
+ willChange?: string;
11
+ }, {
12
+ position: import('@floating-ui/vue').Strategy;
13
+ top: string;
14
+ left: string;
15
+ transform?: string;
16
+ willChange?: string;
17
+ }>>;
18
+ arrowStyles: import('vue').ComputedRef<StyleValue>;
19
+ show: import('vue').ComputedRef<boolean>;
20
+ content: import('vue').Ref<Maybe<import('./types.ts').Content>, Maybe<import('./types.ts').Content>>;
21
+ };
@@ -0,0 +1,8 @@
1
+ import { Placement } from '@floating-ui/vue';
2
+ import { DirectiveBinding } from 'vue';
3
+ import { Modifier, Value } from './types.ts';
4
+ export declare const vueltipDirective: {
5
+ updated: (el: HTMLElement, binding: DirectiveBinding<Value, Modifier, Placement>) => void;
6
+ created: (el: HTMLElement, binding: DirectiveBinding<Value, Modifier, Placement>) => void;
7
+ beforeUnmount: (el: HTMLElement) => void;
8
+ };
@@ -0,0 +1,6 @@
1
+ export { BasicTooltip } from './basicTooltip.component';
2
+ export { useVueltip } from './composables';
3
+ export { vueltipDirective } from './directive';
4
+ export { setOptions } from './options';
5
+ export { vueltipPlugin } from './plugin';
6
+ export type { Content, CustomVueltipData } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,193 @@
1
+ import { computed as e, createVNode as t, defineComponent as n, h as r, ref as i, render as a, useTemplateRef as o, watch as s } from "vue";
2
+ import { arrow as c, autoUpdate as l, flip as u, offset as d, shift as f, useFloating as p } from "@floating-ui/vue";
3
+ //#region src/options.ts
4
+ var m = {
5
+ placementAttribute: "data-vueltip-placement",
6
+ keyAttribute: "data-vueltip-key",
7
+ truncateAttribute: "data-vueltip-truncate",
8
+ showDelay: 0,
9
+ hideDelay: 200,
10
+ handleDialogModals: !1,
11
+ defaultTruncateDetection: "both",
12
+ defaultPlacement: "top"
13
+ }, h = (e) => {
14
+ m = {
15
+ ...m,
16
+ ...e
17
+ };
18
+ }, g = (e) => m[e], _, v = i("top"), y = i("top"), b = i(), x = i(), S = (e) => {
19
+ e !== x.value && e !== b.value || (b.value = void 0, x.value = void 0, _ && clearTimeout(_));
20
+ }, C = i(/* @__PURE__ */ new Map()), w = (e) => C.value.get(e), T = (e, t) => C.value.set(e, t), E = (e) => C.value.delete(e), D = () => crypto.randomUUID(), O = i(), k = i();
21
+ s([
22
+ O,
23
+ b,
24
+ v,
25
+ () => w(O.value ?? "")
26
+ ], ([e, t, n]) => {
27
+ if (!e) return;
28
+ _ && clearTimeout(_);
29
+ let r = g(t ? "showDelay" : "hideDelay");
30
+ _ = setTimeout(() => {
31
+ k.value = w(e), x.value = t, y.value = n, _ = void 0;
32
+ }, r);
33
+ });
34
+ //#endregion
35
+ //#region src/composables.ts
36
+ var A = {
37
+ top: "bottom",
38
+ right: "left",
39
+ bottom: "top",
40
+ left: "right"
41
+ }, j = ({ tooltipElement: t, arrowElement: n, offset: r, padding: i, arrowSize: a, floatingOptions: o }) => {
42
+ let m, h = e(() => !!x.value);
43
+ s(h, (e, n, r) => {
44
+ if (!e) return;
45
+ let i = t.value;
46
+ if (!i) return;
47
+ m = i.parentElement;
48
+ let a = () => b.value = x.value, o = () => b.value = void 0;
49
+ i.addEventListener("mouseenter", a), i.addEventListener("mouseleave", o), r(() => {
50
+ i.removeEventListener("mouseenter", a), i.removeEventListener("mouseleave", o);
51
+ });
52
+ }, { flush: "post" });
53
+ let _ = [
54
+ d(r),
55
+ u(),
56
+ f({ padding: i })
57
+ ];
58
+ n && _.push(c({
59
+ element: n,
60
+ padding: 6
61
+ }));
62
+ let { floatingStyles: v, middlewareData: S, placement: C } = p(x, t, {
63
+ placement: y,
64
+ whileElementsMounted: l,
65
+ middleware: _,
66
+ ...o
67
+ }), w = e(() => A[C.value.split("-")[0]]), T = a ?? 10, E = e(() => ({
68
+ width: `${T}px`,
69
+ height: `${T}px`,
70
+ rotate: "45deg",
71
+ position: "absolute",
72
+ left: S.value.arrow?.x == null ? "" : `${S.value.arrow.x}px`,
73
+ top: S.value.arrow?.y == null ? "" : `${S.value.arrow.y}px`,
74
+ [w.value]: `-${T / 2}px`
75
+ }));
76
+ return g("handleDialogModals") && s(h, (e) => {
77
+ if (!e || !t.value || !x.value || !m) return;
78
+ let n = x.value.closest("dialog");
79
+ if (!n) {
80
+ t.value.parentElement !== m && m.appendChild(t.value);
81
+ return;
82
+ }
83
+ globalThis.getComputedStyle(n, "::backdrop").display !== "none" && n.appendChild(t.value);
84
+ }), {
85
+ tooltipStyles: v,
86
+ arrowStyles: E,
87
+ show: h,
88
+ content: k
89
+ };
90
+ }, M = n(() => {
91
+ let { tooltipStyles: e, arrowStyles: t, show: n, content: i } = j({
92
+ tooltipElement: o("tooltipElement"),
93
+ arrowElement: o("arrowElement"),
94
+ offset: 8,
95
+ padding: 8
96
+ });
97
+ return () => n.value ? r("div", {
98
+ ref: "tooltipElement",
99
+ class: "vueltip-theme",
100
+ style: e.value,
101
+ role: "tooltip"
102
+ }, [r("div", {
103
+ ref: "arrowElement",
104
+ class: "vueltip-arrow",
105
+ style: t.value
106
+ }), r("div", { class: "vueltip-content" }, [i.value?.text])]) : null;
107
+ });
108
+ //#endregion
109
+ //#region src/utils.ts
110
+ function N(e) {
111
+ let t = P(e), n = e.offsetWidth < e.scrollWidth - 1, r = e.offsetHeight < e.scrollHeight - 1;
112
+ switch (t) {
113
+ case "x": return n;
114
+ case "y": return r;
115
+ case "both": return n || r;
116
+ case "none": return !0;
117
+ }
118
+ }
119
+ function P(e) {
120
+ return e.getAttribute(g("truncateAttribute")) ?? g("defaultTruncateDetection");
121
+ }
122
+ function F(e, t) {
123
+ return L(e) || R(e) ? z(e).includes(t) : !!(e.innerText || e.textContent)?.includes(t);
124
+ }
125
+ function I(e) {
126
+ return e instanceof HTMLElement;
127
+ }
128
+ function L(e) {
129
+ return e instanceof HTMLInputElement;
130
+ }
131
+ function R(e) {
132
+ return e instanceof HTMLTextAreaElement;
133
+ }
134
+ function z(e) {
135
+ return e.value;
136
+ }
137
+ var B = (e, t) => {
138
+ let n = e.getAttribute(g("keyAttribute"));
139
+ if (n) return t(n);
140
+ }, V = (e) => (t) => {
141
+ let { target: n } = t;
142
+ !n || !I(n) || e(n);
143
+ }, H = V((e) => B(e, (t) => {
144
+ let n = w(t);
145
+ if (!n) return;
146
+ let { text: r } = n;
147
+ if (!r || F(e, r) && !N(e)) return;
148
+ let i = e.getAttribute(g("placementAttribute"));
149
+ O.value = t, b.value = e, v.value = i;
150
+ })), U = V((e) => {
151
+ e === b.value && (b.value = void 0);
152
+ }), W = (e) => {
153
+ if (e == null || typeof e == "string") return { text: e };
154
+ let { placement: t, ...n } = e;
155
+ return n;
156
+ }, G = (e) => {
157
+ let { value: t, arg: n } = e;
158
+ return t && typeof t != "string" && "placement" in t && t.placement != null ? t.placement : n || g("defaultPlacement");
159
+ }, K = (e) => e.none ? "none" : e.both || e.x && e.y ? "both" : e.x ? "x" : e.y ? "y" : g("defaultTruncateDetection"), q = {
160
+ updated: (e, t) => {
161
+ B(e, (n) => {
162
+ e.setAttribute(g("placementAttribute"), G(t)), e.setAttribute(g("truncateAttribute"), K(t.modifiers ?? {})), T(n, W(t.value));
163
+ });
164
+ },
165
+ created: (e, t) => {
166
+ let n = D();
167
+ T(n, W(t.value)), e.setAttribute(g("keyAttribute"), n), e.setAttribute(g("placementAttribute"), G(t)), e.setAttribute(g("truncateAttribute"), K(t.modifiers ?? {})), e.addEventListener("mouseenter", H), e.addEventListener("focus", H), e.addEventListener("mouseleave", U), e.addEventListener("blur", U);
168
+ },
169
+ beforeUnmount: (e) => {
170
+ B(e, (e) => E(e)), S(e), e.removeEventListener("mouseenter", H), e.removeEventListener("focus", H), e.removeEventListener("mouseleave", U), e.removeEventListener("blur", U);
171
+ }
172
+ }, J = (e) => {
173
+ if (e.key !== "Escape") return;
174
+ let t = b.value ?? x.value;
175
+ t && S(t);
176
+ }, Y = "__vueltip_root__", X = () => {
177
+ let e = document.getElementById(Y);
178
+ if (e) return e;
179
+ let t = document.createElement("div");
180
+ return t.id = Y, document.body.appendChild(t), t;
181
+ }, Z = 0, Q = { install: (e, n) => {
182
+ let { component: r, ...i } = n;
183
+ if (h(i), !r || typeof window > "u") return;
184
+ Z === 0 && window.addEventListener("keydown", J), Z++;
185
+ let o = X(), s = t(r);
186
+ s.appContext = e._context, a(s, o);
187
+ let { unmount: c } = e;
188
+ e.unmount = () => {
189
+ Z--, Z <= 0 && (window.removeEventListener("keydown", J), Z = 0), c.call(e);
190
+ };
191
+ } };
192
+ //#endregion
193
+ export { M as BasicTooltip, h as setOptions, j as useVueltip, q as vueltipDirective, Q as vueltipPlugin };
@@ -0,0 +1 @@
1
+ export declare const onKeydown: (e: KeyboardEvent) => void;
@@ -0,0 +1,2 @@
1
+ export declare const onMouseover: (event: MouseEvent | FocusEvent) => void;
2
+ export declare const onMouseout: (event: MouseEvent | FocusEvent) => void;
@@ -0,0 +1,3 @@
1
+ import { Options } from './types';
2
+ export declare const setOptions: (opts?: Partial<Options>) => void;
3
+ export declare const getOption: <T extends keyof Options>(key: T) => Options[T];
@@ -0,0 +1,7 @@
1
+ import { App, Component } from 'vue';
2
+ import { Options } from './types';
3
+ export declare const vueltipPlugin: {
4
+ install: (app: App, options: Partial<Options & {
5
+ component: Component;
6
+ }>) => void;
7
+ };
@@ -0,0 +1,20 @@
1
+ import { Placement } from '@floating-ui/vue';
2
+ import { Maybe } from '@vingy/shared/types';
3
+ import { Content } from './types';
4
+ export declare const tooltipPlacement: import('vue').Ref<Placement, Placement>;
5
+ export declare const debouncedTooltipPlacement: import('vue').Ref<Placement, Placement>;
6
+ export declare const hoveredElement: import('vue').Ref<Maybe<HTMLElement>, Maybe<HTMLElement>>;
7
+ export declare const debouncedHoveredElement: import('vue').Ref<Maybe<HTMLElement>, Maybe<HTMLElement>>;
8
+ export declare const forceClearHoveredElement: (el: HTMLElement) => void;
9
+ export declare const getContent: (key: string) => {
10
+ text: Maybe<string>;
11
+ custom?: import('./types').CustomVueltipData | undefined;
12
+ } | undefined;
13
+ export declare const setContent: (key: string, value: Content) => Map<string, {
14
+ text: Maybe<string>;
15
+ custom?: import('./types').CustomVueltipData | undefined;
16
+ }> & Omit<Map<string, Content>, keyof Map<any, any>>;
17
+ export declare const deleteContent: (key: string) => boolean;
18
+ export declare const generateKey: () => `${string}-${string}-${string}-${string}-${string}`;
19
+ export declare const tooltipKey: import('vue').Ref<Maybe<string>, Maybe<string>>;
20
+ export declare const tooltipContent: import('vue').Ref<Maybe<Content>, Maybe<Content>>;
@@ -0,0 +1,45 @@
1
+ import { Placement, UseFloatingOptions } from '@floating-ui/vue';
2
+ import { Maybe } from '@vingy/shared/types';
3
+ import { Directive, ShallowRef } from 'vue';
4
+ export interface CustomVueltipData {
5
+ }
6
+ export interface Content {
7
+ text: Maybe<string>;
8
+ custom?: CustomVueltipData;
9
+ }
10
+ export type Value = Maybe<string> | (Content & {
11
+ placement?: Placement;
12
+ });
13
+ export type Modifier = 'x' | 'y' | 'none' | 'both';
14
+ export type TooltipDirective = Directive<HTMLElement, Value, Modifier, Placement>;
15
+ export type Options = {
16
+ /** @default 'data-vueltip-placement' */
17
+ placementAttribute: string;
18
+ /** @default 'data-vueltip-key' */
19
+ keyAttribute: string;
20
+ /** @default 'data-vueltip-truncate' */
21
+ truncateAttribute: string;
22
+ /** @default 0 */
23
+ showDelay: number;
24
+ /** @default 200 */
25
+ hideDelay: number;
26
+ /** @default false */
27
+ handleDialogModals: boolean;
28
+ /** @default 'both' */
29
+ defaultTruncateDetection: Modifier;
30
+ /** @default 'top' */
31
+ defaultPlacement: Placement;
32
+ };
33
+ export type UseTooltipOptions = {
34
+ tooltipElement: Readonly<ShallowRef<HTMLElement | null>>;
35
+ arrowElement?: Readonly<ShallowRef<HTMLElement | null>>;
36
+ offset?: number;
37
+ padding?: number;
38
+ arrowSize?: number;
39
+ floatingOptions?: UseFloatingOptions<HTMLElement>;
40
+ };
41
+ declare module 'vue' {
42
+ interface GlobalDirectives {
43
+ vTooltip: TooltipDirective;
44
+ }
45
+ }
@@ -0,0 +1,4 @@
1
+ export declare function isTruncated(el: HTMLElement): boolean;
2
+ export declare function elementContainsText(el: HTMLElement, text: string): boolean;
3
+ export declare function isHtmlElement(el: EventTarget): el is HTMLElement;
4
+ export declare const ensureKey: <T>(el: HTMLElement, fn: (key: string) => T) => T | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vingy/vueltip",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Headless tooltip which only shows when necessary.",
5
5
  "keywords": [
6
6
  "composition-api",
@@ -21,12 +21,12 @@
21
21
  "sideEffects": [
22
22
  "./dist/basicTooltip.css"
23
23
  ],
24
- "main": "./dist/index.mjs",
25
- "types": "./dist/index.d.mts",
24
+ "main": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
26
  "exports": {
27
27
  ".": {
28
- "types": "./dist/index.d.mts",
29
- "import": "./dist/index.mjs"
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
30
  },
31
31
  "./basicTooltip.css": "./dist/basicTooltip.css"
32
32
  },
@@ -34,14 +34,17 @@
34
34
  "access": "public"
35
35
  },
36
36
  "devDependencies": {
37
- "@floating-ui/vue": "^1.1.10",
37
+ "@vitejs/plugin-vue": "^6.0.5",
38
+ "vite": "^8.0.3",
39
+ "vite-plugin-dts": "^4.5.4",
38
40
  "@vingy/shared": "^0.1.0"
39
41
  },
40
42
  "peerDependencies": {
43
+ "@floating-ui/vue": "^1.1.10",
41
44
  "vue": "^3.5.0"
42
45
  },
43
46
  "scripts": {
44
- "build": "tsdown",
45
- "dev": "tsdown -w"
47
+ "build": "vite build",
48
+ "dev": "vite build --watch"
46
49
  }
47
50
  }
@@ -1,36 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __exportAll = (all, no_symbols) => {
7
- let target = {};
8
- for (var name in all) {
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true
12
- });
13
- }
14
- if (!no_symbols) {
15
- __defProp(target, Symbol.toStringTag, { value: "Module" });
16
- }
17
- return target;
18
- };
19
- var __copyProps = (to, from, except, desc) => {
20
- if (from && typeof from === "object" || typeof from === "function") {
21
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
22
- key = keys[i];
23
- if (!__hasOwnProp.call(to, key) && key !== except) {
24
- __defProp(to, key, {
25
- get: ((k) => from[k]).bind(null, key),
26
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
- });
28
- }
29
- }
30
- }
31
- return to;
32
- };
33
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
34
-
35
- //#endregion
36
- export { __reExport as n, __exportAll as t };