@ucloud-pccl/react-components
Version:
UCloud pccl react components
30 lines (29 loc) • 998 B
TypeScript
import { Moment } from 'moment';
import { TDate } from '@z-r/calendar/types/interface';
import { Size } from 'src/type';
import LOCALE from './locale/zh_CN';
import { TShortcut } from './Footer';
interface TProps<D> {
value?: TDate | null;
defaultValue?: TDate | null;
onChange?: (v: Moment | null) => void;
onInitialChange?: (v: Moment | null) => void;
rules?: any;
size?: Size;
format?: string | string[];
nullable?: boolean;
display?: D;
disabled?: boolean;
popoverProps?: any;
zIndex?: number;
getCalendarContainer?: (triggerNode: Element) => Element;
locale?: typeof LOCALE;
status?: 'default' | 'error';
placeholder?: string;
shortcuts?: TShortcut[] | null;
}
interface DisplayToFormatAndTimeMode<D> {
(display?: D): [string[]] | [string[], string[]];
}
declare const usePicker: <D>(props: TProps<D>, displayToFormatAndTimeMode: DisplayToFormatAndTimeMode<D>, mode: 'date' | 'month') => any[];
export default usePicker;