@hortiview/shared-components 2.8.8 → 2.9.0

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.
Files changed (112) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/{AlertBanner-D-NTP_6i.js → AlertBanner-Dss0v6W0.js} +3 -3
  3. package/dist/{BigLoadingSpinner-CCxsMWnc.js → BigLoadingSpinner-BeHzqdOg.js} +1 -1
  4. package/dist/{GenericCard-DOKyENNm.js → GenericCard-MjxZ1L7r.js} +3 -3
  5. package/dist/ListAreaService-Dx9WBGHB.js +125 -0
  6. package/dist/{OfflineView-DHtzNLwt.js → OfflineView-D168VIXv.js} +3 -3
  7. package/dist/assets/BaseView.css +1 -1
  8. package/dist/assets/BasicHeading.css +1 -1
  9. package/dist/assets/BlockView.css +1 -1
  10. package/dist/assets/ContextMenu.css +1 -1
  11. package/dist/assets/CustomTextField.css +1 -1
  12. package/dist/assets/EmptyView.css +1 -0
  13. package/dist/assets/Filter.css +1 -1
  14. package/dist/assets/FormDatePicker.css +1 -1
  15. package/dist/assets/FormSelect.css +1 -1
  16. package/dist/assets/FormText.css +1 -1
  17. package/dist/assets/HashTabView.css +1 -1
  18. package/dist/assets/InfoGroup.css +1 -1
  19. package/dist/assets/ListAreaService.css +1 -1
  20. package/dist/assets/Modal.css +1 -1
  21. package/dist/assets/OnboardingBanner.css +1 -1
  22. package/dist/assets/Select.css +1 -1
  23. package/dist/components/AlertBanner/AlertBanner.js +4 -4
  24. package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
  25. package/dist/components/AlertBanner/LinkBanner.js +3 -3
  26. package/dist/components/BaseView/BaseView.d.ts +17 -1
  27. package/dist/components/BaseView/BaseView.js +119 -76
  28. package/dist/components/BaseView/BaseView.service.d.ts +7 -0
  29. package/dist/components/BaseView/BaseView.service.js +27 -0
  30. package/dist/components/BaseView/BaseView.test.js +18 -17
  31. package/dist/components/BasicHeading/BasicHeading.d.ts +6 -1
  32. package/dist/components/BasicHeading/BasicHeading.js +57 -53
  33. package/dist/components/BasicHeading/BasicHeading.test.js +24 -24
  34. package/dist/components/BlockView/BlockView.d.ts +15 -3
  35. package/dist/components/BlockView/BlockView.js +69 -58
  36. package/dist/components/ChipCard/ChipCard.js +7 -7
  37. package/dist/components/ContextMenu/ContextMenu.d.ts +2 -0
  38. package/dist/components/ContextMenu/ContextMenu.js +52 -41
  39. package/dist/components/DeleteModal/DeleteModal.js +4 -4
  40. package/dist/components/DetailContentWrapper/DetailContentWrapper.d.ts +18 -3
  41. package/dist/components/DetailContentWrapper/DetailContentWrapper.js +13 -11
  42. package/dist/components/Disclaimer/Disclaimer.js +3 -3
  43. package/dist/components/EmptyView/EmptyView.d.ts +18 -6
  44. package/dist/components/EmptyView/EmptyView.js +37 -309
  45. package/dist/components/EmptyView/EmptyView.test.js +34 -38
  46. package/dist/components/Filter/Filter.d.ts +5 -1
  47. package/dist/components/Filter/Filter.js +113 -98
  48. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
  49. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +4 -4
  50. package/dist/components/FormComponents/FormNumber/CustomTextField.js +21 -20
  51. package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
  52. package/dist/components/FormComponents/FormSelect/FormSelect.js +66 -66
  53. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
  54. package/dist/components/FormComponents/FormSlider/FormSlider.js +3 -3
  55. package/dist/components/FormComponents/FormText/FormText.js +45 -44
  56. package/dist/components/FormComponents/FormToggle/FormToggle.js +3 -3
  57. package/dist/components/GenericTable/GenericTable.js +17 -17
  58. package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
  59. package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
  60. package/dist/components/GenericTable/Mobile/GenericCardList.js +3 -3
  61. package/dist/components/HashTabView/HashTabView.js +119 -117
  62. package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
  63. package/dist/components/Iconify/Iconify.d.ts +4 -0
  64. package/dist/components/Iconify/Iconify.js +1 -1
  65. package/dist/components/InfoCard/InfoCard.js +3 -3
  66. package/dist/components/InfoGroup/InfoGroup.js +47 -38
  67. package/dist/components/ListArea/ListArea.d.ts +6 -2
  68. package/dist/components/ListArea/ListArea.js +37 -32
  69. package/dist/components/ListArea/ListArea.test.js +2 -2
  70. package/dist/components/ListArea/ListAreaService.js +4 -4
  71. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
  72. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
  73. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +4 -4
  74. package/dist/components/Modal/Modal.js +119 -103
  75. package/dist/components/OfflineView/OfflineView.js +4 -4
  76. package/dist/components/OfflineView/OfflineView.test.js +1 -1
  77. package/dist/components/OnboardingBanner/OnboardingBanner.js +35 -33
  78. package/dist/components/OverflowTooltip/OverflowTooltip.js +1 -1
  79. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
  80. package/dist/components/SearchBar/SearchBar.js +2 -2
  81. package/dist/components/Select/Select.js +2 -2
  82. package/dist/components/Stepper/Stepper.js +1 -1
  83. package/dist/components/Stepper/components/StepperButton.js +1 -1
  84. package/dist/components/Stepper/components/StepperHeader.js +2 -2
  85. package/dist/components/Stepper/components/StepperIndicator.js +1 -1
  86. package/dist/{find-B-dm7n_F.js → find-Dpy_M6vm.js} +1 -1
  87. package/dist/{index.es-DObVvepK.js → index.es-BLIkMu0q.js} +2 -2
  88. package/dist/{index.es-DENZVv7_.js → index.es-BLolvOHO.js} +5 -5
  89. package/dist/{index.es-BXj90wb_.js → index.es-BjvSa9Z-.js} +2 -2
  90. package/dist/{index.es-Dfju71Pi.js → index.es-Bus5gEri.js} +1 -1
  91. package/dist/{index.es-IXyb5F6n.js → index.es-BzdG6flH.js} +2 -2
  92. package/dist/{index.es-DqSY-ePE.js → index.es-CXq42ihP.js} +9 -9
  93. package/dist/{index.es-45NOgWlB.js → index.es-CijDQQVg.js} +2 -2
  94. package/dist/{index.es-BGordhUK.js → index.es-DCSgIiJH.js} +1 -1
  95. package/dist/{index.es-D1IpdMde.js → index.es-DDRyb2df.js} +2 -2
  96. package/dist/{index.es-DeF-y7fd.js → index.es-DNRm4vOy.js} +1 -1
  97. package/dist/{index.es-0QJC9VS2.js → index.es-DUcI2Zyr.js} +2 -2
  98. package/dist/{index.es-DwzB1d7_.js → index.es-DYs8W4jv.js} +1 -1
  99. package/dist/{index.es-B6ZgiW2s.js → index.es-D_hWWij3.js} +13 -13
  100. package/dist/{index.es-CK4oZMKs.js → index.es-Dq_bXeGZ.js} +13 -13
  101. package/dist/{index.es-t7hFwQSs.js → index.es-Ds9rRj5B.js} +2 -2
  102. package/dist/{index.es-DDYCugj-.js → index.es-DsGuBR0Z.js} +1 -1
  103. package/dist/{index.es-Bg8hxXM8.js → index.es-P5F6NJPB.js} +360 -255
  104. package/dist/{index.es-Cq04gn3U.js → index.es-b2h35xzk.js} +4 -4
  105. package/dist/{index.es-Bgjh6euR.js → index.es-vqlyMiew.js} +1 -1
  106. package/dist/{keyboard-B-WUULl-.js → keyboard-BfmK7HK_.js} +1 -1
  107. package/dist/main.js +2 -2
  108. package/dist/{map-Dbvlv_6y.js → map-LUrszKZW.js} +2 -2
  109. package/dist/{slicedToArray-BWk2gTCn.js → slicedToArray-uk6yv91z.js} +1 -1
  110. package/package.json +1 -1
  111. package/dist/ListAreaService-CI-s1Xx5.js +0 -124
  112. package/dist/includes-Bt-Stz_B.js +0 -110
