@hybridcore/ui 1.0.2 → 1.1.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 (105) hide show
  1. package/dist/ButtonBase-BYmh3G5j.js +967 -0
  2. package/dist/CardContent-C8PxkJz4.js +73 -0
  3. package/dist/Checkbox-DostZSwR.js +673 -0
  4. package/dist/DialogContent-2aPOjKE7.js +2025 -0
  5. package/dist/FormControl-BiAFm76F.js +1491 -0
  6. package/dist/IconButton-CQJ8wZE8.js +183 -0
  7. package/dist/Input-Bf5G3tFN.js +324 -0
  8. package/dist/OutlinedInput-BEVE8VZQ.js +452 -0
  9. package/dist/Paper-CaiWdndQ.js +162 -0
  10. package/dist/Select-DxpxZbJp.js +2526 -0
  11. package/dist/Source-CnCcu5UP.js +4374 -0
  12. package/dist/Text-BT5kPHOo.js +2192 -0
  13. package/dist/Typography-XIiVCSto.js +178 -0
  14. package/dist/assertThisInitialized-BUtkG-md.js +13 -0
  15. package/dist/assets/index.css +1 -0
  16. package/dist/assets/index2.css +1 -0
  17. package/dist/chainPropTypes-DtBfUj5o.js +96 -0
  18. package/dist/components/access/helpers.js +32 -0
  19. package/dist/components/access/index.js +15 -0
  20. package/dist/components/card/index.js +159 -469
  21. package/dist/components/card/styled.js +75 -7
  22. package/dist/components/conditional-wrapper/index.js +9 -0
  23. package/dist/components/confirm/dialog.js +151 -0
  24. package/dist/components/confirm/index.js +23 -0
  25. package/dist/components/container/index.js +270 -0
  26. package/dist/components/context-menu/index.js +973 -0
  27. package/dist/components/data-management/instance-form/components/composite-list/index.js +12 -0
  28. package/dist/components/data-management/instance-form/components/composite-list/styled.js +64 -0
  29. package/dist/components/data-management/instance-form/components/policy-list/index.js +86 -0
  30. package/dist/components/data-management/instance-form/components/variable/index.js +15 -0
  31. package/dist/components/data-management/instance-form/components/variables/index.js +39 -0
  32. package/dist/components/data-management/instance-form/index.js +437 -0
  33. package/dist/components/data-security-selectors/dissemination-list/index.js +3201 -0
  34. package/dist/components/data-security-selectors/security-level/index.js +81 -0
  35. package/dist/components/date-time-picker/index.js +103 -0
  36. package/dist/components/geometry-picker/coordinate/index.js +93 -0
  37. package/dist/components/geometry-picker/edit/index.js +71 -0
  38. package/dist/components/geometry-picker/geometry/index.js +160 -0
  39. package/dist/components/geometry-picker/geometry/map-overlay.js +22 -0
  40. package/dist/components/geometry-picker/index.js +140 -0
  41. package/dist/components/geometry-picker/kml/index.js +62 -0
  42. package/dist/components/geometry-picker/kml/select-input-method.js +75 -0
  43. package/dist/components/geometry-picker/logic.js +69 -0
  44. package/dist/components/geometry-picker/map/index.js +42 -0
  45. package/dist/components/geometry-picker/map/logic.js +2360 -0
  46. package/dist/components/geometry-picker/map/style.js +88 -0
  47. package/dist/components/geometry-picker/parser/coordinate-input/index.js +78 -0
  48. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1305 -0
  49. package/dist/components/geometry-picker/parser/index.js +179 -0
  50. package/dist/components/geometry-picker/parser/logic.js +84 -0
  51. package/dist/components/geometry-picker/parser/styled.js +25 -0
  52. package/dist/components/geometry-picker/styled.js +48 -0
  53. package/dist/components/geometry-picker/wkt/index.js +59 -0
  54. package/dist/components/geometry-picker/wkt/select-input-method.js +75 -0
  55. package/dist/components/icon-button/index.js +18 -0
  56. package/dist/components/icon-button/styled.js +51 -0
  57. package/dist/components/key-protection/index.js +4 -0
  58. package/dist/components/key-protection/menu.js +85 -0
  59. package/dist/components/key-protection/utils.js +10 -0
  60. package/dist/components/loading/index.js +7 -0
  61. package/dist/components/loading/styled.js +16 -0
  62. package/dist/components/map/helpers/kml.js +45 -0
  63. package/dist/components/map/helpers/mapbox.js +48 -0
  64. package/dist/components/map/helpers/ol.js +25 -0
  65. package/dist/components/map/helpers/wkt.js +29 -0
  66. package/dist/components/map/index.js +8 -0
  67. package/dist/components/map/logic.js +140 -0
  68. package/dist/components/map/styled.js +8 -0
  69. package/dist/components/phone-input/index.js +25 -0
  70. package/dist/components/phone-input/styled.js +26 -0
  71. package/dist/components/search-input/index.js +76 -0
  72. package/dist/components/tree-select/index.js +70 -0
  73. package/dist/components/tree-select/styled.js +64 -0
  74. package/dist/components/treeview-filter/index.js +621 -0
  75. package/dist/components/treeview-filter/item/index.js +7 -0
  76. package/dist/components/treeview-filter/item-label/index.js +44 -0
  77. package/dist/createTheme-agWfFD64.js +2392 -0
  78. package/dist/exactProp-CI8dagM-.js +36 -0
  79. package/dist/extends-C3382pL0.js +22 -0
  80. package/dist/has-9_asnBxn.js +688 -0
  81. package/dist/hooks/useMenuLogic.js +21 -0
  82. package/dist/hooks/useToggle.js +23 -0
  83. package/dist/index-Bw_m9ult.js +1105 -0
  84. package/dist/index-IvOfmM1F.js +34 -0
  85. package/dist/index-wW2D1aTG.js +957 -0
  86. package/dist/isHostComponent-kiaBvYVo.js +6 -0
  87. package/dist/isMuiElement-CxT3_ACP.js +13 -0
  88. package/dist/listItemTextClasses-BvXFz-Oc.js +132 -0
  89. package/dist/main.d.ts +1317 -0
  90. package/dist/main.js +41 -2
  91. package/dist/ol-DXmSLlWv.js +15041 -0
  92. package/dist/ownerDocument-CUrv0DIK.js +6 -0
  93. package/dist/ownerWindow-niciwP7I.js +7 -0
  94. package/dist/styled-C43K9x7T.js +229 -0
  95. package/dist/styled-Iq9jsO4F.js +1033 -0
  96. package/dist/useFormControl-CatNKXAi.js +10 -0
  97. package/dist/useId-BHG98T5I.js +26 -0
  98. package/dist/useTheme-C0Dky5rV.js +17 -0
  99. package/dist/useTheme-CeyGVuQP.js +10 -0
  100. package/dist/useThemeProps-CzAjOL6F.js +26 -0
  101. package/dist/utils/ontology.js +37 -0
  102. package/dist/utils-Bq0ye5vf.js +115 -0
  103. package/dist/utils-DLpkeyhZ.js +365 -0
  104. package/package.json +26 -5
  105. package/dist/styled-BG5UIpPU.js +0 -3459
