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