@hybridcore/ui 1.5.47 → 1.5.48

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.
@@ -19,22 +19,22 @@ const $e = ({
19
19
  objectInstance: I,
20
20
  disableCatalogueSource: G,
21
21
  disableObjectSource: U,
22
- scenario: C,
22
+ scenario: M,
23
23
  mapboxAccessToken: E,
24
- onSubmit: M,
24
+ onSubmit: g,
25
25
  onClose: O
26
26
  }) => {
27
27
  const [k, j] = H(P), [L, N] = H(/* @__PURE__ */ new Map());
28
28
  ue(() => (N(/* @__PURE__ */ new Map()), () => {
29
29
  }), [F]);
30
30
  const Q = () => {
31
- a ? M(a, !0) : M(k);
31
+ a ? g(a, !0) : g(k);
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
- a && M({ ...a, [n]: d });
37
+ a && g({ ...a, [n]: d });
38
38
  }, S = (n, d, p, o) => (r) => {
39
39
  if (a) {
40
40
  let t = [...a.propertyInfoMap];
@@ -48,7 +48,7 @@ const $e = ({
48
48
  value: l,
49
49
  source: p ? p || "" : t[e].source,
50
50
  sourceField: o !== void 0 ? o || "" : t[e].sourceField
51
- }), M && M({ ...a, propertyInfoMap: t });
51
+ }), g && g({ ...a, propertyInfoMap: t });
52
52
  }
53
53
  }
54
54
  }, Y = (n) => () => {
@@ -97,7 +97,7 @@ const $e = ({
97
97
  o[r] && (o.splice(r, 1, {
98
98
  ...o[r],
99
99
  randomInfo: p
100
- }), M && M({ ...a, propertyInfoMap: o }));
100
+ }), g && g({ ...a, propertyInfoMap: o }));
101
101
  }
