react-toolkits 2.14.2 → 2.14.4
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 +12 -0
- package/lib/index.d.ts +4 -7
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
5
5
|
import { FormInstance, MenuProps, SelectProps, ModalProps, FormProps, ButtonProps } from 'antd';
|
|
6
6
|
import { AnyObject } from 'antd/es/_util/type';
|
|
7
7
|
import { TableProps } from 'antd/es/table';
|
|
8
|
-
import { AxiosHeaderValue, AxiosRequestConfig, AxiosInstance, InternalAxiosRequestConfig, AxiosResponse
|
|
8
|
+
import { AxiosHeaderValue, AxiosRequestConfig, AxiosInstance, AxiosInterceptorManager, InternalAxiosRequestConfig, AxiosResponse } from 'axios';
|
|
9
9
|
import * as swr from 'swr';
|
|
10
10
|
import { MutatorCallback, MutatorOptions, Arguments, SWRResponse } from 'swr';
|
|
11
11
|
import { ItemType, SubMenuType, MenuItemGroupType, MenuItemType } from 'antd/es/menu/interface';
|
|
@@ -217,6 +217,7 @@ interface QueryListProps<Item extends AnyObject = AnyObject, Data = any, Values
|
|
|
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?: {
|
|
@@ -376,12 +377,8 @@ interface ContextSlice {
|
|
|
376
377
|
collapsible?: boolean;
|
|
377
378
|
mainPagePath: string;
|
|
378
379
|
interceptors?: {
|
|
379
|
-
request?:
|
|
380
|
-
response?: [
|
|
381
|
-
(response: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>,
|
|
382
|
-
((error: any) => any) | null,
|
|
383
|
-
options?: AxiosInterceptorOptions
|
|
384
|
-
];
|
|
380
|
+
request?: Parameters<AxiosInterceptorManager<InternalAxiosRequestConfig>['use']>;
|
|
381
|
+
response?: Parameters<AxiosInterceptorManager<AxiosResponse>['use']>;
|
|
385
382
|
};
|
|
386
383
|
setContext(state: Partial<Omit<ContextSlice, 'setContext'>>): void;
|
|
387
384
|
}
|
package/lib/index.js
CHANGED
|
@@ -420,7 +420,7 @@ var init_Interceptors = __esm({
|
|
|
420
420
|
const responseType = response.request.responseType || "json";
|
|
421
421
|
if (responseType === "json") {
|
|
422
422
|
const data = response.data;
|
|
423
|
-
if (data.code === 0 || data.code === 200 || data.status === 0 || data.errno === 0) {
|
|
423
|
+
if (data.code === 0 || data.code === 1 || data.code === 200 || data.status === 0 || data.errno === 0) {
|
|
424
424
|
return response;
|
|
425
425
|
} else {
|
|
426
426
|
notification.error({
|
|
@@ -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,
|