@guiexpert/table 1.1.90 → 1.1.92
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 +8 -2
- package/css/main.css +129 -4
- package/css/table-classes.css +93 -0
- package/css/table-color-classes.css +3 -1
- package/css/table-color-vars.css +20 -2
- package/css/table-tree.css +13 -1
- package/index.cjs +111 -96
- package/index.d.ts +203 -184
- package/index.js +4927 -2096
- 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 +62 -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 +72 -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/ge-state-change-event.d.ts +30 -0
- 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 +44 -1
- package/lib/table/data/options/auto-restore-options.if.d.ts +95 -45
- 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/default-row-id.d.ts +4 -0
- 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/overlay-options.d.ts +30 -0
- package/lib/table/data/options/overlay-options.if.d.ts +79 -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 +40 -13
- package/lib/table/data/options/table-options.if.d.ts +152 -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 +13 -4
- package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +44 -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 +48 -31
- package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +162 -11
- package/lib/table/data/tablemodel/areamodel/area-model.d.ts +66 -104
- package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +75 -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 +17 -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 +4 -1
- package/lib/table/data/tablemodel/cellgroup/cell-group.if.d.ts +34 -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 +11 -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 +53 -5
- package/lib/table/event-adapter.d.ts +20 -10
- package/lib/table/event-checkbox-changed-handler.d.ts +2 -1
- package/lib/table/event-listener.if.d.ts +50 -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 +20 -9
- package/lib/table/overlay/calc-overlay-kind.d.ts +31 -0
- package/lib/table/overlay/ge-overlay-kind.type.d.ts +17 -0
- package/lib/table/overlay/table-overlay.d.ts +108 -0
- package/lib/table/render-scope.d.ts +141 -27
- 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 +37 -14
- 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/state/state-storage.if.d.ts +39 -0
- package/lib/table/state/table-state-migration.d.ts +36 -0
- package/lib/table/state/table-state-part.d.ts +13 -0
- package/lib/table/state/table-state.if.d.ts +181 -0
- package/lib/table/state/table-state.service.d.ts +158 -0
- package/lib/table/table-api.d.ts +450 -550
- package/lib/table/table-scope.d.ts +288 -114
- package/package.json +23 -8
|
@@ -1,25 +1,66 @@
|
|
|
1
|
-
import { GeMouseEvent } from './data/common/event/ge-mouse-event';
|
|
2
|
-
import { GeModelChangeEvent } from './data/common/event/ge-model-change-event';
|
|
3
|
-
import { GeScrollEvent } from './data/common/event/ge-scroll-event';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { GeMouseEvent } from './data/common/event/ge-mouse-event.js';
|
|
2
|
+
import { GeModelChangeEvent } from './data/common/event/ge-model-change-event.js';
|
|
3
|
+
import { GeScrollEvent } from './data/common/event/ge-scroll-event.js';
|
|
4
|
+
import { GeStateChangeEvent } from './data/common/event/ge-state-change-event.js';
|
|
5
|
+
import { SelectionModelIf } from './selection/selection-model.if.js';
|
|
6
|
+
import { FocusModelIf } from './focus/focus-model.if.js';
|
|
7
|
+
import { EventFocusChangedListenerIf } from './focus/event-focus-changed-listener.if.js';
|
|
8
|
+
import { EventSelectionChangedListenerIf } from './selection/event-selection-changed-listener.if.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Receives the events of a table – the fifth argument of `new TableScope(…)`.
|
|
12
|
+
* Extend {@link EventAdapter} and override only the methods you need.
|
|
11
13
|
*
|
|
12
|
-
*
|
|
14
|
+
* In the framework wrappers the same events arrive as callback props (`mouseClicked`, `selectionChanged` …),
|
|
15
|
+
* Vue events, Angular outputs or bubbling `CustomEvent`s of the Web Component.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* class OrderEvents extends EventAdapter {
|
|
19
|
+
* override onMouseClicked(evt: GeMouseEvent): void {
|
|
20
|
+
* if (evt.areaIdent === "body" && evt.clickCount === 2) {
|
|
21
|
+
* const order = tableModel.getBodyModel().getRowByIndex(evt.rowIndex); // displayed row → object
|
|
22
|
+
* console.log("double-click on", order);
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* override onSelectionChanged(model: SelectionModelIf): void {
|
|
26
|
+
* console.log(model.getRanges());
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* new TableScope(host, tableModel, new SimpleDomService(), new TableOptions(), new OrderEvents()).firstInit();
|
|
30
|
+
*
|
|
31
|
+
* @see Training: [Events and a context menu of your own](https://gui.expert/training/events-and-context-menu/)
|
|
32
|
+
*
|
|
33
|
+
* @category Events
|
|
13
34
|
*/
|
|
14
35
|
export interface EventListenerIf extends EventFocusChangedListenerIf, EventSelectionChangedListenerIf {
|
|
36
|
+
/** Right-click on the table. Call `evt.originalEvent?.preventDefault()` to suppress the browser menu (e.g. for an own menu). */
|
|
15
37
|
onContextmenu(evt: GeMouseEvent): void;
|
|
38
|
+
/** The mouse moved over the table (cell under the mouse in `evt`). Called often – keep it cheap. */
|
|
16
39
|
onMouseMoved(evt: GeMouseEvent): void;
|
|
40
|
+
/** A drag with the mouse ended (column resize, column move or range selection). */
|
|
17
41
|
onMouseDraggingEnd(evt: GeMouseEvent): void;
|
|
42
|
+
/** The mouse is being dragged; `evt.draggingX` / `evt.draggingY` hold the distance. */
|
|
18
43
|
onMouseDragging(evt: GeMouseEvent): void;
|
|
44
|
+
/**
|
|
45
|
+
* A click on the table. A double-click on the same cell is reported again with `clickCount === 2`
|
|
46
|
+
* (after the first click with `clickCount === 1`).
|
|
47
|
+
*/
|
|
19
48
|
onMouseClicked(evt: GeMouseEvent): void;
|
|
49
|
+
/** Checked rows changed (row checkboxes, tree checkboxes) – the argument holds all checked rows. */
|
|
20
50
|
onCheckboxChanged(evt: any[]): void;
|
|
51
|
+
/** Cells were edited – `evt.cells` holds row and column index of each; the new value is already in the model (your row object). */
|
|
21
52
|
onModelChanged(evt: GeModelChangeEvent): void;
|
|
53
|
+
/** The table was scrolled. */
|
|
22
54
|
onScroll(evt: GeScrollEvent): void;
|
|
55
|
+
/** The selection changed – read it from {@link SelectionModelIf.getRanges}. */
|
|
23
56
|
onSelectionChanged(model: SelectionModelIf): void;
|
|
57
|
+
/** The focused cell changed – read it from {@link FocusModelIf.getFocus}. */
|
|
24
58
|
onFocusChanged(model: FocusModelIf): void;
|
|
59
|
+
/**
|
|
60
|
+
* The state of the table changed (column layout, sorting, scroll position, tree, checked or selected rows,
|
|
61
|
+
* header groups, custom data) – reported once after the changes settled, see {@link GeStateChangeEvent}.
|
|
62
|
+
* Save `evt.state` e.g. on your server and pass it back as {@link TableOptionsIf.initialState}.
|
|
63
|
+
* @since 1.1.92
|
|
64
|
+
*/
|
|
65
|
+
onStateChanged?(evt: GeStateChangeEvent): void;
|
|
25
66
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CoverGridTableModel } from '../data/tablemodel/cover-grid-table-model';
|
|
2
|
-
import { CellRendererIf } from '../renderer/cell-render.if';
|
|
3
|
-
import { TableOptionsIf } from '../data/options/table-options.if';
|
|
1
|
+
import { CoverGridTableModel } from '../data/tablemodel/cover-grid-table-model.js';
|
|
2
|
+
import { CellRendererIf } from '../renderer/cell-render.if.js';
|
|
3
|
+
import { TableOptionsIf } from '../data/options/table-options.if.js';
|
|
4
4
|
|
|
5
|
+
/** @category Table model */
|
|
5
6
|
export declare class CoverGridFactory {
|
|
6
7
|
static createCoverGridModel<T>(items: T[], cellRenderer: CellRendererIf, coverWidth?: number, coverHeight?: number, width?: number, firstRowPaddingTop?: number): CoverGridTableModel<T>;
|
|
7
8
|
static createCoverGrisDefaultOptions(defaultRowHeight: number, getStorageKeyFn?: () => string): TableOptionsIf;
|
|
@@ -1,69 +1,123 @@
|
|
|
1
|
-
import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if';
|
|
2
|
-
import { DefaultRowHeightsIf } from '../data/options/default-row-heights.if';
|
|
3
|
-
import { ColumnDefIf } from '../data/tablemodel/column/column-def.if';
|
|
4
|
-
import { GetT } from '../data/common/get-t';
|
|
5
|
-
import { TableOptionsIf } from '../data/options/table-options.if';
|
|
6
|
-
import { TableModelIf } from '../data/tablemodel/table-model.if';
|
|
7
|
-
import { TableModel } from '../data/tablemodel/table-model';
|
|
8
|
-
import { SelectionModelIf } from '../selection/selection-model.if';
|
|
1
|
+
import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if.js';
|
|
2
|
+
import { DefaultRowHeightsIf } from '../data/options/default-row-heights.if.js';
|
|
3
|
+
import { ColumnDefIf } from '../data/tablemodel/column/column-def.if.js';
|
|
4
|
+
import { GetT } from '../data/common/get-t.js';
|
|
5
|
+
import { TableOptionsIf } from '../data/options/table-options.if.js';
|
|
6
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if.js';
|
|
7
|
+
import { TableModel } from '../data/tablemodel/table-model.js';
|
|
8
|
+
import { SelectionModelIf } from '../selection/selection-model.if.js';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Parameters of {@link TableFactory.createTableModel} – pass any subset (`Partial<CreateTableModelPara>`).
|
|
12
|
+
*
|
|
13
|
+
* Three typical combinations:
|
|
14
|
+
*
|
|
15
|
+
* | You have … | Pass | Training |
|
|
16
|
+
* |---|---|---|
|
|
17
|
+
* | an array of objects | `rows` (+ `properties` or `columnDefs`) | [chapter 12](https://gui.expert/training/array-to-table-model/), [13](https://gui.expert/training/column-definitions/) |
|
|
18
|
+
* | rows of values (CSV, matrix) | `headerData`, `bodyData`, `footerData`, `columnSizes` | [chapter 14](https://gui.expert/training/array-of-arrays/) |
|
|
19
|
+
* | own area models | `headerAreaModel`, `bodyAreaModel`, `footerAreaModel` + `columnDefs` | [chapter 15–17](https://gui.expert/training/custom-area-model/) |
|
|
20
|
+
*
|
|
21
|
+
* Everything not given is derived: column definitions from `properties` or the keys of the first row
|
|
22
|
+
* (header label = key in upper case, width 200 px), area models from the data, row heights from
|
|
23
|
+
* `tableOptions.defaultRowHeights`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const tableModel = TableFactory.createTableModel({
|
|
27
|
+
* rows: orders, // Order[]
|
|
28
|
+
* columnDefs: [new ColumnDef("id", "ID", px80, allRight), new ColumnDef("customer", "Customer", px180)],
|
|
29
|
+
* fixedLeftColumnCount: 1,
|
|
30
|
+
* tableOptions
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* @category Table model
|
|
34
|
+
*/
|
|
35
|
+
export interface CreateTableModelPara {
|
|
36
|
+
/** Model of the header. Default: one header row from the `headerLabel`s of `columnDefs`, or `headerData`. */
|
|
11
37
|
headerAreaModel: AreaModelIf;
|
|
38
|
+
/** Model of the body. Default: built from `rows` (objects or tree rows) or `bodyData`. See {@link AreaModel} for own models. */
|
|
12
39
|
bodyAreaModel: AreaModelIf;
|
|
40
|
+
/** Model of the footer. Default: `footerData`, otherwise no footer. Totals that follow the filter: an own {@link AreaModel}. */
|
|
13
41
|
footerAreaModel: AreaModelIf;
|
|
42
|
+
/** Number of columns fixed on the left (side "west"). Default 0. */
|
|
14
43
|
fixedLeftColumnCount: number;
|
|
44
|
+
/** Number of columns fixed on the right (side "east"). Default 0. */
|
|
15
45
|
fixedRightColumnCount: number;
|
|
46
|
+
/** Show a checkbox column for every row. Default false. */
|
|
16
47
|
rowCheckboxVisible: boolean;
|
|
48
|
+
/** Row heights of header, body and footer in px. Default: `tableOptions.defaultRowHeights`, otherwise 34 / 34 / 34. */
|
|
17
49
|
defaultRowHeights: DefaultRowHeightsIf;
|
|
50
|
+
/** The columns: property, header label, width, classes, renderers, sorting, editing. See {@link ColumnDef}. */
|
|
18
51
|
columnDefs: ColumnDefIf[];
|
|
52
|
+
/** Column widths in px – the simple alternative to `columnDefs` (e.g. with `bodyData`). */
|
|
19
53
|
columnSizes: number[];
|
|
54
|
+
/** A width in px for all columns; -1 (default) = use the column definitions. */
|
|
20
55
|
overridingColumnWidth: number;
|
|
56
|
+
/** Number of columns. Default: derived from `columnDefs`, `headerData` or `columnSizes`. */
|
|
21
57
|
columnCount: number;
|
|
58
|
+
/** Width of the parent element in px, used for percentage column widths before the first render (default 400). */
|
|
22
59
|
parentSize: number;
|
|
60
|
+
/** Selection model factory. Default: `tableOptions.getSelectionModel`. */
|
|
23
61
|
getSelectionModel: GetT<SelectionModelIf>;
|
|
62
|
+
/** The rows as objects (`T[]`) or tree rows from {@link TreeFactory.buildTreeRows}. */
|
|
24
63
|
rows: any[];
|
|
64
|
+
/** Which properties of `rows` become columns, in this order (ignored if `columnDefs` is given). */
|
|
25
65
|
properties: string[];
|
|
66
|
+
/** The body as rows of values (`any[][]`). */
|
|
26
67
|
bodyData: any[][];
|
|
68
|
+
/** Header rows as values – several rows are possible. */
|
|
27
69
|
headerData: string[][];
|
|
70
|
+
/** Footer rows as values (static – they don't follow filter or edits). */
|
|
28
71
|
footerData: string[][];
|
|
72
|
+
/** Options of the table; the factory reads `defaultRowHeights`, `getSelectionModel` and `showCheckboxWihoutExtraColumn`. */
|
|
29
73
|
tableOptions: TableOptionsIf;
|
|
30
|
-
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Creates {@link TableModelIf table models} from data – the usual way to start a table.
|
|
77
|
+
*
|
|
78
|
+
* - {@link createTableModel} – the universal entry point with named parameters ({@link CreateTableModelPara}).
|
|
79
|
+
* - {@link buildByTypedRows} – rows + column definitions (+ options, fixed columns).
|
|
80
|
+
* - {@link createByObjectArray} – rows + header/footer rows as data.
|
|
81
|
+
* - {@link createByAreaModels} – three area models of your own.
|
|
82
|
+
*
|
|
83
|
+
* Trees: build the rows with {@link TreeFactory.buildTreeRows} first, then pass them as `rows`.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // all keys of the first row become columns
|
|
87
|
+
* const simple = TableFactory.createTableModel({ rows: orders });
|
|
88
|
+
*
|
|
89
|
+
* // choose and order the columns – typed
|
|
90
|
+
* const properties: (keyof Order)[] = ["id", "date", "customer", "total"];
|
|
91
|
+
* const selected = TableFactory.createTableModel({ rows: orders, properties });
|
|
92
|
+
*
|
|
93
|
+
* // rows of values with a header and a footer row
|
|
94
|
+
* const csv = TableFactory.createTableModel({
|
|
95
|
+
* headerData: [["ID", "City"]],
|
|
96
|
+
* bodyData: [[1, "Berlin"], [2, "Paris"]],
|
|
97
|
+
* footerData: [["", "2 rows"]],
|
|
98
|
+
* columnSizes: [80, 160]
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* @see Training: [Array<T> → TableModel](https://gui.expert/training/array-to-table-model/),
|
|
102
|
+
* [Array of arrays](https://gui.expert/training/array-of-arrays/)
|
|
103
|
+
*
|
|
104
|
+
* @category Table model
|
|
105
|
+
*/
|
|
31
106
|
export declare class TableFactory {
|
|
32
107
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* This class is responsible for creating table models based on various
|
|
36
|
-
* parameters and configurations. TableFactory provides different methods
|
|
37
|
-
* to create these models that must comply with TableModelIf interface.
|
|
38
|
-
*
|
|
39
|
-
* Methods:
|
|
40
|
-
*
|
|
41
|
-
* createTableModel(p: Partial<{...}>): TableModelIf
|
|
42
|
-
* Receives a set of parameters as a Partial object with a number of properties
|
|
43
|
-
* and returns an instance of an object that complies to TableModelIf interface.
|
|
44
|
-
* Refer to the method's documentation for details.
|
|
45
|
-
*
|
|
46
|
-
* buildByTypedRowsParam(param: {rows: T[]; columnDefs: ColumnDefIf[]; tableOptions?: TableOptionsIf; fixedLeftColumnCount?: number; fixedRightColumnCount?: number}): TableModelIf
|
|
47
|
-
* Receives a parameter object with essential properties needed to build the table model,
|
|
48
|
-
* including rows (type T array), column definitions (ColumnDefIf array),
|
|
49
|
-
* optional table options (TableOptionsIf object), and optional fixed column counts,
|
|
50
|
-
* and returns an instance of TableModelIf.
|
|
108
|
+
* Creates a table model from any subset of {@link CreateTableModelPara}.
|
|
109
|
+
* Missing parts are derived (see {@link CreateTableModelPara}).
|
|
51
110
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
111
|
+
* @param p - rows, column definitions, area models, fixed columns, options …
|
|
112
|
+
* @returns the table model for `new TableScope(host, tableModel, …)` or the `tableModel` input of a framework wrapper
|
|
54
113
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Similar to `createByAreaModels` but accepts an object parameter with the required and optional properties to create the table model.
|
|
63
|
-
*
|
|
64
|
-
* createByObjectArray(rows: T[], header: string[][], footer: string[][], fixedLeftColumnCount: number, fixedRightColumnCount: number, rowCheckboxVisible: boolean, defaultRowHeights: DefaultRowHeightsIf): TableModelIf
|
|
65
|
-
* Allows to create a table model utilizing object array data for rows, header, and footer along with the specified configurations.
|
|
66
|
-
* Please consult each method's documentation for detailed explanation of their functionality.
|
|
114
|
+
* @example
|
|
115
|
+
* const tableModel = TableFactory.createTableModel({
|
|
116
|
+
* rows: orders,
|
|
117
|
+
* columnDefs,
|
|
118
|
+
* fixedLeftColumnCount: 1,
|
|
119
|
+
* footerAreaModel: new OrderTotalsFooterModel(() => tableModel.getBodyModel())
|
|
120
|
+
* });
|
|
67
121
|
*/
|
|
68
122
|
static createTableModel(p: Partial<CreateTableModelPara>): TableModelIf;
|
|
69
123
|
/**
|
|
@@ -156,16 +210,8 @@ export declare class TableFactory {
|
|
|
156
210
|
* rowCheckboxVisible: true,
|
|
157
211
|
* defaultRowHeights: new DefaultRowHeights(40, 50, 40),
|
|
158
212
|
* columnDefs: [
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* headerLabel: 'Name',
|
|
162
|
-
* width: 100
|
|
163
|
-
* },
|
|
164
|
-
* {
|
|
165
|
-
* property: 'age',
|
|
166
|
-
* headerLabel: 'Age',
|
|
167
|
-
* width: 50
|
|
168
|
-
* }
|
|
213
|
+
* new ColumnDef('name', 'Name', px100),
|
|
214
|
+
* new ColumnDef('age', 'Age', px50)
|
|
169
215
|
* ],
|
|
170
216
|
* columnSizes: [100, 50]
|
|
171
217
|
* };
|
|
@@ -307,19 +353,12 @@ export declare class TableFactory {
|
|
|
307
353
|
*
|
|
308
354
|
* Note: You need to import the `AreaModelArrayOfArrays` and `AreaModelHidden` classes from the respective package/module before using this method.
|
|
309
355
|
*
|
|
310
|
-
* @
|
|
311
|
-
* ```typescript
|
|
312
|
-
* // Given the following array of objects:
|
|
313
|
-
* const rows = [{field1: 'data11', field2: 'data12'}, {field1: 'data21', field2: 'data22'}];
|
|
314
|
-
*
|
|
315
|
-
* // And a set of column definitions:
|
|
316
|
-
* const columnDefs: ColumnDefIf[] = [{headerLabel: 'Field 1', property: 'field1'}, {headerLabel: 'Field 2', property: 'field2'}];
|
|
317
|
-
*
|
|
318
|
-
* // You can create a TableModel like following:
|
|
319
|
-
* let tableModel = TableFactory.createByObjectArray(rows, undefined, undefined, 0, 0, false, new DefaultRowHeights(), columnDefs);
|
|
320
|
-
* ```
|
|
356
|
+
* Simpler with named parameters: {@link createTableModel}.
|
|
321
357
|
*
|
|
322
|
-
*
|
|
358
|
+
* @example
|
|
359
|
+
* const rows = [{ field1: "data11", field2: "data12" }, { field1: "data21", field2: "data22" }];
|
|
360
|
+
* const columnDefs: ColumnDefIf[] = [new ColumnDef("field1", "Field 1"), new ColumnDef("field2", "Field 2")];
|
|
361
|
+
* const tableModel = TableFactory.createByObjectArray(rows, undefined, undefined, 0, 0, false, new DefaultRowHeights(), columnDefs);
|
|
323
362
|
*/
|
|
324
363
|
static createByObjectArray<T>(rows: T[], header: string[][] | undefined, footer: string[][] | undefined, fixedLeftColumnCount: number | undefined, fixedRightColumnCount: number | undefined, rowCheckboxVisible: boolean | undefined, defaultRowHeights: DefaultRowHeightsIf | undefined, columnDefs: ColumnDefIf[], columnSizes?: number[]): TableModel;
|
|
325
364
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { TreeRowIf } from '../data/common/tree-row-if';
|
|
1
|
+
import { TreeRowIf } from '../data/common/tree-row-if.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Expanded state of a new tree row: a fixed value for all rows, or a function per row
|
|
5
5
|
* (e.g. `(_data, deep) => deep < 1` → only the top level is open).
|
|
6
|
+
*
|
|
7
|
+
* @category Tree & checkboxes
|
|
6
8
|
*/
|
|
7
9
|
export type TreeRowExpandedFn<T> = (data: T, deep: number) => boolean;
|
|
8
10
|
/**
|
|
@@ -15,28 +17,68 @@ export type TreeRowExpandedFn<T> = (data: T, deep: number) => boolean;
|
|
|
15
17
|
* @example
|
|
16
18
|
* // open the first level only
|
|
17
19
|
* TreeFactory.buildTreeRows(data, { expanded: (_row, deep) => deep === 0 });
|
|
20
|
+
*
|
|
21
|
+
* @category Tree & checkboxes
|
|
18
22
|
*/
|
|
19
23
|
export interface TreeFactoryOptions<T> {
|
|
20
24
|
/** Property that holds the child objects. Default: "children". */
|
|
21
25
|
childrenProperty?: string;
|
|
22
26
|
/** Expanded state of the rows. Default: true (everything open, as before). */
|
|
23
27
|
expanded?: boolean | TreeRowExpandedFn<T>;
|
|
24
|
-
/** Maximum depth. Default: 12. */
|
|
28
|
+
/** Maximum depth of a row (0 = top level only); deeper children are skipped with a console warning. Default: 12. */
|
|
25
29
|
deepMaxLimit?: number;
|
|
26
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Turns hierarchical data into {@link TreeRow tree rows} for a tree table. Pass the result as `rows`
|
|
33
|
+
* to {@link TableFactory.createTableModel} – the factory then creates an {@link AreaModelTree}; the first
|
|
34
|
+
* column shows the arrows.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* interface Node { label: string; total: number; children?: Node[] }
|
|
38
|
+
*
|
|
39
|
+
* const rows = TreeFactory.buildTreeRows<Node>(nodes, {
|
|
40
|
+
* childrenProperty: "children",
|
|
41
|
+
* expanded: (row, deep) => deep === 0 // open only the first level
|
|
42
|
+
* });
|
|
43
|
+
* const tableModel = TableFactory.createTableModel({
|
|
44
|
+
* rows,
|
|
45
|
+
* columnDefs: [new ColumnDef("label", "Name", px300, bodyLeft), new ColumnDef("total", "Total", px120, allRight)]
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* @see Training: [Tree table with checkboxes](https://gui.expert/training/tree-table/)
|
|
49
|
+
*
|
|
50
|
+
* @category Tree & checkboxes
|
|
51
|
+
*/
|
|
27
52
|
export declare class TreeFactory {
|
|
28
53
|
/**
|
|
29
54
|
* Builds tree rows (input for `TableFactory.createTableModel({ rows })`) from nested objects.
|
|
30
55
|
*
|
|
31
56
|
* @param data - the top-level objects
|
|
32
57
|
* @param childrenPropertyOrOptions - name of the children property (default "children") or {@link TreeFactoryOptions}
|
|
33
|
-
* @param deepMaxLimit - maximum depth (default 12; ignored when options are passed)
|
|
58
|
+
* @param deepMaxLimit - maximum depth of a row, 0 = top level only (default 12; ignored when options are passed)
|
|
34
59
|
* @param expanded - expanded state of the rows (default true; ignored when options are passed)
|
|
35
60
|
*
|
|
36
61
|
* @example
|
|
37
62
|
* const rows = TreeFactory.buildTreeRows<OrderNode>(data, { childrenProperty: "children", expanded: false });
|
|
38
63
|
*/
|
|
39
64
|
static buildTreeRows<T>(data: T[], childrenPropertyOrOptions?: string | TreeFactoryOptions<T>, deepMaxLimit?: number, expanded?: boolean | TreeRowExpandedFn<T>): TreeRowIf<T>[];
|
|
65
|
+
/**
|
|
66
|
+
* Appends the child rows of `data` (recursively) to `parent` – used by {@link buildTreeRows}.
|
|
67
|
+
* No row deeper than `deepMaxLimit` is created: the children of a row at depth `deepMaxLimit` are
|
|
68
|
+
* skipped with a console warning.
|
|
69
|
+
*
|
|
70
|
+
* @param data - the object whose children are added
|
|
71
|
+
* @param childrenProperty - name of the children property (default "children")
|
|
72
|
+
* @param parent - the tree row of `data` (default: a new, expanded top-level row)
|
|
73
|
+
* @param deep - depth of `parent` (0 = top level)
|
|
74
|
+
* @param deepMaxLimit - maximum depth of a created row (default 12)
|
|
75
|
+
* @param expanded - expanded state of the new rows (default true)
|
|
76
|
+
* @returns `parent`
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const root = TreeFactory.buildTreeRow<OrderNode>(nodes[0], "children");
|
|
80
|
+
* console.log(root.children?.length);
|
|
81
|
+
*/
|
|
40
82
|
static buildTreeRow<T>(data: T, childrenProperty?: string, parent?: TreeRowIf<T>, deep?: number, deepMaxLimit?: number, expanded?: boolean | TreeRowExpandedFn<T>): TreeRowIf<T>;
|
|
41
83
|
private static toExpandedFn;
|
|
42
84
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FocusModelIf } from './focus-model.if';
|
|
1
|
+
import { FocusModelIf } from './focus-model.if.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `EventFocusChangedListenerIf` is an interface that defines a contract for classes that wish to listen for changes in focus in a
|
|
@@ -29,11 +29,13 @@ import { FocusModelIf } from './focus-model.if';
|
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* ## See Also
|
|
32
|
-
* -
|
|
33
|
-
* -
|
|
32
|
+
* - {@link FocusModelIf} for focus management.
|
|
33
|
+
* - {@link EventAdapter} for a class that implements this and other listener interfaces.
|
|
34
34
|
*
|
|
35
35
|
* @interface
|
|
36
36
|
* @method onFocusChanged - method to be called with an instance of the `FocusModelIf` interface whenever a focus event occurs
|
|
37
|
+
*
|
|
38
|
+
* @category Events
|
|
37
39
|
*/
|
|
38
40
|
export interface EventFocusChangedListenerIf {
|
|
39
41
|
onFocusChanged(model: FocusModelIf): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FocusType } from './focus.type';
|
|
2
|
-
import { FocusModelIf } from './focus-model.if';
|
|
3
|
-
import { EventFocusChangedListenerIf } from './event-focus-changed-listener.if';
|
|
1
|
+
import { FocusType } from './focus.type.js';
|
|
2
|
+
import { FocusModelIf } from './focus-model.if.js';
|
|
3
|
+
import { EventFocusChangedListenerIf } from './event-focus-changed-listener.if.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The `FocusModel` class is an implementation of the `FocusModelIf` interface.
|
|
@@ -40,11 +40,13 @@ import { EventFocusChangedListenerIf } from './event-focus-changed-listener.if';
|
|
|
40
40
|
* focusModel.setFocus(2, 3);
|
|
41
41
|
* ```
|
|
42
42
|
*
|
|
43
|
-
* @see
|
|
44
|
-
* @see
|
|
43
|
+
* @see {@link FocusType}
|
|
44
|
+
* @see {@link EventFocusChangedListenerIf}
|
|
45
45
|
*
|
|
46
46
|
* @class
|
|
47
47
|
* @implements {FocusModelIf}
|
|
48
|
+
*
|
|
49
|
+
* @category Selection & focus
|
|
48
50
|
*/
|
|
49
51
|
export declare class FocusModel implements FocusModelIf {
|
|
50
52
|
selectionType: FocusType;
|
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
import { EventFocusChangedListenerIf } from './event-focus-changed-listener.if';
|
|
1
|
+
import { EventFocusChangedListenerIf } from './event-focus-changed-listener.if.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The focused cell of a table (moved by click and arrow keys; F2 edits it). The implementation is {@link FocusModel};
|
|
5
|
+
* changes are reported to {@link EventListenerIf.onFocusChanged}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* override onFocusChanged(model: FocusModelIf): void {
|
|
9
|
+
* const [row, col] = model.getFocus();
|
|
10
|
+
* console.log(`focus on row ${row}, column ${col}`);
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* @category Selection & focus
|
|
14
|
+
*/
|
|
3
15
|
export interface FocusModelIf {
|
|
16
|
+
/** The registered listeners. */
|
|
4
17
|
getEventFocusChangedListeners(): EventFocusChangedListenerIf[];
|
|
18
|
+
/** Get notified when the focus moves. */
|
|
5
19
|
addEventFocusChangedListener(listener: EventFocusChangedListenerIf): void;
|
|
20
|
+
/** Stop notifications. */
|
|
6
21
|
removeEventFocusChangedListener(listener: EventFocusChangedListenerIf): void;
|
|
22
|
+
/** No cell has the focus afterwards. */
|
|
7
23
|
clear(): void;
|
|
24
|
+
/** Moves the focus to a body cell. */
|
|
8
25
|
setFocus(rowIndex: number, columnIndex: number): void;
|
|
26
|
+
/** Has this cell the focus? */
|
|
9
27
|
hasFocus(rowIndex: number, columnIndex: number): boolean;
|
|
28
|
+
/** `[rowIndex, columnIndex]` of the focused cell (-1 if none). */
|
|
10
29
|
getFocus(): [number, number];
|
|
30
|
+
/** Did the focus change since {@link clearChanged}? */
|
|
11
31
|
hasChanged(): boolean;
|
|
32
|
+
/** Resets {@link hasChanged}. */
|
|
12
33
|
clearChanged(): void;
|
|
13
34
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { TableScope } from './table-scope';
|
|
1
|
+
import { TableScope } from './table-scope.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Class representing an input handler for table input fields (HTMLSelectElement, HTMLTextAreaElement, HTMLInputElement).
|
|
5
5
|
*
|
|
6
6
|
* @class
|
|
7
7
|
* @memberOf module:input
|
|
8
|
+
*
|
|
9
|
+
* @category Internals
|
|
8
10
|
*/
|
|
9
11
|
export declare class InputHandler {
|
|
10
12
|
protected tableScope: TableScope;
|
|
11
13
|
constructor(tableScope: TableScope);
|
|
14
|
+
/** Escape in the cell editor cancels the editing: the old value stays, nothing is committed. */
|
|
15
|
+
private onHostElementKeyDown;
|
|
12
16
|
/**
|
|
13
17
|
* Handles the onHostElementChanged event.
|
|
14
18
|
* In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @param {any} row - The row to be checked.
|
|
5
5
|
*
|
|
6
6
|
* @return {boolean} - true if the row is a tree row, false otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @category Utilities
|
|
7
9
|
*/
|
|
8
10
|
export declare function isTreeRow(row: any): boolean;
|
|
9
11
|
/**
|
|
@@ -11,6 +13,8 @@ export declare function isTreeRow(row: any): boolean;
|
|
|
11
13
|
*
|
|
12
14
|
* @param {any} model - The model object to check.
|
|
13
15
|
* @return {boolean} - True if the model is an AreaModelTree, false otherwise.
|
|
16
|
+
*
|
|
17
|
+
* @category Utilities
|
|
14
18
|
*/
|
|
15
19
|
export declare function isAreaModelTree(model: any): boolean;
|
|
16
20
|
/**
|
|
@@ -18,5 +22,17 @@ export declare function isAreaModelTree(model: any): boolean;
|
|
|
18
22
|
*
|
|
19
23
|
* @param {any} o - The object to be checked.
|
|
20
24
|
* @returns {boolean} - True if the object is a CheckboxColumnDef, false otherwise.
|
|
25
|
+
*
|
|
26
|
+
* @category Utilities
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* True for a {@link CheckboxCellRenderer} – also from another copy of the core (no `instanceof`).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* isCheckboxCellRenderer(new CheckboxCellRenderer()); // true
|
|
33
|
+
*
|
|
34
|
+
* @since 1.1.91
|
|
35
|
+
* @category Utilities
|
|
21
36
|
*/
|
|
37
|
+
export declare function isCheckboxCellRenderer(o: any): boolean;
|
|
22
38
|
export declare function isCheckboxColumnDef(o: any): boolean;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { TableScope } from './table-scope';
|
|
2
|
-
import { GeMouseEvent } from './data/common/event/ge-mouse-event';
|
|
1
|
+
import { TableScope } from './table-scope.js';
|
|
2
|
+
import { GeMouseEvent } from './data/common/event/ge-mouse-event.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Class representing a MouseHandler.
|
|
6
6
|
* @class
|
|
7
|
+
*
|
|
8
|
+
* @category Internals
|
|
7
9
|
*/
|
|
8
10
|
export declare class MouseHandler {
|
|
9
11
|
protected tableScope: TableScope;
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Programmatic clicks (`element.click()`, `event.detail === 0`): two clicks on the same cell within this delay (ms)
|
|
14
|
+
* count as a double click. Real mouse clicks use the click count of the browser (`event.detail`), i.e. the
|
|
15
|
+
* double-click speed of the operating system.
|
|
12
16
|
*
|
|
13
17
|
* @type {number}
|
|
14
18
|
*/
|
|
@@ -17,9 +21,11 @@ export declare class MouseHandler {
|
|
|
17
21
|
startMouseEvent?: GeMouseEvent;
|
|
18
22
|
geMouseEvent?: GeMouseEvent;
|
|
19
23
|
geMouseEventOld?: GeMouseEvent;
|
|
20
|
-
private expandedAll;
|
|
21
24
|
private lastClickedCellKey;
|
|
25
|
+
/** The second click of a double click that was already reported (clickCount 2) – its "dblclick" is not. */
|
|
26
|
+
private reportedDoubleClick?;
|
|
22
27
|
private mouseDown;
|
|
28
|
+
private repaintAfterMouseUp;
|
|
23
29
|
private dragging;
|
|
24
30
|
constructor(tableScope: TableScope);
|
|
25
31
|
/**
|
|
@@ -39,6 +45,10 @@ export declare class MouseHandler {
|
|
|
39
45
|
* @return {void}
|
|
40
46
|
*/
|
|
41
47
|
private onHostElementClicked;
|
|
48
|
+
/** "area:row:column" of the cell of an event target ('' outside of a cell). */
|
|
49
|
+
private getCellKey;
|
|
50
|
+
/** A click that triggers an action on its own: row checkbox, tree arrow, "expand/collapse all", header group toggle. */
|
|
51
|
+
private isClickAction;
|
|
42
52
|
/**
|
|
43
53
|
* Handles the double click event on the host element.
|
|
44
54
|
* This method is private.
|
|
@@ -56,12 +66,11 @@ export declare class MouseHandler {
|
|
|
56
66
|
*/
|
|
57
67
|
private publishGeMouseEvent;
|
|
58
68
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @returns {void}
|
|
69
|
+
* True if the click went to a form control, button, link or editable element inside the table (e.g. rendered by
|
|
70
|
+
* a custom cell renderer or the cell editor). Such a click must not repaint: the repaint re-creates the cells,
|
|
71
|
+
* the element would lose the focus and the user's input.
|
|
63
72
|
*/
|
|
64
|
-
private
|
|
73
|
+
private isInteractiveCellElement;
|
|
65
74
|
private getArrowColumnIndex;
|
|
66
75
|
private onMouseDown;
|
|
67
76
|
private onMouseMove;
|
|
@@ -69,4 +78,6 @@ export declare class MouseHandler {
|
|
|
69
78
|
private mouseDraggingOnFrame;
|
|
70
79
|
private mouseDraggingEndOnFrame;
|
|
71
80
|
private mouseMoveOnFrame;
|
|
81
|
+
/** A mouse event on a blocking loading overlay ({@link TableOverlay.isEventBlocked}): the table ignores it. */
|
|
82
|
+
private isBlocked;
|
|
72
83
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GeOverlayKind } from './ge-overlay-kind.type.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Input of {@link calcOverlayKind}.
|
|
5
|
+
*
|
|
6
|
+
* @since 1.1.92
|
|
7
|
+
* @category Internals
|
|
8
|
+
*/
|
|
9
|
+
export interface OverlayKindInput {
|
|
10
|
+
/** The overlay requested by the API ({@link TableApi.showLoadingOverlay}, {@link TableApi.showNoRowsOverlay}). */
|
|
11
|
+
manual?: "loading" | "noRows";
|
|
12
|
+
/** `getRowCount()` of the body (after the filter); < 0 = unknown. */
|
|
13
|
+
rowCount: number;
|
|
14
|
+
/** `getUnfilteredRowCount()` of the body, `undefined` if the model cannot tell. */
|
|
15
|
+
unfilteredRowCount?: number;
|
|
16
|
+
/** {@link OverlayOptionsIf.autoNoRows} */
|
|
17
|
+
autoNoRows: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decides which overlay the table shows. Order: a manual overlay > "no matching rows" > "no rows to show".
|
|
21
|
+
* A model that cannot tell its unfiltered row count gets "no rows" (never a wrong "no matching rows"),
|
|
22
|
+
* an unknown row count (< 0) no overlay.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* calcOverlayKind({ rowCount: 0, unfilteredRowCount: 100, autoNoRows: true }); // "noMatches"
|
|
26
|
+
* calcOverlayKind({ manual: "loading", rowCount: 0, autoNoRows: true }); // "loading"
|
|
27
|
+
*
|
|
28
|
+
* @since 1.1.92
|
|
29
|
+
* @category Internals
|
|
30
|
+
*/
|
|
31
|
+
export declare function calcOverlayKind(input: OverlayKindInput): GeOverlayKind;
|