PickerPanel.d.ts
2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* Logic:
* When `mode` === `picker`,
* click will trigger `onSelect` (if value changed trigger `onChange` also).
* Panel change will not trigger `onSelect` but trigger `onPanelChange`
*/
import * as React from 'react';
import { SharedTimeProps } from './panels/TimePanel';
import { GenerateConfig } from './generate';
import { Locale, PanelMode, PickerMode, DisabledTime, OnPanelChange, Components } from './interface';
import { DateRender } from './panels/DatePanel/DateBody';
import { MonthCellRender } from './panels/MonthPanel/MonthBody';
export interface PickerPanelSharedProps<DateType> {
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
/** @deprecated Will be removed in next big version. Please use `mode` instead */
mode?: PanelMode;
tabIndex?: number;
locale: Locale;
generateConfig: GenerateConfig<DateType>;
value?: DateType | null;
defaultValue?: DateType;
/** [Legacy] Set default display picker view date */
pickerValue?: DateType;
/** [Legacy] Set default display picker view date */
defaultPickerValue?: DateType;
disabledDate?: (date: DateType) => boolean;
dateRender?: DateRender<DateType>;
monthCellRender?: MonthCellRender<DateType>;
renderExtraFooter?: (mode: PanelMode) => React.ReactNode;
onSelect?: (value: DateType) => void;
onChange?: (value: DateType) => void;
onPanelChange?: OnPanelChange<DateType>;
onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
onOk?: (date: DateType) => void;
direction?: 'ltr' | 'rtl';
/** @private This is internal usage. Do not use in your production env */
hideHeader?: boolean;
/** @private This is internal usage. Do not use in your production env */
onPickerValueChange?: (date: DateType) => void;
/** @private Internal usage. Do not use in your production env */
components?: Components;
}
export interface PickerPanelBaseProps<DateType> extends PickerPanelSharedProps<DateType> {
picker: Exclude<PickerMode, 'date' | 'time'>;
}
export interface PickerPanelDateProps<DateType> extends PickerPanelSharedProps<DateType> {
picker?: 'date';
showToday?: boolean;
showNow?: boolean;
showTime?: boolean | SharedTimeProps<DateType>;
disabledTime?: DisabledTime<DateType>;
}
export interface PickerPanelTimeProps<DateType> extends PickerPanelSharedProps<DateType>, SharedTimeProps<DateType> {
picker: 'time';
}
export declare type PickerPanelProps<DateType> = PickerPanelBaseProps<DateType> | PickerPanelDateProps<DateType> | PickerPanelTimeProps<DateType>;
declare function PickerPanel<DateType>(props: PickerPanelProps<DateType>): JSX.Element;
export default PickerPanel;