@sumaris-net/ngx-components 2.18.0-beta1 → 2.18.0-beta11

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.
Files changed (59) hide show
  1. package/esm2022/public_api.mjs +2 -1
  2. package/esm2022/src/app/core/account/account.page.mjs +1 -2
  3. package/esm2022/src/app/core/auth/auth.form.mjs +1 -2
  4. package/esm2022/src/app/core/form/array/testing/form-array.test.mjs +1 -2
  5. package/esm2022/src/app/core/form/entity/entity-editor-modal.class.mjs +1 -2
  6. package/esm2022/src/app/core/form/entity/entity-editor.class.mjs +1 -2
  7. package/esm2022/src/app/core/form/entity/tab-editor.class.mjs +1 -2
  8. package/esm2022/src/app/core/form/form-container.class.mjs +6 -3
  9. package/esm2022/src/app/core/form/form.utils.mjs +5 -2
  10. package/esm2022/src/app/core/form/properties/properties.utils.mjs +60 -0
  11. package/esm2022/src/app/core/form/text-popover/text-popover.component.mjs +1 -2
  12. package/esm2022/src/app/core/menu/menu.component.mjs +1 -2
  13. package/esm2022/src/app/core/menu/menu.service.mjs +1 -2
  14. package/esm2022/src/app/core/services/account.service.mjs +3 -3
  15. package/esm2022/src/app/core/services/config.service.mjs +1 -2
  16. package/esm2022/src/app/core/services/model/entity.model.mjs +3 -9
  17. package/esm2022/src/app/core/services/model/peer.model.mjs +11 -2
  18. package/esm2022/src/app/core/services/network.service.mjs +4 -3
  19. package/esm2022/src/app/core/services/platform.service.mjs +1 -2
  20. package/esm2022/src/app/core/services/validator/local-settings.validator.mjs +8 -7
  21. package/esm2022/src/app/core/settings/settings.page.mjs +5 -5
  22. package/esm2022/src/app/core/table/async-table.class.mjs +1 -2
  23. package/esm2022/src/app/core/table/entities-table-datasource.class.mjs +1 -2
  24. package/esm2022/src/app/core/table/table.class.mjs +1 -2
  25. package/esm2022/src/app/shared/form/field.component.mjs +1 -2
  26. package/esm2022/src/app/shared/forms.mjs +45 -3
  27. package/esm2022/src/app/shared/functions.mjs +1 -2
  28. package/esm2022/src/app/shared/hotkeys/dialog/hotkeys-dialog.component.mjs +3 -3
  29. package/esm2022/src/app/shared/hotkeys/hotkeys.service.mjs +37 -9
  30. package/esm2022/src/app/shared/image/gallery/image-gallery.component.mjs +1 -2
  31. package/esm2022/src/app/shared/material/autocomplete/material.autocomplete.mjs +1 -2
  32. package/esm2022/src/app/shared/material/boolean/material.boolean.mjs +1 -2
  33. package/esm2022/src/app/shared/material/datetime/material.date.mjs +1 -2
  34. package/esm2022/src/app/shared/material/datetime/material.dateshort.mjs +4 -3
  35. package/esm2022/src/app/shared/material/datetime/material.datetime.mjs +1 -2
  36. package/esm2022/src/app/shared/material/duration/material.duration.mjs +1 -2
  37. package/esm2022/src/app/shared/material/latlong/testing/latlong.test.mjs +1 -2
  38. package/esm2022/src/app/shared/material/swipe/material.swipe.mjs +1 -2
  39. package/esm2022/src/app/shared/toolbar/toolbar.mjs +1 -2
  40. package/esm2022/src/app/shared/upload-file/testing/upload-file.testing.mjs +1 -2
  41. package/esm2022/src/app/shared/validator/validators.mjs +3 -2
  42. package/esm2022/src/app/social/job/progression/job-progression.icon.mjs +1 -2
  43. package/esm2022/src/app/social/message/message.modal.mjs +1 -2
  44. package/esm2022/src/app/social/user-event/notification/user-event-notification.icon.mjs +1 -2
  45. package/fesm2022/sumaris-net.ngx-components.mjs +233 -92
  46. package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
  47. package/package.json +2 -2
  48. package/public_api.d.ts +1 -0
  49. package/src/app/core/form/form.utils.d.ts +4 -1
  50. package/src/app/core/form/properties/properties.utils.d.ts +27 -0
  51. package/src/app/core/services/model/entity.model.d.ts +3 -2
  52. package/src/app/core/services/model/peer.model.d.ts +1 -0
  53. package/src/app/shared/forms.d.ts +19 -0
  54. package/src/app/shared/hotkeys/hotkeys.service.d.ts +16 -2
  55. package/src/app/shared/validator/validators.d.ts +2 -0
  56. package/src/assets/i18n/en-US.json +1 -0
  57. package/src/assets/i18n/en.json +1 -0
  58. package/src/assets/i18n/fr.json +1 -0
  59. package/src/assets/manifest.json +1 -1
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.18.0-beta1",
4
+ "version": "2.18.0-beta11",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -35,7 +35,7 @@
35
35
  "d3": "~7.6.1",
