@hybridcore/ui 1.3.5 → 1.3.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.
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { RadioButtonUnchecked as
|
|
5
|
-
import { Typography as p, FormLabel as
|
|
1
|
+
import { jsx as a, jsxs as r, 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 p, FormLabel as D, FormGroup as L, Button as B } from "@mui/material";
|
|
6
6
|
import { DatePicker as I } from "@mui/x-date-pickers";
|
|
7
7
|
import { T as x, F as C } from "../../FormControlLabel-DENNVXWL.js";
|
|
8
|
-
import { B as
|
|
9
|
-
import { F as
|
|
10
|
-
function
|
|
8
|
+
import { B as f, C as V } from "../../Checkbox-BFWhj3s-.js";
|
|
9
|
+
import { F as T } from "../../FormControl-BMRUQKHh.js";
|
|
10
|
+
function R({
|
|
11
11
|
property: e,
|
|
12
12
|
value: t,
|
|
13
13
|
size: d = "medium",
|
|
14
|
-
onChange:
|
|
14
|
+
onChange: h
|
|
15
15
|
}) {
|
|
16
16
|
var g;
|
|
17
|
-
const u = (o) => (
|
|
17
|
+
const u = (o) => (n) => {
|
|
18
18
|
let l = { ...t };
|
|
19
|
-
const i =
|
|
20
|
-
l[o] = String(i),
|
|
21
|
-
[
|
|
19
|
+
const i = n.target.type === "checkbox" ? n.target.checked : n.target.value;
|
|
20
|
+
l[o] = String(i), h({
|
|
21
|
+
[n.target.name]: l
|
|
22
22
|
});
|
|
23
23
|
}, M = (o) => {
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
i ? (
|
|
27
|
-
[
|
|
24
|
+
var c;
|
|
25
|
+
const n = { ...t }, { value: l, checked: i, name: s } = o.target;
|
|
26
|
+
i ? (n.list || (n.list = []), n.list.push(l)) : n.list = (c = n.list) == null ? void 0 : c.filter((P) => P !== l), h({
|
|
27
|
+
[s]: n
|
|
28
28
|
});
|
|
29
|
-
}, b = (o) => (
|
|
29
|
+
}, b = (o) => (n) => {
|
|
30
30
|
let l = { ...t };
|
|
31
|
-
l[o] =
|
|
31
|
+
l[o] = m(n).format("YYYY-MM-DD"), h({
|
|
32
32
|
[e.propertyId]: l
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
if (["string", "text", "list"].includes(e.type))
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ a(
|
|
37
37
|
x,
|
|
38
38
|
{
|
|
39
39
|
label: e.name,
|
|
@@ -53,8 +53,8 @@ function G({
|
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
if (["integer", "double", "long", "byte"].includes(e.type))
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ r(f, { display: "flex", alignItems: "center", mb: 2, children: [
|
|
57
|
+
/* @__PURE__ */ a(
|
|
58
58
|
x,
|
|
59
59
|
{
|
|
60
60
|
label: `${e.name} (Min)`,
|
|
@@ -71,8 +71,8 @@ function G({
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ a(p, { px: 1, children: "-" }),
|
|
75
|
+
/* @__PURE__ */ a(
|
|
76
76
|
x,
|
|
77
77
|
{
|
|
78
78
|
label: `${e.name} (Max)`,
|
|
@@ -91,9 +91,9 @@ function G({
|
|
|
91
91
|
)
|
|
92
92
|
] });
|
|
93
93
|
if (e.type === "date") {
|
|
94
|
-
const o = "DD/MM/YYYY",
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
94
|
+
const o = "DD/MM/YYYY", n = "YYYY-MM-DD", l = t.min && m(t.min, n, !0).isValid() ? m(t.min, n) : null, i = t.max && m(t.max, n, !0).isValid() ? m(t.max, n) : null;
|
|
95
|
+
return /* @__PURE__ */ r(f, { mb: 2, display: "flex", alignItems: "end", children: [
|
|
96
|
+
/* @__PURE__ */ a(
|
|
97
97
|
I,
|
|
98
98
|
{
|
|
99
99
|
label: `${e.name} (Min)`,
|
|
@@ -113,8 +113,8 @@ function G({
|
|
|
113
113
|
onChange: b("min")
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ a(p, { px: 1, children: "-" }),
|
|
117
|
+
/* @__PURE__ */ a(
|
|
118
118
|
I,
|
|
119
119
|
{
|
|
120
120
|
label: `${e.name} (Max)`,
|
|
@@ -138,18 +138,18 @@ function G({
|
|
|
138
138
|
] });
|
|
139
139
|
}
|
|
140
140
|
if (e.type === "boolean")
|
|
141
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ a(f, { mb: 2, children: /* @__PURE__ */ a(
|
|
142
142
|
C,
|
|
143
143
|
{
|
|
144
144
|
label: e.name,
|
|
145
|
-
control: /* @__PURE__ */
|
|
145
|
+
control: /* @__PURE__ */ a(
|
|
146
146
|
V,
|
|
147
147
|
{
|
|
148
148
|
size: d,
|
|
149
149
|
name: e.propertyId,
|
|
150
150
|
checked: !!t,
|
|
151
|
-
icon: /* @__PURE__ */
|
|
152
|
-
checkedIcon: /* @__PURE__ */
|
|
151
|
+
icon: /* @__PURE__ */ a(F, {}),
|
|
152
|
+
checkedIcon: /* @__PURE__ */ a(S, {}),
|
|
153
153
|
onChange: u("exact")
|
|
154
154
|
}
|
|
155
155
|
),
|
|
@@ -161,19 +161,19 @@ function G({
|
|
|
161
161
|
}
|
|
162
162
|
) });
|
|
163
163
|
if (e.type === "enum") {
|
|
164
|
-
const [o,
|
|
164
|
+
const [o, n] = w(!1), l = 10;
|
|
165
165
|
let i = [];
|
|
166
|
-
return (g = e.dataTypeInfo) != null && g.enumValues && (i = e.dataTypeInfo.enumValues), /* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
166
|
+
return (g = e.dataTypeInfo) != null && g.enumValues && (i = e.dataTypeInfo.enumValues), /* @__PURE__ */ r(f, { mb: 2, children: [
|
|
167
|
+
/* @__PURE__ */ r(T, { fullWidth: !0, component: "fieldset", variant: "standard", children: [
|
|
168
|
+
/* @__PURE__ */ a(D, { component: "legend", sx: { mb: 1 }, children: e.name }),
|
|
169
|
+
/* @__PURE__ */ a(L, { children: i.slice(0, o ? 9999 : l).map((s, c) => /* @__PURE__ */ a(
|
|
170
170
|
C,
|
|
171
171
|
{
|
|
172
172
|
label: s,
|
|
173
|
-
control: /* @__PURE__ */
|
|
173
|
+
control: /* @__PURE__ */ a(
|
|
174
174
|
V,
|
|
175
175
|
{
|
|
176
|
-
name: e.
|
|
176
|
+
name: e.propertyId,
|
|
177
177
|
value: s,
|
|
178
178
|
size: "small",
|
|
179
179
|
checked: t.list ? t.list.includes(s) : !1,
|
|
@@ -186,16 +186,16 @@ function G({
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
|
-
|
|
189
|
+
c
|
|
190
190
|
)) })
|
|
191
191
|
] }),
|
|
192
|
-
i.length > l && /* @__PURE__ */
|
|
193
|
-
|
|
192
|
+
i.length > l && /* @__PURE__ */ r(
|
|
193
|
+
B,
|
|
194
194
|
{
|
|
195
195
|
size: "small",
|
|
196
196
|
sx: { p: 0, textTransform: "none" },
|
|
197
|
-
endIcon: o ? /* @__PURE__ */
|
|
198
|
-
onClick: () =>
|
|
197
|
+
endIcon: o ? /* @__PURE__ */ a(Y, {}) : /* @__PURE__ */ a(y, {}),
|
|
198
|
+
onClick: () => n((s) => !s),
|
|
199
199
|
children: [
|
|
200
200
|
"Show ",
|
|
201
201
|
o ? "Less" : "More"
|
|
@@ -204,8 +204,8 @@ function G({
|
|
|
204
204
|
)
|
|
205
205
|
] });
|
|
206
206
|
}
|
|
207
|
-
return /* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ a(k, {});
|
|
208
208
|
}
|
|
209
209
|
export {
|
|
210
|
-
|
|
210
|
+
R as default
|
|
211
211
|
};
|