@guiexpert/table 1.1.90 → 1.1.91
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 -1
- package/css/main.css +50 -4
- package/css/table-classes.css +30 -0
- package/css/table-color-classes.css +3 -1
- package/css/table-color-vars.css +4 -2
- package/css/table-tree.css +13 -1
- package/index.cjs +80 -89
- package/index.d.ts +192 -184
- package/index.js +3229 -1580
- package/lib/common/debounce.d.ts +1 -0
- package/lib/common/decorator/avoid-double-execution.decorator.d.ts +2 -0
- package/lib/common/escape-html.d.ts +22 -0
- package/lib/common/generator/column-def-generator-service.d.ts +2 -1
- package/lib/common/generator/domain/property-type.d.ts +19 -0
- package/lib/common/generator/domain/value-info.d.ts +2 -1
- package/lib/common/generator/json-service.d.ts +1 -0
- package/lib/common/generator/property-type.service.d.ts +3 -2
- package/lib/common/generator/scheme-generator-service.d.ts +3 -1
- package/lib/common/generator/string-util.d.ts +7 -0
- package/lib/common/throttle.d.ts +1 -0
- package/lib/table/action/action-id.type.d.ts +5 -1
- package/lib/table/action/on-action-triggered.if.d.ts +2 -1
- package/lib/table/action/osx-shortcut-actionId-mapping.d.ts +3 -1
- package/lib/table/action/shortcut-actionid-mapping.type.d.ts +3 -1
- package/lib/table/action/shortcut-util.d.ts +12 -0
- package/lib/table/action/shortcut.service.d.ts +5 -3
- package/lib/table/action/windows-shortcut-actionId-mapping.d.ts +3 -1
- package/lib/table/aria/aria-grid-info.d.ts +76 -0
- package/lib/table/aria/aria-ids.d.ts +56 -0
- package/lib/table/aria/aria-texts.d.ts +34 -0
- package/lib/table/aria/aria-texts.if.d.ts +88 -0
- package/lib/table/aria/live-announcer.d.ts +53 -0
- package/lib/table/aria/tree-aria-info.d.ts +58 -0
- package/lib/table/checkbox/all-rows-checkbox-model.d.ts +31 -0
- package/lib/table/checkbox/checkbox-model.d.ts +3 -2
- package/lib/table/checkbox/checkbox-model.if.d.ts +2 -1
- package/lib/table/checkbox/tree-checkbox-model.d.ts +19 -4
- package/lib/table/color/color-rgb.d.ts +2 -1
- package/lib/table/color/color-rgb.if.d.ts +2 -0
- package/lib/table/color/ge-css-color-util.d.ts +25 -2
- package/lib/table/color/three-color-gradient-arg.d.ts +3 -2
- package/lib/table/color/three-color-gradient-arg.if.d.ts +3 -1
- package/lib/table/color/two-color-gradient-arg.d.ts +3 -2
- package/lib/table/color/two-color-gradient-arg.if.d.ts +3 -1
- package/lib/table/crud/column-widths.d.ts +2 -1
- package/lib/table/crud/column-widths.if.d.ts +1 -0
- package/lib/table/crud/crud-action.d.ts +1 -0
- package/lib/table/crud/crud-object-edit.d.ts +25 -3
- package/lib/table/crud/crud-object-view.d.ts +6 -0
- package/lib/table/crud/crud-options.d.ts +35 -4
- package/lib/table/crud/crud-options.if.d.ts +3 -2
- package/lib/table/crud/crud-table-model-factory.d.ts +64 -8
- package/lib/table/crud/url-info.d.ts +2 -1
- package/lib/table/crud/url-info.if.d.ts +1 -0
- package/lib/table/crud/urls.if.d.ts +2 -1
- package/lib/table/css-vars.d.ts +1 -0
- package/lib/table/data/chunk/chunk.data-event.d.ts +3 -2
- package/lib/table/data/chunk/chunk.data-event.if.d.ts +2 -1
- package/lib/table/data/chunk/request-chunk.d.ts +2 -1
- package/lib/table/data/chunk/request-chunk.if.d.ts +1 -0
- package/lib/table/data/common/aligns.d.ts +18 -0
- package/lib/table/data/common/area-map-factory.d.ts +3 -2
- package/lib/table/data/common/area-map.d.ts +3 -1
- package/lib/table/data/common/area-map.type.d.ts +1 -0
- package/lib/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +6 -4
- package/lib/table/data/common/args-render-cell-div.d.ts +5 -3
- package/lib/table/data/common/boolean-function.d.ts +10 -0
- package/lib/table/data/common/cell-range.d.ts +16 -7
- package/lib/table/data/common/checkbox-column-def.d.ts +6 -4
- package/lib/table/data/common/checked-type.d.ts +2 -0
- package/lib/table/data/common/event/ge-cell-indices.d.ts +2 -0
- package/lib/table/data/common/event/ge-key-event.d.ts +2 -0
- package/lib/table/data/common/event/ge-model-change-event.d.ts +16 -2
- package/lib/table/data/common/event/ge-mouse-event.d.ts +52 -4
- package/lib/table/data/common/event/ge-scroll-event.d.ts +27 -1
- package/lib/table/data/common/event/input/table-cell-update-event.d.ts +14 -10
- package/lib/table/data/common/event/input/table-cell-update-event.if.d.ts +3 -1
- package/lib/table/data/common/filter-function.d.ts +2 -0
- package/lib/table/data/common/get-t.d.ts +2 -0
- package/lib/table/data/common/index-and-px.d.ts +2 -0
- package/lib/table/data/common/size-unit.type.d.ts +2 -0
- package/lib/table/data/common/size.d.ts +13 -2
- package/lib/table/data/common/size.if.d.ts +3 -1
- package/lib/table/data/common/sizes.d.ts +133 -1
- package/lib/table/data/common/sort-item.d.ts +16 -3
- package/lib/table/data/common/sort-state.type.d.ts +2 -0
- package/lib/table/data/common/tree-arrow.type.d.ts +2 -0
- package/lib/table/data/common/tree-row-if.d.ts +22 -1
- package/lib/table/data/common/tree-row.d.ts +3 -1
- package/lib/table/data/common/value-label.d.ts +2 -1
- package/lib/table/data/common/value-label.if.d.ts +1 -0
- package/lib/table/data/div-scope.type.d.ts +2 -0
- package/lib/table/data/event/mouse-target-data.d.ts +5 -3
- package/lib/table/data/geo-data.d.ts +2 -0
- package/lib/table/data/options/auto-restore-options.d.ts +32 -1
- package/lib/table/data/options/auto-restore-options.if.d.ts +8 -0
- package/lib/table/data/options/default-row-heights.d.ts +20 -2
- package/lib/table/data/options/default-row-heights.if.d.ts +4 -1
- package/lib/table/data/options/header-group-options.d.ts +3 -2
- package/lib/table/data/options/header-group-options.if.d.ts +3 -4
- package/lib/table/data/options/icon.d.ts +2 -1
- package/lib/table/data/options/icon.if.d.ts +2 -0
- package/lib/table/data/options/sorted-options.d.ts +3 -2
- package/lib/table/data/options/sorted-options.if.d.ts +3 -1
- package/lib/table/data/options/table-options.d.ts +37 -13
- package/lib/table/data/options/table-options.if.d.ts +117 -44
- package/lib/table/data/options/tree-options.d.ts +3 -2
- package/lib/table/data/options/tree-options.if.d.ts +3 -1
- package/lib/table/data/side-ident.type.d.ts +2 -0
- package/lib/table/data/table-model-and-options.d.ts +5 -3
- package/lib/table/data/table-model-and-options.if.d.ts +4 -2
- package/lib/table/data/tablemodel/area-ident.type.d.ts +4 -0
- package/lib/table/data/tablemodel/areamodel/abstract-area-model.d.ts +10 -9
- package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +6 -4
- package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +13 -12
- package/lib/table/data/tablemodel/areamodel/area-model-hidden.d.ts +9 -7
- package/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +16 -14
- package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +35 -31
- package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +153 -11
- package/lib/table/data/tablemodel/areamodel/area-model.d.ts +66 -104
- package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +56 -50
- package/lib/table/data/tablemodel/areamodel/async-area-model-object-array.d.ts +5 -5
- package/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +14 -3
- package/lib/table/data/tablemodel/areamodel/cover-grid-body-model.d.ts +10 -8
- package/lib/table/data/tablemodel/areamodel/has-default-row-height-if.d.ts +1 -0
- package/lib/table/data/tablemodel/areamodel/object-array-holder.if.d.ts +1 -0
- package/lib/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +3 -2
- package/lib/table/data/tablemodel/cellgroup/cell-group.d.ts +2 -1
- package/lib/table/data/tablemodel/cellgroup/cell-group.if.d.ts +28 -0
- package/lib/table/data/tablemodel/cellgroup/cellgroup-factory.d.ts +4 -3
- package/lib/table/data/tablemodel/column/column-def.d.ts +67 -10
- package/lib/table/data/tablemodel/column/column-def.if.d.ts +63 -96
- package/lib/table/data/tablemodel/column/column-visibility.d.ts +6 -0
- package/lib/table/data/tablemodel/cover-grid-table-model.d.ts +11 -10
- package/lib/table/data/tablemodel/padding.d.ts +2 -0
- package/lib/table/data/tablemodel/table-model.d.ts +75 -14
- package/lib/table/data/tablemodel/table-model.if.d.ts +52 -8
- package/lib/table/ele-scope.d.ts +36 -5
- package/lib/table/event-adapter.d.ts +17 -10
- package/lib/table/event-checkbox-changed-handler.d.ts +2 -1
- package/lib/table/event-listener.if.d.ts +42 -9
- package/lib/table/factory/cover-grid-factory.d.ts +4 -3
- package/lib/table/factory/table-factory.d.ts +103 -64
- package/lib/table/factory/tree-factory.d.ts +45 -3
- package/lib/table/focus/event-focus-changed-listener.if.d.ts +5 -3
- package/lib/table/focus/focus-model.d.ts +7 -5
- package/lib/table/focus/focus-model.if.d.ts +22 -1
- package/lib/table/focus/focus.type.d.ts +2 -0
- package/lib/table/input-handler.d.ts +5 -1
- package/lib/table/instanceof-workaround.d.ts +16 -0
- package/lib/table/license-manager.d.ts +2 -0
- package/lib/table/mouse-handler.d.ts +18 -9
- package/lib/table/render-scope.d.ts +115 -25
- package/lib/table/renderer/action/action-event-listener.if.d.ts +2 -1
- package/lib/table/renderer/action/action-event.d.ts +4 -3
- package/lib/table/renderer/action/action-event.if.d.ts +2 -1
- package/lib/table/renderer/action/actions-cell-renderer.d.ts +8 -7
- package/lib/table/renderer/cell-group-ext-cell-renderer.d.ts +8 -7
- package/lib/table/renderer/cell-render.if.d.ts +41 -4
- package/lib/table/renderer/checkbox-boolean-property-cell-renderer.d.ts +7 -5
- package/lib/table/renderer/checkbox-cell-renderer.d.ts +8 -5
- package/lib/table/renderer/date-to-int-date-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/date-to-iso-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/date-to-locale-date-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/date-to-tec-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/edit/edit-cell-renderer.type.d.ts +2 -1
- package/lib/table/renderer/edit/edit-input-pipe-for-number.d.ts +2 -1
- package/lib/table/renderer/edit/edit-input-pipe.if.d.ts +2 -0
- package/lib/table/renderer/edit/input-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/edit/select-cell-renderer.d.ts +7 -6
- package/lib/table/renderer/male-female-to-icon-cell-renderer.d.ts +19 -6
- package/lib/table/renderer/number-cell-progress-bar-cell-renderer.d.ts +11 -6
- package/lib/table/renderer/number-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/positive-and-negative-number-renderer.d.ts +6 -5
- package/lib/table/renderer/progress-bar-cell-renderer.d.ts +12 -6
- package/lib/table/renderer/renderer-cleanup-fn.type.d.ts +1 -0
- package/lib/table/renderer/renderer.d.ts +3 -2
- package/lib/table/renderer/simple-array-cell-renderer.d.ts +6 -5
- package/lib/table/renderer/star-rating-cell-renderer.d.ts +12 -6
- package/lib/table/renderer/true-false-cell-renderer.d.ts +17 -5
- package/lib/table/resize-handler.d.ts +3 -1
- package/lib/table/selection/event-selection-changed-listener.if.d.ts +2 -1
- package/lib/table/selection/multi-rows-selection-model.d.ts +7 -4
- package/lib/table/selection/selection-model.d.ts +112 -10
- package/lib/table/selection/selection-model.if.d.ts +48 -3
- package/lib/table/selection/selection-service.d.ts +35 -7
- package/lib/table/selection/selection.type.d.ts +3 -0
- package/lib/table/service/abstract-store-state.service.d.ts +1 -1
- package/lib/table/service/convenience-dom.service.d.ts +36 -13
- package/lib/table/service/copy-service.d.ts +18 -4
- package/lib/table/service/copy-service.if.d.ts +4 -3
- package/lib/table/service/data/collapsed-expanded.data.d.ts +1 -0
- package/lib/table/service/data/html-style.type.d.ts +1 -0
- package/lib/table/service/dom-service.if.d.ts +30 -0
- package/lib/table/service/excel-service.d.ts +24 -1
- package/lib/table/service/excel-service.if.d.ts +7 -0
- package/lib/table/service/ge-filter.service.d.ts +1 -0
- package/lib/table/service/simple-dom-service.d.ts +3 -1
- package/lib/table/service/store-state-collapsed-expand.service.d.ts +4 -3
- package/lib/table/service/store-state-scroll-pos.service.d.ts +3 -2
- package/lib/table/service/store-state-sorting.service.d.ts +4 -3
- package/lib/table/service/tree-row.service.d.ts +5 -1
- package/lib/table/table-api.d.ts +296 -550
- package/lib/table/table-scope.d.ts +213 -86
- package/package.json +23 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AreaModelIf } from '../tablemodel/areamodel/area-model.if';
|
|
2
|
-
import { AreaIdent } from '../tablemodel/area-ident.type';
|
|
3
|
-
import { SideIdent } from '../side-ident.type';
|
|
1
|
+
import { AreaModelIf } from '../tablemodel/areamodel/area-model.if.js';
|
|
2
|
+
import { AreaIdent } from '../tablemodel/area-ident.type.js';
|
|
3
|
+
import { SideIdent } from '../side-ident.type.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents the arguments required to render a cell div.
|
|
@@ -17,6 +17,8 @@ import { SideIdent } from '../side-ident.type';
|
|
|
17
17
|
* @property {number} top - The top position of the cell.
|
|
18
18
|
* @property {HTMLDivElement} parent - The parent element of the cell.
|
|
19
19
|
* @property {boolean} lastRowOfModel - Indicates if the cell is in the last row of the model.
|
|
20
|
+
*
|
|
21
|
+
* @category Internals
|
|
20
22
|
*/
|
|
21
23
|
export interface ArgsRenderCellDiv {
|
|
22
24
|
areaModel: AreaModelIf;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A flag as function – e.g. {@link ColumnDefIf.sortable}, `editable`, `isVisible`. A function can depend on state:
|
|
3
|
+
* `isVisible: () => showDetails`. Constants: {@link TrueFn}, {@link FalseFn}.
|
|
4
|
+
*
|
|
5
|
+
* @category Columns
|
|
6
|
+
*/
|
|
1
7
|
export type BooleanFunction = () => boolean;
|
|
2
8
|
/**
|
|
3
9
|
* Represents a function that always returns true.
|
|
4
10
|
*
|
|
5
11
|
* @function
|
|
6
12
|
* @returns {boolean} - Always returns true
|
|
13
|
+
*
|
|
14
|
+
* @category Columns
|
|
7
15
|
*/
|
|
8
16
|
export declare const TrueFn: () => boolean;
|
|
9
17
|
/**
|
|
@@ -11,5 +19,7 @@ export declare const TrueFn: () => boolean;
|
|
|
11
19
|
*
|
|
12
20
|
* @function
|
|
13
21
|
* @returns {boolean} Always returns `false`.
|
|
22
|
+
*
|
|
23
|
+
* @category Columns
|
|
14
24
|
*/
|
|
15
25
|
export declare const FalseFn: () => boolean;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A rectangle of cells: rows `r1`…`r2`, columns `c1`…`c2` (inclusive, body indices as displayed).
|
|
3
|
+
* {@link SelectionModelIf.getRanges} returns the selection as a list of them.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const firstTenRows = new CellRange(0, 0, 9, tableModel.getColumnCount() - 1);
|
|
7
|
+
* tableApi.getSelectionModel()?.addSelection(firstTenRows);
|
|
8
|
+
* tableApi.repaint();
|
|
9
|
+
*
|
|
10
|
+
* @category Selection & focus
|
|
11
|
+
*/
|
|
1
12
|
export declare class CellRange {
|
|
2
13
|
r1: number;
|
|
3
14
|
c1: number;
|
|
@@ -5,13 +16,11 @@ export declare class CellRange {
|
|
|
5
16
|
c2: number;
|
|
6
17
|
gammaRange: boolean;
|
|
7
18
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {number} c2 - The value for c2.
|
|
14
|
-
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
19
|
+
* @param r1 - first row
|
|
20
|
+
* @param c1 - first column
|
|
21
|
+
* @param r2 - last row (inclusive)
|
|
22
|
+
* @param c2 - last column (inclusive)
|
|
23
|
+
* @param gammaRange - reserved for {@link AreaModelCellGroups}, not used yet (default false)
|
|
15
24
|
*/
|
|
16
25
|
constructor(r1: number, c1: number, r2: number, c2: number, gammaRange?: boolean);
|
|
17
26
|
static create(params: {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { SizeIf } from './size.if';
|
|
2
|
-
import { ColumnDefIf } from '../tablemodel/column/column-def.if';
|
|
3
|
-
import { CellRendererIf } from '../../renderer/cell-render.if';
|
|
4
|
-
import { AreaObjectMapType } from './area-map.type';
|
|
1
|
+
import { SizeIf } from './size.if.js';
|
|
2
|
+
import { ColumnDefIf } from '../tablemodel/column/column-def.if.js';
|
|
3
|
+
import { CellRendererIf } from '../../renderer/cell-render.if.js';
|
|
4
|
+
import { AreaObjectMapType } from './area-map.type.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A pre-defined column definition for a checkbox representation.
|
|
8
8
|
*
|
|
9
9
|
* @implements {ColumnDefIf}
|
|
10
|
+
*
|
|
11
|
+
* @category Columns
|
|
10
12
|
*/
|
|
11
13
|
export declare class CheckboxColumnDef implements ColumnDefIf {
|
|
12
14
|
type: string;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { GeCellIndices } from './ge-cell-indices';
|
|
1
|
+
import { GeCellIndices } from './ge-cell-indices.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Reported by {@link EventListenerIf.onModelChanged} after cells were edited: the row and column indices
|
|
5
|
+
* of the changed cells. The new values are already written into the area model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* override onModelChanged(evt: GeModelChangeEvent): void {
|
|
9
|
+
* for (const { rowIndex } of evt.cells) {
|
|
10
|
+
* const order = tableModel.getBodyModel().getRowByIndex(rowIndex) as Order;
|
|
11
|
+
* order.total = order.quantity * order.price; // recalculate derived values
|
|
12
|
+
* }
|
|
13
|
+
* tableApi.repaint();
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* @see Training: [Inline editing](https://gui.expert/training/inline-editing/)
|
|
17
|
+
*
|
|
18
|
+
* @category Events
|
|
5
19
|
*/
|
|
6
20
|
export declare class GeModelChangeEvent {
|
|
7
21
|
cells: GeCellIndices[];
|
|
@@ -1,21 +1,69 @@
|
|
|
1
|
-
import { AreaIdent } from '../../tablemodel/area-ident.type';
|
|
2
|
-
import { SideIdent } from '../../side-ident.type';
|
|
1
|
+
import { AreaIdent } from '../../tablemodel/area-ident.type.js';
|
|
2
|
+
import { SideIdent } from '../../side-ident.type.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A mouse event of the table: where it happened (area, side, row, column) plus the browser event.
|
|
6
|
+
* Passed to {@link EventListenerIf.onMouseClicked}, {@link EventListenerIf.onContextmenu} and the other mouse methods.
|
|
7
|
+
*
|
|
8
|
+
* `rowIndex` is the row as **displayed** (after filter and sorting) – get your object with
|
|
9
|
+
* `tableModel.getBodyModel().getRowByIndex(evt.rowIndex)`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* override onContextmenu(evt: GeMouseEvent): void {
|
|
13
|
+
* if (evt.areaIdent !== "body" || evt.rowIndex < 0) return;
|
|
14
|
+
* evt.originalEvent?.preventDefault(); // no browser menu
|
|
15
|
+
* showMyMenu(evt.originalEvent!.clientX, evt.originalEvent!.clientY, evt.rowIndex);
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* @see Training: [Events and a context menu of your own](https://gui.expert/training/events-and-context-menu/)
|
|
19
|
+
*
|
|
20
|
+
* @category Events
|
|
6
21
|
*/
|
|
7
22
|
export declare class GeMouseEvent {
|
|
23
|
+
/** Row index in the area (as displayed); -1 outside of rows. */
|
|
8
24
|
rowIndex: number;
|
|
25
|
+
/** Top position of the row in px. */
|
|
9
26
|
rowTop: number;
|
|
27
|
+
/** Column index (model index over west + center + east); -1 outside of columns. */
|
|
10
28
|
columnIndex: number;
|
|
29
|
+
/** Left position of the column in px. */
|
|
11
30
|
columnLeft: number;
|
|
31
|
+
/** `"header"`, `"body"` or `"footer"`. */
|
|
12
32
|
areaIdent?: AreaIdent | undefined;
|
|
33
|
+
/** `"west"` (fixed left), `"center"` or `"east"` (fixed right). */
|
|
13
34
|
sideIdent?: SideIdent | undefined;
|
|
35
|
+
/** The browser event – position, buttons, modifier keys. */
|
|
14
36
|
originalEvent?: MouseEvent | undefined;
|
|
37
|
+
/** 1 = click, 2 = double-click on the same cell. */
|
|
15
38
|
clickCount: number;
|
|
39
|
+
/** Horizontal distance in px while dragging. */
|
|
16
40
|
draggingX: number;
|
|
41
|
+
/** Vertical distance in px while dragging. */
|
|
17
42
|
draggingY: number;
|
|
43
|
+
/** Internal action of the clicked element (e.g. a tree arrow), otherwise empty. */
|
|
18
44
|
action: string | null;
|
|
19
|
-
constructor(
|
|
45
|
+
constructor(
|
|
46
|
+
/** Row index in the area (as displayed); -1 outside of rows. */
|
|
47
|
+
rowIndex?: number,
|
|
48
|
+
/** Top position of the row in px. */
|
|
49
|
+
rowTop?: number,
|
|
50
|
+
/** Column index (model index over west + center + east); -1 outside of columns. */
|
|
51
|
+
columnIndex?: number,
|
|
52
|
+
/** Left position of the column in px. */
|
|
53
|
+
columnLeft?: number,
|
|
54
|
+
/** `"header"`, `"body"` or `"footer"`. */
|
|
55
|
+
areaIdent?: AreaIdent | undefined,
|
|
56
|
+
/** `"west"` (fixed left), `"center"` or `"east"` (fixed right). */
|
|
57
|
+
sideIdent?: SideIdent | undefined,
|
|
58
|
+
/** The browser event – position, buttons, modifier keys. */
|
|
59
|
+
originalEvent?: MouseEvent | undefined,
|
|
60
|
+
/** 1 = click, 2 = double-click on the same cell. */
|
|
61
|
+
clickCount?: number,
|
|
62
|
+
/** Horizontal distance in px while dragging. */
|
|
63
|
+
draggingX?: number,
|
|
64
|
+
/** Vertical distance in px while dragging. */
|
|
65
|
+
draggingY?: number,
|
|
66
|
+
/** Internal action of the clicked element (e.g. a tree arrow), otherwise empty. */
|
|
67
|
+
action?: string | null);
|
|
20
68
|
clone(): GeMouseEvent;
|
|
21
69
|
}
|
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Scroll event containing position and size information.
|
|
3
|
+
*
|
|
4
|
+
* @category Events
|
|
3
5
|
*/
|
|
4
6
|
export declare class GeScrollEvent {
|
|
7
|
+
/** Vertical scroll position of the viewport in px. */
|
|
5
8
|
scrollTop: number;
|
|
9
|
+
/** Horizontal scroll position of the viewport in px. */
|
|
6
10
|
scrollLeft: number;
|
|
11
|
+
/** Height of the whole (virtual) content in px. */
|
|
7
12
|
scrollHeight: number;
|
|
13
|
+
/** Width of the whole content in px. */
|
|
8
14
|
scrollWidth: number;
|
|
15
|
+
/** Visible height in px. */
|
|
9
16
|
clientHeight: number;
|
|
17
|
+
/** Visible width in px. */
|
|
10
18
|
clientWidth: number;
|
|
19
|
+
/** Vertical position as factor 0 (top) … 1 (bottom). */
|
|
11
20
|
scrollFactorY: number;
|
|
21
|
+
/** Horizontal position as factor 0 (left) … 1 (right). */
|
|
12
22
|
scrollFactorX: number;
|
|
13
|
-
constructor(
|
|
23
|
+
constructor(
|
|
24
|
+
/** Vertical scroll position of the viewport in px. */
|
|
25
|
+
scrollTop: number,
|
|
26
|
+
/** Horizontal scroll position of the viewport in px. */
|
|
27
|
+
scrollLeft: number,
|
|
28
|
+
/** Height of the whole (virtual) content in px. */
|
|
29
|
+
scrollHeight: number,
|
|
30
|
+
/** Width of the whole content in px. */
|
|
31
|
+
scrollWidth: number,
|
|
32
|
+
/** Visible height in px. */
|
|
33
|
+
clientHeight: number,
|
|
34
|
+
/** Visible width in px. */
|
|
35
|
+
clientWidth: number,
|
|
36
|
+
/** Vertical position as factor 0 (top) … 1 (bottom). */
|
|
37
|
+
scrollFactorY: number,
|
|
38
|
+
/** Horizontal position as factor 0 (left) … 1 (right). */
|
|
39
|
+
scrollFactorX: number);
|
|
14
40
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { TableCellUpdateEventIf } from './table-cell-update-event.if';
|
|
2
|
-
import { AreaIdent } from '../../../tablemodel/area-ident.type';
|
|
1
|
+
import { TableCellUpdateEventIf } from './table-cell-update-event.if.js';
|
|
2
|
+
import { AreaIdent } from '../../../tablemodel/area-ident.type.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A new value for one cell – the input of {@link TableApi.updateCells}.
|
|
6
|
+
* The value is written into the area model; if the cell is visible, only this cell is redrawn.
|
|
7
|
+
* `cssClasses` are applied to the current drawing of the cell (e.g. a short "flash"); permanent colours
|
|
8
|
+
* belong into the model ({@link AreaModelIf.getCustomClassesAt}).
|
|
6
9
|
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
10
|
+
* @example
|
|
11
|
+
* tableApi.updateCells([
|
|
12
|
+
* new TableCellUpdateEvent("body", row, 2, price, { "tick-up": up, "tick-down": !up }),
|
|
13
|
+
* new TableCellUpdateEvent("body", row, 4, volume)
|
|
14
|
+
* ]);
|
|
9
15
|
*
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
13
|
-
* @param {any} value - The new value for the cell.
|
|
14
|
-
* @param {Object.<string, boolean>} cssClasses - An object containing CSS classes to be applied to the cell.
|
|
16
|
+
* @see Training: [Live data without rebuilding the table](https://gui.expert/training/live-data/)
|
|
17
|
+
*
|
|
18
|
+
* @category Events
|
|
15
19
|
*/
|
|
16
20
|
export declare class TableCellUpdateEvent implements TableCellUpdateEventIf {
|
|
17
21
|
area: AreaIdent;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { AreaIdent } from '../../../tablemodel/area-ident.type';
|
|
1
|
+
import { AreaIdent } from '../../../tablemodel/area-ident.type.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* One event defines one table cell update operation.
|
|
5
5
|
* You can send an array of these event via TableApi#updateCells(events: TableCellUpdateEventIf[], repaintAll: boolean = false).
|
|
6
|
+
*
|
|
7
|
+
* @category Events
|
|
6
8
|
*/
|
|
7
9
|
export interface TableCellUpdateEventIf {
|
|
8
10
|
/**
|
|
@@ -5,5 +5,7 @@
|
|
|
5
5
|
* @param {number} index The index of the current element being evaluated.
|
|
6
6
|
* @param {T[]} array The array that the filter function was called upon.
|
|
7
7
|
* @returns {unknown} The result of the filter function evaluation: `true` if the element should be included, `false` otherwise.
|
|
8
|
+
*
|
|
9
|
+
* @category Sorting & filtering
|
|
8
10
|
*/
|
|
9
11
|
export type FilterFunction<T> = (value: T, index: number, array: T[]) => unknown;
|
|
@@ -5,5 +5,7 @@
|
|
|
5
5
|
* 'weight': after the width is set for columns with unit 'px' and '%', the remaining width is divided among the weighted columns according to their respective weighting.
|
|
6
6
|
*
|
|
7
7
|
* @typedef {"px" | "%" | "weight"} SizeUnitType
|
|
8
|
+
*
|
|
9
|
+
* @category Columns
|
|
8
10
|
*/
|
|
9
11
|
export type SizeUnitType = "px" | "%" | "weight";
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { SizeIf } from './size.if';
|
|
2
|
-
import { SizeUnitType } from './size-unit.type';
|
|
1
|
+
import { SizeIf } from './size.if.js';
|
|
2
|
+
import { SizeUnitType } from './size-unit.type.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A width with unit – used for {@link ColumnDefIf.width}, `minWidth` and `maxWidth`.
|
|
6
|
+
* For pixel widths use the constants {@link px80}, {@link px100}, {@link px120} … (`px0` – `px500`).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* new Size(37, "px"); // fixed
|
|
10
|
+
* new Size(10, "%"); // 10 % of the table width (clamped by minWidth / maxWidth)
|
|
11
|
+
* new Size(2, "weight"); // twice as much of the remaining space as a column with weight 1
|
|
12
|
+
*
|
|
13
|
+
* @category Columns
|
|
14
|
+
*/
|
|
4
15
|
export declare class Size implements SizeIf {
|
|
5
16
|
value: number;
|
|
6
17
|
unit: SizeUnitType;
|
|
@@ -1,35 +1,167 @@
|
|
|
1
|
-
import { Size } from './size';
|
|
1
|
+
import { Size } from './size.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* 500 px – a column width, e.g. `new ColumnDef("name", "Name", px500)`.
|
|
5
|
+
* @category Columns
|
|
6
|
+
*/
|
|
3
7
|
export declare const px500: Size;
|
|
8
|
+
/**
|
|
9
|
+
* 400 px – a column width, e.g. `new ColumnDef("name", "Name", px400)`.
|
|
10
|
+
* @category Columns
|
|
11
|
+
*/
|
|
4
12
|
export declare const px400: Size;
|
|
13
|
+
/**
|
|
14
|
+
* 300 px – a column width, e.g. `new ColumnDef("name", "Name", px300)`.
|
|
15
|
+
* @category Columns
|
|
16
|
+
*/
|
|
5
17
|
export declare const px300: Size;
|
|
18
|
+
/**
|
|
19
|
+
* 290 px – a column width, e.g. `new ColumnDef("name", "Name", px290)`.
|
|
20
|
+
* @category Columns
|
|
21
|
+
*/
|
|
6
22
|
export declare const px290: Size;
|
|
23
|
+
/**
|
|
24
|
+
* 280 px – a column width, e.g. `new ColumnDef("name", "Name", px280)`.
|
|
25
|
+
* @category Columns
|
|
26
|
+
*/
|
|
7
27
|
export declare const px280: Size;
|
|
28
|
+
/**
|
|
29
|
+
* 270 px – a column width, e.g. `new ColumnDef("name", "Name", px270)`.
|
|
30
|
+
* @category Columns
|
|
31
|
+
*/
|
|
8
32
|
export declare const px270: Size;
|
|
33
|
+
/**
|
|
34
|
+
* 260 px – a column width, e.g. `new ColumnDef("name", "Name", px260)`.
|
|
35
|
+
* @category Columns
|
|
36
|
+
*/
|
|
9
37
|
export declare const px260: Size;
|
|
38
|
+
/**
|
|
39
|
+
* 250 px – a column width, e.g. `new ColumnDef("name", "Name", px250)`.
|
|
40
|
+
* @category Columns
|
|
41
|
+
*/
|
|
10
42
|
export declare const px250: Size;
|
|
43
|
+
/**
|
|
44
|
+
* 240 px – a column width, e.g. `new ColumnDef("name", "Name", px240)`.
|
|
45
|
+
* @category Columns
|
|
46
|
+
*/
|
|
11
47
|
export declare const px240: Size;
|
|
48
|
+
/**
|
|
49
|
+
* 230 px – a column width, e.g. `new ColumnDef("name", "Name", px230)`.
|
|
50
|
+
* @category Columns
|
|
51
|
+
*/
|
|
12
52
|
export declare const px230: Size;
|
|
53
|
+
/**
|
|
54
|
+
* 220 px – a column width, e.g. `new ColumnDef("name", "Name", px220)`.
|
|
55
|
+
* @category Columns
|
|
56
|
+
*/
|
|
13
57
|
export declare const px220: Size;
|
|
58
|
+
/**
|
|
59
|
+
* 210 px – a column width, e.g. `new ColumnDef("name", "Name", px210)`.
|
|
60
|
+
* @category Columns
|
|
61
|
+
*/
|
|
14
62
|
export declare const px210: Size;
|
|
63
|
+
/**
|
|
64
|
+
* 200 px – a column width, e.g. `new ColumnDef("name", "Name", px200)`.
|
|
65
|
+
* @category Columns
|
|
66
|
+
*/
|
|
15
67
|
export declare const px200: Size;
|
|
68
|
+
/**
|
|
69
|
+
* 190 px – a column width, e.g. `new ColumnDef("name", "Name", px190)`.
|
|
70
|
+
* @category Columns
|
|
71
|
+
*/
|
|
16
72
|
export declare const px190: Size;
|
|
73
|
+
/**
|
|
74
|
+
* 180 px – a column width, e.g. `new ColumnDef("name", "Name", px180)`.
|
|
75
|
+
* @category Columns
|
|
76
|
+
*/
|
|
17
77
|
export declare const px180: Size;
|
|
78
|
+
/**
|
|
79
|
+
* 170 px – a column width, e.g. `new ColumnDef("name", "Name", px170)`.
|
|
80
|
+
* @category Columns
|
|
81
|
+
*/
|
|
18
82
|
export declare const px170: Size;
|
|
83
|
+
/**
|
|
84
|
+
* 160 px – a column width, e.g. `new ColumnDef("name", "Name", px160)`.
|
|
85
|
+
* @category Columns
|
|
86
|
+
*/
|
|
19
87
|
export declare const px160: Size;
|
|
88
|
+
/**
|
|
89
|
+
* 150 px – a column width, e.g. `new ColumnDef("name", "Name", px150)`.
|
|
90
|
+
* @category Columns
|
|
91
|
+
*/
|
|
20
92
|
export declare const px150: Size;
|
|
93
|
+
/**
|
|
94
|
+
* 140 px – a column width, e.g. `new ColumnDef("name", "Name", px140)`.
|
|
95
|
+
* @category Columns
|
|
96
|
+
*/
|
|
21
97
|
export declare const px140: Size;
|
|
98
|
+
/**
|
|
99
|
+
* 130 px – a column width, e.g. `new ColumnDef("name", "Name", px130)`.
|
|
100
|
+
* @category Columns
|
|
101
|
+
*/
|
|
22
102
|
export declare const px130: Size;
|
|
103
|
+
/**
|
|
104
|
+
* 120 px – a column width, e.g. `new ColumnDef("name", "Name", px120)`.
|
|
105
|
+
* @category Columns
|
|
106
|
+
*/
|
|
23
107
|
export declare const px120: Size;
|
|
108
|
+
/**
|
|
109
|
+
* 110 px – a column width, e.g. `new ColumnDef("name", "Name", px110)`.
|
|
110
|
+
* @category Columns
|
|
111
|
+
*/
|
|
24
112
|
export declare const px110: Size;
|
|
113
|
+
/**
|
|
114
|
+
* 100 px – a column width, e.g. `new ColumnDef("name", "Name", px100)`.
|
|
115
|
+
* @category Columns
|
|
116
|
+
*/
|
|
25
117
|
export declare const px100: Size;
|
|
118
|
+
/**
|
|
119
|
+
* 90 px – a column width, e.g. `new ColumnDef("name", "Name", px90)`.
|
|
120
|
+
* @category Columns
|
|
121
|
+
*/
|
|
26
122
|
export declare const px90: Size;
|
|
123
|
+
/**
|
|
124
|
+
* 80 px – a column width, e.g. `new ColumnDef("name", "Name", px80)`.
|
|
125
|
+
* @category Columns
|
|
126
|
+
*/
|
|
27
127
|
export declare const px80: Size;
|
|
128
|
+
/**
|
|
129
|
+
* 70 px – a column width, e.g. `new ColumnDef("name", "Name", px70)`.
|
|
130
|
+
* @category Columns
|
|
131
|
+
*/
|
|
28
132
|
export declare const px70: Size;
|
|
133
|
+
/**
|
|
134
|
+
* 60 px – a column width, e.g. `new ColumnDef("name", "Name", px60)`.
|
|
135
|
+
* @category Columns
|
|
136
|
+
*/
|
|
29
137
|
export declare const px60: Size;
|
|
138
|
+
/**
|
|
139
|
+
* 50 px – a column width, e.g. `new ColumnDef("name", "Name", px50)`.
|
|
140
|
+
* @category Columns
|
|
141
|
+
*/
|
|
30
142
|
export declare const px50: Size;
|
|
143
|
+
/**
|
|
144
|
+
* 40 px – a column width, e.g. `new ColumnDef("name", "Name", px40)`.
|
|
145
|
+
* @category Columns
|
|
146
|
+
*/
|
|
31
147
|
export declare const px40: Size;
|
|
148
|
+
/**
|
|
149
|
+
* 30 px – a column width, e.g. `new ColumnDef("name", "Name", px30)`.
|
|
150
|
+
* @category Columns
|
|
151
|
+
*/
|
|
32
152
|
export declare const px30: Size;
|
|
153
|
+
/**
|
|
154
|
+
* 20 px – a column width, e.g. `new ColumnDef("name", "Name", px20)`.
|
|
155
|
+
* @category Columns
|
|
156
|
+
*/
|
|
33
157
|
export declare const px20: Size;
|
|
158
|
+
/**
|
|
159
|
+
* 10 px – a column width, e.g. `new ColumnDef("name", "Name", px10)`.
|
|
160
|
+
* @category Columns
|
|
161
|
+
*/
|
|
34
162
|
export declare const px10: Size;
|
|
163
|
+
/**
|
|
164
|
+
* 0 px – a column width, e.g. `new ColumnDef("name", "Name", px0)`.
|
|
165
|
+
* @category Columns
|
|
166
|
+
*/
|
|
35
167
|
export declare const px0: Size;
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { SortState } from './sort-state.type';
|
|
1
|
+
import { SortState } from './sort-state.type.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* One sort instruction: column index + direction. Used by {@link TableModelIf.doSort} and
|
|
5
|
+
* {@link AreaModelIf.doSort}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // sort once by column 10 descending (and match the header icon set with sortState: "desc")
|
|
9
|
+
* tableModel.doSort([new SortItem(10, "desc")]);
|
|
10
|
+
*
|
|
11
|
+
* @category Sorting & filtering
|
|
5
12
|
*/
|
|
6
13
|
export declare class SortItem {
|
|
14
|
+
/** Column index (west + center + east). */
|
|
7
15
|
columnIndex: number;
|
|
16
|
+
/** `"asc"`, `"desc"` or `""` (unsorted). */
|
|
8
17
|
sortState: SortState;
|
|
9
|
-
constructor(
|
|
18
|
+
constructor(
|
|
19
|
+
/** Column index (west + center + east). */
|
|
20
|
+
columnIndex: number,
|
|
21
|
+
/** `"asc"`, `"desc"` or `""` (unsorted). */
|
|
22
|
+
sortState: SortState);
|
|
10
23
|
}
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* The arrow type determines the visual representation of the arrow icon associated with a tree node.
|
|
5
5
|
*
|
|
6
6
|
* @typedef {("none" | "hidden" | "collapsed" | "expanded")} TreeArrowType
|
|
7
|
+
*
|
|
8
|
+
* @category Tree & checkboxes
|
|
7
9
|
*/
|
|
8
10
|
export type TreeArrowType = "none" | "hidden" | "collapsed" | "expanded";
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* A row of a tree table: your object (`data`) plus the tree state. Created by {@link TreeFactory.buildTreeRows}.
|
|
3
|
+
*
|
|
4
|
+
* @typeParam T - the type of your objects
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // expand all first-level rows: change `expanded`, rebuild the displayed rows, repaint
|
|
8
|
+
* const treeModel = tableModel.getBodyModel() as AreaModelTree<OrderNode>;
|
|
9
|
+
* for (const row of treeModel.rows) row.expanded = true;
|
|
10
|
+
* treeModel.recalcVisibleTreeRows(); // without it the table keeps showing the old rows
|
|
11
|
+
* tableApi.repaintHard();
|
|
12
|
+
*
|
|
13
|
+
* @see Training: [Tree table with checkboxes](https://gui.expert/training/tree-table/)
|
|
14
|
+
*
|
|
15
|
+
* @category Tree & checkboxes
|
|
3
16
|
*/
|
|
4
17
|
export interface TreeRowIf<T> {
|
|
18
|
+
/** Marker to recognise tree rows across package boundaries (see `isTreeRow()`). */
|
|
5
19
|
type?: 'TreeRow' | '';
|
|
20
|
+
/** Your object. Column values are read from it (`columnDef.property`). */
|
|
6
21
|
data: T;
|
|
22
|
+
/** Are the children visible? */
|
|
7
23
|
expanded: boolean;
|
|
24
|
+
/** The child rows, undefined for leaves. */
|
|
8
25
|
children: TreeRowIf<T>[] | undefined;
|
|
26
|
+
/** The parent row, undefined on the top level. */
|
|
9
27
|
parent: TreeRowIf<T> | undefined;
|
|
28
|
+
/** Depth in the tree: 0 = top level. */
|
|
10
29
|
deep: number;
|
|
30
|
+
/** Checkbox state (with `showCheckboxWihoutExtraColumn` or a checkbox column). */
|
|
11
31
|
checked: boolean;
|
|
32
|
+
/** Internal, set by the filter: the row or one of its descendants matches (also below collapsed rows). */
|
|
12
33
|
keep: boolean;
|
|
13
34
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { TreeRowIf } from './tree-row-if';
|
|
1
|
+
import { TreeRowIf } from './tree-row-if.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents a (table) row in a tree structure. It's a container object for T with additional tree node information.
|
|
5
5
|
* @template T - The type of data stored in the row.
|
|
6
|
+
*
|
|
7
|
+
* @category Tree & checkboxes
|
|
6
8
|
*/
|
|
7
9
|
export declare class TreeRow<T> implements TreeRowIf<T> {
|
|
8
10
|
data: T;
|