react-toolkits 2.14.1 → 2.14.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 2.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 37dc742: feat(QueryList): 添加 pageSizeOptions 属性以支持自定义分页大小选项
8
+
9
+ ## 2.14.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 2df5864: feat: change QueryList generics
14
+
3
15
  ## 2.14.1
4
16
 
5
17
  ### Patch Changes
package/lib/index.d.ts CHANGED
@@ -203,12 +203,12 @@ declare enum QueryListAction {
203
203
  Jump = 2,
204
204
  Init = 3
205
205
  }
206
- interface QueryListRef<Item extends AnyObject = AnyObject, Values = AnyObject, Data = any> {
206
+ interface QueryListRef<Item extends AnyObject = AnyObject, Data = any, Values = AnyObject> {
207
207
  data: Data | undefined;
208
208
  dataSource: Item[] | undefined;
209
209
  form: FormInstance<Values>;
210
210
  }
211
- interface QueryListProps<Item extends AnyObject = AnyObject, Values = AnyObject, Data = any> extends Omit<TableProps<Item>, 'pagination' | 'dataSource' | 'loading' | 'footer'>, Pick<FilterFormWrapperProps, 'buttonsAlign' | 'showReset'> {
211
+ interface QueryListProps<Item extends AnyObject = AnyObject, Data = any, Values = AnyObject> extends Omit<TableProps<Item>, 'pagination' | 'dataSource' | 'loading' | 'footer'>, Pick<FilterFormWrapperProps, 'buttonsAlign' | 'showReset'> {
212
212
  code?: string;
213
213
  url?: string;
214
214
  form?: FormInstance<Values>;
@@ -217,6 +217,7 @@ interface QueryListProps<Item extends AnyObject = AnyObject, Values = AnyObject,
217
217
  onePage?: boolean;
218
218
  defaultSize?: number;
219
219
  body?: FormData | Record<string | number, any> | ((payload: QueryListPayload<Values>) => FormData | Record<string | number, any>);
220
+ pageSizeOptions?: number[];
220
221
  params?: Record<string | number, any> | ((payload: QueryListPayload<Values>) => Record<string | number, any>);
221
222
  tableExtra?: ReactNode | ((form: FormInstance<Values>, data?: Data) => ReactNode);
222
223
  headers?: {
@@ -230,7 +231,7 @@ interface QueryListProps<Item extends AnyObject = AnyObject, Values = AnyObject,
230
231
  getDataSource?: (data: Data | undefined, form: FormInstance<Values>) => Item[] | undefined;
231
232
  footer?: (data: Data | undefined) => ReactNode;
232
233
  }
233
- declare const QueryList: <Item extends AnyObject = AnyObject, Values extends object | undefined = undefined, Data = any>(props: QueryListProps<Item, Values, Data> & {
234
+ declare const QueryList: <Item extends AnyObject = AnyObject, Data = any, Values extends object | undefined = undefined>(props: QueryListProps<Item, Values, Data> & {
234
235
  ref?: Ref<QueryListRef<Item, Values, Data>>;
235
236
  }) => ReactElement;
236
237
 
package/lib/index.js CHANGED
@@ -1328,6 +1328,7 @@ var init_QueryList = __esm({
1328
1328
  getTotal,
1329
1329
  getDataSource,
1330
1330
  footer,
1331
+ pageSizeOptions,
1331
1332
  ...tableProps
1332
1333
  } = internalProps;
1333
1334
  if (!url4) {
@@ -1388,6 +1389,7 @@ var init_QueryList = __esm({
1388
1389
  const dataSource = getDataSource(data, _form);
1389
1390
  const total = getTotal(data);
1390
1391
  const pagination = !onePage && {
1392
+ pageSizeOptions,
1391
1393
  showSizeChanger: true,
1392
1394
  showQuickJumper: true,
1393
1395
  current: page,