wargerm 0.5.0 → 0.5.1
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.
- package/dist/index.esm.js +10 -6
- package/dist/index.js +10 -6
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -8317,12 +8317,14 @@ function Table(_ref) {
|
|
8317
8317
|
case 7:
|
8318
8318
|
res = _context.sent;
|
8319
8319
|
setLoading(false);
|
8320
|
-
onLoad && onLoad(res.data, res);
|
8321
|
-
setDataSource(res.data);
|
8322
|
-
setTotal(res.total || 0);
|
8320
|
+
onLoad && onLoad(res === null || res === void 0 ? void 0 : res.data, res);
|
8321
|
+
setDataSource((res === null || res === void 0 ? void 0 : res.data) || []);
|
8322
|
+
setTotal((res === null || res === void 0 ? void 0 : res.total) || 0);
|
8323
8323
|
setpaginationParams(function (c) {
|
8324
|
+
var _res$data;
|
8325
|
+
|
8324
8326
|
return _objectSpread2(_objectSpread2(_objectSpread2({}, c), {}, {
|
8325
|
-
total: res.total || res.data.length
|
8327
|
+
total: (res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.length) || 0
|
8326
8328
|
}, pagination), requestParams);
|
8327
8329
|
});
|
8328
8330
|
_context.next = 16;
|
@@ -8330,13 +8332,15 @@ function Table(_ref) {
|
|
8330
8332
|
|
8331
8333
|
case 15:
|
8332
8334
|
setpaginationParams(function (c) {
|
8335
|
+
var _tableList$slice;
|
8336
|
+
|
8333
8337
|
var obj = _objectSpread2(_objectSpread2(_objectSpread2({}, c), {}, {
|
8334
|
-
total: tableList
|
8338
|
+
total: (tableList === null || tableList === void 0 ? void 0 : tableList.length) || 0
|
8335
8339
|
}, pagination), pageParams);
|
8336
8340
|
|
8337
8341
|
var current = obj.current,
|
8338
8342
|
pageSize = obj.pageSize;
|
8339
|
-
setDataSource(tableList ? (tableList === null ||
|
8343
|
+
setDataSource((tableList === null || tableList === void 0 ? void 0 : (_tableList$slice = tableList.slice) === null || _tableList$slice === void 0 ? void 0 : _tableList$slice.call(tableList, (current - 1) * pageSize, current * pageSize)) || []);
|
8340
8344
|
return obj;
|
8341
8345
|
});
|
8342
8346
|
|
package/dist/index.js
CHANGED
@@ -8376,12 +8376,14 @@ function Table(_ref) {
|
|
8376
8376
|
case 7:
|
8377
8377
|
res = _context.sent;
|
8378
8378
|
setLoading(false);
|
8379
|
-
onLoad && onLoad(res.data, res);
|
8380
|
-
setDataSource(res.data);
|
8381
|
-
setTotal(res.total || 0);
|
8379
|
+
onLoad && onLoad(res === null || res === void 0 ? void 0 : res.data, res);
|
8380
|
+
setDataSource((res === null || res === void 0 ? void 0 : res.data) || []);
|
8381
|
+
setTotal((res === null || res === void 0 ? void 0 : res.total) || 0);
|
8382
8382
|
setpaginationParams(function (c) {
|
8383
|
+
var _res$data;
|
8384
|
+
|
8383
8385
|
return _objectSpread2(_objectSpread2(_objectSpread2({}, c), {}, {
|
8384
|
-
total: res.total || res.data.length
|
8386
|
+
total: (res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.length) || 0
|
8385
8387
|
}, pagination), requestParams);
|
8386
8388
|
});
|
8387
8389
|
_context.next = 16;
|
@@ -8389,13 +8391,15 @@ function Table(_ref) {
|
|
8389
8391
|
|
8390
8392
|
case 15:
|
8391
8393
|
setpaginationParams(function (c) {
|
8394
|
+
var _tableList$slice;
|
8395
|
+
|
8392
8396
|
var obj = _objectSpread2(_objectSpread2(_objectSpread2({}, c), {}, {
|
8393
|
-
total: tableList
|
8397
|
+
total: (tableList === null || tableList === void 0 ? void 0 : tableList.length) || 0
|
8394
8398
|
}, pagination), pageParams);
|
8395
8399
|
|
8396
8400
|
var current = obj.current,
|
8397
8401
|
pageSize = obj.pageSize;
|
8398
|
-
setDataSource(tableList ? (tableList === null ||
|
8402
|
+
setDataSource((tableList === null || tableList === void 0 ? void 0 : (_tableList$slice = tableList.slice) === null || _tableList$slice === void 0 ? void 0 : _tableList$slice.call(tableList, (current - 1) * pageSize, current * pageSize)) || []);
|
8399
8403
|
return obj;
|
8400
8404
|
});
|
8401
8405
|
|