@devtron-labs/devtron-fe-common-lib 1.17.0 → 1.18.0-pre-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/{@code-editor-IalENjkh.js → @code-editor-BDktoNH9.js} +11049 -10196
  2. package/dist/@common-rjsf-B-rBhlAg.js +598 -0
  3. package/dist/{@framer-motion-j6RIjEIR.js → @framer-motion-BcOlP2tv.js} +1 -1
  4. package/dist/{@react-dates-BVyHiOGU.js → @react-dates-BkJF0N9I.js} +213 -213
  5. package/dist/{@react-select-BQNFZu0Y.js → @react-select-Dw-yFFvz.js} +1 -1
  6. package/dist/{@react-virtualized-sticky-tree-CuElh0mS.js → @react-virtualized-sticky-tree-YTxUTwpg.js} +1 -1
  7. package/dist/{@vendor-DbxoIktR.js → @vendor-Dkf3d5cm.js} +17434 -14725
  8. package/dist/Common/API/CoreAPI.d.ts +11 -0
  9. package/dist/Common/API/QueryClientProvider.d.ts +2 -0
  10. package/dist/Common/API/index.d.ts +2 -0
  11. package/dist/Common/API/reactQueryHooks.d.ts +6 -0
  12. package/dist/Common/Drawer/Drawer.d.ts +3 -2
  13. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  14. package/dist/Common/Hooks/UseIsTextTruncated/UseIsTextTruncated.d.ts +5 -0
  15. package/dist/Common/Hooks/UseIsTextTruncated/constants.d.ts +1 -0
  16. package/dist/Common/Hooks/UseIsTextTruncated/index.d.ts +1 -0
  17. package/dist/Common/Hooks/index.d.ts +1 -0
  18. package/dist/Common/Modals/Modal.d.ts +1 -2
  19. package/dist/Common/Modals/VisibleModal.d.ts +6 -8
  20. package/dist/Common/Modals/VisibleModal2.d.ts +4 -7
  21. package/dist/Common/RJSF/Form.d.ts +1 -1
  22. package/dist/Common/RJSF/constants.d.ts +1 -0
  23. package/dist/Common/RJSF/utils.d.ts +1 -1
  24. package/dist/Common/Tooltip/constants.d.ts +0 -1
  25. package/dist/Common/Types.d.ts +2 -0
  26. package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +0 -1
  27. package/dist/Shared/Components/ActionMenu/types.d.ts +2 -33
  28. package/dist/Shared/Components/Backdrop/Backdrop.d.ts +1 -1
  29. package/dist/Shared/Components/Backdrop/types.d.ts +2 -10
  30. package/dist/Shared/Components/Button/Button.component.d.ts +24 -12
  31. package/dist/Shared/Components/Button/types.d.ts +4 -0
  32. package/dist/Shared/Components/CollapsibleList/CollapsibleList.component.d.ts +3 -0
  33. package/dist/Shared/Components/ContextSwitcher/ContextSwitcher.d.ts +2 -0
  34. package/dist/Shared/Components/ContextSwitcher/index.d.ts +3 -0
  35. package/dist/Shared/Components/ContextSwitcher/types.d.ts +14 -0
  36. package/dist/Shared/Components/ContextSwitcher/utils.d.ts +5 -0
  37. package/dist/Shared/Components/DTFocusTrap/DTFocusTrap.d.ts +3 -0
  38. package/dist/Shared/Components/DTFocusTrap/index.d.ts +2 -0
  39. package/dist/Shared/Components/DTFocusTrap/types.d.ts +33 -0
  40. package/dist/Shared/Components/DocLink/types.d.ts +4 -0
  41. package/dist/Shared/Components/DocLink/utils.d.ts +2 -1
  42. package/dist/Shared/Components/Header/PageHeader.d.ts +1 -1
  43. package/dist/Shared/Components/Header/types.d.ts +2 -0
  44. package/dist/Shared/Components/Icon/Icon.d.ts +5 -0
  45. package/dist/Shared/Components/Illustration/Illustration.d.ts +15 -0
  46. package/dist/Shared/Components/Illustration/IllustrationBase.d.ts +2 -0
  47. package/dist/Shared/Components/Illustration/index.d.ts +1 -0
  48. package/dist/Shared/Components/Illustration/types.d.ts +27 -0
  49. package/dist/Shared/Components/Popover/types.d.ts +4 -0
  50. package/dist/Shared/Components/Popover/usePopover.hook.d.ts +1 -1
  51. package/dist/Shared/Components/Popover/utils.d.ts +1 -1
  52. package/dist/Shared/Components/PortalContainer/PortalContainer.d.ts +5 -0
  53. package/dist/Shared/Components/PortalContainer/index.d.ts +1 -0
  54. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +6 -3
  55. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -1
  56. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +2 -2
  57. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +0 -6
  58. package/dist/Shared/Components/Security/types.d.ts +5 -1
  59. package/dist/Shared/Components/SelectPicker/GroupedFilterSelectPicker.d.ts +2 -0
  60. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  61. package/dist/Shared/Components/SelectPicker/index.d.ts +1 -0
  62. package/dist/Shared/Components/SelectPicker/type.d.ts +7 -2
  63. package/dist/Shared/Components/Table/InternalTable.d.ts +2 -2
  64. package/dist/Shared/Components/Table/Table.component.d.ts +2 -2
  65. package/dist/Shared/Components/Table/TableContent.d.ts +2 -2
  66. package/dist/Shared/Components/Table/index.d.ts +1 -1
  67. package/dist/Shared/Components/Table/types.d.ts +56 -67
  68. package/dist/Shared/Components/Table/useTableWithKeyboardShortcuts.d.ts +2 -2
  69. package/dist/Shared/Components/Table/utils.d.ts +6 -6
  70. package/dist/Shared/Components/TempAppWindow/TempAppWindow.d.ts +1 -0
  71. package/dist/Shared/Components/TempAppWindow/index.d.ts +1 -0
  72. package/dist/Shared/Components/TrailingItem/TrailingItem.component.d.ts +3 -0
  73. package/dist/Shared/Components/TrailingItem/index.d.ts +2 -0
  74. package/dist/Shared/Components/TrailingItem/types.d.ts +39 -0
  75. package/dist/Shared/Components/TreeView/TreeView.component.d.ts +3 -0
  76. package/dist/Shared/Components/TreeView/TreeViewNodeContent.d.ts +3 -0
  77. package/dist/Shared/Components/TreeView/constants.d.ts +4 -0
  78. package/dist/Shared/Components/TreeView/index.d.ts +2 -0
  79. package/dist/Shared/Components/TreeView/types.d.ts +204 -0
  80. package/dist/Shared/Components/TreeView/utils.d.ts +22 -0
  81. package/dist/Shared/Components/UserIdentifier/UserIdentifier.d.ts +1 -1
  82. package/dist/Shared/Components/UserIdentifier/types.d.ts +5 -0
  83. package/dist/Shared/Components/index.d.ts +5 -0
  84. package/dist/Shared/Helpers.d.ts +2 -2
  85. package/dist/Shared/Hooks/index.d.ts +1 -0
  86. package/dist/Shared/Hooks/useIsSecureConnection/index.d.ts +1 -0
  87. package/dist/Shared/Hooks/useIsSecureConnection/useIsSecureConnection.d.ts +1 -0
  88. package/dist/Shared/Hooks/useUserPreferences/constants.d.ts +2 -0
  89. package/dist/Shared/Hooks/useUserPreferences/index.d.ts +1 -1
  90. package/dist/Shared/Hooks/useUserPreferences/service.d.ts +22 -2
  91. package/dist/Shared/Hooks/useUserPreferences/types.d.ts +24 -11
  92. package/dist/Shared/Hooks/useUserPreferences/useUserPrefrences.d.ts +5 -3
  93. package/dist/Shared/Hooks/useUserPreferences/utils.d.ts +3 -4
  94. package/dist/Shared/Providers/MainContextProvider/index.d.ts +1 -1
  95. package/dist/Shared/Providers/MainContextProvider/types.d.ts +18 -0
  96. package/dist/Shared/types.d.ts +0 -8
  97. package/dist/assets/@code-editor.css +1 -1
  98. package/dist/assets/@common-rjsf.css +1 -1
  99. package/dist/assets/ic-activity.abf111c7.svg +3 -0
  100. package/dist/assets/ic-folder.8038c019.svg +3 -0
  101. package/dist/assets/ic-helm-app.a20cfeb3.svg +4 -0
  102. package/dist/assets/ic-list-bullets.91aab240.svg +4 -0
  103. package/dist/assets/ic-namespace.8980221f.svg +3 -0
  104. package/dist/assets/img-code.fa00ae8e.webp +0 -0
  105. package/dist/assets/img-man-on-rocket.ab6bef97.webp +0 -0
  106. package/dist/assets/img-no-result.51284acb.webp +0 -0
  107. package/dist/index.d.ts +22 -0
  108. package/dist/index.js +811 -792
  109. package/package.json +7 -3
  110. package/dist/@common-rjsf-ChkYseh5.js +0 -609
  111. package/dist/assets/empty-noresult@2x.022ec87c.png +0 -0
  112. package/dist/assets/ic-errorInfo.d8d674b8.svg +0 -23
