@hortiview/shared-components 0.0.8373 → 0.0.8519
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/FormComponents/FormCheckBox/FormCheckBox.js +26 -25
- package/dist/components/FormComponents/FormRadio/FormRadio.js +15 -14
- package/dist/components/GenericTable/GenericTable.js +32 -31
- package/dist/components/GenericTable/Mobile/GenericCard.js +20 -20
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +7 -7
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +12 -12
- package/package.json +1 -1
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Checkbox as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
const
|
|
5
|
-
propertyName:
|
|
6
|
-
label:
|
|
7
|
-
validate:
|
|
8
|
-
required:
|
|
1
|
+
import { jsx as e, jsxs as C, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as d, TypoCaption as g } from "@element/react-components";
|
|
3
|
+
import { useFormContext as i, Controller as k } from "react-hook-form";
|
|
4
|
+
const F = ({
|
|
5
|
+
propertyName: t,
|
|
6
|
+
label: n,
|
|
7
|
+
validate: c,
|
|
8
|
+
required: m,
|
|
9
9
|
onChange: s,
|
|
10
|
-
disabled:
|
|
10
|
+
disabled: a
|
|
11
11
|
}) => {
|
|
12
|
-
const { control:
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
12
|
+
const { control: h } = i();
|
|
13
|
+
return /* @__PURE__ */ e(
|
|
14
|
+
k,
|
|
15
15
|
{
|
|
16
|
-
name:
|
|
17
|
-
control:
|
|
16
|
+
name: t,
|
|
17
|
+
control: h,
|
|
18
18
|
rules: {
|
|
19
|
-
required:
|
|
20
|
-
validate:
|
|
19
|
+
required: m,
|
|
20
|
+
validate: c
|
|
21
21
|
},
|
|
22
|
-
render: ({ field: r, fieldState:
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
22
|
+
render: ({ field: r, fieldState: o }) => /* @__PURE__ */ C(p, { children: [
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
d,
|
|
25
25
|
{
|
|
26
|
+
"data-testid": "checkbox",
|
|
26
27
|
...r,
|
|
27
|
-
label:
|
|
28
|
-
onChange: (...
|
|
29
|
-
r.onChange(...
|
|
28
|
+
label: n,
|
|
29
|
+
onChange: (...x) => {
|
|
30
|
+
r.onChange(...x), s?.();
|
|
30
31
|
},
|
|
31
32
|
checked: r.value,
|
|
32
|
-
disabled:
|
|
33
|
+
disabled: a
|
|
33
34
|
}
|
|
34
35
|
),
|
|
35
|
-
|
|
36
|
+
o.error && /* @__PURE__ */ e(g, { "data-testid": "checkbox-error-message", themeColor: "error", children: o.error.message })
|
|
36
37
|
] })
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
40
|
};
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
F as FormCheckBox
|
|
42
43
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Radio as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
const
|
|
5
|
-
const { control:
|
|
6
|
-
const e =
|
|
7
|
-
|
|
1
|
+
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { Radio as d } from "@element/react-components";
|
|
3
|
+
import { useFormContext as c, Controller as s } from "react-hook-form";
|
|
4
|
+
const g = ({ propertyName: l, options: t }) => {
|
|
5
|
+
const { control: n, setValue: o } = c(), u = (a) => {
|
|
6
|
+
const e = a.target.value;
|
|
7
|
+
o(l, e);
|
|
8
8
|
};
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
|
|
9
|
+
return /* @__PURE__ */ r(
|
|
10
|
+
s,
|
|
11
11
|
{
|
|
12
12
|
name: l,
|
|
13
|
-
control:
|
|
14
|
-
render: (
|
|
15
|
-
|
|
13
|
+
control: n,
|
|
14
|
+
render: (a) => /* @__PURE__ */ r(m, { children: t.map((e) => /* @__PURE__ */ r(
|
|
15
|
+
d,
|
|
16
16
|
{
|
|
17
|
+
"data-testid": "radio",
|
|
17
18
|
name: e.value,
|
|
18
19
|
value: e.value,
|
|
19
|
-
checked:
|
|
20
|
+
checked: a.field.value === e.value,
|
|
20
21
|
label: e.label,
|
|
21
22
|
onChange: u
|
|
22
23
|
},
|
|
@@ -26,5 +27,5 @@ const h = ({ propertyName: l, options: n }) => {
|
|
|
26
27
|
);
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
g as FormRadio
|
|
30
31
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r, jsxs as B } from "react/jsx-runtime";
|
|
2
|
-
import { Elevation as D, Table as G, TableTopBar as u, Group as m, Padding as W, TypoDisplay as
|
|
3
|
-
import { Fragment as
|
|
2
|
+
import { Elevation as D, Table as G, TableTopBar as u, Group as m, Padding as W, TypoDisplay as $, TypoSubtitle as k } from "@element/react-components";
|
|
3
|
+
import { Fragment as C } from "react";
|
|
4
4
|
import { a as t } from "../../genericTable.module-Dk3yy2S3.js";
|
|
5
|
-
import { u as
|
|
5
|
+
import { u as j } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
6
6
|
import "../../alertBanner.module-BPiKN0gh.js";
|
|
7
7
|
import "../../iconify.module-C89oaw5b.js";
|
|
8
8
|
import "../../isArray-Ca4KR8TK.js";
|
|
@@ -32,16 +32,16 @@ import "react-hook-form";
|
|
|
32
32
|
import "../../formDatePicker.module-BV3ma_7y.js";
|
|
33
33
|
import "../../formSelect.module-DMHh1bp8.js";
|
|
34
34
|
import "../../formText.module-C0by6_DK.js";
|
|
35
|
-
import { useGenerateColumns as
|
|
35
|
+
import { useGenerateColumns as x, useGenerateTableData as _ } from "./GenericTableService.js";
|
|
36
36
|
import { GenericCardList as A } from "./Mobile/GenericCardList.js";
|
|
37
|
-
const
|
|
38
|
-
data:
|
|
39
|
-
hiddenColumns:
|
|
37
|
+
const gr = ({
|
|
38
|
+
data: l = [],
|
|
39
|
+
hiddenColumns: n = [],
|
|
40
40
|
order: f = [],
|
|
41
|
-
cellTemplates:
|
|
41
|
+
cellTemplates: g = void 0,
|
|
42
42
|
tableActions: i = [],
|
|
43
|
-
noContentText:
|
|
44
|
-
headerTranslation:
|
|
43
|
+
noContentText: p = "No data available",
|
|
44
|
+
headerTranslation: h = (a) => a,
|
|
45
45
|
pagination: y = !1,
|
|
46
46
|
getRowActions: s = void 0,
|
|
47
47
|
customColumnWidth: b,
|
|
@@ -49,35 +49,36 @@ const hr = ({
|
|
|
49
49
|
cardTitleColumn: v,
|
|
50
50
|
cardSubTitleColumn: T
|
|
51
51
|
}) => {
|
|
52
|
-
const { isDesktop:
|
|
53
|
-
data:
|
|
52
|
+
const { isDesktop: a } = j(), o = x({
|
|
53
|
+
data: l,
|
|
54
54
|
order: f,
|
|
55
|
-
cellTemplates:
|
|
56
|
-
headerTranslation:
|
|
55
|
+
cellTemplates: g,
|
|
56
|
+
headerTranslation: h,
|
|
57
57
|
getRowActions: s,
|
|
58
58
|
customColumnWidth: b,
|
|
59
59
|
cardTitleColumn: v,
|
|
60
60
|
cardSubTitleColumn: T
|
|
61
|
-
}),
|
|
62
|
-
data:
|
|
61
|
+
}), d = _({
|
|
62
|
+
data: l,
|
|
63
63
|
getRowActions: s
|
|
64
64
|
});
|
|
65
|
-
return
|
|
65
|
+
return a ? /* @__PURE__ */ r(D, { elevation: 1, className: t.elevation, "data-testid": "generic-table-elevation", children: /* @__PURE__ */ r(
|
|
66
66
|
G,
|
|
67
67
|
{
|
|
68
|
+
"data-testid": `generic-table${e ? "-" + e : ""}`,
|
|
68
69
|
className: t.table,
|
|
69
70
|
fullWidth: !0,
|
|
70
71
|
alwaysUseDivTags: !0,
|
|
71
72
|
layout: "standard",
|
|
72
|
-
hiddenColumns:
|
|
73
|
-
data:
|
|
74
|
-
columns:
|
|
73
|
+
hiddenColumns: n,
|
|
74
|
+
data: d,
|
|
75
|
+
columns: o,
|
|
75
76
|
leadingContent: e && i?.length === 0 ? /* @__PURE__ */ r(u, { title: e }) : i?.length > 0 && /* @__PURE__ */ r(
|
|
76
77
|
u,
|
|
77
78
|
{
|
|
78
79
|
className: t.topBar,
|
|
79
80
|
filterBar: /* @__PURE__ */ B(m, { fullWidth: !0, direction: "vertical", gap: "none", children: [
|
|
80
|
-
e && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
81
|
+
e && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r($, { level: 6, children: e }) }),
|
|
81
82
|
/* @__PURE__ */ r(
|
|
82
83
|
m,
|
|
83
84
|
{
|
|
@@ -85,7 +86,7 @@ const hr = ({
|
|
|
85
86
|
fullWidth: !0,
|
|
86
87
|
primaryAlign: "end",
|
|
87
88
|
secondaryAlign: "center",
|
|
88
|
-
children: i.map((
|
|
89
|
+
children: i.map((c, N) => /* @__PURE__ */ r(C, { children: c }, `action_${N}_${c.key}`))
|
|
89
90
|
}
|
|
90
91
|
)
|
|
91
92
|
] })
|
|
@@ -93,7 +94,7 @@ const hr = ({
|
|
|
93
94
|
),
|
|
94
95
|
paginated: y,
|
|
95
96
|
sortable: !0,
|
|
96
|
-
noContentIncludeTable: !!
|
|
97
|
+
noContentIncludeTable: !!o,
|
|
97
98
|
noContentMessage: /* @__PURE__ */ r(
|
|
98
99
|
m,
|
|
99
100
|
{
|
|
@@ -101,20 +102,20 @@ const hr = ({
|
|
|
101
102
|
primaryAlign: "center",
|
|
102
103
|
secondaryAlign: "center",
|
|
103
104
|
className: t.emptyTable,
|
|
104
|
-
children: /* @__PURE__ */ r(
|
|
105
|
+
children: /* @__PURE__ */ r(k, { children: p })
|
|
105
106
|
}
|
|
106
107
|
)
|
|
107
108
|
}
|
|
108
|
-
) }) : /* @__PURE__ */ r(
|
|
109
|
+
) }) : /* @__PURE__ */ r("div", { "data-testid": `generic-card-list${e ? "-" + e : ""}`, children: /* @__PURE__ */ r(
|
|
109
110
|
A,
|
|
110
111
|
{
|
|
111
|
-
data:
|
|
112
|
-
columns:
|
|
113
|
-
hiddenColumns:
|
|
114
|
-
noContentText:
|
|
112
|
+
data: d,
|
|
113
|
+
columns: o,
|
|
114
|
+
hiddenColumns: n,
|
|
115
|
+
noContentText: p
|
|
115
116
|
}
|
|
116
|
-
);
|
|
117
|
+
) });
|
|
117
118
|
};
|
|
118
119
|
export {
|
|
119
|
-
|
|
120
|
+
gr as GenericTable
|
|
120
121
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import { Card as T, CardContent as v, CardBody as y, Grid as x, GridRow as b, GridCol as n, TypoSubtitle as f, CardTitle as u, CardDivider as N } from "@element/react-components";
|
|
3
3
|
import { useMemo as $ } from "react";
|
|
4
4
|
import { OverflowTooltip as c } from "../../OverflowTooltip/OverflowTooltip.js";
|
|
5
|
-
import { s as
|
|
5
|
+
import { s as i } from "../../../genericCard.module-DrQu86jX.js";
|
|
6
6
|
const h = {
|
|
7
7
|
desktopCol: 6,
|
|
8
8
|
phoneCol: 2,
|
|
9
9
|
tabletCol: 4,
|
|
10
10
|
verticalAlign: "bottom"
|
|
11
|
-
},
|
|
12
|
-
const
|
|
11
|
+
}, A = ({ item: t, columns: r, hiddenColumns: d }) => {
|
|
12
|
+
const s = r.find((a) => a.asCardTitle), p = r.find((a) => a.asCardSubtitle), C = $(
|
|
13
13
|
() => r.filter(
|
|
14
|
-
(
|
|
14
|
+
(a) => !a.asCardTitle && !a.asCardSubtitle && a.id !== "actions"
|
|
15
15
|
),
|
|
16
16
|
[r]
|
|
17
17
|
);
|
|
18
|
-
return /* @__PURE__ */ e(T, { variant: "raised", children: /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ e(k, { item: t, titleColumn:
|
|
20
|
-
/* @__PURE__ */ e(y, { className:
|
|
21
|
-
/* @__PURE__ */ e(n, { horizontalAlign: "right", ...h, children: /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ e(T, { variant: "raised", "data-testid": `card${s ? "-" + t[s.accessor] : ""}`, children: /* @__PURE__ */ l(v, { className: i.cardContent, "data-testid": "card-content", children: [
|
|
19
|
+
/* @__PURE__ */ e(k, { item: t, titleColumn: s, subTitleColumn: p }),
|
|
20
|
+
/* @__PURE__ */ e(y, { className: i.cardBody, "data-testid": "card-body", children: /* @__PURE__ */ e(x, { fullHeight: !0, fullWidth: !0, variant: "none", children: C.map((a) => d?.includes(a.id) ? null : /* @__PURE__ */ l(b, { className: i.row, "data-testid": "row", children: [
|
|
21
|
+
/* @__PURE__ */ e(n, { horizontalAlign: "right", ...h, children: /* @__PURE__ */ l(
|
|
22
22
|
f,
|
|
23
23
|
{
|
|
24
24
|
level: 2,
|
|
25
25
|
themeColor: "text-secondary-on-background",
|
|
26
|
-
className: `${
|
|
26
|
+
className: `${i.font} ${i.fontHeader}`,
|
|
27
27
|
tag: "div",
|
|
28
28
|
children: [
|
|
29
|
-
|
|
29
|
+
a.header,
|
|
30
30
|
":"
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
33
|
) }),
|
|
34
|
-
/* @__PURE__ */ e(n, { horizontalAlign: "left", ...h, children: /* @__PURE__ */ e(o, { column:
|
|
35
|
-
] },
|
|
34
|
+
/* @__PURE__ */ e(n, { horizontalAlign: "left", ...h, children: /* @__PURE__ */ e(o, { column: a, item: t }) })
|
|
35
|
+
] }, a.id)) }) })
|
|
36
36
|
] }) });
|
|
37
37
|
}, k = ({ item: t, titleColumn: r, subTitleColumn: d }) => {
|
|
38
|
-
const
|
|
39
|
-
return !r && !d && !
|
|
38
|
+
const s = t.actions;
|
|
39
|
+
return !r && !d && !s ? null : /* @__PURE__ */ l(g, { children: [
|
|
40
40
|
/* @__PURE__ */ e(
|
|
41
41
|
u,
|
|
42
42
|
{
|
|
43
43
|
"data-testid": "card-title",
|
|
44
|
-
className:
|
|
44
|
+
className: i.cardTitle,
|
|
45
45
|
primaryText: r !== void 0 && /* @__PURE__ */ e(o, { column: r, item: t, isTitle: !0 }),
|
|
46
46
|
secondaryText: d !== void 0 && /* @__PURE__ */ e(o, { column: d, item: t, isTitle: !0 }),
|
|
47
|
-
trailingBlock:
|
|
47
|
+
trailingBlock: s,
|
|
48
48
|
trailingBlockType: "title-actions"
|
|
49
49
|
}
|
|
50
50
|
),
|
|
@@ -55,16 +55,16 @@ const h = {
|
|
|
55
55
|
{
|
|
56
56
|
id: `tip_${r.id}_${t[r.accessor]}`,
|
|
57
57
|
text: t[r.accessor],
|
|
58
|
-
children: /* @__PURE__ */ e("span", { className:
|
|
58
|
+
children: /* @__PURE__ */ e("span", { className: i.title, children: t[r.accessor] })
|
|
59
59
|
}
|
|
60
60
|
) : /* @__PURE__ */ e(
|
|
61
61
|
c,
|
|
62
62
|
{
|
|
63
63
|
id: `tip_${r.id}_${t[r.accessor]}`,
|
|
64
64
|
text: t[r.accessor],
|
|
65
|
-
children: /* @__PURE__ */ e(f, { level: 2, themeColor: "text-primary-on-background", className:
|
|
65
|
+
children: /* @__PURE__ */ e(f, { level: 2, themeColor: "text-primary-on-background", className: i.font, children: t[r.accessor] })
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
export {
|
|
69
|
-
|
|
69
|
+
A as GenericCard
|
|
70
70
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { TypoBody as
|
|
1
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { TypoBody as e } from "@element/react-components";
|
|
3
3
|
import { s as r } from "../../../bigLoadingSpinner.module-GgbFol8k.js";
|
|
4
4
|
import { I as n } from "../../../Iconify-CY9lZjFd.js";
|
|
5
|
-
const s = ({ text:
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
] }),
|
|
5
|
+
const s = ({ text: o }) => /* @__PURE__ */ a("div", { className: r.bigLoadSpinnerCard, role: "progressbar", "data-testid": "loading-spinner", children: [
|
|
6
|
+
/* @__PURE__ */ i(n, { icon: "hortiview", className: r.logo, "data-testid": "logo-icon" }),
|
|
7
|
+
/* @__PURE__ */ i(e, { tag: "p", bold: !0, level: 1, className: r.bigLoadSpinnerCardText, children: o })
|
|
8
|
+
] }), p = (o) => /* @__PURE__ */ i("div", { className: r.loadingBigOverlay, children: /* @__PURE__ */ i(s, { ...o }) });
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
p as BigLoadingSpinner
|
|
11
11
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { CircularProgress as
|
|
3
|
-
import { BigLoadingSpinner as
|
|
4
|
-
import { s as
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { CircularProgress as t, Padding as l, Group as g, TypoBody as m } from "@element/react-components";
|
|
3
|
+
import { BigLoadingSpinner as p } from "../Big/BigLoadingSpinner.js";
|
|
4
|
+
import { s as c } from "../../../loadingSpinner.module-CLtqSMWA.js";
|
|
5
5
|
const C = ({
|
|
6
6
|
size: i,
|
|
7
|
-
center:
|
|
7
|
+
center: o = !1,
|
|
8
8
|
text: e = "Loading",
|
|
9
9
|
textPosition: a = "bottom",
|
|
10
10
|
color: n = "primary",
|
|
11
11
|
spinnerOnly: d = !1
|
|
12
|
-
}) => i === "big" ? /* @__PURE__ */ r(
|
|
13
|
-
|
|
12
|
+
}) => i === "big" ? /* @__PURE__ */ r(p, { text: e }) : d ? /* @__PURE__ */ r(t, { "data-testid": "loading-spinner", themeColor: n, indicatorSize: i ?? "md" }) : /* @__PURE__ */ r(
|
|
13
|
+
l,
|
|
14
14
|
{
|
|
15
15
|
variant: "standard",
|
|
16
16
|
style: { textAlign: "center" },
|
|
17
|
-
className:
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
|
|
17
|
+
className: o ? c.loadingSpinnerContainer : "",
|
|
18
|
+
children: /* @__PURE__ */ s(
|
|
19
|
+
g,
|
|
20
20
|
{
|
|
21
21
|
direction: a === "right" ? "horizontal" : "vertical",
|
|
22
22
|
gap: "dense",
|
|
23
23
|
primaryAlign: "center",
|
|
24
24
|
secondaryAlign: "center",
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */ r(
|
|
27
|
-
/* @__PURE__ */ r(
|
|
26
|
+
/* @__PURE__ */ r(t, { "data-testid": "loading-spinner", themeColor: n, indicatorSize: i ?? "lg" }),
|
|
27
|
+
/* @__PURE__ */ r(m, { themeColor: `text-${n}-on-background`, tag: "div", children: e })
|
|
28
28
|
]
|
|
29
29
|
}
|
|
30
30
|
)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hortiview/shared-components",
|
|
3
3
|
"description": "This is a shared component library. It should used in the HortiView platform and its modules.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8519",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
|
|
7
7
|
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|