UNPKG

multiple-select-vanilla

Version:
114 lines 5.44 kB
import type { MultipleSelectOption } from './interfaces/multipleSelectOption.interface'; import type { HtmlStruct, MultipleSelectLocales, OptGroupRowData, OptionRowData } from './interfaces'; import { BindingEventService, VirtualScroll } from './services'; export declare class MultipleSelectInstance { protected elm: HTMLSelectElement; protected _bindEventService: BindingEventService; protected allSelected: boolean; protected fromHtml: boolean; protected choiceElm: HTMLButtonElement; protected closeElm?: HTMLElement | null; protected closeSearchElm?: HTMLElement | null; protected filterText: string; protected updateData: any[]; protected data?: Array<OptionRowData | OptGroupRowData>; protected dataTotal?: any; protected dropElm: HTMLDivElement; protected okButtonElm?: HTMLButtonElement; protected filterParentElm?: HTMLDivElement | null; protected ulElm?: HTMLUListElement | null; protected parentElm: HTMLDivElement; protected labelElm?: HTMLLabelElement | null; protected selectAllParentElm?: HTMLDivElement | null; protected selectAllElm?: HTMLInputElement | null; protected searchInputElm?: HTMLInputElement | null; protected selectGroupElms?: NodeListOf<HTMLInputElement>; protected selectItemElms?: NodeListOf<HTMLInputElement>; protected disableItemElms?: NodeListOf<HTMLInputElement>; protected noResultsElm?: HTMLDivElement | null; protected options: MultipleSelectOption; protected selectAllName: string; protected selectGroupName: string; protected selectItemName: string; protected tabIndex?: string | null; protected updateDataStart?: number; protected updateDataEnd?: number; protected virtualScroll?: VirtualScroll | null; locales: MultipleSelectLocales; get isRenderAsHtml(): boolean | undefined; constructor(elm: HTMLSelectElement, options?: Partial<Omit<MultipleSelectOption, 'onHardDestroy' | 'onAfterHardDestroy'>>); init(): void; /** * destroy the element, if a hard destroy is enabled then we'll also nullify it on the multipleSelect instance array. * When a soft destroy is called, we'll only remove it from the DOM but we'll keep all multipleSelect instances */ destroy(hardDestroy?: boolean): void; protected initLocale(): void; protected initContainer(): void; protected initData(): void; protected initRow(elm: HTMLOptionElement, groupDisabled?: boolean): OptionRowData | OptGroupRowData | null; protected initDrop(): void; protected initFilter(): void; protected initList(): void; protected initListItems(): HtmlStruct[]; protected getListRows(): HtmlStruct[]; protected initListItem(row: OptionRowData | OptGroupRowData, level?: number): HtmlStruct[]; protected initSelected(ignoreTrigger?: boolean): void; protected initView(): void; protected events(): void; /** * Open the drop method, user could optionally provide a delay in ms to open the drop. * The default delay is 0ms (which is 1 CPU cycle) when nothing is provided, to avoid a delay we can pass `-1` or `null` * @param {number} [openDelay=0] - provide an optional delay, defaults to 0 */ open(openDelay?: number | null): void; protected openDrop(): void; close(): void; /** * apply value to an HTML element as text or as HTML with innerHTML when enabled * @param elm * @param value */ protected applyAsTextOrHtmlWhenEnabled(elmOrProp: HTMLElement | any, value: string): void; protected update(ignoreTrigger?: boolean): void; protected updateSelected(rows?: HtmlStruct[]): void; getData(): { [value: string]: string | number | boolean; } | (string | number | boolean | import("./interfaces").OptionRowDivider | OptionRowData | OptGroupRowData)[] | undefined; getDataLength(): number; /** * Get current options, by default we'll return an immutable deep copy of the options to avoid conflicting with the lib * but in rare occasion we might want to the return the actual, but mutable, options * @param {Boolean} [returnDeepCopy] */ getOptions(returnDeepCopy?: boolean): any; refreshOptions(options: Partial<MultipleSelectOption>): void; getDropElement(): HTMLDivElement; getParentElement(): HTMLDivElement; getSelects(type?: string): any[]; setSelects(values: any[], type?: string, ignoreTrigger?: boolean): void; enable(): void; disable(): void; check(value: any): void; uncheck(value: any): void; protected _check(option: any, checked: boolean): void; checkAll(): void; uncheckAll(): void; protected _checkAll(checked: boolean, ignoreUpdate?: boolean): void; protected _checkGroup(group: any, checked: boolean, ignoreUpdate?: boolean): void; checkInvert(): void; focus(): void; blur(): void; refresh(): void; protected filter(ignoreTrigger?: boolean): void; protected adjustDropHeight(position: 'bottom' | 'top'): boolean; protected adjustDropPosition(forceToggle: boolean): string; protected adjustDropWidthByText(): void; getScrollbarWidth(): number; formatAllSelected(): string; formatCountSelected(selectedCount: number, totalCount: number): string; formatNoMatchesFound(): string; formatOkButton(): string; formatSelectAll(): string; } //# sourceMappingURL=MultipleSelectInstance.d.ts.map