@hortiview/shared-components 2.1.0 → 2.2.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 +6 -0
- package/dist/{ListAreaService-Wq9IkwWN.js → ListAreaService-BVtuBN0K.js} +34 -33
- package/dist/components/ContextMenu/ContextMenu.d.ts +6 -1
- package/dist/components/ContextMenu/ContextMenu.js +33 -32
- package/dist/components/ContextMenu/ContextMenu.test.js +7 -7
- package/dist/components/ListArea/ListArea.d.ts +5 -1
- package/dist/components/ListArea/ListArea.js +24 -23
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/ListArea/ListAreaService.js +1 -1
- package/dist/components/OnboardingBanner/OnboardingBanner.test.js +18 -18
- package/dist/types/ListElement.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [2.2.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.1.0...v2.2.0) (2025-07-24)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add new data-testids and fix onboardingbanner test ([1ac90c1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/1ac90c1c4db3ff909e6ac3beb52863e6a8e55937))
|
|
6
|
+
|
|
1
7
|
## [2.1.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.0.0...v2.1.0) (2025-06-11)
|
|
2
8
|
|
|
3
9
|
### Features
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { G as
|
|
3
|
-
import { I as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Iconify as
|
|
6
|
-
import { AvailableCustomIcons as
|
|
7
|
-
import './assets/ListAreaService.css';const
|
|
8
|
-
fullWidth:
|
|
9
|
-
mainElevation:
|
|
10
|
-
searchbar:
|
|
11
|
-
roundedBottom:
|
|
12
|
-
primaryText:
|
|
13
|
-
list:
|
|
14
|
-
listItem:
|
|
15
|
-
iconColor:
|
|
16
|
-
overlineTitle:
|
|
17
|
-
noOverlineTitle:
|
|
18
|
-
truncate:
|
|
19
|
-
truncateOverlineText:
|
|
20
|
-
},
|
|
1
|
+
import { jsx as r, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { G as C } from "./index.es-DntoATwO.js";
|
|
3
|
+
import { I as b } from "./index.es-3043KTnb.js";
|
|
4
|
+
import { c as N, d as O, T as $ } from "./index.es-D54RuMc_.js";
|
|
5
|
+
import { Iconify as k } from "./components/Iconify/Iconify.js";
|
|
6
|
+
import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
|
|
7
|
+
import './assets/ListAreaService.css';const j = "_fullWidth_zewqs_1", G = "_mainElevation_zewqs_5", W = "_searchbar_zewqs_11", L = "_roundedBottom_zewqs_19", S = "_primaryText_zewqs_24", A = "_list_zewqs_28", P = "_listItem_zewqs_56", D = "_iconColor_zewqs_76", F = "_overlineTitle_zewqs_80", H = "_noOverlineTitle_zewqs_85", J = "_truncate_zewqs_89", K = "_truncateOverlineText_zewqs_100", n = {
|
|
8
|
+
fullWidth: j,
|
|
9
|
+
mainElevation: G,
|
|
10
|
+
searchbar: W,
|
|
11
|
+
roundedBottom: L,
|
|
12
|
+
primaryText: S,
|
|
13
|
+
list: A,
|
|
14
|
+
listItem: P,
|
|
15
|
+
iconColor: D,
|
|
16
|
+
overlineTitle: F,
|
|
17
|
+
noOverlineTitle: H,
|
|
18
|
+
truncate: J,
|
|
19
|
+
truncateOverlineText: K
|
|
20
|
+
}, ee = (t, s, a, l) => {
|
|
21
21
|
const i = t.reduce((o, c) => {
|
|
22
22
|
const { groupName: e, ...m } = c;
|
|
23
23
|
return !e || typeof e != "string" || (o[e] || (o[e] = {
|
|
24
|
-
groupName: /* @__PURE__ */ r(
|
|
24
|
+
groupName: /* @__PURE__ */ r(N, { children: e }),
|
|
25
25
|
id: e,
|
|
26
26
|
items: []
|
|
27
27
|
}), o[e].items = [
|
|
@@ -30,7 +30,7 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
|
|
|
30
30
|
]), o;
|
|
31
31
|
}, {});
|
|
32
32
|
return Object.values(i);
|
|
33
|
-
},
|
|
33
|
+
}, te = (t, s, a, l) => t.map((i) => y(i, s, a, l)), y = (t, s, a, l) => {
|
|
34
34
|
const {
|
|
35
35
|
id: i,
|
|
36
36
|
title: o,
|
|
@@ -47,16 +47,17 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
|
|
|
47
47
|
onClick: w,
|
|
48
48
|
customTitle: T,
|
|
49
49
|
listItemClassName: x,
|
|
50
|
-
overlineTitle: _
|
|
50
|
+
overlineTitle: _,
|
|
51
|
+
"data-testid": q
|
|
51
52
|
} = t, u = s === e;
|
|
52
53
|
return {
|
|
53
54
|
id: i,
|
|
54
55
|
key: i,
|
|
55
56
|
select: u,
|
|
56
57
|
primaryText: i,
|
|
57
|
-
secondaryText: /* @__PURE__ */
|
|
58
|
+
secondaryText: /* @__PURE__ */ B(C, { direction: "vertical", gap: "none", children: [
|
|
58
59
|
T ?? /* @__PURE__ */ r(
|
|
59
|
-
|
|
60
|
+
O,
|
|
60
61
|
{
|
|
61
62
|
"data-testid": "title",
|
|
62
63
|
level: 1,
|
|
@@ -66,7 +67,7 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
|
|
|
66
67
|
}
|
|
67
68
|
),
|
|
68
69
|
c && !T ? /* @__PURE__ */ r(
|
|
69
|
-
|
|
70
|
+
$,
|
|
70
71
|
{
|
|
71
72
|
"data-testid": "subtitle",
|
|
72
73
|
level: 2,
|
|
@@ -84,26 +85,26 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
|
|
|
84
85
|
children: _
|
|
85
86
|
}
|
|
86
87
|
) : void 0,
|
|
87
|
-
trailingBlock: I ?? f ?? /* @__PURE__ */ r(
|
|
88
|
-
leadingBlock:
|
|
88
|
+
trailingBlock: I ?? f ?? /* @__PURE__ */ r(b, { icon: "arrow_right", className: n.iconColor }),
|
|
89
|
+
leadingBlock: M(g),
|
|
89
90
|
value: m,
|
|
90
91
|
componentProps: {
|
|
91
92
|
id: i,
|
|
92
|
-
"data-testid": `${o}-list-item`,
|
|
93
|
+
"data-testid": `${q ?? o}-list-item`,
|
|
93
94
|
key: i,
|
|
94
95
|
leadingBlockType: p ?? "icon",
|
|
95
96
|
trailingBlockType: h ?? "icon",
|
|
96
97
|
className: `${p === "avatar" ? "" : n.listItem} ${a} ${x ?? ""} ${_ ? n.overlineTitle : n.noOverlineTitle}`,
|
|
97
|
-
onClick: (
|
|
98
|
+
onClick: (Q, z) => w?.(z),
|
|
98
99
|
tag: d || v ? void 0 : l ?? "a",
|
|
99
100
|
to: d || v ? void 0 : e,
|
|
100
101
|
disabled: d
|
|
101
102
|
}
|
|
102
103
|
};
|
|
103
|
-
},
|
|
104
|
+
}, M = (t) => typeof t == "string" && t in E ? /* @__PURE__ */ r(k, { icon: t }) : t;
|
|
104
105
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
te as a,
|
|
107
|
+
ee as g,
|
|
107
108
|
y as m,
|
|
108
109
|
n as s
|
|
109
110
|
};
|
|
@@ -15,9 +15,14 @@ type ContextMenuProps = {
|
|
|
15
15
|
* Default is 'vertical'
|
|
16
16
|
*/
|
|
17
17
|
iconOrientation?: 'vertical' | 'horizontal';
|
|
18
|
+
/**
|
|
19
|
+
* data-testid for testing
|
|
20
|
+
*/
|
|
21
|
+
'data-testid'?: string;
|
|
18
22
|
};
|
|
19
23
|
export type ActionProps = ListItemProps & {
|
|
20
24
|
closeOnClick?: boolean;
|
|
25
|
+
'data-testid'?: string;
|
|
21
26
|
};
|
|
22
27
|
/**
|
|
23
28
|
*
|
|
@@ -32,5 +37,5 @@ export type ActionProps = ListItemProps & {
|
|
|
32
37
|
* ];
|
|
33
38
|
* @returns a context menu with the given actions as ListItems
|
|
34
39
|
*/
|
|
35
|
-
export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, "data-testid": dataTestId, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
41
|
export {};
|
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { I as
|
|
3
|
-
import { M as
|
|
4
|
-
import { useState as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { I as d } from "../../index.es-0lQcz8m1.js";
|
|
3
|
+
import { M as f, L as _, a as I } from "../../index.es-fnFnw2P1.js";
|
|
4
|
+
import { useState as p, useCallback as a, useEffect as v } from "react";
|
|
5
5
|
import { u as C } from "../../uniqueId-NU3-C36A.js";
|
|
6
|
-
import '../../assets/ContextMenu.css';const k = "_menu_ol91v_1", y = "_icon_ol91v_5", M = "_listItem_ol91v_9",
|
|
6
|
+
import '../../assets/ContextMenu.css';const k = "_menu_ol91v_1", y = "_icon_ol91v_5", M = "_listItem_ol91v_9", i = {
|
|
7
7
|
menu: k,
|
|
8
8
|
icon: y,
|
|
9
9
|
listItem: M
|
|
10
|
-
},
|
|
11
|
-
triggerOpen:
|
|
10
|
+
}, T = ({
|
|
11
|
+
triggerOpen: n = null,
|
|
12
12
|
actions: c,
|
|
13
|
-
iconOrientation: m = "vertical"
|
|
13
|
+
iconOrientation: m = "vertical",
|
|
14
|
+
"data-testid": r
|
|
14
15
|
}) => {
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
}, [
|
|
18
|
-
|
|
16
|
+
const [t, s] = p(!1), u = a(() => {
|
|
17
|
+
s(!t);
|
|
18
|
+
}, [t]), l = a(() => {
|
|
19
|
+
s(!1);
|
|
19
20
|
}, []);
|
|
20
21
|
return v(() => {
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
|
|
22
|
+
s(n !== null ? n : !1);
|
|
23
|
+
}, [n]), /* @__PURE__ */ o(
|
|
24
|
+
f,
|
|
24
25
|
{
|
|
25
|
-
className:
|
|
26
|
-
"data-testid": "selection-menu",
|
|
27
|
-
open:
|
|
26
|
+
className: i.menu,
|
|
27
|
+
"data-testid": r ?? "selection-menu",
|
|
28
|
+
open: t,
|
|
28
29
|
surfaceOnly: !0,
|
|
29
30
|
hoistToBody: !0,
|
|
30
|
-
onClose:
|
|
31
|
-
trigger: /* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
onClose: l,
|
|
32
|
+
trigger: /* @__PURE__ */ o(
|
|
33
|
+
d,
|
|
33
34
|
{
|
|
34
|
-
className:
|
|
35
|
-
variant:
|
|
35
|
+
className: i.icon,
|
|
36
|
+
variant: t ? "filled-primary" : void 0,
|
|
36
37
|
"data-testid": "open-button",
|
|
37
38
|
icon: m === "vertical" ? "more_vert" : "more_horiz",
|
|
38
|
-
onClick:
|
|
39
|
+
onClick: u
|
|
39
40
|
}
|
|
40
41
|
),
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
|
|
42
|
+
children: /* @__PURE__ */ o(_, { "data-testid": "selection-list", children: c.map((e) => /* @__PURE__ */ o(
|
|
43
|
+
I,
|
|
43
44
|
{
|
|
44
|
-
className:
|
|
45
|
-
...
|
|
45
|
+
className: i.listItem,
|
|
46
|
+
...e,
|
|
46
47
|
leadingBlockType: "icon",
|
|
47
|
-
"data-testid":
|
|
48
|
+
"data-testid": e["data-testid"],
|
|
48
49
|
onClick: () => {
|
|
49
|
-
|
|
50
|
+
e?.onClick?.(), e.closeOnClick !== !1 && l();
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
|
-
C(`LI_${
|
|
53
|
+
C(`LI_${e.primaryText?.toString()}_`)
|
|
53
54
|
)) })
|
|
54
55
|
},
|
|
55
56
|
"selectionmenu"
|
|
56
57
|
);
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
T as ContextMenu
|
|
60
61
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { a as B, s as t, f as o, w as s } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
3
|
import { ContextMenu as p } from "./ContextMenu.js";
|
|
4
|
-
import { a as
|
|
5
|
-
const C =
|
|
6
|
-
{ primaryText: "Open", onClick: C, leadingBlock: "add" },
|
|
7
|
-
{ primaryText: "Delete", onClick: i, leadingBlock: "delete_outline" },
|
|
8
|
-
{ primaryText: "Edit", onClick: a, leadingBlock: "edit" }
|
|
4
|
+
import { a as d, d as k, t as T, g as e } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
5
|
+
const C = d.fn(), a = d.fn(), i = d.fn(), g = [
|
|
6
|
+
{ primaryText: "Open", onClick: C, leadingBlock: "add", "data-testid": "open-testid" },
|
|
7
|
+
{ primaryText: "Delete", onClick: i, leadingBlock: "delete_outline", "data-testid": "delete-testid" },
|
|
8
|
+
{ primaryText: "Edit", onClick: a, leadingBlock: "edit", "data-testid": "edit-testid" }
|
|
9
9
|
];
|
|
10
10
|
k("ContextMenu Test", () => {
|
|
11
11
|
T("render contextMenu and close it", () => {
|
|
@@ -16,7 +16,7 @@ k("ContextMenu Test", () => {
|
|
|
16
16
|
B(/* @__PURE__ */ r(p, { actions: g, triggerOpen: !0 }));
|
|
17
17
|
const c = t.getByTestId("open-button"), n = t.getByTestId("selection-menu");
|
|
18
18
|
e(n).toBeInTheDocument(), e(n).not.toHaveClass("mdc-menu-surface--open"), o.click(c), await s(() => e(n).toHaveClass("mdc-menu-surface--animating-open")), e(t.getByText("Open")).toBeInTheDocument(), e(t.getByText("Delete")).toBeInTheDocument(), e(t.getByText("Edit")).toBeInTheDocument();
|
|
19
|
-
const
|
|
20
|
-
e(
|
|
19
|
+
const l = t.getByTestId("open-testid"), m = t.getByTestId("delete-testid"), u = t.getByTestId("edit-testid");
|
|
20
|
+
e(l).toBeInTheDocument(), e(m).toBeInTheDocument(), e(u).toBeInTheDocument(), o.click(l), e(C).toHaveBeenCalled(), e(i).not.toHaveBeenCalled(), e(a).not.toHaveBeenCalled(), o.click(m), e(i).toHaveBeenCalled(), o.click(u), e(a).toHaveBeenCalled();
|
|
21
21
|
});
|
|
22
22
|
});
|
|
@@ -42,6 +42,10 @@ type ListAreaProps = {
|
|
|
42
42
|
* noElementsView is the view to be displayed when the list is empty
|
|
43
43
|
*/
|
|
44
44
|
noElementsView?: JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* data-testid for testing
|
|
47
|
+
*/
|
|
48
|
+
'data-testid'?: string;
|
|
45
49
|
/**
|
|
46
50
|
* routerLinkElement is the element to be used for the elements link, use react-router Link component for the best experience.
|
|
47
51
|
* If the element has `noNavigation=false` and the `routerLinkElement` is undefined an `<a>` tag is used.
|
|
@@ -54,5 +58,5 @@ type ListAreaProps = {
|
|
|
54
58
|
* list elements act as router links to the corresponding route.
|
|
55
59
|
* The list will be displayed in the desktop view or when no detail view is selected (in mobile view).
|
|
56
60
|
*/
|
|
57
|
-
export declare const ListArea: ({ elements, pathname, isGrouped, hasSearch, searchPlaceholder, isIntegrated, isSorted, itemClassName, maxHeight, noElementsView, routerLinkElement, }: ListAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export declare const ListArea: ({ elements, pathname, isGrouped, hasSearch, searchPlaceholder, isIntegrated, isSorted, itemClassName, maxHeight, noElementsView, "data-testid": dataTestId, routerLinkElement, }: ListAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
58
62
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as s, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { D as u } from "../../index.es-BWgXLqXn.js";
|
|
3
|
-
import { E as
|
|
4
|
-
import { L as
|
|
3
|
+
import { E as C } from "../../index.es-h2lMdt7G.js";
|
|
4
|
+
import { L as b } from "../../index.es-fnFnw2P1.js";
|
|
5
5
|
import { o as p } from "../../orderBy-Bd48bw88.js";
|
|
6
|
-
import { useState as
|
|
7
|
-
import { SearchBar as
|
|
8
|
-
import { g as
|
|
9
|
-
const
|
|
6
|
+
import { useState as B, useMemo as v } from "react";
|
|
7
|
+
import { SearchBar as D } from "../SearchBar/SearchBar.js";
|
|
8
|
+
import { g as j, a as E, s as e } from "../../ListAreaService-BVtuBN0K.js";
|
|
9
|
+
const z = ({
|
|
10
10
|
elements: r,
|
|
11
11
|
pathname: o,
|
|
12
12
|
isGrouped: i = !1,
|
|
@@ -17,31 +17,32 @@ const q = ({
|
|
|
17
17
|
itemClassName: c = "",
|
|
18
18
|
maxHeight: T = "100%",
|
|
19
19
|
noElementsView: $,
|
|
20
|
+
"data-testid": g,
|
|
20
21
|
routerLinkElement: d
|
|
21
22
|
}) => {
|
|
22
|
-
const [
|
|
23
|
-
if (!
|
|
24
|
-
const n = r.filter((f) => f.title.toLowerCase().includes(
|
|
23
|
+
const [t, x] = B(""), a = v(() => {
|
|
24
|
+
if (!t) return l ? p(r, "title") : r;
|
|
25
|
+
const n = r.filter((f) => f.title.toLowerCase().includes(t.toLowerCase()) || f.subTitle?.toLowerCase().includes(t.toLowerCase()) || f.overlineTitle?.toLowerCase().includes(t.toLowerCase()));
|
|
25
26
|
return l ? p(n, "title") : n;
|
|
26
|
-
}, [
|
|
27
|
-
() => i ?
|
|
27
|
+
}, [t, r, l]), y = v(
|
|
28
|
+
() => i ? j(a, o, c, d) : E(a, o, c, d),
|
|
28
29
|
[a, o, c, i, d]
|
|
29
30
|
);
|
|
30
31
|
return /* @__PURE__ */ s(
|
|
31
|
-
|
|
32
|
+
C,
|
|
32
33
|
{
|
|
33
34
|
"data-testid": "elevation",
|
|
34
35
|
elevation: m ? 0 : 1,
|
|
35
|
-
className: `${
|
|
36
|
-
children: /* @__PURE__ */ h("div", { className:
|
|
36
|
+
className: `${e.mainElevation}`,
|
|
37
|
+
children: /* @__PURE__ */ h("div", { className: e.fullWidth, children: [
|
|
37
38
|
L && r.length > 0 && /* @__PURE__ */ h("span", { "data-testid": "search-bar-container", children: [
|
|
38
39
|
m && /* @__PURE__ */ s(u, {}),
|
|
39
40
|
/* @__PURE__ */ s(
|
|
40
|
-
|
|
41
|
+
D,
|
|
41
42
|
{
|
|
42
|
-
searchTerm:
|
|
43
|
-
setSearchTerm:
|
|
44
|
-
className:
|
|
43
|
+
searchTerm: t,
|
|
44
|
+
setSearchTerm: x,
|
|
45
|
+
className: e.searchbar,
|
|
45
46
|
placeholder: w
|
|
46
47
|
}
|
|
47
48
|
),
|
|
@@ -49,11 +50,11 @@ const q = ({
|
|
|
49
50
|
] }),
|
|
50
51
|
a.length === 0 && $,
|
|
51
52
|
/* @__PURE__ */ s(
|
|
52
|
-
|
|
53
|
+
b,
|
|
53
54
|
{
|
|
54
|
-
"data-testid":
|
|
55
|
-
items:
|
|
56
|
-
className: `${
|
|
55
|
+
"data-testid": g,
|
|
56
|
+
items: y,
|
|
57
|
+
className: `${e.list} ${e.primaryText} ${i ? "" : e.roundedBottom}`,
|
|
57
58
|
style: { maxHeight: T },
|
|
58
59
|
showDivider: !1
|
|
59
60
|
}
|
|
@@ -63,5 +64,5 @@ const q = ({
|
|
|
63
64
|
);
|
|
64
65
|
};
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
z as ListArea
|
|
67
68
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as r, Fragment as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as p } from "../../index.es-D54RuMc_.js";
|
|
3
3
|
import { a as s, s as a, f as u } from "../../react.esm-CX1WJ2Pp.js";
|
|
4
4
|
import { ListArea as c } from "./ListArea.js";
|
|
5
|
-
import { g as h } from "../../ListAreaService-
|
|
5
|
+
import { g as h } from "../../ListAreaService-BVtuBN0K.js";
|
|
6
6
|
import { d as m, t as n, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
7
7
|
m("ListArea Test", () => {
|
|
8
8
|
const o = [
|
|
@@ -4,7 +4,7 @@ import "../../index.es-3043KTnb.js";
|
|
|
4
4
|
import "../../index.es-D54RuMc_.js";
|
|
5
5
|
import "../Iconify/Iconify.js";
|
|
6
6
|
import "../../enums/AvailableCustomIcons.js";
|
|
7
|
-
import { g as a, a as g, m as d } from "../../ListAreaService-
|
|
7
|
+
import { g as a, a as g, m as d } from "../../ListAreaService-BVtuBN0K.js";
|
|
8
8
|
export {
|
|
9
9
|
a as getGroupedItems,
|
|
10
10
|
g as getListedItems,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, Fragment as
|
|
1
|
+
import { jsx as n, Fragment as d } from "react/jsx-runtime";
|
|
2
2
|
import { a as o, s as e } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
|
-
import { OnboardingBanner as
|
|
4
|
-
import { d, t as
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { OnboardingBanner as i } from "./OnboardingBanner.js";
|
|
4
|
+
import { d as a, t as s, a as r, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
5
|
+
a("Onboarding Banner Test", () => {
|
|
6
|
+
s("render OnboardingBanner with headline & description text", () => {
|
|
7
7
|
o(
|
|
8
8
|
/* @__PURE__ */ n(
|
|
9
|
-
|
|
9
|
+
i,
|
|
10
10
|
{
|
|
11
11
|
headline: "test",
|
|
12
12
|
description: "test description",
|
|
@@ -15,56 +15,56 @@ d("Onboarding Banner Test", () => {
|
|
|
15
15
|
}
|
|
16
16
|
)
|
|
17
17
|
), t(e.getByText("test")).toBeInTheDocument(), t(e.getByText("test description")).toBeInTheDocument();
|
|
18
|
-
}),
|
|
18
|
+
}), s("render OnboardingBanner with media content", () => {
|
|
19
19
|
o(
|
|
20
20
|
/* @__PURE__ */ n(
|
|
21
|
-
|
|
21
|
+
i,
|
|
22
22
|
{
|
|
23
23
|
headline: "test",
|
|
24
24
|
description: "test description",
|
|
25
|
-
mediaContent: /* @__PURE__ */ n(
|
|
25
|
+
mediaContent: /* @__PURE__ */ n(d, { children: "Element" }),
|
|
26
26
|
isVisible: !0,
|
|
27
27
|
onClose: r.fn()
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
), t(e.getByText("Element")).toBeInTheDocument();
|
|
31
|
-
}),
|
|
31
|
+
}), s("render OnboardingBanner with buttons", () => {
|
|
32
32
|
o(
|
|
33
33
|
/* @__PURE__ */ n(
|
|
34
|
-
|
|
34
|
+
i,
|
|
35
35
|
{
|
|
36
36
|
headline: "test",
|
|
37
37
|
description: "test description",
|
|
38
38
|
isVisible: !0,
|
|
39
39
|
onClose: r.fn(),
|
|
40
|
-
buttons: [{ label: "button-1" }, { label: "button-2" }]
|
|
40
|
+
buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
), t(e.getByText("button-1")).toBeInTheDocument(), t(e.getByText("button-2")).toBeInTheDocument(), t(e.queryByText("button-3")).not.toBeInTheDocument();
|
|
44
|
-
}),
|
|
44
|
+
}), s("calls onClose when close button is clicked", () => {
|
|
45
45
|
const l = r.fn();
|
|
46
46
|
o(
|
|
47
47
|
/* @__PURE__ */ n(
|
|
48
|
-
|
|
48
|
+
i,
|
|
49
49
|
{
|
|
50
50
|
headline: "test",
|
|
51
51
|
description: "test description",
|
|
52
52
|
isVisible: !0,
|
|
53
53
|
onClose: l,
|
|
54
|
-
buttons: [{ label: "button-1" }, { label: "
|
|
54
|
+
buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
), e.getByTestId("onboarding-banner-close-button").click(), t(l).toHaveBeenCalledTimes(1);
|
|
58
|
-
}),
|
|
58
|
+
}), s("renders nothing when isVisibility is false", () => {
|
|
59
59
|
o(
|
|
60
60
|
/* @__PURE__ */ n(
|
|
61
|
-
|
|
61
|
+
i,
|
|
62
62
|
{
|
|
63
63
|
headline: "test",
|
|
64
64
|
description: "test description",
|
|
65
65
|
isVisible: !1,
|
|
66
66
|
onClose: r.fn(),
|
|
67
|
-
buttons: [{ label: "button-1" }, { label: "button-2" }]
|
|
67
|
+
buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
), t(e.queryByText("test")).not.toBeInTheDocument();
|
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.
|
|
4
|
+
"version": "2.2.0",
|
|
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>",
|