@sumaris-net/ngx-components 18.0.0 → 18.0.1-0.alpha1

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 (122) hide show
  1. package/doc/build.md +13 -11
  2. package/doc/changelog.md +42 -5
  3. package/esm2022/public_api.mjs +4 -2
  4. package/esm2022/src/app/admin/services/filter/person.filter.mjs +10 -3
  5. package/esm2022/src/app/admin/services/person.service.mjs +11 -5
  6. package/esm2022/src/app/admin/users/users.mjs +2 -2
  7. package/esm2022/src/app/core/about/about.modal.mjs +6 -4
  8. package/esm2022/src/app/core/about/about.module.mjs +5 -4
  9. package/esm2022/src/app/core/account/account.page.mjs +5 -6
  10. package/esm2022/src/app/core/account/token.table.mjs +10 -6
  11. package/esm2022/src/app/core/form/buttons/form-buttons-bar.component.mjs +5 -5
  12. package/esm2022/src/app/core/form/properties/properties.form.mjs +110 -57
  13. package/esm2022/src/app/core/form/properties/properties.utils.mjs +264 -32
  14. package/esm2022/src/app/core/form/properties/property.validator.mjs +36 -4
  15. package/esm2022/src/app/core/form/properties/testing/properties-form.test.mjs +26 -18
  16. package/esm2022/src/app/core/graphql/graphql.service.mjs +1 -1
  17. package/esm2022/src/app/core/home/home.module.mjs +2 -2
  18. package/esm2022/src/app/core/menu/menu.component.mjs +3 -3
  19. package/esm2022/src/app/core/menu/menu.module.mjs +2 -2
  20. package/esm2022/src/app/core/menu/menu.service.mjs +5 -4
  21. package/esm2022/src/app/core/register/register.form.mjs +1 -1
  22. package/esm2022/src/app/core/services/base-entity-service.class.mjs +1 -1
  23. package/esm2022/src/app/core/services/config/core.config.mjs +6 -1
  24. package/esm2022/src/app/core/services/local-settings.service.mjs +17 -8
  25. package/esm2022/src/app/core/services/model/config.model.mjs +1 -1
  26. package/esm2022/src/app/core/services/model/entity.model.mjs +2 -2
  27. package/esm2022/src/app/core/services/model/settings.model.mjs +1 -1
  28. package/esm2022/src/app/core/services/storage/entities-storage.service.mjs +1 -1
  29. package/esm2022/src/app/core/services/storage/entity-store.class.mjs +1 -1
  30. package/esm2022/src/app/core/services/validator/local-settings.validator.mjs +4 -24
  31. package/esm2022/src/app/core/settings/settings.page.mjs +51 -16
  32. package/esm2022/src/app/core/table/column/row-field.component.mjs +1 -1
  33. package/esm2022/src/app/core/table/testing/table.testing.mjs +1 -1
  34. package/esm2022/src/app/core/table/testing/table2.testing.mjs +1 -1
  35. package/esm2022/src/app/shared/debug/debug.component.mjs +10 -6
  36. package/esm2022/src/app/shared/form/field.component.mjs +39 -31
  37. package/esm2022/src/app/shared/form/field.model.mjs +59 -2
  38. package/esm2022/src/app/shared/functions.mjs +6 -3
  39. package/esm2022/src/app/shared/hotkeys/dialog/hotkeys-dialog.component.mjs +1 -1
  40. package/esm2022/src/app/shared/hotkeys/hotkeys.service.mjs +51 -17
  41. package/esm2022/src/app/shared/image/gallery/image-gallery.module.mjs +2 -2
  42. package/esm2022/src/app/shared/image/gallery/testing/gallery.testing.mjs +1 -1
  43. package/esm2022/src/app/shared/material/autocomplete/material.autocomplete.config.mjs +1 -1
  44. package/esm2022/src/app/shared/material/autocomplete/material.autocomplete.mjs +11 -4
  45. package/esm2022/src/app/shared/material/autocomplete/material.autocomplete.module.mjs +2 -2
  46. package/esm2022/src/app/shared/material/autocomplete/testing/autocomplete.test.mjs +18 -8
  47. package/esm2022/src/app/shared/material/chips/chips.module.mjs +2 -2
  48. package/esm2022/src/app/shared/material/chips/material.chips.mjs +4 -3
  49. package/esm2022/src/app/shared/material/latlong/material.latlong.mjs +33 -10
  50. package/esm2022/src/app/shared/named-filter/named-filter-selector.component.mjs +1 -1
  51. package/esm2022/src/app/shared/pipes/display-with.pipe.mjs +23 -0
  52. package/esm2022/src/app/shared/pipes/pipes.module.mjs +7 -3
  53. package/esm2022/src/app/shared/pipes/property.pipes.mjs +30 -31
  54. package/esm2022/src/app/shared/platforms.mjs +12 -4
  55. package/esm2022/src/app/shared/rx-state/rx-state.decorators.mjs +71 -0
  56. package/esm2022/src/app/shared/rx-state/rx-state.module.mjs +19 -0
  57. package/esm2022/src/app/shared/services/entity-service.class.mjs +1 -1
  58. package/esm2022/src/app/shared/services.mjs +34 -18
  59. package/esm2022/src/app/shared/shared.module.mjs +2 -2
  60. package/esm2022/src/app/shared/storage/storage-explorer.module.mjs +2 -2
  61. package/esm2022/src/app/shared/toolbar/modal-toolbar.mjs +2 -2
  62. package/esm2022/src/app/shared/toolbar/toolbar.module.mjs +2 -2
  63. package/esm2022/src/app/shared/types.mjs +1 -1
  64. package/esm2022/src/app/social/user-event/user-event.module.mjs +2 -2
  65. package/esm2022/src/environments/environment.mjs +3 -6
  66. package/fesm2022/sumaris-net.ngx-components.mjs +1429 -805
  67. package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
  68. package/package.json +5 -2
  69. package/public_api.d.ts +3 -1
  70. package/src/app/admin/services/filter/person.filter.d.ts +1 -0
  71. package/src/app/admin/services/person.service.d.ts +8 -6
  72. package/src/app/core/about/about.modal.d.ts +1 -1
  73. package/src/app/core/about/about.module.d.ts +2 -1
  74. package/src/app/core/account/token.table.d.ts +1 -1
  75. package/src/app/core/form/properties/properties.form.d.ts +28 -11
  76. package/src/app/core/form/properties/properties.utils.d.ts +41 -13
  77. package/src/app/core/form/properties/property.validator.d.ts +8 -0
  78. package/src/app/core/form/properties/testing/properties-form.test.d.ts +6 -3
  79. package/src/app/core/graphql/graphql.service.d.ts +2 -2
  80. package/src/app/core/home/home.module.d.ts +1 -1
  81. package/src/app/core/menu/menu.module.d.ts +1 -1
  82. package/src/app/core/services/base-entity-service.class.d.ts +1 -1
  83. package/src/app/core/services/config/core.config.d.ts +1 -0
  84. package/src/app/core/services/local-settings.service.d.ts +3 -1
  85. package/src/app/core/services/model/config.model.d.ts +2 -2
  86. package/src/app/core/services/model/entity.model.d.ts +2 -2
  87. package/src/app/core/services/model/settings.model.d.ts +2 -2
  88. package/src/app/core/services/storage/entities-storage.service.d.ts +4 -4
  89. package/src/app/core/services/storage/entity-store.class.d.ts +4 -4
  90. package/src/app/core/services/validator/local-settings.validator.d.ts +3 -7
  91. package/src/app/core/settings/settings.page.d.ts +4 -1
  92. package/src/app/shared/debug/debug.component.d.ts +2 -1
  93. package/src/app/shared/form/field.component.d.ts +14 -5
  94. package/src/app/shared/form/field.model.d.ts +44 -1
  95. package/src/app/shared/functions.d.ts +1 -0
  96. package/src/app/shared/hotkeys/hotkeys.service.d.ts +10 -3
  97. package/src/app/shared/image/gallery/image-gallery.module.d.ts +1 -1
  98. package/src/app/shared/material/autocomplete/material.autocomplete.config.d.ts +2 -2
  99. package/src/app/shared/material/autocomplete/material.autocomplete.d.ts +4 -1
  100. package/src/app/shared/material/autocomplete/material.autocomplete.module.d.ts +1 -1
  101. package/src/app/shared/material/chips/chips.module.d.ts +1 -1
  102. package/src/app/shared/material/chips/material.chips.d.ts +1 -0
  103. package/src/app/shared/material/latlong/material.latlong.d.ts +3 -0
  104. package/src/app/shared/pipes/display-with.pipe.d.ts +8 -0
  105. package/src/app/shared/pipes/pipes.module.d.ts +5 -4
  106. package/src/app/shared/pipes/property.pipes.d.ts +3 -9
  107. package/src/app/shared/platforms.d.ts +3 -0
  108. package/src/app/shared/rx-state/rx-state.decorators.d.ts +7 -0
  109. package/src/app/shared/services/entity-service.class.d.ts +2 -0
  110. package/src/app/shared/services.d.ts +8 -1
  111. package/src/app/shared/shared.module.d.ts +1 -1
  112. package/src/app/shared/storage/storage-explorer.module.d.ts +1 -1
  113. package/src/app/shared/toolbar/toolbar.module.d.ts +1 -1
  114. package/src/app/shared/types.d.ts +11 -6
  115. package/src/app/social/user-event/user-event.module.d.ts +1 -1
  116. package/src/assets/i18n/en-US.json +14 -2
  117. package/src/assets/i18n/en.json +13 -1
  118. package/src/assets/i18n/fr.json +11 -1
  119. package/src/assets/manifest.json +1 -1
  120. package/src/theme/_ngx-components.scss +2 -4
  121. package/esm2022/src/app/shared/rx-state.module.mjs +0 -19
  122. /package/src/app/shared/{rx-state.module.d.ts → rx-state/rx-state.module.d.ts} +0 -0
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": "18.0.0",
4
+ "version": "18.0.10.alpha1",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -58,7 +58,10 @@
58
58
  "clovelced-plugin-audiomanagement": "~1.0.2",
