From 9ee7b12e4a51c7d1ee8923dc87e359b12e5be118 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 14 Jun 2022 19:08:13 +0300 Subject: [PATCH] update to angular 14 --- src/lib/dialog/base-dialog.component.ts | 4 ++-- src/lib/form/base-form.component.ts | 4 ++-- src/lib/utils/functions.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/dialog/base-dialog.component.ts b/src/lib/dialog/base-dialog.component.ts index 35400f3..2d02f1d 100644 --- a/src/lib/dialog/base-dialog.component.ts +++ b/src/lib/dialog/base-dialog.component.ts @@ -1,6 +1,6 @@ import { Directive, HostListener, Injector, OnInit } from '@angular/core'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { AutoUnsubscribe, hasFormChanged, IqserEventTarget } from '../utils'; import { ConfirmOptions } from '../misc'; import { ConfirmationDialogService } from './confirmation-dialog.service'; @@ -25,7 +25,7 @@ export interface SaveOptions { * (otherwise the save request will be triggered twice). * */ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnInit { - form!: FormGroup; + form!: UntypedFormGroup; initialFormValue!: Record; private readonly _confirmationDialogService: ConfirmationDialogService = this._injector.get(ConfirmationDialogService); private readonly _dialog: MatDialog = this._injector.get(MatDialog); diff --git a/src/lib/form/base-form.component.ts b/src/lib/form/base-form.component.ts index ad9b033..ab961b9 100644 --- a/src/lib/form/base-form.component.ts +++ b/src/lib/form/base-form.component.ts @@ -1,10 +1,10 @@ import { Directive } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { AutoUnsubscribe, hasFormChanged } from '../utils'; @Directive() export abstract class BaseFormComponent extends AutoUnsubscribe { - form!: FormGroup; + form!: UntypedFormGroup; initialFormValue!: Record; get changed(): boolean { diff --git a/src/lib/utils/functions.ts b/src/lib/utils/functions.ts index 1f24cd8..48ab2a5 100644 --- a/src/lib/utils/functions.ts +++ b/src/lib/utils/functions.ts @@ -1,5 +1,5 @@ import { ITrackable } from '../listing/models/trackable'; -import { FormGroup } from '@angular/forms'; +import { UntypedFormGroup } from '@angular/forms'; import { forOwn, has, isEqual, isPlainObject, transform } from 'lodash-es'; import dayjs, { Dayjs } from 'dayjs'; @@ -35,7 +35,7 @@ export function trackByFactory() { return (index: number, item: T): string => item.id; } -export function hasFormChanged(form: FormGroup, initialFormValue: Record): boolean { +export function hasFormChanged(form: UntypedFormGroup, initialFormValue: Record): boolean { if (form && initialFormValue) { for (const key of Object.keys(form.getRawValue())) { const initialValue = initialFormValue[key];