asp-lib 2.0.0 → 2.1.1

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.
@@ -9,6 +9,13 @@ export interface HeaderShortcut {
9
9
  module: any;
10
10
  option: any;
11
11
  }
12
+ /** A module shown on its own select, with its options tree already loaded. */
13
+ export interface HeaderInlineModule {
14
+ module: any;
15
+ data: {
16
+ categories: any[];
17
+ };
18
+ }
12
19
  export interface DropdownOptions {
13
20
  id: number;
14
21
  label: string;
@@ -35,6 +42,11 @@ export declare class HeaderComponent {
35
42
  auto: boolean;
36
43
  servicesConfig: ServicesConfig;
37
44
  isMobile: boolean;
45
+ /**
46
+ * Up to this many screens are shown as shortcuts; otherwise up to this many
47
+ * modules are shown as selects without the 9-dot modules menu.
48
+ */
49
+ shortcutLimit: number;
38
50
  returnClick: EventEmitter<any>;
39
51
  menuItemClick: EventEmitter<string>;
40
52
  menuNavigate: EventEmitter<any>;
@@ -67,12 +79,18 @@ export declare class HeaderComponent {
67
79
  currentModuleOption: any;
68
80
  selectedOption: any;
69
81
  /**
70
- * What the left side shows: the modules menu, or one shortcut per module when the
71
- * user has few modules with a single screen each. 'loading' avoids flashing the
72
- * menu while that is being checked.
82
+ * What the left side shows: the modules menu, one select per module when the user
83
+ * has few modules, or one shortcut per screen when the user has few screens.
84
+ * 'loading' avoids flashing the menu while that is being checked.
73
85
  */
74
- menuMode: 'loading' | 'modules' | 'shortcuts';
86
+ menuMode: 'loading' | 'modules' | 'inlineModules' | 'shortcuts';
75
87
  shortcuts: HeaderShortcut[];
88
+ inlineModules: HeaderInlineModule[];
89
+ /** Modules of the 9-dot menu that replaces the selects on small screens. */
90
+ inlineModuleList: any[];
91
+ /** True while the options tree of the selected module is being loaded. */
92
+ menuLoading: boolean;
93
+ private moduleOptionsRequest;
76
94
  dropdownOptionsMenu: DropdownOptions[];
77
95
  constructor(services: SecurityServices, router: Router, route: ActivatedRoute, cdr: ChangeDetectorRef, snackbar: SnackbarService);
78
96
  ngOnInit(): void;
@@ -90,8 +108,10 @@ export declare class HeaderComponent {
90
108
  getPath(): string;
91
109
  getModules(): void;
92
110
  /**
93
- * Shows shortcuts instead of the modules menu when the user has at most
94
- * MAX_SHORTCUT_MODULES modules and each one has exactly one screen.
111
+ * Picks what the left side shows, ignoring modules without screens:
112
+ * - at most `shortcutLimit` screens in total: one shortcut per screen;
113
+ * - else at most `shortcutLimit` modules: one select per module, no 9-dot menu;
114
+ * - else, or if an options request fails: the modules menu.
95
115
  */
96
116
  checkShortcuts(): void;
97
117
  /** Screens a user can open: tree nodes without children, as shown by the menu. */
@@ -104,5 +124,5 @@ export declare class HeaderComponent {
104
124
  encodeBase64Url(text: string): string;
105
125
  decodeBase64Url(base64url: any): string;
106
126
  static ɵfac: i0.ɵɵFactoryDeclaration<HeaderComponent, never>;
107
- static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "lib-header", never, { "appLogo": { "alias": "appLogo"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "showBackButton": { "alias": "showBackButton"; "required": false; }; "menuData": { "alias": "menuData"; "required": false; }; "recentOptions": { "alias": "recentOptions"; "required": false; }; "companies": { "alias": "companies"; "required": false; }; "moduleList": { "alias": "moduleList"; "required": false; }; "auto": { "alias": "auto"; "required": false; }; "servicesConfig": { "alias": "servicesConfig"; "required": false; }; "isMobile": { "alias": "isMobile"; "required": false; }; }, { "returnClick": "returnClick"; "menuItemClick": "menuItemClick"; "menuNavigate": "menuNavigate"; "recentNavigate": "recentNavigate"; "moduleSelect": "moduleSelect"; "lastOption": "lastOption"; }, never, never, false, never>;
127
+ static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "lib-header", never, { "appLogo": { "alias": "appLogo"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "showBackButton": { "alias": "showBackButton"; "required": false; }; "menuData": { "alias": "menuData"; "required": false; }; "recentOptions": { "alias": "recentOptions"; "required": false; }; "companies": { "alias": "companies"; "required": false; }; "moduleList": { "alias": "moduleList"; "required": false; }; "auto": { "alias": "auto"; "required": false; }; "servicesConfig": { "alias": "servicesConfig"; "required": false; }; "isMobile": { "alias": "isMobile"; "required": false; }; "shortcutLimit": { "alias": "shortcutLimit"; "required": false; }; }, { "returnClick": "returnClick"; "menuItemClick": "menuItemClick"; "menuNavigate": "menuNavigate"; "recentNavigate": "recentNavigate"; "moduleSelect": "moduleSelect"; "lastOption": "lastOption"; }, never, never, false, never>;
108
128
  }
@@ -1,4 +1,4 @@
1
- import { ElementRef, EventEmitter, OnDestroy, SimpleChanges } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, SimpleChanges } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export interface Option {
4
4
  baseUrl: string;
@@ -19,6 +19,7 @@ export interface Data {
19
19
  }
20
20
  export declare class MenuComponent implements OnDestroy {
21
21
  private elementRef;
22
+ private cdr;
22
23
  /** Modules the user can access ({ id, name, icon }). */
23
24
  dropdownOptions: any;
24
25
  /** Module shown in the select. */
@@ -27,6 +28,10 @@ export declare class MenuComponent implements OnDestroy {
27
28
  data: any;
28
29
  theme: string;
29
30
  isMobile: boolean;
31
+ /** True while `data` is being loaded; the options card shows a loading message. */
32
+ loading: boolean;
33
+ /** Shows the 9-dot modules launcher; off when the header lists each module on its own. */
34
+ showModules: boolean;
30
35
  menuOriginal: any;
31
36
  menuItemClick: EventEmitter<any>;
32
37
  selectOptionFromApp: EventEmitter<any>;
@@ -42,7 +47,7 @@ export declare class MenuComponent implements OnDestroy {
42
47
  private modulesPinned;
43
48
  private closeModulesTimer;
44
49
  set searchInput(input: ElementRef<HTMLInputElement> | undefined);
45
- constructor(elementRef: ElementRef);
50
+ constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
46
51
  ngOnInit(): void;
47
52
  ngOnChanges(changes: SimpleChanges): void;
48
53
  ngOnDestroy(): void;
@@ -66,5 +71,5 @@ export declare class MenuComponent implements OnDestroy {
66
71
  onEscape(): void;
67
72
  handleOptionSelected(event: any): void;
68
73
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, never>;
69
- static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "lib-menu", never, { "dropdownOptions": { "alias": "dropdownOptions"; "required": false; }; "selectedOption": { "alias": "selectedOption"; "required": false; }; "data": { "alias": "data"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "isMobile": { "alias": "isMobile"; "required": false; }; "menuOriginal": { "alias": "menu"; "required": false; }; }, { "menuItemClick": "menuItemClick"; "selectOptionFromApp": "selectOptionFromApp"; "moduleSelected": "moduleSelected"; }, never, never, false, never>;
74
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "lib-menu", never, { "dropdownOptions": { "alias": "dropdownOptions"; "required": false; }; "selectedOption": { "alias": "selectedOption"; "required": false; }; "data": { "alias": "data"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "isMobile": { "alias": "isMobile"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "showModules": { "alias": "showModules"; "required": false; }; "menuOriginal": { "alias": "menu"; "required": false; }; }, { "menuItemClick": "menuItemClick"; "selectOptionFromApp": "selectOptionFromApp"; "moduleSelected": "moduleSelected"; }, never, never, false, never>;
70
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asp-lib",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=16.2.0 <20.0.0",
6
6
  "@angular/core": ">=16.2.0 <20.0.0",