@@ -0,0 +1,27 @@
1
+ import { useRef as S, useState as s, useLayoutEffect as E } from "react";
2
+ function T(u = []) {
3
+ const r = S(null), [d, f] = s(!1), [m, v] = s(!1), [p, b] = s(!0), [h, w] = s(!1);
4
+ return E(() => {
5
+ const e = r.current;
6
+ if (!e) return;
7
+ const t = () => {
8
+ const o = e.scrollHeight, a = e.clientHeight, i = e.scrollTop;
9
+ f(o > a + 1), b(i <= 0), v(Math.ceil(i + a) >= o);
10
+ }, n = () => {
11
+ const o = e.scrollTop;
12
+ w(o > 0), t();
13
+ };
14
+ t();
15
+ const L = requestAnimationFrame(t);
16
+ e.addEventListener("scroll", n, { passive: !0 });
17
+ const c = new ResizeObserver(t);
18
+ c.observe(e);
19
+ const l = new MutationObserver(t);
20
+ return l.observe(e, { childList: !0, subtree: !0, characterData: !0 }), window.addEventListener("resize", t), () => {
21
+ cancelAnimationFrame(L), e.removeEventListener("scroll", n), c.disconnect(), l.disconnect(), window.removeEventListener("resize", t);
22
+ };
23
+ }, u), { ref: r, scrollable: d, atTop: p, atBottom: m, hasScrolled: h };
24
+ }
25
+ export {
26
+ T as useScrollableInfo
27
+ };
@@ -1,10 +1,10 @@
1
1
  import { jsx as o, Fragment as s } from "react/jsx-runtime";
