parent
6b1f38cd4e
commit
aa9ba7fc5a
@ -1,10 +1,9 @@
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import generateConfig from '../vc-picker/generate/dayjs';
|
||||
import { withInstall } from '../_util/type';
|
||||
import type { CalendarProps } from './generateCalendar';
|
||||
import generateCalendar from './generateCalendar';
|
||||
|
||||
const Calendar = generateCalendar<Dayjs>(generateConfig);
|
||||
const Calendar = generateCalendar(generateConfig);
|
||||
|
||||
export type { CalendarProps };
|
||||
export default withInstall(Calendar);
|
||||
|
@ -0,0 +1,73 @@
|
||||
import type {
|
||||
PickerBaseProps as RCPickerBaseProps,
|
||||
PickerDateProps as RCPickerDateProps,
|
||||
PickerTimeProps as RCPickerTimeProps,
|
||||
} from '../../vc-picker/Picker';
|
||||
import type {
|
||||
RangePickerBaseProps as RCRangePickerBaseProps,
|
||||
RangePickerDateProps as RCRangePickerDateProps,
|
||||
RangePickerTimeProps as RCRangePickerTimeProps,
|
||||
} from '../../vc-picker/RangePicker';
|
||||
import type { Locale as RcPickerLocale } from '../../vc-picker/interface';
|
||||
import type { TimePickerLocale } from '../../time-picker';
|
||||
import type { SizeType } from '../../config-provider';
|
||||
|
||||
type InjectDefaultProps<Props> = Omit<
|
||||
Props,
|
||||
| 'locale'
|
||||
| 'generateConfig'
|
||||
| 'prevIcon'
|
||||
| 'nextIcon'
|
||||
| 'superPrevIcon'
|
||||
| 'superNextIcon'
|
||||
| 'hideHeader'
|
||||
| 'components'
|
||||
> & {
|
||||
locale?: PickerLocale;
|
||||
size?: SizeType;
|
||||
bordered?: boolean;
|
||||
};
|
||||
|
||||
export type PickerLocale = {
|
||||
lang: RcPickerLocale & AdditionalPickerLocaleLangProps;
|
||||
timePickerLocale: TimePickerLocale;
|
||||
} & AdditionalPickerLocaleProps;
|
||||
|
||||
export type AdditionalPickerLocaleProps = {
|
||||
dateFormat?: string;
|
||||
dateTimeFormat?: string;
|
||||
weekFormat?: string;
|
||||
monthFormat?: string;
|
||||
};
|
||||
|
||||
export type AdditionalPickerLocaleLangProps = {
|
||||
placeholder: string;
|
||||
yearPlaceholder?: string;
|
||||
quarterPlaceholder?: string;
|
||||
monthPlaceholder?: string;
|
||||
weekPlaceholder?: string;
|
||||
rangeYearPlaceholder?: [string, string];
|
||||
rangeMonthPlaceholder?: [string, string];
|
||||
rangeWeekPlaceholder?: [string, string];
|
||||
rangePlaceholder?: [string, string];
|
||||
};
|
||||
|
||||
// Picker Props
|
||||
export type PickerBaseProps<DateType> = InjectDefaultProps<RCPickerBaseProps<DateType>>;
|
||||
export type PickerDateProps<DateType> = InjectDefaultProps<RCPickerDateProps<DateType>>;
|
||||
export type PickerTimeProps<DateType> = InjectDefaultProps<RCPickerTimeProps<DateType>>;
|
||||
|
||||
export type PickerProps<DateType> =
|
||||
| PickerBaseProps<DateType>
|
||||
| PickerDateProps<DateType>
|
||||
| PickerTimeProps<DateType>;
|
||||
|
||||
// Range Picker Props
|
||||
export type RangePickerBaseProps<DateType> = InjectDefaultProps<RCRangePickerBaseProps<DateType>>;
|
||||
export type RangePickerDateProps<DateType> = InjectDefaultProps<RCRangePickerDateProps<DateType>>;
|
||||
export type RangePickerTimeProps<DateType> = InjectDefaultProps<RCRangePickerTimeProps<DateType>>;
|
||||
|
||||
export type RangePickerProps<DateType> =
|
||||
| RangePickerBaseProps<DateType>
|
||||
| RangePickerDateProps<DateType>
|
||||
| RangePickerTimeProps<DateType>;
|
Loading…
Reference in new issue