@bento-core/table 1.0.0-c3dc.27 → 1.0.0-c3dc.28
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/assets/cpi_icon.svg +22 -0
- package/dist/body/CustomTblBody.js +9 -4
- package/dist/body/DisplayBodyCell.js +13 -3
- package/dist/body/components/CPIModal.js +210 -0
- package/dist/body/components/CPIView.js +115 -0
- package/dist/body/components/ModalStyle.js +121 -0
- package/dist/header/CustomCell.js +4 -2
- package/dist/util/Types.js +5 -2
- package/package.json +1 -1
- package/src/assets/cpi_icon.svg +22 -0
- package/src/body/CustomTblBody.js +6 -1
- package/src/body/DisplayBodyCell.js +12 -0
- package/src/body/components/CPIModal.js +243 -0
- package/src/body/components/CPIView.js +133 -0
- package/src/body/components/ModalStyle.js +115 -0
- package/src/header/CustomCell.js +2 -0
- package/src/util/Types.js +2 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_12066_12050)">
|
|
3
|
+
<path d="M19.0973 13.2173C16.943 13.2173 15.1948 14.9585 15.1948 17.1042C15.1948 19.2499 16.943 20.9912 19.0973 20.9912C21.2516 20.9912 22.9998 19.2499 22.9998 17.1042C22.9998 14.9585 21.2516 13.2173 19.0973 13.2173Z" fill="#006A8F"/>
|
|
4
|
+
<path d="M19.389 18.8806L21.5609 16.4447C21.7905 16.1897 21.6051 15.7939 21.2696 15.7939H16.9256C16.5813 15.7939 16.4047 16.1985 16.6343 16.4447L18.8062 18.8806C18.9652 19.0565 19.2389 19.0565 19.3978 18.8806H19.389Z" fill="white"/>
|
|
5
|
+
<g clip-path="url(#clip1_12066_12050)">
|
|
6
|
+
<path d="M5.995 10.579C6.49826 10.579 6.96621 10.4734 7.4165 10.3239C6.15393 9.06641 5.36813 7.31641 5.36813 5.39933C5.36813 4.19455 5.67715 3.06013 6.21573 2.07521C6.1451 2.07521 6.07446 2.05762 6.00383 2.05762C3.63761 2.05762 1.72168 3.96591 1.72168 6.32269C1.72168 8.67948 3.63761 10.5878 6.00383 10.5878L5.995 10.579Z" fill="#006A8F"/>
|
|
7
|
+
<path d="M16.1916 9.19803C18.3053 7.09283 18.3053 3.67963 16.1916 1.57443C14.078 -0.530773 10.6511 -0.530773 8.53751 1.57443C6.42388 3.67963 6.42388 7.09283 8.53751 9.19803C10.6511 11.3032 14.078 11.3032 16.1916 9.19803Z" fill="#006A8F"/>
|
|
8
|
+
<path d="M13.6409 17.1395C13.6409 14.6948 15.3272 12.6458 17.5963 12.0742C17.1637 11.7312 16.6869 11.4498 16.166 11.2388C15.0712 11.9511 13.7645 12.3732 12.3518 12.3732C10.9391 12.3732 9.64124 11.9511 8.5376 11.2388C6.3303 12.1445 4.77637 14.2991 4.77637 16.8229V17.6848C4.77637 18.3267 5.22666 18.8807 5.86236 19.0038C7.67234 19.3468 9.86197 19.6194 12.3518 19.6194C13.0052 19.6194 13.6232 19.593 14.2324 19.5579C13.8528 18.8368 13.6409 18.0189 13.6409 17.1483V17.1395Z" fill="#006A8F"/>
|
|
9
|
+
<path d="M2.63109 11.0981C1.07716 11.8896 0 13.4901 0 15.3544V16.0404C0 16.5504 0.361996 16.9901 0.85643 17.0868C1.56276 17.2187 2.34856 17.3419 3.19616 17.4298V16.823C3.19616 15.0378 3.83186 13.3758 4.90019 12.0567C4.07025 11.8984 3.29328 11.573 2.62227 11.1069L2.63109 11.0981Z" fill="#006A8F"/>
|
|
10
|
+
<path d="M15.1948 17.1043C15.1948 19.25 16.943 20.9912 19.0973 20.9912C21.2516 20.9912 22.9998 19.25 22.9998 17.1043C22.9998 14.9585 21.2516 13.2173 19.0973 13.2173C16.943 13.2173 15.1948 14.9585 15.1948 17.1043Z" fill="#006A8F"/>
|
|
11
|
+
<path d="M20.8808 16.8143L18.4351 14.651C18.1791 14.4224 17.7817 14.607 17.7817 14.9412L17.7817 19.2678C17.7817 19.6108 18.1879 19.7867 18.4351 19.558L20.8808 17.3947C21.0574 17.2364 21.0574 16.9638 20.8808 16.8055L20.8808 16.8143Z" fill="white"/>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
<defs>
|
|
15
|
+
<clipPath id="clip0_12066_12050">
|
|
16
|
+
<rect width="23" height="21" fill="white"/>
|
|
17
|
+
</clipPath>
|
|
18
|
+
<clipPath id="clip1_12066_12050">
|
|
19
|
+
<rect width="23" height="21" fill="white"/>
|
|
20
|
+
</clipPath>
|
|
21
|
+
</defs>
|
|
22
|
+
</svg>
|
|
@@ -32,9 +32,13 @@ const CustomTableBody = _ref => {
|
|
|
32
32
|
columns
|
|
33
33
|
} = table;
|
|
34
34
|
const displayColunms = columns.filter(col => col.display);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const MuiTableRow = _objectSpread(_objectSpread({}, (0, _DefaultThemConfig.default)().MuiTableRow), customTheme.MuiTableRow);
|
|
36
|
+
const updatedTheme = {
|
|
37
|
+
overrides: _objectSpread(_objectSpread(_objectSpread({}, (0, _DefaultThemConfig.default)()), customTheme), {}, {
|
|
38
|
+
MuiTableRow
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
const themeConfig = (0, _core.createTheme)(updatedTheme);
|
|
38
42
|
return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
|
|
39
43
|
theme: themeConfig
|
|
40
44
|
}, /*#__PURE__*/_react.default.createElement(_core.TableBody, null, rows.map(row => /*#__PURE__*/_react.default.createElement(_core.TableRow, null, displayColunms.map(column => {
|
|
@@ -51,7 +55,8 @@ const CustomTableBody = _ref => {
|
|
|
51
55
|
}
|
|
52
56
|
return /*#__PURE__*/_react.default.createElement(_DisplayBodyCell.default, {
|
|
53
57
|
column: column,
|
|
54
|
-
row: row
|
|
58
|
+
row: row,
|
|
59
|
+
themeConfig: themeConfig
|
|
55
60
|
});
|
|
56
61
|
})))));
|
|
57
62
|
};
|
|
@@ -9,6 +9,7 @@ var _core = require("@material-ui/core");
|
|
|
9
9
|
var _Types = require("../util/Types");
|
|
10
10
|
var _CustomLinkView = _interopRequireDefault(require("./components/CustomLinkView"));
|
|
11
11
|
var _DataFormatView = _interopRequireDefault(require("./components/DataFormatView"));
|
|
12
|
+
var _CPIView = _interopRequireDefault(require("./components/CPIView"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -39,7 +40,8 @@ const CustomComponent = _ref => {
|
|
|
39
40
|
const ViewCell = _ref2 => {
|
|
40
41
|
let {
|
|
41
42
|
column,
|
|
42
|
-
row
|
|
43
|
+
row,
|
|
44
|
+
themeConfig
|
|
43
45
|
} = _ref2;
|
|
44
46
|
const {
|
|
45
47
|
cellType
|
|
@@ -65,6 +67,12 @@ const ViewCell = _ref2 => {
|
|
|
65
67
|
});
|
|
66
68
|
case _Types.cellTypes.COMMA:
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_core.Typography, null, isNumeric(row[column.dataField]) ? Number(row[column.dataField]).toLocaleString() : row[column.dataField]);
|
|
70
|
+
case _Types.cellTypes.CPI:
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_CPIView.default, {
|
|
72
|
+
row: row,
|
|
73
|
+
column: column,
|
|
74
|
+
themeConfig: themeConfig
|
|
75
|
+
});
|
|
68
76
|
default:
|
|
69
77
|
return /*#__PURE__*/_react.default.createElement(_core.Typography, null, row[column.dataField]);
|
|
70
78
|
}
|
|
@@ -72,13 +80,15 @@ const ViewCell = _ref2 => {
|
|
|
72
80
|
const DisplayCell = _ref3 => {
|
|
73
81
|
let {
|
|
74
82
|
row,
|
|
75
|
-
column
|
|
83
|
+
column,
|
|
84
|
+
themeConfig
|
|
76
85
|
} = _ref3;
|
|
77
86
|
return /*#__PURE__*/_react.default.createElement(_core.TableCell, {
|
|
78
87
|
className: column.dataField
|
|
79
88
|
}, /*#__PURE__*/_react.default.createElement(ViewCell, {
|
|
80
89
|
row: row,
|
|
81
|
-
column: column
|
|
90
|
+
column: column,
|
|
91
|
+
themeConfig: themeConfig
|
|
82
92
|
}));
|
|
83
93
|
};
|
|
84
94
|
var _default = DisplayCell;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _core = require("@material-ui/core");
|
|
9
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
10
|
+
var _styles = require("@material-ui/core/styles");
|
|
11
|
+
var _ModalStyle = _interopRequireDefault(require("./ModalStyle"));
|
|
12
|
+
var _CustomCell = _interopRequireDefault(require("../../header/CustomCell"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
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
|
+
// import CustomTableBody from '../../body/CustomTblBody';
|
|
17
|
+
|
|
18
|
+
// import TableHeader from '../../header/CustomTblHeader';
|
|
19
|
+
|
|
20
|
+
const CustomTableContainer = props => {
|
|
21
|
+
const {
|
|
22
|
+
children,
|
|
23
|
+
themeConfig,
|
|
24
|
+
className
|
|
25
|
+
} = props;
|
|
26
|
+
const tableStyle = {
|
|
27
|
+
height: '510px',
|
|
28
|
+
overflowX: 'hidden'
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
|
|
31
|
+
theme: themeConfig
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement(_core.TableContainer, {
|
|
33
|
+
className: className,
|
|
34
|
+
id: "tableContainer",
|
|
35
|
+
component: _core.Paper,
|
|
36
|
+
style: tableStyle
|
|
37
|
+
}, children));
|
|
38
|
+
};
|
|
39
|
+
const CPIModal = _ref => {
|
|
40
|
+
let {
|
|
41
|
+
classes,
|
|
42
|
+
open,
|
|
43
|
+
onClose,
|
|
44
|
+
row,
|
|
45
|
+
themeConfig
|
|
46
|
+
} = _ref;
|
|
47
|
+
const [sortBy, setSortBy] = (0, _react.useState)('associated_id');
|
|
48
|
+
const [sortOrder, setSortOrder] = (0, _react.useState)('asc');
|
|
49
|
+
const [data, setData] = (0, _react.useState)(() => {
|
|
50
|
+
const result = row.cpi_data;
|
|
51
|
+
return result;
|
|
52
|
+
});
|
|
53
|
+
const sortingData = (column, newOrder) => {
|
|
54
|
+
const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
|
|
55
|
+
if (newOrder === 'desc') {
|
|
56
|
+
return sortedData.reverse();
|
|
57
|
+
}
|
|
58
|
+
return sortedData;
|
|
59
|
+
};
|
|
60
|
+
const handleSortByColumn = (column, order) => {
|
|
61
|
+
const newOrder = order === 'asc' && sortBy === column ? 'desc' : 'asc';
|
|
62
|
+
const newData = sortingData(column, newOrder);
|
|
63
|
+
setData(newData);
|
|
64
|
+
setSortBy(column);
|
|
65
|
+
setSortOrder(newOrder);
|
|
66
|
+
};
|
|
67
|
+
const modalBody = {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
top: '5%',
|
|
70
|
+
left: '25%',
|
|
71
|
+
width: '840px',
|
|
72
|
+
height: '671px',
|
|
73
|
+
background: '#FFFFFF',
|
|
74
|
+
border: '1px solid #505050',
|
|
75
|
+
borderRadius: '40px',
|
|
76
|
+
overflow: 'hidden'
|
|
77
|
+
};
|
|
78
|
+
const header = {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
height: '55px'
|
|
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
|
+
};
|
|
93
|
+
const footer = {
|
|
94
|
+
display: 'flex',
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
height: '55px',
|
|
98
|
+
color: '#7D267E',
|
|
99
|
+
fontFamily: 'Nunito',
|
|
100
|
+
fontSize: '16px',
|
|
101
|
+
fontWeight: '400'
|
|
102
|
+
};
|
|
103
|
+
const link = {
|
|
104
|
+
color: '#7D267E',
|
|
105
|
+
fontFamily: 'Nunito',
|
|
106
|
+
fontSize: '16px',
|
|
107
|
+
fontWeight: '700'
|
|
108
|
+
};
|
|
109
|
+
const modalTitle = {
|
|
110
|
+
fontFamily: 'Poppins',
|
|
111
|
+
fontSize: '19px',
|
|
112
|
+
fontWeight: '400',
|
|
113
|
+
lineHeight: '21px',
|
|
114
|
+
letterSpacing: '0.02em',
|
|
115
|
+
textAlign: 'center',
|
|
116
|
+
color: '#000000'
|
|
117
|
+
};
|
|
118
|
+
const closeButton = {
|
|
119
|
+
marginLeft: '769px',
|
|
120
|
+
position: 'absolute',
|
|
121
|
+
backgroundColor: 'transparent'
|
|
122
|
+
};
|
|
123
|
+
const countContainer = {
|
|
124
|
+
display: 'flex',
|
|
125
|
+
justifyContent: 'left',
|
|
126
|
+
alignItems: 'center',
|
|
127
|
+
borderTop: '3px solid #939393',
|
|
128
|
+
borderBottom: '3px solid #939393',
|
|
129
|
+
height: '51px',
|
|
130
|
+
paddingLeft: '16px'
|
|
131
|
+
};
|
|
132
|
+
const participantId = row.participant_id;
|
|
133
|
+
const displayColumns = [{
|
|
134
|
+
dataField: 'associated_id',
|
|
135
|
+
header: 'Participant ID',
|
|
136
|
+
tooltipText: 'sort'
|
|
137
|
+
}, {
|
|
138
|
+
dataField: 'repository_of_synonym_id',
|
|
139
|
+
header: 'Name',
|
|
140
|
+
tooltipText: 'sort'
|
|
141
|
+
}, {
|
|
142
|
+
dataField: 'domain_description',
|
|
143
|
+
header: 'Description',
|
|
144
|
+
tooltipText: 'sort'
|
|
145
|
+
}, {
|
|
146
|
+
dataField: 'domain_category',
|
|
147
|
+
header: 'Category',
|
|
148
|
+
tooltipText: 'sort'
|
|
149
|
+
}, {
|
|
150
|
+
dataField: 'data_location',
|
|
151
|
+
header: 'Location',
|
|
152
|
+
tooltipText: 'sort'
|
|
153
|
+
}];
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement(_core.Modal, {
|
|
155
|
+
open: open,
|
|
156
|
+
onClose: onClose,
|
|
157
|
+
"aria-labelledby": "".concat(row.id, "-modal")
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
|
159
|
+
className: classes.modalBody,
|
|
160
|
+
style: modalBody
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
+
className: "header",
|
|
163
|
+
style: header
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Typography, {
|
|
165
|
+
id: "modal-modal-title",
|
|
166
|
+
className: "modalTitle",
|
|
167
|
+
style: modalTitle
|
|
168
|
+
}, "Participant ID ".concat(participantId, " : CPI Mappings")), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
169
|
+
"aria-label": "close",
|
|
170
|
+
onClick: onClose,
|
|
171
|
+
className: "closeButton",
|
|
172
|
+
style: closeButton
|
|
173
|
+
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
174
|
+
fontSize: "small"
|
|
175
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
176
|
+
className: "container",
|
|
177
|
+
style: countContainer
|
|
178
|
+
}, "".concat(data.length, " mapped identifiers")), /*#__PURE__*/_react.default.createElement(CustomTableContainer, {
|
|
179
|
+
className: classes.tableContainer,
|
|
180
|
+
themeConfig: themeConfig
|
|
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, {
|
|
182
|
+
column: column,
|
|
183
|
+
sortBy: sortBy,
|
|
184
|
+
sortOrder: sortOrder,
|
|
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", {
|
|
196
|
+
href: currRow[column.dataField],
|
|
197
|
+
target: "_blank",
|
|
198
|
+
rel: "noopener noreferrer"
|
|
199
|
+
}, currRow[column.dataField])))))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
+
className: "footer",
|
|
201
|
+
style: footer
|
|
202
|
+
}, "To learn more about CPI click\xA0", /*#__PURE__*/_react.default.createElement("a", {
|
|
203
|
+
style: link,
|
|
204
|
+
href: "https://participantindex-docs.ccdi.cancer.gov/",
|
|
205
|
+
target: "_blank",
|
|
206
|
+
rel: "noopener noreferrer"
|
|
207
|
+
}, "here"))));
|
|
208
|
+
};
|
|
209
|
+
var _default = (0, _styles.withStyles)(_ModalStyle.default)(CPIModal);
|
|
210
|
+
exports.default = _default;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _core = require("@material-ui/core");
|
|
9
|
+
var _Types = require("../../util/Types");
|
|
10
|
+
var _cpi_icon = _interopRequireDefault(require("../../assets/cpi_icon.svg"));
|
|
11
|
+
var _CPIModal = _interopRequireDefault(require("./CPIModal"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
/**
|
|
16
|
+
* Custom Link component
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const CPIView = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
column,
|
|
22
|
+
row,
|
|
23
|
+
themeConfig
|
|
24
|
+
} = _ref;
|
|
25
|
+
const useStyles = (0, _core.makeStyles)(() => ({
|
|
26
|
+
arrow: {
|
|
27
|
+
'&:before': {
|
|
28
|
+
border: '1px solid black'
|
|
29
|
+
},
|
|
30
|
+
color: 'white'
|
|
31
|
+
},
|
|
32
|
+
tooltip: {
|
|
33
|
+
backgroundColor: 'white',
|
|
34
|
+
border: '1px solid black',
|
|
35
|
+
color: 'black',
|
|
36
|
+
font: 'Poppins',
|
|
37
|
+
fontWeight: 400,
|
|
38
|
+
fontSize: '13px',
|
|
39
|
+
lineHeight: '17.5px'
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
const classes = useStyles();
|
|
43
|
+
const [modalOpen, setModalOpen] = (0, _react.useState)(false);
|
|
44
|
+
const cpiData = row.cpi_data;
|
|
45
|
+
const internalData = cpiData.filter(e => e.data_type === 'internal');
|
|
46
|
+
const externalData = cpiData.filter(e => e.data_type === 'external');
|
|
47
|
+
const handleModalOpen = () => {
|
|
48
|
+
setModalOpen(true);
|
|
49
|
+
};
|
|
50
|
+
const handleModalClose = () => {
|
|
51
|
+
setModalOpen(false);
|
|
52
|
+
};
|
|
53
|
+
const button = {
|
|
54
|
+
color: '#07679C',
|
|
55
|
+
textDecoration: 'underline',
|
|
56
|
+
fontWeight: 700,
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
padding: 0,
|
|
59
|
+
marginLeft: '3px'
|
|
60
|
+
};
|
|
61
|
+
const icon = {
|
|
62
|
+
marginLeft: '10px',
|
|
63
|
+
position: 'relative',
|
|
64
|
+
top: '5px',
|
|
65
|
+
cursor: 'pointer'
|
|
66
|
+
};
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_core.Typography, {
|
|
68
|
+
className: _Types.cellTypes.CPI
|
|
69
|
+
}, row[column === null || column === void 0 ? void 0 : column.dataField], cpiData.length ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CPIModal.default, {
|
|
70
|
+
row: row,
|
|
71
|
+
open: modalOpen,
|
|
72
|
+
onClose: handleModalClose,
|
|
73
|
+
themeConfig: themeConfig
|
|
74
|
+
}), /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
|
|
75
|
+
interactive: true,
|
|
76
|
+
placement: "top",
|
|
77
|
+
arrow: true,
|
|
78
|
+
disableFocusListener: true,
|
|
79
|
+
disableTouchListener: true,
|
|
80
|
+
style: {
|
|
81
|
+
pointerEvents: 'auto',
|
|
82
|
+
backgroundColor: 'transparent',
|
|
83
|
+
font: 'Poppins',
|
|
84
|
+
fontSize: '13px'
|
|
85
|
+
},
|
|
86
|
+
classes: {
|
|
87
|
+
arrow: classes.arrow,
|
|
88
|
+
tooltip: classes.tooltip
|
|
89
|
+
},
|
|
90
|
+
title: externalData.length && internalData.length === 0 ? /*#__PURE__*/_react.default.createElement("div", null, "All mapped identifiers in the CCDI Participant Index (CPI) are available", /*#__PURE__*/_react.default.createElement("span", {
|
|
91
|
+
role: "button",
|
|
92
|
+
onClick: handleModalOpen,
|
|
93
|
+
tabIndex: 0,
|
|
94
|
+
style: button
|
|
95
|
+
}, "here.")) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
style: {
|
|
97
|
+
marginBottom: '3px'
|
|
98
|
+
}
|
|
99
|
+
}, "Identifier mapped in CCDI Hub:"), internalData.map(e => /*#__PURE__*/_react.default.createElement("div", null, "".concat(e.associated_id, ", ").concat(e.repository_of_synonym_id))), /*#__PURE__*/_react.default.createElement("p", null, "All mapped identifiers in the CCDI Participant Index (CPI) are available", /*#__PURE__*/_react.default.createElement("span", {
|
|
100
|
+
role: "button",
|
|
101
|
+
onClick: handleModalOpen,
|
|
102
|
+
tabIndex: 0,
|
|
103
|
+
style: button
|
|
104
|
+
}, "here.")))
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
106
|
+
style: icon
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
108
|
+
src: _cpi_icon.default,
|
|
109
|
+
height: 21,
|
|
110
|
+
width: 23,
|
|
111
|
+
alt: "cpi-icon"
|
|
112
|
+
})))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null));
|
|
113
|
+
};
|
|
114
|
+
var _default = CPIView;
|
|
115
|
+
exports.default = _default;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = () => ({
|
|
8
|
+
header: {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
height: '55px'
|
|
13
|
+
},
|
|
14
|
+
closeButton: {
|
|
15
|
+
marginLeft: '769px',
|
|
16
|
+
position: 'absolute'
|
|
17
|
+
},
|
|
18
|
+
resetIcon: {
|
|
19
|
+
marginLeft: '10px',
|
|
20
|
+
minWidth: '5px',
|
|
21
|
+
width: '5px',
|
|
22
|
+
borderRadius: '9px',
|
|
23
|
+
height: '30px'
|
|
24
|
+
},
|
|
25
|
+
modalTitle: {
|
|
26
|
+
fontFamily: 'Poppins',
|
|
27
|
+
fontSize: '19px',
|
|
28
|
+
fontWeight: '400',
|
|
29
|
+
lineHeight: '21px',
|
|
30
|
+
letterSpacing: '0.02em',
|
|
31
|
+
textAlign: 'center',
|
|
32
|
+
color: '#000000'
|
|
33
|
+
},
|
|
34
|
+
modalBody: {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
top: '5%',
|
|
37
|
+
left: '25%',
|
|
38
|
+
width: '840px',
|
|
39
|
+
height: '671px',
|
|
40
|
+
background: '#FFFFFF',
|
|
41
|
+
border: '1px solid #505050',
|
|
42
|
+
borderRadius: '40px',
|
|
43
|
+
overflow: 'hidden'
|
|
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
|
+
},
|
|
59
|
+
searchContainer: {
|
|
60
|
+
display: 'flex',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
borderTop: '3px solid #939393',
|
|
64
|
+
borderBottom: '3px solid #939393',
|
|
65
|
+
height: '51px'
|
|
66
|
+
},
|
|
67
|
+
searchInputbox: {
|
|
68
|
+
marginRight: '10px',
|
|
69
|
+
fontFamily: 'Poppins',
|
|
70
|
+
fontSize: '18px',
|
|
71
|
+
fontWeight: '600',
|
|
72
|
+
lineHeight: '27px',
|
|
73
|
+
letterSpacing: '-0.02em',
|
|
74
|
+
textAlign: 'left',
|
|
75
|
+
color: '#7A437A'
|
|
76
|
+
},
|
|
77
|
+
highlight: {
|
|
78
|
+
color: '#b2c6d6'
|
|
79
|
+
},
|
|
80
|
+
sortGroup: {
|
|
81
|
+
paddingTop: '10px',
|
|
82
|
+
marginBottom: '5px',
|
|
83
|
+
borderTop: '1px solid #B1B1B1',
|
|
84
|
+
textAlign: 'left',
|
|
85
|
+
marginLeft: '-5px'
|
|
86
|
+
},
|
|
87
|
+
sortGroupIcon: {
|
|
88
|
+
cursor: 'pointer',
|
|
89
|
+
fontFamily: 'Nunito',
|
|
90
|
+
fontSize: '10px',
|
|
91
|
+
marginRight: '12px',
|
|
92
|
+
marginLeft: '24px'
|
|
93
|
+
},
|
|
94
|
+
sortGroupItem: {
|
|
95
|
+
cursor: 'pointer',
|
|
96
|
+
fontFamily: 'Nunito',
|
|
97
|
+
fontSize: '10px',
|
|
98
|
+
marginRight: '32px'
|
|
99
|
+
},
|
|
100
|
+
NonSortGroup: {
|
|
101
|
+
marginBottom: '5px',
|
|
102
|
+
borderTop: '1px solid #B1B1B1',
|
|
103
|
+
textAlign: 'left',
|
|
104
|
+
paddingLeft: '10px'
|
|
105
|
+
},
|
|
106
|
+
NonSortGroupItem: {
|
|
107
|
+
fontFamily: 'Nunito',
|
|
108
|
+
fontSize: '10px',
|
|
109
|
+
marginRight: '32px'
|
|
110
|
+
},
|
|
111
|
+
sortGroupItemCounts: {
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
fontFamily: 'Nunito',
|
|
114
|
+
fontSize: '10px',
|
|
115
|
+
float: 'right',
|
|
116
|
+
marginRight: '10px',
|
|
117
|
+
marginTop: '5px'
|
|
118
|
+
},
|
|
119
|
+
itemContainer: {}
|
|
120
|
+
});
|
|
121
|
+
exports.default = _default;
|
|
@@ -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,
|
package/dist/util/Types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.headerTypes = exports.dataFormatTypes = exports.cellTypes = exports.cellStyles = exports.actionCellTypes = exports.TRANSFORM = exports.LINK = exports.FORMAT_DATA_CELLS = exports.FORMAT_DATA = exports.FORMAT_BYTES = exports.EXPAND = exports.DISPLAY = exports.DELETE = exports.DEFAULT = exports.ComponentTypes = exports.CUSTOM_ELEM = exports.COMMA = exports.CHECKBOX = void 0;
|
|
6
|
+
exports.headerTypes = exports.dataFormatTypes = exports.cellTypes = exports.cellStyles = exports.actionCellTypes = exports.TRANSFORM = exports.LINK = exports.FORMAT_DATA_CELLS = exports.FORMAT_DATA = exports.FORMAT_BYTES = exports.EXPAND = exports.DISPLAY = exports.DELETE = exports.DEFAULT = exports.ComponentTypes = exports.CUSTOM_ELEM = exports.CPI = exports.COMMA = exports.CHECKBOX = void 0;
|
|
7
7
|
const CHECKBOX = 'CHECKBOX';
|
|
8
8
|
exports.CHECKBOX = CHECKBOX;
|
|
9
9
|
const DELETE = 'DELETE';
|
|
@@ -26,6 +26,8 @@ const EXPAND = 'EXPAND';
|
|
|
26
26
|
exports.EXPAND = EXPAND;
|
|
27
27
|
const COMMA = 'COMMA';
|
|
28
28
|
exports.COMMA = COMMA;
|
|
29
|
+
const CPI = 'CPI';
|
|
30
|
+
exports.CPI = CPI;
|
|
29
31
|
const cellTypes = {
|
|
30
32
|
CUSTOM_ELEM,
|
|
31
33
|
LINK,
|
|
@@ -34,7 +36,8 @@ const cellTypes = {
|
|
|
34
36
|
DELETE,
|
|
35
37
|
DEFAULT,
|
|
36
38
|
FORMAT_DATA,
|
|
37
|
-
COMMA
|
|
39
|
+
COMMA,
|
|
40
|
+
CPI
|
|
38
41
|
};
|
|
39
42
|
exports.cellTypes = cellTypes;
|
|
40
43
|
const cellStyles = {
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_12066_12050)">
|
|
3
|
+
<path d="M19.0973 13.2173C16.943 13.2173 15.1948 14.9585 15.1948 17.1042C15.1948 19.2499 16.943 20.9912 19.0973 20.9912C21.2516 20.9912 22.9998 19.2499 22.9998 17.1042C22.9998 14.9585 21.2516 13.2173 19.0973 13.2173Z" fill="#006A8F"/>
|
|
4
|
+
<path d="M19.389 18.8806L21.5609 16.4447C21.7905 16.1897 21.6051 15.7939 21.2696 15.7939H16.9256C16.5813 15.7939 16.4047 16.1985 16.6343 16.4447L18.8062 18.8806C18.9652 19.0565 19.2389 19.0565 19.3978 18.8806H19.389Z" fill="white"/>
|
|
5
|
+
<g clip-path="url(#clip1_12066_12050)">
|
|
6
|
+
<path d="M5.995 10.579C6.49826 10.579 6.96621 10.4734 7.4165 10.3239C6.15393 9.06641 5.36813 7.31641 5.36813 5.39933C5.36813 4.19455 5.67715 3.06013 6.21573 2.07521C6.1451 2.07521 6.07446 2.05762 6.00383 2.05762C3.63761 2.05762 1.72168 3.96591 1.72168 6.32269C1.72168 8.67948 3.63761 10.5878 6.00383 10.5878L5.995 10.579Z" fill="#006A8F"/>
|
|
7
|
+
<path d="M16.1916 9.19803C18.3053 7.09283 18.3053 3.67963 16.1916 1.57443C14.078 -0.530773 10.6511 -0.530773 8.53751 1.57443C6.42388 3.67963 6.42388 7.09283 8.53751 9.19803C10.6511 11.3032 14.078 11.3032 16.1916 9.19803Z" fill="#006A8F"/>
|
|
8
|
+
<path d="M13.6409 17.1395C13.6409 14.6948 15.3272 12.6458 17.5963 12.0742C17.1637 11.7312 16.6869 11.4498 16.166 11.2388C15.0712 11.9511 13.7645 12.3732 12.3518 12.3732C10.9391 12.3732 9.64124 11.9511 8.5376 11.2388C6.3303 12.1445 4.77637 14.2991 4.77637 16.8229V17.6848C4.77637 18.3267 5.22666 18.8807 5.86236 19.0038C7.67234 19.3468 9.86197 19.6194 12.3518 19.6194C13.0052 19.6194 13.6232 19.593 14.2324 19.5579C13.8528 18.8368 13.6409 18.0189 13.6409 17.1483V17.1395Z" fill="#006A8F"/>
|
|
9
|
+
<path d="M2.63109 11.0981C1.07716 11.8896 0 13.4901 0 15.3544V16.0404C0 16.5504 0.361996 16.9901 0.85643 17.0868C1.56276 17.2187 2.34856 17.3419 3.19616 17.4298V16.823C3.19616 15.0378 3.83186 13.3758 4.90019 12.0567C4.07025 11.8984 3.29328 11.573 2.62227 11.1069L2.63109 11.0981Z" fill="#006A8F"/>
|
|
10
|
+
<path d="M15.1948 17.1043C15.1948 19.25 16.943 20.9912 19.0973 20.9912C21.2516 20.9912 22.9998 19.25 22.9998 17.1043C22.9998 14.9585 21.2516 13.2173 19.0973 13.2173C16.943 13.2173 15.1948 14.9585 15.1948 17.1043Z" fill="#006A8F"/>
|
|
11
|
+
<path d="M20.8808 16.8143L18.4351 14.651C18.1791 14.4224 17.7817 14.607 17.7817 14.9412L17.7817 19.2678C17.7817 19.6108 18.1879 19.7867 18.4351 19.558L20.8808 17.3947C21.0574 17.2364 21.0574 16.9638 20.8808 16.8055L20.8808 16.8143Z" fill="white"/>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
<defs>
|
|
15
|
+
<clipPath id="clip0_12066_12050">
|
|
16
|
+
<rect width="23" height="21" fill="white"/>
|
|
17
|
+
</clipPath>
|
|
18
|
+
<clipPath id="clip1_12066_12050">
|
|
19
|
+
<rect width="23" height="21" fill="white"/>
|
|
20
|
+
</clipPath>
|
|
21
|
+
</defs>
|
|
22
|
+
</svg>
|
|
@@ -25,7 +25,11 @@ const CustomTableBody = ({
|
|
|
25
25
|
}) => {
|
|
26
26
|
const { columns } = table;
|
|
27
27
|
const displayColunms = columns.filter((col) => col.display);
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
const MuiTableRow = { ...defaultTheme().MuiTableRow, ...customTheme.MuiTableRow };
|
|
30
|
+
const updatedTheme = { overrides: { ...defaultTheme(), ...customTheme, MuiTableRow } };
|
|
31
|
+
|
|
32
|
+
const themeConfig = createTheme(updatedTheme);
|
|
29
33
|
|
|
30
34
|
return (
|
|
31
35
|
<ThemeProvider theme={themeConfig}>
|
|
@@ -50,6 +54,7 @@ const CustomTableBody = ({
|
|
|
50
54
|
<DisplayCell
|
|
51
55
|
column={column}
|
|
52
56
|
row={row}
|
|
57
|
+
themeConfig={themeConfig}
|
|
53
58
|
/>
|
|
54
59
|
);
|
|
55
60
|
})
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { cellTypes } from '../util/Types';
|
|
7
7
|
import CustomLinkView from './components/CustomLinkView';
|
|
8
8
|
import DataFormatView from './components/DataFormatView';
|
|
9
|
+
import CPIView from './components/CPIView';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Custom Column reneder
|
|
@@ -29,6 +30,7 @@ const CustomComponent = ({
|
|
|
29
30
|
const ViewCell = ({
|
|
30
31
|
column,
|
|
31
32
|
row,
|
|
33
|
+
themeConfig,
|
|
32
34
|
}) => {
|
|
33
35
|
const { cellType } = column;
|
|
34
36
|
function isNumeric(value) {
|
|
@@ -64,6 +66,14 @@ const ViewCell = ({
|
|
|
64
66
|
: row[column.dataField]}
|
|
65
67
|
</Typography>
|
|
66
68
|
);
|
|
69
|
+
case cellTypes.CPI:
|
|
70
|
+
return (
|
|
71
|
+
<CPIView
|
|
72
|
+
row={row}
|
|
73
|
+
column={column}
|
|
74
|
+
themeConfig={themeConfig}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
67
77
|
default:
|
|
68
78
|
return (
|
|
69
79
|
<Typography>
|
|
@@ -76,11 +86,13 @@ const ViewCell = ({
|
|
|
76
86
|
const DisplayCell = ({
|
|
77
87
|
row,
|
|
78
88
|
column,
|
|
89
|
+
themeConfig,
|
|
79
90
|
}) => (
|
|
80
91
|
<TableCell className={column.dataField}>
|
|
81
92
|
<ViewCell
|
|
82
93
|
row={row}
|
|
83
94
|
column={column}
|
|
95
|
+
themeConfig={themeConfig}
|
|
84
96
|
/>
|
|
85
97
|
</TableCell>
|
|
86
98
|
);
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Modal,
|
|
5
|
+
Typography,
|
|
6
|
+
IconButton,
|
|
7
|
+
Paper,
|
|
8
|
+
Table,
|
|
9
|
+
TableContainer,
|
|
10
|
+
ThemeProvider,
|
|
11
|
+
TableHead,
|
|
12
|
+
TableRow,
|
|
13
|
+
TableCell,
|
|
14
|
+
TableBody,
|
|
15
|
+
} from '@material-ui/core';
|
|
16
|
+
// import CustomTableBody from '../../body/CustomTblBody';
|
|
17
|
+
import CloseIcon from '@material-ui/icons/Close';
|
|
18
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
19
|
+
import styles from './ModalStyle';
|
|
20
|
+
// import TableHeader from '../../header/CustomTblHeader';
|
|
21
|
+
import HeaderCell from '../../header/CustomCell';
|
|
22
|
+
|
|
23
|
+
const CustomTableContainer = (props) => {
|
|
24
|
+
const { children, themeConfig, className } = props;
|
|
25
|
+
const tableStyle = {
|
|
26
|
+
height: '510px',
|
|
27
|
+
overflowX: 'hidden',
|
|
28
|
+
};
|
|
29
|
+
return (
|
|
30
|
+
<ThemeProvider theme={themeConfig}>
|
|
31
|
+
<TableContainer className={className} id="tableContainer" component={Paper} style={tableStyle}>
|
|
32
|
+
{children}
|
|
33
|
+
</TableContainer>
|
|
34
|
+
</ThemeProvider>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const CPIModal = ({
|
|
39
|
+
classes,
|
|
40
|
+
open,
|
|
41
|
+
onClose,
|
|
42
|
+
row,
|
|
43
|
+
themeConfig,
|
|
44
|
+
}) => {
|
|
45
|
+
const [sortBy, setSortBy] = useState('associated_id');
|
|
46
|
+
const [sortOrder, setSortOrder] = useState('asc');
|
|
47
|
+
const [data, setData] = useState(() => {
|
|
48
|
+
const result = row.cpi_data;
|
|
49
|
+
return result;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const sortingData = (column, newOrder) => {
|
|
53
|
+
const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
|
|
54
|
+
|
|
55
|
+
if (newOrder === 'desc') {
|
|
56
|
+
return sortedData.reverse();
|
|
57
|
+
}
|
|
58
|
+
return sortedData;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const handleSortByColumn = (column, order) => {
|
|
62
|
+
const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
|
|
63
|
+
const newData = sortingData(column, newOrder);
|
|
64
|
+
setData(newData);
|
|
65
|
+
setSortBy(column);
|
|
66
|
+
setSortOrder(newOrder);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const modalBody = {
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
top: '5%',
|
|
72
|
+
left: '25%',
|
|
73
|
+
width: '840px',
|
|
74
|
+
height: '671px',
|
|
75
|
+
background: '#FFFFFF',
|
|
76
|
+
border: '1px solid #505050',
|
|
77
|
+
borderRadius: '40px',
|
|
78
|
+
overflow: 'hidden',
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const header = {
|
|
82
|
+
display: 'flex',
|
|
83
|
+
justifyContent: 'center',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
height: '55px',
|
|
86
|
+
};
|
|
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
|
+
|
|
99
|
+
const footer = {
|
|
100
|
+
display: 'flex',
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
height: '55px',
|
|
104
|
+
color: '#7D267E',
|
|
105
|
+
fontFamily: 'Nunito',
|
|
106
|
+
fontSize: '16px',
|
|
107
|
+
fontWeight: '400',
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const link = {
|
|
111
|
+
color: '#7D267E',
|
|
112
|
+
fontFamily: 'Nunito',
|
|
113
|
+
fontSize: '16px',
|
|
114
|
+
fontWeight: '700',
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const modalTitle = {
|
|
118
|
+
fontFamily: 'Poppins',
|
|
119
|
+
fontSize: '19px',
|
|
120
|
+
fontWeight: '400',
|
|
121
|
+
lineHeight: '21px',
|
|
122
|
+
letterSpacing: '0.02em',
|
|
123
|
+
textAlign: 'center',
|
|
124
|
+
color: '#000000',
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const closeButton = {
|
|
128
|
+
marginLeft: '769px',
|
|
129
|
+
position: 'absolute',
|
|
130
|
+
backgroundColor: 'transparent',
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const countContainer = {
|
|
134
|
+
display: 'flex',
|
|
135
|
+
justifyContent: 'left',
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
borderTop: '3px solid #939393',
|
|
138
|
+
borderBottom: '3px solid #939393',
|
|
139
|
+
height: '51px',
|
|
140
|
+
paddingLeft: '16px',
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const participantId = row.participant_id;
|
|
144
|
+
const displayColumns = [
|
|
145
|
+
{
|
|
146
|
+
dataField: 'associated_id',
|
|
147
|
+
header: 'Participant ID',
|
|
148
|
+
tooltipText: 'sort',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
dataField: 'repository_of_synonym_id',
|
|
152
|
+
header: 'Name',
|
|
153
|
+
tooltipText: 'sort',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
dataField: 'domain_description',
|
|
157
|
+
header: 'Description',
|
|
158
|
+
tooltipText: 'sort',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
dataField: 'domain_category',
|
|
162
|
+
header: 'Category',
|
|
163
|
+
tooltipText: 'sort',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
dataField: 'data_location',
|
|
167
|
+
header: 'Location',
|
|
168
|
+
tooltipText: 'sort',
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<Modal
|
|
174
|
+
open={open}
|
|
175
|
+
onClose={onClose}
|
|
176
|
+
aria-labelledby={`${row.id}-modal`}
|
|
177
|
+
>
|
|
178
|
+
<Box className={classes.modalBody} style={modalBody}>
|
|
179
|
+
<div className="header" style={header}>
|
|
180
|
+
<Typography id="modal-modal-title" className="modalTitle" style={modalTitle}>
|
|
181
|
+
{`Participant ID ${participantId} : CPI Mappings`}
|
|
182
|
+
</Typography>
|
|
183
|
+
<IconButton
|
|
184
|
+
aria-label="close"
|
|
185
|
+
onClick={onClose}
|
|
186
|
+
className="closeButton"
|
|
187
|
+
style={closeButton}
|
|
188
|
+
>
|
|
189
|
+
<CloseIcon fontSize="small" />
|
|
190
|
+
</IconButton>
|
|
191
|
+
</div>
|
|
192
|
+
<div className="container" style={countContainer}>
|
|
193
|
+
{`${data.length} mapped identifiers`}
|
|
194
|
+
</div>
|
|
195
|
+
<CustomTableContainer
|
|
196
|
+
className={classes.tableContainer}
|
|
197
|
+
themeConfig={themeConfig}
|
|
198
|
+
>
|
|
199
|
+
<Table>
|
|
200
|
+
<TableHead>
|
|
201
|
+
<TableRow>
|
|
202
|
+
{
|
|
203
|
+
displayColumns.map((column) => (
|
|
204
|
+
<HeaderCell
|
|
205
|
+
column={column}
|
|
206
|
+
sortBy={sortBy}
|
|
207
|
+
sortOrder={sortOrder}
|
|
208
|
+
toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
|
|
209
|
+
style={{ paddingLeft: '3px', paddingRight: '3px', fontWeight: '700' }}
|
|
210
|
+
/>
|
|
211
|
+
))
|
|
212
|
+
}
|
|
213
|
+
</TableRow>
|
|
214
|
+
</TableHead>
|
|
215
|
+
<TableBody>
|
|
216
|
+
{
|
|
217
|
+
data.map((currRow) => (
|
|
218
|
+
<TableRow>
|
|
219
|
+
{
|
|
220
|
+
displayColumns.map((column) => (
|
|
221
|
+
(
|
|
222
|
+
column.dataField !== 'data_location'
|
|
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>
|
|
225
|
+
)
|
|
226
|
+
))
|
|
227
|
+
}
|
|
228
|
+
</TableRow>
|
|
229
|
+
))
|
|
230
|
+
}
|
|
231
|
+
</TableBody>
|
|
232
|
+
</Table>
|
|
233
|
+
</CustomTableContainer>
|
|
234
|
+
<div className="footer" style={footer}>
|
|
235
|
+
To learn more about CPI click
|
|
236
|
+
<a style={link} href="https://participantindex-docs.ccdi.cancer.gov/" target="_blank" rel="noopener noreferrer">here</a>
|
|
237
|
+
</div>
|
|
238
|
+
</Box>
|
|
239
|
+
</Modal>
|
|
240
|
+
);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export default withStyles(styles)(CPIModal);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Typography,
|
|
4
|
+
Tooltip,
|
|
5
|
+
makeStyles,
|
|
6
|
+
} from '@material-ui/core';
|
|
7
|
+
import { cellTypes } from '../../util/Types';
|
|
8
|
+
import cpiIcon from '../../assets/cpi_icon.svg';
|
|
9
|
+
import CPIModal from './CPIModal';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom Link component
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const CPIView = ({
|
|
16
|
+
column,
|
|
17
|
+
row,
|
|
18
|
+
themeConfig,
|
|
19
|
+
}) => {
|
|
20
|
+
const useStyles = makeStyles(() => ({
|
|
21
|
+
arrow: {
|
|
22
|
+
'&:before': {
|
|
23
|
+
border: '1px solid black',
|
|
24
|
+
},
|
|
25
|
+
color: 'white',
|
|
26
|
+
},
|
|
27
|
+
tooltip: {
|
|
28
|
+
backgroundColor: 'white',
|
|
29
|
+
border: '1px solid black',
|
|
30
|
+
color: 'black',
|
|
31
|
+
font: 'Poppins',
|
|
32
|
+
fontWeight: 400,
|
|
33
|
+
fontSize: '13px',
|
|
34
|
+
lineHeight: '17.5px',
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
const classes = useStyles();
|
|
39
|
+
|
|
40
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
41
|
+
const cpiData = row.cpi_data;
|
|
42
|
+
const internalData = cpiData.filter((e) => (e.data_type === 'internal'));
|
|
43
|
+
const externalData = cpiData.filter((e) => (e.data_type === 'external'));
|
|
44
|
+
|
|
45
|
+
const handleModalOpen = () => {
|
|
46
|
+
setModalOpen(true);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleModalClose = () => {
|
|
50
|
+
setModalOpen(false);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const button = {
|
|
54
|
+
color: '#07679C',
|
|
55
|
+
textDecoration: 'underline',
|
|
56
|
+
fontWeight: 700,
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
padding: 0,
|
|
59
|
+
marginLeft: '3px',
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const icon = {
|
|
63
|
+
marginLeft: '10px',
|
|
64
|
+
position: 'relative',
|
|
65
|
+
top: '5px',
|
|
66
|
+
cursor: 'pointer',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Typography className={cellTypes.CPI}>
|
|
71
|
+
{row[column?.dataField]}
|
|
72
|
+
{cpiData.length
|
|
73
|
+
? (
|
|
74
|
+
<>
|
|
75
|
+
<CPIModal
|
|
76
|
+
row={row}
|
|
77
|
+
open={modalOpen}
|
|
78
|
+
onClose={handleModalClose}
|
|
79
|
+
themeConfig={themeConfig}
|
|
80
|
+
/>
|
|
81
|
+
<Tooltip
|
|
82
|
+
interactive
|
|
83
|
+
placement="top"
|
|
84
|
+
arrow
|
|
85
|
+
disableFocusListener
|
|
86
|
+
disableTouchListener
|
|
87
|
+
style={{
|
|
88
|
+
pointerEvents: 'auto',
|
|
89
|
+
backgroundColor: 'transparent',
|
|
90
|
+
font: 'Poppins',
|
|
91
|
+
fontSize: '13px',
|
|
92
|
+
}}
|
|
93
|
+
classes={{ arrow: classes.arrow, tooltip: classes.tooltip }}
|
|
94
|
+
title={
|
|
95
|
+
(externalData.length && internalData.length === 0
|
|
96
|
+
? (
|
|
97
|
+
<div>
|
|
98
|
+
All mapped identifiers in the CCDI Participant Index (CPI) are available
|
|
99
|
+
<span role="button" onClick={handleModalOpen} tabIndex={0} style={button}>here.</span>
|
|
100
|
+
</div>
|
|
101
|
+
)
|
|
102
|
+
: (
|
|
103
|
+
<div>
|
|
104
|
+
<div style={{ marginBottom: '3px' }}>Identifier mapped in CCDI Hub:</div>
|
|
105
|
+
{internalData.map((e) => (
|
|
106
|
+
<div>{`${e.associated_id}, ${e.repository_of_synonym_id}`}</div>
|
|
107
|
+
))}
|
|
108
|
+
<p>
|
|
109
|
+
All mapped identifiers in the CCDI Participant Index (CPI) are available
|
|
110
|
+
<span role="button" onClick={handleModalOpen} tabIndex={0} style={button}>here.</span>
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
>
|
|
117
|
+
<span style={icon}>
|
|
118
|
+
<img
|
|
119
|
+
src={cpiIcon}
|
|
120
|
+
height={21}
|
|
121
|
+
width={23}
|
|
122
|
+
alt="cpi-icon"
|
|
123
|
+
/>
|
|
124
|
+
</span>
|
|
125
|
+
</Tooltip>
|
|
126
|
+
</>
|
|
127
|
+
)
|
|
128
|
+
: <></>}
|
|
129
|
+
</Typography>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default CPIView;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export default () => ({
|
|
2
|
+
header: {
|
|
3
|
+
display: 'flex',
|
|
4
|
+
justifyContent: 'center',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
height: '55px',
|
|
7
|
+
},
|
|
8
|
+
closeButton: {
|
|
9
|
+
marginLeft: '769px',
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
},
|
|
12
|
+
resetIcon: {
|
|
13
|
+
marginLeft: '10px',
|
|
14
|
+
minWidth: '5px',
|
|
15
|
+
width: '5px',
|
|
16
|
+
borderRadius: '9px',
|
|
17
|
+
height: '30px',
|
|
18
|
+
},
|
|
19
|
+
modalTitle: {
|
|
20
|
+
fontFamily: 'Poppins',
|
|
21
|
+
fontSize: '19px',
|
|
22
|
+
fontWeight: '400',
|
|
23
|
+
lineHeight: '21px',
|
|
24
|
+
letterSpacing: '0.02em',
|
|
25
|
+
textAlign: 'center',
|
|
26
|
+
color: '#000000',
|
|
27
|
+
},
|
|
28
|
+
modalBody: {
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
top: '5%',
|
|
31
|
+
left: '25%',
|
|
32
|
+
width: '840px',
|
|
33
|
+
height: '671px',
|
|
34
|
+
background: '#FFFFFF',
|
|
35
|
+
border: '1px solid #505050',
|
|
36
|
+
borderRadius: '40px',
|
|
37
|
+
overflow: 'hidden',
|
|
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
|
+
},
|
|
53
|
+
searchContainer: {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
borderTop: '3px solid #939393',
|
|
58
|
+
borderBottom: '3px solid #939393',
|
|
59
|
+
height: '51px',
|
|
60
|
+
},
|
|
61
|
+
searchInputbox: {
|
|
62
|
+
marginRight: '10px',
|
|
63
|
+
fontFamily: 'Poppins',
|
|
64
|
+
fontSize: '18px',
|
|
65
|
+
fontWeight: '600',
|
|
66
|
+
lineHeight: '27px',
|
|
67
|
+
letterSpacing: '-0.02em',
|
|
68
|
+
textAlign: 'left',
|
|
69
|
+
color: '#7A437A',
|
|
70
|
+
},
|
|
71
|
+
highlight: {
|
|
72
|
+
color: '#b2c6d6',
|
|
73
|
+
},
|
|
74
|
+
sortGroup: {
|
|
75
|
+
paddingTop: '10px',
|
|
76
|
+
marginBottom: '5px',
|
|
77
|
+
borderTop: '1px solid #B1B1B1',
|
|
78
|
+
textAlign: 'left',
|
|
79
|
+
marginLeft: '-5px',
|
|
80
|
+
},
|
|
81
|
+
sortGroupIcon: {
|
|
82
|
+
cursor: 'pointer',
|
|
83
|
+
fontFamily: 'Nunito',
|
|
84
|
+
fontSize: '10px',
|
|
85
|
+
marginRight: '12px',
|
|
86
|
+
marginLeft: '24px',
|
|
87
|
+
},
|
|
88
|
+
sortGroupItem: {
|
|
89
|
+
cursor: 'pointer',
|
|
90
|
+
fontFamily: 'Nunito',
|
|
91
|
+
fontSize: '10px',
|
|
92
|
+
marginRight: '32px',
|
|
93
|
+
},
|
|
94
|
+
NonSortGroup: {
|
|
95
|
+
marginBottom: '5px',
|
|
96
|
+
borderTop: '1px solid #B1B1B1',
|
|
97
|
+
textAlign: 'left',
|
|
98
|
+
paddingLeft: '10px',
|
|
99
|
+
},
|
|
100
|
+
NonSortGroupItem: {
|
|
101
|
+
fontFamily: 'Nunito',
|
|
102
|
+
fontSize: '10px',
|
|
103
|
+
marginRight: '32px',
|
|
104
|
+
},
|
|
105
|
+
sortGroupItemCounts: {
|
|
106
|
+
cursor: 'pointer',
|
|
107
|
+
fontFamily: 'Nunito',
|
|
108
|
+
fontSize: '10px',
|
|
109
|
+
float: 'right',
|
|
110
|
+
marginRight: '10px',
|
|
111
|
+
marginTop: '5px',
|
|
112
|
+
},
|
|
113
|
+
itemContainer: {
|
|
114
|
+
},
|
|
115
|
+
});
|
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
|
package/src/util/Types.js
CHANGED
|
@@ -9,6 +9,7 @@ export const FORMAT_BYTES = 'FORMAT_BYTES';
|
|
|
9
9
|
export const TRANSFORM = 'TRANSFORM';
|
|
10
10
|
export const EXPAND = 'EXPAND';
|
|
11
11
|
export const COMMA = 'COMMA';
|
|
12
|
+
export const CPI = 'CPI';
|
|
12
13
|
|
|
13
14
|
export const cellTypes = {
|
|
14
15
|
CUSTOM_ELEM,
|
|
@@ -19,6 +20,7 @@ export const cellTypes = {
|
|
|
19
20
|
DEFAULT,
|
|
20
21
|
FORMAT_DATA,
|
|
21
22
|
COMMA,
|
|
23
|
+
CPI,
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
export const cellStyles = {
|