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.mjs CHANGED
@@ -8259,13 +8259,13 @@ function useApprovalActions(options) {
8259
8259
  // src/hooks/useChangeRecords.ts
8260
8260
  import { useState as useState27, useEffect as useEffect32, useCallback as useCallback14, useRef as useRef12 } from "react";
8261
8261
  var normalizeChangeRecordList = (value) => {
8262
- const body = value?.data ?? value?.result ?? value ?? {};
8263
- const records = body.records ?? body.data ?? body.list ?? body.items ?? [];
8262
+ 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;
8263
+ const records = Array.isArray(body) ? body : body?.records ?? body?.data ?? body?.list ?? body?.items ?? [];
8264
8264
  return {
8265
8265
  records: Array.isArray(records) ? records : [],
8266
- total: Number(body.total ?? body.totalCount ?? body.count ?? records.length) || 0,
8267
- page: Number(body.page ?? body.currentPage ?? 1) || 1,
8268
- pageSize: Number(body.pageSize ?? body.limit ?? 20) || 20
8266
+ total: Number(body?.total ?? body?.totalCount ?? body?.count ?? records.length) || 0,
8267
+ page: Number(body?.page ?? body?.currentPage ?? 1) || 1,
8268
+ pageSize: Number(body?.pageSize ?? body?.limit ?? 20) || 20
8269
8269
  };
8270
8270
  };
8271
8271
  function useChangeRecords(options) {
@@ -11782,6 +11782,8 @@ var InnerDetailContent = ({
11782
11782
  const {
11783
11783
  records,
11784
11784
  loading: recordsLoading,
11785
+ total: recordsTotal,
11786
+ page: recordsPage,
11785
11787
  hasMore,
11786
11788
  loadMore,
11787
11789
  refresh: refreshRecords
@@ -11893,7 +11895,8 @@ var InnerDetailContent = ({
11893
11895
  {
11894
11896
  records,
11895
11897
  loading: recordsLoading,
11896
- total: records.length,
11898
+ total: recordsTotal,
11899
+ page: recordsPage,
11897
11900
  hasMore,
11898
11901
  onLoadMore: loadMore,
11899
11902
  onRefresh: refreshRecords,