Skip to content

Commit 6f8c75c

Browse files
committed
fix: timeRangePicker ts type support string
1 parent d645ad6 commit 6f8c75c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

components/time-picker/time-picker.tsx

+17-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,25 @@ export interface CommonTimePickerProps {
4646
hideDisabledOptions?: boolean;
4747
popupClassName?: string;
4848
}
49-
50-
export type TimeRangePickerProps<T> = Omit<RangePickerTimeProps<T>, 'picker'> & {
49+
export type TimeRangePickerProps<DateType> = Omit<
50+
RangePickerTimeProps<DateType>,
51+
'picker' | 'defaultPickerValue' | 'defaultValue' | 'value' | 'onChange' | 'onPanelChange' | 'onOk'
52+
> & {
5153
popupClassName?: string;
5254
valueFormat?: string;
55+
defaultPickerValue?: RangeValue<DateType> | RangeValue<string>;
56+
defaultValue?: RangeValue<DateType> | RangeValue<string>;
57+
value?: RangeValue<DateType> | RangeValue<string>;
58+
onChange?: (
59+
value: RangeValue<DateType> | RangeValue<string> | null,
60+
dateString: [string, string],
61+
) => void;
62+
'onUpdate:value'?: (value: RangeValue<DateType> | RangeValue<string> | null) => void;
63+
onPanelChange?: (
64+
values: RangeValue<DateType> | RangeValue<string>,
65+
modes: [PanelMode, PanelMode],
66+
) => void;
67+
onOk?: (dates: RangeValue<DateType> | RangeValue<string>) => void;
5368
};
5469

5570
export type TimePickerProps<DateType> = CommonProps<DateType> &
@@ -151,9 +166,7 @@ function createTimePicker<
151166
slot: ['renderExtraFooter', 'suffixIcon', 'clearIcon'],
152167
setup(props, { slots, expose, emit, attrs }) {
153168
const pickerRef = ref();
154-
155169
const formItemContext = useInjectFormItemContext();
156-
157170
expose({
158171
focus: () => {
159172
pickerRef.value?.focus();

0 commit comments

Comments
 (0)