@ssplib/react-components 0.0.205 → 0.0.207
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.
|
@@ -73,7 +73,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
73
73
|
const isSmall = (0, material_1.useMediaQuery)(theme.breakpoints.only('xs'));
|
|
74
74
|
(0, react_1.useEffect)(() => {
|
|
75
75
|
setError(null);
|
|
76
|
-
if (userLoaded || !useKC)
|
|
76
|
+
if (userLoaded || !useKC) {
|
|
77
|
+
setIsLoading(true);
|
|
77
78
|
fetchFunc()
|
|
78
79
|
.then((res) => {
|
|
79
80
|
if (!res.ok)
|
|
@@ -106,6 +107,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
106
107
|
status: 500,
|
|
107
108
|
});
|
|
108
109
|
});
|
|
110
|
+
}
|
|
109
111
|
}, [userLoaded, fetchFunc]);
|
|
110
112
|
const getCount = (0, react_1.useCallback)((countData) => {
|
|
111
113
|
if (countData.length <= 0)
|
|
@@ -431,7 +433,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
431
433
|
filterBasedOnList(appliedFilters);
|
|
432
434
|
}, [appliedFilters]);
|
|
433
435
|
const filterBasedOnList = (filteredList) => {
|
|
434
|
-
|
|
436
|
+
var _a;
|
|
437
|
+
let rawList = JSON.parse(JSON.stringify(Array.isArray(startData) ? startData : (_a = (0, lodash_get_1.default)(startData, dataPath)) !== null && _a !== void 0 ? _a : '[]'));
|
|
435
438
|
if (filteredList.length <= 0 || rawList.length <= 0) {
|
|
436
439
|
setList(rawList);
|
|
437
440
|
setPagCount(getCount(rawList));
|