102
102
  }, ee = (n) => (d) => {
103
103
  const p = d.target.name;
@@ -178,16 +178,16 @@ const $e = ({
178
178
  disableColumnMenu: !0,
179
179
  flex: 2.5,
180
180
  renderCell: (r) => {
181
- var x, g;
181
+ var x, w;
182
182
  const { key: t, dataType: e } = r.row;
183
- let l = "", u = /* @__PURE__ */ i(b, {}), y = /* @__PURE__ */ i(b, {}), s = r.row.source;
183
+ let l = "", u = /* @__PURE__ */ i(b, {}), y = /* @__PURE__ */ i(b, {}), c = r.row.source;
184
184
  if (T && a) {
185
- const c = a.propertyInfoMap.find(
186
- (w) => w.key === t && w.policyKey === n.key
185
+ const s = a.propertyInfoMap.find(
186
+ (C) => C.key === t && C.policyKey === n.key
187
187
  );
188
- if (c) {
189
- const { valid: w, validationErrors: z } = c;
190
- l = c.value, s = c.source, w === !1 && (u = /* @__PURE__ */ i(
188
+ if (s) {
189
+ const { valid: C, validationErrors: z } = s;
190
+ l = s.value, c = s.source, C === !1 && (u = /* @__PURE__ */ i(
191
191
  ne,
192
192
  {
193
193
  color: "error",
@@ -195,19 +195,19 @@ const $e = ({
195
195
  sx: { ml: 1 },
196
196
  titleAccess: z ? z.join(", ") : "Value is not valid!"
197
197
  }
198
- )), s && (L.get(
199
- `${h.get(a, "referenceObjectInstanceId")}:${c.policyKey}:${c.key}`
198
+ )), c && (L.get(
199
+ `${h.get(a, "referenceObjectInstanceId")}:${s.policyKey}:${s.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(c),
204
- title: `Reload value from the ${s === "OBJECT" ? "Object" : "Catalogue"}`,
203
+ onClick: Y(s),
204
+ title: `Reload value from the ${c === "OBJECT" ? "Object" : "Catalogue"}`,
205
205
  children: /* @__PURE__ */ i(ae, {})
206
206
  }
207
207
  ));
208
208
  }
209
- if (s === "STATIC") {
210
- const w = (x = C == null ? void 0 : C.environment.context) != null && x.boundingBox ? ye(C.environment.context.boundingBox) : void 0;
209
+ if (c === "STATIC") {
210
+ const C = (x = M == null ? void 0 : M.environment.context) != null && x.boundingBox ? ye(M.environment.context.boundingBox) : void 0;
211
211
  return /* @__PURE__ */ f(b, { children: [
212
212
  /* @__PURE__ */ i(
213
213
  he,
@@ -224,23 +224,23 @@ const $e = ({
224
224
  variant: "outlined",
225
225
  value: l,
226
226
  size: "small",
227
- defaultExtent: w,
227
+ defaultExtent: C,
228
228
  onChange: S(n.key, t)
229
229
  }
230
230
  ),
231
231
  u
232
232
  ] });
233
233
  }
234
- if (s === "RANDOM" || s === "SMART_RANDOM")
234
+ if (c === "RANDOM" || c === "SMART_RANDOM")
235
235
  return /* @__PURE__ */ f(b, { children: [
236
236
  /* @__PURE__ */ i(
237
237
  me,
238
238
  {
239
239
  type: e.type,
240
- value: c == null ? void 0 : c.randomInfo,
241
- innerType: (g = e.innerType) == null ? void 0 : g.type,
242
- minDate: C ? C.startTime : "",
243
- maxDate: C ? C.endTime : "",
240
+ value: s == null ? void 0 : s.randomInfo,
241
+ innerType: (w = e.innerType) == null ? void 0 : w.type,
242
+ minDate: M ? M.startTime : "",
243
+ maxDate: M ? M.endTime : "",
244
244
  mapboxAccessToken: E,
245
245
  onChange: Z(n.key, t)
246
246
  }
@@ -365,31 +365,31 @@ 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 s = a.propertyInfoMap.find(
368
+ const c = a.propertyInfoMap.find(
369
369
  (x) => x.policyKey === n.key && x.key === r.id
370
370
  );
371
- s && (e = s.source, l = s.sourceField || "");
371
+ c && (e = c.source, l = c.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((s) => ({
379
- value: s.propertyId,
380
- text: s.name
378
+ y = q.properties.map((c) => ({
379
+ value: c.propertyId,
380
+ text: c.name
381
381
  }));
382
382
  else if (e !== null) {
383
- const s = Number(e), x = v == null ? void 0 : v.find(
384
- (g) => g.id === s
383
+ const c = Number(e), x = v == null ? void 0 : v.find(
384
+ (w) => w.id === c
385
385
  );
386
386
  if (x && K) {
387
- const g = K.find(
388
- (c) => c.templateKey === x.template.templateKey
387
+ const w = K.find(
388
+ (s) => s.templateKey === x.template.templateKey
389
389
  );
390
- g && (y = g.properties.filter((c) => c.type === t.type).map((c) => ({
391
- value: c.propertyId,
392
- text: c.name
390
+ w && (y = w.properties.filter((s) => s.type === t.type).sort((s, C) => s.name < C.name ? -1 : s.name > C.name ? 1 : 0).map((s) => ({
391
+ value: s.propertyId,
392
+ text: s.name
393
393
  })));
394
394
  }
395
395
  }
@@ -400,7 +400,7 @@ const $e = ({
400
400
  name: String(r.id),
401
401
  value: u,
402
402
  children: [
403
- y.map((s, x) => /* @__PURE__ */ i(A, { value: s.value, children: s.text }, x)),
403
+ y.map((c, x) => /* @__PURE__ */ i(A, { value: c.value, children: c.text }, x)),
404
404
  y.length === 0 && /* @__PURE__ */ f(A, { disabled: !0, children: [
405
405
  "No ",
406
406
  t.type,
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.47",
4
+ "version": "1.5.48",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",