@ssplib/react-components 0.0.128 → 0.0.129

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.
@@ -14,8 +14,8 @@ export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableNam
14
14
  csvShowAllButton?: boolean;
15
15
  csvAllButtonTitle?: string;
16
16
  csvButtonTitle?: string;
17
- csvZipFileNamesKey: string;
18
- generateCsvZip: boolean;
17
+ csvZipFileNamesKey?: string;
18
+ generateCsvZip?: boolean;
19
19
  csvExcludeValidate?: (key: string, value: string | number) => boolean;
20
20
  csvCustomKeyNames?: {
21
21
  [key: string]: string;
@@ -214,14 +214,15 @@ function Table({ columns, fetchFunc, emptyMsg = {
214
214
  });
215
215
  Object.keys(obj).forEach((objKey) => {
216
216
  const values = [];
217
+ let include = true;
217
218
  obj[objKey].forEach((x) => {
218
- let include = true;
219
219
  originalKeys.forEach((k) => {
220
220
  //verificar se pode incluir
221
221
  if (csvExcludeValidate(k, x[k])) {
222
222
  include = false;
223
223
  }
224
224
  });
225
+ console.log(include);
225
226
  if (include) {
226
227
  const value = keys
227
228
  .map((k) => {
@@ -241,7 +242,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
241
242
  }
242
243
  });
243
244
  const csvData = '\uFEFF' + header + values.join('\n');
244
- zip.file(`${objKey}.csv`, csvData);
245
+ if (include)
246
+ zip.file(`${objKey}.csv`, csvData);
245
247
  });
246
248
  // // download
247
249
  var link = window.document.createElement('a');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.128",
3
+ "version": "0.0.129",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",