Skip to content

Commit a5bc400

Browse files
author
Oliver Strik
committed
fix: replace Orientation input enum with a string set type
1 parent 1419be9 commit a5bc400

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

projects/klippa/ngx-enhancy-forms/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@klippa/ngx-enhancy-forms",
3-
"version": "14.7.2",
3+
"version": "14.7.3",
44
"publishConfig": {
55
"access": "public"
66
},

projects/klippa/ngx-enhancy-forms/src/lib/elements/radio/radio.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="componentContainer" [ngClass]="{'verticallyOriented': orientation === Orientation.COLUMN, 'horizontallyOriented': orientation === Orientation.ROW}">
1+
<div class="componentContainer" [ngClass]="{'verticallyOriented': orientation === 'column', 'horizontallyOriented': orientation === 'row'}">
22
<ng-container *ngFor="let option of options">
33
<button class="optionContainer"
44
[ngClass]="{classic: variant === 'classic', button: variant === 'button', isSelected: innerValue === option.id}"

projects/klippa/ngx-enhancy-forms/src/lib/elements/radio/radio.component.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import { Component, Input} from '@angular/core';
22
import { NG_VALUE_ACCESSOR } from '@angular/forms';
33
import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
44

5-
export enum Orientation {
6-
COLUMN = 'column',
7-
ROW = 'row'
8-
}
5+
export type RadioVariant = 'classic' | 'button';
6+
export type RadioOrientation = 'column' | 'row';
97
export type RadioOptions = Array<RadioOption>;
108
export type RadioOption = {
119
id: any;
@@ -21,8 +19,7 @@ export type RadioOption = {
2119
})
2220
export class RadioComponent extends ValueAccessorBase<string>{
2321
@Input() options: RadioOptions;
24-
@Input() orientation: Orientation = Orientation.ROW;
25-
@Input() variant: 'classic' | 'button' = 'classic';
26-
public Orientation = Orientation;
22+
@Input() orientation: RadioOrientation = 'row';
23+
@Input() variant: RadioVariant = 'classic';
2724
}
2825

0 commit comments

Comments
 (0)