UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

98 lines 4.73 kB
export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<{ /** * Optional flag to denote if this field has an error or warning to display. * If value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added. * If value is `alert`: A visual orange warning ring is added to the `FormField.Input`. */ error: "error" | "alert" | undefined; /** * Optional `id` provided to `FormField`'s subcomponents as HTML attributes: * - `FormField.Input` will set `aria-describedby` to `hint-${id}` * - `FormField.Input` will set `id` to `input-${id}` * - `FormField.Label` will set `htmlFor` to `input-${id}` * - `FormField.Hint` will set `id` to `hint-${id}` * * If a value is not provided, a unique id will be automatically created by `useUniqueId()`. * @default {useUniqueId} */ id: string; /** * Optional flag to denote if this field is required. When true the `FormField.Input` will have * `required` set to true, and an asterisk will be appended to the `FormField.Label`. */ isRequired: boolean; orientation: "horizontal" | "vertical" | "horizontalEnd" | "horizontalStart"; }> & {} & {}) | undefined) => { state: { id: string; /** * Optional flag to denote if this field has an error or warning to display. * If value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added. * If value is `alert`: A visual orange warning ring is added to the `FormField.Input`. */ error: "error" | "alert" | undefined; /** * Optional flag to denote if this field is required. When true the `FormField.Input` will have * `required` set to true, and an asterisk will be appended to the `FormField.Label`. */ isRequired: boolean; orientation: "horizontal" | "vertical" | "horizontalEnd" | "horizontalStart"; }; events: {}; }) & import("@workday/canvas-kit-react/common").ModelExtras<{ /** * Optional flag to denote if this field has an error or warning to display. * If value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added. * If value is `alert`: A visual orange warning ring is added to the `FormField.Input`. */ error: "error" | "alert" | undefined; /** * Optional `id` provided to `FormField`'s subcomponents as HTML attributes: * - `FormField.Input` will set `aria-describedby` to `hint-${id}` * - `FormField.Input` will set `id` to `input-${id}` * - `FormField.Label` will set `htmlFor` to `input-${id}` * - `FormField.Hint` will set `id` to `hint-${id}` * * If a value is not provided, a unique id will be automatically created by `useUniqueId()`. * @default {useUniqueId} */ id: string; /** * Optional flag to denote if this field is required. When true the `FormField.Input` will have * `required` set to true, and an asterisk will be appended to the `FormField.Label`. */ isRequired: boolean; orientation: "horizontal" | "vertical" | "horizontalEnd" | "horizontalStart"; }, {}, { id: string; /** * Optional flag to denote if this field has an error or warning to display. * If value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added. * If value is `alert`: A visual orange warning ring is added to the `FormField.Input`. */ error: "error" | "alert" | undefined; /** * Optional flag to denote if this field is required. When true the `FormField.Input` will have * `required` set to true, and an asterisk will be appended to the `FormField.Label`. */ isRequired: boolean; orientation: "horizontal" | "vertical" | "horizontalEnd" | "horizontalStart"; }, {}, { state: { id: string; /** * Optional flag to denote if this field has an error or warning to display. * If value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added. * If value is `alert`: A visual orange warning ring is added to the `FormField.Input`. */ error: "error" | "alert" | undefined; /** * Optional flag to denote if this field is required. When true the `FormField.Input` will have * `required` set to true, and an asterisk will be appended to the `FormField.Label`. */ isRequired: boolean; orientation: "horizontal" | "vertical" | "horizontalEnd" | "horizontalStart"; }; events: {}; }>; //# sourceMappingURL=useFormFieldModel.d.ts.map