@bento-core/table 1.0.1-ccdihub.80 → 1.0.1-ccdihub.82
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/dist/body/components/CPIModal.js +38 -15
- package/dist/body/components/CPIView.js +1 -1
- package/dist/body/components/ModalStyle.js +15 -1
- package/dist/header/CustomCell.js +4 -2
- package/dist/header/CustomTblHeader.js +4 -1
- package/package.json +1 -1
- package/src/body/components/CPIModal.js +25 -9
- package/src/body/components/CPIView.js +1 -1
- package/src/body/components/ModalStyle.js +15 -1
- package/src/header/CustomCell.js +2 -0
- package/src/header/CustomTblHeader.js +1 -0
|
@@ -13,28 +13,32 @@ var _CustomCell = _interopRequireDefault(require("../../header/CustomCell"));
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
// import CustomTableBody from '../../body/CustomTblBody';
|
|
17
|
+
|
|
18
|
+
// import TableHeader from '../../header/CustomTblHeader';
|
|
19
|
+
|
|
21
20
|
const CustomTableContainer = props => {
|
|
22
21
|
const {
|
|
23
22
|
children,
|
|
24
|
-
|
|
23
|
+
themeConfig,
|
|
24
|
+
className
|
|
25
25
|
} = props;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const tableStyle = {
|
|
27
|
+
height: '510px',
|
|
28
|
+
overflowX: 'hidden'
|
|
29
|
+
};
|
|
29
30
|
return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
|
|
30
31
|
theme: themeConfig
|
|
31
32
|
}, /*#__PURE__*/_react.default.createElement(_core.TableContainer, {
|
|
33
|
+
className: className,
|
|
32
34
|
id: "tableContainer",
|
|
33
|
-
component: _core.Paper
|
|
35
|
+
component: _core.Paper,
|
|
36
|
+
style: tableStyle
|
|
34
37
|
}, children));
|
|
35
38
|
};
|
|
36
39
|
const CPIModal = _ref => {
|
|
37
40
|
let {
|
|
41
|
+
classes,
|
|
38
42
|
open,
|
|
39
43
|
onClose,
|
|
40
44
|
row,
|
|
@@ -64,7 +68,7 @@ const CPIModal = _ref => {
|
|
|
64
68
|
position: 'absolute',
|
|
65
69
|
top: '5%',
|
|
66
70
|
left: '25%',
|
|
67
|
-
width: '
|
|
71
|
+
width: '840px',
|
|
68
72
|
height: '671px',
|
|
69
73
|
background: '#FFFFFF',
|
|
70
74
|
border: '1px solid #505050',
|
|
@@ -77,6 +81,15 @@ const CPIModal = _ref => {
|
|
|
77
81
|
alignItems: 'center',
|
|
78
82
|
height: '55px'
|
|
79
83
|
};
|
|
84
|
+
const cell = {
|
|
85
|
+
paddingLeft: '3px',
|
|
86
|
+
paddingRight: '5px'
|
|
87
|
+
};
|
|
88
|
+
const cellLast = {
|
|
89
|
+
paddingLeft: '3px',
|
|
90
|
+
paddingRight: '10px',
|
|
91
|
+
wordBreak: 'break-word'
|
|
92
|
+
};
|
|
80
93
|
const footer = {
|
|
81
94
|
display: 'flex',
|
|
82
95
|
justifyContent: 'center',
|
|
@@ -143,7 +156,7 @@ const CPIModal = _ref => {
|
|
|
143
156
|
onClose: onClose,
|
|
144
157
|
"aria-labelledby": "".concat(row.id, "-modal")
|
|
145
158
|
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
|
146
|
-
className:
|
|
159
|
+
className: classes.modalBody,
|
|
147
160
|
style: modalBody
|
|
148
161
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
149
162
|
className: "header",
|
|
@@ -163,13 +176,23 @@ const CPIModal = _ref => {
|
|
|
163
176
|
className: "container",
|
|
164
177
|
style: countContainer
|
|
165
178
|
}, "".concat(data.length, " mapped identifiers")), /*#__PURE__*/_react.default.createElement(CustomTableContainer, {
|
|
166
|
-
|
|
179
|
+
className: classes.tableContainer,
|
|
180
|
+
themeConfig: themeConfig
|
|
167
181
|
}, /*#__PURE__*/_react.default.createElement(_core.Table, null, /*#__PURE__*/_react.default.createElement(_core.TableHead, null, /*#__PURE__*/_react.default.createElement(_core.TableRow, null, displayColumns.map(column => /*#__PURE__*/_react.default.createElement(_CustomCell.default, {
|
|
168
182
|
column: column,
|
|
169
183
|
sortBy: sortBy,
|
|
170
184
|
sortOrder: sortOrder,
|
|
171
|
-
toggleSort: () => handleSortByColumn(column.dataField, sortOrder)
|
|
172
|
-
|
|
185
|
+
toggleSort: () => handleSortByColumn(column.dataField, sortOrder),
|
|
186
|
+
style: {
|
|
187
|
+
paddingLeft: '3px',
|
|
188
|
+
paddingRight: '3px',
|
|
189
|
+
fontWeight: '700'
|
|
190
|
+
}
|
|
191
|
+
})))), /*#__PURE__*/_react.default.createElement(_core.TableBody, null, data.map(currRow => /*#__PURE__*/_react.default.createElement(_core.TableRow, null, displayColumns.map(column => column.dataField !== 'data_location' ? /*#__PURE__*/_react.default.createElement(_core.TableCell, {
|
|
192
|
+
style: cell
|
|
193
|
+
}, currRow[column.dataField]) : /*#__PURE__*/_react.default.createElement(_core.TableCell, {
|
|
194
|
+
style: cellLast
|
|
195
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
173
196
|
href: currRow[column.dataField],
|
|
174
197
|
target: "_blank",
|
|
175
198
|
rel: "noopener noreferrer"
|
|
@@ -73,7 +73,7 @@ const CPIView = _ref => {
|
|
|
73
73
|
themeConfig: themeConfig
|
|
74
74
|
}), /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
|
|
75
75
|
interactive: true,
|
|
76
|
-
placement: "top
|
|
76
|
+
placement: "top",
|
|
77
77
|
arrow: true,
|
|
78
78
|
disableFocusListener: true,
|
|
79
79
|
disableTouchListener: true,
|
|
@@ -35,13 +35,27 @@ var _default = () => ({
|
|
|
35
35
|
position: 'absolute',
|
|
36
36
|
top: '5%',
|
|
37
37
|
left: '25%',
|
|
38
|
-
width: '
|
|
38
|
+
width: '840px',
|
|
39
39
|
height: '671px',
|
|
40
40
|
background: '#FFFFFF',
|
|
41
41
|
border: '1px solid #505050',
|
|
42
42
|
borderRadius: '40px',
|
|
43
43
|
overflow: 'hidden'
|
|
44
44
|
},
|
|
45
|
+
tableContainer: {
|
|
46
|
+
'&::-webkit-scrollbar': {
|
|
47
|
+
width: '6px',
|
|
48
|
+
borderWidth: '0px 1px 1px 1px',
|
|
49
|
+
borderStyle: 'solid',
|
|
50
|
+
borderColor: '#B0B0B0'
|
|
51
|
+
},
|
|
52
|
+
'&::-webkit-scrollbar-track': {
|
|
53
|
+
backgroundColor: '#CECECE'
|
|
54
|
+
},
|
|
55
|
+
'&::-webkit-scrollbar-thumb': {
|
|
56
|
+
backgroundColor: '#003F74'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
45
59
|
searchContainer: {
|
|
46
60
|
display: 'flex',
|
|
47
61
|
justifyContent: 'center',
|
|
@@ -22,7 +22,8 @@ const CustomHeaderCell = _ref => {
|
|
|
22
22
|
sortBy,
|
|
23
23
|
column,
|
|
24
24
|
components = {},
|
|
25
|
-
toggleSort
|
|
25
|
+
toggleSort,
|
|
26
|
+
style
|
|
26
27
|
} = _ref;
|
|
27
28
|
const {
|
|
28
29
|
dataField,
|
|
@@ -59,7 +60,8 @@ const CustomHeaderCell = _ref => {
|
|
|
59
60
|
return /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
60
61
|
scope: "col",
|
|
61
62
|
active: sortBy === dataField,
|
|
62
|
-
direction: sortOrder
|
|
63
|
+
direction: sortOrder,
|
|
64
|
+
style: style
|
|
63
65
|
}, /*#__PURE__*/_react.default.createElement(Tooltip, null, /*#__PURE__*/_react.default.createElement(_TableSortLabel.default, {
|
|
64
66
|
active: sortBy === dataField,
|
|
65
67
|
hideSortIcon: sortBy !== dataField,
|
|
@@ -66,7 +66,10 @@ const CustomTableHeader = _ref => {
|
|
|
66
66
|
column: column,
|
|
67
67
|
sortBy: sortBy,
|
|
68
68
|
sortOrder: sortOrder,
|
|
69
|
-
toggleSort: () => sortByColumn(column.dataField, sortOrder)
|
|
69
|
+
toggleSort: () => sortByColumn(column.dataField, sortOrder),
|
|
70
|
+
style: column.dataField === 'participant_id' ? {
|
|
71
|
+
minWidth: '230px'
|
|
72
|
+
} : {}
|
|
70
73
|
});
|
|
71
74
|
}))));
|
|
72
75
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.82",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Table,
|
|
9
9
|
TableContainer,
|
|
10
10
|
ThemeProvider,
|
|
11
|
-
createTheme,
|
|
12
11
|
TableHead,
|
|
13
12
|
TableRow,
|
|
14
13
|
TableCell,
|
|
@@ -22,11 +21,14 @@ import styles from './ModalStyle';
|
|
|
22
21
|
import HeaderCell from '../../header/CustomCell';
|
|
23
22
|
|
|
24
23
|
const CustomTableContainer = (props) => {
|
|
25
|
-
const { children,
|
|
26
|
-
const
|
|
24
|
+
const { children, themeConfig, className } = props;
|
|
25
|
+
const tableStyle = {
|
|
26
|
+
height: '510px',
|
|
27
|
+
overflowX: 'hidden',
|
|
28
|
+
};
|
|
27
29
|
return (
|
|
28
30
|
<ThemeProvider theme={themeConfig}>
|
|
29
|
-
<TableContainer id="tableContainer" component={Paper}>
|
|
31
|
+
<TableContainer className={className} id="tableContainer" component={Paper} style={tableStyle}>
|
|
30
32
|
{children}
|
|
31
33
|
</TableContainer>
|
|
32
34
|
</ThemeProvider>
|
|
@@ -34,6 +36,7 @@ const CustomTableContainer = (props) => {
|
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
const CPIModal = ({
|
|
39
|
+
classes,
|
|
37
40
|
open,
|
|
38
41
|
onClose,
|
|
39
42
|
row,
|
|
@@ -67,7 +70,7 @@ const CPIModal = ({
|
|
|
67
70
|
position: 'absolute',
|
|
68
71
|
top: '5%',
|
|
69
72
|
left: '25%',
|
|
70
|
-
width: '
|
|
73
|
+
width: '840px',
|
|
71
74
|
height: '671px',
|
|
72
75
|
background: '#FFFFFF',
|
|
73
76
|
border: '1px solid #505050',
|
|
@@ -82,6 +85,17 @@ const CPIModal = ({
|
|
|
82
85
|
height: '55px',
|
|
83
86
|
};
|
|
84
87
|
|
|
88
|
+
const cell = {
|
|
89
|
+
paddingLeft: '3px',
|
|
90
|
+
paddingRight: '5px',
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const cellLast = {
|
|
94
|
+
paddingLeft: '3px',
|
|
95
|
+
paddingRight: '10px',
|
|
96
|
+
wordBreak: 'break-word',
|
|
97
|
+
};
|
|
98
|
+
|
|
85
99
|
const footer = {
|
|
86
100
|
display: 'flex',
|
|
87
101
|
justifyContent: 'center',
|
|
@@ -161,7 +175,7 @@ const CPIModal = ({
|
|
|
161
175
|
onClose={onClose}
|
|
162
176
|
aria-labelledby={`${row.id}-modal`}
|
|
163
177
|
>
|
|
164
|
-
<Box className=
|
|
178
|
+
<Box className={classes.modalBody} style={modalBody}>
|
|
165
179
|
<div className="header" style={header}>
|
|
166
180
|
<Typography id="modal-modal-title" className="modalTitle" style={modalTitle}>
|
|
167
181
|
{`Participant ID ${participantId} : CPI Mappings`}
|
|
@@ -179,7 +193,8 @@ const CPIModal = ({
|
|
|
179
193
|
{`${data.length} mapped identifiers`}
|
|
180
194
|
</div>
|
|
181
195
|
<CustomTableContainer
|
|
182
|
-
|
|
196
|
+
className={classes.tableContainer}
|
|
197
|
+
themeConfig={themeConfig}
|
|
183
198
|
>
|
|
184
199
|
<Table>
|
|
185
200
|
<TableHead>
|
|
@@ -191,6 +206,7 @@ const CPIModal = ({
|
|
|
191
206
|
sortBy={sortBy}
|
|
192
207
|
sortOrder={sortOrder}
|
|
193
208
|
toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
|
|
209
|
+
style={{ paddingLeft: '3px', paddingRight: '3px', fontWeight: '700' }}
|
|
194
210
|
/>
|
|
195
211
|
))
|
|
196
212
|
}
|
|
@@ -204,8 +220,8 @@ const CPIModal = ({
|
|
|
204
220
|
displayColumns.map((column) => (
|
|
205
221
|
(
|
|
206
222
|
column.dataField !== 'data_location'
|
|
207
|
-
? <TableCell>{currRow[column.dataField]}</TableCell>
|
|
208
|
-
: <TableCell><a href={currRow[column.dataField]} target="_blank" rel="noopener noreferrer">{currRow[column.dataField]}</a></TableCell>
|
|
223
|
+
? <TableCell style={cell}>{currRow[column.dataField]}</TableCell>
|
|
224
|
+
: <TableCell style={cellLast}><a href={currRow[column.dataField]} target="_blank" rel="noopener noreferrer">{currRow[column.dataField]}</a></TableCell>
|
|
209
225
|
)
|
|
210
226
|
))
|
|
211
227
|
}
|
|
@@ -29,13 +29,27 @@ export default () => ({
|
|
|
29
29
|
position: 'absolute',
|
|
30
30
|
top: '5%',
|
|
31
31
|
left: '25%',
|
|
32
|
-
width: '
|
|
32
|
+
width: '840px',
|
|
33
33
|
height: '671px',
|
|
34
34
|
background: '#FFFFFF',
|
|
35
35
|
border: '1px solid #505050',
|
|
36
36
|
borderRadius: '40px',
|
|
37
37
|
overflow: 'hidden',
|
|
38
38
|
},
|
|
39
|
+
tableContainer: {
|
|
40
|
+
'&::-webkit-scrollbar': {
|
|
41
|
+
width: '6px',
|
|
42
|
+
borderWidth: '0px 1px 1px 1px',
|
|
43
|
+
borderStyle: 'solid',
|
|
44
|
+
borderColor: '#B0B0B0',
|
|
45
|
+
},
|
|
46
|
+
'&::-webkit-scrollbar-track': {
|
|
47
|
+
backgroundColor: '#CECECE',
|
|
48
|
+
},
|
|
49
|
+
'&::-webkit-scrollbar-thumb': {
|
|
50
|
+
backgroundColor: '#003F74',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
39
53
|
searchContainer: {
|
|
40
54
|
display: 'flex',
|
|
41
55
|
justifyContent: 'center',
|
package/src/header/CustomCell.js
CHANGED
|
@@ -14,6 +14,7 @@ const CustomHeaderCell = ({
|
|
|
14
14
|
column,
|
|
15
15
|
components = {},
|
|
16
16
|
toggleSort,
|
|
17
|
+
style,
|
|
17
18
|
}) => {
|
|
18
19
|
const {
|
|
19
20
|
dataField,
|
|
@@ -61,6 +62,7 @@ const CustomHeaderCell = ({
|
|
|
61
62
|
scope="col"
|
|
62
63
|
active={sortBy === dataField}
|
|
63
64
|
direction={sortOrder}
|
|
65
|
+
style={style}
|
|
64
66
|
>
|
|
65
67
|
<Tooltip>
|
|
66
68
|
<TableSortLabel
|