@hortiview/shared-components 0.0.6359 → 0.0.6403
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-BoNnFzrZ.js +82 -0
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/components/BaseView/BaseView.js +23 -23
- package/dist/components/ListArea/ListArea.js +1 -1
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/ListArea/ListAreaService.js +1 -1
- package/package.json +1 -1
- package/dist/ListAreaService-zxVNvD59.js +0 -80
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import "./assets/ListAreaService.css";
|
|
2
|
+
import { jsx as l, jsxs as b } from "react/jsx-runtime";
|
|
3
|
+
import { TypoButton as C, Group as k, TypoSubtitle as N, TypoBody as L, Icon as O } from "@element/react-components";
|
|
4
|
+
import { Iconify as E } from "./components/Iconify/Iconify.js";
|
|
5
|
+
import { AvailableCustomIcons as $ } from "./enums/AvailableCustomIcons.js";
|
|
6
|
+
const j = "_fullWidth_9hcwy_1", W = "_mainElevation_9hcwy_5", G = "_searchbar_9hcwy_11", S = "_roundedBottom_9hcwy_19", A = "_primaryText_9hcwy_24", P = "_noOverlineText_9hcwy_28", q = "_list_9hcwy_32", z = "_listItem_9hcwy_60", D = "_trailingIcon_9hcwy_64", F = "_groupedListItem_9hcwy_76", H = "_iconColor_9hcwy_80", J = "_overlineTitle_9hcwy_84", a = {
|
|
7
|
+
fullWidth: j,
|
|
8
|
+
mainElevation: W,
|
|
9
|
+
searchbar: G,
|
|
10
|
+
roundedBottom: S,
|
|
11
|
+
primaryText: A,
|
|
12
|
+
noOverlineText: P,
|
|
13
|
+
list: q,
|
|
14
|
+
listItem: z,
|
|
15
|
+
trailingIcon: D,
|
|
16
|
+
groupedListItem: F,
|
|
17
|
+
iconColor: H,
|
|
18
|
+
overlineTitle: J
|
|
19
|
+
}, Y = (e, n, r, c) => {
|
|
20
|
+
const o = e.reduce((i, s) => {
|
|
21
|
+
const { groupName: t, ...m } = s;
|
|
22
|
+
return !t || typeof t != "string" || (i[t] || (i[t] = {
|
|
23
|
+
groupName: /* @__PURE__ */ l(C, { children: t }),
|
|
24
|
+
id: t,
|
|
25
|
+
items: []
|
|
26
|
+
}), i[t].items = [
|
|
27
|
+
...i[t].items,
|
|
28
|
+
h(m, n, r, c)
|
|
29
|
+
]), i;
|
|
30
|
+
}, {});
|
|
31
|
+
return Object.values(o);
|
|
32
|
+
}, Z = (e, n, r, c) => e.map((o) => h(o, n, r, c)), h = (e, n, r, c) => {
|
|
33
|
+
const {
|
|
34
|
+
id: o,
|
|
35
|
+
title: i,
|
|
36
|
+
subTitle: s,
|
|
37
|
+
route: t,
|
|
38
|
+
value: m,
|
|
39
|
+
noNavigation: p,
|
|
40
|
+
disabled: _,
|
|
41
|
+
icon: g,
|
|
42
|
+
iconType: y,
|
|
43
|
+
trailingIcon: T,
|
|
44
|
+
trailingIconType: I,
|
|
45
|
+
actionButton: f,
|
|
46
|
+
onClick: w,
|
|
47
|
+
customTitle: u,
|
|
48
|
+
listItemClassName: x,
|
|
49
|
+
overlineTitle: v
|
|
50
|
+
} = e, d = n === t;
|
|
51
|
+
return {
|
|
52
|
+
id: o,
|
|
53
|
+
key: o,
|
|
54
|
+
select: d,
|
|
55
|
+
primaryText: o,
|
|
56
|
+
secondaryText: /* @__PURE__ */ b(k, { direction: "vertical", gap: "none", children: [
|
|
57
|
+
u ?? /* @__PURE__ */ l(N, { level: 1, bold: d, className: "lmnt-theme-on-surface-active", children: i }),
|
|
58
|
+
s && !u ? /* @__PURE__ */ l(L, { level: 2, themeColor: d ? "primary" : void 0, className: "lmnt-theme-on-surface-inactive", children: s }) : void 0
|
|
59
|
+
] }),
|
|
60
|
+
overlineText: v,
|
|
61
|
+
trailingBlock: f ?? T ?? /* @__PURE__ */ l(O, { icon: "arrow_right", className: a.iconColor }),
|
|
62
|
+
leadingBlock: K(g),
|
|
63
|
+
value: m,
|
|
64
|
+
componentProps: {
|
|
65
|
+
id: o,
|
|
66
|
+
key: o,
|
|
67
|
+
leadingBlockType: y ?? "icon",
|
|
68
|
+
trailingBlockType: I ?? "icon",
|
|
69
|
+
className: `${y === "avatar" ? "" : a.listItem} ${r} ${x ?? ""} ${v ? a.overlineTitle : a.noOverlineText}`,
|
|
70
|
+
onClick: (M, B) => w?.(B),
|
|
71
|
+
tag: _ || p ? void 0 : c ?? "a",
|
|
72
|
+
to: _ || p ? void 0 : t,
|
|
73
|
+
disabled: _
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}, K = (e) => typeof e == "string" && e in $ ? /* @__PURE__ */ l(E, { icon: e }) : e;
|
|
77
|
+
export {
|
|
78
|
+
Z as a,
|
|
79
|
+
Y as g,
|
|
80
|
+
h as m,
|
|
81
|
+
a as s
|
|
82
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._fullWidth_9hcwy_1{width:100%}._mainElevation_9hcwy_5{background:var(--lmnt-theme-background);border-radius:.5rem;width:100%}._searchbar_9hcwy_11 div{border:none}._searchbar_9hcwy_11 button{margin-right:.5rem}._roundedBottom_9hcwy_19{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}._primaryText_9hcwy_24 [class*=mdc-list-item__primary-text]{display:none!important}._noOverlineText_9hcwy_28 [class*=mdc-list-item__content]{margin-top:-.625rem}._list_9hcwy_32{padding-top:0;padding-bottom:0;overflow-y:auto}._list_9hcwy_32 [class*=mdc-list-item__overline-text]{margin-bottom:-2.25rem}._list_9hcwy_32::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 .25rem rgba(0,0,0,.2);border-radius:.5rem;margin-right:.25rem;background-color:var(--lmnt-theme-background)}._list_9hcwy_32::-webkit-scrollbar{width:.5rem;background-color:var(--lmnt-theme-background)}._list_9hcwy_32::-webkit-scrollbar-thumb{border-radius:.5rem;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:var(--lmnt-theme-primary-on-surface)}._listItem_9hcwy_60{border-bottom:.0775rem solid var(--lmnt-utility-gray-surface)}._listItem_9hcwy_60 i:not(._trailingIcon_9hcwy_64){color:var(--lmnt-theme-on-surface-inactive)}._listItem_9hcwy_60 i._trailingIcon_9hcwy_64{color:var(--lmnt-theme-on-surface-disabled)}._listItem_9hcwy_60 [class^=mdc-list-item__start]{margin:0 1rem!important;align-self:center!important}._groupedListItem_9hcwy_76{height:4.5rem!important}._iconColor_9hcwy_80{color:var(--lmnt-theme-on-surface-disabled)!important}._overlineTitle_9hcwy_84 [class*=mdc-list-item__overline-text]{color:var(--lmnt-theme-on-surface-inactive)!important;line-height:1rem!important}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import "../../assets/BaseView.css";
|
|
2
|
-
import { jsx as t, Fragment as
|
|
2
|
+
import { jsx as t, Fragment as k, jsxs as e } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as n } from "react";
|
|
4
|
-
import { EmptyView as
|
|
5
|
-
import { ListArea as
|
|
6
|
-
import { VerticalDivider as
|
|
7
|
-
import { a as
|
|
8
|
-
import { Grid as
|
|
9
|
-
import { BasicHeading as
|
|
10
|
-
const
|
|
11
|
-
divider:
|
|
4
|
+
import { EmptyView as y } from "../EmptyView/EmptyView.js";
|
|
5
|
+
import { ListArea as A } from "../ListArea/ListArea.js";
|
|
6
|
+
import { VerticalDivider as H } from "../VerticalDivider/VerticalDivider.js";
|
|
7
|
+
import { a as L } from "../../useBreakpoint-DROHPVxO.js";
|
|
8
|
+
import { Grid as V, GridRow as W, GridCol as a, Group as m } from "@element/react-components";
|
|
9
|
+
import { BasicHeading as u } from "../BasicHeading/BasicHeading.js";
|
|
10
|
+
const _ = "_divider_anyyu_1", j = {
|
|
11
|
+
divider: _
|
|
12
12
|
}, z = ({
|
|
13
13
|
action: d,
|
|
14
14
|
heading: c,
|
|
15
15
|
elements: o,
|
|
16
16
|
emptyText: s,
|
|
17
|
-
hasSearch:
|
|
18
|
-
isSorted:
|
|
17
|
+
hasSearch: p = !0,
|
|
18
|
+
isSorted: h = !0,
|
|
19
19
|
className: f,
|
|
20
20
|
withAvatar: v = !1,
|
|
21
21
|
listMaxHeight: g = "calc(100vh - 200px)",
|
|
@@ -23,29 +23,29 @@ const W = "_divider_anyyu_1", _ = {
|
|
|
23
23
|
routerLinkElement: C,
|
|
24
24
|
searchPlaceholder: B
|
|
25
25
|
}) => {
|
|
26
|
-
const { isLg: r } =
|
|
27
|
-
return /* @__PURE__ */ t(
|
|
28
|
-
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
-
c && /* @__PURE__ */ t(
|
|
26
|
+
const { isLg: r, isXs: G } = L(), i = n(() => o.find((x) => x.route === l), [l, o]), b = n(() => i?.component ?? (r ? /* @__PURE__ */ t(y, { subtitle: s }) : /* @__PURE__ */ t(k, {})), [i, r, s]), w = n(() => r ? !0 : !i, [i, r]);
|
|
27
|
+
return /* @__PURE__ */ t(V, { className: f ?? "", fullHeight: !0, fullWidth: !0, columnGap: 0, children: /* @__PURE__ */ e(W, { children: [
|
|
28
|
+
w && /* @__PURE__ */ e(a, { desktopCol: 4, tabletCol: 12, phoneCol: 12, children: [
|
|
29
|
+
/* @__PURE__ */ e(m, { direction: "vertical", fullWidth: !0, gap: G ? "dense" : "standard", children: [
|
|
30
|
+
c && /* @__PURE__ */ t(u, { heading: c, level: 4, marginBottom: 0, children: d }),
|
|
31
31
|
/* @__PURE__ */ t(
|
|
32
|
-
|
|
32
|
+
A,
|
|
33
33
|
{
|
|
34
34
|
elements: o,
|
|
35
|
-
hasSearch:
|
|
35
|
+
hasSearch: p,
|
|
36
36
|
maxHeight: g,
|
|
37
|
-
isSorted:
|
|
37
|
+
isSorted: h,
|
|
38
38
|
pathname: l,
|
|
39
39
|
routerLinkElement: C,
|
|
40
40
|
searchPlaceholder: B
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
] }),
|
|
44
|
-
r && /* @__PURE__ */ t(
|
|
44
|
+
r && /* @__PURE__ */ t(H, { className: j.divider, height: "100%" })
|
|
45
45
|
] }),
|
|
46
|
-
/* @__PURE__ */ t(
|
|
46
|
+
/* @__PURE__ */ t(a, { desktopCol: 8, tabletCol: 12, phoneCol: 12, children: /* @__PURE__ */ e(m, { direction: "vertical", fullWidth: !0, children: [
|
|
47
47
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
48
|
+
u,
|
|
49
49
|
{
|
|
50
50
|
heading: i?.detailTitle ?? i?.title ?? "",
|
|
51
51
|
level: 4,
|
|
@@ -56,7 +56,7 @@ const W = "_divider_anyyu_1", _ = {
|
|
|
56
56
|
children: i?.detailAction ?? d
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
|
|
59
|
+
b
|
|
60
60
|
] }) })
|
|
61
61
|
] }) });
|
|
62
62
|
};
|
|
@@ -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 w, d as Nr, e as Wr, f as h, h as N, j as B, k as Xr, l as zr, m as I, n as Yr, o as Zr, p as Jr, q as W, r as Qr, s as Or, t as Pr, u as kr, v as Vr } from "../../get-BRDhkfK0.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 T } from "../../ListAreaService-
|
|
7
|
+
import { g as ae, a as te, s as T } from "../../ListAreaService-BoNnFzrZ.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-BBemCHUU.js";
|
|
4
4
|
import { ListArea as c } from "./ListArea.js";
|
|
5
|
-
import { g as h } from "../../ListAreaService-
|
|
5
|
+
import { g as h } from "../../ListAreaService-BoNnFzrZ.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 = [
|
|
@@ -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-BoNnFzrZ.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.6403",
|
|
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,80 +0,0 @@
|
|
|
1
|
-
import "./assets/ListAreaService.css";
|
|
2
|
-
import { jsx as s, jsxs as B } from "react/jsx-runtime";
|
|
3
|
-
import { TypoButton as b, Group as k, TypoSubtitle as C, TypoBody as L, Icon as N } from "@element/react-components";
|
|
4
|
-
import { Iconify as O } from "./components/Iconify/Iconify.js";
|
|
5
|
-
import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
|
|
6
|
-
const $ = "_fullWidth_1ja2q_1", W = "_mainElevation_1ja2q_5", G = "_searchbar_1ja2q_11", S = "_roundedBottom_1ja2q_19", w = "_primaryText_1ja2q_24", A = "_noOverlineText_1ja2q_28", P = "_list_1ja2q_32", z = "_listItem_1ja2q_60", D = "_trailingIcon_1ja2q_64", F = "_groupedListItem_1ja2q_76", v = {
|
|
7
|
-
fullWidth: $,
|
|
8
|
-
mainElevation: W,
|
|
9
|
-
searchbar: G,
|
|
10
|
-
roundedBottom: S,
|
|
11
|
-
primaryText: w,
|
|
12
|
-
noOverlineText: A,
|
|
13
|
-
list: P,
|
|
14
|
-
listItem: z,
|
|
15
|
-
trailingIcon: D,
|
|
16
|
-
groupedListItem: F
|
|
17
|
-
}, V = (e, n, r, a) => {
|
|
18
|
-
const o = e.reduce((i, l) => {
|
|
19
|
-
const { groupName: t, ...c } = l;
|
|
20
|
-
return !t || typeof t != "string" || (i[t] || (i[t] = {
|
|
21
|
-
groupName: /* @__PURE__ */ s(b, { children: t }),
|
|
22
|
-
id: t,
|
|
23
|
-
items: []
|
|
24
|
-
}), i[t].items = [
|
|
25
|
-
...i[t].items,
|
|
26
|
-
y(c, n, r, a)
|
|
27
|
-
]), i;
|
|
28
|
-
}, {});
|
|
29
|
-
return Object.values(o);
|
|
30
|
-
}, X = (e, n, r, a) => e.map((o) => y(o, n, r, a)), y = (e, n, r, a) => {
|
|
31
|
-
const {
|
|
32
|
-
id: o,
|
|
33
|
-
title: i,
|
|
34
|
-
subTitle: l,
|
|
35
|
-
route: t,
|
|
36
|
-
value: c,
|
|
37
|
-
noNavigation: p,
|
|
38
|
-
disabled: m,
|
|
39
|
-
icon: I,
|
|
40
|
-
iconType: _,
|
|
41
|
-
trailingIcon: T,
|
|
42
|
-
trailingIconType: f,
|
|
43
|
-
actionButton: j,
|
|
44
|
-
onClick: x,
|
|
45
|
-
customTitle: u,
|
|
46
|
-
listItemClassName: h,
|
|
47
|
-
overlineTitle: g
|
|
48
|
-
} = e, d = n === t;
|
|
49
|
-
return {
|
|
50
|
-
id: o,
|
|
51
|
-
key: o,
|
|
52
|
-
select: d,
|
|
53
|
-
primaryText: o,
|
|
54
|
-
secondaryText: /* @__PURE__ */ B(k, { direction: "vertical", gap: "none", children: [
|
|
55
|
-
u ?? /* @__PURE__ */ s(C, { level: 1, bold: d, children: i }),
|
|
56
|
-
l && !u ? /* @__PURE__ */ s(L, { level: 2, themeColor: d ? "primary" : void 0, children: l }) : void 0
|
|
57
|
-
] }),
|
|
58
|
-
overlineText: g,
|
|
59
|
-
trailingBlock: j ?? T ?? /* @__PURE__ */ s(N, { icon: "arrow_right" }),
|
|
60
|
-
leadingBlock: H(I),
|
|
61
|
-
value: c,
|
|
62
|
-
componentProps: {
|
|
63
|
-
id: o,
|
|
64
|
-
key: o,
|
|
65
|
-
leadingBlockType: _ ?? "icon",
|
|
66
|
-
trailingBlockType: f ?? "icon",
|
|
67
|
-
className: `${_ === "avatar" ? "" : v.listItem} ${r} ${h ?? ""} ${g ? "" : v.noOverlineText}`,
|
|
68
|
-
onClick: (J, q) => x?.(q),
|
|
69
|
-
tag: m || p ? void 0 : a ?? "a",
|
|
70
|
-
to: m || p ? void 0 : t,
|
|
71
|
-
disabled: m
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}, H = (e) => typeof e == "string" && e in E ? /* @__PURE__ */ s(O, { icon: e }) : e;
|
|
75
|
-
export {
|
|
76
|
-
X as a,
|
|
77
|
-
V as g,
|
|
78
|
-
y as m,
|
|
79
|
-
v as s
|
|
80
|
-
};
|