@hortiview/shared-components 0.0.9939 → 0.0.10001
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.
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { Elevation as N, Group as o, TabBar as
|
|
2
|
+
import { Elevation as N, Group as o, TabBar as y, Tab as b, Padding as k } from "@element/react-components";
|
|
3
3
|
import { useState as w, useEffect as x } from "react";
|
|
4
4
|
import { u as C } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
5
|
-
import { s as
|
|
6
|
-
const f = (
|
|
7
|
-
tabs:
|
|
5
|
+
import { s as n } from "../../HashTabView.module-ZhwSfDeQ.js";
|
|
6
|
+
const f = (t, r) => !r || !t ? 0 : t.findIndex((i) => i.hash === r.replace("#", "")) ?? 0, z = ({
|
|
7
|
+
tabs: t,
|
|
8
8
|
hasHash: r = !0,
|
|
9
9
|
hash: i = "",
|
|
10
10
|
clusterAlign: h = "start",
|
|
11
11
|
hasClusteredTabs: g,
|
|
12
|
-
children:
|
|
12
|
+
children: d,
|
|
13
13
|
verticalGap: v = "none",
|
|
14
14
|
elevation: $ = 0,
|
|
15
15
|
backgroundColor: T = "themeBackground",
|
|
16
16
|
onChange: A,
|
|
17
17
|
hasStickyTabs: p = !1
|
|
18
18
|
}) => {
|
|
19
|
-
const [
|
|
19
|
+
const [l, u] = w(f(t, i)), { isDesktop: s } = C();
|
|
20
20
|
x(() => {
|
|
21
21
|
if (!r || !i)
|
|
22
22
|
return;
|
|
23
|
-
const e = f(
|
|
23
|
+
const e = f(t, i);
|
|
24
24
|
u(e);
|
|
25
|
-
}, [
|
|
25
|
+
}, [t, i, r]);
|
|
26
26
|
const B = (e) => {
|
|
27
|
-
const c =
|
|
27
|
+
const c = t[e].hash;
|
|
28
28
|
c != null && r && window.history.replaceState(null, "", `#${c}`), u(e), A?.(e);
|
|
29
29
|
};
|
|
30
30
|
return /* @__PURE__ */ a(
|
|
31
31
|
N,
|
|
32
32
|
{
|
|
33
33
|
elevation: $,
|
|
34
|
-
className: `${
|
|
34
|
+
className: `${n.elevation} ${T === "none" ? "" : n.themeBackground}`,
|
|
35
35
|
children: /* @__PURE__ */ m(
|
|
36
36
|
o,
|
|
37
37
|
{
|
|
@@ -43,26 +43,26 @@ const f = (n, r) => !r || !n ? 0 : n.findIndex((i) => i.hash === r.replace("#",
|
|
|
43
43
|
/* @__PURE__ */ m(
|
|
44
44
|
o,
|
|
45
45
|
{
|
|
46
|
-
direction:
|
|
47
|
-
className: `${
|
|
46
|
+
direction: s ? "horizontal" : "vertical",
|
|
47
|
+
className: `${n.tabWrapper} ${p ? n.stickyHeader : ""}`,
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ a(
|
|
50
|
-
|
|
50
|
+
y,
|
|
51
51
|
{
|
|
52
52
|
"data-testid": "tab-bar",
|
|
53
|
-
className:
|
|
54
|
-
clustered:
|
|
53
|
+
className: n.tabBar,
|
|
54
|
+
clustered: s ? g : !1,
|
|
55
55
|
clusterAlign: h,
|
|
56
56
|
variant: "surface",
|
|
57
|
-
activeTabIndex:
|
|
57
|
+
activeTabIndex: l,
|
|
58
58
|
onTabActivated: B,
|
|
59
|
-
children:
|
|
60
|
-
|
|
59
|
+
children: t.map((e, c) => /* @__PURE__ */ a(
|
|
60
|
+
b,
|
|
61
61
|
{
|
|
62
62
|
"data-testid": `tab-${e.title}`,
|
|
63
63
|
icon: e.leadingIcon,
|
|
64
|
-
className: `${
|
|
65
|
-
active:
|
|
64
|
+
className: `${d ? n.tabButton : ""} ${e.isIconRed ? n.iconColorRed : ""}`,
|
|
65
|
+
active: l === c,
|
|
66
66
|
children: /* @__PURE__ */ m(o, { gap: "dense", children: [
|
|
67
67
|
e.title,
|
|
68
68
|
e.trailingIcon
|
|
@@ -72,26 +72,18 @@ const f = (n, r) => !r || !n ? 0 : n.findIndex((i) => i.hash === r.replace("#",
|
|
|
72
72
|
))
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
|
|
75
|
+
d ? /* @__PURE__ */ a(
|
|
76
76
|
k,
|
|
77
77
|
{
|
|
78
78
|
variant: "dense",
|
|
79
|
-
className:
|
|
80
|
-
children: /* @__PURE__ */ a(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children:
|
|
79
|
+
className: s ? n.childContainer : n.childContainerPhone,
|
|
80
|
+
children: /* @__PURE__ */ a(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: d })
|
|
81
81
|
}
|
|
82
82
|
) : /* @__PURE__ */ a(I, {})
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */ a(
|
|
87
|
-
o,
|
|
88
|
-
{
|
|
89
|
-
fullWidth: !0,
|
|
90
|
-
direction: "vertical",
|
|
91
|
-
className: ` ${p ? t.miniPadding : ""}`,
|
|
92
|
-
children: n[s]?.component
|
|
93
|
-
}
|
|
94
|
-
)
|
|
86
|
+
p ? /* @__PURE__ */ a(o, { fullWidth: !0, direction: "vertical", className: n.miniPadding, children: t[l]?.component }) : t[l]?.component
|
|
95
87
|
]
|
|
96
88
|
}
|
|
97
89
|
)
|
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.10001",
|
|
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>",
|