1 | import {FormData, VNodeData} from "@form-create/core";
|
2 | import {Button, Col, Popover, Row, Tooltip} from "ant-design-vue";
|
3 | import {Api} from "./index";
|
4 |
|
5 | export interface OptionAttrs {
|
6 | col?: Boolean | Col & {
|
7 | labelWidth?: number | string;
|
8 | show?: Boolean;
|
9 | };
|
10 | row?: Boolean | Row & {
|
11 | show?: Boolean;
|
12 | };
|
13 | info?: Boolean | (Tooltip | Popover) & VNodeData & {
|
14 | show?: Boolean;
|
15 | native?: Boolean;
|
16 | icon?: string;
|
17 | align?: 'left' | 'right';
|
18 | info?: string;
|
19 | };
|
20 | wrap?: Boolean | VNodeData & {
|
21 | colon?: boolean;
|
22 | extra?: any;
|
23 | hasFeedback?: boolean;
|
24 | help?: any;
|
25 | label?: any;
|
26 | labelCol?: Col;
|
27 | required?: boolean;
|
28 | validateStatus?: '' | 'success' | 'warning' | 'error' | 'validating';
|
29 | wrapperCol?: Col;
|
30 | labelAlign?: 'left' | 'right';
|
31 | autoLink?: boolean;
|
32 | show?: Boolean;
|
33 | };
|
34 | form?: {
|
35 | hideRequiredMark?: boolean;
|
36 | labelCol?: Col;
|
37 | layout?: 'horizontal' | 'inline' | 'vertical';
|
38 | wrapperCol?: Col;
|
39 | colon?: boolean;
|
40 | labelAlign?: 'left' | 'right';
|
41 | validateMessages?: any;
|
42 | validateOnRuleChange?: boolean;
|
43 | className?: any;
|
44 | col?: Boolean;
|
45 | };
|
46 |
|
47 | submitBtn?: Boolean | Button & {
|
48 | click?: Function;
|
49 | innerText?: string;
|
50 | show?: Boolean;
|
51 | };
|
52 |
|
53 | resetBtn?: Boolean | Button & {
|
54 | click?: Function;
|
55 | innerText?: string;
|
56 | show?: Boolean;
|
57 | };
|
58 |
|
59 | }
|
60 |
|
61 | declare const optionAttrs: OptionAttrs & {
|
62 | title?: Boolean | VNodeData & {
|
63 | show?: Boolean;
|
64 | native?: Boolean;
|
65 | title?: string;
|
66 | };
|
67 | };
|
68 |
|
69 | interface children {
|
70 | children?: VNodeData[]
|
71 | }
|
72 |
|
73 | export interface CreatorAttrs {
|
74 | col(props: typeof optionAttrs.col): this;
|
75 |
|
76 | wrap(props: typeof optionAttrs.wrap): this;
|
77 |
|
78 | title(props: string | typeof optionAttrs.title & children): this;
|
79 |
|
80 | info(props: string | typeof optionAttrs.info & children): this;
|
81 |
|
82 | className(prop: string): this;
|
83 |
|
84 | }
|
85 |
|
86 | export interface RuleAttrs {
|
87 | col?: typeof optionAttrs.col;
|
88 | wrap?: typeof optionAttrs.wrap;
|
89 | title?: string | typeof optionAttrs.title & children;
|
90 | info?: string | typeof optionAttrs.info & children;
|
91 | className?: string;
|
92 | }
|
93 |
|
94 | export interface ApiAttrs {
|
95 | btn: {
|
96 | loading(loading: boolean): void;
|
97 | disabled(disabled: boolean): void;
|
98 | show(show: boolean): void;
|
99 | }
|
100 | resetBtn: {
|
101 | loading(loading: boolean): void;
|
102 | disabled(disabled: boolean): void;
|
103 | show(show: boolean): void;
|
104 | }
|
105 |
|
106 | submit(success: (formData: FormData, $f: Api) => void, fail: ($f: Api) => void): void;
|
107 |
|
108 | clearValidateState(fields?: string | string[], clearSub?: Boolean): void;
|
109 |
|
110 | clearSubValidateState(fields?: string | string[]): void;
|
111 |
|
112 | validate(callback?: (callback?: (boolean: boolean, object: Object) => void) => void): void;
|
113 |
|
114 | validateField(field: string, callback?: (errorMessage: string) => void): void;
|
115 |
|
116 | submitBtnProps(props: Button): void;
|
117 |
|
118 | resetBtnProps(props: Button): void;
|
119 |
|
120 | } |
\ | No newline at end of file |