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
|
@@ -6,16 +6,13 @@
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __require = /* @__PURE__ */ ((
|
|
10
|
-
get: (
|
|
11
|
-
}) :
|
|
9
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
12
|
if (typeof require !== "undefined")
|
|
13
13
|
return require.apply(this, arguments);
|
|
14
|
-
throw new Error('Dynamic require of "' +
|
|
14
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
15
15
|
});
|
|
16
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
-
};
|
|
19
16
|
var __copyProps = (to, from, except, desc) => {
|
|
20
17
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
18
|
for (let key of __getOwnPropNames(from))
|
|
@@ -33,63 +30,12 @@
|
|
|
33
30
|
mod
|
|
34
31
|
));
|
|
35
32
|
|
|
36
|
-
// node_modules/classnames/index.js
|
|
37
|
-
var require_classnames = __commonJS({
|
|
38
|
-
"node_modules/classnames/index.js"(exports, module) {
|
|
39
|
-
(function() {
|
|
40
|
-
"use strict";
|
|
41
|
-
var hasOwn = {}.hasOwnProperty;
|
|
42
|
-
var nativeCodeString = "[native code]";
|
|
43
|
-
function classNames3() {
|
|
44
|
-
var classes = [];
|
|
45
|
-
for (var i3 = 0; i3 < arguments.length; i3++) {
|
|
46
|
-
var arg = arguments[i3];
|
|
47
|
-
if (!arg)
|
|
48
|
-
continue;
|
|
49
|
-
var argType = typeof arg;
|
|
50
|
-
if (argType === "string" || argType === "number") {
|
|
51
|
-
classes.push(arg);
|
|
52
|
-
} else if (Array.isArray(arg)) {
|
|
53
|
-
if (arg.length) {
|
|
54
|
-
var inner = classNames3.apply(null, arg);
|
|
55
|
-
if (inner) {
|
|
56
|
-
classes.push(inner);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
} else if (argType === "object") {
|
|
60
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
61
|
-
classes.push(arg.toString());
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
for (var key in arg) {
|
|
65
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
66
|
-
classes.push(key);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return classes.join(" ");
|
|
72
|
-
}
|
|
73
|
-
if (typeof module !== "undefined" && module.exports) {
|
|
74
|
-
classNames3.default = classNames3;
|
|
75
|
-
module.exports = classNames3;
|
|
76
|
-
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
77
|
-
define("classnames", [], function() {
|
|
78
|
-
return classNames3;
|
|
79
|
-
});
|
|
80
|
-
} else {
|
|
81
|
-
window.classNames = classNames3;
|
|
82
|
-
}
|
|
83
|
-
})();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
33
|
// src/components/TooltipController/TooltipController.tsx
|
|
88
34
|
var import_react5 = __require("react");
|
|
89
35
|
|
|
90
36
|
// src/components/Tooltip/Tooltip.tsx
|
|
91
37
|
var import_react4 = __require("react");
|
|
92
|
-
var import_classnames2 = __toESM(
|
|
38
|
+
var import_classnames2 = __toESM(__require("classnames"));
|
|
93
39
|
|
|
94
40
|
// src/utils/debounce.ts
|
|
95
41
|
var debounce = (func, wait, immediate) => {
|
|
@@ -195,7 +141,7 @@
|
|
|
195
141
|
|
|
196
142
|
// src/components/TooltipProvider/TooltipWrapper.tsx
|
|
197
143
|
var import_react2 = __require("react");
|
|
198
|
-
var import_classnames = __toESM(
|
|
144
|
+
var import_classnames = __toESM(__require("classnames"));
|
|
199
145
|
var import_jsx_runtime3 = __require("react/jsx-runtime");
|
|
200
146
|
var TooltipWrapper = ({
|
|
201
147
|
tooltipId,
|
|
@@ -205,7 +151,7 @@
|
|
|
205
151
|
content,
|
|
206
152
|
html,
|
|
207
153
|
variant,
|
|
208
|
-
offset,
|
|
154
|
+
offset: offset2,
|
|
209
155
|
wrapper,
|
|
210
156
|
events,
|
|
211
157
|
positionStrategy,
|
|
@@ -229,7 +175,7 @@
|
|
|
229
175
|
"data-tooltip-content": content,
|
|
230
176
|
"data-tooltip-html": html,
|
|
231
177
|
"data-tooltip-variant": variant,
|
|
232
|
-
"data-tooltip-offset":
|
|
178
|
+
"data-tooltip-offset": offset2,
|
|
233
179
|
"data-tooltip-wrapper": wrapper,
|
|
234
180
|
"data-tooltip-events": events,
|
|
235
181
|
"data-tooltip-position-strategy": positionStrategy,
|
|
@@ -246,416 +192,8 @@
|
|
|
246
192
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react3.useLayoutEffect : import_react3.useEffect;
|
|
247
193
|
var use_isomorphic_layout_effect_default = useIsomorphicLayoutEffect;
|
|
248
194
|
|
|
249
|
-
// node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
|
|
250
|
-
function t(t2) {
|
|
251
|
-
return t2.split("-")[1];
|
|
252
|
-
}
|
|
253
|
-
function e(t2) {
|
|
254
|
-
return "y" === t2 ? "height" : "width";
|
|
255
|
-
}
|
|
256
|
-
function n(t2) {
|
|
257
|
-
return t2.split("-")[0];
|
|
258
|
-
}
|
|
259
|
-
function o(t2) {
|
|
260
|
-
return ["top", "bottom"].includes(n(t2)) ? "x" : "y";
|
|
261
|
-
}
|
|
262
|
-
function i(i3, r3, a3) {
|
|
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, m3 = o(r3), u3 = e(m3), g3 = l3[u3] / 2 - s3[u3] / 2, d3 = "x" === m3;
|
|
265
|
-
let p3;
|
|
266
|
-
switch (n(r3)) {
|
|
267
|
-
case "top":
|
|
268
|
-
p3 = { x: c3, y: l3.y - s3.height };
|
|
269
|
-
break;
|
|
270
|
-
case "bottom":
|
|
271
|
-
p3 = { x: c3, y: l3.y + l3.height };
|
|
272
|
-
break;
|
|
273
|
-
case "right":
|
|
274
|
-
p3 = { x: l3.x + l3.width, y: f3 };
|
|
275
|
-
break;
|
|
276
|
-
case "left":
|
|
277
|
-
p3 = { x: l3.x - s3.width, y: f3 };
|
|
278
|
-
break;
|
|
279
|
-
default:
|
|
280
|
-
p3 = { x: l3.x, y: l3.y };
|
|
281
|
-
}
|
|
282
|
-
switch (t(r3)) {
|
|
283
|
-
case "start":
|
|
284
|
-
p3[m3] -= g3 * (a3 && d3 ? -1 : 1);
|
|
285
|
-
break;
|
|
286
|
-
case "end":
|
|
287
|
-
p3[m3] += g3 * (a3 && d3 ? -1 : 1);
|
|
288
|
-
}
|
|
289
|
-
return p3;
|
|
290
|
-
}
|
|
291
|
-
var r = async (t2, e2, n3) => {
|
|
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: m3, y: u3 } = i(f3, o3, c3), g3 = o3, d3 = {}, p3 = 0;
|
|
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: 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
|
-
}
|
|
298
|
-
return { x: m3, y: u3, placement: g3, strategy: r3, middlewareData: d3 };
|
|
299
|
-
};
|
|
300
|
-
function a(t2) {
|
|
301
|
-
return "number" != typeof t2 ? function(t3) {
|
|
302
|
-
return { top: 0, right: 0, bottom: 0, left: 0, ...t3 };
|
|
303
|
-
}(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
|
|
304
|
-
}
|
|
305
|
-
function l(t2) {
|
|
306
|
-
return { ...t2, top: t2.y, left: t2.x, right: t2.x + t2.width, bottom: t2.y + t2.height };
|
|
307
|
-
}
|
|
308
|
-
async function s(t2, e2) {
|
|
309
|
-
var n3;
|
|
310
|
-
void 0 === e2 && (e2 = {});
|
|
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
|
-
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
|
-
}
|
|
314
|
-
var c = Math.min;
|
|
315
|
-
var f = Math.max;
|
|
316
|
-
function m(t2, e2, n3) {
|
|
317
|
-
return f(t2, c(e2, n3));
|
|
318
|
-
}
|
|
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
|
-
if (null == r3)
|
|
322
|
-
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
|
-
} });
|
|
329
|
-
var g = ["top", "right", "bottom", "left"];
|
|
330
|
-
var d = g.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
|
|
331
|
-
var p = { left: "right", right: "left", bottom: "top", top: "bottom" };
|
|
332
|
-
function h(t2) {
|
|
333
|
-
return t2.replace(/left|right|bottom|top/g, (t3) => p[t3]);
|
|
334
|
-
}
|
|
335
|
-
function y(n3, i3, r3) {
|
|
336
|
-
void 0 === r3 && (r3 = false);
|
|
337
|
-
const a3 = t(n3), l3 = o(n3), s3 = e(l3);
|
|
338
|
-
let c3 = "x" === l3 ? a3 === (r3 ? "end" : "start") ? "right" : "left" : "start" === a3 ? "bottom" : "top";
|
|
339
|
-
return i3.reference[s3] > i3.floating[s3] && (c3 = h(c3)), { main: c3, cross: h(c3) };
|
|
340
|
-
}
|
|
341
|
-
var x = { start: "end", end: "start" };
|
|
342
|
-
function w(t2) {
|
|
343
|
-
return t2.replace(/start|end/g, (t3) => x[t3]);
|
|
344
|
-
}
|
|
345
|
-
var b = function(e2) {
|
|
346
|
-
return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(o3) {
|
|
347
|
-
var i3;
|
|
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
|
-
const e3 = h(t2);
|
|
350
|
-
return [w(t2), e3, w(e3)];
|
|
351
|
-
}(c3));
|
|
352
|
-
d3 || "none" === x3 || T3.push(...function(e3, o4, i4, r4) {
|
|
353
|
-
const a4 = t(e3);
|
|
354
|
-
let l4 = function(t2, e4, n3) {
|
|
355
|
-
const o5 = ["left", "right"], i5 = ["right", "left"], r5 = ["top", "bottom"], a5 = ["bottom", "top"];
|
|
356
|
-
switch (t2) {
|
|
357
|
-
case "top":
|
|
358
|
-
case "bottom":
|
|
359
|
-
return n3 ? e4 ? i5 : o5 : e4 ? o5 : i5;
|
|
360
|
-
case "left":
|
|
361
|
-
case "right":
|
|
362
|
-
return e4 ? r5 : a5;
|
|
363
|
-
default:
|
|
364
|
-
return [];
|
|
365
|
-
}
|
|
366
|
-
}(n(e3), "start" === i4, r4);
|
|
367
|
-
return a4 && (l4 = l4.map((t2) => t2 + "-" + a4), o4 && (l4 = l4.concat(l4.map(w)))), l4;
|
|
368
|
-
}(c3, v3, x3, P2));
|
|
369
|
-
const O3 = [c3, ...T3], E3 = await s(o3, b3), D3 = [];
|
|
370
|
-
let L3 = (null == (i3 = a3.flip) ? void 0 : i3.overflows) || [];
|
|
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
|
-
}
|
|
375
|
-
if (L3 = [...L3, { placement: r3, overflows: D3 }], !D3.every((t2) => t2 <= 0)) {
|
|
376
|
-
var k2, B;
|
|
377
|
-
const t2 = ((null == (k2 = a3.flip) ? void 0 : k2.index) || 0) + 1, e3 = O3[t2];
|
|
378
|
-
if (e3)
|
|
379
|
-
return { data: { index: t2, overflows: L3 }, reset: { placement: e3 } };
|
|
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
|
-
if (!n3)
|
|
382
|
-
switch (p3) {
|
|
383
|
-
case "bestFit": {
|
|
384
|
-
var C2;
|
|
385
|
-
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];
|
|
386
|
-
t3 && (n3 = t3);
|
|
387
|
-
break;
|
|
388
|
-
}
|
|
389
|
-
case "initialPlacement":
|
|
390
|
-
n3 = c3;
|
|
391
|
-
}
|
|
392
|
-
if (r3 !== n3)
|
|
393
|
-
return { reset: { placement: n3 } };
|
|
394
|
-
}
|
|
395
|
-
return {};
|
|
396
|
-
} };
|
|
397
|
-
};
|
|
398
|
-
var O = function(e2) {
|
|
399
|
-
return void 0 === e2 && (e2 = 0), { name: "offset", options: e2, async fn(i3) {
|
|
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), m3 = "x" === o(r4), u3 = ["left", "top"].includes(c3) ? -1 : 1, g3 = s3 && m3 ? -1 : 1, d3 = "function" == typeof i4 ? i4(e3) : i4;
|
|
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), m3 ? { x: h3 * g3, y: p3 * u3 } : { x: p3 * u3, y: h3 * g3 };
|
|
404
|
-
}(i3, e2);
|
|
405
|
-
return { x: r3 + l3.x, y: a3 + l3.y, data: l3 };
|
|
406
|
-
} };
|
|
407
|
-
};
|
|
408
|
-
function E(t2) {
|
|
409
|
-
return "x" === t2 ? "y" : "x";
|
|
410
|
-
}
|
|
411
|
-
var D = function(t2) {
|
|
412
|
-
return void 0 === t2 && (t2 = {}), { name: "shift", options: t2, async fn(e2) {
|
|
413
|
-
const { x: i3, y: r3, placement: a3 } = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t3) => {
|
|
414
|
-
let { x: e3, y: n3 } = t3;
|
|
415
|
-
return { x: e3, y: n3 };
|
|
416
|
-
} }, ...u3 } = t2, g3 = { x: i3, y: r3 }, d3 = await s(e2, u3), p3 = o(n(a3)), h3 = E(p3);
|
|
417
|
-
let y3 = g3[p3], x3 = g3[h3];
|
|
418
|
-
if (l3) {
|
|
419
|
-
const t3 = "y" === p3 ? "bottom" : "right";
|
|
420
|
-
y3 = m(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t3]);
|
|
421
|
-
}
|
|
422
|
-
if (c3) {
|
|
423
|
-
const t3 = "y" === h3 ? "bottom" : "right";
|
|
424
|
-
x3 = m(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t3]);
|
|
425
|
-
}
|
|
426
|
-
const w3 = f3.fn({ ...e2, [p3]: y3, [h3]: x3 });
|
|
427
|
-
return { ...w3, data: { x: w3.x - i3, y: w3.y - r3 } };
|
|
428
|
-
} };
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
// node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs
|
|
432
|
-
function n2(t2) {
|
|
433
|
-
var e2;
|
|
434
|
-
return (null == (e2 = t2.ownerDocument) ? void 0 : e2.defaultView) || window;
|
|
435
|
-
}
|
|
436
|
-
function o2(t2) {
|
|
437
|
-
return n2(t2).getComputedStyle(t2);
|
|
438
|
-
}
|
|
439
|
-
var i2 = Math.min;
|
|
440
|
-
var r2 = Math.max;
|
|
441
|
-
var l2 = Math.round;
|
|
442
|
-
function c2(t2) {
|
|
443
|
-
const e2 = o2(t2);
|
|
444
|
-
let n3 = parseFloat(e2.width), i3 = parseFloat(e2.height);
|
|
445
|
-
const r3 = t2.offsetWidth, c3 = t2.offsetHeight, s3 = l2(n3) !== r3 || l2(i3) !== c3;
|
|
446
|
-
return s3 && (n3 = r3, i3 = c3), { width: n3, height: i3, fallback: s3 };
|
|
447
|
-
}
|
|
448
|
-
function s2(t2) {
|
|
449
|
-
return h2(t2) ? (t2.nodeName || "").toLowerCase() : "";
|
|
450
|
-
}
|
|
451
|
-
var f2;
|
|
452
|
-
function u2() {
|
|
453
|
-
if (f2)
|
|
454
|
-
return f2;
|
|
455
|
-
const t2 = navigator.userAgentData;
|
|
456
|
-
return t2 && Array.isArray(t2.brands) ? (f2 = t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" "), f2) : navigator.userAgent;
|
|
457
|
-
}
|
|
458
|
-
function a2(t2) {
|
|
459
|
-
return t2 instanceof n2(t2).HTMLElement;
|
|
460
|
-
}
|
|
461
|
-
function d2(t2) {
|
|
462
|
-
return t2 instanceof n2(t2).Element;
|
|
463
|
-
}
|
|
464
|
-
function h2(t2) {
|
|
465
|
-
return t2 instanceof n2(t2).Node;
|
|
466
|
-
}
|
|
467
|
-
function p2(t2) {
|
|
468
|
-
if ("undefined" == typeof ShadowRoot)
|
|
469
|
-
return false;
|
|
470
|
-
return t2 instanceof n2(t2).ShadowRoot || t2 instanceof ShadowRoot;
|
|
471
|
-
}
|
|
472
|
-
function g2(t2) {
|
|
473
|
-
const { overflow: e2, overflowX: n3, overflowY: i3, display: r3 } = o2(t2);
|
|
474
|
-
return /auto|scroll|overlay|hidden|clip/.test(e2 + i3 + n3) && !["inline", "contents"].includes(r3);
|
|
475
|
-
}
|
|
476
|
-
function m2(t2) {
|
|
477
|
-
return ["table", "td", "th"].includes(s2(t2));
|
|
478
|
-
}
|
|
479
|
-
function y2(t2) {
|
|
480
|
-
const e2 = /firefox/i.test(u2()), n3 = o2(t2), i3 = n3.backdropFilter || n3.WebkitBackdropFilter;
|
|
481
|
-
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) => {
|
|
482
|
-
const e3 = n3.contain;
|
|
483
|
-
return null != e3 && e3.includes(t3);
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
function x2() {
|
|
487
|
-
return /^((?!chrome|android).)*safari/i.test(u2());
|
|
488
|
-
}
|
|
489
|
-
function w2(t2) {
|
|
490
|
-
return ["html", "body", "#document"].includes(s2(t2));
|
|
491
|
-
}
|
|
492
|
-
function v2(t2) {
|
|
493
|
-
return d2(t2) ? t2 : t2.contextElement;
|
|
494
|
-
}
|
|
495
|
-
var b2 = { x: 1, y: 1 };
|
|
496
|
-
function L2(t2) {
|
|
497
|
-
const e2 = v2(t2);
|
|
498
|
-
if (!a2(e2))
|
|
499
|
-
return b2;
|
|
500
|
-
const n3 = e2.getBoundingClientRect(), { width: o3, height: i3, fallback: r3 } = c2(e2);
|
|
501
|
-
let s3 = (r3 ? l2(n3.width) : n3.width) / o3, f3 = (r3 ? l2(n3.height) : n3.height) / i3;
|
|
502
|
-
return s3 && Number.isFinite(s3) || (s3 = 1), f3 && Number.isFinite(f3) || (f3 = 1), { x: s3, y: f3 };
|
|
503
|
-
}
|
|
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
|
-
}
|
|
519
|
-
}
|
|
520
|
-
return l({ width: m3, height: y3, x: p3, y: g3 });
|
|
521
|
-
}
|
|
522
|
-
function R(t2) {
|
|
523
|
-
return ((h2(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
|
|
524
|
-
}
|
|
525
|
-
function T2(t2) {
|
|
526
|
-
return d2(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.pageXOffset, scrollTop: t2.pageYOffset };
|
|
527
|
-
}
|
|
528
|
-
function C(t2) {
|
|
529
|
-
return E2(R(t2)).left + T2(t2).scrollLeft;
|
|
530
|
-
}
|
|
531
|
-
function F(t2) {
|
|
532
|
-
if ("html" === s2(t2))
|
|
533
|
-
return t2;
|
|
534
|
-
const e2 = t2.assignedSlot || t2.parentNode || p2(t2) && t2.host || R(t2);
|
|
535
|
-
return p2(e2) ? e2.host : e2;
|
|
536
|
-
}
|
|
537
|
-
function W(t2) {
|
|
538
|
-
const e2 = F(t2);
|
|
539
|
-
return w2(e2) ? e2.ownerDocument.body : a2(e2) && g2(e2) ? e2 : W(e2);
|
|
540
|
-
}
|
|
541
|
-
function D2(t2, e2) {
|
|
542
|
-
var o3;
|
|
543
|
-
void 0 === e2 && (e2 = []);
|
|
544
|
-
const i3 = W(t2), r3 = i3 === (null == (o3 = t2.ownerDocument) ? void 0 : o3.body), l3 = n2(i3);
|
|
545
|
-
return r3 ? e2.concat(l3, l3.visualViewport || [], g2(i3) ? i3 : []) : e2.concat(i3, D2(i3));
|
|
546
|
-
}
|
|
547
|
-
function S(e2, i3, l3) {
|
|
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;
|
|
578
|
-
}
|
|
579
|
-
c3 = t2;
|
|
580
|
-
}
|
|
581
|
-
return l(c3);
|
|
582
|
-
}
|
|
583
|
-
function A(t2, e2) {
|
|
584
|
-
return a2(t2) && "fixed" !== o2(t2).position ? e2 ? e2(t2) : t2.offsetParent : null;
|
|
585
|
-
}
|
|
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) {
|
|
594
|
-
let e3 = F(t3);
|
|
595
|
-
for (; a2(e3) && !w2(e3); ) {
|
|
596
|
-
if (y2(e3))
|
|
597
|
-
return e3;
|
|
598
|
-
e3 = F(e3);
|
|
599
|
-
}
|
|
600
|
-
return null;
|
|
601
|
-
}(t2) || i3;
|
|
602
|
-
}
|
|
603
|
-
function V(t2, e2, n3) {
|
|
604
|
-
const o3 = a2(e2), i3 = R(e2), r3 = E2(t2, true, "fixed" === n3, e2);
|
|
605
|
-
let l3 = { scrollLeft: 0, scrollTop: 0 };
|
|
606
|
-
const c3 = { x: 0, y: 0 };
|
|
607
|
-
if (o3 || !o3 && "fixed" !== n3)
|
|
608
|
-
if (("body" !== s2(e2) || g2(i3)) && (l3 = T2(e2)), a2(e2)) {
|
|
609
|
-
const t3 = E2(e2, true);
|
|
610
|
-
c3.x = t3.x + e2.clientLeft, c3.y = t3.y + e2.clientTop;
|
|
611
|
-
} else
|
|
612
|
-
i3 && (c3.x = C(i3));
|
|
613
|
-
return { x: r3.left + l3.scrollLeft - c3.x, y: r3.top + l3.scrollTop - c3.y, width: r3.width, height: r3.height };
|
|
614
|
-
}
|
|
615
|
-
var O2 = { getClippingRect: function(t2) {
|
|
616
|
-
let { element: e2, boundary: n3, rootBoundary: l3, strategy: c3 } = t2;
|
|
617
|
-
const f3 = "clippingAncestors" === n3 ? function(t3, e3) {
|
|
618
|
-
const n4 = e3.get(t3);
|
|
619
|
-
if (n4)
|
|
620
|
-
return n4;
|
|
621
|
-
let i3 = D2(t3).filter((t4) => d2(t4) && "body" !== s2(t4)), r3 = null;
|
|
622
|
-
const l4 = "fixed" === o2(t3).position;
|
|
623
|
-
let c4 = l4 ? F(t3) : t3;
|
|
624
|
-
for (; d2(c4) && !w2(c4); ) {
|
|
625
|
-
const t4 = o2(c4), e4 = y2(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);
|
|
627
|
-
}
|
|
628
|
-
return e3.set(t3, i3), i3;
|
|
629
|
-
}(e2, this._c) : [].concat(n3), u3 = [...f3, l3], a3 = u3[0], h3 = u3.reduce((t3, n4) => {
|
|
630
|
-
const o3 = S(e2, n4, c3);
|
|
631
|
-
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;
|
|
632
|
-
}, S(e2, a3, c3));
|
|
633
|
-
return { width: h3.right - h3.left, height: h3.bottom - h3.top, x: h3.left, y: h3.top };
|
|
634
|
-
}, convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
|
|
635
|
-
let { rect: e2, offsetParent: n3, strategy: o3 } = t2;
|
|
636
|
-
const i3 = a2(n3), r3 = R(n3);
|
|
637
|
-
if (n3 === r3)
|
|
638
|
-
return e2;
|
|
639
|
-
let l3 = { scrollLeft: 0, scrollTop: 0 }, c3 = { x: 1, y: 1 };
|
|
640
|
-
const f3 = { x: 0, y: 0 };
|
|
641
|
-
if ((i3 || !i3 && "fixed" !== o3) && (("body" !== s2(n3) || g2(r3)) && (l3 = T2(n3)), a2(n3))) {
|
|
642
|
-
const t3 = E2(n3);
|
|
643
|
-
c3 = L2(n3), f3.x = t3.x + n3.clientLeft, f3.y = t3.y + n3.clientTop;
|
|
644
|
-
}
|
|
645
|
-
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 };
|
|
646
|
-
}, isElement: d2, getDimensions: function(t2) {
|
|
647
|
-
return a2(t2) ? c2(t2) : t2.getBoundingClientRect();
|
|
648
|
-
}, getOffsetParent: H, getDocumentElement: R, getScale: L2, async getElementRects(t2) {
|
|
649
|
-
let { reference: e2, floating: n3, strategy: o3 } = t2;
|
|
650
|
-
const i3 = this.getOffsetParent || H, r3 = this.getDimensions;
|
|
651
|
-
return { reference: V(e2, await i3(n3), o3), floating: { x: 0, y: 0, ...await r3(n3) } };
|
|
652
|
-
}, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === o2(t2).direction };
|
|
653
|
-
var z = (t2, n3, o3) => {
|
|
654
|
-
const i3 = /* @__PURE__ */ new Map(), r3 = { platform: O2, ...o3 }, l3 = { ...r3.platform, _c: i3 };
|
|
655
|
-
return r(t2, n3, { ...r3, platform: l3 });
|
|
656
|
-
};
|
|
657
|
-
|
|
658
195
|
// src/utils/compute-positions.ts
|
|
196
|
+
var import_dom = __require("@floating-ui/dom");
|
|
659
197
|
var computeTooltipPosition = async ({
|
|
660
198
|
elementReference = null,
|
|
661
199
|
tooltipReference = null,
|
|
@@ -663,24 +201,24 @@
|
|
|
663
201
|
place = "top",
|
|
664
202
|
offset: offsetValue = 10,
|
|
665
203
|
strategy = "absolute",
|
|
666
|
-
middlewares = [
|
|
204
|
+
middlewares = [(0, import_dom.offset)(Number(offsetValue)), (0, import_dom.flip)(), (0, import_dom.shift)({ padding: 5 })]
|
|
667
205
|
}) => {
|
|
668
206
|
if (!elementReference) {
|
|
669
|
-
return { tooltipStyles: {}, tooltipArrowStyles: {}
|
|
207
|
+
return { tooltipStyles: {}, tooltipArrowStyles: {} };
|
|
670
208
|
}
|
|
671
209
|
if (tooltipReference === null) {
|
|
672
|
-
return { tooltipStyles: {}, tooltipArrowStyles: {}
|
|
210
|
+
return { tooltipStyles: {}, tooltipArrowStyles: {} };
|
|
673
211
|
}
|
|
674
212
|
const middleware = middlewares;
|
|
675
213
|
if (tooltipArrowReference) {
|
|
676
|
-
middleware.push(
|
|
677
|
-
return
|
|
214
|
+
middleware.push((0, import_dom.arrow)({ element: tooltipArrowReference, padding: 5 }));
|
|
215
|
+
return (0, import_dom.computePosition)(elementReference, tooltipReference, {
|
|
678
216
|
placement: place,
|
|
679
217
|
strategy,
|
|
680
218
|
middleware
|
|
681
|
-
}).then(({ x
|
|
219
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
682
220
|
var _a, _b;
|
|
683
|
-
const styles = { left: `${
|
|
221
|
+
const styles = { left: `${x}px`, top: `${y}px` };
|
|
684
222
|
const { x: arrowX, y: arrowY } = (_a = middlewareData.arrow) != null ? _a : { x: 0, y: 0 };
|
|
685
223
|
const staticSide = (_b = {
|
|
686
224
|
top: "bottom",
|
|
@@ -695,16 +233,16 @@
|
|
|
695
233
|
bottom: "",
|
|
696
234
|
[staticSide]: "-4px"
|
|
697
235
|
};
|
|
698
|
-
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle
|
|
236
|
+
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle };
|
|
699
237
|
});
|
|
700
238
|
}
|
|
701
|
-
return
|
|
239
|
+
return (0, import_dom.computePosition)(elementReference, tooltipReference, {
|
|
702
240
|
placement: "bottom",
|
|
703
241
|
strategy,
|
|
704
242
|
middleware
|
|
705
|
-
}).then(({ x
|
|
706
|
-
const styles = { left: `${
|
|
707
|
-
return { tooltipStyles: styles, tooltipArrowStyles: {}
|
|
243
|
+
}).then(({ x, y }) => {
|
|
244
|
+
const styles = { left: `${x}px`, top: `${y}px` };
|
|
245
|
+
return { tooltipStyles: styles, tooltipArrowStyles: {} };
|
|
708
246
|
});
|
|
709
247
|
};
|
|
710
248
|
|
|
@@ -722,7 +260,7 @@
|
|
|
722
260
|
anchorId,
|
|
723
261
|
anchorSelect,
|
|
724
262
|
place = "top",
|
|
725
|
-
offset = 10,
|
|
263
|
+
offset: offset2 = 10,
|
|
726
264
|
events = ["hover"],
|
|
727
265
|
positionStrategy = "absolute",
|
|
728
266
|
middlewares,
|
|
@@ -750,7 +288,6 @@
|
|
|
750
288
|
const tooltipArrowRef = (0, import_react4.useRef)(null);
|
|
751
289
|
const tooltipShowDelayTimerRef = (0, import_react4.useRef)(null);
|
|
752
290
|
const tooltipHideDelayTimerRef = (0, import_react4.useRef)(null);
|
|
753
|
-
const [actualPlacement, setActualPlacement] = (0, import_react4.useState)(place);
|
|
754
291
|
const [inlineStyles, setInlineStyles] = (0, import_react4.useState)({});
|
|
755
292
|
const [inlineArrowStyles, setInlineArrowStyles] = (0, import_react4.useState)({});
|
|
756
293
|
const [show, setShow] = (0, import_react4.useState)(false);
|
|
@@ -868,24 +405,24 @@
|
|
|
868
405
|
clearTimeout(tooltipShowDelayTimerRef.current);
|
|
869
406
|
}
|
|
870
407
|
};
|
|
871
|
-
const handleTooltipPosition = ({ x
|
|
408
|
+
const handleTooltipPosition = ({ x, y }) => {
|
|
872
409
|
const virtualElement = {
|
|
873
410
|
getBoundingClientRect() {
|
|
874
411
|
return {
|
|
875
|
-
x
|
|
876
|
-
y
|
|
412
|
+
x,
|
|
413
|
+
y,
|
|
877
414
|
width: 0,
|
|
878
415
|
height: 0,
|
|
879
|
-
top:
|
|
880
|
-
left:
|
|
881
|
-
right:
|
|
882
|
-
bottom:
|
|
416
|
+
top: y,
|
|
417
|
+
left: x,
|
|
418
|
+
right: x,
|
|
419
|
+
bottom: y
|
|
883
420
|
};
|
|
884
421
|
}
|
|
885
422
|
};
|
|
886
423
|
computeTooltipPosition({
|
|
887
424
|
place,
|
|
888
|
-
offset,
|
|
425
|
+
offset: offset2,
|
|
889
426
|
elementReference: virtualElement,
|
|
890
427
|
tooltipReference: tooltipRef.current,
|
|
891
428
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
@@ -898,7 +435,6 @@
|
|
|
898
435
|
if (Object.keys(computedStylesData.tooltipArrowStyles).length) {
|
|
899
436
|
setInlineArrowStyles(computedStylesData.tooltipArrowStyles);
|
|
900
437
|
}
|
|
901
|
-
setActualPlacement(computedStylesData.place);
|
|
902
438
|
});
|
|
903
439
|
};
|
|
904
440
|
const handleMouseMove = (event) => {
|
|
@@ -1050,7 +586,7 @@
|
|
|
1050
586
|
(element) => [...element.querySelectorAll(selector)]
|
|
1051
587
|
)
|
|
1052
588
|
);
|
|
1053
|
-
} catch (
|
|
589
|
+
} catch (e) {
|
|
1054
590
|
}
|
|
1055
591
|
});
|
|
1056
592
|
if (newAnchors.length) {
|
|
@@ -1081,7 +617,7 @@
|
|
|
1081
617
|
}
|
|
1082
618
|
computeTooltipPosition({
|
|
1083
619
|
place,
|
|
1084
|
-
offset,
|
|
620
|
+
offset: offset2,
|
|
1085
621
|
elementReference: activeAnchor,
|
|
1086
622
|
tooltipReference: tooltipRef.current,
|
|
1087
623
|
tooltipArrowReference: tooltipArrowRef.current,
|
|
@@ -1097,9 +633,8 @@
|
|
|
1097
633
|
if (Object.keys(computedStylesData.tooltipArrowStyles).length) {
|
|
1098
634
|
setInlineArrowStyles(computedStylesData.tooltipArrowStyles);
|
|
1099
635
|
}
|
|
1100
|
-
setActualPlacement(computedStylesData.place);
|
|
1101
636
|
});
|
|
1102
|
-
}, [show, activeAnchor, content, html, place,
|
|
637
|
+
}, [show, activeAnchor, content, html, place, offset2, positionStrategy, position]);
|
|
1103
638
|
(0, import_react4.useEffect)(() => {
|
|
1104
639
|
var _a;
|
|
1105
640
|
const anchorById = document.querySelector(`[id='${anchorId}']`);
|
|
@@ -1129,7 +664,7 @@
|
|
|
1129
664
|
try {
|
|
1130
665
|
const anchors = Array.from(document.querySelectorAll(selector));
|
|
1131
666
|
setAnchorsBySelect(anchors);
|
|
1132
|
-
} catch (
|
|
667
|
+
} catch (e) {
|
|
1133
668
|
setAnchorsBySelect([]);
|
|
1134
669
|
}
|
|
1135
670
|
}, [id, anchorSelect]);
|
|
@@ -1143,11 +678,7 @@
|
|
|
1143
678
|
className: (0, import_classnames2.default)("react-tooltip", styles_module_default["tooltip"], styles_module_default[variant], className, {
|
|
1144
679
|
[styles_module_default["show"]]: canShow,
|
|
1145
680
|
[styles_module_default["fixed"]]: positionStrategy === "fixed",
|
|
1146
|
-
[styles_module_default["clickable"]]: clickable
|
|
1147
|
-
"react-tooltip__place-top": actualPlacement === "top",
|
|
1148
|
-
"react-tooltip__place-right": actualPlacement === "right",
|
|
1149
|
-
"react-tooltip__place-bottom": actualPlacement === "bottom",
|
|
1150
|
-
"react-tooltip__place-left": actualPlacement === "left"
|
|
681
|
+
[styles_module_default["clickable"]]: clickable
|
|
1151
682
|
}),
|
|
1152
683
|
style: { ...externalStyles, ...inlineStyles },
|
|
1153
684
|
ref: tooltipRef,
|
|
@@ -1185,7 +716,7 @@
|
|
|
1185
716
|
classNameArrow,
|
|
1186
717
|
variant = "dark",
|
|
1187
718
|
place = "top",
|
|
1188
|
-
offset = 10,
|
|
719
|
+
offset: offset2 = 10,
|
|
1189
720
|
wrapper = "div",
|
|
1190
721
|
children = null,
|
|
1191
722
|
events = ["hover"],
|
|
@@ -1208,7 +739,7 @@
|
|
|
1208
739
|
const [tooltipHtml, setTooltipHtml] = (0, import_react5.useState)(html);
|
|
1209
740
|
const [tooltipPlace, setTooltipPlace] = (0, import_react5.useState)(place);
|
|
1210
741
|
const [tooltipVariant, setTooltipVariant] = (0, import_react5.useState)(variant);
|
|
1211
|
-
const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(
|
|
742
|
+
const [tooltipOffset, setTooltipOffset] = (0, import_react5.useState)(offset2);
|
|
1212
743
|
const [tooltipDelayShow, setTooltipDelayShow] = (0, import_react5.useState)(delayShow);
|
|
1213
744
|
const [tooltipDelayHide, setTooltipDelayHide] = (0, import_react5.useState)(delayHide);
|
|
1214
745
|
const [tooltipFloat, setTooltipFloat] = (0, import_react5.useState)(float);
|
|
@@ -1243,7 +774,7 @@
|
|
|
1243
774
|
setTooltipVariant(value != null ? value : variant);
|
|
1244
775
|
},
|
|
1245
776
|
offset: (value) => {
|
|
1246
|
-
setTooltipOffset(value === null ?
|
|
777
|
+
setTooltipOffset(value === null ? offset2 : Number(value));
|
|
1247
778
|
},
|
|
1248
779
|
wrapper: (value) => {
|
|
1249
780
|
setTooltipWrapper(value != null ? value : wrapper);
|
|
@@ -1293,7 +824,7 @@
|
|
|
1293
824
|
anchorsBySelect.forEach((anchor) => {
|
|
1294
825
|
elementRefs.add({ current: anchor });
|
|
1295
826
|
});
|
|
1296
|
-
} catch (
|
|
827
|
+
} catch (e) {
|
|
1297
828
|
if (true) {
|
|
1298
829
|
console.warn(`[react-tooltip] "${anchorSelect}" is not a valid CSS selector`);
|
|
1299
830
|
}
|
|
@@ -1362,13 +893,4 @@
|
|
|
1362
893
|
};
|
|
1363
894
|
var TooltipController_default = TooltipController;
|
|
1364
895
|
})();
|
|
1365
|
-
/*! Bundled license information:
|
|
1366
|
-
|
|
1367
|
-
classnames/index.js:
|
|
1368
|
-
(*!
|
|
1369
|
-
Copyright (c) 2018 Jed Watson.
|
|
1370
|
-
Licensed under the MIT License (MIT), see
|
|
1371
|
-
http://jedwatson.github.io/classnames
|
|
1372
|
-
*)
|
|
1373
|
-
*/
|
|
1374
896
|
//# sourceMappingURL=react-tooltip.iife.js.map
|