import type { Api, RendererEvent, SchemaClassName, SchemaExpression } from 'jamis-core'; import type { CSSProperties } from 'react'; import type { AssociatedSelectionProps, ChainedSelectionProps, FormOptionsSchema, IFormItemStore, IFormStore, Option, OptionsControlProps, SchemaApi, SchemaObject, SchemaTpl, SizeUnit, TableSelectionProps, TooltipObject, TransferSelectMode, TreeCompProps } from '../types'; import type { BaseSelectionProps } from './components/types'; export type ISelectEvent = 'change' | 'blur' | 'focus' | 'addstart' | 'add' | 'editstart' | 'edit' | 'deletestart' | 'delete' | 'close'; /** * Select 下拉选择框。 * */ export interface SelectControlSchema extends Omit { type: 'select' | 'multi-select'; /** * 自动完成 API,当输入部分文字的时候,会将这些文字通过 ${term} 可以取到,发送给接口。 * 接口可以返回匹配到的选项,帮助用户输入。 */ autoComplete?: Api; /** * 是否初始发起一次autoComplete请求, 如果在autoComplete的api中开启了sendOn, 则会在sendOn校验通过时才发起 */ autoCompleteLoadOnce?: boolean; autoCompleteLoadOnceOn?: SchemaExpression; /** * 初始发起请求的模式, 默认是mounted后就发起, 可以设置聚焦时才发起 */ autoCompleteLoadOnceMode?: 'mounted' | 'focus'; /** * 可以自定义菜单展示。 */ menuTpl?: SchemaTpl | SchemaObject; /** * 自定义选中值展示方式。 */ valueTpl?: SchemaObject; /** * 当在value值未匹配到当前options中的选项时,是否value值对应文本飘红显示 */ showInvalidMatch?: boolean; /** * 边框模式,全边框或者没边框。 */ borderMode?: 'full' | 'half' | 'none'; /** * 勾选展示模式 */ selectMode?: TransferSelectMode; groupConfig?: Partial; listConfig?: Partial; /** * 当selectMode=tree时可配置项 */ treeConfig?: Omit; /** * 当selectMode=table时可配置项 */ tableConfig?: Partial; /** * 当selectMode=associated时可配置项 */ associatedConfig?: Partial; chainedConfig?: Partial; /** * 当 selectMode 为 associated 时用来定义左侧的选项 * @deprecated 请使用`associatedConfig.leftOptions`替代 */ leftOptions?: Array