@devtron-labs/devtron-fe-common-lib 1.10.15-beta-3 → 1.10.15-gatekeeper-1

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.
Files changed (64) hide show
  1. package/dist/{@code-editor-Cq3RvVHz.js → @common-rjsf-DpMVaiMa.js} +8692 -9804
  2. package/dist/{@framer-motion-DMD7dX-G.js → @framer-motion-DI44jecR.js} +1 -1
  3. package/dist/{@react-dates-DxmDHBUI.js → @react-dates-lUQ2WJOE.js} +333 -333
  4. package/dist/{@react-select-BR4eLpVa.js → @react-select-DrPIgUsG.js} +1 -1
  5. package/dist/{@react-virtualized-sticky-tree-Ca-pl6uN.js → @react-virtualized-sticky-tree-D-jip2dN.js} +1 -1
  6. package/dist/@vendor-DxSbZ5Xu.js +29041 -0
  7. package/dist/Common/SegmentedControl/types.d.ts +0 -4
  8. package/dist/Common/Toggle/Toggle.d.ts +1 -2
  9. package/dist/Common/Types.d.ts +0 -1
  10. package/dist/Common/index.d.ts +0 -1
  11. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.d.ts +1 -1
  12. package/dist/Shared/Components/ConfirmationModal/index.d.ts +0 -1
  13. package/dist/Shared/Components/Icon/Icon.d.ts +0 -14
  14. package/dist/Shared/Components/Icon/types.d.ts +1 -1
  15. package/dist/Shared/Components/TabGroup/TabGroup.helpers.d.ts +2 -2
  16. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +3 -5
  17. package/dist/Shared/Components/TabGroup/TabGroup.utils.d.ts +0 -2
  18. package/dist/Shared/Components/index.d.ts +0 -2
  19. package/dist/Shared/Hooks/index.d.ts +0 -1
  20. package/dist/Shared/types.d.ts +4 -13
  21. package/dist/assets/@common-rjsf.css +1 -1
  22. package/dist/assets/ic-hibernate.988d2323.svg +28 -0
  23. package/dist/index.js +636 -646
  24. package/package.json +1 -7
  25. package/dist/@common-rjsf-e_cHSsWz.js +0 -617
  26. package/dist/@monaco-editor-CVagbUeH.js +0 -138960
  27. package/dist/@vendor-DZHtXPTX.js +0 -68691
  28. package/dist/Common/CodeEditor/CodeEditor.d.ts +0 -4
  29. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +0 -48
  30. package/dist/Common/CodeEditor/index.d.ts +0 -2
  31. package/dist/Common/CodeEditor/types.d.ts +0 -110
  32. package/dist/Common/CodeEditor/utils.d.ts +0 -3
  33. package/dist/Shared/Components/CodeEditorWrapper/CodeEditorWrapper.d.ts +0 -19
  34. package/dist/Shared/Components/CodeEditorWrapper/index.d.ts +0 -1
  35. package/dist/Shared/Components/CodeEditorWrapper/types.d.ts +0 -7
  36. package/dist/Shared/Components/FramerComponents/MotionDiv.d.ts +0 -2
  37. package/dist/Shared/Components/FramerComponents/index.d.ts +0 -3
  38. package/dist/Shared/Hooks/useOneTimePrompt/constants.d.ts +0 -1
  39. package/dist/Shared/Hooks/useOneTimePrompt/index.d.ts +0 -1
  40. package/dist/Shared/Hooks/useOneTimePrompt/types.d.ts +0 -3
  41. package/dist/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.d.ts +0 -6
  42. package/dist/assets/@code-editor.css +0 -1
  43. package/dist/assets/@monaco-editor.css +0 -1
  44. package/dist/assets/codicon.ecfbfe4b.ttf +0 -0
  45. package/dist/assets/ic-arrows-left-right.2d4dda45.svg +0 -3
  46. package/dist/assets/ic-check.a0f5ee85.svg +0 -3
  47. package/dist/assets/ic-close-large.fb6095e0.svg +0 -3
  48. package/dist/assets/ic-compare.0ee3e4cf.svg +0 -22
  49. package/dist/assets/ic-delete-lightning.2a7545bd.svg +0 -3
  50. package/dist/assets/ic-folder-user.ff0670e8.svg +0 -3
  51. package/dist/assets/ic-hibernate.f75c1e70.svg +0 -19
  52. package/dist/assets/ic-lightning-fill.25ce980f.svg +0 -3
  53. package/dist/assets/ic-lightning.02da5bf8.svg +0 -3
  54. package/dist/assets/ic-match-case.13b7a2fa.svg +0 -19
  55. package/dist/assets/ic-match-word.d92addc3.svg +0 -19
  56. package/dist/assets/ic-medium-delete.f33a9cd7.svg +0 -11
  57. package/dist/assets/ic-pencil.3ea1c075.svg +0 -3
  58. package/dist/assets/ic-replace-all-text.a87fd342.svg +0 -19
  59. package/dist/assets/ic-replace-text.cc5433be.svg +0 -19
  60. package/dist/assets/ic-sort-ascending.45f474ff.svg +0 -3
  61. package/dist/assets/ic-sort-descending.0ee6b8dd.svg +0 -3
  62. package/dist/assets/ic-sortable.1d3308e1.svg +0 -3
  63. package/dist/assets/ic-stamp.23836e37.svg +0 -3
  64. package/dist/assets/ic-users.102d4732.svg +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "1.10.15-beta-3",
