@@ -127,20 +127,26 @@ export interface SinglePickerPanelProps<DateType extends object = any>
127
127
onChange ?: ( date : DateType ) => void ;
128
128
}
129
129
130
+ type PanelSemanticName = 'popupBody' | 'popupContent' ;
130
131
export type PickerPanelProps < DateType extends object = any > = BasePickerPanelProps < DateType > & {
131
132
/** multiple selection. Not support time or datetime picker */
132
133
multiple ?: boolean ;
133
134
134
135
defaultValue ?: DateType | DateType [ ] | null ;
135
136
value ?: DateType | DateType [ ] | null ;
136
137
onChange ?: ( date : DateType | DateType [ ] ) => void ;
138
+ styles ?: Partial < Record < PanelSemanticName , React . CSSProperties > > ;
139
+ classNames ?: Partial < Record < PanelSemanticName , string > > ;
137
140
} ;
138
141
139
142
function PickerPanel < DateType extends object = any > (
140
143
props : PickerPanelProps < DateType > ,
141
144
ref : React . Ref < PickerPanelRef > ,
142
145
) {
143
146
const {
147
+ classNames : panelClassNames ,
148
+ styles : panelStyles ,
149
+
144
150
locale,
145
151
generateConfig,
146
152
@@ -187,7 +193,7 @@ function PickerPanel<DateType extends object = any>(
187
193
const {
188
194
prefixCls : contextPrefixCls ,
189
195
classNames : pickerClassNames ,
190
- styles,
196
+ styles : pickerStyles ,
191
197
} = React . useContext ( PickerContext ) || { } ;
192
198
193
199
// ======================== prefixCls ========================
@@ -372,10 +378,17 @@ function PickerPanel<DateType extends object = any>(
372
378
DatePanel ) as typeof DatePanel ;
373
379
374
380
// ======================== Context =========================
381
+ const mergedStyles = pickerStyles ?? panelStyles ;
382
+ const mergedClassNames = pickerClassNames ?? panelClassNames ;
375
383
const parentHackContext = React . useContext ( PickerHackContext ) ;
376
384
const pickerPanelContext = React . useMemo (
377
- ( ) => ( { ...parentHackContext , hideHeader, classNames : pickerClassNames , styles } ) ,
378
- [ parentHackContext , hideHeader , pickerClassNames , styles ] ,
385
+ ( ) => ( {
386
+ ...parentHackContext ,
387
+ hideHeader,
388
+ classNames : mergedClassNames ,
389
+ styles : mergedStyles ,
390
+ } ) ,
391
+ [ parentHackContext , hideHeader , mergedClassNames , mergedStyles ] ,
379
392
) ;
380
393
381
394
// ======================== Warnings ========================
0 commit comments