@progress/kendo-vue-form 8.0.3-develop.2 → 8.0.3-develop.3
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/Field.d.ts +18 -0
- package/FieldArray.d.ts +43 -0
- package/FieldWrapper.d.ts +37 -0
- package/Form.d.ts +137 -0
- package/FormElement.d.ts +58 -0
- package/dist/cdn/js/kendo-vue-form.js +1 -1
- package/index.d.mts +17 -864
- package/index.d.ts +17 -864
- package/interfaces/FieldArrayProps.d.ts +31 -0
- package/interfaces/FieldArrayRenderProps.d.ts +92 -0
- package/interfaces/FieldInjectedProps.d.ts +163 -0
- package/interfaces/FieldProps.d.ts +99 -0
- package/interfaces/FieldRenderProps.d.ts +68 -0
- package/interfaces/FieldValidator.d.ts +21 -0
- package/interfaces/FormProps.d.ts +55 -0
- package/interfaces/FormRenderProps.d.ts +82 -0
- package/interfaces/FormSubmitClickEvent.d.ts +30 -0
- package/interfaces/FormValidator.d.ts +18 -0
- package/interfaces/KeyValue.d.ts +13 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -5
package/index.d.mts
CHANGED
|
@@ -5,867 +5,20 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>, {
|
|
26
|
-
[x: string]: any;
|
|
27
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
export declare const FieldArray: DefineComponent<ExtractPropTypes< {
|
|
33
|
-
value: PropType<any>;
|
|
34
|
-
component: PropType<any>;
|
|
35
|
-
validationMessage: PropType<any>;
|
|
36
|
-
touched: PropType<any>;
|
|
37
|
-
modified: PropType<any>;
|
|
38
|
-
validator: PropType<FieldValidatorType_2 | FieldValidatorType_2[]>;
|
|
39
|
-
visited: PropType<any>;
|
|
40
|
-
valid: PropType<any>;
|
|
41
|
-
name: PropType<string>;
|
|
42
|
-
id: PropType<any>;
|
|
43
|
-
}>, {}, {}, {}, {
|
|
44
|
-
onUnshift(event: any): void;
|
|
45
|
-
onPush(event: any): void;
|
|
46
|
-
onInsert(event: any): void;
|
|
47
|
-
onPop(): void;
|
|
48
|
-
onRemove(event: any): void;
|
|
49
|
-
onReplace(event: any): void;
|
|
50
|
-
onMove(event: any): void;
|
|
51
|
-
}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
52
|
-
value: PropType<any>;
|
|
53
|
-
component: PropType<any>;
|
|
54
|
-
validationMessage: PropType<any>;
|
|
55
|
-
touched: PropType<any>;
|
|
56
|
-
modified: PropType<any>;
|
|
57
|
-
validator: PropType<FieldValidatorType_2 | FieldValidatorType_2[]>;
|
|
58
|
-
visited: PropType<any>;
|
|
59
|
-
valid: PropType<any>;
|
|
60
|
-
name: PropType<string>;
|
|
61
|
-
id: PropType<any>;
|
|
62
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Represents the props of the FieldArray component that is used inside the Kendo U for Vue Form component.
|
|
66
|
-
*/
|
|
67
|
-
export declare interface FieldArrayProps {
|
|
68
|
-
/**
|
|
69
|
-
* The name of the field in the Form state.
|
|
70
|
-
*/
|
|
71
|
-
name: string;
|
|
72
|
-
/**
|
|
73
|
-
* Can be set to a Vue component.
|
|
74
|
-
* [`FieldArrayRenderProps`]({% slug api_form_fieldarrayprops %}).
|
|
75
|
-
*/
|
|
76
|
-
component: any;
|
|
77
|
-
/**
|
|
78
|
-
* The validation functions for the FieldArray level.
|
|
79
|
-
* Currently, `validator` supports only synchronous functions.
|
|
80
|
-
*/
|
|
81
|
-
validator?: FieldValidatorType | FieldValidatorType[];
|
|
82
|
-
/**
|
|
83
|
-
* @hidden
|
|
84
|
-
*/
|
|
85
|
-
[customProp: string]: any;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Represents the props that are passed to the component which is rendered by FieldArray.
|
|
90
|
-
*/
|
|
91
|
-
export declare interface FieldArrayRenderProps {
|
|
92
|
-
/**
|
|
93
|
-
* Represents the current value of the FieldArray
|
|
94
|
-
* ([see example]({% slug custom_components_form %}#toc-using-basic-properties)).
|
|
95
|
-
*/
|
|
96
|
-
value: any;
|
|
97
|
-
/**
|
|
98
|
-
* Represents the error message that is returned by the validator.
|
|
99
|
-
* The FieldArray is considered valid if the `validationMessage` field is empty.
|
|
100
|
-
*/
|
|
101
|
-
validationMessage: string | null;
|
|
102
|
-
/**
|
|
103
|
-
* Indicates if the field is touched.
|
|
104
|
-
* The touched state is set to `true` when the `onBlur` callback is called.
|
|
105
|
-
*/
|
|
106
|
-
touched: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Indicates if the field is modified.
|
|
109
|
-
* The modified state is set to `true` when the `onChange` callback for the current field is called for first time.
|
|
110
|
-
*/
|
|
111
|
-
modified: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Indicates if the field is visited.
|
|
114
|
-
* The visited state is set to `true` when the `onFocus` callback is called.
|
|
115
|
-
*/
|
|
116
|
-
visited: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* A calculated property based on whether `validationMessage` is present and the `touched` state is set to `true`.
|
|
119
|
-
*/
|
|
120
|
-
valid: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* The name of the field in the Form state.
|
|
123
|
-
*/
|
|
124
|
-
name: string;
|
|
125
|
-
/**
|
|
126
|
-
* A callback to add a value to the beginning of the array.
|
|
127
|
-
*/
|
|
128
|
-
onUnshift: (options: {
|
|
129
|
-
value: any;
|
|
130
|
-
}) => number;
|
|
131
|
-
/**
|
|
132
|
-
* A callback to add a value to the end of the array.
|
|
133
|
-
*/
|
|
134
|
-
onPush: (options: {
|
|
135
|
-
value: any;
|
|
136
|
-
}) => void;
|
|
137
|
-
/**
|
|
138
|
-
* A callback to insert value at given index of the array.
|
|
139
|
-
*/
|
|
140
|
-
onInsert: (options: {
|
|
141
|
-
value: any;
|
|
142
|
-
index: number;
|
|
143
|
-
}) => void;
|
|
144
|
-
/**
|
|
145
|
-
* A callback to remove a value from the end of the array. The value is returned.
|
|
146
|
-
*/
|
|
147
|
-
onPop: () => any;
|
|
148
|
-
/**
|
|
149
|
-
* A callback to remove a value from given index of the array.
|
|
150
|
-
*/
|
|
151
|
-
onRemove: (options: {
|
|
152
|
-
index: number;
|
|
153
|
-
}) => any;
|
|
154
|
-
/**
|
|
155
|
-
* A callback to replace value at given index of the array.
|
|
156
|
-
*/
|
|
157
|
-
onReplace: (options: {
|
|
158
|
-
value: any;
|
|
159
|
-
index: number;
|
|
160
|
-
}) => void;
|
|
161
|
-
/**
|
|
162
|
-
* A callback to move a value from one index to another. Useful for drag and drop reordering.
|
|
163
|
-
*/
|
|
164
|
-
onMove: (options: {
|
|
165
|
-
prevIndex: number;
|
|
166
|
-
nextIndex: number;
|
|
167
|
-
}) => void;
|
|
168
|
-
/**
|
|
169
|
-
* @hidden
|
|
170
|
-
*/
|
|
171
|
-
[customProp: string]: any;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Represents the props that are passed from the Form component to the components nested inside it.
|
|
176
|
-
* To use the [KendoFrom Injected Property]({% slug api_form_fieldinjectedprops %}) it should be
|
|
177
|
-
* [injected](https://v3.vuejs.org/guide/component-provide-inject.html) it in the component that defines the Form content using the below code.
|
|
178
|
-
*
|
|
179
|
-
* ```js-no-run
|
|
180
|
-
* ...........
|
|
181
|
-
* inject: {
|
|
182
|
-
* kendoForm: { default: {} },
|
|
183
|
-
* }
|
|
184
|
-
* ...........
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
export declare interface FieldInjectedProps {
|
|
188
|
-
/**
|
|
189
|
-
* Indicates if the Form is ready to be submitted.
|
|
190
|
-
* If `allowSubmit` is set to `true` and the Form is valid, the user will be able to submit the form.
|
|
191
|
-
* If `allowSubmit` is set to `true` and the Form is not valid, the user will be able to set all fields
|
|
192
|
-
* `touched` and `visited` state to true.
|
|
193
|
-
* Useful for toggling the disabled state of the **Submit** button.
|
|
194
|
-
*/
|
|
195
|
-
allowSubmit?: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* The key-value pair containing the current errors by field path, combined from both field and form level validators.
|
|
198
|
-
*/
|
|
199
|
-
errors?: object;
|
|
200
|
-
/**
|
|
201
|
-
* Indicates if the Form is modified. If any field is modified, `modified` is set to `true`.
|
|
202
|
-
* The modified state of field is set to `true` when the `onChange`
|
|
203
|
-
* callback of the Field component is called for first time.
|
|
204
|
-
*/
|
|
205
|
-
modified: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* An object that holds the `modified` fields.
|
|
208
|
-
*/
|
|
209
|
-
modifiedByField: object;
|
|
210
|
-
/**
|
|
211
|
-
* Indicates if the Form is successfully submitted.
|
|
212
|
-
* Useful for detecting if user is leaving the form before saving changes.
|
|
213
|
-
*/
|
|
214
|
-
submitted: boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Indicates if the Form is touched.
|
|
217
|
-
* If any field is touched, `touched` is set to `true`.
|
|
218
|
-
* The touched state of field is set to `true` when the `onBlur`
|
|
219
|
-
* callback of the Field component is called or when the user tries to submit the form.
|
|
220
|
-
*/
|
|
221
|
-
touched: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* An object that holds the `touched` fields.
|
|
224
|
-
*/
|
|
225
|
-
touchedByField: object;
|
|
226
|
-
/**
|
|
227
|
-
* Indicates if the Form is valid.
|
|
228
|
-
* If any field is invalid, `valid` is set to `false`.
|
|
229
|
-
*/
|
|
230
|
-
valid: boolean;
|
|
231
|
-
/**
|
|
232
|
-
* A callback for getting the value of a field without using the Field component
|
|
233
|
-
* ([see example]({% slug common_scenarios_form %}#toc-reading-the-field-state)).
|
|
234
|
-
* Useful for creating and modifying the UI based on the field values.
|
|
235
|
-
*/
|
|
236
|
-
valueGetter: (name: string) => any;
|
|
237
|
-
/**
|
|
238
|
-
* Indicates if the Form is visited.
|
|
239
|
-
* If any field is visited, `visited` is set to `true`.
|
|
240
|
-
* The visited state of field is set to `true` when the `onFocus`
|
|
241
|
-
* callback of the Field component is called or when the user tries to submit the form.
|
|
242
|
-
*/
|
|
243
|
-
visited: boolean;
|
|
244
|
-
/**
|
|
245
|
-
* An object that holds the `visited` fields.
|
|
246
|
-
*/
|
|
247
|
-
visitedByField: object;
|
|
248
|
-
/**
|
|
249
|
-
* When called without parameters it validates all the fields in the Form.
|
|
250
|
-
* If called with object parameter with keys names - the names of the fields, only these fields are validated.
|
|
251
|
-
*/
|
|
252
|
-
validate: (options?: {
|
|
253
|
-
[key: string]: any;
|
|
254
|
-
}) => void;
|
|
255
|
-
/**
|
|
256
|
-
* A callback for resetting the Form.
|
|
257
|
-
*/
|
|
258
|
-
onFormReset: () => void;
|
|
259
|
-
/**
|
|
260
|
-
* A callback for submitting the Form.
|
|
261
|
-
* Can be passed to the `onClick` property of the **Submit** button.
|
|
262
|
-
*/
|
|
263
|
-
onSubmit: (event: any) => void;
|
|
264
|
-
/**
|
|
265
|
-
* A callback you have to call when the rendered component is blurred.
|
|
266
|
-
* Responsible for setting the touched state of the Field.
|
|
267
|
-
*/
|
|
268
|
-
onBlur: () => void;
|
|
269
|
-
/**
|
|
270
|
-
* A callback you have to call when the value of the rendered component is changed
|
|
271
|
-
* ([see example]({% slug common_scenarios_form %}#toc-changing-the-field-value)).
|
|
272
|
-
* The `value` property of the event takes precedence over `target.value`.
|
|
273
|
-
*/
|
|
274
|
-
onChange: (fieldName: string, event: {
|
|
275
|
-
target?: any;
|
|
276
|
-
value?: any;
|
|
277
|
-
}) => void;
|
|
278
|
-
/**
|
|
279
|
-
* A callback you have to call when the rendered component is focused.
|
|
280
|
-
* Responsible for setting the visited state of the Field.
|
|
281
|
-
*/
|
|
282
|
-
onFocus: () => void;
|
|
283
|
-
/**
|
|
284
|
-
* ## Functions used in FieldArray component
|
|
285
|
-
*/
|
|
286
|
-
/**
|
|
287
|
-
* A callback to insert value at given index of the array.
|
|
288
|
-
*/
|
|
289
|
-
onInsert: (options: {
|
|
290
|
-
index: number;
|
|
291
|
-
value: any;
|
|
292
|
-
}) => void;
|
|
293
|
-
/**
|
|
294
|
-
* A callback to move a value from one index to another. Useful for drag and drop reordering.
|
|
295
|
-
*/
|
|
296
|
-
onMove: (options: {
|
|
297
|
-
nextIndex: number;
|
|
298
|
-
prevIndex: number;
|
|
299
|
-
}) => void;
|
|
300
|
-
/**
|
|
301
|
-
* A callback to remove a value from the end of the array. The value is returned.
|
|
302
|
-
*/
|
|
303
|
-
onPop: () => any;
|
|
304
|
-
/**
|
|
305
|
-
* A callback to add a value to the end of the array.
|
|
306
|
-
*/
|
|
307
|
-
onPush: (options: {
|
|
308
|
-
value: any;
|
|
309
|
-
}) => void;
|
|
310
|
-
/**
|
|
311
|
-
* A callback to remove a value from given index of the array.
|
|
312
|
-
*/
|
|
313
|
-
onRemove: (options: {
|
|
314
|
-
index: number;
|
|
315
|
-
}) => any;
|
|
316
|
-
/**
|
|
317
|
-
* A callback to replace value at given index of the array.
|
|
318
|
-
*/
|
|
319
|
-
onReplace: (options: {
|
|
320
|
-
index: number;
|
|
321
|
-
value: any;
|
|
322
|
-
}) => void;
|
|
323
|
-
/**
|
|
324
|
-
* A callback to add a value to the beginning of the array.
|
|
325
|
-
*/
|
|
326
|
-
onUnshift: (options: {
|
|
327
|
-
value: any;
|
|
328
|
-
}) => number;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Represents the props of the Field component that is used inside the Kendo U for Vue Form component.
|
|
333
|
-
*/
|
|
334
|
-
export declare interface FieldProps {
|
|
335
|
-
/**
|
|
336
|
-
* The name of the field in the Form state.
|
|
337
|
-
* Supports nested fields in the `user.age` and `users[index].name` formats.
|
|
338
|
-
*/
|
|
339
|
-
name: string;
|
|
340
|
-
/**
|
|
341
|
-
* The id of the field.
|
|
342
|
-
*/
|
|
343
|
-
id?: string;
|
|
344
|
-
/**
|
|
345
|
-
* Can be set to a Vue component or to the name of an HTML element,
|
|
346
|
-
* for example, `input`, `select`, and `textarea`.
|
|
347
|
-
* The props that are passed to component are the
|
|
348
|
-
* [`FieldRenderProps`]({% slug api_form_fieldrenderprops %}).
|
|
349
|
-
*/
|
|
350
|
-
component: string | any;
|
|
351
|
-
/**
|
|
352
|
-
* The validation functions for the Field level.
|
|
353
|
-
* Currently, `validator` supports only synchronous functions.
|
|
354
|
-
* Using the array overload with inline array will cause infinite
|
|
355
|
-
* loop - in this case use `useMemo` hook to memoize the array.
|
|
356
|
-
*/
|
|
357
|
-
validator?: FieldValidatorType | FieldValidatorType[];
|
|
358
|
-
/**
|
|
359
|
-
* Called when underlying editor triggers it's onChange event and the Form update it's internal state.
|
|
360
|
-
* Useful for updating related fields.
|
|
361
|
-
* > Keep in mind that Form listens to this editor event and automatically keeps it's internal state up to date.
|
|
362
|
-
* That why this event should be used only for executing custom logic.
|
|
363
|
-
*/
|
|
364
|
-
onChange?: (event: any) => void;
|
|
365
|
-
/**
|
|
366
|
-
* @hidden
|
|
367
|
-
*/
|
|
368
|
-
resource?: any;
|
|
369
|
-
/**
|
|
370
|
-
* @hidden
|
|
371
|
-
*/
|
|
372
|
-
multiple?: boolean;
|
|
373
|
-
/**
|
|
374
|
-
* @hidden
|
|
375
|
-
*/
|
|
376
|
-
dataItems?: any[];
|
|
377
|
-
/**
|
|
378
|
-
* @hidden
|
|
379
|
-
*/
|
|
380
|
-
textField?: string;
|
|
381
|
-
/**
|
|
382
|
-
* @hidden
|
|
383
|
-
*/
|
|
384
|
-
valueField?: string;
|
|
385
|
-
/**
|
|
386
|
-
* @hidden
|
|
387
|
-
*/
|
|
388
|
-
colorField?: string;
|
|
389
|
-
/**
|
|
390
|
-
* @hidden
|
|
391
|
-
*/
|
|
392
|
-
rows?: number;
|
|
393
|
-
/**
|
|
394
|
-
* @hidden
|
|
395
|
-
*/
|
|
396
|
-
field?: any;
|
|
397
|
-
/**
|
|
398
|
-
* @hidden
|
|
399
|
-
*/
|
|
400
|
-
start?: any;
|
|
401
|
-
/**
|
|
402
|
-
* @hidden
|
|
403
|
-
*/
|
|
404
|
-
value?: any;
|
|
405
|
-
/**
|
|
406
|
-
* @hidden
|
|
407
|
-
*/
|
|
408
|
-
width?: string;
|
|
409
|
-
/**
|
|
410
|
-
* @hidden
|
|
411
|
-
*/
|
|
412
|
-
editorId?: string;
|
|
413
|
-
/**
|
|
414
|
-
* @hidden
|
|
415
|
-
*/
|
|
416
|
-
isAllDay?: boolean;
|
|
417
|
-
/**
|
|
418
|
-
* @hidden
|
|
419
|
-
*/
|
|
420
|
-
timezone?: string;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Represents the props that are passed to the component which is rendered by Field.
|
|
425
|
-
*/
|
|
426
|
-
export declare interface FieldRenderProps {
|
|
427
|
-
/**
|
|
428
|
-
* A callback you have to call when the value of the rendered component is changed
|
|
429
|
-
* ([see example]({% slug common_scenarios_form %}#toc-changing-the-field-value)).
|
|
430
|
-
* The `value` property of the event takes precedence over `target.value`.
|
|
431
|
-
*/
|
|
432
|
-
onChange?: (event: {
|
|
433
|
-
target?: any;
|
|
434
|
-
value?: any;
|
|
435
|
-
}) => void;
|
|
436
|
-
/**
|
|
437
|
-
* A callback you have to call when the rendered component is focused.
|
|
438
|
-
* Responsible for setting the visited state of the Field.
|
|
439
|
-
*/
|
|
440
|
-
onFocus?: () => void;
|
|
441
|
-
/**
|
|
442
|
-
* A callback you have to call when the rendered component is blurred.
|
|
443
|
-
* Responsible for setting the touched state of the Field.
|
|
444
|
-
*/
|
|
445
|
-
onBlur?: () => void;
|
|
446
|
-
/**
|
|
447
|
-
* Represents the current value of the Field
|
|
448
|
-
* ([see example]({% slug custom_components_form %}#toc-using-basic-properties)).
|
|
449
|
-
*/
|
|
450
|
-
value: any;
|
|
451
|
-
/**
|
|
452
|
-
* Represents the error message that is returned by the validator.
|
|
453
|
-
* The Field is considered valid if the `validationMessage` field is empty.
|
|
454
|
-
*/
|
|
455
|
-
validationMessage: string | null;
|
|
456
|
-
/**
|
|
457
|
-
* Indicates if the field is touched.
|
|
458
|
-
* The touched state is set to `true` when the `onBlur` callback is called.
|
|
459
|
-
*/
|
|
460
|
-
touched: boolean;
|
|
461
|
-
/**
|
|
462
|
-
* Indicates if the field is modified.
|
|
463
|
-
* The modified state is set to `true` when the `onChange` callback for the current field is called for first time.
|
|
464
|
-
*/
|
|
465
|
-
modified: boolean;
|
|
466
|
-
/**
|
|
467
|
-
* Indicates if the field is visited.
|
|
468
|
-
* The visited state is set to `true` when the `onFocus` callback is called.
|
|
469
|
-
*/
|
|
470
|
-
visited: boolean;
|
|
471
|
-
/**
|
|
472
|
-
* A calculated property based on whether `validationMessage` is present and the `touched` state is set to `true`.
|
|
473
|
-
*/
|
|
474
|
-
valid: boolean;
|
|
475
|
-
/**
|
|
476
|
-
* The name of the field in the Form state.
|
|
477
|
-
*/
|
|
478
|
-
name: string;
|
|
479
|
-
/**
|
|
480
|
-
* @hidden
|
|
481
|
-
*/
|
|
482
|
-
[customProp: string]: any;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* The validator function for the Field component. The function arguments are:
|
|
487
|
-
*
|
|
488
|
-
* * value - The current value of the field.
|
|
489
|
-
* * valueGetter - Function which can be used to get other fields value.
|
|
490
|
-
* Usable when validator depends on more than one field. Supports field paths.
|
|
491
|
-
* * fieldProps - Props of the Field component. Currently contains only the `name` prop.
|
|
492
|
-
* Usable when one validator is used across multiple fields.
|
|
493
|
-
*
|
|
494
|
-
* Returns `string` to signify error or `undefined` to signify validation success.
|
|
495
|
-
*/
|
|
496
|
-
export declare type FieldValidatorType = (value: any, valueGetter: (name: string) => any, fieldProps: {
|
|
497
|
-
name: string;
|
|
498
|
-
}) => string | undefined;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* @hidden
|
|
502
|
-
*/
|
|
503
|
-
export declare const FieldWrapper: DefineComponent<ExtractPropTypes< {
|
|
504
|
-
dir: PropType<any>;
|
|
505
|
-
horizontal: PropType<boolean>;
|
|
506
|
-
}>, {}, {}, {
|
|
507
|
-
fieldClassName(): {
|
|
508
|
-
'k-form-field': boolean;
|
|
509
|
-
'k-rtl': boolean;
|
|
510
|
-
};
|
|
511
|
-
}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
512
|
-
dir: PropType<any>;
|
|
513
|
-
horizontal: PropType<boolean>;
|
|
514
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* Represents the props of the Kendo U for Vue FieldWrapper component.
|
|
518
|
-
*/
|
|
519
|
-
export declare interface FieldWrapperProps {
|
|
520
|
-
/**
|
|
521
|
-
* If set to `true` enable the horizontal layout of the form editors.
|
|
522
|
-
*/
|
|
523
|
-
horizontal?: boolean;
|
|
524
|
-
/**
|
|
525
|
-
* @hidden
|
|
526
|
-
*/
|
|
527
|
-
[customProp: string]: any;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* @hidden
|
|
532
|
-
*/
|
|
533
|
-
export declare const Form: DefineComponent<ExtractPropTypes< {
|
|
534
|
-
renderForm: PropType<(props: FormRenderProps_2) => any>;
|
|
535
|
-
initialValues: PropType<{
|
|
536
|
-
[name: string]: any;
|
|
537
|
-
}>;
|
|
538
|
-
validator: PropType<FormValidatorType_2>;
|
|
539
|
-
ignoreModified: PropType<boolean>;
|
|
540
|
-
}>, {}, {
|
|
541
|
-
validatorsByField: {};
|
|
542
|
-
fields: any[];
|
|
543
|
-
unmounted: boolean;
|
|
544
|
-
form: {
|
|
545
|
-
id: Function;
|
|
546
|
-
errors: {};
|
|
547
|
-
values: {};
|
|
548
|
-
modifiedByField: {};
|
|
549
|
-
touchedByField: {};
|
|
550
|
-
visitedByField: {};
|
|
551
|
-
valid: boolean;
|
|
552
|
-
modified: boolean;
|
|
553
|
-
touched: boolean;
|
|
554
|
-
visited: boolean;
|
|
555
|
-
submitted: boolean;
|
|
556
|
-
valueGetter: Function;
|
|
557
|
-
allowSubmit: boolean;
|
|
558
|
-
validate: Function;
|
|
559
|
-
onChange: Function;
|
|
560
|
-
onSubmit: (...args: any[] | unknown[]) => any;
|
|
561
|
-
onFormReset: Function;
|
|
562
|
-
registerField: Function;
|
|
563
|
-
onFocus: Function;
|
|
564
|
-
onBlur: Function;
|
|
565
|
-
onUnshift: Function;
|
|
566
|
-
onPush: Function;
|
|
567
|
-
onInsert: Function;
|
|
568
|
-
onPop: Function;
|
|
569
|
-
onRemove: Function;
|
|
570
|
-
onReplace: Function;
|
|
571
|
-
onMove: Function;
|
|
572
|
-
};
|
|
573
|
-
}, {}, {
|
|
574
|
-
isValid(): boolean;
|
|
575
|
-
formErrors(): KeyValue<string> | undefined;
|
|
576
|
-
getErrors(): KeyValue<string>;
|
|
577
|
-
/**
|
|
578
|
-
* @hidden
|
|
579
|
-
*/
|
|
580
|
-
accumulatedForceUpdate(): void;
|
|
581
|
-
/**
|
|
582
|
-
* @hidden
|
|
583
|
-
*/
|
|
584
|
-
resetForm(): void;
|
|
585
|
-
/**
|
|
586
|
-
* Method for resetting the form state outside the form component.
|
|
587
|
-
*
|
|
588
|
-
* > Use `onReset` only if you cannot achieve the desired behavior
|
|
589
|
-
* through the Field component or by FormRenderProps.
|
|
590
|
-
*/
|
|
591
|
-
onReset(): void;
|
|
592
|
-
addField(field: string): void;
|
|
593
|
-
validate(fields: object): void;
|
|
594
|
-
onSubmit(event: any): void;
|
|
595
|
-
/**
|
|
596
|
-
* Method for emitting changes to a specific field outside the form component.
|
|
597
|
-
*
|
|
598
|
-
* > Use `onChange` only if you cannot achieve the desired behavior
|
|
599
|
-
* through the Field component by FormRenderProps.
|
|
600
|
-
*/
|
|
601
|
-
onChange(name: string, options: {
|
|
602
|
-
value: any;
|
|
603
|
-
}): void;
|
|
604
|
-
onFocus(name: string): void;
|
|
605
|
-
onBlur(name: string): void;
|
|
606
|
-
onFieldRegister(name: string, validator: FieldValidatorType | FieldValidatorType[] | undefined): () => void;
|
|
607
|
-
isFormValid(errors: KeyValue<any>): boolean;
|
|
608
|
-
isFormModified(modified: KeyValue<boolean>, fields: string[]): boolean;
|
|
609
|
-
isFormHasNotTouched(touched: KeyValue<boolean>, fields: string[]): boolean;
|
|
610
|
-
isFormTouched(touched: KeyValue<boolean>, fields: string[]): boolean;
|
|
611
|
-
isFormVisited(visited: KeyValue<boolean>, fields: string[]): boolean;
|
|
612
|
-
formHasNotTouched(): any;
|
|
613
|
-
allowSubmit(): any;
|
|
614
|
-
valueGetter(fieldName: string): any;
|
|
615
|
-
valueSetter(fieldName: string, value: any): any;
|
|
616
|
-
onArrayAction(name: string): void;
|
|
617
|
-
onInsert(name: string, options: {
|
|
618
|
-
value: any;
|
|
619
|
-
index: number;
|
|
620
|
-
}): void;
|
|
621
|
-
onUnshift(name: string, options: {
|
|
622
|
-
value: any;
|
|
623
|
-
}): void;
|
|
624
|
-
onPush(name: string, options: {
|
|
625
|
-
value: any;
|
|
626
|
-
}): void;
|
|
627
|
-
onPop(name: string): any;
|
|
628
|
-
onRemove(name: string, options: {
|
|
629
|
-
index: number;
|
|
630
|
-
}): any;
|
|
631
|
-
onReplace(name: string, options: {
|
|
632
|
-
value: any;
|
|
633
|
-
index: number;
|
|
634
|
-
}): void;
|
|
635
|
-
onMove(name: string, options: {
|
|
636
|
-
prevIndex: number;
|
|
637
|
-
nextIndex: number;
|
|
638
|
-
}): void;
|
|
639
|
-
onDestroy(): void;
|
|
640
|
-
}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
641
|
-
submitclick: any;
|
|
642
|
-
submit: any;
|
|
643
|
-
}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
644
|
-
renderForm: PropType<(props: FormRenderProps_2) => any>;
|
|
645
|
-
initialValues: PropType<{
|
|
646
|
-
[name: string]: any;
|
|
647
|
-
}>;
|
|
648
|
-
validator: PropType<FormValidatorType_2>;
|
|
649
|
-
ignoreModified: PropType<boolean>;
|
|
650
|
-
}>> & Readonly<{
|
|
651
|
-
onSubmit?: (...args: any[] | unknown[]) => any;
|
|
652
|
-
onSubmitclick?: (...args: any[] | unknown[]) => any;
|
|
653
|
-
}>, {}, {}, {}, {}, string, () => {
|
|
654
|
-
kendoForm: any;
|
|
655
|
-
}, true, {}, any>;
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* @hidden
|
|
659
|
-
*/
|
|
660
|
-
export declare const FormElement: DefineComponent<ExtractPropTypes< {
|
|
661
|
-
horizontal: PropType<boolean>;
|
|
662
|
-
size: {
|
|
663
|
-
type: PropType<"small" | "medium" | "large">;
|
|
664
|
-
validator: (value: string) => boolean;
|
|
665
|
-
};
|
|
666
|
-
}>, {}, {}, {
|
|
667
|
-
formElementClassName(): {
|
|
668
|
-
[x: string]: any;
|
|
669
|
-
'k-form': boolean;
|
|
670
|
-
'k-form-horizontal': boolean;
|
|
671
|
-
};
|
|
672
|
-
}, {
|
|
673
|
-
handleSubmit(e: any): void;
|
|
674
|
-
}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
675
|
-
horizontal: PropType<boolean>;
|
|
676
|
-
size: {
|
|
677
|
-
type: PropType<"small" | "medium" | "large">;
|
|
678
|
-
validator: (value: string) => boolean;
|
|
679
|
-
};
|
|
680
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Represents the props of the Kendo U for Vue FormElement component.
|
|
684
|
-
*/
|
|
685
|
-
export declare interface FormElementProps {
|
|
686
|
-
/**
|
|
687
|
-
* Configures the `size` of the Form.
|
|
688
|
-
*
|
|
689
|
-
* The available options are:
|
|
690
|
-
* - small
|
|
691
|
-
* - medium
|
|
692
|
-
* - large
|
|
693
|
-
* - null—Does not set a size `class`.
|
|
694
|
-
*
|
|
695
|
-
* @default `medium`
|
|
696
|
-
*/
|
|
697
|
-
size?: null | 'small' | 'medium' | 'large';
|
|
698
|
-
/**
|
|
699
|
-
* If set to `true` enable the horizontal layout of the form editors.
|
|
700
|
-
*/
|
|
701
|
-
horizontal?: boolean;
|
|
702
|
-
/**
|
|
703
|
-
* @hidden
|
|
704
|
-
*/
|
|
705
|
-
[customProp: string]: any;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
/**
|
|
709
|
-
* Represents the props of the Kendo U for Vue Form component.
|
|
710
|
-
*/
|
|
711
|
-
export declare interface FormProps {
|
|
712
|
-
/**
|
|
713
|
-
* The initial field values of the Form.
|
|
714
|
-
*
|
|
715
|
-
* > When you initialize the Form fields, set initial values to them. Otherwise, some
|
|
716
|
-
* components might throw errors related to switching from uncontrolled to controlled mode.
|
|
717
|
-
*/
|
|
718
|
-
initialValues?: {
|
|
719
|
-
[name: string]: any;
|
|
720
|
-
};
|
|
721
|
-
/**
|
|
722
|
-
* The validation function for the Form level.
|
|
723
|
-
* Should return key-value pair where the key is the field path and the value is the error message.
|
|
724
|
-
* Nested fields are supported, e.g.: 'users[0].name'.
|
|
725
|
-
* You can use the same field path to access the value from the
|
|
726
|
-
* values object using the `getter` function from the `kendo-vue-common` package.
|
|
727
|
-
* Currently, `validator` supports only synchronous functions.
|
|
728
|
-
*/
|
|
729
|
-
validator?: FormValidatorType;
|
|
730
|
-
/**
|
|
731
|
-
* The submission handler for the Form.
|
|
732
|
-
* Called when at least one field has been modified, the user pressed
|
|
733
|
-
* the **Submit** button, and the form validation was successful.
|
|
734
|
-
*/
|
|
735
|
-
onSubmit?: (values: {
|
|
736
|
-
[name: string]: any;
|
|
737
|
-
}, event?: any) => void;
|
|
738
|
-
/**
|
|
739
|
-
* Called every time the user presses the **Submit** button.
|
|
740
|
-
* Useful in advanced scenarios when you need to handle every
|
|
741
|
-
* submit event, even when the form is invalid or not modified state.
|
|
742
|
-
*/
|
|
743
|
-
onSubmitclick?: (event: FormSubmitClickEvent) => void;
|
|
744
|
-
/**
|
|
745
|
-
* The Form content that will be rendered.
|
|
746
|
-
*/
|
|
747
|
-
renderForm?: (props: FormRenderProps) => any;
|
|
748
|
-
/**
|
|
749
|
-
* Set this to `true` to allow the form submit without modified fields.
|
|
750
|
-
*/
|
|
751
|
-
ignoreModified?: boolean;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Represents the props that are passed to the `render` option component of the Form.
|
|
756
|
-
*/
|
|
757
|
-
export declare interface FormRenderProps {
|
|
758
|
-
/**
|
|
759
|
-
* A callback for submitting the Form.
|
|
760
|
-
* Can be passed to the `onClick` property of the **Submit** button.
|
|
761
|
-
*/
|
|
762
|
-
onSubmit?: (event: any) => void;
|
|
763
|
-
/**
|
|
764
|
-
* A callback for emiting changes to a specific field without using the Field component
|
|
765
|
-
* ([see example]({% slug common_scenarios_form %}#toc-changing-the-field-value)).
|
|
766
|
-
*
|
|
767
|
-
* > Use `onChange` only if you cannot achieve the desired behavior through the Field component.
|
|
768
|
-
*/
|
|
769
|
-
onChange?: (name: string, options: {
|
|
770
|
-
value: any;
|
|
771
|
-
}) => void;
|
|
772
|
-
/**
|
|
773
|
-
* A callback for resetting the Form.
|
|
774
|
-
*/
|
|
775
|
-
onFormreset?: () => void;
|
|
776
|
-
/**
|
|
777
|
-
* The key-value pair containing the current errors by field path,
|
|
778
|
-
* combined from both field and form level validators.
|
|
779
|
-
*/
|
|
780
|
-
errors: KeyValue<string>;
|
|
781
|
-
/**
|
|
782
|
-
* Indicates if the Form is valid.
|
|
783
|
-
* If any field is invalid, `valid` is set to `false`.
|
|
784
|
-
*/
|
|
785
|
-
valid: boolean;
|
|
786
|
-
/**
|
|
787
|
-
* Indicates if the Form is touched.
|
|
788
|
-
* If any field is touched, `touched` is set to `true`.
|
|
789
|
-
* The touched state of field is set to `true` when the `onBlur`
|
|
790
|
-
* callback of the Field component is called or when the user tries to submit the form.
|
|
791
|
-
*/
|
|
792
|
-
touched: boolean;
|
|
793
|
-
/**
|
|
794
|
-
* Indicates if the Form is visited.
|
|
795
|
-
* If any field is visited, `visited` is set to `true`.
|
|
796
|
-
* The visited state of field is set to `true` when the `onFocus`
|
|
797
|
-
* callback of the Field component is called or when the user tries to submit the form.
|
|
798
|
-
*/
|
|
799
|
-
visited: boolean;
|
|
800
|
-
/**
|
|
801
|
-
* Indicates if the Form is modified.
|
|
802
|
-
* If any field is modified, `modified` is set to `true`.
|
|
803
|
-
* The modified state of field is set to `true` when the `onChange`
|
|
804
|
-
* callback of the Field component is called for first time.
|
|
805
|
-
*/
|
|
806
|
-
modified: boolean;
|
|
807
|
-
/**
|
|
808
|
-
* Indicates if the Form is successfuly submitted.
|
|
809
|
-
* Useful for detecting if user is leaving the form before saving changes.
|
|
810
|
-
*/
|
|
811
|
-
submitted: boolean;
|
|
812
|
-
/**
|
|
813
|
-
* Indicates if the Form is ready to be submitted.
|
|
814
|
-
* * If `allowSubmit` is set to `true` and the Form is valid, the user will be able to submit the form.
|
|
815
|
-
* * If `allowSubmit` is set to `true` and the Form is not valid, the user will be able to set all fields
|
|
816
|
-
* `touched` and `visited` state to true.
|
|
817
|
-
*
|
|
818
|
-
* Useful for toggling the disabled state of the **Submit** button.
|
|
819
|
-
*/
|
|
820
|
-
allowSubmit: boolean;
|
|
821
|
-
/**
|
|
822
|
-
* A callback for getting the value of a field without using the Field component
|
|
823
|
-
* ([see example]({% slug common_scenarios_form %}#toc-reading-the-field-state)).
|
|
824
|
-
* Useful for creating and modifying the UI based on the field values.
|
|
825
|
-
*/
|
|
826
|
-
valueGetter: (name: string) => any;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* The FormSubmitClick event.
|
|
831
|
-
*/
|
|
832
|
-
export declare interface FormSubmitClickEvent {
|
|
833
|
-
/**
|
|
834
|
-
* Contains the current values of the form.
|
|
835
|
-
*/
|
|
836
|
-
values: {
|
|
837
|
-
[name: string]: any;
|
|
838
|
-
};
|
|
839
|
-
/**
|
|
840
|
-
* The native event.
|
|
841
|
-
*/
|
|
842
|
-
event?: any;
|
|
843
|
-
/**
|
|
844
|
-
* Represents the validity state of the form.
|
|
845
|
-
*/
|
|
846
|
-
isValid: boolean;
|
|
847
|
-
/**
|
|
848
|
-
* Represents the modified state of the form.
|
|
849
|
-
*/
|
|
850
|
-
isModified: boolean;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* The validator function for the Form component.
|
|
855
|
-
*
|
|
856
|
-
* * values - The current values of the form.
|
|
857
|
-
* * valueGetter - Function which can be used to get field value. Supports field paths.
|
|
858
|
-
*
|
|
859
|
-
* Returns key-value pair with errors if such are present. The key
|
|
860
|
-
* is the field path, where the value is the error message.
|
|
861
|
-
*/
|
|
862
|
-
export declare type FormValidatorType = (values: any, valueGetter: (name: string) => any) => KeyValue<string> | undefined;
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
*
|
|
866
|
-
*/
|
|
867
|
-
export declare interface KeyValue<ValueType> {
|
|
868
|
-
[name: string]: ValueType;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
export { }
|
|
8
|
+
import { FieldProps } from './interfaces/FieldProps.js';
|
|
9
|
+
import { FieldRenderProps } from './interfaces/FieldRenderProps.js';
|
|
10
|
+
import { FieldInjectedProps } from './interfaces/FieldInjectedProps.js';
|
|
11
|
+
import { FormProps } from './interfaces/FormProps.js';
|
|
12
|
+
import { FormRenderProps } from './interfaces/FormRenderProps.js';
|
|
13
|
+
import { Field } from './Field.js';
|
|
14
|
+
import { Form } from './Form.js';
|
|
15
|
+
import { FormValidatorType } from './interfaces/FormValidator.js';
|
|
16
|
+
import { FieldValidatorType } from './interfaces/FieldValidator.js';
|
|
17
|
+
import { FieldArray } from './FieldArray.js';
|
|
18
|
+
import { FieldArrayProps } from './interfaces/FieldArrayProps.js';
|
|
19
|
+
import { FieldArrayRenderProps } from './interfaces/FieldArrayRenderProps.js';
|
|
20
|
+
import { KeyValue } from './interfaces/KeyValue.js';
|
|
21
|
+
import { FieldWrapper, FieldWrapperProps } from './FieldWrapper.js';
|
|
22
|
+
import { FormElement, FormElementProps } from './FormElement.js';
|
|
23
|
+
import { FormSubmitClickEvent } from './interfaces/FormSubmitClickEvent.js';
|
|
24
|
+
export { FieldArray, type FieldArrayProps, type FieldArrayRenderProps, Field, type FieldProps, type FieldRenderProps, Form, type FormProps, type FormRenderProps, type FieldInjectedProps, type FormValidatorType, type FieldValidatorType, type KeyValue, FieldWrapper, type FieldWrapperProps, FormElement, type FormElementProps, type FormSubmitClickEvent };
|