dhx-suite 8.4.5 → 9.0.0
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-all/sources/entry.d.ts +1 -1
- package/codebase/types/ts-common/core.d.ts +1 -0
- package/codebase/types/ts-common/html.d.ts +1 -0
- package/codebase/types/ts-common/input.d.ts +24 -0
- package/codebase/types/ts-data/index.d.ts +1 -0
- package/codebase/types/ts-data/sources/DragManager.d.ts +12 -1
- package/codebase/types/ts-data/sources/datacollection/group.d.ts +42 -0
- package/codebase/types/ts-data/sources/datacollection.d.ts +6 -1
- package/codebase/types/ts-data/sources/methods.d.ts +11 -0
- package/codebase/types/ts-data/sources/types.d.ts +30 -11
- package/codebase/types/ts-form/sources/elements/input.d.ts +7 -0
- package/codebase/types/ts-form/sources/elements/textarea.d.ts +4 -3
- package/codebase/types/ts-grid/index.d.ts +1 -1
- package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +23 -0
- package/codebase/types/ts-grid/sources/Grid.d.ts +18 -8
- package/codebase/types/ts-grid/sources/ProGrid.d.ts +50 -14
- package/codebase/types/ts-grid/sources/Selection.d.ts +28 -2
- package/codebase/types/ts-grid/sources/columnsResizer.d.ts +2 -2
- package/codebase/types/ts-grid/sources/helpers/data.d.ts +3 -3
- package/codebase/types/ts-grid/sources/helpers/default.d.ts +2 -0
- package/codebase/types/ts-grid/sources/helpers/keys.d.ts +3 -2
- package/codebase/types/ts-grid/sources/locales/en.d.ts +7 -0
- package/codebase/types/ts-grid/sources/types.d.ts +378 -338
- package/codebase/types/ts-grid/sources/ui/Cells.d.ts +4 -2
- package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +2 -0
- package/codebase/types/ts-grid/sources/ui/editors/InputEditor.d.ts +5 -3
- package/codebase/types/ts-grid/sources/ui/editors/TextAreaEditor.d.ts +3 -1
- package/codebase/types/ts-grid/sources/ui/group/panel.d.ts +12 -0
- package/codebase/types/ts-treegrid/index.d.ts +3 -0
- package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +28 -0
- package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +20 -0
- package/codebase/types/ts-treegrid/sources/types.d.ts +34 -0
- package/package.json +1 -1
- package/readme.txt +1 -1
- package/whatsnew.txt +69 -3
|
@@ -3,7 +3,7 @@ export { cssManager } from "../../ts-common/CssManager";
|
|
|
3
3
|
export { EventSystem } from "../../ts-common/events";
|
|
4
4
|
export { awaitRedraw, resizeHandler, setTheme } from "../../ts-common/dom";
|
|
5
5
|
export { Uploader } from "../../ts-vault";
|
|
6
|
-
export { DataCollection, TreeCollection, DataProxy, dataDrivers, ajax } from "../../ts-data";
|
|
6
|
+
export { DataCollection, TreeCollection, DataProxy, dataDrivers, ajax, methods } from "../../ts-data";
|
|
7
7
|
export { Layout } from "../../ts-layout";
|
|
8
8
|
export { List } from "../../ts-list";
|
|
9
9
|
export { Calendar } from "../../ts-calendar";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type fn<T extends any[], K> = (...args: T) => K;
|
|
2
2
|
type anyFunction = fn<any[], any>;
|
|
3
3
|
export declare function uid(): string;
|
|
4
|
+
export declare function extendComponent(target: any, source: any): any;
|
|
4
5
|
export declare function extend(target: any, source: any, deep?: boolean): any;
|
|
5
6
|
interface IOBj {
|
|
6
7
|
[key: string]: any;
|
|
@@ -66,4 +66,5 @@ export declare function getLabelStyle(config: any): false | {
|
|
|
66
66
|
};
|
|
67
67
|
export declare function getPageInlineCss(): string;
|
|
68
68
|
export declare function getPageLinksCss(exportStyles?: string[]): string;
|
|
69
|
+
export declare function getElementFromPoint(e: MouseEvent | TouchEvent): Element | null;
|
|
69
70
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface INumberMask {
|
|
2
|
+
prefix?: string;
|
|
3
|
+
suffix?: string;
|
|
4
|
+
groupSeparator?: string;
|
|
5
|
+
decSeparator?: string;
|
|
6
|
+
allowNegative?: boolean;
|
|
7
|
+
maxIntLength?: number;
|
|
8
|
+
maxDecLength?: number;
|
|
9
|
+
minDecLength?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface INumberMaskConfig extends INumberMask {
|
|
12
|
+
onlyView?: boolean;
|
|
13
|
+
lastCall?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function numberMask(value: string | number, options: INumberMaskConfig, input?: HTMLInputElement): string | number;
|
|
16
|
+
export declare function removeNumberMask(value: string, options: INumberMaskConfig): string;
|
|
17
|
+
export interface IPatternMask {
|
|
18
|
+
pattern: ((value: string | number) => string) | string;
|
|
19
|
+
charFormat?: {
|
|
20
|
+
[char: string]: RegExp;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function patternMask(value: string | number, options: IPatternMask | string, input?: HTMLInputElement): string;
|
|
24
|
+
export declare function removePatternMask(value: string, options: IPatternMask | string): string;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { Id } from "../../ts-common/types";
|
|
2
|
+
export type TDragItem = "row" | "group" | "column";
|
|
3
|
+
interface IDragConfig {
|
|
4
|
+
event: MouseEvent | TouchEvent;
|
|
5
|
+
type: TDragItem;
|
|
6
|
+
source?: Id[];
|
|
7
|
+
itemsForGhost?: NodeList | HTMLDivElement[] | Element[];
|
|
8
|
+
ghost?: HTMLElement;
|
|
9
|
+
groupable?: boolean;
|
|
10
|
+
groupOnly?: boolean;
|
|
11
|
+
}
|
|
2
12
|
export interface IDragManager {
|
|
3
13
|
setItem(id: Id, item: any): void;
|
|
4
|
-
onMouseDown(
|
|
14
|
+
onMouseDown(config: IDragConfig): void;
|
|
5
15
|
isDrag(): boolean;
|
|
6
16
|
cancelCanDrop(event: MouseEvent | TouchEvent): void;
|
|
7
17
|
}
|
|
8
18
|
export declare const dragManager: IDragManager;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IDataItem } from "../types";
|
|
2
|
+
export type TGroupOrderFunc = (i: IDataItem) => string;
|
|
3
|
+
export type TAggregate = "sum" | "count" | "min" | "max" | "avg" | string;
|
|
4
|
+
export interface IGroupOrder {
|
|
5
|
+
by: string | TGroupOrderFunc;
|
|
6
|
+
map?: {
|
|
7
|
+
[field: string]: [string, TAggregate] | ((i: IDataItem[]) => string | number);
|
|
8
|
+
};
|
|
9
|
+
summary?: "top" | "bottom";
|
|
10
|
+
}
|
|
11
|
+
export interface IGroupOrderConfig extends IGroupOrder {
|
|
12
|
+
by: string;
|
|
13
|
+
}
|
|
14
|
+
export type TGroupOrder = string | TGroupOrderFunc | IGroupOrder;
|
|
15
|
+
export type TDisplayMode = "original" | "column" | "row";
|
|
16
|
+
export interface IGroupConfig {
|
|
17
|
+
displayMode?: TDisplayMode;
|
|
18
|
+
showMissed?: boolean | string;
|
|
19
|
+
field?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IGroup {
|
|
22
|
+
group(order: TGroupOrder[], arr: IDataItem[], config: IGroupConfig): IDataItem[];
|
|
23
|
+
ungroup(arr?: IDataItem[]): IDataItem[];
|
|
24
|
+
isGrouped(): boolean;
|
|
25
|
+
getGroupedFields(): string[];
|
|
26
|
+
getGroupConfig(config?: IGroupConfig): IGroupConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare class Group implements IGroup {
|
|
29
|
+
private _init;
|
|
30
|
+
private _config;
|
|
31
|
+
private _groupSet;
|
|
32
|
+
constructor();
|
|
33
|
+
group(order: TGroupOrder[], arr: IDataItem[], config?: IGroupConfig): IDataItem[];
|
|
34
|
+
ungroup(modifiedData?: IDataItem[]): IDataItem[];
|
|
35
|
+
isGrouped(): boolean;
|
|
36
|
+
getGroupedFields(): string[];
|
|
37
|
+
getGroupConfig(config?: IGroupConfig): IGroupConfig;
|
|
38
|
+
private _group;
|
|
39
|
+
private _addSummaryRow;
|
|
40
|
+
private _toAggregate;
|
|
41
|
+
private _getOrderConfig;
|
|
42
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
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 } 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 } from "./types";
|
|
5
|
+
import { TGroupOrder, IGroup } from "./datacollection/group";
|
|
5
6
|
export declare class DataCollection<T extends IDataItem = IDataItem> implements IDataCollection<T> {
|
|
6
7
|
loadData: Promise<any>;
|
|
7
8
|
saveData: Promise<any>;
|
|
@@ -19,10 +20,14 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
|
|
|
19
20
|
protected _loaded: boolean;
|
|
20
21
|
protected _initOrder: T[];
|
|
21
22
|
protected _filters: IFilter;
|
|
23
|
+
protected _group: IGroup;
|
|
22
24
|
private _changes;
|
|
23
25
|
private _loader;
|
|
24
26
|
constructor(config?: any, events?: IEventSystem<any>);
|
|
25
27
|
protected _reset(): void;
|
|
28
|
+
group(order: TGroupOrder[], config?: IGroupDataConfig): void;
|
|
29
|
+
ungroup(): void;
|
|
30
|
+
isGrouped(): boolean;
|
|
26
31
|
add(newItem: IDataItem, index?: number): Id;
|
|
27
32
|
add(newItem: IDataItem[], index?: number): Id[];
|
|
28
33
|
remove(id: Id | Id[]): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Item = {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
};
|
|
4
|
+
export declare const methods: {
|
|
5
|
+
sum: (items: Item[], field: string) => number;
|
|
6
|
+
avg: (items: Item[], field: string) => number;
|
|
7
|
+
count: (items: Item[], field: string) => number;
|
|
8
|
+
min: (items: Item[], field: string) => number;
|
|
9
|
+
max: (items: Item[], field: string) => number;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
2
|
import { anyFunction, IAnyObj, Id } from "../../ts-common/types";
|
|
3
|
+
import { IGroupConfig, TGroupOrder } from "./datacollection/group";
|
|
4
|
+
import { TDragItem } from "./DragManager";
|
|
3
5
|
export interface IDataProxy {
|
|
4
6
|
url: string;
|
|
5
7
|
config?: any;
|
|
@@ -74,12 +76,18 @@ export interface IDataConfig {
|
|
|
74
76
|
collapsed?: boolean;
|
|
75
77
|
rootId?: Id;
|
|
76
78
|
}
|
|
79
|
+
export interface IGroupDataConfig extends IGroupConfig {
|
|
80
|
+
data?: IDataItem[];
|
|
81
|
+
}
|
|
77
82
|
export interface IDataCollection<T extends IDataItem = IDataItem> {
|
|
78
83
|
config: IDataConfig;
|
|
79
84
|
events: IEventSystem<DataEvents>;
|
|
80
85
|
dataProxy: IDataProxy;
|
|
81
86
|
loadData: Promise<any>;
|
|
82
87
|
saveData: Promise<any>;
|
|
88
|
+
group(order: TGroupOrder[], config?: IGroupDataConfig): void;
|
|
89
|
+
ungroup(): void;
|
|
90
|
+
isGrouped(): boolean;
|
|
83
91
|
load(url: IDataProxy | string, driver?: IDataDriver | DataDriver): Promise<any>;
|
|
84
92
|
parse(data: T[] | string, driver?: DataDriver | IDataDriver): void;
|
|
85
93
|
$parse(data: any[]): void;
|
|
@@ -215,6 +223,10 @@ export interface ITransferData {
|
|
|
215
223
|
start?: Id;
|
|
216
224
|
source?: Id[];
|
|
217
225
|
target?: Id;
|
|
226
|
+
type?: TDragItem;
|
|
227
|
+
isWasColumn?: boolean;
|
|
228
|
+
groupable?: boolean;
|
|
229
|
+
groupOnly?: boolean;
|
|
218
230
|
}
|
|
219
231
|
export interface IDragConfig {
|
|
220
232
|
dragCopy?: boolean;
|
|
@@ -240,7 +252,11 @@ export declare enum DataEvents {
|
|
|
240
252
|
beforeLazyLoad = "beforelazyload",
|
|
241
253
|
afterLazyLoad = "afterlazyload",
|
|
242
254
|
beforeItemLoad = "beforeItemLoad",
|
|
243
|
-
afterItemLoad = "afterItemLoad"
|
|
255
|
+
afterItemLoad = "afterItemLoad",
|
|
256
|
+
beforeGroup = "beforeGroup",
|
|
257
|
+
afterGroup = "afterGroup",
|
|
258
|
+
beforeUnGroup = "beforeUnGroup",
|
|
259
|
+
afterUnGroup = "afterUnGroup"
|
|
244
260
|
}
|
|
245
261
|
export interface IDataEventsHandlersMap {
|
|
246
262
|
[key: string]: (...args: any[]) => any;
|
|
@@ -258,6 +274,10 @@ export interface IDataEventsHandlersMap {
|
|
|
258
274
|
[DataEvents.afterItemLoad]: (id: Id) => void;
|
|
259
275
|
[DataEvents.beforeLazyLoad]: () => boolean | void;
|
|
260
276
|
[DataEvents.afterLazyLoad]: (from: number, count: number) => void;
|
|
277
|
+
[DataEvents.beforeGroup]: (config: IGroupConfig) => boolean | void;
|
|
278
|
+
[DataEvents.afterGroup]: (grouped: string[], config: IGroupConfig) => void;
|
|
279
|
+
[DataEvents.beforeUnGroup]: (grouped: string[], config: IGroupConfig) => boolean | void;
|
|
280
|
+
[DataEvents.afterUnGroup]: (grouped: string[], config: IGroupConfig) => void;
|
|
261
281
|
}
|
|
262
282
|
export declare enum DragEvents {
|
|
263
283
|
beforeDrag = "beforeDrag",
|
|
@@ -275,21 +295,20 @@ export interface IDragInfo {
|
|
|
275
295
|
source: Id[];
|
|
276
296
|
target: Id;
|
|
277
297
|
dropPosition?: DropPosition;
|
|
278
|
-
dragItem?: "row" | "column";
|
|
279
298
|
}
|
|
280
299
|
export type DragMode = "target" | "both" | "source";
|
|
281
300
|
export type DropBehaviour = "child" | "sibling" | "complex";
|
|
282
301
|
export interface IDragEventsHandlersMap {
|
|
283
302
|
[key: string]: (...args: any[]) => any;
|
|
284
|
-
[DragEvents.beforeDrag]: (data: IDragInfo, events: MouseEvent, ghost: HTMLElement) => void | boolean;
|
|
285
|
-
[DragEvents.dragStart]: (data: IDragInfo, events: MouseEvent) => void;
|
|
286
|
-
[DragEvents.dragOut]: (data: IDragInfo, events: MouseEvent) => void;
|
|
287
|
-
[DragEvents.dragIn]: (data: IDragInfo, events: MouseEvent) => void | boolean;
|
|
288
|
-
[DragEvents.canDrop]: (data: IDragInfo, events: MouseEvent) => void;
|
|
289
|
-
[DragEvents.cancelDrop]: (data: IDragInfo, events: MouseEvent) => void;
|
|
290
|
-
[DragEvents.beforeDrop]: (data: IDragInfo, events: MouseEvent) => void | boolean;
|
|
291
|
-
[DragEvents.afterDrop]: (data: IDragInfo, events: MouseEvent) => any;
|
|
292
|
-
[DragEvents.afterDrag]: (data: IDragInfo, events: MouseEvent) => any;
|
|
303
|
+
[DragEvents.beforeDrag]: (data: IDragInfo, events: MouseEvent, ghost: HTMLElement, type: TDragItem) => void | boolean;
|
|
304
|
+
[DragEvents.dragStart]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
305
|
+
[DragEvents.dragOut]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
306
|
+
[DragEvents.dragIn]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
|
|
307
|
+
[DragEvents.canDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
308
|
+
[DragEvents.cancelDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
309
|
+
[DragEvents.beforeDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
|
|
310
|
+
[DragEvents.afterDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
|
|
311
|
+
[DragEvents.afterDrag]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
|
|
293
312
|
}
|
|
294
313
|
export declare enum DataDriver {
|
|
295
314
|
json = "json",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { INumberMask, IPatternMask } from "../../../ts-common/input";
|
|
1
2
|
import { Label } from "./helper/label";
|
|
2
3
|
import { IEventSystem } from "../../../ts-common/events";
|
|
3
4
|
import { ItemEvent, IBaseLayoutItem, ILabel, IMessage, IBaseItem, IBaseState, IBaseHandlersMap } from "../types";
|
|
@@ -25,6 +26,8 @@ export interface IInputProps extends IBaseLayoutItem, ILabel, IMessage {
|
|
|
25
26
|
min?: number | string;
|
|
26
27
|
max?: number | string;
|
|
27
28
|
step?: number | string;
|
|
29
|
+
numberMask?: INumberMask | boolean;
|
|
30
|
+
patternMask?: IPatternMask | string;
|
|
28
31
|
}
|
|
29
32
|
export interface IInputConfig extends IBaseItem, IBaseState, IInputProps {
|
|
30
33
|
type: "input";
|
|
@@ -45,6 +48,7 @@ export interface IInput {
|
|
|
45
48
|
clearValidate(): void;
|
|
46
49
|
setValue(value: string | number): void;
|
|
47
50
|
getValue(): string | number;
|
|
51
|
+
getText(): string;
|
|
48
52
|
isFocused(): boolean;
|
|
49
53
|
focus(): void;
|
|
50
54
|
blur(): void;
|
|
@@ -91,6 +95,7 @@ export declare class Input extends Label implements IInput {
|
|
|
91
95
|
clear(): void;
|
|
92
96
|
setValue(value: string | number): void;
|
|
93
97
|
getValue(): string | number;
|
|
98
|
+
getText(): string;
|
|
94
99
|
isFocused(): boolean;
|
|
95
100
|
focus(): void;
|
|
96
101
|
blur(): void;
|
|
@@ -104,4 +109,6 @@ export declare class Input extends Label implements IInput {
|
|
|
104
109
|
onkeydown: (event: KeyboardEvent) => void;
|
|
105
110
|
};
|
|
106
111
|
protected _draw(): any;
|
|
112
|
+
protected _applyValuePattern(value: string | number, input?: HTMLInputElement | null, onlyView?: boolean): string | number;
|
|
113
|
+
protected _removeValuePattern(value: string, lastCall?: boolean): string;
|
|
107
114
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Input, IInputProps } from "./input";
|
|
2
2
|
import { ItemEvent, ValidationFn, IBaseItem, IBaseState, IBaseLayoutItem, ILabel, IMessage, IBaseHandlersMap } from "../types";
|
|
3
3
|
import { IEventSystem } from "../../../ts-common/events";
|
|
4
|
+
import { INumberMask, IPatternMask } from "../../../ts-common/input";
|
|
4
5
|
import { IFieldset } from "./fieldset";
|
|
5
6
|
export interface ITextAreaProps extends IBaseLayoutItem, ILabel, IMessage {
|
|
6
7
|
validation?: ValidationFn;
|
|
@@ -9,6 +10,8 @@ export interface ITextAreaProps extends IBaseLayoutItem, ILabel, IMessage {
|
|
|
9
10
|
maxlength?: number | string;
|
|
10
11
|
minlength?: number | string;
|
|
11
12
|
resizable?: boolean;
|
|
13
|
+
numberMask?: INumberMask | boolean;
|
|
14
|
+
patternMask?: IPatternMask | string;
|
|
12
15
|
}
|
|
13
16
|
export interface ITextAreaConfig extends IBaseItem, IBaseState, ITextAreaProps {
|
|
14
17
|
type: "textarea";
|
|
@@ -29,6 +32,7 @@ export interface ITextArea {
|
|
|
29
32
|
clearValidate(): void;
|
|
30
33
|
setValue(value: string): void;
|
|
31
34
|
getValue(): string;
|
|
35
|
+
getText(): string;
|
|
32
36
|
focus(): void;
|
|
33
37
|
blur(): void;
|
|
34
38
|
clear(): void;
|
|
@@ -60,9 +64,6 @@ export declare class Textarea extends Input implements ITextArea {
|
|
|
60
64
|
protected _propsItem: string[];
|
|
61
65
|
protected _props: string[];
|
|
62
66
|
getValue(): string;
|
|
63
|
-
isFocused(): boolean;
|
|
64
|
-
focus(): void;
|
|
65
|
-
blur(): void;
|
|
66
67
|
setProperties(propertyConfig: ITextAreaProps & IInputProps): void;
|
|
67
68
|
getProperties(): ITextAreaProps & IInputProps;
|
|
68
69
|
protected _initView(config: ITextAreaConfig): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./sources/Grid";
|
|
2
|
+
export * from "./sources/ExtendedGrid";
|
|
2
3
|
export * from "./sources/ProGrid";
|
|
3
4
|
export * from "./sources/types";
|
|
4
5
|
export * from "./sources/helpers/cells";
|
|
5
|
-
export { getTreeCell } from "./sources/ui/Cells";
|
|
6
6
|
export * from "./sources/helpers/data";
|
|
7
7
|
export * from "./sources/helpers/main";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig } from "./types";
|
|
2
|
+
import { IDataCollection, IDataItem } from "../../ts-data";
|
|
3
|
+
import { ScrollView } from "../../ts-common/ScrollView";
|
|
4
|
+
import { Grid } from "./Grid";
|
|
5
|
+
export declare class ExtendedGrid extends Grid implements IExtendedGrid {
|
|
6
|
+
scrollView: ScrollView;
|
|
7
|
+
config: IExtendedGridConfig;
|
|
8
|
+
constructor(container: HTMLElement | string | null, config?: IExtendedGridConfig);
|
|
9
|
+
protected _createView(): any;
|
|
10
|
+
protected _setEventHandlers(): void;
|
|
11
|
+
protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
|
|
12
|
+
protected _prepareData(data: IDataItem[] | IDataCollection): IDataItem[] | IRow[];
|
|
13
|
+
protected _prepareDataFromTo(data: IDataCollection, from: number, to: number): IDataItem[];
|
|
14
|
+
protected _dragStart(event: any): void;
|
|
15
|
+
protected _group(order: IGroupOrderItem[]): void;
|
|
16
|
+
private _lazyLoad;
|
|
17
|
+
private _getGhostItem;
|
|
18
|
+
private _dragStartColumn;
|
|
19
|
+
private _dragStartGroupItem;
|
|
20
|
+
private _changeGroupItemAfterSort;
|
|
21
|
+
private _isGroupableColumn;
|
|
22
|
+
private _isGroupClosable;
|
|
23
|
+
}
|
|
@@ -4,7 +4,8 @@ import { Id, ITouchParam } from "../../ts-common/types";
|
|
|
4
4
|
import { View } from "../../ts-common/view";
|
|
5
5
|
import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap } from "../../ts-data";
|
|
6
6
|
import { Exporter } from "./Exporter";
|
|
7
|
-
import {
|
|
7
|
+
import { ISelection } from "./Selection";
|
|
8
|
+
import { Dirs, EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, ISortingState, SortFunction, IHeaderFilter, IAdjustColumns, IDirection, IFooter, IHeader, INormalizeColumnsParams, ISummaryList } from "./types";
|
|
8
9
|
export declare class Grid extends View implements IGrid {
|
|
9
10
|
version: string;
|
|
10
11
|
name: "grid";
|
|
@@ -16,16 +17,20 @@ export declare class Grid extends View implements IGrid {
|
|
|
16
17
|
selection: ISelection;
|
|
17
18
|
keyManager: IKeyManager;
|
|
18
19
|
protected _touch: ITouchParam;
|
|
20
|
+
protected _destructed: boolean;
|
|
19
21
|
protected _scroll: IScrollState;
|
|
20
22
|
protected _events: IEventSystem<GridSystemEvents, ISystemEventHandlersMap>;
|
|
21
23
|
protected _htmlEvents: any;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
protected _sortState: {
|
|
25
|
+
by: Id;
|
|
26
|
+
dir: Dirs;
|
|
27
|
+
};
|
|
25
28
|
protected _activeFilters: object;
|
|
29
|
+
private _filterData;
|
|
26
30
|
private _hiddenFilters;
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
private _commonSummary;
|
|
32
|
+
private _colSummary;
|
|
33
|
+
constructor(container: HTMLElement | string | null, config?: IGridConfig);
|
|
29
34
|
destructor(): void;
|
|
30
35
|
setColumns(columns: ICol[]): void;
|
|
31
36
|
addRowCss(rowId: Id, css: string): void;
|
|
@@ -54,6 +59,7 @@ export declare class Grid extends View implements IGrid {
|
|
|
54
59
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
55
60
|
edit(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
56
61
|
paint(): void;
|
|
62
|
+
getSummary(colId?: Id): ISummaryList;
|
|
57
63
|
protected _createView(): any;
|
|
58
64
|
protected _parseColumns(configChanged?: boolean): void;
|
|
59
65
|
protected normalizeColumns({ config, columns, configChanged }: INormalizeColumnsParams): void;
|
|
@@ -63,7 +69,7 @@ export declare class Grid extends View implements IGrid {
|
|
|
63
69
|
protected _getRowIndex(rowId: Id): number;
|
|
64
70
|
protected _setEventHandlers(): void;
|
|
65
71
|
protected _addEmptyRow(): void;
|
|
66
|
-
protected _sort(by: Id,
|
|
72
|
+
protected _sort(by: Id, sortAs?: SortFunction): void;
|
|
67
73
|
protected _clearTouchTimer(): void;
|
|
68
74
|
protected _checkFilters(reset?: boolean): void;
|
|
69
75
|
protected _setUniqueData(sync?: boolean): void;
|
|
@@ -81,6 +87,10 @@ export declare class Grid extends View implements IGrid {
|
|
|
81
87
|
protected _normalizeDataType(): void;
|
|
82
88
|
protected _applyLocalFilter(beforePrepareData?: boolean): void;
|
|
83
89
|
protected _normalizeSpans(): void;
|
|
90
|
+
protected _hideColumn(column: ICol): void;
|
|
91
|
+
protected _showColumn(column: ICol): void;
|
|
92
|
+
protected _setSummary(): void;
|
|
93
|
+
private _applyMethod;
|
|
84
94
|
private _canDataParse;
|
|
85
95
|
private _init;
|
|
86
96
|
private _attachDataCollection;
|
|
@@ -92,6 +102,6 @@ export declare class Grid extends View implements IGrid {
|
|
|
92
102
|
private _render;
|
|
93
103
|
private _initHotKey;
|
|
94
104
|
private _normalizeConfig;
|
|
95
|
-
|
|
105
|
+
protected _autoScroll(mode: IDirection): void;
|
|
96
106
|
private _applyAutoWidth;
|
|
97
107
|
}
|
|
@@ -1,17 +1,53 @@
|
|
|
1
|
-
import { IGridConfig, ICol, IRow, IProGrid, IFooter, IHeader } from "./types";
|
|
2
|
-
import { IDataCollection, IDataItem } from "../../ts-data";
|
|
3
1
|
import { ScrollView } from "../../ts-common/ScrollView";
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { ITreeEventHandlersMap, TreeGridCollection, TreeGridEvents } from "../../ts-treegrid";
|
|
3
|
+
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IHeaderFilter, IProGrid, IProGridConfig, ISortingState, ISpan, ISummaryList } from "./types";
|
|
4
|
+
import { IKeyManager } from "../../ts-common/KeyManager";
|
|
5
|
+
import { IEventSystem } from "../../ts-common/events";
|
|
6
|
+
import { Id } from "../../ts-common/types";
|
|
7
|
+
import { DataEvents, DragEvents, IDataEventsHandlersMap, IDragEventsHandlersMap, IDataCollection, IDataItem } from "../../ts-data";
|
|
8
|
+
import { ISelection } from "./Selection";
|
|
9
|
+
export declare class ProGrid implements IProGrid {
|
|
10
|
+
config: IProGridConfig;
|
|
6
11
|
scrollView: ScrollView;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
events: IEventSystem<GridEvents | DataEvents | DragEvents | TreeGridEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap & ITreeEventHandlersMap>;
|
|
13
|
+
name: string;
|
|
14
|
+
data: IDataCollection<IDataItem> & TreeGridCollection;
|
|
15
|
+
selection: ISelection;
|
|
16
|
+
content: IContentList;
|
|
17
|
+
keyManager: IKeyManager;
|
|
18
|
+
export: any;
|
|
19
|
+
constructor(container: HTMLElement | string | null, config?: IProGridConfig);
|
|
20
|
+
paint(): void;
|
|
21
|
+
destructor(): void;
|
|
22
|
+
expand(rowId: Id): void;
|
|
23
|
+
collapse(rowId: Id): void;
|
|
24
|
+
expandAll(): void;
|
|
25
|
+
collapseAll(): void;
|
|
26
|
+
showColumn(colId: Id): void;
|
|
27
|
+
hideColumn(colId: Id): void;
|
|
28
|
+
isColumnHidden(colId: Id): boolean;
|
|
29
|
+
showRow(rowId: Id): void;
|
|
30
|
+
hideRow(rowId: Id): void;
|
|
31
|
+
isRowHidden(rowId: Id): boolean;
|
|
32
|
+
scrollTo(rowId: Id, colId: Id): void;
|
|
33
|
+
scroll(x?: number, y?: number): void;
|
|
34
|
+
getScrollState(): ICoords;
|
|
35
|
+
setColumns(col: ICol[]): void;
|
|
36
|
+
addRowCss(rowId: Id, css: string): void;
|
|
37
|
+
removeRowCss(rowId: Id, css: string): void;
|
|
38
|
+
addCellCss(rowId: Id, colId: Id, css: string): void;
|
|
39
|
+
removeCellCss(rowId: Id, colId: Id, css: string): void;
|
|
40
|
+
adjustColumnWidth(colId: Id, adjust?: IAdjustBy): void;
|
|
41
|
+
getCellRect(rowId: Id, colId: Id): ICellRect;
|
|
42
|
+
getColumn(colId: Id): ICol;
|
|
43
|
+
addSpan(spanObj: ISpan): void;
|
|
44
|
+
getSpan(rowId: Id, colId: Id): ISpan;
|
|
45
|
+
removeSpan(rowId: Id, colId: Id): void;
|
|
46
|
+
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
47
|
+
editEnd(withoutSave?: boolean): void;
|
|
48
|
+
getSortingState(): ISortingState;
|
|
49
|
+
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
50
|
+
getSummary(colId?: Id): ISummaryList;
|
|
51
|
+
getRootNode(): HTMLElement;
|
|
52
|
+
getRootView(): void;
|
|
17
53
|
}
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import { VNode } from "../../ts-common/dom";
|
|
2
2
|
import { IEventSystem } from "../../ts-common/events";
|
|
3
|
-
import { ICell, IGrid,
|
|
3
|
+
import { ICell, IGrid, IRow, ICol, IProGrid } from "./types";
|
|
4
4
|
import { Id } from "../../ts-common/types";
|
|
5
|
+
export interface ISelectionConfig {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ISelection {
|
|
9
|
+
config?: ISelectionConfig;
|
|
10
|
+
setCell(rowId?: IRow | Id, colId?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
11
|
+
getCell(): ICell | void;
|
|
12
|
+
getCells(): ICell[];
|
|
13
|
+
removeCell(rowId?: Id, colId?: Id): void;
|
|
14
|
+
disable(): void;
|
|
15
|
+
enable(): void;
|
|
16
|
+
toHTML(): VNode | VNode[];
|
|
17
|
+
}
|
|
18
|
+
export declare enum GridSelectionEvents {
|
|
19
|
+
beforeUnSelect = "beforeUnSelect",
|
|
20
|
+
afterUnSelect = "afterUnSelect",
|
|
21
|
+
beforeSelect = "beforeSelect",
|
|
22
|
+
afterSelect = "afterSelect"
|
|
23
|
+
}
|
|
24
|
+
export interface IGridSelectionEventsHandlersMap {
|
|
25
|
+
[key: string]: (...args: any[]) => any;
|
|
26
|
+
[GridSelectionEvents.afterSelect]: (row: IRow, col: ICol) => void;
|
|
27
|
+
[GridSelectionEvents.afterUnSelect]: (row: IRow, col: ICol) => void;
|
|
28
|
+
[GridSelectionEvents.beforeSelect]: (row: IRow, col: ICol) => boolean | void;
|
|
29
|
+
[GridSelectionEvents.beforeUnSelect]: (row: IRow, col: ICol) => boolean | void;
|
|
30
|
+
}
|
|
5
31
|
export declare class Selection implements ISelection {
|
|
6
32
|
events: IEventSystem<GridSelectionEvents, IGridSelectionEventsHandlersMap>;
|
|
7
33
|
config: ISelectionConfig;
|
|
@@ -11,7 +37,7 @@ export declare class Selection implements ISelection {
|
|
|
11
37
|
private _selectedCells;
|
|
12
38
|
private _type;
|
|
13
39
|
private _multiselection;
|
|
14
|
-
constructor(grid: IGrid, config?: ISelectionConfig, events?: IEventSystem<any>, gridId?: Id);
|
|
40
|
+
constructor(grid: IGrid | IProGrid, config?: ISelectionConfig, events?: IEventSystem<any>, gridId?: Id);
|
|
15
41
|
setCell(row?: IRow | Id, col?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
16
42
|
removeCell(rowId?: Id, colId?: Id): void;
|
|
17
43
|
getCell(): ICell | void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IGrid } from "./types";
|
|
2
|
-
export declare function startResize(grid: IGrid, column: string, ev: MouseEvent & TouchEvent, cb: any): void;
|
|
1
|
+
import { IGrid, IProGrid } from "./types";
|
|
2
|
+
export declare function startResize(grid: IGrid | IProGrid, column: string, ev: MouseEvent & TouchEvent, cb: any): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IContainerConfig } from "../../../ts-common/core";
|
|
2
|
-
import { ICol, IColumnsWidth, IGridConfig, IRow,
|
|
2
|
+
import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption } from "./../types";
|
|
3
3
|
export declare function normalizeArray(obj: any, name: string): void;
|
|
4
4
|
export declare function measureTextHeight({ text, width, lineHeight, font, htmlEnable, }: {
|
|
5
5
|
text?: string;
|
|
@@ -22,8 +22,8 @@ export declare const getCalculatedRowHeight: (height: number, config?: {
|
|
|
22
22
|
padding?: number;
|
|
23
23
|
}) => number;
|
|
24
24
|
export declare const getTreeCellWidthOffset: (row: IRow, toArrow?: boolean) => number;
|
|
25
|
-
export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config
|
|
26
|
-
export declare function
|
|
25
|
+
export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config: IContainerConfig, target: AdjustTargetType) => IColumnsWidth;
|
|
26
|
+
export declare function applyPattern(value: string | number | boolean, col: ICol): string | number | boolean;
|
|
27
27
|
export declare function getEditorOptions(col: ICol, row?: IRow): TOption[];
|
|
28
28
|
export declare function getValueForNumberColumn(col: ICol, value: any): any;
|
|
29
29
|
export declare function getEditorValue(value: any, options: TOption[]): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IGrid, IDirection } from "../types";
|
|
2
|
-
export declare function selectionMove(e: KeyboardEvent, grid: IGrid, dir: IDirection, range: number, toEnd?: boolean, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
1
|
+
import { IGrid, IDirection, IProGrid } from "../types";
|
|
2
|
+
export declare function selectionMove(e: KeyboardEvent, grid: IGrid | IProGrid, dir: IDirection, range: number, toEnd?: boolean, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
3
3
|
export declare function getKeysHandlers(grid: any): {
|
|
4
4
|
enter: () => void;
|
|
5
5
|
space: (e: any) => void;
|
|
@@ -7,6 +7,7 @@ export declare function getKeysHandlers(grid: any): {
|
|
|
7
7
|
tab: (e: any) => void;
|
|
8
8
|
"shift+tab": (e: any) => void;
|
|
9
9
|
arrowUp: (e: any) => void;
|
|
10
|
+
"ctrl+enter": () => void;
|
|
10
11
|
"ctrl+arrowUp": (e: any) => void;
|
|
11
12
|
"shift+arrowUp": (e: any) => void;
|
|
12
13
|
"ctrl+shift+arrowUp": (e: any) => void;
|