@ojiepermana/angular 0.0.3 → 0.1.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/README.md +50 -7
- package/fesm2022/ojiepermana-angular-internal.mjs +417 -2
- package/fesm2022/ojiepermana-angular-internal.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout.mjs +8 -18
- package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-horizontal.mjs +785 -0
- package/fesm2022/ojiepermana-angular-navigation-horizontal.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-navigation-vertical.mjs +1568 -0
- package/fesm2022/ojiepermana-angular-navigation-vertical.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs +176 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-theme-component.mjs +12 -26
- package/fesm2022/ojiepermana-angular-theme-component.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme-service.mjs +2 -6
- package/fesm2022/ojiepermana-angular-theme-service.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular.mjs.map +1 -1
- package/navigation/README.md +215 -0
- package/package.json +13 -1
- package/theme/README.md +1 -4
- package/theme/styles/adapters/material-ui/index.css +1 -5
- package/theme/styles/layout/horizontal.css +2 -10
- package/theme/styles/layout/vertical.css +3 -5
- package/theme/styles/presets/styles/flat.css +3 -6
- package/theme/styles/presets/styles/glass.css +1 -7
- package/theme/styles/presets/styles/index.css +1 -1
- package/theme/styles/roles/index.css +18 -0
- package/theme/styles/tokens/foundation.css +4 -7
- package/types/ojiepermana-angular-internal.d.ts +64 -1
- package/types/ojiepermana-angular-navigation-horizontal.d.ts +77 -0
- package/types/ojiepermana-angular-navigation-vertical.d.ts +260 -0
- package/types/ojiepermana-angular-navigation.d.ts +182 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { NavigationItem, shouldRenderNavigationItem, hasNavigationChildren } from '@ojiepermana/angular/navigation';
|
|
3
|
+
import { trackNavigationTreeItem, getNavigationTreePathKey } from '@ojiepermana/angular/internal';
|
|
4
|
+
|
|
5
|
+
declare class HorizontalNavigationBranchItem {
|
|
6
|
+
private _menuTrigger?;
|
|
7
|
+
private _rootTrigger?;
|
|
8
|
+
private _activeChildBranch;
|
|
9
|
+
private readonly _document;
|
|
10
|
+
readonly isMenuOpen: _angular_core.WritableSignal<boolean>;
|
|
11
|
+
readonly expandedInlineBranchByParent: _angular_core.WritableSignal<Record<string, string>>;
|
|
12
|
+
item: _angular_core.InputSignal<NavigationItem>;
|
|
13
|
+
menuItem: _angular_core.InputSignal<boolean>;
|
|
14
|
+
nested: _angular_core.InputSignal<boolean>;
|
|
15
|
+
itemClicked: _angular_core.OutputEmitterRef<NavigationItem>;
|
|
16
|
+
branchOpened: _angular_core.OutputEmitterRef<HorizontalNavigationBranchItem>;
|
|
17
|
+
branchClosed: _angular_core.OutputEmitterRef<HorizontalNavigationBranchItem>;
|
|
18
|
+
readonly itemChildren: _angular_core.Signal<NavigationItem[]>;
|
|
19
|
+
readonly treeTemplateData: _angular_core.Signal<{
|
|
20
|
+
inlineBranch: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
readonly treeTrackByFn: typeof trackNavigationTreeItem;
|
|
23
|
+
readonly treeShouldRenderItemFn: typeof shouldRenderNavigationItem;
|
|
24
|
+
readonly treeHasChildrenFn: typeof hasNavigationChildren;
|
|
25
|
+
readonly treeResolveParentKeyFn: typeof getNavigationTreePathKey;
|
|
26
|
+
readonly menuPanelClass: _angular_core.Signal<"horizontal-navigation-menu horizontal-navigation-menu--nested" | "horizontal-navigation-menu horizontal-navigation-menu--root">;
|
|
27
|
+
hasChildren(item: NavigationItem): boolean;
|
|
28
|
+
shouldRenderItem(item: NavigationItem): boolean;
|
|
29
|
+
trackByFn(index: number, item: NavigationItem): string | number;
|
|
30
|
+
onMenuItemTriggerClick(event: MouseEvent): void;
|
|
31
|
+
onChildItemClicked(child: NavigationItem): void;
|
|
32
|
+
isInlineBranchExpanded(item: NavigationItem, parentKey: string): boolean;
|
|
33
|
+
toggleInlineBranch(item: NavigationItem, parentKey: string): void;
|
|
34
|
+
onInlineBranchHeaderClick(event: MouseEvent, item: NavigationItem, parentKey: string): void;
|
|
35
|
+
getPathKey(parentKey: string, item: NavigationItem): string;
|
|
36
|
+
onChildBranchOpened(branch: HorizontalNavigationBranchItem): void;
|
|
37
|
+
onChildBranchClosed(branch: HorizontalNavigationBranchItem): void;
|
|
38
|
+
handleMenuOpened(): void;
|
|
39
|
+
handleMenuClosed(): void;
|
|
40
|
+
closeMenu(): void;
|
|
41
|
+
private _syncRootTriggerWidth;
|
|
42
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HorizontalNavigationBranchItem, never>;
|
|
43
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HorizontalNavigationBranchItem, "horizontal-navigation-branch-item", never, { "item": { "alias": "item"; "required": true; "isSignal": true; }; "menuItem": { "alias": "menuItem"; "required": false; "isSignal": true; }; "nested": { "alias": "nested"; "required": false; "isSignal": true; }; }, { "itemClicked": "itemClicked"; "branchOpened": "branchOpened"; "branchClosed": "branchClosed"; }, never, never, true, never>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class HorizontalNavigation {
|
|
47
|
+
private _navigationService;
|
|
48
|
+
private _activeRootBranch;
|
|
49
|
+
name: _angular_core.InputSignal<string>;
|
|
50
|
+
navigation: _angular_core.InputSignal<NavigationItem[]>;
|
|
51
|
+
itemClicked: _angular_core.OutputEmitterRef<NavigationItem>;
|
|
52
|
+
navigationData: _angular_core.Signal<NavigationItem[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Handle item click
|
|
55
|
+
*/
|
|
56
|
+
onItemClicked(item: NavigationItem): void;
|
|
57
|
+
onRootBranchOpened(branch: HorizontalNavigationBranchItem): void;
|
|
58
|
+
onRootBranchClosed(branch: HorizontalNavigationBranchItem): void;
|
|
59
|
+
shouldRenderItem(item: NavigationItem): boolean;
|
|
60
|
+
hasChildren(item: NavigationItem): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Get flat navigation for utility purposes
|
|
63
|
+
*/
|
|
64
|
+
getFlatNavigation(): NavigationItem[];
|
|
65
|
+
/**
|
|
66
|
+
* Get navigation item by ID
|
|
67
|
+
*/
|
|
68
|
+
getItem(id: string): NavigationItem | null;
|
|
69
|
+
/**
|
|
70
|
+
* Get navigation item parent by ID
|
|
71
|
+
*/
|
|
72
|
+
getItemParent(id: string): NavigationItem[] | NavigationItem | null;
|
|
73
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HorizontalNavigation, never>;
|
|
74
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HorizontalNavigation, "horizontal-navigation", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "navigation": { "alias": "navigation"; "required": false; "isSignal": true; }; }, { "itemClicked": "itemClicked"; }, never, never, true, never>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { HorizontalNavigation, HorizontalNavigationBranchItem };
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { OnChanges, OnInit, AfterViewInit, OnDestroy, ChangeDetectorRef, ElementRef, Renderer2, EventEmitter, SimpleChanges } from '@angular/core';
|
|
3
|
+
import { NavigationService, VerticalNavigationMode, NavigationItem, VerticalNavigationPosition, VerticalNavigationAppearance, NavigationAsideItem, shouldRenderNavigationItem, NavigationBasicItem, NavigationCollapsableItem, NavigationGroupItem } from '@ojiepermana/angular/navigation';
|
|
4
|
+
import { Router, IsActiveMatchOptions } from '@angular/router';
|
|
5
|
+
import { ReplaySubject, Subject } from 'rxjs';
|
|
6
|
+
import { trackNavigationTreeItem } from '@ojiepermana/angular/internal';
|
|
7
|
+
|
|
8
|
+
declare abstract class VerticalNavigationBaseComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {
|
|
9
|
+
protected _changeDetectorRef: ChangeDetectorRef;
|
|
10
|
+
protected _document: Document;
|
|
11
|
+
protected _elementRef: ElementRef<any>;
|
|
12
|
+
protected _renderer2: Renderer2;
|
|
13
|
+
protected _router: Router;
|
|
14
|
+
protected _navigationService: NavigationService;
|
|
15
|
+
autoCollapse: boolean;
|
|
16
|
+
inner: boolean;
|
|
17
|
+
mode: VerticalNavigationMode;
|
|
18
|
+
navigation: NavigationItem[];
|
|
19
|
+
opened: boolean;
|
|
20
|
+
position: VerticalNavigationPosition;
|
|
21
|
+
transparentOverlay: boolean;
|
|
22
|
+
readonly appearanceChanged: EventEmitter<VerticalNavigationAppearance>;
|
|
23
|
+
readonly modeChanged: EventEmitter<VerticalNavigationMode>;
|
|
24
|
+
readonly openedChanged: EventEmitter<boolean>;
|
|
25
|
+
readonly positionChanged: EventEmitter<VerticalNavigationPosition>;
|
|
26
|
+
protected _navigationContentEl?: ElementRef;
|
|
27
|
+
activeAsideItemId: string | null;
|
|
28
|
+
onCollapsableItemCollapsed: ReplaySubject<NavigationItem>;
|
|
29
|
+
onCollapsableItemExpanded: ReplaySubject<NavigationItem>;
|
|
30
|
+
onRefreshed: ReplaySubject<boolean>;
|
|
31
|
+
protected _animationsEnabled: boolean;
|
|
32
|
+
protected _asideOverlay: HTMLElement | null;
|
|
33
|
+
protected _hovered: boolean;
|
|
34
|
+
protected _mutationObserver?: MutationObserver;
|
|
35
|
+
protected _overlay: HTMLElement | null;
|
|
36
|
+
protected _pendingTimeouts: ReturnType<typeof setTimeout>[];
|
|
37
|
+
protected _unsubscribeAll: Subject<void>;
|
|
38
|
+
protected abstract _componentPrefix: string;
|
|
39
|
+
protected abstract _asideWrapperClass: string;
|
|
40
|
+
private readonly _overlayClickHandler;
|
|
41
|
+
private readonly _asideOverlayClickHandler;
|
|
42
|
+
abstract appearance: VerticalNavigationAppearance;
|
|
43
|
+
get hostClasses(): Record<string, boolean>;
|
|
44
|
+
get asideWrapperClass(): string;
|
|
45
|
+
activeAsideNavigationItem(): NavigationAsideItem | null;
|
|
46
|
+
shouldRenderItem(item: NavigationItem): boolean;
|
|
47
|
+
onMouseenter(): void;
|
|
48
|
+
onMouseleave(): void;
|
|
49
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
50
|
+
ngOnInit(): void;
|
|
51
|
+
ngAfterViewInit(): void;
|
|
52
|
+
ngOnDestroy(): void;
|
|
53
|
+
refresh(): void;
|
|
54
|
+
open(): void;
|
|
55
|
+
close(): void;
|
|
56
|
+
toggle(): void;
|
|
57
|
+
openAside(item: NavigationItem): void;
|
|
58
|
+
closeAside(): void;
|
|
59
|
+
toggleAside(item: NavigationItem): void;
|
|
60
|
+
trackByFn(index: number, item: NavigationItem): string | number | undefined;
|
|
61
|
+
protected _enableAnimations(): void;
|
|
62
|
+
protected _disableAnimations(): void;
|
|
63
|
+
protected _showOverlay(): void;
|
|
64
|
+
protected _hideOverlay(): void;
|
|
65
|
+
protected _showAsideOverlay(): void;
|
|
66
|
+
protected _hideAsideOverlay(): void;
|
|
67
|
+
protected _setTimeout(fn: () => void, delay?: number): void;
|
|
68
|
+
private _removeOverlayElement;
|
|
69
|
+
protected _toggleOpened(open: boolean): void;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationBaseComponent, never>;
|
|
71
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VerticalNavigationBaseComponent, never, never, { "autoCollapse": { "alias": "autoCollapse"; "required": false; }; "inner": { "alias": "inner"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "navigation": { "alias": "navigation"; "required": false; }; "opened": { "alias": "opened"; "required": false; }; "position": { "alias": "position"; "required": false; }; "transparentOverlay": { "alias": "transparentOverlay"; "required": false; }; }, { "appearanceChanged": "appearanceChanged"; "modeChanged": "modeChanged"; "openedChanged": "openedChanged"; "positionChanged": "positionChanged"; }, never, never, true, never>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class VerticalNavigationDefaultComponent extends VerticalNavigationBaseComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {
|
|
75
|
+
protected _componentPrefix: string;
|
|
76
|
+
protected _asideWrapperClass: string;
|
|
77
|
+
appearance: VerticalNavigationAppearance;
|
|
78
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationDefaultComponent, never>;
|
|
79
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationDefaultComponent, "vertical-navigation", ["verticalNavigationDefault"], { "appearance": { "alias": "appearance"; "required": false; }; }, {}, never, ["[verticalNavigationHeader]", "[verticalNavigationContentHeader]", "[verticalNavigationContentFooter]", "[verticalNavigationFooter]"], true, never>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class VerticalNavigationCompactComponent extends VerticalNavigationBaseComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {
|
|
83
|
+
protected _componentPrefix: string;
|
|
84
|
+
protected _asideWrapperClass: string;
|
|
85
|
+
appearance: VerticalNavigationAppearance;
|
|
86
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationCompactComponent, never>;
|
|
87
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationCompactComponent, "vertical-navigation-compact", ["verticalNavigationCompact"], { "appearance": { "alias": "appearance"; "required": false; }; }, {}, never, ["[verticalNavigationHeader]", "[verticalNavigationContentHeader]", "[verticalNavigationContentFooter]", "[verticalNavigationFooter]"], true, never>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare class VerticalNavigationDenseComponent extends VerticalNavigationBaseComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {
|
|
91
|
+
protected _componentPrefix: string;
|
|
92
|
+
protected _asideWrapperClass: string;
|
|
93
|
+
appearance: VerticalNavigationAppearance;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationDenseComponent, never>;
|
|
95
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationDenseComponent, "vertical-navigation-dense", ["verticalNavigationDense"], { "appearance": { "alias": "appearance"; "required": false; }; }, {}, never, ["[verticalNavigationHeader]", "[verticalNavigationContentHeader]", "[verticalNavigationContentFooter]", "[verticalNavigationFooter]"], true, never>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare class VerticalNavigationThinComponent extends VerticalNavigationBaseComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {
|
|
99
|
+
protected _componentPrefix: string;
|
|
100
|
+
protected _asideWrapperClass: string;
|
|
101
|
+
appearance: VerticalNavigationAppearance;
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationThinComponent, never>;
|
|
103
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationThinComponent, "vertical-navigation-thin", ["verticalNavigationThin"], { "appearance": { "alias": "appearance"; "required": false; }; }, {}, never, ["[verticalNavigationHeader]", "[verticalNavigationContentHeader]", "[verticalNavigationContentFooter]", "[verticalNavigationFooter]"], true, never>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
declare class VerticalNavigationAsideItemComponent implements OnChanges, OnInit, OnDestroy {
|
|
107
|
+
private _changeDetectorRef;
|
|
108
|
+
private _navigationComponent;
|
|
109
|
+
private _router;
|
|
110
|
+
activeItemId?: string | null;
|
|
111
|
+
autoCollapse: boolean;
|
|
112
|
+
item: NavigationAsideItem;
|
|
113
|
+
skipChildren: boolean;
|
|
114
|
+
active: boolean;
|
|
115
|
+
readonly treeTrackByFn: typeof trackNavigationTreeItem;
|
|
116
|
+
readonly treeShouldRenderItemFn: typeof shouldRenderNavigationItem;
|
|
117
|
+
private _unsubscribeAll;
|
|
118
|
+
/**
|
|
119
|
+
* On changes
|
|
120
|
+
*/
|
|
121
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
122
|
+
/**
|
|
123
|
+
* On init
|
|
124
|
+
*/
|
|
125
|
+
ngOnInit(): void;
|
|
126
|
+
/**
|
|
127
|
+
* On destroy
|
|
128
|
+
*/
|
|
129
|
+
ngOnDestroy(): void;
|
|
130
|
+
/**
|
|
131
|
+
* Track by function for ngFor loops
|
|
132
|
+
*/
|
|
133
|
+
trackByFn(index: number, item: NavigationItem): string | number | undefined;
|
|
134
|
+
shouldRenderItem(item: NavigationItem): boolean;
|
|
135
|
+
get treeTemplateData(): {
|
|
136
|
+
autoCollapse: boolean;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Check if the given item has the given url in one of its children
|
|
140
|
+
*/
|
|
141
|
+
private _hasActiveChild;
|
|
142
|
+
/**
|
|
143
|
+
* Decide and mark if the item is active
|
|
144
|
+
*/
|
|
145
|
+
private _markIfActive;
|
|
146
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationAsideItemComponent, never>;
|
|
147
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationAsideItemComponent, "vertical-navigation-aside-item", never, { "activeItemId": { "alias": "activeItemId"; "required": false; }; "autoCollapse": { "alias": "autoCollapse"; "required": false; }; "item": { "alias": "item"; "required": false; }; "skipChildren": { "alias": "skipChildren"; "required": false; }; }, {}, never, never, true, never>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare class VerticalNavigationBasicItemComponent implements OnInit, OnDestroy {
|
|
151
|
+
private _changeDetectorRef;
|
|
152
|
+
private _navigationComponent;
|
|
153
|
+
item: NavigationBasicItem;
|
|
154
|
+
isActiveMatchOptions: IsActiveMatchOptions;
|
|
155
|
+
private _unsubscribeAll;
|
|
156
|
+
/**
|
|
157
|
+
* On init
|
|
158
|
+
*/
|
|
159
|
+
ngOnInit(): void;
|
|
160
|
+
/**
|
|
161
|
+
* On destroy
|
|
162
|
+
*/
|
|
163
|
+
ngOnDestroy(): void;
|
|
164
|
+
hasAction(): boolean;
|
|
165
|
+
triggerAction(): void;
|
|
166
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationBasicItemComponent, never>;
|
|
167
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationBasicItemComponent, "vertical-navigation-basic-item", never, { "item": { "alias": "item"; "required": false; }; }, {}, never, never, true, never>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare class VerticalNavigationCollapsableItemComponent implements OnInit, OnDestroy {
|
|
171
|
+
private _changeDetectorRef;
|
|
172
|
+
private _navigationComponent;
|
|
173
|
+
private _navigationService;
|
|
174
|
+
private _router;
|
|
175
|
+
autoCollapse: boolean;
|
|
176
|
+
item: NavigationCollapsableItem;
|
|
177
|
+
isCollapsed: boolean;
|
|
178
|
+
readonly treeTrackByFn: typeof trackNavigationTreeItem;
|
|
179
|
+
readonly treeShouldRenderItemFn: typeof shouldRenderNavigationItem;
|
|
180
|
+
get isExpanded(): boolean;
|
|
181
|
+
private _unsubscribeAll;
|
|
182
|
+
/**
|
|
183
|
+
* On init
|
|
184
|
+
*/
|
|
185
|
+
ngOnInit(): void;
|
|
186
|
+
/**
|
|
187
|
+
* On destroy
|
|
188
|
+
*/
|
|
189
|
+
ngOnDestroy(): void;
|
|
190
|
+
/**
|
|
191
|
+
* Collapse
|
|
192
|
+
*/
|
|
193
|
+
collapse(): void;
|
|
194
|
+
/**
|
|
195
|
+
* Expand
|
|
196
|
+
*/
|
|
197
|
+
expand(): void;
|
|
198
|
+
/**
|
|
199
|
+
* Toggle collapsable
|
|
200
|
+
*/
|
|
201
|
+
toggleCollapsable(): void;
|
|
202
|
+
/**
|
|
203
|
+
* Track by function for ngFor loops
|
|
204
|
+
*/
|
|
205
|
+
trackByFn(index: number, item: NavigationItem): string | number | undefined;
|
|
206
|
+
shouldRenderItem(item: NavigationItem): boolean;
|
|
207
|
+
get treeTemplateData(): {
|
|
208
|
+
autoCollapse: boolean;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Check if the given item has the given url in one of its children
|
|
212
|
+
*/
|
|
213
|
+
private _hasActiveChild;
|
|
214
|
+
/**
|
|
215
|
+
* Check if this is a children of the given item
|
|
216
|
+
*/
|
|
217
|
+
private _isChildrenOf;
|
|
218
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationCollapsableItemComponent, never>;
|
|
219
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationCollapsableItemComponent, "vertical-navigation-collapsable-item", never, { "autoCollapse": { "alias": "autoCollapse"; "required": false; }; "item": { "alias": "item"; "required": false; }; }, {}, never, never, true, never>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare class VerticalNavigationDividerItemComponent {
|
|
223
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationDividerItemComponent, never>;
|
|
224
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationDividerItemComponent, "vertical-navigation-divider-item", never, {}, {}, never, never, true, never>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare class VerticalNavigationGroupItemComponent implements OnInit, OnDestroy {
|
|
228
|
+
private _changeDetectorRef;
|
|
229
|
+
private _navigationComponent;
|
|
230
|
+
autoCollapse: boolean;
|
|
231
|
+
item: NavigationGroupItem;
|
|
232
|
+
private _unsubscribeAll;
|
|
233
|
+
readonly treeTrackByFn: typeof trackNavigationTreeItem;
|
|
234
|
+
readonly treeShouldRenderItemFn: typeof shouldRenderNavigationItem;
|
|
235
|
+
/**
|
|
236
|
+
* On init
|
|
237
|
+
*/
|
|
238
|
+
ngOnInit(): void;
|
|
239
|
+
/**
|
|
240
|
+
* On destroy
|
|
241
|
+
*/
|
|
242
|
+
ngOnDestroy(): void;
|
|
243
|
+
/**
|
|
244
|
+
* Track by function for ngFor loops
|
|
245
|
+
*/
|
|
246
|
+
trackByFn(index: number, item: NavigationItem): string | number | undefined;
|
|
247
|
+
shouldRenderItem(item: NavigationItem): boolean;
|
|
248
|
+
get treeTemplateData(): {
|
|
249
|
+
autoCollapse: boolean;
|
|
250
|
+
};
|
|
251
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationGroupItemComponent, never>;
|
|
252
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationGroupItemComponent, "vertical-navigation-group-item", never, { "autoCollapse": { "alias": "autoCollapse"; "required": false; }; "item": { "alias": "item"; "required": false; }; }, {}, never, never, true, never>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare class VerticalNavigationSpacerItemComponent {
|
|
256
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VerticalNavigationSpacerItemComponent, never>;
|
|
257
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VerticalNavigationSpacerItemComponent, "vertical-navigation-spacer-item", never, {}, {}, never, never, true, never>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export { VerticalNavigationAsideItemComponent, VerticalNavigationBasicItemComponent, VerticalNavigationCollapsableItemComponent, VerticalNavigationCompactComponent, VerticalNavigationDefaultComponent, VerticalNavigationDenseComponent, VerticalNavigationDividerItemComponent, VerticalNavigationGroupItemComponent, VerticalNavigationSpacerItemComponent, VerticalNavigationThinComponent };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Params, QueryParamsHandling, IsActiveMatchOptions } from '@angular/router';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
|
|
4
|
+
type NavigationItemType = 'aside' | 'basic' | 'collapsable' | 'divider' | 'group' | 'spacer';
|
|
5
|
+
interface NavigationItemClasses {
|
|
6
|
+
title?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
wrapper?: string;
|
|
10
|
+
}
|
|
11
|
+
interface NavigationItemBadge {
|
|
12
|
+
title?: string;
|
|
13
|
+
classes?: string;
|
|
14
|
+
}
|
|
15
|
+
type NavigationVisibilityHandler = (item: NavigationItem) => boolean;
|
|
16
|
+
type NavigationActionHandler = (item: NavigationItem) => void;
|
|
17
|
+
interface NavigationItemBase {
|
|
18
|
+
/** Unique identifier untuk item navigasi */
|
|
19
|
+
id?: string;
|
|
20
|
+
/** Judul/label yang ditampilkan */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** Subtitle/deskripsi tambahan */
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
/** Status aktif item */
|
|
25
|
+
active?: boolean;
|
|
26
|
+
/** Status disabled item */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Tooltip text saat hover */
|
|
29
|
+
tooltip?: string;
|
|
30
|
+
/** Custom CSS classes */
|
|
31
|
+
classes?: NavigationItemClasses;
|
|
32
|
+
/** Material icon name */
|
|
33
|
+
icon?: string;
|
|
34
|
+
/** Badge configuration */
|
|
35
|
+
badge?: NavigationItemBadge;
|
|
36
|
+
/** Additional metadata */
|
|
37
|
+
meta?: Record<string, unknown>;
|
|
38
|
+
/** Function untuk hide/show item secara dinamis */
|
|
39
|
+
isHidden?: NavigationVisibilityHandler;
|
|
40
|
+
}
|
|
41
|
+
interface NavigationRoutableItemBase extends NavigationItemBase {
|
|
42
|
+
/** Angular router link */
|
|
43
|
+
link?: string;
|
|
44
|
+
/** URL fragment (#anchor) */
|
|
45
|
+
fragment?: string;
|
|
46
|
+
/** Preserve fragment saat navigasi */
|
|
47
|
+
preserveFragment?: boolean;
|
|
48
|
+
/** Query parameters untuk routing */
|
|
49
|
+
queryParams?: Params | null;
|
|
50
|
+
/** Cara handle query params */
|
|
51
|
+
queryParamsHandling?: QueryParamsHandling | null;
|
|
52
|
+
/** Flag untuk external link */
|
|
53
|
+
externalLink?: boolean;
|
|
54
|
+
/** Target untuk external link */
|
|
55
|
+
target?: '_blank' | '_self' | '_parent' | '_top' | string;
|
|
56
|
+
/** Exact match untuk active route */
|
|
57
|
+
exactMatch?: boolean;
|
|
58
|
+
/** Options untuk active match detection */
|
|
59
|
+
isActiveMatchOptions?: IsActiveMatchOptions;
|
|
60
|
+
/** Custom action yang dipanggil saat item diklik */
|
|
61
|
+
action?: NavigationActionHandler;
|
|
62
|
+
}
|
|
63
|
+
interface NavigationBasicItem extends NavigationRoutableItemBase {
|
|
64
|
+
type: 'basic';
|
|
65
|
+
children?: never;
|
|
66
|
+
}
|
|
67
|
+
interface NavigationAsideItem extends NavigationRoutableItemBase {
|
|
68
|
+
type: 'aside';
|
|
69
|
+
children: NavigationItem[];
|
|
70
|
+
}
|
|
71
|
+
interface NavigationCollapsableItem extends NavigationRoutableItemBase {
|
|
72
|
+
type: 'collapsable';
|
|
73
|
+
children: NavigationItem[];
|
|
74
|
+
}
|
|
75
|
+
interface NavigationGroupItem extends NavigationItemBase {
|
|
76
|
+
type: 'group';
|
|
77
|
+
children: NavigationItem[];
|
|
78
|
+
}
|
|
79
|
+
interface NavigationDividerItem extends NavigationItemBase {
|
|
80
|
+
type: 'divider';
|
|
81
|
+
children?: never;
|
|
82
|
+
}
|
|
83
|
+
interface NavigationSpacerItem extends NavigationItemBase {
|
|
84
|
+
type: 'spacer';
|
|
85
|
+
children?: never;
|
|
86
|
+
}
|
|
87
|
+
type NavigationBranchItem = NavigationAsideItem | NavigationCollapsableItem | NavigationGroupItem;
|
|
88
|
+
type NavigationLeafItem = NavigationBasicItem | NavigationDividerItem | NavigationSpacerItem;
|
|
89
|
+
type NavigationItem = NavigationBranchItem | NavigationLeafItem;
|
|
90
|
+
/**
|
|
91
|
+
* Navigation Item Interface
|
|
92
|
+
*
|
|
93
|
+
* Interface ini mendefinisikan struktur data untuk setiap item navigasi
|
|
94
|
+
* Mendukung berbagai tipe item dan konfigurasi routing Angular
|
|
95
|
+
*/
|
|
96
|
+
type NavigationStructuredItem = NavigationItem;
|
|
97
|
+
/**
|
|
98
|
+
* Vertical Navigation Appearances
|
|
99
|
+
* - default: 280px width, full labels & icons
|
|
100
|
+
* - compact: 240px width, slightly condensed
|
|
101
|
+
* - dense: 200px width, more condensed
|
|
102
|
+
* - thin: 80px width, icon only (labels on hover)
|
|
103
|
+
*/
|
|
104
|
+
type VerticalNavigationAppearance = 'default' | 'compact' | 'dense' | 'thin';
|
|
105
|
+
/**
|
|
106
|
+
* Vertical Navigation Modes
|
|
107
|
+
* - over: Overlay mode (fixed position, z-index tinggi)
|
|
108
|
+
* - side: Side mode (relative position, push content)
|
|
109
|
+
*/
|
|
110
|
+
type VerticalNavigationMode = 'over' | 'side';
|
|
111
|
+
/**
|
|
112
|
+
* Vertical Navigation Position
|
|
113
|
+
*/
|
|
114
|
+
type VerticalNavigationPosition = 'left' | 'right';
|
|
115
|
+
|
|
116
|
+
declare function getNavigationItemAction(item: NavigationItem): NavigationActionHandler | undefined;
|
|
117
|
+
declare function getNavigationItemVisibilityHandler(item: NavigationItem): NavigationVisibilityHandler | undefined;
|
|
118
|
+
declare function isNavigationItemHidden(item: NavigationItem): boolean;
|
|
119
|
+
declare function shouldRenderNavigationItem(item: NavigationItem): boolean;
|
|
120
|
+
declare function hasNavigationChildren(item: NavigationItem): item is NavigationBranchItem;
|
|
121
|
+
declare function getNavigationChildren(item: NavigationItem): NavigationItem[];
|
|
122
|
+
declare function isNavigationRoutableItem(item: NavigationItem): item is NavigationItem & NavigationRoutableItemBase;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Navigation Service
|
|
126
|
+
*
|
|
127
|
+
* Service ini bertanggung jawab untuk:
|
|
128
|
+
* 1. Store dan retrieve navigation data
|
|
129
|
+
* 2. Menyediakan state aktif dan expanded item
|
|
130
|
+
* 3. Utility functions untuk navigation operations
|
|
131
|
+
*/
|
|
132
|
+
declare class NavigationService {
|
|
133
|
+
private _navigation;
|
|
134
|
+
private _activeItemId;
|
|
135
|
+
private _expandedItemIds;
|
|
136
|
+
readonly navigationItems: _angular_core.Signal<NavigationItem[]>;
|
|
137
|
+
readonly activeItemId: _angular_core.Signal<string | null>;
|
|
138
|
+
readonly flatNavigation: _angular_core.Signal<NavigationItem[]>;
|
|
139
|
+
readonly expandedItemIds: _angular_core.Signal<string[]>;
|
|
140
|
+
/**
|
|
141
|
+
* Store navigation data
|
|
142
|
+
* Biasanya dipanggil saat app initialization
|
|
143
|
+
*/
|
|
144
|
+
storeNavigation(navigation: NavigationItem[]): void;
|
|
145
|
+
/**
|
|
146
|
+
* Get navigation data dari storage
|
|
147
|
+
*/
|
|
148
|
+
getNavigation(): NavigationItem[];
|
|
149
|
+
/**
|
|
150
|
+
* Delete navigation data dari storage
|
|
151
|
+
*/
|
|
152
|
+
deleteNavigation(): void;
|
|
153
|
+
setActiveItem(id: string | null): void;
|
|
154
|
+
clearActiveItem(): void;
|
|
155
|
+
getActiveItem(navigation?: NavigationItem[]): NavigationItem | null;
|
|
156
|
+
expandItem(id: string): void;
|
|
157
|
+
collapseItem(id: string): void;
|
|
158
|
+
toggleItemExpanded(id: string): void;
|
|
159
|
+
isItemExpanded(id: string): boolean;
|
|
160
|
+
clearExpandedItems(): void;
|
|
161
|
+
/**
|
|
162
|
+
* Flatten navigation array
|
|
163
|
+
* Convert nested structure menjadi flat array (hanya basic items)
|
|
164
|
+
* Berguna untuk search, analytics, atau operations lainnya
|
|
165
|
+
*/
|
|
166
|
+
getFlatNavigation(navigation: NavigationItem[], flatNavigation?: NavigationItem[]): NavigationItem[];
|
|
167
|
+
/**
|
|
168
|
+
* Get item by ID dari navigation tree
|
|
169
|
+
* Recursive search untuk find item dengan id tertentu
|
|
170
|
+
*/
|
|
171
|
+
getItem(id: string, navigation: NavigationItem[]): NavigationItem | null;
|
|
172
|
+
/**
|
|
173
|
+
* Get parent dari item dengan id tertentu
|
|
174
|
+
* Berguna untuk breadcrumb atau navigation path
|
|
175
|
+
*/
|
|
176
|
+
getItemParent(id: string, navigation: NavigationItem[], parent: NavigationItem[] | NavigationItem): NavigationItem[] | NavigationItem | null;
|
|
177
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavigationService, never>;
|
|
178
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NavigationService>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { NavigationService, getNavigationChildren, getNavigationItemAction, getNavigationItemVisibilityHandler, hasNavigationChildren, isNavigationItemHidden, isNavigationRoutableItem, shouldRenderNavigationItem };
|
|
182
|
+
export type { NavigationActionHandler, NavigationAsideItem, NavigationBasicItem, NavigationBranchItem, NavigationCollapsableItem, NavigationDividerItem, NavigationGroupItem, NavigationItem, NavigationItemBadge, NavigationItemBase, NavigationItemClasses, NavigationItemType, NavigationLeafItem, NavigationRoutableItemBase, NavigationSpacerItem, NavigationStructuredItem, NavigationVisibilityHandler, VerticalNavigationAppearance, VerticalNavigationMode, VerticalNavigationPosition };
|