@acellera/pm-rjsf 0.0.4 → 0.0.6
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 +342 -282
- package/dist/pm-rjsf.preview.js +4002 -3942
- package/package.json +1 -1
package/dist/pm-rjsf.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ExpandMore as
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
AjvClass:
|
|
1
|
+
import A from "react";
|
|
2
|
+
import V from "@rjsf/mui";
|
|
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 v, 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
|
+
import { customizeValidator as ae } from "@rjsf/validator-ajv8";
|
|
6
|
+
import ce from "ajv/dist/2020";
|
|
7
|
+
import { ExpandMore as de, Delete as ue, DriveFolderUpload as me, CloudDownload as fe, ArrowDropDown as pe } from "@mui/icons-material";
|
|
8
|
+
function ye() {
|
|
9
|
+
return ae({
|
|
10
|
+
AjvClass: ce,
|
|
11
11
|
customFormats: { path: () => !0 },
|
|
12
12
|
ajvOptionsOverrides: { strict: !1 }
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
function
|
|
15
|
+
const P = ["outdir", "scratchdir", "execdir"];
|
|
16
|
+
function he(e) {
|
|
17
17
|
if (!e || !e.properties) return e;
|
|
18
18
|
const t = { ...e.properties };
|
|
19
|
-
for (const n of
|
|
20
|
-
const i = (e.required || []).filter((n) => !
|
|
19
|
+
for (const n of P) delete t[n];
|
|
20
|
+
const i = (e.required || []).filter((n) => !P.includes(n));
|
|
21
21
|
return { ...e, properties: t, required: i };
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
if (Array.isArray(e)) return e.map(
|
|
23
|
+
function j(e) {
|
|
24
|
+
if (Array.isArray(e)) return e.map(j);
|
|
25
25
|
if (e && typeof e == "object") {
|
|
26
26
|
if (Array.isArray(e.anyOf)) {
|
|
27
27
|
const i = e.anyOf.filter((n) => !(n && n.type === "null"));
|
|
28
28
|
if (i.length === 1) {
|
|
29
|
-
const { anyOf: n, ...o } = e;
|
|
30
|
-
return
|
|
29
|
+
const { anyOf: n, default: r, ...o } = e, c = { ...i[0], ...o };
|
|
30
|
+
return r != null && (c.default = r), j(c);
|
|
31
31
|
}
|
|
32
32
|
e = { ...e, anyOf: i };
|
|
33
33
|
}
|
|
34
34
|
if (Array.isArray(e.oneOf) && e.discriminator && e.discriminator.mapping) {
|
|
35
35
|
const i = {};
|
|
36
|
-
for (const [n,
|
|
37
|
-
i[
|
|
36
|
+
for (const [n, r] of Object.entries(e.discriminator.mapping))
|
|
37
|
+
i[r.split("/").pop()] = n;
|
|
38
38
|
e = {
|
|
39
39
|
...e,
|
|
40
40
|
oneOf: e.oneOf.map((n) => {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
41
|
+
const r = n && n.$ref ? n.$ref.split("/").pop() : null;
|
|
42
|
+
return r && i[r] && !n.title ? { ...n, title: i[r] } : n;
|
|
43
43
|
})
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
const t = {};
|
|
47
|
-
for (const [i, n] of Object.entries(e)) t[i] =
|
|
47
|
+
for (const [i, n] of Object.entries(e)) t[i] = j(n);
|
|
48
48
|
return t.const !== void 0 && t.enum === void 0 && (t.enum = [t.const], delete t.const), t;
|
|
49
49
|
}
|
|
50
50
|
return e;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
52
|
+
function be(e) {
|
|
53
|
+
return j(he(e));
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
function
|
|
55
|
+
const s = A.createElement, ge = /\.(?!smi|sdf)/;
|
|
56
|
+
function Ae(e) {
|
|
57
57
|
if (!e) return "";
|
|
58
|
-
const t = String(e), i = t.match(
|
|
58
|
+
const t = String(e), i = t.match(ge);
|
|
59
59
|
if (i) {
|
|
60
60
|
const n = t.slice(0, i.index).trim();
|
|
61
61
|
if (n && n.split(/\s+/).length <= 4)
|
|
@@ -63,10 +63,10 @@ function pe(e) {
|
|
|
63
63
|
}
|
|
64
64
|
return t;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const i =
|
|
68
|
-
return i ?
|
|
69
|
-
|
|
66
|
+
function E(e, t) {
|
|
67
|
+
const i = Ae(e);
|
|
68
|
+
return i ? s(
|
|
69
|
+
F,
|
|
70
70
|
{
|
|
71
71
|
title: i,
|
|
72
72
|
arrow: !0,
|
|
@@ -77,46 +77,46 @@ function _(e, t) {
|
|
|
77
77
|
t
|
|
78
78
|
) : t;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const K = {
|
|
81
81
|
border: "1px solid",
|
|
82
82
|
borderColor: "divider",
|
|
83
83
|
borderRadius: 1,
|
|
84
84
|
p: 1.5,
|
|
85
85
|
mb: 1.5
|
|
86
86
|
};
|
|
87
|
-
function
|
|
88
|
-
const { children: t, errors: i, help: n, hidden:
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
let
|
|
92
|
-
if (
|
|
93
|
-
|
|
87
|
+
function ke(e) {
|
|
88
|
+
const { children: t, errors: i, help: n, hidden: r, schema: o, registry: c, uiSchema: l } = e;
|
|
89
|
+
if (r) return s("div", { className: "hidden" }, t);
|
|
90
|
+
const m = o && o.type, u = m === "object" || m === "array" || Array.isArray(m) && (m.includes("object") || m.includes("array"));
|
|
91
|
+
let d;
|
|
92
|
+
if (u)
|
|
93
|
+
d = t;
|
|
94
94
|
else {
|
|
95
|
-
const
|
|
95
|
+
const b = o && o.description ? String(o.description) : "", y = m === "boolean" || Array.isArray(m) && m.includes("boolean"), g = s(
|
|
96
96
|
"div",
|
|
97
|
-
|
|
97
|
+
y ? { style: { display: "inline-block" } } : null,
|
|
98
98
|
t,
|
|
99
99
|
i,
|
|
100
100
|
n
|
|
101
101
|
);
|
|
102
|
-
|
|
102
|
+
d = E(b, g);
|
|
103
103
|
}
|
|
104
|
-
const f =
|
|
104
|
+
const f = H(
|
|
105
105
|
"WrapIfAdditionalTemplate",
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
c,
|
|
107
|
+
X(l)
|
|
108
108
|
);
|
|
109
|
-
return
|
|
109
|
+
return s(f, { ...e }, d);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const t = e.uiSchema || {}, i = e.registry.templates, n = [],
|
|
113
|
-
for (const
|
|
114
|
-
const
|
|
115
|
-
|
|
111
|
+
function xe(e) {
|
|
112
|
+
const t = e.uiSchema || {}, i = e.registry.templates, n = [], r = /* @__PURE__ */ new Map();
|
|
113
|
+
for (const u of e.properties) {
|
|
114
|
+
const d = t[u.name] && t[u.name]["ui:options"] && t[u.name]["ui:options"].group;
|
|
115
|
+
d ? (r.get(d) || r.set(d, []).get(d)).push(u) : n.push(u);
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
e.title && !
|
|
119
|
-
|
|
117
|
+
const o = [], c = $ in (e.schema || {}), l = t["ui:options"] && t["ui:options"].group, m = l && l === e.title;
|
|
118
|
+
e.title && !c && !m && o.push(
|
|
119
|
+
s(i.TitleFieldTemplate, {
|
|
120
120
|
key: "__title",
|
|
121
121
|
id: e.idSchema.$id + "__title",
|
|
122
122
|
title: e.title,
|
|
@@ -126,14 +126,14 @@ function he(e) {
|
|
|
126
126
|
registry: e.registry
|
|
127
127
|
})
|
|
128
128
|
);
|
|
129
|
-
for (const
|
|
130
|
-
|
|
131
|
-
for (const [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
for (const u of n)
|
|
130
|
+
o.push(s("div", { key: u.name, className: "pm-field" }, u.content));
|
|
131
|
+
for (const [u, d] of r)
|
|
132
|
+
o.push(
|
|
133
|
+
s(
|
|
134
|
+
Q,
|
|
135
135
|
{
|
|
136
|
-
key:
|
|
136
|
+
key: u,
|
|
137
137
|
variant: "outlined",
|
|
138
138
|
disableGutters: !0,
|
|
139
139
|
elevation: 0,
|
|
@@ -147,20 +147,20 @@ function he(e) {
|
|
|
147
147
|
"& .MuiAccordionDetails-root": { pt: 0, pr: 2, pb: 1, pl: 2 }
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
{ expandIcon:
|
|
153
|
-
|
|
150
|
+
s(
|
|
151
|
+
Z,
|
|
152
|
+
{ expandIcon: s(de, null) },
|
|
153
|
+
u
|
|
154
154
|
),
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
s(
|
|
156
|
+
ee,
|
|
157
157
|
null,
|
|
158
|
-
|
|
158
|
+
d.map((f) => s("div", { key: f.name, className: "pm-field" }, f.content))
|
|
159
159
|
)
|
|
160
160
|
)
|
|
161
161
|
);
|
|
162
|
-
return
|
|
163
|
-
|
|
162
|
+
return J(e.schema, e.uiSchema, e.formData) && o.push(
|
|
163
|
+
s(i.ButtonTemplates.AddButton, {
|
|
164
164
|
key: "__add",
|
|
165
165
|
className: "object-property-expand",
|
|
166
166
|
onClick: e.onAddClick(e.schema),
|
|
@@ -168,86 +168,86 @@ function he(e) {
|
|
|
168
168
|
uiSchema: e.uiSchema,
|
|
169
169
|
registry: e.registry
|
|
170
170
|
})
|
|
171
|
-
),
|
|
171
|
+
), s("div", null, o);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Se(e) {
|
|
174
174
|
const {
|
|
175
175
|
children: t,
|
|
176
176
|
classNames: i,
|
|
177
177
|
style: n,
|
|
178
|
-
disabled:
|
|
179
|
-
id:
|
|
180
|
-
label:
|
|
181
|
-
onKeyChange:
|
|
182
|
-
onDropPropertyClick:
|
|
183
|
-
readonly:
|
|
184
|
-
schema:
|
|
178
|
+
disabled: r,
|
|
179
|
+
id: o,
|
|
180
|
+
label: c,
|
|
181
|
+
onKeyChange: l,
|
|
182
|
+
onDropPropertyClick: m,
|
|
183
|
+
readonly: u,
|
|
184
|
+
schema: d,
|
|
185
185
|
uiSchema: f,
|
|
186
|
-
registry:
|
|
186
|
+
registry: b
|
|
187
187
|
} = e;
|
|
188
|
-
if (!(
|
|
189
|
-
return
|
|
190
|
-
const
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
{ sx:
|
|
194
|
-
|
|
188
|
+
if (!($ in d))
|
|
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 || c + " Key", T = o + "-key", I = /^newKey(-\d+)?$/.test(c || ""), k = d && d.description ? String(d.description) : "";
|
|
191
|
+
return s(
|
|
192
|
+
B,
|
|
193
|
+
{ sx: K },
|
|
194
|
+
s(
|
|
195
195
|
"div",
|
|
196
196
|
{ style: { display: "flex", gap: "1rem", alignItems: "flex-start" } },
|
|
197
|
-
|
|
197
|
+
s(
|
|
198
198
|
"div",
|
|
199
199
|
{ style: { flex: "0 0 34%" } },
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
id:
|
|
204
|
-
label:
|
|
200
|
+
E(
|
|
201
|
+
k,
|
|
202
|
+
s(te, {
|
|
203
|
+
id: T,
|
|
204
|
+
label: g,
|
|
205
205
|
size: "small",
|
|
206
206
|
fullWidth: !0,
|
|
207
|
-
defaultValue:
|
|
208
|
-
disabled:
|
|
207
|
+
defaultValue: I ? "" : c,
|
|
208
|
+
disabled: r || u,
|
|
209
209
|
onBlur: (C) => {
|
|
210
|
-
const
|
|
211
|
-
|
|
210
|
+
const p = C.target.value.trim();
|
|
211
|
+
p && p !== c && l(p);
|
|
212
212
|
}
|
|
213
213
|
})
|
|
214
214
|
)
|
|
215
215
|
),
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
s("div", { className: "pm-ap-value", style: { flex: "1 1 auto" } }, t),
|
|
217
|
+
s(
|
|
218
218
|
"div",
|
|
219
219
|
{ style: { flex: "0 0 auto", paddingTop: ".5rem" } },
|
|
220
|
-
|
|
221
|
-
disabled:
|
|
222
|
-
onClick:
|
|
220
|
+
s(y, {
|
|
221
|
+
disabled: r || u,
|
|
222
|
+
onClick: m(c),
|
|
223
223
|
uiSchema: f,
|
|
224
|
-
registry:
|
|
224
|
+
registry: b
|
|
225
225
|
})
|
|
226
226
|
)
|
|
227
227
|
)
|
|
228
228
|
);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function ve() {
|
|
231
231
|
return null;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Te(e) {
|
|
234
234
|
if (!e.title) return null;
|
|
235
|
-
const t = e.schema && e.schema.description ? String(e.schema.description) : "", i =
|
|
236
|
-
|
|
235
|
+
const t = e.schema && e.schema.description ? String(e.schema.description) : "", i = s(
|
|
236
|
+
G,
|
|
237
237
|
null,
|
|
238
238
|
e.title,
|
|
239
|
-
e.required ?
|
|
239
|
+
e.required ? s("span", { style: { color: "#b00" } }, " *") : null
|
|
240
240
|
);
|
|
241
|
-
return
|
|
241
|
+
return s(
|
|
242
242
|
"div",
|
|
243
243
|
{ style: { marginTop: "8px", marginBottom: "2px" } },
|
|
244
|
-
|
|
244
|
+
E(t, s("span", null, i))
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const t = e.registry.templates, i = t.ArrayFieldItemTemplate, n = e.uiSchema && e.uiSchema["ui:title"] || e.title,
|
|
249
|
-
return n &&
|
|
250
|
-
|
|
247
|
+
function Ie(e) {
|
|
248
|
+
const t = e.registry.templates, i = t.ArrayFieldItemTemplate, n = e.uiSchema && e.uiSchema["ui:title"] || e.title, r = [];
|
|
249
|
+
return n && r.push(
|
|
250
|
+
s(t.TitleFieldTemplate, {
|
|
251
251
|
key: "__t",
|
|
252
252
|
id: e.idSchema.$id + "__title",
|
|
253
253
|
title: n,
|
|
@@ -257,202 +257,202 @@ function ke(e) {
|
|
|
257
257
|
registry: e.registry
|
|
258
258
|
})
|
|
259
259
|
), (e.items || []).forEach(
|
|
260
|
-
({ key:
|
|
261
|
-
), e.canAdd &&
|
|
262
|
-
|
|
260
|
+
({ key: o, ...c }) => r.push(s(i, { key: o, ...c }))
|
|
261
|
+
), e.canAdd && r.push(
|
|
262
|
+
s(t.ButtonTemplates.AddButton, {
|
|
263
263
|
key: "__add",
|
|
264
264
|
onClick: e.onAddClick,
|
|
265
265
|
disabled: e.disabled || e.readonly,
|
|
266
266
|
uiSchema: e.uiSchema,
|
|
267
267
|
registry: e.registry
|
|
268
268
|
})
|
|
269
|
-
),
|
|
269
|
+
), s("div", null, r);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Ce(e) {
|
|
272
272
|
const {
|
|
273
273
|
children: t,
|
|
274
274
|
hasToolbar: i,
|
|
275
275
|
hasCopy: n,
|
|
276
|
-
hasMoveDown:
|
|
277
|
-
hasMoveUp:
|
|
278
|
-
hasRemove:
|
|
279
|
-
index:
|
|
280
|
-
onCopyIndexClick:
|
|
281
|
-
onDropIndexClick:
|
|
282
|
-
onReorderClick:
|
|
276
|
+
hasMoveDown: r,
|
|
277
|
+
hasMoveUp: o,
|
|
278
|
+
hasRemove: c,
|
|
279
|
+
index: l,
|
|
280
|
+
onCopyIndexClick: m,
|
|
281
|
+
onDropIndexClick: u,
|
|
282
|
+
onReorderClick: d,
|
|
283
283
|
disabled: f,
|
|
284
|
-
readonly:
|
|
285
|
-
uiSchema:
|
|
286
|
-
registry:
|
|
287
|
-
} = e, { CopyButton:
|
|
288
|
-
return
|
|
289
|
-
|
|
290
|
-
{ sx:
|
|
291
|
-
|
|
292
|
-
|
|
284
|
+
readonly: b,
|
|
285
|
+
uiSchema: y,
|
|
286
|
+
registry: g
|
|
287
|
+
} = e, { CopyButton: T, MoveDownButton: I, MoveUpButton: k, RemoveButton: C } = g.templates.ButtonTemplates, p = { flex: 1, paddingLeft: 6, paddingRight: 6, fontWeight: "bold", minWidth: 0 };
|
|
288
|
+
return s(
|
|
289
|
+
B,
|
|
290
|
+
{ sx: K },
|
|
291
|
+
s(
|
|
292
|
+
v,
|
|
293
293
|
{ container: !0, alignItems: "center", wrap: "nowrap" },
|
|
294
|
-
|
|
295
|
-
i &&
|
|
296
|
-
|
|
294
|
+
s(v, { item: !0, xs: !0, style: { minWidth: 0 } }, t),
|
|
295
|
+
i && s(
|
|
296
|
+
v,
|
|
297
297
|
{ item: !0 },
|
|
298
|
-
(
|
|
299
|
-
style:
|
|
300
|
-
disabled: f ||
|
|
301
|
-
onClick:
|
|
302
|
-
uiSchema:
|
|
303
|
-
registry:
|
|
298
|
+
(o || r) && s(k, {
|
|
299
|
+
style: p,
|
|
300
|
+
disabled: f || b || !o,
|
|
301
|
+
onClick: d(l, l - 1),
|
|
302
|
+
uiSchema: y,
|
|
303
|
+
registry: g
|
|
304
304
|
}),
|
|
305
|
-
(
|
|
306
|
-
style:
|
|
307
|
-
disabled: f ||
|
|
308
|
-
onClick:
|
|
309
|
-
uiSchema:
|
|
310
|
-
registry:
|
|
305
|
+
(o || r) && s(I, {
|
|
306
|
+
style: p,
|
|
307
|
+
disabled: f || b || !r,
|
|
308
|
+
onClick: d(l, l + 1),
|
|
309
|
+
uiSchema: y,
|
|
310
|
+
registry: g
|
|
311
311
|
}),
|
|
312
|
-
n &&
|
|
313
|
-
style:
|
|
314
|
-
disabled: f ||
|
|
315
|
-
onClick:
|
|
316
|
-
uiSchema:
|
|
317
|
-
registry:
|
|
312
|
+
n && s(T, {
|
|
313
|
+
style: p,
|
|
314
|
+
disabled: f || b,
|
|
315
|
+
onClick: m(l),
|
|
316
|
+
uiSchema: y,
|
|
317
|
+
registry: g
|
|
318
318
|
}),
|
|
319
|
-
|
|
320
|
-
style:
|
|
321
|
-
disabled: f ||
|
|
322
|
-
onClick:
|
|
323
|
-
uiSchema:
|
|
324
|
-
registry:
|
|
319
|
+
c && s(C, {
|
|
320
|
+
style: p,
|
|
321
|
+
disabled: f || b,
|
|
322
|
+
onClick: u(l),
|
|
323
|
+
uiSchema: y,
|
|
324
|
+
registry: g
|
|
325
325
|
})
|
|
326
326
|
)
|
|
327
327
|
)
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
|
-
const
|
|
331
|
-
FieldTemplate:
|
|
332
|
-
ObjectFieldTemplate:
|
|
333
|
-
WrapIfAdditionalTemplate:
|
|
334
|
-
DescriptionFieldTemplate:
|
|
335
|
-
TitleFieldTemplate:
|
|
336
|
-
ArrayFieldTemplate:
|
|
337
|
-
ArrayFieldItemTemplate:
|
|
338
|
-
},
|
|
339
|
-
{ key: "local", label: "From local file system", isInput: !0, Icon:
|
|
340
|
-
{ key: "datacenter", label: "From datacenter", isInput: !1, Icon:
|
|
330
|
+
const Oe = {
|
|
331
|
+
FieldTemplate: ke,
|
|
332
|
+
ObjectFieldTemplate: xe,
|
|
333
|
+
WrapIfAdditionalTemplate: Se,
|
|
334
|
+
DescriptionFieldTemplate: ve,
|
|
335
|
+
TitleFieldTemplate: Te,
|
|
336
|
+
ArrayFieldTemplate: Ie,
|
|
337
|
+
ArrayFieldItemTemplate: Ce
|
|
338
|
+
}, a = A.createElement, L = [
|
|
339
|
+
{ key: "local", label: "From local file system", isInput: !0, Icon: me },
|
|
340
|
+
{ key: "datacenter", label: "From datacenter", isInput: !1, Icon: fe }
|
|
341
341
|
];
|
|
342
|
-
function
|
|
343
|
-
const { value: t, onChange: i, disabled: n = !1, readonly:
|
|
344
|
-
|
|
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() : "", T = (S) => S && i(S.name), I = () => i(void 0), k = L[f], C = o && !l ? a(
|
|
344
|
+
v,
|
|
345
345
|
{ item: !0, zeroMinWidth: !0 },
|
|
346
|
-
|
|
347
|
-
) : null,
|
|
348
|
-
|
|
346
|
+
a(G, null, o, c ? " *" : null)
|
|
347
|
+
) : null, p = t ? a(
|
|
348
|
+
v,
|
|
349
349
|
{ item: !0, xs: !0, zeroMinWidth: !0 },
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
{ title:
|
|
353
|
-
|
|
350
|
+
a(
|
|
351
|
+
F,
|
|
352
|
+
{ title: g, arrow: !0, placement: "top" },
|
|
353
|
+
a(ne, { style: { textOverflow: "ellipsis", overflow: "hidden" } }, g)
|
|
354
354
|
)
|
|
355
|
-
) :
|
|
356
|
-
let
|
|
355
|
+
) : a(v, { item: !0, xs: !0 }, null);
|
|
356
|
+
let x;
|
|
357
357
|
if (t)
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
x = a(
|
|
359
|
+
v,
|
|
360
360
|
{ item: !0, xs: "auto" },
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
a(
|
|
362
|
+
F,
|
|
363
363
|
{ title: "Clear", arrow: !0, placement: "right" },
|
|
364
|
-
|
|
364
|
+
a(
|
|
365
365
|
"span",
|
|
366
366
|
null,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
{ onClick:
|
|
370
|
-
|
|
367
|
+
a(
|
|
368
|
+
ie,
|
|
369
|
+
{ onClick: I, size: "small", disabled: m },
|
|
370
|
+
a(ue, { fontSize: "small" })
|
|
371
371
|
)
|
|
372
372
|
)
|
|
373
373
|
)
|
|
374
374
|
);
|
|
375
375
|
else {
|
|
376
|
-
const S =
|
|
377
|
-
|
|
376
|
+
const S = k.isInput ? a(
|
|
377
|
+
w,
|
|
378
378
|
{
|
|
379
379
|
component: "label",
|
|
380
|
-
disabled:
|
|
381
|
-
endIcon:
|
|
380
|
+
disabled: m,
|
|
381
|
+
endIcon: a(k.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: (
|
|
388
|
+
onChange: (h) => T(h.target.files && h.target.files[0])
|
|
389
389
|
})
|
|
390
|
-
) :
|
|
391
|
-
|
|
390
|
+
) : a(
|
|
391
|
+
w,
|
|
392
392
|
{
|
|
393
|
-
disabled:
|
|
394
|
-
endIcon:
|
|
393
|
+
disabled: m,
|
|
394
|
+
endIcon: a(k.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
|
+
x = a(
|
|
402
|
+
v,
|
|
403
403
|
{ item: !0, xs: "auto" },
|
|
404
|
-
|
|
405
|
-
|
|
404
|
+
a(
|
|
405
|
+
re,
|
|
406
406
|
{
|
|
407
407
|
variant: "outlined",
|
|
408
|
-
disabled:
|
|
408
|
+
disabled: m,
|
|
409
409
|
sx: { "& .MuiButtonGroup-grouped": { minWidth: 0 } }
|
|
410
410
|
},
|
|
411
411
|
S,
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
a(
|
|
413
|
+
w,
|
|
414
414
|
{
|
|
415
415
|
size: "small",
|
|
416
|
-
onClick: (
|
|
416
|
+
onClick: (h) => d(h.currentTarget),
|
|
417
417
|
sx: { width: "1em", borderRadius: "0 4px 4px 0" }
|
|
418
418
|
},
|
|
419
|
-
|
|
419
|
+
a(pe, null)
|
|
420
420
|
)
|
|
421
421
|
),
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
{ anchorEl:
|
|
425
|
-
|
|
426
|
-
(
|
|
427
|
-
|
|
428
|
-
{ key:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
422
|
+
a(
|
|
423
|
+
oe,
|
|
424
|
+
{ anchorEl: u, open: y, onClose: () => d(null) },
|
|
425
|
+
L.map(
|
|
426
|
+
(h, O) => h.isInput ? a(
|
|
427
|
+
_,
|
|
428
|
+
{ key: h.key, component: "label", selected: O === f },
|
|
429
|
+
a(R, null, a(h.Icon, null)),
|
|
430
|
+
a(N, null, h.label),
|
|
431
|
+
a("input", {
|
|
432
432
|
type: "file",
|
|
433
433
|
hidden: !0,
|
|
434
|
-
onChange: (
|
|
435
|
-
|
|
434
|
+
onChange: (D) => {
|
|
435
|
+
b(O), d(null), T(D.target.files && D.target.files[0]);
|
|
436
436
|
}
|
|
437
437
|
})
|
|
438
|
-
) :
|
|
439
|
-
|
|
438
|
+
) : a(
|
|
439
|
+
_,
|
|
440
440
|
{
|
|
441
|
-
key:
|
|
442
|
-
selected:
|
|
441
|
+
key: h.key,
|
|
442
|
+
selected: O === f,
|
|
443
443
|
onClick: () => {
|
|
444
|
-
|
|
444
|
+
b(O), d(null);
|
|
445
445
|
}
|
|
446
446
|
},
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
a(R, null, a(h.Icon, null)),
|
|
448
|
+
a(N, null, h.label)
|
|
449
449
|
)
|
|
450
450
|
)
|
|
451
451
|
)
|
|
452
452
|
);
|
|
453
453
|
}
|
|
454
|
-
return
|
|
455
|
-
|
|
454
|
+
return a(
|
|
455
|
+
v,
|
|
456
456
|
{
|
|
457
457
|
container: !0,
|
|
458
458
|
direction: "row",
|
|
@@ -463,24 +463,68 @@ function Te(e) {
|
|
|
463
463
|
sx: { mt: 0.5 }
|
|
464
464
|
},
|
|
465
465
|
C,
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
p,
|
|
467
|
+
x
|
|
468
468
|
);
|
|
469
469
|
}
|
|
470
|
-
const
|
|
470
|
+
const we = `
|
|
471
471
|
.pm-field { margin: .5rem 0; }
|
|
472
472
|
/* In an additionalProperties row, align the value's first field with the key
|
|
473
473
|
field (drop its leading margin so both start at the row top). */
|
|
474
474
|
.pm-ap-value > div > .pm-field:first-child { margin-top: 0; }
|
|
475
475
|
`;
|
|
476
476
|
let W = !1;
|
|
477
|
-
function
|
|
477
|
+
function Fe() {
|
|
478
478
|
if (W || typeof document > "u") return;
|
|
479
479
|
W = !0;
|
|
480
480
|
const e = document.createElement("style");
|
|
481
|
-
e.setAttribute("data-pm-rjsf", ""), e.textContent =
|
|
481
|
+
e.setAttribute("data-pm-rjsf", ""), e.textContent = we, document.head.appendChild(e);
|
|
482
482
|
}
|
|
483
|
-
const
|
|
483
|
+
const z = ye(), q = { emptyObjectFields: "skipEmptyDefaults" };
|
|
484
|
+
function M(e, t) {
|
|
485
|
+
if (e === t) return !0;
|
|
486
|
+
if (e == null || t == null || typeof e != "object" || typeof t != "object" || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
487
|
+
const i = Object.keys(e), n = Object.keys(t);
|
|
488
|
+
return i.length === n.length && i.every((r) => M(e[r], t[r]));
|
|
489
|
+
}
|
|
490
|
+
function U(e, t, i) {
|
|
491
|
+
if (M(e, t)) return;
|
|
492
|
+
if (e && typeof e == "object" && !Array.isArray(e) && t && typeof t == "object" && !Array.isArray(t)) {
|
|
493
|
+
const r = {};
|
|
494
|
+
for (const [o, c] of Object.entries(e)) {
|
|
495
|
+
if (i.has(o)) {
|
|
496
|
+
r[o] = c;
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
499
|
+
const l = U(c, t[o], i);
|
|
500
|
+
l !== void 0 && (r[o] = l);
|
|
501
|
+
}
|
|
502
|
+
return Object.keys(r).length ? r : void 0;
|
|
503
|
+
}
|
|
504
|
+
return e;
|
|
505
|
+
}
|
|
506
|
+
function Be(e) {
|
|
507
|
+
const t = /* @__PURE__ */ new Set();
|
|
508
|
+
return (function i(n) {
|
|
509
|
+
if (Array.isArray(n)) return n.forEach(i);
|
|
510
|
+
if (n && typeof n == "object") {
|
|
511
|
+
n.discriminator && n.discriminator.propertyName && t.add(n.discriminator.propertyName);
|
|
512
|
+
for (const r of Object.values(n)) i(r);
|
|
513
|
+
}
|
|
514
|
+
})(e), t;
|
|
515
|
+
}
|
|
516
|
+
function Ee(e) {
|
|
517
|
+
const t = /* @__PURE__ */ new Set(), i = e && e.properties || {};
|
|
518
|
+
for (const [n, r] of Object.entries(i))
|
|
519
|
+
if (r && Array.isArray(r.anyOf)) {
|
|
520
|
+
const o = r.anyOf.some((l) => l && l.type === "null"), c = r.anyOf.some(
|
|
521
|
+
(l) => l && (l.$ref || l.type === "object" || l.properties || Array.isArray(l.oneOf))
|
|
522
|
+
);
|
|
523
|
+
o && c && t.add(n);
|
|
524
|
+
}
|
|
525
|
+
return t;
|
|
526
|
+
}
|
|
527
|
+
const Me = (e) => se(e || {}, {
|
|
484
528
|
components: {
|
|
485
529
|
MuiTextField: { defaultProps: { size: "small", fullWidth: !0 } },
|
|
486
530
|
MuiFormControl: { defaultProps: { size: "small", fullWidth: !0 } },
|
|
@@ -488,57 +532,73 @@ const Ae = de(), we = (e) => Z(e || {}, {
|
|
|
488
532
|
MuiCheckbox: { defaultProps: { size: "small" } }
|
|
489
533
|
}
|
|
490
534
|
});
|
|
491
|
-
function
|
|
535
|
+
function De(e, t) {
|
|
492
536
|
if (!e || typeof e != "object") return e;
|
|
493
537
|
const i = t && typeof t == "object" ? t : {};
|
|
494
538
|
let n = null;
|
|
495
|
-
for (const [
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
498
|
-
const
|
|
499
|
-
!!
|
|
539
|
+
for (const [r, o] of Object.entries(e)) {
|
|
540
|
+
const c = o && o["ui:options"] && o["ui:options"].enabledBy;
|
|
541
|
+
if (!c) continue;
|
|
542
|
+
const l = !i[c];
|
|
543
|
+
!!o["ui:disabled"] !== l && (n = n || { ...e }, n[r] = { ...o, "ui:disabled": l });
|
|
500
544
|
}
|
|
501
545
|
return n || e;
|
|
502
546
|
}
|
|
503
|
-
function
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
547
|
+
function qe({ schema: e, uiSchema: t, widgets: i, formData: n, onChange: r, onSubmit: o, ...c }) {
|
|
548
|
+
Fe();
|
|
549
|
+
const l = A.useMemo(() => be(e), [e]), m = A.useMemo(() => Be(l), [l]), u = A.useMemo(() => Ee(e), [e]), d = A.useMemo(
|
|
550
|
+
() => Y(z, l, void 0, l, !1, q),
|
|
551
|
+
[l]
|
|
552
|
+
), [f, b] = A.useState(n !== void 0 ? n : d), y = n !== void 0 ? n : f, g = (p, x) => {
|
|
553
|
+
b(p.formData), r && r(p, x);
|
|
554
|
+
}, T = De(t, y), I = { file: je, ...i || {} }, k = (p) => p.filter((x) => {
|
|
555
|
+
const S = (x.property || "").split(".").filter(Boolean)[0];
|
|
556
|
+
if (!S || !u.has(S)) return !0;
|
|
557
|
+
const h = y ? y[S] : void 0;
|
|
558
|
+
return !(h === void 0 || M(h, d[S]));
|
|
559
|
+
}), C = o ? (p, x) => o({ ...p, formData: U(p.formData, d, m) ?? {} }, x) : void 0;
|
|
560
|
+
return A.createElement(
|
|
561
|
+
le,
|
|
562
|
+
{ theme: Me },
|
|
563
|
+
A.createElement(
|
|
564
|
+
B,
|
|
513
565
|
{ sx: { color: "text.primary" } },
|
|
514
|
-
|
|
515
|
-
schema:
|
|
516
|
-
uiSchema:
|
|
517
|
-
validator:
|
|
518
|
-
templates:
|
|
519
|
-
widgets:
|
|
520
|
-
formData:
|
|
521
|
-
onChange:
|
|
522
|
-
|
|
566
|
+
A.createElement(V, {
|
|
567
|
+
schema: l,
|
|
568
|
+
uiSchema: T,
|
|
569
|
+
validator: z,
|
|
570
|
+
templates: Oe,
|
|
571
|
+
widgets: I,
|
|
572
|
+
formData: y,
|
|
573
|
+
onChange: g,
|
|
574
|
+
onSubmit: C,
|
|
575
|
+
transformErrors: k,
|
|
576
|
+
// RJSF owns validation + error display. Native HTML5 validation hard-
|
|
577
|
+
// blocks submit when a `required` control is non-focusable (e.g. inside a
|
|
578
|
+
// collapsed accordion) and does so SILENTLY -- onSubmit never fires and
|
|
579
|
+
// nothing surfaces. Let RJSF validate instead so errors are visible.
|
|
580
|
+
noHtml5Validate: !0,
|
|
581
|
+
experimental_defaultFormStateBehavior: q,
|
|
582
|
+
...c
|
|
523
583
|
})
|
|
524
584
|
)
|
|
525
585
|
);
|
|
526
586
|
}
|
|
527
587
|
export {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
588
|
+
Ie as ArrayFieldTemplate,
|
|
589
|
+
ve as DescriptionFieldTemplate,
|
|
590
|
+
ke as FieldTemplate,
|
|
591
|
+
je as FileWidget,
|
|
592
|
+
xe as GroupedObjectFieldTemplate,
|
|
593
|
+
qe as PMForm,
|
|
594
|
+
we as PM_RJSF_CSS,
|
|
595
|
+
P as SPECIAL_DIRS,
|
|
596
|
+
Te as TitleFieldTemplate,
|
|
597
|
+
Se as WrapIfAdditionalTemplate,
|
|
598
|
+
Fe as injectStyles,
|
|
599
|
+
ye as makeValidator,
|
|
600
|
+
be as prepareForRjsf,
|
|
601
|
+
j as simplify,
|
|
602
|
+
he as stripSpecialDirs,
|
|
603
|
+
Oe as templates
|
|
544
604
|
};
|