@hybridcore/ui 1.5.28 → 1.5.29
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.
- package/dist/components/tabs/index.js +35 -32
- package/dist/main.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Badge as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { TabsRoot as
|
|
7
|
-
import { T as
|
|
8
|
-
function
|
|
1
|
+
import { jsxs as P, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import T from "react";
|
|
3
|
+
import { Badge as b, Tab as v } from "@mui/material";
|
|
4
|
+
import w from "./tab-panel.js";
|
|
5
|
+
import d from "./appleTabs.style.js";
|
|
6
|
+
import { TabsRoot as C } from "./styled.js";
|
|
7
|
+
import { T as S } from "../../Tabs-DqdkJU6b.js";
|
|
8
|
+
function g(t) {
|
|
9
9
|
return {
|
|
10
|
-
id: `simple-tab-${
|
|
11
|
-
"aria-controls": `simple-tabpanel-${
|
|
10
|
+
id: `simple-tab-${t}`,
|
|
11
|
+
"aria-controls": `simple-tabpanel-${t}`
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
const A = ({
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
id: t = "tab",
|
|
16
|
+
defaultActive: s = 0,
|
|
17
|
+
tabContents: i,
|
|
17
18
|
styleVariant: p,
|
|
18
|
-
tabPanelStyle:
|
|
19
|
-
onChange:
|
|
19
|
+
tabPanelStyle: m,
|
|
20
|
+
onChange: r,
|
|
20
21
|
...l
|
|
21
22
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
23
|
+
const e = new URLSearchParams(window.location.hash.substring(1)), [f, u] = T.useState(
|
|
24
|
+
Number(e.get(t)) ?? s
|
|
25
|
+
), c = r !== void 0 ? s : f, h = (o, a) => {
|
|
26
|
+
u(a), r && r(a), e.set(t, a), window.location.hash = `#${e.toString()}`;
|
|
24
27
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
p === "APPLE" ? /* @__PURE__ */
|
|
27
|
-
|
|
28
|
+
return /* @__PURE__ */ P(C, { children: [
|
|
29
|
+
p === "APPLE" ? /* @__PURE__ */ n(d.Tabs, { value: c, onChange: h, ...l, children: i.map((o, a) => /* @__PURE__ */ n(
|
|
30
|
+
d.Item,
|
|
28
31
|
{
|
|
29
|
-
label: /* @__PURE__ */
|
|
30
|
-
|
|
32
|
+
label: /* @__PURE__ */ n(
|
|
33
|
+
b,
|
|
31
34
|
{
|
|
32
35
|
badgeContent: o.badgeContent,
|
|
33
36
|
color: o.badgeColor ?? "primary",
|
|
@@ -45,14 +48,14 @@ const A = ({
|
|
|
45
48
|
),
|
|
46
49
|
icon: o.icon,
|
|
47
50
|
iconPosition: o.iconPosition,
|
|
48
|
-
...
|
|
51
|
+
...g(a)
|
|
49
52
|
},
|
|
50
53
|
a
|
|
51
|
-
)) }) : /* @__PURE__ */
|
|
52
|
-
|
|
54
|
+
)) }) : /* @__PURE__ */ n(S, { value: c, onChange: h, ...l, children: i.map((o, a) => /* @__PURE__ */ n(
|
|
55
|
+
v,
|
|
53
56
|
{
|
|
54
|
-
label: /* @__PURE__ */
|
|
55
|
-
|
|
57
|
+
label: /* @__PURE__ */ n(
|
|
58
|
+
b,
|
|
56
59
|
{
|
|
57
60
|
badgeContent: o.badgeContent,
|
|
58
61
|
color: o.badgeColor ?? "primary",
|
|
@@ -70,18 +73,18 @@ const A = ({
|
|
|
70
73
|
),
|
|
71
74
|
icon: o.icon,
|
|
72
75
|
iconPosition: o.iconPosition,
|
|
73
|
-
...
|
|
76
|
+
...g(a)
|
|
74
77
|
},
|
|
75
78
|
a
|
|
76
79
|
)) }),
|
|
77
|
-
|
|
80
|
+
i.map((o, a) => {
|
|
78
81
|
if (o.content)
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
82
|
+
return /* @__PURE__ */ n(
|
|
83
|
+
w,
|
|
81
84
|
{
|
|
82
|
-
value:
|
|
85
|
+
value: c,
|
|
83
86
|
index: a,
|
|
84
|
-
style:
|
|
87
|
+
style: m,
|
|
85
88
|
children: o.content
|
|
86
89
|
},
|
|
87
90
|
a
|
package/dist/main.d.ts
CHANGED
|
@@ -892,6 +892,7 @@ declare interface TabItem {
|
|
|
892
892
|
export declare const Tabs: FC<TabsProps>;
|
|
893
893
|
|
|
894
894
|
export declare interface TabsProps extends TabsProps_2 {
|
|
895
|
+
id?: string;
|
|
895
896
|
defaultActive?: number;
|
|
896
897
|
tabContents: TabContent[];
|
|
897
898
|
styleVariant?: "DEFAULT" | "APPLE";
|