@devtron-labs/devtron-fe-common-lib 1.18.1-pre-3 → 1.18.1-pre-5
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-Cpy4hA_i.js → @code-editor-BzeAa_a8.js} +2888 -2883
- package/dist/{@common-rjsf-B_yuIRxG.js → @common-rjsf-B6-zgtfh.js} +136 -135
- package/dist/Pages/BulkEdit/index.d.ts +1 -0
- package/dist/Pages/BulkEdit/types.d.ts +50 -0
- package/dist/Pages/index.d.ts +1 -0
- package/dist/Shared/Components/Chip/Chip.component.d.ts +1 -1
- package/dist/Shared/Components/Chip/types.d.ts +7 -1
- package/dist/Shared/Components/Icon/Icon.d.ts +1 -0
- package/dist/Shared/Components/SelectPicker/type.d.ts +2 -3
- package/dist/assets/ic-resize-handle.b0afcd2d.svg +9 -0
- package/dist/index.js +868 -867
- package/package.json +1 -1
@@ -1,20 +1,20 @@
|
|
1
|
-
import { j as n, au as y, aw as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import { T as N, j as w, c as v, b as F, S as
|
5
|
-
import { getUiOptions as
|
6
|
-
import { ReactComponent as
|
7
|
-
import { ReactComponent as
|
8
|
-
import { ReactComponent as
|
1
|
+
import { j as n, au as y, aw as M, av as W } from "./@vendor-3ORIJA0h.js";
|
2
|
+
import J, { forwardRef as V, useMemo as C } from "react";
|
3
|
+
import K, { getDefaultRegistry as q } from "@rjsf/core";
|
4
|
+
import { T as N, j as w, c as v, b as F, S as Y, i as G, a as z, d as E, e as Q } from "./@code-editor-BzeAa_a8.js";
|
5
|
+
import { getUiOptions as D, getTemplate as B, getSubmitButtonOptions as X, ADDITIONAL_PROPERTY_FLAG as $, errorId as Z, englishStringTranslator as ee, TranslatableString as te, titleId as ne, canExpand as re, deepEquals as se } from "@rjsf/utils";
|
6
|
+
import { ReactComponent as ae } from "./assets/ic-add.cfaa779b.svg";
|
7
|
+
import { ReactComponent as oe } from "./assets/ic-warning.ecf7ff97.svg";
|
8
|
+
import { ReactComponent as le } from "./assets/ic-cross.01e03666.svg";
|
9
9
|
import './assets/@common-rjsf.css';const S = {
|
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
|
+
}, ie = "Key not available", Ue = {
|
14
14
|
"ui:submitButtonOptions": {
|
15
15
|
norender: !0
|
16
16
|
}
|
17
|
-
},
|
17
|
+
}, L = "rjsf-form-select-portal-target", ce = ({
|
18
18
|
children: e,
|
19
19
|
disabled: t,
|
20
20
|
hasToolbar: 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(N, { alwaysShowTippyOnHover: !!i, content: i, children: /* @__PURE__ */ n.jsx("span", { className: `dc__ellipsis-right ${i ? "dc__underline-dotted" : ""}`, children: t ||
|
55
|
+
/* @__PURE__ */ n.jsx(N, { alwaysShowTippyOnHover: !!i, content: i, children: /* @__PURE__ */ n.jsx("span", { className: `dc__ellipsis-right ${i ? "dc__underline-dotted" : ""}`, children: t || ie }) }),
|
56
56
|
s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
57
57
|
] }),
|
58
58
|
r
|
59
59
|
]
|
60
60
|
}
|
61
|
-
),
|
61
|
+
), R = ({ 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
|
+
}, de = ({
|
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: h
|
87
87
|
}) => {
|
88
|
-
const
|
88
|
+
const m = D(a), _ = B("ArrayFieldItemTemplate", c, m), u = m.title || h;
|
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:
|
90
|
+
i.map(({ key: x, ...f }, g) => {
|
91
91
|
const p = {
|
92
|
-
...
|
92
|
+
...f.children,
|
93
93
|
props: {
|
94
|
-
...
|
94
|
+
...f.children.props
|
95
95
|
}
|
96
96
|
};
|
97
|
-
return /* @__PURE__ */ n.jsx(
|
97
|
+
return /* @__PURE__ */ n.jsx(_, { ...f, children: p }, x);
|
98
98
|
}),
|
99
99
|
/* @__PURE__ */ n.jsx(
|
100
|
-
|
100
|
+
R,
|
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(T, { label:
|
112
|
-
|
111
|
+
] }) : /* @__PURE__ */ n.jsx(T, { label: u, required: d, showLabel: !0, id: r.$id, children: /* @__PURE__ */ n.jsx(
|
112
|
+
R,
|
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: ue }
|
125
|
+
} = q(), me = ({ placeholder: e, ...t }) => {
|
126
126
|
const { schema: s } = t;
|
127
127
|
return /* @__PURE__ */ n.jsx(
|
128
|
-
|
128
|
+
ue,
|
129
129
|
{
|
130
130
|
placeholder: s.placeholder || e || S.INPUT,
|
131
131
|
...t,
|
132
132
|
className: "form__input cn-9 fs-13 lh-20 fw-4"
|
133
133
|
}
|
134
134
|
);
|
135
|
-
},
|
135
|
+
}, U = ({
|
136
136
|
label: e,
|
137
137
|
icon: t,
|
138
138
|
iconType: s,
|
@@ -149,13 +149,13 @@ 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(
|
152
|
+
/* @__PURE__ */ n.jsx(ae, { className: "icon-dim-16 fcb-5" }),
|
153
153
|
/* @__PURE__ */ n.jsx(N, { 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
|
+
}, pe = ({ 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(le, { className: "icon-dim-16 fcn-6" }) }), fe = ({ uiSchema: e }) => {
|
158
|
+
const { submitText: t, norender: s, props: r = {} } = X(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
|
}, O = ({
|
161
161
|
id: e,
|
@@ -165,7 +165,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
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
166
|
/* @__PURE__ */ n.jsx(N, { 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
|
+
] }), he = (e) => {
|
169
169
|
const {
|
170
170
|
id: t,
|
171
171
|
label: s,
|
@@ -176,17 +176,17 @@ 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: h,
|
180
|
+
schema: m,
|
181
|
+
rawDescription: _
|
182
|
+
} = e, u = D(d), x = B(
|
183
183
|
"WrapIfAdditionalTemplate",
|
184
184
|
c,
|
185
|
-
|
186
|
-
),
|
185
|
+
u
|
186
|
+
), f = $ in m, g = (o || m.type === "boolean") && !f, 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: `${
|
189
|
+
/* @__PURE__ */ n.jsxs("div", { className: `${h} mb-0`, children: [
|
190
190
|
p && /* @__PURE__ */ n.jsx(
|
191
191
|
O,
|
192
192
|
{
|
@@ -195,39 +195,39 @@ import './assets/@common-rjsf.css';const S = {
|
|
195
195
|
required: l,
|
196
196
|
registry: c,
|
197
197
|
uiSchema: d,
|
198
|
-
schema:
|
199
|
-
description:
|
198
|
+
schema: m,
|
199
|
+
description: _
|
200
200
|
}
|
201
201
|
),
|
202
202
|
/* @__PURE__ */ n.jsx(
|
203
203
|
T,
|
204
204
|
{
|
205
205
|
label: s,
|
206
|
-
showLabel:
|
206
|
+
showLabel: g,
|
207
207
|
id: t,
|
208
208
|
required: l,
|
209
|
-
rawDescription:
|
210
|
-
children: /* @__PURE__ */ n.jsx(
|
209
|
+
rawDescription: _,
|
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
|
+
}, _e = ({ errors: e = [], idSchema: t }) => {
|
217
|
+
const s = Z(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(J.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(oe, { className: "form__icon form__icon--error" }),
|
222
222
|
r
|
223
223
|
] })
|
224
224
|
] }, a)) });
|
225
|
-
},
|
225
|
+
}, xe = (e, t) => {
|
226
226
|
switch (e) {
|
227
|
-
case
|
227
|
+
case te.NewStringDefault:
|
228
228
|
return "";
|
229
229
|
default:
|
230
|
-
return
|
230
|
+
return ee(e, t);
|
231
231
|
}
|
232
232
|
}, He = (e) => {
|
233
233
|
try {
|
@@ -262,31 +262,31 @@ import './assets/@common-rjsf.css';const S = {
|
|
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
|
+
}, A = {
|
266
266
|
value: !1,
|
267
267
|
path: ""
|
268
|
-
},
|
268
|
+
}, je = (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
274
|
path: b(t)
|
275
|
-
} : typeof t != "object" ? structuredClone(
|
275
|
+
} : typeof t != "object" ? structuredClone(A) : Object.hasOwn(t, "condition") && "condition" in t && Object.hasOwn(t, "value") && "value" in t ? {
|
276
276
|
value: t.condition,
|
277
277
|
path: b(t.value)
|
278
278
|
} : Object.hasOwn(t, "value") && "value" in t && Object.hasOwn(t, "path") && "path" in t ? {
|
279
279
|
value: t.value,
|
280
280
|
path: b(t.path)
|
281
|
-
} : structuredClone(
|
282
|
-
},
|
281
|
+
} : structuredClone(A);
|
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
|
-
|
284
|
+
H(a, `${t}/${r}`, s);
|
285
285
|
}), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (s[t] = b(e.updatePath ?? t)));
|
286
|
-
},
|
286
|
+
}, ge = (e) => {
|
287
287
|
const t = {};
|
288
|
-
return
|
289
|
-
},
|
288
|
+
return H(e, "", t), t;
|
289
|
+
}, k = (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] = k(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
|
+
}, be = (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 k(e, 0, s);
|
309
|
+
}, I = ({
|
310
310
|
formState: e,
|
311
311
|
formData: t,
|
312
312
|
schemaPathToUpdatePathMap: s
|
@@ -321,7 +321,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
321
321
|
resultType: "value",
|
322
322
|
wrap: !1
|
323
323
|
});
|
324
|
-
l === void 0 ? r =
|
324
|
+
l === void 0 ? r = be(r, a) : r = w([F(a, l), r]);
|
325
325
|
const o = y({
|
326
326
|
json: e,
|
327
327
|
path: v(a),
|
@@ -329,8 +329,8 @@ import './assets/@common-rjsf.css';const S = {
|
|
329
329
|
wrap: !1
|
330
330
|
});
|
331
331
|
o !== void 0 && (r = w([F(i, o), r]));
|
332
|
-
}), t && r ?
|
333
|
-
},
|
332
|
+
}), t && r ? M(t, W(t, r), !1, !1).newDocument : r);
|
333
|
+
}, ye = ({ formData: e, schemaPathToUpdatePathMap: t }) => w([
|
334
334
|
...Object.entries(t).map(([s, r]) => {
|
335
335
|
if (s === r || !r)
|
336
336
|
return {};
|
@@ -343,7 +343,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
343
343
|
return a === void 0 ? {} : F(s, a);
|
344
344
|
}),
|
345
345
|
structuredClone(e)
|
346
|
-
]),
|
346
|
+
]), ve = ({
|
347
347
|
disabled: e,
|
348
348
|
formData: t,
|
349
349
|
idSchema: s,
|
@@ -354,39 +354,39 @@ 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: h,
|
358
|
+
formContext: m
|
359
359
|
}) => {
|
360
|
-
const
|
361
|
-
|
360
|
+
const _ = !!c.additionalProperties, u = re(c, h, t) && /* @__PURE__ */ n.jsx(
|
361
|
+
U,
|
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: h,
|
368
368
|
registry: l
|
369
369
|
}
|
370
|
-
),
|
371
|
-
const
|
372
|
-
if (!
|
370
|
+
), x = a.filter((f) => {
|
371
|
+
const g = c.properties?.[f.name]?.hidden;
|
372
|
+
if (!g)
|
373
373
|
return !0;
|
374
374
|
try {
|
375
|
-
const p =
|
375
|
+
const p = je(g);
|
376
376
|
if (!p.path)
|
377
377
|
throw new Error("Empty path property of hidden descriptor field");
|
378
|
-
const
|
378
|
+
const j = y({
|
379
379
|
path: v(p.path),
|
380
|
-
json:
|
380
|
+
json: m,
|
381
381
|
resultType: "value",
|
382
382
|
wrap: !1
|
383
383
|
});
|
384
|
-
return !(
|
384
|
+
return !(j === void 0 || se(p.value, j));
|
385
385
|
} catch {
|
386
386
|
return !0;
|
387
387
|
}
|
388
|
-
}).map((
|
389
|
-
return
|
388
|
+
}).map((f) => f.content);
|
389
|
+
return _ ? a.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
390
390
|
/* @__PURE__ */ n.jsx(
|
391
391
|
T,
|
392
392
|
{
|
@@ -395,21 +395,21 @@ import './assets/@common-rjsf.css';const S = {
|
|
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(T, { label: d, required: o, showLabel: !0, id: s.$id, children:
|
403
|
-
|
404
|
-
|
401
|
+
u
|
402
|
+
] }) : /* @__PURE__ */ n.jsx(T, { 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
|
+
}, Te = (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
|
O,
|
411
411
|
{
|
412
|
-
id:
|
412
|
+
id: ne(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(ve, { ...e })
|
426
426
|
}
|
427
427
|
)
|
428
428
|
] });
|
429
|
-
},
|
429
|
+
}, we = ({
|
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: h } = d, { RemoveButton: m } = h.ButtonTemplates, _ = $ in l;
|
442
|
+
return /* @__PURE__ */ n.jsx(n.Fragment, { children: _ ? /* @__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: (
|
449
|
+
onBlur: (u) => r(u.target.value),
|
450
450
|
placeholder: S.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
|
+
}, Fe = ({
|
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 = G(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
|
+
Y,
|
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
|
+
}, Ne = (e) => {
|
491
491
|
const {
|
492
492
|
id: t,
|
493
493
|
multiple: s = !1,
|
@@ -498,53 +498,54 @@ 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: h,
|
502
|
+
placeholder: m,
|
503
|
+
schema: _
|
504
|
+
} = e, { enumOptions: u = [] } = r, x = s ? [] : null, f = (p) => {
|
505
|
+
c(s ? p.map((j) => j.value) : p.value);
|
506
|
+
}, g = (p) => s ? u.filter((j) => p.some((P) => E(P, j.value))) : u.find((j) => E(p, j.value));
|
506
507
|
return /* @__PURE__ */ n.jsx(
|
507
|
-
|
508
|
+
z,
|
508
509
|
{
|
509
510
|
inputId: `devtron-rjsf-select__${t}`,
|
510
511
|
name: t,
|
511
512
|
isMulti: s,
|
512
|
-
value: typeof a > "u" ?
|
513
|
+
value: typeof a > "u" ? x : g(a),
|
513
514
|
autoFocus: o,
|
514
|
-
onChange:
|
515
|
-
options:
|
515
|
+
onChange: f,
|
516
|
+
options: u,
|
516
517
|
onBlur: () => d(t, a),
|
517
|
-
onFocus: () =>
|
518
|
-
placeholder:
|
518
|
+
onFocus: () => h(t, a),
|
519
|
+
placeholder: _.placeholder || m || S.SELECT,
|
519
520
|
isDisabled: i || l,
|
520
|
-
menuPortalTarget: document.getElementById(
|
521
|
+
menuPortalTarget: document.getElementById(L),
|
521
522
|
menuPosition: "fixed"
|
522
523
|
}
|
523
524
|
);
|
524
|
-
}, Ne = {
|
525
|
-
CheckboxWidget: we,
|
526
|
-
SelectWidget: Fe
|
527
525
|
}, Se = {
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
526
|
+
CheckboxWidget: Fe,
|
527
|
+
SelectWidget: Ne
|
528
|
+
}, Oe = {
|
529
|
+
ArrayFieldItemTemplate: ce,
|
530
|
+
ArrayFieldTemplate: de,
|
531
|
+
BaseInputTemplate: me,
|
532
|
+
ButtonTemplates: { AddButton: U, RemoveButton: pe, SubmitButton: fe },
|
533
|
+
FieldTemplate: he,
|
534
|
+
FieldErrorTemplate: _e,
|
535
|
+
ObjectFieldTemplate: Te,
|
535
536
|
TitleFieldTemplate: O,
|
536
|
-
WrapIfAdditionalTemplate:
|
537
|
-
},
|
538
|
-
const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } =
|
539
|
-
const o =
|
537
|
+
WrapIfAdditionalTemplate: we
|
538
|
+
}, Pe = K, Ce = Q, Me = V((e, t) => {
|
539
|
+
const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } = C(() => {
|
540
|
+
const o = ge(e.schema);
|
540
541
|
return {
|
541
542
|
schemaPathToUpdatePathMap: o,
|
542
543
|
isUpdatePathKeywordPresent: Object.entries(o).some(([c, d]) => c !== d)
|
543
544
|
};
|
544
|
-
}, [e.schema]), a =
|
545
|
+
}, [e.schema]), a = C(() => r ? ye({ formData: e.formData ?? {}, schemaPathToUpdatePathMap: s }) : e.formData, [e.formData, s, r]), i = (o) => {
|
545
546
|
if (!e.onChange)
|
546
547
|
return;
|
547
|
-
const c =
|
548
|
+
const c = I({
|
548
549
|
formState: o.formData,
|
549
550
|
formData: e.formData,
|
550
551
|
schemaPathToUpdatePathMap: s
|
@@ -553,7 +554,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
553
554
|
}, l = (o, c) => {
|
554
555
|
if (!e.onSubmit)
|
555
556
|
return;
|
556
|
-
const d =
|
557
|
+
const d = I({
|
557
558
|
formState: o.formData,
|
558
559
|
formData: e.formData,
|
559
560
|
schemaPathToUpdatePathMap: s
|
@@ -562,7 +563,7 @@ import './assets/@common-rjsf.css';const S = {
|
|
562
563
|
};
|
563
564
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
564
565
|
/* @__PURE__ */ n.jsx(
|
565
|
-
|
566
|
+
Pe,
|
566
567
|
{
|
567
568
|
noHtml5Validate: !0,
|
568
569
|
showErrorList: !1,
|
@@ -574,25 +575,25 @@ import './assets/@common-rjsf.css';const S = {
|
|
574
575
|
onSubmit: l
|
575
576
|
} : {},
|
576
577
|
className: `rjsf-form-template__container ${e.className || ""}`,
|
577
|
-
validator:
|
578
|
+
validator: Ce,
|
578
579
|
templates: {
|
579
|
-
...
|
580
|
+
...Oe,
|
580
581
|
...e.templates
|
581
582
|
},
|
582
583
|
formContext: a,
|
583
|
-
widgets: { ...
|
584
|
-
translateString:
|
584
|
+
widgets: { ...Se, ...e.widgets },
|
585
|
+
translateString: xe,
|
585
586
|
ref: t
|
586
587
|
}
|
587
588
|
),
|
588
|
-
/* @__PURE__ */ n.jsx("div", { id:
|
589
|
+
/* @__PURE__ */ n.jsx("div", { id: L })
|
589
590
|
] });
|
590
591
|
});
|
591
592
|
export {
|
592
593
|
Ue as H,
|
593
594
|
Me as R,
|
594
595
|
He as a,
|
595
|
-
|
596
|
+
ge as b,
|
596
597
|
b as c,
|
597
598
|
ke as g
|
598
599
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './types';
|
@@ -0,0 +1,50 @@
|
|
1
|
+
export interface BulkEditConfigV2Type {
|
2
|
+
gvk: string;
|
3
|
+
readme: string;
|
4
|
+
schema: Record<string, any>;
|
5
|
+
}
|
6
|
+
export interface AppEnvDetail {
|
7
|
+
appName: string;
|
8
|
+
envName?: string;
|
9
|
+
message: string;
|
10
|
+
}
|
11
|
+
export interface ObjectsWithAppEnvDetail extends AppEnvDetail {
|
12
|
+
names: string[];
|
13
|
+
}
|
14
|
+
export interface DeploymentTemplateResponse {
|
15
|
+
message: string[];
|
16
|
+
failure: AppEnvDetail[];
|
17
|
+
successful: AppEnvDetail[];
|
18
|
+
}
|
19
|
+
export interface CmCsResponse {
|
20
|
+
message: string[];
|
21
|
+
failure: ObjectsWithAppEnvDetail[];
|
22
|
+
successful: ObjectsWithAppEnvDetail[];
|
23
|
+
}
|
24
|
+
export interface BulkEditResponseType {
|
25
|
+
deploymentTemplate?: DeploymentTemplateResponse;
|
26
|
+
configMap?: CmCsResponse;
|
27
|
+
secret?: CmCsResponse;
|
28
|
+
}
|
29
|
+
export interface ImpactedDeploymentTemplate {
|
30
|
+
appId?: number;
|
31
|
+
envId?: number;
|
32
|
+
appName: string;
|
33
|
+
envName?: string;
|
34
|
+
}
|
35
|
+
export interface ImpactedCmCs {
|
36
|
+
appId?: number;
|
37
|
+
envId?: number;
|
38
|
+
appName: string;
|
39
|
+
envName?: string;
|
40
|
+
names: string[];
|
41
|
+
}
|
42
|
+
export interface ImpactedObjectsType {
|
43
|
+
deploymentTemplate?: ImpactedDeploymentTemplate[];
|
44
|
+
configMap?: ImpactedCmCs[];
|
45
|
+
secret?: ImpactedCmCs[];
|
46
|
+
}
|
47
|
+
export declare enum BulkEditVersion {
|
48
|
+
v1 = "batch/v1beta1",
|
49
|
+
v2 = "batch/v1beta2"
|
50
|
+
}
|
package/dist/Pages/index.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ChipProps } from './types';
|
2
|
-
declare const Chip: ({ label, startIconProps, size: userSize, value, onRemove, style, type, onClick, capitalizeLabel, href, }: ChipProps) => JSX.Element;
|
2
|
+
declare const Chip: ({ label, startIconProps, startIcon, size: userSize, value, onRemove, style, type, onClick, capitalizeLabel, href, }: ChipProps) => JSX.Element;
|
3
3
|
export default Chip;
|