@devtron-labs/devtron-fe-common-lib 1.22.0-beta-10 → 1.22.0-beta-11
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/{@code-editor-DVQaVhRe.js → @code-editor-3oNEo5OH.js} +636 -638
- package/dist/{@common-rjsf-smts-NGt.js → @common-rjsf-C-XA6_6d.js} +173 -175
- package/dist/{@framer-motion-DDwxEunL.js → @framer-motion-15oDoXjC.js} +64 -64
- package/dist/{@react-select-DOdTjlKm.js → @react-select-5qCcb7qu.js} +1 -1
- package/dist/{@react-virtualized-sticky-tree-CtbSHsKR.js → @react-virtualized-sticky-tree-ByLcweNf.js} +1 -1
- package/dist/{@vendor-BfI9BrhH.js → @vendor-CIlxgD4r.js} +52112 -40697
- package/dist/index.js +7 -7
- package/package.json +4 -4
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { j as n,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { T as O, j as N, c as T, b as w, S as Q, i as X, g as Z, a as ee, d as R, e as te } from "./@code-editor-DVQaVhRe.js";
|
|
5
|
-
import { getUiOptions as B, getSubmitButtonOptions as ne, getTemplate as se, ADDITIONAL_PROPERTY_FLAG as $, errorId as re, englishStringTranslator as ae, TranslatableString as oe, titleId as ie, canExpand as le, deepEquals as ce } from "@rjsf/utils";
|
|
1
|
+
import { j as n, be as $, bf as W, bg as J, bh as K, bi as B, bj as V, aP as v, bk as q, bl as Y, aR as G, aQ as z, bm as Q, bn as X, b as Z, bo as ee } from "./@vendor-CIlxgD4r.js";
|
|
2
|
+
import te, { useState as ne, useEffect as se, forwardRef as ae, useMemo as E } from "react";
|
|
3
|
+
import { T as O, j as w, c as T, b as N, S as re, i as oe, g as le, a as ie, d as R, e as ce } from "./@code-editor-3oNEo5OH.js";
|
|
6
4
|
import { ReactComponent as de } from "./assets/ic-add.cfaa779b.svg";
|
|
7
5
|
import { ReactComponent as ue } from "./assets/ic-warning.ecf7ff97.svg";
|
|
8
6
|
import { ReactComponent as me } from "./assets/ic-cross.01e03666.svg";
|
|
@@ -10,29 +8,29 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
10
8
|
SELECT: "Please select an option",
|
|
11
9
|
INPUT: "Please enter an input",
|
|
12
10
|
OBJECT_KEY: "Please enter a value for the key"
|
|
13
|
-
}, pe = "Key not available",
|
|
11
|
+
}, pe = "Key not available", Me = {
|
|
14
12
|
"ui:submitButtonOptions": {
|
|
15
13
|
norender: !0
|
|
16
14
|
}
|
|
17
15
|
}, L = "rjsf-form-select-portal-target", fe = ({
|
|
18
16
|
children: e,
|
|
19
17
|
disabled: t,
|
|
20
|
-
hasToolbar:
|
|
18
|
+
hasToolbar: a,
|
|
21
19
|
hasRemove: s,
|
|
22
|
-
onRemoveItem:
|
|
23
|
-
readonly:
|
|
20
|
+
onRemoveItem: r,
|
|
21
|
+
readonly: i,
|
|
24
22
|
registry: o,
|
|
25
|
-
uiSchema:
|
|
23
|
+
uiSchema: l
|
|
26
24
|
}) => {
|
|
27
25
|
const { RemoveButton: c } = o.templates.ButtonTemplates;
|
|
28
26
|
return /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel display-grid rjsf-form-template__array-field-item flex-align-center", children: [
|
|
29
27
|
e,
|
|
30
|
-
/* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children:
|
|
28
|
+
/* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: a && s && /* @__PURE__ */ n.jsx(
|
|
31
29
|
c,
|
|
32
30
|
{
|
|
33
|
-
disabled: t ||
|
|
34
|
-
onClick:
|
|
35
|
-
uiSchema:
|
|
31
|
+
disabled: t || i,
|
|
32
|
+
onClick: r,
|
|
33
|
+
uiSchema: l,
|
|
36
34
|
registry: o
|
|
37
35
|
}
|
|
38
36
|
) })
|
|
@@ -40,62 +38,62 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
40
38
|
}, S = ({
|
|
41
39
|
showLabel: e,
|
|
42
40
|
label: t,
|
|
43
|
-
required:
|
|
41
|
+
required: a,
|
|
44
42
|
children: s,
|
|
45
|
-
id:
|
|
46
|
-
rawDescription:
|
|
43
|
+
id: r,
|
|
44
|
+
rawDescription: i,
|
|
47
45
|
shouldAlignCenter: o = !0
|
|
48
46
|
}) => /* @__PURE__ */ n.jsxs(
|
|
49
47
|
"div",
|
|
50
48
|
{
|
|
51
49
|
className: e ? `display-grid dc__gap-12 rjsf-form-template__field ${o ? "" : "rjsf-form-template__field--align-top"}` : "",
|
|
52
50
|
children: [
|
|
53
|
-
e && /* @__PURE__ */ n.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor:
|
|
54
|
-
/* @__PURE__ */ n.jsx(O, { alwaysShowTippyOnHover: !!
|
|
55
|
-
|
|
51
|
+
e && /* @__PURE__ */ n.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor: r, children: [
|
|
52
|
+
/* @__PURE__ */ n.jsx(O, { alwaysShowTippyOnHover: !!i, content: i, children: /* @__PURE__ */ n.jsx("span", { className: `dc__ellipsis-right ${i ? "dc__underline-dotted" : ""}`, children: t || pe }) }),
|
|
53
|
+
a && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
|
56
54
|
] }),
|
|
57
55
|
s
|
|
58
56
|
]
|
|
59
57
|
}
|
|
60
|
-
), A = ({ label: e, canAdd: t, onAddClick:
|
|
58
|
+
), A = ({ label: e, canAdd: t, onAddClick: a, disabled: s, readonly: r, uiSchema: i, registry: o }) => {
|
|
61
59
|
const {
|
|
62
|
-
ButtonTemplates: { AddButton:
|
|
60
|
+
ButtonTemplates: { AddButton: l }
|
|
63
61
|
} = o.templates;
|
|
64
62
|
return t && /* @__PURE__ */ n.jsx(
|
|
65
|
-
|
|
63
|
+
l,
|
|
66
64
|
{
|
|
67
65
|
label: e,
|
|
68
|
-
onClick:
|
|
69
|
-
disabled: s ||
|
|
70
|
-
uiSchema:
|
|
66
|
+
onClick: a,
|
|
67
|
+
disabled: s || r,
|
|
68
|
+
uiSchema: i,
|
|
71
69
|
registry: o
|
|
72
70
|
}
|
|
73
71
|
);
|
|
74
72
|
}, he = ({
|
|
75
73
|
canAdd: e,
|
|
76
74
|
className: t,
|
|
77
|
-
disabled:
|
|
75
|
+
disabled: a,
|
|
78
76
|
fieldPathId: s,
|
|
79
|
-
uiSchema:
|
|
80
|
-
items:
|
|
77
|
+
uiSchema: r,
|
|
78
|
+
items: i,
|
|
81
79
|
onAddClick: o,
|
|
82
|
-
readonly:
|
|
80
|
+
readonly: l,
|
|
83
81
|
registry: c,
|
|
84
82
|
required: d,
|
|
85
83
|
title: p
|
|
86
84
|
}) => {
|
|
87
|
-
const u =
|
|
88
|
-
return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: s.$id, children:
|
|
89
|
-
|
|
85
|
+
const u = $(r).title || p;
|
|
86
|
+
return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: s.$id, children: i.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
87
|
+
i,
|
|
90
88
|
/* @__PURE__ */ n.jsx(
|
|
91
89
|
A,
|
|
92
90
|
{
|
|
93
91
|
label: u,
|
|
94
92
|
canAdd: e,
|
|
95
93
|
onAddClick: o,
|
|
96
|
-
disabled:
|
|
97
|
-
readonly:
|
|
98
|
-
uiSchema:
|
|
94
|
+
disabled: a,
|
|
95
|
+
readonly: l,
|
|
96
|
+
uiSchema: r,
|
|
99
97
|
registry: c
|
|
100
98
|
}
|
|
101
99
|
)
|
|
@@ -105,20 +103,20 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
105
103
|
label: u,
|
|
106
104
|
canAdd: e,
|
|
107
105
|
onAddClick: o,
|
|
108
|
-
disabled:
|
|
109
|
-
readonly:
|
|
110
|
-
uiSchema:
|
|
106
|
+
disabled: a,
|
|
107
|
+
readonly: l,
|
|
108
|
+
uiSchema: r,
|
|
111
109
|
registry: c
|
|
112
110
|
}
|
|
113
111
|
) }) });
|
|
114
112
|
}, {
|
|
115
113
|
templates: { BaseInputTemplate: _e }
|
|
116
|
-
} =
|
|
117
|
-
const { schema:
|
|
114
|
+
} = W(), xe = ({ placeholder: e, ...t }) => {
|
|
115
|
+
const { schema: a } = t;
|
|
118
116
|
return /* @__PURE__ */ n.jsx(
|
|
119
117
|
_e,
|
|
120
118
|
{
|
|
121
|
-
placeholder:
|
|
119
|
+
placeholder: a.placeholder || e || F.INPUT,
|
|
122
120
|
...t,
|
|
123
121
|
className: "form__input cn-9 fs-13 lh-20 fw-4"
|
|
124
122
|
}
|
|
@@ -126,16 +124,16 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
126
124
|
}, U = ({
|
|
127
125
|
label: e,
|
|
128
126
|
icon: t,
|
|
129
|
-
iconType:
|
|
127
|
+
iconType: a,
|
|
130
128
|
registry: s,
|
|
131
|
-
uiSchema:
|
|
132
|
-
...
|
|
129
|
+
uiSchema: r,
|
|
130
|
+
...i
|
|
133
131
|
}) => {
|
|
134
132
|
const o = `Add ${e}`;
|
|
135
133
|
return /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-start", children: /* @__PURE__ */ n.jsxs(
|
|
136
134
|
"button",
|
|
137
135
|
{
|
|
138
|
-
...
|
|
136
|
+
...i,
|
|
139
137
|
type: "button",
|
|
140
138
|
className: "dc__outline-none-imp p-0 dc__transparent flex dc__gap-4 cursor dc__mxw-250",
|
|
141
139
|
title: "Add",
|
|
@@ -145,44 +143,44 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
145
143
|
]
|
|
146
144
|
}
|
|
147
145
|
) });
|
|
148
|
-
}, je = ({ icon: e, iconType: t, registry:
|
|
149
|
-
const { submitText: t, norender:
|
|
150
|
-
return
|
|
146
|
+
}, je = ({ icon: e, iconType: t, registry: a, uiSchema: s, ...r }) => /* @__PURE__ */ n.jsx("button", { ...r, type: "button", className: "dc__outline-none-imp p-0 dc__transparent flex cursor", title: "Remove", children: /* @__PURE__ */ n.jsx(me, { className: "icon-dim-16 fcn-6" }) }), be = ({ uiSchema: e }) => {
|
|
147
|
+
const { submitText: t, norender: a, props: s = {} } = J(e);
|
|
148
|
+
return a ? null : /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-end", children: /* @__PURE__ */ n.jsx("button", { type: "submit", ...s, className: `cta ${s.className || ""}`, children: t }) });
|
|
151
149
|
}, P = ({
|
|
152
150
|
id: e,
|
|
153
151
|
title: t,
|
|
154
|
-
required:
|
|
152
|
+
required: a,
|
|
155
153
|
description: s
|
|
156
154
|
}) => /* @__PURE__ */ n.jsxs("legend", { className: "fs-13 fw-6 cn-9 lh-20 dc__no-border pb-9 mb-0", id: e, children: [
|
|
157
155
|
/* @__PURE__ */ n.jsx(O, { alwaysShowTippyOnHover: !!s, content: s, children: /* @__PURE__ */ n.jsx("span", { className: `${s ? "dc__underline-dotted" : ""}`, children: t }) }),
|
|
158
|
-
|
|
159
|
-
] }),
|
|
156
|
+
a && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
|
157
|
+
] }), ge = (e) => {
|
|
160
158
|
const {
|
|
161
159
|
id: t,
|
|
162
|
-
label:
|
|
160
|
+
label: a,
|
|
163
161
|
children: s,
|
|
164
|
-
errors:
|
|
165
|
-
hidden:
|
|
162
|
+
errors: r,
|
|
163
|
+
hidden: i,
|
|
166
164
|
required: o,
|
|
167
|
-
displayLabel:
|
|
165
|
+
displayLabel: l,
|
|
168
166
|
registry: c,
|
|
169
167
|
uiSchema: d,
|
|
170
168
|
classNames: p,
|
|
171
169
|
schema: m,
|
|
172
170
|
rawDescription: u
|
|
173
|
-
} = e, f =
|
|
171
|
+
} = e, f = $(d), h = K(
|
|
174
172
|
"WrapIfAdditionalTemplate",
|
|
175
173
|
c,
|
|
176
174
|
f
|
|
177
|
-
), x =
|
|
178
|
-
return
|
|
175
|
+
), x = B in m, _ = (l || m.type === "boolean") && !x, j = m.type === "array";
|
|
176
|
+
return i ? /* @__PURE__ */ n.jsx("div", { className: "hidden", children: s }) : (
|
|
179
177
|
// NOTE: need to override the margins of default rjsf css
|
|
180
178
|
/* @__PURE__ */ n.jsxs("div", { className: `${p} mb-0`, children: [
|
|
181
179
|
j && /* @__PURE__ */ n.jsx(
|
|
182
180
|
P,
|
|
183
181
|
{
|
|
184
182
|
id: t,
|
|
185
|
-
title:
|
|
183
|
+
title: a,
|
|
186
184
|
required: o,
|
|
187
185
|
registry: c,
|
|
188
186
|
uiSchema: d,
|
|
@@ -193,7 +191,7 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
193
191
|
/* @__PURE__ */ n.jsx(
|
|
194
192
|
S,
|
|
195
193
|
{
|
|
196
|
-
label:
|
|
194
|
+
label: a,
|
|
197
195
|
showLabel: _,
|
|
198
196
|
id: t,
|
|
199
197
|
required: o,
|
|
@@ -201,26 +199,26 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
201
199
|
children: /* @__PURE__ */ n.jsx(h, { ...e, children: s })
|
|
202
200
|
}
|
|
203
201
|
),
|
|
204
|
-
|
|
202
|
+
r
|
|
205
203
|
] })
|
|
206
204
|
);
|
|
207
205
|
}, ye = ({ errors: e = [], fieldPathId: t }) => {
|
|
208
|
-
const
|
|
209
|
-
return e.length > 0 && /* @__PURE__ */ n.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id:
|
|
206
|
+
const a = V(t);
|
|
207
|
+
return e.length > 0 && /* @__PURE__ */ n.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id: a, children: e.filter((s) => !!s).map((s, r) => /* @__PURE__ */ n.jsxs(te.Fragment, { children: [
|
|
210
208
|
/* @__PURE__ */ n.jsx("span", {}),
|
|
211
209
|
/* @__PURE__ */ n.jsxs("span", { className: "form__error", children: [
|
|
212
210
|
/* @__PURE__ */ n.jsx(ue, { className: "form__icon form__icon--error" }),
|
|
213
211
|
s
|
|
214
212
|
] })
|
|
215
|
-
] },
|
|
213
|
+
] }, r)) });
|
|
216
214
|
}, ve = (e, t) => {
|
|
217
215
|
switch (e) {
|
|
218
|
-
case
|
|
216
|
+
case Y.NewStringDefault:
|
|
219
217
|
return "";
|
|
220
218
|
default:
|
|
221
|
-
return
|
|
219
|
+
return q(e, t);
|
|
222
220
|
}
|
|
223
|
-
},
|
|
221
|
+
}, We = (e) => {
|
|
224
222
|
try {
|
|
225
223
|
const t = new URL(e).origin === window.location.origin;
|
|
226
224
|
return {
|
|
@@ -236,7 +234,7 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
236
234
|
url: `${e} (Invalid URL)`
|
|
237
235
|
};
|
|
238
236
|
}
|
|
239
|
-
},
|
|
237
|
+
}, Je = (e) => {
|
|
240
238
|
const t = typeof e;
|
|
241
239
|
switch (t) {
|
|
242
240
|
case "boolean":
|
|
@@ -270,94 +268,94 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
270
268
|
value: t.value,
|
|
271
269
|
path: y(t.path)
|
|
272
270
|
} : structuredClone(I);
|
|
273
|
-
}, k = (e, t,
|
|
274
|
-
e && (e.type === "object" && e.properties && typeof e.properties == "object" && Object.entries(e.properties).forEach(([s,
|
|
275
|
-
k(
|
|
276
|
-
}), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (
|
|
271
|
+
}, k = (e, t, a) => {
|
|
272
|
+
e && (e.type === "object" && e.properties && typeof e.properties == "object" && Object.entries(e.properties).forEach(([s, r]) => {
|
|
273
|
+
k(r, `${t}/${s}`, a);
|
|
274
|
+
}), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (a[t] = y(e.updatePath ?? t)));
|
|
277
275
|
}, Se = (e) => {
|
|
278
276
|
const t = {};
|
|
279
277
|
return k(e, "", t), t;
|
|
280
|
-
}, H = (e, t,
|
|
281
|
-
if (t >=
|
|
278
|
+
}, H = (e, t, a) => {
|
|
279
|
+
if (t >= a.length)
|
|
282
280
|
return e;
|
|
283
|
-
const s =
|
|
284
|
-
if (t ===
|
|
285
|
-
const
|
|
286
|
-
return delete
|
|
281
|
+
const s = a[t];
|
|
282
|
+
if (t === a.length - 1) {
|
|
283
|
+
const r = structuredClone(e);
|
|
284
|
+
return delete r[s], r;
|
|
287
285
|
}
|
|
288
|
-
if (e[s] && (e[s] = H(e[s], t + 1,
|
|
289
|
-
const
|
|
290
|
-
return delete
|
|
286
|
+
if (e[s] && (e[s] = H(e[s], t + 1, a)), Object.keys(e[s] ?? {}).length === 0) {
|
|
287
|
+
const r = structuredClone(e);
|
|
288
|
+
return delete r[s], r;
|
|
291
289
|
}
|
|
292
290
|
return e;
|
|
293
|
-
},
|
|
291
|
+
}, we = (e, t) => {
|
|
294
292
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
295
293
|
throw new Error("Invalid object");
|
|
296
294
|
if (!t || !t.startsWith("/"))
|
|
297
295
|
throw new Error("Invalid path");
|
|
298
|
-
const
|
|
299
|
-
return H(e, 0,
|
|
296
|
+
const a = t.split("/").slice(1);
|
|
297
|
+
return H(e, 0, a);
|
|
300
298
|
}, D = ({
|
|
301
299
|
formState: e,
|
|
302
300
|
formData: t,
|
|
303
|
-
schemaPathToUpdatePathMap:
|
|
301
|
+
schemaPathToUpdatePathMap: a
|
|
304
302
|
}) => {
|
|
305
303
|
let s = structuredClone(e);
|
|
306
|
-
return s && (Object.entries(
|
|
307
|
-
if (
|
|
304
|
+
return s && (Object.entries(a).forEach(([r, i]) => {
|
|
305
|
+
if (r === i || !i)
|
|
308
306
|
return;
|
|
309
307
|
const o = v({
|
|
310
308
|
json: t,
|
|
311
|
-
path: T(
|
|
309
|
+
path: T(r),
|
|
312
310
|
resultType: "value",
|
|
313
311
|
wrap: !1
|
|
314
312
|
});
|
|
315
|
-
o === void 0 ? s =
|
|
316
|
-
const
|
|
313
|
+
o === void 0 ? s = we(s, r) : s = w([N(r, o), s]);
|
|
314
|
+
const l = v({
|
|
317
315
|
json: e,
|
|
318
|
-
path: T(
|
|
316
|
+
path: T(r),
|
|
319
317
|
resultType: "value",
|
|
320
318
|
wrap: !1
|
|
321
319
|
});
|
|
322
|
-
|
|
323
|
-
}), t && s ?
|
|
324
|
-
},
|
|
325
|
-
...Object.entries(t).map(([
|
|
326
|
-
if (
|
|
320
|
+
l !== void 0 && (s = w([N(i, l), s]));
|
|
321
|
+
}), t && s ? G(t, z(t, s), !1, !1).newDocument : s);
|
|
322
|
+
}, Ne = ({ formData: e, schemaPathToUpdatePathMap: t }) => w([
|
|
323
|
+
...Object.entries(t).map(([a, s]) => {
|
|
324
|
+
if (a === s || !s)
|
|
327
325
|
return {};
|
|
328
|
-
const
|
|
326
|
+
const r = v({
|
|
329
327
|
json: e,
|
|
330
328
|
path: T(s),
|
|
331
329
|
resultType: "value",
|
|
332
330
|
wrap: !1
|
|
333
331
|
});
|
|
334
|
-
return
|
|
332
|
+
return r === void 0 ? {} : N(a, r);
|
|
335
333
|
}),
|
|
336
334
|
structuredClone(e)
|
|
337
335
|
]), Oe = ({
|
|
338
336
|
disabled: e,
|
|
339
337
|
formData: t,
|
|
340
|
-
fieldPathId:
|
|
338
|
+
fieldPathId: a,
|
|
341
339
|
onAddProperty: s,
|
|
342
|
-
properties:
|
|
343
|
-
readonly:
|
|
340
|
+
properties: r,
|
|
341
|
+
readonly: i,
|
|
344
342
|
registry: o,
|
|
345
|
-
required:
|
|
343
|
+
required: l,
|
|
346
344
|
schema: c,
|
|
347
345
|
title: d,
|
|
348
346
|
uiSchema: p
|
|
349
347
|
}) => {
|
|
350
|
-
const m = !!c.additionalProperties, u =
|
|
348
|
+
const m = !!c.additionalProperties, u = X(c, p, t) && /* @__PURE__ */ n.jsx(
|
|
351
349
|
U,
|
|
352
350
|
{
|
|
353
351
|
label: d,
|
|
354
352
|
className: "object-property-expand",
|
|
355
353
|
onClick: s,
|
|
356
|
-
disabled: e ||
|
|
354
|
+
disabled: e || i,
|
|
357
355
|
uiSchema: p,
|
|
358
356
|
registry: o
|
|
359
357
|
}
|
|
360
|
-
), f =
|
|
358
|
+
), f = r.filter((h) => {
|
|
361
359
|
const x = c.properties?.[h.name]?.hidden;
|
|
362
360
|
if (!x)
|
|
363
361
|
return !0;
|
|
@@ -371,47 +369,47 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
371
369
|
resultType: "value",
|
|
372
370
|
wrap: !1
|
|
373
371
|
});
|
|
374
|
-
return !(j === void 0 ||
|
|
372
|
+
return !(j === void 0 || Z(_.value, j));
|
|
375
373
|
} catch {
|
|
376
374
|
return !0;
|
|
377
375
|
}
|
|
378
376
|
}).map((h) => h.content);
|
|
379
|
-
return m ?
|
|
377
|
+
return m ? r.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
380
378
|
/* @__PURE__ */ n.jsx(
|
|
381
379
|
S,
|
|
382
380
|
{
|
|
383
381
|
label: d,
|
|
384
|
-
required:
|
|
382
|
+
required: l,
|
|
385
383
|
showLabel: !0,
|
|
386
|
-
id:
|
|
384
|
+
id: a.$id,
|
|
387
385
|
shouldAlignCenter: !1,
|
|
388
386
|
children: /* @__PURE__ */ n.jsx("div", { children: f })
|
|
389
387
|
}
|
|
390
388
|
),
|
|
391
389
|
u
|
|
392
|
-
] }) : /* @__PURE__ */ n.jsx(S, { label: d, required:
|
|
390
|
+
] }) : /* @__PURE__ */ n.jsx(S, { label: d, required: l, showLabel: !0, id: a.$id, children: u }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
393
391
|
f,
|
|
394
392
|
u
|
|
395
393
|
] });
|
|
396
394
|
}, Fe = (e) => {
|
|
397
|
-
const { fieldPathId: t, registry:
|
|
395
|
+
const { fieldPathId: t, registry: a, required: s, schema: r, title: i, uiSchema: o, description: l } = e, c = !!r.additionalProperties, d = i && !c;
|
|
398
396
|
return /* @__PURE__ */ n.jsxs("fieldset", { id: t.$id, children: [
|
|
399
397
|
d && /* @__PURE__ */ n.jsx(
|
|
400
398
|
P,
|
|
401
399
|
{
|
|
402
|
-
id:
|
|
403
|
-
title:
|
|
400
|
+
id: Q(t),
|
|
401
|
+
title: i,
|
|
404
402
|
required: s,
|
|
405
|
-
schema:
|
|
403
|
+
schema: r,
|
|
406
404
|
uiSchema: o,
|
|
407
|
-
registry:
|
|
408
|
-
description:
|
|
405
|
+
registry: a,
|
|
406
|
+
description: l
|
|
409
407
|
}
|
|
410
408
|
),
|
|
411
409
|
/* @__PURE__ */ n.jsx(
|
|
412
410
|
"div",
|
|
413
411
|
{
|
|
414
|
-
className: `${
|
|
412
|
+
className: `${r.properties && !c && t.$id !== "root" ? "dc__border-left pl-12" : ""} ${t.$id === "root" ? "dc__separated-flexbox dc__separated-flexbox--vertical" : "flexbox-col dc__gap-8"}`,
|
|
415
413
|
children: /* @__PURE__ */ n.jsx(Oe, { ...e })
|
|
416
414
|
}
|
|
417
415
|
)
|
|
@@ -419,16 +417,16 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
419
417
|
}, Pe = ({
|
|
420
418
|
id: e,
|
|
421
419
|
disabled: t,
|
|
422
|
-
label:
|
|
420
|
+
label: a,
|
|
423
421
|
onKeyRename: s,
|
|
424
|
-
onRemoveProperty:
|
|
425
|
-
readonly:
|
|
422
|
+
onRemoveProperty: r,
|
|
423
|
+
readonly: i,
|
|
426
424
|
schema: o,
|
|
427
|
-
children:
|
|
425
|
+
children: l,
|
|
428
426
|
uiSchema: c,
|
|
429
427
|
registry: d
|
|
430
428
|
}) => {
|
|
431
|
-
const { templates: p } = d, { RemoveButton: m } = p.ButtonTemplates, u =
|
|
429
|
+
const { templates: p } = d, { RemoveButton: m } = p.ButtonTemplates, u = B in o;
|
|
432
430
|
return /* @__PURE__ */ n.jsx(n.Fragment, { children: u ? /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel rjsf-form-template__additional-fields display-grid dc__gap-8 flex-align-center", children: [
|
|
433
431
|
/* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(
|
|
434
432
|
"input",
|
|
@@ -438,41 +436,41 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
438
436
|
id: `${e}-key`,
|
|
439
437
|
onBlur: (f) => s(f.target.value),
|
|
440
438
|
placeholder: F.OBJECT_KEY,
|
|
441
|
-
defaultValue:
|
|
439
|
+
defaultValue: a
|
|
442
440
|
}
|
|
443
441
|
) }),
|
|
444
|
-
/* @__PURE__ */ n.jsx("div", { children:
|
|
442
|
+
/* @__PURE__ */ n.jsx("div", { children: l }),
|
|
445
443
|
/* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: /* @__PURE__ */ n.jsx(
|
|
446
444
|
m,
|
|
447
445
|
{
|
|
448
|
-
disabled: t ||
|
|
449
|
-
onClick:
|
|
446
|
+
disabled: t || i,
|
|
447
|
+
onClick: r,
|
|
450
448
|
uiSchema: c,
|
|
451
449
|
registry: d
|
|
452
450
|
}
|
|
453
451
|
) })
|
|
454
|
-
] }) :
|
|
452
|
+
] }) : l });
|
|
455
453
|
}, Ce = ({
|
|
456
454
|
id: e,
|
|
457
455
|
onChange: t,
|
|
458
|
-
value:
|
|
456
|
+
value: a,
|
|
459
457
|
disabled: s,
|
|
460
|
-
readonly:
|
|
461
|
-
autofocus:
|
|
458
|
+
readonly: r,
|
|
459
|
+
autofocus: i
|
|
462
460
|
}) => {
|
|
463
|
-
const o =
|
|
461
|
+
const o = oe(a) ? !1 : a, l = () => {
|
|
464
462
|
t(!o);
|
|
465
463
|
};
|
|
466
464
|
return /* @__PURE__ */ n.jsxs("div", { className: "flexbox dc__align-items-center dc__gap-8", children: [
|
|
467
465
|
/* @__PURE__ */ n.jsx(
|
|
468
|
-
|
|
466
|
+
re,
|
|
469
467
|
{
|
|
470
468
|
name: e,
|
|
471
469
|
ariaLabel: e,
|
|
472
|
-
onChange:
|
|
470
|
+
onChange: l,
|
|
473
471
|
isChecked: o,
|
|
474
|
-
autoFocus:
|
|
475
|
-
isDisabled: s ||
|
|
472
|
+
autoFocus: i,
|
|
473
|
+
isDisabled: s || r
|
|
476
474
|
}
|
|
477
475
|
),
|
|
478
476
|
/* @__PURE__ */ n.jsx("span", { className: "dc__capitalize", children: o.toString() })
|
|
@@ -480,38 +478,38 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
480
478
|
}, Ee = (e) => {
|
|
481
479
|
const {
|
|
482
480
|
id: t,
|
|
483
|
-
multiple:
|
|
481
|
+
multiple: a = !1,
|
|
484
482
|
options: s,
|
|
485
|
-
value:
|
|
486
|
-
disabled:
|
|
483
|
+
value: r,
|
|
484
|
+
disabled: i,
|
|
487
485
|
readonly: o,
|
|
488
|
-
autofocus:
|
|
486
|
+
autofocus: l = !1,
|
|
489
487
|
onChange: c,
|
|
490
488
|
onBlur: d,
|
|
491
489
|
onFocus: p,
|
|
492
490
|
placeholder: m,
|
|
493
491
|
schema: u
|
|
494
|
-
} = e, { enumOptions: f = [] } = s, h =
|
|
495
|
-
c(
|
|
496
|
-
}, [_, j] =
|
|
497
|
-
|
|
498
|
-
j(
|
|
492
|
+
} = e, { enumOptions: f = [] } = s, h = a ? [] : null, x = (b) => {
|
|
493
|
+
c(a ? b.map((g) => g.value) : b.value);
|
|
494
|
+
}, [_, j] = ne();
|
|
495
|
+
se(() => {
|
|
496
|
+
j(le(8));
|
|
499
497
|
}, []);
|
|
500
|
-
const C = (
|
|
498
|
+
const C = (b) => a ? f.filter((g) => b.some((M) => R(M, g.value))) : f.find((g) => R(b, g.value));
|
|
501
499
|
return /* @__PURE__ */ n.jsx(
|
|
502
|
-
|
|
500
|
+
ie,
|
|
503
501
|
{
|
|
504
502
|
inputId: `devtron-rjsf-select__${t}`,
|
|
505
503
|
name: t,
|
|
506
|
-
isMulti:
|
|
507
|
-
value: typeof
|
|
508
|
-
autoFocus:
|
|
504
|
+
isMulti: a,
|
|
505
|
+
value: typeof r > "u" ? h : C(r),
|
|
506
|
+
autoFocus: l,
|
|
509
507
|
onChange: x,
|
|
510
508
|
options: f,
|
|
511
|
-
onBlur: () => d(t,
|
|
512
|
-
onFocus: () => p(t,
|
|
509
|
+
onBlur: () => d(t, r),
|
|
510
|
+
onFocus: () => p(t, r),
|
|
513
511
|
placeholder: u.placeholder || m || F.SELECT,
|
|
514
|
-
isDisabled:
|
|
512
|
+
isDisabled: i || o,
|
|
515
513
|
menuPortalTarget: document.getElementById(L),
|
|
516
514
|
menuPosition: "fixed"
|
|
517
515
|
},
|
|
@@ -524,37 +522,37 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
524
522
|
ArrayFieldItemTemplate: fe,
|
|
525
523
|
ArrayFieldTemplate: he,
|
|
526
524
|
BaseInputTemplate: xe,
|
|
527
|
-
ButtonTemplates: { AddButton: U, RemoveButton: je, SubmitButton:
|
|
528
|
-
FieldTemplate:
|
|
525
|
+
ButtonTemplates: { AddButton: U, RemoveButton: je, SubmitButton: be },
|
|
526
|
+
FieldTemplate: ge,
|
|
529
527
|
FieldErrorTemplate: ye,
|
|
530
528
|
ObjectFieldTemplate: Fe,
|
|
531
529
|
TitleFieldTemplate: P,
|
|
532
530
|
WrapIfAdditionalTemplate: Pe
|
|
533
|
-
}, Ie =
|
|
534
|
-
const { schemaPathToUpdatePathMap:
|
|
535
|
-
const
|
|
531
|
+
}, Ie = ee, De = ce, Ke = ae((e, t) => {
|
|
532
|
+
const { schemaPathToUpdatePathMap: a, isUpdatePathKeywordPresent: s } = E(() => {
|
|
533
|
+
const l = Se(e.schema);
|
|
536
534
|
return {
|
|
537
|
-
schemaPathToUpdatePathMap:
|
|
538
|
-
isUpdatePathKeywordPresent: Object.entries(
|
|
535
|
+
schemaPathToUpdatePathMap: l,
|
|
536
|
+
isUpdatePathKeywordPresent: Object.entries(l).some(([c, d]) => c !== d)
|
|
539
537
|
};
|
|
540
|
-
}, [e.schema]),
|
|
538
|
+
}, [e.schema]), r = E(() => s ? Ne({ formData: e.formData ?? {}, schemaPathToUpdatePathMap: a }) : e.formData, [e.formData, a, s]), i = (l) => {
|
|
541
539
|
if (!e.onChange)
|
|
542
540
|
return;
|
|
543
541
|
const c = D({
|
|
544
|
-
formState:
|
|
542
|
+
formState: l.formData,
|
|
545
543
|
formData: e.formData,
|
|
546
|
-
schemaPathToUpdatePathMap:
|
|
544
|
+
schemaPathToUpdatePathMap: a
|
|
547
545
|
});
|
|
548
|
-
e.onChange({ ...
|
|
549
|
-
}, o = (
|
|
546
|
+
e.onChange({ ...l, formData: c });
|
|
547
|
+
}, o = (l, c) => {
|
|
550
548
|
if (!e.onSubmit)
|
|
551
549
|
return;
|
|
552
550
|
const d = D({
|
|
553
|
-
formState:
|
|
551
|
+
formState: l.formData,
|
|
554
552
|
formData: e.formData,
|
|
555
|
-
schemaPathToUpdatePathMap:
|
|
553
|
+
schemaPathToUpdatePathMap: a
|
|
556
554
|
});
|
|
557
|
-
e.onSubmit?.({ ...
|
|
555
|
+
e.onSubmit?.({ ...l, formData: d }, c);
|
|
558
556
|
};
|
|
559
557
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
560
558
|
/* @__PURE__ */ n.jsx(
|
|
@@ -564,9 +562,9 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
564
562
|
showErrorList: !1,
|
|
565
563
|
autoComplete: "off",
|
|
566
564
|
...e,
|
|
567
|
-
formData:
|
|
565
|
+
formData: r,
|
|
568
566
|
...s ? {
|
|
569
|
-
onChange:
|
|
567
|
+
onChange: i,
|
|
570
568
|
onSubmit: o
|
|
571
569
|
} : {},
|
|
572
570
|
className: `rjsf-form-template__container ${e.className || ""}`,
|
|
@@ -575,7 +573,7 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
575
573
|
...Ae,
|
|
576
574
|
...e.templates
|
|
577
575
|
},
|
|
578
|
-
formContext:
|
|
576
|
+
formContext: r,
|
|
579
577
|
widgets: { ...Re, ...e.widgets },
|
|
580
578
|
translateString: ve,
|
|
581
579
|
ref: t
|
|
@@ -585,10 +583,10 @@ import './assets/@common-rjsf.css';const F = {
|
|
|
585
583
|
] });
|
|
586
584
|
});
|
|
587
585
|
export {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
586
|
+
Me as H,
|
|
587
|
+
Ke as R,
|
|
588
|
+
We as a,
|
|
591
589
|
Se as b,
|
|
592
590
|
y as c,
|
|
593
|
-
|
|
591
|
+
Je as g
|
|
594
592
|
};
|