Skip to content

Commit 688d0fd

Browse files
palbizuPatricio Albizu
andauthored
feat: Adding option disabled (#1504)
Co-authored-by: Patricio Albizu <[email protected]>
1 parent 35b3801 commit 688d0fd

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

projects/components/src/radio/radio-group.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@
8080
}
8181

8282
.mat-radio-container .mat-radio-outer-circle {
83+
cursor: not-allowed;
8384
background: $gray-1;
8485
}
8586

8687
.radio-button-label {
88+
cursor: not-allowed;
8789
color: $gray-5;
8890
}
8991
}

projects/components/src/radio/radio-group.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ import { RadioOption } from './radio-option';
2727
<mat-radio-button
2828
class="radio-button"
2929
*ngFor="let option of options"
30-
[ngClass]="[this.optionsDirection, this.disabled ? 'disabled' : '']"
30+
[ngClass]="[this.optionsDirection, this.disabled || option.disabled ? 'disabled' : '']"
3131
[value]="option.value"
32+
[disabled]="option.disabled"
3233
>
3334
<ng-container
3435
*ngTemplateOutlet="

projects/components/src/radio/radio-option.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export interface RadioOption {
44
value: string;
55
label: string | TemplateRef<unknown>;
66
description?: string;
7+
disabled?: boolean;
78
}

0 commit comments

Comments
 (0)