/** * * This file may have been modified by Bytedance Inc. (“Bytedance Inc.'s Modifications”). * All Bytedance Inc.'s Modifications are Copyright (year) Bytedance Inc.. * * This source code is licensed under the Apache license. * See LICENSE file in the project root for license information. * */ import React from 'react'; import moment, { Moment } from 'moment'; import D, { DatePickerProps as DatePickerAntProps } from './component'; import DateRangePickerJoin from './DateRangePickerJoin'; import { PickerBaseProps, PickerDateProps, PickerTimeProps, RangePickerBaseProps as RangePickerAntBaseProps, RangePickerDateProps as RangePickerAntDateProps, RangePickerTimeProps as RangePickerAntTimeProps } from './component/generatePicker'; export * from './component'; declare type OmitPickerProps = 'value' | 'defaultValue' | 'defaultPickerValue' | 'onChange'; declare type ValueTypeFormatProps = { valueType: 'format'; value?: string; defaultValue?: string; defaultPickerValue?: string; onChange?: (value: string | null, dateString: Moment | null) => void; }; declare type ValueTypeunixTimeStampProps = { valueType: 'unixTimeStamp'; value?: number; defaultValue?: number; defaultPickerValue?: number; onChange?: (value: number | null, dateString: Moment | null) => void; }; declare type DatePickerBaseFormatProps = Omit, OmitPickerProps> & ValueTypeFormatProps; declare type DatePickerDateFormatProps = Omit, OmitPickerProps> & ValueTypeFormatProps; declare type DatePickerTimeFormatProps = Omit, OmitPickerProps> & ValueTypeFormatProps; declare type DatePickerBaseUnixTimeStampProps = Omit, OmitPickerProps> & ValueTypeunixTimeStampProps; declare type DatePickerDateUnixTimeStampProps = Omit, OmitPickerProps> & ValueTypeunixTimeStampProps; declare type DatePickerTimeUnixTimeStampProps = Omit, OmitPickerProps> & ValueTypeunixTimeStampProps; export declare type DatePickerProps = (DatePickerAntProps & { valueType?: undefined; popupClassName?: string; }) | DatePickerBaseFormatProps | DatePickerDateFormatProps | DatePickerTimeFormatProps | DatePickerBaseUnixTimeStampProps | DatePickerDateUnixTimeStampProps | DatePickerTimeUnixTimeStampProps; export interface RangePickerFocusEventProps { onBlur?: (e: React.FocusEvent, info: { range: 'start' | 'end'; }) => void; onSingleBlur?: (e: React.FocusEvent, info: { range: 'start' | 'end'; }) => void; onFocus?: (e: React.FocusEvent, info: { range: 'start' | 'end'; }) => void; } declare type RangeValueTypeFormatProps = { valueType?: 'format'; value?: [string, string] | null; defaultValue?: [string, string] | null; defaultPickerValue?: [string, string] | null; onChange?: (value: [string | null, string | null] | null, dateString: [Moment | null, Moment | null] | null) => void; }; declare type RangeValueTypeUnixTimeStampProps = { valueType?: 'unixTimeStamp'; value?: [number, number] | null; defaultValue?: [number, number] | null; defaultPickerValue?: [number, number] | null; onChange?: (value: [number | null, number | null] | null, dateString: [Moment | null, Moment | null] | null) => void; }; declare type RangePickerBaseProps = Omit, 'onBlur' | 'onFocus' | 'onSingleBlur'> & RangePickerFocusEventProps; declare type RangePickerDateProps = Omit, 'onBlur' | 'onFocus' | 'onSingleBlur'> & RangePickerFocusEventProps; declare type RangePickerTimeProps = Omit, 'onBlur' | 'onFocus' | 'onSingleBlur'> & RangePickerFocusEventProps; declare type RangePickerBaseFormatProps = Omit & RangeValueTypeFormatProps; declare type RangePickerDateFormatProps = Omit & RangeValueTypeFormatProps; declare type RangePickerTimeFormatProps = Omit & RangeValueTypeFormatProps; declare type RangePickerBaseUnixTimeStampProps = Omit & RangeValueTypeUnixTimeStampProps; declare type RangePickerDateUnixTimeStampProps = Omit & RangeValueTypeUnixTimeStampProps; declare type RangePickerTimeUnixTimeStampProps = Omit & RangeValueTypeUnixTimeStampProps; export declare type RangePickerProps = (RangePickerBaseProps & { valueType?: undefined; popupClassName?: string; }) | (RangePickerDateProps & { valueType?: undefined; popupClassName?: string; }) | (RangePickerTimeProps & { valueType?: undefined; popupClassName?: string; }) | RangePickerBaseFormatProps | RangePickerDateFormatProps | RangePickerTimeFormatProps | RangePickerBaseUnixTimeStampProps | RangePickerDateUnixTimeStampProps | RangePickerTimeUnixTimeStampProps; export declare const RangePicker: React.ForwardRefExoticComponent<(Pick & RangeValueTypeFormatProps & React.RefAttributes) | (Pick & RangeValueTypeFormatProps & React.RefAttributes) | (Pick & RangeValueTypeFormatProps & React.RefAttributes) | (Pick & RangeValueTypeUnixTimeStampProps & React.RefAttributes) | (Pick & RangeValueTypeUnixTimeStampProps & React.RefAttributes) | (Pick & RangeValueTypeUnixTimeStampProps & React.RefAttributes) | (Pick, "size" | "style" | "locale" | "onChange" | "picker" | "prefixCls" | "className" | "mode" | "tabIndex" | "value" | "defaultValue" | "defaultPickerValue" | "disabledDate" | "dateRender" | "monthCellRender" | "yearCellRender" | "renderExtraFooter" | "onPanelChange" | "onMouseDown" | "onOk" | "direction" | "format" | "disabledTime" | "onChangeForBlur" | "dropdownClassName" | "dropdownAlign" | "popupStyle" | "transitionName" | "placeholder" | "allowClear" | "autoFocus" | "disabled" | "open" | "defaultOpen" | "inputReadOnly" | "id" | "suffixIcon" | "clearIcon" | "prevIcon" | "nextIcon" | "superPrevIcon" | "superNextIcon" | "getPopupContainer" | "panelRender" | "inputRender" | "triggerRender" | "onOpenChange" | "onMouseUp" | "onMouseEnter" | "onMouseLeave" | "onClick" | "onContextMenu" | "onKeyDown" | "onClear" | "pickerRef" | "role" | "name" | "autoComplete" | "isSelectedClose" | "isForceedDisplayClearIcon" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "placement" | "bordered" | "status" | "ranges" | "separator" | "allowEmpty" | "onCalendarChange" | "activePickerIndex" | "onClearClick"> & RangePickerFocusEventProps & { valueType?: undefined; popupClassName?: string | undefined; } & React.RefAttributes) | (Pick, "size" | "style" | "locale" | "onChange" | "picker" | "prefixCls" | "className" | "mode" | "tabIndex" | "value" | "defaultValue" | "defaultPickerValue" | "disabledDate" | "dateRender" | "monthCellRender" | "yearCellRender" | "renderExtraFooter" | "onPanelChange" | "onMouseDown" | "onOk" | "direction" | "format" | "showNow" | "disabledTime" | "onChangeForBlur" | "dropdownClassName" | "dropdownAlign" | "popupStyle" | "transitionName" | "placeholder" | "allowClear" | "autoFocus" | "disabled" | "open" | "defaultOpen" | "inputReadOnly" | "id" | "suffixIcon" | "clearIcon" | "prevIcon" | "nextIcon" | "superPrevIcon" | "superNextIcon" | "getPopupContainer" | "panelRender" | "inputRender" | "triggerRender" | "onOpenChange" | "onMouseUp" | "onMouseEnter" | "onMouseLeave" | "onClick" | "onContextMenu" | "onKeyDown" | "onClear" | "pickerRef" | "role" | "name" | "autoComplete" | "isSelectedClose" | "isForceedDisplayClearIcon" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "placement" | "bordered" | "status" | "showTime" | "ranges" | "separator" | "allowEmpty" | "onCalendarChange" | "activePickerIndex" | "onClearClick"> & RangePickerFocusEventProps & { valueType?: undefined; popupClassName?: string | undefined; } & React.RefAttributes) | (Pick, "size" | "style" | "locale" | "onChange" | "picker" | "prefixCls" | "className" | "mode" | "tabIndex" | "value" | "defaultValue" | "defaultPickerValue" | "disabledDate" | "dateRender" | "monthCellRender" | "yearCellRender" | "renderExtraFooter" | "onPanelChange" | "onMouseDown" | "onOk" | "direction" | "format" | "showNow" | "showHour" | "showMinute" | "showSecond" | "use12Hours" | "hourStep" | "minuteStep" | "secondStep" | "hideDisabledOptions" | "disabledHours" | "disabledMinutes" | "disabledSeconds" | "disabledTime" | "defaultOpenValue" | "onChangeForBlur" | "dropdownClassName" | "dropdownAlign" | "popupStyle" | "transitionName" | "placeholder" | "allowClear" | "autoFocus" | "disabled" | "open" | "defaultOpen" | "inputReadOnly" | "id" | "suffixIcon" | "clearIcon" | "prevIcon" | "nextIcon" | "superPrevIcon" | "superNextIcon" | "getPopupContainer" | "panelRender" | "inputRender" | "triggerRender" | "onOpenChange" | "onMouseUp" | "onMouseEnter" | "onMouseLeave" | "onClick" | "onContextMenu" | "onKeyDown" | "onClear" | "pickerRef" | "role" | "name" | "autoComplete" | "isSelectedClose" | "isForceedDisplayClearIcon" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "placement" | "bordered" | "status" | "order" | "ranges" | "separator" | "allowEmpty" | "onCalendarChange" | "activePickerIndex" | "onClearClick"> & RangePickerFocusEventProps & { valueType?: undefined; popupClassName?: string | undefined; } & React.RefAttributes)>; interface CompoundedComponent extends React.ForwardRefExoticComponent> { RangePicker: typeof RangePicker; MonthPicker: typeof D.MonthPicker; TimePicker: typeof D.TimePicker; WeekPicker: typeof D.WeekPicker; YearPicker: typeof D.YearPicker; DateRangePickerJoin: typeof DateRangePickerJoin; } export declare const DatePicker: CompoundedComponent; export default DatePicker;