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