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