275 lines
12 KiB
TypeScript
275 lines
12 KiB
TypeScript
import { ElementRef, OnInit, AfterContentInit, EventEmitter, QueryList, TemplateRef, OnChanges, SimpleChanges, ChangeDetectorRef, OnDestroy } from '@angular/core';
|
|
import { PrimeTemplate, FilterService, PrimeNGConfig } from 'primeng/api';
|
|
import { BlockableUI } from 'primeng/api';
|
|
import { Subscription } from 'rxjs';
|
|
import { Nullable } from 'primeng/ts-helpers';
|
|
import { DataViewLayoutChangeEvent, DataViewLazyLoadEvent, DataViewPageEvent, DataViewPaginatorState, DataViewSortEvent } from './dataview.interface';
|
|
import * as i0 from "@angular/core";
|
|
import * as i1 from "@angular/common";
|
|
import * as i2 from "primeng/api";
|
|
import * as i3 from "primeng/paginator";
|
|
import * as i4 from "primeng/icons/spinner";
|
|
import * as i5 from "primeng/icons/bars";
|
|
import * as i6 from "primeng/icons/thlarge";
|
|
/**
|
|
* DataView displays data in grid or list layout with pagination and sorting features.
|
|
* @group Components
|
|
*/
|
|
export declare class DataView implements OnInit, AfterContentInit, OnDestroy, BlockableUI, OnChanges {
|
|
el: ElementRef;
|
|
cd: ChangeDetectorRef;
|
|
filterService: FilterService;
|
|
config: PrimeNGConfig;
|
|
/**
|
|
* When specified as true, enables the pagination.
|
|
* @group Props
|
|
*/
|
|
paginator: boolean | undefined;
|
|
/**
|
|
* Number of rows to display per page.
|
|
* @group Props
|
|
*/
|
|
rows: number | undefined;
|
|
/**
|
|
* Number of total records, defaults to length of value when not defined.
|
|
* @group Props
|
|
*/
|
|
totalRecords: number | undefined;
|
|
/**
|
|
* Number of page links to display in paginator.
|
|
* @group Props
|
|
*/
|
|
pageLinks: number;
|
|
/**
|
|
* Array of integer/object values to display inside rows per page dropdown of paginator
|
|
* @group Props
|
|
*/
|
|
rowsPerPageOptions: number[] | any[] | undefined;
|
|
/**
|
|
* Position of the paginator.
|
|
* @group Props
|
|
*/
|
|
paginatorPosition: 'top' | 'bottom' | 'both';
|
|
/**
|
|
* Custom style class for paginator
|
|
* @group Props
|
|
*/
|
|
paginatorStyleClass: string | undefined;
|
|
/**
|
|
* Whether to show it even there is only one page.
|
|
* @group Props
|
|
*/
|
|
alwaysShowPaginator: boolean;
|
|
/**
|
|
* Target element to attach the paginator dropdown overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name).
|
|
* @group Props
|
|
*/
|
|
paginatorDropdownAppendTo: HTMLElement | ElementRef | TemplateRef<any> | string | null | undefined | any;
|
|
/**
|
|
* Paginator dropdown height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value.
|
|
* @group Props
|
|
*/
|
|
paginatorDropdownScrollHeight: string;
|
|
/**
|
|
* Template of the current page report element. Available placeholders are {currentPage},{totalPages},{rows},{first},{last} and {totalRecords}
|
|
* @group Props
|
|
*/
|
|
currentPageReportTemplate: string;
|
|
/**
|
|
* Whether to display current page report.
|
|
* @group Props
|
|
*/
|
|
showCurrentPageReport: boolean | undefined;
|
|
/**
|
|
* Whether to display a dropdown to navigate to any page.
|
|
* @group Props
|
|
*/
|
|
showJumpToPageDropdown: boolean | undefined;
|
|
/**
|
|
* When enabled, icons are displayed on paginator to go first and last page.
|
|
* @group Props
|
|
*/
|
|
showFirstLastIcon: boolean;
|
|
/**
|
|
* Whether to show page links.
|
|
* @group Props
|
|
*/
|
|
showPageLinks: boolean;
|
|
/**
|
|
* Defines if data is loaded and interacted with in lazy manner.
|
|
* @group Props
|
|
*/
|
|
lazy: boolean | undefined;
|
|
/**
|
|
* Whether to call lazy loading on initialization.
|
|
* @group Props
|
|
*/
|
|
lazyLoadOnInit: boolean;
|
|
/**
|
|
* Text to display when there is no data. Defaults to global value in i18n translation configuration.
|
|
* @group Props
|
|
*/
|
|
emptyMessage: string;
|
|
/**
|
|
* Inline style of the component.
|
|
* @group Props
|
|
*/
|
|
style: {
|
|
[klass: string]: any;
|
|
} | null | undefined;
|
|
/**
|
|
* Style class of the component.
|
|
* @group Props
|
|
*/
|
|
styleClass: string | undefined;
|
|
/**
|
|
* Style class of the grid.
|
|
* @group Props
|
|
*/
|
|
gridStyleClass: string;
|
|
/**
|
|
* Function to optimize the dom operations by delegating to ngForTrackBy, default algorithm checks for object identity.
|
|
* @group Props
|
|
*/
|
|
trackBy: Function;
|
|
/**
|
|
* Comma separated list of fields in the object graph to search against.
|
|
* @group Props
|
|
*/
|
|
filterBy: string | undefined;
|
|
/**
|
|
* Locale to use in filtering. The default locale is the host environment's current locale.
|
|
* @group Props
|
|
*/
|
|
filterLocale: string | undefined;
|
|
/**
|
|
* Displays a loader to indicate data load is in progress.
|
|
* @group Props
|
|
*/
|
|
loading: boolean | undefined;
|
|
/**
|
|
* The icon to show while indicating data load is in progress.
|
|
* @group Props
|
|
*/
|
|
loadingIcon: string | undefined;
|
|
/**
|
|
* Index of the first row to be displayed.
|
|
* @group Props
|
|
*/
|
|
first: number | undefined;
|
|
/**
|
|
* Property name of data to use in sorting by default.
|
|
* @group Props
|
|
*/
|
|
sortField: string | undefined;
|
|
/**
|
|
* Order to sort the data by default.
|
|
* @group Props
|
|
*/
|
|
sortOrder: number | undefined;
|
|
/**
|
|
* An array of objects to display.
|
|
* @group Props
|
|
*/
|
|
value: any[] | undefined;
|
|
/**
|
|
* Defines the layout mode.
|
|
* @group Props
|
|
*/
|
|
get layout(): 'list' | 'grid';
|
|
set layout(layout: 'list' | 'grid');
|
|
/**
|
|
* Callback to invoke when paging, sorting or filtering happens in lazy mode.
|
|
* @param {DataViewLazyLoadEvent} event - Custom lazy load event.
|
|
* @group Emits
|
|
*/
|
|
onLazyLoad: EventEmitter<DataViewLazyLoadEvent>;
|
|
/**
|
|
* Callback to invoke when pagination occurs.
|
|
* @param {DataViewPageEvent} event - Custom page event.
|
|
* @group Emits
|
|
*/
|
|
onPage: EventEmitter<DataViewPageEvent>;
|
|
/**
|
|
* Callback to invoke when sorting occurs.
|
|
* @param {DataViewSortEvent} event - Custom sort event.
|
|
* @group Emits
|
|
*/
|
|
onSort: EventEmitter<DataViewSortEvent>;
|
|
/**
|
|
* Callback to invoke when changing layout.
|
|
* @param {DataViewLayoutChangeEvent} event - Custom layout change event.
|
|
* @group Emits
|
|
*/
|
|
onChangeLayout: EventEmitter<DataViewLayoutChangeEvent>;
|
|
header: any;
|
|
footer: any;
|
|
templates: Nullable<QueryList<PrimeTemplate>>;
|
|
_value: Nullable<any[]>;
|
|
listTemplate: Nullable<TemplateRef<any>>;
|
|
gridTemplate: Nullable<TemplateRef<any>>;
|
|
itemTemplate: Nullable<TemplateRef<any>>;
|
|
headerTemplate: Nullable<TemplateRef<any>>;
|
|
emptyMessageTemplate: Nullable<TemplateRef<any>>;
|
|
footerTemplate: Nullable<TemplateRef<any>>;
|
|
paginatorLeftTemplate: Nullable<TemplateRef<any>>;
|
|
paginatorRightTemplate: Nullable<TemplateRef<any>>;
|
|
paginatorDropdownItemTemplate: Nullable<TemplateRef<any>>;
|
|
loadingIconTemplate: Nullable<TemplateRef<any>>;
|
|
listIconTemplate: Nullable<TemplateRef<any>>;
|
|
gridIconTemplate: Nullable<TemplateRef<any>>;
|
|
filteredValue: Nullable<any[]>;
|
|
filterValue: Nullable<string>;
|
|
initialized: Nullable<boolean>;
|
|
_layout: 'list' | 'grid';
|
|
translationSubscription: Nullable<Subscription>;
|
|
get emptyMessageLabel(): string;
|
|
constructor(el: ElementRef, cd: ChangeDetectorRef, filterService: FilterService, config: PrimeNGConfig);
|
|
ngOnInit(): void;
|
|
ngOnChanges(simpleChanges: SimpleChanges): void;
|
|
ngAfterContentInit(): void;
|
|
updateItemTemplate(): void;
|
|
changeLayout(layout: 'list' | 'grid'): void;
|
|
updateTotalRecords(): void;
|
|
paginate(event: DataViewPaginatorState): void;
|
|
sort(): void;
|
|
isEmpty(): boolean;
|
|
createLazyLoadMetadata(): DataViewLazyLoadEvent;
|
|
getBlockableElement(): HTMLElement;
|
|
filter(filter: string, filterMatchMode?: string): void;
|
|
hasFilter(): boolean;
|
|
ngOnDestroy(): void;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataView, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<DataView, "p-dataView", never, { "paginator": { "alias": "paginator"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "totalRecords": { "alias": "totalRecords"; "required": false; }; "pageLinks": { "alias": "pageLinks"; "required": false; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; }; "paginatorPosition": { "alias": "paginatorPosition"; "required": false; }; "paginatorStyleClass": { "alias": "paginatorStyleClass"; "required": false; }; "alwaysShowPaginator": { "alias": "alwaysShowPaginator"; "required": false; }; "paginatorDropdownAppendTo": { "alias": "paginatorDropdownAppendTo"; "required": false; }; "paginatorDropdownScrollHeight": { "alias": "paginatorDropdownScrollHeight"; "required": false; }; "currentPageReportTemplate": { "alias": "currentPageReportTemplate"; "required": false; }; "showCurrentPageReport": { "alias": "showCurrentPageReport"; "required": false; }; "showJumpToPageDropdown": { "alias": "showJumpToPageDropdown"; "required": false; }; "showFirstLastIcon": { "alias": "showFirstLastIcon"; "required": false; }; "showPageLinks": { "alias": "showPageLinks"; "required": false; }; "lazy": { "alias": "lazy"; "required": false; }; "lazyLoadOnInit": { "alias": "lazyLoadOnInit"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "gridStyleClass": { "alias": "gridStyleClass"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; "filterBy": { "alias": "filterBy"; "required": false; }; "filterLocale": { "alias": "filterLocale"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingIcon": { "alias": "loadingIcon"; "required": false; }; "first": { "alias": "first"; "required": false; }; "sortField": { "alias": "sortField"; "required": false; }; "sortOrder": { "alias": "sortOrder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; }, { "onLazyLoad": "onLazyLoad"; "onPage": "onPage"; "onSort": "onSort"; "onChangeLayout": "onChangeLayout"; }, ["header", "footer", "templates"], ["p-header", "p-footer"], false, never>;
|
|
static ngAcceptInputType_paginator: unknown;
|
|
static ngAcceptInputType_rows: unknown;
|
|
static ngAcceptInputType_totalRecords: unknown;
|
|
static ngAcceptInputType_pageLinks: unknown;
|
|
static ngAcceptInputType_alwaysShowPaginator: unknown;
|
|
static ngAcceptInputType_showCurrentPageReport: unknown;
|
|
static ngAcceptInputType_showJumpToPageDropdown: unknown;
|
|
static ngAcceptInputType_showFirstLastIcon: unknown;
|
|
static ngAcceptInputType_showPageLinks: unknown;
|
|
static ngAcceptInputType_lazy: unknown;
|
|
static ngAcceptInputType_lazyLoadOnInit: unknown;
|
|
static ngAcceptInputType_loading: unknown;
|
|
static ngAcceptInputType_first: unknown;
|
|
static ngAcceptInputType_sortOrder: unknown;
|
|
}
|
|
export declare class DataViewLayoutOptions {
|
|
dv: DataView;
|
|
style: {
|
|
[klass: string]: any;
|
|
} | null | undefined;
|
|
styleClass: string | undefined;
|
|
constructor(dv: DataView);
|
|
changeLayout(event: Event, layout: 'list' | 'grid'): void;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataViewLayoutOptions, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<DataViewLayoutOptions, "p-dataViewLayoutOptions", never, { "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; }, {}, never, never, false, never>;
|
|
}
|
|
export declare class DataViewModule {
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataViewModule, never>;
|
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DataViewModule, [typeof DataView, typeof DataViewLayoutOptions], [typeof i1.CommonModule, typeof i2.SharedModule, typeof i3.PaginatorModule, typeof i4.SpinnerIcon, typeof i5.BarsIcon, typeof i6.ThLargeIcon], [typeof DataView, typeof i2.SharedModule, typeof DataViewLayoutOptions]>;
|
|
static ɵinj: i0.ɵɵInjectorDeclaration<DataViewModule>;
|
|
}
|