@devtron-labs/devtron-fe-common-lib 1.8.1 → 1.8.2-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.
@@ -0,0 +1,617 @@
1
+ import { j as n, J as y, e as k, b as W } from "./@vendor-CIA81cZg.js";
2
+ import J, { forwardRef as V, 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-hufLMePq.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", Ve = {
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(J.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
+ }, g = (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
+ }, be = (e) => {
268
+ if (!e)
269
+ return null;
270
+ const t = structuredClone(e);
271
+ return typeof t == "string" ? {
272
+ value: !0,
273
+ path: g(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: g(t.value)
277
+ } : Object.hasOwn(t, "value") && "value" in t && Object.hasOwn(t, "path") && "path" in t ? {
278
+ value: t.value,
279
+ path: g(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] = g(e.updatePath ?? t)));
285
+ }, ge = (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 = be(h);
375
+ if (!m.path)
376
+ throw new Error("Empty path property of hidden descriptor field");
377
+ const b = y({
378
+ path: v(m.path),
379
+ json: u,
380
+ resultType: "value",
381
+ wrap: !1
382
+ });
383
+ return !(b === void 0 || ae(m.value, b));
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((b) => E(b, 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 = V((e, t) => {
560
+ const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } = P(() => {
561
+ const o = ge(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
+ Ve as H,
612
+ Ye as R,
613
+ Ke as a,
614
+ ge as b,
615
+ g as c,
616
+ qe as g
617
+ };
@@ -118,6 +118,7 @@ export declare const ROUTES: {
118
118
  CD_TRIGGER_POST: string;
119
119
  DELETE_RESOURCE: string;
120
120
  NODE_CAPACITY: string;
121
+ ENVIRONMENT_DATA: string;
121
122
  };
122
123
  export declare enum KEY_VALUE {
123
124
  KEY = "key",
@@ -1,6 +1,6 @@
1
1
  import { ShortcutType } from './types';
2
2
  export declare const preprocessKeys: (keys: ShortcutType["keys"]) => {
3
- keys: ("Alt" | "F" | "E" | "R" | "K" | "Control" | "Shift" | "Meta" | "Escape" | "Enter")[];
3
+ keys: ("Escape" | "Control" | "Alt" | "F" | "E" | "R" | "K" | "Shift" | "Meta" | "Enter")[];
4
4
  id: string;
5
5
  };
6
6
  export declare const verifyCallbackStack: (stack: ShortcutType["callbackStack"]) => void;
@@ -1,3 +1,3 @@
1
1
  import { default as RJSF } from '@rjsf/core';
2
2
  import { FormProps } from './types';
3
- export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "target" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "action" | "method" | "autoComplete" | "tagName" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
3
+ export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "className" | "children" | "disabled" | "id" | "name" | "target" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "autoComplete" | "noValidate" | "tagName" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "action" | "enctype" | "method" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<any, import('./types').RJSFFormSchema, any>>>;
@@ -1,4 +1,4 @@
1
1
  export { RJSFForm } from './Form';
2
2
  export type * from './types';
3
- export { getInferredTypeFromValueType, getRedirectionProps } from './utils';
3
+ export { getInferredTypeFromValueType, getRedirectionProps, getSchemaPathToUpdatePathMap, conformPathToPointers, } from './utils';
4
4
  export { HIDE_SUBMIT_BUTTON_UI_SCHEMA } from './constants';
@@ -1,7 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { default as RJSFForm } from '@rjsf/core';
3
3
  import { StrictRJSFSchema } from '@rjsf/utils';
4
- export type FormProps = Omit<ComponentProps<typeof RJSFForm>, 'validator'>;
5
4
  export interface MetaHiddenType {
6
5
  value: any;
7
6
  path: string;
@@ -11,8 +10,23 @@ export type HiddenType = MetaHiddenType | {
11
10
  value: string;
12
11
  } | string;
13
12
  export interface RJSFFormSchema extends StrictRJSFSchema {
14
- properties: {
13
+ properties?: {
15
14
  [key: string]: RJSFFormSchema;
16
15
  };
17
- hidden: HiddenType;
16
+ hidden?: HiddenType;
17
+ updatePath?: string;
18
+ }
19
+ export type FormProps = Omit<ComponentProps<typeof RJSFForm<any, RJSFFormSchema>>, 'validator'>;
20
+ export interface UpdateFormDataFromFormStateProps {
21
+ /**
22
+ * formData is data that is being passed from the user
23
+ */
24
+ formData: Record<string, unknown>;
25
+ /**
26
+ * formState is the latest state of the form
27
+ */
28
+ formState: Record<string, unknown>;
29
+ schemaPathToUpdatePathMap: Record<string, string>;
30
+ }
31
+ export interface GetFormStateFromFormDataProps extends Pick<UpdateFormDataFromFormStateProps, 'formData' | 'schemaPathToUpdatePathMap'> {
18
32
  }
@@ -1,5 +1,5 @@
1
1
  import { TranslatableString } from '@rjsf/utils';
2
- import { HiddenType, MetaHiddenType } from './types';
2
+ import { GetFormStateFromFormDataProps, HiddenType, MetaHiddenType, RJSFFormSchema, UpdateFormDataFromFormStateProps } from './types';
3
3
  /**
4
4
  * Override for the TranslatableString from RJSF
5
5
  */
@@ -14,4 +14,8 @@ export declare const getRedirectionProps: (url: string) => React.AnchorHTMLAttri
14
14
  * Infers the type for json schema from value type
15
15
  */
16
16
  export declare const getInferredTypeFromValueType: (value: any) => "string" | "number" | "boolean" | "object" | "array" | "null";
17
+ export declare const conformPathToPointers: (path: string) => string;
17
18
  export declare const parseSchemaHiddenType: (hiddenSchema: HiddenType) => MetaHiddenType;
19
+ export declare const getSchemaPathToUpdatePathMap: (schema: RJSFFormSchema) => Record<string, string>;
20
+ export declare const updateFormDataFromFormState: ({ formState, formData, schemaPathToUpdatePathMap, }: UpdateFormDataFromFormStateProps) => Record<string, unknown>;
21
+ export declare const getFormStateFromFormData: ({ formData, schemaPathToUpdatePathMap }: GetFormStateFromFormDataProps) => {};