mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
feat: tree-select 支持 maxTagCount 属性 (#5784)
This commit is contained in:
parent
5e3c59cb1c
commit
96bc868289
@ -19,6 +19,7 @@ import {ListMenu} from 'amis-ui';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
import {supportStatic} from './StaticHoc';
|
||||
import {TooltipWrapperSchema} from '../TooltipWrapper';
|
||||
|
||||
/**
|
||||
* Tag 输入框
|
||||
@ -55,7 +56,7 @@ export interface TagControlSchema extends FormOptionsSchema {
|
||||
/**
|
||||
* 收纳标签的Popover配置
|
||||
*/
|
||||
overflowTagPopover?: object;
|
||||
overflowTagPopover?: TooltipWrapperSchema;
|
||||
|
||||
/** 是否开启批量添加模式 */
|
||||
enableBatchAdd: boolean;
|
||||
|
@ -24,6 +24,7 @@ import {normalizeOptions} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
import {supportStatic} from './StaticHoc';
|
||||
import {TooltipWrapperSchema} from '../TooltipWrapper';
|
||||
|
||||
/**
|
||||
* Tree 下拉选择框。
|
||||
@ -96,6 +97,16 @@ export interface TreeSelectControlSchema extends FormOptionsSchema {
|
||||
* 是否显示展开线
|
||||
*/
|
||||
showOutline?: boolean;
|
||||
|
||||
/**
|
||||
* 标签的最大展示数量,超出数量后以收纳浮层的方式展示,仅在多选模式开启后生效
|
||||
*/
|
||||
maxTagCount?: number;
|
||||
|
||||
/**
|
||||
* 收纳标签的Popover配置
|
||||
*/
|
||||
overflowTagPopover?: TooltipWrapperSchema;
|
||||
}
|
||||
|
||||
export interface TreeSelectProps extends OptionsControlProps {
|
||||
@ -607,6 +618,8 @@ export default class TreeSelectControl extends React.Component<
|
||||
placeholder,
|
||||
popOverContainer,
|
||||
useMobileUI,
|
||||
maxTagCount,
|
||||
overflowTagPopover,
|
||||
translate: __,
|
||||
env
|
||||
} = this.props;
|
||||
@ -616,6 +629,8 @@ export default class TreeSelectControl extends React.Component<
|
||||
return (
|
||||
<div ref={this.container} className={cx(`TreeSelectControl`, className)}>
|
||||
<ResultBox
|
||||
maxTagCount={maxTagCount}
|
||||
overflowTagPopover={overflowTagPopover}
|
||||
disabled={disabled}
|
||||
ref={this.targetRef}
|
||||
placeholder={__(placeholder ?? 'placeholder.empty')}
|
||||
|
Loading…
Reference in New Issue
Block a user