@uiw/react-native
Version:
UIW for React Native
51 lines (50 loc) • 1.68 kB
TypeScript
import React from 'react';
import { StyleProp, TextStyle } from 'react-native';
import { ModalProps } from '../Modal';
import { PickerProps } from '../Picker';
import { DateKey } from './component/PickerView';
export interface DatePickerProps {
/** 显示时间的精度 例: 显示年月日 ['year', 'month', 'day'] */
precision?: DateKey;
/** "2022-10-26 00:00:00" */
value?: string;
/** 确认时触发 */
onOk?: (value: string) => void;
/** Picker 值变化时触发 */
onChange?: (value: string) => void;
/** 关闭模态框 */
onClosed?: () => void;
/** 最小值 "2022-10-26 00:00:00" */
min?: string;
/** 最大值 "2022-10-26 00:00:00" */
max?: string;
/** 是否显示头部 年 月 日 */
showTitle?: boolean;
/** 头部样式 */
titleStyle?: StyleProp<TextStyle>;
/** 自定义头部 */
renderTitle?: (text: '年' | '月' | '日' | '时' | '分' | '秒') => React.ReactNode;
/** 确定按钮的文字 */
okText?: string | React.ReactNode;
/** 取消按钮的文字 */
cancelText?: string | React.ReactNode;
/** 确定取消按钮 当触摸处于活动状态时将显示的底层颜色 */
underlayColor?: string;
/** 是否显示选择器 */
visible?: boolean;
/** modal 属性 */
modalProps?: ModalProps;
/** picker 属性 */
pickerProps?: PickerProps;
}
export interface DateLabel {
year?: string;
month?: string;
day?: string;
hour?: string;
minute?: string;
second?: string;
}
export declare const typeTimer: DateKey[];
declare const DatePicker: (props: DatePickerProps) => JSX.Element;
export default DatePicker;