File tree 4 files changed +22
-3
lines changed
packages/ra-ui-materialui/src/input
4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 4
4
TranslatableContextProvider ,
5
5
useTranslatable ,
6
6
UseTranslatableOptions ,
7
+ InputProps ,
7
8
} from 'ra-core' ;
8
9
import { TranslatableInputsTabs } from './TranslatableInputsTabs' ;
9
10
import { TranslatableInputsTabContent } from './TranslatableInputsTabContent' ;
@@ -69,6 +70,8 @@ export const TranslatableInputs = (props: TranslatableProps): ReactElement => {
69
70
groupKey = '' ,
70
71
selector = < TranslatableInputsTabs groupKey = { groupKey } /> ,
71
72
children,
73
+ variant,
74
+ margin,
72
75
} = props ;
73
76
const context = useTranslatable ( { defaultLocale, locales } ) ;
74
77
const classes = useStyles ( props ) ;
@@ -82,6 +85,8 @@ export const TranslatableInputs = (props: TranslatableProps): ReactElement => {
82
85
key = { locale }
83
86
locale = { locale }
84
87
groupKey = { groupKey }
88
+ variant = { variant }
89
+ margin = { margin }
85
90
>
86
91
{ children }
87
92
</ TranslatableInputsTabContent >
@@ -91,7 +96,7 @@ export const TranslatableInputs = (props: TranslatableProps): ReactElement => {
91
96
) ;
92
97
} ;
93
98
94
- export interface TranslatableProps extends UseTranslatableOptions {
99
+ export interface TranslatableProps extends UseTranslatableOptions , InputProps {
95
100
selector ?: ReactElement ;
96
101
children : ReactNode ;
97
102
groupKey ?: string ;
Original file line number Diff line number Diff line change @@ -24,14 +24,21 @@ export const TranslatableInputsTab = (
24
24
label = { translate ( `ra.locales.${ locale } ` , {
25
25
_ : capitalize ( locale ) ,
26
26
} ) }
27
- className = { invalid && touched ? classes . error : undefined }
27
+ className = { `${ classes . root } ${
28
+ invalid && touched ? classes . error : ''
29
+ } `}
28
30
{ ...rest }
29
31
/>
30
32
) ;
31
33
} ;
32
34
33
35
const useStyles = makeStyles (
34
36
theme => ( {
37
+ root : {
38
+ fontSize : '0.8em' ,
39
+ minHeight : theme . spacing ( 3 ) ,
40
+ minWidth : theme . spacing ( 6 ) ,
41
+ } ,
35
42
error : { color : theme . palette . error . main } ,
36
43
} ) ,
37
44
{ name : 'RaTranslatableInputsTab' }
Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ const useStyles = makeStyles(
90
90
theme => ( {
91
91
root : {
92
92
flexGrow : 1 ,
93
- padding : theme . spacing ( 2 ) ,
93
+ paddingLeft : theme . spacing ( 2 ) ,
94
+ paddingRight : theme . spacing ( 2 ) ,
95
+ paddingTop : theme . spacing ( 1 ) ,
96
+ paddingBottom : theme . spacing ( 1 ) ,
94
97
borderRadius : 0 ,
95
98
borderBottomLeftRadius : theme . shape . borderRadius ,
96
99
borderBottomRightRadius : theme . shape . borderRadius ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export const TranslatableInputsTabs = (
28
28
onChange = { handleChange }
29
29
indicatorColor = "primary"
30
30
textColor = "primary"
31
+ className = { classes . tabs }
31
32
{ ...tabsProps }
32
33
>
33
34
{ locales . map ( locale => (
@@ -57,6 +58,9 @@ const useStyles = makeStyles(
57
58
borderTopRightRadius : theme . shape . borderRadius ,
58
59
border : `1px solid ${ theme . palette . divider } ` ,
59
60
} ,
61
+ tabs : {
62
+ minHeight : theme . spacing ( 3 ) ,
63
+ } ,
60
64
} ) ,
61
65
{ name : 'RaTranslatableInputsTabs' }
62
66
) ;
You can’t perform that action at this time.
0 commit comments