orcs-design-system 3.2.44 → 3.2.45
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
2
|
import { useMaterialReactTable, MaterialReactTable } from "material-react-table";
|
|
3
|
-
import { merge } from "lodash";
|
|
3
|
+
import { merge, map } from "lodash";
|
|
4
4
|
import muiStyleOverrides from "./muiStyleOverrides";
|
|
5
5
|
import getExpandColumnConfig from "./getExpandColumnConfig";
|
|
6
6
|
import { PropTypes } from "prop-types";
|
|
@@ -8,11 +8,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
const Table = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
data,
|
|
11
|
-
columns,
|
|
11
|
+
columns: columnOverrides,
|
|
12
12
|
...tableConfig
|
|
13
13
|
} = _ref;
|
|
14
14
|
const otherConfig = {};
|
|
15
15
|
const columnVisibility = {};
|
|
16
|
+
const columns = useMemo(() => {
|
|
17
|
+
return tableConfig?.enableSorting ? columnOverrides : map(columnOverrides, col => {
|
|
18
|
+
return {
|
|
19
|
+
...col,
|
|
20
|
+
enableSorting: false
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}, [columnOverrides, tableConfig?.enableSorting]);
|
|
16
24
|
const firstCol = useMemo(() => columns[0], [columns]);
|
|
17
25
|
if (tableConfig.enableExpanding) {
|
|
18
26
|
columnVisibility[firstCol.id] = false;
|
|
@@ -26,6 +34,7 @@ const Table = _ref => {
|
|
|
26
34
|
...tableConfig,
|
|
27
35
|
columns,
|
|
28
36
|
data,
|
|
37
|
+
enableExpanding: true,
|
|
29
38
|
initialState: merge({
|
|
30
39
|
density: "compact",
|
|
31
40
|
columnVisibility
|
|
@@ -1,37 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon";
|
|
3
|
+
import Box from "../Box";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
5
|
const muiStyleOverrides = {
|
|
6
|
+
muiExpandButtonProps: _ref => {
|
|
7
|
+
let {
|
|
8
|
+
row
|
|
9
|
+
} = _ref;
|
|
10
|
+
return {
|
|
11
|
+
children: row?.getIsExpanded() ? /*#__PURE__*/_jsx(Box, {
|
|
12
|
+
p: "s",
|
|
13
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
14
|
+
icon: ["fas", "chevron-down"],
|
|
15
|
+
size: "xs"
|
|
16
|
+
})
|
|
17
|
+
}) : /*#__PURE__*/_jsx(Box, {
|
|
18
|
+
p: "s",
|
|
19
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
20
|
+
icon: ["fal", "chevron-right"],
|
|
21
|
+
size: "xs"
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
},
|
|
2
26
|
muiBottomToolbarProps: {
|
|
3
27
|
sx: {
|
|
4
|
-
|
|
28
|
+
display: "none" // Remove bottom toolbar
|
|
5
29
|
}
|
|
6
30
|
},
|
|
7
31
|
muiTableHeadProps: {
|
|
8
32
|
sx: {
|
|
9
|
-
|
|
10
|
-
|
|
33
|
+
backgroundColor: "transparent",
|
|
34
|
+
// No background for header
|
|
11
35
|
"& .MuiTableCell-root": {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
borderRadius: "5px 0px 0px 5px"
|
|
36
|
+
color: "#6b7280",
|
|
37
|
+
// Subtle text color (gray tone)
|
|
38
|
+
fontWeight: "500",
|
|
39
|
+
// Slightly bold for clarity
|
|
40
|
+
padding: "0 0 6px 0",
|
|
41
|
+
// Consistent padding
|
|
42
|
+
borderBottom: "1px solid #e0e0e0",
|
|
43
|
+
// Subtle header-row separation
|
|
44
|
+
textAlign: "left",
|
|
45
|
+
// Ensure text alignment is consistent
|
|
46
|
+
lineHeight: "1.5" // Enhance readability
|
|
24
47
|
},
|
|
25
|
-
"&
|
|
26
|
-
|
|
48
|
+
"& button": {
|
|
49
|
+
display: "none" // Explicitly hide any buttons in the header
|
|
27
50
|
}
|
|
28
51
|
}
|
|
29
52
|
},
|
|
30
|
-
muiTableBodyRowProps:
|
|
53
|
+
muiTableBodyRowProps: _ref2 => {
|
|
31
54
|
let {
|
|
32
55
|
row,
|
|
33
56
|
table
|
|
34
|
-
} =
|
|
57
|
+
} = _ref2;
|
|
35
58
|
let borderBottomStyle = "solid";
|
|
36
59
|
if (row.getIsExpanded()) {
|
|
37
60
|
borderBottomStyle = "dashed";
|
|
@@ -57,9 +80,35 @@ const muiStyleOverrides = {
|
|
|
57
80
|
sx: {
|
|
58
81
|
borderCollapse: "separate !important",
|
|
59
82
|
tableLayout: "fixed",
|
|
60
|
-
|
|
83
|
+
fontFamily: "inherit",
|
|
84
|
+
fontSize: "inherit",
|
|
85
|
+
fontWeight: "normal",
|
|
86
|
+
"& th, .MuiTableCell-root": {
|
|
87
|
+
fontWeight: "normal",
|
|
88
|
+
fontSize: "inherit",
|
|
89
|
+
fontFamily: "inherit"
|
|
90
|
+
},
|
|
91
|
+
"& td": {
|
|
92
|
+
fontFamily: "inherit",
|
|
93
|
+
fontSize: "inherit",
|
|
94
|
+
fontWeight: "normal"
|
|
95
|
+
},
|
|
61
96
|
"& td, .MuiTableCell-root": {
|
|
62
|
-
|
|
97
|
+
padding: "6px 0 6px 0",
|
|
98
|
+
marginLeft: "0"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
muiTableBodyCellProps: {
|
|
103
|
+
sx: {
|
|
104
|
+
fontWeight: "normal",
|
|
105
|
+
// Remove bold when expanded
|
|
106
|
+
// Default row cell style
|
|
107
|
+
"&.MuiTableRow-root": {
|
|
108
|
+
fontWeight: "normal" // Ensure the font is not bold by default
|
|
109
|
+
},
|
|
110
|
+
"&.expanded": {
|
|
111
|
+
fontWeight: "normal" // Remove bold when expanded
|
|
63
112
|
}
|
|
64
113
|
}
|
|
65
114
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orcs-design-system",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.45",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": "20.12.2"
|
|
6
6
|
},
|
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
},
|
|
145
145
|
"overrides": {
|
|
146
146
|
"braces": "3.0.3",
|
|
147
|
+
"cross-spawn": "7.0.6",
|
|
147
148
|
"eslint-plugin-testing-library": "^5.11.1",
|
|
148
149
|
"jest": "$jest",
|
|
149
150
|
"nth-check": "2.1.0",
|