@faasjs/ant-design 0.0.2-beta.451 → 0.0.2-beta.453
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/index.d.ts +84 -47
- package/dist/index.js +210 -252
- package/dist/index.mjs +212 -247
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { Drawer, Modal } from 'antd';
|
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { CSSProperties, ReactNode, LazyExoticComponent, ComponentType } from 'react';
|
|
7
7
|
import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/lib/config-provider';
|
|
8
|
+
import * as antd_es_button from 'antd/es/button';
|
|
9
|
+
import * as rc_picker_lib_Picker from 'rc-picker/lib/Picker';
|
|
8
10
|
import * as antd_es_date_picker_generatePicker_interface from 'antd/es/date-picker/generatePicker/interface';
|
|
9
11
|
import * as antd_es_date_picker_generatePicker from 'antd/es/date-picker/generatePicker';
|
|
10
12
|
import { PickerDateProps, PickerTimeProps } from 'antd/es/date-picker/generatePicker';
|
|
@@ -14,7 +16,7 @@ import { RuleObject } from 'rc-field-form/lib/interface';
|
|
|
14
16
|
import { RouteProps } from 'react-router-dom';
|
|
15
17
|
import { FilterValue, SorterResult, TableCurrentDataSource } from 'antd/lib/table/interface';
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
type BlankProps = {
|
|
18
20
|
value?: any;
|
|
19
21
|
text?: string;
|
|
20
22
|
};
|
|
@@ -32,10 +34,10 @@ declare type BlankProps = {
|
|
|
32
34
|
*/
|
|
33
35
|
declare function Blank(options?: BlankProps): JSX.Element;
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
type CalendarProps = CalendarProps$1<Dayjs>;
|
|
36
38
|
declare const Calendar: (props: antd_es_calendar_generateCalendar_js.CalendarProps<Dayjs>) => JSX.Element;
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
type ConfigProviderProps = {
|
|
39
41
|
antd?: ConfigProviderProps$1;
|
|
40
42
|
lang?: string;
|
|
41
43
|
common?: {
|
|
@@ -88,9 +90,9 @@ declare function ConfigProvider({ config, children }: {
|
|
|
88
90
|
}): JSX.Element;
|
|
89
91
|
declare function useConfigContext(): ConfigProviderProps;
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
type FaasItemType = 'string' | 'string[]' | 'number' | 'number[]' | 'boolean' | 'date' | 'time' | 'object' | 'object[]';
|
|
92
94
|
/** FaasItemType's value type */
|
|
93
|
-
|
|
95
|
+
type FaasItemTypeValue = {
|
|
94
96
|
string: string;
|
|
95
97
|
'string[]': string[];
|
|
96
98
|
number: number;
|
|
@@ -101,16 +103,16 @@ declare type FaasItemTypeValue = {
|
|
|
101
103
|
object: any;
|
|
102
104
|
'object[]': any[];
|
|
103
105
|
};
|
|
104
|
-
|
|
106
|
+
type BaseOption = string | number | {
|
|
105
107
|
label: string;
|
|
106
108
|
value?: string | number;
|
|
107
109
|
};
|
|
108
|
-
|
|
110
|
+
type BaseItemProps = {
|
|
109
111
|
id: string;
|
|
110
112
|
title?: string;
|
|
111
113
|
options?: BaseOption[];
|
|
112
114
|
};
|
|
113
|
-
|
|
115
|
+
type FaasItemProps = BaseItemProps & {
|
|
114
116
|
/**
|
|
115
117
|
* Support string, string[], number, number[], boolean
|
|
116
118
|
* @default 'string'
|
|
@@ -123,33 +125,68 @@ declare function transferOptions(options: BaseOption[]): {
|
|
|
123
125
|
}[];
|
|
124
126
|
declare function transferValue(type: FaasItemType, value: any): any;
|
|
125
127
|
|
|
126
|
-
|
|
128
|
+
type DatePickerProps = PickerDateProps<Dayjs>;
|
|
127
129
|
declare const DatePicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<antd_es_date_picker_generatePicker.PickerProps<Dayjs> & {
|
|
128
130
|
status?: "" | "warning" | "error";
|
|
129
131
|
dropdownClassName?: string;
|
|
130
132
|
popupClassName?: string;
|
|
131
133
|
}, unknown> & {
|
|
132
|
-
WeekPicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<Omit<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
WeekPicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<Omit<antd_es_date_picker_generatePicker.PickerProps<Dayjs> & {
|
|
135
|
+
status?: "" | "warning" | "error";
|
|
136
|
+
dropdownClassName?: string;
|
|
137
|
+
popupClassName?: string;
|
|
138
|
+
}, "picker">, unknown>;
|
|
139
|
+
MonthPicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<Omit<antd_es_date_picker_generatePicker.PickerProps<Dayjs> & {
|
|
140
|
+
status?: "" | "warning" | "error";
|
|
141
|
+
dropdownClassName?: string;
|
|
142
|
+
popupClassName?: string;
|
|
143
|
+
}, "picker">, unknown>;
|
|
144
|
+
YearPicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<Omit<antd_es_date_picker_generatePicker.PickerProps<Dayjs> & {
|
|
145
|
+
status?: "" | "warning" | "error";
|
|
146
|
+
dropdownClassName?: string;
|
|
147
|
+
popupClassName?: string;
|
|
148
|
+
}, "picker">, unknown>;
|
|
149
|
+
RangePicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<antd_es_date_picker_generatePicker.RangePickerProps<Dayjs> & {
|
|
150
|
+
dropdownClassName?: string;
|
|
151
|
+
popupClassName?: string;
|
|
152
|
+
}, unknown>;
|
|
153
|
+
TimePicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<Omit<Omit<rc_picker_lib_Picker.PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
|
|
154
|
+
locale?: antd_es_date_picker_generatePicker.PickerLocale;
|
|
155
|
+
size?: antd_es_button.ButtonSize;
|
|
156
|
+
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
|
|
157
|
+
bordered?: boolean;
|
|
158
|
+
status?: "" | "warning" | "error";
|
|
159
|
+
} & {
|
|
160
|
+
status?: "" | "warning" | "error";
|
|
161
|
+
dropdownClassName?: string;
|
|
162
|
+
popupClassName?: string;
|
|
163
|
+
}, "picker">, unknown>;
|
|
164
|
+
QuarterPicker: antd_es_date_picker_generatePicker_interface.PickerComponentClass<Omit<Omit<rc_picker_lib_Picker.PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
|
|
165
|
+
locale?: antd_es_date_picker_generatePicker.PickerLocale;
|
|
166
|
+
size?: antd_es_button.ButtonSize;
|
|
167
|
+
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
|
|
168
|
+
bordered?: boolean;
|
|
169
|
+
status?: "" | "warning" | "error";
|
|
170
|
+
} & {
|
|
171
|
+
status?: "" | "warning" | "error";
|
|
172
|
+
dropdownClassName?: string;
|
|
173
|
+
popupClassName?: string;
|
|
174
|
+
}, "picker">, unknown>;
|
|
138
175
|
};
|
|
139
176
|
|
|
140
|
-
|
|
177
|
+
type ExtendDescriptionTypeProps = {
|
|
141
178
|
children?: JSX.Element | null;
|
|
142
179
|
render?: (value: any, values: any) => ReactNode | JSX.Element;
|
|
143
180
|
};
|
|
144
|
-
|
|
145
|
-
|
|
181
|
+
type ExtendDescriptionItemProps = BaseItemProps;
|
|
182
|
+
type DescriptionItemProps<T = any> = {
|
|
146
183
|
children?: JSX.Element;
|
|
147
184
|
render?: (value: T, values: any) => ReactNode | JSX.Element;
|
|
148
185
|
if?: (values: Record<string, any>) => boolean;
|
|
149
186
|
} & FaasItemProps & {
|
|
150
187
|
object?: DescriptionItemProps[];
|
|
151
188
|
};
|
|
152
|
-
|
|
189
|
+
type DescriptionProps<T = any, ExtendItemProps = any> = {
|
|
153
190
|
renderTitle?: ((values: T) => ReactNode | JSX.Element);
|
|
154
191
|
items: (DescriptionItemProps | ExtendItemProps)[];
|
|
155
192
|
extendTypes?: {
|
|
@@ -160,10 +197,10 @@ declare type DescriptionProps<T = any, ExtendItemProps = any> = {
|
|
|
160
197
|
} & DescriptionsProps;
|
|
161
198
|
declare function Description<T = any>(props: DescriptionProps<T>): JSX.Element;
|
|
162
199
|
|
|
163
|
-
|
|
200
|
+
type DrawerProps = DrawerProps$1 & {
|
|
164
201
|
children?: JSX.Element | JSX.Element[];
|
|
165
202
|
};
|
|
166
|
-
|
|
203
|
+
type setDrawerProps = (changes: Partial<DrawerProps>) => void;
|
|
167
204
|
/**
|
|
168
205
|
* Hook style drawer.
|
|
169
206
|
* @param init initial props
|
|
@@ -187,41 +224,41 @@ declare function useDrawer(init?: DrawerProps): {
|
|
|
187
224
|
setDrawerProps(changes: Partial<DrawerProps>): void;
|
|
188
225
|
};
|
|
189
226
|
|
|
190
|
-
|
|
227
|
+
type StringProps = {
|
|
191
228
|
type?: 'string';
|
|
192
229
|
input?: InputProps;
|
|
193
230
|
};
|
|
194
|
-
|
|
231
|
+
type StringListProps = {
|
|
195
232
|
type: 'string[]';
|
|
196
233
|
input?: InputProps;
|
|
197
234
|
maxCount?: number;
|
|
198
235
|
};
|
|
199
|
-
|
|
236
|
+
type NumberProps = {
|
|
200
237
|
type: 'number';
|
|
201
238
|
input?: InputNumberProps;
|
|
202
239
|
};
|
|
203
|
-
|
|
240
|
+
type NumberListProps = {
|
|
204
241
|
type: 'number[]';
|
|
205
242
|
input?: InputNumberProps;
|
|
206
243
|
maxCount?: number;
|
|
207
244
|
};
|
|
208
|
-
|
|
245
|
+
type BooleanProps = {
|
|
209
246
|
type: 'boolean';
|
|
210
247
|
input?: SwitchProps;
|
|
211
248
|
};
|
|
212
|
-
|
|
249
|
+
type DateProps = {
|
|
213
250
|
type: 'date';
|
|
214
251
|
input?: DatePickerProps$1;
|
|
215
252
|
};
|
|
216
|
-
|
|
253
|
+
type TimeProps = {
|
|
217
254
|
type: 'time';
|
|
218
255
|
input?: TimePickerProps$1;
|
|
219
256
|
};
|
|
220
|
-
|
|
257
|
+
type ObjectProps = {
|
|
221
258
|
type: 'object';
|
|
222
259
|
object: FormItemProps[];
|
|
223
260
|
};
|
|
224
|
-
|
|
261
|
+
type ObjectListProps = {
|
|
225
262
|
type: 'object[]';
|
|
226
263
|
object: (FormItemProps & {
|
|
227
264
|
/** default is 6 */
|
|
@@ -229,23 +266,23 @@ declare type ObjectListProps = {
|
|
|
229
266
|
})[];
|
|
230
267
|
maxCount?: number;
|
|
231
268
|
};
|
|
232
|
-
|
|
269
|
+
type OptionsProps = {
|
|
233
270
|
options?: BaseOption[];
|
|
234
271
|
type?: 'string' | 'string[]' | 'number' | 'number[]';
|
|
235
272
|
input?: SelectProps<any>;
|
|
236
273
|
};
|
|
237
|
-
|
|
274
|
+
type FormItemInputProps = (StringProps | StringListProps | NumberProps | NumberListProps | BooleanProps | OptionsProps | DateProps | TimeProps | ObjectProps | ObjectListProps) & {
|
|
238
275
|
disabled?: boolean;
|
|
239
276
|
required?: boolean;
|
|
240
277
|
};
|
|
241
|
-
|
|
278
|
+
type ExtendFormTypeProps = {
|
|
242
279
|
children?: ReactNode;
|
|
243
280
|
};
|
|
244
|
-
|
|
281
|
+
type ExtendTypes = {
|
|
245
282
|
[type: string]: ExtendFormTypeProps;
|
|
246
283
|
};
|
|
247
|
-
|
|
248
|
-
|
|
284
|
+
type ExtendFormItemProps = BaseItemProps & FormItemProps$1;
|
|
285
|
+
type FormItemProps<T = any> = {
|
|
249
286
|
children?: ReactNode;
|
|
250
287
|
render?: (value?: T) => ReactNode | JSX.Element;
|
|
251
288
|
rules?: RuleObject[];
|
|
@@ -271,7 +308,7 @@ declare type FormItemProps<T = any> = {
|
|
|
271
308
|
*/
|
|
272
309
|
declare function FormItem<T = any>(props: FormItemProps<T>): JSX.Element;
|
|
273
310
|
|
|
274
|
-
|
|
311
|
+
type FormProps<Values extends Record<string, any> = any, ExtendItemProps = any> = {
|
|
275
312
|
items?: (FormItemProps | ExtendItemProps)[];
|
|
276
313
|
/** Default: { text: 'Submit' }, set false to disable it */
|
|
277
314
|
submit?: false | {
|
|
@@ -325,7 +362,7 @@ declare namespace Form {
|
|
|
325
362
|
var useForm: typeof antd_lib_form_Form.useForm;
|
|
326
363
|
}
|
|
327
364
|
|
|
328
|
-
|
|
365
|
+
type LinkProps = {
|
|
329
366
|
href: string;
|
|
330
367
|
target?: string;
|
|
331
368
|
text?: string | number;
|
|
@@ -344,10 +381,10 @@ declare type LinkProps = {
|
|
|
344
381
|
*/
|
|
345
382
|
declare function Link({ href, target, text, children, style, button, }: LinkProps): JSX.Element;
|
|
346
383
|
|
|
347
|
-
|
|
384
|
+
type ModalProps = ModalProps$1 & {
|
|
348
385
|
children?: JSX.Element | JSX.Element[] | string;
|
|
349
386
|
};
|
|
350
|
-
|
|
387
|
+
type setModalProps = (changes: Partial<ModalProps>) => void;
|
|
351
388
|
/**
|
|
352
389
|
* Hook style modal.
|
|
353
390
|
* @param init initial props
|
|
@@ -369,7 +406,7 @@ declare function useModal(init?: ModalProps): {
|
|
|
369
406
|
};
|
|
370
407
|
|
|
371
408
|
declare function PageNotFound(): JSX.Element;
|
|
372
|
-
|
|
409
|
+
type RoutesProps = {
|
|
373
410
|
routes: (RouteProps & {
|
|
374
411
|
page?: LazyExoticComponent<ComponentType<any>>;
|
|
375
412
|
})[];
|
|
@@ -397,18 +434,18 @@ declare type RoutesProps = {
|
|
|
397
434
|
*/
|
|
398
435
|
declare function Routes(props: RoutesProps): JSX.Element;
|
|
399
436
|
|
|
400
|
-
|
|
437
|
+
type TableItemProps<T = any> = {
|
|
401
438
|
optionsType?: 'auto';
|
|
402
439
|
/** @deprecated use render */
|
|
403
440
|
children?: JSX.Element | null;
|
|
404
441
|
object?: TableItemProps[];
|
|
405
442
|
} & FaasItemProps & Omit<TableColumnProps<T>, 'children'>;
|
|
406
|
-
|
|
443
|
+
type ExtendTableTypeProps = {
|
|
407
444
|
children?: JSX.Element | null;
|
|
408
445
|
render?: (value: any, values: any, index: number) => JSX.Element | string | number | boolean | null;
|
|
409
446
|
};
|
|
410
|
-
|
|
411
|
-
|
|
447
|
+
type ExtendTableItemProps<T = any> = BaseItemProps & Omit<TableColumnProps<T>, 'children'>;
|
|
448
|
+
type TableProps<T = any, ExtendTypes = any> = {
|
|
412
449
|
items: (TableItemProps | (ExtendTypes & ExtendTableItemProps))[];
|
|
413
450
|
extendTypes?: {
|
|
414
451
|
[key: string]: ExtendTableTypeProps;
|
|
@@ -428,10 +465,10 @@ declare type TableProps<T = any, ExtendTypes = any> = {
|
|
|
428
465
|
*/
|
|
429
466
|
declare function Table<T = any, ExtendTypes = any>(props: TableProps<T, ExtendTypes>): JSX.Element;
|
|
430
467
|
|
|
431
|
-
|
|
468
|
+
type TimePickerProps = Omit<PickerTimeProps<Dayjs>, 'picker'>;
|
|
432
469
|
declare const TimePicker: react.ForwardRefExoticComponent<TimePickerProps & react.RefAttributes<any>>;
|
|
433
470
|
|
|
434
|
-
|
|
471
|
+
type TitleProps = {
|
|
435
472
|
title: string | string[];
|
|
436
473
|
/** ` - ` as default */
|
|
437
474
|
separator?: string;
|