@solostylist/ui-kit 1.0.187 → 1.0.189
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/s-action-overlay/s-action-overlay.js +0 -1
- package/dist/s-ai-tool-bar/s-ai-tool-bar.js +66 -70
- package/dist/s-chat-input/s-chat-input.js +18 -22
- package/dist/s-chat-message/s-chat-message.js +28 -29
- package/dist/s-code-block/s-code-block.js +1 -2
- package/dist/s-comment-message/s-comment-message.js +55 -57
- package/dist/s-file-dropzone/s-file-dropzone.js +7 -7
- package/dist/s-review/s-review.js +14 -16
- package/dist/s-select/s-select.js +26 -27
- package/dist/s-two-pane-layout/s-two-pane-layout.d.ts +2 -0
- package/dist/s-two-pane-layout/s-two-pane-layout.js +61 -32
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import j, { useEffect as K, useState as T, useMemo as H, useCallback as L } from "react";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as S } from "../createSvgIcon-DTNHY3_v.js";
|
|
4
4
|
import { C as $ } from "../Close-C-pCw-CD.js";
|
|
5
5
|
import { D as J } from "../Download-D97XSAig.js";
|
|
6
|
-
import { TextField as X, Typography as Q, Box as n, Slider as Y, IconButton as
|
|
6
|
+
import { TextField as X, Typography as Q, Box as n, Slider as Y, IconButton as F, Checkbox as Z, Divider as ee, Tooltip as M, Dialog as le, DialogTitle as te, DialogContent as se } from "@mui/material";
|
|
7
7
|
import { createPortal as re } from "react-dom";
|
|
8
8
|
import { SSelect as ne } from "../s-select/s-select.js";
|
|
9
|
-
const oe =
|
|
9
|
+
const oe = S(/* @__PURE__ */ e.jsx("path", {
|
|
10
10
|
d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"
|
|
11
|
-
}), "AddPhotoAlternate"), ae =
|
|
11
|
+
}), "AddPhotoAlternate"), ae = S(/* @__PURE__ */ e.jsx("path", {
|
|
12
12
|
d: "m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"
|
|
13
|
-
}), "AutoAwesome"), ce =
|
|
13
|
+
}), "AutoAwesome"), ce = S(/* @__PURE__ */ e.jsx("path", {
|
|
14
14
|
d: "M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"
|
|
15
|
-
}), "Autorenew"), ie =
|
|
15
|
+
}), "Autorenew"), ie = S(/* @__PURE__ */ e.jsx("path", {
|
|
16
16
|
d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
|
|
17
17
|
}), "InfoOutlined");
|
|
18
18
|
var de = /* @__PURE__ */ ((l) => (l.TEXTAREA = "textarea", l.SLIDER = "slider", l.IMAGE = "image", l.NUMBER = "number", l.SELECT = "select", l.CHECKBOX = "checkbox", l))(de || {});
|
|
@@ -30,7 +30,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
30
30
|
maxRows: l.maxRows ?? 5,
|
|
31
31
|
fullWidth: !0
|
|
32
32
|
}
|
|
33
|
-
)),
|
|
33
|
+
)), z = j.memo((l) => /* @__PURE__ */ e.jsx(
|
|
34
34
|
Q,
|
|
35
35
|
{
|
|
36
36
|
variant: "caption",
|
|
@@ -52,7 +52,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
52
52
|
flexDirection: "column"
|
|
53
53
|
},
|
|
54
54
|
children: [
|
|
55
|
-
/* @__PURE__ */ e.jsx(
|
|
55
|
+
/* @__PURE__ */ e.jsx(z, { label: l.label }),
|
|
56
56
|
/* @__PURE__ */ e.jsx(
|
|
57
57
|
X,
|
|
58
58
|
{
|
|
@@ -62,7 +62,6 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
62
62
|
onFocus: o,
|
|
63
63
|
onBlur: m,
|
|
64
64
|
disabled: i,
|
|
65
|
-
size: "small",
|
|
66
65
|
slotProps: {
|
|
67
66
|
htmlInput: {
|
|
68
67
|
min: l.min,
|
|
@@ -88,7 +87,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
88
87
|
flexDirection: "column"
|
|
89
88
|
},
|
|
90
89
|
children: [
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
90
|
+
/* @__PURE__ */ e.jsx(z, { label: l.label }),
|
|
92
91
|
/* @__PURE__ */ e.jsx(
|
|
93
92
|
ne,
|
|
94
93
|
{
|
|
@@ -102,8 +101,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
102
101
|
optionLabel: l.optionLabel,
|
|
103
102
|
optionValue: l.optionValue,
|
|
104
103
|
searchable: l.searchable,
|
|
105
|
-
searchPlaceholder: l.searchPlaceholder
|
|
106
|
-
size: "small"
|
|
104
|
+
searchPlaceholder: l.searchPlaceholder
|
|
107
105
|
}
|
|
108
106
|
)
|
|
109
107
|
]
|
|
@@ -117,7 +115,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
117
115
|
flexDirection: "column"
|
|
118
116
|
},
|
|
119
117
|
children: [
|
|
120
|
-
/* @__PURE__ */ e.jsx(
|
|
118
|
+
/* @__PURE__ */ e.jsx(z, { label: l.label }),
|
|
121
119
|
/* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", height: 36 }, children: [
|
|
122
120
|
/* @__PURE__ */ e.jsx(
|
|
123
121
|
Y,
|
|
@@ -130,7 +128,6 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
130
128
|
min: l.min ?? 0,
|
|
131
129
|
max: l.max ?? 100,
|
|
132
130
|
step: l.step ?? 1,
|
|
133
|
-
size: "small",
|
|
134
131
|
sx: { flex: 1 }
|
|
135
132
|
}
|
|
136
133
|
),
|
|
@@ -150,7 +147,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
150
147
|
]
|
|
151
148
|
}
|
|
152
149
|
)), ue = j.memo(({ input: l, value: r, onChange: d, disabled: o }) => {
|
|
153
|
-
const m = j.useRef(null), [i, x] = j.useState([]), [b,
|
|
150
|
+
const m = j.useRef(null), [i, x] = j.useState([]), [b, D] = j.useState(null), I = l.multiple ?? !1, p = l.maxImages ?? 5;
|
|
154
151
|
K(() => {
|
|
155
152
|
let f = [];
|
|
156
153
|
return x(((a) => {
|
|
@@ -176,7 +173,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
176
173
|
d(h[0]);
|
|
177
174
|
f.target.value = "";
|
|
178
175
|
}
|
|
179
|
-
},
|
|
176
|
+
}, E = (f, h) => {
|
|
180
177
|
if (f.stopPropagation(), I && Array.isArray(r)) {
|
|
181
178
|
const a = r.filter((y, c) => c !== h);
|
|
182
179
|
d(a.length > 0 ? a : null);
|
|
@@ -201,8 +198,8 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
201
198
|
i.map((f, h) => /* @__PURE__ */ e.jsxs(
|
|
202
199
|
n,
|
|
203
200
|
{
|
|
204
|
-
onMouseEnter: () =>
|
|
205
|
-
onMouseLeave: () =>
|
|
201
|
+
onMouseEnter: () => D(h),
|
|
202
|
+
onMouseLeave: () => D(null),
|
|
206
203
|
sx: {
|
|
207
204
|
width: 50,
|
|
208
205
|
height: 50,
|
|
@@ -234,7 +231,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
234
231
|
!o && b === h && /* @__PURE__ */ e.jsx(
|
|
235
232
|
n,
|
|
236
233
|
{
|
|
237
|
-
onClick: (a) =>
|
|
234
|
+
onClick: (a) => E(a, h),
|
|
238
235
|
sx: {
|
|
239
236
|
position: "absolute",
|
|
240
237
|
top: 0,
|
|
@@ -245,7 +242,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
245
242
|
alignItems: "center",
|
|
246
243
|
justifyContent: "center"
|
|
247
244
|
},
|
|
248
|
-
children: /* @__PURE__ */ e.jsx(
|
|
245
|
+
children: /* @__PURE__ */ e.jsx(F, { onClick: (a) => E(a, h), children: /* @__PURE__ */ e.jsx($, {}) })
|
|
249
246
|
}
|
|
250
247
|
)
|
|
251
248
|
]
|
|
@@ -293,7 +290,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
293
290
|
minWidth: 60
|
|
294
291
|
},
|
|
295
292
|
children: [
|
|
296
|
-
/* @__PURE__ */ e.jsx(
|
|
293
|
+
/* @__PURE__ */ e.jsx(z, { label: l.label }),
|
|
297
294
|
/* @__PURE__ */ e.jsx(
|
|
298
295
|
Z,
|
|
299
296
|
{
|
|
@@ -301,8 +298,7 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
301
298
|
onChange: (x) => d(x.target.checked),
|
|
302
299
|
onFocus: o,
|
|
303
300
|
onBlur: m,
|
|
304
|
-
disabled: i
|
|
305
|
-
size: "small"
|
|
301
|
+
disabled: i
|
|
306
302
|
}
|
|
307
303
|
)
|
|
308
304
|
]
|
|
@@ -333,11 +329,11 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
333
329
|
uploading: i = !1,
|
|
334
330
|
inputValues: x = {},
|
|
335
331
|
onInputChange: b,
|
|
336
|
-
customActionButtons:
|
|
332
|
+
customActionButtons: D,
|
|
337
333
|
hideProcessButton: I = !1,
|
|
338
334
|
processButtonDisabled: p = !1,
|
|
339
335
|
getInputDisabled: R,
|
|
340
|
-
processTooltip:
|
|
336
|
+
processTooltip: E = "Process",
|
|
341
337
|
downloadTooltip: P = "Download",
|
|
342
338
|
resetTooltip: V = "Reset",
|
|
343
339
|
infoTooltip: f = "Information",
|
|
@@ -346,12 +342,12 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
346
342
|
position: y = "bottom",
|
|
347
343
|
relative: c = !1
|
|
348
344
|
}) => {
|
|
349
|
-
const [k, A] = T(!1), W = H(() => l.length === 0 ? !0 : l.every((
|
|
350
|
-
if (!
|
|
351
|
-
const
|
|
352
|
-
return
|
|
345
|
+
const [k, A] = T(!1), W = H(() => l.length === 0 ? !0 : l.every((t) => {
|
|
346
|
+
if (!t.required) return !0;
|
|
347
|
+
const s = x[t.key];
|
|
348
|
+
return t.type === "textarea" ? s && typeof s == "string" && s.trim() !== "" : t.type === "number" || t.type === "slider" ? s != null : t.type === "select" ? s != null && s !== "" : !0;
|
|
353
349
|
}), [l, x]), { imageInputs: B, textareaInputs: N, paramInputs: O } = H(() => l.reduce(
|
|
354
|
-
(
|
|
350
|
+
(t, s) => (s.type === "image" ? t.imageInputs.push(s) : s.type === "textarea" ? t.textareaInputs.push(s) : t.paramInputs.push(s), t),
|
|
355
351
|
{
|
|
356
352
|
imageInputs: [],
|
|
357
353
|
textareaInputs: [],
|
|
@@ -360,8 +356,8 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
360
356
|
), [l]), C = L(() => {
|
|
361
357
|
}, []), w = L(() => {
|
|
362
358
|
}, []), v = L(
|
|
363
|
-
(
|
|
364
|
-
b?.(
|
|
359
|
+
(t, s, g) => {
|
|
360
|
+
b?.(t, s, g);
|
|
365
361
|
},
|
|
366
362
|
[b]
|
|
367
363
|
), q = L(() => A(!0), []), G = L(() => A(!1), []), _ = /* @__PURE__ */ e.jsxs(
|
|
@@ -393,25 +389,25 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
393
389
|
bgcolor: "background.default"
|
|
394
390
|
},
|
|
395
391
|
children: [
|
|
396
|
-
N.length > 0 && /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: N.map((
|
|
397
|
-
const
|
|
398
|
-
return
|
|
399
|
-
value:
|
|
400
|
-
onChange: (u) => v(
|
|
392
|
+
N.length > 0 && /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: N.map((t) => {
|
|
393
|
+
const s = x[t.key], g = R?.(t.key) ?? !1;
|
|
394
|
+
return t.renderInput ? /* @__PURE__ */ e.jsx(n, { children: t.renderInput({
|
|
395
|
+
value: s,
|
|
396
|
+
onChange: (u) => v(t.key, u),
|
|
401
397
|
onFocus: C,
|
|
402
398
|
onBlur: w,
|
|
403
399
|
disabled: g
|
|
404
|
-
}) },
|
|
400
|
+
}) }, t.key) : /* @__PURE__ */ e.jsx(
|
|
405
401
|
U,
|
|
406
402
|
{
|
|
407
|
-
input:
|
|
408
|
-
value:
|
|
409
|
-
onChange: (u) => v(
|
|
403
|
+
input: t,
|
|
404
|
+
value: s,
|
|
405
|
+
onChange: (u) => v(t.key, u),
|
|
410
406
|
onFocus: C,
|
|
411
407
|
onBlur: w,
|
|
412
408
|
disabled: g
|
|
413
409
|
},
|
|
414
|
-
|
|
410
|
+
t.key
|
|
415
411
|
);
|
|
416
412
|
}) }),
|
|
417
413
|
/* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
@@ -425,46 +421,46 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
425
421
|
flex: 1
|
|
426
422
|
},
|
|
427
423
|
children: (B.length > 0 || O.length > 0) && /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "flex-end", gap: 1.5 }, children: [
|
|
428
|
-
B.map((
|
|
429
|
-
const
|
|
430
|
-
return
|
|
431
|
-
value:
|
|
432
|
-
onChange: (u) => v(
|
|
424
|
+
B.map((t) => {
|
|
425
|
+
const s = x[t.key], g = R?.(t.key) ?? !1;
|
|
426
|
+
return t.renderInput ? /* @__PURE__ */ e.jsx(n, { children: t.renderInput({
|
|
427
|
+
value: s,
|
|
428
|
+
onChange: (u) => v(t.key, u),
|
|
433
429
|
onFocus: C,
|
|
434
430
|
onBlur: w,
|
|
435
431
|
disabled: g
|
|
436
|
-
}) },
|
|
432
|
+
}) }, t.key) : /* @__PURE__ */ e.jsx(
|
|
437
433
|
U,
|
|
438
434
|
{
|
|
439
|
-
input:
|
|
440
|
-
value:
|
|
441
|
-
onChange: (u) => v(
|
|
435
|
+
input: t,
|
|
436
|
+
value: s,
|
|
437
|
+
onChange: (u) => v(t.key, u),
|
|
442
438
|
onFocus: C,
|
|
443
439
|
onBlur: w,
|
|
444
440
|
disabled: g
|
|
445
441
|
},
|
|
446
|
-
|
|
442
|
+
t.key
|
|
447
443
|
);
|
|
448
444
|
}),
|
|
449
|
-
O.map((
|
|
450
|
-
const
|
|
451
|
-
return
|
|
452
|
-
value:
|
|
453
|
-
onChange: (u) => v(
|
|
445
|
+
O.map((t) => {
|
|
446
|
+
const s = x[t.key], g = R?.(t.key) ?? !1;
|
|
447
|
+
return t.renderInput ? /* @__PURE__ */ e.jsx(n, { children: t.renderInput({
|
|
448
|
+
value: s,
|
|
449
|
+
onChange: (u) => v(t.key, u),
|
|
454
450
|
onFocus: C,
|
|
455
451
|
onBlur: w,
|
|
456
452
|
disabled: g
|
|
457
|
-
}) },
|
|
453
|
+
}) }, t.key) : /* @__PURE__ */ e.jsx(
|
|
458
454
|
U,
|
|
459
455
|
{
|
|
460
|
-
input:
|
|
461
|
-
value:
|
|
462
|
-
onChange: (u) => v(
|
|
456
|
+
input: t,
|
|
457
|
+
value: s,
|
|
458
|
+
onChange: (u) => v(t.key, u),
|
|
463
459
|
onFocus: C,
|
|
464
460
|
onBlur: w,
|
|
465
461
|
disabled: g
|
|
466
462
|
},
|
|
467
|
-
|
|
463
|
+
t.key
|
|
468
464
|
);
|
|
469
465
|
})
|
|
470
466
|
] })
|
|
@@ -472,12 +468,12 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
472
468
|
),
|
|
473
469
|
(B.length > 0 || O.length > 0) && /* @__PURE__ */ e.jsx(ee, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5, flexShrink: 0 } }),
|
|
474
470
|
/* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.75, ml: "auto" }, children: [
|
|
475
|
-
|
|
476
|
-
a && /* @__PURE__ */ e.jsx(
|
|
477
|
-
/* @__PURE__ */ e.jsx(
|
|
478
|
-
/* @__PURE__ */ e.jsx(
|
|
479
|
-
!I && /* @__PURE__ */ e.jsx(
|
|
480
|
-
|
|
471
|
+
D,
|
|
472
|
+
a && /* @__PURE__ */ e.jsx(M, { title: f, children: /* @__PURE__ */ e.jsx(F, { onClick: q, children: /* @__PURE__ */ e.jsx(ie, {}) }) }),
|
|
473
|
+
/* @__PURE__ */ e.jsx(M, { title: P, children: /* @__PURE__ */ e.jsx(F, { onClick: o, children: /* @__PURE__ */ e.jsx(J, {}) }) }),
|
|
474
|
+
/* @__PURE__ */ e.jsx(M, { title: V, children: /* @__PURE__ */ e.jsx(F, { onClick: d, children: /* @__PURE__ */ e.jsx(ce, {}) }) }),
|
|
475
|
+
!I && /* @__PURE__ */ e.jsx(M, { title: E, children: /* @__PURE__ */ e.jsx("span", { children: /* @__PURE__ */ e.jsx(
|
|
476
|
+
F,
|
|
481
477
|
{
|
|
482
478
|
onClick: r,
|
|
483
479
|
disabled: p || !W || i || m,
|
|
@@ -496,8 +492,8 @@ const xe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
|
|
|
496
492
|
}
|
|
497
493
|
),
|
|
498
494
|
a && /* @__PURE__ */ e.jsxs(le, { open: k, onClose: G, maxWidth: "sm", fullWidth: !0, children: [
|
|
499
|
-
/* @__PURE__ */ e.jsx(
|
|
500
|
-
/* @__PURE__ */ e.jsx(
|
|
495
|
+
/* @__PURE__ */ e.jsx(te, { children: h }),
|
|
496
|
+
/* @__PURE__ */ e.jsx(se, { children: a })
|
|
501
497
|
] })
|
|
502
498
|
]
|
|
503
499
|
}
|
|
@@ -13,8 +13,8 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
13
13
|
}), "AttachFile"), Z = R(/* @__PURE__ */ r.jsx("path", {
|
|
14
14
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"
|
|
15
15
|
}), "EmojiEmotions"), ee = V(
|
|
16
|
-
({ onSubmit: I, onFileSelect: E, disabled: a, acceptedFileTypes: S, maxFileSize: b, hideEmojiPicker: M, hideFileAttachment: F, ...
|
|
17
|
-
const [p,
|
|
16
|
+
({ onSubmit: I, onFileSelect: E, disabled: a, acceptedFileTypes: S, maxFileSize: b, hideEmojiPicker: M, hideFileAttachment: F, ...U }, $) => {
|
|
17
|
+
const [p, u] = c(""), [l, m] = c([]), [i, h] = c(/* @__PURE__ */ new Map()), [j, x] = c(!1), v = B(null), C = D(), f = (e) => e.type.startsWith("image/"), P = (e) => {
|
|
18
18
|
const o = `${e.name}-${e.size}-${e.lastModified}`;
|
|
19
19
|
if (i.has(o))
|
|
20
20
|
return i.get(o);
|
|
@@ -23,17 +23,17 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
23
23
|
return h((t) => new Map(t).set(o, n)), n;
|
|
24
24
|
}
|
|
25
25
|
return "";
|
|
26
|
-
}, P = (e) => {
|
|
27
|
-
m(e.target.value);
|
|
28
26
|
}, L = (e) => {
|
|
29
|
-
|
|
30
|
-
}, A = () => {
|
|
27
|
+
u(e.target.value);
|
|
28
|
+
}, A = (e) => {
|
|
29
|
+
u((o) => o + e.emoji), x(!1);
|
|
30
|
+
}, O = () => {
|
|
31
31
|
x(!j);
|
|
32
32
|
}, k = () => {
|
|
33
|
-
a || p.trim().length === 0 && l.length === 0 || (I?.(p, l),
|
|
34
|
-
},
|
|
33
|
+
a || p.trim().length === 0 && l.length === 0 || (I?.(p, l), u(""), i.forEach((e) => URL.revokeObjectURL(e)), h(/* @__PURE__ */ new Map()), m([]));
|
|
34
|
+
}, z = (e) => {
|
|
35
35
|
const n = Array.from(e.target.files || []).filter((t) => !(b && t.size > b));
|
|
36
|
-
|
|
36
|
+
m((t) => [...t, ...n]), E?.(n), e.target.value = "";
|
|
37
37
|
}, K = (e) => {
|
|
38
38
|
const o = l[e];
|
|
39
39
|
if (o && f(o)) {
|
|
@@ -43,7 +43,7 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
43
43
|
return y.delete(n), y;
|
|
44
44
|
}));
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
m((n) => n.filter((t, g) => g !== e));
|
|
47
47
|
}, T = (e) => {
|
|
48
48
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), k());
|
|
49
49
|
};
|
|
@@ -56,15 +56,14 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
56
56
|
placeholder: "Enter your message here...",
|
|
57
57
|
disabled: a,
|
|
58
58
|
value: p,
|
|
59
|
-
onChange:
|
|
59
|
+
onChange: L,
|
|
60
60
|
onKeyDown: T,
|
|
61
61
|
multiline: !0,
|
|
62
62
|
minRows: 1,
|
|
63
63
|
maxRows: 10,
|
|
64
|
-
size: "small",
|
|
65
64
|
variant: "outlined",
|
|
66
65
|
fullWidth: !0,
|
|
67
|
-
inputRef:
|
|
66
|
+
inputRef: $,
|
|
68
67
|
slotProps: {
|
|
69
68
|
input: {
|
|
70
69
|
sx: {
|
|
@@ -87,7 +86,7 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
},
|
|
90
|
-
...
|
|
89
|
+
...U
|
|
91
90
|
}
|
|
92
91
|
),
|
|
93
92
|
l.length > 0 && /* @__PURE__ */ r.jsx(s, { mt: 1, children: l.map((e, o) => {
|
|
@@ -112,7 +111,7 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
112
111
|
s,
|
|
113
112
|
{
|
|
114
113
|
component: "img",
|
|
115
|
-
src:
|
|
114
|
+
src: P(e),
|
|
116
115
|
alt: e.name,
|
|
117
116
|
sx: {
|
|
118
117
|
width: 40,
|
|
@@ -133,7 +132,7 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
133
132
|
] }) })
|
|
134
133
|
] })
|
|
135
134
|
] }),
|
|
136
|
-
/* @__PURE__ */ r.jsx(d, {
|
|
135
|
+
/* @__PURE__ */ r.jsx(d, { onClick: () => K(o), sx: { minWidth: "auto", p: 0.5 }, children: /* @__PURE__ */ r.jsx(Q, {}) })
|
|
137
136
|
]
|
|
138
137
|
},
|
|
139
138
|
`${e.name}-${o}`
|
|
@@ -148,7 +147,7 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
148
147
|
type: "file",
|
|
149
148
|
multiple: !0,
|
|
150
149
|
accept: S,
|
|
151
|
-
onChange:
|
|
150
|
+
onChange: z,
|
|
152
151
|
style: { display: "none" },
|
|
153
152
|
id: `file-attachment-input-${C}`,
|
|
154
153
|
disabled: a
|
|
@@ -159,7 +158,6 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
159
158
|
{
|
|
160
159
|
component: "span",
|
|
161
160
|
disabled: a,
|
|
162
|
-
size: "small",
|
|
163
161
|
sx: {
|
|
164
162
|
transition: "transform 0.3s ease",
|
|
165
163
|
"&:hover": {
|
|
@@ -174,9 +172,8 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
174
172
|
d,
|
|
175
173
|
{
|
|
176
174
|
ref: v,
|
|
177
|
-
onClick:
|
|
175
|
+
onClick: O,
|
|
178
176
|
disabled: a,
|
|
179
|
-
size: "small",
|
|
180
177
|
sx: {
|
|
181
178
|
transition: "transform 0.3s ease",
|
|
182
179
|
"&:hover": {
|
|
@@ -192,7 +189,6 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
192
189
|
{
|
|
193
190
|
onClick: k,
|
|
194
191
|
disabled: a,
|
|
195
|
-
size: "small",
|
|
196
192
|
sx: {
|
|
197
193
|
transition: "transform 0.3s ease",
|
|
198
194
|
"&:hover": {
|
|
@@ -296,7 +292,7 @@ const Y = R(/* @__PURE__ */ r.jsx("path", {
|
|
|
296
292
|
children: /* @__PURE__ */ r.jsx(
|
|
297
293
|
q,
|
|
298
294
|
{
|
|
299
|
-
onEmojiClick:
|
|
295
|
+
onEmojiClick: A,
|
|
300
296
|
width: 300,
|
|
301
297
|
height: 400,
|
|
302
298
|
searchDisabled: !1,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import { useState as k } from "react";
|
|
3
|
-
import { Box as
|
|
3
|
+
import { Box as s, Typography as t, Paper as P, IconButton as B } from "@mui/material";
|
|
4
4
|
import { SSkeleton as l } from "../s-skeleton/s-skeleton.js";
|
|
5
5
|
import { SAvatar as F } from "../s-avatar/s-avatar.js";
|
|
6
6
|
import G from "../s-lazy-image/s-lazy-image.js";
|
|
@@ -32,7 +32,7 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
32
32
|
sx: y,
|
|
33
33
|
...z
|
|
34
34
|
}) => {
|
|
35
|
-
const [c, b] = k(null), [O, M] = k(!1),
|
|
35
|
+
const [c, b] = k(null), [O, M] = k(!1), r = D === "sent", T = (i) => (typeof i == "string" ? new Date(i) : i).toLocaleTimeString("en-US", {
|
|
36
36
|
hour: "2-digit",
|
|
37
37
|
minute: "2-digit",
|
|
38
38
|
hour12: !0
|
|
@@ -46,33 +46,33 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
46
46
|
a ? a(i) : d && d(i);
|
|
47
47
|
}, h = m.filter((i) => i.type === "image"), C = m.filter((i) => i.type === "file");
|
|
48
48
|
return L ? /* @__PURE__ */ e.jsxs(
|
|
49
|
-
|
|
49
|
+
s,
|
|
50
50
|
{
|
|
51
51
|
display: "flex",
|
|
52
|
-
flexDirection:
|
|
52
|
+
flexDirection: r ? "row-reverse" : "row",
|
|
53
53
|
alignItems: "flex-start",
|
|
54
54
|
gap: 1,
|
|
55
55
|
mb: 1,
|
|
56
56
|
sx: {
|
|
57
57
|
maxWidth: S,
|
|
58
|
-
alignSelf:
|
|
58
|
+
alignSelf: r ? "flex-end" : "flex-start",
|
|
59
59
|
...y
|
|
60
60
|
},
|
|
61
61
|
...z,
|
|
62
62
|
children: [
|
|
63
|
-
n && !
|
|
63
|
+
n && !r && /* @__PURE__ */ e.jsx(l, { component: "rounded-avatar", width: 36, height: 36 }),
|
|
64
64
|
/* @__PURE__ */ e.jsxs(
|
|
65
|
-
|
|
65
|
+
s,
|
|
66
66
|
{
|
|
67
67
|
display: "flex",
|
|
68
68
|
flexDirection: "column",
|
|
69
|
-
alignItems:
|
|
69
|
+
alignItems: r ? "flex-end" : "flex-start",
|
|
70
70
|
gap: 0.5,
|
|
71
71
|
sx: { minWidth: 0 },
|
|
72
72
|
children: [
|
|
73
|
-
o && !
|
|
73
|
+
o && !r && /* @__PURE__ */ e.jsx(l, { variant: "text", width: 100, height: 12, sx: { ml: 0.5 } }),
|
|
74
74
|
/* @__PURE__ */ e.jsxs(
|
|
75
|
-
|
|
75
|
+
s,
|
|
76
76
|
{
|
|
77
77
|
sx: {
|
|
78
78
|
display: "inline-block",
|
|
@@ -88,41 +88,41 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
I && /* @__PURE__ */ e.jsx(l, { variant: "text", width: 60, height: 10, sx: { ml:
|
|
91
|
+
I && /* @__PURE__ */ e.jsx(l, { variant: "text", width: 60, height: 10, sx: { ml: r ? 0 : 0.5, mr: r ? 0.5 : 0 } })
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
n &&
|
|
95
|
+
n && r && /* @__PURE__ */ e.jsx(l, { component: "rounded-avatar", width: 36, height: 36 })
|
|
96
96
|
]
|
|
97
97
|
}
|
|
98
98
|
) : /* @__PURE__ */ e.jsxs(
|
|
99
|
-
|
|
99
|
+
s,
|
|
100
100
|
{
|
|
101
101
|
display: "flex",
|
|
102
|
-
flexDirection:
|
|
102
|
+
flexDirection: r ? "row-reverse" : "row",
|
|
103
103
|
alignItems: "flex-start",
|
|
104
104
|
gap: 1,
|
|
105
105
|
mb: 1,
|
|
106
106
|
sx: {
|
|
107
107
|
maxWidth: S,
|
|
108
|
-
alignSelf:
|
|
108
|
+
alignSelf: r ? "flex-end" : "flex-start",
|
|
109
109
|
...y
|
|
110
110
|
},
|
|
111
111
|
...z,
|
|
112
112
|
children: [
|
|
113
|
-
n && !
|
|
113
|
+
n && !r && /* @__PURE__ */ e.jsx(F, { avatar: v, name: o, size: 36 }),
|
|
114
114
|
/* @__PURE__ */ e.jsxs(
|
|
115
|
-
|
|
115
|
+
s,
|
|
116
116
|
{
|
|
117
117
|
display: "flex",
|
|
118
118
|
flexDirection: "column",
|
|
119
|
-
alignItems:
|
|
119
|
+
alignItems: r ? "flex-end" : "flex-start",
|
|
120
120
|
gap: 0.5,
|
|
121
121
|
sx: { minWidth: 0 },
|
|
122
122
|
children: [
|
|
123
|
-
o && !
|
|
123
|
+
o && !r && /* @__PURE__ */ e.jsx(t, { children: o }),
|
|
124
124
|
/* @__PURE__ */ e.jsxs(
|
|
125
|
-
|
|
125
|
+
s,
|
|
126
126
|
{
|
|
127
127
|
sx: {
|
|
128
128
|
display: "inline-block",
|
|
@@ -138,7 +138,7 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
138
138
|
},
|
|
139
139
|
children: [
|
|
140
140
|
h.length > 0 && /* @__PURE__ */ e.jsx(
|
|
141
|
-
|
|
141
|
+
s,
|
|
142
142
|
{
|
|
143
143
|
sx: {
|
|
144
144
|
display: "grid",
|
|
@@ -148,7 +148,7 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
148
148
|
},
|
|
149
149
|
minWidth: 200,
|
|
150
150
|
children: h.map((i) => /* @__PURE__ */ e.jsx(
|
|
151
|
-
|
|
151
|
+
s,
|
|
152
152
|
{
|
|
153
153
|
sx: {
|
|
154
154
|
position: "relative",
|
|
@@ -181,7 +181,7 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
181
181
|
))
|
|
182
182
|
}
|
|
183
183
|
),
|
|
184
|
-
C.length > 0 && /* @__PURE__ */ e.jsx(
|
|
184
|
+
C.length > 0 && /* @__PURE__ */ e.jsx(s, { sx: { p: 1.5 }, children: C.map((i, p) => /* @__PURE__ */ e.jsxs(
|
|
185
185
|
P,
|
|
186
186
|
{
|
|
187
187
|
variant: "outlined",
|
|
@@ -196,7 +196,7 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
196
196
|
onClick: () => V(i),
|
|
197
197
|
children: [
|
|
198
198
|
/* @__PURE__ */ e.jsx(E, { sx: { fontSize: 32 } }),
|
|
199
|
-
/* @__PURE__ */ e.jsxs(
|
|
199
|
+
/* @__PURE__ */ e.jsxs(s, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
200
200
|
/* @__PURE__ */ e.jsx(
|
|
201
201
|
t,
|
|
202
202
|
{
|
|
@@ -216,7 +216,6 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
216
216
|
d && /* @__PURE__ */ e.jsx(
|
|
217
217
|
B,
|
|
218
218
|
{
|
|
219
|
-
size: "small",
|
|
220
219
|
onClick: (f) => {
|
|
221
220
|
f.stopPropagation(), d(i);
|
|
222
221
|
},
|
|
@@ -227,7 +226,7 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
227
226
|
},
|
|
228
227
|
i.id
|
|
229
228
|
)) }),
|
|
230
|
-
j && /* @__PURE__ */ e.jsx(
|
|
229
|
+
j && /* @__PURE__ */ e.jsx(s, { sx: { px: 2, py: 1.5, pt: m.length > 0 ? 0 : 1.5 }, children: /* @__PURE__ */ e.jsx(
|
|
231
230
|
t,
|
|
232
231
|
{
|
|
233
232
|
variant: "body2",
|
|
@@ -243,15 +242,15 @@ const q = g(/* @__PURE__ */ e.jsx("path", {
|
|
|
243
242
|
}
|
|
244
243
|
),
|
|
245
244
|
I && u && /* @__PURE__ */ e.jsx(t, { variant: "caption", children: T(u) }),
|
|
246
|
-
x && /* @__PURE__ */ e.jsxs(
|
|
245
|
+
x && /* @__PURE__ */ e.jsxs(s, { display: "flex", alignItems: "center", gap: 0.5, color: "error.main", children: [
|
|
247
246
|
/* @__PURE__ */ e.jsx(q, { sx: { fontSize: "1rem" } }),
|
|
248
247
|
/* @__PURE__ */ e.jsx(t, { color: "inherit", children: W }),
|
|
249
|
-
w && /* @__PURE__ */ e.jsx(B, {
|
|
248
|
+
w && /* @__PURE__ */ e.jsx(B, { onClick: w, children: /* @__PURE__ */ e.jsx(J, {}) })
|
|
250
249
|
] })
|
|
251
250
|
]
|
|
252
251
|
}
|
|
253
252
|
),
|
|
254
|
-
n &&
|
|
253
|
+
n && r && /* @__PURE__ */ e.jsx(F, { avatar: v, name: o, size: 36 }),
|
|
255
254
|
c && /* @__PURE__ */ e.jsx(
|
|
256
255
|
K,
|
|
257
256
|
{
|
|
@@ -1012,7 +1012,6 @@ const w = {
|
|
|
1012
1012
|
u,
|
|
1013
1013
|
{
|
|
1014
1014
|
onClick: h,
|
|
1015
|
-
size: "small",
|
|
1016
1015
|
sx: {
|
|
1017
1016
|
position: "absolute",
|
|
1018
1017
|
top: 8,
|
|
@@ -1021,7 +1020,7 @@ const w = {
|
|
|
1021
1020
|
color: r ? "success.main" : "text.primary",
|
|
1022
1021
|
backdropFilter: "blur(8px)"
|
|
1023
1022
|
},
|
|
1024
|
-
children: r ? /* @__PURE__ */ o.jsx(m, {
|
|
1023
|
+
children: r ? /* @__PURE__ */ o.jsx(m, {}) : /* @__PURE__ */ o.jsx(f, {})
|
|
1025
1024
|
}
|
|
1026
1025
|
),
|
|
1027
1026
|
/* @__PURE__ */ o.jsx(
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Box as
|
|
2
|
+
import { useState as C, useEffect as F } from "react";
|
|
3
|
+
import { Box as l, Stack as x, Typography as g, IconButton as G, Button as T, Collapse as J } from "@mui/material";
|
|
4
4
|
import { SSkeleton as e } from "../s-skeleton/s-skeleton.js";
|
|
5
5
|
import { SAvatar as K } from "../s-avatar/s-avatar.js";
|
|
6
6
|
import { F as N } from "../Favorite-Cvjg7GqN.js";
|
|
7
|
-
import { c as
|
|
7
|
+
import { c as L } from "../createSvgIcon-DTNHY3_v.js";
|
|
8
8
|
import { E as O } from "../ExpandMore-CTZrSZlF.js";
|
|
9
|
-
const Q =
|
|
9
|
+
const Q = L(/* @__PURE__ */ t.jsx("path", {
|
|
10
10
|
d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
|
|
11
|
-
}), "ExpandLess"), U =
|
|
11
|
+
}), "ExpandLess"), U = L(/* @__PURE__ */ t.jsx("path", {
|
|
12
12
|
d: "M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"
|
|
13
|
-
}), "FavoriteBorder"), X =
|
|
13
|
+
}), "FavoriteBorder"), X = L(/* @__PURE__ */ t.jsx("path", {
|
|
14
14
|
d: "M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11"
|
|
15
15
|
}), "Reply"), Z = (o) => {
|
|
16
|
-
const d = /* @__PURE__ */ new Date(), j = typeof o == "string" ? new Date(o) : o, p = d.getTime() - j.getTime(),
|
|
17
|
-
return
|
|
18
|
-
},
|
|
16
|
+
const d = /* @__PURE__ */ new Date(), j = typeof o == "string" ? new Date(o) : o, p = d.getTime() - j.getTime(), f = Math.floor(p / 1e3), n = Math.floor(f / 60), i = Math.floor(n / 60), s = Math.floor(i / 24), h = Math.floor(s / 7), r = Math.floor(s / 30), a = Math.floor(s / 365);
|
|
17
|
+
return f < 60 ? "just now" : n < 60 ? n === 1 ? "1 minute ago" : `${n} minutes ago` : i < 24 ? i === 1 ? "1 hour ago" : `${i} hours ago` : s < 7 ? s === 1 ? "1 day ago" : `${s} days ago` : h < 4 ? h === 1 ? "1 week ago" : `${h} weeks ago` : r < 12 ? r === 1 ? "1 month ago" : `${r} months ago` : a === 1 ? "1 year ago" : `${a} years ago`;
|
|
18
|
+
}, H = ({
|
|
19
19
|
id: o = Date.now(),
|
|
20
20
|
userName: d,
|
|
21
21
|
userAvatar: j,
|
|
22
22
|
commentContent: p,
|
|
23
|
-
datetime:
|
|
23
|
+
datetime: f,
|
|
24
24
|
likes: n = 0,
|
|
25
25
|
isLiked: i = !1,
|
|
26
26
|
replies: s = [],
|
|
27
27
|
totalReplies: h,
|
|
28
|
-
onLike:
|
|
29
|
-
onReply:
|
|
30
|
-
onToggleReplies:
|
|
28
|
+
onLike: r,
|
|
29
|
+
onReply: a,
|
|
30
|
+
onToggleReplies: b,
|
|
31
31
|
showReplies: u = !0,
|
|
32
|
-
avatarSize:
|
|
33
|
-
level:
|
|
34
|
-
maxLevel:
|
|
35
|
-
loading:
|
|
36
|
-
children:
|
|
37
|
-
sx:
|
|
32
|
+
avatarSize: m = 48,
|
|
33
|
+
level: S = 0,
|
|
34
|
+
maxLevel: k = 3,
|
|
35
|
+
loading: W = !1,
|
|
36
|
+
children: $,
|
|
37
|
+
sx: E = {}
|
|
38
38
|
}) => {
|
|
39
|
-
const [
|
|
40
|
-
w ? (v((
|
|
41
|
-
}, P = () => {
|
|
42
|
-
r && r(o);
|
|
39
|
+
const [B, v] = C(n), [w, I] = C(i), [M, A] = C(!1), P = () => {
|
|
40
|
+
w ? (v((c) => Math.max(0, c - 1)), I(!1)) : (v((c) => c + 1), I(!0)), r && r(o);
|
|
43
41
|
}, V = () => {
|
|
44
|
-
|
|
45
|
-
}, Y =
|
|
46
|
-
|
|
42
|
+
a && a(o);
|
|
43
|
+
}, Y = () => {
|
|
44
|
+
A(!M), b && b(o);
|
|
45
|
+
}, q = Z(f), y = h ?? s.length, D = y > 0, R = Math.min(S, k) * 2;
|
|
46
|
+
return F(() => {
|
|
47
47
|
v(n);
|
|
48
|
-
}, [n]),
|
|
48
|
+
}, [n]), F(() => {
|
|
49
49
|
I(i);
|
|
50
|
-
}, [i]),
|
|
51
|
-
/* @__PURE__ */ t.jsx(e, { component: "rounded-avatar", width:
|
|
52
|
-
/* @__PURE__ */ t.jsxs(
|
|
50
|
+
}, [i]), W ? /* @__PURE__ */ t.jsx(l, { sx: { pl: R, py: 1, ...E }, children: /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
51
|
+
/* @__PURE__ */ t.jsx(e, { component: "rounded-avatar", width: m, height: m }),
|
|
52
|
+
/* @__PURE__ */ t.jsxs(l, { sx: { flex: 1 }, children: [
|
|
53
53
|
/* @__PURE__ */ t.jsxs(x, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
|
|
54
54
|
/* @__PURE__ */ t.jsx(e, { variant: "text", width: 120, height: 20 }),
|
|
55
55
|
/* @__PURE__ */ t.jsx(e, { variant: "text", width: 80, height: 16 })
|
|
@@ -64,35 +64,33 @@ const Q = C(/* @__PURE__ */ t.jsx("path", {
|
|
|
64
64
|
/* @__PURE__ */ t.jsx(e, { variant: "text", width: 80, height: 32 })
|
|
65
65
|
] })
|
|
66
66
|
] })
|
|
67
|
-
] }) }) : /* @__PURE__ */ t.jsxs(
|
|
67
|
+
] }) }) : /* @__PURE__ */ t.jsxs(l, { sx: { pl: R, py: 1, ...E }, children: [
|
|
68
68
|
/* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
69
|
-
/* @__PURE__ */ t.jsx(K, { avatar: j, name: d, size:
|
|
70
|
-
/* @__PURE__ */ t.jsxs(
|
|
69
|
+
/* @__PURE__ */ t.jsx(K, { avatar: j, name: d, size: m }),
|
|
70
|
+
/* @__PURE__ */ t.jsxs(l, { sx: { flex: 1 }, children: [
|
|
71
71
|
/* @__PURE__ */ t.jsxs(x, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
|
|
72
72
|
/* @__PURE__ */ t.jsx(g, { variant: "subtitle2", fontWeight: "600", children: d }),
|
|
73
|
-
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(g, { variant: "caption", children:
|
|
73
|
+
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(g, { variant: "caption", children: q }) })
|
|
74
74
|
] }),
|
|
75
75
|
/* @__PURE__ */ t.jsx(g, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: p }),
|
|
76
76
|
/* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
77
77
|
/* @__PURE__ */ t.jsx(
|
|
78
78
|
G,
|
|
79
79
|
{
|
|
80
|
-
|
|
81
|
-
onClick: A,
|
|
80
|
+
onClick: P,
|
|
82
81
|
sx: {
|
|
83
82
|
color: w ? "error.main" : "text.secondary"
|
|
84
83
|
},
|
|
85
|
-
children: w ? /* @__PURE__ */ t.jsx(N, {
|
|
84
|
+
children: w ? /* @__PURE__ */ t.jsx(N, {}) : /* @__PURE__ */ t.jsx(U, {})
|
|
86
85
|
}
|
|
87
86
|
),
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */ t.jsx(
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
B > 0 && /* @__PURE__ */ t.jsx(g, { variant: "caption", children: B }),
|
|
88
|
+
/* @__PURE__ */ t.jsx(T, { startIcon: /* @__PURE__ */ t.jsx(X, {}), onClick: V, variant: "text", children: "Reply" }),
|
|
89
|
+
D && u && /* @__PURE__ */ t.jsxs(
|
|
90
|
+
T,
|
|
92
91
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
onClick: V,
|
|
92
|
+
startIcon: M ? /* @__PURE__ */ t.jsx(Q, {}) : /* @__PURE__ */ t.jsx(O, {}),
|
|
93
|
+
onClick: Y,
|
|
96
94
|
variant: "text",
|
|
97
95
|
children: [
|
|
98
96
|
y,
|
|
@@ -102,26 +100,26 @@ const Q = C(/* @__PURE__ */ t.jsx("path", {
|
|
|
102
100
|
}
|
|
103
101
|
)
|
|
104
102
|
] }),
|
|
105
|
-
|
|
103
|
+
$ && /* @__PURE__ */ t.jsx(l, { sx: { mt: 2 }, children: $ })
|
|
106
104
|
] })
|
|
107
105
|
] }),
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
D && u && /* @__PURE__ */ t.jsx(J, { in: M, children: /* @__PURE__ */ t.jsx(l, { sx: { mt: 2 }, children: s.map((c, z) => /* @__PURE__ */ t.jsx(
|
|
107
|
+
H,
|
|
110
108
|
{
|
|
111
|
-
...
|
|
112
|
-
level:
|
|
113
|
-
maxLevel:
|
|
114
|
-
onLike:
|
|
115
|
-
onReply:
|
|
109
|
+
...c,
|
|
110
|
+
level: S + 1,
|
|
111
|
+
maxLevel: k,
|
|
112
|
+
onLike: r,
|
|
113
|
+
onReply: a,
|
|
116
114
|
showReplies: u,
|
|
117
|
-
avatarSize: Math.max(32,
|
|
115
|
+
avatarSize: Math.max(32, m - 8)
|
|
118
116
|
},
|
|
119
|
-
|
|
117
|
+
c.id || `reply-${z}`
|
|
120
118
|
)) }) })
|
|
121
119
|
] });
|
|
122
120
|
};
|
|
123
|
-
|
|
121
|
+
H.displayName = "SCommentMessage";
|
|
124
122
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
H as SCommentMessage,
|
|
124
|
+
H as default
|
|
127
125
|
};
|
|
@@ -2,9 +2,9 @@ import { j as o } from "../jsx-runtime-tc70JA_2.js";
|
|
|
2
2
|
import * as g from "react";
|
|
3
3
|
import { c as l } from "../createSvgIcon-DTNHY3_v.js";
|
|
4
4
|
import { Avatar as b, Tooltip as v, IconButton as y, Button as C } from "@mui/material";
|
|
5
|
-
import { useDropzone as
|
|
6
|
-
import { bytesToSize as
|
|
7
|
-
import { SForm as
|
|
5
|
+
import { useDropzone as I } from "react-dropzone";
|
|
6
|
+
import { bytesToSize as S } from "../utils/bytes-to-size.js";
|
|
7
|
+
import { SForm as z } from "../s-form/s-form.js";
|
|
8
8
|
import { B as i } from "../Box-p3bpOtdn.js";
|
|
9
9
|
import { S as e } from "../Stack-BlwLEm6H.js";
|
|
10
10
|
import { T as t } from "../Typography-Cum5_Ehu.js";
|
|
@@ -25,9 +25,9 @@ const k = l(/* @__PURE__ */ o.jsx("path", {
|
|
|
25
25
|
isShowBtnRemoveAll: h = !1,
|
|
26
26
|
...n
|
|
27
27
|
}) => {
|
|
28
|
-
const { getRootProps: u, getInputProps: j, isDragActive: s } =
|
|
28
|
+
const { getRootProps: u, getInputProps: j, isDragActive: s } = I(n);
|
|
29
29
|
return /* @__PURE__ */ o.jsxs(g.Fragment, { children: [
|
|
30
|
-
/* @__PURE__ */ o.jsx(
|
|
30
|
+
/* @__PURE__ */ o.jsx(z, { error: d, label: c, required: m, hint: a, children: /* @__PURE__ */ o.jsxs(
|
|
31
31
|
i,
|
|
32
32
|
{
|
|
33
33
|
sx: {
|
|
@@ -99,7 +99,7 @@ const k = l(/* @__PURE__ */ o.jsx("path", {
|
|
|
99
99
|
/* @__PURE__ */ o.jsx(R, { extension: f }),
|
|
100
100
|
/* @__PURE__ */ o.jsxs(i, { sx: { flex: "1 1 auto" }, children: [
|
|
101
101
|
/* @__PURE__ */ o.jsx(t, { variant: "subtitle2", children: r.name }),
|
|
102
|
-
/* @__PURE__ */ o.jsx(t, { color: "text.secondary", variant: "body2", children:
|
|
102
|
+
/* @__PURE__ */ o.jsx(t, { color: "text.secondary", variant: "body2", children: S(r.size) })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ o.jsx(v, { title: "Remove", children: /* @__PURE__ */ o.jsx(
|
|
105
105
|
y,
|
|
@@ -115,7 +115,7 @@ const k = l(/* @__PURE__ */ o.jsx("path", {
|
|
|
115
115
|
r.size
|
|
116
116
|
);
|
|
117
117
|
}) }),
|
|
118
|
-
/* @__PURE__ */ o.jsx(e, { direction: "row", sx: { alignItems: "center", justifyContent: "flex-end" }, children: h && /* @__PURE__ */ o.jsx(C, { onClick: p,
|
|
118
|
+
/* @__PURE__ */ o.jsx(e, { direction: "row", sx: { alignItems: "center", justifyContent: "flex-end" }, children: h && /* @__PURE__ */ o.jsx(C, { onClick: p, type: "button", variant: "text", children: "Remove all" }) })
|
|
119
119
|
] }) : null
|
|
120
120
|
] });
|
|
121
121
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import { useState as j, useEffect as G } from "react";
|
|
3
|
-
import { Box as h, Stack as r, Divider as
|
|
3
|
+
import { Box as h, Stack as r, Divider as R, Typography as m, IconButton as H } from "@mui/material";
|
|
4
4
|
import { SSkeleton as i } from "../s-skeleton/s-skeleton.js";
|
|
5
5
|
import { SAvatar as J } from "../s-avatar/s-avatar.js";
|
|
6
6
|
import { SRating as K } from "../s-rating/s-rating.js";
|
|
7
7
|
import P from "../s-lazy-image/s-lazy-image.js";
|
|
8
|
-
import { c as
|
|
8
|
+
import { c as L } from "../createSvgIcon-DTNHY3_v.js";
|
|
9
9
|
import { SImageModal as Q } from "../s-image-modal/s-image-modal.js";
|
|
10
|
-
const X =
|
|
10
|
+
const X = L(/* @__PURE__ */ e.jsx("path", {
|
|
11
11
|
d: "M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2m4 0v12h4V3z"
|
|
12
|
-
}), "ThumbDown"), Z =
|
|
12
|
+
}), "ThumbDown"), Z = L(/* @__PURE__ */ e.jsx("path", {
|
|
13
13
|
d: "M1 21h4V9H1zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73z"
|
|
14
14
|
}), "ThumbUp"), _ = (l) => {
|
|
15
15
|
const x = /* @__PURE__ */ new Date(), v = typeof l == "string" ? new Date(l) : l, y = x.getTime() - v.getTime(), w = Math.floor(y / 1e3), c = Math.floor(w / 60), a = Math.floor(c / 60), o = Math.floor(a / 24), d = Math.floor(o / 7), f = Math.floor(o / 30), g = Math.floor(o / 365);
|
|
@@ -26,7 +26,7 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
26
26
|
helpfulYes: d = 0,
|
|
27
27
|
helpfulNo: f = 0,
|
|
28
28
|
onHelpfulVote: g,
|
|
29
|
-
showHelpfulSection:
|
|
29
|
+
showHelpfulSection: z = !0,
|
|
30
30
|
avatarSize: I = 48,
|
|
31
31
|
maxRating: V = 5,
|
|
32
32
|
readOnly: W = !0,
|
|
@@ -34,7 +34,7 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
34
34
|
loading: E = !1,
|
|
35
35
|
sx: T = {}
|
|
36
36
|
}) => {
|
|
37
|
-
const [O, M] = j(d), [U, b] = j(f), [p, S] = j(o), [Y, $] = j(!1), [B, k] = j(null),
|
|
37
|
+
const [O, M] = j(d), [U, b] = j(f), [p, S] = j(o), [Y, $] = j(!1), [B, k] = j(null), D = (n) => {
|
|
38
38
|
let s = n;
|
|
39
39
|
p === n ? (n === "yes" ? M((t) => Math.max(0, t - 1)) : b((t) => Math.max(0, t - 1)), S(null), s = null) : (p === "yes" ? M((t) => Math.max(0, t - 1)) : p === "no" && b((t) => Math.max(0, t - 1)), n === "yes" ? M((t) => t + 1) : b((t) => t + 1), S(n), s = n), g && g(l, s);
|
|
40
40
|
}, u = a?.map((n, s) => ({
|
|
@@ -72,7 +72,7 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
72
72
|
] })
|
|
73
73
|
] })
|
|
74
74
|
] }),
|
|
75
|
-
C && /* @__PURE__ */ e.jsx(
|
|
75
|
+
C && /* @__PURE__ */ e.jsx(R, { sx: { mt: 2 } })
|
|
76
76
|
] }) : /* @__PURE__ */ e.jsxs(h, { sx: { py: 2, ...T }, children: [
|
|
77
77
|
/* @__PURE__ */ e.jsxs(r, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
78
78
|
/* @__PURE__ */ e.jsx(J, { avatar: v, name: x, size: I }),
|
|
@@ -81,7 +81,7 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
81
81
|
/* @__PURE__ */ e.jsx(m, { variant: "subtitle2", fontWeight: "600", children: x }),
|
|
82
82
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(m, { variant: "caption", children: q }) })
|
|
83
83
|
] }),
|
|
84
|
-
/* @__PURE__ */ e.jsx(h, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(K, { value: y, max: V, readOnly: W
|
|
84
|
+
/* @__PURE__ */ e.jsx(h, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(K, { value: y, max: V, readOnly: W }) }),
|
|
85
85
|
/* @__PURE__ */ e.jsx(m, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: w }),
|
|
86
86
|
a && a.length > 0 && /* @__PURE__ */ e.jsx(r, { direction: "row", spacing: 1, sx: { mb: 2, flexWrap: "wrap", gap: 1 }, children: a.map((n, s) => /* @__PURE__ */ e.jsx(
|
|
87
87
|
P,
|
|
@@ -105,13 +105,12 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
105
105
|
},
|
|
106
106
|
s
|
|
107
107
|
)) }),
|
|
108
|
-
|
|
108
|
+
z && /* @__PURE__ */ e.jsxs(r, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
|
|
109
109
|
/* @__PURE__ */ e.jsx(m, { variant: "caption", sx: { mr: 2 }, children: "Was this review helpful?" }),
|
|
110
110
|
/* @__PURE__ */ e.jsx(
|
|
111
|
-
|
|
111
|
+
H,
|
|
112
112
|
{
|
|
113
|
-
|
|
114
|
-
onClick: () => z("yes"),
|
|
113
|
+
onClick: () => D("yes"),
|
|
115
114
|
sx: {
|
|
116
115
|
color: p === "yes" ? "primary.main" : "text.secondary",
|
|
117
116
|
"&:hover": {
|
|
@@ -123,10 +122,9 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
123
122
|
),
|
|
124
123
|
/* @__PURE__ */ e.jsx(m, { variant: "caption", children: O }),
|
|
125
124
|
/* @__PURE__ */ e.jsx(
|
|
126
|
-
|
|
125
|
+
H,
|
|
127
126
|
{
|
|
128
|
-
|
|
129
|
-
onClick: () => z("no"),
|
|
127
|
+
onClick: () => D("no"),
|
|
130
128
|
sx: {
|
|
131
129
|
color: p === "no" ? "error.main" : "text.secondary",
|
|
132
130
|
ml: 1,
|
|
@@ -141,7 +139,7 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
141
139
|
] })
|
|
142
140
|
] })
|
|
143
141
|
] }),
|
|
144
|
-
C && /* @__PURE__ */ e.jsx(
|
|
142
|
+
C && /* @__PURE__ */ e.jsx(R, { sx: { mt: 2 } }),
|
|
145
143
|
/* @__PURE__ */ e.jsx(
|
|
146
144
|
Q,
|
|
147
145
|
{
|
|
@@ -7,8 +7,8 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
7
7
|
d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
|
|
8
8
|
}), "Search"), N = A(
|
|
9
9
|
({
|
|
10
|
-
options:
|
|
11
|
-
optionLabel:
|
|
10
|
+
options: r = [],
|
|
11
|
+
optionLabel: m = "name",
|
|
12
12
|
optionValue: y = "id",
|
|
13
13
|
placeholder: x,
|
|
14
14
|
label: C = "",
|
|
@@ -17,11 +17,11 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
17
17
|
variant: R = "outlined",
|
|
18
18
|
simple: w = !1,
|
|
19
19
|
htmlFor: v,
|
|
20
|
-
searchable:
|
|
20
|
+
searchable: l = !1,
|
|
21
21
|
searchPlaceholder: P = "",
|
|
22
|
-
...
|
|
22
|
+
...a
|
|
23
23
|
}, O) => {
|
|
24
|
-
const g =
|
|
24
|
+
const g = a.value !== void 0, [V, $] = f(a.multiple ? [] : null), L = g ? a.value : V, [u, h] = f(""), [k, j] = f(!1), s = (e) => String(typeof e == "string" || typeof e == "number" ? e : e[m]), o = (e) => typeof e == "string" || typeof e == "number" ? e : e[y], S = l && u ? r.filter((e) => s(e).toLowerCase().includes(u.toLowerCase())) : r;
|
|
25
25
|
return /* @__PURE__ */ t.jsx(D, { error: b, label: C, required: I, htmlFor: v, children: /* @__PURE__ */ t.jsxs(
|
|
26
26
|
F,
|
|
27
27
|
{
|
|
@@ -30,12 +30,12 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
30
30
|
fullWidth: !0,
|
|
31
31
|
defaultValue: "",
|
|
32
32
|
ref: O,
|
|
33
|
-
open:
|
|
34
|
-
onOpen:
|
|
35
|
-
onClose:
|
|
33
|
+
open: l ? k : void 0,
|
|
34
|
+
onOpen: l ? () => j(!0) : void 0,
|
|
35
|
+
onClose: l ? () => {
|
|
36
36
|
j(!1), h("");
|
|
37
37
|
} : void 0,
|
|
38
|
-
MenuProps:
|
|
38
|
+
MenuProps: l ? {
|
|
39
39
|
autoFocus: !1,
|
|
40
40
|
PaperProps: {
|
|
41
41
|
onKeyDown: (e) => {
|
|
@@ -43,36 +43,35 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
} : void 0,
|
|
46
|
-
renderValue:
|
|
46
|
+
renderValue: a.multiple ? (e) => {
|
|
47
47
|
const n = e;
|
|
48
48
|
return n.length === 0 ? /* @__PURE__ */ t.jsx(p, { component: "span", sx: { color: "divider" }, children: x }) : n?.map((i) => {
|
|
49
|
-
const d =
|
|
50
|
-
return d ?
|
|
49
|
+
const d = r.find((z) => o(z) === o(i));
|
|
50
|
+
return d ? s(d) : "";
|
|
51
51
|
}).filter(Boolean).join(", ");
|
|
52
52
|
} : (e) => {
|
|
53
53
|
const n = e;
|
|
54
54
|
if (n == null || n === "")
|
|
55
55
|
return /* @__PURE__ */ t.jsx(p, { component: "span", sx: { color: "divider" }, children: x });
|
|
56
56
|
if (w)
|
|
57
|
-
return
|
|
58
|
-
const i =
|
|
59
|
-
return i ?
|
|
57
|
+
return s(n);
|
|
58
|
+
const i = r.find((d) => o(d) === o(n));
|
|
59
|
+
return i ? s(i) : "";
|
|
60
60
|
},
|
|
61
|
-
...
|
|
62
|
-
value:
|
|
61
|
+
...a,
|
|
62
|
+
value: r.length ? L ?? "" : "",
|
|
63
63
|
onChange: (e, n) => {
|
|
64
|
-
if (
|
|
65
|
-
|
|
64
|
+
if (a.onChange)
|
|
65
|
+
a.onChange(e, n);
|
|
66
66
|
else if (!g) {
|
|
67
67
|
const i = e.target.value;
|
|
68
68
|
$(i);
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
children: [
|
|
72
|
-
|
|
72
|
+
l && /* @__PURE__ */ t.jsx(M, { sx: { px: 2, py: 1, position: "sticky", top: 0, bgcolor: "background.paper", zIndex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
73
73
|
T,
|
|
74
74
|
{
|
|
75
|
-
size: "small",
|
|
76
75
|
fullWidth: !0,
|
|
77
76
|
autoFocus: !0,
|
|
78
77
|
placeholder: P,
|
|
@@ -89,28 +88,28 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
) }),
|
|
92
|
-
|
|
91
|
+
l ? S?.length > 0 ? S.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
93
92
|
c,
|
|
94
93
|
{
|
|
95
94
|
disabled: e?.disabled ?? !1,
|
|
96
95
|
value: o(e),
|
|
97
|
-
children:
|
|
96
|
+
children: s(e)
|
|
98
97
|
},
|
|
99
98
|
`${o(e)}-${n}`
|
|
100
|
-
)) : u ? /* @__PURE__ */ t.jsx(c, { disabled: !0, children: /* @__PURE__ */ t.jsx(p, { sx: { color: "text.secondary", textAlign: "center", width: "100%" }, children: "No results found" }) }) :
|
|
99
|
+
)) : u ? /* @__PURE__ */ t.jsx(c, { disabled: !0, children: /* @__PURE__ */ t.jsx(p, { sx: { color: "text.secondary", textAlign: "center", width: "100%" }, children: "No results found" }) }) : r?.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
101
100
|
c,
|
|
102
101
|
{
|
|
103
102
|
disabled: e?.disabled ?? !1,
|
|
104
103
|
value: o(e),
|
|
105
|
-
children:
|
|
104
|
+
children: s(e)
|
|
106
105
|
},
|
|
107
106
|
`${o(e)}-${n}`
|
|
108
|
-
)) :
|
|
107
|
+
)) : r?.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
109
108
|
c,
|
|
110
109
|
{
|
|
111
110
|
disabled: e?.disabled ?? !1,
|
|
112
111
|
value: o(e),
|
|
113
|
-
children:
|
|
112
|
+
children: s(e)
|
|
114
113
|
},
|
|
115
114
|
`${o(e)}-${n}`
|
|
116
115
|
))
|
|
@@ -46,6 +46,8 @@ export interface STwoPaneLayoutProps {
|
|
|
46
46
|
sidebarHeaderPadding?: number | string;
|
|
47
47
|
/** Padding for content header. Default: 2 */
|
|
48
48
|
contentHeaderPadding?: number | string;
|
|
49
|
+
/** Height of header sections to ensure consistent sizing between panes. Default: '40px' */
|
|
50
|
+
headerHeight?: number | string;
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
53
|
* A flexible two-pane layout component with customizable sidebar and content areas.
|
|
@@ -1,53 +1,82 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import { Box as r } from "@mui/material";
|
|
3
|
-
import { SOverlayScrollbar as
|
|
4
|
-
import { SFlexBox as
|
|
3
|
+
import { SOverlayScrollbar as a } from "../s-overlay-scrollbar/s-overlay-scrollbar.js";
|
|
4
|
+
import { SFlexBox as I } from "../s-flex-box/s-flex-box.js";
|
|
5
5
|
const R = ({
|
|
6
|
-
sidebar:
|
|
7
|
-
content:
|
|
8
|
-
sidebarWidth:
|
|
6
|
+
sidebar: x,
|
|
7
|
+
content: i,
|
|
8
|
+
sidebarWidth: g = 280,
|
|
9
9
|
height: u = "calc(100vh - 65px)",
|
|
10
10
|
containerSx: v,
|
|
11
11
|
sidebarSx: w,
|
|
12
|
-
contentSx:
|
|
13
|
-
sidebarHeaderSx:
|
|
14
|
-
contentHeaderSx:
|
|
15
|
-
sidebarScrollSx:
|
|
12
|
+
contentSx: y,
|
|
13
|
+
sidebarHeaderSx: B,
|
|
14
|
+
contentHeaderSx: D,
|
|
15
|
+
sidebarScrollSx: o,
|
|
16
16
|
contentScrollSx: s,
|
|
17
17
|
disableBorder: h = !1,
|
|
18
|
-
sidebarHeader:
|
|
19
|
-
contentHeader:
|
|
20
|
-
enableSidebarScroll:
|
|
21
|
-
enableContentScroll:
|
|
22
|
-
sidebarPosition:
|
|
23
|
-
sidebarPadding:
|
|
18
|
+
sidebarHeader: t,
|
|
19
|
+
contentHeader: d,
|
|
20
|
+
enableSidebarScroll: F = !0,
|
|
21
|
+
enableContentScroll: n = !1,
|
|
22
|
+
sidebarPosition: l = "left",
|
|
23
|
+
sidebarPadding: f = 1,
|
|
24
24
|
contentPadding: c = 1,
|
|
25
|
-
sidebarHeaderPadding:
|
|
26
|
-
contentHeaderPadding:
|
|
25
|
+
sidebarHeaderPadding: L = 2,
|
|
26
|
+
contentHeaderPadding: C = 2,
|
|
27
|
+
headerHeight: m = "40px"
|
|
27
28
|
}) => {
|
|
28
|
-
const
|
|
29
|
+
const p = /* @__PURE__ */ e.jsxs(
|
|
29
30
|
r,
|
|
30
31
|
{
|
|
31
32
|
sx: {
|
|
32
|
-
width:
|
|
33
|
-
borderRight: !h &&
|
|
34
|
-
borderLeft: !h &&
|
|
33
|
+
width: g,
|
|
34
|
+
borderRight: !h && l === "left" ? 1 : 0,
|
|
35
|
+
borderLeft: !h && l === "right" ? 1 : 0,
|
|
35
36
|
borderColor: "divider",
|
|
36
37
|
display: "flex",
|
|
37
38
|
flexDirection: "column",
|
|
38
39
|
...w
|
|
39
40
|
},
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
t && /* @__PURE__ */ e.jsx(
|
|
43
|
+
r,
|
|
44
|
+
{
|
|
45
|
+
sx: {
|
|
46
|
+
p: L,
|
|
47
|
+
height: m,
|
|
48
|
+
borderBottom: 1,
|
|
49
|
+
borderColor: "divider",
|
|
50
|
+
display: "flex",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
...B
|
|
53
|
+
},
|
|
54
|
+
children: t
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ e.jsx(r, { sx: { flex: 1, minHeight: 0 }, children: F ? /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(r, { sx: { p: f, ...o }, children: x }) }) : /* @__PURE__ */ e.jsx(r, { sx: { p: f, height: "100%", overflow: "hidden", ...o }, children: x }) })
|
|
43
58
|
]
|
|
44
59
|
}
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
), j = /* @__PURE__ */ e.jsxs(r, { sx: { flex: 1, display: "flex", flexDirection: "column", ...y }, height: "100%", children: [
|
|
61
|
+
d && /* @__PURE__ */ e.jsx(
|
|
62
|
+
r,
|
|
63
|
+
{
|
|
64
|
+
sx: {
|
|
65
|
+
p: C,
|
|
66
|
+
height: m,
|
|
67
|
+
borderBottom: 1,
|
|
68
|
+
borderColor: "divider",
|
|
69
|
+
display: "flex",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
...D
|
|
72
|
+
},
|
|
73
|
+
children: d
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ e.jsx(r, { sx: { flex: 1, overflow: n ? "auto" : "hidden" }, children: n ? /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(r, { sx: { p: c, ...s }, children: i }) }) : /* @__PURE__ */ e.jsx(r, { sx: { p: c, height: "100%", ...s }, children: i }) })
|
|
48
77
|
] });
|
|
49
78
|
return /* @__PURE__ */ e.jsx(
|
|
50
|
-
|
|
79
|
+
I,
|
|
51
80
|
{
|
|
52
81
|
sx: {
|
|
53
82
|
height: u,
|
|
@@ -56,12 +85,12 @@ const R = ({
|
|
|
56
85
|
overflow: "hidden",
|
|
57
86
|
...v
|
|
58
87
|
},
|
|
59
|
-
children:
|
|
60
|
-
|
|
61
|
-
m
|
|
62
|
-
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
63
|
-
m,
|
|
88
|
+
children: l === "left" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
89
|
+
p,
|
|
64
90
|
j
|
|
91
|
+
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
92
|
+
j,
|
|
93
|
+
p
|
|
65
94
|
] })
|
|
66
95
|
}
|
|
67
96
|
);
|