import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough, LazyLoadMeta, FilterMetadata, TreeNode, TreeTableNode, SortMeta } from 'primeng/api'; import { BadgePassThrough } from 'primeng/types/badge'; import { CheckboxPassThrough } from 'primeng/types/checkbox'; import { PaginatorPassThrough } from 'primeng/types/paginator'; import { VirtualScrollerPassThrough } from 'primeng/types/scroller'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link TreeTableProps.pt} * @group Interface */ interface TreeTablePassThroughOptions { /** * 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's DOM element. */ loading?: PassThroughOption; /** * Used to pass attributes to the mask's DOM element. */ mask?: 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 Paginator component. * @see {@link PaginatorPassThrough} */ pcPaginator?: PaginatorPassThrough; /** * Used to pass attributes to the wrapper's DOM element. */ wrapper?: PassThroughOption; /** * Used to pass attributes to the table's DOM element. */ table?: PassThroughOption; /** * Used to pass attributes to the thead's DOM element. */ thead?: PassThroughOption; /** * Used to pass attributes to the tbody's DOM element. */ tbody?: PassThroughOption; /** * Used to pass attributes to the tfoot's DOM element. */ tfoot?: PassThroughOption; /** * Used to pass attributes to the footer's DOM element. */ footer?: PassThroughOption; /** * Used to pass attributes to the scrollable wrapper's DOM element. */ scrollableWrapper?: PassThroughOption; /** * Used to pass attributes to the scrollable container's DOM element. */ scrollableView?: PassThroughOption; /** * Used to pass attributes to the scrollable header's DOM element. */ scrollableHeader?: PassThroughOption; /** * Used to pass attributes to the scrollable header box's DOM element. */ scrollableHeaderBox?: PassThroughOption; /** * Used to pass attributes to the scrollable header table's DOM element. */ scrollableHeaderTable?: PassThroughOption; /** * Used to pass attributes to the Scroller component. * @see {@link VirtualScrollerPassThrough} */ virtualScroller?: VirtualScrollerPassThrough; /** * Used to pass attributes to the scrollable body's DOM element. */ scrollableBody?: PassThroughOption; /** * Used to pass attributes to the scrollable footer's DOM element. */ scrollableFooter?: PassThroughOption; /** * Used to pass attributes to the scrollable footer box's DOM element. */ scrollableFooterBox?: PassThroughOption; /** * Used to pass attributes to the scrollable footer table's DOM element. */ scrollableFooterTable?: PassThroughOption; /** * Used to pass attributes to the column resizer helper's DOM element. */ columnResizerHelper?: PassThroughOption; /** * Used to pass attributes to the reorder indicator up's DOM element. */ reorderIndicatorUp?: PassThroughOption; /** * Used to pass attributes to the reorder indicator down's DOM element. */ reorderIndicatorDown?: PassThroughOption; /** * Used to pass attributes to the sortable column's DOM element. */ sortableColumn?: PassThroughOption; /** * Used to pass attributes to the sortable column icon's DOM element. */ sortableColumnIcon?: PassThroughOption; /** * Used to pass attributes to the Badge component for sortable column. * @see {@link BadgePassThrough} */ pcSortableColumnBadge?: BadgePassThrough; /** * Used to pass attributes to the row's DOM element. */ row?: PassThroughOption; /** * Used to pass attributes to the Checkbox component for row. * @see {@link CheckboxPassThrough} */ pcRowCheckbox?: CheckboxPassThrough; /** * Used to pass attributes to the Checkbox component for header. * @see {@link CheckboxPassThrough} */ pcHeaderCheckbox?: CheckboxPassThrough; /** * Used to pass attributes to the cell editor's DOM element. */ cellEditor?: PassThroughOption; /** * Used to pass attributes to the row toggle button's DOM element. */ rowToggleButton?: PassThroughOption; /** * Used to pass attributes to the toggler's DOM element. */ toggler?: PassThroughOption; } /** * Defines valid pass-through options in TreeTable. * @see {@link TreeTablePassThroughOptions} * * @template I Type of instance. */ type TreeTablePassThrough = PassThrough>; /** * Paginator state. * @group Interface */ interface TreeTablePaginatorState { /** * Current page. */ page?: number; /** * Index of the first element. */ first?: number; /** * Row count. */ rows?: number; /** * Page count. */ pageCount?: number; } /** * Custom lazy load event. * @see {@link TreeTable.onLazyLoad} * @extends {LazyLoadMeta} * @group Events */ interface TreeTableLazyLoadEvent extends LazyLoadMeta { /** * First element in viewport. */ first: any; /** * Last element in viewport. */ last: any; } /** * Custom column reorder event. * @see {@link TreeTable.onColReorder} * @group Events */ interface TreeTableColumnReorderEvent { /** * Index of the dragged item. */ dragIndex?: number; /** * Index of the drop position. */ dropIndex?: number; /** * Columns after reorder. */ columns?: any[]; } /** * Custom filter event. * @see {@link TreeTable.onFilter} * @group Events */ interface TreeTableFilterEvent { /** * Filter meta. */ filters?: { [s: string]: FilterMetadata | undefined; }; /** * Value after filter. */ filteredValue?: TreeNode[]; } /** * Custom node expand event. * @see {@link TreeTable.onNodeExpand} * @group Events */ interface TreeTableNodeExpandEvent extends TreeTableNodeCollapseEvent { } /** * Custom node collapse event. * @see {@link TreeTable.onNodeCollapse} * @group Events */ interface TreeTableNodeCollapseEvent { /** * Browser event. */ originalEvent: Event; /** * Node instance. */ node: TreeTableNode; } /** * Custom sort event. * @see {@link TreeTable.onSort} * @see {@link TreeTable.sortFunction} * @group Events */ interface TreeTableSortEvent { /** * Browser event. */ originalEvent?: Event; /** * Value to be sorted. */ data?: TreeNode[]; /** * Sort mode. */ mode?: 'single' | 'multiple'; /** * Sort field. */ field?: string; /** * Sort order. */ order?: number; /** * Multiple sort meta. */ multiSortMeta?: SortMeta[] | null | undefined; /** * Multiple sort meta. */ multisortmeta?: any; /** * Sort meta. */ sortMeta?: SortMeta; } /** * Custom column resize event. * @see {@link TreeTable.onColResize} * @group Events */ interface TreeTableColResizeEvent { /** * Instance of resized column. */ element: HTMLElement; /** * Position. */ delta: number; } /** * Custom node select event. * @see {@link TreeTable.onNodeSelect} * @extends {TreeTableNode} * @group Events */ interface TreeTableNodeSelectEvent extends TreeTableNode { } /** * Custom node unselect event. * @see {@link TreeTable.onNodeUnSelect} * @group Events */ interface TreeTableNodeUnSelectEvent { /** * Browser event. */ originalEvent?: Event; /** * Node instance. */ node?: TreeTableNode; /** * Selection type. */ type?: string; } /** * Custom context menu select event. * @see {@link TreeTable.onContextMenuSelect} * @group Events */ interface TreeTableContextMenuSelectEvent { /** * Browser event. */ originalEvent: Event; /** * Node instance. */ node: TreeTableNode; } /** * Custom checkbox toggle event. * @see {@link TreeTable.onHeaderCheckboxToggle} * @group Events */ interface TreeTableHeaderCheckboxToggleEvent { /** * Browser event. */ originalEvent: Event; /** * Checked state. */ checked: boolean; } /** * Custom edit event. * @see {@link TreeTable.onEditInit} * @see {@link TreeTable.onEditCancel} * @see {@link TreeTable.onEditComplete} * @group Events */ interface TreeTableEditEvent { /** * Field to be edited. */ field: string; /** * New value. */ data: string; } /** * Filtering options. * @group Interface */ interface TreeTableFilterOptions { /** * Field to be filtered. */ filterField: string; /** * Value to use when filtering. */ filterValue: any; /** * Filter constraints. */ filterConstraint: (dataFieldValue: any, filterValue: any, filterLocale: string) => boolean; /** * Boolean value that defines if strict mode enabled. */ isStrictMode: boolean; } /** * Custom columns template context. * @group Interface */ interface TreeTableColumnsTemplateContext { /** * Columns instance. */ $implicit: any[]; } /** * Custom body template context. * @group Interface */ interface TreeTableBodyTemplateContext { /** * Node instance. */ $implicit: TreeNode; /** * Serialized node. */ node: TreeNode; /** * Row data. */ rowData: any; /** * Columns instance. */ columns: any[]; } /** * Custom empty message template context. * @group Interface */ interface TreeTableEmptyMessageTemplateContext { /** * Columns instance. */ $implicit: any[]; /** * Whether the column is frozen. */ frozen: boolean; } /** * Custom sort icon template context. * @group Interface */ interface TreeTableSortIconTemplateContext { /** * Sort order. */ $implicit: number; } /** * Custom checkbox icon template context. * @group Interface */ interface TreeTableCheckboxIconTemplateContext { /** * Checkbox state. */ $implicit: boolean; /** * Partial selection state of row node. */ partialSelected: boolean; } /** * Custom header checkbox icon template context. * @group Interface */ interface TreeTableHeaderCheckboxIconTemplateContext { /** * Checkbox state. */ $implicit: boolean; } /** * Custom toggler icon template context. * @group Interface */ interface TreeTableTogglerIconTemplateContext { /** * Expand state of row node. */ $implicit: boolean; } /** * Defines valid templates in TreeTable. * @group Templates */ interface TreeTableTemplates { /** * Custom caption template. */ caption(): TemplateRef; /** * Custom header template. * @param {TreeTableColumnsTemplateContext} context - header context. */ header(context: TreeTableColumnsTemplateContext): TemplateRef; /** * Custom body template. * @param {TreeTableBodyTemplateContext} context - body context. */ body(context: TreeTableBodyTemplateContext): TemplateRef; /** * Custom footer template. * @param {TreeTableColumnsTemplateContext} context - footer context. */ footer(context: TreeTableColumnsTemplateContext): TemplateRef; /** * Custom summary template. */ summary(): TemplateRef; /** * Custom colgroup template. * @param {TreeTableColumnsTemplateContext} context - column group context. */ colgroup(context: TreeTableColumnsTemplateContext): TemplateRef; /** * Custom empty message template. * @param {TreeTableEmptyMessageTemplateContext} context - empty message context. */ emptymessage(context: TreeTableEmptyMessageTemplateContext): TemplateRef; /** * Custom paginator left section template. */ paginatorleft(): TemplateRef; /** * Custom paginator right section template. */ paginatorright(): TemplateRef; /** * Custom paginator dropdown item template. */ paginatordropdownitem(): TemplateRef; /** * Custom frozen header template. * @param {TreeTableColumnsTemplateContext} context - frozen header context. */ frozenheader(context: TreeTableColumnsTemplateContext): TemplateRef; /** * Custom frozen body template. */ frozenbody(): TemplateRef; /** * Custom frozen footer template. * @param {TreeTableColumnsTemplateContext} context - frozen footer context. */ frozenfooter(context: TreeTableColumnsTemplateContext): TemplateRef; /** * Custom frozen column group template. * @param {TreeTableColumnsTemplateContext} context - frozen column group context. */ frozencolgroup(context: TreeTableColumnsTemplateContext): TemplateRef; /** * Custom loading icon template. */ loadingicon(): TemplateRef; /** * Custom reorder indicator up icon template. */ reorderindicatorupicon(): TemplateRef; /** * Custom reorder indicator down icon template. */ reorderindicatordownicon(): TemplateRef; /** * Custom sort icon template. * @param {TreeTableSortIconTemplateContext} context - sort icon context. */ sorticon(context: TreeTableSortIconTemplateContext): TemplateRef; /** * Custom checkbox icon template. * @param {TreeTableCheckboxIconTemplateContext} context - checkbox icon context. */ checkboxicon(context: TreeTableCheckboxIconTemplateContext): TemplateRef; /** * Custom header checkbox icon template. * @param {TreeTableHeaderCheckboxIconTemplateContext} context - header checkbox icon context. */ headercheckboxicon(context: TreeTableHeaderCheckboxIconTemplateContext): TemplateRef; /** * Custom toggler icon template. * @param {TreeTableTogglerIconTemplateContext} context - toggler icon context. */ togglericon(context: TreeTableTogglerIconTemplateContext): TemplateRef; /** * Custom paginator first page link icon template. */ paginatorfirstpagelinkicon(): TemplateRef; /** * Custom paginator last page link icon template. */ paginatorlastpagelinkicon(): TemplateRef; /** * Custom paginator previous page link icon template. */ paginatorpreviouspagelinkicon(): TemplateRef; /** * Custom paginator next page link icon template. */ paginatornextpagelinkicon(): TemplateRef; /** * Custom loader template. */ loader(): TemplateRef; } export type { TreeTableBodyTemplateContext, TreeTableCheckboxIconTemplateContext, TreeTableColResizeEvent, TreeTableColumnReorderEvent, TreeTableColumnsTemplateContext, TreeTableContextMenuSelectEvent, TreeTableEditEvent, TreeTableEmptyMessageTemplateContext, TreeTableFilterEvent, TreeTableFilterOptions, TreeTableHeaderCheckboxIconTemplateContext, TreeTableHeaderCheckboxToggleEvent, TreeTableLazyLoadEvent, TreeTableNodeCollapseEvent, TreeTableNodeExpandEvent, TreeTableNodeSelectEvent, TreeTableNodeUnSelectEvent, TreeTablePaginatorState, TreeTablePassThrough, TreeTablePassThroughOptions, TreeTableSortEvent, TreeTableSortIconTemplateContext, TreeTableTemplates, TreeTableTogglerIconTemplateContext };