@bento-core/table 1.0.1-ccdihub.28 → 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.
@@ -60,7 +60,8 @@ const ExtendedView = _ref => {
60
60
  onPageChange: onPageChange,
61
61
  onRowsPerPageChange: onRowsPerPageChange,
62
62
  queryVariables: queryVariables,
63
- table: table
63
+ table: table,
64
+ download: download
64
65
  }));
65
66
  };
66
67
  var _default = ExtendedView;
@@ -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,21 +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
42
  paginationAPIField
40
43
  } = table;
41
- const downloadFileName = downloadFile.concat(paginationAPIField, ' download');
42
44
  const result = await client.query({
43
45
  query,
44
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.28",
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",
@@ -56,6 +56,7 @@ const ExtendedView = ({
56
56
  onRowsPerPageChange={onRowsPerPageChange}
57
57
  queryVariables={queryVariables}
58
58
  table={table}
59
+ download={download}
59
60
  />
60
61
  )
61
62
  }
@@ -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,21 +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 client = useApolloClient();
25
+ const {
26
+ downloadFileName,
27
+ } = download;
25
28
 
26
- const downloadFile = 'CCDI Inventory ';
29
+ const client = useApolloClient();
27
30
 
28
31
  async function downloadSCSVFile() {
29
32
  const {
30
33
  query,
31
34
  paginationAPIField,
32
35
  } = table;
33
- const downloadFileName = downloadFile.concat(paginationAPIField, ' download');
36
+
34
37
  const result = await client.query({
35
38
  query,
36
39
  variables: {