@hybridcore/ui 1.4.3 → 1.4.5
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.
- package/dist/components/template-form/components/property-list/index.js +1 -1
- package/dist/components/template-form/components/property-list/property-list-form.js +1 -1
- package/dist/components/template-form/index.js +68 -69
- package/dist/main.d.ts +1 -0
- package/dist/{property-list-form-BfP9gzSo.js → property-list-form-D-SW5H_I.js} +99 -99
- package/package.json +1 -1
|
@@ -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-
|
|
5
|
+
import { a as c } from "../../../../property-list-form-D-SW5H_I.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-
|
|
4
|
+
import { a as b } from "../../../../property-list-form-D-SW5H_I.js";
|
|
5
5
|
import "../../../../constants/index.js";
|
|
6
6
|
import "../../../../TextField-D87qTh1k.js";
|
|
7
7
|
import "../../../../InputLabel-CWkW8NtU.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
|
3
3
|
import k from "lodash";
|
|
4
4
|
import { useForm as P, Controller as l } from "react-hook-form";
|
|
@@ -6,27 +6,26 @@ import O from "./components/property-list/index.js";
|
|
|
6
6
|
import j from "./components/recognition-property-list/index.js";
|
|
7
7
|
import { CatalogueInstanceSelector as K } from "./components/catalogue-instance-selector/index.js";
|
|
8
8
|
import { getNestedChildrenFromMap as L } from "../../utils/ontology.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import B from "./components/select-icon/index.js";
|
|
9
|
+
import { TreeSelect as _ } from "../tree-select/index.js";
|
|
10
|
+
import { FormLabel as w, Button as b } from "@mui/material";
|
|
11
|
+
import A from "./components/select-icon/index.js";
|
|
13
12
|
import { T as m } from "../../TextField-D87qTh1k.js";
|
|
14
|
-
import { F as g } from "../../property-list-form-
|
|
13
|
+
import { F as g } from "../../property-list-form-D-SW5H_I.js";
|
|
15
14
|
import { F as d } from "../../FormControlLabel-D9KFjcIx.js";
|
|
16
15
|
import { C as c } from "../../Checkbox-qy3cjvnb.js";
|
|
17
|
-
import { B as
|
|
18
|
-
function
|
|
16
|
+
import { B as p } from "../../Box-BPyg-Ybm.js";
|
|
17
|
+
function B(e, x) {
|
|
19
18
|
const {
|
|
20
19
|
register: s,
|
|
21
20
|
handleSubmit: T,
|
|
22
21
|
control: i,
|
|
23
|
-
formState: { errors:
|
|
22
|
+
formState: { errors: v },
|
|
24
23
|
getValues: h,
|
|
25
|
-
reset:
|
|
24
|
+
reset: C
|
|
26
25
|
} = P({
|
|
27
26
|
defaultValues: e.defaultValues
|
|
28
|
-
}), [V, F] = f.useState([]), I = (
|
|
29
|
-
const a = new Map(
|
|
27
|
+
}), [V, F] = f.useState([]), I = (t) => {
|
|
28
|
+
const a = new Map(t);
|
|
30
29
|
for (const [r, o] of a)
|
|
31
30
|
a.set(r, {
|
|
32
31
|
...o,
|
|
@@ -36,8 +35,8 @@ function D(e, x) {
|
|
|
36
35
|
});
|
|
37
36
|
return L(a);
|
|
38
37
|
}, S = () => {
|
|
39
|
-
const
|
|
40
|
-
F(
|
|
38
|
+
const t = I(e.mappedTemplates);
|
|
39
|
+
F(t);
|
|
41
40
|
}, M = () => {
|
|
42
41
|
if (e.onCancel) {
|
|
43
42
|
e.onCancel();
|
|
@@ -46,15 +45,15 @@ function D(e, x) {
|
|
|
46
45
|
};
|
|
47
46
|
return f.useImperativeHandle(x, () => ({
|
|
48
47
|
resetForm() {
|
|
49
|
-
|
|
48
|
+
C();
|
|
50
49
|
}
|
|
51
50
|
})), f.useEffect(() => (S(), () => {
|
|
52
|
-
}), [e.mappedTemplates]), /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
e.onSubmit(
|
|
51
|
+
}), [e.mappedTemplates]), /* @__PURE__ */ u("form", { onSubmit: (t, a) => {
|
|
52
|
+
t == null || t.preventDefault(), T(((o) => (y) => {
|
|
53
|
+
e.onSubmit(y, o);
|
|
55
54
|
})(a))();
|
|
56
55
|
}, children: [
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ n(
|
|
58
57
|
m,
|
|
59
58
|
{
|
|
60
59
|
label: "Name *",
|
|
@@ -62,13 +61,13 @@ function D(e, x) {
|
|
|
62
61
|
fullWidth: !0,
|
|
63
62
|
sx: { mb: 2 },
|
|
64
63
|
...s("name", { required: !0 }),
|
|
65
|
-
...
|
|
64
|
+
...v.name && {
|
|
66
65
|
helperText: "This field is required!",
|
|
67
66
|
error: !0
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ n(
|
|
72
71
|
m,
|
|
73
72
|
{
|
|
74
73
|
label: "Template Key",
|
|
@@ -79,7 +78,7 @@ function D(e, x) {
|
|
|
79
78
|
...s("templateKey")
|
|
80
79
|
}
|
|
81
80
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ n(
|
|
83
82
|
m,
|
|
84
83
|
{
|
|
85
84
|
label: "Description",
|
|
@@ -89,7 +88,7 @@ function D(e, x) {
|
|
|
89
88
|
...s("description")
|
|
90
89
|
}
|
|
91
90
|
),
|
|
92
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ n(
|
|
93
92
|
m,
|
|
94
93
|
{
|
|
95
94
|
label: "Version",
|
|
@@ -99,15 +98,15 @@ function D(e, x) {
|
|
|
99
98
|
...s("version")
|
|
100
99
|
}
|
|
101
100
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ n(g, { sx: { mb: 2 }, children: /* @__PURE__ */ n(
|
|
103
102
|
l,
|
|
104
103
|
{
|
|
105
104
|
name: "parent",
|
|
106
105
|
control: i,
|
|
107
|
-
render: ({ field: { value:
|
|
106
|
+
render: ({ field: { value: t, onChange: a } }) => {
|
|
108
107
|
if (e.disableParent) {
|
|
109
|
-
const r =
|
|
110
|
-
return /* @__PURE__ */
|
|
108
|
+
const r = t ? e.mappedTemplates.get(t) : void 0;
|
|
109
|
+
return /* @__PURE__ */ n(
|
|
111
110
|
m,
|
|
112
111
|
{
|
|
113
112
|
label: "Parent",
|
|
@@ -118,13 +117,13 @@ function D(e, x) {
|
|
|
118
117
|
}
|
|
119
118
|
);
|
|
120
119
|
}
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
|
|
120
|
+
return /* @__PURE__ */ n(
|
|
121
|
+
_,
|
|
123
122
|
{
|
|
124
123
|
label: "Parent",
|
|
125
124
|
idKey: "templateKey",
|
|
126
125
|
data: V,
|
|
127
|
-
selected:
|
|
126
|
+
selected: t ? [t] : "",
|
|
128
127
|
onChange: (r, o) => {
|
|
129
128
|
a({
|
|
130
129
|
target: {
|
|
@@ -137,12 +136,12 @@ function D(e, x) {
|
|
|
137
136
|
}
|
|
138
137
|
}
|
|
139
138
|
) }),
|
|
140
|
-
"agentReferenceIds" in e.defaultValues && /* @__PURE__ */
|
|
139
|
+
"agentReferenceIds" in e.defaultValues && /* @__PURE__ */ n(
|
|
141
140
|
l,
|
|
142
141
|
{
|
|
143
142
|
name: "agentReferenceIds",
|
|
144
143
|
control: i,
|
|
145
|
-
render: ({ field: { onChange:
|
|
144
|
+
render: ({ field: { onChange: t } }) => /* @__PURE__ */ n(
|
|
146
145
|
K,
|
|
147
146
|
{
|
|
148
147
|
templates: e.agentTemplates ?? /* @__PURE__ */ new Map(),
|
|
@@ -150,7 +149,7 @@ function D(e, x) {
|
|
|
150
149
|
inputVariant: e.inputVariant,
|
|
151
150
|
selectedInstances: e.selectedAgentInstances,
|
|
152
151
|
onSelect: (a) => {
|
|
153
|
-
|
|
152
|
+
t({
|
|
154
153
|
target: {
|
|
155
154
|
value: a
|
|
156
155
|
}
|
|
@@ -172,71 +171,71 @@ function D(e, x) {
|
|
|
172
171
|
}
|
|
173
172
|
),
|
|
174
173
|
/* @__PURE__ */ u(g, { row: !0, sx: { mb: 2 }, children: [
|
|
175
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ n(
|
|
176
175
|
d,
|
|
177
176
|
{
|
|
178
|
-
control: /* @__PURE__ */
|
|
177
|
+
control: /* @__PURE__ */ n(
|
|
179
178
|
l,
|
|
180
179
|
{
|
|
181
180
|
name: "creatable",
|
|
182
181
|
control: i,
|
|
183
|
-
render: ({ field: { value:
|
|
182
|
+
render: ({ field: { value: t, ...a } }) => /* @__PURE__ */ n(c, { checked: t, ...a })
|
|
184
183
|
}
|
|
185
184
|
),
|
|
186
185
|
label: "Creatable"
|
|
187
186
|
}
|
|
188
187
|
),
|
|
189
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ n(
|
|
190
189
|
d,
|
|
191
190
|
{
|
|
192
|
-
control: /* @__PURE__ */
|
|
191
|
+
control: /* @__PURE__ */ n(
|
|
193
192
|
l,
|
|
194
193
|
{
|
|
195
194
|
name: "editable",
|
|
196
195
|
control: i,
|
|
197
|
-
render: ({ field: { value:
|
|
196
|
+
render: ({ field: { value: t, ...a } }) => /* @__PURE__ */ n(c, { checked: t, ...a })
|
|
198
197
|
}
|
|
199
198
|
),
|
|
200
199
|
label: "Editable"
|
|
201
200
|
}
|
|
202
201
|
),
|
|
203
|
-
"stationary" in e.defaultValues && /* @__PURE__ */
|
|
202
|
+
"stationary" in e.defaultValues && /* @__PURE__ */ n(
|
|
204
203
|
d,
|
|
205
204
|
{
|
|
206
|
-
control: /* @__PURE__ */
|
|
205
|
+
control: /* @__PURE__ */ n(
|
|
207
206
|
l,
|
|
208
207
|
{
|
|
209
208
|
name: "stationary",
|
|
210
209
|
control: i,
|
|
211
|
-
render: ({ field: { value:
|
|
210
|
+
render: ({ field: { value: t, ...a } }) => /* @__PURE__ */ n(c, { checked: t, ...a })
|
|
212
211
|
}
|
|
213
212
|
),
|
|
214
213
|
label: "Stationary"
|
|
215
214
|
}
|
|
216
215
|
),
|
|
217
|
-
"livingObject" in e.defaultValues && /* @__PURE__ */
|
|
216
|
+
"livingObject" in e.defaultValues && /* @__PURE__ */ n(
|
|
218
217
|
d,
|
|
219
218
|
{
|
|
220
|
-
control: /* @__PURE__ */
|
|
219
|
+
control: /* @__PURE__ */ n(
|
|
221
220
|
l,
|
|
222
221
|
{
|
|
223
222
|
name: "livingObject",
|
|
224
223
|
control: i,
|
|
225
|
-
render: ({ field: { value:
|
|
224
|
+
render: ({ field: { value: t, ...a } }) => /* @__PURE__ */ n(c, { checked: t, ...a })
|
|
226
225
|
}
|
|
227
226
|
),
|
|
228
227
|
label: "Living Object"
|
|
229
228
|
}
|
|
230
229
|
),
|
|
231
|
-
"storeFile" in e.defaultValues && /* @__PURE__ */
|
|
230
|
+
"storeFile" in e.defaultValues && /* @__PURE__ */ n(
|
|
232
231
|
d,
|
|
233
232
|
{
|
|
234
|
-
control: /* @__PURE__ */
|
|
233
|
+
control: /* @__PURE__ */ n(
|
|
235
234
|
l,
|
|
236
235
|
{
|
|
237
236
|
name: "storeFile",
|
|
238
237
|
control: i,
|
|
239
|
-
render: ({ field: { value:
|
|
238
|
+
render: ({ field: { value: t, ...a } }) => /* @__PURE__ */ n(c, { checked: t, ...a })
|
|
240
239
|
}
|
|
241
240
|
),
|
|
242
241
|
label: "Store File"
|
|
@@ -244,17 +243,17 @@ function D(e, x) {
|
|
|
244
243
|
)
|
|
245
244
|
] }),
|
|
246
245
|
/* @__PURE__ */ u(g, { children: [
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ n(w, { children: "Icon" }),
|
|
247
|
+
/* @__PURE__ */ n(
|
|
249
248
|
l,
|
|
250
249
|
{
|
|
251
250
|
name: "icon",
|
|
252
251
|
control: i,
|
|
253
|
-
render: ({ field: { value:
|
|
254
|
-
|
|
252
|
+
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
253
|
+
A,
|
|
255
254
|
{
|
|
256
255
|
list: [],
|
|
257
|
-
value:
|
|
256
|
+
value: t ?? "",
|
|
258
257
|
newIcon: "",
|
|
259
258
|
onFileUpload: () => {
|
|
260
259
|
},
|
|
@@ -264,15 +263,15 @@ function D(e, x) {
|
|
|
264
263
|
}
|
|
265
264
|
)
|
|
266
265
|
] }),
|
|
267
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ n(
|
|
268
267
|
l,
|
|
269
268
|
{
|
|
270
269
|
name: "properties",
|
|
271
270
|
control: i,
|
|
272
|
-
render: ({ field: { value:
|
|
271
|
+
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
273
272
|
O,
|
|
274
273
|
{
|
|
275
|
-
list:
|
|
274
|
+
list: t || [],
|
|
276
275
|
inputVariant: e.inputVariant,
|
|
277
276
|
templateId: k.get(e.defaultValues, "id"),
|
|
278
277
|
disablePropertyId: e.disablePropertyId,
|
|
@@ -281,23 +280,23 @@ function D(e, x) {
|
|
|
281
280
|
)
|
|
282
281
|
}
|
|
283
282
|
),
|
|
284
|
-
"recognitionPropertyList" in e.defaultValues && /* @__PURE__ */
|
|
283
|
+
"recognitionPropertyList" in e.defaultValues && /* @__PURE__ */ n(
|
|
285
284
|
l,
|
|
286
285
|
{
|
|
287
286
|
name: "recognitionPropertyList",
|
|
288
287
|
control: i,
|
|
289
|
-
render: ({ field: { value:
|
|
288
|
+
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
290
289
|
j,
|
|
291
290
|
{
|
|
292
|
-
list:
|
|
291
|
+
list: t || [],
|
|
293
292
|
getFormValues: h,
|
|
294
293
|
onChange: a
|
|
295
294
|
}
|
|
296
295
|
)
|
|
297
296
|
}
|
|
298
297
|
),
|
|
299
|
-
/* @__PURE__ */ u(
|
|
300
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ u(p, { display: "flex", justifyContent: "space-between", mt: 3, children: [
|
|
299
|
+
/* @__PURE__ */ n(
|
|
301
300
|
b,
|
|
302
301
|
{
|
|
303
302
|
color: "primary",
|
|
@@ -308,20 +307,20 @@ function D(e, x) {
|
|
|
308
307
|
children: "Cancel"
|
|
309
308
|
}
|
|
310
309
|
),
|
|
311
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ n(p, { children: e.saveButtons ? e.saveButtons.map((t, a) => /* @__PURE__ */ n(
|
|
312
311
|
b,
|
|
313
312
|
{
|
|
314
313
|
type: "submit",
|
|
315
314
|
color: "primary",
|
|
316
315
|
variant: "contained",
|
|
317
316
|
disabled: e.loading,
|
|
318
|
-
startIcon:
|
|
317
|
+
startIcon: t.icon,
|
|
319
318
|
sx: { ml: 1, textTransform: "none" },
|
|
320
|
-
onClick:
|
|
321
|
-
children:
|
|
319
|
+
onClick: t.onClick,
|
|
320
|
+
children: t.label
|
|
322
321
|
},
|
|
323
322
|
a
|
|
324
|
-
)) : /* @__PURE__ */
|
|
323
|
+
)) : /* @__PURE__ */ n(
|
|
325
324
|
b,
|
|
326
325
|
{
|
|
327
326
|
type: "submit",
|
|
@@ -333,9 +332,9 @@ function D(e, x) {
|
|
|
333
332
|
}
|
|
334
333
|
) })
|
|
335
334
|
] })
|
|
336
|
-
] })
|
|
335
|
+
] });
|
|
337
336
|
}
|
|
338
|
-
const
|
|
337
|
+
const te = f.forwardRef(B);
|
|
339
338
|
export {
|
|
340
|
-
|
|
339
|
+
te as TemplateForm
|
|
341
340
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import K, { jsx as t, jsxs as c, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import * as Q from "react";
|
|
3
3
|
import F from "react";
|
|
4
|
-
import
|
|
5
|
-
import { r as
|
|
6
|
-
import { DATA_TYPES as R, COORDINATE_FORMAT as
|
|
7
|
-
import { T as
|
|
8
|
-
import { f as
|
|
4
|
+
import X from "lodash";
|
|
5
|
+
import { r as Z, i as ee } from "./createSvgIcon-Cfm1LkEe.js";
|
|
6
|
+
import { DATA_TYPES as R, COORDINATE_FORMAT as te, PRIVACY_PRESERVATION_METHOD as Y } from "./constants/index.js";
|
|
7
|
+
import { T as b } from "./TextField-D87qTh1k.js";
|
|
8
|
+
import { f as re, F as w, I as C } from "./InputLabel-CWkW8NtU.js";
|
|
9
9
|
import { S as P } from "./Select-ClaBvSqf.js";
|
|
10
10
|
import { M as _ } from "./MenuItem-D-INSvZa.js";
|
|
11
|
-
import { _ as M, a as
|
|
11
|
+
import { _ as M, a as ae } from "./objectWithoutPropertiesLoose-BK36oJDi.js";
|
|
12
12
|
import { P as n } from "./createStyled-BzvgQjjR.js";
|
|
13
|
-
import { g as
|
|
14
|
-
import { g as
|
|
15
|
-
import { u as
|
|
16
|
-
import { F as
|
|
17
|
-
import { C as
|
|
18
|
-
import { B as
|
|
19
|
-
import { B as
|
|
20
|
-
function
|
|
21
|
-
return
|
|
13
|
+
import { g as oe, u as le, c as ne, a as ie } from "./useThemeProps-uYx_RkOH.js";
|
|
14
|
+
import { g as se, s as de } from "./styled-LNCprp4n.js";
|
|
15
|
+
import { u as me } from "./useFormControl-CatNKXAi.js";
|
|
16
|
+
import { F as f } from "./FormControlLabel-D9KFjcIx.js";
|
|
17
|
+
import { C as y } from "./Checkbox-qy3cjvnb.js";
|
|
18
|
+
import { B as ce } from "./Box-BPyg-Ybm.js";
|
|
19
|
+
import { B as $ } from "./Button-DLwB_sKd.js";
|
|
20
|
+
function ue(a) {
|
|
21
|
+
return se("MuiFormGroup", a);
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
const
|
|
23
|
+
oe("MuiFormGroup", ["root", "row", "error"]);
|
|
24
|
+
const pe = ["className", "row"], fe = (a) => {
|
|
25
25
|
const {
|
|
26
|
-
classes:
|
|
27
|
-
row:
|
|
28
|
-
error:
|
|
26
|
+
classes: i,
|
|
27
|
+
row: m,
|
|
28
|
+
error: s
|
|
29
29
|
} = a;
|
|
30
|
-
return
|
|
31
|
-
root: ["root",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
30
|
+
return ie({
|
|
31
|
+
root: ["root", m && "row", s && "error"]
|
|
32
|
+
}, ue, i);
|
|
33
|
+
}, ye = de("div", {
|
|
34
34
|
name: "MuiFormGroup",
|
|
35
35
|
slot: "Root",
|
|
36
|
-
overridesResolver: (a,
|
|
36
|
+
overridesResolver: (a, i) => {
|
|
37
37
|
const {
|
|
38
|
-
ownerState:
|
|
38
|
+
ownerState: m
|
|
39
39
|
} = a;
|
|
40
|
-
return [
|
|
40
|
+
return [i.root, m.row && i.row];
|
|
41
41
|
}
|
|
42
42
|
})(({
|
|
43
43
|
ownerState: a
|
|
@@ -47,28 +47,28 @@ const se = ["className", "row"], ie = (a) => {
|
|
|
47
47
|
flexWrap: "wrap"
|
|
48
48
|
}, a.row && {
|
|
49
49
|
flexDirection: "row"
|
|
50
|
-
})),
|
|
51
|
-
const
|
|
52
|
-
props:
|
|
50
|
+
})), z = /* @__PURE__ */ Q.forwardRef(function(i, m) {
|
|
51
|
+
const s = le({
|
|
52
|
+
props: i,
|
|
53
53
|
name: "MuiFormGroup"
|
|
54
54
|
}), {
|
|
55
|
-
className:
|
|
55
|
+
className: v,
|
|
56
56
|
row: e = !1
|
|
57
|
-
} =
|
|
58
|
-
props:
|
|
59
|
-
muiFormControl:
|
|
57
|
+
} = s, h = ae(s, pe), u = me(), T = re({
|
|
58
|
+
props: s,
|
|
59
|
+
muiFormControl: u,
|
|
60
60
|
states: ["error"]
|
|
61
|
-
}), o = M({},
|
|
61
|
+
}), o = M({}, s, {
|
|
62
62
|
row: e,
|
|
63
|
-
error:
|
|
64
|
-
}), g =
|
|
65
|
-
return /* @__PURE__ */ t(
|
|
66
|
-
className:
|
|
63
|
+
error: T.error
|
|
64
|
+
}), g = fe(o);
|
|
65
|
+
return /* @__PURE__ */ t(ye, M({
|
|
66
|
+
className: ne(g.root, v),
|
|
67
67
|
ownerState: o,
|
|
68
|
-
ref:
|
|
68
|
+
ref: m
|
|
69
69
|
}, h));
|
|
70
70
|
});
|
|
71
|
-
process.env.NODE_ENV !== "production" && (
|
|
71
|
+
process.env.NODE_ENV !== "production" && (z.propTypes = {
|
|
72
72
|
// ----------------------------- Warning --------------------------------
|
|
73
73
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
74
74
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -95,23 +95,23 @@ process.env.NODE_ENV !== "production" && (U.propTypes = {
|
|
|
95
95
|
*/
|
|
96
96
|
sx: n.oneOfType([n.arrayOf(n.oneOfType([n.func, n.object, n.bool])), n.func, n.object])
|
|
97
97
|
});
|
|
98
|
-
var q = {},
|
|
98
|
+
var q = {}, he = ee;
|
|
99
99
|
Object.defineProperty(q, "__esModule", {
|
|
100
100
|
value: !0
|
|
101
101
|
});
|
|
102
|
-
var
|
|
103
|
-
|
|
102
|
+
var H = q.default = void 0, be = he(Z()), ve = K;
|
|
103
|
+
H = q.default = (0, be.default)(/* @__PURE__ */ (0, ve.jsx)("path", {
|
|
104
104
|
d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
|
|
105
105
|
}), "Check");
|
|
106
|
-
function
|
|
106
|
+
function We({
|
|
107
107
|
inputVariant: a,
|
|
108
|
-
defaultValues:
|
|
108
|
+
defaultValues: i = {
|
|
109
109
|
name: "",
|
|
110
110
|
propertyId: "",
|
|
111
111
|
type: R[0],
|
|
112
112
|
dataTypeInfo: {},
|
|
113
113
|
defaultValue: "",
|
|
114
|
-
privacyPreservationMethod:
|
|
114
|
+
privacyPreservationMethod: Y[0],
|
|
115
115
|
required: !1,
|
|
116
116
|
visible: !1,
|
|
117
117
|
editable: !1,
|
|
@@ -119,46 +119,46 @@ function De({
|
|
|
119
119
|
temporal: !1,
|
|
120
120
|
unique: !1
|
|
121
121
|
},
|
|
122
|
-
disablePropertyId:
|
|
123
|
-
onSubmit:
|
|
124
|
-
onCancel:
|
|
122
|
+
disablePropertyId: m,
|
|
123
|
+
onSubmit: s,
|
|
124
|
+
onCancel: v
|
|
125
125
|
}) {
|
|
126
|
-
var D, k, E, S,
|
|
127
|
-
const [e, h] = F.useState(
|
|
126
|
+
var D, k, E, S, j, O, W, N, G, V, A, U, B, L;
|
|
127
|
+
const [e, h] = F.useState(i), [u, T] = F.useState({
|
|
128
128
|
name: !1
|
|
129
129
|
}), o = (r) => {
|
|
130
|
-
var
|
|
130
|
+
var x, I;
|
|
131
131
|
const l = r.target.name;
|
|
132
|
-
let
|
|
133
|
-
if (
|
|
134
|
-
let
|
|
135
|
-
|
|
132
|
+
let d = r.target.type === "checkbox" ? r.target.checked : r.target.value;
|
|
133
|
+
if (e.type === "enum" && l === "dataTypeInfo.enumValues" && (d = d.split(",")), ((I = (x = e.dataTypeInfo) == null ? void 0 : x.innerType) == null ? void 0 : I.type) === "enum" && l === "dataTypeInfo.innerType.enumValues" && (d = d.split(",").map((p) => p.trim())), l.includes(".")) {
|
|
134
|
+
let p = { ...e };
|
|
135
|
+
X.set(p, l, d), h(p);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
h((
|
|
139
|
-
...
|
|
140
|
-
[l]:
|
|
138
|
+
h((p) => ({
|
|
139
|
+
...p,
|
|
140
|
+
[l]: d
|
|
141
141
|
}));
|
|
142
142
|
}, g = () => {
|
|
143
143
|
if (!e.name) {
|
|
144
|
-
|
|
144
|
+
T({ ...u, name: !0 });
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
s(e);
|
|
148
148
|
};
|
|
149
|
-
return F.useEffect(() => (
|
|
149
|
+
return F.useEffect(() => (u.name && e.name && T({ ...u, name: !1 }), () => {
|
|
150
150
|
}), [e.name]), F.useEffect(() => {
|
|
151
151
|
if (!["date", "coordinate", "composite-list", "enum"].includes(e.type)) {
|
|
152
152
|
if (e.dataTypeInfo) {
|
|
153
|
-
const { coordinateFormat: r, datePattern: l, innerType:
|
|
154
|
-
(r || l ||
|
|
153
|
+
const { coordinateFormat: r, datePattern: l, innerType: d, enumValues: x } = e.dataTypeInfo;
|
|
154
|
+
(r || l || d || x) && h((I) => ({ ...I, dataTypeInfo: {} }));
|
|
155
155
|
}
|
|
156
156
|
return () => {
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
}, [e.type]), /* @__PURE__ */ c(
|
|
159
|
+
}, [e.type]), /* @__PURE__ */ c(J, { children: [
|
|
160
160
|
/* @__PURE__ */ t(
|
|
161
|
-
|
|
161
|
+
b,
|
|
162
162
|
{
|
|
163
163
|
label: "Name",
|
|
164
164
|
name: "name",
|
|
@@ -168,20 +168,20 @@ function De({
|
|
|
168
168
|
value: e.name,
|
|
169
169
|
onChange: o,
|
|
170
170
|
required: !0,
|
|
171
|
-
...
|
|
171
|
+
...u.name && {
|
|
172
172
|
error: !0,
|
|
173
173
|
helperText: "This field is required!"
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
177
|
/* @__PURE__ */ t(
|
|
178
|
-
|
|
178
|
+
b,
|
|
179
179
|
{
|
|
180
180
|
label: "Property ID",
|
|
181
181
|
name: "propertyId",
|
|
182
182
|
variant: a,
|
|
183
183
|
fullWidth: !0,
|
|
184
|
-
disabled:
|
|
184
|
+
disabled: m,
|
|
185
185
|
sx: { mb: 2 },
|
|
186
186
|
value: e.propertyId,
|
|
187
187
|
onChange: o
|
|
@@ -203,7 +203,7 @@ function De({
|
|
|
203
203
|
)
|
|
204
204
|
] }),
|
|
205
205
|
e.type === "date" && /* @__PURE__ */ t(
|
|
206
|
-
|
|
206
|
+
b,
|
|
207
207
|
{
|
|
208
208
|
label: "Date Format",
|
|
209
209
|
name: "dataTypeInfo.datePattern",
|
|
@@ -225,7 +225,7 @@ function De({
|
|
|
225
225
|
id: "coordinate-format-select",
|
|
226
226
|
value: (k = e.dataTypeInfo) == null ? void 0 : k.coordinateFormat,
|
|
227
227
|
onChange: o,
|
|
228
|
-
children:
|
|
228
|
+
children: te.map((r, l) => /* @__PURE__ */ t(_, { value: r, children: r }, l))
|
|
229
229
|
}
|
|
230
230
|
)
|
|
231
231
|
] }),
|
|
@@ -246,21 +246,21 @@ function De({
|
|
|
246
246
|
}
|
|
247
247
|
)
|
|
248
248
|
] }),
|
|
249
|
-
(e.type === "enum" || ((
|
|
250
|
-
|
|
249
|
+
(e.type === "enum" || ((O = (j = e.dataTypeInfo) == null ? void 0 : j.innerType) == null ? void 0 : O.type) === "enum") && /* @__PURE__ */ t(
|
|
250
|
+
b,
|
|
251
251
|
{
|
|
252
252
|
label: "Enum Values",
|
|
253
|
-
name: "dataTypeInfo.enumValues",
|
|
253
|
+
name: ((N = (W = e.dataTypeInfo) == null ? void 0 : W.innerType) == null ? void 0 : N.type) === "enum" ? "dataTypeInfo.innerType.enumValues" : "dataTypeInfo.enumValues",
|
|
254
254
|
variant: a,
|
|
255
255
|
fullWidth: !0,
|
|
256
256
|
sx: { mb: 2 },
|
|
257
|
-
value: (
|
|
257
|
+
value: ((V = (G = e.dataTypeInfo) == null ? void 0 : G.innerType) == null ? void 0 : V.type) === "enum" ? (U = (A = e.dataTypeInfo.innerType) == null ? void 0 : A.enumValues) == null ? void 0 : U.join(",") : (L = (B = e.dataTypeInfo) == null ? void 0 : B.enumValues) == null ? void 0 : L.join(","),
|
|
258
258
|
onChange: o,
|
|
259
259
|
helperText: "Add list values with the comma (,) separated string"
|
|
260
260
|
}
|
|
261
261
|
),
|
|
262
262
|
/* @__PURE__ */ t(
|
|
263
|
-
|
|
263
|
+
b,
|
|
264
264
|
{
|
|
265
265
|
label: "Default Value",
|
|
266
266
|
name: "defaultValue",
|
|
@@ -282,17 +282,17 @@ function De({
|
|
|
282
282
|
id: "privacy-method",
|
|
283
283
|
value: e.privacyPreservationMethod,
|
|
284
284
|
onChange: o,
|
|
285
|
-
children:
|
|
285
|
+
children: Y.map((r, l) => /* @__PURE__ */ t(_, { value: r, children: r }, l))
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
288
|
] }),
|
|
289
|
-
/* @__PURE__ */ c(
|
|
289
|
+
/* @__PURE__ */ c(z, { row: !0, sx: { mb: 2 }, children: [
|
|
290
290
|
/* @__PURE__ */ t(
|
|
291
|
-
|
|
291
|
+
f,
|
|
292
292
|
{
|
|
293
293
|
label: "Required",
|
|
294
294
|
control: /* @__PURE__ */ t(
|
|
295
|
-
|
|
295
|
+
y,
|
|
296
296
|
{
|
|
297
297
|
name: "required",
|
|
298
298
|
checked: e.required,
|
|
@@ -303,11 +303,11 @@ function De({
|
|
|
303
303
|
}
|
|
304
304
|
),
|
|
305
305
|
/* @__PURE__ */ t(
|
|
306
|
-
|
|
306
|
+
f,
|
|
307
307
|
{
|
|
308
308
|
label: "Editable",
|
|
309
309
|
control: /* @__PURE__ */ t(
|
|
310
|
-
|
|
310
|
+
y,
|
|
311
311
|
{
|
|
312
312
|
name: "editable",
|
|
313
313
|
checked: e.editable,
|
|
@@ -318,11 +318,11 @@ function De({
|
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
320
|
/* @__PURE__ */ t(
|
|
321
|
-
|
|
321
|
+
f,
|
|
322
322
|
{
|
|
323
323
|
label: "Visible",
|
|
324
324
|
control: /* @__PURE__ */ t(
|
|
325
|
-
|
|
325
|
+
y,
|
|
326
326
|
{
|
|
327
327
|
name: "visible",
|
|
328
328
|
checked: e.visible,
|
|
@@ -333,19 +333,19 @@ function De({
|
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
335
|
/* @__PURE__ */ t(
|
|
336
|
-
|
|
336
|
+
f,
|
|
337
337
|
{
|
|
338
338
|
label: "Unique",
|
|
339
|
-
control: /* @__PURE__ */ t(
|
|
339
|
+
control: /* @__PURE__ */ t(y, { name: "unique", checked: e.unique, onChange: o }),
|
|
340
340
|
sx: { width: "30%" }
|
|
341
341
|
}
|
|
342
342
|
),
|
|
343
343
|
/* @__PURE__ */ t(
|
|
344
|
-
|
|
344
|
+
f,
|
|
345
345
|
{
|
|
346
346
|
label: "Distinctive",
|
|
347
347
|
control: /* @__PURE__ */ t(
|
|
348
|
-
|
|
348
|
+
y,
|
|
349
349
|
{
|
|
350
350
|
name: "distinctive",
|
|
351
351
|
checked: e.distinctive,
|
|
@@ -356,11 +356,11 @@ function De({
|
|
|
356
356
|
}
|
|
357
357
|
),
|
|
358
358
|
/* @__PURE__ */ t(
|
|
359
|
-
|
|
359
|
+
f,
|
|
360
360
|
{
|
|
361
361
|
label: "Temporal",
|
|
362
362
|
control: /* @__PURE__ */ t(
|
|
363
|
-
|
|
363
|
+
y,
|
|
364
364
|
{
|
|
365
365
|
name: "temporal",
|
|
366
366
|
checked: e.temporal,
|
|
@@ -371,13 +371,13 @@ function De({
|
|
|
371
371
|
}
|
|
372
372
|
)
|
|
373
373
|
] }),
|
|
374
|
-
/* @__PURE__ */ c(
|
|
375
|
-
/* @__PURE__ */ t(
|
|
374
|
+
/* @__PURE__ */ c(ce, { display: "flex", justifyContent: "flex-end", children: [
|
|
375
|
+
/* @__PURE__ */ t($, { variant: "contained", onClick: v, sx: { marginRight: 2 }, children: "Cancel" }),
|
|
376
376
|
/* @__PURE__ */ t(
|
|
377
|
-
|
|
377
|
+
$,
|
|
378
378
|
{
|
|
379
379
|
variant: "contained",
|
|
380
|
-
startIcon: /* @__PURE__ */ t(
|
|
380
|
+
startIcon: /* @__PURE__ */ t(H, {}),
|
|
381
381
|
onClick: g,
|
|
382
382
|
children: "OK"
|
|
383
383
|
}
|
|
@@ -386,6 +386,6 @@ function De({
|
|
|
386
386
|
] });
|
|
387
387
|
}
|
|
388
388
|
export {
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
z as F,
|
|
390
|
+
We as a
|
|
391
391
|
};
|