@unbxd-ui/unbxd-react-components 0.2.220 → 0.2.221
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.
|
@@ -117,6 +117,10 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
117
117
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
118
118
|
isNextPageLoading = _useState10[0],
|
|
119
119
|
setIsNextPageLoading = _useState10[1];
|
|
120
|
+
var _useState11 = (0, _react.useState)(false),
|
|
121
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
122
|
+
isApiLoading = _useState12[0],
|
|
123
|
+
setIsApiLoading = _useState12[1];
|
|
120
124
|
var debouncedFn = (0, _react.useRef)();
|
|
121
125
|
var getDefaultPageNo = function getDefaultPageNo() {
|
|
122
126
|
return minPageNo !== null && minPageNo !== void 0 ? minPageNo : 1;
|
|
@@ -155,6 +159,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
155
159
|
};
|
|
156
160
|
var makeAPICall = function makeAPICall() {
|
|
157
161
|
var _objectSpread2;
|
|
162
|
+
setIsApiLoading(true);
|
|
158
163
|
apiCallRef.current = true;
|
|
159
164
|
abortController.current = new AbortController();
|
|
160
165
|
setIsNextPageLoading(true);
|
|
@@ -166,6 +171,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
166
171
|
});
|
|
167
172
|
def.done(function (response) {
|
|
168
173
|
onDataLoaded(response);
|
|
174
|
+
setIsApiLoading(false);
|
|
169
175
|
});
|
|
170
176
|
return def;
|
|
171
177
|
};
|
|
@@ -235,7 +241,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
235
241
|
showClippedContentTitle: showClippedContentTitle
|
|
236
242
|
}, restProps);
|
|
237
243
|
if (total === null) {
|
|
238
|
-
if (LoaderComponent) {
|
|
244
|
+
if (LoaderComponent && isApiLoading) {
|
|
239
245
|
return LoaderComponent;
|
|
240
246
|
}
|
|
241
247
|
return [];
|