@hortiview/shared-components 0.0.8611 → 0.0.8622

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