@hybridcore/ui 1.5.45 → 1.5.46
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.
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as i, Fragment as b } from "react/jsx-runtime";
|
|
2
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
|
|
3
|
+
import { Dialog as de, DialogTitle as pe, Box as m, Typography as $, TextField as R, IconButton as J, DialogContent as se, DialogActions as ce, Button as W, FormControl as V, Select as _, MenuItem as A } from "@mui/material";
|
|
4
4
|
import { DataGrid as fe } from "@mui/x-data-grid";
|
|
5
|
-
import { useState as
|
|
5
|
+
import { useState as H, useEffect as ue } from "react";
|
|
6
6
|
import h from "lodash";
|
|
7
7
|
import { d as ye } from "../../ol-lGwSyEIV.js";
|
|
8
8
|
import { V as he } from "../../index-OtGK6phq.js";
|
|
9
9
|
import { RangeSelector as me } from "../range-selector/index.js";
|
|
10
10
|
const $e = ({
|
|
11
|
-
open:
|
|
12
|
-
data:
|
|
11
|
+
open: F,
|
|
12
|
+
data: P,
|
|
13
13
|
objectTemplate: q,
|
|
14
14
|
agent: a,
|
|
15
15
|
enableValueInput: T,
|
|
16
|
-
loading:
|
|
17
|
-
agentTemplates:
|
|
16
|
+
loading: B,
|
|
17
|
+
agentTemplates: K,
|
|
18
18
|
catalogueInstances: v,
|
|
19
|
-
objectInstance:
|
|
19
|
+
objectInstance: I,
|
|
20
20
|
disableCatalogueSource: G,
|
|
21
21
|
disableObjectSource: U,
|
|
22
22
|
scenario: C,
|
|
23
|
-
mapboxAccessToken:
|
|
23
|
+
mapboxAccessToken: E,
|
|
24
24
|
onSubmit: M,
|
|
25
|
-
onClose:
|
|
25
|
+
onClose: O
|
|
26
26
|
}) => {
|
|
27
|
-
const [k,
|
|
28
|
-
ue(() => (
|
|
29
|
-
}), [
|
|
27
|
+
const [k, j] = H(P), [L, N] = H(/* @__PURE__ */ new Map());
|
|
28
|
+
ue(() => (N(/* @__PURE__ */ new Map()), () => {
|
|
29
|
+
}), [F]);
|
|
30
30
|
const Q = () => {
|
|
31
31
|
a ? M(a, !0) : M(k);
|
|
32
|
-
},
|
|
33
|
-
const { name: d, value:
|
|
34
|
-
let o =
|
|
32
|
+
}, D = (n) => {
|
|
33
|
+
const { name: d, value: p } = n.target;
|
|
34
|
+
let o = p;
|
|
35
35
|
d === "criticalityScore" && (o = o.replace(",", "."), o = o.replace(/[^\d.-]+/g, "")), X(d)(o);
|
|
36
36
|
}, X = (n) => (d) => {
|
|
37
37
|
a && M({ ...a, [n]: d });
|
|
38
|
-
}, S = (n, d,
|
|
38
|
+
}, S = (n, d, p, o) => (r) => {
|
|
39
39
|
if (a) {
|
|
40
40
|
let t = [...a.propertyInfoMap];
|
|
41
41
|
const e = t.findIndex(
|
|
@@ -46,17 +46,17 @@ const $e = ({
|
|
|
46
46
|
t.splice(e, 1, {
|
|
47
47
|
...t[e],
|
|
48
48
|
value: l,
|
|
49
|
-
source:
|
|
49
|
+
source: p ? p || "" : t[e].source,
|
|
50
50
|
sourceField: o !== void 0 ? o || "" : t[e].sourceField
|
|
51
51
|
}), M && M({ ...a, propertyInfoMap: t });
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}, Y = (n) => () => {
|
|
55
|
-
const { policyKey: d, key:
|
|
55
|
+
const { policyKey: d, key: p, source: o, sourceField: r } = n;
|
|
56
56
|
let t = "";
|
|
57
57
|
if (o === "OBJECT")
|
|
58
58
|
t = h.get(
|
|
59
|
-
|
|
59
|
+
I,
|
|
60
60
|
`variables.${n.dataType.type}.${r}`
|
|
61
61
|
);
|
|
62
62
|
else if (o) {
|
|
@@ -70,25 +70,25 @@ const $e = ({
|
|
|
70
70
|
v
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
t && (S(d,
|
|
73
|
+
t && (S(d, p)({ value: t }), N((e) => {
|
|
74
74
|
const l = new Map(e);
|
|
75
75
|
return l.set(
|
|
76
|
-
`${h.get(a, "referenceObjectInstanceId")}:${d}:${
|
|
76
|
+
`${h.get(a, "referenceObjectInstanceId")}:${d}:${p}`,
|
|
77
77
|
"Updated"
|
|
78
78
|
), l;
|
|
79
79
|
}), setTimeout(() => {
|
|
80
|
-
|
|
80
|
+
N((e) => {
|
|
81
81
|
const l = new Map(e);
|
|
82
82
|
return l.set(
|
|
83
83
|
`${h.get(
|
|
84
84
|
a,
|
|
85
85
|
"referenceObjectInstanceId"
|
|
86
|
-
)}:${d}:${
|
|
86
|
+
)}:${d}:${p}`,
|
|
87
87
|
"Default"
|
|
88
88
|
), l;
|
|
89
89
|
});
|
|
90
90
|
}, 2e3));
|
|
91
|
-
}, Z = (n, d) => (
|
|
91
|
+
}, Z = (n, d) => (p) => {
|
|
92
92
|
if (a) {
|
|
93
93
|
let o = [...a.propertyInfoMap];
|
|
94
94
|
const r = o.findIndex(
|
|
@@ -96,14 +96,14 @@ const $e = ({
|
|
|
96
96
|
);
|
|
97
97
|
o[r] && (o.splice(r, 1, {
|
|
98
98
|
...o[r],
|
|
99
|
-
randomInfo:
|
|
99
|
+
randomInfo: p
|
|
100
100
|
}), M && M({ ...a, propertyInfoMap: o }));
|
|
101
101
|
}
|
|
102
102
|
}, ee = (n) => (d) => {
|
|
103
|
-
const
|
|
103
|
+
const p = d.target.name;
|
|
104
104
|
let o = [...k];
|
|
105
105
|
const r = o[n], t = r.propertyMappings.findIndex(
|
|
106
|
-
(l) => l.key ===
|
|
106
|
+
(l) => l.key === p
|
|
107
107
|
), e = r.propertyMappings[t];
|
|
108
108
|
h.set(
|
|
109
109
|
o,
|
|
@@ -113,31 +113,31 @@ const $e = ({
|
|
|
113
113
|
o,
|
|
114
114
|
`${n}.propertyMappings.${t}.sourceField`,
|
|
115
115
|
""
|
|
116
|
-
),
|
|
116
|
+
), j(o), a && S(
|
|
117
117
|
r.key,
|
|
118
118
|
e.key,
|
|
119
119
|
String(d.target.value),
|
|
120
120
|
""
|
|
121
121
|
)({ value: "" });
|
|
122
122
|
}, re = (n) => (d) => {
|
|
123
|
-
const
|
|
123
|
+
const p = d.target.name;
|
|
124
124
|
let o = [...k];
|
|
125
125
|
const r = o[n], t = r.propertyMappings.findIndex(
|
|
126
|
-
(l) => l.key ===
|
|
126
|
+
(l) => l.key === p
|
|
127
127
|
), e = r.propertyMappings[t];
|
|
128
128
|
if (h.set(
|
|
129
129
|
o,
|
|
130
130
|
`${n}.propertyMappings.${t}.sourceField`,
|
|
131
131
|
d.target.value
|
|
132
|
-
),
|
|
132
|
+
), j(o), T && a) {
|
|
133
133
|
const l = h.get(
|
|
134
134
|
o,
|
|
135
135
|
`${n}.propertyMappings.${t}.source`
|
|
136
136
|
);
|
|
137
137
|
if (l === "OBJECT") {
|
|
138
|
-
if (
|
|
138
|
+
if (I) {
|
|
139
139
|
const u = h.get(
|
|
140
|
-
|
|
140
|
+
I.variables,
|
|
141
141
|
`${e.dataType.type}.${d.target.value}`
|
|
142
142
|
) || "";
|
|
143
143
|
S(
|
|
@@ -170,7 +170,7 @@ const $e = ({
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}, te = (n, d) => {
|
|
173
|
-
let
|
|
173
|
+
let p = {
|
|
174
174
|
field: "value",
|
|
175
175
|
headerName: "Value",
|
|
176
176
|
sortable: !1,
|
|
@@ -180,39 +180,39 @@ const $e = ({
|
|
|
180
180
|
renderCell: (r) => {
|
|
181
181
|
var x, g;
|
|
182
182
|
const { key: t, dataType: e } = r.row;
|
|
183
|
-
let l = "", u = /* @__PURE__ */ i(b, {}), y = /* @__PURE__ */ i(b, {}),
|
|
183
|
+
let l = "", u = /* @__PURE__ */ i(b, {}), y = /* @__PURE__ */ i(b, {}), s = r.row.source;
|
|
184
184
|
if (T && a) {
|
|
185
|
-
const
|
|
185
|
+
const c = a.propertyInfoMap.find(
|
|
186
186
|
(w) => w.key === t && w.policyKey === n.key
|
|
187
187
|
);
|
|
188
|
-
if (
|
|
189
|
-
const { valid: w, validationErrors:
|
|
190
|
-
l =
|
|
188
|
+
if (c) {
|
|
189
|
+
const { valid: w, validationErrors: z } = c;
|
|
190
|
+
l = c.value, s = c.source, w === !1 && (u = /* @__PURE__ */ i(
|
|
191
191
|
ne,
|
|
192
192
|
{
|
|
193
193
|
color: "error",
|
|
194
194
|
fontSize: "small",
|
|
195
195
|
sx: { ml: 1 },
|
|
196
|
-
titleAccess:
|
|
196
|
+
titleAccess: z ? z.join(", ") : "Value is not valid!"
|
|
197
197
|
}
|
|
198
|
-
)),
|
|
199
|
-
`${h.get(a, "referenceObjectInstanceId")}:${
|
|
198
|
+
)), s && (L.get(
|
|
199
|
+
`${h.get(a, "referenceObjectInstanceId")}:${c.policyKey}:${c.key}`
|
|
200
200
|
) === "Updated" ? y = /* @__PURE__ */ i(oe, { color: "success", sx: { mr: 1 }, titleAccess: "Updated" }) : y = /* @__PURE__ */ i(
|
|
201
|
-
|
|
201
|
+
J,
|
|
202
202
|
{
|
|
203
|
-
onClick: Y(
|
|
204
|
-
title: `Reload value from the ${
|
|
203
|
+
onClick: Y(c),
|
|
204
|
+
title: `Reload value from the ${s === "OBJECT" ? "Object" : "Catalogue"}`,
|
|
205
205
|
children: /* @__PURE__ */ i(ae, {})
|
|
206
206
|
}
|
|
207
207
|
));
|
|
208
208
|
}
|
|
209
|
-
if (
|
|
209
|
+
if (s === "STATIC") {
|
|
210
210
|
const w = (x = C == null ? void 0 : C.environment.context) != null && x.boundingBox ? ye(C.environment.context.boundingBox) : void 0;
|
|
211
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ f(b, { children: [
|
|
212
212
|
/* @__PURE__ */ i(
|
|
213
213
|
he,
|
|
214
214
|
{
|
|
215
|
-
mapboxAccessToken:
|
|
215
|
+
mapboxAccessToken: E,
|
|
216
216
|
property: {
|
|
217
217
|
propertyId: "value",
|
|
218
218
|
type: e.type,
|
|
@@ -231,24 +231,24 @@ const $e = ({
|
|
|
231
231
|
u
|
|
232
232
|
] });
|
|
233
233
|
}
|
|
234
|
-
if (
|
|
235
|
-
return /* @__PURE__ */
|
|
234
|
+
if (s === "RANDOM" || s === "SMART_RANDOM")
|
|
235
|
+
return /* @__PURE__ */ f(b, { children: [
|
|
236
236
|
/* @__PURE__ */ i(
|
|
237
237
|
me,
|
|
238
238
|
{
|
|
239
239
|
type: e.type,
|
|
240
|
-
value:
|
|
240
|
+
value: c == null ? void 0 : c.randomInfo,
|
|
241
241
|
innerType: (g = e.innerType) == null ? void 0 : g.type,
|
|
242
242
|
minDate: C ? C.startTime : "",
|
|
243
243
|
maxDate: C ? C.endTime : "",
|
|
244
|
-
mapboxAccessToken:
|
|
244
|
+
mapboxAccessToken: E,
|
|
245
245
|
onChange: Z(n.key, t)
|
|
246
246
|
}
|
|
247
247
|
),
|
|
248
248
|
u
|
|
249
249
|
] });
|
|
250
250
|
}
|
|
251
|
-
return h.isArray(l) && (l = l.join(", ")), /* @__PURE__ */
|
|
251
|
+
return h.isArray(l) && (l = l.join(", ")), /* @__PURE__ */ f(
|
|
252
252
|
m,
|
|
253
253
|
{
|
|
254
254
|
display: "flex",
|
|
@@ -256,7 +256,7 @@ const $e = ({
|
|
|
256
256
|
alignItems: "center",
|
|
257
257
|
width: "100%",
|
|
258
258
|
children: [
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ f(m, { flex: 1, children: [
|
|
260
260
|
l,
|
|
261
261
|
u
|
|
262
262
|
] }),
|
|
@@ -274,7 +274,7 @@ const $e = ({
|
|
|
274
274
|
filterable: !1,
|
|
275
275
|
disableColumnMenu: !0,
|
|
276
276
|
flex: 1,
|
|
277
|
-
renderCell: (r) => /* @__PURE__ */
|
|
277
|
+
renderCell: (r) => /* @__PURE__ */ f(
|
|
278
278
|
m,
|
|
279
279
|
{
|
|
280
280
|
sx: {
|
|
@@ -339,8 +339,8 @@ const $e = ({
|
|
|
339
339
|
);
|
|
340
340
|
e && (t = e.source || "");
|
|
341
341
|
}
|
|
342
|
-
return /* @__PURE__ */ i(
|
|
343
|
-
|
|
342
|
+
return /* @__PURE__ */ i(V, { fullWidth: !0, size: "small", children: /* @__PURE__ */ f(
|
|
343
|
+
_,
|
|
344
344
|
{
|
|
345
345
|
onChange: ee(d),
|
|
346
346
|
name: String(r.id),
|
|
@@ -365,43 +365,43 @@ const $e = ({
|
|
|
365
365
|
const { dataType: t } = r.row;
|
|
366
366
|
let e = r.row.source, l = r.row.sourceField;
|
|
367
367
|
if (a) {
|
|
368
|
-
const
|
|
368
|
+
const s = a.propertyInfoMap.find(
|
|
369
369
|
(x) => x.policyKey === n.key && x.key === r.id
|
|
370
370
|
);
|
|
371
|
-
|
|
371
|
+
s && (e = s.source, l = s.sourceField || "");
|
|
372
372
|
}
|
|
373
373
|
let u = l || "";
|
|
374
374
|
if (e === "RANDOM" || e === "STATIC" || e === "SMART_RANDOM")
|
|
375
375
|
return /* @__PURE__ */ i(b, {});
|
|
376
376
|
let y = [];
|
|
377
377
|
if (e === "OBJECT")
|
|
378
|
-
y = q.properties.map((
|
|
379
|
-
value:
|
|
380
|
-
text:
|
|
378
|
+
y = q.properties.map((s) => ({
|
|
379
|
+
value: s.propertyId,
|
|
380
|
+
text: s.name
|
|
381
381
|
}));
|
|
382
382
|
else if (e !== null) {
|
|
383
|
-
const
|
|
384
|
-
(g) => g.id ===
|
|
383
|
+
const s = Number(e), x = v == null ? void 0 : v.find(
|
|
384
|
+
(g) => g.id === s
|
|
385
385
|
);
|
|
386
|
-
if (x &&
|
|
387
|
-
const g =
|
|
388
|
-
(
|
|
386
|
+
if (x && K) {
|
|
387
|
+
const g = K.find(
|
|
388
|
+
(c) => c.templateKey === x.template.templateKey
|
|
389
389
|
);
|
|
390
|
-
g && (y = g.properties.map((
|
|
391
|
-
value:
|
|
392
|
-
text:
|
|
390
|
+
g && (y = g.properties.filter((c) => c.type === t.type).map((c) => ({
|
|
391
|
+
value: c.propertyId,
|
|
392
|
+
text: c.name
|
|
393
393
|
})));
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
return /* @__PURE__ */ i(
|
|
397
|
-
|
|
396
|
+
return /* @__PURE__ */ i(V, { fullWidth: !0, size: "small", children: /* @__PURE__ */ f(
|
|
397
|
+
_,
|
|
398
398
|
{
|
|
399
399
|
onChange: re(d),
|
|
400
400
|
name: String(r.id),
|
|
401
401
|
value: u,
|
|
402
402
|
children: [
|
|
403
|
-
y.map((
|
|
404
|
-
y.length === 0 && /* @__PURE__ */
|
|
403
|
+
y.map((s, x) => /* @__PURE__ */ i(A, { value: s.value, children: s.text }, x)),
|
|
404
|
+
y.length === 0 && /* @__PURE__ */ f(A, { disabled: !0, children: [
|
|
405
405
|
"No ",
|
|
406
406
|
t.type,
|
|
407
407
|
" property found!"
|
|
@@ -412,22 +412,22 @@ const $e = ({
|
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
];
|
|
415
|
-
return T ? [...o,
|
|
415
|
+
return T ? [...o, p] : o;
|
|
416
416
|
};
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
|
|
417
|
+
return /* @__PURE__ */ f(de, { open: F, fullWidth: !0, maxWidth: "lg", onClose: O, children: [
|
|
418
|
+
/* @__PURE__ */ f(
|
|
419
|
+
pe,
|
|
420
420
|
{
|
|
421
421
|
component: "div",
|
|
422
422
|
lineHeight: 1,
|
|
423
423
|
display: "flex",
|
|
424
424
|
justifyContent: "space-between",
|
|
425
425
|
children: [
|
|
426
|
-
/* @__PURE__ */ i(m, { children: a === void 0 ? /* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ i(m, { children: a === void 0 ? /* @__PURE__ */ f(b, { children: [
|
|
427
427
|
/* @__PURE__ */ i($, { variant: "h6", children: "Property Mapping" }),
|
|
428
428
|
/* @__PURE__ */ i($, { variant: "caption", children: "Map policy properties with object template or catalog istance properties" })
|
|
429
|
-
] }) : /* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
429
|
+
] }) : /* @__PURE__ */ f(m, { display: "flex", flex: 1, alignItems: "flex-start", children: [
|
|
430
|
+
/* @__PURE__ */ f(
|
|
431
431
|
m,
|
|
432
432
|
{
|
|
433
433
|
display: "flex",
|
|
@@ -436,13 +436,13 @@ const $e = ({
|
|
|
436
436
|
minWidth: 200,
|
|
437
437
|
children: [
|
|
438
438
|
/* @__PURE__ */ i(
|
|
439
|
-
|
|
439
|
+
R,
|
|
440
440
|
{
|
|
441
441
|
name: "name",
|
|
442
442
|
variant: "standard",
|
|
443
443
|
value: a.name,
|
|
444
444
|
placeholder: "Add name",
|
|
445
|
-
onChange:
|
|
445
|
+
onChange: D,
|
|
446
446
|
sx: {
|
|
447
447
|
"& .MuiInputBase-root:before": {
|
|
448
448
|
border: "none"
|
|
@@ -451,14 +451,14 @@ const $e = ({
|
|
|
451
451
|
}
|
|
452
452
|
),
|
|
453
453
|
"description" in a && /* @__PURE__ */ i(
|
|
454
|
-
|
|
454
|
+
R,
|
|
455
455
|
{
|
|
456
456
|
name: "description",
|
|
457
457
|
variant: "standard",
|
|
458
458
|
size: "small",
|
|
459
459
|
value: a.description,
|
|
460
460
|
placeholder: "Add description",
|
|
461
|
-
onChange:
|
|
461
|
+
onChange: D,
|
|
462
462
|
sx: {
|
|
463
463
|
"& .MuiInputBase-root:before": {
|
|
464
464
|
border: "none"
|
|
@@ -469,9 +469,9 @@ const $e = ({
|
|
|
469
469
|
]
|
|
470
470
|
}
|
|
471
471
|
),
|
|
472
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ f(m, { ml: 4, children: [
|
|
473
473
|
"count" in a && /* @__PURE__ */ i(
|
|
474
|
-
|
|
474
|
+
R,
|
|
475
475
|
{
|
|
476
476
|
name: "count",
|
|
477
477
|
label: "Count",
|
|
@@ -479,11 +479,11 @@ const $e = ({
|
|
|
479
479
|
required: !0,
|
|
480
480
|
sx: { width: 100, mr: 1 },
|
|
481
481
|
value: a.count,
|
|
482
|
-
onChange:
|
|
482
|
+
onChange: D
|
|
483
483
|
}
|
|
484
484
|
),
|
|
485
485
|
"criticalityScore" in a && /* @__PURE__ */ i(
|
|
486
|
-
|
|
486
|
+
R,
|
|
487
487
|
{
|
|
488
488
|
name: "criticalityScore",
|
|
489
489
|
label: "Criticality Score",
|
|
@@ -492,26 +492,26 @@ const $e = ({
|
|
|
492
492
|
title: "Should be between 0 and 1",
|
|
493
493
|
sx: { width: 150 },
|
|
494
494
|
value: a.criticalityScore,
|
|
495
|
-
onChange:
|
|
495
|
+
onChange: D
|
|
496
496
|
}
|
|
497
497
|
)
|
|
498
498
|
] })
|
|
499
499
|
] }) }),
|
|
500
|
-
/* @__PURE__ */ i(m, { flex: 1, textAlign: "end", children: /* @__PURE__ */ i(
|
|
500
|
+
/* @__PURE__ */ i(m, { flex: 1, textAlign: "end", children: /* @__PURE__ */ i(J, { onClick: O, children: /* @__PURE__ */ i(le, {}) }) })
|
|
501
501
|
]
|
|
502
502
|
}
|
|
503
503
|
),
|
|
504
|
-
/* @__PURE__ */ i(
|
|
504
|
+
/* @__PURE__ */ i(se, { sx: { minHeight: 300 }, children: k.map((n, d) => /* @__PURE__ */ f(
|
|
505
505
|
m,
|
|
506
506
|
{
|
|
507
|
-
boxShadow: (
|
|
507
|
+
boxShadow: (p) => p.shadows[1],
|
|
508
508
|
mt: 0.1,
|
|
509
509
|
mb: 2,
|
|
510
510
|
overflow: "hidden",
|
|
511
511
|
borderRadius: 1,
|
|
512
512
|
children: [
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */ i($, { children: n.catalogInstances.map((
|
|
513
|
+
/* @__PURE__ */ f(m, { display: "flex", alignItems: "center", p: 2, children: [
|
|
514
|
+
/* @__PURE__ */ i($, { children: n.catalogInstances.map((p) => p.name).join(", ") }),
|
|
515
515
|
/* @__PURE__ */ i(ie, { color: "disabled", sx: { mx: 1 } }),
|
|
516
516
|
/* @__PURE__ */ i($, { variant: "caption", color: "GrayText", children: n.name || n.key })
|
|
517
517
|
] }),
|
|
@@ -525,28 +525,28 @@ const $e = ({
|
|
|
525
525
|
sx: {
|
|
526
526
|
border: "none",
|
|
527
527
|
"& .MuiDataGrid-columnHeadersInner": {
|
|
528
|
-
backgroundColor: (
|
|
528
|
+
backgroundColor: (p) => p.palette.grey[200]
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
531
|
hideFooterPagination: !0,
|
|
532
532
|
hideFooter: !0,
|
|
533
|
-
getRowId: (
|
|
533
|
+
getRowId: (p) => p.key
|
|
534
534
|
}
|
|
535
535
|
)
|
|
536
536
|
]
|
|
537
537
|
},
|
|
538
538
|
d
|
|
539
539
|
)) }),
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */ i(
|
|
540
|
+
/* @__PURE__ */ f(ce, { children: [
|
|
541
|
+
/* @__PURE__ */ i(W, { color: "inherit", variant: "contained", onClick: O, children: "Cancel" }),
|
|
542
542
|
/* @__PURE__ */ i(
|
|
543
|
-
|
|
543
|
+
W,
|
|
544
544
|
{
|
|
545
545
|
color: "primary",
|
|
546
546
|
variant: "contained",
|
|
547
|
-
disabled: k.length === 0 ||
|
|
547
|
+
disabled: k.length === 0 || B,
|
|
548
548
|
onClick: Q,
|
|
549
|
-
children:
|
|
549
|
+
children: B ? "Saving..." : "Save"
|
|
550
550
|
}
|
|
551
551
|
)
|
|
552
552
|
] })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, Fragment as S, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as T } from "react";
|
|
3
|
-
import { Box as
|
|
3
|
+
import { Box as l, TextField as k, InputAdornment as w, Button as a, Dialog as j, DialogTitle as A, Typography as m, IconButton as D, DialogContent as B, DialogActions as M } from "@mui/material";
|
|
4
4
|
import { CloseOutlined as O } from "@mui/icons-material";
|
|
5
5
|
import P from "../../../../hooks/useToggle.js";
|
|
6
6
|
import { SearchInput as W } from "../../../search-input/index.js";
|
|
@@ -8,27 +8,27 @@ import { InstanceHierarchyTable as F } from "../../../instance-hierarchy-table/i
|
|
|
8
8
|
import { PropertyMapping as H } from "../../../property-mapping/index.js";
|
|
9
9
|
const K = ({
|
|
10
10
|
inputVariant: c,
|
|
11
|
-
templates:
|
|
11
|
+
templates: r,
|
|
12
12
|
data: d,
|
|
13
|
-
onSelect:
|
|
14
|
-
onSearchSubmit:
|
|
15
|
-
openMapping:
|
|
13
|
+
onSelect: p,
|
|
14
|
+
onSearchSubmit: u,
|
|
15
|
+
openMapping: s,
|
|
16
16
|
mappingData: g,
|
|
17
17
|
objectTemplate: f,
|
|
18
|
-
selectedInstances:
|
|
18
|
+
selectedInstances: t = [],
|
|
19
19
|
mapboxAccessToken: x,
|
|
20
20
|
onMappingSubmit: C,
|
|
21
|
-
onMappingOpen:
|
|
21
|
+
onMappingOpen: h,
|
|
22
22
|
onMappingClose: y
|
|
23
23
|
}) => {
|
|
24
24
|
const o = P(!1), b = T(
|
|
25
|
-
() => Array.from(
|
|
26
|
-
[
|
|
25
|
+
() => Array.from(r, ([n, I]) => I),
|
|
26
|
+
[r]
|
|
27
27
|
), v = (n) => {
|
|
28
|
-
o.action.close(),
|
|
28
|
+
o.action.close(), h(n);
|
|
29
29
|
};
|
|
30
30
|
return /* @__PURE__ */ i(S, { children: [
|
|
31
|
-
/* @__PURE__ */ e(
|
|
31
|
+
/* @__PURE__ */ e(l, { mb: 2, position: "relative", children: /* @__PURE__ */ e(
|
|
32
32
|
k,
|
|
33
33
|
{
|
|
34
34
|
label: "Catalogue Instance(s)",
|
|
@@ -41,12 +41,12 @@ const K = ({
|
|
|
41
41
|
{
|
|
42
42
|
variant: "contained",
|
|
43
43
|
size: "small",
|
|
44
|
-
onClick:
|
|
44
|
+
onClick: h,
|
|
45
45
|
children: "Edit Mapping"
|
|
46
46
|
}
|
|
47
47
|
) })
|
|
48
48
|
},
|
|
49
|
-
value:
|
|
49
|
+
value: t.map((n) => n.title).join(", "),
|
|
50
50
|
onClick: o.action.open
|
|
51
51
|
}
|
|
52
52
|
) }),
|
|
@@ -66,12 +66,12 @@ const K = ({
|
|
|
66
66
|
display: "flex",
|
|
67
67
|
justifyContent: "space-between",
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */ i(
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
/* @__PURE__ */ e(
|
|
69
|
+
/* @__PURE__ */ i(l, { flex: 1, children: [
|
|
70
|
+
/* @__PURE__ */ e(m, { variant: "h6", children: "Catalogue Instance" }),
|
|
71
|
+
/* @__PURE__ */ e(m, { variant: "caption", children: "Search and select catalogue instance(s)" })
|
|
72
72
|
] }),
|
|
73
73
|
/* @__PURE__ */ i(
|
|
74
|
-
|
|
74
|
+
l,
|
|
75
75
|
{
|
|
76
76
|
flex: 1,
|
|
77
77
|
flexGrow: 1,
|
|
@@ -84,7 +84,7 @@ const K = ({
|
|
|
84
84
|
{
|
|
85
85
|
variant: c,
|
|
86
86
|
sx: { width: 300 },
|
|
87
|
-
onSubmit:
|
|
87
|
+
onSubmit: u
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
/* @__PURE__ */ e(
|
|
@@ -101,8 +101,8 @@ const K = ({
|
|
|
101
101
|
]
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
|
|
104
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
105
|
+
l,
|
|
106
106
|
{
|
|
107
107
|
boxShadow: (n) => n.shadows[1],
|
|
108
108
|
mt: 0.1,
|
|
@@ -112,15 +112,15 @@ const K = ({
|
|
|
112
112
|
F,
|
|
113
113
|
{
|
|
114
114
|
data: d,
|
|
115
|
-
templates:
|
|
115
|
+
templates: r,
|
|
116
116
|
enableCheckboxSelection: !0,
|
|
117
|
-
selectedIds:
|
|
118
|
-
onSelect:
|
|
117
|
+
selectedIds: t.map((n) => n.id),
|
|
118
|
+
onSelect: p
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
}
|
|
122
122
|
) }),
|
|
123
|
-
/* @__PURE__ */ i(
|
|
123
|
+
/* @__PURE__ */ i(M, { children: [
|
|
124
124
|
/* @__PURE__ */ e(
|
|
125
125
|
a,
|
|
126
126
|
{
|
|
@@ -135,7 +135,7 @@ const K = ({
|
|
|
135
135
|
{
|
|
136
136
|
color: "primary",
|
|
137
137
|
variant: "contained",
|
|
138
|
-
disabled:
|
|
138
|
+
disabled: t.length === 0,
|
|
139
139
|
onClick: v,
|
|
140
140
|
children: "Property Mapping"
|
|
141
141
|
}
|
|
@@ -144,15 +144,16 @@ const K = ({
|
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
147
|
+
s && /* @__PURE__ */ e(
|
|
148
148
|
H,
|
|
149
149
|
{
|
|
150
150
|
data: g,
|
|
151
151
|
objectTemplate: f,
|
|
152
152
|
agentTemplates: b,
|
|
153
|
+
catalogueInstances: t,
|
|
153
154
|
mapboxAccessToken: x,
|
|
154
155
|
onSubmit: C,
|
|
155
|
-
open:
|
|
156
|
+
open: s,
|
|
156
157
|
onClose: y
|
|
157
158
|
}
|
|
158
159
|
)
|