Files
element-plus/packages/components/time-select/src/time-select.ts
Anas Boudih 1069e9ff34 refactor(components): [time-select] switch to script-setup syntax (#7833)
* refactor(components): [time-select] switch to script-setup syntax

* fix(components): [time-select] fix typing

* fix(components): [time-select] fix props reviews

* fix(components): [time-select] fix props and build

Co-authored-by: metanas <matanas@pre-history.com>
2022-05-25 23:06:12 +08:00

56 lines
1.3 KiB
TypeScript

import { buildProps, definePropType } from '@element-plus/utils'
import { CircleClose, Clock } from '@element-plus/icons-vue'
import { useSizeProp } from '@element-plus/hooks'
import type TimeSelect from './time-select.vue'
import type { Component, ExtractPropTypes, PropType } from 'vue'
export const timeSelectProps = buildProps({
format: {
type: String,
default: 'HH:mm',
},
modelValue: String,
disabled: Boolean,
editable: {
type: Boolean,
default: true,
},
effect: {
type: String as PropType<'light' | 'dark' | string>,
default: 'light',
},
clearable: {
type: Boolean,
default: true,
},
size: useSizeProp,
placeholder: String,
start: {
type: String,
default: '09:00',
},
end: {
type: String,
default: '18:00',
},
step: {
type: String,
default: '00:30',
},
minTime: String,
maxTime: String,
name: String,
prefixIcon: {
type: definePropType<string | Component>([String, Object]),
default: () => Clock,
},
clearIcon: {
type: definePropType<string | Component>([String, Object]),
default: () => CircleClose,
},
} as const)
export type TimeSelectProps = ExtractPropTypes<typeof timeSelectProps>
export type TimeSelectInstance = InstanceType<typeof TimeSelect>