@sumaris-net/ngx-components 0.14.0 → 0.15.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": "0.14.0",
4
+ "version": "0.15.3",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -38,6 +38,7 @@ export declare abstract class AppTabEditor<T = any, ID = number, O = any> implem
38
38
  private _subscription;
39
39
  protected _enabled: boolean;
40
40
  protected _dirty: boolean;
41
+ protected _loading: boolean;
41
42
  tabCount: number;
42
43
  enableSwipe: boolean;
43
44
  tabGroupAnimationDuration: string;
@@ -46,7 +47,6 @@ export declare abstract class AppTabEditor<T = any, ID = number, O = any> implem
46
47
  selectedTabIndex: number;
47
48
  submitted: boolean;
48
49
  error: string;
49
- loading: boolean;
50
50
  queryParams: Params;
51
51
  i18nContext: {
52
52
  prefix: string;
@@ -66,6 +66,7 @@ export declare abstract class AppTabEditor<T = any, ID = number, O = any> implem
66
66
  get valid(): boolean;
67
67
  get invalid(): boolean;
68
68
  get pending(): boolean;
69
+ get loading(): boolean;
69
70
  get enabled(): boolean;
70
71
  get disabled(): boolean;
71
72
  get children(): IAppForm[];
@@ -126,7 +126,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
126
126
  protected onEntitySaved(data: T): Promise<void>;
127
127
  protected onEntityDeleted(data: T): Promise<void>;
128
128
  protected computeUsageMode(data: T): UsageMode;
129
- protected waitWhilePending(): Promise<void>;
129
+ protected waitWhilePending(): Promise<boolean>;
130
130
  protected getValue(): Promise<T>;
131
131
  protected getJsonValueToSave(): Promise<any>;
132
132
  /**
@@ -75,6 +75,11 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy
75
75
  onlySelf?: boolean;
76
76
  emitEvent?: boolean;
77
77
  }): void;
78
+ /**
79
+ * Wait form is idle (not loading)
80
+ * @param opts
81
+ */
82
+ waitIdle(): Promise<boolean>;
78
83
  protected registerSubscription(sub: Subscription): Subscription;
79
84
  protected registerAutocompleteField<T = any, F = any>(fieldName: string, opts?: MatAutocompleteFieldAddOptions<T, F>): MatAutocompleteFieldConfig<T, F>;
80
85
  protected markForCheck(): void;
@@ -6,11 +6,12 @@ export interface IAppForm {
6
6
  invalid: boolean;
7
7
  valid: boolean;
8
8
  dirty: boolean;
9
- empty?: boolean;
10
9
  pending: boolean;
11
10
  error: string;
12
11
  enabled: boolean;
13
12
  disabled: boolean;
13
+ empty?: boolean;
14
+ loading?: boolean;
14
15
  disable(opts?: {
15
16
  onlySelf?: boolean;
16
17
  emitEvent?: boolean;
@@ -47,6 +48,7 @@ export declare class AppNullForm implements IAppForm {
47
48
  readonly pending = false;
48
49
  readonly error: any;
49
50
  readonly enabled = false;
51
+ readonly loading = false;
50
52
  get disabled(): boolean;
51
53
  disable(opts?: {
52
54
  onlySelf?: boolean;
@@ -91,6 +93,7 @@ export declare class AppFormHolder<F extends IAppForm = IAppForm> implements IAp
91
93
  get dirty(): boolean;
92
94
  get empty(): boolean;
93
95
  get pending(): boolean;
96
+ get loading(): boolean;
94
97
  disable(opts?: {
95
98
  onlySelf?: boolean;
96
99
  emitEvent?: boolean;
@@ -128,6 +131,7 @@ export declare class AppFormUtils {
128
131
  static markAsTouched: typeof markAsTouched;
129
132
  static markAsUntouched: typeof markAsUntouched;
130
133
  static waitWhilePending: typeof waitWhilePending;
134
+ static waitIdle: typeof waitIdle;
131
135
  static updateValueAndValidity: typeof updateValueAndValidity;
132
136
  static getFormErrors: typeof getFormErrors;
133
137
  static addValueInArray: typeof addValueInArray;
@@ -214,7 +218,16 @@ export declare function waitWhilePending<T extends {
214
218
  }>(form: T, opts?: {
215
219
  checkPeriod?: number;
216
220
  timeout?: number;
217
- }): Promise<any>;
221
+ }): Promise<boolean>;
222
+ /**
223
+ * Wait form is idle (not loading). This need to implement IAppForm.loading
224
+ * @param form
225
+ * @param opts
226
+ */
227
+ export declare function waitIdle(form: IAppForm, opts?: {
228
+ checkPeriod?: number;
229
+ timeout?: number;
230
+ }): Promise<boolean>;
218
231
  export declare function isControlHasInput(controls: {
219
232
  [key: string]: AbstractControl;
220
233
  }, controlName: string): boolean;
@@ -1,4 +1,4 @@
1
1
  import { AppTable } from './table.class';
2
2
  export declare class AppTableUtils {
3
- static waitIdle(table: AppTable<any, any, any>): Promise<void>;
3
+ static waitIdle(table: AppTable<any, any, any>): Promise<any>;
4
4
  }