diff --git a/projects/klippa/ngx-enhancy-forms/package.json b/projects/klippa/ngx-enhancy-forms/package.json index 705cfd9..2b64497 100644 --- a/projects/klippa/ngx-enhancy-forms/package.json +++ b/projects/klippa/ngx-enhancy-forms/package.json @@ -1,6 +1,6 @@ { "name": "@klippa/ngx-enhancy-forms", - "version": "14.7.1", + "version": "14.7.2", "publishConfig": { "access": "public" }, diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/button/button.component.ts b/projects/klippa/ngx-enhancy-forms/src/lib/elements/button/button.component.ts index cfa4e1f..7885c56 100644 --- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/button/button.component.ts +++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/button/button.component.ts @@ -1,21 +1,22 @@ import { Component, HostBinding, Input } from '@angular/core'; import {isValueSet} from "../../util/values"; -@Component({ - selector: 'klp-form-button', - templateUrl: './button.component.html', - styleUrls: ['./button.component.scss'], -}) -export class ButtonComponent { - @Input() variant: - | 'white' +export type ButtonVariant = 'white' | 'greenFilled' | 'greenOutlined' | 'greenLink' | 'contextMenuItem' | 'redFilled' | 'redOutlined' - | 'orangeFilled' = 'white'; + | 'orangeFilled'; + +@Component({ + selector: 'klp-form-button', + templateUrl: './button.component.html', + styleUrls: ['./button.component.scss'], +}) +export class ButtonComponent { + @Input() variant: ButtonVariant = 'white'; @Input() size: 'small' | 'medium' | 'large' = 'medium'; @Input() fullWidth = false; @Input() hasBorder = true; diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/form/form-submit-button/form-submit-button.component.ts b/projects/klippa/ngx-enhancy-forms/src/lib/form/form-submit-button/form-submit-button.component.ts index 267dca1..d88414a 100644 --- a/projects/klippa/ngx-enhancy-forms/src/lib/form/form-submit-button/form-submit-button.component.ts +++ b/projects/klippa/ngx-enhancy-forms/src/lib/form/form-submit-button/form-submit-button.component.ts @@ -1,6 +1,14 @@ import { Component, Host, HostBinding, Input, Optional } from '@angular/core'; import {FormComponent, invalidFieldsSymbol} from '../form.component'; import {isNullOrUndefined} from '../../util/values'; +import { ButtonVariant } from '../../elements/button/button.component'; + +export type SubmitButtonVariant = Extract; @Component({ selector: 'klp-form-submit-button', @@ -10,7 +18,7 @@ import {isNullOrUndefined} from '../../util/values'; export class FormSubmitButtonComponent { @Input() public isLoading = false; @Input() fullWidth = false; - @Input() variant: 'greenFilled' | 'redFilled' | 'greenOutlined' = 'greenFilled'; + @Input() variant: SubmitButtonVariant = 'greenFilled'; @Input() public before: () => Promise = () => Promise.resolve(); @Input() public after: () => Promise = () => Promise.resolve(); @Input() public submitCallback: (renderedAndEnabledValues: object, renderedButDisabledValues: object) => Promise;