@xto/form 1.6.8 → 1.7.0
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/es/AutoComplete/index.d.ts +29 -0
- package/es/AutoComplete/index.vue.d.ts +70 -0
- package/es/Cascader/index.d.ts +40 -0
- package/es/Cascader/index.vue.d.ts +58 -0
- package/es/Checkbox/group.vue.d.ts +34 -0
- package/es/Checkbox/index.d.ts +49 -0
- package/es/Checkbox/index.vue.d.ts +31 -0
- package/es/Checkbox/types.d.ts +106 -0
- package/es/ColorPicker/index.d.ts +15 -0
- package/es/ColorPicker/index.vue.d.ts +29 -0
- package/es/DatePicker/components/DateTable.vue.d.ts +36 -0
- package/es/DatePicker/components/MonthTable.vue.d.ts +14 -0
- package/es/DatePicker/components/YearTable.vue.d.ts +14 -0
- package/es/DatePicker/index.d.ts +35 -0
- package/es/DatePicker/index.vue.d.ts +57 -0
- package/es/DatePicker/types.d.ts +112 -0
- package/es/DatePicker/utils.d.ts +21 -0
- package/es/DynamicFields/index.d.ts +2 -0
- package/es/DynamicFields/index.vue.d.ts +52 -0
- package/es/DynamicFields/types.d.ts +36 -0
- package/es/Form/index.d.ts +77 -0
- package/es/Form/index.vue.d.ts +64 -0
- package/es/Form/item.vue.d.ts +31 -0
- package/es/Form/types.d.ts +239 -0
- package/es/Form/validators.d.ts +60 -0
- package/es/Input/index.d.ts +29 -0
- package/es/Input/index.vue.d.ts +70 -0
- package/es/Input/types.d.ts +97 -0
- package/es/InputNumber/index.vue.d.ts +57 -0
- package/es/InputNumber/types.d.ts +83 -0
- package/es/Mention/index.d.ts +27 -0
- package/es/Mention/index.vue.d.ts +45 -0
- package/es/Radio/button.vue.d.ts +29 -0
- package/es/Radio/group.vue.d.ts +35 -0
- package/es/Radio/index.d.ts +61 -0
- package/es/Radio/index.vue.d.ts +30 -0
- package/es/Radio/types.d.ts +83 -0
- package/es/Rate/index.d.ts +41 -0
- package/es/Rate/index.vue.d.ts +49 -0
- package/es/Rate/types.d.ts +71 -0
- package/es/RichEditor/index.d.ts +19 -0
- package/es/RichEditor/index.vue.d.ts +41 -0
- package/es/Segmented/index.d.ts +20 -0
- package/es/Segmented/index.vue.d.ts +52 -0
- package/es/Select/Option.vue.d.ts +9 -0
- package/es/Select/index.d.ts +48 -0
- package/es/Select/index.vue.d.ts +93 -0
- package/es/Select/types.d.ts +137 -0
- package/es/Select/utils.d.ts +8 -0
- package/es/Slider/index.d.ts +52 -0
- package/es/Slider/index.vue.d.ts +39 -0
- package/es/Slider/types.d.ts +77 -0
- package/es/Switch/index.d.ts +16 -0
- package/es/Switch/index.vue.d.ts +44 -0
- package/es/Switch/types.d.ts +69 -0
- package/es/Textarea/index.d.ts +48 -0
- package/es/Textarea/index.vue.d.ts +51 -0
- package/es/Textarea/types.d.ts +91 -0
- package/es/TimePicker/components/TimePanel.vue.d.ts +28 -0
- package/es/TimePicker/index.d.ts +39 -0
- package/es/TimePicker/index.vue.d.ts +57 -0
- package/es/TimePicker/types.d.ts +117 -0
- package/es/TimePicker/utils.d.ts +10 -0
- package/es/Transfer/index.d.ts +58 -0
- package/es/Transfer/index.vue.d.ts +62 -0
- package/es/Transfer/types.d.ts +117 -0
- package/es/Upload/index.d.ts +110 -0
- package/es/Upload/index.vue.d.ts +140 -0
- package/es/Upload/types.d.ts +238 -0
- package/es/index.d.ts +41 -0
- package/es/index.mjs +504 -497
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Upload 文件状态
|
|
6
|
+
*/
|
|
7
|
+
export type UploadStatus = 'ready' | 'uploading' | 'success' | 'error';
|
|
8
|
+
/**
|
|
9
|
+
* Upload 文件列表类型
|
|
10
|
+
*/
|
|
11
|
+
export type UploadListType = 'text' | 'picture' | 'picture-card';
|
|
12
|
+
/**
|
|
13
|
+
* Upload 文件对象
|
|
14
|
+
*/
|
|
15
|
+
export interface UploadFile {
|
|
16
|
+
/**
|
|
17
|
+
* 文件名
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* 文件大小
|
|
22
|
+
*/
|
|
23
|
+
size?: number;
|
|
24
|
+
/**
|
|
25
|
+
* 文件 URL
|
|
26
|
+
*/
|
|
27
|
+
url?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 上传状态
|
|
30
|
+
*/
|
|
31
|
+
status?: UploadStatus;
|
|
32
|
+
/**
|
|
33
|
+
* 上传进度
|
|
34
|
+
*/
|
|
35
|
+
percentage?: number;
|
|
36
|
+
/**
|
|
37
|
+
* 文件唯一标识
|
|
38
|
+
*/
|
|
39
|
+
uid?: number | string;
|
|
40
|
+
/**
|
|
41
|
+
* 原始文件对象
|
|
42
|
+
*/
|
|
43
|
+
raw?: File;
|
|
44
|
+
/**
|
|
45
|
+
* 上传响应
|
|
46
|
+
*/
|
|
47
|
+
response?: any;
|
|
48
|
+
/**
|
|
49
|
+
* 缩略图 URL
|
|
50
|
+
*/
|
|
51
|
+
thumbUrl?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Upload HTTP 请求选项
|
|
55
|
+
*/
|
|
56
|
+
export interface UploadRequestOptions {
|
|
57
|
+
/**
|
|
58
|
+
* 上传地址
|
|
59
|
+
*/
|
|
60
|
+
action: string;
|
|
61
|
+
/**
|
|
62
|
+
* 请求头
|
|
63
|
+
*/
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
/**
|
|
66
|
+
* 附带数据
|
|
67
|
+
*/
|
|
68
|
+
data?: Record<string, any>;
|
|
69
|
+
/**
|
|
70
|
+
* 文件对象
|
|
71
|
+
*/
|
|
72
|
+
file: File;
|
|
73
|
+
/**
|
|
74
|
+
* 文件字段名
|
|
75
|
+
*/
|
|
76
|
+
name: string;
|
|
77
|
+
/**
|
|
78
|
+
* 是否携带凭证
|
|
79
|
+
*/
|
|
80
|
+
withCredentials?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 进度回调
|
|
83
|
+
*/
|
|
84
|
+
onProgress?: (e: {
|
|
85
|
+
percent: number;
|
|
86
|
+
}) => void;
|
|
87
|
+
/**
|
|
88
|
+
* 成功回调
|
|
89
|
+
*/
|
|
90
|
+
onSuccess?: (response: any) => void;
|
|
91
|
+
/**
|
|
92
|
+
* 错误回调
|
|
93
|
+
*/
|
|
94
|
+
onError?: (error: Error) => void;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Upload Props
|
|
98
|
+
*/
|
|
99
|
+
export interface UploadProps {
|
|
100
|
+
/**
|
|
101
|
+
* 上传地址
|
|
102
|
+
* @default '#'
|
|
103
|
+
*/
|
|
104
|
+
action?: string;
|
|
105
|
+
/**
|
|
106
|
+
* 请求头
|
|
107
|
+
*/
|
|
108
|
+
headers?: Record<string, string>;
|
|
109
|
+
/**
|
|
110
|
+
* 附带数据
|
|
111
|
+
*/
|
|
112
|
+
data?: Record<string, any>;
|
|
113
|
+
/**
|
|
114
|
+
* 是否支持多选
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
multiple?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* 接受的文件类型
|
|
120
|
+
*/
|
|
121
|
+
accept?: string;
|
|
122
|
+
/**
|
|
123
|
+
* 最大上传数量
|
|
124
|
+
*/
|
|
125
|
+
limit?: number;
|
|
126
|
+
/**
|
|
127
|
+
* 是否禁用
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
disabled?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* 是否拖拽上传
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
drag?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* 文件列表类型
|
|
138
|
+
* @default 'text'
|
|
139
|
+
*/
|
|
140
|
+
listType?: UploadListType;
|
|
141
|
+
/**
|
|
142
|
+
* 是否自动上传
|
|
143
|
+
* @default true
|
|
144
|
+
*/
|
|
145
|
+
autoUpload?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 默认文件列表
|
|
148
|
+
*/
|
|
149
|
+
fileList?: UploadFile[];
|
|
150
|
+
/**
|
|
151
|
+
* 是否显示文件列表
|
|
152
|
+
* @default true
|
|
153
|
+
*/
|
|
154
|
+
showFileList?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* 是否携带凭证
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
withCredentials?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* 文件字段名
|
|
162
|
+
* @default 'file'
|
|
163
|
+
*/
|
|
164
|
+
name?: string;
|
|
165
|
+
/**
|
|
166
|
+
* 自定义上传方法
|
|
167
|
+
*/
|
|
168
|
+
httpRequest?: (options: UploadRequestOptions) => Promise<any>;
|
|
169
|
+
/**
|
|
170
|
+
* 上传前钩子
|
|
171
|
+
*/
|
|
172
|
+
beforeUpload?: (file: File, fileList: File[]) => boolean | Promise<boolean>;
|
|
173
|
+
/**
|
|
174
|
+
* 删除前钩子
|
|
175
|
+
*/
|
|
176
|
+
beforeRemove?: (file: UploadFile, fileList: UploadFile[]) => boolean;
|
|
177
|
+
/**
|
|
178
|
+
* 上传成功钩子
|
|
179
|
+
*/
|
|
180
|
+
onSuccess?: (response: any, file: UploadFile, fileList: UploadFile[]) => void;
|
|
181
|
+
/**
|
|
182
|
+
* 上传失败钩子
|
|
183
|
+
*/
|
|
184
|
+
onError?: (error: Error, file: UploadFile, fileList: UploadFile[]) => void;
|
|
185
|
+
/**
|
|
186
|
+
* 上传进度钩子
|
|
187
|
+
*/
|
|
188
|
+
onProgress?: (event: {
|
|
189
|
+
percent: number;
|
|
190
|
+
}, file: UploadFile, fileList: UploadFile[]) => void;
|
|
191
|
+
/**
|
|
192
|
+
* 文件状态改变钩子
|
|
193
|
+
*/
|
|
194
|
+
onChange?: (file: UploadFile, fileList: UploadFile[]) => void;
|
|
195
|
+
/**
|
|
196
|
+
* 文件删除钩子
|
|
197
|
+
*/
|
|
198
|
+
onRemove?: (file: UploadFile, fileList: UploadFile[]) => void;
|
|
199
|
+
/**
|
|
200
|
+
* 超出限制钩子
|
|
201
|
+
*/
|
|
202
|
+
onExceed?: (files: File[], fileList: UploadFile[]) => void;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Upload Emits
|
|
206
|
+
*/
|
|
207
|
+
export interface UploadEmits {
|
|
208
|
+
(e: 'update:fileList', fileList: UploadFile[]): void;
|
|
209
|
+
(e: 'success', response: any, file: UploadFile, fileList: UploadFile[]): void;
|
|
210
|
+
(e: 'error', error: Error, file: UploadFile, fileList: UploadFile[]): void;
|
|
211
|
+
(e: 'progress', event: {
|
|
212
|
+
percent: number;
|
|
213
|
+
}, file: UploadFile, fileList: UploadFile[]): void;
|
|
214
|
+
(e: 'change', file: UploadFile, fileList: UploadFile[]): void;
|
|
215
|
+
(e: 'remove', file: UploadFile, fileList: UploadFile[]): void;
|
|
216
|
+
(e: 'exceed', files: File[], fileList: UploadFile[]): void;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Upload Expose
|
|
220
|
+
*/
|
|
221
|
+
export interface UploadExpose {
|
|
222
|
+
/**
|
|
223
|
+
* 手动上传
|
|
224
|
+
*/
|
|
225
|
+
submit: () => void;
|
|
226
|
+
/**
|
|
227
|
+
* 清空文件列表
|
|
228
|
+
*/
|
|
229
|
+
clearFiles: () => void;
|
|
230
|
+
/**
|
|
231
|
+
* 文件列表
|
|
232
|
+
*/
|
|
233
|
+
uploadFiles: UploadFile[];
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Upload 组件实例类型
|
|
237
|
+
*/
|
|
238
|
+
export type UploadInstance = InstanceType<typeof import('./index.vue').default>;
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export { default as Input } from './Input/index.vue';
|
|
2
|
+
export { default as InputNumber } from './InputNumber/index.vue';
|
|
3
|
+
export { default as Textarea } from './Textarea/index.vue';
|
|
4
|
+
export { default as Switch } from './Switch/index.vue';
|
|
5
|
+
export { Radio, RadioGroup, RadioButton } from './Radio';
|
|
6
|
+
export { Checkbox, CheckboxGroup } from './Checkbox';
|
|
7
|
+
export { Form, FormItem } from './Form';
|
|
8
|
+
export { default as DatePicker } from './DatePicker/index.vue';
|
|
9
|
+
export { default as TimePicker } from './TimePicker/index.vue';
|
|
10
|
+
export { Select, SelectOption } from './Select';
|
|
11
|
+
export { default as Transfer } from './Transfer/index.vue';
|
|
12
|
+
export { default as Slider } from './Slider/index.vue';
|
|
13
|
+
export { default as Upload } from './Upload/index.vue';
|
|
14
|
+
export { default as Rate } from './Rate/index.vue';
|
|
15
|
+
export { default as DynamicFields } from './DynamicFields/index.vue';
|
|
16
|
+
export { default as RichEditor } from './RichEditor/index.vue';
|
|
17
|
+
export { default as Cascader } from './Cascader/index.vue';
|
|
18
|
+
export { default as ColorPicker } from './ColorPicker/index.vue';
|
|
19
|
+
export { default as AutoComplete } from './AutoComplete/index.vue';
|
|
20
|
+
export { default as Segmented } from './Segmented/index.vue';
|
|
21
|
+
export { default as Mention } from './Mention/index.vue';
|
|
22
|
+
export type { InputProps } from './Input';
|
|
23
|
+
export type { TextareaProps } from './Textarea';
|
|
24
|
+
export type { RadioProps, RadioGroupProps, RadioButtonProps } from './Radio';
|
|
25
|
+
export type { CheckboxProps, CheckboxGroupProps } from './Checkbox';
|
|
26
|
+
export type { FormProps, FormItemProps, FormRule } from './Form';
|
|
27
|
+
export type { SwitchProps } from './Switch';
|
|
28
|
+
export type { DatePickerProps, DatePickerType } from './DatePicker';
|
|
29
|
+
export type { TimePickerProps, TimePickerType } from './TimePicker';
|
|
30
|
+
export type { SelectProps, SelectType, SelectOption } from './Select';
|
|
31
|
+
export type { TransferProps, TransferOption } from './Transfer';
|
|
32
|
+
export type { SliderProps } from './Slider';
|
|
33
|
+
export type { UploadProps, UploadFile } from './Upload';
|
|
34
|
+
export type { RateProps } from './Rate';
|
|
35
|
+
export type { DynamicField, DynamicFieldsProps, DynamicFieldsEmits } from './DynamicFields';
|
|
36
|
+
export type { RichEditorProps } from './RichEditor';
|
|
37
|
+
export type { CascaderOption, CascaderProps, CascaderComponentProps } from './Cascader';
|
|
38
|
+
export type { ColorPickerProps } from './ColorPicker';
|
|
39
|
+
export type { AutoCompleteSuggestion, AutoCompleteProps } from './AutoComplete';
|
|
40
|
+
export type { SegmentedOption, SegmentedProps } from './Segmented';
|
|
41
|
+
export type { MentionOption, MentionProps } from './Mention';
|