@sumaris-net/ngx-components 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "1.7.2",
4
+ "version": "1.7.3",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -5,6 +5,7 @@ import { Entity } from '../services/model/entity.model';
5
5
  import { UsageMode } from '../services/model/settings.model';
6
6
  import { FormGroup } from '@angular/forms';
7
7
  import { AppTabEditor, AppTabEditorOptions } from './editor.class';
8
+ import { FormErrors } from './form.utils';
8
9
  import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/entity-service.class';
9
10
  import { DateFormatPipe } from '../../shared/pipes/date-format.pipe';
10
11
  import { HistoryPageReference } from '../services/model/history.model';
@@ -25,6 +26,15 @@ export declare class AppEditorOptions extends AppTabEditorOptions {
25
26
  autoOpenNextTab?: boolean;
26
27
  i18nPrefix?: string;
27
28
  }
29
+ export interface AppError {
30
+ code?: number;
31
+ message?: string;
32
+ }
33
+ export interface AppErrorWithDetails extends AppError {
34
+ details?: AppError & {
35
+ errors?: FormErrors;
36
+ };
37
+ }
28
38
  export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends IEntityService<T, ID> = IEntityService<T, any>, ID = number> extends AppTabEditor<T, ID, EntityServiceLoadOptions> implements OnInit, OnDestroy, AfterViewInit {
29
39
  protected dataType: new () => T;
30
40
  protected dataService?: S;
@@ -122,7 +132,13 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
122
132
  delete(event?: UIEvent): Promise<boolean>;
123
133
  reload(): Promise<void>;
124
134
  goBack(event?: Event): Promise<void | boolean>;
125
- setError(err: any): void;
135
+ resetError(opts?: {
136
+ emitEvent?: boolean;
137
+ }): void;
138
+ setError(err: string | AppErrorWithDetails, opts?: {
139
+ emitEvent?: boolean;
140
+ detailsCssClass?: string;
141
+ }): void;
126
142
  protected abstract registerForms(): any;
127
143
  protected abstract computeTitle(data: T): Promise<string>;
128
144
  protected abstract setValue(data: T): Promise<void> | void;