3
+ "version": "1.10.15-gatekeeper-1",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -65,8 +65,6 @@
65
65
  "json-schema": "^0.4.0",
66
66
  "lint-staged": "^12.5.0",
67
67
  "moment": "^2.29.4",
68
- "monaco-editor": "0.44.0",
69
- "monaco-yaml": "5.1.1",
70
68
  "prettier": "^3.1.1",
71
69
  "react-ga4": "^1.4.1",
72
70
  "react-toastify": "9.1.3",
@@ -125,7 +123,6 @@
125
123
  "react-diff-viewer-continued": "^3.4.0",
126
124
  "react-draggable": "^4.4.5",
127
125
  "react-international-phone": "^4.5.0",
128
- "react-monaco-editor": "^0.54.0",
129
126
  "react-virtualized-sticky-tree": "^3.0.0-beta18",
130
127
  "sass": "^1.69.7",
131
128
  "tslib": "2.7.0"
@@ -136,9 +133,6 @@
136
133
  "react": "^17.0.2",
137
134
  "react-dom": "^17.0.2"
138
135
  },
139
- "react-monaco-editor": {
140
- "monaco-editor": "0.44.0"
141
- },
142
136
  "vite-plugin-svgr": {
143
137
  "vite": "5.4.14"
144
138
  },
