@devtron-labs/devtron-fe-common-lib 1.17.1 → 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.
- package/dist/{@code-editor-CXQ0yUkc.js → @code-editor-BDktoNH9.js} +12111 -11264
- package/dist/@common-rjsf-B-rBhlAg.js +598 -0
- package/dist/{@framer-motion-j6RIjEIR.js → @framer-motion-BcOlP2tv.js} +1 -1
- package/dist/{@react-dates-BVyHiOGU.js → @react-dates-BkJF0N9I.js} +213 -213
- package/dist/{@react-select-BQNFZu0Y.js → @react-select-Dw-yFFvz.js} +1 -1
- package/dist/{@react-virtualized-sticky-tree-CuElh0mS.js → @react-virtualized-sticky-tree-YTxUTwpg.js} +1 -1
- package/dist/{@vendor-DbxoIktR.js → @vendor-Dkf3d5cm.js} +17434 -14725
- package/dist/Common/API/CoreAPI.d.ts +11 -0
- package/dist/Common/API/QueryClientProvider.d.ts +2 -0
- package/dist/Common/API/index.d.ts +2 -0
- package/dist/Common/API/reactQueryHooks.d.ts +6 -0
- package/dist/Common/Drawer/Drawer.d.ts +3 -2
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
- package/dist/Common/Hooks/UseIsTextTruncated/UseIsTextTruncated.d.ts +5 -0
- package/dist/Common/Hooks/UseIsTextTruncated/constants.d.ts +1 -0
- package/dist/Common/Hooks/UseIsTextTruncated/index.d.ts +1 -0
- package/dist/Common/Hooks/index.d.ts +1 -0
- package/dist/Common/Modals/Modal.d.ts +1 -2
- package/dist/Common/Modals/VisibleModal.d.ts +6 -8
- package/dist/Common/Modals/VisibleModal2.d.ts +4 -7
- package/dist/Common/RJSF/Form.d.ts +1 -1
- package/dist/Common/RJSF/constants.d.ts +1 -0
- package/dist/Common/RJSF/utils.d.ts +1 -1
- package/dist/Common/Tooltip/constants.d.ts +0 -1
- package/dist/Common/Types.d.ts +2 -0
- package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +0 -1
- package/dist/Shared/Components/ActionMenu/types.d.ts +2 -33
- package/dist/Shared/Components/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Shared/Components/Backdrop/types.d.ts +2 -10
- package/dist/Shared/Components/Button/Button.component.d.ts +24 -12
- package/dist/Shared/Components/Button/types.d.ts +4 -0
- package/dist/Shared/Components/CollapsibleList/CollapsibleList.component.d.ts +3 -0
- package/dist/Shared/Components/ContextSwitcher/ContextSwitcher.d.ts +2 -0
- package/dist/Shared/Components/ContextSwitcher/index.d.ts +3 -0
- package/dist/Shared/Components/ContextSwitcher/types.d.ts +14 -0
- package/dist/Shared/Components/ContextSwitcher/utils.d.ts +5 -0
- package/dist/Shared/Components/DTFocusTrap/DTFocusTrap.d.ts +3 -0
- package/dist/Shared/Components/DTFocusTrap/index.d.ts +2 -0
- package/dist/Shared/Components/DTFocusTrap/types.d.ts +33 -0
- package/dist/Shared/Components/DocLink/types.d.ts +4 -0
- package/dist/Shared/Components/DocLink/utils.d.ts +2 -1
- package/dist/Shared/Components/Header/PageHeader.d.ts +1 -1
- package/dist/Shared/Components/Header/types.d.ts +2 -0
- package/dist/Shared/Components/Icon/Icon.d.ts +5 -0
- package/dist/Shared/Components/Illustration/Illustration.d.ts +15 -0
- package/dist/Shared/Components/Illustration/IllustrationBase.d.ts +2 -0
- package/dist/Shared/Components/Illustration/index.d.ts +1 -0
- package/dist/Shared/Components/Illustration/types.d.ts +27 -0
- package/dist/Shared/Components/Popover/types.d.ts +4 -0
- package/dist/Shared/Components/Popover/usePopover.hook.d.ts +1 -1
- package/dist/Shared/Components/Popover/utils.d.ts +1 -1
- package/dist/Shared/Components/PortalContainer/PortalContainer.d.ts +5 -0
- package/dist/Shared/Components/PortalContainer/index.d.ts +1 -0
- package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +6 -3
- package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityModal/index.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +0 -6
- package/dist/Shared/Components/Security/types.d.ts +5 -1
- package/dist/Shared/Components/SelectPicker/GroupedFilterSelectPicker.d.ts +2 -0
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/index.d.ts +1 -0
- package/dist/Shared/Components/SelectPicker/type.d.ts +7 -2
- package/dist/Shared/Components/Table/InternalTable.d.ts +2 -2
- package/dist/Shared/Components/Table/Table.component.d.ts +2 -2
- package/dist/Shared/Components/Table/TableContent.d.ts +2 -2
- package/dist/Shared/Components/Table/index.d.ts +1 -1
- package/dist/Shared/Components/Table/types.d.ts +56 -67
- package/dist/Shared/Components/Table/useTableWithKeyboardShortcuts.d.ts +2 -2
- package/dist/Shared/Components/Table/utils.d.ts +6 -6
- package/dist/Shared/Components/TempAppWindow/TempAppWindow.d.ts +1 -0
- package/dist/Shared/Components/TempAppWindow/index.d.ts +1 -0
- package/dist/Shared/Components/TrailingItem/TrailingItem.component.d.ts +3 -0
- package/dist/Shared/Components/TrailingItem/index.d.ts +2 -0
- package/dist/Shared/Components/TrailingItem/types.d.ts +39 -0
- package/dist/Shared/Components/TreeView/TreeView.component.d.ts +3 -0
- package/dist/Shared/Components/TreeView/TreeViewNodeContent.d.ts +3 -0
- package/dist/Shared/Components/TreeView/constants.d.ts +4 -0
- package/dist/Shared/Components/TreeView/index.d.ts +2 -0
- package/dist/Shared/Components/TreeView/types.d.ts +204 -0
- package/dist/Shared/Components/TreeView/utils.d.ts +22 -0
- package/dist/Shared/Components/UserIdentifier/UserIdentifier.d.ts +1 -1
- package/dist/Shared/Components/UserIdentifier/types.d.ts +5 -0
- package/dist/Shared/Components/index.d.ts +5 -0
- package/dist/Shared/Helpers.d.ts +2 -2
- package/dist/Shared/Hooks/useUserPreferences/constants.d.ts +2 -0
- package/dist/Shared/Hooks/useUserPreferences/index.d.ts +1 -1
- package/dist/Shared/Hooks/useUserPreferences/service.d.ts +22 -2
- package/dist/Shared/Hooks/useUserPreferences/types.d.ts +24 -11
- package/dist/Shared/Hooks/useUserPreferences/useUserPrefrences.d.ts +5 -3
- package/dist/Shared/Hooks/useUserPreferences/utils.d.ts +3 -4
- package/dist/Shared/Providers/MainContextProvider/index.d.ts +1 -1
- package/dist/Shared/Providers/MainContextProvider/types.d.ts +18 -0
- package/dist/Shared/types.d.ts +0 -8
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/@common-rjsf.css +1 -1
- package/dist/assets/ic-activity.abf111c7.svg +3 -0
- package/dist/assets/ic-folder.8038c019.svg +3 -0
- package/dist/assets/ic-helm-app.a20cfeb3.svg +4 -0
- package/dist/assets/ic-list-bullets.91aab240.svg +4 -0
- package/dist/assets/ic-namespace.8980221f.svg +3 -0
- package/dist/assets/img-code.fa00ae8e.webp +0 -0
- package/dist/assets/img-man-on-rocket.ab6bef97.webp +0 -0
- package/dist/assets/img-no-result.51284acb.webp +0 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +811 -793
- package/package.json +7 -3
- package/dist/@common-rjsf-CDMxkHD5.js +0 -609
- package/dist/assets/empty-noresult@2x.022ec87c.png +0 -0
- package/dist/assets/ic-errorInfo.d8d674b8.svg +0 -23
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@devtron-labs/devtron-fe-common-lib",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.18.0-pre-0",
|
4
4
|
"description": "Supporting common component library",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.js",
|
@@ -33,12 +33,14 @@
|
|
33
33
|
"preview": "vite preview",
|
34
34
|
"lint-staged": "lint-staged",
|
35
35
|
"postinstall": "patch-package",
|
36
|
-
"generate-icon": "node ./scripts/generate-icon.cjs"
|
36
|
+
"generate-icon": "node ./scripts/generate-icon.cjs",
|
37
|
+
"generate-illustration": "node ./scripts/generate-illustration.cjs"
|
37
38
|
},
|
38
39
|
"devDependencies": {
|
39
40
|
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
|
40
41
|
"@laynezh/vite-plugin-lib-assets": "1.1.0",
|
41
42
|
"@sentry/browser": "^7.119.1",
|
43
|
+
"@tanstack/eslint-plugin-query": "<5",
|
42
44
|
"@testing-library/jest-dom": "^5.16.2",
|
43
45
|
"@testing-library/react": "^12.1.4",
|
44
46
|
"@tippyjs/react": "^4.2.0",
|
@@ -46,6 +48,7 @@
|
|
46
48
|
"@types/dompurify": "^3.0.5",
|
47
49
|
"@types/json-schema": "^7.0.15",
|
48
50
|
"@types/react": "17.0.39",
|
51
|
+
"@types/react-dates": "^21.8.6",
|
49
52
|
"@types/react-dom": "17.0.13",
|
50
53
|
"@types/react-router-dom": "^5.3.3",
|
51
54
|
"@typescript-eslint/eslint-plugin": "8.3.0",
|
@@ -106,7 +109,7 @@
|
|
106
109
|
"@lezer/highlight": "1.2.1",
|
107
110
|
"@replit/codemirror-indentation-markers": "6.5.3",
|
108
111
|
"@replit/codemirror-vscode-keymap": "6.0.2",
|
109
|
-
"@
|
112
|
+
"@tanstack/react-query": "<5",
|
110
113
|
"@uiw/codemirror-extensions-hyper-link": "4.23.10",
|
111
114
|
"@uiw/codemirror-theme-github": "4.23.7",
|
112
115
|
"@uiw/react-codemirror": "4.23.7",
|
@@ -115,6 +118,7 @@
|
|
115
118
|
"codemirror-json-schema": "0.8.0",
|
116
119
|
"dayjs": "^1.11.13",
|
117
120
|
"fast-json-patch": "^3.1.1",
|
121
|
+
"focus-trap-react": "^10.3.1",
|
118
122
|
"framer-motion": "^6.5.1",
|
119
123
|
"jsonpath-plus": "^10.3.0",
|
120
124
|
"marked": "^13.0.3",
|
@@ -1,609 +0,0 @@
|
|
1
|
-
import { j as n, at as b, av as k, au as W } from "./@vendor-DbxoIktR.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, S as Y, i as z, a as w, d as A, e as G } from "./@code-editor-CXQ0yUkc.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 $, getTemplate as B, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as ae, deepEquals as se } from "@rjsf/utils";
|
8
|
-
import { ReactComponent as oe } from "./assets/ic-add.cfaa779b.svg";
|
9
|
-
import { ReactComponent as ie } from "./assets/ic-warning.ecf7ff97.svg";
|
10
|
-
import { ReactComponent as le } from "./assets/ic-cross.01e03666.svg";
|
11
|
-
import './assets/@common-rjsf.css';const C = {
|
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
|
-
}, de = ({
|
20
|
-
children: e,
|
21
|
-
disabled: t,
|
22
|
-
hasToolbar: a,
|
23
|
-
hasRemove: r,
|
24
|
-
index: s,
|
25
|
-
onDropIndexClick: l,
|
26
|
-
readonly: i,
|
27
|
-
registry: o,
|
28
|
-
uiSchema: c
|
29
|
-
}) => {
|
30
|
-
const { RemoveButton: d } = o.templates.ButtonTemplates;
|
31
|
-
return /* @__PURE__ */ n.jsxs("div", { className: "dc__position-rel display-grid rjsf-form-template__array-field-item flex-align-center", children: [
|
32
|
-
e,
|
33
|
-
/* @__PURE__ */ n.jsx("div", { className: "dc__position-abs remove-btn__container", style: { right: "-28px", top: "9px" }, children: a && r && /* @__PURE__ */ n.jsx(
|
34
|
-
d,
|
35
|
-
{
|
36
|
-
disabled: t || i,
|
37
|
-
onClick: l(s),
|
38
|
-
uiSchema: c,
|
39
|
-
registry: o
|
40
|
-
}
|
41
|
-
) })
|
42
|
-
] });
|
43
|
-
}, T = ({
|
44
|
-
showLabel: e,
|
45
|
-
label: t,
|
46
|
-
required: a,
|
47
|
-
children: r,
|
48
|
-
id: s,
|
49
|
-
rawDescription: l,
|
50
|
-
shouldAlignCenter: i = !0
|
51
|
-
}) => /* @__PURE__ */ n.jsxs(
|
52
|
-
"div",
|
53
|
-
{
|
54
|
-
className: e ? `display-grid dc__gap-12 rjsf-form-template__field ${i ? "flex-align-center" : ""}` : "",
|
55
|
-
children: [
|
56
|
-
e && /* @__PURE__ */ n.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor: s, children: [
|
57
|
-
/* @__PURE__ */ n.jsx(F, { alwaysShowTippyOnHover: !!l, content: l, children: /* @__PURE__ */ n.jsx("span", { className: `dc__ellipsis-right ${l ? "text-underline-dashed-300" : ""}`, children: t || ce }) }),
|
58
|
-
a && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
59
|
-
] }),
|
60
|
-
r
|
61
|
-
]
|
62
|
-
}
|
63
|
-
), E = ({ label: e, canAdd: t, onAddClick: a, disabled: r, readonly: s, uiSchema: l, registry: i }) => {
|
64
|
-
const {
|
65
|
-
ButtonTemplates: { AddButton: o }
|
66
|
-
} = i.templates;
|
67
|
-
return t && /* @__PURE__ */ n.jsx(
|
68
|
-
o,
|
69
|
-
{
|
70
|
-
label: e,
|
71
|
-
onClick: a,
|
72
|
-
disabled: r || s,
|
73
|
-
uiSchema: l,
|
74
|
-
registry: i
|
75
|
-
}
|
76
|
-
);
|
77
|
-
}, ue = ({
|
78
|
-
canAdd: e,
|
79
|
-
className: t,
|
80
|
-
disabled: a,
|
81
|
-
idSchema: r,
|
82
|
-
uiSchema: s,
|
83
|
-
items: l,
|
84
|
-
onAddClick: i,
|
85
|
-
readonly: o,
|
86
|
-
registry: c,
|
87
|
-
required: d,
|
88
|
-
title: j
|
89
|
-
}) => {
|
90
|
-
const p = $(s), h = B("ArrayFieldItemTemplate", c, p), f = p.title || j;
|
91
|
-
return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: r.$id, children: l.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
92
|
-
l.map(({ key: _, ...x }, m) => {
|
93
|
-
const u = {
|
94
|
-
...x.children,
|
95
|
-
props: {
|
96
|
-
...x.children.props
|
97
|
-
}
|
98
|
-
};
|
99
|
-
return /* @__PURE__ */ n.jsx(h, { ...x, children: u }, _);
|
100
|
-
}),
|
101
|
-
/* @__PURE__ */ n.jsx(
|
102
|
-
E,
|
103
|
-
{
|
104
|
-
label: f,
|
105
|
-
canAdd: e,
|
106
|
-
onAddClick: i,
|
107
|
-
disabled: a,
|
108
|
-
readonly: o,
|
109
|
-
uiSchema: s,
|
110
|
-
registry: c
|
111
|
-
}
|
112
|
-
)
|
113
|
-
] }) : /* @__PURE__ */ n.jsx(T, { label: f, required: d, showLabel: !0, id: r.$id, children: /* @__PURE__ */ n.jsx(
|
114
|
-
E,
|
115
|
-
{
|
116
|
-
label: f,
|
117
|
-
canAdd: e,
|
118
|
-
onAddClick: i,
|
119
|
-
disabled: a,
|
120
|
-
readonly: o,
|
121
|
-
uiSchema: s,
|
122
|
-
registry: c
|
123
|
-
}
|
124
|
-
) }) });
|
125
|
-
}, {
|
126
|
-
templates: { BaseInputTemplate: me }
|
127
|
-
} = q(), pe = ({ placeholder: e, ...t }) => /* @__PURE__ */ n.jsx(
|
128
|
-
me,
|
129
|
-
{
|
130
|
-
placeholder: e || C.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: a,
|
138
|
-
registry: r,
|
139
|
-
uiSchema: s,
|
140
|
-
...l
|
141
|
-
}) => {
|
142
|
-
const i = `Add ${e}`;
|
143
|
-
return /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-start", children: /* @__PURE__ */ n.jsxs(
|
144
|
-
"button",
|
145
|
-
{
|
146
|
-
...l,
|
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: i, children: /* @__PURE__ */ n.jsx("span", { className: "cb-5 fs-13 lh-34 dc__truncate", children: i }) })
|
153
|
-
]
|
154
|
-
}
|
155
|
-
) });
|
156
|
-
}, fe = ({ icon: e, iconType: t, registry: a, uiSchema: r, ...s }) => /* @__PURE__ */ n.jsx("button", { ...s, type: "button", className: "dc__outline-none-imp p-0 dc__transparent flex cursor", title: "Remove", children: /* @__PURE__ */ n.jsx(le, { className: "icon-dim-16 fcn-6" }) }), he = ({ uiSchema: e }) => {
|
157
|
-
const { submitText: t, norender: a, props: r = {} } = Z(e);
|
158
|
-
return a ? 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
|
-
}, O = ({
|
160
|
-
id: e,
|
161
|
-
title: t,
|
162
|
-
required: a,
|
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
|
-
a && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
|
167
|
-
] }), xe = (e) => {
|
168
|
-
const {
|
169
|
-
id: t,
|
170
|
-
label: a,
|
171
|
-
children: r,
|
172
|
-
errors: s,
|
173
|
-
hidden: l,
|
174
|
-
required: i,
|
175
|
-
displayLabel: o,
|
176
|
-
registry: c,
|
177
|
-
uiSchema: d,
|
178
|
-
classNames: j,
|
179
|
-
schema: p,
|
180
|
-
rawDescription: h
|
181
|
-
} = e, f = $(d), _ = B(
|
182
|
-
"WrapIfAdditionalTemplate",
|
183
|
-
c,
|
184
|
-
f
|
185
|
-
), x = L in p, m = (o || p.type === "boolean") && !x, u = p.type === "array";
|
186
|
-
return l ? /* @__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: `${j} mb-0`, children: [
|
189
|
-
u && /* @__PURE__ */ n.jsx(
|
190
|
-
O,
|
191
|
-
{
|
192
|
-
id: t,
|
193
|
-
title: a,
|
194
|
-
required: i,
|
195
|
-
registry: c,
|
196
|
-
uiSchema: d,
|
197
|
-
schema: p,
|
198
|
-
description: h
|
199
|
-
}
|
200
|
-
),
|
201
|
-
/* @__PURE__ */ n.jsx(
|
202
|
-
T,
|
203
|
-
{
|
204
|
-
label: a,
|
205
|
-
showLabel: m,
|
206
|
-
id: t,
|
207
|
-
required: i,
|
208
|
-
rawDescription: h,
|
209
|
-
children: /* @__PURE__ */ n.jsx(_, { ...e, children: r })
|
210
|
-
}
|
211
|
-
),
|
212
|
-
s
|
213
|
-
] })
|
214
|
-
);
|
215
|
-
}, je = ({ errors: e = [], idSchema: t }) => {
|
216
|
-
const a = ee(t);
|
217
|
-
return e.length > 0 && /* @__PURE__ */ n.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id: a, children: e.filter((r) => !!r).map((r, s) => /* @__PURE__ */ n.jsxs(V.Fragment, { children: [
|
218
|
-
/* @__PURE__ */ n.jsx("span", {}),
|
219
|
-
/* @__PURE__ */ n.jsxs("span", { className: "form__error", children: [
|
220
|
-
/* @__PURE__ */ n.jsx(ie, { className: "form__icon form__icon--error" }),
|
221
|
-
r
|
222
|
-
] })
|
223
|
-
] }, s)) });
|
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
|
-
}, y = (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: y(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: y(t.value)
|
277
|
-
} : Object.hasOwn(t, "value") && "value" in t && Object.hasOwn(t, "path") && "path" in t ? {
|
278
|
-
value: t.value,
|
279
|
-
path: y(t.path)
|
280
|
-
} : structuredClone(R);
|
281
|
-
}, H = (e, t, a) => {
|
282
|
-
e && (e.type === "object" && e.properties && typeof e.properties == "object" && Object.entries(e.properties).forEach(([r, s]) => {
|
283
|
-
H(s, `${t}/${r}`, a);
|
284
|
-
}), (e.type === "boolean" || e.type === "string" || e.type === "number" || e.type === "integer") && (a[t] = y(e.updatePath ?? t)));
|
285
|
-
}, ye = (e) => {
|
286
|
-
const t = {};
|
287
|
-
return H(e, "", t), t;
|
288
|
-
}, M = (e, t, a) => {
|
289
|
-
if (t >= a.length)
|
290
|
-
return e;
|
291
|
-
const r = a[t];
|
292
|
-
if (t === a.length - 1) {
|
293
|
-
const s = structuredClone(e);
|
294
|
-
return delete s[r], s;
|
295
|
-
}
|
296
|
-
if (e[r] && (e[r] = M(e[r], t + 1, a)), Object.keys(e[r] ?? {}).length === 0) {
|
297
|
-
const s = structuredClone(e);
|
298
|
-
return delete s[r], s;
|
299
|
-
}
|
300
|
-
return e;
|
301
|
-
}, be = (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 a = t.split("/").slice(1);
|
307
|
-
return M(e, 0, a);
|
308
|
-
}, I = ({
|
309
|
-
formState: e,
|
310
|
-
formData: t,
|
311
|
-
schemaPathToUpdatePathMap: a
|
312
|
-
}) => {
|
313
|
-
let r = structuredClone(e);
|
314
|
-
return r && (Object.entries(a).forEach(([s, l]) => {
|
315
|
-
if (s === l || !l)
|
316
|
-
return;
|
317
|
-
const i = b({
|
318
|
-
json: t,
|
319
|
-
path: v(s),
|
320
|
-
resultType: "value",
|
321
|
-
wrap: !1
|
322
|
-
});
|
323
|
-
i === void 0 ? r = be(r, s) : r = N([S(s, i), r]);
|
324
|
-
const o = b({
|
325
|
-
json: e,
|
326
|
-
path: v(s),
|
327
|
-
resultType: "value",
|
328
|
-
wrap: !1
|
329
|
-
});
|
330
|
-
o !== void 0 && (r = N([S(l, 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(([a, r]) => {
|
334
|
-
if (a === r || !r)
|
335
|
-
return {};
|
336
|
-
const s = b({
|
337
|
-
json: e,
|
338
|
-
path: v(r),
|
339
|
-
resultType: "value",
|
340
|
-
wrap: !1
|
341
|
-
});
|
342
|
-
return s === void 0 ? {} : S(a, s);
|
343
|
-
}),
|
344
|
-
structuredClone(e)
|
345
|
-
]), Te = ({
|
346
|
-
disabled: e,
|
347
|
-
formData: t,
|
348
|
-
idSchema: a,
|
349
|
-
onAddClick: r,
|
350
|
-
properties: s,
|
351
|
-
readonly: l,
|
352
|
-
registry: i,
|
353
|
-
required: o,
|
354
|
-
schema: c,
|
355
|
-
title: d,
|
356
|
-
uiSchema: j,
|
357
|
-
formContext: p
|
358
|
-
}) => {
|
359
|
-
const h = !!c.additionalProperties, f = ae(c, j, t) && /* @__PURE__ */ n.jsx(
|
360
|
-
U,
|
361
|
-
{
|
362
|
-
label: d,
|
363
|
-
className: "object-property-expand",
|
364
|
-
onClick: r(c),
|
365
|
-
disabled: e || l,
|
366
|
-
uiSchema: j,
|
367
|
-
registry: i
|
368
|
-
}
|
369
|
-
), _ = s.filter((x) => {
|
370
|
-
const m = c.properties?.[x.name]?.hidden;
|
371
|
-
if (!m)
|
372
|
-
return !0;
|
373
|
-
try {
|
374
|
-
const u = ge(m);
|
375
|
-
if (!u.path)
|
376
|
-
throw new Error("Empty path property of hidden descriptor field");
|
377
|
-
const g = b({
|
378
|
-
path: v(u.path),
|
379
|
-
json: p,
|
380
|
-
resultType: "value",
|
381
|
-
wrap: !1
|
382
|
-
});
|
383
|
-
return !(g === void 0 || se(u.value, g));
|
384
|
-
} catch {
|
385
|
-
return !0;
|
386
|
-
}
|
387
|
-
}).map((x) => x.content);
|
388
|
-
return h ? s.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: a.$id,
|
396
|
-
shouldAlignCenter: !1,
|
397
|
-
children: /* @__PURE__ */ n.jsx("div", { children: _ })
|
398
|
-
}
|
399
|
-
),
|
400
|
-
f
|
401
|
-
] }) : /* @__PURE__ */ n.jsx(T, { label: d, required: o, showLabel: !0, id: a.$id, children: f }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
402
|
-
_,
|
403
|
-
f
|
404
|
-
] });
|
405
|
-
}, we = (e) => {
|
406
|
-
const { idSchema: t, registry: a, required: r, schema: s, title: l, uiSchema: i, description: o } = e, c = !!s.additionalProperties, d = l && !c;
|
407
|
-
return /* @__PURE__ */ n.jsxs("fieldset", { id: t.$id, children: [
|
408
|
-
d && /* @__PURE__ */ n.jsx(
|
409
|
-
O,
|
410
|
-
{
|
411
|
-
id: re(t),
|
412
|
-
title: l,
|
413
|
-
required: r,
|
414
|
-
schema: s,
|
415
|
-
uiSchema: i,
|
416
|
-
registry: a,
|
417
|
-
description: o
|
418
|
-
}
|
419
|
-
),
|
420
|
-
/* @__PURE__ */ n.jsx(
|
421
|
-
"div",
|
422
|
-
{
|
423
|
-
className: `${s.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: a,
|
432
|
-
onKeyChange: r,
|
433
|
-
onDropPropertyClick: s,
|
434
|
-
readonly: l,
|
435
|
-
schema: i,
|
436
|
-
children: o,
|
437
|
-
uiSchema: c,
|
438
|
-
registry: d
|
439
|
-
}) => {
|
440
|
-
const { templates: j } = d, { RemoveButton: p } = j.ButtonTemplates, h = L in i;
|
441
|
-
return /* @__PURE__ */ n.jsx(n.Fragment, { children: h ? /* @__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: (f) => r(f.target.value),
|
449
|
-
placeholder: C.OBJECT_KEY,
|
450
|
-
defaultValue: a
|
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
|
-
p,
|
456
|
-
{
|
457
|
-
disabled: t || l,
|
458
|
-
onClick: s(a),
|
459
|
-
uiSchema: c,
|
460
|
-
registry: d
|
461
|
-
}
|
462
|
-
) })
|
463
|
-
] }) : o });
|
464
|
-
}, Se = ({
|
465
|
-
id: e,
|
466
|
-
onChange: t,
|
467
|
-
value: a,
|
468
|
-
disabled: r,
|
469
|
-
readonly: s,
|
470
|
-
autofocus: l
|
471
|
-
}) => {
|
472
|
-
const i = z(a) ? !1 : a, o = () => {
|
473
|
-
t(!i);
|
474
|
-
};
|
475
|
-
return /* @__PURE__ */ n.jsxs("div", { className: "flexbox dc__align-items-center dc__gap-8", children: [
|
476
|
-
/* @__PURE__ */ n.jsx(
|
477
|
-
Y,
|
478
|
-
{
|
479
|
-
name: e,
|
480
|
-
ariaLabel: e,
|
481
|
-
onChange: o,
|
482
|
-
isChecked: i,
|
483
|
-
autoFocus: l,
|
484
|
-
isDisabled: r || s
|
485
|
-
}
|
486
|
-
),
|
487
|
-
/* @__PURE__ */ n.jsx("span", { className: "dc__capitalize", children: i.toString() })
|
488
|
-
] });
|
489
|
-
}, Fe = ({ children: e, ...t }) => /* @__PURE__ */ n.jsx(D.MenuList, { ...t, children: Array.isArray(e) ? e.slice(0, 20) : e }), Ce = (e) => /* @__PURE__ */ n.jsx(D.DropdownIndicator, { ...e, children: /* @__PURE__ */ n.jsx(X, { className: "icon-dim-20 icon-n5", "data-testid": "overview-project-edit-dropdown" }) }), Oe = (e) => {
|
490
|
-
const {
|
491
|
-
id: t,
|
492
|
-
multiple: a = !1,
|
493
|
-
options: r,
|
494
|
-
value: s,
|
495
|
-
disabled: l,
|
496
|
-
readonly: i,
|
497
|
-
autofocus: o = !1,
|
498
|
-
onChange: c,
|
499
|
-
onBlur: d,
|
500
|
-
onFocus: j,
|
501
|
-
placeholder: p
|
502
|
-
} = e, { enumOptions: h = [] } = r, f = a ? [] : "", _ = (m) => {
|
503
|
-
c(a ? m.map((u) => u.value) : m.value);
|
504
|
-
}, x = (m) => a ? h.filter((u) => m.some((g) => A(g, u.value))) : h.find((u) => A(m, u.value));
|
505
|
-
return /* @__PURE__ */ n.jsx(
|
506
|
-
Q,
|
507
|
-
{
|
508
|
-
id: t,
|
509
|
-
name: t,
|
510
|
-
isMulti: a,
|
511
|
-
value: typeof s > "u" ? f : x(s),
|
512
|
-
autoFocus: o,
|
513
|
-
onChange: _,
|
514
|
-
options: h,
|
515
|
-
onBlur: () => d(t, s),
|
516
|
-
onFocus: () => j(t, s),
|
517
|
-
placeholder: p || C.SELECT,
|
518
|
-
isDisabled: l || i,
|
519
|
-
styles: {
|
520
|
-
...w,
|
521
|
-
control: (m, u) => ({
|
522
|
-
...w.control(m, u),
|
523
|
-
minHeight: "36px"
|
524
|
-
}),
|
525
|
-
multiValue: (m, u) => ({
|
526
|
-
...w.multiValue(m, u),
|
527
|
-
margin: "2px 8px 2px 2px"
|
528
|
-
})
|
529
|
-
},
|
530
|
-
components: {
|
531
|
-
IndicatorSeparator: null,
|
532
|
-
DropdownIndicator: Ce,
|
533
|
-
MenuList: Fe
|
534
|
-
},
|
535
|
-
menuPlacement: "auto"
|
536
|
-
}
|
537
|
-
);
|
538
|
-
}, Pe = {
|
539
|
-
CheckboxWidget: Se,
|
540
|
-
SelectWidget: Oe
|
541
|
-
}, Ae = {
|
542
|
-
ArrayFieldItemTemplate: de,
|
543
|
-
ArrayFieldTemplate: ue,
|
544
|
-
BaseInputTemplate: pe,
|
545
|
-
ButtonTemplates: { AddButton: U, RemoveButton: fe, SubmitButton: he },
|
546
|
-
FieldTemplate: xe,
|
547
|
-
FieldErrorTemplate: je,
|
548
|
-
ObjectFieldTemplate: we,
|
549
|
-
TitleFieldTemplate: O,
|
550
|
-
WrapIfAdditionalTemplate: Ne
|
551
|
-
}, Ee = K, Re = G, Ye = J((e, t) => {
|
552
|
-
const { schemaPathToUpdatePathMap: a, isUpdatePathKeywordPresent: r } = P(() => {
|
553
|
-
const o = ye(e.schema);
|
554
|
-
return {
|
555
|
-
schemaPathToUpdatePathMap: o,
|
556
|
-
isUpdatePathKeywordPresent: Object.entries(o).some(([c, d]) => c !== d)
|
557
|
-
};
|
558
|
-
}, [e.schema]), s = P(() => r ? ve({ formData: e.formData ?? {}, schemaPathToUpdatePathMap: a }) : e.formData, [e.formData, a, r]), l = (o) => {
|
559
|
-
if (!e.onChange)
|
560
|
-
return;
|
561
|
-
const c = I({
|
562
|
-
formState: o.formData,
|
563
|
-
formData: e.formData,
|
564
|
-
schemaPathToUpdatePathMap: a
|
565
|
-
});
|
566
|
-
e.onChange({ ...o, formData: c });
|
567
|
-
}, i = (o, c) => {
|
568
|
-
if (!e.onSubmit)
|
569
|
-
return;
|
570
|
-
const d = I({
|
571
|
-
formState: o.formData,
|
572
|
-
formData: e.formData,
|
573
|
-
schemaPathToUpdatePathMap: a
|
574
|
-
});
|
575
|
-
e.onSubmit?.({ ...o, formData: d }, c);
|
576
|
-
};
|
577
|
-
return /* @__PURE__ */ n.jsx(
|
578
|
-
Ee,
|
579
|
-
{
|
580
|
-
noHtml5Validate: !0,
|
581
|
-
showErrorList: !1,
|
582
|
-
autoComplete: "off",
|
583
|
-
...e,
|
584
|
-
formData: s,
|
585
|
-
...r ? {
|
586
|
-
onChange: l,
|
587
|
-
onSubmit: i
|
588
|
-
} : {},
|
589
|
-
className: `rjsf-form-template__container ${e.className || ""}`,
|
590
|
-
validator: Re,
|
591
|
-
templates: {
|
592
|
-
...Ae,
|
593
|
-
...e.templates
|
594
|
-
},
|
595
|
-
formContext: s,
|
596
|
-
widgets: { ...Pe, ...e.widgets },
|
597
|
-
translateString: _e,
|
598
|
-
ref: t
|
599
|
-
}
|
600
|
-
);
|
601
|
-
});
|
602
|
-
export {
|
603
|
-
Je as H,
|
604
|
-
Ye as R,
|
605
|
-
Ke as a,
|
606
|
-
ye as b,
|
607
|
-
y as c,
|
608
|
-
qe as g
|
609
|
-
};
|
Binary file
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
- Copyright (c) 2024. Devtron Inc.
|
3
|
-
-
|
4
|
-
- Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
- you may not use this file except in compliance with the License.
|
6
|
-
- You may obtain a copy of the License at
|
7
|
-
-
|
8
|
-
- http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
-
|
10
|
-
- Unless required by applicable law or agreed to in writing, software
|
11
|
-
- distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
- See the License for the specific language governing permissions and
|
14
|
-
- limitations under the License.
|
15
|
-
-->
|
16
|
-
|
17
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
18
|
-
<g fill="none" fill-rule="evenodd">
|
19
|
-
<path d="M0 0h32v32H0z"/>
|
20
|
-
<path fill="#de350b" d="M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667z"/>
|
21
|
-
<path fill="#FFF" d="M16 14.667c.736 0 1.333.597 1.333 1.333v5.333a1.333 1.333 0 1 1-2.666 0V16c0-.736.597-1.333 1.333-1.333zm0-5.334A1.333 1.333 0 1 1 16 12a1.333 1.333 0 0 1 0-2.667z"/>
|
22
|
-
</g>
|
23
|
-
</svg>
|