@guiexpert/table 1.1.93 → 1.1.96
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 +25 -0
- package/css/main.css +334 -0
- package/css/table-calc.css +7 -0
- package/css/table-classes.css +34 -0
- package/css/table-color-vars.css +78 -0
- package/css/table-fill-batch.css +58 -0
- package/css/table-pivot.css +42 -0
- package/css/table-row-drag.css +81 -0
- package/css/table-row-group.css +25 -0
- package/css/table-tree.css +9 -0
- package/index.cjs +57 -47
- package/index.d.ts +67 -0
- package/index.js +11290 -4985
- package/lib/table/action/action-id.type.d.ts +1 -1
- package/lib/table/aggregation/aggregate-internals.d.ts +30 -0
- package/lib/table/aggregation/aggregate-spec.if.d.ts +51 -0
- package/lib/table/aggregation/aggregate.d.ts +58 -0
- package/lib/table/aggregation/aggregator-name.type.d.ts +39 -0
- package/lib/table/aggregation/aggregator.if.d.ts +51 -0
- package/lib/table/aggregation/aggregators.d.ts +37 -0
- package/lib/table/aggregation/create-value-getter.d.ts +18 -0
- package/lib/table/aggregation/selection-aggregates.if.d.ts +35 -0
- package/lib/table/aggregation/value-accessor.type.d.ts +13 -0
- package/lib/table/aria/aria-texts.d.ts +11 -0
- package/lib/table/aria/aria-texts.if.d.ts +87 -0
- package/lib/table/batch-edit/batch-edit-options.d.ts +21 -0
- package/lib/table/batch-edit/batch-edit-options.if.d.ts +20 -0
- package/lib/table/batch-edit/batch-edit-service.d.ts +104 -0
- package/lib/table/batch-edit/cell-change.if.d.ts +39 -0
- package/lib/table/batch-edit/cell-value-change.if.d.ts +18 -0
- package/lib/table/batch-edit/pending-cell-changes.d.ts +104 -0
- package/lib/table/calc/column-values.d.ts +55 -0
- package/lib/table/calc/show-values-as-internals.d.ts +4 -0
- package/lib/table/calc/show-values-as.d.ts +87 -0
- package/lib/table/calc/show-values-as.type.d.ts +55 -0
- package/lib/table/calc/value-getter-context.if.d.ts +35 -0
- package/lib/table/calc/value-getter.type.d.ts +36 -0
- package/lib/table/data/common/event/ge-batch-edit-event.d.ts +46 -0
- package/lib/table/data/common/event/ge-model-change-event.d.ts +27 -1
- package/lib/table/data/common/event/ge-row-drag-event.d.ts +89 -0
- package/lib/table/data/common/row-number-column-def.d.ts +107 -0
- package/lib/table/data/common/row-number-columns.d.ts +17 -0
- package/lib/table/data/common/row-number-options.d.ts +19 -0
- package/lib/table/data/common/row-number-options.if.d.ts +44 -0
- package/lib/table/data/options/table-options.d.ts +6 -0
- package/lib/table/data/options/table-options.if.d.ts +44 -0
- package/lib/table/data/tablemodel/areamodel/abstract-area-model.d.ts +66 -0
- package/lib/table/data/tablemodel/areamodel/aggregate-footer-options.if.d.ts +73 -0
- package/lib/table/data/tablemodel/areamodel/area-model-aggregate-footer.d.ts +150 -0
- package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +24 -0
- package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +18 -1
- package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +70 -0
- package/lib/table/data/tablemodel/areamodel/area-model-pivot-footer.d.ts +47 -0
- package/lib/table/data/tablemodel/areamodel/area-model-pivot.d.ts +281 -0
- package/lib/table/data/tablemodel/areamodel/area-model-row-groups.d.ts +336 -0
- package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +97 -0
- package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +94 -0
- package/lib/table/data/tablemodel/areamodel/derived-values-change.if.d.ts +30 -0
- package/lib/table/data/tablemodel/column/column-def.d.ts +31 -1
- package/lib/table/data/tablemodel/column/column-def.if.d.ts +86 -0
- package/lib/table/event-adapter.d.ts +7 -0
- package/lib/table/event-listener.if.d.ts +32 -0
- package/lib/table/factory/pivot-factory.d.ts +63 -0
- package/lib/table/factory/pivot-table-model-para.if.d.ts +44 -0
- package/lib/table/factory/row-group-factory.d.ts +70 -0
- package/lib/table/factory/row-group-table-model-para.if.d.ts +66 -0
- package/lib/table/factory/table-factory.d.ts +56 -1
- package/lib/table/fill/compute-fill-changes.d.ts +67 -0
- package/lib/table/fill/fill-direction.type.d.ts +7 -0
- package/lib/table/fill/fill-handle-options.d.ts +29 -0
- package/lib/table/fill/fill-handle-options.if.d.ts +35 -0
- package/lib/table/fill/fill-handle-service.d.ts +55 -0
- package/lib/table/fill/fill-series.d.ts +60 -0
- package/lib/table/fill/fill-value-context.if.d.ts +36 -0
- package/lib/table/formula/compile-formula.d.ts +86 -0
- package/lib/table/formula/evaluator.d.ts +19 -0
- package/lib/table/formula/formula-ast.if.d.ts +42 -0
- package/lib/table/formula/formula-error.d.ts +59 -0
- package/lib/table/formula/formula-options.if.d.ts +41 -0
- package/lib/table/formula/formula-values.d.ts +13 -0
- package/lib/table/formula/functions.d.ts +18 -0
- package/lib/table/formula/parser.d.ts +10 -0
- package/lib/table/formula/tokenizer.d.ts +22 -0
- package/lib/table/instanceof-workaround.d.ts +143 -6
- package/lib/table/pivot/area-model-pivot-header.d.ts +9 -0
- package/lib/table/pivot/pivot-column-def.d.ts +28 -0
- package/lib/table/pivot/pivot-column-info.if.d.ts +25 -0
- package/lib/table/pivot/pivot-config.if.d.ts +58 -0
- package/lib/table/pivot/pivot-internals.d.ts +13 -0
- package/lib/table/pivot/pivot-layout.d.ts +40 -0
- package/lib/table/pivot/pivot-result.d.ts +157 -0
- package/lib/table/pivot/pivot-table-model.d.ts +86 -0
- package/lib/table/pivot/pivot-value.type.d.ts +80 -0
- package/lib/table/render-scope.d.ts +142 -4
- package/lib/table/renderer/aggregate-cell-renderer.d.ts +27 -0
- package/lib/table/renderer/edit/input-cell-renderer.d.ts +1 -1
- package/lib/table/renderer/edit/select-cell-renderer.d.ts +1 -1
- package/lib/table/renderer/row-number-cell-renderer.d.ts +27 -0
- package/lib/table/row-drag/move-rows.d.ts +157 -0
- package/lib/table/row-drag/row-drag-options.d.ts +28 -0
- package/lib/table/row-drag/row-drag-options.if.d.ts +36 -0
- package/lib/table/row-drag/row-drag-service.d.ts +130 -0
- package/lib/table/row-drag/row-drop-target.if.d.ts +29 -0
- package/lib/table/rowgroup/group-rows-internals.d.ts +14 -0
- package/lib/table/rowgroup/group-rows-options.if.d.ts +13 -0
- package/lib/table/rowgroup/group-rows.d.ts +48 -0
- package/lib/table/rowgroup/row-group-column-def.d.ts +26 -0
- package/lib/table/rowgroup/row-group-column-options.if.d.ts +27 -0
- package/lib/table/rowgroup/row-group-detail-row.d.ts +8 -0
- package/lib/table/rowgroup/row-group-field.type.d.ts +56 -0
- package/lib/table/rowgroup/row-group-internals.d.ts +31 -0
- package/lib/table/rowgroup/row-group-layout.d.ts +13 -0
- package/lib/table/rowgroup/row-group-model-options.if.d.ts +39 -0
- package/lib/table/rowgroup/row-group.d.ts +51 -0
- package/lib/table/rowgroup/row-group.if.d.ts +48 -0
- package/lib/table/selection/selection-aggregator.d.ts +37 -0
- package/lib/table/selection/selection-service.d.ts +7 -0
- package/lib/table/service/convenience-dom.service.d.ts +5 -0
- package/lib/table/service/excel-service.d.ts +6 -0
- package/lib/table/service/excel-service.if.d.ts +35 -0
- package/lib/table/table-api.d.ts +389 -3
- package/lib/table/table-scope.d.ts +140 -0
- package/package.json +3 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { TableScope } from '../table-scope.js';
|
|
2
|
+
import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if.js';
|
|
3
|
+
import { ColumnDefIf } from '../data/tablemodel/column/column-def.if.js';
|
|
4
|
+
import { RowDropTargetIf } from './row-drop-target.if.js';
|
|
5
|
+
import { RowDragOptionsIf } from './row-drag-options.if.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Whether a body cell shows a drag handle: `"none"`, `"enabled"`, or `"disabled"` (managed drag while the table is
|
|
9
|
+
* sorted or filtered).
|
|
10
|
+
*
|
|
11
|
+
* @category Row drag
|
|
12
|
+
* @since 1.1.95
|
|
13
|
+
*/
|
|
14
|
+
export type RowDragHandleState = "none" | "enabled" | "disabled";
|
|
15
|
+
/**
|
|
16
|
+
* Row drag of one table (`tableScope.rowDragService`): drag handles ({@link ColumnDefIf.rowDrag}), pointer drag with
|
|
17
|
+
* ghost, drop marker and auto-scroll, the keyboard alternative (`MOVE_ROW_UP` / `MOVE_ROW_DOWN`) and the managed move.
|
|
18
|
+
* Use {@link TableApi.moveRows}, {@link TableApi.isRowDragging} and {@link TableApi.cancelRowDrag} instead.
|
|
19
|
+
*
|
|
20
|
+
* Pointer Events (mouse, touch, pen) – only on the drag handle; its `pointerdown` is prevented, so the mouse handler
|
|
21
|
+
* of the table (range selection, column drag) never sees it.
|
|
22
|
+
*
|
|
23
|
+
* @category Internals
|
|
24
|
+
* @since 1.1.95
|
|
25
|
+
*/
|
|
26
|
+
export declare class RowDragService {
|
|
27
|
+
private readonly tableScope;
|
|
28
|
+
private pending?;
|
|
29
|
+
private session?;
|
|
30
|
+
private sessionAbortController?;
|
|
31
|
+
private ghost?;
|
|
32
|
+
private indicator?;
|
|
33
|
+
private autoScrollFrame;
|
|
34
|
+
private suppressClick;
|
|
35
|
+
private warnedUnsupported;
|
|
36
|
+
constructor(tableScope: TableScope);
|
|
37
|
+
/** The options of this table ({@link TableOptionsIf.rowDragOptions} + defaults). */
|
|
38
|
+
get options(): RowDragOptionsIf;
|
|
39
|
+
/** true while rows are dragged with the pointer. */
|
|
40
|
+
isDragging(): boolean;
|
|
41
|
+
/** true if the row is one of the dragged rows (it is painted dimmed). */
|
|
42
|
+
isDragSourceRow(rowIndex: number): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Why a managed drag is not possible right now: `"sorted"` (a column has the sort state asc/desc), `"filtered"`
|
|
45
|
+
* (a filter hides rows) – `undefined` if it is possible or the drag is unmanaged.
|
|
46
|
+
*/
|
|
47
|
+
getBlockReason(): "sorted" | "filtered" | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The drag handle of a body cell: none (no `rowDrag`, a group or pivot row, a managed drag the model cannot do),
|
|
50
|
+
* enabled or disabled (managed + sorted/filtered).
|
|
51
|
+
*/
|
|
52
|
+
getHandleState(rowIndex: number, columnDef: ColumnDefIf | undefined, areaModel: AreaModelIf): RowDragHandleState;
|
|
53
|
+
/**
|
|
54
|
+
* Adds the drag handle to a rendered body cell (called by the render pass for columns with `rowDrag`).
|
|
55
|
+
*
|
|
56
|
+
* @param {HTMLDivElement} cell - the cell div
|
|
57
|
+
* @param {RowDragHandleState} state - from {@link getHandleState}
|
|
58
|
+
*/
|
|
59
|
+
decorateCell(cell: HTMLDivElement, state: RowDragHandleState): void;
|
|
60
|
+
private onPointerDown;
|
|
61
|
+
private listenToDocument;
|
|
62
|
+
private onPointerMove;
|
|
63
|
+
private onPointerUp;
|
|
64
|
+
private onPointerCancel;
|
|
65
|
+
private onKeyDown;
|
|
66
|
+
private onClickCapture;
|
|
67
|
+
/** Starts the drag after the threshold – false if the listener vetoed it. */
|
|
68
|
+
private startPointerDrag;
|
|
69
|
+
/** Computes the drop target from the pointer position, reports a change, moves ghost and marker, auto-scrolls. */
|
|
70
|
+
private updateTarget;
|
|
71
|
+
private autoScrollStep;
|
|
72
|
+
/**
|
|
73
|
+
* Speed in px per frame (negative = up): a quadratic ramp inside the zone at the top/bottom edge of the body, full
|
|
74
|
+
* speed above (header) and below (footer) the body.
|
|
75
|
+
*/
|
|
76
|
+
private calcAutoScrollSpeed;
|
|
77
|
+
/** The row under the pointer and the position (before/after/inside) – computed, not read from the DOM. */
|
|
78
|
+
private computeTarget;
|
|
79
|
+
private isValidTarget;
|
|
80
|
+
private drop;
|
|
81
|
+
/**
|
|
82
|
+
* Cancels a running drag (Escape, `pointercancel`, {@link TableApi.cancelRowDrag}, destroy): `onRowDragEnd` with the
|
|
83
|
+
* type `"cancel"`, nothing is moved.
|
|
84
|
+
*/
|
|
85
|
+
cancel(originalEvent?: PointerEvent | KeyboardEvent): void;
|
|
86
|
+
/** Ends the pointer session: listeners, ghost, marker, auto-scroll. */
|
|
87
|
+
private stopListening;
|
|
88
|
+
/** Releases everything (TableScope.destroy). A running drag is cancelled. */
|
|
89
|
+
destroy(): void;
|
|
90
|
+
private createDragElements;
|
|
91
|
+
private getGhostText;
|
|
92
|
+
private renderDragElements;
|
|
93
|
+
/** The rows' width (fixed columns + center columns), at most the visible width – the marker ends with the rows. */
|
|
94
|
+
private getMarkerWidth;
|
|
95
|
+
/**
|
|
96
|
+
* Moves rows in the model (managed), repaints, keeps focus and selection on the moved rows and announces the new
|
|
97
|
+
* position.
|
|
98
|
+
*
|
|
99
|
+
* @param {number[]} rowIndices - display indices
|
|
100
|
+
* @param {RowDropTargetIf} target - drop target
|
|
101
|
+
* @param {boolean} reselect - select the moved rows again (multi-row drag)
|
|
102
|
+
* @returns {number} the new display index of the first moved row, -1 if nothing moved
|
|
103
|
+
*/
|
|
104
|
+
moveRows(rowIndices: number[], target: RowDropTargetIf, reselect?: boolean): number;
|
|
105
|
+
private findDisplayIndices;
|
|
106
|
+
/**
|
|
107
|
+
* `MOVE_ROW_UP` / `MOVE_ROW_DOWN`: moves the focused row (or the selected rows, if it is one of them) one position.
|
|
108
|
+
* Trees: among the siblings.
|
|
109
|
+
*
|
|
110
|
+
* @param {-1 | 1} direction - up or down
|
|
111
|
+
* @returns {boolean} true if the key was used (a row with a drag handle has the focus)
|
|
112
|
+
*/
|
|
113
|
+
moveByKeyboard(direction: -1 | 1): boolean;
|
|
114
|
+
private getFlatKeyboardTarget;
|
|
115
|
+
private getTreeKeyboardTarget;
|
|
116
|
+
/** The dragged rows for a grabbed row: all rows with a selection if it is one of them (multiRow), else this one. */
|
|
117
|
+
getDragRowIndices(rowIndex: number): number[];
|
|
118
|
+
private getRows;
|
|
119
|
+
/** Index of the first column whose drag handle is shown for the row, -1 if none. */
|
|
120
|
+
private getHandleColumnIndex;
|
|
121
|
+
/** The state of the handle of a row that has one (see {@link getHandleColumnIndex}). */
|
|
122
|
+
private getHandleStateOfRow;
|
|
123
|
+
/** true if a column has the sort state asc or desc (the header shows the arrow). */
|
|
124
|
+
private isSorted;
|
|
125
|
+
private isManaged;
|
|
126
|
+
private canModelMove;
|
|
127
|
+
private createEvent;
|
|
128
|
+
private announceNotPossible;
|
|
129
|
+
private texts;
|
|
130
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where dragged rows are dropped, relative to the row under the drop marker:
|
|
3
|
+
* `"before"` / `"after"` that row, or `"inside"` it (it becomes the last child – trees only).
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const target: RowDropTargetIf = { rowIndex: 7, position: "before" }; // between row 7 and row 8 (1-based)
|
|
7
|
+
*
|
|
8
|
+
* @category Row drag
|
|
9
|
+
* @since 1.1.95
|
|
10
|
+
*/
|
|
11
|
+
export type RowDropPosition = "before" | "after" | "inside";
|
|
12
|
+
/**
|
|
13
|
+
* The drop target of a row drag ({@link GeRowDragEvent.target}, {@link TableApi.moveRows}).
|
|
14
|
+
*
|
|
15
|
+
* `rowIndex` is the display index (body row index) of the target row **before** the rows are moved.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // move the rows 2 and 3 behind the last row
|
|
19
|
+
* tableApi.moveRows([2, 3], { rowIndex: tableApi.getDisplayedRowCount() - 1, position: "after" });
|
|
20
|
+
*
|
|
21
|
+
* @category Row drag
|
|
22
|
+
* @since 1.1.95
|
|
23
|
+
*/
|
|
24
|
+
export interface RowDropTargetIf {
|
|
25
|
+
/** Display index of the row next to (or under) the drop marker – before the move. */
|
|
26
|
+
rowIndex: number;
|
|
27
|
+
/** Before or after that row, or inside it (tree: becomes its last child). */
|
|
28
|
+
position: RowDropPosition;
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RowGroup } from './row-group.js';
|
|
2
|
+
import { ResolvedRowGroupField } from './row-group-internals.js';
|
|
3
|
+
import { ResolvedAggregateSpec } from '../aggregation/aggregate-internals.js';
|
|
4
|
+
|
|
5
|
+
/** {@link groupRows} with resolved levels. @internal */
|
|
6
|
+
export declare function groupRowsResolved<T>(rows: ArrayLike<T>, fields: ResolvedRowGroupField<T>[], emptyLabel: string): RowGroup<T>[];
|
|
7
|
+
/** {@link aggregateRowGroups} with resolved specs. @internal */
|
|
8
|
+
export declare function aggregateRowGroupsResolved<T>(groups: RowGroup<T>[], specs: ResolvedAggregateSpec<T>[], accept?: (sourceIndex: number) => boolean): Record<string, unknown>;
|
|
9
|
+
/** The totals: the merged states of the given groups. @internal */
|
|
10
|
+
export declare function totalsOf<T>(groups: RowGroup<T>[], specs: ResolvedAggregateSpec<T>[]): Record<string, unknown>;
|
|
11
|
+
/** Aggregates the rows of a group of the last level. @internal */
|
|
12
|
+
export declare function computeLeaf<T>(group: RowGroup<T>, specs: ResolvedAggregateSpec<T>[], accept?: (i: number) => boolean): void;
|
|
13
|
+
/** A group above the last level: merges the states of its sub-groups (they stay unchanged). @internal */
|
|
14
|
+
export declare function mergeChildren<T>(group: RowGroup<T>, specs: ResolvedAggregateSpec<T>[]): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options of {@link groupRows}.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* const groups = groupRows(orders, ["country"], { emptyLabel: "(no country)" });
|
|
6
|
+
*
|
|
7
|
+
* @since 1.1.94
|
|
8
|
+
* @category Row grouping
|
|
9
|
+
*/
|
|
10
|
+
export interface GroupRowsOptionsIf {
|
|
11
|
+
/** The label of the group of empty keys (`null`, `undefined`, `""`). Default `"(empty)"`. */
|
|
12
|
+
emptyLabel?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RowGroupField } from './row-group-field.type.js';
|
|
2
|
+
import { GroupRowsOptionsIf } from './group-rows-options.if.js';
|
|
3
|
+
import { AggregateSpecMap } from '../aggregation/aggregate-spec.if.js';
|
|
4
|
+
import { RowGroup } from './row-group.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Groups rows by one or more levels – the engine behind {@link AreaModelRowGroups} (and pivot tables). One pass over
|
|
8
|
+
* the rows with nested `Map`s: keys are compared as values (`1` and `"1"` are different groups, two dates of the same
|
|
9
|
+
* time one group); `null`, `undefined` and `""` form one group (label `"(empty)"`), which is always last. Groups are
|
|
10
|
+
* ordered by the `order` of their level (default ascending); the rows of a group stay in source order. The rows are
|
|
11
|
+
* not changed.
|
|
12
|
+
*
|
|
13
|
+
* Aggregates are filled by {@link aggregateRowGroups}.
|
|
14
|
+
*
|
|
15
|
+
* @param {ArrayLike<T>} rows - the rows
|
|
16
|
+
* @param {RowGroupField<T>[]} groupBy - the levels, top first: property paths, functions or {@link RowGroupFieldIf}
|
|
17
|
+
* @param {GroupRowsOptionsIf} [options] - e.g. the label of empty keys
|
|
18
|
+
* @returns {RowGroup<T>[]} the groups of the top level (empty for no levels or no rows)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const groups = groupRows(sales, ["region", "produkt"]);
|
|
22
|
+
* groups[0].label; // "Nord"
|
|
23
|
+
* groups[0].children[0].getRows(); // the rows of Nord › A
|
|
24
|
+
*
|
|
25
|
+
* @since 1.1.94
|
|
26
|
+
* @category Row grouping
|
|
27
|
+
*/
|
|
28
|
+
export declare function groupRows<T = any>(rows: ArrayLike<T>, groupBy: RowGroupField<T>[], options?: GroupRowsOptionsIf): RowGroup<T>[];
|
|
29
|
+
/**
|
|
30
|
+
* Computes the aggregates of all groups ({@link RowGroupIf.results}) and their row counts ({@link RowGroupIf.count}).
|
|
31
|
+
* A group of the last level aggregates its rows; every group above **merges** the states of its sub-groups – an
|
|
32
|
+
* average stays the average of all rows (sum and count are merged), never the average of averages.
|
|
33
|
+
*
|
|
34
|
+
* @param {RowGroup<T>[]} groups - the top-level groups of {@link groupRows}
|
|
35
|
+
* @param {AggregateSpecMap<T>} aggregations - key → aggregator (`{ umsatz: "sum" }`, see {@link AggregateSpecMap})
|
|
36
|
+
* @param {(sourceIndex: number) => boolean} [accept] - a filter: only rows it accepts count (index into the source rows)
|
|
37
|
+
* @returns {Record<string, unknown>} the totals over all groups
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const groups = groupRows(sales, ["region", "produkt"]);
|
|
41
|
+
* const totals = aggregateRowGroups(groups, { umsatz: "avg" });
|
|
42
|
+
* groups[0].results.umsatz; // 90 – Nord: (100 + 50 + 120) / 3, not the mean of A (110) and B (50)
|
|
43
|
+
* totals.umsatz; // 75
|
|
44
|
+
*
|
|
45
|
+
* @since 1.1.94
|
|
46
|
+
* @category Row grouping
|
|
47
|
+
*/
|
|
48
|
+
export declare function aggregateRowGroups<T = any>(groups: RowGroup<T>[], aggregations: AggregateSpecMap<T>, accept?: (sourceIndex: number) => boolean): Record<string, unknown>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ColumnDef } from '../data/tablemodel/column/column-def.js';
|
|
2
|
+
import { RowGroupColumnOptionsIf } from './row-group-column-options.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The group column of a row grouping: arrows, indentation and the group labels (`"Nord (3)"`). Created by
|
|
6
|
+
* {@link RowGroupFactory.createTableModel}; the column is sortable (by group key) and not editable. Its property is
|
|
7
|
+
* {@link RowGroupColumnDef.PROPERTY} – sort and state refer to it like to any column.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const tableModel = RowGroupFactory.createTableModel<Sale>({ rows: sales, columnDefs, groupBy: ["region"] });
|
|
11
|
+
* const groupColumn = tableModel.getColumnDefs()?.find(isRowGroupColumnDef);
|
|
12
|
+
*
|
|
13
|
+
* @since 1.1.94
|
|
14
|
+
* @category Row grouping
|
|
15
|
+
*/
|
|
16
|
+
export declare class RowGroupColumnDef extends ColumnDef {
|
|
17
|
+
/** The property of the group column. */
|
|
18
|
+
static readonly PROPERTY = "RowGroupColumn";
|
|
19
|
+
/** Marker for {@link isRowGroupColumnDef} (works across copies of the core). */
|
|
20
|
+
readonly type = "RowGroupColumnDef";
|
|
21
|
+
/** The options with defaults. */
|
|
22
|
+
readonly options: RowGroupColumnOptionsIf;
|
|
23
|
+
/** True if the header follows the grouping (no own `headerLabel`). */
|
|
24
|
+
readonly autoHeaderLabel: boolean;
|
|
25
|
+
constructor(options?: Partial<RowGroupColumnOptionsIf>);
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SizeIf } from '../data/common/size.if.js';
|
|
2
|
+
import { RowGroupIf } from './row-group.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Options of the group column ({@link RowGroupColumnDef}) – the column with the arrows and the group labels.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* RowGroupFactory.createTableModel<Sale>({
|
|
9
|
+
* rows: sales, columnDefs, groupBy: ["region"],
|
|
10
|
+
* groupColumn: { headerLabel: "Region", width: px160, label: g => `${g.label} – ${g.count} sales` }
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
* @since 1.1.94
|
|
14
|
+
* @category Row grouping
|
|
15
|
+
*/
|
|
16
|
+
export interface RowGroupColumnOptionsIf<T = any> {
|
|
17
|
+
/** The header text. Default: the names of the levels, e.g. `"Region › Produkt"` (follows {@link TableApi.setRowGroupBy}). */
|
|
18
|
+
headerLabel?: string;
|
|
19
|
+
/** The width. Default 220 px. */
|
|
20
|
+
width: SizeIf;
|
|
21
|
+
/** Show the number of rows behind the key: `"Nord (3)"`. Default true. */
|
|
22
|
+
showCount: boolean;
|
|
23
|
+
/** An own label of a group row (text, never HTML). Default: `"<key> (<count>)"`. */
|
|
24
|
+
label?: (group: RowGroupIf<T>) => string;
|
|
25
|
+
/** Fix the column on the left (it comes behind row numbers and the checkbox column). Default true. */
|
|
26
|
+
fixed: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TreeRow } from '../data/common/tree-row.js';
|
|
2
|
+
import { TreeRowIf } from '../data/common/tree-row-if.js';
|
|
3
|
+
|
|
4
|
+
/** A detail row: a tree row with the index of its object in the source rows. */
|
|
5
|
+
export declare class RowGroupDetailRow<T> extends TreeRow<T> {
|
|
6
|
+
readonly sourceIndex: number;
|
|
7
|
+
constructor(data: T, parent: TreeRowIf<any> | undefined, deep: number, sourceIndex: number);
|
|
8
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ValueAccessor } from '../aggregation/value-accessor.type.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The order of the groups of one level: ascending (`"asc"`, the default), descending, in the order the keys first
|
|
5
|
+
* appear in the rows (`"insertion"`), or an own comparison of two keys. Empty keys (`null`, `undefined`, `""`) are
|
|
6
|
+
* always last.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const months: RowGroupOrder = (a, b) => MONTHS.indexOf(a as string) - MONTHS.indexOf(b as string);
|
|
10
|
+
*
|
|
11
|
+
* @since 1.1.94
|
|
12
|
+
* @category Row grouping
|
|
13
|
+
*/
|
|
14
|
+
export type RowGroupOrder = "asc" | "desc" | "insertion" | ((a: unknown, b: unknown) => number);
|
|
15
|
+
/**
|
|
16
|
+
* One level of a row grouping in full form: where the key of a row comes from and how the groups of the level are
|
|
17
|
+
* named and ordered. The short form is just the {@link ValueAccessor} (`"region"` or a function).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // year › month from a date, newest year first, month names as labels
|
|
21
|
+
* const groupBy: RowGroupField<Order>[] = [
|
|
22
|
+
* { name: "year", label: "Year", value: o => new Date(o.date).getFullYear(), order: "desc" },
|
|
23
|
+
* { name: "month", label: "Month", value: o => new Date(o.date).getMonth(), format: m => MONTHS[m as number] }
|
|
24
|
+
* ];
|
|
25
|
+
*
|
|
26
|
+
* @typeParam T - the row type
|
|
27
|
+
* @since 1.1.94
|
|
28
|
+
* @category Row grouping
|
|
29
|
+
*/
|
|
30
|
+
export interface RowGroupFieldIf<T = any> {
|
|
31
|
+
/** The key of a row: a property path (`"region"`, `"address.city"`) or a function (computed keys). */
|
|
32
|
+
value: ValueAccessor<T>;
|
|
33
|
+
/**
|
|
34
|
+
* The id of the level – part of the group ids that remember expanded groups ({@link RowGroupIf.id}).
|
|
35
|
+
* Default: the property path; for a function `"level<N>"` (give functions a name if you switch between them).
|
|
36
|
+
*/
|
|
37
|
+
name?: string;
|
|
38
|
+
/** The name of the level, e.g. in the header of the group column. Default: the header label of the column with this property, otherwise the name. */
|
|
39
|
+
label?: string;
|
|
40
|
+
/** The text of a key in the group label. Default: the key as text, dates as date (en-US), empty keys `emptyLabel`. Text only – never HTML. */
|
|
41
|
+
format?: (key: unknown) => string;
|
|
42
|
+
/** The order of the groups of this level. Default `"asc"`. */
|
|
43
|
+
order?: RowGroupOrder;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One level of a row grouping: a property path (`"region"`), a function (`o => o.date.getFullYear()`) or the full form
|
|
47
|
+
* {@link RowGroupFieldIf}.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const groupBy: RowGroupField<Sale>[] = ["region", s => s.produkt.toUpperCase()];
|
|
51
|
+
*
|
|
52
|
+
* @typeParam T - the row type
|
|
53
|
+
* @since 1.1.94
|
|
54
|
+
* @category Row grouping
|
|
55
|
+
*/
|
|
56
|
+
export type RowGroupField<T = any> = ValueAccessor<T> | RowGroupFieldIf<T>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RowGroupField } from './row-group-field.type.js';
|
|
2
|
+
|
|
3
|
+
/** A level of a grouping, resolved for a pass over the rows. */
|
|
4
|
+
export interface ResolvedRowGroupField<T = any> {
|
|
5
|
+
name: string;
|
|
6
|
+
/** the given label (undefined: the factory takes the column header) */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** the property path, undefined for a function */
|
|
9
|
+
path?: string;
|
|
10
|
+
getKey: (row: T) => unknown;
|
|
11
|
+
format?: (key: unknown) => string;
|
|
12
|
+
/** the order of the groups (empty keys last) */
|
|
13
|
+
compare: (a: unknown, b: unknown) => number;
|
|
14
|
+
}
|
|
15
|
+
/** The key of the group of empty keys (`null`, `undefined`, `""`). */
|
|
16
|
+
export declare const EMPTY_GROUP_KEY: null;
|
|
17
|
+
/** `null`, `undefined` and `""` form one group. */
|
|
18
|
+
export declare function isEmptyGroupKey(key: unknown): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The natural order of two non-empty group keys: numbers, dates (by time), booleans (false first), text (natural,
|
|
21
|
+
* "A2" before "A10"); keys of different types by type in this order.
|
|
22
|
+
*/
|
|
23
|
+
export declare function compareGroupKeys(a: unknown, b: unknown): number;
|
|
24
|
+
export declare function resolveRowGroupField<T>(field: RowGroupField<T>, level: number): ResolvedRowGroupField<T>;
|
|
25
|
+
export declare function resolveRowGroupFields<T>(groupBy: RowGroupField<T>[] | undefined): ResolvedRowGroupField<T>[];
|
|
26
|
+
/** The key as text with its type – part of the group id (`1` and `"1"` differ, dates by time). */
|
|
27
|
+
export declare function typedGroupKey(key: unknown): string;
|
|
28
|
+
/** The default text of a group key. */
|
|
29
|
+
export declare function defaultGroupKeyLabel(key: unknown, emptyLabel: string): string;
|
|
30
|
+
/** The level labels of a grouping, e.g. for the header of the group column. */
|
|
31
|
+
export declare function rowGroupLevelLabels<T>(fields: ResolvedRowGroupField<T>[], headerOf: (path: string) => string | undefined): string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if.js';
|
|
2
|
+
import { ColumnDefIf } from '../data/tablemodel/column/column-def.if.js';
|
|
3
|
+
import { RowGroupField } from './row-group-field.type.js';
|
|
4
|
+
|
|
5
|
+
/** The header text of the group column for these levels, e.g. "Region › Produkt". */
|
|
6
|
+
export declare function rowGroupHeaderLabel(groupBy: RowGroupField[], columnDefs: ColumnDefIf[]): string;
|
|
7
|
+
/**
|
|
8
|
+
* Adapts the columns of a row grouping to its current levels: hides the columns of the grouped properties (and shows
|
|
9
|
+
* the ones it hid before that are no longer grouped) and sets the header of the group column.
|
|
10
|
+
*
|
|
11
|
+
* @returns true if the body is a row grouping
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateRowGroupLayout(tableModel: TableModelIf): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RowGroupField } from './row-group-field.type.js';
|
|
2
|
+
import { AggregateSpecMap } from '../aggregation/aggregate-spec.if.js';
|
|
3
|
+
import { RowGroupIf } from './row-group.if.js';
|
|
4
|
+
import { RowGroupColumnOptionsIf } from './row-group-column-options.if.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which groups are expanded: all (`true`), none (`false`), the levels above a number (`1` = the top level is open, its
|
|
8
|
+
* sub-groups are closed; `0` = all closed), or a function per group.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const onlyNorth: RowGroupExpanded<Sale> = group => group.path[0] === "Nord";
|
|
12
|
+
*
|
|
13
|
+
* @since 1.1.94
|
|
14
|
+
* @category Row grouping
|
|
15
|
+
*/
|
|
16
|
+
export type RowGroupExpanded<T = any> = boolean | number | ((group: RowGroupIf<T>) => boolean);
|
|
17
|
+
/**
|
|
18
|
+
* Options of an {@link AreaModelRowGroups} (the factory {@link RowGroupFactory.createTableModel} fills them).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const body = new AreaModelRowGroups<Sale>(sales, columnDefs, { groupBy: ["region"], aggregations: { umsatz: "sum" } });
|
|
22
|
+
*
|
|
23
|
+
* @since 1.1.94
|
|
24
|
+
* @category Row grouping
|
|
25
|
+
*/
|
|
26
|
+
export interface RowGroupModelOptionsIf<T = any> {
|
|
27
|
+
/** The levels, top first. An empty list shows the rows without groups. */
|
|
28
|
+
groupBy: RowGroupField<T>[];
|
|
29
|
+
/** The aggregates of the group rows; the key is the property of the column that shows it (`{ umsatz: "sum" }`). */
|
|
30
|
+
aggregations?: AggregateSpecMap<T>;
|
|
31
|
+
/** Which groups are expanded at the start and in new paths after regrouping. Default true. */
|
|
32
|
+
expanded?: RowGroupExpanded<T>;
|
|
33
|
+
/** The label of the group of empty keys (`null`, `undefined`, `""`). Default `"(empty)"`. */
|
|
34
|
+
emptyLabel?: string;
|
|
35
|
+
/** Label options of the group column (`showCount`, `label`). */
|
|
36
|
+
groupColumn?: Partial<RowGroupColumnOptionsIf<T>>;
|
|
37
|
+
/** Hide the columns of the grouped properties (their values are in the group column). Default true. */
|
|
38
|
+
hideGroupedColumns?: boolean;
|
|
39
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RowGroupIf } from './row-group.if.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A group of a row grouping (see {@link RowGroupIf}). Created by {@link groupRows} and {@link AreaModelRowGroups} –
|
|
5
|
+
* you don't create groups yourself.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const groups = groupRows(sales, ["region"]);
|
|
9
|
+
* aggregateRowGroups(groups, { umsatz: "sum" });
|
|
10
|
+
* groups.map(g => `${g.label}: ${g.results.umsatz}`); // ["Nord: 270", "Süd: 180"]
|
|
11
|
+
*
|
|
12
|
+
* @typeParam T - the row type
|
|
13
|
+
* @since 1.1.94
|
|
14
|
+
* @category Row grouping
|
|
15
|
+
*/
|
|
16
|
+
export declare class RowGroup<T = any> implements RowGroupIf<T> {
|
|
17
|
+
readonly key: unknown;
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly level: number;
|
|
20
|
+
readonly field: string;
|
|
21
|
+
readonly path: readonly unknown[];
|
|
22
|
+
readonly parent: RowGroup<T> | undefined;
|
|
23
|
+
/** @internal the source rows */
|
|
24
|
+
readonly source: ArrayLike<T>;
|
|
25
|
+
/** Marker for {@link isRowGroup}. */
|
|
26
|
+
readonly type = "RowGroup";
|
|
27
|
+
readonly children: RowGroup<T>[];
|
|
28
|
+
count: number;
|
|
29
|
+
results: Record<string, unknown>;
|
|
30
|
+
/** @internal indices into the source rows (last level only), in source order */
|
|
31
|
+
readonly sourceIndices: number[];
|
|
32
|
+
/** @internal aggregation states (one per spec), kept for merging and partial updates */
|
|
33
|
+
states: unknown[];
|
|
34
|
+
/** @internal the filter of the last aggregation (source index → kept) */
|
|
35
|
+
accept?: (sourceIndex: number) => boolean;
|
|
36
|
+
/** @internal parts of the id: level name + typed key per level */
|
|
37
|
+
readonly idParts: [string, string][];
|
|
38
|
+
constructor(key: unknown, label: string, level: number, field: string, path: readonly unknown[], parent: RowGroup<T> | undefined,
|
|
39
|
+
/** @internal the source rows */
|
|
40
|
+
source: ArrayLike<T>, typedKey: string);
|
|
41
|
+
/** A stable id from level names and keys, e.g. `rowgroup:[["region","s:Nord"]]`. */
|
|
42
|
+
get id(): string;
|
|
43
|
+
/** True for a group of the last level (it holds rows, no sub-groups). */
|
|
44
|
+
isLeaf(): boolean;
|
|
45
|
+
getRows(filtered?: boolean): T[];
|
|
46
|
+
/**
|
|
47
|
+
* The source indices of all rows of the group (and its sub-groups), group by group.
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
collectIndices(filtered: boolean, ret: number[]): number[];
|
|
51
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A group of a row grouping – the `data` of a group row in an {@link AreaModelRowGroups} and the result of
|
|
3
|
+
* {@link groupRows}. Groups of the last level hold the rows; groups above hold sub-groups.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // the group of a clicked row
|
|
7
|
+
* const group = model.getRowGroup(rowIndex);
|
|
8
|
+
* if (group) console.log(group.path, group.count, group.results.umsatz); // ["Nord", "A"], 2, 220
|
|
9
|
+
*
|
|
10
|
+
* @typeParam T - the row type
|
|
11
|
+
* @since 1.1.94
|
|
12
|
+
* @category Row grouping
|
|
13
|
+
*/
|
|
14
|
+
export interface RowGroupIf<T = any> {
|
|
15
|
+
/** Marker for {@link isRowGroup} (works across copies of the core). */
|
|
16
|
+
readonly type: "RowGroup";
|
|
17
|
+
/** The key of the group, as the rows have it (`null` for the group of empty keys: `null`, `undefined`, `""`). */
|
|
18
|
+
readonly key: unknown;
|
|
19
|
+
/** The key as text (`format` of the level, otherwise the default text). */
|
|
20
|
+
readonly label: string;
|
|
21
|
+
/** The level, 0 = top. */
|
|
22
|
+
readonly level: number;
|
|
23
|
+
/** The name of the level ({@link RowGroupFieldIf.name}). */
|
|
24
|
+
readonly field: string;
|
|
25
|
+
/** The keys from the top level down to this group. */
|
|
26
|
+
readonly path: readonly unknown[];
|
|
27
|
+
/**
|
|
28
|
+
* A stable id built from the level names and keys – the same data give the same id (persistence of expanded groups).
|
|
29
|
+
* Keys that are objects or symbols get an id per page load only (they can't be stored).
|
|
30
|
+
*/
|
|
31
|
+
readonly id: string;
|
|
32
|
+
/** The parent group, undefined on the top level. */
|
|
33
|
+
readonly parent: RowGroupIf<T> | undefined;
|
|
34
|
+
/** The sub-groups, empty on the last level. */
|
|
35
|
+
readonly children: RowGroupIf<T>[];
|
|
36
|
+
/** The number of rows in the group (after the filter). */
|
|
37
|
+
readonly count: number;
|
|
38
|
+
/** The aggregates of the group by key (after the filter), e.g. `{ umsatz: 270 }`. */
|
|
39
|
+
readonly results: Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* The rows of the group and of all sub-groups, in the order of the grouped view: sub-group by sub-group, the rows of a
|
|
42
|
+
* group in source order – or sorted, after the table sorted them.
|
|
43
|
+
*
|
|
44
|
+
* @param {boolean} [filtered=true] - only the rows the filter keeps
|
|
45
|
+
* @returns {T[]} a new array
|
|
46
|
+
*/
|
|
47
|
+
getRows(filtered?: boolean): T[];
|
|
48
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if.js';
|
|
2
|
+
import { SelectionModelIf } from './selection-model.if.js';
|
|
3
|
+
import { SelectionAggregatesIf } from '../aggregation/selection-aggregates.if.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Computes count, sum, average, minimum and maximum of the selected body cells ({@link SelectionAggregatesIf}) – what
|
|
7
|
+
* {@link TableApi.getSelectionAggregates} returns, e.g. for a status bar under the table.
|
|
8
|
+
*
|
|
9
|
+
* Counted are the selected cells of the visible data columns (no row numbers, no checkbox column); the numbers are the
|
|
10
|
+
* cell values (`getValueAt`) of type `number`. Negative ranges (Ctrl/⌘-click) are respected. A selection whose ranges
|
|
11
|
+
* cover more than {@link maxCells} cells is not computed (`capped: true`).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* SelectionAggregator.maxCells = 5_000_000; // allow bigger selections
|
|
15
|
+
* const a = new SelectionAggregator().aggregate(tableModel, selectionModel);
|
|
16
|
+
*
|
|
17
|
+
* @since 1.1.94
|
|
18
|
+
* @category Aggregation
|
|
19
|
+
*/
|
|
20
|
+
export declare class SelectionAggregator {
|
|
21
|
+
/**
|
|
22
|
+
* Upper limit for the cells of the selected ranges (Ctrl+A on millions of rows). Like
|
|
23
|
+
* {@link CopyService.maxCopyCells}: above it nothing is computed.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* SelectionAggregator.maxCells = 2_000_000;
|
|
27
|
+
*/
|
|
28
|
+
static maxCells: number;
|
|
29
|
+
/**
|
|
30
|
+
* @param {TableModelIf} tableModel - the table model (body rows, columns, visibility)
|
|
31
|
+
* @param {SelectionModelIf | undefined} selectionModel - the selection; none → all zero
|
|
32
|
+
* @returns {SelectionAggregatesIf} the aggregates of the selected cells
|
|
33
|
+
*/
|
|
34
|
+
aggregate(tableModel: TableModelIf, selectionModel: SelectionModelIf | undefined): SelectionAggregatesIf;
|
|
35
|
+
/** The visible data columns between c1 and c2 (no hidden, row number or checkbox columns). */
|
|
36
|
+
private dataColumns;
|
|
37
|
+
}
|
|
@@ -51,6 +51,13 @@ export declare class SelectionService implements OnActionTriggeredIf {
|
|
|
51
51
|
*/
|
|
52
52
|
onMouseClicked(evt: GeMouseEvent, _previousEvt: GeMouseEvent | undefined): boolean;
|
|
53
53
|
onActionTriggered(actionId: ActionId): boolean;
|
|
54
|
+
/** True if the column is a row number column ({@link RowNumberColumnDef}). */
|
|
55
|
+
private isRowNumberColumn;
|
|
56
|
+
/** A click on the header cell of the row numbers: everything (selection types "row" and "range"). */
|
|
57
|
+
private selectAllByRowNumberHeader;
|
|
58
|
+
/** Selection type "range", click on a row number: the whole row – new, toggled (Ctrl/⌘) or removed (Ctrl/⌘+Alt). */
|
|
59
|
+
private clickRowNumber;
|
|
60
|
+
private static isRangeSelection;
|
|
54
61
|
/** Speaks a message for screen readers – only if the selection model can select anything. */
|
|
55
62
|
private announce;
|
|
56
63
|
/** Runs `fn` so that all selection changes in it reach the table's listener as ONE onSelectionChanged event. */
|
|
@@ -26,6 +26,11 @@ export interface AddColumnDivPara {
|
|
|
26
26
|
sortState?: SortState;
|
|
27
27
|
/** Accessible name of the row checkbox (`showCheckboxWihoutExtraColumn`), e.g. "Select row 5". @since 1.1.91 */
|
|
28
28
|
checkboxAriaLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Index of the first data column – the column of the checkbox of `showCheckboxWihoutExtraColumn` and of the tree
|
|
31
|
+
* label. 0, behind a {@link RowNumberColumnDef} 1. Default 0. @since 1.1.93
|
|
32
|
+
*/
|
|
33
|
+
firstDataColumnIndex?: number;
|
|
29
34
|
}
|
|
30
35
|
/** @category DOM */
|
|
31
36
|
export declare class ConvenienceDomService {
|
|
@@ -24,6 +24,8 @@ import { ExcelServiceIf } from './excel-service.if.js';
|
|
|
24
24
|
* @category Export & clipboard
|
|
25
25
|
*/
|
|
26
26
|
export declare class ExcelService implements ExcelServiceIf {
|
|
27
|
+
/** Understands cells `{ value, numberFormat }` ({@link ExcelFormattedValueIf}), since 1.1.95. */
|
|
28
|
+
readonly supportsNumberFormats = true;
|
|
27
29
|
/**
|
|
28
30
|
* Downloads a matrix data as an Excel file.
|
|
29
31
|
*
|
|
@@ -44,6 +46,10 @@ export declare class ExcelService implements ExcelServiceIf {
|
|
|
44
46
|
createExcelBlob(matrix: Array<Array<any>>, author?: string): Promise<Blob>;
|
|
45
47
|
private generateMap;
|
|
46
48
|
private getX1WorksheetsSheet1Xml;
|
|
49
|
+
/** Number format → cell style index (1-based; 0 = default), filled by withNumberFormats() before the sheet is written. */
|
|
50
|
+
private numberFormatStyles;
|
|
51
|
+
/** Adds one cell style per number format used in the matrix (`<numFmts>` + `<cellXfs>`); unchanged without formats. */
|
|
52
|
+
private withNumberFormats;
|
|
47
53
|
private escapeXml;
|
|
48
54
|
private getCellAddress;
|
|
49
55
|
/**
|