@hortiview/shared-components 2.1.0 → 2.3.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 +13 -0
- package/dist/AlertBanner-75jjene1.js +26 -0
- package/dist/{ListAreaService-Wq9IkwWN.js → ListAreaService-BVtuBN0K.js} +34 -33
- package/dist/assets/AlertBanner.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.d.ts +1 -2
- package/dist/components/AlertBanner/AlertBanner.js +6 -22
- package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.d.ts +21 -0
- package/dist/components/AlertBanner/LinkBanner.js +37 -0
- package/dist/components/AlertBanner/LinkBanner.test.d.ts +1 -0
- package/dist/components/AlertBanner/LinkBanner.test.js +17 -0
- 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/Modal/Modal.js +70 -69
- package/dist/components/ModulePadding/ModulePadding.js +1 -1
- package/dist/components/OnboardingBanner/OnboardingBanner.test.js +18 -18
- package/dist/components/Stepper/Stepper.d.ts +4 -3
- package/dist/components/Stepper/Stepper.js +33 -21
- package/dist/components/Stepper/Stepper.test.js +40 -64
- package/dist/components/Stepper/components/StepperButton.d.ts +8 -2
- package/dist/components/Stepper/components/StepperButton.js +54 -38
- package/dist/components/Stepper/stepperTypes.d.ts +31 -1
- package/dist/main.d.ts +5 -4
- package/dist/main.js +99 -97
- package/dist/types/ListElement.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [2.3.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.2.0...v2.3.0) (2025-08-20)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add additional props to the stepper and stepper buttons ([e7a404d](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/e7a404df5f97ec90dbfc4055cef8026f6d84a136))
|
|
6
|
+
* added new LinkBanner component ([86d5360](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/86d5360b713cff6abd2bf6658e1f934b972c7020))
|
|
7
|
+
|
|
8
|
+
## [2.2.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.1.0...v2.2.0) (2025-07-24)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add new data-testids and fix onboardingbanner test ([1ac90c1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/1ac90c1c4db3ff909e6ac3beb52863e6a8e55937))
|
|
13
|
+
|
|
1
14
|
## [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
15
|
|
|
3
16
|
### Features
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as n, Fragment as i, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { G as l } from "./index.es-DntoATwO.js";
|
|
3
|
+
import { I as _ } from "./index.es-3043KTnb.js";
|
|
4
|
+
import { T as d } from "./index.es-D54RuMc_.js";
|
|
5
|
+
import './assets/AlertBanner.css';const m = "_messageContainer_2hnjr_1", g = "_info_2hnjr_9", h = "_danger_2hnjr_14", p = "_success_2hnjr_19", f = "_warning_2hnjr_24", u = "_closeIcon_2hnjr_29", j = "_linkBanner_2hnjr_34", s = {
|
|
6
|
+
messageContainer: m,
|
|
7
|
+
info: g,
|
|
8
|
+
danger: h,
|
|
9
|
+
success: p,
|
|
10
|
+
warning: f,
|
|
11
|
+
closeIcon: u,
|
|
12
|
+
linkBanner: j
|
|
13
|
+
}, k = ({
|
|
14
|
+
text: e,
|
|
15
|
+
color: o = "info",
|
|
16
|
+
isOpen: a = !0,
|
|
17
|
+
isBold: c = !0,
|
|
18
|
+
onClose: r
|
|
19
|
+
}) => a ? /* @__PURE__ */ n("div", { "data-testid": "alert-banner", className: `${s.messageContainer} ${s[o]}`, children: /* @__PURE__ */ t(l, { primaryAlign: "space-between", secondaryAlign: "top", gap: "dense", fullWidth: !0, children: [
|
|
20
|
+
typeof e == "string" ? /* @__PURE__ */ n(d, { bold: c, level: 2, children: e }) : /* @__PURE__ */ n("div", { style: { width: "100%" }, children: e }),
|
|
21
|
+
r && /* @__PURE__ */ n(_, { icon: "close", iconSize: "small", onClick: r, className: s.closeIcon })
|
|
22
|
+
] }) }) : /* @__PURE__ */ n(i, {});
|
|
23
|
+
export {
|
|
24
|
+
k as A,
|
|
25
|
+
s
|
|
26
|
+
};
|
|
@@ -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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._messageContainer_2hnjr_1{border-radius:.25rem;padding:.75rem 1rem;width:-moz-available;width:-webkit-fill-available;width:stretch}._info_2hnjr_9{border:1px solid var(--lmnt-theme-on-secondary-stroke);background:var(--lmnt-theme-secondary-50)}._danger_2hnjr_14{border:1px solid var(--lmnt-theme-on-danger-stroke);background:var(--lmnt-theme-danger-50)}._success_2hnjr_19{border:1px solid var(--lmnt-theme-on-success-stroke);background:var(--lmnt-theme-success-50)}._warning_2hnjr_24{border:1px solid var(--lmnt-utility-orange-surface);background:#f6a6491a}._closeIcon_2hnjr_29{align-self:flex-start;margin-right:-.15rem}._linkBanner_2hnjr_34{cursor:pointer}
|
package/dist/assets/Modal.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._modal_fr8bw_1 div[class*=lmnt-modal__surface]{max-height:100svh!important;max-width:100svw!important}._title_fr8bw_6{header{display:flex;justify-content:start;padding-left:.5rem!important;>div{width:100%;margin-left:0!important}}}._titleWithoutCloseIcon_fr8bw_18{margin-left:1rem!important}._closeButton_fr8bw_22:before{display:none!important}._closeButton_fr8bw_22:hover{background-color:var(--lmnt-theme-surface-variant)!important}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AlertBannerProps = {
|
|
1
|
+
export type AlertBannerProps = {
|
|
2
2
|
text: string | JSX.Element;
|
|
3
3
|
color?: 'danger' | 'info' | 'success' | 'warning';
|
|
4
4
|
isOpen?: boolean;
|
|
@@ -13,4 +13,3 @@ type AlertBannerProps = {
|
|
|
13
13
|
action?: JSX.Element;
|
|
14
14
|
};
|
|
15
15
|
export declare const AlertBanner: ({ text, color, isOpen, isBold, onClose, }: AlertBannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
messageContainer: d,
|
|
7
|
-
info: g,
|
|
8
|
-
danger: p,
|
|
9
|
-
success: f,
|
|
10
|
-
warning: u,
|
|
11
|
-
closeIcon: y
|
|
12
|
-
}, b = ({
|
|
13
|
-
text: s,
|
|
14
|
-
color: r = "info",
|
|
15
|
-
isOpen: i = !0,
|
|
16
|
-
isBold: c = !0,
|
|
17
|
-
onClose: o
|
|
18
|
-
}) => i ? /* @__PURE__ */ n("div", { "data-testid": "alert-banner", className: `${e.messageContainer} ${e[r]}`, children: /* @__PURE__ */ t(l, { primaryAlign: "space-between", secondaryAlign: "top", gap: "dense", children: [
|
|
19
|
-
typeof s == "string" ? /* @__PURE__ */ n(m, { bold: c, level: 2, children: s }) : /* @__PURE__ */ n("div", { children: s }),
|
|
20
|
-
o && /* @__PURE__ */ n(_, { icon: "close", iconSize: "small", onClick: o, className: e.closeIcon })
|
|
21
|
-
] }) }) : /* @__PURE__ */ n(a, {});
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../index.es-DntoATwO.js";
|
|
3
|
+
import "../../index.es-3043KTnb.js";
|
|
4
|
+
import "../../index.es-D54RuMc_.js";
|
|
5
|
+
import { A as e } from "../../AlertBanner-75jjene1.js";
|
|
22
6
|
export {
|
|
23
|
-
|
|
7
|
+
e as AlertBanner
|
|
24
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, Fragment as m } from "react/jsx-runtime";
|
|
2
2
|
import { a as t, s } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
3
|
import { a as o } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
4
|
-
import {
|
|
4
|
+
import { A as n } from "../../AlertBanner-75jjene1.js";
|
|
5
5
|
import { d as p, b as c, a as l, t as r, g as a } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
6
6
|
p("AlertBanner Test", () => {
|
|
7
7
|
c(() => {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AlertBannerProps } from './AlertBanner';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* LinkBanner component, shows an alert banner but with a link as text
|
|
5
|
+
* @param text - The text of the link.
|
|
6
|
+
* @param url - The URL the link points to.
|
|
7
|
+
* @param color - The color of the link banner.
|
|
8
|
+
* @param isOpen - Whether the link banner is open or not.
|
|
9
|
+
* @param isBold - Whether the text is bold or not.
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const LinkBanner: ({ text, color, isOpen, isBold, url, }: Omit<AlertBannerProps, "onClose" | "action" | "text"> & {
|
|
13
|
+
/**
|
|
14
|
+
* the given text is shown as a link, in addition a link icon is displayed
|
|
15
|
+
*/
|
|
16
|
+
url: string;
|
|
17
|
+
/**
|
|
18
|
+
* the text of the link
|
|
19
|
+
*/
|
|
20
|
+
text: string;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { G as l } from "../../index.es-DntoATwO.js";
|
|
3
|
+
import { T as s } from "../../index.es-D54RuMc_.js";
|
|
4
|
+
import { Iconify as p } from "../Iconify/Iconify.js";
|
|
5
|
+
import { A as m, s as c } from "../../AlertBanner-75jjene1.js";
|
|
6
|
+
const g = ({
|
|
7
|
+
text: n,
|
|
8
|
+
color: o = "info",
|
|
9
|
+
isOpen: t = !0,
|
|
10
|
+
isBold: e = !0,
|
|
11
|
+
url: i
|
|
12
|
+
}) => /* @__PURE__ */ r(
|
|
13
|
+
m,
|
|
14
|
+
{
|
|
15
|
+
color: o,
|
|
16
|
+
isOpen: t,
|
|
17
|
+
isBold: e,
|
|
18
|
+
text: /* @__PURE__ */ r("a", { href: i, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ a(
|
|
19
|
+
l,
|
|
20
|
+
{
|
|
21
|
+
direction: "horizontal",
|
|
22
|
+
primaryAlign: "space-between",
|
|
23
|
+
gap: "dense",
|
|
24
|
+
secondaryAlign: "center",
|
|
25
|
+
className: c.linkBanner,
|
|
26
|
+
fullWidth: !0,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ r(s, { bold: e, level: 2, children: n }),
|
|
29
|
+
/* @__PURE__ */ r(p, { icon: "open_in_new", pointer: !0 })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
) })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
export {
|
|
36
|
+
g as LinkBanner
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { a as r, s as e } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
|
+
import { a as o } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
4
|
+
import { LinkBanner as a } from "./LinkBanner.js";
|
|
5
|
+
import { d as n, b as i, a as m, t as p, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
6
|
+
n("LinkBanner Test", () => {
|
|
7
|
+
i(() => {
|
|
8
|
+
m.spyOn(o, "useBreakpoints").mockReturnValue({
|
|
9
|
+
isMobile: !1,
|
|
10
|
+
isTablet: !1,
|
|
11
|
+
isDesktop: !0,
|
|
12
|
+
isDesktopNavbar: !0
|
|
13
|
+
});
|
|
14
|
+
}), p("render LinkBanner with text", () => {
|
|
15
|
+
r(/* @__PURE__ */ s(a, { text: "Test", url: "#" })), t(e.getByText("Test")).toBeInTheDocument(), t(e.getByText("open_in_new")).toBeInTheDocument(), t(e.getByRole("link")).toHaveAttribute("href", "#");
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -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,
|