From 0130933bc06846caf6ddcdcc6d3ff4e9fde05c81 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 11 Oct 2022 12:32:48 +0200 Subject: [PATCH] feat: update ngx formly --- package-lock.json | 72 ++++++------------- package.json | 4 +- .../config/icon-input/icon-input.component.ts | 5 +- .../keyboard-input.component.ts | 3 +- .../select-project.component.ts | 3 +- .../task-repeat-cfg-form.const.ts | 2 +- .../input-duration-formly.component.ts | 3 +- 7 files changed, 33 insertions(+), 59 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a2391e3f6..fc996812ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,8 +50,8 @@ "@ngrx/schematics": "^14.0.2", "@ngrx/store": "14.0.2", "@ngrx/store-devtools": "^14.0.2", - "@ngx-formly/core": "5.12.0", - "@ngx-formly/material": "5.12.0", + "@ngx-formly/core": "6.0.1", + "@ngx-formly/material": "6.0.1", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", "@schematics/angular": "^14.1.3", @@ -4352,43 +4352,31 @@ } }, "node_modules/@ngx-formly/core": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-5.12.0.tgz", - "integrity": "sha512-1YQIu69w3dU4KlrKj6gOgY5ekiut3erZyJ8lMpPNYl1/I1fd3mkEMOjBKqeDdm29buScuD/YcxSQiePDpseKzA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-6.0.1.tgz", + "integrity": "sha512-TkVg7m2SZEIHoL5kIJgH7TYqwT6G6mz1ZKIgvT3W3eBUr70u1HZ1RiDHjXeqMC3sse7saSDFsFOI6P7ybHJ1Zw==", "dev": true, "dependencies": { - "tslib": "^1.7.1" + "tslib": "^2.0.0" }, "peerDependencies": { - "@angular/forms": ">=7.0.0", - "rxjs": ">=6.3.0" + "@angular/forms": ">=13.2.0", + "rxjs": "^6.5.3 || ^7.0.0" } }, - "node_modules/@ngx-formly/core/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/@ngx-formly/material": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ngx-formly/material/-/material-5.12.0.tgz", - "integrity": "sha512-km37Q+PLHYmEOv17AM35kichDwLgvQ5t+FgIWzWcyPhcEbzgRWOCAtXDt+htiLkMPD9kQDRpniF/zIlECsZfdA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@ngx-formly/material/-/material-6.0.1.tgz", + "integrity": "sha512-dyu6Scwn3D6g4Zg7bDS4yvxjkLakwIpy0sIE5TjvRa2ByTE0cTAkRaksFfdT6KW8dtti+N56IjFgQOzb+XZwMg==", "dev": true, "dependencies": { - "tslib": "^1.9.0" + "tslib": "^2.0.0" }, "peerDependencies": { - "@angular/material": ">=7.0.0", - "@ngx-formly/core": "5.12.0" + "@angular/material": ">=13.0.0", + "@ngx-formly/core": "6.0.1" } }, - "node_modules/@ngx-formly/material/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/@ngx-translate/core": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-14.0.0.tgz", @@ -30304,37 +30292,21 @@ "requires": {} }, "@ngx-formly/core": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-5.12.0.tgz", - "integrity": "sha512-1YQIu69w3dU4KlrKj6gOgY5ekiut3erZyJ8lMpPNYl1/I1fd3mkEMOjBKqeDdm29buScuD/YcxSQiePDpseKzA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-6.0.1.tgz", + "integrity": "sha512-TkVg7m2SZEIHoL5kIJgH7TYqwT6G6mz1ZKIgvT3W3eBUr70u1HZ1RiDHjXeqMC3sse7saSDFsFOI6P7ybHJ1Zw==", "dev": true, "requires": { - "tslib": "^1.7.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } + "tslib": "^2.0.0" } }, "@ngx-formly/material": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ngx-formly/material/-/material-5.12.0.tgz", - "integrity": "sha512-km37Q+PLHYmEOv17AM35kichDwLgvQ5t+FgIWzWcyPhcEbzgRWOCAtXDt+htiLkMPD9kQDRpniF/zIlECsZfdA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@ngx-formly/material/-/material-6.0.1.tgz", + "integrity": "sha512-dyu6Scwn3D6g4Zg7bDS4yvxjkLakwIpy0sIE5TjvRa2ByTE0cTAkRaksFfdT6KW8dtti+N56IjFgQOzb+XZwMg==", "dev": true, "requires": { - "tslib": "^1.9.0" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } + "tslib": "^2.0.0" } }, "@ngx-translate/core": { diff --git a/package.json b/package.json index ed58f2372a..91f32d02aa 100644 --- a/package.json +++ b/package.json @@ -144,8 +144,8 @@ "@ngrx/schematics": "^14.0.2", "@ngrx/store": "14.0.2", "@ngrx/store-devtools": "^14.0.2", - "@ngx-formly/core": "5.12.0", - "@ngx-formly/material": "5.12.0", + "@ngx-formly/core": "6.0.1", + "@ngx-formly/material": "6.0.1", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", "@schematics/angular": "^14.1.3", diff --git a/src/app/features/config/icon-input/icon-input.component.ts b/src/app/features/config/icon-input/icon-input.component.ts index 5c8df73441..aeb81048f9 100644 --- a/src/app/features/config/icon-input/icon-input.component.ts +++ b/src/app/features/config/icon-input/icon-input.component.ts @@ -3,6 +3,7 @@ import { FieldType } from '@ngx-formly/material'; import { MATERIAL_ICONS } from '../../../ui/material-icons.const'; import { Observable } from 'rxjs'; import { filter, map, startWith } from 'rxjs/operators'; +import { FormlyFieldConfig } from '@ngx-formly/core'; @Component({ selector: 'icon-input', @@ -10,7 +11,7 @@ import { filter, map, startWith } from 'rxjs/operators'; styleUrls: ['./icon-input.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class IconInputComponent extends FieldType implements OnInit { +export class IconInputComponent extends FieldType implements OnInit { // @ViewChild(MatInput) formFieldControl: MatInput; customIcons: string[] = MATERIAL_ICONS; @@ -21,8 +22,6 @@ export class IconInputComponent extends FieldType implements OnInit { } ngOnInit(): void { - super.ngOnInit(); - this.filteredIcons$ = this.formControl.valueChanges.pipe( startWith(''), filter((searchTerm) => !!searchTerm), diff --git a/src/app/features/config/keyboard-input/keyboard-input.component.ts b/src/app/features/config/keyboard-input/keyboard-input.component.ts index 55b397ef6c..b6775c8444 100644 --- a/src/app/features/config/keyboard-input/keyboard-input.component.ts +++ b/src/app/features/config/keyboard-input/keyboard-input.component.ts @@ -1,5 +1,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FieldType } from '@ngx-formly/material'; +import { FormlyFieldConfig } from '@ngx-formly/core'; @Component({ selector: 'keyboard-input', @@ -7,7 +8,7 @@ import { FieldType } from '@ngx-formly/material'; styleUrls: ['./keyboard-input.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class KeyboardInputComponent extends FieldType { +export class KeyboardInputComponent extends FieldType { // @ViewChild(MatInput, {static: true}) formFieldControl: MatInput; get type(): string { diff --git a/src/app/features/config/select-project/select-project.component.ts b/src/app/features/config/select-project/select-project.component.ts index 3863059c5f..0b5ea71137 100644 --- a/src/app/features/config/select-project/select-project.component.ts +++ b/src/app/features/config/select-project/select-project.component.ts @@ -3,6 +3,7 @@ import { FieldType } from '@ngx-formly/material'; import { ProjectService } from '../../project/project.service'; import { Project } from '../../project/project.model'; import { T } from 'src/app/t.const'; +import { FormlyFieldConfig } from '@ngx-formly/core'; @Component({ selector: 'select-project', @@ -10,7 +11,7 @@ import { T } from 'src/app/t.const'; styleUrls: ['./select-project.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class SelectProjectComponent extends FieldType { +export class SelectProjectComponent extends FieldType { T: typeof T = T; constructor(public projectService: ProjectService) { diff --git a/src/app/features/task-repeat-cfg/dialog-edit-task-repeat-cfg/task-repeat-cfg-form.const.ts b/src/app/features/task-repeat-cfg/dialog-edit-task-repeat-cfg/task-repeat-cfg-form.const.ts index fd32b8176f..1b4100443c 100644 --- a/src/app/features/task-repeat-cfg/dialog-edit-task-repeat-cfg/task-repeat-cfg-form.const.ts +++ b/src/app/features/task-repeat-cfg/dialog-edit-task-repeat-cfg/task-repeat-cfg-form.const.ts @@ -14,7 +14,7 @@ const updateParent = ( field.form?.patchValue({ // ...field.parent.model, ...changes, - }); + } as any); }; export const TASK_REPEAT_CFG_FORM_CFG_BEFORE_TAGS: FormlyFieldConfig[] = [ diff --git a/src/app/ui/duration/input-duration-formly/input-duration-formly.component.ts b/src/app/ui/duration/input-duration-formly/input-duration-formly.component.ts index b3e26669ed..99dd38d660 100644 --- a/src/app/ui/duration/input-duration-formly/input-duration-formly.component.ts +++ b/src/app/ui/duration/input-duration-formly/input-duration-formly.component.ts @@ -1,5 +1,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FieldType } from '@ngx-formly/material'; +import { FormlyFieldConfig } from '@ngx-formly/core'; @Component({ selector: 'input-duration-formly', @@ -7,6 +8,6 @@ import { FieldType } from '@ngx-formly/material'; styleUrls: ['./input-duration-formly.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class InputDurationFormlyComponent extends FieldType { +export class InputDurationFormlyComponent extends FieldType { // @ViewChild(MatInput, {static: true}) formFieldControl?: MatInput; }