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