@ucloud-pccl/react-components
Version:
UCloud pccl react components
64 lines (63 loc) • 2.17 kB
TypeScript
import React from 'react';
import { Moment } from 'moment';
import { TDate } from '@z-r/calendar/types/interface';
import Time from 'src/components/TimePicker/Time';
import { Size } from 'src/type';
import { TShortcut } from './Footer';
export type DatePickerProps = {
/** 值,受控 */
value?: TDate | null;
/** 默认值,非受控 */
defaultValue?: TDate | null;
/** 修改回调 */
onChange?: (v: Moment | null) => void;
/** 自定义规则 */
rules?: any;
/** 尺寸 */
size?: Size;
/** 输入和展示的字符串格式,为数组时,第一个用作展示,并影响时间面板 */
format?: string | string[];
/** 是否可为空,为空时不传或传入空值会默认为当前时刻 */
nullable?: boolean;
/**
* 设置操作面板,时分秒
*/
display?: {
date?: {
/** @deprecated 设置日期展示格式,使用 format 替换 */
format?: string;
/** @deprecated 是否展示日期选择,仅时间选择需求使用 TimePicker 替换 */
show?: boolean;
};
/** 设置为 false,隐藏时 */
hour?: boolean;
/** 设置为 false,隐藏分 */
minute?: boolean;
/** 设置为 false,隐藏秒 */
second?: boolean;
};
/** 是否禁用 */
disabled?: boolean;
/** 状态 */
status?: 'default' | 'error';
/** placeholder */
placeholder?: string;
/** 面板快捷内容 */
shortcuts?: TShortcut[] | null;
/** 自定义 popover,参考 popover */
popoverProps?: any;
/**
* @deprecated 使用 popoverProps 替换
* 弹出层的 z-index
*/
zIndex?: number;
/**
* @deprecated 使用 popoverProps 替换
* 弹出层容器,参考 popover.getPopupContainer
*/
getCalendarContainer?: (triggerNode: Element) => Element;
};
type Time = 'HH' | 'mm' | 'ss';
export declare const displayToFormatAndTimeMode: (display: DatePickerProps['display']) => [string[], Time[]];
declare const _default: React.MemoExoticComponent<(props: DatePickerProps) => React.JSX.Element>;
export default _default;