UNPKG

@smkit/ui

Version:

UI Kit of SberMarketing

35 lines (34 loc) 1.01 kB
import { type Readable, type Writable } from 'svelte/store'; import type { Props, State, SearchBy } from './types'; import { type EventDispatcher } from 'svelte'; export declare enum ViewType { Modal = "modal", Embedded = "embedded" } export declare class Combobox<T> { props: Props<T>; options: Writable<T[]>; selected: Writable<T[]>; state: Writable<State>; search: Writable<string>; focus: Writable<boolean>; filtered: Readable<T[]>; ctxKey: string; multiple: boolean; disabled: Writable<boolean>; dispatch: EventDispatcher<{ toggle: T; select: T[] | T; }>; private lastOptions; private searchIndex; groupBy: Props<T>['groupBy']; searchBy: SearchBy<T>; constructor({ selected, groupBy, searchBy, multiple, config, disabled }: Props<T>); render(options: T[]): void; static get self(): Combobox<Option>; toggle(option: T): void; toggleAll(): void; isSelectedAll(): boolean; close(): void; }