@jigowatts/jigowatts-ui 0.0.1-12
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/README.md +50 -0
- package/dist/AccordionSummary-B4zooGpd.js +831 -0
- package/dist/ButtonBase-pxtIu13Q.js +866 -0
- package/dist/DateTimePicker-DJSOr5wM.js +4653 -0
- package/dist/ListContext-DOVwHqy-.js +180 -0
- package/dist/MenuItem-yBaT3_db.js +470 -0
- package/dist/Paper-COvYqxZa.js +522 -0
- package/dist/Tabs-D3lJRumZ.js +1085 -0
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index12.css +1 -0
- package/dist/assets/index13.css +1 -0
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index21.css +1 -0
- package/dist/assets/index22.css +1 -0
- package/dist/assets/index23.css +1 -0
- package/dist/assets/index24.css +1 -0
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index27.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/browser-DxfwT6rn.js +656 -0
- package/dist/components/Button/index.d.ts +28 -0
- package/dist/components/Button/index.js +18 -0
- package/dist/components/Button/index.test.d.ts +1 -0
- package/dist/components/Button/index.test.js +23 -0
- package/dist/components/Card/index.d.ts +16 -0
- package/dist/components/Card/index.js +37 -0
- package/dist/components/Card/index.test.d.ts +1 -0
- package/dist/components/Card/index.test.js +35 -0
- package/dist/components/CustomLink/index.d.ts +11 -0
- package/dist/components/CustomLink/index.js +1670 -0
- package/dist/components/CustomLink/index.test.d.ts +1 -0
- package/dist/components/CustomLink/index.test.js +40 -0
- package/dist/components/DataTable/index.d.ts +28 -0
- package/dist/components/DataTable/index.js +137 -0
- package/dist/components/DataTable/index.test.d.ts +1 -0
- package/dist/components/DataTable/index.test.js +3010 -0
- package/dist/components/DatePickerController/index.d.ts +16 -0
- package/dist/components/DatePickerController/index.js +83 -0
- package/dist/components/DatePickerController/index.test.d.ts +1 -0
- package/dist/components/DatePickerController/index.test.js +24 -0
- package/dist/components/ErrorMessage/index.d.ts +5 -0
- package/dist/components/ErrorMessage/index.js +11 -0
- package/dist/components/ErrorMessage/index.test.d.ts +1 -0
- package/dist/components/ErrorMessage/index.test.js +17 -0
- package/dist/components/EvseStateLabel/index.d.ts +5 -0
- package/dist/components/EvseStateLabel/index.js +36 -0
- package/dist/components/FlexButtons/index.d.ts +9 -0
- package/dist/components/FlexButtons/index.js +13 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/index.js +11 -0
- package/dist/components/Form/index.test.d.ts +1 -0
- package/dist/components/Form/index.test.js +25 -0
- package/dist/components/FormItem/index.d.ts +9 -0
- package/dist/components/FormItem/index.js +19 -0
- package/dist/components/FormItem/index.test.d.ts +1 -0
- package/dist/components/FormItem/index.test.js +15 -0
- package/dist/components/FormTitle/index.d.ts +5 -0
- package/dist/components/FormTitle/index.js +11 -0
- package/dist/components/FormTitle/index.test.d.ts +1 -0
- package/dist/components/FormTitle/index.test.js +15 -0
- package/dist/components/Input/index.d.ts +15 -0
- package/dist/components/Input/index.js +39 -0
- package/dist/components/Input/index.test.d.ts +1 -0
- package/dist/components/Input/index.test.js +39 -0
- package/dist/components/InputController/index.d.ts +20 -0
- package/dist/components/InputController/index.js +81 -0
- package/dist/components/InputController/index.test.d.ts +1 -0
- package/dist/components/InputController/index.test.js +56 -0
- package/dist/components/InputGroup/index.d.ts +7 -0
- package/dist/components/InputGroup/index.js +11 -0
- package/dist/components/InputGroup/index.test.d.ts +1 -0
- package/dist/components/InputGroup/index.test.js +15 -0
- package/dist/components/Label/index.d.ts +7 -0
- package/dist/components/Label/index.js +14 -0
- package/dist/components/Label/index.test.d.ts +1 -0
- package/dist/components/Label/index.test.js +25 -0
- package/dist/components/LabeledContent/index.d.ts +15 -0
- package/dist/components/LabeledContent/index.js +28 -0
- package/dist/components/LabeledContent/index.test.d.ts +1 -0
- package/dist/components/LabeledContent/index.test.js +19 -0
- package/dist/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/components/LoadingOverlay/index.js +134 -0
- package/dist/components/LoadingOverlay/index.test.d.ts +1 -0
- package/dist/components/LoadingOverlay/index.test.js +12 -0
- package/dist/components/Map/index.d.ts +8 -0
- package/dist/components/Map/index.js +6575 -0
- package/dist/components/MaxWidthContainer/index.d.ts +13 -0
- package/dist/components/MaxWidthContainer/index.js +15 -0
- package/dist/components/MaxWidthContainer/index.test.d.ts +1 -0
- package/dist/components/MaxWidthContainer/index.test.js +24 -0
- package/dist/components/NumericFieldController/index.d.ts +53 -0
- package/dist/components/NumericFieldController/index.js +620 -0
- package/dist/components/NumericFieldController/index.test.d.ts +1 -0
- package/dist/components/NumericFieldController/index.test.js +24 -0
- package/dist/components/OfflineLabel/index.d.ts +5 -0
- package/dist/components/OfflineLabel/index.js +34 -0
- package/dist/components/PageSizeSelector/index.d.ts +15 -0
- package/dist/components/PageSizeSelector/index.js +43 -0
- package/dist/components/Pagination/index.d.ts +9 -0
- package/dist/components/Pagination/index.js +7 -0
- package/dist/components/Pagination/index.test.d.ts +1 -0
- package/dist/components/Pagination/index.test.js +34 -0
- package/dist/components/PasswordInputController/index.d.ts +17 -0
- package/dist/components/PasswordInputController/index.js +78 -0
- package/dist/components/PasswordInputController/index.test.d.ts +1 -0
- package/dist/components/PasswordInputController/index.test.js +37 -0
- package/dist/components/RadioButton/index.d.ts +13 -0
- package/dist/components/RadioButton/index.js +7 -0
- package/dist/components/RadioButton/index.test.d.ts +1 -0
- package/dist/components/RadioButton/index.test.js +38 -0
- package/dist/components/RadioGroupController/index.d.ts +15 -0
- package/dist/components/RadioGroupController/index.js +48 -0
- package/dist/components/RadioGroupController/index.test.d.ts +1 -0
- package/dist/components/RadioGroupController/index.test.js +48 -0
- package/dist/components/RangeDatePicker/index.d.ts +14 -0
- package/dist/components/RangeDatePicker/index.js +1594 -0
- package/dist/components/RangeDatePickerController/index.d.ts +21 -0
- package/dist/components/RangeDatePickerController/index.js +123 -0
- package/dist/components/RangeDatePickerController/index.test.d.ts +1 -0
- package/dist/components/RangeDatePickerController/index.test.js +24 -0
- package/dist/components/ReportCard/index.d.ts +12 -0
- package/dist/components/ReportCard/index.js +18 -0
- package/dist/components/ReportCard/index.test.d.ts +1 -0
- package/dist/components/ReportCard/index.test.js +27 -0
- package/dist/components/ReportChart/index.d.ts +22 -0
- package/dist/components/ReportChart/index.js +23101 -0
- package/dist/components/ScrollableDialog/index.d.ts +19 -0
- package/dist/components/ScrollableDialog/index.js +42 -0
- package/dist/components/ScrollableDialog/index.test.d.ts +1 -0
- package/dist/components/ScrollableDialog/index.test.js +59 -0
- package/dist/components/SearchForm/index.d.ts +13 -0
- package/dist/components/SearchForm/index.js +86 -0
- package/dist/components/SelectBox/index.d.ts +18 -0
- package/dist/components/SelectBox/index.js +7 -0
- package/dist/components/SelectBox/index.test.d.ts +1 -0
- package/dist/components/SelectBox/index.test.js +34 -0
- package/dist/components/SelectBoxController/index.d.ts +20 -0
- package/dist/components/SelectBoxController/index.js +87 -0
- package/dist/components/SelectBoxController/index.test.d.ts +1 -0
- package/dist/components/SelectBoxController/index.test.js +52 -0
- package/dist/components/SubMenu/index.d.ts +22 -0
- package/dist/components/SubMenu/index.js +278 -0
- package/dist/components/SubMenu/index.test.d.ts +1 -0
- package/dist/components/SubMenu/index.test.js +41 -0
- package/dist/components/Tabs/index.d.ts +21 -0
- package/dist/components/Tabs/index.js +100 -0
- package/dist/components/Tabs/index.test.d.ts +1 -0
- package/dist/components/Tabs/index.test.js +24 -0
- package/dist/components/Textarea/index.d.ts +18 -0
- package/dist/components/Textarea/index.js +34 -0
- package/dist/components/Textarea/index.test.d.ts +1 -0
- package/dist/components/Textarea/index.test.js +25 -0
- package/dist/components/ToggleButton/index.d.ts +16 -0
- package/dist/components/ToggleButton/index.js +39 -0
- package/dist/components/ToggleButton/index.test.d.ts +1 -0
- package/dist/components/ToggleButton/index.test.js +49 -0
- package/dist/constants/datetime.d.ts +2 -0
- package/dist/constants/datetime.js +5 -0
- package/dist/createSvgIcon-B53UOwxg.js +183 -0
- package/dist/createSvgIcon-Dj8zNxRS.js +72 -0
- package/dist/index-BLPOOjNr.js +184 -0
- package/dist/index-BOjtnFU5.js +34 -0
- package/dist/index-Bs3JCwgu.js +689 -0
- package/dist/index-CICI7n5Y.js +19688 -0
- package/dist/index-CQDJfJT1.js +50 -0
- package/dist/index-C_i0-R5C.js +393 -0
- package/dist/index-DWRHnq8_.js +42 -0
- package/dist/index-Di2gTfPF.js +25175 -0
- package/dist/index-VF82hRp0.js +2522 -0
- package/dist/index-kvi6aotO.js +39 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.esm-ChwJSgnF.js +1052 -0
- package/dist/index.js +77 -0
- package/dist/isEqual-BBhdD79C.js +667 -0
- package/dist/mergeSlotProps-J197zKan.js +63 -0
- package/dist/react.esm-C8amP77L.js +11182 -0
- package/dist/styled-CWju4EfZ.js +2702 -0
- package/dist/unsupportedProp-DZaWZqWQ.js +30 -0
- package/dist/useControlled-BQCJRJNJ.js +64 -0
- package/dist/useIsFocusVisible-BxB-Hdhb.js +124 -0
- package/dist/useSlotProps-Bh7akxXV.js +33 -0
- package/package.json +360 -0
|
@@ -0,0 +1,1085 @@
|
|
|
1
|
+
import { b as ve, g as me, s as _, d as Le, a as b, u as Se, _ as ae, c as ye } from "./styled-CWju4EfZ.js";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { c as L, P as t } from "./index-Bs3JCwgu.js";
|
|
4
|
+
import { jsxs as Q, jsx as C } from "react/jsx-runtime";
|
|
5
|
+
import { B as ke, r as st } from "./ButtonBase-pxtIu13Q.js";
|
|
6
|
+
import { u as at, a as Fe, d as $e, o as it } from "./unsupportedProp-DZaWZqWQ.js";
|
|
7
|
+
import { r as ct } from "./index-BLPOOjNr.js";
|
|
8
|
+
import { a as Ae, u as se } from "./useSlotProps-Bh7akxXV.js";
|
|
9
|
+
import { u as dt } from "./mergeSlotProps-J197zKan.js";
|
|
10
|
+
import { a as ut, b as be } from "./useIsFocusVisible-BxB-Hdhb.js";
|
|
11
|
+
import { c as je } from "./createSvgIcon-B53UOwxg.js";
|
|
12
|
+
let X;
|
|
13
|
+
function De() {
|
|
14
|
+
if (X)
|
|
15
|
+
return X;
|
|
16
|
+
const e = document.createElement("div"), o = document.createElement("div");
|
|
17
|
+
return o.style.width = "10px", o.style.height = "1px", e.appendChild(o), e.dir = "rtl", e.style.fontSize = "14px", e.style.width = "4px", e.style.height = "1px", e.style.position = "absolute", e.style.top = "-1000px", e.style.overflow = "scroll", document.body.appendChild(e), X = "reverse", e.scrollLeft > 0 ? X = "default" : (e.scrollLeft = 1, e.scrollLeft === 0 && (X = "negative")), document.body.removeChild(e), X;
|
|
18
|
+
}
|
|
19
|
+
function pt(e, o) {
|
|
20
|
+
const n = e.scrollLeft;
|
|
21
|
+
if (o !== "rtl")
|
|
22
|
+
return n;
|
|
23
|
+
switch (De()) {
|
|
24
|
+
case "negative":
|
|
25
|
+
return e.scrollWidth - e.clientWidth + n;
|
|
26
|
+
case "reverse":
|
|
27
|
+
return e.scrollWidth - e.clientWidth - n;
|
|
28
|
+
default:
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function ft(e) {
|
|
33
|
+
return me("MuiTab", e);
|
|
34
|
+
}
|
|
35
|
+
const bt = ve("MuiTab", ["root", "labelIcon", "textColorInherit", "textColorPrimary", "textColorSecondary", "selected", "disabled", "fullWidth", "wrapped", "iconWrapper"]), D = bt, ht = ["className", "disabled", "disableFocusRipple", "fullWidth", "icon", "iconPosition", "indicator", "label", "onChange", "onClick", "onFocus", "selected", "selectionFollowsFocus", "textColor", "value", "wrapped"], vt = (e) => {
|
|
36
|
+
const {
|
|
37
|
+
classes: o,
|
|
38
|
+
textColor: n,
|
|
39
|
+
fullWidth: c,
|
|
40
|
+
wrapped: i,
|
|
41
|
+
icon: d,
|
|
42
|
+
label: v,
|
|
43
|
+
selected: h,
|
|
44
|
+
disabled: p
|
|
45
|
+
} = e, y = {
|
|
46
|
+
root: ["root", d && v && "labelIcon", `textColor${Le(n)}`, c && "fullWidth", i && "wrapped", h && "selected", p && "disabled"],
|
|
47
|
+
iconWrapper: ["iconWrapper"]
|
|
48
|
+
};
|
|
49
|
+
return ye(y, ft, o);
|
|
50
|
+
}, mt = _(ke, {
|
|
51
|
+
name: "MuiTab",
|
|
52
|
+
slot: "Root",
|
|
53
|
+
overridesResolver: (e, o) => {
|
|
54
|
+
const {
|
|
55
|
+
ownerState: n
|
|
56
|
+
} = e;
|
|
57
|
+
return [o.root, n.label && n.icon && o.labelIcon, o[`textColor${Le(n.textColor)}`], n.fullWidth && o.fullWidth, n.wrapped && o.wrapped];
|
|
58
|
+
}
|
|
59
|
+
})(({
|
|
60
|
+
theme: e,
|
|
61
|
+
ownerState: o
|
|
62
|
+
}) => b({}, e.typography.button, {
|
|
63
|
+
maxWidth: 360,
|
|
64
|
+
minWidth: 90,
|
|
65
|
+
position: "relative",
|
|
66
|
+
minHeight: 48,
|
|
67
|
+
flexShrink: 0,
|
|
68
|
+
padding: "12px 16px",
|
|
69
|
+
overflow: "hidden",
|
|
70
|
+
whiteSpace: "normal",
|
|
71
|
+
textAlign: "center"
|
|
72
|
+
}, o.label && {
|
|
73
|
+
flexDirection: o.iconPosition === "top" || o.iconPosition === "bottom" ? "column" : "row"
|
|
74
|
+
}, {
|
|
75
|
+
lineHeight: 1.25
|
|
76
|
+
}, o.icon && o.label && {
|
|
77
|
+
minHeight: 72,
|
|
78
|
+
paddingTop: 9,
|
|
79
|
+
paddingBottom: 9,
|
|
80
|
+
[`& > .${D.iconWrapper}`]: b({}, o.iconPosition === "top" && {
|
|
81
|
+
marginBottom: 6
|
|
82
|
+
}, o.iconPosition === "bottom" && {
|
|
83
|
+
marginTop: 6
|
|
84
|
+
}, o.iconPosition === "start" && {
|
|
85
|
+
marginRight: e.spacing(1)
|
|
86
|
+
}, o.iconPosition === "end" && {
|
|
87
|
+
marginLeft: e.spacing(1)
|
|
88
|
+
})
|
|
89
|
+
}, o.textColor === "inherit" && {
|
|
90
|
+
color: "inherit",
|
|
91
|
+
opacity: 0.6,
|
|
92
|
+
// same opacity as theme.palette.text.secondary
|
|
93
|
+
[`&.${D.selected}`]: {
|
|
94
|
+
opacity: 1
|
|
95
|
+
},
|
|
96
|
+
[`&.${D.disabled}`]: {
|
|
97
|
+
opacity: (e.vars || e).palette.action.disabledOpacity
|
|
98
|
+
}
|
|
99
|
+
}, o.textColor === "primary" && {
|
|
100
|
+
color: (e.vars || e).palette.text.secondary,
|
|
101
|
+
[`&.${D.selected}`]: {
|
|
102
|
+
color: (e.vars || e).palette.primary.main
|
|
103
|
+
},
|
|
104
|
+
[`&.${D.disabled}`]: {
|
|
105
|
+
color: (e.vars || e).palette.text.disabled
|
|
106
|
+
}
|
|
107
|
+
}, o.textColor === "secondary" && {
|
|
108
|
+
color: (e.vars || e).palette.text.secondary,
|
|
109
|
+
[`&.${D.selected}`]: {
|
|
110
|
+
color: (e.vars || e).palette.secondary.main
|
|
111
|
+
},
|
|
112
|
+
[`&.${D.disabled}`]: {
|
|
113
|
+
color: (e.vars || e).palette.text.disabled
|
|
114
|
+
}
|
|
115
|
+
}, o.fullWidth && {
|
|
116
|
+
flexShrink: 1,
|
|
117
|
+
flexGrow: 1,
|
|
118
|
+
flexBasis: 0,
|
|
119
|
+
maxWidth: "none"
|
|
120
|
+
}, o.wrapped && {
|
|
121
|
+
fontSize: e.typography.pxToRem(12)
|
|
122
|
+
})), _e = /* @__PURE__ */ u.forwardRef(function(o, n) {
|
|
123
|
+
const c = Se({
|
|
124
|
+
props: o,
|
|
125
|
+
name: "MuiTab"
|
|
126
|
+
}), {
|
|
127
|
+
className: i,
|
|
128
|
+
disabled: d = !1,
|
|
129
|
+
disableFocusRipple: v = !1,
|
|
130
|
+
// eslint-disable-next-line react/prop-types
|
|
131
|
+
fullWidth: h,
|
|
132
|
+
icon: p,
|
|
133
|
+
iconPosition: y = "top",
|
|
134
|
+
// eslint-disable-next-line react/prop-types
|
|
135
|
+
indicator: w,
|
|
136
|
+
label: T,
|
|
137
|
+
onChange: m,
|
|
138
|
+
onClick: I,
|
|
139
|
+
onFocus: k,
|
|
140
|
+
// eslint-disable-next-line react/prop-types
|
|
141
|
+
selected: E,
|
|
142
|
+
// eslint-disable-next-line react/prop-types
|
|
143
|
+
selectionFollowsFocus: g,
|
|
144
|
+
// eslint-disable-next-line react/prop-types
|
|
145
|
+
textColor: H = "inherit",
|
|
146
|
+
value: M,
|
|
147
|
+
wrapped: ie = !1
|
|
148
|
+
} = c, V = ae(c, ht), Y = b({}, c, {
|
|
149
|
+
disabled: d,
|
|
150
|
+
disableFocusRipple: v,
|
|
151
|
+
selected: E,
|
|
152
|
+
icon: !!p,
|
|
153
|
+
iconPosition: y,
|
|
154
|
+
label: !!T,
|
|
155
|
+
fullWidth: h,
|
|
156
|
+
textColor: H,
|
|
157
|
+
wrapped: ie
|
|
158
|
+
}), U = vt(Y), F = p && T && /* @__PURE__ */ u.isValidElement(p) ? /* @__PURE__ */ u.cloneElement(p, {
|
|
159
|
+
className: L(U.iconWrapper, p.props.className)
|
|
160
|
+
}) : p, Z = (N) => {
|
|
161
|
+
!E && m && m(N, M), I && I(N);
|
|
162
|
+
}, P = (N) => {
|
|
163
|
+
g && !E && m && m(N, M), k && k(N);
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ Q(mt, b({
|
|
166
|
+
focusRipple: !v,
|
|
167
|
+
className: L(U.root, i),
|
|
168
|
+
ref: n,
|
|
169
|
+
role: "tab",
|
|
170
|
+
"aria-selected": E,
|
|
171
|
+
disabled: d,
|
|
172
|
+
onClick: Z,
|
|
173
|
+
onFocus: P,
|
|
174
|
+
ownerState: Y,
|
|
175
|
+
tabIndex: E ? 0 : -1
|
|
176
|
+
}, V, {
|
|
177
|
+
children: [y === "top" || y === "start" ? /* @__PURE__ */ Q(u.Fragment, {
|
|
178
|
+
children: [F, T]
|
|
179
|
+
}) : /* @__PURE__ */ Q(u.Fragment, {
|
|
180
|
+
children: [T, F]
|
|
181
|
+
}), w]
|
|
182
|
+
}));
|
|
183
|
+
});
|
|
184
|
+
process.env.NODE_ENV !== "production" && (_e.propTypes = {
|
|
185
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
186
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
187
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
188
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
189
|
+
/**
|
|
190
|
+
* This prop isn't supported.
|
|
191
|
+
* Use the `component` prop if you need to change the children structure.
|
|
192
|
+
*/
|
|
193
|
+
children: at,
|
|
194
|
+
/**
|
|
195
|
+
* Override or extend the styles applied to the component.
|
|
196
|
+
*/
|
|
197
|
+
classes: t.object,
|
|
198
|
+
/**
|
|
199
|
+
* @ignore
|
|
200
|
+
*/
|
|
201
|
+
className: t.string,
|
|
202
|
+
/**
|
|
203
|
+
* If `true`, the component is disabled.
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
disabled: t.bool,
|
|
207
|
+
/**
|
|
208
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
209
|
+
* @default false
|
|
210
|
+
*/
|
|
211
|
+
disableFocusRipple: t.bool,
|
|
212
|
+
/**
|
|
213
|
+
* If `true`, the ripple effect is disabled.
|
|
214
|
+
*
|
|
215
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
216
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
|
+
disableRipple: t.bool,
|
|
220
|
+
/**
|
|
221
|
+
* The icon to display.
|
|
222
|
+
*/
|
|
223
|
+
icon: t.oneOfType([t.element, t.string]),
|
|
224
|
+
/**
|
|
225
|
+
* The position of the icon relative to the label.
|
|
226
|
+
* @default 'top'
|
|
227
|
+
*/
|
|
228
|
+
iconPosition: t.oneOf(["bottom", "end", "start", "top"]),
|
|
229
|
+
/**
|
|
230
|
+
* The label element.
|
|
231
|
+
*/
|
|
232
|
+
label: t.node,
|
|
233
|
+
/**
|
|
234
|
+
* @ignore
|
|
235
|
+
*/
|
|
236
|
+
onChange: t.func,
|
|
237
|
+
/**
|
|
238
|
+
* @ignore
|
|
239
|
+
*/
|
|
240
|
+
onClick: t.func,
|
|
241
|
+
/**
|
|
242
|
+
* @ignore
|
|
243
|
+
*/
|
|
244
|
+
onFocus: t.func,
|
|
245
|
+
/**
|
|
246
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
247
|
+
*/
|
|
248
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
249
|
+
/**
|
|
250
|
+
* You can provide your own value. Otherwise, we fallback to the child position index.
|
|
251
|
+
*/
|
|
252
|
+
value: t.any,
|
|
253
|
+
/**
|
|
254
|
+
* Tab labels appear in a single row.
|
|
255
|
+
* They can use a second line if needed.
|
|
256
|
+
* @default false
|
|
257
|
+
*/
|
|
258
|
+
wrapped: t.bool
|
|
259
|
+
});
|
|
260
|
+
const Gt = _e;
|
|
261
|
+
function St(e) {
|
|
262
|
+
return (1 + Math.sin(Math.PI * e - Math.PI / 2)) / 2;
|
|
263
|
+
}
|
|
264
|
+
function yt(e, o, n, c = {}, i = () => {
|
|
265
|
+
}) {
|
|
266
|
+
const {
|
|
267
|
+
ease: d = St,
|
|
268
|
+
duration: v = 300
|
|
269
|
+
// standard
|
|
270
|
+
} = c;
|
|
271
|
+
let h = null;
|
|
272
|
+
const p = o[e];
|
|
273
|
+
let y = !1;
|
|
274
|
+
const w = () => {
|
|
275
|
+
y = !0;
|
|
276
|
+
}, T = (m) => {
|
|
277
|
+
if (y) {
|
|
278
|
+
i(new Error("Animation cancelled"));
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
h === null && (h = m);
|
|
282
|
+
const I = Math.min(1, (m - h) / v);
|
|
283
|
+
if (o[e] = d(I) * (n - p) + p, I >= 1) {
|
|
284
|
+
requestAnimationFrame(() => {
|
|
285
|
+
i(null);
|
|
286
|
+
});
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
requestAnimationFrame(T);
|
|
290
|
+
};
|
|
291
|
+
return p === n ? (i(new Error("Element already at target position")), w) : (requestAnimationFrame(T), w);
|
|
292
|
+
}
|
|
293
|
+
const gt = ["onChange"], Tt = {
|
|
294
|
+
width: 99,
|
|
295
|
+
height: 99,
|
|
296
|
+
position: "absolute",
|
|
297
|
+
top: -9999,
|
|
298
|
+
overflow: "scroll"
|
|
299
|
+
};
|
|
300
|
+
function He(e) {
|
|
301
|
+
const {
|
|
302
|
+
onChange: o
|
|
303
|
+
} = e, n = ae(e, gt), c = u.useRef(), i = u.useRef(null), d = () => {
|
|
304
|
+
c.current = i.current.offsetHeight - i.current.clientHeight;
|
|
305
|
+
};
|
|
306
|
+
return ut(() => {
|
|
307
|
+
const v = $e(() => {
|
|
308
|
+
const p = c.current;
|
|
309
|
+
d(), p !== c.current && o(c.current);
|
|
310
|
+
}), h = Fe(i.current);
|
|
311
|
+
return h.addEventListener("resize", v), () => {
|
|
312
|
+
v.clear(), h.removeEventListener("resize", v);
|
|
313
|
+
};
|
|
314
|
+
}, [o]), u.useEffect(() => {
|
|
315
|
+
d(), o(c.current);
|
|
316
|
+
}, [o]), /* @__PURE__ */ C("div", b({
|
|
317
|
+
style: Tt,
|
|
318
|
+
ref: i
|
|
319
|
+
}, n));
|
|
320
|
+
}
|
|
321
|
+
process.env.NODE_ENV !== "production" && (He.propTypes = {
|
|
322
|
+
onChange: t.func.isRequired
|
|
323
|
+
});
|
|
324
|
+
const xt = je(/* @__PURE__ */ C("path", {
|
|
325
|
+
d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
|
|
326
|
+
}), "KeyboardArrowLeft"), Bt = je(/* @__PURE__ */ C("path", {
|
|
327
|
+
d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
|
|
328
|
+
}), "KeyboardArrowRight");
|
|
329
|
+
function Ct(e) {
|
|
330
|
+
return me("MuiTabScrollButton", e);
|
|
331
|
+
}
|
|
332
|
+
const wt = ve("MuiTabScrollButton", ["root", "vertical", "horizontal", "disabled"]), It = wt, Et = ["className", "slots", "slotProps", "direction", "orientation", "disabled"], Ot = (e) => {
|
|
333
|
+
const {
|
|
334
|
+
classes: o,
|
|
335
|
+
orientation: n,
|
|
336
|
+
disabled: c
|
|
337
|
+
} = e;
|
|
338
|
+
return ye({
|
|
339
|
+
root: ["root", n, c && "disabled"]
|
|
340
|
+
}, Ct, o);
|
|
341
|
+
}, Mt = _(ke, {
|
|
342
|
+
name: "MuiTabScrollButton",
|
|
343
|
+
slot: "Root",
|
|
344
|
+
overridesResolver: (e, o) => {
|
|
345
|
+
const {
|
|
346
|
+
ownerState: n
|
|
347
|
+
} = e;
|
|
348
|
+
return [o.root, n.orientation && o[n.orientation]];
|
|
349
|
+
}
|
|
350
|
+
})(({
|
|
351
|
+
ownerState: e
|
|
352
|
+
}) => b({
|
|
353
|
+
width: 40,
|
|
354
|
+
flexShrink: 0,
|
|
355
|
+
opacity: 0.8,
|
|
356
|
+
[`&.${It.disabled}`]: {
|
|
357
|
+
opacity: 0
|
|
358
|
+
}
|
|
359
|
+
}, e.orientation === "vertical" && {
|
|
360
|
+
width: "100%",
|
|
361
|
+
height: 40,
|
|
362
|
+
"& svg": {
|
|
363
|
+
transform: `rotate(${e.isRtl ? -90 : 90}deg)`
|
|
364
|
+
}
|
|
365
|
+
})), Ve = /* @__PURE__ */ u.forwardRef(function(o, n) {
|
|
366
|
+
var c, i;
|
|
367
|
+
const d = Se({
|
|
368
|
+
props: o,
|
|
369
|
+
name: "MuiTabScrollButton"
|
|
370
|
+
}), {
|
|
371
|
+
className: v,
|
|
372
|
+
slots: h = {},
|
|
373
|
+
slotProps: p = {},
|
|
374
|
+
direction: y
|
|
375
|
+
} = d, w = ae(d, Et), T = Ae(), m = b({
|
|
376
|
+
isRtl: T
|
|
377
|
+
}, d), I = Ot(m), k = (c = h.StartScrollButtonIcon) != null ? c : xt, E = (i = h.EndScrollButtonIcon) != null ? i : Bt, g = se({
|
|
378
|
+
elementType: k,
|
|
379
|
+
externalSlotProps: p.startScrollButtonIcon,
|
|
380
|
+
additionalProps: {
|
|
381
|
+
fontSize: "small"
|
|
382
|
+
},
|
|
383
|
+
ownerState: m
|
|
384
|
+
}), H = se({
|
|
385
|
+
elementType: E,
|
|
386
|
+
externalSlotProps: p.endScrollButtonIcon,
|
|
387
|
+
additionalProps: {
|
|
388
|
+
fontSize: "small"
|
|
389
|
+
},
|
|
390
|
+
ownerState: m
|
|
391
|
+
});
|
|
392
|
+
return /* @__PURE__ */ C(Mt, b({
|
|
393
|
+
component: "div",
|
|
394
|
+
className: L(I.root, v),
|
|
395
|
+
ref: n,
|
|
396
|
+
role: null,
|
|
397
|
+
ownerState: m,
|
|
398
|
+
tabIndex: null
|
|
399
|
+
}, w, {
|
|
400
|
+
children: y === "left" ? /* @__PURE__ */ C(k, b({}, g)) : /* @__PURE__ */ C(E, b({}, H))
|
|
401
|
+
}));
|
|
402
|
+
});
|
|
403
|
+
process.env.NODE_ENV !== "production" && (Ve.propTypes = {
|
|
404
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
405
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
406
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
407
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
408
|
+
/**
|
|
409
|
+
* The content of the component.
|
|
410
|
+
*/
|
|
411
|
+
children: t.node,
|
|
412
|
+
/**
|
|
413
|
+
* Override or extend the styles applied to the component.
|
|
414
|
+
*/
|
|
415
|
+
classes: t.object,
|
|
416
|
+
/**
|
|
417
|
+
* @ignore
|
|
418
|
+
*/
|
|
419
|
+
className: t.string,
|
|
420
|
+
/**
|
|
421
|
+
* The direction the button should indicate.
|
|
422
|
+
*/
|
|
423
|
+
direction: t.oneOf(["left", "right"]).isRequired,
|
|
424
|
+
/**
|
|
425
|
+
* If `true`, the component is disabled.
|
|
426
|
+
* @default false
|
|
427
|
+
*/
|
|
428
|
+
disabled: t.bool,
|
|
429
|
+
/**
|
|
430
|
+
* The component orientation (layout flow direction).
|
|
431
|
+
*/
|
|
432
|
+
orientation: t.oneOf(["horizontal", "vertical"]).isRequired,
|
|
433
|
+
/**
|
|
434
|
+
* The extra props for the slot components.
|
|
435
|
+
* You can override the existing props or add new ones.
|
|
436
|
+
* @default {}
|
|
437
|
+
*/
|
|
438
|
+
slotProps: t.shape({
|
|
439
|
+
endScrollButtonIcon: t.oneOfType([t.func, t.object]),
|
|
440
|
+
startScrollButtonIcon: t.oneOfType([t.func, t.object])
|
|
441
|
+
}),
|
|
442
|
+
/**
|
|
443
|
+
* The components used for each slot inside.
|
|
444
|
+
* @default {}
|
|
445
|
+
*/
|
|
446
|
+
slots: t.shape({
|
|
447
|
+
EndScrollButtonIcon: t.elementType,
|
|
448
|
+
StartScrollButtonIcon: t.elementType
|
|
449
|
+
}),
|
|
450
|
+
/**
|
|
451
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
452
|
+
*/
|
|
453
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
454
|
+
});
|
|
455
|
+
const Nt = Ve;
|
|
456
|
+
function Rt(e) {
|
|
457
|
+
return me("MuiTabs", e);
|
|
458
|
+
}
|
|
459
|
+
const Pt = ve("MuiTabs", ["root", "vertical", "flexContainer", "flexContainerVertical", "centered", "scroller", "fixed", "scrollableX", "scrollableY", "hideScrollbar", "scrollButtons", "scrollButtonsHideMobile", "indicator"]), he = Pt, zt = ["aria-label", "aria-labelledby", "action", "centered", "children", "className", "component", "allowScrollButtonsMobile", "indicatorColor", "onChange", "orientation", "ScrollButtonComponent", "scrollButtons", "selectionFollowsFocus", "slots", "slotProps", "TabIndicatorProps", "TabScrollButtonProps", "textColor", "value", "variant", "visibleScrollbar"], Re = (e, o) => e === o ? e.firstChild : o && o.nextElementSibling ? o.nextElementSibling : e.firstChild, Pe = (e, o) => e === o ? e.lastChild : o && o.previousElementSibling ? o.previousElementSibling : e.lastChild, ne = (e, o, n) => {
|
|
460
|
+
let c = !1, i = n(e, o);
|
|
461
|
+
for (; i; ) {
|
|
462
|
+
if (i === e.firstChild) {
|
|
463
|
+
if (c)
|
|
464
|
+
return;
|
|
465
|
+
c = !0;
|
|
466
|
+
}
|
|
467
|
+
const d = i.disabled || i.getAttribute("aria-disabled") === "true";
|
|
468
|
+
if (!i.hasAttribute("tabindex") || d)
|
|
469
|
+
i = n(e, i);
|
|
470
|
+
else {
|
|
471
|
+
i.focus();
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}, Wt = (e) => {
|
|
476
|
+
const {
|
|
477
|
+
vertical: o,
|
|
478
|
+
fixed: n,
|
|
479
|
+
hideScrollbar: c,
|
|
480
|
+
scrollableX: i,
|
|
481
|
+
scrollableY: d,
|
|
482
|
+
centered: v,
|
|
483
|
+
scrollButtonsHideMobile: h,
|
|
484
|
+
classes: p
|
|
485
|
+
} = e;
|
|
486
|
+
return ye({
|
|
487
|
+
root: ["root", o && "vertical"],
|
|
488
|
+
scroller: ["scroller", n && "fixed", c && "hideScrollbar", i && "scrollableX", d && "scrollableY"],
|
|
489
|
+
flexContainer: ["flexContainer", o && "flexContainerVertical", v && "centered"],
|
|
490
|
+
indicator: ["indicator"],
|
|
491
|
+
scrollButtons: ["scrollButtons", h && "scrollButtonsHideMobile"],
|
|
492
|
+
scrollableX: [i && "scrollableX"],
|
|
493
|
+
hideScrollbar: [c && "hideScrollbar"]
|
|
494
|
+
}, Rt, p);
|
|
495
|
+
}, Lt = _("div", {
|
|
496
|
+
name: "MuiTabs",
|
|
497
|
+
slot: "Root",
|
|
498
|
+
overridesResolver: (e, o) => {
|
|
499
|
+
const {
|
|
500
|
+
ownerState: n
|
|
501
|
+
} = e;
|
|
502
|
+
return [{
|
|
503
|
+
[`& .${he.scrollButtons}`]: o.scrollButtons
|
|
504
|
+
}, {
|
|
505
|
+
[`& .${he.scrollButtons}`]: n.scrollButtonsHideMobile && o.scrollButtonsHideMobile
|
|
506
|
+
}, o.root, n.vertical && o.vertical];
|
|
507
|
+
}
|
|
508
|
+
})(({
|
|
509
|
+
ownerState: e,
|
|
510
|
+
theme: o
|
|
511
|
+
}) => b({
|
|
512
|
+
overflow: "hidden",
|
|
513
|
+
minHeight: 48,
|
|
514
|
+
// Add iOS momentum scrolling for iOS < 13.0
|
|
515
|
+
WebkitOverflowScrolling: "touch",
|
|
516
|
+
display: "flex"
|
|
517
|
+
}, e.vertical && {
|
|
518
|
+
flexDirection: "column"
|
|
519
|
+
}, e.scrollButtonsHideMobile && {
|
|
520
|
+
[`& .${he.scrollButtons}`]: {
|
|
521
|
+
[o.breakpoints.down("sm")]: {
|
|
522
|
+
display: "none"
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
})), kt = _("div", {
|
|
526
|
+
name: "MuiTabs",
|
|
527
|
+
slot: "Scroller",
|
|
528
|
+
overridesResolver: (e, o) => {
|
|
529
|
+
const {
|
|
530
|
+
ownerState: n
|
|
531
|
+
} = e;
|
|
532
|
+
return [o.scroller, n.fixed && o.fixed, n.hideScrollbar && o.hideScrollbar, n.scrollableX && o.scrollableX, n.scrollableY && o.scrollableY];
|
|
533
|
+
}
|
|
534
|
+
})(({
|
|
535
|
+
ownerState: e
|
|
536
|
+
}) => b({
|
|
537
|
+
position: "relative",
|
|
538
|
+
display: "inline-block",
|
|
539
|
+
flex: "1 1 auto",
|
|
540
|
+
whiteSpace: "nowrap"
|
|
541
|
+
}, e.fixed && {
|
|
542
|
+
overflowX: "hidden",
|
|
543
|
+
width: "100%"
|
|
544
|
+
}, e.hideScrollbar && {
|
|
545
|
+
// Hide dimensionless scrollbar on macOS
|
|
546
|
+
scrollbarWidth: "none",
|
|
547
|
+
// Firefox
|
|
548
|
+
"&::-webkit-scrollbar": {
|
|
549
|
+
display: "none"
|
|
550
|
+
// Safari + Chrome
|
|
551
|
+
}
|
|
552
|
+
}, e.scrollableX && {
|
|
553
|
+
overflowX: "auto",
|
|
554
|
+
overflowY: "hidden"
|
|
555
|
+
}, e.scrollableY && {
|
|
556
|
+
overflowY: "auto",
|
|
557
|
+
overflowX: "hidden"
|
|
558
|
+
})), Ft = _("div", {
|
|
559
|
+
name: "MuiTabs",
|
|
560
|
+
slot: "FlexContainer",
|
|
561
|
+
overridesResolver: (e, o) => {
|
|
562
|
+
const {
|
|
563
|
+
ownerState: n
|
|
564
|
+
} = e;
|
|
565
|
+
return [o.flexContainer, n.vertical && o.flexContainerVertical, n.centered && o.centered];
|
|
566
|
+
}
|
|
567
|
+
})(({
|
|
568
|
+
ownerState: e
|
|
569
|
+
}) => b({
|
|
570
|
+
display: "flex"
|
|
571
|
+
}, e.vertical && {
|
|
572
|
+
flexDirection: "column"
|
|
573
|
+
}, e.centered && {
|
|
574
|
+
justifyContent: "center"
|
|
575
|
+
})), $t = _("span", {
|
|
576
|
+
name: "MuiTabs",
|
|
577
|
+
slot: "Indicator",
|
|
578
|
+
overridesResolver: (e, o) => o.indicator
|
|
579
|
+
})(({
|
|
580
|
+
ownerState: e,
|
|
581
|
+
theme: o
|
|
582
|
+
}) => b({
|
|
583
|
+
position: "absolute",
|
|
584
|
+
height: 2,
|
|
585
|
+
bottom: 0,
|
|
586
|
+
width: "100%",
|
|
587
|
+
transition: o.transitions.create()
|
|
588
|
+
}, e.indicatorColor === "primary" && {
|
|
589
|
+
backgroundColor: (o.vars || o).palette.primary.main
|
|
590
|
+
}, e.indicatorColor === "secondary" && {
|
|
591
|
+
backgroundColor: (o.vars || o).palette.secondary.main
|
|
592
|
+
}, e.vertical && {
|
|
593
|
+
height: "100%",
|
|
594
|
+
width: 2,
|
|
595
|
+
right: 0
|
|
596
|
+
})), At = _(He)({
|
|
597
|
+
overflowX: "auto",
|
|
598
|
+
overflowY: "hidden",
|
|
599
|
+
// Hide dimensionless scrollbar on macOS
|
|
600
|
+
scrollbarWidth: "none",
|
|
601
|
+
// Firefox
|
|
602
|
+
"&::-webkit-scrollbar": {
|
|
603
|
+
display: "none"
|
|
604
|
+
// Safari + Chrome
|
|
605
|
+
}
|
|
606
|
+
}), ze = {};
|
|
607
|
+
let We = !1;
|
|
608
|
+
const Ue = /* @__PURE__ */ u.forwardRef(function(o, n) {
|
|
609
|
+
const c = Se({
|
|
610
|
+
props: o,
|
|
611
|
+
name: "MuiTabs"
|
|
612
|
+
}), i = dt(), d = Ae(), {
|
|
613
|
+
"aria-label": v,
|
|
614
|
+
"aria-labelledby": h,
|
|
615
|
+
action: p,
|
|
616
|
+
centered: y = !1,
|
|
617
|
+
children: w,
|
|
618
|
+
className: T,
|
|
619
|
+
component: m = "div",
|
|
620
|
+
allowScrollButtonsMobile: I = !1,
|
|
621
|
+
indicatorColor: k = "primary",
|
|
622
|
+
onChange: E,
|
|
623
|
+
orientation: g = "horizontal",
|
|
624
|
+
ScrollButtonComponent: H = Nt,
|
|
625
|
+
scrollButtons: M = "auto",
|
|
626
|
+
selectionFollowsFocus: ie,
|
|
627
|
+
slots: V = {},
|
|
628
|
+
slotProps: Y = {},
|
|
629
|
+
TabIndicatorProps: U = {},
|
|
630
|
+
TabScrollButtonProps: F = {},
|
|
631
|
+
textColor: Z = "primary",
|
|
632
|
+
value: P,
|
|
633
|
+
variant: N = "standard",
|
|
634
|
+
visibleScrollbar: ce = !1
|
|
635
|
+
} = c, Xe = ae(c, zt), x = N === "scrollable", B = g === "vertical", K = B ? "scrollTop" : "scrollLeft", ee = B ? "top" : "left", te = B ? "bottom" : "right", de = B ? "clientHeight" : "clientWidth", q = B ? "height" : "width", $ = b({}, c, {
|
|
636
|
+
component: m,
|
|
637
|
+
allowScrollButtonsMobile: I,
|
|
638
|
+
indicatorColor: k,
|
|
639
|
+
orientation: g,
|
|
640
|
+
vertical: B,
|
|
641
|
+
scrollButtons: M,
|
|
642
|
+
textColor: Z,
|
|
643
|
+
variant: N,
|
|
644
|
+
visibleScrollbar: ce,
|
|
645
|
+
fixed: !x,
|
|
646
|
+
hideScrollbar: x && !ce,
|
|
647
|
+
scrollableX: x && !B,
|
|
648
|
+
scrollableY: x && B,
|
|
649
|
+
centered: y && !x,
|
|
650
|
+
scrollButtonsHideMobile: !I
|
|
651
|
+
}), z = Wt($), Ye = se({
|
|
652
|
+
elementType: V.StartScrollButtonIcon,
|
|
653
|
+
externalSlotProps: Y.startScrollButtonIcon,
|
|
654
|
+
ownerState: $
|
|
655
|
+
}), Ke = se({
|
|
656
|
+
elementType: V.EndScrollButtonIcon,
|
|
657
|
+
externalSlotProps: Y.endScrollButtonIcon,
|
|
658
|
+
ownerState: $
|
|
659
|
+
});
|
|
660
|
+
process.env.NODE_ENV !== "production" && y && x && console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties at the same time on a `Tabs` component.');
|
|
661
|
+
const [ge, qe] = u.useState(!1), [A, Te] = u.useState(ze), [xe, Ge] = u.useState(!1), [Be, Je] = u.useState(!1), [Ce, Qe] = u.useState(!1), [we, Ze] = u.useState({
|
|
662
|
+
overflow: "hidden",
|
|
663
|
+
scrollbarWidth: 0
|
|
664
|
+
}), oe = /* @__PURE__ */ new Map(), R = u.useRef(null), j = u.useRef(null), Ie = () => {
|
|
665
|
+
const l = R.current;
|
|
666
|
+
let r;
|
|
667
|
+
if (l) {
|
|
668
|
+
const a = l.getBoundingClientRect();
|
|
669
|
+
r = {
|
|
670
|
+
clientWidth: l.clientWidth,
|
|
671
|
+
scrollLeft: l.scrollLeft,
|
|
672
|
+
scrollTop: l.scrollTop,
|
|
673
|
+
scrollLeftNormalized: pt(l, d ? "rtl" : "ltr"),
|
|
674
|
+
scrollWidth: l.scrollWidth,
|
|
675
|
+
top: a.top,
|
|
676
|
+
bottom: a.bottom,
|
|
677
|
+
left: a.left,
|
|
678
|
+
right: a.right
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
let s;
|
|
682
|
+
if (l && P !== !1) {
|
|
683
|
+
const a = j.current.children;
|
|
684
|
+
if (a.length > 0) {
|
|
685
|
+
const f = a[oe.get(P)];
|
|
686
|
+
process.env.NODE_ENV !== "production" && (f || console.error(["MUI: The `value` provided to the Tabs component is invalid.", `None of the Tabs' children match with "${P}".`, oe.keys ? `You can provide one of the following values: ${Array.from(oe.keys()).join(", ")}.` : null].join(`
|
|
687
|
+
`))), s = f ? f.getBoundingClientRect() : null, process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && !We && s && s.width === 0 && s.height === 0 && // if the whole Tabs component is hidden, don't warn
|
|
688
|
+
r.clientWidth !== 0 && (r = null, console.error(["MUI: The `value` provided to the Tabs component is invalid.", `The Tab with this \`value\` ("${P}") is not part of the document layout.`, "Make sure the tab item is present in the document or that it's not `display: none`."].join(`
|
|
689
|
+
`)), We = !0);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return {
|
|
693
|
+
tabsMeta: r,
|
|
694
|
+
tabMeta: s
|
|
695
|
+
};
|
|
696
|
+
}, G = be(() => {
|
|
697
|
+
const {
|
|
698
|
+
tabsMeta: l,
|
|
699
|
+
tabMeta: r
|
|
700
|
+
} = Ie();
|
|
701
|
+
let s = 0, a;
|
|
702
|
+
if (B)
|
|
703
|
+
a = "top", r && l && (s = r.top - l.top + l.scrollTop);
|
|
704
|
+
else if (a = d ? "right" : "left", r && l) {
|
|
705
|
+
const S = d ? l.scrollLeftNormalized + l.clientWidth - l.scrollWidth : l.scrollLeft;
|
|
706
|
+
s = (d ? -1 : 1) * (r[a] - l[a] + S);
|
|
707
|
+
}
|
|
708
|
+
const f = {
|
|
709
|
+
[a]: s,
|
|
710
|
+
// May be wrong until the font is loaded.
|
|
711
|
+
[q]: r ? r[q] : 0
|
|
712
|
+
};
|
|
713
|
+
if (isNaN(A[a]) || isNaN(A[q]))
|
|
714
|
+
Te(f);
|
|
715
|
+
else {
|
|
716
|
+
const S = Math.abs(A[a] - f[a]), O = Math.abs(A[q] - f[q]);
|
|
717
|
+
(S >= 1 || O >= 1) && Te(f);
|
|
718
|
+
}
|
|
719
|
+
}), ue = (l, {
|
|
720
|
+
animation: r = !0
|
|
721
|
+
} = {}) => {
|
|
722
|
+
r ? yt(K, R.current, l, {
|
|
723
|
+
duration: i.transitions.duration.standard
|
|
724
|
+
}) : R.current[K] = l;
|
|
725
|
+
}, Ee = (l) => {
|
|
726
|
+
let r = R.current[K];
|
|
727
|
+
B ? r += l : (r += l * (d ? -1 : 1), r *= d && De() === "reverse" ? -1 : 1), ue(r);
|
|
728
|
+
}, Oe = () => {
|
|
729
|
+
const l = R.current[de];
|
|
730
|
+
let r = 0;
|
|
731
|
+
const s = Array.from(j.current.children);
|
|
732
|
+
for (let a = 0; a < s.length; a += 1) {
|
|
733
|
+
const f = s[a];
|
|
734
|
+
if (r + f[de] > l) {
|
|
735
|
+
a === 0 && (r = l);
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
r += f[de];
|
|
739
|
+
}
|
|
740
|
+
return r;
|
|
741
|
+
}, et = () => {
|
|
742
|
+
Ee(-1 * Oe());
|
|
743
|
+
}, tt = () => {
|
|
744
|
+
Ee(Oe());
|
|
745
|
+
}, ot = u.useCallback((l) => {
|
|
746
|
+
Ze({
|
|
747
|
+
overflow: null,
|
|
748
|
+
scrollbarWidth: l
|
|
749
|
+
});
|
|
750
|
+
}, []), lt = () => {
|
|
751
|
+
const l = {};
|
|
752
|
+
l.scrollbarSizeListener = x ? /* @__PURE__ */ C(At, {
|
|
753
|
+
onChange: ot,
|
|
754
|
+
className: L(z.scrollableX, z.hideScrollbar)
|
|
755
|
+
}) : null;
|
|
756
|
+
const s = x && (M === "auto" && (xe || Be) || M === !0);
|
|
757
|
+
return l.scrollButtonStart = s ? /* @__PURE__ */ C(H, b({
|
|
758
|
+
slots: {
|
|
759
|
+
StartScrollButtonIcon: V.StartScrollButtonIcon
|
|
760
|
+
},
|
|
761
|
+
slotProps: {
|
|
762
|
+
startScrollButtonIcon: Ye
|
|
763
|
+
},
|
|
764
|
+
orientation: g,
|
|
765
|
+
direction: d ? "right" : "left",
|
|
766
|
+
onClick: et,
|
|
767
|
+
disabled: !xe
|
|
768
|
+
}, F, {
|
|
769
|
+
className: L(z.scrollButtons, F.className)
|
|
770
|
+
})) : null, l.scrollButtonEnd = s ? /* @__PURE__ */ C(H, b({
|
|
771
|
+
slots: {
|
|
772
|
+
EndScrollButtonIcon: V.EndScrollButtonIcon
|
|
773
|
+
},
|
|
774
|
+
slotProps: {
|
|
775
|
+
endScrollButtonIcon: Ke
|
|
776
|
+
},
|
|
777
|
+
orientation: g,
|
|
778
|
+
direction: d ? "left" : "right",
|
|
779
|
+
onClick: tt,
|
|
780
|
+
disabled: !Be
|
|
781
|
+
}, F, {
|
|
782
|
+
className: L(z.scrollButtons, F.className)
|
|
783
|
+
})) : null, l;
|
|
784
|
+
}, Me = be((l) => {
|
|
785
|
+
const {
|
|
786
|
+
tabsMeta: r,
|
|
787
|
+
tabMeta: s
|
|
788
|
+
} = Ie();
|
|
789
|
+
if (!(!s || !r)) {
|
|
790
|
+
if (s[ee] < r[ee]) {
|
|
791
|
+
const a = r[K] + (s[ee] - r[ee]);
|
|
792
|
+
ue(a, {
|
|
793
|
+
animation: l
|
|
794
|
+
});
|
|
795
|
+
} else if (s[te] > r[te]) {
|
|
796
|
+
const a = r[K] + (s[te] - r[te]);
|
|
797
|
+
ue(a, {
|
|
798
|
+
animation: l
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}), le = be(() => {
|
|
803
|
+
x && M !== !1 && Qe(!Ce);
|
|
804
|
+
});
|
|
805
|
+
u.useEffect(() => {
|
|
806
|
+
const l = $e(() => {
|
|
807
|
+
R.current && G();
|
|
808
|
+
});
|
|
809
|
+
let r;
|
|
810
|
+
const s = (S) => {
|
|
811
|
+
S.forEach((O) => {
|
|
812
|
+
O.removedNodes.forEach((J) => {
|
|
813
|
+
var W;
|
|
814
|
+
(W = r) == null || W.unobserve(J);
|
|
815
|
+
}), O.addedNodes.forEach((J) => {
|
|
816
|
+
var W;
|
|
817
|
+
(W = r) == null || W.observe(J);
|
|
818
|
+
});
|
|
819
|
+
}), l(), le();
|
|
820
|
+
}, a = Fe(R.current);
|
|
821
|
+
a.addEventListener("resize", l);
|
|
822
|
+
let f;
|
|
823
|
+
return typeof ResizeObserver < "u" && (r = new ResizeObserver(l), Array.from(j.current.children).forEach((S) => {
|
|
824
|
+
r.observe(S);
|
|
825
|
+
})), typeof MutationObserver < "u" && (f = new MutationObserver(s), f.observe(j.current, {
|
|
826
|
+
childList: !0
|
|
827
|
+
})), () => {
|
|
828
|
+
var S, O;
|
|
829
|
+
l.clear(), a.removeEventListener("resize", l), (S = f) == null || S.disconnect(), (O = r) == null || O.disconnect();
|
|
830
|
+
};
|
|
831
|
+
}, [G, le]), u.useEffect(() => {
|
|
832
|
+
const l = Array.from(j.current.children), r = l.length;
|
|
833
|
+
if (typeof IntersectionObserver < "u" && r > 0 && x && M !== !1) {
|
|
834
|
+
const s = l[0], a = l[r - 1], f = {
|
|
835
|
+
root: R.current,
|
|
836
|
+
threshold: 0.99
|
|
837
|
+
}, S = (fe) => {
|
|
838
|
+
Ge(!fe[0].isIntersecting);
|
|
839
|
+
}, O = new IntersectionObserver(S, f);
|
|
840
|
+
O.observe(s);
|
|
841
|
+
const J = (fe) => {
|
|
842
|
+
Je(!fe[0].isIntersecting);
|
|
843
|
+
}, W = new IntersectionObserver(J, f);
|
|
844
|
+
return W.observe(a), () => {
|
|
845
|
+
O.disconnect(), W.disconnect();
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
}, [x, M, Ce, w == null ? void 0 : w.length]), u.useEffect(() => {
|
|
849
|
+
qe(!0);
|
|
850
|
+
}, []), u.useEffect(() => {
|
|
851
|
+
G();
|
|
852
|
+
}), u.useEffect(() => {
|
|
853
|
+
Me(ze !== A);
|
|
854
|
+
}, [Me, A]), u.useImperativeHandle(p, () => ({
|
|
855
|
+
updateIndicator: G,
|
|
856
|
+
updateScrollButtons: le
|
|
857
|
+
}), [G, le]);
|
|
858
|
+
const Ne = /* @__PURE__ */ C($t, b({}, U, {
|
|
859
|
+
className: L(z.indicator, U.className),
|
|
860
|
+
ownerState: $,
|
|
861
|
+
style: b({}, A, U.style)
|
|
862
|
+
}));
|
|
863
|
+
let re = 0;
|
|
864
|
+
const rt = u.Children.map(w, (l) => {
|
|
865
|
+
if (!/* @__PURE__ */ u.isValidElement(l))
|
|
866
|
+
return null;
|
|
867
|
+
process.env.NODE_ENV !== "production" && ct.isFragment(l) && console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.", "Consider providing an array instead."].join(`
|
|
868
|
+
`));
|
|
869
|
+
const r = l.props.value === void 0 ? re : l.props.value;
|
|
870
|
+
oe.set(r, re);
|
|
871
|
+
const s = r === P;
|
|
872
|
+
return re += 1, /* @__PURE__ */ u.cloneElement(l, b({
|
|
873
|
+
fullWidth: N === "fullWidth",
|
|
874
|
+
indicator: s && !ge && Ne,
|
|
875
|
+
selected: s,
|
|
876
|
+
selectionFollowsFocus: ie,
|
|
877
|
+
onChange: E,
|
|
878
|
+
textColor: Z,
|
|
879
|
+
value: r
|
|
880
|
+
}, re === 1 && P === !1 && !l.props.tabIndex ? {
|
|
881
|
+
tabIndex: 0
|
|
882
|
+
} : {}));
|
|
883
|
+
}), nt = (l) => {
|
|
884
|
+
const r = j.current, s = it(r).activeElement;
|
|
885
|
+
if (s.getAttribute("role") !== "tab")
|
|
886
|
+
return;
|
|
887
|
+
let f = g === "horizontal" ? "ArrowLeft" : "ArrowUp", S = g === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
888
|
+
switch (g === "horizontal" && d && (f = "ArrowRight", S = "ArrowLeft"), l.key) {
|
|
889
|
+
case f:
|
|
890
|
+
l.preventDefault(), ne(r, s, Pe);
|
|
891
|
+
break;
|
|
892
|
+
case S:
|
|
893
|
+
l.preventDefault(), ne(r, s, Re);
|
|
894
|
+
break;
|
|
895
|
+
case "Home":
|
|
896
|
+
l.preventDefault(), ne(r, null, Re);
|
|
897
|
+
break;
|
|
898
|
+
case "End":
|
|
899
|
+
l.preventDefault(), ne(r, null, Pe);
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
}, pe = lt();
|
|
903
|
+
return /* @__PURE__ */ Q(Lt, b({
|
|
904
|
+
className: L(z.root, T),
|
|
905
|
+
ownerState: $,
|
|
906
|
+
ref: n,
|
|
907
|
+
as: m
|
|
908
|
+
}, Xe, {
|
|
909
|
+
children: [pe.scrollButtonStart, pe.scrollbarSizeListener, /* @__PURE__ */ Q(kt, {
|
|
910
|
+
className: z.scroller,
|
|
911
|
+
ownerState: $,
|
|
912
|
+
style: {
|
|
913
|
+
overflow: we.overflow,
|
|
914
|
+
[B ? `margin${d ? "Left" : "Right"}` : "marginBottom"]: ce ? void 0 : -we.scrollbarWidth
|
|
915
|
+
},
|
|
916
|
+
ref: R,
|
|
917
|
+
children: [/* @__PURE__ */ C(Ft, {
|
|
918
|
+
"aria-label": v,
|
|
919
|
+
"aria-labelledby": h,
|
|
920
|
+
"aria-orientation": g === "vertical" ? "vertical" : null,
|
|
921
|
+
className: z.flexContainer,
|
|
922
|
+
ownerState: $,
|
|
923
|
+
onKeyDown: nt,
|
|
924
|
+
ref: j,
|
|
925
|
+
role: "tablist",
|
|
926
|
+
children: rt
|
|
927
|
+
}), ge && Ne]
|
|
928
|
+
}), pe.scrollButtonEnd]
|
|
929
|
+
}));
|
|
930
|
+
});
|
|
931
|
+
process.env.NODE_ENV !== "production" && (Ue.propTypes = {
|
|
932
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
933
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
934
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
935
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
936
|
+
/**
|
|
937
|
+
* Callback fired when the component mounts.
|
|
938
|
+
* This is useful when you want to trigger an action programmatically.
|
|
939
|
+
* It supports two actions: `updateIndicator()` and `updateScrollButtons()`
|
|
940
|
+
*
|
|
941
|
+
* @param {object} actions This object contains all possible actions
|
|
942
|
+
* that can be triggered programmatically.
|
|
943
|
+
*/
|
|
944
|
+
action: st,
|
|
945
|
+
/**
|
|
946
|
+
* If `true`, the scroll buttons aren't forced hidden on mobile.
|
|
947
|
+
* By default the scroll buttons are hidden on mobile and takes precedence over `scrollButtons`.
|
|
948
|
+
* @default false
|
|
949
|
+
*/
|
|
950
|
+
allowScrollButtonsMobile: t.bool,
|
|
951
|
+
/**
|
|
952
|
+
* The label for the Tabs as a string.
|
|
953
|
+
*/
|
|
954
|
+
"aria-label": t.string,
|
|
955
|
+
/**
|
|
956
|
+
* An id or list of ids separated by a space that label the Tabs.
|
|
957
|
+
*/
|
|
958
|
+
"aria-labelledby": t.string,
|
|
959
|
+
/**
|
|
960
|
+
* If `true`, the tabs are centered.
|
|
961
|
+
* This prop is intended for large views.
|
|
962
|
+
* @default false
|
|
963
|
+
*/
|
|
964
|
+
centered: t.bool,
|
|
965
|
+
/**
|
|
966
|
+
* The content of the component.
|
|
967
|
+
*/
|
|
968
|
+
children: t.node,
|
|
969
|
+
/**
|
|
970
|
+
* Override or extend the styles applied to the component.
|
|
971
|
+
*/
|
|
972
|
+
classes: t.object,
|
|
973
|
+
/**
|
|
974
|
+
* @ignore
|
|
975
|
+
*/
|
|
976
|
+
className: t.string,
|
|
977
|
+
/**
|
|
978
|
+
* The component used for the root node.
|
|
979
|
+
* Either a string to use a HTML element or a component.
|
|
980
|
+
*/
|
|
981
|
+
component: t.elementType,
|
|
982
|
+
/**
|
|
983
|
+
* Determines the color of the indicator.
|
|
984
|
+
* @default 'primary'
|
|
985
|
+
*/
|
|
986
|
+
indicatorColor: t.oneOfType([t.oneOf(["primary", "secondary"]), t.string]),
|
|
987
|
+
/**
|
|
988
|
+
* Callback fired when the value changes.
|
|
989
|
+
*
|
|
990
|
+
* @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
991
|
+
* @param {any} value We default to the index of the child (number)
|
|
992
|
+
*/
|
|
993
|
+
onChange: t.func,
|
|
994
|
+
/**
|
|
995
|
+
* The component orientation (layout flow direction).
|
|
996
|
+
* @default 'horizontal'
|
|
997
|
+
*/
|
|
998
|
+
orientation: t.oneOf(["horizontal", "vertical"]),
|
|
999
|
+
/**
|
|
1000
|
+
* The component used to render the scroll buttons.
|
|
1001
|
+
* @default TabScrollButton
|
|
1002
|
+
*/
|
|
1003
|
+
ScrollButtonComponent: t.elementType,
|
|
1004
|
+
/**
|
|
1005
|
+
* Determine behavior of scroll buttons when tabs are set to scroll:
|
|
1006
|
+
*
|
|
1007
|
+
* - `auto` will only present them when not all the items are visible.
|
|
1008
|
+
* - `true` will always present them.
|
|
1009
|
+
* - `false` will never present them.
|
|
1010
|
+
*
|
|
1011
|
+
* By default the scroll buttons are hidden on mobile.
|
|
1012
|
+
* This behavior can be disabled with `allowScrollButtonsMobile`.
|
|
1013
|
+
* @default 'auto'
|
|
1014
|
+
*/
|
|
1015
|
+
scrollButtons: t.oneOf(["auto", !1, !0]),
|
|
1016
|
+
/**
|
|
1017
|
+
* If `true` the selected tab changes on focus. Otherwise it only
|
|
1018
|
+
* changes on activation.
|
|
1019
|
+
*/
|
|
1020
|
+
selectionFollowsFocus: t.bool,
|
|
1021
|
+
/**
|
|
1022
|
+
* The extra props for the slot components.
|
|
1023
|
+
* You can override the existing props or add new ones.
|
|
1024
|
+
* @default {}
|
|
1025
|
+
*/
|
|
1026
|
+
slotProps: t.shape({
|
|
1027
|
+
endScrollButtonIcon: t.oneOfType([t.func, t.object]),
|
|
1028
|
+
startScrollButtonIcon: t.oneOfType([t.func, t.object])
|
|
1029
|
+
}),
|
|
1030
|
+
/**
|
|
1031
|
+
* The components used for each slot inside.
|
|
1032
|
+
* @default {}
|
|
1033
|
+
*/
|
|
1034
|
+
slots: t.shape({
|
|
1035
|
+
EndScrollButtonIcon: t.elementType,
|
|
1036
|
+
StartScrollButtonIcon: t.elementType
|
|
1037
|
+
}),
|
|
1038
|
+
/**
|
|
1039
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1040
|
+
*/
|
|
1041
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
1042
|
+
/**
|
|
1043
|
+
* Props applied to the tab indicator element.
|
|
1044
|
+
* @default {}
|
|
1045
|
+
*/
|
|
1046
|
+
TabIndicatorProps: t.object,
|
|
1047
|
+
/**
|
|
1048
|
+
* Props applied to the [`TabScrollButton`](/material-ui/api/tab-scroll-button/) element.
|
|
1049
|
+
* @default {}
|
|
1050
|
+
*/
|
|
1051
|
+
TabScrollButtonProps: t.object,
|
|
1052
|
+
/**
|
|
1053
|
+
* Determines the color of the `Tab`.
|
|
1054
|
+
* @default 'primary'
|
|
1055
|
+
*/
|
|
1056
|
+
textColor: t.oneOf(["inherit", "primary", "secondary"]),
|
|
1057
|
+
/**
|
|
1058
|
+
* The value of the currently selected `Tab`.
|
|
1059
|
+
* If you don't want any selected `Tab`, you can set this prop to `false`.
|
|
1060
|
+
*/
|
|
1061
|
+
value: t.any,
|
|
1062
|
+
/**
|
|
1063
|
+
* Determines additional display behavior of the tabs:
|
|
1064
|
+
*
|
|
1065
|
+
* - `scrollable` will invoke scrolling properties and allow for horizontally
|
|
1066
|
+
* scrolling (or swiping) of the tab bar.
|
|
1067
|
+
* - `fullWidth` will make the tabs grow to use all the available space,
|
|
1068
|
+
* which should be used for small views, like on mobile.
|
|
1069
|
+
* - `standard` will render the default state.
|
|
1070
|
+
* @default 'standard'
|
|
1071
|
+
*/
|
|
1072
|
+
variant: t.oneOf(["fullWidth", "scrollable", "standard"]),
|
|
1073
|
+
/**
|
|
1074
|
+
* If `true`, the scrollbar is visible. It can be useful when displaying
|
|
1075
|
+
* a long vertical list of tabs.
|
|
1076
|
+
* @default false
|
|
1077
|
+
*/
|
|
1078
|
+
visibleScrollbar: t.bool
|
|
1079
|
+
});
|
|
1080
|
+
const Jt = Ue;
|
|
1081
|
+
export {
|
|
1082
|
+
Jt as M,
|
|
1083
|
+
Gt as T,
|
|
1084
|
+
he as t
|
|
1085
|
+
};
|