@@ -0,0 +1,598 @@
1
+ import { j as n, au as y, aw as k, av as M } from "./@vendor-Dkf3d5cm.js";
2
+ import W, { forwardRef as J, useMemo as P } from "react";
3
+ import V, { getDefaultRegistry as K } from "@rjsf/core";
4
+ import { T as N, j as w, c as v, b as F, S as q, i as Y, a as G, d as C, e as z } from "./@code-editor-BDktoNH9.js";
5
+ import { getUiOptions as I, getTemplate as D, getSubmitButtonOptions as Q, ADDITIONAL_PROPERTY_FLAG as B, errorId as X, englishStringTranslator as Z, TranslatableString as ee, titleId as te, canExpand as ne, deepEquals as re } from "@rjsf/utils";
6
+ import { ReactComponent as se } from "./assets/ic-add.cfaa779b.svg";
7
+ import { ReactComponent as ae } from "./assets/ic-warning.ecf7ff97.svg";
8
+ import { ReactComponent as oe } from "./assets/ic-cross.01e03666.svg";
9
+ import './assets/@common-rjsf.css';const S = {
10
+ SELECT: "Please select an option",
11
+ INPUT: "Please enter an input",
12
+ OBJECT_KEY: "Please enter a value for the key"
13
+ }, le = "Key not available", Ue = {
14
+ "ui:submitButtonOptions": {
15
+ norender: !0
16
+ }
17
+ }, $ = "rjsf-form-select-portal-target", ie = ({
18
+ children: e,
19
+ disabled: t,
20
+ hasToolbar: s,
21
+ hasRemove: r,
22
+ index: a,
23
+ onDropIndexClick: i,
24
+ readonly: l,
25
+ registry: o,
26
+ uiSchema: c
27
+ }) => {
28
+ const { RemoveButton: d } = o.templates.ButtonTemplates;
29
+ return /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel display-grid rjsf-form-template__array-field-item flex-align-center", children: [
30
+ e,
31
+ /* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: s && r && /* @__PURE__ */ n.jsx(
32
+ d,
33
+ {
34
+ disabled: t || l,
35
+ onClick: i(a),
36
+ uiSchema: c,
37
+ registry: o
38
+ }
39
+ ) })
40
+ ] });
41
+ }, T = ({
42
+ showLabel: e,
43
+ label: t,
44
+ required: s,
45
+ children: r,
46
+ id: a,
47
+ rawDescription: i,
48
+ shouldAlignCenter: l = !0
49
+ }) => /* @__PURE__ */ n.jsxs(
50
+ "div",
51
+ {
52
+ className: e ? `display-grid dc__gap-12 rjsf-form-template__field ${l ? "" : "rjsf-form-template__field--align-top"}` : "",
53
+ children: [
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 || le }) }),
56
+ s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
57
+ ] }),
58
+ r
59
+ ]
60
+ }
61
+ ), E = ({ label: e, canAdd: t, onAddClick: s, disabled: r, readonly: a, uiSchema: i, registry: l }) => {
62
+ const {
63
+ ButtonTemplates: { AddButton: o }
64
+ } = l.templates;
65
+ return t && /* @__PURE__ */ n.jsx(
66
+ o,
67
+ {
68
+ label: e,
69
+ onClick: s,
70
+ disabled: r || a,
71
+ uiSchema: i,
72
+ registry: l
73
+ }
74
+ );
75
+ }, ce = ({
76
+ canAdd: e,
77
+ className: t,
78
+ disabled: s,
79
+ idSchema: r,
80
+ uiSchema: a,
81
+ items: i,
82
+ onAddClick: l,
83
+ readonly: o,
84
+ registry: c,
85
+ required: d,
86
+ title: x
87
+ }) => {
88
+ const u = I(a), f = D("ArrayFieldItemTemplate", c, u), m = u.title || x;
89
+ return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: r.$id, children: i.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
90
+ i.map(({ key: j, ...h }, _) => {
91
+ const p = {
92
+ ...h.children,
93
+ props: {
94
+ ...h.children.props
95
+ }
96
+ };
97
+ return /* @__PURE__ */ n.jsx(f, { ...h, children: p }, j);
98
+ }),
99
+ /* @__PURE__ */ n.jsx(
100
+ E,
101
+ {
102
+ label: m,
103
+ canAdd: e,
104
+ onAddClick: l,
105
+ disabled: s,
106
+ readonly: o,
107
+ uiSchema: a,
108
+ registry: c
109
+ }
110
+ )
111
+ ] }) : /* @__PURE__ */ n.jsx(T, { label: m, required: d, showLabel: !0, id: r.$id, children: /* @__PURE__ */ n.jsx(
112
+ E,
113
+ {
114
+ label: m,
115
+ canAdd: e,
116
+ onAddClick: l,
117
+ disabled: s,
118
+ readonly: o,
119
+ uiSchema: a,
120
+ registry: c
121
+ }
122
+ ) }) });
123
+ }, {
124
+ templates: { BaseInputTemplate: de }
125
+ } = K(), ue = ({ placeholder: e, ...t }) => {
126
+ const { schema: s } = t;
127
+ return /* @__PURE__ */ n.jsx(
128
+ de,
129
+ {
130
+ placeholder: s.placeholder || e || S.INPUT,
131
+ ...t,
132
+ className: "form__input cn-9 fs-13 lh-20 fw-4"
133
+ }
134
+ );
135
+ }, L = ({
136
+ label: e,
137
+ icon: t,
138
+ iconType: s,
139
+ registry: r,
140
+ uiSchema: a,
141
+ ...i
142
+ }) => {
143
+ const l = `Add ${e}`;
144
+ return /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-start", children: /* @__PURE__ */ n.jsxs(
145
+ "button",
146
+ {
147
+ ...i,
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__ */ n.jsx(se, { className: "icon-dim-16 fcb-5" }),
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
+ ]
155
+ }
156
+ ) });
157
+ }, me = ({ 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(oe, { className: "icon-dim-16 fcn-6" }) }), pe = ({ uiSchema: e }) => {
158
+ const { submitText: t, norender: s, props: r = {} } = Q(e);
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
+ }, O = ({
161
+ id: e,
162
+ title: t,
163
+ required: s,
164
+ description: r
165
+ }) => /* @__PURE__ */ n.jsxs("legend", { className: "fs-13 fw-6 cn-9 lh-20 dc__no-border pb-9 mb-0", id: e, children: [
166
+ /* @__PURE__ */ n.jsx(N, { alwaysShowTippyOnHover: !!r, content: r, children: /* @__PURE__ */ n.jsx("span", { className: `${r ? "dc__underline-dotted" : ""}`, children: t }) }),
167
+ s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
168
+ ] }), fe = (e) => {
169
+ const {
170
+ id: t,
171
+ label: s,
172
+ children: r,
173
+ errors: a,
174
+ hidden: i,
175
+ required: l,
176
+ displayLabel: o,
177
+ registry: c,
178
+ uiSchema: d,
179
+ classNames: x,
180
+ schema: u,
181
+ rawDescription: f
182
+ } = e, m = I(d), j = D(
183
+ "WrapIfAdditionalTemplate",
184
+ c,
185
+ m
186
+ ), h = B in u, _ = (o || u.type === "boolean") && !h, p = u.type === "array";
187
+ return i ? /* @__PURE__ */ n.jsx("div", { className: "hidden", children: r }) : (
188
+ // NOTE: need to override the margins of default rjsf css
189
+ /* @__PURE__ */ n.jsxs("div", { className: `${x} mb-0`, children: [
190
+ p && /* @__PURE__ */ n.jsx(
191
+ O,
192
+ {
193
+ id: t,
194
+ title: s,
195
+ required: l,
196
+ registry: c,
197
+ uiSchema: d,
198
+ schema: u,
199
+ description: f
200
+ }
201
+ ),
202
+ /* @__PURE__ */ n.jsx(
203
+ T,
204
+ {
205
+ label: s,
206
+ showLabel: _,
207
+ id: t,
208
+ required: l,
209
+ rawDescription: f,
210
+ children: /* @__PURE__ */ n.jsx(j, { ...e, children: r })
211
+ }
212
+ ),
213
+ a
214
+ ] })
215
+ );
216
+ }, he = ({ errors: e = [], idSchema: t }) => {
217
+ const s = X(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(W.Fragment, { children: [
219
+ /* @__PURE__ */ n.jsx("span", {}),
220
+ /* @__PURE__ */ n.jsxs("span", { className: "form__error", children: [
221
+ /* @__PURE__ */ n.jsx(ae, { className: "form__icon form__icon--error" }),
222
+ r
223
+ ] })
224
+ ] }, a)) });
225
+ }, _e = (e, t) => {
226
+ switch (e) {
227
+ case ee.NewStringDefault:
228
+ return "";
229
+ default:
230
+ return Z(e, t);
231
+ }
232
+ }, He = (e) => {
233
+ try {
234
+ const t = new URL(e).origin === window.location.origin;
235
+ return {
236
+ href: e,
237
+ target: t ? "_self" : "_blank",
238
+ rel: t ? void 0 : "external noreferrer",
239
+ url: e
240
+ };
241
+ } catch {
242
+ return {
243
+ href: e,
244
+ target: "_blank",
245
+ url: `${e} (Invalid URL)`
246
+ };
247
+ }
248
+ }, ke = (e) => {
249
+ const t = typeof e;
250
+ switch (t) {
251
+ case "boolean":
252
+ case "string":
253
+ case "number":
254
+ return t;
255
+ case "object":
256
+ return Array.isArray(e) ? "array" : e === null ? "null" : t;
257
+ default:
258
+ return "null";
259
+ }
260
+ }, b = (e) => {
261
+ if (!e)
262
+ return "";
263
+ const t = e.trim(), r = (/^\/.+$/g.test(t) ? t : `/${t}`).replaceAll(/\./g, "/");
264
+ return /(\/(([^/~])|(~[01]))*)/g.test(r) ? r : "";
265
+ }, R = {
266
+ value: !1,
267
+ path: ""
268
+ }, xe = (e) => {
269
+ if (!e)
270
+ return null;
271
+ const t = structuredClone(e);
272
+ return typeof t == "string" ? {
273
+ value: !0,
274
+ path: b(t)
275
+ } : typeof t != "object" ? structuredClone(R) : Object.hasOwn(t, "condition") && "condition" in t && Object.hasOwn(t, "value") && "value" in t ? {
276
+ value: t.condition,
277
+ path: b(t.value)
278
+ } : Object.hasOwn(t, "value") && "value" in t && Object.hasOwn(t, "path") && "path" in t ? {
279
+ value: t.value,
280
+ path: b(t.path)
281
+ } : structuredClone(R);
282
+ }, U = (e, t, s) => {
283
+ e && (e.type === "object" && e.properties && typeof e.properties == "object" && Object.entries(e.properties).forEach(([r, a]) => {
284
+ U(a, `${t}/${r}`, s);
285
+ }), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (s[t] = b(e.updatePath ?? t)));
286
+ }, je = (e) => {
287
+ const t = {};
288
+ return U(e, "", t), t;
289
+ }, H = (e, t, s) => {
290
+ if (t >= s.length)
291
+ return e;
292
+ const r = s[t];
293
+ if (t === s.length - 1) {
294
+ const a = structuredClone(e);
295
+ return delete a[r], a;
296
+ }
297
+ if (e[r] && (e[r] = H(e[r], t + 1, s)), Object.keys(e[r] ?? {}).length === 0) {
298
+ const a = structuredClone(e);
299
+ return delete a[r], a;
300
+ }
301
+ return e;
302
+ }, ge = (e, t) => {
303
+ if (!e || typeof e != "object" || Array.isArray(e))
304
+ throw new Error("Invalid object");
305
+ if (!t || !t.startsWith("/"))
306
+ throw new Error("Invalid path");
307
+ const s = t.split("/").slice(1);
308
+ return H(e, 0, s);
309
+ }, A = ({
310
+ formState: e,
311
+ formData: t,
312
+ schemaPathToUpdatePathMap: s
313
+ }) => {
314
+ let r = structuredClone(e);
315
+ return r && (Object.entries(s).forEach(([a, i]) => {
316
+ if (a === i || !i)
317
+ return;
318
+ const l = y({
319
+ json: t,
320
+ path: v(a),
321
+ resultType: "value",
322
+ wrap: !1
323
+ });
324
+ l === void 0 ? r = ge(r, a) : r = w([F(a, l), r]);
325
+ const o = y({
326
+ json: e,
327
+ path: v(a),
328
+ resultType: "value",
329
+ wrap: !1
330
+ });
331
+ o !== void 0 && (r = w([F(i, o), r]));
332
+ }), t && r ? k(t, M(t, r), !1, !1).newDocument : r);
333
+ }, be = ({ formData: e, schemaPathToUpdatePathMap: t }) => w([
334
+ ...Object.entries(t).map(([s, r]) => {
335
+ if (s === r || !r)
336
+ return {};
337
+ const a = y({
338
+ json: e,
339
+ path: v(r),
340
+ resultType: "value",
341
+ wrap: !1
342
+ });
343
+ return a === void 0 ? {} : F(s, a);
344
+ }),
345
+ structuredClone(e)
346
+ ]), ye = ({
347
+ disabled: e,
348
+ formData: t,
349
+ idSchema: s,
350
+ onAddClick: r,
351
+ properties: a,
352
+ readonly: i,
353
+ registry: l,
354
+ required: o,
355
+ schema: c,
356
+ title: d,
357
+ uiSchema: x,
358
+ formContext: u
359
+ }) => {
360
+ const f = !!c.additionalProperties, m = ne(c, x, t) && /* @__PURE__ */ n.jsx(
361
+ L,
362
+ {
363
+ label: d,
364
+ className: "object-property-expand",
365
+ onClick: r(c),
366
+ disabled: e || i,
367
+ uiSchema: x,
368
+ registry: l
369
+ }
370
+ ), j = a.filter((h) => {
371
+ const _ = c.properties?.[h.name]?.hidden;
372
+ if (!_)
373
+ return !0;
374
+ try {
375
+ const p = xe(_);
376
+ if (!p.path)
377
+ throw new Error("Empty path property of hidden descriptor field");
378
+ const g = y({
379
+ path: v(p.path),
380
+ json: u,
381
+ resultType: "value",
382
+ wrap: !1
383
+ });
384
+ return !(g === void 0 || re(p.value, g));
385
+ } catch {
386
+ return !0;
387
+ }
388
+ }).map((h) => h.content);
389
+ return f ? a.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
390
+ /* @__PURE__ */ n.jsx(
391
+ T,
392
+ {
393
+ label: d,
394
+ required: o,
395
+ showLabel: !0,
396
+ id: s.$id,
397
+ shouldAlignCenter: !1,
398
+ children: /* @__PURE__ */ n.jsx("div", { children: j })
399
+ }
400
+ ),
401
+ m
402
+ ] }) : /* @__PURE__ */ n.jsx(T, { label: d, required: o, showLabel: !0, id: s.$id, children: m }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
403
+ j,
404
+ m
405
+ ] });
406
+ }, ve = (e) => {
407
+ const { idSchema: t, registry: s, required: r, schema: a, title: i, uiSchema: l, description: o } = e, c = !!a.additionalProperties, d = i && !c;
408
+ return /* @__PURE__ */ n.jsxs("fieldset", { id: t.$id, children: [
409
+ d && /* @__PURE__ */ n.jsx(
410
+ O,
411
+ {
412
+ id: te(t),
413
+ title: i,
414
+ required: r,
415
+ schema: a,
416
+ uiSchema: l,
417
+ registry: s,
418
+ description: o
419
+ }
420
+ ),
421
+ /* @__PURE__ */ n.jsx(
422
+ "div",
423
+ {
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(ye, { ...e })
426
+ }
427
+ )
428
+ ] });
429
+ }, Te = ({
430
+ id: e,
431
+ disabled: t,
432
+ label: s,
433
+ onKeyChange: r,
434
+ onDropPropertyClick: a,
435
+ readonly: i,
436
+ schema: l,
437
+ children: o,
438
+ uiSchema: c,
439
+ registry: d
440
+ }) => {
441
+ const { templates: x } = d, { RemoveButton: u } = x.ButtonTemplates, f = B in l;
442
+ 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: [
443
+ /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(
444
+ "input",
445
+ {
446
+ type: "text",
447
+ className: "form__input cn-9 fs-13 lh-20 fw-4",
448
+ id: `${e}-key`,
449
+ onBlur: (m) => r(m.target.value),
450
+ placeholder: S.OBJECT_KEY,
451
+ defaultValue: s
452
+ }
453
+ ) }),
454
+ /* @__PURE__ */ n.jsx("div", { children: o }),
455
+ /* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: /* @__PURE__ */ n.jsx(
456
+ u,
457
+ {
458
+ disabled: t || i,
459
+ onClick: a(s),
460
+ uiSchema: c,
461
+ registry: d
462
+ }
463
+ ) })
464
+ ] }) : o });
465
+ }, we = ({
466
+ id: e,
467
+ onChange: t,
468
+ value: s,
469
+ disabled: r,
470
+ readonly: a,
471
+ autofocus: i
472
+ }) => {
473
+ const l = Y(s) ? !1 : s, o = () => {
474
+ t(!l);
475
+ };
476
+ return /* @__PURE__ */ n.jsxs("div", { className: "flexbox dc__align-items-center dc__gap-8", children: [
477
+ /* @__PURE__ */ n.jsx(
478
+ q,
479
+ {
480
+ name: e,
481
+ ariaLabel: e,
482
+ onChange: o,
483
+ isChecked: l,
484
+ autoFocus: i,
485
+ isDisabled: r || a
486
+ }
487
+ ),
488
+ /* @__PURE__ */ n.jsx("span", { className: "dc__capitalize", children: l.toString() })
489
+ ] });
490
+ }, Fe = (e) => {
491
+ const {
492
+ id: t,
493
+ multiple: s = !1,
494
+ options: r,
495
+ value: a,
496
+ disabled: i,
497
+ readonly: l,
498
+ autofocus: o = !1,
499
+ onChange: c,
500
+ onBlur: d,
501
+ onFocus: x,
502
+ placeholder: u
503
+ } = e, { enumOptions: f = [] } = r, m = s ? [] : null, j = (_) => {
504
+ c(s ? _.map((p) => p.value) : _.value);
505
+ }, h = (_) => s ? f.filter((p) => _.some((g) => C(g, p.value))) : f.find((p) => C(_, p.value));
506
+ return /* @__PURE__ */ n.jsx(
507
+ G,
508
+ {
509
+ inputId: `devtron-rjsf-select__${t}`,
510
+ name: t,
511
+ isMulti: s,
512
+ value: typeof a > "u" ? m : h(a),
513
+ autoFocus: o,
514
+ onChange: j,
515
+ options: f,
516
+ onBlur: () => d(t, a),
517
+ onFocus: () => x(t, a),
518
+ placeholder: u || S.SELECT,
519
+ isDisabled: i || l,
520
+ menuPortalTarget: document.getElementById($),
521
+ menuPosition: "fixed"
522
+ }
523
+ );
524
+ }, Ne = {
525
+ CheckboxWidget: we,
526
+ SelectWidget: Fe
527
+ }, Se = {
528
+ ArrayFieldItemTemplate: ie,
529
+ ArrayFieldTemplate: ce,
530
+ BaseInputTemplate: ue,
531
+ ButtonTemplates: { AddButton: L, RemoveButton: me, SubmitButton: pe },
532
+ FieldTemplate: fe,
533
+ FieldErrorTemplate: he,
534
+ ObjectFieldTemplate: ve,
535
+ TitleFieldTemplate: O,
536
+ WrapIfAdditionalTemplate: Te
537
+ }, Oe = V, Pe = z, Me = J((e, t) => {
538
+ const { schemaPathToUpdatePathMap: s, isUpdatePathKeywordPresent: r } = P(() => {
539
+ const o = je(e.schema);
540
+ return {
541
+ schemaPathToUpdatePathMap: o,
542
+ isUpdatePathKeywordPresent: Object.entries(o).some(([c, d]) => c !== d)
543
+ };
544
+ }, [e.schema]), a = P(() => r ? be({ formData: e.formData ?? {}, schemaPathToUpdatePathMap: s }) : e.formData, [e.formData, s, r]), i = (o) => {
545
+ if (!e.onChange)
546
+ return;
547
+ const c = A({
548
+ formState: o.formData,
549
+ formData: e.formData,
550
+ schemaPathToUpdatePathMap: s
551
+ });
552
+ e.onChange({ ...o, formData: c });
553
+ }, l = (o, c) => {
554
+ if (!e.onSubmit)
555
+ return;
556
+ const d = A({
557
+ formState: o.formData,
558
+ formData: e.formData,
559
+ schemaPathToUpdatePathMap: s
560
+ });
561
+ e.onSubmit?.({ ...o, formData: d }, c);
562
+ };
563
+ return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
564
+ /* @__PURE__ */ n.jsx(
565
+ Oe,
566
+ {
567
+ noHtml5Validate: !0,
568
+ showErrorList: !1,
569
+ autoComplete: "off",
570
+ ...e,
571
+ formData: a,
572
+ ...r ? {
573
+ onChange: i,
574
+ onSubmit: l
575
+ } : {},
576
+ className: `rjsf-form-template__container ${e.className || ""}`,
577
+ validator: Pe,
578
+ templates: {
579
+ ...Se,
580
+ ...e.templates
581
+ },
582
+ formContext: a,
583
+ widgets: { ...Ne, ...e.widgets },
584
+ translateString: _e,
585
+ ref: t
586
+ }
587
+ ),
588
+ /* @__PURE__ */ n.jsx("div", { id: $ })
589
+ ] });
590
+ });
591
+ export {
592
+ Ue as H,
593
+ Me as R,
594
+ He as a,
595
+ je as b,
596
+ b as c,
597
+ ke as g
598
+ };
@@ -1,4 +1,4 @@
1
- import { ay as m, az as lt, aA as R, aB as Zr, aC as Le, aD as oe, aE as T, aF as $e, aG as at, aH as Gt, aI as Q, aJ as $r, aK as oi, aL as si, aM as ui, aN as li, aO as fi, aP as ci, aQ as vi, aR as di, aS as qr, aT as pi, aU as hi, aV as mi, aW as gi, aX as yi, aY as Jr, aZ as Pt, a_ as he, a$ as X, b0 as bi, b1 as Qr, b2 as z, b3 as tn, b4 as me, b5 as Z, b6 as Pi, b7 as Ot, b8 as Vi, b9 as Ti, ba as en, bb as Ft, bc as O, bd as ge, be as Si, bf as se, bg as xi, bh as Ci } from "./@vendor-DbxoIktR.js";
1
+ import { aF as m, aG as lt, aH as R, aI as Zr, aJ as Le, aK as oe, aL as T, aM as $e, aN as at, aO as Gt, aP as Q, aQ as $r, aR as oi, aS as si, aT as ui, aU as li, aV as fi, aW as ci, aX as vi, aY as di, aZ as qr, a_ as pi, a$ as hi, b0 as mi, b1 as gi, b2 as yi, b3 as Jr, b4 as Pt, b5 as he, b6 as X, b7 as bi, b8 as Qr, b9 as z, ba as tn, bb as me, bc as Z, bd as Pi, be as Ot, bf as Vi, bg as Ti, bh as en, bi as Ft, bj as O, bk as ge, bl as Si, bm as se, bn as xi, bo as Ci } from "./@vendor-Dkf3d5cm.js";
2
2
  import * as Y from "react";
3
3
  import Re, { createContext as St, useContext as F, useLayoutEffect as Ai, useEffect as N, useState as Me, useRef as $, useCallback as ye, useMemo as Vt, forwardRef as wi, createElement as Ei, cloneElement as Li, Children as Ri, isValidElement as Mi } from "react";
4
4
  var qe = "production", De = typeof process > "u" || process.env === void 0 ? qe : process.env.NODE_ENV || qe, tt = function(t) {