2
2
  import { a as n, s as e, f as p } from "../../react.esm-CX1WJ2Pp.js";
3
3
  import { a as l } from "../../useBreakpoints-MzTZ0tCT.js";
4
- import { BaseView as r } from "./BaseView.js";
5
- import { d as u, b as f, a as c, t as i, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
4
+ import { BaseView as i } from "./BaseView.js";
5
+ import { d as u, b as d, a as c, t as r, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
6
6
  u("BaseView Test", () => {
7
- f(() => {
7
+ d(() => {
8
8
  c.spyOn(l, "useBreakpoints").mockReturnValue({
9
9
  isMobile: !1,
10
10
  isTablet: !1,
@@ -37,10 +37,10 @@ u("BaseView Test", () => {
37
37
  component: /* @__PURE__ */ o(s, { children: "Security selected" })
38
38
  }
39
39
  ];
40
- i("render BaseView with empty view and navigation list", () => {
40
+ r("render BaseView with empty view and navigation list", () => {
41
41
  n(
42
42
  /* @__PURE__ */ o(
43
- r,
43
+ i,
44
44
  {
45
45
  pathname: "/personal-profile",
46
46
  elements: a,
@@ -52,10 +52,10 @@ u("BaseView Test", () => {
52
52
  }
53
53
  )
54
54
  ), t(e.getByText("user.noselection")).toBeInTheDocument(), t(e.getByText("user.personal-profile")).toBeInTheDocument(), t(e.getByText("user.personal_information")).toBeInTheDocument(), t(e.getByText("user.data_privacy")).toBeInTheDocument(), t(e.getByText("user.security")).toBeInTheDocument();
55
- }), i("render BaseView with data and navigation list", () => {
55
+ }), r("render BaseView with data and navigation list", () => {
56
56
  n(
57
57
  /* @__PURE__ */ o(
58
- r,
58
+ i,
59
59
  {
60
60
  pathname: "/personal-profile/personal-information",
61
61
  elements: a,
@@ -63,14 +63,15 @@ u("BaseView Test", () => {
63
63
  hasSearch: !1,
64
64
  emptyText: "user.noselection",
65
65
  isSorted: !1,
66
- routerLinkElement: void 0
66
+ routerLinkElement: void 0,
67
+ basicHeadingIcon: "directions_car"
67
68
  }
68
69
  )
69
- ), t(e.getByText("Personal information selected")).toBeInTheDocument(), t(e.getAllByText("account_circle")).toHaveLength(2), t(e.getAllByText("user.personal_information")).toHaveLength(2);
70
- }), i("render BaseView with custom detail title and no detail icon", () => {
70
+ ), t(e.getByText("Personal information selected")).toBeInTheDocument(), t(e.getAllByText("account_circle")).toHaveLength(2), t(e.getAllByText("user.personal_information")).toHaveLength(2), t(e.getByText("directions_car")).toBeInTheDocument();
71
+ }), r("render BaseView with custom detail title and no detail icon", () => {
71
72
  n(
72
73
  /* @__PURE__ */ o(
73
- r,
74
+ i,
74
75
  {
75
76
  pathname: "/personal-profile/data-privacy",
76
77
  elements: a,
@@ -82,7 +83,7 @@ u("BaseView Test", () => {
82
83
  }
83
84
  )
84
85
  ), t(e.getByText("Data Privacy selected")).toBeInTheDocument(), t(e.getByText("Data Privacy 2000")).toBeInTheDocument(), t(e.getAllByText("privacy_tip")).toHaveLength(1), t(e.getAllByText("user.data_privacy")).toHaveLength(1);
85
- }), i("hide empty view when screen is small", () => {
86
+ }), r("hide empty view when screen is small", () => {
86
87
  c.spyOn(l, "useBreakpoints").mockReturnValue({
87
88
  isMobile: !0,
88
89
  isTablet: !1,
@@ -90,7 +91,7 @@ u("BaseView Test", () => {
90
91
  isDesktopNavbar: !1
91
92
  }), n(
92
93
  /* @__PURE__ */ o(
93
- r,
94
+ i,
94
95
  {
95
96
  pathname: "/personal-profile/data-privacy",
96
97
  elements: a,
@@ -102,10 +103,10 @@ u("BaseView Test", () => {
102
103
  }
103
104
  )
104
105
  ), t(e.queryByText("user.noselection")).not.toBeInTheDocument();
105
- }), i("render BaseView with selected detail section", () => {
106
+ }), r("render BaseView with selected detail section", () => {
106
107
  n(
107
108
  /* @__PURE__ */ o(
108
- r,
109
+ i,
109
110
  {
110
111
  pathname: "/personal-profile/data-privacy",
111
112
  elements: a,
@@ -117,10 +118,10 @@ u("BaseView Test", () => {
117
118
  }
118
119
  )
119
120
  ), p.click(e.getAllByRole("option")[1]), t(e.getByText("Data Privacy selected")).toBeInTheDocument();
120
- }), i("renders only offline view when offline", () => {
121
+ }), r("renders only offline view when offline", () => {
121
122
  n(
122
123
  /* @__PURE__ */ o(
123
- r,
124
+ i,
124
125
  {
125
126
  pathname: "/personal-profile/personal-information",
126
127
  elements: a,
@@ -10,7 +10,12 @@ export type BasicHeadingProps = {
10
10
  */
11
11
  marginBottom?: 'large' | number;
12
12
  /**
13
- * the level of the heading, @default 4
13
+ * @deprecated no longer used since it leads to inconsistent paddings
14
+ * Optional custom padding for the header @default "0.75rem"
15
+ */
16
+ customHeaderPadding?: string;
17
+ /**
18
+ * the level of the heading, @default 5
14
19
  */
15
20
  level?: number;
16
21
  /**
@@ -1,79 +1,83 @@
1
- import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
- import { I as u } from "../../index.es-DwzB1d7_.js";
3
- import { b as y, T as C } from "../../index.es-BGordhUK.js";
4
- import { Iconify as w } from "../Iconify/Iconify.js";
5
- import { AvailableCustomIcons as j } from "../../enums/AvailableCustomIcons.js";
6
- import { u as I } from "../../useBreakpoints-MzTZ0tCT.js";
7
- import { OverflowTooltip as B } from "../OverflowTooltip/OverflowTooltip.js";
8
- import '../../assets/BasicHeading.css';const N = "_pageHeader_gwnjc_1", b = "_actionButtonContainer_gwnjc_16", H = "_leadingIcon_gwnjc_31", T = "_headingWrapper_gwnjc_35", x = "_headingContainer_gwnjc_40", A = "_invisible_gwnjc_45", W = "_withAvatar_gwnjc_49", $ = "_iconContainer_gwnjc_54", n = {
9
- pageHeader: N,
10
- actionButtonContainer: b,
11
- leadingIcon: H,
12
- headingWrapper: T,
13
- headingContainer: x,
14
- invisible: A,
15
- withAvatar: W,
16
- iconContainer: $
17
- }, k = ({ icon: e }) => e ? typeof e != "string" ? /* @__PURE__ */ i("div", { className: n.iconContainer, children: e }) : e in j ? /* @__PURE__ */ i(
18
- w,
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { G as t } from "../../index.es-DsGuBR0Z.js";
3
+ import { I as u } from "../../index.es-DYs8W4jv.js";
4
+ import { b as w, T as h } from "../../index.es-DCSgIiJH.js";
5
+ import { c as I } from "../../index-Cpb-8cAN.js";
6
+ import { Iconify as A } from "../Iconify/Iconify.js";
7
+ import { AvailableCustomIcons as H } from "../../enums/AvailableCustomIcons.js";
8
+ import { u as N } from "../../useBreakpoints-MzTZ0tCT.js";
9
+ import { OverflowTooltip as x } from "../OverflowTooltip/OverflowTooltip.js";
10
+ import '../../assets/BasicHeading.css';const C = "_basicHeading_imv0w_1", T = "_actions_imv0w_6", B = "_invisible_imv0w_10", j = "_leadingIcon_imv0w_14", k = "_withAvatar_imv0w_18", z = "_iconContainer_imv0w_24", n = {
11
+ basicHeading: C,
12
+ actions: T,
13
+ invisible: B,
14
+ leadingIcon: j,
15
+ withAvatar: k,
16
+ iconContainer: z
17
+ }, D = ({ icon: i }) => i ? typeof i != "string" ? /* @__PURE__ */ e("div", { className: n.iconContainer, children: i }) : i in H ? /* @__PURE__ */ e(
18
+ A,
19
19
  {
20
- icon: e,
20
+ icon: i,
21
21
  className: n.leadingIcon,
22
- iconSize: "large",
22
+ iconSize: "medium",
23
23
  iconType: "filled"
24
24
  }
25
- ) : /* @__PURE__ */ i(u, { iconSize: "large", iconType: "filled", icon: e, className: n.leadingIcon }) : null, R = ({
26
- children: e,
27
- marginBottom: a,
28
- heading: t,
29
- icon: d,
30
- className: p,
31
- subHeading: r,
25
+ ) : /* @__PURE__ */ e(u, { iconSize: "medium", iconType: "filled", icon: i, className: n.leadingIcon }) : null, q = ({
26
+ children: i,
27
+ marginBottom: s,
28
+ heading: a,
29
+ icon: m,
30
+ className: d,
31
+ subHeading: p,
32
32
  subHeadingLevel: g = 2,
33
- invisibleButton: m = !1,
34
- level: s = 4,
33
+ invisibleButton: f = !1,
34
+ level: r = 5,
35
35
  fontWeight: c = 400,
36
- withAvatar: _ = !1
36
+ withAvatar: v = !1
37
37
  }) => {
38
- const { isDesktop: l } = I(), f = l ? s : s + 1, h = c === "bold" ? 500 : c, v = () => {
39
- if (a !== void 0)
40
- return typeof a == "number" ? `${a}px` : "2rem";
41
- };
38
+ const { isDesktop: l } = N(), y = l ? r : r + 1, _ = c === "bold" ? 500 : c, b = typeof s == "number" ? `${s}px` : "2rem";
42
39
  return /* @__PURE__ */ o(
43
- "div",
40
+ t,
44
41
  {
45
- className: n.pageHeader,
46
- style: { marginBottom: v() },
42
+ primaryAlign: "space-between",
43
+ secondaryAlign: "center",
44
+ gap: "none",
45
+ className: n.basicHeading,
46
+ style: { marginBottom: b },
47
47
  "data-testid": "HeaderContainer",
48
48
  children: [
49
49
  /* @__PURE__ */ o(
50
- "div",
50
+ t,
51
51
  {
52
- className: `${_ && l ? n.withAvatar : ""} ${n.headingWrapper}`,
52
+ secondaryAlign: "center",
53
+ gap: "none",
54
+ className: `${v && l ? n.withAvatar : ""}`,
53
55
  children: [
54
- /* @__PURE__ */ i(k, { icon: d }),
55
- /* @__PURE__ */ o("div", { className: r ? n.headingContainer : "", children: [
56
- /* @__PURE__ */ i(B, { id: t, text: t, children: /* @__PURE__ */ i(
57
- y,
56
+ /* @__PURE__ */ e(D, { icon: m }),
57
+ /* @__PURE__ */ o(t, { direction: "vertical", gap: "none", children: [
58
+ /* @__PURE__ */ e(x, { id: a, text: a, children: /* @__PURE__ */ e(
59
+ w,
58
60
  {
59
- level: f,
61
+ level: y,
60
62
  "data-testid": "Header",
61
- className: p ?? "",
62
- style: { fontWeight: h },
63
- children: t
63
+ className: d ?? "",
64
+ style: { fontWeight: _ },
65
+ children: a
64
66
  }
65
67
  ) }),
66
- /* @__PURE__ */ i(C, { level: g, children: r })
68
+ /* @__PURE__ */ e(h, { level: g, children: p })
67
69
  ] })
68
70
  ]
69
71
  }
70
72
  ),
71
- /* @__PURE__ */ i(
72
- "div",
73
+ /* @__PURE__ */ e(
74
+ t,
73
75
  {
74
- className: `${n.actionButtonContainer} ${m && n.invisible}`,
76
+ secondaryAlign: "center",
77
+ gap: "dense",
78
+ className: I(f && n.invisible, n.actions),
75
79
  "data-testid": "RightPart",
76
- children: e
80
+ children: i
77
81
  }
78
82
  )
79
83
  ]
@@ -81,5 +85,5 @@ import '../../assets/BasicHeading.css';const N = "_pageHeader_gwnjc_1", b = "_ac
81
85
  );
82
86
  };
83
87
  export {
84
- R as BasicHeading
88
+ q as BasicHeading
85
89
  };
@@ -1,36 +1,36 @@
1
- import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
- import { B as g } from "../../index.es-0QJC9VS2.js";
3
- import { a, s as n } from "../../react.esm-CX1WJ2Pp.js";
4
- import { BasicHeading as i } from "./BasicHeading.js";
1
+ import { jsx as o, Fragment as d } from "react/jsx-runtime";
2
+ import { B as g } from "../../index.es-DUcI2Zyr.js";
3
+ import { a as i, s as t } from "../../react.esm-CX1WJ2Pp.js";
4
+ import { BasicHeading as a } from "./BasicHeading.js";
5
5
  import { d as h, t as s, g as e } from "../../vi.CjhMlMwf-CKxPQtd6.js";
6
6
  h("BasicHeading-Test", () => {
7
7
  s("render small container without content", () => {
8
- a(/* @__PURE__ */ o(i, { heading: "Test" }));
9
- const t = n.getByTestId("HeaderContainer");
10
- e(t).toBeDefined(), e(t).toHaveClass(/pageHeader/);
11
- const r = n.getByTestId("Header");
8
+ i(/* @__PURE__ */ o(a, { heading: "Test" }));
9
+ const n = t.getByTestId("HeaderContainer");
10
+ e(n).toBeDefined();
11
+ const r = t.getByTestId("Header");
12
12
  e(r).toBeDefined(), e(r).toHaveTextContent("Test");
13
- const d = n.getByTestId("RightPart");
14
- e(d).toBeDefined();
13
+ const c = t.getByTestId("RightPart");
14
+ e(c).toBeDefined();
15
15
  }), s("render large container with children", () => {
16
- a(
17
- /* @__PURE__ */ o(i, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(g, { children: "Extracontent" }) })
16
+ i(
17
+ /* @__PURE__ */ o(a, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(g, { children: "Extracontent" }) })
18
18
  );
19
- const t = n.getByTestId("HeaderContainer");
20
- e(t).toBeDefined();
21
- const r = n.getByTestId("Header");
19
+ const n = t.getByTestId("HeaderContainer");
20
+ e(n).toBeDefined();
21
+ const r = t.getByTestId("Header");
22
22
  e(r).toBeDefined(), e(r).toHaveTextContent("Test");
23
- const d = n.getByTestId("RightPart");
24
- e(d).toBeDefined(), e(d).toContainHTML("<button");
23
+ const c = t.getByTestId("RightPart");
24
+ e(c).toBeDefined(), e(c).toContainHTML("<button");
25
25
  }), s("render with available custom icon", () => {
26
- a(/* @__PURE__ */ o(i, { heading: "Test", icon: "farm" }));
27
- const t = n.getByTestId("farm");
28
- e(t).toBeInTheDocument();
26
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: "farm" }));
27
+ const n = t.getByTestId("farm");
28
+ e(n).toBeInTheDocument();
29
29
  }), s("render with JSX element as icon", () => {
30
- a(/* @__PURE__ */ o(i, { heading: "Test", icon: /* @__PURE__ */ o(c, { children: "JSX" }) })), e(n.getByText("JSX")).toBeInTheDocument();
30
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: /* @__PURE__ */ o(d, { children: "JSX" }) })), e(t.getByText("JSX")).toBeInTheDocument();
31
31
  }), s("render with other icon", () => {
32
- a(/* @__PURE__ */ o(i, { heading: "Test", icon: "contact_support" }));
33
- const t = document.querySelector("i");
34
- e(t).toHaveTextContent("contact_support");
32
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: "contact_support" }));
33
+ const n = document.querySelector("i");
34
+ e(n).toHaveTextContent("contact_support");
35
35
  });
36
36
  });
@@ -1,6 +1,8 @@
1
1
  import { Block } from '../../types/internal/Block';
2
2
 
3
- type BlockViewProps<T extends Block> = {
3
+ type BlockViewProps<T extends Block & {
4
+ id?: string;
5
+ }> = {
4
6
  /**
5
7
  * number of rows the will be rendered
6
8
  */
@@ -14,9 +16,13 @@ type BlockViewProps<T extends Block> = {
14
16
  */
15
17
  errorBlocks?: number[];
16
18
  /**
17
- * hide the text above and below the block view
19
+ * hide the text above the block view @default false
18
20
  */
19
21
  hideText?: boolean;
22
+ /**
23
+ * hide the text below the block view @default false
24
+ */
25
+ hideBlockCountText?: boolean;
20
26
  /**
21
27
  * show the block numbers inside the blocks
22
28
  */
@@ -56,9 +62,15 @@ type BlockViewProps<T extends Block> = {
56
62
  * an empty view title to be shown when there are no blocks
57
63
  */
58
64
  emptyViewTitle?: string;
65
+ /**
66
+ * Blocks that should be highlighted as active.
67
+ */
68
+ activeBlocks?: string[];
59
69
  };
60
70
  /**
61
71
  * A component that renders a grid of blocks
62
72
  */
63
- export declare const BlockView: <T extends Block>({ rows, columns, hideText, errorBlocks, showNumbers, clickable, size, onClick, currentBlock, blocks, blockViewTitle, blockLabel, emptyViewTitle, }: BlockViewProps<T>) => import("react/jsx-runtime").JSX.Element;
73
+ export declare const BlockView: <T extends Block & {
74
+ id?: string;
75
+ }>({ rows, columns, hideText, hideBlockCountText, errorBlocks, showNumbers, clickable, size, onClick, currentBlock, activeBlocks, blocks, blockViewTitle, blockLabel, emptyViewTitle, }: BlockViewProps<T>) => import("react/jsx-runtime").JSX.Element;
64
76
  export {};
@@ -1,82 +1,93 @@
1
- import { jsxs as v, jsx as t, Fragment as h } from "react/jsx-runtime";
2
- import { d as C, b as R, a as B } from "../../index.es-BGordhUK.js";
3
- import { useState as A, useEffect as D, useMemo as S } from "react";
4
- import { getBlockNumberByDto as F } from "../../services/BlockService.js";
5
- import '../../assets/BlockView.css';const M = "_grid_17o13_1", V = "_black_17o13_11", j = "_blockLayout_17o13_15", q = "_blockRow_17o13_26", G = "_block_17o13_15", H = "_active_17o13_45", I = "_error_17o13_51", J = "_empty_17o13_57", K = "_blockText_17o13_61", O = "_emptyLayout_17o13_70", o = {
6
- grid: M,
7
- black: V,
8
- blockLayout: j,
9
- blockRow: q,
10
- block: G,
11
- active: H,
12
- error: I,
13
- empty: J,
14
- blockText: K,
15
- emptyLayout: O
16
- }, Y = ({
1
+ import { jsxs as v, jsx as o, Fragment as h } from "react/jsx-runtime";
2
+ import { d as D, b as S, a as F } from "../../index.es-DCSgIiJH.js";
3
+ import { c as M } from "../../index-Cpb-8cAN.js";
4
+ import { useState as V, useEffect as q, useMemo as G } from "react";
5
+ import { getBlockNumberByDto as H } from "../../services/BlockService.js";
6
+ import '../../assets/BlockView.css';const I = "_grid_1ym34_1", J = "_blockLayout_1ym34_11", K = "_blockRow_1ym34_22", O = "_block_1ym34_11", P = "_active_1ym34_41", Q = "_error_1ym34_46", U = "_empty_1ym34_52", W = "_activeBlock_1ym34_56", X = "_blockText_1ym34_60", Y = "_emptyLayout_1ym34_70", t = {
7
+ grid: I,
8
+ blockLayout: J,
9
+ blockRow: K,
10
+ block: O,
11
+ active: P,
12
+ error: Q,
13
+ empty: U,
14
+ activeBlock: W,
15
+ blockText: X,
16
+ emptyLayout: Y
17
+ }, rt = ({
17
18
  rows: e,
18
19
  columns: r,
19
- hideText: b = !1,
20
- errorBlocks: f = [],
21
- showNumbers: w = !0,
22
- clickable: g = !0,
23
- size: m = 15,
24
- onClick: d = null,
25
- currentBlock: a,
26
- blocks: k,
27
- blockViewTitle: N,
28
- blockLabel: $,
29
- emptyViewTitle: x
20
+ hideText: f = !1,
21
+ hideBlockCountText: w = !1,
22
+ errorBlocks: N = [],
23
+ showNumbers: g = !0,
24
+ clickable: x = !0,
25
+ size: y = 15,
26
+ onClick: u = null,
27
+ currentBlock: s,
28
+ activeBlocks: b,
29
+ blocks: m,
30
+ blockViewTitle: L,
31
+ blockLabel: T,
32
+ emptyViewTitle: B
30
33
  }) => {
31
- const [u, _] = A(0);
32
- D(() => {
33
- if (!a) return;
34
- const l = F(a, r);
35
- _(l);
36
- }, [a, r]);
37
- const L = S(() => e * r, [e, r]), T = (l) => {
38
- d && d(l, a ?? void 0);
39
- }, E = ({ row: l, column: i }) => k.length === 0 ? !0 : k.some((s) => s.position?.row === l && s.position?.column === i), y = !e && !r;
40
- return /* @__PURE__ */ v("div", { "data-testid": "block-view-container", className: o.grid, children: [
41
- !b && /* @__PURE__ */ t(C, { level: 1, bold: !0, className: o.black, children: N }),
42
- /* @__PURE__ */ t(
34
+ const [C, _] = V(0);
35
+ q(() => {
36
+ if (!s) return;
37
+ const i = H(s, r);
38
+ _(i);
39
+ }, [s, r]);
40
+ const E = G(() => e * r, [e, r]), R = (i) => {
41
+ u && u(i, s ?? void 0);
42
+ }, $ = ({ row: i, column: c }) => m.length === 0 ? !0 : m.some((d) => d.position?.row === i && d.position?.column === c), k = !e && !r;
43
+ return /* @__PURE__ */ v("div", { "data-testid": "block-view-container", className: t.grid, children: [
44
+ !f && /* @__PURE__ */ o(D, { level: 1, bold: !0, className: t.black, children: L }),
45
+ /* @__PURE__ */ o(
43
46
  "div",
44
47
  {
45
48
  "data-testid": "block-view-layout",
46
- className: y ? o.emptyLayout : o.blockLayout,
47
- style: { width: `${m}rem`, height: `${m}rem` },
48
- children: y ? /* @__PURE__ */ t(P, { emptyViewTitle: x }) : /* @__PURE__ */ t(h, { children: Array.from({ length: e }).map((l, i) => /* @__PURE__ */ t("div", { "data-testid": "block-view-row", className: o.blockRow, children: Array.from({ length: r }).map((s, n) => {
49
- const c = r * i + n + 1, p = E({ row: i + 1, column: n + 1 });
50
- return /* @__PURE__ */ t(
49
+ className: k ? t.emptyLayout : t.blockLayout,
50
+ style: { width: `${y}rem`, height: `${y}rem` },
51
+ children: k ? /* @__PURE__ */ o(Z, { emptyViewTitle: B }) : /* @__PURE__ */ o(h, { children: Array.from({ length: e }).map((i, c) => /* @__PURE__ */ o("div", { "data-testid": "block-view-row", className: t.blockRow, children: Array.from({ length: r }).map((d, a) => {
52
+ const l = r * c + a + 1, p = $({ row: c + 1, column: a + 1 }), A = M(
53
+ t.block,
54
+ C === l && t.active,
55
+ !p && t.empty,
56
+ N.includes(l) && t.error,
57
+ b && m.some(
58
+ (n) => n.id && b.includes(n.id) && n.position?.row === c + 1 && n.position?.column === a + 1
59
+ ) && t.activeBlock
60
+ );
61
+ return /* @__PURE__ */ o(
51
62
  "div",
52
63
  {
53
64
  "data-testid": "block-view-block",
54
- className: `${o.block} ${u === c ? o.active : ""} ${p ? "" : o.empty} ${f.includes(c) ? o.error : ""}`,
55
- id: `block${c}`,
56
- onClick: g ? () => {
57
- _(c), T({ row: i + 1, column: n + 1 });
65
+ className: A,
66
+ id: `block${l}`,
67
+ onClick: x ? () => {
68
+ _(l), R({ row: c + 1, column: a + 1 });
58
69
  } : void 0,
59
- children: w && p && /* @__PURE__ */ t(
70
+ children: g && p && /* @__PURE__ */ o(
60
71
  "div",
61
72
  {
62
73
  "data-testid": "block-view-block-number",
63
- className: `${o.blockText} ${u === c ? o.black : ""}`,
64
- children: c
74
+ className: t.blockText,
75
+ children: l
65
76
  }
66
77
  )
67
78
  },
68
- c
79
+ l
69
80
  );
70
- }) }, i)) })
81
+ }) }, c)) })
71
82
  }
72
83
  ),
73
- !b && /* @__PURE__ */ v(R, { themeColor: "primary", level: 6, children: [
74
- L,
84
+ !w && /* @__PURE__ */ v(S, { themeColor: "primary", level: 6, children: [
85
+ E,
75
86
  " ",
76
- $
87
+ T
77
88
  ] })
78
89
  ] });
79
- }, P = ({ emptyViewTitle: e }) => e ? /* @__PURE__ */ t(B, { bold: !0, children: e }) : /* @__PURE__ */ t(h, {});
90
+ }, Z = ({ emptyViewTitle: e }) => e ? /* @__PURE__ */ o(F, { bold: !0, children: e }) : /* @__PURE__ */ o(h, {});
80
91
  export {
81
- Y as BlockView
92
+ rt as BlockView
82
93
  };
@@ -1,19 +1,19 @@
1
1
  import { jsx as jt } from "react/jsx-runtime";
2
- import { o as ze, e as Je, i as Qe, C as Ze } from "../../index.es-Bg8hxXM8.js";
2
+ import { o as ze, e as Je, i as Qe, C as Ze } from "../../index.es-P5F6NJPB.js";
3
3
  import { _ as te, a as Fe, c as Jt, b as Kt, d as De, P as l } from "../../index-Cpb-8cAN.js";
4
4
  import { f as Mt, _ as Le, a as kt, b as Pe, c as Ke, d as $t, e as Yt, g as Me } from "../../defineProperty-CmuOyxyf.js";
5
- import { _ as Pt, a as ti, b as ei, c as ii } from "../../map-Dbvlv_6y.js";
5
+ import { _ as Pt, a as ti, b as ei, c as ii } from "../../map-LUrszKZW.js";
6
6
  import { g as ke } from "../../_commonjsHelpers-BkfeUUK-.js";
7
7
  import { a as ni } from "../../es.string.iterator-DrqCBub-.js";
8
- import { j as oi, _ as vt } from "../../slicedToArray-BWk2gTCn.js";
9
- import { k as It, u as ri, l as ai, e as ci, i as si } from "../../index.es-BXj90wb_.js";
10
- import { n as li, i as di, K as M, _ as ui } from "../../keyboard-B-WUULl-.js";
11
- import { _ as _e } from "../../find-B-dm7n_F.js";
8
+ import { j as oi, _ as vt } from "../../slicedToArray-uk6yv91z.js";
9
+ import { k as It, u as ri, l as ai, e as ci, i as si } from "../../index.es-BjvSa9Z-.js";
10
+ import { n as li, i as di, K as M, _ as ui } from "../../keyboard-BfmK7HK_.js";
11
+ import { _ as _e } from "../../find-Dpy_M6vm.js";
12
12
  import E, { useEffect as ee, useState as gt, useMemo as Qt, useCallback as g, useRef as Ye, forwardRef as pi, useImperativeHandle as hi } from "react";
13
13
  import { e as fi, c as R, b as tt } from "../../tslib.es6-BDCynO9F.js";
14
14
  import { M as ie, a as ne } from "../../component-neHBNHRu.js";
15
15
  import { M as wt, b as we } from "../../component-DsB0poTj.js";
16
- import { I as Ce } from "../../index.es-DwzB1d7_.js";
16
+ import { I as Ce } from "../../index.es-DYs8W4jv.js";
17
17
  import { OverflowTooltip as _i } from "../OverflowTooltip/OverflowTooltip.js";
18
18
  import '../../assets/ChipCard.css';var Ci = Qe ? window : null, Ie = function(o) {
19
19
  return !!o.addEventListener;
@@ -32,6 +32,8 @@ type ContextMenuProps = {
32
32
  export type ActionProps = ListItemProps & {
33
33
  closeOnClick?: boolean;
34
34
  'data-testid'?: string;
35
+ dividerBefore?: boolean;
36
+ dividerAfter?: boolean;
35
37
  };
36
38
  /**
37
39
  *