UNPKG

shineout

Version:

Shein 前端组件库

95 lines (94 loc) 3.45 kB
/// <reference types="node" /> import React from 'react'; import { PureComponent } from '../component'; import { RegularAttributes, ResultItem } from '../@types/common'; import { BaseSelectProps, Control } from './Props'; interface SelectState { control: Control; focus: boolean; position: RegularAttributes.ListPosition; } declare class Select<Item, Value> extends PureComponent<BaseSelectProps<Item, Value>, SelectState> { static defaultProps: { clearable: boolean; data: never[]; height: number; itemsInView: number; lineHeight: number; loading: boolean; multiple: boolean; renderItem: (e: any) => any; text: {}; compressed: boolean; trim: boolean; autoAdapt: boolean; showArrow: boolean; focusSelected: boolean; }; blurHandler: (() => void) | null; renderPending: boolean; optionList: { handleHover?: (index?: number, force?: boolean) => void; hoverMove?: (step: number) => void; getIndex?: () => number; }; selectId: string; mouseDown: boolean; lastResult: undefined; lastFoucs: boolean; focusInput: null | ((flag?: boolean) => void); inputReset: () => void; element: HTMLDivElement; blured: boolean; inputBlurTimer: NodeJS.Timer | null; lastChangeIsOptionClick: boolean; handleRemove: (data: ResultItem<Item>, fromInput?: boolean) => void; inputLocked: boolean; keyLocked: boolean; cancelDeleteLockTimer: NodeJS.Timer; deleteLock: boolean; constructor(props: BaseSelectProps<Item, Value>); componentDidMount(): void; componentDidUpdate(prevProps: BaseSelectProps<Item, Value>, prevState: SelectState): void; componentWillUnmount(): void; get focus(): boolean; setOpenEvent(): void; getDisabledStatus(): boolean | ((data: Item) => boolean); getFocusSelected(): boolean | undefined; setInputReset(fn: () => void): void; forceChange: () => void; isDescendent(el: any, id: any): any; bindOptionFunc(name: 'handleHover' | 'hoverMove' | 'getIndex', fn: any): void; bindFocusInputFunc(fn: (flag: boolean) => void): void; bindElement(el: HTMLDivElement): void; bindClickAway(): void; clearClickAway(): void; handleClickAway(e: any): void; handleClick(e: React.MouseEvent<HTMLDivElement>): void; handleState(focus: boolean, e?: any): void; handleControlChange(control: 'mouse' | 'keyboard'): void; handleChange(_isActive: boolean, data: ResultItem<Item>, fromInput?: boolean): void; shouldFocus(el: HTMLDivElement): boolean; handleFocus(e: React.FocusEvent<HTMLDivElement>): void; handleInputFocus(): void; handleInputBlur(text: string): void; handleClear(): void; handleHideOption(): void; handleEnter(): void; handleKeyDown(e: React.KeyboardEvent<HTMLDivElement>): void; handleKeyUp(): void; cancelDeleteLock(): void; handleDelete(e: React.KeyboardEvent<HTMLDivElement>): void; handleFilter(...args: [string]): void; renderItem(data: Item, index: number): React.ReactNode; renderResult(data: Item, index: number): React.ReactNode; /** * custom options list header */ renderCustomHeader(): JSX.Element | null; renderTree(): JSX.Element; renderList(): JSX.Element; renderOptions(): JSX.Element; render(): JSX.Element; } export default Select;