@hybridcore/ui 1.3.6 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccordionDetails-CGs6GZQK.js +454 -0
- package/dist/Add-eepk2WTM.js +379 -0
- package/dist/Box-BPyg-Ybm.js +70 -0
- package/dist/Button-DLwB_sKd.js +354 -0
- package/dist/{ButtonBase-D6qhsxB0.js → ButtonBase-D0qccOVb.js} +6 -5
- package/dist/{CardContent-B8hqgH-I.js → CardContent-DFsCCOWk.js} +4 -4
- package/dist/{Checkbox-BFWhj3s-.js → Checkbox-qy3cjvnb.js} +134 -195
- package/dist/{Collapse-D_TjnyE5.js → Collapse-CL6LGGZw.js} +68 -75
- package/dist/Delete-OHEw9lDi.js +22 -0
- package/dist/DialogContent-CxOSq6h9.js +519 -0
- package/dist/FormControlLabel-D9KFjcIx.js +193 -0
- package/dist/{IconButton-D8bwME9t.js → IconButton-BaiyAtmS.js} +5 -5
- package/dist/{Input-Dxzguyp5.js → Input-CmCkXczh.js} +6 -6
- package/dist/{InputAdornment-B8ERE7Zv.js → InputAdornment-CZUPEeia.js} +5 -5
- package/dist/{FormControl-BMRUQKHh.js → InputLabel-CWkW8NtU.js} +316 -316
- package/dist/{List-DEWyK9IO.js → List-PpNAWJ_I.js} +4 -4
- package/dist/ListItem-CZbZ91vp.js +428 -0
- package/dist/{MenuItem-DstAFfik.js → MenuItem-D-INSvZa.js} +7 -7
- package/dist/{Modal-DNGEQJ1M.js → Modal-KrI5qFIq.js} +61 -57
- package/dist/{OutlinedInput-w2Cj9STF.js → OutlinedInput-DkIUD30e.js} +6 -6
- package/dist/{Paper-BseeergJ.js → Paper-btu3j72o.js} +5 -5
- package/dist/{Select-NDq3WyLt.js → Select-ClaBvSqf.js} +20 -18
- package/dist/Tabs-BzelDJKy.js +787 -0
- package/dist/TextField-D87qTh1k.js +457 -0
- package/dist/Typography-Bm7PFqUT.js +176 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/components/card/index.js +6 -6
- package/dist/components/card/styled.js +1 -1
- package/dist/components/collapsible-card/style.js +20 -466
- package/dist/components/confirm/dialog.js +8 -149
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/container/index.js +7 -7
- package/dist/components/context-menu/index.js +191 -604
- package/dist/components/data-security-selectors/dissemination-list/index.js +12 -6
- package/dist/components/data-security-selectors/security-level/index.js +46 -45
- package/dist/components/date-time-picker/index.js +85 -64
- package/dist/components/geometry-picker/coordinate/index.js +1 -1
- package/dist/components/geometry-picker/edit/index.js +16 -16
- package/dist/components/geometry-picker/geometry/index.js +35 -35
- package/dist/components/geometry-picker/index.js +60 -56
- package/dist/components/geometry-picker/kml/index.js +14 -14
- package/dist/components/geometry-picker/map/index.js +1 -1
- package/dist/components/geometry-picker/map/logic.js +38 -37
- package/dist/components/geometry-picker/parser/coordinate-input/logic.js +63 -59
- package/dist/components/geometry-picker/parser/logic.js +33 -32
- package/dist/components/geometry-picker/styled.js +22 -14
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button/styled.js +0 -2
- package/dist/components/{data-management/instance-form → instance-form}/components/composite-list/index.js +2 -2
- package/dist/components/{data-management/instance-form → instance-form}/components/composite-list/styled.js +15 -6
- package/dist/components/instance-form/components/variable/index.js +19 -0
- package/dist/components/instance-form/components/variables/index.js +40 -0
- package/dist/components/{data-management/instance-form → instance-form}/index.js +174 -155
- package/dist/components/instance-hierarchy-table/index.js +58 -0
- package/dist/components/instance-hierarchy-table/styled.js +29 -0
- package/dist/components/instance-table/index.js +125 -0
- package/dist/components/instance-table/styled.js +13 -0
- package/dist/components/map/helpers/ol.js +1 -1
- package/dist/components/map/index.js +1 -1
- package/dist/components/map/logic.js +1 -1
- package/dist/components/map/styled.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/property-mapping/index.js +558 -0
- package/dist/components/range-selector/components/composite-list-range/index.js +81 -0
- package/dist/components/range-selector/components/date-range/index.js +9 -0
- package/dist/components/range-selector/components/geometry-range/index.js +26 -0
- package/dist/components/range-selector/components/number-range/index.js +86 -0
- package/dist/components/range-selector/components/string-range/index.js +31 -0
- package/dist/components/range-selector/index.js +59 -0
- package/dist/components/search-input/index.js +4 -4
- package/dist/components/tabs/appleTabs.style.js +55 -0
- package/dist/components/tabs/index.js +93 -0
- package/dist/components/tabs/tab-panel.js +18 -0
- package/dist/components/template-form/components/catalogue-instance-selector/index.js +158 -0
- package/dist/components/template-form/components/property-list/index.js +72 -0
- package/dist/components/template-form/components/property-list/property-list-columns.js +125 -0
- package/dist/components/template-form/components/property-list/property-list-form.js +16 -0
- package/dist/components/template-form/components/property-list/property-list-logic.js +66 -0
- package/dist/components/template-form/components/property-list/types.js +8 -0
- package/dist/components/template-form/components/recognition-property-list/index.js +69 -0
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +50 -0
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +174 -0
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-logic.js +64 -0
- package/dist/components/template-form/components/recognition-property-list/types.js +8 -0
- package/dist/components/template-form/components/select-icon/index.js +186 -0
- package/dist/components/template-form/components/select-icon/styled.js +76 -0
- package/dist/components/template-form/index.js +338 -0
- package/dist/components/template-property-filters/property.js +48 -46
- package/dist/components/tree-select/index.js +51 -49
- package/dist/components/tree-select/styled.js +2 -2
- package/dist/components/treeview-filter/index.js +8 -8
- package/dist/components/treeview-filter/item/index.js +1 -1
- package/dist/components/treeview-filter/item-label/index.js +18 -17
- package/dist/constants/index.js +41 -0
- package/dist/{createStyled-B96gjom1.js → createStyled-BzvgQjjR.js} +487 -464
- package/dist/createSvgIcon-Cfm1LkEe.js +73 -0
- package/dist/{createSvgIcon-BNrb7rDY.js → createSvgIcon-DEXLbMwp.js} +62 -90
- package/dist/dialog-v5-nL5yy.js +153 -0
- package/dist/{exactProp-CI_rjX83.js → exactProp-DkmnwNVS.js} +3 -3
- package/dist/extendSxProp-qqdkfHzS.js +30 -0
- package/dist/{index-CSfSVkKj.js → index-B0JPwFI9.js} +6 -5
- package/dist/index-C1fczHEW.js +11042 -0
- package/dist/index-DPf5olog.js +288 -0
- package/dist/{index-JrtqxUdI.js → index-DlnzUkwe.js} +1 -1
- package/dist/{listItemTextClasses-CFiI_U7B.js → listItemTextClasses-DsHGzpPM.js} +2 -2
- package/dist/main.d.ts +569 -81
- package/dist/main.js +157 -157
- package/dist/{ol-BUKJ1urU.js → ol-CHaVTXvL.js} +24 -24
- package/dist/property-list-form-BfP9gzSo.js +391 -0
- package/dist/requirePropFactory-BjhhI-AW.js +18 -0
- package/dist/{styled-cPJbqF0E.js → styled-LNCprp4n.js} +24 -22
- package/dist/unsupportedProp-BuVD30Gh.js +9 -0
- package/dist/useControlled-BYdyS7Pn.js +31 -0
- package/dist/{useTheme-C-T6Qisa.js → useTheme-DBiahn6p.js} +2 -2
- package/dist/{useThemeProps-DeftUmqJ.js → useThemeProps-uYx_RkOH.js} +16 -14
- package/dist/utils/ontology.js +52 -30
- package/dist/{utils-CCkxV0lZ.js → utils-DNe_YYjm.js} +16 -16
- package/package.json +2 -1
- package/dist/DialogContent-BCYm_d1s.js +0 -864
- package/dist/FormControlLabel-DENNVXWL.js +0 -639
- package/dist/Typography-Dg-ROiTA.js +0 -201
- package/dist/components/data-management/instance-form/components/variable/index.js +0 -17
- package/dist/components/data-management/instance-form/components/variables/index.js +0 -39
- package/dist/createSvgIcon-B2WT0K4k.js +0 -87
- package/dist/index-B3Oj04nl.js +0 -287
- package/dist/components/{data-management/instance-form → instance-form}/components/policy-list/index.js +0 -0
- package/dist/{extends-Cyw62AD_.js → objectWithoutPropertiesLoose-BK36oJDi.js} +9 -9
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { CloseOutlined as le, ChevronRight as ie, ErrorOutline as ne, Check as oe, Refresh as ae } from "@mui/icons-material";
|
|
3
|
+
import { Dialog as de, DialogTitle as se, Box as m, Typography as $, TextField as R, IconButton as J, DialogContent as pe, DialogActions as ce, Button as W, FormControl as V, Select as _, MenuItem as A } from "@mui/material";
|
|
4
|
+
import { DataGrid as fe } from "@mui/x-data-grid";
|
|
5
|
+
import { useState as H, useEffect as ue } from "react";
|
|
6
|
+
import h from "lodash";
|
|
7
|
+
import { e as ye } from "../../ol-CHaVTXvL.js";
|
|
8
|
+
import { V as he } from "../../index-DPf5olog.js";
|
|
9
|
+
import { RangeSelector as me } from "../range-selector/index.js";
|
|
10
|
+
const $e = ({
|
|
11
|
+
open: F,
|
|
12
|
+
data: P,
|
|
13
|
+
objectTemplate: q,
|
|
14
|
+
agent: a,
|
|
15
|
+
enableValueInput: T,
|
|
16
|
+
loading: B,
|
|
17
|
+
agentTemplates: K,
|
|
18
|
+
catalogueInstances: v,
|
|
19
|
+
objectInstance: I,
|
|
20
|
+
disableCatalogueSource: G,
|
|
21
|
+
disableObjectSource: U,
|
|
22
|
+
scenario: C,
|
|
23
|
+
mapboxAccessToken: E,
|
|
24
|
+
onSubmit: M,
|
|
25
|
+
onClose: O
|
|
26
|
+
}) => {
|
|
27
|
+
const [k, j] = H(P), [L, N] = H(/* @__PURE__ */ new Map());
|
|
28
|
+
ue(() => (N(/* @__PURE__ */ new Map()), () => {
|
|
29
|
+
}), [F]);
|
|
30
|
+
const Q = () => {
|
|
31
|
+
a ? M(a, !0) : M(k);
|
|
32
|
+
}, D = (n) => {
|
|
33
|
+
const { name: d, value: s } = n.target;
|
|
34
|
+
let o = s;
|
|
35
|
+
d === "criticalityScore" && (o = o.replace(",", "."), o = o.replace(/[^\d.-]+/g, "")), X(d)(o);
|
|
36
|
+
}, X = (n) => (d) => {
|
|
37
|
+
a && M({ ...a, [n]: d });
|
|
38
|
+
}, S = (n, d, s, o) => (r) => {
|
|
39
|
+
if (a) {
|
|
40
|
+
let t = [...a.propertyInfoMap];
|
|
41
|
+
const e = t.findIndex(
|
|
42
|
+
(l) => l.policyKey === n && l.key === d
|
|
43
|
+
);
|
|
44
|
+
if (t[e]) {
|
|
45
|
+
let l = r.value;
|
|
46
|
+
t.splice(e, 1, {
|
|
47
|
+
...t[e],
|
|
48
|
+
value: l,
|
|
49
|
+
source: s ? s || "" : t[e].source,
|
|
50
|
+
sourceField: o !== void 0 ? o || "" : t[e].sourceField
|
|
51
|
+
}), M && M({ ...a, propertyInfoMap: t });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, Y = (n) => () => {
|
|
55
|
+
const { policyKey: d, key: s, source: o, sourceField: r } = n;
|
|
56
|
+
let t = "";
|
|
57
|
+
if (o === "OBJECT")
|
|
58
|
+
t = h.get(
|
|
59
|
+
I,
|
|
60
|
+
`variables.${n.dataType.type}.${r}`
|
|
61
|
+
);
|
|
62
|
+
else if (o) {
|
|
63
|
+
const e = parseInt(String(o)), l = v == null ? void 0 : v.find((u) => u.id === e);
|
|
64
|
+
l ? t = h.get(
|
|
65
|
+
l.variables,
|
|
66
|
+
`${n.dataType.type}.${r}`
|
|
67
|
+
) : console.log(
|
|
68
|
+
"Catalogue instance could not be found!",
|
|
69
|
+
o,
|
|
70
|
+
v
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
t && (S(d, s)({ value: t }), N((e) => {
|
|
74
|
+
const l = new Map(e);
|
|
75
|
+
return l.set(
|
|
76
|
+
`${h.get(a, "referenceObjectInstanceId")}:${d}:${s}`,
|
|
77
|
+
"Updated"
|
|
78
|
+
), l;
|
|
79
|
+
}), setTimeout(() => {
|
|
80
|
+
N((e) => {
|
|
81
|
+
const l = new Map(e);
|
|
82
|
+
return l.set(
|
|
83
|
+
`${h.get(
|
|
84
|
+
a,
|
|
85
|
+
"referenceObjectInstanceId"
|
|
86
|
+
)}:${d}:${s}`,
|
|
87
|
+
"Default"
|
|
88
|
+
), l;
|
|
89
|
+
});
|
|
90
|
+
}, 2e3));
|
|
91
|
+
}, Z = (n, d) => (s) => {
|
|
92
|
+
if (a) {
|
|
93
|
+
let o = [...a.propertyInfoMap];
|
|
94
|
+
const r = o.findIndex(
|
|
95
|
+
(t) => t.policyKey === n && t.key === d
|
|
96
|
+
);
|
|
97
|
+
o[r] && (o.splice(r, 1, {
|
|
98
|
+
...o[r],
|
|
99
|
+
randomInfo: s
|
|
100
|
+
}), M && M({ ...a, propertyInfoMap: o }));
|
|
101
|
+
}
|
|
102
|
+
}, ee = (n) => (d) => {
|
|
103
|
+
const s = d.target.name;
|
|
104
|
+
let o = [...k];
|
|
105
|
+
const r = o[n], t = r.propertyMappings.findIndex(
|
|
106
|
+
(l) => l.key === s
|
|
107
|
+
), e = r.propertyMappings[t];
|
|
108
|
+
h.set(
|
|
109
|
+
o,
|
|
110
|
+
`${n}.propertyMappings.${t}.source`,
|
|
111
|
+
d.target.value
|
|
112
|
+
), h.set(
|
|
113
|
+
o,
|
|
114
|
+
`${n}.propertyMappings.${t}.sourceField`,
|
|
115
|
+
""
|
|
116
|
+
), j(o), a && S(
|
|
117
|
+
r.key,
|
|
118
|
+
e.key,
|
|
119
|
+
String(d.target.value),
|
|
120
|
+
""
|
|
121
|
+
)({ value: "" });
|
|
122
|
+
}, re = (n) => (d) => {
|
|
123
|
+
const s = d.target.name;
|
|
124
|
+
let o = [...k];
|
|
125
|
+
const r = o[n], t = r.propertyMappings.findIndex(
|
|
126
|
+
(l) => l.key === s
|
|
127
|
+
), e = r.propertyMappings[t];
|
|
128
|
+
if (h.set(
|
|
129
|
+
o,
|
|
130
|
+
`${n}.propertyMappings.${t}.sourceField`,
|
|
131
|
+
d.target.value
|
|
132
|
+
), j(o), T && a) {
|
|
133
|
+
const l = h.get(
|
|
134
|
+
o,
|
|
135
|
+
`${n}.propertyMappings.${t}.source`
|
|
136
|
+
);
|
|
137
|
+
if (l === "OBJECT") {
|
|
138
|
+
if (I) {
|
|
139
|
+
const u = h.get(
|
|
140
|
+
I.variables,
|
|
141
|
+
`${e.dataType.type}.${d.target.value}`
|
|
142
|
+
) || "";
|
|
143
|
+
S(
|
|
144
|
+
r.key,
|
|
145
|
+
e.key,
|
|
146
|
+
void 0,
|
|
147
|
+
d.target.value
|
|
148
|
+
)({ value: u });
|
|
149
|
+
}
|
|
150
|
+
} else if (l !== "STATIC") {
|
|
151
|
+
if (l !== "RANDOM") {
|
|
152
|
+
if (l !== "SMART_RANDOM") {
|
|
153
|
+
const u = v == null ? void 0 : v.find(
|
|
154
|
+
(y) => y.id === Number(l)
|
|
155
|
+
);
|
|
156
|
+
if (u) {
|
|
157
|
+
const y = h.get(
|
|
158
|
+
u.variables,
|
|
159
|
+
`${e.dataType.type}.${d.target.value}`
|
|
160
|
+
) || "";
|
|
161
|
+
S(
|
|
162
|
+
r.key,
|
|
163
|
+
e.key,
|
|
164
|
+
void 0,
|
|
165
|
+
d.target.value
|
|
166
|
+
)({ value: y });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, te = (n, d) => {
|
|
173
|
+
let s = {
|
|
174
|
+
field: "value",
|
|
175
|
+
headerName: "Value",
|
|
176
|
+
sortable: !1,
|
|
177
|
+
filterable: !1,
|
|
178
|
+
disableColumnMenu: !0,
|
|
179
|
+
flex: 2.5,
|
|
180
|
+
renderCell: (r) => {
|
|
181
|
+
var x, g;
|
|
182
|
+
const { key: t, dataType: e } = r.row;
|
|
183
|
+
let l = "", u = /* @__PURE__ */ i(w, {}), y = /* @__PURE__ */ i(w, {}), p = r.row.source;
|
|
184
|
+
if (T && a) {
|
|
185
|
+
const f = a.propertyInfoMap.find(
|
|
186
|
+
(b) => b.key === t && b.policyKey === n.key
|
|
187
|
+
);
|
|
188
|
+
if (f) {
|
|
189
|
+
const { valid: b, validationErrors: z } = f;
|
|
190
|
+
l = f.value, p = f.source, b === !1 && (u = /* @__PURE__ */ i(
|
|
191
|
+
ne,
|
|
192
|
+
{
|
|
193
|
+
color: "error",
|
|
194
|
+
fontSize: "small",
|
|
195
|
+
sx: { ml: 1 },
|
|
196
|
+
titleAccess: z ? z.join(", ") : "Value is not valid!"
|
|
197
|
+
}
|
|
198
|
+
)), p && (L.get(
|
|
199
|
+
`${h.get(a, "referenceObjectInstanceId")}:${f.policyKey}:${f.key}`
|
|
200
|
+
) === "Updated" ? y = /* @__PURE__ */ i(oe, { color: "success", sx: { mr: 1 }, titleAccess: "Updated" }) : y = /* @__PURE__ */ i(
|
|
201
|
+
J,
|
|
202
|
+
{
|
|
203
|
+
onClick: Y(f),
|
|
204
|
+
title: `Reload value from the ${p === "OBJECT" ? "Object" : "Catalogue"}`,
|
|
205
|
+
children: /* @__PURE__ */ i(ae, {})
|
|
206
|
+
}
|
|
207
|
+
));
|
|
208
|
+
}
|
|
209
|
+
if (p === "STATIC") {
|
|
210
|
+
const b = (x = C == null ? void 0 : C.environment.context) != null && x.boundingBox ? ye(C.environment.context.boundingBox) : void 0;
|
|
211
|
+
return /* @__PURE__ */ c(w, { children: [
|
|
212
|
+
/* @__PURE__ */ i(
|
|
213
|
+
he,
|
|
214
|
+
{
|
|
215
|
+
mapboxAccessToken: E,
|
|
216
|
+
property: {
|
|
217
|
+
propertyId: "value",
|
|
218
|
+
type: e.type,
|
|
219
|
+
editable: !0,
|
|
220
|
+
dataTypeInfo: {
|
|
221
|
+
innerType: e.innerType
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
variant: "outlined",
|
|
225
|
+
value: l,
|
|
226
|
+
size: "small",
|
|
227
|
+
disableMargin: !0,
|
|
228
|
+
defaultExtent: b,
|
|
229
|
+
onChange: S(n.key, t)
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
u
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
235
|
+
if (p === "RANDOM" || p === "SMART_RANDOM")
|
|
236
|
+
return /* @__PURE__ */ c(w, { children: [
|
|
237
|
+
/* @__PURE__ */ i(
|
|
238
|
+
me,
|
|
239
|
+
{
|
|
240
|
+
type: e.type,
|
|
241
|
+
value: f == null ? void 0 : f.randomInfo,
|
|
242
|
+
innerType: (g = e.innerType) == null ? void 0 : g.type,
|
|
243
|
+
minDate: C ? C.startTime : "",
|
|
244
|
+
maxDate: C ? C.endTime : "",
|
|
245
|
+
mapboxAccessToken: E,
|
|
246
|
+
onChange: Z(n.key, t)
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
u
|
|
250
|
+
] });
|
|
251
|
+
}
|
|
252
|
+
return h.isArray(l) && (l = l.join(", ")), /* @__PURE__ */ c(
|
|
253
|
+
m,
|
|
254
|
+
{
|
|
255
|
+
display: "flex",
|
|
256
|
+
justifyContent: "space-between",
|
|
257
|
+
alignItems: "center",
|
|
258
|
+
width: "100%",
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ c(m, { flex: 1, children: [
|
|
261
|
+
l,
|
|
262
|
+
u
|
|
263
|
+
] }),
|
|
264
|
+
y
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const o = [
|
|
271
|
+
{
|
|
272
|
+
field: "name",
|
|
273
|
+
headerName: "Policy Field",
|
|
274
|
+
sortable: !1,
|
|
275
|
+
filterable: !1,
|
|
276
|
+
disableColumnMenu: !0,
|
|
277
|
+
flex: 1,
|
|
278
|
+
renderCell: (r) => /* @__PURE__ */ c(
|
|
279
|
+
m,
|
|
280
|
+
{
|
|
281
|
+
sx: {
|
|
282
|
+
overflow: "hidden",
|
|
283
|
+
whiteSpace: "nowrap",
|
|
284
|
+
textOverflow: "ellipsis",
|
|
285
|
+
width: "100%"
|
|
286
|
+
},
|
|
287
|
+
title: r.row.name || r.row.key,
|
|
288
|
+
children: [
|
|
289
|
+
r.row.name || r.row.key,
|
|
290
|
+
r.row.required ? /* @__PURE__ */ i($, { color: "red", ml: 1, title: "Required", display: "inline", children: "*" }) : null
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
field: "description",
|
|
297
|
+
headerName: "Description",
|
|
298
|
+
sortable: !1,
|
|
299
|
+
filterable: !1,
|
|
300
|
+
disableColumnMenu: !0,
|
|
301
|
+
flex: 1
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
field: "dataType",
|
|
305
|
+
headerName: "Data Type",
|
|
306
|
+
sortable: !1,
|
|
307
|
+
filterable: !1,
|
|
308
|
+
disableColumnMenu: !0,
|
|
309
|
+
flex: 1,
|
|
310
|
+
renderCell: (r) => {
|
|
311
|
+
const { dataType: t } = r.row;
|
|
312
|
+
let e = t.type;
|
|
313
|
+
return t.type === "composite-list" && (e += ` <${t.innerType.type}>`), /* @__PURE__ */ i(
|
|
314
|
+
m,
|
|
315
|
+
{
|
|
316
|
+
sx: {
|
|
317
|
+
overflow: "hidden",
|
|
318
|
+
whiteSpace: "nowrap",
|
|
319
|
+
textOverflow: "ellipsis",
|
|
320
|
+
width: "100%"
|
|
321
|
+
},
|
|
322
|
+
title: e,
|
|
323
|
+
children: e
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
field: "source",
|
|
330
|
+
headerName: "Source",
|
|
331
|
+
sortable: !1,
|
|
332
|
+
filterable: !1,
|
|
333
|
+
disableColumnMenu: !0,
|
|
334
|
+
flex: 1,
|
|
335
|
+
renderCell: (r) => {
|
|
336
|
+
let t = r.row.source || "";
|
|
337
|
+
if (a) {
|
|
338
|
+
const e = a.propertyInfoMap.find(
|
|
339
|
+
(l) => l.policyKey === n.key && l.key === r.id
|
|
340
|
+
);
|
|
341
|
+
e && (t = e.source || "");
|
|
342
|
+
}
|
|
343
|
+
return /* @__PURE__ */ i(V, { fullWidth: !0, size: "small", children: /* @__PURE__ */ c(
|
|
344
|
+
_,
|
|
345
|
+
{
|
|
346
|
+
onChange: ee(d),
|
|
347
|
+
name: String(r.id),
|
|
348
|
+
value: t,
|
|
349
|
+
children: [
|
|
350
|
+
!U && /* @__PURE__ */ i(A, { value: "OBJECT", children: "OBJECT" }),
|
|
351
|
+
!G && n.catalogInstances.map((e) => /* @__PURE__ */ i(A, { value: e.id, children: e.name }, e.id)),
|
|
352
|
+
T && ["STATIC", "RANDOM", "SMART_RANDOM"].map((e) => /* @__PURE__ */ i(A, { value: e, children: e }, e))
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
) });
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
field: "sourceField",
|
|
360
|
+
headerName: "Source Field",
|
|
361
|
+
sortable: !1,
|
|
362
|
+
filterable: !1,
|
|
363
|
+
disableColumnMenu: !0,
|
|
364
|
+
flex: 1,
|
|
365
|
+
renderCell: (r) => {
|
|
366
|
+
const { dataType: t } = r.row;
|
|
367
|
+
let e = r.row.source, l = r.row.sourceField;
|
|
368
|
+
if (a) {
|
|
369
|
+
const p = a.propertyInfoMap.find(
|
|
370
|
+
(x) => x.policyKey === n.key && x.key === r.id
|
|
371
|
+
);
|
|
372
|
+
p && (e = p.source, l = p.sourceField || "");
|
|
373
|
+
}
|
|
374
|
+
let u = l || "";
|
|
375
|
+
if (e === "RANDOM" || e === "STATIC" || e === "SMART_RANDOM")
|
|
376
|
+
return /* @__PURE__ */ i(w, {});
|
|
377
|
+
let y = [];
|
|
378
|
+
if (e === "OBJECT")
|
|
379
|
+
y = q.properties.map((p) => ({
|
|
380
|
+
value: p.propertyId,
|
|
381
|
+
text: p.name
|
|
382
|
+
}));
|
|
383
|
+
else if (e !== null) {
|
|
384
|
+
const p = Number(e), x = v == null ? void 0 : v.find(
|
|
385
|
+
(g) => g.id === p
|
|
386
|
+
);
|
|
387
|
+
if (x && K) {
|
|
388
|
+
const g = K.find(
|
|
389
|
+
(f) => f.templateKey === x.template.templateKey
|
|
390
|
+
);
|
|
391
|
+
g && (y = g.properties.map((f) => ({
|
|
392
|
+
value: f.propertyId,
|
|
393
|
+
text: f.name
|
|
394
|
+
})));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return /* @__PURE__ */ i(V, { fullWidth: !0, size: "small", children: /* @__PURE__ */ c(
|
|
398
|
+
_,
|
|
399
|
+
{
|
|
400
|
+
onChange: re(d),
|
|
401
|
+
name: String(r.id),
|
|
402
|
+
value: u,
|
|
403
|
+
children: [
|
|
404
|
+
y.map((p, x) => /* @__PURE__ */ i(A, { value: p.value, children: p.text }, x)),
|
|
405
|
+
y.length === 0 && /* @__PURE__ */ c(A, { disabled: !0, children: [
|
|
406
|
+
"No ",
|
|
407
|
+
t.type,
|
|
408
|
+
" property found!"
|
|
409
|
+
] })
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
) });
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
];
|
|
416
|
+
return T ? [...o, s] : o;
|
|
417
|
+
};
|
|
418
|
+
return /* @__PURE__ */ c(de, { open: F, fullWidth: !0, maxWidth: "lg", onClose: O, children: [
|
|
419
|
+
/* @__PURE__ */ c(
|
|
420
|
+
se,
|
|
421
|
+
{
|
|
422
|
+
component: "div",
|
|
423
|
+
lineHeight: 1,
|
|
424
|
+
display: "flex",
|
|
425
|
+
justifyContent: "space-between",
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ i(m, { children: a === void 0 ? /* @__PURE__ */ c(w, { children: [
|
|
428
|
+
/* @__PURE__ */ i($, { variant: "h6", children: "Property Mapping" }),
|
|
429
|
+
/* @__PURE__ */ i($, { variant: "caption", children: "Map policy properties with object template or catalog istance properties" })
|
|
430
|
+
] }) : /* @__PURE__ */ c(m, { display: "flex", flex: 1, alignItems: "flex-start", children: [
|
|
431
|
+
/* @__PURE__ */ c(
|
|
432
|
+
m,
|
|
433
|
+
{
|
|
434
|
+
display: "flex",
|
|
435
|
+
flexDirection: "column",
|
|
436
|
+
flex: 1,
|
|
437
|
+
minWidth: 200,
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ i(
|
|
440
|
+
R,
|
|
441
|
+
{
|
|
442
|
+
name: "name",
|
|
443
|
+
variant: "standard",
|
|
444
|
+
value: a.name,
|
|
445
|
+
placeholder: "Add name",
|
|
446
|
+
onChange: D,
|
|
447
|
+
sx: {
|
|
448
|
+
"& .MuiInputBase-root:before": {
|
|
449
|
+
border: "none"
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
),
|
|
454
|
+
"description" in a && /* @__PURE__ */ i(
|
|
455
|
+
R,
|
|
456
|
+
{
|
|
457
|
+
name: "description",
|
|
458
|
+
variant: "standard",
|
|
459
|
+
size: "small",
|
|
460
|
+
value: a.description,
|
|
461
|
+
placeholder: "Add description",
|
|
462
|
+
onChange: D,
|
|
463
|
+
sx: {
|
|
464
|
+
"& .MuiInputBase-root:before": {
|
|
465
|
+
border: "none"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
)
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
),
|
|
473
|
+
/* @__PURE__ */ c(m, { ml: 4, children: [
|
|
474
|
+
"count" in a && /* @__PURE__ */ i(
|
|
475
|
+
R,
|
|
476
|
+
{
|
|
477
|
+
name: "count",
|
|
478
|
+
label: "Count",
|
|
479
|
+
size: "small",
|
|
480
|
+
required: !0,
|
|
481
|
+
sx: { width: 100, mr: 1 },
|
|
482
|
+
value: a.count,
|
|
483
|
+
onChange: D
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
"criticalityScore" in a && /* @__PURE__ */ i(
|
|
487
|
+
R,
|
|
488
|
+
{
|
|
489
|
+
name: "criticalityScore",
|
|
490
|
+
label: "Criticality Score",
|
|
491
|
+
size: "small",
|
|
492
|
+
type: "text",
|
|
493
|
+
title: "Should be between 0 and 1",
|
|
494
|
+
sx: { width: 150 },
|
|
495
|
+
value: a.criticalityScore,
|
|
496
|
+
onChange: D
|
|
497
|
+
}
|
|
498
|
+
)
|
|
499
|
+
] })
|
|
500
|
+
] }) }),
|
|
501
|
+
/* @__PURE__ */ i(m, { flex: 1, textAlign: "end", children: /* @__PURE__ */ i(J, { onClick: O, children: /* @__PURE__ */ i(le, {}) }) })
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
/* @__PURE__ */ i(pe, { sx: { minHeight: 300 }, children: k.map((n, d) => /* @__PURE__ */ c(
|
|
506
|
+
m,
|
|
507
|
+
{
|
|
508
|
+
boxShadow: (s) => s.shadows[1],
|
|
509
|
+
mt: 0.1,
|
|
510
|
+
mb: 2,
|
|
511
|
+
overflow: "hidden",
|
|
512
|
+
borderRadius: 1,
|
|
513
|
+
children: [
|
|
514
|
+
/* @__PURE__ */ c(m, { display: "flex", alignItems: "center", p: 2, children: [
|
|
515
|
+
/* @__PURE__ */ i($, { children: n.catalogInstances.map((s) => s.name).join(", ") }),
|
|
516
|
+
/* @__PURE__ */ i(ie, { color: "disabled", sx: { mx: 1 } }),
|
|
517
|
+
/* @__PURE__ */ i($, { variant: "caption", color: "GrayText", children: n.name || n.key })
|
|
518
|
+
] }),
|
|
519
|
+
/* @__PURE__ */ i(
|
|
520
|
+
fe,
|
|
521
|
+
{
|
|
522
|
+
columns: te(n, d),
|
|
523
|
+
rows: n.propertyMappings,
|
|
524
|
+
autoHeight: !0,
|
|
525
|
+
density: T ? "comfortable" : "standard",
|
|
526
|
+
sx: {
|
|
527
|
+
border: "none",
|
|
528
|
+
"& .MuiDataGrid-columnHeadersInner": {
|
|
529
|
+
backgroundColor: (s) => s.palette.grey[200]
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
hideFooterPagination: !0,
|
|
533
|
+
hideFooter: !0,
|
|
534
|
+
getRowId: (s) => s.key
|
|
535
|
+
}
|
|
536
|
+
)
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
d
|
|
540
|
+
)) }),
|
|
541
|
+
/* @__PURE__ */ c(ce, { children: [
|
|
542
|
+
/* @__PURE__ */ i(W, { color: "inherit", variant: "contained", onClick: O, children: "Cancel" }),
|
|
543
|
+
/* @__PURE__ */ i(
|
|
544
|
+
W,
|
|
545
|
+
{
|
|
546
|
+
color: "primary",
|
|
547
|
+
variant: "contained",
|
|
548
|
+
disabled: k.length === 0 || B,
|
|
549
|
+
onClick: Q,
|
|
550
|
+
children: B ? "Saving..." : "Save"
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] })
|
|
554
|
+
] });
|
|
555
|
+
};
|
|
556
|
+
export {
|
|
557
|
+
$e as PropertyMapping
|
|
558
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as o, jsxs as R, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { Box as f, TextField as u } from "@mui/material";
|
|
3
|
+
import x from "../number-range/index.js";
|
|
4
|
+
import I from "../string-range/index.js";
|
|
5
|
+
import C from "../geometry-range/index.js";
|
|
6
|
+
import { D as c } from "../../../../index-C1fczHEW.js";
|
|
7
|
+
function j({
|
|
8
|
+
value: n,
|
|
9
|
+
innerType: e,
|
|
10
|
+
mapboxAccessToken: d,
|
|
11
|
+
onChange: i,
|
|
12
|
+
...r
|
|
13
|
+
}) {
|
|
14
|
+
const a = (m) => {
|
|
15
|
+
i({ ...n, innerRandomInfo: m });
|
|
16
|
+
}, g = (m) => {
|
|
17
|
+
const { name: l, value: s } = m.target;
|
|
18
|
+
i({
|
|
19
|
+
...n,
|
|
20
|
+
[l]: Number(s)
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
let t = /* @__PURE__ */ o(h, {});
|
|
24
|
+
return (e === "byte" || e === "double" || e === "integer" || e === "long") && (t = /* @__PURE__ */ o(
|
|
25
|
+
x,
|
|
26
|
+
{
|
|
27
|
+
value: n.innerRandomInfo ? n.innerRandomInfo : {
|
|
28
|
+
minValue: "",
|
|
29
|
+
maxValue: ""
|
|
30
|
+
},
|
|
31
|
+
onChange: a
|
|
32
|
+
}
|
|
33
|
+
)), (e === "string" || e === "text") && (t = /* @__PURE__ */ o(
|
|
34
|
+
I,
|
|
35
|
+
{
|
|
36
|
+
value: n.innerRandomInfo ? n.innerRandomInfo : {
|
|
37
|
+
listOfPossibleValues: []
|
|
38
|
+
},
|
|
39
|
+
onChange: a
|
|
40
|
+
}
|
|
41
|
+
)), e === "geometry" && (t = /* @__PURE__ */ o(
|
|
42
|
+
C,
|
|
43
|
+
{
|
|
44
|
+
mapboxAccessToken: d,
|
|
45
|
+
value: n.innerRandomInfo ? n.innerRandomInfo : {
|
|
46
|
+
geometryArea: ""
|
|
47
|
+
},
|
|
48
|
+
onChange: a
|
|
49
|
+
}
|
|
50
|
+
)), e === "date" && (t = /* @__PURE__ */ o(
|
|
51
|
+
c,
|
|
52
|
+
{
|
|
53
|
+
value: n.innerRandomInfo ? n.innerRandomInfo : {
|
|
54
|
+
startDate: r.minDate || "",
|
|
55
|
+
startRange: 0,
|
|
56
|
+
endRange: 0,
|
|
57
|
+
timeUnit: "MINUTE",
|
|
58
|
+
limitForScenarioTimeRange: !1
|
|
59
|
+
},
|
|
60
|
+
onChange: a,
|
|
61
|
+
...r
|
|
62
|
+
}
|
|
63
|
+
)), /* @__PURE__ */ R(f, { display: "flex", alignItems: "flex-end", width: "100%", children: [
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
|
+
u,
|
|
66
|
+
{
|
|
67
|
+
name: "count",
|
|
68
|
+
label: "Count",
|
|
69
|
+
type: "number",
|
|
70
|
+
size: "small",
|
|
71
|
+
sx: { mr: 0.5, minWidth: 50, width: 85 },
|
|
72
|
+
value: n.count,
|
|
73
|
+
onChange: g
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ o(f, { flex: 1, maxWidth: 300, children: t })
|
|
77
|
+
] });
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
j as default
|
|
81
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { GeometryPicker as m } from "../../../geometry-picker/index.js";
|
|
3
|
+
function l({
|
|
4
|
+
value: e,
|
|
5
|
+
mapboxAccessToken: r,
|
|
6
|
+
onChange: o
|
|
7
|
+
}) {
|
|
8
|
+
const t = (a) => {
|
|
9
|
+
o({
|
|
10
|
+
geometryArea: a
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ n(
|
|
14
|
+
m,
|
|
15
|
+
{
|
|
16
|
+
mapboxAccessToken: r,
|
|
17
|
+
label: "",
|
|
18
|
+
value: e.geometryArea,
|
|
19
|
+
disableAddCoordinate: !0,
|
|
20
|
+
onChange: t
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
l as default
|
|
26
|
+
};
|