react-tooltip 5.8.4-beta.2 → 5.9.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/README.md +12 -3
- package/dist/react-tooltip.cjs.js +102 -84
- package/dist/react-tooltip.cjs.js.map +3 -3
- package/dist/react-tooltip.cjs.min.js +1 -1
- package/dist/react-tooltip.cjs.min.js.map +3 -3
- package/dist/react-tooltip.esm.js +102 -84
- package/dist/react-tooltip.esm.js.map +3 -3
- package/dist/react-tooltip.esm.min.js +1 -1
- package/dist/react-tooltip.esm.min.js.map +3 -3
- package/dist/react-tooltip.iife.js +102 -84
- package/dist/react-tooltip.iife.js.map +3 -3
- package/dist/react-tooltip.iife.min.js +1 -1
- package/dist/react-tooltip.iife.min.js.map +3 -3
- package/dist/react-tooltip.min.js +11 -0
- package/dist/react-tooltip.min.js.map +7 -0
- package/esbuild.config.dev.mjs +2 -4
- package/esbuild.config.prod.mjs +28 -23
- package/package.json +25 -39
- package/{cli.js → prebuild.js} +5 -2
- package/dist/react-tooltip.min.css +0 -2
- package/dist/react-tooltip.min.css.map +0 -7
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
}
|
|
262
262
|
function i(i3, r3, a3) {
|
|
263
263
|
let { reference: l3, floating: s3 } = i3;
|
|
264
|
-
const c3 = l3.x + l3.width / 2 - s3.width / 2, f3 = l3.y + l3.height / 2 - s3.height / 2,
|
|
264
|
+
const c3 = l3.x + l3.width / 2 - s3.width / 2, f3 = l3.y + l3.height / 2 - s3.height / 2, m3 = o(r3), u3 = e(m3), g3 = l3[u3] / 2 - s3[u3] / 2, d3 = "x" === m3;
|
|
265
265
|
let p3;
|
|
266
266
|
switch (n(r3)) {
|
|
267
267
|
case "top":
|
|
@@ -281,21 +281,21 @@
|
|
|
281
281
|
}
|
|
282
282
|
switch (t(r3)) {
|
|
283
283
|
case "start":
|
|
284
|
-
p3[
|
|
284
|
+
p3[m3] -= g3 * (a3 && d3 ? -1 : 1);
|
|
285
285
|
break;
|
|
286
286
|
case "end":
|
|
287
|
-
p3[
|
|
287
|
+
p3[m3] += g3 * (a3 && d3 ? -1 : 1);
|
|
288
288
|
}
|
|
289
289
|
return p3;
|
|
290
290
|
}
|
|
291
291
|
var r = async (t2, e2, n3) => {
|
|
292
292
|
const { placement: o3 = "bottom", strategy: r3 = "absolute", middleware: a3 = [], platform: l3 } = n3, s3 = a3.filter(Boolean), c3 = await (null == l3.isRTL ? void 0 : l3.isRTL(e2));
|
|
293
|
-
let f3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }), { x:
|
|
293
|
+
let f3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }), { x: m3, y: u3 } = i(f3, o3, c3), g3 = o3, d3 = {}, p3 = 0;
|
|
294
294
|
for (let n4 = 0; n4 < s3.length; n4++) {
|
|
295
|
-
const { name: a4, fn: h3 } = s3[n4], { x: y3, y: x3, data: w3, reset: v3 } = await h3({ x:
|
|
296
|
-
|
|
295
|
+
const { name: a4, fn: h3 } = s3[n4], { x: y3, y: x3, data: w3, reset: v3 } = await h3({ x: m3, y: u3, initialPlacement: o3, placement: g3, strategy: r3, middlewareData: d3, rects: f3, platform: l3, elements: { reference: t2, floating: e2 } });
|
|
296
|
+
m3 = null != y3 ? y3 : m3, u3 = null != x3 ? x3 : u3, d3 = { ...d3, [a4]: { ...d3[a4], ...w3 } }, v3 && p3 <= 50 && (p3++, "object" == typeof v3 && (v3.placement && (g3 = v3.placement), v3.rects && (f3 = true === v3.rects ? await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }) : v3.rects), { x: m3, y: u3 } = i(f3, g3, c3)), n4 = -1);
|
|
297
297
|
}
|
|
298
|
-
return { x:
|
|
298
|
+
return { x: m3, y: u3, placement: g3, strategy: r3, middlewareData: d3 };
|
|
299
299
|
};
|
|
300
300
|
function a(t2) {
|
|
301
301
|
return "number" != typeof t2 ? function(t3) {
|
|
@@ -308,23 +308,23 @@
|
|
|
308
308
|
async function s(t2, e2) {
|
|
309
309
|
var n3;
|
|
310
310
|
void 0 === e2 && (e2 = {});
|
|
311
|
-
const { x: o3, y: i3, platform: r3, rects: s3, elements: c3, strategy: f3 } = t2, { boundary:
|
|
311
|
+
const { x: o3, y: i3, platform: r3, rects: s3, elements: c3, strategy: f3 } = t2, { boundary: m3 = "clippingAncestors", rootBoundary: u3 = "viewport", elementContext: g3 = "floating", altBoundary: d3 = false, padding: p3 = 0 } = e2, h3 = a(p3), y3 = c3[d3 ? "floating" === g3 ? "reference" : "floating" : g3], x3 = l(await r3.getClippingRect({ element: null == (n3 = await (null == r3.isElement ? void 0 : r3.isElement(y3))) || n3 ? y3 : y3.contextElement || await (null == r3.getDocumentElement ? void 0 : r3.getDocumentElement(c3.floating)), boundary: m3, rootBoundary: u3, strategy: f3 })), w3 = "floating" === g3 ? { ...s3.floating, x: o3, y: i3 } : s3.reference, v3 = await (null == r3.getOffsetParent ? void 0 : r3.getOffsetParent(c3.floating)), b3 = await (null == r3.isElement ? void 0 : r3.isElement(v3)) && await (null == r3.getScale ? void 0 : r3.getScale(v3)) || { x: 1, y: 1 }, R2 = l(r3.convertOffsetParentRelativeRectToViewportRelativeRect ? await r3.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: w3, offsetParent: v3, strategy: f3 }) : w3);
|
|
312
312
|
return { top: (x3.top - R2.top + h3.top) / b3.y, bottom: (R2.bottom - x3.bottom + h3.bottom) / b3.y, left: (x3.left - R2.left + h3.left) / b3.x, right: (R2.right - x3.right + h3.right) / b3.x };
|
|
313
313
|
}
|
|
314
314
|
var c = Math.min;
|
|
315
315
|
var f = Math.max;
|
|
316
|
-
function
|
|
316
|
+
function m(t2, e2, n3) {
|
|
317
317
|
return f(t2, c(e2, n3));
|
|
318
318
|
}
|
|
319
|
-
var
|
|
320
|
-
const { element: r3, padding: l3 = 0 } = n3 || {}, { x: s3, y: c3, placement: f3, rects:
|
|
319
|
+
var u = (n3) => ({ name: "arrow", options: n3, async fn(i3) {
|
|
320
|
+
const { element: r3, padding: l3 = 0 } = n3 || {}, { x: s3, y: c3, placement: f3, rects: u3, platform: g3, elements: d3 } = i3;
|
|
321
321
|
if (null == r3)
|
|
322
322
|
return {};
|
|
323
|
-
const
|
|
324
|
-
let
|
|
325
|
-
0
|
|
326
|
-
const
|
|
327
|
-
return { [
|
|
323
|
+
const p3 = a(l3), h3 = { x: s3, y: c3 }, y3 = o(f3), x3 = e(y3), w3 = await g3.getDimensions(r3), v3 = "y" === y3, b3 = v3 ? "top" : "left", R2 = v3 ? "bottom" : "right", A2 = v3 ? "clientHeight" : "clientWidth", P2 = u3.reference[x3] + u3.reference[y3] - h3[y3] - u3.floating[x3], T3 = h3[y3] - u3.reference[y3], O3 = await (null == g3.getOffsetParent ? void 0 : g3.getOffsetParent(r3));
|
|
324
|
+
let E3 = O3 ? O3[A2] : 0;
|
|
325
|
+
E3 && await (null == g3.isElement ? void 0 : g3.isElement(O3)) || (E3 = d3.floating[A2] || u3.floating[x3]);
|
|
326
|
+
const D3 = P2 / 2 - T3 / 2, L3 = p3[b3], k2 = E3 - w3[x3] - p3[R2], B = E3 / 2 - w3[x3] / 2 + D3, C2 = m(L3, B, k2), H2 = null != t(f3) && B != C2 && u3.reference[x3] / 2 - (B < L3 ? p3[b3] : p3[R2]) - w3[x3] / 2 < 0;
|
|
327
|
+
return { [y3]: h3[y3] - (H2 ? B < L3 ? L3 - B : k2 - B : 0), data: { [y3]: C2, centerOffset: B - C2 } };
|
|
328
328
|
} });
|
|
329
329
|
var g = ["top", "right", "bottom", "left"];
|
|
330
330
|
var d = g.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
var b = function(e2) {
|
|
346
346
|
return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(o3) {
|
|
347
347
|
var i3;
|
|
348
|
-
const { placement: r3, middlewareData: a3, rects: l3, initialPlacement: c3, platform: f3, elements:
|
|
348
|
+
const { placement: r3, middlewareData: a3, rects: l3, initialPlacement: c3, platform: f3, elements: m3 } = o3, { mainAxis: u3 = true, crossAxis: g3 = true, fallbackPlacements: d3, fallbackStrategy: p3 = "bestFit", fallbackAxisSideDirection: x3 = "none", flipAlignment: v3 = true, ...b3 } = e2, R2 = n(r3), A2 = n(c3) === c3, P2 = await (null == f3.isRTL ? void 0 : f3.isRTL(m3.floating)), T3 = d3 || (A2 || !v3 ? [h(c3)] : function(t2) {
|
|
349
349
|
const e3 = h(t2);
|
|
350
350
|
return [w(t2), e3, w(e3)];
|
|
351
351
|
}(c3));
|
|
@@ -365,19 +365,19 @@
|
|
|
365
365
|
}
|
|
366
366
|
}(n(e3), "start" === i4, r4);
|
|
367
367
|
return a4 && (l4 = l4.map((t2) => t2 + "-" + a4), o4 && (l4 = l4.concat(l4.map(w)))), l4;
|
|
368
|
-
}(c3, v3, x3,
|
|
369
|
-
const O3 = [c3, ...T3],
|
|
368
|
+
}(c3, v3, x3, P2));
|
|
369
|
+
const O3 = [c3, ...T3], E3 = await s(o3, b3), D3 = [];
|
|
370
370
|
let L3 = (null == (i3 = a3.flip) ? void 0 : i3.overflows) || [];
|
|
371
|
-
if (
|
|
372
|
-
const { main: t2, cross: e3 } = y(r3, l3,
|
|
373
|
-
|
|
371
|
+
if (u3 && D3.push(E3[R2]), g3) {
|
|
372
|
+
const { main: t2, cross: e3 } = y(r3, l3, P2);
|
|
373
|
+
D3.push(E3[t2], E3[e3]);
|
|
374
374
|
}
|
|
375
|
-
if (L3 = [...L3, { placement: r3, overflows:
|
|
376
|
-
var k2,
|
|
375
|
+
if (L3 = [...L3, { placement: r3, overflows: D3 }], !D3.every((t2) => t2 <= 0)) {
|
|
376
|
+
var k2, B;
|
|
377
377
|
const t2 = ((null == (k2 = a3.flip) ? void 0 : k2.index) || 0) + 1, e3 = O3[t2];
|
|
378
378
|
if (e3)
|
|
379
379
|
return { data: { index: t2, overflows: L3 }, reset: { placement: e3 } };
|
|
380
|
-
let n3 = null == (
|
|
380
|
+
let n3 = null == (B = L3.filter((t3) => t3.overflows[0] <= 0).sort((t3, e4) => t3.overflows[1] - e4.overflows[1])[0]) ? void 0 : B.placement;
|
|
381
381
|
if (!n3)
|
|
382
382
|
switch (p3) {
|
|
383
383
|
case "bestFit": {
|
|
@@ -398,30 +398,30 @@
|
|
|
398
398
|
var O = function(e2) {
|
|
399
399
|
return void 0 === e2 && (e2 = 0), { name: "offset", options: e2, async fn(i3) {
|
|
400
400
|
const { x: r3, y: a3 } = i3, l3 = await async function(e3, i4) {
|
|
401
|
-
const { placement: r4, platform: a4, elements: l4 } = e3, s3 = await (null == a4.isRTL ? void 0 : a4.isRTL(l4.floating)), c3 = n(r4), f3 = t(r4),
|
|
401
|
+
const { placement: r4, platform: a4, elements: l4 } = e3, s3 = await (null == a4.isRTL ? void 0 : a4.isRTL(l4.floating)), c3 = n(r4), f3 = t(r4), m3 = "x" === o(r4), u3 = ["left", "top"].includes(c3) ? -1 : 1, g3 = s3 && m3 ? -1 : 1, d3 = "function" == typeof i4 ? i4(e3) : i4;
|
|
402
402
|
let { mainAxis: p3, crossAxis: h3, alignmentAxis: y3 } = "number" == typeof d3 ? { mainAxis: d3, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...d3 };
|
|
403
|
-
return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3),
|
|
403
|
+
return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3), m3 ? { x: h3 * g3, y: p3 * u3 } : { x: p3 * u3, y: h3 * g3 };
|
|
404
404
|
}(i3, e2);
|
|
405
405
|
return { x: r3 + l3.x, y: a3 + l3.y, data: l3 };
|
|
406
406
|
} };
|
|
407
407
|
};
|
|
408
|
-
function
|
|
408
|
+
function E(t2) {
|
|
409
409
|
return "x" === t2 ? "y" : "x";
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var D = function(t2) {
|
|
412
412
|
return void 0 === t2 && (t2 = {}), { name: "shift", options: t2, async fn(e2) {
|
|
413
413
|
const { x: i3, y: r3, placement: a3 } = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t3) => {
|
|
414
414
|
let { x: e3, y: n3 } = t3;
|
|
415
415
|
return { x: e3, y: n3 };
|
|
416
|
-
} }, ...
|
|
416
|
+
} }, ...u3 } = t2, g3 = { x: i3, y: r3 }, d3 = await s(e2, u3), p3 = o(n(a3)), h3 = E(p3);
|
|
417
417
|
let y3 = g3[p3], x3 = g3[h3];
|
|
418
418
|
if (l3) {
|
|
419
419
|
const t3 = "y" === p3 ? "bottom" : "right";
|
|
420
|
-
y3 =
|
|
420
|
+
y3 = m(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t3]);
|
|
421
421
|
}
|
|
422
422
|
if (c3) {
|
|
423
423
|
const t3 = "y" === h3 ? "bottom" : "right";
|
|
424
|
-
x3 =
|
|
424
|
+
x3 = m(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t3]);
|
|
425
425
|
}
|
|
426
426
|
const w3 = f3.fn({ ...e2, [p3]: y3, [h3]: x3 });
|
|
427
427
|
return { ...w3, data: { x: w3.x - i3, y: w3.y - r3 } };
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
function x2() {
|
|
487
|
-
return
|
|
487
|
+
return /^((?!chrome|android).)*safari/i.test(u2());
|
|
488
488
|
}
|
|
489
489
|
function w2(t2) {
|
|
490
490
|
return ["html", "body", "#document"].includes(s2(t2));
|
|
@@ -501,23 +501,23 @@
|
|
|
501
501
|
let s3 = (r3 ? l2(n3.width) : n3.width) / o3, f3 = (r3 ? l2(n3.height) : n3.height) / i3;
|
|
502
502
|
return s3 && Number.isFinite(s3) || (s3 = 1), f3 && Number.isFinite(f3) || (f3 = 1), { x: s3, y: f3 };
|
|
503
503
|
}
|
|
504
|
-
function E2(
|
|
505
|
-
var
|
|
506
|
-
void 0 ===
|
|
507
|
-
const
|
|
508
|
-
let
|
|
509
|
-
|
|
510
|
-
const
|
|
511
|
-
let
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
let o4 =
|
|
515
|
-
for (; o4 &&
|
|
516
|
-
const
|
|
517
|
-
e4.x += (o4.clientLeft + parseFloat(i4.paddingLeft)) *
|
|
504
|
+
function E2(e2, o3, i3, r3) {
|
|
505
|
+
var l3, c3;
|
|
506
|
+
void 0 === o3 && (o3 = false), void 0 === i3 && (i3 = false);
|
|
507
|
+
const s3 = e2.getBoundingClientRect(), f3 = v2(e2);
|
|
508
|
+
let u3 = b2;
|
|
509
|
+
o3 && (r3 ? d2(r3) && (u3 = L2(r3)) : u3 = L2(e2));
|
|
510
|
+
const a3 = f3 ? n2(f3) : window, h3 = x2() && i3;
|
|
511
|
+
let p3 = (s3.left + (h3 && (null == (l3 = a3.visualViewport) ? void 0 : l3.offsetLeft) || 0)) / u3.x, g3 = (s3.top + (h3 && (null == (c3 = a3.visualViewport) ? void 0 : c3.offsetTop) || 0)) / u3.y, m3 = s3.width / u3.x, y3 = s3.height / u3.y;
|
|
512
|
+
if (f3) {
|
|
513
|
+
const t2 = n2(f3), e3 = r3 && d2(r3) ? n2(r3) : r3;
|
|
514
|
+
let o4 = t2.frameElement;
|
|
515
|
+
for (; o4 && r3 && e3 !== t2; ) {
|
|
516
|
+
const t3 = L2(o4), e4 = o4.getBoundingClientRect(), i4 = getComputedStyle(o4);
|
|
517
|
+
e4.x += (o4.clientLeft + parseFloat(i4.paddingLeft)) * t3.x, e4.y += (o4.clientTop + parseFloat(i4.paddingTop)) * t3.y, p3 *= t3.x, g3 *= t3.y, m3 *= t3.x, y3 *= t3.y, p3 += e4.x, g3 += e4.y, o4 = n2(o4).frameElement;
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
return { width:
|
|
520
|
+
return l({ width: m3, height: y3, x: p3, y: g3 });
|
|
521
521
|
}
|
|
522
522
|
function R(t2) {
|
|
523
523
|
return ((h2(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
|
|
@@ -545,34 +545,52 @@
|
|
|
545
545
|
return r3 ? e2.concat(l3, l3.visualViewport || [], g2(i3) ? i3 : []) : e2.concat(i3, D2(i3));
|
|
546
546
|
}
|
|
547
547
|
function S(e2, i3, l3) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
l4 =
|
|
553
|
-
|
|
554
|
-
|
|
548
|
+
let c3;
|
|
549
|
+
if ("viewport" === i3)
|
|
550
|
+
c3 = function(t2, e3) {
|
|
551
|
+
const o3 = n2(t2), i4 = R(t2), r3 = o3.visualViewport;
|
|
552
|
+
let l4 = i4.clientWidth, c4 = i4.clientHeight, s4 = 0, f4 = 0;
|
|
553
|
+
if (r3) {
|
|
554
|
+
l4 = r3.width, c4 = r3.height;
|
|
555
|
+
const t3 = x2();
|
|
556
|
+
(!t3 || t3 && "fixed" === e3) && (s4 = r3.offsetLeft, f4 = r3.offsetTop);
|
|
557
|
+
}
|
|
558
|
+
return { width: l4, height: c4, x: s4, y: f4 };
|
|
559
|
+
}(e2, l3);
|
|
560
|
+
else if ("document" === i3)
|
|
561
|
+
c3 = function(t2) {
|
|
562
|
+
const e3 = R(t2), n3 = T2(t2), i4 = t2.ownerDocument.body, l4 = r2(e3.scrollWidth, e3.clientWidth, i4.scrollWidth, i4.clientWidth), c4 = r2(e3.scrollHeight, e3.clientHeight, i4.scrollHeight, i4.clientHeight);
|
|
563
|
+
let s4 = -n3.scrollLeft + C(t2);
|
|
564
|
+
const f4 = -n3.scrollTop;
|
|
565
|
+
return "rtl" === o2(i4).direction && (s4 += r2(e3.clientWidth, i4.clientWidth) - l4), { width: l4, height: c4, x: s4, y: f4 };
|
|
566
|
+
}(R(e2));
|
|
567
|
+
else if (d2(i3))
|
|
568
|
+
c3 = function(t2, e3) {
|
|
569
|
+
const n3 = E2(t2, true, "fixed" === e3), o3 = n3.top + t2.clientTop, i4 = n3.left + t2.clientLeft, r3 = a2(t2) ? L2(t2) : { x: 1, y: 1 };
|
|
570
|
+
return { width: t2.clientWidth * r3.x, height: t2.clientHeight * r3.y, x: i4 * r3.x, y: o3 * r3.y };
|
|
571
|
+
}(i3, l3);
|
|
572
|
+
else {
|
|
573
|
+
const t2 = { ...i3 };
|
|
574
|
+
if (x2()) {
|
|
575
|
+
var s3, f3;
|
|
576
|
+
const o3 = n2(e2);
|
|
577
|
+
t2.x -= (null == (s3 = o3.visualViewport) ? void 0 : s3.offsetLeft) || 0, t2.y -= (null == (f3 = o3.visualViewport) ? void 0 : f3.offsetTop) || 0;
|
|
555
578
|
}
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
return { width: t2.clientWidth * r3.x, height: t2.clientHeight * r3.y, x: i4 * r3.x, y: o3 * r3.y };
|
|
560
|
-
}(i3, l3)) : l(function(t2) {
|
|
561
|
-
const e3 = R(t2), n3 = T2(t2), i4 = t2.ownerDocument.body, l4 = r2(e3.scrollWidth, e3.clientWidth, i4.scrollWidth, i4.clientWidth), c3 = r2(e3.scrollHeight, e3.clientHeight, i4.scrollHeight, i4.clientHeight);
|
|
562
|
-
let s3 = -n3.scrollLeft + C(t2);
|
|
563
|
-
const f3 = -n3.scrollTop;
|
|
564
|
-
return "rtl" === o2(i4).direction && (s3 += r2(e3.clientWidth, i4.clientWidth) - l4), { width: l4, height: c3, x: s3, y: f3 };
|
|
565
|
-
}(R(e2)));
|
|
579
|
+
c3 = t2;
|
|
580
|
+
}
|
|
581
|
+
return l(c3);
|
|
566
582
|
}
|
|
567
|
-
function A(t2) {
|
|
568
|
-
return a2(t2) && "fixed" !== o2(t2).position ? t2.offsetParent : null;
|
|
583
|
+
function A(t2, e2) {
|
|
584
|
+
return a2(t2) && "fixed" !== o2(t2).position ? e2 ? e2(t2) : t2.offsetParent : null;
|
|
569
585
|
}
|
|
570
|
-
function H(t2) {
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
586
|
+
function H(t2, e2) {
|
|
587
|
+
const i3 = n2(t2);
|
|
588
|
+
if (!a2(t2))
|
|
589
|
+
return i3;
|
|
590
|
+
let r3 = A(t2, e2);
|
|
591
|
+
for (; r3 && m2(r3) && "static" === o2(r3).position; )
|
|
592
|
+
r3 = A(r3, e2);
|
|
593
|
+
return r3 && ("html" === s2(r3) || "body" === s2(r3) && "static" === o2(r3).position && !y2(r3)) ? i3 : r3 || function(t3) {
|
|
576
594
|
let e3 = F(t3);
|
|
577
595
|
for (; a2(e3) && !w2(e3); ) {
|
|
578
596
|
if (y2(e3))
|
|
@@ -580,9 +598,9 @@
|
|
|
580
598
|
e3 = F(e3);
|
|
581
599
|
}
|
|
582
600
|
return null;
|
|
583
|
-
}(t2) ||
|
|
601
|
+
}(t2) || i3;
|
|
584
602
|
}
|
|
585
|
-
function
|
|
603
|
+
function V(t2, e2, n3) {
|
|
586
604
|
const o3 = a2(e2), i3 = R(e2), r3 = E2(t2, true, "fixed" === n3, e2);
|
|
587
605
|
let l3 = { scrollLeft: 0, scrollTop: 0 };
|
|
588
606
|
const c3 = { x: 0, y: 0 };
|
|
@@ -594,7 +612,7 @@
|
|
|
594
612
|
i3 && (c3.x = C(i3));
|
|
595
613
|
return { x: r3.left + l3.scrollLeft - c3.x, y: r3.top + l3.scrollTop - c3.y, width: r3.width, height: r3.height };
|
|
596
614
|
}
|
|
597
|
-
var
|
|
615
|
+
var O2 = { getClippingRect: function(t2) {
|
|
598
616
|
let { element: e2, boundary: n3, rootBoundary: l3, strategy: c3 } = t2;
|
|
599
617
|
const f3 = "clippingAncestors" === n3 ? function(t3, e3) {
|
|
600
618
|
const n4 = e3.get(t3);
|
|
@@ -605,7 +623,7 @@
|
|
|
605
623
|
let c4 = l4 ? F(t3) : t3;
|
|
606
624
|
for (; d2(c4) && !w2(c4); ) {
|
|
607
625
|
const t4 = o2(c4), e4 = y2(c4);
|
|
608
|
-
(l4 ? e4 || r3 : e4 || "static" !== t4.position || !r3 || !["absolute", "fixed"].includes(r3.position)) ? r3 = t4 : i3 = i3.filter((t5) => t5 !== c4), c4 = F(c4);
|
|
626
|
+
"fixed" === t4.position ? r3 = null : (l4 ? e4 || r3 : e4 || "static" !== t4.position || !r3 || !["absolute", "fixed"].includes(r3.position)) ? r3 = t4 : i3 = i3.filter((t5) => t5 !== c4), c4 = F(c4);
|
|
609
627
|
}
|
|
610
628
|
return e3.set(t3, i3), i3;
|
|
611
629
|
}(e2, this._c) : [].concat(n3), u3 = [...f3, l3], a3 = u3[0], h3 = u3.reduce((t3, n4) => {
|
|
@@ -630,10 +648,10 @@
|
|
|
630
648
|
}, getOffsetParent: H, getDocumentElement: R, getScale: L2, async getElementRects(t2) {
|
|
631
649
|
let { reference: e2, floating: n3, strategy: o3 } = t2;
|
|
632
650
|
const i3 = this.getOffsetParent || H, r3 = this.getDimensions;
|
|
633
|
-
return { reference:
|
|
651
|
+
return { reference: V(e2, await i3(n3), o3), floating: { x: 0, y: 0, ...await r3(n3) } };
|
|
634
652
|
}, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === o2(t2).direction };
|
|
635
|
-
var
|
|
636
|
-
const i3 = /* @__PURE__ */ new Map(), r3 = { platform:
|
|
653
|
+
var z = (t2, n3, o3) => {
|
|
654
|
+
const i3 = /* @__PURE__ */ new Map(), r3 = { platform: O2, ...o3 }, l3 = { ...r3.platform, _c: i3 };
|
|
637
655
|
return r(t2, n3, { ...r3, platform: l3 });
|
|
638
656
|
};
|
|
639
657
|
|
|
@@ -645,7 +663,7 @@
|
|
|
645
663
|
place = "top",
|
|
646
664
|
offset: offsetValue = 10,
|
|
647
665
|
strategy = "absolute",
|
|
648
|
-
middlewares = [O(Number(offsetValue)), b(),
|
|
666
|
+
middlewares = [O(Number(offsetValue)), b(), D({ padding: 5 })]
|
|
649
667
|
}) => {
|
|
650
668
|
if (!elementReference) {
|
|
651
669
|
return { tooltipStyles: {}, tooltipArrowStyles: {} };
|
|
@@ -655,8 +673,8 @@
|
|
|
655
673
|
}
|
|
656
674
|
const middleware = middlewares;
|
|
657
675
|
if (tooltipArrowReference) {
|
|
658
|
-
middleware.push(
|
|
659
|
-
return
|
|
676
|
+
middleware.push(u({ element: tooltipArrowReference, padding: 5 }));
|
|
677
|
+
return z(elementReference, tooltipReference, {
|
|
660
678
|
placement: place,
|
|
661
679
|
strategy,
|
|
662
680
|
middleware
|
|
@@ -680,7 +698,7 @@
|
|
|
680
698
|
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle };
|
|
681
699
|
});
|
|
682
700
|
}
|
|
683
|
-
return
|
|
701
|
+
return z(elementReference, tooltipReference, {
|
|
684
702
|
placement: "bottom",
|
|
685
703
|
strategy,
|
|
686
704
|
middleware
|