@hybridcore/ui 1.4.6 → 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,
@@ -0,0 +1,335 @@
1
+ import { jsxs as h, Fragment as D, jsx as n } from "react/jsx-runtime";
2
+ import I from "lodash";
3
+ import N from "dayjs";
4
+ import { FormControl as W, FormLabel as j, FormGroup as Y, FormControlLabel as $, Checkbox as v, Typography as P, Button as L, Chip as O, Dialog as _, DialogTitle as E, DialogContent as G, DialogActions as M, InputAdornment as H, Tooltip as K } from "@mui/material";
5
+ import { Container as R, Values as U, MiniButton as q } from "./components/instance-form/components/composite-list/styled.js";
6
+ import { KeyboardArrowUp as J, KeyboardArrowDown as Q, Add as X, LockOutlined as Z } from "@mui/icons-material";
7
+ import z from "./hooks/useToggle.js";
8
+ import { GeometryPicker as ee } from "./components/geometry-picker/index.js";
9
+ import { PhoneInput as ne } from "./components/phone-input/index.js";
10
+ import { DateTimePicker as le } from "./components/date-time-picker/index.js";
11
+ import { T as S } from "./TextField-D87qTh1k.js";
12
+ import { B as T } from "./Box-BPyg-Ybm.js";
13
+ import { F as te } from "./FormControlLabel-D9KFjcIx.js";
14
+ import { C as ae } from "./Checkbox-qy3cjvnb.js";
15
+ import { F as oe, I as ie } from "./InputLabel-CWkW8NtU.js";
16
+ import { S as de } from "./Select-ClaBvSqf.js";
17
+ import { M as me } from "./MenuItem-D-INSvZa.js";
18
+ import { useState as B } from "react";
19
+ function ce({
20
+ property: i,
21
+ mapboxAccessToken: e,
22
+ value: l,
23
+ variant: r = "outlined",
24
+ size: m = "medium",
25
+ onChange: d
26
+ }) {
27
+ var g, V, t;
28
+ const f = z(!1), [c, p] = B(), [C, w] = B(!1), x = 10, A = (a) => {
29
+ p(I.get(a, i.propertyId));
30
+ }, y = () => {
31
+ d([...l || [], c]), p(""), f.action.close();
32
+ }, F = (a) => () => {
33
+ if (l) {
34
+ const o = [...l];
35
+ o.splice(a, 1), d(o);
36
+ }
37
+ }, k = (a) => {
38
+ const { value: o, checked: s } = a.target;
39
+ let u = I.isArray(l) ? l : [];
40
+ s ? u.push(o) : u = u.filter((b) => b !== o), d(u);
41
+ };
42
+ if (((V = (g = i.dataTypeInfo) == null ? void 0 : g.innerType) == null ? void 0 : V.type) === "enum") {
43
+ const { enumValues: a } = i.dataTypeInfo.innerType;
44
+ return /* @__PURE__ */ h(D, { children: [
45
+ /* @__PURE__ */ h(W, { fullWidth: !0, component: "fieldset", variant: r, children: [
46
+ /* @__PURE__ */ n(j, { component: "legend", sx: { mb: 1 }, children: i.name }),
47
+ /* @__PURE__ */ n(Y, { children: a && a.length > 0 ? a.slice(0, C ? 9999 : x).map((o, s) => /* @__PURE__ */ n(
48
+ $,
49
+ {
50
+ label: o,
51
+ control: /* @__PURE__ */ n(
52
+ v,
53
+ {
54
+ name: i.propertyId,
55
+ value: o,
56
+ size: "small",
57
+ checked: I.isArray(l) ? l.includes(o) : !1,
58
+ onChange: k
59
+ }
60
+ ),
61
+ componentsProps: {
62
+ typography: {
63
+ variant: "body2"
64
+ }
65
+ }
66
+ },
67
+ s
68
+ )) : /* @__PURE__ */ n(P, { variant: "caption", mb: 1, children: "No enum values!" }) })
69
+ ] }),
70
+ I.isArray(a) && a.length > x && /* @__PURE__ */ h(
71
+ L,
72
+ {
73
+ size: "small",
74
+ sx: { p: 0, textTransform: "none" },
75
+ endIcon: C ? /* @__PURE__ */ n(J, {}) : /* @__PURE__ */ n(Q, {}),
76
+ onClick: () => w((o) => !o),
77
+ children: [
78
+ "Show ",
79
+ C ? "Less" : "More"
80
+ ]
81
+ }
82
+ )
83
+ ] });
84
+ }
85
+ return /* @__PURE__ */ h(D, { children: [
86
+ /* @__PURE__ */ h(R, { variant: r, children: [
87
+ /* @__PURE__ */ n(P, { children: i.name }),
88
+ /* @__PURE__ */ n(U, { children: I.isArray(l) && l.map((a, o) => {
89
+ var s, u;
90
+ return /* @__PURE__ */ n(
91
+ O,
92
+ {
93
+ label: ((u = (s = i.dataTypeInfo) == null ? void 0 : s.innerType) == null ? void 0 : u.type) === "date" ? N(a).format("DD/MM/YYYY HH:mm:ss") : a,
94
+ size: m,
95
+ onDelete: F(o)
96
+ },
97
+ o
98
+ );
99
+ }) }),
100
+ /* @__PURE__ */ n(
101
+ q,
102
+ {
103
+ startIcon: /* @__PURE__ */ n(X, {}),
104
+ variant: "text",
105
+ onClick: f.action.open,
106
+ children: "Add"
107
+ }
108
+ )
109
+ ] }),
110
+ /* @__PURE__ */ h(
111
+ _,
112
+ {
113
+ open: f.state.isOpen,
114
+ onClose: f.action.close,
115
+ maxWidth: "sm",
116
+ fullWidth: !0,
117
+ children: [
118
+ /* @__PURE__ */ n(E, { children: "Add List Value" }),
119
+ /* @__PURE__ */ n(G, { children: (t = i.dataTypeInfo) != null && t.innerType ? /* @__PURE__ */ n(
120
+ se,
121
+ {
122
+ mapboxAccessToken: e,
123
+ property: {
124
+ ...i,
125
+ name: "Value",
126
+ type: i.dataTypeInfo.innerType.type
127
+ },
128
+ value: c,
129
+ onChange: A
130
+ }
131
+ ) : null }),
132
+ /* @__PURE__ */ h(M, { children: [
133
+ /* @__PURE__ */ n(
134
+ L,
135
+ {
136
+ variant: "contained",
137
+ color: "inherit",
138
+ onClick: f.action.close,
139
+ children: "Cancel"
140
+ }
141
+ ),
142
+ /* @__PURE__ */ n(L, { variant: "contained", color: "primary", onClick: y, children: "Ok" })
143
+ ] })
144
+ ]
145
+ }
146
+ )
147
+ ] });
148
+ }
149
+ function se({
150
+ mapboxAccessToken: i,
151
+ property: e,
152
+ value: l,
153
+ variant: r = "standard",
154
+ size: m = "medium",
155
+ disableMargin: d = !1,
156
+ defaultExtent: f,
157
+ // keyAuth,
158
+ onChange: c
159
+ }) {
160
+ var k, g, V;
161
+ const p = (t) => {
162
+ const o = t.target.value.split(",").map((s) => s.trimStart());
163
+ c({
164
+ [e.propertyId]: o
165
+ });
166
+ }, C = (t) => {
167
+ const { name: a, type: o, checked: s, value: u } = t.target;
168
+ let b = u;
169
+ e.type === "double" && (b = b.replace(",", "."), b = b.replace(/[^\d.-]+/g, "")), c({
170
+ [a]: o === "checkbox" ? s : b
171
+ });
172
+ }, w = (t) => {
173
+ c({
174
+ [e.propertyId]: t
175
+ });
176
+ }, x = (t) => {
177
+ c({
178
+ [e.propertyId]: t.target.value
179
+ });
180
+ }, A = (t) => (a) => {
181
+ c({
182
+ [t]: a
183
+ });
184
+ }, y = (t) => (a) => {
185
+ c({
186
+ [t]: a
187
+ });
188
+ }, F = (t) => (a) => {
189
+ c({
190
+ [t]: a
191
+ });
192
+ };
193
+ if ([
194
+ "string",
195
+ "integer",
196
+ "double",
197
+ "text",
198
+ "long",
199
+ "byte",
200
+ "bank-account"
201
+ ].includes(e.type))
202
+ return /* @__PURE__ */ n(
203
+ S,
204
+ {
205
+ label: e.name,
206
+ name: e.propertyId,
207
+ value: l ?? e.defaultValue ?? "",
208
+ defaultValue: l,
209
+ onChange: C,
210
+ variant: r,
211
+ type: "text",
212
+ multiline: e.type === "text",
213
+ disabled: !e.editable,
214
+ fullWidth: !0,
215
+ sx: { mb: d ? 0 : 2 },
216
+ InputProps: {
217
+ size: m,
218
+ ...e.privacyPreservationMethod === "ENCRYPTION" ? {
219
+ endAdornment: /* @__PURE__ */ n(H, { position: "end", children: /* @__PURE__ */ n(K, { title: "Encrypted Field", children: /* @__PURE__ */ n(Z, {}) }) })
220
+ } : {}
221
+ }
222
+ }
223
+ );
224
+ if (e.type === "date") {
225
+ const t = l !== void 0 ? N(l).format() : l;
226
+ return /* @__PURE__ */ n(T, { mb: d ? 0 : 2, children: /* @__PURE__ */ n(
227
+ le,
228
+ {
229
+ label: e.name,
230
+ value: t,
231
+ variant: r,
232
+ size: m,
233
+ name: e.propertyId,
234
+ onChange: w
235
+ }
236
+ ) });
237
+ }
238
+ if (e.type === "list") {
239
+ let t = "";
240
+ return e.defaultValue && (t = I.isArray(e.defaultValue) ? l.join(", ") : e.defaultValue), l && (t = I.isArray(l) ? l.join(",") : l), /* @__PURE__ */ n(
241
+ S,
242
+ {
243
+ label: e.name,
244
+ name: e.propertyId,
245
+ value: t,
246
+ onChange: p,
247
+ variant: r,
248
+ disabled: !e.editable,
249
+ fullWidth: !0,
250
+ helperText: m === "small" ? null : "Add list values with the comma (,) separated string",
251
+ sx: { mb: d ? 0 : 2 },
252
+ InputProps: {
253
+ size: m,
254
+ placeholder: m === "small" ? "Add list values with the comma (,) separated string" : ""
255
+ }
256
+ }
257
+ );
258
+ }
259
+ if (e.type === "boolean")
260
+ return /* @__PURE__ */ n(T, { mb: d ? 0 : 2, children: /* @__PURE__ */ n(
261
+ te,
262
+ {
263
+ control: /* @__PURE__ */ n(
264
+ ae,
265
+ {
266
+ name: e.propertyId,
267
+ checked: !!l,
268
+ onChange: C,
269
+ size: m
270
+ }
271
+ ),
272
+ label: e.name
273
+ }
274
+ ) });
275
+ if (e.type === "enum") {
276
+ let t = [];
277
+ return (k = e.dataTypeInfo) != null && k.enumValues && (t = e.dataTypeInfo.enumValues), (V = (g = e.dataTypeInfo) == null ? void 0 : g.innerType) != null && V.enumValues && (t = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ h(
278
+ oe,
279
+ {
280
+ fullWidth: !0,
281
+ variant: r,
282
+ sx: { mb: d ? 0 : 2 },
283
+ size: m,
284
+ children: [
285
+ /* @__PURE__ */ n(ie, { id: `${e.propertyId}-label`, children: e.name }),
286
+ /* @__PURE__ */ n(
287
+ de,
288
+ {
289
+ label: e.name,
290
+ name: e.name,
291
+ labelId: `${e.propertyId}-label`,
292
+ id: e.propertyId,
293
+ value: l ?? "",
294
+ onChange: x,
295
+ children: t.map((a, o) => /* @__PURE__ */ n(me, { value: a, children: a }, o))
296
+ }
297
+ )
298
+ ]
299
+ }
300
+ );
301
+ }
302
+ return e.type === "geometry" ? /* @__PURE__ */ n(T, { sx: { mb: d ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
303
+ ee,
304
+ {
305
+ mapboxAccessToken: i,
306
+ label: e.name,
307
+ value: l ?? e.defaultValue ?? "",
308
+ defaultExtent: f,
309
+ variant: r,
310
+ onChange: A(e.propertyId)
311
+ }
312
+ ) }) : e.type === "phone-number" ? /* @__PURE__ */ n(T, { sx: { mb: d ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
313
+ ne,
314
+ {
315
+ label: e.name,
316
+ placeholder: "Enter phone number",
317
+ value: l ?? e.defaultValue ?? "",
318
+ onChange: y(e.propertyId)
319
+ }
320
+ ) }) : e.type === "composite-list" ? /* @__PURE__ */ n(T, { sx: { mb: d ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
321
+ ce,
322
+ {
323
+ property: e,
324
+ value: l ?? e.defaultValue ?? "",
325
+ variant: r,
326
+ size: m,
327
+ mapboxAccessToken: i,
328
+ onChange: F(e.propertyId)
329
+ }
330
+ ) }) : /* @__PURE__ */ n(D, {});
331
+ }
332
+ export {
333
+ ce as C,
334
+ se as V
335
+ };
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.4.6",
4
+ "version": "1.4.7",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",
@@ -1,288 +0,0 @@
1
- import { jsxs as C, Fragment as P, jsx as n } from "react/jsx-runtime";
2
- import T from "lodash";
3
- import F from "dayjs";
4
- import { Typography as B, Chip as j, Dialog as N, DialogTitle as S, DialogContent as W, DialogActions as Y, Button as w, InputAdornment as v, Tooltip as O } from "@mui/material";
5
- import { Container as _, Values as y, MiniButton as E } from "./components/instance-form/components/composite-list/styled.js";
6
- import { Add as G, LockOutlined as H } from "@mui/icons-material";
7
- import R from "./hooks/useToggle.js";
8
- import { GeometryPicker as $ } from "./components/geometry-picker/index.js";
9
- import { PhoneInput as q } from "./components/phone-input/index.js";
10
- import { DateTimePicker as J } from "./components/date-time-picker/index.js";
11
- import { T as D } from "./TextField-D87qTh1k.js";
12
- import { B as b } from "./Box-BPyg-Ybm.js";
13
- import { F as K } from "./FormControlLabel-D9KFjcIx.js";
14
- import { C as Q } from "./Checkbox-qy3cjvnb.js";
15
- import { F as U, I as X } from "./InputLabel-CWkW8NtU.js";
16
- import { S as Z } from "./Select-ClaBvSqf.js";
17
- import { M } from "./MenuItem-D-INSvZa.js";
18
- import { useState as z } from "react";
19
- function ee({
20
- property: m,
21
- mapboxAccessToken: e,
22
- value: l,
23
- variant: c = "outlined",
24
- size: i = "medium",
25
- onChange: a
26
- }) {
27
- var x;
28
- const s = R(!1), [d, g] = z(), V = (u) => {
29
- g(T.get(u, m.propertyId));
30
- }, p = () => {
31
- a([...l || [], d]), g(""), s.action.close();
32
- }, k = (u) => () => {
33
- if (l) {
34
- const r = [...l];
35
- r.splice(u, 1), a(r);
36
- }
37
- };
38
- return /* @__PURE__ */ C(P, { children: [
39
- /* @__PURE__ */ C(_, { variant: c, children: [
40
- /* @__PURE__ */ n(B, { children: m.name }),
41
- /* @__PURE__ */ n(y, { children: T.isArray(l) && l.map((u, r) => {
42
- var h, t;
43
- return /* @__PURE__ */ n(
44
- j,
45
- {
46
- label: ((t = (h = m.dataTypeInfo) == null ? void 0 : h.innerType) == null ? void 0 : t.type) === "date" ? F(u).format("DD/MM/YYYY HH:mm:ss") : u,
47
- size: i,
48
- onDelete: k(r)
49
- },
50
- r
51
- );
52
- }) }),
53
- /* @__PURE__ */ n(
54
- E,
55
- {
56
- startIcon: /* @__PURE__ */ n(G, {}),
57
- variant: "text",
58
- onClick: s.action.open,
59
- children: "Add"
60
- }
61
- )
62
- ] }),
63
- /* @__PURE__ */ C(
64
- N,
65
- {
66
- open: s.state.isOpen,
67
- onClose: s.action.close,
68
- maxWidth: "sm",
69
- fullWidth: !0,
70
- children: [
71
- /* @__PURE__ */ n(S, { children: "Add List Value" }),
72
- /* @__PURE__ */ n(W, { children: (x = m.dataTypeInfo) != null && x.innerType ? /* @__PURE__ */ n(
73
- ne,
74
- {
75
- mapboxAccessToken: e,
76
- property: {
77
- ...m,
78
- name: "Value",
79
- type: m.dataTypeInfo.innerType.type
80
- },
81
- value: d,
82
- onChange: V
83
- }
84
- ) : null }),
85
- /* @__PURE__ */ C(Y, { children: [
86
- /* @__PURE__ */ n(
87
- w,
88
- {
89
- variant: "contained",
90
- color: "inherit",
91
- onClick: s.action.close,
92
- children: "Cancel"
93
- }
94
- ),
95
- /* @__PURE__ */ n(w, { variant: "contained", color: "primary", onClick: p, children: "Ok" })
96
- ] })
97
- ]
98
- }
99
- )
100
- ] });
101
- }
102
- function ne({
103
- mapboxAccessToken: m,
104
- property: e,
105
- value: l,
106
- variant: c = "standard",
107
- size: i = "medium",
108
- disableMargin: a = !1,
109
- defaultExtent: s,
110
- // keyAuth,
111
- onChange: d
112
- }) {
113
- var h;
114
- const g = (t) => {
115
- const f = t.target.value.split(",").map((A) => A.trimStart());
116
- d({
117
- [e.propertyId]: f
118
- });
119
- }, V = (t) => {
120
- const { name: o, type: f, checked: A, value: L } = t.target;
121
- let I = L;
122
- e.type === "double" && (I = I.replace(",", "."), I = I.replace(/[^\d.-]+/g, "")), d({
123
- [o]: f === "checkbox" ? A : I
124
- });
125
- }, p = (t) => {
126
- d({
127
- [e.propertyId]: t
128
- });
129
- }, k = (t) => {
130
- d({
131
- [e.propertyId]: t.target.value
132
- });
133
- }, x = (t) => (o) => {
134
- d({
135
- [t]: o
136
- });
137
- }, u = (t) => (o) => {
138
- d({
139
- [t]: o
140
- });
141
- }, r = (t) => (o) => {
142
- d({
143
- [t]: o
144
- });
145
- };
146
- if ([
147
- "string",
148
- "integer",
149
- "double",
150
- "text",
151
- "long",
152
- "byte",
153
- "bank-account"
154
- ].includes(e.type))
155
- return /* @__PURE__ */ n(
156
- D,
157
- {
158
- label: e.name,
159
- name: e.propertyId,
160
- value: l ?? e.defaultValue ?? "",
161
- defaultValue: l,
162
- onChange: V,
163
- variant: c,
164
- type: "text",
165
- multiline: e.type === "text",
166
- disabled: !e.editable,
167
- fullWidth: !0,
168
- sx: { mb: a ? 0 : 2 },
169
- InputProps: {
170
- size: i,
171
- ...e.privacyPreservationMethod === "ENCRYPTION" ? {
172
- endAdornment: /* @__PURE__ */ n(v, { position: "end", children: /* @__PURE__ */ n(O, { title: "Encrypted Field", children: /* @__PURE__ */ n(H, {}) }) })
173
- } : {}
174
- }
175
- }
176
- );
177
- if (e.type === "date") {
178
- const t = l !== void 0 ? F(l).format() : l;
179
- return /* @__PURE__ */ n(b, { mb: a ? 0 : 2, children: /* @__PURE__ */ n(
180
- J,
181
- {
182
- label: e.name,
183
- value: t,
184
- variant: c,
185
- size: i,
186
- name: e.propertyId,
187
- onChange: p
188
- }
189
- ) });
190
- }
191
- if (e.type === "list") {
192
- let t = "";
193
- return e.defaultValue && (t = T.isArray(e.defaultValue) ? l.join(", ") : e.defaultValue), l && (t = T.isArray(l) ? l.join(",") : l), /* @__PURE__ */ n(
194
- D,
195
- {
196
- label: e.name,
197
- name: e.propertyId,
198
- value: t,
199
- onChange: g,
200
- variant: c,
201
- disabled: !e.editable,
202
- fullWidth: !0,
203
- helperText: i === "small" ? null : "Add list values with the comma (,) separated string",
204
- sx: { mb: a ? 0 : 2 },
205
- InputProps: {
206
- size: i,
207
- placeholder: i === "small" ? "Add list values with the comma (,) separated string" : ""
208
- }
209
- }
210
- );
211
- }
212
- if (e.type === "boolean")
213
- return /* @__PURE__ */ n(b, { mb: a ? 0 : 2, children: /* @__PURE__ */ n(
214
- K,
215
- {
216
- control: /* @__PURE__ */ n(
217
- Q,
218
- {
219
- name: e.propertyId,
220
- checked: !!l,
221
- onChange: V,
222
- size: i
223
- }
224
- ),
225
- label: e.name
226
- }
227
- ) });
228
- if (e.type === "enum") {
229
- let t = [];
230
- return (h = e.dataTypeInfo) != null && h.enumValues && (t = e.dataTypeInfo.enumValues), /* @__PURE__ */ C(
231
- U,
232
- {
233
- fullWidth: !0,
234
- variant: c,
235
- sx: { mb: a ? 0 : 2 },
236
- size: i,
237
- children: [
238
- /* @__PURE__ */ n(X, { id: `${e.propertyId}-label`, children: e.name }),
239
- /* @__PURE__ */ n(
240
- Z,
241
- {
242
- label: e.name,
243
- name: e.name,
244
- labelId: `${e.propertyId}-label`,
245
- id: e.propertyId,
246
- value: l ?? "",
247
- onChange: k,
248
- children: t.map((o, f) => /* @__PURE__ */ n(M, { value: o, children: o }, f))
249
- }
250
- )
251
- ]
252
- }
253
- );
254
- }
255
- return e.type === "geometry" ? /* @__PURE__ */ n(b, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
256
- $,
257
- {
258
- mapboxAccessToken: m,
259
- label: e.name,
260
- value: l ?? e.defaultValue ?? "",
261
- defaultExtent: s,
262
- variant: c,
263
- onChange: x(e.propertyId)
264
- }
265
- ) }) : e.type === "phone-number" ? /* @__PURE__ */ n(b, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
266
- q,
267
- {
268
- label: e.name,
269
- placeholder: "Enter phone number",
270
- value: l ?? e.defaultValue ?? "",
271
- onChange: u(e.propertyId)
272
- }
273
- ) }) : e.type === "composite-list" ? /* @__PURE__ */ n(b, { sx: { mb: a ? 0 : 2, width: "100%" }, children: /* @__PURE__ */ n(
274
- ee,
275
- {
276
- property: e,
277
- value: l ?? e.defaultValue ?? "",
278
- variant: c,
279
- size: i,
280
- mapboxAccessToken: m,
281
- onChange: r(e.propertyId)
282
- }
283
- ) }) : /* @__PURE__ */ n(P, {});
284
- }
285
- export {
286
- ee as C,
287
- ne as V
288
- };