Files
element-plus/packages/components/select/src/token.ts
kooriookami 5844947198 refactor(components): [select & select-v2] Refactor components (#15352)
* 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
2024-01-10 11:14:58 +08:00

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>