tgui-core 1.0.13 → 1.0.15
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 +30 -30
- package/dist/{ProgressBar.module-Jzqlebbx.js → ProgressBar.module-BkAFfFy0.js} +4 -4
- package/dist/Section.module-CLVHJ4yA.js +15 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/NumberInput.css +1 -1
- package/dist/assets/Section.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/TextArea.css +1 -1
- package/dist/assets/Tooltip.css +1 -0
- package/dist/components/Button.js +97 -97
- package/dist/components/Input.js +28 -28
- package/dist/components/NumberInput.js +24 -24
- package/dist/components/ProgressBar.js +15 -15
- package/dist/components/Section.d.ts +1 -1
- package/dist/components/Section.js +35 -45
- package/dist/components/Slider.js +24 -24
- package/dist/components/Stack.js +35 -35
- package/dist/components/StyleableSection.d.ts +1 -1
- package/dist/components/StyleableSection.js +14 -10
- package/dist/components/Tabs.js +49 -51
- package/dist/components/TextArea.d.ts +1 -1
- package/dist/components/TextArea.js +14 -14
- package/dist/components/Tooltip.js +10 -8
- package/package.json +1 -1
package/dist/components/Tabs.js
CHANGED
|
@@ -1,61 +1,59 @@
|
|
|
1
1
|
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
|
-
import { classes as
|
|
3
|
-
import { computeBoxClassName as b, computeBoxProps as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../assets/Tabs.css';const
|
|
6
|
-
tabs:
|
|
7
|
-
fill:
|
|
8
|
-
section: p,
|
|
9
|
-
"section--fitted": "_section--fitted_3dx9a_28",
|
|
2
|
+
import { classes as h, canRender as i } from "../common/react.js";
|
|
3
|
+
import { computeBoxClassName as b, computeBoxProps as d } from "./Box.js";
|
|
4
|
+
import { Icon as m } from "./Icon.js";
|
|
5
|
+
import '../assets/Tabs.css';const v = "_tabs_9h380_13", p = "_fill_9h380_20", u = "_vertical_9h380_35", w = "_horizontal_9h380_40", x = "_tabs__tab_9h380_48", y = "_fluid_9h380_52", N = "_tab_9h380_13", k = "_selected_9h380_66", z = "_tab__text_9h380_75", T = "_tab__left_9h380_80", j = "_tab__right_9h380_86", B = "_color__black_9h380_113", S = "_color__white_9h380_125", C = "_color__red_9h380_137", I = "_color__orange_9h380_149", P = "_color__yellow_9h380_161", R = "_color__olive_9h380_173", q = "_color__green_9h380_185", A = "_color__teal_9h380_197", D = "_color__blue_9h380_209", E = "_color__violet_9h380_221", F = "_color__purple_9h380_233", G = "_color__pink_9h380_245", H = "_color__brown_9h380_257", J = "_color__grey_9h380_269", K = "_color__good_9h380_293", L = "_color__average_9h380_305", M = "_color__bad_9h380_317", O = "_color__label_9h380_329", _ = {
|
|
6
|
+
tabs: v,
|
|
7
|
+
fill: p,
|
|
10
8
|
vertical: u,
|
|
11
9
|
horizontal: w,
|
|
12
|
-
tabs__tab:
|
|
13
|
-
fluid:
|
|
14
|
-
tab:
|
|
15
|
-
selected:
|
|
16
|
-
tab__text:
|
|
17
|
-
tab__left:
|
|
18
|
-
tab__right:
|
|
19
|
-
color__black:
|
|
20
|
-
color__white:
|
|
21
|
-
color__red:
|
|
22
|
-
color__orange:
|
|
23
|
-
color__yellow:
|
|
24
|
-
color__olive:
|
|
25
|
-
color__green:
|
|
26
|
-
color__teal:
|
|
27
|
-
color__blue:
|
|
28
|
-
color__violet:
|
|
29
|
-
color__purple:
|
|
30
|
-
color__pink:
|
|
31
|
-
color__brown:
|
|
32
|
-
color__grey:
|
|
33
|
-
"color__light-grey": "_color__light-
|
|
34
|
-
color__good:
|
|
35
|
-
color__average:
|
|
36
|
-
color__bad:
|
|
37
|
-
color__label:
|
|
38
|
-
},
|
|
39
|
-
const { className:
|
|
10
|
+
tabs__tab: x,
|
|
11
|
+
fluid: y,
|
|
12
|
+
tab: N,
|
|
13
|
+
selected: k,
|
|
14
|
+
tab__text: z,
|
|
15
|
+
tab__left: T,
|
|
16
|
+
tab__right: j,
|
|
17
|
+
color__black: B,
|
|
18
|
+
color__white: S,
|
|
19
|
+
color__red: C,
|
|
20
|
+
color__orange: I,
|
|
21
|
+
color__yellow: P,
|
|
22
|
+
color__olive: R,
|
|
23
|
+
color__green: q,
|
|
24
|
+
color__teal: A,
|
|
25
|
+
color__blue: D,
|
|
26
|
+
color__violet: E,
|
|
27
|
+
color__purple: F,
|
|
28
|
+
color__pink: G,
|
|
29
|
+
color__brown: H,
|
|
30
|
+
color__grey: J,
|
|
31
|
+
"color__light-grey": "_color__light-grey_9h380_281",
|
|
32
|
+
color__good: K,
|
|
33
|
+
color__average: L,
|
|
34
|
+
color__bad: M,
|
|
35
|
+
color__label: O
|
|
36
|
+
}, Q = (r) => {
|
|
37
|
+
const { className: e, vertical: a, fill: s, fluid: c, children: t, ...l } = r;
|
|
40
38
|
return /* @__PURE__ */ o(
|
|
41
39
|
"div",
|
|
42
40
|
{
|
|
43
|
-
className:
|
|
41
|
+
className: h([
|
|
44
42
|
_.tabs,
|
|
45
|
-
|
|
43
|
+
a ? _.vertical : _.horizontal,
|
|
46
44
|
s && _.fill,
|
|
47
45
|
c && _.fluid,
|
|
48
|
-
|
|
46
|
+
e,
|
|
49
47
|
b(l)
|
|
50
48
|
]),
|
|
51
|
-
...
|
|
49
|
+
...d(l),
|
|
52
50
|
children: t
|
|
53
51
|
}
|
|
54
52
|
);
|
|
55
|
-
},
|
|
53
|
+
}, U = (r) => {
|
|
56
54
|
const {
|
|
57
|
-
className:
|
|
58
|
-
selected:
|
|
55
|
+
className: e,
|
|
56
|
+
selected: a,
|
|
59
57
|
color: s,
|
|
60
58
|
icon: c,
|
|
61
59
|
leftSlot: t,
|
|
@@ -66,24 +64,24 @@ import '../assets/Tabs.css';const m = "_tabs_3dx9a_13", v = "_fill_3dx9a_20", p
|
|
|
66
64
|
return /* @__PURE__ */ f(
|
|
67
65
|
"div",
|
|
68
66
|
{
|
|
69
|
-
className:
|
|
67
|
+
className: h([
|
|
70
68
|
_.tab,
|
|
71
69
|
_.tabs__tab,
|
|
72
70
|
_["color__" + s],
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
a && _.selected,
|
|
72
|
+
e,
|
|
75
73
|
b(n)
|
|
76
74
|
]),
|
|
77
|
-
...
|
|
75
|
+
...d(n),
|
|
78
76
|
children: [
|
|
79
|
-
|
|
77
|
+
i(t) && /* @__PURE__ */ o("div", { className: _.tab__left, children: t }) || !!c && /* @__PURE__ */ o("div", { className: _.tab__left, children: /* @__PURE__ */ o(m, { name: c }) }),
|
|
80
78
|
/* @__PURE__ */ o("div", { className: _.tab__text, children: g }),
|
|
81
|
-
|
|
79
|
+
i(l) && /* @__PURE__ */ o("div", { className: _.tab__right, children: l })
|
|
82
80
|
]
|
|
83
81
|
}
|
|
84
82
|
);
|
|
85
83
|
};
|
|
86
|
-
|
|
84
|
+
Q.Tab = U;
|
|
87
85
|
export {
|
|
88
|
-
|
|
86
|
+
Q as Tabs
|
|
89
87
|
};
|
|
@@ -32,7 +32,7 @@ export declare const TextArea: import('react').ForwardRefExoticComponent<Partial
|
|
|
32
32
|
onKeyDown: import('react').KeyboardEventHandler<HTMLDivElement>;
|
|
33
33
|
onKeyUp: import('react').KeyboardEventHandler<HTMLDivElement>;
|
|
34
34
|
onMouseDown: import('react').MouseEventHandler<HTMLDivElement>;
|
|
35
|
-
onMouseMove: import('react').MouseEventHandler<HTMLDivElement>;
|
|
35
|
+
onMouseMove: import('react').MouseEventHandler<HTMLDivElement>;
|
|
36
36
|
onMouseOver: import('react').MouseEventHandler<HTMLDivElement>;
|
|
37
37
|
onMouseUp: import('react').MouseEventHandler<HTMLDivElement>;
|
|
38
38
|
onScroll: import('react').UIEventHandler<HTMLDivElement>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as I, jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { KEY as p } from "../common/keys.js";
|
|
3
3
|
import { classes as d } from "../common/react.js";
|
|
4
|
-
import { forwardRef as Y, useRef as C, useState as H, useImperativeHandle as L, useEffect as
|
|
4
|
+
import { forwardRef as Y, useRef as C, useState as H, useImperativeHandle as L, useEffect as g } from "react";
|
|
5
5
|
import { Box as P } from "./Box.js";
|
|
6
|
-
import { toInputValue as
|
|
7
|
-
import '../assets/TextArea.css';const U = "
|
|
6
|
+
import { toInputValue as T } from "./Input.js";
|
|
7
|
+
import '../assets/TextArea.css';const U = "_textArea_1bert_20", $ = "_fluid_1bert_33", q = "_noborder_1bert_39", z = "_inner_1bert_43", G = "_scrollable_1bert_43", J = "_custom_1bert_78", M = "_nowrap_1bert_83", O = "_wrapper_1bert_89", e = {
|
|
8
8
|
textArea: U,
|
|
9
9
|
fluid: $,
|
|
10
10
|
noborder: q,
|
|
@@ -14,7 +14,7 @@ import '../assets/TextArea.css';const U = "_textArea_20wp8_13", $ = "_fluid_20wp
|
|
|
14
14
|
nowrap: M,
|
|
15
15
|
wrapper: O
|
|
16
16
|
}, er = Y(
|
|
17
|
-
(
|
|
17
|
+
(x, w) => {
|
|
18
18
|
const {
|
|
19
19
|
autoFocus: m,
|
|
20
20
|
autoSelect: s,
|
|
@@ -28,43 +28,43 @@ import '../assets/TextArea.css';const U = "_textArea_20wp8_13", $ = "_fluid_20wp
|
|
|
28
28
|
onInput: c,
|
|
29
29
|
placeholder: N,
|
|
30
30
|
scrollbar: S,
|
|
31
|
-
selfClear:
|
|
31
|
+
selfClear: b,
|
|
32
32
|
value: i,
|
|
33
33
|
...E
|
|
34
|
-
} =
|
|
34
|
+
} = x, { className: K, fluid: k, nowrap: D, ...R } = E, t = C(null), [V, j] = H(0), B = (r) => {
|
|
35
35
|
if (r.key === p.Enter) {
|
|
36
36
|
if (r.shiftKey) {
|
|
37
37
|
r.currentTarget.focus();
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
n == null || n(r, r.currentTarget.value),
|
|
40
|
+
n == null || n(r, r.currentTarget.value), b && (r.currentTarget.value = ""), r.currentTarget.blur();
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
if (r.key === p.Escape) {
|
|
44
|
-
u == null || u(r),
|
|
44
|
+
u == null || u(r), b ? r.currentTarget.value = "" : (r.currentTarget.value = T(i), r.currentTarget.blur());
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
if (!y && r.key === p.Tab) {
|
|
48
48
|
r.preventDefault();
|
|
49
|
-
const { value: o, selectionStart:
|
|
50
|
-
r.currentTarget.value = o.substring(0,
|
|
49
|
+
const { value: o, selectionStart: _, selectionEnd: F } = r.currentTarget;
|
|
50
|
+
r.currentTarget.value = o.substring(0, _) + " " + o.substring(F), r.currentTarget.selectionEnd = _ + 1;
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
return L(
|
|
54
|
-
|
|
54
|
+
w,
|
|
55
55
|
() => t.current
|
|
56
|
-
),
|
|
56
|
+
), g(() => {
|
|
57
57
|
if (!m && !s)
|
|
58
58
|
return;
|
|
59
59
|
const r = t.current;
|
|
60
60
|
r && (m || s) && setTimeout(() => {
|
|
61
61
|
r.focus(), s && r.select();
|
|
62
62
|
}, 1);
|
|
63
|
-
}, []),
|
|
63
|
+
}, []), g(() => {
|
|
64
64
|
const r = t.current;
|
|
65
65
|
if (!r)
|
|
66
66
|
return;
|
|
67
|
-
const o =
|
|
67
|
+
const o = T(i);
|
|
68
68
|
r.value !== o && (r.value = o);
|
|
69
69
|
}, [i]), /* @__PURE__ */ I(
|
|
70
70
|
P,
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
var s = Object.defineProperty;
|
|
2
|
-
var p = (
|
|
3
|
-
var
|
|
1
|
+
import '../assets/Tooltip.css';var s = Object.defineProperty;
|
|
2
|
+
var p = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var r = (o, e, t) => (p(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
4
|
import { jsx as l } from "react/jsx-runtime";
|
|
5
5
|
import { Component as c } from "react";
|
|
6
6
|
import { findDOMNode as m, render as a } from "react-dom";
|
|
7
7
|
import { c as u } from "../popper-Dm3m9eeZ.js";
|
|
8
|
-
const
|
|
8
|
+
const h = "_tooltip_1pib4_13", f = {
|
|
9
|
+
tooltip: h
|
|
10
|
+
}, i = {
|
|
9
11
|
modifiers: [
|
|
10
12
|
{
|
|
11
13
|
name: "eventListeners",
|
|
12
14
|
enabled: !1
|
|
13
15
|
}
|
|
14
16
|
]
|
|
15
|
-
},
|
|
17
|
+
}, v = {
|
|
16
18
|
width: 0,
|
|
17
19
|
height: 0,
|
|
18
20
|
top: 0,
|
|
@@ -30,7 +32,7 @@ const i = {
|
|
|
30
32
|
const e = this.getDOMNode();
|
|
31
33
|
e && (e.addEventListener("mouseenter", () => {
|
|
32
34
|
let t = n.renderedTooltip;
|
|
33
|
-
t === void 0 && (t = document.createElement("div"), t.className =
|
|
35
|
+
t === void 0 && (t = document.createElement("div"), t.className = f.tooltip, document.body.appendChild(t), n.renderedTooltip = t), n.currentHoveredElement = e, t.style.opacity = "1", this.renderPopperContent();
|
|
34
36
|
}), e.addEventListener("mouseleave", () => {
|
|
35
37
|
this.fadeOut();
|
|
36
38
|
}));
|
|
@@ -69,10 +71,10 @@ const i = {
|
|
|
69
71
|
// Thus, instead of using the Popper component, Tooltip creates ONE popper
|
|
70
72
|
// and stores every tooltip inside that.
|
|
71
73
|
// This means you can never have two tooltips at once, for instance.
|
|
72
|
-
|
|
74
|
+
r(n, "renderedTooltip"), r(n, "singletonPopper"), r(n, "currentHoveredElement"), r(n, "virtualElement", {
|
|
73
75
|
getBoundingClientRect: () => {
|
|
74
76
|
var e;
|
|
75
|
-
return ((e = n.currentHoveredElement) == null ? void 0 : e.getBoundingClientRect()) ??
|
|
77
|
+
return ((e = n.currentHoveredElement) == null ? void 0 : e.getBoundingClientRect()) ?? v;
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
80
|
let d = n;
|