@sumaris-net/ngx-components 2.4.112 → 2.4.114

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 (34) hide show
  1. package/doc/changelog.md +1 -1
  2. package/esm2020/public_api.mjs +3 -1
  3. package/esm2020/src/app/core/form/entity/editor.class.mjs +5 -5
  4. package/esm2020/src/app/core/graphql/graphql.service.mjs +4 -1
  5. package/esm2020/src/app/core/menu/menu.component.mjs +115 -11
  6. package/esm2020/src/app/core/menu/menu.model.mjs +20 -1
  7. package/esm2020/src/app/core/menu/menu.service.mjs +13 -1
  8. package/esm2020/src/app/core/menu/testing/menu.testing.mjs +89 -0
  9. package/esm2020/src/app/core/menu/testing/menu.testing.module.mjs +44 -0
  10. package/esm2020/src/app/core/services/account.service.mjs +2 -2
  11. package/esm2020/src/app/core/services/network.service.mjs +9 -6
  12. package/esm2020/src/app/core/table/table-select-columns.component.mjs +1 -1
  13. package/esm2020/src/app/shared/material/autocomplete/material.autocomplete.mjs +1 -1
  14. package/esm2020/src/app/shared/shared.testing.module.mjs +15 -7
  15. package/esm2020/src/app/shared/toast/toast.testing.mjs +1 -1
  16. package/esm2020/src/app/shared/toolbar/toolbar.mjs +1 -1
  17. package/esm2020/src/app/social/user-event/user-event.service.mjs +3 -2
  18. package/fesm2015/sumaris-net.ngx-components.mjs +316 -52
  19. package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
  20. package/fesm2020/sumaris-net.ngx-components.mjs +314 -52
  21. package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
  22. package/package.json +3 -3
  23. package/public_api.d.ts +2 -0
  24. package/src/app/core/menu/menu.component.d.ts +22 -9
  25. package/src/app/core/menu/menu.model.d.ts +19 -0
  26. package/src/app/core/menu/menu.service.d.ts +10 -4
  27. package/src/app/core/menu/testing/menu.testing.d.ts +21 -0
  28. package/src/app/core/menu/testing/menu.testing.module.d.ts +11 -0
  29. package/src/app/core/services/account.service.d.ts +1 -1
  30. package/src/app/core/services/network.service.d.ts +1 -1
  31. package/src/app/shared/shared.testing.module.d.ts +2 -1
  32. package/src/assets/i18n/en-US.json +1 -0
  33. package/src/assets/i18n/en.json +1 -0
  34. package/src/assets/i18n/fr.json +1 -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": "2.4.112",
4
+ "version": "2.4.114",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -17,8 +17,8 @@
17
17
  "tslib": "~2.3.1"
18
18
  },