@@ -0,0 +1,12 @@
1
+ import "react/jsx-runtime";
2
+ import "@mui/material";
3
+ import "./styled.js";
4
+ import "@mui/icons-material";
5
+ import "../../../../../hooks/useToggle.js";
6
+ import { C as l } from "../../../../../index-Bw_m9ult.js";
7
+ import "react";
8
+ import "lodash";
9
+ import "dayjs";
10
+ export {
11
+ l as default
12
+ };
@@ -0,0 +1,64 @@
1
+ import { styled as i, Box as n, Button as r } from "@mui/material";
2
+ const p = i(n)(({ theme: o, variant: t }) => ({
3
+ position: "relative",
4
+ width: "100%",
5
+ ...t === "outlined" ? {
6
+ border: "1px solid",
7
+ padding: "2.5px 60px 2.5px 2.5px",
8
+ borderRadius: o.spacing(0.5),
9
+ "& .MuiButton-root": {
10
+ margin: "7px 8px"
11
+ }
12
+ } : {
13
+ borderBottom: "1px solid",
14
+ paddingBottom: o.spacing(0.5)
15
+ },
16
+ borderColor: o.palette.action.disabled,
17
+ "&:hover": {
18
+ borderColor: o.palette.action.active
19
+ }
20
+ })), d = i(n)(({ theme: o }) => ({
21
+ minHeight: 33,
22
+ whiteSpace: "normal",
23
+ "& .MuiChip-root": {
24
+ marginRight: o.spacing(0.5),
25
+ marginTop: o.spacing(0.5)
26
+ },
27
+ "& .MuiChip-root:first-of-type": {
28
+ marginLeft: 0
29
+ }
30
+ })), e = i(r)(({ theme: o, variant: t }) => ({
31
+ position: "absolute",
32
+ top: 0,
33
+ right: 0,
34
+ fontSize: 10,
35
+ padding: "3px 8px",
36
+ minWidth: "auto",
37
+ boxShadow: o.shadows[1],
38
+ textTransform: "none",
39
+ borderRadius: 13,
40
+ marginLeft: o.spacing(0.5),
41
+ "& .MuiButton-startIcon": {
42
+ marginRight: 0.25,
43
+ "& > :nth-of-type(1)": {
44
+ fontSize: 14
45
+ }
46
+ },
47
+ ...t === "contained" && {
48
+ "&:hover": {
49
+ backgroundColor: o.palette.grey[300],
50
+ boxShadow: o.shadows[1]
51
+ }
52
+ },
53
+ ...t === "text" && {
54
+ backgroundColor: o.palette.common.white,
55
+ "&:hover": {
56
+ backgroundColor: o.palette.grey[300]
57
+ }
58
+ }
59
+ }));
60
+ export {
61
+ p as Container,
62
+ e as MiniButton,
63
+ d as Values
64
+ };
@@ -0,0 +1,86 @@
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
+ import { Box as p, FormLabel as c } from "@mui/material";
3
+ import m from "react-select";
4
+ const f = ({
5
+ policyList: n,
6
+ value: l = [],
7
+ showError: t = !1,
8
+ variant: e = "standart",
9
+ onChange: r
10
+ }) => {
11
+ const d = (o) => {
12
+ r(o.map((a) => a.id));
13
+ };
14
+ return /* @__PURE__ */ s(
15
+ p,
16
+ {
17
+ sx: {
18
+ mb: 2,
19
+ ...e === "outlined" && {
20
+ position: "relative",
21
+ mt: 1.5,
22
+ zIndex: 9
23
+ }
24
+ },
25
+ children: [
26
+ /* @__PURE__ */ i(
27
+ c,
28
+ {
29
+ sx: {
30
+ display: "block",
31
+ ...t && {
32
+ color: (o) => o.palette.error.main
33
+ },
34
+ ...e === "outlined" && {
35
+ position: "absolute",
36
+ fontSize: "small",
37
+ zIndex: 1,
38
+ bgcolor: (o) => o.palette.background.paper,
39
+ ml: 1.5,
40
+ mt: "-9px",
41
+ px: 0.5
42
+ }
43
+ },
44
+ children: "Policy List"
45
+ }
46
+ ),
47
+ /* @__PURE__ */ i(
48
+ m,
49
+ {
50
+ value: n.filter((o) => l.includes(o.id)),
51
+ options: n,
52
+ isMulti: !0,
53
+ onChange: d,
54
+ menuPosition: "fixed",
55
+ getOptionLabel: (o) => o.name ?? o.key,
56
+ getOptionValue: (o) => String(o.id),
57
+ styles: {
58
+ control: (o) => ({
59
+ ...o,
60
+ boxShadow: "none",
61
+ ...e === "standart" && {
62
+ border: "none",
63
+ borderBottom: "1px solid",
64
+ borderRadius: 0,
65
+ borderColor: "rgba(0, 0, 0, 0.42)"
66
+ },
67
+ ...t && { color: "#c00", borderColor: "#c00" }
68
+ }),
69
+ valueContainer: (o) => ({
70
+ ...o,
71
+ fontSize: "1rem",
72
+ ...e === "standart" ? { paddingLeft: 0 } : {
73
+ padding: "6px 0px 3px 8px"
74
+ },
75
+ ...t && { color: "#c00" }
76
+ })
77
+ }
78
+ }
79
+ )
80
+ ]
81
+ }
82
+ );
83
+ };
84
+ export {
85
+ f as default
86
+ };
@@ -0,0 +1,15 @@
1
+ import "react/jsx-runtime";
2
+ import "lodash";
3
+ import "dayjs";
4
+ import { V as x } from "../../../../../index-Bw_m9ult.js";
5
+ import "@mui/material";
6
+ import "@mui/icons-material";
7
+ import "../../../../geometry-picker/index.js";
8
+ import "../../../../phone-input/index.js";
9
+ import "../../../../date-time-picker/index.js";
10
+ import "../../../../../Checkbox-DostZSwR.js";
11
+ import "../../../../../FormControl-BiAFm76F.js";
12
+ import "../../../../../Select-DxpxZbJp.js";
13
+ export {
14
+ x as default
15
+ };
@@ -0,0 +1,39 @@
1
+ import { jsx as t, Fragment as i } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { V as m } from "../../../../../index-Bw_m9ult.js";
4
+ import d from "lodash";
5
+ function h({
6
+ template: o,
7
+ value: n,
8
+ mapboxAccessToken: a,
9
+ onChange: s
10
+ }) {
11
+ if (o === void 0) return /* @__PURE__ */ t(i, {});
12
+ const p = l.useMemo(() => {
13
+ let r = o.properties.filter((e) => e.visible);
14
+ return r = d.orderBy(r, "id"), r;
15
+ }, [o]), u = (r) => {
16
+ const e = {
17
+ target: {
18
+ value: { ...n, ...r }
19
+ }
20
+ };
21
+ s(e);
22
+ };
23
+ return /* @__PURE__ */ t(i, { children: p.map((r, e) => {
24
+ const f = n[r.propertyId];
25
+ return /* @__PURE__ */ t(
26
+ m,
27
+ {
28
+ property: r,
29
+ value: f,
30
+ mapboxAccessToken: a,
31
+ onChange: u
32
+ },
33
+ e
34
+ );
35
+ }) });
36
+ }
37
+ export {
38
+ h as default
39
+ };
@@ -0,0 +1,437 @@
1
+ import { jsx as a, jsxs as f, Fragment as P } from "react/jsx-runtime";
2
+ import m from "react";
3
+ import W from "lodash";
4
+ import { useForm as M, Controller as s } from "react-hook-form";
5
+ import { getNestedChildrenFromMap as N } from "../../../utils/ontology.js";
6
+ import { i as G, d as K } from "../../../utils-Bq0ye5vf.js";
7
+ import { ConditionalWrapper as O } from "../../conditional-wrapper/index.js";
8
+ import { Container as U } from "../../container/index.js";
9
+ import { TextField as h, FormGroup as j, FormControl as q, InputLabel as H, Select as Y, MenuItem as J, FormControlLabel as L, Checkbox as S, Box as T, Button as g } from "@mui/material";
10
+ import { TreeSelect as $ } from "../../tree-select/index.js";
11
+ import Q from "./components/policy-list/index.js";
12
+ import X from "./components/variables/index.js";
13
+ import { DisseminationList as z } from "../../data-security-selectors/dissemination-list/index.js";
14
+ import { SecurityLevel as Z } from "../../data-security-selectors/security-level/index.js";
15
+ const ee = {
16
+ alg: "A256GCM",
17
+ ext: !0,
18
+ k: "_El6rHQxC5E7NdO5DiMDITjF7f65wrlaJmFVagVE9Ic",
19
+ key_ops: ["encrypt", "decrypt"],
20
+ kty: "oct"
21
+ }, te = [
22
+ "IMAGE",
23
+ "VIDEO",
24
+ "TEXT",
25
+ "BINARY",
26
+ "OTHER"
27
+ ];
28
+ function ae(e, F) {
29
+ const {
30
+ register: C,
31
+ handleSubmit: E,
32
+ control: d,
33
+ formState: { errors: V },
34
+ getValues: x,
35
+ setValue: p,
36
+ reset: k
37
+ } = M({
38
+ defaultValues: e.defaultValues
39
+ }), [R, _] = m.useState([]), [v, I] = m.useState(), [ne, w] = m.useState(0), B = m.useMemo(() => {
40
+ const t = [];
41
+ return e.mappedTemplates.forEach((n) => {
42
+ n.creatable || t.push(String(n.id));
43
+ }), t;
44
+ }, [e.mappedTemplates]);
45
+ m.useEffect(() => {
46
+ (async () => {
47
+ let t = { ...e.defaultValues };
48
+ const n = e.mappedTemplates.get(t.templateId);
49
+ if (n) {
50
+ const l = n.properties.filter(
51
+ (r) => r.privacyPreservationMethod === "ENCRYPTION"
52
+ );
53
+ if (l.length > 0)
54
+ for (let r = 0; r < l.length; r++) {
55
+ const i = l[r], o = W.get(t, `variables.${i.propertyId}`);
56
+ if (o && e.keyAuth) {
57
+ const c = await G(ee), u = await K(c, o);
58
+ u.data && (p(`variables.${i.propertyId}`, u.data), w((b) => b + 1));
59
+ }
60
+ }
61
+ }
62
+ })();
63
+ }, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
64
+ const y = () => {
65
+ const t = x("templateId");
66
+ v && I(void 0);
67
+ const n = N(e.mappedTemplates);
68
+ _(n);
69
+ for (let l of e.mappedTemplates.values())
70
+ if (l.id === t) {
71
+ I(l);
72
+ break;
73
+ }
74
+ };
75
+ m.useImperativeHandle(F, () => ({
76
+ resetForm() {
77
+ k({
78
+ title: "",
79
+ description: "",
80
+ templateId: 0,
81
+ variables: {}
82
+ }), y();
83
+ },
84
+ setFormValue(t, n) {
85
+ p(t, n);
86
+ },
87
+ getFormValue(t) {
88
+ return x(t);
89
+ }
90
+ })), m.useEffect(() => (y(), () => {
91
+ }), [e.mappedTemplates]), m.useEffect(() => {
92
+ e.onSelectedTemplateChange && e.onSelectedTemplateChange(v);
93
+ }, [v]);
94
+ const A = () => {
95
+ if (e.onCancel) {
96
+ e.onCancel();
97
+ return;
98
+ }
99
+ };
100
+ return /* @__PURE__ */ a(
101
+ O,
102
+ {
103
+ condition: e.variant === void 0 || e.variant === "inline",
104
+ wrapper: (t) => /* @__PURE__ */ a(
105
+ U,
106
+ {
107
+ disableHeader: !0,
108
+ sx: { position: "relative", overflow: "visible" },
109
+ children: t
110
+ }
111
+ ),
112
+ children: /* @__PURE__ */ f("form", { onSubmit: E(e.onSubmit), children: [
113
+ /* @__PURE__ */ a(
114
+ h,
115
+ {
116
+ label: "Title *",
117
+ variant: "standard",
118
+ fullWidth: !0,
119
+ sx: { mb: 2 },
120
+ ...C("title", { required: !0 }),
121
+ ...V.title && {
122
+ helperText: "This field is required!",
123
+ error: !0
124
+ }
125
+ }
126
+ ),
127
+ /* @__PURE__ */ a(
128
+ h,
129
+ {
130
+ label: "Description",
131
+ variant: "standard",
132
+ fullWidth: !0,
133
+ multiline: !0,
134
+ sx: { mb: 2 },
135
+ ...C("description")
136
+ }
137
+ ),
138
+ /* @__PURE__ */ a(j, { sx: { mb: 2 }, children: /* @__PURE__ */ a(
139
+ s,
140
+ {
141
+ name: "templateId",
142
+ control: d,
143
+ render: ({ field: { value: t, onChange: n } }) => {
144
+ if (e.disableTemplateChange) {
145
+ const l = e.mappedTemplates.get(t);
146
+ return /* @__PURE__ */ a(
147
+ h,
148
+ {
149
+ label: "Template",
150
+ variant: "standard",
151
+ fullWidth: !0,
152
+ disabled: !0,
153
+ value: l == null ? void 0 : l.name,
154
+ InputLabelProps: { shrink: !0 }
155
+ }
156
+ );
157
+ }
158
+ return /* @__PURE__ */ a(
159
+ $,
160
+ {
161
+ label: "Template",
162
+ data: R,
163
+ selected: t === 0 ? "" : [String(t)],
164
+ disabled: B,
165
+ onChange: (l, r) => {
166
+ const i = {
167
+ target: {
168
+ value: r ? Number(l) : 0
169
+ }
170
+ };
171
+ n(i), y();
172
+ }
173
+ }
174
+ );
175
+ }
176
+ }
177
+ ) }),
178
+ "aliasList" in e.defaultValues && /* @__PURE__ */ a(
179
+ s,
180
+ {
181
+ name: "aliasList",
182
+ control: d,
183
+ render: ({ field: { value: t, onChange: n, ...l } }) => /* @__PURE__ */ a(
184
+ h,
185
+ {
186
+ label: "Alias List",
187
+ variant: "standard",
188
+ fullWidth: !0,
189
+ value: t,
190
+ sx: { mb: 2 },
191
+ helperText: "Add list values with the comma (,) separated string",
192
+ onChange: (i) => {
193
+ const u = {
194
+ target: {
195
+ value: i.target.value.split(",").map((b) => b.trimStart())
196
+ }
197
+ };
198
+ n(u);
199
+ },
200
+ ...l
201
+ }
202
+ )
203
+ }
204
+ ),
205
+ "appliedPolicies" in e.defaultValues && /* @__PURE__ */ a(
206
+ s,
207
+ {
208
+ name: "appliedPolicies",
209
+ control: d,
210
+ render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ a(
211
+ Q,
212
+ {
213
+ policyList: e.policyList,
214
+ value: t,
215
+ onChange: n
216
+ }
217
+ )
218
+ }
219
+ ),
220
+ /* @__PURE__ */ a(
221
+ s,
222
+ {
223
+ name: "variables",
224
+ control: d,
225
+ render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ a(
226
+ X,
227
+ {
228
+ template: v,
229
+ value: t,
230
+ mapboxAccessToken: "",
231
+ onChange: n
232
+ }
233
+ )
234
+ }
235
+ ),
236
+ "fileInBase64" in e.defaultValues && /* @__PURE__ */ f(P, { children: [
237
+ /* @__PURE__ */ a(
238
+ s,
239
+ {
240
+ name: "fileInBase64",
241
+ control: d,
242
+ render: ({ field: { value: t, onChange: n, ...l } }) => /* @__PURE__ */ a(
243
+ h,
244
+ {
245
+ type: "file",
246
+ label: "File to Upload",
247
+ variant: "standard",
248
+ fullWidth: !0,
249
+ sx: { mb: 2 },
250
+ helperText: "Select a file to upload",
251
+ InputLabelProps: { shrink: !0 },
252
+ onChange: (i) => {
253
+ if (i.target.files) {
254
+ const o = new FileReader();
255
+ o.onload = async (u) => {
256
+ const D = u.target.result.split("base64,")[1];
257
+ n(D);
258
+ };
259
+ const c = i.target.files[0];
260
+ p("originalFileName", c.name), p("contentType", c.type), o.readAsDataURL(c);
261
+ }
262
+ },
263
+ ...l
264
+ }
265
+ )
266
+ }
267
+ ),
268
+ /* @__PURE__ */ a(
269
+ s,
270
+ {
271
+ name: "type",
272
+ control: d,
273
+ render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ f(
274
+ q,
275
+ {
276
+ fullWidth: !0,
277
+ sx: {
278
+ mb: 2
279
+ },
280
+ variant: "standard",
281
+ children: [
282
+ /* @__PURE__ */ a(H, { children: "Type" }),
283
+ /* @__PURE__ */ a(Y, { value: t, onChange: (r) => {
284
+ const {
285
+ target: { value: i }
286
+ } = r;
287
+ n(i);
288
+ }, children: te.map((r) => /* @__PURE__ */ a(J, { value: r, children: r }, r)) })
289
+ ]
290
+ }
291
+ )
292
+ }
293
+ ),
294
+ /* @__PURE__ */ a(
295
+ L,
296
+ {
297
+ control: /* @__PURE__ */ a(
298
+ s,
299
+ {
300
+ name: "redacted",
301
+ control: d,
302
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ a(S, { checked: !!t, ...n })
303
+ }
304
+ ),
305
+ label: "Redacted",
306
+ sx: { mb: 2 }
307
+ }
308
+ ),
309
+ /* @__PURE__ */ a(
310
+ L,
311
+ {
312
+ control: /* @__PURE__ */ a(
313
+ s,
314
+ {
315
+ name: "contentEncrypted",
316
+ control: d,
317
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ a(S, { checked: !!t, ...n })
318
+ }
319
+ ),
320
+ label: "Content Encrypted",
321
+ sx: { mb: 2 }
322
+ }
323
+ )
324
+ ] }),
325
+ /* @__PURE__ */ a(
326
+ s,
327
+ {
328
+ name: "disseminationList",
329
+ rules: {
330
+ required: !0
331
+ },
332
+ control: d,
333
+ render: ({ field: { value: t, onChange: n }, fieldState: l }) => {
334
+ const r = t || [], i = (o) => {
335
+ n(o);
336
+ };
337
+ return /* @__PURE__ */ a(
338
+ z,
339
+ {
340
+ selectedIds: r,
341
+ memberedGroups: e.memberedGroups,
342
+ showError: !!l.error,
343
+ onChange: i
344
+ }
345
+ );
346
+ }
347
+ }
348
+ ),
349
+ /* @__PURE__ */ a(T, { mt: 2, children: /* @__PURE__ */ a(
350
+ s,
351
+ {
352
+ name: "securityLevelId",
353
+ rules: {
354
+ required: !0
355
+ },
356
+ control: d,
357
+ render: ({ field: { value: t, onChange: n }, fieldState: l }) => {
358
+ var i, o;
359
+ const r = (c) => {
360
+ n(c);
361
+ };
362
+ return /* @__PURE__ */ a(
363
+ Z,
364
+ {
365
+ value: t,
366
+ ontologyId: e.ontologyId,
367
+ appRoles: e.appRoles,
368
+ securityLevels: e.securityLevels,
369
+ minLevelId: e.minSecurityLevel,
370
+ templateKeys: (i = e.securityLevelConfig) == null ? void 0 : i.templateKeys,
371
+ templateType: (o = e.securityLevelConfig) == null ? void 0 : o.templateType,
372
+ showError: !!l.error,
373
+ onChange: r
374
+ }
375
+ );
376
+ }
377
+ }
378
+ ) }),
379
+ /* @__PURE__ */ f(T, { display: "flex", justifyContent: "space-between", mt: 3, children: [
380
+ /* @__PURE__ */ a(
381
+ g,
382
+ {
383
+ color: "primary",
384
+ variant: "text",
385
+ disabled: e.loading,
386
+ sx: { textTransform: "none" },
387
+ onClick: A,
388
+ children: "Cancel"
389
+ }
390
+ ),
391
+ /* @__PURE__ */ f(T, { children: [
392
+ e.onRemove !== void 0 && /* @__PURE__ */ a(
393
+ g,
394
+ {
395
+ type: "button",
396
+ color: "error",
397
+ variant: "contained",
398
+ disabled: e.removeLoading || e.loading,
399
+ sx: { mr: 2, textTransform: "none" },
400
+ onClick: e.onRemove,
401
+ children: e.removeLoading ? "Deleting..." : "Delete"
402
+ }
403
+ ),
404
+ e.saveButtons ? e.saveButtons.map((t, n) => /* @__PURE__ */ a(
405
+ g,
406
+ {
407
+ type: "submit",
408
+ color: "primary",
409
+ variant: "contained",
410
+ disabled: e.loading,
411
+ startIcon: t.icon,
412
+ sx: { ml: 1, textTransform: "none" },
413
+ onClick: t.onClick,
414
+ children: t.label
415
+ },
416
+ n
417
+ )) : /* @__PURE__ */ a(
418
+ g,
419
+ {
420
+ type: "submit",
421
+ color: "primary",
422
+ variant: "contained",
423
+ disabled: e.loading,
424
+ sx: { textTransform: "none" },
425
+ children: e.loading ? "Saving..." : "Save"
426
+ }
427
+ )
428
+ ] })
429
+ ] })
430
+ ] })
431
+ }
432
+ );
433
+ }
434
+ const ge = m.forwardRef(ae);
435
+ export {
436
+ ge as InstanceForm
437
+ };