@@ -1,617 +0,0 @@
1
- import { j as n, au as y, aw as k, av as W } from "./@vendor-DZHtXPTX.js";
2
- import V, { forwardRef as J, useMemo as P } from "react";
3
- import K, { getDefaultRegistry as q } from "@rjsf/core";
4
- import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-Cq3RvVHz.js";
5
- import Q, { components as D } from "react-select";
6
- import { ReactComponent as X } from "./assets/ic-chevron-down.fc70d7a7.svg";
7
- import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as se, deepEquals as ae } from "@rjsf/utils";
8
- import { ReactComponent as oe } from "./assets/ic-add.cfaa779b.svg";
9
- import { ReactComponent as ie } from "./assets/ic-cross.01e03666.svg";
10
- import { ReactComponent as le } from "./assets/ic-warning.ecf7ff97.svg";
11
- import './assets/@common-rjsf.css';const O = {
12
- SELECT: "Please select an option",
13
- INPUT: "Please enter an input",
14
- OBJECT_KEY: "Please enter a value for the key"
15
- }, ce = "Key not available", Je = {
16
- "ui:submitButtonOptions": {
17
- norender: !0
18
- }
19
- }, T = ({
20
- showLabel: e,
21
- label: t,
22
- required: s,
23
- children: r,
24
- id: a,
25
- rawDescription: i,
26
- shouldAlignCenter: l = !0
27
- }) => /* @__PURE__ */ n.jsxs(
28
- "div",
29
- {
30
- className: e ? `display-grid dc__gap-12 rjsf-form-template__field ${l ? "flex-align-center" : ""}` : "",
31
- children: [
32
- e && /* @__PURE__ */ n.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor: a, children: [
33
- /* @__PURE__ */ n.jsx(F, { alwaysShowTippyOnHover: !!i, content: i, children: /* @__PURE__ */ n.jsx("span", { className: `dc__ellipsis-right ${i ? "text-underline-dashed-300" : ""}`, children: t || ce }) }),
34
- s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
35
- ] }),
36
- r
37
- ]
38
- }
39
- ), A = ({ label: e, canAdd: t, onAddClick: s, disabled: r, readonly: a, uiSchema: i, registry: l }) => {
40
- const {
41
- ButtonTemplates: { AddButton: o }
42
- } = l.templates;
43
- return t && /* @__PURE__ */ n.jsx(
44
- o,
45
- {
46
- label: e,
47
- onClick: s,
48
- disabled: r || a,
49
- uiSchema: i,
50
- registry: l
51
- }
52
- );
53
- }, de = ({
54
- canAdd: e,
55
- className: t,
56
- disabled: s,
57
- idSchema: r,
58
- uiSchema: a,
59
- items: i,
60
- onAddClick: l,
61
- readonly: o,
62
- registry: c,
63
- required: d,
64
- title: x
65
- }) => {
66
- const u = B(a), f = $("ArrayFieldItemTemplate", c, u), p = u.title || x;
67
- return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: r.$id, children: i.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
68
- i.map(({ key: _, ...j }, h) => {
69
- const m = {
70
- ...j.children,
71
- props: {
72
- ...j.children.props
73
- }
74
- };
75
- return /* @__PURE__ */ n.jsx(f, { ...j, children: m }, _);
76
- }),
77
- /* @__PURE__ */ n.jsx(
78
- A,
79
- {
80
- label: p,
81
- canAdd: e,
82
- onAddClick: l,
83
- disabled: s,
84
- readonly: o,
85
- uiSchema: a,
86
- registry: c
87
- }
88
- )
89
- ] }) : /* @__PURE__ */ n.jsx(T, { label: p, required: d, showLabel: !0, id: r.$id, children: /* @__PURE__ */ n.jsx(
90
- A,
91
- {
92
- label: p,
93
- canAdd: e,
94
- onAddClick: l,
95
- disabled: s,
96
- readonly: o,
97
- uiSchema: a,
98
- registry: c
99
- }
100
- ) }) });
101
- }, ue = ({
102
- children: e,
103
- disabled: t,
104
- hasToolbar: s,
105
- hasRemove: r,
106
- index: a,
107
- onDropIndexClick: i,
108
- readonly: l,
109
- registry: o,
110
- uiSchema: c
111
- }) => {
112
- const { RemoveButton: d } = o.templates.ButtonTemplates;
113
- return /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel display-grid rjsf-form-template__array-field-item flex-align-center", children: [
114
- e,
115
- /* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: s && r && /* @__PURE__ */ n.jsx(
116
- d,
117
- {
118
- disabled: t || l,
119
- onClick: i(a),
120
- uiSchema: c,
121
- registry: o
122
- }
123
- ) })
124
- ] });
125
- }, {
126
- templates: { BaseInputTemplate: me }
127
- } = q(), pe = ({ placeholder: e, ...t }) => /* @__PURE__ */ n.jsx(
128
- me,
129
- {
130
- placeholder: e || O.INPUT,
131
- ...t,
132
- className: "form__input cn-9 fs-13 lh-20 fw-4"
133
- }
134
- ), U = ({
135
- label: e,
136
- icon: t,
137
- iconType: s,
138
- registry: r,
139
- uiSchema: a,
140
- ...i
141
- }) => {
142
- const l = `Add ${e}`;
143
- return /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-start", children: /* @__PURE__ */ n.jsxs(
144
- "button",
145
- {
146
- ...i,
147
- type: "button",
148
- className: "dc__outline-none-imp p-0 dc__transparent flex dc__gap-4 cursor dc__mxw-250",
149
- title: "Add",
150
- children: [
151
- /* @__PURE__ */ n.jsx(oe, { className: "icon-dim-16 fcb-5" }),
152
- /* @__PURE__ */ n.jsx(F, { placement: "right", content: l, children: /* @__PURE__ */ n.jsx("span", { className: "cb-5 fs-13 lh-34 dc__truncate", children: l }) })
153
- ]
154
- }
155
- ) });
156
- }, fe = ({ 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(ie, { className: "icon-dim-16 fcn-6" }) }), he = ({ uiSchema: e }) => {
157
- const { submitText: t, norender: s, props: r = {} } = Z(e);
158
- 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 }) });
159
- }, C = ({
160
- id: e,
161
- title: t,
162
- required: s,
163
- description: r
164
- }) => /* @__PURE__ */ n.jsxs("legend", { className: "fs-13 fw-6 cn-9 lh-20 dc__no-border pb-9 mb-0", id: e, children: [
165
- /* @__PURE__ */ n.jsx(F, { alwaysShowTippyOnHover: !!r, content: r, children: /* @__PURE__ */ n.jsx("span", { className: `${r ? "text-underline-dashed-300" : ""}`, children: t }) }),
166
- s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
167
- ] }), xe = (e) => {
168
- const {
169
- id: t,
170
- label: s,
171
- children: r,
172
- errors: a,
173
- hidden: i,
174
- required: l,
175
- displayLabel: o,
176
- registry: c,
177
- uiSchema: d,
178
- classNames: x,
179
- schema: u,
180
- rawDescription: f
181
- } = e, p = B(d), _ = $(
182
- "WrapIfAdditionalTemplate",
183
- c,
184
- p
185
- ), j = L in u, h = (o || u.type === "boolean") && !j, m = u.type === "array";
186
- return i ? /* @__PURE__ */ n.jsx("div", { className: "hidden", children: r }) : (
187
- // NOTE: need to override the margins of default rjsf css
188
- /* @__PURE__ */ n.jsxs("div", { className: `${x} mb-0`, children: [
189
- m && /* @__PURE__ */ n.jsx(
190
- C,
191
- {
192
- id: t,
193
- title: s,
194
- required: l,
195
- registry: c,
196
- uiSchema: d,
197
- schema: u,
198
- description: f
199
- }
200
- ),
201
- /* @__PURE__ */ n.jsx(
202
- T,
203
- {
204
- label: s,
205
- showLabel: h,
206
- id: t,
207
- required: l,
208
- rawDescription: f,
209
- children: /* @__PURE__ */ n.jsx(_, { ...e, children: r })
210
- }
211
- ),
212
- a
213
- ] })
214
- );
215
- }, je = ({ errors: e = [], idSchema: t }) => {
216
- const s = ee(t);
217
- 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: [
218
- /* @__PURE__ */ n.jsx("span", {}),
219
- /* @__PURE__ */ n.jsxs("span", { className: "form__error", children: [
220
- /* @__PURE__ */ n.jsx(le, { className: "form__icon form__icon--error" }),
221
- r
222
- ] })
223
- ] }, a)) });
224
- }, _e = (e, t) => {
225
- switch (e) {
226
- case ne.NewStringDefault:
227
- return "";
228
- default:
229
- return te(e, t);
230
- }
231
- }, Ke = (e) => {
232
- try {
233
- const t = new URL(e).origin === window.location.origin;
234
- return {
235
- href: e,
236
- target: t ? "_self" : "_blank",
237
- rel: t ? void 0 : "external noreferrer",
238
- url: e
239
- };
240
- } catch {
241
- return {
242
- href: e,
243
- target: "_blank",
244
- url: `${e} (Invalid URL)`
245
- };
246
- }
247
- }, qe = (e) => {
248
- const t = typeof e;
249
- switch (t) {
250
- case "boolean":
251
- case "string":
252
- case "number":
253
- return t;
254
- case "object":
255
- return Array.isArray(e) ? "array" : e === null ? "null" : t;
256
- default:
257
- return "null";
258
- }
259
- }, b = (e) => {
260
- if (!e)
261
- return "";
262
- const t = e.trim(), r = (/^\/.+$/g.test(t) ? t : `/${t}`).replaceAll(/\./g, "/");
263
- return /(\/(([^/~])|(~[01]))*)/g.test(r) ? r : "";
264
- }, R = {
265
- value: !1,
266
- path: ""
267
- }, ge = (e) => {
268
- if (!e)
269
- return null;
270
- const t = structuredClone(e);
271
- return typeof t == "string" ? {
272
- value: !0,
273
- path: b(t)
274
- } : typeof t != "object" ? structuredClone(R) : Object.hasOwn(t, "condition") && "condition" in t && Object.hasOwn(t, "value") && "value" in t ? {
275
- value: t.condition,
276
- path: b(t.value)
277
- } : Object.hasOwn(t, "value") && "value" in t && Object.hasOwn(t, "path") && "path" in t ? {
278
- value: t.value,
279
- path: b(t.path)
280
- } : structuredClone(R);
281
- }, H = (e, t, s) => {
282
- e && (e.type === "object" && e.properties && typeof e.properties == "object" && Object.entries(e.properties).forEach(([r, a]) => {
283
- H(a, `${t}/${r}`, s);
284
- }), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (s[t] = b(e.updatePath ?? t)));
285
- }, be = (e) => {
286
- const t = {};
287
- return H(e, "", t), t;
288
- }, M = (e, t, s) => {
289
- if (t >= s.length)
290
- return e;
291
- const r = s[t];
292
- if (t === s.length - 1) {
293
- const a = structuredClone(e);
294
- return delete a[r], a;
295
- }
296
- if (e[r] && (e[r] = M(e[r], t + 1, s)), Object.keys(e[r] ?? {}).length === 0) {
297
- const a = structuredClone(e);
298
- return delete a[r], a;
299
- }
300
- return e;
301
- }, ye = (e, t) => {
302
- if (!e || typeof e != "object" || Array.isArray(e))
303
- throw new Error("Invalid object");
304
- if (!t || !t.startsWith("/"))
305
- throw new Error("Invalid path");
306
- const s = t.split("/").slice(1);
307
- return M(e, 0, s);
308
- }, I = ({
309
- formState: e,
310
- formData: t,
311
- schemaPathToUpdatePathMap: s
312
- }) => {
313
- let r = structuredClone(e);
314
- return r && (Object.entries(s).forEach(([a, i]) => {
315
- if (a === i || !i)
316
- return;
317
- const l = y({
318
- json: t,
319
- path: v(a),
320
- resultType: "value",
321
- wrap: !1
322
- });
323
- l === void 0 ? r = ye(r, a) : r = N([S(a, l), r]);
324
- const o = y({
325
- json: e,
326
- path: v(a),
327
- resultType: "value",
328
- wrap: !1
329
- });
330
- o !== void 0 && (r = N([S(i, o), r]));
331
- }), t && r ? k(t, W(t, r), !1, !1).newDocument : r);
332
- }, ve = ({ formData: e, schemaPathToUpdatePathMap: t }) => N([
333
- ...Object.entries(t).map(([s, r]) => {
334
- if (s === r || !r)
335
- return {};
336
- const a = y({
337
- json: e,
338
- path: v(r),
339
- resultType: "value",
340
- wrap: !1
341
- });
342
- return a === void 0 ? {} : S(s, a);
343
- }),
344
- structuredClone(e)
345
- ]), Te = ({
346
- disabled: e,
347
- formData: t,
348
- idSchema: s,
349
- onAddClick: r,
350
- properties: a,
351
- readonly: i,
352
- registry: l,
353
- required: o,
354
- schema: c,
355
- title: d,
356
- uiSchema: x,
357
- formContext: u
358
- }) => {
359
- const f = !!c.additionalProperties, p = se(c, x, t) && /* @__PURE__ */ n.jsx(
360
- U,
361
- {
362
- label: d,
363
- className: "object-property-expand",
364
- onClick: r(c),
365
- disabled: e || i,
366
- uiSchema: x,
367
- registry: l
368
- }
369
- ), _ = a.filter((j) => {
370
- const h = c.properties?.[j.name]?.hidden;
371
- if (!h)
372
- return !0;
373
- try {
374
- const m = ge(h);
375
- if (!m.path)
376
- throw new Error("Empty path property of hidden descriptor field");
377
- const g = y({
378
- path: v(m.path),
379
- json: u,
380
- resultType: "value",
381
- wrap: !1
382
- });
383
- return !(g === void 0 || ae(m.value, g));
384
- } catch {
385
- return !0;
386
- }
387
- }).sort((j) => c.properties?.[j.name]?.type === "boolean" ? -1 : 1).map((j) => j.content);
388
- return f ? a.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
389
- /* @__PURE__ */ n.jsx(
390
- T,
391
- {
392
- label: d,
393
- required: o,
394
- showLabel: !0,
395
- id: s.$id,
396
- shouldAlignCenter: !1,
397
- children: /* @__PURE__ */ n.jsx("div", { children: _ })
398
- }
399
- ),
400
- p
401
- ] }) : /* @__PURE__ */ n.jsx(T, { label: d, required: o, showLabel: !0, id: s.$id, children: p }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
402
- _,
403
- p
404
- ] });
405
- }, we = (e) => {
406
- const { idSchema: t, registry: s, required: r, schema: a, title: i, uiSchema: l, description: o } = e, c = !!a.additionalProperties, d = i && !c;
407
- return /* @__PURE__ */ n.jsxs("fieldset", { id: t.$id, children: [
408
- d && /* @__PURE__ */ n.jsx(
409
- C,
410
- {
411
- id: re(t),
412
- title: i,
413
- required: r,
414
- schema: a,
415
- uiSchema: l,
416
- registry: s,
417
- description: o
418
- }
419
- ),
420
- /* @__PURE__ */ n.jsx(
421
- "div",
422
- {
423
- 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"}`,
424
- children: /* @__PURE__ */ n.jsx(Te, { ...e })
425
- }
426
- )
427
- ] });
428
- }, Ne = ({
429
- id: e,
430
- disabled: t,
431
- label: s,
432
- onKeyChange: r,
433
- onDropPropertyClick: a,
434
- readonly: i,
435
- schema: l,
436
- children: o,
437
- uiSchema: c,
438
- registry: d
439
- }) => {
440
- const { templates: x } = d, { RemoveButton: u } = x.ButtonTemplates, f = L in l;
441
- return /* @__PURE__ */ n.jsx(n.Fragment, { children: f ? /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel rjsf-form-template__additional-fields display-grid dc__gap-8 flex-align-center", children: [
442
- /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(
443
- "input",
444
- {
445
- type: "text",
446
- className: "form__input cn-9 fs-13 lh-20 fw-4",
447
- id: `${e}-key`,
448
- onBlur: (p) => r(p.target.value),
449
- placeholder: O.OBJECT_KEY,
450
- defaultValue: s
451
- }
452
- ) }),
453
- /* @__PURE__ */ n.jsx("div", { children: o }),
454
- /* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: /* @__PURE__ */ n.jsx(
455
- u,
456
- {
457
- disabled: t || i,
458
- onClick: a(s),
459
- uiSchema: c,
460
- registry: d
461
- }
462
- ) })
463
- ] }) : o });
464
- }, Se = ({
465
- id: e,
466
- onChange: t,
467
- value: s,
468
- required: r,
469
- disabled: a,
470
- readonly: i,
471
- autofocus: l,
472
- onBlur: o,
473
- onFocus: c
474
- }) => {
475
- const d = (u, f) => {
476
- const { id: p, checked: _ } = u.target;
477
- f === "blur" ? o(p, _) : f === "focus" && c(p, _);
478
- }, x = z(s) ? !1 : s;
479
- return /* @__PURE__ */ n.jsxs("div", { children: [
480
- /* @__PURE__ */ n.jsx(
481
- Y,
482
- {
483
- selected: x,
484
- onSelect: t,
485
- id: e,
486
- name: e,
487
- required: r,
488
- disabled: a || i,
489
- autoFocus: l,
490
- rootClassName: "w-32 mb-0 dc__height-inherit",
491
- onBlur: (u) => d(u, "blur"),
492
- onFocus: (u) => d(u, "focus")
493
- }
494
- ),
495
- /* @__PURE__ */ n.jsx("span", { className: "dc__capitalize ml-8", children: x.toString() })
496
- ] });
497
- }, Fe = ({ children: e, ...t }) => /* @__PURE__ */ n.jsx(D.MenuList, { ...t, children: Array.isArray(e) ? e.slice(0, 20) : e }), Oe = (e) => /* @__PURE__ */ n.jsx(D.DropdownIndicator, { ...e, children: /* @__PURE__ */ n.jsx(X, { className: "icon-dim-20 icon-n5", "data-testid": "overview-project-edit-dropdown" }) }), Ce = (e) => {
498
- const {
499
- id: t,
500
- multiple: s = !1,
501
- options: r,
502
- value: a,
503
- disabled: i,
504
- readonly: l,
505
- autofocus: o = !1,
506
- onChange: c,
507
- onBlur: d,
508
- onFocus: x,
509
- placeholder: u
510
- } = e, { enumOptions: f = [] } = r, p = s ? [] : "", _ = (h) => {
511
- c(s ? h.map((m) => m.value) : h.value);
512
- }, j = (h) => s ? f.filter((m) => h.some((g) => E(g, m.value))) : f.find((m) => E(h, m.value));
513
- return /* @__PURE__ */ n.jsx(
514
- Q,
515
- {
516
- id: t,
517
- name: t,
518
- isMulti: s,
519
- value: typeof a > "u" ? p : j(a),
520
- autoFocus: o,
521
- onChange: _,
522
- options: f,
523
- onBlur: () => d(t, a),
524
- onFocus: () => x(t, a),
525
- placeholder: u || O.SELECT,
526
- isDisabled: i || l,
527
- styles: {
528
- ...w,
529
- control: (h, m) => ({
530
- ...w.control(h, m),
531
- minHeight: "36px"
532
- }),
533
- multiValue: (h, m) => ({
534
- ...w.multiValue(h, m),
535
- margin: "2px 8px 2px 2px"
536
- })
537
- },
538
- components: {
539
- IndicatorSeparator: null,
540
- DropdownIndicator: Oe,
541
- MenuList: Fe
542
- },
543
- menuPlacement: "auto"
544
- }
545
- );
546
- }, Pe = {
547
- CheckboxWidget: Se,
548
- SelectWidget: Ce
549
- }, Ee = {
550
- ArrayFieldItemTemplate: ue,
551
- ArrayFieldTemplate: de,
552
- BaseInputTemplate: pe,
553
- ButtonTemplates: { AddButton: U, RemoveButton: fe, SubmitButton: he },
554
- FieldTemplate: xe,
555
- FieldErrorTemplate: je,
556
- ObjectFieldTemplate: we,
557
- TitleFieldTemplate: C,
558
- WrapIfAdditionalTemplate: Ne
559
- }, Ae = K, Re = G, Ye = J((e, t) => {
560
- const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } = P(() => {
561
- const o = be(e.schema);
562
- return {
563
- schemaPathToUpdatePathMap: o,
564
- isUpdatePathKeywordPresent: Object.entries(o).some(([c, d]) => c !== d)
565
- };
566
- }, [e.schema]), a = P(() => r ? ve({ formData: e.formData ?? {}, schemaPathToUpdatePathMap: s }) : e.formData, [e.formData, s, r]), i = (o) => {
567
- if (!e.onChange)
568
- return;
569
- const c = I({
570
- formState: o.formData,
571
- formData: e.formData,
572
- schemaPathToUpdatePathMap: s
573
- });
574
- e.onChange({ ...o, formData: c });
575
- }, l = (o, c) => {
576
- if (!e.onSubmit)
577
- return;
578
- const d = I({
579
- formState: o.formData,
580
- formData: e.formData,
581
- schemaPathToUpdatePathMap: s
582
- });
583
- e.onSubmit?.({ ...o, formData: d }, c);
584
- };
585
- return /* @__PURE__ */ n.jsx(
586
- Ae,
587
- {
588
- noHtml5Validate: !0,
589
- showErrorList: !1,
590
- autoComplete: "off",
591
- ...e,
592
- formData: a,
593
- ...r ? {
594
- onChange: i,
595
- onSubmit: l
596
- } : {},
597
- className: `rjsf-form-template__container ${e.className || ""}`,
598
- validator: Re,
599
- templates: {
600
- ...Ee,
601
- ...e.templates
602
- },
603
- formContext: a,
604
- widgets: { ...Pe, ...e.widgets },
605
- translateString: _e,
606
- ref: t
607
- }
608
- );
609
- });
610
- export {
611
- Je as H,
612
- Ye as R,
613
- Ke as a,
614
- be as b,
615
- b as c,
616
- qe as g
617
- };