react-tooltip 5.10.1-beta.4 → 5.10.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/dist/react-tooltip.cjs.js +32 -502
- 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 +35 -528
- 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 +36 -506
- 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 +5 -12
|
@@ -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) => {
|
|
@@ -194,7 +140,7 @@ var TooltipProvider_default = TooltipProvider;
|
|
|
194
140
|
|
|
195
141
|
// src/components/TooltipProvider/TooltipWrapper.tsx
|
|
196
142
|
var import_react2 = require("react");
|
|
197
|
-
var import_classnames = __toESM(
|
|
143
|
+
var import_classnames = __toESM(require("classnames"));
|
|
198
144
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
199
145
|
var TooltipWrapper = ({
|
|
200
146
|
tooltipId,
|
|
@@ -204,7 +150,7 @@ var TooltipWrapper = ({
|
|
|
204
150
|
content,
|
|
205
151
|
html,
|
|
206
152
|
variant,
|
|
207
|
-
offset,
|
|
153
|
+
offset: offset2,
|
|
208
154
|
wrapper,
|
|
209
155
|
events,
|
|
210
156
|
positionStrategy,
|
|
@@ -228,7 +174,7 @@ var TooltipWrapper = ({
|
|
|
228
174
|
"data-tooltip-content": content,
|
|
229
175
|
"data-tooltip-html": html,
|
|
230
176
|
"data-tooltip-variant": variant,
|
|
231
|
-
"data-tooltip-offset":
|
|
177
|
+
"data-tooltip-offset": offset2,
|
|
232
178
|
"data-tooltip-wrapper": wrapper,
|
|
233
179
|
"data-tooltip-events": events,
|
|
234
180
|
"data-tooltip-position-strategy": positionStrategy,
|
|
@@ -245,416 +191,8 @@ var import_react3 = require("react");
|
|
|
245
191
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react3.useLayoutEffect : import_react3.useEffect;
|
|
246
192
|
var use_isomorphic_layout_effect_default = useIsomorphicLayoutEffect;
|
|
247
193
|
|
|
248
|
-
// node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
|
|
249
|
-
function t(t2) {
|
|
250
|
-
return t2.split("-")[1];
|
|
251
|
-
}
|
|
252
|
-
function e(t2) {
|
|
253
|
-
return "y" === t2 ? "height" : "width";
|
|
254
|
-
}
|
|
255
|
-
function n(t2) {
|
|
256
|
-
return t2.split("-")[0];
|
|
257
|
-
}
|
|
258
|
-
function o(t2) {
|
|
259
|
-
return ["top", "bottom"].includes(n(t2)) ? "x" : "y";
|
|
260
|
-
}
|
|
261
|
-
function i(i3, r3, a3) {
|
|
262
|
-
let { reference: l3, floating: s3 } = i3;
|
|
263
|
-
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;
|
|
264
|
-
let p3;
|
|
265
|
-
switch (n(r3)) {
|
|
266
|
-
case "top":
|
|
267
|
-
p3 = { x: c3, y: l3.y - s3.height };
|
|
268
|
-
break;
|
|
269
|
-
case "bottom":
|
|
270
|
-
p3 = { x: c3, y: l3.y + l3.height };
|
|
271
|
-
break;
|
|
272
|
-
case "right":
|
|
273
|
-
p3 = { x: l3.x + l3.width, y: f3 };
|
|
274
|
-
break;
|
|
275
|
-
case "left":
|
|
276
|
-
p3 = { x: l3.x - s3.width, y: f3 };
|
|
277
|
-
break;
|
|
278
|
-
default:
|
|
279
|
-
p3 = { x: l3.x, y: l3.y };
|
|
280
|
-
}
|
|
281
|
-
switch (t(r3)) {
|
|
282
|
-
case "start":
|
|
283
|
-
p3[m3] -= g3 * (a3 && d3 ? -1 : 1);
|
|
284
|
-
break;
|
|
285
|
-
case "end":
|
|
286
|
-
p3[m3] += g3 * (a3 && d3 ? -1 : 1);
|
|
287
|
-
}
|
|
288
|
-
return p3;
|
|
289
|
-
}
|
|
290
|
-
var r = async (t2, e2, n3) => {
|
|
291
|
-
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));
|
|
292
|
-
let f3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: r3 }), { x: m3, y: u3 } = i(f3, o3, c3), g3 = o3, d3 = {}, p3 = 0;
|
|
293
|
-
for (let n4 = 0; n4 < s3.length; n4++) {
|
|
294
|
-
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 } });
|
|
295
|
-
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);
|
|
296
|
-
}
|
|
297
|
-
return { x: m3, y: u3, placement: g3, strategy: r3, middlewareData: d3 };
|
|
298
|
-
};
|
|
299
|
-
function a(t2) {
|
|
300
|
-
return "number" != typeof t2 ? function(t3) {
|
|
301
|
-
return { top: 0, right: 0, bottom: 0, left: 0, ...t3 };
|
|
302
|
-
}(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
|
|
303
|
-
}
|
|
304
|
-
function l(t2) {
|
|
305
|
-
return { ...t2, top: t2.y, left: t2.x, right: t2.x + t2.width, bottom: t2.y + t2.height };
|
|
306
|
-
}
|
|
307
|
-
async function s(t2, e2) {
|
|
308
|
-
var n3;
|
|
309
|
-
void 0 === e2 && (e2 = {});
|
|
310
|
-
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);
|
|
311
|
-
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 };
|
|
312
|
-
}
|
|
313
|
-
var c = Math.min;
|
|
314
|
-
var f = Math.max;
|
|
315
|
-
function m(t2, e2, n3) {
|
|
316
|
-
return f(t2, c(e2, n3));
|
|
317
|
-
}
|
|
318
|
-
var u = (n3) => ({ name: "arrow", options: n3, async fn(i3) {
|
|
319
|
-
const { element: r3, padding: l3 = 0 } = n3 || {}, { x: s3, y: c3, placement: f3, rects: u3, platform: g3, elements: d3 } = i3;
|
|
320
|
-
if (null == r3)
|
|
321
|
-
return {};
|
|
322
|
-
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));
|
|
323
|
-
let E3 = O3 ? O3[A2] : 0;
|
|
324
|
-
E3 && await (null == g3.isElement ? void 0 : g3.isElement(O3)) || (E3 = d3.floating[A2] || u3.floating[x3]);
|
|
325
|
-
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;
|
|
326
|
-
return { [y3]: h3[y3] - (H2 ? B < L3 ? L3 - B : k2 - B : 0), data: { [y3]: C2, centerOffset: B - C2 } };
|
|
327
|
-
} });
|
|
328
|
-
var g = ["top", "right", "bottom", "left"];
|
|
329
|
-
var d = g.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
|
|
330
|
-
var p = { left: "right", right: "left", bottom: "top", top: "bottom" };
|
|
331
|
-
function h(t2) {
|
|
332
|
-
return t2.replace(/left|right|bottom|top/g, (t3) => p[t3]);
|
|
333
|
-
}
|
|
334
|
-
function y(n3, i3, r3) {
|
|
335
|
-
void 0 === r3 && (r3 = false);
|
|
336
|
-
const a3 = t(n3), l3 = o(n3), s3 = e(l3);
|
|
337
|
-
let c3 = "x" === l3 ? a3 === (r3 ? "end" : "start") ? "right" : "left" : "start" === a3 ? "bottom" : "top";
|
|
338
|
-
return i3.reference[s3] > i3.floating[s3] && (c3 = h(c3)), { main: c3, cross: h(c3) };
|
|
339
|
-
}
|
|
340
|
-
var x = { start: "end", end: "start" };
|
|
341
|
-
function w(t2) {
|
|
342
|
-
return t2.replace(/start|end/g, (t3) => x[t3]);
|
|
343
|
-
}
|
|
344
|
-
var b = function(e2) {
|
|
345
|
-
return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(o3) {
|
|
346
|
-
var i3;
|
|
347
|
-
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) {
|
|
348
|
-
const e3 = h(t2);
|
|
349
|
-
return [w(t2), e3, w(e3)];
|
|
350
|
-
}(c3));
|
|
351
|
-
d3 || "none" === x3 || T3.push(...function(e3, o4, i4, r4) {
|
|
352
|
-
const a4 = t(e3);
|
|
353
|
-
let l4 = function(t2, e4, n3) {
|
|
354
|
-
const o5 = ["left", "right"], i5 = ["right", "left"], r5 = ["top", "bottom"], a5 = ["bottom", "top"];
|
|
355
|
-
switch (t2) {
|
|
356
|
-
case "top":
|
|
357
|
-
case "bottom":
|
|
358
|
-
return n3 ? e4 ? i5 : o5 : e4 ? o5 : i5;
|
|
359
|
-
case "left":
|
|
360
|
-
case "right":
|
|
361
|
-
return e4 ? r5 : a5;
|
|
362
|
-
default:
|
|
363
|
-
return [];
|
|
364
|
-
}
|
|
365
|
-
}(n(e3), "start" === i4, r4);
|
|
366
|
-
return a4 && (l4 = l4.map((t2) => t2 + "-" + a4), o4 && (l4 = l4.concat(l4.map(w)))), l4;
|
|
367
|
-
}(c3, v3, x3, P2));
|
|
368
|
-
const O3 = [c3, ...T3], E3 = await s(o3, b3), D3 = [];
|
|
369
|
-
let L3 = (null == (i3 = a3.flip) ? void 0 : i3.overflows) || [];
|
|
370
|
-
if (u3 && D3.push(E3[R2]), g3) {
|
|
371
|
-
const { main: t2, cross: e3 } = y(r3, l3, P2);
|
|
372
|
-
D3.push(E3[t2], E3[e3]);
|
|
373
|
-
}
|
|
374
|
-
if (L3 = [...L3, { placement: r3, overflows: D3 }], !D3.every((t2) => t2 <= 0)) {
|
|
375
|
-
var k2, B;
|
|
376
|
-
const t2 = ((null == (k2 = a3.flip) ? void 0 : k2.index) || 0) + 1, e3 = O3[t2];
|
|
377
|
-
if (e3)
|
|
378
|
-
return { data: { index: t2, overflows: L3 }, reset: { placement: e3 } };
|
|
379
|
-
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;
|
|
380
|
-
if (!n3)
|
|
381
|
-
switch (p3) {
|
|
382
|
-
case "bestFit": {
|
|
383
|
-
var C2;
|
|
384
|
-
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];
|
|
385
|
-
t3 && (n3 = t3);
|
|
386
|
-
break;
|
|
387
|
-
}
|
|
388
|
-
case "initialPlacement":
|
|
389
|
-
n3 = c3;
|
|
390
|
-
}
|
|
391
|
-
if (r3 !== n3)
|
|
392
|
-
return { reset: { placement: n3 } };
|
|
393
|
-
}
|
|
394
|
-
return {};
|
|
395
|
-
} };
|
|
396
|
-
};
|
|
397
|
-
var O = function(e2) {
|
|
398
|
-
return void 0 === e2 && (e2 = 0), { name: "offset", options: e2, async fn(i3) {
|
|
399
|
-
const { x: r3, y: a3 } = i3, l3 = await async function(e3, i4) {
|
|
400
|
-
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;
|
|
401
|
-
let { mainAxis: p3, crossAxis: h3, alignmentAxis: y3 } = "number" == typeof d3 ? { mainAxis: d3, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...d3 };
|
|
402
|
-
return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3), m3 ? { x: h3 * g3, y: p3 * u3 } : { x: p3 * u3, y: h3 * g3 };
|
|
403
|
-
}(i3, e2);
|
|
404
|
-
return { x: r3 + l3.x, y: a3 + l3.y, data: l3 };
|
|
405
|
-
} };
|
|
406
|
-
};
|
|
407
|
-
function E(t2) {
|
|
408
|
-
return "x" === t2 ? "y" : "x";
|
|
409
|
-
}
|
|
410
|
-
var D = function(t2) {
|
|
411
|
-
return void 0 === t2 && (t2 = {}), { name: "shift", options: t2, async fn(e2) {
|
|
412
|
-
const { x: i3, y: r3, placement: a3 } = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t3) => {
|
|
413
|
-
let { x: e3, y: n3 } = t3;
|
|
414
|
-
return { x: e3, y: n3 };
|
|
415
|
-
} }, ...u3 } = t2, g3 = { x: i3, y: r3 }, d3 = await s(e2, u3), p3 = o(n(a3)), h3 = E(p3);
|
|
416
|
-
let y3 = g3[p3], x3 = g3[h3];
|
|
417
|
-
if (l3) {
|
|
418
|
-
const t3 = "y" === p3 ? "bottom" : "right";
|
|
419
|
-
y3 = m(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t3]);
|
|
420
|
-
}
|
|
421
|
-
if (c3) {
|
|
422
|
-
const t3 = "y" === h3 ? "bottom" : "right";
|
|
423
|
-
x3 = m(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t3]);
|
|
424
|
-
}
|
|
425
|
-
const w3 = f3.fn({ ...e2, [p3]: y3, [h3]: x3 });
|
|
426
|
-
return { ...w3, data: { x: w3.x - i3, y: w3.y - r3 } };
|
|
427
|
-
} };
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
// node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs
|
|
431
|
-
function n2(t2) {
|
|
432
|
-
var e2;
|
|
433
|
-
return (null == (e2 = t2.ownerDocument) ? void 0 : e2.defaultView) || window;
|
|
434
|
-
}
|
|
435
|
-
function o2(t2) {
|
|
436
|
-
return n2(t2).getComputedStyle(t2);
|
|
437
|
-
}
|
|
438
|
-
var i2 = Math.min;
|
|
439
|
-
var r2 = Math.max;
|
|
440
|
-
var l2 = Math.round;
|
|
441
|
-
function c2(t2) {
|
|
442
|
-
const e2 = o2(t2);
|
|
443
|
-
let n3 = parseFloat(e2.width), i3 = parseFloat(e2.height);
|
|
444
|
-
const r3 = t2.offsetWidth, c3 = t2.offsetHeight, s3 = l2(n3) !== r3 || l2(i3) !== c3;
|
|
445
|
-
return s3 && (n3 = r3, i3 = c3), { width: n3, height: i3, fallback: s3 };
|
|
446
|
-
}
|
|
447
|
-
function s2(t2) {
|
|
448
|
-
return h2(t2) ? (t2.nodeName || "").toLowerCase() : "";
|
|
449
|
-
}
|
|
450
|
-
var f2;
|
|
451
|
-
function u2() {
|
|
452
|
-
if (f2)
|
|
453
|
-
return f2;
|
|
454
|
-
const t2 = navigator.userAgentData;
|
|
455
|
-
return t2 && Array.isArray(t2.brands) ? (f2 = t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" "), f2) : navigator.userAgent;
|
|
456
|
-
}
|
|
457
|
-
function a2(t2) {
|
|
458
|
-
return t2 instanceof n2(t2).HTMLElement;
|
|
459
|
-
}
|
|
460
|
-
function d2(t2) {
|
|
461
|
-
return t2 instanceof n2(t2).Element;
|
|
462
|
-
}
|
|
463
|
-
function h2(t2) {
|
|
464
|
-
return t2 instanceof n2(t2).Node;
|
|
465
|
-
}
|
|
466
|
-
function p2(t2) {
|
|
467
|
-
if ("undefined" == typeof ShadowRoot)
|
|
468
|
-
return false;
|
|
469
|
-
return t2 instanceof n2(t2).ShadowRoot || t2 instanceof ShadowRoot;
|
|
470
|
-
}
|
|
471
|
-
function g2(t2) {
|
|
472
|
-
const { overflow: e2, overflowX: n3, overflowY: i3, display: r3 } = o2(t2);
|
|
473
|
-
return /auto|scroll|overlay|hidden|clip/.test(e2 + i3 + n3) && !["inline", "contents"].includes(r3);
|
|
474
|
-
}
|
|
475
|
-
function m2(t2) {
|
|
476
|
-
return ["table", "td", "th"].includes(s2(t2));
|
|
477
|
-
}
|
|
478
|
-
function y2(t2) {
|
|
479
|
-
const e2 = /firefox/i.test(u2()), n3 = o2(t2), i3 = n3.backdropFilter || n3.WebkitBackdropFilter;
|
|
480
|
-
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) => {
|
|
481
|
-
const e3 = n3.contain;
|
|
482
|
-
return null != e3 && e3.includes(t3);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
function x2() {
|
|
486
|
-
return /^((?!chrome|android).)*safari/i.test(u2());
|
|
487
|
-
}
|
|
488
|
-
function w2(t2) {
|
|
489
|
-
return ["html", "body", "#document"].includes(s2(t2));
|
|
490
|
-
}
|
|
491
|
-
function v2(t2) {
|
|
492
|
-
return d2(t2) ? t2 : t2.contextElement;
|
|
493
|
-
}
|
|
494
|
-
var b2 = { x: 1, y: 1 };
|
|
495
|
-
function L2(t2) {
|
|
496
|
-
const e2 = v2(t2);
|
|
497
|
-
if (!a2(e2))
|
|
498
|
-
return b2;
|
|
499
|
-
const n3 = e2.getBoundingClientRect(), { width: o3, height: i3, fallback: r3 } = c2(e2);
|
|
500
|
-
let s3 = (r3 ? l2(n3.width) : n3.width) / o3, f3 = (r3 ? l2(n3.height) : n3.height) / i3;
|
|
501
|
-
return s3 && Number.isFinite(s3) || (s3 = 1), f3 && Number.isFinite(f3) || (f3 = 1), { x: s3, y: f3 };
|
|
502
|
-
}
|
|
503
|
-
function E2(e2, o3, i3, r3) {
|
|
504
|
-
var l3, c3;
|
|
505
|
-
void 0 === o3 && (o3 = false), void 0 === i3 && (i3 = false);
|
|
506
|
-
const s3 = e2.getBoundingClientRect(), f3 = v2(e2);
|
|
507
|
-
let u3 = b2;
|
|
508
|
-
o3 && (r3 ? d2(r3) && (u3 = L2(r3)) : u3 = L2(e2));
|
|
509
|
-
const a3 = f3 ? n2(f3) : window, h3 = x2() && i3;
|
|
510
|
-
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;
|
|
511
|
-
if (f3) {
|
|
512
|
-
const t2 = n2(f3), e3 = r3 && d2(r3) ? n2(r3) : r3;
|
|
513
|
-
let o4 = t2.frameElement;
|
|
514
|
-
for (; o4 && r3 && e3 !== t2; ) {
|
|
515
|
-
const t3 = L2(o4), e4 = o4.getBoundingClientRect(), i4 = getComputedStyle(o4);
|
|
516
|
-
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;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return l({ width: m3, height: y3, x: p3, y: g3 });
|
|
520
|
-
}
|
|
521
|
-
function R(t2) {
|
|
522
|
-
return ((h2(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
|
|
523
|
-
}
|
|
524
|
-
function T2(t2) {
|
|
525
|
-
return d2(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.pageXOffset, scrollTop: t2.pageYOffset };
|
|
526
|
-
}
|
|
527
|
-
function C(t2) {
|
|
528
|
-
return E2(R(t2)).left + T2(t2).scrollLeft;
|
|
529
|
-
}
|
|
530
|
-
function F(t2) {
|
|
531
|
-
if ("html" === s2(t2))
|
|
532
|
-
return t2;
|
|
533
|
-
const e2 = t2.assignedSlot || t2.parentNode || p2(t2) && t2.host || R(t2);
|
|
534
|
-
return p2(e2) ? e2.host : e2;
|
|
535
|
-
}
|
|
536
|
-
function W(t2) {
|
|
537
|
-
const e2 = F(t2);
|
|
538
|
-
return w2(e2) ? e2.ownerDocument.body : a2(e2) && g2(e2) ? e2 : W(e2);
|
|
539
|
-
}
|
|
540
|
-
function D2(t2, e2) {
|
|
541
|
-
var o3;
|
|
542
|
-
void 0 === e2 && (e2 = []);
|
|
543
|
-
const i3 = W(t2), r3 = i3 === (null == (o3 = t2.ownerDocument) ? void 0 : o3.body), l3 = n2(i3);
|
|
544
|
-
return r3 ? e2.concat(l3, l3.visualViewport || [], g2(i3) ? i3 : []) : e2.concat(i3, D2(i3));
|
|
545
|
-
}
|
|
546
|
-
function S(e2, i3, l3) {
|
|
547
|
-
let c3;
|
|
548
|
-
if ("viewport" === i3)
|
|
549
|
-
c3 = function(t2, e3) {
|
|
550
|
-
const o3 = n2(t2), i4 = R(t2), r3 = o3.visualViewport;
|
|
551
|
-
let l4 = i4.clientWidth, c4 = i4.clientHeight, s4 = 0, f4 = 0;
|
|
552
|
-
if (r3) {
|
|
553
|
-
l4 = r3.width, c4 = r3.height;
|
|
554
|
-
const t3 = x2();
|
|
555
|
-
(!t3 || t3 && "fixed" === e3) && (s4 = r3.offsetLeft, f4 = r3.offsetTop);
|
|
556
|
-
}
|
|
557
|
-
return { width: l4, height: c4, x: s4, y: f4 };
|
|
558
|
-
}(e2, l3);
|
|
559
|
-
else if ("document" === i3)
|
|
560
|
-
c3 = function(t2) {
|
|
561
|
-
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);
|
|
562
|
-
let s4 = -n3.scrollLeft + C(t2);
|
|
563
|
-
const f4 = -n3.scrollTop;
|
|
564
|
-
return "rtl" === o2(i4).direction && (s4 += r2(e3.clientWidth, i4.clientWidth) - l4), { width: l4, height: c4, x: s4, y: f4 };
|
|
565
|
-
}(R(e2));
|
|
566
|
-
else if (d2(i3))
|
|
567
|
-
c3 = function(t2, e3) {
|
|
568
|
-
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 };
|
|
569
|
-
return { width: t2.clientWidth * r3.x, height: t2.clientHeight * r3.y, x: i4 * r3.x, y: o3 * r3.y };
|
|
570
|
-
}(i3, l3);
|
|
571
|
-
else {
|
|
572
|
-
const t2 = { ...i3 };
|
|
573
|
-
if (x2()) {
|
|
574
|
-
var s3, f3;
|
|
575
|
-
const o3 = n2(e2);
|
|
576
|
-
t2.x -= (null == (s3 = o3.visualViewport) ? void 0 : s3.offsetLeft) || 0, t2.y -= (null == (f3 = o3.visualViewport) ? void 0 : f3.offsetTop) || 0;
|
|
577
|
-
}
|
|
578
|
-
c3 = t2;
|
|
579
|
-
}
|
|
580
|
-
return l(c3);
|
|
581
|
-
}
|
|
582
|
-
function A(t2, e2) {
|
|
583
|
-
return a2(t2) && "fixed" !== o2(t2).position ? e2 ? e2(t2) : t2.offsetParent : null;
|
|
584
|
-
}
|
|
585
|
-
function H(t2, e2) {
|
|
586
|
-
const i3 = n2(t2);
|
|
587
|
-
if (!a2(t2))
|
|
588
|
-
return i3;
|
|
589
|
-
let r3 = A(t2, e2);
|
|
590
|
-
for (; r3 && m2(r3) && "static" === o2(r3).position; )
|
|
591
|
-
r3 = A(r3, e2);
|
|
592
|
-
return r3 && ("html" === s2(r3) || "body" === s2(r3) && "static" === o2(r3).position && !y2(r3)) ? i3 : r3 || function(t3) {
|
|
593
|
-
let e3 = F(t3);
|
|
594
|
-
for (; a2(e3) && !w2(e3); ) {
|
|
595
|
-
if (y2(e3))
|
|
596
|
-
return e3;
|
|
597
|
-
e3 = F(e3);
|
|
598
|
-
}
|
|
599
|
-
return null;
|
|
600
|
-
}(t2) || i3;
|
|
601
|
-
}
|
|
602
|
-
function V(t2, e2, n3) {
|
|
603
|
-
const o3 = a2(e2), i3 = R(e2), r3 = E2(t2, true, "fixed" === n3, e2);
|
|
604
|
-
let l3 = { scrollLeft: 0, scrollTop: 0 };
|
|
605
|
-
const c3 = { x: 0, y: 0 };
|
|
606
|
-
if (o3 || !o3 && "fixed" !== n3)
|
|
607
|
-
if (("body" !== s2(e2) || g2(i3)) && (l3 = T2(e2)), a2(e2)) {
|
|
608
|
-
const t3 = E2(e2, true);
|
|
609
|
-
c3.x = t3.x + e2.clientLeft, c3.y = t3.y + e2.clientTop;
|
|
610
|
-
} else
|
|
611
|
-
i3 && (c3.x = C(i3));
|
|
612
|
-
return { x: r3.left + l3.scrollLeft - c3.x, y: r3.top + l3.scrollTop - c3.y, width: r3.width, height: r3.height };
|
|
613
|
-
}
|
|
614
|
-
var O2 = { getClippingRect: function(t2) {
|
|
615
|
-
let { element: e2, boundary: n3, rootBoundary: l3, strategy: c3 } = t2;
|
|
616
|
-
const f3 = "clippingAncestors" === n3 ? function(t3, e3) {
|
|
617
|
-
const n4 = e3.get(t3);
|
|
618
|
-
if (n4)
|
|
619
|
-
return n4;
|
|
620
|
-
let i3 = D2(t3).filter((t4) => d2(t4) && "body" !== s2(t4)), r3 = null;
|
|
621
|
-
const l4 = "fixed" === o2(t3).position;
|
|
622
|
-
let c4 = l4 ? F(t3) : t3;
|
|
623
|
-
for (; d2(c4) && !w2(c4); ) {
|
|
624
|
-
const t4 = o2(c4), e4 = y2(c4);
|
|
625
|
-
"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);
|
|
626
|
-
}
|
|
627
|
-
return e3.set(t3, i3), i3;
|
|
628
|
-
}(e2, this._c) : [].concat(n3), u3 = [...f3, l3], a3 = u3[0], h3 = u3.reduce((t3, n4) => {
|
|
629
|
-
const o3 = S(e2, n4, c3);
|
|
630
|
-
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;
|
|
631
|
-
}, S(e2, a3, c3));
|
|
632
|
-
return { width: h3.right - h3.left, height: h3.bottom - h3.top, x: h3.left, y: h3.top };
|
|
633
|
-
}, convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
|
|
634
|
-
let { rect: e2, offsetParent: n3, strategy: o3 } = t2;
|
|
635
|
-
const i3 = a2(n3), r3 = R(n3);
|
|
636
|
-
if (n3 === r3)
|
|
637
|
-
return e2;
|
|
638
|
-
let l3 = { scrollLeft: 0, scrollTop: 0 }, c3 = { x: 1, y: 1 };
|
|
639
|
-
const f3 = { x: 0, y: 0 };
|
|
640
|
-
if ((i3 || !i3 && "fixed" !== o3) && (("body" !== s2(n3) || g2(r3)) && (l3 = T2(n3)), a2(n3))) {
|
|
641
|
-
const t3 = E2(n3);
|
|
642
|
-
c3 = L2(n3), f3.x = t3.x + n3.clientLeft, f3.y = t3.y + n3.clientTop;
|
|
643
|
-
}
|
|
644
|
-
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 };
|
|
645
|
-
}, isElement: d2, getDimensions: function(t2) {
|
|
646
|
-
return a2(t2) ? c2(t2) : t2.getBoundingClientRect();
|
|
647
|
-
}, getOffsetParent: H, getDocumentElement: R, getScale: L2, async getElementRects(t2) {
|
|
648
|
-
let { reference: e2, floating: n3, strategy: o3 } = t2;
|
|
649
|
-
const i3 = this.getOffsetParent || H, r3 = this.getDimensions;
|
|
650
|
-
return { reference: V(e2, await i3(n3), o3), floating: { x: 0, y: 0, ...await r3(n3) } };
|
|
651
|
-
}, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === o2(t2).direction };
|
|
652
|
-
var z = (t2, n3, o3) => {
|
|
653
|
-
const i3 = /* @__PURE__ */ new Map(), r3 = { platform: O2, ...o3 }, l3 = { ...r3.platform, _c: i3 };
|
|
654
|
-
return r(t2, n3, { ...r3, platform: l3 });
|
|
655
|
-
};
|
|
656
|
-
|
|
657
194
|
// src/utils/compute-positions.ts
|
|
195
|
+
var import_dom = require("@floating-ui/dom");
|
|
658
196
|
var computeTooltipPosition = async ({
|
|
659
197
|
elementReference = null,
|
|
660
198
|
tooltipReference = null,
|
|
@@ -662,7 +200,7 @@ var computeTooltipPosition = async ({
|
|
|
662
200
|
place = "top",
|
|
663
201
|
offset: offsetValue = 10,
|
|
664
202
|
strategy = "absolute",
|
|
665
|
-
middlewares = [
|
|
203
|
+
middlewares = [(0, import_dom.offset)(Number(offsetValue)), (0, import_dom.flip)(), (0, import_dom.shift)({ padding: 5 })]
|
|
666
204
|
}) => {
|
|
667
205
|
if (!elementReference) {
|
|
668
206
|
return { tooltipStyles: {}, tooltipArrowStyles: {}, place };
|
|
@@ -672,14 +210,14 @@ var computeTooltipPosition = async ({
|
|
|
672
210
|
}
|
|
673
211
|
const middleware = middlewares;
|
|
674
212
|
if (tooltipArrowReference) {
|
|
675
|
-
middleware.push(
|
|
676
|
-
return
|
|
213
|
+
middleware.push((0, import_dom.arrow)({ element: tooltipArrowReference, padding: 5 }));
|
|
214
|
+
return (0, import_dom.computePosition)(elementReference, tooltipReference, {
|
|
677
215
|
placement: place,
|
|
678
216
|
strategy,
|
|
679
217
|
middleware
|
|
680
|
-
}).then(({ x
|
|
218
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
681
219
|
var _a, _b;
|
|
682
|
-
const styles = { left: `${
|
|
220
|
+
const styles = { left: `${x}px`, top: `${y}px` };
|
|
683
221
|
const { x: arrowX, y: arrowY } = (_a = middlewareData.arrow) != null ? _a : { x: 0, y: 0 };
|
|
684
222
|
const staticSide = (_b = {
|
|
685
223
|
top: "bottom",
|
|
@@ -697,12 +235,12 @@ var computeTooltipPosition = async ({
|
|
|
697
235
|
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement };
|
|
698
236
|
});
|
|
699
237
|
}
|
|
700
|
-
return
|
|
238
|
+
return (0, import_dom.computePosition)(elementReference, tooltipReference, {
|
|
701
239
|
placement: "bottom",
|
|
702
240
|
strategy,
|
|
703
241
|
middleware
|
|
704
|
-
}).then(({ x
|
|
705
|
-
const styles = { left: `${
|
|
242
|
+
}).then(({ x, y, placement }) => {
|
|
243
|
+
const styles = { left: `${x}px`, top: `${y}px` };
|
|
706
244
|
return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement };
|
|
707
245
|
});
|
|
708
246
|
};
|
|
@@ -721,7 +259,7 @@ var Tooltip = ({
|
|
|
721
259
|
anchorId,
|
|
722
260
|
anchorSelect,
|
|
723
261
|
place = "top",
|
|
724
|
-
offset = 10,
|
|
262
|
+
offset: offset2 = 10,
|
|
725
263
|
events = ["hover"],
|
|
726
264
|
openOnClick = false,
|
|
727
265
|
positionStrategy = "absolute",
|
|
@@ -867,24 +405,24 @@ var Tooltip = ({
|
|
|
867
405
|
clearTimeout(tooltipShowDelayTimerRef.current);
|
|
868
406
|
}
|
|
869
407
|
};
|
|
870
|
-
const handleTooltipPosition = ({ x
|
|
408
|
+
const handleTooltipPosition = ({ x, y }) => {
|
|
871
409
|
const virtualElement = {
|
|
872
410
|
getBoundingClientRect() {
|
|
873
411
|
return {
|
|
874
|
-
x
|
|
875
|
-
y
|
|
412
|
+
x,
|
|
413
|
+
y,
|
|
876
414
|
width: 0,
|
|
877
415
|
height: 0,
|
|
878
|
-
top:
|
|
879
|
-
left:
|
|
880
|
-
right:
|
|
881
|
-
bottom:
|
|
416
|
+
top: y,
|
|
417
|
+
left: x,
|
|
418
|
+
right: x,
|
|
419
|
+
bottom: y
|
|
882
420
|
};
|
|
883
421
|
}
|
|
884
422
|
};
|
|
885
423
|
computeTooltipPosition({
|
|
886
424
|
place,
|
|
887
|
-
offset,
|
|
425
|
+
offset: offset2,
|
|
888
426
|
elementReference: virtualElement,
|
|
889
427
|
tooltipReference: tooltipRef.current,
|
|
890
428
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
@@ -1026,7 +564,8 @@ var Tooltip = ({
|
|
|
1026
564
|
if (activeAnchor) {
|
|
1027
565
|
;
|
|
1028
566
|
[...mutation.removedNodes].some((node) => {
|
|
1029
|
-
|
|
567
|
+
var _a;
|
|
568
|
+
if ((_a = node == null ? void 0 : node.contains) == null ? void 0 : _a.call(node, activeAnchor)) {
|
|
1030
569
|
setRendered(false);
|
|
1031
570
|
handleShow(false);
|
|
1032
571
|
setActiveAnchor(null);
|
|
@@ -1050,7 +589,7 @@ var Tooltip = ({
|
|
|
1050
589
|
(element) => [...element.querySelectorAll(selector)]
|
|
1051
590
|
)
|
|
1052
591
|
);
|
|
1053
|
-
} catch (
|
|
592
|
+
} catch (e) {
|
|
1054
593
|
}
|
|
1055
594
|
});
|
|
1056
595
|
if (newAnchors.length) {
|
|
@@ -1081,7 +620,7 @@ var Tooltip = ({
|
|
|
1081
620
|
}
|
|
1082
621
|
computeTooltipPosition({
|
|
1083
622
|
place,
|
|
1084
|
-
offset,
|
|
623
|
+
offset: offset2,
|
|
1085
624
|
elementReference: activeAnchor,
|
|
1086
625
|
tooltipReference: tooltipRef.current,
|
|
1087
626
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
@@ -1099,7 +638,7 @@ var Tooltip = ({
|
|
|
1099
638
|
}
|
|
1100
639
|
setActualPlacement(computedStylesData.place);
|
|
1101
640
|
});
|
|
1102
|
-
}, [show, activeAnchor, content, place,
|
|
641
|
+
}, [show, activeAnchor, content, place, offset2, positionStrategy, position]);
|
|
1103
642
|
(0, import_react4.useEffect)(() => {
|
|
1104
643
|
var _a;
|
|
1105
644
|
const anchorById = document.querySelector(`[id='${anchorId}']`);
|
|
@@ -1129,7 +668,7 @@ var Tooltip = ({
|
|
|
1129
668
|
try {
|
|
1130
669
|
const anchors = Array.from(document.querySelectorAll(selector));
|
|
1131
670
|
setAnchorsBySelect(anchors);
|
|
1132
|
-
} catch (
|
|
671
|
+
} catch (e) {
|
|
1133
672
|
setAnchorsBySelect([]);
|
|
1134
673
|
}
|
|
1135
674
|
}, [id, anchorSelect]);
|
|
@@ -1195,7 +734,7 @@ var TooltipController = ({
|
|
|
1195
734
|
classNameArrow,
|
|
1196
735
|
variant = "dark",
|
|
1197
736
|
place = "top",
|
|
1198
|
-
offset = 10,
|
|
737
|
+
offset: offset2 = 10,
|
|
1199
738
|
wrapper = "div",
|
|
1200
739
|
children = null,
|
|
1201
740
|
events = ["hover"],
|
|
@@ -1219,7 +758,7 @@ var TooltipController = ({
|
|
|
1219
758
|
const [tooltipHtml, setTooltipHtml] = (0, import_react5.useState)(html);
|
|
1220
759
|
const [tooltipPlace, setTooltipPlace] = (0, import_react5.useState)(place);
|
|
1221
760
|
const [tooltipVariant, setTooltipVariant] = (0, import_react5.useState)(variant);
|
|
1222
|
-
const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(
|
|
761
|
+
const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(offset2);
|
|
1223
762
|
const [tooltipDelayShow, setTooltipDelayShow] = (0, import_react5.useState)(delayShow);
|
|
1224
763
|
const [tooltipDelayHide, setTooltipDelayHide] = (0, import_react5.useState)(delayHide);
|
|
1225
764
|
const [tooltipFloat, setTooltipFloat] = (0, import_react5.useState)(float);
|
|
@@ -1254,7 +793,7 @@ var TooltipController = ({
|
|
|
1254
793
|
setTooltipVariant(value != null ? value : variant);
|
|
1255
794
|
},
|
|
1256
795
|
offset: (value) => {
|
|
1257
|
-
setTooltipOffset(value === null ?
|
|
796
|
+
setTooltipOffset(value === null ? offset2 : Number(value));
|
|
1258
797
|
},
|
|
1259
798
|
wrapper: (value) => {
|
|
1260
799
|
setTooltipWrapper(value != null ? value : wrapper);
|
|
@@ -1304,7 +843,7 @@ var TooltipController = ({
|
|
|
1304
843
|
anchorsBySelect.forEach((anchor) => {
|
|
1305
844
|
elementRefs.add({ current: anchor });
|
|
1306
845
|
});
|
|
1307
|
-
} catch (
|
|
846
|
+
} catch (e) {
|
|
1308
847
|
if (true) {
|
|
1309
848
|
console.warn(`[react-tooltip] "${anchorSelect}" is not a valid CSS selector`);
|
|
1310
849
|
}
|
|
@@ -1381,13 +920,4 @@ var TooltipController = ({
|
|
|
1381
920
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Tooltip_default, { ...props });
|
|
1382
921
|
};
|
|
1383
922
|
var TooltipController_default = TooltipController;
|
|
1384
|
-
/*! Bundled license information:
|
|
1385
|
-
|
|
1386
|
-
classnames/index.js:
|
|
1387
|
-
(*!
|
|
1388
|
-
Copyright (c) 2018 Jed Watson.
|
|
1389
|
-
Licensed under the MIT License (MIT), see
|
|
1390
|
-
http://jedwatson.github.io/classnames
|
|
1391
|
-
*)
|
|
1392
|
-
*/
|
|
1393
923
|
//# sourceMappingURL=react-tooltip.cjs.js.map
|