@bento-core/table 1.0.1-ccdihub.27 → 1.0.1-ccdihub.29
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 +2 -1
- package/dist/pagination/CustomPagination.js +4 -2
- package/dist/pagination/components/DownloadButton.js +6 -5
- package/package.json +1 -1
- package/src/ExtendedView.js +1 -0
- package/src/pagination/CustomPagination.js +2 -0
- package/src/pagination/components/DownloadButton.js +6 -4
package/dist/ExtendedView.js
CHANGED
|
@@ -55,7 +55,8 @@ const CustomPagination = _ref => {
|
|
|
55
55
|
onRowsPerPageChange,
|
|
56
56
|
customTheme = {},
|
|
57
57
|
queryVariables,
|
|
58
|
-
table
|
|
58
|
+
table,
|
|
59
|
+
download
|
|
59
60
|
} = _ref;
|
|
60
61
|
return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
|
|
61
62
|
theme: (0, _core.createTheme)({
|
|
@@ -81,7 +82,8 @@ const CustomPagination = _ref => {
|
|
|
81
82
|
}), /*#__PURE__*/_react.default.createElement(_DownloadButton.default, {
|
|
82
83
|
count: count,
|
|
83
84
|
queryVariables: queryVariables,
|
|
84
|
-
table: table
|
|
85
|
+
table: table,
|
|
86
|
+
download: download
|
|
85
87
|
})));
|
|
86
88
|
};
|
|
87
89
|
CustomPagination.propTypes = {
|
|
@@ -24,22 +24,23 @@ const DownloadButton = _ref => {
|
|
|
24
24
|
let {
|
|
25
25
|
count,
|
|
26
26
|
queryVariables,
|
|
27
|
-
table
|
|
27
|
+
table,
|
|
28
|
+
download
|
|
28
29
|
} = _ref;
|
|
29
30
|
if (count === 0) {
|
|
30
31
|
return /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, {
|
|
31
32
|
style: downloadButtonStyle
|
|
32
33
|
});
|
|
33
34
|
}
|
|
35
|
+
const {
|
|
36
|
+
downloadFileName
|
|
37
|
+
} = download;
|
|
34
38
|
const client = (0, _client.useApolloClient)();
|
|
35
|
-
const downloadFile = 'CCDI Inventory ';
|
|
36
39
|
async function downloadSCSVFile() {
|
|
37
40
|
const {
|
|
38
41
|
query,
|
|
39
|
-
paginationAPIField
|
|
40
|
-
dataKey
|
|
42
|
+
paginationAPIField
|
|
41
43
|
} = table;
|
|
42
|
-
const downloadFileName = downloadFile.concat(dataKey, ' download');
|
|
43
44
|
const result = await client.query({
|
|
44
45
|
query,
|
|
45
46
|
variables: _objectSpread(_objectSpread({}, queryVariables), {}, {
|
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.29",
|
|
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",
|
package/src/ExtendedView.js
CHANGED
|
@@ -50,6 +50,7 @@ const CustomPagination = ({
|
|
|
50
50
|
customTheme = {},
|
|
51
51
|
queryVariables,
|
|
52
52
|
table,
|
|
53
|
+
download,
|
|
53
54
|
}) => (
|
|
54
55
|
<ThemeProvider theme={createTheme({ overrides: { ...defaultTheme, ...customTheme } })}>
|
|
55
56
|
<div className="downloadArea" style={downloadAreaStyle}>
|
|
@@ -70,6 +71,7 @@ const CustomPagination = ({
|
|
|
70
71
|
count={count}
|
|
71
72
|
queryVariables={queryVariables}
|
|
72
73
|
table={table}
|
|
74
|
+
download={download}
|
|
73
75
|
/>
|
|
74
76
|
</div>
|
|
75
77
|
</ThemeProvider>
|
|
@@ -16,22 +16,24 @@ const DownloadButton = ({
|
|
|
16
16
|
count,
|
|
17
17
|
queryVariables,
|
|
18
18
|
table,
|
|
19
|
+
download,
|
|
19
20
|
}) => {
|
|
20
21
|
if (count === 0) {
|
|
21
22
|
return <CloudDownload style={downloadButtonStyle} />;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
downloadFileName,
|
|
27
|
+
} = download;
|
|
25
28
|
|
|
26
|
-
const
|
|
29
|
+
const client = useApolloClient();
|
|
27
30
|
|
|
28
31
|
async function downloadSCSVFile() {
|
|
29
32
|
const {
|
|
30
33
|
query,
|
|
31
34
|
paginationAPIField,
|
|
32
|
-
dataKey,
|
|
33
35
|
} = table;
|
|
34
|
-
|
|
36
|
+
|
|
35
37
|
const result = await client.query({
|
|
36
38
|
query,
|
|
37
39
|
variables: {
|