@bento-core/table 1.0.1-ccdihub.11 → 1.0.1-ccdihub.111

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.
Files changed (85) hide show
  1. package/dist/DefaultThemConfig.js +6 -2
  2. package/dist/ExtendedView.js +27 -16
  3. package/dist/TableView.js +92 -8
  4. package/dist/body/CustomTblBody.js +5 -2
  5. package/dist/body/DisplayBodyCell.js +17 -3
  6. package/dist/body/components/CPIModal.js +696 -0
  7. package/dist/body/components/CPIView.js +147 -0
  8. package/dist/body/components/CustomLinkView.js +1 -1
  9. package/dist/body/components/ModalStyle.js +121 -0
  10. package/dist/body/components/assets/CPI_Icon_Multi.svg +6 -0
  11. package/dist/body/components/assets/CPI_Icon_Single.svg +4 -0
  12. package/dist/body/components/assets/CPI_icon.svg +22 -0
  13. package/dist/body/components/assets/Cart_Icon.svg +3 -0
  14. package/dist/body/components/assets/Question_Icon.svg +4 -0
  15. package/dist/body/components/assets/download.svg +3 -0
  16. package/dist/header/ActionHeaderCell.js +2 -1
  17. package/dist/header/CustomCell.js +6 -3
  18. package/dist/header/CustomTblHeader.js +4 -1
  19. package/dist/header/components/CheckBoxView.js +3 -2
  20. package/dist/index.js +13 -0
  21. package/dist/pagination/CustomPagination.js +12 -7
  22. package/dist/toolbar/DownloadButtonView.js +181 -7
  23. package/dist/toolbar/ManageColumnView.js +212 -38
  24. package/dist/toolbar/assets/Hidden_Column.svg +4 -0
  25. package/dist/toolbar/assets/View_Columns.svg +6 -0
  26. package/dist/util/Dataformat.js +41 -1
  27. package/dist/util/Types.js +22 -2
  28. package/dist/util/downloadTable.js +196 -0
  29. package/dist/wrapper/WrapperService.js +36 -0
  30. package/dist/wrapper/components/AddFiles.js +63 -0
  31. package/dist/wrapper/components/AddToCart/AddToCartView.js +126 -0
  32. package/dist/wrapper/components/AddToCart/ReduxAddToCart.js +27 -0
  33. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +35 -0
  34. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogController.js +36 -0
  35. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogView.js +43 -0
  36. package/dist/wrapper/components/CPIFilesView/CPIFilesView.js +178 -0
  37. package/dist/wrapper/components/ReduxAddFile.js +27 -0
  38. package/dist/wrapper/components/Snackbar/Snackbar.js +45 -0
  39. package/dist/wrapper/components/Snackbar/SnackbarRedux.js +16 -0
  40. package/dist/wrapper/components/Snackbar/SuccessOutlined.js +17 -0
  41. package/dist/wrapper/components/TextFieldView.js +37 -0
  42. package/dist/wrapper/components/TooltipView.js +40 -0
  43. package/package.json +11 -1
  44. package/src/DefaultThemConfig.js +6 -2
  45. package/src/ExtendedView.js +39 -22
  46. package/src/TableView.js +139 -52
  47. package/src/body/CustomTblBody.js +3 -0
  48. package/src/body/DisplayBodyCell.js +16 -0
  49. package/src/body/components/CPIModal.js +770 -0
  50. package/src/body/components/CPIView.js +166 -0
  51. package/src/body/components/CustomLinkView.js +1 -1
  52. package/src/body/components/ModalStyle.js +115 -0
  53. package/src/body/components/assets/CPI_Icon_Multi.svg +6 -0
  54. package/src/body/components/assets/CPI_Icon_Single.svg +4 -0
  55. package/src/body/components/assets/CPI_icon.svg +22 -0
  56. package/src/body/components/assets/Cart_Icon.svg +3 -0
  57. package/src/body/components/assets/Question_Icon.svg +4 -0
  58. package/src/body/components/assets/download.svg +3 -0
  59. package/src/header/ActionHeaderCell.js +1 -1
  60. package/src/header/CustomCell.js +3 -0
  61. package/src/header/CustomTblHeader.js +1 -0
  62. package/src/header/components/CheckBoxView.js +2 -1
  63. package/src/index.js +2 -0
  64. package/src/pagination/CustomPagination.js +4 -6
  65. package/src/toolbar/DownloadButtonView.js +183 -10
  66. package/src/toolbar/ManageColumnView.js +207 -46
  67. package/src/toolbar/assets/Hidden_Column.svg +4 -0
  68. package/src/toolbar/assets/View_Columns.svg +6 -0
  69. package/src/util/Dataformat.js +25 -0
  70. package/src/util/Types.js +15 -0
  71. package/src/util/downloadTable.js +138 -0
  72. package/src/wrapper/WrapperService.js +25 -0
  73. package/src/wrapper/components/AddFiles.js +62 -0
  74. package/src/wrapper/components/AddToCart/AddToCartView.js +132 -0
  75. package/src/wrapper/components/AddToCart/ReduxAddToCart.js +20 -0
  76. package/src/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +37 -0
  77. package/src/wrapper/components/AddToCartDialog/AddToCartDialogController.js +32 -0
  78. package/src/wrapper/components/AddToCartDialog/AddToCartDialogView.js +57 -0
  79. package/src/wrapper/components/CPIFilesView/CPIFilesView.js +190 -0
  80. package/src/wrapper/components/ReduxAddFile.js +20 -0
  81. package/src/wrapper/components/Snackbar/Snackbar.js +44 -0
  82. package/src/wrapper/components/Snackbar/SnackbarRedux.js +11 -0
  83. package/src/wrapper/components/Snackbar/SuccessOutlined.js +10 -0
  84. package/src/wrapper/components/TextFieldView.js +32 -0
  85. package/src/wrapper/components/TooltipView.js +35 -0
