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 () => {
51
51
< div style = { { display : 'flex' , flexWrap : 'wrap' } } >
52
52
< div style = { { margin : '0 8px' } } >
53
53
< 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
+ />
55
64
< Picker < Moment > { ...sharedProps } locale = { enUS } />
56
65
</ div >
57
66
< div style = { { margin : '0 8px' } } >
Original file line number Diff line number Diff line change 1
1
import { useEvent , useMergedState } from '@rc-component/util' ;
2
+ import cls from 'classnames' ;
2
3
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect' ;
3
4
import omit from '@rc-component/util/lib/omit' ;
4
5
import pickAttrs from '@rc-component/util/lib/pickAttrs' ;
@@ -159,6 +160,7 @@ function RangePicker<DateType extends object = any>(
159
160
const {
160
161
// Style
161
162
prefixCls,
163
+ rootClassName,
162
164
styles : propStyles ,
163
165
classNames : propClassNames ,
164
166
@@ -770,7 +772,7 @@ function RangePicker<DateType extends object = any>(
770
772
{ ...pickTriggerProps ( filledProps ) }
771
773
popupElement = { panel }
772
774
popupStyle = { mergedStyles . popup . root }
773
- popupClassName = { mergedClassNames . popup . root }
775
+ popupClassName = { cls ( rootClassName , mergedClassNames . popup . root ) }
774
776
// Visible
775
777
visible = { mergedOpen }
776
778
onClose = { onPopupClose }
@@ -782,6 +784,12 @@ function RangePicker<DateType extends object = any>(
782
784
{ ...filledProps }
783
785
// Ref
784
786
ref = { selectorRef }
787
+ // Style
788
+ className = { cls ( filledProps . className , rootClassName , mergedClassNames . root ) }
789
+ style = { {
790
+ ...mergedStyles . root ,
791
+ ...filledProps . style ,
792
+ } }
785
793
// Icon
786
794
suffixIcon = { suffixIcon }
787
795
// Active
Original file line number Diff line number Diff line change 1
1
import { useEvent , useMergedState } from '@rc-component/util' ;
2
+ import cls from 'classnames' ;
2
3
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect' ;
3
4
import omit from '@rc-component/util/lib/omit' ;
4
5
import pickAttrs from '@rc-component/util/lib/pickAttrs' ;
@@ -123,6 +124,7 @@ function Picker<DateType extends object = any>(
123
124
const {
124
125
// Style
125
126
prefixCls,
127
+ rootClassName,
126
128
styles : propStyles ,
127
129
classNames : propClassNames ,
128
130
@@ -630,7 +632,7 @@ function Picker<DateType extends object = any>(
630
632
{ ...pickTriggerProps ( filledProps ) }
631
633
popupElement = { panel }
632
634
popupStyle = { mergedStyles . popup . root }
633
- popupClassName = { mergedClassNames . popup . root }
635
+ popupClassName = { cls ( rootClassName , mergedClassNames . popup . root ) }
634
636
// Visible
635
637
visible = { mergedOpen }
636
638
onClose = { onPopupClose }
@@ -640,6 +642,12 @@ function Picker<DateType extends object = any>(
640
642
{ ...filledProps }
641
643
// Ref
642
644
ref = { selectorRef }
645
+ // Style
646
+ className = { cls ( filledProps . className , rootClassName , mergedClassNames . root ) }
647
+ style = { {
648
+ ...mergedStyles . root ,
649
+ ...filledProps . style ,
650
+ } }
643
651
// Icon
644
652
suffixIcon = { suffixIcon }
645
653
removeIcon = { removeIcon }
Original file line number Diff line number Diff line change @@ -329,12 +329,13 @@ export interface SharedPickerProps<DateType extends object = any>
329
329
prefixCls ?: string ;
330
330
className ?: string ;
331
331
style ?: React . CSSProperties ;
332
+ rootClassName ?: string ;
332
333
333
334
styles ?: Partial < Record < SemanticName , React . CSSProperties > > & {
334
- popup : Partial < Record < PanelSemanticName , React . CSSProperties > > ;
335
+ popup ? : Partial < Record < PanelSemanticName , React . CSSProperties > > ;
335
336
} ;
336
337
classNames ?: Partial < Record < SemanticName , string > > & {
337
- popup : Partial < Record < PanelSemanticName , string > > ;
338
+ popup ? : Partial < Record < PanelSemanticName , string > > ;
338
339
} ;
339
340
340
341
// Config
You can’t perform that action at this time.
0 commit comments