51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import type { GetTextCallback } from '../types';
|
|
|
|
/** 下拉列表参数对象 */
|
|
interface DropdownOptions {
|
|
/** 文本关键字 */
|
|
textKey?: string;
|
|
/** 值关键字 */
|
|
valueKey?: string;
|
|
/** 源码显示的关键字 */
|
|
htmlKey?: string;
|
|
/** 子集合的关键字 */
|
|
childKey?: string;
|
|
/** 最大输入长度 */
|
|
maxLength?: number;
|
|
/**
|
|
* 模板创建函数
|
|
* @param this 当前Dropdown
|
|
* @param it 下拉项目
|
|
* @returns 返回渲染的字符串
|
|
*/
|
|
htmlTemplate?: (this: Dropdown, it: DropdownItem) => string;
|
|
/** 是否允许多选 */
|
|
multiSelect?: boolean;
|
|
/** 选中值 */
|
|
selected?: string;
|
|
/** 选中的数组 */
|
|
selectedList?: string[];
|
|
/** 是否禁用 */
|
|
disabled?: boolean;
|
|
/** 是否支持输入 */
|
|
input?: boolean;
|
|
/** 是否支持搜索 */
|
|
search?: boolean;
|
|
/** 搜索的关键字数组 */
|
|
searchKeys?: string[];
|
|
/** 搜索提示文本,默认值取语言资源 `searchHolder` "Search..." */
|
|
searchPlaceholder?: string;
|
|
/** 焦点索引 */
|
|
tabIndex?: number;
|
|
/** 输入框的提示文本 */
|
|
placeholder?: string;
|
|
/** 是否固定为向下展开 */
|
|
slideFixed?: boolean;
|
|
/** 父元素,默认添加到头元素之后 */
|
|
wrapper?: HTMLElement;
|
|
/** 是否忽略 All 选项 */
|
|
ignoreAll?: boolean;
|
|
/** 获取文本的代理函数 */
|
|
getText?: GetTextCallback;
|
|
}
|