UNPKG

@rero/ng-core

Version:

RERO angular core library.

116 lines (115 loc) 3.58 kB
import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { FormlyFieldConfig } from '@ngx-formly/core'; import { ActionStatus } from '../action-status'; import { RecordUiService } from '../record-ui.service'; import { RecordSearchService } from './record-search.service'; import { JSONSchema7 } from '../editor/utils'; import * as i0 from "@angular/core"; export declare class RecordSearchPageComponent implements OnInit, OnDestroy { protected route: ActivatedRoute; protected router: Router; protected recordSearchService: RecordSearchService; protected recordUiService: RecordUiService; /** * Current selected resource type */ currentType: string; /** * URL to notice detail */ detailUrl: string; /** * Display search input */ showSearchInput: boolean; /** * Admin mode (edit, remove, add, ...) */ adminMode: ActionStatus; /** * Define the current record's page */ page: number; /** * Define the number of records per page */ size: number; /** * Search query */ q: string; /** * Define the sort order of resulting records. It takes a string value * representing the property which is used to sort the records. * If a minus is put before the value, the sort is reversed. */ sort: string; /** * Types of resources available */ types: { key: string; label: string; index?: string; component?: Component; total?: number; canAdd?: any; canUpdate?: any; canDelete?: any; canRead?: any; permissions?: any; aggregations?: any; preFilters?: any; listHeaders?: any; itemHeaders?: any; aggregationsName?: any; aggregationsOrder?: Array<string>; aggregationsExpand?: Array<string> | (() => Array<string>); aggregationsBucketSize?: number; pagination?: { boundaryLinks?: boolean; maxSize?: number; pageReport?: boolean; rowsPerPageOptions?: number[]; }; formFieldMap?: (field: FormlyFieldConfig, jsonSchema: JSONSchema7) => FormlyFieldConfig; }[]; /** * Subscription to route parameters observables */ private routeParametersSubscription; /** * Component initialization. * * Subscribes to changes of route parameters and query parameters for * updating the search parameters and sending them to child component * (RecordSearchComponent). */ ngOnInit(): void; /** * Component destruction. * * Unsubscribes from the observables of the route parameters. */ ngOnDestroy(): void; /** * Update URL accordingly to parameters given. * @param parameters Parameters to put in url or query string */ updateUrl(parameters: any): void; /** * Return current URL after removing query parameters and updating resource type. * * @returns Updated url without query string */ protected getCurrentUrl(type: string): string; /** * Sets the default sort for resource type. * * @param config Configuration object. */ private _setDefaultSort; static ɵfac: i0.ɵɵFactoryDeclaration<RecordSearchPageComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<RecordSearchPageComponent, "ng-core-record-search-page", never, {}, {}, never, never, false, never>; }