@versini/ui-tooltip 1.1.2 → 1.3.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.ts +1 -1
- package/dist/index.js +388 -339
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { TooltipTypes } from '@versini/ui-types';
|
|
|
4
4
|
declare const TOOLTIP_CLASSNAME = "av-tooltip";
|
|
5
5
|
declare const TOOLTIP_ARROW_CLASSNAME = "av-tooltip-arrow";
|
|
6
6
|
|
|
7
|
-
declare const Tooltip: ({ trigger, label, placement, mode, delay, className, arrowClassName, }: TooltipTypes.Props) => react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare const Tooltip: ({ trigger, label, placement, mode, delay, className, tooltipClassName, arrowClassName, }: TooltipTypes.Props) => react_jsx_runtime.JSX.Element;
|
|
8
8
|
|
|
9
9
|
export { TOOLTIP_ARROW_CLASSNAME, TOOLTIP_CLASSNAME, Tooltip };
|
package/dist/index.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as At, jsx as $t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as G, useEffect as ht, useState as ft, useCallback as ut } from "react";
|
|
3
|
+
import H from "clsx";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/ui-tooltip v1.
|
|
5
|
+
@versini/ui-tooltip v1.3.0
|
|
6
6
|
© 2025 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_UI_TOOLTIP__ || (window.__VERSINI_UI_TOOLTIP__ = {
|
|
10
|
-
version: "1.
|
|
11
|
-
buildTime: "01/20/2025
|
|
10
|
+
version: "1.3.0",
|
|
11
|
+
buildTime: "01/20/2025 10:08 PM EST",
|
|
12
12
|
homepage: "https://github.com/aversini/ui-components",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
|
15
15
|
} catch {
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const Ht = "av-tooltip", jt = "av-tooltip-arrow", J = Math.min, z = Math.max, ot = Math.round, P = (t) => ({
|
|
18
18
|
x: t,
|
|
19
19
|
y: t
|
|
20
|
-
}),
|
|
20
|
+
}), Yt = {
|
|
21
21
|
left: "right",
|
|
22
22
|
right: "left",
|
|
23
23
|
bottom: "top",
|
|
24
24
|
top: "bottom"
|
|
25
|
-
},
|
|
25
|
+
}, zt = {
|
|
26
26
|
start: "end",
|
|
27
27
|
end: "start"
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function dt(t, e, o) {
|
|
30
|
+
return z(t, J(e, o));
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Z(t, e) {
|
|
33
33
|
return typeof t == "function" ? t(e) : t;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function j(t) {
|
|
36
36
|
return t.split("-")[0];
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function tt(t) {
|
|
39
39
|
return t.split("-")[1];
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function St(t) {
|
|
42
42
|
return t === "x" ? "y" : "x";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function wt(t) {
|
|
45
45
|
return t === "y" ? "height" : "width";
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
return ["top", "bottom"].includes(
|
|
47
|
+
function X(t) {
|
|
48
|
+
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
50
|
+
function xt(t) {
|
|
51
|
+
return St(X(t));
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Ut(t, e, o) {
|
|
54
54
|
o === void 0 && (o = !1);
|
|
55
|
-
const n =
|
|
55
|
+
const n = tt(t), i = xt(t), s = wt(i);
|
|
56
56
|
let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
57
|
-
return e.reference[s] > e.floating[s] && (r =
|
|
57
|
+
return e.reference[s] > e.floating[s] && (r = it(r)), [r, it(r)];
|
|
58
58
|
}
|
|
59
59
|
function Xt(t) {
|
|
60
|
-
const e =
|
|
61
|
-
return [
|
|
60
|
+
const e = it(t);
|
|
61
|
+
return [mt(t), e, mt(e)];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return t.replace(/start|end/g, (e) =>
|
|
63
|
+
function mt(t) {
|
|
64
|
+
return t.replace(/start|end/g, (e) => zt[e]);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Kt(t, e, o) {
|
|
67
67
|
const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
68
68
|
switch (t) {
|
|
69
69
|
case "top":
|
|
@@ -76,15 +76,15 @@ function Ut(t, e, o) {
|
|
|
76
76
|
return [];
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const i =
|
|
81
|
-
let s =
|
|
82
|
-
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(
|
|
79
|
+
function qt(t, e, o, n) {
|
|
80
|
+
const i = tt(t);
|
|
81
|
+
let s = Kt(j(t), o === "start", n);
|
|
82
|
+
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(mt)))), s;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
84
|
+
function it(t) {
|
|
85
|
+
return t.replace(/left|right|bottom|top/g, (e) => Yt[e]);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Gt(t) {
|
|
88
88
|
return {
|
|
89
89
|
top: 0,
|
|
90
90
|
right: 0,
|
|
@@ -93,15 +93,15 @@ function qt(t) {
|
|
|
93
93
|
...t
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return typeof t != "number" ?
|
|
96
|
+
function kt(t) {
|
|
97
|
+
return typeof t != "number" ? Gt(t) : {
|
|
98
98
|
top: t,
|
|
99
99
|
right: t,
|
|
100
100
|
bottom: t,
|
|
101
101
|
left: t
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function st(t) {
|
|
105
105
|
const {
|
|
106
106
|
x: e,
|
|
107
107
|
y: o,
|
|
@@ -119,12 +119,12 @@ function it(t) {
|
|
|
119
119
|
y: o
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Tt(t, e, o) {
|
|
123
123
|
let {
|
|
124
124
|
reference: n,
|
|
125
125
|
floating: i
|
|
126
126
|
} = t;
|
|
127
|
-
const s =
|
|
127
|
+
const s = X(e), r = xt(e), c = wt(r), l = j(e), a = s === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, p = n[c] / 2 - i[c] / 2;
|
|
128
128
|
let u;
|
|
129
129
|
switch (l) {
|
|
130
130
|
case "top":
|
|
@@ -157,17 +157,17 @@ function bt(t, e, o) {
|
|
|
157
157
|
y: n.y
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
switch (
|
|
160
|
+
switch (tt(e)) {
|
|
161
161
|
case "start":
|
|
162
|
-
u[r] -=
|
|
162
|
+
u[r] -= p * (o && a ? -1 : 1);
|
|
163
163
|
break;
|
|
164
164
|
case "end":
|
|
165
|
-
u[r] +=
|
|
165
|
+
u[r] += p * (o && a ? -1 : 1);
|
|
166
166
|
break;
|
|
167
167
|
}
|
|
168
168
|
return u;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const Jt = async (t, e, o) => {
|
|
171
171
|
const {
|
|
172
172
|
placement: n = "bottom",
|
|
173
173
|
strategy: i = "absolute",
|
|
@@ -181,21 +181,21 @@ const Gt = async (t, e, o) => {
|
|
|
181
181
|
}), {
|
|
182
182
|
x: d,
|
|
183
183
|
y: f
|
|
184
|
-
} =
|
|
185
|
-
for (let
|
|
184
|
+
} = Tt(a, n, l), p = n, u = {}, m = 0;
|
|
185
|
+
for (let g = 0; g < c.length; g++) {
|
|
186
186
|
const {
|
|
187
187
|
name: h,
|
|
188
188
|
fn: w
|
|
189
|
-
} = c[
|
|
189
|
+
} = c[g], {
|
|
190
190
|
x,
|
|
191
191
|
y,
|
|
192
|
-
data:
|
|
192
|
+
data: A,
|
|
193
193
|
reset: b
|
|
194
194
|
} = await w({
|
|
195
195
|
x: d,
|
|
196
196
|
y: f,
|
|
197
197
|
initialPlacement: n,
|
|
198
|
-
placement:
|
|
198
|
+
placement: p,
|
|
199
199
|
strategy: i,
|
|
200
200
|
middlewareData: u,
|
|
201
201
|
rects: a,
|
|
@@ -209,26 +209,26 @@ const Gt = async (t, e, o) => {
|
|
|
209
209
|
...u,
|
|
210
210
|
[h]: {
|
|
211
211
|
...u[h],
|
|
212
|
-
...
|
|
212
|
+
...A
|
|
213
213
|
}
|
|
214
|
-
}, b &&
|
|
214
|
+
}, b && m <= 50 && (m++, typeof b == "object" && (b.placement && (p = b.placement), b.rects && (a = b.rects === !0 ? await r.getElementRects({
|
|
215
215
|
reference: t,
|
|
216
216
|
floating: e,
|
|
217
217
|
strategy: i
|
|
218
218
|
}) : b.rects), {
|
|
219
219
|
x: d,
|
|
220
220
|
y: f
|
|
221
|
-
} =
|
|
221
|
+
} = Tt(a, p, l)), g = -1);
|
|
222
222
|
}
|
|
223
223
|
return {
|
|
224
224
|
x: d,
|
|
225
225
|
y: f,
|
|
226
|
-
placement:
|
|
226
|
+
placement: p,
|
|
227
227
|
strategy: i,
|
|
228
228
|
middlewareData: u
|
|
229
229
|
};
|
|
230
230
|
};
|
|
231
|
-
async function
|
|
231
|
+
async function Pt(t, e) {
|
|
232
232
|
var o;
|
|
233
233
|
e === void 0 && (e = {});
|
|
234
234
|
const {
|
|
@@ -242,9 +242,9 @@ async function St(t, e) {
|
|
|
242
242
|
boundary: a = "clippingAncestors",
|
|
243
243
|
rootBoundary: d = "viewport",
|
|
244
244
|
elementContext: f = "floating",
|
|
245
|
-
altBoundary:
|
|
245
|
+
altBoundary: p = !1,
|
|
246
246
|
padding: u = 0
|
|
247
|
-
} =
|
|
247
|
+
} = Z(e, t), m = kt(u), h = c[p ? f === "floating" ? "reference" : "floating" : f], w = st(await s.getClippingRect({
|
|
248
248
|
element: (o = await (s.isElement == null ? void 0 : s.isElement(h))) == null || o ? h : h.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
|
|
249
249
|
boundary: a,
|
|
250
250
|
rootBoundary: d,
|
|
@@ -254,26 +254,26 @@ async function St(t, e) {
|
|
|
254
254
|
y: i,
|
|
255
255
|
width: r.floating.width,
|
|
256
256
|
height: r.floating.height
|
|
257
|
-
} : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)),
|
|
257
|
+
} : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), A = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
|
|
258
258
|
x: 1,
|
|
259
259
|
y: 1
|
|
260
260
|
} : {
|
|
261
261
|
x: 1,
|
|
262
262
|
y: 1
|
|
263
|
-
}, b =
|
|
263
|
+
}, b = st(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
264
264
|
elements: c,
|
|
265
265
|
rect: x,
|
|
266
266
|
offsetParent: y,
|
|
267
267
|
strategy: l
|
|
268
268
|
}) : x);
|
|
269
269
|
return {
|
|
270
|
-
top: (w.top - b.top +
|
|
271
|
-
bottom: (b.bottom - w.bottom +
|
|
272
|
-
left: (w.left - b.left +
|
|
273
|
-
right: (b.right - w.right +
|
|
270
|
+
top: (w.top - b.top + m.top) / A.y,
|
|
271
|
+
bottom: (b.bottom - w.bottom + m.bottom) / A.y,
|
|
272
|
+
left: (w.left - b.left + m.left) / A.x,
|
|
273
|
+
right: (b.right - w.right + m.right) / A.x
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
const
|
|
276
|
+
const Qt = (t) => ({
|
|
277
277
|
name: "arrow",
|
|
278
278
|
options: t,
|
|
279
279
|
async fn(e) {
|
|
@@ -288,29 +288,29 @@ const Jt = (t) => ({
|
|
|
288
288
|
} = e, {
|
|
289
289
|
element: a,
|
|
290
290
|
padding: d = 0
|
|
291
|
-
} =
|
|
291
|
+
} = Z(t, e) || {};
|
|
292
292
|
if (a == null)
|
|
293
293
|
return {};
|
|
294
|
-
const f =
|
|
294
|
+
const f = kt(d), p = {
|
|
295
295
|
x: o,
|
|
296
296
|
y: n
|
|
297
|
-
}, u =
|
|
298
|
-
let
|
|
299
|
-
(!
|
|
300
|
-
const
|
|
297
|
+
}, u = xt(i), m = wt(u), g = await r.getDimensions(a), h = u === "y", w = h ? "top" : "left", x = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", A = s.reference[m] + s.reference[u] - p[u] - s.floating[m], b = p[u] - s.reference[u], N = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
|
|
298
|
+
let E = N ? N[y] : 0;
|
|
299
|
+
(!E || !await (r.isElement == null ? void 0 : r.isElement(N))) && (E = c.floating[y] || s.floating[m]);
|
|
300
|
+
const V = A / 2 - b / 2, R = E / 2 - g[m] / 2 - 1, L = J(f[w], R), I = J(f[x], R), S = L, $ = E - g[m] - I, v = E / 2 - g[m] / 2 + V, Y = dt(S, v, $), M = !l.arrow && tt(i) != null && v !== Y && s.reference[m] / 2 - (v < S ? L : I) - g[m] / 2 < 0, k = M ? v < S ? v - S : v - $ : 0;
|
|
301
301
|
return {
|
|
302
|
-
[u]:
|
|
302
|
+
[u]: p[u] + k,
|
|
303
303
|
data: {
|
|
304
|
-
[u]:
|
|
305
|
-
centerOffset:
|
|
306
|
-
...
|
|
307
|
-
alignmentOffset:
|
|
304
|
+
[u]: Y,
|
|
305
|
+
centerOffset: v - Y - k,
|
|
306
|
+
...M && {
|
|
307
|
+
alignmentOffset: k
|
|
308
308
|
}
|
|
309
309
|
},
|
|
310
|
-
reset:
|
|
310
|
+
reset: M
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
}),
|
|
313
|
+
}), Zt = function(t) {
|
|
314
314
|
return t === void 0 && (t = {}), {
|
|
315
315
|
name: "flip",
|
|
316
316
|
options: t,
|
|
@@ -326,63 +326,63 @@ const Jt = (t) => ({
|
|
|
326
326
|
} = e, {
|
|
327
327
|
mainAxis: d = !0,
|
|
328
328
|
crossAxis: f = !0,
|
|
329
|
-
fallbackPlacements:
|
|
329
|
+
fallbackPlacements: p,
|
|
330
330
|
fallbackStrategy: u = "bestFit",
|
|
331
|
-
fallbackAxisSideDirection:
|
|
332
|
-
flipAlignment:
|
|
331
|
+
fallbackAxisSideDirection: m = "none",
|
|
332
|
+
flipAlignment: g = !0,
|
|
333
333
|
...h
|
|
334
|
-
} =
|
|
334
|
+
} = Z(t, e);
|
|
335
335
|
if ((o = s.arrow) != null && o.alignmentOffset)
|
|
336
336
|
return {};
|
|
337
|
-
const w =
|
|
338
|
-
!
|
|
339
|
-
const
|
|
340
|
-
let
|
|
341
|
-
if (d &&
|
|
342
|
-
const
|
|
343
|
-
|
|
337
|
+
const w = j(i), x = X(c), y = j(c) === c, A = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), b = p || (y || !g ? [it(c)] : Xt(c)), N = m !== "none";
|
|
338
|
+
!p && N && b.push(...qt(c, g, m, A));
|
|
339
|
+
const E = [c, ...b], V = await Pt(e, h), R = [];
|
|
340
|
+
let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
|
|
341
|
+
if (d && R.push(V[w]), f) {
|
|
342
|
+
const v = Ut(i, r, A);
|
|
343
|
+
R.push(V[v[0]], V[v[1]]);
|
|
344
344
|
}
|
|
345
|
-
if (
|
|
345
|
+
if (L = [...L, {
|
|
346
346
|
placement: i,
|
|
347
|
-
overflows:
|
|
348
|
-
}], !
|
|
349
|
-
var
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
347
|
+
overflows: R
|
|
348
|
+
}], !R.every((v) => v <= 0)) {
|
|
349
|
+
var I, S;
|
|
350
|
+
const v = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, Y = E[v];
|
|
351
|
+
if (Y)
|
|
352
352
|
return {
|
|
353
353
|
data: {
|
|
354
|
-
index:
|
|
355
|
-
overflows:
|
|
354
|
+
index: v,
|
|
355
|
+
overflows: L
|
|
356
356
|
},
|
|
357
357
|
reset: {
|
|
358
|
-
placement:
|
|
358
|
+
placement: Y
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
|
-
let
|
|
362
|
-
if (!
|
|
361
|
+
let M = (S = L.filter((k) => k.overflows[0] <= 0).sort((k, B) => k.overflows[1] - B.overflows[1])[0]) == null ? void 0 : S.placement;
|
|
362
|
+
if (!M)
|
|
363
363
|
switch (u) {
|
|
364
364
|
case "bestFit": {
|
|
365
|
-
var
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
const
|
|
369
|
-
return
|
|
365
|
+
var $;
|
|
366
|
+
const k = ($ = L.filter((B) => {
|
|
367
|
+
if (N) {
|
|
368
|
+
const F = X(B.placement);
|
|
369
|
+
return F === x || // Create a bias to the `y` side axis due to horizontal
|
|
370
370
|
// reading directions favoring greater width.
|
|
371
|
-
|
|
371
|
+
F === "y";
|
|
372
372
|
}
|
|
373
373
|
return !0;
|
|
374
|
-
}).map((
|
|
375
|
-
|
|
374
|
+
}).map((B) => [B.placement, B.overflows.filter((F) => F > 0).reduce((F, It) => F + It, 0)]).sort((B, F) => B[1] - F[1])[0]) == null ? void 0 : $[0];
|
|
375
|
+
k && (M = k);
|
|
376
376
|
break;
|
|
377
377
|
}
|
|
378
378
|
case "initialPlacement":
|
|
379
|
-
|
|
379
|
+
M = c;
|
|
380
380
|
break;
|
|
381
381
|
}
|
|
382
|
-
if (i !==
|
|
382
|
+
if (i !== M)
|
|
383
383
|
return {
|
|
384
384
|
reset: {
|
|
385
|
-
placement:
|
|
385
|
+
placement: M
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
}
|
|
@@ -390,16 +390,16 @@ const Jt = (t) => ({
|
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
};
|
|
393
|
-
async function
|
|
393
|
+
async function te(t, e) {
|
|
394
394
|
const {
|
|
395
395
|
placement: o,
|
|
396
396
|
platform: n,
|
|
397
397
|
elements: i
|
|
398
|
-
} = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r =
|
|
398
|
+
} = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = j(o), c = tt(o), l = X(o) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && l ? -1 : 1, f = Z(e, t);
|
|
399
399
|
let {
|
|
400
|
-
mainAxis:
|
|
400
|
+
mainAxis: p,
|
|
401
401
|
crossAxis: u,
|
|
402
|
-
alignmentAxis:
|
|
402
|
+
alignmentAxis: m
|
|
403
403
|
} = typeof f == "number" ? {
|
|
404
404
|
mainAxis: f,
|
|
405
405
|
crossAxis: 0,
|
|
@@ -409,15 +409,15 @@ async function Zt(t, e) {
|
|
|
409
409
|
crossAxis: f.crossAxis || 0,
|
|
410
410
|
alignmentAxis: f.alignmentAxis
|
|
411
411
|
};
|
|
412
|
-
return c && typeof
|
|
412
|
+
return c && typeof m == "number" && (u = c === "end" ? m * -1 : m), l ? {
|
|
413
413
|
x: u * d,
|
|
414
|
-
y:
|
|
414
|
+
y: p * a
|
|
415
415
|
} : {
|
|
416
|
-
x:
|
|
416
|
+
x: p * a,
|
|
417
417
|
y: u * d
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
|
-
const
|
|
420
|
+
const ee = function(t) {
|
|
421
421
|
return t === void 0 && (t = 0), {
|
|
422
422
|
name: "offset",
|
|
423
423
|
options: t,
|
|
@@ -428,7 +428,7 @@ const te = function(t) {
|
|
|
428
428
|
y: s,
|
|
429
429
|
placement: r,
|
|
430
430
|
middlewareData: c
|
|
431
|
-
} = e, l = await
|
|
431
|
+
} = e, l = await te(e, t);
|
|
432
432
|
return r === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
|
|
433
433
|
x: i + l.x,
|
|
434
434
|
y: s + l.y,
|
|
@@ -439,7 +439,7 @@ const te = function(t) {
|
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
|
-
},
|
|
442
|
+
}, ne = function(t) {
|
|
443
443
|
return t === void 0 && (t = {}), {
|
|
444
444
|
name: "shift",
|
|
445
445
|
options: t,
|
|
@@ -464,31 +464,31 @@ const te = function(t) {
|
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
466
|
...l
|
|
467
|
-
} =
|
|
467
|
+
} = Z(t, e), a = {
|
|
468
468
|
x: o,
|
|
469
469
|
y: n
|
|
470
|
-
}, d = await
|
|
471
|
-
let u = a[
|
|
470
|
+
}, d = await Pt(e, l), f = X(j(i)), p = St(f);
|
|
471
|
+
let u = a[p], m = a[f];
|
|
472
472
|
if (s) {
|
|
473
|
-
const h =
|
|
474
|
-
u =
|
|
473
|
+
const h = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", x = u + d[h], y = u - d[w];
|
|
474
|
+
u = dt(x, u, y);
|
|
475
475
|
}
|
|
476
476
|
if (r) {
|
|
477
|
-
const h = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x =
|
|
478
|
-
|
|
477
|
+
const h = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = m + d[h], y = m - d[w];
|
|
478
|
+
m = dt(x, m, y);
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const g = c.fn({
|
|
481
481
|
...e,
|
|
482
|
-
[
|
|
483
|
-
[f]:
|
|
482
|
+
[p]: u,
|
|
483
|
+
[f]: m
|
|
484
484
|
});
|
|
485
485
|
return {
|
|
486
|
-
...
|
|
486
|
+
...g,
|
|
487
487
|
data: {
|
|
488
|
-
x:
|
|
489
|
-
y:
|
|
488
|
+
x: g.x - o,
|
|
489
|
+
y: g.y - n,
|
|
490
490
|
enabled: {
|
|
491
|
-
[
|
|
491
|
+
[p]: s,
|
|
492
492
|
[f]: r
|
|
493
493
|
}
|
|
494
494
|
}
|
|
@@ -496,33 +496,33 @@ const te = function(t) {
|
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
498
|
};
|
|
499
|
-
function
|
|
499
|
+
function rt() {
|
|
500
500
|
return typeof window < "u";
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
return
|
|
502
|
+
function q(t) {
|
|
503
|
+
return Dt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
504
504
|
}
|
|
505
505
|
function T(t) {
|
|
506
506
|
var e;
|
|
507
507
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function _(t) {
|
|
510
510
|
var e;
|
|
511
|
-
return (e = (
|
|
511
|
+
return (e = (Dt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
513
|
+
function Dt(t) {
|
|
514
|
+
return rt() ? t instanceof Node || t instanceof T(t).Node : !1;
|
|
515
515
|
}
|
|
516
516
|
function C(t) {
|
|
517
|
-
return
|
|
517
|
+
return rt() ? t instanceof Element || t instanceof T(t).Element : !1;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
519
|
+
function D(t) {
|
|
520
|
+
return rt() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return !
|
|
522
|
+
function Ct(t) {
|
|
523
|
+
return !rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function et(t) {
|
|
526
526
|
const {
|
|
527
527
|
overflow: e,
|
|
528
528
|
overflowX: o,
|
|
@@ -531,10 +531,10 @@ function tt(t) {
|
|
|
531
531
|
} = O(t);
|
|
532
532
|
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
return ["table", "td", "th"].includes(
|
|
534
|
+
function oe(t) {
|
|
535
|
+
return ["table", "td", "th"].includes(q(t));
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function ct(t) {
|
|
538
538
|
return [":popover-open", ":modal"].some((e) => {
|
|
539
539
|
try {
|
|
540
540
|
return t.matches(e);
|
|
@@ -543,31 +543,31 @@ function rt(t) {
|
|
|
543
543
|
}
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
const e =
|
|
546
|
+
function yt(t) {
|
|
547
|
+
const e = bt(), o = C(t) ? O(t) : t;
|
|
548
548
|
return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
|
|
549
549
|
}
|
|
550
|
-
function
|
|
551
|
-
let e =
|
|
552
|
-
for (;
|
|
553
|
-
if (
|
|
550
|
+
function ie(t) {
|
|
551
|
+
let e = W(t);
|
|
552
|
+
for (; D(e) && !K(e); ) {
|
|
553
|
+
if (yt(e))
|
|
554
554
|
return e;
|
|
555
|
-
if (
|
|
555
|
+
if (ct(e))
|
|
556
556
|
return null;
|
|
557
|
-
e =
|
|
557
|
+
e = W(e);
|
|
558
558
|
}
|
|
559
559
|
return null;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function bt() {
|
|
562
562
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
return ["html", "body", "#document"].includes(
|
|
564
|
+
function K(t) {
|
|
565
|
+
return ["html", "body", "#document"].includes(q(t));
|
|
566
566
|
}
|
|
567
567
|
function O(t) {
|
|
568
568
|
return T(t).getComputedStyle(t);
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function lt(t) {
|
|
571
571
|
return C(t) ? {
|
|
572
572
|
scrollLeft: t.scrollLeft,
|
|
573
573
|
scrollTop: t.scrollTop
|
|
@@ -576,158 +576,158 @@ function ct(t) {
|
|
|
576
576
|
scrollTop: t.scrollY
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
if (
|
|
579
|
+
function W(t) {
|
|
580
|
+
if (q(t) === "html")
|
|
581
581
|
return t;
|
|
582
582
|
const e = (
|
|
583
583
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
584
584
|
t.assignedSlot || // DOM Element detected.
|
|
585
585
|
t.parentNode || // ShadowRoot detected.
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
Ct(t) && t.host || // Fallback.
|
|
587
|
+
_(t)
|
|
588
588
|
);
|
|
589
|
-
return
|
|
589
|
+
return Ct(e) ? e.host : e;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
const e =
|
|
593
|
-
return
|
|
591
|
+
function Nt(t) {
|
|
592
|
+
const e = W(t);
|
|
593
|
+
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : D(e) && et(e) ? e : Nt(e);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function pt(t, e, o) {
|
|
596
596
|
var n;
|
|
597
597
|
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
598
|
-
const i =
|
|
598
|
+
const i = Nt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = T(i);
|
|
599
599
|
if (s) {
|
|
600
|
-
const c =
|
|
601
|
-
return e.concat(r, r.visualViewport || [],
|
|
600
|
+
const c = gt(r);
|
|
601
|
+
return e.concat(r, r.visualViewport || [], et(i) ? i : [], c && o ? pt(c) : []);
|
|
602
602
|
}
|
|
603
|
-
return e.concat(i,
|
|
603
|
+
return e.concat(i, pt(i, [], o));
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function gt(t) {
|
|
606
606
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function Mt(t) {
|
|
609
609
|
const e = O(t);
|
|
610
610
|
let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
611
|
-
const i =
|
|
611
|
+
const i = D(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, c = ot(o) !== s || ot(n) !== r;
|
|
612
612
|
return c && (o = s, n = r), {
|
|
613
613
|
width: o,
|
|
614
614
|
height: n,
|
|
615
615
|
$: c
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function _t(t) {
|
|
619
619
|
return C(t) ? t : t.contextElement;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const e =
|
|
623
|
-
if (!
|
|
624
|
-
return
|
|
621
|
+
function U(t) {
|
|
622
|
+
const e = _t(t);
|
|
623
|
+
if (!D(e))
|
|
624
|
+
return P(1);
|
|
625
625
|
const o = e.getBoundingClientRect(), {
|
|
626
626
|
width: n,
|
|
627
627
|
height: i,
|
|
628
628
|
$: s
|
|
629
|
-
} =
|
|
630
|
-
let r = (s ?
|
|
629
|
+
} = Mt(e);
|
|
630
|
+
let r = (s ? ot(o.width) : o.width) / n, c = (s ? ot(o.height) : o.height) / i;
|
|
631
631
|
return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
632
632
|
x: r,
|
|
633
633
|
y: c
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
const
|
|
637
|
-
function
|
|
636
|
+
const se = /* @__PURE__ */ P(0);
|
|
637
|
+
function Vt(t) {
|
|
638
638
|
const e = T(t);
|
|
639
|
-
return !
|
|
639
|
+
return !bt() || !e.visualViewport ? se : {
|
|
640
640
|
x: e.visualViewport.offsetLeft,
|
|
641
641
|
y: e.visualViewport.offsetTop
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function re(t, e, o) {
|
|
645
645
|
return e === void 0 && (e = !1), !o || e && o !== T(t) ? !1 : e;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function Q(t, e, o, n) {
|
|
648
648
|
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
649
|
-
const i = t.getBoundingClientRect(), s =
|
|
650
|
-
let r =
|
|
651
|
-
e && (n ? C(n) && (r =
|
|
652
|
-
const c =
|
|
649
|
+
const i = t.getBoundingClientRect(), s = _t(t);
|
|
650
|
+
let r = P(1);
|
|
651
|
+
e && (n ? C(n) && (r = U(n)) : r = U(t));
|
|
652
|
+
const c = re(s, o, n) ? Vt(s) : P(0);
|
|
653
653
|
let l = (i.left + c.x) / r.x, a = (i.top + c.y) / r.y, d = i.width / r.x, f = i.height / r.y;
|
|
654
654
|
if (s) {
|
|
655
|
-
const
|
|
656
|
-
let
|
|
657
|
-
for (;
|
|
658
|
-
const h =
|
|
659
|
-
l *= h.x, a *= h.y, d *= h.x, f *= h.y, l += y, a +=
|
|
655
|
+
const p = T(s), u = n && C(n) ? T(n) : n;
|
|
656
|
+
let m = p, g = gt(m);
|
|
657
|
+
for (; g && n && u !== m; ) {
|
|
658
|
+
const h = U(g), w = g.getBoundingClientRect(), x = O(g), y = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * h.x, A = w.top + (g.clientTop + parseFloat(x.paddingTop)) * h.y;
|
|
659
|
+
l *= h.x, a *= h.y, d *= h.x, f *= h.y, l += y, a += A, m = T(g), g = gt(m);
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
return
|
|
662
|
+
return st({
|
|
663
663
|
width: d,
|
|
664
664
|
height: f,
|
|
665
665
|
x: l,
|
|
666
666
|
y: a
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
|
-
function
|
|
670
|
-
const o =
|
|
671
|
-
return e ? e.left + o :
|
|
669
|
+
function vt(t, e) {
|
|
670
|
+
const o = lt(t).scrollLeft;
|
|
671
|
+
return e ? e.left + o : Q(_(t)).left + o;
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Bt(t, e, o) {
|
|
674
674
|
o === void 0 && (o = !1);
|
|
675
675
|
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - (o ? 0 : (
|
|
676
676
|
// RTL <body> scrollbar.
|
|
677
|
-
|
|
677
|
+
vt(t, n)
|
|
678
678
|
)), s = n.top + e.scrollTop;
|
|
679
679
|
return {
|
|
680
680
|
x: i,
|
|
681
681
|
y: s
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function ce(t) {
|
|
685
685
|
let {
|
|
686
686
|
elements: e,
|
|
687
687
|
rect: o,
|
|
688
688
|
offsetParent: n,
|
|
689
689
|
strategy: i
|
|
690
690
|
} = t;
|
|
691
|
-
const s = i === "fixed", r =
|
|
691
|
+
const s = i === "fixed", r = _(n), c = e ? ct(e.floating) : !1;
|
|
692
692
|
if (n === r || c && s)
|
|
693
693
|
return o;
|
|
694
694
|
let l = {
|
|
695
695
|
scrollLeft: 0,
|
|
696
696
|
scrollTop: 0
|
|
697
|
-
}, a =
|
|
698
|
-
const d =
|
|
699
|
-
if ((f || !f && !s) && ((
|
|
700
|
-
const u =
|
|
701
|
-
a =
|
|
697
|
+
}, a = P(1);
|
|
698
|
+
const d = P(0), f = D(n);
|
|
699
|
+
if ((f || !f && !s) && ((q(n) !== "body" || et(r)) && (l = lt(n)), D(n))) {
|
|
700
|
+
const u = Q(n);
|
|
701
|
+
a = U(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
|
|
702
702
|
}
|
|
703
|
-
const
|
|
703
|
+
const p = r && !f && !s ? Bt(r, l, !0) : P(0);
|
|
704
704
|
return {
|
|
705
705
|
width: o.width * a.x,
|
|
706
706
|
height: o.height * a.y,
|
|
707
|
-
x: o.x * a.x - l.scrollLeft * a.x + d.x +
|
|
708
|
-
y: o.y * a.y - l.scrollTop * a.y + d.y +
|
|
707
|
+
x: o.x * a.x - l.scrollLeft * a.x + d.x + p.x,
|
|
708
|
+
y: o.y * a.y - l.scrollTop * a.y + d.y + p.y
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function le(t) {
|
|
712
712
|
return Array.from(t.getClientRects());
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
const e =
|
|
716
|
-
let r = -o.scrollLeft +
|
|
714
|
+
function ae(t) {
|
|
715
|
+
const e = _(t), o = lt(t), n = t.ownerDocument.body, i = z(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = z(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
716
|
+
let r = -o.scrollLeft + vt(t);
|
|
717
717
|
const c = -o.scrollTop;
|
|
718
|
-
return O(n).direction === "rtl" && (r +=
|
|
718
|
+
return O(n).direction === "rtl" && (r += z(e.clientWidth, n.clientWidth) - i), {
|
|
719
719
|
width: i,
|
|
720
720
|
height: s,
|
|
721
721
|
x: r,
|
|
722
722
|
y: c
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
function
|
|
726
|
-
const o = T(t), n =
|
|
725
|
+
function fe(t, e) {
|
|
726
|
+
const o = T(t), n = _(t), i = o.visualViewport;
|
|
727
727
|
let s = n.clientWidth, r = n.clientHeight, c = 0, l = 0;
|
|
728
728
|
if (i) {
|
|
729
729
|
s = i.width, r = i.height;
|
|
730
|
-
const a =
|
|
730
|
+
const a = bt();
|
|
731
731
|
(!a || a && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
|
|
732
732
|
}
|
|
733
733
|
return {
|
|
@@ -737,8 +737,8 @@ function ae(t, e) {
|
|
|
737
737
|
y: l
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
const o =
|
|
740
|
+
function ue(t, e) {
|
|
741
|
+
const o = Q(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = D(t) ? U(t) : P(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, a = n * s.y;
|
|
742
742
|
return {
|
|
743
743
|
width: r,
|
|
744
744
|
height: c,
|
|
@@ -746,16 +746,16 @@ function fe(t, e) {
|
|
|
746
746
|
y: a
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Ot(t, e, o) {
|
|
750
750
|
let n;
|
|
751
751
|
if (e === "viewport")
|
|
752
|
-
n =
|
|
752
|
+
n = fe(t, o);
|
|
753
753
|
else if (e === "document")
|
|
754
|
-
n =
|
|
754
|
+
n = ae(_(t));
|
|
755
755
|
else if (C(e))
|
|
756
|
-
n =
|
|
756
|
+
n = ue(e, o);
|
|
757
757
|
else {
|
|
758
|
-
const i =
|
|
758
|
+
const i = Vt(t);
|
|
759
759
|
n = {
|
|
760
760
|
x: e.x - i.x,
|
|
761
761
|
y: e.y - i.y,
|
|
@@ -763,36 +763,36 @@ function At(t, e, o) {
|
|
|
763
763
|
height: e.height
|
|
764
764
|
};
|
|
765
765
|
}
|
|
766
|
-
return
|
|
766
|
+
return st(n);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
const o =
|
|
770
|
-
return o === e || !C(o) ||
|
|
768
|
+
function Ft(t, e) {
|
|
769
|
+
const o = W(t);
|
|
770
|
+
return o === e || !C(o) || K(o) ? !1 : O(o).position === "fixed" || Ft(o, e);
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function de(t, e) {
|
|
773
773
|
const o = e.get(t);
|
|
774
774
|
if (o)
|
|
775
775
|
return o;
|
|
776
|
-
let n =
|
|
776
|
+
let n = pt(t, [], !1).filter((c) => C(c) && q(c) !== "body"), i = null;
|
|
777
777
|
const s = O(t).position === "fixed";
|
|
778
|
-
let r = s ?
|
|
779
|
-
for (; C(r) && !
|
|
780
|
-
const c = O(r), l =
|
|
781
|
-
!l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) ||
|
|
778
|
+
let r = s ? W(t) : t;
|
|
779
|
+
for (; C(r) && !K(r); ) {
|
|
780
|
+
const c = O(r), l = yt(r);
|
|
781
|
+
!l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || et(r) && !l && Ft(t, r)) ? n = n.filter((d) => d !== r) : i = c, r = W(r);
|
|
782
782
|
}
|
|
783
783
|
return e.set(t, n), n;
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function me(t) {
|
|
786
786
|
let {
|
|
787
787
|
element: e,
|
|
788
788
|
boundary: o,
|
|
789
789
|
rootBoundary: n,
|
|
790
790
|
strategy: i
|
|
791
791
|
} = t;
|
|
792
|
-
const r = [...o === "clippingAncestors" ?
|
|
793
|
-
const f =
|
|
794
|
-
return a.top =
|
|
795
|
-
},
|
|
792
|
+
const r = [...o === "clippingAncestors" ? ct(e) ? [] : de(e, this._c) : [].concat(o), n], c = r[0], l = r.reduce((a, d) => {
|
|
793
|
+
const f = Ot(e, d, i);
|
|
794
|
+
return a.top = z(f.top, a.top), a.right = J(f.right, a.right), a.bottom = J(f.bottom, a.bottom), a.left = z(f.left, a.left), a;
|
|
795
|
+
}, Ot(e, c, i));
|
|
796
796
|
return {
|
|
797
797
|
width: l.right - l.left,
|
|
798
798
|
height: l.bottom - l.top,
|
|
@@ -800,29 +800,29 @@ function de(t) {
|
|
|
800
800
|
y: l.top
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function pe(t) {
|
|
804
804
|
const {
|
|
805
805
|
width: e,
|
|
806
806
|
height: o
|
|
807
|
-
} =
|
|
807
|
+
} = Mt(t);
|
|
808
808
|
return {
|
|
809
809
|
width: e,
|
|
810
810
|
height: o
|
|
811
811
|
};
|
|
812
812
|
}
|
|
813
813
|
function ge(t, e, o) {
|
|
814
|
-
const n =
|
|
814
|
+
const n = D(e), i = _(e), s = o === "fixed", r = Q(t, !0, s, e);
|
|
815
815
|
let c = {
|
|
816
816
|
scrollLeft: 0,
|
|
817
817
|
scrollTop: 0
|
|
818
818
|
};
|
|
819
|
-
const l =
|
|
819
|
+
const l = P(0);
|
|
820
820
|
if (n || !n && !s)
|
|
821
|
-
if ((
|
|
822
|
-
const
|
|
823
|
-
l.x =
|
|
824
|
-
} else i && (l.x =
|
|
825
|
-
const a = i && !n && !s ?
|
|
821
|
+
if ((q(e) !== "body" || et(i)) && (c = lt(e)), n) {
|
|
822
|
+
const p = Q(e, !0, s, e);
|
|
823
|
+
l.x = p.x + e.clientLeft, l.y = p.y + e.clientTop;
|
|
824
|
+
} else i && (l.x = vt(i));
|
|
825
|
+
const a = i && !n && !s ? Bt(i, c) : P(0), d = r.left + c.scrollLeft - l.x - a.x, f = r.top + c.scrollTop - l.y - a.y;
|
|
826
826
|
return {
|
|
827
827
|
x: d,
|
|
828
828
|
y: f,
|
|
@@ -833,34 +833,34 @@ function ge(t, e, o) {
|
|
|
833
833
|
function at(t) {
|
|
834
834
|
return O(t).position === "static";
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
if (!
|
|
836
|
+
function Et(t, e) {
|
|
837
|
+
if (!D(t) || O(t).position === "fixed")
|
|
838
838
|
return null;
|
|
839
839
|
if (e)
|
|
840
840
|
return e(t);
|
|
841
841
|
let o = t.offsetParent;
|
|
842
|
-
return
|
|
842
|
+
return _(t) === o && (o = o.ownerDocument.body), o;
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Wt(t, e) {
|
|
845
845
|
const o = T(t);
|
|
846
|
-
if (
|
|
846
|
+
if (ct(t))
|
|
847
847
|
return o;
|
|
848
|
-
if (!
|
|
849
|
-
let i =
|
|
850
|
-
for (; i && !
|
|
848
|
+
if (!D(t)) {
|
|
849
|
+
let i = W(t);
|
|
850
|
+
for (; i && !K(i); ) {
|
|
851
851
|
if (C(i) && !at(i))
|
|
852
852
|
return i;
|
|
853
|
-
i =
|
|
853
|
+
i = W(i);
|
|
854
854
|
}
|
|
855
855
|
return o;
|
|
856
856
|
}
|
|
857
|
-
let n =
|
|
858
|
-
for (; n &&
|
|
859
|
-
n =
|
|
860
|
-
return n &&
|
|
857
|
+
let n = Et(t, e);
|
|
858
|
+
for (; n && oe(n) && at(n); )
|
|
859
|
+
n = Et(n, e);
|
|
860
|
+
return n && K(n) && at(n) && !yt(n) ? o : n || ie(t) || o;
|
|
861
861
|
}
|
|
862
|
-
const
|
|
863
|
-
const e = this.getOffsetParent ||
|
|
862
|
+
const he = async function(t) {
|
|
863
|
+
const e = this.getOffsetParent || Wt, o = this.getDimensions, n = await o(t.floating);
|
|
864
864
|
return {
|
|
865
865
|
reference: ge(t.reference, await e(t.floating), t.strategy),
|
|
866
866
|
floating: {
|
|
@@ -871,136 +871,185 @@ const pe = async function(t) {
|
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
873
|
};
|
|
874
|
-
function
|
|
874
|
+
function we(t) {
|
|
875
875
|
return O(t).direction === "rtl";
|
|
876
876
|
}
|
|
877
|
-
const
|
|
878
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
879
|
-
getDocumentElement:
|
|
880
|
-
getClippingRect:
|
|
881
|
-
getOffsetParent:
|
|
882
|
-
getElementRects:
|
|
883
|
-
getClientRects:
|
|
884
|
-
getDimensions:
|
|
885
|
-
getScale:
|
|
877
|
+
const xe = {
|
|
878
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ce,
|
|
879
|
+
getDocumentElement: _,
|
|
880
|
+
getClippingRect: me,
|
|
881
|
+
getOffsetParent: Wt,
|
|
882
|
+
getElementRects: he,
|
|
883
|
+
getClientRects: le,
|
|
884
|
+
getDimensions: pe,
|
|
885
|
+
getScale: U,
|
|
886
886
|
isElement: C,
|
|
887
|
-
isRTL:
|
|
888
|
-
},
|
|
887
|
+
isRTL: we
|
|
888
|
+
}, ye = ee, be = ne, ve = Zt, Ae = Qt, Te = (t, e, o) => {
|
|
889
889
|
const n = /* @__PURE__ */ new Map(), i = {
|
|
890
|
-
platform:
|
|
890
|
+
platform: xe,
|
|
891
891
|
...o
|
|
892
892
|
}, s = {
|
|
893
893
|
...i.platform,
|
|
894
894
|
_c: n
|
|
895
895
|
};
|
|
896
|
-
return
|
|
896
|
+
return Jt(t, e, {
|
|
897
897
|
...i,
|
|
898
898
|
platform: s
|
|
899
899
|
});
|
|
900
|
-
},
|
|
900
|
+
}, Rt = ["mousedown", "touchstart"];
|
|
901
|
+
function Ce(t, e, o) {
|
|
902
|
+
const n = G(null);
|
|
903
|
+
return ht(() => {
|
|
904
|
+
const i = (s) => {
|
|
905
|
+
const r = s ? s.target : void 0;
|
|
906
|
+
if (Array.isArray(o)) {
|
|
907
|
+
const c = !document.body.contains(r) && r.tagName !== "HTML";
|
|
908
|
+
o.every(
|
|
909
|
+
(l) => !!l && !s.composedPath().includes(l)
|
|
910
|
+
) && !c && t();
|
|
911
|
+
} else n.current && !n.current.contains(r) && t();
|
|
912
|
+
};
|
|
913
|
+
return Rt.forEach(
|
|
914
|
+
(s) => document.addEventListener(s, i)
|
|
915
|
+
), () => {
|
|
916
|
+
Rt.forEach(
|
|
917
|
+
(s) => document.removeEventListener(s, i)
|
|
918
|
+
);
|
|
919
|
+
};
|
|
920
|
+
}, [t, o, e]), n;
|
|
921
|
+
}
|
|
922
|
+
function Oe(t, e) {
|
|
923
|
+
const [o, n] = ft(!1), i = G(null), s = G(null), r = ut(() => {
|
|
924
|
+
n((l) => (!l && (!i.current || i.current === -1) && (i.current = window.setInterval(s.current, e)), !0));
|
|
925
|
+
}, [e]), c = ut(() => {
|
|
926
|
+
n(!1), window.clearInterval(i.current || -1), i.current = -1;
|
|
927
|
+
}, []);
|
|
928
|
+
return ht(() => (s.current = t, o && r(), c), [t, o, r, c]), { start: r, stop: c, active: o };
|
|
929
|
+
}
|
|
930
|
+
const nt = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Ee = () => H("absolute top-0 left-0 w-max py-1 px-2 rounded text-sm z-50"), Lt = ({
|
|
901
931
|
mode: t
|
|
902
|
-
}) =>
|
|
932
|
+
}) => H({
|
|
903
933
|
"bg-surface-darker": t === "dark" || t === "system",
|
|
904
934
|
"bg-surface-light": t === "light" || t === "alt-system",
|
|
905
935
|
"dark:bg-surface-light": t === "system",
|
|
906
936
|
"dark:bg-surface-darker": t === "alt-system"
|
|
907
|
-
}),
|
|
937
|
+
}), Re = ({
|
|
908
938
|
mode: t
|
|
909
|
-
}) =>
|
|
939
|
+
}) => H({
|
|
910
940
|
"text-copy-light": t === "dark" || t === "system",
|
|
911
941
|
"text-copy-dark": t === "light" || t === "alt-system",
|
|
912
942
|
"dark:text-copy-dark": t === "system",
|
|
913
943
|
"dark:text-copy-light": t === "alt-system"
|
|
914
|
-
}),
|
|
944
|
+
}), Le = () => H("absolute", "size-2", "transform rotate-45"), Se = ({
|
|
915
945
|
mode: t,
|
|
916
946
|
className: e,
|
|
917
|
-
|
|
947
|
+
tooltipClassName: o,
|
|
948
|
+
arrowClassName: n
|
|
918
949
|
}) => {
|
|
919
|
-
const
|
|
920
|
-
It,
|
|
921
|
-
Te(),
|
|
922
|
-
Ct({ mode: t }),
|
|
923
|
-
Ce({ mode: t }),
|
|
924
|
-
e
|
|
925
|
-
), s = W(
|
|
950
|
+
const i = H("relative inline-block", e), s = H(
|
|
926
951
|
Ht,
|
|
927
|
-
|
|
928
|
-
|
|
952
|
+
Ee(),
|
|
953
|
+
Lt({ mode: t }),
|
|
954
|
+
Re({ mode: t }),
|
|
929
955
|
o
|
|
956
|
+
), r = H(
|
|
957
|
+
jt,
|
|
958
|
+
Le(),
|
|
959
|
+
Lt({ mode: t }),
|
|
960
|
+
n
|
|
930
961
|
);
|
|
931
|
-
return { tooltip:
|
|
932
|
-
},
|
|
962
|
+
return { tooltip: s, arrow: r, wrapper: i };
|
|
963
|
+
}, ke = ({ delay: t = 300 }) => ({
|
|
933
964
|
animation: `av-tooltip-fade-in ${t}ms ease-in-out`
|
|
934
|
-
}), Pe = ({
|
|
965
|
+
}), Pe = 5e3, _e = ({
|
|
935
966
|
trigger: t,
|
|
936
967
|
label: e,
|
|
937
968
|
placement: o = "top",
|
|
938
969
|
mode: n = "system",
|
|
939
970
|
delay: i = 300,
|
|
940
971
|
className: s,
|
|
941
|
-
|
|
972
|
+
tooltipClassName: r,
|
|
973
|
+
arrowClassName: c
|
|
942
974
|
}) => {
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
|
|
975
|
+
const l = Ce(() => {
|
|
976
|
+
g.stop(), m(!1);
|
|
977
|
+
}), a = G(null), d = G(null), [f, p] = ft(!1), [u, m] = ft(!1), g = Oe(() => {
|
|
978
|
+
m(!1);
|
|
979
|
+
}, Pe), h = Se({
|
|
980
|
+
mode: n,
|
|
981
|
+
className: s,
|
|
982
|
+
tooltipClassName: r,
|
|
983
|
+
arrowClassName: c
|
|
984
|
+
}), w = ke({ delay: i }), x = ut(async () => {
|
|
985
|
+
var N, E, V, R;
|
|
986
|
+
if (l.current && a.current && d.current) {
|
|
946
987
|
const {
|
|
947
|
-
x:
|
|
948
|
-
y:
|
|
949
|
-
middlewareData:
|
|
950
|
-
placement:
|
|
951
|
-
} = await
|
|
988
|
+
x: L,
|
|
989
|
+
y: I,
|
|
990
|
+
middlewareData: S,
|
|
991
|
+
placement: $
|
|
992
|
+
} = await Te(l.current, a.current, {
|
|
952
993
|
placement: o,
|
|
953
994
|
middleware: [
|
|
954
|
-
|
|
955
|
-
|
|
995
|
+
ye(10),
|
|
996
|
+
ve({
|
|
956
997
|
crossAxis: o.includes("-"),
|
|
957
998
|
fallbackAxisSideDirection: "start"
|
|
958
999
|
}),
|
|
959
|
-
|
|
960
|
-
|
|
1000
|
+
be({ padding: 5 }),
|
|
1001
|
+
Ae({ element: d.current })
|
|
961
1002
|
]
|
|
962
1003
|
});
|
|
963
|
-
Object.assign(
|
|
964
|
-
left:
|
|
965
|
-
top:
|
|
966
|
-
...
|
|
1004
|
+
(N = a == null ? void 0 : a.current) != null && N.style && Object.assign(a.current.style, {
|
|
1005
|
+
left: nt(L),
|
|
1006
|
+
top: nt(I),
|
|
1007
|
+
...w
|
|
967
1008
|
});
|
|
968
|
-
const
|
|
1009
|
+
const v = {
|
|
969
1010
|
top: "bottom",
|
|
970
1011
|
right: "left",
|
|
971
1012
|
bottom: "top",
|
|
972
1013
|
left: "right"
|
|
973
|
-
}[
|
|
974
|
-
Object.assign(
|
|
975
|
-
left:
|
|
976
|
-
top:
|
|
1014
|
+
}[$.split("-")[0]];
|
|
1015
|
+
(E = d == null ? void 0 : d.current) != null && E.style && Object.assign(d.current.style, {
|
|
1016
|
+
left: nt((V = S.arrow) == null ? void 0 : V.x),
|
|
1017
|
+
top: nt((R = S.arrow) == null ? void 0 : R.y),
|
|
977
1018
|
right: "",
|
|
978
1019
|
bottom: "",
|
|
979
|
-
[
|
|
1020
|
+
[v]: "-4px"
|
|
980
1021
|
});
|
|
981
1022
|
}
|
|
982
|
-
}, [o,
|
|
983
|
-
|
|
984
|
-
(async () =>
|
|
985
|
-
}, [
|
|
1023
|
+
}, [o, w, l]);
|
|
1024
|
+
ht(() => {
|
|
1025
|
+
(async () => f && await x())();
|
|
1026
|
+
}, [x, f]);
|
|
1027
|
+
const y = () => {
|
|
1028
|
+
p(!1), m(!0), g.start();
|
|
1029
|
+
}, A = () => {
|
|
1030
|
+
u || p(!0);
|
|
1031
|
+
}, b = () => {
|
|
1032
|
+
u || p(!1);
|
|
1033
|
+
};
|
|
1034
|
+
return /* @__PURE__ */ At(
|
|
986
1035
|
"div",
|
|
987
1036
|
{
|
|
988
|
-
className:
|
|
989
|
-
ref:
|
|
990
|
-
onMouseEnter:
|
|
991
|
-
onMouseLeave:
|
|
992
|
-
onClick:
|
|
1037
|
+
className: h.wrapper,
|
|
1038
|
+
ref: l,
|
|
1039
|
+
onMouseEnter: A,
|
|
1040
|
+
onMouseLeave: b,
|
|
1041
|
+
onClick: y,
|
|
993
1042
|
children: [
|
|
994
1043
|
t,
|
|
995
|
-
|
|
1044
|
+
f && /* @__PURE__ */ At(
|
|
996
1045
|
"div",
|
|
997
1046
|
{
|
|
998
1047
|
role: "tooltip",
|
|
999
|
-
ref:
|
|
1000
|
-
className:
|
|
1048
|
+
ref: a,
|
|
1049
|
+
className: h.tooltip,
|
|
1001
1050
|
children: [
|
|
1002
1051
|
e,
|
|
1003
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ $t("div", { ref: d, className: h.arrow })
|
|
1004
1053
|
]
|
|
1005
1054
|
}
|
|
1006
1055
|
)
|
|
@@ -1009,7 +1058,7 @@ const we = {
|
|
|
1009
1058
|
);
|
|
1010
1059
|
};
|
|
1011
1060
|
export {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1061
|
+
jt as TOOLTIP_ARROW_CLASSNAME,
|
|
1062
|
+
Ht as TOOLTIP_CLASSNAME,
|
|
1063
|
+
_e as Tooltip
|
|
1015
1064
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-tooltip",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -38,16 +38,17 @@
|
|
|
38
38
|
"react-dom": "^18.3.1 || ^19.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@versini/ui-types": "4.
|
|
41
|
+
"@versini/ui-types": "4.4.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@floating-ui/dom": "1.6.13",
|
|
45
45
|
"@tailwindcss/typography": "0.5.16",
|
|
46
|
+
"@versini/ui-hooks": "4.5.0",
|
|
46
47
|
"clsx": "2.1.1",
|
|
47
48
|
"tailwindcss": "3.4.17"
|
|
48
49
|
},
|
|
49
50
|
"sideEffects": [
|
|
50
51
|
"**/*.css"
|
|
51
52
|
],
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "9fe85d906eb117bb22c3b576f104b6f0203429d7"
|
|
53
54
|
}
|