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 a5bc400
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion projects/klippa/ngx-enhancy-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
"version": "14.7.2",
"version": "14.7.3",
"publishConfig": {
"access": "public"
},
Expand Down
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 a5bc400

Please sign in to comment.