/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { PopupProps } from '@progress/kendo-react-popup'; import { FormComponentProps, FormComponentValidity, AdaptiveModeContextType, WebMcpProps } from '@progress/kendo-react-common'; import { DateInputHandle, DateInputProps } from '../dateinput/DateInput.js'; import { Calendar, CalendarProps } from '../calendar/components/Calendar.js'; import { DatePickerSettings } from './models/index.js'; import { ToggleButtonProps } from './ToggleButton.js'; import { DateInputCommonPackageProps } from '../dateinput/models/index.js'; import * as React from 'react'; /** * The arguments for the `onChange` event of the DatePicker. */ export interface DatePickerChangeEvent { /** The native DOM event. */ nativeEvent?: any; /** The React synthetic event. */ syntheticEvent: React.SyntheticEvent; /** The new `value`. */ value: Date | null; /** The current popup state. */ show: boolean; /** The component instance that fired the event. */ target: DatePickerHandle; } /** * The arguments for the `onOpen` event of the DatePicker. */ export interface DatePickerOpenEvent { /** The component instance that fired the event. */ target: DatePickerHandle; } /** * The arguments for the `onClose` event of the DatePicker. */ export interface DatePickerCloseEvent { /** The component instance that fired the event. */ target: DatePickerHandle; } /** * Represents the props of the [KendoReact DatePicker component](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker). */ export interface DatePickerProps extends DatePickerSettings, FormComponentProps, DateInputCommonPackageProps, Omit, 'defaultValue' | 'onChange' | 'onBlur' | 'onFocus' | 'placeholder'> { /** * Set the initial `value` when the component is uncontrolled ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/default-value)). */ defaultValue?: Date | null; /** * Fires when the user selects a new `value` ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/controlled-state#toc-controlling-the-date-value)). */ onChange?: (event: DatePickerChangeEvent) => void; /** * Fires when the popup opens. */ onOpen?: (event: DatePickerOpenEvent) => void; /** * Fires when the popup closes. */ onClose?: (event: DatePickerCloseEvent) => void; /** * Set the current `value` ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/controlled-state#toc-controlling-the-date-value)). * Provide a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance or `null`. */ value?: Date | null; /** * Control the `size` of the DatePicker. * * The available options are: * - small * - medium * - large * * @default undefined (theme-controlled) * * @example * ```tsx * * ``` */ size?: 'small' | 'medium' | 'large'; /** * Control the corner `rounded` style of the DatePicker. * * 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 DatePicker. * * The available options are: * - solid * - outline * - flat * * @default undefined (theme-controlled) * * @example * ```tsx * * ``` */ fillMode?: 'solid' | 'flat' | 'outline'; /** * Enable adaptive rendering of the popup based on viewport width. * * @default `false` */ adaptive?: boolean; /** * Set the title text in the adaptive popup (action sheet). Use only when `adaptive` is `true`. * If not set, the title matches the `label`. */ adaptiveTitle?: string; /** * Set the subtitle text in the adaptive popup (action sheet). Use only when `adaptive` is `true`. */ adaptiveSubtitle?: string; /** * Apply the `autoFocus` attribute to the internal input element. * * @default `false` * * @remarks * This property is related to accessibility. */ autoFocus?: boolean; /** * @hidden */ visited?: boolean; /** * @hidden */ touched?: boolean; /** * @hidden */ modified?: boolean; /** * Autofill missing date parts with the current date on blur. * * @default `false` */ autoFill?: boolean; /** * Set the upper threshold for interpreting a two-digit year as part of the current century ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/dateinput/formats#toc-two---digit-year-max)). * Values smaller than (`twoDigitYearMax` + 1) map to 20xx. Larger map to 19xx. * * @default `68` */ twoDigitYearMax?: number; /** * Enable mouse wheel to increment or decrement segments. * * @default `true` */ enableMouseWheel?: boolean; /** * Pass HTML attributes to the internal focusable input element. * Attributes required for core logic are ignored. */ inputAttributes?: React.InputHTMLAttributes; /** * Enables Web MCP tool registration for this component. * Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`. */ webMcp?: boolean | WebMcpProps; /** * @hidden * This prop is provided by the withAdaptiveModeContext HOC to subscribe to AdaptiveModeContext. */ _adaptiveMode?: AdaptiveModeContextType; } /** * @hidden */ export interface DatePickerState { value: Date | null; show: boolean; focused: boolean; windowWidth?: number; } /** * Represents the KendoReact DatePicker Component. * * Accepts properties of type [DatePickerProps](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/datepickerprops). * Obtaining the `ref` returns an object of type [DatePickerHandle](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/datepickerhandle). */ export declare const DatePicker: React.ForwardRefExoticComponent>; /** * @hidden */ export declare const datePickerDefaultProps: { defaultShow: boolean; defaultValue: null; dateInput: React.ComponentType>; calendar: React.ComponentType>; toggleButton: React.ComponentType; popup: React.ComponentType; disabled: boolean; format: string; max: Date; min: Date; popupSettings: any; tabIndex: number; weekNumber: boolean; validityStyles: boolean; size: "small" | "medium" | "large" | undefined; rounded: "small" | "none" | "medium" | "large" | "full" | undefined; fillMode: "flat" | "solid" | "outline" | undefined; autoFocus: boolean; }; /** * Represents the PropsContext of the `DatePicker` component. * Used for global configuration of all `DatePicker` 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 DatePickerPropsContext: React.Context<(p: DatePickerProps) => DatePickerProps>; /** * Represent the `ref` of the DatePicker component. */ export interface DatePickerHandle { /** * @hidden */ focus: () => void; /** * Toggles the popup of the DatePicker. */ togglePopup: () => void; /** * Returns the props of the DatePicker component. */ props: DatePickerProps; /** * Returns a boolean value indicating whether the DatePicker is in mobile mode. */ mobileMode: boolean; /** * Returns the HTML element of the DatePicker component. */ element: HTMLSpanElement | null; /** * Gets the Calendar component inside the DatePicker component. */ calendar: Calendar | null; /** * Gets the DateInput component inside the DatePicker component. */ dateInput: DateInputHandle | null; /** * Gets the `name` property of the DatePicker. */ name: string | undefined; /** * Gets the popup state of the DatePicker. */ show: boolean; /** * Represents the validity state into which the DatePicker is set. */ validity: FormComponentValidity; /** * Gets the value of the DatePicker. */ value: Date | null; } export type DatePicker = DatePickerHandle;