tgui-core 1.1.18 → 1.1.20
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/components/Button.js +59 -59
- package/package.json +14 -10
|
@@ -48,15 +48,15 @@ import '../assets/Button.css';const T = "_button_433yx_17", L = "_fa_433yx_34",
|
|
|
48
48
|
content: Bo,
|
|
49
49
|
textMargin: Io
|
|
50
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function g(u) {
|
|
52
52
|
const {
|
|
53
53
|
captureKeys: s = !0,
|
|
54
54
|
children: a,
|
|
55
|
-
circular:
|
|
55
|
+
circular: y,
|
|
56
56
|
className: f,
|
|
57
57
|
color: i,
|
|
58
|
-
compact:
|
|
59
|
-
content:
|
|
58
|
+
compact: b,
|
|
59
|
+
content: x,
|
|
60
60
|
disabled: o,
|
|
61
61
|
ellipsis: c,
|
|
62
62
|
fluid: n,
|
|
@@ -65,13 +65,13 @@ function m(u) {
|
|
|
65
65
|
iconPosition: v,
|
|
66
66
|
iconRotation: w,
|
|
67
67
|
iconSpin: N,
|
|
68
|
-
onClick:
|
|
69
|
-
selected:
|
|
70
|
-
tooltip:
|
|
68
|
+
onClick: h,
|
|
69
|
+
selected: C,
|
|
70
|
+
tooltip: m,
|
|
71
71
|
tooltipPosition: A,
|
|
72
|
-
verticalAlignContent:
|
|
72
|
+
verticalAlignContent: k,
|
|
73
73
|
...B
|
|
74
|
-
} = u,
|
|
74
|
+
} = u, p = x || a;
|
|
75
75
|
let t = /* @__PURE__ */ l(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
@@ -79,24 +79,24 @@ function m(u) {
|
|
|
79
79
|
_.button,
|
|
80
80
|
n && _.fluid,
|
|
81
81
|
o && _.disabled,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
C && _.selected,
|
|
83
|
+
y && _.circular,
|
|
84
|
+
b && _.compact,
|
|
85
|
+
k && _.flex,
|
|
86
|
+
k && n && _.flex__fluid,
|
|
87
|
+
k && _["verticalAlignContent__" + k],
|
|
88
88
|
i && typeof i == "string" ? _["color__" + i] : _.color__default,
|
|
89
89
|
f,
|
|
90
90
|
j(B)
|
|
91
91
|
]),
|
|
92
92
|
tabIndex: o ? void 0 : 0,
|
|
93
93
|
onClick: (r) => {
|
|
94
|
-
!o &&
|
|
94
|
+
!o && h && h(r);
|
|
95
95
|
},
|
|
96
96
|
onKeyDown: (r) => {
|
|
97
97
|
if (s) {
|
|
98
98
|
if (r.key === I.Space || r.key === I.Enter) {
|
|
99
|
-
r.preventDefault(), !o &&
|
|
99
|
+
r.preventDefault(), !o && h && h(r);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
r.key === I.Escape && r.preventDefault();
|
|
@@ -107,7 +107,7 @@ function m(u) {
|
|
|
107
107
|
e && v !== "right" && /* @__PURE__ */ l(
|
|
108
108
|
D,
|
|
109
109
|
{
|
|
110
|
-
mr: 1,
|
|
110
|
+
mr: p ? 1 : 0,
|
|
111
111
|
name: e,
|
|
112
112
|
color: d,
|
|
113
113
|
rotation: w,
|
|
@@ -118,13 +118,13 @@ function m(u) {
|
|
|
118
118
|
"span",
|
|
119
119
|
{
|
|
120
120
|
className: R([_.ellipsis, e && _.textMargin]),
|
|
121
|
-
children:
|
|
121
|
+
children: p
|
|
122
122
|
}
|
|
123
|
-
) :
|
|
123
|
+
) : p,
|
|
124
124
|
e && v === "right" && /* @__PURE__ */ l(
|
|
125
125
|
D,
|
|
126
126
|
{
|
|
127
|
-
ml: 1,
|
|
127
|
+
ml: p ? 1 : 0,
|
|
128
128
|
name: e,
|
|
129
129
|
color: d,
|
|
130
130
|
rotation: w,
|
|
@@ -134,12 +134,12 @@ function m(u) {
|
|
|
134
134
|
] })
|
|
135
135
|
}
|
|
136
136
|
);
|
|
137
|
-
return
|
|
137
|
+
return m && (t = /* @__PURE__ */ l(P, { content: m, position: A, children: t })), t;
|
|
138
138
|
}
|
|
139
139
|
function No(u) {
|
|
140
140
|
const { checked: s, ...a } = u;
|
|
141
141
|
return /* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
g,
|
|
143
143
|
{
|
|
144
144
|
color: "transparent",
|
|
145
145
|
icon: s ? "check-square-o" : "square-o",
|
|
@@ -148,16 +148,16 @@ function No(u) {
|
|
|
148
148
|
}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
g.Checkbox = No;
|
|
152
152
|
function Ro(u) {
|
|
153
153
|
const {
|
|
154
154
|
children: s,
|
|
155
155
|
color: a,
|
|
156
|
-
confirmColor:
|
|
156
|
+
confirmColor: y = "bad",
|
|
157
157
|
confirmContent: f = "Confirm?",
|
|
158
158
|
confirmIcon: i,
|
|
159
|
-
ellipsis:
|
|
160
|
-
icon:
|
|
159
|
+
ellipsis: b = !0,
|
|
160
|
+
icon: x,
|
|
161
161
|
onClick: o,
|
|
162
162
|
...c
|
|
163
163
|
} = u, [n, e] = F(!1);
|
|
@@ -169,26 +169,26 @@ function Ro(u) {
|
|
|
169
169
|
o == null || o(v), e(!1);
|
|
170
170
|
}
|
|
171
171
|
return /* @__PURE__ */ l(
|
|
172
|
-
|
|
172
|
+
g,
|
|
173
173
|
{
|
|
174
|
-
icon: n ? i :
|
|
175
|
-
color: n ?
|
|
174
|
+
icon: n ? i : x,
|
|
175
|
+
color: n ? y : a,
|
|
176
176
|
onClick: d,
|
|
177
177
|
...c,
|
|
178
178
|
children: n ? f : s
|
|
179
179
|
}
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
g.Confirm = Ro;
|
|
183
183
|
function Do(u) {
|
|
184
184
|
const {
|
|
185
185
|
children: s,
|
|
186
186
|
color: a = "default",
|
|
187
|
-
content:
|
|
187
|
+
content: y,
|
|
188
188
|
currentValue: f,
|
|
189
189
|
defaultValue: i,
|
|
190
|
-
disabled:
|
|
191
|
-
fluid:
|
|
190
|
+
disabled: b,
|
|
191
|
+
fluid: x,
|
|
192
192
|
icon: o,
|
|
193
193
|
iconRotation: c,
|
|
194
194
|
iconSpin: n,
|
|
@@ -197,8 +197,8 @@ function Do(u) {
|
|
|
197
197
|
placeholder: v,
|
|
198
198
|
tooltip: w,
|
|
199
199
|
tooltipPosition: N,
|
|
200
|
-
...
|
|
201
|
-
} = u, [
|
|
200
|
+
...h
|
|
201
|
+
} = u, [C, m] = F(!1), A = K(), k = y || s;
|
|
202
202
|
function B(t) {
|
|
203
203
|
const r = A.current;
|
|
204
204
|
if (!r) return;
|
|
@@ -206,58 +206,58 @@ function Do(u) {
|
|
|
206
206
|
}
|
|
207
207
|
M(() => {
|
|
208
208
|
const t = A.current;
|
|
209
|
-
if (t &&
|
|
209
|
+
if (t && C) {
|
|
210
210
|
t.value = f || "";
|
|
211
211
|
try {
|
|
212
212
|
t.focus(), t.select();
|
|
213
213
|
} catch {
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
}, [
|
|
217
|
-
let
|
|
216
|
+
}, [C, f]);
|
|
217
|
+
let p = /* @__PURE__ */ E(
|
|
218
218
|
O,
|
|
219
219
|
{
|
|
220
220
|
className: R([
|
|
221
221
|
_.button,
|
|
222
|
-
|
|
222
|
+
x && _.fluid,
|
|
223
223
|
_["color__" + a]
|
|
224
224
|
]),
|
|
225
|
-
...
|
|
226
|
-
onClick: () =>
|
|
225
|
+
...h,
|
|
226
|
+
onClick: () => m(!0),
|
|
227
227
|
children: [
|
|
228
228
|
o && /* @__PURE__ */ l(D, { name: o, rotation: c, spin: n }),
|
|
229
|
-
/* @__PURE__ */ l("div", { children:
|
|
229
|
+
/* @__PURE__ */ l("div", { children: k }),
|
|
230
230
|
/* @__PURE__ */ l(
|
|
231
231
|
"input",
|
|
232
232
|
{
|
|
233
|
-
disabled: !!
|
|
233
|
+
disabled: !!b,
|
|
234
234
|
ref: A,
|
|
235
235
|
className: "NumberInput__input",
|
|
236
236
|
style: {
|
|
237
|
-
display:
|
|
237
|
+
display: C ? "" : "none",
|
|
238
238
|
textAlign: "left"
|
|
239
239
|
},
|
|
240
240
|
onBlur: (t) => {
|
|
241
|
-
|
|
241
|
+
C && (m(!1), B(t));
|
|
242
242
|
},
|
|
243
243
|
onKeyDown: (t) => {
|
|
244
244
|
if (t.key === I.Enter) {
|
|
245
|
-
|
|
245
|
+
m(!1), B(t);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
t.key === I.Escape &&
|
|
248
|
+
t.key === I.Escape && m(!1);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
)
|
|
252
252
|
]
|
|
253
253
|
}
|
|
254
254
|
);
|
|
255
|
-
return w && (
|
|
255
|
+
return w && (p = /* @__PURE__ */ l(P, { content: w, position: N, children: p })), p;
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
g.Input = Do;
|
|
258
258
|
function Eo(u) {
|
|
259
|
-
const { accept: s, multiple: a, onSelectFiles:
|
|
260
|
-
async function
|
|
259
|
+
const { accept: s, multiple: a, onSelectFiles: y, ...f } = u, i = V(null);
|
|
260
|
+
async function b(o) {
|
|
261
261
|
const c = Array.from(o).map((n) => {
|
|
262
262
|
const e = new FileReader();
|
|
263
263
|
return new Promise((d) => {
|
|
@@ -266,15 +266,15 @@ function Eo(u) {
|
|
|
266
266
|
});
|
|
267
267
|
return await Promise.all(c);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function x(o) {
|
|
270
270
|
const c = o.target.files;
|
|
271
271
|
if (c != null && c.length) {
|
|
272
|
-
const n = await
|
|
273
|
-
|
|
272
|
+
const n = await b(c);
|
|
273
|
+
y(a ? n : n[0]);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
return /* @__PURE__ */ E(S, { children: [
|
|
277
|
-
/* @__PURE__ */ l(
|
|
277
|
+
/* @__PURE__ */ l(g, { onClick: () => {
|
|
278
278
|
var o;
|
|
279
279
|
return (o = i.current) == null ? void 0 : o.click();
|
|
280
280
|
}, ...f }),
|
|
@@ -286,13 +286,13 @@ function Eo(u) {
|
|
|
286
286
|
ref: i,
|
|
287
287
|
accept: s,
|
|
288
288
|
multiple: a,
|
|
289
|
-
onChange:
|
|
289
|
+
onChange: x
|
|
290
290
|
}
|
|
291
291
|
)
|
|
292
292
|
] });
|
|
293
293
|
}
|
|
294
|
-
|
|
294
|
+
g.File = Eo;
|
|
295
295
|
export {
|
|
296
|
-
|
|
296
|
+
g as Button,
|
|
297
297
|
No as ButtonCheckbox
|
|
298
298
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tgui-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.20",
|
|
4
4
|
"description": "TGUI core component library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TGUI",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"import": "./dist/components/index.js",
|
|
16
16
|
"require": "./dist/components/index.cjs"
|
|
17
17
|
},
|
|
18
|
+
"./styles": {
|
|
19
|
+
"import": "./dist/assets/*.css",
|
|
20
|
+
"require": "./dist/assets/*.css"
|
|
21
|
+
},
|
|
18
22
|
"./*": {
|
|
19
23
|
"import": "./dist/common/*.js",
|
|
20
24
|
"require": "./dist/common/*.cjs"
|
|
@@ -28,29 +32,29 @@
|
|
|
28
32
|
"license": "MIT",
|
|
29
33
|
"type": "module",
|
|
30
34
|
"devDependencies": {
|
|
31
|
-
"@eslint/js": "^9.
|
|
35
|
+
"@eslint/js": "^9.7.0",
|
|
32
36
|
"@popperjs/core": "^2.11.8",
|
|
33
37
|
"@types/eslint__js": "^8.42.3",
|
|
34
|
-
"@types/node": "^20.14.
|
|
38
|
+
"@types/node": "^20.14.11",
|
|
35
39
|
"@types/react": "^18.3.3",
|
|
36
40
|
"@types/react-dom": "^18.3.0",
|
|
37
41
|
"@types/webpack-env": "^1.18.5",
|
|
38
42
|
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
39
|
-
"eslint": "^9.
|
|
43
|
+
"eslint": "^9.7.0",
|
|
40
44
|
"eslint-config-prettier": "^9.1.0",
|
|
41
|
-
"eslint-plugin-react": "^7.34.
|
|
45
|
+
"eslint-plugin-react": "^7.34.4",
|
|
42
46
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
43
47
|
"eslint-plugin-typescript-sort-keys": "^3.2.0",
|
|
44
48
|
"eslint-plugin-unused-imports": "^4.0.0",
|
|
45
|
-
"glob": "^
|
|
49
|
+
"glob": "^11.0.0",
|
|
46
50
|
"react-popper": "^2.3.0",
|
|
47
|
-
"sass": "^1.77.
|
|
51
|
+
"sass": "^1.77.8",
|
|
48
52
|
"typescript": "^5.5.3",
|
|
49
|
-
"typescript-eslint": "^7.
|
|
50
|
-
"vite": "^5.3.
|
|
53
|
+
"typescript-eslint": "^7.16.1",
|
|
54
|
+
"vite": "^5.3.4",
|
|
51
55
|
"vite-plugin-dts": "^3.9.1",
|
|
52
56
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
53
|
-
"vite-plugin-sass-dts": "^1.3.
|
|
57
|
+
"vite-plugin-sass-dts": "^1.3.24"
|
|
54
58
|
},
|
|
55
59
|
"peerDependencies": {
|
|
56
60
|
"react": "^18.2.0",
|