dhx-suite 9.0.4 → 9.1.1
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/codebase/suite.min.css +1 -1
- package/codebase/suite.min.js +3 -3
- package/codebase/suite.min.js.map +1 -1
- package/codebase/types/ts-common/core.d.ts +5 -1
- package/codebase/types/ts-data/sources/datacollection.d.ts +6 -3
- package/codebase/types/ts-data/sources/treecollection.d.ts +2 -1
- package/codebase/types/ts-data/sources/types.d.ts +4 -1
- package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +11 -1
- package/codebase/types/ts-grid/sources/Grid.d.ts +11 -11
- package/codebase/types/ts-grid/sources/ProGrid.d.ts +10 -5
- package/codebase/types/ts-grid/sources/helpers/cells.d.ts +1 -1
- package/codebase/types/ts-grid/sources/helpers/data.d.ts +10 -10
- package/codebase/types/ts-grid/sources/helpers/default.d.ts +2 -1
- package/codebase/types/ts-grid/sources/types.d.ts +69 -23
- package/codebase/types/ts-grid/sources/ui/Cells.d.ts +1 -2
- package/codebase/types/ts-grid/sources/ui/SubRows.d.ts +4 -0
- package/codebase/types/ts-grid/sources/ui/editors/ComboboxEditor.d.ts +1 -0
- package/codebase/types/ts-grid/sources/ui/group/panel.d.ts +3 -2
- package/codebase/types/ts-grid/sources/ui/render.d.ts +2 -2
- package/codebase/types/ts-layout/sources/ProCell.d.ts +1 -1
- package/codebase/types/ts-layout/sources/types.d.ts +1 -1
- package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +2 -4
- package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +2 -2
- package/codebase/types/ts-treegrid/sources/types.d.ts +1 -19
- package/package.json +1 -1
- package/readme.txt +1 -1
- package/whatsnew.txt +39 -0
|
@@ -32,5 +32,9 @@ export interface IContainerConfig {
|
|
|
32
32
|
export declare const getStringWidth: (value: string, config?: IContainerConfig) => number;
|
|
33
33
|
export declare const rgbToHex: (color: string) => string;
|
|
34
34
|
export declare function getCloneObject(obj: any): any;
|
|
35
|
-
export declare function getTextLines(ctx
|
|
35
|
+
export declare function getTextLines({ ctx, text, maxWidth }: {
|
|
36
|
+
ctx: any;
|
|
37
|
+
text: any;
|
|
38
|
+
maxWidth: any;
|
|
39
|
+
}): string[];
|
|
36
40
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
2
|
import { Id } from "../../ts-common/types";
|
|
3
3
|
import { Sort } from "./datacollection/sort";
|
|
4
|
-
import { DataCallback, DataEvents, IDataCollection, IDataItem, IDataProxy, IFilterCallback, IFilterConfig, IFilterMode, ISortMode, ITreeCollection, IUpdateObject, ReduceCallBack, Statuses, IDataEventsHandlersMap, DataDriver, IDataConfig, ISortConfig, IDataDriver, IFilterComplexMode, IFilter, IResetFilterConfig, IGroupDataConfig } from "./types";
|
|
4
|
+
import { DataCallback, DataEvents, IDataCollection, IDataItem, IDataProxy, IFilterCallback, IFilterConfig, IFilterMode, ISortMode, ITreeCollection, IUpdateObject, ReduceCallBack, Statuses, IDataEventsHandlersMap, DataDriver, IDataConfig, ISortConfig, IDataDriver, IFilterComplexMode, IFilter, IResetFilterConfig, IGroupDataConfig, ISortingState } from "./types";
|
|
5
5
|
import { TGroupOrder, IGroup } from "./datacollection/group";
|
|
6
6
|
export declare class DataCollection<T extends IDataItem = IDataItem> implements IDataCollection<T> {
|
|
7
7
|
loadData: Promise<any>;
|
|
@@ -18,9 +18,11 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
|
|
|
18
18
|
protected _meta: any;
|
|
19
19
|
protected _range: [number, number];
|
|
20
20
|
protected _loaded: boolean;
|
|
21
|
-
protected
|
|
21
|
+
protected _initFilterOrder: T[];
|
|
22
|
+
protected _initSortOrder: T[];
|
|
22
23
|
protected _filters: IFilter;
|
|
23
24
|
protected _group: IGroup;
|
|
25
|
+
protected _sortingStates: ISortingState[];
|
|
24
26
|
private _changes;
|
|
25
27
|
private _loader;
|
|
26
28
|
constructor(config?: any, events?: IEventSystem<any>);
|
|
@@ -52,7 +54,8 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
|
|
|
52
54
|
}): IFilter;
|
|
53
55
|
find(conf: IFilterMode | DataCallback<T>): any;
|
|
54
56
|
findAll(conf: IFilterMode | DataCallback<T>): any[];
|
|
55
|
-
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
57
|
+
sort(rule?: ISortMode, config?: ISortConfig, ignore?: boolean): void;
|
|
58
|
+
getSortingStates(): ISortMode[];
|
|
56
59
|
copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
|
|
57
60
|
move(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, newId?: Id): Id | Id[];
|
|
58
61
|
forEach(callback: DataCallback<T>): void;
|
|
@@ -18,7 +18,7 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
|
|
|
18
18
|
removeAll(id?: Id): void;
|
|
19
19
|
update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
|
|
20
20
|
getIndex(id: Id): number;
|
|
21
|
-
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
21
|
+
sort(rule?: ISortMode, config?: ISortConfig, ignore?: boolean): void;
|
|
22
22
|
filter(rule?: IFilterMode | IFilterComplexMode | IFilterCallback, config?: ITreeFilterConfig, silent?: boolean): string;
|
|
23
23
|
restoreOrder(): void;
|
|
24
24
|
copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id;
|
|
@@ -49,6 +49,7 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
|
|
|
49
49
|
protected _removeCore(id: any): void;
|
|
50
50
|
protected _addToOrder(_order: any, obj: any, index: number): void;
|
|
51
51
|
protected _parse_data(data: any, parent?: Id): void;
|
|
52
|
+
protected _parseItem(item: any): void;
|
|
52
53
|
private _fastDeleteChilds;
|
|
53
54
|
private _recursiveFilter;
|
|
54
55
|
private _serialize;
|
|
@@ -18,12 +18,14 @@ export interface ILazyConfig {
|
|
|
18
18
|
delay?: number;
|
|
19
19
|
prepare?: number;
|
|
20
20
|
}
|
|
21
|
+
export type TSortDir = "asc" | "desc";
|
|
21
22
|
export interface ISortMode {
|
|
22
23
|
by?: string | number;
|
|
23
|
-
dir?:
|
|
24
|
+
dir?: TSortDir;
|
|
24
25
|
as?: (a: any) => any;
|
|
25
26
|
rule?: (a: any, b: any) => number;
|
|
26
27
|
}
|
|
28
|
+
export type ISortingState = ISortMode & ISortConfig;
|
|
27
29
|
export type IFilterCallback = (obj: any) => boolean;
|
|
28
30
|
export interface IFilterMode {
|
|
29
31
|
by?: Id;
|
|
@@ -117,6 +119,7 @@ export interface IDataCollection<T extends IDataItem = IDataItem> {
|
|
|
117
119
|
map(callback: DataCallback<T>): T[];
|
|
118
120
|
mapRange(from: number, to: number, callback: DataCallback<T>): T[];
|
|
119
121
|
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
122
|
+
getSortingStates(): ISortingState[];
|
|
120
123
|
serialize(driver?: DataDriver): T[];
|
|
121
124
|
copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
|
|
122
125
|
move(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig } from "./types";
|
|
1
|
+
import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig, ISubViewCell } from "./types";
|
|
2
2
|
import { IDataCollection, IDataItem } from "../../ts-data";
|
|
3
3
|
import { ScrollView } from "../../ts-common/ScrollView";
|
|
4
|
+
import { Id } from "../../ts-common/types";
|
|
4
5
|
import { Grid } from "./Grid";
|
|
5
6
|
export declare class ExtendedGrid extends Grid implements IExtendedGrid {
|
|
6
7
|
scrollView: ScrollView;
|
|
7
8
|
config: IExtendedGridConfig;
|
|
8
9
|
constructor(container: HTMLElement | string | null, config?: IExtendedGridConfig);
|
|
10
|
+
expand(rowId: Id): void;
|
|
11
|
+
collapse(rowId: Id): void;
|
|
12
|
+
expandAll(): void;
|
|
13
|
+
collapseAll(): void;
|
|
14
|
+
getSubRow(id: Id): ISubViewCell | null;
|
|
9
15
|
protected _createView(): any;
|
|
16
|
+
protected _setHTMLEventHandlers(): void;
|
|
10
17
|
protected _setEventHandlers(): void;
|
|
18
|
+
protected _setSort(): void;
|
|
11
19
|
protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
|
|
12
20
|
protected _prepareData(data: IDataItem[] | IDataCollection): IDataItem[] | IRow[];
|
|
13
21
|
protected _prepareDataFromTo(data: IDataCollection, from: number, to: number): IDataItem[];
|
|
14
22
|
protected _dragStart(event: any): void;
|
|
15
23
|
protected _group(order: IGroupOrderItem[]): void;
|
|
24
|
+
protected _expand(row: IRow): boolean;
|
|
25
|
+
protected _collapse(row: IRow): boolean;
|
|
16
26
|
private _lazyLoad;
|
|
17
27
|
private _getGhostItem;
|
|
18
28
|
private _dragStartColumn;
|
|
@@ -2,10 +2,10 @@ import { IEventSystem } from "../../ts-common/events";
|
|
|
2
2
|
import { IKeyManager } from "../../ts-common/KeyManager";
|
|
3
3
|
import { Id, ITouchParam } from "../../ts-common/types";
|
|
4
4
|
import { View } from "../../ts-common/view";
|
|
5
|
-
import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap } from "../../ts-data";
|
|
5
|
+
import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap, TSortDir } from "../../ts-data";
|
|
6
6
|
import { Exporter } from "./Exporter";
|
|
7
7
|
import { ISelection } from "./Selection";
|
|
8
|
-
import {
|
|
8
|
+
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, SortFunction, IHeaderFilter, IAdjustColumns, IDirection, IFooter, IHeader, INormalizeColumnsParams, ISummaryList, ISortingStates } from "./types";
|
|
9
9
|
export declare class Grid extends View implements IGrid {
|
|
10
10
|
version: string;
|
|
11
11
|
name: "grid";
|
|
@@ -21,10 +21,7 @@ export declare class Grid extends View implements IGrid {
|
|
|
21
21
|
protected _scroll: IScrollState;
|
|
22
22
|
protected _events: IEventSystem<GridSystemEvents, ISystemEventHandlersMap>;
|
|
23
23
|
protected _htmlEvents: any;
|
|
24
|
-
protected
|
|
25
|
-
by: Id;
|
|
26
|
-
dir: Dirs;
|
|
27
|
-
};
|
|
24
|
+
protected _sortingStates: ISortingStates;
|
|
28
25
|
protected _activeFilters: object;
|
|
29
26
|
private _filterData;
|
|
30
27
|
private _hiddenFilters;
|
|
@@ -54,12 +51,13 @@ export declare class Grid extends View implements IGrid {
|
|
|
54
51
|
removeSpan(rowId: Id, colId: Id): void;
|
|
55
52
|
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
56
53
|
editEnd(withoutSave?: boolean): void;
|
|
57
|
-
getSortingState(): ISortingState;
|
|
58
54
|
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
59
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
60
|
-
edit(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
61
|
-
paint(): void;
|
|
62
55
|
getSummary(colId?: Id): ISummaryList;
|
|
56
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
57
|
+
getSortingState(): {
|
|
58
|
+
dir?: TSortDir;
|
|
59
|
+
by?: Id;
|
|
60
|
+
};
|
|
63
61
|
protected _createView(): any;
|
|
64
62
|
protected _parseColumns(configChanged?: boolean): void;
|
|
65
63
|
protected normalizeColumns({ config, columns, configChanged }: INormalizeColumnsParams): void;
|
|
@@ -67,9 +65,11 @@ export declare class Grid extends View implements IGrid {
|
|
|
67
65
|
protected _parseData(): void;
|
|
68
66
|
protected _createCollection(): void;
|
|
69
67
|
protected _getRowIndex(rowId: Id): number;
|
|
68
|
+
protected _setHTMLEventHandlers(): void;
|
|
70
69
|
protected _setEventHandlers(): void;
|
|
71
70
|
protected _addEmptyRow(): void;
|
|
72
|
-
protected _sort(by: Id, sortAs?: SortFunction): void;
|
|
71
|
+
protected _sort(by: Id, sortAs?: SortFunction, smartSorting?: boolean): void;
|
|
72
|
+
protected _setSort(): void;
|
|
73
73
|
protected _clearTouchTimer(): void;
|
|
74
74
|
protected _checkFilters(reset?: boolean): void;
|
|
75
75
|
protected _setUniqueData(sync?: boolean): void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ScrollView } from "../../ts-common/ScrollView";
|
|
2
|
-
import {
|
|
3
|
-
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IHeaderFilter, IProGrid, IProGridConfig,
|
|
2
|
+
import { TreeGridCollection } from "../../ts-treegrid";
|
|
3
|
+
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IHeaderFilter, IProGrid, IProGridConfig, ISpan, ISubViewCell, ISummaryList } from "./types";
|
|
4
4
|
import { IKeyManager } from "../../ts-common/KeyManager";
|
|
5
5
|
import { IEventSystem } from "../../ts-common/events";
|
|
6
6
|
import { Id } from "../../ts-common/types";
|
|
7
|
-
import { DataEvents, DragEvents, IDataEventsHandlersMap, IDragEventsHandlersMap, IDataCollection, IDataItem } from "../../ts-data";
|
|
7
|
+
import { DataEvents, DragEvents, IDataEventsHandlersMap, IDragEventsHandlersMap, IDataCollection, IDataItem, TSortDir } from "../../ts-data";
|
|
8
8
|
import { ISelection } from "./Selection";
|
|
9
9
|
export declare class ProGrid implements IProGrid {
|
|
10
10
|
config: IProGridConfig;
|
|
11
11
|
scrollView: ScrollView;
|
|
12
|
-
events: IEventSystem<GridEvents | DataEvents | DragEvents
|
|
12
|
+
events: IEventSystem<GridEvents | DataEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
|
|
13
13
|
name: string;
|
|
14
14
|
data: IDataCollection<IDataItem> & TreeGridCollection;
|
|
15
15
|
selection: ISelection;
|
|
@@ -45,9 +45,14 @@ export declare class ProGrid implements IProGrid {
|
|
|
45
45
|
removeSpan(rowId: Id, colId: Id): void;
|
|
46
46
|
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
47
47
|
editEnd(withoutSave?: boolean): void;
|
|
48
|
-
getSortingState(): ISortingState;
|
|
49
48
|
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
50
49
|
getSummary(colId?: Id): ISummaryList;
|
|
50
|
+
getSubRow(id: Id): ISubViewCell | null;
|
|
51
51
|
getRootNode(): HTMLElement;
|
|
52
52
|
getRootView(): void;
|
|
53
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
54
|
+
getSortingState(): {
|
|
55
|
+
dir?: TSortDir;
|
|
56
|
+
by?: Id;
|
|
57
|
+
};
|
|
53
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ICell, ICol, IGrid, IRow, ISpan } from "./../types";
|
|
2
2
|
import { Id } from "../../../ts-common/types";
|
|
3
3
|
export declare function getWidth(columns: ICol[], colspan: number, index: number): number;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function getSpanHeight(rows: IRow[], span: ISpan): number;
|
|
5
5
|
export declare function getReducedColspan(columns: ICol[], colId: Id, colspan: number): number;
|
|
6
6
|
export declare function getReducedRowspan(initialRows: IRow[], currRows: IRow[], rowIndex: number, span: ISpan): number;
|
|
7
7
|
export declare function normalizeCell(cell: ICell, grid: IGrid): ICell;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IContainerConfig } from "../../../ts-common/core";
|
|
2
|
-
import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption } from "./../types";
|
|
2
|
+
import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IScrollState, IRange, ISizes } from "./../types";
|
|
3
|
+
export declare function getTotalRowHeight(row: IRow): number;
|
|
3
4
|
export declare function normalizeArray(obj: any, name: string): void;
|
|
4
5
|
export declare function measureTextHeight({ text, width, lineHeight, font, htmlEnable, }: {
|
|
5
6
|
text?: string;
|
|
@@ -9,17 +10,16 @@ export declare function measureTextHeight({ text, width, lineHeight, font, htmlE
|
|
|
9
10
|
htmlEnable?: boolean;
|
|
10
11
|
}): number;
|
|
11
12
|
export declare function countColumns(config: IGridConfig, columns: ICol[]): number;
|
|
12
|
-
export declare function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export declare const getMaxRowHeight: (row: IRow, cols: ICol[], config?: IContainerConfig) => number;
|
|
13
|
+
export declare function calculateVisibleRange(viewPortSize: ISizes, scroll: IScrollState, config: IGridConfig, data: IRow[]): IRange;
|
|
14
|
+
export declare function getUnique(arr: any[], name: string, multiselection: boolean, editorType: ICol["editorType"]): any[];
|
|
15
|
+
export declare const getMaxRowHeight: ({ cols, row, config, }: {
|
|
16
|
+
row: IRow;
|
|
17
|
+
cols: ICol[];
|
|
18
|
+
config?: IContainerConfig;
|
|
19
|
+
}) => number;
|
|
20
20
|
export declare const getCalculatedRowHeight: (height: number, config?: {
|
|
21
21
|
rowHeight: number;
|
|
22
|
-
|
|
22
|
+
verticalOffset?: number;
|
|
23
23
|
}) => number;
|
|
24
24
|
export declare const getTreeCellWidthOffset: (row: IRow, toArrow?: boolean) => number;
|
|
25
25
|
export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config: IContainerConfig, target: AdjustTargetType) => IColumnsWidth;
|
|
@@ -2,7 +2,7 @@ import { IEventSystem } from "../../ts-common/events";
|
|
|
2
2
|
import { IKeyManager } from "../../ts-common/KeyManager";
|
|
3
3
|
import { IAlign } from "../../ts-common/html";
|
|
4
4
|
import { Position } from "../../ts-message";
|
|
5
|
-
import { IDataCollection, IDragConfig, ICsvDriverConfig, IDataItem, IDragInfo, DataCollection } from "../../ts-data";
|
|
5
|
+
import { IDataCollection, IDragConfig, ICsvDriverConfig, IDataItem, IDragInfo, DataCollection, ISortMode, TSortDir } from "../../ts-data";
|
|
6
6
|
import { Combobox } from "../../ts-combobox";
|
|
7
7
|
import { IHandlers, Id } from "../../ts-common/types";
|
|
8
8
|
import { ScrollView } from "../../ts-common/ScrollView";
|
|
@@ -13,6 +13,7 @@ import { IGroupOrder, TDisplayMode } from "../../ts-data/sources/datacollection/
|
|
|
13
13
|
import { IGroupItem } from "./ui/group/panel";
|
|
14
14
|
import { ITreeGrid, ITreeGridConfig } from "../../ts-treegrid";
|
|
15
15
|
import { ISelection } from "./Selection";
|
|
16
|
+
import { IProCell, IViewConstructor } from "../../ts-layout";
|
|
16
17
|
export interface IGrid {
|
|
17
18
|
data: IDataCollection;
|
|
18
19
|
name: "grid" | string;
|
|
@@ -47,15 +48,24 @@ export interface IGrid {
|
|
|
47
48
|
removeSpan(rowId: Id, colId: Id): void;
|
|
48
49
|
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
49
50
|
editEnd(withoutSave?: boolean): void;
|
|
50
|
-
getSortingState(): ISortingState;
|
|
51
51
|
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
52
52
|
getRootNode(): HTMLElement;
|
|
53
53
|
getSummary(colId?: Id): ISummaryList;
|
|
54
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/suite/migration/ */
|
|
55
|
+
getSortingState(): {
|
|
56
|
+
dir?: TSortDir;
|
|
57
|
+
by?: Id;
|
|
58
|
+
};
|
|
54
59
|
}
|
|
55
60
|
export interface IExtendedGrid extends IGrid {
|
|
56
61
|
name: "progrid" | string;
|
|
57
62
|
scrollView: ScrollView;
|
|
58
63
|
config: IExtendedGridConfig;
|
|
64
|
+
getSubRow(id: Id): ISubViewCell | null;
|
|
65
|
+
expand(rowId: Id): void;
|
|
66
|
+
collapse(rowId: Id): void;
|
|
67
|
+
expandAll(): void;
|
|
68
|
+
collapseAll(): void;
|
|
59
69
|
}
|
|
60
70
|
export interface IProGrid extends ITreeGrid {
|
|
61
71
|
config: IProGridConfig;
|
|
@@ -75,6 +85,7 @@ export interface IGridConfig extends IDragConfig {
|
|
|
75
85
|
rightSplit?: number;
|
|
76
86
|
bottomSplit?: number;
|
|
77
87
|
sortable?: boolean;
|
|
88
|
+
multiSort?: boolean;
|
|
78
89
|
editable?: boolean;
|
|
79
90
|
resizable?: boolean;
|
|
80
91
|
groupable?: boolean;
|
|
@@ -100,17 +111,17 @@ export interface IGridConfig extends IDragConfig {
|
|
|
100
111
|
summary?: ISummary;
|
|
101
112
|
hotkeys?: IHandlers;
|
|
102
113
|
rootParent?: Id;
|
|
103
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
114
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
104
115
|
groupTitleTemplate?: (groupName: string, groupItems: IDataItem[]) => string;
|
|
105
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
116
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
106
117
|
editing?: boolean;
|
|
107
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
118
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
108
119
|
headerSort?: boolean;
|
|
109
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
120
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
110
121
|
columnsAutoWidth?: boolean;
|
|
111
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
122
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
112
123
|
fitToContainer?: boolean;
|
|
113
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
124
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
114
125
|
splitAt?: number;
|
|
115
126
|
$width?: number;
|
|
116
127
|
$height?: number;
|
|
@@ -134,15 +145,19 @@ export interface IGridConfig extends IDragConfig {
|
|
|
134
145
|
$scrollBarWidth?: IScrollBarWidth;
|
|
135
146
|
$data?: any[];
|
|
136
147
|
$grouped?: IGroupItem[];
|
|
148
|
+
$subRowCells?: Map<Id, ISubRowCell>;
|
|
137
149
|
}
|
|
138
150
|
export type IProGridConfig = IExtendedGridConfig & ITreeGridConfig;
|
|
139
151
|
export interface IExtendedGridConfig extends IGridConfig {
|
|
152
|
+
subRowConfig?: ((row: IRow) => ISubRowConfig) | ISubRowConfig;
|
|
153
|
+
subRow?: (row: IRow) => string | IViewConstructor;
|
|
140
154
|
height?: number | "auto";
|
|
141
155
|
autoHeight?: boolean;
|
|
142
156
|
headerAutoHeight?: boolean;
|
|
143
157
|
footerAutoHeight?: boolean;
|
|
144
158
|
group?: boolean | IGroup;
|
|
145
159
|
dragItem?: IDragType;
|
|
160
|
+
multiSort?: boolean;
|
|
146
161
|
}
|
|
147
162
|
export interface IRendererConfig extends Required<IProGridConfig> {
|
|
148
163
|
scroll?: IScrollState;
|
|
@@ -158,8 +173,7 @@ export interface IRendererConfig extends Required<IProGridConfig> {
|
|
|
158
173
|
footerHeight?: number;
|
|
159
174
|
events?: IEventSystem<GridEvents, IEventHandlersMap>;
|
|
160
175
|
selection: any;
|
|
161
|
-
|
|
162
|
-
sortDir?: string;
|
|
176
|
+
sort: ISortingStates;
|
|
163
177
|
filterLocation?: string;
|
|
164
178
|
content?: IContentList;
|
|
165
179
|
gridId?: string;
|
|
@@ -207,6 +221,10 @@ export declare enum GridEvents {
|
|
|
207
221
|
afterRowHide = "afterRowHide",
|
|
208
222
|
beforeRowShow = "beforeRowShow",
|
|
209
223
|
afterRowShow = "afterRowShow",
|
|
224
|
+
beforeCollapse = "beforeCollapse",
|
|
225
|
+
afterCollapse = "afterCollapse",
|
|
226
|
+
beforeExpand = "beforeExpand",
|
|
227
|
+
afterExpand = "afterExpand",
|
|
210
228
|
beforeRowDrag = "beforeRowDrag",
|
|
211
229
|
dragRowStart = "dragRowStart",
|
|
212
230
|
dragRowOut = "dragRowOut",
|
|
@@ -235,8 +253,8 @@ export declare enum GridEvents {
|
|
|
235
253
|
export interface IEventHandlersMap {
|
|
236
254
|
[key: string]: (...args: any[]) => any;
|
|
237
255
|
[GridEvents.scroll]: (scrollState: ICoords) => void;
|
|
238
|
-
[GridEvents.beforeSort]: (column: ICol, dir:
|
|
239
|
-
[GridEvents.afterSort]: (column: ICol, dir:
|
|
256
|
+
[GridEvents.beforeSort]: (column: ICol, dir: TSortDir) => void | boolean;
|
|
257
|
+
[GridEvents.afterSort]: (column: ICol, dir: TSortDir) => void;
|
|
240
258
|
[GridEvents.filterChange]: (value: string | string[], colId: Id, filterId: TContentFilter, silent?: boolean) => void;
|
|
241
259
|
[GridEvents.beforeFilter]: (value: string, colId: Id) => void | boolean;
|
|
242
260
|
[GridEvents.beforeResizeStart]: (column: ICol, event: MouseEvent) => boolean | void;
|
|
@@ -271,6 +289,10 @@ export interface IEventHandlersMap {
|
|
|
271
289
|
[GridEvents.afterRowHide]: (row: IRow) => void;
|
|
272
290
|
[GridEvents.beforeRowShow]: (row: IRow) => boolean | void;
|
|
273
291
|
[GridEvents.afterRowShow]: (row: IRow) => void;
|
|
292
|
+
[GridEvents.beforeCollapse]: (rowId: Id) => boolean | void;
|
|
293
|
+
[GridEvents.afterCollapse]: (rowId: Id) => void;
|
|
294
|
+
[GridEvents.beforeExpand]: (rowId: Id) => boolean | void;
|
|
295
|
+
[GridEvents.afterExpand]: (rowId: Id) => void;
|
|
274
296
|
[GridEvents.beforeRowDrag]: (data: IDragInfo, event: MouseEvent) => void | boolean;
|
|
275
297
|
[GridEvents.dragRowStart]: (data: IDragInfo, event: MouseEvent) => void;
|
|
276
298
|
[GridEvents.dragRowOut]: (data: IDragInfo, event: MouseEvent) => void;
|
|
@@ -291,7 +313,7 @@ export interface IEventHandlersMap {
|
|
|
291
313
|
[GridEvents.afterColumnDrag]: (data: IDragInfo, event: MouseEvent) => void;
|
|
292
314
|
[GridEvents.beforeRowResize]: (row: IRow, event: Event, currentHeight: number) => boolean;
|
|
293
315
|
[GridEvents.afterRowResize]: (row: IRow, event: Event, currentHeight: number) => void;
|
|
294
|
-
[GridEvents.groupPanelItemClick]: (id: string, event:
|
|
316
|
+
[GridEvents.groupPanelItemClick]: (id: string, event: MouseEvent | TouchEvent) => void;
|
|
295
317
|
[GridEvents.groupPanelItemMouseDown]: (id: string, event: MouseEvent | TouchEvent) => void;
|
|
296
318
|
[GridEvents.expand]: (rowId: Id) => void;
|
|
297
319
|
}
|
|
@@ -343,15 +365,15 @@ export interface ICol {
|
|
|
343
365
|
dateFormat?: string;
|
|
344
366
|
summary?: TSummary;
|
|
345
367
|
gravity?: number;
|
|
346
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
368
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
347
369
|
format?: string;
|
|
348
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
370
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
349
371
|
editing?: boolean;
|
|
350
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
372
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
351
373
|
headerSort?: boolean;
|
|
352
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
374
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
353
375
|
columnsAutoWidth?: boolean;
|
|
354
|
-
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
376
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
355
377
|
fitToContainer?: boolean;
|
|
356
378
|
$cellCss?: {
|
|
357
379
|
[key: string]: string;
|
|
@@ -368,7 +390,10 @@ export interface IRow {
|
|
|
368
390
|
height?: number;
|
|
369
391
|
hidden?: boolean;
|
|
370
392
|
[key: string]: any;
|
|
393
|
+
$index?: number;
|
|
371
394
|
$height?: number;
|
|
395
|
+
$opened?: boolean;
|
|
396
|
+
$subRowHeight?: number;
|
|
372
397
|
}
|
|
373
398
|
export interface ISpan {
|
|
374
399
|
row: Id;
|
|
@@ -410,6 +435,22 @@ export interface IFooter extends IContent {
|
|
|
410
435
|
value: string;
|
|
411
436
|
} & ISummaryList, header: IFooter, column: ICol) => string | boolean;
|
|
412
437
|
}
|
|
438
|
+
export interface ISubViewCell extends ISubRowConfig {
|
|
439
|
+
view: string | any;
|
|
440
|
+
element: HTMLElement | null;
|
|
441
|
+
}
|
|
442
|
+
export interface ISubRowCell extends ISubRowConfig {
|
|
443
|
+
cell?: IProCell;
|
|
444
|
+
}
|
|
445
|
+
export interface ISubRowConfig {
|
|
446
|
+
expanded?: boolean;
|
|
447
|
+
preserve?: boolean;
|
|
448
|
+
toggleIcon?: boolean;
|
|
449
|
+
height?: number;
|
|
450
|
+
padding?: number | string;
|
|
451
|
+
fullWidth?: boolean;
|
|
452
|
+
css?: string;
|
|
453
|
+
}
|
|
413
454
|
export interface ISummaryList {
|
|
414
455
|
[key: string]: string | number | null;
|
|
415
456
|
}
|
|
@@ -457,6 +498,12 @@ export interface IScrollState {
|
|
|
457
498
|
left: number;
|
|
458
499
|
top: number;
|
|
459
500
|
}
|
|
501
|
+
export interface IRange {
|
|
502
|
+
xStart: number;
|
|
503
|
+
xEnd: number;
|
|
504
|
+
yStart: number;
|
|
505
|
+
yEnd: number;
|
|
506
|
+
}
|
|
460
507
|
interface IFixedColumns {
|
|
461
508
|
left: ICol[];
|
|
462
509
|
right: ICol[];
|
|
@@ -466,11 +513,11 @@ interface IFixedRows {
|
|
|
466
513
|
bottom: IRow[];
|
|
467
514
|
}
|
|
468
515
|
type RenderFrom = "leftFixedCols" | "rightFixedCols" | "topFixedRows" | "bottomFixedRows" | "render";
|
|
469
|
-
export interface ISortingState {
|
|
470
|
-
dir: Dirs;
|
|
471
|
-
by: Id;
|
|
472
|
-
}
|
|
473
516
|
export type EditorType = "input" | "select" | "datePicker" | "checkbox" | "combobox" | "multiselect" | "textarea";
|
|
517
|
+
export interface ISort extends Omit<ISortMode, "as" | "rule"> {
|
|
518
|
+
permanent?: boolean;
|
|
519
|
+
}
|
|
520
|
+
export type ISortingStates = ISort[];
|
|
474
521
|
export interface IComboEditorConfig {
|
|
475
522
|
newOptions?: boolean;
|
|
476
523
|
readOnly?: boolean;
|
|
@@ -596,7 +643,6 @@ export interface ICsvExportConfig extends ICsvDriverConfig {
|
|
|
596
643
|
rowDelimiter?: string;
|
|
597
644
|
columnDelimiter?: string;
|
|
598
645
|
}
|
|
599
|
-
export type Dirs = "asc" | "desc";
|
|
600
646
|
export interface ICoords {
|
|
601
647
|
x: number;
|
|
602
648
|
y: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridEvents, GridSystemEvents,
|
|
1
|
+
import { GridEvents, GridSystemEvents, ICoords, IGridConfig, IRendererConfig, ISpan, Split } from "../types";
|
|
2
2
|
import { IDataCollection } from "../../../ts-data";
|
|
3
3
|
type mouseEvents = GridEvents.cellClick | GridEvents.cellMouseOver | GridEvents.cellMouseDown | GridEvents.cellDblClick | GridEvents.cellRightClick;
|
|
4
4
|
type touchEvents = GridSystemEvents.cellTouchEnd | GridSystemEvents.cellTouchMove;
|
|
@@ -13,7 +13,6 @@ export declare function getHandlers(row: number, column: number, conf: IRenderer
|
|
|
13
13
|
ontouchmove: (number | GridSystemEvents | IRendererConfig | typeof handleMouse)[];
|
|
14
14
|
ontouchend: (number | GridSystemEvents | IRendererConfig | typeof handleMouse)[];
|
|
15
15
|
};
|
|
16
|
-
export declare function getTreeCell(content: any, row: any, col: ICol, conf: IRendererConfig): any;
|
|
17
16
|
export declare function getCells(conf: IRendererConfig): any[];
|
|
18
17
|
export declare function getSpans(config: IRendererConfig, mode?: Split): any[];
|
|
19
18
|
export declare function getShifts(conf: IRendererConfig): ICoords;
|
|
@@ -4,9 +4,10 @@ export interface IGroupItem {
|
|
|
4
4
|
label: string;
|
|
5
5
|
closable?: boolean;
|
|
6
6
|
sortable?: boolean;
|
|
7
|
-
|
|
7
|
+
sortDir?: "asc" | "desc" | null;
|
|
8
|
+
sortOrder?: number | null;
|
|
8
9
|
mode?: "basic" | "drop";
|
|
9
10
|
notGrouped?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare function getGroupItem({ id, label,
|
|
12
|
+
export declare function getGroupItem({ id, label, sortDir, sortOrder, mode, sortable, closable, }: IGroupItem): any;
|
|
12
13
|
export declare function getGroupPanel(grouped: IGroupItem[], grid: IProGrid): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IGrid, IGridConfig, IProGrid, IRendererConfig, IRow } from "../types";
|
|
2
|
-
export declare function getRenderConfig(obj: any, data: IRow[], wrapperSizes:
|
|
1
|
+
import { IGrid, IGridConfig, IProGrid, IRendererConfig, IRow, ISizes } from "../types";
|
|
2
|
+
export declare function getRenderConfig(obj: any, data: IRow[], wrapperSizes: ISizes): IRendererConfig;
|
|
3
3
|
export declare function getElementSizes(element: HTMLElement | any): {
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
@@ -3,7 +3,7 @@ import { Cell } from "./Cell";
|
|
|
3
3
|
import { ILayout, ICellConfig, IProCell } from "./types";
|
|
4
4
|
export declare class ProCell extends Cell implements IProCell {
|
|
5
5
|
scrollView: ScrollView;
|
|
6
|
-
constructor(parent: string | HTMLElement | ILayout, config: ICellConfig);
|
|
6
|
+
constructor(parent: string | HTMLElement | ILayout | null, config: ICellConfig);
|
|
7
7
|
private _getFirstRootView;
|
|
8
8
|
toVDOM(nodes?: any[]): any;
|
|
9
9
|
}
|
|
@@ -52,7 +52,7 @@ export interface ILayoutConfig extends ICellConfig {
|
|
|
52
52
|
}
|
|
53
53
|
export type IViewFn = (cfg: any) => VNode;
|
|
54
54
|
export interface IViewConstructor {
|
|
55
|
-
new: (container: HTMLElement | string, config: any) => IView;
|
|
55
|
+
new: (container: HTMLElement | string | null, config: any) => IView;
|
|
56
56
|
}
|
|
57
57
|
export interface ICell extends IView {
|
|
58
58
|
id: string;
|
|
@@ -2,12 +2,12 @@ import { GridEvents, IEventHandlersMap, ExtendedGrid, ICellRect, IColumnsWidth,
|
|
|
2
2
|
import { IEventSystem } from "../../ts-common/events";
|
|
3
3
|
import { DataEvents, DragEvents, IDataEventsHandlersMap, IDragEventsHandlersMap } from "../../ts-data";
|
|
4
4
|
import { TreeGridCollection } from "./TreeGridCollection";
|
|
5
|
-
import {
|
|
5
|
+
import { ITreeGrid, ITreeGridConfig } from "./types";
|
|
6
6
|
import { Id } from "../../ts-common/types";
|
|
7
7
|
export declare class TreeGrid extends ExtendedGrid implements ITreeGrid {
|
|
8
8
|
config: ITreeGridConfig;
|
|
9
9
|
data: TreeGridCollection;
|
|
10
|
-
events: IEventSystem<DataEvents | GridEvents | DragEvents
|
|
10
|
+
events: IEventSystem<DataEvents | GridEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
|
|
11
11
|
constructor(container: HTMLElement | string | null, config: ITreeGridConfig);
|
|
12
12
|
expand(rowId: Id): void;
|
|
13
13
|
collapse(rowId: Id): void;
|
|
@@ -23,6 +23,4 @@ export declare class TreeGrid extends ExtendedGrid implements ITreeGrid {
|
|
|
23
23
|
protected _applyLocalFilter(beforePrepareData?: boolean): void;
|
|
24
24
|
protected _setEventHandlers(): void;
|
|
25
25
|
private _serialize;
|
|
26
|
-
private _expand;
|
|
27
|
-
private _collapse;
|
|
28
26
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
2
|
import { DataCallback, DataDriver, DataEvents, IDataItem, TreeCollection } from "../../ts-data";
|
|
3
|
-
import { TreeGridEvents } from "./types";
|
|
4
3
|
import { Id } from "../../ts-common/types";
|
|
4
|
+
import { GridEvents } from "../../ts-grid";
|
|
5
5
|
export declare class TreeGridCollection extends TreeCollection {
|
|
6
|
-
constructor(config?: any, events?: IEventSystem<DataEvents |
|
|
6
|
+
constructor(config?: any, events?: IEventSystem<DataEvents | GridEvents>);
|
|
7
7
|
eachChild(id: Id, cb: any, direct?: boolean, checkItem?: (item: IDataItem) => boolean): void;
|
|
8
8
|
getMaxLevel(): number;
|
|
9
9
|
getLevel(id: Id): number;
|
|
@@ -10,25 +10,7 @@ export interface ITreeGridConfig extends IExtendedGridConfig {
|
|
|
10
10
|
collapsed?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface ITreeGrid extends IExtendedGrid {
|
|
13
|
-
events: IEventSystem<DataEvents | GridEvents | DragEvents
|
|
13
|
+
events: IEventSystem<DataEvents | GridEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
|
|
14
14
|
config: ITreeGridConfig;
|
|
15
15
|
data: TreeGridCollection;
|
|
16
|
-
scrollTo(rowId: Id, colId: Id): void;
|
|
17
|
-
expand(rowId: Id): void;
|
|
18
|
-
collapse(rowId: Id): void;
|
|
19
|
-
expandAll(): void;
|
|
20
|
-
collapseAll(): void;
|
|
21
|
-
}
|
|
22
|
-
export declare enum TreeGridEvents {
|
|
23
|
-
beforeCollapse = "beforeCollapse",
|
|
24
|
-
afterCollapse = "afterCollapse",
|
|
25
|
-
beforeExpand = "beforeExpand",
|
|
26
|
-
afterExpand = "afterExpand"
|
|
27
|
-
}
|
|
28
|
-
export interface ITreeEventHandlersMap {
|
|
29
|
-
[key: string]: (...args: any[]) => any;
|
|
30
|
-
[TreeGridEvents.beforeCollapse]: (rowId: Id) => boolean | void;
|
|
31
|
-
[TreeGridEvents.afterCollapse]: (rowId: Id) => any;
|
|
32
|
-
[TreeGridEvents.beforeExpand]: (rowId: Id) => boolean | void;
|
|
33
|
-
[TreeGridEvents.afterExpand]: (rowId: Id) => any;
|
|
34
16
|
}
|