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