tgui-core 1.1.22 → 1.1.24
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/Section.module-qhQWhlUX.js +18 -0
- package/dist/assets/Section.css +1 -1
- package/dist/components/Box.js +1 -1
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +178 -175
- package/dist/components/Collapsible.d.ts +2 -0
- package/dist/components/Collapsible.js +24 -16
- package/dist/components/ColorBox.js +1 -1
- package/dist/components/Input.js +47 -41
- package/dist/components/LabeledList.js +10 -10
- package/dist/components/NoticeBox.d.ts +4 -1
- package/dist/components/NoticeBox.js +31 -30
- package/dist/components/NumberInput.js +49 -49
- package/dist/components/Section.d.ts +27 -34
- package/dist/components/Section.js +67 -60
- package/dist/components/StyleableSection.js +1 -1
- package/dist/components/Tabs.d.ts +1 -0
- package/dist/components/Tabs.js +69 -64
- package/dist/components/TextArea.js +36 -36
- package/dist/components/TimeDisplay.d.ts +10 -0
- package/dist/components/TimeDisplay.js +22 -31
- package/package.json +1 -1
- package/dist/Section.module-CLVHJ4yA.js +0 -15
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './assets/Section.css';const t = "_section_10c68_17", _ = "_title_10c68_28", n = "_titleText_10c68_34", o = "_buttons_10c68_40", c = "_rest_10c68_47", e = "_content_10c68_51", s = "_fitted_10c68_55", l = "_fill_10c68_59", i = "_scrollable_10c68_73", r = "_scrollableHorizontal_10c68_90", a = "_section__flex_10c68_125", b = "_content__noTopPadding_10c68_135", d = "_content__stretchContents_10c68_139", f = {
|
|
2
|
+
section: t,
|
|
3
|
+
title: _,
|
|
4
|
+
titleText: n,
|
|
5
|
+
buttons: o,
|
|
6
|
+
rest: c,
|
|
7
|
+
content: e,
|
|
8
|
+
fitted: s,
|
|
9
|
+
fill: l,
|
|
10
|
+
scrollable: i,
|
|
11
|
+
scrollableHorizontal: r,
|
|
12
|
+
section__flex: a,
|
|
13
|
+
content__noTopPadding: b,
|
|
14
|
+
content__stretchContents: d
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
f as s
|
|
18
|
+
};
|
package/dist/assets/Section.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._section_10c68_17{position:relative;margin-bottom:.5em;background-color:#191919;background-color:#00000054;box-sizing:border-box}._section_10c68_17:last-child{margin-bottom:0}._title_10c68_28{position:relative;padding:.5em;border-bottom:.1666666667em solid #4972a1}._titleText_10c68_34{font-size:1.1666666667em;font-weight:700;color:#fff}._buttons_10c68_40{position:absolute;display:inline-block;right:.5em;margin-top:-.0833333333em}._rest_10c68_47{position:relative}._content_10c68_51{padding:.66em .5em}._fitted_10c68_55>._rest_10c68_47>._content_10c68_51{padding:0}._fill_10c68_59{display:flex;flex-direction:column;height:100%}._fill_10c68_59>._rest_10c68_47{flex-grow:1}._fill_10c68_59>._rest_10c68_47>._content_10c68_51{height:100%}._fill_10c68_59._scrollable_10c68_73>._rest_10c68_47>._content_10c68_51{position:absolute;top:0;left:0;right:0;bottom:0}._scrollable_10c68_73{overflow-x:hidden;overflow-y:hidden}._scrollable_10c68_73>._rest_10c68_47>._content_10c68_51{overflow-y:scroll;overflow-x:hidden}._scrollableHorizontal_10c68_90{overflow-x:hidden;overflow-y:hidden}._scrollableHorizontal_10c68_90>._rest_10c68_47>._content_10c68_51{overflow-y:hidden;overflow-x:scroll}._scrollable_10c68_73._scrollableHorizontal_10c68_90{overflow-x:hidden;overflow-y:hidden}._scrollable_10c68_73._scrollableHorizontal_10c68_90>._rest_10c68_47>._content_10c68_51{overflow-y:scroll;overflow-x:scroll}._section_10c68_17 ._section_10c68_17{background-color:transparent;margin-left:-.5em;margin-right:-.5em}._section_10c68_17 ._section_10c68_17:first-child{margin-top:-.5em}._section_10c68_17 ._section_10c68_17 ._titleText_10c68_34{font-size:1.0833333333em}._section_10c68_17 ._section_10c68_17 ._section_10c68_17 ._titleText_10c68_34{font-size:1em}._section__flex_10c68_125{display:flex;flex-flow:column}._section__flex_10c68_125 ._content_10c68_51{overflow:auto;flex-grow:1}._content__noTopPadding_10c68_135{padding-top:0}._content__stretchContents_10c68_139{height:calc(100% - 3rem)}
|
package/dist/components/Box.js
CHANGED
|
@@ -28,7 +28,7 @@ const m = (o) => (t, i) => {
|
|
|
28
28
|
}, g = (o, t, i) => (e, f) => {
|
|
29
29
|
if (typeof f == "number" || typeof f == "string")
|
|
30
30
|
for (let c = 0; c < i.length; c++)
|
|
31
|
-
e[o +
|
|
31
|
+
e[o + i[c]] = t(f);
|
|
32
32
|
}, s = (o) => (t, i) => {
|
|
33
33
|
x(i) && (t[o] = i);
|
|
34
34
|
}, C = {
|
|
@@ -1,267 +1,270 @@
|
|
|
1
|
-
import { jsx as l, jsxs 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
|
-
import '../assets/Button.css';const
|
|
9
|
-
button:
|
|
10
|
-
fa:
|
|
11
|
-
fas:
|
|
12
|
-
far:
|
|
13
|
-
dropdown:
|
|
14
|
-
ellipsis:
|
|
15
|
-
fluid:
|
|
16
|
-
circular:
|
|
17
|
-
compact:
|
|
18
|
-
color__black:
|
|
19
|
-
color__white:
|
|
20
|
-
color__red:
|
|
21
|
-
color__orange:
|
|
22
|
-
color__yellow:
|
|
23
|
-
color__olive:
|
|
24
|
-
color__green:
|
|
25
|
-
color__teal:
|
|
26
|
-
color__blue:
|
|
27
|
-
color__violet:
|
|
28
|
-
color__purple:
|
|
29
|
-
color__pink:
|
|
30
|
-
color__brown:
|
|
31
|
-
color__grey:
|
|
1
|
+
import { jsx as l, jsxs as P, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, createRef as V, useEffect as z, useRef as j } from "react";
|
|
3
|
+
import { KEY as R, isEscape as E } from "../common/keys.js";
|
|
4
|
+
import { classes as D } from "../common/react.js";
|
|
5
|
+
import { computeBoxClassName as q, computeBoxProps as O, Box as T } from "./Box.js";
|
|
6
|
+
import { Icon as F } from "./Icon.js";
|
|
7
|
+
import { Tooltip as K } from "./Tooltip.js";
|
|
8
|
+
import '../assets/Button.css';const L = "_button_433yx_17", Y = "_fa_433yx_34", G = "_fas_433yx_35", H = "_far_433yx_36", J = "_dropdown_433yx_43", Q = "_ellipsis_433yx_49", U = "_fluid_433yx_54", W = "_circular_433yx_60", X = "_compact_433yx_64", Z = "_color__black_433yx_69", $ = "_color__white_433yx_82", oo = "_color__red_433yx_95", to = "_color__orange_433yx_108", _o = "_color__yellow_433yx_121", no = "_color__olive_433yx_134", eo = "_color__green_433yx_147", lo = "_color__teal_433yx_160", co = "_color__blue_433yx_173", ro = "_color__violet_433yx_186", io = "_color__purple_433yx_199", so = "_color__pink_433yx_212", ao = "_color__brown_433yx_225", uo = "_color__grey_433yx_238", fo = "_color__good_433yx_264", po = "_color__average_433yx_277", yo = "_color__bad_433yx_290", xo = "_color__label_433yx_303", mo = "_color__default_433yx_316", go = "_color__caution_433yx_329", bo = "_color__danger_433yx_342", ho = "_color__transparent_433yx_355", Co = "_disabled_433yx_370", ko = "_selected_433yx_374", vo = "_flex_433yx_387", wo = "_flex__fluid_433yx_392", Ao = "_verticalAlignContent__top_433yx_396", Bo = "_verticalAlignContent__middle_433yx_400", Io = "_verticalAlignContent__bottom_433yx_404", No = "_content_433yx_408", Ro = "_textMargin_433yx_413", _ = {
|
|
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
32
|
"color__light-grey": "_color__light-grey_433yx_251",
|
|
33
|
-
color__good:
|
|
34
|
-
color__average:
|
|
35
|
-
color__bad:
|
|
36
|
-
color__label:
|
|
37
|
-
color__default:
|
|
38
|
-
color__caution:
|
|
39
|
-
color__danger:
|
|
40
|
-
color__transparent:
|
|
41
|
-
disabled:
|
|
42
|
-
selected:
|
|
43
|
-
flex:
|
|
44
|
-
flex__fluid:
|
|
45
|
-
verticalAlignContent__top:
|
|
46
|
-
verticalAlignContent__middle:
|
|
47
|
-
verticalAlignContent__bottom:
|
|
48
|
-
content:
|
|
49
|
-
textMargin:
|
|
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
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function b(a) {
|
|
52
52
|
const {
|
|
53
|
-
captureKeys:
|
|
54
|
-
children:
|
|
53
|
+
captureKeys: i = !0,
|
|
54
|
+
children: s,
|
|
55
55
|
circular: y,
|
|
56
|
-
className:
|
|
57
|
-
color:
|
|
58
|
-
compact:
|
|
56
|
+
className: p,
|
|
57
|
+
color: r,
|
|
58
|
+
compact: h,
|
|
59
59
|
content: x,
|
|
60
60
|
disabled: o,
|
|
61
61
|
ellipsis: c,
|
|
62
62
|
fluid: n,
|
|
63
63
|
icon: e,
|
|
64
|
-
iconColor:
|
|
65
|
-
iconPosition:
|
|
66
|
-
iconRotation:
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
iconColor: u,
|
|
65
|
+
iconPosition: w,
|
|
66
|
+
iconRotation: A,
|
|
67
|
+
iconSize: B,
|
|
68
|
+
iconSpin: I,
|
|
69
|
+
onClick: d,
|
|
69
70
|
selected: C,
|
|
70
|
-
tooltip:
|
|
71
|
-
tooltipPosition:
|
|
72
|
-
verticalAlignContent:
|
|
73
|
-
...
|
|
74
|
-
} =
|
|
75
|
-
let
|
|
71
|
+
tooltip: k,
|
|
72
|
+
tooltipPosition: N,
|
|
73
|
+
verticalAlignContent: m,
|
|
74
|
+
...v
|
|
75
|
+
} = a, t = x || s;
|
|
76
|
+
let g = /* @__PURE__ */ l(
|
|
76
77
|
"div",
|
|
77
78
|
{
|
|
78
|
-
className:
|
|
79
|
+
className: D([
|
|
79
80
|
_.button,
|
|
80
81
|
n && _.fluid,
|
|
81
82
|
o && _.disabled,
|
|
82
83
|
C && _.selected,
|
|
83
84
|
y && _.circular,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
h && _.compact,
|
|
86
|
+
m && _.flex,
|
|
87
|
+
m && n && _.flex__fluid,
|
|
88
|
+
m && _["verticalAlignContent__" + m],
|
|
89
|
+
r && typeof r == "string" ? _["color__" + r] : _.color__default,
|
|
90
|
+
p,
|
|
91
|
+
q(v)
|
|
91
92
|
]),
|
|
92
93
|
tabIndex: o ? void 0 : 0,
|
|
93
|
-
onClick: (
|
|
94
|
-
!o &&
|
|
94
|
+
onClick: (f) => {
|
|
95
|
+
!o && d && d(f);
|
|
95
96
|
},
|
|
96
|
-
onKeyDown: (
|
|
97
|
-
if (
|
|
98
|
-
if (
|
|
99
|
-
|
|
97
|
+
onKeyDown: (f) => {
|
|
98
|
+
if (i) {
|
|
99
|
+
if (f.key === R.Space || f.key === R.Enter) {
|
|
100
|
+
f.preventDefault(), !o && d && d(f);
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
+
E(f.key) && f.preventDefault();
|
|
103
104
|
}
|
|
104
105
|
},
|
|
105
|
-
...
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
e &&
|
|
108
|
-
|
|
106
|
+
...O(v),
|
|
107
|
+
children: /* @__PURE__ */ P("div", { className: _.content, children: [
|
|
108
|
+
e && w !== "right" && /* @__PURE__ */ l(
|
|
109
|
+
F,
|
|
109
110
|
{
|
|
110
|
-
mr:
|
|
111
|
+
mr: t ? 1 : 0,
|
|
111
112
|
name: e,
|
|
112
|
-
color:
|
|
113
|
-
rotation:
|
|
114
|
-
|
|
113
|
+
color: u,
|
|
114
|
+
rotation: A,
|
|
115
|
+
size: B,
|
|
116
|
+
spin: I
|
|
115
117
|
}
|
|
116
118
|
),
|
|
117
119
|
c ? /* @__PURE__ */ l(
|
|
118
120
|
"span",
|
|
119
121
|
{
|
|
120
|
-
className:
|
|
121
|
-
children:
|
|
122
|
+
className: D([_.ellipsis, e && _.textMargin]),
|
|
123
|
+
children: t
|
|
122
124
|
}
|
|
123
|
-
) :
|
|
124
|
-
e &&
|
|
125
|
-
|
|
125
|
+
) : t,
|
|
126
|
+
e && w === "right" && /* @__PURE__ */ l(
|
|
127
|
+
F,
|
|
126
128
|
{
|
|
127
|
-
ml:
|
|
129
|
+
ml: t ? 1 : 0,
|
|
128
130
|
name: e,
|
|
129
|
-
color:
|
|
130
|
-
rotation:
|
|
131
|
-
|
|
131
|
+
color: u,
|
|
132
|
+
rotation: A,
|
|
133
|
+
size: B,
|
|
134
|
+
spin: I
|
|
132
135
|
}
|
|
133
136
|
)
|
|
134
137
|
] })
|
|
135
138
|
}
|
|
136
139
|
);
|
|
137
|
-
return
|
|
140
|
+
return k && (g = /* @__PURE__ */ l(K, { content: k, position: N, children: g })), g;
|
|
138
141
|
}
|
|
139
|
-
function
|
|
140
|
-
const { checked:
|
|
142
|
+
function Do(a) {
|
|
143
|
+
const { checked: i, ...s } = a;
|
|
141
144
|
return /* @__PURE__ */ l(
|
|
142
|
-
|
|
145
|
+
b,
|
|
143
146
|
{
|
|
144
147
|
color: "transparent",
|
|
145
|
-
icon:
|
|
146
|
-
selected:
|
|
147
|
-
...
|
|
148
|
+
icon: i ? "check-square-o" : "square-o",
|
|
149
|
+
selected: i,
|
|
150
|
+
...s
|
|
148
151
|
}
|
|
149
152
|
);
|
|
150
153
|
}
|
|
151
|
-
|
|
152
|
-
function
|
|
154
|
+
b.Checkbox = Do;
|
|
155
|
+
function Fo(a) {
|
|
153
156
|
const {
|
|
154
|
-
children:
|
|
155
|
-
color:
|
|
157
|
+
children: i,
|
|
158
|
+
color: s,
|
|
156
159
|
confirmColor: y = "bad",
|
|
157
|
-
confirmContent:
|
|
158
|
-
confirmIcon:
|
|
159
|
-
ellipsis:
|
|
160
|
+
confirmContent: p = "Confirm?",
|
|
161
|
+
confirmIcon: r,
|
|
162
|
+
ellipsis: h = !0,
|
|
160
163
|
icon: x,
|
|
161
164
|
onClick: o,
|
|
162
165
|
...c
|
|
163
|
-
} =
|
|
164
|
-
function
|
|
166
|
+
} = a, [n, e] = S(!1);
|
|
167
|
+
function u(w) {
|
|
165
168
|
if (!n) {
|
|
166
169
|
e(!0);
|
|
167
170
|
return;
|
|
168
171
|
}
|
|
169
|
-
o == null || o(
|
|
172
|
+
o == null || o(w), e(!1);
|
|
170
173
|
}
|
|
171
174
|
return /* @__PURE__ */ l(
|
|
172
|
-
|
|
175
|
+
b,
|
|
173
176
|
{
|
|
174
|
-
icon: n ?
|
|
175
|
-
color: n ? y :
|
|
176
|
-
onClick:
|
|
177
|
+
icon: n ? r : x,
|
|
178
|
+
color: n ? y : s,
|
|
179
|
+
onClick: u,
|
|
177
180
|
...c,
|
|
178
|
-
children: n ?
|
|
181
|
+
children: n ? p : i
|
|
179
182
|
}
|
|
180
183
|
);
|
|
181
184
|
}
|
|
182
|
-
|
|
183
|
-
function
|
|
185
|
+
b.Confirm = Fo;
|
|
186
|
+
function Po(a) {
|
|
184
187
|
const {
|
|
185
|
-
children:
|
|
186
|
-
color:
|
|
188
|
+
children: i,
|
|
189
|
+
color: s = "default",
|
|
187
190
|
content: y,
|
|
188
|
-
currentValue:
|
|
189
|
-
defaultValue:
|
|
190
|
-
disabled:
|
|
191
|
+
currentValue: p,
|
|
192
|
+
defaultValue: r,
|
|
193
|
+
disabled: h,
|
|
191
194
|
fluid: x,
|
|
192
195
|
icon: o,
|
|
193
196
|
iconRotation: c,
|
|
194
197
|
iconSpin: n,
|
|
195
198
|
maxLength: e,
|
|
196
|
-
onCommit:
|
|
197
|
-
placeholder:
|
|
198
|
-
tooltip:
|
|
199
|
-
tooltipPosition:
|
|
200
|
-
...
|
|
201
|
-
} =
|
|
202
|
-
function
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
205
|
-
|
|
199
|
+
onCommit: u = () => null,
|
|
200
|
+
placeholder: w,
|
|
201
|
+
tooltip: A,
|
|
202
|
+
tooltipPosition: B,
|
|
203
|
+
...I
|
|
204
|
+
} = a, [d, C] = S(!1), k = V(), N = y || i;
|
|
205
|
+
function m(t) {
|
|
206
|
+
const g = k.current;
|
|
207
|
+
if (!g) return;
|
|
208
|
+
g.value !== "" ? u(t, g.value) : r && u(t, r);
|
|
206
209
|
}
|
|
207
|
-
|
|
208
|
-
const t =
|
|
209
|
-
if (t &&
|
|
210
|
-
t.value =
|
|
210
|
+
z(() => {
|
|
211
|
+
const t = k.current;
|
|
212
|
+
if (t && d) {
|
|
213
|
+
t.value = p || "";
|
|
211
214
|
try {
|
|
212
215
|
t.focus(), t.select();
|
|
213
216
|
} catch {
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
|
-
}, [
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
+
}, [d, p]);
|
|
220
|
+
let v = /* @__PURE__ */ P(
|
|
221
|
+
T,
|
|
219
222
|
{
|
|
220
|
-
className:
|
|
223
|
+
className: D([
|
|
221
224
|
_.button,
|
|
222
225
|
x && _.fluid,
|
|
223
|
-
_["color__" +
|
|
226
|
+
_["color__" + s]
|
|
224
227
|
]),
|
|
225
|
-
...
|
|
226
|
-
onClick: () =>
|
|
228
|
+
...I,
|
|
229
|
+
onClick: () => C(!0),
|
|
227
230
|
children: [
|
|
228
|
-
o && /* @__PURE__ */ l(
|
|
229
|
-
/* @__PURE__ */ l("div", { children:
|
|
231
|
+
o && /* @__PURE__ */ l(F, { name: o, rotation: c, spin: n }),
|
|
232
|
+
/* @__PURE__ */ l("div", { children: N }),
|
|
230
233
|
/* @__PURE__ */ l(
|
|
231
234
|
"input",
|
|
232
235
|
{
|
|
233
|
-
disabled: !!
|
|
234
|
-
ref:
|
|
236
|
+
disabled: !!h,
|
|
237
|
+
ref: k,
|
|
235
238
|
className: "NumberInput__input",
|
|
236
239
|
style: {
|
|
237
|
-
display:
|
|
240
|
+
display: d ? "" : "none",
|
|
238
241
|
textAlign: "left"
|
|
239
242
|
},
|
|
240
243
|
onBlur: (t) => {
|
|
241
|
-
|
|
244
|
+
d && (C(!1), m(t));
|
|
242
245
|
},
|
|
243
246
|
onKeyDown: (t) => {
|
|
244
|
-
if (t.key ===
|
|
245
|
-
|
|
247
|
+
if (t.key === R.Enter) {
|
|
248
|
+
C(!1), m(t);
|
|
246
249
|
return;
|
|
247
250
|
}
|
|
248
|
-
t.key
|
|
251
|
+
E(t.key) && C(!1);
|
|
249
252
|
}
|
|
250
253
|
}
|
|
251
254
|
)
|
|
252
255
|
]
|
|
253
256
|
}
|
|
254
257
|
);
|
|
255
|
-
return
|
|
258
|
+
return A && (v = /* @__PURE__ */ l(K, { content: A, position: B, children: v })), v;
|
|
256
259
|
}
|
|
257
|
-
|
|
258
|
-
function
|
|
259
|
-
const { accept:
|
|
260
|
-
async function
|
|
260
|
+
b.Input = Po;
|
|
261
|
+
function So(a) {
|
|
262
|
+
const { accept: i, multiple: s, onSelectFiles: y, ...p } = a, r = j(null);
|
|
263
|
+
async function h(o) {
|
|
261
264
|
const c = Array.from(o).map((n) => {
|
|
262
265
|
const e = new FileReader();
|
|
263
|
-
return new Promise((
|
|
264
|
-
e.onload = () =>
|
|
266
|
+
return new Promise((u) => {
|
|
267
|
+
e.onload = () => u(e.result), e.readAsText(n);
|
|
265
268
|
});
|
|
266
269
|
});
|
|
267
270
|
return await Promise.all(c);
|
|
@@ -269,30 +272,30 @@ function Eo(u) {
|
|
|
269
272
|
async function x(o) {
|
|
270
273
|
const c = o.target.files;
|
|
271
274
|
if (c != null && c.length) {
|
|
272
|
-
const n = await
|
|
273
|
-
y(
|
|
275
|
+
const n = await h(c);
|
|
276
|
+
y(s ? n : n[0]);
|
|
274
277
|
}
|
|
275
278
|
}
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */ l(
|
|
279
|
+
return /* @__PURE__ */ P(M, { children: [
|
|
280
|
+
/* @__PURE__ */ l(b, { onClick: () => {
|
|
278
281
|
var o;
|
|
279
|
-
return (o =
|
|
280
|
-
}, ...
|
|
282
|
+
return (o = r.current) == null ? void 0 : o.click();
|
|
283
|
+
}, ...p }),
|
|
281
284
|
/* @__PURE__ */ l(
|
|
282
285
|
"input",
|
|
283
286
|
{
|
|
284
287
|
hidden: !0,
|
|
285
288
|
type: "file",
|
|
286
|
-
ref:
|
|
287
|
-
accept:
|
|
288
|
-
multiple:
|
|
289
|
+
ref: r,
|
|
290
|
+
accept: i,
|
|
291
|
+
multiple: s,
|
|
289
292
|
onChange: x
|
|
290
293
|
}
|
|
291
294
|
)
|
|
292
295
|
] });
|
|
293
296
|
}
|
|
294
|
-
|
|
297
|
+
b.File = So;
|
|
295
298
|
export {
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
b as Button,
|
|
300
|
+
Do as ButtonCheckbox
|
|
298
301
|
};
|
|
@@ -4,6 +4,8 @@ import { BoxProps } from './Box';
|
|
|
4
4
|
type Props = Partial<{
|
|
5
5
|
/** Buttons or other content to render inline with the button */
|
|
6
6
|
buttons: ReactNode;
|
|
7
|
+
/** Top margin of the child nodes, defaulted to 1 */
|
|
8
|
+
child_mt: number;
|
|
7
9
|
/** Icon to display with the collapsible */
|
|
8
10
|
icon: string;
|
|
9
11
|
/** Whether the collapsible is open */
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { Button as
|
|
5
|
-
function
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import { Box as t } from "./Box.js";
|
|
4
|
+
import { Button as b } from "./Button.js";
|
|
5
|
+
function x(o) {
|
|
6
|
+
const {
|
|
7
|
+
children: r,
|
|
8
|
+
child_mt: s = 1,
|
|
9
|
+
color: m,
|
|
10
|
+
title: a,
|
|
11
|
+
buttons: c,
|
|
12
|
+
icon: i,
|
|
13
|
+
...d
|
|
14
|
+
} = o, [l, h] = p(o.open);
|
|
15
|
+
return /* @__PURE__ */ n(t, { mb: 1, children: [
|
|
16
|
+
/* @__PURE__ */ n("div", { className: "Table", children: [
|
|
9
17
|
/* @__PURE__ */ e("div", { className: "Table__cell", children: /* @__PURE__ */ e(
|
|
10
|
-
|
|
18
|
+
b,
|
|
11
19
|
{
|
|
12
20
|
fluid: !0,
|
|
13
|
-
color:
|
|
14
|
-
icon:
|
|
15
|
-
onClick: () =>
|
|
16
|
-
...
|
|
21
|
+
color: m,
|
|
22
|
+
icon: i || (l ? "chevron-down" : "chevron-right"),
|
|
23
|
+
onClick: () => h(!l),
|
|
24
|
+
...d,
|
|
17
25
|
children: a
|
|
18
26
|
}
|
|
19
27
|
) }),
|
|
20
|
-
|
|
28
|
+
c && /* @__PURE__ */ e("div", { className: "Table__cell Table__cell--collapsing", children: c })
|
|
21
29
|
] }),
|
|
22
|
-
l && /* @__PURE__ */ e(
|
|
30
|
+
l && /* @__PURE__ */ e(t, { mt: s, children: r })
|
|
23
31
|
] });
|
|
24
32
|
}
|
|
25
33
|
export {
|
|
26
|
-
|
|
34
|
+
x as Collapsible
|
|
27
35
|
};
|