@vingy/vueltip 0.1.0 → 0.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.
@@ -0,0 +1,36 @@
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 };
@@ -0,0 +1,299 @@
1
+ import { n as __reExport, t as __exportAll } from "./chunk-CtajNgzt.mjs";
2
+ import * as Vue from "vue";
3
+ import { ShallowRef, StyleValue } from "vue";
4
+
5
+ //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts
6
+ declare type AlignedPlacement = `${Side}-${Alignment}`;
7
+ declare type Alignment = 'start' | 'end';
8
+ declare type Axis = 'x' | 'y';
9
+ declare type ClientRectObject = Prettify$1<Rect & SideObject>;
10
+ declare type Coords = { [key in Axis]: number };
11
+ declare type Dimensions = { [key in Length]: number };
12
+ declare interface ElementRects {
13
+ reference: Rect;
14
+ floating: Rect;
15
+ }
16
+ declare type Length = 'width' | 'height';
17
+ declare type Padding = number | Prettify$1<Partial<SideObject>>;
18
+ declare type Placement = Prettify$1<Side | AlignedPlacement>;
19
+ declare type Prettify$1<T> = { [K in keyof T]: T[K] } & {};
20
+ declare type Rect = Prettify$1<Coords & Dimensions>;
21
+ declare type Side = 'top' | 'right' | 'bottom' | 'left';
22
+ declare type SideObject = { [key in Side]: number };
23
+ declare type Strategy = 'absolute' | 'fixed';
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts
26
+ declare type Boundary = any;
27
+ /**
28
+ * Function option to derive middleware options from state.
29
+ */
30
+ declare type Derivable<T> = (state: MiddlewareState$1) => T;
31
+ /**
32
+ * Resolves with an object of overflow side offsets that determine how much the
33
+ * element is overflowing a given clipping boundary on each side.
34
+ * - positive = overflowing the boundary by that number of pixels
35
+ * - negative = how many pixels left before it will overflow
36
+ * - 0 = lies flush with the boundary
37
+ * @see https://floating-ui.com/docs/detectOverflow
38
+ */
39
+ declare function detectOverflow(state: MiddlewareState$1, options?: DetectOverflowOptions | Derivable<DetectOverflowOptions>): Promise<SideObject>;
40
+ declare interface DetectOverflowOptions {
41
+ /**
42
+ * The clipping element(s) or area in which overflow will be checked.
43
+ * @default 'clippingAncestors'
44
+ */
45
+ boundary?: Boundary;
46
+ /**
47
+ * The root clipping area in which overflow will be checked.
48
+ * @default 'viewport'
49
+ */
50
+ rootBoundary?: RootBoundary;
51
+ /**
52
+ * The element in which overflow is being checked relative to a boundary.
53
+ * @default 'floating'
54
+ */
55
+ elementContext?: ElementContext;
56
+ /**
57
+ * Whether to check for overflow using the alternate element's boundary
58
+ * (`clippingAncestors` boundary only).
59
+ * @default false
60
+ */
61
+ altBoundary?: boolean;
62
+ /**
63
+ * Virtual padding for the resolved overflow detection offsets.
64
+ * @default 0
65
+ */
66
+ padding?: Padding;
67
+ }
68
+ declare type ElementContext = 'reference' | 'floating';
69
+ declare interface Elements$1 {
70
+ reference: ReferenceElement$1;
71
+ floating: FloatingElement$1;
72
+ }
73
+ declare type FloatingElement$1 = any;
74
+ declare type Middleware$1 = {
75
+ name: string;
76
+ options?: any;
77
+ fn: (state: MiddlewareState$1) => Promisable$1<MiddlewareReturn>;
78
+ };
79
+ declare interface MiddlewareData {
80
+ [key: string]: any;
81
+ arrow?: Partial<Coords> & {
82
+ centerOffset: number;
83
+ alignmentOffset?: number;
84
+ };
85
+ autoPlacement?: {
86
+ index?: number;
87
+ overflows: Array<{
88
+ placement: Placement;
89
+ overflows: Array<number>;
90
+ }>;
91
+ };
92
+ flip?: {
93
+ index?: number;
94
+ overflows: Array<{
95
+ placement: Placement;
96
+ overflows: Array<number>;
97
+ }>;
98
+ };
99
+ hide?: {
100
+ referenceHidden?: boolean;
101
+ escaped?: boolean;
102
+ referenceHiddenOffsets?: SideObject;
103
+ escapedOffsets?: SideObject;
104
+ };
105
+ offset?: Coords & {
106
+ placement: Placement;
107
+ };
108
+ shift?: Coords & {
109
+ enabled: { [key in Axis]: boolean };
110
+ };
111
+ }
112
+ declare interface MiddlewareReturn extends Partial<Coords> {
113
+ data?: {
114
+ [key: string]: any;
115
+ };
116
+ reset?: boolean | {
117
+ placement?: Placement;
118
+ rects?: boolean | ElementRects;
119
+ };
120
+ }
121
+ declare interface MiddlewareState$1 extends Coords {
122
+ initialPlacement: Placement;
123
+ placement: Placement;
124
+ strategy: Strategy;
125
+ middlewareData: MiddlewareData;
126
+ elements: Elements$1;
127
+ rects: ElementRects;
128
+ platform: {
129
+ detectOverflow: typeof detectOverflow;
130
+ } & Platform;
131
+ }
132
+ /**
133
+ * Platform interface methods to work with the current platform.
134
+ * @see https://floating-ui.com/docs/platform
135
+ */
136
+ declare interface Platform {
137
+ getElementRects: (args: {
138
+ reference: ReferenceElement$1;
139
+ floating: FloatingElement$1;
140
+ strategy: Strategy;
141
+ }) => Promisable$1<ElementRects>;
142
+ getClippingRect: (args: {
143
+ element: any;
144
+ boundary: Boundary;
145
+ rootBoundary: RootBoundary;
146
+ strategy: Strategy;
147
+ }) => Promisable$1<Rect>;
148
+ getDimensions: (element: any) => Promisable$1<Dimensions>;
149
+ convertOffsetParentRelativeRectToViewportRelativeRect?: (args: {
150
+ elements?: Elements$1;
151
+ rect: Rect;
152
+ offsetParent: any;
153
+ strategy: Strategy;
154
+ }) => Promisable$1<Rect>;
155
+ getOffsetParent?: (element: any) => Promisable$1<any>;
156
+ isElement?: (value: any) => Promisable$1<boolean>;
157
+ getDocumentElement?: (element: any) => Promisable$1<any>;
158
+ getClientRects?: (element: any) => Promisable$1<Array<ClientRectObject>>;
159
+ isRTL?: (element: any) => Promisable$1<boolean>;
160
+ getScale?: (element: any) => Promisable$1<{
161
+ x: number;
162
+ y: number;
163
+ }>;
164
+ detectOverflow?: typeof detectOverflow;
165
+ }
166
+ declare type Promisable$1<T> = T | Promise<T>;
167
+ declare type ReferenceElement$1 = any;
168
+ declare type RootBoundary = 'viewport' | 'document' | Rect;
169
+ //#endregion
170
+ //#region ../../node_modules/.pnpm/@floating-ui+dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts
171
+ declare interface Elements {
172
+ reference: ReferenceElement;
173
+ floating: FloatingElement;
174
+ }
175
+ declare type FloatingElement = HTMLElement;
176
+ declare type Middleware = Prettify<Omit<Middleware$1, 'fn'> & {
177
+ fn(state: MiddlewareState): Promisable<MiddlewareReturn>;
178
+ }>;
179
+ declare type MiddlewareState = Prettify<Omit<MiddlewareState$1, 'elements'> & {
180
+ elements: Elements;
181
+ }>;
182
+ declare type Prettify<T> = { [K in keyof T]: T[K] } & {};
183
+ declare type Promisable<T> = T | Promise<T>;
184
+ declare type ReferenceElement = Element | VirtualElement;
185
+ /**
186
+ * Custom positioning reference element.
187
+ * @see https://floating-ui.com/docs/virtual-elements
188
+ */
189
+ declare interface VirtualElement {
190
+ getBoundingClientRect(): ClientRectObject;
191
+ getClientRects?(): Array<ClientRectObject> | DOMRectList;
192
+ contextElement?: Element;
193
+ }
194
+ declare namespace index_d_exports {
195
+ export { V as Vue, Vue2, del, install, isVue2, isVue3, set };
196
+ }
197
+ import * as import_vue from "vue";
198
+ declare const isVue2: boolean;
199
+ declare const isVue3: boolean;
200
+ declare const Vue2: any;
201
+ declare const install: (vue?: any) => void;
202
+ /**
203
+ * @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
204
+ * Refer to https://github.com/vueuse/vue-demi/issues/41
205
+ */
206
+ declare const V: typeof Vue;
207
+ declare function set<T>(target: any, key: any, val: T): T;
208
+ declare function del(target: any, key: any): void;
209
+ //#endregion
210
+ //#region ../../node_modules/.pnpm/@floating-ui+vue@1.1.10_vue@3.5.28_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.d.mts
211
+ declare type MaybeReadonlyRef<T> = T | Readonly<index_d_exports.Ref<T>>;
212
+ declare type MaybeReadonlyRefOrGetter<T> = MaybeReadonlyRef<T> | (() => T);
213
+ declare type UseFloatingOptions<T extends ReferenceElement = ReferenceElement> = {
214
+ /**
215
+ * Represents the open/close state of the floating element.
216
+ * @default true
217
+ */
218
+ open?: MaybeReadonlyRefOrGetter<boolean | undefined>;
219
+ /**
220
+ * Where to place the floating element relative to its reference element.
221
+ * @default 'bottom'
222
+ */
223
+ placement?: MaybeReadonlyRefOrGetter<Placement | undefined>;
224
+ /**
225
+ * The type of CSS position property to use.
226
+ * @default 'absolute'
227
+ */
228
+ strategy?: MaybeReadonlyRefOrGetter<Strategy | undefined>;
229
+ /**
230
+ * These are plain objects that modify the positioning coordinates in some fashion, or provide useful data for the consumer to use.
231
+ * @default undefined
232
+ */
233
+ middleware?: MaybeReadonlyRefOrGetter<Middleware[] | undefined>;
234
+ /**
235
+ * Whether to use `transform` instead of `top` and `left` styles to
236
+ * position the floating element (`floatingStyles`).
237
+ * @default true
238
+ */
239
+ transform?: MaybeReadonlyRefOrGetter<boolean | undefined>;
240
+ /**
241
+ * Callback to handle mounting/unmounting of the elements.
242
+ * @default undefined
243
+ */
244
+ whileElementsMounted?: (reference: T, floating: FloatingElement, update: () => void) => () => void;
245
+ };
246
+ //#endregion
247
+ //#region src/types.d.ts
248
+ interface Content {
249
+ text: string;
250
+ }
251
+ type Options = {
252
+ /** @default 'tooltip-placement' */placementAttribute: string; /** @default 'tooltip-key' */
253
+ keyAttribute: string; /** @default 0 */
254
+ showDelay: number; /** @default 200 */
255
+ hideDelay: number; /** @default false */
256
+ handleDialogModals: boolean;
257
+ };
258
+ type UseTooltipOptions = {
259
+ tooltipElement: Readonly<ShallowRef<HTMLElement | null>>;
260
+ arrowElement?: Readonly<ShallowRef<HTMLElement | null>>;
261
+ offset?: number;
262
+ padding?: number;
263
+ arrowSize?: number;
264
+ floatingOptions?: UseFloatingOptions<HTMLElement>;
265
+ };
266
+ //#endregion
267
+ //#region src/composables.d.ts
268
+ declare const useTooltip: ({
269
+ tooltipElement,
270
+ arrowElement,
271
+ offset: _offset,
272
+ padding,
273
+ arrowSize,
274
+ floatingOptions
275
+ }: UseTooltipOptions) => {
276
+ tooltipStyles: Readonly<Vue.Ref<{
277
+ position: Strategy;
278
+ top: string;
279
+ left: string;
280
+ transform?: string;
281
+ willChange?: string;
282
+ }, {
283
+ position: Strategy;
284
+ top: string;
285
+ left: string;
286
+ transform?: string;
287
+ willChange?: string;
288
+ }>>;
289
+ arrowStyles: Vue.ComputedRef<StyleValue>;
290
+ show: Vue.ComputedRef<boolean>;
291
+ content: Vue.Ref<Maybe<Content>, Maybe<Content>>;
292
+ };
293
+ //#endregion
294
+ //#region src/plugin.d.ts
295
+ declare const tooltipPlugin: {
296
+ install: (app: any, options?: Partial<Options>) => void;
297
+ };
298
+ //#endregion
299
+ export { type Content, tooltipPlugin, useTooltip };