@ssplib/react-components 0.0.140 → 0.0.141
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.
|
@@ -349,9 +349,14 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
349
349
|
filterBasedOnList(appliedFilters);
|
|
350
350
|
}, [appliedFilters]);
|
|
351
351
|
const filterBasedOnList = (filteredList) => {
|
|
352
|
-
if (filteredList.length === 0)
|
|
353
|
-
return;
|
|
354
352
|
let rawList = JSON.parse(JSON.stringify(Array.isArray(startData) ? startData : (0, lodash_get_1.default)(startData, dataPath)));
|
|
353
|
+
if (filteredList.length === 0) {
|
|
354
|
+
setList(rawList);
|
|
355
|
+
setPagCount(getCount(rawList));
|
|
356
|
+
setCurrentPage(0);
|
|
357
|
+
setListPage(1);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
355
360
|
function category(type, keyName, uniqueName, customValue, referencekey) {
|
|
356
361
|
if (type === 'a-z') {
|
|
357
362
|
rawList = rawList.sort((a, b) => {
|
|
@@ -553,7 +558,11 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
553
558
|
if (uniqueName === 'isDate')
|
|
554
559
|
setAppliedFilters((s) => s.filter((x) => !x.isDate));
|
|
555
560
|
else
|
|
556
|
-
setAppliedFilters((s) =>
|
|
561
|
+
setAppliedFilters((s) => {
|
|
562
|
+
const value = s.filter((x) => x.uniqueName !== uniqueName);
|
|
563
|
+
localStorage.setItem('tableFilters', JSON.stringify(value));
|
|
564
|
+
return value;
|
|
565
|
+
});
|
|
557
566
|
};
|
|
558
567
|
const handleDateFilter = (from, to, keyName) => {
|
|
559
568
|
setAppliedFilters((s) => {
|