1 | import { PipeTransform } from '@angular/core';
|
2 | import { ValueGetter } from '../utils/column-prop-getters';
|
3 | /**
|
4 | * Column property that indicates how to retrieve this column's
|
5 | * value from a row.
|
6 | * 'a.deep.value', 'normalprop', 0 (numeric)
|
7 | */
|
8 | export declare type TableColumnProp = string | number;
|
9 | /**
|
10 | * Column Type
|
11 | */
|
12 | export interface TableColumn {
|
13 | /**
|
14 | * Internal unique id
|
15 | *
|
16 | * @memberOf TableColumn
|
17 | */
|
18 | $$id?: string;
|
19 | /**
|
20 | * Internal for column width distributions
|
21 | *
|
22 | * @memberOf TableColumn
|
23 | */
|
24 | $$oldWidth?: number;
|
25 | /**
|
26 | * Internal for setColumnDefaults
|
27 | *
|
28 | * @memberOf TableColumn
|
29 | */
|
30 | $$valueGetter?: ValueGetter;
|
31 | /**
|
32 | * Determines if column is checkbox
|
33 | *
|
34 | * @memberOf TableColumn
|
35 | */
|
36 | checkboxable?: boolean;
|
37 | /**
|
38 | * Determines if the column is frozen to the left
|
39 | *
|
40 | * @memberOf TableColumn
|
41 | */
|
42 | frozenLeft?: boolean;
|
43 | /**
|
44 | * Determines if the column is frozen to the right
|
45 | *
|
46 | * @memberOf TableColumn
|
47 | */
|
48 | frozenRight?: boolean;
|
49 | /**
|
50 | * The grow factor relative to other columns. Same as the flex-grow
|
51 | * API from http =//www.w3.org/TR/css3-flexbox/. Basically;
|
52 | * take any available extra width and distribute it proportionally
|
53 | * according to all columns' flexGrow values.
|
54 | *
|
55 | * @memberOf TableColumn
|
56 | */
|
57 | flexGrow?: number;
|
58 | /**
|
59 | * Min width of the column
|
60 | *
|
61 | * @memberOf TableColumn
|
62 | */
|
63 | minWidth?: number;
|
64 | /**
|
65 | * Max width of the column
|
66 | *
|
67 | * @memberOf TableColumn
|
68 | */
|
69 | maxWidth?: number;
|
70 | /**
|
71 | * The default width of the column, in pixels
|
72 | *
|
73 | * @memberOf TableColumn
|
74 | */
|
75 | width?: number;
|
76 | /**
|
77 | * Can the column be resized
|
78 | *
|
79 | * @memberOf TableColumn
|
80 | */
|
81 | resizeable?: boolean;
|
82 | /**
|
83 | * Custom sort comparator
|
84 | *
|
85 | * @memberOf TableColumn
|
86 | */
|
87 | comparator?: any;
|
88 | /**
|
89 | * Custom pipe transforms
|
90 | *
|
91 | * @memberOf TableColumn
|
92 | */
|
93 | pipe?: PipeTransform;
|
94 | /**
|
95 | * Can the column be sorted
|
96 | *
|
97 | * @memberOf TableColumn
|
98 | */
|
99 | sortable?: boolean;
|
100 | /**
|
101 | * Can the column be re-arranged by dragging
|
102 | *
|
103 | * @memberOf TableColumn
|
104 | */
|
105 | draggable?: boolean;
|
106 | /**
|
107 | * Whether the column can automatically resize to fill space in the table.
|
108 | *
|
109 | * @memberOf TableColumn
|
110 | */
|
111 | canAutoResize?: boolean;
|
112 | /**
|
113 | * Column name or label
|
114 | *
|
115 | * @memberOf TableColumn
|
116 | */
|
117 | name?: string;
|
118 | /**
|
119 | * Property to bind to the row. Example:
|
120 | *
|
121 | * `someField` or `some.field.nested`, 0 (numeric)
|
122 | *
|
123 | * If left blank, will use the name as camel case conversion
|
124 | *
|
125 | * @memberOf TableColumn
|
126 | */
|
127 | prop?: TableColumnProp;
|
128 | /**
|
129 | * Cell template ref
|
130 | *
|
131 | * @memberOf TableColumn
|
132 | */
|
133 | cellTemplate?: any;
|
134 | /**
|
135 | * Header template ref
|
136 | *
|
137 | * @memberOf TableColumn
|
138 | */
|
139 | headerTemplate?: any;
|
140 | /**
|
141 | * Tree toggle template ref
|
142 | *
|
143 | * @memberOf TableColumn
|
144 | */
|
145 | treeToggleTemplate?: any;
|
146 | /**
|
147 | * CSS Classes for the cell
|
148 | *
|
149 | *
|
150 | * @memberOf TableColumn
|
151 | */
|
152 | cellClass?: string | ((data: any) => string | any);
|
153 | /**
|
154 | * CSS classes for the header
|
155 | *
|
156 | *
|
157 | * @memberOf TableColumn
|
158 | */
|
159 | headerClass?: string | ((data: any) => string | any);
|
160 | /**
|
161 | * Header checkbox enabled
|
162 | *
|
163 | * @memberOf TableColumn
|
164 | */
|
165 | headerCheckboxable?: boolean;
|
166 | /**
|
167 | * Is tree displayed on this column
|
168 | *
|
169 | * @memberOf TableColumn
|
170 | */
|
171 | isTreeColumn?: boolean;
|
172 | /**
|
173 | * Width of the tree level indent
|
174 | *
|
175 | * @memberOf TableColumn
|
176 | */
|
177 | treeLevelIndent?: number;
|
178 | /**
|
179 | * Summary function
|
180 | *
|
181 | * @memberOf TableColumn
|
182 | */
|
183 | summaryFunc?: (cells: any[]) => any;
|
184 | /**
|
185 | * Summary cell template ref
|
186 | *
|
187 | * @memberOf TableColumn
|
188 | */
|
189 | summaryTemplate?: any;
|
190 | }
|