Skip to content

Commit 3f8523c

Browse files
crisbetojelbourn
authored andcommitted
refactor(radio): remove 6.0.0 deletion targets (#10218)
Removes the deletion targets for 6.0.0 in the `material/radio` entry point. BREAKING CHANGES: * `align` input in `MatRadioGroup` which was deprecated in 5.0.0 has been removed. Use `labelPosition` instead. * `align` input in `MatRadioButton` which was deprecated in 5.0.0 has been removed. Use `labelPosition` instead.
1 parent 5c5f3b6 commit 3f8523c

File tree

2 files changed

+3
-35
lines changed

2 files changed

+3
-35
lines changed

src/demo-app/radio/radio-demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h1>Dynamic Example</h1>
3434
name="my_options"
3535
[disabled]="isDisabled"
3636
[required]="isRequired"
37-
[align]="isAlignEnd ? 'end' : 'start'">
37+
[labelPosition]="isAlignEnd ? 'end' : 'start'">
3838
<mat-radio-button value="option_1">Option 1</mat-radio-button>
3939
<mat-radio-button value="option_2">Option 2</mat-radio-button>
4040
<mat-radio-button value="option_3">Option 3</mat-radio-button>

src/lib/radio/radio.ts

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -141,29 +141,13 @@ export class MatRadioGroup extends _MatRadioGroupMixinBase
141141
this._updateRadioButtonNames();
142142
}
143143

144-
/**
145-
* Alignment of the radio-buttons relative to their labels. Can be 'before' or 'after'.
146-
* @deprecated
147-
* @deletion-target 6.0.0
148-
*/
149-
@Input()
150-
get align(): 'start' | 'end' {
151-
// align refers to the checkbox relative to the label, while labelPosition refers to the
152-
// label relative to the checkbox. As such, they are inverted.
153-
return this.labelPosition == 'after' ? 'start' : 'end';
154-
}
155-
set align(v) {
156-
this.labelPosition = (v == 'start') ? 'after' : 'before';
157-
}
158-
159-
160144
/** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
161145
@Input()
162146
get labelPosition(): 'before' | 'after' {
163147
return this._labelPosition;
164148
}
165149
set labelPosition(v) {
166-
this._labelPosition = (v == 'before') ? 'before' : 'after';
150+
this._labelPosition = v === 'before' ? 'before' : 'after';
167151
this._markRadiosForCheck();
168152
}
169153

@@ -412,23 +396,6 @@ export class MatRadioButton extends _MatRadioButtonMixinBase
412396
}
413397
}
414398

415-
/**
416-
* Whether or not the radio-button should appear before or after the label.
417-
* @deprecated
418-
* @deletion-target 6.0.0
419-
*/
420-
@Input()
421-
get align(): 'start' | 'end' {
422-
// align refers to the checkbox relative to the label, while labelPosition refers to the
423-
// label relative to the checkbox. As such, they are inverted.
424-
return this.labelPosition == 'after' ? 'start' : 'end';
425-
}
426-
set align(v) {
427-
this.labelPosition = (v == 'start') ? 'after' : 'before';
428-
}
429-
430-
private _labelPosition: 'before' | 'after';
431-
432399
/** Whether the label should appear after or before the radio button. Defaults to 'after' */
433400
@Input()
434401
get labelPosition(): 'before' | 'after' {
@@ -437,6 +404,7 @@ export class MatRadioButton extends _MatRadioButtonMixinBase
437404
set labelPosition(value) {
438405
this._labelPosition = value;
439406
}
407+
private _labelPosition: 'before' | 'after';
440408

441409
/** Whether the radio button is disabled. */
442410
@Input()

0 commit comments

Comments
 (0)