@hortiview/shared-components 0.0.4993 → 0.0.5024

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,59 +1,59 @@
1
1
  import "../../assets/HashTabView.css";
2
- import { jsx as r, jsxs as d, Fragment as w } from "react/jsx-runtime";
2
+ import { jsx as a, jsxs as l, Fragment as w } from "react/jsx-runtime";
3
3
  import { Elevation as T, Group as o, TabBar as C, Tab as k, Padding as A } from "@element/react-components";
4
4
  import { useState as I, useEffect as L } from "react";
5
5
  import { a as N } from "../../useBreakpoint-DROHPVxO.js";
6
- const x = "_elevation_1rcw6_1", y = "_themeBackground_1rcw6_6", W = "_tabBar_1rcw6_10", $ = "_tabWrapper_1rcw6_16", j = "_tabButton_1rcw6_20", E = "_childContainer_1rcw6_24", z = "_childContainerLg_1rcw6_28", a = {
6
+ const x = "_elevation_1rcw6_1", y = "_themeBackground_1rcw6_6", W = "_tabBar_1rcw6_10", j = "_tabWrapper_1rcw6_16", E = "_tabButton_1rcw6_20", $ = "_childContainer_1rcw6_24", z = "_childContainerLg_1rcw6_28", t = {
7
7
  elevation: x,
8
8
  themeBackground: y,
9
9
  tabBar: W,
10
- tabWrapper: $,
11
- tabButton: j,
12
- childContainer: E,
10
+ tabWrapper: j,
11
+ tabButton: E,
12
+ childContainer: $,
13
13
  childContainerLg: z
14
- }, _ = (n, t, c) => !c || !t || !n ? 0 : n.findIndex((i) => `#${i.hash}` === t) ?? 0, q = ({
14
+ }, p = (n, r) => !r || !n ? 0 : n.findIndex((c) => c.hash === r.replace("#", "")) ?? 0, q = ({
15
15
  tabs: n,
16
- hasHash: t = !0,
16
+ hasHash: r = !0,
17
17
  hash: c = "",
18
- clusterAlign: i = "start",
19
- hasClusteredTabs: g,
20
- children: l,
21
- verticalGap: h = "none",
18
+ clusterAlign: u = "start",
19
+ hasClusteredTabs: _,
20
+ children: i,
21
+ verticalGap: g = "none",
22
22
  elevation: B = 0,
23
23
  backgroundColor: v = "themeBackground",
24
24
  onChange: b
25
25
  }) => {
26
- const [m, p] = I(_(n, c, t)), { isLg: s } = N();
26
+ const [d, h] = I(p(n, c)), { isLg: s } = N();
27
27
  L(() => {
28
- const e = _(n, c, t);
29
- p(e);
30
- }, [c, n, t]);
28
+ const e = p(n, c);
29
+ h(e);
30
+ }, [c, n, r]);
31
31
  const f = (e) => {
32
- const u = n[e].hash;
33
- u != null && t && (window.location.hash = u), p(e), b?.(e);
32
+ const m = n[e].hash;
33
+ m != null && r && (window.location.hash = m), h(e), b?.(e);
34
34
  };
35
- return /* @__PURE__ */ r(
35
+ return /* @__PURE__ */ a(
36
36
  T,
37
37
  {
38
38
  elevation: B,
39
- className: `${a.elevation} ${v === "none" ? "" : a.themeBackground}`,
40
- children: /* @__PURE__ */ d(o, { direction: "vertical", gap: h, secondaryAlign: "stretch", children: [
41
- /* @__PURE__ */ d(o, { direction: s ? "horizontal" : "vertical", className: a.tabWrapper, children: [
42
- /* @__PURE__ */ r(
39
+ className: `${t.elevation} ${v === "none" ? "" : t.themeBackground}`,
40
+ children: /* @__PURE__ */ l(o, { direction: "vertical", gap: g, secondaryAlign: "stretch", children: [
41
+ /* @__PURE__ */ l(o, { direction: s ? "horizontal" : "vertical", className: t.tabWrapper, children: [
42
+ /* @__PURE__ */ a(
43
43
  C,
44
44
  {
45
- className: a.tabBar,
46
- clustered: s ? g : !1,
47
- clusterAlign: i,
45
+ className: t.tabBar,
46
+ clustered: s ? _ : !1,
47
+ clusterAlign: u,
48
48
  variant: "surface",
49
- activeTabIndex: m,
49
+ activeTabIndex: d,
50
50
  onTabActivated: f,
51
- children: n.map((e) => /* @__PURE__ */ r(
51
+ children: n.map((e) => /* @__PURE__ */ a(
52
52
  k,
53
53
  {
54
54
  icon: e.leadingIcon,
55
- className: l ? a.tabButton : "",
56
- children: /* @__PURE__ */ d(o, { gap: "dense", children: [
55
+ className: i ? t.tabButton : "",
56
+ children: /* @__PURE__ */ l(o, { gap: "dense", children: [
57
57
  e.title,
58
58
  e.trailingIcon
59
59
  ] })
@@ -62,16 +62,16 @@ const x = "_elevation_1rcw6_1", y = "_themeBackground_1rcw6_6", W = "_tabBar_1rc
62
62
  ))
63
63
  }
64
64
  ),
65
- l ? /* @__PURE__ */ r(
65
+ i ? /* @__PURE__ */ a(
66
66
  A,
67
67
  {
68
68
  variant: "dense",
69
- className: s ? a.childContainer : a.childContainerLg,
70
- children: /* @__PURE__ */ r(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: l })
69
+ className: s ? t.childContainer : t.childContainerLg,
70
+ children: /* @__PURE__ */ a(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: i })
71
71
  }
72
- ) : /* @__PURE__ */ r(w, {})
72
+ ) : /* @__PURE__ */ a(w, {})
73
73
  ] }),
74
- n[m]?.component
74
+ n[d]?.component
75
75
  ] })
76
76
  }
77
77
  );
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.4993",
4
+ "version": "0.0.5024",
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>",