diff --git a/src/lib/buttons/icon-button/icon-button.component.html b/src/lib/buttons/icon-button/icon-button.component.html index d3a892e..9510afe 100644 --- a/src/lib/buttons/icon-button/icon-button.component.html +++ b/src/lib/buttons/icon-button/icon-button.component.html @@ -1,15 +1,10 @@ + - +
{{ config.discardChangesText }} diff --git a/src/lib/dialog/confirmation-dialog/confirmation-dialog.component.ts b/src/lib/dialog/confirmation-dialog/confirmation-dialog.component.ts index a11d49c..9692d85 100644 --- a/src/lib/dialog/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/lib/dialog/confirmation-dialog/confirmation-dialog.component.ts @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component, HostListener, Inject, TemplateRef } import { MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; import { TranslateService } from '@ngx-translate/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { IconButtonTypes } from '../../buttons'; export type TitleColor = 'default' | 'warn'; @@ -85,6 +86,7 @@ export class ConfirmationDialogComponent { showToast = false; readonly inputLabel: string; readonly ConfirmOptions = ConfirmOptions; + readonly iconButtonTypes = IconButtonTypes; constructor( private readonly _dialogRef: MatDialogRef, @@ -104,6 +106,13 @@ export class ConfirmationDialogComponent { return this.config?.titleColor === TitleColors.WARN; } + get confirmOption(): ConfirmOptions { + if (!this.config.checkboxesValidation && this.config.checkboxes[0]?.value) { + return ConfirmOptions.SECOND_CONFIRM; + } + return ConfirmOptions.CONFIRM; + } + @HostListener('window:keyup.enter') onKeyupEnter(): void { if (this.config.requireInput && !this.confirmationDoesNotMatch()) { @@ -146,11 +155,4 @@ export class ConfirmationDialogComponent { }); }); } - - get confirmOption(): ConfirmOptions { - if (!this.config.checkboxesValidation && this.config.checkboxes[0]?.value) { - return ConfirmOptions.SECOND_CONFIRM; - } - return ConfirmOptions.CONFIRM; - } } diff --git a/src/lib/form/base-form.component.ts b/src/lib/form/base-form.component.ts index c1baa60..267d7b6 100644 --- a/src/lib/form/base-form.component.ts +++ b/src/lib/form/base-form.component.ts @@ -1,9 +1,11 @@ import { Directive } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { hasFormChanged } from '../utils'; +import { IconButtonTypes } from '../buttons'; @Directive() export abstract class BaseFormComponent { + readonly iconButtonTypes = IconButtonTypes; form!: UntypedFormGroup; initialFormValue!: Record;