@bento-core/table 1.0.0-c3dc.33 → 1.0.0-c3dc.34

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.
@@ -76,18 +76,27 @@ function downloadData(tableData, table, downloadFileName) {
76
76
  } = table;
77
77
  const filterColumns = columns.filter(_ref => {
78
78
  let {
79
- cellType,
80
- doNotDownload
79
+ cellType
81
80
  } = _ref;
82
- return !_Types.actionCellTypes.includes(cellType) && !doNotDownload;
81
+ return !_Types.actionCellTypes.includes(cellType);
82
+ }).filter(_ref2 => {
83
+ let {
84
+ doNotDownload
85
+ } = _ref2;
86
+ return !doNotDownload;
87
+ }).filter(_ref3 => {
88
+ let {
89
+ display
90
+ } = _ref3;
91
+ return display;
83
92
  });
84
93
  let formatDataVal = (0, _Dataformat.formatColumnValues)(filterColumns, tableData);
85
94
  formatDataVal = formatDataVal.map(item => {
86
95
  const updatedItem = {};
87
- filterColumns.forEach(_ref2 => {
96
+ filterColumns.forEach(_ref4 => {
88
97
  let {
89
98
  dataField
90
- } = _ref2;
99
+ } = _ref4;
91
100
  updatedItem[dataField] = item[dataField];
92
101
  });
93
102
  return updatedItem;
@@ -112,27 +121,27 @@ function downloadData(tableData, table, downloadFileName) {
112
121
  fileType = 'application/json';
113
122
  } else {
114
123
  const jsonse = JSON.stringify(formatDataVal);
115
- const keysToInclude = filterColumns.filter(_ref3 => {
124
+ const keysToInclude = filterColumns.filter(_ref5 => {
116
125
  let {
117
126
  dataField
118
- } = _ref3;
127
+ } = _ref5;
119
128
  return dataField;
120
- }).map(_ref4 => {
129
+ }).map(_ref6 => {
121
130
  let {
122
131
  dataField
123
- } = _ref4;
132
+ } = _ref6;
124
133
  return dataField;
125
134
  });
126
- const headers = filterColumns.filter(_ref5 => {
135
+ const headers = filterColumns.filter(_ref7 => {
127
136
  let {
128
137
  dataField
129
- } = _ref5;
138
+ } = _ref7;
130
139
  return dataField;
131
- }).map(_ref6 => {
140
+ }).map(_ref8 => {
132
141
  let {
133
142
  header,
134
143
  downloadHeader
135
- } = _ref6;
144
+ } = _ref8;
136
145
  return downloadHeader || header;
137
146
  });
138
147
  fileContent = convertToCSV(jsonse, keysToInclude, headers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.0-c3dc.33",
3
+ "version": "1.0.0-c3dc.34",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
@@ -63,8 +63,10 @@ export function convertToCSV(jsonse, keysToInclude, header) {
63
63
 
64
64
  export function downloadData(tableData, table, downloadFileName, format = 'csv') {
65
65
  const { columns = [] } = table;
66
- const filterColumns = columns.filter(({ cellType, doNotDownload }) => (
67
- !actionCellTypes.includes(cellType) && !doNotDownload));
66
+ const filterColumns = columns
67
+ .filter(({ cellType }) => !actionCellTypes.includes(cellType))
68
+ .filter(({ doNotDownload }) => !doNotDownload)
69
+ .filter(({ display }) => display);
68
70
  let formatDataVal = formatColumnValues(filterColumns, tableData);
69
71
 
70
72
  formatDataVal = formatDataVal.map((item) => {