@hybridcore/ui 1.6.23 → 1.6.24

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,66 +1,66 @@
1
- import be, { jsx as t, jsxs as f, Fragment as he } from "react/jsx-runtime";
2
- import * as z from "react";
3
- import A from "react";
4
- import ye from "lodash";
5
- import { g as se, a as ce, s as Y, r as ve, b as D, d as Te, u as X, c as de, i as Ce } from "../../../../styled-Ckq8ALHh.js";
6
- import { r as xe } from "../../../../createSvgIcon-jKAqRXE2.js";
7
- import { DATA_TYPES as K, COORDINATE_FORMAT as Ie, PRIVACY_PRESERVATION_METHOD as le } from "../../../../constants/index.js";
8
- import { LabeledField as C } from "../../helpers.js";
9
- import { A as ge } from "../../../../Alert-BsT46Tgd.js";
10
- import { T as E, F as W, B as ke } from "../../../../TextField-Db63_GNb.js";
1
+ import Ce, { jsx as r, jsxs as b, Fragment as de } from "react/jsx-runtime";
2
+ import * as W from "react";
3
+ import L from "react";
4
+ import pe from "lodash";
5
+ import { g as be, a as he, s as Y, r as ke, b as j, d as Oe, u as X, c as ye, i as Pe } from "../../../../styled-Ckq8ALHh.js";
6
+ import { r as Re } from "../../../../createSvgIcon-jKAqRXE2.js";
7
+ import { DATA_TYPES as K, COORDINATE_FORMAT as Fe, PRIVACY_PRESERVATION_METHOD as me } from "../../../../constants/index.js";
8
+ import { LabeledField as y } from "../../helpers.js";
9
+ import { A as Se } from "../../../../Alert-BsT46Tgd.js";
10
+ import { T as q, F as V, B as qe } from "../../../../TextField-Db63_GNb.js";
11
11
  import { I as H } from "../../../../InputLabel-jPm6Xuco.js";
12
12
  import { S as U } from "../../../../Select-nL91eUH9.js";
13
13
  import { M as G } from "../../../../MenuItem-BjnnhDbD.js";
14
- import { F as Oe } from "../../../../FormGroup-LH368jad.js";
15
- import { a as x, _ as pe } from "../../../../objectWithoutPropertiesLoose-DJteAcBH.js";
14
+ import { F as Me } from "../../../../FormGroup-LH368jad.js";
15
+ import { a as x, _ as ve } from "../../../../objectWithoutPropertiesLoose-DJteAcBH.js";
16
16
  import { P as e } from "../../../../index-CblbdqjE.js";
17
17
  import { c as Q } from "../../../../clsx-OuTLNxxd.js";
18
- import { f as Pe } from "../../../../formControlState-vgaj2ksH.js";
19
- import { u as Re } from "../../../../useFormControl-CatNKXAi.js";
20
- import { T as ne } from "../../../../Typography-B_LKrxyI.js";
21
- import { createStack as Fe } from "@mui/system";
22
- import { r as me } from "../../../../TransitionGroupContext-C_aW1Tei.js";
23
- import { S as qe } from "../../../../SwitchBase-BcJAJYsB.js";
18
+ import { f as Ne } from "../../../../formControlState-vgaj2ksH.js";
19
+ import { u as _e } from "../../../../useFormControl-CatNKXAi.js";
20
+ import { T as ue } from "../../../../Typography-B_LKrxyI.js";
21
+ import { createStack as De } from "@mui/system";
22
+ import { r as Te } from "../../../../TransitionGroupContext-C_aW1Tei.js";
23
+ import { S as Ee } from "../../../../SwitchBase-BcJAJYsB.js";
24
24
  import { c as Z } from "../../../../createSvgIcon-Bx0mTP6n.js";
