@sumaris-net/ngx-components 2.11.8 → 2.12.1
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/doc/changelog.md +4 -1
- package/esm2022/src/app/core/form/form.class.mjs +2 -11
- package/esm2022/src/app/core/services/base-entity-service.class.mjs +5 -5
- package/esm2022/src/app/core/table/async-table.class.mjs +2 -14
- package/esm2022/src/app/core/table/table.class.mjs +2 -14
- package/esm2022/src/app/shared/image/gallery/image-gallery.component.mjs +1 -3
- package/esm2022/src/app/shared/material/boolean/material.boolean.mjs +1 -2
- package/esm2022/src/app/shared/material/swipe/material.swipe.mjs +1 -2
- package/esm2022/src/app/shared/pipes/form.pipes.mjs +1 -1
- package/esm2022/src/app/shared/validator/form-error-adapter.class.mjs +6 -15
- package/esm2022/src/app/social/user-event/user-event.service.mjs +2 -2
- package/fesm2022/sumaris-net.ngx-components.mjs +10 -56
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/form.class.d.ts +1 -6
- package/src/app/core/services/base-entity-service.class.d.ts +1 -1
- package/src/app/core/table/async-table.class.d.ts +2 -10
- package/src/app/core/table/table.class.d.ts +2 -10
- package/src/app/shared/pipes/form.pipes.d.ts +2 -2
- package/src/app/shared/validator/form-error-adapter.class.d.ts +10 -37
- 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 { FormErrorTranslateOptions, FormErrorTranslator,
|
|
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";
|
|
@@ -44,11 +44,6 @@ export declare class AppForm<T> implements IAppForm<T>, OnInit, OnDestroy, IForm
|
|
|
44
44
|
*/
|
|
45
45
|
protected get _enable(): boolean;
|
|
46
46
|
protected set _enable(value: boolean);
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated use errorTranslateOptions instead
|
|
49
|
-
*/
|
|
50
|
-
get errorTranslatorOptions(): FormErrorTranslatorOptions;
|
|
51
|
-
set errorTranslatorOptions(options: FormErrorTranslatorOptions);
|
|
52
47
|
disable(opts?: {
|
|
53
48
|
onlySelf?: boolean;
|
|
54
49
|
emitEvent?: boolean;
|
|
@@ -112,7 +112,7 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
|
|
|
112
112
|
isNewFn(data: T): boolean;
|
|
113
113
|
protected ngOnStart(): Promise<void>;
|
|
114
114
|
protected fillDefaultProperties(source: T): void;
|
|
115
|
-
protected asObject(
|
|
115
|
+
protected asObject(source: T, opts?: EntityAsObjectOptions): any;
|
|
116
116
|
protected getRefetchQueriesForMutation(opts?: EntitySaveOptions): ((result: FetchResult<{
|
|
117
117
|
data: any;
|
|
118
118
|
}>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
|
|
@@ -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 { FormErrorTranslateOptions, FormErrorTranslator,
|
|
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
|
-
errorTranslateOptions: FormErrorTranslateOptions
|
|
53
|
+
errorTranslateOptions: FormErrorTranslateOptions;
|
|
54
54
|
readonly readySubject: BehaviorSubject<boolean>;
|
|
55
55
|
readonly loadingSubject: BehaviorSubject<boolean>;
|
|
56
56
|
readonly savingSubject: BehaviorSubject<boolean>;
|
|
@@ -59,14 +59,6 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
59
59
|
readonly errorSubject: BehaviorSubject<string>;
|
|
60
60
|
get error(): string;
|
|
61
61
|
set error(error: string);
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated use errorTranslateOptions instead
|
|
64
|
-
*/
|
|
65
|
-
get errorTranslatorOptions(): FormErrorTranslatorOptions;
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated use errorTranslateOptions instead
|
|
68
|
-
*/
|
|
69
|
-
set errorTranslatorOptions(options: FormErrorTranslatorOptions);
|
|
70
62
|
selection: SelectionModel<AsyncTableElement<T>>;
|
|
71
63
|
permanentSelection: SelectionModel<T>;
|
|
72
64
|
permanentSelectionChangedPrevented: boolean;
|
|
@@ -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 { FormErrorTranslateOptions, FormErrorTranslator,
|
|
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
|
-
errorTranslateOptions: FormErrorTranslateOptions
|
|
53
|
+
errorTranslateOptions: FormErrorTranslateOptions;
|
|
54
54
|
readonly readySubject: BehaviorSubject<boolean>;
|
|
55
55
|
readonly loadingSubject: BehaviorSubject<boolean>;
|
|
56
56
|
readonly savingSubject: BehaviorSubject<boolean>;
|
|
@@ -63,14 +63,6 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
63
63
|
* @deprecated
|
|
64
64
|
*/
|
|
65
65
|
get error$(): Observable<string>;
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated use errorTranslateOptions instead
|
|
68
|
-
*/
|
|
69
|
-
get errorTranslatorOptions(): FormErrorTranslatorOptions;
|
|
70
|
-
/**
|
|
71
|
-
* @deprecated use errorTranslateOptions instead
|
|
72
|
-
*/
|
|
73
|
-
set errorTranslatorOptions(options: FormErrorTranslatorOptions);
|
|
74
66
|
selection: SelectionModel<TableElement<T>>;
|
|
75
67
|
permanentSelection: SelectionModel<T>;
|
|
76
68
|
permanentSelectionChangedPrevented: boolean;
|
|
@@ -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 { FormErrorTranslateOptions, FormErrorTranslator
|
|
3
|
+
import { FormErrorTranslateOptions, FormErrorTranslator } 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;
|
|
@@ -26,7 +26,7 @@ export declare class FormErrorPipe implements PipeTransform, OnDestroy {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare class FormErrorTranslatePipe extends FormErrorPipe {
|
|
28
28
|
constructor(service: FormErrorTranslator, _ref: ChangeDetectorRef);
|
|
29
|
-
transform(form: UntypedFormGroup, opts?: FormErrorTranslateOptions
|
|
29
|
+
transform(form: UntypedFormGroup, opts?: FormErrorTranslateOptions): string;
|
|
30
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorTranslatePipe, never>;
|
|
31
31
|
static ɵpipe: i0.ɵɵPipeDeclaration<FormErrorTranslatePipe, "translateFormError", false>;
|
|
32
32
|
}
|
|
@@ -6,54 +6,27 @@ import { FormErrors } from '../forms';
|
|
|
6
6
|
import { TranslateContextService } from '../services/translate-context.service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare const APP_FORM_ERROR_I18N_KEYS: InjectionToken<ObjectMap<string>>;
|
|
9
|
-
export interface
|
|
10
|
-
translateFormPath: (path: string, opts?: {
|
|
11
|
-
i18nPrefix?: string;
|
|
12
|
-
i18nSuffix?: string;
|
|
13
|
-
}) => string;
|
|
14
|
-
}
|
|
15
|
-
export interface FormErrorTranslateOptions {
|
|
9
|
+
export interface IFormPathTranslatorOptions {
|
|
16
10
|
i18nPrefix?: string;
|
|
17
11
|
i18nSuffix?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface IFormPathTranslator<O extends IFormPathTranslatorOptions = IFormPathTranslatorOptions> {
|
|
15
|
+
translateFormPath: (path: string, opts?: O) => string;
|
|
16
|
+
}
|
|
17
|
+
export interface FormErrorTranslateOptions extends IFormPathTranslatorOptions {
|
|
18
18
|
pathTranslator?: IFormPathTranslator;
|
|
19
19
|
separator?: string;
|
|
20
20
|
recursive?: boolean;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
* @deprecated use IFormPathTranslator instead
|
|
24
|
-
*/
|
|
25
|
-
export interface IFormControlPathTranslator {
|
|
26
|
-
/**
|
|
27
|
-
* @Deprecated use 'translateControlPath' from IFormPathTranslator interface
|
|
28
|
-
*/
|
|
29
|
-
translateControlPath: (path: string, opts?: {
|
|
30
|
-
i18nPrefix?: string;
|
|
31
|
-
i18nSuffix?: string;
|
|
32
|
-
}) => string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @Deprecated use 'FormErrorTranslateOptions' instead
|
|
36
|
-
*/
|
|
37
|
-
export interface FormErrorTranslatorOptions extends FormErrorTranslateOptions {
|
|
38
|
-
/**
|
|
39
|
-
* @Deprecated use 'pathTranslator' instead
|
|
40
|
-
*/
|
|
41
|
-
controlPathTranslator?: IFormControlPathTranslator;
|
|
42
|
-
}
|
|
43
|
-
export declare class FormErrorTranslator implements IFormPathTranslator, IFormControlPathTranslator {
|
|
22
|
+
export declare class FormErrorTranslator implements IFormPathTranslator {
|
|
44
23
|
private translate;
|
|
45
24
|
private translateContext;
|
|
46
25
|
private readonly errorI18nKeys;
|
|
47
26
|
constructor(translate: TranslateService, translateContext: TranslateContextService, errorI18nKeys: ObjectMap<string>);
|
|
48
|
-
translateFormErrors(control: AbstractControl, opts?: FormErrorTranslateOptions
|
|
27
|
+
translateFormErrors(control: AbstractControl, opts?: FormErrorTranslateOptions): string;
|
|
49
28
|
translateErrors(errors: FormErrors, opts?: FormErrorTranslateOptions): string;
|
|
50
|
-
translateFormPath(path: string, opts?: FormErrorTranslateOptions
|
|
51
|
-
/**
|
|
52
|
-
* @Deprecated use translateFormPath() instead
|
|
53
|
-
* @param path
|
|
54
|
-
* @param opts
|
|
55
|
-
*/
|
|
56
|
-
translateControlPath(path: string, opts?: FormErrorTranslatorOptions): string;
|
|
29
|
+
translateFormPath(path: string, opts?: FormErrorTranslateOptions): string;
|
|
57
30
|
translateError(errorKey: string, errorContent?: any): any;
|
|
58
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorTranslator, [null, null, { optional: true; }]>;
|
|
59
32
|
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.
|
|
5
|
+
"version": "2.12.1",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|