Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions projects/components/src/radio/radio-group.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
}

.radio-group {
display: flex;

&.row {
flex-direction: row;
}

&.column {
flex-direction: column;
}

::ng-deep .radio-button {
line-height: 18px;
padding-right: 10px;
Expand Down
9 changes: 9 additions & 0 deletions projects/components/src/radio/radio-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { RadioOption } from './radio-option';
<ht-label class="title" [label]="this.title"></ht-label>
<mat-radio-group
class="radio-group"
[ngClass]="this.optionsDirection"
[ngModel]="this.selected!.value"
(change)="this.onRadioChange($event)"
[disabled]="this.disabled"
Expand Down Expand Up @@ -39,6 +40,9 @@ export class RadioGroupComponent implements OnInit {
@Input()
public disabled: boolean | undefined;

@Input()
public optionsDirection: OptionsDirection = OptionsDirection.Column;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an input within the radiogroup component. so it can use a simpler name. perhaps just orientation or direction?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a bad update to make (I'd opt for orientation, and update the enum too to something like RadioGroupOrientation), worth doing before this gets consumed anywhere.


@Output()
public readonly selectedChange: EventEmitter<string> = new EventEmitter();

Expand All @@ -63,3 +67,8 @@ export class RadioGroupComponent implements OnInit {
this.selectedChange.emit(event.value);
}
}

export const enum OptionsDirection {
Row = 'row',
Column = 'column'
}