@hybridcore/ui 1.5.83 → 1.5.85
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,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Box as
|
|
3
|
-
import V from "lodash";
|
|
1
|
+
import { jsx as n, Fragment as V, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { Box as f } from "@mui/material";
|
|
4
3
|
import Y from "dayjs";
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import x from "lodash";
|
|
5
|
+
import { VariableRoot as j, VariableRow as d, VariableTitle as h, VariableValue as m } from "./styled.js";
|
|
6
|
+
const D = [
|
|
7
7
|
"string",
|
|
8
8
|
"boolean",
|
|
9
9
|
"date",
|
|
@@ -15,43 +15,46 @@ const T = [
|
|
|
15
15
|
"list",
|
|
16
16
|
"text",
|
|
17
17
|
"composite-list"
|
|
18
|
-
], i = ({ title: r, value: e }) => /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
] }), s = ({ title: r, value: e }) => /* @__PURE__ */
|
|
18
|
+
], i = ({ title: r, value: e }) => /* @__PURE__ */ a(d, { children: [
|
|
19
|
+
/* @__PURE__ */ n(h, { variant: "subtitle2", children: r }),
|
|
20
|
+
/* @__PURE__ */ n(m, { variant: "body2", children: e })
|
|
21
|
+
] }), s = ({ title: r, value: e }) => /* @__PURE__ */ n(i, { title: r, value: e }), T = ({ title: r, value: e }) => /* @__PURE__ */ n(i, { title: r, value: e ? "Yes" : "No" }), B = ({ title: r, value: e }) => {
|
|
22
22
|
const u = Y(e).format("DD/MM/YYYY");
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
},
|
|
23
|
+
return /* @__PURE__ */ n(i, { title: r, value: u });
|
|
24
|
+
}, g = ({ title: r, value: e }) => {
|
|
25
25
|
const u = (e ?? []).join(", ");
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
}
|
|
28
|
-
|
|
26
|
+
return /* @__PURE__ */ n(i, { title: r, value: u });
|
|
27
|
+
}, E = ({ title: r, value: e }) => /* @__PURE__ */ a(d, { children: [
|
|
28
|
+
/* @__PURE__ */ n(h, { variant: "subtitle2", children: r }),
|
|
29
|
+
/* @__PURE__ */ n(m, { variant: "body2", children: /* @__PURE__ */ n("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: e }) })
|
|
30
|
+
] });
|
|
31
|
+
function R({
|
|
29
32
|
type: r,
|
|
30
33
|
data: e,
|
|
31
34
|
filter: u,
|
|
32
|
-
properties:
|
|
33
|
-
hashPrefix:
|
|
35
|
+
properties: c,
|
|
36
|
+
hashPrefix: v
|
|
34
37
|
}) {
|
|
35
|
-
return r === "geometry" ? /* @__PURE__ */
|
|
36
|
-
const t =
|
|
38
|
+
return r === "geometry" ? /* @__PURE__ */ n(V, {}) : /* @__PURE__ */ n(j, { children: x.keys(e).filter((l) => {
|
|
39
|
+
const t = c.get(v + l);
|
|
37
40
|
return t && !t.visible ? !1 : u === void 0 || u === "" || l.includes(u);
|
|
38
41
|
}).map((l, t) => {
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
-
r === "string" && /* @__PURE__ */ o(s, { title:
|
|
42
|
-
r === "boolean" && /* @__PURE__ */
|
|
43
|
-
r === "date" && /* @__PURE__ */
|
|
44
|
-
r === "byte" && /* @__PURE__ */
|
|
45
|
-
r === "double" && /* @__PURE__ */
|
|
46
|
-
r === "integer" && /* @__PURE__ */
|
|
47
|
-
r === "long" && /* @__PURE__ */
|
|
48
|
-
r === "enum" && /* @__PURE__ */
|
|
49
|
-
r === "list" && /* @__PURE__ */
|
|
50
|
-
r === "text" && /* @__PURE__ */
|
|
51
|
-
r === "composite-list" && /* @__PURE__ */
|
|
52
|
-
] }, t) : /* @__PURE__ */
|
|
42
|
+
const b = c.get(v + l), o = b ? b.name : "";
|
|
43
|
+
return D.includes(r) ? /* @__PURE__ */ a(f, { mb: 1, className: "variable", children: [
|
|
44
|
+
r === "string" && l === "url" ? /* @__PURE__ */ n(E, { title: o, value: e[l] }) : r === "string" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
45
|
+
r === "boolean" && /* @__PURE__ */ n(T, { title: o, value: e[l] }),
|
|
46
|
+
r === "date" && /* @__PURE__ */ n(B, { title: o, value: e[l] }),
|
|
47
|
+
r === "byte" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
48
|
+
r === "double" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
49
|
+
r === "integer" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
50
|
+
r === "long" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
51
|
+
r === "enum" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
52
|
+
r === "list" && /* @__PURE__ */ n(g, { title: o, value: e[l] }),
|
|
53
|
+
r === "text" && /* @__PURE__ */ n(s, { title: o, value: e[l] }),
|
|
54
|
+
r === "composite-list" && /* @__PURE__ */ n(g, { title: o, value: e[l] })
|
|
55
|
+
] }, t) : /* @__PURE__ */ n(f, {}, t);
|
|
53
56
|
}) });
|
|
54
57
|
}
|
|
55
58
|
export {
|
|
56
|
-
|
|
59
|
+
R as default
|
|
57
60
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as m, jsx as t, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Typography as f, FormLabel as P, FormGroup as D, Button as W } from "@mui/material";
|
|
1
|
+
import { jsxs as m, jsx as t, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T } from "react";
|
|
3
|
+
import { KeyboardArrowUp as k, KeyboardArrowDown as w } from "@mui/icons-material";
|
|
4
|
+
import { Typography as c, FormLabel as Y, FormGroup as D, Button as W } from "@mui/material";
|
|
6
5
|
import { DatePicker as C } from "@mui/x-date-pickers";
|
|
7
|
-
import
|
|
6
|
+
import f from "dayjs";
|
|
7
|
+
import { B as r } from "../../Box-B1AVyJ_s.js";
|
|
8
8
|
import { T as b } from "../../TextField-Bf46COnQ.js";
|
|
9
9
|
import { F as O } from "../../FormControlLabel-DzNokgFD.js";
|
|
10
|
-
import { C as
|
|
10
|
+
import { C as z } from "../../Checkbox-CrU2hpWB.js";
|
|
11
11
|
import { F as B } from "../../InputLabel-rrSJo8M_.js";
|
|
12
12
|
const R = ({
|
|
13
13
|
property: e,
|
|
14
14
|
value: a,
|
|
15
|
-
size:
|
|
16
|
-
variant:
|
|
15
|
+
size: d = "medium",
|
|
16
|
+
variant: u,
|
|
17
17
|
onChange: p
|
|
18
18
|
}) => {
|
|
19
19
|
var I, S, y, V, M;
|
|
@@ -23,31 +23,31 @@ const R = ({
|
|
|
23
23
|
o[l] = String(i), p({
|
|
24
24
|
[n.target.name]: o
|
|
25
25
|
});
|
|
26
|
-
},
|
|
26
|
+
}, F = (l) => {
|
|
27
27
|
var x;
|
|
28
28
|
const n = { ...a }, { value: o, checked: i, name: s } = l.target;
|
|
29
29
|
i ? (n.atLeastOneOf || (n.atLeastOneOf = []), n.atLeastOneOf.push(o)) : n.atLeastOneOf = (x = n.atLeastOneOf) == null ? void 0 : x.filter(
|
|
30
|
-
(
|
|
30
|
+
(L) => L !== o
|
|
31
31
|
), p({
|
|
32
32
|
[s]: n
|
|
33
33
|
});
|
|
34
34
|
}, g = (l) => (n) => {
|
|
35
35
|
let o = { ...a };
|
|
36
|
-
o[l] =
|
|
36
|
+
o[l] = f(n).format("YYYY-MM-DD"), p({
|
|
37
37
|
[e.propertyId]: o
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
if (["string", "text", "list"].includes(e.type))
|
|
41
|
-
return /* @__PURE__ */ m(
|
|
42
|
-
/* @__PURE__ */ t(
|
|
41
|
+
return /* @__PURE__ */ m(r, { mb: 1, children: [
|
|
42
|
+
/* @__PURE__ */ t(c, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
|
|
43
43
|
/* @__PURE__ */ t(
|
|
44
44
|
b,
|
|
45
45
|
{
|
|
46
46
|
name: e.propertyId,
|
|
47
47
|
value: a.exact ?? e.defaultValue ?? "",
|
|
48
|
-
size:
|
|
48
|
+
size: d,
|
|
49
49
|
onChange: h("exact"),
|
|
50
|
-
variant:
|
|
50
|
+
variant: u,
|
|
51
51
|
type: "text",
|
|
52
52
|
multiline: e.type === "text",
|
|
53
53
|
disabled: !e.editable,
|
|
@@ -59,17 +59,17 @@ const R = ({
|
|
|
59
59
|
)
|
|
60
60
|
] });
|
|
61
61
|
if (["integer", "double", "long", "byte"].includes(e.type))
|
|
62
|
-
return /* @__PURE__ */ m(
|
|
63
|
-
/* @__PURE__ */ t(
|
|
64
|
-
/* @__PURE__ */ m(
|
|
62
|
+
return /* @__PURE__ */ m(r, { mb: 1, children: [
|
|
63
|
+
/* @__PURE__ */ t(c, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
|
|
64
|
+
/* @__PURE__ */ m(r, { display: "flex", alignItems: "center", mb: 2, children: [
|
|
65
65
|
/* @__PURE__ */ t(
|
|
66
66
|
b,
|
|
67
67
|
{
|
|
68
68
|
name: e.propertyId,
|
|
69
69
|
value: a.min ?? e.defaultValue ?? "",
|
|
70
|
-
size:
|
|
70
|
+
size: d,
|
|
71
71
|
onChange: h("min"),
|
|
72
|
-
variant:
|
|
72
|
+
variant: u,
|
|
73
73
|
type: "number",
|
|
74
74
|
disabled: !e.editable,
|
|
75
75
|
fullWidth: !0,
|
|
@@ -79,15 +79,15 @@ const R = ({
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */ t(
|
|
82
|
+
/* @__PURE__ */ t(c, { px: 1, children: "-" }),
|
|
83
83
|
/* @__PURE__ */ t(
|
|
84
84
|
b,
|
|
85
85
|
{
|
|
86
86
|
name: e.propertyId,
|
|
87
87
|
value: a.max ?? e.defaultValue ?? "",
|
|
88
|
-
size:
|
|
88
|
+
size: d,
|
|
89
89
|
onChange: h("max"),
|
|
90
|
-
variant:
|
|
90
|
+
variant: u,
|
|
91
91
|
type: "number",
|
|
92
92
|
disabled: !e.editable,
|
|
93
93
|
fullWidth: !0,
|
|
@@ -100,23 +100,25 @@ const R = ({
|
|
|
100
100
|
] })
|
|
101
101
|
] });
|
|
102
102
|
if (e.type === "date") {
|
|
103
|
-
const l = "DD/MM/YYYY", n = "YYYY-MM-DD", o = a.min &&
|
|
104
|
-
return /* @__PURE__ */ m(
|
|
105
|
-
/* @__PURE__ */ t(
|
|
106
|
-
/* @__PURE__ */ m(
|
|
103
|
+
const l = "DD/MM/YYYY", n = "YYYY-MM-DD", o = a.min && f(a.min, n, !0).isValid() ? f(a.min, n) : null, i = a.max && f(a.max, n, !0).isValid() ? f(a.max, n) : null;
|
|
104
|
+
return /* @__PURE__ */ m(r, { mb: 1, children: [
|
|
105
|
+
/* @__PURE__ */ t(c, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
|
|
106
|
+
/* @__PURE__ */ m(r, { display: "flex", alignItems: "center", children: [
|
|
107
107
|
/* @__PURE__ */ t(
|
|
108
108
|
C,
|
|
109
109
|
{
|
|
110
|
+
label: "From",
|
|
110
111
|
value: o,
|
|
111
112
|
format: l,
|
|
112
113
|
views: ["year", "month", "day"],
|
|
113
114
|
slotProps: {
|
|
114
115
|
textField: {
|
|
115
|
-
variant:
|
|
116
|
+
variant: u,
|
|
116
117
|
name: e.propertyId,
|
|
117
|
-
size:
|
|
118
|
+
size: d,
|
|
118
119
|
fullWidth: !0,
|
|
119
|
-
inputProps: { sx: { fontSize: 12 } }
|
|
120
|
+
inputProps: { sx: { fontSize: 12 } },
|
|
121
|
+
InputLabelProps: { sx: { fontSize: 12 } }
|
|
120
122
|
},
|
|
121
123
|
inputAdornment: {
|
|
122
124
|
sx: {
|
|
@@ -129,21 +131,23 @@ const R = ({
|
|
|
129
131
|
onChange: g("min")
|
|
130
132
|
}
|
|
131
133
|
),
|
|
132
|
-
/* @__PURE__ */ t(
|
|
134
|
+
/* @__PURE__ */ t(c, { px: 1, children: "-" }),
|
|
133
135
|
/* @__PURE__ */ t(
|
|
134
136
|
C,
|
|
135
137
|
{
|
|
138
|
+
label: "To",
|
|
136
139
|
value: i,
|
|
137
140
|
format: l,
|
|
138
141
|
minDate: o !== null ? o : void 0,
|
|
139
142
|
views: ["year", "month", "day"],
|
|
140
143
|
slotProps: {
|
|
141
144
|
textField: {
|
|
142
|
-
variant:
|
|
145
|
+
variant: u,
|
|
143
146
|
name: e.propertyId,
|
|
144
|
-
size:
|
|
147
|
+
size: d,
|
|
145
148
|
fullWidth: !0,
|
|
146
|
-
inputProps: { sx: { fontSize: 12 } }
|
|
149
|
+
inputProps: { sx: { fontSize: 12 } },
|
|
150
|
+
InputLabelProps: { sx: { fontSize: 12 } }
|
|
147
151
|
},
|
|
148
152
|
inputAdornment: {
|
|
149
153
|
sx: {
|
|
@@ -160,14 +164,14 @@ const R = ({
|
|
|
160
164
|
] });
|
|
161
165
|
}
|
|
162
166
|
if (e.type === "boolean")
|
|
163
|
-
return /* @__PURE__ */ t(
|
|
167
|
+
return /* @__PURE__ */ t(r, { mb: 1, children: /* @__PURE__ */ t(
|
|
164
168
|
O,
|
|
165
169
|
{
|
|
166
170
|
label: e.name,
|
|
167
171
|
control: /* @__PURE__ */ t(
|
|
168
|
-
|
|
172
|
+
z,
|
|
169
173
|
{
|
|
170
|
-
size:
|
|
174
|
+
size: d,
|
|
171
175
|
name: e.propertyId,
|
|
172
176
|
checked: !!a,
|
|
173
177
|
onChange: h("exact")
|
|
@@ -181,23 +185,23 @@ const R = ({
|
|
|
181
185
|
}
|
|
182
186
|
) });
|
|
183
187
|
if (e.type === "enum" || e.type === "composite-list" && ((S = (I = e.dataTypeInfo) == null ? void 0 : I.innerType) == null ? void 0 : S.type) === "enum") {
|
|
184
|
-
const [l, n] =
|
|
188
|
+
const [l, n] = T(!1), o = 10;
|
|
185
189
|
let i = [];
|
|
186
|
-
return (y = e.dataTypeInfo) != null && y.enumValues && (i = e.dataTypeInfo.enumValues), (M = (V = e.dataTypeInfo) == null ? void 0 : V.innerType) != null && M.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ m(
|
|
187
|
-
/* @__PURE__ */ m(B, { fullWidth: !0, component: "fieldset", variant:
|
|
188
|
-
/* @__PURE__ */ t(
|
|
190
|
+
return (y = e.dataTypeInfo) != null && y.enumValues && (i = e.dataTypeInfo.enumValues), (M = (V = e.dataTypeInfo) == null ? void 0 : V.innerType) != null && M.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ m(r, { mb: 1, children: [
|
|
191
|
+
/* @__PURE__ */ m(B, { fullWidth: !0, component: "fieldset", variant: u, children: [
|
|
192
|
+
/* @__PURE__ */ t(Y, { component: "legend", sx: { mb: 1, fontSize: 12 }, children: e.name }),
|
|
189
193
|
/* @__PURE__ */ t(D, { children: i.slice(0, l ? 9999 : o).map((s, x) => /* @__PURE__ */ t(
|
|
190
194
|
O,
|
|
191
195
|
{
|
|
192
196
|
label: s,
|
|
193
197
|
control: /* @__PURE__ */ t(
|
|
194
|
-
|
|
198
|
+
z,
|
|
195
199
|
{
|
|
196
200
|
name: e.propertyId,
|
|
197
201
|
value: s,
|
|
198
202
|
size: "small",
|
|
199
203
|
checked: a.atLeastOneOf ? a.atLeastOneOf.includes(s) : !1,
|
|
200
|
-
onChange:
|
|
204
|
+
onChange: F,
|
|
201
205
|
sx: {
|
|
202
206
|
p: 0,
|
|
203
207
|
mr: 1,
|
|
@@ -226,7 +230,7 @@ const R = ({
|
|
|
226
230
|
{
|
|
227
231
|
size: "small",
|
|
228
232
|
sx: { p: 0, textTransform: "none", fontSize: 12 },
|
|
229
|
-
endIcon: l ? /* @__PURE__ */ t(
|
|
233
|
+
endIcon: l ? /* @__PURE__ */ t(k, { sx: { fontSize: 14 } }) : /* @__PURE__ */ t(w, { sx: { fontSize: 14 } }),
|
|
230
234
|
onClick: () => n((s) => !s),
|
|
231
235
|
children: [
|
|
232
236
|
"Show ",
|
|
@@ -236,7 +240,7 @@ const R = ({
|
|
|
236
240
|
)
|
|
237
241
|
] });
|
|
238
242
|
}
|
|
239
|
-
return /* @__PURE__ */ t(
|
|
243
|
+
return /* @__PURE__ */ t(P, {});
|
|
240
244
|
};
|
|
241
245
|
export {
|
|
242
246
|
R as Property
|