mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-12 14:10:19 +08:00
- 新增 search.ts 搜索工具,支持中文拼音(全拼/首字母)模糊匹配 - 新增 select-search-context.ts,通过 provide/inject 为 radix-vue Select 组件注入搜索能力 - MultiSelect、ModelMultiSelect 组件集成搜索框,选项超过阈值时自动显示 - select-content/select-item 组件支持搜索过滤与空状态提示 - StandaloneKeyFormDialog、UserFormDialog 中手写下拉框替换为复用 MultiSelect 组件 - 引入 pinyin-pro 依赖,按需懒加载 Closes #210 Co-authored-by: AoaoMH <kidxb@vip.qq.com>
18 lines
508 B
TypeScript
18 lines
508 B
TypeScript
import type { InjectionKey, Ref } from 'vue'
|
|
|
|
export interface RegisteredSelectItem {
|
|
value: string
|
|
text: string
|
|
}
|
|
|
|
export interface SelectSearchContext {
|
|
searchQuery: Ref<string>
|
|
hiddenValues: Ref<Set<string>>
|
|
registerItem: (id: string, item: RegisteredSelectItem) => void
|
|
updateItem: (id: string, item: Partial<RegisteredSelectItem>) => void
|
|
unregisterItem: (id: string) => void
|
|
}
|
|
|
|
export const SELECT_SEARCH_CONTEXT_KEY: InjectionKey<SelectSearchContext> =
|
|
Symbol('select-search-context')
|