File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,16 @@ export default () => {
5151 < div style = { { display : 'flex' , flexWrap : 'wrap' } } >
5252 < div style = { { margin : '0 8px' } } >
5353 < h3 > Basic</ h3 >
54- < Picker < Moment > { ...sharedProps } locale = { zhCN } suffixIcon = "SUFFIX" />
54+ < Picker < Moment >
55+ { ...sharedProps }
56+ locale = { zhCN }
57+ suffixIcon = "SUFFIX"
58+ rootClassName = "bamboo"
59+ className = "little"
60+ classNames = { {
61+ root : 'light' ,
62+ } }
63+ />
5564 < Picker < Moment > { ...sharedProps } locale = { enUS } />
5665 </ div >
5766 < div style = { { margin : '0 8px' } } >
Original file line number Diff line number Diff line change 11import { useEvent , useMergedState } from '@rc-component/util' ;
2+ import cls from 'classnames' ;
23import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect' ;
34import omit from '@rc-component/util/lib/omit' ;
45import pickAttrs from '@rc-component/util/lib/pickAttrs' ;
@@ -159,6 +160,7 @@ function RangePicker<DateType extends object = any>(
159160 const {
160161 // Style
161162 prefixCls,
163+ rootClassName,
162164 styles : propStyles ,
163165 classNames : propClassNames ,
164166
@@ -770,7 +772,7 @@ function RangePicker<DateType extends object = any>(
770772 { ...pickTriggerProps ( filledProps ) }
771773 popupElement = { panel }
772774 popupStyle = { mergedStyles . popup . root }
773- popupClassName = { mergedClassNames . popup . root }
775+ popupClassName = { cls ( rootClassName , mergedClassNames . popup . root ) }
774776 // Visible
775777 visible = { mergedOpen }
776778 onClose = { onPopupClose }
@@ -782,6 +784,12 @@ function RangePicker<DateType extends object = any>(
782784 { ...filledProps }
783785 // Ref
784786 ref = { selectorRef }
787+ // Style
788+ className = { cls ( filledProps . className , rootClassName , mergedClassNames . root ) }
789+ style = { {
790+ ...mergedStyles . root ,
791+ ...filledProps . style ,
792+ } }
785793 // Icon
786794 suffixIcon = { suffixIcon }
787795 // Active
Original file line number Diff line number Diff line change 11import { useEvent , useMergedState } from '@rc-component/util' ;
2+ import cls from 'classnames' ;
23import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect' ;
34import omit from '@rc-component/util/lib/omit' ;
45import pickAttrs from '@rc-component/util/lib/pickAttrs' ;
@@ -123,6 +124,7 @@ function Picker<DateType extends object = any>(
123124 const {
124125 // Style
125126 prefixCls,
127+ rootClassName,
126128 styles : propStyles ,
127129 classNames : propClassNames ,
128130
@@ -630,7 +632,7 @@ function Picker<DateType extends object = any>(
630632 { ...pickTriggerProps ( filledProps ) }
631633 popupElement = { panel }
632634 popupStyle = { mergedStyles . popup . root }
633- popupClassName = { mergedClassNames . popup . root }
635+ popupClassName = { cls ( rootClassName , mergedClassNames . popup . root ) }
634636 // Visible
635637 visible = { mergedOpen }
636638 onClose = { onPopupClose }
@@ -640,6 +642,12 @@ function Picker<DateType extends object = any>(
640642 { ...filledProps }
641643 // Ref
642644 ref = { selectorRef }
645+ // Style
646+ className = { cls ( filledProps . className , rootClassName , mergedClassNames . root ) }
647+ style = { {
648+ ...mergedStyles . root ,
649+ ...filledProps . style ,
650+ } }
643651 // Icon
644652 suffixIcon = { suffixIcon }
645653 removeIcon = { removeIcon }
Original file line number Diff line number Diff line change @@ -329,12 +329,13 @@ export interface SharedPickerProps<DateType extends object = any>
329329 prefixCls ?: string ;
330330 className ?: string ;
331331 style ?: React . CSSProperties ;
332+ rootClassName ?: string ;
332333
333334 styles ?: Partial < Record < SemanticName , React . CSSProperties > > & {
334- popup : Partial < Record < PanelSemanticName , React . CSSProperties > > ;
335+ popup ? : Partial < Record < PanelSemanticName , React . CSSProperties > > ;
335336 } ;
336337 classNames ?: Partial < Record < SemanticName , string > > & {
337- popup : Partial < Record < PanelSemanticName , string > > ;
338+ popup ? : Partial < Record < PanelSemanticName , string > > ;
338339 } ;
339340
340341 // Config
You can’t perform that action at this time.
0 commit comments