@mi-avalon/libs 0.0.10 → 0.0.11
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/components/index.d.ts +0 -3
- package/dist/libs.cjs.development.js +0 -333
- package/dist/libs.cjs.development.js.map +1 -1
- package/dist/libs.cjs.production.min.js +1 -1
- package/dist/libs.cjs.production.min.js.map +1 -1
- package/dist/libs.esm.js +2 -333
- package/dist/libs.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/MForm/MFormItemConst.d.ts +0 -26
- package/dist/components/MForm/index.d.ts +0 -10
- package/dist/components/MForm/type.d.ts +0 -178
- package/dist/components/MSearch/index.d.ts +0 -27
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IMFormCascaderItem, IMFormCheckBoxGroupItem, IMFormDatePickerItem, IMFormInputItem, IMFormInputNumItem, IMFormItem, IMFormMentionsItem, IMFormRadioGroupItem, IMFormRangePickerItem, IMFormSelectItem, IMFormTextItem, IMFormTreeSelectItem, IMFormUploadItem } from './type';
|
|
3
|
-
export declare class MFormItemConst {
|
|
4
|
-
static readonly labelCol: {
|
|
5
|
-
span: number;
|
|
6
|
-
};
|
|
7
|
-
static readonly wrapperCol: {
|
|
8
|
-
span: number;
|
|
9
|
-
};
|
|
10
|
-
static readonly defaultRowGutter = 24;
|
|
11
|
-
static getDefaultArrayPlaceholder(item: IMFormItem): [string, string];
|
|
12
|
-
static getDefaultPlaceholder(item: IMFormItem): string;
|
|
13
|
-
static input: (item: IMFormInputItem) => React.JSX.Element;
|
|
14
|
-
static password: (item: IMFormInputItem) => React.JSX.Element;
|
|
15
|
-
static text: (item: IMFormTextItem) => React.JSX.Element;
|
|
16
|
-
static inputNumber: (item: IMFormInputNumItem) => React.JSX.Element;
|
|
17
|
-
static datePicker: (item: IMFormDatePickerItem) => React.JSX.Element;
|
|
18
|
-
static rangePicker: (item: IMFormRangePickerItem) => React.JSX.Element;
|
|
19
|
-
static select: (item: IMFormSelectItem) => React.JSX.Element;
|
|
20
|
-
static radio: (item: IMFormRadioGroupItem) => React.JSX.Element;
|
|
21
|
-
static checkbox: (item: IMFormCheckBoxGroupItem) => React.JSX.Element;
|
|
22
|
-
static upload: (item: IMFormUploadItem) => React.JSX.Element;
|
|
23
|
-
static mentions: (item: IMFormMentionsItem) => React.JSX.Element;
|
|
24
|
-
static cascader: (item: IMFormCascaderItem) => React.JSX.Element;
|
|
25
|
-
static treeSelect: (item: IMFormTreeSelectItem) => React.JSX.Element;
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
import { IMFormProps } from './type';
|
|
4
|
-
declare function MForm(props: IMFormProps): React.JSX.Element;
|
|
5
|
-
declare namespace MForm {
|
|
6
|
-
var displayName: string;
|
|
7
|
-
}
|
|
8
|
-
export default MForm;
|
|
9
|
-
export * from './MFormItemConst';
|
|
10
|
-
export * from './type';
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { CascaderAutoProps, Checkbox, DatePicker, FormInstance, FormItemProps, FormProps, FormRule, Input, InputNumberProps, InputProps, MentionsProps, RadioGroupProps, RowProps, SelectProps, TreeSelectProps, UploadProps } from 'antd';
|
|
2
|
-
import { ReactElement } from 'react';
|
|
3
|
-
declare type CheckboxGroupProps = React.ComponentProps<typeof Checkbox.Group>;
|
|
4
|
-
declare type RangePickerProps = React.ComponentProps<typeof DatePicker.RangePicker>;
|
|
5
|
-
declare type DatePickerProps = React.ComponentProps<typeof DatePicker>;
|
|
6
|
-
declare type TextAreaProps = React.ComponentProps<typeof Input.TextArea>;
|
|
7
|
-
export declare enum MFormItemTypeEnum {
|
|
8
|
-
Input = "input",
|
|
9
|
-
InputNumber = "inputNumber",
|
|
10
|
-
Text = "text",
|
|
11
|
-
Password = "password",
|
|
12
|
-
Radio = "radio",
|
|
13
|
-
Select = "select",
|
|
14
|
-
Checkbox = "checkbox",
|
|
15
|
-
DatePicker = "datePicker",
|
|
16
|
-
RangePicker = "rangePicker",
|
|
17
|
-
Upload = "upload",
|
|
18
|
-
Mentions = "mentions",
|
|
19
|
-
Cascader = "cascader",
|
|
20
|
-
TreeSelect = "treeSelect"
|
|
21
|
-
}
|
|
22
|
-
export declare type MFormItemLayout = {
|
|
23
|
-
span?: number;
|
|
24
|
-
offset?: number;
|
|
25
|
-
};
|
|
26
|
-
export interface IMFormProps {
|
|
27
|
-
/**
|
|
28
|
-
* 一行显示几个label 默认1个, 其他:2, 3, 4
|
|
29
|
-
*/
|
|
30
|
-
column?: 1 | 2 | 3 | 4;
|
|
31
|
-
/**
|
|
32
|
-
* 需要的数据: [ { label: ...,id: ..., required: ..., type: ..., ... }, ... ]
|
|
33
|
-
*/
|
|
34
|
-
formItems: IMFormItem[];
|
|
35
|
-
/**
|
|
36
|
-
* Antd const [form] = useForm()
|
|
37
|
-
*/
|
|
38
|
-
form?: FormInstance;
|
|
39
|
-
/**
|
|
40
|
-
* 表单其他属性
|
|
41
|
-
*/
|
|
42
|
-
formProps?: FormProps;
|
|
43
|
-
/**
|
|
44
|
-
* 全局 MFormItem layout, 默认为 {labelCol:{span: 7}, wrapperCol: {span: 7}}
|
|
45
|
-
* @type {{labelCol: MFormItemLayout, wrapperCol: MFormItemLayout}}
|
|
46
|
-
* @memberof MFormItem
|
|
47
|
-
*/
|
|
48
|
-
itemLayout?: {
|
|
49
|
-
labelCol?: MFormItemLayout;
|
|
50
|
-
wrapperCol?: MFormItemLayout;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Antd Row 的其他属性
|
|
54
|
-
*/
|
|
55
|
-
formRowProps?: RowProps;
|
|
56
|
-
}
|
|
57
|
-
export interface IMFormBaseItem {
|
|
58
|
-
/**
|
|
59
|
-
* 属性名
|
|
60
|
-
*/
|
|
61
|
-
id: string;
|
|
62
|
-
/**
|
|
63
|
-
* label名称
|
|
64
|
-
*/
|
|
65
|
-
label: string;
|
|
66
|
-
/**
|
|
67
|
-
* 组件是否禁用
|
|
68
|
-
*/
|
|
69
|
-
disabled?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* form类型 FORM_TYPE
|
|
72
|
-
*/
|
|
73
|
-
type?: MFormItemTypeEnum;
|
|
74
|
-
/**
|
|
75
|
-
* 初始值
|
|
76
|
-
*/
|
|
77
|
-
initialValue?: any;
|
|
78
|
-
/**
|
|
79
|
-
* rules required的验证消息, 不填写则不验证
|
|
80
|
-
*/
|
|
81
|
-
required?: string;
|
|
82
|
-
/**
|
|
83
|
-
* rule-max, 正则,验证消息
|
|
84
|
-
*/
|
|
85
|
-
rules?: FormRule[];
|
|
86
|
-
/**
|
|
87
|
-
* 自定义form
|
|
88
|
-
*/
|
|
89
|
-
render?: (form?: FormInstance) => ReactElement;
|
|
90
|
-
/**
|
|
91
|
-
* Antd MForm.Item 的其他属性
|
|
92
|
-
*/
|
|
93
|
-
formItemProps?: FormItemProps;
|
|
94
|
-
/**
|
|
95
|
-
* MFormItem layout, 默认为 {labelCol:{span: 7}, wrapperCol: {span: 7}}
|
|
96
|
-
* @type {{labelCol: MFormItemLayout, wrapperCol: MFormItemLayout}}
|
|
97
|
-
* @memberof MFormItem
|
|
98
|
-
*/
|
|
99
|
-
itemLayout?: {
|
|
100
|
-
labelCol?: MFormItemLayout;
|
|
101
|
-
wrapperCol?: MFormItemLayout;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* 当前表单占据行的宽度 1-24 默认 24 / column
|
|
105
|
-
*/
|
|
106
|
-
span?: number;
|
|
107
|
-
/**
|
|
108
|
-
* 是否显示当前组件 默认显示
|
|
109
|
-
*/
|
|
110
|
-
show?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* item组件的其他属性
|
|
113
|
-
*/
|
|
114
|
-
props?: any;
|
|
115
|
-
}
|
|
116
|
-
export interface IMFormInputItem extends IMFormBaseItem {
|
|
117
|
-
type: MFormItemTypeEnum.Input | MFormItemTypeEnum.Password;
|
|
118
|
-
props?: InputProps;
|
|
119
|
-
placeholder?: string;
|
|
120
|
-
maxLength?: number;
|
|
121
|
-
}
|
|
122
|
-
export interface IMFormInputNumItem extends IMFormBaseItem {
|
|
123
|
-
type: MFormItemTypeEnum.InputNumber;
|
|
124
|
-
props?: InputNumberProps;
|
|
125
|
-
placeholder?: string;
|
|
126
|
-
maxLength?: number;
|
|
127
|
-
}
|
|
128
|
-
export interface IMFormTextItem extends IMFormBaseItem {
|
|
129
|
-
type: MFormItemTypeEnum.Text;
|
|
130
|
-
props?: TextAreaProps;
|
|
131
|
-
placeholder?: string;
|
|
132
|
-
maxLength?: number;
|
|
133
|
-
}
|
|
134
|
-
export interface IMFormRadioGroupItem extends IMFormBaseItem {
|
|
135
|
-
type: MFormItemTypeEnum.Radio;
|
|
136
|
-
props?: RadioGroupProps;
|
|
137
|
-
}
|
|
138
|
-
export interface IMFormCheckBoxGroupItem extends IMFormBaseItem {
|
|
139
|
-
type: MFormItemTypeEnum.Checkbox;
|
|
140
|
-
props?: CheckboxGroupProps;
|
|
141
|
-
}
|
|
142
|
-
export interface IMFormSelectItem<T = any> extends IMFormBaseItem {
|
|
143
|
-
type: MFormItemTypeEnum.Select;
|
|
144
|
-
placeholder?: string;
|
|
145
|
-
props?: SelectProps<T>;
|
|
146
|
-
}
|
|
147
|
-
export interface IMFormDatePickerItem extends IMFormBaseItem {
|
|
148
|
-
type: MFormItemTypeEnum.DatePicker;
|
|
149
|
-
placeholder?: string;
|
|
150
|
-
props?: DatePickerProps;
|
|
151
|
-
}
|
|
152
|
-
export interface IMFormRangePickerItem extends IMFormBaseItem {
|
|
153
|
-
type: MFormItemTypeEnum.RangePicker;
|
|
154
|
-
placeholder?: [string, string];
|
|
155
|
-
props?: RangePickerProps;
|
|
156
|
-
}
|
|
157
|
-
export interface IMFormUploadItem extends IMFormBaseItem {
|
|
158
|
-
type: MFormItemTypeEnum.Upload;
|
|
159
|
-
children?: ReactElement;
|
|
160
|
-
props?: UploadProps;
|
|
161
|
-
}
|
|
162
|
-
export interface IMFormMentionsItem extends IMFormBaseItem {
|
|
163
|
-
type: MFormItemTypeEnum.Mentions;
|
|
164
|
-
placeholder?: string;
|
|
165
|
-
props?: MentionsProps;
|
|
166
|
-
}
|
|
167
|
-
export interface IMFormCascaderItem extends IMFormBaseItem {
|
|
168
|
-
type: MFormItemTypeEnum.Cascader;
|
|
169
|
-
placeholder?: string;
|
|
170
|
-
props?: CascaderAutoProps;
|
|
171
|
-
}
|
|
172
|
-
export interface IMFormTreeSelectItem extends IMFormBaseItem {
|
|
173
|
-
type: MFormItemTypeEnum.TreeSelect;
|
|
174
|
-
placeholder?: string;
|
|
175
|
-
props?: TreeSelectProps;
|
|
176
|
-
}
|
|
177
|
-
export declare type IMFormItem = IMFormInputItem | IMFormInputNumItem | IMFormSelectItem | IMFormCheckBoxGroupItem | IMFormRadioGroupItem | IMFormTextItem | IMFormDatePickerItem | IMFormRangePickerItem | IMFormUploadItem | IMFormMentionsItem | IMFormCascaderItem | IMFormTreeSelectItem;
|
|
178
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from 'antd';
|
|
2
|
-
import { FormInstance } from 'antd/lib';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { IMFormItem } from '../MForm';
|
|
5
|
-
import './index.scss';
|
|
6
|
-
export interface IMSearchProps {
|
|
7
|
-
form?: FormInstance;
|
|
8
|
-
/**
|
|
9
|
-
* 需要的数据: [ { lable: ...,id: ..., required: ..., type: ..., }, ... ]
|
|
10
|
-
*/
|
|
11
|
-
searchItems: IMFormItem[];
|
|
12
|
-
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 搜索按钮 params返回form表单的数据
|
|
15
|
-
*/
|
|
16
|
-
onSearch?: (params: any, isReset: boolean) => any;
|
|
17
|
-
/**
|
|
18
|
-
* 搜索项默认展开,不填写默认false
|
|
19
|
-
*/
|
|
20
|
-
defaultShowAll?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 自定义按钮
|
|
23
|
-
*/
|
|
24
|
-
customButtons?: ButtonProps[];
|
|
25
|
-
}
|
|
26
|
-
declare const MSearch: React.FC<IMSearchProps>;
|
|
27
|
-
export default MSearch;
|