mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(components): [select&select-v2] refactor components * refactor(components): [select-v2] * refactor(components): update * refactor(components): update * refactor(components): [select-v2] update * refactor(components): update * refactor(components): update * refactor(components): update type * refactor(components): update * refactor(components): update * refactor(components): update style * refactor(components): update docs * refactor(components): update * refactor(components): fix #15323 * refactor(theme-chalk): update * refactor(components): update * refactor(components): update * refactor(components): update * refactor(components): fix bugs * fix(components): fix issue * fix(components): update * fix(components): fix some bug * feat(components): update * feat(components): add tag slot * feat(components): update * fix(components): update * style(theme-chalk): update style * fix(theme-chalk): update * feat(theme-chalk): update * fix(components): update * feat: update * feat: update * feat: update * feat(components): update
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import type { ExtractPropTypes, InjectionKey } from 'vue'
|
|
import type { SelectProps } from './select'
|
|
|
|
interface SelectGroupContext {
|
|
disabled: boolean
|
|
}
|
|
|
|
export interface SelectContext {
|
|
props: ExtractPropTypes<typeof SelectProps>
|
|
states: any
|
|
expanded: boolean
|
|
selectRef: HTMLElement
|
|
optionsArray: any[]
|
|
setSelected(): void
|
|
onOptionCreate(vm: SelectOptionProxy): void
|
|
onOptionDestroy(
|
|
key: number | string | Record<string, string>,
|
|
vm: SelectOptionProxy
|
|
): void
|
|
handleOptionSelect(vm: SelectOptionProxy): void
|
|
}
|
|
|
|
// For individual build sharing injection key, we had to make `Symbol` to string
|
|
export const selectGroupKey: InjectionKey<SelectGroupContext> =
|
|
Symbol('ElSelectGroup')
|
|
|
|
export const selectKey: InjectionKey<SelectContext> = Symbol('ElSelect')
|
|
|
|
export interface SelectOptionProxy {
|
|
value: string | number | Record<string, string>
|
|
label: string | number
|
|
created: boolean
|
|
disabled: boolean
|
|
currentLabel: string
|
|
itemSelected: boolean
|
|
isDisabled: boolean
|
|
select: SelectContext
|
|
hoverItem: () => void
|
|
updateOption: (query: string) => void
|
|
visible: boolean
|
|
hover: boolean
|
|
selectOptionClick: () => void
|
|
}
|
|
|
|
export type ISelectProps = ExtractPropTypes<typeof SelectProps>
|