@hybridcore/ui 1.5.43 → 1.5.45
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,42 +1,42 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { b64toBlob as
|
|
1
|
+
import { useRef as f, useState as s, useEffect as g } from "react";
|
|
2
|
+
import { b64toBlob as b, printBlob as w, downloadBlob as p } from "./utils.js";
|
|
3
3
|
const D = ({
|
|
4
|
-
data:
|
|
5
|
-
title:
|
|
6
|
-
rightPanel:
|
|
7
|
-
rightPanelWidth:
|
|
4
|
+
data: e,
|
|
5
|
+
title: c,
|
|
6
|
+
rightPanel: u,
|
|
7
|
+
rightPanelWidth: n = 450
|
|
8
8
|
}) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
|
|
9
|
+
const t = f(null), [o, a] = s();
|
|
10
|
+
g(() => ((async () => {
|
|
11
|
+
if (e) {
|
|
12
|
+
const i = await b(e, "application/pdf");
|
|
13
|
+
console.log(await i.text()), a(i);
|
|
14
14
|
}
|
|
15
15
|
})(), () => {
|
|
16
|
-
}), [
|
|
17
|
-
const [
|
|
18
|
-
|
|
16
|
+
}), [e]);
|
|
17
|
+
const [l, r] = s(
|
|
18
|
+
u ? n : 0
|
|
19
19
|
);
|
|
20
20
|
return {
|
|
21
21
|
refs: {
|
|
22
|
-
viewer:
|
|
22
|
+
viewer: t
|
|
23
23
|
},
|
|
24
24
|
state: {
|
|
25
|
-
blob:
|
|
26
|
-
rightPanelWidth:
|
|
25
|
+
blob: o,
|
|
26
|
+
rightPanelWidth: l
|
|
27
27
|
},
|
|
28
28
|
action: {
|
|
29
29
|
onPrint: () => {
|
|
30
|
-
|
|
30
|
+
o && w(o);
|
|
31
31
|
},
|
|
32
32
|
onFullScreen: () => {
|
|
33
|
-
|
|
33
|
+
t.current && t.current.requestFullscreen();
|
|
34
34
|
},
|
|
35
35
|
onDownload: () => {
|
|
36
|
-
|
|
36
|
+
o && p(o, c);
|
|
37
37
|
},
|
|
38
38
|
toggleRightPanel: () => {
|
|
39
|
-
|
|
39
|
+
r(l ? 0 : n);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { jsxs as c, 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 se, Box as m, Typography as $, TextField as D, IconButton as W, DialogContent as pe, DialogActions as ce, Button as V, FormControl as _, Select as H, 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 P, 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: I,
|
|
12
|
+
data: K,
|
|
13
13
|
objectTemplate: q,
|
|
14
14
|
agent: a,
|
|
15
15
|
enableValueInput: T,
|
|
16
|
-
loading:
|
|
17
|
-
agentTemplates:
|
|
16
|
+
loading: E,
|
|
17
|
+
agentTemplates: j,
|
|
18
18
|
catalogueInstances: v,
|
|
19
|
-
objectInstance:
|
|
19
|
+
objectInstance: O,
|
|
20
20
|
disableCatalogueSource: G,
|
|
21
21
|
disableObjectSource: U,
|
|
22
22
|
scenario: C,
|
|
23
|
-
mapboxAccessToken:
|
|
23
|
+
mapboxAccessToken: z,
|
|
24
24
|
onSubmit: M,
|
|
25
|
-
onClose:
|
|
25
|
+
onClose: N
|
|
26
26
|
}) => {
|
|
27
|
-
const [k,
|
|
28
|
-
ue(() => (
|
|
29
|
-
}), [
|
|
27
|
+
const [k, F] = P(K), [L, B] = P(/* @__PURE__ */ new Map());
|
|
28
|
+
ue(() => (B(/* @__PURE__ */ new Map()), I && F(K), () => {
|
|
29
|
+
}), [I]);
|
|
30
30
|
const Q = () => {
|
|
31
31
|
a ? M(a, !0) : M(k);
|
|
32
|
-
},
|
|
33
|
-
const { name: d, value:
|
|
34
|
-
let o =
|
|
32
|
+
}, R = (n) => {
|
|
33
|
+
const { name: d, value: s } = n.target;
|
|
34
|
+
let o = s;
|
|
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, s, 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: s ? s || "" : 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: s, source: o, sourceField: r } = n;
|
|
56
56
|
let t = "";
|
|
57
57
|
if (o === "OBJECT")
|
|
58
58
|
t = h.get(
|
|
59
|
-
|
|
59
|
+
O,
|
|
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, s)({ value: t }), B((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}:${s}`,
|
|
77
77
|
"Updated"
|
|
78
78
|
), l;
|
|
79
79
|
}), setTimeout(() => {
|
|
80
|
-
|
|
80
|
+
B((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}:${s}`,
|
|
87
87
|
"Default"
|
|
88
88
|
), l;
|
|
89
89
|
});
|
|
90
90
|
}, 2e3));
|
|
91
|
-
}, Z = (n, d) => (
|
|
91
|
+
}, Z = (n, d) => (s) => {
|
|
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: s
|
|
100
100
|
}), M && M({ ...a, propertyInfoMap: o }));
|
|
101
101
|
}
|
|
102
102
|
}, ee = (n) => (d) => {
|
|
103
|
-
const
|
|
103
|
+
const s = 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 === s
|
|
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
|
+
), F(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 s = 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 === s
|
|
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
|
+
), F(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 (O) {
|
|
139
139
|
const u = h.get(
|
|
140
|
-
|
|
140
|
+
O.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 s = {
|
|
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, {}), p = r.row.source;
|
|
184
184
|
if (T && a) {
|
|
185
185
|
const f = a.propertyInfoMap.find(
|
|
186
186
|
(w) => w.key === t && w.policyKey === n.key
|
|
187
187
|
);
|
|
188
188
|
if (f) {
|
|
189
|
-
const { valid: w, validationErrors:
|
|
190
|
-
l = f.value,
|
|
189
|
+
const { valid: w, validationErrors: J } = f;
|
|
190
|
+
l = f.value, p = f.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: J ? J.join(", ") : "Value is not valid!"
|
|
197
197
|
}
|
|
198
|
-
)),
|
|
198
|
+
)), p && (L.get(
|
|
199
199
|
`${h.get(a, "referenceObjectInstanceId")}:${f.policyKey}:${f.key}`
|
|
200
200
|
) === "Updated" ? y = /* @__PURE__ */ i(oe, { color: "success", sx: { mr: 1 }, titleAccess: "Updated" }) : y = /* @__PURE__ */ i(
|
|
201
|
-
|
|
201
|
+
W,
|
|
202
202
|
{
|
|
203
203
|
onClick: Y(f),
|
|
204
|
-
title: `Reload value from the ${
|
|
204
|
+
title: `Reload value from the ${p === "OBJECT" ? "Object" : "Catalogue"}`,
|
|
205
205
|
children: /* @__PURE__ */ i(ae, {})
|
|
206
206
|
}
|
|
207
207
|
));
|
|
208
208
|
}
|
|
209
|
-
if (
|
|
209
|
+
if (p === "STATIC") {
|
|
210
210
|
const w = (x = C == null ? void 0 : C.environment.context) != null && x.boundingBox ? ye(C.environment.context.boundingBox) : void 0;
|
|
211
211
|
return /* @__PURE__ */ c(b, { children: [
|
|
212
212
|
/* @__PURE__ */ i(
|
|
213
213
|
he,
|
|
214
214
|
{
|
|
215
|
-
mapboxAccessToken:
|
|
215
|
+
mapboxAccessToken: z,
|
|
216
216
|
property: {
|
|
217
217
|
propertyId: "value",
|
|
218
218
|
type: e.type,
|
|
@@ -231,7 +231,7 @@ const $e = ({
|
|
|
231
231
|
u
|
|
232
232
|
] });
|
|
233
233
|
}
|
|
234
|
-
if (
|
|
234
|
+
if (p === "RANDOM" || p === "SMART_RANDOM")
|
|
235
235
|
return /* @__PURE__ */ c(b, { children: [
|
|
236
236
|
/* @__PURE__ */ i(
|
|
237
237
|
me,
|
|
@@ -241,7 +241,7 @@ const $e = ({
|
|
|
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: z,
|
|
245
245
|
onChange: Z(n.key, t)
|
|
246
246
|
}
|
|
247
247
|
),
|
|
@@ -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(_, { fullWidth: !0, size: "small", children: /* @__PURE__ */ c(
|
|
343
|
+
H,
|
|
344
344
|
{
|
|
345
345
|
onChange: ee(d),
|
|
346
346
|
name: String(r.id),
|
|
@@ -365,26 +365,26 @@ 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 p = a.propertyInfoMap.find(
|
|
369
369
|
(x) => x.policyKey === n.key && x.key === r.id
|
|
370
370
|
);
|
|
371
|
-
|
|
371
|
+
p && (e = p.source, l = p.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((p) => ({
|
|
379
|
+
value: p.propertyId,
|
|
380
|
+
text: p.name
|
|
381
381
|
}));
|
|
382
382
|
else if (e !== null) {
|
|
383
|
-
const
|
|
384
|
-
(g) => g.id ===
|
|
383
|
+
const p = Number(e), x = v == null ? void 0 : v.find(
|
|
384
|
+
(g) => g.id === p
|
|
385
385
|
);
|
|
386
|
-
if (x &&
|
|
387
|
-
const g =
|
|
386
|
+
if (x && j) {
|
|
387
|
+
const g = j.find(
|
|
388
388
|
(f) => f.templateKey === x.template.templateKey
|
|
389
389
|
);
|
|
390
390
|
g && (y = g.properties.map((f) => ({
|
|
@@ -393,14 +393,14 @@ const $e = ({
|
|
|
393
393
|
})));
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
return /* @__PURE__ */ i(
|
|
397
|
-
|
|
396
|
+
return /* @__PURE__ */ i(_, { fullWidth: !0, size: "small", children: /* @__PURE__ */ c(
|
|
397
|
+
H,
|
|
398
398
|
{
|
|
399
399
|
onChange: re(d),
|
|
400
400
|
name: String(r.id),
|
|
401
401
|
value: u,
|
|
402
402
|
children: [
|
|
403
|
-
y.map((
|
|
403
|
+
y.map((p, x) => /* @__PURE__ */ i(A, { value: p.value, children: p.text }, x)),
|
|
404
404
|
y.length === 0 && /* @__PURE__ */ c(A, { disabled: !0, children: [
|
|
405
405
|
"No ",
|
|
406
406
|
t.type,
|
|
@@ -412,11 +412,11 @@ const $e = ({
|
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
];
|
|
415
|
-
return T ? [...o,
|
|
415
|
+
return T ? [...o, s] : o;
|
|
416
416
|
};
|
|
417
|
-
return /* @__PURE__ */ c(de, { open:
|
|
417
|
+
return /* @__PURE__ */ c(de, { open: I, fullWidth: !0, maxWidth: "lg", onClose: N, children: [
|
|
418
418
|
/* @__PURE__ */ c(
|
|
419
|
-
|
|
419
|
+
se,
|
|
420
420
|
{
|
|
421
421
|
component: "div",
|
|
422
422
|
lineHeight: 1,
|
|
@@ -436,13 +436,13 @@ const $e = ({
|
|
|
436
436
|
minWidth: 200,
|
|
437
437
|
children: [
|
|
438
438
|
/* @__PURE__ */ i(
|
|
439
|
-
|
|
439
|
+
D,
|
|
440
440
|
{
|
|
441
441
|
name: "name",
|
|
442
442
|
variant: "standard",
|
|
443
443
|
value: a.name,
|
|
444
444
|
placeholder: "Add name",
|
|
445
|
-
onChange:
|
|
445
|
+
onChange: R,
|
|
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
|
+
D,
|
|
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: R,
|
|
462
462
|
sx: {
|
|
463
463
|
"& .MuiInputBase-root:before": {
|
|
464
464
|
border: "none"
|
|
@@ -471,7 +471,7 @@ const $e = ({
|
|
|
471
471
|
),
|
|
472
472
|
/* @__PURE__ */ c(m, { ml: 4, children: [
|
|
473
473
|
"count" in a && /* @__PURE__ */ i(
|
|
474
|
-
|
|
474
|
+
D,
|
|
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: R
|
|
483
483
|
}
|
|
484
484
|
),
|
|
485
485
|
"criticalityScore" in a && /* @__PURE__ */ i(
|
|
486
|
-
|
|
486
|
+
D,
|
|
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: R
|
|
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(W, { onClick: N, children: /* @__PURE__ */ i(le, {}) }) })
|
|
501
501
|
]
|
|
502
502
|
}
|
|
503
503
|
),
|
|
504
|
-
/* @__PURE__ */ i(
|
|
504
|
+
/* @__PURE__ */ i(pe, { sx: { minHeight: 300 }, children: k.map((n, d) => /* @__PURE__ */ c(
|
|
505
505
|
m,
|
|
506
506
|
{
|
|
507
|
-
boxShadow: (
|
|
507
|
+
boxShadow: (s) => s.shadows[1],
|
|
508
508
|
mt: 0.1,
|
|
509
509
|
mb: 2,
|
|
510
510
|
overflow: "hidden",
|
|
511
511
|
borderRadius: 1,
|
|
512
512
|
children: [
|
|
513
513
|
/* @__PURE__ */ c(m, { display: "flex", alignItems: "center", p: 2, children: [
|
|
514
|
-
/* @__PURE__ */ i($, { children: n.catalogInstances.map((
|
|
514
|
+
/* @__PURE__ */ i($, { children: n.catalogInstances.map((s) => s.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,12 +525,12 @@ const $e = ({
|
|
|
525
525
|
sx: {
|
|
526
526
|
border: "none",
|
|
527
527
|
"& .MuiDataGrid-columnHeadersInner": {
|
|
528
|
-
backgroundColor: (
|
|
528
|
+
backgroundColor: (s) => s.palette.grey[200]
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
531
|
hideFooterPagination: !0,
|
|
532
532
|
hideFooter: !0,
|
|
533
|
-
getRowId: (
|
|
533
|
+
getRowId: (s) => s.key
|
|
534
534
|
}
|
|
535
535
|
)
|
|
536
536
|
]
|
|
@@ -538,15 +538,15 @@ const $e = ({
|
|
|
538
538
|
d
|
|
539
539
|
)) }),
|
|
540
540
|
/* @__PURE__ */ c(ce, { children: [
|
|
541
|
-
/* @__PURE__ */ i(
|
|
541
|
+
/* @__PURE__ */ i(V, { color: "inherit", variant: "contained", onClick: N, children: "Cancel" }),
|
|
542
542
|
/* @__PURE__ */ i(
|
|
543
|
-
|
|
543
|
+
V,
|
|
544
544
|
{
|
|
545
545
|
color: "primary",
|
|
546
546
|
variant: "contained",
|
|
547
|
-
disabled: k.length === 0 ||
|
|
547
|
+
disabled: k.length === 0 || E,
|
|
548
548
|
onClick: Q,
|
|
549
|
-
children:
|
|
549
|
+
children: E ? "Saving..." : "Save"
|
|
550
550
|
}
|
|
551
551
|
)
|
|
552
552
|
] })
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as i, Fragment as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as T } from "react";
|
|
3
|
+
import { Box as t, TextField as k, InputAdornment as w, Button as a, Dialog as j, DialogTitle as A, Typography as p, IconButton as D, DialogContent as M, DialogActions as B } from "@mui/material";
|
|
4
|
+
import { CloseOutlined as O } from "@mui/icons-material";
|
|
5
|
+
import P from "../../../../hooks/useToggle.js";
|
|
6
|
+
import { SearchInput as W } from "../../../search-input/index.js";
|
|
7
|
+
import { InstanceHierarchyTable as F } from "../../../instance-hierarchy-table/index.js";
|
|
8
|
+
import { PropertyMapping as H } from "../../../property-mapping/index.js";
|
|
9
|
+
const K = ({
|
|
10
|
+
inputVariant: c,
|
|
11
|
+
templates: l,
|
|
12
|
+
data: d,
|
|
12
13
|
onSelect: h,
|
|
13
14
|
onSearchSubmit: m,
|
|
14
15
|
openMapping: u,
|
|
15
16
|
mappingData: g,
|
|
16
17
|
objectTemplate: f,
|
|
17
|
-
selectedInstances:
|
|
18
|
+
selectedInstances: r = [],
|
|
18
19
|
mapboxAccessToken: x,
|
|
19
20
|
onMappingSubmit: C,
|
|
20
|
-
onMappingOpen:
|
|
21
|
-
onMappingClose:
|
|
21
|
+
onMappingOpen: s,
|
|
22
|
+
onMappingClose: y
|
|
22
23
|
}) => {
|
|
23
|
-
const o =
|
|
24
|
-
|
|
24
|
+
const o = P(!1), b = T(
|
|
25
|
+
() => Array.from(l, ([n, I]) => I),
|
|
26
|
+
[l]
|
|
27
|
+
), v = (n) => {
|
|
28
|
+
o.action.close(), s(n);
|
|
25
29
|
};
|
|
26
|
-
return /* @__PURE__ */ i(
|
|
30
|
+
return /* @__PURE__ */ i(S, { children: [
|
|
27
31
|
/* @__PURE__ */ e(t, { mb: 2, position: "relative", children: /* @__PURE__ */ e(
|
|
28
|
-
|
|
32
|
+
k,
|
|
29
33
|
{
|
|
30
34
|
label: "Catalogue Instance(s)",
|
|
31
|
-
variant:
|
|
35
|
+
variant: c,
|
|
32
36
|
fullWidth: !0,
|
|
33
37
|
InputProps: {
|
|
34
38
|
readOnly: !0,
|
|
35
|
-
endAdornment: /* @__PURE__ */ e(
|
|
39
|
+
endAdornment: /* @__PURE__ */ e(w, { position: "end", children: /* @__PURE__ */ e(
|
|
36
40
|
a,
|
|
37
41
|
{
|
|
38
42
|
variant: "contained",
|
|
39
43
|
size: "small",
|
|
40
|
-
onClick:
|
|
44
|
+
onClick: s,
|
|
41
45
|
children: "Edit Mapping"
|
|
42
46
|
}
|
|
43
47
|
) })
|
|
44
48
|
},
|
|
45
|
-
value:
|
|
49
|
+
value: r.map((n) => n.title).join(", "),
|
|
46
50
|
onClick: o.action.open
|
|
47
51
|
}
|
|
48
52
|
) }),
|
|
49
53
|
/* @__PURE__ */ i(
|
|
50
|
-
|
|
54
|
+
j,
|
|
51
55
|
{
|
|
52
56
|
open: o.state.isOpen,
|
|
53
57
|
fullWidth: !0,
|
|
@@ -55,7 +59,7 @@ const R = ({
|
|
|
55
59
|
onClose: o.action.close,
|
|
56
60
|
children: [
|
|
57
61
|
/* @__PURE__ */ i(
|
|
58
|
-
|
|
62
|
+
A,
|
|
59
63
|
{
|
|
60
64
|
component: "div",
|
|
61
65
|
lineHeight: 1,
|
|
@@ -63,8 +67,8 @@ const R = ({
|
|
|
63
67
|
justifyContent: "space-between",
|
|
64
68
|
children: [
|
|
65
69
|
/* @__PURE__ */ i(t, { flex: 1, children: [
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
/* @__PURE__ */ e(
|
|
70
|
+
/* @__PURE__ */ e(p, { variant: "h6", children: "Catalogue Instance" }),
|
|
71
|
+
/* @__PURE__ */ e(p, { variant: "caption", children: "Search and select catalogue instance(s)" })
|
|
68
72
|
] }),
|
|
69
73
|
/* @__PURE__ */ i(
|
|
70
74
|
t,
|
|
@@ -76,19 +80,19 @@ const R = ({
|
|
|
76
80
|
justifyContent: "flex-end",
|
|
77
81
|
children: [
|
|
78
82
|
/* @__PURE__ */ e(
|
|
79
|
-
|
|
83
|
+
W,
|
|
80
84
|
{
|
|
81
|
-
variant:
|
|
85
|
+
variant: c,
|
|
82
86
|
sx: { width: 300 },
|
|
83
87
|
onSubmit: m
|
|
84
88
|
}
|
|
85
89
|
),
|
|
86
90
|
/* @__PURE__ */ e(
|
|
87
|
-
|
|
91
|
+
D,
|
|
88
92
|
{
|
|
89
93
|
onClick: o.action.close,
|
|
90
94
|
sx: { ml: 2 },
|
|
91
|
-
children: /* @__PURE__ */ e(
|
|
95
|
+
children: /* @__PURE__ */ e(O, {})
|
|
92
96
|
}
|
|
93
97
|
)
|
|
94
98
|
]
|
|
@@ -97,26 +101,26 @@ const R = ({
|
|
|
97
101
|
]
|
|
98
102
|
}
|
|
99
103
|
),
|
|
100
|
-
/* @__PURE__ */ e(
|
|
104
|
+
/* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
|
101
105
|
t,
|
|
102
106
|
{
|
|
103
107
|
boxShadow: (n) => n.shadows[1],
|
|
104
108
|
mt: 0.1,
|
|
105
109
|
overflow: "hidden",
|
|
106
110
|
borderRadius: 1,
|
|
107
|
-
children:
|
|
108
|
-
|
|
111
|
+
children: d && /* @__PURE__ */ e(
|
|
112
|
+
F,
|
|
109
113
|
{
|
|
110
|
-
data:
|
|
111
|
-
templates:
|
|
114
|
+
data: d,
|
|
115
|
+
templates: l,
|
|
112
116
|
enableCheckboxSelection: !0,
|
|
113
|
-
selectedIds:
|
|
117
|
+
selectedIds: r.map((n) => n.id),
|
|
114
118
|
onSelect: h
|
|
115
119
|
}
|
|
116
120
|
)
|
|
117
121
|
}
|
|
118
122
|
) }),
|
|
119
|
-
/* @__PURE__ */ i(
|
|
123
|
+
/* @__PURE__ */ i(B, { children: [
|
|
120
124
|
/* @__PURE__ */ e(
|
|
121
125
|
a,
|
|
122
126
|
{
|
|
@@ -131,7 +135,7 @@ const R = ({
|
|
|
131
135
|
{
|
|
132
136
|
color: "primary",
|
|
133
137
|
variant: "contained",
|
|
134
|
-
disabled:
|
|
138
|
+
disabled: r.length === 0,
|
|
135
139
|
onClick: v,
|
|
136
140
|
children: "Property Mapping"
|
|
137
141
|
}
|
|
@@ -141,18 +145,19 @@ const R = ({
|
|
|
141
145
|
}
|
|
142
146
|
),
|
|
143
147
|
/* @__PURE__ */ e(
|
|
144
|
-
|
|
148
|
+
H,
|
|
145
149
|
{
|
|
146
150
|
data: g,
|
|
147
151
|
objectTemplate: f,
|
|
152
|
+
agentTemplates: b,
|
|
148
153
|
mapboxAccessToken: x,
|
|
149
154
|
onSubmit: C,
|
|
150
155
|
open: u,
|
|
151
|
-
onClose:
|
|
156
|
+
onClose: y
|
|
152
157
|
}
|
|
153
158
|
)
|
|
154
159
|
] });
|
|
155
160
|
};
|
|
156
161
|
export {
|
|
157
|
-
|
|
162
|
+
K as CatalogueInstanceSelector
|
|
158
163
|
};
|