wargerm 0.2.20 → 0.2.24
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/README.zh-CN.md +40 -40
- package/dist/components/AutoScroll/index.d.ts +10 -0
- package/dist/components/Breadcrumb/index.d.ts +8 -0
- package/dist/components/Button/index.d.ts +12 -0
- package/dist/components/Card/index.d.ts +12 -0
- package/dist/components/Cascader/index.d.ts +8 -0
- package/dist/components/Checkbox/index.d.ts +9 -0
- package/dist/components/CountUp/index.d.ts +6 -0
- package/dist/components/DatePicker/index.d.ts +7 -0
- package/dist/components/IconFont/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts +10 -0
- package/dist/components/InputNumber/index.d.ts +6 -0
- package/dist/components/Modal/dialog.d.ts +19 -0
- package/dist/components/Modal/index.d.ts +30 -0
- package/dist/components/ModalForm/index.d.ts +9 -0
- package/dist/components/Number/index.d.ts +10 -0
- package/dist/components/NumericInput/index.d.ts +18 -0
- package/dist/components/Radio/index.d.ts +10 -0
- package/dist/components/Select/index.d.ts +14 -0
- package/dist/components/Swiper/index.d.ts +13 -0
- package/dist/components/Switch/index.d.ts +6 -0
- package/dist/components/TabelCard/index.d.ts +3 -0
- package/dist/components/Table/FrameBox/index.d.ts +11 -0
- package/dist/components/Table/index.d.ts +115 -0
- package/dist/components/TreeSelect/index.d.ts +14 -0
- package/dist/components/WDatePicker/index.d.ts +7 -0
- package/dist/components/WForm/index.d.ts +60 -0
- package/dist/hooks/useClickOutside.d.ts +3 -0
- package/dist/hooks/useDebounce.d.ts +2 -0
- package/dist/index.css +1826 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.esm.css +1826 -0
- package/dist/index.esm.js +11497 -0
- package/dist/index.js +11554 -0
- package/dist/utils/index.d.ts +14 -0
- package/package.json +79 -79
package/README.zh-CN.md
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
<!--
|
2
|
-
* @Author: lijin
|
3
|
-
* @Date: 2021-10-18 15:22:28
|
4
|
-
* @LastEditTime: 2021-11-05 09:25:52
|
5
|
-
* @LastEditors: lijin
|
6
|
-
* @Description:
|
7
|
-
* @FilePath: \wargerm\README.zh-CN.md
|
8
|
-
* 可以输入预定的版权声明、个性签名、空行等
|
9
|
-
-->
|
10
|
-
|
11
|
-
## 📒 目录介绍
|
12
|
-
|
13
|
-
```
|
14
|
-
├── docs 文档存放路径
|
15
|
-
│ ├── index.md 首页展示
|
16
|
-
│ └── **.** 网站目录文档
|
17
|
-
├── src 组件主目录
|
18
|
-
│ ├── index.ts 组件注册
|
19
|
-
│ └── Foo 组件开发
|
20
|
-
├── .eslintrc.js eslint 配置
|
21
|
-
├── .fatherrc.ts father 配置
|
22
|
-
├── .umirc.ts dumi 配置
|
23
|
-
└── tsconfig.json typescript 配置
|
24
|
-
```
|
25
|
-
|
26
|
-
其余文件可自行查阅了解。
|
27
|
-
|
28
|
-
## 🤖 命令介绍
|
29
|
-
|
30
|
-
| 名称 | 描述 | 备注 |
|
31
|
-
| ----------------------- | -------------- | ----------------------------- |
|
32
|
-
| `npm run dev` | 项目启动 | - |
|
33
|
-
| `npm run test` | 组件测试 | - |
|
34
|
-
| `npm run test:coverage` | 代码覆盖率查看 | - |
|
35
|
-
| `npm run prettier` | 代码美化 | - |
|
36
|
-
| `npm run build` | 组件打包 | - |
|
37
|
-
| `npm run release` | 组件打包发布 | - |
|
38
|
-
| `npm run docs:build` | 文档打包 | - |
|
39
|
-
| `npm run docs:deploy` | 文档发布 | 这里默认是使用了 GitHub Pages |
|
40
|
-
| `npm run deploy` | 文档打包发布 | - |
|
1
|
+
<!--
|
2
|
+
* @Author: lijin
|
3
|
+
* @Date: 2021-10-18 15:22:28
|
4
|
+
* @LastEditTime: 2021-11-05 09:25:52
|
5
|
+
* @LastEditors: lijin
|
6
|
+
* @Description:
|
7
|
+
* @FilePath: \wargerm\README.zh-CN.md
|
8
|
+
* 可以输入预定的版权声明、个性签名、空行等
|
9
|
+
-->
|
10
|
+
|
11
|
+
## 📒 目录介绍
|
12
|
+
|
13
|
+
```
|
14
|
+
├── docs 文档存放路径
|
15
|
+
│ ├── index.md 首页展示
|
16
|
+
│ └── **.** 网站目录文档
|
17
|
+
├── src 组件主目录
|
18
|
+
│ ├── index.ts 组件注册
|
19
|
+
│ └── Foo 组件开发
|
20
|
+
├── .eslintrc.js eslint 配置
|
21
|
+
├── .fatherrc.ts father 配置
|
22
|
+
├── .umirc.ts dumi 配置
|
23
|
+
└── tsconfig.json typescript 配置
|
24
|
+
```
|
25
|
+
|
26
|
+
其余文件可自行查阅了解。
|
27
|
+
|
28
|
+
## 🤖 命令介绍
|
29
|
+
|
30
|
+
| 名称 | 描述 | 备注 |
|
31
|
+
| ----------------------- | -------------- | ----------------------------- |
|
32
|
+
| `npm run dev` | 项目启动 | - |
|
33
|
+
| `npm run test` | 组件测试 | - |
|
34
|
+
| `npm run test:coverage` | 代码覆盖率查看 | - |
|
35
|
+
| `npm run prettier` | 代码美化 | - |
|
36
|
+
| `npm run build` | 组件打包 | - |
|
37
|
+
| `npm run release` | 组件打包发布 | - |
|
38
|
+
| `npm run docs:build` | 文档打包 | - |
|
39
|
+
| `npm run docs:deploy` | 文档发布 | 这里默认是使用了 GitHub Pages |
|
40
|
+
| `npm run deploy` | 文档打包发布 | - |
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ReactNode, FC, CSSProperties } from 'react';
|
2
|
+
declare type IProps = {
|
3
|
+
list: Array<Record<string, any>>;
|
4
|
+
partSize?: number;
|
5
|
+
style?: CSSProperties;
|
6
|
+
className?: string;
|
7
|
+
render: (record: any, index: number) => ReactNode;
|
8
|
+
};
|
9
|
+
declare const Index: FC<IProps>;
|
10
|
+
export default Index;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { ButtonProps } from 'antd/lib/button';
|
3
|
+
interface IMultiple {
|
4
|
+
handleMenuClick?: (e: any) => void;
|
5
|
+
handleClick?: (e: any) => void;
|
6
|
+
children?: String[];
|
7
|
+
}
|
8
|
+
export interface IButtonProps extends ButtonProps {
|
9
|
+
multiple?: IMultiple;
|
10
|
+
}
|
11
|
+
declare const WButton: FC<IButtonProps>;
|
12
|
+
export default WButton;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { ReactNode } from 'react';
|
3
|
+
declare type Props = {
|
4
|
+
title: ReactNode;
|
5
|
+
className: string;
|
6
|
+
headerTail?: ReactNode;
|
7
|
+
headerCenter?: ReactNode;
|
8
|
+
children?: ReactNode;
|
9
|
+
style?: Record<string, string>;
|
10
|
+
};
|
11
|
+
declare const Index: FC<Props>;
|
12
|
+
export default Index;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { CascaderProps } from 'antd/lib/Cascader';
|
3
|
+
export interface ICascader extends CascaderProps<any> {
|
4
|
+
request?: () => Promise<any>;
|
5
|
+
onLoad?: (options: Record<string, any>[]) => void;
|
6
|
+
}
|
7
|
+
declare const WCascader: FC<ICascader>;
|
8
|
+
export default WCascader;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CheckboxProps, CheckboxGroupProps } from 'antd/lib/Checkbox';
|
3
|
+
export interface ICheckbox extends CheckboxProps {
|
4
|
+
}
|
5
|
+
export declare type IndexComponent = React.FC<ICheckbox> & {
|
6
|
+
Group: React.FC<CheckboxGroupProps>;
|
7
|
+
};
|
8
|
+
declare const Index: IndexComponent;
|
9
|
+
export default Index;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { DatePickerProps, RangePickerProps } from 'antd/lib/date-picker';
|
3
|
+
export declare type IndexComponent = React.FC<DatePickerProps> & {
|
4
|
+
RangePicker: React.FC<RangePickerProps>;
|
5
|
+
};
|
6
|
+
declare const Index: IndexComponent;
|
7
|
+
export default Index;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { InputProps, TextAreaProps } from 'antd/lib/input';
|
3
|
+
export interface IInputProps extends InputProps {
|
4
|
+
}
|
5
|
+
export declare type IndexComponent = React.FC<IInputProps> & {
|
6
|
+
TextArea: React.FC<TextAreaProps>;
|
7
|
+
Button: React.FC<any>;
|
8
|
+
};
|
9
|
+
declare const Index: IndexComponent;
|
10
|
+
export default Index;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React, { ReactNode } from 'react';
|
2
|
+
declare type Props = {
|
3
|
+
title?: string | ReactNode;
|
4
|
+
onOk?: (e: any) => void;
|
5
|
+
onCancel?: (e: any) => void;
|
6
|
+
closeCb?: () => void;
|
7
|
+
footer?: ReactNode | boolean;
|
8
|
+
content?: ReactNode;
|
9
|
+
onClose?: () => void;
|
10
|
+
okText?: string;
|
11
|
+
cancelText?: string;
|
12
|
+
visible?: boolean;
|
13
|
+
width?: number;
|
14
|
+
className?: string;
|
15
|
+
style?: React.CSSProperties;
|
16
|
+
children?: ReactNode;
|
17
|
+
};
|
18
|
+
export default function DialogModel(props: Props): React.ReactPortal;
|
19
|
+
export {};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import React, { ReactNode } from 'react';
|
2
|
+
declare type Props = {
|
3
|
+
title?: string | ReactNode;
|
4
|
+
onOk?: (e: any) => void;
|
5
|
+
onCancel?: (e: any) => void;
|
6
|
+
closeCb?: () => void;
|
7
|
+
footer?: ReactNode | boolean;
|
8
|
+
content?: ReactNode;
|
9
|
+
onClose?: () => void;
|
10
|
+
okText?: string;
|
11
|
+
cancelText?: string;
|
12
|
+
visible?: boolean;
|
13
|
+
width?: number;
|
14
|
+
className?: string;
|
15
|
+
style?: React.CSSProperties;
|
16
|
+
};
|
17
|
+
declare class Modal extends React.PureComponent<Props> {
|
18
|
+
static show: (config: any) => {
|
19
|
+
setShow: null;
|
20
|
+
mounted: boolean;
|
21
|
+
hidden(): void;
|
22
|
+
destory(): void;
|
23
|
+
} | undefined;
|
24
|
+
static hidden: () => void;
|
25
|
+
renderFooter: () => JSX.Element | null;
|
26
|
+
renderTop: () => JSX.Element;
|
27
|
+
renderContent: () => {} | null;
|
28
|
+
render(): JSX.Element;
|
29
|
+
}
|
30
|
+
export default Modal;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React, { MutableRefObject } from 'react';
|
2
|
+
import { FormInstance } from 'antd';
|
3
|
+
export interface IFormInstance extends MutableRefObject<FormInstance> {
|
4
|
+
handleSubmit?: () => void;
|
5
|
+
resetFields?: () => void;
|
6
|
+
setFieldsValue?: (record: Record<string, any>) => void;
|
7
|
+
}
|
8
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Record<string, any>, string> & React.RefAttributes<unknown>>;
|
9
|
+
export default _default;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React, { FC } from 'react';
|
2
|
+
interface countInterface {
|
3
|
+
width: number;
|
4
|
+
height: number;
|
5
|
+
count: number | string;
|
6
|
+
style?: React.CSSProperties;
|
7
|
+
numberStyle?: React.CSSProperties;
|
8
|
+
}
|
9
|
+
declare const Index: FC<countInterface>;
|
10
|
+
export default Index;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
declare type Props = {
|
3
|
+
onChange?: (value: string) => void;
|
4
|
+
onBlur?: () => void;
|
5
|
+
disabled?: boolean;
|
6
|
+
value?: string;
|
7
|
+
placeholder: string;
|
8
|
+
};
|
9
|
+
export default class NumericInput extends React.Component<Props> {
|
10
|
+
onChange: (e: {
|
11
|
+
target: {
|
12
|
+
value: any;
|
13
|
+
};
|
14
|
+
}) => void;
|
15
|
+
onBlur: () => void;
|
16
|
+
render(): JSX.Element;
|
17
|
+
}
|
18
|
+
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RadioProps, RadioGroupProps } from 'antd/lib/Radio';
|
3
|
+
export interface IRadio extends RadioProps {
|
4
|
+
}
|
5
|
+
export declare type IndexComponent = React.FC<IRadio> & {
|
6
|
+
Group: React.FC<RadioGroupProps>;
|
7
|
+
Button: React.FC<any>;
|
8
|
+
};
|
9
|
+
declare const Index: IndexComponent;
|
10
|
+
export default Index;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SelectProps, OptionProps } from 'antd/lib/Select';
|
3
|
+
export interface IOptionProps extends OptionProps {
|
4
|
+
}
|
5
|
+
export interface ISelect extends SelectProps<any> {
|
6
|
+
request?: () => Promise<any>;
|
7
|
+
valueEnum?: Record<string, any>;
|
8
|
+
onLoad?: (options: Record<string, any>[]) => void;
|
9
|
+
}
|
10
|
+
export declare type IWSelectComponent = React.FC<ISelect> & {
|
11
|
+
Option?: React.FC<IOptionProps>;
|
12
|
+
};
|
13
|
+
declare let Index: IWSelectComponent;
|
14
|
+
export default Index;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React, { FC } from 'react';
|
2
|
+
import { Swiper } from 'swiper/react';
|
3
|
+
export interface IProps extends Swiper {
|
4
|
+
data: Array<any>;
|
5
|
+
onClick?: (swiper: any, event: any) => void;
|
6
|
+
onSwiperChange?: (index: any, record: any) => void;
|
7
|
+
renderItem: (item: any, index: number, isActive: boolean) => React.ReactNode;
|
8
|
+
isPreventClick?: boolean;
|
9
|
+
slidesPerView?: number;
|
10
|
+
rowKey?: string;
|
11
|
+
}
|
12
|
+
declare const Index: FC<IProps>;
|
13
|
+
export default Index;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import './index.less';
|
3
|
+
declare type Props = {
|
4
|
+
className?: string;
|
5
|
+
frameStyle?: Record<string, any>;
|
6
|
+
style?: Record<string, any>;
|
7
|
+
children: ReactNode;
|
8
|
+
direction?: 'in' | 'out';
|
9
|
+
};
|
10
|
+
export default function FrameBox({ className, frameStyle, style, direction, children, ...props }: Props): JSX.Element;
|
11
|
+
export {};
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ReactNode } from 'react';
|
3
|
+
import { FormProps } from 'antd';
|
4
|
+
interface ColumnProps {
|
5
|
+
title: string;
|
6
|
+
dataIndex: string;
|
7
|
+
key?: string | number;
|
8
|
+
width?: number;
|
9
|
+
ellipsis?: Boolean;
|
10
|
+
showTitle?: Boolean;
|
11
|
+
copyable?: Boolean;
|
12
|
+
fixed?: 'left' | 'right';
|
13
|
+
hideInTable?: boolean;
|
14
|
+
hideInSearch?: boolean;
|
15
|
+
search?: {
|
16
|
+
transform?: (value: any) => Record<string, any>;
|
17
|
+
};
|
18
|
+
valueType?: 'text' | 'select' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'treeSelect' | 'image';
|
19
|
+
valueEnum?: Record<string, any>;
|
20
|
+
children?: ColumnProps[];
|
21
|
+
fieldProps?: Record<string, any>;
|
22
|
+
formItemProps?: Record<string, any>;
|
23
|
+
order?: number;
|
24
|
+
colSize?: number;
|
25
|
+
initialValue?: any;
|
26
|
+
request?: () => Promise<any>;
|
27
|
+
render?: (text: string, record: Record<string, any>, index: number) => ReactNode;
|
28
|
+
}
|
29
|
+
interface IRowSelection {
|
30
|
+
type: 'checkbox' | 'radio';
|
31
|
+
selectedRowKeys?: Array<string | number>;
|
32
|
+
defaultSelectedRowKeys?: Array<string | number>;
|
33
|
+
/**
|
34
|
+
* 选中项发生变化时的回调
|
35
|
+
*/
|
36
|
+
onChange?: (selectedRowKeys: Array<string | number>, selectedRows: Array<Record<string, any>>) => void;
|
37
|
+
/**
|
38
|
+
* 用户手动选择/取消选择某行的回调
|
39
|
+
*/
|
40
|
+
onSelect?: (record: Record<string, any>, selected: boolean, selectedRows: Record<string, any>[], nativeEvent: MouseEvent) => void;
|
41
|
+
/**
|
42
|
+
* 用户手动选择/取消选择所有行的回调
|
43
|
+
*/
|
44
|
+
onSelectAll?: (selected: boolean, selectedRows: Record<string, any>[], changeRows: Record<string, any>[]) => void;
|
45
|
+
}
|
46
|
+
interface Iscroll {
|
47
|
+
/**
|
48
|
+
* 当分页、排序、筛选变化后是否滚动到表格顶部
|
49
|
+
*/
|
50
|
+
scrollToFirstRowOnChange?: boolean;
|
51
|
+
/**
|
52
|
+
* 设置横向滚动,也可用于指定滚动区域的宽,可以设置为像素值,百分比,true 和 'max-content'
|
53
|
+
*/
|
54
|
+
x?: string | number | true;
|
55
|
+
/**
|
56
|
+
* 设置纵向滚动,也可用于指定滚动区域的高,可以设置为像素值
|
57
|
+
*/
|
58
|
+
y?: string | number;
|
59
|
+
}
|
60
|
+
declare type defaultColConfig = {
|
61
|
+
xs: 24;
|
62
|
+
sm: 24;
|
63
|
+
md: 12;
|
64
|
+
lg: 12;
|
65
|
+
xl: 8;
|
66
|
+
xxl: 6;
|
67
|
+
};
|
68
|
+
interface Isearch {
|
69
|
+
labelWidth?: number | 'auto';
|
70
|
+
span?: number | defaultColConfig;
|
71
|
+
filterType?: 'query' | 'light';
|
72
|
+
searchText?: string;
|
73
|
+
resetText?: string;
|
74
|
+
submitText?: string;
|
75
|
+
optionRender?: ((searchConfig: any, formProps: any, dom: any) => ReactNode[]) | false;
|
76
|
+
}
|
77
|
+
declare type Props = {
|
78
|
+
className?: string;
|
79
|
+
rowClassName?: (record: Record<string, any>, index: number) => string;
|
80
|
+
style?: React.CSSProperties;
|
81
|
+
tbodyStyle?: React.CSSProperties;
|
82
|
+
thStyle?: React.CSSProperties;
|
83
|
+
columns: ColumnProps[];
|
84
|
+
border?: Boolean;
|
85
|
+
params?: Record<string, any>;
|
86
|
+
dataSource?: Record<string, any>[];
|
87
|
+
request?: (params?: {
|
88
|
+
pageSize?: number;
|
89
|
+
current?: number;
|
90
|
+
}, sort?: any, filter?: any) => {
|
91
|
+
data: Record<string, any>[];
|
92
|
+
success: boolean;
|
93
|
+
total: number;
|
94
|
+
};
|
95
|
+
onLoad?: (dataSource: Record<string, any>[]) => void;
|
96
|
+
onSubmit?: (params: Record<string, any>) => void;
|
97
|
+
onReset?: () => void;
|
98
|
+
rowKey: ((record: Record<string, any>) => number | string) | string;
|
99
|
+
onRow?: (record: Record<string, any>, index: any) => Record<string, any>;
|
100
|
+
rowSelection?: IRowSelection;
|
101
|
+
scroll?: Iscroll;
|
102
|
+
pagination?: false | Record<string, any>;
|
103
|
+
children?: ReactNode;
|
104
|
+
form?: FormProps;
|
105
|
+
search?: Isearch | false;
|
106
|
+
frameBoxTable?: boolean;
|
107
|
+
frameBoxDirection?: 'in' | 'out';
|
108
|
+
};
|
109
|
+
declare function Table({ columns, dataSource: tableList, request, onLoad, params, onSubmit, rowKey, onRow, className, rowClassName, rowSelection, style, tbodyStyle, thStyle, border, scroll, pagination, search, frameBoxTable, frameBoxDirection, ...props }: Props): JSX.Element;
|
110
|
+
declare namespace Table {
|
111
|
+
var defaultProps: {
|
112
|
+
rowKey: string;
|
113
|
+
};
|
114
|
+
}
|
115
|
+
export default Table;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TreeSelectProps as Props } from 'antd/lib/tree-select';
|
3
|
+
interface TreeSelectProps<T> extends Props<T> {
|
4
|
+
treeNodeLabelProp?: string;
|
5
|
+
treeNodeValueProp?: string;
|
6
|
+
treeNodeChildrenProp?: string;
|
7
|
+
request?: () => Promise<any>;
|
8
|
+
onLoad?: (options: Record<string, any>[]) => void;
|
9
|
+
}
|
10
|
+
export declare type IndexComponent = React.FC<TreeSelectProps<any>> & {
|
11
|
+
TreeNode?: React.FC<any>;
|
12
|
+
};
|
13
|
+
declare let Index: IndexComponent;
|
14
|
+
export default Index;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { DatePickerProps, RangePickerProps } from 'antd/lib/date-picker';
|
3
|
+
export declare type IndexComponent = React.FC<DatePickerProps> & {
|
4
|
+
RangePicker: React.FC<RangePickerProps>;
|
5
|
+
};
|
6
|
+
declare const Index: IndexComponent;
|
7
|
+
export default Index;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React, { MutableRefObject } from 'react';
|
2
|
+
import { ReactNode } from 'react';
|
3
|
+
import { FormInstance, FormProps } from 'antd';
|
4
|
+
export interface ColumnProps {
|
5
|
+
title: string;
|
6
|
+
dataIndex: string;
|
7
|
+
key?: string | number;
|
8
|
+
width?: number;
|
9
|
+
ellipsis?: Boolean;
|
10
|
+
showTitle?: Boolean;
|
11
|
+
hideInSearch?: boolean;
|
12
|
+
search?: {
|
13
|
+
transform?: (value: any) => Record<string, any>;
|
14
|
+
};
|
15
|
+
valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'cascader' | 'image';
|
16
|
+
valueEnum?: Record<string, any>;
|
17
|
+
options?: Record<string, any>[];
|
18
|
+
fieldProps?: Record<string, any>;
|
19
|
+
formItemProps?: Record<string, any>;
|
20
|
+
order?: number;
|
21
|
+
colSize?: number;
|
22
|
+
initialValue?: any;
|
23
|
+
request?: () => Promise<any>;
|
24
|
+
render?: (text: string, record: Record<string, any>, index: number) => ReactNode;
|
25
|
+
renderFormItem?: (item: any, { formItemProps, fieldProps, ...rest }: any, form: any) => ReactNode;
|
26
|
+
}
|
27
|
+
declare type defaultColConfig = {
|
28
|
+
xs: 24;
|
29
|
+
sm: 24;
|
30
|
+
md: 12;
|
31
|
+
lg: 12;
|
32
|
+
xl: 8;
|
33
|
+
xxl: 6;
|
34
|
+
};
|
35
|
+
export interface Isearch {
|
36
|
+
labelWidth?: number | 'auto';
|
37
|
+
span?: number | defaultColConfig;
|
38
|
+
filterType?: 'query' | 'light';
|
39
|
+
searchText?: string;
|
40
|
+
resetText?: string;
|
41
|
+
submitText?: string;
|
42
|
+
hideSubmit?: boolean;
|
43
|
+
transform?: (value: any) => any;
|
44
|
+
optionRender?: ((searchConfig: any, formProps: any, dom: any) => ReactNode[]) | false;
|
45
|
+
}
|
46
|
+
export interface WFormProps extends FormProps {
|
47
|
+
className?: string;
|
48
|
+
style?: React.CSSProperties;
|
49
|
+
columns: ColumnProps[];
|
50
|
+
extraColumns?: ColumnProps[];
|
51
|
+
disabled?: boolean;
|
52
|
+
disabledHideInSearch?: boolean;
|
53
|
+
onSubmit?: (params: Record<string, any>) => void;
|
54
|
+
onFormChange?: (changedValues: Record<string, any>, allValues: Record<string, any>, form: any) => void;
|
55
|
+
onReset?: () => void;
|
56
|
+
formRef?: MutableRefObject<FormInstance>;
|
57
|
+
search?: Isearch | false;
|
58
|
+
}
|
59
|
+
declare const _default: React.ForwardRefExoticComponent<WFormProps & React.RefAttributes<unknown>>;
|
60
|
+
export default _default;
|