import { LiveAnnouncer } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { ChangeDetectorRef, ElementRef, EventEmitter, TrackByFunction } from '@angular/core'; import { MatCheckboxChange } from '@angular/material/checkbox'; import { CanColor } from '@angular/material/core'; import { SortDirection } from '@angular/material/sort'; import { MtnaSortedColumn } from '@mtna/lib-ui/header-sort'; import { MtnaResizableTableDefaultOptions } from '@mtna/lib-ui/resizable-table'; import { Result, SearchField, SearchResult, SearchTarget } from '@mtna/search-manager-ui'; import { MtnaSearchConfig, MtnaSubResultSelectedEvent } from '../../models/index'; import { MtnaSearchSelectionService } from '../../services'; import { MtnaResultsTableBase } from './results-table-base'; import * as i0 from "@angular/core"; export declare const MtnaResultsTableMixinBase: import("@angular/material/core/common-behaviors/constructor").Constructor & import("@angular/material/core/common-behaviors/constructor").AbstractConstructor & typeof MtnaResultsTableBase; /** * Generic table for search results. * * Supports * - Sorting * - Click a row to navigate * * @author Will Davis */ export declare class MtnaResultsTableComponent extends MtnaResultsTableMixinBase implements CanColor { private liveAnnouncer; private selectionManagerService; static ngAcceptInputType_canLoadMore: BooleanInput; static ngAcceptInputType_disableExpansion: BooleanInput; static ngAcceptInputType_disableSubResults: BooleanInput; static ngAcceptInputType_loading: BooleanInput; static ngAcceptInputType_multi: BooleanInput; static ngAcceptInputType_navigable: BooleanInput; static ngAcceptInputType_results: Result[] | null | undefined; static ngAcceptInputType_selectable: BooleanInput; static ngAcceptInputType_selections: unknown[] | null | undefined; static ngAcceptInputType_selectableHeaders: BooleanInput; static ngAcceptInputType_sortedColumns: MtnaSortedColumn[] | null | undefined; static ngAcceptInputType_sortableFields: SearchField[] | null | undefined; /** Whether there are more results to load. Prevents emitting {@link loadMore} if set to false. Defaults to true. */ get canLoadMore(): boolean; set canLoadMore(canLoadMore: boolean); private _canLoadMore; searchConfig: MtnaSearchConfig | null | undefined; /** Whether to disable the expandable rows, defaults to false. */ get disableExpansion(): boolean; set disableExpansion(disableExpansion: boolean); private _disableExpansion; /** Whether to disable the sub-results row, defaults to false. */ get disableSubResults(): boolean; set disableSubResults(disableSubResults: boolean); private _disableSubResults; /** Whether more items are loading. Defaults to false. */ get loading(): boolean; set loading(loadingMore: boolean); private _loading; /** * Whether to allow multiple rows to be selected. Defaults to false. * NOTE: selectable must also be true to enable multi-selection. */ get multi(): boolean; set multi(multiSelectable: boolean); private _multi; /** Whether to show the navigate column. Defaults to true. */ get navigable(): boolean; set navigable(navigable: boolean); private _navigable; /** Search results to be displayed in the table. */ get results(): Result[]; set results(results: Result[]); private _results; /** Whether to allow the rows to be selected. Defaults to false. */ get selectable(): boolean; set selectable(selectable: boolean); private _selectable; /** Whether the header is selectable. Defaults to false. */ get selectableHeaders(): boolean; set selectableHeaders(value: boolean); private _selectableHeaders; /** * The selected model that represents a search {@link Result} that should be displayed as selected. * NOTE: @deprecated This is only used for single selection. For multi-selection, use {@link selections}. */ get selected(): M | null | undefined; set selected(selected: M | null | undefined); private _selected; /** “An array of values representing a search that should be displayed as selected.” */ get selections(): M[]; set selections(selections: M[]); private _selections; /** The columns currently being sorted, in order of priority. */ get sortedColumns(): MtnaSortedColumn[]; set sortedColumns(c: MtnaSortedColumn[]); private _sortedColumns; /** The required search target for the results. This will inform the table how to display certain fields based on type and the sub-results. */ get target(): SearchTarget | null | undefined; set target(target: SearchTarget | null | undefined); private _target; /** Emitted when the user has scrolled to the bottom of the container. */ loadMore: EventEmitter; /** Emitted when the user has selected a result. Can emit `undefined` to indicate there is no selection. */ selectResult: EventEmitter; /** Emitted when the user has selected an array of results. Only to be used when multiSelectable is set to true. */ selectResults: EventEmitter; /** Event emitted when the user changes either the active sort or sort direction. */ sortChange: EventEmitter; /** Emitted when a sub result is selected. */ subResultSelected: EventEmitter; /** The search fields marked to be additional details, derrived from the {@link SearchTarget}. These will be displayed in the expansion panel. */ additionalDetails: SearchField[]; get areColumnsSet(): boolean; /** The search fields marked to display, derrived from the {@link SearchTarget}. These will be used for the table columns. */ displayFields: SearchField[]; /** Whether the {@link SearchTarget} defines any joined targets. */ hasJoinedTargets: boolean; /** Aria label for the checkbox */ _checkboxLabel: string; /** Aria label for toggle button when the row is expanded */ _collapseButtonLabel: string; /** Aria label for toggle button when the row is collapsed */ _expandButtonLabel: string; /** The URI of the expanded row. */ _expandedUri: string | null; /** A map of the checked status of each result, keyed on it's uri. */ resultsCheckedMap: { [key: string]: boolean; }; constructor(cdr: ChangeDetectorRef, elementRef: ElementRef, liveAnnouncer: LiveAnnouncer, selectionManagerService: MtnaSearchSelectionService, defaults?: MtnaResizableTableDefaultOptions); getColumnWidth(id: string | null | undefined): number; getLargestContentWidth(id: string): number; handleSortColumn(direction: SortDirection, id: string, displayName: string): void; /** * Handle the selection change for a result row. * @param event the checkbox change event * @param result the result that was changed */ selectionChange(event: MatCheckboxChange, result: Result): void; /** * Initialize the map of result uris to false. If the selections array contains a result that is in * the results array, set the value to true. This is used to track the selected state of the results. */ setMultiSelectResultsMap(): void; /** * Select a sub result and output the event. * @param event browser event of origin * @param subResult the sub-result selected */ selectSubResult(event: Event, subResult: SearchResult): void; toggleExpansion(result: Result): void; _trackByResult: TrackByFunction; _trackBySearchField: TrackByFunction; /** Update displayed columns based on what should show from the search targed and whether the results are navigable. */ private _updateDisplayedColumns; static ɵfac: i0.ɵɵFactoryDeclaration, [null, null, null, null, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "mtna-results-table", never, { "color": "color"; "columnWidths": "columnWidths"; "resizableColumns": "resizableColumns"; "canLoadMore": "canLoadMore"; "searchConfig": "searchConfig"; "disableExpansion": "disableExpansion"; "disableSubResults": "disableSubResults"; "loading": "loading"; "multi": "multi"; "navigable": "navigable"; "results": "results"; "selectable": "selectable"; "selectableHeaders": "selectableHeaders"; "selected": "selected"; "selections": "selections"; "sortedColumns": "sortedColumns"; "target": "target"; }, { "resizeColumn": "resizeColumn"; "loadMore": "loadMore"; "selectResult": "selectResult"; "selectResults": "selectResults"; "sortChange": "sortChange"; "subResultSelected": "subResultSelected"; }, never, never>; }