@devtron-labs/devtron-fe-common-lib 1.12.0 → 1.13.0-beta-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 (179) hide show
  1. package/dist/{@code-editor-BX93G51P.js → @common-rjsf-DHa4CNIm.js} +15141 -14159
  2. package/dist/{@framer-motion-BaOj5B1h.js → @framer-motion-Hh5HoZEj.js} +1 -1
  3. package/dist/{@react-dates-CdRpENvm.js → @react-dates-RAg1eRYJ.js} +14 -14
  4. package/dist/{@react-select-BLSAqXV1.js → @react-select-Cyc43HrK.js} +1 -1
  5. package/dist/{@react-virtualized-sticky-tree-BLmFnJWD.js → @react-virtualized-sticky-tree-Cby7tsJ8.js} +1 -1
  6. package/dist/{@vendor-SjXFleuT.js → @vendor-BZpoz8Ez.js} +18390 -19220
  7. package/dist/Common/CIPipeline.Types.d.ts +20 -19
  8. package/dist/Common/Checkbox/Checkbox.d.ts +2 -0
  9. package/dist/Common/Checkbox/index.d.ts +1 -0
  10. package/dist/Common/Common.service.d.ts +2 -1
  11. package/dist/Common/Constants.d.ts +4 -2
  12. package/dist/Common/Drawer/index.d.ts +1 -0
  13. package/dist/Common/EmptyState/index.d.ts +2 -0
  14. package/dist/Common/Helper.d.ts +5 -1
  15. package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +1 -1
  16. package/dist/Common/RJSF/Form.d.ts +1 -1
  17. package/dist/Common/Toggle/Toggle.d.ts +4 -1
  18. package/dist/Common/Types.d.ts +16 -10
  19. package/dist/Common/index.d.ts +2 -4
  20. package/dist/Shared/Components/AboutDevtron/AboutDevtronBody.d.ts +4 -0
  21. package/dist/Shared/Components/AboutDevtron/AboutDevtronDialog.d.ts +5 -0
  22. package/dist/Shared/Components/AboutDevtron/index.d.ts +2 -0
  23. package/dist/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.d.ts +1 -1
  24. package/dist/Shared/Components/AnimatedDeployButton/types.d.ts +6 -0
  25. package/dist/Shared/Components/AppStatusModal/AppStatusBody.d.ts +2 -0
  26. package/dist/Shared/Components/AppStatusModal/AppStatusContent.d.ts +3 -0
  27. package/dist/Shared/Components/AppStatusModal/AppStatusModal.component.d.ts +3 -0
  28. package/dist/Shared/Components/AppStatusModal/AppStatusModalTabList.d.ts +3 -0
  29. package/dist/Shared/Components/AppStatusModal/constants.d.ts +4 -0
  30. package/dist/Shared/Components/AppStatusModal/index.d.ts +3 -0
  31. package/dist/Shared/Components/AppStatusModal/service.d.ts +4 -0
  32. package/dist/Shared/Components/AppStatusModal/types.d.ts +78 -0
  33. package/dist/Shared/Components/AppStatusModal/utils.d.ts +8 -0
  34. package/dist/Shared/Components/Button/types.d.ts +3 -1
  35. package/dist/Shared/Components/CICDHistory/Artifacts.d.ts +1 -1
  36. package/dist/Shared/Components/CICDHistory/DeploymentDetailSteps.d.ts +1 -1
  37. package/dist/Shared/Components/CICDHistory/DeploymentStatusBreakdown.d.ts +1 -1
  38. package/dist/Shared/Components/CICDHistory/DeploymentStatusDetailRow.d.ts +1 -1
  39. package/dist/Shared/Components/CICDHistory/History.components.d.ts +1 -1
  40. package/dist/Shared/Components/CICDHistory/constants.d.ts +1 -0
  41. package/dist/Shared/Components/CICDHistory/index.d.ts +0 -1
  42. package/dist/Shared/Components/CICDHistory/service.d.ts +3 -0
  43. package/dist/Shared/Components/CICDHistory/types.d.ts +15 -79
  44. package/dist/Shared/Components/CICDHistory/utils.d.ts +7 -3
  45. package/dist/Shared/Components/CMCS/constants.d.ts +2 -2
  46. package/dist/Shared/Components/CMCS/utils.d.ts +4 -3
  47. package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/types.d.ts +3 -3
  48. package/dist/Shared/Components/DeploymentStatusBreakdown/constants.d.ts +10 -0
  49. package/dist/Shared/Components/DeploymentStatusBreakdown/index.d.ts +3 -0
  50. package/dist/Shared/Components/DeploymentStatusBreakdown/types.d.ts +22 -0
  51. package/dist/Shared/Components/DeploymentStatusBreakdown/utils.d.ts +20 -0
  52. package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +1 -1
  53. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +1 -1
  54. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +1 -1
  55. package/dist/Shared/Components/DynamicDataTable/types.d.ts +8 -2
  56. package/dist/Shared/Components/Error/ErrorBar.d.ts +1 -1
  57. package/dist/Shared/Components/Error/types.d.ts +4 -0
  58. package/dist/Shared/Components/Error/utils.d.ts +1 -0
  59. package/dist/Shared/Components/FramerComponents/index.d.ts +2 -2
  60. package/dist/Shared/Components/Header/PageHeader.d.ts +1 -1
  61. package/dist/Shared/Components/Header/types.d.ts +0 -1
  62. package/dist/Shared/Components/Icon/Icon.d.ts +34 -1
  63. package/dist/Shared/Components/Icon/IconBase.d.ts +1 -1
  64. package/dist/Shared/Components/Icon/types.d.ts +2 -1
  65. package/dist/Shared/Components/InfoBlock/constants.d.ts +2 -2
  66. package/dist/Shared/Components/InfoBlock/types.d.ts +2 -2
  67. package/dist/Shared/Components/InfoIconTippy/InfoIconTippy.d.ts +1 -1
  68. package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
  69. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +75 -78
  70. package/dist/Shared/Components/KeyValueTable/index.d.ts +1 -1
  71. package/dist/Shared/Components/KeyValueTable/utils.d.ts +13 -0
  72. package/dist/Shared/Components/License/index.d.ts +1 -1
  73. package/dist/Shared/Components/License/utils.d.ts +2 -1
  74. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
  75. package/dist/Shared/Components/TabGroup/TabGroup.component.d.ts +1 -1
  76. package/dist/Shared/Components/TabGroup/TabGroup.helpers.d.ts +1 -1
  77. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +36 -12
  78. package/dist/Shared/Components/TabGroup/TabGroup.utils.d.ts +1 -1
  79. package/dist/Shared/Components/UserIdentifier/UserIdentifier.d.ts +2 -0
  80. package/dist/Shared/Components/UserIdentifier/index.d.ts +2 -0
  81. package/dist/Shared/Components/UserIdentifier/types.d.ts +11 -0
  82. package/dist/Shared/Components/index.d.ts +5 -2
  83. package/dist/Shared/Helpers.d.ts +2 -2
  84. package/dist/Shared/Providers/index.d.ts +1 -1
  85. package/dist/Shared/Providers/types.d.ts +13 -1
  86. package/dist/Shared/Services/app.types.d.ts +2 -6
  87. package/dist/Shared/constants.d.ts +20 -24
  88. package/dist/Shared/types.d.ts +109 -2
  89. package/dist/assets/@common-rjsf.css +1 -1
  90. package/dist/assets/ic-amazon-eks.13404569.svg +5 -0
  91. package/dist/assets/ic-arrow-square-out.59bb549a.svg +3 -0
  92. package/dist/assets/ic-azure-aks.a9e437d5.svg +46 -0
  93. package/dist/assets/{ic-timeout-red.5eda1010.svg → ic-bulk-check.0f698efa.svg} +4 -4
  94. package/dist/assets/{ic-memory.c4159f96.svg → ic-bulk-check.99e92f7a.svg} +5 -3
  95. package/dist/assets/ic-caret-down-small.7c4f88bf.svg +3 -0
  96. package/dist/assets/ic-caret-right.0ff813c2.svg +3 -0
  97. package/dist/assets/ic-celebration.77350694.svg +238 -0
  98. package/dist/assets/ic-checkbox-hover.0151d832.svg +20 -0
  99. package/dist/assets/ic-checkbox-hover.93e8d66a.svg +20 -0
  100. package/dist/assets/ic-checkbox-intermediate.24c6d21d.svg +22 -0
  101. package/dist/assets/ic-checkbox-intermediate.2a2d6c49.svg +22 -0
  102. package/dist/assets/ic-checkbox-selected.47444fab.svg +20 -0
  103. package/dist/assets/ic-checkbox-selected.c5539d6f.svg +20 -0
  104. package/dist/assets/{ic-check-grey.f556e371.svg → ic-checkbox-unselected.8054e3d7.svg} +2 -4
  105. package/dist/assets/ic-checkbox-unselected.ab91cdba.svg +19 -0
  106. package/dist/assets/ic-checks.d276fd05.svg +3 -0
  107. package/dist/assets/ic-cloud-vms.27ea954e.svg +5 -0
  108. package/dist/assets/ic-cpu.07ca0915.svg +3 -0
  109. package/dist/assets/ic-disconnect.26bad827.svg +3 -0
  110. package/dist/assets/ic-expand-right-sm.9b347d49.svg +3 -0
  111. package/dist/assets/ic-expand-sm.a9a724f8.svg +3 -0
  112. package/dist/assets/ic-gift-gradient.7690a246.svg +9 -0
  113. package/dist/assets/ic-gift.9b048fc7.svg +3 -0
  114. package/dist/assets/ic-gitlab.ac331d67.svg +31 -0
  115. package/dist/assets/ic-google-gke.07314724.svg +9 -0
  116. package/dist/assets/ic-hand-pointing.aff70667.svg +4 -0
  117. package/dist/assets/ic-help-filled.4468cdf1.svg +4 -0
  118. package/dist/assets/{ic-info-filled.9277eb13.svg → ic-info-filled.763be331.svg} +1 -1
  119. package/dist/assets/ic-install.28c3beec.svg +3 -0
  120. package/dist/assets/ic-k3s.7f4bf72d.svg +3 -0
  121. package/dist/assets/ic-key.8c76fb61.svg +3 -0
  122. package/dist/assets/ic-kind.bd8ee992.svg +9 -0
  123. package/dist/assets/ic-laptop.485e21b4.svg +3 -0
  124. package/dist/assets/ic-man-on-rocket.7f67e914.svg +94 -0
  125. package/dist/assets/ic-megaphone-left.6b2a00b7.svg +3 -0
  126. package/dist/assets/ic-memory.82ba7e9b.svg +3 -0
  127. package/dist/assets/ic-minikube.d9ff1575.svg +9 -0
  128. package/dist/assets/ic-mobile.7c649251.svg +4 -0
  129. package/dist/assets/ic-rocket-launch.1d407c66.svg +3 -0
  130. package/dist/assets/{ic-timeout-two-dash.9a580698.svg → ic-selected.3a29e244.svg} +2 -3
  131. package/dist/assets/ic-sparkle-color.01c0be88.svg +1 -0
  132. package/dist/assets/ic-thumb-down.92d2c4d7.svg +3 -0
  133. package/dist/assets/ic-thumb-up.7c6f6896.svg +3 -0
  134. package/dist/assets/ic-timeout-dash.d8e2d62e.svg +21 -0
  135. package/dist/assets/ic-ubuntu.fa47508f.svg +4 -0
  136. package/dist/assets/ic-user-circle.7d7152fa.svg +3 -0
  137. package/dist/assets/ic-wifi-slash.d0390749.svg +3 -0
  138. package/dist/index.d.ts +5 -5
  139. package/dist/index.js +887 -858
  140. package/package.json +1 -7
  141. package/dist/@common-rjsf-CzK1frl5.js +0 -617
  142. package/dist/@monaco-editor-CVagbUeH.js +0 -138960
  143. package/dist/Common/Checkbox.d.ts +0 -5
  144. package/dist/Common/CodeEditor/CodeEditor.d.ts +0 -4
  145. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +0 -48
  146. package/dist/Common/CodeEditor/index.d.ts +0 -2
  147. package/dist/Common/CodeEditor/types.d.ts +0 -110
  148. package/dist/Common/CodeEditor/utils.d.ts +0 -3
  149. package/dist/Shared/Components/AnnouncementBanner/AnnouncementBanner.d.ts +0 -6
  150. package/dist/Shared/Components/AnnouncementBanner/index.d.ts +0 -1
  151. package/dist/Shared/Components/CICDHistory/AppStatusDetailsChart.d.ts +0 -3
  152. package/dist/Shared/Components/CICDHistory/ErrorInfoStatusBar.d.ts +0 -2
  153. package/dist/Shared/Components/CodeEditorWrapper/CodeEditorWrapper.d.ts +0 -19
  154. package/dist/Shared/Components/CodeEditorWrapper/index.d.ts +0 -1
  155. package/dist/Shared/Components/CodeEditorWrapper/types.d.ts +0 -7
  156. package/dist/assets/@code-editor.css +0 -1
  157. package/dist/assets/@monaco-editor.css +0 -1
  158. package/dist/assets/codicon.ecfbfe4b.ttf +0 -0
  159. package/dist/assets/ic-cpu.8be677ee.svg +0 -20
  160. package/dist/assets/ic-disconnected.551d6161.svg +0 -29
  161. package/dist/assets/ic-megaphone.b9f9a901.svg +0 -19
  162. package/dist/assets/ic-nav-rocket.433c9706.svg +0 -19
  163. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/CodeEditor.components.d.ts +0 -0
  164. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/CodeEditor.constants.d.ts +0 -0
  165. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/CodeEditor.context.d.ts +0 -0
  166. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/CodeEditor.d.ts +0 -0
  167. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/CodeEditor.theme.d.ts +0 -0
  168. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/CodeEditorRenderer.d.ts +0 -0
  169. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Commands/findAndReplace.d.ts +0 -0
  170. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Commands/index.d.ts +0 -0
  171. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Commands/keyMaps.d.ts +0 -0
  172. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Extensions/DiffMinimap.d.ts +0 -0
  173. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Extensions/findAndReplace.d.ts +0 -0
  174. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Extensions/index.d.ts +0 -0
  175. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Extensions/readOnlyTooltip.d.ts +0 -0
  176. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Extensions/yamlHighlight.d.ts +0 -0
  177. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/Extensions/yamlParseLinter.d.ts +0 -0
  178. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/index.d.ts +0 -0
  179. /package/dist/{Common/CodeMirror → Shared/Components/CodeEditor}/utils.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "1.12.0",
