@sumaris-net/ngx-components 2.9.0-alpha3 → 2.9.0-alpha4
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/esm2022/src/app/core/form/form.class.mjs +5 -5
- package/esm2022/src/app/core/table/async-table.class.mjs +1 -1
- package/esm2022/src/app/core/table/table.class.mjs +4 -4
- package/esm2022/src/app/shared/pipes/form.pipes.mjs +2 -2
- package/esm2022/src/app/shared/validator/form-error-adapter.class.mjs +6 -2
- package/fesm2022/sumaris-net.ngx-components.mjs +13 -9
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/form.class.d.ts +4 -4
- package/src/app/core/table/async-table.class.d.ts +3 -3
- package/src/app/core/table/table.class.d.ts +3 -3
- package/src/app/shared/pipes/form.pipes.d.ts +4 -4
- package/src/app/shared/validator/form-error-adapter.class.d.ts +22 -4
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { BehaviorSubject, Subject, Subscription } from 'rxjs';
|
|
|
4
4
|
import { IAppForm } from './form.utils';
|
|
5
5
|
import { LocalSettingsService } from '../services/local-settings.service';
|
|
6
6
|
import { WaitForOptions } from '../../shared/observables';
|
|
7
|
-
import {
|
|
7
|
+
import { FormErrorTranslateOptions, FormErrorTranslator, IFormPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
8
8
|
import { TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
@@ -55,7 +55,7 @@ export declare class AppForm<T> implements IAppForm<T>, OnInit, OnDestroy, IForm
|
|
|
55
55
|
get destroyed(): boolean;
|
|
56
56
|
debug: boolean;
|
|
57
57
|
tabindex: number;
|
|
58
|
-
|
|
58
|
+
formErrorTranslateOptions: FormErrorTranslateOptions;
|
|
59
59
|
set form(value: UntypedFormGroup);
|
|
60
60
|
get form(): UntypedFormGroup;
|
|
61
61
|
onCancel: EventEmitter<any>;
|
|
@@ -132,7 +132,7 @@ export declare class AppForm<T> implements IAppForm<T>, OnInit, OnDestroy, IForm
|
|
|
132
132
|
emitEvent?: boolean;
|
|
133
133
|
}): void;
|
|
134
134
|
translateFormPath(path: string): any;
|
|
135
|
-
protected getFormError(form: UntypedFormGroup, opts?:
|
|
135
|
+
protected getFormError(form: UntypedFormGroup, opts?: FormErrorTranslateOptions): string;
|
|
136
136
|
protected getI18nFieldName(path: string): string;
|
|
137
137
|
protected registerSubscription(sub: Subscription): void;
|
|
138
138
|
protected unregisterSubscription(sub: Subscription): void;
|
|
@@ -143,5 +143,5 @@ export declare class AppForm<T> implements IAppForm<T>, OnInit, OnDestroy, IForm
|
|
|
143
143
|
protected markForCheck(): void;
|
|
144
144
|
private setLoading;
|
|
145
145
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppForm<any>, never>;
|
|
146
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AppForm<any>, never, never, { "debug": { "alias": "debug"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "
|
|
146
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AppForm<any>, never, never, { "debug": { "alias": "debug"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "formErrorTranslateOptions": { "alias": "formErrorTranslateOptions"; "required": false; }; "form": { "alias": "form"; "required": false; }; }, { "onCancel": "onCancel"; "onSubmit": "onSubmit"; }, never, never, false, never>;
|
|
147
147
|
}
|
|
@@ -18,7 +18,7 @@ import { WaitForOptions } from '../../shared/observables';
|
|
|
18
18
|
import { ShowToastOptions } from '../../shared/toast/toasts';
|
|
19
19
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
20
20
|
import { LoadResult } from '../../shared/services/entity-service.class';
|
|
21
|
-
import {
|
|
21
|
+
import { FormErrorTranslateOptions, FormErrorTranslator, IFormPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
22
22
|
import { SaveActionType } from './table.model';
|
|
23
23
|
import { AsyncTableElement } from '@e-is/ngx-material-table';
|
|
24
24
|
import { EntitiesAsyncTableDataSource } from './entities-async-table-datasource.class';
|
|
@@ -50,7 +50,7 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
50
50
|
displayedColumns: string[];
|
|
51
51
|
totalRowCount: number | null;
|
|
52
52
|
visibleRowCount: number;
|
|
53
|
-
errorTranslatorOptions:
|
|
53
|
+
errorTranslatorOptions: FormErrorTranslateOptions;
|
|
54
54
|
readonly readySubject: BehaviorSubject<boolean>;
|
|
55
55
|
readonly loadingSubject: BehaviorSubject<boolean>;
|
|
56
56
|
readonly savingSubject: BehaviorSubject<boolean>;
|
|
@@ -343,7 +343,7 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
343
343
|
protected resetError(opts?: {
|
|
344
344
|
emitEvent?: boolean;
|
|
345
345
|
}): void;
|
|
346
|
-
protected getRowError(row?: AsyncTableElement<T>, opts?:
|
|
346
|
+
protected getRowError(row?: AsyncTableElement<T>, opts?: FormErrorTranslateOptions): string;
|
|
347
347
|
protected setError(value: string, opts?: {
|
|
348
348
|
emitEvent?: boolean;
|
|
349
349
|
}): void;
|
|
@@ -18,7 +18,7 @@ import { WaitForOptions } from '../../shared/observables';
|
|
|
18
18
|
import { ShowToastOptions } from '../../shared/toast/toasts';
|
|
19
19
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
20
20
|
import { LoadResult } from '../../shared/services/entity-service.class';
|
|
21
|
-
import {
|
|
21
|
+
import { FormErrorTranslateOptions, FormErrorTranslator, IFormPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
22
22
|
import { SaveActionType } from './table.model';
|
|
23
23
|
import { MatPaginator } from '@angular/material/paginator';
|
|
24
24
|
import { MatTable } from '@angular/material/table';
|
|
@@ -50,7 +50,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
50
50
|
displayedColumns: string[];
|
|
51
51
|
totalRowCount: number | null;
|
|
52
52
|
visibleRowCount: number;
|
|
53
|
-
|
|
53
|
+
errorTranslateOptions: FormErrorTranslateOptions;
|
|
54
54
|
readonly readySubject: BehaviorSubject<boolean>;
|
|
55
55
|
readonly loadingSubject: BehaviorSubject<boolean>;
|
|
56
56
|
readonly savingSubject: BehaviorSubject<boolean>;
|
|
@@ -349,7 +349,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
349
349
|
protected resetError(opts?: {
|
|
350
350
|
emitEvent?: boolean;
|
|
351
351
|
}): void;
|
|
352
|
-
protected getRowError(row?: TableElement<T>, opts?:
|
|
352
|
+
protected getRowError(row?: TableElement<T>, opts?: FormErrorTranslateOptions): string;
|
|
353
353
|
protected setError(value: string, opts?: {
|
|
354
354
|
emitEvent?: boolean;
|
|
355
355
|
}): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeDetectorRef, OnDestroy, PipeTransform } from '@angular/core';
|
|
2
2
|
import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
|
3
|
-
import { FormErrorTranslator, FormErrorTranslatorOptions } from '../validator/form-error-adapter.class';
|
|
3
|
+
import { FormErrorTranslateOptions, FormErrorTranslator, FormErrorTranslatorOptions } from '../validator/form-error-adapter.class';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class FormErrorPipe implements PipeTransform, OnDestroy {
|
|
6
6
|
private service;
|
|
@@ -10,7 +10,7 @@ export declare class FormErrorPipe implements PipeTransform, OnDestroy {
|
|
|
10
10
|
private _lastOptions;
|
|
11
11
|
private _onFormStatusChanges;
|
|
12
12
|
constructor(service: FormErrorTranslator, _ref: ChangeDetectorRef);
|
|
13
|
-
transform(form: UntypedFormGroup, opts?:
|
|
13
|
+
transform(form: UntypedFormGroup, opts?: FormErrorTranslateOptions): string;
|
|
14
14
|
ngOnDestroy(): void;
|
|
15
15
|
private _updateValue;
|
|
16
16
|
/**
|
|
@@ -22,11 +22,11 @@ export declare class FormErrorPipe implements PipeTransform, OnDestroy {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Same a FormErrorPipe
|
|
25
|
-
* @deprecated
|
|
25
|
+
* @deprecated use `formError` instead
|
|
26
26
|
*/
|
|
27
27
|
export declare class FormErrorTranslatePipe extends FormErrorPipe {
|
|
28
28
|
constructor(service: FormErrorTranslator, _ref: ChangeDetectorRef);
|
|
29
|
-
transform(form: UntypedFormGroup, opts?: FormErrorTranslatorOptions): string;
|
|
29
|
+
transform(form: UntypedFormGroup, opts?: FormErrorTranslateOptions | FormErrorTranslatorOptions): string;
|
|
30
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorTranslatePipe, never>;
|
|
31
31
|
static ɵpipe: i0.ɵɵPipeDeclaration<FormErrorTranslatePipe, "translateFormError", false>;
|
|
32
32
|
}
|
|
@@ -8,19 +8,37 @@ export declare const APP_FORM_ERROR_I18N_KEYS: InjectionToken<ObjectMap<string>>
|
|
|
8
8
|
export interface IFormPathTranslator {
|
|
9
9
|
translateFormPath: (path: string) => string;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface FormErrorTranslateOptions {
|
|
12
12
|
i18nPrefix?: string;
|
|
13
13
|
pathTranslator?: IFormPathTranslator;
|
|
14
14
|
separator?: string;
|
|
15
15
|
recursive?: boolean;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated use IFormPathTranslator instead
|
|
19
|
+
*/
|
|
20
|
+
export interface IFormControlPathTranslator {
|
|
21
|
+
/**
|
|
22
|
+
* @Deprecated use 'translateControlPath' from IFormPathTranslator interface
|
|
23
|
+
*/
|
|
24
|
+
translateControlPath: (path: string) => string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @Deprecated use 'FormErrorTranslateOptions' instead
|
|
28
|
+
*/
|
|
29
|
+
export interface FormErrorTranslatorOptions extends FormErrorTranslateOptions {
|
|
30
|
+
/**
|
|
31
|
+
* @Deprecated use 'pathTranslator' instead
|
|
32
|
+
*/
|
|
33
|
+
controlPathTranslator?: IFormControlPathTranslator;
|
|
34
|
+
}
|
|
17
35
|
export declare class FormErrorTranslator implements IFormPathTranslator {
|
|
18
36
|
private translate;
|
|
19
37
|
private readonly errorI18nKeys;
|
|
20
38
|
constructor(translate: TranslateService, errorI18nKeys: ObjectMap<string>);
|
|
21
|
-
translateFormErrors(control: AbstractControl, opts?: FormErrorTranslatorOptions): string;
|
|
22
|
-
translateErrors(errors: FormErrors, opts?:
|
|
23
|
-
translateFormPath(path: string, opts?: FormErrorTranslatorOptions): string;
|
|
39
|
+
translateFormErrors(control: AbstractControl, opts?: FormErrorTranslateOptions | FormErrorTranslatorOptions): string;
|
|
40
|
+
translateErrors(errors: FormErrors, opts?: FormErrorTranslateOptions): string;
|
|
41
|
+
translateFormPath(path: string, opts?: FormErrorTranslateOptions | FormErrorTranslatorOptions): string;
|
|
24
42
|
translateError(errorKey: string, errorContent?: any): any;
|
|
25
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorTranslator, [null, { optional: true; }]>;
|
|
26
44
|
static ɵprov: i0.ɵɵInjectableDeclaration<FormErrorTranslator>;
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "2.9.0-
|
|
5
|
+
"version": "2.9.0-alpha4",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|