@bento-core/table 1.0.1-ccdihub.81 → 1.0.1-ccdihub.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,31 +13,32 @@ var _CustomCell = _interopRequireDefault(require("../../header/CustomCell"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- 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; }
17
- 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; }
18
- 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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ // import CustomTableBody from '../../body/CustomTblBody';
17
+
18
+ // import TableHeader from '../../header/CustomTblHeader';
19
+
21
20
  const CustomTableContainer = props => {
22
21
  const {
23
22
  children,
24
- customTheme
23
+ themeConfig,
24
+ className
25
25
  } = props;
26
- const themeConfig = (0, _core.createTheme)({
27
- overrides: _objectSpread({}, customTheme)
28
- });
26
+ const tableStyle = {
27
+ height: '510px',
28
+ overflowX: 'hidden'
29
+ };
29
30
  return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
30
31
  theme: themeConfig
31
32
  }, /*#__PURE__*/_react.default.createElement(_core.TableContainer, {
33
+ className: className,
32
34
  id: "tableContainer",
33
35
  component: _core.Paper,
34
- style: {
35
- height: '510px'
36
- }
36
+ style: tableStyle
37
37
  }, children));
38
38
  };
39
39
  const CPIModal = _ref => {
40
40
  let {
41
+ classes,
41
42
  open,
42
43
  onClose,
43
44
  row,
@@ -82,7 +83,12 @@ const CPIModal = _ref => {
82
83
  };
83
84
  const cell = {
84
85
  paddingLeft: '3px',
85
- paddingRight: '3px'
86
+ paddingRight: '5px'
87
+ };
88
+ const cellLast = {
89
+ paddingLeft: '3px',
90
+ paddingRight: '10px',
91
+ wordBreak: 'break-word'
86
92
  };
87
93
  const footer = {
88
94
  display: 'flex',
@@ -150,7 +156,7 @@ const CPIModal = _ref => {
150
156
  onClose: onClose,
151
157
  "aria-labelledby": "".concat(row.id, "-modal")
152
158
  }, /*#__PURE__*/_react.default.createElement(_core.Box, {
153
- className: "modalBody",
159
+ className: classes.modalBody,
154
160
  style: modalBody
155
161
  }, /*#__PURE__*/_react.default.createElement("div", {
156
162
  className: "header",
@@ -170,7 +176,8 @@ const CPIModal = _ref => {
170
176
  className: "container",
171
177
  style: countContainer
172
178
  }, "".concat(data.length, " mapped identifiers")), /*#__PURE__*/_react.default.createElement(CustomTableContainer, {
173
- customTheme: themeConfig.tblContainer || {}
179
+ className: classes.tableContainer,
180
+ themeConfig: themeConfig
174
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, {
175
182
  column: column,
176
183
  sortBy: sortBy,
@@ -178,12 +185,13 @@ const CPIModal = _ref => {
178
185
  toggleSort: () => handleSortByColumn(column.dataField, sortOrder),
179
186
  style: {
180
187
  paddingLeft: '3px',
181
- paddingRight: '3px'
188
+ paddingRight: '3px',
189
+ fontWeight: '700'
182
190
  }
183
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, {
184
192
  style: cell
185
193
  }, currRow[column.dataField]) : /*#__PURE__*/_react.default.createElement(_core.TableCell, {
186
- style: cell
194
+ style: cellLast
187
195
  }, /*#__PURE__*/_react.default.createElement("a", {
188
196
  href: currRow[column.dataField],
189
197
  target: "_blank",
@@ -35,13 +35,27 @@ var _default = () => ({
35
35
  position: 'absolute',
36
36
  top: '5%',
37
37
  left: '25%',
38
- width: '836px',
38
+ width: '840px',
39
39
  height: '671px',
40
40
  background: '#FFFFFF',
41
41
  border: '1px solid #505050',
42
42
  borderRadius: '40px',
43
43
  overflow: 'hidden'
44
44
  },
45
+ tableContainer: {
46
+ '&::-webkit-scrollbar': {
47
+ width: '6px',
48
+ borderWidth: '0px 1px 1px 1px',
49
+ borderStyle: 'solid',
50
+ borderColor: '#B0B0B0'
51
+ },
52
+ '&::-webkit-scrollbar-track': {
53
+ backgroundColor: '#CECECE'
54
+ },
55
+ '&::-webkit-scrollbar-thumb': {
56
+ backgroundColor: '#003F74'
57
+ }
58
+ },
45
59
  searchContainer: {
46
60
  display: 'flex',
47
61
  justifyContent: 'center',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.81",
3
+ "version": "1.0.1-ccdihub.82",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
@@ -8,7 +8,6 @@ import {
8
8
  Table,
9
9
  TableContainer,
10
10
  ThemeProvider,
11
- createTheme,
12
11
  TableHead,
13
12
  TableRow,
14
13
  TableCell,
@@ -22,11 +21,14 @@ import styles from './ModalStyle';
22
21
  import HeaderCell from '../../header/CustomCell';
23
22
 
24
23
  const CustomTableContainer = (props) => {
25
- const { children, customTheme } = props;
26
- const themeConfig = createTheme({ overrides: { ...customTheme } });
24
+ const { children, themeConfig, className } = props;
25
+ const tableStyle = {
26
+ height: '510px',
27
+ overflowX: 'hidden',
28
+ };
27
29
  return (
28
30
  <ThemeProvider theme={themeConfig}>
29
- <TableContainer id="tableContainer" component={Paper} style={{ height: '510px' }}>
31
+ <TableContainer className={className} id="tableContainer" component={Paper} style={tableStyle}>
30
32
  {children}
31
33
  </TableContainer>
32
34
  </ThemeProvider>
@@ -34,6 +36,7 @@ const CustomTableContainer = (props) => {
34
36
  };
35
37
 
36
38
  const CPIModal = ({
39
+ classes,
37
40
  open,
38
41
  onClose,
39
42
  row,
@@ -84,7 +87,13 @@ const CPIModal = ({
84
87
 
85
88
  const cell = {
86
89
  paddingLeft: '3px',
87
- paddingRight: '3px',
90
+ paddingRight: '5px',
91
+ };
92
+
93
+ const cellLast = {
94
+ paddingLeft: '3px',
95
+ paddingRight: '10px',
96
+ wordBreak: 'break-word',
88
97
  };
89
98
 
90
99
  const footer = {
@@ -166,7 +175,7 @@ const CPIModal = ({
166
175
  onClose={onClose}
167
176
  aria-labelledby={`${row.id}-modal`}
168
177
  >
169
- <Box className="modalBody" style={modalBody}>
178
+ <Box className={classes.modalBody} style={modalBody}>
170
179
  <div className="header" style={header}>
171
180
  <Typography id="modal-modal-title" className="modalTitle" style={modalTitle}>
172
181
  {`Participant ID ${participantId} : CPI Mappings`}
@@ -184,7 +193,8 @@ const CPIModal = ({
184
193
  {`${data.length} mapped identifiers`}
185
194
  </div>
186
195
  <CustomTableContainer
187
- customTheme={themeConfig.tblContainer || {}}
196
+ className={classes.tableContainer}
197
+ themeConfig={themeConfig}
188
198
  >
189
199
  <Table>
190
200
  <TableHead>
@@ -196,7 +206,7 @@ const CPIModal = ({
196
206
  sortBy={sortBy}
197
207
  sortOrder={sortOrder}
198
208
  toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
199
- style={{ paddingLeft: '3px', paddingRight: '3px' }}
209
+ style={{ paddingLeft: '3px', paddingRight: '3px', fontWeight: '700' }}
200
210
  />
201
211
  ))
202
212
  }
@@ -211,7 +221,7 @@ const CPIModal = ({
211
221
  (
212
222
  column.dataField !== 'data_location'
213
223
  ? <TableCell style={cell}>{currRow[column.dataField]}</TableCell>
214
- : <TableCell style={cell}><a href={currRow[column.dataField]} target="_blank" rel="noopener noreferrer">{currRow[column.dataField]}</a></TableCell>
224
+ : <TableCell style={cellLast}><a href={currRow[column.dataField]} target="_blank" rel="noopener noreferrer">{currRow[column.dataField]}</a></TableCell>
215
225
  )
216
226
  ))
217
227
  }
@@ -29,13 +29,27 @@ export default () => ({
29
29
  position: 'absolute',
30
30
  top: '5%',
31
31
  left: '25%',
32
- width: '836px',
32
+ width: '840px',
33
33
  height: '671px',
34
34
  background: '#FFFFFF',
35
35
  border: '1px solid #505050',
36
36
  borderRadius: '40px',
37
37
  overflow: 'hidden',
38
38
  },
39
+ tableContainer: {
40
+ '&::-webkit-scrollbar': {
41
+ width: '6px',
42
+ borderWidth: '0px 1px 1px 1px',
43
+ borderStyle: 'solid',
44
+ borderColor: '#B0B0B0',
45
+ },
46
+ '&::-webkit-scrollbar-track': {
47
+ backgroundColor: '#CECECE',
48
+ },
49
+ '&::-webkit-scrollbar-thumb': {
50
+ backgroundColor: '#003F74',
51
+ },
52
+ },
39
53
  searchContainer: {
40
54
  display: 'flex',
41
55
  justifyContent: 'center',