import { PassThroughOption, PassThrough } from 'primeng/api'; import { TemplateRef } from '@angular/core'; import { PaginatorPassThrough } from 'primeng/types/paginator'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link DataView.pt} * @group Interface */ interface DataViewPassThroughOptions { /** * Used to pass attributes to the host's DOM element. */ host?: PassThroughOption; /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the loading container's DOM element. */ loading?: PassThroughOption; /** * Used to pass attributes to the loading overlay's DOM element. */ loadingOverlay?: PassThroughOption; /** * Used to pass attributes to the loading icon's DOM element. */ loadingIcon?: PassThroughOption; /** * Used to pass attributes to the header's DOM element. */ header?: PassThroughOption; /** * Used to pass attributes to the content container's DOM element. */ content?: PassThroughOption; /** * Used to pass attributes to the empty message's DOM element. */ emptyMessage?: PassThroughOption; /** * Used to pass attributes to the footer's DOM element. */ footer?: PassThroughOption; /** * Used to pass attributes to the Paginator component. */ pcPaginator?: PaginatorPassThrough; } /** * Defines valid pass-through options in DataView. * @see {@link DataViewPassThroughOptions} * * @template I Type of instance. */ type DataViewPassThrough = PassThrough>; /** * State of the paginator. * @group Interface */ interface DataViewPaginatorState { /** * Current page. */ page?: number; /** * First item in the current page. */ first?: number; /** * Row count. */ rows?: number; /** * Page count. */ pageCount?: number; } /** * Custom lazy load event. * @see {@link DataView.onLazyLoad} * @group Events */ interface DataViewLazyLoadEvent { /** * Index of the first element. */ first: number; /** * Row count. */ rows: number; /** * Property name of data to use in sorting by default. */ sortField: string; /** * Order to sort the data by default. */ sortOrder: number; } /** * Custom page event. * @see {@link DataView.onPage} * @group Events */ interface DataViewPageEvent { /** * Index of the first element. */ first: number; /** * Row count. */ rows: number; } /** * Custom sort event. * @see {@link DataView.onSort} * @group Events */ interface DataViewSortEvent { /** * Sort field. */ sortField: string; /** * Sort order. */ sortOrder: number; } /** * Custom layout change. * @see {@link DataView.onChangeLayout} * @group Events */ interface DataViewLayoutChangeEvent { /** * Layout of the component. */ layout: 'list' | 'grid'; } /** * Custom list template context. * @group Interface */ interface DataViewListTemplateContext { /** * Rows data for the current page. */ $implicit: T[]; } /** * Custom grid template context. * @group Interface */ interface DataViewGridTemplateContext { /** * Rows data for the current page. */ $implicit: T[]; } /** * Custom paginator left template context. * @group Interface */ interface DataViewPaginatorLeftTemplateContext { /** * State of the paginator. */ $implicit: DataViewPaginatorState; } /** * Custom paginator right template context. * @group Interface */ interface DataViewPaginatorRightTemplateContext { /** * State of the paginator. */ $implicit: DataViewPaginatorState; } /** * Custom paginator dropdown item template context. * @group Interface */ interface DataViewPaginatorDropdownItemTemplateContext { /** * Dropdown item instance (rows per page option). */ $implicit: number; } /** * Defines valid templates in DataView. * @group Templates */ interface DataViewTemplates { /** * Custom list template. * @param {Object} context - data of the DataView. */ list(context: DataViewListTemplateContext): TemplateRef>; /** * Custom grid template. * @param {Object} context - data of the DataView. */ grid(context: DataViewGridTemplateContext): TemplateRef>; /** * Custom paginator left template. * @param {Object} context - paginator state. */ paginatorleft(context: DataViewPaginatorLeftTemplateContext): TemplateRef; /** * Custom paginator right template. * @param {Object} context - paginator state. */ paginatorright(context: DataViewPaginatorRightTemplateContext): TemplateRef; /** * Custom paginator dropdown template. * @param {Object} context - dropdown item. */ paginatordropdownitem(context: DataViewPaginatorDropdownItemTemplateContext): TemplateRef; /** * Custom empty message template. */ emptymessage(): TemplateRef; /** * Custom header template. */ header(): TemplateRef; /** * Custom footer template. */ footer(): TemplateRef; /** * Custom loading icon template. */ loadingicon(): TemplateRef; /** * Custom list icon template. */ listicon(): TemplateRef; /** * Custom grid icon template. */ gridicon(): TemplateRef; } export type { DataViewGridTemplateContext, DataViewLayoutChangeEvent, DataViewLazyLoadEvent, DataViewListTemplateContext, DataViewPageEvent, DataViewPaginatorDropdownItemTemplateContext, DataViewPaginatorLeftTemplateContext, DataViewPaginatorRightTemplateContext, DataViewPaginatorState, DataViewPassThrough, DataViewPassThroughOptions, DataViewSortEvent, DataViewTemplates };