mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-17 23:50:52 +08:00

* feat: ConfigProvider support classNames and styles for timepicker * save * empty * add test * bump * fix * fix * improve type * chore: refactor * chore: clean up * chore: memo * docs: fix ts * chore: update demo * chore: all semantic * chore: fix types * chore: update demo * test: update test case * chore: fix ts * test: fix test case * test: fix test case * chore: rm console --------- Co-authored-by: 二货机器人 <smith3816@gmail.com>
41 lines
1.5 KiB
TypeScript
Executable File
41 lines
1.5 KiB
TypeScript
Executable File
import dayjsGenerateConfig from '@rc-component/picker/lib/generate/dayjs';
|
|
import type { Dayjs } from 'dayjs';
|
|
|
|
import genPurePanel from '../_util/PurePanel';
|
|
import generatePicker from './generatePicker';
|
|
import type {
|
|
RangePickerProps as BaseRangePickerProps,
|
|
PickerProps,
|
|
PickerPropsWithMultiple,
|
|
} from './generatePicker/interface';
|
|
|
|
export type DatePickerProps<ValueType = Dayjs | Dayjs> = PickerPropsWithMultiple<
|
|
Dayjs,
|
|
PickerProps<Dayjs>,
|
|
ValueType
|
|
>;
|
|
export type MonthPickerProps<ValueType = Dayjs | Dayjs> = Omit<
|
|
DatePickerProps<ValueType>,
|
|
'picker'
|
|
>;
|
|
export type WeekPickerProps<ValueType = Dayjs | Dayjs> = Omit<DatePickerProps<ValueType>, 'picker'>;
|
|
export type RangePickerProps = BaseRangePickerProps<Dayjs>;
|
|
|
|
const DatePicker = generatePicker<Dayjs>(dayjsGenerateConfig);
|
|
|
|
export type DatePickerType = typeof DatePicker & {
|
|
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
|
|
_InternalRangePanelDoNotUseOrYouWillBeFired: typeof PureRangePanel;
|
|
generatePicker: typeof generatePicker;
|
|
};
|
|
|
|
// We don't care debug panel
|
|
/* istanbul ignore next */
|
|
const PurePanel = genPurePanel(DatePicker, 'popupAlign', undefined, 'picker');
|
|
(DatePicker as DatePickerType)._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
|
const PureRangePanel = genPurePanel(DatePicker.RangePicker, 'popupAlign', undefined, 'picker');
|
|
(DatePicker as DatePickerType)._InternalRangePanelDoNotUseOrYouWillBeFired = PureRangePanel;
|
|
(DatePicker as DatePickerType).generatePicker = generatePicker;
|
|
|
|
export default DatePicker as DatePickerType;
|