tgui-core 1.2.0 → 1.3.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 +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 +0 -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 +57 -49
- 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 +0 -1
- package/dist/components/ImageButton.js +87 -170
- 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 +99 -107
- 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 +0 -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 +0 -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/package.json +25 -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/ImageButton.css +0 -5
- 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
package/dist/components/Stack.js
CHANGED
|
@@ -1,67 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { classes as
|
|
3
|
-
import { computeBoxClassName as
|
|
4
|
-
import { computeFlexClassName as
|
|
5
|
-
|
|
6
|
-
fill:
|
|
7
|
-
|
|
8
|
-
item: z,
|
|
9
|
-
vertical: x,
|
|
10
|
-
reverse: N,
|
|
11
|
-
reverse__vertical: b,
|
|
12
|
-
zebra: S,
|
|
13
|
-
divider: k,
|
|
14
|
-
divider__hidden: F
|
|
15
|
-
};
|
|
16
|
-
function a(t) {
|
|
17
|
-
const { className: s, vertical: r, fill: i, reverse: c, zebra: d, ...v } = t, m = r ? "column" : "row", u = c ? "-reverse" : "";
|
|
18
|
-
return /* @__PURE__ */ l(
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { classes as a } from "../common/react.js";
|
|
3
|
+
import { computeBoxClassName as o } from "./Box.js";
|
|
4
|
+
import { computeFlexClassName as k, computeFlexProps as v, computeFlexItemProps as m } from "./Flex.js";
|
|
5
|
+
function n(r) {
|
|
6
|
+
const { className: c, vertical: e, fill: t, reverse: s, zebra: l, ...d } = r, f = e ? "column" : "row", S = s ? "-reverse" : "";
|
|
7
|
+
return /* @__PURE__ */ i(
|
|
19
8
|
"div",
|
|
20
9
|
{
|
|
21
|
-
className:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
s
|
|
27
|
-
|
|
10
|
+
className: a([
|
|
11
|
+
"Stack",
|
|
12
|
+
t && "Stack--fill",
|
|
13
|
+
e ? "Stack--vertical" : "Stack--horizontal",
|
|
14
|
+
l && "Stack--zebra",
|
|
15
|
+
s && `Stack--reverse${e ? "--vertical" : ""}`,
|
|
16
|
+
c,
|
|
17
|
+
k(r)
|
|
28
18
|
]),
|
|
29
|
-
...
|
|
30
|
-
direction: `${
|
|
31
|
-
...
|
|
19
|
+
...v({
|
|
20
|
+
direction: `${f}${S}`,
|
|
21
|
+
...d
|
|
32
22
|
})
|
|
33
23
|
}
|
|
34
24
|
);
|
|
35
25
|
}
|
|
36
|
-
function
|
|
37
|
-
const { className:
|
|
38
|
-
return /* @__PURE__ */
|
|
26
|
+
function u(r) {
|
|
27
|
+
const { className: c, innerRef: e, ...t } = r;
|
|
28
|
+
return /* @__PURE__ */ i(
|
|
39
29
|
"div",
|
|
40
30
|
{
|
|
41
|
-
className:
|
|
42
|
-
ref:
|
|
43
|
-
...
|
|
31
|
+
className: a(["Stack__item", c, o(t)]),
|
|
32
|
+
ref: e,
|
|
33
|
+
...m(t)
|
|
44
34
|
}
|
|
45
35
|
);
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
const { className:
|
|
50
|
-
return /* @__PURE__ */
|
|
37
|
+
n.Item = u;
|
|
38
|
+
function p(r) {
|
|
39
|
+
const { className: c, hidden: e, ...t } = r;
|
|
40
|
+
return /* @__PURE__ */ i(
|
|
51
41
|
"div",
|
|
52
42
|
{
|
|
53
|
-
className:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
className: a([
|
|
44
|
+
"Stack__item",
|
|
45
|
+
"Stack__divider",
|
|
46
|
+
e && "Stack__divider--hidden",
|
|
47
|
+
c,
|
|
48
|
+
o(t)
|
|
59
49
|
]),
|
|
60
|
-
...
|
|
50
|
+
...m(t)
|
|
61
51
|
}
|
|
62
52
|
);
|
|
63
53
|
}
|
|
64
|
-
|
|
54
|
+
n.Divider = p;
|
|
65
55
|
export {
|
|
66
|
-
|
|
56
|
+
n as Stack
|
|
67
57
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Box as t } from "./Box.js";
|
|
3
|
+
function m(i) {
|
|
4
|
+
const { children: c, titleStyle: n, titleSubtext: s, title: o, textStyle: r, style: a } = i;
|
|
5
|
+
return /* @__PURE__ */ l(t, { style: a, children: [
|
|
6
|
+
/* @__PURE__ */ l(t, { className: "Section__title", style: n, children: [
|
|
7
|
+
/* @__PURE__ */ e(t, { className: "Section__titleText", style: r, children: o }),
|
|
8
|
+
/* @__PURE__ */ e("div", { className: "Section__buttons", children: s }),
|
|
9
|
+
" "
|
|
10
10
|
] }),
|
|
11
|
-
/* @__PURE__ */
|
|
11
|
+
/* @__PURE__ */ e(t, { className: "Section__rest", children: /* @__PURE__ */ e(t, { className: "Section__content", children: c }) })
|
|
12
12
|
] });
|
|
13
13
|
}
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
m as StyleableSection
|
|
16
16
|
};
|
package/dist/components/Table.js
CHANGED
|
@@ -1,67 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { classes as
|
|
3
|
-
import { computeBoxClassName as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
row: p,
|
|
8
|
-
cell: g,
|
|
9
|
-
row__header: w,
|
|
10
|
-
cell__header: b,
|
|
11
|
-
cell__collapsing: u
|
|
12
|
-
};
|
|
13
|
-
function h(l) {
|
|
14
|
-
const { className: c, collapsing: o, children: _, ...a } = l;
|
|
15
|
-
return /* @__PURE__ */ s(
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { classes as r } from "../common/react.js";
|
|
3
|
+
import { computeBoxClassName as t, computeBoxProps as n } from "./Box.js";
|
|
4
|
+
function m(e) {
|
|
5
|
+
const { className: l, collapsing: a, children: s, ...o } = e;
|
|
6
|
+
return /* @__PURE__ */ c(
|
|
16
7
|
"table",
|
|
17
8
|
{
|
|
18
|
-
className:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
className: r([
|
|
10
|
+
"Table",
|
|
11
|
+
a && "Table--collapsing",
|
|
12
|
+
l,
|
|
13
|
+
t(o)
|
|
23
14
|
]),
|
|
24
|
-
...
|
|
25
|
-
children: /* @__PURE__ */
|
|
15
|
+
...n(o),
|
|
16
|
+
children: /* @__PURE__ */ c("tbody", { children: s })
|
|
26
17
|
}
|
|
27
18
|
);
|
|
28
19
|
}
|
|
29
|
-
function
|
|
30
|
-
const { className:
|
|
31
|
-
return /* @__PURE__ */
|
|
20
|
+
function i(e) {
|
|
21
|
+
const { className: l, header: a, ...s } = e;
|
|
22
|
+
return /* @__PURE__ */ c(
|
|
32
23
|
"tr",
|
|
33
24
|
{
|
|
34
|
-
className:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
className: r([
|
|
26
|
+
"Table__row",
|
|
27
|
+
a && "Table__row--header",
|
|
28
|
+
l,
|
|
29
|
+
t(e)
|
|
39
30
|
]),
|
|
40
|
-
...
|
|
31
|
+
...n(s)
|
|
41
32
|
}
|
|
42
33
|
);
|
|
43
34
|
}
|
|
44
|
-
|
|
45
|
-
function
|
|
46
|
-
const { className:
|
|
47
|
-
return /* @__PURE__ */
|
|
35
|
+
m.Row = i;
|
|
36
|
+
function T(e) {
|
|
37
|
+
const { className: l, collapsing: a, colSpan: s, header: o, ...b } = e;
|
|
38
|
+
return /* @__PURE__ */ c(
|
|
48
39
|
"td",
|
|
49
40
|
{
|
|
50
|
-
className:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
className: r([
|
|
42
|
+
"Table__cell",
|
|
43
|
+
a && "Table__cell--collapsing",
|
|
44
|
+
o && "Table__cell--header",
|
|
45
|
+
l,
|
|
46
|
+
t(e)
|
|
56
47
|
]),
|
|
57
|
-
colSpan:
|
|
58
|
-
...
|
|
48
|
+
colSpan: s,
|
|
49
|
+
...n(b)
|
|
59
50
|
}
|
|
60
51
|
);
|
|
61
52
|
}
|
|
62
|
-
|
|
53
|
+
m.Cell = T;
|
|
63
54
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
m as Table,
|
|
56
|
+
T as TableCell,
|
|
57
|
+
i as TableRow
|
|
67
58
|
};
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,94 +1,62 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { classes as
|
|
3
|
-
import { computeBoxClassName as f, computeBoxProps as
|
|
4
|
-
import { Icon as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
vertical: y,
|
|
9
|
-
horizontal: N,
|
|
10
|
-
tabs__tab: z,
|
|
11
|
-
fluid: C,
|
|
12
|
-
tab: S,
|
|
13
|
-
selected: T,
|
|
14
|
-
tab__text: j,
|
|
15
|
-
tab__left: B,
|
|
16
|
-
tab__right: I,
|
|
17
|
-
color__black: P,
|
|
18
|
-
color__white: R,
|
|
19
|
-
color__red: q,
|
|
20
|
-
color__orange: A,
|
|
21
|
-
color__yellow: D,
|
|
22
|
-
color__olive: E,
|
|
23
|
-
color__green: F,
|
|
24
|
-
color__teal: G,
|
|
25
|
-
color__blue: H,
|
|
26
|
-
color__violet: J,
|
|
27
|
-
color__purple: K,
|
|
28
|
-
color__pink: L,
|
|
29
|
-
color__brown: M,
|
|
30
|
-
color__grey: O,
|
|
31
|
-
"color__light-grey": "_color__light-grey_9h380_281",
|
|
32
|
-
color__good: Q,
|
|
33
|
-
color__average: U,
|
|
34
|
-
color__bad: V,
|
|
35
|
-
color__label: W
|
|
36
|
-
};
|
|
37
|
-
function X(t) {
|
|
38
|
-
const { className: r, vertical: e, fill: a, fluid: c, children: s, ...l } = t;
|
|
39
|
-
return /* @__PURE__ */ o(
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { classes as T, canRender as d } from "../common/react.js";
|
|
3
|
+
import { computeBoxClassName as f, computeBoxProps as h } from "./Box.js";
|
|
4
|
+
import { Icon as N } from "./Icon.js";
|
|
5
|
+
function v(l) {
|
|
6
|
+
const { className: c, vertical: i, fill: o, fluid: e, children: r, ...s } = l;
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
40
8
|
"div",
|
|
41
9
|
{
|
|
42
|
-
className:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
f(
|
|
10
|
+
className: T([
|
|
11
|
+
"Tabs",
|
|
12
|
+
i ? "Tabs--vertical" : "Tabs--horizontal",
|
|
13
|
+
o && "Tabs--fill",
|
|
14
|
+
e && "Tabs--fluid",
|
|
15
|
+
c,
|
|
16
|
+
f(s)
|
|
49
17
|
]),
|
|
50
|
-
...
|
|
51
|
-
children:
|
|
18
|
+
...h(s),
|
|
19
|
+
children: r
|
|
52
20
|
}
|
|
53
21
|
);
|
|
54
22
|
}
|
|
55
|
-
function
|
|
23
|
+
function x(l) {
|
|
56
24
|
const {
|
|
57
|
-
className:
|
|
58
|
-
selected:
|
|
59
|
-
color:
|
|
60
|
-
icon:
|
|
61
|
-
iconSpin:
|
|
62
|
-
leftSlot:
|
|
63
|
-
rightSlot:
|
|
64
|
-
children:
|
|
65
|
-
onClick:
|
|
66
|
-
...
|
|
67
|
-
} =
|
|
68
|
-
|
|
25
|
+
className: c,
|
|
26
|
+
selected: i,
|
|
27
|
+
color: o,
|
|
28
|
+
icon: e,
|
|
29
|
+
iconSpin: r,
|
|
30
|
+
leftSlot: s,
|
|
31
|
+
rightSlot: t,
|
|
32
|
+
children: p,
|
|
33
|
+
onClick: n,
|
|
34
|
+
...m
|
|
35
|
+
} = l, _ = (b) => {
|
|
36
|
+
n && (n(b), b.target.blur());
|
|
69
37
|
};
|
|
70
38
|
return /* @__PURE__ */ u(
|
|
71
39
|
"div",
|
|
72
40
|
{
|
|
73
|
-
className:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
f(
|
|
41
|
+
className: T([
|
|
42
|
+
"Tab",
|
|
43
|
+
"Tabs__Tab",
|
|
44
|
+
`Tab--color--${o}`,
|
|
45
|
+
i && "Tab--selected",
|
|
46
|
+
c,
|
|
47
|
+
f(m)
|
|
80
48
|
]),
|
|
81
|
-
onClick:
|
|
82
|
-
...m
|
|
49
|
+
onClick: _,
|
|
50
|
+
...h(m),
|
|
83
51
|
children: [
|
|
84
|
-
d(
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
d(
|
|
52
|
+
d(s) && /* @__PURE__ */ a("div", { className: "Tab__left", children: s }) || !!e && /* @__PURE__ */ a("div", { className: "Tab__left", children: /* @__PURE__ */ a(N, { name: e, spin: r }) }),
|
|
53
|
+
/* @__PURE__ */ a("div", { className: "Tab__text", children: p }),
|
|
54
|
+
d(t) && /* @__PURE__ */ a("div", { className: "Tab__right", children: t })
|
|
87
55
|
]
|
|
88
56
|
}
|
|
89
57
|
);
|
|
90
58
|
}
|
|
91
|
-
|
|
59
|
+
v.Tab = x;
|
|
92
60
|
export {
|
|
93
|
-
|
|
61
|
+
v as Tabs
|
|
94
62
|
};
|
|
@@ -1,108 +1,113 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { KEY as
|
|
4
|
-
import { classes as
|
|
5
|
-
import { Box as
|
|
6
|
-
import { toInputValue as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
fluid: q,
|
|
10
|
-
noborder: z,
|
|
11
|
-
inner: G,
|
|
12
|
-
scrollable: J,
|
|
13
|
-
custom: M,
|
|
14
|
-
nowrap: O,
|
|
15
|
-
wrapper: Q
|
|
16
|
-
}, tr = Y(
|
|
17
|
-
(x, w) => {
|
|
1
|
+
import { jsxs as B, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as F, useRef as I, useState as Y, useImperativeHandle as C, useEffect as x } from "react";
|
|
3
|
+
import { KEY as p, isEscape as H } from "../common/keys.js";
|
|
4
|
+
import { classes as f } from "../common/react.js";
|
|
5
|
+
import { Box as L } from "./Box.js";
|
|
6
|
+
import { toInputValue as g } from "./Input.js";
|
|
7
|
+
const M = F(
|
|
8
|
+
(b, h) => {
|
|
18
9
|
const {
|
|
19
10
|
autoFocus: d,
|
|
20
|
-
autoSelect:
|
|
11
|
+
autoSelect: o,
|
|
21
12
|
displayedValue: a,
|
|
22
|
-
dontUseTabForIndent:
|
|
23
|
-
maxLength:
|
|
24
|
-
noborder:
|
|
13
|
+
dontUseTabForIndent: A,
|
|
14
|
+
maxLength: _,
|
|
15
|
+
noborder: y,
|
|
25
16
|
onChange: l,
|
|
26
|
-
onEnter:
|
|
27
|
-
onEscape:
|
|
17
|
+
onEnter: u,
|
|
18
|
+
onEscape: s,
|
|
28
19
|
onInput: c,
|
|
29
|
-
placeholder:
|
|
20
|
+
placeholder: w,
|
|
30
21
|
scrollbar: S,
|
|
31
22
|
selfClear: m,
|
|
32
|
-
value:
|
|
23
|
+
value: n,
|
|
33
24
|
...E
|
|
34
|
-
} =
|
|
35
|
-
function
|
|
36
|
-
if (r.key ===
|
|
25
|
+
} = b, { className: K, fluid: N, nowrap: k, ...D } = E, e = I(null), [R, V] = Y(0);
|
|
26
|
+
function $(r) {
|
|
27
|
+
if (r.key === p.Enter) {
|
|
37
28
|
if (r.shiftKey) {
|
|
38
29
|
r.currentTarget.focus();
|
|
39
30
|
return;
|
|
40
31
|
}
|
|
41
|
-
|
|
32
|
+
u == null || u(r, r.currentTarget.value), m && (r.currentTarget.value = ""), r.currentTarget.blur();
|
|
42
33
|
return;
|
|
43
34
|
}
|
|
44
|
-
if (
|
|
45
|
-
|
|
35
|
+
if (H(r.key)) {
|
|
36
|
+
s == null || s(r), m ? r.currentTarget.value = "" : (r.currentTarget.value = g(n), r.currentTarget.blur());
|
|
46
37
|
return;
|
|
47
38
|
}
|
|
48
|
-
if (!
|
|
39
|
+
if (!A && r.key === p.Tab) {
|
|
49
40
|
r.preventDefault();
|
|
50
|
-
const { value:
|
|
51
|
-
r.currentTarget.value =
|
|
41
|
+
const { value: t, selectionStart: T, selectionEnd: j } = r.currentTarget;
|
|
42
|
+
r.currentTarget.value = `${t.substring(0, T)} ${t.substring(j)}`, r.currentTarget.selectionEnd = T + 1;
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
() =>
|
|
57
|
-
),
|
|
58
|
-
if (!d && !
|
|
59
|
-
const r =
|
|
60
|
-
r && (d ||
|
|
61
|
-
r.focus(),
|
|
45
|
+
return C(
|
|
46
|
+
h,
|
|
47
|
+
() => e.current
|
|
48
|
+
), x(() => {
|
|
49
|
+
if (!d && !o) return;
|
|
50
|
+
const r = e.current;
|
|
51
|
+
r && (d || o) && setTimeout(() => {
|
|
52
|
+
r.focus(), o && r.select();
|
|
62
53
|
}, 1);
|
|
63
|
-
}, []),
|
|
64
|
-
const r =
|
|
54
|
+
}, []), x(() => {
|
|
55
|
+
const r = e.current;
|
|
65
56
|
if (!r) return;
|
|
66
|
-
const
|
|
67
|
-
r.value !==
|
|
68
|
-
}, [
|
|
69
|
-
|
|
57
|
+
const t = g(n);
|
|
58
|
+
r.value !== t && (r.value = t);
|
|
59
|
+
}, [n]), /* @__PURE__ */ B(
|
|
60
|
+
L,
|
|
70
61
|
{
|
|
71
|
-
className:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
className: f([
|
|
63
|
+
"TextArea",
|
|
64
|
+
N && "TextArea--fluid",
|
|
65
|
+
y && "TextArea--noborder",
|
|
75
66
|
K
|
|
76
67
|
]),
|
|
77
|
-
...
|
|
68
|
+
...D,
|
|
78
69
|
children: [
|
|
79
|
-
!!a && /* @__PURE__ */
|
|
70
|
+
!!a && /* @__PURE__ */ i(
|
|
80
71
|
"div",
|
|
81
72
|
{
|
|
82
|
-
className: p([e.inner, e.custom]),
|
|
83
73
|
style: {
|
|
84
|
-
|
|
74
|
+
height: "100%",
|
|
75
|
+
overflow: "hidden",
|
|
76
|
+
position: "absolute",
|
|
77
|
+
width: "100%"
|
|
85
78
|
},
|
|
86
|
-
children:
|
|
79
|
+
children: /* @__PURE__ */ i(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: f([
|
|
83
|
+
"TextArea__textarea",
|
|
84
|
+
"TextArea__textarea_custom"
|
|
85
|
+
]),
|
|
86
|
+
style: {
|
|
87
|
+
transform: `translateY(-${R}px)`
|
|
88
|
+
},
|
|
89
|
+
children: a
|
|
90
|
+
}
|
|
91
|
+
)
|
|
87
92
|
}
|
|
88
|
-
)
|
|
89
|
-
/* @__PURE__ */
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ i(
|
|
90
95
|
"textarea",
|
|
91
96
|
{
|
|
92
|
-
className:
|
|
93
|
-
|
|
94
|
-
S &&
|
|
95
|
-
|
|
97
|
+
className: f([
|
|
98
|
+
"TextArea__textarea",
|
|
99
|
+
S && "TextArea__textarea--scrollable",
|
|
100
|
+
k && "TextArea__nowrap"
|
|
96
101
|
]),
|
|
97
|
-
maxLength:
|
|
102
|
+
maxLength: _,
|
|
98
103
|
onBlur: (r) => l == null ? void 0 : l(r, r.target.value),
|
|
99
104
|
onChange: (r) => c == null ? void 0 : c(r, r.target.value),
|
|
100
|
-
onKeyDown:
|
|
105
|
+
onKeyDown: $,
|
|
101
106
|
onScroll: () => {
|
|
102
|
-
a &&
|
|
107
|
+
a && e.current && V(e.current.scrollTop);
|
|
103
108
|
},
|
|
104
|
-
placeholder:
|
|
105
|
-
ref:
|
|
109
|
+
placeholder: w,
|
|
110
|
+
ref: e,
|
|
106
111
|
style: {
|
|
107
112
|
color: a ? "rgba(0, 0, 0, 0)" : "inherit"
|
|
108
113
|
}
|
|
@@ -114,5 +119,5 @@ import '../assets/TextArea.css';const $ = "_textArea_1bert_20", q = "_fluid_1ber
|
|
|
114
119
|
}
|
|
115
120
|
);
|
|
116
121
|
export {
|
|
117
|
-
|
|
122
|
+
M as TextArea
|
|
118
123
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
/** Whether the TimeDisplay should automatically increment or decrement (plain prop to dec.) */
|
|
3
|
-
auto?: 'up' | 'down' | true;
|
|
4
|
-
/** An optional function to format the value */
|
|
5
|
-
format?: (value: number) => string;
|
|
1
|
+
type TimeDisplayProps = {
|
|
6
2
|
/** The value that the TimeDisplay needs to render - if you pass a wrong type it will be rendered directly */
|
|
7
3
|
value: number;
|
|
8
|
-
}
|
|
4
|
+
} & Partial<{
|
|
5
|
+
/** Whether the TimeDisplay should automatically increment or decrement (plain prop to dec.) */
|
|
6
|
+
auto: 'up' | 'down' | true;
|
|
7
|
+
/** An optional function to format the value */
|
|
8
|
+
format: (value: number) => string;
|
|
9
|
+
}>;
|
|
9
10
|
export declare function TimeDisplay(props: TimeDisplayProps): string | number | null;
|
|
10
11
|
export {};
|