@guiexpert/table 1.1.118 → 1.1.119
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/README.md +3 -0
- package/index.cjs +20 -20
- package/index.js +1052 -915
- package/lib/table/data/common/event/ge-column-move-event.d.ts +2 -2
- package/lib/table/data/common/event/ge-column-resize-event.d.ts +2 -1
- package/lib/table/event-listener.if.d.ts +5 -1
- package/lib/table/mouse-handler.d.ts +39 -0
- package/lib/table/table-api.d.ts +38 -0
- package/lib/table/table-scope.d.ts +13 -0
- package/llms.txt +9 -0
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ import { GeColumnDragEventType } from './ge-column-resize-event.js';
|
|
|
22
22
|
* @since 1.1.110
|
|
23
23
|
*/
|
|
24
24
|
export declare class GeColumnMoveEvent {
|
|
25
|
-
/** Phase: `"start"`, `"end"` or `"cancel"` (Escape: the old order is back). */
|
|
25
|
+
/** Phase: `"start"`, `"end"` or `"cancel"` (Escape, or the mouseup never arrived – since 1.1.119: the old order is back). */
|
|
26
26
|
readonly type: GeColumnDragEventType;
|
|
27
27
|
/** Model index of the column when the drag started. */
|
|
28
28
|
readonly fromIndex: number;
|
|
@@ -37,7 +37,7 @@ export declare class GeColumnMoveEvent {
|
|
|
37
37
|
/** The browser event behind it (mouse up; `undefined` for {@link TableApi.cancelColumnDrag}). */
|
|
38
38
|
readonly originalEvent?: Event | undefined;
|
|
39
39
|
constructor(
|
|
40
|
-
/** Phase: `"start"`, `"end"` or `"cancel"` (Escape: the old order is back). */
|
|
40
|
+
/** Phase: `"start"`, `"end"` or `"cancel"` (Escape, or the mouseup never arrived – since 1.1.119: the old order is back). */
|
|
41
41
|
type: GeColumnDragEventType,
|
|
42
42
|
/** Model index of the column when the drag started. */
|
|
43
43
|
fromIndex: number,
|
|
@@ -3,7 +3,8 @@ import { ColumnDefIf } from '../../tablemodel/column/column-def.if.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Phase of a column drag (resize or move): `"start"` (the mouse moved past the drag threshold of 4 px, or a double
|
|
5
5
|
* click on the resize handle), `"end"` (released – also outside of the table) or `"cancel"` (Escape,
|
|
6
|
-
* {@link TableApi.cancelColumnDrag}
|
|
6
|
+
* {@link TableApi.cancelColumnDrag}, or the mouseup never reached the page – a native drag, a system dialog,
|
|
7
|
+
* {@link TableApi.releaseMouse}, since 1.1.119: the old width resp. order is back).
|
|
7
8
|
*
|
|
8
9
|
* @category Column drag
|
|
9
10
|
* @since 1.1.110
|
|
@@ -46,7 +46,11 @@ export interface EventListenerIf extends EventFocusChangedListenerIf, EventSelec
|
|
|
46
46
|
onContextmenu(evt: GeMouseEvent): void;
|
|
47
47
|
/** The mouse moved over the table (cell under the mouse in `evt`). Called often – keep it cheap. */
|
|
48
48
|
onMouseMoved(evt: GeMouseEvent): void;
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* A drag with the mouse ended (column resize, column move or range selection). Since 1.1.119 also when the mouseup
|
|
51
|
+
* never reached the page (a native drag out of the window, a system dialog, {@link TableApi.releaseMouse}): then
|
|
52
|
+
* with the last position of the drag.
|
|
53
|
+
*/
|
|
50
54
|
onMouseDraggingEnd(evt: GeMouseEvent): void;
|
|
51
55
|
/** The mouse is being dragged; `evt.draggingX` / `evt.draggingY` hold the distance. */
|
|
52
56
|
onMouseDragging(evt: GeMouseEvent): void;
|
|
@@ -47,6 +47,12 @@ export declare class MouseHandler {
|
|
|
47
47
|
private dragGeneration;
|
|
48
48
|
/** The end of the last drag, until its frame ran – a new mousedown handles it at once (see {@link flushDraggingEnd}). */
|
|
49
49
|
private pendingDraggingEnd?;
|
|
50
|
+
/** The button of the press as a bit of `MouseEvent.buttons` (left 1, right 2, middle 4) – see {@link isPressLost}. */
|
|
51
|
+
private pressButtons;
|
|
52
|
+
/** The listeners of the current press at the document and the window (mouseup, lost press) – aborted when it ends. */
|
|
53
|
+
private pressAbort?;
|
|
54
|
+
/** `onMouseDragging` was reported for the current press – only then {@link releaseMouse} reports the end. */
|
|
55
|
+
private dragReported;
|
|
50
56
|
constructor(tableScope: TableScope);
|
|
51
57
|
/**
|
|
52
58
|
* Handles the "contextmenu" event.
|
|
@@ -115,8 +121,38 @@ export declare class MouseHandler {
|
|
|
115
121
|
private isInteractiveCellElement;
|
|
116
122
|
private getArrowColumnIndex;
|
|
117
123
|
private onMouseDown;
|
|
124
|
+
/** True if a mousedown shows that the press of the table is over: the same button again, or its button is not held. */
|
|
125
|
+
private isStalePress;
|
|
126
|
+
/** The bit of `MouseEvent.buttons` for the button of a mousedown (`button` 0 → 1, 1 → 4, 2 → 2, 3 → 8, 4 → 16). */
|
|
127
|
+
private static buttonsOf;
|
|
128
|
+
/**
|
|
129
|
+
* True if the table is pressed but the button of the press is not held any more: the mouseup never reached the
|
|
130
|
+
* page – a native drag out of the window (Tauri, Electron), an HTML5 drag, a system dialog (since 1.1.119).
|
|
131
|
+
*/
|
|
132
|
+
private isPressLost;
|
|
133
|
+
/**
|
|
134
|
+
* Listens at the document and the window while the button is held: for the mouseup outside of the host, and for
|
|
135
|
+
* everything that tells that no mouseup will come ({@link releaseMouse}). {@link endPressListeners} removes them.
|
|
136
|
+
*/
|
|
137
|
+
private listenToPress;
|
|
138
|
+
private endPressListeners;
|
|
118
139
|
/** A mouseup that did not reach the host (released outside the table). */
|
|
119
140
|
private onDocumentMouseUp;
|
|
141
|
+
/**
|
|
142
|
+
* Ends the press without a mouseup ({@link TableApi.releaseMouse}): the table is not pressed any more. Nothing is
|
|
143
|
+
* dropped – a running column resize or move is cancelled like with Escape (old width resp. order, end with type
|
|
144
|
+
* `"cancel"`), a range selection stays as it is, no click is reported. `onMouseDraggingEnd` is called once if
|
|
145
|
+
* `onMouseDragging` was (with the last position of the press). Without a press nothing happens.
|
|
146
|
+
*
|
|
147
|
+
* Called by the table itself as soon as it notices that the button is not held any more: a mouse movement in the
|
|
148
|
+
* document without the button, `pointercancel`, an HTML5 `dragstart` that is not prevented, the window losing the
|
|
149
|
+
* focus, the next mousedown of that button.
|
|
150
|
+
*
|
|
151
|
+
* @param {Event} [originalEvent] - the event that told it (passed on to the column event)
|
|
152
|
+
* @returns {boolean} true if a press was ended
|
|
153
|
+
* @since 1.1.119
|
|
154
|
+
*/
|
|
155
|
+
releaseMouse(originalEvent?: Event): boolean;
|
|
120
156
|
/**
|
|
121
157
|
* Live data (since 1.1.108): a drag in progress (range selection) keeps its start row when rows were removed at the
|
|
122
158
|
* start or inserted.
|
|
@@ -147,6 +183,9 @@ export declare class MouseHandler {
|
|
|
147
183
|
* True while the mouse button is held in the table (a click or a drag in progress) – live data does not jump to
|
|
148
184
|
* the end then (`tableApi.appendRows({ follow: "auto" })`, since 1.1.108).
|
|
149
185
|
*
|
|
186
|
+
* Since 1.1.119 a press also ends without a mouseup, as soon as the table notices that the button is not held any
|
|
187
|
+
* more (see {@link releaseMouse}).
|
|
188
|
+
*
|
|
150
189
|
* @returns {boolean} true between mousedown and mouseup
|
|
151
190
|
*/
|
|
152
191
|
isButtonDown(): boolean;
|
package/lib/table/table-api.d.ts
CHANGED
|
@@ -1175,6 +1175,44 @@ export declare class TableApi {
|
|
|
1175
1175
|
* @since 1.1.110
|
|
1176
1176
|
*/
|
|
1177
1177
|
cancelColumnDrag(): void;
|
|
1178
|
+
/**
|
|
1179
|
+
* Ends the mouse press of the table when its `mouseup` never reaches the page – e.g. because the app hands a drag
|
|
1180
|
+
* over to the operating system (Tauri / Electron `startDrag`: the mouse belongs to the system from then on).
|
|
1181
|
+
*
|
|
1182
|
+
* Nothing is dropped: a running column resize or move is cancelled like with Escape (`onColumnResizeEnd` /
|
|
1183
|
+
* `onColumnMoveEnd` with type `"cancel"`), a range selection stays as it is, no click is reported, and
|
|
1184
|
+
* `onMouseDraggingEnd` is called once if `onMouseDragging` was. Without a press nothing happens.
|
|
1185
|
+
*
|
|
1186
|
+
* The table also notices it by itself – with the next mouse movement without the button, a `pointercancel`, an
|
|
1187
|
+
* HTML5 `dragstart` or when the window loses the focus. Call this method when the app knows the moment: until
|
|
1188
|
+
* then {@link isMouseDown} is `true` and live data does not follow the end ({@link appendRows}).
|
|
1189
|
+
*
|
|
1190
|
+
* @example
|
|
1191
|
+
* // the app drags a file out of the window: the system takes the mouse, no mouseup will come
|
|
1192
|
+
* declare function startNativeDrag(): Promise<void>;
|
|
1193
|
+
*
|
|
1194
|
+
* tableApi.releaseMouse();
|
|
1195
|
+
* await startNativeDrag();
|
|
1196
|
+
*
|
|
1197
|
+
* @since 1.1.119
|
|
1198
|
+
*/
|
|
1199
|
+
releaseMouse(): void;
|
|
1200
|
+
/**
|
|
1201
|
+
* True while a mouse button is held in the table: between `mousedown` and `mouseup` – or {@link releaseMouse},
|
|
1202
|
+
* or the moment the table notices that the button is not held any more. Live data does not jump to the end
|
|
1203
|
+
* meanwhile ({@link appendRows} with `follow: "auto"`).
|
|
1204
|
+
*
|
|
1205
|
+
* A row drag at its handle and the fill handle use pointer events: see {@link isRowDragging} and {@link isFilling}.
|
|
1206
|
+
*
|
|
1207
|
+
* @example
|
|
1208
|
+
* if (!tableApi.isMouseDown()) {
|
|
1209
|
+
* tableApi.setRows(newOrders); // not while the user clicks or drags
|
|
1210
|
+
* }
|
|
1211
|
+
*
|
|
1212
|
+
* @returns {boolean} true while the button is held in the table
|
|
1213
|
+
* @since 1.1.119
|
|
1214
|
+
*/
|
|
1215
|
+
isMouseDown(): boolean;
|
|
1178
1216
|
/**
|
|
1179
1217
|
* Recalculates the dimensions of all wrapper elements in the table.
|
|
1180
1218
|
*
|
|
@@ -142,6 +142,8 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
142
142
|
private mouseStartColumnIndex;
|
|
143
143
|
/** The column resize or move of the current press (prompt 022) – `undefined` without an allowed column action. */
|
|
144
144
|
private columnDrag?;
|
|
145
|
+
/** Counts the presses that ended without a mouseup ({@link mousePressLost}) – a drag frame in progress stops. */
|
|
146
|
+
private pressLostCount;
|
|
145
147
|
private dragFrom;
|
|
146
148
|
private lastDragFrom;
|
|
147
149
|
private lastDragTo;
|
|
@@ -921,6 +923,17 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
921
923
|
* @since 1.1.110
|
|
922
924
|
*/
|
|
923
925
|
cancelColumnDrag(originalEvent?: Event): void;
|
|
926
|
+
/**
|
|
927
|
+
* The press ended without a mouseup ({@link MouseHandler.releaseMouse}, {@link TableApi.releaseMouse}): nothing is
|
|
928
|
+
* dropped. A running column resize or move is cancelled like with Escape (`onColumnResizeEnd` / `onColumnMoveEnd`
|
|
929
|
+
* with type `"cancel"`), the column action of the press is forgotten, then `onMouseDraggingEnd` is reported if a
|
|
930
|
+
* drag was.
|
|
931
|
+
*
|
|
932
|
+
* @param {GeMouseEvent} [draggingEndEvent] - the last position of the drag (only if `onMouseDragging` was reported)
|
|
933
|
+
* @param {Event} [originalEvent] - the event that told that the button is not held any more
|
|
934
|
+
* @since 1.1.119
|
|
935
|
+
*/
|
|
936
|
+
mousePressLost(draggingEndEvent?: GeMouseEvent, originalEvent?: Event): void;
|
|
924
937
|
/** Reports a column drag to the listener (and the subscribers). */
|
|
925
938
|
private emitColumnDragEvent;
|
|
926
939
|
/**
|
package/llms.txt
CHANGED
|
@@ -638,6 +638,13 @@ Symptom → cause → fix.
|
|
|
638
638
|
- **`Maximum call stack size exceeded`** → `array.push(...rows)` with ~100,000+ rows → a `for` loop (or `appendRows`).
|
|
639
639
|
- **Clicks lost while the table updates** (before 1.1.108) → a render between `mousedown` and `mouseup` → update to
|
|
640
640
|
1.1.108; older: render only when the visible part changed.
|
|
641
|
+
- **After a drag out of the window (Tauri / Electron `startDrag`, HTML5 drag from a cell) the table stays "pressed":
|
|
642
|
+
no hover, selection or column follows the pointer without a button, the next click is ignored** (before 1.1.119) →
|
|
643
|
+
the system took the mouse, no `mouseup` reached the page → update to 1.1.119 (the press ends with the next mouse
|
|
644
|
+
movement without the button, a column drag is cancelled); an app that starts the native drag calls
|
|
645
|
+
`tableApi.releaseMouse()` right before it. Older: `host.dispatchEvent(new MouseEvent("mouseup"))`.
|
|
646
|
+
- **A test that drags with synthetic events stopped working in 1.1.119** → `new MouseEvent("mousemove")` has
|
|
647
|
+
`buttons: 0` = "the button is not held" → pass `buttons: 1` (also for `pointermove` of a row drag / fill handle).
|
|
641
648
|
- **Context menu right after creating the table is ignored** → the first 50 ms are swallowed → normal; Angular: use
|
|
642
649
|
`(contextMenu)` – `(contextmenu)` fires twice (also the native event).
|
|
643
650
|
- **Clicks arrive late in Angular/Vue** → `debounceMouseClickDelay` (150 ms) → `0` for immediate clicks (a double click
|
|
@@ -683,6 +690,7 @@ Full answers: instructions.md section 6.26 (https://github.com/guiexperttable/mo
|
|
|
683
690
|
- Rows appended continuously (live log, ticker) and keep the position or follow the end: `tableApi.repaintHard({ py })` – one render pass (since 1.1.107); follow the end with `py: Number.MAX_SAFE_INTEGER`.
|
|
684
691
|
- Clicks lost while the app renders (live tail, `repaint()`/`repaintHard()` between mousedown and mouseup): fixed in 1.1.108 – the table reports `mouseClicked` (and the double click) for the pressed cell itself, once, with the current index of that row object.
|
|
685
692
|
- Rows that keep coming (log, stream, ticker of trades): `tableApi.appendRows(rows, { follow: "auto", maxRows })` (since 1.1.108) – in place, O(k), one render, filter/sort only for new rows, selection/focus stay; freeze = `follow: false`, jump to the end = `repaintHard({ py: Number.MAX_SAFE_INTEGER })`. Own AreaModel: `rowsAppended(count, { removedAtStart })`. Not `addRows()`.
|
|
693
|
+
- Own drag out of the table (native drag in Tauri / Electron, files to the Finder): call `tableApi.releaseMouse()` right before the system takes the mouse – no `mouseup` will come (since 1.1.119; `tableApi.isMouseDown()` tells the state). The table also notices it by itself with the next mouse movement without the button, `pointercancel`, `dragstart` or window blur; a running column resize/move is cancelled (`type: "cancel"`), nothing is dropped, no click.
|
|
686
694
|
- `repaint()` = values changed, same row count; `repaintHard()` = row count or heights changed; `updateCells()` = single cells.
|
|
687
695
|
- Variable row heights: implement `getRowHeight(i)`; `getConstantRowHeight()` only if all rows are equally high. `defaultRowHeights` only applies to models the factory builds or whose `getRowHeight()` returns 0.
|
|
688
696
|
- Save the column layout when the user resizes or moves a column: `onColumnResizeEnd` / `onColumnMoveEnd` (wrappers `columnResizeEnd`, `columnMoveEnd`, since 1.1.110) – once per drag, after the change; read `tableApi.getState(["columns"])` there. Lock a column: `ColumnDef.resizable: false`, `movable: false`. Double click on the column border fits the width (`columnAutoWidth`, `tableApi.autoResizeColumn(column)`).
|
|
@@ -728,6 +736,7 @@ What the table can do – one line per feature, details in instructions.md (each
|
|
|
728
736
|
- Spreadsheet mode (since 1.1.99): SpreadsheetFactory.create({ data: unknown[][], rowCount (100), columnCount (26), columnWidth, rowHeight, rowNumbers, locale, functions, tableOptions }) → { tableModel: SpreadsheetTableModel, tableOptions } – column letters (AreaModelSheetHeader), row numbers, sparse AreaModelSheet; preset tableOptions.spreadsheet: true | { editing, clipboard, undo, cellFormulas, fillHandle } (false = off) for any flat table (TableFactory columnLetters: true). FormulaBar(container, api) – address box + formula input. api.getActiveCell(), goToAddress("B2:C5"), insertRows(at, count), deleteRows, insertColumns, deleteColumns (references adjusted, one undo step, source "structure"), getSheetData() (inputs for JSON).
|
|
729
737
|
- Angular signal component (since 1.1.100, Angular 22 and later): TableSignalComponent, selector guiexpert-table-signal, from @guiexpert/angular-table@22.x – inputs (input()) tableModel (TableModelIf | undefined), tableOptions (default new TableOptions()), loading, debounceMouseClickDelay (150, 0 = synchronous); tableApi = model<TableApi | undefined>() → [(tableApi)]="api" with api = signal<TableApi | undefined>(undefined), (tableApiChange), viewChild(TableSignalComponent)?.tableApi(); set when the table is built, switches directly to the new API on a new model/options, undefined after destroy, written from outside = replaced. Outputs (output()): no tableReady (the API comes as the signal tableApi / tableApiChange), mouseClicked, mouseMoved, mouseDragging, mouseDraggingEnded, contextMenu (camelCase – TableComponent's (contextmenu) also receives the native MouseEvent first), scroll, modelChanged, selectionChanged, focusChanged, checkboxChanged, stateChanged, rowDragStart/Move/End, batchEditChanged, detailExpandedChanged, editingChanged, undoStackChanged, columnResizeStart/End, columnMoveStart/End (since 1.1.110) – events of the table (mouse, keyboard, scroll …) are emitted outside the Angular zone (write signals in handlers). effect() instead of ngOnChanges, no RxJS, zoneless (provideZonelessChangeDetection()), SSR: no table on the server. TableComponent (<guiexpert-table>) unchanged for Angular 14 – 22+.
|
|
730
738
|
- Column drag (since 1.1.110): events EventListenerIf.onColumnResizeStart/End (GeColumnResizeEvent: type "start" | "end" | "cancel", source "mouse" | "dblclick", columnIndex, columnDef, property, oldWidth, newWidth) and onColumnMoveStart/End (GeColumnMoveEvent: type, fromIndex, toIndex, columnDef, property, columnOrder, moved) – only user actions, once per drag, the end after the change, start after 4 px, Escape / tableApi.cancelColumnDrag() = "cancel", tableApi.isColumnDragging(); wrappers columnResizeStart/End, columnMoveStart/End. Locks: ColumnDef.resizable: false (no handle, no double click, no auto width), movable: false (fixed place, applyState keeps it); RowNumberColumnDef has both false; a column stays in its area (west/center/east). Double click on the resize handle fits the width (no sorting): tableOptions.columnAutoWidth: { doubleClick (true), maxRows (10,000: all body rows, above only the rendered rows), getWidth(ctx: ColumnAutoWidthContextIf { columnIndex, columnDef, property, source, firstRenderedRow, lastRenderedRow, measureText(text), getDefaultWidth() }) => number | undefined }, limited by minWidth/maxWidth; tableApi.autoResizeColumn(index | property | ColumnDef) → width | undefined.
|
|
739
|
+
- Mouse press without a mouseup (since 1.1.119): tableApi.releaseMouse() ends the press of the table (native drag out of the window, the system took the mouse), tableApi.isMouseDown(): boolean. Automatic: a mousemove anywhere in the document without the pressed button (MouseEvent.buttons), pointercancel, a dragstart that is not prevented, window blur or the next mousedown end a press whose mouseup never arrived – column resize/move cancelled like Escape (onColumnResizeEnd / onColumnMoveEnd type "cancel"), range selection kept, no onMouseClicked, onMouseDraggingEnd once if a drag was reported; row drag, fill handle and formula pointing end on a pointermove with buttons 0. Synthetic drags in tests need `buttons: 1`. No wrapper code (all wrappers pass the TableApi).
|
|
731
740
|
- Column filters, filter menu and column chooser (since 1.1.114): opt-in persistent filter row `tableOptions.filterRow: true | FilterRowOptionsIf` (visible, debounce, placeholder, height, clearButtonVisible, minInputWidthInPx), Excel-style per-column filter menu `tableOptions.columnFilterMenu: true | ColumnFilterMenuOptionsIf` (showCondition, showValues, applyOnChange, maxValues, virtualized unique-value checklist, async `ColumnDef.filter.getValues`), global `tableOptions.columnFilter: ColumnFilterOptionsIf` (`managed: true | false`, `caseSensitive`, `locale`, `maxValues`), `tableOptions.columnFilterTexts: ColumnFilterTextsIf`; per-column `ColumnDef.filter: false | "text" | "number" | "date" | "boolean" | ColumnFilterColumnOptionsIf` (type, valueGetter, caseSensitive, placeholder, getValues) and `ColumnDef.hideable: false`; shorthand syntax in filter row (`>100`, `10..20`, `=x`, `!=x`, `^a`, `z$`, `""`, `2026-01..2026-03`, tri-state boolean); `TableApi`: `setColumnFilter`, `setColumnFilters`, `clearColumnFilters`, `getColumnFilter`, `getColumnFilters`, `isColumnFiltered`, `setFilterRowVisible`, `isFilterRowVisible`, `showColumnFilterMenu`, `hideColumnFilterMenu`, `showColumnChooser`, `hideColumnChooser`; event `EventListenerIf.onFilterChanged(GeFilterEvent: filters, property, source, rowCount, unfilteredRowCount)` (wrappers: `filterChanged`); composes with `externalFilterFunction` (AND) and live `appendRows` (input focus/caret/IME preserved); state part `"filters"` (`TableStateIf.filters`, `filterRowVisible`, `autoRestoreOptions.autoRestoreFilterState`); keyboard `FOCUS_COLUMN_FILTER` (Ctrl/⌘+Shift+F), `OPEN_COLUMN_FILTER_MENU` (Alt+ArrowDown); top-layer popups (`popover="manual"` with fullscreen/Shadow DOM fallback), RTL & fixed columns; DOM-free engine `parseFilterInput`, `formatFilterCondition`, `compileSingleColumnFilter`, `compileColumnFilterPredicate`, `inferColumnFilterType`, `collectDistinctValues`; CSS `ge-table-filter-row*`, `ge-table-filter-menu*`, `ge-table-column-chooser*`, `--ge-table-filter-*`. Showcase `columnfilter`, demo `apps/table-demo/column-filter.html`.
|
|
732
741
|
- Live data / log tail (since 1.1.108): tableApi.appendRows(rows, { follow?: "auto" (default: stays at the end if it was at the end, else the first visible row stays) | true (always the end) | false (freeze), maxRows?: ring buffer – oldest rows removed from the start in blocks of ≥ 1 % }) → AppendRowsResultIf { added, shown, removed, following } | false (tree, row groups, pivot, spreadsheet, cell formulas) – AreaModelObjectArray body only, IN PLACE (pushes to your array, no copy), O(k): externalFilterFunction only for the new rows, sorted column / sort(fn) → merged in (binary search, behind equal rows); selection, focus, Shift+arrow anchor and checked rows stay at their rows (RowIndexShift, SelectionModel/FocusModel.adjustForRowChanges – no onSelectionChanged unless a selected row left the buffer); one render pass, none when only rows below the view came in (cells not rebuilt). Held mouse button: "auto" keeps the rows under the pointer and follows again after release. Own AreaModel: append yourself, then tableApi.rowsAppended(count, { follow, removedAtStart }). Not addRows() (copies all rows, resets filter and sort). Showcase logtail, demo apps/table-demo/log-tail.html, LogTailController + createLogTailModelAndOptions in @guiexpert/demo-table-models.
|
|
733
742
|
- Open a cell, tile navigation, focus frame (since 1.1.115): EventListenerIf.onCellActivated(GeCellActivateEvent: areaIdent "body", rowIndex, columnIndex, value, row, source "keyboard" | "mouse" | "api", originalEvent) – Enter on the focused body cell or a double click, in every table, after the built-in jobs (row checkbox, detail row, tree node, editing.enterKey; double click: editor of an editable cell, tree node), not on handles, empty tiles or under a blocking overlay; the Enter key is not consumed; wrappers cellActivated. Cover grid keyboard: AreaModelIf.getTileLayout?(): TileLayoutIf { getTileCount, getTilesPerRow, getTileAt(index), indexOfTile(item) } (CoverGridBodyModel implements it) → the items are one sequence: ←/→ previous/next with wrap (RTL mirrored), ↑/↓ one row (↓ without a tile below: last item), Home/End and Ctrl/⌘+Home/End first/last item, Page Up/Down; empty tiles never focused (keys and mouse); one render per key; the focus follows the item (sort, filter, resize, new items; filtered out → tile at the same index). DOM-free: navigateTiles(index, action, { count, perRow, pageRows, firstVisible }), tileIndexToCell, cellToTileIndex. tableOptions.focusFrame: "always" (default) | "keyboard" (only while the keyboard is used, default of CoverGridFactory.createCoverGridDefaultOptions) | "never"; FocusModel("none") does not hide the frame. CoverGridFactory.createCoverGridDefaultOptions (alias, the old createCoverGrisDefaultOptions is deprecated). Cover grid fixes: at least one column (was 0 → Infinity rows), no empty extra row, sort()/doSort() sort a copy (the app's items array keeps its order).
|