Skip to content

Commit 9f8eec1

Browse files
crisbetommalerba
authored andcommitted
refactor(checkbox): remove 6.0.0 deletion targets (#10342)
Removes the 6.0.0 deletion targets from the `material/checkbox` entry point. BREAKING CHANGES: * `align` which was deprecated in 5.0.0 has been removed. Use `labelPosition` instead. Note that the values are different.
1 parent aa2356d commit 9f8eec1

File tree

5 files changed

+20
-35
lines changed

5 files changed

+20
-35
lines changed

src/demo-app/checkbox/checkbox-demo.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>mat-checkbox: Basic Example</h1>
77
(change)="isIndeterminate = false"
88
[indeterminate]="isIndeterminate"
99
[disabled]="isDisabled"
10-
[align]="alignment">
10+
[labelPosition]="labelPosition">
1111
Do you want to <em>foobar</em> the <em>bazquux</em>?
1212

1313
</mat-checkbox> - <strong>{{printResult()}}</strong>
@@ -24,23 +24,23 @@ <h1>mat-checkbox: Basic Example</h1>
2424
<label for="color-toggle">Toggle Color</label>
2525
</div>
2626
<div>
27-
<p>Alignment:</p>
27+
<p>Label position:</p>
2828
<div>
29-
<input #start type="radio"
30-
value="start"
31-
id="align-start"
32-
name="alignment"
33-
(click)="alignment = start.value"
29+
<input #after type="radio"
30+
value="after"
31+
id="align-after"
32+
name="labelPosition"
33+
(click)="labelPosition = after.value"
3434
checked>
35-
<label for="align-start">Start</label>
35+
<label for="align-after">After</label>
3636
</div>
3737
<div>
38-
<input #end type="radio"
39-
value="end"
40-
id="align-end"
41-
name="alignment"
42-
(click)="alignment = end.value">
43-
<label for="align-end">End</label>
38+
<input #before type="radio"
39+
value="before"
40+
id="align-before"
41+
name="labelPosition"
42+
(click)="labelPosition = before.value">
43+
<label for="align-before">Before</label>
4444
</div>
4545
</div>
4646

src/demo-app/checkbox/checkbox-demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class CheckboxDemo {
7979
isIndeterminate: boolean = false;
8080
isChecked: boolean = false;
8181
isDisabled: boolean = false;
82-
alignment: string = 'start';
82+
labelPosition: string = 'after';
8383
useAlternativeColor: boolean = false;
8484

8585
printResult() {

src/lib/checkbox/checkbox.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,6 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
142142
set required(value: boolean) { this._required = coerceBooleanProperty(value); }
143143
private _required: boolean;
144144

145-
/**
146-
* Whether or not the checkbox should appear before or after the label.
147-
* @deprecated
148-
* @deletion-target 6.0.0
149-
*/
150-
@Input()
151-
get align(): 'start' | 'end' {
152-
// align refers to the checkbox relative to the label, while labelPosition refers to the
153-
// label relative to the checkbox. As such, they are inverted.
154-
return this.labelPosition == 'after' ? 'start' : 'end';
155-
}
156-
set align(value: 'start' | 'end') {
157-
this.labelPosition = (value == 'start') ? 'after' : 'before';
158-
}
159-
160145
/** Whether the label should appear after or before the checkbox. Defaults to 'after' */
161146
@Input() labelPosition: 'before' | 'after' = 'after';
162147

src/material-examples/checkbox-configurable/checkbox-configurable-example.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ <h2 class="example-h2">Checkbox configuration</h2>
99

1010
<section class="example-section">
1111
<label class="example-margin">Align:</label>
12-
<mat-radio-group [(ngModel)]="align">
13-
<mat-radio-button class="example-margin" value="start">Start</mat-radio-button>
14-
<mat-radio-button class="example-margin" value="end">End</mat-radio-button>
12+
<mat-radio-group [(ngModel)]="labelPosition">
13+
<mat-radio-button class="example-margin" value="after">After</mat-radio-button>
14+
<mat-radio-button class="example-margin" value="before">Before</mat-radio-button>
1515
</mat-radio-group>
1616
</section>
1717

@@ -30,7 +30,7 @@ <h2 class="example-h2">Result</h2>
3030
class="example-margin"
3131
[(ngModel)]="checked"
3232
[(indeterminate)]="indeterminate"
33-
[align]="align"
33+
[labelPosition]="labelPosition"
3434
[disabled]="disabled">
3535
I'm a checkbox
3636
</mat-checkbox>

src/material-examples/checkbox-configurable/checkbox-configurable-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import {Component} from '@angular/core';
1111
export class CheckboxConfigurableExample {
1212
checked = false;
1313
indeterminate = false;
14-
align = 'start';
14+
labelPosition = 'after';
1515
disabled = false;
1616
}

0 commit comments

Comments
 (0)