/** * Refact by liuxiangyang on 2021/9/29. */ import { Component } from 'react'; import moment from 'moment'; import type { FocusEvent } from 'react'; import type { Moment } from 'moment'; import type { RangeValue } from 'rc-picker/lib/interface'; import type { RangePickerProps, RangePickerState } from './iPicker'; declare class RangePicker extends Component { static defaultProps: { antd: boolean; clearIcon: JSX.Element; suffixIcon: JSX.Element; allowClear: boolean; showToday: boolean; showRangeLabel: boolean; isHeaderSelect: boolean; }; constructor(props: RangePickerProps); private startInputBlur; private endInputBlur; private node; leftInputValue?: string | number; rightInputValue?: string | number; componentDidMount(): void; componentWillUnmount(): void; componentWillReceiveProps(nextProps: RangePickerProps): void; initValue: (props: RangePickerProps) => RangeValue; initMode: (props: RangePickerProps) => RangePickerState['modeArr'] | undefined; /** * @desc 生成RangePicker的format数组 * @param {String|Array} customFormat * @returns [startFormat, endFormat] */ generateRangeFormat: (customFormat?: RangePickerProps['format']) => [string, string]; generateClearIcon: () => JSX.Element; generateSuffixIcon: () => JSX.Element; /** * string类型输入转换为数组 * @param {String | Array} str Tinper老版本value、placeholder等的string类型输入 * @param {String} seperator 分隔符 * @returns {Array} */ splitRangeStr2Arr: (str: string | RangePickerProps['value'], seperator?: string) => string[] | [import("rc-picker/lib/interface").EventValue, import("rc-picker/lib/interface").EventValue] | null | undefined; initPlaceholder: (props: RangePickerProps) => [string, string] | undefined; initRanges: (ranges: RangePickerProps['ranges']) => Record; initActivePresetLabel: ({ ranges, activePresetKey }: RangePickerProps) => string; onInputBlurAdapt: () => void; removeInputBlurAdapt: () => void; handleFocus: (e: FocusEvent) => void; handleBlur: (e: FocusEvent) => void; onInputBlur: (e: FocusEvent, type: 'start' | 'end') => void; /** * 日期范围变化的回调 * @param {Array[moment]} value 选中的日期范围值 * @param {Array[String]} formatString 数组字符串 * @param {[String]} label 快捷按钮文本,非快捷按钮选中日期无此项 */ handleChange: (value: RangePickerState['value'], formatString: [string, string], label?: string) => void; handleCalendarChange: (value: [moment.Moment, moment.Moment] | null, formatString: [string, string], info: { range: string; }) => void; handleValue: (val: string) => string[]; onInputFocus: (val: number, val2: string, e: FocusEvent) => void; handlePanelChange: (value: RangePickerState['value'], mode: RangePickerState['modeArr'], type?: string, diff?: number) => void; handleOpenChange: (open: boolean) => void; /** * @desc 选中快捷日期的回调 * @param {String} label 快捷选项文本 * @param {[moment||null, moment||null]} values 新选中的值 */ handlePresetChange: (label: string, values: RangeValue) => void; getPopupContainerDom: (dom: HTMLElement) => void | HTMLElement; getDiffValueHanle: (value: [number, number], val2: string, ismask: boolean) => void; getDiffValueHandleRight: (value: [number, number], val2: string, ismask: boolean) => void; onPanelshow: (val: boolean) => void; render(): JSX.Element; } export default RangePicker;