@nova-ui/dashboards
Version:
Nova Dashboards is a framework designed to provide feature developers with a common solution for presenting data coming from various sources within a single view, as well as a set of predefined widget visualizations that are 100% configuration-driven and
102 lines (100 loc) • 2.9 kB
TypeScript
import { ITableSelectionConfigDisabled, ITableSelectionConfigEnabled } from "@nova-ui/bits";
import { IFormatter } from "../types";
export interface ITableWidgetColumnConfig {
id: string;
label: string;
/**
* Possibility to show or hide column without removing it
*/
isActive?: boolean;
/**
* Formatter configuration
*/
formatter?: IFormatter;
/**
* Width of the column
*/
width?: number;
/**
* If column is sortable
*/
sortable?: boolean;
}
export interface ITableWidgetConfig {
reorderable?: boolean;
columns: Array<ITableWidgetColumnConfig>;
sortable?: boolean;
sorterConfiguration: ITableWidgetSorterConfig;
/**
* Allows to choose row selection behavior of a table.
* Can be None | Multi | Single | Radio.
*/
selectionConfiguration?: TableWidgetSelectionConfig;
/**
* @deprecated Use scrollType and set it to "infinite" instead
*/
hasVirtualScroll?: boolean;
scrollType?: ScrollType;
/**
* Makes table rows interactive.
* Disabled if 'selectable' is set to true.
*/
interactive?: boolean;
headerTooltipsEnabled?: boolean;
scrollActivationDelayMs?: number;
/**
* Selectors for target elements to be ignored for row click.
*
* Default value ["button", "input[type='button']", "a[href]"]
*/
interactionIgnoredSelectors?: string[];
searchConfiguration?: {
enabled: boolean;
searchTerm?: string;
searchDebounce?: number;
};
paginatorConfiguration?: ITableWidgetPaginatorConfig;
}
export interface ITableWidgetSorterConfig {
descendantSorting: boolean;
sortBy: string;
}
export interface ITableWidgetPaginatorConfig {
pageSizeSet?: number[];
pageSize?: number;
}
export interface IPaginatorState {
page: number;
pageSize: number;
pageSizeSet: number[];
total: number;
}
export declare enum ScrollType {
virtual = "virtual",
paginator = "paginator",
default = "default"
}
interface ITableWidgetSelectionConfigEnabled extends ITableSelectionConfigEnabled {
/**
* Property name that is unique.
* Needs to be set in order for selection to work in combination with filtering.
*
* Using property that is not unique across table data will result in a selection
* of all rows with the same column value at once.
@default "id"
*/
trackByProperty?: string;
/**
* If clicking on row should select it.
* True if selectionMode is set to "single".
* @default false
*/
clickableRow?: boolean;
/**
* Controls if the dropdown is needed for selection on other pages
* Only available for the pagination
*/
allPages?: boolean;
}
export type TableWidgetSelectionConfig = ITableWidgetSelectionConfigEnabled | ITableSelectionConfigDisabled;
export {};