@sumaris-net/ngx-components 0.27.5 → 0.27.9
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/sumaris-net.ngx-components.umd.js +86 -30
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +8 -0
- package/esm2015/src/app/core/form/editor.class.js +4 -2
- package/esm2015/src/app/core/form/entity-editor.class.js +6 -6
- package/esm2015/src/app/core/form/form.class.js +17 -8
- package/esm2015/src/app/core/form/form.utils.js +4 -1
- package/esm2015/src/app/core/table/table.class.js +8 -4
- package/esm2015/src/app/shared/observables.js +22 -19
- package/esm2015/src/app/shared/validator/validators.js +1 -2
- package/fesm2015/sumaris-net.ngx-components.js +52 -35
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/entity-editor.class.d.ts +1 -1
- package/src/app/core/form/form.class.d.ts +8 -6
- package/src/app/core/form/form.utils.d.ts +5 -3
- package/src/app/core/table/table.class.d.ts +3 -2
- package/src/app/shared/observables.d.ts +1 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -141,7 +141,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
141
141
|
protected onEntitySaved(data: T): Promise<void>;
|
|
142
142
|
protected onEntityDeleted(data: T): Promise<void>;
|
|
143
143
|
protected computeUsageMode(data: T): UsageMode;
|
|
144
|
-
protected waitWhilePending(opts?: WaitForOptions): Promise<
|
|
144
|
+
protected waitWhilePending(opts?: WaitForOptions): Promise<void>;
|
|
145
145
|
protected getValue(): Promise<T>;
|
|
146
146
|
protected getJsonValueToSave(): Promise<any>;
|
|
147
147
|
/**
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import { EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { Subscription } from 'rxjs';
|
|
3
|
+
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
4
4
|
import { IAppForm } from './form.utils';
|
|
5
5
|
import { LocalSettingsService } from '../services/local-settings.service';
|
|
6
6
|
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete';
|
|
7
7
|
import { WaitForOptions } from '../../shared/observables';
|
|
8
8
|
import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
9
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
9
10
|
export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy, IFormControlPathTranslator {
|
|
10
11
|
autocompleteHelper: MatAutocompleteConfigHolder;
|
|
11
12
|
autocompleteFields: {
|
|
12
13
|
[key: string]: MatAutocompleteFieldConfig;
|
|
13
14
|
};
|
|
14
15
|
error: string;
|
|
16
|
+
protected translate: TranslateService;
|
|
15
17
|
protected settings: LocalSettingsService;
|
|
16
18
|
protected errorTranslator: FormErrorTranslator;
|
|
17
19
|
protected _enable: boolean;
|
|
20
|
+
protected _$ready: BehaviorSubject<boolean>;
|
|
18
21
|
protected _loading: boolean;
|
|
19
22
|
protected i18nFieldPrefix: string;
|
|
20
23
|
private _subscription;
|
|
21
24
|
private _form;
|
|
22
|
-
private _$ready;
|
|
23
25
|
debug: boolean;
|
|
24
26
|
tabindex: number;
|
|
25
27
|
errorTranslatorOptions: FormErrorTranslatorOptions;
|
|
@@ -98,19 +100,19 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
|
|
|
98
100
|
* Wait form is ready
|
|
99
101
|
* @param opts
|
|
100
102
|
*/
|
|
101
|
-
ready(opts?: WaitForOptions): Promise<
|
|
103
|
+
ready(opts?: WaitForOptions): Promise<void>;
|
|
102
104
|
/**
|
|
103
105
|
* Wait form is idle (not loading)
|
|
104
106
|
* @param opts
|
|
105
107
|
*/
|
|
106
|
-
waitIdle(opts?: WaitForOptions): Promise<
|
|
108
|
+
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
107
109
|
updateValueAndValidity(opts?: {
|
|
108
110
|
onlySelf?: boolean;
|
|
109
111
|
emitEvent?: boolean;
|
|
110
112
|
}): void;
|
|
111
|
-
translateControlPath(path: string):
|
|
113
|
+
translateControlPath(path: string): any;
|
|
112
114
|
protected getFormError(form: FormGroup, opts?: FormErrorTranslatorOptions): string;
|
|
113
|
-
protected
|
|
115
|
+
protected getI18nFieldName(path: string): string;
|
|
114
116
|
protected registerSubscription(sub: Subscription): Subscription;
|
|
115
117
|
protected registerAutocompleteField<T = any, F = any>(fieldName: string, opts?: MatAutocompleteFieldAddOptions<T, F>): MatAutocompleteFieldConfig<T, F>;
|
|
116
118
|
protected markForCheck(): void;
|
|
@@ -16,7 +16,8 @@ export interface IAppForm {
|
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
empty?: boolean;
|
|
18
18
|
loading?: boolean;
|
|
19
|
-
ready(): Promise<
|
|
19
|
+
ready(): Promise<void>;
|
|
20
|
+
waitIdle(opts?: WaitForOptions): Promise<any>;
|
|
20
21
|
disable(opts?: {
|
|
21
22
|
onlySelf?: boolean;
|
|
22
23
|
emitEvent?: boolean;
|
|
@@ -128,6 +129,7 @@ export declare class AppFormProvider<F extends IAppForm = IAppForm> implements I
|
|
|
128
129
|
get pending(): boolean;
|
|
129
130
|
get loading(): boolean;
|
|
130
131
|
ready(): Promise<any>;
|
|
132
|
+
waitIdle(opts?: WaitForOptions): Promise<any>;
|
|
131
133
|
disable(opts?: {
|
|
132
134
|
onlySelf?: boolean;
|
|
133
135
|
emitEvent?: boolean;
|
|
@@ -268,7 +270,7 @@ export declare function markAsUntouched(form: FormGroup, opts?: {
|
|
|
268
270
|
*/
|
|
269
271
|
export declare function waitWhilePending<T extends IAppForm | {
|
|
270
272
|
pending: boolean;
|
|
271
|
-
}>(form: T, opts?: WaitForOptions): Promise<
|
|
273
|
+
}>(form: T, opts?: WaitForOptions): Promise<void>;
|
|
272
274
|
/**
|
|
273
275
|
* Wait form is idle (not loading). This need to implement IAppForm.loading
|
|
274
276
|
* @param form
|
|
@@ -276,7 +278,7 @@ export declare function waitWhilePending<T extends IAppForm | {
|
|
|
276
278
|
*/
|
|
277
279
|
export declare function waitIdle<T extends IAppForm | {
|
|
278
280
|
loading: boolean;
|
|
279
|
-
}>(form: T, opts?: WaitForOptions): Promise<
|
|
281
|
+
}>(form: T, opts?: WaitForOptions): Promise<void>;
|
|
280
282
|
export declare function isControlHasInput(controls: {
|
|
281
283
|
[key: string]: AbstractControl;
|
|
282
284
|
}, controlName: string): boolean;
|
|
@@ -17,6 +17,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
17
17
|
import { PlatformService } from '../services/platform.service';
|
|
18
18
|
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete';
|
|
19
19
|
import { CompletableEvent } from '../../shared/events';
|
|
20
|
+
import { WaitForOptions } from '../../shared/observables';
|
|
20
21
|
import { ShowToastOptions } from '../../shared/toasts';
|
|
21
22
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
22
23
|
import { LoadResult } from '../../shared/services/entity-service.class';
|
|
@@ -290,8 +291,8 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
290
291
|
selectRowByData(data: T): Promise<boolean>;
|
|
291
292
|
clickRow(event: UIEvent | undefined, row: TableElement<T>): boolean;
|
|
292
293
|
moveRow(id: number, direction: number): void;
|
|
293
|
-
ready(): Promise<
|
|
294
|
-
waitIdle(): Promise<
|
|
294
|
+
ready(): Promise<void>;
|
|
295
|
+
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
295
296
|
openSelectColumnsModal(event?: Event): Promise<any>;
|
|
296
297
|
trackByFn(index: number, row: TableElement<T>): number;
|
|
297
298
|
doRefresh(event?: CompletableEvent): void;
|
|
@@ -18,4 +18,4 @@ export declare interface WaitForOptions {
|
|
|
18
18
|
* @param predicate
|
|
19
19
|
* @param opts
|
|
20
20
|
*/
|
|
21
|
-
export declare function waitFor(predicate: Predicate<void>, opts?: WaitForOptions): Promise<
|
|
21
|
+
export declare function waitFor(predicate: Predicate<void>, opts?: WaitForOptions): Promise<void>;
|