@solostylist/ui-kit 1.0.223 → 1.0.224
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/{checkbox-PlpiwQNi.js → checkbox-B95Vlykq.js} +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/{use-count-down.d.ts → use-countdown.d.ts} +8 -8
- package/dist/hooks/{use-count-down.js → use-countdown.js} +1 -1
- 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-DpCaY6gB.js → s-chat-input-DKGeMh55.js} +98 -98
- package/dist/s-countdown/index.d.ts +2 -2
- package/dist/s-countdown/index.js +1 -1
- package/dist/s-countdown/{s-count-down.d.ts → s-countdown.d.ts} +17 -17
- package/dist/s-countdown/{s-count-down.js → s-countdown.js} +2 -2
- package/dist/s-data-table/index.js +1 -1
- package/dist/s-data-table/s-data-table.js +1 -1
- package/dist/{s-data-table-Cb7CsYQf.js → s-data-table-TrCdKq9r.js} +12 -12
- 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-BkZIEZoz.js +634 -0
- 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-D78dPyAo.js → s-datetime-picker-rCWovez1.js} +394 -394
- package/dist/s-dialog-confirm/s-dialog-confirm.js +0 -1
- package/dist/s-glow-button/s-glow-button.d.ts +1 -1
- package/dist/s-glow-button/s-glow-button.js +18 -19
- package/dist/s-nav-item/index.d.ts +0 -1
- package/dist/s-nav-item/index.js +1 -2
- package/dist/s-nav-items/index.d.ts +2 -0
- package/dist/s-nav-items/index.js +2 -0
- package/dist/{s-nav-item → s-nav-items}/s-nav-items.d.ts +1 -1
- package/dist/{s-nav-item → s-nav-items}/s-nav-items.js +3 -3
- package/dist/s-pixel-reveal/s-pixel-reveal.d.ts +1 -1
- package/dist/s-pixel-reveal/s-pixel-reveal.js +74 -69
- package/dist/s-text-editor/s-text-editor.js +30 -31
- package/dist/s-theme-provider/s-theme-provider.d.ts +3 -3
- package/dist/s-theme-provider/s-theme-provider.js +32 -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-B-v1I_Hy.js → s-tool-bar-DGfyNoYW.js} +142 -143
- package/dist/theme/components/accordion-summary.d.ts +385 -385
- package/dist/theme/components/accordion-summary.js +1 -1
- package/dist/theme/components/accordion.d.ts +2 -2
- package/dist/theme/components/alert.d.ts +1524 -1524
- package/dist/theme/components/alert.js +15 -22
- package/dist/theme/components/app-bar.d.ts +2 -2
- package/dist/theme/components/button.d.ts +2282 -2282
- package/dist/theme/components/button.js +40 -42
- package/dist/theme/components/card.d.ts +767 -767
- package/dist/theme/components/card.js +1 -1
- package/dist/theme/components/checkbox.d.ts +381 -381
- package/dist/theme/components/checkbox.js +1 -1
- package/dist/theme/components/chip.js +65 -52
- package/dist/theme/components/components.js +3 -3
- package/dist/theme/components/form-label.d.ts +2 -2
- package/dist/theme/components/icon-button.d.ts +2294 -2294
- package/dist/theme/components/icon-button.js +31 -29
- package/dist/theme/components/linear-progress.d.ts +382 -382
- package/dist/theme/components/linear-progress.js +1 -1
- package/dist/theme/components/link.d.ts +2 -2
- package/dist/theme/components/link.js +1 -1
- package/dist/theme/components/list-item-button.d.ts +2 -2
- package/dist/theme/components/list-item.d.ts +2 -2
- package/dist/theme/components/outlined-input.js +1 -1
- package/dist/theme/components/pagination-item.d.ts +385 -385
- package/dist/theme/components/step-icon.d.ts +383 -383
- package/dist/theme/components/step-icon.js +1 -1
- package/dist/theme/components/step-label.d.ts +384 -384
- package/dist/theme/components/tab.d.ts +384 -384
- package/dist/theme/components/tabs.d.ts +386 -386
- package/dist/theme/components/toggle-button-group.d.ts +383 -383
- package/dist/theme/components/toggle-button-group.js +1 -1
- package/dist/theme/components/toggle-button.d.ts +385 -385
- package/dist/theme/components/toggle-button.js +1 -1
- package/dist/theme/theme-primitives.d.ts +132 -0
- package/dist/theme/theme-primitives.js +1 -1
- package/dist/theme/utils.d.ts +11 -0
- package/dist/theme/utils.js +4 -0
- package/dist/{theme-primitives-OrQ-xFJR.js → theme-primitives-D2vHHGiX.js} +34 -10
- package/dist/{toggle-button-BgpxYWVw.js → toggle-button-BUsRxHn0.js} +1 -1
- package/dist/{toggle-button-group-l4hL1DLP.js → toggle-button-group-ABwIhV4P.js} +1 -1
- package/package.json +1 -1
- package/dist/s-date-picker-Mynq297P.js +0 -634
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { createPortal as
|
|
10
|
-
import { Box as
|
|
1
|
+
import { tint as e } from "./theme/utils.js";
|
|
2
|
+
import { t } from "./createSvgIcon-BdNZIlKS.js";
|
|
3
|
+
import { t as n } from "./Close-Bj2HYB9Q.js";
|
|
4
|
+
import { t as r } from "./Download-BhSXOhCI.js";
|
|
5
|
+
import { t as i } from "./InfoOutlined-C1AW3f5V.js";
|
|
6
|
+
import { t as a } from "./s-select-b8CHbeCf.js";
|
|
7
|
+
import o, { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as p } from "react-dom";
|
|
10
|
+
import { Box as m, Checkbox as h, Dialog as g, DialogContent as _, DialogTitle as v, Divider as y, IconButton as b, Slider as x, TextField as S, Tooltip as C, Typography as w } from "@mui/material";
|
|
11
11
|
//#region ../../node_modules/@mui/icons-material/AddPhotoAlternate.mjs
|
|
12
|
-
var
|
|
12
|
+
var T = t(/* @__PURE__ */ d("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"), E = t(/* @__PURE__ */ d("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"), D = t(/* @__PURE__ */ d("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"), O = o.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ d(S, {
|
|
13
13
|
value: t,
|
|
14
14
|
onChange: (e) => n(e.target.value),
|
|
15
15
|
onFocus: r,
|
|
@@ -21,7 +21,7 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
21
21
|
maxRows: e.maxRows ?? 5,
|
|
22
22
|
fullWidth: !0,
|
|
23
23
|
...e.componentProps?.textarea ?? {}
|
|
24
|
-
})),
|
|
24
|
+
})), k = o.memo((e) => /* @__PURE__ */ d(w, {
|
|
25
25
|
variant: "caption",
|
|
26
26
|
sx: {
|
|
27
27
|
whiteSpace: "nowrap",
|
|
@@ -31,13 +31,13 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
31
31
|
textAlign: "center"
|
|
32
32
|
},
|
|
33
33
|
children: e.label
|
|
34
|
-
})),
|
|
34
|
+
})), A = o.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ f(m, {
|
|
35
35
|
sx: {
|
|
36
36
|
width: 120,
|
|
37
37
|
display: "flex",
|
|
38
38
|
flexDirection: "column"
|
|
39
39
|
},
|
|
40
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ d(k, { label: e.label }), /* @__PURE__ */ d(S, {
|
|
41
41
|
type: "number",
|
|
42
42
|
value: t ?? e.defaultValue ?? 0,
|
|
43
43
|
onChange: (e) => n(Number(e.target.value)),
|
|
@@ -52,18 +52,18 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
52
52
|
sx: { "& input": { textAlign: "center" } },
|
|
53
53
|
...e.componentProps?.number ?? {}
|
|
54
54
|
})]
|
|
55
|
-
})),
|
|
55
|
+
})), j = o.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: o }) => /* @__PURE__ */ f(m, {
|
|
56
56
|
sx: {
|
|
57
57
|
width: 180,
|
|
58
58
|
display: "flex",
|
|
59
59
|
flexDirection: "column"
|
|
60
60
|
},
|
|
61
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ d(k, { label: e.label }), /* @__PURE__ */ d(a, {
|
|
62
62
|
value: t ?? e.defaultValue ?? "",
|
|
63
63
|
onChange: (e) => n(e.target.value),
|
|
64
64
|
onFocus: r,
|
|
65
65
|
onBlur: i,
|
|
66
|
-
disabled:
|
|
66
|
+
disabled: o,
|
|
67
67
|
placeholder: e.placeholder,
|
|
68
68
|
options: e.options ?? [],
|
|
69
69
|
optionLabel: e.optionLabel,
|
|
@@ -72,19 +72,19 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
72
72
|
searchPlaceholder: e.searchPlaceholder,
|
|
73
73
|
...e.componentProps?.select ?? {}
|
|
74
74
|
})]
|
|
75
|
-
})),
|
|
75
|
+
})), M = o.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ f(m, {
|
|
76
76
|
sx: {
|
|
77
77
|
width: 160,
|
|
78
78
|
display: "flex",
|
|
79
79
|
flexDirection: "column"
|
|
80
80
|
},
|
|
81
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ d(k, { label: e.label }), /* @__PURE__ */ f(m, {
|
|
82
82
|
sx: {
|
|
83
83
|
display: "flex",
|
|
84
84
|
alignItems: "center",
|
|
85
85
|
height: 36
|
|
86
86
|
},
|
|
87
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ d(x, {
|
|
88
88
|
value: t ?? e.defaultValue ?? e.min ?? 0,
|
|
89
89
|
onChange: (e, t) => n(t),
|
|
90
90
|
onMouseDown: r,
|
|
@@ -95,7 +95,7 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
95
95
|
step: e.step ?? 1,
|
|
96
96
|
sx: { flex: 1 },
|
|
97
97
|
...e.componentProps?.slider ?? {}
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ d(m, {
|
|
99
99
|
sx: {
|
|
100
100
|
minWidth: 60,
|
|
101
101
|
textAlign: "center",
|
|
@@ -105,11 +105,11 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
105
105
|
children: t ?? e.defaultValue ?? e.min ?? 0
|
|
106
106
|
})]
|
|
107
107
|
})]
|
|
108
|
-
})),
|
|
109
|
-
let a =
|
|
110
|
-
|
|
108
|
+
})), N = o.memo(({ input: e, value: t, onChange: r, disabled: i }) => {
|
|
109
|
+
let a = o.useRef(null), [s, l] = o.useState([]), [u, p] = o.useState(null), h = e.multiple ?? !1, g = e.maxImages ?? 5;
|
|
110
|
+
c(() => {
|
|
111
111
|
let e = [];
|
|
112
|
-
return
|
|
112
|
+
return l(((t) => {
|
|
113
113
|
if (!t) return [];
|
|
114
114
|
let n = Array.isArray(t) ? t : [t], r = [], i = /* @__PURE__ */ new Map();
|
|
115
115
|
return n.forEach((t) => {
|
|
@@ -134,42 +134,42 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
134
134
|
};
|
|
135
135
|
}, [t]);
|
|
136
136
|
let _ = (e) => {
|
|
137
|
-
let
|
|
138
|
-
if (!(!
|
|
139
|
-
if (
|
|
140
|
-
let e =
|
|
141
|
-
|
|
142
|
-
} else n
|
|
137
|
+
let n = e.target.files;
|
|
138
|
+
if (!(!n || n.length === 0)) {
|
|
139
|
+
if (h) {
|
|
140
|
+
let e = I(t), i = Array.from(n).slice(0, g - e.length);
|
|
141
|
+
r([...e, ...i]);
|
|
142
|
+
} else r(n[0]);
|
|
143
143
|
e.target.value = "";
|
|
144
144
|
}
|
|
145
|
-
}, v = (e,
|
|
146
|
-
if (e.stopPropagation(),
|
|
147
|
-
let e = t.filter((e, t) => t !==
|
|
148
|
-
|
|
149
|
-
} else
|
|
145
|
+
}, v = (e, n) => {
|
|
146
|
+
if (e.stopPropagation(), h && Array.isArray(t)) {
|
|
147
|
+
let e = t.filter((e, t) => t !== n);
|
|
148
|
+
r(e.length > 0 ? e : null);
|
|
149
|
+
} else r(null);
|
|
150
150
|
}, y = () => {
|
|
151
|
-
i ||
|
|
152
|
-
},
|
|
153
|
-
return /* @__PURE__ */
|
|
151
|
+
i || h && s.length >= g || a.current?.click();
|
|
152
|
+
}, x = h && s.length < g;
|
|
153
|
+
return /* @__PURE__ */ f(m, {
|
|
154
154
|
sx: {
|
|
155
155
|
display: "flex",
|
|
156
156
|
alignItems: "center",
|
|
157
157
|
gap: .75
|
|
158
158
|
},
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ d("input", {
|
|
161
161
|
ref: a,
|
|
162
162
|
type: "file",
|
|
163
163
|
accept: "image/*",
|
|
164
|
-
multiple:
|
|
164
|
+
multiple: h,
|
|
165
165
|
onChange: _,
|
|
166
166
|
disabled: i,
|
|
167
167
|
style: { display: "none" },
|
|
168
168
|
...e.componentProps?.image ?? {}
|
|
169
169
|
}),
|
|
170
|
-
|
|
171
|
-
onMouseEnter: () =>
|
|
172
|
-
onMouseLeave: () =>
|
|
170
|
+
s.map((e, t) => /* @__PURE__ */ f(m, {
|
|
171
|
+
onMouseEnter: () => p(t),
|
|
172
|
+
onMouseLeave: () => p(null),
|
|
173
173
|
sx: {
|
|
174
174
|
width: 50,
|
|
175
175
|
height: 50,
|
|
@@ -184,7 +184,7 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
184
184
|
overflow: "hidden",
|
|
185
185
|
transition: "all 0.2s"
|
|
186
186
|
},
|
|
187
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ d(m, {
|
|
188
188
|
component: "img",
|
|
189
189
|
src: e.src,
|
|
190
190
|
alt: `Preview ${t + 1}`,
|
|
@@ -193,7 +193,7 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
193
193
|
height: "100%",
|
|
194
194
|
objectFit: "cover"
|
|
195
195
|
}
|
|
196
|
-
}), !i && u === t && /* @__PURE__ */
|
|
196
|
+
}), !i && u === t && /* @__PURE__ */ d(m, {
|
|
197
197
|
onClick: (e) => v(e, t),
|
|
198
198
|
sx: {
|
|
199
199
|
position: "absolute",
|
|
@@ -205,13 +205,13 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
205
205
|
alignItems: "center",
|
|
206
206
|
justifyContent: "center"
|
|
207
207
|
},
|
|
208
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ d(b, {
|
|
209
209
|
onClick: (e) => v(e, t),
|
|
210
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ d(n, {})
|
|
211
211
|
})
|
|
212
212
|
})]
|
|
213
213
|
}, e.key)),
|
|
214
|
-
(
|
|
214
|
+
(s.length === 0 || x) && /* @__PURE__ */ d(m, {
|
|
215
215
|
onClick: y,
|
|
216
216
|
sx: {
|
|
217
217
|
width: 50,
|
|
@@ -226,21 +226,21 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
226
226
|
transition: "all 0.2s",
|
|
227
227
|
"&:hover": { bgcolor: "action.hover" }
|
|
228
228
|
},
|
|
229
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ d(T, { sx: {
|
|
230
230
|
fontSize: 20,
|
|
231
231
|
color: i ? "action.disabled" : "divider"
|
|
232
232
|
} })
|
|
233
233
|
})
|
|
234
234
|
]
|
|
235
235
|
});
|
|
236
|
-
}),
|
|
236
|
+
}), P = o.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: i, disabled: a }) => /* @__PURE__ */ f(m, {
|
|
237
237
|
sx: {
|
|
238
238
|
display: "flex",
|
|
239
239
|
flexDirection: "column",
|
|
240
240
|
alignItems: "center",
|
|
241
241
|
minWidth: 60
|
|
242
242
|
},
|
|
243
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ d(k, { label: e.label }), /* @__PURE__ */ d(h, {
|
|
244
244
|
checked: t ?? e.defaultValue ?? !1,
|
|
245
245
|
onChange: (e) => n(e.target.checked),
|
|
246
246
|
onFocus: r,
|
|
@@ -249,54 +249,54 @@ var D = n(/* @__PURE__ */ f("path", { d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99
|
|
|
249
249
|
...e.componentProps?.checkbox ?? {}
|
|
250
250
|
})]
|
|
251
251
|
}));
|
|
252
|
-
function
|
|
252
|
+
function F(e, t) {
|
|
253
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
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function I(e) {
|
|
256
256
|
return Array.isArray(e) ? e : e instanceof File || typeof e == "string" ? [e] : [];
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function L(e) {
|
|
259
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
260
|
imageInputs: [],
|
|
261
261
|
textareaInputs: [],
|
|
262
262
|
paramInputs: []
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function R(e, t) {
|
|
266
266
|
return e.length > 0 || t.length > 0;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function z(e, t, n, r) {
|
|
269
269
|
return e || !t || n || r;
|
|
270
270
|
}
|
|
271
|
-
var
|
|
271
|
+
var B = (e) => {
|
|
272
272
|
switch (e.input.type) {
|
|
273
|
-
case "textarea": return /* @__PURE__ */
|
|
274
|
-
case "number": return /* @__PURE__ */
|
|
275
|
-
case "slider": return /* @__PURE__ */
|
|
276
|
-
case "select": return /* @__PURE__ */
|
|
277
|
-
case "image": return /* @__PURE__ */
|
|
273
|
+
case "textarea": return /* @__PURE__ */ d(O, { ...e });
|
|
274
|
+
case "number": return /* @__PURE__ */ d(A, { ...e });
|
|
275
|
+
case "slider": return /* @__PURE__ */ d(M, { ...e });
|
|
276
|
+
case "select": return /* @__PURE__ */ d(j, { ...e });
|
|
277
|
+
case "image": return /* @__PURE__ */ d(N, {
|
|
278
278
|
input: e.input,
|
|
279
279
|
value: e.value,
|
|
280
280
|
onChange: e.onChange,
|
|
281
281
|
disabled: e.disabled
|
|
282
282
|
});
|
|
283
|
-
case "checkbox": return /* @__PURE__ */
|
|
283
|
+
case "checkbox": return /* @__PURE__ */ d(P, { ...e });
|
|
284
284
|
default: return null;
|
|
285
285
|
}
|
|
286
|
-
},
|
|
286
|
+
}, V = o.memo(({ input: e, value: t, disabled: n, onChange: r, onFocus: i, onBlur: a }) => e.renderInput ? /* @__PURE__ */ d(m, { children: e.renderInput({
|
|
287
287
|
value: t,
|
|
288
288
|
onChange: r,
|
|
289
289
|
onFocus: i,
|
|
290
290
|
onBlur: a,
|
|
291
291
|
disabled: n
|
|
292
|
-
}) }) : /* @__PURE__ */
|
|
292
|
+
}) }) : /* @__PURE__ */ d(B, {
|
|
293
293
|
input: e,
|
|
294
294
|
value: t,
|
|
295
295
|
onChange: r,
|
|
296
296
|
onFocus: i,
|
|
297
297
|
onBlur: a,
|
|
298
298
|
disabled: n
|
|
299
|
-
})),
|
|
299
|
+
})), H = o.memo(({ customActionButtons: e, infoContent: t, infoTooltip: n, downloadTooltip: a, resetTooltip: o, processTooltip: s, hideProcessButton: c, processActionDisabled: l, onInfoOpen: u, onDownload: p, onReset: h, onProcess: g }) => /* @__PURE__ */ f(m, {
|
|
300
300
|
sx: {
|
|
301
301
|
display: "flex",
|
|
302
302
|
alignItems: "center",
|
|
@@ -305,71 +305,71 @@ var H = (e) => {
|
|
|
305
305
|
},
|
|
306
306
|
children: [
|
|
307
307
|
e,
|
|
308
|
-
t && /* @__PURE__ */
|
|
308
|
+
t && /* @__PURE__ */ d(C, {
|
|
309
309
|
title: n,
|
|
310
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ d(b, {
|
|
311
311
|
onClick: u,
|
|
312
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ d(i, {})
|
|
313
313
|
})
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
title:
|
|
317
|
-
children: /* @__PURE__ */
|
|
318
|
-
onClick:
|
|
319
|
-
children: /* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ d(C, {
|
|
316
|
+
title: a,
|
|
317
|
+
children: /* @__PURE__ */ d(b, {
|
|
318
|
+
onClick: p,
|
|
319
|
+
children: /* @__PURE__ */ d(r, {})
|
|
320
320
|
})
|
|
321
321
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ d(C, {
|
|
323
323
|
title: o,
|
|
324
|
-
children: /* @__PURE__ */
|
|
325
|
-
onClick:
|
|
326
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ d(b, {
|
|
325
|
+
onClick: h,
|
|
326
|
+
children: /* @__PURE__ */ d(D, {})
|
|
327
327
|
})
|
|
328
328
|
}),
|
|
329
|
-
!c && /* @__PURE__ */
|
|
329
|
+
!c && /* @__PURE__ */ d(C, {
|
|
330
330
|
title: s,
|
|
331
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(b, {
|
|
332
332
|
onClick: g,
|
|
333
333
|
disabled: l,
|
|
334
334
|
size: "large",
|
|
335
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ d(E, { color: l ? "disabled" : "primary" })
|
|
336
336
|
}) })
|
|
337
337
|
})
|
|
338
338
|
]
|
|
339
|
-
})),
|
|
340
|
-
let [
|
|
341
|
-
|
|
342
|
-
}, [
|
|
343
|
-
let t =
|
|
344
|
-
return /* @__PURE__ */
|
|
339
|
+
})), U = ({ inputs: t = [], onProcess: n, onReset: r, onDownload: i, processing: a = !1, uploading: o = !1, inputValues: c = {}, onInputChange: h, customActionButtons: b, hideProcessButton: x = !1, processButtonDisabled: S = !1, getInputDisabled: C, processTooltip: w = "Process", downloadTooltip: T = "Download", resetTooltip: E = "Reset", infoTooltip: D = "Information", infoTitle: O = "Tool Information", infoContent: k, position: A = "bottom", relative: j = !1, containerSx: M, sx: N }) => {
|
|
340
|
+
let [P, I] = u(!1), B = l(() => t.length === 0 ? !0 : t.every((e) => F(e, c[e.key])), [t, c]), { imageInputs: U, textareaInputs: W, paramInputs: G } = l(() => L(t), [t]), K = R(U, G), q = z(S, B, o, a), J = s(() => {}, []), Y = s(() => {}, []), X = s((e, t, n) => {
|
|
341
|
+
h?.(e, t, n);
|
|
342
|
+
}, [h]), Z = s(() => I(!0), []), ee = s(() => I(!1), []), Q = s((e) => {
|
|
343
|
+
let t = c[e.key];
|
|
344
|
+
return /* @__PURE__ */ d(V, {
|
|
345
345
|
input: e,
|
|
346
346
|
value: t,
|
|
347
|
-
onChange: (t) =>
|
|
348
|
-
onFocus:
|
|
349
|
-
onBlur:
|
|
350
|
-
disabled:
|
|
347
|
+
onChange: (t) => X(e.key, t),
|
|
348
|
+
onFocus: J,
|
|
349
|
+
onBlur: Y,
|
|
350
|
+
disabled: C?.(e.key) ?? !1
|
|
351
351
|
}, e.key);
|
|
352
352
|
}, [
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
]), $ = /* @__PURE__ */
|
|
353
|
+
c,
|
|
354
|
+
C,
|
|
355
|
+
X,
|
|
356
|
+
J,
|
|
357
|
+
Y
|
|
358
|
+
]), $ = /* @__PURE__ */ f(m, {
|
|
359
359
|
sx: {
|
|
360
|
-
position:
|
|
361
|
-
[
|
|
362
|
-
left:
|
|
363
|
-
transform:
|
|
364
|
-
zIndex:
|
|
365
|
-
display:
|
|
366
|
-
justifyContent:
|
|
367
|
-
mt:
|
|
368
|
-
mb:
|
|
369
|
-
...
|
|
360
|
+
position: j ? "relative" : "fixed",
|
|
361
|
+
[A]: j ? "auto" : 20,
|
|
362
|
+
left: j ? "auto" : "50%",
|
|
363
|
+
transform: j ? "none" : "translateX(-50%)",
|
|
364
|
+
zIndex: j ? "auto" : 1300,
|
|
365
|
+
display: j ? "flex" : "block",
|
|
366
|
+
justifyContent: j ? "center" : "initial",
|
|
367
|
+
mt: j && A === "top" ? 2 : 0,
|
|
368
|
+
mb: j && A === "bottom" ? 2 : 0,
|
|
369
|
+
...M
|
|
370
370
|
},
|
|
371
|
-
children: [/* @__PURE__ */
|
|
372
|
-
sx: {
|
|
371
|
+
children: [/* @__PURE__ */ f(m, {
|
|
372
|
+
sx: [(t) => ({
|
|
373
373
|
display: "flex",
|
|
374
374
|
flexDirection: "column",
|
|
375
375
|
gap: 2,
|
|
@@ -379,44 +379,43 @@ var H = (e) => {
|
|
|
379
379
|
borderColor: "divider",
|
|
380
380
|
bgcolor: "background.default",
|
|
381
381
|
transition: "border 120ms ease-in",
|
|
382
|
-
"&:hover": { borderColor: t[500] },
|
|
382
|
+
"&:hover": { borderColor: (t.vars ?? t).palette.grey[500] },
|
|
383
383
|
"&:focus-within": {
|
|
384
|
-
outline: `3px solid ${
|
|
385
|
-
borderColor:
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
children: [K.length > 0 && /* @__PURE__ */ f(h, {
|
|
384
|
+
outline: `3px solid ${e((t.vars ?? t).palette.primary[500], 50)}`,
|
|
385
|
+
borderColor: (t.vars ?? t).palette.primary[400]
|
|
386
|
+
}
|
|
387
|
+
}), ...Array.isArray(N) ? N : [N]],
|
|
388
|
+
children: [W.length > 0 && /* @__PURE__ */ d(m, {
|
|
390
389
|
sx: {
|
|
391
390
|
display: "flex",
|
|
392
391
|
flexDirection: "column",
|
|
393
392
|
gap: 2
|
|
394
393
|
},
|
|
395
|
-
children:
|
|
396
|
-
}), /* @__PURE__ */
|
|
394
|
+
children: W.map(Q)
|
|
395
|
+
}), /* @__PURE__ */ f(m, {
|
|
397
396
|
sx: {
|
|
398
397
|
display: "flex",
|
|
399
398
|
alignItems: "center",
|
|
400
399
|
gap: .5
|
|
401
400
|
},
|
|
402
401
|
children: [
|
|
403
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ d(m, {
|
|
404
403
|
sx: {
|
|
405
404
|
display: "flex",
|
|
406
405
|
alignItems: "center",
|
|
407
406
|
gap: 2,
|
|
408
407
|
flex: 1
|
|
409
408
|
},
|
|
410
|
-
children:
|
|
409
|
+
children: K && /* @__PURE__ */ f(m, {
|
|
411
410
|
sx: {
|
|
412
411
|
display: "flex",
|
|
413
412
|
alignItems: "center",
|
|
414
413
|
gap: 1.5
|
|
415
414
|
},
|
|
416
|
-
children: [
|
|
415
|
+
children: [U.map(Q), G.map(Q)]
|
|
417
416
|
})
|
|
418
417
|
}),
|
|
419
|
-
|
|
418
|
+
K && /* @__PURE__ */ d(y, {
|
|
420
419
|
orientation: "vertical",
|
|
421
420
|
flexItem: !0,
|
|
422
421
|
sx: {
|
|
@@ -424,32 +423,32 @@ var H = (e) => {
|
|
|
424
423
|
flexShrink: 0
|
|
425
424
|
}
|
|
426
425
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
customActionButtons:
|
|
429
|
-
infoContent:
|
|
430
|
-
infoTooltip:
|
|
431
|
-
downloadTooltip:
|
|
432
|
-
resetTooltip:
|
|
433
|
-
processTooltip:
|
|
434
|
-
hideProcessButton:
|
|
435
|
-
processActionDisabled:
|
|
436
|
-
onInfoOpen:
|
|
437
|
-
onDownload:
|
|
438
|
-
onReset:
|
|
439
|
-
onProcess:
|
|
426
|
+
/* @__PURE__ */ d(H, {
|
|
427
|
+
customActionButtons: b,
|
|
428
|
+
infoContent: k,
|
|
429
|
+
infoTooltip: D,
|
|
430
|
+
downloadTooltip: T,
|
|
431
|
+
resetTooltip: E,
|
|
432
|
+
processTooltip: w,
|
|
433
|
+
hideProcessButton: x,
|
|
434
|
+
processActionDisabled: q,
|
|
435
|
+
onInfoOpen: Z,
|
|
436
|
+
onDownload: i,
|
|
437
|
+
onReset: r,
|
|
438
|
+
onProcess: n
|
|
440
439
|
})
|
|
441
440
|
]
|
|
442
441
|
})]
|
|
443
|
-
}),
|
|
444
|
-
open:
|
|
445
|
-
onClose:
|
|
442
|
+
}), k && /* @__PURE__ */ f(g, {
|
|
443
|
+
open: P,
|
|
444
|
+
onClose: ee,
|
|
446
445
|
maxWidth: "sm",
|
|
447
446
|
fullWidth: !0,
|
|
448
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ d(v, { children: O }), /* @__PURE__ */ d(_, { children: k })]
|
|
449
448
|
})]
|
|
450
449
|
});
|
|
451
|
-
return !
|
|
450
|
+
return !j && typeof window < "u" ? p($, document.body) : $;
|
|
452
451
|
};
|
|
453
|
-
|
|
452
|
+
U.displayName = "SToolBar";
|
|
454
453
|
//#endregion
|
|
455
|
-
export {
|
|
454
|
+
export { U as t };
|