@bento-core/table 1.0.1-ccdihub.46 → 1.0.1-ccdihub.48

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/TableView.js CHANGED
@@ -58,8 +58,7 @@ const TableView = _ref => {
58
58
  onSortByColumn,
59
59
  onColumnViewChange,
60
60
  themeConfig = {},
61
- queryVariables,
62
- tableInfo
61
+ queryVariables
63
62
  } = _ref;
64
63
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ExtendedView.default, {
65
64
  table: table,
@@ -106,8 +105,7 @@ const TableView = _ref => {
106
105
  }), /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
107
106
  count: table.totalRowCount || 0,
108
107
  queryVariables: queryVariables,
109
- table: table,
110
- tableInfo: tableInfo
108
+ table: table
111
109
  })));
112
110
  };
113
111
  var _default = TableView;
@@ -24,8 +24,7 @@ const DownloadButton = _ref => {
24
24
  let {
25
25
  count,
26
26
  queryVariables,
27
- table,
28
- tableInfo
27
+ table
29
28
  } = _ref;
30
29
  if (table.paginationAPIField === 'filesInList') {
31
30
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
@@ -36,7 +35,9 @@ const DownloadButton = _ref => {
36
35
  style: downloadButtonStyle
37
36
  });
38
37
  }
39
- console.log('@@@@@@@@@tableInfo:', tableInfo);
38
+ console.log('#######table:', table);
39
+ console.log('&&&&&&&table:', table.column);
40
+ console.log('*******downloadFileName:', table.downloadFileName);
40
41
  const client = (0, _client.useApolloClient)();
41
42
  const downloadFile = 'CCDI Inventory ';
42
43
  async function downloadSCSVFile() {
@@ -89,15 +89,22 @@ function downloadJson(tableData, table, downloadFileName) {
89
89
  } = _ref3;
90
90
  return dataField;
91
91
  });
92
- const headers = columns.filter(_ref4 => {
92
+ const columnsFilter = columns.filter(_ref4 => {
93
93
  let {
94
94
  dataField
95
95
  } = _ref4;
96
96
  return dataField;
97
- }).map(_ref5 => {
97
+ });
98
+ console.log('????? columnsFilter:', columnsFilter);
99
+ const headers = columns.filter(_ref5 => {
98
100
  let {
99
- header
101
+ dataField
100
102
  } = _ref5;
103
+ return dataField;
104
+ }).map(_ref6 => {
105
+ let {
106
+ header
107
+ } = _ref6;
101
108
  return header;
102
109
  });
103
110
  const csv = convertToCSV(jsonse, keysToInclude, headers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.46",
3
+ "version": "1.0.1-ccdihub.48",
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/TableView.js CHANGED
@@ -52,7 +52,6 @@ const TableView = ({
52
52
  onColumnViewChange,
53
53
  themeConfig = {},
54
54
  queryVariables,
55
- tableInfo,
56
55
  }) => (
57
56
  <>
58
57
  <ExtendedView
@@ -111,7 +110,6 @@ const TableView = ({
111
110
  count={table.totalRowCount || 0}
112
111
  queryVariables={queryVariables}
113
112
  table={table}
114
- tableInfo={tableInfo}
115
113
  />
116
114
  </div>
117
115
  </>
@@ -16,7 +16,6 @@ const DownloadButton = ({
16
16
  count,
17
17
  queryVariables,
18
18
  table,
19
- tableInfo,
20
19
  }) => {
21
20
  if (table.paginationAPIField === 'filesInList') {
22
21
  return <></>;
@@ -24,7 +23,9 @@ const DownloadButton = ({
24
23
  if (count === 0) {
25
24
  return <CloudDownload className="disableButton" style={downloadButtonStyle} />;
26
25
  }
27
- console.log('@@@@@@@@@tableInfo:', tableInfo);
26
+ console.log('#######table:', table);
27
+ console.log('&&&&&&&table:', table.column);
28
+ console.log('*******downloadFileName:', table.downloadFileName);
28
29
 
29
30
  const client = useApolloClient();
30
31
 
@@ -66,6 +66,8 @@ export function downloadJson(tableData, table, downloadFileName) {
66
66
  const jsonse = JSON.stringify(formatDataVal);
67
67
  const keysToInclude = columns.filter(({ dataField }) => dataField)
68
68
  .map(({ dataField }) => dataField);
69
+ const columnsFilter = columns.filter(({ dataField }) => dataField);
70
+ console.log('????? columnsFilter:', columnsFilter);
69
71
  const headers = columns.filter(({ dataField }) => dataField).map(({ header }) => header);
70
72
  const csv = convertToCSV(jsonse, keysToInclude, headers);
71
73
  const exportData = new Blob([csv], { type: 'text/csv' });