@devtron-labs/devtron-fe-common-lib 1.18.1 → 1.19.0
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-Cmi_dLiG.js → @code-editor-GtoBp4ff.js} +8406 -7972
- package/dist/{@common-rjsf-DTSwvp93.js → @common-rjsf-BfawWJnS.js} +179 -173
- package/dist/{@framer-motion-j6RIjEIR.js → @framer-motion-DZveCoIL.js} +1 -1
- package/dist/{@react-dates-BVyHiOGU.js → @react-dates-CZ1bNWJM.js} +213 -213
- package/dist/{@react-select-BQNFZu0Y.js → @react-select-DS68hCUM.js} +1 -1
- package/dist/{@react-virtualized-sticky-tree-CuElh0mS.js → @react-virtualized-sticky-tree-V-8klKy9.js} +1 -1
- package/dist/{@vendor-DbxoIktR.js → @vendor-3ORIJA0h.js} +22139 -16828
- package/dist/Common/API/CoreAPI.d.ts +11 -0
- package/dist/Common/API/QueryClientProvider.d.ts +2 -0
- package/dist/Common/API/index.d.ts +2 -0
- package/dist/Common/API/reactQueryHooks.d.ts +6 -0
- package/dist/Common/Constants.d.ts +1 -2
- package/dist/Common/Drawer/Drawer.d.ts +3 -2
- package/dist/Common/Modals/Modal.d.ts +1 -2
- package/dist/Common/Modals/VisibleModal.d.ts +6 -8
- package/dist/Common/Modals/VisibleModal2.d.ts +4 -7
- package/dist/Common/RJSF/Form.d.ts +1 -1
- package/dist/Common/SearchBar/SearchBar.component.d.ts +1 -1
- package/dist/Common/SearchBar/types.d.ts +7 -0
- package/dist/Common/Types.d.ts +0 -1
- package/dist/Pages/BulkEdit/index.d.ts +1 -0
- package/dist/Pages/BulkEdit/types.d.ts +50 -0
- package/dist/Pages/ResourceBrowser/ClusterMap/ClusterMap.d.ts +2 -0
- package/dist/Pages/ResourceBrowser/ClusterMap/index.d.ts +1 -0
- package/dist/Pages/ResourceBrowser/ClusterMap/types.d.ts +27 -0
- package/dist/Pages/ResourceBrowser/ClusterMap/utils.d.ts +14 -0
- package/dist/Pages/ResourceBrowser/index.d.ts +1 -0
- package/dist/Pages/ResourceBrowser/types.d.ts +1 -1
- package/dist/Pages/index.d.ts +1 -0
- package/dist/Shared/Components/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Shared/Components/Backdrop/types.d.ts +2 -10
- package/dist/Shared/Components/Button/Button.component.d.ts +24 -12
- package/dist/Shared/Components/Button/types.d.ts +4 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.d.ts +1 -1
- package/dist/Shared/Components/Chip/Chip.component.d.ts +3 -0
- package/dist/Shared/Components/Chip/index.d.ts +2 -0
- package/dist/Shared/Components/Chip/types.d.ts +64 -0
- package/dist/Shared/Components/Chip/utils.d.ts +6 -0
- package/dist/Shared/Components/DTFocusTrap/DTFocusTrap.d.ts +8 -0
- package/dist/Shared/Components/DTFocusTrap/index.d.ts +2 -0
- package/dist/Shared/Components/DTFocusTrap/types.d.ts +33 -0
- package/dist/Shared/Components/FilterChips/types.d.ts +2 -3
- package/dist/Shared/Components/Header/PageHeader.d.ts +1 -1
- package/dist/Shared/Components/Header/types.d.ts +2 -0
- package/dist/Shared/Components/Icon/Icon.d.ts +3 -0
- package/dist/Shared/Components/Popover/types.d.ts +4 -0
- package/dist/Shared/Components/Popover/usePopover.hook.d.ts +1 -1
- package/dist/Shared/Components/Popover/utils.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/common.d.ts +2 -3
- package/dist/Shared/Components/SelectPicker/constants.d.ts +1 -0
- package/dist/Shared/Components/SelectPicker/type.d.ts +14 -3
- package/dist/Shared/Components/Table/types.d.ts +1 -0
- package/dist/Shared/Components/TempAppWindow/TempAppWindow.d.ts +1 -0
- package/dist/Shared/Components/TempAppWindow/index.d.ts +1 -0
- package/dist/Shared/Components/index.d.ts +2 -0
- package/dist/Shared/Helpers.d.ts +1 -2
- package/dist/Shared/Providers/MainContextProvider/index.d.ts +1 -1
- package/dist/Shared/Providers/MainContextProvider/types.d.ts +18 -0
- package/dist/Shared/constants.d.ts +1 -0
- package/dist/Shared/types.d.ts +0 -4
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-bg-environment.1ea03fc5.svg +12 -0
- package/dist/assets/ic-link.52effffd.svg +3 -0
- package/dist/assets/ic-resize-handle.b0afcd2d.svg +9 -0
- package/dist/index.d.ts +16 -6
- package/dist/index.js +947 -938
- package/package.json +6 -2
@@ -1,20 +1,20 @@
|
|
1
|
-
import { j as n,
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import { T as
|
5
|
-
import { getUiOptions as
|
6
|
-
import { ReactComponent as
|
7
|
-
import { ReactComponent as
|
8
|
-
import { ReactComponent as
|
9
|
-
import './assets/@common-rjsf.css';const
|
1
|
+
import { j as n, au as T, aw as J, av as K } from "./@vendor-3ORIJA0h.js";
|
2
|
+
import V, { useState as q, useEffect as Y, forwardRef as G, useMemo as E } from "react";
|
3
|
+
import z, { getDefaultRegistry as Q } from "@rjsf/core";
|
4
|
+
import { T as O, j as F, c as w, b as N, S as X, i as Z, g as ee, a as te, d as R, e as ne } from "./@code-editor-GtoBp4ff.js";
|
5
|
+
import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as re, ADDITIONAL_PROPERTY_FLAG as L, errorId as se, englishStringTranslator as ae, TranslatableString as oe, titleId as le, canExpand as ie, deepEquals as ce } from "@rjsf/utils";
|
6
|
+
import { ReactComponent as de } from "./assets/ic-add.cfaa779b.svg";
|
7
|
+
import { ReactComponent as ue } from "./assets/ic-warning.ecf7ff97.svg";
|
8
|
+
import { ReactComponent as me } from "./assets/ic-cross.01e03666.svg";
|
9
|
+
import './assets/@common-rjsf.css';const P = {
|
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"
|
13
|
-
},
|
13
|
+
}, pe = "Key not available", Je = {
|
14
14
|
"ui:submitButtonOptions": {
|
15
15
|
norender: !0
|
16
16
|
}
|
17
|
-
},
|
17
|
+
}, U = "rjsf-form-select-portal-target", fe = ({
|
18
18
|
children: e,
|
19
19
|
disabled: t,
|
20
20
|
hasToolbar: s,
|
@@ -38,7 +38,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
38
38
|
}
|
39
39
|
) })
|
40
40
|
] });
|
41
|
-
},
|
41
|
+
}, S = ({
|
42
42
|
showLabel: e,
|
43
43
|
label: t,
|
44
44
|
required: s,
|
@@ -52,13 +52,13 @@ import './assets/@common-rjsf.css';const S = {
|
|
52
52
|
className: e ? `display-grid dc__gap-12 rjsf-form-template__field ${l ? "" : "rjsf-form-template__field--align-top"}` : "",
|
53
53
|
children: [
|
54
54
|
e && /* @__PURE__ */ n.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor: a, children: [
|
55
|
-
/* @__PURE__ */ n.jsx(
|
55
|
+
/* @__PURE__ */ n.jsx(O, { alwaysShowTippyOnHover: !!i, content: i, children: /* @__PURE__ */ n.jsx("span", { className: `dc__ellipsis-right ${i ? "dc__underline-dotted" : ""}`, children: t || pe }) }),
|
56
56
|
s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
57
57
|
] }),
|
58
58
|
r
|
59
59
|
]
|
60
60
|
}
|
61
|
-
),
|
61
|
+
), A = ({ label: e, canAdd: t, onAddClick: s, disabled: r, readonly: a, uiSchema: i, registry: l }) => {
|
62
62
|
const {
|
63
63
|
ButtonTemplates: { AddButton: o }
|
64
64
|
} = l.templates;
|
@@ -72,7 +72,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
72
72
|
registry: l
|
73
73
|
}
|
74
74
|
);
|
75
|
-
},
|
75
|
+
}, he = ({
|
76
76
|
canAdd: e,
|
77
77
|
className: t,
|
78
78
|
disabled: s,
|
@@ -83,23 +83,23 @@ import './assets/@common-rjsf.css';const S = {
|
|
83
83
|
readonly: o,
|
84
84
|
registry: c,
|
85
85
|
required: d,
|
86
|
-
title:
|
86
|
+
title: f
|
87
87
|
}) => {
|
88
|
-
const
|
88
|
+
const m = B(a), h = $("ArrayFieldItemTemplate", c, m), u = m.title || f;
|
89
89
|
return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: r.$id, children: i.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
90
|
-
i.map(({ key:
|
91
|
-
const
|
92
|
-
...
|
90
|
+
i.map(({ key: x, ...p }, j) => {
|
91
|
+
const _ = {
|
92
|
+
...p.children,
|
93
93
|
props: {
|
94
|
-
...
|
94
|
+
...p.children.props
|
95
95
|
}
|
96
96
|
};
|
97
|
-
return /* @__PURE__ */ n.jsx(
|
97
|
+
return /* @__PURE__ */ n.jsx(h, { ...p, children: _ }, x);
|
98
98
|
}),
|
99
99
|
/* @__PURE__ */ n.jsx(
|
100
|
-
|
100
|
+
A,
|
101
101
|
{
|
102
|
-
label:
|
102
|
+
label: u,
|
103
103
|
canAdd: e,
|
104
104
|
onAddClick: l,
|
105
105
|
disabled: s,
|
@@ -108,10 +108,10 @@ import './assets/@common-rjsf.css';const S = {
|
|
108
108
|
registry: c
|
109
109
|
}
|
110
110
|
)
|
111
|
-
] }) : /* @__PURE__ */ n.jsx(
|
112
|
-
|
111
|
+
] }) : /* @__PURE__ */ n.jsx(S, { label: u, required: d, showLabel: !0, id: r.$id, children: /* @__PURE__ */ n.jsx(
|
112
|
+
A,
|
113
113
|
{
|
114
|
-
label:
|
114
|
+
label: u,
|
115
115
|
canAdd: e,
|
116
116
|
onAddClick: l,
|
117
117
|
disabled: s,
|
@@ -121,18 +121,18 @@ import './assets/@common-rjsf.css';const S = {
|
|
121
121
|
}
|
122
122
|
) }) });
|
123
123
|
}, {
|
124
|
-
templates: { BaseInputTemplate:
|
125
|
-
} =
|
124
|
+
templates: { BaseInputTemplate: _e }
|
125
|
+
} = Q(), xe = ({ placeholder: e, ...t }) => {
|
126
126
|
const { schema: s } = t;
|
127
127
|
return /* @__PURE__ */ n.jsx(
|
128
|
-
|
128
|
+
_e,
|
129
129
|
{
|
130
|
-
placeholder: s.placeholder || e ||
|
130
|
+
placeholder: s.placeholder || e || P.INPUT,
|
131
131
|
...t,
|
132
132
|
className: "form__input cn-9 fs-13 lh-20 fw-4"
|
133
133
|
}
|
134
134
|
);
|
135
|
-
},
|
135
|
+
}, k = ({
|
136
136
|
label: e,
|
137
137
|
icon: t,
|
138
138
|
iconType: s,
|
@@ -149,23 +149,23 @@ import './assets/@common-rjsf.css';const S = {
|
|
149
149
|
className: "dc__outline-none-imp p-0 dc__transparent flex dc__gap-4 cursor dc__mxw-250",
|
150
150
|
title: "Add",
|
151
151
|
children: [
|
152
|
-
/* @__PURE__ */ n.jsx(
|
153
|
-
/* @__PURE__ */ n.jsx(
|
152
|
+
/* @__PURE__ */ n.jsx(de, { className: "icon-dim-16 fcb-5" }),
|
153
|
+
/* @__PURE__ */ n.jsx(O, { placement: "right", content: l, children: /* @__PURE__ */ n.jsx("span", { className: "cb-5 fs-13 lh-34 dc__truncate", children: l }) })
|
154
154
|
]
|
155
155
|
}
|
156
156
|
) });
|
157
|
-
},
|
158
|
-
const { submitText: t, norender: s, props: r = {} } =
|
157
|
+
}, je = ({ icon: e, iconType: t, registry: s, uiSchema: r, ...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 }) => {
|
158
|
+
const { submitText: t, norender: s, props: r = {} } = re(e);
|
159
159
|
return s ? null : /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-end", children: /* @__PURE__ */ n.jsx("button", { type: "submit", ...r, className: `cta ${r.className || ""}`, children: t }) });
|
160
|
-
},
|
160
|
+
}, C = ({
|
161
161
|
id: e,
|
162
162
|
title: t,
|
163
163
|
required: s,
|
164
164
|
description: r
|
165
165
|
}) => /* @__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(
|
166
|
+
/* @__PURE__ */ n.jsx(O, { alwaysShowTippyOnHover: !!r, content: r, children: /* @__PURE__ */ n.jsx("span", { className: `${r ? "dc__underline-dotted" : ""}`, children: t }) }),
|
167
167
|
s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
168
|
-
] }),
|
168
|
+
] }), be = (e) => {
|
169
169
|
const {
|
170
170
|
id: t,
|
171
171
|
label: s,
|
@@ -176,60 +176,60 @@ import './assets/@common-rjsf.css';const S = {
|
|
176
176
|
displayLabel: o,
|
177
177
|
registry: c,
|
178
178
|
uiSchema: d,
|
179
|
-
classNames:
|
180
|
-
schema:
|
181
|
-
rawDescription:
|
182
|
-
} = e,
|
179
|
+
classNames: f,
|
180
|
+
schema: m,
|
181
|
+
rawDescription: h
|
182
|
+
} = e, u = B(d), x = $(
|
183
183
|
"WrapIfAdditionalTemplate",
|
184
184
|
c,
|
185
|
-
|
186
|
-
),
|
185
|
+
u
|
186
|
+
), p = L in m, j = (o || m.type === "boolean") && !p, _ = m.type === "array";
|
187
187
|
return i ? /* @__PURE__ */ n.jsx("div", { className: "hidden", children: r }) : (
|
188
188
|
// NOTE: need to override the margins of default rjsf css
|
189
|
-
/* @__PURE__ */ n.jsxs("div", { className: `${
|
190
|
-
|
191
|
-
|
189
|
+
/* @__PURE__ */ n.jsxs("div", { className: `${f} mb-0`, children: [
|
190
|
+
_ && /* @__PURE__ */ n.jsx(
|
191
|
+
C,
|
192
192
|
{
|
193
193
|
id: t,
|
194
194
|
title: s,
|
195
195
|
required: l,
|
196
196
|
registry: c,
|
197
197
|
uiSchema: d,
|
198
|
-
schema:
|
199
|
-
description:
|
198
|
+
schema: m,
|
199
|
+
description: h
|
200
200
|
}
|
201
201
|
),
|
202
202
|
/* @__PURE__ */ n.jsx(
|
203
|
-
|
203
|
+
S,
|
204
204
|
{
|
205
205
|
label: s,
|
206
|
-
showLabel:
|
206
|
+
showLabel: j,
|
207
207
|
id: t,
|
208
208
|
required: l,
|
209
|
-
rawDescription:
|
210
|
-
children: /* @__PURE__ */ n.jsx(
|
209
|
+
rawDescription: h,
|
210
|
+
children: /* @__PURE__ */ n.jsx(x, { ...e, children: r })
|
211
211
|
}
|
212
212
|
),
|
213
213
|
a
|
214
214
|
] })
|
215
215
|
);
|
216
|
-
},
|
217
|
-
const s =
|
218
|
-
return e.length > 0 && /* @__PURE__ */ n.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id: s, children: e.filter((r) => !!r).map((r, a) => /* @__PURE__ */ n.jsxs(
|
216
|
+
}, ye = ({ errors: e = [], idSchema: t }) => {
|
217
|
+
const s = se(t);
|
218
|
+
return e.length > 0 && /* @__PURE__ */ n.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id: s, children: e.filter((r) => !!r).map((r, a) => /* @__PURE__ */ n.jsxs(V.Fragment, { children: [
|
219
219
|
/* @__PURE__ */ n.jsx("span", {}),
|
220
220
|
/* @__PURE__ */ n.jsxs("span", { className: "form__error", children: [
|
221
|
-
/* @__PURE__ */ n.jsx(
|
221
|
+
/* @__PURE__ */ n.jsx(ue, { className: "form__icon form__icon--error" }),
|
222
222
|
r
|
223
223
|
] })
|
224
224
|
] }, a)) });
|
225
|
-
},
|
225
|
+
}, ve = (e, t) => {
|
226
226
|
switch (e) {
|
227
|
-
case
|
227
|
+
case oe.NewStringDefault:
|
228
228
|
return "";
|
229
229
|
default:
|
230
|
-
return
|
230
|
+
return ae(e, t);
|
231
231
|
}
|
232
|
-
},
|
232
|
+
}, Ke = (e) => {
|
233
233
|
try {
|
234
234
|
const t = new URL(e).origin === window.location.origin;
|
235
235
|
return {
|
@@ -245,7 +245,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
245
245
|
url: `${e} (Invalid URL)`
|
246
246
|
};
|
247
247
|
}
|
248
|
-
},
|
248
|
+
}, Ve = (e) => {
|
249
249
|
const t = typeof e;
|
250
250
|
switch (t) {
|
251
251
|
case "boolean":
|
@@ -257,36 +257,36 @@ import './assets/@common-rjsf.css';const S = {
|
|
257
257
|
default:
|
258
258
|
return "null";
|
259
259
|
}
|
260
|
-
},
|
260
|
+
}, v = (e) => {
|
261
261
|
if (!e)
|
262
262
|
return "";
|
263
263
|
const t = e.trim(), r = (/^\/.+$/g.test(t) ? t : `/${t}`).replaceAll(/\./g, "/");
|
264
264
|
return /(\/(([^/~])|(~[01]))*)/g.test(r) ? r : "";
|
265
|
-
},
|
265
|
+
}, I = {
|
266
266
|
value: !1,
|
267
267
|
path: ""
|
268
|
-
},
|
268
|
+
}, Te = (e) => {
|
269
269
|
if (!e)
|
270
270
|
return null;
|
271
271
|
const t = structuredClone(e);
|
272
272
|
return typeof t == "string" ? {
|
273
273
|
value: !0,
|
274
|
-
path:
|
275
|
-
} : typeof t != "object" ? structuredClone(
|
274
|
+
path: v(t)
|
275
|
+
} : typeof t != "object" ? structuredClone(I) : Object.hasOwn(t, "condition") && "condition" in t && Object.hasOwn(t, "value") && "value" in t ? {
|
276
276
|
value: t.condition,
|
277
|
-
path:
|
277
|
+
path: v(t.value)
|
278
278
|
} : Object.hasOwn(t, "value") && "value" in t && Object.hasOwn(t, "path") && "path" in t ? {
|
279
279
|
value: t.value,
|
280
|
-
path:
|
281
|
-
} : structuredClone(
|
282
|
-
},
|
280
|
+
path: v(t.path)
|
281
|
+
} : structuredClone(I);
|
282
|
+
}, H = (e, t, s) => {
|
283
283
|
e && (e.type === "object" && e.properties && typeof e.properties == "object" && Object.entries(e.properties).forEach(([r, a]) => {
|
284
|
-
|
285
|
-
}), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (s[t] =
|
286
|
-
},
|
284
|
+
H(a, `${t}/${r}`, s);
|
285
|
+
}), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (s[t] = v(e.updatePath ?? t)));
|
286
|
+
}, we = (e) => {
|
287
287
|
const t = {};
|
288
|
-
return
|
289
|
-
},
|
288
|
+
return H(e, "", t), t;
|
289
|
+
}, M = (e, t, s) => {
|
290
290
|
if (t >= s.length)
|
291
291
|
return e;
|
292
292
|
const r = s[t];
|
@@ -294,19 +294,19 @@ import './assets/@common-rjsf.css';const S = {
|
|
294
294
|
const a = structuredClone(e);
|
295
295
|
return delete a[r], a;
|
296
296
|
}
|
297
|
-
if (e[r] && (e[r] =
|
297
|
+
if (e[r] && (e[r] = M(e[r], t + 1, s)), Object.keys(e[r] ?? {}).length === 0) {
|
298
298
|
const a = structuredClone(e);
|
299
299
|
return delete a[r], a;
|
300
300
|
}
|
301
301
|
return e;
|
302
|
-
},
|
302
|
+
}, Se = (e, t) => {
|
303
303
|
if (!e || typeof e != "object" || Array.isArray(e))
|
304
304
|
throw new Error("Invalid object");
|
305
305
|
if (!t || !t.startsWith("/"))
|
306
306
|
throw new Error("Invalid path");
|
307
307
|
const s = t.split("/").slice(1);
|
308
|
-
return
|
309
|
-
},
|
308
|
+
return M(e, 0, s);
|
309
|
+
}, D = ({
|
310
310
|
formState: e,
|
311
311
|
formData: t,
|
312
312
|
schemaPathToUpdatePathMap: s
|
@@ -315,35 +315,35 @@ import './assets/@common-rjsf.css';const S = {
|
|
315
315
|
return r && (Object.entries(s).forEach(([a, i]) => {
|
316
316
|
if (a === i || !i)
|
317
317
|
return;
|
318
|
-
const l =
|
318
|
+
const l = T({
|
319
319
|
json: t,
|
320
|
-
path:
|
320
|
+
path: w(a),
|
321
321
|
resultType: "value",
|
322
322
|
wrap: !1
|
323
323
|
});
|
324
|
-
l === void 0 ? r =
|
325
|
-
const o =
|
324
|
+
l === void 0 ? r = Se(r, a) : r = F([N(a, l), r]);
|
325
|
+
const o = T({
|
326
326
|
json: e,
|
327
|
-
path:
|
327
|
+
path: w(a),
|
328
328
|
resultType: "value",
|
329
329
|
wrap: !1
|
330
330
|
});
|
331
|
-
o !== void 0 && (r =
|
332
|
-
}), t && r ?
|
333
|
-
},
|
331
|
+
o !== void 0 && (r = F([N(i, o), r]));
|
332
|
+
}), t && r ? J(t, K(t, r), !1, !1).newDocument : r);
|
333
|
+
}, Fe = ({ formData: e, schemaPathToUpdatePathMap: t }) => F([
|
334
334
|
...Object.entries(t).map(([s, r]) => {
|
335
335
|
if (s === r || !r)
|
336
336
|
return {};
|
337
|
-
const a =
|
337
|
+
const a = T({
|
338
338
|
json: e,
|
339
|
-
path:
|
339
|
+
path: w(r),
|
340
340
|
resultType: "value",
|
341
341
|
wrap: !1
|
342
342
|
});
|
343
|
-
return a === void 0 ? {} :
|
343
|
+
return a === void 0 ? {} : N(s, a);
|
344
344
|
}),
|
345
345
|
structuredClone(e)
|
346
|
-
]),
|
346
|
+
]), Ne = ({
|
347
347
|
disabled: e,
|
348
348
|
formData: t,
|
349
349
|
idSchema: s,
|
@@ -354,62 +354,62 @@ import './assets/@common-rjsf.css';const S = {
|
|
354
354
|
required: o,
|
355
355
|
schema: c,
|
356
356
|
title: d,
|
357
|
-
uiSchema:
|
358
|
-
formContext:
|
357
|
+
uiSchema: f,
|
358
|
+
formContext: m
|
359
359
|
}) => {
|
360
|
-
const
|
361
|
-
|
360
|
+
const h = !!c.additionalProperties, u = ie(c, f, t) && /* @__PURE__ */ n.jsx(
|
361
|
+
k,
|
362
362
|
{
|
363
363
|
label: d,
|
364
364
|
className: "object-property-expand",
|
365
365
|
onClick: r(c),
|
366
366
|
disabled: e || i,
|
367
|
-
uiSchema:
|
367
|
+
uiSchema: f,
|
368
368
|
registry: l
|
369
369
|
}
|
370
|
-
),
|
371
|
-
const
|
372
|
-
if (!
|
370
|
+
), x = a.filter((p) => {
|
371
|
+
const j = c.properties?.[p.name]?.hidden;
|
372
|
+
if (!j)
|
373
373
|
return !0;
|
374
374
|
try {
|
375
|
-
const
|
376
|
-
if (!
|
375
|
+
const _ = Te(j);
|
376
|
+
if (!_.path)
|
377
377
|
throw new Error("Empty path property of hidden descriptor field");
|
378
|
-
const
|
379
|
-
path:
|
380
|
-
json:
|
378
|
+
const y = T({
|
379
|
+
path: w(_.path),
|
380
|
+
json: m,
|
381
381
|
resultType: "value",
|
382
382
|
wrap: !1
|
383
383
|
});
|
384
|
-
return !(
|
384
|
+
return !(y === void 0 || ce(_.value, y));
|
385
385
|
} catch {
|
386
386
|
return !0;
|
387
387
|
}
|
388
|
-
}).map((
|
389
|
-
return
|
388
|
+
}).map((p) => p.content);
|
389
|
+
return h ? a.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
390
390
|
/* @__PURE__ */ n.jsx(
|
391
|
-
|
391
|
+
S,
|
392
392
|
{
|
393
393
|
label: d,
|
394
394
|
required: o,
|
395
395
|
showLabel: !0,
|
396
396
|
id: s.$id,
|
397
397
|
shouldAlignCenter: !1,
|
398
|
-
children: /* @__PURE__ */ n.jsx("div", { children:
|
398
|
+
children: /* @__PURE__ */ n.jsx("div", { children: x })
|
399
399
|
}
|
400
400
|
),
|
401
|
-
|
402
|
-
] }) : /* @__PURE__ */ n.jsx(
|
403
|
-
|
404
|
-
|
401
|
+
u
|
402
|
+
] }) : /* @__PURE__ */ n.jsx(S, { label: d, required: o, showLabel: !0, id: s.$id, children: u }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
403
|
+
x,
|
404
|
+
u
|
405
405
|
] });
|
406
|
-
},
|
406
|
+
}, Oe = (e) => {
|
407
407
|
const { idSchema: t, registry: s, required: r, schema: a, title: i, uiSchema: l, description: o } = e, c = !!a.additionalProperties, d = i && !c;
|
408
408
|
return /* @__PURE__ */ n.jsxs("fieldset", { id: t.$id, children: [
|
409
409
|
d && /* @__PURE__ */ n.jsx(
|
410
|
-
|
410
|
+
C,
|
411
411
|
{
|
412
|
-
id:
|
412
|
+
id: le(t),
|
413
413
|
title: i,
|
414
414
|
required: r,
|
415
415
|
schema: a,
|
@@ -422,11 +422,11 @@ import './assets/@common-rjsf.css';const S = {
|
|
422
422
|
"div",
|
423
423
|
{
|
424
424
|
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(
|
425
|
+
children: /* @__PURE__ */ n.jsx(Ne, { ...e })
|
426
426
|
}
|
427
427
|
)
|
428
428
|
] });
|
429
|
-
},
|
429
|
+
}, Pe = ({
|
430
430
|
id: e,
|
431
431
|
disabled: t,
|
432
432
|
label: s,
|
@@ -438,22 +438,22 @@ import './assets/@common-rjsf.css';const S = {
|
|
438
438
|
uiSchema: c,
|
439
439
|
registry: d
|
440
440
|
}) => {
|
441
|
-
const { templates:
|
442
|
-
return /* @__PURE__ */ n.jsx(n.Fragment, { children:
|
441
|
+
const { templates: f } = d, { RemoveButton: m } = f.ButtonTemplates, h = L in l;
|
442
|
+
return /* @__PURE__ */ n.jsx(n.Fragment, { children: h ? /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel rjsf-form-template__additional-fields display-grid dc__gap-8 flex-align-center", children: [
|
443
443
|
/* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(
|
444
444
|
"input",
|
445
445
|
{
|
446
446
|
type: "text",
|
447
447
|
className: "form__input cn-9 fs-13 lh-20 fw-4",
|
448
448
|
id: `${e}-key`,
|
449
|
-
onBlur: (
|
450
|
-
placeholder:
|
449
|
+
onBlur: (u) => r(u.target.value),
|
450
|
+
placeholder: P.OBJECT_KEY,
|
451
451
|
defaultValue: s
|
452
452
|
}
|
453
453
|
) }),
|
454
454
|
/* @__PURE__ */ n.jsx("div", { children: o }),
|
455
455
|
/* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: /* @__PURE__ */ n.jsx(
|
456
|
-
|
456
|
+
m,
|
457
457
|
{
|
458
458
|
disabled: t || i,
|
459
459
|
onClick: a(s),
|
@@ -462,7 +462,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
462
462
|
}
|
463
463
|
) })
|
464
464
|
] }) : o });
|
465
|
-
},
|
465
|
+
}, Ce = ({
|
466
466
|
id: e,
|
467
467
|
onChange: t,
|
468
468
|
value: s,
|
@@ -470,12 +470,12 @@ import './assets/@common-rjsf.css';const S = {
|
|
470
470
|
readonly: a,
|
471
471
|
autofocus: i
|
472
472
|
}) => {
|
473
|
-
const l =
|
473
|
+
const l = Z(s) ? !1 : s, o = () => {
|
474
474
|
t(!l);
|
475
475
|
};
|
476
476
|
return /* @__PURE__ */ n.jsxs("div", { className: "flexbox dc__align-items-center dc__gap-8", children: [
|
477
477
|
/* @__PURE__ */ n.jsx(
|
478
|
-
|
478
|
+
X,
|
479
479
|
{
|
480
480
|
name: e,
|
481
481
|
ariaLabel: e,
|
@@ -487,7 +487,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
487
487
|
),
|
488
488
|
/* @__PURE__ */ n.jsx("span", { className: "dc__capitalize", children: l.toString() })
|
489
489
|
] });
|
490
|
-
},
|
490
|
+
}, Ee = (e) => {
|
491
491
|
const {
|
492
492
|
id: t,
|
493
493
|
multiple: s = !1,
|
@@ -498,53 +498,59 @@ import './assets/@common-rjsf.css';const S = {
|
|
498
498
|
autofocus: o = !1,
|
499
499
|
onChange: c,
|
500
500
|
onBlur: d,
|
501
|
-
onFocus:
|
502
|
-
placeholder:
|
503
|
-
|
504
|
-
|
505
|
-
|
501
|
+
onFocus: f,
|
502
|
+
placeholder: m,
|
503
|
+
schema: h
|
504
|
+
} = e, { enumOptions: u = [] } = r, x = s ? [] : null, p = (g) => {
|
505
|
+
c(s ? g.map((b) => b.value) : g.value);
|
506
|
+
}, [j, _] = q();
|
507
|
+
Y(() => {
|
508
|
+
_(ee(8));
|
509
|
+
}, []);
|
510
|
+
const y = (g) => s ? u.filter((b) => g.some((W) => R(W, b.value))) : u.find((b) => R(g, b.value));
|
506
511
|
return /* @__PURE__ */ n.jsx(
|
507
|
-
|
512
|
+
te,
|
508
513
|
{
|
509
514
|
inputId: `devtron-rjsf-select__${t}`,
|
510
515
|
name: t,
|
511
516
|
isMulti: s,
|
512
|
-
value: typeof a > "u" ?
|
517
|
+
value: typeof a > "u" ? x : y(a),
|
513
518
|
autoFocus: o,
|
514
|
-
onChange:
|
515
|
-
options:
|
519
|
+
onChange: p,
|
520
|
+
options: u,
|
516
521
|
onBlur: () => d(t, a),
|
517
|
-
onFocus: () =>
|
518
|
-
placeholder:
|
522
|
+
onFocus: () => f(t, a),
|
523
|
+
placeholder: h.placeholder || m || P.SELECT,
|
519
524
|
isDisabled: i || l,
|
520
|
-
menuPortalTarget: document.getElementById(
|
525
|
+
menuPortalTarget: document.getElementById(U),
|
521
526
|
menuPosition: "fixed"
|
522
|
-
}
|
527
|
+
},
|
528
|
+
j
|
523
529
|
);
|
524
|
-
},
|
525
|
-
CheckboxWidget:
|
526
|
-
SelectWidget:
|
527
|
-
},
|
528
|
-
ArrayFieldItemTemplate:
|
529
|
-
ArrayFieldTemplate:
|
530
|
-
BaseInputTemplate:
|
531
|
-
ButtonTemplates: { AddButton:
|
532
|
-
FieldTemplate:
|
533
|
-
FieldErrorTemplate:
|
534
|
-
ObjectFieldTemplate:
|
535
|
-
TitleFieldTemplate:
|
536
|
-
WrapIfAdditionalTemplate:
|
537
|
-
},
|
538
|
-
const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } =
|
539
|
-
const o =
|
530
|
+
}, Re = {
|
531
|
+
CheckboxWidget: Ce,
|
532
|
+
SelectWidget: Ee
|
533
|
+
}, Ae = {
|
534
|
+
ArrayFieldItemTemplate: fe,
|
535
|
+
ArrayFieldTemplate: he,
|
536
|
+
BaseInputTemplate: xe,
|
537
|
+
ButtonTemplates: { AddButton: k, RemoveButton: je, SubmitButton: ge },
|
538
|
+
FieldTemplate: be,
|
539
|
+
FieldErrorTemplate: ye,
|
540
|
+
ObjectFieldTemplate: Oe,
|
541
|
+
TitleFieldTemplate: C,
|
542
|
+
WrapIfAdditionalTemplate: Pe
|
543
|
+
}, Ie = z, De = ne, qe = G((e, t) => {
|
544
|
+
const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } = E(() => {
|
545
|
+
const o = we(e.schema);
|
540
546
|
return {
|
541
547
|
schemaPathToUpdatePathMap: o,
|
542
548
|
isUpdatePathKeywordPresent: Object.entries(o).some(([c, d]) => c !== d)
|
543
549
|
};
|
544
|
-
}, [e.schema]), a =
|
550
|
+
}, [e.schema]), a = E(() => r ? Fe({ formData: e.formData ?? {}, schemaPathToUpdatePathMap: s }) : e.formData, [e.formData, s, r]), i = (o) => {
|
545
551
|
if (!e.onChange)
|
546
552
|
return;
|
547
|
-
const c =
|
553
|
+
const c = D({
|
548
554
|
formState: o.formData,
|
549
555
|
formData: e.formData,
|
550
556
|
schemaPathToUpdatePathMap: s
|
@@ -553,7 +559,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
553
559
|
}, l = (o, c) => {
|
554
560
|
if (!e.onSubmit)
|
555
561
|
return;
|
556
|
-
const d =
|
562
|
+
const d = D({
|
557
563
|
formState: o.formData,
|
558
564
|
formData: e.formData,
|
559
565
|
schemaPathToUpdatePathMap: s
|
@@ -562,7 +568,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
562
568
|
};
|
563
569
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
564
570
|
/* @__PURE__ */ n.jsx(
|
565
|
-
|
571
|
+
Ie,
|
566
572
|
{
|
567
573
|
noHtml5Validate: !0,
|
568
574
|
showErrorList: !1,
|
@@ -574,25 +580,25 @@ import './assets/@common-rjsf.css';const S = {
|
|
574
580
|
onSubmit: l
|
575
581
|
} : {},
|
576
582
|
className: `rjsf-form-template__container ${e.className || ""}`,
|
577
|
-
validator:
|
583
|
+
validator: De,
|
578
584
|
templates: {
|
579
|
-
...
|
585
|
+
...Ae,
|
580
586
|
...e.templates
|
581
587
|
},
|
582
588
|
formContext: a,
|
583
|
-
widgets: { ...
|
584
|
-
translateString:
|
589
|
+
widgets: { ...Re, ...e.widgets },
|
590
|
+
translateString: ve,
|
585
591
|
ref: t
|
586
592
|
}
|
587
593
|
),
|
588
|
-
/* @__PURE__ */ n.jsx("div", { id:
|
594
|
+
/* @__PURE__ */ n.jsx("div", { id: U })
|
589
595
|
] });
|
590
596
|
});
|
591
597
|
export {
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
+
Je as H,
|
599
|
+
qe as R,
|
600
|
+
Ke as a,
|
601
|
+
we as b,
|
602
|
+
v as c,
|
603
|
+
Ve as g
|
598
604
|
};
|