@progress/kendo-react-common
Version:
React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package
103 lines (102 loc) • 4 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2023 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------*/
/**
* Represents the basic props of the KendoReact form components.
*
* For runnable examples on forms support, refer to the documentation of the respective form component:
* * [DateInput]({% slug forms_dateinput %})
* * [DatePicker]({% slug forms_datepicker %})
* * [TimePicker]({% slug forms_timepicker %})
* * [DateTimePicker]({% slug forms_datetimepicker %})
* * [AutoComplete]({% slug forms_autocomplete %})
* * [ComboBox]({% slug forms_combobox %})
* * [DropDownList]({% slug forms_dropdownlist %})
* * [MultiSelect]({% slug forms_multiselect %})
* * [Input]({% slug forms_input %})
* * [MaskedTextBox]({% slug forms_maskedtextbox %})
* * [NumericTextBox]({% slug forms_numerictextbox %})
* * [Checkbox]({% slug forms_support_checkbox %})
* * [Switch]({% slug forms_support_switch %})
*/
export interface FormComponentProps {
/**
* Controls the form error message of the component. If set to an empty string, no error will be thrown.
*
* This property is part of the [FormComponentProps]({% slug api_common_formcomponentprops %}) interface.
*/
validationMessage?: string;
/**
* Specifies if `null` is a valid value for the component.
*
* This property is part of the [FormComponentProps]({% slug api_common_formcomponentprops %}) interface.
*/
required?: boolean;
/**
* Specifies the `name` property of the `input` DOM element.
*
* This property is part of the [FormComponentProps]({% slug api_common_formcomponentprops %}) interface.
*/
name?: string;
/**
* Overrides the validity state of the component.
* If `valid` is set, the `required` property will be ignored.
*
* This property is part of the [FormComponentProps]({% slug api_common_formcomponentprops %}) interface.
*/
valid?: boolean;
/**
* If set to `false`, no visual representation of the invalid state of the component will be applied.
*
* This property is part of the [FormComponentProps]({% slug api_common_formcomponentprops %}) interface.
*/
validityStyles?: boolean;
/**
* @hidden
*/
value?: any;
/**
* @hidden
*/
defaultValue?: any;
}
/**
* Represents the `validity` state of the KendoReact form components.
*
* For runnable examples on forms support, refer to the documentation of the respective form component:
* * [DateInput]({% slug forms_dateinput %})
* * [DatePicker]({% slug forms_datepicker %})
* * [TimePicker]({% slug forms_timepicker %})
* * [DateTimePicker]({% slug forms_timepicker %})
* * [AutoComplete]({% slug forms_autocomplete %})
* * [ComboBox]({% slug forms_combobox %})
* * [DropDownList]({% slug forms_dropdownlist %})
* * [MultiSelect]({% slug forms_multiselect %})
* * [Input]({% slug forms_input %})
* * [MaskedTextBox]({% slug forms_maskedtextbox %})
* * [NumericTextBox]({% slug forms_numerictextbox %})
* * [Checkbox]({% slug forms_support_checkbox %})
* * [Switch]({% slug forms_support_switch %})
*/
export interface FormComponentValidity {
readonly badInput?: boolean;
readonly customError: boolean;
readonly patternMismatch?: boolean;
readonly rangeOverflow?: boolean;
readonly rangeUnderflow?: boolean;
readonly stepMismatch?: boolean;
readonly tooLong?: boolean;
readonly tooShort?: boolean;
readonly typeMismatch?: boolean;
readonly valid: boolean;
readonly valueMissing: boolean;
}
/**
* @hidden
*/
export declare abstract class FormComponent {
abstract get value(): any;
abstract get validity(): FormComponentValidity;
abstract get name(): string | undefined;
}