/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { DateInputSettings, DateInputFormatPlaceholder, DateInputCommonPackageProps } from './models/index.js'; import { FormComponentProps, FormComponentValidity, DateInputsClassStructure } from '@progress/kendo-react-common'; import { DateInputOptions } from './models/dateinput-options'; import * as React from 'react'; /** * The arguments for the `change` event of the DateInput. The generic argument sets the target type of the event. Defaults to `DateInput`. */ export interface DateInputChangeEvent { /** The native DOM event. */ nativeEvent?: any; /** The React synthetic event. */ syntheticEvent: React.SyntheticEvent; /** The new `value`. */ value: Date | null; /** The component instance that fired the event. */ target: T; } /** * Represents the props of the [KendoReact DateInput component](https://www.telerik.com/kendo-react-ui/components/dateinputs/dateinput). The generic argument is passed to the `onChange` property and is used as a target in the [`DateInputChangeEvent`](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/dateinputchangeevent) interface. */ export interface DateInputProps extends FormComponentProps, DateInputSettings, DateInputCommonPackageProps { /** @hidden */ _ref?: React.MutableRefObject; /** * @hidden */ children?: React.ReactNode; /** * @hidden */ disableSelection?: boolean; /** * Set a custom CSS class on the DateInput DOM element. */ className?: string; /** * Set the `value` of the DateInput. */ value?: Date | null; /** * Set the initial `value` when the component is uncontrolled. * If `value` is not set, the component uses this as its starting value. */ defaultValue?: Date | null; /** * Define the interactive popup type for assistive tech. * Use `grid` (default) or `dialog` based on context. * * @default `grid` * * @remarks * This property is related to accessibility. */ ariaHasPopup?: boolean | 'grid' | 'dialog'; /** * Indicate whether the popup content is expanded. * * @remarks * This property is related to accessibility. */ ariaExpanded?: boolean; /** * Set the ARIA role of the DateInput root element. */ ariaRole?: string; /** * Reference the id of the element that the DateInput controls via ARIA. * * @remarks * This property is related to accessibility. */ ariaControls?: string; /** * Fires when the user edits the `value` ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/dateinput/date-ranges)). */ onChange?: (event: DateInputChangeEvent) => void; /** * Control the `size` of the DateInput. * * The available options are: * - small * - medium * - large * * @default undefined (theme-controlled) * * @example * ```tsx * * ``` */ size?: 'small' | 'medium' | 'large'; /** * Control the corner `rounded` style of the DateInput. * * The available options are: * - small * - medium * - large * - full * - none * * @default undefined (theme-controlled) * * @example * ```tsx * * ``` */ rounded?: 'small' | 'medium' | 'large' | 'full' | 'none'; /** * Control the `fillMode` (background) of the DateInput. * * The available options are: * - solid * - outline * - flat * * @default undefined (theme-controlled) * * @example * ```tsx * * ``` */ fillMode?: 'solid' | 'flat' | 'outline'; /** * Put the component in read-only mode. */ readonly?: boolean; /** * Show a clear button that sets `value` to `null` and fires `onChange`. */ clearButton?: boolean; /** * Apply the `autoFocus` attribute to the internal input. * * @default `false` * * @remarks * This property is related to accessibility. */ autoFocus?: boolean; /** * Autofill missing parts with the current date on blur. * * @default `false` */ autoFill?: boolean; /** * The maximum year to assume to be from the current century when typing two-digit year value ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/dateinput/formats#toc-two---digit-year-max)). * The default value of 68, indicating that typing any value less than 69 will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx. * * @default `68` */ twoDigitYearMax?: number; /** * Indicates whether the mouse scroll can be used to increase/decrease the date segments values. * * @default `true` */ enableMouseWheel?: boolean; /** * @hidden */ unstyled?: DateInputsClassStructure; /** * Pass HTML attributes to the internal focusable input. * Attributes required for core logic are ignored. * * @remarks * This property is related to accessibility. */ inputAttributes?: React.InputHTMLAttributes; } /** * Represents the KendoReact DateInput Component. * * Accepts properties of type [DateInputProps](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/dateinputprops). * Obtaining the `ref` returns an object of type [DateInputHandle](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/dateinputhandle). */ export declare const DateInput: React.ForwardRefExoticComponent & React.RefAttributes>; /** * @hidden * * Internal renderer that emits only the bare `` element — no * `.k-dateinput k-input` wrapper. Used by composite pickers (DatePicker, TimePicker, * DateTimePicker) so the picker itself provides the wrapper, matching the theme spec markup. * * Not part of the public API; consume `DateInput` from outside the package. */ export declare const DateInputInner: React.ForwardRefExoticComponent & React.RefAttributes>; /** * @hidden */ export declare const dateInputDefaultProps: { format: string; defaultValue: null; size: "small" | "medium" | "large" | undefined; rounded: "small" | "none" | "medium" | "large" | "full" | undefined; fillMode: "flat" | "solid" | "outline" | undefined; formatPlaceholder: DateInputFormatPlaceholder; spinners: boolean; disabled: boolean; max: Date; min: Date; minTime: Date; maxTime: Date; validityStyles: boolean; validationMessage: string; placeholder: null; enableMouseWheel: boolean; autoCorrectParts: boolean; autoSwitchParts: boolean; allowCaretMode: boolean; twoDigitYearMax: number; ariaHasPopup: undefined; autoFocus: boolean; }; /** * Represents the PropsContext of the `DateInput` component. * Used for global configuration of all `DateInput` instances. * * For more information, refer to the [DateInputs Props Context](https://www.telerik.com/kendo-react-ui/components/dateinputs/props-context) article. */ export declare const DateInputPropsContext: React.Context<(p: DateInputProps) => DateInputProps>; /** * Represent the `ref` of the DateInput component. */ export interface DateInputHandle { /** * @hidden */ focus: () => void; /** * @hidden */ updateOnPaste: (event: React.SyntheticEvent) => void; /** * Get the props object of the component. */ props: Readonly; /** * Get the formatted text value. */ text: string; /** * Get the resolved configuration `options`. */ options: DateInputOptions; /** * Get the root input DOM element. */ element: HTMLInputElement | null; /** * Get the `name` property. */ name: string | undefined; /** * Get the current `value`. */ value: Date | null; /** * Get the current validity state. */ validity: FormComponentValidity; } export type DateInput = DateInputHandle;