@hortiview/shared-components 2.24.0 → 2.24.1
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
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [2.24.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.24.0...v2.24.1) (2026-05-06)
|
|
2
|
+
|
|
3
|
+
### Code Refactoring
|
|
4
|
+
|
|
5
|
+
* add isHeaderVisibleOnMobile prop to BaseView and update stories ([877f3d0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/877f3d04e7c59964f7b4e34efd38783e5b5ca27f))
|
|
6
|
+
* add tests for header visibility in BaseView on mobile devices ([4ce94fc](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/4ce94fcd192d631b9f61471024e634f672b99e2f))
|
|
7
|
+
* update default value of isHeaderVisibleOnMobile to true in BaseView ([94be513](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/94be5132157bade01a66a885f9c10fed96c06875))
|
|
8
|
+
* update header visibility logic in BaseView for mobile and desktop ([c878166](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/c8781667ddc509180565cece789ccaf5c07abd7e))
|
|
9
|
+
|
|
1
10
|
## [2.24.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.23.5...v2.24.0) (2026-04-30)
|
|
2
11
|
|
|
3
12
|
### Features
|
|
@@ -88,9 +88,13 @@ type BaseViewProps = {
|
|
|
88
88
|
* @default undefined
|
|
89
89
|
*/
|
|
90
90
|
routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
91
|
+
/**
|
|
92
|
+
* isHeaderVisibleOnMobile is true if the header should be visible on mobile devices, @default false
|
|
93
|
+
*/
|
|
94
|
+
isHeaderVisibleOnMobile?: boolean;
|
|
91
95
|
};
|
|
92
96
|
/**
|
|
93
97
|
* `BaseView` is a layout component that displays a main (a list) and a detail section.
|
|
94
98
|
*/
|
|
95
|
-
export declare const BaseView: ({ heading, action, hint, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, titleLevel, detailTitleLevel, pathname, basicHeadingIcon, isOnline, offlineViewProps, noRoundedListItemEdges, routerLinkElement, searchPlaceholder, isGrouped, }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
export declare const BaseView: ({ heading, action, hint, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, titleLevel, detailTitleLevel, pathname, basicHeadingIcon, isOnline, offlineViewProps, noRoundedListItemEdges, routerLinkElement, searchPlaceholder, isGrouped, isHeaderVisibleOnMobile, }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
96
100
|
export {};
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import { jsx as e, Fragment as d, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import { D as
|
|
2
|
+
import { D as $ } from "../../index.es-C27R5Xae.js";
|
|
3
3
|
import { G as s } from "../../index.es-Z0aF-7Cn.js";
|
|
4
|
-
import { P as
|
|
5
|
-
import { c as
|
|
4
|
+
import { P as F } from "../../index.es-DgncYOqO.js";
|
|
5
|
+
import { c as v } from "../../index-Df2FYN-K.js";
|
|
6
6
|
import { useMemo as l } from "react";
|
|
7
|
-
import { BasicHeading as
|
|
8
|
-
import { EmptyView as
|
|
9
|
-
import { ListArea as
|
|
10
|
-
import { useBreakpoints as
|
|
11
|
-
import { OfflineView as
|
|
12
|
-
import { useScrollableInfo as
|
|
13
|
-
import '../../assets/BaseView.css';const
|
|
14
|
-
fullHeight:
|
|
15
|
-
fullWidth:
|
|
16
|
-
heading:
|
|
17
|
-
list:
|
|
18
|
-
desktopList:
|
|
19
|
-
noRoundedCorners:
|
|
20
|
-
detail:
|
|
21
|
-
desktopDetail:
|
|
22
|
-
},
|
|
7
|
+
import { BasicHeading as D } from "../BasicHeading/BasicHeading.js";
|
|
8
|
+
import { EmptyView as M } from "../EmptyView/EmptyView.js";
|
|
9
|
+
import { ListArea as P } from "../ListArea/ListArea.js";
|
|
10
|
+
import { useBreakpoints as T } from "../../hooks/useBreakpoints.js";
|
|
11
|
+
import { OfflineView as q } from "../OfflineView/OfflineView.js";
|
|
12
|
+
import { useScrollableInfo as z } from "./BaseView.service.js";
|
|
13
|
+
import '../../assets/BaseView.css';const J = "_fullHeight_1yui7_1", K = "_fullWidth_1yui7_5", O = "_heading_1yui7_9", Q = "_list_1yui7_18", U = "_desktopList_1yui7_27", X = "_noRoundedCorners_1yui7_32", Y = "_detail_1yui7_36", Z = "_desktopDetail_1yui7_44", i = {
|
|
14
|
+
fullHeight: J,
|
|
15
|
+
fullWidth: K,
|
|
16
|
+
heading: O,
|
|
17
|
+
list: Q,
|
|
18
|
+
desktopList: U,
|
|
19
|
+
noRoundedCorners: X,
|
|
20
|
+
detail: Y,
|
|
21
|
+
desktopDetail: Z
|
|
22
|
+
}, mt = ({
|
|
23
23
|
heading: u,
|
|
24
24
|
action: m = /* @__PURE__ */ e(d, {}),
|
|
25
|
-
hint:
|
|
25
|
+
hint: k = /* @__PURE__ */ e(d, {}),
|
|
26
26
|
elements: f,
|
|
27
27
|
emptyText: h,
|
|
28
|
-
hasSearch:
|
|
29
|
-
isSorted:
|
|
30
|
-
className:
|
|
31
|
-
withAvatar:
|
|
32
|
-
listMaxHeight:
|
|
33
|
-
titleLevel:
|
|
34
|
-
detailTitleLevel:
|
|
28
|
+
hasSearch: y = !0,
|
|
29
|
+
isSorted: L = !0,
|
|
30
|
+
className: b,
|
|
31
|
+
withAvatar: H = !1,
|
|
32
|
+
listMaxHeight: N = "calc(100vh - 220px)",
|
|
33
|
+
titleLevel: W = 5,
|
|
34
|
+
detailTitleLevel: B,
|
|
35
35
|
pathname: r,
|
|
36
|
-
basicHeadingIcon:
|
|
36
|
+
basicHeadingIcon: x,
|
|
37
37
|
isOnline: p = !0,
|
|
38
38
|
offlineViewProps: _,
|
|
39
39
|
noRoundedListItemEdges: g = !0,
|
|
40
|
-
routerLinkElement:
|
|
41
|
-
searchPlaceholder:
|
|
42
|
-
isGrouped:
|
|
40
|
+
routerLinkElement: R,
|
|
41
|
+
searchPlaceholder: A,
|
|
42
|
+
isGrouped: C = !1,
|
|
43
|
+
isHeaderVisibleOnMobile: I = !0
|
|
43
44
|
}) => {
|
|
44
|
-
const { isDesktopNavbar: o, isDesktop:
|
|
45
|
+
const { isDesktopNavbar: o, isDesktop: w } = T(), n = l(() => f.filter((a) => a.isAllowed !== !1), [f]), t = l(() => n.find((a) => a.route === r), [r, n]), S = l(() => p ? t?.component ? t.component : o ? /* @__PURE__ */ e(F, { className: i.fullWidth, children: /* @__PURE__ */ e(M, { title: h }) }) : /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(q, { ..._, fullWidth: !0 }), [t?.component, h, o, p, _]), { showList: E, showDetail: j } = l(() => o ? { showList: !0, showDetail: !0 } : { showList: !t, showDetail: !!t }, [t, o]), { ref: G, hasScrolled: V } = z([
|
|
45
46
|
r,
|
|
46
47
|
o
|
|
47
48
|
]);
|
|
@@ -49,82 +50,82 @@ import '../../assets/BaseView.css';const z = "_fullHeight_1yui7_1", J = "_fullWi
|
|
|
49
50
|
s,
|
|
50
51
|
{
|
|
51
52
|
"data-testid": "base-view-container",
|
|
52
|
-
className: `${
|
|
53
|
+
className: `${w ? i.fullHeight : ""} ${b ?? ""}`,
|
|
53
54
|
fullWidth: !0,
|
|
54
55
|
children: [
|
|
55
|
-
|
|
56
|
+
E && /* @__PURE__ */ c(
|
|
56
57
|
s,
|
|
57
58
|
{
|
|
58
59
|
"data-testid": "show-list-container",
|
|
59
60
|
gap: "none",
|
|
60
61
|
direction: "vertical",
|
|
61
|
-
className:
|
|
62
|
+
className: v(
|
|
62
63
|
i.list,
|
|
63
64
|
o && i.desktopList,
|
|
64
65
|
g && i.noRoundedCorners
|
|
65
66
|
),
|
|
66
67
|
children: [
|
|
67
68
|
u && /* @__PURE__ */ e(
|
|
68
|
-
|
|
69
|
+
D,
|
|
69
70
|
{
|
|
70
|
-
icon:
|
|
71
|
+
icon: x,
|
|
71
72
|
"data-testid": "heading",
|
|
72
73
|
heading: u,
|
|
73
|
-
level:
|
|
74
|
+
level: W,
|
|
74
75
|
marginBottom: 0,
|
|
75
76
|
inList: !0,
|
|
76
77
|
children: m
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
|
-
|
|
80
|
+
k,
|
|
80
81
|
/* @__PURE__ */ e(
|
|
81
|
-
|
|
82
|
+
P,
|
|
82
83
|
{
|
|
83
84
|
hasLastItemNoRoundedEdges: g,
|
|
84
85
|
elements: n,
|
|
85
|
-
hasSearch:
|
|
86
|
-
maxHeight:
|
|
87
|
-
isSorted:
|
|
86
|
+
hasSearch: y,
|
|
87
|
+
maxHeight: N,
|
|
88
|
+
isSorted: L,
|
|
88
89
|
pathname: r,
|
|
89
|
-
routerLinkElement:
|
|
90
|
-
searchPlaceholder:
|
|
91
|
-
isGrouped:
|
|
90
|
+
routerLinkElement: R,
|
|
91
|
+
searchPlaceholder: A,
|
|
92
|
+
isGrouped: C
|
|
92
93
|
}
|
|
93
94
|
)
|
|
94
95
|
]
|
|
95
96
|
}
|
|
96
97
|
),
|
|
97
|
-
|
|
98
|
+
j && /* @__PURE__ */ c(
|
|
98
99
|
s,
|
|
99
100
|
{
|
|
100
101
|
"data-testid": "show-details-container",
|
|
101
102
|
gap: "none",
|
|
102
103
|
direction: "vertical",
|
|
103
|
-
className:
|
|
104
|
+
className: v(i.detail, o && i.desktopDetail),
|
|
104
105
|
children: [
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
|
|
106
|
+
(I || w) && /* @__PURE__ */ e(
|
|
107
|
+
D,
|
|
107
108
|
{
|
|
108
109
|
className: i.heading,
|
|
109
110
|
heading: t?.detailTitle ?? t?.title ?? "",
|
|
110
|
-
level:
|
|
111
|
+
level: B,
|
|
111
112
|
icon: t?.hideIconInDetail === !0 ? void 0 : t?.detailIcon ?? t?.icon,
|
|
112
113
|
marginBottom: 0,
|
|
113
114
|
invisibleButton: t?.detailAction === void 0,
|
|
114
|
-
withAvatar:
|
|
115
|
+
withAvatar: H,
|
|
115
116
|
subHeading: t?.detailSubTitle,
|
|
116
117
|
children: t?.detailAction ?? m
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
|
-
|
|
120
|
+
V && /* @__PURE__ */ e($, {}),
|
|
120
121
|
/* @__PURE__ */ e(
|
|
121
122
|
s,
|
|
122
123
|
{
|
|
123
124
|
"data-testid": "base-view-show-details-scroll-component-group",
|
|
124
125
|
fullWidth: !0,
|
|
125
126
|
direction: "vertical",
|
|
126
|
-
ref:
|
|
127
|
-
children:
|
|
127
|
+
ref: G,
|
|
128
|
+
children: S
|
|
128
129
|
}
|
|
129
130
|
)
|
|
130
131
|
]
|
|
@@ -135,5 +136,5 @@ import '../../assets/BaseView.css';const z = "_fullHeight_1yui7_1", J = "_fullWi
|
|
|
135
136
|
);
|
|
136
137
|
};
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
+
mt as BaseView
|
|
139
140
|
};
|
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.24.
|
|
4
|
+
"version": "2.24.1",
|
|
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>",
|