dhx-suite 8.4.6 → 9.0.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-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 +14 -5
- package/codebase/types/ts-data/sources/helpers.d.ts +1 -1
- package/codebase/types/ts-data/sources/methods.d.ts +11 -0
- package/codebase/types/ts-data/sources/treecollection.d.ts +9 -3
- package/codebase/types/ts-data/sources/types.d.ts +31 -13
- 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/Exporter.d.ts +23 -19
- package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +23 -0
- package/codebase/types/ts-grid/sources/Grid.d.ts +19 -9
- 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 -351
- 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-tree/sources/Tree.d.ts +0 -1
- 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 +82 -0
|
@@ -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,16 @@ 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
|
-
protected _reset(
|
|
27
|
+
protected _reset(config?: {
|
|
28
|
+
grouping?: boolean;
|
|
29
|
+
}): void;
|
|
30
|
+
group(order: TGroupOrder[], config?: IGroupDataConfig): void;
|
|
31
|
+
ungroup(): void;
|
|
32
|
+
isGrouped(): boolean;
|
|
26
33
|
add(newItem: IDataItem, index?: number): Id;
|
|
27
34
|
add(newItem: IDataItem[], index?: number): Id[];
|
|
28
35
|
remove(id: Id | Id[]): void;
|
|
@@ -65,11 +72,11 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
|
|
|
65
72
|
getMetaMap(obj: T): any;
|
|
66
73
|
setRange(from: number, to: number): void;
|
|
67
74
|
getRawData(from: number, to: number, order?: T[], mode?: number): T[];
|
|
68
|
-
protected _add(newItem: IDataItem, index
|
|
75
|
+
protected _add(newItem: IDataItem, index?: number): Id;
|
|
69
76
|
protected _remove(id: Id): void;
|
|
70
77
|
protected _copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number): Id;
|
|
71
78
|
protected _move(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number, newId?: Id): Id;
|
|
72
|
-
protected _addCore(obj: IDataItem, index
|
|
79
|
+
protected _addCore(obj: IDataItem, index?: number): Id;
|
|
73
80
|
protected _removeCore(id: Id): void;
|
|
74
81
|
protected _parse_data(data: any[]): void;
|
|
75
82
|
protected _approximate(data: any[], values: string[], maxNum: number): any[];
|
|
@@ -77,8 +84,10 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
|
|
|
77
84
|
protected _addToOrder(array: any[], obj: any, index?: number): void;
|
|
78
85
|
protected _applySorters(by?: ISortMode): void;
|
|
79
86
|
protected _applyFilters(rule?: IFilterMode | IFilterCallback): void;
|
|
80
|
-
protected _reapplyFilters(
|
|
87
|
+
protected _reapplyFilters(): void;
|
|
81
88
|
protected _getRuleCallback(rule: IFilterMode): IFilterCallback;
|
|
82
89
|
protected _getPureFilters(filters: IFilter): IFilter;
|
|
83
90
|
protected _normalizeFilters(filters: any): any;
|
|
91
|
+
protected _checkFilterRule(rule: IFilterMode | IFilterCallback): boolean;
|
|
92
|
+
private _parse;
|
|
84
93
|
}
|
|
@@ -3,7 +3,7 @@ import { DataProxy } from "./dataproxy";
|
|
|
3
3
|
import { IFilterCallback, IFilterMode, IDataCollection, IDataItem, ITreeCollection, DataDriver, IDataDriver, IFilter } from "./types";
|
|
4
4
|
export declare function isEqualObj(a: any, b: any): boolean;
|
|
5
5
|
export declare function naturalCompare(a: any, b: any): any;
|
|
6
|
-
export declare function findByConf(item:
|
|
6
|
+
export declare function findByConf(item: IDataItem, conf: IFilterMode | IFilterCallback, index?: number, array?: IDataItem[]): IDataItem;
|
|
7
7
|
export declare function isDebug(): boolean;
|
|
8
8
|
export declare function dhxWarning(msg: string): void;
|
|
9
9
|
export declare function dhxError(msg: string): 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,6 +1,6 @@
|
|
|
1
1
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
2
|
import { DataCollection } from "./datacollection";
|
|
3
|
-
import { DataCallback, DataEvents, IDataCollection, IDataItem, ITreeCollection, IFilterCallback, IFilterMode, IFilterComplexMode, ITreeFilterConfig, DataDriver, ISortMode, IDataDriver } from "./types";
|
|
3
|
+
import { DataCallback, DataEvents, IDataCollection, IDataItem, ITreeCollection, IFilterCallback, IFilterMode, IFilterComplexMode, ITreeFilterConfig, DataDriver, ISortMode, IDataDriver, IUpdateObject, ISortConfig } from "./types";
|
|
4
4
|
import { Id } from "../../ts-common/types";
|
|
5
5
|
export declare class TreeCollection<T extends IDataItem = IDataItem> extends DataCollection<T> implements ITreeCollection<T> {
|
|
6
6
|
protected _childs: {
|
|
@@ -16,8 +16,9 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
|
|
|
16
16
|
getItems(id: Id): T[];
|
|
17
17
|
getLength(id?: Id): number;
|
|
18
18
|
removeAll(id?: Id): void;
|
|
19
|
+
update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
|
|
19
20
|
getIndex(id: Id): number;
|
|
20
|
-
sort(rule?: ISortMode): void;
|
|
21
|
+
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
21
22
|
filter(rule?: IFilterMode | IFilterComplexMode | IFilterCallback, config?: ITreeFilterConfig, silent?: boolean): string;
|
|
22
23
|
restoreOrder(): void;
|
|
23
24
|
copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id;
|
|
@@ -41,7 +42,10 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
|
|
|
41
42
|
protected _setParent(item: IDataItem, parent: Id): void;
|
|
42
43
|
protected _copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number): Id;
|
|
43
44
|
protected _move(id: Id, index: number, target?: ITreeCollection | IDataCollection, targetId?: Id, key?: number): Id;
|
|
44
|
-
protected _reset(
|
|
45
|
+
protected _reset(config: {
|
|
46
|
+
id?: Id;
|
|
47
|
+
grouping: any;
|
|
48
|
+
}): void;
|
|
45
49
|
protected _removeCore(id: any): void;
|
|
46
50
|
protected _addToOrder(_order: any, obj: any, index: number): void;
|
|
47
51
|
protected _parse_data(data: any, parent?: Id): void;
|
|
@@ -50,4 +54,6 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
|
|
|
50
54
|
private _serialize;
|
|
51
55
|
private _applyFilter;
|
|
52
56
|
protected _normalizeFilters(filters: any): any;
|
|
57
|
+
protected _checkFilterRule(rule: IFilterMode | IFilterComplexMode | IFilterCallback): boolean;
|
|
58
|
+
protected _applySorters(by?: ISortMode): void;
|
|
53
59
|
}
|
|
@@ -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;
|
|
@@ -66,7 +68,6 @@ export interface IApproximate {
|
|
|
66
68
|
maxNum: number;
|
|
67
69
|
}
|
|
68
70
|
export interface IDataConfig {
|
|
69
|
-
prep?: anyFunction;
|
|
70
71
|
init?: anyFunction;
|
|
71
72
|
update?: anyFunction;
|
|
72
73
|
approximate?: IApproximate;
|
|
@@ -74,12 +75,18 @@ export interface IDataConfig {
|
|
|
74
75
|
collapsed?: boolean;
|
|
75
76
|
rootId?: Id;
|
|
76
77
|
}
|
|
78
|
+
export interface IGroupDataConfig extends IGroupConfig {
|
|
79
|
+
data?: IDataItem[];
|
|
80
|
+
}
|
|
77
81
|
export interface IDataCollection<T extends IDataItem = IDataItem> {
|
|
78
82
|
config: IDataConfig;
|
|
79
83
|
events: IEventSystem<DataEvents>;
|
|
80
84
|
dataProxy: IDataProxy;
|
|
81
85
|
loadData: Promise<any>;
|
|
82
86
|
saveData: Promise<any>;
|
|
87
|
+
group(order: TGroupOrder[], config?: IGroupDataConfig): void;
|
|
88
|
+
ungroup(): void;
|
|
89
|
+
isGrouped(): boolean;
|
|
83
90
|
load(url: IDataProxy | string, driver?: IDataDriver | DataDriver): Promise<any>;
|
|
84
91
|
parse(data: T[] | string, driver?: DataDriver | IDataDriver): void;
|
|
85
92
|
$parse(data: any[]): void;
|
|
@@ -170,7 +177,7 @@ export interface ITreeCollection<T extends IDataItem = IDataItem> extends IDataC
|
|
|
170
177
|
getLength(id?: Id): number;
|
|
171
178
|
getIndex(id: Id): number;
|
|
172
179
|
getItems(id: Id): T[];
|
|
173
|
-
sort(rule?: ISortMode): void;
|
|
180
|
+
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
174
181
|
map(callback: DataCallback<T>, parent?: Id, direct?: boolean): any;
|
|
175
182
|
filter(rule?: IFilterMode | IFilterCallback, config?: ITreeFilterConfig, silent?: boolean): string;
|
|
176
183
|
restoreOrder(): void;
|
|
@@ -215,6 +222,10 @@ export interface ITransferData {
|
|
|
215
222
|
start?: Id;
|
|
216
223
|
source?: Id[];
|
|
217
224
|
target?: Id;
|
|
225
|
+
type?: TDragItem;
|
|
226
|
+
isWasColumn?: boolean;
|
|
227
|
+
groupable?: boolean;
|
|
228
|
+
groupOnly?: boolean;
|
|
218
229
|
}
|
|
219
230
|
export interface IDragConfig {
|
|
220
231
|
dragCopy?: boolean;
|
|
@@ -240,7 +251,11 @@ export declare enum DataEvents {
|
|
|
240
251
|
beforeLazyLoad = "beforelazyload",
|
|
241
252
|
afterLazyLoad = "afterlazyload",
|
|
242
253
|
beforeItemLoad = "beforeItemLoad",
|
|
243
|
-
afterItemLoad = "afterItemLoad"
|
|
254
|
+
afterItemLoad = "afterItemLoad",
|
|
255
|
+
beforeGroup = "beforeGroup",
|
|
256
|
+
afterGroup = "afterGroup",
|
|
257
|
+
beforeUnGroup = "beforeUnGroup",
|
|
258
|
+
afterUnGroup = "afterUnGroup"
|
|
244
259
|
}
|
|
245
260
|
export interface IDataEventsHandlersMap {
|
|
246
261
|
[key: string]: (...args: any[]) => any;
|
|
@@ -258,6 +273,10 @@ export interface IDataEventsHandlersMap {
|
|
|
258
273
|
[DataEvents.afterItemLoad]: (id: Id) => void;
|
|
259
274
|
[DataEvents.beforeLazyLoad]: () => boolean | void;
|
|
260
275
|
[DataEvents.afterLazyLoad]: (from: number, count: number) => void;
|
|
276
|
+
[DataEvents.beforeGroup]: (config: IGroupConfig) => boolean | void;
|
|
277
|
+
[DataEvents.afterGroup]: (grouped: string[], config: IGroupConfig) => void;
|
|
278
|
+
[DataEvents.beforeUnGroup]: (grouped: string[], config: IGroupConfig) => boolean | void;
|
|
279
|
+
[DataEvents.afterUnGroup]: (grouped: string[], config: IGroupConfig) => void;
|
|
261
280
|
}
|
|
262
281
|
export declare enum DragEvents {
|
|
263
282
|
beforeDrag = "beforeDrag",
|
|
@@ -275,21 +294,20 @@ export interface IDragInfo {
|
|
|
275
294
|
source: Id[];
|
|
276
295
|
target: Id;
|
|
277
296
|
dropPosition?: DropPosition;
|
|
278
|
-
dragItem?: "row" | "column";
|
|
279
297
|
}
|
|
280
298
|
export type DragMode = "target" | "both" | "source";
|
|
281
299
|
export type DropBehaviour = "child" | "sibling" | "complex";
|
|
282
300
|
export interface IDragEventsHandlersMap {
|
|
283
301
|
[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;
|
|
302
|
+
[DragEvents.beforeDrag]: (data: IDragInfo, events: MouseEvent, ghost: HTMLElement, type: TDragItem) => void | boolean;
|
|
303
|
+
[DragEvents.dragStart]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
304
|
+
[DragEvents.dragOut]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
305
|
+
[DragEvents.dragIn]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
|
|
306
|
+
[DragEvents.canDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
307
|
+
[DragEvents.cancelDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
308
|
+
[DragEvents.beforeDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
|
|
309
|
+
[DragEvents.afterDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
|
|
310
|
+
[DragEvents.afterDrag]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
|
|
293
311
|
}
|
|
294
312
|
export declare enum DataDriver {
|
|
295
313
|
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";
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { ICsvExportConfig, IGrid, IXlsxExportConfig } from "./types";
|
|
1
|
+
import { ICsvExportConfig, IGrid, IXlsxExportConfig, ICellCss } from "./types";
|
|
2
2
|
import { IPDFConfig, IPNGConfig, TExportType } from "../../ts-common/types";
|
|
3
|
-
export
|
|
3
|
+
export interface IExportData {
|
|
4
|
+
name: string;
|
|
5
|
+
columns: Array<{
|
|
6
|
+
width: number;
|
|
7
|
+
}>;
|
|
8
|
+
header: string[][];
|
|
9
|
+
data: any[];
|
|
10
|
+
styles: {
|
|
11
|
+
cells: any[];
|
|
12
|
+
css: {
|
|
13
|
+
[key: string]: ICellCss;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface IExporter {
|
|
18
|
+
pdf: (config?: IPDFConfig) => void;
|
|
19
|
+
png: (config?: IPNGConfig) => void;
|
|
20
|
+
xlsx: (config?: IXlsxExportConfig) => IExportData;
|
|
21
|
+
csv: (config?: ICsvExportConfig) => string;
|
|
22
|
+
}
|
|
23
|
+
export declare class Exporter implements IExporter {
|
|
4
24
|
private _name;
|
|
5
25
|
private _version;
|
|
6
26
|
private _view;
|
|
7
27
|
constructor(_name: string, _version: string, _view: IGrid);
|
|
8
28
|
pdf(config?: IPDFConfig): void;
|
|
9
29
|
png(config?: IPNGConfig): void;
|
|
10
|
-
xlsx(config?: IXlsxExportConfig):
|
|
11
|
-
name: string;
|
|
12
|
-
columns: any[];
|
|
13
|
-
header: any[][];
|
|
14
|
-
data: string[][];
|
|
15
|
-
styles: {
|
|
16
|
-
cells: any[];
|
|
17
|
-
css: {
|
|
18
|
-
default: {
|
|
19
|
-
color: string;
|
|
20
|
-
background: string;
|
|
21
|
-
fontSize: number;
|
|
22
|
-
bold: boolean;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
30
|
+
xlsx(config?: IXlsxExportConfig): IExportData;
|
|
27
31
|
csv(config?: ICsvExportConfig): string;
|
|
28
32
|
private _export;
|
|
29
33
|
private getFlatCSV;
|
|
@@ -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,16 +59,17 @@ 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;
|
|
60
66
|
protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
|
|
61
67
|
protected _parseData(): void;
|
|
62
|
-
protected _createCollection(
|
|
68
|
+
protected _createCollection(): void;
|
|
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
|
}
|