UNPKG

1.89 kBTypeScriptView Raw
1import { Emitter } from '@mantou/gem/lib/decorators';
2import { GemElement, TemplateResult } from '@mantou/gem/lib/element';
3import { StyleObject } from '@mantou/gem/lib/utils';
4import { MenuItem } from './menu';
5import './placeholder';
6import './empty';
7import './tooltip';
8import './loading';
9import './space';
10import './selection-box';
11export declare type Column<T> = {
12 title: string | TemplateResult;
13 style?: StyleObject;
14 ellipsis?: boolean;
15 width?: string;
16 tooltip?: string;
17 dataIndex?: keyof T | string[];
18 render?: (record: T) => string | TemplateResult;
19 getActions?: (record: T, evt: HTMLElement) => MenuItem[];
20 getColSpan?: (record: T, arr: T[]) => number;
21 getRowSpan?: (record: T, arr: T[]) => number;
22 data?: Record<string, unknown>;
23};
24export declare type Columns<T> = Column<T>[];
25export declare type ItemContextMenuEventDetail = {
26 data: any;
27 selected: boolean;
28 originEvent: MouseEvent;
29};
30/**
31 * @customElement dy-table
32 */
33export declare class DuoyunTableElement extends GemElement {
34 #private;
35 static table: string;
36 static th: string;
37 static td: string;
38 static tr: string;
39 static side: string;
40 caption: string;
41 headless: boolean;
42 selectable: boolean;
43 selection?: any[];
44 select: Emitter<any[]>;
45 itemclick: Emitter<any>;
46 itemcontextmenu: Emitter<ItemContextMenuEventDetail>;
47 columns?: Column<any>[];
48 data?: (Record<string, unknown> | undefined)[];
49 getRowStyle?: (record: any) => StyleObject;
50 noData?: string | TemplateResult;
51 rowKey?: string | string[];
52 expandedRowRender?: (record: any) => undefined | string | TemplateResult;
53 expand: Emitter<any>;
54 constructor();
55 mounted: () => void;
56 render: () => TemplateResult;
57 appendSelection(items: any[]): void;
58 removeSelection(items: any[]): void;
59}
60//# sourceMappingURL=table.d.ts.map
\No newline at end of file