@hybridcore/ui 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/CATALOG.md +179 -0
  2. package/README.md +1 -2
  3. package/dist/AccordionSummary-CJppWeqF.js +781 -0
  4. package/dist/Add-CqcD1PWb.js +403 -0
  5. package/dist/Box-DqUMmZjL.js +31 -0
  6. package/dist/{Button-CvE2gnly.js → Button-C5yquWAB.js} +120 -133
  7. package/dist/ButtonBase-BEF7oTOe.js +887 -0
  8. package/dist/{Delete-CW0UZv1m.js → Delete-BdyYpINH.js} +9 -8
  9. package/dist/{DialogContent-B3nbEbuv.js → DialogContent-BvVjD9z3.js} +127 -124
  10. package/dist/FormGroup-CpBsIyYR.js +89 -0
  11. package/dist/{IconButton-CHwRQF-g.js → IconButton-BoGwbvrP.js} +41 -43
  12. package/dist/InputLabel-Dd8RrneV.js +341 -0
  13. package/dist/{MenuItem-xZx_w7zA.js → MenuItem-DwqJqzuM.js} +51 -53
  14. package/dist/Modal-MUZygjmQ.js +1158 -0
  15. package/dist/Paper-BkQLdsCI.js +582 -0
  16. package/dist/Select-DHUl_uG3.js +3916 -0
  17. package/dist/SwitchBase-DTndTqI8.js +235 -0
  18. package/dist/TextField-e2oKaUN1.js +669 -0
  19. package/dist/TransitionGroupContext-BDAp2T0O.js +96 -0
  20. package/dist/{Typography-CxbneZy_.js → Typography-DgsSLCFC.js} +53 -53
  21. package/dist/assertThisInitialized-C1dAyb4j.js +7 -0
  22. package/dist/assets/index4.css +1 -0
  23. package/dist/clsx-OuTLNxxd.js +16 -0
  24. package/dist/components/access/helpers.js +1 -1
  25. package/dist/components/access/index.js +8 -15
  26. package/dist/components/access/logic.js +25 -0
  27. package/dist/components/button/index.js +10 -0
  28. package/dist/components/button/logic.js +26 -0
  29. package/dist/components/button/styled.js +9 -0
  30. package/dist/components/card/index.js +158 -498
  31. package/dist/components/card/logic.js +24 -0
  32. package/dist/components/card/styled.js +226 -51
  33. package/dist/components/card-alternate/index.js +111 -139
  34. package/dist/components/card-alternate/logic.js +17 -0
  35. package/dist/components/card-alternate/styled.js +113 -19
  36. package/dist/components/charts/_common/chart-error.js +19 -0
  37. package/dist/components/charts/candlestick/index.js +3 -3
  38. package/dist/components/charts/candlestick/logic.js +123 -113
  39. package/dist/components/charts/chart-wrapper/index.js +5 -5
  40. package/dist/components/charts/column-line-mix/index.js +9 -8
  41. package/dist/components/charts/column-line-mix/logic.js +68 -71
  42. package/dist/components/charts/drill-down-treemap/index.js +8 -7
  43. package/dist/components/charts/drill-down-treemap/logic.js +138 -144
  44. package/dist/components/charts/drill-down-voronoi-treemap/index.js +9 -8
  45. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +222 -228
  46. package/dist/components/charts/heatmap/index.js +9 -8
  47. package/dist/components/charts/heatmap/logic.js +167 -173
  48. package/dist/components/charts/highlighting-line-data/index.js +3 -3
  49. package/dist/components/charts/line/index.js +9 -8
  50. package/dist/components/charts/line/logic.js +74 -79
  51. package/dist/components/charts/logaritmic-scale/index.js +9 -8
  52. package/dist/components/charts/logaritmic-scale/logic.js +63 -69
  53. package/dist/components/charts/multiple-value-axes/index.js +9 -8
  54. package/dist/components/charts/multiple-value-axes/logic.js +101 -107
  55. package/dist/components/charts/nested-pie/index.js +9 -8
  56. package/dist/components/charts/nested-pie/logic.js +62 -68
  57. package/dist/components/charts/packed-circles/index.js +7 -6
  58. package/dist/components/charts/packed-circles/logic.js +50 -56
  59. package/dist/components/charts/pie-chart/index.js +9 -8
  60. package/dist/components/charts/pie-chart/logic.js +49 -54
  61. package/dist/components/charts/stacked-area-radar/index.js +8 -7
  62. package/dist/components/charts/stacked-area-radar/logic.js +113 -118
  63. package/dist/components/charts/stacked-column-chart/index.js +9 -8
  64. package/dist/components/charts/stacked-column-chart/logic.js +78 -84
  65. package/dist/components/charts/xy-chart/index.js +9 -8
  66. package/dist/components/charts/xy-chart/logic.js +56 -60
  67. package/dist/components/collapsible-card/index.js +11 -10
  68. package/dist/components/collapsible-card/styled.js +1 -1
  69. package/dist/components/color-picker/index.js +7120 -0
  70. package/dist/components/color-picker/logic.js +18 -0
  71. package/dist/components/color-picker/styled.js +7 -0
  72. package/dist/components/confirm/dialog.js +3 -3
  73. package/dist/components/confirm/index.js +1 -1
  74. package/dist/components/container/index.js +28 -269
  75. package/dist/components/container/logic.js +12 -0
  76. package/dist/components/container/styled.js +29 -0
  77. package/dist/components/context-menu/index.js +25 -457
  78. package/dist/components/context-menu/logic.js +14 -0
  79. package/dist/components/context-menu/styled.js +40 -0
  80. package/dist/components/data-grid/index.js +22 -0
  81. package/dist/components/data-grid/logic.js +15 -0
  82. package/dist/components/data-grid/styled.js +20 -0
  83. package/dist/components/data-map/components/controls/index.js +4 -6
  84. package/dist/components/data-map/index.js +11 -11
  85. package/dist/components/data-security-selectors/dissemination-list/index.js +192 -191
  86. package/dist/components/data-security-selectors/dissemination-list/styled.js +12 -12
  87. package/dist/components/data-security-selectors/security-level/index.js +39 -91
  88. package/dist/components/data-security-selectors/security-level/logic.js +28 -0
  89. package/dist/components/data-security-selectors/security-level/styled.js +53 -0
  90. package/dist/components/date-picker-with-custom-range/index.js +1 -1
  91. package/dist/components/date-range-picker/index.js +2748 -0
  92. package/dist/components/date-range-picker/styled.js +14 -0
  93. package/dist/components/date-time-picker/index.js +45 -46
  94. package/dist/components/divider/index.js +11 -11
  95. package/dist/components/document-viewer/components/action-buttons/index.js +15 -15
  96. package/dist/components/document-viewer/components/navigation/index.js +9 -9
  97. package/dist/components/document-viewer/components/viewer/index.js +31 -35
  98. package/dist/components/document-viewer/index.js +31 -39
  99. package/dist/components/document-viewer/logic.js +41 -34
  100. package/dist/components/document-viewer/styled.js +115 -27
  101. package/dist/components/duration-select/index.js +27 -0
  102. package/dist/components/duration-select/logic.js +21 -0
  103. package/dist/components/duration-select/styled.js +26 -0
  104. package/dist/components/editable-text/index.js +20 -0
  105. package/dist/components/editable-text/logic.js +18 -0
  106. package/dist/components/editable-text/styled.js +22 -0
  107. package/dist/components/geometry-picker/coordinate/index.js +29 -29
  108. package/dist/components/geometry-picker/edit/index.js +18 -18
  109. package/dist/components/geometry-picker/geometry/index.js +67 -67
  110. package/dist/components/geometry-picker/geometry/map-overlay.js +6 -6
  111. package/dist/components/geometry-picker/index.js +69 -85
  112. package/dist/components/geometry-picker/kml/index.js +16 -16
  113. package/dist/components/geometry-picker/logic.js +50 -57
  114. package/dist/components/geometry-picker/map/index.js +8 -8
  115. package/dist/components/geometry-picker/parser/coordinate-input/index.js +4 -4
  116. package/dist/components/geometry-picker/parser/index.js +46 -50
  117. package/dist/components/geometry-picker/parser/styled.js +22 -4
  118. package/dist/components/geometry-picker/styled.js +97 -37
  119. package/dist/components/geometry-picker/wkt/index.js +13 -13
  120. package/dist/components/heat-map/components/controls/index.js +4 -6
  121. package/dist/components/heat-map/components/legend/index.js +15 -17
  122. package/dist/components/heat-map/index.js +7 -7
  123. package/dist/components/instance-form/components/TopLabelWrapper.js +8 -48
  124. package/dist/components/instance-form/components/composite-list/index.js +5 -3
  125. package/dist/components/instance-form/components/composite-matrix/components/editable-table/index.js +83 -74
  126. package/dist/components/instance-form/components/composite-matrix/components/editor/index.js +45 -66
  127. package/dist/components/instance-form/components/composite-matrix/components/form/index.js +60 -75
  128. package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +2425 -2422
  129. package/dist/components/instance-form/components/composite-matrix/components/table/index.js +33 -52
  130. package/dist/components/instance-form/components/composite-matrix/index.js +30 -36
  131. package/dist/components/instance-form/components/policy-list/index.js +47 -81
  132. package/dist/components/instance-form/components/variable/index.js +6 -11
  133. package/dist/components/instance-form/components/variables/index.js +48 -55
  134. package/dist/components/instance-form/helpers.js +9 -0
  135. package/dist/components/instance-form/index.js +402 -518
  136. package/dist/components/instance-form/logic.js +115 -0
  137. package/dist/components/instance-form/styled.js +487 -0
  138. package/dist/components/instance-hierarchy-table/index.js +32 -37
  139. package/dist/components/instance-hierarchy-table/logic.js +16 -0
  140. package/dist/components/instance-hierarchy-table/styled.js +53 -12
  141. package/dist/components/instance-table/index.js +30 -135
  142. package/dist/components/instance-table/logic.js +122 -0
  143. package/dist/components/instance-table/styled.js +53 -11
  144. package/dist/components/instance-variable-list/index.js +11 -11
  145. package/dist/components/loading/index.js +15 -9
  146. package/dist/components/loading/logic.js +15 -0
  147. package/dist/components/loading/styled.js +26 -19
  148. package/dist/components/map/index.js +28 -6
  149. package/dist/components/map/styled.js +1 -1
  150. package/dist/components/notification/index.js +67 -0
  151. package/dist/components/notification/logic.js +30 -0
  152. package/dist/components/notification/store.js +23 -0
  153. package/dist/components/notification/styled.js +52 -0
  154. package/dist/components/object-profile-card/components/avatar/index.js +9 -10
  155. package/dist/components/object-profile-card/index.js +19 -20
  156. package/dist/components/paginated-list/index.js +2 -3
  157. package/dist/components/phone-input/index.js +18 -22
  158. package/dist/components/phone-input/logic.js +14 -0
  159. package/dist/components/phone-input/styled.js +12 -4
  160. package/dist/components/placeholder/index.js +10 -0
  161. package/dist/components/placeholder/logic.js +12 -0
  162. package/dist/components/placeholder/styled.js +32 -0
  163. package/dist/components/positional-tooltip/index.js +24 -0
  164. package/dist/components/positional-tooltip/styled.js +17 -0
  165. package/dist/components/property-mapping/index.js +204 -423
  166. package/dist/components/property-mapping/logic.js +156 -0
  167. package/dist/components/property-mapping/styled.js +199 -0
  168. package/dist/components/prr-map/components/controls/index.js +4 -6
  169. package/dist/components/prr-map/components/legend/index.js +26 -28
  170. package/dist/components/prr-map/index.js +5 -5
  171. package/dist/components/range-selector/components/composite-list-range/index.js +42 -50
  172. package/dist/components/range-selector/components/date-range/index.js +87 -4221
  173. package/dist/components/range-selector/components/geometry-range/index.js +11 -17
  174. package/dist/components/range-selector/components/number-range/index.js +48 -53
  175. package/dist/components/range-selector/components/string-range/index.js +15 -17
  176. package/dist/components/range-selector/index.js +63 -57
  177. package/dist/components/range-selector/logic.js +12 -0
  178. package/dist/components/range-selector/styled.js +4294 -0
  179. package/dist/components/raster-grid-map/components/controls/index.js +4 -6
  180. package/dist/components/raster-grid-map/components/legend/index.js +4 -6
  181. package/dist/components/raster-grid-map/index.js +5 -5
  182. package/dist/components/scroll-drag/index.js +22 -0
  183. package/dist/components/scroll-drag/logic.js +39 -0
  184. package/dist/components/scroll-drag/styled.js +17 -0
  185. package/dist/components/search-input/logic.js +35 -33
  186. package/dist/components/simple-pivot-table/index.js +12 -12
  187. package/dist/components/sortable-list/index.js +599 -0
  188. package/dist/components/sortable-list/logic.js +18 -0
  189. package/dist/components/sortable-list/styled.js +38 -0
  190. package/dist/components/static-text/index.js +6 -6
  191. package/dist/components/stats-box/index.js +12 -0
  192. package/dist/components/stats-box/styled.js +36 -0
  193. package/dist/components/template-filters/components/filter/index.js +13 -18
  194. package/dist/components/template-filters/components/tab-panel/index.js +8 -16
  195. package/dist/components/template-filters/index.js +21 -29
  196. package/dist/components/template-filters/logic.js +18 -0
  197. package/dist/components/template-filters/styled.js +44 -1
  198. package/dist/components/template-form/components/property-list/index.js +27 -26
  199. package/dist/components/template-form/components/property-list/property-list-columns.js +3 -3
  200. package/dist/components/template-form/components/property-list/property-list-form.js +758 -14
  201. package/dist/components/template-form/components/recognition-property-list/index.js +11 -11
  202. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +2 -2
  203. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +24 -23
  204. package/dist/components/template-form/components/select-icon/index.js +24 -24
  205. package/dist/components/template-form/helpers.js +17 -0
  206. package/dist/components/template-form/index.js +270 -309
  207. package/dist/components/template-form/logic.js +69 -0
  208. package/dist/components/template-form/styled.js +84 -0
  209. package/dist/components/template-property-filters/index.js +45 -95
  210. package/dist/components/template-property-filters/logic.js +27 -0
  211. package/dist/components/template-property-filters/property.js +105 -165
  212. package/dist/components/template-property-filters/styled.js +121 -20
  213. package/dist/components/text-overflow/index.js +6 -0
  214. package/dist/components/text-overflow/styled.js +13 -0
  215. package/dist/components/timeline/index.js +12 -12
  216. package/dist/components/toggle-view-button/index.js +35 -0
  217. package/dist/components/toggle-view-button/logic.js +22 -0
  218. package/dist/components/toggle-view-button/styled.js +11 -0
  219. package/dist/components/tree-select/index.js +52 -67
  220. package/dist/components/tree-select/logic.js +59 -0
  221. package/dist/components/tree-select/styled.js +45 -62
  222. package/dist/components/treeview-filter/index.js +43 -65
  223. package/dist/components/treeview-filter/item/index.js +43 -42
  224. package/dist/components/treeview-filter/item-label/index.js +17 -37
  225. package/dist/components/treeview-filter/logic.js +28 -0
  226. package/dist/components/treeview-filter/styled.js +86 -0
  227. package/dist/components/uploader/index.js +532 -567
  228. package/dist/components/uploader/logic.js +74 -0
  229. package/dist/components/uploader/styled.js +93 -46
  230. package/dist/components/visually-hidden-input/index.js +4 -0
  231. package/dist/components/visually-hidden-input/styled.js +18 -0
  232. package/dist/createChainedFunction-C0nujS3O.js +9 -0
  233. package/dist/{createSvgIcon-DrtgaibK.js → createSvgIcon-Ch_cT8az.js} +69 -68
  234. package/dist/createSvgIcon-DuDuASu1.js +62 -0
  235. package/dist/{dialog-DcwXug9J.js → dialog-BYRnCztH.js} +18 -18
  236. package/dist/formControlState-vgaj2ksH.js +10 -0
  237. package/dist/generateUtilityClasses-C3ivN9Ie.js +2973 -0
  238. package/dist/{helpers-B4UL9NMD.js → helpers-D4uXfBfO.js} +2 -2
  239. package/dist/index-BtlzPygz.js +470 -0
  240. package/dist/index-DH6qsPBn.js +153 -0
  241. package/dist/{index-syTc6m_V.js → index-e9xTIYWt.js} +87 -87
  242. package/dist/main.d.ts +1722 -562
  243. package/dist/main.js +161 -128
  244. package/dist/ownerWindow-wg6foiOE.js +10 -0
  245. package/dist/setPrototypeOf-NPgp4cYc.js +8 -0
  246. package/dist/styled-Db1RdcPA.js +323 -0
  247. package/dist/unsupportedProp-DuqR2hj9.js +36 -0
  248. package/dist/useId-BW-oWmul.js +19 -0
  249. package/dist/useMobilePicker-CY8ndYRL.js +8279 -0
  250. package/dist/useSlot-B_Q4vnX5.js +42 -0
  251. package/package.json +15 -7
  252. package/dist/AccordionSummary-DgAwVTk8.js +0 -742
  253. package/dist/Add-DJLrrVHm.js +0 -382
  254. package/dist/Box-p6OtTUEo.js +0 -30
  255. package/dist/ButtonBase-2bPw77UP.js +0 -961
  256. package/dist/CardContent-CSHh-ZlM.js +0 -74
  257. package/dist/Checkbox-CWRMFTBp.js +0 -421
  258. package/dist/FormControl-BLbrq4C7.js +0 -1636
  259. package/dist/FormControlLabel-C8SPv14J.js +0 -195
  260. package/dist/InputAdornment-DLxWUE6H.js +0 -157
  261. package/dist/List-tqElle9C.js +0 -121
  262. package/dist/ListItem-CfjsIg4B.js +0 -430
  263. package/dist/Modal-DhPpOoGB.js +0 -1299
  264. package/dist/Paper-2B03OBmZ.js +0 -169
  265. package/dist/Select-BgYwkZgI.js +0 -2613
  266. package/dist/TextField-1yCesIbH.js +0 -457
  267. package/dist/assertThisInitialized-BUtkG-md.js +0 -13
  268. package/dist/capitalize-ciszXJ7R.js +0 -9
  269. package/dist/components/instance-form/components/composite-list/styled.js +0 -73
  270. package/dist/components/instance-form/components/composite-matrix/components/editor/styled.js +0 -1
  271. package/dist/components/instance-form/components/composite-matrix/styled.js +0 -69
  272. package/dist/components/key-protection/index.js +0 -4
  273. package/dist/components/key-protection/menu.js +0 -85
  274. package/dist/components/key-protection/utils.js +0 -10
  275. package/dist/components/treeview-filter/item/styled.js +0 -39
  276. package/dist/createSvgIcon-BjpIhJ30.js +0 -71
  277. package/dist/createTheme-DYxDnE9u.js +0 -612
  278. package/dist/index-BMS1Otro.js +0 -183
  279. package/dist/index-CcdvNlgr.js +0 -503
  280. package/dist/index-kCJ_Zvl8.js +0 -34
  281. package/dist/isHostComponent-kiaBvYVo.js +0 -6
  282. package/dist/isMuiElement-CxT3_ACP.js +0 -13
  283. package/dist/listItemTextClasses-C3lndiXO.js +0 -16
  284. package/dist/property-list-form-zZQfpR0X.js +0 -386
  285. package/dist/styled-eZwjUruw.js +0 -12
  286. package/dist/unsupportedProp-BND8AB6O.js +0 -25
  287. package/dist/useId-B4-oF9Mq.js +0 -34
  288. package/dist/useMobilePicker-BLg3Blg8.js +0 -7589
  289. package/dist/useThemeProps-BzzHcQyd.js +0 -58
  290. package/dist/utils-BDNynJcd.js +0 -365
  291. package/dist/utils-Bq0ye5vf.js +0 -115
