Skip to content

Commit

Permalink
fix: replace Orientation input enum with a string set type
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Strik committed Aug 16, 2023
1 parent 1419be9 commit 101bdb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="componentContainer" [ngClass]="{'verticallyOriented': orientation === Orientation.COLUMN, 'horizontallyOriented': orientation === Orientation.ROW}">
<div class="componentContainer" [ngClass]="{'verticallyOriented': orientation === 'column', 'horizontallyOriented': orientation === 'row'}">
<ng-container *ngFor="let option of options">
<button class="optionContainer"
[ngClass]="{classic: variant === 'classic', button: variant === 'button', isSelected: innerValue === option.id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { Component, Input} from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';

export enum Orientation {
COLUMN = 'column',
ROW = 'row'
}
export type RadioVariant = 'classic' | 'button';
export type RadioOrientation = 'column' | 'row';
export type RadioOptions = Array<RadioOption>;
export type RadioOption = {
id: any;
Expand All @@ -21,8 +19,7 @@ export type RadioOption = {
})
export class RadioComponent extends ValueAccessorBase<string>{
@Input() options: RadioOptions;
@Input() orientation: Orientation = Orientation.ROW;
@Input() variant: 'classic' | 'button' = 'classic';
public Orientation = Orientation;
@Input() orientation: RadioOrientation = 'row';
@Input() variant: RadioVariant = 'classic';
}

0 comments on commit 101bdb2

Please sign in to comment.