File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/color-compact/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export interface CompactProps<T> extends Omit<React.HTMLAttributes<HTMLDivElemen
19
19
onChange ?: ( color : ColorResult , evn ?: T ) => void ;
20
20
rectRender ?: ( props : SwatchRectRenderProps ) => JSX . Element | undefined ;
21
21
rectProps ?: SwatchProps [ 'rectProps' ] ;
22
+ addonBefore ?: React . ReactNode ;
23
+ addonAfter ?: React . ReactNode ;
22
24
}
23
25
24
26
const COLORS = [
@@ -84,6 +86,8 @@ const Compact = React.forwardRef<HTMLDivElement, CompactProps<React.MouseEvent<H
84
86
colors = COLORS ,
85
87
rectProps,
86
88
rectRender,
89
+ addonBefore,
90
+ addonAfter,
87
91
...other
88
92
} = props ;
89
93
const hsva = ( typeof color === 'string' && validHex ( color ) ? hexToHsva ( color ) : color ) as HsvaColor ;
@@ -128,8 +132,13 @@ const Compact = React.forwardRef<HTMLDivElement, CompactProps<React.MouseEvent<H
128
132
} ,
129
133
} }
130
134
onChange = { ( hsvColor ) => handleChangeCallback ( hsvColor ) }
135
+ addonBefore = { addonBefore }
136
+ addonAfter = { addonAfter }
131
137
/>
132
- < div style = { { display : 'flex' , margin : '0 4px 3px 0' } } >
138
+ < div
139
+ className = { [ `${ prefixCls } -input-wrapper` , className || '' ] . filter ( Boolean ) . join ( ' ' ) }
140
+ style = { { display : 'flex' , margin : '0 4px 3px 0' } }
141
+ >
133
142
< EditableInput
134
143
onChange = { ( evn , val ) => handleHex ( val , evn ) }
135
144
labelStyle = { { paddingRight : 5 , marginTop : - 1 } }
You can’t perform that action at this time.
0 commit comments