@progress/kendo-react-form 13.3.0 → 13.4.0-develop.1
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 +19 -0
- package/FieldArray.d.ts +14 -0
- package/FieldWrapper.d.ts +45 -0
- package/Form.d.ts +274 -0
- package/FormContext.d.ts +57 -0
- package/FormElement.d.ts +95 -0
- package/FormElement.js +1 -1
- package/FormElement.mjs +19 -19
- package/FormFieldSet.d.ts +67 -0
- package/FormSeparator.d.ts +47 -0
- package/dist/cdn/js/kendo-react-form.js +1 -1
- package/index.d.mts +22 -1034
- package/index.d.ts +22 -1034
- package/interfaces/FieldArrayProps.d.ts +35 -0
- package/interfaces/FieldArrayRenderProps.d.ts +96 -0
- package/interfaces/FieldProps.d.ts +76 -0
- package/interfaces/FieldRenderProps.d.ts +13 -0
- package/interfaces/FieldValidator.d.ts +19 -0
- package/interfaces/FormProps.d.ts +137 -0
- package/interfaces/FormRenderProps.d.ts +130 -0
- package/interfaces/FormSubmitClickEvent.d.ts +30 -0
- package/interfaces/FormValidator.d.ts +17 -0
- package/interfaces/Gutters.d.ts +25 -0
- package/interfaces/KeyValue.d.ts +13 -0
- package/interfaces/ResponsiveFormBreakPoint.d.ts +25 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +3 -3
- package/utils.d.ts +66 -0
- package/utils.mjs +19 -20
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { FieldValidatorType } from './FieldValidator.js';
|
|
9
|
+
/**
|
|
10
|
+
* Contains the props for the FieldArray component that you use inside forms.
|
|
11
|
+
*/
|
|
12
|
+
export interface FieldArrayProps {
|
|
13
|
+
/**
|
|
14
|
+
* Sets the field name in the form state.
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Can be set to a React component.
|
|
19
|
+
* [`FieldArrayRenderProps`](https://www.telerik.com/kendo-react-ui/components/form/api/fieldarrayrenderprops).
|
|
20
|
+
*/
|
|
21
|
+
component: React.ComponentType<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Validates the field array and returns error messages.
|
|
24
|
+
* Only synchronous functions are supported.
|
|
25
|
+
*/
|
|
26
|
+
validator?: FieldValidatorType | FieldValidatorType[];
|
|
27
|
+
/**
|
|
28
|
+
* Provides child elements that are passed to the rendered component.
|
|
29
|
+
*/
|
|
30
|
+
children?: any;
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
[customProp: string]: any;
|
|
35
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Contains props that are passed to components rendered inside FieldArray components.
|
|
10
|
+
*/
|
|
11
|
+
export interface FieldArrayRenderProps {
|
|
12
|
+
/**
|
|
13
|
+
* Represents the current value of the FieldArray
|
|
14
|
+
* ([see example](https://www.telerik.com/kendo-react-ui/components/form/custom-components#toc-using-basic-properties)).
|
|
15
|
+
*/
|
|
16
|
+
value: any;
|
|
17
|
+
/**
|
|
18
|
+
* Contains the error message from validation.
|
|
19
|
+
* The field is valid when this is empty.
|
|
20
|
+
*/
|
|
21
|
+
validationMessage: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Shows whether the user has interacted with the field.
|
|
24
|
+
* Becomes true when the field loses focus.
|
|
25
|
+
*/
|
|
26
|
+
touched: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Shows whether the field value has changed from its initial value.
|
|
29
|
+
* Becomes true when the field value changes for the first time.
|
|
30
|
+
*/
|
|
31
|
+
modified: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Shows whether the user has focused on the field.
|
|
34
|
+
* Becomes true when the field receives focus.
|
|
35
|
+
*/
|
|
36
|
+
visited: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Shows whether the field passes validation and has been touched.
|
|
39
|
+
*/
|
|
40
|
+
valid: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Contains child elements that are passed to the FieldArray.
|
|
43
|
+
*/
|
|
44
|
+
children: any;
|
|
45
|
+
/**
|
|
46
|
+
* Contains the field name in the form state.
|
|
47
|
+
*/
|
|
48
|
+
name: string;
|
|
49
|
+
/**
|
|
50
|
+
* Adds a value to the beginning of the array.
|
|
51
|
+
*/
|
|
52
|
+
onUnshift: (options: {
|
|
53
|
+
value: any;
|
|
54
|
+
}) => number;
|
|
55
|
+
/**
|
|
56
|
+
* Adds a value to the end of the array.
|
|
57
|
+
*/
|
|
58
|
+
onPush: (options: {
|
|
59
|
+
value: any;
|
|
60
|
+
}) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Inserts a value at a specific position in the array.
|
|
63
|
+
*/
|
|
64
|
+
onInsert: (options: {
|
|
65
|
+
value: any;
|
|
66
|
+
index: number;
|
|
67
|
+
}) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Removes and returns the last value from the array.
|
|
70
|
+
*/
|
|
71
|
+
onPop: () => any;
|
|
72
|
+
/**
|
|
73
|
+
* Removes a value at a specific position in the array.
|
|
74
|
+
*/
|
|
75
|
+
onRemove: (options: {
|
|
76
|
+
index: number;
|
|
77
|
+
}) => any;
|
|
78
|
+
/**
|
|
79
|
+
* Replaces a value at a specific position in the array.
|
|
80
|
+
*/
|
|
81
|
+
onReplace: (options: {
|
|
82
|
+
value: any;
|
|
83
|
+
index: number;
|
|
84
|
+
}) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Moves a value from one position to another in the array.
|
|
87
|
+
*/
|
|
88
|
+
onMove: (options: {
|
|
89
|
+
prevIndex: number;
|
|
90
|
+
nextIndex: number;
|
|
91
|
+
}) => void;
|
|
92
|
+
/**
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
95
|
+
[customProp: string]: any;
|
|
96
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { FieldValidatorType } from './FieldValidator.js';
|
|
9
|
+
import { ResponsiveFormBreakPoint } from './ResponsiveFormBreakPoint.js';
|
|
10
|
+
/**
|
|
11
|
+
* Contains the props for the Field component that you use inside forms.
|
|
12
|
+
*/
|
|
13
|
+
export interface FieldProps {
|
|
14
|
+
/**
|
|
15
|
+
* Sets the field name in the form state.
|
|
16
|
+
* You can use nested fields like `user.age` and `users[0].name`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```jsx
|
|
20
|
+
* <Field name="user.age" component="input" />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Can be set to a React component or to the name of an HTML element,
|
|
26
|
+
* for example, `input`, `select`, and `textarea`.
|
|
27
|
+
* The props that are passed to the component are the
|
|
28
|
+
* [`FieldRenderProps`](https://www.telerik.com/kendo-react-ui/components/form/api/fieldrenderprops).
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <Field name="user.name" component="input" />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
component: string | React.ComponentType<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Validates the field value and returns error messages.
|
|
38
|
+
*
|
|
39
|
+
* Only synchronous functions are supported.
|
|
40
|
+
* Use `useMemo` to avoid infinite loops when using an array of validators.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* const validator = value => value ? "" : "This field is required.";
|
|
45
|
+
* <Field name="user.email" component="input" validator={validator} />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
validator?: FieldValidatorType | FieldValidatorType[];
|
|
49
|
+
/**
|
|
50
|
+
* Provides child elements that are passed to the rendered component.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```jsx
|
|
54
|
+
* <Field name="user.name" component="input">
|
|
55
|
+
* <span>Additional content</span>
|
|
56
|
+
* </Field>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
children?: any;
|
|
60
|
+
/**
|
|
61
|
+
* Sets how many columns the field spans in the form layout.
|
|
62
|
+
*/
|
|
63
|
+
colSpan?: number | ResponsiveFormBreakPoint[];
|
|
64
|
+
/**
|
|
65
|
+
* Handles changes to the field value.
|
|
66
|
+
*
|
|
67
|
+
* Use this to update related fields. The Form automatically updates its state when this fires.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```jsx
|
|
71
|
+
* const handleChange = event => console.log(event);
|
|
72
|
+
* <Field name="user.name" component="input" onChange={handleChange} />
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
onChange?: (event: any) => void;
|
|
76
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { FieldRenderPropsBase } from '@progress/kendo-react-common';
|
|
9
|
+
/**
|
|
10
|
+
* Contains props that are passed to components rendered inside Field components.
|
|
11
|
+
*/
|
|
12
|
+
export interface FieldRenderProps extends FieldRenderPropsBase {
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Validates a single field and returns an error message or success.
|
|
10
|
+
*
|
|
11
|
+
* * value - Contains the current field value
|
|
12
|
+
* * valueGetter - Gets values from other fields using field paths like 'user.name'
|
|
13
|
+
* * fieldProps - Contains the field's props, including the field name
|
|
14
|
+
*
|
|
15
|
+
* Returns a string for validation errors or undefined for successful validation.
|
|
16
|
+
*/
|
|
17
|
+
export type FieldValidatorType = (value: any, valueGetter: (name: string) => any, fieldProps: {
|
|
18
|
+
name: string;
|
|
19
|
+
}) => string | undefined;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { FormRenderProps } from './FormRenderProps.js';
|
|
9
|
+
import { FormValidatorType } from './FormValidator.js';
|
|
10
|
+
import { FormSubmitClickEvent } from './FormSubmitClickEvent.js';
|
|
11
|
+
/**
|
|
12
|
+
* Contains the props for the KendoReact Form component.
|
|
13
|
+
*/
|
|
14
|
+
export interface FormProps {
|
|
15
|
+
/**
|
|
16
|
+
* Sets the starting values for form fields.
|
|
17
|
+
*
|
|
18
|
+
* Set initial values to prevent errors when switching from uncontrolled to controlled mode.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```jsx
|
|
22
|
+
* const initialValues = { user: { name: '', age: 0 } };
|
|
23
|
+
* <Form initialValues={initialValues} render={props => <form>form content</form>} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
initialValues?: {
|
|
27
|
+
[name: string]: any;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Validation errors that override field and form validators.
|
|
31
|
+
*
|
|
32
|
+
* Provides validation errors directly as an object, unlike the validator prop which expects a callback.
|
|
33
|
+
* When both validator and errors exist for a field, the errors prop takes precedence.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```jsx
|
|
37
|
+
* const [errors, setErrors] = useState({});
|
|
38
|
+
* const handleSubmit = async (data) => {
|
|
39
|
+
* const response = await submitToServer(data);
|
|
40
|
+
* if (response.errors) {
|
|
41
|
+
* setErrors(response.errors);
|
|
42
|
+
* }
|
|
43
|
+
* };
|
|
44
|
+
* <Form errors={errors} onSubmit={handleSubmit} render={props => <FormElement>form content</FormElement>} />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
errors?: {
|
|
48
|
+
[name: string]: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Fires each time any field value changes.
|
|
52
|
+
*
|
|
53
|
+
* The third parameter `valueGetter` allows accessing other field values, useful for cross-field validation or clearing related errors.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```jsx
|
|
57
|
+
* const handleChange = (fieldName, value, valueGetter) => {
|
|
58
|
+
* // For nested fields like 'user.name', access related fields like 'user.email'
|
|
59
|
+
* if (fieldName === 'user.name') {
|
|
60
|
+
* const email = valueGetter('user.email');
|
|
61
|
+
* console.log('Name changed:', value, 'Email is:', email);
|
|
62
|
+
* }
|
|
63
|
+
* // Clear error for the changed field
|
|
64
|
+
* if (formErrors[fieldName]) {
|
|
65
|
+
* setFormErrors(prev => ({ ...prev, [fieldName]: '' }));
|
|
66
|
+
* }
|
|
67
|
+
* };
|
|
68
|
+
* <Form errors={formErrors} onChange={handleChange} render={props => <FormElement>form content</FormElement>} />
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
onChange?: (fieldName: string, value: any, valueGetter: (name: string) => any) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Validates the entire form and returns error messages.
|
|
74
|
+
*
|
|
75
|
+
* Return a key-value pair where the key is the field path and the value is the error message.
|
|
76
|
+
* You can validate nested fields like 'users[0].name'.
|
|
77
|
+
* Only synchronous functions are supported.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```jsx
|
|
81
|
+
* const validator = values => ({ user: { name: values.user.name ? "" : "Name is required." } });
|
|
82
|
+
* <Form validator={validator} render={props => <form> form content </form>} />
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
validator?: FormValidatorType;
|
|
86
|
+
/**
|
|
87
|
+
* Handles form submission when validation passes and fields are modified.
|
|
88
|
+
*
|
|
89
|
+
* Fires when at least one field is modified, the user clicks Submit, and validation passes.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```jsx
|
|
93
|
+
* const handleSubmit = (values, event) => console.log(values);
|
|
94
|
+
* <Form onSubmit={handleSubmit} render={props => <form> form content </form>} />
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
onSubmit?: (values: {
|
|
98
|
+
[name: string]: any;
|
|
99
|
+
}, event?: React.SyntheticEvent<any>) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Handles every submit button click, even when the form is invalid or unchanged.
|
|
102
|
+
*
|
|
103
|
+
* Use this for advanced scenarios where you need to handle all submit events.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```jsx
|
|
107
|
+
* const handleSubmitClick = event => console.log(event);
|
|
108
|
+
* <Form onSubmitClick={handleSubmitClick} render={props => <form> form content </form>} />
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
onSubmitClick?: (event: FormSubmitClickEvent) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Renders the form content using the provided render function.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```jsx
|
|
117
|
+
* const renderForm = props => <form> form content </form>;
|
|
118
|
+
* <Form render={renderForm} />
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
render: (props: FormRenderProps) => any;
|
|
122
|
+
/**
|
|
123
|
+
* Allows the form to submit even when no fields have been modified.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```jsx
|
|
127
|
+
* <Form ignoreModified={true} render={props => <form>form content </form>} />
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
ignoreModified?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* @hidden
|
|
133
|
+
* This prop comes from the `withId` HOC and is used internally by the Form.
|
|
134
|
+
* It replaces the previously used guid() function and generates an `id` of the Form.
|
|
135
|
+
*/
|
|
136
|
+
id?: string;
|
|
137
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { KeyValue } from './KeyValue.js';
|
|
9
|
+
/**
|
|
10
|
+
* Contains props that are passed to the form's render function.
|
|
11
|
+
*/
|
|
12
|
+
export interface FormRenderProps {
|
|
13
|
+
/**
|
|
14
|
+
* Submits the form when called.
|
|
15
|
+
* Use this with the onClick property of Submit buttons.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```jsx
|
|
19
|
+
* const handleSubmit = event => console.log("Form submitted");
|
|
20
|
+
* <Button onClick={props.onSubmit}>Submit</Button>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
onSubmit: (event: React.SyntheticEvent<any>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* A callback for emitting changes to a specific field without using the Field component
|
|
26
|
+
* ([see example](https://www.telerik.com/kendo-react-ui/components/form/advanced-scenarios#toc-changing-the-field-value)).
|
|
27
|
+
*
|
|
28
|
+
* > Use `onChange` only if you cannot achieve the desired behavior through the Field component.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* props.onChange("user.name", { value: "John Doe" });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
onChange: (name: string, options: {
|
|
36
|
+
value: any;
|
|
37
|
+
}) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Resets the form to its initial state.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```jsx
|
|
43
|
+
* <Button onClick={props.onFormReset}>Reset</Button>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
onFormReset: () => void;
|
|
47
|
+
/**
|
|
48
|
+
* Contains current validation errors organized by field path.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```jsx
|
|
52
|
+
* console.log(props.errors);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
errors: KeyValue<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Shows whether the form passes all validation rules.
|
|
58
|
+
* Becomes false if any field fails validation.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```jsx
|
|
62
|
+
* console.log(props.valid);
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
valid: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Shows whether the user has interacted with any field.
|
|
68
|
+
* Becomes true when any field loses focus or the user tries to submit.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```jsx
|
|
72
|
+
* console.log(props.touched);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
touched: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Shows whether the user has focused on any field.
|
|
78
|
+
* Becomes true when any field receives focus or the user tries to submit.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```jsx
|
|
82
|
+
* console.log(props.visited);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
visited: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Shows whether any field value has changed from its initial value.
|
|
88
|
+
* Becomes true when any field value changes for the first time.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```jsx
|
|
92
|
+
* console.log(props.modified);
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
modified: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Shows whether the form has been successfully submitted.
|
|
98
|
+
* Use this to detect if the user is leaving before saving changes.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```jsx
|
|
102
|
+
* console.log(props.submitted);
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
submitted: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Shows whether the form can be submitted.
|
|
108
|
+
* When true and form is valid, you can submit. When true and form is invalid, you can show all validation errors.
|
|
109
|
+
*
|
|
110
|
+
* Use this to control the disabled state of Submit buttons.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```jsx
|
|
114
|
+
* console.log(props.allowSubmit);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
allowSubmit: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* A callback for getting the value of a field without using the Field component
|
|
120
|
+
* ([see example](https://www.telerik.com/kendo-react-ui/components/form/advanced-scenarios#toc-reading-the-field-state)).
|
|
121
|
+
* Useful for creating and modifying the UI based on the field values.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```jsx
|
|
125
|
+
* const value = props.valueGetter("user.name");
|
|
126
|
+
* console.log(value);
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
valueGetter: (name: string) => any;
|
|
130
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Contains data for the form submit click event.
|
|
10
|
+
*/
|
|
11
|
+
export interface FormSubmitClickEvent {
|
|
12
|
+
/**
|
|
13
|
+
* Provides the current values from all form fields.
|
|
14
|
+
*/
|
|
15
|
+
values: {
|
|
16
|
+
[name: string]: any;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Contains the original browser event that triggered the submit.
|
|
20
|
+
*/
|
|
21
|
+
event?: React.SyntheticEvent<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Shows whether the form passes all validation rules.
|
|
24
|
+
*/
|
|
25
|
+
isValid: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Shows whether any form fields have been changed from their initial values.
|
|
28
|
+
*/
|
|
29
|
+
isModified: boolean;
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { KeyValue } from './KeyValue.js';
|
|
9
|
+
/**
|
|
10
|
+
* Validates an entire form and returns error messages.
|
|
11
|
+
*
|
|
12
|
+
* * values - Contains the current values from all form fields
|
|
13
|
+
* * valueGetter - Gets field values using field paths like 'user.name'
|
|
14
|
+
*
|
|
15
|
+
* Returns a key-value pair where the key is the field path and the value is the error message.
|
|
16
|
+
*/
|
|
17
|
+
export type FormValidatorType = (values: any, valueGetter: (name: string) => any) => KeyValue<string> | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { ResponsiveFormBreakPoint } from './ResponsiveFormBreakPoint.js';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the [gutters](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) configuration for a form layout.
|
|
11
|
+
* It allows defining the spacing between the columns and rows of the form.
|
|
12
|
+
* Each property can be a number or an array of responsive breakpoints.
|
|
13
|
+
*/
|
|
14
|
+
export interface Gutters {
|
|
15
|
+
/**
|
|
16
|
+
* Defines the gutters for the columns in the form.
|
|
17
|
+
* Can be a number or an array of responsive breakpoints.
|
|
18
|
+
*/
|
|
19
|
+
cols?: string | number | ResponsiveFormBreakPoint[];
|
|
20
|
+
/**
|
|
21
|
+
* Defines the gutters for the rows in the form.
|
|
22
|
+
* Can be a number or an array of responsive breakpoints.
|
|
23
|
+
*/
|
|
24
|
+
rows?: string | number | ResponsiveFormBreakPoint[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Represents a key-value pair collection where keys are strings.
|
|
10
|
+
*/
|
|
11
|
+
export interface KeyValue<ValueType> {
|
|
12
|
+
[name: string]: ValueType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Defines responsive breakpoints for form layouts.
|
|
10
|
+
* Each breakpoint sets minimum and maximum widths and values for columns or spacing at different screen sizes.
|
|
11
|
+
*/
|
|
12
|
+
export interface ResponsiveFormBreakPoint {
|
|
13
|
+
/**
|
|
14
|
+
* Sets the minimum screen width in pixels for this breakpoint.
|
|
15
|
+
*/
|
|
16
|
+
minWidth?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the maximum screen width in pixels for this breakpoint.
|
|
19
|
+
*/
|
|
20
|
+
maxWidth?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the number of columns or spacing for form controls at this screen size.
|
|
23
|
+
*/
|
|
24
|
+
value: number | string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PackageMetadata } from '@progress/kendo-licensing';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const packageMetadata: PackageMetadata;
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-form",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-form",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1770218860,version:"13.4.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
// Generated file. DO NOT EDIT.
|
|
1
2
|
/**
|
|
2
|
-
* @
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
3
|
+
* @hidden
|
|
7
4
|
*/
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export const packageMetadata = Object.freeze({
|
|
6
|
+
name: '@progress/kendo-react-form',
|
|
7
|
+
productName: 'KendoReact',
|
|
8
|
+
productCode: 'KENDOUIREACT',
|
|
9
|
+
productCodes: ['KENDOUIREACT'],
|
|
10
|
+
publishDate: 0,
|
|
11
|
+
version: '13.4.0-develop.1',
|
|
12
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
16
13
|
});
|
|
17
|
-
export {
|
|
18
|
-
e as packageMetadata
|
|
19
|
-
};
|