@hortiview/shared-components 2.10.1 → 2.10.2
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/CHANGELOG.md +11 -0
- package/dist/assets/GenericTable.css +1 -1
- package/dist/components/BasicHeading/BasicHeading.js +27 -27
- package/dist/components/GenericTable/GenericTable.js +1 -1
- package/dist/components/GenericTable/GenericTableService.js +37 -31
- package/dist/types/GenericTable.d.ts +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.10.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.10.1...v2.10.2) (2026-01-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* column width ([4a5f60a](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/4a5f60a263765fee170859fcb4162343be9bf326))
|
|
6
|
+
* fixed basic heading classname ([13af9e1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/13af9e192b104ea036dc4d1f125144639dbd7205))
|
|
7
|
+
|
|
8
|
+
### Styles
|
|
9
|
+
|
|
10
|
+
* actions column sticked left ([c90e1c1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/c90e1c10b8e5197cf15a0cb3f8606ed9f76197df))
|
|
11
|
+
|
|
1
12
|
## [2.10.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.10.0...v2.10.1) (2026-01-06)
|
|
2
13
|
|
|
3
14
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._topBar_47g7x_1 [class*=lmnt-table__top-bar__title]{display:none}._filterBar_47g7x_5{padding:1rem;width:inherit!important}._start_47g7x_10{padding-top:0;padding-bottom:0}._emptyTable_47g7x_15{height:16rem}[class*=mnt-pagination][class*=mdc-data-table__pagination]{border-top:1px solid var(--lmnt-theme-on-secondary-stroke)}._elevation_47g7x_23{border-radius:.4rem;width:100%}._table_47g7x_28,._table_47g7x_28 [class*=mdc-data-table__table-container]{border-radius:.4rem}._table_47g7x_28 *[id=actions]{width:44px;padding:0 2px;position:sticky;right:0;background-color:var(--lmnt-theme-background)}._table_47g7x_28 tr:hover td[id=actions]{background-color:var(--table-bg-color-hover)}._noBorder_47g7x_48{border:none}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { G as t } from "../../index.es-DsGuBR0Z.js";
|
|
3
3
|
import { I as A } from "../../index.es-DYs8W4jv.js";
|
|
4
4
|
import { b as I, T as z } from "../../index.es-DCSgIiJH.js";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as m } from "../../index-Cpb-8cAN.js";
|
|
6
6
|
import { Iconify as H } from "../Iconify/Iconify.js";
|
|
7
7
|
import { AvailableCustomIcons as q } from "../../enums/AvailableCustomIcons.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { OverflowTooltip as
|
|
10
|
-
import '../../assets/BasicHeading.css';const
|
|
11
|
-
basicHeading:
|
|
12
|
-
inList:
|
|
8
|
+
import { u as w } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
9
|
+
import { OverflowTooltip as x } from "../OverflowTooltip/OverflowTooltip.js";
|
|
10
|
+
import '../../assets/BasicHeading.css';const C = "_basicHeading_14qaz_1", N = "_inList_14qaz_13", T = "_actions_14qaz_17", B = "_invisible_14qaz_25", L = "_leadingIcon_14qaz_29", W = "_withAvatar_14qaz_33", j = "_iconContainer_14qaz_39", e = {
|
|
11
|
+
basicHeading: C,
|
|
12
|
+
inList: N,
|
|
13
13
|
actions: T,
|
|
14
14
|
invisible: B,
|
|
15
15
|
leadingIcon: L,
|
|
16
16
|
withAvatar: W,
|
|
17
17
|
iconContainer: j
|
|
18
|
-
}, k = ({ icon: i }) => i ? typeof i != "string" ? /* @__PURE__ */
|
|
18
|
+
}, k = ({ icon: i }) => i ? typeof i != "string" ? /* @__PURE__ */ n("div", { className: e.iconContainer, children: i }) : i in q ? /* @__PURE__ */ n(
|
|
19
19
|
H,
|
|
20
20
|
{
|
|
21
21
|
icon: i,
|
|
22
|
-
className:
|
|
22
|
+
className: e.leadingIcon,
|
|
23
23
|
iconSize: "medium",
|
|
24
24
|
iconType: "filled"
|
|
25
25
|
}
|
|
26
|
-
) : /* @__PURE__ */
|
|
26
|
+
) : /* @__PURE__ */ n(A, { iconSize: "medium", iconType: "filled", icon: i, className: e.leadingIcon }) : null, J = ({
|
|
27
27
|
children: i,
|
|
28
|
-
marginBottom:
|
|
28
|
+
marginBottom: s,
|
|
29
29
|
heading: a,
|
|
30
|
-
icon:
|
|
31
|
-
className:
|
|
30
|
+
icon: p,
|
|
31
|
+
className: r,
|
|
32
32
|
subHeading: f,
|
|
33
33
|
subHeadingLevel: g = 2,
|
|
34
34
|
invisibleButton: _ = !1,
|
|
35
|
-
level:
|
|
36
|
-
fontWeight:
|
|
35
|
+
level: c = 5,
|
|
36
|
+
fontWeight: l = 400,
|
|
37
37
|
withAvatar: u = !1,
|
|
38
38
|
inList: y = !1
|
|
39
39
|
}) => {
|
|
40
|
-
const { isDesktop:
|
|
41
|
-
return /* @__PURE__ */
|
|
40
|
+
const { isDesktop: d } = w(), v = d ? c : c + 1, b = l === "bold" ? 500 : l, h = typeof s == "number" ? `${s}px` : "2rem";
|
|
41
|
+
return /* @__PURE__ */ o(
|
|
42
42
|
t,
|
|
43
43
|
{
|
|
44
44
|
primaryAlign: "space-between",
|
|
45
45
|
secondaryAlign: "center",
|
|
46
46
|
gap: "none",
|
|
47
|
-
className:
|
|
47
|
+
className: m(e.basicHeading, y && e.inList, r),
|
|
48
48
|
style: { marginBottom: h },
|
|
49
49
|
"data-testid": "HeaderContainer",
|
|
50
50
|
fullWidth: !0,
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ o(
|
|
53
53
|
t,
|
|
54
54
|
{
|
|
55
55
|
secondaryAlign: "center",
|
|
56
56
|
gap: "none",
|
|
57
|
-
className: `${u &&
|
|
57
|
+
className: `${u && d ? e.withAvatar : ""}`,
|
|
58
58
|
fullWidth: !0,
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ n(k, { icon: p }),
|
|
61
|
+
/* @__PURE__ */ o(t, { direction: "vertical", gap: "none", fullWidth: !0, children: [
|
|
62
|
+
/* @__PURE__ */ n(x, { id: a, text: a, children: /* @__PURE__ */ n(
|
|
63
63
|
I,
|
|
64
64
|
{
|
|
65
65
|
level: v,
|
|
66
66
|
"data-testid": "Header",
|
|
67
|
-
className:
|
|
67
|
+
className: r ?? "",
|
|
68
68
|
style: { fontWeight: b },
|
|
69
69
|
children: a
|
|
70
70
|
}
|
|
71
71
|
) }),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ n(z, { level: g, children: f })
|
|
73
73
|
] })
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
i ? /* @__PURE__ */
|
|
77
|
+
i ? /* @__PURE__ */ n(
|
|
78
78
|
t,
|
|
79
79
|
{
|
|
80
80
|
primaryAlign: "end",
|
|
81
81
|
secondaryAlign: "center",
|
|
82
82
|
gap: "dense",
|
|
83
|
-
className:
|
|
83
|
+
className: m(_ && e.invisible, e.actions),
|
|
84
84
|
"data-testid": "RightPart",
|
|
85
85
|
children: i
|
|
86
86
|
}
|
|
@@ -11493,7 +11493,7 @@ var $g = ["title", "actions", "prominent", "filterBar", "className"], Fa = Fv, R
|
|
|
11493
11493
|
});
|
|
11494
11494
|
Ro.displayName = "TableTopBar";
|
|
11495
11495
|
Ro.propTypes = Mv;
|
|
11496
|
-
const Mg = "
|
|
11496
|
+
const Mg = "_topBar_47g7x_1", Fg = "_filterBar_47g7x_5", Gg = "_start_47g7x_10", zg = "_emptyTable_47g7x_15", Wg = "_elevation_47g7x_23", kg = "_table_47g7x_28", Ug = "_noBorder_47g7x_48", Ln = {
|
|
11497
11497
|
topBar: Mg,
|
|
11498
11498
|
filterBar: Fg,
|
|
11499
11499
|
start: Gg,
|
|
@@ -1,58 +1,64 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { ContextMenu as
|
|
4
|
-
const
|
|
2
|
+
import { useMemo as p } from "react";
|
|
3
|
+
import { ContextMenu as l } from "../ContextMenu/ContextMenu.js";
|
|
4
|
+
const P = ({
|
|
5
5
|
data: r = [],
|
|
6
|
-
order:
|
|
7
|
-
cellTemplates:
|
|
8
|
-
headerTranslation: t = (
|
|
9
|
-
getRowActions:
|
|
6
|
+
order: e = [],
|
|
7
|
+
cellTemplates: n = void 0,
|
|
8
|
+
headerTranslation: t = (d) => d,
|
|
9
|
+
getRowActions: c = void 0,
|
|
10
10
|
customColumnWidth: o,
|
|
11
11
|
cardTitleColumn: u,
|
|
12
12
|
cardSubTitleColumn: s
|
|
13
|
-
}) =>
|
|
13
|
+
}) => p(() => {
|
|
14
14
|
if (r?.length === 0) return [];
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const d = v(r[0], e).map((i) => {
|
|
16
|
+
const f = o ? o[i] : void 0;
|
|
17
17
|
return {
|
|
18
18
|
id: i,
|
|
19
19
|
header: t(i),
|
|
20
20
|
accessor: i,
|
|
21
|
-
cellTemplate:
|
|
22
|
-
cellProps:
|
|
23
|
-
headerCellProps:
|
|
21
|
+
cellTemplate: n ? n[i] : void 0,
|
|
22
|
+
cellProps: f ? { width: f } : void 0,
|
|
23
|
+
headerCellProps: f ? { width: f } : void 0,
|
|
24
24
|
asCardTitle: i === u,
|
|
25
25
|
asCardSubtitle: i === s
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
|
-
return
|
|
29
|
-
...
|
|
30
|
-
{
|
|
31
|
-
|
|
28
|
+
return c ? [
|
|
29
|
+
...d,
|
|
30
|
+
{
|
|
31
|
+
id: "actions",
|
|
32
|
+
header: " ",
|
|
33
|
+
accessor: "actions",
|
|
34
|
+
cellProps: { id: "actions" },
|
|
35
|
+
headerCellProps: { id: "actions" }
|
|
36
|
+
}
|
|
37
|
+
] : d;
|
|
32
38
|
}, [
|
|
33
39
|
r,
|
|
34
|
-
e,
|
|
35
40
|
n,
|
|
41
|
+
e,
|
|
36
42
|
t,
|
|
37
|
-
|
|
43
|
+
c,
|
|
38
44
|
o,
|
|
39
45
|
u,
|
|
40
46
|
s
|
|
41
|
-
]),
|
|
47
|
+
]), C = ({
|
|
42
48
|
data: r = [],
|
|
43
|
-
getRowActions:
|
|
44
|
-
}) =>
|
|
45
|
-
const t = /* @__PURE__ */ a(
|
|
46
|
-
return { ...
|
|
47
|
-
}) : r, [r,
|
|
49
|
+
getRowActions: e = void 0
|
|
50
|
+
}) => p(() => e ? r.map((n) => {
|
|
51
|
+
const t = /* @__PURE__ */ a(l, { actions: e(n), iconOrientation: "horizontal" });
|
|
52
|
+
return { ...n, actions: t };
|
|
53
|
+
}) : r, [r, e]), v = (r, e) => {
|
|
48
54
|
if (!r) return [];
|
|
49
|
-
let
|
|
50
|
-
return
|
|
51
|
-
const o =
|
|
55
|
+
let n = Object.keys(r).map((t) => t);
|
|
56
|
+
return e?.length > 0 && (n = n.sort((t, c) => {
|
|
57
|
+
const o = e.findIndex((s) => s === t), u = e.findIndex((s) => s === c);
|
|
52
58
|
return o === -1 ? 1 : u === -1 ? -1 : o - u;
|
|
53
|
-
})),
|
|
59
|
+
})), n;
|
|
54
60
|
};
|
|
55
61
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
P as useGenerateColumns,
|
|
63
|
+
C as useGenerateTableData
|
|
58
64
|
};
|
|
@@ -183,8 +183,13 @@ export type GenericColumn<T> = {
|
|
|
183
183
|
accessor: keyof T;
|
|
184
184
|
cellTemplate?: (props: CellTemplateProps<T>) => JSX.Element;
|
|
185
185
|
cellProps?: {
|
|
186
|
-
|
|
186
|
+
id?: string;
|
|
187
|
+
width?: string | number;
|
|
187
188
|
};
|
|
188
189
|
asCardTitle?: boolean;
|
|
189
190
|
asCardSubtitle?: boolean;
|
|
191
|
+
headerCellProps?: {
|
|
192
|
+
id?: string;
|
|
193
|
+
width?: string | number;
|
|
194
|
+
};
|
|
190
195
|
};
|
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": "2.10.
|
|
4
|
+
"version": "2.10.2",
|
|
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>",
|