sy-form-components 0.2.12 → 0.2.13

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.js CHANGED
@@ -8408,13 +8408,13 @@ function useApprovalActions(options) {
8408
8408
  // src/hooks/useChangeRecords.ts
8409
8409
  var import_react52 = require("react");
8410
8410
  var normalizeChangeRecordList = (value) => {
8411
- const body = value?.data ?? value?.result ?? value ?? {};
8412
- const records = body.records ?? body.data ?? body.list ?? body.items ?? [];
8411
+ const body = value && typeof value === "object" && !Array.isArray(value) ? Array.isArray(value.data) || Array.isArray(value.records) || Array.isArray(value.list) || Array.isArray(value.items) ? value : value.data ?? value.result ?? value : value;
8412
+ const records = Array.isArray(body) ? body : body?.records ?? body?.data ?? body?.list ?? body?.items ?? [];
8413
8413
  return {
8414
8414
  records: Array.isArray(records) ? records : [],
8415
- total: Number(body.total ?? body.totalCount ?? body.count ?? records.length) || 0,
8416
- page: Number(body.page ?? body.currentPage ?? 1) || 1,
8417
- pageSize: Number(body.pageSize ?? body.limit ?? 20) || 20
8415
+ total: Number(body?.total ?? body?.totalCount ?? body?.count ?? records.length) || 0,
8416
+ page: Number(body?.page ?? body?.currentPage ?? 1) || 1,
8417
+ pageSize: Number(body?.pageSize ?? body?.limit ?? 20) || 20
8418
8418
  };
8419
8419
  };
8420
8420
  function useChangeRecords(options) {
@@ -11876,6 +11876,8 @@ var InnerDetailContent = ({
11876
11876
  const {
11877
11877
  records,
11878
11878
  loading: recordsLoading,
11879
+ total: recordsTotal,
11880
+ page: recordsPage,
11879
11881
  hasMore,
11880
11882
  loadMore,
11881
11883
  refresh: refreshRecords
@@ -11987,7 +11989,8 @@ var InnerDetailContent = ({
11987
11989
  {
11988
11990
  records,
11989
11991
  loading: recordsLoading,
11990
- total: records.length,
11992
+ total: recordsTotal,
11993
+ page: recordsPage,
11991
11994
  hasMore,
11992
11995
  onLoadMore: loadMore,
11993
11996
  onRefresh: refreshRecords,