@acellera/pm-rjsf 0.0.6 → 0.0.7
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/pm-rjsf.js +39 -39
- package/dist/pm-rjsf.preview.js +4 -4
- package/package.json +1 -1
package/dist/pm-rjsf.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import A from "react";
|
|
2
2
|
import V from "@rjsf/mui";
|
|
3
3
|
import { getTemplate as H, getUiOptions as X, ADDITIONAL_PROPERTY_FLAG as $, canExpand as J, getDefaultFormState as Y } from "@rjsf/utils";
|
|
4
|
-
import { Accordion as Q, AccordionSummary as Z, AccordionDetails as ee, FormLabel as G, Box as B, TextField as te, Grid as
|
|
4
|
+
import { Accordion as Q, AccordionSummary as Z, AccordionDetails as ee, FormLabel as G, Box as B, TextField as te, Grid as T, Tooltip as F, Typography as ne, IconButton as ie, Button as w, ButtonGroup as re, Menu as oe, MenuItem as _, ListItemIcon as R, ListItemText as N, ThemeProvider as le, createTheme as se } from "@mui/material";
|
|
5
5
|
import { customizeValidator as ae } from "@rjsf/validator-ajv8";
|
|
6
6
|
import ce from "ajv/dist/2020";
|
|
7
7
|
import { ExpandMore as de, Delete as ue, DriveFolderUpload as me, CloudDownload as fe, ArrowDropDown as pe } from "@mui/icons-material";
|
|
@@ -187,7 +187,7 @@ function Se(e) {
|
|
|
187
187
|
} = e;
|
|
188
188
|
if (!($ in d))
|
|
189
189
|
return s("div", { className: i, style: n }, t);
|
|
190
|
-
const y = b.templates.ButtonTemplates.RemoveButton, g = f && f["ui:options"] && f["ui:options"].keyLabel ||
|
|
190
|
+
const y = b.templates.ButtonTemplates.RemoveButton, g = o + "-key", k = /^newKey(-\d+)?$/.test(c || ""), I = f && f["ui:options"] && f["ui:options"].keyLabel || (k ? "Key" : c + " Key"), x = d && d.description ? String(d.description) : "";
|
|
191
191
|
return s(
|
|
192
192
|
B,
|
|
193
193
|
{ sx: K },
|
|
@@ -198,13 +198,13 @@ function Se(e) {
|
|
|
198
198
|
"div",
|
|
199
199
|
{ style: { flex: "0 0 34%" } },
|
|
200
200
|
E(
|
|
201
|
-
|
|
201
|
+
x,
|
|
202
202
|
s(te, {
|
|
203
|
-
id:
|
|
204
|
-
label:
|
|
203
|
+
id: g,
|
|
204
|
+
label: I,
|
|
205
205
|
size: "small",
|
|
206
206
|
fullWidth: !0,
|
|
207
|
-
defaultValue:
|
|
207
|
+
defaultValue: k ? "" : c,
|
|
208
208
|
disabled: r || u,
|
|
209
209
|
onBlur: (C) => {
|
|
210
210
|
const p = C.target.value.trim();
|
|
@@ -284,18 +284,18 @@ function Ce(e) {
|
|
|
284
284
|
readonly: b,
|
|
285
285
|
uiSchema: y,
|
|
286
286
|
registry: g
|
|
287
|
-
} = e, { CopyButton:
|
|
287
|
+
} = e, { CopyButton: k, MoveDownButton: I, MoveUpButton: x, RemoveButton: C } = g.templates.ButtonTemplates, p = { flex: 1, paddingLeft: 6, paddingRight: 6, fontWeight: "bold", minWidth: 0 };
|
|
288
288
|
return s(
|
|
289
289
|
B,
|
|
290
290
|
{ sx: K },
|
|
291
291
|
s(
|
|
292
|
-
|
|
292
|
+
T,
|
|
293
293
|
{ container: !0, alignItems: "center", wrap: "nowrap" },
|
|
294
|
-
s(
|
|
294
|
+
s(T, { item: !0, xs: !0, style: { minWidth: 0 } }, t),
|
|
295
295
|
i && s(
|
|
296
|
-
|
|
296
|
+
T,
|
|
297
297
|
{ item: !0 },
|
|
298
|
-
(o || r) && s(
|
|
298
|
+
(o || r) && s(x, {
|
|
299
299
|
style: p,
|
|
300
300
|
disabled: f || b || !o,
|
|
301
301
|
onClick: d(l, l - 1),
|
|
@@ -309,7 +309,7 @@ function Ce(e) {
|
|
|
309
309
|
uiSchema: y,
|
|
310
310
|
registry: g
|
|
311
311
|
}),
|
|
312
|
-
n && s(
|
|
312
|
+
n && s(k, {
|
|
313
313
|
style: p,
|
|
314
314
|
disabled: f || b,
|
|
315
315
|
onClick: m(l),
|
|
@@ -340,23 +340,23 @@ const Oe = {
|
|
|
340
340
|
{ key: "datacenter", label: "From datacenter", isInput: !1, Icon: fe }
|
|
341
341
|
];
|
|
342
342
|
function je(e) {
|
|
343
|
-
const { value: t, onChange: i, disabled: n = !1, readonly: r = !1, label: o, required: c } = e, l = /_\d+$/.test(e.id || ""), m = n || r, [u, d] = A.useState(null), [f, b] = A.useState(0), y = !!u, g = t ? String(t).split("/").pop() : "",
|
|
344
|
-
|
|
343
|
+
const { value: t, onChange: i, disabled: n = !1, readonly: r = !1, label: o, required: c } = e, l = /_\d+$/.test(e.id || ""), m = n || r, [u, d] = A.useState(null), [f, b] = A.useState(0), y = !!u, g = t ? String(t).split("/").pop() : "", k = (v) => v && i(v.name), I = () => i(void 0), x = L[f], C = o && !l ? a(
|
|
344
|
+
T,
|
|
345
345
|
{ item: !0, zeroMinWidth: !0 },
|
|
346
346
|
a(G, null, o, c ? " *" : null)
|
|
347
347
|
) : null, p = t ? a(
|
|
348
|
-
|
|
348
|
+
T,
|
|
349
349
|
{ item: !0, xs: !0, zeroMinWidth: !0 },
|
|
350
350
|
a(
|
|
351
351
|
F,
|
|
352
352
|
{ title: g, arrow: !0, placement: "top" },
|
|
353
353
|
a(ne, { style: { textOverflow: "ellipsis", overflow: "hidden" } }, g)
|
|
354
354
|
)
|
|
355
|
-
) : a(
|
|
356
|
-
let
|
|
355
|
+
) : a(T, { item: !0, xs: !0 }, null);
|
|
356
|
+
let S;
|
|
357
357
|
if (t)
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
S = a(
|
|
359
|
+
T,
|
|
360
360
|
{ item: !0, xs: "auto" },
|
|
361
361
|
a(
|
|
362
362
|
F,
|
|
@@ -373,33 +373,33 @@ function je(e) {
|
|
|
373
373
|
)
|
|
374
374
|
);
|
|
375
375
|
else {
|
|
376
|
-
const
|
|
376
|
+
const v = x.isInput ? a(
|
|
377
377
|
w,
|
|
378
378
|
{
|
|
379
379
|
component: "label",
|
|
380
380
|
disabled: m,
|
|
381
|
-
endIcon: a(
|
|
381
|
+
endIcon: a(x.Icon, null),
|
|
382
382
|
sx: { px: 1.2, borderRadius: "4px 0 0 4px", borderRight: 0 }
|
|
383
383
|
},
|
|
384
384
|
"Select",
|
|
385
385
|
a("input", {
|
|
386
386
|
type: "file",
|
|
387
387
|
hidden: !0,
|
|
388
|
-
onChange: (h) =>
|
|
388
|
+
onChange: (h) => k(h.target.files && h.target.files[0])
|
|
389
389
|
})
|
|
390
390
|
) : a(
|
|
391
391
|
w,
|
|
392
392
|
{
|
|
393
393
|
disabled: m,
|
|
394
|
-
endIcon: a(
|
|
394
|
+
endIcon: a(x.Icon, null),
|
|
395
395
|
sx: { px: 1.2, borderRadius: "4px 0 0 4px", borderRight: 0 },
|
|
396
396
|
onClick: () => {
|
|
397
397
|
}
|
|
398
398
|
},
|
|
399
399
|
"Select"
|
|
400
400
|
);
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
S = a(
|
|
402
|
+
T,
|
|
403
403
|
{ item: !0, xs: "auto" },
|
|
404
404
|
a(
|
|
405
405
|
re,
|
|
@@ -408,7 +408,7 @@ function je(e) {
|
|
|
408
408
|
disabled: m,
|
|
409
409
|
sx: { "& .MuiButtonGroup-grouped": { minWidth: 0 } }
|
|
410
410
|
},
|
|
411
|
-
|
|
411
|
+
v,
|
|
412
412
|
a(
|
|
413
413
|
w,
|
|
414
414
|
{
|
|
@@ -432,7 +432,7 @@ function je(e) {
|
|
|
432
432
|
type: "file",
|
|
433
433
|
hidden: !0,
|
|
434
434
|
onChange: (D) => {
|
|
435
|
-
b(O), d(null),
|
|
435
|
+
b(O), d(null), k(D.target.files && D.target.files[0]);
|
|
436
436
|
}
|
|
437
437
|
})
|
|
438
438
|
) : a(
|
|
@@ -452,7 +452,7 @@ function je(e) {
|
|
|
452
452
|
);
|
|
453
453
|
}
|
|
454
454
|
return a(
|
|
455
|
-
|
|
455
|
+
T,
|
|
456
456
|
{
|
|
457
457
|
container: !0,
|
|
458
458
|
direction: "row",
|
|
@@ -464,7 +464,7 @@ function je(e) {
|
|
|
464
464
|
},
|
|
465
465
|
C,
|
|
466
466
|
p,
|
|
467
|
-
|
|
467
|
+
S
|
|
468
468
|
);
|
|
469
469
|
}
|
|
470
470
|
const we = `
|
|
@@ -549,14 +549,14 @@ function qe({ schema: e, uiSchema: t, widgets: i, formData: n, onChange: r, onSu
|
|
|
549
549
|
const l = A.useMemo(() => be(e), [e]), m = A.useMemo(() => Be(l), [l]), u = A.useMemo(() => Ee(e), [e]), d = A.useMemo(
|
|
550
550
|
() => Y(z, l, void 0, l, !1, q),
|
|
551
551
|
[l]
|
|
552
|
-
), [f, b] = A.useState(n !== void 0 ? n : d), y = n !== void 0 ? n : f, g = (p,
|
|
553
|
-
b(p.formData), r && r(p,
|
|
554
|
-
},
|
|
555
|
-
const
|
|
556
|
-
if (!
|
|
557
|
-
const h = y ? y[
|
|
558
|
-
return !(h === void 0 || M(h, d[
|
|
559
|
-
}), C = o ? (p,
|
|
552
|
+
), [f, b] = A.useState(n !== void 0 ? n : d), y = n !== void 0 ? n : f, g = (p, S) => {
|
|
553
|
+
b(p.formData), r && r(p, S);
|
|
554
|
+
}, k = De(t, y), I = { file: je, ...i || {} }, x = (p) => p.filter((S) => {
|
|
555
|
+
const v = (S.property || "").split(".").filter(Boolean)[0];
|
|
556
|
+
if (!v || !u.has(v)) return !0;
|
|
557
|
+
const h = y ? y[v] : void 0;
|
|
558
|
+
return !(h === void 0 || M(h, d[v]));
|
|
559
|
+
}), C = o ? (p, S) => o({ ...p, formData: U(p.formData, d, m) ?? {} }, S) : void 0;
|
|
560
560
|
return A.createElement(
|
|
561
561
|
le,
|
|
562
562
|
{ theme: Me },
|
|
@@ -565,14 +565,14 @@ function qe({ schema: e, uiSchema: t, widgets: i, formData: n, onChange: r, onSu
|
|
|
565
565
|
{ sx: { color: "text.primary" } },
|
|
566
566
|
A.createElement(V, {
|
|
567
567
|
schema: l,
|
|
568
|
-
uiSchema:
|
|
568
|
+
uiSchema: k,
|
|
569
569
|
validator: z,
|
|
570
570
|
templates: Oe,
|
|
571
571
|
widgets: I,
|
|
572
572
|
formData: y,
|
|
573
573
|
onChange: g,
|
|
574
574
|
onSubmit: C,
|
|
575
|
-
transformErrors:
|
|
575
|
+
transformErrors: x,
|
|
576
576
|
// RJSF owns validation + error display. Native HTML5 validation hard-
|
|
577
577
|
// blocks submit when a `required` control is non-focusable (e.g. inside a
|
|
578
578
|
// collapsed accordion) and does so SILENTLY -- onSubmit never fires and
|
package/dist/pm-rjsf.preview.js
CHANGED
|
@@ -27770,7 +27770,7 @@ function vK(e) {
|
|
|
27770
27770
|
} = e;
|
|
27771
27771
|
if (!(tn in u))
|
|
27772
27772
|
return Ie("div", { className: r, style: n }, t);
|
|
27773
|
-
const m = f.templates.ButtonTemplates.RemoveButton, _ = d && d["ui:options"] && d["ui:options"].keyLabel ||
|
|
27773
|
+
const m = f.templates.ButtonTemplates.RemoveButton, _ = i + "-key", h = /^newKey(-\d+)?$/.test(a || ""), g = d && d["ui:options"] && d["ui:options"].keyLabel || (h ? "Key" : a + " Key"), p = u && u.description ? String(u.description) : "";
|
|
27774
27774
|
return Ie(
|
|
27775
27775
|
vr,
|
|
27776
27776
|
{ sx: Yx },
|
|
@@ -27783,11 +27783,11 @@ function vK(e) {
|
|
|
27783
27783
|
Lg(
|
|
27784
27784
|
p,
|
|
27785
27785
|
Ie(gc, {
|
|
27786
|
-
id:
|
|
27787
|
-
label:
|
|
27786
|
+
id: _,
|
|
27787
|
+
label: g,
|
|
27788
27788
|
size: "small",
|
|
27789
27789
|
fullWidth: !0,
|
|
27790
|
-
defaultValue:
|
|
27790
|
+
defaultValue: h ? "" : a,
|
|
27791
27791
|
disabled: o || c,
|
|
27792
27792
|
onBlur: (y) => {
|
|
27793
27793
|
const b = y.target.value.trim();
|
package/package.json
CHANGED