react-tooltip 5.9.1-beta.0 → 5.9.1-beta.1
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 +2 -2
- package/dist/react-tooltip.cjs.js +35 -513
- package/dist/react-tooltip.cjs.js.map +4 -4
- package/dist/react-tooltip.cjs.min.js +1 -10
- package/dist/react-tooltip.cjs.min.js.map +4 -4
- package/dist/react-tooltip.esm.js +38 -539
- package/dist/react-tooltip.esm.js.map +4 -4
- package/dist/react-tooltip.esm.min.js +1 -10
- package/dist/react-tooltip.esm.min.js.map +4 -4
- package/dist/react-tooltip.iife.js +39 -517
- package/dist/react-tooltip.iife.js.map +4 -4
- package/dist/react-tooltip.iife.min.js +1 -10
- package/dist/react-tooltip.iife.min.js.map +4 -4
- package/dist/react-tooltip.min.js +1 -10
- package/dist/react-tooltip.min.js.map +4 -4
- package/esbuild.config.prod.mjs +3 -1
- package/package.json +7 -6
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __export = (target, all) => {
|
|
12
9
|
for (var name in all)
|
|
13
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -30,57 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
27
|
));
|
|
31
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
29
|
|
|
33
|
-
// node_modules/classnames/index.js
|
|
34
|
-
var require_classnames = __commonJS({
|
|
35
|
-
"node_modules/classnames/index.js"(exports, module2) {
|
|
36
|
-
(function() {
|
|
37
|
-
"use strict";
|
|
38
|
-
var hasOwn = {}.hasOwnProperty;
|
|
39
|
-
var nativeCodeString = "[native code]";
|
|
40
|
-
function classNames3() {
|
|
41
|
-
var classes = [];
|
|
42
|
-
for (var i3 = 0; i3 < arguments.length; i3++) {
|
|
43
|
-
var arg = arguments[i3];
|
|
44
|
-
if (!arg)
|
|
45
|
-
continue;
|
|
46
|
-
var argType = typeof arg;
|
|
47
|
-
if (argType === "string" || argType === "number") {
|
|
48
|
-
classes.push(arg);
|
|
49
|
-
} else if (Array.isArray(arg)) {
|
|
50
|
-
if (arg.length) {
|
|
51
|
-
var inner = classNames3.apply(null, arg);
|
|
52
|
-
if (inner) {
|
|
53
|
-
classes.push(inner);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
} else if (argType === "object") {
|
|
57
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
58
|
-
classes.push(arg.toString());
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
for (var key in arg) {
|
|
62
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
63
|
-
classes.push(key);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return classes.join(" ");
|
|
69
|
-
}
|
|
70
|
-
if (typeof module2 !== "undefined" && module2.exports) {
|
|
71
|
-
classNames3.default = classNames3;
|
|
72
|
-
module2.exports = classNames3;
|
|
73
|
-
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
74
|
-
define("classnames", [], function() {
|
|
75
|
-
return classNames3;
|
|
76
|
-
});
|
|
77
|
-
} else {
|
|
78
|
-
window.classNames = classNames3;
|
|
79
|
-
}
|
|
80
|
-
})();
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
30
|
// src/index.tsx
|
|
85
31
|
var src_exports = {};
|
|
86
32
|
__export(src_exports, {
|
|
@@ -95,7 +41,7 @@ var import_react5 = require("react");
|
|
|
95
41
|
|
|
96
42
|
// src/components/Tooltip/Tooltip.tsx
|
|
97
43
|
var import_react4 = require("react");
|
|
98
|
-
var import_classnames2 = __toESM(
|
|
44
|
+
var import_classnames2 = __toESM(require("classnames"));
|
|
99
45
|
|
|
100
46
|
// src/utils/debounce.ts
|
|
101
47
|
var debounce = (func, wait, immediate) => {
|
|
@@ -201,7 +147,7 @@ var TooltipProvider_default = TooltipProvider;
|
|
|
201
147
|
|
|
202
148
|
// src/components/TooltipProvider/TooltipWrapper.tsx
|
|
203
149
|
var import_react2 = require("react");
|
|
204
|
-
var import_classnames = __toESM(
|
|
150
|
+
var import_classnames = __toESM(require("classnames"));
|
|
205
151
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
206
152
|
var TooltipWrapper = ({
|
|
207
153
|
tooltipId,
|
|
@@ -211,7 +157,7 @@ var TooltipWrapper = ({
|
|
|
211
157
|
content,
|
|
212
158
|
html,
|
|
213
159
|
variant,
|
|
214
|
-
offset,
|
|
160
|
+
offset: offset2,
|
|
215
161
|
wrapper,
|
|
216
162
|
events,
|
|
217
163
|
positionStrategy,
|
|
@@ -235,7 +181,7 @@ var TooltipWrapper = ({
|
|
|
235
181
|
"data-tooltip-content": content,
|
|
236
182
|
"data-tooltip-html": html,
|
|
237
183
|
"data-tooltip-variant": variant,
|
|
238
|
-
"data-tooltip-offset":
|
|
184
|
+
"data-tooltip-offset": offset2,
|
|
239
185
|
"data-tooltip-wrapper": wrapper,
|
|
240
186
|
"data-tooltip-events": events,
|
|
241
187
|
"data-tooltip-position-strategy": positionStrategy,
|
|
@@ -252,416 +198,8 @@ var import_react3 = require("react");
|
|
|
252
198
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react3.useLayoutEffect : import_react3.useEffect;
|
|
253
199
|
var use_isomorphic_layout_effect_default = useIsomorphicLayoutEffect;
|
|
254
200
|
|
|
255
|
-
// node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
|
|
256
|
-
function t(t2) {
|
|
257
|
-
return t2.split("-")[1];
|
|
258
|
-
}
|
|
259
|
-
function e(t2) {
|
|
260
|
-
return "y" === t2 ? "height" : "width";
|
|
261
|
-
}
|
|
262
|
-
function n(t2) {
|
|
263
|
-
return t2.split("-")[0];
|
|
264
|
-
}
|
|
265
|
-
function o(t2) {
|
|
266
|
-
return ["top", "bottom"].includes(n(t2)) ? "x" : "y";
|
|
267
|
-
}
|
|
268
|
-
function i(i3, r3, a3) {
|
|
269
|
-
let { reference: l3, floating: s3 } = i3;
|
|
270
|
-
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;
|
|
271
|
-
let p3;
|
|
272
|
-
switch (n(r3)) {
|
|
273
|
-
case "top":
|
|
274
|
-
p3 = { x: c3, y: l3.y - s3.height };
|
|
275
|
-
break;
|
|
276
|
-
case "bottom":
|
|
277
|
-
p3 = { x: c3, y: l3.y + l3.height };
|
|
278
|
-
break;
|
|
279
|
-
case "right":
|
|
280
|
-
p3 = { x: l3.x + l3.width, y: f3 };
|
|
281
|
-
break;
|
|
282
|
-
case "left":
|
|
283
|
-
p3 = { x: l3.x - s3.width, y: f3 };
|
|
284
|
-
break;
|
|
285
|
-
default:
|
|
286
|
-
p3 = { x: l3.x, y: l3.y };
|
|
287
|
-
}
|
|
288
|
-
switch (t(r3)) {
|
|
289
|
-
case "start":
|
|
290
|
-
p3[m3] -= g3 * (a3 && d3 ? -1 : 1);
|
|
291
|
-
break;
|
|
292
|
-
case "end":
|
|
293
|
-
p3[m3] += g3 * (a3 && d3 ? -1 : 1);
|
|
294
|
-
}
|
|
295
|
-
return p3;
|
|
296
|
-
}
|
|
297
|
-
var r = async (t2, e2, n3) => {
|
|
298
|
-
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));
|
|
299
|
-
let f3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }), { x: m3, y: u3 } = i(f3, o3, c3), g3 = o3, d3 = {}, p3 = 0;
|
|
300
|
-
for (let n4 = 0; n4 < s3.length; n4++) {
|
|
301
|
-
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 } });
|
|
302
|
-
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);
|
|
303
|
-
}
|
|
304
|
-
return { x: m3, y: u3, placement: g3, strategy: r3, middlewareData: d3 };
|
|
305
|
-
};
|
|
306
|
-
function a(t2) {
|
|
307
|
-
return "number" != typeof t2 ? function(t3) {
|
|
308
|
-
return { top: 0, right: 0, bottom: 0, left: 0, ...t3 };
|
|
309
|
-
}(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
|
|
310
|
-
}
|
|
311
|
-
function l(t2) {
|
|
312
|
-
return { ...t2, top: t2.y, left: t2.x, right: t2.x + t2.width, bottom: t2.y + t2.height };
|
|
313
|
-
}
|
|
314
|
-
async function s(t2, e2) {
|
|
315
|
-
var n3;
|
|
316
|
-
void 0 === e2 && (e2 = {});
|
|
317
|
-
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);
|
|
318
|
-
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 };
|
|
319
|
-
}
|
|
320
|
-
var c = Math.min;
|
|
321
|
-
var f = Math.max;
|
|
322
|
-
function m(t2, e2, n3) {
|
|
323
|
-
return f(t2, c(e2, n3));
|
|
324
|
-
}
|
|
325
|
-
var u = (n3) => ({ name: "arrow", options: n3, async fn(i3) {
|
|
326
|
-
const { element: r3, padding: l3 = 0 } = n3 || {}, { x: s3, y: c3, placement: f3, rects: u3, platform: g3, elements: d3 } = i3;
|
|
327
|
-
if (null == r3)
|
|
328
|
-
return {};
|
|
329
|
-
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));
|
|
330
|
-
let E3 = O3 ? O3[A2] : 0;
|
|
331
|
-
E3 && await (null == g3.isElement ? void 0 : g3.isElement(O3)) || (E3 = d3.floating[A2] || u3.floating[x3]);
|
|
332
|
-
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;
|
|
333
|
-
return { [y3]: h3[y3] - (H2 ? B < L3 ? L3 - B : k2 - B : 0), data: { [y3]: C2, centerOffset: B - C2 } };
|
|
334
|
-
} });
|
|
335
|
-
var g = ["top", "right", "bottom", "left"];
|
|
336
|
-
var d = g.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
|
|
337
|
-
var p = { left: "right", right: "left", bottom: "top", top: "bottom" };
|
|
338
|
-
function h(t2) {
|
|
339
|
-
return t2.replace(/left|right|bottom|top/g, (t3) => p[t3]);
|
|
340
|
-
}
|
|
341
|
-
function y(n3, i3, r3) {
|
|
342
|
-
void 0 === r3 && (r3 = false);
|
|
343
|
-
const a3 = t(n3), l3 = o(n3), s3 = e(l3);
|
|
344
|
-
let c3 = "x" === l3 ? a3 === (r3 ? "end" : "start") ? "right" : "left" : "start" === a3 ? "bottom" : "top";
|
|
345
|
-
return i3.reference[s3] > i3.floating[s3] && (c3 = h(c3)), { main: c3, cross: h(c3) };
|
|
346
|
-
}
|
|
347
|
-
var x = { start: "end", end: "start" };
|
|
348
|
-
function w(t2) {
|
|
349
|
-
return t2.replace(/start|end/g, (t3) => x[t3]);
|
|
350
|
-
}
|
|
351
|
-
var b = function(e2) {
|
|
352
|
-
return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(o3) {
|
|
353
|
-
var i3;
|
|
354
|
-
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) {
|
|
355
|
-
const e3 = h(t2);
|
|
356
|
-
return [w(t2), e3, w(e3)];
|
|
357
|
-
}(c3));
|
|
358
|
-
d3 || "none" === x3 || T3.push(...function(e3, o4, i4, r4) {
|
|
359
|
-
const a4 = t(e3);
|
|
360
|
-
let l4 = function(t2, e4, n3) {
|
|
361
|
-
const o5 = ["left", "right"], i5 = ["right", "left"], r5 = ["top", "bottom"], a5 = ["bottom", "top"];
|
|
362
|
-
switch (t2) {
|
|
363
|
-
case "top":
|
|
364
|
-
case "bottom":
|
|
365
|
-
return n3 ? e4 ? i5 : o5 : e4 ? o5 : i5;
|
|
366
|
-
case "left":
|
|
367
|
-
case "right":
|
|
368
|
-
return e4 ? r5 : a5;
|
|
369
|
-
default:
|
|
370
|
-
return [];
|
|
371
|
-
}
|
|
372
|
-
}(n(e3), "start" === i4, r4);
|
|
373
|
-
return a4 && (l4 = l4.map((t2) => t2 + "-" + a4), o4 && (l4 = l4.concat(l4.map(w)))), l4;
|
|
374
|
-
}(c3, v3, x3, P2));
|
|
375
|
-
const O3 = [c3, ...T3], E3 = await s(o3, b3), D3 = [];
|
|
376
|
-
let L3 = (null == (i3 = a3.flip) ? void 0 : i3.overflows) || [];
|
|
377
|
-
if (u3 && D3.push(E3[R2]), g3) {
|
|
378
|
-
const { main: t2, cross: e3 } = y(r3, l3, P2);
|
|
379
|
-
D3.push(E3[t2], E3[e3]);
|
|
380
|
-
}
|
|
381
|
-
if (L3 = [...L3, { placement: r3, overflows: D3 }], !D3.every((t2) => t2 <= 0)) {
|
|
382
|
-
var k2, B;
|
|
383
|
-
const t2 = ((null == (k2 = a3.flip) ? void 0 : k2.index) || 0) + 1, e3 = O3[t2];
|
|
384
|
-
if (e3)
|
|
385
|
-
return { data: { index: t2, overflows: L3 }, reset: { placement: e3 } };
|
|
386
|
-
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;
|
|
387
|
-
if (!n3)
|
|
388
|
-
switch (p3) {
|
|
389
|
-
case "bestFit": {
|
|
390
|
-
var C2;
|
|
391
|
-
const t3 = null == (C2 = L3.map((t4) => [t4.placement, t4.overflows.filter((t5) => t5 > 0).reduce((t5, e4) => t5 + e4, 0)]).sort((t4, e4) => t4[1] - e4[1])[0]) ? void 0 : C2[0];
|
|
392
|
-
t3 && (n3 = t3);
|
|
393
|
-
break;
|
|
394
|
-
}
|
|
395
|
-
case "initialPlacement":
|
|
396
|
-
n3 = c3;
|
|
397
|
-
}
|
|
398
|
-
if (r3 !== n3)
|
|
399
|
-
return { reset: { placement: n3 } };
|
|
400
|
-
}
|
|
401
|
-
return {};
|
|
402
|
-
} };
|
|
403
|
-
};
|
|
404
|
-
var O = function(e2) {
|
|
405
|
-
return void 0 === e2 && (e2 = 0), { name: "offset", options: e2, async fn(i3) {
|
|
406
|
-
const { x: r3, y: a3 } = i3, l3 = await async function(e3, i4) {
|
|
407
|
-
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;
|
|
408
|
-
let { mainAxis: p3, crossAxis: h3, alignmentAxis: y3 } = "number" == typeof d3 ? { mainAxis: d3, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...d3 };
|
|
409
|
-
return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3), m3 ? { x: h3 * g3, y: p3 * u3 } : { x: p3 * u3, y: h3 * g3 };
|
|
410
|
-
}(i3, e2);
|
|
411
|
-
return { x: r3 + l3.x, y: a3 + l3.y, data: l3 };
|
|
412
|
-
} };
|
|
413
|
-
};
|
|
414
|
-
function E(t2) {
|
|
415
|
-
return "x" === t2 ? "y" : "x";
|
|
416
|
-
}
|
|
417
|
-
var D = function(t2) {
|
|
418
|
-
return void 0 === t2 && (t2 = {}), { name: "shift", options: t2, async fn(e2) {
|
|
419
|
-
const { x: i3, y: r3, placement: a3 } = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t3) => {
|
|
420
|
-
let { x: e3, y: n3 } = t3;
|
|
421
|
-
return { x: e3, y: n3 };
|
|
422
|
-
} }, ...u3 } = t2, g3 = { x: i3, y: r3 }, d3 = await s(e2, u3), p3 = o(n(a3)), h3 = E(p3);
|
|
423
|
-
let y3 = g3[p3], x3 = g3[h3];
|
|
424
|
-
if (l3) {
|
|
425
|
-
const t3 = "y" === p3 ? "bottom" : "right";
|
|
426
|
-
y3 = m(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t3]);
|
|
427
|
-
}
|
|
428
|
-
if (c3) {
|
|
429
|
-
const t3 = "y" === h3 ? "bottom" : "right";
|
|
430
|
-
x3 = m(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t3]);
|
|
431
|
-
}
|
|
432
|
-
const w3 = f3.fn({ ...e2, [p3]: y3, [h3]: x3 });
|
|
433
|
-
return { ...w3, data: { x: w3.x - i3, y: w3.y - r3 } };
|
|
434
|
-
} };
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
// node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs
|
|
438
|
-
function n2(t2) {
|
|
439
|
-
var e2;
|
|
440
|
-
return (null == (e2 = t2.ownerDocument) ? void 0 : e2.defaultView) || window;
|
|
441
|
-
}
|
|
442
|
-
function o2(t2) {
|
|
443
|
-
return n2(t2).getComputedStyle(t2);
|
|
444
|
-
}
|
|
445
|
-
var i2 = Math.min;
|
|
446
|
-
var r2 = Math.max;
|
|
447
|
-
var l2 = Math.round;
|
|
448
|
-
function c2(t2) {
|
|
449
|
-
const e2 = o2(t2);
|
|
450
|
-
let n3 = parseFloat(e2.width), i3 = parseFloat(e2.height);
|
|
451
|
-
const r3 = t2.offsetWidth, c3 = t2.offsetHeight, s3 = l2(n3) !== r3 || l2(i3) !== c3;
|
|
452
|
-
return s3 && (n3 = r3, i3 = c3), { width: n3, height: i3, fallback: s3 };
|
|
453
|
-
}
|
|
454
|
-
function s2(t2) {
|
|
455
|
-
return h2(t2) ? (t2.nodeName || "").toLowerCase() : "";
|
|
456
|
-
}
|
|
457
|
-
var f2;
|
|
458
|
-
function u2() {
|
|
459
|
-
if (f2)
|
|
460
|
-
return f2;
|
|
461
|
-
const t2 = navigator.userAgentData;
|
|
462
|
-
return t2 && Array.isArray(t2.brands) ? (f2 = t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" "), f2) : navigator.userAgent;
|
|
463
|
-
}
|
|
464
|
-
function a2(t2) {
|
|
465
|
-
return t2 instanceof n2(t2).HTMLElement;
|
|
466
|
-
}
|
|
467
|
-
function d2(t2) {
|
|
468
|
-
return t2 instanceof n2(t2).Element;
|
|
469
|
-
}
|
|
470
|
-
function h2(t2) {
|
|
471
|
-
return t2 instanceof n2(t2).Node;
|
|
472
|
-
}
|
|
473
|
-
function p2(t2) {
|
|
474
|
-
if ("undefined" == typeof ShadowRoot)
|
|
475
|
-
return false;
|
|
476
|
-
return t2 instanceof n2(t2).ShadowRoot || t2 instanceof ShadowRoot;
|
|
477
|
-
}
|
|
478
|
-
function g2(t2) {
|
|
479
|
-
const { overflow: e2, overflowX: n3, overflowY: i3, display: r3 } = o2(t2);
|
|
480
|
-
return /auto|scroll|overlay|hidden|clip/.test(e2 + i3 + n3) && !["inline", "contents"].includes(r3);
|
|
481
|
-
}
|
|
482
|
-
function m2(t2) {
|
|
483
|
-
return ["table", "td", "th"].includes(s2(t2));
|
|
484
|
-
}
|
|
485
|
-
function y2(t2) {
|
|
486
|
-
const e2 = /firefox/i.test(u2()), n3 = o2(t2), i3 = n3.backdropFilter || n3.WebkitBackdropFilter;
|
|
487
|
-
return "none" !== n3.transform || "none" !== n3.perspective || !!i3 && "none" !== i3 || e2 && "filter" === n3.willChange || e2 && !!n3.filter && "none" !== n3.filter || ["transform", "perspective"].some((t3) => n3.willChange.includes(t3)) || ["paint", "layout", "strict", "content"].some((t3) => {
|
|
488
|
-
const e3 = n3.contain;
|
|
489
|
-
return null != e3 && e3.includes(t3);
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
function x2() {
|
|
493
|
-
return /^((?!chrome|android).)*safari/i.test(u2());
|
|
494
|
-
}
|
|
495
|
-
function w2(t2) {
|
|
496
|
-
return ["html", "body", "#document"].includes(s2(t2));
|
|
497
|
-
}
|
|
498
|
-
function v2(t2) {
|
|
499
|
-
return d2(t2) ? t2 : t2.contextElement;
|
|
500
|
-
}
|
|
501
|
-
var b2 = { x: 1, y: 1 };
|
|
502
|
-
function L2(t2) {
|
|
503
|
-
const e2 = v2(t2);
|
|
504
|
-
if (!a2(e2))
|
|
505
|
-
return b2;
|
|
506
|
-
const n3 = e2.getBoundingClientRect(), { width: o3, height: i3, fallback: r3 } = c2(e2);
|
|
507
|
-
let s3 = (r3 ? l2(n3.width) : n3.width) / o3, f3 = (r3 ? l2(n3.height) : n3.height) / i3;
|
|
508
|
-
return s3 && Number.isFinite(s3) || (s3 = 1), f3 && Number.isFinite(f3) || (f3 = 1), { x: s3, y: f3 };
|
|
509
|
-
}
|
|
510
|
-
function E2(e2, o3, i3, r3) {
|
|
511
|
-
var l3, c3;
|
|
512
|
-
void 0 === o3 && (o3 = false), void 0 === i3 && (i3 = false);
|
|
513
|
-
const s3 = e2.getBoundingClientRect(), f3 = v2(e2);
|
|
514
|
-
let u3 = b2;
|
|
515
|
-
o3 && (r3 ? d2(r3) && (u3 = L2(r3)) : u3 = L2(e2));
|
|
516
|
-
const a3 = f3 ? n2(f3) : window, h3 = x2() && i3;
|
|
517
|
-
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;
|
|
518
|
-
if (f3) {
|
|
519
|
-
const t2 = n2(f3), e3 = r3 && d2(r3) ? n2(r3) : r3;
|
|
520
|
-
let o4 = t2.frameElement;
|
|
521
|
-
for (; o4 && r3 && e3 !== t2; ) {
|
|
522
|
-
const t3 = L2(o4), e4 = o4.getBoundingClientRect(), i4 = getComputedStyle(o4);
|
|
523
|
-
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;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return l({ width: m3, height: y3, x: p3, y: g3 });
|
|
527
|
-
}
|
|
528
|
-
function R(t2) {
|
|
529
|
-
return ((h2(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
|
|
530
|
-
}
|
|
531
|
-
function T2(t2) {
|
|
532
|
-
return d2(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.pageXOffset, scrollTop: t2.pageYOffset };
|
|
533
|
-
}
|
|
534
|
-
function C(t2) {
|
|
535
|
-
return E2(R(t2)).left + T2(t2).scrollLeft;
|
|
536
|
-
}
|
|
537
|
-
function F(t2) {
|
|
538
|
-
if ("html" === s2(t2))
|
|
539
|
-
return t2;
|
|
540
|
-
const e2 = t2.assignedSlot || t2.parentNode || p2(t2) && t2.host || R(t2);
|
|
541
|
-
return p2(e2) ? e2.host : e2;
|
|
542
|
-
}
|
|
543
|
-
function W(t2) {
|
|
544
|
-
const e2 = F(t2);
|
|
545
|
-
return w2(e2) ? e2.ownerDocument.body : a2(e2) && g2(e2) ? e2 : W(e2);
|
|
546
|
-
}
|
|
547
|
-
function D2(t2, e2) {
|
|
548
|
-
var o3;
|
|
549
|
-
void 0 === e2 && (e2 = []);
|
|
550
|
-
const i3 = W(t2), r3 = i3 === (null == (o3 = t2.ownerDocument) ? void 0 : o3.body), l3 = n2(i3);
|
|
551
|
-
return r3 ? e2.concat(l3, l3.visualViewport || [], g2(i3) ? i3 : []) : e2.concat(i3, D2(i3));
|
|
552
|
-
}
|
|
553
|
-
function S(e2, i3, l3) {
|
|
554
|
-
let c3;
|
|
555
|
-
if ("viewport" === i3)
|
|
556
|
-
c3 = function(t2, e3) {
|
|
557
|
-
const o3 = n2(t2), i4 = R(t2), r3 = o3.visualViewport;
|
|
558
|
-
let l4 = i4.clientWidth, c4 = i4.clientHeight, s4 = 0, f4 = 0;
|
|
559
|
-
if (r3) {
|
|
560
|
-
l4 = r3.width, c4 = r3.height;
|
|
561
|
-
const t3 = x2();
|
|
562
|
-
(!t3 || t3 && "fixed" === e3) && (s4 = r3.offsetLeft, f4 = r3.offsetTop);
|
|
563
|
-
}
|
|
564
|
-
return { width: l4, height: c4, x: s4, y: f4 };
|
|
565
|
-
}(e2, l3);
|
|
566
|
-
else if ("document" === i3)
|
|
567
|
-
c3 = function(t2) {
|
|
568
|
-
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);
|
|
569
|
-
let s4 = -n3.scrollLeft + C(t2);
|
|
570
|
-
const f4 = -n3.scrollTop;
|
|
571
|
-
return "rtl" === o2(i4).direction && (s4 += r2(e3.clientWidth, i4.clientWidth) - l4), { width: l4, height: c4, x: s4, y: f4 };
|
|
572
|
-
}(R(e2));
|
|
573
|
-
else if (d2(i3))
|
|
574
|
-
c3 = function(t2, e3) {
|
|
575
|
-
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 };
|
|
576
|
-
return { width: t2.clientWidth * r3.x, height: t2.clientHeight * r3.y, x: i4 * r3.x, y: o3 * r3.y };
|
|
577
|
-
}(i3, l3);
|
|
578
|
-
else {
|
|
579
|
-
const t2 = { ...i3 };
|
|
580
|
-
if (x2()) {
|
|
581
|
-
var s3, f3;
|
|
582
|
-
const o3 = n2(e2);
|
|
583
|
-
t2.x -= (null == (s3 = o3.visualViewport) ? void 0 : s3.offsetLeft) || 0, t2.y -= (null == (f3 = o3.visualViewport) ? void 0 : f3.offsetTop) || 0;
|
|
584
|
-
}
|
|
585
|
-
c3 = t2;
|
|
586
|
-
}
|
|
587
|
-
return l(c3);
|
|
588
|
-
}
|
|
589
|
-
function A(t2, e2) {
|
|
590
|
-
return a2(t2) && "fixed" !== o2(t2).position ? e2 ? e2(t2) : t2.offsetParent : null;
|
|
591
|
-
}
|
|
592
|
-
function H(t2, e2) {
|
|
593
|
-
const i3 = n2(t2);
|
|
594
|
-
if (!a2(t2))
|
|
595
|
-
return i3;
|
|
596
|
-
let r3 = A(t2, e2);
|
|
597
|
-
for (; r3 && m2(r3) && "static" === o2(r3).position; )
|
|
598
|
-
r3 = A(r3, e2);
|
|
599
|
-
return r3 && ("html" === s2(r3) || "body" === s2(r3) && "static" === o2(r3).position && !y2(r3)) ? i3 : r3 || function(t3) {
|
|
600
|
-
let e3 = F(t3);
|
|
601
|
-
for (; a2(e3) && !w2(e3); ) {
|
|
602
|
-
if (y2(e3))
|
|
603
|
-
return e3;
|
|
604
|
-
e3 = F(e3);
|
|
605
|
-
}
|
|
606
|
-
return null;
|
|
607
|
-
}(t2) || i3;
|
|
608
|
-
}
|
|
609
|
-
function V(t2, e2, n3) {
|
|
610
|
-
const o3 = a2(e2), i3 = R(e2), r3 = E2(t2, true, "fixed" === n3, e2);
|
|
611
|
-
let l3 = { scrollLeft: 0, scrollTop: 0 };
|
|
612
|
-
const c3 = { x: 0, y: 0 };
|
|
613
|
-
if (o3 || !o3 && "fixed" !== n3)
|
|
614
|
-
if (("body" !== s2(e2) || g2(i3)) && (l3 = T2(e2)), a2(e2)) {
|
|
615
|
-
const t3 = E2(e2, true);
|
|
616
|
-
c3.x = t3.x + e2.clientLeft, c3.y = t3.y + e2.clientTop;
|
|
617
|
-
} else
|
|
618
|
-
i3 && (c3.x = C(i3));
|
|
619
|
-
return { x: r3.left + l3.scrollLeft - c3.x, y: r3.top + l3.scrollTop - c3.y, width: r3.width, height: r3.height };
|
|
620
|
-
}
|
|
621
|
-
var O2 = { getClippingRect: function(t2) {
|
|
622
|
-
let { element: e2, boundary: n3, rootBoundary: l3, strategy: c3 } = t2;
|
|
623
|
-
const f3 = "clippingAncestors" === n3 ? function(t3, e3) {
|
|
624
|
-
const n4 = e3.get(t3);
|
|
625
|
-
if (n4)
|
|
626
|
-
return n4;
|
|
627
|
-
let i3 = D2(t3).filter((t4) => d2(t4) && "body" !== s2(t4)), r3 = null;
|
|
628
|
-
const l4 = "fixed" === o2(t3).position;
|
|
629
|
-
let c4 = l4 ? F(t3) : t3;
|
|
630
|
-
for (; d2(c4) && !w2(c4); ) {
|
|
631
|
-
const t4 = o2(c4), e4 = y2(c4);
|
|
632
|
-
"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);
|
|
633
|
-
}
|
|
634
|
-
return e3.set(t3, i3), i3;
|
|
635
|
-
}(e2, this._c) : [].concat(n3), u3 = [...f3, l3], a3 = u3[0], h3 = u3.reduce((t3, n4) => {
|
|
636
|
-
const o3 = S(e2, n4, c3);
|
|
637
|
-
return t3.top = r2(o3.top, t3.top), t3.right = i2(o3.right, t3.right), t3.bottom = i2(o3.bottom, t3.bottom), t3.left = r2(o3.left, t3.left), t3;
|
|
638
|
-
}, S(e2, a3, c3));
|
|
639
|
-
return { width: h3.right - h3.left, height: h3.bottom - h3.top, x: h3.left, y: h3.top };
|
|
640
|
-
}, convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
|
|
641
|
-
let { rect: e2, offsetParent: n3, strategy: o3 } = t2;
|
|
642
|
-
const i3 = a2(n3), r3 = R(n3);
|
|
643
|
-
if (n3 === r3)
|
|
644
|
-
return e2;
|
|
645
|
-
let l3 = { scrollLeft: 0, scrollTop: 0 }, c3 = { x: 1, y: 1 };
|
|
646
|
-
const f3 = { x: 0, y: 0 };
|
|
647
|
-
if ((i3 || !i3 && "fixed" !== o3) && (("body" !== s2(n3) || g2(r3)) && (l3 = T2(n3)), a2(n3))) {
|
|
648
|
-
const t3 = E2(n3);
|
|
649
|
-
c3 = L2(n3), f3.x = t3.x + n3.clientLeft, f3.y = t3.y + n3.clientTop;
|
|
650
|
-
}
|
|
651
|
-
return { width: e2.width * c3.x, height: e2.height * c3.y, x: e2.x * c3.x - l3.scrollLeft * c3.x + f3.x, y: e2.y * c3.y - l3.scrollTop * c3.y + f3.y };
|
|
652
|
-
}, isElement: d2, getDimensions: function(t2) {
|
|
653
|
-
return a2(t2) ? c2(t2) : t2.getBoundingClientRect();
|
|
654
|
-
}, getOffsetParent: H, getDocumentElement: R, getScale: L2, async getElementRects(t2) {
|
|
655
|
-
let { reference: e2, floating: n3, strategy: o3 } = t2;
|
|
656
|
-
const i3 = this.getOffsetParent || H, r3 = this.getDimensions;
|
|
657
|
-
return { reference: V(e2, await i3(n3), o3), floating: { x: 0, y: 0, ...await r3(n3) } };
|
|
658
|
-
}, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === o2(t2).direction };
|
|
659
|
-
var z = (t2, n3, o3) => {
|
|
660
|
-
const i3 = /* @__PURE__ */ new Map(), r3 = { platform: O2, ...o3 }, l3 = { ...r3.platform, _c: i3 };
|
|
661
|
-
return r(t2, n3, { ...r3, platform: l3 });
|
|
662
|
-
};
|
|
663
|
-
|
|
664
201
|
// src/utils/compute-positions.ts
|
|
202
|
+
var import_dom = require("@floating-ui/dom");
|
|
665
203
|
var computeTooltipPosition = async ({
|
|
666
204
|
elementReference = null,
|
|
667
205
|
tooltipReference = null,
|
|
@@ -669,24 +207,24 @@ var computeTooltipPosition = async ({
|
|
|
669
207
|
place = "top",
|
|
670
208
|
offset: offsetValue = 10,
|
|
671
209
|
strategy = "absolute",
|
|
672
|
-
middlewares = [
|
|
210
|
+
middlewares = [(0, import_dom.offset)(Number(offsetValue)), (0, import_dom.flip)(), (0, import_dom.shift)({ padding: 5 })]
|
|
673
211
|
}) => {
|
|
674
212
|
if (!elementReference) {
|
|
675
|
-
return { tooltipStyles: {}, tooltipArrowStyles: {}
|
|
213
|
+
return { tooltipStyles: {}, tooltipArrowStyles: {} };
|
|
676
214
|
}
|
|
677
215
|
if (tooltipReference === null) {
|
|
678
|
-
return { tooltipStyles: {}, tooltipArrowStyles: {}
|
|
216
|
+
return { tooltipStyles: {}, tooltipArrowStyles: {} };
|
|
679
217
|
}
|
|
680
218
|
const middleware = middlewares;
|
|
681
219
|
if (tooltipArrowReference) {
|
|
682
|
-
middleware.push(
|
|
683
|
-
return
|
|
220
|
+
middleware.push((0, import_dom.arrow)({ element: tooltipArrowReference, padding: 5 }));
|
|
221
|
+
return (0, import_dom.computePosition)(elementReference, tooltipReference, {
|
|
684
222
|
placement: place,
|
|
685
223
|
strategy,
|
|
686
224
|
middleware
|
|
687
|
-
}).then(({ x
|
|
225
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
688
226
|
var _a, _b;
|
|
689
|
-
const styles = { left: `${
|
|
227
|
+
const styles = { left: `${x}px`, top: `${y}px` };
|
|
690
228
|
const { x: arrowX, y: arrowY } = (_a = middlewareData.arrow) != null ? _a : { x: 0, y: 0 };
|
|
691
229
|
const staticSide = (_b = {
|
|
692
230
|
top: "bottom",
|
|
@@ -701,16 +239,16 @@ var computeTooltipPosition = async ({
|
|
|
701
239
|
bottom: "",
|
|
702
240
|
[staticSide]: "-4px"
|
|
703
241
|
};
|
|
704
|
-
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle
|
|
242
|
+
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle };
|
|
705
243
|
});
|
|
706
244
|
}
|
|
707
|
-
return
|
|
245
|
+
return (0, import_dom.computePosition)(elementReference, tooltipReference, {
|
|
708
246
|
placement: "bottom",
|
|
709
247
|
strategy,
|
|
710
248
|
middleware
|
|
711
|
-
}).then(({ x
|
|
712
|
-
const styles = { left: `${
|
|
713
|
-
return { tooltipStyles: styles, tooltipArrowStyles: {}
|
|
249
|
+
}).then(({ x, y }) => {
|
|
250
|
+
const styles = { left: `${x}px`, top: `${y}px` };
|
|
251
|
+
return { tooltipStyles: styles, tooltipArrowStyles: {} };
|
|
714
252
|
});
|
|
715
253
|
};
|
|
716
254
|
|
|
@@ -728,7 +266,7 @@ var Tooltip = ({
|
|
|
728
266
|
anchorId,
|
|
729
267
|
anchorSelect,
|
|
730
268
|
place = "top",
|
|
731
|
-
offset = 10,
|
|
269
|
+
offset: offset2 = 10,
|
|
732
270
|
events = ["hover"],
|
|
733
271
|
positionStrategy = "absolute",
|
|
734
272
|
middlewares,
|
|
@@ -756,7 +294,6 @@ var Tooltip = ({
|
|
|
756
294
|
const tooltipArrowRef = (0, import_react4.useRef)(null);
|
|
757
295
|
const tooltipShowDelayTimerRef = (0, import_react4.useRef)(null);
|
|
758
296
|
const tooltipHideDelayTimerRef = (0, import_react4.useRef)(null);
|
|
759
|
-
const [actualPlacement, setActualPlacement] = (0, import_react4.useState)(place);
|
|
760
297
|
const [inlineStyles, setInlineStyles] = (0, import_react4.useState)({});
|
|
761
298
|
const [inlineArrowStyles, setInlineArrowStyles] = (0, import_react4.useState)({});
|
|
762
299
|
const [show, setShow] = (0, import_react4.useState)(false);
|
|
@@ -874,24 +411,24 @@ var Tooltip = ({
|
|
|
874
411
|
clearTimeout(tooltipShowDelayTimerRef.current);
|
|
875
412
|
}
|
|
876
413
|
};
|
|
877
|
-
const handleTooltipPosition = ({ x
|
|
414
|
+
const handleTooltipPosition = ({ x, y }) => {
|
|
878
415
|
const virtualElement = {
|
|
879
416
|
getBoundingClientRect() {
|
|
880
417
|
return {
|
|
881
|
-
x
|
|
882
|
-
y
|
|
418
|
+
x,
|
|
419
|
+
y,
|
|
883
420
|
width: 0,
|
|
884
421
|
height: 0,
|
|
885
|
-
top:
|
|
886
|
-
left:
|
|
887
|
-
right:
|
|
888
|
-
bottom:
|
|
422
|
+
top: y,
|
|
423
|
+
left: x,
|
|
424
|
+
right: x,
|
|
425
|
+
bottom: y
|
|
889
426
|
};
|
|
890
427
|
}
|
|
891
428
|
};
|
|
892
429
|
computeTooltipPosition({
|
|
893
430
|
place,
|
|
894
|
-
offset,
|
|
431
|
+
offset: offset2,
|
|
895
432
|
elementReference: virtualElement,
|
|
896
433
|
tooltipReference: tooltipRef.current,
|
|
897
434
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
@@ -904,7 +441,6 @@ var Tooltip = ({
|
|
|
904
441
|
if (Object.keys(computedStylesData.tooltipArrowStyles).length) {
|
|
905
442
|
setInlineArrowStyles(computedStylesData.tooltipArrowStyles);
|
|
906
443
|
}
|
|
907
|
-
setActualPlacement(computedStylesData.place);
|
|
908
444
|
});
|
|
909
445
|
};
|
|
910
446
|
const handleMouseMove = (event) => {
|
|
@@ -1056,7 +592,7 @@ var Tooltip = ({
|
|
|
1056
592
|
(element) => [...element.querySelectorAll(selector)]
|
|
1057
593
|
)
|
|
1058
594
|
);
|
|
1059
|
-
} catch (
|
|
595
|
+
} catch (e) {
|
|
1060
596
|
}
|
|
1061
597
|
});
|
|
1062
598
|
if (newAnchors.length) {
|
|
@@ -1087,7 +623,7 @@ var Tooltip = ({
|
|
|
1087
623
|
}
|
|
1088
624
|
computeTooltipPosition({
|
|
1089
625
|
place,
|
|
1090
|
-
offset,
|
|
626
|
+
offset: offset2,
|
|
1091
627
|
elementReference: activeAnchor,
|
|
1092
628
|
tooltipReference: tooltipRef.current,
|
|
1093
629
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
@@ -1103,9 +639,8 @@ var Tooltip = ({
|
|
|
1103
639
|
if (Object.keys(computedStylesData.tooltipArrowStyles).length) {
|
|
1104
640
|
setInlineArrowStyles(computedStylesData.tooltipArrowStyles);
|
|
1105
641
|
}
|
|
1106
|
-
setActualPlacement(computedStylesData.place);
|
|
1107
642
|
});
|
|
1108
|
-
}, [show, activeAnchor, content, html, place,
|
|
643
|
+
}, [show, activeAnchor, content, html, place, offset2, positionStrategy, position]);
|
|
1109
644
|
(0, import_react4.useEffect)(() => {
|
|
1110
645
|
var _a;
|
|
1111
646
|
const anchorById = document.querySelector(`[id='${anchorId}']`);
|
|
@@ -1135,7 +670,7 @@ var Tooltip = ({
|
|
|
1135
670
|
try {
|
|
1136
671
|
const anchors = Array.from(document.querySelectorAll(selector));
|
|
1137
672
|
setAnchorsBySelect(anchors);
|
|
1138
|
-
} catch (
|
|
673
|
+
} catch (e) {
|
|
1139
674
|
setAnchorsBySelect([]);
|
|
1140
675
|
}
|
|
1141
676
|
}, [id, anchorSelect]);
|
|
@@ -1149,11 +684,7 @@ var Tooltip = ({
|
|
|
1149
684
|
className: (0, import_classnames2.default)("react-tooltip", styles_module_default["tooltip"], styles_module_default[variant], className, {
|
|
1150
685
|
[styles_module_default["show"]]: canShow,
|
|
1151
686
|
[styles_module_default["fixed"]]: positionStrategy === "fixed",
|
|
1152
|
-
[styles_module_default["clickable"]]: clickable
|
|
1153
|
-
"react-tooltip__place-top": actualPlacement === "top",
|
|
1154
|
-
"react-tooltip__place-right": actualPlacement === "right",
|
|
1155
|
-
"react-tooltip__place-bottom": actualPlacement === "bottom",
|
|
1156
|
-
"react-tooltip__place-left": actualPlacement === "left"
|
|
687
|
+
[styles_module_default["clickable"]]: clickable
|
|
1157
688
|
}),
|
|
1158
689
|
style: { ...externalStyles, ...inlineStyles },
|
|
1159
690
|
ref: tooltipRef,
|
|
@@ -1191,7 +722,7 @@ var TooltipController = ({
|
|
|
1191
722
|
classNameArrow,
|
|
1192
723
|
variant = "dark",
|
|
1193
724
|
place = "top",
|
|
1194
|
-
offset = 10,
|
|
725
|
+
offset: offset2 = 10,
|
|
1195
726
|
wrapper = "div",
|
|
1196
727
|
children = null,
|
|
1197
728
|
events = ["hover"],
|
|
@@ -1214,7 +745,7 @@ var TooltipController = ({
|
|
|
1214
745
|
const [tooltipHtml, setTooltipHtml] = (0, import_react5.useState)(html);
|
|
1215
746
|
const [tooltipPlace, setTooltipPlace] = (0, import_react5.useState)(place);
|
|
1216
747
|
const [tooltipVariant, setTooltipVariant] = (0, import_react5.useState)(variant);
|
|
1217
|
-
const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(
|
|
748
|
+
const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(offset2);
|
|
1218
749
|
const [tooltipDelayShow, setTooltipDelayShow] = (0, import_react5.useState)(delayShow);
|
|
1219
750
|
const [tooltipDelayHide, setTooltipDelayHide] = (0, import_react5.useState)(delayHide);
|
|
1220
751
|
const [tooltipFloat, setTooltipFloat] = (0, import_react5.useState)(float);
|
|
@@ -1249,7 +780,7 @@ var TooltipController = ({
|
|
|
1249
780
|
setTooltipVariant(value != null ? value : variant);
|
|
1250
781
|
},
|
|
1251
782
|
offset: (value) => {
|
|
1252
|
-
setTooltipOffset(value === null ?
|
|
783
|
+
setTooltipOffset(value === null ? offset2 : Number(value));
|
|
1253
784
|
},
|
|
1254
785
|
wrapper: (value) => {
|
|
1255
786
|
setTooltipWrapper(value != null ? value : wrapper);
|
|
@@ -1299,7 +830,7 @@ var TooltipController = ({
|
|
|
1299
830
|
anchorsBySelect.forEach((anchor) => {
|
|
1300
831
|
elementRefs.add({ current: anchor });
|
|
1301
832
|
});
|
|
1302
|
-
} catch (
|
|
833
|
+
} catch (e) {
|
|
1303
834
|
if (true) {
|
|
1304
835
|
console.warn(`[react-tooltip] "${anchorSelect}" is not a valid CSS selector`);
|
|
1305
836
|
}
|
|
@@ -1367,13 +898,4 @@ var TooltipController = ({
|
|
|
1367
898
|
return children ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Tooltip_default, { ...props, children }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Tooltip_default, { ...props });
|
|
1368
899
|
};
|
|
1369
900
|
var TooltipController_default = TooltipController;
|
|
1370
|
-
/*! Bundled license information:
|
|
1371
|
-
|
|
1372
|
-
classnames/index.js:
|
|
1373
|
-
(*!
|
|
1374
|
-
Copyright (c) 2018 Jed Watson.
|
|
1375
|
-
Licensed under the MIT License (MIT), see
|
|
1376
|
-
http://jedwatson.github.io/classnames
|
|
1377
|
-
*)
|
|
1378
|
-
*/
|
|
1379
901
|
//# sourceMappingURL=react-tooltip.cjs.js.map
|