@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/bundles/ngx-sumaris-components.umd.js +54 -8
- package/bundles/ngx-sumaris-components.umd.js.map +1 -1
- package/bundles/ngx-sumaris-components.umd.min.js +1 -1
- package/bundles/ngx-sumaris-components.umd.min.js.map +1 -1
- package/doc/changelog.md +5 -0
- package/esm2015/src/app/core/form/editor.class.js +10 -7
- package/esm2015/src/app/core/form/entity-editor.class.js +2 -2
- package/esm2015/src/app/core/form/form.class.js +8 -1
- package/esm2015/src/app/core/form/form.utils.js +30 -3
- package/esm2015/src/app/core/table/table.utils.js +1 -1
- package/fesm2015/ngx-sumaris-components.js +46 -9
- package/fesm2015/ngx-sumaris-components.js.map +1 -1
- package/ngx-sumaris-components.metadata.json +1 -1
- package/package.json +1 -1
- package/src/app/core/form/editor.class.d.ts +2 -1
- package/src/app/core/form/entity-editor.class.d.ts +1 -1
- package/src/app/core/form/form.class.d.ts +5 -0
- package/src/app/core/form/form.utils.d.ts +15 -2
- package/src/app/core/table/table.utils.d.ts +1 -1
package/package.json
CHANGED
|
@@ -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<
|
|
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<
|
|
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;
|