@hybridcore/ui 1.5.48 → 1.5.49

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 f, jsx as i, Fragment as b } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as i, Fragment as T } 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 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";
3
+ import { Dialog as de, DialogTitle as pe, Box as m, Typography as b, TextField as R, IconButton as J, DialogContent as se, DialogActions as ce, Button as W, FormControl as V, Select as _, MenuItem as k } from "@mui/material";
4
4
  import { DataGrid as fe } from "@mui/x-data-grid";
5
- import { useState as H, useEffect as ue } from "react";
5
+ import { useState as G, 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
11
  open: F,
12
- data: P,
13
- objectTemplate: q,
12
+ data: H,
13
+ objectTemplate: P,
14
14
  agent: a,
15
- enableValueInput: T,
15
+ enableValueInput: S,
16
16
  loading: B,
17
17
  agentTemplates: K,
18
18
  catalogueInstances: v,
19
19
  objectInstance: I,
20
- disableCatalogueSource: G,
21
- disableObjectSource: U,
20
+ disableCatalogueSource: U,
21
+ disableObjectSource: q,
22
22
  scenario: M,
23
23
  mapboxAccessToken: E,
24
24
  onSubmit: g,
25
25
  onClose: O
26
26
  }) => {
27
- const [k, j] = H(P), [L, N] = H(/* @__PURE__ */ new Map());
27
+ const [$, j] = G(H), [L, N] = G(/* @__PURE__ */ new Map());
28
28
  ue(() => (N(/* @__PURE__ */ new Map()), () => {
29
29
  }), [F]);
30
30
  const Q = () => {
31
- a ? g(a, !0) : g(k);
31
+ a ? g(a, !0) : g($);
32
32
  }, D = (n) => {
33
33
  const { name: d, value: p } = n.target;
34
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 && g({ ...a, [n]: d });
38
- }, S = (n, d, p, o) => (r) => {
38
+ }, A = (n, d, p, o) => (r) => {
39
39
  if (a) {
40
40
  let t = [...a.propertyInfoMap];
41
41
  const e = t.findIndex(
@@ -70,7 +70,7 @@ const $e = ({
70
70
  v
71
71
  );
72
72
  }
73
- t && (S(d, p)({ value: t }), N((e) => {
73
+ t && (A(d, p)({ value: t }), N((e) => {
74
74
  const l = new Map(e);
75
75
  return l.set(
76
76
  `${h.get(a, "referenceObjectInstanceId")}:${d}:${p}`,
@@ -101,7 +101,7 @@ const $e = ({
101
101
  }
102
102
  }, ee = (n) => (d) => {
103
103
  const p = d.target.name;
104
- let o = [...k];
104
+ let o = [...$];
105
105
  const r = o[n], t = r.propertyMappings.findIndex(
106
106
  (l) => l.key === p
107
107
  ), e = r.propertyMappings[t];
@@ -113,7 +113,7 @@ const $e = ({
113
113
  o,
114
114
  `${n}.propertyMappings.${t}.sourceField`,
115
115
  ""
116
- ), j(o), a && S(
116
+ ), j(o), a && A(
117
117
  r.key,
118
118
  e.key,
119
119
  String(d.target.value),
@@ -121,7 +121,7 @@ const $e = ({
121
121
  )({ value: "" });
122
122
  }, re = (n) => (d) => {
123
123
  const p = d.target.name;
124
- let o = [...k];
124
+ let o = [...$];
125
125
  const r = o[n], t = r.propertyMappings.findIndex(
126
126
  (l) => l.key === p
127
127
  ), e = r.propertyMappings[t];
@@ -129,7 +129,7 @@ const $e = ({
129
129
  o,
130
130
  `${n}.propertyMappings.${t}.sourceField`,
131
131
  d.target.value
132
- ), j(o), T && a) {
132
+ ), j(o), S && a) {
133
133
  const l = h.get(
134
134
  o,
135
135
  `${n}.propertyMappings.${t}.source`
@@ -140,7 +140,7 @@ const $e = ({
140
140
  I.variables,
141
141
  `${e.dataType.type}.${d.target.value}`
142
142
  ) || "";
143
- S(
143
+ A(
144
144
  r.key,
145
145
  e.key,
146
146
  void 0,
@@ -158,7 +158,7 @@ const $e = ({
158
158
  u.variables,
159
159
  `${e.dataType.type}.${d.target.value}`
160
160
  ) || "";
161
- S(
161
+ A(
162
162
  r.key,
163
163
  e.key,
164
164
  void 0,
@@ -180,8 +180,8 @@ const $e = ({
180
180
  renderCell: (r) => {
181
181
  var x, w;
182
182
  const { key: t, dataType: e } = r.row;
183
- let l = "", u = /* @__PURE__ */ i(b, {}), y = /* @__PURE__ */ i(b, {}), c = r.row.source;
184
- if (T && a) {
183
+ let l = "", u = /* @__PURE__ */ i(T, {}), y = /* @__PURE__ */ i(T, {}), c = r.row.source;
184
+ if (S && a) {
185
185
  const s = a.propertyInfoMap.find(
186
186
  (C) => C.key === t && C.policyKey === n.key
187
187
  );
@@ -208,7 +208,7 @@ const $e = ({
208
208
  }
209
209
  if (c === "STATIC") {
210
210
  const C = (x = M == null ? void 0 : M.environment.context) != null && x.boundingBox ? ye(M.environment.context.boundingBox) : void 0;
211
- return /* @__PURE__ */ f(b, { children: [
211
+ return /* @__PURE__ */ f(T, { children: [
212
212
  /* @__PURE__ */ i(
213
213
  he,
214
214
  {
@@ -225,14 +225,14 @@ const $e = ({
225
225
  value: l,
226
226
  size: "small",
227
227
  defaultExtent: C,
228
- onChange: S(n.key, t)
228
+ onChange: A(n.key, t)
229
229
  }
230
230
  ),
231
231
  u
232
232
  ] });
233
233
  }
234
234
  if (c === "RANDOM" || c === "SMART_RANDOM")
235
- return /* @__PURE__ */ f(b, { children: [
235
+ return /* @__PURE__ */ f(T, { children: [
236
236
  /* @__PURE__ */ i(
237
237
  me,
238
238
  {
@@ -286,7 +286,7 @@ const $e = ({
286
286
  title: r.row.name || r.row.key,
287
287
  children: [
288
288
  r.row.name || r.row.key,
289
- r.row.required ? /* @__PURE__ */ i($, { color: "red", ml: 1, title: "Required", display: "inline", children: "*" }) : null
289
+ r.row.required ? /* @__PURE__ */ i(b, { color: "red", ml: 1, title: "Required", display: "inline", children: "*" }) : null
290
290
  ]
291
291
  }
292
292
  )
@@ -346,9 +346,10 @@ const $e = ({
346
346
  name: String(r.id),
347
347
  value: t,
348
348
  children: [
349
- !U && /* @__PURE__ */ i(A, { value: "OBJECT", children: "OBJECT" }),
350
- !G && n.catalogInstances.map((e) => /* @__PURE__ */ i(A, { value: e.id, children: e.name }, e.id)),
351
- T && ["STATIC", "RANDOM", "SMART_RANDOM"].map((e) => /* @__PURE__ */ i(A, { value: e, children: e }, e))
349
+ /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(b, { fontStyle: "italic", color: "GrayText", children: "Undefined" }) }),
350
+ !q && /* @__PURE__ */ i(k, { value: "OBJECT", children: "OBJECT" }),
351
+ !U && n.catalogInstances.map((e) => /* @__PURE__ */ i(k, { value: e.id, children: e.name }, e.id)),
352
+ S && ["STATIC", "RANDOM", "SMART_RANDOM"].map((e) => /* @__PURE__ */ i(k, { value: e, children: e }, e))
352
353
  ]
353
354
  }
354
355
  ) });
@@ -372,10 +373,10 @@ const $e = ({
372
373
  }
373
374
  let u = l || "";
374
375
  if (e === "RANDOM" || e === "STATIC" || e === "SMART_RANDOM")
375
- return /* @__PURE__ */ i(b, {});
376
+ return /* @__PURE__ */ i(T, {});
376
377
  let y = [];
377
378
  if (e === "OBJECT")
378
- y = q.properties.map((c) => ({
379
+ y = P.properties.map((c) => ({
379
380
  value: c.propertyId,
380
381
  text: c.name
381
382
  }));
@@ -400,8 +401,8 @@ const $e = ({
400
401
  name: String(r.id),
401
402
  value: u,
402
403
  children: [
403
- y.map((c, x) => /* @__PURE__ */ i(A, { value: c.value, children: c.text }, x)),
404
- y.length === 0 && /* @__PURE__ */ f(A, { disabled: !0, children: [
404
+ y.map((c, x) => /* @__PURE__ */ i(k, { value: c.value, children: c.text }, x)),
405
+ y.length === 0 && /* @__PURE__ */ f(k, { disabled: !0, children: [
405
406
  "No ",
406
407
  t.type,
407
408
  " property found!"
@@ -412,7 +413,7 @@ const $e = ({
412
413
  }
413
414
  }
414
415
  ];
415
- return T ? [...o, p] : o;
416
+ return S ? [...o, p] : o;
416
417
  };
417
418
  return /* @__PURE__ */ f(de, { open: F, fullWidth: !0, maxWidth: "lg", onClose: O, children: [
418
419
  /* @__PURE__ */ f(
@@ -423,9 +424,9 @@ const $e = ({
423
424
  display: "flex",
424
425
  justifyContent: "space-between",
425
426
  children: [
426
- /* @__PURE__ */ i(m, { children: a === void 0 ? /* @__PURE__ */ f(b, { children: [
427
- /* @__PURE__ */ i($, { variant: "h6", children: "Property Mapping" }),
428
- /* @__PURE__ */ i($, { variant: "caption", children: "Map policy properties with object template or catalog istance properties" })
427
+ /* @__PURE__ */ i(m, { children: a === void 0 ? /* @__PURE__ */ f(T, { children: [
428
+ /* @__PURE__ */ i(b, { variant: "h6", children: "Property Mapping" }),
429
+ /* @__PURE__ */ i(b, { variant: "caption", children: "Map policy properties with object template or catalog istance properties" })
429
430
  ] }) : /* @__PURE__ */ f(m, { display: "flex", flex: 1, alignItems: "flex-start", children: [
430
431
  /* @__PURE__ */ f(
431
432
  m,
@@ -501,7 +502,7 @@ const $e = ({
501
502
  ]
502
503
  }
503
504
  ),
504
- /* @__PURE__ */ i(se, { sx: { minHeight: 300 }, children: k.map((n, d) => /* @__PURE__ */ f(
505
+ /* @__PURE__ */ i(se, { sx: { minHeight: 300 }, children: $.map((n, d) => /* @__PURE__ */ f(
505
506
  m,
506
507
  {
507
508
  boxShadow: (p) => p.shadows[1],
@@ -511,9 +512,9 @@ const $e = ({
511
512
  borderRadius: 1,
512
513
  children: [
513
514
  /* @__PURE__ */ f(m, { display: "flex", alignItems: "center", p: 2, children: [
514
- /* @__PURE__ */ i($, { children: n.catalogInstances.map((p) => p.name).join(", ") }),
515
+ /* @__PURE__ */ i(b, { children: n.catalogInstances.map((p) => p.name).join(", ") }),
515
516
  /* @__PURE__ */ i(ie, { color: "disabled", sx: { mx: 1 } }),
516
- /* @__PURE__ */ i($, { variant: "caption", color: "GrayText", children: n.name || n.key })
517
+ /* @__PURE__ */ i(b, { variant: "caption", color: "GrayText", children: n.name || n.key })
517
518
  ] }),
518
519
  /* @__PURE__ */ i(
519
520
  fe,
@@ -521,7 +522,7 @@ const $e = ({
521
522
  columns: te(n, d),
522
523
  rows: n.propertyMappings,
523
524
  autoHeight: !0,
524
- density: T ? "comfortable" : "standard",
525
+ density: S ? "comfortable" : "standard",
525
526
  sx: {
526
527
  border: "none",
527
528
  "& .MuiDataGrid-columnHeadersInner": {
@@ -544,7 +545,7 @@ const $e = ({
544
545
  {
545
546
  color: "primary",
546
547
  variant: "contained",
547
- disabled: k.length === 0 || B,
548
+ disabled: $.length === 0 || B,
548
549
  onClick: Q,
549
550
  children: B ? "Saving..." : "Save"
550
551
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.48",
4
+ "version": "1.5.49",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",