@ssplib/react-components 0.0.204 → 0.0.206

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.
@@ -43,6 +43,13 @@ const DatePicker_1 = __importDefault(require("../date/DatePicker"));
43
43
  const dayjs_1 = __importDefault(require("dayjs"));
44
44
  const jszip_1 = __importDefault(require("jszip"));
45
45
  const NavigateNextRounded_1 = __importDefault(require("@mui/icons-material/NavigateNextRounded"));
46
+ function removePunctuationAndAccents(text) {
47
+ // Remove accents and diacritics
48
+ const normalizedText = text.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
49
+ // Remove punctuation marks
50
+ const cleanedText = normalizedText.replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g, '');
51
+ return cleanedText;
52
+ }
46
53
  let startData = [];
47
54
  function Table({ columns, fetchFunc, emptyMsg = {
48
55
  user: 'Nenhum dado encontrado',
@@ -66,7 +73,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
66
73
  const isSmall = (0, material_1.useMediaQuery)(theme.breakpoints.only('xs'));
67
74
  (0, react_1.useEffect)(() => {
68
75
  setError(null);
69
- if (userLoaded || !useKC)
76
+ if (userLoaded || !useKC) {
77
+ setIsLoading(true);
70
78
  fetchFunc()
71
79
  .then((res) => {
72
80
  if (!res.ok)
@@ -99,6 +107,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
99
107
  status: 500,
100
108
  });
101
109
  });
110
+ }
102
111
  }, [userLoaded, fetchFunc]);
103
112
  const getCount = (0, react_1.useCallback)((countData) => {
104
113
  if (countData.length <= 0)
@@ -189,7 +198,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
189
198
  return;
190
199
  }
191
200
  }
192
- if (key.toLowerCase().includes(searchValue.toLowerCase())) {
201
+ if (removePunctuationAndAccents(key.toLowerCase()).includes(removePunctuationAndAccents(searchValue.toLowerCase()))) {
193
202
  exists = true;
194
203
  }
195
204
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.204",
3
+ "version": "0.0.206",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",