@ssplib/react-components 0.0.231 → 0.0.233

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.
@@ -53,6 +53,12 @@ function removePunctuationAndAccents(text) {
53
53
  const cleanedText = normalizedText.replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g, '');
54
54
  return cleanedText;
55
55
  }
56
+ function formatarString(str) {
57
+ return str
58
+ .normalize('NFD')
59
+ .replace(/[\u0300-\u036f]/g, '')
60
+ .toLowerCase();
61
+ }
56
62
  let startData = [];
57
63
  let isExpandAll = false;
58
64
  let localTableName = '';
@@ -92,7 +98,6 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
92
98
  filtersFuncData = filtersFunc !== null && filtersFunc !== void 0 ? filtersFunc : {};
93
99
  if (!localStorage.getItem(localTableNameCache))
94
100
  localStorage.setItem(localTableNameCache, JSON.stringify(filters));
95
- console.log('DTTTTTTTT: ', localStorage.getItem(localTableNameCache) === JSON.stringify(filters));
96
101
  if (localStorage.getItem(localTableNameCache) !== JSON.stringify(filters)) {
97
102
  localStorage.setItem(localTableNameCache, JSON.stringify(filters));
98
103
  localStorage.removeItem(localTableName);
@@ -507,7 +512,7 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
507
512
  case 'igual':
508
513
  currentData.forEach((cd) => {
509
514
  const value = (0, lodash_get_1.default)(cd, dt.keyName, '');
510
- if (value === dt.value) {
515
+ if (formatarString(value) === formatarString(dt.value)) {
511
516
  filteredData.push(cd);
512
517
  }
513
518
  });
@@ -518,12 +523,12 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
518
523
  if (!value)
519
524
  return;
520
525
  if (dt.useList) {
521
- if (value.includes(dt.value.id)) {
526
+ if (formatarString(value).includes(formatarString(dt.value.id))) {
522
527
  filteredData.push(cd);
523
528
  }
524
529
  }
525
530
  else {
526
- if (value.includes(dt.value)) {
531
+ if (formatarString(value).includes(formatarString(dt.value))) {
527
532
  filteredData.push(cd);
528
533
  }
529
534
  }
@@ -534,7 +539,7 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
534
539
  const value = (0, lodash_get_1.default)(cd, dt.keyName, '');
535
540
  if (!value)
536
541
  return;
537
- if (dt.value.map((x) => x.id).includes(value)) {
542
+ if (dt.value.map((x) => formatarString(x.id)).includes(formatarString(value))) {
538
543
  filteredData.push(cd);
539
544
  }
540
545
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.231",
3
+ "version": "0.0.233",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",