@guiexpert/table 1.1.89 → 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 +88 -97
- package/index.d.ts +192 -184
- package/index.js +3616 -1879
- 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 +44 -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 +81 -4
- 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 +43 -3
- package/lib/table/service/excel-service.if.d.ts +8 -1
- 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 +309 -550
- package/lib/table/table-scope.d.ts +223 -85
- package/package.json +23 -8
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { AreaIdent } from '../area-ident.type';
|
|
2
|
-
import { ColumnDefIf } from '../column/column-def.if';
|
|
3
|
-
import { AreaModelIf } from './area-model.if';
|
|
4
|
-
import { CellGroupIf } from '../cellgroup/cell-group.if';
|
|
5
|
-
import { CheckboxModelIf } from '../../../checkbox/checkbox-model.if';
|
|
6
|
-
import { SortItem } from '../../common/sort-item';
|
|
7
|
-
import { FilterFunction } from '../../common/filter-function';
|
|
8
|
-
import { CellRendererIf } from '../../../renderer/cell-render.if';
|
|
9
|
-
import { CheckedType } from '../../common/checked-type';
|
|
10
|
-
import { CellGroupExt } from '../cellgroup/cell-group-ext';
|
|
11
|
-
import { MouseTargetData } from '../../event/mouse-target-data';
|
|
12
|
-
import { HeaderGroupOptionsIf } from '../../options/header-group-options.if';
|
|
1
|
+
import { AreaIdent } from '../area-ident.type.js';
|
|
2
|
+
import { ColumnDefIf } from '../column/column-def.if.js';
|
|
3
|
+
import { AreaModelIf } from './area-model.if.js';
|
|
4
|
+
import { CellGroupIf } from '../cellgroup/cell-group.if.js';
|
|
5
|
+
import { CheckboxModelIf } from '../../../checkbox/checkbox-model.if.js';
|
|
6
|
+
import { SortItem } from '../../common/sort-item.js';
|
|
7
|
+
import { FilterFunction } from '../../common/filter-function.js';
|
|
8
|
+
import { CellRendererIf } from '../../../renderer/cell-render.if.js';
|
|
9
|
+
import { CheckedType } from '../../common/checked-type.js';
|
|
10
|
+
import { CellGroupExt } from '../cellgroup/cell-group-ext.js';
|
|
11
|
+
import { MouseTargetData } from '../../event/mouse-target-data.js';
|
|
12
|
+
import { HeaderGroupOptionsIf } from '../../options/header-group-options.if.js';
|
|
13
13
|
|
|
14
|
+
/** @category Header groups */
|
|
14
15
|
export declare class AreaModelCellGroups implements AreaModelIf {
|
|
15
16
|
readonly areaIdent: AreaIdent;
|
|
16
17
|
readonly groups: CellGroupIf[];
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { AreaModelIf } from './area-model.if';
|
|
2
|
-
import { CellRendererIf } from '../../../renderer/cell-render.if';
|
|
3
|
-
import { CheckedType } from '../../common/checked-type';
|
|
4
|
-
import { CheckboxModelIf } from '../../../checkbox/checkbox-model.if';
|
|
5
|
-
import { FilterFunction } from '../../common/filter-function';
|
|
6
|
-
import { SortItem } from '../../common/sort-item';
|
|
7
|
-
import { AreaIdent } from '../area-ident.type';
|
|
1
|
+
import { AreaModelIf } from './area-model.if.js';
|
|
2
|
+
import { CellRendererIf } from '../../../renderer/cell-render.if.js';
|
|
3
|
+
import { CheckedType } from '../../common/checked-type.js';
|
|
4
|
+
import { CheckboxModelIf } from '../../../checkbox/checkbox-model.if.js';
|
|
5
|
+
import { FilterFunction } from '../../common/filter-function.js';
|
|
6
|
+
import { SortItem } from '../../common/sort-item.js';
|
|
7
|
+
import { AreaIdent } from '../area-ident.type.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* An invisible model, which is used internally for hiding a header.
|
|
11
|
+
*
|
|
12
|
+
* @category Area models
|
|
11
13
|
*/
|
|
12
14
|
export declare class AreaModelHidden implements AreaModelIf {
|
|
13
15
|
areaIdent: AreaIdent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AreaModelObjectArray } from './area-model-object-array';
|
|
2
|
-
import { ColumnDefIf } from '../column/column-def.if';
|
|
3
|
-
import { AreaIdent } from '../area-ident.type';
|
|
1
|
+
import { AreaModelObjectArray } from './area-model-object-array.js';
|
|
2
|
+
import { ColumnDefIf } from '../column/column-def.if.js';
|
|
3
|
+
import { AreaIdent } from '../area-ident.type.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents an area model defined by an object array with column definitions.
|
|
@@ -29,10 +29,10 @@ import { AreaIdent } from '../area-ident.type';
|
|
|
29
29
|
* { id: 3, name: 'Bob', age: 40 }
|
|
30
30
|
* ];
|
|
31
31
|
*
|
|
32
|
-
* const columnDefs = [
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* const columnDefs: ColumnDefIf[] = [
|
|
33
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
34
|
+
* new ColumnDef('name', 'Name', new Size(150, 'px')),
|
|
35
|
+
* new ColumnDef('age', 'Age', new Size(100, 'px'))
|
|
36
36
|
* ];
|
|
37
37
|
*
|
|
38
38
|
* const bodyAreaModel = new AreaModelObjectArrayWithColumndefs<any>(
|
|
@@ -47,9 +47,9 @@ import { AreaIdent } from '../area-ident.type';
|
|
|
47
47
|
* function createTableModel() {
|
|
48
48
|
* const rows = fetchDataFromServer();
|
|
49
49
|
* const columnDefs = [
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
51
|
+
* new ColumnDef('name', 'Name', new Size(150, 'px')),
|
|
52
|
+
* new ColumnDef('age', 'Age', new Size(100, 'px'))
|
|
53
53
|
* ];
|
|
54
54
|
*
|
|
55
55
|
* const tableModel = TableFactory.buildByTypedRowsParam({
|
|
@@ -81,6 +81,8 @@ import { AreaIdent } from '../area-ident.type';
|
|
|
81
81
|
* @see {@link AreaModelObjectArray} - The parent class that provides the core functionality
|
|
82
82
|
* @see {@link ColumnDefIf} - The interface that defines the structure of column definitions
|
|
83
83
|
* @see {@link CrudTableModelFactory} - A factory class that uses this class for CRUD operations
|
|
84
|
+
*
|
|
85
|
+
* @category Area models
|
|
84
86
|
*/
|
|
85
87
|
export declare class AreaModelObjectArrayWithColumndefs<T> extends AreaModelObjectArray<T> {
|
|
86
88
|
areaIdent: AreaIdent;
|
|
@@ -103,10 +105,10 @@ export declare class AreaModelObjectArrayWithColumndefs<T> extends AreaModelObje
|
|
|
103
105
|
* { id: 2, name: 'Jane', age: 25 }
|
|
104
106
|
* ];
|
|
105
107
|
*
|
|
106
|
-
* const columnDefs = [
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
108
|
+
* const columnDefs: ColumnDefIf[] = [
|
|
109
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
110
|
+
* new ColumnDef('name', 'Name', new Size(150, 'px')),
|
|
111
|
+
* new ColumnDef('age', 'Age', new Size(100, 'px'))
|
|
110
112
|
* ];
|
|
111
113
|
*
|
|
112
114
|
* const bodyAreaModel = new AreaModelObjectArrayWithColumndefs(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AbstractAreaModel } from './abstract-area-model';
|
|
2
|
-
import { ColumnDefIf } from '../column/column-def.if';
|
|
3
|
-
import { AreaIdent } from '../area-ident.type';
|
|
4
|
-
import { FilterFunction } from '../../common/filter-function';
|
|
5
|
-
import { SorterService } from '../../../service/sorter.service';
|
|
6
|
-
import { SortItem } from '../../common/sort-item';
|
|
7
|
-
import { ObjectArrayHolderIf } from './object-array-holder.if';
|
|
1
|
+
import { AbstractAreaModel } from './abstract-area-model.js';
|
|
2
|
+
import { ColumnDefIf } from '../column/column-def.if.js';
|
|
3
|
+
import { AreaIdent } from '../area-ident.type.js';
|
|
4
|
+
import { FilterFunction } from '../../common/filter-function.js';
|
|
5
|
+
import { SorterService } from '../../../service/sorter.service.js';
|
|
6
|
+
import { SortItem } from '../../common/sort-item.js';
|
|
7
|
+
import { ObjectArrayHolderIf } from './object-array-holder.if.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @class AreaModelObjectArray
|
|
@@ -35,10 +35,10 @@ import { ObjectArrayHolderIf } from './object-array-holder.if';
|
|
|
35
35
|
* { id: 3, name: 'Bob', age: 40 }
|
|
36
36
|
* ];
|
|
37
37
|
*
|
|
38
|
-
* const columnDefs = [
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* const columnDefs: ColumnDefIf[] = [
|
|
39
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
40
|
+
* new ColumnDef('name', 'Name', new Size(150, 'px')),
|
|
41
|
+
* new ColumnDef('age', 'Age', new Size(100, 'px'))
|
|
42
42
|
* ];
|
|
43
43
|
*
|
|
44
44
|
* const bodyAreaModel = new AreaModelObjectArray<any>(
|
|
@@ -50,7 +50,7 @@ import { ObjectArrayHolderIf } from './object-array-holder.if';
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* // Using with TableFactory to create a complete table model
|
|
53
|
-
* import { TableFactory } from '../../../factory/table-factory';
|
|
53
|
+
* import { TableFactory } from '../../../factory/table-factory.js';
|
|
54
54
|
*
|
|
55
55
|
* const rows = [
|
|
56
56
|
* { id: 1, name: 'John', age: 30 },
|
|
@@ -58,10 +58,10 @@ import { ObjectArrayHolderIf } from './object-array-holder.if';
|
|
|
58
58
|
* { id: 3, name: 'Bob', age: 40 }
|
|
59
59
|
* ];
|
|
60
60
|
*
|
|
61
|
-
* const columnDefs = [
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
61
|
+
* const columnDefs: ColumnDefIf[] = [
|
|
62
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
63
|
+
* new ColumnDef('name', 'Name', new Size(150, 'px')),
|
|
64
|
+
* new ColumnDef('age', 'Age', new Size(100, 'px'))
|
|
65
65
|
* ];
|
|
66
66
|
*
|
|
67
67
|
* const tableModel = TableFactory.createByObjectArray(
|
|
@@ -82,11 +82,11 @@ import { ObjectArrayHolderIf } from './object-array-holder.if';
|
|
|
82
82
|
* { id: 2, person: { name: 'Jane', contact: { email: 'jane@example.com', phone: '098-765-4321' } } }
|
|
83
83
|
* ];
|
|
84
84
|
*
|
|
85
|
-
* const columnDefs = [
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
85
|
+
* const columnDefs: ColumnDefIf[] = [
|
|
86
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
87
|
+
* new ColumnDef('person.name', 'Name', new Size(150, 'px')),
|
|
88
|
+
* new ColumnDef('person.contact.email', 'Email', new Size(200, 'px')),
|
|
89
|
+
* new ColumnDef('person.contact.phone', 'Phone', new Size(150, 'px'))
|
|
90
90
|
* ];
|
|
91
91
|
*
|
|
92
92
|
* const bodyAreaModel = new AreaModelObjectArray<any>(
|
|
@@ -139,6 +139,8 @@ import { ObjectArrayHolderIf } from './object-array-holder.if';
|
|
|
139
139
|
* @see {@link AbstractAreaModel} - The parent class that provides the base implementation
|
|
140
140
|
* @see {@link ObjectArrayHolderIf} - The interface that defines methods for accessing rows
|
|
141
141
|
* @see {@link AreaModelObjectArrayWithColumndefs} - A subclass that changes the constructor parameter order
|
|
142
|
+
*
|
|
143
|
+
* @category Area models
|
|
142
144
|
*/
|
|
143
145
|
export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implements ObjectArrayHolderIf<T> {
|
|
144
146
|
areaIdent: AreaIdent;
|
|
@@ -166,6 +168,7 @@ export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implem
|
|
|
166
168
|
* Service for handling sorting operations.
|
|
167
169
|
* @protected
|
|
168
170
|
* @type {SorterService}
|
|
171
|
+
* @internal
|
|
169
172
|
*/
|
|
170
173
|
protected sorterService: SorterService;
|
|
171
174
|
/**
|
|
@@ -184,10 +187,10 @@ export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implem
|
|
|
184
187
|
* { id: 2, name: 'Jane', age: 25 }
|
|
185
188
|
* ];
|
|
186
189
|
*
|
|
187
|
-
* const columnDefs = [
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
190
|
+
* const columnDefs: ColumnDefIf[] = [
|
|
191
|
+
* new ColumnDef('id', 'ID', new Size(50, 'px')),
|
|
192
|
+
* new ColumnDef('name', 'Name', new Size(150, 'px')),
|
|
193
|
+
* new ColumnDef('age', 'Age', new Size(100, 'px'))
|
|
191
194
|
* ];
|
|
192
195
|
*
|
|
193
196
|
* const bodyAreaModel = new AreaModelObjectArray(
|
|
@@ -432,7 +435,8 @@ export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implem
|
|
|
432
435
|
externalFilterChanged(predictFn: FilterFunction<any>): void;
|
|
433
436
|
/**
|
|
434
437
|
* Sorts the filtered rows based on the provided sort items.
|
|
435
|
-
* This method supports sorting by multiple columns with different sort directions
|
|
438
|
+
* This method supports sorting by multiple columns with different sort directions: the first item is the primary
|
|
439
|
+
* key, the following ones break ties.
|
|
436
440
|
*
|
|
437
441
|
* @param {SortItem[]} sortItems - An array of sort items, each containing a column index and sort state
|
|
438
442
|
* @returns {boolean} Always returns true to indicate sorting was performed
|
|
@@ -450,7 +454,7 @@ export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implem
|
|
|
450
454
|
*
|
|
451
455
|
* @example
|
|
452
456
|
* // Clear sorting
|
|
453
|
-
* bodyAreaModel.doSort([
|
|
457
|
+
* bodyAreaModel.doSort([new SortItem(0, '')]);
|
|
454
458
|
*/
|
|
455
459
|
doSort(sortItems: SortItem[]): boolean;
|
|
456
460
|
/**
|
|
@@ -508,7 +512,7 @@ export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implem
|
|
|
508
512
|
*
|
|
509
513
|
* @example
|
|
510
514
|
* // Move the last column to the first position
|
|
511
|
-
* const lastIndex =
|
|
515
|
+
* const lastIndex = tableModel.getColumnCount() - 1;
|
|
512
516
|
* bodyAreaModel.changeColumnOrder(lastIndex, 0);
|
|
513
517
|
*/
|
|
514
518
|
changeColumnOrder(sourceColumnIndex: number, targetColumnIndex: number): void;
|
|
@@ -541,11 +545,11 @@ export declare class AreaModelObjectArray<T> extends AbstractAreaModel<T> implem
|
|
|
541
545
|
* @returns {(a: T, b: T) => number} A comparator function that compares two rows
|
|
542
546
|
*
|
|
543
547
|
* @example
|
|
544
|
-
* //
|
|
545
|
-
* const comparator =
|
|
548
|
+
* // inside a subclass: a comparator for sorting by name in ascending order
|
|
549
|
+
* const comparator = this.genericFlatTableSortComparator('name', 1);
|
|
546
550
|
*
|
|
547
551
|
* // Sort the rows using the comparator
|
|
548
|
-
* const sortedRows = [...
|
|
552
|
+
* const sortedRows = [...this.getFilteredRows()].sort(comparator);
|
|
549
553
|
*/
|
|
550
554
|
protected genericFlatTableSortComparator(property: string, f: number): (a: T, b: T) => number;
|
|
551
555
|
/**
|
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
import { TreeRow } from '../../common/tree-row';
|
|
2
|
-
import { AbstractAreaModel } from './abstract-area-model';
|
|
3
|
-
import { AreaIdent } from '../area-ident.type';
|
|
4
|
-
import { ColumnDefIf } from '../column/column-def.if';
|
|
5
|
-
import { FilterFunction } from '../../common/filter-function';
|
|
6
|
-
import { SorterService } from '../../../service/sorter.service';
|
|
7
|
-
import { SortItem } from '../../common/sort-item';
|
|
8
|
-
import { TreeRowIf } from '../../common/tree-row-if';
|
|
1
|
+
import { TreeRow } from '../../common/tree-row.js';
|
|
2
|
+
import { AbstractAreaModel } from './abstract-area-model.js';
|
|
3
|
+
import { AreaIdent } from '../area-ident.type.js';
|
|
4
|
+
import { ColumnDefIf } from '../column/column-def.if.js';
|
|
5
|
+
import { FilterFunction } from '../../common/filter-function.js';
|
|
6
|
+
import { SorterService } from '../../../service/sorter.service.js';
|
|
7
|
+
import { SortItem } from '../../common/sort-item.js';
|
|
8
|
+
import { TreeRowIf } from '../../common/tree-row-if.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents a tree-based table model.
|
|
12
12
|
* Extends the AbstractAreaModel class.
|
|
13
13
|
*
|
|
14
|
+
* The displayed rows always come from one pipeline: all tree rows (in their current, possibly sorted order)
|
|
15
|
+
* → rows whose parents are all expanded → active filter. Everything that changes one of these inputs
|
|
16
|
+
* ({@link recalcVisibleTreeRows} after an expand/collapse, {@link externalFilterChanged}, {@link doSort},
|
|
17
|
+
* {@link toggleExpandCollapseAll}) runs the whole pipeline, so a filter survives expanding, collapsing and sorting.
|
|
18
|
+
*
|
|
19
|
+
* Filter semantics: the filter function receives the {@link TreeRowIf tree row} – your object is `row.data`.
|
|
20
|
+
* It is called for **every** row, also for rows below collapsed parents. A row is shown if it or one of its
|
|
21
|
+
* descendants matches (`row.keep`) and all its parents are expanded. So a match below a collapsed node keeps
|
|
22
|
+
* that node visible (still collapsed); expanding it reveals the path to the match. The children of a matching
|
|
23
|
+
* row are not kept automatically.
|
|
24
|
+
*
|
|
14
25
|
* @template S - The type of the row data.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // a tree table with a live search over the labels
|
|
29
|
+
* const filter = { text: "" };
|
|
30
|
+
* const tableOptions: TableOptionsIf = {
|
|
31
|
+
* ...new TableOptions(),
|
|
32
|
+
* externalFilterFunction: (row: TreeRowIf<OrderNode>) => row.data.label.toLowerCase().includes(filter.text)
|
|
33
|
+
* };
|
|
34
|
+
* const rows = TreeFactory.buildTreeRows<OrderNode>(nodes, { expanded: false });
|
|
35
|
+
* const tableModel = TableFactory.createTableModel({ rows, columnDefs, tableOptions });
|
|
36
|
+
* searchInput.addEventListener("input", () => {
|
|
37
|
+
* filter.text = searchInput.value.toLowerCase();
|
|
38
|
+
* tableApi.externalFilterChanged(); // parents of matches stay visible; expanding and sorting keep the filter
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* @category Tree & checkboxes
|
|
15
42
|
*/
|
|
16
43
|
export declare class AreaModelTree<S> extends AbstractAreaModel<TreeRow<S>> {
|
|
17
44
|
areaIdent: AreaIdent;
|
|
@@ -20,14 +47,70 @@ export declare class AreaModelTree<S> extends AbstractAreaModel<TreeRow<S>> {
|
|
|
20
47
|
protected columnDefs: ColumnDefIf[];
|
|
21
48
|
type: string;
|
|
22
49
|
protected readonly properties: string[];
|
|
50
|
+
/** @internal */
|
|
23
51
|
protected sorterService: SorterService;
|
|
24
52
|
private readonly service;
|
|
53
|
+
/** the displayed rows: all parents expanded and accepted by the filter */
|
|
25
54
|
private filteredFlattenRows;
|
|
55
|
+
/** the visible rows (all parents expanded), not filtered */
|
|
26
56
|
private flattenRows;
|
|
27
57
|
private lastPredictFn?;
|
|
58
|
+
/** `row.keep` was set for the current filter (it depends on the filter and the data, not on expand/collapse). */
|
|
59
|
+
private keepMarked;
|
|
28
60
|
constructor(areaIdent: AreaIdent, rows: TreeRowIf<S>[], defaultRowHeight: number, columnDefs?: ColumnDefIf[]);
|
|
29
61
|
changeColumnOrder(sourceColumnIndex: number, targetColumnIndex: number): void;
|
|
30
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Rebuilds the displayed rows after the `expanded` state of rows has changed and applies the active filter
|
|
64
|
+
* (see {@link externalFilterChanged}) again. The table calls it on every expand/collapse click. Call it
|
|
65
|
+
* yourself after changing `row.expanded` from code, then repaint with `tableApi.repaintHard()`
|
|
66
|
+
* (the row count changes).
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // expand all first-level rows from code
|
|
70
|
+
* const treeModel = tableModel.getBodyModel() as AreaModelTree<OrderNode>;
|
|
71
|
+
* for (const row of treeModel.rows) row.expanded = true;
|
|
72
|
+
* treeModel.recalcVisibleTreeRows();
|
|
73
|
+
* tableApi.repaintHard();
|
|
74
|
+
*
|
|
75
|
+
* @param {boolean} [refilter=true] - run the filter function again (needed after the rows changed). `false` after a
|
|
76
|
+
* pure expand/collapse: whether a row matches does not depend on it (the table does this on every click –
|
|
77
|
+
* before, the filter ran over all nodes for each click).
|
|
78
|
+
*/
|
|
79
|
+
recalcVisibleTreeRows(refilter?: boolean): void;
|
|
80
|
+
/**
|
|
81
|
+
* The displayed top-level rows: all of {@link rows}, with an active filter only the matching ones (or with a
|
|
82
|
+
* matching descendant).
|
|
83
|
+
*
|
|
84
|
+
* @returns {TreeRowIf<S>[]} the top-level rows that are shown
|
|
85
|
+
*/
|
|
86
|
+
getDisplayedRootRows(): TreeRowIf<S>[];
|
|
87
|
+
/**
|
|
88
|
+
* True if the row has children that are shown when it is expanded – with an active filter only children that
|
|
89
|
+
* match (or have a matching descendant) count. The arrow of a row without such children is hidden.
|
|
90
|
+
*
|
|
91
|
+
* @param {TreeRowIf<S>} row - a tree row of this model
|
|
92
|
+
* @returns {boolean} true if the row has displayed children
|
|
93
|
+
*/
|
|
94
|
+
hasDisplayedChildren(row: TreeRowIf<S>): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The displayed children of a row (in display order): all children, with an active filter only those that match
|
|
97
|
+
* (or have a matching descendant). They are on screen if the row is expanded.
|
|
98
|
+
* Used for the screen reader attributes `aria-setsize` / `aria-posinset` of tree rows.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const treeModel = tableModel.getBodyModel() as AreaModelTree<OrderNode>;
|
|
102
|
+
* const shown = treeModel.getDisplayedChildren(treeModel.rows[0]).length;
|
|
103
|
+
*
|
|
104
|
+
* @param {TreeRowIf<S>} row - a tree row of this model
|
|
105
|
+
* @returns {TreeRowIf<S>[]} the displayed children (empty for a leaf)
|
|
106
|
+
* @since 1.1.91
|
|
107
|
+
*/
|
|
108
|
+
getDisplayedChildren(row: TreeRowIf<S>): TreeRowIf<S>[];
|
|
109
|
+
/**
|
|
110
|
+
* The displayed rows: all parents expanded and accepted by the active filter, in display order.
|
|
111
|
+
*
|
|
112
|
+
* @returns {TreeRowIf<S>[]} the displayed tree rows (do not modify the array)
|
|
113
|
+
*/
|
|
31
114
|
getFilteredFlattenRows(): TreeRowIf<S>[];
|
|
32
115
|
getRowCount(): number;
|
|
33
116
|
getValueAt(rowIndex: number, columnIndex: number): any;
|
|
@@ -42,14 +125,73 @@ export declare class AreaModelTree<S> extends AbstractAreaModel<TreeRow<S>> {
|
|
|
42
125
|
getCustomClassesAt(rowIndex: number, _columnIndex: number): string[];
|
|
43
126
|
getRowByIndex(idx: number): TreeRowIf<S> | undefined;
|
|
44
127
|
getValueByT(t: S, property: string): any;
|
|
128
|
+
/**
|
|
129
|
+
* Filters the tree; the function is remembered and applied again on every expand/collapse
|
|
130
|
+
* ({@link recalcVisibleTreeRows}), {@link toggleExpandCollapseAll} and {@link doSort}.
|
|
131
|
+
*
|
|
132
|
+
* The function is called once for **every** tree row in depth-first order – also for rows below collapsed
|
|
133
|
+
* parents – with the {@link TreeRowIf tree row} (not your object: use `row.data`), the index of the row in
|
|
134
|
+
* this depth-first list and the list itself. Shown are the rows that match or have a matching descendant
|
|
135
|
+
* (`row.keep = true`) and whose parents are all expanded. A match below a collapsed node therefore keeps the
|
|
136
|
+
* collapsed node visible. Usually called by `tableApi.externalFilterChanged()` with
|
|
137
|
+
* `tableOptions.externalFilterFunction`.
|
|
138
|
+
*
|
|
139
|
+
* @param {FilterFunction<S>} predictFn - returns a truthy value for the rows to show
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* const treeModel = tableModel.getBodyModel() as AreaModelTree<OrderNode>;
|
|
143
|
+
* treeModel.externalFilterChanged((row: TreeRowIf<OrderNode>) => row.data.total > 1000);
|
|
144
|
+
* tableApi.repaintHard();
|
|
145
|
+
*
|
|
146
|
+
* // remove the filter
|
|
147
|
+
* treeModel.externalFilterChanged(() => true);
|
|
148
|
+
*/
|
|
45
149
|
externalFilterChanged<S>(predictFn: FilterFunction<S>): void;
|
|
150
|
+
/**
|
|
151
|
+
* Sorts the rows of every level (children stay below their parent) and keeps the active filter. The first sort
|
|
152
|
+
* item is the primary key, the following ones break ties. The `rows` array and the children arrays are reordered
|
|
153
|
+
* in place, so the order survives expanding, collapsing and filtering. Sort state `""` keeps the current order.
|
|
154
|
+
*
|
|
155
|
+
* @param {SortItem[]} sortItems - primary key first; an empty list does nothing
|
|
156
|
+
* @returns {boolean} `true` if the rows were sorted, `false` for an empty list
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* tableModel.getBodyModel().doSort([new SortItem(1, "desc")]);
|
|
160
|
+
* tableApi.repaint();
|
|
161
|
+
*/
|
|
46
162
|
doSort(sortItems: SortItem[]): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Sorts the rows of every level with your own function (children stay below their parent) and keeps the active
|
|
165
|
+
* filter. Used by `tableApi.sort(fn)` – before, sorting a tree with a function did nothing.
|
|
166
|
+
*
|
|
167
|
+
* @param {(a: TreeRowIf<S>, b: TreeRowIf<S>) => number} compareFn - compares two sibling rows – like the filter
|
|
168
|
+
* function it gets the tree rows: your objects are `a.data` / `b.data`
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* tableApi.sort((a, b) => a.data.total - b.data.total); // sorts the siblings of every level by total
|
|
172
|
+
*/
|
|
173
|
+
sort(compareFn: (a: TreeRowIf<S>, b: TreeRowIf<S>) => number): void;
|
|
174
|
+
/**
|
|
175
|
+
* Expands or collapses every row on every level and applies the active filter again.
|
|
176
|
+
*
|
|
177
|
+
* @param {boolean} expanded - `true` expands, `false` collapses all rows
|
|
178
|
+
*/
|
|
47
179
|
toggleExpandCollapseAll(expanded: boolean): void;
|
|
48
180
|
setAllParentsOk(item: TreeRowIf<any>): boolean;
|
|
49
181
|
setValue(rowIndex: number, columnIndex: number, value: any): boolean;
|
|
50
182
|
protected genericTreeTableSortComparator(property: string, f: number): (a: TreeRowIf<S>, b: TreeRowIf<S>) => number;
|
|
51
183
|
private expandAllRecursive;
|
|
52
|
-
|
|
184
|
+
/**
|
|
185
|
+
* The one pipeline behind the displayed rows: all rows (current order) → visible (all parents expanded)
|
|
186
|
+
* → active filter.
|
|
187
|
+
*/
|
|
188
|
+
private refreshDisplayedRows;
|
|
189
|
+
/**
|
|
190
|
+
* Sets `keep` on every row (also below collapsed parents): true for matching rows and all their ancestors.
|
|
191
|
+
*/
|
|
192
|
+
private markKeptRows;
|
|
193
|
+
/** all rows depth-first, independent of the expanded state */
|
|
194
|
+
private collectAllRows;
|
|
53
195
|
private getPropertyValue;
|
|
54
|
-
private
|
|
196
|
+
private treeSortWith;
|
|
55
197
|
}
|