@hortiview/shared-components 2.24.0 → 2.24.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 CHANGED
@@ -1,3 +1,25 @@
1
+ ## [2.24.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.24.1...v2.24.2) (2026-05-06)
2
+
3
+ ### Bug Fixes
4
+
5
+ * disable cancel button when delete is pending ([538317e](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/538317e474c0ce894eef736a9675a48279c1fa76))
6
+ * mandatory isDeletePending prop ([96ee69b](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/96ee69bc4019b299a9da7901dad6bb69a9147ace))
7
+ * mandatory isLoading prop ([1fd0cb2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/1fd0cb241ce44f7ffc176b444be72708df214de1))
8
+ * mandatory isStepLoading prop ([67b7d3b](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/67b7d3bed2e962ddd904559642042c20ae3d2f24))
9
+
10
+ ### Styles
11
+
12
+ * ensure loading spinner can always have full size ([4c155f1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/4c155f1d4ca875a2ef5ec70373018444384133b9))
13
+
14
+ ## [2.24.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.24.0...v2.24.1) (2026-05-06)
15
+
16
+ ### Code Refactoring
17
+
18
+ * add isHeaderVisibleOnMobile prop to BaseView and update stories ([877f3d0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/877f3d04e7c59964f7b4e34efd38783e5b5ca27f))
19
+ * add tests for header visibility in BaseView on mobile devices ([4ce94fc](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/4ce94fcd192d631b9f61471024e634f672b99e2f))
20
+ * update default value of isHeaderVisibleOnMobile to true in BaseView ([94be513](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/94be5132157bade01a66a885f9c10fed96c06875))
21
+ * update header visibility logic in BaseView for mobile and desktop ([c878166](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/c8781667ddc509180565cece789ccaf5c07abd7e))
22
+
1
23
  ## [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
24
 
3
25
  ### Features
@@ -28,7 +28,7 @@ export type AllowedButtonProps = Omit<ButtonProps & React.HTMLProps<HTMLButtonEl
28
28
  * If true, the button shows a loading spinner instead of the label.
29
29
  * While true, the button is disabled.
30
30
  */
31
- isLoading?: boolean;
31
+ isLoading: boolean;
32
32
  /**
33
33
  * Can be a string or JSX.Element for setting a loading spinner or custom component.
34
34
  */
