tgui-core 1.1.24 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/common/color.js +31 -30
- package/dist/common/events.js +5 -5
- package/dist/common/format.js +27 -27
- package/dist/common/hotkeys.d.ts +0 -1
- package/dist/common/hotkeys.js +2 -2
- package/dist/common/math.d.ts +4 -0
- package/dist/common/math.js +29 -25
- package/dist/common/random.js +14 -13
- package/dist/common/react.js +1 -1
- package/dist/common/string.js +9 -9
- package/dist/common/type-utils.d.ts +1 -1
- package/dist/components/AnimatedNumber.d.ts +6 -6
- package/dist/components/AnimatedNumber.js +14 -17
- package/dist/components/Autofocus.d.ts +0 -1
- package/dist/components/Blink.d.ts +0 -1
- package/dist/components/BlockQuote.d.ts +0 -1
- package/dist/components/BlockQuote.js +4 -7
- package/dist/components/Box.d.ts +2 -1
- package/dist/components/Box.js +4 -4
- package/dist/components/Button.d.ts +0 -1
- package/dist/components/Button.js +173 -211
- package/dist/components/ByondUi.js +3 -3
- package/dist/components/Chart.d.ts +0 -1
- package/dist/components/Chart.js +25 -22
- package/dist/components/Collapsible.d.ts +0 -1
- package/dist/components/ColorBox.d.ts +0 -1
- package/dist/components/ColorBox.js +7 -14
- package/dist/components/Dialog.js +31 -40
- package/dist/components/Dimmer.d.ts +0 -1
- package/dist/components/Dimmer.js +6 -9
- package/dist/components/Divider.js +10 -14
- package/dist/components/DmIcon.d.ts +0 -1
- package/dist/components/DraggableControl.js +58 -52
- package/dist/components/Dropdown.d.ts +0 -1
- package/dist/components/Dropdown.js +73 -67
- package/dist/components/FitText.d.ts +0 -1
- package/dist/components/Flex.d.ts +1 -1
- package/dist/components/Flex.js +39 -41
- package/dist/components/Icon.d.ts +0 -1
- package/dist/components/Icon.js +27 -34
- package/dist/components/Image.d.ts +0 -1
- package/dist/components/Image.js +7 -6
- package/dist/components/ImageButton.d.ts +60 -0
- package/dist/components/ImageButton.js +131 -0
- package/dist/components/InfinitePlane.js +1 -1
- package/dist/components/Input.d.ts +0 -1
- package/dist/components/Input.js +57 -64
- package/dist/components/KeyListener.d.ts +0 -1
- package/dist/components/Knob.d.ts +0 -1
- package/dist/components/Knob.js +91 -117
- package/dist/components/LabeledControls.d.ts +0 -1
- package/dist/components/LabeledList.d.ts +0 -1
- package/dist/components/LabeledList.js +48 -55
- package/dist/components/MenuBar.d.ts +0 -1
- package/dist/components/MenuBar.js +93 -102
- package/dist/components/Modal.d.ts +0 -1
- package/dist/components/Modal.js +11 -18
- package/dist/components/NoticeBox.d.ts +0 -1
- package/dist/components/NoticeBox.js +16 -43
- package/dist/components/NumberInput.d.ts +0 -2
- package/dist/components/NumberInput.js +112 -120
- package/dist/components/Popper.d.ts +0 -1
- package/dist/components/ProgressBar.d.ts +0 -1
- package/dist/components/ProgressBar.js +22 -27
- package/dist/components/RestrictedInput.js +64 -58
- package/dist/components/RoundGauge.d.ts +0 -1
- package/dist/components/RoundGauge.js +70 -104
- package/dist/components/Section.d.ts +1 -2
- package/dist/components/Section.js +50 -51
- package/dist/components/Slider.d.ts +2 -1
- package/dist/components/Slider.js +72 -80
- package/dist/components/Stack.d.ts +0 -1
- package/dist/components/Stack.js +37 -47
- package/dist/components/StyleableSection.d.ts +0 -1
- package/dist/components/StyleableSection.js +11 -11
- package/dist/components/Table.d.ts +0 -1
- package/dist/components/Table.js +38 -47
- package/dist/components/Tabs.d.ts +0 -1
- package/dist/components/Tabs.js +43 -75
- package/dist/components/TextArea.d.ts +2 -1
- package/dist/components/TextArea.js +74 -69
- package/dist/components/TimeDisplay.d.ts +7 -6
- package/dist/components/TimeDisplay.js +17 -17
- package/dist/components/Tooltip.d.ts +1 -2
- package/dist/components/Tooltip.js +8 -10
- package/dist/components/TrackOutsideClicks.d.ts +0 -1
- package/dist/components/VirtualList.d.ts +0 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +60 -58
- package/package.json +11 -25
- package/dist/ProgressBar.module-Jzqlebbx.js +0 -29
- package/dist/Section.module-qhQWhlUX.js +0 -18
- package/dist/assets/BlockQuote.css +0 -1
- package/dist/assets/Button.css +0 -1
- package/dist/assets/ColorBox.css +0 -1
- package/dist/assets/Dialog.css +0 -1
- package/dist/assets/Dimmer.css +0 -1
- package/dist/assets/Divider.css +0 -1
- package/dist/assets/Flex.css +0 -1
- package/dist/assets/Icon.css +0 -6
- package/dist/assets/Input.css +0 -1
- package/dist/assets/Knob.css +0 -1
- package/dist/assets/LabeledList.css +0 -1
- package/dist/assets/MenuBar.css +0 -1
- package/dist/assets/Modal.css +0 -1
- package/dist/assets/NoticeBox.css +0 -1
- package/dist/assets/NumberInput.css +0 -1
- package/dist/assets/ProgressBar.css +0 -1
- package/dist/assets/RoundGauge.css +0 -1
- package/dist/assets/Section.css +0 -1
- package/dist/assets/Slider.css +0 -1
- package/dist/assets/Stack.css +0 -1
- package/dist/assets/Table.css +0 -1
- package/dist/assets/Tabs.css +0 -1
- package/dist/assets/TextArea.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
|
@@ -1,301 +1,263 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { KEY as
|
|
4
|
-
import { classes as
|
|
5
|
-
import { computeBoxClassName as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
|
|
9
|
-
button: L,
|
|
10
|
-
fa: Y,
|
|
11
|
-
fas: G,
|
|
12
|
-
far: H,
|
|
13
|
-
dropdown: J,
|
|
14
|
-
ellipsis: Q,
|
|
15
|
-
fluid: U,
|
|
16
|
-
circular: W,
|
|
17
|
-
compact: X,
|
|
18
|
-
color__black: Z,
|
|
19
|
-
color__white: $,
|
|
20
|
-
color__red: oo,
|
|
21
|
-
color__orange: to,
|
|
22
|
-
color__yellow: _o,
|
|
23
|
-
color__olive: no,
|
|
24
|
-
color__green: eo,
|
|
25
|
-
color__teal: lo,
|
|
26
|
-
color__blue: co,
|
|
27
|
-
color__violet: ro,
|
|
28
|
-
color__purple: io,
|
|
29
|
-
color__pink: so,
|
|
30
|
-
color__brown: ao,
|
|
31
|
-
color__grey: uo,
|
|
32
|
-
"color__light-grey": "_color__light-grey_433yx_251",
|
|
33
|
-
color__good: fo,
|
|
34
|
-
color__average: po,
|
|
35
|
-
color__bad: yo,
|
|
36
|
-
color__label: xo,
|
|
37
|
-
color__default: mo,
|
|
38
|
-
color__caution: go,
|
|
39
|
-
color__danger: bo,
|
|
40
|
-
color__transparent: ho,
|
|
41
|
-
disabled: Co,
|
|
42
|
-
selected: ko,
|
|
43
|
-
flex: vo,
|
|
44
|
-
flex__fluid: wo,
|
|
45
|
-
verticalAlignContent__top: Ao,
|
|
46
|
-
verticalAlignContent__middle: Bo,
|
|
47
|
-
verticalAlignContent__bottom: Io,
|
|
48
|
-
content: No,
|
|
49
|
-
textMargin: Ro
|
|
50
|
-
};
|
|
51
|
-
function b(a) {
|
|
1
|
+
import { jsx as i, jsxs as _, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, createRef as V, useEffect as $, useRef as z } from "react";
|
|
3
|
+
import { KEY as D, isEscape as E } from "../common/keys.js";
|
|
4
|
+
import { classes as F } from "../common/react.js";
|
|
5
|
+
import { computeBoxClassName as j, computeBoxProps as q, Box as O } from "./Box.js";
|
|
6
|
+
import { Icon as S } from "./Icon.js";
|
|
7
|
+
import { Tooltip as v } from "./Tooltip.js";
|
|
8
|
+
function x(u) {
|
|
52
9
|
const {
|
|
53
|
-
captureKeys:
|
|
10
|
+
captureKeys: l = !0,
|
|
54
11
|
children: s,
|
|
55
|
-
circular:
|
|
56
|
-
className:
|
|
57
|
-
color:
|
|
12
|
+
circular: m,
|
|
13
|
+
className: d,
|
|
14
|
+
color: c,
|
|
58
15
|
compact: h,
|
|
59
|
-
content:
|
|
60
|
-
disabled:
|
|
61
|
-
ellipsis:
|
|
62
|
-
fluid:
|
|
16
|
+
content: B,
|
|
17
|
+
disabled: t,
|
|
18
|
+
ellipsis: r,
|
|
19
|
+
fluid: o,
|
|
63
20
|
icon: e,
|
|
64
|
-
iconColor:
|
|
65
|
-
iconPosition:
|
|
66
|
-
iconRotation:
|
|
67
|
-
iconSize:
|
|
68
|
-
iconSpin:
|
|
69
|
-
onClick:
|
|
70
|
-
selected:
|
|
71
|
-
tooltip:
|
|
72
|
-
tooltipPosition:
|
|
73
|
-
verticalAlignContent:
|
|
74
|
-
...
|
|
75
|
-
} =
|
|
76
|
-
let
|
|
21
|
+
iconColor: a,
|
|
22
|
+
iconPosition: C,
|
|
23
|
+
iconRotation: N,
|
|
24
|
+
iconSize: R,
|
|
25
|
+
iconSpin: P,
|
|
26
|
+
onClick: f,
|
|
27
|
+
selected: g,
|
|
28
|
+
tooltip: b,
|
|
29
|
+
tooltipPosition: w,
|
|
30
|
+
verticalAlignContent: y,
|
|
31
|
+
...I
|
|
32
|
+
} = u, n = B || s;
|
|
33
|
+
let k = /* @__PURE__ */ i(
|
|
77
34
|
"div",
|
|
78
35
|
{
|
|
79
|
-
className:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
h &&
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
36
|
+
className: F([
|
|
37
|
+
"Button",
|
|
38
|
+
o && "Button--fluid",
|
|
39
|
+
t && "Button--disabled",
|
|
40
|
+
g && "Button--selected",
|
|
41
|
+
m && "Button--circular",
|
|
42
|
+
h && "Button--compact",
|
|
43
|
+
C && `Button--iconPosition--${C}`,
|
|
44
|
+
y && "Button--flex",
|
|
45
|
+
y && o && "Button--flex--fluid",
|
|
46
|
+
y && `Button--verticalAlignContent--${y}`,
|
|
47
|
+
c && typeof c == "string" ? `Button--color--${c}` : "Button--color--default",
|
|
48
|
+
d,
|
|
49
|
+
j(I)
|
|
92
50
|
]),
|
|
93
|
-
tabIndex:
|
|
94
|
-
onClick: (
|
|
95
|
-
!
|
|
51
|
+
tabIndex: t ? void 0 : 0,
|
|
52
|
+
onClick: (p) => {
|
|
53
|
+
!t && f && f(p);
|
|
96
54
|
},
|
|
97
|
-
onKeyDown: (
|
|
98
|
-
if (
|
|
99
|
-
if (
|
|
100
|
-
|
|
55
|
+
onKeyDown: (p) => {
|
|
56
|
+
if (l) {
|
|
57
|
+
if (p.key === D.Space || p.key === D.Enter) {
|
|
58
|
+
p.preventDefault(), !t && f && f(p);
|
|
101
59
|
return;
|
|
102
60
|
}
|
|
103
|
-
E(
|
|
61
|
+
E(p.key) && p.preventDefault();
|
|
104
62
|
}
|
|
105
63
|
},
|
|
106
|
-
...
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
e &&
|
|
109
|
-
|
|
64
|
+
...q(I),
|
|
65
|
+
children: /* @__PURE__ */ _("div", { className: "Button__content", children: [
|
|
66
|
+
e && C !== "right" && /* @__PURE__ */ i(
|
|
67
|
+
S,
|
|
110
68
|
{
|
|
111
|
-
mr:
|
|
69
|
+
mr: n ? 1 : 0,
|
|
112
70
|
name: e,
|
|
113
|
-
color:
|
|
114
|
-
rotation:
|
|
115
|
-
size:
|
|
116
|
-
spin:
|
|
71
|
+
color: a,
|
|
72
|
+
rotation: N,
|
|
73
|
+
size: R,
|
|
74
|
+
spin: P
|
|
117
75
|
}
|
|
118
76
|
),
|
|
119
|
-
|
|
77
|
+
r ? /* @__PURE__ */ i(
|
|
120
78
|
"span",
|
|
121
79
|
{
|
|
122
|
-
className:
|
|
123
|
-
|
|
80
|
+
className: F([
|
|
81
|
+
"Button--ellipsis",
|
|
82
|
+
e && "Button__textMargin"
|
|
83
|
+
]),
|
|
84
|
+
children: n
|
|
124
85
|
}
|
|
125
|
-
) :
|
|
126
|
-
e &&
|
|
127
|
-
|
|
86
|
+
) : n,
|
|
87
|
+
e && C === "right" && /* @__PURE__ */ i(
|
|
88
|
+
S,
|
|
128
89
|
{
|
|
129
|
-
ml:
|
|
90
|
+
ml: n ? 1 : 0,
|
|
130
91
|
name: e,
|
|
131
|
-
color:
|
|
132
|
-
rotation:
|
|
133
|
-
size:
|
|
134
|
-
spin:
|
|
92
|
+
color: a,
|
|
93
|
+
rotation: N,
|
|
94
|
+
size: R,
|
|
95
|
+
spin: P
|
|
135
96
|
}
|
|
136
97
|
)
|
|
137
98
|
] })
|
|
138
99
|
}
|
|
139
100
|
);
|
|
140
|
-
return
|
|
101
|
+
return b && (k = /* @__PURE__ */ i(v, { content: b, position: w, children: k })), k;
|
|
141
102
|
}
|
|
142
|
-
function
|
|
143
|
-
const { checked:
|
|
144
|
-
return /* @__PURE__ */
|
|
145
|
-
|
|
103
|
+
function T(u) {
|
|
104
|
+
const { checked: l, ...s } = u;
|
|
105
|
+
return /* @__PURE__ */ i(
|
|
106
|
+
x,
|
|
146
107
|
{
|
|
147
108
|
color: "transparent",
|
|
148
|
-
icon:
|
|
149
|
-
selected:
|
|
109
|
+
icon: l ? "check-square-o" : "square-o",
|
|
110
|
+
selected: l,
|
|
150
111
|
...s
|
|
151
112
|
}
|
|
152
113
|
);
|
|
153
114
|
}
|
|
154
|
-
|
|
155
|
-
function
|
|
115
|
+
x.Checkbox = T;
|
|
116
|
+
function L(u) {
|
|
156
117
|
const {
|
|
157
|
-
children:
|
|
118
|
+
children: l,
|
|
158
119
|
color: s,
|
|
159
|
-
confirmColor:
|
|
160
|
-
confirmContent:
|
|
161
|
-
confirmIcon:
|
|
120
|
+
confirmColor: m = "bad",
|
|
121
|
+
confirmContent: d = "Confirm?",
|
|
122
|
+
confirmIcon: c,
|
|
162
123
|
ellipsis: h = !0,
|
|
163
|
-
icon:
|
|
164
|
-
onClick:
|
|
165
|
-
...
|
|
166
|
-
} =
|
|
167
|
-
function
|
|
168
|
-
if (!
|
|
124
|
+
icon: B,
|
|
125
|
+
onClick: t,
|
|
126
|
+
...r
|
|
127
|
+
} = u, [o, e] = A(!1);
|
|
128
|
+
function a(C) {
|
|
129
|
+
if (!o) {
|
|
169
130
|
e(!0);
|
|
170
131
|
return;
|
|
171
132
|
}
|
|
172
|
-
|
|
133
|
+
t == null || t(C), e(!1);
|
|
173
134
|
}
|
|
174
|
-
return /* @__PURE__ */
|
|
175
|
-
|
|
135
|
+
return /* @__PURE__ */ i(
|
|
136
|
+
x,
|
|
176
137
|
{
|
|
177
|
-
icon:
|
|
178
|
-
color:
|
|
179
|
-
onClick:
|
|
180
|
-
...
|
|
181
|
-
children:
|
|
138
|
+
icon: o ? c : B,
|
|
139
|
+
color: o ? m : s,
|
|
140
|
+
onClick: a,
|
|
141
|
+
...r,
|
|
142
|
+
children: o ? d : l
|
|
182
143
|
}
|
|
183
144
|
);
|
|
184
145
|
}
|
|
185
|
-
|
|
186
|
-
function
|
|
146
|
+
x.Confirm = L;
|
|
147
|
+
function M(u) {
|
|
187
148
|
const {
|
|
188
|
-
children:
|
|
149
|
+
children: l,
|
|
189
150
|
color: s = "default",
|
|
190
|
-
content:
|
|
191
|
-
currentValue:
|
|
192
|
-
defaultValue:
|
|
151
|
+
content: m,
|
|
152
|
+
currentValue: d,
|
|
153
|
+
defaultValue: c,
|
|
193
154
|
disabled: h,
|
|
194
|
-
fluid:
|
|
195
|
-
icon:
|
|
196
|
-
iconRotation:
|
|
197
|
-
iconSpin:
|
|
155
|
+
fluid: B,
|
|
156
|
+
icon: t,
|
|
157
|
+
iconRotation: r,
|
|
158
|
+
iconSpin: o,
|
|
198
159
|
maxLength: e,
|
|
199
|
-
onCommit:
|
|
200
|
-
placeholder:
|
|
201
|
-
tooltip:
|
|
202
|
-
tooltipPosition:
|
|
203
|
-
...
|
|
204
|
-
} =
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
if (!
|
|
208
|
-
|
|
160
|
+
onCommit: a = () => null,
|
|
161
|
+
placeholder: C,
|
|
162
|
+
tooltip: N,
|
|
163
|
+
tooltipPosition: R,
|
|
164
|
+
...P
|
|
165
|
+
} = u, [f, g] = A(!1), b = V(), w = m || l;
|
|
166
|
+
function y(n) {
|
|
167
|
+
const k = b.current;
|
|
168
|
+
if (!k) return;
|
|
169
|
+
k.value !== "" ? a(n, k.value) : c && a(n, c);
|
|
209
170
|
}
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
|
|
171
|
+
$(() => {
|
|
172
|
+
const n = b.current;
|
|
173
|
+
if (n && f) {
|
|
174
|
+
n.value = d || "";
|
|
214
175
|
try {
|
|
215
|
-
|
|
176
|
+
n.focus(), n.select();
|
|
216
177
|
} catch {
|
|
217
178
|
}
|
|
218
179
|
}
|
|
219
|
-
}, [
|
|
220
|
-
let
|
|
221
|
-
|
|
180
|
+
}, [f, d]);
|
|
181
|
+
let I = /* @__PURE__ */ _(
|
|
182
|
+
O,
|
|
222
183
|
{
|
|
223
|
-
className:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
184
|
+
className: F([
|
|
185
|
+
"Button",
|
|
186
|
+
B && "Button--fluid",
|
|
187
|
+
h && "Button--disabled",
|
|
188
|
+
`Button--color--${s}`
|
|
227
189
|
]),
|
|
228
|
-
...
|
|
229
|
-
onClick: () =>
|
|
190
|
+
...P,
|
|
191
|
+
onClick: () => g(!0),
|
|
230
192
|
children: [
|
|
231
|
-
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
193
|
+
t && /* @__PURE__ */ i(S, { name: t, rotation: r, spin: o }),
|
|
194
|
+
/* @__PURE__ */ i("div", { children: w }),
|
|
195
|
+
/* @__PURE__ */ i(
|
|
234
196
|
"input",
|
|
235
197
|
{
|
|
236
198
|
disabled: !!h,
|
|
237
|
-
ref:
|
|
199
|
+
ref: b,
|
|
238
200
|
className: "NumberInput__input",
|
|
239
201
|
style: {
|
|
240
|
-
display:
|
|
202
|
+
display: f ? "" : "none",
|
|
241
203
|
textAlign: "left"
|
|
242
204
|
},
|
|
243
|
-
onBlur: (
|
|
244
|
-
|
|
205
|
+
onBlur: (n) => {
|
|
206
|
+
f && (g(!1), y(n));
|
|
245
207
|
},
|
|
246
|
-
onKeyDown: (
|
|
247
|
-
if (
|
|
248
|
-
|
|
208
|
+
onKeyDown: (n) => {
|
|
209
|
+
if (n.key === D.Enter) {
|
|
210
|
+
g(!1), y(n);
|
|
249
211
|
return;
|
|
250
212
|
}
|
|
251
|
-
E(
|
|
213
|
+
E(n.key) && g(!1);
|
|
252
214
|
}
|
|
253
215
|
}
|
|
254
216
|
)
|
|
255
217
|
]
|
|
256
218
|
}
|
|
257
219
|
);
|
|
258
|
-
return
|
|
220
|
+
return N && (I = /* @__PURE__ */ i(v, { content: N, position: R, children: I })), I;
|
|
259
221
|
}
|
|
260
|
-
|
|
261
|
-
function
|
|
262
|
-
const { accept:
|
|
263
|
-
async function h(
|
|
264
|
-
const
|
|
222
|
+
x.Input = M;
|
|
223
|
+
function Y(u) {
|
|
224
|
+
const { accept: l, multiple: s, onSelectFiles: m, ...d } = u, c = z(null);
|
|
225
|
+
async function h(t) {
|
|
226
|
+
const r = Array.from(t).map((o) => {
|
|
265
227
|
const e = new FileReader();
|
|
266
|
-
return new Promise((
|
|
267
|
-
e.onload = () =>
|
|
228
|
+
return new Promise((a) => {
|
|
229
|
+
e.onload = () => a(e.result), e.readAsText(o);
|
|
268
230
|
});
|
|
269
231
|
});
|
|
270
|
-
return await Promise.all(
|
|
232
|
+
return await Promise.all(r);
|
|
271
233
|
}
|
|
272
|
-
async function
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
|
|
234
|
+
async function B(t) {
|
|
235
|
+
const r = t.target.files;
|
|
236
|
+
if (r != null && r.length) {
|
|
237
|
+
const o = await h(r);
|
|
238
|
+
m(s ? o : o[0]);
|
|
277
239
|
}
|
|
278
240
|
}
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
var
|
|
282
|
-
return (
|
|
283
|
-
}, ...
|
|
284
|
-
/* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ _(K, { children: [
|
|
242
|
+
/* @__PURE__ */ i(x, { onClick: () => {
|
|
243
|
+
var t;
|
|
244
|
+
return (t = c.current) == null ? void 0 : t.click();
|
|
245
|
+
}, ...d }),
|
|
246
|
+
/* @__PURE__ */ i(
|
|
285
247
|
"input",
|
|
286
248
|
{
|
|
287
249
|
hidden: !0,
|
|
288
250
|
type: "file",
|
|
289
|
-
ref:
|
|
290
|
-
accept:
|
|
251
|
+
ref: c,
|
|
252
|
+
accept: l,
|
|
291
253
|
multiple: s,
|
|
292
|
-
onChange:
|
|
254
|
+
onChange: B
|
|
293
255
|
}
|
|
294
256
|
)
|
|
295
257
|
] });
|
|
296
258
|
}
|
|
297
|
-
|
|
259
|
+
x.File = Y;
|
|
298
260
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
261
|
+
x as Button,
|
|
262
|
+
T as ButtonCheckbox
|
|
301
263
|
};
|
|
@@ -7,7 +7,7 @@ const o = [];
|
|
|
7
7
|
function h(t) {
|
|
8
8
|
const n = o.length;
|
|
9
9
|
o.push(null);
|
|
10
|
-
const e = t ||
|
|
10
|
+
const e = t || `byondui_${n}`;
|
|
11
11
|
return {
|
|
12
12
|
render: (i) => {
|
|
13
13
|
o[n] = e, Byond.winset(e, i);
|
|
@@ -56,8 +56,8 @@ class U extends a {
|
|
|
56
56
|
this.byondUiElement.render({
|
|
57
57
|
parent: Byond.windowId,
|
|
58
58
|
...n,
|
|
59
|
-
pos: e.pos[0]
|
|
60
|
-
size: e.size[0]
|
|
59
|
+
pos: `${e.pos[0]},${e.pos[1]}`,
|
|
60
|
+
size: `${e.size[0]}x${e.size[1]}`
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
componentWillUnmount() {
|
package/dist/components/Chart.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var w = Object.defineProperty;
|
|
2
2
|
var R = (t, o, e) => o in t ? w(t, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[o] = e;
|
|
3
3
|
var p = (t, o, e) => R(t, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
5
|
-
import { Component as
|
|
4
|
+
import { jsx as c, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import { Component as B, createRef as C } from "react";
|
|
6
6
|
import { zip as u } from "../common/collections.js";
|
|
7
7
|
import { Box as v } from "./Box.js";
|
|
8
|
-
function
|
|
8
|
+
function $(t, o, e, n) {
|
|
9
9
|
if (t.length === 0)
|
|
10
10
|
return [];
|
|
11
11
|
const f = u(...t), h = f.map((r) => Math.min(...r)), a = f.map((r) => Math.max(...r));
|
|
12
12
|
return e !== void 0 && (h[0] = e[0], a[0] = e[1]), n !== void 0 && (h[1] = n[0], a[1] = n[1]), t.map(
|
|
13
13
|
(r) => u(r, h, a, o).map(
|
|
14
|
-
([l, i,
|
|
14
|
+
([l, i, d, m]) => (l - i) / (d - i) * m
|
|
15
15
|
)
|
|
16
16
|
);
|
|
17
17
|
}
|
|
@@ -19,11 +19,11 @@ function L(t) {
|
|
|
19
19
|
let o = "";
|
|
20
20
|
for (let e = 0; e < t.length; e++) {
|
|
21
21
|
const n = t[e];
|
|
22
|
-
o += n[0]
|
|
22
|
+
o += `${n[0]},${n[1]} `;
|
|
23
23
|
}
|
|
24
24
|
return o;
|
|
25
25
|
}
|
|
26
|
-
class b extends
|
|
26
|
+
class b extends B {
|
|
27
27
|
constructor(e) {
|
|
28
28
|
super(e);
|
|
29
29
|
p(this, "ref");
|
|
@@ -34,7 +34,7 @@ class b extends g {
|
|
|
34
34
|
viewBox: [e.offsetWidth, e.offsetHeight]
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
-
this.ref =
|
|
37
|
+
this.ref = C(), this.state = {
|
|
38
38
|
// Initial guess
|
|
39
39
|
viewBox: [600, 200]
|
|
40
40
|
}, this.handleResize = this.handleResize.bind(this);
|
|
@@ -54,13 +54,13 @@ class b extends g {
|
|
|
54
54
|
strokeColor: a = "#ffffff",
|
|
55
55
|
strokeWidth: s = 2,
|
|
56
56
|
...r
|
|
57
|
-
} = this.props, { viewBox: l } = this.state, i =
|
|
57
|
+
} = this.props, { viewBox: l } = this.state, i = $(e, l, n, f);
|
|
58
58
|
if (i.length > 0) {
|
|
59
59
|
const z = i[0], x = i[i.length - 1];
|
|
60
60
|
i.push([l[0] + s, x[1]]), i.push([l[0] + s, -s]), i.push([-s, -s]), i.push([-s, z[1]]);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
return /* @__PURE__ */ c(v, { position: "relative", ...r, children: /* @__PURE__ */ c(v, { ...
|
|
62
|
+
const d = L(i), m = { ...r, className: "", ref: this.ref };
|
|
63
|
+
return /* @__PURE__ */ c(v, { position: "relative", ...r, children: /* @__PURE__ */ c(v, { ...m, children: /* @__PURE__ */ g(
|
|
64
64
|
"svg",
|
|
65
65
|
{
|
|
66
66
|
viewBox: `0 0 ${l[0]} ${l[1]}`,
|
|
@@ -73,23 +73,26 @@ class b extends g {
|
|
|
73
73
|
bottom: 0,
|
|
74
74
|
overflow: "hidden"
|
|
75
75
|
},
|
|
76
|
-
children:
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ c("title", { children: "chart" }),
|
|
78
|
+
/* @__PURE__ */ c(
|
|
79
|
+
"polyline",
|
|
80
|
+
{
|
|
81
|
+
transform: `scale(1, -1) translate(0, -${l[1]})`,
|
|
82
|
+
fill: h,
|
|
83
|
+
stroke: a,
|
|
84
|
+
strokeWidth: s,
|
|
85
|
+
points: d
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
86
89
|
}
|
|
87
90
|
) }) });
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
|
-
const
|
|
93
|
+
const j = {
|
|
91
94
|
Line: b
|
|
92
95
|
};
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
j as Chart
|
|
95
98
|
};
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { classes as
|
|
3
|
-
import { computeBoxClassName as
|
|
4
|
-
import '../assets/ColorBox.css';const m = "_colorBox_110qz_5", a = {
|
|
5
|
-
colorBox: m
|
|
6
|
-
};
|
|
2
|
+
import { classes as c } from "../common/react.js";
|
|
3
|
+
import { computeBoxClassName as s, computeBoxProps as m } from "./Box.js";
|
|
7
4
|
function d(r) {
|
|
8
|
-
const { content:
|
|
9
|
-
return o.color =
|
|
5
|
+
const { content: l, children: a, className: e, ...o } = r;
|
|
6
|
+
return o.color = l ? null : "default", o.backgroundColor = r.color || "default", /* @__PURE__ */ t(
|
|
10
7
|
"div",
|
|
11
8
|
{
|
|
12
|
-
className: s(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
e(o)
|
|
16
|
-
]),
|
|
17
|
-
...n(o),
|
|
18
|
-
children: c || ""
|
|
9
|
+
className: c(["ColorBox", e, s(o)]),
|
|
10
|
+
...m(o),
|
|
11
|
+
children: l || ""
|
|
19
12
|
}
|
|
20
13
|
);
|
|
21
14
|
}
|