@@ -1,77 +1,35 @@
1
- import { jsx as t, jsxs as c, Fragment as pe } from "react/jsx-runtime";
2
- import Fe from "lodash";
3
- import p, { useRef as ke } from "react";
4
- import { useForm as Ee, Controller as h } from "react-hook-form";
5
- import { Box as l, Typography as y, TextField as x, FormHelperText as ve, FormGroup as Pe, FormControlLabel as ye, Checkbox as ge, Button as C } from "@mui/material";
6
- import { getNestedChildrenFromMap as Re } from "../../utils/ontology.js";
7
- import { ConditionalWrapper as m } from "../conditional-wrapper/index.js";
1
+ import { jsxs as s, jsx as t, Fragment as se } from "react/jsx-runtime";
2
+ import { TextField as b, FormControlLabel as me, Checkbox as ue } from "@mui/material";
3
+ import pe from "react";
4
+ import { Controller as u } from "react-hook-form";
5
+ import { ConditionalWrapper as d } from "../conditional-wrapper/index.js";
8
6
  import { Container as Be } from "../container/index.js";
9
- import { DisseminationList as Ae } from "../data-security-selectors/dissemination-list/index.js";
10
- import { SecurityLevel as De } from "../data-security-selectors/security-level/index.js";
11
- import { i as Ne, d as _e } from "../../utils-Bq0ye5vf.js";
12
- import { TreeSelect as We } from "../tree-select/index.js";
13
- import qe from "./components/policy-list/index.js";
14
- import L from "./components/TopLabelWrapper.js";
15
- import $e from "./components/variables/index.js";
16
- const Ke = {
17
- alg: "A256GCM",
18
- ext: !0,
19
- k: "_El6rHQxC5E7NdO5DiMDITjF7f65wrlaJmFVagVE9Ic",
20
- key_ops: ["encrypt", "decrypt"],
21
- kty: "oct"
22
- };
23
- function Me(e, be) {
24
- var P, R, B, A, D, N, _, W, q, $, K, M, U, j, G, H, J, Q, Y, z, X, Z, ee, te, ie, ne, le, ae, de, re, oe, ce, se, me, fe, ue;
25
- const V = ke(null), {
26
- register: S,
27
- handleSubmit: xe,
28
- control: f,
29
- formState: { errors: Te, isDirty: F },
30
- getValues: k,
31
- setValue: T,
32
- reset: we,
33
- watch: I
34
- } = Ee({
35
- defaultValues: e.defaultValues
36
- }), a = (e == null ? void 0 : e.labelPosition) ?? "default", [Ie, Oe] = p.useState([]), [w, E] = p.useState(), [Ue, Ce] = p.useState(0), Le = p.useMemo(() => {
37
- const i = [];
38
- return e.mappedTemplates.forEach((n) => {
39
- n.creatable || i.push(String(n.id));
40
- }), i;
41
- }, [e.mappedTemplates]);
42
- p.useEffect(() => {
43
- (async () => {
44
- const i = { ...e.defaultValues }, n = e.mappedTemplates.get(i.templateId);
45
- if (n) {
46
- const r = n.properties.filter(
47
- (o) => o.privacyPreservationMethod === "ENCRYPTION"
48
- );
49
- if (r.length > 0)
50
- for (let o = 0; o < r.length; o++) {
51
- const d = r[o], s = Fe.get(i, `variables.${d.propertyId}`);
52
- if (s && e.keyAuth) {
53
- const u = await Ne(Ke), g = await _e(u, String(s));
54
- g.data && (T(`variables.${d.propertyId}`, g.data), Ce((b) => b + 1));
55
- }
56
- }
57
- }
58
- })();
59
- }, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
60
- const O = () => {
61
- const i = k("templateId");
62
- w && E(void 0);
63
- const n = Re(e.mappedTemplates);
64
- Oe(n);
65
- for (const r of e.mappedTemplates.values())
66
- if (r.id === i) {
67
- E(r);
68
- break;
69
- }
70
- };
71
- p.useImperativeHandle(be, () => ({
7
+ import { DisseminationList as Re } from "../data-security-selectors/dissemination-list/index.js";
8
+ import { SecurityLevel as Pe } from "../data-security-selectors/security-level/index.js";
9
+ import { TreeSelect as ke } from "../tree-select/index.js";
10
+ import { PolicyList as We } from "./components/policy-list/index.js";
11
+ import g from "./components/TopLabelWrapper.js";
12
+ import { Variables as Ae } from "./components/variables/index.js";
13
+ import { leftLayoutWrapper as h } from "./helpers.js";
14
+ import { useInstanceFormLogic as De } from "./logic.js";
15
+ import { InstanceFormForm as Ee, FieldContainer as p, CharCount as fe, TemplateGroup as qe, SecurityLevelContainer as Ue, ActionsRow as Ne, CancelButton as $e, SaveButtonsContainer as Ge, SaveButton as he, InstanceFormRoot as _e, CONTAINER_SX as je } from "./styled.js";
16
+ function He(e, ve) {
17
+ var V, w, S, F, B, R, P, k, W, A, D, E, q, U, N, $, G, _, j, H, X, z, J, K, M, Q, Y, Z, ee, te, ie, ne, ae, le, re, de;
18
+ const { refs: T, state: be, form: Ce, actions: o } = De(e), {
19
+ ownerState: y,
20
+ templates: Oe,
21
+ selectedTemplate: xe,
22
+ disabledTemplates: Le,
23
+ labelPosition: n,
24
+ loading: C,
25
+ hasPolicyList: ge,
26
+ errors: Te,
27
+ isDirty: ye
28
+ } = be, { register: I, handleSubmit: Ie, control: m, getValues: Ve, setValue: O, reset: we, watch: x } = Ce;
29
+ pe.useImperativeHandle(ve, () => ({
72
30
  requestSubmit() {
73
31
  var i;
74
- (i = V.current) == null || i.requestSubmit();
32
+ (i = T.formRef.current) == null || i.requestSubmit();
75
33
  },
76
34
  resetForm() {
77
35
  we({
@@ -79,501 +37,427 @@ function Me(e, be) {
79
37
  description: "",
80
38
  templateId: 0,
81
39
  variables: {}
82
- }), O();
40
+ }), o.handleTemplates();
83
41
  },
84
- setFormValue(i, n) {
85
- T(i, n);
42
+ setFormValue(i, a) {
43
+ O(i, a);
86
44
  },
87
45
  getFormValue(i) {
88
- return k(i);
46
+ return Ve(i);
89
47
  },
90
48
  isDirty() {
91
- return F;
49
+ return ye;
92
50
  },
93
51
  getWatchedValue(i) {
94
- return I(i);
95
- }
96
- })), p.useEffect(() => (O(), () => {
97
- }), [e.mappedTemplates]), p.useEffect(() => {
98
- e.onSelectedTemplateChange && e.onSelectedTemplateChange(w);
99
- }, [w]);
100
- const Ve = () => {
101
- if (e.onCancel) {
102
- e.onCancel(F);
103
- return;
52
+ return x(i);
104
53
  }
105
- }, v = (i) => {
106
- var o, d;
107
- if (!i) return;
108
- const n = (d = (o = e == null ? void 0 : e.fieldOptions) == null ? void 0 : o[i]) == null ? void 0 : d.maxChar;
109
- return n != null && !Number.isNaN(Number(n)) ? Number(n) : void 0;
110
- };
111
- return /* @__PURE__ */ t(
112
- m,
54
+ }));
55
+ const Se = /* @__PURE__ */ s(
56
+ Ee,
113
57
  {
114
- condition: e.variant === void 0 || e.variant === "inline",
115
- wrapper: (i) => /* @__PURE__ */ t(
116
- Be,
117
- {
118
- disableHeader: !0,
119
- sx: { position: "relative", overflow: "visible" },
120
- children: i
121
- }
122
- ),
123
- children: /* @__PURE__ */ c(
124
- "form",
125
- {
126
- ref: V,
127
- onSubmit: xe(e.onSubmit),
128
- style: { display: "flex", flexDirection: "column" },
129
- children: [
130
- !((R = (P = e.fieldOptions) == null ? void 0 : P.title) != null && R.hidden) && /* @__PURE__ */ t(
131
- m,
132
- {
133
- condition: a === "left",
134
- wrapper: (i) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
135
- /* @__PURE__ */ t(y, { width: "32%", children: "Title *" }),
136
- /* @__PURE__ */ t(l, { width: "68%", children: i })
137
- ] }),
138
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
139
- /* @__PURE__ */ t(
140
- m,
141
- {
142
- condition: a === "top",
143
- wrapper: L("Title", !0),
144
- children: /* @__PURE__ */ t(
145
- x,
146
- {
147
- label: a === "default" ? "Title *" : void 0,
148
- variant: e.inputVariant,
149
- placeholder: ((A = (B = e.fieldOptions) == null ? void 0 : B.title) == null ? void 0 : A.placeholder) ?? "",
150
- inputProps: v("title") ? { maxLength: v("title") } : void 0,
151
- fullWidth: !0,
152
- ...S("title", { required: !0 }),
153
- ...Te.title && {
154
- helperText: "This field is required!",
155
- error: !0
156
- }
157
- }
158
- )
159
- }
160
- ),
161
- v("title") && /* @__PURE__ */ t(ve, { sx: { textAlign: "right", mt: 0.5 }, children: `${(D = I("title")) == null ? void 0 : D.length}/${v("title")}` }),
162
- e.fieldOptions && ((N = e.fieldOptions.title) == null ? void 0 : N.helperText)
163
- ] })
164
- }
165
- ),
166
- !((W = (_ = e.fieldOptions) == null ? void 0 : _.description) != null && W.hidden) && /* @__PURE__ */ t(pe, { children: ($ = (q = e.fieldOptions) == null ? void 0 : q.description) != null && $.component ? e.fieldOptions.description.component : (
167
- // Otherwise fallback to TextField
58
+ ref: T.formRef,
59
+ onSubmit: Ie(e.onSubmit),
60
+ children: [
61
+ !((w = (V = e.fieldOptions) == null ? void 0 : V.title) != null && w.hidden) && /* @__PURE__ */ t(
62
+ d,
63
+ {
64
+ condition: n === "left",
65
+ wrapper: h("Title *"),
66
+ children: /* @__PURE__ */ s(p, { children: [
168
67
  /* @__PURE__ */ t(
169
- m,
68
+ d,
170
69
  {
171
- condition: a === "left",
172
- wrapper: (i) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
173
- /* @__PURE__ */ t(y, { width: "32%", children: "Description" }),
174
- /* @__PURE__ */ t(l, { width: "68%", children: i })
175
- ] }),
176
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
177
- /* @__PURE__ */ t(
178
- m,
179
- {
180
- condition: a === "top",
181
- wrapper: L("Description", !1),
182
- children: /* @__PURE__ */ t(
183
- x,
184
- {
185
- label: a === "default" ? "Description" : void 0,
186
- inputProps: v("description") ? { maxLength: v("description") } : void 0,
187
- placeholder: ((M = (K = e.fieldOptions) == null ? void 0 : K.description) == null ? void 0 : M.placeholder) ?? "",
188
- variant: e.inputVariant,
189
- fullWidth: !0,
190
- multiline: !0,
191
- minRows: (j = (U = e.fieldOptions) == null ? void 0 : U.description) == null ? void 0 : j.minRows,
192
- ...S("description")
193
- }
194
- )
195
- }
196
- ),
197
- v("description") && /* @__PURE__ */ t(ve, { sx: { textAlign: "right", mt: 0.5 }, children: `${(G = I("description")) == null ? void 0 : G.length}/${v(
198
- "description"
199
- )}` }),
200
- (J = (H = e.fieldOptions) == null ? void 0 : H.description) == null ? void 0 : J.helperText
201
- ] })
202
- }
203
- )
204
- ) }),
205
- !((Y = (Q = e.fieldOptions) == null ? void 0 : Q.templateId) != null && Y.hidden) && /* @__PURE__ */ t(
206
- m,
207
- {
208
- condition: a === "left",
209
- wrapper: (i) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
210
- /* @__PURE__ */ t(y, { width: "32%", children: "Template" }),
211
- /* @__PURE__ */ t(l, { width: "68%", children: i })
212
- ] }),
213
- children: /* @__PURE__ */ c(Pe, { sx: { mb: 2 }, children: [
214
- /* @__PURE__ */ t(
215
- m,
70
+ condition: n === "top",
71
+ wrapper: g("Title", !0),
72
+ children: /* @__PURE__ */ t(
73
+ b,
216
74
  {
217
- condition: a === "top",
218
- wrapper: L("Template", !1),
219
- children: /* @__PURE__ */ t(
220
- h,
221
- {
222
- name: "templateId",
223
- control: f,
224
- render: ({ field: { value: i, onChange: n } }) => {
225
- var r, o;
226
- if ((o = (r = e.fieldOptions) == null ? void 0 : r.templateId) != null && o.disabled) {
227
- const d = i ? e.mappedTemplates.get(i) : void 0;
228
- return /* @__PURE__ */ t(
229
- x,
230
- {
231
- label: a === "default" ? "Template" : void 0,
232
- variant: e.inputVariant,
233
- fullWidth: !0,
234
- disabled: !0,
235
- value: d == null ? void 0 : d.name,
236
- InputLabelProps: {
237
- shrink: a === "default" ? !0 : void 0
238
- }
239
- }
240
- );
241
- }
242
- return /* @__PURE__ */ t(
243
- We,
244
- {
245
- label: a === "default" ? "Template" : void 0,
246
- data: Ie,
247
- selected: i === 0 ? "" : [String(i)],
248
- disabled: Le,
249
- variant: e.inputVariant,
250
- onChange: (d, s) => {
251
- const u = {
252
- target: {
253
- value: s ? Number(d) : 0
254
- }
255
- };
256
- n(u), O();
257
- }
258
- }
259
- );
260
- }
261
- }
262
- )
263
- }
264
- ),
265
- e.fieldOptions && ((z = e.fieldOptions.templateId) == null ? void 0 : z.helperText)
266
- ] })
267
- }
268
- ),
269
- "aliasList" in e.defaultValues && !((Z = (X = e.fieldOptions) == null ? void 0 : X.aliasList) != null && Z.hidden) && /* @__PURE__ */ t(
270
- h,
271
- {
272
- name: "aliasList",
273
- control: f,
274
- render: ({ field: { value: i, onChange: n, ...r } }) => {
275
- var d;
276
- const o = (s) => {
277
- const b = {
278
- target: {
279
- value: s.target.value.split(",").map((he) => he.trimStart())
75
+ label: n === "default" ? "Title *" : void 0,
76
+ variant: e.inputVariant,
77
+ placeholder: ((F = (S = e.fieldOptions) == null ? void 0 : S.title) == null ? void 0 : F.placeholder) ?? "",
78
+ inputProps: o.maxCharValidation("title") ? { maxLength: o.maxCharValidation("title") } : void 0,
79
+ fullWidth: !0,
80
+ ...I("title", { required: !0 }),
81
+ ...Te.title && {
82
+ helperText: "This field is required!",
83
+ error: !0
280
84
  }
281
- };
282
- n(b);
283
- };
284
- return /* @__PURE__ */ t(
285
- m,
286
- {
287
- condition: a === "left",
288
- wrapper: (s) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
289
- /* @__PURE__ */ t(y, { width: "32%", children: "Alias List" }),
290
- /* @__PURE__ */ t(l, { width: "68%", children: s })
291
- ] }),
292
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
293
- /* @__PURE__ */ t(
294
- x,
295
- {
296
- label: a === "default" ? "Alias List" : void 0,
297
- variant: e.inputVariant,
298
- fullWidth: !0,
299
- value: i,
300
- helperText: "Add list values with the comma (,) separated string",
301
- onChange: o,
302
- ...r
303
- }
304
- ),
305
- e.fieldOptions && ((d = e.fieldOptions.aliasList) == null ? void 0 : d.helperText)
306
- ] })
307
85
  }
