@solostylist/ui-kit 1.0.219 → 1.0.221
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-avatar/s-avatar.js +1 -5
- package/dist/s-breadcrumbs/s-breadcrumbs.js +45 -40
- package/dist/s-carousel/index.js +1 -1
- package/dist/s-carousel/s-carousel.js +1 -1
- package/dist/{s-carousel-DhUo-3W-.js → s-carousel-BUJYCigy.js} +15 -31
- package/dist/s-category-card/s-category-card.js +2 -2
- package/dist/s-chat-input/index.js +1 -1
- package/dist/s-chat-input/s-chat-input.js +1 -1
- package/dist/{s-chat-input-DlEMhm6X.js → s-chat-input-B0gdPa1c.js} +106 -101
- package/dist/s-chat-message/index.js +1 -1
- package/dist/s-chat-message/s-chat-message.js +1 -1
- package/dist/{s-chat-message-DeP8O6TO.js → s-chat-message-DVfbqSAQ.js} +27 -28
- package/dist/s-checkbox/s-checkbox.js +2 -1
- package/dist/s-code-block/index.js +1 -1
- package/dist/s-code-block/s-code-block.js +1 -1
- package/dist/{s-code-block-DTzppazr.js → s-code-block-CHIgPLsL.js} +31 -22
- package/dist/s-comment-message/index.js +1 -1
- package/dist/s-comment-message/s-comment-message.js +1 -1
- package/dist/{s-comment-message-C-7IZOqA.js → s-comment-message-DuJPcZFR.js} +2 -6
- package/dist/s-date-picker/index.js +1 -1
- package/dist/s-date-picker/s-date-picker.js +1 -1
- package/dist/{s-date-picker-CKSRNJ_A.js → s-date-picker-Mynq297P.js} +1 -1
- package/dist/s-datetime-picker/index.js +1 -1
- package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
- package/dist/{s-datetime-picker-BlStwMie.js → s-datetime-picker-D78dPyAo.js} +1 -1
- package/dist/s-gallery/s-gallery.js +25 -18
- package/dist/s-image-comparison/s-image-comparison.js +76 -108
- package/dist/s-image-modal/index.js +2 -2
- package/dist/s-image-modal/s-image-modal.js +2 -399
- package/dist/s-image-modal-DxwMFMNS.js +397 -0
- package/dist/s-language-switcher/index.js +1 -1
- package/dist/s-language-switcher/s-language-switcher.js +1 -1
- package/dist/{s-language-switcher-Cg3Gh8_i.js → s-language-switcher-vievp2VS.js} +8 -8
- package/dist/s-link/s-link.js +5 -1
- package/dist/s-nav-item/s-nav-item.js +70 -61
- package/dist/s-nav-item/s-nav-items.js +6 -6
- package/dist/s-review/index.js +1 -1
- package/dist/s-review/s-review.js +1 -1
- package/dist/{s-review-D5_TicCf.js → s-review-Ca6JUgGr.js} +18 -22
- package/dist/s-scroll-to-top/s-scroll-to-top.js +10 -20
- package/dist/s-switch/s-switch.js +2 -1
- package/dist/s-text-editor/s-text-editor.js +34 -26
- package/dist/s-tool-bar/index.js +1 -1
- package/dist/s-tool-bar/s-tool-bar.js +1 -1
- package/dist/s-tool-bar-Du66wRC2.js +455 -0
- package/dist/s-tool-item/s-tool-item.js +8 -5
- package/dist/s-zoom-image/s-zoom-image.js +1 -1
- package/dist/theme/components/chip.js +10 -10
- package/dist/theme/components/components.js +86 -82
- package/dist/theme/components/day-calendar.d.ts +12 -0
- package/dist/theme/components/day-calendar.js +4 -0
- package/dist/theme/components/dialog.d.ts +8 -0
- package/dist/theme/components/dialog.js +5 -1
- package/dist/theme/components/outlined-input.d.ts +1 -0
- package/dist/theme/components/outlined-input.js +1 -0
- package/dist/theme/components/picker-day.d.ts +12 -0
- package/dist/theme/components/picker-day.js +4 -0
- package/dist/theme/components/select.d.ts +4 -0
- package/dist/theme/components/select.js +4 -0
- package/package.json +1 -1
- package/dist/ChevronLeft-rgSvkrT_.js +0 -6
- package/dist/s-tool-bar-DOcT-lNr.js +0 -448
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./createSvgIcon-BdNZIlKS.js";
|
|
2
|
-
import { t } from "./Close-oXeOGTZb.js";
|
|
3
|
-
import { t as n } from "./Download-DMm8oiCF.js";
|
|
4
|
-
import { t as r } from "./InfoOutlined-CqXSSVWh.js";
|
|
5
|
-
import { t as i } from "./s-select-ClL8bygg.js";
|
|
6
|
-
import a, { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
7
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
import { createPortal as f } from "react-dom";
|
|
9
|
-
import { Box as p, Checkbox as m, Dialog as h, DialogContent as g, DialogTitle as _, Divider as v, IconButton as y, Slider as b, TextField as x, Tooltip as S, Typography as C } from "@mui/material";
|
|
10
|
-
//#region ../../node_modules/@mui/icons-material/AddPhotoAlternate.mjs
|
|
11
|
-
var w = e(/* @__PURE__ */ u("path", { 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" }), "AddPhotoAlternate"), T = e(/* @__PURE__ */ u("path", { 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" }), "AutoAwesome"), E = e(/* @__PURE__ */ u("path", { 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" }), "Autorenew"), D = a.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ u(x, {
|
|
12
|
-
value: t,
|
|
13
|
-
onChange: (e) => n(e.target.value),
|
|
14
|
-
onFocus: r,
|
|
15
|
-
onBlur: i,
|
|
16
|
-
placeholder: e.placeholder ?? e.label,
|
|
17
|
-
disabled: a,
|
|
18
|
-
multiline: !0,
|
|
19
|
-
minRows: e.minRows ?? 2,
|
|
20
|
-
maxRows: e.maxRows ?? 5,
|
|
21
|
-
fullWidth: !0,
|
|
22
|
-
...e.componentProps?.textarea ?? {}
|
|
23
|
-
})), O = a.memo((e) => /* @__PURE__ */ u(C, {
|
|
24
|
-
variant: "caption",
|
|
25
|
-
sx: {
|
|
26
|
-
whiteSpace: "nowrap",
|
|
27
|
-
overflow: "hidden",
|
|
28
|
-
textOverflow: "ellipsis",
|
|
29
|
-
width: "100% !important",
|
|
30
|
-
textAlign: "center"
|
|
31
|
-
},
|
|
32
|
-
children: e.label
|
|
33
|
-
})), k = a.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ d(p, {
|
|
34
|
-
sx: {
|
|
35
|
-
width: 120,
|
|
36
|
-
display: "flex",
|
|
37
|
-
flexDirection: "column"
|
|
38
|
-
},
|
|
39
|
-
children: [/* @__PURE__ */ u(O, { label: e.label }), /* @__PURE__ */ u(x, {
|
|
40
|
-
type: "number",
|
|
41
|
-
value: t ?? e.defaultValue ?? 0,
|
|
42
|
-
onChange: (e) => n(Number(e.target.value)),
|
|
43
|
-
onFocus: r,
|
|
44
|
-
onBlur: i,
|
|
45
|
-
disabled: a,
|
|
46
|
-
slotProps: { htmlInput: {
|
|
47
|
-
min: e.min,
|
|
48
|
-
max: e.max,
|
|
49
|
-
step: e.step
|
|
50
|
-
} },
|
|
51
|
-
sx: { "& input": { textAlign: "center" } },
|
|
52
|
-
...e.componentProps?.number ?? {}
|
|
53
|
-
})]
|
|
54
|
-
})), A = a.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: a, disabled: o }) => /* @__PURE__ */ d(p, {
|
|
55
|
-
sx: {
|
|
56
|
-
width: 180,
|
|
57
|
-
display: "flex",
|
|
58
|
-
flexDirection: "column"
|
|
59
|
-
},
|
|
60
|
-
children: [/* @__PURE__ */ u(O, { label: e.label }), /* @__PURE__ */ u(i, {
|
|
61
|
-
value: t ?? e.defaultValue ?? "",
|
|
62
|
-
onChange: (e) => n(e.target.value),
|
|
63
|
-
onFocus: r,
|
|
64
|
-
onBlur: a,
|
|
65
|
-
disabled: o,
|
|
66
|
-
placeholder: e.placeholder,
|
|
67
|
-
options: e.options ?? [],
|
|
68
|
-
optionLabel: e.optionLabel,
|
|
69
|
-
optionValue: e.optionValue,
|
|
70
|
-
searchable: e.searchable,
|
|
71
|
-
searchPlaceholder: e.searchPlaceholder,
|
|
72
|
-
...e.componentProps?.select ?? {}
|
|
73
|
-
})]
|
|
74
|
-
})), j = a.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ d(p, {
|
|
75
|
-
sx: {
|
|
76
|
-
width: 160,
|
|
77
|
-
display: "flex",
|
|
78
|
-
flexDirection: "column"
|
|
79
|
-
},
|
|
80
|
-
children: [/* @__PURE__ */ u(O, { label: e.label }), /* @__PURE__ */ d(p, {
|
|
81
|
-
sx: {
|
|
82
|
-
display: "flex",
|
|
83
|
-
alignItems: "center",
|
|
84
|
-
height: 36
|
|
85
|
-
},
|
|
86
|
-
children: [/* @__PURE__ */ u(b, {
|
|
87
|
-
value: t ?? e.defaultValue ?? e.min ?? 0,
|
|
88
|
-
onChange: (e, t) => n(t),
|
|
89
|
-
onMouseDown: r,
|
|
90
|
-
onMouseUp: i,
|
|
91
|
-
disabled: a,
|
|
92
|
-
min: e.min ?? 0,
|
|
93
|
-
max: e.max ?? 100,
|
|
94
|
-
step: e.step ?? 1,
|
|
95
|
-
sx: { flex: 1 },
|
|
96
|
-
...e.componentProps?.slider ?? {}
|
|
97
|
-
}), /* @__PURE__ */ u(p, {
|
|
98
|
-
sx: {
|
|
99
|
-
minWidth: 60,
|
|
100
|
-
textAlign: "center",
|
|
101
|
-
fontWeight: 500,
|
|
102
|
-
fontSize: "0.875rem"
|
|
103
|
-
},
|
|
104
|
-
children: t ?? e.defaultValue ?? e.min ?? 0
|
|
105
|
-
})]
|
|
106
|
-
})]
|
|
107
|
-
})), M = a.memo(({ input: e, value: n, onChange: r, disabled: i }) => {
|
|
108
|
-
let o = a.useRef(null), [c, l] = a.useState([]), [f, m] = a.useState(null), h = e.multiple ?? !1, g = e.maxImages ?? 5;
|
|
109
|
-
s(() => {
|
|
110
|
-
let e = [];
|
|
111
|
-
return l(((t) => {
|
|
112
|
-
if (!t) return [];
|
|
113
|
-
let n = Array.isArray(t) ? t : [t], r = [], i = /* @__PURE__ */ new Map();
|
|
114
|
-
return n.forEach((t) => {
|
|
115
|
-
if (t instanceof File) {
|
|
116
|
-
let n = URL.createObjectURL(t);
|
|
117
|
-
e.push(n);
|
|
118
|
-
let a = `file:${t.name}:${t.size}:${t.lastModified}`, o = i.get(a) ?? 0;
|
|
119
|
-
i.set(a, o + 1), r.push({
|
|
120
|
-
key: o > 0 ? `${a}:${o}` : a,
|
|
121
|
-
src: n
|
|
122
|
-
});
|
|
123
|
-
} else if (typeof t == "string") {
|
|
124
|
-
let e = `url:${t}`, n = i.get(e) ?? 0;
|
|
125
|
-
i.set(e, n + 1), r.push({
|
|
126
|
-
key: n > 0 ? `${e}:${n}` : e,
|
|
127
|
-
src: t
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}), r;
|
|
131
|
-
})(n)), () => {
|
|
132
|
-
e.forEach((e) => URL.revokeObjectURL(e));
|
|
133
|
-
};
|
|
134
|
-
}, [n]);
|
|
135
|
-
let _ = (e) => {
|
|
136
|
-
let t = e.target.files;
|
|
137
|
-
if (!(!t || t.length === 0)) {
|
|
138
|
-
if (h) {
|
|
139
|
-
let e = F(n), i = Array.from(t).slice(0, g - e.length);
|
|
140
|
-
r([...e, ...i]);
|
|
141
|
-
} else r(t[0]);
|
|
142
|
-
e.target.value = "";
|
|
143
|
-
}
|
|
144
|
-
}, v = (e, t) => {
|
|
145
|
-
if (e.stopPropagation(), h && Array.isArray(n)) {
|
|
146
|
-
let e = n.filter((e, n) => n !== t);
|
|
147
|
-
r(e.length > 0 ? e : null);
|
|
148
|
-
} else r(null);
|
|
149
|
-
}, b = () => {
|
|
150
|
-
i || h && c.length >= g || o.current?.click();
|
|
151
|
-
}, x = h && c.length < g;
|
|
152
|
-
return /* @__PURE__ */ d(p, {
|
|
153
|
-
sx: {
|
|
154
|
-
display: "flex",
|
|
155
|
-
alignItems: "center",
|
|
156
|
-
gap: .75
|
|
157
|
-
},
|
|
158
|
-
children: [
|
|
159
|
-
/* @__PURE__ */ u("input", {
|
|
160
|
-
ref: o,
|
|
161
|
-
type: "file",
|
|
162
|
-
accept: "image/*",
|
|
163
|
-
multiple: h,
|
|
164
|
-
onChange: _,
|
|
165
|
-
disabled: i,
|
|
166
|
-
style: { display: "none" },
|
|
167
|
-
...e.componentProps?.image ?? {}
|
|
168
|
-
}),
|
|
169
|
-
c.map((e, n) => /* @__PURE__ */ d(p, {
|
|
170
|
-
onMouseEnter: () => m(n),
|
|
171
|
-
onMouseLeave: () => m(null),
|
|
172
|
-
sx: {
|
|
173
|
-
width: 50,
|
|
174
|
-
height: 50,
|
|
175
|
-
border: 1,
|
|
176
|
-
borderColor: i ? "action.disabled" : "divider",
|
|
177
|
-
borderRadius: 1,
|
|
178
|
-
display: "flex",
|
|
179
|
-
alignItems: "center",
|
|
180
|
-
justifyContent: "center",
|
|
181
|
-
cursor: i ? "not-allowed" : "default",
|
|
182
|
-
position: "relative",
|
|
183
|
-
overflow: "hidden",
|
|
184
|
-
transition: "all 0.2s"
|
|
185
|
-
},
|
|
186
|
-
children: [/* @__PURE__ */ u(p, {
|
|
187
|
-
component: "img",
|
|
188
|
-
src: e.src,
|
|
189
|
-
alt: `Preview ${n + 1}`,
|
|
190
|
-
sx: {
|
|
191
|
-
width: "100%",
|
|
192
|
-
height: "100%",
|
|
193
|
-
objectFit: "cover"
|
|
194
|
-
}
|
|
195
|
-
}), !i && f === n && /* @__PURE__ */ u(p, {
|
|
196
|
-
onClick: (e) => v(e, n),
|
|
197
|
-
sx: {
|
|
198
|
-
position: "absolute",
|
|
199
|
-
top: 0,
|
|
200
|
-
left: 0,
|
|
201
|
-
right: 0,
|
|
202
|
-
bottom: 0,
|
|
203
|
-
display: "flex",
|
|
204
|
-
alignItems: "center",
|
|
205
|
-
justifyContent: "center"
|
|
206
|
-
},
|
|
207
|
-
children: /* @__PURE__ */ u(y, {
|
|
208
|
-
onClick: (e) => v(e, n),
|
|
209
|
-
children: /* @__PURE__ */ u(t, {})
|
|
210
|
-
})
|
|
211
|
-
})]
|
|
212
|
-
}, e.key)),
|
|
213
|
-
(c.length === 0 || x) && /* @__PURE__ */ u(p, {
|
|
214
|
-
onClick: b,
|
|
215
|
-
sx: {
|
|
216
|
-
width: 50,
|
|
217
|
-
height: 50,
|
|
218
|
-
border: 1,
|
|
219
|
-
borderColor: i ? "action.disabled" : "divider",
|
|
220
|
-
borderRadius: 1,
|
|
221
|
-
display: "flex",
|
|
222
|
-
alignItems: "center",
|
|
223
|
-
justifyContent: "center",
|
|
224
|
-
cursor: i ? "not-allowed" : "pointer",
|
|
225
|
-
transition: "all 0.2s",
|
|
226
|
-
"&:hover": { bgcolor: "action.hover" }
|
|
227
|
-
},
|
|
228
|
-
children: /* @__PURE__ */ u(w, { sx: {
|
|
229
|
-
fontSize: 20,
|
|
230
|
-
color: i ? "action.disabled" : "divider"
|
|
231
|
-
} })
|
|
232
|
-
})
|
|
233
|
-
]
|
|
234
|
-
});
|
|
235
|
-
}), N = a.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ d(p, {
|
|
236
|
-
sx: {
|
|
237
|
-
display: "flex",
|
|
238
|
-
flexDirection: "column",
|
|
239
|
-
alignItems: "center",
|
|
240
|
-
minWidth: 60
|
|
241
|
-
},
|
|
242
|
-
children: [/* @__PURE__ */ u(O, { label: e.label }), /* @__PURE__ */ u(m, {
|
|
243
|
-
checked: t ?? e.defaultValue ?? !1,
|
|
244
|
-
onChange: (e) => n(e.target.checked),
|
|
245
|
-
onFocus: r,
|
|
246
|
-
onBlur: i,
|
|
247
|
-
disabled: a,
|
|
248
|
-
...e.componentProps?.checkbox ?? {}
|
|
249
|
-
})]
|
|
250
|
-
}));
|
|
251
|
-
function P(e, t) {
|
|
252
|
-
return e.required ? e.type === "textarea" ? typeof t == "string" && t.trim() !== "" : e.type === "number" || e.type === "slider" ? t != null : e.type === "select" ? t != null && t !== "" : !0 : !0;
|
|
253
|
-
}
|
|
254
|
-
function F(e) {
|
|
255
|
-
return Array.isArray(e) ? e : e instanceof File || typeof e == "string" ? [e] : [];
|
|
256
|
-
}
|
|
257
|
-
function I(e) {
|
|
258
|
-
return e.reduce((e, t) => (t.type === "image" ? e.imageInputs.push(t) : t.type === "textarea" ? e.textareaInputs.push(t) : e.paramInputs.push(t), e), {
|
|
259
|
-
imageInputs: [],
|
|
260
|
-
textareaInputs: [],
|
|
261
|
-
paramInputs: []
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
function L(e, t) {
|
|
265
|
-
return e.length > 0 || t.length > 0;
|
|
266
|
-
}
|
|
267
|
-
function R(e, t, n, r) {
|
|
268
|
-
return e || !t || n || r;
|
|
269
|
-
}
|
|
270
|
-
var z = (e) => {
|
|
271
|
-
switch (e.input.type) {
|
|
272
|
-
case "textarea": return /* @__PURE__ */ u(D, { ...e });
|
|
273
|
-
case "number": return /* @__PURE__ */ u(k, { ...e });
|
|
274
|
-
case "slider": return /* @__PURE__ */ u(j, { ...e });
|
|
275
|
-
case "select": return /* @__PURE__ */ u(A, { ...e });
|
|
276
|
-
case "image": return /* @__PURE__ */ u(M, {
|
|
277
|
-
input: e.input,
|
|
278
|
-
value: e.value,
|
|
279
|
-
onChange: e.onChange,
|
|
280
|
-
disabled: e.disabled
|
|
281
|
-
});
|
|
282
|
-
case "checkbox": return /* @__PURE__ */ u(N, { ...e });
|
|
283
|
-
default: return null;
|
|
284
|
-
}
|
|
285
|
-
}, B = a.memo(({ input: e, value: t, disabled: n, onChange: r, onFocus: i, onBlur: a }) => e.renderInput ? /* @__PURE__ */ u(p, { children: e.renderInput({
|
|
286
|
-
value: t,
|
|
287
|
-
onChange: r,
|
|
288
|
-
onFocus: i,
|
|
289
|
-
onBlur: a,
|
|
290
|
-
disabled: n
|
|
291
|
-
}) }) : /* @__PURE__ */ u(z, {
|
|
292
|
-
input: e,
|
|
293
|
-
value: t,
|
|
294
|
-
onChange: r,
|
|
295
|
-
onFocus: i,
|
|
296
|
-
onBlur: a,
|
|
297
|
-
disabled: n
|
|
298
|
-
})), V = a.memo(({ customActionButtons: e, infoContent: t, infoTooltip: i, downloadTooltip: a, resetTooltip: o, processTooltip: s, hideProcessButton: c, processActionDisabled: l, onInfoOpen: f, onDownload: m, onReset: h, onProcess: g }) => /* @__PURE__ */ d(p, {
|
|
299
|
-
sx: {
|
|
300
|
-
display: "flex",
|
|
301
|
-
alignItems: "center",
|
|
302
|
-
gap: .75,
|
|
303
|
-
ml: "auto"
|
|
304
|
-
},
|
|
305
|
-
children: [
|
|
306
|
-
e,
|
|
307
|
-
t && /* @__PURE__ */ u(S, {
|
|
308
|
-
title: i,
|
|
309
|
-
children: /* @__PURE__ */ u(y, {
|
|
310
|
-
onClick: f,
|
|
311
|
-
children: /* @__PURE__ */ u(r, {})
|
|
312
|
-
})
|
|
313
|
-
}),
|
|
314
|
-
/* @__PURE__ */ u(S, {
|
|
315
|
-
title: a,
|
|
316
|
-
children: /* @__PURE__ */ u(y, {
|
|
317
|
-
onClick: m,
|
|
318
|
-
children: /* @__PURE__ */ u(n, {})
|
|
319
|
-
})
|
|
320
|
-
}),
|
|
321
|
-
/* @__PURE__ */ u(S, {
|
|
322
|
-
title: o,
|
|
323
|
-
children: /* @__PURE__ */ u(y, {
|
|
324
|
-
onClick: h,
|
|
325
|
-
children: /* @__PURE__ */ u(E, {})
|
|
326
|
-
})
|
|
327
|
-
}),
|
|
328
|
-
!c && /* @__PURE__ */ u(S, {
|
|
329
|
-
title: s,
|
|
330
|
-
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(y, {
|
|
331
|
-
onClick: g,
|
|
332
|
-
disabled: l,
|
|
333
|
-
size: "large",
|
|
334
|
-
children: /* @__PURE__ */ u(T, { color: l ? "disabled" : "primary" })
|
|
335
|
-
}) })
|
|
336
|
-
})
|
|
337
|
-
]
|
|
338
|
-
})), H = ({ inputs: e = [], onProcess: t, onReset: n, onDownload: r, processing: i = !1, uploading: a = !1, inputValues: s = {}, onInputChange: m, customActionButtons: y, hideProcessButton: b = !1, processButtonDisabled: x = !1, getInputDisabled: S, processTooltip: C = "Process", downloadTooltip: w = "Download", resetTooltip: T = "Reset", infoTooltip: E = "Information", infoTitle: D = "Tool Information", infoContent: O, position: k = "bottom", relative: A = !1, containerSx: j, sx: M }) => {
|
|
339
|
-
let [N, F] = l(!1), z = c(() => e.length === 0 ? !0 : e.every((e) => P(e, s[e.key])), [e, s]), { imageInputs: H, textareaInputs: U, paramInputs: W } = c(() => I(e), [e]), G = L(H, W), K = R(x, z, a, i), q = o(() => {}, []), J = o(() => {}, []), Y = o((e, t, n) => {
|
|
340
|
-
m?.(e, t, n);
|
|
341
|
-
}, [m]), X = o(() => F(!0), []), Z = o(() => F(!1), []), Q = o((e) => {
|
|
342
|
-
let t = s[e.key];
|
|
343
|
-
return /* @__PURE__ */ u(B, {
|
|
344
|
-
input: e,
|
|
345
|
-
value: t,
|
|
346
|
-
onChange: (t) => Y(e.key, t),
|
|
347
|
-
onFocus: q,
|
|
348
|
-
onBlur: J,
|
|
349
|
-
disabled: S?.(e.key) ?? !1
|
|
350
|
-
}, e.key);
|
|
351
|
-
}, [
|
|
352
|
-
s,
|
|
353
|
-
S,
|
|
354
|
-
Y,
|
|
355
|
-
q,
|
|
356
|
-
J
|
|
357
|
-
]), $ = /* @__PURE__ */ d(p, {
|
|
358
|
-
sx: {
|
|
359
|
-
position: A ? "relative" : "fixed",
|
|
360
|
-
[k]: A ? "auto" : 20,
|
|
361
|
-
left: A ? "auto" : "50%",
|
|
362
|
-
transform: A ? "none" : "translateX(-50%)",
|
|
363
|
-
zIndex: A ? "auto" : 1300,
|
|
364
|
-
display: A ? "flex" : "block",
|
|
365
|
-
justifyContent: A ? "center" : "initial",
|
|
366
|
-
mt: A && k === "top" ? 2 : 0,
|
|
367
|
-
mb: A && k === "bottom" ? 2 : 0,
|
|
368
|
-
...j
|
|
369
|
-
},
|
|
370
|
-
children: [/* @__PURE__ */ d(p, {
|
|
371
|
-
sx: {
|
|
372
|
-
display: "flex",
|
|
373
|
-
flexDirection: "column",
|
|
374
|
-
gap: 2,
|
|
375
|
-
p: 2,
|
|
376
|
-
borderRadius: 2,
|
|
377
|
-
border: 1,
|
|
378
|
-
borderColor: "divider",
|
|
379
|
-
bgcolor: "background.default",
|
|
380
|
-
...M
|
|
381
|
-
},
|
|
382
|
-
children: [U.length > 0 && /* @__PURE__ */ u(p, {
|
|
383
|
-
sx: {
|
|
384
|
-
display: "flex",
|
|
385
|
-
flexDirection: "column",
|
|
386
|
-
gap: 2
|
|
387
|
-
},
|
|
388
|
-
children: U.map(Q)
|
|
389
|
-
}), /* @__PURE__ */ d(p, {
|
|
390
|
-
sx: {
|
|
391
|
-
display: "flex",
|
|
392
|
-
alignItems: "center",
|
|
393
|
-
gap: .5
|
|
394
|
-
},
|
|
395
|
-
children: [
|
|
396
|
-
/* @__PURE__ */ u(p, {
|
|
397
|
-
sx: {
|
|
398
|
-
display: "flex",
|
|
399
|
-
alignItems: "center",
|
|
400
|
-
gap: 2,
|
|
401
|
-
flex: 1
|
|
402
|
-
},
|
|
403
|
-
children: G && /* @__PURE__ */ d(p, {
|
|
404
|
-
sx: {
|
|
405
|
-
display: "flex",
|
|
406
|
-
alignItems: "flex-end",
|
|
407
|
-
gap: 1.5
|
|
408
|
-
},
|
|
409
|
-
children: [H.map(Q), W.map(Q)]
|
|
410
|
-
})
|
|
411
|
-
}),
|
|
412
|
-
G && /* @__PURE__ */ u(v, {
|
|
413
|
-
orientation: "vertical",
|
|
414
|
-
flexItem: !0,
|
|
415
|
-
sx: {
|
|
416
|
-
mx: .5,
|
|
417
|
-
flexShrink: 0
|
|
418
|
-
}
|
|
419
|
-
}),
|
|
420
|
-
/* @__PURE__ */ u(V, {
|
|
421
|
-
customActionButtons: y,
|
|
422
|
-
infoContent: O,
|
|
423
|
-
infoTooltip: E,
|
|
424
|
-
downloadTooltip: w,
|
|
425
|
-
resetTooltip: T,
|
|
426
|
-
processTooltip: C,
|
|
427
|
-
hideProcessButton: b,
|
|
428
|
-
processActionDisabled: K,
|
|
429
|
-
onInfoOpen: X,
|
|
430
|
-
onDownload: r,
|
|
431
|
-
onReset: n,
|
|
432
|
-
onProcess: t
|
|
433
|
-
})
|
|
434
|
-
]
|
|
435
|
-
})]
|
|
436
|
-
}), O && /* @__PURE__ */ d(h, {
|
|
437
|
-
open: N,
|
|
438
|
-
onClose: Z,
|
|
439
|
-
maxWidth: "sm",
|
|
440
|
-
fullWidth: !0,
|
|
441
|
-
children: [/* @__PURE__ */ u(_, { children: D }), /* @__PURE__ */ u(g, { children: O })]
|
|
442
|
-
})]
|
|
443
|
-
});
|
|
444
|
-
return !A && typeof window < "u" ? f($, document.body) : $;
|
|
445
|
-
};
|
|
446
|
-
H.displayName = "SToolBar";
|
|
447
|
-
//#endregion
|
|
448
|
-
export { H as t };
|