UNPKG

ng-hub-ui-table

Version:

Highly customizable Angular table and list components with pagination, sorting and filtering support.

84 lines (83 loc) 3.92 kB
import { TemplateRef } from '@angular/core'; import { FormArray, FormControl } from '@angular/forms'; import { ListClickEvent } from '../../../interfaces/item-click-event'; import { PaginableTableDropdown } from '../../../interfaces/paginable-table-dropdown'; import { PaginableTableOptions } from '../../../interfaces/paginable-table-options'; import { RowButton } from '../../../interfaces/row-button'; import * as i0 from "@angular/core"; export declare class PaginableListComponent<T = any> { #private; bindValue?: string; bindLabel: string; bindChildren: string; selectable: string | null; private _options; get options(): PaginableTableOptions; set options(v: PaginableTableOptions); private _items; get items(): Array<T>; set items(v: Array<T>); clickFn: (event: ListClickEvent<T>) => void | Promise<void>; form: FormArray; value: Array<T & { collapsed: boolean; }>; itemTpt?: TemplateRef<any>; noDataTpt?: TemplateRef<any>; isDisabled: boolean; onChange: any; onTouch: any; searchFG: FormControl<{} | null>; /** * Collection of actions for items * * @type {PaginableTableRowAction[]} * @memberof PaginableTableComponent */ private _batchActions; get batchActions(): Array<PaginableTableDropdown | RowButton>; set batchActions(v: Array<PaginableTableDropdown | RowButton>); writeValue(value?: Array<T>): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; /** * Handles the action to be executed in a batch * * @param {Event} event * @memberof PaginableTableComponent */ handleBatchAction(event: any): void; buildForm(form: FormArray, items: Array<any>): void; buildValue(items: Array<T>): Array<T & { collapsed: boolean; }>; toggleCollapsed(control: FormControl): void; /** * Emits a structured click event for the clicked list item, including metadata and state. * * This method is typically called when an item in the list is clicked. It extracts contextual * information such as depth, index, selection state, and expansion state, then passes it to * the user-defined `clickFn` callback. * * If a `bindLabel` is configured, the emitted `value` will be derived from that property; * otherwise, the full item will be passed as `value`. * * @param item - The list item object, including `selected` and `collapsed` state. * @param depth - The nesting depth of the item within a tree structure (0 = root level). * @param index - The position of the item in the current visible list or page. * @param event - The native `MouseEvent` that triggered the click. * * @remarks * If the `clickFn` callback is not defined, the method exits early and no event is emitted. */ onItemClick({ collapsed, selected, ...item }: { [x: string]: any; collapsed: any; selected: any; }, depth: number, index: number, event: MouseEvent): void; onPageClicked(page: number): void; filter(): void; static ɵfac: i0.ɵɵFactoryDeclaration<PaginableListComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PaginableListComponent<any>, "hub-list, hub-ui-list, hub-paginable-list", never, { "bindValue": { "alias": "bindValue"; "required": false; }; "bindLabel": { "alias": "bindLabel"; "required": false; }; "bindChildren": { "alias": "bindChildren"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "options": { "alias": "options"; "required": false; }; "items": { "alias": "items"; "required": false; }; "clickFn": { "alias": "clickFn"; "required": false; }; "batchActions": { "alias": "batchActions"; "required": false; }; }, {}, ["itemTpt", "noDataTpt"], never, true, never>; }