19
19
  "peerDependencies": {
20
- "@angular-devkit/build-angular": "~14.2.11",
21
- "@angular/compiler-cli": "~14.2.12",
20
+ "@angular-devkit/build-angular": "~14.2.12",
21
+ "@angular/compiler-cli": "~14.3.0",
22
22
  "@apollo/client": "~3.7.16",
23
23
  "@ionic/storage": "~3.0.6",
24
24
  "d3": "~7.6.1",
package/public_api.d.ts CHANGED
@@ -257,6 +257,8 @@ export * from './src/app/shared/image/gallery/testing/gallery.testing';
257
257
  export * from './src/app/shared/image/gallery/testing/gallery.testing.module';
258
258
  export * from './src/app/shared/audio/audio.testing';
259
259
  export * from './src/app/shared/audio/audio.testing.module';
260
+ export * from './src/app/core/menu/testing/menu.testing';
261
+ export * from './src/app/core/menu/testing/menu.testing.module';
260
262
  export * from './src/app/core/core.testing.module';
261
263
  export * from './src/app/core/services/testing/referential-filter.model';
262
264
  export * from './src/app/core/services/testing/referential.validator';
@@ -25,15 +25,6 @@ export declare class MenuComponent implements OnInit {
25
25
  protected environment: any;
26
26
  protected options: MenuOptions;
27
27
  protected items: MenuItem[];
28
- private readonly _debug;
29
- private _subscription;
30
- private _config;
31
- loading: boolean;
32
- isLogin: boolean;
33
- accountName: string;
34
- accountAvatar: string;
35
- accountEmail: string;
36
- $items: BehaviorSubject<MenuItem[]>;
37
28
  id: string;
38
29
  menuId: string;
39
30
  side: string;
@@ -42,6 +33,15 @@ export declare class MenuComponent implements OnInit {
42
33
  appName: string;
43
34
  appVersion: string;
44
35
  splitPane: IonSplitPane;
36
+ loading: boolean;
37
+ isLogin: boolean;
38
+ accountName: string;
39
+ accountAvatar: string;
40
+ accountEmail: string;
41
+ $items: BehaviorSubject<MenuItem[]>;
42
+ private readonly _debug;
43
+ private _subscription;
44
+ private _config;
45
45
  constructor(platformService: PlatformService, accountService: AccountService, navController: NavController, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService, configService: ConfigService, cd: ChangeDetectorRef, menuService: MenuService, environment: any, options: MenuOptions, items: MenuItem[]);
46
46
  ngOnInit(): Promise<void>;
47
47
  onLogin(account: Account): Promise<void>;
@@ -57,6 +57,19 @@ export declare class MenuComponent implements OnInit {
57
57
  onSwipeRight(event: any): boolean;
58
58
  protected refreshMenuItems(): void;
59
59
  protected detectChanges(): void;
60
+ protected insertMenuItem(newItem: MenuItem, opts?: {
61
+ skipExisting: boolean;
62
+ }): void;
63
+ protected cleanItem(item: MenuItem): void;
64
+ protected findExistingItem(item: MenuItem, items?: MenuItem[]): MenuItem;
65
+ protected findParent(childItem: MenuItem, items?: MenuItem[]): MenuItem;
66
+ protected addMenuToParent(parent: MenuItem, child: MenuItem): MenuItem[];
67
+ protected splitPathParam(pathWithParam: string): {
68
+ path: string;
69
+ params: {
70
+ [key: string]: string;
71
+ };
72
+ };
60
73
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
61
74
  static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "app-menu", never, { "id": "id"; "menuId": "menuId"; "side": "side"; "contentId": "contentId"; "logo": "logo"; "appName": "appName"; "appVersion": "appVersion"; }, {}, never, ["*", "[headerBottomRight]"], false>;
62
75
  }
@@ -15,9 +15,28 @@ export interface MenuItem extends IconRef {
15
15
  titleArgs?: {
16
16
  [key: string]: string;
17
17
  };
18
+ pathParams?: {
19
+ [key: string]: string;
20
+ };
21
+ parentPath?: string;
22
+ parentPathParams?: {
23
+ [key: string]: string;
24
+ };
18
25
  children?: MenuItem[];
19
26
  }
20
27
  export declare class MenuItems {
28
+ /**
29
+ * Compare, without checking the children
30
+ * @param a
31
+ * @param b
32
+ */
33
+ static isSame(a: MenuItem, b: MenuItem): boolean;
34
+ static isSameParams(a: {
35
+ [key: string]: string;
36
+ }, b: {
37
+ [key: string]: string;
38
+ }): boolean;
39
+ static isParent(child: MenuItem, parent: MenuItem): boolean;
21
40
  static checkIfVisible(item: MenuItem, accountService: AccountService, config: Configuration, opts?: {
22
41
  isLogin?: boolean;
23
42
  debug?: boolean;
@@ -1,19 +1,25 @@
1
- import { Observable } from 'rxjs';
1
+ import { BehaviorSubject, Observable } from 'rxjs';
2
+ import { MenuItem } from './menu.model';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare type SplitPaneShowWhen = boolean | 'lg';
4
5
  export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
5
6
  export declare class MenuService {
7
+ onMenuComponentReady: BehaviorSubject<boolean>;
8
+ get subMenuItem(): Observable<MenuItem>;
9
+ get opened(): Observable<boolean>;
10
+ get splitPaneWhen(): Observable<SplitPaneShowWhen>;
11
+ get enabled(): Observable<boolean>;
6
12
  private readonly _$toggled;
7
13
  private readonly _$opened;
8
14
  private readonly _$splitPaneWhen;
9
15
  private readonly _$enabled;
10
- get opened(): Observable<boolean>;
11
- get splitPaneWhen(): Observable<SplitPaneShowWhen>;
12
- get enabled(): Observable<boolean>;
16
+ private _$subMenuItem;
13
17
  toggle(): void;
14
18
  enable(value: boolean): void;
15
19
  setSplitPaneShowWhen(value: SplitPaneShowWhen): void;
16
20
  toggleSplitPaneWhen(): void;
21
+ clearSubMenuItems(): void;
22
+ addSubMenuItem(value: MenuItem): void;
17
23
  _markAsOpened(): void;
18
24
  _markAsClosed(): void;
19
25
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, never>;
@@ -0,0 +1,21 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { MenuService } from '../menu.service';
3
+ import { AppTabEditor } from '../../form/entity/editor.class';
4
+ import { ActivatedRoute, Router } from '@angular/router';
5
+ import { AlertController, NavController } from '@ionic/angular';
6
+ import { TranslateService } from '@ngx-translate/core';
7
+ import * as i0 from "@angular/core";
8
+ export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnDestroy {
9
+ private menuService;
10
+ constructor(route: ActivatedRoute, // Modal editor give 'null'
11
+ router: Router, navController: NavController, alertCtrl: AlertController, translate: TranslateService, menuService: MenuService);
12
+ ngOnInit(): void;
13
+ ngOnDestroy(): void;
14
+ load(id?: number, options?: any): Promise<void>;
15
+ get isNewData(): boolean;
16
+ reload(): Promise<void>;
17
+ save(event: Event | undefined, options: any): Promise<boolean>;
18
+ protected getFirstInvalidTabIndex(): number;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuTestingPage, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuTestingPage, "app-testing-menu", never, {}, {}, never, never, false>;
21
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./menu.testing";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/router";
5
+ import * as i4 from "../menu.module";
6
+ import * as i5 from "../../../shared/shared.module";
7
+ export declare class MenuTestingModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuTestingModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MenuTestingModule, [typeof i1.MenuTestingPage], [typeof i2.CommonModule, typeof i3.RouterModule, typeof i4.AppMenuModule, typeof i5.SharedModule], [typeof i3.RouterModule, typeof i1.MenuTestingPage]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<MenuTestingModule>;
11
+ }
@@ -89,7 +89,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
89
89
  /**
90
90
  *
91
91
  * @param recorderDepartment
92
- * @deprecated use ProgramRefService.canUserWriteDataForDepartment() instead
92
+ * @deprecated use ProgramRefService.canUserWriteEntity() instead
93
93
  */
94
94
  canUserWriteDataForDepartment(recorderDepartment: Referential | any): boolean;
95
95
  register(data: RegisterData): Promise<Account>;
@@ -29,7 +29,6 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
29
29
  private http;
30
30
  protected environment: any;
31
31
  private loggingService;
32
- private network;
33
32
  private translate;
34
33
  private toastController;
35
34
  onPeerChanges: import("rxjs").Observable<string>;
@@ -37,6 +36,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
37
36
  onResetNetworkCache: EventEmitter<any>;
38
37
  private readonly _mobile;
39
38
  private readonly _logger;
39
+ private readonly _network;
40
40
  private _timerSubscription;
41
41
  private readonly _timerRefreshPeriod;
42
42
  private readonly _timerRefreshCondition;
@@ -9,9 +9,10 @@ import * as i6 from "./upload-file/testing/upload-file.testing.module";
9
9
  import * as i7 from "./image/gallery/testing/gallery.testing.module";
10
10
  import * as i8 from "./audio/audio.testing.module";
11
11
  import * as i9 from "./storage/storage-explorer.module";
12
+ import * as i10 from "../core/menu/testing/menu.testing.module";
12
13
  export declare const SHARED_TESTING_PAGES: TestingPage[];
13
14
  export declare class SharedTestingModule {
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<SharedTestingModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<SharedTestingModule, never, [typeof i1.CommonModule, typeof i2.IonicModule, typeof i3.TranslateModule, typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule, typeof i9.StorageExplorerModule], [typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule, typeof i9.StorageExplorerModule]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedTestingModule, never, [typeof i1.CommonModule, typeof i2.IonicModule, typeof i3.TranslateModule, typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule, typeof i9.StorageExplorerModule, typeof i10.MenuTestingModule], [typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule, typeof i9.StorageExplorerModule, typeof i10.MenuTestingModule]>;
16
17
  static ɵinj: i0.ɵɵInjectorDeclaration<SharedTestingModule>;
17
18
  }
@@ -608,6 +608,7 @@
608
608
  "CREATION_DATE": "Creation date",
609
609
  "UPDATE_DATE": "Update date",
610
610
  "COMMENTS": "Comments",
611
+ "VALUES": "Enums",
611
612
  "GROUP_1": "Group 1",
612
613
  "GROUP_2": "Group 2",
613
614
  "STATUS_ID": "Status"
@@ -608,6 +608,7 @@
608
608
  "CREATION_DATE": "Creation date",
609
609
  "UPDATE_DATE": "Update date",
610
610
  "COMMENTS": "Comments",
611
+ "VALUES": "Enums",
611
612
  "GROUP_1": "Group 1",
612
613
  "GROUP_2": "Group 2",
613
614
  "STATUS_ID": "Status"
@@ -601,6 +601,7 @@
601
601
  "CREATION_DATE": "Date création",
602
602
  "UPDATE_DATE": "Date MAJ",
603
603
  "COMMENTS": "Commentaires",
604
+ "VALUES": "Enums",
604
605
  "GROUP_1": "Groupe 1",
605
606
  "GROUP_2": "Groupe 2",
606
607
  "STATUS_ID": "Etat de saisie"