@hybridcore/ui 1.4.39 → 1.4.40
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,60 +1,60 @@
|
|
|
1
|
-
import { jsx as d } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as d, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import s from "lodash";
|
|
3
|
-
import { CollapsibleCard as I } from "../collapsible-card/index.js";
|
|
4
3
|
import p from "./property.js";
|
|
5
|
-
import { Box as c } from "@mui/material";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { Box as c, Typography as I } from "@mui/material";
|
|
5
|
+
import { Accordion as A, AccordionSummary as K, AccordionDetails as N } from "./styled.js";
|
|
6
|
+
const j = ({
|
|
7
|
+
values: f,
|
|
8
|
+
templates: h,
|
|
9
|
+
inputVariant: m,
|
|
10
10
|
fieldOptions: i,
|
|
11
11
|
onChange: g
|
|
12
12
|
}) => {
|
|
13
|
-
const y = (
|
|
14
|
-
if (
|
|
15
|
-
let e =
|
|
13
|
+
const y = (a) => (n) => {
|
|
14
|
+
if (a) {
|
|
15
|
+
let e = f.find((r) => r.templateKey === a);
|
|
16
16
|
if (e) {
|
|
17
|
-
const r = s.keys(
|
|
18
|
-
let
|
|
19
|
-
(
|
|
17
|
+
const r = s.keys(n)[0];
|
|
18
|
+
let t = e.filters.findIndex(
|
|
19
|
+
(l) => l.fieldName === r
|
|
20
20
|
);
|
|
21
|
-
const
|
|
22
|
-
s.values(
|
|
21
|
+
const o = s.get(n, r);
|
|
22
|
+
s.values(o).filter((l) => !(s.isArray(l) && l.length === 0 || l === "")).length === 0 && t !== -1 ? e.filters.splice(t, 1) : t !== -1 ? e.filters[t] = {
|
|
23
23
|
fieldName: r,
|
|
24
|
-
value:
|
|
24
|
+
value: o
|
|
25
25
|
} : e.filters.push({
|
|
26
26
|
fieldName: r,
|
|
27
|
-
value:
|
|
27
|
+
value: o
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
g(
|
|
30
|
+
g(f, e);
|
|
31
31
|
} else console.warn("Template could not be found!");
|
|
32
32
|
};
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */ d(c, { display: "flex", flexDirection: "column", children:
|
|
33
|
+
if (f.length === 1) {
|
|
34
|
+
const a = f[0], n = h.get(a.templateKey);
|
|
35
|
+
return /* @__PURE__ */ d(c, { display: "flex", flexDirection: "column", children: n == null ? void 0 : n.properties.filter((e) => {
|
|
36
36
|
var r;
|
|
37
37
|
return i ? !((r = i[e.propertyId]) != null && r.hidden) : !0;
|
|
38
38
|
}).map((e, r) => {
|
|
39
|
-
var
|
|
40
|
-
let
|
|
41
|
-
const
|
|
39
|
+
var l;
|
|
40
|
+
let t = {};
|
|
41
|
+
const o = a.filters.find(
|
|
42
42
|
(u) => u.fieldName === e.propertyId
|
|
43
43
|
);
|
|
44
|
-
return
|
|
44
|
+
return o && (t = o.value), /* @__PURE__ */ d(
|
|
45
45
|
c,
|
|
46
46
|
{
|
|
47
|
-
...i && ((
|
|
47
|
+
...i && ((l = i[e.propertyId]) == null ? void 0 : l.order) && {
|
|
48
48
|
order: i[e.propertyId].order
|
|
49
49
|
},
|
|
50
50
|
children: /* @__PURE__ */ d(
|
|
51
51
|
p,
|
|
52
52
|
{
|
|
53
53
|
property: e,
|
|
54
|
-
value:
|
|
54
|
+
value: t,
|
|
55
55
|
size: "small",
|
|
56
|
-
variant:
|
|
57
|
-
onChange: y(
|
|
56
|
+
variant: m,
|
|
57
|
+
onChange: y(n == null ? void 0 : n.templateKey)
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
},
|
|
@@ -62,46 +62,49 @@ const b = ({
|
|
|
62
62
|
);
|
|
63
63
|
}) });
|
|
64
64
|
}
|
|
65
|
-
return
|
|
66
|
-
const e =
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
value: f,
|
|
91
|
-
size: "small",
|
|
92
|
-
variant: h,
|
|
93
|
-
onChange: y(e == null ? void 0 : e.templateKey)
|
|
94
|
-
}
|
|
95
|
-
)
|
|
65
|
+
return f.map((a, n) => {
|
|
66
|
+
const e = h.get(a.templateKey);
|
|
67
|
+
return /* @__PURE__ */ x(A, { disableGutters: !0, elevation: 0, square: !0, children: [
|
|
68
|
+
/* @__PURE__ */ d(
|
|
69
|
+
K,
|
|
70
|
+
{
|
|
71
|
+
"aria-controls": `panel${n}-content`,
|
|
72
|
+
id: `panel${n}-header`,
|
|
73
|
+
children: /* @__PURE__ */ d(I, { variant: "body2", sx: { fontSize: 12 }, children: e == null ? void 0 : e.name })
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ d(N, { children: e == null ? void 0 : e.properties.filter((r) => {
|
|
77
|
+
var t;
|
|
78
|
+
return i ? !((t = i[r.propertyId]) != null && t.hidden) : !0;
|
|
79
|
+
}).map((r, t) => {
|
|
80
|
+
var u;
|
|
81
|
+
let o = {};
|
|
82
|
+
const l = a.filters.find(
|
|
83
|
+
(v) => v.fieldName === r.propertyId
|
|
84
|
+
);
|
|
85
|
+
return l && (o = l.value), /* @__PURE__ */ d(
|
|
86
|
+
c,
|
|
87
|
+
{
|
|
88
|
+
...i && ((u = i[r.propertyId]) == null ? void 0 : u.order) && {
|
|
89
|
+
order: i[r.propertyId].order
|
|
96
90
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
children: /* @__PURE__ */ d(
|
|
92
|
+
p,
|
|
93
|
+
{
|
|
94
|
+
property: r,
|
|
95
|
+
value: o,
|
|
96
|
+
size: "small",
|
|
97
|
+
variant: m,
|
|
98
|
+
onChange: y(e == null ? void 0 : e.templateKey)
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
},
|
|
102
|
+
t
|
|
103
|
+
);
|
|
104
|
+
}) })
|
|
105
|
+
] });
|
|
103
106
|
});
|
|
104
107
|
};
|
|
105
108
|
export {
|
|
106
|
-
|
|
109
|
+
j as TemplatePropertyFilters
|
|
107
110
|
};
|
|
@@ -1,216 +1,242 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { DatePicker as
|
|
1
|
+
import { jsxs as m, jsx as t, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Y } from "react";
|
|
3
|
+
import c from "dayjs";
|
|
4
|
+
import { KeyboardArrowUp as L, KeyboardArrowDown as P } from "@mui/icons-material";
|
|
5
|
+
import { Typography as f, FormLabel as z, FormGroup as D, Button as W } from "@mui/material";
|
|
6
|
+
import { DatePicker as C } from "@mui/x-date-pickers";
|
|
7
|
+
import { B as d } from "../../Box-SSMZuKnS.js";
|
|
7
8
|
import { T as b } from "../../TextField-BjFXx91l.js";
|
|
8
|
-
import { B as h } from "../../Box-SSMZuKnS.js";
|
|
9
9
|
import { F as O } from "../../FormControlLabel-BNT5EI0b.js";
|
|
10
|
-
import { C as
|
|
11
|
-
import { F as
|
|
12
|
-
function
|
|
10
|
+
import { C as k } from "../../Checkbox-B0P8LhCl.js";
|
|
11
|
+
import { F as B } from "../../InputLabel-ClDXuWBr.js";
|
|
12
|
+
function R({
|
|
13
13
|
property: e,
|
|
14
14
|
value: a,
|
|
15
|
-
size:
|
|
16
|
-
variant:
|
|
17
|
-
onChange:
|
|
15
|
+
size: r = "medium",
|
|
16
|
+
variant: u,
|
|
17
|
+
onChange: p
|
|
18
18
|
}) {
|
|
19
|
-
var
|
|
20
|
-
const
|
|
21
|
-
let
|
|
19
|
+
var I, y, S, V, M;
|
|
20
|
+
const h = (l) => (n) => {
|
|
21
|
+
let o = { ...a };
|
|
22
22
|
const i = n.target.type === "checkbox" ? n.target.checked : n.target.value;
|
|
23
|
-
l
|
|
24
|
-
[n.target.name]:
|
|
23
|
+
o[l] = String(i), p({
|
|
24
|
+
[n.target.name]: o
|
|
25
25
|
});
|
|
26
|
-
},
|
|
27
|
-
var
|
|
28
|
-
const n = { ...a }, { value:
|
|
29
|
-
i ? (n.atLeastOneOf || (n.atLeastOneOf = []), n.atLeastOneOf.push(
|
|
30
|
-
(
|
|
31
|
-
),
|
|
32
|
-
[
|
|
26
|
+
}, w = (l) => {
|
|
27
|
+
var x;
|
|
28
|
+
const n = { ...a }, { value: o, checked: i, name: s } = l.target;
|
|
29
|
+
i ? (n.atLeastOneOf || (n.atLeastOneOf = []), n.atLeastOneOf.push(o)) : n.atLeastOneOf = (x = n.atLeastOneOf) == null ? void 0 : x.filter(
|
|
30
|
+
(F) => F !== o
|
|
31
|
+
), p({
|
|
32
|
+
[s]: n
|
|
33
33
|
});
|
|
34
|
-
},
|
|
35
|
-
let
|
|
36
|
-
l
|
|
37
|
-
[e.propertyId]:
|
|
34
|
+
}, g = (l) => (n) => {
|
|
35
|
+
let o = { ...a };
|
|
36
|
+
o[l] = c(n).format("YYYY-MM-DD"), p({
|
|
37
|
+
[e.propertyId]: o
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
if (["string", "text", "list"].includes(e.type))
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
label: e.name,
|
|
45
|
-
name: e.propertyId,
|
|
46
|
-
value: a.exact ?? e.defaultValue ?? "",
|
|
47
|
-
size: s,
|
|
48
|
-
onChange: f("exact"),
|
|
49
|
-
variant: d,
|
|
50
|
-
type: "text",
|
|
51
|
-
multiline: e.type === "text",
|
|
52
|
-
disabled: !e.editable,
|
|
53
|
-
fullWidth: !0,
|
|
54
|
-
sx: { mb: 2 },
|
|
55
|
-
InputLabelProps: {
|
|
56
|
-
sx: { fontSize: 14 }
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
if (["integer", "double", "long", "byte"].includes(e.type))
|
|
61
|
-
return /* @__PURE__ */ u(h, { display: "flex", alignItems: "center", mb: 2, children: [
|
|
41
|
+
return /* @__PURE__ */ m(d, { mb: 1, children: [
|
|
42
|
+
/* @__PURE__ */ t(f, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
|
|
62
43
|
/* @__PURE__ */ t(
|
|
63
44
|
b,
|
|
64
45
|
{
|
|
65
|
-
label: `${e.name} (Min)`,
|
|
66
46
|
name: e.propertyId,
|
|
67
|
-
value: a.
|
|
68
|
-
size:
|
|
69
|
-
onChange:
|
|
70
|
-
variant:
|
|
71
|
-
type: "
|
|
47
|
+
value: a.exact ?? e.defaultValue ?? "",
|
|
48
|
+
size: r,
|
|
49
|
+
onChange: h("exact"),
|
|
50
|
+
variant: u,
|
|
51
|
+
type: "text",
|
|
52
|
+
multiline: e.type === "text",
|
|
72
53
|
disabled: !e.editable,
|
|
73
54
|
fullWidth: !0,
|
|
74
|
-
|
|
75
|
-
sx: { fontSize:
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
/* @__PURE__ */ t(y, { px: 1, children: "-" }),
|
|
80
|
-
/* @__PURE__ */ t(
|
|
81
|
-
b,
|
|
82
|
-
{
|
|
83
|
-
label: `${e.name} (Max)`,
|
|
84
|
-
name: e.propertyId,
|
|
85
|
-
value: a.max ?? e.defaultValue ?? "",
|
|
86
|
-
size: s,
|
|
87
|
-
onChange: f("max"),
|
|
88
|
-
variant: d,
|
|
89
|
-
type: "number",
|
|
90
|
-
disabled: !e.editable,
|
|
91
|
-
fullWidth: !0,
|
|
92
|
-
InputLabelProps: {
|
|
93
|
-
sx: { fontSize: 14 }
|
|
55
|
+
InputProps: {
|
|
56
|
+
sx: { fontSize: 12 }
|
|
94
57
|
}
|
|
95
58
|
}
|
|
96
59
|
)
|
|
97
60
|
] });
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
61
|
+
if (["integer", "double", "long", "byte"].includes(e.type))
|
|
62
|
+
return /* @__PURE__ */ m(d, { mb: 1, children: [
|
|
63
|
+
/* @__PURE__ */ t(f, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
|
|
64
|
+
/* @__PURE__ */ m(d, { display: "flex", alignItems: "center", mb: 2, children: [
|
|
65
|
+
/* @__PURE__ */ t(
|
|
66
|
+
b,
|
|
67
|
+
{
|
|
68
|
+
name: e.propertyId,
|
|
69
|
+
value: a.min ?? e.defaultValue ?? "",
|
|
70
|
+
size: r,
|
|
71
|
+
onChange: h("min"),
|
|
72
|
+
variant: u,
|
|
73
|
+
type: "number",
|
|
74
|
+
disabled: !e.editable,
|
|
75
|
+
fullWidth: !0,
|
|
76
|
+
InputProps: {
|
|
77
|
+
placeholder: "Min",
|
|
78
|
+
sx: { fontSize: 12 }
|
|
116
79
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
size: s,
|
|
135
|
-
fullWidth: !0,
|
|
136
|
-
InputLabelProps: { sx: { fontSize: 14 } },
|
|
137
|
-
inputProps: { sx: { fontSize: 14 } }
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ t(f, { px: 1, children: "-" }),
|
|
83
|
+
/* @__PURE__ */ t(
|
|
84
|
+
b,
|
|
85
|
+
{
|
|
86
|
+
name: e.propertyId,
|
|
87
|
+
value: a.max ?? e.defaultValue ?? "",
|
|
88
|
+
size: r,
|
|
89
|
+
onChange: h("max"),
|
|
90
|
+
variant: u,
|
|
91
|
+
type: "number",
|
|
92
|
+
disabled: !e.editable,
|
|
93
|
+
fullWidth: !0,
|
|
94
|
+
InputProps: {
|
|
95
|
+
placeholder: "Max",
|
|
96
|
+
sx: { fontSize: 12 }
|
|
138
97
|
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] })
|
|
101
|
+
] });
|
|
102
|
+
if (e.type === "date") {
|
|
103
|
+
const l = "DD/MM/YYYY", n = "YYYY-MM-DD", o = a.min && c(a.min, n, !0).isValid() ? c(a.min, n) : null, i = a.max && c(a.max, n, !0).isValid() ? c(a.max, n) : null;
|
|
104
|
+
return /* @__PURE__ */ m(d, { mb: 1, children: [
|
|
105
|
+
/* @__PURE__ */ t(f, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
|
|
106
|
+
/* @__PURE__ */ m(d, { display: "flex", alignItems: "center", children: [
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
C,
|
|
109
|
+
{
|
|
110
|
+
value: o,
|
|
111
|
+
format: l,
|
|
112
|
+
views: ["year", "month", "day"],
|
|
113
|
+
slotProps: {
|
|
114
|
+
textField: {
|
|
115
|
+
variant: u,
|
|
116
|
+
name: e.propertyId,
|
|
117
|
+
size: r,
|
|
118
|
+
fullWidth: !0,
|
|
119
|
+
inputProps: { sx: { fontSize: 12 } }
|
|
120
|
+
},
|
|
121
|
+
inputAdornment: {
|
|
122
|
+
sx: {
|
|
123
|
+
"& .MuiSvgIcon-root": {
|
|
124
|
+
fontSize: 16
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
onChange: g("min")
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ t(f, { px: 1, children: "-" }),
|
|
133
|
+
/* @__PURE__ */ t(
|
|
134
|
+
C,
|
|
135
|
+
{
|
|
136
|
+
value: i,
|
|
137
|
+
format: l,
|
|
138
|
+
minDate: o !== null ? o : void 0,
|
|
139
|
+
views: ["year", "month", "day"],
|
|
140
|
+
slotProps: {
|
|
141
|
+
textField: {
|
|
142
|
+
variant: u,
|
|
143
|
+
name: e.propertyId,
|
|
144
|
+
size: r,
|
|
145
|
+
fullWidth: !0,
|
|
146
|
+
inputProps: { sx: { fontSize: 12 } }
|
|
147
|
+
},
|
|
148
|
+
inputAdornment: {
|
|
149
|
+
sx: {
|
|
150
|
+
"& .MuiSvgIcon-root": {
|
|
151
|
+
fontSize: 16
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
onChange: g("max")
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] })
|
|
143
160
|
] });
|
|
144
161
|
}
|
|
145
162
|
if (e.type === "boolean")
|
|
146
|
-
return /* @__PURE__ */ t(
|
|
163
|
+
return /* @__PURE__ */ t(d, { mb: 1, children: /* @__PURE__ */ t(
|
|
147
164
|
O,
|
|
148
165
|
{
|
|
149
166
|
label: e.name,
|
|
150
167
|
control: /* @__PURE__ */ t(
|
|
151
|
-
|
|
168
|
+
k,
|
|
152
169
|
{
|
|
153
|
-
size:
|
|
170
|
+
size: r,
|
|
154
171
|
name: e.propertyId,
|
|
155
172
|
checked: !!a,
|
|
156
|
-
|
|
157
|
-
checkedIcon: /* @__PURE__ */ t(Y, {}),
|
|
158
|
-
onChange: f("exact")
|
|
173
|
+
onChange: h("exact")
|
|
159
174
|
}
|
|
160
175
|
),
|
|
161
176
|
slotProps: {
|
|
162
177
|
typography: {
|
|
163
|
-
fontSize:
|
|
178
|
+
fontSize: 13
|
|
164
179
|
}
|
|
165
180
|
}
|
|
166
181
|
}
|
|
167
182
|
) });
|
|
168
|
-
if (e.type === "enum" || e.type === "composite-list" && ((
|
|
169
|
-
const [
|
|
183
|
+
if (e.type === "enum" || e.type === "composite-list" && ((y = (I = e.dataTypeInfo) == null ? void 0 : I.innerType) == null ? void 0 : y.type) === "enum") {
|
|
184
|
+
const [l, n] = Y(!1), o = 10;
|
|
170
185
|
let i = [];
|
|
171
|
-
return (
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */ t(
|
|
174
|
-
/* @__PURE__ */ t(
|
|
186
|
+
return (S = e.dataTypeInfo) != null && S.enumValues && (i = e.dataTypeInfo.enumValues), (M = (V = e.dataTypeInfo) == null ? void 0 : V.innerType) != null && M.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ m(d, { mb: 1, children: [
|
|
187
|
+
/* @__PURE__ */ m(B, { fullWidth: !0, component: "fieldset", variant: u, children: [
|
|
188
|
+
/* @__PURE__ */ t(z, { component: "legend", sx: { mb: 1, fontSize: 12 }, children: e.name }),
|
|
189
|
+
/* @__PURE__ */ t(D, { children: i.slice(0, l ? 9999 : o).map((s, x) => /* @__PURE__ */ t(
|
|
175
190
|
O,
|
|
176
191
|
{
|
|
177
|
-
label:
|
|
192
|
+
label: s,
|
|
178
193
|
control: /* @__PURE__ */ t(
|
|
179
|
-
|
|
194
|
+
k,
|
|
180
195
|
{
|
|
181
196
|
name: e.propertyId,
|
|
182
|
-
value:
|
|
197
|
+
value: s,
|
|
183
198
|
size: "small",
|
|
184
|
-
checked: a.atLeastOneOf ? a.atLeastOneOf.includes(
|
|
185
|
-
onChange:
|
|
199
|
+
checked: a.atLeastOneOf ? a.atLeastOneOf.includes(s) : !1,
|
|
200
|
+
onChange: w,
|
|
201
|
+
sx: {
|
|
202
|
+
p: 0,
|
|
203
|
+
mr: 1,
|
|
204
|
+
"& .MuiSvgIcon-root": {
|
|
205
|
+
fontSize: 16
|
|
206
|
+
}
|
|
207
|
+
}
|
|
186
208
|
}
|
|
187
209
|
),
|
|
188
210
|
componentsProps: {
|
|
189
211
|
typography: {
|
|
190
212
|
variant: "body2"
|
|
191
213
|
}
|
|
214
|
+
},
|
|
215
|
+
sx: {
|
|
216
|
+
m: 0,
|
|
217
|
+
mb: 1
|
|
192
218
|
}
|
|
193
219
|
},
|
|
194
|
-
|
|
220
|
+
x
|
|
195
221
|
)) })
|
|
196
222
|
] }),
|
|
197
|
-
i.length >
|
|
198
|
-
|
|
223
|
+
i.length > o && /* @__PURE__ */ m(
|
|
224
|
+
W,
|
|
199
225
|
{
|
|
200
226
|
size: "small",
|
|
201
|
-
sx: { p: 0, textTransform: "none" },
|
|
202
|
-
endIcon:
|
|
203
|
-
onClick: () => n((
|
|
227
|
+
sx: { p: 0, textTransform: "none", fontSize: 12 },
|
|
228
|
+
endIcon: l ? /* @__PURE__ */ t(L, { sx: { fontSize: 14 } }) : /* @__PURE__ */ t(P, { sx: { fontSize: 14 } }),
|
|
229
|
+
onClick: () => n((s) => !s),
|
|
204
230
|
children: [
|
|
205
231
|
"Show ",
|
|
206
|
-
|
|
232
|
+
l ? "Less" : "More"
|
|
207
233
|
]
|
|
208
234
|
}
|
|
209
235
|
)
|
|
210
236
|
] });
|
|
211
237
|
}
|
|
212
|
-
return /* @__PURE__ */ t(
|
|
238
|
+
return /* @__PURE__ */ t(T, {});
|
|
213
239
|
}
|
|
214
240
|
export {
|
|
215
|
-
|
|
241
|
+
R as default
|
|
216
242
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as n, jsxs as i, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { Add as r, Remove as d } from "@mui/icons-material";
|
|
3
|
+
import { styled as a, Accordion as e, AccordionSummary as p, alpha as s, AccordionDetails as t } from "@mui/material";
|
|
4
|
+
const g = a((o) => /* @__PURE__ */ n(e, { disableGutters: !0, elevation: 0, square: !0, ...o }))(({ theme: o }) => ({
|
|
5
|
+
borderTop: `1px solid ${o.palette.divider}`,
|
|
6
|
+
"&:last-of-type": {
|
|
7
|
+
borderBottom: `1px solid ${o.palette.divider}`
|
|
8
|
+
},
|
|
9
|
+
"&::before": {
|
|
10
|
+
display: "none"
|
|
11
|
+
}
|
|
12
|
+
})), x = a((o) => /* @__PURE__ */ n(
|
|
13
|
+
p,
|
|
14
|
+
{
|
|
15
|
+
expandIcon: /* @__PURE__ */ i(c, { children: [
|
|
16
|
+
/* @__PURE__ */ n(r, { className: "expandIcon", sx: { fontSize: 16 } }),
|
|
17
|
+
/* @__PURE__ */ n(d, { className: "collapseIcon", sx: { fontSize: 16 } })
|
|
18
|
+
] }),
|
|
19
|
+
...o
|
|
20
|
+
}
|
|
21
|
+
))(({ theme: o }) => ({
|
|
22
|
+
minHeight: 30,
|
|
23
|
+
paddingLeft: o.spacing(1),
|
|
24
|
+
paddingRight: o.spacing(1),
|
|
25
|
+
"&.Mui-expanded": {
|
|
26
|
+
backgroundColor: s(o.palette.primary.main, 0.1),
|
|
27
|
+
"& .MuiAccordionSummary-content": {
|
|
28
|
+
color: o.palette.primary.main
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"& .MuiAccordionSummary-content": {
|
|
32
|
+
margin: 0
|
|
33
|
+
},
|
|
34
|
+
"& .MuiAccordionSummary-expandIconWrapper": {
|
|
35
|
+
transform: "none",
|
|
36
|
+
"& .expandIcon": {
|
|
37
|
+
display: "block"
|
|
38
|
+
},
|
|
39
|
+
"& .collapseIcon": {
|
|
40
|
+
display: "none"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded": {
|
|
44
|
+
transform: "none",
|
|
45
|
+
"& .expandIcon": {
|
|
46
|
+
display: "none"
|
|
47
|
+
},
|
|
48
|
+
"& .collapseIcon": {
|
|
49
|
+
display: "block"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})), y = a(t)(({ theme: o }) => ({
|
|
53
|
+
display: "flex",
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
paddingLeft: o.spacing(1),
|
|
56
|
+
paddingRight: o.spacing(1),
|
|
57
|
+
paddingTop: o.spacing(1.5),
|
|
58
|
+
paddingBottom: o.spacing(1.5)
|
|
59
|
+
}));
|
|
60
|
+
export {
|
|
61
|
+
g as Accordion,
|
|
62
|
+
y as AccordionDetails,
|
|
63
|
+
x as AccordionSummary
|
|
64
|
+
};
|