@@ -6,9 +6,9 @@ import ShuyunUtils from 'shuyun-utils';
66import ContextProvider from '@contexts/context-provider' ;
77import { noop } from '@utils' ;
88
9- import Tree from './tree' ;
9+ import Tree from './tree/tree ' ;
1010import Selected from './selected' ;
11- import SingleTree from './single-tree' ;
11+ import SingleTree from './tree/ single-tree' ;
1212import { selector , SINGLE , MULTIPLE , getNodePath } from './const' ;
1313
1414import './index.less' ;
@@ -197,9 +197,9 @@ class TreeSelect extends Component {
197197 }
198198 } ;
199199
200- handleSelect = ( ) => {
200+ handleSelect = ( { isClose = false } = { } ) => {
201201 const { open } = this . state ;
202- const { onSelectOpen, onSelectClose, open : propOpen , searchInBox , type } = this . props ;
202+ const { onSelectOpen, onSelectClose, open : propOpen , type } = this . props ;
203203 if ( open ) {
204204 onSelectClose ( ) ;
205205 } else {
@@ -211,7 +211,7 @@ class TreeSelect extends Component {
211211 setTimeout ( ( ) => {
212212 this . optionsNode . current . classList . add ( 'show' ) ;
213213 } ) ;
214- } else if ( ! searchInBox || searchInBox && type === MULTIPLE || searchInBox && type !== MULTIPLE && ! this . state . isSearch ) {
214+ } else if ( type !== MULTIPLE && ! this . state . isSearch || isClose ) {
215215 this . optionsNode . current . classList . remove ( 'show' ) ;
216216 setTimeout ( ( ) => {
217217 this . setState ( { open : ! open } ) ;
@@ -290,7 +290,7 @@ class TreeSelect extends Component {
290290 prevValue : selectedNodes ,
291291 } ) ;
292292 this . props . onOk ( node , selectedNodes ) ;
293- this . handleSelect ( ) ;
293+ this . handleSelect ( { isClose : true } ) ;
294294 } ;
295295
296296 handleCancel = ( ) => {
@@ -299,7 +299,7 @@ class TreeSelect extends Component {
299299 value : prevValue ,
300300 } ) ;
301301 this . props . onCancel ( ) ;
302- this . handleSelect ( ) ;
302+ this . handleSelect ( { isClose : true } ) ;
303303 } ;
304304
305305 handleReset = ( ) => {
@@ -386,7 +386,6 @@ class TreeSelect extends Component {
386386 treeData = { this . props . isDynamicLoad ? this . props . dataSource : this . state . treeData }
387387 disabled = { disabled }
388388 searchable = { searchable }
389- searchInBox = { this . props . searchInBox }
390389 treeRef = { this . treeRef }
391390 setSearchStatus = { this . setSearchStatus }
392391 onMultiChange = { this . onValueChange }
@@ -427,14 +426,15 @@ TreeSelect.propTypes = {
427426 onOk : PropTypes . func ,
428427 onCancel : PropTypes . func ,
429428 onReset : PropTypes . func ,
430- searchInBox : PropTypes . bool ,
431429 showTag : PropTypes . bool ,
432430 maxTagCount : PropTypes . number ,
431+ scrollSelected : PropTypes . bool ,
433432 dropdownStyle : PropTypes . object ,
434433 dropdownClassName : PropTypes . string ,
435434 position : PropTypes . oneOf ( [ 'top' , 'bottom' , 'auto' ] ) ,
436435 maxHeight : PropTypes . number ,
437436 size : PropTypes . oneOf ( [ 'small' , 'default' , 'large' ] ) ,
437+ borderRadiusSize : PropTypes . oneOf ( [ 'default' , 'medium' , 'large' , 'circle' ] ) ,
438438} ;
439439
440440TreeSelect . defaultProps = {
@@ -460,14 +460,15 @@ TreeSelect.defaultProps = {
460460 onOk : noop ,
461461 onCancel : noop ,
462462 onReset : noop ,
463- searchInBox : true ,
464463 showTag : true ,
465464 maxTagCount : 1 ,
465+ scrollSelected : false ,
466466 dropdownStyle : { } ,
467467 dropdownClassName : '' ,
468468 position : 'bottom' ,
469469 maxHeight : undefined ,
470470 size : 'default' ,
471+ borderRadiusSize : 'default' ,
471472} ;
472473
473474export default TreeSelect ;
0 commit comments