@@ -0,0 +1,696 @@
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 _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
11
+ var _ExpandLess = _interopRequireDefault(require("@material-ui/icons/ExpandLess"));
12
+ var _styles = require("@material-ui/core/styles");
13
+ var _ModalStyle = _interopRequireDefault(require("./ModalStyle"));
14
+ var _CustomCell = _interopRequireDefault(require("../../header/CustomCell"));
15
+ var _ReduxAddFile = _interopRequireDefault(require("../../wrapper/components/ReduxAddFile"));
16
+ var _Question_Icon = _interopRequireDefault(require("./assets/Question_Icon.svg"));
17
+ var _download = _interopRequireDefault(require("./assets/download.svg"));
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ 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); }
20
+ 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; }
21
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
+ const useStyles = (0, _styles.makeStyles)(() => ({
23
+ button: {
24
+ width: '189px',
25
+ height: '41px',
26
+ alignSelf: 'end',
27
+ color: '#FFFFFF',
28
+ backgroundColor: '#2A6E93',
29
+ borderColor: '#2A6E93',
30
+ fontFamily: 'Poppins',
31
+ fontWeight: '600',
32
+ fontSize: '12px',
33
+ lineHeight: '13px',
34
+ display: 'flex',
35
+ justifyContent: 'flex-start',
36
+ alignItems: 'center',
37
+ padding: '0 12px',
38
+ borderRadius: '5px',
39
+ transition: 'border-radius 0.2s ease-in-out',
40
+ textAlign: 'left',
41
+ '&:hover': {
42
+ backgroundColor: '#245A7A'
43
+ },
44
+ '& .MuiButton-label': {
45
+ display: 'flex',
46
+ justifyContent: 'space-between',
47
+ alignItems: 'center',
48
+ width: '100%'
49
+ }
50
+ },
51
+ buttonOpen: {
52
+ borderBottomLeftRadius: '0',
53
+ borderBottomRightRadius: '0'
54
+ },
55
+ dropdownContainer: {
56
+ position: 'relative',
57
+ display: 'flex',
58
+ flexDirection: 'column',
59
+ alignItems: 'flex-end'
60
+ },
61
+ dropdown: {
62
+ position: 'absolute',
63
+ top: '100%',
64
+ right: 0,
65
+ zIndex: 10000,
66
+ marginTop: '-1px',
67
+ backgroundColor: 'white',
68
+ border: '1px solid #07679C',
69
+ borderTop: 'none',
70
+ borderRadius: '0 0 5px 5px',
71
+ boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.15)',
72
+ minWidth: '189px',
73
+ width: '189px',
74
+ transformOrigin: 'top',
75
+ animation: '$slideDown 0.2s ease-out'
76
+ },
77
+ '@keyframes slideDown': {
78
+ '0%': {
79
+ opacity: 0,
80
+ transform: 'translateY(-10px)'
81
+ },
82
+ '100%': {
83
+ opacity: 1,
84
+ transform: 'translateY(0)'
85
+ }
86
+ },
87
+ dropdownList: {
88
+ padding: 0,
89
+ margin: 0
90
+ },
91
+ dropdownItem: {
92
+ borderBottom: '1px solid #07679C',
93
+ padding: '0',
94
+ height: '41px',
95
+ minHeight: '41px',
96
+ display: 'flex',
97
+ alignItems: 'center',
98
+ '&:first-child': {
99
+ borderTop: '1px solid #07679C'
100
+ },
101
+ '&:last-child': {
102
+ borderBottom: 'none'
103
+ },
104
+ '&:hover': {
105
+ backgroundColor: '#DEE4EC'
106
+ },
107
+ '&:active': {
108
+ backgroundColor: '#e9ecef'
109
+ },
110
+ '&:not(:last-child)': {
111
+ borderBottom: '1px solid #07679C'
112
+ },
113
+ '& > div': {
114
+ width: '100%',
115
+ display: 'flex',
116
+ alignItems: 'center',
117
+ height: '100%'
118
+ },
119
+ '& button': {
120
+ width: '100% !important',
121
+ height: '41px !important',
122
+ borderRadius: '0 !important',
123
+ backgroundColor: 'transparent !important',
124
+ color: '#343434 !important',
125
+ fontFamily: 'Poppins !important',
126
+ fontWeight: '500 !important',
127
+ fontStyle: 'Medium !important',
128
+ fontSize: '12px !important',
129
+ lineHeight: '13px !important',
130
+ letterSpacing: '-0.02em !important',
131
+ textTransform: 'uppercase !important',
132
+ textAlign: 'left !important',
133
+ justifyContent: 'flex-start !important',
134
+ padding: '0 12px !important',
135
+ border: 'none !important',
136
+ boxShadow: 'none !important',
137
+ display: 'flex !important',
138
+ alignItems: 'center !important',
139
+ verticalAlign: 'middle !important',
140
+ '&:hover': {
141
+ backgroundColor: 'transparent !important'
142
+ }
143
+ }
144
+ },
145
+ dropdownItemText: {
146
+ '& .MuiListItemText-primary': {
147
+ fontFamily: 'Poppins',
148
+ fontWeight: '600',
149
+ fontSize: '12px',
150
+ color: '#07679C',
151
+ textTransform: 'uppercase',
152
+ letterSpacing: '0.5px'
153
+ }
154
+ },
155
+ questionIcon: {
156
+ width: '10px',
157
+ height: '10px',
158
+ position: 'absolute',
159
+ top: '3px',
160
+ right: '-12px',
161
+ cursor: 'pointer',
162
+ zIndex: 1
163
+ },
164
+ tooltipContent: {
165
+ fontFamily: 'Poppins',
166
+ fontWeight: 400,
167
+ fontStyle: 'Regular',
168
+ fontSize: '13px',
169
+ lineHeight: '17.5px',
170
+ letterSpacing: '-0.01em',
171
+ color: '#000000',
172
+ backgroundColor: '#FFFFFF',
173
+ border: '0.5px solid #000000',
174
+ borderRadius: '4px',
175
+ padding: '12px',
176
+ maxWidth: '400px'
177
+ },
178
+ tooltipIcon: {
179
+ width: '16px',
180
+ height: '11px',
181
+ marginRight: '8px',
182
+ verticalAlign: 'middle'
183
+ },
184
+ customTooltip: {
185
+ backgroundColor: '#FFFFFF !important',
186
+ color: '#000000 !important',
187
+ border: '0.5px solid #000000 !important',
188
+ borderRadius: '4px !important',
189
+ padding: '0 !important',
190
+ boxShadow: 'none !important',
191
+ '& .MuiTooltip-arrow': {
192
+ color: '#000000 !important'
193
+ }
194
+ }
195
+ }));
196
+ const CustomTableContainer = props => {
197
+ const {
198
+ children,
199
+ className
200
+ } = props;
201
+ const tableStyle = {
202
+ height: '450px',
203
+ overflowX: 'hidden'
204
+ };
205
+ const defaultTheme = (0, _styles.createTheme)();
206
+ return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
207
+ theme: defaultTheme
208
+ }, /*#__PURE__*/_react.default.createElement(_core.TableContainer, {
209
+ className: className,
210
+ id: "tableContainer",
211
+ component: _core.Paper,
212
+ style: tableStyle
213
+ }, children));
214
+ };
215
+ const CPIModal = _ref => {
216
+ let {
217
+ open,
218
+ onClose,
219
+ row
220
+ } = _ref;
221
+ const classes = useStyles();
222
+ // const [sortBy, setSortBy] = useState('associated_id');
223
+ // const [sortOrder, setSortOrder] = useState('asc');
224
+ const [data, setData] = (0, _react.useState)(row.cpi_data);
225
+ const [selectedIds, setIds] = (0, _react.useState)([]);
226
+ const [selectAll, setSelectAll] = (0, _react.useState)(false);
227
+ const [dropdownOpen, setDropdownOpen] = (0, _react.useState)(false);
228
+ const dropdownRef = (0, _react.useRef)(null);
229
+ const participantId = row.participant_id;
230
+ const studyId = row.study_id;
231
+ (0, _react.useEffect)(() => {
232
+ setData(row.cpi_data);
233
+ }, [row]);
234
+ const handleDropdownToggle = () => {
235
+ setDropdownOpen(!dropdownOpen);
236
+ };
237
+ const displayColumns = [{
238
+ dataField: 'associated_id',
239
+ header: 'Participant ID',
240
+ // tooltipText: 'sort',
241
+ sortable: false
242
+ }, {
243
+ dataField: 'repository_of_synonym_id',
244
+ header: 'Name',
245
+ // tooltipText: 'sort',
246
+ sortable: false
247
+ }, {
248
+ dataField: 'domain_description',
249
+ header: 'Description',
250
+ // tooltipText: 'sort',
251
+ sortable: false
252
+ }, {
253
+ dataField: 'domain_category',
254
+ header: 'Category',
255
+ // tooltipText: 'sort',
256
+ sortable: false
257
+ }, {
258
+ dataField: 'data_location',
259
+ header: 'Location',
260
+ // tooltipText: 'sort',
261
+ sortable: false
262
+ }];
263
+ const handleDownloadCSV = () => {
264
+ // Use the same column order and headers as the table display
265
+ const csvColumnOrder = displayColumns;
266
+
267
+ // Get the table data using the same column order as table
268
+ const csvData = data.map(dataRow => csvColumnOrder.map(column => {
269
+ const value = dataRow[column.dataField];
270
+ // Escape commas and quotes in CSV
271
+ if (typeof value === 'string' && (value.includes(',') || value.includes('"') || value.includes('\n'))) {
272
+ return "\"".concat(value.replace(/"/g, '""'), "\"");
273
+ }
274
+ return value || '';
275
+ }));
276
+
277
+ // Create CSV headers using the same headers as table
278
+ const headers = csvColumnOrder.map(column => column.header).join(',');
279
+
280
+ // Create CSV content
281
+ const csvContent = [headers, ...csvData.map(csvRow => csvRow.join(','))].join('\n');
282
+
283
+ // Create and download the file
284
+ const blob = new Blob([csvContent], {
285
+ type: 'text/csv;charset=utf-8;'
286
+ });
287
+ const link = document.createElement('a');
288
+ const url = URL.createObjectURL(blob);
289
+ link.setAttribute('href', url);
290
+ link.setAttribute('download', "alternative_identifiers_".concat(participantId, "_").concat(studyId, ".csv"));
291
+ link.style.visibility = 'hidden';
292
+ document.body.appendChild(link);
293
+ link.click();
294
+ document.body.removeChild(link);
295
+ };
296
+ const wrapperConfig = {
297
+ container: 'buttons',
298
+ size: 'xl',
299
+ clsName: 'container_header',
300
+ items: [{
301
+ participantIds: data,
302
+ title: 'ADD ALL FILES FOR PARTICIPANT',
303
+ clsName: 'add_all_button',
304
+ role: 'ADD_ALL_FILES',
305
+ btnType: 'ADD_ALL_FILES',
306
+ conditional: false,
307
+ alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.'
308
+ }, {
309
+ participantIds: selectedIds,
310
+ title: 'ADD SELECTED FILES FOR PARTICIPANT',
311
+ clsName: 'add_selected_button',
312
+ role: 'ADD_SELECTED_FILES',
313
+ btnType: 'ADD_SELECTED_FILES',
314
+ conditional: true,
315
+ disabled: selectedIds.length === 0,
316
+ alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.'
317
+ }]
318
+ };
319
+
320
+ /* const sortingData = (column, newOrder) => {
321
+ const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
322
+ if (newOrder === 'desc') {
323
+ return sortedData.reverse();
324
+ }
325
+ return sortedData;
326
+ }; */
327
+
328
+ const handleSelectAll = () => {
329
+ if (selectAll) {
330
+ setSelectAll(false);
331
+ setIds([]);
332
+ } else {
333
+ setSelectAll(true);
334
+ let toAdd = [];
335
+ data.forEach(e => {
336
+ if (e.data_type === 'internal' && e.p_id) {
337
+ toAdd = toAdd.concat(e.p_id);
338
+ }
339
+ });
340
+ setIds(toAdd);
341
+ }
342
+ };
343
+ const handleSelect = id => {
344
+ if (selectedIds.indexOf(id) !== -1) {
345
+ setIds(selectedIds.filter(e => e !== id));
346
+ } else {
347
+ const toAdd = selectedIds.concat(id);
348
+ setIds(toAdd);
349
+ }
350
+ };
351
+
352
+ /* const handleSortByColumn = (column, order) => {
353
+ const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
354
+ const newData = sortingData(column, newOrder);
355
+ setData(newData);
356
+ setSortBy(column);
357
+ setSortOrder(newOrder);
358
+ }; */
359
+
360
+ const buttonContainer = {
361
+ display: 'flex',
362
+ justifyContent: 'center',
363
+ alignItems: 'center',
364
+ padding: '10px',
365
+ gap: '20px'
366
+ };
367
+ const addAllFilesButton = {
368
+ width: '174px',
369
+ height: '41px',
370
+ borderRadius: '5px',
371
+ backgroundColor: '#536D70',
372
+ fontFamily: 'Poppins',
373
+ fontWeight: '600',
374
+ fontSize: '12px',
375
+ color: 'white',
376
+ lineHeight: '14px'
377
+ };
378
+ const addSelectedFilesButton = {
379
+ width: '174px',
380
+ height: '41px',
381
+ borderRadius: '5px',
382
+ backgroundColor: selectedIds.length ? '#2A6E93' : '#B3D6EA',
383
+ fontFamily: 'Poppins',
384
+ fontWeight: '600',
385
+ fontSize: '12px',
386
+ color: selectedIds.length ? 'white' : '#666666',
387
+ lineHeight: '14px',
388
+ opacity: selectedIds.length ? 1 : 0.6,
389
+ cursor: selectedIds.length ? 'pointer' : 'not-allowed'
390
+ };
391
+ const goToCartButton = {
392
+ width: '174px',
393
+ height: '41px',
394
+ borderRadius: '5px',
395
+ backgroundColor: '#5666BD',
396
+ fontFamily: 'Poppins',
397
+ fontWeight: '600',
398
+ fontSize: '12px',
399
+ color: 'white'
400
+ };
401
+ const downloadAltIdsButton = {
402
+ width: '189px',
403
+ height: '41px',
404
+ borderRadius: '5px',
405
+ backgroundColor: '#5A7C84',
406
+ fontFamily: 'Poppins',
407
+ fontWeight: '600',
408
+ fontSize: '12px',
409
+ color: 'white',
410
+ textTransform: 'uppercase',
411
+ border: 'none'
412
+ };
413
+ const viewInExploreButton = {
414
+ width: '189px',
415
+ height: '41px',
416
+ borderRadius: '5px',
417
+ backgroundColor: '#2A5C75',
418
+ fontFamily: 'Poppins',
419
+ fontWeight: '600',
420
+ fontSize: '12px',
421
+ color: 'white',
422
+ textTransform: 'uppercase',
423
+ border: 'none'
424
+ };
425
+ const modalBody = {
426
+ position: 'absolute',
427
+ top: '5%',
428
+ left: '25%',
429
+ width: '880px',
430
+ height: '671px',
431
+ background: '#FFFFFF',
432
+ border: '1px solid #505050',
433
+ borderRadius: '40px',
434
+ overflow: 'visible'
435
+ };
436
+ const header = {
437
+ display: 'flex',
438
+ justifyContent: 'center',
439
+ alignItems: 'center',
440
+ height: '55px'
441
+ };
442
+ const cell = {
443
+ paddingLeft: '3px',
444
+ paddingRight: '5px'
445
+ };
446
+ const cellLast = {
447
+ paddingLeft: '3px',
448
+ paddingRight: '10px',
449
+ wordBreak: 'break-word'
450
+ };
451
+ const footer = {
452
+ display: 'flex',
453
+ justifyContent: 'center',
454
+ alignItems: 'center',
455
+ height: '50px',
456
+ color: '#7D267E',
457
+ fontFamily: 'Nunito',
458
+ fontSize: '16px',
459
+ fontWeight: '400',
460
+ padding: '0 25px',
461
+ borderTop: '1px solid #505050',
462
+ textAlign: 'center',
463
+ lineHeight: '30px'
464
+ };
465
+ const link = {
466
+ color: '#7D267E',
467
+ fontFamily: 'Nunito',
468
+ fontSize: '16px',
469
+ fontWeight: '700',
470
+ textDecoration: 'underline'
471
+ };
472
+ const modalTitle = {
473
+ fontFamily: 'Poppins',
474
+ fontSize: '19px',
475
+ fontWeight: '400',
476
+ lineHeight: '21px',
477
+ letterSpacing: '0.02em',
478
+ textAlign: 'center',
479
+ color: '#000000'
480
+ };
481
+ const closeButton = {
482
+ marginLeft: '769px',
483
+ position: 'absolute',
484
+ backgroundColor: 'transparent'
485
+ };
486
+ const countContainer = {
487
+ display: 'flex',
488
+ justifyContent: 'left',
489
+ alignItems: 'center',
490
+ borderTop: '3px solid #939393',
491
+ borderBottom: '3px solid #939393',
492
+ height: '51px',
493
+ paddingLeft: '16px'
494
+ };
495
+ const tableContainer = {
496
+ '&::-webkit-scrollbar': {
497
+ width: '6px',
498
+ borderWidth: '0px 1px 1px 1px',
499
+ borderStyle: 'solid',
500
+ borderColor: '#B0B0B0'
501
+ },
502
+ '&::-webkit-scrollbar-track': {
503
+ backgroundColor: '#CECECE'
504
+ },
505
+ '&::-webkit-scrollbar-thumb': {
506
+ backgroundColor: '#003F74'
507
+ }
508
+ };
509
+ return /*#__PURE__*/_react.default.createElement(_core.Modal, {
510
+ open: open,
511
+ onClose: onClose,
512
+ "aria-labelledby": "".concat(row.id, "-modal")
513
+ }, /*#__PURE__*/_react.default.createElement(_core.Box, {
514
+ style: modalBody
515
+ }, /*#__PURE__*/_react.default.createElement("div", {
516
+ className: "header",
517
+ style: header
518
+ }, /*#__PURE__*/_react.default.createElement(_core.Typography, {
519
+ id: "modal-modal-title",
520
+ className: "modalTitle",
521
+ style: modalTitle
522
+ }, "Alternative Identifiers for Participant ".concat(participantId, " in ").concat(studyId)), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
523
+ "aria-label": "close",
524
+ onClick: onClose,
525
+ className: "closeButton",
526
+ style: closeButton
527
+ }, /*#__PURE__*/_react.default.createElement(_Close.default, {
528
+ fontSize: "small"
529
+ }))), /*#__PURE__*/_react.default.createElement("div", {
530
+ className: "container",
531
+ style: countContainer
532
+ }, "".concat(data.length, " mapped identifiers")), /*#__PURE__*/_react.default.createElement(CustomTableContainer, {
533
+ style: tableContainer
534
+ }, /*#__PURE__*/_react.default.createElement(_core.Table, null, /*#__PURE__*/_react.default.createElement(_core.TableHead, null, /*#__PURE__*/_react.default.createElement(_core.TableRow, null, /*#__PURE__*/_react.default.createElement(_core.TableCell, {
535
+ padding: "checkbox"
536
+ }, /*#__PURE__*/_react.default.createElement("span", {
537
+ style: {
538
+ display: 'none'
539
+ }
540
+ }, "Select all"), /*#__PURE__*/_react.default.createElement(_core.Checkbox, {
541
+ color: "primary",
542
+ checked: selectAll,
543
+ onChange: () => handleSelectAll()
544
+ })), displayColumns.map(column => /*#__PURE__*/_react.default.createElement(_CustomCell.default, {
545
+ column: column
546
+ // sortBy={sortBy}
547
+ // sortOrder={sortOrder}
548
+ // toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
549
+ ,
550
+ style: {
551
+ paddingLeft: '3px',
552
+ paddingRight: '3px',
553
+ fontWeight: '700'
554
+ }
555
+ })))), /*#__PURE__*/_react.default.createElement(_core.TableBody, {
556
+ style: {
557
+ borderBottom: '3px solid rgb(147, 147, 147)'
558
+ }
559
+ }, data.map(currRow => /*#__PURE__*/_react.default.createElement(_core.TableRow, null, /*#__PURE__*/_react.default.createElement(_core.TableCell, {
560
+ padding: "checkbox"
561
+ }, /*#__PURE__*/_react.default.createElement(_core.Checkbox, {
562
+ color: "#2A6E93",
563
+ checked: selectedIds.includes(currRow.p_id),
564
+ disabled: currRow.data_type === 'external',
565
+ onChange: () => handleSelect(currRow.p_id)
566
+ })), displayColumns.map(column => column.dataField !== 'data_location' ? /*#__PURE__*/_react.default.createElement(_core.TableCell, {
567
+ style: cell
568
+ }, currRow[column.dataField]) : /*#__PURE__*/_react.default.createElement(_core.TableCell, {
569
+ style: cellLast
570
+ }, /*#__PURE__*/_react.default.createElement("a", {
571
+ href: currRow[column.dataField],
572
+ target: "_blank",
573
+ rel: "noopener noreferrer"
574
+ }, currRow[column.dataField])))))))), /*#__PURE__*/_react.default.createElement("div", {
575
+ style: buttonContainer
576
+ }, /*#__PURE__*/_react.default.createElement("div", {
577
+ style: {
578
+ display: 'flex',
579
+ alignItems: 'center',
580
+ position: 'relative'
581
+ }
582
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
583
+ style: downloadAltIdsButton,
584
+ onClick: handleDownloadCSV,
585
+ disableRipple: true
586
+ }, /*#__PURE__*/_react.default.createElement("div", {
587
+ style: {
588
+ textAlign: 'center',
589
+ lineHeight: '1.2'
590
+ }
591
+ }, /*#__PURE__*/_react.default.createElement("div", null, "DOWNLOAD"), /*#__PURE__*/_react.default.createElement("div", null, "ALTERNATIVE IDS"))), /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
592
+ title: /*#__PURE__*/_react.default.createElement("div", {
593
+ className: classes.tooltipContent
594
+ }, /*#__PURE__*/_react.default.createElement("div", {
595
+ style: {
596
+ marginBottom: '8px'
597
+ }
598
+ }, "Clicking on DOWNLOAD ALTERNATIVE IDS will download the available alternative identifiers for this Participant."), /*#__PURE__*/_react.default.createElement("div", {
599
+ style: {
600
+ marginBottom: '8px'
601
+ }
602
+ }, "CPI mappings are also available for each study as part of the downloadable study manifest. Follow these steps to download all alternative identifiers for a study:"), /*#__PURE__*/_react.default.createElement("div", {
603
+ style: {
604
+ paddingLeft: '16px'
605
+ }
606
+ }, /*#__PURE__*/_react.default.createElement("div", {
607
+ style: {
608
+ marginBottom: '4px'
609
+ }
610
+ }, "1. Go to the Explore Dashboard"), /*#__PURE__*/_react.default.createElement("div", {
611
+ style: {
612
+ marginBottom: '4px'
613
+ }
614
+ }, "2. Go to the Studies Tab of the Table"), /*#__PURE__*/_react.default.createElement("div", {
615
+ style: {
616
+ marginBottom: '4px'
617
+ }
618
+ }, "3. Click on the icon", ' ', /*#__PURE__*/_react.default.createElement("img", {
619
+ src: _download.default,
620
+ alt: "Download",
621
+ style: {
622
+ width: '12px',
623
+ height: '8px',
624
+ margin: '0 4px',
625
+ verticalAlign: 'middle'
626
+ }
627
+ }), ' ', "in the Manifest column to download the Manifest."), /*#__PURE__*/_react.default.createElement("div", null, "4. Open the downloaded Manifest and go to the \"alternative identifiers\" tab"))),
628
+ placement: "top",
629
+ arrow: true,
630
+ classes: {
631
+ tooltip: classes.customTooltip
632
+ }
633
+ }, /*#__PURE__*/_react.default.createElement("img", {
634
+ src: _Question_Icon.default,
635
+ alt: "Help",
636
+ className: classes.questionIcon
637
+ }))), /*#__PURE__*/_react.default.createElement(_core.Button, {
638
+ style: viewInExploreButton,
639
+ onClick: () => {
640
+ window.location.href = "/explore?p_id=".concat(participantId, "&dbgap_accession=").concat(studyId);
641
+ },
642
+ disableRipple: true
643
+ }, "VIEW IN EXPLORE"), /*#__PURE__*/_react.default.createElement("div", {
644
+ className: classes.dropdownContainer,
645
+ ref: dropdownRef
646
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
647
+ variant: "outlined",
648
+ className: "".concat(classes.button, " ").concat(dropdownOpen ? classes.buttonOpen : ''),
649
+ onClick: handleDropdownToggle,
650
+ disableRipple: true
651
+ }, /*#__PURE__*/_react.default.createElement("span", null, "ADD TO OR GO TO CART"), dropdownOpen ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null)), dropdownOpen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
652
+ style: {
653
+ position: 'fixed',
654
+ top: 0,
655
+ left: 0,
656
+ right: 0,
657
+ bottom: 0,
658
+ zIndex: 9998
659
+ },
660
+ onClick: () => setDropdownOpen(false)
661
+ }), /*#__PURE__*/_react.default.createElement("div", {
662
+ className: classes.dropdown
663
+ }, /*#__PURE__*/_react.default.createElement("div", {
664
+ className: classes.dropdownList
665
+ }, /*#__PURE__*/_react.default.createElement("div", {
666
+ className: classes.dropdownItem
667
+ }, /*#__PURE__*/_react.default.createElement(_ReduxAddFile.default, _extends({}, wrapperConfig.items[0], {
668
+ buttonStyle: addAllFilesButton,
669
+ rowID: row.id
670
+ }))), /*#__PURE__*/_react.default.createElement("div", {
671
+ className: classes.dropdownItem
672
+ }, /*#__PURE__*/_react.default.createElement(_ReduxAddFile.default, _extends({}, wrapperConfig.items[1], {
673
+ buttonStyle: addSelectedFilesButton,
674
+ rowID: row.id,
675
+ disabled: selectedIds.length === 0
676
+ }))), /*#__PURE__*/_react.default.createElement("div", {
677
+ className: classes.dropdownItem
678
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
679
+ style: goToCartButton,
680
+ onClick: () => {
681
+ window.location.href = '/fileCentricCart';
682
+ setDropdownOpen(false);
683
+ },
684
+ disableRipple: true
685
+ }, "GO TO CART"))))))), /*#__PURE__*/_react.default.createElement("div", {
686
+ className: "footer",
687
+ style: footer
688
+ }, /*#__PURE__*/_react.default.createElement("span", null, "For more information about CPI, click", ' ', /*#__PURE__*/_react.default.createElement("a", {
689
+ style: link,
690
+ href: "https://participantindex-docs.ccdi.cancer.gov/",
691
+ target: "_blank",
692
+ rel: "noopener noreferrer"
693
+ }, "here"), "."))));
694
+ };
695
+ var _default = (0, _styles.withStyles)(_ModalStyle.default)(CPIModal);
696
+ exports.default = _default;