@sumaris-net/ngx-components 0.25.13 → 0.25.17
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 +14 -13
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/public_api.js +2 -1
- package/esm2015/src/app/core/form/form.utils.js +1 -1
- package/esm2015/src/app/core/services/model/entity.model.js +1 -1
- package/esm2015/src/app/core/table/table.class.js +4 -3
- package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +2 -2
- package/esm2015/src/app/shared/pipes/form.pipes.js +2 -2
- package/esm2015/src/app/shared/validator/form-error-adapter.class.js +10 -10
- package/fesm2015/sumaris-net.ngx-components.js +14 -13
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/core/services/model/entity.model.d.ts +2 -2
- package/src/app/core/table/table.class.d.ts +4 -3
- package/src/app/shared/pipes/form.pipes.d.ts +2 -2
- package/src/app/shared/validator/form-error-adapter.class.d.ts +8 -8
- package/src/theme/_ngx-components.scss +6 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export * from './src/app/shared/graph/colors.utils';
|
|
|
80
80
|
export * from './src/app/shared/gesture/gesture-config';
|
|
81
81
|
export * from './src/app/shared/gesture/hammer.utils';
|
|
82
82
|
export * from './src/app/shared/validator/validators';
|
|
83
|
+
export * from './src/app/shared/validator/form-error-adapter.class';
|
|
83
84
|
export * from './src/app/shared/material/latlong/latlong.utils';
|
|
84
85
|
export * from './src/app/shared/shared.testing.module';
|
|
85
86
|
export * from './src/app/shared/material/testing/material.testing.module';
|
|
@@ -45,8 +45,8 @@ export declare abstract class Entity<T extends Entity<T, ID, AO, FO>, ID = numbe
|
|
|
45
45
|
*/
|
|
46
46
|
export declare function isInstanceOf<T>(obj: any, constructor: new (...args: any[]) => T): obj is T;
|
|
47
47
|
export declare abstract class EntityUtils {
|
|
48
|
-
static isNotEmpty<T extends IEntity<any> | any>(obj:
|
|
49
|
-
static isEmpty
|
|
48
|
+
static isNotEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
49
|
+
static isEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
50
50
|
static equals<T extends IEntity<any> | any>(o1: T, o2: T, checkAttribute?: keyof T): boolean;
|
|
51
51
|
static getPropertyByPath(obj: any | IEntity<any>, path: string): any;
|
|
52
52
|
static getArrayAsMap<T = any>(source?: ObjectMapEntry<T>[]): ObjectMap<T>;
|
|
@@ -20,7 +20,7 @@ import { CompletableEvent } from '../../shared/events';
|
|
|
20
20
|
import { ShowToastOptions } from '../../shared/toasts';
|
|
21
21
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
22
22
|
import { LoadResult } from '../../shared/services/entity-service.class';
|
|
23
|
-
import { FormErrorAdapter,
|
|
23
|
+
import { FormErrorAdapter, FormErrorTranslateOptions, IFormControlPathTranslateService } from '../../shared/validator/form-error-adapter.class';
|
|
24
24
|
export declare const SETTINGS_DISPLAY_COLUMNS = "displayColumns";
|
|
25
25
|
export declare const SETTINGS_SORTED_COLUMN = "sortedColumn";
|
|
26
26
|
export declare const SETTINGS_FILTER = "filter";
|
|
@@ -43,7 +43,7 @@ export interface IModalDetailOptions<T = any> {
|
|
|
43
43
|
onDelete: (event: UIEvent, data: T) => Promise<boolean>;
|
|
44
44
|
}
|
|
45
45
|
export declare type SaveActionType = 'delete' | 'sort' | 'filter';
|
|
46
|
-
export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm,
|
|
46
|
+
export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, IFormControlPathTranslateService {
|
|
47
47
|
protected route: ActivatedRoute;
|
|
48
48
|
protected router: Router;
|
|
49
49
|
protected platform: Platform | PlatformService;
|
|
@@ -70,6 +70,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
70
70
|
displayedColumns: string[];
|
|
71
71
|
totalRowCount: number | null;
|
|
72
72
|
visibleRowCount: number;
|
|
73
|
+
translateErrorOptions: FormErrorTranslateOptions;
|
|
73
74
|
loadingSubject: BehaviorSubject<boolean>;
|
|
74
75
|
savingSubject: BehaviorSubject<boolean>;
|
|
75
76
|
dirtySubject: BehaviorSubject<boolean>;
|
|
@@ -290,7 +291,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
290
291
|
doRefresh(event?: CompletableEvent): void;
|
|
291
292
|
getCurrentColumns(): ColumnItem[];
|
|
292
293
|
escapeEditingRow(event?: Event, row?: TableElement<T>): void;
|
|
293
|
-
|
|
294
|
+
translateControlPath(path: string): string;
|
|
294
295
|
protected editRow(event: Event | undefined, row: TableElement<T>, opts?: {
|
|
295
296
|
focusColumn?: string;
|
|
296
297
|
}): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { FormErrorAdapter,
|
|
3
|
+
import { FormErrorAdapter, FormErrorTranslateOptions } from '../validator/form-error-adapter.class';
|
|
4
4
|
export declare class FormErrorTranslatePipe implements PipeTransform {
|
|
5
5
|
private adapter;
|
|
6
6
|
constructor(adapter: FormErrorAdapter);
|
|
7
|
-
transform(form: FormGroup, opts?:
|
|
7
|
+
transform(form: FormGroup, opts?: FormErrorTranslateOptions): string;
|
|
8
8
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
import {
|
|
3
|
+
import { AbstractControl } from '@angular/forms';
|
|
4
4
|
import { ObjectMap } from '../types';
|
|
5
5
|
export declare const APP_FORM_ERROR_I18N_KEYS: InjectionToken<ObjectMap<string>>;
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface IFormControlPathTranslateService {
|
|
7
|
+
translateControlPath: (controlPath: string) => string;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface FormErrorTranslateOptions {
|
|
10
10
|
i18nPrefix?: string;
|
|
11
|
-
pathTranslateService?:
|
|
11
|
+
pathTranslateService?: IFormControlPathTranslateService;
|
|
12
12
|
separator?: string;
|
|
13
13
|
recursive?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare class FormErrorAdapter implements
|
|
15
|
+
export declare class FormErrorAdapter implements IFormControlPathTranslateService {
|
|
16
16
|
private translate;
|
|
17
17
|
private readonly errorI18nKeys;
|
|
18
18
|
constructor(translate: TranslateService, errorI18nKeys: ObjectMap<string>);
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
translateErrors(control: AbstractControl, opts?: FormErrorTranslateOptions): string;
|
|
20
|
+
translateControlPath(path: string, opts?: FormErrorTranslateOptions): string;
|
|
21
21
|
translateError(errorKey: string, errorContent?: any): any;
|
|
22
22
|
}
|
|
@@ -142,6 +142,12 @@ form.form-container {
|
|
|
142
142
|
color: $app-form-color-disabled !important;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
.mat-form-field-disabled {
|
|
146
|
+
.mat-form-field-infix{
|
|
147
|
+
min-height: 41px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
145
151
|
mat-form-field,
|
|
146
152
|
mat-autocomplete-field,
|
|
147
153
|
app-form-field {
|