@@ -28,7 +28,7 @@ import {
2828 toRawValues ,
2929} from './utils/commonUtil' ;
3030import { formatStrategyValues , toPathOptions } from './utils/treeUtil' ;
31- import warningProps , { warningNullOptions } from './utils/warningPropsUtil' ;
31+ import { warningNullOptions } from './utils/warningPropsUtil' ;
3232
3333export interface BaseOptionType {
3434 disabled ?: boolean ;
@@ -71,9 +71,9 @@ interface BaseCascaderProps<
7171 OptionType extends DefaultOptionType = DefaultOptionType ,
7272 ValueField extends keyof OptionType = keyof OptionType ,
7373> extends Omit <
74- BaseSelectPropsWithoutPrivate ,
75- 'tokenSeparators' | 'labelInValue' | 'mode' | 'showSearch'
76- > {
74+ BaseSelectPropsWithoutPrivate ,
75+ 'tokenSeparators' | 'labelInValue' | 'mode' | 'showSearch'
76+ > {
7777 // MISC
7878 id ?: string ;
7979 prefixCls ?: string ;
@@ -99,18 +99,12 @@ interface BaseCascaderProps<
9999 // Options
100100 options ?: OptionType [ ] ;
101101 /** @private Internal usage. Do not use in your production. */
102- dropdownPrefixCls ?: string ;
102+ popupPrefixCls ?: string ;
103103 loadData ?: ( selectOptions : OptionType [ ] ) => void ;
104104
105- // Open
106- /** @deprecated Use `open` instead */
107- popupVisible ?: boolean ;
108-
109105 popupClassName ?: string ;
110- dropdownMenuColumnStyle ?: React . CSSProperties ;
106+ popupMenuColumnStyle ?: React . CSSProperties ;
111107
112- /** @deprecated Use `placement` instead */
113- popupPlacement ?: Placement ;
114108 placement ?: Placement ;
115109 builtinPlacements ?: BuildInPlacements ;
116110
@@ -135,8 +129,8 @@ export type ValueType<
135129 ValueField extends keyof OptionType = keyof OptionType ,
136130> = keyof OptionType extends ValueField
137131 ? unknown extends OptionType [ 'value' ]
138- ? OptionType [ ValueField ]
139- : OptionType [ 'value' ]
132+ ? OptionType [ ValueField ]
133+ : OptionType [ 'value' ]
140134 : OptionType [ ValueField ] ;
141135
142136export type GetValueType <
@@ -167,6 +161,9 @@ export interface CascaderProps<
167161}
168162
169163export type SingleValueType = ( string | number ) [ ] ;
164+
165+ export type LegacyKey = string | number ;
166+
170167export type InternalValueType = SingleValueType | SingleValueType [ ] ;
171168
172169export interface InternalFieldNames extends Required < FieldNames > {
@@ -210,18 +207,15 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
210207
211208 // Options
212209 options,
213- dropdownPrefixCls ,
210+ popupPrefixCls ,
214211 loadData,
215212
216- // Open
217- popupVisible,
218213 open,
219214
220215 popupClassName,
221- dropdownMenuColumnStyle ,
216+ popupMenuColumnStyle ,
222217 popupStyle : customPopupStyle ,
223218
224- popupPlacement,
225219 placement,
226220
227221 onPopupVisibleChange,
@@ -281,7 +275,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
281275 mergedSearchValue ,
282276 mergedOptions ,
283277 mergedFieldNames ,
284- dropdownPrefixCls || prefixCls ,
278+ popupPrefixCls || prefixCls ,
285279 searchConfig ,
286280 changeOnSelect || multiple ,
287281 ) ;
@@ -374,18 +368,13 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
374368 onInternalSelect ( valueCells ) ;
375369 } ;
376370
377- // ============================ Open ============================
378- const mergedOpen = open !== undefined ? open : popupVisible ;
379-
380- const mergedPlacement = placement || popupPlacement ;
381-
382371 const onInternalPopupVisibleChange = ( nextVisible : boolean ) => {
383372 onPopupVisibleChange ?.( nextVisible ) ;
384373 } ;
385374
375+
386376 // ========================== Warning ===========================
387377 if ( process . env . NODE_ENV !== 'production' ) {
388- warningProps ( props ) ;
389378 warningNullOptions ( mergedOptions , mergedFieldNames ) ;
390379 }
391380
@@ -400,12 +389,12 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
400389 onSelect : onInternalSelect ,
401390 checkable,
402391 searchOptions,
403- dropdownPrefixCls ,
392+ popupPrefixCls ,
404393 loadData,
405394 expandTrigger,
406395 expandIcon,
407396 loadingIcon,
408- dropdownMenuColumnStyle ,
397+ popupMenuColumnStyle ,
409398 optionRender,
410399 } ) ,
411400 [
@@ -417,12 +406,12 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
417406 onInternalSelect ,
418407 checkable ,
419408 searchOptions ,
420- dropdownPrefixCls ,
409+ popupPrefixCls ,
421410 loadData ,
422411 expandTrigger ,
423412 expandIcon ,
424413 loadingIcon ,
425- dropdownMenuColumnStyle ,
414+ popupMenuColumnStyle ,
426415 optionRender ,
427416 ] ,
428417 ) ;
@@ -435,12 +424,12 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
435424 const popupStyle : React . CSSProperties =
436425 // Search to match width
437426 ( mergedSearchValue && searchConfig . matchInputWidth ) ||
438- // Empty keep the width
439- emptyOptions
427+ // Empty keep the width
428+ emptyOptions
440429 ? { }
441430 : {
442- minWidth : 'auto' ,
443- } ;
431+ minWidth : 'auto' ,
432+ } ;
444433
445434 return (
446435 < CascaderContext . Provider value = { cascaderContext } >
@@ -468,9 +457,9 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
468457 OptionList = { OptionList }
469458 emptyOptions = { emptyOptions }
470459 // Open
471- open = { mergedOpen }
460+ open = { open }
472461 popupClassName = { popupClassName }
473- placement = { mergedPlacement }
462+ placement = { placement }
474463 onPopupVisibleChange = { onInternalPopupVisibleChange }
475464 // Children
476465 getRawInputElement = { ( ) => children as React . ReactElement }
0 commit comments