@@ -5,10 +5,10 @@ import * as React from 'react';
55import type { Placement , RenderDOMFunc } from './BaseSelect' ;
66
77const getBuiltInPlacements = (
8- dropdownMatchSelectWidth : number | boolean ,
8+ popupMatchSelectWidth : number | boolean ,
99) : Record < string , AlignType > => {
1010 // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
11- const adjustX = dropdownMatchSelectWidth === true ? 0 : 1 ;
11+ const adjustX = popupMatchSelectWidth === true ? 0 : 1 ;
1212 return {
1313 bottomLeft : {
1414 points : [ 'tl' , 'bl' ] ,
@@ -64,13 +64,13 @@ export interface SelectTriggerProps {
6464 transitionName ?: string ;
6565 placement ?: Placement ;
6666 builtinPlacements ?: BuildInPlacements ;
67- dropdownStyle : React . CSSProperties ;
68- dropdownClassName : string ;
67+ popupStyle : React . CSSProperties ;
68+ popupClassName : string ;
6969 direction : string ;
70- dropdownMatchSelectWidth ?: boolean | number ;
71- dropdownRender ?: ( menu : React . ReactElement ) => React . ReactElement ;
70+ popupMatchSelectWidth ?: boolean | number ;
71+ popupRender ?: ( menu : React . ReactElement ) => React . ReactElement ;
7272 getPopupContainer ?: RenderDOMFunc ;
73- dropdownAlign : AlignType ;
73+ popupAlign : AlignType ;
7474 empty : boolean ;
7575
7676 getTriggerDOMNode : ( node : HTMLElement ) => HTMLElement ;
@@ -91,14 +91,14 @@ const SelectTrigger: React.ForwardRefRenderFunction<RefTriggerProps, SelectTrigg
9191 popupElement,
9292 animation,
9393 transitionName,
94- dropdownStyle ,
95- dropdownClassName ,
94+ popupStyle ,
95+ popupClassName ,
9696 direction = 'ltr' ,
9797 placement,
9898 builtinPlacements,
99- dropdownMatchSelectWidth ,
100- dropdownRender ,
101- dropdownAlign ,
99+ popupMatchSelectWidth ,
100+ popupRender ,
101+ popupAlign ,
102102 getPopupContainer,
103103 empty,
104104 getTriggerDOMNode,
@@ -107,38 +107,38 @@ const SelectTrigger: React.ForwardRefRenderFunction<RefTriggerProps, SelectTrigg
107107 ...restProps
108108 } = props ;
109109
110- const dropdownPrefixCls = `${ prefixCls } -dropdown` ;
110+ const popupPrefixCls = `${ prefixCls } -dropdown` ;
111111
112112 let popupNode = popupElement ;
113- if ( dropdownRender ) {
114- popupNode = dropdownRender ( popupElement ) ;
113+ if ( popupRender ) {
114+ popupNode = popupRender ( popupElement ) ;
115115 }
116116
117117 const mergedBuiltinPlacements = React . useMemo (
118- ( ) => builtinPlacements || getBuiltInPlacements ( dropdownMatchSelectWidth ) ,
119- [ builtinPlacements , dropdownMatchSelectWidth ] ,
118+ ( ) => builtinPlacements || getBuiltInPlacements ( popupMatchSelectWidth ) ,
119+ [ builtinPlacements , popupMatchSelectWidth ] ,
120120 ) ;
121121
122122 // ===================== Motion ======================
123- const mergedTransitionName = animation ? `${ dropdownPrefixCls } -${ animation } ` : transitionName ;
123+ const mergedTransitionName = animation ? `${ popupPrefixCls } -${ animation } ` : transitionName ;
124124
125125 // =================== Popup Width ===================
126- const isNumberPopupWidth = typeof dropdownMatchSelectWidth === 'number' ;
126+ const isNumberPopupWidth = typeof popupMatchSelectWidth === 'number' ;
127127
128128 const stretch = React . useMemo ( ( ) => {
129129 if ( isNumberPopupWidth ) {
130130 return null ;
131131 }
132132
133- return dropdownMatchSelectWidth === false ? 'minWidth' : 'width' ;
134- } , [ dropdownMatchSelectWidth , isNumberPopupWidth ] ) ;
133+ return popupMatchSelectWidth === false ? 'minWidth' : 'width' ;
134+ } , [ popupMatchSelectWidth , isNumberPopupWidth ] ) ;
135135
136- let popupStyle = dropdownStyle ;
136+ let mergedPopupStyle = popupStyle ;
137137
138138 if ( isNumberPopupWidth ) {
139- popupStyle = {
139+ mergedPopupStyle = {
140140 ...popupStyle ,
141- width : dropdownMatchSelectWidth ,
141+ width : popupMatchSelectWidth ,
142142 } ;
143143 }
144144
@@ -156,18 +156,18 @@ const SelectTrigger: React.ForwardRefRenderFunction<RefTriggerProps, SelectTrigg
156156 hideAction = { onPopupVisibleChange ? [ 'click' ] : [ ] }
157157 popupPlacement = { placement || ( direction === 'rtl' ? 'bottomRight' : 'bottomLeft' ) }
158158 builtinPlacements = { mergedBuiltinPlacements }
159- prefixCls = { dropdownPrefixCls }
159+ prefixCls = { popupPrefixCls }
160160 popupTransitionName = { mergedTransitionName }
161161 popup = { < div onMouseEnter = { onPopupMouseEnter } > { popupNode } </ div > }
162162 ref = { triggerPopupRef }
163163 stretch = { stretch }
164- popupAlign = { dropdownAlign }
164+ popupAlign = { popupAlign }
165165 popupVisible = { visible }
166166 getPopupContainer = { getPopupContainer }
167- popupClassName = { classNames ( dropdownClassName , {
168- [ `${ dropdownPrefixCls } -empty` ] : empty ,
167+ popupClassName = { classNames ( popupClassName , {
168+ [ `${ popupPrefixCls } -empty` ] : empty ,
169169 } ) }
170- popupStyle = { popupStyle }
170+ popupStyle = { mergedPopupStyle }
171171 getTriggerDOMNode = { getTriggerDOMNode }
172172 onPopupVisibleChange = { onPopupVisibleChange }
173173 >
0 commit comments