cloudmr-ux 3.0.7 → 3.0.9
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.
|
@@ -7,6 +7,7 @@ interface CmrPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
onToggle?: (key: number | undefined) => void;
|
|
8
8
|
expanded?: boolean;
|
|
9
9
|
cardProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
10
|
+
headerFontWeight?: "normal" | "bold";
|
|
10
11
|
}
|
|
11
12
|
declare const CmrPanel: (props: CmrPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export default CmrPanel;
|
|
@@ -13,7 +13,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp";
|
|
14
14
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
|
15
15
|
var CmrPanel = function (props) {
|
|
16
|
-
var _a, _b;
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
var headerFontWeight = (_a = props.headerFontWeight) !== null && _a !== void 0 ? _a : "normal";
|
|
17
18
|
var expanded = props.expanded, onToggle = props.onToggle;
|
|
18
19
|
var toggle = function () {
|
|
19
20
|
if (onToggle)
|
|
@@ -22,16 +23,16 @@ var CmrPanel = function (props) {
|
|
|
22
23
|
return (_jsxs("div", __assign({ className: "card ".concat(props.className) }, { children: [_jsx("div", __assign({ className: "card-header", style: {
|
|
23
24
|
background: "white",
|
|
24
25
|
display: props.header == undefined ? "none" : undefined
|
|
25
|
-
} }, { children: _jsxs("div", __assign({ className: "row align-items-center" }, { children: [_jsx("div", __assign({ className: "col" }, { children: props.header })), onToggle && (_jsx("div", __assign({ className: "col text-end" }, { children: _jsx("span", __assign({ className: "react-collapse float-end btn", onClick: function (e) {
|
|
26
|
+
} }, { children: _jsxs("div", __assign({ className: "row align-items-center" }, { children: [_jsx("div", __assign({ className: "col", style: { fontWeight: headerFontWeight } }, { children: props.header })), onToggle && (_jsx("div", __assign({ className: "col text-end" }, { children: _jsx("span", __assign({ className: "react-collapse float-end btn", onClick: function (e) {
|
|
26
27
|
toggle();
|
|
27
|
-
} }, { children: !expanded ? (_jsx(ArrowDropDownIcon, {})) : (_jsx(ArrowDropUpIcon, {})) })) })))] })) })), !expanded ? (_jsx("div", __assign({ className: "card-body m-0 ".concat(((
|
|
28
|
+
} }, { children: !expanded ? (_jsx(ArrowDropDownIcon, {})) : (_jsx(ArrowDropUpIcon, {})) })) })))] })) })), !expanded ? (_jsx("div", __assign({ className: "card-body m-0 ".concat(((_b = props.cardProps) === null || _b === void 0 ? void 0 : _b.className) || ""), style: {
|
|
28
29
|
maxHeight: "0",
|
|
29
30
|
padding: 0,
|
|
30
31
|
opacity: "0",
|
|
31
32
|
overflow: "hidden",
|
|
32
33
|
visibility: "collapse",
|
|
33
34
|
transition: "all 0.5s"
|
|
34
|
-
} }, { children: props.children }))) : (_jsx("div", __assign({ className: "card-body m-4 ".concat(((
|
|
35
|
+
} }, { children: props.children }))) : (_jsx("div", __assign({ className: "card-body m-4 ".concat(((_c = props.cardProps) === null || _c === void 0 ? void 0 : _c.className) || ""), style: {
|
|
35
36
|
maxHeight: undefined,
|
|
36
37
|
padding: 0,
|
|
37
38
|
opacity: "1",
|
|
@@ -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
|