import { Location } from '@angular/common'; import { HttpHeaders } from '@angular/common/http'; import { AfterViewInit, ChangeDetectorRef, ElementRef, OnInit, QueryList, Type } from '@angular/core'; import { MatExpansionPanel } from '@angular/material/expansion'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Title } from '@angular/platform-browser'; import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { AppSetting } from '../../common/models/app-setting'; import { VdDialogService } from '../../dialogs/services/dialog.service'; import { VdMediaService } from '../../media/services/media.service'; import { Menu } from '../../menu/models/menu'; import { MessageType } from '../enums/message-type'; import { AuthUser } from '../models/auth-user'; import * as i0 from "@angular/core"; /** * A base list component for components with pagination support */ export declare abstract class BaseComponent implements OnInit, AfterViewInit { protected route: ActivatedRoute; protected changeDetectorRef: ChangeDetectorRef; /** * App settings */ appSetting: AppSetting; /** * Menu items */ menu: Menu; /** * The name of the project */ projectName: string; /** * The title of the current page */ title: string; /** * The subtitle of the current outlet */ subtitle: string; /** * If true, use some dummy data and show debug logs */ debug: boolean; /** * Loading status */ isLoading: boolean; /** * Saving status */ _isSaving: boolean; get isSaving(): boolean; set isSaving(isSaving: boolean); /** * A flag eindicates that the editor is inited */ isEditorInitialzed: boolean; /** * Represents the request errors */ errors: Array; /** * Used to evaluate whether a given media query is true or false given the current device's screen / window size. */ media: VdMediaService; /** * Allowed file extensions */ allowedExtensions: string[]; /** * tinyMCE plugins */ editorPlugins: string; /** * tinyMCE editor */ editorToolbar: string; /** * Editor configuration */ editorConfig: any; /** * Provides the navigation and url manipulation capabilities. */ router: Router; /** * urlHash: string */ urlHash: string; /** * Class name */ className: string; /** * Create permission */ canCreate: boolean; /** * Update permission */ canUpdate: boolean; /** * Current route */ currentRoute: string; /** * Current base route */ currentBaseRoute: string; /** * A url to return to after save */ returnUrl: string; /** * Current user object */ currentUser: AuthUser; /** * A service that can be used to get and set the title of a current HTML document. */ protected titleService: Title; /** * A service to dispatch Material Design snack bar messages. */ protected snackBarService: MatSnackBar; /** * A service to show conirm and prompt dialogs. */ protected dialogService: VdDialogService; /** * location: Location */ protected location: Location; /** * If true, set url hash */ protected setUrlHash: boolean; /** * MatExpansionPanel ref */ protected matExpansionPanelElementQueryList: QueryList; /** * MatExpansionPanel ref */ protected matExpansionPanelQueryList: QueryList; /** * Constructor */ constructor(route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef); /** * Lifecycle hook that is called after data-bound properties * of a directive are initialized. */ ngOnInit(): void; /** * Lifecycle hook that is called after a component's view has been fully initialized. */ ngAfterViewInit(): void; /** * Refreshs this page/component */ reloadPage(): void; /** * Navigates back to return url */ navigateToReturnUrl(): void; detectChanges(): void; /** * Sets return url * @param returnUrl */ protected setReturnUrl(returnUrl: string): void; /** * Listen for expansion panel changes */ protected onExpansionPanelChanges(): void; /** * Retrieves an instance from the injector based on the provided token. * If not found: * - Throws {@link NoProviderError} if no `notFoundValue` that is not equal to * Injector.THROW_IF_NOT_FOUND is given * - Returns the `notFoundValue` otherwise */ protected getService(token: Type): T; /** * Gets base route * @param snapshot */ protected getMainRoute(snapshot: ActivatedRouteSnapshot): ActivatedRouteSnapshot; /** * Shows a confirm dialog to delete an item */ protected showDeleteItemDialog(): Observable; /** * Shows a confirm dialog to delete multiple items */ protected showDeleteItemsDialog(): Observable; /** * Shows a confirm dialog to send some data * @param message The message to display * @param observabe The observable instance * @param successCallback A success callback * @param errorCallback An error callback */ showConfirmationDialog(message: string, observabe: Observable, successCallback?: Function, errorCallback?: Function): void; /** * Shows a message * @param message The message to display * @param type The type of the message */ protected showMessage(message?: string, type?: MessageType): void; /** * Initoalizes the tinymce editor */ protected initEditor(editorConfig?: any): void; /** * Sets subtitle from curren menu */ protected setTitles(): void; /** * Navigate based on the provided array of commands and a starting point. * @param commands */ protected navigate(commands: any[], queryParams?: any): void; /** * Convert Object to HttpHeaders * * @param body */ protected toHttpHeaders(body: Object): HttpHeaders; /** * Parses http response errors * @param errors */ protected parseErrors(errors: Object): void; /** * Handle Http operation that failed. * Let the app continue. * @param operation - name of the operation that failed * @param result - optional value to return as the observable result */ protected handleError(operation?: string, result?: T): (error: any) => Observable; /** * Log to console * @param message * @param optionalParams */ protected log(message: string, ...optionalParams: any[]): void; /** * Log to console * @param message * @param optionalParams */ protected warn(message: string, ...optionalParams: any[]): void; /** * Cleans the objects * Removes empty properties * @param obj */ protected clean(obj: any): any; /** * Sanitizes the specified object * @param obj * @returns */ protected sanitizeObject(obj: any, ...ignore: string[]): any; /** * Checks if the user seleceted any text in the document * @returns */ protected isTextSelected: () => boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }