@devtron-labs/devtron-fe-common-lib 1.5.2-beta-2 → 1.5.3-beta-2
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/{@common-rjsf-C8ECaBh9.js → @code-editor-D6GUKRXw.js} +7155 -7896
- package/dist/@common-rjsf-dtuESmgZ.js +516 -0
- package/dist/{@framer-motion-kiKkrflf.js → @framer-motion-CdgdF0KV.js} +70 -70
- package/dist/@monaco-editor-CVagbUeH.js +138960 -0
- package/dist/{@react-dates-CYDS4B1O.js → @react-dates-CtQV2TLr.js} +14 -14
- package/dist/{@react-select-DO6kTltA.js → @react-select-Cn3OpC9h.js} +1 -1
- package/dist/{@react-virtualized-sticky-tree-CUw0C6F9.js → @react-virtualized-sticky-tree-CVJYfMx0.js} +1 -1
- package/dist/@vendor-CwAQS8iU.js +21782 -0
- package/dist/Common/CodeEditor/CodeEditor.d.ts +3 -9
- package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +47 -3
- package/dist/Common/CodeEditor/index.d.ts +1 -1
- package/dist/Common/CodeEditor/types.d.ts +76 -64
- package/dist/Common/CodeEditor/utils.d.ts +3 -9
- package/dist/Shared/Components/Button/constants.d.ts +2 -3
- package/dist/Shared/Components/Button/utils.d.ts +1 -1
- package/dist/Shared/Components/Collapse/Collapse.d.ts +1 -0
- package/dist/Shared/Components/ScannedByToolModal/types.d.ts +2 -1
- package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +3 -2
- package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +4 -3
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +16 -15
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
- package/dist/Shared/Components/Security/types.d.ts +1 -0
- package/dist/Shared/constants.d.ts +0 -6
- package/dist/Shared/types.d.ts +0 -3
- package/dist/assets/@code-editor.css +1 -0
- package/dist/assets/@common-rjsf.css +1 -1
- package/dist/assets/@monaco-editor.css +1 -0
- package/dist/assets/codicon.ecfbfe4b.ttf +0 -0
- package/dist/assets/ic-scan-fallback.7ff5ed3b.svg +4 -0
- package/dist/index.js +592 -591
- package/package.json +7 -10
- package/dist/@code-editor-BUYzZERD.js +0 -18136
- package/dist/@vendor-Dh1o-c9o.js +0 -41567
- package/dist/Common/ClipboardButton/index.d.ts +0 -1
- package/dist/Common/CodeEditor/CodeEditor.components.d.ts +0 -6
- package/dist/Common/CodeEditor/CodeEditor.context.d.ts +0 -3
- package/dist/Common/CodeEditor/CodeEditor.theme.d.ts +0 -2
- package/dist/Common/CodeEditor/Extensions/findAndReplace.d.ts +0 -2
- package/dist/Common/CodeEditor/Extensions/index.d.ts +0 -3
- package/dist/Common/CodeEditor/Extensions/readOnlyTooltip.d.ts +0 -2
- package/dist/Common/CodeEditor/Extensions/yamlParseErrorLint.d.ts +0 -1
- package/dist/assets/ic-clair.ba79956f.svg +0 -21
- package/dist/assets/ic-match-case.702186fe.svg +0 -3
- package/dist/assets/ic-match-word.991dea5a.svg +0 -3
- package/dist/assets/ic-replace-all-text.4c69aea8.svg +0 -6
- package/dist/assets/ic-replace-text.47c57097.svg +0 -7
- package/dist/assets/ic-trivy.d5338454.svg +0 -25
@@ -0,0 +1,516 @@
|
|
1
|
+
import { j as t, J as $ } from "./@vendor-CwAQS8iU.js";
|
2
|
+
import A, { forwardRef as E } from "react";
|
3
|
+
import L, { getDefaultRegistry as D } from "@rjsf/core";
|
4
|
+
import H from "@rjsf/validator-ajv8";
|
5
|
+
import { T as v, c as U, a as k, i as J, b as w, d as S } from "./@code-editor-D6GUKRXw.js";
|
6
|
+
import M, { components as B } from "react-select";
|
7
|
+
import { ReactComponent as W } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
8
|
+
import { getUiOptions as C, getTemplate as I, getSubmitButtonOptions as V, ADDITIONAL_PROPERTY_FLAG as P, errorId as q, englishStringTranslator as K, TranslatableString as Y, titleId as z, canExpand as G, deepEquals as Q } from "@rjsf/utils";
|
9
|
+
import { ReactComponent as X } from "./assets/ic-add.cfaa779b.svg";
|
10
|
+
import { ReactComponent as Z } from "./assets/ic-cross.01e03666.svg";
|
11
|
+
import { ReactComponent as ee } from "./assets/ic-warning.10bcf8bd.svg";
|
12
|
+
import './assets/@common-rjsf.css';const T = {
|
13
|
+
SELECT: "Please select an option",
|
14
|
+
INPUT: "Please enter an input",
|
15
|
+
OBJECT_KEY: "Please enter a value for the key"
|
16
|
+
}, te = "Key not available", Ae = {
|
17
|
+
"ui:submitButtonOptions": {
|
18
|
+
norender: !0
|
19
|
+
}
|
20
|
+
}, g = ({
|
21
|
+
showLabel: n,
|
22
|
+
label: e,
|
23
|
+
required: s,
|
24
|
+
children: a,
|
25
|
+
id: r,
|
26
|
+
rawDescription: o,
|
27
|
+
shouldAlignCenter: i = !0
|
28
|
+
}) => /* @__PURE__ */ t.jsxs(
|
29
|
+
"div",
|
30
|
+
{
|
31
|
+
className: n ? `display-grid dc__gap-12 rjsf-form-template__field ${i ? "flex-align-center" : ""}` : "",
|
32
|
+
children: [
|
33
|
+
n && /* @__PURE__ */ t.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor: r, children: [
|
34
|
+
/* @__PURE__ */ t.jsx(v, { alwaysShowTippyOnHover: !!o, content: o, children: /* @__PURE__ */ t.jsx("span", { className: `dc__ellipsis-right ${o ? "text-underline-dashed-300" : ""}`, children: e || te }) }),
|
35
|
+
s && /* @__PURE__ */ t.jsx("span", { className: "cr-5", children: " *" })
|
36
|
+
] }),
|
37
|
+
a
|
38
|
+
]
|
39
|
+
}
|
40
|
+
), F = ({ label: n, canAdd: e, onAddClick: s, disabled: a, readonly: r, uiSchema: o, registry: i }) => {
|
41
|
+
const {
|
42
|
+
ButtonTemplates: { AddButton: c }
|
43
|
+
} = i.templates;
|
44
|
+
return e && /* @__PURE__ */ t.jsx(
|
45
|
+
c,
|
46
|
+
{
|
47
|
+
label: n,
|
48
|
+
onClick: s,
|
49
|
+
disabled: a || r,
|
50
|
+
uiSchema: o,
|
51
|
+
registry: i
|
52
|
+
}
|
53
|
+
);
|
54
|
+
}, ne = ({
|
55
|
+
canAdd: n,
|
56
|
+
className: e,
|
57
|
+
disabled: s,
|
58
|
+
idSchema: a,
|
59
|
+
uiSchema: r,
|
60
|
+
items: o,
|
61
|
+
onAddClick: i,
|
62
|
+
readonly: c,
|
63
|
+
registry: l,
|
64
|
+
required: d,
|
65
|
+
title: f
|
66
|
+
}) => {
|
67
|
+
const p = C(r), h = I("ArrayFieldItemTemplate", l, p), m = p.title || f;
|
68
|
+
return /* @__PURE__ */ t.jsx("fieldset", { className: e, id: a.$id, children: o.length ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
69
|
+
o.map(({ key: _, ...x }, j) => {
|
70
|
+
const u = {
|
71
|
+
...x.children,
|
72
|
+
props: {
|
73
|
+
...x.children.props
|
74
|
+
}
|
75
|
+
};
|
76
|
+
return /* @__PURE__ */ t.jsx(h, { ...x, children: u }, _);
|
77
|
+
}),
|
78
|
+
/* @__PURE__ */ t.jsx(
|
79
|
+
F,
|
80
|
+
{
|
81
|
+
label: m,
|
82
|
+
canAdd: n,
|
83
|
+
onAddClick: i,
|
84
|
+
disabled: s,
|
85
|
+
readonly: c,
|
86
|
+
uiSchema: r,
|
87
|
+
registry: l
|
88
|
+
}
|
89
|
+
)
|
90
|
+
] }) : /* @__PURE__ */ t.jsx(g, { label: m, required: d, showLabel: !0, id: a.$id, children: /* @__PURE__ */ t.jsx(
|
91
|
+
F,
|
92
|
+
{
|
93
|
+
label: m,
|
94
|
+
canAdd: n,
|
95
|
+
onAddClick: i,
|
96
|
+
disabled: s,
|
97
|
+
readonly: c,
|
98
|
+
uiSchema: r,
|
99
|
+
registry: l
|
100
|
+
}
|
101
|
+
) }) });
|
102
|
+
}, se = ({
|
103
|
+
children: n,
|
104
|
+
disabled: e,
|
105
|
+
hasToolbar: s,
|
106
|
+
hasRemove: a,
|
107
|
+
index: r,
|
108
|
+
onDropIndexClick: o,
|
109
|
+
readonly: i,
|
110
|
+
registry: c,
|
111
|
+
uiSchema: l
|
112
|
+
}) => {
|
113
|
+
const { RemoveButton: d } = c.templates.ButtonTemplates;
|
114
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "dc__position-rel display-grid rjsf-form-template__array-field-item flex-align-center", children: [
|
115
|
+
n,
|
116
|
+
/* @__PURE__ */ t.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: s && a && /* @__PURE__ */ t.jsx(
|
117
|
+
d,
|
118
|
+
{
|
119
|
+
disabled: e || i,
|
120
|
+
onClick: o(r),
|
121
|
+
uiSchema: l,
|
122
|
+
registry: c
|
123
|
+
}
|
124
|
+
) })
|
125
|
+
] });
|
126
|
+
}, {
|
127
|
+
templates: { BaseInputTemplate: ae }
|
128
|
+
} = D(), re = ({ placeholder: n, ...e }) => /* @__PURE__ */ t.jsx(
|
129
|
+
ae,
|
130
|
+
{
|
131
|
+
placeholder: n || T.INPUT,
|
132
|
+
...e,
|
133
|
+
className: "form__input cn-9 fs-13 lh-20 fw-4"
|
134
|
+
}
|
135
|
+
), R = ({
|
136
|
+
label: n,
|
137
|
+
icon: e,
|
138
|
+
iconType: s,
|
139
|
+
registry: a,
|
140
|
+
uiSchema: r,
|
141
|
+
...o
|
142
|
+
}) => {
|
143
|
+
const i = `Add ${n}`;
|
144
|
+
return /* @__PURE__ */ t.jsx("div", { className: "flexbox flex-justify-start", children: /* @__PURE__ */ t.jsxs(
|
145
|
+
"button",
|
146
|
+
{
|
147
|
+
...o,
|
148
|
+
type: "button",
|
149
|
+
className: "dc__outline-none-imp p-0 dc__transparent flex dc__gap-4 cursor dc__mxw-250",
|
150
|
+
title: "Add",
|
151
|
+
children: [
|
152
|
+
/* @__PURE__ */ t.jsx(X, { className: "icon-dim-16 fcb-5" }),
|
153
|
+
/* @__PURE__ */ t.jsx(v, { placement: "right", content: i, children: /* @__PURE__ */ t.jsx("span", { className: "cb-5 fs-13 lh-34 dc__truncate", children: i }) })
|
154
|
+
]
|
155
|
+
}
|
156
|
+
) });
|
157
|
+
}, oe = ({ icon: n, iconType: e, registry: s, uiSchema: a, ...r }) => /* @__PURE__ */ t.jsx("button", { ...r, type: "button", className: "dc__outline-none-imp p-0 dc__transparent flex cursor", title: "Remove", children: /* @__PURE__ */ t.jsx(Z, { className: "icon-dim-16 fcn-6" }) }), ie = ({ uiSchema: n }) => {
|
158
|
+
const { submitText: e, norender: s, props: a = {} } = V(n);
|
159
|
+
return s ? null : /* @__PURE__ */ t.jsx("div", { className: "flexbox flex-justify-end", children: /* @__PURE__ */ t.jsx("button", { type: "submit", ...a, className: `cta ${a.className || ""}`, children: e }) });
|
160
|
+
}, N = ({
|
161
|
+
id: n,
|
162
|
+
title: e,
|
163
|
+
required: s,
|
164
|
+
description: a
|
165
|
+
}) => /* @__PURE__ */ t.jsxs("legend", { className: "fs-13 fw-6 cn-9 lh-20 dc__no-border pb-9 mb-0", id: n, children: [
|
166
|
+
/* @__PURE__ */ t.jsx(v, { alwaysShowTippyOnHover: !!a, content: a, children: /* @__PURE__ */ t.jsx("span", { className: `${a ? "text-underline-dashed-300" : ""}`, children: e }) }),
|
167
|
+
s && /* @__PURE__ */ t.jsx("span", { className: "cr-5", children: " *" })
|
168
|
+
] }), le = (n) => {
|
169
|
+
const {
|
170
|
+
id: e,
|
171
|
+
label: s,
|
172
|
+
children: a,
|
173
|
+
errors: r,
|
174
|
+
hidden: o,
|
175
|
+
required: i,
|
176
|
+
displayLabel: c,
|
177
|
+
registry: l,
|
178
|
+
uiSchema: d,
|
179
|
+
classNames: f,
|
180
|
+
schema: p,
|
181
|
+
rawDescription: h
|
182
|
+
} = n, m = C(d), _ = I(
|
183
|
+
"WrapIfAdditionalTemplate",
|
184
|
+
l,
|
185
|
+
m
|
186
|
+
), x = P in p, j = (c || p.type === "boolean") && !x, u = p.type === "array";
|
187
|
+
return o ? /* @__PURE__ */ t.jsx("div", { className: "hidden", children: a }) : (
|
188
|
+
// NOTE: need to override the margins of default rjsf css
|
189
|
+
/* @__PURE__ */ t.jsxs("div", { className: `${f} mb-0`, children: [
|
190
|
+
u && /* @__PURE__ */ t.jsx(
|
191
|
+
N,
|
192
|
+
{
|
193
|
+
id: e,
|
194
|
+
title: s,
|
195
|
+
required: i,
|
196
|
+
registry: l,
|
197
|
+
uiSchema: d,
|
198
|
+
schema: p,
|
199
|
+
description: h
|
200
|
+
}
|
201
|
+
),
|
202
|
+
/* @__PURE__ */ t.jsx(
|
203
|
+
g,
|
204
|
+
{
|
205
|
+
label: s,
|
206
|
+
showLabel: j,
|
207
|
+
id: e,
|
208
|
+
required: i,
|
209
|
+
rawDescription: h,
|
210
|
+
children: /* @__PURE__ */ t.jsx(_, { ...n, children: a })
|
211
|
+
}
|
212
|
+
),
|
213
|
+
r
|
214
|
+
] })
|
215
|
+
);
|
216
|
+
}, ce = ({ errors: n = [], idSchema: e }) => {
|
217
|
+
const s = q(e);
|
218
|
+
return n.length > 0 && /* @__PURE__ */ t.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id: s, children: n.filter((a) => !!a).map((a, r) => /* @__PURE__ */ t.jsxs(A.Fragment, { children: [
|
219
|
+
/* @__PURE__ */ t.jsx("span", {}),
|
220
|
+
/* @__PURE__ */ t.jsxs("span", { className: "form__error", children: [
|
221
|
+
/* @__PURE__ */ t.jsx(ee, { className: "form__icon form__icon--error" }),
|
222
|
+
a
|
223
|
+
] })
|
224
|
+
] }, r)) });
|
225
|
+
}, de = (n, e) => {
|
226
|
+
switch (n) {
|
227
|
+
case Y.NewStringDefault:
|
228
|
+
return "";
|
229
|
+
default:
|
230
|
+
return K(n, e);
|
231
|
+
}
|
232
|
+
}, Ee = (n) => {
|
233
|
+
try {
|
234
|
+
const e = new URL(n).origin === window.location.origin;
|
235
|
+
return {
|
236
|
+
href: n,
|
237
|
+
target: e ? "_self" : "_blank",
|
238
|
+
rel: e ? void 0 : "external noreferrer",
|
239
|
+
url: n
|
240
|
+
};
|
241
|
+
} catch {
|
242
|
+
return {
|
243
|
+
href: n,
|
244
|
+
target: "_blank",
|
245
|
+
url: `${n} (Invalid URL)`
|
246
|
+
};
|
247
|
+
}
|
248
|
+
}, Le = (n) => {
|
249
|
+
const e = typeof n;
|
250
|
+
switch (e) {
|
251
|
+
case "boolean":
|
252
|
+
case "string":
|
253
|
+
case "number":
|
254
|
+
return e;
|
255
|
+
case "object":
|
256
|
+
return Array.isArray(n) ? "array" : n === null ? "null" : e;
|
257
|
+
default:
|
258
|
+
return "null";
|
259
|
+
}
|
260
|
+
}, y = (n) => {
|
261
|
+
if (!n)
|
262
|
+
return "";
|
263
|
+
const e = n.trim();
|
264
|
+
return e.match(/^\w+(\/\w+)*$/g) ? `/${e}` : e.match(/^\w+(\.\w+)*$/g) ? `/${e.replaceAll(/\./g, "/")}` : e;
|
265
|
+
}, O = {
|
266
|
+
value: !1,
|
267
|
+
path: ""
|
268
|
+
}, pe = (n) => {
|
269
|
+
if (!n)
|
270
|
+
return null;
|
271
|
+
const e = structuredClone(n);
|
272
|
+
return typeof e == "string" ? {
|
273
|
+
value: !0,
|
274
|
+
path: y(e)
|
275
|
+
} : typeof e != "object" ? structuredClone(O) : Object.hasOwn(e, "condition") && "condition" in e && Object.hasOwn(e, "value") && "value" in e ? {
|
276
|
+
value: e.condition,
|
277
|
+
path: y(e.value)
|
278
|
+
} : Object.hasOwn(e, "value") && "value" in e && Object.hasOwn(e, "path") && "path" in e ? {
|
279
|
+
value: e.value,
|
280
|
+
path: y(e.path)
|
281
|
+
} : structuredClone(O);
|
282
|
+
}, me = ({
|
283
|
+
disabled: n,
|
284
|
+
formData: e,
|
285
|
+
idSchema: s,
|
286
|
+
onAddClick: a,
|
287
|
+
properties: r,
|
288
|
+
readonly: o,
|
289
|
+
registry: i,
|
290
|
+
required: c,
|
291
|
+
schema: l,
|
292
|
+
title: d,
|
293
|
+
uiSchema: f,
|
294
|
+
formContext: p
|
295
|
+
}) => {
|
296
|
+
const h = !!l.additionalProperties, m = G(l, f, e) && /* @__PURE__ */ t.jsx(
|
297
|
+
R,
|
298
|
+
{
|
299
|
+
label: d,
|
300
|
+
className: "object-property-expand",
|
301
|
+
onClick: a(l),
|
302
|
+
disabled: n || o,
|
303
|
+
uiSchema: f,
|
304
|
+
registry: i
|
305
|
+
}
|
306
|
+
), _ = r.filter((x) => {
|
307
|
+
const j = l.properties?.[x.name]?.hidden;
|
308
|
+
if (!j)
|
309
|
+
return !0;
|
310
|
+
try {
|
311
|
+
const u = pe(j);
|
312
|
+
if (!u.path)
|
313
|
+
throw new Error("Empty path property of hidden descriptor field");
|
314
|
+
if (!u.path.match(/^\/\w+(\/\w+)*$/g))
|
315
|
+
throw new Error("Provided path is not a valid JSON pointer");
|
316
|
+
const b = $({
|
317
|
+
path: U(u.path),
|
318
|
+
json: p
|
319
|
+
})?.[0];
|
320
|
+
return !(b === void 0 || Q(u.value, b));
|
321
|
+
} catch {
|
322
|
+
return !0;
|
323
|
+
}
|
324
|
+
}).sort((x) => l.properties?.[x.name]?.type === "boolean" ? -1 : 1).map((x) => x.content);
|
325
|
+
return h ? r.length ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
326
|
+
/* @__PURE__ */ t.jsx(
|
327
|
+
g,
|
328
|
+
{
|
329
|
+
label: d,
|
330
|
+
required: c,
|
331
|
+
showLabel: !0,
|
332
|
+
id: s.$id,
|
333
|
+
shouldAlignCenter: !1,
|
334
|
+
children: /* @__PURE__ */ t.jsx("div", { children: _ })
|
335
|
+
}
|
336
|
+
),
|
337
|
+
m
|
338
|
+
] }) : /* @__PURE__ */ t.jsx(g, { label: d, required: c, showLabel: !0, id: s.$id, children: m }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
339
|
+
_,
|
340
|
+
m
|
341
|
+
] });
|
342
|
+
}, ue = (n) => {
|
343
|
+
const { idSchema: e, registry: s, required: a, schema: r, title: o, uiSchema: i, description: c } = n, l = !!r.additionalProperties, d = o && !l;
|
344
|
+
return /* @__PURE__ */ t.jsxs("fieldset", { id: e.$id, children: [
|
345
|
+
d && /* @__PURE__ */ t.jsx(
|
346
|
+
N,
|
347
|
+
{
|
348
|
+
id: z(e),
|
349
|
+
title: o,
|
350
|
+
required: a,
|
351
|
+
schema: r,
|
352
|
+
uiSchema: i,
|
353
|
+
registry: s,
|
354
|
+
description: c
|
355
|
+
}
|
356
|
+
),
|
357
|
+
/* @__PURE__ */ t.jsx(
|
358
|
+
"div",
|
359
|
+
{
|
360
|
+
className: `${r.properties && !l && e.$id !== "root" ? "dc__border-left pl-12" : ""} ${e.$id === "root" ? "dc__separated-flexbox dc__separated-flexbox--vertical" : "flexbox-col dc__gap-8"}`,
|
361
|
+
children: /* @__PURE__ */ t.jsx(me, { ...n })
|
362
|
+
}
|
363
|
+
)
|
364
|
+
] });
|
365
|
+
}, he = ({
|
366
|
+
id: n,
|
367
|
+
disabled: e,
|
368
|
+
label: s,
|
369
|
+
onKeyChange: a,
|
370
|
+
onDropPropertyClick: r,
|
371
|
+
readonly: o,
|
372
|
+
schema: i,
|
373
|
+
children: c,
|
374
|
+
uiSchema: l,
|
375
|
+
registry: d
|
376
|
+
}) => {
|
377
|
+
const { templates: f } = d, { RemoveButton: p } = f.ButtonTemplates, h = P in i;
|
378
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: h ? /* @__PURE__ */ t.jsxs("div", { className: "dc__position-rel rjsf-form-template__additional-fields display-grid dc__gap-8 flex-align-center", children: [
|
379
|
+
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
380
|
+
"input",
|
381
|
+
{
|
382
|
+
type: "text",
|
383
|
+
className: "form__input cn-9 fs-13 lh-20 fw-4",
|
384
|
+
id: `${n}-key`,
|
385
|
+
onBlur: (m) => a(m.target.value),
|
386
|
+
placeholder: T.OBJECT_KEY,
|
387
|
+
defaultValue: s
|
388
|
+
}
|
389
|
+
) }),
|
390
|
+
/* @__PURE__ */ t.jsx("div", { children: c }),
|
391
|
+
/* @__PURE__ */ t.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: /* @__PURE__ */ t.jsx(
|
392
|
+
p,
|
393
|
+
{
|
394
|
+
disabled: e || o,
|
395
|
+
onClick: r(s),
|
396
|
+
uiSchema: l,
|
397
|
+
registry: d
|
398
|
+
}
|
399
|
+
) })
|
400
|
+
] }) : c });
|
401
|
+
}, fe = ({
|
402
|
+
id: n,
|
403
|
+
onChange: e,
|
404
|
+
value: s,
|
405
|
+
required: a,
|
406
|
+
disabled: r,
|
407
|
+
readonly: o,
|
408
|
+
autofocus: i,
|
409
|
+
onBlur: c,
|
410
|
+
onFocus: l
|
411
|
+
}) => {
|
412
|
+
const d = (p, h) => {
|
413
|
+
const { id: m, checked: _ } = p.target;
|
414
|
+
h === "blur" ? c(m, _) : h === "focus" && l(m, _);
|
415
|
+
}, f = J(s) ? !1 : s;
|
416
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
417
|
+
/* @__PURE__ */ t.jsx(
|
418
|
+
k,
|
419
|
+
{
|
420
|
+
selected: f,
|
421
|
+
onSelect: e,
|
422
|
+
id: n,
|
423
|
+
name: n,
|
424
|
+
required: a,
|
425
|
+
disabled: r || o,
|
426
|
+
autoFocus: i,
|
427
|
+
rootClassName: "w-32 mb-0 dc__height-inherit",
|
428
|
+
onBlur: (p) => d(p, "blur"),
|
429
|
+
onFocus: (p) => d(p, "focus")
|
430
|
+
}
|
431
|
+
),
|
432
|
+
/* @__PURE__ */ t.jsx("span", { className: "dc__capitalize ml-8", children: f.toString() })
|
433
|
+
] });
|
434
|
+
}, xe = ({ children: n, ...e }) => /* @__PURE__ */ t.jsx(B.MenuList, { ...e, children: Array.isArray(n) ? n.slice(0, 20) : n }), je = (n) => /* @__PURE__ */ t.jsx(B.DropdownIndicator, { ...n, children: /* @__PURE__ */ t.jsx(W, { className: "icon-dim-20 icon-n5", "data-testid": "overview-project-edit-dropdown" }) }), _e = (n) => {
|
435
|
+
const {
|
436
|
+
id: e,
|
437
|
+
multiple: s = !1,
|
438
|
+
options: a,
|
439
|
+
value: r,
|
440
|
+
disabled: o,
|
441
|
+
readonly: i,
|
442
|
+
autofocus: c = !1,
|
443
|
+
onChange: l,
|
444
|
+
onBlur: d,
|
445
|
+
onFocus: f,
|
446
|
+
placeholder: p
|
447
|
+
} = n, { enumOptions: h = [] } = a, m = s ? [] : "", _ = (j) => {
|
448
|
+
l(s ? j.map((u) => u.value) : j.value);
|
449
|
+
}, x = (j) => s ? h.filter((u) => j.some((b) => S(b, u.value))) : h.find((u) => S(j, u.value));
|
450
|
+
return /* @__PURE__ */ t.jsx(
|
451
|
+
M,
|
452
|
+
{
|
453
|
+
id: e,
|
454
|
+
name: e,
|
455
|
+
isMulti: s,
|
456
|
+
value: typeof r > "u" ? m : x(r),
|
457
|
+
autoFocus: c,
|
458
|
+
onChange: _,
|
459
|
+
options: h,
|
460
|
+
onBlur: () => d(e, r),
|
461
|
+
onFocus: () => f(e, r),
|
462
|
+
placeholder: p || T.SELECT,
|
463
|
+
isDisabled: o || i,
|
464
|
+
styles: {
|
465
|
+
...w,
|
466
|
+
control: (j, u) => ({
|
467
|
+
...w.control(j, u),
|
468
|
+
height: "36px"
|
469
|
+
})
|
470
|
+
},
|
471
|
+
components: {
|
472
|
+
IndicatorSeparator: null,
|
473
|
+
DropdownIndicator: je,
|
474
|
+
MenuList: xe
|
475
|
+
},
|
476
|
+
menuPlacement: "auto"
|
477
|
+
}
|
478
|
+
);
|
479
|
+
}, be = {
|
480
|
+
CheckboxWidget: fe,
|
481
|
+
SelectWidget: _e
|
482
|
+
}, ge = {
|
483
|
+
ArrayFieldItemTemplate: se,
|
484
|
+
ArrayFieldTemplate: ne,
|
485
|
+
BaseInputTemplate: re,
|
486
|
+
ButtonTemplates: { AddButton: R, RemoveButton: oe, SubmitButton: ie },
|
487
|
+
FieldTemplate: le,
|
488
|
+
FieldErrorTemplate: ce,
|
489
|
+
ObjectFieldTemplate: ue,
|
490
|
+
TitleFieldTemplate: N,
|
491
|
+
WrapIfAdditionalTemplate: he
|
492
|
+
}, ye = L, ve = H, De = E((n, e) => /* @__PURE__ */ t.jsx(
|
493
|
+
ye,
|
494
|
+
{
|
495
|
+
noHtml5Validate: !0,
|
496
|
+
showErrorList: !1,
|
497
|
+
autoComplete: "off",
|
498
|
+
...n,
|
499
|
+
className: `rjsf-form-template__container ${n.className || ""}`,
|
500
|
+
validator: ve,
|
501
|
+
templates: {
|
502
|
+
...ge,
|
503
|
+
...n.templates
|
504
|
+
},
|
505
|
+
formContext: n.formData,
|
506
|
+
widgets: { ...be, ...n.widgets },
|
507
|
+
translateString: de,
|
508
|
+
ref: e
|
509
|
+
}
|
510
|
+
));
|
511
|
+
export {
|
512
|
+
Ae as H,
|
513
|
+
De as R,
|
514
|
+
Ee as a,
|
515
|
+
Le as g
|
516
|
+
};
|