@hybridcore/ui 1.4.4 → 1.4.6
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 +1 -1
- package/dist/components/template-property-filters/index.js +19 -16
- package/dist/components/template-property-filters/property.js +87 -86
- package/dist/main.d.ts +2 -0
- package/dist/{property-list-form-BfP9gzSo.js → property-list-form-B1GZ9ZGO.js} +84 -84
- 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-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-
|
|
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-
|
|
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
|
|
1
|
+
import { jsx as s, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import a from "lodash";
|
|
3
|
-
import { CollapsibleCard as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
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
|
-
|
|
8
|
+
inputVariant: m,
|
|
9
|
+
onChange: h
|
|
9
10
|
}) => {
|
|
10
|
-
const
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
39
|
+
u,
|
|
39
40
|
{
|
|
40
41
|
property: e,
|
|
41
42
|
value: i,
|
|
42
43
|
size: "small",
|
|
43
|
-
|
|
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
|
-
|
|
54
|
+
v,
|
|
53
55
|
{
|
|
54
56
|
header: e == null ? void 0 : e.name,
|
|
55
|
-
content: /* @__PURE__ */ s(
|
|
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
|
-
(
|
|
60
|
+
(g) => g.fieldName === l.propertyId
|
|
59
61
|
);
|
|
60
62
|
return o && (n = o.value), /* @__PURE__ */ s(
|
|
61
|
-
|
|
63
|
+
u,
|
|
62
64
|
{
|
|
63
65
|
property: l,
|
|
64
66
|
value: n,
|
|
65
67
|
size: "small",
|
|
66
|
-
|
|
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
|
-
|
|
80
|
+
N as TemplatePropertyFilters
|
|
78
81
|
};
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { RadioButtonUnchecked as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { DatePicker as
|
|
7
|
-
import { T as
|
|
8
|
-
import { B as
|
|
9
|
-
import { F as
|
|
10
|
-
import { C as
|
|
11
|
-
import { F as
|
|
12
|
-
function
|
|
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:
|
|
15
|
-
size:
|
|
16
|
-
|
|
14
|
+
value: l,
|
|
15
|
+
size: s = "medium",
|
|
16
|
+
variant: d,
|
|
17
|
+
onChange: x
|
|
17
18
|
}) {
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
let
|
|
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
|
-
|
|
23
|
-
[n.target.name]:
|
|
23
|
+
a[o] = String(i), x({
|
|
24
|
+
[n.target.name]: a
|
|
24
25
|
});
|
|
25
|
-
},
|
|
26
|
-
var
|
|
27
|
-
const n = { ...
|
|
28
|
-
i ? (n.list || (n.list = []), n.list.push(
|
|
29
|
-
[
|
|
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
|
-
},
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
[e.propertyId]:
|
|
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
|
-
|
|
40
|
+
b,
|
|
40
41
|
{
|
|
41
42
|
label: e.name,
|
|
42
43
|
name: e.propertyId,
|
|
43
|
-
value:
|
|
44
|
-
size:
|
|
45
|
-
onChange:
|
|
46
|
-
variant:
|
|
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__ */
|
|
59
|
+
return /* @__PURE__ */ u(h, { display: "flex", alignItems: "center", mb: 2, children: [
|
|
59
60
|
/* @__PURE__ */ t(
|
|
60
|
-
|
|
61
|
+
b,
|
|
61
62
|
{
|
|
62
63
|
label: `${e.name} (Min)`,
|
|
63
64
|
name: e.propertyId,
|
|
64
|
-
value:
|
|
65
|
-
size:
|
|
66
|
-
onChange:
|
|
67
|
-
variant:
|
|
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(
|
|
77
|
+
/* @__PURE__ */ t(M, { px: 1, children: "-" }),
|
|
77
78
|
/* @__PURE__ */ t(
|
|
78
|
-
|
|
79
|
+
b,
|
|
79
80
|
{
|
|
80
81
|
label: `${e.name} (Max)`,
|
|
81
82
|
name: e.propertyId,
|
|
82
|
-
value:
|
|
83
|
-
size:
|
|
84
|
-
onChange:
|
|
85
|
-
variant:
|
|
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",
|
|
97
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
100
|
+
P,
|
|
100
101
|
{
|
|
101
102
|
label: `${e.name} (Min)`,
|
|
102
|
-
value:
|
|
103
|
+
value: a,
|
|
103
104
|
format: o,
|
|
104
105
|
views: ["year", "month", "day"],
|
|
105
106
|
slotProps: {
|
|
106
107
|
textField: {
|
|
107
|
-
variant:
|
|
108
|
+
variant: d,
|
|
108
109
|
name: e.propertyId,
|
|
109
|
-
size:
|
|
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:
|
|
116
|
+
onChange: p("min")
|
|
116
117
|
}
|
|
117
118
|
),
|
|
118
|
-
/* @__PURE__ */ t(
|
|
119
|
+
/* @__PURE__ */ t(M, { px: 1, children: "-" }),
|
|
119
120
|
/* @__PURE__ */ t(
|
|
120
|
-
|
|
121
|
+
P,
|
|
121
122
|
{
|
|
122
123
|
label: `${e.name} (Max)`,
|
|
123
124
|
value: i,
|
|
124
125
|
format: o,
|
|
125
|
-
minDate:
|
|
126
|
+
minDate: a !== null ? a : void 0,
|
|
126
127
|
views: ["year", "month", "day"],
|
|
127
128
|
slotProps: {
|
|
128
129
|
textField: {
|
|
129
|
-
variant:
|
|
130
|
+
variant: d,
|
|
130
131
|
name: e.propertyId,
|
|
131
|
-
size:
|
|
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:
|
|
138
|
+
onChange: p("max")
|
|
138
139
|
}
|
|
139
140
|
)
|
|
140
141
|
] });
|
|
141
142
|
}
|
|
142
143
|
if (e.type === "boolean")
|
|
143
|
-
return /* @__PURE__ */ t(
|
|
144
|
-
|
|
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
|
-
|
|
149
|
+
w,
|
|
149
150
|
{
|
|
150
|
-
size:
|
|
151
|
+
size: s,
|
|
151
152
|
name: e.propertyId,
|
|
152
|
-
checked: !!
|
|
153
|
-
icon: /* @__PURE__ */ t(
|
|
154
|
-
checkedIcon: /* @__PURE__ */ t(
|
|
155
|
-
onChange:
|
|
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] =
|
|
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 (
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */ t(
|
|
171
|
-
/* @__PURE__ */ t(
|
|
172
|
-
|
|
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:
|
|
175
|
+
label: m,
|
|
175
176
|
control: /* @__PURE__ */ t(
|
|
176
|
-
|
|
177
|
+
w,
|
|
177
178
|
{
|
|
178
179
|
name: e.propertyId,
|
|
179
|
-
value:
|
|
180
|
+
value: m,
|
|
180
181
|
size: "small",
|
|
181
|
-
checked:
|
|
182
|
-
onChange:
|
|
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
|
-
|
|
192
|
+
f
|
|
192
193
|
)) })
|
|
193
194
|
] }),
|
|
194
|
-
i.length >
|
|
195
|
-
|
|
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(
|
|
200
|
-
onClick: () => n((
|
|
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(
|
|
210
|
+
return /* @__PURE__ */ t(T, {});
|
|
210
211
|
}
|
|
211
212
|
export {
|
|
212
|
-
|
|
213
|
+
X as default
|
|
213
214
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -517,6 +517,7 @@ declare interface Props {
|
|
|
517
517
|
declare interface Props_10 {
|
|
518
518
|
values: FV.TemplateFilter[];
|
|
519
519
|
templates: Map<string | number, ONTOLOGY.TemplateType>;
|
|
520
|
+
inputVariant?: "standard" | "outlined" | "filled";
|
|
520
521
|
onChange(values: FV.TemplateFilter[]): void;
|
|
521
522
|
}
|
|
522
523
|
|
|
@@ -1389,6 +1390,7 @@ declare namespace ONTOLOGY {
|
|
|
1389
1390
|
coordinateFormat?: string;
|
|
1390
1391
|
innerType?: {
|
|
1391
1392
|
type: string;
|
|
1393
|
+
enumValues?: string[];
|
|
1392
1394
|
};
|
|
1393
1395
|
enumValues?: string[];
|
|
1394
1396
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import K, { jsx as t, jsxs as m, 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 h } 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
|
|
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 ce } from "./useFormControl-CatNKXAi.js";
|
|
16
16
|
import { F as p } from "./FormControlLabel-D9KFjcIx.js";
|
|
17
17
|
import { C as f } from "./Checkbox-qy3cjvnb.js";
|
|
18
|
-
import { B as
|
|
19
|
-
import { B as
|
|
20
|
-
function
|
|
21
|
-
return
|
|
18
|
+
import { B as me } 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: c,
|
|
28
|
+
error: s
|
|
29
29
|
} = a;
|
|
30
|
-
return
|
|
31
|
-
root: ["root",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
30
|
+
return ie({
|
|
31
|
+
root: ["root", c && "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: c
|
|
39
39
|
} = a;
|
|
40
|
-
return [
|
|
40
|
+
return [i.root, c.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, c) {
|
|
51
|
+
const s = le({
|
|
52
|
+
props: i,
|
|
53
53
|
name: "MuiFormGroup"
|
|
54
54
|
}), {
|
|
55
55
|
className: b,
|
|
56
56
|
row: e = !1
|
|
57
|
-
} =
|
|
58
|
-
props:
|
|
59
|
-
muiFormControl:
|
|
57
|
+
} = s, y = ae(s, pe), u = ce(), v = re({
|
|
58
|
+
props: s,
|
|
59
|
+
muiFormControl: u,
|
|
60
60
|
states: ["error"]
|
|
61
|
-
}), o = M({},
|
|
61
|
+
}), o = M({}, s, {
|
|
62
62
|
row: e,
|
|
63
63
|
error: v.error
|
|
64
|
-
}), g =
|
|
65
|
-
return /* @__PURE__ */ t(
|
|
66
|
-
className:
|
|
64
|
+
}), g = fe(o);
|
|
65
|
+
return /* @__PURE__ */ t(ye, M({
|
|
66
|
+
className: ne(g.root, b),
|
|
67
67
|
ownerState: o,
|
|
68
|
-
ref:
|
|
69
|
-
},
|
|
68
|
+
ref: c
|
|
69
|
+
}, y));
|
|
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:
|
|
122
|
+
disablePropertyId: c,
|
|
123
|
+
onSubmit: s,
|
|
124
124
|
onCancel: b
|
|
125
125
|
}) {
|
|
126
|
-
var D, k, E, S,
|
|
127
|
-
const [e,
|
|
126
|
+
var D, k, E, S, j, O, W, N, G, V, A, U, B, L;
|
|
127
|
+
const [e, y] = F.useState(i), [u, v] = F.useState({
|
|
128
128
|
name: !1
|
|
129
129
|
}), o = (r) => {
|
|
130
130
|
var T, x;
|
|
131
131
|
const l = r.target.name;
|
|
132
|
-
let
|
|
133
|
-
if (
|
|
132
|
+
let d = r.target.type === "checkbox" ? r.target.checked : r.target.value;
|
|
133
|
+
if (e.type === "enum" && l === "dataTypeInfo.enumValues" && (d = d.split(",")), ((x = (T = e.dataTypeInfo) == null ? void 0 : T.innerType) == null ? void 0 : x.type) === "enum" && l === "dataTypeInfo.innerType.enumValues" && (d = d.split(",")), l.includes(".")) {
|
|
134
134
|
let I = { ...e };
|
|
135
|
-
|
|
135
|
+
X.set(I, l, d), y(I);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
y((I) => ({
|
|
139
139
|
...I,
|
|
140
|
-
[l]:
|
|
140
|
+
[l]: d
|
|
141
141
|
}));
|
|
142
142
|
}, g = () => {
|
|
143
143
|
if (!e.name) {
|
|
144
|
-
v({ ...
|
|
144
|
+
v({ ...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 && v({ ...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: T } = e.dataTypeInfo;
|
|
154
|
+
(r || l || d || T) && y((x) => ({ ...x, dataTypeInfo: {} }));
|
|
155
155
|
}
|
|
156
156
|
return () => {
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
}, [e.type]), /* @__PURE__ */
|
|
159
|
+
}, [e.type]), /* @__PURE__ */ m(J, { children: [
|
|
160
160
|
/* @__PURE__ */ t(
|
|
161
|
-
|
|
161
|
+
h,
|
|
162
162
|
{
|
|
163
163
|
label: "Name",
|
|
164
164
|
name: "name",
|
|
@@ -168,26 +168,26 @@ 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
|
+
h,
|
|
179
179
|
{
|
|
180
180
|
label: "Property ID",
|
|
181
181
|
name: "propertyId",
|
|
182
182
|
variant: a,
|
|
183
183
|
fullWidth: !0,
|
|
184
|
-
disabled:
|
|
184
|
+
disabled: c,
|
|
185
185
|
sx: { mb: 2 },
|
|
186
186
|
value: e.propertyId,
|
|
187
187
|
onChange: o
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ m(w, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
|
|
191
191
|
/* @__PURE__ */ t(C, { id: "type-select-label", children: "Type" }),
|
|
192
192
|
/* @__PURE__ */ t(
|
|
193
193
|
P,
|
|
@@ -203,7 +203,7 @@ function De({
|
|
|
203
203
|
)
|
|
204
204
|
] }),
|
|
205
205
|
e.type === "date" && /* @__PURE__ */ t(
|
|
206
|
-
|
|
206
|
+
h,
|
|
207
207
|
{
|
|
208
208
|
label: "Date Format",
|
|
209
209
|
name: "dataTypeInfo.datePattern",
|
|
@@ -214,7 +214,7 @@ function De({
|
|
|
214
214
|
onChange: o
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
|
-
e.type === "coordinate" && /* @__PURE__ */
|
|
217
|
+
e.type === "coordinate" && /* @__PURE__ */ m(w, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
|
|
218
218
|
/* @__PURE__ */ t(C, { id: "coordinate-format-select-label", children: "Cordinate Format" }),
|
|
219
219
|
/* @__PURE__ */ t(
|
|
220
220
|
P,
|
|
@@ -225,11 +225,11 @@ 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
|
] }),
|
|
232
|
-
e.type === "composite-list" && /* @__PURE__ */
|
|
232
|
+
e.type === "composite-list" && /* @__PURE__ */ m(w, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
|
|
233
233
|
/* @__PURE__ */ t(C, { id: "composite-list-select-label", children: "Inner Type" }),
|
|
234
234
|
/* @__PURE__ */ t(
|
|
235
235
|
P,
|
|
@@ -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
|
+
h,
|
|
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
|
+
h,
|
|
264
264
|
{
|
|
265
265
|
label: "Default Value",
|
|
266
266
|
name: "defaultValue",
|
|
@@ -271,7 +271,7 @@ function De({
|
|
|
271
271
|
onChange: o
|
|
272
272
|
}
|
|
273
273
|
),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ m(w, { fullWidth: !0, variant: a, sx: { mb: 2 }, children: [
|
|
275
275
|
/* @__PURE__ */ t(C, { id: "privacy-method-label", children: "Privacy Preservation Method" }),
|
|
276
276
|
/* @__PURE__ */ t(
|
|
277
277
|
P,
|
|
@@ -282,11 +282,11 @@ 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__ */
|
|
289
|
+
/* @__PURE__ */ m(z, { row: !0, sx: { mb: 2 }, children: [
|
|
290
290
|
/* @__PURE__ */ t(
|
|
291
291
|
p,
|
|
292
292
|
{
|
|
@@ -371,13 +371,13 @@ function De({
|
|
|
371
371
|
}
|
|
372
372
|
)
|
|
373
373
|
] }),
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */ t(
|
|
374
|
+
/* @__PURE__ */ m(me, { display: "flex", justifyContent: "flex-end", children: [
|
|
375
|
+
/* @__PURE__ */ t($, { variant: "contained", onClick: b, 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
|
};
|