feat: tree-select 支持 maxTagCount 属性 (#5784)

This commit is contained in:
sansiro 2022-11-25 13:51:39 +08:00 committed by GitHub
parent 5e3c59cb1c
commit 96bc868289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -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;

View File

@ -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')}