308
- );
86
+ )
309
87
  }
310
- }
311
- ),
312
- "appliedPolicies" in e.defaultValues && !((te = (ee = e.fieldOptions) == null ? void 0 : ee.appliedPolicies) != null && te.hidden) && /* @__PURE__ */ t(
313
- h,
314
- {
315
- name: "appliedPolicies",
316
- control: f,
317
- render: ({ field: { value: i, onChange: n } }) => {
318
- var r;
319
- return /* @__PURE__ */ t(
320
- m,
88
+ ),
89
+ o.maxCharValidation("title") && /* @__PURE__ */ t(fe, { children: `${(B = x("title")) == null ? void 0 : B.length}/${o.maxCharValidation("title")}` }),
90
+ e.fieldOptions && ((R = e.fieldOptions.title) == null ? void 0 : R.helperText)
91
+ ] })
92
+ }
93
+ ),
94
+ !((k = (P = e.fieldOptions) == null ? void 0 : P.description) != null && k.hidden) && /* @__PURE__ */ t(se, { children: (A = (W = e.fieldOptions) == null ? void 0 : W.description) != null && A.component ? e.fieldOptions.description.component : /* @__PURE__ */ t(
95
+ d,
96
+ {
97
+ condition: n === "left",
98
+ wrapper: h("Description"),
99
+ children: /* @__PURE__ */ s(p, { children: [
100
+ /* @__PURE__ */ t(
101
+ d,
102
+ {
103
+ condition: n === "top",
104
+ wrapper: g("Description", !1),
105
+ children: /* @__PURE__ */ t(
106
+ b,
321
107
  {
322
- condition: a === "left",
323
- wrapper: (o) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
324
- /* @__PURE__ */ t(y, { width: "32%", children: "Policy List" }),
325
- /* @__PURE__ */ t(l, { width: "68%", children: o })
326
- ] }),
327
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
328
- /* @__PURE__ */ t(
329
- qe,
330
- {
331
- policyList: e.policyList,
332
- labelPosition: a,
333
- value: i || void 0,
334
- onChange: n
335
- }
336
- ),
337
- e.fieldOptions && ((r = e.fieldOptions.appliedPolicies) == null ? void 0 : r.helperText)
338
- ] })
108
+ label: n === "default" ? "Description" : void 0,
109
+ inputProps: o.maxCharValidation("description") ? {
110
+ maxLength: o.maxCharValidation("description")
111
+ } : void 0,
112
+ placeholder: ((E = (D = e.fieldOptions) == null ? void 0 : D.description) == null ? void 0 : E.placeholder) ?? "",
113
+ variant: e.inputVariant,
114
+ fullWidth: !0,
115
+ multiline: !0,
116
+ minRows: (U = (q = e.fieldOptions) == null ? void 0 : q.description) == null ? void 0 : U.minRows,
117
+ ...I("description")
339
118
  }
340
- );
119
+ )
341
120
  }
342
- }
343
- ),
344
- /* @__PURE__ */ t(
345
- h,
346
- {
347
- name: "variables",
348
- control: f,
349
- render: ({ field: { value: i, onChange: n } }) => /* @__PURE__ */ t(
350
- $e,
351
- {
352
- template: w,
353
- value: i,
354
- mapboxAccessToken: e.mapboxAccessToken,
355
- variant: e.inputVariant,
356
- labelPosition: a,
357
- fieldOptions: e.fieldOptions,
358
- onChange: n
359
- }
360
- )
361
- }
362
- ),
363
- "fileInBase64" in e.defaultValues && !((ne = (ie = e.fieldOptions) == null ? void 0 : ie.fileInBase64) != null && ne.hidden) && /* @__PURE__ */ c(pe, { children: [
121
+ ),
122
+ o.maxCharValidation("description") && /* @__PURE__ */ t(fe, { children: `${(N = x("description")) == null ? void 0 : N.length}/${o.maxCharValidation(
123
+ "description"
124
+ )}` }),
125
+ (G = ($ = e.fieldOptions) == null ? void 0 : $.description) == null ? void 0 : G.helperText
126
+ ] })
127
+ }
128
+ ) }),
129
+ !((j = (_ = e.fieldOptions) == null ? void 0 : _.templateId) != null && j.hidden) && /* @__PURE__ */ t(
130
+ d,
131
+ {
132
+ condition: n === "left",
133
+ wrapper: h("Template"),
134
+ children: /* @__PURE__ */ s(qe, { children: [
364
135
  /* @__PURE__ */ t(
365
- h,
136
+ d,
366
137
  {
367
- name: "fileInBase64",
368
- control: f,
369
- render: ({ field: { onChange: i, value: n, ...r } }) => {
370
- var d;
371
- const o = (s) => {
372
- if (s.target.files) {
373
- const u = new FileReader();
374
- u.onload = async (b) => {
375
- const Se = b.target.result.split("base64,")[1];
376
- i(Se);
377
- };
378
- const g = s.target.files[0];
379
- T("originalFileName", g.name), T("contentType", g.type), u.readAsDataURL(g);
380
- }
381
- };
382
- return /* @__PURE__ */ t(
383
- m,
384
- {
385
- condition: a === "left",
386
- wrapper: (s) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
387
- /* @__PURE__ */ t(y, { width: "32%", children: "File to Upload" }),
388
- /* @__PURE__ */ t(l, { width: "68%", children: s })
389
- ] }),
390
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
391
- /* @__PURE__ */ t(
392
- x,
138
+ condition: n === "top",
139
+ wrapper: g("Template", !1),
140
+ children: /* @__PURE__ */ t(
141
+ u,
142
+ {
143
+ name: "templateId",
144
+ control: m,
145
+ render: ({ field: { value: i, onChange: a } }) => {
146
+ var r, c;
147
+ if ((c = (r = e.fieldOptions) == null ? void 0 : r.templateId) != null && c.disabled) {
148
+ const l = i ? e.templates.get(i) : void 0;
149
+ return /* @__PURE__ */ t(
150
+ b,
393
151
  {
394
- type: "file",
395
- label: a === "default" ? "File to Upload" : void 0,
152
+ label: n === "default" ? "Template" : void 0,
396
153
  variant: e.inputVariant,
397
154
  fullWidth: !0,
398
- helperText: "Select a file to upload",
399
- InputLabelProps: { shrink: !0 },
400
- onChange: o,
401
- ...r
155
+ disabled: !0,
156
+ value: l == null ? void 0 : l.name,
157
+ InputLabelProps: {
158
+ shrink: n === "default" ? !0 : void 0
159
+ }
160
+ }
161
+ );
162
+ }
163
+ return /* @__PURE__ */ t(
164
+ ke,
165
+ {
166
+ label: n === "default" ? "Template" : void 0,
167
+ data: Oe,
168
+ selected: i === 0 ? "" : [String(i)],
169
+ disabled: Le,
170
+ variant: e.inputVariant,
171
+ onChange: (l, f) => {
172
+ const v = {
173
+ target: { value: f ? Number(l) : 0 }
174
+ };
175
+ a(v), o.handleTemplates();
402
176
  }
403
- ),
404
- e.fieldOptions && ((d = e.fieldOptions.fileInBase64) == null ? void 0 : d.helperText)
405
- ] })
177
+ }
178
+ );
406
179
  }
407
- );
408
- }
180
+ }
181
+ )
409
182
  }
410
183
  ),
