Skip to content

Commit 7fd005c

Browse files
committed
fix(TextInputMapper): improve styles inside form
1 parent ff08611 commit 7fd005c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.changeset/chilly-crews-mix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Improve TextInputMapper styles inside Form.'

src/components/fields/TextInputMapper/TextInputMapper.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99

1010
import { useEvent } from '../../../_internal/hooks';
1111
import { FieldBaseProps } from '../../../shared';
12+
import { mergeProps } from '../../../utils/react/index';
1213
import { useFieldProps, useFormProps, wrapWithField } from '../../form';
1314
import { CloseIcon, PlusIcon } from '../../../icons';
1415
import { Button } from '../../actions';
@@ -34,6 +35,19 @@ export interface CubeTextInputMapperProps extends FieldBaseProps {
3435
valueProps?: Partial<CubeTextInputMapperInputProps>;
3536
}
3637

38+
// Rewrites upper level field component styles
39+
// @TODO: Remove this after the release of new Element API
40+
const PROPS_GRID_HACK = {
41+
styles: {
42+
InputArea: {
43+
gridColumn: {
44+
'': 'auto',
45+
'has-sider': 'auto',
46+
},
47+
},
48+
},
49+
};
50+
3751
// remove duplicates in mappings
3852
function removeDuplicates(mappings: Mapping[]) {
3953
const keys = new Set<string>();
@@ -254,7 +268,7 @@ function TextInputMapperInput(props: CubeTextInputMapperInputProps) {
254268
<TextInput
255269
qa="AddMapping"
256270
width="auto"
257-
{...rest}
271+
{...mergeProps(rest, PROPS_GRID_HACK)}
258272
id={undefined}
259273
value={value}
260274
labelPosition="top"

0 commit comments

Comments
 (0)