Skip to content

Commit a6d25cd

Browse files
committed
v1.19.11
1 parent eebb630 commit a6d25cd

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

components/Abstract/SelectionBase.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export interface IPropsSelectionBase extends IPropsFieldBase {
1313
disabled?: boolean;
1414
checked: boolean;
1515
helperText?: React.ReactNode;
16-
FormControlLabelProps: Partial<FormControlLabelProps>;
16+
disableLabelMargin?: boolean;
17+
FormControlLabelProps?: Partial<FormControlLabelProps>;
1718
}
1819

1920
interface IProps extends IPropsSelectionBase {
@@ -28,12 +29,27 @@ interface IProps extends IPropsSelectionBase {
2829
labelAlign: {
2930
marginTop: 14
3031
},
32+
labelRight: {
33+
textAlign: 'right'
34+
},
3135
helperText: {
3236
opacity: 0.7,
3337
fontSize: '95%'
3438
}
3539
})
3640
export default class FieldSelectionBase extends FieldCoreBase<IProps> {
41+
get labelClassName(): string {
42+
const { helperText, disableLabelMargin, classes, FormControlLabelProps } = this.props;
43+
return (helperText && !disableLabelMargin ? classes.labelAlign : '') +
44+
(FormControlLabelProps && FormControlLabelProps.labelPlacement === 'start' ? classes.labelRight : '');
45+
}
46+
47+
get helperTextClassName(): string {
48+
const { FormControlLabelProps, classes } = this.props;
49+
return classes.helperText +
50+
(FormControlLabelProps && FormControlLabelProps.labelPlacement === 'start' ? classes.labelRight : '');
51+
}
52+
3753
onChange = (event: React.ChangeEvent<any>) => {
3854
let value = this.props.value;
3955

@@ -82,9 +98,9 @@ export default class FieldSelectionBase extends FieldCoreBase<IProps> {
8298
<React.Fragment>
8399
{!!label &&
84100
<React.Fragment>
85-
<Typography className={helperText ? classes.labelAlign : null}>{label}</Typography>
101+
<Typography className={this.labelClassName}>{label}</Typography>
86102
{!!helperText &&
87-
<Typography className={classes.helperText}>
103+
<Typography className={this.helperTextClassName}>
88104
{helperText}
89105
</Typography>
90106
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"validation",
1111
"material"
1212
],
13-
"version": "1.19.9",
13+
"version": "1.19.11",
1414
"main": "./dist/index.js",
1515
"types": "./dist/index.d.ts",
1616
"license": "MIT",

0 commit comments

Comments
 (0)