mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
104 lines
2.3 KiB
TypeScript
104 lines
2.3 KiB
TypeScript
import { isValidComponentSize } from '@element-plus/utils-v2'
|
|
import { useTooltipContentProps } from '@element-plus/components/tooltip'
|
|
import { CircleClose } from '@element-plus/icons-vue'
|
|
|
|
import type { PropType, Component } from 'vue'
|
|
import type { ComponentSize } from '@element-plus/constants'
|
|
import type { OptionType } from './select.types'
|
|
import type { Options } from '@element-plus/components/popper'
|
|
|
|
export const SelectProps = {
|
|
allowCreate: Boolean,
|
|
autocomplete: {
|
|
type: String as PropType<'none' | 'both' | 'list' | 'inline'>,
|
|
default: 'none',
|
|
},
|
|
automaticDropdown: Boolean,
|
|
clearable: Boolean,
|
|
clearIcon: {
|
|
type: [String, Object] as PropType<string | Component>,
|
|
default: CircleClose,
|
|
},
|
|
collapseTags: Boolean,
|
|
defaultFirstOption: Boolean,
|
|
disabled: Boolean,
|
|
estimatedOptionHeight: {
|
|
type: Number,
|
|
default: undefined,
|
|
},
|
|
filterable: Boolean,
|
|
filterMethod: Function,
|
|
height: {
|
|
type: Number,
|
|
default: 170, // 5 items by default
|
|
},
|
|
itemHeight: {
|
|
type: Number,
|
|
default: 34,
|
|
},
|
|
id: String,
|
|
loading: Boolean,
|
|
loadingText: String,
|
|
label: String,
|
|
modelValue: [Array, String, Number, Boolean, Object] as PropType<
|
|
any[] | string | number | boolean | Record<string, any> | any
|
|
>,
|
|
multiple: Boolean,
|
|
multipleLimit: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
name: String,
|
|
noDataText: String,
|
|
noMatchText: String,
|
|
remoteMethod: Function,
|
|
reserveKeyword: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
options: {
|
|
type: Array as PropType<OptionType[]>,
|
|
required: true,
|
|
},
|
|
placeholder: {
|
|
type: String,
|
|
},
|
|
popperAppendToBody: {
|
|
type: Boolean,
|
|
default: undefined,
|
|
},
|
|
teleported: useTooltipContentProps.teleported,
|
|
popperClass: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
popperOptions: {
|
|
type: Object as PropType<Partial<Options>>,
|
|
default: () => ({} as Partial<Options>),
|
|
},
|
|
remote: Boolean,
|
|
size: {
|
|
type: String as PropType<ComponentSize>,
|
|
validator: isValidComponentSize,
|
|
},
|
|
valueKey: {
|
|
type: String,
|
|
default: 'value',
|
|
},
|
|
scrollbarAlwaysOn: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
}
|
|
|
|
export const OptionProps = {
|
|
data: Array,
|
|
disabled: Boolean,
|
|
hovering: Boolean,
|
|
item: Object,
|
|
index: Number,
|
|
style: Object,
|
|
selected: Boolean,
|
|
created: Boolean,
|
|
}
|