411
- !((ae = (le = e.fieldOptions) == null ? void 0 : le.redacted) != null && ae.hidden) && /* @__PURE__ */ t(
412
- m,
184
+ e.fieldOptions && ((H = e.fieldOptions.templateId) == null ? void 0 : H.helperText)
185
+ ] })
186
+ }
187
+ ),
188
+ "aliasList" in (e.values ?? {}) && !((z = (X = e.fieldOptions) == null ? void 0 : X.aliasList) != null && z.hidden) && /* @__PURE__ */ t(
189
+ u,
190
+ {
191
+ name: "aliasList",
192
+ control: m,
193
+ render: ({ field: { value: i, onChange: a, ...r } }) => {
194
+ var l;
195
+ const c = (f) => {
196
+ const L = f.target.value.split(",").map((oe) => oe.trimStart());
197
+ a({ target: { value: L } });
198
+ };
199
+ return /* @__PURE__ */ t(
200
+ d,
413
201
  {
414
- condition: a === "left",
415
- wrapper: (i) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
416
- /* @__PURE__ */ t(y, { width: "32%", children: "Redacted" }),
417
- /* @__PURE__ */ t(l, { width: "68%", children: i })
418
- ] }),
419
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
202
+ condition: n === "left",
203
+ wrapper: h("Alias List"),
204
+ children: /* @__PURE__ */ s(p, { children: [
420
205
  /* @__PURE__ */ t(
421
- ye,
206
+ b,
422
207
  {
423
- control: /* @__PURE__ */ t(
424
- h,
425
- {
426
- name: "redacted",
427
- control: f,
428
- render: ({ field: { value: i, ...n } }) => /* @__PURE__ */ t(ge, { checked: !!i, ...n })
429
- }
430
- ),
431
- label: a === "default" ? "Redacted" : void 0
208
+ label: n === "default" ? "Alias List" : void 0,
209
+ variant: e.inputVariant,
210
+ fullWidth: !0,
211
+ value: i,
212
+ helperText: "Add list values with the comma (,) separated string",
213
+ onChange: c,
214
+ ...r
432
215
  }
433
216
  ),
434
- e.fieldOptions && ((de = e.fieldOptions.redacted) == null ? void 0 : de.helperText)
217
+ e.fieldOptions && ((l = e.fieldOptions.aliasList) == null ? void 0 : l.helperText)
435
218
  ] })
436
219
  }
437
- ),
438
- !((oe = (re = e.fieldOptions) == null ? void 0 : re.contentEncrypted) != null && oe.hidden) && /* @__PURE__ */ t(
439
- m,
220
+ );
221
+ }
222
+ }
223
+ ),
224
+ ge && "appliedPolicies" in (e.values ?? {}) && !((K = (J = e.fieldOptions) == null ? void 0 : J.appliedPolicies) != null && K.hidden) && /* @__PURE__ */ t(
225
+ u,
226
+ {
227
+ name: "appliedPolicies",
228
+ control: m,
229
+ render: ({ field: { value: i, onChange: a } }) => {
230
+ var r;
231
+ return /* @__PURE__ */ t(
232
+ d,
440
233
  {
441
- condition: a === "left",
442
- wrapper: (i) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
443
- /* @__PURE__ */ t(y, { width: "32%", children: "Content Encrypted" }),
444
- /* @__PURE__ */ t(l, { width: "68%", children: i })
445
- ] }),
446
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
234
+ condition: n === "left",
235
+ wrapper: h("Policy List"),
236
+ children: /* @__PURE__ */ s(p, { children: [
447
237
  /* @__PURE__ */ t(
448
- ye,
238
+ We,
449
239
  {
450
- control: /* @__PURE__ */ t(
451
- h,
452
- {
453
- name: "contentEncrypted",
454
- control: f,
455
- render: ({ field: { value: i, ...n } }) => /* @__PURE__ */ t(ge, { checked: !!i, ...n })
456
- }
457
- ),
458
- label: a === "default" ? "Content Encrypted" : void 0
240
+ policyList: e.policyList ?? [],
241
+ labelPosition: n,
242
+ value: i || void 0,
243
+ onChange: a
459
244
  }
460
245
  ),
461
- e.fieldOptions && ((ce = e.fieldOptions.contentEncrypted) == null ? void 0 : ce.helperText)
246
+ e.fieldOptions && ((r = e.fieldOptions.appliedPolicies) == null ? void 0 : r.helperText)
462
247
  ] })
463
248
  }
464
- )
465
- ] }),
466
- !((me = (se = e.fieldOptions) == null ? void 0 : se.disseminationList) != null && me.hidden) && /* @__PURE__ */ t(
467
- h,
249
+ );
250
+ }
251
+ }
252
+ ),
253
+ /* @__PURE__ */ t(
254
+ u,
255
+ {
256
+ name: "variables",
257
+ control: m,
258
+ render: ({ field: { value: i, onChange: a } }) => /* @__PURE__ */ t(
259
+ Ae,
468
260
  {
469
- name: "disseminationList",
470
- rules: {
471
- required: !0
472
- },
473
- control: f,
474
- render: ({ field: { value: i, onChange: n }, fieldState: r }) => {
475
- const o = i || [], d = (s) => {
476
- n(s);
477
- };
478
- return /* @__PURE__ */ t(
479
- Ae,
480
- {
481
- selectedIds: o,
482
- memberedGroups: e.memberedGroups,
483
- showError: !!r.error,
484
- variant: e.inputVariant,
485
- labelPosition: a,
486
- onChange: d
487
- }
488
- );
489
- }
261
+ template: xe,
262
+ value: i,
263
+ mapboxAccessToken: e.mapboxAccessToken,
264
+ variant: e.inputVariant,
265
+ labelPosition: n,
266
+ fieldOptions: e.fieldOptions,
267
+ onChange: a
490
268
  }
491
- ),
492
- !((ue = (fe = e.fieldOptions) == null ? void 0 : fe.securityLevelId) != null && ue.hidden) && /* @__PURE__ */ t(l, { mt: 2, children: /* @__PURE__ */ t(
493
- h,
494
- {
495
- name: "securityLevelId",
496
- rules: {
497
- required: !0
498
- },
499
- control: f,
500
- render: ({ field: { value: i, onChange: n }, fieldState: r }) => {
501
- var d, s;
502
- const o = (u) => {
503
- n(u);
269
+ )
270
+ }
271
+ ),
272
+ "fileInBase64" in (e.values ?? {}) && !((Q = (M = e.fieldOptions) == null ? void 0 : M.fileInBase64) != null && Q.hidden) && /* @__PURE__ */ s(se, { children: [
273
+ /* @__PURE__ */ t(
274
+ u,
275
+ {
276
+ name: "fileInBase64",
277
+ control: m,
278
+ render: ({ field: { onChange: i, ...a } }) => {
279
+ var c;
280
+ const r = (l) => {
281
+ if (!l.target.files) return;
282
+ const f = new FileReader();
283
+ f.onload = (L) => {
284
+ var ce;
285
+ const Fe = ((ce = L.target) == null ? void 0 : ce.result).split("base64,")[1];
286
+ i(Fe);
504
287
  };
505
- return /* @__PURE__ */ t(
506
- De,
507
- {
508
- value: i || 0,
509
- ontologyId: e.ontologyId,
510
- appRoles: e.appRoles,
511
- securityLevels: e.securityLevels,
512
- minLevelId: e.minSecurityLevel,
513
- templateKeys: (d = e.securityLevelConfig) == null ? void 0 : d.templateKeys,
514
- templateType: (s = e.securityLevelConfig) == null ? void 0 : s.templateType,
515
- showError: !!r.error,
516
- variant: e.inputVariant,
517
- labelPosition: a,
518
- onChange: o
519
- }
520
- );
521
- }
522
- }
523
- ) }),
524
- /* @__PURE__ */ c(
525
- l,
526
- {
527
- display: "flex",
528
- justifyContent: "space-between",
529
- mt: 3,
530
- width: "100%",
531
- children: [
532
- e.onCancel && /* @__PURE__ */ t(
533
- C,
534
- {
535
- color: "primary",
536
- variant: "text",
537
- disabled: e.loading,
538
- sx: { textTransform: "none" },
539
- onClick: Ve,
540
- children: "Cancel"
541
- }
542
- ),
543
- /* @__PURE__ */ t(l, { sx: { flex: e.onCancel ? "none" : 1 }, children: e.customSaveButtons ? e.customSaveButtons : e.saveButtons ? e.saveButtons.map((i, n) => /* @__PURE__ */ t(
544
- C,
545
- {
546
- type: "submit",
547
- color: "primary",
548
- variant: "contained",
549
- disabled: e.loading,
550
- startIcon: i.icon,
551
- sx: { ml: 1, textTransform: "none" },
552
- onClick: i.onClick,
553
- children: i.label
554
- },
555
- n
556
- )) : /* @__PURE__ */ t(
557
- C,
558
- {
559
- type: "submit",
560
- color: "primary",
561
- variant: "contained",
562
- disabled: e.loading,
563
- sx: { textTransform: "none" },
564
- children: e.loading ? "Saving..." : "Save"
565
- }
566
- ) })
567
- ]
288
+ const v = l.target.files[0];
289
+ O("originalFileName", v.name), O("contentType", v.type), f.readAsDataURL(v);
290
+ };
291
+ return /* @__PURE__ */ t(
292
+ d,
293
+ {
294
+ condition: n === "left",
295
+ wrapper: h("File to Upload"),
296
+ children: /* @__PURE__ */ s(p, { children: [
297
+ /* @__PURE__ */ t(
298
+ b,
299
+ {
300
+ type: "file",
301
+ label: n === "default" ? "File to Upload" : void 0,
302
+ variant: e.inputVariant,
303
+ fullWidth: !0,
304
+ helperText: "Select a file to upload",
305
+ InputLabelProps: { shrink: !0 },
306
+ onChange: r,
307
+ ...a
308
+ }
309
+ ),
310
+ e.fieldOptions && ((c = e.fieldOptions.fileInBase64) == null ? void 0 : c.helperText)
311
+ ] })
312
+ }
313
+ );
568
314
  }
569
- )
570
- ]
571
- }
572
- )
315
+ }
316
+ ),
317
+ !((Z = (Y = e.fieldOptions) == null ? void 0 : Y.redacted) != null && Z.hidden) && /* @__PURE__ */ t(
318
+ d,
319
+ {
320
+ condition: n === "left",
321
+ wrapper: h("Redacted"),
322
+ children: /* @__PURE__ */ s(p, { children: [
323
+ /* @__PURE__ */ t(
324
+ me,
325
+ {
326
+ control: /* @__PURE__ */ t(
327
+ u,
328
+ {
329
+ name: "redacted",
330
+ control: m,
331
+ render: ({ field: { value: i, ...a } }) => /* @__PURE__ */ t(ue, { checked: !!i, ...a })
332
+ }
333
+ ),
334
+ label: n === "default" ? "Redacted" : void 0
335
+ }
336
+ ),
337
+ e.fieldOptions && ((ee = e.fieldOptions.redacted) == null ? void 0 : ee.helperText)
338
+ ] })
339
+ }
340
+ ),
341
+ !((ie = (te = e.fieldOptions) == null ? void 0 : te.contentEncrypted) != null && ie.hidden) && /* @__PURE__ */ t(
342
+ d,
343
+ {
344
+ condition: n === "left",
345
+ wrapper: h("Content Encrypted"),
346
+ children: /* @__PURE__ */ s(p, { children: [
347
+ /* @__PURE__ */ t(
348
+ me,
349
+ {
350
+ control: /* @__PURE__ */ t(
351
+ u,
352
+ {
353
+ name: "contentEncrypted",
354
+ control: m,
355
+ render: ({ field: { value: i, ...a } }) => /* @__PURE__ */ t(ue, { checked: !!i, ...a })
356
+ }
357
+ ),
358
+ label: n === "default" ? "Content Encrypted" : void 0
359
+ }
360
+ ),
361
+ e.fieldOptions && ((ne = e.fieldOptions.contentEncrypted) == null ? void 0 : ne.helperText)
362
+ ] })
363
+ }
364
+ )
365
+ ] }),
366
+ !((le = (ae = e.fieldOptions) == null ? void 0 : ae.disseminationList) != null && le.hidden) && /* @__PURE__ */ t(
367
+ u,
368
+ {
369
+ name: "disseminationList",
370
+ rules: { required: !0 },
371
+ control: m,
372
+ render: ({ field: { value: i, onChange: a }, fieldState: r }) => {
373
+ const c = i || [], l = (f) => {
374
+ a(f);
375
+ };
376
+ return /* @__PURE__ */ t(
377
+ Re,
378
+ {
379
+ selectedIds: c,
380
+ memberedGroups: e.memberedGroups,
381
+ showError: !!r.error,
382
+ variant: e.inputVariant,
383
+ labelPosition: n,
384
+ onChange: l
385
+ }
386
+ );
387
+ }
388
+ }
389
+ ),
390
+ !((de = (re = e.fieldOptions) == null ? void 0 : re.securityLevelId) != null && de.hidden) && /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ t(
391
+ u,
392
+ {
393
+ name: "securityLevelId",
394
+ rules: { required: !0 },
395
+ control: m,
396
+ render: ({ field: { value: i, onChange: a }, fieldState: r }) => {
397
+ const c = (l) => {
398
+ a(l);
399
+ };
400
+ return /* @__PURE__ */ t(
401
+ Pe,
402
+ {
403
+ value: i || 0,
404
+ securityLevels: e.securityLevels,
405
+ showError: !!r.error,
406
+ variant: e.inputVariant,
407
+ labelPosition: n,
408
+ onChange: c
409
+ }
410
+ );
411
+ }
412
+ }
413
+ ) }),
414
+ /* @__PURE__ */ s(Ne, { children: [
415
+ e.onCancel && /* @__PURE__ */ t(
416
+ $e,
417
+ {
418
+ color: "primary",
419
+ variant: "text",
420
+ disabled: C,
421
+ onClick: o.handleOnCancel,
422
+ children: "Cancel"
423
+ }
424
+ ),
425
+ /* @__PURE__ */ t(Ge, { ownerState: y, children: e.customSaveButtons ? e.customSaveButtons : e.saveButtons ? e.saveButtons.map((i, a) => /* @__PURE__ */ t(
426
+ he,
427
+ {
428
+ type: "submit",
429
+ color: "primary",
430
+ variant: "contained",
431
+ disabled: C,
432
+ startIcon: i.icon,
433
+ onClick: i.onClick,
434
+ children: i.label
435
+ },
436
+ a
437
+ )) : /* @__PURE__ */ t(
438
+ he,
439
+ {
440
+ type: "submit",
441
+ color: "primary",
442
+ variant: "contained",
443
+ disabled: C,
444
+ children: C ? "Saving..." : "Save"
445
+ }
446
+ ) })
447
+ ] })
448
+ ]
573
449
  }
574
450
  );
451
+ return /* @__PURE__ */ t(_e, { ownerState: y, sx: e.sx, children: /* @__PURE__ */ t(
452
+ d,
453
+ {
454
+ condition: e.variant === void 0 || e.variant === "inline",
455
+ wrapper: (i) => /* @__PURE__ */ t(Be, { disableHeader: !0, sx: je, children: i }),
456
+ children: Se
457
+ }
458
+ ) });
575
459
  }
576
- const dt = p.forwardRef(Me);
460
+ const dt = pe.forwardRef(He);
577
461
  export {
578
462
  dt as InstanceForm
579
463
  };