Skip to content

Commit 9f53d53

Browse files
authored
refactor:timepicker (#6270)
* refactor:timepicker * docs:update & refactor: timepicker type
1 parent cd47a27 commit 9f53d53

File tree

6 files changed

+12
-19
lines changed

6 files changed

+12
-19
lines changed

components/style.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import './cascader/style';
3131
// import './back-top/style';
3232
// import './modal/style';
3333
// import './alert/style';
34-
import './time-picker/style';
34+
// import './time-picker/style';
3535
// import './steps/style';
3636
// import './breadcrumb/style';
3737
// import './calendar/style';

components/time-picker/index.en-US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
category: Components
33
type: Data Entry
44
title: TimePicker
5-
cover: https://gw.alipayobjects.com/zos/alicdn/h04Zsl98I/TimePicker.svg
5+
cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*kGmGSLk_1fwAAAAAAAAAAAAADrJ8AQ/original
66
---
77

88
To select/input a time.

components/time-picker/index.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ category: Components
33
type: 数据录入
44
title: TimePicker
55
subtitle: 时间选择框
6-
cover: https://gw.alipayobjects.com/zos/alicdn/h04Zsl98I/TimePicker.svg
6+
cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*kGmGSLk_1fwAAAAAAAAAAAAADrJ8AQ/original
77
---
88

99
输入或选择时间的控件。

components/time-picker/style/index.less

-3
This file was deleted.

components/time-picker/style/index.tsx

-5
This file was deleted.

components/time-picker/time-picker.tsx

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ExtractPropTypes, PropType } from 'vue';
1+
import type { ExtractPropTypes } from 'vue';
22
import { defineComponent, ref } from 'vue';
33
import type { RangePickerTimeProps } from '../date-picker/generatePicker';
44
import generatePicker from '../date-picker/generatePicker';
@@ -15,6 +15,7 @@ import devWarning from '../vc-util/devWarning';
1515
import { useInjectFormItemContext } from '../form/FormItemContext';
1616
import omit from '../_util/omit';
1717
import type { InputStatus } from '../_util/statusUtils';
18+
import { booleanType, stringType } from '../_util/type';
1819

1920
export interface TimePickerLocale {
2021
placeholder?: string;
@@ -23,17 +24,17 @@ export interface TimePickerLocale {
2324

2425
export const timePickerProps = () => ({
2526
format: String,
26-
showNow: { type: Boolean, default: undefined },
27-
showHour: { type: Boolean, default: undefined },
28-
showMinute: { type: Boolean, default: undefined },
29-
showSecond: { type: Boolean, default: undefined },
30-
use12Hours: { type: Boolean, default: undefined },
27+
showNow: booleanType(),
28+
showHour: booleanType(),
29+
showMinute: booleanType(),
30+
showSecond: booleanType(),
31+
use12Hours: booleanType(),
3132
hourStep: Number,
3233
minuteStep: Number,
3334
secondStep: Number,
34-
hideDisabledOptions: { type: Boolean, default: undefined },
35+
hideDisabledOptions: booleanType(),
3536
popupClassName: String,
36-
status: String as PropType<InputStatus>,
37+
status: stringType<InputStatus>(),
3738
});
3839
type CommonTimePickerProps = Partial<ExtractPropTypes<ReturnType<typeof timePickerProps>>>;
3940
export type TimeRangePickerProps<DateType> = Omit<

0 commit comments

Comments
 (0)