@zambon-dev/library 1.4.1 → 1.6.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/CHANGELOG.md +52 -1
- package/fesm2022/zambon-dev-library.mjs +165 -60
- package/fesm2022/zambon-dev-library.mjs.map +1 -1
- package/lib/components/sidebar/sidebar.component.d.ts +9 -0
- package/lib/helpers/display-controls.d.ts +29 -0
- package/lib/helpers/index.d.ts +1 -0
- package/lib/models/sidebar/sidebar-configs.d.ts +11 -0
- package/lib/services/sidebar.service.d.ts +6 -0
- package/package.json +1 -1
|
@@ -24,7 +24,16 @@ export declare class SidebarComponent extends BaseComponent implements AfterView
|
|
|
24
24
|
collapse(): void;
|
|
25
25
|
protected trackByFn(_index: number, item: SidebarMenu): number;
|
|
26
26
|
protected trackByRegion(_index: number, region: SidebarRegion): string;
|
|
27
|
+
/** Whether this top-level menu stands for an area rather than a destination of its own. */
|
|
28
|
+
private isArea;
|
|
29
|
+
private groupByRegionLabel;
|
|
30
|
+
private groupByRootMenus;
|
|
27
31
|
private groupIntoRegions;
|
|
32
|
+
/**
|
|
33
|
+
* Fetches the children of every area up front, because they are rendered flat rather than
|
|
34
|
+
* behind a click, so the lazy load a collapsible parent relies on would never be triggered.
|
|
35
|
+
*/
|
|
36
|
+
private loadAreaChildren;
|
|
28
37
|
private deactivate;
|
|
29
38
|
private updateShouldActivate;
|
|
30
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<SidebarComponent, never>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AbstractControl } from '@angular/forms';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks the form controls that exist only to show a catalog selection's label.
|
|
4
|
+
*
|
|
5
|
+
* `lib-catalog-select` works in pairs: the control named by `controlName` holds the identifier, and
|
|
6
|
+
* the one named by `displayControlName` holds the text the user reads. The second is created by the
|
|
7
|
+
* component itself when a screen does not declare it, so a form ends up carrying controls nobody
|
|
8
|
+
* wrote down — and a filters form then submits them alongside the real filters.
|
|
9
|
+
*
|
|
10
|
+
* The mark lives in a `WeakSet` keyed by the control instance rather than by its name. That is the
|
|
11
|
+
* only scope that is actually correct: two forms may each have an `employeeName`, and only the one
|
|
12
|
+
* a catalog select drives is a display control. It also keeps nothing alive.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DisplayControls {
|
|
15
|
+
private static readonly marked;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the control exists only to display a catalog selection's label.
|
|
18
|
+
*
|
|
19
|
+
* @param control The control, which may be absent.
|
|
20
|
+
* @returns `true` when a catalog select drives it as its display control.
|
|
21
|
+
*/
|
|
22
|
+
static isDisplayControl(control: AbstractControl | null | undefined): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Marks the control as existing only to display a catalog selection's label.
|
|
25
|
+
*
|
|
26
|
+
* @param control The control, which may be absent.
|
|
27
|
+
*/
|
|
28
|
+
static markAsDisplayControl(control: AbstractControl | null | undefined): void;
|
|
29
|
+
}
|
package/lib/helpers/index.d.ts
CHANGED
|
@@ -5,6 +5,17 @@ export declare class SidebarConfigs {
|
|
|
5
5
|
/** Tooltip for items that open in a new browser tab. Rendered as-is, like {@link errorText}. */
|
|
6
6
|
externalLinkText: string;
|
|
7
7
|
loadingText: string;
|
|
8
|
+
/**
|
|
9
|
+
* Derive region headers from the menu tree instead of from {@link SidebarMenu.region}.
|
|
10
|
+
*
|
|
11
|
+
* With this on, a top-level menu that has children and no URL stops being a collapsible node
|
|
12
|
+
* and becomes an area header, with its children rendered flat beneath it as top-level items --
|
|
13
|
+
* icons included. The area is then a real menu row, so it carries its own translated label and
|
|
14
|
+
* its own order, and no `region` label has to be repeated across every item that belongs to it.
|
|
15
|
+
*
|
|
16
|
+
* Off by default: without it a top-level parent stays the collapsible group it has always been.
|
|
17
|
+
*/
|
|
18
|
+
shouldDeriveAreasFromRootMenus: boolean;
|
|
8
19
|
logoCollapsedPath?: string;
|
|
9
20
|
logoExpandedPath?: string;
|
|
10
21
|
constructor(options?: Partial<SidebarConfigs>);
|
|
@@ -16,6 +16,12 @@ export declare abstract class SidebarService {
|
|
|
16
16
|
private selectedMenu;
|
|
17
17
|
deselectAll(): void;
|
|
18
18
|
loadChildren(parentMenu: SidebarMenu): void;
|
|
19
|
+
/**
|
|
20
|
+
* Loads a parent's children and hands them back, for callers that need them before the user
|
|
21
|
+
* clicks -- a sidebar rendering areas flat has to have them up front. {@link loadChildren} is
|
|
22
|
+
* the fire-and-forget variant that also raises the loading and failure events.
|
|
23
|
+
*/
|
|
24
|
+
loadChildrenFor(parentMenu: SidebarMenu): Observable<SidebarMenu[]>;
|
|
19
25
|
loadRoot(): Observable<SidebarMenu[]>;
|
|
20
26
|
select(menu: SidebarMenu): void;
|
|
21
27
|
private deselectMenu;
|