@bento-core/table 1.0.0-c3dc.3 → 1.0.0-c3dc.31

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 (41) hide show
  1. package/dist/ExtendedView.js +9 -11
  2. package/dist/TableView.js +7 -4
  3. package/dist/assets/cpi_icon.svg +22 -0
  4. package/dist/assets/downArrow.svg +3 -0
  5. package/dist/assets/leftArrow.svg +3 -0
  6. package/dist/assets/rightArrow.svg +3 -0
  7. package/dist/body/CustomTblBody.js +9 -4
  8. package/dist/body/DisplayBodyCell.js +18 -3
  9. package/dist/body/components/CPIModal.js +210 -0
  10. package/dist/body/components/CPIView.js +115 -0
  11. package/dist/body/components/CustomLinkView.js +1 -1
  12. package/dist/body/components/ModalStyle.js +121 -0
  13. package/dist/header/ActionHeaderCell.js +2 -1
  14. package/dist/header/CustomCell.js +8 -5
  15. package/dist/header/CustomTblHeader.js +3 -1
  16. package/dist/header/components/CheckBoxView.js +3 -2
  17. package/dist/pagination/CustomPagination.js +84 -28
  18. package/dist/toolbar/DownloadButtonView.js +254 -51
  19. package/dist/util/Types.js +8 -2
  20. package/dist/util/downloadTable.js +72 -37
  21. package/package.json +2 -2
  22. package/src/ExtendedView.js +34 -33
  23. package/src/TableView.js +11 -8
  24. package/src/assets/cpi_icon.svg +22 -0
  25. package/src/assets/downArrow.svg +3 -0
  26. package/src/assets/leftArrow.svg +3 -0
  27. package/src/assets/rightArrow.svg +3 -0
  28. package/src/body/CustomTblBody.js +6 -1
  29. package/src/body/DisplayBodyCell.js +23 -0
  30. package/src/body/components/CPIModal.js +243 -0
  31. package/src/body/components/CPIView.js +133 -0
  32. package/src/body/components/CustomLinkView.js +1 -1
  33. package/src/body/components/ModalStyle.js +115 -0
  34. package/src/header/ActionHeaderCell.js +1 -0
  35. package/src/header/CustomCell.js +6 -3
  36. package/src/header/CustomTblHeader.js +3 -1
  37. package/src/header/components/CheckBoxView.js +2 -1
  38. package/src/pagination/CustomPagination.js +97 -40
  39. package/src/toolbar/DownloadButtonView.js +257 -73
  40. package/src/util/Types.js +4 -0
  41. package/src/util/downloadTable.js +51 -17
@@ -48,21 +48,14 @@ const ExtendedView = _ref => {
48
48
  });
49
49
  return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
50
50
  theme: themeConfig
51
- }, numSelected === 0 && (download || manageViewColumns) && /*#__PURE__*/_react.default.createElement(_core.Toolbar, {
52
- className: "downloadColumnView"
53
- }, /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
54
- count: table.totalRowCount || 0,
55
- queryVariables: queryVariables,
56
- table: table,
57
- buttonConfig: downloadButtonConfig
58
- }), /*#__PURE__*/_react.default.createElement(_ManageColumnView.default, {
51
+ }, numSelected === 0 && (download || manageViewColumns) && /*#__PURE__*/_react.default.createElement(_ManageColumnView.default, {
59
52
  table: table,
60
53
  manageViewColumns: manageViewColumns,
61
54
  onColumnViewChange: onColumnViewChange
62
- })), pagination && /*#__PURE__*/_react.default.createElement("div", {
55
+ }), pagination && /*#__PURE__*/_react.default.createElement("div", {
63
56
  className: "downloadArea",
64
- style: downloadAreaStyle
65
- }, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
57
+ style: table.paginationCustomStyle && table.paginationCustomStyle.topPagination ? table.paginationCustomStyle.topPagination : downloadAreaStyle
58
+ }, table.showSearchBox && /*#__PURE__*/_react.default.createElement(table.SearchBox, null), /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
66
59
  customTheme: customTheme.tblTopPgn,
67
60
  rowsPerPageOptions: [10, 25, 50, 100],
68
61
  component: "div",
@@ -73,6 +66,11 @@ const ExtendedView = _ref => {
73
66
  onRowsPerPageChange: onRowsPerPageChange,
74
67
  queryVariables: queryVariables,
75
68
  table: table
69
+ }), table.showDownloadIcon !== false && /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
70
+ count: table.totalRowCount || 0,
71
+ queryVariables: queryVariables,
72
+ table: table,
73
+ buttonConfig: downloadButtonConfig
76
74
  })));
77
75
  };
78
76
  var _default = ExtendedView;
