2022-02-14 14:40:40 +08:00
|
|
|
import type { Dayjs } from 'dayjs';
|
|
|
|
import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs';
|
2022-07-13 23:06:28 +08:00
|
|
|
import genPurePanel from '../_util/PurePanel';
|
2022-05-07 14:31:54 +08:00
|
|
|
import type {
|
2020-01-14 19:46:05 +08:00
|
|
|
PickerDateProps,
|
2022-06-22 14:57:09 +08:00
|
|
|
PickerProps,
|
2020-01-14 19:46:05 +08:00
|
|
|
RangePickerProps as BaseRangePickerProps,
|
|
|
|
} from './generatePicker';
|
2022-05-07 14:31:54 +08:00
|
|
|
import generatePicker from './generatePicker';
|
2020-01-14 19:46:05 +08:00
|
|
|
|
2022-02-14 14:40:40 +08:00
|
|
|
export type DatePickerProps = PickerProps<Dayjs>;
|
|
|
|
export type MonthPickerProps = Omit<PickerDateProps<Dayjs>, 'picker'>;
|
|
|
|
export type WeekPickerProps = Omit<PickerDateProps<Dayjs>, 'picker'>;
|
|
|
|
export type RangePickerProps = BaseRangePickerProps<Dayjs>;
|
2015-08-25 17:27:38 +08:00
|
|
|
|
2022-02-14 14:40:40 +08:00
|
|
|
const DatePicker = generatePicker<Dayjs>(dayjsGenerateConfig);
|
2016-08-19 17:11:06 +08:00
|
|
|
|
2022-07-11 14:58:59 +08:00
|
|
|
// We don't care debug panel
|
|
|
|
/* istanbul ignore next */
|
|
|
|
const PurePanel = genPurePanel(DatePicker, 'picker');
|
|
|
|
(DatePicker as any)._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
2023-02-20 10:51:18 +08:00
|
|
|
const PureRangePanel = genPurePanel(DatePicker.RangePicker, 'picker');
|
|
|
|
(DatePicker as any)._InternalRangePanelDoNotUseOrYouWillBeFired = PureRangePanel;
|
2022-07-11 14:58:59 +08:00
|
|
|
|
|
|
|
export default DatePicker as typeof DatePicker & {
|
|
|
|
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
|
2023-02-20 10:51:18 +08:00
|
|
|
_InternalRangePanelDoNotUseOrYouWillBeFired: typeof PureRangePanel;
|
2022-07-11 14:58:59 +08:00
|
|
|
};
|