@ssplib/react-components 0.0.55 → 0.0.56

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.
@@ -167,29 +167,32 @@ function Table({ columns, fetchFunc, emptyMsg = {
167
167
  e.preventDefault();
168
168
  if (list.length <= 0)
169
169
  return;
170
- const keys = Object.keys(list[0]).filter((k) => !csvExcludeKeys.includes(k));
170
+ const originalKeys = Object.keys(list[0]);
171
+ const keys = originalKeys.filter((k) => !csvExcludeKeys.includes(k));
171
172
  const header = keys.map((k) => (csvCustomKeyNames[k] ? csvCustomKeyNames[k] : k)).join(',') + '\n';
172
173
  const values = [];
173
174
  list.forEach((x) => {
174
175
  let include = true;
175
- const value = keys
176
- .map((k) => {
176
+ originalKeys.forEach((k) => {
177
177
  //verificar se pode incluir
178
178
  if (csvExcludeValidate(k, x[k])) {
179
179
  include = false;
180
- return;
181
180
  }
182
- if (k === 'tbRa')
183
- return x[k]['NO_CIDADE'];
184
- if (k === 'rlEventoData')
185
- return `${x[k][0]['DT_INICIO']} - ${x[k][0]['HR_INICIO']}`;
186
- if (typeof x[k] === 'string')
187
- return `"${x[k]}"`;
188
- return x[k];
189
- })
190
- .join(',');
191
- if (include)
181
+ });
182
+ if (include) {
183
+ const value = keys
184
+ .map((k) => {
185
+ if (k === 'tbRa')
186
+ return x[k]['NO_CIDADE'];
187
+ if (k === 'rlEventoData')
188
+ return `${x[k][0]['DT_INICIO']} - ${x[k][0]['HR_INICIO']}`;
189
+ if (typeof x[k] === 'string')
190
+ return `"${x[k]}"`;
191
+ return x[k];
192
+ })
193
+ .join(',');
192
194
  values.push(value);
195
+ }
193
196
  });
194
197
  const csvData = header + values.join('\n');
195
198
  // download
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",