jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
71 lines (70 loc) • 2.06 kB
TypeScript
import type { SchemaClassName } from 'jamis-core';
import type { FormOptionsSchema, IFormItemStore, IFormStore, OptionsControlProps } from '../types';
/**
* Nested Select
*/
export interface NestedSelectControlSchema extends FormOptionsSchema {
type: 'nested-select';
/**
* 边框模式,全边框,还是半边框,或者没边框。
*/
borderMode?: 'full' | 'half' | 'none';
/**
* 弹框的 css 类
*/
menuClassName?: SchemaClassName;
/**
* popover弹窗的样式类
*/
popoverClassName?: SchemaClassName;
/**
* 父子之间是否完全独立。
*/
cascade?: boolean;
/**
* 选父级的时候是否把子节点的值也包含在内。
*/
withChildren?: boolean;
/**
* 选父级的时候,是否只把子节点的值包含在内
*/
onlyChildren?: boolean;
/**
* 只允许选择叶子节点
*/
onlyLeaf?: boolean;
/**
* 是否隐藏选择框中已选中节点的祖先节点的文本信息
*/
hideNodePathLabel?: boolean;
searchable?: boolean;
autoFocus?: boolean;
/** 是否可以全选 */
checkAll?: boolean;
/** 全选label */
checkAllLabel?: string;
optionLabel?: string;
/**
* 元素`.cxd-ResultBox`的样式类
*/
resultBoxClassName?: SchemaClassName;
/**
* 元素 `.cxd-ResultBox input`的样式类
*/
resultInputClassName?: SchemaClassName;
/**
* 表单项value改变事件监听
*/
onChange?: (curr: any, prev: any, itemStore: IFormItemStore, formStore: IFormStore) => any;
/**
* 键盘离开事件监听器
*/
onBlur?: (event: React.KeyboardEvent<any>) => any;
}
export interface NestedSelectProps extends OptionsControlProps, Omit<NestedSelectControlSchema, 'options' | 'descriptionClassName' | 'className' | 'inputClassName' | 'onChange' | 'onBlur'> {
cascade?: boolean;
noResultsText?: string;
withChildren?: boolean;
onlyChildren?: boolean;
hideNodePathLabel?: boolean;
}