import { FC } from "react"; import { CalendarSelectTypes } from "./constants"; export type NvDatePickerValue = (Date | null)[] | Date | null; export interface NvDatePickerOnChangeHandler { (result: (Date | null)[] | Date): void; } /** * Props for the NvDatePicker component * * @param value - Value of date field as date object, or null, or array of two elements with the corresponding values for range mode * @param disablePastDates - Disable past dates pick * @param onChange - Handler on change event * @param range - Allow the selection of date range * @param rangeState - Currently selected value in range mode Useful in cases when date picker is only allowed to select one of the dates * @param auto - If date picker should automatically switch to next value in range mode * @param dateType - Calendar type (Day, month, year) */ export interface NvDatePickerProps { /** Value of date field as date object, or null, or array of two elements with the corresponding values for range mode */ value?: NvDatePickerValue; /** Disable past dates pick */ disablePastDates?: boolean; /** Handler on change event */ onChange?: NvDatePickerOnChangeHandler; /** Allow the selection of date range */ range?: boolean; /** Currently selected value in range mode Useful in cases when date picker is only allowed to select one of the dates */ rangeState?: number; /** If date picker should automatically switch to next value in range mode */ auto?: boolean; /** Calendar type (Day, month, year) */ dateType?: CalendarSelectTypes; } /** * Functional component for a date picker that allows selecting single or range dates. * Manages the state of the selected date(s) and the calendar display mode. * * @param value The initial value of the date picker. * @param disablePastDates Boolean to enable/disable past dates selection. * @param onChange Function to handle date selection changes. * @param range Boolean indicating if the date picker is in range selection mode. * @param rangeState The state of the range selection (start date, end date, or none). * @param auto Boolean to automatically select a date when only one date is allowed. * @param dateType Calendar type (Day, month, year). * @returns A date picker component with day, month, and year modes. */ declare const NvDatePicker: FC; export default NvDatePicker;