@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.
- package/CHANGELOG.md +29 -0
- package/dist/{AlertBanner-D-NTP_6i.js → AlertBanner-Dss0v6W0.js} +3 -3
- package/dist/{BigLoadingSpinner-CCxsMWnc.js → BigLoadingSpinner-BeHzqdOg.js} +1 -1
- package/dist/{GenericCard-DOKyENNm.js → GenericCard-MjxZ1L7r.js} +3 -3
- package/dist/ListAreaService-Dx9WBGHB.js +125 -0
- package/dist/{OfflineView-DHtzNLwt.js → OfflineView-D168VIXv.js} +3 -3
- package/dist/assets/BaseView.css +1 -1
- package/dist/assets/BasicHeading.css +1 -1
- package/dist/assets/BlockView.css +1 -1
- package/dist/assets/ContextMenu.css +1 -1
- package/dist/assets/CustomTextField.css +1 -1
- package/dist/assets/EmptyView.css +1 -0
- package/dist/assets/Filter.css +1 -1
- package/dist/assets/FormDatePicker.css +1 -1
- package/dist/assets/FormSelect.css +1 -1
- package/dist/assets/FormText.css +1 -1
- package/dist/assets/HashTabView.css +1 -1
- package/dist/assets/InfoGroup.css +1 -1
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/assets/OnboardingBanner.css +1 -1
- package/dist/assets/Select.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.js +4 -4
- package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.js +3 -3
- package/dist/components/BaseView/BaseView.d.ts +17 -1
- package/dist/components/BaseView/BaseView.js +119 -76
- package/dist/components/BaseView/BaseView.service.d.ts +7 -0
- package/dist/components/BaseView/BaseView.service.js +27 -0
- package/dist/components/BaseView/BaseView.test.js +18 -17
- package/dist/components/BasicHeading/BasicHeading.d.ts +6 -1
- package/dist/components/BasicHeading/BasicHeading.js +57 -53
- package/dist/components/BasicHeading/BasicHeading.test.js +24 -24
- package/dist/components/BlockView/BlockView.d.ts +15 -3
- package/dist/components/BlockView/BlockView.js +69 -58
- package/dist/components/ChipCard/ChipCard.js +7 -7
- package/dist/components/ContextMenu/ContextMenu.d.ts +2 -0
- package/dist/components/ContextMenu/ContextMenu.js +52 -41
- package/dist/components/DeleteModal/DeleteModal.js +4 -4
- package/dist/components/DetailContentWrapper/DetailContentWrapper.d.ts +18 -3
- package/dist/components/DetailContentWrapper/DetailContentWrapper.js +13 -11
- package/dist/components/Disclaimer/Disclaimer.js +3 -3
- package/dist/components/EmptyView/EmptyView.d.ts +18 -6
- package/dist/components/EmptyView/EmptyView.js +37 -309
- package/dist/components/EmptyView/EmptyView.test.js +34 -38
- package/dist/components/Filter/Filter.d.ts +5 -1
- package/dist/components/Filter/Filter.js +113 -98
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +4 -4
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +21 -20
- package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +66 -66
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.js +3 -3
- package/dist/components/FormComponents/FormText/FormText.js +45 -44
- package/dist/components/FormComponents/FormToggle/FormToggle.js +3 -3
- package/dist/components/GenericTable/GenericTable.js +17 -17
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +3 -3
- package/dist/components/HashTabView/HashTabView.js +119 -117
- package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
- package/dist/components/Iconify/Iconify.d.ts +4 -0
- package/dist/components/Iconify/Iconify.js +1 -1
- package/dist/components/InfoCard/InfoCard.js +3 -3
- package/dist/components/InfoGroup/InfoGroup.js +47 -38
- package/dist/components/ListArea/ListArea.d.ts +6 -2
- package/dist/components/ListArea/ListArea.js +37 -32
- package/dist/components/ListArea/ListArea.test.js +2 -2
- package/dist/components/ListArea/ListAreaService.js +4 -4
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +4 -4
- package/dist/components/Modal/Modal.js +119 -103
- package/dist/components/OfflineView/OfflineView.js +4 -4
- package/dist/components/OfflineView/OfflineView.test.js +1 -1
- package/dist/components/OnboardingBanner/OnboardingBanner.js +35 -33
- package/dist/components/OverflowTooltip/OverflowTooltip.js +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.js +2 -2
- package/dist/components/Stepper/components/StepperIndicator.js +1 -1
- package/dist/{find-B-dm7n_F.js → find-Dpy_M6vm.js} +1 -1
- package/dist/{index.es-DObVvepK.js → index.es-BLIkMu0q.js} +2 -2
- package/dist/{index.es-DENZVv7_.js → index.es-BLolvOHO.js} +5 -5
- package/dist/{index.es-BXj90wb_.js → index.es-BjvSa9Z-.js} +2 -2
- package/dist/{index.es-Dfju71Pi.js → index.es-Bus5gEri.js} +1 -1
- package/dist/{index.es-IXyb5F6n.js → index.es-BzdG6flH.js} +2 -2
- package/dist/{index.es-DqSY-ePE.js → index.es-CXq42ihP.js} +9 -9
- package/dist/{index.es-45NOgWlB.js → index.es-CijDQQVg.js} +2 -2
- package/dist/{index.es-BGordhUK.js → index.es-DCSgIiJH.js} +1 -1
- package/dist/{index.es-D1IpdMde.js → index.es-DDRyb2df.js} +2 -2
- package/dist/{index.es-DeF-y7fd.js → index.es-DNRm4vOy.js} +1 -1
- package/dist/{index.es-0QJC9VS2.js → index.es-DUcI2Zyr.js} +2 -2
- package/dist/{index.es-DwzB1d7_.js → index.es-DYs8W4jv.js} +1 -1
- package/dist/{index.es-B6ZgiW2s.js → index.es-D_hWWij3.js} +13 -13
- package/dist/{index.es-CK4oZMKs.js → index.es-Dq_bXeGZ.js} +13 -13
- package/dist/{index.es-t7hFwQSs.js → index.es-Ds9rRj5B.js} +2 -2
- package/dist/{index.es-DDYCugj-.js → index.es-DsGuBR0Z.js} +1 -1
- package/dist/{index.es-Bg8hxXM8.js → index.es-P5F6NJPB.js} +360 -255
- package/dist/{index.es-Cq04gn3U.js → index.es-b2h35xzk.js} +4 -4
- package/dist/{index.es-Bgjh6euR.js → index.es-vqlyMiew.js} +1 -1
- package/dist/{keyboard-B-WUULl-.js → keyboard-BfmK7HK_.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/{map-Dbvlv_6y.js → map-LUrszKZW.js} +2 -2
- package/dist/{slicedToArray-BWk2gTCn.js → slicedToArray-uk6yv91z.js} +1 -1
- package/package.json +1 -1
- package/dist/ListAreaService-CI-s1Xx5.js +0 -124
- 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
|
|
5
|
-
import { d as u, b as
|
|
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
|
-
|
|
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
|
-
|
|
40
|
+
r("render BaseView with empty view and navigation list", () => {
|
|
41
41
|
n(
|
|
42
42
|
/* @__PURE__ */ o(
|
|
43
|
-
|
|
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
|
-
}),
|
|
55
|
+
}), r("render BaseView with data and navigation list", () => {
|
|
56
56
|
n(
|
|
57
57
|
/* @__PURE__ */ o(
|
|
58
|
-
|
|
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
|
-
}),
|
|
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
|
-
|
|
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
|
-
}),
|
|
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
|
-
|
|
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
|
-
}),
|
|
106
|
+
}), r("render BaseView with selected detail section", () => {
|
|
106
107
|
n(
|
|
107
108
|
/* @__PURE__ */ o(
|
|
108
|
-
|
|
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
|
-
}),
|
|
121
|
+
}), r("renders only offline view when offline", () => {
|
|
121
122
|
n(
|
|
122
123
|
/* @__PURE__ */ o(
|
|
123
|
-
|
|
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
|
-
*
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
withAvatar:
|
|
16
|
-
iconContainer:
|
|
17
|
-
},
|
|
18
|
-
|
|
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:
|
|
20
|
+
icon: i,
|
|
21
21
|
className: n.leadingIcon,
|
|
22
|
-
iconSize: "
|
|
22
|
+
iconSize: "medium",
|
|
23
23
|
iconType: "filled"
|
|
24
24
|
}
|
|
25
|
-
) : /* @__PURE__ */
|
|
26
|
-
children:
|
|
27
|
-
marginBottom:
|
|
28
|
-
heading:
|
|
29
|
-
icon:
|
|
30
|
-
className:
|
|
31
|
-
subHeading:
|
|
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:
|
|
34
|
-
level:
|
|
33
|
+
invisibleButton: f = !1,
|
|
34
|
+
level: r = 5,
|
|
35
35
|
fontWeight: c = 400,
|
|
36
|
-
withAvatar:
|
|
36
|
+
withAvatar: v = !1
|
|
37
37
|
}) => {
|
|
38
|
-
const { isDesktop: l } =
|
|
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
|
-
|
|
40
|
+
t,
|
|
44
41
|
{
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
50
|
+
t,
|
|
51
51
|
{
|
|
52
|
-
|
|
52
|
+
secondaryAlign: "center",
|
|
53
|
+
gap: "none",
|
|
54
|
+
className: `${v && l ? n.withAvatar : ""}`,
|
|
53
55
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ o(
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
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:
|
|
61
|
+
level: y,
|
|
60
62
|
"data-testid": "Header",
|
|
61
|
-
className:
|
|
62
|
-
style: { fontWeight:
|
|
63
|
-
children:
|
|
63
|
+
className: d ?? "",
|
|
64
|
+
style: { fontWeight: _ },
|
|
65
|
+
children: a
|
|
64
66
|
}
|
|
65
67
|
) }),
|
|
66
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ e(h, { level: g, children: p })
|
|
67
69
|
] })
|
|
68
70
|
]
|
|
69
71
|
}
|
|
70
72
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
+
/* @__PURE__ */ e(
|
|
74
|
+
t,
|
|
73
75
|
{
|
|
74
|
-
|
|
76
|
+
secondaryAlign: "center",
|
|
77
|
+
gap: "dense",
|
|
78
|
+
className: I(f && n.invisible, n.actions),
|
|
75
79
|
"data-testid": "RightPart",
|
|
76
|
-
children:
|
|
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
|
-
|
|
88
|
+
q as BasicHeading
|
|
85
89
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import { B as g } from "../../index.es-
|
|
3
|
-
import { a, s as
|
|
4
|
-
import { BasicHeading as
|
|
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
|
-
|
|
9
|
-
const
|
|
10
|
-
e(
|
|
11
|
-
const r =
|
|
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
|
|
14
|
-
e(
|
|
13
|
+
const c = t.getByTestId("RightPart");
|
|
14
|
+
e(c).toBeDefined();
|
|
15
15
|
}), s("render large container with children", () => {
|
|
16
|
-
|
|
17
|
-
/* @__PURE__ */ o(
|
|
16
|
+
i(
|
|
17
|
+
/* @__PURE__ */ o(a, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(g, { children: "Extracontent" }) })
|
|
18
18
|
);
|
|
19
|
-
const
|
|
20
|
-
e(
|
|
21
|
-
const r =
|
|
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
|
|
24
|
-
e(
|
|
23
|
+
const c = t.getByTestId("RightPart");
|
|
24
|
+
e(c).toBeDefined(), e(c).toContainHTML("<button");
|
|
25
25
|
}), s("render with available custom icon", () => {
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
e(
|
|
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
|
-
|
|
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
|
-
|
|
33
|
-
const
|
|
34
|
-
e(
|
|
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
|
|
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
|
|
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
|
|
2
|
-
import { d as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
blockLayout:
|
|
9
|
-
blockRow:
|
|
10
|
-
block:
|
|
11
|
-
active:
|
|
12
|
-
error:
|
|
13
|
-
empty:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 [
|
|
32
|
-
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
35
|
-
_(
|
|
36
|
-
}, [
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
return /* @__PURE__ */ v("div", { "data-testid": "block-view-container", className:
|
|
41
|
-
!
|
|
42
|
-
/* @__PURE__ */
|
|
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:
|
|
47
|
-
style: { width: `${
|
|
48
|
-
children:
|
|
49
|
-
const
|
|
50
|
-
|
|
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:
|
|
55
|
-
id: `block${
|
|
56
|
-
onClick:
|
|
57
|
-
_(
|
|
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:
|
|
70
|
+
children: g && p && /* @__PURE__ */ o(
|
|
60
71
|
"div",
|
|
61
72
|
{
|
|
62
73
|
"data-testid": "block-view-block-number",
|
|
63
|
-
className:
|
|
64
|
-
children:
|
|
74
|
+
className: t.blockText,
|
|
75
|
+
children: l
|
|
65
76
|
}
|
|
66
77
|
)
|
|
67
78
|
},
|
|
68
|
-
|
|
79
|
+
l
|
|
69
80
|
);
|
|
70
|
-
}) },
|
|
81
|
+
}) }, c)) })
|
|
71
82
|
}
|
|
72
83
|
),
|
|
73
|
-
!
|
|
74
|
-
|
|
84
|
+
!w && /* @__PURE__ */ v(S, { themeColor: "primary", level: 6, children: [
|
|
85
|
+
E,
|
|
75
86
|
" ",
|
|
76
|
-
|
|
87
|
+
T
|
|
77
88
|
] })
|
|
78
89
|
] });
|
|
79
|
-
},
|
|
90
|
+
}, Z = ({ emptyViewTitle: e }) => e ? /* @__PURE__ */ o(F, { bold: !0, children: e }) : /* @__PURE__ */ o(h, {});
|
|
80
91
|
export {
|
|
81
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
9
|
-
import { k as It, u as ri, l as ai, e as ci, i as si } from "../../index.es-
|
|
10
|
-
import { n as li, i as di, K as M, _ as ui } from "../../keyboard-
|
|
11
|
-
import { _ as _e } from "../../find-
|
|
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-
|
|
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;
|