@@ -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 V } from "../../index.es-C27R5Xae.js";
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 $ } from "../../index.es-DgncYOqO.js";
5
- import { c as w } from "../../index-Df2FYN-K.js";
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 v } from "../BasicHeading/BasicHeading.js";
8
- import { EmptyView as F } from "../EmptyView/EmptyView.js";
9
- import { ListArea as M } from "../ListArea/ListArea.js";
10
- import { useBreakpoints as P } from "../../hooks/useBreakpoints.js";
11
- import { OfflineView as T } from "../OfflineView/OfflineView.js";
12
- import { useScrollableInfo as q } from "./BaseView.service.js";
13
- import '../../assets/BaseView.css';const z = "_fullHeight_1yui7_1", J = "_fullWidth_1yui7_5", K = "_heading_1yui7_9", O = "_list_1yui7_18", Q = "_desktopList_1yui7_27", U = "_noRoundedCorners_1yui7_32", X = "_detail_1yui7_36", Y = "_desktopDetail_1yui7_44", i = {
14
- fullHeight: z,
15
- fullWidth: J,
16
- heading: K,
17
- list: O,
18
- desktopList: Q,
19
- noRoundedCorners: U,
20
- detail: X,
21
- desktopDetail: Y
22
- }, ut = ({
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: D = /* @__PURE__ */ e(d, {}),
25
+ hint: k = /* @__PURE__ */ e(d, {}),
26
26
  elements: f,
27
27
  emptyText: h,
28
- hasSearch: k = !0,
29
- isSorted: y = !0,
30
- className: L,
31
- withAvatar: b = !1,
32
- listMaxHeight: H = "calc(100vh - 220px)",
33
- titleLevel: N = 5,
34
- detailTitleLevel: W,
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: B,
36
+ basicHeadingIcon: x,
37
37
  isOnline: p = !0,
38
38
  offlineViewProps: _,
39
39
  noRoundedListItemEdges: g = !0,
40
- routerLinkElement: x,
41
- searchPlaceholder: R,
42
- isGrouped: A = !1
40
+ routerLinkElement: R,
41
+ searchPlaceholder: A,
42
+ isGrouped: C = !1,
43
+ isHeaderVisibleOnMobile: I = !0
43
44
  }) => {
44
- const { isDesktopNavbar: o, isDesktop: C } = P(), n = l(() => f.filter((a) => a.isAllowed !== !1), [f]), t = l(() => n.find((a) => a.route === r), [r, n]), I = l(() => p ? t?.component ? t.component : o ? /* @__PURE__ */ e($, { className: i.fullWidth, children: /* @__PURE__ */ e(F, { title: h }) }) : /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(T, { ..._, fullWidth: !0 }), [t?.component, h, o, p, _]), { showList: S, showDetail: E } = l(() => o ? { showList: !0, showDetail: !0 } : { showList: !t, showDetail: !!t }, [t, o]), { ref: j, hasScrolled: G } = q([
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: `${C ? i.fullHeight : ""} ${L ?? ""}`,
53
+ className: `${w ? i.fullHeight : ""} ${b ?? ""}`,
53
54
  fullWidth: !0,
54
55
  children: [
55
- S && /* @__PURE__ */ c(
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: w(
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
- v,
69
+ D,
69
70
  {
70
- icon: B,
71
+ icon: x,
71
72
  "data-testid": "heading",
72
73
  heading: u,
73
- level: N,
74
+ level: W,
74
75
  marginBottom: 0,
75
76
  inList: !0,
76
77
  children: m
77
78
  }
78
79
  ),
79
- D,
80
+ k,
80
81
  /* @__PURE__ */ e(
81
- M,
82
+ P,
82
83
  {
83
84
  hasLastItemNoRoundedEdges: g,
84
85
  elements: n,
85
- hasSearch: k,
86
- maxHeight: H,
87
- isSorted: y,
86
+ hasSearch: y,
87
+ maxHeight: N,
88
+ isSorted: L,
88
89
  pathname: r,
89
- routerLinkElement: x,
90
- searchPlaceholder: R,
91
- isGrouped: A
90
+ routerLinkElement: R,
91
+ searchPlaceholder: A,
92
+ isGrouped: C
92
93
  }
93
94
  )
94
95
  ]
95
96
  }
96
97
  ),
97
- E && /* @__PURE__ */ c(
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: w(i.detail, o && i.desktopDetail),
104
+ className: v(i.detail, o && i.desktopDetail),
104
105
  children: [
105
- /* @__PURE__ */ e(
106
- v,
106
+ (I || w) && /* @__PURE__ */ e(
107
+ D,
107
108
  {
108
109
  className: i.heading,
109
110
  heading: t?.detailTitle ?? t?.title ?? "",
110
- level: W,
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: b,
115
+ withAvatar: H,
115
116
  subHeading: t?.detailSubTitle,
116
117
  children: t?.detailAction ?? m
117
118
  }
118
119
  ),
119
- G && /* @__PURE__ */ e(V, {}),
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: j,
127
- children: I
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
- ut as BaseView
139
+ mt as BaseView
139
140
  };
@@ -63,7 +63,7 @@ type DeleteModalProps = {
63
63
  /**
64
64
  * Whether the delete action is pending; shows a loading state on the confirm button when true.
65
65
  */
66
- isDeletePending?: boolean;
66
+ isDeletePending: boolean;
67
67
  /**
68
68
  * Whether the user is online; shows OfflineView when false.
69
69
  */
@@ -2,10 +2,10 @@ import { jsx as o, jsxs as b, Fragment as c } from "react/jsx-runtime";
2
2
  import { B as f } from "../../index.es-B19PQgzU.js";
3
3
  import { G as m } from "../../index.es-Z0aF-7Cn.js";
4
4
  import { I as S } from "../../index.es-DEBGoIKX.js";
5
- import { T as l } from "../../index.es-DUrjyxNI.js";
6
- import { u as x } from "../../uniqueId-CJo-XRQb.js";
7
- import { AvailableCustomIcons as N } from "../../enums/AvailableCustomIcons.js";
8
- import { useBreakpoints as O } from "../../hooks/useBreakpoints.js";
5
+ import { T as i } from "../../index.es-DUrjyxNI.js";
6
+ import { u as N } from "../../uniqueId-CJo-XRQb.js";
7
+ import { AvailableCustomIcons as O } from "../../enums/AvailableCustomIcons.js";
8
+ import { useBreakpoints as x } from "../../hooks/useBreakpoints.js";
9
9
  import { Iconify as z } from "../Iconify/Iconify.js";
10
10
  import "react";
11
11
  import "../../react-tooltip.min-Dkz5ltCC.js";
@@ -31,7 +31,7 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
31
31
  title: r,
32
32
  confirmButtonLabel: t,
33
33
  cancelButtonLabel: n,
34
- deleteHeader: i,
34
+ deleteHeader: l,
35
35
  deleteBody: a,
36
36
  deleteText: g,
37
37
  icon: h,
@@ -40,18 +40,18 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
40
40
  open: _,
41
41
  setOpen: d,
42
42
  onDelete: C,
43
- onCancel: I,
43
+ onCancel: k,
44
44
  isDeletePossible: p = !0,
45
- isDeletePending: s = !1,
45
+ isDeletePending: s,
46
46
  isOnline: u = !0,
47
- offlineViewProps: k
47
+ offlineViewProps: I
48
48
  }) => {
49
- const { isDesktop: D } = O();
49
+ const { isDesktop: D } = x();
50
50
  return /* @__PURE__ */ o(
51
51
  B,
52
52
  {
53
53
  isOnline: u,
54
- offlineViewProps: k,
54
+ offlineViewProps: I,
55
55
  className: `${e.modal}`,
56
56
  modalSize: D ? "small" : "fullscreen",
57
57
  open: _,
@@ -62,10 +62,9 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
62
62
  {
63
63
  "data-testid": "delete-button",
64
64
  variant: "danger",
65
- label: s ? "" : t,
66
65
  onClick: C,
67
66
  disabled: !p || s || !u,
68
- trailingIcon: s ? /* @__PURE__ */ o(M, { size: "sm", text: "", spinnerOnly: !0 }) : null
67
+ children: s ? /* @__PURE__ */ o(M, { size: "sm", spinnerOnly: !0 }) : t
69
68
  }
70
69
  ),
71
70
  footerSupplemental: /* @__PURE__ */ o(
@@ -75,8 +74,9 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
75
74
  variant: "text",
76
75
  label: n,
77
76
  onClick: () => {
78
- I?.(), d(!1);
79
- }
77
+ k?.(), d(!1);
78
+ },
79
+ disabled: s
80
80
  }
81
81
  ),
82
82
  children: /* @__PURE__ */ b(m, { direction: "vertical", secondaryAlign: "center", children: [
@@ -84,7 +84,7 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
84
84
  /* @__PURE__ */ o(m, { direction: "vertical", children: p ? /* @__PURE__ */ o(
85
85
  L,
86
86
  {
87
- deleteHeader: i,
87
+ deleteHeader: l,
88
88
  deleteText: g,
89
89
  deleteBody: a
90
90
  }
@@ -95,7 +95,7 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
95
95
  }, F = ({
96
96
  element: r,
97
97
  isCrossedOut: t = !1
98
- }) => t ? /* @__PURE__ */ o("span", { className: e.crossedOut, children: r }) : r, H = ({ icon: r }) => r ? typeof r != "string" ? r : Object.values(N).includes(r) ? /* @__PURE__ */ o(
98
+ }) => t ? /* @__PURE__ */ o("span", { className: e.crossedOut, children: r }) : r, H = ({ icon: r }) => r ? typeof r != "string" ? r : Object.values(O).includes(r) ? /* @__PURE__ */ o(
99
99
  z,
100
100
  {
101
101
  icon: r,
@@ -107,22 +107,22 @@ import '../../assets/DeleteModal.css';const j = "_bulletPoint_bd412_1", A = "_mo
107
107
  deleteText: t,
108
108
  deleteBody: n
109
109
  }) => /* @__PURE__ */ b(c, { children: [
110
- /* @__PURE__ */ o(l, { level: 1, themeColor: "text-primary-on-background", children: r }),
111
- t && typeof t == "string" && /* @__PURE__ */ o(l, { level: 2, themeColor: "text-secondary-on-background", children: t }),
110
+ /* @__PURE__ */ o(i, { level: 1, themeColor: "text-primary-on-background", children: r }),
111
+ t && typeof t == "string" && /* @__PURE__ */ o(i, { level: 2, themeColor: "text-secondary-on-background", children: t }),
112
112
  t && typeof t != "string" && /* @__PURE__ */ o(c, { children: t }),
113
- n && t === void 0 && /* @__PURE__ */ o(m, { direction: "vertical", gap: "none", children: n.map((i, a) => /* @__PURE__ */ o(
114
- l,
113
+ n && t === void 0 && /* @__PURE__ */ o(m, { direction: "vertical", gap: "none", children: n.map((l, a) => /* @__PURE__ */ o(
114
+ i,
115
115
  {
116
116
  level: 2,
117
117
  className: e.bulletPoint,
118
118
  themeColor: "text-secondary-on-background",
119
- children: i
119
+ children: l
120
120
  },
121
- x(a.toString())
121
+ N(a.toString())
122
122
  )) })
123
123
  ] }), P = ({
124
124
  impossibleDeleteHeader: r
125
- }) => /* @__PURE__ */ o(l, { level: 1, themeColor: "text-primary-on-background", children: r });
125
+ }) => /* @__PURE__ */ o(i, { level: 1, themeColor: "text-primary-on-background", children: r });
126
126
  export {
127
127
  mo as DeleteModal
128
128
  };
@@ -32,6 +32,6 @@ export declare const StepperPreviousButton: ({ label, variant, onClick, disabled
32
32
  * @returns
33
33
  */
34
34
  export declare const StepperNextButton: ({ label, variant, onClick, disabled, className, isStepLoading, isLastStep, showArrowIcon, leadingIcon, trailingIcon, buttonSize, fullWidth, }: StepperButtonProps & {
35
- isStepLoading?: boolean;
35
+ isStepLoading: boolean;
36
36
  isLastStep?: boolean;
37
37
  }) => import("react/jsx-runtime").JSX.Element;
@@ -125,7 +125,7 @@ export type StepperProps = {
125
125
  /**
126
126
  * Flag which indicates if the current step is loading.
127
127
  */
128
- isStepLoading?: boolean;
128
+ isStepLoading: boolean;
129
129
  /**
130
130
  * An indicator of whether to show the stepper header.
131
131
  * @default true
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.0",
4
+ "version": "2.24.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>",