baseframe-js
Version:
Baseframe JS is a comprehensive suite of modular plugins and utilities designed for front-end development
67 lines (66 loc) • 2.35 kB
TypeScript
import type { StringPluginArgChoices } from './types';
import { type BaseElem } from "base-elem-js";
export interface ISelectEnhanceDefaults {
cssPrefix: string;
cssListModifer: string;
mobileNative: boolean;
emptyValAsPlaceholder: boolean;
blurDuration: number;
typeAheadDuration: number;
observeSelectbox: boolean;
listAppendToSelect: boolean;
focusIn(select: HTMLSelectElement): any;
focusOut(select: HTMLSelectElement): any;
beforeChange(select: HTMLSelectElement): any;
afterChange(select: HTMLSelectElement): any;
}
export interface ISelectEnhanceOptions extends Partial<ISelectEnhanceDefaults> {
}
export default class SelectEnhance {
#private;
$select: BaseElem;
select: HTMLSelectElement;
params: ISelectEnhanceDefaults;
index: number;
id: string;
selectId: string;
isReadOnly: boolean;
$label: BaseElem;
$selectEnhance: BaseElem;
selectEnhance: HTMLDivElement;
$textInput: BaseElem;
textInput: HTMLInputElement;
$selectList: BaseElem;
selectList: HTMLDivElement;
optionSet: WeakMap<object, any>;
listPosTop: boolean;
optionsShown: boolean;
selectboxObserver: MutationObserver;
selectListBoxInFullView: boolean;
private keyedInput;
private posTimeout;
private bodyCloseEvt;
private toggling;
static defaults: ISelectEnhanceDefaults;
static version: string;
static pluginName: string;
constructor(element: HTMLSelectElement, options: ISelectEnhanceOptions | StringPluginArgChoices, index: number);
showOptions(): void;
closeOptions(focusBack?: boolean): void;
setSelectionState(optionBtn: HTMLDivElement, doBlur?: boolean): void;
eventOutsideClickClose(): void;
static buildOptionsList(s: SelectEnhance, $selectList?: BaseElem): void;
traverseOptions(elem: HTMLElement, dir: 'next' | 'prev'): void;
selectInputMutationObserver(): void;
eventScrollGetListPosition(init?: boolean): void;
listPosition(): void;
static refreshOptions(element: any): void;
static remove(element: BaseElem, plugin?: SelectEnhance): void;
}
export interface SelectEnhancePlugin {
selectEnhance(options?: ISelectEnhanceOptions | StringPluginArgChoices): BaseElem;
}
declare module 'base-elem-js' {
interface BaseElem extends SelectEnhancePlugin {
}
}