3
+ "version": "1.13.0-beta-1",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -66,8 +66,6 @@
66
66
  "json-schema": "^0.4.0",
67
67
  "lint-staged": "^12.5.0",
68
68
  "moment": "^2.29.4",
69
- "monaco-editor": "0.44.0",
70
- "monaco-yaml": "5.1.1",
71
69
  "prettier": "^3.1.1",
72
70
  "react-ga4": "^1.4.1",
73
71
  "react-toastify": "9.1.3",
@@ -127,7 +125,6 @@
127
125
  "react-diff-viewer-continued": "^3.4.0",
128
126
  "react-draggable": "^4.4.5",
129
127
  "react-international-phone": "^4.5.0",
130
- "react-monaco-editor": "^0.54.0",
131
128
  "react-virtualized-sticky-tree": "^3.0.0-beta18",
132
129
  "sass": "^1.69.7",
133
130
  "tslib": "2.7.0"
@@ -138,9 +135,6 @@
138
135
  "react": "^17.0.2",
139
136
  "react-dom": "^17.0.2"
140
137
  },
141
- "react-monaco-editor": {
142
- "monaco-editor": "0.44.0"
143
- },
144
138
  "vite-plugin-svgr": {
145
139
  "vite": "5.4.17"
146
140
  },
@@ -1,617 +0,0 @@
1
- import { j as n, av as y, ax as k, aw as W } from "./@vendor-SjXFleuT.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-BX93G51P.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
- }, de = ({
20
- children: e,
21
- disabled: t,
22
- hasToolbar: s,
23
- hasRemove: r,
24
- index: a,
25
- onDropIndexClick: i,
26
- readonly: l,
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: s && r && /* @__PURE__ */ n.jsx(
34
- d,
35
- {
36
- disabled: t || l,
37
- onClick: i(a),
38
- uiSchema: c,
39
- registry: o
40
- }
41
- ) })
42
- ] });
43
- }, T = ({
44
- showLabel: e,
45
- label: t,
46
- required: s,
47
- children: r,
48
- id: a,
49
- rawDescription: i,
50
- shouldAlignCenter: l = !0
51
- }) => /* @__PURE__ */ n.jsxs(
52
- "div",
53
- {
54
- className: e ? `display-grid dc__gap-12 rjsf-form-template__field ${l ? "flex-align-center" : ""}` : "",
55
- children: [
56
- e && /* @__PURE__ */ n.jsxs("label", { className: "cn-7 fs-13 lh-20 fw-4 flexbox mb-0", htmlFor: a, children: [
57
- /* @__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 }) }),
58
- s && /* @__PURE__ */ n.jsx("span", { className: "cr-5", children: " *" })
59
- ] }),
60
- r
61
- ]
62
- }
63
- ), A = ({ label: e, canAdd: t, onAddClick: s, disabled: r, readonly: a, uiSchema: i, registry: l }) => {
64
- const {
65
- ButtonTemplates: { AddButton: o }
66
- } = l.templates;
67
- return t && /* @__PURE__ */ n.jsx(
68
- o,
69
- {
70
- label: e,
71
- onClick: s,
72
- disabled: r || a,
73
- uiSchema: i,
74
- registry: l
75
- }
76
- );
77
- }, ue = ({
78
- canAdd: e,
79
- className: t,
80
- disabled: s,
81
- idSchema: r,
82
- uiSchema: a,
83
- items: i,
84
- onAddClick: l,
85
- readonly: o,
86
- registry: c,
87
- required: d,
88
- title: x
89
- }) => {
90
- const u = B(a), f = $("ArrayFieldItemTemplate", c, u), p = u.title || x;
91
- return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: r.$id, children: i.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
92
- i.map(({ key: _, ...j }, h) => {
93
- const m = {
94
- ...j.children,
95
- props: {
96
- ...j.children.props
97
- }
98
- };
99
- return /* @__PURE__ */ n.jsx(f, { ...j, children: m }, _);
100
- }),
101
- /* @__PURE__ */ n.jsx(
102
- A,
103
- {
104
- label: p,
105
- canAdd: e,
106
- onAddClick: l,
107
- disabled: s,
108
- readonly: o,
109
- uiSchema: a,
110
- registry: c
111
- }
112
- )
113
- ] }) : /* @__PURE__ */ n.jsx(T, { label: p, required: d, showLabel: !0, id: r.$id, children: /* @__PURE__ */ n.jsx(
114
- A,
115
- {
116
- label: p,
117
- canAdd: e,
118
- onAddClick: l,
119
- disabled: s,
120
- readonly: o,
121
- uiSchema: a,
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 || 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: de,
551
- ArrayFieldTemplate: ue,
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
- };