@hortiview/shared-components 0.0.5450 → 0.0.5551

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.
@@ -50,4 +50,9 @@ interface InfoGroupProps {
50
50
  * ];
51
51
  */
52
52
  export declare const InfoGroup: React.FC<InfoGroupProps>;
53
+ export declare const Cell: ({ field, bold, variant, }: {
54
+ field: FieldItem;
55
+ bold?: boolean | undefined;
56
+ variant?: "default" | "embedded" | undefined;
57
+ }) => import("react/jsx-runtime").JSX.Element;
53
58
  export {};
@@ -1,72 +1,76 @@
1
1
  import "../../assets/InfoGroup.css";
2
- import { jsxs as s, Fragment as l, jsx as n } from "react/jsx-runtime";
3
- import { Divider as p, Group as m, TypoCaption as u, TypoSubtitle as v } from "@element/react-components";
4
- import { a as _ } from "../../useBreakpoint-DROHPVxO.js";
5
- import { VerticalDivider as h } from "../VerticalDivider/VerticalDivider.js";
6
- const g = "_container_egebs_1", C = "_dividerContainer_egebs_10", b = "_mainGroup_egebs_16", y = "_row_egebs_21", w = "_valueText_egebs_46", G = "_component_egebs_54", N = "_componentContainer_egebs_87", x = "_field_egebs_95", t = {
7
- container: g,
2
+ import { jsxs as c, jsx as e, Fragment as _ } from "react/jsx-runtime";
3
+ import { Divider as d, Group as s, TypoCaption as v, TypoSubtitle as h } from "@element/react-components";
4
+ import { a as g } from "../../useBreakpoint-DROHPVxO.js";
5
+ import { Fragment as p } from "react";
6
+ import { VerticalDivider as b } from "../VerticalDivider/VerticalDivider.js";
7
+ const f = "_container_egebs_1", C = "_dividerContainer_egebs_10", y = "_mainGroup_egebs_16", w = "_row_egebs_21", G = "_valueText_egebs_46", N = "_component_egebs_54", x = "_componentContainer_egebs_87", A = "_field_egebs_95", r = {
8
+ container: f,
8
9
  dividerContainer: C,
9
- mainGroup: b,
10
- row: y,
11
- valueText: w,
12
- component: G,
13
- componentContainer: N,
14
- field: x
15
- }, I = ({ fields: e, bold: r }) => {
16
- const a = e.length > 1 && Array.isArray(e.at(0)) ? e.map((c, o) => /* @__PURE__ */ s(l, { children: [
17
- o != 0 && /* @__PURE__ */ n("div", { "data-testid": "test-divider", className: t.dividerContainer, children: /* @__PURE__ */ n(p, {}) }),
18
- /* @__PURE__ */ n(d, { fields: c, bold: r }, `row${o}`)
19
- ] })) : /* @__PURE__ */ n(d, { fields: e, bold: r });
20
- return /* @__PURE__ */ n(m, { direction: "vertical", fullWidth: !0, className: t.mainGroup, children: a });
21
- }, d = ({ fields: e, bold: r }) => {
22
- const { isLg: i } = _();
23
- return /* @__PURE__ */ n(
24
- m,
10
+ mainGroup: y,
11
+ row: w,
12
+ valueText: G,
13
+ component: N,
14
+ componentContainer: x,
15
+ field: A
16
+ }, S = ({ fields: n, bold: i }) => {
17
+ const t = n.length > 1 && Array.isArray(n.at(0)) ? n.map((o, a) => /* @__PURE__ */ c(p, { children: [
18
+ a != 0 && /* @__PURE__ */ e("div", { "data-testid": "test-divider", className: r.dividerContainer, children: /* @__PURE__ */ e(d, {}) }),
19
+ /* @__PURE__ */ e(m, { fields: o, bold: i })
20
+ ] }, `row_${a}`)) : /* @__PURE__ */ e(m, { fields: n, bold: i });
21
+ return /* @__PURE__ */ e(s, { direction: "vertical", fullWidth: !0, className: r.mainGroup, children: t });
22
+ }, m = ({ fields: n, bold: i }) => {
23
+ const { isLg: l } = g();
24
+ return /* @__PURE__ */ e(
25
+ s,
25
26
  {
26
- direction: i ? "horizontal" : "vertical",
27
- className: t.row,
27
+ direction: l ? "horizontal" : "vertical",
28
+ className: r.row,
28
29
  fullWidth: !0,
29
30
  primaryAlign: "center",
30
31
  secondaryAlign: "center",
31
- children: e.map((a, c) => {
32
- const o = i ? /* @__PURE__ */ n(h, { className: t.divider, height: "3rem" }) : /* @__PURE__ */ n(p, {});
33
- return /* @__PURE__ */ s(l, { children: [
34
- c != 0 && o,
35
- /* @__PURE__ */ n(A, { field: a, bold: r })
36
- ] });
32
+ children: n.map((t, o) => {
33
+ const a = l ? /* @__PURE__ */ e(b, { className: r.divider, height: "3rem" }) : /* @__PURE__ */ e(d, {});
34
+ return /* @__PURE__ */ c(p, { children: [
35
+ o != 0 && a,
36
+ /* @__PURE__ */ e(T, { field: t, bold: i, variant: t.variant })
37
+ ] }, `${t.label ?? "label"}_${o}`);
37
38
  })
38
39
  }
39
40
  );
40
- }, A = ({ field: e, bold: r }) => {
41
- if (e.variant || (e.variant = "default"), !e.component || e.variant === "embedded")
42
- return /* @__PURE__ */ s(
43
- m,
44
- {
45
- "data-testid": "infoGroupItem",
46
- direction: "vertical",
47
- primaryAlign: "center",
48
- secondaryAlign: "space-between",
49
- fullWidth: !0,
50
- gap: "dense",
51
- children: [
52
- /* @__PURE__ */ n(u, { className: t.label, themeColor: "text-hint-on-light", children: e.label }),
53
- e.value ? /* @__PURE__ */ n(
54
- v,
55
- {
56
- level: 1,
57
- "data-testid": "infoGroupValue",
58
- themeColor: e.themeColor,
59
- bold: r,
60
- className: t.valueText,
61
- children: e.value
62
- }
63
- ) : /* @__PURE__ */ n(l, { children: e.component })
64
- ]
65
- }
66
- );
67
- if (e.component && e.variant === "default")
68
- return /* @__PURE__ */ n("div", { className: t.componentContainer, children: /* @__PURE__ */ n("div", { className: t.component, children: e.component }) });
41
+ }, T = ({
42
+ field: n,
43
+ bold: i,
44
+ variant: l = "default"
45
+ }) => {
46
+ const { component: t, value: o, label: a, themeColor: u } = n;
47
+ return t && l === "default" ? /* @__PURE__ */ e("div", { className: r.componentContainer, children: /* @__PURE__ */ e("div", { className: r.component, children: t }) }) : /* @__PURE__ */ c(
48
+ s,
49
+ {
50
+ "data-testid": "infoGroupItem",
51
+ direction: "vertical",
52
+ primaryAlign: "center",
53
+ secondaryAlign: "space-between",
54
+ fullWidth: !0,
55
+ gap: "dense",
56
+ children: [
57
+ /* @__PURE__ */ e(v, { className: r.label, themeColor: "text-hint-on-light", children: a }),
58
+ o ? /* @__PURE__ */ e(
59
+ h,
60
+ {
61
+ level: 1,
62
+ "data-testid": "infoGroupValue",
63
+ themeColor: u,
64
+ bold: i,
65
+ className: r.valueText,
66
+ children: o
67
+ }
68
+ ) : /* @__PURE__ */ e(_, { children: t })
69
+ ]
70
+ }
71
+ );
69
72
  };
70
73
  export {
71
- I as InfoGroup
74
+ T as Cell,
75
+ S as InfoGroup
72
76
  };
package/dist/main.d.ts CHANGED
@@ -30,3 +30,4 @@ export type { FieldItem } from './components/InfoGroup/InfoGroup';
30
30
  export type { HashTab } from './types/HashTab';
31
31
  export type { ListElement, BaseListElement } from './types/ListElement';
32
32
  export type { CellTemplate, CellTemplateProps, TableLayoutProps } from './types/GenericTable';
33
+ export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
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.5450",
4
+ "version": "0.0.5551",
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>",