@bento-core/table 1.0.1-ccdihub.86 → 1.0.1-ccdihub.88
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/ExtendedView.js +8 -2
- package/dist/TableView.js +5 -3
- package/dist/body/components/CPIModal.js +7 -6
- package/dist/body/components/CustomLinkView.js +1 -1
- package/dist/header/CustomTblHeader.js +5 -3
- package/dist/pagination/CustomPagination.js +7 -2
- package/package.json +3 -2
- package/src/ExtendedView.js +15 -6
- package/src/TableView.js +9 -5
- package/src/body/components/CPIModal.js +9 -8
- package/src/body/components/CustomLinkView.js +1 -1
- package/src/header/CustomTblHeader.js +6 -1
- package/src/pagination/CustomPagination.js +2 -0
package/dist/ExtendedView.js
CHANGED
|
@@ -21,6 +21,11 @@ const downloadAreaStyle = {
|
|
|
21
21
|
borderTop: '1px solid #8A7F7C',
|
|
22
22
|
paddingRight: '41px'
|
|
23
23
|
};
|
|
24
|
+
const exportAreaStyle = {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
marginTop: '20px',
|
|
27
|
+
paddingRight: '41px'
|
|
28
|
+
};
|
|
24
29
|
const ExtendedView = _ref => {
|
|
25
30
|
let {
|
|
26
31
|
table,
|
|
@@ -37,6 +42,7 @@ const ExtendedView = _ref => {
|
|
|
37
42
|
return null;
|
|
38
43
|
}
|
|
39
44
|
const {
|
|
45
|
+
hasExport = true,
|
|
40
46
|
manageViewColumns = false,
|
|
41
47
|
pagination = false
|
|
42
48
|
} = extendedViewConfig;
|
|
@@ -47,7 +53,7 @@ const ExtendedView = _ref => {
|
|
|
47
53
|
theme: themeConfig
|
|
48
54
|
}, pagination && /*#__PURE__*/_react.default.createElement("div", {
|
|
49
55
|
className: "downloadArea",
|
|
50
|
-
style: downloadAreaStyle
|
|
56
|
+
style: hasExport ? downloadAreaStyle : exportAreaStyle
|
|
51
57
|
}, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
52
58
|
customTheme: customTheme.tblTopPgn,
|
|
53
59
|
rowsPerPageOptions: [10, 25, 50, 100],
|
|
@@ -59,7 +65,7 @@ const ExtendedView = _ref => {
|
|
|
59
65
|
onRowsPerPageChange: onRowsPerPageChange,
|
|
60
66
|
queryVariables: queryVariables,
|
|
61
67
|
table: table
|
|
62
|
-
}), /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
|
|
68
|
+
}), hasExport && /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
|
|
63
69
|
count: table.totalRowCount || 0,
|
|
64
70
|
queryVariables: queryVariables,
|
|
65
71
|
table: table
|
package/dist/TableView.js
CHANGED
|
@@ -95,7 +95,8 @@ const TableView = _ref => {
|
|
|
95
95
|
extendedViewConfig
|
|
96
96
|
} = table;
|
|
97
97
|
const {
|
|
98
|
-
manageViewColumns = false
|
|
98
|
+
manageViewColumns = false,
|
|
99
|
+
hasExport = true
|
|
99
100
|
} = extendedViewConfig;
|
|
100
101
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ExtendedView.default, {
|
|
101
102
|
table: table,
|
|
@@ -144,8 +145,9 @@ const TableView = _ref => {
|
|
|
144
145
|
rowsPerPage: table.rowsPerPage || 10,
|
|
145
146
|
page: table.page || 0,
|
|
146
147
|
onPageChange: onPageChange,
|
|
147
|
-
onRowsPerPageChange: onRowsPerPageChange
|
|
148
|
-
|
|
148
|
+
onRowsPerPageChange: onRowsPerPageChange,
|
|
149
|
+
hasExport: hasExport
|
|
150
|
+
}), hasExport && /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
|
|
149
151
|
count: table.totalRowCount || 0,
|
|
150
152
|
queryVariables: queryVariables,
|
|
151
153
|
table: table
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactRouterDom = require("react-router-dom");
|
|
8
9
|
var _core = require("@material-ui/core");
|
|
9
10
|
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
10
11
|
var _styles = require("@material-ui/core/styles");
|
|
@@ -62,8 +63,7 @@ const CPIModal = _ref => {
|
|
|
62
63
|
open,
|
|
63
64
|
onClose,
|
|
64
65
|
row,
|
|
65
|
-
themeConfig = {}
|
|
66
|
-
navigation
|
|
66
|
+
themeConfig = {}
|
|
67
67
|
} = _ref;
|
|
68
68
|
const [sortBy, setSortBy] = (0, _react.useState)('associated_id');
|
|
69
69
|
const [sortOrder, setSortOrder] = (0, _react.useState)('asc');
|
|
@@ -333,16 +333,17 @@ const CPIModal = _ref => {
|
|
|
333
333
|
})), /*#__PURE__*/_react.default.createElement(_ReduxAddFile.default, _extends({}, wrapperConfig.items[1], {
|
|
334
334
|
buttonStyle: addSelectedFilesButton,
|
|
335
335
|
rowID: row.id
|
|
336
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
})), /*#__PURE__*/_react.default.createElement(_reactRouterDom.NavLink, {
|
|
337
|
+
to: "/fileCentricCart"
|
|
338
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
339
|
+
style: goToCartButton
|
|
339
340
|
}, "GO TO CART", /*#__PURE__*/_react.default.createElement("img", {
|
|
340
341
|
src: _Cart_Icon.default,
|
|
341
342
|
alt: "cart",
|
|
342
343
|
style: {
|
|
343
344
|
paddingLeft: '30px'
|
|
344
345
|
}
|
|
345
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
346
|
+
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
346
347
|
className: "footer",
|
|
347
348
|
style: footer
|
|
348
349
|
}, "To learn more about CPI click\xA0", /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -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 => "
|
|
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
|
|
@@ -67,9 +67,11 @@ const CustomTableHeader = _ref => {
|
|
|
67
67
|
sortBy: sortBy,
|
|
68
68
|
sortOrder: sortOrder,
|
|
69
69
|
toggleSort: () => sortByColumn(column.dataField, sortOrder),
|
|
70
|
-
style:
|
|
71
|
-
minWidth: '230px'
|
|
72
|
-
|
|
70
|
+
style: {
|
|
71
|
+
minWidth: column.dataField === 'participant_id' ? '230px' : '',
|
|
72
|
+
width: column.dataField === 'study_name' ? '325px' : '',
|
|
73
|
+
textWrapMode: 'nowrap'
|
|
74
|
+
}
|
|
73
75
|
});
|
|
74
76
|
}))));
|
|
75
77
|
};
|
|
@@ -47,7 +47,8 @@ const CustomPagination = _ref => {
|
|
|
47
47
|
page,
|
|
48
48
|
onPageChange,
|
|
49
49
|
onRowsPerPageChange,
|
|
50
|
-
customTheme = {}
|
|
50
|
+
customTheme = {},
|
|
51
|
+
hasExport = true
|
|
51
52
|
} = _ref;
|
|
52
53
|
return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
|
|
53
54
|
theme: (0, _core.createTheme)({
|
|
@@ -74,7 +75,11 @@ const CustomPagination = _ref => {
|
|
|
74
75
|
inputProps: {
|
|
75
76
|
'aria-label': 'Selection dropdown for displaying the number of results per page'
|
|
76
77
|
}
|
|
77
|
-
}
|
|
78
|
+
},
|
|
79
|
+
style: !hasExport ? {
|
|
80
|
+
position: 'relative',
|
|
81
|
+
left: '50px'
|
|
82
|
+
} : {}
|
|
78
83
|
}));
|
|
79
84
|
};
|
|
80
85
|
CustomPagination.propTypes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.88",
|
|
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",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"@bento-core/tool-tip": "^1.0.0",
|
|
35
35
|
"@bento-core/util": "^1.0.1-ccdihub.1",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
|
-
"graphql-tag": "^2.12.6"
|
|
37
|
+
"graphql-tag": "^2.12.6",
|
|
38
|
+
"react-router-dom": "^5.1.2"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {},
|
|
40
41
|
"description": ""
|
package/src/ExtendedView.js
CHANGED
|
@@ -14,6 +14,12 @@ const downloadAreaStyle = {
|
|
|
14
14
|
paddingRight: '41px',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
const exportAreaStyle = {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
marginTop: '20px',
|
|
20
|
+
paddingRight: '41px',
|
|
21
|
+
};
|
|
22
|
+
|
|
17
23
|
const ExtendedView = ({
|
|
18
24
|
table,
|
|
19
25
|
onColumnViewChange,
|
|
@@ -27,6 +33,7 @@ const ExtendedView = ({
|
|
|
27
33
|
return null;
|
|
28
34
|
}
|
|
29
35
|
const {
|
|
36
|
+
hasExport = true,
|
|
30
37
|
manageViewColumns = false,
|
|
31
38
|
pagination = false,
|
|
32
39
|
} = extendedViewConfig;
|
|
@@ -43,7 +50,7 @@ const ExtendedView = ({
|
|
|
43
50
|
)} */}
|
|
44
51
|
{
|
|
45
52
|
(pagination) && (
|
|
46
|
-
<div className="downloadArea" style={downloadAreaStyle}>
|
|
53
|
+
<div className="downloadArea" style={hasExport ? downloadAreaStyle : exportAreaStyle}>
|
|
47
54
|
<CustomPagination
|
|
48
55
|
customTheme={customTheme.tblTopPgn}
|
|
49
56
|
rowsPerPageOptions={[10, 25, 50, 100]}
|
|
@@ -56,11 +63,13 @@ const ExtendedView = ({
|
|
|
56
63
|
queryVariables={queryVariables}
|
|
57
64
|
table={table}
|
|
58
65
|
/>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
{hasExport && (
|
|
67
|
+
<DownloadButton
|
|
68
|
+
count={table.totalRowCount || 0}
|
|
69
|
+
queryVariables={queryVariables}
|
|
70
|
+
table={table}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
64
73
|
<ManageColumnView
|
|
65
74
|
table={table}
|
|
66
75
|
manageViewColumns={manageViewColumns}
|
package/src/TableView.js
CHANGED
|
@@ -86,6 +86,7 @@ const TableView = ({
|
|
|
86
86
|
const { extendedViewConfig } = table;
|
|
87
87
|
const {
|
|
88
88
|
manageViewColumns = false,
|
|
89
|
+
hasExport = true,
|
|
89
90
|
} = extendedViewConfig;
|
|
90
91
|
return (
|
|
91
92
|
<>
|
|
@@ -144,12 +145,15 @@ const TableView = ({
|
|
|
144
145
|
page={table.page || 0}
|
|
145
146
|
onPageChange={onPageChange}
|
|
146
147
|
onRowsPerPageChange={onRowsPerPageChange}
|
|
148
|
+
hasExport={hasExport}
|
|
147
149
|
/>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
{hasExport && (
|
|
151
|
+
<DownloadButton
|
|
152
|
+
count={table.totalRowCount || 0}
|
|
153
|
+
queryVariables={queryVariables}
|
|
154
|
+
table={table}
|
|
155
|
+
/>
|
|
156
|
+
)}
|
|
153
157
|
<ManageColumnView
|
|
154
158
|
table={table}
|
|
155
159
|
manageViewColumns={manageViewColumns}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { NavLink } from 'react-router-dom';
|
|
2
3
|
import {
|
|
3
4
|
Box,
|
|
4
5
|
Checkbox,
|
|
@@ -68,7 +69,6 @@ const CPIModal = ({
|
|
|
68
69
|
onClose,
|
|
69
70
|
row,
|
|
70
71
|
themeConfig = {},
|
|
71
|
-
navigation,
|
|
72
72
|
}) => {
|
|
73
73
|
const [sortBy, setSortBy] = useState('associated_id');
|
|
74
74
|
const [sortOrder, setSortOrder] = useState('asc');
|
|
@@ -384,13 +384,14 @@ const CPIModal = ({
|
|
|
384
384
|
buttonStyle={addSelectedFilesButton}
|
|
385
385
|
rowID={row.id}
|
|
386
386
|
/>
|
|
387
|
-
<
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
<NavLink to="/fileCentricCart">
|
|
388
|
+
<Button
|
|
389
|
+
style={goToCartButton}
|
|
390
|
+
>
|
|
391
|
+
GO TO CART
|
|
392
|
+
<img src={cartIcon} alt="cart" style={{ paddingLeft: '30px' }} />
|
|
393
|
+
</Button>
|
|
394
|
+
</NavLink>
|
|
394
395
|
</div>
|
|
395
396
|
<div className="footer" style={footer}>
|
|
396
397
|
To learn more about CPI click
|
|
@@ -12,7 +12,7 @@ const CustomLinkView = ({
|
|
|
12
12
|
row,
|
|
13
13
|
}) => {
|
|
14
14
|
const { rootPath, pathParams } = column?.linkAttr;
|
|
15
|
-
const url = pathParams.map((attr) =>
|
|
15
|
+
const url = pathParams.map((attr) => `${rootPath}/`.concat(row[attr]));
|
|
16
16
|
return (
|
|
17
17
|
<Link href={url} className={cellTypes.LINK}>
|
|
18
18
|
<Typography>
|
|
@@ -37,6 +37,7 @@ const CustomTableHeader = ({
|
|
|
37
37
|
*/
|
|
38
38
|
// const rootClsName = getClsName(table.title, tableCls.HEADER);
|
|
39
39
|
const themeConfig = createTheme({ overrides: { ...defaultTheme(), ...customTheme } });
|
|
40
|
+
|
|
40
41
|
return (
|
|
41
42
|
<ThemeProvider theme={themeConfig}>
|
|
42
43
|
<TableHead>
|
|
@@ -66,7 +67,11 @@ const CustomTableHeader = ({
|
|
|
66
67
|
sortBy={sortBy}
|
|
67
68
|
sortOrder={sortOrder}
|
|
68
69
|
toggleSort={() => sortByColumn(column.dataField, sortOrder)}
|
|
69
|
-
style={
|
|
70
|
+
style={{
|
|
71
|
+
minWidth: column.dataField === 'participant_id' ? '230px' : '',
|
|
72
|
+
width: column.dataField === 'study_name' ? '325px' : '',
|
|
73
|
+
textWrapMode: 'nowrap',
|
|
74
|
+
}}
|
|
70
75
|
/>
|
|
71
76
|
);
|
|
72
77
|
})
|
|
@@ -41,6 +41,7 @@ const CustomPagination = ({
|
|
|
41
41
|
onPageChange,
|
|
42
42
|
onRowsPerPageChange,
|
|
43
43
|
customTheme = {},
|
|
44
|
+
hasExport = true,
|
|
44
45
|
}) => (
|
|
45
46
|
<ThemeProvider theme={createTheme({ overrides: { ...defaultTheme, ...customTheme } })}>
|
|
46
47
|
<TablePagination
|
|
@@ -57,6 +58,7 @@ const CustomPagination = ({
|
|
|
57
58
|
IconComponent: KeyboardArrowDownOutlinedIcon,
|
|
58
59
|
inputProps: { 'aria-label': 'Selection dropdown for displaying the number of results per page' },
|
|
59
60
|
}}
|
|
61
|
+
style={!hasExport ? { position: 'relative', left: '50px' } : {}}
|
|
60
62
|
/>
|
|
61
63
|
</ThemeProvider>
|
|
62
64
|
);
|