mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
24 lines
691 B
TypeScript
24 lines
691 B
TypeScript
import { CustomSelectAutoComplete as CustomSelectAutoCompleteFC } from '@hydrooj/components';
|
|
import AutoComplete, { AutoCompleteOptions } from '.';
|
|
|
|
interface CustomSelectOptions {
|
|
data: any[];
|
|
}
|
|
|
|
export default class CustomSelectAutoComplete<Multi extends boolean> extends AutoComplete<CustomSelectOptions> {
|
|
static DOMAttachKey = 'ucwCustomSelectAutoCompleteInstance';
|
|
|
|
constructor($dom, options: CustomSelectOptions & AutoCompleteOptions<Multi>) {
|
|
super($dom, {
|
|
classes: 'custom-select',
|
|
component: CustomSelectAutoCompleteFC,
|
|
props: {
|
|
data: options.data,
|
|
multi: options.multi,
|
|
height: 'auto',
|
|
},
|
|
...options,
|
|
});
|
|
}
|
|
}
|