diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a0400a1d..5f43e8c31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [14.1.0](https://github.com/ng-alain/delon/compare/14.0.0...14.0.1) (2022-10-09) +## [14.1.0](https://github.com/ng-alain/delon/compare/14.0.0...14.1.0) (2022-10-09) ### Bug Fixes diff --git a/packages/form/spec/form.spec.ts b/packages/form/spec/form.spec.ts index 1e25cce13..93daa8e5b 100644 --- a/packages/form/spec/form.spec.ts +++ b/packages/form/spec/form.spec.ts @@ -527,12 +527,8 @@ describe('form: component', () => { const namePath = '/name'; context.comp.updateFeedback(namePath, 'error'); page.dc().checkCount('.ant-form-item-has-error', 1).checkCount('.ant-form-item-has-feedback', 1); - context.comp.updateFeedback(namePath, 'success', 'left'); - page - .dc() - .checkCount('.ant-form-item-has-success', 1) - .checkCount('.ant-form-item-has-feedback', 1) - .checkCount('.anticon-left', 1); + context.comp.updateFeedback(namePath, 'success'); + page.dc().checkCount('.ant-form-item-has-success', 1).checkCount('.ant-form-item-has-feedback', 1); context.comp.updateFeedback(namePath); page.dc().checkCount('.ant-form-item-has-feedback', 0); diff --git a/packages/form/src/errors.ts b/packages/form/src/errors.ts index 24c4c4aa3..aed23f6d2 100644 --- a/packages/form/src/errors.ts +++ b/packages/form/src/errors.ts @@ -110,5 +110,8 @@ export interface ErrorSchema { */ feedback?: NzFormControlStatusType; + /** + * @deprecated Will be removed of NG-ZORRO don't support + */ feedbackIcon?: string | null; } diff --git a/packages/form/src/model/form.property.ts b/packages/form/src/model/form.property.ts index 3a68adf85..038a34227 100644 --- a/packages/form/src/model/form.property.ts +++ b/packages/form/src/model/form.property.ts @@ -1,6 +1,7 @@ import { BehaviorSubject, combineLatest, Observable, distinctUntilChanged, map } from 'rxjs'; import { AlainSFConfig } from '@delon/util/config'; +import { NzFormStatusService } from 'ng-zorro-antd/core/form'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; import type { NzFormControlStatusType } from 'ng-zorro-antd/form'; @@ -373,17 +374,9 @@ export abstract class FormProperty { // #endregion - updateFeedback(status: NzFormControlStatusType = '', icon?: string | null): void { + updateFeedback(status: NzFormControlStatusType = ''): void { this.ui.feedback = status; - this.ui.feedbackIcon = - icon || - { - '': '', - error: 'close-circle-fill', - validating: 'loading', - success: 'check-circle-fill', - warning: 'exclamation-circle-fill' - }[status]; + this.widget.injector.get(NzFormStatusService).formStatusChanges.next({ status, hasFeedback: !!status }); this.widget.detectChanges(); } } diff --git a/packages/form/src/sf-item-wrap.component.html b/packages/form/src/sf-item-wrap.component.html index 81f8a9478..b067b448b 100644 --- a/packages/form/src/sf-item-wrap.component.html +++ b/packages/form/src/sf-item-wrap.component.html @@ -35,9 +35,6 @@