@hortiview/shared-components 0.0.5053 → 0.0.5060

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.
@@ -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
- ._messageContainer_92aoe_1{border-radius:.25rem;padding:.5rem 1rem;width:-moz-available;width:-webkit-fill-available;width:stretch}._message_92aoe_1{color:var(--lmnt-theme-on-surface-active);font-weight:700}._info_92aoe_13{border:1px solid var(--lmnt-theme-on-secondary-stroke);background:var(--lmnt-theme-secondary-50)}._danger_92aoe_18{border:1px solid var(--lmnt-theme-on-danger-stroke);background:var(--lmnt-theme-danger-50)}._success_92aoe_23{border:1px solid var(--lmnt-theme-on-success-stroke);background:var(--lmnt-theme-success-50)}
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 t, jsxs as c } from "react/jsx-runtime";
3
- import { Group as m, TypoBody as g } from "@element/react-components";
4
- import { a as _ } from "../../useBreakpoint-DROHPVxO.js";
5
- const l = "_messageContainer_92aoe_1", d = "_message_92aoe_1", p = "_info_92aoe_13", f = "_danger_92aoe_18", u = "_success_92aoe_23", n = {
6
- messageContainer: l,
7
- message: d,
8
- info: p,
9
- danger: f,
10
- success: u
11
- }, A = ({ text: s, color: o = "info", isOpen: r = !0, action: a }) => {
12
- const { isLg: i } = _();
13
- return r ? /* @__PURE__ */ e("div", { className: `${n.messageContainer} ${n[o]}`, children: /* @__PURE__ */ c(m, { direction: i ? "horizontal" : "vertical", primaryAlign: "space-between", secondaryAlign: "center", children: [
14
- typeof s == "string" ? /* @__PURE__ */ e(g, { bold: !0, level: 2, children: s }) : /* @__PURE__ */ e("div", { children: s }),
15
- a
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
- A as AlertBanner
18
+ v as AlertBanner
20
19
  };
@@ -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-jz92va76.js";
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-jz92va76.js";
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-jz92va76.js";
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,
@@ -96,4 +96,8 @@ export type ListElement = Omit<BaseListElement, 'component'> & {
96
96
  * will be rendered instead of title and subtitle
97
97
  */
98
98
  customTitle?: JSX.Element;
99
+ /**
100
+ * a custom class name for the list item
101
+ */
102
+ listItemClassName?: string;
99
103
  };
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.5053",
4
+ "version": "0.0.5060",
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
- };