36
36
  "localforage": "~1.10.0",
37
37
  "rxjs": "~7.8.1",
38
- "zone.js": "0.15.0"
38
+ "zone.js": "~0.14.10"
39
39
  },
40
40
  "optionalDependencies": {
41
41
  "@awesome-cordova-plugins/core": "~6.4.0",
package/public_api.d.ts CHANGED
@@ -187,6 +187,7 @@ export * from './src/app/core/form/entity/entity.module';
187
187
  export * from './src/app/core/form/list/list.form';
188
188
  export * from './src/app/core/form/list/list.module';
189
189
  export * from './src/app/core/form/properties/properties.form';
190
+ export * from './src/app/core/form/properties/properties.utils';
190
191
  export * from './src/app/core/form/properties/properties.table';
191
192
  export * from './src/app/core/form/properties/properties.module';
192
193
  export * from './src/app/core/form/text-popover/text-popover.component';
@@ -1,7 +1,7 @@
1
1
  import { AbstractControl } from '@angular/forms';
2
2
  import { filterNumberInput, selectInputContent } from '../../shared/inputs';
3
3
  import { WaitForOptions } from '../../shared/observables';
4
- import { addValueInArray, clearValueInArray, copyEntity2Form, disableControls, filterFormErrors, filterFormErrorsByPath, filterFormErrorsByPrefix, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
4
+ import { addValueInArray, clearValueInArray, copyEntity2Form, disableControl, disableControls, enableControl, enableControls, filterFormErrors, filterFormErrorsByPath, filterFormErrorsByPrefix, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
5
5
  export declare type IAppFormGetter = () => IAppForm;
6
6
  export declare interface OnReady {
7
7
  ngOnReady(): any;
@@ -209,6 +209,9 @@ export declare class AppFormUtils {
209
209
  static logFormErrors: typeof logFormErrors;
210
210
  static getControlFromPath: typeof getControlFromPath;
211
211
  static filterNumberInput: typeof filterNumberInput;
212
+ static enabledControls: typeof enableControls;
213
+ static enabledControl: typeof enableControl;
214
+ static disableControl: typeof disableControl;
212
215
  static disableControls: typeof disableControls;
213
216
  static selectInputContent: typeof selectInputContent;
214
217
  /**
@@ -0,0 +1,27 @@
1
+ import { PropertiesMap, Property } from '../../../shared/types';
2
+ export declare class AppPropertiesUtils {
3
+ /**
4
+ * Converts an array of Property objects to an object map.
5
+ *
6
+ * @param {Property[]} [sources] - The array of Property objects to convert.
7
+ * @param {Object} [opts] - Options for the conversion.
8
+ * @param {boolean} [opts.omitNilOrBlank] - If set to true, properties with nil or blank values will be omitted from the resulting object.
9
+ * @return {PropertiesMap} The resulting object map where keys are property keys and values are property values.
10
+ */
11
+ static arrayAsObject(sources?: Property[], opts?: {
12
+ omitNilOrBlank: boolean;
13
+ }): PropertiesMap;
14
+ /**
15
+ * Converts an object into an array of properties.
16
+ *
17
+ * @param {PropertiesMap} [source] - The source object containing properties to convert.
18
+ * @return {Property[]} An array of properties derived from the source object.
19
+ */
20
+ static arrayFromObject<T = any>(source?: PropertiesMap): Property[];
21
+ }
22
+ export declare class AppPropertyUtils {
23
+ static asObject(source: Property | any): {
24
+ key: string;
25
+ value: string;
26
+ } | undefined;
27
+ }
@@ -1,9 +1,10 @@
1
1
  import { Moment } from 'moment';
2
2
  import { getPropertyByPath } from '../../../shared/functions';
3
- import { FilterFn, ObjectMap, ObjectMapEntry, PropertiesArray, PropertiesMap } from '../../../shared/types';
3
+ import { FilterFn, ObjectMap, ObjectMapEntry } from '../../../shared/types';
4
4
  import { StoreObject } from '@apollo/client/core';
5
5
  import { TreeItemEntityUtils } from './tree-item-entity.model';
6
6
  import { SortDirection } from '@angular/material/sort';
7
+ import { AppPropertiesUtils } from '../../form/properties/properties.utils';
7
8
  export declare interface Cloneable<T> {
8
9
  clone(): T;
9
10
  }
@@ -49,7 +50,7 @@ export declare abstract class EntityUtils {
49
50
  static getPropertyByPath: typeof getPropertyByPath;
50
51
  static getArrayAsMap<T = any>(source?: ObjectMapEntry<T>[]): ObjectMap<T>;
51
52
  static getMapAsArray<T = any>(source?: ObjectMap<T>): ObjectMapEntry<T>[];
52
- static getPropertyArrayAsObject(source?: PropertiesArray): PropertiesMap;
53
+ static getPropertyArrayAsObject: typeof AppPropertiesUtils.arrayAsObject;
53
54
  static copyIdAndUpdateDate<T extends Entity<any, any, any>>(source: T, target: T): void;
54
55
  static fillLocalIds<T extends IEntity<T>>(items: T[], sequenceFactory: (firstEntity: T, incrementSize: number) => Promise<number>): Promise<void>;
55
56
  static cleanIdAndUpdateDate<T extends IEntity<T>>(source: T): void;
@@ -3,6 +3,7 @@ export declare class Peer extends Entity<Peer> implements Cloneable<Peer> {
3
3
  static fromObject: (source: any, opts?: any) => Peer;
4
4
  static parseUrl(peerUrl: string): Peer;
5
5
  static path(peer: Peer, ...paths: string[]): string;
6
+ static equals(p1: Peer, p2: Peer): boolean;
6
7
  dns: string;
7
8
  ipv4: string;
8
9
  ipv6: string;
@@ -37,6 +37,25 @@ export declare function disableControls(form: UntypedFormGroup, paths: string[],
37
37
  onlySelf?: boolean;
38
38
  emitEvent?: boolean;
39
39
  }): void;
40
+ export declare function enableControls(form: UntypedFormGroup, paths: string[], opts?: {
41
+ onlySelf?: boolean;
42
+ emitEvent?: boolean;
43
+ }): void;
44
+ export declare function enableControl(control: AbstractControl, opts?: {
45
+ onlySelf?: boolean;
46
+ emitEvent?: boolean;
47
+ required?: boolean;
48
+ }): void;
49
+ export declare function disableControl(control: AbstractControl, opts?: {
50
+ onlySelf?: boolean;
51
+ emitEvent?: boolean;
52
+ required?: boolean;
53
+ }): void;
54
+ export declare function setControlEnabled(control: AbstractControl, enabled: boolean, opts?: {
55
+ required?: boolean;
56
+ onlySelf?: boolean;
57
+ emitEvent?: boolean;
58
+ }): void;
40
59
  export declare function addValueInArray(arrayControl: UntypedFormArray, createControl: (value?: any) => AbstractControl, equals: (v1: any, v2: any) => boolean, isEmpty: (value: any) => boolean, value: any, options?: {
41
60
  emitEvent: boolean;
42
61
  insertAt?: number;
@@ -1,3 +1,4 @@
1
+ import { InjectionToken } from '@angular/core';
1
2
  import { EventManager } from '@angular/platform-browser';
2
3
  import { Observable } from 'rxjs';
3
4
  import { ModalController, PopoverController } from '@ionic/angular';
@@ -10,6 +11,17 @@ interface Options {
10
11
  keys: string;
11
12
  preventDefault: boolean;
12
13
  }
14
+ export interface HotKeysConfig {
15
+ /**
16
+ * Shortcut to open the hotkeys help modal
17
+ */
18
+ openHelpModalShortcut: string;
19
+ /**
20
+ * Enable the hotkeys help modal
21
+ */
22
+ enableHelpModal: boolean;
23
+ }
24
+ export declare const APP_HOTKEYS_CONFIG: InjectionToken<Partial<HotKeysConfig>>;
13
25
  export declare class Hotkeys {
14
26
  private eventManager;
15
27
  private dialog;
@@ -19,10 +31,12 @@ export declare class Hotkeys {
19
31
  private _hotkeys;
20
32
  private _document;
21
33
  private _defaults;
22
- constructor(eventManager: EventManager, dialog: MatDialog, modalController: ModalController, popoverController: PopoverController);
34
+ private _dialogRef;
35
+ private _config;
36
+ constructor(eventManager: EventManager, dialog: MatDialog, modalController: ModalController, popoverController: PopoverController, config?: Partial<HotKeysConfig>);
23
37
  addShortcut(options: Partial<Options>): Observable<KeyboardEvent>;
24
38
  openHelpModal(): void;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<Hotkeys, never>;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<Hotkeys, [null, null, null, null, { optional: true; }]>;
26
40
  static ɵprov: i0.ɵɵInjectableDeclaration<Hotkeys>;
27
41
  }
28
42
  export {};
@@ -28,6 +28,8 @@ export declare class SharedValidators {
28
28
  pattern: string;
29
29
  unique: string;
30
30
  entity: string;
31
+ invalid: string;
32
+ inconsistent: string;
31
33
  equals: string;
32
34
  };
33
35
  static latitude(control: UntypedFormControl): ValidationErrors | null;
@@ -583,6 +583,7 @@
583
583
  "FIELD_MAXIMUM_DECIMALS": "Too many decimals ({{maxDecimals}} max)",
584
584
  "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb decimals > {{maxDecimals}}",
585
585
  "FIELD_INVALID": "Invalid value",
586
+ "FIELD_INCONSISTENT": "Inconsistent value",
586
587
  "FIELD_NOT_VALID_DECIMAL": "Expected decimal value",
587
588
  "FIELD_NOT_VALID_INTEGER": "Expected integer value",
588
589
  "FIELD_NOT_VALID_PRECISION": "Expected precision: {{precision}}",
@@ -582,6 +582,7 @@
582
582
  "FIELD_MAXIMUM_DECIMALS": "Too many decimals ({{maxDecimals}} max)",
583
583
  "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb decimals > {{maxDecimals}}",
584
584
  "FIELD_INVALID": "Invalid value",
585
+ "FIELD_INCONSISTENT": "Inconsistent value",
585
586
  "FIELD_NOT_VALID_DECIMAL": "Expected decimal value",
586
587
  "FIELD_NOT_VALID_INTEGER": "Expected integer value",
587
588
  "FIELD_NOT_VALID_PRECISION": "Expected precision: {{precision}}",
@@ -583,6 +583,7 @@
583
583
  "FIELD_MAXIMUM_DECIMALS": "Trop de décimales (max : {{maxDecimals}})",
584
584
  "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb décimale > {{maxDecimals}}",
585
585
  "FIELD_INVALID": "Valeur non valide",
586
+ "FIELD_INCONSISTENT": "Valeur incohérente",
586
587
  "FIELD_NOT_VALID_DECIMAL": "Valeur décimale attendue",
587
588
  "FIELD_NOT_VALID_INTEGER": "Valeur entière attendue",
588
589
  "FIELD_NOT_VALID_PRECISION": "Précision minimale : {{precision}}",
@@ -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.18.0-beta1",
5
+ "version": "2.18.0-beta11",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{