tgui-core 1.5.5 → 1.5.7
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/color.d.ts +0 -52
- package/dist/common/color.js +31 -169
- package/dist/common/hotkeys.js +72 -72
- package/dist/components/AnimatedNumber.d.ts +2 -2
- package/dist/components/Button.d.ts +29 -12
- package/dist/components/Button.js +95 -97
- package/dist/components/DmIcon.d.ts +1 -1
- package/dist/components/DmIcon.js +19 -17
- package/dist/components/Icon.d.ts +17 -5
- package/dist/components/Icon.js +24 -22
- package/dist/components/ImageButton.d.ts +14 -5
- package/dist/components/ImageButton.js +97 -81
- package/dist/components/LabeledList.d.ts +34 -31
- package/dist/components/LabeledList.js +19 -18
- package/dist/components/Table.d.ts +28 -20
- package/dist/components/Table.js +7 -6
- package/dist/components/Tabs.d.ts +22 -16
- package/dist/components/Tabs.js +33 -30
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +56 -60
- package/package.json +1 -1
- package/dist/components/Interactive.d.ts +0 -23
- package/dist/components/Interactive.js +0 -75
- package/dist/components/Pointer.d.ts +0 -9
- package/dist/components/Pointer.js +0 -23
package/dist/components/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AnimatedNumber as e } from "./AnimatedNumber.js";
|
|
|
2
2
|
import { Autofocus as m } from "./Autofocus.js";
|
|
3
3
|
import { Blink as x } from "./Blink.js";
|
|
4
4
|
import { BlockQuote as i } from "./BlockQuote.js";
|
|
5
|
-
import { Box as
|
|
5
|
+
import { Box as l } from "./Box.js";
|
|
6
6
|
import { Button as u } from "./Button.js";
|
|
7
7
|
import { ByondUi as c } from "./ByondUi.js";
|
|
8
8
|
import { Chart as b } from "./Chart.js";
|
|
@@ -11,47 +11,45 @@ import { ColorBox as D } from "./ColorBox.js";
|
|
|
11
11
|
import { Dialog as C } from "./Dialog.js";
|
|
12
12
|
import { Dimmer as L } from "./Dimmer.js";
|
|
13
13
|
import { Divider as y } from "./Divider.js";
|
|
14
|
-
import { DmIcon as
|
|
15
|
-
import { DraggableControl as
|
|
16
|
-
import { Dropdown as
|
|
17
|
-
import { FitText as
|
|
14
|
+
import { DmIcon as N } from "./DmIcon.js";
|
|
15
|
+
import { DraggableControl as F } from "./DraggableControl.js";
|
|
16
|
+
import { Dropdown as M } from "./Dropdown.js";
|
|
17
|
+
import { FitText as h } from "./FitText.js";
|
|
18
18
|
import { Flex as w } from "./Flex.js";
|
|
19
19
|
import { Icon as O } from "./Icon.js";
|
|
20
20
|
import { Image as U } from "./Image.js";
|
|
21
21
|
import { ImageButton as j } from "./ImageButton.js";
|
|
22
22
|
import { InfinitePlane as z } from "./InfinitePlane.js";
|
|
23
23
|
import { Input as H } from "./Input.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import { TrackOutsideClicks as Vo } from "./TrackOutsideClicks.js";
|
|
48
|
-
import { VirtualList as qo } from "./VirtualList.js";
|
|
24
|
+
import { KeyListener as W } from "./KeyListener.js";
|
|
25
|
+
import { Knob as Y } from "./Knob.js";
|
|
26
|
+
import { LabeledControls as _ } from "./LabeledControls.js";
|
|
27
|
+
import { LabeledList as oo } from "./LabeledList.js";
|
|
28
|
+
import { MenuBar as eo } from "./MenuBar.js";
|
|
29
|
+
import { Modal as mo } from "./Modal.js";
|
|
30
|
+
import { NoticeBox as xo } from "./NoticeBox.js";
|
|
31
|
+
import { NumberInput as io } from "./NumberInput.js";
|
|
32
|
+
import { Popper as lo } from "./Popper.js";
|
|
33
|
+
import { ProgressBar as uo } from "./ProgressBar.js";
|
|
34
|
+
import { RestrictedInput as co } from "./RestrictedInput.js";
|
|
35
|
+
import { RoundGauge as Bo } from "./RoundGauge.js";
|
|
36
|
+
import { Section as go } from "./Section.js";
|
|
37
|
+
import { Slider as To } from "./Slider.js";
|
|
38
|
+
import { Stack as ko } from "./Stack.js";
|
|
39
|
+
import { StyleableSection as So } from "./StyleableSection.js";
|
|
40
|
+
import { Table as Ao } from "./Table.js";
|
|
41
|
+
import { Tabs as Po } from "./Tabs.js";
|
|
42
|
+
import { TextArea as Ko } from "./TextArea.js";
|
|
43
|
+
import { TimeDisplay as Ro } from "./TimeDisplay.js";
|
|
44
|
+
import { Tooltip as vo } from "./Tooltip.js";
|
|
45
|
+
import { TrackOutsideClicks as Go } from "./TrackOutsideClicks.js";
|
|
46
|
+
import { VirtualList as Qo } from "./VirtualList.js";
|
|
49
47
|
export {
|
|
50
48
|
e as AnimatedNumber,
|
|
51
49
|
m as Autofocus,
|
|
52
50
|
x as Blink,
|
|
53
51
|
i as BlockQuote,
|
|
54
|
-
|
|
52
|
+
l as Box,
|
|
55
53
|
u as Button,
|
|
56
54
|
c as ByondUi,
|
|
57
55
|
b as Chart,
|
|
@@ -60,39 +58,37 @@ export {
|
|
|
60
58
|
C as Dialog,
|
|
61
59
|
L as Dimmer,
|
|
62
60
|
y as Divider,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
N as DmIcon,
|
|
62
|
+
F as DraggableControl,
|
|
63
|
+
M as Dropdown,
|
|
64
|
+
h as FitText,
|
|
67
65
|
w as Flex,
|
|
68
66
|
O as Icon,
|
|
69
67
|
U as Image,
|
|
70
68
|
j as ImageButton,
|
|
71
69
|
z as InfinitePlane,
|
|
72
70
|
H as Input,
|
|
73
|
-
W as
|
|
74
|
-
Y as
|
|
75
|
-
_ as
|
|
76
|
-
oo as
|
|
77
|
-
eo as
|
|
78
|
-
mo as
|
|
79
|
-
xo as
|
|
80
|
-
io as
|
|
81
|
-
|
|
82
|
-
uo as
|
|
83
|
-
co as
|
|
84
|
-
Bo as
|
|
85
|
-
go as
|
|
86
|
-
To as
|
|
87
|
-
ko as
|
|
88
|
-
So as
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Go as
|
|
95
|
-
Qo as
|
|
96
|
-
Vo as TrackOutsideClicks,
|
|
97
|
-
qo as VirtualList
|
|
71
|
+
W as KeyListener,
|
|
72
|
+
Y as Knob,
|
|
73
|
+
_ as LabeledControls,
|
|
74
|
+
oo as LabeledList,
|
|
75
|
+
eo as MenuBar,
|
|
76
|
+
mo as Modal,
|
|
77
|
+
xo as NoticeBox,
|
|
78
|
+
io as NumberInput,
|
|
79
|
+
lo as Popper,
|
|
80
|
+
uo as ProgressBar,
|
|
81
|
+
co as RestrictedInput,
|
|
82
|
+
Bo as RoundGauge,
|
|
83
|
+
go as Section,
|
|
84
|
+
To as Slider,
|
|
85
|
+
ko as Stack,
|
|
86
|
+
So as StyleableSection,
|
|
87
|
+
Ao as Table,
|
|
88
|
+
Po as Tabs,
|
|
89
|
+
Ko as TextArea,
|
|
90
|
+
Ro as TimeDisplay,
|
|
91
|
+
vo as Tooltip,
|
|
92
|
+
Go as TrackOutsideClicks,
|
|
93
|
+
Qo as VirtualList
|
|
98
94
|
};
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { default as React, Component, KeyboardEvent, MouseEvent, RefObject } from 'react';
|
|
2
|
-
export interface Interaction {
|
|
3
|
-
left: number;
|
|
4
|
-
top: number;
|
|
5
|
-
}
|
|
6
|
-
export interface InteractiveProps {
|
|
7
|
-
onMove: (interaction: Interaction) => void;
|
|
8
|
-
onKey: (offset: Interaction) => void;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
style?: React.CSSProperties;
|
|
11
|
-
}
|
|
12
|
-
export declare class Interactive extends Component<InteractiveProps> {
|
|
13
|
-
containerRef: RefObject<HTMLDivElement>;
|
|
14
|
-
constructor(props: InteractiveProps);
|
|
15
|
-
handleMoveStart: (event: MouseEvent) => void;
|
|
16
|
-
handleMove: (event: MouseEvent) => void;
|
|
17
|
-
handleMoveEnd: () => void;
|
|
18
|
-
handleKeyDown: (event: KeyboardEvent) => void;
|
|
19
|
-
toggleDocumentEvents: (state: boolean) => void;
|
|
20
|
-
componentDidMount(): void;
|
|
21
|
-
componentWillUnmount(): void;
|
|
22
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var h = Object.defineProperty;
|
|
2
|
-
var u = (t, n, e) => n in t ? h(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
-
var s = (t, n, e) => u(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
5
|
-
import { Component as f, createRef as g } from "react";
|
|
6
|
-
import { clamp as l } from "../common/math.js";
|
|
7
|
-
const i = (t) => {
|
|
8
|
-
var n;
|
|
9
|
-
return ((n = t == null ? void 0 : t.ownerDocument) == null ? void 0 : n.defaultView) || self;
|
|
10
|
-
}, a = (t, n) => {
|
|
11
|
-
const e = t.getBoundingClientRect();
|
|
12
|
-
return {
|
|
13
|
-
left: l(
|
|
14
|
-
(n.pageX - (e.left + i(t).pageXOffset)) / e.width,
|
|
15
|
-
0,
|
|
16
|
-
1
|
|
17
|
-
),
|
|
18
|
-
top: l(
|
|
19
|
-
(n.pageY - (e.top + i(t).pageYOffset)) / e.height,
|
|
20
|
-
0,
|
|
21
|
-
1
|
|
22
|
-
)
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
class w extends f {
|
|
26
|
-
constructor(e) {
|
|
27
|
-
super(e);
|
|
28
|
-
s(this, "containerRef");
|
|
29
|
-
s(this, "handleMoveStart", (e) => {
|
|
30
|
-
const o = this.containerRef.current;
|
|
31
|
-
o && (e.preventDefault(), o.focus(), this.props.onMove(a(o, e)), this.toggleDocumentEvents(!0));
|
|
32
|
-
});
|
|
33
|
-
s(this, "handleMove", (e) => {
|
|
34
|
-
e.preventDefault(), e.buttons > 0 && this.containerRef.current ? this.props.onMove(a(this.containerRef.current, e)) : this.toggleDocumentEvents(!1);
|
|
35
|
-
});
|
|
36
|
-
s(this, "handleMoveEnd", () => {
|
|
37
|
-
this.toggleDocumentEvents(!1);
|
|
38
|
-
});
|
|
39
|
-
s(this, "handleKeyDown", (e) => {
|
|
40
|
-
const o = e.which || e.keyCode;
|
|
41
|
-
o < 37 || o > 40 || (e.preventDefault(), this.props.onKey({
|
|
42
|
-
left: o === 39 ? 0.05 : o === 37 ? -0.05 : 0,
|
|
43
|
-
top: o === 40 ? 0.05 : o === 38 ? -0.05 : 0
|
|
44
|
-
}));
|
|
45
|
-
});
|
|
46
|
-
s(this, "toggleDocumentEvents", (e) => {
|
|
47
|
-
const o = this.containerRef.current, r = i(o), c = e ? r.addEventListener.bind(r) : r.removeEventListener.bind(r);
|
|
48
|
-
c("mousemove", this.handleMove), c("mouseup", this.handleMoveEnd);
|
|
49
|
-
});
|
|
50
|
-
this.containerRef = g();
|
|
51
|
-
}
|
|
52
|
-
componentDidMount() {
|
|
53
|
-
this.toggleDocumentEvents(!0);
|
|
54
|
-
}
|
|
55
|
-
componentWillUnmount() {
|
|
56
|
-
this.toggleDocumentEvents(!1);
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
return /* @__PURE__ */ p(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
...this.props,
|
|
63
|
-
style: this.props.style,
|
|
64
|
-
ref: this.containerRef,
|
|
65
|
-
onMouseDown: this.handleMoveStart,
|
|
66
|
-
className: "react-colorful__interactive",
|
|
67
|
-
onKeyDown: this.handleKeyDown,
|
|
68
|
-
children: this.props.children
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
w as Interactive
|
|
75
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { classes as a } from "../common/react.js";
|
|
3
|
-
const m = ({
|
|
4
|
-
className: r,
|
|
5
|
-
color: e,
|
|
6
|
-
left: t,
|
|
7
|
-
top: l = 0.5
|
|
8
|
-
}) => {
|
|
9
|
-
const s = a(["react-colorful__pointer", r]), c = {
|
|
10
|
-
top: `${l * 100}%`,
|
|
11
|
-
left: `${t * 100}%`
|
|
12
|
-
};
|
|
13
|
-
return /* @__PURE__ */ o("div", { className: s, style: c, children: /* @__PURE__ */ o(
|
|
14
|
-
"div",
|
|
15
|
-
{
|
|
16
|
-
className: "react-colorful__pointer-fill",
|
|
17
|
-
style: { backgroundColor: e }
|
|
18
|
-
}
|
|
19
|
-
) });
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
m as Pointer
|
|
23
|
-
};
|