1
- import type { BaseSelectPropsWithoutPrivate , BaseSelectRef } from 'rc-select' ;
2
- import { BaseSelect } from 'rc-select' ;
3
- import useId from 'rc-select/lib/hooks/useId' ;
1
+ import type { BaseSelectPropsWithoutPrivate , BaseSelectRef } from '@ rc-component/ select' ;
2
+ import { BaseSelect } from '@ rc-component/ select' ;
3
+ import useId from '@ rc-component/ select/lib/hooks/useId' ;
4
4
import type { IconType } from 'rc-tree/lib/interface' ;
5
5
import type { ExpandAction } from 'rc-tree/lib/Tree' ;
6
6
import { conductCheck } from 'rc-tree/lib/utils/conductUtil' ;
7
- import useMergedState from 'rc-util/lib/hooks/useMergedState' ;
8
- import warning from 'rc-util/lib/warning' ;
7
+ import useMergedState from '@rc-component/util/lib/hooks/useMergedState' ;
9
8
import * as React from 'react' ;
10
9
import useCache from './hooks/useCache' ;
11
10
import useCheckedKeys from './hooks/useCheckedKeys' ;
@@ -93,7 +92,7 @@ export interface TreeSelectProps<ValueType = any, OptionType extends DataNode =
93
92
listHeight ?: number ;
94
93
listItemHeight ?: number ;
95
94
listItemScrollOffset ?: number ;
96
- onDropdownVisibleChange ?: ( open : boolean ) => void ;
95
+ onPopupVisibleChange ?: ( open : boolean ) => void ;
97
96
treeTitleRender ?: ( node : OptionType ) => React . ReactNode ;
98
97
99
98
// >>> Tree
@@ -163,8 +162,8 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
163
162
listItemHeight = 20 ,
164
163
listItemScrollOffset = 0 ,
165
164
166
- onDropdownVisibleChange ,
167
- dropdownMatchSelectWidth = true ,
165
+ onPopupVisibleChange ,
166
+ popupMatchSelectWidth = true ,
168
167
169
168
// Tree
170
169
treeLine,
@@ -582,22 +581,13 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
582
581
) ;
583
582
584
583
// ========================== Dropdown ==========================
585
- const onInternalDropdownVisibleChange = React . useCallback (
584
+ const onInternalPopupVisibleChange = React . useCallback (
586
585
( open : boolean ) => {
587
- if ( onDropdownVisibleChange ) {
588
- const legacyParam = { } ;
589
-
590
- Object . defineProperty ( legacyParam , 'documentClickClose' , {
591
- get ( ) {
592
- warning ( false , 'Second param of `onDropdownVisibleChange` has been removed.' ) ;
593
- return false ;
594
- } ,
595
- } ) ;
596
-
597
- ( onDropdownVisibleChange as any ) ( open , legacyParam ) ;
586
+ if ( onPopupVisibleChange ) {
587
+ onPopupVisibleChange ( open ) ;
598
588
}
599
589
} ,
600
- [ onDropdownVisibleChange ] ,
590
+ [ onPopupVisibleChange ] ,
601
591
) ;
602
592
603
593
// ====================== Display Change ========================
@@ -619,7 +609,7 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
619
609
const treeSelectContext = React . useMemo < TreeSelectContextProps > ( ( ) => {
620
610
return {
621
611
virtual,
622
- dropdownMatchSelectWidth ,
612
+ popupMatchSelectWidth ,
623
613
listHeight,
624
614
listItemHeight,
625
615
listItemScrollOffset,
@@ -636,7 +626,7 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
636
626
} ;
637
627
} , [
638
628
virtual ,
639
- dropdownMatchSelectWidth ,
629
+ popupMatchSelectWidth ,
640
630
listHeight ,
641
631
listItemHeight ,
642
632
listItemScrollOffset ,
@@ -716,8 +706,8 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
716
706
// >>> Options
717
707
OptionList = { OptionList }
718
708
emptyOptions = { ! mergedTreeData . length }
719
- onDropdownVisibleChange = { onInternalDropdownVisibleChange }
720
- dropdownMatchSelectWidth = { dropdownMatchSelectWidth }
709
+ onPopupVisibleChange = { onInternalPopupVisibleChange }
710
+ popupMatchSelectWidth = { popupMatchSelectWidth }
721
711
/>
722
712
</ LegacyContext . Provider >
723
713
</ TreeSelectContext . Provider >
0 commit comments