@@ -6,8 +6,16 @@ import {
66} from '@ant-design/icons' ;
77import { ProProvider , useIntl } from '@ant-design/pro-provider' ;
88import { runFunction , useRefFunction } from '@ant-design/pro-utils' ;
9- import type { TableColumnType } from 'antd' ;
10- import { Checkbox , ConfigProvider , Popover , Space , Tooltip , Tree } from 'antd' ;
9+ import {
10+ Checkbox ,
11+ ConfigProvider ,
12+ Popover ,
13+ Space ,
14+ Tooltip ,
15+ Tree ,
16+ Typography ,
17+ type TableColumnType ,
18+ } from 'antd' ;
1119import type { CheckboxChangeEvent } from 'antd/lib/checkbox' ;
1220import type { DataNode } from 'antd/lib/tree' ;
1321import classNames from 'classnames' ;
@@ -160,6 +168,7 @@ const CheckboxList: React.FC<{
160168 : config . disable ?. checkbox ,
161169 isLeaf : parentConfig ? true : undefined ,
162170 } ;
171+
163172 if ( children ) {
164173 item . children = loopData ( children , {
165174 ...config ,
@@ -260,12 +269,22 @@ const CheckboxList: React.FC<{
260269 titleRender = { ( _node ) => {
261270 const node = { ..._node , children : undefined } ;
262271 if ( ! node . title ) return null ;
272+ const normalizedTitle = runFunction ( node . title , node ) ;
273+ const wrappedTitle = (
274+ < Typography . Text
275+ style = { { width : 80 } }
276+ ellipsis = { { tooltip : normalizedTitle } }
277+ >
278+ { normalizedTitle }
279+ </ Typography . Text >
280+ ) ;
281+
263282 return (
264283 < CheckboxListItem
265284 className = { className }
266285 { ...node }
267286 showListItemOption = { showListItemOption }
268- title = { runFunction ( node . title , node ) }
287+ title = { wrappedTitle }
269288 columnKey = { node . key as string }
270289 />
271290 ) ;
0 commit comments