@yamada-ui/calendar
Version:
Yamada UI calendar component
56 lines (53 loc) • 2.33 kB
text/typescript
import * as _yamada_ui_popover from '@yamada-ui/popover';
import * as _yamada_ui_core from '@yamada-ui/core';
import { PropGetter } from '@yamada-ui/core';
import { CalendarProps as CalendarProps$1 } from './calendar.mjs';
import { UseCalendarProps } from './use-calendar.mjs';
import { UseCalendarPickerProps } from './use-calendar-picker.mjs';
import 'react';
import './calendar-header.mjs';
import '@yamada-ui/button';
import '@yamada-ui/icon';
import './use-calendar-header.mjs';
import './month.mjs';
import './month-list.mjs';
import './year-list.mjs';
import 'dayjs';
import '@yamada-ui/form-control';
interface CalendarProps extends Omit<UseCalendarProps<[Date?, Date?]>, "enableMultiple" | "enableRange" | "nextRef" | "prevRef" | "typeRef"> {
}
interface UseRangeDatePickerOptions {
/**
* If `true`, the list element will be closed when value is selected.
*
* @default true
*/
closeOnSelect?: boolean;
/**
* The end date placeholder
*/
endPlaceholder?: string;
/**
* The start date placeholder
*/
startPlaceholder?: string;
}
interface UseRangeDatePickerProps extends UseCalendarPickerProps<CalendarProps>, UseRangeDatePickerOptions {
}
declare const useRangeDatePicker: ({ allowInputBeyond, closeOnSelect, defaultValue, endPlaceholder, maxSelectValues, placeholder, startPlaceholder, value: valueProp, onChange: onChangeProp, ...rest }: UseRangeDatePickerProps) => {
dateToString: (value: Date | undefined) => string | undefined;
inputValue: string[];
value: [(Date | undefined)?, (Date | undefined)?];
getCalendarProps: (props?: CalendarProps$1) => CalendarProps$1;
getContainerProps: PropGetter<"div", undefined>;
getEndInputProps: PropGetter<"input", undefined>;
getFieldProps: PropGetter<"div", undefined>;
getIconProps: _yamada_ui_core.RequiredPropGetter<{
clear: boolean;
} & _yamada_ui_core.HTMLProps, _yamada_ui_core.HTMLProps>;
getPopoverProps: (props?: _yamada_ui_popover.PopoverProps) => _yamada_ui_popover.PopoverProps;
getStartInputProps: PropGetter<"input", undefined>;
onClose: (...args: any[]) => Promise<void> | void;
};
type UseRangeDatePickerReturn = ReturnType<typeof useRangeDatePicker>;
export { type UseRangeDatePickerProps, type UseRangeDatePickerReturn, useRangeDatePicker };