@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,16 +1,17 @@
|
|
|
1
|
-
import { DomServiceIf } from './dom-service.if';
|
|
2
|
-
import { DivScope } from './../data/div-scope.type';
|
|
3
|
-
import { GeoData } from './../data/geo-data';
|
|
4
|
-
import { TreeArrowType } from '../data/common/tree-arrow.type';
|
|
5
|
-
import { TreeOptionsIf } from '../data/options/tree-options.if';
|
|
6
|
-
import { AreaIdent } from '../data/tablemodel/area-ident.type';
|
|
7
|
-
import { TableOptionsIf } from '../data/options/table-options.if';
|
|
8
|
-
import { CheckedType } from '../data/common/checked-type';
|
|
9
|
-
import { SideIdent } from '../data/side-ident.type';
|
|
10
|
-
import { SortState } from '../data/common/sort-state.type';
|
|
11
|
-
import { SortedOptionsIf } from '../data/options/sorted-options.if';
|
|
12
|
-
import { HtmlStyle } from './data/html-style.type';
|
|
1
|
+
import { DomServiceIf } from './dom-service.if.js';
|
|
2
|
+
import { DivScope } from './../data/div-scope.type.js';
|
|
3
|
+
import { GeoData } from './../data/geo-data.js';
|
|
4
|
+
import { TreeArrowType } from '../data/common/tree-arrow.type.js';
|
|
5
|
+
import { TreeOptionsIf } from '../data/options/tree-options.if.js';
|
|
6
|
+
import { AreaIdent } from '../data/tablemodel/area-ident.type.js';
|
|
7
|
+
import { TableOptionsIf } from '../data/options/table-options.if.js';
|
|
8
|
+
import { CheckedType } from '../data/common/checked-type.js';
|
|
9
|
+
import { SideIdent } from '../data/side-ident.type.js';
|
|
10
|
+
import { SortState } from '../data/common/sort-state.type.js';
|
|
11
|
+
import { SortedOptionsIf } from '../data/options/sorted-options.if.js';
|
|
12
|
+
import { HtmlStyle } from './data/html-style.type.js';
|
|
13
13
|
|
|
14
|
+
/** @category DOM */
|
|
14
15
|
export interface AddColumnDivPara {
|
|
15
16
|
parent: HTMLDivElement;
|
|
16
17
|
geo: GeoData;
|
|
@@ -23,9 +24,14 @@ export interface AddColumnDivPara {
|
|
|
23
24
|
tableOptions?: TableOptionsIf;
|
|
24
25
|
checkedType?: CheckedType | undefined;
|
|
25
26
|
sortState?: SortState;
|
|
27
|
+
/** Accessible name of the row checkbox (`showCheckboxWihoutExtraColumn`), e.g. "Select row 5". @since 1.1.91 */
|
|
28
|
+
checkboxAriaLabel?: string;
|
|
26
29
|
}
|
|
30
|
+
/** @category DOM */
|
|
27
31
|
export declare class ConvenienceDomService {
|
|
28
32
|
readonly domService: DomServiceIf;
|
|
33
|
+
/** Width of the focus frame of a cell in px (WCAG 2.4.7: visible focus, not only a color). @since 1.1.91 */
|
|
34
|
+
static focusBorderWidthInPx: number;
|
|
29
35
|
constructor(domService: DomServiceIf);
|
|
30
36
|
setStyle(el: any, style: string, value: any): any;
|
|
31
37
|
applyStyle(ele: HTMLDivElement, style: HtmlStyle): HTMLDivElement;
|
|
@@ -35,7 +41,7 @@ export declare class ConvenienceDomService {
|
|
|
35
41
|
applyStylePosistionRelative(ele: HTMLDivElement): HTMLDivElement;
|
|
36
42
|
applyStylePosistionAbsolute(ele: HTMLDivElement): HTMLDivElement;
|
|
37
43
|
applyStyleFullSize(ele: HTMLDivElement): HTMLDivElement;
|
|
38
|
-
applyStyleOverflowAuto(overflowX: "
|
|
44
|
+
applyStyleOverflowAuto(overflowX: "scroll" | "auto" | undefined, overflowY: "scroll" | "auto" | undefined, ele: HTMLDivElement): HTMLDivElement;
|
|
39
45
|
applyStyleNoPadding(ele: HTMLDivElement): HTMLDivElement;
|
|
40
46
|
appendRelativeChildDiv(parent: HTMLDivElement): DivScope;
|
|
41
47
|
appendText(parent: HTMLDivElement, text: string): HTMLElement;
|
|
@@ -43,16 +49,33 @@ export declare class ConvenienceDomService {
|
|
|
43
49
|
removeClass(clazz: string, div: HTMLDivElement): HTMLDivElement;
|
|
44
50
|
addClasses(classes: string[] | undefined, div: HTMLDivElement): HTMLDivElement;
|
|
45
51
|
setAttribute(div: HTMLDivElement, key: string, value: string): HTMLDivElement;
|
|
52
|
+
/**
|
|
53
|
+
* Removes an attribute (via {@link DomServiceIf.removeAttribute} if the DOM service has it).
|
|
54
|
+
*
|
|
55
|
+
* @since 1.1.91
|
|
56
|
+
*/
|
|
57
|
+
removeAttribute(ele: HTMLElement, key: string): HTMLElement;
|
|
58
|
+
/**
|
|
59
|
+
* Hides a purely decorative element (border, hover, icon …) from screen readers: `aria-hidden="true"`.
|
|
60
|
+
*
|
|
61
|
+
* @since 1.1.91
|
|
62
|
+
*/
|
|
63
|
+
setAriaHidden<T extends HTMLElement>(ele: T): T;
|
|
46
64
|
createAreaDivWithClass(clazz: string, parent: HTMLDivElement, areaIdent: AreaIdent, sideIdent: SideIdent): HTMLDivElement;
|
|
47
65
|
createDivWithClass(clazz: string, parent: HTMLDivElement): HTMLDivElement;
|
|
48
66
|
addRowDiv(divScope: DivScope, geo: GeoData, rowIndex: number | undefined, areaIdent: AreaIdent, sideIdent: SideIdent, text?: string): HTMLDivElement;
|
|
49
67
|
addColumnDiv(para: AddColumnDivPara): HTMLDivElement;
|
|
50
|
-
addCheckboxToDiv(parent: HTMLDivElement, checkedType: CheckedType, areaIdent: AreaIdent, rowIndex: number): HTMLDivElement;
|
|
68
|
+
addCheckboxToDiv(parent: HTMLDivElement, checkedType: CheckedType, areaIdent: AreaIdent, rowIndex: number, ariaLabel?: string): HTMLDivElement;
|
|
51
69
|
addLabelDiv(parent: HTMLDivElement, text?: string, firstTreeColumn?: boolean, rowIndex?: number, columnIndex?: number, areaIdent?: AreaIdent): HTMLDivElement;
|
|
52
70
|
addSortedIcon(parent: HTMLDivElement, sorted?: SortState, sortedOptions?: SortedOptionsIf, columnIndex?: number): HTMLDivElement;
|
|
53
71
|
addArrowDiv(parent: HTMLDivElement, arrow?: TreeArrowType, treeOptions?: TreeOptionsIf, rowIndex?: number, columnIndex?: number, areaIdent?: AreaIdent): HTMLDivElement;
|
|
54
72
|
addColumnBorderDivs(tableOptions: TableOptionsIf, parent: HTMLDivElement, geo: GeoData, areaIdent: AreaIdent, sideIdent: SideIdent): HTMLDivElement;
|
|
55
73
|
addHorizontalBorder(geo: GeoData, parent: HTMLDivElement, clazz?: string): HTMLDivElement;
|
|
74
|
+
/**
|
|
75
|
+
* Draws the focus frame of a cell: four divs with the class `ge-table-focus-border` (2 px, color
|
|
76
|
+
* `--ge-table-focus-outline-color` resp. `--ge-table-focus-border`). Hidden from screen readers – they get the
|
|
77
|
+
* focus through `aria-activedescendant`.
|
|
78
|
+
*/
|
|
56
79
|
addFocusBorderDivs(parent: HTMLDivElement, geo: GeoData, style: HtmlStyle): HTMLDivElement;
|
|
57
80
|
addVerticalBorder(geo: GeoData, parent: HTMLDivElement, clazz?: string): HTMLDivElement;
|
|
58
81
|
addDiv(parent: HTMLDivElement, geo: GeoData, clazz?: string): HTMLDivElement;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import { TableModelIf } from '../data/tablemodel/table-model.if';
|
|
2
|
-
import { SelectionModelIf } from '../selection/selection-model.if';
|
|
3
|
-
import { FocusModelIf } from '../focus/focus-model.if';
|
|
4
|
-
import { CopyServiceIf } from './copy-service.if';
|
|
1
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if.js';
|
|
2
|
+
import { SelectionModelIf } from '../selection/selection-model.if.js';
|
|
3
|
+
import { FocusModelIf } from '../focus/focus-model.if.js';
|
|
4
|
+
import { CopyServiceIf } from './copy-service.if.js';
|
|
5
5
|
|
|
6
|
+
/** @category Export & clipboard */
|
|
6
7
|
export declare class CopyService implements CopyServiceIf {
|
|
8
|
+
/**
|
|
9
|
+
* Upper limit for the number of cells {@link createContent} copies (e.g. after Ctrl+A on a table with millions
|
|
10
|
+
* of rows). Larger selections are rejected instead of building a huge string and blocking the browser.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* CopyService.maxCopyCells = 5_000_000; // allow bigger copies
|
|
14
|
+
*/
|
|
15
|
+
static maxCopyCells: number;
|
|
7
16
|
static columnSeparatorChar: string;
|
|
8
17
|
static rowSeparatorChar: string;
|
|
9
18
|
/**
|
|
10
19
|
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
11
20
|
*
|
|
21
|
+
* - Selection: the bounding box of all selected ranges, one line per row, cells separated by TAB; cells inside the
|
|
22
|
+
* box that are not selected become empty strings, hidden columns are left out.
|
|
23
|
+
* - Everything selected ({@link SelectionModelIf.selectAll}, ⌘/Ctrl+A): all displayed body rows × all columns.
|
|
24
|
+
* - No selection: the text of the focused cell.
|
|
25
|
+
*
|
|
12
26
|
* @param {TableModelIf} tableModel - The table model for data retrieval.
|
|
13
27
|
* @param {SelectionModelIf} selectionModel - The selection model to determine the selected range.
|
|
14
28
|
* @param {FocusModelIf} focusModel - The focus model to determine the focused cell.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TableModelIf } from '../data/tablemodel/table-model.if';
|
|
2
|
-
import { SelectionModelIf } from '../selection/selection-model.if';
|
|
3
|
-
import { FocusModelIf } from '../focus/focus-model.if';
|
|
1
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if.js';
|
|
2
|
+
import { SelectionModelIf } from '../selection/selection-model.if.js';
|
|
3
|
+
import { FocusModelIf } from '../focus/focus-model.if.js';
|
|
4
4
|
|
|
5
|
+
/** @category Export & clipboard */
|
|
5
6
|
export interface CopyServiceIf {
|
|
6
7
|
/**
|
|
7
8
|
* Copies the selected data from the table to the clipboard.
|
|
@@ -1,10 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All DOM changes of the table go through this service – the third argument of `new TableScope(…)`.
|
|
3
|
+
* Plain TypeScript and most wrappers use {@link SimpleDomService}; Angular uses its `Renderer2`.
|
|
4
|
+
* Cell renderers get it as last argument of {@link CellRendererIf.render}.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // inside CellRendererIf.render(cellDiv, …, cellValue, dom)
|
|
8
|
+
* const badge = dom.createElement<HTMLSpanElement>("span");
|
|
9
|
+
* dom.addClass(badge, "status-badge");
|
|
10
|
+
* dom.setStyle(badge, "margin-left", "4px");
|
|
11
|
+
* badge.textContent = String(cellValue);
|
|
12
|
+
* dom.appendChild(cellDiv, badge);
|
|
13
|
+
*
|
|
14
|
+
* @category DOM
|
|
15
|
+
*/
|
|
1
16
|
export interface DomServiceIf {
|
|
17
|
+
/** Sets one CSS property: `setStyle(el, "background-color", "#fdf2f8")`. */
|
|
2
18
|
setStyle(el: any, style: string, value: any): any;
|
|
19
|
+
/** Adds a CSS class. */
|
|
3
20
|
addClass(div: HTMLElement, clazz: string): HTMLDivElement;
|
|
21
|
+
/** Removes a CSS class. */
|
|
4
22
|
removeClass(div: HTMLElement, clazz: string): HTMLDivElement;
|
|
23
|
+
/** Creates an element: `createElement<HTMLSpanElement>("span")`. */
|
|
5
24
|
createElement<T>(ele: string): T;
|
|
25
|
+
/** Creates a text node. */
|
|
6
26
|
createText(text: string): HTMLElement;
|
|
27
|
+
/** Appends text to an element (no HTML parsing). */
|
|
7
28
|
appendText(parent: HTMLDivElement, text: string): HTMLDivElement;
|
|
29
|
+
/** Appends a child element. */
|
|
8
30
|
appendChild(parent: HTMLElement, child: HTMLElement): void;
|
|
31
|
+
/** Sets an attribute. */
|
|
9
32
|
setAttribute(ele: HTMLElement, key: string, value: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Removes an attribute (used for ARIA attributes of reused row divs). Optional: without it the table calls
|
|
35
|
+
* `ele.removeAttribute(key)` itself.
|
|
36
|
+
*
|
|
37
|
+
* @since 1.1.91
|
|
38
|
+
*/
|
|
39
|
+
removeAttribute?(ele: HTMLElement, key: string): void;
|
|
10
40
|
}
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import { ExcelServiceIf } from './excel-service.if';
|
|
1
|
+
import { ExcelServiceIf } from './excel-service.if.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Writes real `.xlsx` files (Office Open XML) without any library – compressed with the browser's
|
|
5
|
+
* built-in `CompressionStream`. Numbers stay numbers, everything else becomes text.
|
|
6
|
+
*
|
|
7
|
+
* {@link TableApi.downloadExcel} exports what the table shows; use the ExcelService directly for any other data.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // all rows, own columns – independent of filter and sorting
|
|
11
|
+
* const body = tableApi.getBodyModel() as AreaModelObjectArray<Order>;
|
|
12
|
+
* const matrix = [
|
|
13
|
+
* ["ID", "Customer", "Total"],
|
|
14
|
+
* ...body.getAllRows().map(o => [o.id, o.customer, o.total])
|
|
15
|
+
* ];
|
|
16
|
+
* await new ExcelService().downloadExcel(matrix, "orders.xlsx", "GuiExpert");
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // a Blob instead of a download, e.g. for an upload
|
|
20
|
+
* const blob = await new ExcelService().createExcelBlob(matrix);
|
|
21
|
+
*
|
|
22
|
+
* @see Training: [Excel export without a library](https://gui.expert/training/excel-export/)
|
|
23
|
+
*
|
|
24
|
+
* @category Export & clipboard
|
|
25
|
+
*/
|
|
3
26
|
export declare class ExcelService implements ExcelServiceIf {
|
|
4
27
|
/**
|
|
5
28
|
* Downloads a matrix data as an Excel file.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes an Excel file from a matrix of values. The default implementation is {@link ExcelService};
|
|
3
|
+
* pass your own as last argument of the `TableScope` constructor to change how {@link TableApi.downloadExcel} exports.
|
|
4
|
+
*
|
|
5
|
+
* @category Export & clipboard
|
|
6
|
+
*/
|
|
1
7
|
export interface ExcelServiceIf {
|
|
8
|
+
/** Creates the file from `matrix` (rows of values) and hands it to the browser as download. */
|
|
2
9
|
downloadExcel(matrix: Array<Array<any>>, filename: string, author?: string): void | Promise<void>;
|
|
3
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DomServiceIf } from './dom-service.if';
|
|
1
|
+
import { DomServiceIf } from './dom-service.if.js';
|
|
2
2
|
|
|
3
|
+
/** @category DOM */
|
|
3
4
|
export declare class SimpleDomService implements DomServiceIf {
|
|
4
5
|
setStyle(el: any, style: string, value: any): any;
|
|
5
6
|
appendText(parent: HTMLDivElement, text: string): HTMLDivElement;
|
|
@@ -9,4 +10,5 @@ export declare class SimpleDomService implements DomServiceIf {
|
|
|
9
10
|
createElement<T>(name: string): T;
|
|
10
11
|
createText(value: string): any;
|
|
11
12
|
setAttribute(ele: HTMLElement, key: string, value: string): void;
|
|
13
|
+
removeAttribute(ele: HTMLElement, key: string): void;
|
|
12
14
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AbstractStoreStateService } from './abstract-store-state.service';
|
|
2
|
-
import { CollapsedExpandedData } from './data/collapsed-expanded.data';
|
|
3
|
-
import { GetStorageKeyFn } from '../data/options/auto-restore-options.if';
|
|
1
|
+
import { AbstractStoreStateService } from './abstract-store-state.service.js';
|
|
2
|
+
import { CollapsedExpandedData } from './data/collapsed-expanded.data.js';
|
|
3
|
+
import { GetStorageKeyFn } from '../data/options/auto-restore-options.if.js';
|
|
4
4
|
|
|
5
|
+
/** @category Internals */
|
|
5
6
|
export declare class StoreStateCollapsedExpandService extends AbstractStoreStateService {
|
|
6
7
|
private readonly COLLAPSED_EXPANDED_STATE;
|
|
7
8
|
private collapsedExpandedState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AbstractStoreStateService } from './abstract-store-state.service';
|
|
2
|
-
import { GetStorageKeyFn } from '../data/options/auto-restore-options.if';
|
|
1
|
+
import { AbstractStoreStateService } from './abstract-store-state.service.js';
|
|
2
|
+
import { GetStorageKeyFn } from '../data/options/auto-restore-options.if.js';
|
|
3
3
|
|
|
4
|
+
/** @category Internals */
|
|
4
5
|
export declare class StoreStateScrollPosService extends AbstractStoreStateService {
|
|
5
6
|
private readonly SCROLL_STATE;
|
|
6
7
|
private scrollOffset;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AbstractStoreStateService } from './abstract-store-state.service';
|
|
2
|
-
import { GetStorageKeyFn } from '../data/options/auto-restore-options.if';
|
|
3
|
-
import { SortItem } from '../data/common/sort-item';
|
|
1
|
+
import { AbstractStoreStateService } from './abstract-store-state.service.js';
|
|
2
|
+
import { GetStorageKeyFn } from '../data/options/auto-restore-options.if.js';
|
|
3
|
+
import { SortItem } from '../data/common/sort-item.js';
|
|
4
4
|
|
|
5
|
+
/** @category Internals */
|
|
5
6
|
export declare class StoreStateSortingService extends AbstractStoreStateService {
|
|
6
7
|
private readonly SORTING_STATE;
|
|
7
8
|
private sortItems;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { TreeRowIf } from '../data/common/tree-row-if';
|
|
1
|
+
import { TreeRowIf } from '../data/common/tree-row-if.js';
|
|
2
2
|
|
|
3
|
+
/** @category Tree & checkboxes */
|
|
3
4
|
export declare class TreeRowService {
|
|
4
5
|
flattenTree<T>(rows: TreeRowIf<T>[], ret?: TreeRowIf<T>[]): TreeRowIf<T>[];
|
|
6
|
+
/** The children of a visible, expanded row are visible – collapsed subtrees are not walked at all
|
|
7
|
+
* (before, every node of the tree was visited and checked up to the root on every expand/collapse). */
|
|
8
|
+
private flattenVisibleChildren;
|
|
5
9
|
isVisible(row: TreeRowIf<any>): boolean;
|
|
6
10
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where {@link AutoRestoreOptionsIf} stores the state of a table ({@link AutoRestoreOptionsIf.storage}). A synchronous
|
|
3
|
+
* key-value store with the method names of the Web Storage API – `localStorage` (default) and `sessionStorage`
|
|
4
|
+
* fit directly.
|
|
5
|
+
*
|
|
6
|
+
* The table reads the state while it is built, so the storage must answer synchronously. To keep the state on a
|
|
7
|
+
* server, load it before you create the table and pass it as {@link TableOptionsIf.initialState}; save it in
|
|
8
|
+
* {@link EventListenerIf.onStateChanged}.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const tableOptions: TableOptionsIf = {
|
|
12
|
+
* ...new TableOptions(),
|
|
13
|
+
* autoRestoreOptions: {
|
|
14
|
+
* ...new AutoRestoreOptions<Order>(),
|
|
15
|
+
* getStorageKeyFn: () => "orders",
|
|
16
|
+
* storage: sessionStorage, // forget the layout when the tab is closed
|
|
17
|
+
* autoRestoreColumnLayout: true
|
|
18
|
+
* }
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // an own storage, e.g. a prefix for all keys
|
|
23
|
+
* const prefixed: StateStorageIf = {
|
|
24
|
+
* getItem: key => localStorage.getItem("my-app/" + key),
|
|
25
|
+
* setItem: (key, value) => localStorage.setItem("my-app/" + key, value),
|
|
26
|
+
* removeItem: key => localStorage.removeItem("my-app/" + key)
|
|
27
|
+
* };
|
|
28
|
+
*
|
|
29
|
+
* @category State
|
|
30
|
+
* @since 1.1.92
|
|
31
|
+
*/
|
|
32
|
+
export interface StateStorageIf {
|
|
33
|
+
/** The stored string or `null`. */
|
|
34
|
+
getItem(key: string): string | null;
|
|
35
|
+
/** Stores a string. May throw (quota) – the table catches it. */
|
|
36
|
+
setItem(key: string, value: string): void;
|
|
37
|
+
/** Removes a key. */
|
|
38
|
+
removeItem(key: string): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StateStorageIf } from './state-storage.if.js';
|
|
2
|
+
import { TableStateIf } from './table-state.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Reads the state that tables before 1.1.92 stored under `<key>sortingState`, `<key>scrollState` and
|
|
6
|
+
* `<key>collapsedExpandedState` and converts it to a {@link TableStateIf}. The stored sort items hold a column
|
|
7
|
+
* INDEX – it is converted to the property of the column at that index in the default column order (the order a
|
|
8
|
+
* table of the old version always started with).
|
|
9
|
+
*
|
|
10
|
+
* @param {StateStorageIf} storage - the storage
|
|
11
|
+
* @param {string} key - the storage key of the table (`getStorageKeyFn()`)
|
|
12
|
+
* @param {string[]} properties - the properties of the columns in the default order
|
|
13
|
+
* @returns {TableStateIf | undefined} the state, `undefined` if nothing was stored
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* localStorage.setItem("orderssortingState", '[{"columnIndex":2,"sortState":"desc"}]');
|
|
17
|
+
* readLegacyState(localStorage, "orders", ["id", "customer", "total"]);
|
|
18
|
+
* // → { version: 1, sort: [{ property: "total", sortState: "desc" }] }
|
|
19
|
+
*
|
|
20
|
+
* @category Internals
|
|
21
|
+
* @since 1.1.92
|
|
22
|
+
*/
|
|
23
|
+
export declare function readLegacyState(storage: StateStorageIf, key: string, properties: string[]): TableStateIf | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Removes the keys of tables before 1.1.92 (see {@link readLegacyState}).
|
|
26
|
+
*
|
|
27
|
+
* @param {StateStorageIf} storage - the storage
|
|
28
|
+
* @param {string} key - the storage key of the table
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* removeLegacyState(localStorage, "orders");
|
|
32
|
+
*
|
|
33
|
+
* @category Internals
|
|
34
|
+
* @since 1.1.92
|
|
35
|
+
*/
|
|
36
|
+
export declare function removeLegacyState(storage: StateStorageIf, key: string): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableStatePart } from './table-state.if.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* All parts of a {@link TableStateIf}, in the order the table applies them.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const withoutScroll = ALL_TABLE_STATE_PARTS.filter(part => part !== "scroll");
|
|
8
|
+
* const state = tableApi.getState(withoutScroll);
|
|
9
|
+
*
|
|
10
|
+
* @category State
|
|
11
|
+
* @since 1.1.92
|
|
12
|
+
*/
|
|
13
|
+
export declare const ALL_TABLE_STATE_PARTS: readonly TableStatePart[];
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { SortState } from '../data/common/sort-state.type.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The id of a row in a {@link TableStateIf} – what {@link AutoRestoreOptionsIf.getRowId} returns.
|
|
5
|
+
*
|
|
6
|
+
* @category State
|
|
7
|
+
* @since 1.1.92
|
|
8
|
+
*/
|
|
9
|
+
export type TableStateRowId = string | number;
|
|
10
|
+
/**
|
|
11
|
+
* One part of a {@link TableStateIf}. Use it to read or apply only some parts:
|
|
12
|
+
* `tableApi.getState(["columns", "sort"])`.
|
|
13
|
+
*
|
|
14
|
+
* | Part | Content | {@link AutoRestoreOptionsIf} flag |
|
|
15
|
+
* |---|---|---|
|
|
16
|
+
* | `columns` | width, order and visibility of the columns | `autoRestoreColumnLayout` |
|
|
17
|
+
* | `sort` | sorted columns | `autoRestoreSortingState` |
|
|
18
|
+
* | `scroll` | scroll position | `autoRestoreScrollPosition` |
|
|
19
|
+
* | `tree` | expanded / collapsed tree nodes | `autoRestoreCollapsedExpandedState` |
|
|
20
|
+
* | `checked` | checked rows (row checkboxes) | `autoRestoreCheckedState` |
|
|
21
|
+
* | `selection` | selected rows, columns, cells or ranges | `autoRestoreSelectedState` |
|
|
22
|
+
* | `headerGroups` | collapsed header groups | `autoRestoreHeaderGroupState` |
|
|
23
|
+
* | `custom` | data of your application ({@link TableApi.setCustomState}) | `autoRestoreCustomState` |
|
|
24
|
+
*
|
|
25
|
+
* @category State
|
|
26
|
+
* @since 1.1.92
|
|
27
|
+
*/
|
|
28
|
+
export type TableStatePart = "columns" | "sort" | "scroll" | "tree" | "checked" | "selection" | "headerGroups" | "custom";
|
|
29
|
+
/**
|
|
30
|
+
* The state of a table as plain JSON: column layout, sorting, scroll position, tree, checked and selected rows,
|
|
31
|
+
* header groups and data of your own. Get it with {@link TableApi.getState}, apply it with
|
|
32
|
+
* {@link TableApi.applyState} or pass it at the start as {@link TableOptionsIf.initialState} – e.g. to store it on
|
|
33
|
+
* your server per user. {@link TableOptionsIf.autoRestoreOptions} stores it in `localStorage` for you.
|
|
34
|
+
*
|
|
35
|
+
* Every part is optional: a missing part is not applied (the table keeps its current state of that part).
|
|
36
|
+
* Columns are identified by their property, rows by their id ({@link AutoRestoreOptionsIf.getRowId}) – never by an
|
|
37
|
+
* index, so the state survives moved columns and rows that arrive in another order. Unknown columns and rows are
|
|
38
|
+
* ignored. The state holds no cell values – but row ids can be personal data (e.g. an e-mail address as id).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const state: TableStateIf = tableApi.getState();
|
|
42
|
+
* localStorage.setItem("orders-layout", JSON.stringify(state));
|
|
43
|
+
* // later, e.g. in another table:
|
|
44
|
+
* tableApi.applyState(JSON.parse(localStorage.getItem("orders-layout")!) as TableStateIf);
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // hand-written: "total" first and 240 px wide, "city" hidden, sorted by total descending
|
|
48
|
+
* const state: TableStateIf = {
|
|
49
|
+
* version: 1,
|
|
50
|
+
* columns: [{ property: "total", width: 240 }, { property: "id" }, { property: "city", visible: false }],
|
|
51
|
+
* sort: [{ property: "total", sortState: "desc" }]
|
|
52
|
+
* };
|
|
53
|
+
*
|
|
54
|
+
* @see Training: [Remember the state](https://gui.expert/training/persist-state/)
|
|
55
|
+
*
|
|
56
|
+
* @category State
|
|
57
|
+
* @since 1.1.92
|
|
58
|
+
*/
|
|
59
|
+
export interface TableStateIf {
|
|
60
|
+
/** Format version, always `1`. */
|
|
61
|
+
version: 1;
|
|
62
|
+
/**
|
|
63
|
+
* The columns in their order (fixed columns included). Columns of the table that are missing here keep their
|
|
64
|
+
* place; unknown properties are ignored.
|
|
65
|
+
*/
|
|
66
|
+
columns?: TableColumnStateIf[];
|
|
67
|
+
/** The sorted columns, the first one is the primary sort key. `[]` = unsorted. */
|
|
68
|
+
sort?: TableSortStateIf[];
|
|
69
|
+
/** The scroll position. */
|
|
70
|
+
scroll?: TableScrollStateIf;
|
|
71
|
+
/** Expanded / collapsed nodes of a tree table. */
|
|
72
|
+
tree?: TableTreeStateIf;
|
|
73
|
+
/** The ids of the checked rows. */
|
|
74
|
+
checkedRowIds?: TableStateRowId[];
|
|
75
|
+
/** The selection. */
|
|
76
|
+
selection?: TableSelectionStateIf;
|
|
77
|
+
/** The state of the header groups with a toggle. */
|
|
78
|
+
headerGroups?: TableHeaderGroupStateIf[];
|
|
79
|
+
/** Data of your application, e.g. the text of a filter field (must be JSON). */
|
|
80
|
+
custom?: unknown;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Width, visibility and (by its position in {@link TableStateIf.columns}) order of one column.
|
|
84
|
+
*
|
|
85
|
+
* @category State
|
|
86
|
+
* @since 1.1.92
|
|
87
|
+
*/
|
|
88
|
+
export interface TableColumnStateIf {
|
|
89
|
+
/** The property of the column ({@link ColumnDefIf.property}). */
|
|
90
|
+
property: string;
|
|
91
|
+
/** Width in px – only set for columns the user (or `setColumnWidth`) resized; otherwise the width of the code. */
|
|
92
|
+
width?: number;
|
|
93
|
+
/** `false` = hidden with {@link TableApi.setColumnVisible} (a collapsed header group is stored separately). */
|
|
94
|
+
visible?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* One sorted column.
|
|
98
|
+
*
|
|
99
|
+
* @category State
|
|
100
|
+
* @since 1.1.92
|
|
101
|
+
*/
|
|
102
|
+
export interface TableSortStateIf {
|
|
103
|
+
/** The property of the column. */
|
|
104
|
+
property?: string;
|
|
105
|
+
/** Only for tables without column definitions (and the format before 1.1.92): the column index. */
|
|
106
|
+
columnIndex?: number;
|
|
107
|
+
/** `"asc"` or `"desc"`. */
|
|
108
|
+
sortState: SortState;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The scroll position.
|
|
112
|
+
*
|
|
113
|
+
* @category State
|
|
114
|
+
* @since 1.1.92
|
|
115
|
+
*/
|
|
116
|
+
export interface TableScrollStateIf {
|
|
117
|
+
/** Horizontal scroll position in px. */
|
|
118
|
+
left: number;
|
|
119
|
+
/** Vertical scroll position in px. */
|
|
120
|
+
top: number;
|
|
121
|
+
/**
|
|
122
|
+
* The id of the first visible row. If other rows are at the top after restoring `top` (new data), the table
|
|
123
|
+
* scrolls to this row.
|
|
124
|
+
*/
|
|
125
|
+
firstRowId?: TableStateRowId;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Expanded and collapsed nodes of a tree. Only one of the two lists is set – the shorter one:
|
|
129
|
+
* `expandedRowIds` = these nodes are expanded, all others collapsed; `collapsedRowIds` = the other way round.
|
|
130
|
+
* `{ collapsedRowIds: [] }` = all expanded.
|
|
131
|
+
*
|
|
132
|
+
* @category State
|
|
133
|
+
* @since 1.1.92
|
|
134
|
+
*/
|
|
135
|
+
export interface TableTreeStateIf {
|
|
136
|
+
/** These nodes are expanded, all other nodes are collapsed. */
|
|
137
|
+
expandedRowIds?: TableStateRowId[];
|
|
138
|
+
/** These nodes are collapsed, all other nodes are expanded. */
|
|
139
|
+
collapsedRowIds?: TableStateRowId[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The selection: rectangles between rows (ids) and columns (properties).
|
|
143
|
+
*
|
|
144
|
+
* @category State
|
|
145
|
+
* @since 1.1.92
|
|
146
|
+
*/
|
|
147
|
+
export interface TableSelectionStateIf {
|
|
148
|
+
/** Everything selected (⌘/Ctrl+A). */
|
|
149
|
+
allSelected?: boolean;
|
|
150
|
+
/** The selected rectangles. */
|
|
151
|
+
ranges: TableStateRangeIf[];
|
|
152
|
+
/** Rectangles removed from the selection (Ctrl/⌘+Alt-click). */
|
|
153
|
+
negativeRanges?: TableStateRangeIf[];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A rectangle of a selection. Without row ids it spans all rows (a selected column), without properties all columns
|
|
157
|
+
* (a selected row); without `toRowId` / `toProperty` it reaches to the last row / column. Restored in the current
|
|
158
|
+
* row order: a rectangle between the same first and last row. Tables without column definitions store only
|
|
159
|
+
* row selections (columns have no property there).
|
|
160
|
+
*
|
|
161
|
+
* @category State
|
|
162
|
+
* @since 1.1.92
|
|
163
|
+
*/
|
|
164
|
+
export interface TableStateRangeIf {
|
|
165
|
+
fromRowId?: TableStateRowId;
|
|
166
|
+
toRowId?: TableStateRowId;
|
|
167
|
+
fromProperty?: string;
|
|
168
|
+
toProperty?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Collapsed or expanded header group ({@link CellGroupIf} with `toggle: true`).
|
|
172
|
+
*
|
|
173
|
+
* @category State
|
|
174
|
+
* @since 1.1.92
|
|
175
|
+
*/
|
|
176
|
+
export interface TableHeaderGroupStateIf {
|
|
177
|
+
/** {@link CellGroupIf.id}, otherwise the path of the labels, e.g. `"Customer"` or `"2026/Q1"`. */
|
|
178
|
+
id: string;
|
|
179
|
+
/** `true` = collapsed. */
|
|
180
|
+
closed: boolean;
|
|
181
|
+
}
|