import * as i0 from '@angular/core'; import { InputSignal, OnInit, OutputEmitterRef, Signal, InputSignalWithTransform, TemplateRef, InjectionToken, Type, TrackByFunction, WritableSignal, ComponentRef, ViewContainerRef } from '@angular/core'; import * as _ppwcode_ng_common from '@ppwcode/ng-common'; import { SelectionModel } from '@angular/cdk/collections'; import * as i8 from '@angular/cdk/drag-drop'; import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { FormArray, FormGroup } from '@angular/forms'; import * as i7 from '@angular/material/table'; import { MatTable, MatTableDataSource } from '@angular/material/table'; import * as i15 from '@angular/material/sort'; import { Sort } from '@angular/material/sort'; import * as i9 from '@angular/material/icon'; import * as i10 from '@angular/material/core'; import * as i11 from '@angular/material/checkbox'; import * as i12 from '@angular/material/button'; import * as i13 from '@angular/common'; declare enum Severity { success = "success", error = "error", warning = "warning", info = "info" } declare class MessageBarComponent { severity: InputSignal; message: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ExpandableCardComponent implements OnInit { cardTitle: InputSignal; cardDescription: InputSignal; canBeCollapsed: InputSignal; openAsExpanded: InputSignal; panelOpenState: boolean; ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SearchFilterComponent { submitDisabled: InputSignal; clearDisabled: InputSignal; allowReset: InputSignal; searchLabel: InputSignal; resetLabel: InputSignal; performSearch: OutputEmitterRef; clear: OutputEmitterRef; protected executeSearch(): void; protected executeClear(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Enum containing the different column types supported by the DataTablesModule. */ declare enum ColumnType { /** A column that will display the value as it is given. */ Text = "text", Date = "date", Number = "number", Template = "template" } /** * The representation of a column. * TRecord is the type of object in the items array. * TValue is the type of the resulting value. */ interface Column { /** The type of the column. */ readonly type: ColumnType; /** The unique name of the column within a set of columns. */ name: string; /** The label to display in the column header. */ label: string; /** Whether the column should be sticky. */ sticky: boolean; /** Whether the column should be sticky at the end of the row. */ stickyEnd: boolean; /** Whether the column is sortable. */ sortable: Signal; /** Whether the sort clear should be disabled. */ disableSortClear: Signal; value?: string | ((record: TRecord) => TValue); } /** * This directive represents what a column should look like in the table. * * It can be used in the template, between the `ppw-table` tags. * @example * ` * * ` */ declare class PpwColumnDirective { #private; /** The name of the column, this should be unique within the table. */ name: InputSignal; /** The type of the column, this determines the way its value is rendered and is optional if a cell template is set. */ type: InputSignal>; /** The label of the column, this is shown in the header of the column if no header template is set. */ label: InputSignal; /** Whether the column should be sticky. */ sticky: InputSignalWithTransform; /** Whether the column should be sticky at the end of the row. */ stickyEnd: InputSignalWithTransform; /** The formatting function to format number values. When not provided, the default from PPW_TABLE_OPTIONS is used. */ numberFormatFn: InputSignal<((value: any) => string) | undefined>; /** The formatting function to format date values. */ dateFormatFn: InputSignal<((value: any) => string) | undefined>; /** The name of the property to get the value from, or a custom function providing the value. */ valueRetrieval: InputSignal unknown) | undefined>; /** Whether the column is sortable. */ sortable: InputSignalWithTransform; /** Whether the sort clear should be disabled. */ disableSortClear: InputSignalWithTransform; /** Reference to the optional header cell template. */ private headerCellDirective; /** Reference to the optional row cell template. */ private columnCellDirective; /** Gets the template reference from the found header cell directive. */ get headerTemplate(): TemplateRef | undefined; /** Gets the number formatting function to use. This is the `numberFormatFn` input or the default from PPW_TABLE_OPTIONS. */ private get numberFormatter(); /** Gets the date formatting function to use. This is the `dateFormatFn` input or the default from PPW_TABLE_OPTIONS. */ private get dateFormatter(); columnDefinition: Signal | undefined>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "ppw-column", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "type": { "alias": "type"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "sticky": { "alias": "sticky"; "required": false; "isSignal": true; }; "stickyEnd": { "alias": "stickyEnd"; "required": false; "isSignal": true; }; "numberFormatFn": { "alias": "numberFormatFn"; "required": false; "isSignal": true; }; "dateFormatFn": { "alias": "dateFormatFn"; "required": false; "isSignal": true; }; "valueRetrieval": { "alias": "valueRetrieval"; "required": false; "isSignal": true; }; "sortable": { "alias": "sortable"; "required": false; "isSignal": true; }; "disableSortClear": { "alias": "disableSortClear"; "required": false; "isSignal": true; }; }, {}, ["headerCellDirective", "columnCellDirective"], never, false, never>; } /** * Directive used to identify the template for the cell of a column. */ declare class PpwColumnCellDirective { templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Directive used to identify the template for the header of a column. */ declare class PpwColumnHeaderDirective { templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Directive used to identify the template for when the table has an empty page. */ declare class PpwEmptyTablePageDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Interface describing the options for a ppwcode table. */ interface PpwTableOptions { /** * Configuration for the header of the table. */ header?: { /** Whether the header should stick to the top of the table when scrolling. */ sticky?: boolean; /** Whether the header should be hidden. */ hidden?: boolean; /** Whether the first row should have a top border. This is only applied when the header is hidden. */ showFirstRowTopBorder?: boolean; /** CSS styles to conditionally apply to the header cells of the given columns. */ styles?: Record | string, () => { [key: string]: unknown; }>; }; /** * Configuration for the footer of the table. */ footer?: { /** Whether the header should stick to the top of the table when scrolling. */ sticky?: boolean; /** CSS styles to conditionally apply to the header cells of the given columns. */ styles?: Record { [key: string]: unknown; }>; }; /** * Configuration for the columns of the table. */ columns?: { /** * The widths of the columns in the table. * The keys are the column names. Any string is allowed because column names are not limited to the keys of a record, * because we can have columns that are calculated from other columns. * The values are the widths in CSS units: px, %, em, rem, ... */ widths?: Record | string, string>; /** CSS styles to conditionally apply to the cells of the given columns. */ styles?: Record | string, (record: TRecord) => { [key: string]: unknown; }>; /** Column names to ignore the row click for. */ ignoreClick?: string[]; }; /** * Configuration for the rows of the table. */ rows?: { /** Whether the row should be highlighted on hover. */ highlightOnHover?: boolean; /** Function to be executed when the row is clicked. */ onClick?: (row: TRecord) => void; /** Function to be executed when the row is CTRL-clicked. */ onCtrlClick?: (row: TRecord) => void; /** Disable selection of the current row. */ disableRowSelection?: (row: TRecord) => boolean; }; } declare const PPW_TABLE_DEFAULT_OPTIONS: InjectionToken; interface PpwTableDefaultOptions { dateColumnFormatter?: (value: unknown) => string; numberColumnFormatter?: (value: unknown) => string; emptyPageComponent?: Type; } interface TableRecord { /** The initial record that was passed. */ initialRecord: T; /** A local mapped representation of the record. */ mappedValues: Record; /** The value generated for the trackBy function. */ trackByValue: unknown; /** Whether the record can be selected. */ selectable: boolean; } interface SortChange { /** The name of the column that was sorted. */ column: string; /** The direction of the sort. */ direction: 'asc' | 'desc' | ''; } declare const AbstractTableComponent_base: _ppwcode_ng_common.CanHandleSubscriptionsCtor & _ppwcode_ng_common.Constructor; declare abstract class AbstractTableComponent | Array>> extends AbstractTableComponent_base implements OnInit { #private; headerTemplates: Record>; data: InputSignal; footerData: InputSignal | undefined>; trackBy: InputSignal>; disableAnimations: InputSignal; enableRowSelection: InputSignal; enableRowDrag: InputSignal; expandable: InputSignalWithTransform; expandableTemplate: InputSignal | undefined>; options: InputSignal | undefined>; sort: InputSignal; selectionChanged: OutputEmitterRef[]>; orderChanged: OutputEmitterRef[]>; sortChanged: OutputEmitterRef; emptyPageTemplate: Signal | undefined>; columnDirectives: Signal[]>; table: Signal>; columns: Signal>>; /** The names of the columns that are displayed. */ columnNames: Signal>; protected readonly localRecords: Signal[]>; protected readonly selectableRows: Signal[]>; /** The data source for the material table. */ dataSource: WritableSignal>>; arrowPositions: Signal>; selection: SelectionModel>; readonly isAllSelected: Signal; readonly isSomeSelected: Signal; protected readonly notUndefined: (t?: T) => T; get emptyPageComponent(): Type | undefined; /** Gets whether a custom height has been set by the --ppw-table-height CSS variable. */ get hasFixedHeight(): boolean; /** Whether the given record is expanded. */ isExpanded(record: TRecord): boolean; isRowSelectionDisabled(row: TableRecord): boolean; /** Selects all rows if they are not all selected; otherwise clear selection. */ masterToggle(): void; ngOnInit(): void; trackByFn(_index: number, item: TableRecord): unknown; mapValue(column: Column, record: unknown): {} | undefined; executeRowClick(event: MouseEvent, record: TRecord, columnName: string): void; toggleExpand(record: TRecord): void; dropTable(event: CdkDragDrop>, unknown>): void; handleSortChange(sort: Sort): void; /** * Maps the given items into a local key-value pair to be used within * the template. The original record is left intact so that it can still * be passed along where necessary. * @param items The items to map. */ protected abstract _mapToLocalKeyValuePairs(items: TData, columns: Array>, disabledFn?: (record: TRecord) => boolean): Array>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "footerData": { "alias": "footerData"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": true; "isSignal": true; }; "disableAnimations": { "alias": "disableAnimations"; "required": false; "isSignal": true; }; "enableRowSelection": { "alias": "enableRowSelection"; "required": false; "isSignal": true; }; "enableRowDrag": { "alias": "enableRowDrag"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "expandableTemplate": { "alias": "expandableTemplate"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "sort": { "alias": "sort"; "required": false; "isSignal": true; }; }, { "selectionChanged": "selectionChanged"; "orderChanged": "orderChanged"; "sortChanged": "sortChanged"; }, ["emptyPageTemplate", "columnDirectives"], never, true, never>; } declare class TableComponent extends AbstractTableComponent>> implements OnInit { /** * Maps the given items into a local key-value pair to be used within * the template. The original record is left intact so that it can still * be passed along where necessary. * @param items The items to map. */ protected _mapToLocalKeyValuePairs(items: Array>, columns: Array>, disabledFn?: (record: TRecord) => boolean): Array>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ppw-table", never, {}, {}, never, never, false, never>; } declare class FormTableComponent extends AbstractTableComponent implements OnInit { /** * Maps the given items into a local key-value pair to be used within * the template. The original record is left intact so that it can still * be passed along where necessary. * @param items The items to map. */ protected _mapToLocalKeyValuePairs(items: FormArray, columns: Array>, disabledFn?: (record: TRecord) => boolean): Array>; addControl(control: FormGroup): void; removeControl(control: FormGroup): void; private refreshDataSource; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ppw-form-table", never, {}, {}, never, never, false, never>; } /** * Defines that the implementation has the API of a cell component. * * Generic type TColumn is the corresponding configuration of the related column. * Generic type TValue is the type of value that is expected and defaults to any. * This allows for type safety in the implementation where the component needs to * manipulate the value it was given. */ interface IsCellComponent, TValue = any> { /** The row index of the record in the ngFor loop */ rowIndex: Signal; /** The configuration of the column the cell is related to. */ column: Signal; /** The original record data the cell is rendered for. */ record: Signal<{ [key: string]: any; }>; /** The value for the cell component to continue with. */ value: Signal; } declare class DynamicCellDirective implements OnInit { private _viewContainerRef; column: InputSignal>; record: InputSignal>; value: InputSignal; rowIndex: InputSignal; /** A reference to the instantiated component. */ componentRef: ComponentRef>>; private _componentTypeMap; constructor(_viewContainerRef: ViewContainerRef); ngOnInit(): void; /** * Creates a new instance of the component on the view container. */ private _instantiateComponent; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[ppwDynamicCell]", never, { "column": { "alias": "column"; "required": true; "isSignal": true; }; "record": { "alias": "record"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "rowIndex": { "alias": "rowIndex"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>; } declare class PpwTableModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class LoaderComponent { loading: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A model representing an action on a dashboard item. */ interface DashboardItemAction { /** The translation key of the label to show on the button. */ labelKey: string; /** The function that will be executed when the action button is clicked. */ clickFn: () => void; } /** * The model for an item that can be shown as a dashboard item. */ interface DashboardItem { /** The optiona fa icon class that will be used to render the dashboard item icon. */ iconClass?: string; /** An optional template ref that will be rendered as the dashboard item content. */ template?: TemplateRef; /** The translation key for the dashboard item title. */ titleKey: string; /** The translation key for the description that will be added to the dashboard item. */ descriptionKey: string; /** The default action that will be executed when the icon or template of the dashboard item is clicked. */ defaultAction?: DashboardItemAction; /** The actions that will be shown on the dashboard item. */ actions?: DashboardItemAction[]; /** An optional badge that can be shown on a dashboard item. */ badgeContent?: string; /** Indicates in what direction the action buttons should be displayed */ actionsDirection?: 'row' | 'column'; /** Indicates how the action buttons should be aligned */ actionsAlignment?: 'start' | 'center' | 'end'; } interface DashboardOptions { cardsAlignment: 'left' | 'center'; } declare class DashboardItemsTableComponent { dashboardItems: InputSignal>; dashboardOptions: InputSignal; executeAction: OutputEmitterRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { DashboardItemsTableComponent, ExpandableCardComponent, FormTableComponent, LoaderComponent, MessageBarComponent, PPW_TABLE_DEFAULT_OPTIONS, PpwColumnCellDirective, PpwColumnDirective, PpwColumnHeaderDirective, PpwEmptyTablePageDirective, PpwTableModule, SearchFilterComponent, Severity, TableComponent }; export type { DashboardItem, DashboardItemAction, DashboardOptions, PpwTableDefaultOptions, PpwTableOptions, SortChange, TableRecord };