From aa6c77b606b4104dc063f30983a4bc520193fb19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=89=B2?= Date: Tue, 12 Jul 2022 22:18:44 +0800 Subject: [PATCH] fix: fix 'null' is not assignable to type 'NzFormControlStatusType' (#1502) --- package.json | 2 +- packages/form/src/model/form.property.ts | 5 +++-- packages/form/src/sf.component.ts | 2 +- packages/form/src/widgets/mention/mention.widget.spec.ts | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f77fd8f22..7dc7548cd 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "extend": "^3.0.2", "file-saver": "^2.0.5", "ng-github-button": "^13.0.0", - "ng-zorro-antd": "^13.1.1", + "ng-zorro-antd": "^13.3.2", "ngx-color": "~7.3.3", "ngx-countdown": "^13.0.0", "ngx-highlight-js": "^13.0.0", diff --git a/packages/form/src/model/form.property.ts b/packages/form/src/model/form.property.ts index 3e673c9ff..2b4e47b97 100644 --- a/packages/form/src/model/form.property.ts +++ b/packages/form/src/model/form.property.ts @@ -373,16 +373,17 @@ export abstract class FormProperty { // #endregion - updateFeedback(status: NzFormControlStatusType = null, icon?: string | null): void { + updateFeedback(status: NzFormControlStatusType = '', icon?: string | null): void { this.ui.feedback = status; this.ui.feedbackIcon = icon || { + '': '', error: 'close-circle-fill', validating: 'loading', success: 'check-circle-fill', warning: 'exclamation-circle-fill' - }[status!]; + }[status]; this.widget.detectChanges(); } } diff --git a/packages/form/src/sf.component.ts b/packages/form/src/sf.component.ts index 61c3ffa01..8d70c85fe 100644 --- a/packages/form/src/sf.component.ts +++ b/packages/form/src/sf.component.ts @@ -236,7 +236,7 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy { * this.sf.updateFeedback('/name'); * ``` */ - updateFeedback(path: string, status: NzFormControlStatusType = null, icon?: string | null): this { + updateFeedback(path: string, status: NzFormControlStatusType = '', icon?: string | null): this { this.getProperty(path)?.updateFeedback(status, icon); return this; } diff --git a/packages/form/src/widgets/mention/mention.widget.spec.ts b/packages/form/src/widgets/mention/mention.widget.spec.ts index 3efb92125..5966272b7 100644 --- a/packages/form/src/widgets/mention/mention.widget.spec.ts +++ b/packages/form/src/widgets/mention/mention.widget.spec.ts @@ -39,8 +39,8 @@ describe('form: widget: mention', () => { page .newSchema(s) .typeChar('@') - .checkCount('.ant-mention-dropdown-item', DATA.length, true) - .typeEvent('click', '.ant-mention-dropdown-item'); + .checkCount('.ant-mentions-dropdown-menu-item', DATA.length, true) + .typeEvent('click', '.ant-mentions-dropdown-menu-item'); expect((s.properties!.a.ui as NzSafeAny).select).toHaveBeenCalled(); })); @@ -69,6 +69,6 @@ describe('form: widget: mention', () => { } } }; - page.newSchema(s).dc(1).typeChar('@').checkElText('.ant-mention-dropdown-item', '1', true); + page.newSchema(s).dc(1).typeChar('@').checkElText('.ant-mentions-dropdown-menu-item', '1', true); })); });