Skip to content

Commit 69ce706

Browse files
palbizuPatricio Albizu
andauthored
feat: adding options alignment in Radio Group (#918)
* feat: adding options alignment in Radio Group * feat: changing radio group default Co-authored-by: Patricio Albizu <patricioalbizu@Patricios-MacBook-Pro.local>
1 parent dfd14c1 commit 69ce706

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
}
99

1010
.radio-group {
11+
display: flex;
12+
13+
&.row {
14+
flex-direction: row;
15+
}
16+
17+
&.column {
18+
flex-direction: column;
19+
}
20+
1121
::ng-deep .radio-button {
1222
line-height: 18px;
1323
padding-right: 10px;

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { RadioOption } from './radio-option';
1111
<ht-label class="title" [label]="this.title"></ht-label>
1212
<mat-radio-group
1313
class="radio-group"
14+
[ngClass]="this.optionsDirection"
1415
[ngModel]="this.selected!.value"
1516
(change)="this.onRadioChange($event)"
1617
[disabled]="this.disabled"
@@ -39,6 +40,9 @@ export class RadioGroupComponent implements OnInit {
3940
@Input()
4041
public disabled: boolean | undefined;
4142

43+
@Input()
44+
public optionsDirection: OptionsDirection = OptionsDirection.Column;
45+
4246
@Output()
4347
public readonly selectedChange: EventEmitter<string> = new EventEmitter();
4448

@@ -63,3 +67,8 @@ export class RadioGroupComponent implements OnInit {
6367
this.selectedChange.emit(event.value);
6468
}
6569
}
70+
71+
export const enum OptionsDirection {
72+
Row = 'row',
73+
Column = 'column'
74+
}

0 commit comments

Comments
 (0)