@@ -29,9 +29,9 @@ export interface CubeTextInputMapperProps extends FieldBaseProps {
2929 isDisabled ?: boolean ;
3030 value ?: Record < string , string > ;
3131 onChange ?: ( value : Record < string , string > | undefined ) => void ;
32- InputComponent ?: ComponentType < CubeTextInputMapperInputProps > ;
33- keyPlaceholder ?: string ;
34- valuePlaceholder ?: string ;
32+ ValueComponent ?: ComponentType < CubeTextInputMapperInputProps > ;
33+ keyProps ?: CubeTextInputMapperInputProps ;
34+ valueProps ?: CubeTextInputMapperInputProps ;
3535}
3636
3737// remove duplicates in mappings
@@ -61,7 +61,15 @@ function TextInputMapper(props: CubeTextInputMapperProps, ref: any) {
6161
6262 const counterRef = useRef ( 0 ) ;
6363
64- let { isDisabled, actionLabel, value, onChange, InputComponent } = props ;
64+ let {
65+ isDisabled,
66+ actionLabel,
67+ value,
68+ onChange,
69+ keyProps,
70+ valueProps,
71+ ValueComponent,
72+ } = props ;
6573
6674 function extractLocalValues (
6775 value : Record < string , string > ,
@@ -128,7 +136,7 @@ function TextInputMapper(props: CubeTextInputMapperProps, ref: any) {
128136 ) ;
129137 } , [ mappings ] ) ;
130138
131- InputComponent = InputComponent ?? TextInputMapperInput ;
139+ ValueComponent = ValueComponent ?? TextInputMapperInput ;
132140
133141 const onKeyChange = useEvent ( ( id : number , value : string ) => {
134142 mappings . find ( ( mapping ) => {
@@ -169,18 +177,20 @@ function TextInputMapper(props: CubeTextInputMapperProps, ref: any) {
169177 isDisabled = { isDisabled }
170178 type = "name"
171179 value = { key }
172- placeholder = { props . keyPlaceholder || ' Key' }
180+ placeholder = " Key"
173181 onChange = { onKeyChange }
174182 onSubmit = { onSubmit }
183+ { ...keyProps }
175184 />
176- < InputComponent
185+ < ValueComponent
177186 id = { id }
178187 type = "value"
179188 isDisabled = { ! key || isDisabled }
180189 value = { value }
181- placeholder = { props . valuePlaceholder || ' Value' }
190+ placeholder = " Value"
182191 onChange = { onValueChange }
183192 onSubmit = { onSubmit }
193+ { ...valueProps }
184194 />
185195 < Button
186196 aria-label = "Remove mapping"
0 commit comments