UNPKG

@ctodev/cclibrary-typings

Version:

Library typings for use with CLARC INFINITY

114 lines (113 loc) 4.63 kB
import { OnDestroy } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { TccKeyValuePair } from '../../../odata/models/shared.model'; import { TopNavCrumbNode, TopNavLeaf, TopNavNode, TopNavSelectOption } from '../../components/tcc-top-navbar/tcc-top-navbar.component'; import { TccSingleton } from '../../models/tcc-singleton.model'; import { TccManageSingletonsService } from '../tcc-manage-singletons/tcc-manage-singletons.service'; export interface TopNavigation { node: TopNavCrumbNode; leaf?: TopNavLeaf; } export interface FlattenedNavigation { node: FlattenedTopNavNode; leaf?: TopNavLeaf; } export interface FlattenedTopNavNode extends TopNavNode { parents: Array<string>; } export interface IconButtonConfig { firstIcon: string | null; secondIcon: string | null; visible: boolean; isFirstIconNormalButton?: boolean; } export type IconButtonId = 'LEFT' | 'RIGHT'; export declare class TccTopNavService implements TccSingleton, OnDestroy { private router; private route; private routerSubscription; flattenedNodes: Array<FlattenedTopNavNode>; allNodes: { [nodeidentifier: string]: FlattenedTopNavNode; }; private basehref; private lasturl; private tempContextText; private tempContextData; private pastNavigations; lastNavigation: FlattenedNavigation; private lastCrumb; private _next; private _onNavigate; private _onCrumbClickSubject; private canNavigate; private settoactiveleaf; iconButtonConfig$: import("@angular/core").WritableSignal<IconButtonConfig>; private buttonClickSubject; readonly buttonClick$: Observable<IconButtonId>; activeLeaf$: import("@angular/core").WritableSignal<string>; set topNavElements(elements: Array<TopNavNode>); constructor(router: Router, manageSingletons: TccManageSingletonsService, route: ActivatedRoute); init(): void; reset(): void; _init(basehref: string): void; ngOnDestroy(): void; set contextData(data: any); get contextData(): any; set contextText(text: string); getContextData(nodeName: string): any; private resetContext; get OnTopNavigation(): Observable<TopNavigation>; get OnNavigationChange(): Observable<TopNavigation>; get onCrumbClick(): Observable<TopNavCrumbNode>; get Next(): Observable<{ breadcrumbs: Array<TopNavCrumbNode>; activeLeaf: string; activeNode: TopNavCrumbNode; }>; private set _Next(value); private set OnNavigate(value); setCanNavigateFunction(func: () => Observable<boolean>, leafs?: string[]): void; deleteCanNavigateFunction(): void; NavigatePath(path: string, contextText?: string, contextData?: any): void; Navigate(nodename: string, leafname: string, contextText?: string, contextData?: any): void; NavigateBack(): void; _onLeafSelect(leaf: TopNavLeaf, selectedPair: TccKeyValuePair): void; _onLeafClick(leaf: TopNavLeaf): void; private handleLeafClick; private handleLeafClickCallback; _onCrumbClick(crumb: TopNavCrumbNode): void; private getNodeByPath; private getNodeByUniqueIdentifier; private onCrumbClickClearContext; _onContextCrumbClick(crumb: TopNavCrumbNode): void; OnNavigation(url: string, leafId?: string): void; private compareFirst; private findNavigation; private returnLeafByUniqueIdentifier; private returnFirstLeaf; private pathIsEmpty; private pathisinpath; private find; buildLeafSelect(group: string, leaf: string, options: Array<TopNavSelectOption>): void; deleteFromCurrentLeafSelect(leaf: string, select: string, byName: boolean): void; private findCurrentLeaf; addToCurrentLeafSelect(leaf: string, select: TopNavSelectOption): void; hideLeaf(group: string, leaf: string): void; showLeaf(group: string, leaf: string): void; updateLeafSelectOption(group: string, leaf: string, selectValue: any, additional: string): void; getSelectedLeafValue(leaf: TopNavLeaf | string): any; private flattenNodes; private flattenNode; private nodeToCrumb; private getBreadCrumbs; private generateBreadCrumbs; private clearContextNodes; setIconButtonConfig(config: IconButtonConfig): void; emitButtonClick(id: IconButtonId): void; setIconButtonsVisible(visible: boolean): void; setTempContext(contextText: string, contextData: any): void; setParentUniqueContext(parent: string, contextText: string, contextData: any): void; setTempContextText(contextText: string): void; }