@hortiview/shared-components 0.0.5053 → 0.0.5110
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/dist/ListAreaService-DhlEJxAH.js +74 -0
- package/dist/assets/AlertBanner.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.js +15 -16
- package/dist/components/ContextMenu/ContextMenu.js +23 -13
- package/dist/components/ListArea/ListArea.js +1 -1
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/ListArea/ListAreaService.d.ts +8 -0
- package/dist/components/ListArea/ListAreaService.js +1 -1
- package/dist/types/ListElement.d.ts +4 -0
- package/package.json +1 -1
- package/dist/ListAreaService-jz92va76.js +0 -68
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "./assets/ListAreaService.css";
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { TypoButton as C, TypoSubtitle as L, TypoBody as x, Icon as N } from "@element/react-components";
|
|
4
|
+
import { Iconify as E } from "./components/Iconify/Iconify.js";
|
|
5
|
+
import { AvailableCustomIcons as $ } from "./enums/AvailableCustomIcons.js";
|
|
6
|
+
const W = "_fullWidth_1y0ty_1", j = "_mainElevation_1y0ty_5", S = "_searchbar_1y0ty_11", w = "_roundedBottom_1y0ty_19", A = "_list_1y0ty_24", G = "_listItem_1y0ty_52", O = "_trailingIcon_1y0ty_56", P = "_groupedListItem_1y0ty_68", _ = {
|
|
7
|
+
fullWidth: W,
|
|
8
|
+
mainElevation: j,
|
|
9
|
+
searchbar: S,
|
|
10
|
+
roundedBottom: w,
|
|
11
|
+
list: A,
|
|
12
|
+
listItem: G,
|
|
13
|
+
trailingIcon: O,
|
|
14
|
+
groupedListItem: P
|
|
15
|
+
}, M = (t, i, n, r) => {
|
|
16
|
+
const s = t.reduce((o, m) => {
|
|
17
|
+
const { groupName: e, ...a } = m;
|
|
18
|
+
return !e || typeof e != "string" || (o[e] || (o[e] = {
|
|
19
|
+
groupName: /* @__PURE__ */ l(C, { children: e }),
|
|
20
|
+
id: e,
|
|
21
|
+
items: []
|
|
22
|
+
}), o[e].items = [
|
|
23
|
+
...o[e].items,
|
|
24
|
+
g(a, i, n, !0, r)
|
|
25
|
+
]), o;
|
|
26
|
+
}, {});
|
|
27
|
+
return Object.values(s);
|
|
28
|
+
}, Q = (t, i, n, r) => t.map((s) => g(s, i, n, !1, r)), g = (t, i, n, r, s) => {
|
|
29
|
+
const {
|
|
30
|
+
id: o,
|
|
31
|
+
title: m,
|
|
32
|
+
subTitle: e,
|
|
33
|
+
route: a,
|
|
34
|
+
value: I,
|
|
35
|
+
noNavigation: y,
|
|
36
|
+
disabled: d,
|
|
37
|
+
icon: v,
|
|
38
|
+
iconType: p,
|
|
39
|
+
trailingIcon: f,
|
|
40
|
+
trailingIconType: T,
|
|
41
|
+
actionButton: h,
|
|
42
|
+
onClick: B,
|
|
43
|
+
customTitle: u,
|
|
44
|
+
listItemClassName: b
|
|
45
|
+
} = t, c = i === a;
|
|
46
|
+
return {
|
|
47
|
+
id: o,
|
|
48
|
+
key: o,
|
|
49
|
+
select: c,
|
|
50
|
+
primaryText: u ?? /* @__PURE__ */ l(L, { level: 1, bold: c, themeColor: c ? "primary" : void 0, children: m }),
|
|
51
|
+
secondaryText: e && !u ? /* @__PURE__ */ l(x, { level: 2, themeColor: c ? "primary" : void 0, children: e }) : void 0,
|
|
52
|
+
overlineText: t.overlineTitle,
|
|
53
|
+
trailingBlock: h ?? f ?? /* @__PURE__ */ l(N, { icon: "arrow_right" }),
|
|
54
|
+
leadingBlock: q(v),
|
|
55
|
+
value: I,
|
|
56
|
+
componentProps: {
|
|
57
|
+
id: o,
|
|
58
|
+
key: o,
|
|
59
|
+
leadingBlockType: p ?? "icon",
|
|
60
|
+
trailingBlockType: T ?? "icon",
|
|
61
|
+
className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""} ${b ?? ""}`,
|
|
62
|
+
onClick: (z, k) => B?.(k),
|
|
63
|
+
tag: d || y ? void 0 : s ?? "a",
|
|
64
|
+
to: d || y ? void 0 : a,
|
|
65
|
+
disabled: d
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, q = (t) => typeof t == "string" && t in $ ? /* @__PURE__ */ l(E, { icon: t }) : t;
|
|
69
|
+
export {
|
|
70
|
+
Q as a,
|
|
71
|
+
M as g,
|
|
72
|
+
g as m,
|
|
73
|
+
_ as s
|
|
74
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._messageContainer_1kpsp_1{border-radius:.25rem;padding:.5rem 1rem;width:-moz-available;width:-webkit-fill-available;width:stretch}._info_1kpsp_9{border:1px solid var(--lmnt-theme-on-secondary-stroke);background:var(--lmnt-theme-secondary-50)}._danger_1kpsp_14{border:1px solid var(--lmnt-theme-on-danger-stroke);background:var(--lmnt-theme-danger-50)}._success_1kpsp_19{border:1px solid var(--lmnt-theme-on-success-stroke);background:var(--lmnt-theme-success-50)}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import "../../assets/AlertBanner.css";
|
|
2
|
-
import { jsx as e, Fragment as
|
|
3
|
-
import { Group as
|
|
4
|
-
import { a as
|
|
5
|
-
const
|
|
6
|
-
messageContainer:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
] }) }) : /* @__PURE__ */ e(t, {});
|
|
2
|
+
import { jsx as e, Fragment as a, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import { Group as p, TypoBody as l } from "@element/react-components";
|
|
4
|
+
import { a as m } from "../../useBreakpoint-DROHPVxO.js";
|
|
5
|
+
const d = "_messageContainer_1kpsp_1", g = "_info_1kpsp_9", _ = "_danger_1kpsp_14", f = "_success_1kpsp_19", n = {
|
|
6
|
+
messageContainer: d,
|
|
7
|
+
info: g,
|
|
8
|
+
danger: _,
|
|
9
|
+
success: f
|
|
10
|
+
}, v = ({ text: s, color: r = "info", isOpen: o = !0, action: i }) => {
|
|
11
|
+
const { isLg: t } = m();
|
|
12
|
+
return o ? /* @__PURE__ */ e("div", { className: `${n.messageContainer} ${n[r]}`, children: /* @__PURE__ */ c(p, { direction: t ? "horizontal" : "vertical", primaryAlign: "space-between", secondaryAlign: "center", children: [
|
|
13
|
+
typeof s == "string" ? /* @__PURE__ */ e(l, { bold: !0, level: 2, children: s }) : /* @__PURE__ */ e("div", { children: s }),
|
|
14
|
+
i
|
|
15
|
+
] }) }) : /* @__PURE__ */ e(a, {});
|
|
17
16
|
};
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
v as AlertBanner
|
|
20
19
|
};
|
|
@@ -1,40 +1,50 @@
|
|
|
1
1
|
import "../../assets/ContextMenu.css";
|
|
2
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { Menu as
|
|
4
|
-
import { useState as f, useCallback as
|
|
5
|
-
const
|
|
6
|
-
menu:
|
|
7
|
-
},
|
|
8
|
-
const [e, t] = f(!1),
|
|
3
|
+
import { Menu as a, IconButton as m, List as r, ListItem as d } from "@element/react-components";
|
|
4
|
+
import { useState as f, useCallback as i, useEffect as p } from "react";
|
|
5
|
+
const C = "_menu_1rfel_1", k = {
|
|
6
|
+
menu: C
|
|
7
|
+
}, h = ({ triggerOpen: o = null, actions: u }) => {
|
|
8
|
+
const [e, t] = f(!1), c = i(() => {
|
|
9
9
|
t(!e);
|
|
10
|
-
}, [e]),
|
|
10
|
+
}, [e]), s = i(() => {
|
|
11
11
|
t(!1);
|
|
12
12
|
}, []);
|
|
13
13
|
return p(() => {
|
|
14
14
|
t(o !== null ? o : !1);
|
|
15
15
|
}, [o]), /* @__PURE__ */ n(
|
|
16
|
-
|
|
16
|
+
a,
|
|
17
17
|
{
|
|
18
|
-
className:
|
|
18
|
+
className: k.menu,
|
|
19
19
|
"data-testid": "selectionmenu",
|
|
20
20
|
open: e,
|
|
21
21
|
surfaceOnly: !0,
|
|
22
22
|
hoistToBody: !0,
|
|
23
|
-
onClose:
|
|
23
|
+
onClose: s,
|
|
24
24
|
trigger: /* @__PURE__ */ n(
|
|
25
25
|
m,
|
|
26
26
|
{
|
|
27
27
|
variant: e ? "filled-primary" : void 0,
|
|
28
28
|
"data-testid": "openButton",
|
|
29
29
|
icon: "more_vert",
|
|
30
|
-
onClick:
|
|
30
|
+
onClick: c
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
children: /* @__PURE__ */ n(r, { children:
|
|
33
|
+
children: /* @__PURE__ */ n(r, { children: u.map((l) => /* @__PURE__ */ n(
|
|
34
|
+
d,
|
|
35
|
+
{
|
|
36
|
+
...l,
|
|
37
|
+
leadingBlockType: "icon",
|
|
38
|
+
"data-testid": "listItemButton",
|
|
39
|
+
onClick: () => {
|
|
40
|
+
l?.onClick?.(), s();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)) })
|
|
34
44
|
},
|
|
35
45
|
"selectionmenu"
|
|
36
46
|
);
|
|
37
47
|
};
|
|
38
48
|
export {
|
|
39
|
-
|
|
49
|
+
h as ContextMenu
|
|
40
50
|
};
|
|
@@ -4,7 +4,7 @@ import { g as Hr } from "../../_commonjsHelpers-CT_km90n.js";
|
|
|
4
4
|
import { _ as H, a as Tr, b as wr, c as T, d as Nr, e as Wr, i as h, f as N, h as B, j as Xr, k as zr, l as I, m as Yr, n as Zr, o as Jr, p as W, q as Qr, r as Or, s as Pr, t as kr, u as Vr } from "../../get-Dyz8NMrE.js";
|
|
5
5
|
import { useState as re, useMemo as k } from "react";
|
|
6
6
|
import { SearchBar as ee } from "../SearchBar/SearchBar.js";
|
|
7
|
-
import { g as ae, a as te, s as m } from "../../ListAreaService-
|
|
7
|
+
import { g as ae, a as te, s as m } from "../../ListAreaService-DhlEJxAH.js";
|
|
8
8
|
var ne = H;
|
|
9
9
|
function se() {
|
|
10
10
|
this.__data__ = new ne(), this.size = 0;
|
|
@@ -2,7 +2,7 @@ import { jsx as r, Fragment as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { TypoButton as p } from "@element/react-components";
|
|
3
3
|
import { r as s, s as a, f as u } from "../../react.esm-C0LtovhP.js";
|
|
4
4
|
import { ListArea as c } from "./ListArea.js";
|
|
5
|
-
import { g as h } from "../../ListAreaService-
|
|
5
|
+
import { g as h } from "../../ListAreaService-DhlEJxAH.js";
|
|
6
6
|
import { d as m, t as n, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
7
7
|
m("ListArea Test", () => {
|
|
8
8
|
const o = [
|
|
@@ -21,6 +21,8 @@ export declare const getGroupedItems: (items: ListElement[], pathname: string, i
|
|
|
21
21
|
* @returns an array of objects with List component schema
|
|
22
22
|
*/
|
|
23
23
|
export declare const getListedItems: (items: ListElement[], pathname: string, itemClassName: string, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
|
|
24
|
+
id: string;
|
|
25
|
+
key: string;
|
|
24
26
|
select: boolean;
|
|
25
27
|
primaryText: JSX.Element;
|
|
26
28
|
secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -29,6 +31,8 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
|
|
|
29
31
|
leadingBlock: string | JSX.Element | undefined;
|
|
30
32
|
value: string | undefined;
|
|
31
33
|
componentProps: {
|
|
34
|
+
id: string;
|
|
35
|
+
key: string;
|
|
32
36
|
leadingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
33
37
|
trailingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
34
38
|
className: string;
|
|
@@ -47,6 +51,8 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
|
|
|
47
51
|
* @returns an object with List component schema
|
|
48
52
|
*/
|
|
49
53
|
export declare const mapListElement: (element: ListElement, pathname: string | undefined, itemClassName: string | undefined, isGrouped: boolean, routerLinkElement: undefined | React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>) => {
|
|
54
|
+
id: string;
|
|
55
|
+
key: string;
|
|
50
56
|
select: boolean;
|
|
51
57
|
primaryText: JSX.Element;
|
|
52
58
|
secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -55,6 +61,8 @@ export declare const mapListElement: (element: ListElement, pathname: string | u
|
|
|
55
61
|
leadingBlock: string | JSX.Element | undefined;
|
|
56
62
|
value: string | undefined;
|
|
57
63
|
componentProps: {
|
|
64
|
+
id: string;
|
|
65
|
+
key: string;
|
|
58
66
|
leadingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
59
67
|
trailingBlockType: "icon" | "badge" | "image" | "meta" | "checkbox" | "radio" | "switch" | "avatar" | "lgImage" | "thumbnail";
|
|
60
68
|
className: string;
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "@element/react-components";
|
|
3
3
|
import "../Iconify/Iconify.js";
|
|
4
4
|
import "../../enums/AvailableCustomIcons.js";
|
|
5
|
-
import { g as s, a as i, m as a } from "../../ListAreaService-
|
|
5
|
+
import { g as s, a as i, m as a } from "../../ListAreaService-DhlEJxAH.js";
|
|
6
6
|
export {
|
|
7
7
|
s as getGroupedItems,
|
|
8
8
|
i as getListedItems,
|
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": "0.0.
|
|
4
|
+
"version": "0.0.5110",
|
|
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>",
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "./assets/ListAreaService.css";
|
|
2
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import { TypoButton as b, TypoSubtitle as k, TypoBody as L, Icon as x } from "@element/react-components";
|
|
4
|
-
import { Iconify as C } from "./components/Iconify/Iconify.js";
|
|
5
|
-
import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
|
|
6
|
-
const N = "_fullWidth_1y0ty_1", W = "_mainElevation_1y0ty_5", $ = "_searchbar_1y0ty_11", j = "_roundedBottom_1y0ty_19", S = "_list_1y0ty_24", w = "_listItem_1y0ty_52", A = "_trailingIcon_1y0ty_56", G = "_groupedListItem_1y0ty_68", _ = {
|
|
7
|
-
fullWidth: N,
|
|
8
|
-
mainElevation: W,
|
|
9
|
-
searchbar: $,
|
|
10
|
-
roundedBottom: j,
|
|
11
|
-
list: S,
|
|
12
|
-
listItem: w,
|
|
13
|
-
trailingIcon: A,
|
|
14
|
-
groupedListItem: G
|
|
15
|
-
}, J = (t, i, n, r) => {
|
|
16
|
-
const s = t.reduce((e, a) => {
|
|
17
|
-
const { groupName: o, ...m } = a;
|
|
18
|
-
return !o || typeof o != "string" || (e[o] || (e[o] = {
|
|
19
|
-
groupName: /* @__PURE__ */ l(b, { children: o }),
|
|
20
|
-
id: o,
|
|
21
|
-
items: []
|
|
22
|
-
}), e[o].items = [
|
|
23
|
-
...e[o].items,
|
|
24
|
-
g(m, i, n, !0, r)
|
|
25
|
-
]), e;
|
|
26
|
-
}, {});
|
|
27
|
-
return Object.values(s);
|
|
28
|
-
}, K = (t, i, n, r) => t.map((s) => g(s, i, n, !1, r)), g = (t, i, n, r, s) => {
|
|
29
|
-
const {
|
|
30
|
-
title: e,
|
|
31
|
-
subTitle: a,
|
|
32
|
-
route: o,
|
|
33
|
-
value: m,
|
|
34
|
-
noNavigation: y,
|
|
35
|
-
disabled: d,
|
|
36
|
-
icon: I,
|
|
37
|
-
iconType: p,
|
|
38
|
-
trailingIcon: v,
|
|
39
|
-
trailingIconType: f,
|
|
40
|
-
actionButton: T,
|
|
41
|
-
onClick: h,
|
|
42
|
-
customTitle: u
|
|
43
|
-
} = t, c = i === o;
|
|
44
|
-
return {
|
|
45
|
-
select: c,
|
|
46
|
-
primaryText: u ?? /* @__PURE__ */ l(k, { level: 1, bold: c, themeColor: c ? "primary" : void 0, children: e }),
|
|
47
|
-
secondaryText: a && !u ? /* @__PURE__ */ l(L, { level: 2, themeColor: c ? "primary" : void 0, children: a }) : void 0,
|
|
48
|
-
overlineText: t.overlineTitle,
|
|
49
|
-
trailingBlock: T ?? v ?? /* @__PURE__ */ l(x, { icon: "arrow_right" }),
|
|
50
|
-
leadingBlock: O(I),
|
|
51
|
-
value: m,
|
|
52
|
-
componentProps: {
|
|
53
|
-
leadingBlockType: p ?? "icon",
|
|
54
|
-
trailingBlockType: f ?? "icon",
|
|
55
|
-
className: `${p === "avatar" ? "" : _.listItem} ${n} ${r ? _.groupedListItem : ""}`,
|
|
56
|
-
onClick: (P, B) => h?.(B),
|
|
57
|
-
tag: d || y ? void 0 : s ?? "a",
|
|
58
|
-
to: d || y ? void 0 : o,
|
|
59
|
-
disabled: d
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}, O = (t) => typeof t == "string" && t in E ? /* @__PURE__ */ l(C, { icon: t }) : t;
|
|
63
|
-
export {
|
|
64
|
-
K as a,
|
|
65
|
-
J as g,
|
|
66
|
-
g as m,
|
|
67
|
-
_ as s
|
|
68
|
-
};
|