cloudmr-ux 3.0.5 → 3.0.7
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.
|
@@ -8,6 +8,9 @@ export interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
showCheckbox?: boolean;
|
|
11
|
+
headerBgColor?: string;
|
|
12
|
+
headerTextColor?: string;
|
|
13
|
+
headerIconColor?: string;
|
|
11
14
|
}
|
|
12
15
|
declare const CmrTable: React.FC<CmrTableProps>;
|
|
13
16
|
export default CmrTable;
|
|
@@ -24,7 +24,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
24
24
|
import './CmrTable.css';
|
|
25
25
|
import { DataGrid } from '@mui/x-data-grid';
|
|
26
26
|
var CmrTable = function (props) {
|
|
27
|
-
var dataSource = props.dataSource, columns = props.columns, idAlias = props.idAlias, className = props.className, onRowSelectionModelChange = props.onRowSelectionModelChange, style = props.style, _a = props.showCheckbox, showCheckbox = _a === void 0 ? true : _a, rest = __rest(props, ["dataSource", "columns", "idAlias", "className", "onRowSelectionModelChange", "style", "showCheckbox"]);
|
|
27
|
+
var dataSource = props.dataSource, columns = props.columns, idAlias = props.idAlias, className = props.className, onRowSelectionModelChange = props.onRowSelectionModelChange, style = props.style, _a = props.showCheckbox, showCheckbox = _a === void 0 ? true : _a, _b = props.headerBgColor, headerBgColor = _b === void 0 ? '#F3E5F5' : _b, _c = props.headerTextColor, headerTextColor = _c === void 0 ? '#333' : _c, _d = props.headerIconColor, headerIconColor = _d === void 0 ? '#580f8b' : _d, rest = __rest(props, ["dataSource", "columns", "idAlias", "className", "onRowSelectionModelChange", "style", "showCheckbox", "headerBgColor", "headerTextColor", "headerIconColor"]);
|
|
28
28
|
return (_jsx("div", __assign({ style: style !== null && style !== void 0 ? style : { height: '400px', width: '100%' }, className: className !== null && className !== void 0 ? className : '' }, { children: _jsx(DataGrid, __assign({ rows: dataSource
|
|
29
29
|
? dataSource.map(function (row) { return (__assign({ id: idAlias ? row[idAlias] : row['id'] }, row)); })
|
|
30
30
|
: [], columns: columns, checkboxSelection: showCheckbox, onRowSelectionModelChange: onRowSelectionModelChange, initialState: {
|
|
@@ -33,11 +33,23 @@ var CmrTable = function (props) {
|
|
|
33
33
|
}
|
|
34
34
|
}, sx: {
|
|
35
35
|
'& .MuiDataGrid-columnHeaders': {
|
|
36
|
-
backgroundColor:
|
|
37
|
-
color:
|
|
36
|
+
backgroundColor: headerBgColor,
|
|
37
|
+
color: headerTextColor
|
|
38
38
|
},
|
|
39
|
-
'& .MuiDataGrid-columnHeaders .MuiSvgIcon-root': {
|
|
40
|
-
|
|
39
|
+
// '& .MuiDataGrid-columnHeaders .MuiSvgIcon-root': {
|
|
40
|
+
// color: headerIconColor,
|
|
41
|
+
// },
|
|
42
|
+
'&& .MuiDataGrid-columnHeader .MuiSvgIcon-root': {
|
|
43
|
+
color: "".concat(headerIconColor, " !important")
|
|
44
|
+
},
|
|
45
|
+
'&& .MuiDataGrid-columnHeader .MuiDataGrid-sortIcon': {
|
|
46
|
+
color: "".concat(headerIconColor, " !important")
|
|
47
|
+
},
|
|
48
|
+
'&& .MuiDataGrid-columnHeader .MuiDataGrid-menuIconButton .MuiSvgIcon-root': {
|
|
49
|
+
color: "".concat(headerIconColor, " !important")
|
|
50
|
+
},
|
|
51
|
+
'&& .MuiDataGrid-columnHeader .MuiDataGrid-iconButtonContainer .MuiSvgIcon-root': {
|
|
52
|
+
color: "".concat(headerIconColor, " !important")
|
|
41
53
|
},
|
|
42
54
|
'& .MuiDataGrid-columnHeaderTitle': {
|
|
43
55
|
fontWeight: 'bold'
|