dhx-chart 7.3.14 → 8.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/chart.min.css +1 -1
- package/codebase/chart.min.js +3 -3
- package/codebase/types/ts-chart/sources/Chart.d.ts +8 -6
- package/codebase/types/ts-chart/sources/Export.d.ts +10 -0
- package/codebase/types/ts-chart/sources/Legend.d.ts +1 -0
- package/codebase/types/ts-chart/sources/entry.d.ts +2 -1
- package/codebase/types/ts-chart/sources/series/CalendarHeatMap.d.ts +20 -0
- package/codebase/types/ts-chart/sources/series/index.d.ts +2 -0
- package/codebase/types/ts-chart/sources/shapes/legend.d.ts +1 -0
- package/codebase/types/ts-chart/sources/types.d.ts +42 -10
- package/codebase/types/ts-combobox/sources/Combobox.d.ts +2 -0
- package/codebase/types/ts-combobox/sources/types.d.ts +2 -0
- package/codebase/types/ts-common/dom.d.ts +2 -0
- package/codebase/types/ts-common/html.d.ts +2 -0
- package/codebase/types/ts-common/types.d.ts +1 -0
- package/codebase/types/ts-data/sources/types.d.ts +10 -5
- package/codebase/types/ts-grid/sources/Grid.d.ts +4 -5
- package/codebase/types/ts-grid/sources/ProGrid.d.ts +1 -0
- package/codebase/types/ts-grid/sources/Selection.d.ts +20 -18
- package/codebase/types/ts-grid/sources/types.d.ts +57 -11
- package/codebase/types/ts-grid/sources/ui/Cells.d.ts +10 -10
- package/codebase/types/ts-grid/sources/ui/FixedCols.d.ts +3 -3
- package/codebase/types/ts-grid/sources/ui/FixedRows.d.ts +2 -2
- package/codebase/types/ts-grid/sources/ui/content/ComboFilter.d.ts +21 -0
- package/codebase/types/ts-grid/sources/ui/content/InputFilter.d.ts +22 -0
- package/codebase/types/ts-grid/sources/ui/content/SelectFilter.d.ts +20 -0
- package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +16 -0
- package/codebase/types/ts-grid/sources/ui/render.d.ts +3 -2
- package/codebase/types/ts-layout/sources/Cell.d.ts +10 -0
- package/codebase/types/ts-layout/sources/Layout.d.ts +3 -0
- package/codebase/types/ts-layout/sources/types.d.ts +5 -0
- package/codebase/types/ts-list/sources/types.d.ts +2 -0
- package/codebase/types/ts-message/sources/message.d.ts +3 -1
- package/codebase/types/ts-popup/sources/Popup.d.ts +1 -0
- package/codebase/types/ts-popup/sources/types.d.ts +2 -0
- package/codebase/types/ts-slider/sources/types.d.ts +2 -0
- package/codebase/types/ts-timepicker/sources/Timepicker.d.ts +3 -1
- package/codebase/types/ts-timepicker/sources/types.d.ts +2 -0
- package/package.json +1 -1
- package/readme.txt +1 -1
- package/whatsnew.txt +50 -40
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
2
|
import { View } from "../../ts-common/view";
|
|
3
3
|
import { DataCollection, DataEvents, TreeCollection } from "../../ts-data";
|
|
4
|
-
import { ChartEvents, IChart, IChartConfig, ISeria } from "./types";
|
|
4
|
+
import { ChartEvents, IChart, IChartConfig, IChartSeries, IComposeLayer, IScaleConfig, IScales, ISeria } from "./types";
|
|
5
|
+
import { Exporter } from "./Export";
|
|
5
6
|
export declare class Chart extends View implements IChart {
|
|
6
7
|
data: DataCollection | TreeCollection;
|
|
7
8
|
events: IEventSystem<DataEvents | ChartEvents>;
|
|
8
9
|
config: IChartConfig;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export: Exporter;
|
|
11
|
+
protected _layers: IComposeLayer;
|
|
12
|
+
protected _series: IChartSeries;
|
|
13
|
+
protected _scales: IScales;
|
|
12
14
|
private _tooltip;
|
|
13
15
|
private _globalHTMLHandlers;
|
|
14
16
|
private _width;
|
|
@@ -20,7 +22,7 @@ export declare class Chart extends View implements IChart {
|
|
|
20
22
|
eachSeries(handler: (serie: ISeria) => any): any[];
|
|
21
23
|
destructor(): void;
|
|
22
24
|
setConfig(config: IChartConfig): void;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
protected _setScale(config: IScaleConfig, position: string): void;
|
|
26
|
+
protected _detectScaleType(config: any, key: any): any;
|
|
25
27
|
private _initEvents;
|
|
26
28
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { View } from "../../ts-common/view";
|
|
2
|
+
export declare class Exporter {
|
|
3
|
+
private _name;
|
|
4
|
+
private _view;
|
|
5
|
+
private _version;
|
|
6
|
+
constructor(_name: string, _view: View);
|
|
7
|
+
pdf(config: any): void;
|
|
8
|
+
png(config: any): void;
|
|
9
|
+
protected _rawExport(config: any, mode: string, view: View): void;
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../../styles/chart.scss";
|
|
2
|
+
import "../../styles/themes.scss";
|
|
2
3
|
export declare const vmdom: {
|
|
3
4
|
sv: any;
|
|
4
5
|
};
|
|
5
|
-
export { resizeHandler } from "../../ts-common/dom";
|
|
6
|
+
export { resizeHandler, awaitRedraw, setTheme } from "../../ts-common/dom";
|
|
6
7
|
export { Chart } from "./Chart";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IFitPosition } from "../../../ts-common/html";
|
|
2
|
+
import { DataCollection } from "../../../ts-data";
|
|
3
|
+
import { ICalendarHeatMapConfig, PointData, SvgElement } from "../types";
|
|
4
|
+
import BaseSeria from "./BaseSeria";
|
|
5
|
+
export default class CalendarHeatMap extends BaseSeria {
|
|
6
|
+
config: ICalendarHeatMapConfig;
|
|
7
|
+
protected _data: DataCollection;
|
|
8
|
+
private _headerHeight;
|
|
9
|
+
private _dateLocator;
|
|
10
|
+
private _valueLocator;
|
|
11
|
+
private _cellSize;
|
|
12
|
+
private _years;
|
|
13
|
+
private _maxValue;
|
|
14
|
+
private _minValue;
|
|
15
|
+
scaleReady(sizes: IFitPosition): IFitPosition;
|
|
16
|
+
dataReady(): PointData[];
|
|
17
|
+
paint(width: number, height: number): SvgElement;
|
|
18
|
+
protected _setDefaults(config: ICalendarHeatMapConfig): void;
|
|
19
|
+
protected _defaultLocator(v: any): any[];
|
|
20
|
+
}
|
|
@@ -10,6 +10,7 @@ import scatter from "./Scatter";
|
|
|
10
10
|
import spline from "./Spline";
|
|
11
11
|
import splineArea from "./SplineArea";
|
|
12
12
|
import treeMap from "./TreeMap";
|
|
13
|
+
import calendarHeatMap from "./CalendarHeatMap";
|
|
13
14
|
declare const seriesTypes: {
|
|
14
15
|
line: typeof line;
|
|
15
16
|
spline: typeof spline;
|
|
@@ -23,5 +24,6 @@ declare const seriesTypes: {
|
|
|
23
24
|
bar: typeof bar;
|
|
24
25
|
xbar: typeof xbar;
|
|
25
26
|
treeMap: typeof treeMap;
|
|
27
|
+
calendarHeatMap: typeof calendarHeatMap;
|
|
26
28
|
};
|
|
27
29
|
export default seriesTypes;
|
|
@@ -10,7 +10,7 @@ export interface IChart {
|
|
|
10
10
|
getSeries(id: string): ISeria;
|
|
11
11
|
}
|
|
12
12
|
export interface IChartConfig {
|
|
13
|
-
type?:
|
|
13
|
+
type?: TChartType;
|
|
14
14
|
css?: string;
|
|
15
15
|
barWidth?: number;
|
|
16
16
|
scales?: IScalesConfig;
|
|
@@ -18,8 +18,9 @@ export interface IChartConfig {
|
|
|
18
18
|
series?: SeriaConfig[];
|
|
19
19
|
maxPoints?: number;
|
|
20
20
|
data?: DataCollection<any> | any[];
|
|
21
|
+
exportStyles?: boolean | string[];
|
|
21
22
|
}
|
|
22
|
-
export declare type
|
|
23
|
+
export declare type TChartType = "bar" | "line" | "spline" | "scatter" | "area" | "donut" | "pie" | "pie3D" | "radar" | "xbar" | "splineArea" | "treeMap" | "calendarHeatMap";
|
|
23
24
|
export declare enum ChartEvents {
|
|
24
25
|
toggleSeries = "toggleSeries",
|
|
25
26
|
chartMouseMove = "chartMouseMove",
|
|
@@ -56,7 +57,7 @@ export interface ISeria extends ILikeSeria {
|
|
|
56
57
|
export declare type TreeDirectionType = "asc" | "desc";
|
|
57
58
|
export interface ISeriaConfig {
|
|
58
59
|
id?: string;
|
|
59
|
-
type?:
|
|
60
|
+
type?: TChartType;
|
|
60
61
|
active?: boolean;
|
|
61
62
|
pointColor?: string;
|
|
62
63
|
dashed?: boolean;
|
|
@@ -119,10 +120,10 @@ export interface IScales {
|
|
|
119
120
|
radial?: IScale;
|
|
120
121
|
}
|
|
121
122
|
export interface IScalesConfig {
|
|
122
|
-
left?: IScaleConfig;
|
|
123
|
-
right?: IScaleConfig;
|
|
124
|
-
top?: IScaleConfig;
|
|
125
|
-
bottom?: IScaleConfig;
|
|
123
|
+
left?: IScaleConfig | boolean;
|
|
124
|
+
right?: IScaleConfig | boolean;
|
|
125
|
+
top?: IScaleConfig | boolean;
|
|
126
|
+
bottom?: IScaleConfig | boolean;
|
|
126
127
|
radial?: IRadialScaleConfig;
|
|
127
128
|
}
|
|
128
129
|
export interface ILegendConfig {
|
|
@@ -131,6 +132,15 @@ export interface ILegendConfig {
|
|
|
131
132
|
text: SmartLocator;
|
|
132
133
|
color: SmartLocator;
|
|
133
134
|
alpha?: SmartLocator;
|
|
135
|
+
positiveColor?: SmartLocator;
|
|
136
|
+
negativeColor?: SmartLocator;
|
|
137
|
+
minValue?: number;
|
|
138
|
+
maxValue?: number;
|
|
139
|
+
value?: string;
|
|
140
|
+
step?: number;
|
|
141
|
+
tick?: number;
|
|
142
|
+
majorTick?: number;
|
|
143
|
+
tickTemplate?: <T>(value: T) => string;
|
|
134
144
|
};
|
|
135
145
|
size?: number;
|
|
136
146
|
form?: Shape;
|
|
@@ -162,6 +172,14 @@ export interface ILegendDrawData {
|
|
|
162
172
|
fill: string;
|
|
163
173
|
active?: boolean;
|
|
164
174
|
color?: string;
|
|
175
|
+
minValue?: number;
|
|
176
|
+
maxValue?: number;
|
|
177
|
+
negativeColor?: string;
|
|
178
|
+
positiveColor?: string;
|
|
179
|
+
step?: number;
|
|
180
|
+
tick?: number;
|
|
181
|
+
majorTick?: number;
|
|
182
|
+
tickTemplate?: <T>(value: T) => string;
|
|
165
183
|
}
|
|
166
184
|
export interface IComposable {
|
|
167
185
|
paint(width: number, height: number, prev?: PointData[]): object;
|
|
@@ -197,6 +215,20 @@ export interface ITreeMapConfig extends ISeriaConfig {
|
|
|
197
215
|
paddings?: number;
|
|
198
216
|
text?: string;
|
|
199
217
|
}
|
|
218
|
+
export interface ICalendarHeatMapConfig extends ISeriaConfig {
|
|
219
|
+
paddings?: number;
|
|
220
|
+
date?: string;
|
|
221
|
+
dateFormat?: string;
|
|
222
|
+
weekStart?: "saturday" | "sunday" | "monday";
|
|
223
|
+
positiveColor?: SmartLocator;
|
|
224
|
+
negativeColor?: SmartLocator;
|
|
225
|
+
minValue?: number;
|
|
226
|
+
maxValue?: number;
|
|
227
|
+
startDate?: string | Date;
|
|
228
|
+
endDate?: string | Date;
|
|
229
|
+
days?: string[];
|
|
230
|
+
months?: string[];
|
|
231
|
+
}
|
|
200
232
|
export interface IAxisCreatorConfig {
|
|
201
233
|
max?: number;
|
|
202
234
|
min?: number;
|
|
@@ -232,11 +264,11 @@ export declare type PointType = "circle" | "rect" | "triangle" | "rhombus" | "si
|
|
|
232
264
|
export declare type Gradient = (color: string) => any;
|
|
233
265
|
export declare type TooltipType = "simple" | "right" | "left" | "top" | "bot";
|
|
234
266
|
export declare type SvgElement = any;
|
|
235
|
-
export declare type Shape = "rect" | "circle";
|
|
267
|
+
export declare type Shape = "rect" | "circle" | "line";
|
|
236
268
|
export declare type HorizontalPosition = "left" | "center" | "right";
|
|
237
269
|
export declare type VerticalPosition = "top" | "middle" | "bottom";
|
|
238
270
|
export declare type LegendDirection = "row" | "column";
|
|
239
|
-
export declare type LegendType = "groupName" | "range";
|
|
271
|
+
export declare type LegendType = "groupName" | "range" | "scale";
|
|
240
272
|
export declare type LegendSizes = {
|
|
241
273
|
width: number;
|
|
242
274
|
height: number;
|
|
@@ -255,7 +287,7 @@ export declare type SmartLocator = Locator | string;
|
|
|
255
287
|
export interface IStacker extends IComposable, ILikeSeria {
|
|
256
288
|
add(seria: ISeria): void;
|
|
257
289
|
}
|
|
258
|
-
export declare type PointData = [number, number, string, number | string
|
|
290
|
+
export declare type PointData = [number, number, string, (number | string)?, number?, TreePointData?];
|
|
259
291
|
export declare type TreePointData = {
|
|
260
292
|
items: PointData[];
|
|
261
293
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VNode } from "../../ts-common/dom";
|
|
1
2
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
3
|
import { View } from "../../ts-common/view";
|
|
3
4
|
import { DataCollection, DataEvents, IDataEventsHandlersMap } from "../../ts-data";
|
|
@@ -6,6 +7,7 @@ import { List } from "../../ts-list";
|
|
|
6
7
|
import { Popup } from "../../ts-popup";
|
|
7
8
|
import { Id, IHandlers } from "../../ts-common/types";
|
|
8
9
|
import { ComboboxEvents, ICombobox, IComboboxConfig, IComboboxEventHandlersMap, State } from "./types";
|
|
10
|
+
export declare const $template: VNode;
|
|
9
11
|
export declare class Combobox extends View implements ICombobox {
|
|
10
12
|
data: DataCollection;
|
|
11
13
|
config: IComboboxConfig;
|
|
@@ -36,6 +36,7 @@ export interface IComboboxConfig {
|
|
|
36
36
|
readonly?: boolean;
|
|
37
37
|
}
|
|
38
38
|
export declare enum ComboboxEvents {
|
|
39
|
+
beforeChange = "beforeChange",
|
|
39
40
|
change = "change",
|
|
40
41
|
focus = "focus",
|
|
41
42
|
blur = "blur",
|
|
@@ -52,6 +53,7 @@ export declare enum ComboboxEvents {
|
|
|
52
53
|
}
|
|
53
54
|
export interface IComboboxEventHandlersMap {
|
|
54
55
|
[key: string]: (...args: any[]) => any;
|
|
56
|
+
[ComboboxEvents.beforeChange]: (ids: Id | Id[]) => boolean | void;
|
|
55
57
|
[ComboboxEvents.change]: (ids: Id | Id[]) => void;
|
|
56
58
|
[ComboboxEvents.focus]: () => void;
|
|
57
59
|
[ComboboxEvents.blur]: () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TTheme } from "./types";
|
|
1
2
|
export declare const el: any;
|
|
2
3
|
export declare const sv: any;
|
|
3
4
|
export declare const view: any;
|
|
@@ -19,3 +20,4 @@ export interface IViewHash {
|
|
|
19
20
|
export declare function resizer(handler: any): any;
|
|
20
21
|
export declare function resizeHandler(container: any, handler: any): any;
|
|
21
22
|
export declare function awaitRedraw(): Promise<any>;
|
|
23
|
+
export declare function setTheme(theme: TTheme, container: string | HTMLElement): void;
|
|
@@ -2,6 +2,7 @@ import { IEventSystem } from "./events";
|
|
|
2
2
|
export interface IHandlers {
|
|
3
3
|
[key: string]: anyFunction | IHandlers;
|
|
4
4
|
}
|
|
5
|
+
export declare type TTheme = "light" | "dark" | "contrast-light" | "contrast-dark" | string;
|
|
5
6
|
export declare type Id = string | number;
|
|
6
7
|
export declare type fn<T extends any[], K> = (...args: T) => K;
|
|
7
8
|
export declare type anyFunction = fn<any[], any>;
|
|
@@ -57,7 +57,7 @@ export interface IDataConfig {
|
|
|
57
57
|
init?: anyFunction;
|
|
58
58
|
update?: anyFunction;
|
|
59
59
|
approximate?: IApproximate;
|
|
60
|
-
autoload?:
|
|
60
|
+
autoload?: string;
|
|
61
61
|
}
|
|
62
62
|
export interface IDataCollection<T extends IDataItem = IDataItem> {
|
|
63
63
|
config: IDataConfig;
|
|
@@ -94,7 +94,7 @@ export interface IDataCollection<T extends IDataItem = IDataItem> {
|
|
|
94
94
|
forEach(callback: DataCallback<T>): void;
|
|
95
95
|
save(url: IDataProxy | string): void;
|
|
96
96
|
isSaved(): boolean;
|
|
97
|
-
getRawData(from: number, to: number, order?: T[], mode?: number): T[];
|
|
97
|
+
getRawData(from: number, to: number, order?: T[] | null, mode?: number): T[];
|
|
98
98
|
}
|
|
99
99
|
export interface IDataChangeStack {
|
|
100
100
|
order: IDataChange[];
|
|
@@ -209,11 +209,13 @@ export declare enum DataEvents {
|
|
|
209
209
|
beforeRemove = "beforeremove",
|
|
210
210
|
afterRemove = "afterremove",
|
|
211
211
|
change = "change",
|
|
212
|
+
dataRequest = "dataRequest",
|
|
212
213
|
load = "load",
|
|
213
214
|
loadError = "loaderror",
|
|
214
215
|
beforeLazyLoad = "beforelazyload",
|
|
215
216
|
afterLazyLoad = "afterlazyload",
|
|
216
|
-
|
|
217
|
+
beforeItemLoad = "beforeItemLoad",
|
|
218
|
+
afterItemLoad = "afterItemLoad"
|
|
217
219
|
}
|
|
218
220
|
export interface IDataEventsHandlersMap {
|
|
219
221
|
[key: string]: (...args: any[]) => any;
|
|
@@ -222,12 +224,14 @@ export interface IDataEventsHandlersMap {
|
|
|
222
224
|
[DataEvents.afterRemove]: (removedItem: any) => void;
|
|
223
225
|
[DataEvents.beforeAdd]: (newItem: any) => boolean | void;
|
|
224
226
|
[DataEvents.beforeRemove]: (removedItem: any) => boolean | void;
|
|
225
|
-
[DataEvents.load]: () => void;
|
|
226
227
|
[DataEvents.removeAll]: () => void;
|
|
228
|
+
[DataEvents.dataRequest]: (from: number, to: number) => void;
|
|
229
|
+
[DataEvents.load]: () => void;
|
|
227
230
|
[DataEvents.loadError]: (response: any) => void;
|
|
231
|
+
[DataEvents.beforeItemLoad]: (id: Id) => boolean | void;
|
|
232
|
+
[DataEvents.afterItemLoad]: (id: Id) => void;
|
|
228
233
|
[DataEvents.beforeLazyLoad]: () => boolean | void;
|
|
229
234
|
[DataEvents.afterLazyLoad]: (from: number, count: number) => void;
|
|
230
|
-
[DataEvents.dataRequest]: (from: number, to: number) => void;
|
|
231
235
|
}
|
|
232
236
|
export declare enum DragEvents {
|
|
233
237
|
beforeDrag = "beforeDrag",
|
|
@@ -245,6 +249,7 @@ export interface IDragInfo {
|
|
|
245
249
|
source: Id[];
|
|
246
250
|
target: Id;
|
|
247
251
|
dropPosition?: DropPosition;
|
|
252
|
+
dragItem?: "row" | "column";
|
|
248
253
|
}
|
|
249
254
|
export declare type DragMode = "target" | "both" | "source";
|
|
250
255
|
export declare type DropBehaviour = "child" | "sibling" | "complex";
|
|
@@ -4,8 +4,7 @@ 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 { Dirs, EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISelection, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, ISortingState, SortFunction } from "./types";
|
|
8
|
-
import { Combobox } from "../../ts-combobox";
|
|
7
|
+
import { Dirs, EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISelection, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, ISortingState, SortFunction, IHeaderFilter } from "./types";
|
|
9
8
|
export declare class Grid extends View implements IGrid {
|
|
10
9
|
data: IDataCollection;
|
|
11
10
|
config: IGridConfig;
|
|
@@ -48,7 +47,7 @@ export declare class Grid extends View implements IGrid {
|
|
|
48
47
|
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
49
48
|
editEnd(withoutSave?: boolean): void;
|
|
50
49
|
getSortingState(): ISortingState;
|
|
51
|
-
getHeaderFilter(colId: Id):
|
|
50
|
+
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
52
51
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
53
52
|
edit(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
54
53
|
paint(): void;
|
|
@@ -66,8 +65,8 @@ export declare class Grid extends View implements IGrid {
|
|
|
66
65
|
protected _prepareData(data: IDataItem[] | IDataCollection): any[] | IDataItem[];
|
|
67
66
|
protected _adjustColumnsWidth(rows: IRow[], cols: ICol[], adjust?: IAdjustBy): IColumnsWidth;
|
|
68
67
|
protected _prepareColumnData(data: any, type: "header" | "footer"): IRow[];
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
protected _dragStart(event: any): void;
|
|
69
|
+
protected _getRowGhost(ids: Id[]): HTMLDivElement;
|
|
71
70
|
private _init;
|
|
72
71
|
private _attachDataCollection;
|
|
73
72
|
private _setMarks;
|
|
@@ -9,6 +9,7 @@ export declare class ProGrid extends Grid implements IProGrid {
|
|
|
9
9
|
protected _setEventHandlers(): void;
|
|
10
10
|
protected _prepareData(data: IDataItem[] | IDataCollection): any;
|
|
11
11
|
protected _prepareDataFromTo(data: IDataCollection, from: number, to: number): IDataItem[];
|
|
12
|
+
protected _dragStart(event: any): void;
|
|
12
13
|
private _lazyLoad;
|
|
13
14
|
private _getColumnGhost;
|
|
14
15
|
private _dragStartColumn;
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
+
import { VNode } from "../../ts-common/dom";
|
|
1
2
|
import { IEventSystem } from "../../ts-common/events";
|
|
2
|
-
import { ICell, IGrid, ISelection, IRow, ICol,
|
|
3
|
+
import { ICell, IGrid, ISelection, IRow, ICol, GridSelectionEvents, IGridSelectionEventsHandlersMap, ISelectionConfig } from "./types";
|
|
3
4
|
import { Id } from "../../ts-common/types";
|
|
4
5
|
export declare class Selection implements ISelection {
|
|
5
6
|
events: IEventSystem<GridSelectionEvents, IGridSelectionEventsHandlersMap>;
|
|
6
7
|
config: ISelectionConfig;
|
|
7
|
-
|
|
8
|
+
private _grid;
|
|
8
9
|
private _gridId;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
protected _multiselection: boolean;
|
|
10
|
+
private _selectedCell;
|
|
11
|
+
private _selectedCells;
|
|
12
|
+
private _type;
|
|
13
|
+
private _multiselection;
|
|
14
14
|
constructor(grid: IGrid, config?: ISelectionConfig, events?: IEventSystem<any>, gridId?: Id);
|
|
15
|
-
setCell(row?:
|
|
16
|
-
|
|
15
|
+
setCell(row?: IRow | Id, col?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
16
|
+
removeCell(rowId?: Id, colId?: Id): void;
|
|
17
|
+
getCell(): ICell | void;
|
|
17
18
|
getCells(): ICell[];
|
|
18
|
-
toHTML(): any;
|
|
19
19
|
disable(): void;
|
|
20
20
|
enable(): void;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
toHTML(): VNode | VNode[];
|
|
22
|
+
private _setCell;
|
|
23
|
+
private _removeCell;
|
|
24
|
+
private _removeCells;
|
|
25
|
+
private _init;
|
|
26
|
+
private _toHTML;
|
|
27
|
+
private _isUnselected;
|
|
28
|
+
private _findIndex;
|
|
29
|
+
private _setBrowserFocus;
|
|
30
|
+
private _getReverseScrollState;
|
|
29
31
|
}
|
|
@@ -6,6 +6,8 @@ import { Exporter } from "./Exporter";
|
|
|
6
6
|
import { Combobox } from "../../ts-combobox";
|
|
7
7
|
import { IHandlers, Id } from "../../ts-common/types";
|
|
8
8
|
import { ScrollView } from "../../ts-common/ScrollView";
|
|
9
|
+
import { ICalendarConfig } from "../../ts-calendar";
|
|
10
|
+
import { VNode } from "../../ts-common/dom";
|
|
9
11
|
export interface IGridConfig extends IDragConfig {
|
|
10
12
|
columns?: ICol[];
|
|
11
13
|
spans?: ISpan[];
|
|
@@ -17,6 +19,8 @@ export interface IGridConfig extends IDragConfig {
|
|
|
17
19
|
rowCss?: (row: IRow) => string;
|
|
18
20
|
leftSplit?: number;
|
|
19
21
|
topSplit?: number;
|
|
22
|
+
rightSplit?: number;
|
|
23
|
+
bottomSplit?: number;
|
|
20
24
|
selection?: ISelectionType;
|
|
21
25
|
multiselection?: boolean;
|
|
22
26
|
dragItem?: IDragType;
|
|
@@ -55,6 +59,7 @@ export interface IGridConfig extends IDragConfig {
|
|
|
55
59
|
editor?: IEditor;
|
|
56
60
|
};
|
|
57
61
|
$resizing?: string | number;
|
|
62
|
+
$scrollBarWidth?: IScrollBarWidth;
|
|
58
63
|
groupTitleTemplate?: (groupName: string, groupItems: IDataItem[]) => string;
|
|
59
64
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
60
65
|
editing?: boolean;
|
|
@@ -67,6 +72,12 @@ export interface IGridConfig extends IDragConfig {
|
|
|
67
72
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
68
73
|
splitAt?: number;
|
|
69
74
|
}
|
|
75
|
+
export interface IScrollBarWidth {
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
xState: boolean;
|
|
79
|
+
yState: boolean;
|
|
80
|
+
}
|
|
70
81
|
interface ICellObj {
|
|
71
82
|
col: ICol;
|
|
72
83
|
row: IRow;
|
|
@@ -78,18 +89,25 @@ export interface IScrollState {
|
|
|
78
89
|
left: number;
|
|
79
90
|
top: number;
|
|
80
91
|
}
|
|
92
|
+
interface IFixedColumns {
|
|
93
|
+
left: ICol[];
|
|
94
|
+
right: ICol[];
|
|
95
|
+
}
|
|
96
|
+
interface IFixedRows {
|
|
97
|
+
top: IRow[];
|
|
98
|
+
bottom: IRow[];
|
|
99
|
+
}
|
|
81
100
|
export interface IRendererConfig extends IGridConfig {
|
|
82
101
|
scroll?: IScrollState;
|
|
83
102
|
datacollection: any;
|
|
84
103
|
currentColumns?: ICol[];
|
|
85
104
|
currentRows?: IRow[];
|
|
86
|
-
fixedColumns?:
|
|
87
|
-
fixedRows?:
|
|
105
|
+
fixedColumns?: IFixedColumns;
|
|
106
|
+
fixedRows?: IFixedRows;
|
|
88
107
|
firstColId?: Id;
|
|
89
108
|
headerHeight?: number;
|
|
90
109
|
footerHeight?: number;
|
|
91
110
|
events?: IEventSystem<GridEvents, IEventHandlersMap>;
|
|
92
|
-
fixedColumnsWidth?: number;
|
|
93
111
|
selection: any;
|
|
94
112
|
sortBy?: Id;
|
|
95
113
|
sortDir?: string;
|
|
@@ -138,7 +156,7 @@ export interface IGrid {
|
|
|
138
156
|
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
139
157
|
editEnd(withoutSave?: boolean): void;
|
|
140
158
|
getSortingState(): ISortingState;
|
|
141
|
-
getHeaderFilter(colId: Id):
|
|
159
|
+
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
142
160
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
143
161
|
edit(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
144
162
|
}
|
|
@@ -149,6 +167,26 @@ export declare type EditorType = "input" | "select" | "datePicker" | "checkbox"
|
|
|
149
167
|
export interface IComboEditorConfig {
|
|
150
168
|
newOptions?: boolean;
|
|
151
169
|
}
|
|
170
|
+
export interface IBaseHandlersMap {
|
|
171
|
+
[key: string]: (...args: any[]) => any;
|
|
172
|
+
}
|
|
173
|
+
export declare enum HeaderFilterEvent {
|
|
174
|
+
change = "change"
|
|
175
|
+
}
|
|
176
|
+
export interface IHeaderFilter {
|
|
177
|
+
column: ICol;
|
|
178
|
+
config: IRendererConfig;
|
|
179
|
+
value: string | string[];
|
|
180
|
+
events: IEventSystem<HeaderFilterEvent>;
|
|
181
|
+
data?: any[];
|
|
182
|
+
id?: Id;
|
|
183
|
+
filterConfig?: IComboFilterConfig;
|
|
184
|
+
getFilter(): HTMLElement | Combobox;
|
|
185
|
+
setValue(value: string | string[]): void;
|
|
186
|
+
clear(): void;
|
|
187
|
+
focus(): void;
|
|
188
|
+
blur(): void;
|
|
189
|
+
}
|
|
152
190
|
export interface ICellRect extends ICoords, ISizes {
|
|
153
191
|
}
|
|
154
192
|
export declare type colType = "string" | "number" | "boolean" | "date" | "percent" | any;
|
|
@@ -161,14 +199,14 @@ export interface ICol {
|
|
|
161
199
|
maxWidth?: number;
|
|
162
200
|
mark?: IMark | MarkFunction;
|
|
163
201
|
type?: colType;
|
|
202
|
+
format?: string;
|
|
164
203
|
editorType?: EditorType;
|
|
165
|
-
editorConfig?: IComboEditorConfig;
|
|
204
|
+
editorConfig?: IComboEditorConfig | ICalendarConfig;
|
|
166
205
|
editable?: boolean;
|
|
167
206
|
resizable?: boolean;
|
|
168
207
|
sortable?: boolean;
|
|
169
208
|
options?: any[];
|
|
170
209
|
draggable?: boolean;
|
|
171
|
-
format?: string;
|
|
172
210
|
htmlEnable?: boolean;
|
|
173
211
|
template?: (cellValue: any, row: IRow, col: ICol) => string;
|
|
174
212
|
hidden?: boolean;
|
|
@@ -185,6 +223,7 @@ export interface ICol {
|
|
|
185
223
|
$width?: number;
|
|
186
224
|
$fixed?: boolean;
|
|
187
225
|
$htmlEnable?: boolean;
|
|
226
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
188
227
|
dateFormat?: string;
|
|
189
228
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
190
229
|
editing?: boolean;
|
|
@@ -268,6 +307,7 @@ export declare enum GridEvents {
|
|
|
268
307
|
scroll = "scroll",
|
|
269
308
|
expand = "expand",
|
|
270
309
|
filterChange = "filterChange",
|
|
310
|
+
beforeFilter = "beforeFilter",
|
|
271
311
|
beforeResizeStart = "beforeResizeStart",
|
|
272
312
|
resize = "resize",
|
|
273
313
|
afterResizeEnd = "afterResizeEnd",
|
|
@@ -328,7 +368,8 @@ export interface IEventHandlersMap {
|
|
|
328
368
|
[GridEvents.scroll]: (scrollState: ICoords) => void;
|
|
329
369
|
[GridEvents.beforeSort]: (col: ICol, dir: Dirs) => void | boolean;
|
|
330
370
|
[GridEvents.afterSort]: (col: ICol, dir: Dirs) => void;
|
|
331
|
-
[GridEvents.filterChange]: (value: string, colId: Id, filterId: fixedRowContent) => void;
|
|
371
|
+
[GridEvents.filterChange]: (value: string | string[], colId: Id, filterId: fixedRowContent) => void;
|
|
372
|
+
[GridEvents.beforeFilter]: (value: string, colId: Id) => void | boolean;
|
|
332
373
|
[GridEvents.beforeResizeStart]: (col: ICol, e: MouseEvent) => boolean | void;
|
|
333
374
|
[GridEvents.resize]: (col: ICol, e: MouseEvent) => void;
|
|
334
375
|
[GridEvents.afterResizeEnd]: (col: ICol, e: MouseEvent) => void;
|
|
@@ -448,7 +489,6 @@ export interface ISizes {
|
|
|
448
489
|
export interface ICell {
|
|
449
490
|
row: IRow;
|
|
450
491
|
column: ICol;
|
|
451
|
-
$preventedUnselect?: boolean;
|
|
452
492
|
}
|
|
453
493
|
export interface IRow {
|
|
454
494
|
id?: Id;
|
|
@@ -470,13 +510,13 @@ export interface ISelectionConfig {
|
|
|
470
510
|
}
|
|
471
511
|
export interface ISelection {
|
|
472
512
|
config?: ISelectionConfig;
|
|
473
|
-
setCell(rowId?: Id, colId?: Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
474
|
-
getCell(): ICell;
|
|
513
|
+
setCell(rowId?: IRow | Id, colId?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
514
|
+
getCell(): ICell | void;
|
|
475
515
|
getCells(): ICell[];
|
|
476
516
|
removeCell(rowId?: Id, colId?: Id): void;
|
|
477
517
|
disable(): void;
|
|
478
518
|
enable(): void;
|
|
479
|
-
toHTML():
|
|
519
|
+
toHTML(): VNode | VNode[];
|
|
480
520
|
}
|
|
481
521
|
export declare enum GridSelectionEvents {
|
|
482
522
|
beforeUnSelect = "beforeUnSelect",
|
|
@@ -492,4 +532,10 @@ export interface IGridSelectionEventsHandlersMap {
|
|
|
492
532
|
[GridSelectionEvents.beforeUnSelect]: (row: IRow, col: ICol) => boolean | void;
|
|
493
533
|
}
|
|
494
534
|
export declare type TRowStatus = "firstFilledRow" | "firstEmptyRow";
|
|
535
|
+
export declare enum Split {
|
|
536
|
+
left = "leftSplit",
|
|
537
|
+
right = "rightSplit",
|
|
538
|
+
top = "topSplit",
|
|
539
|
+
bottom = "bottomSplit"
|
|
540
|
+
}
|
|
495
541
|
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { GridEvents, ICol, ICoords,
|
|
1
|
+
import { GridEvents, GridSystemEvents, ICol, ICoords, IGridConfig, IRendererConfig, ISpan, Split } from "../types";
|
|
2
2
|
declare type mouseEvents = GridEvents.cellClick | GridEvents.cellMouseOver | GridEvents.cellMouseDown | GridEvents.cellDblClick | GridEvents.cellRightClick;
|
|
3
3
|
declare type touchEvents = GridSystemEvents.cellTouchEnd | GridSystemEvents.cellTouchMove;
|
|
4
4
|
declare function handleMouse(rowStart: number, colStart: number, conf: IRendererConfig, type: mouseEvents & touchEvents, e: any): void;
|
|
5
5
|
export declare function getHandlers(row: number, column: number, conf: IRendererConfig): {
|
|
6
|
-
onclick: (number |
|
|
7
|
-
onmouseover: (number |
|
|
8
|
-
onmousedown: (number |
|
|
9
|
-
ondblclick: (number |
|
|
10
|
-
oncontextmenu: (number |
|
|
11
|
-
ontouchstart: (number |
|
|
12
|
-
ontouchmove: (number |
|
|
13
|
-
ontouchend: (number |
|
|
6
|
+
onclick: (number | IRendererConfig | GridEvents | typeof handleMouse)[];
|
|
7
|
+
onmouseover: (number | IRendererConfig | GridEvents | typeof handleMouse)[];
|
|
8
|
+
onmousedown: (number | IRendererConfig | GridEvents | typeof handleMouse)[];
|
|
9
|
+
ondblclick: (number | IRendererConfig | GridEvents | typeof handleMouse)[];
|
|
10
|
+
oncontextmenu: (number | IRendererConfig | GridEvents | typeof handleMouse)[];
|
|
11
|
+
ontouchstart: (number | IRendererConfig | GridEvents | typeof handleMouse)[];
|
|
12
|
+
ontouchmove: (number | IRendererConfig | GridSystemEvents | typeof handleMouse)[];
|
|
13
|
+
ontouchend: (number | IRendererConfig | GridSystemEvents | typeof handleMouse)[];
|
|
14
14
|
};
|
|
15
15
|
export declare function getTreeCell(content: any, row: any, col: ICol, conf: IRendererConfig): any;
|
|
16
16
|
export declare function getCells(conf: IRendererConfig): any[];
|
|
17
|
-
export declare function getSpans(config: IRendererConfig,
|
|
17
|
+
export declare function getSpans(config: IRendererConfig, mode?: Split): any[];
|
|
18
18
|
export declare function getShifts(conf: IRendererConfig): ICoords;
|
|
19
19
|
export declare function normalizeSpan(span: ISpan, renderConfig: IGridConfig): {
|
|
20
20
|
$renderFrom: string[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ILayoutState, IRendererConfig } from "./../types";
|
|
2
|
-
export declare function getFixedColsHeader(renderConfig: IRendererConfig, layout: ILayoutState): any;
|
|
3
|
-
export declare function getFixedCols(renderConfig: IRendererConfig, layout: ILayoutState): any[];
|
|
1
|
+
import { ILayoutState, IRendererConfig, Split } from "./../types";
|
|
2
|
+
export declare function getFixedColsHeader(renderConfig: IRendererConfig, layout: ILayoutState, mode: Split.left | Split.right): any;
|
|
3
|
+
export declare function getFixedCols(renderConfig: IRendererConfig, layout: ILayoutState, mode: Split.left | Split.right): any[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IFixedRowsConfig, IRendererConfig,
|
|
1
|
+
import { IFixedRowsConfig, ILayoutState, IRendererConfig, Split } from "../types";
|
|
2
2
|
export declare function getRows(config: IRendererConfig, rowsConfig: IFixedRowsConfig): any[];
|
|
3
3
|
export declare function getFixedSpans(config: IRendererConfig, rowsConfig: IFixedRowsConfig): any[];
|
|
4
4
|
export declare function getFixedRows(config: IRendererConfig, rowsConfig: IFixedRowsConfig): any;
|
|
5
|
-
export declare function getFixedDataRows(config: IRendererConfig, layout: ILayoutState): any[];
|
|
5
|
+
export declare function getFixedDataRows(config: IRendererConfig, layout: ILayoutState, mode: Split.top | Split.bottom): any[];
|