mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(button-toggle): remove 6.0.0 deletion targets (#10416)
Removes the deletion targets for 6.0.0 from the `material/button-toggle` entry point. BREAKING CHANGES: * `selected` is no longer an input and is now readonly.
This commit is contained in:
committed by
Andrew Seguin
parent
6405da9b8e
commit
f0bf6e7b28
@@ -154,27 +154,11 @@ export class MatButtonToggleGroup extends _MatButtonToggleGroupMixinBase impleme
|
||||
*/
|
||||
@Output() readonly valueChange = new EventEmitter<any>();
|
||||
|
||||
/**
|
||||
* Selected button toggles in the group.
|
||||
* @deprecated
|
||||
* @deletion-target 6.0.0
|
||||
*/
|
||||
@Input()
|
||||
/** Selected button toggles in the group. */
|
||||
get selected() {
|
||||
const selected = this._selectionModel.selected;
|
||||
return this.multiple ? selected : (selected[0] || null);
|
||||
}
|
||||
set selected(selected: MatButtonToggle | MatButtonToggle[] | null) {
|
||||
if (this._buttonToggles) {
|
||||
this._clearSelection();
|
||||
|
||||
if (Array.isArray(selected)) {
|
||||
selected.forEach(toggle => toggle.checked = true);
|
||||
} else if (selected) {
|
||||
selected.checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether multiple button toggles can be selected. */
|
||||
@Input()
|
||||
|
||||
Reference in New Issue
Block a user