@hybridcore/ui 1.4.5 → 1.4.7

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.
@@ -3,7 +3,7 @@ import "@mui/material";
3
3
  import "./styled.js";
4
4
  import "@mui/icons-material";
5
5
  import "../../../../hooks/useToggle.js";
6
- import { C as l } from "../../../../index-DPf5olog.js";
6
+ import { C as l } from "../../../../index-V39OBeR0.js";
7
7
  import "react";
8
8
  import "lodash";
9
9
  import "dayjs";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "lodash";
3
3
  import "dayjs";
4
- import { V as g } from "../../../../index-DPf5olog.js";
4
+ import { V as g } from "../../../../index-V39OBeR0.js";
5
5
  import "@mui/material";
6
6
  import "@mui/icons-material";
7
7
  import "../../../geometry-picker/index.js";
@@ -1,29 +1,29 @@
1
- import { jsx as n, Fragment as t } from "react/jsx-runtime";
2
- import l from "react";
3
- import { V as p } from "../../../../index-DPf5olog.js";
1
+ import { jsx as i, Fragment as t } from "react/jsx-runtime";
2
+ import p from "react";
3
+ import { V as l } from "../../../../index-V39OBeR0.js";
4
4
  import m from "lodash";
5
5
  function b({
6
6
  template: o,
7
- value: i,
7
+ value: e,
8
8
  mapboxAccessToken: s,
9
9
  variant: a = "outlined",
10
10
  onChange: u
11
11
  }) {
12
- const d = l.useMemo(() => {
13
- let r = o == null ? void 0 : o.properties.filter((e) => e.visible);
12
+ const d = p.useMemo(() => {
13
+ let r = o == null ? void 0 : o.properties.filter((n) => n.visible);
14
14
  return r = m.orderBy(r, "id"), r;
15
15
  }, [o]), f = (r) => {
16
- const e = {
16
+ const n = {
17
17
  target: {
18
- value: { ...i, ...r }
18
+ value: { ...e, ...r }
19
19
  }
20
20
  };
21
- u(e);
21
+ u(n);
22
22
  };
23
- return o === void 0 ? /* @__PURE__ */ n(t, {}) : /* @__PURE__ */ n(t, { children: d.map((r, e) => {
24
- const c = i[r.propertyId];
25
- return /* @__PURE__ */ n(
26
- p,
23
+ return o === void 0 ? /* @__PURE__ */ i(t, {}) : /* @__PURE__ */ i(t, { children: d.map((r, n) => {
24
+ const c = e ? e[r.propertyId] : "";
25
+ return /* @__PURE__ */ i(
26
+ l,
27
27
  {
28
28
  property: r,
29
29
  value: c,
@@ -31,7 +31,7 @@ function b({
31
31
  variant: a,
32
32
  onChange: f
33
33
  },
34
- e
34
+ n
35
35
  );
36
36
  }) });
37
37
  }
@@ -5,7 +5,7 @@ import { DataGrid as fe } from "@mui/x-data-grid";
5
5
  import { useState as H, useEffect as ue } from "react";
6
6
  import h from "lodash";
7
7
  import { e as ye } from "../../ol-CHaVTXvL.js";
8
- import { V as he } from "../../index-DPf5olog.js";
8
+ import { V as he } from "../../index-V39OBeR0.js";
9
9
  import { RangeSelector as me } from "../range-selector/index.js";
10
10
  const $e = ({
11
11
  open: F,
@@ -2,7 +2,7 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { DataGrid as d } from "@mui/x-data-grid";
3
3
  import { A as n, a as m, d as s } from "../../../../Add-eepk2WTM.js";
4
4
  import p from "./property-list-columns.js";
5
- import { a as c } from "../../../../property-list-form-D-SW5H_I.js";
5
+ import { a as c } from "../../../../property-list-form-B1GZ9ZGO.js";
6
6
  import u from "./property-list-logic.js";
7
7
  import { B as f } from "../../../../Box-BPyg-Ybm.js";
8
8
  import { T as y } from "../../../../Typography-Bm7PFqUT.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "lodash";
4
- import { a as b } from "../../../../property-list-form-D-SW5H_I.js";
4
+ import { a as b } from "../../../../property-list-form-B1GZ9ZGO.js";
5
5
  import "../../../../constants/index.js";
6
6
  import "../../../../TextField-D87qTh1k.js";
7
7
  import "../../../../InputLabel-CWkW8NtU.js";
@@ -10,7 +10,7 @@ import { TreeSelect as _ } from "../tree-select/index.js";
10
10
  import { FormLabel as w, Button as b } from "@mui/material";
11
11
  import A from "./components/select-icon/index.js";
12
12
  import { T as m } from "../../TextField-D87qTh1k.js";
13
- import { F as g } from "../../property-list-form-D-SW5H_I.js";
13
+ import { F as g } from "../../property-list-form-B1GZ9ZGO.js";
14
14
  import { F as d } from "../../FormControlLabel-D9KFjcIx.js";
15
15
  import { C as c } from "../../Checkbox-qy3cjvnb.js";
16
16
  import { B as p } from "../../Box-BPyg-Ybm.js";
@@ -1,13 +1,14 @@
1
- import { jsx as s, Fragment as c } from "react/jsx-runtime";
1
+ import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
2
  import a from "lodash";
3
- import { CollapsibleCard as g } from "../collapsible-card/index.js";
4
- import p from "./property.js";
5
- const K = ({
3
+ import { CollapsibleCard as v } from "../collapsible-card/index.js";
4
+ import u from "./property.js";
5
+ const N = ({
6
6
  values: f,
7
7
  templates: d,
8
- onChange: u
8
+ inputVariant: m,
9
+ onChange: h
9
10
  }) => {
10
- const m = (t) => (r) => {
11
+ const c = (t) => (r) => {
11
12
  if (t) {
12
13
  let e = f.find((l) => l.templateKey === t);
13
14
  if (e) {
@@ -24,23 +25,24 @@ const K = ({
24
25
  value: n
25
26
  });
26
27
  }
27
- u(f);
28
+ h(f);
28
29
  } else console.warn("Template could not be found!");
29
30
  };
30
31
  if (f.length === 1) {
31
32
  const t = f[0], r = d.get(t.templateKey);
32
- return /* @__PURE__ */ s(c, { children: r == null ? void 0 : r.properties.map((e, l) => {
33
+ return /* @__PURE__ */ s(p, { children: r == null ? void 0 : r.properties.map((e, l) => {
33
34
  let i = {};
34
35
  const n = t.filters.find(
35
36
  (o) => o.fieldName === e.propertyId
36
37
  );
37
38
  return n && (i = n.value), /* @__PURE__ */ s(
38
- p,
39
+ u,
39
40
  {
40
41
  property: e,
41
42
  value: i,
42
43
  size: "small",
43
- onChange: m(r == null ? void 0 : r.templateKey)
44
+ variant: m,
45
+ onChange: c(r == null ? void 0 : r.templateKey)
44
46
  },
45
47
  l
46
48
  );
@@ -49,21 +51,22 @@ const K = ({
49
51
  return f.map((t, r) => {
50
52
  const e = d.get(t.templateKey);
51
53
  return /* @__PURE__ */ s(
52
- g,
54
+ v,
53
55
  {
54
56
  header: e == null ? void 0 : e.name,
55
- content: /* @__PURE__ */ s(c, { children: e == null ? void 0 : e.properties.map((l, i) => {
57
+ content: /* @__PURE__ */ s(p, { children: e == null ? void 0 : e.properties.map((l, i) => {
56
58
  let n = {};
57
59
  const o = t.filters.find(
58
- (h) => h.fieldName === l.propertyId
60
+ (g) => g.fieldName === l.propertyId
59
61
  );
60
62
  return o && (n = o.value), /* @__PURE__ */ s(
61
- p,
63
+ u,
62
64
  {
63
65
  property: l,
64
66
  value: n,
65
67
  size: "small",
66
- onChange: m(e == null ? void 0 : e.templateKey)
68
+ variant: m,
69
+ onChange: c(e == null ? void 0 : e.templateKey)
67
70
  },
68
71
  i
69
72
  );
@@ -74,5 +77,5 @@ const K = ({
74
77
  });
75
78
  };
76
79
  export {
77
- K as TemplatePropertyFilters
80
+ N as TemplatePropertyFilters
78
81
  };
@@ -1,49 +1,50 @@
1
- import { jsx as t, jsxs as d, Fragment as k } from "react/jsx-runtime";
2
- import { useState as w } from "react";
3
- import m from "dayjs";
4
- import { RadioButtonUnchecked as F, CheckCircle as S, KeyboardArrowUp as Y, KeyboardArrowDown as y } from "@mui/icons-material";
5
- import { Typography as g, FormLabel as D, FormGroup as L, Button as B } from "@mui/material";
6
- import { DatePicker as I } from "@mui/x-date-pickers";
7
- import { T as x } from "../../TextField-D87qTh1k.js";
8
- import { B as f } from "../../Box-BPyg-Ybm.js";
9
- import { F as C } from "../../FormControlLabel-D9KFjcIx.js";
10
- import { C as V } from "../../Checkbox-qy3cjvnb.js";
11
- import { F as T } from "../../InputLabel-CWkW8NtU.js";
12
- function E({
1
+ import { jsx as t, jsxs as u, Fragment as T } from "react/jsx-runtime";
2
+ import { useState as Y } from "react";
3
+ import r from "dayjs";
4
+ import { RadioButtonUnchecked as D, CheckCircle as L, KeyboardArrowUp as B, KeyboardArrowDown as W } from "@mui/icons-material";
5
+ import { Typography as M, FormLabel as z, FormGroup as $, Button as j } from "@mui/material";
6
+ import { DatePicker as P } from "@mui/x-date-pickers";
7
+ import { T as b } from "../../TextField-D87qTh1k.js";
8
+ import { B as h } from "../../Box-BPyg-Ybm.js";
9
+ import { F as k } from "../../FormControlLabel-D9KFjcIx.js";
10
+ import { C as w } from "../../Checkbox-qy3cjvnb.js";
11
+ import { F as A } from "../../InputLabel-CWkW8NtU.js";
12
+ function X({
13
13
  property: e,
14
- value: a,
15
- size: r = "medium",
16
- onChange: h
14
+ value: l,
15
+ size: s = "medium",
16
+ variant: d,
17
+ onChange: x
17
18
  }) {
18
- var p;
19
- const u = (o) => (n) => {
20
- let l = { ...a };
19
+ var g, I, V, C, y;
20
+ const c = (o) => (n) => {
21
+ let a = { ...l };
21
22
  const i = n.target.type === "checkbox" ? n.target.checked : n.target.value;
22
- l[o] = String(i), h({
23
- [n.target.name]: l
23
+ a[o] = String(i), x({
24
+ [n.target.name]: a
24
25
  });
25
- }, M = (o) => {
26
- var c;
27
- const n = { ...a }, { value: l, checked: i, name: s } = o.target;
28
- i ? (n.list || (n.list = []), n.list.push(l)) : n.list = (c = n.list) == null ? void 0 : c.filter((P) => P !== l), h({
29
- [s]: n
26
+ }, F = (o) => {
27
+ var f;
28
+ const n = { ...l }, { value: a, checked: i, name: m } = o.target;
29
+ i ? (n.list || (n.list = []), n.list.push(a)) : n.list = (f = n.list) == null ? void 0 : f.filter((S) => S !== a), x({
30
+ [m]: n
30
31
  });
31
- }, b = (o) => (n) => {
32
- let l = { ...a };
33
- l[o] = m(n).format("YYYY-MM-DD"), h({
34
- [e.propertyId]: l
32
+ }, p = (o) => (n) => {
33
+ let a = { ...l };
34
+ a[o] = r(n).format("YYYY-MM-DD"), x({
35
+ [e.propertyId]: a
35
36
  });
36
37
  };
37
38
  if (["string", "text", "list"].includes(e.type))
38
39
  return /* @__PURE__ */ t(
39
- x,
40
+ b,
40
41
  {
41
42
  label: e.name,
42
43
  name: e.propertyId,
43
- value: a.exact ?? e.defaultValue ?? "",
44
- size: r,
45
- onChange: u("exact"),
46
- variant: "standard",
44
+ value: l.exact ?? e.defaultValue ?? "",
45
+ size: s,
46
+ onChange: c("exact"),
47
+ variant: d,
47
48
  type: "text",
48
49
  multiline: e.type === "text",
49
50
  disabled: !e.editable,
@@ -55,16 +56,16 @@ function E({
55
56
  }
56
57
  );
57
58
  if (["integer", "double", "long", "byte"].includes(e.type))
58
- return /* @__PURE__ */ d(f, { display: "flex", alignItems: "center", mb: 2, children: [
59
+ return /* @__PURE__ */ u(h, { display: "flex", alignItems: "center", mb: 2, children: [
59
60
  /* @__PURE__ */ t(
60
- x,
61
+ b,
61
62
  {
62
63
  label: `${e.name} (Min)`,
63
64
  name: e.propertyId,
64
- value: a.min ?? e.defaultValue ?? "",
65
- size: r,
66
- onChange: u("min"),
67
- variant: "standard",
65
+ value: l.min ?? e.defaultValue ?? "",
66
+ size: s,
67
+ onChange: c("min"),
68
+ variant: d,
68
69
  type: "number",
69
70
  disabled: !e.editable,
70
71
  fullWidth: !0,
@@ -73,16 +74,16 @@ function E({
73
74
  }
74
75
  }
75
76
  ),
76
- /* @__PURE__ */ t(g, { px: 1, children: "-" }),
77
+ /* @__PURE__ */ t(M, { px: 1, children: "-" }),
77
78
  /* @__PURE__ */ t(
78
- x,
79
+ b,
79
80
  {
80
81
  label: `${e.name} (Max)`,
81
82
  name: e.propertyId,
82
- value: a.max ?? e.defaultValue ?? "",
83
- size: r,
84
- onChange: u("max"),
85
- variant: "standard",
83
+ value: l.max ?? e.defaultValue ?? "",
84
+ size: s,
85
+ onChange: c("max"),
86
+ variant: d,
86
87
  type: "number",
87
88
  disabled: !e.editable,
88
89
  fullWidth: !0,
@@ -93,66 +94,66 @@ function E({
93
94
  )
94
95
  ] });
95
96
  if (e.type === "date") {
96
- const o = "DD/MM/YYYY", n = "YYYY-MM-DD", l = a.min && m(a.min, n, !0).isValid() ? m(a.min, n) : null, i = a.max && m(a.max, n, !0).isValid() ? m(a.max, n) : null;
97
- return /* @__PURE__ */ d(f, { mb: 2, display: "flex", alignItems: "end", children: [
97
+ const o = "DD/MM/YYYY", n = "YYYY-MM-DD", a = l.min && r(l.min, n, !0).isValid() ? r(l.min, n) : null, i = l.max && r(l.max, n, !0).isValid() ? r(l.max, n) : null;
98
+ return /* @__PURE__ */ u(h, { mb: 2, display: "flex", alignItems: "end", children: [
98
99
  /* @__PURE__ */ t(
99
- I,
100
+ P,
100
101
  {
101
102
  label: `${e.name} (Min)`,
102
- value: l,
103
+ value: a,
103
104
  format: o,
104
105
  views: ["year", "month", "day"],
105
106
  slotProps: {
106
107
  textField: {
107
- variant: "standard",
108
+ variant: d,
108
109
  name: e.propertyId,
109
- size: r,
110
+ size: s,
110
111
  fullWidth: !0,
111
112
  InputLabelProps: { sx: { fontSize: 14 } },
112
113
  inputProps: { sx: { fontSize: 14 } }
113
114
  }
114
115
  },
115
- onChange: b("min")
116
+ onChange: p("min")
116
117
  }
117
118
  ),
118
- /* @__PURE__ */ t(g, { px: 1, children: "-" }),
119
+ /* @__PURE__ */ t(M, { px: 1, children: "-" }),
119
120
  /* @__PURE__ */ t(
120
- I,
121
+ P,
121
122
  {
122
123
  label: `${e.name} (Max)`,
123
124
  value: i,
124
125
  format: o,
125
- minDate: l !== null ? l : void 0,
126
+ minDate: a !== null ? a : void 0,
126
127
  views: ["year", "month", "day"],
127
128
  slotProps: {
128
129
  textField: {
129
- variant: "standard",
130
+ variant: d,
130
131
  name: e.propertyId,
131
- size: r,
132
+ size: s,
132
133
  fullWidth: !0,
133
134
  InputLabelProps: { sx: { fontSize: 14 } },
134
135
  inputProps: { sx: { fontSize: 14 } }
135
136
  }
136
137
  },
137
- onChange: b("max")
138
+ onChange: p("max")
138
139
  }
139
140
  )
140
141
  ] });
141
142
  }
142
143
  if (e.type === "boolean")
143
- return /* @__PURE__ */ t(f, { mb: 2, children: /* @__PURE__ */ t(
144
- C,
144
+ return /* @__PURE__ */ t(h, { mb: 2, children: /* @__PURE__ */ t(
145
+ k,
145
146
  {
146
147
  label: e.name,
147
148
  control: /* @__PURE__ */ t(
148
- V,
149
+ w,
149
150
  {
150
- size: r,
151
+ size: s,
151
152
  name: e.propertyId,
152
- checked: !!a,
153
- icon: /* @__PURE__ */ t(F, {}),
154
- checkedIcon: /* @__PURE__ */ t(S, {}),
155
- onChange: u("exact")
153
+ checked: !!l,
154
+ icon: /* @__PURE__ */ t(D, {}),
155
+ checkedIcon: /* @__PURE__ */ t(L, {}),
156
+ onChange: c("exact")
156
157
  }
157
158
  ),
158
159
  slotProps: {
@@ -162,24 +163,24 @@ function E({
162
163
  }
163
164
  }
164
165
  ) });
165
- if (e.type === "enum") {
166
- const [o, n] = w(!1), l = 10;
166
+ if (e.type === "enum" || e.type === "composite-list" && ((I = (g = e.dataTypeInfo) == null ? void 0 : g.innerType) == null ? void 0 : I.type) === "enum") {
167
+ const [o, n] = Y(!1), a = 10;
167
168
  let i = [];
168
- return (p = e.dataTypeInfo) != null && p.enumValues && (i = e.dataTypeInfo.enumValues), /* @__PURE__ */ d(f, { mb: 2, children: [
169
- /* @__PURE__ */ d(T, { fullWidth: !0, component: "fieldset", variant: "standard", children: [
170
- /* @__PURE__ */ t(D, { component: "legend", sx: { mb: 1 }, children: e.name }),
171
- /* @__PURE__ */ t(L, { children: i.slice(0, o ? 9999 : l).map((s, c) => /* @__PURE__ */ t(
172
- C,
169
+ return (V = e.dataTypeInfo) != null && V.enumValues && (i = e.dataTypeInfo.enumValues), (y = (C = e.dataTypeInfo) == null ? void 0 : C.innerType) != null && y.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ u(h, { mb: 2, children: [
170
+ /* @__PURE__ */ u(A, { fullWidth: !0, component: "fieldset", variant: d, children: [
171
+ /* @__PURE__ */ t(z, { component: "legend", sx: { mb: 1 }, children: e.name }),
172
+ /* @__PURE__ */ t($, { children: i.slice(0, o ? 9999 : a).map((m, f) => /* @__PURE__ */ t(
173
+ k,
173
174
  {
174
- label: s,
175
+ label: m,
175
176
  control: /* @__PURE__ */ t(
176
- V,
177
+ w,
177
178
  {
178
179
  name: e.propertyId,
179
- value: s,
180
+ value: m,
180
181
  size: "small",
181
- checked: a.list ? a.list.includes(s) : !1,
182
- onChange: M
182
+ checked: l.list ? l.list.includes(m) : !1,
183
+ onChange: F
183
184
  }
184
185
  ),
185
186
  componentsProps: {
@@ -188,16 +189,16 @@ function E({
188
189
  }
189
190
  }
190
191
  },
191
- c
192
+ f
192
193
  )) })
193
194
  ] }),
194
- i.length > l && /* @__PURE__ */ d(
195
- B,
195
+ i.length > a && /* @__PURE__ */ u(
196
+ j,
196
197
  {
197
198
  size: "small",
198
199
  sx: { p: 0, textTransform: "none" },
199
- endIcon: o ? /* @__PURE__ */ t(Y, {}) : /* @__PURE__ */ t(y, {}),
200
- onClick: () => n((s) => !s),
200
+ endIcon: o ? /* @__PURE__ */ t(B, {}) : /* @__PURE__ */ t(W, {}),
201
+ onClick: () => n((m) => !m),
201
202
  children: [
202
203
  "Show ",
203
204
  o ? "Less" : "More"
@@ -206,8 +207,8 @@ function E({
206
207
  )
207
208
  ] });
208
209
  }
209
- return /* @__PURE__ */ t(k, {});
210
+ return /* @__PURE__ */ t(T, {});
210
211
  }
211
212
  export {
212
- E as default
213
+ X as default
213
214
  };