Skip to content

Commit 1a64860

Browse files
authored
Merge pull request #2702 from kush-savani/support-disable-table-radio
feat(data-table): support disabled table radio selection
2 parents 8ccf0aa + c3f6d90 commit 1a64860

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/table/cell/table-radio.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from "@angular/core";
77
import { I18n } from "carbon-components-angular/i18n";
88
import { TableItem } from "../table-item.class";
9+
import { TableRow } from "../table-row.class";
910
import { Observable } from "rxjs";
1011

1112
@Component({
@@ -17,6 +18,7 @@ import { Observable } from "rxjs";
1718
[attr.aria-label]="getLabel() | i18nReplace:getSelectionLabelValue(row) | async"
1819
[ariaLabel]="getLabel() | i18nReplace:getSelectionLabelValue(row) | async"
1920
[checked]="selected"
21+
[disabled]="disabled"
2022
(change)="change.emit()">
2123
</cds-radio>
2224
`
@@ -35,6 +37,10 @@ export class TableRadio {
3537
return this._label.value;
3638
}
3739

40+
get disabled(): boolean {
41+
return this.row ? !!(this.row as TableRow).disabled : false;
42+
}
43+
3844
/**
3945
* Used to populate the row selection checkbox label with a useful value if set.
4046
*

0 commit comments

Comments
 (0)