import * as _bootkit_ng1_common from '@bootkit/ng1/common'; import { formatString } from '@bootkit/ng1/common'; import * as _bootkit_ng1_localization from '@bootkit/ng1/localization'; import { LocalizationService, TableComponentPagingFormatter } from '@bootkit/ng1/localization'; import * as _angular_core from '@angular/core'; import { OnInit, TemplateRef, AfterContentInit, OnDestroy, ChangeDetectorRef, QueryList } from '@angular/core'; import { DataSource, DataSourceLike, DataResult } from '@bootkit/ng1/data'; import { ItemSelectEvent } from '@bootkit/ng1/components/select'; /** * Type of the table column. * This can be a primitive type like 'number', 'currency', 'date', 'time', * or an object with specific formatting options. */ type TableColumnType = 'text' | 'number' | 'currency' | 'date' | 'time' | { /** Enum formatting options */ enum?: { /** The name of the enum to use for translation */ name: string; fallback?: string; }; /** Boolean formatting options */ boolean?: { false?: string; true?: string; }; currency?: {}; }; /** * Type of the table column filter. * This is used for determining the type of filter to show in the column header when filtering is enabled. */ type TableColumnFilterType = 'text' | 'number' | 'currency' | 'date' | 'time' | 'select'; /** * Directive for defining a column in the ng0-table component. * This directive is used to specify the configuration of each column, such as the field to bind to, the title, formatting options, filtering options, and sorting options. */ declare class TableColumnDirective implements OnInit { private readonly _injector; /** * The field in the data source to bind to. If not set, the column will not display any data. * @deprecated Use formatBy input. */ readonly field: _angular_core.InputSignal; /** * A fromatter to convert each item to a string for display. * This can be a function, a string (field name), or an array of formatters. * If not set, the default formatter will be used, which simply calls toString() on the value. */ readonly formatBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_localization.ObjectFormatter, _bootkit_ng1_localization.ObjectFormatterLike>; /** * The title of the column. This will be displayed in the header row. */ readonly title: _angular_core.InputSignal; /** * Text to display in the cell if the value is null or undefined. */ readonly emptyCell: _angular_core.InputSignal; /** * Type of the table cell. * @deprecated The `type` input is no longer used for formatting. Use `formatBy` instead. */ readonly type: _angular_core.InputSignal; /** * CSS class(es) to apply to the table cell. */ readonly cellClass: _angular_core.InputSignal; /** * @deprecated Use `cellClass` instead. */ readonly bold: _angular_core.InputSignalWithTransform; /** * @deprecated Use `cellClass` instead. */ readonly shrink: _angular_core.InputSignalWithTransform; /** * If true, the column will support filtering. */ readonly filterable: _angular_core.InputSignalWithTransform; /** * The type of filter to show in the column header when filtering is enabled. * This determines the UI of the filter input. */ readonly filterType: _angular_core.InputSignal; /** * The data source to use for filtering. * This is used when the filterType is 'select' to populate the dropdown options. */ readonly filterItems: _angular_core.InputSignalWithTransform | undefined, DataSourceLike>; /** * A formatter to convert each filter item to a string for display in the filter dropdown. * This is used when the filterType is 'select' to display the options in the dropdown. It can be a function, a string (field name), or an array of formatters. * If not set, the default formatter will be used, which simply calls toString() on the value. */ readonly filterFormatBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_localization.ObjectFormatter, _bootkit_ng1_localization.ObjectFormatterLike>; /** * A function to compare filter items for selection. * This is used when the filterType is 'select' to determine which item is selected based on the current filterValue. * If not set, the default equality comparer will be used, which compares values using strict equality (===). */ readonly filterCompareBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.EqualityComparer, _bootkit_ng1_common.EqualityComparerLike>; /** * A function to write the filter value back to the model when using select filter type. * This is used when the filterType is 'select' to convert the selected item from the dropdown back to the value that should be set as filterValue. * If not set, the default value writer will be used, which simply returns the selected item as is. */ readonly filterWriteBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.ValueWriter, _bootkit_ng1_common.ValueWriterLike>; /** * The name of the filter to use for this column. * This is used when grid is creating a DataRequest object to send to the data source. */ readonly filterName: _angular_core.InputSignal; /** * The current filter value of the column. */ readonly filterValue: _angular_core.ModelSignal; /** * The current filter operator of the column. */ readonly filterOperator: _angular_core.ModelSignal; /** * The list of filter operators to show in the filter dropdown. If not set, a default list will be used based on the column type. */ readonly filterOperators: _angular_core.InputSignal; /** * If true, the filter operators dropdown will be shown. */ readonly showFilterOperators: _angular_core.WritableSignal; /** * The name of the field in the data source. If not set, the `field` property will be used. * @deprecated Use FilterName for filtering and FormatBy for display instead. */ readonly fieldName: _angular_core.InputSignal; /** * If true, the column will support sorting. */ readonly sortable: _angular_core.InputSignalWithTransform; /** * The current sort direction of the column. */ readonly sortDirection: _angular_core.ModelSignal<"none" | "asc" | "desc">; readonly template?: TemplateRef; constructor(); ngOnInit(): void; /** * @private */ getFilterOperators(): string[]; /** * Toggle the sort direction of the column. * @returns void */ toggleSortDirection(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class TableDetailRowDirective { readonly templateRef: TemplateRef; showCallback?: (row: any) => boolean; constructor(templateRef: TemplateRef); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * A generic table component that can display data in a tabular format. * It supports features like pagination, sorting, filtering, and row details. * It can be used with any data source that implements the DataSource interface. */ declare class TableComponent implements AfterContentInit, OnDestroy { protected readonly _ls: LocalizationService; private readonly _destroyRef; protected _changeDetectorRef: ChangeDetectorRef; private _changeSubscription?; protected _columns: QueryList; protected _detailRow?: TableDetailRowDirective; protected readonly _dataResult: _angular_core.WritableSignal | undefined>; protected readonly _error: _angular_core.WritableSignal; protected _rowStates: Map; protected _formatString: typeof formatString; protected _pagingFormatter: TableComponentPagingFormatter; /** * The data source for the table. * This can be an array of data, a function that returns an observable of data, * or an instance of DataSource. */ readonly source: _angular_core.InputSignalWithTransform, DataSourceLike>; /** * If true, the table will automatically load data when initialized. * This is useful for tables that need to display data immediately without user interaction. */ readonly autoLoad: _angular_core.InputSignalWithTransform; /** * If true, the table will show row numbers. * This will add a column to the left of the table with the row numbers. */ readonly showRowNumbers: _angular_core.InputSignalWithTransform; /** * If true, the table will show the header row. */ readonly showHeader: _angular_core.InputSignalWithTransform; /** * If true, the table will support pagination. */ readonly pageable: _angular_core.InputSignalWithTransform; /** * The currently selected page in the table. * @default 0 */ readonly pageIndex: _angular_core.ModelSignal; /** * The number of records to display per page. * @default 10 */ readonly pageSize: _angular_core.ModelSignal; /** * Maximum number of visible pages in the pagination controls. * @default 10 */ readonly maxVisiblePages: _angular_core.InputSignalWithTransform; /** * If true, the table will show pagination controls at the bottom. * This will allow users to navigate between pages of data. * @default true */ readonly showPagingControls: _angular_core.InputSignalWithTransform; /** * Whether to show the first and last buttons in the pagination controls. * @default true */ readonly showFirstLastButtons: _angular_core.InputSignalWithTransform; /** * Whetheer to show the next and previous buttons in the pagination controls. * @default true */ readonly showNextPreviousButtons: _angular_core.InputSignalWithTransform; /** * Array of page size options to display in the page size selector. * If not provided, the default page size options will be used. * @default true */ readonly pageSizeOptions: _angular_core.InputSignal; /** * Whether to show paging info at the bottom of the table. * This will show the number of records displayed and total records. * @default true */ readonly showPagingInfo: _angular_core.InputSignalWithTransform; /** * If true, the table will support sorting. * This will add a sort icon to each column header. */ readonly sortable: _angular_core.InputSignalWithTransform; /** * The CSS class to apply to the internal table element. * This can be used to apply custom styles to the table. */ readonly tableClass: _angular_core.InputSignal; /** * The CSS class to apply to the header element. */ readonly headerClass: _angular_core.InputSignal; /** * The caption of the table. */ readonly caption: _angular_core.InputSignal; /** * The height of the table in pixels. * This can be used to set a fixed height for the table. */ readonly height: _angular_core.InputSignal; /** * If true, the table will support filtering. * This will add a filter input to each column header. */ readonly filterable: _angular_core.InputSignalWithTransform; /** * The indicator to show while the table is loading data for the first time. */ readonly loadingIndicator: _angular_core.InputSignal<"none" | "simple" | "spinner">; /** If true, the table will show a loading cover while data is being loaded. * This can be used to prevent user interaction with the table while loading. * This cover is not displayed when the table is loading for the first time. * Instead, the table will show a loading based on loadingIndicator settings. */ readonly loadingCover: _angular_core.InputSignal<"none" | "simple" | "spinner">; ngAfterContentInit(): void; /** * Manually triggers a refresh of the table. This can be used to update the table's display after making changes to the data or state. * It will mark the component for check, which will cause Angular to re-render the component and update the displayed data. */ refresh(): void; /** * Loads data from the data source based on the current state of the table (pagination, sorting, filtering). * This method can be called manually to refresh the data in the table. * It will construct a DataRequest object based on the current pagination, sorting, and filtering settings, * and then call the load method of the data source with that request. */ load(pageIndex?: number): void; /** * Determines if the table is currently loading data. */ get isLoading(): _angular_core.Signal; protected _getCellValue(row: any, col: TableColumnDirective): any; protected _onPageChange(pageIndex: number): void; protected _onToggleRowDetailClick(row: any): void; protected isRowExpanded(row: any): boolean; protected _onToggleFilterOperator(col: TableColumnDirective): void; protected _onSelectFilterOperator(col: TableColumnDirective, filterOperator: string): void; _onPageSizeOptionsItemSelect(e: ItemSelectEvent): void; _onColumnHeaderClick(col: TableColumnDirective): void; protected _hasFilterableColumns: _angular_core.Signal; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class TableModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { TableColumnDirective, TableComponent, TableDetailRowDirective, TableModule };