@guiexpert/table 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +11 -11
- package/index.js +794 -338
- package/lib/table/action/action-id.type.d.ts +12 -0
- package/lib/table/action/on-action-triggered.if.d.ts +7 -0
- package/lib/table/action/osx-shortcut-actionId-mapping.d.ts +5 -0
- package/lib/table/action/shortcut-actionid-mapping.type.d.ts +4 -0
- package/lib/table/action/shortcut.service.d.ts +3 -0
- package/lib/table/action/windows-shortcut-actionId-mapping.d.ts +3 -0
- package/lib/table/color/color-rgb.if.d.ts +5 -0
- package/lib/table/color/three-color-gradient-arg.if.d.ts +5 -0
- package/lib/table/color/two-color-gradient-arg.if.d.ts +4 -0
- package/lib/table/data/common/aligns.d.ts +23 -0
- package/lib/table/data/common/area-map-factory.d.ts +6 -0
- package/lib/table/data/common/area-map.d.ts +7 -0
- package/lib/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +4 -0
- package/lib/table/data/common/args-render-cell-div.d.ts +17 -0
- package/lib/table/data/common/boolean-function.d.ts +12 -0
- package/lib/table/data/common/cell-range.d.ts +9 -0
- package/lib/table/data/common/checkbox-column-def.d.ts +5 -0
- package/lib/table/data/common/checked-type.d.ts +5 -0
- package/lib/table/data/common/event/ge-cell-indices.d.ts +3 -0
- package/lib/table/data/common/event/ge-key-event.d.ts +5 -0
- package/lib/table/data/common/event/ge-model-change-event.d.ts +3 -0
- package/lib/table/data/common/event/ge-mouse-event.d.ts +3 -0
- package/lib/table/data/common/event/input/table-cell-update-event.d.ts +12 -0
- package/lib/table/data/common/event/input/table-cell-update-event.if.d.ts +41 -0
- package/lib/table/data/common/filter-function.d.ts +8 -0
- package/lib/table/data/common/get-t.d.ts +6 -0
- package/lib/table/data/common/index-and-px.d.ts +3 -0
- package/lib/table/data/common/size.if.d.ts +4 -0
- package/lib/table/data/common/sort-item.d.ts +3 -0
- package/lib/table/data/common/sort-state.type.d.ts +6 -0
- package/lib/table/data/common/tree-arrow.type.d.ts +7 -0
- package/lib/table/data/common/tree-row-if.d.ts +3 -0
- package/lib/table/data/common/tree-row.d.ts +4 -0
- package/lib/table/data/div-scope.type.d.ts +9 -0
- package/lib/table/data/event/mouse-target-data.d.ts +3 -0
- package/lib/table/data/geo-data.d.ts +3 -0
- package/lib/table/data/options/icon.if.d.ts +13 -0
- package/lib/table/data/options/sorted-options.if.d.ts +4 -0
- package/lib/table/data/options/table-options.if.d.ts +186 -0
- package/lib/table/data/side-ident.type.d.ts +3 -0
- package/lib/table/data/table-model-and-options.d.ts +3 -0
- package/lib/table/data/table-model-and-options.if.d.ts +3 -0
- package/lib/table/data/tablemodel/area-ident.type.d.ts +1 -1
- package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +4 -0
- package/lib/table/data/tablemodel/areamodel/area-model-hidden.d.ts +1 -1
- package/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +5 -0
- package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +4 -0
- package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +6 -0
- package/lib/table/data/tablemodel/areamodel/area-model.d.ts +3 -0
- package/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +3 -0
- package/lib/table/data/tablemodel/column/column-def.d.ts +3 -0
- package/lib/table/data/tablemodel/column/column-def.if.d.ts +113 -0
- package/lib/table/data/tablemodel/padding.d.ts +3 -0
- package/lib/table/data/tablemodel/table-model.d.ts +186 -0
- package/lib/table/data/tablemodel/table-model.if.d.ts +165 -0
- package/lib/table/ele-scope.d.ts +4 -0
- package/lib/table/event-adapter.d.ts +7 -0
- package/lib/table/event-listener.if.d.ts +5 -0
- package/lib/table/input-handler.d.ts +14 -0
- package/lib/table/instanceof-workaround.d.ts +19 -0
- package/lib/table/mouse-handler.d.ts +38 -0
- package/lib/table/render-scope.d.ts +1 -1
- package/lib/table/renderer/edit/edit-input-pipe.if.d.ts +8 -0
- package/lib/table/table-api.d.ts +72 -0
- package/lib/table/table-scope.d.ts +148 -0
- package/package.json +1 -1
|
@@ -51,35 +51,221 @@ export declare class TableModel implements TableModelIf {
|
|
|
51
51
|
constructor(headerAreaModel: AreaModelIf, bodyAreaModel: AreaModelIf, footerAreaModel: AreaModelIf, fixedLeftColumnCount?: number, fixedRightColumnCount?: number, rowCheckboxVisible?: boolean, defaultRowHeights?: DefaultRowHeightsIf, columnDefs?: ColumnDefIf[], columnSizes?: number[], overridingColumnWidth?: number, columnCount?: number, parentSize?: number, // can be important when we have percentage widthes,
|
|
52
52
|
getSelectionModel?: GetT<SelectionModelIf>);
|
|
53
53
|
init(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves the count of columns in the current instance.
|
|
56
|
+
*
|
|
57
|
+
* @return {number} The count of columns.
|
|
58
|
+
*/
|
|
54
59
|
getColumnCount(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Sets the width in pixel of a column (by columnIndex) in a table.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} columnIndex - The index of the column.
|
|
64
|
+
* @param {number} width - The desired width of the column.
|
|
65
|
+
* @return {void}
|
|
66
|
+
*/
|
|
55
67
|
setColumnWidth(columnIndex: number, width: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves the width of a column specified by its index.
|
|
70
|
+
*
|
|
71
|
+
* @param {number} columnIndex - The index of the desired column.
|
|
72
|
+
* @return {number} - The width of the specified column.
|
|
73
|
+
*/
|
|
56
74
|
getColumnWidth(columnIndex: number): number;
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the x position for a given column index.
|
|
77
|
+
*
|
|
78
|
+
* @param {number} columnIndex - The index of the column.
|
|
79
|
+
* @return {number} - The x position of the column.
|
|
80
|
+
*/
|
|
57
81
|
getXPosByColumnIndex(columnIndex: number): number;
|
|
82
|
+
/**
|
|
83
|
+
* Recalculates the size (width, height, padding) of the elements based on the client width.
|
|
84
|
+
*
|
|
85
|
+
* @param {number} clientWidth - The width of the client area.
|
|
86
|
+
*
|
|
87
|
+
* @return {void} - This method does not return a value.
|
|
88
|
+
*/
|
|
58
89
|
recalcSize(clientWidth: number): void;
|
|
90
|
+
/**
|
|
91
|
+
* Recalculates the height and padding for the body area.
|
|
92
|
+
*
|
|
93
|
+
* This method retrieves the area model for the "body" area,
|
|
94
|
+
* and updates the rowCount property with the row count of the model.
|
|
95
|
+
*
|
|
96
|
+
* The contentHeightInPx property is then updated with the height of the "body" area.
|
|
97
|
+
*
|
|
98
|
+
* The method calls the recalcContentWidthInPx() method to recalculate the content width.
|
|
99
|
+
*
|
|
100
|
+
* Finally, the method calls the recalcPadding() method to recalculate the padding.
|
|
101
|
+
*
|
|
102
|
+
* @return {void}
|
|
103
|
+
*/
|
|
59
104
|
recalcHeightAndPadding(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Recalculates the padding of an element based on the width and height of its surrounding areas.
|
|
107
|
+
*
|
|
108
|
+
* @method recalcPadding
|
|
109
|
+
*
|
|
110
|
+
* @returns {void}
|
|
111
|
+
*/
|
|
60
112
|
recalcPadding(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves the padding value.
|
|
115
|
+
*
|
|
116
|
+
* @returns {Padding} The padding value.
|
|
117
|
+
*/
|
|
61
118
|
getPadding(): Padding;
|
|
119
|
+
/**
|
|
120
|
+
* Returns the height of the content in pixels.
|
|
121
|
+
*
|
|
122
|
+
* @returns {number} The height of the content in pixels.
|
|
123
|
+
*/
|
|
62
124
|
getContentHeightInPixel(): number;
|
|
125
|
+
/**
|
|
126
|
+
* Returns the width of the content in pixels.
|
|
127
|
+
*
|
|
128
|
+
* @returns {number} The width of the content in pixels.
|
|
129
|
+
*/
|
|
63
130
|
getContentWidthInPixel(): number;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the height of the specified row in the given row area identifier.
|
|
133
|
+
*
|
|
134
|
+
* @param {AreaIdent} rowAreaIdent - The row area identifier.
|
|
135
|
+
* @param {number} rowIndex - The index of the row.
|
|
136
|
+
* @return {number} - The height of the specified row.
|
|
137
|
+
*/
|
|
64
138
|
getRowHeight(rowAreaIdent: AreaIdent, rowIndex: number): number;
|
|
139
|
+
/**
|
|
140
|
+
* Retrieves the model for the given row area identifier.
|
|
141
|
+
*
|
|
142
|
+
* @param {AreaIdent} rowAreaIdent - The identifier of the row area.
|
|
143
|
+
* @return {AreaModelIf} - The model of the specified row area.
|
|
144
|
+
*/
|
|
65
145
|
getModel(rowAreaIdent: AreaIdent): AreaModelIf;
|
|
146
|
+
/**
|
|
147
|
+
* Calculates the height of the area identified by the given area identifier.
|
|
148
|
+
*
|
|
149
|
+
* @param {AreaIdent} areaIdent - The identifier of the area.
|
|
150
|
+
* @return {number} - The height of the area.
|
|
151
|
+
*/
|
|
66
152
|
getAreaHeight(areaIdent: AreaIdent): number;
|
|
153
|
+
/**
|
|
154
|
+
* Returns the total width of the side area identified by sideIdent.
|
|
155
|
+
*
|
|
156
|
+
* @param {SideIdent} sideIdent - The identifier of the side area ("west" | "center" | "east").
|
|
157
|
+
* @return {number} - The total width in pixels of the side area.
|
|
158
|
+
*/
|
|
67
159
|
getSideAreaWidth(sideIdent: SideIdent): number;
|
|
160
|
+
/**
|
|
161
|
+
* Retrieves the start and end column indices based on the given side identifier.
|
|
162
|
+
*
|
|
163
|
+
* @param {SideIdent} sideIdent - The side identifier, which can be "west", "east", or "center".
|
|
164
|
+
* @return {[number, number]} - An array containing the start and end column indices.
|
|
165
|
+
*/
|
|
68
166
|
getSideStartAndEndColumnIndex(sideIdent: SideIdent): [number, number];
|
|
167
|
+
/**
|
|
168
|
+
* Returns the column definition at the specified index.
|
|
169
|
+
*
|
|
170
|
+
* @param {number} index - The index of the column definition to retrieve.
|
|
171
|
+
* @returns {ColumnDefIf | undefined} - The column definition at the specified index, or undefined if no ColumnDef is specified for the given column
|
|
172
|
+
*/
|
|
69
173
|
getColumnDef(index: number): ColumnDefIf | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Retrieves the count of fixed left columns.
|
|
176
|
+
*
|
|
177
|
+
* @returns {number} The count of fixed left columns.
|
|
178
|
+
*/
|
|
70
179
|
getFixedLeftColumnCount(): number;
|
|
180
|
+
/**
|
|
181
|
+
* Returns the number of fixed right columns.
|
|
182
|
+
*
|
|
183
|
+
* @returns {number} The number of fixed right columns.
|
|
184
|
+
*/
|
|
71
185
|
getFixedRightColumnCount(): number;
|
|
186
|
+
/**
|
|
187
|
+
* Retrieves the area model (header, body or footer) based on the area identification.
|
|
188
|
+
*
|
|
189
|
+
* @param {AreaIdent} area - The identifier of the area.
|
|
190
|
+
* @return {AreaModelIf} The area model corresponding to the given area identification.
|
|
191
|
+
* @throws {Error} If the area identification is invalid.
|
|
192
|
+
*/
|
|
72
193
|
getAreaModel(area: AreaIdent): AreaModelIf;
|
|
194
|
+
/**
|
|
195
|
+
* Returns the body area model.
|
|
196
|
+
*
|
|
197
|
+
* @returns {AreaModelIf} The body area model.
|
|
198
|
+
*/
|
|
73
199
|
getBodyModel(): AreaModelIf;
|
|
200
|
+
/**
|
|
201
|
+
* Checks if the footer is visible.
|
|
202
|
+
*
|
|
203
|
+
* @returns {boolean} True if the footer is visible, false otherwise.
|
|
204
|
+
*/
|
|
74
205
|
isFooterVisibe(): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Checks if the header area is visible.
|
|
208
|
+
* @return {boolean} Returns true if the header area is visible, otherwise false.
|
|
209
|
+
*/
|
|
75
210
|
isHeaderVisibe(): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Checks whether the row checkbox is visible.
|
|
213
|
+
*
|
|
214
|
+
* @returns {boolean} True if the row checkbox is visible, otherwise false.
|
|
215
|
+
*/
|
|
76
216
|
isRowCheckboxVisible(): boolean;
|
|
217
|
+
/**
|
|
218
|
+
* This method is called when an external filter is changed.
|
|
219
|
+
*
|
|
220
|
+
* @param {FilterFunction<T>} predictFn - The function used to predict whether an element should be filtered or not.
|
|
221
|
+
* @return {void}
|
|
222
|
+
*/
|
|
77
223
|
externalFilterChanged<T>(predictFn: FilterFunction<T>): void;
|
|
224
|
+
/**
|
|
225
|
+
* Sorts the items using the given sortItems array.
|
|
226
|
+
*
|
|
227
|
+
* @param {SortItem[]} sortItems - An array of sort items to sort the items.
|
|
228
|
+
* @return {boolean} - Returns true if the sorting is successful, otherwise false.
|
|
229
|
+
*/
|
|
78
230
|
doSort(sortItems: SortItem[]): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Returns an array of ColumnDefIf objects or undefined.
|
|
233
|
+
*
|
|
234
|
+
* @return {ColumnDefIf[] | undefined} An array of ColumnDefIf objects or undefined.
|
|
235
|
+
*/
|
|
79
236
|
getColumnDefs(): ColumnDefIf[] | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Retrieves the property key of the table row business object associated with the specified column index.
|
|
239
|
+
* It's only available when columnDefs are specified.
|
|
240
|
+
*
|
|
241
|
+
* @param {number} columnIndex - The index of the column to retrieve the property from.
|
|
242
|
+
* @return {string} The property associated with the specified column index.
|
|
243
|
+
*/
|
|
80
244
|
getColumnProperty(columnIndex: number): string;
|
|
245
|
+
/**
|
|
246
|
+
* Retrieves the row object from the body model at the specified index.
|
|
247
|
+
*
|
|
248
|
+
* @param {number} rowIndex - The index of the row to retrieve.
|
|
249
|
+
*
|
|
250
|
+
* @return {any} The row object at the specified index.
|
|
251
|
+
*/
|
|
81
252
|
getBodyRowByIndex(rowIndex: number): any;
|
|
253
|
+
/**
|
|
254
|
+
* Checks if a column at the given index is sortable.
|
|
255
|
+
*
|
|
256
|
+
* @param {number} columnIndex - The index of the column to check.
|
|
257
|
+
*
|
|
258
|
+
* @returns {boolean} - `true` if the column is sortable, `false` otherwise.
|
|
259
|
+
*/
|
|
82
260
|
isSortable(columnIndex: number): boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Moves a column in the column order.
|
|
263
|
+
*
|
|
264
|
+
* @param {number} sourceColumnIndex - The index of the column to be moved.
|
|
265
|
+
* @param {number} targetColumnIndex - The index where the column should be moved to.
|
|
266
|
+
*
|
|
267
|
+
* @returns {void}
|
|
268
|
+
*/
|
|
83
269
|
changeColumnOrder(sourceColumnIndex: number, targetColumnIndex: number): void;
|
|
84
270
|
private recalcColumnWidthes;
|
|
85
271
|
private arrayMove;
|
|
@@ -24,33 +24,198 @@ import { SelectionModelIf } from "../../selection/selection-model.if";
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
export interface TableModelIf {
|
|
27
|
+
/**
|
|
28
|
+
* Moves a column from the source column index to the target column index.
|
|
29
|
+
*
|
|
30
|
+
* @param {number} sourceColumnIndex - The index of the column to be moved.
|
|
31
|
+
* @param {number} targetColumnIndex - The index where the column will be moved to.
|
|
32
|
+
*
|
|
33
|
+
* @return {void} - This method does not return anything.
|
|
34
|
+
*/
|
|
27
35
|
changeColumnOrder(sourceColumnIndex: number, targetColumnIndex: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* Checks if a column at the specified index is sortable.
|
|
38
|
+
*
|
|
39
|
+
* @param {number} colIdx - The index of the column to check.
|
|
40
|
+
* @return {boolean} - true if the column is sortable, false otherwise.
|
|
41
|
+
*/
|
|
28
42
|
isSortable(colIdx: number): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Triggered by TableScope.firstInit() after the table tag is attached to the dom.
|
|
45
|
+
*/
|
|
29
46
|
init(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the number of columns in a dataset.
|
|
49
|
+
*
|
|
50
|
+
* @returns {number} The number of columns in the dataset.
|
|
51
|
+
*/
|
|
30
52
|
getColumnCount(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the width (in pixels) of a specific column.
|
|
55
|
+
*
|
|
56
|
+
* @param {number} columnIndex - The index of the column to get the width of.
|
|
57
|
+
* @return {number} The width of the specified column.
|
|
58
|
+
*/
|
|
31
59
|
getColumnWidth(columnIndex: number): number;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the x position corresponding to the given column index.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} columnIndex - The index of the column.
|
|
64
|
+
* @return {number} - The x position corresponding to the given column index.
|
|
65
|
+
*/
|
|
32
66
|
getXPosByColumnIndex(columnIndex: number): number;
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves the area model based on the given row area identifier.
|
|
69
|
+
*
|
|
70
|
+
* @param {AreaIdent} rowAreaIdent - The identifier of the row area.
|
|
71
|
+
* @return {AreaModelIf} The area model corresponding to the provided row area identifier.
|
|
72
|
+
*/
|
|
33
73
|
getAreaModel(rowAreaIdent: AreaIdent): AreaModelIf;
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves the body model.
|
|
76
|
+
*
|
|
77
|
+
* @returns {AreaModelIf} The body model representing an area.
|
|
78
|
+
*/
|
|
34
79
|
getBodyModel(): AreaModelIf;
|
|
80
|
+
/**
|
|
81
|
+
* Retrieves the number of fixed left columns.
|
|
82
|
+
*
|
|
83
|
+
* @returns {number} The count of fixed left columns.
|
|
84
|
+
*/
|
|
35
85
|
getFixedLeftColumnCount(): number;
|
|
86
|
+
/**
|
|
87
|
+
* Retrieves the count of fixed right columns.
|
|
88
|
+
*
|
|
89
|
+
* @return {number} The count of fixed right columns.
|
|
90
|
+
*/
|
|
36
91
|
getFixedRightColumnCount(): number;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if the header is visible.
|
|
94
|
+
*
|
|
95
|
+
* @return {boolean} - Returns true if the header is visible, false otherwise.
|
|
96
|
+
*/
|
|
37
97
|
isHeaderVisibe(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Checks if the footer is visible.
|
|
100
|
+
*
|
|
101
|
+
* @returns {boolean} Returns true if the footer is visible, otherwise returns false.
|
|
102
|
+
*/
|
|
38
103
|
isFooterVisibe(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Determines if the row checkbox is visible.
|
|
106
|
+
*
|
|
107
|
+
* @return {boolean} True if the row checkbox is visible, false otherwise.
|
|
108
|
+
*/
|
|
39
109
|
isRowCheckboxVisible(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Retrieves the height of a specific row in the provided row area.
|
|
112
|
+
*
|
|
113
|
+
* @param {AreaIdent} rowAreaIdent - The identifier of the row area.
|
|
114
|
+
* @param {number} rowIndex - The index of the row for which to retrieve the height.
|
|
115
|
+
* @return {number} The height of the specified row in pixels.
|
|
116
|
+
*/
|
|
40
117
|
getRowHeight(rowAreaIdent: AreaIdent, rowIndex: number): number;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieves the column definition for the specified index.
|
|
120
|
+
*
|
|
121
|
+
* @param {number} index - The index of the column to retrieve the definition for.
|
|
122
|
+
* @return {ColumnDefIf | undefined} - The column definition for the specified index, or undefined if not found.
|
|
123
|
+
*/
|
|
41
124
|
getColumnDef(index: number): ColumnDefIf | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieves the column definitions for a table.
|
|
127
|
+
*
|
|
128
|
+
* @return {ColumnDefIf[] | undefined} An array of column definitions or undefined if there are no column definitions.
|
|
129
|
+
*/
|
|
42
130
|
getColumnDefs(): ColumnDefIf[] | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Retrieves the property of a specific column.
|
|
133
|
+
*
|
|
134
|
+
* @param {number} columnIndex - The index of the column.
|
|
135
|
+
* @return {string} The property of the column.
|
|
136
|
+
*/
|
|
43
137
|
getColumnProperty(columnIndex: number): string;
|
|
138
|
+
/**
|
|
139
|
+
* Retrieves the body row at the specified index.
|
|
140
|
+
*
|
|
141
|
+
* @param {number} rowIndex - The index of the desired body row.
|
|
142
|
+
* @returns {any} - The body row object at the specified index.
|
|
143
|
+
*/
|
|
44
144
|
getBodyRowByIndex(rowIndex: number): any;
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves the width of a given column in the table.
|
|
147
|
+
*
|
|
148
|
+
* @param {number} columnIndex - The index of the column for which to get the width.
|
|
149
|
+
* @return {number} The width of the column in pixels.
|
|
150
|
+
*/
|
|
45
151
|
getColumnWidth(columnIndex: number): number;
|
|
152
|
+
/**
|
|
153
|
+
* Sets the width of a column in the table.
|
|
154
|
+
*
|
|
155
|
+
* @param {number} columnIndex - The index of the column to set the width for.
|
|
156
|
+
* @param {number} width - The width to set for the column, in pixels.
|
|
157
|
+
* @return {void}
|
|
158
|
+
*/
|
|
46
159
|
setColumnWidth(columnIndex: number, width: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Recalculates the size of the element based on the provided client width.
|
|
162
|
+
*
|
|
163
|
+
* @param {number} clientWidth - The current client width of the element.
|
|
164
|
+
* @return {void}
|
|
165
|
+
*/
|
|
47
166
|
recalcSize(clientWidth: number): void;
|
|
167
|
+
/**
|
|
168
|
+
* Recalculates the padding of the element based on its content.
|
|
169
|
+
* This method updates the padding of the element to ensure that its content
|
|
170
|
+
* is properly aligned and displayed.
|
|
171
|
+
*
|
|
172
|
+
* @returns {void}
|
|
173
|
+
*/
|
|
48
174
|
recalcPadding(): void;
|
|
175
|
+
/**
|
|
176
|
+
* Recalculates the height and padding of an element.
|
|
177
|
+
*
|
|
178
|
+
* @returns {void}
|
|
179
|
+
*/
|
|
49
180
|
recalcHeightAndPadding(): void;
|
|
181
|
+
/**
|
|
182
|
+
* Retrieves the padding value of the element.
|
|
183
|
+
*
|
|
184
|
+
* @returns {Padding} The padding value of the element.
|
|
185
|
+
*/
|
|
50
186
|
getPadding(): Padding;
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves the content height in pixels.
|
|
189
|
+
*
|
|
190
|
+
* @returns {number} The height of the content in pixels.
|
|
191
|
+
*/
|
|
51
192
|
getContentHeightInPixel(): number;
|
|
193
|
+
/**
|
|
194
|
+
* Returns the content width in pixels.
|
|
195
|
+
*
|
|
196
|
+
* @returns {number} The width of the content in pixels.
|
|
197
|
+
*/
|
|
52
198
|
getContentWidthInPixel(): number;
|
|
199
|
+
/**
|
|
200
|
+
* This is triggered when an external filter has changed.
|
|
201
|
+
*
|
|
202
|
+
* @param {FilterFunction<T>} predictFn - A function that takes an element of type T and returns a boolean indicating whether the element satisfies the filter conditions.
|
|
203
|
+
* @template T - The type of elements being filtered.
|
|
204
|
+
*
|
|
205
|
+
* @return {void}
|
|
206
|
+
*/
|
|
53
207
|
externalFilterChanged<T>(predictFn: FilterFunction<T>): void;
|
|
208
|
+
/**
|
|
209
|
+
* Sorts an array of SortItem objects based on a predetermined sorting algorithm.
|
|
210
|
+
*
|
|
211
|
+
* @param {SortItem[]} sortItems - An array of SortItem objects to be sorted.
|
|
212
|
+
* @return {boolean} - Returns true if the sorting was successful, false otherwise.
|
|
213
|
+
*/
|
|
54
214
|
doSort(sortItems: SortItem[]): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Retrieves the selection model associated with the component.
|
|
217
|
+
*
|
|
218
|
+
* @returns {SelectionModelIf|undefined} The selection model instance if available, or undefined if none is found.
|
|
219
|
+
*/
|
|
55
220
|
getSelectionModel(): SelectionModelIf | undefined;
|
|
56
221
|
}
|
package/lib/table/ele-scope.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { DivScope } from "./data/div-scope.type";
|
|
|
3
3
|
import { TableModelIf } from "./data/tablemodel/table-model.if";
|
|
4
4
|
import { TableOptionsIf } from "./data/options/table-options.if";
|
|
5
5
|
import { GeoData } from "./data/geo-data";
|
|
6
|
+
/**
|
|
7
|
+
* Represents an store for HTML elements.
|
|
8
|
+
* @class
|
|
9
|
+
*/
|
|
6
10
|
export declare class EleScope {
|
|
7
11
|
readonly hostElement: HTMLDivElement;
|
|
8
12
|
readonly tableModel: TableModelIf;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { GeModelChangeEvent } from "./data/common/event/ge-model-change-event";
|
|
2
2
|
import { GeMouseEvent } from "./data/common/event/ge-mouse-event";
|
|
3
3
|
import { EventListenerIf } from "./event-listener.if";
|
|
4
|
+
/**
|
|
5
|
+
* EventAdapter class implements the EventListenerIf interface.
|
|
6
|
+
* It provides empty implementations for all the event listener methods.
|
|
7
|
+
*
|
|
8
|
+
* @class
|
|
9
|
+
* @implements {EventListenerIf}
|
|
10
|
+
*/
|
|
4
11
|
export declare class EventAdapter implements EventListenerIf {
|
|
5
12
|
onCheckboxChanged(_evt: any[]): void;
|
|
6
13
|
onContextmenu(_evt: GeMouseEvent): void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { GeMouseEvent } from "./data/common/event/ge-mouse-event";
|
|
2
2
|
import { GeModelChangeEvent } from "./data/common/event/ge-model-change-event";
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing an event listener.
|
|
5
|
+
*
|
|
6
|
+
* @interface
|
|
7
|
+
*/
|
|
3
8
|
export interface EventListenerIf {
|
|
4
9
|
onContextmenu(evt: GeMouseEvent): void;
|
|
5
10
|
onMouseMoved(evt: GeMouseEvent): void;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { TableScope } from "./table-scope";
|
|
2
|
+
/**
|
|
3
|
+
* Class representing an input handler for table input fields (HTMLSelectElement, HTMLTextAreaElement, HTMLInputElement).
|
|
4
|
+
*
|
|
5
|
+
* @class
|
|
6
|
+
* @memberOf module:input
|
|
7
|
+
*/
|
|
2
8
|
export declare class InputHandler {
|
|
3
9
|
protected tableScope: TableScope;
|
|
4
10
|
constructor(tableScope: TableScope);
|
|
11
|
+
/**
|
|
12
|
+
* Handles the onHostElementChanged event.
|
|
13
|
+
* In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
|
|
14
|
+
*
|
|
15
|
+
* @param {Event} event - The event object.
|
|
16
|
+
*
|
|
17
|
+
* @return {void}
|
|
18
|
+
*/
|
|
5
19
|
private onHostElementChanged;
|
|
6
20
|
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given row is a tree row.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} row - The row to be checked.
|
|
5
|
+
*
|
|
6
|
+
* @return {boolean} - true if the row is a tree row, false otherwise.
|
|
7
|
+
*/
|
|
1
8
|
export declare function isTreeRow(row: any): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Determines if the given model is an AreaModelTree.
|
|
11
|
+
*
|
|
12
|
+
* @param {any} model - The model object to check.
|
|
13
|
+
* @return {boolean} - True if the model is an AreaModelTree, false otherwise.
|
|
14
|
+
*/
|
|
2
15
|
export declare function isAreaModelTree(model: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the given object is a CheckboxColumnDef.
|
|
18
|
+
*
|
|
19
|
+
* @param {any} o - The object to be checked.
|
|
20
|
+
* @returns {boolean} - True if the object is a CheckboxColumnDef, false otherwise.
|
|
21
|
+
*/
|
|
3
22
|
export declare function isCheckboxColumnDef(o: any): boolean;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { TableScope } from "./table-scope";
|
|
2
2
|
import { GeMouseEvent } from "./data/common/event/ge-mouse-event";
|
|
3
|
+
/**
|
|
4
|
+
* Class representing a MouseHandler.
|
|
5
|
+
* @class
|
|
6
|
+
*/
|
|
3
7
|
export declare class MouseHandler {
|
|
4
8
|
protected tableScope: TableScope;
|
|
5
9
|
mouseEvent?: MouseEvent;
|
|
@@ -10,10 +14,44 @@ export declare class MouseHandler {
|
|
|
10
14
|
private mouseDown;
|
|
11
15
|
private dragging;
|
|
12
16
|
constructor(tableScope: TableScope);
|
|
17
|
+
/**
|
|
18
|
+
* Handles the "contextmenu" event.
|
|
19
|
+
*
|
|
20
|
+
* @private
|
|
21
|
+
* @param {MouseEvent} evt - The mouse event object.
|
|
22
|
+
* @return {void}
|
|
23
|
+
*/
|
|
13
24
|
private onContextmenu;
|
|
25
|
+
/**
|
|
26
|
+
* Handles the click event on the host element.
|
|
27
|
+
*
|
|
28
|
+
* @param {MouseEvent} event - The click event.
|
|
29
|
+
*
|
|
30
|
+
* @return {void}
|
|
31
|
+
*/
|
|
14
32
|
private onHostElementClicked;
|
|
33
|
+
/**
|
|
34
|
+
* Handles the double click event on the host element.
|
|
35
|
+
* This method is private.
|
|
36
|
+
*
|
|
37
|
+
* @param {MouseEvent} event - The double click event.
|
|
38
|
+
*/
|
|
15
39
|
private onHostElementDblClicked;
|
|
40
|
+
/**
|
|
41
|
+
* Publishes a GeMouseEvent.
|
|
42
|
+
*
|
|
43
|
+
* @param {MouseEvent} event - The MouseEvent to publish.
|
|
44
|
+
* @param {number} clickCount - The number of clicks for the GeMouseEvent.
|
|
45
|
+
*
|
|
46
|
+
* @return {void}
|
|
47
|
+
*/
|
|
16
48
|
private publishGeMouseEvent;
|
|
49
|
+
/**
|
|
50
|
+
* Update the collapsed/expanded state of a tree row.
|
|
51
|
+
*
|
|
52
|
+
* @param {TreeRowIf<any>} tr - The tree row object.
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
17
55
|
private updateCollapsedExpandedState;
|
|
18
56
|
private getArrowColumnIndex;
|
|
19
57
|
private onMouseDown;
|
|
@@ -71,7 +71,7 @@ export declare class RenderScope extends EleScope {
|
|
|
71
71
|
protected findRowOfImportantRowspanCell(areaModel: AreaModelIf, rowIndex: number, colIndex: number): number;
|
|
72
72
|
protected adjustColumnsToRowParent({ areaIdent, sideIdent, areaModel, geo, parent, rowIndex, columnIndexStart, columnIndexEnd, verticalFixed, lastRowOfModel }: ArgsAdjustColumnsToRowParentParams): void;
|
|
73
73
|
protected getTreeArrowColumnIndex(): 0 | 1;
|
|
74
|
-
protected addAndRenderCellDiv({ areaModel, areaIdent, sideIdent, rowIndex, index, left, width, height, top, parent, lastRowOfModel }: ArgsRenderCellDiv): [HTMLDivElement, RendererCleanupFnType | undefined];
|
|
74
|
+
protected addAndRenderCellDiv({ areaModel, areaIdent, sideIdent, rowIndex, index, left, width, height, top, parent, lastRowOfModel, gammaRange }: ArgsRenderCellDiv): [HTMLDivElement, RendererCleanupFnType | undefined];
|
|
75
75
|
protected applyCssClasses(ele: HTMLDivElement, cssClasses?: {
|
|
76
76
|
[key: string]: boolean;
|
|
77
77
|
}): void;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an editInputPipe function.
|
|
3
|
+
* @typedef {Function} editInputPipe
|
|
4
|
+
* @param {any} input - The input object.
|
|
5
|
+
* @param {number} rowIndex - The index of the row.
|
|
6
|
+
* @param {number} columnIndex - The index of the column.
|
|
7
|
+
* @returns {any|undefined} - The modified input object or undefined.
|
|
8
|
+
*/
|
|
1
9
|
export interface editInputPipe {
|
|
2
10
|
(input: any, rowIndex: number, columnIndex: number): any | undefined;
|
|
3
11
|
}
|
package/lib/table/table-api.d.ts
CHANGED
|
@@ -4,15 +4,87 @@ import { TableCellUpdateEventIf } from "./data/common/event/input/table-cell-upd
|
|
|
4
4
|
export declare class TableApi {
|
|
5
5
|
private readonly tableScope;
|
|
6
6
|
constructor(tableScope: TableScope);
|
|
7
|
+
/**
|
|
8
|
+
* Updates the cells in the table based on the provided events.
|
|
9
|
+
*
|
|
10
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events representing the updates to perform on the cells.
|
|
11
|
+
* @param {boolean} [repaintAll=false] - Optional parameter indicating whether to repaint all cells or not. Default value is false. If true, the full table will be rendered. If false, the table cell will be rendered immediately.
|
|
12
|
+
*
|
|
13
|
+
* @return {void} - This method doesn't return anything.
|
|
14
|
+
*/
|
|
7
15
|
updateCells(events: TableCellUpdateEventIf[], repaintAll?: boolean): void;
|
|
16
|
+
/**
|
|
17
|
+
* Notifies that the external filter has changed.
|
|
18
|
+
*
|
|
19
|
+
* @return {void}
|
|
20
|
+
*/
|
|
8
21
|
externalFilterChanged(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Scrolls the table body to the specified pixel coordinates.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} _px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
26
|
+
* @param {number} _py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
27
|
+
* @return {void}
|
|
28
|
+
*/
|
|
9
29
|
scrollToPixel(_px?: number, _py?: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
32
|
+
*
|
|
33
|
+
* @param {number} _indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
34
|
+
* @param {number} _indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
35
|
+
*
|
|
36
|
+
* @return undefined
|
|
37
|
+
*/
|
|
10
38
|
scrollToIndex(_indexX?: number, _indexY?: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets whether the header is visible or not.
|
|
41
|
+
*
|
|
42
|
+
* @param _visible - A boolean value indicating whether the header should be visible. Default value is true.
|
|
43
|
+
*
|
|
44
|
+
* @return undefined
|
|
45
|
+
*/
|
|
11
46
|
setHeaderVisible(_visible?: boolean): void;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the visibility of a column in the table.
|
|
49
|
+
*
|
|
50
|
+
* @param {_column} - The column index or column definition to set visibility for.
|
|
51
|
+
* @param {_visible=true} - The flag to set visibility to. true for visible, false for hidden.
|
|
52
|
+
*
|
|
53
|
+
* @return {void} - There is no return value.
|
|
54
|
+
*/
|
|
12
55
|
setColumnVisible(_column: number | ColumnDefIf, _visible?: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Returns whether a column is visible or not.
|
|
58
|
+
*
|
|
59
|
+
* @param {number | ColumnDefIf} _column - The column index or the column definition.
|
|
60
|
+
* @return {boolean} - True if the column is visible, false otherwise.
|
|
61
|
+
*/
|
|
13
62
|
isColumnVisible(_column: number | ColumnDefIf): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if the header is visible.
|
|
65
|
+
*
|
|
66
|
+
* @return {boolean} - Returns true if the header is visible, otherwise returns false.
|
|
67
|
+
*/
|
|
14
68
|
isHeaderVisible(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the visibility of the footer.
|
|
71
|
+
*
|
|
72
|
+
* @param {boolean} _visible - Indicates whether the footer should be visible or not. Default value is true.
|
|
73
|
+
*
|
|
74
|
+
* @return {void} - This method does not return any value.
|
|
75
|
+
*/
|
|
15
76
|
setFooterVisible(_visible?: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* Determines if the footer is visible.
|
|
79
|
+
*
|
|
80
|
+
* @returns {boolean} True if the footer is visible, false otherwise.
|
|
81
|
+
*/
|
|
16
82
|
isFooterVisible(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Repaints the table.
|
|
85
|
+
*
|
|
86
|
+
* This method calls the repaint method of the tableScope object
|
|
87
|
+
* to update and redraw the table based on the latest data.
|
|
88
|
+
*/
|
|
17
89
|
repaint(): void;
|
|
18
90
|
}
|