ranui
Version:
UI Component library based on `Web Component`
109 lines (108 loc) • 3.32 kB
TypeScript
import '@/shadowless/select/option';
import '@/shadowless/icon';
import '@/shadowless/input';
import type { Input } from '@/shadowless/input';
import './index.less';
interface Option {
label: string | number;
value: string | number;
}
declare const Select_base: {
new (): HTMLElement;
prototype: HTMLElement;
};
export declare class Select extends Select_base {
removeTimeId?: NodeJS.Timeout;
_select: HTMLDivElement;
_selection: HTMLDivElement;
_search: Input;
_icon: HTMLElement;
_selectDropdown?: HTMLDivElement;
_selectionDropdown?: HTMLDivElement;
_selectDropDownInTimeId?: NodeJS.Timeout;
_selectDropDownOutTimeId?: NodeJS.Timeout;
_optionList: Option[];
_optionLabelMapValue: Map<string, string>;
_optionValueMapLabel: Map<string, string>;
_activeOption?: HTMLElement;
_text: HTMLSpanElement;
_selector: HTMLDivElement;
onSearch?: (this: HTMLElement, ev: Event) => unknown;
static get observedAttributes(): string[];
constructor();
get value(): string;
set value(value: string);
get defaultValue(): string;
set defaultValue(value: string);
get showSearch(): string;
set showSearch(value: string);
get type(): string;
set type(value: string);
get placement(): string;
set placement(value: string);
get sheet(): string;
set sheet(value: string);
get getPopupContainerId(): string;
set getPopupContainerId(value: string);
get dropdownclass(): string;
set dropdownclass(value: string);
get trigger(): string;
set trigger(value: string);
get disabled(): boolean;
set disabled(value: boolean | string | undefined | null);
/**
* @description: 移除 select dropdown
* @return {*}
*/
setSelectDropdownDisplayNone: () => void;
/**
* @description: 添加 select dropdown
* @return {*}
*/
setSelectDropdownDisplayBlock: () => void;
placementPosition: () => void;
/**
* @description: 设置下拉框
* @return {*}
*/
selectMouseDown: (e: Event) => void;
removeDropDownTimeId: () => void;
/**
* @description: 焦点移除的情况,需要移除 select 下拉框
* @return {*}
*/
selectBlur: () => void;
/**
* @description: 选中一个选项的情况
* @param {MouseEvent} e
* @return {*}
*/
clickOption: (e: MouseEvent) => void;
/**
* @description: 初始化创建选项下拉框
* @return {*}
*/
createOption: () => void;
/**
* @description: 移除选项下拉框
* @return {*}
*/
removeSelectDropdown: () => void;
/**
* @description: 当 select 中有 option 元素的时候,给 dropdown 添加元素
* @return {*}
*/
addOptionToSlot: () => void;
createSelectDropdownContent: (options?: Option[]) => void;
setDefaultValue: () => void;
changeSearch: (e: Event) => void;
setShowSearch: () => void;
removeShowSearch: () => void;
listenActionEvent: () => void;
clickRemoveSelect: (e: Event) => void;
connectedCallback(): void;
disconnectCallback(): void;
attributeChangedCallback(name: string, _: string, newValue: string): void;
}
declare const _default: import("@/utils/index").CustomErrorType;
export default _default;