59
59
  "cordova-sqlite-storage": "~6.0.0",
60
60
  "integrator-cordova-plugin-downloader": "~1.1.0",
61
- "localforage-cordovasqlitedriver": "~1.8.0"
61
+ "localforage-cordovasqlitedriver": "~1.8.0",
62
+ "clipboard": "^2.0.11",
63
+ "emoji-toolkit": ">= 8.0.0 < 10.0.0",
64
+ "prismjs": "^1.28.0"
62
65
  },
63
66
  "repository": {
64
67
  "type": "git",
package/public_api.d.ts CHANGED
@@ -3,7 +3,8 @@ export * from './src/environments/environment.loader';
3
3
  export * from './src/app/shared/constants';
4
4
  export * from './src/app/shared/shared.module';
5
5
  export { SharedRoutingModule } from './src/app/shared/shared-routing.module';
6
- export { RxStateModule } from './src/app/shared/rx-state.module';
6
+ export { RxStateModule } from './src/app/shared/rx-state/rx-state.module';
7
+ export * from './src/app/shared/rx-state/rx-state.decorators';
7
8
  export * from './src/app/shared/material/material.module';
8
9
  export * from './src/app/shared/material/material.config';
9
10
  export * from './src/app/shared/material/material.animations';
@@ -87,6 +88,7 @@ export * from './src/app/shared/pipes/maskito.pipe';
87
88
  export * from './src/app/shared/pipes/selection.pipes';
88
89
  export * from './src/app/shared/pipes/badge.pipes';
89
90
  export * from './src/app/shared/pipes/html.pipes';
91
+ export * from './src/app/shared/pipes/display-with.pipe';
90
92
  export * from './src/app/shared/services';
91
93
  export * from './src/app/shared/audio/audio';
92
94
  export * from './src/app/shared/file/file.service';
@@ -11,6 +11,7 @@ export declare class PersonFilter extends EntityFilter<PersonFilter, Person> {
11
11
  searchText: string;
12
12
  statusIds: number[];
13
13
  userProfiles: string[];
14
+ includedIds: number[];
14
15
  excludedIds: number[];
15
16
  searchAttribute: string;
16
17
  searchAttributes: string[];
@@ -5,7 +5,7 @@ import { NetworkService } from '../../core/services/network.service';
5
5
  import { EntitiesStorage } from '../../core/services/storage/entities-storage.service';
6
6
  import { Person } from '../../core/services/model/person.model';
7
7
  import { SortDirection } from '@angular/material/sort';
8
- import { LoadResult, SuggestService } from '../../shared/services/entity-service.class';
8
+ import { EntitiesServiceLoadOptions, LoadResult, SuggestService } from '../../shared/services/entity-service.class';
9
9
  import { PlatformService } from '../../core/services/platform.service';
10
10
  import { PersonFilter } from './filter/person.filter';
11
11
  import { BaseEntityService } from '../../core/services/base-entity-service.class';
@@ -19,12 +19,9 @@ export declare class PersonService extends BaseEntityService<Person, PersonFilte
19
19
  protected network: NetworkService;
20
20
  protected entities: EntitiesStorage;
21
21
  constructor(graphql: GraphqlService, platform: PlatformService, network: NetworkService, entities: EntitiesStorage);
22
- loadAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<PersonFilter>, opts?: {
22
+ loadAll(offset: number, size: number, sortBy?: keyof Person | string, sortDirection?: SortDirection, filter?: Partial<PersonFilter>, opts?: EntitiesServiceLoadOptions & {
23
23
  [key: string]: any;
24
- fetchPolicy?: FetchPolicy;
25
24
  debug?: boolean;
26
- withTotal?: boolean;
27
- toEntity?: boolean;
28
25
  }): Promise<LoadResult<Person>>;
29
26
  loadAllLocally(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<PersonFilter>, opts?: {
30
27
  [key: string]: any;
@@ -33,11 +30,16 @@ export declare class PersonService extends BaseEntityService<Person, PersonFilte
33
30
  withTotal?: boolean;
34
31
  toEntity?: boolean;
35
32
  }): Promise<LoadResult<Person>>;
36
- suggest(value: any, filter?: PersonFilter, sortBy?: string, sortDirection?: SortDirection): Promise<LoadResult<Person>>;
33
+ suggest(value: any, filter?: Partial<PersonFilter>, sortBy?: keyof Person | string, sortDirection?: SortDirection, opts?: EntitiesServiceLoadOptions): Promise<LoadResult<Person>>;
37
34
  executeImport(filter: Partial<PersonFilter>, opts: {
38
35
  progression?: BehaviorSubject<number>;
39
36
  maxProgression?: number;
40
37
  }): Promise<void>;
38
+ loadById(id: number, opts?: {
39
+ [key: string]: any;
40
+ fetchPolicy?: FetchPolicy;
41
+ toEntity?: boolean;
42
+ }): Promise<Person>;
41
43
  loadByPubkey(pubkey: string, opts?: {
42
44
  [key: string]: any;
43
45
  fetchPolicy?: FetchPolicy;
@@ -18,8 +18,8 @@ export declare class AboutModal implements OnDestroy {
18
18
  readonly name: string;
19
19
  readonly version: string;
20
20
  readonly sourceUrl: string;
21
- readonly reportIssueUrl: string;
22
21
  readonly config$: Observable<Configuration>;
22
+ reportIssueUrl: string;
23
23
  forumUrl: string;
24
24
  helpUrl: string;
25
25
  private readonly _subscription;
@@ -3,8 +3,9 @@ import * as i1 from "./about.modal";
3
3
  import * as i2 from "../../shared/shared.module";
4
4
  import * as i3 from "@ionic/angular";
5
5
  import * as i4 from "@ngx-translate/core";
6
+ import * as i5 from "ngx-markdown";
6
7
  export declare class AppAboutModalModule {
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<AppAboutModalModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<AppAboutModalModule, [typeof i1.AboutModal], [typeof i2.SharedModule, typeof i3.IonicModule, typeof i4.TranslateModule], [typeof i4.TranslateModule, typeof i1.AboutModal]>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AppAboutModalModule, [typeof i1.AboutModal], [typeof i2.SharedModule, typeof i3.IonicModule, typeof i4.TranslateModule, typeof i5.MarkdownModule], [typeof i4.TranslateModule, typeof i1.AboutModal]>;
9
10
  static ɵinj: i0.ɵɵInjectorDeclaration<AppAboutModalModule>;
10
11
  }
@@ -8,10 +8,10 @@ import { Configuration } from '../services/model/config.model';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare class UserTokenTable extends AppInMemoryTable<UserToken> implements OnInit {
10
10
  protected configService: ConfigService;
11
- protected tokenScopes: TokenScope[];
12
11
  useSticky: boolean;
13
12
  protected showScopes: boolean;
14
13
  protected defaultScope: string;
14
+ protected tokenScopes: TokenScope[];
15
15
  constructor(injector: Injector, validatorService: ValidatorService, configService: ConfigService, environment: Environment, tokenScopes: TokenScope[]);
16
16
  ngOnInit(): void;
17
17
  get value(): UserToken[];
@@ -4,28 +4,38 @@ import { FormFieldDefinition, FormFieldDefinitionMap } from '../../../shared/for
4
4
  import { DateAdapter, ThemePalette } from '@angular/material/core';
5
5
  import { Moment } from 'moment';
6
6
  import { AppForm } from '../form.class';
7
- import { Property } from '../../../shared/types';
7
+ import { Property, PropertyMap } from '../../../shared/types';
8
8
  import { PropertyValidator } from './property.validator';
9
9
  import { PredefinedColors } from '@ionic/core';
10
10
  import { FormArrayHelper, FormArrayHelperOptions } from '../array/form-array';
11
11
  import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';
12
12
  import { MatAutocompleteFieldConfig } from '../../../shared/material/autocomplete/material.autocomplete.config';
13
13
  import { LoadResult } from '../../../shared/services/entity-service.class';
14
+ import { RxState } from '@rx-angular/state';
14
15
  import * as i0 from "@angular/core";
15
- export declare class AppPropertiesForm<T = Property> extends AppForm<T[]> implements OnInit {
16
+ export interface AppPropertiesFormState {
17
+ definitions: FormFieldDefinition[];
18
+ definitionKeys: Property[];
19
+ }
20
+ export declare class AppPropertiesForm<O = any, T extends Property<O> = Property<O>, S extends AppPropertiesFormState = AppPropertiesFormState> extends AppForm<T[]> implements OnInit {
21
+ protected injector: Injector;
16
22
  protected formBuilder: UntypedFormBuilder;
17
23
  protected dateAdapter: DateAdapter<Moment>;
18
24
  protected cd: ChangeDetectorRef;
19
25
  protected validator: PropertyValidator;
20
26
  private formGroupDir;
21
- protected _definitions: FormFieldDefinition[];
22
- protected _options: Property[];
23
- protected _definitionsMapByKey: FormFieldDefinitionMap;
27
+ protected readonly _state: RxState<S>;
28
+ protected _definitions$: import("rxjs").Observable<S["definitions"]>;
29
+ protected _definitionKeys$: import("rxjs").Observable<S["definitionKeys"]>;
30
+ protected set _definitionKeys(value: Property[]);
31
+ protected get _definitionKeys(): Property[];
32
+ protected _definitionByKey: FormFieldDefinitionMap;
24
33
  protected _definitionsByIndex: {
25
34
  [index: number]: FormFieldDefinition;
26
35
  };
27
36
  protected _helper: FormArrayHelper<Property>;
28
37
  protected _autocompleteConfig: MatAutocompleteFieldConfig;
38
+ protected _focusedControlIndex: number;
29
39
  formArrayName: string;
30
40
  formArray: UntypedFormArray;
31
41
  options: FormArrayHelperOptions;
@@ -36,8 +46,15 @@ export declare class AppPropertiesForm<T = Property> extends AppForm<T[]> implem
36
46
  showHintKey: boolean;
37
47
  hintKeyPrefix: string;
38
48
  showMoreButton: boolean;
39
- showMoreButtonTitle: string;
49
+ addButtonText: string;
50
+ addButtonTitle: string;
40
51
  showAddButton: boolean;
52
+ /**
53
+ * @deprecated Use addButtonTitle instead
54
+ * @param value
55
+ */
56
+ set showMoreButtonTitle(value: string);
57
+ get showMoreButtonTitle(): string;
41
58
  set definitions(value: FormFieldDefinition[]);
42
59
  get definitions(): FormFieldDefinition[];
43
60
  set value(data: T[]);
@@ -46,19 +63,19 @@ export declare class AppPropertiesForm<T = Property> extends AppForm<T[]> implem
46
63
  get fieldForms(): UntypedFormGroup[];
47
64
  constructor(injector: Injector, formBuilder: UntypedFormBuilder, dateAdapter: DateAdapter<Moment>, cd: ChangeDetectorRef, validator: PropertyValidator, formGroupDir: FormGroupDirective);
48
65
  ngOnInit(): void;
49
- protected updateDefinitionsMaps(): void;
66
+ protected processDefinitions(definitions: FormFieldDefinition[]): FormFieldDefinition[];
50
67
  getDefinitionAt(index: number): FormFieldDefinition;
51
68
  updateDefinitionAt(index: number, opts?: {
52
69
  emitEvent?: boolean;
53
70
  }): FormFieldDefinition;
54
71
  removeAt(index: number): void;
55
- isUnknownField(fieldForm: UntypedFormGroup): boolean;
56
- setValue(data: T[] | any): void;
72
+ setValue(data: PropertyMap | T[]): Promise<void>;
73
+ getValueAsJson(): PropertyMap;
57
74
  protected suggestDefinition(value: any, filter?: any): Promise<LoadResult<Property>>;
58
75
  protected markForCheck(): void;
59
76
  protected isEmptyProperty(obj: Property): boolean;
60
- static ɵfac: i0.ɵɵFactoryDeclaration<AppPropertiesForm<any>, [null, null, null, null, null, { optional: true; }]>;
61
- static ɵcmp: i0.ɵɵComponentDeclaration<AppPropertiesForm<any>, "app-properties-form", never, { "formArrayName": { "alias": "formArrayName"; "required": false; }; "formArray": { "alias": "formArray"; "required": false; }; "options": { "alias": "options"; "required": false; }; "chipColor": { "alias": "chipColor"; "required": false; }; "mobile": { "alias": "mobile"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "subscriptSizing": { "alias": "subscriptSizing"; "required": false; }; "showHintKey": { "alias": "showHintKey"; "required": false; }; "hintKeyPrefix": { "alias": "hintKeyPrefix"; "required": false; }; "showMoreButton": { "alias": "showMoreButton"; "required": false; }; "showMoreButtonTitle": { "alias": "showMoreButtonTitle"; "required": false; }; "showAddButton": { "alias": "showAddButton"; "required": false; }; "definitions": { "alias": "definitions"; "required": false; }; }, {}, never, never, false, never>;
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppPropertiesForm<any, any, any>, [null, null, null, null, null, { optional: true; }]>;
78
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppPropertiesForm<any, any, any>, "app-properties-form", never, { "formArrayName": { "alias": "formArrayName"; "required": false; }; "formArray": { "alias": "formArray"; "required": false; }; "options": { "alias": "options"; "required": false; }; "chipColor": { "alias": "chipColor"; "required": false; }; "mobile": { "alias": "mobile"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "subscriptSizing": { "alias": "subscriptSizing"; "required": false; }; "showHintKey": { "alias": "showHintKey"; "required": false; }; "hintKeyPrefix": { "alias": "hintKeyPrefix"; "required": false; }; "showMoreButton": { "alias": "showMoreButton"; "required": false; }; "addButtonText": { "alias": "addButtonText"; "required": false; }; "addButtonTitle": { "alias": "addButtonTitle"; "required": false; }; "showAddButton": { "alias": "showAddButton"; "required": false; }; "showMoreButtonTitle": { "alias": "showMoreButtonTitle"; "required": false; }; "definitions": { "alias": "definitions"; "required": false; }; }, {}, never, never, false, never>;
62
79
  static ngAcceptInputType_mobile: unknown;
63
80
  static ngAcceptInputType_showHintKey: unknown;
64
81
  static ngAcceptInputType_showMoreButton: unknown;
@@ -1,27 +1,55 @@
1
- import { PropertiesMap, Property } from '../../../shared/types';
1
+ import { Property, PropertyMap } from '../../../shared/types';
2
+ import { FormFieldDefinition } from '../../../shared/form/field.model';
3
+ import { EntitiesServiceLoadOptions, SuggestFn } from '../../../shared/services/entity-service.class';
2
4
  export declare class AppPropertiesUtils {
3
5
  /**
4
- * Converts an array of Property objects to an object map.
6
+ * Converts an array of `Property` objects into a `PropertiesMap` object.
5
7
  *
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.
8
+ * @param {Property[]} [sources] - An optional array of properties to be converted.
9
+ * @param {FormFieldDefinition[]} [definitions] - An optional array of form field definitions to help with the conversion.
10
+ * @param {Object} [opts] - Optional configurations.
11
+ * @param {boolean} [opts.omitNilOrBlank] - If true, properties with nil or blank values will be omitted. Defaults to true.
12
+ * @return {PropertyMap} - The resulting `PropertiesMap` object.
10
13
  */
11
- static arrayAsObject(sources?: Property[], opts?: {
14
+ static arrayAsObject<T = any>(sources?: Property<T>[], definitions?: FormFieldDefinition[], opts?: {
12
15
  omitNilOrBlank: boolean;
13
- }): PropertiesMap;
16
+ }): PropertyMap;
14
17
  /**
15
- * Converts an object into an array of properties.
18
+ * Generates an array of properties from the given object, optionally applying definitions to the properties.
16
19
  *
17
- * @param {PropertiesMap} [source] - The source object containing properties to convert.
18
- * @return {Property[]} An array of properties derived from the source object.
20
+ * @param {PropertyMap} [sources] - The source object from which properties are to be extracted.
21
+ * @param {FormFieldDefinition[]} [definitions] - An optional array of definitions to be applied to the extracted properties.
22
+ * @param opts
23
+ * @return {Property[] | Promise<Property[]>} An array of properties generated from the source object, or a promise resolving to that array.
19
24
  */
20
- static arrayFromObject<T = any>(source?: PropertiesMap): Property[];
25
+ static arrayFromObject<T>(sources?: PropertyMap | Property<T>[], definitions?: FormFieldDefinition[], opts?: {
26
+ keepOrphan?: boolean;
27
+ }): Property<T>[] | Promise<Property<T>[]>;
21
28
  }
22
29
  export declare class AppPropertyUtils {
23
- static asObject(source: Property | any): {
30
+ static key(key: any): string;
31
+ static getPropertyKey(source: Property | any): string;
32
+ /**
33
+ * Converts the given source to an object that contains a key-value pair.
34
+ *
35
+ * @param {Property<any> | any} source - The source property or any value to be converted.
36
+ * @param {FormFieldDefinition} [def] - The form field definition used for serialization.
37
+ * @param {Object} [opts] - Additional options for serialization.
38
+ * @param {string} [opts.defaultSerializeAttribute='id'] - The attribute to be used for default serialization.
39
+ * @return {{ key: string, value: string } | undefined} An object containing the serialized key-value pair, or undefined if the source is not provided.
40
+ */
41
+ static asObject(source: Property<any> | any, def?: FormFieldDefinition, opts?: {
42
+ defaultSerializeAttribute?: string;
43
+ }): {
24
44
  key: string;
25
45
  value: string;
26
46
  } | undefined;
47
+ static fromObject<T = string>(source: Property | Property<T>, def: FormFieldDefinition, opts?: {
48
+ defaultSuggestFn: SuggestFn<any, any>;
49
+ defaultSuggestOptions?: EntitiesServiceLoadOptions;
50
+ defaultSerializeAttribute?: string;
51
+ }): Property<T> | Promise<Property<T>>;
52
+ private static resolveEntity;
53
+ private static resolveEntityBySuggest;
54
+ private static toString;
27
55
  }
@@ -1,13 +1,21 @@
1
1
  import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
2
2
  import { Property } from '../../../shared/types';
3
3
  import { AppValidatorService } from '../../services/validator/base.validator.class';
4
+ import { FormFieldDefinition } from '../../../shared/form/field.model';
5
+ import { AppFormArray } from '../array/form-array';
4
6
  import * as i0 from "@angular/core";
5
7
  export interface PropertyValidatorOptions {
8
+ definition?: FormFieldDefinition;
9
+ valueMaxLength?: number;
10
+ }
11
+ export interface PropertiesValidatorOptions {
12
+ definitions?: FormFieldDefinition[];
6
13
  valueMaxLength?: number;
7
14
  }
8
15
  export declare class PropertyValidator extends AppValidatorService<Property> {
9
16
  protected formBuilder: UntypedFormBuilder;
10
17
  constructor(formBuilder: UntypedFormBuilder);
18
+ getFormArray(data?: any, opts?: PropertiesValidatorOptions): AppFormArray<Property, UntypedFormGroup>;
11
19
  getFormGroup(data?: Property, opts?: PropertyValidatorOptions): UntypedFormGroup;
12
20
  getFormGroupConfig(data?: Property, opts?: PropertyValidatorOptions): {
13
21
  [p: string]: any;
@@ -3,17 +3,20 @@ import { FormFieldDefinition } from '../../../../shared/form/field.model';
3
3
  import { AppPropertiesForm } from '../properties.form';
4
4
  import { LoadResult } from '../../../../shared/services/entity-service.class';
5
5
  import { FormBuilder, FormGroup } from '@angular/forms';
6
+ import { PropertyValidator } from '../property.validator';
7
+ import { SortDirection } from '@angular/material/sort';
6
8
  import * as i0 from "@angular/core";
7
9
  export declare class PropertiesFormTestPage implements OnInit, AfterViewInit {
8
10
  protected formBuilder: FormBuilder;
11
+ protected pv: PropertyValidator;
9
12
  propertyDefinitions: FormFieldDefinition[];
10
13
  i18nFieldPrefix: string;
11
14
  form: FormGroup;
12
15
  propertiesForm: AppPropertiesForm;
13
- constructor(formBuilder: FormBuilder);
16
+ constructor(formBuilder: FormBuilder, pv: PropertyValidator);
14
17
  ngOnInit(): void;
15
- ngAfterViewInit(): void;
16
- protected suggestEntity(value: any, filter: any): Promise<LoadResult<any>>;
18
+ ngAfterViewInit(): Promise<void>;
19
+ protected suggestEntity(value: any, filter: any, sortBy: any | string, sortDirection: SortDirection, options: any): Promise<LoadResult<any>>;
17
20
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertiesFormTestPage, never>;
18
21
  static ɵcmp: i0.ɵɵComponentDeclaration<PropertiesFormTestPage, "app-properties-form-test", never, {}, {}, never, never, false, never>;
19
22
  }
@@ -12,7 +12,7 @@ import { HttpLink } from 'apollo-angular/http';
12
12
  import { ErrorPolicy, MutationBaseOptions } from '@apollo/client/core/watchQueryOptions';
13
13
  import { Cache } from '@apollo/client/cache/core/types/Cache';
14
14
  import { Environment } from '../../../environments/environment.class';
15
- import { PropertiesMap } from '../../shared/types';
15
+ import { PropertyMap } from '../../shared/types';
16
16
  import { StartableService } from '../../shared/services/startable-service.class';
17
17
  import { StorageService } from '../../shared/storage/storage.service';
18
18
  import { DocumentNode } from 'graphql';
@@ -133,7 +133,7 @@ export declare class GraphqlService extends StartableService<ApolloClient<any>>
133
133
  equalsFn?: (d1: T, d2: T) => boolean;
134
134
  }): void;
135
135
  clearCache(client?: ApolloClient<any>): Promise<void>;
136
- registerCustomError(error: PropertiesMap): void;
136
+ registerCustomError(error: PropertyMap): void;
137
137
  protected ngOnStart(): Promise<ApolloClient<any>>;
138
138
  protected ngOnStop(): Promise<void>;
139
139
  protected resetClient(client?: ApolloClient<any>): Promise<void>;
@@ -3,7 +3,7 @@ import * as i1 from "./home";
3
3
  import * as i2 from "../../shared/shared.module";
4
4
  import * as i3 from "@angular/router";
5
5
  import * as i4 from "@ngx-translate/core";
6
- import * as i5 from "../../shared/rx-state.module";
6
+ import * as i5 from "../../shared/rx-state/rx-state.module";
7
7
  import * as i6 from "../auth/auth.module";
8
8
  import * as i7 from "../install/install-upgrade-card.module";
9
9
  export declare class AppHomePageModule {
@@ -3,7 +3,7 @@ import * as i1 from "./menu.component";
3
3
  import * as i2 from "./sub-menu-tab.directive";
4
4
  import * as i3 from "../../shared/shared.module";
5
5
  import * as i4 from "@angular/router";
6
- import * as i5 from "../../shared/rx-state.module";
6
+ import * as i5 from "../../shared/rx-state/rx-state.module";
7
7
  import * as i6 from "@ngx-translate/core";
8
8
  export declare class AppMenuModule {
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<AppMenuModule, never>;
@@ -72,7 +72,7 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
72
72
  watch(id: number, opts?: WO): Observable<T>;
73
73
  load(id: ID, opts?: LO): Promise<T>;
74
74
  watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, dataFilter?: F, opts?: WO): Observable<LoadResult<T>>;
75
- loadAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>, opts?: LO & {
75
+ loadAll(offset: number, size: number, sortBy?: keyof T | string, sortDirection?: SortDirection, filter?: Partial<F>, opts?: LO & {
76
76
  debug?: boolean;
77
77
  }): Promise<LoadResult<T>>;
78
78
  countAll(filter?: Partial<F>, opts?: LO): Promise<number>;
@@ -20,6 +20,7 @@ export declare const CORE_CONFIG_OPTIONS: Readonly<{
20
20
  APP_MIN_VERSION: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
21
21
  HELP_URL: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
22
22
  FORUM_URL: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
23
+ REPORT_ISSUE_URL: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
23
24
  LOGO_LARGE: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
24
25
  MENU_ITEMS: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
25
26
  HOME_PARTNERS_DEPARTMENTS: FormFieldDefinition<string, import("../../../shared/form/field.model").FormFieldType, any>;
@@ -77,7 +77,9 @@ export declare class LocalSettingsService extends StartableService<LocalSettings
77
77
  getFieldDisplayAttributes(fieldName: string, defaultAttributes?: string[]): string[];
78
78
  getPageFieldDefaultValue(pageId: string, fieldName: string): any;
79
79
  get optionDefs(): FormFieldDefinition[];
80
- registerOption(def: FormFieldDefinition): void;
80
+ registerOption(def: FormFieldDefinition, opts?: {
81
+ replaceIfExists?: boolean;
82
+ }): void;
81
83
  registerOptions(defs: FormFieldDefinition[]): void;
82
84
  addToPageHistory(page: HistoryPageReference, opts?: AddToPageHistoryOptions, pageHistory?: HistoryPageReference[]): Promise<void>;
83
85
  removePageHistory(path: string, opts?: {
@@ -2,7 +2,7 @@ import { Moment } from 'moment';
2
2
  import { FormFieldDefinition } from '../../../shared/form/field.model';
3
3
  import { Entity, EntityAsObjectOptions, IEntity } from './entity.model';
4
4
  import { Department } from './department.model';
5
- import { PropertiesMap } from '../../../shared/types';
5
+ import { PropertyMap } from '../../../shared/types';
6
6
  export declare class Software<T extends Software<any> = Software<any>> extends Entity<T, number> implements IEntity<T, number> {
7
7
  static fromObject: (source: any, opts?: any) => Software;
8
8
  label: string;
@@ -11,7 +11,7 @@ export declare class Software<T extends Software<any> = Software<any>> extends E
11
11
  comments: string;
12
12
  creationDate: Date | Moment;
13
13
  statusId: number;
14
- properties: PropertiesMap;
14
+ properties: PropertyMap;
15
15
  constructor(__typename?: string);
16
16
  asObject(options?: EntityAsObjectOptions): any;
17
17
  fromObject(source: any): void;
@@ -55,8 +55,8 @@ export declare abstract class EntityUtils {
55
55
  static fillLocalIds<T extends IEntity<T>>(items: T[], sequenceFactory: (firstEntity: T, incrementSize: number) => Promise<number>): Promise<void>;
56
56
  static cleanIdAndUpdateDate<T extends IEntity<T>>(source: T): void;
57
57
  static cleanIdsAndUpdateDates<T extends IEntity<T>>(items: T[]): void;
58
- static sort<T extends IEntity<T> | any>(data: T[], sortBy?: string, sortDirection?: SortDirection): T[];
59
- static sortComparator<T extends IEntity<T> | any>(sortBy?: string, sortDirection?: SortDirection): (a: T, b: T) => number;
58
+ static sort<T extends IEntity<T> | any>(data: T[], sortBy?: keyof T | string, sortDirection?: SortDirection): T[];
59
+ static sortComparator<T extends IEntity<T> | any>(sortBy?: keyof T | string, sortDirection?: SortDirection): (a: T, b: T) => number;
60
60
  static compare<T extends IEntity<any>>(value1: T, value2: T, direction: 1 | -1, checkAttribute?: keyof T): number;
61
61
  static compareValue<T>(value1: T, value2: T, direction: 1 | -1): number;
62
62
  static filter<T extends IEntity<T> | any>(data: T[], searchAttribute: string, searchText: string): T[];
@@ -1,4 +1,4 @@
1
- import { PropertiesMap, Property } from '../../../shared/types';
1
+ import { Property, PropertyMap } from '../../../shared/types';
2
2
  import { InjectionToken } from '@angular/core';
3
3
  import { HistoryPageReference } from './history.model';
4
4
  export type UsageMode = 'DESK' | 'FIELD';
@@ -20,7 +20,7 @@ export declare interface LocalSettings {
20
20
  locale: string;
21
21
  usageMode?: UsageMode;
22
22
  mobile?: boolean;
23
- properties?: PropertiesMap;
23
+ properties?: PropertyMap | Property[];
24
24
  pageHistory?: HistoryPageReference[];
25
25
  offlineFeatures?: (string | OfflineFeature)[];
26
26
  pageHistoryMaxSize: number;
@@ -35,17 +35,17 @@ export declare class EntitiesStorage extends StartableService<EntityStorageMap>
35
35
  watchAll<T extends Entity<T>>(entityName: string, variables: {
36
36
  offset?: number;
37
37
  size?: number;
38
- sortBy?: string;
38
+ sortBy?: keyof T | string;
39
39
  sortDirection?: string;
40
40
  trash?: boolean;
41
- filter?: (T: any) => boolean;
41
+ filter?: (data: T) => boolean;
42
42
  }, opts?: EntityStorageLoadOptions): Observable<LoadResult<T>>;
43
43
  loadAll<T extends Entity<T>>(entityName: string, variables?: {
44
44
  offset?: number;
45
45
  size?: number;
46
- sortBy?: string;
46
+ sortBy?: keyof T | string;
47
47
  sortDirection?: string;
48
- filter?: (T: any) => boolean;
48
+ filter?: (data: T) => boolean;
49
49
  }, opts?: EntityStorageLoadOptions): Promise<LoadResult<T>>;
50
50
  load<T extends Entity<T>>(id: number, entityName: string, opts?: EntityStorageLoadOptions): Promise<T>;
51
51
  nextValue(entityOrName: string | any): Promise<number>;
@@ -42,9 +42,9 @@ export declare class EntityStore<T extends IEntity<T, ID>, ID = number, O extend
42
42
  watchAll(variables: {
43
43
  offset?: number;
44
44
  size?: number;
45
- sortBy?: string;
45
+ sortBy?: keyof T | string;
46
46
  sortDirection?: string;
47
- filter?: (T: any) => boolean;
47
+ filter?: (data: T) => boolean;
48
48
  }, opts?: O): Observable<LoadResult<T>>;
49
49
  /**
50
50
  * WIll apply a filter, then a sort, then a page slice
@@ -55,9 +55,9 @@ export declare class EntityStore<T extends IEntity<T, ID>, ID = number, O extend
55
55
  loadAll(variables: {
56
56
  offset?: number;
57
57
  size?: number;
58
- sortBy?: string;
58
+ sortBy?: keyof T | string;
59
59
  sortDirection?: string;
60
- filter?: (T: any) => boolean;
60
+ filter?: (data: T) => boolean;
61
61
  }, opts?: O): Promise<LoadResult<T>>;
62
62
  save(entity: T, opts?: {
63
63
  emitEvent?: boolean;
@@ -2,19 +2,15 @@ import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, ValidationErrors
2
2
  import { LocalSettings } from '../model/settings.model';
3
3
  import { NetworkService } from '../network.service';
4
4
  import { AppValidatorService } from './base.validator.class';
5
- import { AppFormArray } from '../../form/array/form-array';
6
- import { Property } from '../../../shared/types';
7
5
  import { PropertyValidator } from '../../form/properties/property.validator';
6
+ import { FormFieldDefinition } from '../../../shared/form/field.model';
8
7
  import * as i0 from "@angular/core";
9
8
  export declare class LocalSettingsValidatorService extends AppValidatorService<LocalSettings> {
10
9
  private propertyValidator;
11
10
  private networkService;
12
11
  constructor(formBuilder: UntypedFormBuilder, propertyValidator: PropertyValidator, networkService: NetworkService);
13
- getFormGroup(data?: LocalSettings): UntypedFormGroup;
14
- getPropertiesArray(data?: any): AppFormArray<Property, UntypedFormGroup>;
15
- getPropertyFormGroup(data?: {
16
- key: string;
17
- value?: string;
12
+ getFormGroup(data?: LocalSettings, opts?: {
13
+ definitions?: FormFieldDefinition[];
18
14
  }): UntypedFormGroup;
19
15
  protected peerAlive(peerUrlControl: AbstractControl): Promise<ValidationErrors | null>;
20
16
  static ɵfac: i0.ɵɵFactoryDeclaration<LocalSettingsValidatorService, never>;
@@ -34,6 +34,7 @@ export declare class SettingsPage extends AppForm<LocalSettings> implements OnIn
34
34
  protected saving: boolean;
35
35
  protected usageModes: UsageMode[];
36
36
  protected menuItems: IMenuItem[];
37
+ protected showOptionKeys: boolean;
37
38
  protected propertyDefinitions: FormFieldDefinition[];
38
39
  protected latLongFormats: string[];
39
40
  get accountInheritance(): boolean;
@@ -44,8 +45,9 @@ export declare class SettingsPage extends AppForm<LocalSettings> implements OnIn
44
45
  propertiesForm: AppPropertiesForm;
45
46
  constructor(injector: Injector, platform: PlatformService, navController: NavController, validatorService: LocalSettingsValidatorService, alertCtrl: AlertController, translate: TranslateService, formBuilder: UntypedFormBuilder, accountService: AccountService, settings: LocalSettingsService, cd: ChangeDetectorRef, network: NetworkService, locales: LocaleConfig[], menuItems?: IMenuItem[]);
46
47
  ngOnInit(): Promise<void>;
48
+ protected loadPropertyDefinitions(): void;
47
49
  load(): Promise<void>;
48
- updateView(data: LocalSettings): void;
50
+ updateView(data: LocalSettings): Promise<void>;
49
51
  save(event?: Event, options?: any): Promise<boolean>;
50
52
  setAccountInheritance(enable: boolean, opts?: {
51
53
  emitEvent?: boolean;
@@ -75,6 +77,7 @@ export declare class SettingsPage extends AppForm<LocalSettings> implements OnIn
75
77
  emitEvent?: boolean;
76
78
  }): void;
77
79
  protected toggleDarkMode(enable?: boolean): Promise<void>;
80
+ protected toggleShowOptionKey(): void;
78
81
  protected markForCheck(): void;
79
82
  static ɵfac: i0.ɵɵFactoryDeclaration<SettingsPage, [null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }]>;
80
83
  static ɵcmp: i0.ɵɵComponentDeclaration<SettingsPage, "page-settings", never, {}, {}, never, never, false, never>;
@@ -2,6 +2,7 @@ import { MatExpansionPanel } from '@angular/material/expansion';
2
2
  import { Environment } from '../../../environments/environment.class';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class DebugComponent {
5
+ titlePrefix: string;
5
6
  title: string;
6
7
  enable: boolean;
7
8
  expanded: boolean;
@@ -9,5 +10,5 @@ export declare class DebugComponent {
9
10
  constructor(environment: Environment);
10
11
  toggle(): void;
11
12
  static ɵfac: i0.ɵɵFactoryDeclaration<DebugComponent, [{ optional: true; }]>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<DebugComponent, "app-debug", never, { "title": { "alias": "title"; "required": false; }; "enable": { "alias": "enable"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; }, {}, never, ["*"], false, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<DebugComponent, "app-debug", never, { "titlePrefix": { "alias": "titlePrefix"; "required": false; }; "title": { "alias": "title"; "required": false; }; "enable": { "alias": "enable"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; }, {}, never, ["*"], false, never>;
13
14
  }