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