tgui-core 1.2.0 → 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.
Files changed (116) hide show
  1. package/README.md +3 -3
  2. package/dist/common/color.js +31 -30
  3. package/dist/common/events.js +5 -5
  4. package/dist/common/format.js +27 -27
  5. package/dist/common/hotkeys.d.ts +0 -1
  6. package/dist/common/hotkeys.js +2 -2
  7. package/dist/common/math.d.ts +4 -0
  8. package/dist/common/math.js +29 -25
  9. package/dist/common/random.js +14 -13
  10. package/dist/common/react.js +1 -1
  11. package/dist/common/string.js +9 -9
  12. package/dist/common/type-utils.d.ts +1 -1
  13. package/dist/components/AnimatedNumber.d.ts +6 -6
  14. package/dist/components/AnimatedNumber.js +14 -17
  15. package/dist/components/Autofocus.d.ts +0 -1
  16. package/dist/components/Blink.d.ts +0 -1
  17. package/dist/components/BlockQuote.d.ts +0 -1
  18. package/dist/components/BlockQuote.js +4 -7
  19. package/dist/components/Box.d.ts +0 -1
  20. package/dist/components/Box.js +4 -4
  21. package/dist/components/Button.d.ts +0 -1
  22. package/dist/components/Button.js +173 -211
  23. package/dist/components/ByondUi.js +3 -3
  24. package/dist/components/Chart.d.ts +0 -1
  25. package/dist/components/Chart.js +25 -22
  26. package/dist/components/Collapsible.d.ts +0 -1
  27. package/dist/components/ColorBox.d.ts +0 -1
  28. package/dist/components/ColorBox.js +7 -14
  29. package/dist/components/Dialog.js +31 -40
  30. package/dist/components/Dimmer.d.ts +0 -1
  31. package/dist/components/Dimmer.js +6 -9
  32. package/dist/components/Divider.js +10 -14
  33. package/dist/components/DmIcon.d.ts +0 -1
  34. package/dist/components/DraggableControl.js +57 -49
  35. package/dist/components/Dropdown.d.ts +0 -1
  36. package/dist/components/Dropdown.js +73 -67
  37. package/dist/components/FitText.d.ts +0 -1
  38. package/dist/components/Flex.d.ts +1 -1
  39. package/dist/components/Flex.js +39 -41
  40. package/dist/components/Icon.d.ts +0 -1
  41. package/dist/components/Icon.js +27 -34
  42. package/dist/components/Image.d.ts +0 -1
  43. package/dist/components/Image.js +7 -6
  44. package/dist/components/ImageButton.d.ts +0 -1
  45. package/dist/components/ImageButton.js +84 -171
  46. package/dist/components/InfinitePlane.js +1 -1
  47. package/dist/components/Input.d.ts +0 -1
  48. package/dist/components/Input.js +57 -64
  49. package/dist/components/KeyListener.d.ts +0 -1
  50. package/dist/components/Knob.d.ts +0 -1
  51. package/dist/components/Knob.js +91 -117
  52. package/dist/components/LabeledControls.d.ts +0 -1
  53. package/dist/components/LabeledList.d.ts +0 -1
  54. package/dist/components/LabeledList.js +48 -55
  55. package/dist/components/MenuBar.d.ts +0 -1
  56. package/dist/components/MenuBar.js +93 -102
  57. package/dist/components/Modal.d.ts +0 -1
  58. package/dist/components/Modal.js +11 -18
  59. package/dist/components/NoticeBox.d.ts +0 -1
  60. package/dist/components/NoticeBox.js +16 -43
  61. package/dist/components/NumberInput.d.ts +0 -2
  62. package/dist/components/NumberInput.js +99 -107
  63. package/dist/components/Popper.d.ts +0 -1
  64. package/dist/components/ProgressBar.d.ts +0 -1
  65. package/dist/components/ProgressBar.js +22 -27
  66. package/dist/components/RestrictedInput.js +64 -58
  67. package/dist/components/RoundGauge.d.ts +0 -1
  68. package/dist/components/RoundGauge.js +70 -104
  69. package/dist/components/Section.d.ts +1 -2
  70. package/dist/components/Section.js +50 -51
  71. package/dist/components/Slider.d.ts +0 -1
  72. package/dist/components/Slider.js +72 -80
  73. package/dist/components/Stack.d.ts +0 -1
  74. package/dist/components/Stack.js +37 -47
  75. package/dist/components/StyleableSection.d.ts +0 -1
  76. package/dist/components/StyleableSection.js +11 -11
  77. package/dist/components/Table.d.ts +0 -1
  78. package/dist/components/Table.js +38 -47
  79. package/dist/components/Tabs.d.ts +0 -1
  80. package/dist/components/Tabs.js +43 -75
  81. package/dist/components/TextArea.d.ts +0 -1
  82. package/dist/components/TextArea.js +74 -69
  83. package/dist/components/TimeDisplay.d.ts +7 -6
  84. package/dist/components/TimeDisplay.js +17 -17
  85. package/dist/components/Tooltip.d.ts +1 -2
  86. package/dist/components/Tooltip.js +8 -10
  87. package/dist/components/TrackOutsideClicks.d.ts +0 -1
  88. package/dist/components/VirtualList.d.ts +0 -1
  89. package/package.json +11 -25
  90. package/dist/ProgressBar.module-Jzqlebbx.js +0 -29
  91. package/dist/Section.module-qhQWhlUX.js +0 -18
  92. package/dist/assets/BlockQuote.css +0 -1
  93. package/dist/assets/Button.css +0 -1
  94. package/dist/assets/ColorBox.css +0 -1
  95. package/dist/assets/Dialog.css +0 -1
  96. package/dist/assets/Dimmer.css +0 -1
  97. package/dist/assets/Divider.css +0 -1
  98. package/dist/assets/Flex.css +0 -1
  99. package/dist/assets/Icon.css +0 -6
  100. package/dist/assets/ImageButton.css +0 -5
  101. package/dist/assets/Input.css +0 -1
  102. package/dist/assets/Knob.css +0 -1
  103. package/dist/assets/LabeledList.css +0 -1
  104. package/dist/assets/MenuBar.css +0 -1
  105. package/dist/assets/Modal.css +0 -1
  106. package/dist/assets/NoticeBox.css +0 -1
  107. package/dist/assets/NumberInput.css +0 -1
  108. package/dist/assets/ProgressBar.css +0 -1
  109. package/dist/assets/RoundGauge.css +0 -1
  110. package/dist/assets/Section.css +0 -1
  111. package/dist/assets/Slider.css +0 -1
  112. package/dist/assets/Stack.css +0 -1
  113. package/dist/assets/Table.css +0 -1
  114. package/dist/assets/Tabs.css +0 -1
  115. package/dist/assets/TextArea.css +0 -1
  116. package/dist/assets/Tooltip.css +0 -1
