diff --git a/components/lib/treeselect/TreeSelect.js b/components/lib/treeselect/TreeSelect.js index 23900bc2b5..258ca53f79 100644 --- a/components/lib/treeselect/TreeSelect.js +++ b/components/lib/treeselect/TreeSelect.js @@ -11,6 +11,7 @@ import { Tree } from '../tree/Tree'; import { DomHandler, IconUtils, ObjectUtils, ZIndexUtils, mergeProps } from '../utils/Utils'; import { TreeSelectBase } from './TreeSelectBase'; import { TreeSelectPanel } from './TreeSelectPanel'; +import { Tooltip } from '../tooltip/Tooltip'; export const TreeSelect = React.memo( React.forwardRef((inProps, ref) => { @@ -33,6 +34,7 @@ export const TreeSelect = React.memo( const hasNoOptions = ObjectUtils.isEmpty(props.options); const isSingleSelectionMode = props.selectionMode === 'single'; const isCheckboxSelectionMode = props.selectionMode === 'checkbox'; + const hasTooltip = ObjectUtils.isNotEmpty(props.tooltip); const metaData = { props, @@ -744,6 +746,7 @@ export const TreeSelect = React.memo( > {content} + {hasTooltip && } ); }) diff --git a/components/lib/treeselect/treeselect.d.ts b/components/lib/treeselect/treeselect.d.ts index df26a40f7e..4b62a3f4af 100644 --- a/components/lib/treeselect/treeselect.d.ts +++ b/components/lib/treeselect/treeselect.d.ts @@ -16,6 +16,8 @@ import { TreeNodeTemplateOptions, TreePassThroughOptions, TreeTogglerTemplateOpt import { TreeNode } from '../treenode'; import { FormEvent } from '../ts-helpers'; import { IconType, PassThroughType } from '../utils/utils'; +import { TooltipPassThroughOptions } from '../tooltip/tooltip'; +import { TooltipOptions } from '../tooltip/tooltipoptions'; export declare type TreeSelectPassThroughType = PassThroughType; export declare type TreeSelectPassThroughTransitionType = ReactCSSTransitionProps | ((options: TreeSelectPassThroughMethodOptions) => ReactCSSTransitionProps) | undefined; @@ -123,6 +125,11 @@ export interface TreeSelectPassThroughOptions { * Used to control React Transition API. */ transition?: TreeSelectPassThroughTransitionType; + /** + * Uses to pass attributes to the Tooltip component. + * @see {@link TooltipPassThroughOptions} + */ + tooltip?: TooltipPassThroughOptions; } /** @@ -524,6 +531,14 @@ export interface TreeSelectProps extends Omit