package/dist/TableView.js CHANGED
@@ -10,6 +10,7 @@ var _CustomTblHeader = _interopRequireDefault(require("./header/CustomTblHeader"
10
10
  var _CustomPagination = _interopRequireDefault(require("./pagination/CustomPagination"));
11
11
  var _CustomTblBody = _interopRequireDefault(require("./body/CustomTblBody"));
12
12
  var _CustomToolbar = _interopRequireDefault(require("./toolbar/CustomToolbar"));
13
+ var _DownloadButtonView = _interopRequireDefault(require("./toolbar/DownloadButtonView"));
13
14
  var _DisplayErrMsg = _interopRequireDefault(require("./errMsg/DisplayErrMsg"));
14
15
  var _ExtendedView = _interopRequireDefault(require("./ExtendedView"));
15
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -18,8 +19,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
18
19
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
20
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
21
  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); }
21
- // import DownloadButton from './toolbar/DownloadButtonView';
22
-
23
22
  const CustomTableContainer = props => {
24
23
  const {
25
24
  children,
@@ -37,7 +36,6 @@ const CustomTableContainer = props => {
37
36
  const downloadAreaStyle = {
38
37
  display: 'flex',
39
38
  borderTop: '1px solid #8A7F7C',
40
- borderBottom: '1px solid #8A7F7C',
41
39
  paddingRight: '41px'
42
40
  };
43
41
  const cartDownloadAreaStyle = {
@@ -93,7 +91,7 @@ const TableView = _ref => {
93
91
  table: table
94
92
  }), /*#__PURE__*/_react.default.createElement("div", {
95
93
  className: "downloadArea",
96
- style: table.paginationAPIField === 'filesInList' ? cartDownloadAreaStyle : downloadAreaStyle
94
+ style: table.paginationAPIField === 'filesInList' ? cartDownloadAreaStyle : table.paginationCustomStyle && table.paginationCustomStyle.bottomPagination ? table.paginationCustomStyle.bottomPagination : downloadAreaStyle
97
95
  }, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
98
96
  customTheme: themeConfig.tblPgn,
99
97
  rowsPerPageOptions: [10, 25, 50, 100],
@@ -103,6 +101,11 @@ const TableView = _ref => {
103
101
  page: table.page || 0,
104
102
  onPageChange: onPageChange,
105
103
  onRowsPerPageChange: onRowsPerPageChange
104
+ }), table.showDownloadIcon !== false && /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
105
+ count: table.totalRowCount || 0,
106
+ queryVariables: queryVariables,
107
+ table: table,
108
+ buttonConfig: table.extendedViewConfig.downloadButtonConfig
106
109
  })));
107
110
  };
108
111
  var _default = TableView;
@@ -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>
@@ -0,0 +1,3 @@
1
+ <svg width="13" height="6" viewBox="0 0 13 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0.404297 0.937988L6.45817 5.93799L12.5121 0.937988H0.404297Z" fill="#CFCFCF"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="30" height="25" viewBox="0 0 30 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M19.4141 17.278L13.8687 12.688L19.4141 8.09799L17.7069 6.68799L10.4422 12.688L17.7069 18.688L19.4141 17.278Z" fill="#000"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="30" height="25" viewBox="0 0 30 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.323 17.278L16.8683 12.688L11.323 8.09799L13.0302 6.68799L20.2948 12.688L13.0302 18.688L11.323 17.278Z" fill="#323232"/>
3
+ </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 themeConfig = (0, _core.createTheme)({
36
- overrides: _objectSpread(_objectSpread({}, (0, _DefaultThemConfig.default)()), customTheme)
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,11 +40,15 @@ 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
46
48
  } = column;
49
+ function isNumeric(value) {
50
+ return /^-?\d+\.?\d*$/.test(value);
51
+ }
47
52
  switch (cellType) {
48
53
  case _Types.cellTypes.FORMAT_DATA:
49
54
  return /*#__PURE__*/_react.default.createElement(_DataFormatView.default, {
@@ -60,6 +65,14 @@ const ViewCell = _ref2 => {
60
65
  row: row,
61
66
  column: column
62
67
  });
68
+ case _Types.cellTypes.COMMA:
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
+ });
63
76
  default:
64
77
  return /*#__PURE__*/_react.default.createElement(_core.Typography, null, row[column.dataField]);
65
78
  }
@@ -67,13 +80,15 @@ const ViewCell = _ref2 => {
67
80
  const DisplayCell = _ref3 => {
68
81
  let {
69
82
  row,
70
- column
83
+ column,
84
+ themeConfig
71
85
  } = _ref3;
72
86
  return /*#__PURE__*/_react.default.createElement(_core.TableCell, {
73
87
  className: column.dataField
74
88
  }, /*#__PURE__*/_react.default.createElement(ViewCell, {
75
89
  row: row,
76
- column: column
90
+ column: column,
91
+ themeConfig: themeConfig
77
92
  }));
78
93
  };
79
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;
@@ -20,7 +20,7 @@ const CustomLinkView = _ref => {
20
20
  rootPath,
21
21
  pathParams
22
22
  } = column === null || column === void 0 ? void 0 : column.linkAttr;
23
- const url = pathParams.map(attr => "#".concat(rootPath, "/").concat(row[attr]));
23
+ const url = pathParams.map(attr => "".concat(rootPath, "/").concat(row[attr]));
24
24
  return /*#__PURE__*/_react.default.createElement(_core.Link, {
25
25
  href: url,
26
26
  className: _Types.cellTypes.LINK
@@ -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;