tgui-core 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/keys.d.ts +17 -1
- package/dist/common/keys.js +6 -2
- package/dist/components/AnimatedNumber.d.ts +5 -4
- package/dist/components/Box.d.ts +2 -2
- package/dist/components/Button.d.ts +16 -0
- package/dist/components/Collapsible.d.ts +4 -0
- package/dist/components/DmIcon.d.ts +2 -1
- package/dist/components/DmIcon.js +23 -23
- package/dist/components/Dropdown.js +54 -54
- package/dist/components/Flex.d.ts +69 -5
- package/dist/components/Icon.d.ts +9 -4
- package/dist/components/Image.d.ts +0 -1
- package/dist/components/Knob.js +1 -1
- package/dist/components/LabeledList.d.ts +29 -1
- package/dist/components/LabeledList.js +1 -1
- package/dist/components/NoticeBox.d.ts +3 -0
- package/dist/components/Popper.js +138 -108
- package/dist/components/ProgressBar.d.ts +34 -7
- package/dist/components/ProgressBar.js +4 -4
- package/dist/components/RoundGauge.js +3 -3
- package/dist/components/Section.d.ts +1 -1
- package/dist/components/Section.js +1 -1
- package/dist/components/Slider.js +1 -1
- package/dist/components/TextArea.d.ts +1 -1
- package/dist/components/Tooltip.d.ts +10 -6
- package/dist/components/Tooltip.js +7 -7
- package/dist/{popper-CiqSDJTE.js → index-jLZg_duJ.js} +166 -165
- package/package.json +8 -7
|
@@ -1,85 +1,86 @@
|
|
|
1
|
-
import { jsxs as M, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import * as
|
|
5
|
-
import { c as A } from "../
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as M, Fragment as j, jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { useState as O, useRef as R, useEffect as N } from "react";
|
|
4
|
+
import * as x from "react-dom";
|
|
5
|
+
import { c as A } from "../index-jLZg_duJ.js";
|
|
6
|
+
var W = c.createContext(), Y = c.createContext();
|
|
7
|
+
var P = function(r) {
|
|
8
|
+
return r.reduce(function(n, e) {
|
|
9
|
+
var o = e[0], a = e[1];
|
|
10
|
+
return n[o] = a, n;
|
|
10
11
|
}, {});
|
|
11
|
-
},
|
|
12
|
-
function I(
|
|
13
|
-
return
|
|
12
|
+
}, S = typeof window < "u" && window.document && window.document.createElement ? c.useLayoutEffect : c.useEffect;
|
|
13
|
+
function I(t) {
|
|
14
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
var n,
|
|
21
|
-
if (Array.isArray(
|
|
22
|
-
if (n =
|
|
23
|
-
for (
|
|
24
|
-
if (!
|
|
16
|
+
var _ = typeof Element < "u", F = typeof Map == "function", b = typeof Set == "function", D = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
17
|
+
function g(t, r) {
|
|
18
|
+
if (t === r) return !0;
|
|
19
|
+
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
20
|
+
if (t.constructor !== r.constructor) return !1;
|
|
21
|
+
var n, e, o;
|
|
22
|
+
if (Array.isArray(t)) {
|
|
23
|
+
if (n = t.length, n != r.length) return !1;
|
|
24
|
+
for (e = n; e-- !== 0; )
|
|
25
|
+
if (!g(t[e], r[e])) return !1;
|
|
25
26
|
return !0;
|
|
26
27
|
}
|
|
27
|
-
var
|
|
28
|
-
if (
|
|
29
|
-
if (
|
|
30
|
-
for (
|
|
31
|
-
if (!r.has(
|
|
32
|
-
for (
|
|
33
|
-
if (!
|
|
28
|
+
var a;
|
|
29
|
+
if (F && t instanceof Map && r instanceof Map) {
|
|
30
|
+
if (t.size !== r.size) return !1;
|
|
31
|
+
for (a = t.entries(); !(e = a.next()).done; )
|
|
32
|
+
if (!r.has(e.value[0])) return !1;
|
|
33
|
+
for (a = t.entries(); !(e = a.next()).done; )
|
|
34
|
+
if (!g(e.value[1], r.get(e.value[0]))) return !1;
|
|
34
35
|
return !0;
|
|
35
36
|
}
|
|
36
|
-
if (
|
|
37
|
-
if (
|
|
38
|
-
for (
|
|
39
|
-
if (!r.has(
|
|
37
|
+
if (b && t instanceof Set && r instanceof Set) {
|
|
38
|
+
if (t.size !== r.size) return !1;
|
|
39
|
+
for (a = t.entries(); !(e = a.next()).done; )
|
|
40
|
+
if (!r.has(e.value[0])) return !1;
|
|
40
41
|
return !0;
|
|
41
42
|
}
|
|
42
|
-
if (
|
|
43
|
-
if (n =
|
|
44
|
-
for (
|
|
45
|
-
if (e
|
|
43
|
+
if (D && ArrayBuffer.isView(t) && ArrayBuffer.isView(r)) {
|
|
44
|
+
if (n = t.length, n != r.length) return !1;
|
|
45
|
+
for (e = n; e-- !== 0; )
|
|
46
|
+
if (t[e] !== r[e]) return !1;
|
|
46
47
|
return !0;
|
|
47
48
|
}
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
if (
|
|
51
|
-
if (o = Object.keys(
|
|
52
|
-
for (
|
|
53
|
-
if (!Object.prototype.hasOwnProperty.call(r, o[
|
|
54
|
-
if (
|
|
55
|
-
for (
|
|
56
|
-
if (!((o[
|
|
49
|
+
if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
|
|
50
|
+
if (t.valueOf !== Object.prototype.valueOf && typeof t.valueOf == "function" && typeof r.valueOf == "function") return t.valueOf() === r.valueOf();
|
|
51
|
+
if (t.toString !== Object.prototype.toString && typeof t.toString == "function" && typeof r.toString == "function") return t.toString() === r.toString();
|
|
52
|
+
if (o = Object.keys(t), n = o.length, n !== Object.keys(r).length) return !1;
|
|
53
|
+
for (e = n; e-- !== 0; )
|
|
54
|
+
if (!Object.prototype.hasOwnProperty.call(r, o[e])) return !1;
|
|
55
|
+
if (_ && t instanceof Element) return !1;
|
|
56
|
+
for (e = n; e-- !== 0; )
|
|
57
|
+
if (!((o[e] === "_owner" || o[e] === "__v" || o[e] === "__o") && t.$$typeof) && !g(t[o[e]], r[o[e]]))
|
|
57
58
|
return !1;
|
|
58
59
|
return !0;
|
|
59
60
|
}
|
|
60
|
-
return
|
|
61
|
+
return t !== t && r !== r;
|
|
61
62
|
}
|
|
62
|
-
var
|
|
63
|
+
var U = function(r, n) {
|
|
63
64
|
try {
|
|
64
|
-
return
|
|
65
|
-
} catch (
|
|
66
|
-
if ((
|
|
65
|
+
return g(r, n);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
if ((e.message || "").match(/stack|recursion/i))
|
|
67
68
|
return console.warn("react-fast-compare cannot handle circular refs"), !1;
|
|
68
|
-
throw
|
|
69
|
+
throw e;
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
|
-
const
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
var o =
|
|
75
|
-
onFirstUpdate:
|
|
76
|
-
placement:
|
|
77
|
-
strategy:
|
|
78
|
-
modifiers:
|
|
79
|
-
},
|
|
72
|
+
const $ = /* @__PURE__ */ I(U);
|
|
73
|
+
var C = [], B = function(r, n, e) {
|
|
74
|
+
e === void 0 && (e = {});
|
|
75
|
+
var o = c.useRef(null), a = {
|
|
76
|
+
onFirstUpdate: e.onFirstUpdate,
|
|
77
|
+
placement: e.placement || "bottom",
|
|
78
|
+
strategy: e.strategy || "absolute",
|
|
79
|
+
modifiers: e.modifiers || C
|
|
80
|
+
}, l = c.useState({
|
|
80
81
|
styles: {
|
|
81
82
|
popper: {
|
|
82
|
-
position:
|
|
83
|
+
position: a.strategy,
|
|
83
84
|
left: "0",
|
|
84
85
|
top: "0"
|
|
85
86
|
},
|
|
@@ -88,90 +89,119 @@ var D = [], $ = function(r, n, t) {
|
|
|
88
89
|
}
|
|
89
90
|
},
|
|
90
91
|
attributes: {}
|
|
91
|
-
}),
|
|
92
|
+
}), v = l[0], h = l[1], y = c.useMemo(function() {
|
|
92
93
|
return {
|
|
93
94
|
name: "updateState",
|
|
94
95
|
enabled: !0,
|
|
95
96
|
phase: "write",
|
|
96
|
-
fn: function(
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
styles:
|
|
101
|
-
return [
|
|
97
|
+
fn: function(m) {
|
|
98
|
+
var p = m.state, f = Object.keys(p.elements);
|
|
99
|
+
x.flushSync(function() {
|
|
100
|
+
h({
|
|
101
|
+
styles: P(f.map(function(i) {
|
|
102
|
+
return [i, p.styles[i] || {}];
|
|
102
103
|
})),
|
|
103
|
-
attributes:
|
|
104
|
-
return [
|
|
104
|
+
attributes: P(f.map(function(i) {
|
|
105
|
+
return [i, p.attributes[i]];
|
|
105
106
|
}))
|
|
106
107
|
});
|
|
107
108
|
});
|
|
108
109
|
},
|
|
109
110
|
requires: ["computeStyles"]
|
|
110
111
|
};
|
|
111
|
-
}, []),
|
|
112
|
-
var
|
|
113
|
-
onFirstUpdate:
|
|
114
|
-
placement:
|
|
115
|
-
strategy:
|
|
116
|
-
modifiers: [].concat(
|
|
112
|
+
}, []), d = c.useMemo(function() {
|
|
113
|
+
var s = {
|
|
114
|
+
onFirstUpdate: a.onFirstUpdate,
|
|
115
|
+
placement: a.placement,
|
|
116
|
+
strategy: a.strategy,
|
|
117
|
+
modifiers: [].concat(a.modifiers, [y, {
|
|
117
118
|
name: "applyStyles",
|
|
118
119
|
enabled: !1
|
|
119
120
|
}])
|
|
120
121
|
};
|
|
121
|
-
return
|
|
122
|
-
}, [
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
}, [
|
|
122
|
+
return $(o.current, s) ? o.current || s : (o.current = s, s);
|
|
123
|
+
}, [a.onFirstUpdate, a.placement, a.strategy, a.modifiers, y]), u = c.useRef();
|
|
124
|
+
return S(function() {
|
|
125
|
+
u.current && u.current.setOptions(d);
|
|
126
|
+
}, [d]), S(function() {
|
|
126
127
|
if (!(r == null || n == null)) {
|
|
127
|
-
var
|
|
128
|
-
return
|
|
129
|
-
|
|
128
|
+
var s = e.createPopper || A, m = s(r, n, d);
|
|
129
|
+
return u.current = m, function() {
|
|
130
|
+
m.destroy(), u.current = null;
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
|
-
}, [r, n,
|
|
133
|
-
state:
|
|
134
|
-
styles:
|
|
135
|
-
attributes:
|
|
136
|
-
update:
|
|
137
|
-
forceUpdate:
|
|
133
|
+
}, [r, n, e.createPopper]), {
|
|
134
|
+
state: u.current ? u.current.state : null,
|
|
135
|
+
styles: v.styles,
|
|
136
|
+
attributes: v.attributes,
|
|
137
|
+
update: u.current ? u.current.update : null,
|
|
138
|
+
forceUpdate: u.current ? u.current.forceUpdate : null
|
|
138
139
|
};
|
|
139
140
|
};
|
|
140
|
-
function
|
|
141
|
-
|
|
141
|
+
var q = process.env.NODE_ENV !== "production", z = function() {
|
|
142
|
+
};
|
|
143
|
+
if (q) {
|
|
144
|
+
var L = function(r, n) {
|
|
145
|
+
var e = arguments.length;
|
|
146
|
+
n = new Array(e > 1 ? e - 1 : 0);
|
|
147
|
+
for (var o = 1; o < e; o++)
|
|
148
|
+
n[o - 1] = arguments[o];
|
|
149
|
+
var a = 0, l = "Warning: " + r.replace(/%s/g, function() {
|
|
150
|
+
return n[a++];
|
|
151
|
+
});
|
|
152
|
+
typeof console < "u" && console.error(l);
|
|
153
|
+
try {
|
|
154
|
+
throw new Error(l);
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
z = function(t, r, n) {
|
|
159
|
+
var e = arguments.length;
|
|
160
|
+
n = new Array(e > 2 ? e - 2 : 0);
|
|
161
|
+
for (var o = 2; o < e; o++)
|
|
162
|
+
n[o - 2] = arguments[o];
|
|
163
|
+
if (r === void 0)
|
|
164
|
+
throw new Error(
|
|
165
|
+
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
166
|
+
);
|
|
167
|
+
t || L.apply(null, [r].concat(n));
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function G(t) {
|
|
171
|
+
const { children: r, content: n, isOpen: e, onClickOutside: o, placement: a } = t, [l, v] = O(null), [h, y] = O(
|
|
142
172
|
null
|
|
143
|
-
),
|
|
144
|
-
placement:
|
|
173
|
+
), d = R(null), u = R(null), { styles: s, attributes: m } = B(l, h, {
|
|
174
|
+
placement: a
|
|
145
175
|
});
|
|
146
|
-
function
|
|
147
|
-
var
|
|
148
|
-
!((
|
|
176
|
+
function p(f) {
|
|
177
|
+
var i, w;
|
|
178
|
+
!((i = d.current) != null && i.contains(f.target)) && !((w = u.current) != null && w.contains(f.target)) && (o == null || o());
|
|
149
179
|
}
|
|
150
|
-
return
|
|
151
|
-
document.removeEventListener("mousedown",
|
|
152
|
-
}), [
|
|
153
|
-
/* @__PURE__ */
|
|
180
|
+
return N(() => (e ? document.addEventListener("mousedown", p) : document.removeEventListener("mousedown", p), () => {
|
|
181
|
+
document.removeEventListener("mousedown", p);
|
|
182
|
+
}), [e]), /* @__PURE__ */ M(j, { children: [
|
|
183
|
+
/* @__PURE__ */ E(
|
|
154
184
|
"div",
|
|
155
185
|
{
|
|
156
186
|
ref: (f) => {
|
|
157
|
-
|
|
187
|
+
v(f), u.current = f;
|
|
158
188
|
},
|
|
159
189
|
children: r
|
|
160
190
|
}
|
|
161
191
|
),
|
|
162
|
-
|
|
192
|
+
e && /* @__PURE__ */ E(
|
|
163
193
|
"div",
|
|
164
194
|
{
|
|
165
195
|
ref: (f) => {
|
|
166
|
-
|
|
196
|
+
y(f), d.current = f;
|
|
167
197
|
},
|
|
168
|
-
style: { ...
|
|
169
|
-
...
|
|
198
|
+
style: { ...s.popper, zIndex: t.baseZIndex ?? 5 },
|
|
199
|
+
...m.popper,
|
|
170
200
|
children: n
|
|
171
201
|
}
|
|
172
202
|
)
|
|
173
203
|
] });
|
|
174
204
|
}
|
|
175
205
|
export {
|
|
176
|
-
|
|
206
|
+
G as Popper
|
|
177
207
|
};
|
|
@@ -1,19 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { BoxProps } from './Box';
|
|
3
3
|
|
|
4
4
|
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Current progress as a floating point number between `minValue` (default: 0) and `maxValue` (default: 1).
|
|
7
|
+
* Determines the percentage and how filled the bar is.
|
|
8
|
+
*/
|
|
5
9
|
value: number;
|
|
6
10
|
} & Partial<{
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Color of the progress bar. Can take any of the following formats:
|
|
13
|
+
* - `#ffffff` - Hex format
|
|
14
|
+
* - `rgb(r,g,b) / rgba(r,g,b,a)` - RGB format
|
|
15
|
+
* - `<name>` - the name of a `color-<name>` CSS class. See `CSS_COLORS` in `constants.js`.
|
|
16
|
+
* - `<name>` - the name of a base CSS color, if not overridden by the definitions above.
|
|
17
|
+
*/
|
|
9
18
|
color: string;
|
|
10
|
-
|
|
19
|
+
/** Highest possible value. */
|
|
11
20
|
maxValue: number;
|
|
21
|
+
/** Lowest possible value. */
|
|
12
22
|
minValue: number;
|
|
23
|
+
/**
|
|
24
|
+
* Applies a `color` to the progress bar based on whether the value lands in the range between `from` and `to`.
|
|
25
|
+
* This takes an object with the following format:
|
|
26
|
+
* ```tsx
|
|
27
|
+
* {
|
|
28
|
+
* (colorname): [from, to]
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
* For example:
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <ProgressBar
|
|
34
|
+
* value={0.5}
|
|
35
|
+
* ranges={{
|
|
36
|
+
* bad: [0, 0.5],
|
|
37
|
+
* good: [0.5, 1],
|
|
38
|
+
* }}
|
|
39
|
+
* />
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
13
43
|
ranges: Record<string, [number, number]>;
|
|
14
|
-
style: CSSProperties;
|
|
15
|
-
title: string;
|
|
16
|
-
width: string | number;
|
|
17
44
|
}> & BoxProps & PropsWithChildren;
|
|
18
45
|
export declare function ProgressBar(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
19
46
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as g, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { CSS_COLORS as v } from "../common/constants.js";
|
|
3
|
-
import {
|
|
3
|
+
import { scale as y, keyOfMatchingRange as N, clamp01 as _, toFixed as B } from "../common/math.js";
|
|
4
4
|
import { classes as m } from "../common/react.js";
|
|
5
5
|
import { s as o } from "../ProgressBar.module-BkAFfFy0.js";
|
|
6
6
|
import { computeBoxProps as S, computeBoxClassName as O } from "./Box.js";
|
|
@@ -14,12 +14,12 @@ function w(d) {
|
|
|
14
14
|
ranges: h = {},
|
|
15
15
|
children: l,
|
|
16
16
|
...t
|
|
17
|
-
} = d, a =
|
|
17
|
+
} = d, a = y(r, u, p), x = l !== void 0, s = C || N(r, h) || "default", e = S(t), c = [
|
|
18
18
|
o.progressBar,
|
|
19
19
|
f,
|
|
20
20
|
O(t)
|
|
21
21
|
], i = {
|
|
22
|
-
width:
|
|
22
|
+
width: _(a) * 100 + "%"
|
|
23
23
|
};
|
|
24
24
|
return v.includes(s) || s === "default" ? c.push(o["color__" + s]) : (e.style = { ...e.style, borderColor: s }, i.backgroundColor = s), /* @__PURE__ */ g("div", { className: m(c), ...e, children: [
|
|
25
25
|
/* @__PURE__ */ n(
|
|
@@ -29,7 +29,7 @@ function w(d) {
|
|
|
29
29
|
style: i
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
|
-
/* @__PURE__ */ n("div", { className: o.content, children: x ? l :
|
|
32
|
+
/* @__PURE__ */ n("div", { className: o.content, children: x ? l : B(a * 100) + "%" })
|
|
33
33
|
] });
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as k, jsx as _ } from "react/jsx-runtime";
|
|
2
|
-
import { scale as d,
|
|
2
|
+
import { scale as d, clamp01 as M, keyOfMatchingRange as N } from "../common/math.js";
|
|
3
3
|
import { classes as u } from "../common/react.js";
|
|
4
4
|
import { AnimatedNumber as A } from "./AnimatedNumber.js";
|
|
5
5
|
import { Box as B, computeBoxClassName as G, computeBoxProps as j } from "./Box.js";
|
|
@@ -65,7 +65,7 @@ function A_(y) {
|
|
|
65
65
|
style: w,
|
|
66
66
|
value: l,
|
|
67
67
|
...m
|
|
68
|
-
} = y, C = d(l, s, n), p =
|
|
68
|
+
} = y, C = d(l, s, n), p = M(C), c = a ? {} : { primary: [0, 1] };
|
|
69
69
|
a && Object.keys(a).forEach((t) => {
|
|
70
70
|
const g = a[t];
|
|
71
71
|
c[t] = [
|
|
@@ -76,7 +76,7 @@ function A_(y) {
|
|
|
76
76
|
function x() {
|
|
77
77
|
return o && r && l > o && l < r || o && l > o ? !0 : !!(r && l < r);
|
|
78
78
|
}
|
|
79
|
-
const b = x() &&
|
|
79
|
+
const b = x() && N(p, c);
|
|
80
80
|
return /* @__PURE__ */ k(B, { inline: !0, children: [
|
|
81
81
|
/* @__PURE__ */ _(
|
|
82
82
|
"div",
|
|
@@ -48,7 +48,7 @@ export declare const Section: import('react').ForwardRefExoticComponent<Partial<
|
|
|
48
48
|
as: string;
|
|
49
49
|
children: ReactNode;
|
|
50
50
|
className: string | import('../common/react').BooleanLike;
|
|
51
|
-
style:
|
|
51
|
+
style: import('react').CSSProperties;
|
|
52
52
|
}> & Partial<Record<"bold" | "italic" | "nowrap" | "fillPositionedParent" | "inline" | "preserveWhitespace", boolean>> & Partial<Record<"fontWeight" | "textAlign" | "bottom" | "fontFamily" | "fontSize" | "height" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflow" | "overflowX" | "overflowY" | "position" | "right" | "top" | "verticalAlign" | "width" | "color" | "backgroundColor" | "align" | "lineHeight" | "m" | "mb" | "ml" | "mr" | "mt" | "mx" | "my" | "p" | "pb" | "pl" | "pr" | "pt" | "px" | "py" | "textColor", string | import('../common/react').BooleanLike>> & Partial<{
|
|
53
53
|
onClick: import('react').MouseEventHandler<HTMLDivElement>;
|
|
54
54
|
onContextMenu: import('react').MouseEventHandler<HTMLDivElement>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as S, useEffect as j } from "react";
|
|
3
3
|
import { addScrollableNode as z, removeScrollableNode as B } from "../common/events.js";
|
|
4
|
-
import {
|
|
4
|
+
import { canRender as m, classes as H } from "../common/react.js";
|
|
5
5
|
import { s as t } from "../Section.module-CLVHJ4yA.js";
|
|
6
6
|
import { computeBoxClassName as T, computeBoxProps as y } from "./Box.js";
|
|
7
7
|
const q = S(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { scale as f, keyOfMatchingRange as R, clamp01 as t } from "../common/math.js";
|
|
3
3
|
import { classes as _ } from "../common/react.js";
|
|
4
4
|
import { s as e } from "../ProgressBar.module-BkAFfFy0.js";
|
|
5
5
|
import { computeBoxClassName as $, computeBoxProps as q } from "./Box.js";
|
|
@@ -24,7 +24,7 @@ export declare const TextArea: import('react').ForwardRefExoticComponent<Partial
|
|
|
24
24
|
as: string;
|
|
25
25
|
children: import('react').ReactNode;
|
|
26
26
|
className: string | import('../common/react').BooleanLike;
|
|
27
|
-
style:
|
|
27
|
+
style: import('react').CSSProperties;
|
|
28
28
|
}> & Partial<Record<"bold" | "italic" | "nowrap" | "fillPositionedParent" | "inline" | "preserveWhitespace", boolean>> & Partial<Record<"fontWeight" | "textAlign" | "bottom" | "fontFamily" | "fontSize" | "height" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflow" | "overflowX" | "overflowY" | "position" | "right" | "top" | "verticalAlign" | "width" | "color" | "backgroundColor" | "align" | "lineHeight" | "m" | "mb" | "ml" | "mr" | "mt" | "mx" | "my" | "p" | "pb" | "pl" | "pr" | "pt" | "px" | "py" | "textColor", string | import('../common/react').BooleanLike>> & Partial<{
|
|
29
29
|
onClick: import('react').MouseEventHandler<HTMLDivElement>;
|
|
30
30
|
onContextMenu: import('react').MouseEventHandler<HTMLDivElement>;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { createPopper, Placement, VirtualElement } from '@popperjs/core';
|
|
2
2
|
import { Component, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
|
|
4
|
+
type Props = {
|
|
5
|
+
/** The content to display in the tooltip */
|
|
6
6
|
content: ReactNode;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
} & Partial<{
|
|
8
|
+
/** Hovering this element will show the tooltip */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** Where to place the tooltip relative to the reference element */
|
|
11
|
+
position: Placement;
|
|
12
|
+
}>;
|
|
13
|
+
type State = {
|
|
10
14
|
hovered: boolean;
|
|
11
15
|
};
|
|
12
|
-
export declare class Tooltip extends Component<
|
|
16
|
+
export declare class Tooltip extends Component<Props, State> {
|
|
13
17
|
static renderedTooltip: HTMLDivElement | undefined;
|
|
14
18
|
static singletonPopper: ReturnType<typeof createPopper> | undefined;
|
|
15
19
|
static currentHoveredElement: Element | undefined;
|
|
@@ -2,9 +2,9 @@ import '../assets/Tooltip.css';var s = Object.defineProperty;
|
|
|
2
2
|
var p = (o, e, n) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
|
|
3
3
|
var r = (o, e, n) => p(o, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { c } from "../index-jLZg_duJ.js";
|
|
6
|
+
import { Component as m } from "react";
|
|
7
|
+
import { findDOMNode as a, render as u } from "react-dom";
|
|
8
8
|
const h = "_tooltip_1pib4_13", f = {
|
|
9
9
|
tooltip: h
|
|
10
10
|
}, i = {
|
|
@@ -24,9 +24,9 @@ const h = "_tooltip_1pib4_13", f = {
|
|
|
24
24
|
x: 0,
|
|
25
25
|
y: 0,
|
|
26
26
|
toJSON: () => null
|
|
27
|
-
}, t = class t extends
|
|
27
|
+
}, t = class t extends m {
|
|
28
28
|
getDOMNode() {
|
|
29
|
-
return
|
|
29
|
+
return a(this);
|
|
30
30
|
}
|
|
31
31
|
componentDidMount() {
|
|
32
32
|
const e = this.getDOMNode();
|
|
@@ -42,9 +42,9 @@ const h = "_tooltip_1pib4_13", f = {
|
|
|
42
42
|
}
|
|
43
43
|
renderPopperContent() {
|
|
44
44
|
const e = t.renderedTooltip;
|
|
45
|
-
e &&
|
|
45
|
+
e && u(/* @__PURE__ */ l("span", { children: this.props.content }), e, () => {
|
|
46
46
|
let n = t.singletonPopper;
|
|
47
|
-
n === void 0 ? (n =
|
|
47
|
+
n === void 0 ? (n = c(
|
|
48
48
|
t.virtualElement,
|
|
49
49
|
e,
|
|
50
50
|
{
|