From 6e36f235b4f6f088adf3a7daf3fbd5f51e847742 Mon Sep 17 00:00:00 2001 From: shifeng1993 Date: Sun, 12 Feb 2023 13:51:49 +0800 Subject: [PATCH 1/2] refactor:timepicker --- components/style.ts | 2 +- components/time-picker/style/index.less | 3 --- components/time-picker/style/index.tsx | 5 ----- 3 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 components/time-picker/style/index.less delete mode 100644 components/time-picker/style/index.tsx diff --git a/components/style.ts b/components/style.ts index b2d119dea9..51a7605fd5 100644 --- a/components/style.ts +++ b/components/style.ts @@ -31,7 +31,7 @@ import './cascader/style'; // import './back-top/style'; import './modal/style'; // import './alert/style'; -import './time-picker/style'; +// import './time-picker/style'; import './steps/style'; // import './breadcrumb/style'; import './calendar/style'; diff --git a/components/time-picker/style/index.less b/components/time-picker/style/index.less deleted file mode 100644 index af7ae24a92..0000000000 --- a/components/time-picker/style/index.less +++ /dev/null @@ -1,3 +0,0 @@ -@import '../../style/themes/index'; -@import '../../style/mixins/index'; -@import '../../input/style/mixin'; diff --git a/components/time-picker/style/index.tsx b/components/time-picker/style/index.tsx deleted file mode 100644 index b2534aab0b..0000000000 --- a/components/time-picker/style/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import '../../style/index.less'; -import './index.less'; - -// style dependencies -import '../../date-picker/style'; From 6ffaf77e687bb717f3132b112efe580644e0ed74 Mon Sep 17 00:00:00 2001 From: shifeng1993 Date: Tue, 14 Feb 2023 00:28:08 +0800 Subject: [PATCH 2/2] docs:update & refactor: timepicker type --- components/time-picker/index.en-US.md | 2 +- components/time-picker/index.zh-CN.md | 2 +- components/time-picker/time-picker.tsx | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/time-picker/index.en-US.md b/components/time-picker/index.en-US.md index 0cd4a01245..5646fbcf98 100644 --- a/components/time-picker/index.en-US.md +++ b/components/time-picker/index.en-US.md @@ -2,7 +2,7 @@ category: Components type: Data Entry title: TimePicker -cover: https://gw.alipayobjects.com/zos/alicdn/h04Zsl98I/TimePicker.svg +cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*kGmGSLk_1fwAAAAAAAAAAAAADrJ8AQ/original --- To select/input a time. diff --git a/components/time-picker/index.zh-CN.md b/components/time-picker/index.zh-CN.md index dbf5b32b57..f9043066b8 100644 --- a/components/time-picker/index.zh-CN.md +++ b/components/time-picker/index.zh-CN.md @@ -3,7 +3,7 @@ category: Components type: 数据录入 title: TimePicker subtitle: 时间选择框 -cover: https://gw.alipayobjects.com/zos/alicdn/h04Zsl98I/TimePicker.svg +cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*kGmGSLk_1fwAAAAAAAAAAAAADrJ8AQ/original --- 输入或选择时间的控件。 diff --git a/components/time-picker/time-picker.tsx b/components/time-picker/time-picker.tsx index 6ae4943c42..a7a83f24e5 100644 --- a/components/time-picker/time-picker.tsx +++ b/components/time-picker/time-picker.tsx @@ -1,4 +1,4 @@ -import type { ExtractPropTypes, PropType } from 'vue'; +import type { ExtractPropTypes } from 'vue'; import { defineComponent, ref } from 'vue'; import type { RangePickerTimeProps } from '../date-picker/generatePicker'; import generatePicker from '../date-picker/generatePicker'; @@ -15,6 +15,7 @@ import devWarning from '../vc-util/devWarning'; import { useInjectFormItemContext } from '../form/FormItemContext'; import omit from '../_util/omit'; import type { InputStatus } from '../_util/statusUtils'; +import { booleanType, stringType } from '../_util/type'; export interface TimePickerLocale { placeholder?: string; @@ -23,17 +24,17 @@ export interface TimePickerLocale { export const timePickerProps = () => ({ format: String, - showNow: { type: Boolean, default: undefined }, - showHour: { type: Boolean, default: undefined }, - showMinute: { type: Boolean, default: undefined }, - showSecond: { type: Boolean, default: undefined }, - use12Hours: { type: Boolean, default: undefined }, + showNow: booleanType(), + showHour: booleanType(), + showMinute: booleanType(), + showSecond: booleanType(), + use12Hours: booleanType(), hourStep: Number, minuteStep: Number, secondStep: Number, - hideDisabledOptions: { type: Boolean, default: undefined }, + hideDisabledOptions: booleanType(), popupClassName: String, - status: String as PropType, + status: stringType(), }); type CommonTimePickerProps = Partial>>; export type TimeRangePickerProps = Omit<