@api.global/typedserver
Version:
A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.
33 lines (32 loc) • 1.08 kB
TypeScript
import { LitElement } from './plugins.js';
import type { CSSResult, TemplateResult } from './plugins.js';
export interface IColumnConfig {
key: string;
label: string;
sortable?: boolean;
formatter?: (value: any, row: any) => string;
className?: string;
}
/**
* Base sortable table component for sw-dash
*/
export declare class SwDashTable extends LitElement {
static styles: CSSResult[];
accessor columns: IColumnConfig[];
accessor data: any[];
accessor filterPlaceholder: string;
accessor infoLabel: string;
accessor sortColumn: string;
accessor sortDirection: 'asc' | 'desc';
accessor filterText: string;
static formatNumber(n: number): string;
static formatBytes(bytes: number): string;
static formatTimestamp(ts: number): string;
static getGaugeClass(rate: number): string;
private handleSort;
private handleFilter;
private getSortedFilteredData;
private renderHitRateBar;
protected renderCellValue(value: any, row: any, column: IColumnConfig): any;
render(): TemplateResult;
}