25
- import { B as ie } from "../../../../Button-BMUZn0cT.js";
26
- const Me = Z(/* @__PURE__ */ t("path", {
25
+ import { B as fe } from "../../../../Button-BMUZn0cT.js";
26
+ const $e = Z(/* @__PURE__ */ r("path", {
27
27
  d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
28
- }), "CheckBoxOutlineBlank"), Se = Z(/* @__PURE__ */ t("path", {
28
+ }), "CheckBoxOutlineBlank"), je = Z(/* @__PURE__ */ r("path", {
29
29
  d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
30
- }), "CheckBox"), _e = Z(/* @__PURE__ */ t("path", {
30
+ }), "CheckBox"), we = Z(/* @__PURE__ */ r("path", {
31
31
  d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
32
32
  }), "IndeterminateCheckBox");
33
- function $e(r) {
34
- return ce("MuiCheckbox", r);
33
+ function ze(a) {
34
+ return he("MuiCheckbox", a);
35
35
  }
36
- const J = se("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), De = ["checkedIcon", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size", "className"], je = (r) => {
36
+ const J = be("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), Le = ["checkedIcon", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size", "className"], Be = (a) => {
37
37
  const {
38
38
  classes: o,
39
- indeterminate: i,
39
+ indeterminate: c,
40
40
  color: p,
41
- size: m
42
- } = r, c = {
43
- root: ["root", i && "indeterminate", `color${D(p)}`, `size${D(m)}`]
44
- }, h = de(c, $e, o);
45
- return x({}, o, h);
46
- }, Ee = Y(qe, {
47
- shouldForwardProp: (r) => ve(r) || r === "classes",
41
+ size: u
42
+ } = a, d = {
43
+ root: ["root", c && "indeterminate", `color${j(p)}`, `size${j(u)}`]
44
+ }, v = ye(d, ze, o);
45
+ return x({}, o, v);
46
+ }, We = Y(Ee, {
47
+ shouldForwardProp: (a) => ke(a) || a === "classes",
48
48
  name: "MuiCheckbox",
49
49
  slot: "Root",
50
- overridesResolver: (r, o) => {
50
+ overridesResolver: (a, o) => {
51
51
  const {
52
- ownerState: i
53
- } = r;
54
- return [o.root, i.indeterminate && o.indeterminate, o[`size${D(i.size)}`], i.color !== "default" && o[`color${D(i.color)}`]];
52
+ ownerState: c
53
+ } = a;
54
+ return [o.root, c.indeterminate && o.indeterminate, o[`size${j(c.size)}`], c.color !== "default" && o[`color${j(c.color)}`]];
55
55
  }
56
56
  })(({
57
- theme: r,
57
+ theme: a,
58
58
  ownerState: o
59
59
  }) => x({
60
- color: (r.vars || r).palette.text.secondary
60
+ color: (a.vars || a).palette.text.secondary
61
61
  }, !o.disableRipple && {
62
62
  "&:hover": {
63
- backgroundColor: r.vars ? `rgba(${o.color === "default" ? r.vars.palette.action.activeChannel : r.vars.palette[o.color].mainChannel} / ${r.vars.palette.action.hoverOpacity})` : Te(o.color === "default" ? r.palette.action.active : r.palette[o.color].main, r.palette.action.hoverOpacity),
63
+ backgroundColor: a.vars ? `rgba(${o.color === "default" ? a.vars.palette.action.activeChannel : a.vars.palette[o.color].mainChannel} / ${a.vars.palette.action.hoverOpacity})` : Oe(o.color === "default" ? a.palette.action.active : a.palette[o.color].main, a.palette.action.hoverOpacity),
64
64
  // Reset on touch devices, it doesn't add specificity
65
65
  "@media (hover: none)": {
66
66
  backgroundColor: "transparent"
@@ -68,49 +68,49 @@ const J = se("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "co
68
68
  }
69
69
  }, o.color !== "default" && {
70
70
  [`&.${J.checked}, &.${J.indeterminate}`]: {
71
- color: (r.vars || r).palette[o.color].main
71
+ color: (a.vars || a).palette[o.color].main
72
72
  },
73
73
  [`&.${J.disabled}`]: {
74
- color: (r.vars || r).palette.action.disabled
74
+ color: (a.vars || a).palette.action.disabled
75
75
  }
76
- })), Ne = /* @__PURE__ */ t(Se, {}), ze = /* @__PURE__ */ t(Me, {}), we = /* @__PURE__ */ t(_e, {}), R = /* @__PURE__ */ z.forwardRef(function(o, i) {
77
- var p, m;
78
- const c = X({
76
+ })), Ae = /* @__PURE__ */ r(je, {}), Ve = /* @__PURE__ */ r($e, {}), He = /* @__PURE__ */ r(we, {}), M = /* @__PURE__ */ W.forwardRef(function(o, c) {
77
+ var p, u;
78
+ const d = X({
79
79
  props: o,
80
80
  name: "MuiCheckbox"
81
81
  }), {
82
- checkedIcon: h = Ne,
83
- color: a = "primary",
84
- icon: b = ze,
85
- indeterminate: u = !1,
86
- indeterminateIcon: k = we,
82
+ checkedIcon: v = Ae,
83
+ color: t = "primary",
84
+ icon: h = Ve,
85
+ indeterminate: f = !1,
86
+ indeterminateIcon: C = He,
87
87
  inputProps: s,
88
88
  size: l = "medium",
89
- className: q
90
- } = c, M = pe(c, De), O = u ? k : b, y = u ? k : h, I = x({}, c, {
91
- color: a,
92
- indeterminate: u,
89
+ className: O
90
+ } = d, w = ve(d, Le), P = f ? C : h, T = f ? C : v, k = x({}, d, {
91
+ color: t,
92
+ indeterminate: f,
93
93
  size: l
94
- }), v = je(I);
95
- return /* @__PURE__ */ t(Ee, x({
94
+ }), I = Be(k);
95
+ return /* @__PURE__ */ r(We, x({
96
96
  type: "checkbox",
97
97
  inputProps: x({
98
- "data-indeterminate": u
98
+ "data-indeterminate": f
99
99
  }, s),
100
- icon: /* @__PURE__ */ z.cloneElement(O, {
101
- fontSize: (p = O.props.fontSize) != null ? p : l
100
+ icon: /* @__PURE__ */ W.cloneElement(P, {
101
+ fontSize: (p = P.props.fontSize) != null ? p : l
102
102
  }),
103
- checkedIcon: /* @__PURE__ */ z.cloneElement(y, {
104
- fontSize: (m = y.props.fontSize) != null ? m : l
103
+ checkedIcon: /* @__PURE__ */ W.cloneElement(T, {
104
+ fontSize: (u = T.props.fontSize) != null ? u : l
105
105
  }),
106
- ownerState: I,
107
- ref: i,
108
- className: Q(v.root, q)
109
- }, M, {
110
- classes: v
106
+ ownerState: k,
107
+ ref: c,
108
+ className: Q(I.root, O)
109
+ }, w, {
110
+ classes: I
111
111
  }));
112
112
  });
113
- process.env.NODE_ENV !== "production" && (R.propTypes = {
113
+ process.env.NODE_ENV !== "production" && (M.propTypes = {
114
114
  // ┌────────────────────────────── Warning ──────────────────────────────┐
115
115
  // │ These PropTypes are generated from the TypeScript type definitions. │
116
116
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -182,7 +182,7 @@ process.env.NODE_ENV !== "production" && (R.propTypes = {
182
182
  /**
183
183
  * Pass a ref to the `input` element.
184
184
  */
185
- inputRef: me,
185
+ inputRef: Te,
186
186
  /**
187
187
  * Callback fired when the state is changed.
188
188
  *
@@ -211,18 +211,18 @@ process.env.NODE_ENV !== "production" && (R.propTypes = {
211
211
  */
212
212
  value: e.any
213
213
  });
214
- const ue = Fe({
214
+ const Ie = De({
215
215
  createStyledComponent: Y("div", {
216
216
  name: "MuiStack",
217
217
  slot: "Root",
218
- overridesResolver: (r, o) => o.root
218
+ overridesResolver: (a, o) => o.root
219
219
  }),
220
- useThemeProps: (r) => X({
221
- props: r,
220
+ useThemeProps: (a) => X({
221
+ props: a,
222
222
  name: "MuiStack"
223
223
  })
224
224
  });
225
- process.env.NODE_ENV !== "production" && (ue.propTypes = {
225
+ process.env.NODE_ENV !== "production" && (Ie.propTypes = {
226
226
  // ┌────────────────────────────── Warning ──────────────────────────────┐
227
227
  // │ These PropTypes are generated from the TypeScript type definitions. │
228
228
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -266,35 +266,35 @@ process.env.NODE_ENV !== "production" && (ue.propTypes = {
266
266
  */
267
267
  useFlexGap: e.bool
268
268
  });
269
- function Le(r) {
270
- return ce("MuiFormControlLabel", r);
269
+ function Ue(a) {
270
+ return he("MuiFormControlLabel", a);
271
271
  }
272
- const N = se("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), Be = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"], Ve = (r) => {
272
+ const B = be("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), Ge = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"], Ye = (a) => {
273
273
  const {
274
274
  classes: o,
275
- disabled: i,
275
+ disabled: c,
276
276
  labelPlacement: p,
277
- error: m,
278
- required: c
279
- } = r, h = {
280
- root: ["root", i && "disabled", `labelPlacement${D(p)}`, m && "error", c && "required"],
281
- label: ["label", i && "disabled"],
282
- asterisk: ["asterisk", m && "error"]
277
+ error: u,
278
+ required: d
279
+ } = a, v = {
280
+ root: ["root", c && "disabled", `labelPlacement${j(p)}`, u && "error", d && "required"],
281
+ label: ["label", c && "disabled"],
282
+ asterisk: ["asterisk", u && "error"]
283
283
  };
284
- return de(h, Le, o);
285
- }, Ae = Y("label", {
284
+ return ye(v, Ue, o);
285
+ }, Ke = Y("label", {
286
286
  name: "MuiFormControlLabel",
287
287
  slot: "Root",
288
- overridesResolver: (r, o) => {
288
+ overridesResolver: (a, o) => {
289
289
  const {
290
- ownerState: i
291
- } = r;
290
+ ownerState: c
291
+ } = a;
292
292
  return [{
293
- [`& .${N.label}`]: o.label
294
- }, o.root, o[`labelPlacement${D(i.labelPlacement)}`]];
293
+ [`& .${B.label}`]: o.label
294
+ }, o.root, o[`labelPlacement${j(c.labelPlacement)}`]];
295
295
  }
296
296
  })(({
297
- theme: r,
297
+ theme: a,
298
298
  ownerState: o
299
299
  }) => x({
300
300
  display: "inline-flex",
@@ -306,7 +306,7 @@ const N = se("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacem
306
306
  marginLeft: -11,
307
307
  marginRight: 16,
308
308
  // used for row presentation of radio/checkbox
309
- [`&.${N.disabled}`]: {
309
+ [`&.${B.disabled}`]: {
310
310
  cursor: "default"
311
311
  }
312
312
  }, o.labelPlacement === "start" && {
@@ -321,76 +321,76 @@ const N = se("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacem
321
321
  flexDirection: "column",
322
322
  marginLeft: 16
323
323
  }, {
324
- [`& .${N.label}`]: {
325
- [`&.${N.disabled}`]: {
326
- color: (r.vars || r).palette.text.disabled
324
+ [`& .${B.label}`]: {
325
+ [`&.${B.disabled}`]: {
326
+ color: (a.vars || a).palette.text.disabled
327
327
  }
328
328
  }
329
- })), We = Y("span", {
329
+ })), Je = Y("span", {
330
330
  name: "MuiFormControlLabel",
331
331
  slot: "Asterisk",
332
- overridesResolver: (r, o) => o.asterisk
332
+ overridesResolver: (a, o) => o.asterisk
333
333
  })(({
334
- theme: r
334
+ theme: a
335
335
  }) => ({
336
- [`&.${N.error}`]: {
337
- color: (r.vars || r).palette.error.main
336
+ [`&.${B.error}`]: {
337
+ color: (a.vars || a).palette.error.main
338
338
  }
339
- })), F = /* @__PURE__ */ z.forwardRef(function(o, i) {
340
- var p, m;
341
- const c = X({
339
+ })), N = /* @__PURE__ */ W.forwardRef(function(o, c) {
340
+ var p, u;
341
+ const d = X({
342
342
  props: o,
343
343
  name: "MuiFormControlLabel"
344
344
  }), {
345
- className: h,
346
- componentsProps: a = {},
347
- control: b,
348
- disabled: u,
349
- disableTypography: k,
345
+ className: v,
346
+ componentsProps: t = {},
347
+ control: h,
348
+ disabled: f,
349
+ disableTypography: C,
350
350
  label: s,
351
351
  labelPlacement: l = "end",
352
- required: q,
353
- slotProps: M = {}
354
- } = c, O = pe(c, Be), y = Re(), I = (p = u ?? b.props.disabled) != null ? p : y == null ? void 0 : y.disabled, v = q ?? b.props.required, j = {
355
- disabled: I,
356
- required: v
352
+ required: O,
353
+ slotProps: w = {}
354
+ } = d, P = ve(d, Ge), T = _e(), k = (p = f ?? h.props.disabled) != null ? p : T == null ? void 0 : T.disabled, I = O ?? h.props.required, z = {
355
+ disabled: k,
356
+ required: I
357
357
  };
358
- ["checked", "name", "onChange", "value", "inputRef"].forEach((P) => {
359
- typeof b.props[P] > "u" && typeof c[P] < "u" && (j[P] = c[P]);
358
+ ["checked", "name", "onChange", "value", "inputRef"].forEach((R) => {
359
+ typeof h.props[R] > "u" && typeof d[R] < "u" && (z[R] = d[R]);
360
360
  });
361
- const w = Pe({
362
- props: c,
363
- muiFormControl: y,
361
+ const A = Ne({
362
+ props: d,
363
+ muiFormControl: T,
364
364
  states: ["error"]
365
- }), S = x({}, c, {
366
- disabled: I,
365
+ }), _ = x({}, d, {
366
+ disabled: k,
367
367
  labelPlacement: l,
368
- required: v,
369
- error: w.error
370
- }), _ = Ve(S), $ = (m = M.typography) != null ? m : a.typography;
371
- let T = s;
372
- return T != null && T.type !== ne && !k && (T = /* @__PURE__ */ t(ne, x({
368
+ required: I,
369
+ error: A.error
370
+ }), D = Ye(_), E = (u = w.typography) != null ? u : t.typography;
371
+ let g = s;
372
+ return g != null && g.type !== ue && !C && (g = /* @__PURE__ */ r(ue, x({
373
373
  component: "span"
374
- }, $, {
375
- className: Q(_.label, $ == null ? void 0 : $.className),
376
- children: T
377
- }))), /* @__PURE__ */ f(Ae, x({
378
- className: Q(_.root, h),
379
- ownerState: S,
380
- ref: i
381
- }, O, {
382
- children: [/* @__PURE__ */ z.cloneElement(b, j), v ? /* @__PURE__ */ f(ue, {
374
+ }, E, {
375
+ className: Q(D.label, E == null ? void 0 : E.className),
376
+ children: g
377
+ }))), /* @__PURE__ */ b(Ke, x({
378
+ className: Q(D.root, v),
379
+ ownerState: _,
380
+ ref: c
381
+ }, P, {
382
+ children: [/* @__PURE__ */ W.cloneElement(h, z), I ? /* @__PURE__ */ b(Ie, {
383
383
  display: "block",
384
- children: [T, /* @__PURE__ */ f(We, {
385
- ownerState: S,
384
+ children: [g, /* @__PURE__ */ b(Je, {
385
+ ownerState: _,
386
386
  "aria-hidden": !0,
387
- className: _.asterisk,
387
+ className: D.asterisk,
388
388
  children: [" ", "*"]
389
389
  })]
390
- }) : T]
390
+ }) : g]
391
391
  }));
392
392
  });
393
- process.env.NODE_ENV !== "production" && (F.propTypes = {
393
+ process.env.NODE_ENV !== "production" && (N.propTypes = {
394
394
  // ┌────────────────────────────── Warning ──────────────────────────────┐
395
395
  // │ These PropTypes are generated from the TypeScript type definitions. │
396
396
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -429,7 +429,7 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
429
429
  /**
430
430
  * Pass a ref to the `input` element.
431
431
  */
432
- inputRef: me,
432
+ inputRef: Te,
433
433
  /**
434
434
  * A text or an element to be used in an enclosing label element.
435
435
  */
@@ -470,18 +470,18 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
470
470
  */
471
471
  value: e.any
472
472
  });
473
- var ee = {}, He = Ce;
473
+ var ee = {}, Qe = Pe;
474
474
  Object.defineProperty(ee, "__esModule", {
475
475
  value: !0
476
476
  });
477
- var fe = ee.default = void 0, Ue = He(xe()), Ge = be;
478
- fe = ee.default = (0, Ue.default)(/* @__PURE__ */ (0, Ge.jsx)("path", {
477
+ var ge = ee.default = void 0, Xe = Qe(Re()), Ze = Ce;
478
+ ge = ee.default = (0, Xe.default)(/* @__PURE__ */ (0, Ze.jsx)("path", {
479
479
  d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
480
480
  }), "Check");
481
- function To({
482
- inputVariant: r,
481
+ function Oo({
482
+ inputVariant: a,
483
483
  labelPosition: o = "default",
484
- templateId: i,
484
+ templateId: c,
485
485
  defaultValues: p = {
486
486
  name: "",
487
487
  propertyId: "",
@@ -489,7 +489,7 @@ function To({
489
489
  dataTypeInfo: {},
490
490
  defaultValue: "",
491
491
  description: "",
492
- privacyPreservationMethod: le[0],
492
+ privacyPreservationMethod: me[0],
493
493
  required: !1,
494
494
  visible: !1,
495
495
  editable: !1,
@@ -497,218 +497,281 @@ function To({
497
497
  temporal: !1,
498
498
  unique: !1
499
499
  },
500
- disablePropertyId: m,
501
- onSubmit: c,
502
- onCancel: h
500
+ disablePropertyId: u,
501
+ onSubmit: d,
502
+ onCancel: v
503
503
  }) {
504
- var M, O, y, I, v, j, w, S, _, $, T, P, oe, re, te, ae;
505
- const [a, b] = A.useState(p), [u, k] = A.useState({
506
- name: !1
507
- }), s = !!((M = p.inheritedFrom) != null && M.templateId) && ((O = p.inheritedFrom) == null ? void 0 : O.templateId) !== i, l = (n) => {
508
- var L, B;
509
- const d = n.target.name;
510
- let g = n.target.type === "checkbox" ? n.target.checked : n.target.value;
511
- if (a.type === "enum" && d === "dataTypeInfo.enumValues" && (g = g.split(",")), ((B = (L = a.dataTypeInfo) == null ? void 0 : L.innerType) == null ? void 0 : B.type) === "enum" && d === "dataTypeInfo.innerType.enumValues" && (g = g.split(",")), d.includes(".")) {
512
- let V = { ...a };
513
- ye.set(V, d, g), b(V);
504
+ var P, T, k, I, z, A, _, D, E, g, R, oe, re, ae, te, ne, le, ie, se, ce;
505
+ const [t, h] = L.useState(p), [f, C] = L.useState({
506
+ name: !1,
507
+ scale: !1
508
+ }), s = !!((P = p.inheritedFrom) != null && P.templateId) && ((T = p.inheritedFrom) == null ? void 0 : T.templateId) !== c, l = (n) => {
509
+ var F, S;
510
+ const i = n.target.name;
511
+ let m = n.target.type === "checkbox" ? n.target.checked : n.target.value;
512
+ if (t.type === "enum" && i === "dataTypeInfo.enumValues" && (m = m.split(",")), ((S = (F = t.dataTypeInfo) == null ? void 0 : F.innerType) == null ? void 0 : S.type) === "enum" && i === "dataTypeInfo.innerType.enumValues" && (m = m.split(",")), i.includes(".")) {
513
+ let $ = { ...t };
514
+ pe.set($, i, m), h($);
514
515
  return;
515
516
  }
516
- b((V) => ({
517
- ...V,
518
- [d]: g
517
+ h(($) => ({
518
+ ...$,
519
+ [i]: m
519
520
  }));
520
- }, q = () => {
521
- if (!a.name) {
522
- k({ ...u, name: !0 });
521
+ }, O = (n) => {
522
+ const { name: i, value: m } = n.target, F = Number.parseInt(m, 10), S = { ...t };
523
+ pe.set(S, i, Number.isNaN(F) ? void 0 : F), h(S);
524
+ }, w = () => {
525
+ const { precision: n, scale: i } = t.dataTypeInfo ?? {}, m = t.type === "decimal" && n !== void 0 && i !== void 0 && i > n;
526
+ if (!t.name || m) {
527
+ C({ name: !t.name, scale: m });
523
528
  return;
524
529
  }
525
- c(a);
530
+ d(t);
526
531
  };
527
- return A.useEffect(() => (u.name && a.name && k({ ...u, name: !1 }), () => {
528
- }), [a.name]), A.useEffect(() => {
532
+ return L.useEffect(() => (f.name && t.name && C({ ...f, name: !1 }), () => {
533
+ }), [t.name]), L.useEffect(() => (C((n) => n.scale ? { ...n, scale: !1 } : n), () => {
534
+ }), [t.type, (k = t.dataTypeInfo) == null ? void 0 : k.precision, (I = t.dataTypeInfo) == null ? void 0 : I.scale]), L.useEffect(() => {
529
535
  if (![
530
536
  "date",
531
537
  "coordinate",
532
538
  "composite-list",
539
+ "decimal",
533
540
  "enum",
534
541
  "composite-matrix"
535
- ].includes(a.type)) {
536
- if (a.dataTypeInfo) {
537
- const { coordinateFormat: n, datePattern: d, innerType: g, enumValues: L } = a.dataTypeInfo;
538
- (n || d || g || L) && b((B) => ({ ...B, dataTypeInfo: {} }));
542
+ ].includes(t.type)) {
543
+ if (t.dataTypeInfo) {
544
+ const {
545
+ coordinateFormat: n,
546
+ datePattern: i,
547
+ innerType: m,
548
+ enumValues: F,
549
+ precision: S,
550
+ scale: $
551
+ } = t.dataTypeInfo;
552
+ (n || i || m || F || S !== void 0 || $ !== void 0) && h((xe) => ({ ...xe, dataTypeInfo: {} }));
539
553
  }
540
554
  return () => {
541
555
  };
542
556
  }
543
- }, [a.type]), /* @__PURE__ */ f(he, { children: [
544
- s && /* @__PURE__ */ f(ge, { severity: "info", sx: { mb: 2 }, children: [
557
+ }, [t.type]), /* @__PURE__ */ b(de, { children: [
558
+ s && /* @__PURE__ */ b(Se, { severity: "info", sx: { mb: 2 }, children: [
545
559
  "This property is inherited from",
546
560
  " ",
547
- /* @__PURE__ */ t("strong", { children: (y = p.inheritedFrom) == null ? void 0 : y.templateName }),
561
+ /* @__PURE__ */ r("strong", { children: (z = p.inheritedFrom) == null ? void 0 : z.templateName }),
548
562
  ". Only Default Value, Description and Required can be updated here."
549
563
  ] }),
550
- /* @__PURE__ */ t(C, { label: "Name", required: !0, labelPosition: o, children: /* @__PURE__ */ t(
551
- E,
564
+ /* @__PURE__ */ r(y, { label: "Name", required: !0, labelPosition: o, children: /* @__PURE__ */ r(
565
+ q,
552
566
  {
553
567
  label: o === "default" ? "Name" : void 0,
554
568
  name: "name",
555
- variant: r,
569
+ variant: a,
556
570
  fullWidth: !0,
557
571
  disabled: s,
558
572
  sx: { mb: 2, mt: 0.5 },
559
- value: a.name,
573
+ value: t.name,
560
574
  onChange: l,
561
575
  required: !0,
562
- ...u.name && {
576
+ ...f.name && {
563
577
  error: !0,
564
578
  helperText: "This field is required!"
565
579
  }
566
580
  }
567
581
  ) }),
568
- /* @__PURE__ */ t(C, { label: "Property ID", labelPosition: o, children: /* @__PURE__ */ t(
569
- E,
582
+ /* @__PURE__ */ r(y, { label: "Property ID", labelPosition: o, children: /* @__PURE__ */ r(
583
+ q,
570
584
  {
571
585
  label: o === "default" ? "Property ID" : void 0,
572
586
  name: "propertyId",
573
- variant: r,
587
+ variant: a,
574
588
  fullWidth: !0,
575
- disabled: m || s,
589
+ disabled: u || s,
576
590
  sx: { mb: 2 },
577
- value: a.propertyId,
591
+ value: t.propertyId,
578
592
  onChange: l
579
593
  }
580
594
  ) }),
581
- /* @__PURE__ */ t(C, { label: "Type", labelPosition: o, children: /* @__PURE__ */ f(W, { fullWidth: !0, variant: r, sx: { mb: 2 }, children: [
582
- o === "default" && /* @__PURE__ */ t(H, { id: "type-select-label", children: "Type" }),
583
- /* @__PURE__ */ t(
595
+ /* @__PURE__ */ r(y, { label: "Type", labelPosition: o, children: /* @__PURE__ */ b(V, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
596
+ o === "default" && /* @__PURE__ */ r(H, { id: "type-select-label", children: "Type" }),
597
+ /* @__PURE__ */ r(
584
598
  U,
585
599
  {
586
600
  label: o === "default" ? "Type" : void 0,
587
601
  name: "type",
588
602
  labelId: "type-select-label",
589
603
  id: "type-select",
590
- value: a.type,
604
+ value: t.type,
591
605
  disabled: s,
592
606
  onChange: l,
593
- children: K.map((n, d) => /* @__PURE__ */ t(G, { value: n, children: n }, d))
607
+ children: K.map((n, i) => /* @__PURE__ */ r(G, { value: n, children: n }, i))
594
608
  }
595
609
  )
596
610
  ] }) }),
597
- a.type === "coordinate" && /* @__PURE__ */ t(C, { label: "Coordinate Format", labelPosition: o, children: /* @__PURE__ */ f(W, { fullWidth: !0, variant: r, sx: { mb: 2 }, children: [
598
- o === "default" && /* @__PURE__ */ t(H, { id: "coordinate-format-select-label", children: "Cordinate Format" }),
599
- /* @__PURE__ */ t(
611
+ t.type === "coordinate" && /* @__PURE__ */ r(y, { label: "Coordinate Format", labelPosition: o, children: /* @__PURE__ */ b(V, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
612
+ o === "default" && /* @__PURE__ */ r(H, { id: "coordinate-format-select-label", children: "Cordinate Format" }),
613
+ /* @__PURE__ */ r(
600
614
  U,
601
615
  {
602
616
  label: o === "default" ? "Coordinate Format" : void 0,
603
617
  name: "dataTypeInfo.coordinateFormat",
604
618
  labelId: "coordinate-format-select-label",
605
619
  id: "coordinate-format-select",
606
- value: (I = a.dataTypeInfo) == null ? void 0 : I.coordinateFormat,
620
+ value: (A = t.dataTypeInfo) == null ? void 0 : A.coordinateFormat,
607
621
  disabled: s,
608
622
  onChange: l,
609
- children: Ie.map((n, d) => /* @__PURE__ */ t(G, { value: n, children: n }, d))
623
+ children: Fe.map((n, i) => /* @__PURE__ */ r(G, { value: n, children: n }, i))
610
624
  }
611
625
  )
612
626
  ] }) }),
613
- (a.type === "composite-list" || a.type === "composite-matrix") && /* @__PURE__ */ t(C, { label: "Inner Type", labelPosition: o, children: /* @__PURE__ */ f(W, { fullWidth: !0, variant: r, sx: { mb: 2 }, children: [
614
- o === "default" && /* @__PURE__ */ t(H, { id: "composite-list-select-label", children: "Inner Type" }),
615
- /* @__PURE__ */ t(
627
+ (t.type === "composite-list" || t.type === "composite-matrix") && /* @__PURE__ */ r(y, { label: "Inner Type", labelPosition: o, children: /* @__PURE__ */ b(V, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
628
+ o === "default" && /* @__PURE__ */ r(H, { id: "composite-list-select-label", children: "Inner Type" }),
629
+ /* @__PURE__ */ r(
616
630
  U,
617
631
  {
618
632
  label: o === "default" ? "Inner Type" : void 0,
619
633
  name: "dataTypeInfo.innerType.type",
620
634
  labelId: "composite-list-select-label",
621
635
  id: "composite-list-select",
622
- value: (j = (v = a.dataTypeInfo) == null ? void 0 : v.innerType) == null ? void 0 : j.type,
636
+ value: (D = (_ = t.dataTypeInfo) == null ? void 0 : _.innerType) == null ? void 0 : D.type,
623
637
  disabled: s,
624
638
  onChange: l,
625
639
  children: K.filter(
626
640
  (n) => n !== "composite-list" && n !== "list"
627
- ).map((n, d) => /* @__PURE__ */ t(G, { value: n, children: n }, d))
641
+ ).map((n, i) => /* @__PURE__ */ r(G, { value: n, children: n }, i))
628
642
  }
629
643
  )
630
644
  ] }) }),
631
- (a.type === "enum" || ((S = (w = a.dataTypeInfo) == null ? void 0 : w.innerType) == null ? void 0 : S.type) === "enum") && /* @__PURE__ */ t(C, { label: "Enum Values", labelPosition: o, children: /* @__PURE__ */ t(
632
- E,
645
+ (t.type === "enum" || ((g = (E = t.dataTypeInfo) == null ? void 0 : E.innerType) == null ? void 0 : g.type) === "enum") && /* @__PURE__ */ r(y, { label: "Enum Values", labelPosition: o, children: /* @__PURE__ */ r(
646
+ q,
633
647
  {
634
648
  label: o === "default" ? "Enum Values" : void 0,
635
- name: (($ = (_ = a.dataTypeInfo) == null ? void 0 : _.innerType) == null ? void 0 : $.type) === "enum" ? "dataTypeInfo.innerType.enumValues" : "dataTypeInfo.enumValues",
636
- variant: r,
649
+ name: ((oe = (R = t.dataTypeInfo) == null ? void 0 : R.innerType) == null ? void 0 : oe.type) === "enum" ? "dataTypeInfo.innerType.enumValues" : "dataTypeInfo.enumValues",
650
+ variant: a,
637
651
  fullWidth: !0,
638
652
  disabled: s,
639
653
  sx: { mb: 2 },
640
- value: ((P = (T = a.dataTypeInfo) == null ? void 0 : T.innerType) == null ? void 0 : P.type) === "enum" ? (re = (oe = a.dataTypeInfo.innerType) == null ? void 0 : oe.enumValues) == null ? void 0 : re.join(",") : (ae = (te = a.dataTypeInfo) == null ? void 0 : te.enumValues) == null ? void 0 : ae.join(","),
654
+ value: ((ae = (re = t.dataTypeInfo) == null ? void 0 : re.innerType) == null ? void 0 : ae.type) === "enum" ? (ne = (te = t.dataTypeInfo.innerType) == null ? void 0 : te.enumValues) == null ? void 0 : ne.join(",") : (ie = (le = t.dataTypeInfo) == null ? void 0 : le.enumValues) == null ? void 0 : ie.join(","),
641
655
  onChange: l,
642
656
  helperText: "Add list values with the comma (,) separated string"
643
657
  }
644
658
  ) }),
645
- /* @__PURE__ */ t(C, { label: "Default Value", labelPosition: o, children: /* @__PURE__ */ t(
646
- E,
659
+ t.type === "decimal" && /* @__PURE__ */ b(de, { children: [
660
+ /* @__PURE__ */ r(y, { label: "Precision", labelPosition: o, children: /* @__PURE__ */ r(
661
+ q,
662
+ {
663
+ label: o === "default" ? "Precision" : void 0,
664
+ name: "dataTypeInfo.precision",
665
+ type: "number",
666
+ variant: a,
667
+ fullWidth: !0,
668
+ disabled: s,
669
+ sx: { mb: 2 },
670
+ value: ((se = t.dataTypeInfo) == null ? void 0 : se.precision) ?? "",
671
+ onChange: O,
672
+ inputProps: { min: 1, step: 1 },
673
+ helperText: "Total number of significant digits, e.g. 18"
674
+ }
675
+ ) }),
676
+ /* @__PURE__ */ r(y, { label: "Scale", labelPosition: o, children: /* @__PURE__ */ r(
677
+ q,
678
+ {
679
+ label: o === "default" ? "Scale" : void 0,
680
+ name: "dataTypeInfo.scale",
681
+ type: "number",
682
+ variant: a,
683
+ fullWidth: !0,
684
+ disabled: s,
685
+ sx: { mb: 2 },
686
+ value: ((ce = t.dataTypeInfo) == null ? void 0 : ce.scale) ?? "",
687
+ onChange: O,
688
+ inputProps: { min: 0, step: 1 },
689
+ ...f.scale ? {
690
+ error: !0,
691
+ helperText: "Scale cannot be greater than the precision!"
692
+ } : {
693
+ helperText: "Number of fraction digits, e.g. 4"
694
+ }
695
+ }
696
+ ) })
697
+ ] }),
698
+ /* @__PURE__ */ r(y, { label: "Default Value", labelPosition: o, children: /* @__PURE__ */ r(
699
+ q,
647
700
  {
648
701
  label: o === "default" ? "Default Value" : void 0,
649
702
  name: "defaultValue",
650
- variant: r,
703
+ variant: a,
651
704
  fullWidth: !0,
652
705
  sx: { mb: 2 },
653
- value: a.defaultValue,
654
- onChange: l
706
+ value: t.defaultValue,
707
+ onChange: l,
708
+ ...t.type === "decimal" && {
709
+ helperText: 'Exact numeric string, e.g. "1234.56"'
710
+ }
655
711
  }
656
712
  ) }),
657
- /* @__PURE__ */ t(C, { label: "Description", labelPosition: o, children: /* @__PURE__ */ t(
658
- E,
713
+ /* @__PURE__ */ r(y, { label: "Description", labelPosition: o, children: /* @__PURE__ */ r(
714
+ q,
659
715
  {
660
716
  label: o === "default" ? "Description" : void 0,
661
717
  name: "description",
662
- variant: r,
718
+ variant: a,
663
719
  fullWidth: !0,
664
720
  multiline: !0,
665
721
  minRows: 2,
666
722
  sx: { mb: 2 },
667
- value: a.description ?? "",
723
+ value: t.description ?? "",
668
724
  onChange: l
669
725
  }
670
726
  ) }),
671
- /* @__PURE__ */ t(C, { label: "Privacy Preservation Method", labelPosition: o, children: /* @__PURE__ */ f(W, { fullWidth: !0, variant: r, sx: { mb: 2 }, children: [
672
- o === "default" && /* @__PURE__ */ t(H, { id: "privacy-method-label", children: "Privacy Preservation Method" }),
673
- /* @__PURE__ */ t(
674
- U,
675
- {
676
- label: o === "default" ? "Privacy Preservation Method" : void 0,
677
- name: "privacyPreservationMethod",
678
- labelId: "privacy-method-label",
679
- id: "privacy-method",
680
- value: a.privacyPreservationMethod,
681
- disabled: s,
682
- onChange: l,
683
- children: le.map((n, d) => /* @__PURE__ */ t(G, { value: n, children: n }, d))
684
- }
685
- )
686
- ] }) }),
687
- /* @__PURE__ */ f(Oe, { row: !0, sx: { mb: 2 }, children: [
688
- /* @__PURE__ */ t(
689
- F,
727
+ /* @__PURE__ */ r(
728
+ y,
729
+ {
730
+ label: "Privacy Preservation Method",
731
+ labelPosition: o,
732
+ children: /* @__PURE__ */ b(V, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
733
+ o === "default" && /* @__PURE__ */ r(H, { id: "privacy-method-label", children: "Privacy Preservation Method" }),
734
+ /* @__PURE__ */ r(
735
+ U,
736
+ {
737
+ label: o === "default" ? "Privacy Preservation Method" : void 0,
738
+ name: "privacyPreservationMethod",
739
+ labelId: "privacy-method-label",
740
+ id: "privacy-method",
741
+ value: t.privacyPreservationMethod,
742
+ disabled: s,
743
+ onChange: l,
744
+ children: me.map((n, i) => /* @__PURE__ */ r(G, { value: n, children: n }, i))
745
+ }
746
+ )
747
+ ] })
748
+ }
749
+ ),
750
+ /* @__PURE__ */ b(Me, { row: !0, sx: { mb: 2 }, children: [
751
+ /* @__PURE__ */ r(
752
+ N,
690
753
  {
691
754
  label: "Required",
692
- control: /* @__PURE__ */ t(
693
- R,
755
+ control: /* @__PURE__ */ r(
756
+ M,
694
757
  {
695
758
  name: "required",
696
- checked: a.required,
759
+ checked: t.required,
697
760
  onChange: l
698
761
  }
699
762
  ),
700
763
  sx: { width: "30%" }
701
764
  }
702
765
  ),
703
- /* @__PURE__ */ t(
704
- F,
766
+ /* @__PURE__ */ r(
767
+ N,
705
768
  {
706
769
  label: "Editable",
707
- control: /* @__PURE__ */ t(
708
- R,
770
+ control: /* @__PURE__ */ r(
771
+ M,
709
772
  {
710
773
  name: "editable",
711
- checked: a.editable,
774
+ checked: t.editable,
712
775
  disabled: s,
713
776
  onChange: l
714
777
  }
@@ -716,15 +779,15 @@ function To({
716
779
  sx: { width: "30%" }
717
780
  }
718
781
  ),
719
- /* @__PURE__ */ t(
720
- F,
782
+ /* @__PURE__ */ r(
783
+ N,
721
784
  {
722
785
  label: "Visible",
723
- control: /* @__PURE__ */ t(
724
- R,
786
+ control: /* @__PURE__ */ r(
787
+ M,
725
788
  {
726
789
  name: "visible",
727
- checked: a.visible,
790
+ checked: t.visible,
728
791
  disabled: s,
729
792
  onChange: l
730
793
  }
@@ -732,15 +795,15 @@ function To({
732
795
  sx: { width: "30%" }
733
796
  }
734
797
  ),
735
- /* @__PURE__ */ t(
736
- F,
798
+ /* @__PURE__ */ r(
799
+ N,
737
800
  {
738
801
  label: "Unique",
739
- control: /* @__PURE__ */ t(
740
- R,
802
+ control: /* @__PURE__ */ r(
803
+ M,
741
804
  {
742
805
  name: "unique",
743
- checked: a.unique,
806
+ checked: t.unique,
744
807
  disabled: s,
745
808
  onChange: l
746
809
  }
@@ -748,15 +811,15 @@ function To({
748
811
  sx: { width: "30%" }
749
812
  }
750
813
  ),
751
- /* @__PURE__ */ t(
752
- F,
814
+ /* @__PURE__ */ r(
815
+ N,
753
816
  {
754
817
  label: "Distinctive",
755
- control: /* @__PURE__ */ t(
756
- R,
818
+ control: /* @__PURE__ */ r(
819
+ M,
757
820
  {
758
821
  name: "distinctive",
759
- checked: a.distinctive,
822
+ checked: t.distinctive,
760
823
  disabled: s,
761
824
  onChange: l
762
825
  }
@@ -764,15 +827,15 @@ function To({
764
827
  sx: { width: "30%" }
765
828
  }
766
829
  ),
767
- /* @__PURE__ */ t(
768
- F,
830
+ /* @__PURE__ */ r(
831
+ N,
769
832
  {
770
833
  label: "Temporal",
771
- control: /* @__PURE__ */ t(
772
- R,
834
+ control: /* @__PURE__ */ r(
835
+ M,
773
836
  {
774
837
  name: "temporal",
775
- checked: a.temporal,
838
+ checked: t.temporal,
776
839
  disabled: s,
777
840
  onChange: l
778
841
  }
@@ -781,14 +844,14 @@ function To({
781
844
  }
782
845
  )
783
846
  ] }),
784
- /* @__PURE__ */ f(ke, { display: "flex", justifyContent: "flex-end", children: [
785
- /* @__PURE__ */ t(ie, { variant: "contained", onClick: h, sx: { marginRight: 2 }, children: "Cancel" }),
786
- /* @__PURE__ */ t(
787
- ie,
847
+ /* @__PURE__ */ b(qe, { display: "flex", justifyContent: "flex-end", children: [
848
+ /* @__PURE__ */ r(fe, { variant: "contained", onClick: v, sx: { marginRight: 2 }, children: "Cancel" }),
849
+ /* @__PURE__ */ r(
850
+ fe,
788
851
  {
789
852
  variant: "contained",
790
- startIcon: /* @__PURE__ */ t(fe, {}),
791
- onClick: q,
853
+ startIcon: /* @__PURE__ */ r(ge, {}),
854
+ onClick: w,
792
855
  children: "OK"
793
856
  }
794
857
  )
@@ -796,5 +859,5 @@ function To({
796
859
  ] });
797
860
  }
798
861
  export {
799
- To as default
862
+ Oo as default
800
863
  };