@ssplib/react-components 0.0.203 → 0.0.205
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',
|
|
@@ -189,7 +196,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
189
196
|
return;
|
|
190
197
|
}
|
|
191
198
|
}
|
|
192
|
-
if (key.toLowerCase().includes(searchValue.toLowerCase())) {
|
|
199
|
+
if (removePunctuationAndAccents(key.toLowerCase()).includes(removePunctuationAndAccents(searchValue.toLowerCase()))) {
|
|
193
200
|
exists = true;
|
|
194
201
|
}
|
|
195
202
|
});
|
|
@@ -576,7 +583,9 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
576
583
|
function date(from, to, keyName) {
|
|
577
584
|
const separator = filterSeparator;
|
|
578
585
|
rawList = rawList.filter((x) => {
|
|
579
|
-
const dts = x[keyName]
|
|
586
|
+
const dts = String(x[keyName])
|
|
587
|
+
.split(separator)
|
|
588
|
+
.map((k) => { var _a, _b; return (_b = ((_a = k.match(/[0-9]+\/[0-9]+\/[0-9]+/)) !== null && _a !== void 0 ? _a : [])[0]) !== null && _b !== void 0 ? _b : ''; });
|
|
580
589
|
let inside = false;
|
|
581
590
|
dts.forEach((k) => {
|
|
582
591
|
if (inside)
|