@sumaris-net/ngx-components 2.11.7 → 2.12.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "2.11.7",
4
+ "version": "2.12.0",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -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, FormErrorTranslatorOptions, IFormPathTranslator } from '../../shared/validator/form-error-adapter.class';
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(entity: T, opts?: EntityAsObjectOptions): any;
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, FormErrorTranslatorOptions, IFormPathTranslator } from '../../shared/validator/form-error-adapter.class';
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 | FormErrorTranslatorOptions;
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, FormErrorTranslatorOptions, IFormPathTranslator } from '../../shared/validator/form-error-adapter.class';
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 | FormErrorTranslatorOptions;
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;
@@ -16,7 +16,7 @@ export interface InputElement extends FocusableElement {
16
16
  }
17
17
  export declare function isInputElement(object: any): object is InputElement;
18
18
  export declare function asInputElement(object: ElementRef): InputElement | undefined;
19
- export declare function tabindexComparator(a: InputElement, b: InputElement): 0 | 1 | -1;
19
+ export declare function tabindexComparator(a: InputElement, b: InputElement): 1 | 0 | -1;
20
20
  export interface CanGainFocusOptions {
21
21
  minTabindex?: number;
22
22
  maxTabindex?: number;
@@ -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, FormErrorTranslatorOptions } from '../validator/form-error-adapter.class';
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 | FormErrorTranslatorOptions): string;
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,48 +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 IFormPathTranslator {
10
- translateFormPath: (path: string) => string;
11
- }
12
- export interface FormErrorTranslateOptions {
9
+ export interface IFormPathTranslatorOptions {
13
10
  i18nPrefix?: string;
14
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 {
15
18
  pathTranslator?: IFormPathTranslator;
16
19
  separator?: string;
17
20
  recursive?: boolean;
18
21
  }
19
- /**
20
- * @deprecated use IFormPathTranslator instead
21
- */
22
- export interface IFormControlPathTranslator {
23
- /**
24
- * @Deprecated use 'translateControlPath' from IFormPathTranslator interface
25
- */
26
- translateControlPath: (path: string) => string;
27
- }
28
- /**
29
- * @Deprecated use 'FormErrorTranslateOptions' instead
30
- */
31
- export interface FormErrorTranslatorOptions extends FormErrorTranslateOptions {
32
- /**
33
- * @Deprecated use 'pathTranslator' instead
34
- */
35
- controlPathTranslator?: IFormControlPathTranslator;
36
- }
37
- export declare class FormErrorTranslator implements IFormPathTranslator, IFormControlPathTranslator {
22
+ export declare class FormErrorTranslator implements IFormPathTranslator {
38
23
  private translate;
39
24
  private translateContext;
40
25
  private readonly errorI18nKeys;
41
26
  constructor(translate: TranslateService, translateContext: TranslateContextService, errorI18nKeys: ObjectMap<string>);
42
- translateFormErrors(control: AbstractControl, opts?: FormErrorTranslateOptions | FormErrorTranslatorOptions): string;
27
+ translateFormErrors(control: AbstractControl, opts?: FormErrorTranslateOptions): string;
43
28
  translateErrors(errors: FormErrors, opts?: FormErrorTranslateOptions): string;
44
- translateFormPath(path: string, opts?: FormErrorTranslateOptions | FormErrorTranslatorOptions): string;
45
- /**
46
- * @Deprecated use translateFormPath() instead
47
- * @param path
48
- * @param opts
49
- */
50
- translateControlPath(path: string, opts?: FormErrorTranslatorOptions): string;
29
+ translateFormPath(path: string, opts?: FormErrorTranslateOptions): string;
51
30
  translateError(errorKey: string, errorContent?: any): any;
52
31
  static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorTranslator, [null, null, { optional: true; }]>;
53
32
  static ɵprov: i0.ɵɵInjectableDeclaration<FormErrorTranslator>;
@@ -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.11.7",
5
+ "version": "2.12.0",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{
@@ -138,8 +138,8 @@
138
138
  --app-form-color-disabled: #{$app-form-color-disabled};
139
139
  --app-form-color-computed: #{$app-form-color-computed};
140
140
  --app-form-field-background-color: #{$app-form-field-background-color};
141
- --app-form-field-focus-background-color: #{$app-form-field-focus-background-color};
142
141
  --app-form-field-background-color-shade: #{$app-form-color-background-color-shade};
142
+ --app-form-field-focus-background-color: #{$app-form-field-focus-background-color};
143
143
  --app-form-field-disabled-background-color: #{$app-form-field-disabled-background-color};
144
144
  --app-form-field-label-color: #{$app-form-field-label-color};
145
145
  --app-form-field-disabled-label-color: #{$app-form-field-disabled-label-color};
@@ -10,16 +10,20 @@ $app-table-cell-focus-background-color: transparent !default;
10
10
 
11
11
  $app-paginator-height: 34px !default;
12
12
  $app-form-buttons-bar-height: 56px !default;
13
+
14
+ // Form's field text and label
13
15
  $app-form-color: #{$text-color} !default;
14
16
  $app-form-color-rgb: #{$text-color-rgb} !default;
15
17
  $app-form-color-disabled: rgba(#{$text-color-rgb}, 0.55) !default;
16
18
  $app-form-color-computed: var(--ion-color-primary-tint) !default;
19
+ $app-form-field-label-color: rgba(#{$text-color-rgb}, 0.6) !default;
20
+ $app-form-field-disabled-label-color: rgba(#{$text-color-rgb}, 0.38) !default;
21
+
22
+ // Form's field background
17
23
  $app-form-field-background-color: #f5f5f5 !default; // Field background
24
+ $app-form-color-background-color-shade: #b9b9b9 !default; // Darker color (e.g. for toggle slide bar - see settings field 'dark mode')
18
25
  $app-form-field-focus-background-color: transparent !default; // Focused field background
19
- $app-form-color-background-color-shade: #b9b9b9 !default;
20
26
  $app-form-field-disabled-background-color: #fafafa !default;
21
- $app-form-field-label-color: rgba(#{$text-color-rgb}, 0.6) !default;
22
- $app-form-field-disabled-label-color: rgba(#{$text-color-rgb}, 0.38) !default;
23
27
 
24
28
  $app-select-option-border-color: rgba(#{$text-color-rgb}, 0.12) !default;
25
29
  $app-table-border-color: rgba(#{$text-color-rgb}, 0.08) !default;