1 | import { KeyboardTypeOptions, ImageSourcePropType } from 'react-native'
|
2 |
|
3 | export declare type TextAreaEventHandle = (val?: string) => void
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export interface RulePatternPropsType {
|
9 | pattern?: RegExp
|
10 | message?: string
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export interface RuleRequiredPropsType {
|
17 | required?: boolean
|
18 | message?: string
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export interface RuleValidatorPropsType {
|
25 | pattern?: RegExp
|
26 | validator?: boolean
|
27 | message?: string
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export interface RuleMessagePropsType {
|
34 | type:
|
35 | | 'zip'
|
36 | | 'email'
|
37 | | 'zh'
|
38 | | 'zhName'
|
39 | | 'url'
|
40 | | 'phone'
|
41 | | 'mobilePhone'
|
42 | | 'telephone'
|
43 | | 'idCard'
|
44 | | 'money'
|
45 | | 'date'
|
46 | | 'number'
|
47 | | 'integer'
|
48 | | 'floating'
|
49 | | 'twoTimes'
|
50 | | 'threeTimes'
|
51 | | 'fourTimes'
|
52 | | 'fiveTimes'
|
53 | message?: string
|
54 | }
|
55 |
|
56 | export declare type RulePropsType = (
|
57 | | string
|
58 | | RulePatternPropsType
|
59 | | RuleRequiredPropsType
|
60 | | RuleMessagePropsType
|
61 | | RuleValidatorPropsType)[]
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | export interface FormItemPropsType {
|
67 | componentName: string
|
68 | props: FormItemOptionPropsType
|
69 | }
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export interface FormItemOptionPropsType {
|
75 | name?: string
|
76 | id: string
|
77 | placeholder?: string
|
78 | initialValue?: string
|
79 | required?: boolean
|
80 | rules?: RulePropsType
|
81 | form?: any
|
82 | }
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | export interface SsDescriptionPropsType {
|
88 | name?: string
|
89 | id: string
|
90 | initialValue?: string
|
91 | icon?: string
|
92 | }
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | export interface SwitchPropsType extends FormItemOptionPropsType {
|
98 | label: string
|
99 | onChange?: (checked: boolean) => void
|
100 | last?: boolean
|
101 | }
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | export interface InputPropsType extends FormItemOptionPropsType {
|
107 | icon?: ImageSourcePropType
|
108 | label: string
|
109 | onChange?: (value: string) => void
|
110 | type?: 'text' | 'bankCard' | 'phone' | 'password' | 'number' | 'digit' | KeyboardTypeOptions
|
111 | textAlign?: 'left' | 'center' | 'right'
|
112 | extra?: React.ReactNode
|
113 | maxLength?: number
|
114 | last?: boolean
|
115 | multiline?: boolean
|
116 | height?: number
|
117 | }
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | export interface TextareaPropsType extends FormItemOptionPropsType {
|
123 | label: string
|
124 | onChange?: TextAreaEventHandle
|
125 | count?: number
|
126 | last?: boolean
|
127 | }
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | export interface SsSelectPropsType extends FormItemOptionPropsType {
|
133 | icon?: ImageSourcePropType
|
134 | label: string
|
135 | onChange?: (value?: React.ReactText[]) => void
|
136 | options: ({ label: string; value: string } | string)[]
|
137 | cols?: number
|
138 | last?: boolean
|
139 | }
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | export interface SsMultiSelectPropsType extends FormItemOptionPropsType {
|
145 | label: string
|
146 | onChange?: (value?: React.ReactText[]) => void
|
147 | options: ({ label: string; value: string } | string)[]
|
148 | }
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | export interface SsDropDownPropsType extends FormItemOptionPropsType {
|
154 | icon?: ImageSourcePropType
|
155 | label: string
|
156 | onChange?: (value?: React.ReactText[]) => void
|
157 | options: ({ label: string; value: string } | string)[]
|
158 | multiple: boolean
|
159 | }
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | export interface SsDateProps extends FormItemOptionPropsType {
|
165 | label: string
|
166 | onChange?: (value: Date) => void
|
167 | type: 'year' | 'month' | 'date' | 'datetime' | 'time'
|
168 | minDate: Date
|
169 | maxDate: Date
|
170 | }
|
171 |
|
172 |
|
173 |
|
174 |
|
175 | export interface SsDateRangeProps {
|
176 | name?: string
|
177 | id: string[]
|
178 | placeholder?: string[]
|
179 | initialValue?: string[]
|
180 | required?: boolean
|
181 | rules?: RulePropsType
|
182 | form?: any
|
183 | label: string[]
|
184 | onChange?: (value: Date | Date[]) => void
|
185 | }
|
186 |
|
187 |
|
188 |
|
189 |
|
190 | export interface SsAmountProps extends InputPropsType {
|
191 | upper?: boolean
|
192 | }
|
193 |
|
194 | export interface RatingProps {
|
195 | form?: any
|
196 | id: string
|
197 | label: string
|
198 | rules?: RulePropsType
|
199 | allowHalf?: boolean
|
200 | onChange?: (value: number) => void
|
201 | initialValue: number
|
202 | required?: boolean
|
203 | }
|
204 |
|
205 | export interface ImagePickerProps extends FormItemOptionPropsType {
|
206 | label: string
|
207 | onChange?: (value: any[]) => void
|
208 | }
|
209 |
|
210 | export interface LocationProps extends FormItemOptionPropsType {
|
211 | label: string
|
212 | onChange?: (value: any) => void
|
213 | }
|
214 |
|
215 | export interface CalculateProps extends FormItemOptionPropsType {
|
216 | label: string
|
217 | formula: any[]
|
218 | onChange?: (value: any) => void
|
219 | }
|