@@ -1,67 +1,57 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { classes as o } from "../common/react.js";
3
- import { computeBoxClassName as _ } from "./Box.js";
4
- import { computeFlexClassName as f, computeFlexProps as w, computeFlexItemProps as n } from "./Flex.js";
5
- import '../assets/Stack.css';const h = "_fill_wrul1_9", p = "_horizontal_wrul1_13", z = "_item_wrul1_13", x = "_vertical_wrul1_20", N = "_reverse_wrul1_27", b = "_reverse__vertical_wrul1_35", S = "_zebra_wrul1_43", k = "_divider_wrul1_47", F = "_divider__hidden_wrul1_47", e = {
6
- fill: h,
7
- horizontal: p,
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: o([
22
- i && e.fill,
23
- r ? e.vertical : e.horizontal,
24
- d && e.zebra,
25
- c && e[`reverse${r ? "__vertical" : ""}`],
26
- s,
27
- f(t)
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
- ...w({
30
- direction: `${m}${u}`,
31
- ...v
19
+ ...v({
20
+ direction: `${f}${S}`,
21
+ ...d
32
22
  })
33
23
  }
34
24
  );
35
25
  }
36
- function I(t) {
37
- const { className: s, innerRef: r, ...i } = t;
38
- return /* @__PURE__ */ l(
26
+ function u(r) {
27
+ const { className: c, innerRef: e, ...t } = r;
28
+ return /* @__PURE__ */ i(
39
29
  "div",
40
30
  {
41
- className: o([e.item, s, _(i)]),
42
- ref: r,
43
- ...n(i)
31
+ className: a(["Stack__item", c, o(t)]),
32
+ ref: e,
33
+ ...m(t)
44
34
  }
45
35
  );
46
36
  }
47
- a.Item = I;
48
- function P(t) {
49
- const { className: s, hidden: r, ...i } = t;
50
- return /* @__PURE__ */ l(
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: o([
54
- e.item,
55
- e.divider,
56
- r && e.divider__hidden,
57
- s,
58
- _(i)
43
+ className: a([
44
+ "Stack__item",
45
+ "Stack__divider",
46
+ e && "Stack__divider--hidden",
47
+ c,
48
+ o(t)
59
49
  ]),
60
- ...n(i)
50
+ ...m(t)
61
51
  }
62
52
  );
63
53
  }
64
- a.Divider = P;
54
+ n.Divider = p;
65
55
  export {
66
- a as Stack
56
+ n as Stack
67
57
  };
@@ -1,5 +1,4 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
-
3
2
  type Props = Partial<{
4
3
  style: Record<string, any>;
5
4
  textStyle: Record<string, any>;
@@ -1,16 +1,16 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { s as t } from "../Section.module-qhQWhlUX.js";
3
- import { Box as e } from "./Box.js";
4
- function h(i) {
5
- const { children: r, titleStyle: c, titleSubtext: n, title: o, textStyle: a, style: m } = i;
6
- return /* @__PURE__ */ s(e, { style: m, children: [
7
- /* @__PURE__ */ s(e, { className: t.title, style: c, children: [
8
- /* @__PURE__ */ l(e, { className: t.titleText, style: a, children: o }),
9
- /* @__PURE__ */ l("div", { className: t.buttons, children: n })
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__ */ l(e, { className: t.rest, children: /* @__PURE__ */ l(e, { className: t.content, children: r }) })
11
+ /* @__PURE__ */ e(t, { className: "Section__rest", children: /* @__PURE__ */ e(t, { className: "Section__content", children: c }) })
12
12
  ] });
13
13
  }
14
14
  export {
15
- h as StyleableSection
15
+ m as StyleableSection
16
16
  };
@@ -1,5 +1,4 @@
1
1
  import { BoxProps } from './Box';
2
-
3
2
  type Props = Partial<{
4
3
  /** Collapses table to the smallest possible size. */
5
4
  collapsing: boolean;
@@ -1,67 +1,58 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { classes as t } from "../common/react.js";
3
- import { computeBoxClassName as n, computeBoxProps as r } from "./Box.js";
4
- import '../assets/Table.css';const m = "_table_1hctn_5", d = "_collapsing_1hctn_13", p = "_row_1hctn_17", g = "_cell_1hctn_21", w = "_row__header_1hctn_32", b = "_cell__header_1hctn_33", u = "_cell__collapsing_1hctn_38", e = {
5
- table: m,
6
- collapsing: d,
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: t([
19
- e.table,
20
- o && e.collapsing,
21
- c,
22
- n(a)
9
+ className: r([
10
+ "Table",
11
+ a && "Table--collapsing",
12
+ l,
13
+ t(o)
23
14
  ]),
24
- ...r(a),
25
- children: /* @__PURE__ */ s("tbody", { children: _ })
15
+ ...n(o),
16
+ children: /* @__PURE__ */ c("tbody", { children: s })
26
17
  }
27
18
  );
28
19
  }
29
- function N(l) {
30
- const { className: c, header: o, ..._ } = l;
31
- return /* @__PURE__ */ s(
20
+ function i(e) {
21
+ const { className: l, header: a, ...s } = e;
22
+ return /* @__PURE__ */ c(
32
23
  "tr",
33
24
  {
34
- className: t([
35
- e.row,
36
- o && e.row__header,
37
- c,
38
- n(l)
25
+ className: r([
26
+ "Table__row",
27
+ a && "Table__row--header",
28
+ l,
29
+ t(e)
39
30
  ]),
40
- ...r(_)
31
+ ...n(s)
41
32
  }
42
33
  );
43
34
  }
44
- h.Row = N;
45
- function f(l) {
46
- const { className: c, collapsing: o, colSpan: _, header: a, ...i } = l;
47
- return /* @__PURE__ */ s(
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: t([
51
- e.cell,
52
- o && e.cell__collapsing,
53
- a && e.cell__header,
54
- c,
55
- n(l)
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
- ...r(i)
48
+ colSpan: s,
49
+ ...n(b)
59
50
  }
60
51
  );
61
52
  }
62
- h.Cell = f;
53
+ m.Cell = T;
63
54
  export {
64
- h as Table,
65
- f as TableCell,
66
- N as TableRow
55
+ m as Table,
56
+ T as TableCell,
57
+ i as TableRow
67
58
  };
@@ -1,6 +1,5 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
2
  import { BoxProps } from './Box';
3
-
4
3
  type Props = Partial<{
5
4
  className: string;
6
5
  fill: boolean;
@@ -1,94 +1,62 @@
1
- import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
- import { classes as g, canRender as d } from "../common/react.js";
3
- import { computeBoxClassName as f, computeBoxProps as m } from "./Box.js";
4
- import { Icon as k } from "./Icon.js";
5
- import '../assets/Tabs.css';const w = "_tabs_9h380_13", x = "_fill_9h380_20", y = "_vertical_9h380_35", N = "_horizontal_9h380_40", z = "_tabs__tab_9h380_48", C = "_fluid_9h380_52", S = "_tab_9h380_13", T = "_selected_9h380_66", j = "_tab__text_9h380_75", B = "_tab__left_9h380_80", I = "_tab__right_9h380_86", P = "_color__black_9h380_113", R = "_color__white_9h380_125", q = "_color__red_9h380_137", A = "_color__orange_9h380_149", D = "_color__yellow_9h380_161", E = "_color__olive_9h380_173", F = "_color__green_9h380_185", G = "_color__teal_9h380_197", H = "_color__blue_9h380_209", J = "_color__violet_9h380_221", K = "_color__purple_9h380_233", L = "_color__pink_9h380_245", M = "_color__brown_9h380_257", O = "_color__grey_9h380_269", Q = "_color__good_9h380_293", U = "_color__average_9h380_305", V = "_color__bad_9h380_317", W = "_color__label_9h380_329", _ = {
6
- tabs: w,
7
- fill: x,
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: g([
43
- _.tabs,
44
- e ? _.vertical : _.horizontal,
45
- a && _.fill,
46
- c && _.fluid,
47
- r,
48
- f(l)
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
- ...m(l),
51
- children: s
18
+ ...h(s),
19
+ children: r
52
20
  }
53
21
  );
54
22
  }
55
- function Y(t) {
23
+ function x(l) {
56
24
  const {
57
- className: r,
58
- selected: e,
59
- color: a,
60
- icon: c,
61
- iconSpin: s,
62
- leftSlot: l,
63
- rightSlot: n,
64
- children: v,
65
- onClick: i,
66
- ...h
67
- } = t, p = (b) => {
68
- i && (i(b), b.target.blur());
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: g([
74
- _.tab,
75
- _.tabs__tab,
76
- _["color__" + a],
77
- e && _.selected,
78
- r,
79
- f(h)
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: p,
82
- ...m(h),
49
+ onClick: _,
50
+ ...h(m),
83
51
  children: [
84
- d(l) && /* @__PURE__ */ o("div", { className: _.tab__left, children: l }) || !!c && /* @__PURE__ */ o("div", { className: _.tab__left, children: /* @__PURE__ */ o(k, { name: c, spin: s }) }),
85
- /* @__PURE__ */ o("div", { className: _.tab__text, children: v }),
86
- d(n) && /* @__PURE__ */ o("div", { className: _.tab__right, children: n })
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
- X.Tab = Y;
59
+ v.Tab = x;
92
60
  export {
93
- X as Tabs
61
+ v as Tabs
94
62
  };
@@ -1,5 +1,4 @@
1
1
  import { SyntheticEvent } from 'react';
2
-
3
2
  export declare const TextArea: import('react').ForwardRefExoticComponent<Partial<{
4
3
  autoFocus: boolean;
5
4
  autoSelect: boolean;
@@ -1,108 +1,113 @@
1
- import { jsxs as I, jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as Y, useRef as C, useState as H, useImperativeHandle as L, useEffect as _ } from "react";
3
- import { KEY as g, isEscape as P } from "../common/keys.js";
4
- import { classes as p } from "../common/react.js";
5
- import { Box as U } from "./Box.js";
6
- import { toInputValue as T } from "./Input.js";
7
- import '../assets/TextArea.css';const $ = "_textArea_1bert_20", q = "_fluid_1bert_33", z = "_noborder_1bert_39", G = "_inner_1bert_43", J = "_scrollable_1bert_43", M = "_custom_1bert_78", O = "_nowrap_1bert_83", Q = "_wrapper_1bert_89", e = {
8
- textArea: $,
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: s,
11
+ autoSelect: o,
21
12
  displayedValue: a,
22
- dontUseTabForIndent: y,
23
- maxLength: h,
24
- noborder: A,
13
+ dontUseTabForIndent: A,
14
+ maxLength: _,
15
+ noborder: y,
25
16
  onChange: l,
26
- onEnter: n,
27
- onEscape: u,
17
+ onEnter: u,
18
+ onEscape: s,
28
19
  onInput: c,
29
- placeholder: N,
20
+ placeholder: w,
30
21
  scrollbar: S,
31
22
  selfClear: m,
32
- value: i,
23
+ value: n,
33
24
  ...E
34
- } = x, { className: K, fluid: k, nowrap: D, ...R } = E, t = C(null), [V, j] = H(0);
35
- function B(r) {
36
- if (r.key === g.Enter) {
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
- n == null || n(r, r.currentTarget.value), m && (r.currentTarget.value = ""), r.currentTarget.blur();
32
+ u == null || u(r, r.currentTarget.value), m && (r.currentTarget.value = ""), r.currentTarget.blur();
42
33
  return;
43
34
  }
44
- if (P(r.key)) {
45
- u == null || u(r), m ? r.currentTarget.value = "" : (r.currentTarget.value = T(i), r.currentTarget.blur());
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 (!y && r.key === g.Tab) {
39
+ if (!A && r.key === p.Tab) {
49
40
  r.preventDefault();
50
- const { value: o, selectionStart: b, selectionEnd: F } = r.currentTarget;
51
- r.currentTarget.value = o.substring(0, b) + " " + o.substring(F), r.currentTarget.selectionEnd = b + 1;
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 L(
55
- w,
56
- () => t.current
57
- ), _(() => {
58
- if (!d && !s) return;
59
- const r = t.current;
60
- r && (d || s) && setTimeout(() => {
61
- r.focus(), s && r.select();
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 = t.current;
54
+ }, []), x(() => {
55
+ const r = e.current;
65
56
  if (!r) return;
66
- const o = T(i);
67
- r.value !== o && (r.value = o);
68
- }, [i]), /* @__PURE__ */ I(
69
- U,
57
+ const t = g(n);
58
+ r.value !== t && (r.value = t);
59
+ }, [n]), /* @__PURE__ */ B(
60
+ L,
70
61
  {
71
- className: p([
72
- e.textArea,
73
- k && e.fluid,
74
- A && e.noborder,
62
+ className: f([
63
+ "TextArea",
64
+ N && "TextArea--fluid",
65
+ y && "TextArea--noborder",
75
66
  K
76
67
  ]),
77
- ...R,
68
+ ...D,
78
69
  children: [
79
- !!a && /* @__PURE__ */ f("div", { className: e.wrapper, children: /* @__PURE__ */ f(
70
+ !!a && /* @__PURE__ */ i(
80
71
  "div",
81
72
  {
82
- className: p([e.inner, e.custom]),
83
73
  style: {
84
- transform: `translateY(-${V}px)`
74
+ height: "100%",
75
+ overflow: "hidden",
76
+ position: "absolute",
77
+ width: "100%"
85
78
  },
86
- children: a
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__ */ f(
93
+ ),
94
+ /* @__PURE__ */ i(
90
95
  "textarea",
91
96
  {
92
- className: p([
93
- e.inner,
94
- S && e.scrollable,
95
- D && e.nowrap
97
+ className: f([
98
+ "TextArea__textarea",
99
+ S && "TextArea__textarea--scrollable",
100
+ k && "TextArea__nowrap"
96
101
  ]),
97
- maxLength: h,
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: B,
105
+ onKeyDown: $,
101
106
  onScroll: () => {
102
- a && t.current && j(t.current.scrollTop);
107
+ a && e.current && V(e.current.scrollTop);
103
108
  },
104
- placeholder: N,
105
- ref: t,
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
- tr as TextArea
122
+ M as TextArea
118
123
  };
@@ -1,10 +1,11 @@
1
- interface TimeDisplayProps {
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 {};