@@ -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 ;
@@ -129,8 +129,8 @@ export type ValueType<
129129 ValueField extends keyof OptionType = keyof OptionType ,
130130> = keyof OptionType extends ValueField
131131 ? unknown extends OptionType [ 'value' ]
132- ? OptionType [ ValueField ]
133- : OptionType [ 'value' ]
132+ ? OptionType [ ValueField ]
133+ : OptionType [ 'value' ]
134134 : OptionType [ ValueField ] ;
135135
136136export type GetValueType <
@@ -146,11 +146,19 @@ export type GetOptionType<
146146 Multiple extends boolean | React . ReactNode = false ,
147147> = false extends Multiple ? OptionType [ ] : OptionType [ ] [ ] ;
148148
149+ type SemanticName = 'input' | 'prefix' | 'suffix' ;
150+ type PopupSemantic = 'list' | 'listItem' ;
149151export interface CascaderProps <
150152 OptionType extends DefaultOptionType = DefaultOptionType ,
151153 ValueField extends keyof OptionType = keyof OptionType ,
152154 Multiple extends boolean | React . ReactNode = false ,
153155> extends BaseCascaderProps < OptionType , ValueField > {
156+ styles ?: Partial < Record < SemanticName , React . CSSProperties > > & {
157+ popup ?: Partial < Record < PopupSemantic , React . CSSProperties > > ;
158+ } ;
159+ classNames ?: Partial < Record < SemanticName , string > > & {
160+ popup ?: Partial < Record < PopupSemantic , string > > ;
161+ } ;
154162 checkable ?: Multiple ;
155163 value ?: GetValueType < OptionType , ValueField , Multiple > ;
156164 defaultValue ?: GetValueType < OptionType , ValueField , Multiple > ;
@@ -216,6 +224,9 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
216224 popupMenuColumnStyle,
217225 popupStyle : customPopupStyle ,
218226
227+ classNames,
228+ styles,
229+
219230 placement,
220231
221232 onPopupVisibleChange,
@@ -372,7 +383,6 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
372383 onPopupVisibleChange ?.( nextVisible ) ;
373384 } ;
374385
375-
376386 // ========================== Warning ===========================
377387 if ( process . env . NODE_ENV !== 'production' ) {
378388 warningNullOptions ( mergedOptions , mergedFieldNames ) ;
@@ -381,6 +391,8 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
381391 // ========================== Context ===========================
382392 const cascaderContext = React . useMemo (
383393 ( ) => ( {
394+ classNames,
395+ styles,
384396 options : mergedOptions ,
385397 fieldNames : mergedFieldNames ,
386398 values : checkedValues ,
@@ -424,12 +436,12 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
424436 const popupStyle : React . CSSProperties =
425437 // Search to match width
426438 ( mergedSearchValue && searchConfig . matchInputWidth ) ||
427- // Empty keep the width
428- emptyOptions
439+ // Empty keep the width
440+ emptyOptions
429441 ? { }
430442 : {
431- minWidth : 'auto' ,
432- } ;
443+ minWidth : 'auto' ,
444+ } ;
433445
434446 return (
435447 < CascaderContext . Provider value = { cascaderContext } >
@@ -441,6 +453,16 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
441453 prefixCls = { prefixCls }
442454 autoClearSearchValue = { autoClearSearchValue }
443455 popupMatchSelectWidth = { popupMatchSelectWidth }
456+ classNames = { {
457+ prefix : classNames ?. prefix ,
458+ suffix : classNames ?. suffix ,
459+ input : classNames ?. input ,
460+ } }
461+ styles = { {
462+ prefix : styles ?. prefix ,
463+ suffix : styles ?. suffix ,
464+ input : styles ?. input ,
465+ } }
444466 popupStyle = { {
445467 ...popupStyle ,
446468 ...customPopupStyle ,
0 commit comments