cloudmr-ux 3.0.7 → 3.0.8
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.
|
@@ -2,6 +2,8 @@ import { TabInfo } from "./tab.model";
|
|
|
2
2
|
interface CmrTabsProps {
|
|
3
3
|
tabList: TabInfo[];
|
|
4
4
|
onTabSelected?: (tabId: number) => void;
|
|
5
|
+
tabIndicatorColor?: string;
|
|
6
|
+
tabSelectedTextColor?: string;
|
|
5
7
|
}
|
|
6
8
|
export default function CmrTabs(props: CmrTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
package/dist/CmrTabs/CmrTabs.js
CHANGED
|
@@ -38,7 +38,10 @@ function a11yProps(index) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
export default function CmrTabs(props) {
|
|
41
|
-
var _a
|
|
41
|
+
var _a, _b;
|
|
42
|
+
var _c = React.useState(0), value = _c[0], setValue = _c[1];
|
|
43
|
+
var tabIndicatorColor = (_a = props.tabIndicatorColor) !== null && _a !== void 0 ? _a : "#580F8B";
|
|
44
|
+
var tabSelectedTextColor = (_b = props.tabSelectedTextColor) !== null && _b !== void 0 ? _b : "#580F8B";
|
|
42
45
|
var handleChange = function (event, newValue) {
|
|
43
46
|
setValue(newValue);
|
|
44
47
|
if (props.onTabSelected)
|
|
@@ -52,10 +55,10 @@ export default function CmrTabs(props) {
|
|
|
52
55
|
mt: 4
|
|
53
56
|
} }, { children: [_jsx(Box, __assign({ sx: { borderBottom: 1, borderColor: 'divider', mb: 4 } }, { children: _jsx(Tabs, __assign({ value: value, onChange: handleChange, "aria-label": "basic tabs example", textColor: 'inherit', TabIndicatorProps: {
|
|
54
57
|
style: {
|
|
55
|
-
backgroundColor:
|
|
58
|
+
backgroundColor: tabIndicatorColor
|
|
56
59
|
}
|
|
57
60
|
} }, { children: props.tabList.map(function (tab, index) {
|
|
58
|
-
return _jsx(Tab, __assign({ sx: { color: (value == index) ?
|
|
61
|
+
return _jsx(Tab, __assign({ sx: { color: (value == index) ? tabSelectedTextColor : undefined }, style: { fontSize: '14px', textTransform: 'uppercase', fontWeight: 400 }, label: tab.text }, a11yProps(index)), index);
|
|
59
62
|
}) })) })), props.tabList.map(function (tab, index) {
|
|
60
63
|
return _jsx(CustomTabPanel, __assign({ value: value, index: index }, { children: cloneElement(tab.children, {
|
|
61
64
|
visible: value == index
|