/** * @license * Copyright 厦门乾元盛世科技有限公司 All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file. */ import { EventEmitter, ElementRef, Renderer } from '@angular/core'; import { AfterContentInit, AfterViewInit, OnInit, OnDestroy } from '@angular/core'; import { QueryList } from '@angular/core'; import 'rxjs/add/operator/debounceTime'; import 'rxjs/add/operator/distinctUntilChanged'; import { FormControl } from '../input/form.control'; import { Option } from './option'; import { OptionGroup } from './option.group'; import { NotFound } from './not.found'; export declare type Child = Option | OptionGroup; export interface Data { value: string; text?: string; disabled?: boolean; id?: string; children?: Data[]; } /** * Select 选择器 * 参考: https://github.com/react-component/select */ export declare class Select extends FormControl implements OnInit, OnDestroy, AfterContentInit, AfterViewInit { private renderer; private elementRef; private compositionMode; /** 样式前缀 */ prefixCls: string; /** 用户CSS样式 */ class: string; /** 控件大小。注:标准表单内的输入框大小限制为 `large`。可选 `large` `default` `small`。 */ size: 'large' | 'default' | 'small'; /** 选择框默认文字 */ placeholder: string; /** 在选择框中显示搜索框,默认为false */ showSearch: boolean; /** 支持清除,默认为false */ allowClear: boolean; /** 设置 Select 的模式。可选 `multiple` `tags` `combobox`。 */ mode: 'multiple' | 'tags' | 'combobox'; /** 是否默认高亮第一个选项 */ defaultActiveFirstOption: boolean; /** 当下拉列表为空时显示的内容 */ notFoundContent: string; /** 下拉菜单和选择器同宽 */ dropdownMatchSelectWidth: boolean; /** 下拉菜单的 class 属性 */ dropdownClass: string; dropdownPlacement: string; builtinPlacements: { bottomLeft: { points: string[]; offset: number[]; overflow: { adjustX: number; adjustY: number; }; }; topLeft: { points: string[]; offset: number[]; overflow: { adjustX: number; adjustY: number; }; }; }; /** 自动查询延迟时间(ms),默认300毫秒 */ filterDelay: number; /** * 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue`, `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 */ filterOption: boolean | ((inputValue: string, option: Option) => any); /** 搜索时过滤对应的 option 属性,可选项如:value, text */ optionFilterProp: string; /** 展开/关闭菜单时的动画效果 */ transitionName: string; choiceTransitionName: string; /** 显示下拉三角 */ showArrow: boolean; /** 选中后显示的标签最大长度 */ maxTagTextLength: number; /** 搜索框的样式 */ inputClass: string; /** 重新设置下拉选项列表 */ data: Data[]; /** * option select 事件,参数为:(option: Option) */ select: EventEmitter; /** * option deselect 事件,参数为:(option: Option) */ deselect: EventEmitter; /** * search 事件 */ search: EventEmitter; /** * 菜单可视事件变更 */ openChange: EventEmitter; /** 值变更事件 */ change: EventEmitter; /** 搜索框 */ input: ElementRef; /** 已选内容显示 */ selectionEl: ElementRef; /** 菜单容器 */ menuContainer: ElementRef; inputValue: string; private _focused; private searchTerms; notFound: NotFound; _optionGrpContentChildren: QueryList; _optionContentChildren: QueryList