dhx-chart 7.3.13 → 8.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/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/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 +8 -4
- 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 +5 -1
- package/codebase/types/ts-grid/sources/types.d.ts +51 -5
- package/codebase/types/ts-grid/sources/ui/Cells.d.ts +2 -2
- 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 +4 -1
- 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-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 +6 -0
|
@@ -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
|
};
|
|
@@ -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;
|
|
@@ -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",
|
|
@@ -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;
|
|
@@ -22,8 +22,12 @@ export declare class Selection implements ISelection {
|
|
|
22
22
|
protected _removeCell(row: any, col: any): void;
|
|
23
23
|
protected _removeCells(): void;
|
|
24
24
|
protected _init(): void;
|
|
25
|
-
protected _toHTML(row: IRow, column: ICol, last?: boolean): any;
|
|
25
|
+
protected _toHTML(row: IRow, column: ICol, last?: boolean, skipRow?: boolean): any;
|
|
26
26
|
protected _isUnselected(): boolean;
|
|
27
27
|
protected _findIndex(cell?: ICell): number;
|
|
28
28
|
protected _setBrowserFocus(): void;
|
|
29
|
+
protected _getReverseScrollState(scrollState: any): {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
29
33
|
}
|
|
@@ -6,6 +6,7 @@ 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";
|
|
9
10
|
export interface IGridConfig extends IDragConfig {
|
|
10
11
|
columns?: ICol[];
|
|
11
12
|
spans?: ISpan[];
|
|
@@ -17,6 +18,8 @@ export interface IGridConfig extends IDragConfig {
|
|
|
17
18
|
rowCss?: (row: IRow) => string;
|
|
18
19
|
leftSplit?: number;
|
|
19
20
|
topSplit?: number;
|
|
21
|
+
rightSplit?: number;
|
|
22
|
+
bottomSplit?: number;
|
|
20
23
|
selection?: ISelectionType;
|
|
21
24
|
multiselection?: boolean;
|
|
22
25
|
dragItem?: IDragType;
|
|
@@ -55,6 +58,7 @@ export interface IGridConfig extends IDragConfig {
|
|
|
55
58
|
editor?: IEditor;
|
|
56
59
|
};
|
|
57
60
|
$resizing?: string | number;
|
|
61
|
+
$scrollBarWidth?: IScrollBarWidth;
|
|
58
62
|
groupTitleTemplate?: (groupName: string, groupItems: IDataItem[]) => string;
|
|
59
63
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
60
64
|
editing?: boolean;
|
|
@@ -67,6 +71,10 @@ export interface IGridConfig extends IDragConfig {
|
|
|
67
71
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
68
72
|
splitAt?: number;
|
|
69
73
|
}
|
|
74
|
+
export interface IScrollBarWidth {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
}
|
|
70
78
|
interface ICellObj {
|
|
71
79
|
col: ICol;
|
|
72
80
|
row: IRow;
|
|
@@ -78,16 +86,25 @@ export interface IScrollState {
|
|
|
78
86
|
left: number;
|
|
79
87
|
top: number;
|
|
80
88
|
}
|
|
89
|
+
interface IFixedColumns {
|
|
90
|
+
left: ICol[];
|
|
91
|
+
right: ICol[];
|
|
92
|
+
}
|
|
93
|
+
interface IFixedRows {
|
|
94
|
+
top: IRow[];
|
|
95
|
+
bottom: IRow[];
|
|
96
|
+
}
|
|
81
97
|
export interface IRendererConfig extends IGridConfig {
|
|
82
98
|
scroll?: IScrollState;
|
|
83
99
|
datacollection: any;
|
|
84
100
|
currentColumns?: ICol[];
|
|
85
101
|
currentRows?: IRow[];
|
|
102
|
+
fixedColumns?: IFixedColumns;
|
|
103
|
+
fixedRows?: IFixedRows;
|
|
86
104
|
firstColId?: Id;
|
|
87
105
|
headerHeight?: number;
|
|
88
106
|
footerHeight?: number;
|
|
89
107
|
events?: IEventSystem<GridEvents, IEventHandlersMap>;
|
|
90
|
-
fixedColumnsWidth?: number;
|
|
91
108
|
selection: any;
|
|
92
109
|
sortBy?: Id;
|
|
93
110
|
sortDir?: string;
|
|
@@ -136,7 +153,7 @@ export interface IGrid {
|
|
|
136
153
|
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
137
154
|
editEnd(withoutSave?: boolean): void;
|
|
138
155
|
getSortingState(): ISortingState;
|
|
139
|
-
getHeaderFilter(colId: Id):
|
|
156
|
+
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
140
157
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
141
158
|
edit(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
142
159
|
}
|
|
@@ -147,6 +164,26 @@ export declare type EditorType = "input" | "select" | "datePicker" | "checkbox"
|
|
|
147
164
|
export interface IComboEditorConfig {
|
|
148
165
|
newOptions?: boolean;
|
|
149
166
|
}
|
|
167
|
+
export interface IBaseHandlersMap {
|
|
168
|
+
[key: string]: (...args: any[]) => any;
|
|
169
|
+
}
|
|
170
|
+
export declare enum HeaderFilterEvent {
|
|
171
|
+
change = "change"
|
|
172
|
+
}
|
|
173
|
+
export interface IHeaderFilter {
|
|
174
|
+
column: ICol;
|
|
175
|
+
config: IRendererConfig;
|
|
176
|
+
value: string | string[];
|
|
177
|
+
events: IEventSystem<HeaderFilterEvent>;
|
|
178
|
+
data?: any[];
|
|
179
|
+
id?: Id;
|
|
180
|
+
filterConfig?: IComboFilterConfig;
|
|
181
|
+
getFilter(): HTMLElement | Combobox;
|
|
182
|
+
setValue(value: string | string[]): void;
|
|
183
|
+
clear(): void;
|
|
184
|
+
focus(): void;
|
|
185
|
+
blur(): void;
|
|
186
|
+
}
|
|
150
187
|
export interface ICellRect extends ICoords, ISizes {
|
|
151
188
|
}
|
|
152
189
|
export declare type colType = "string" | "number" | "boolean" | "date" | "percent" | any;
|
|
@@ -159,14 +196,14 @@ export interface ICol {
|
|
|
159
196
|
maxWidth?: number;
|
|
160
197
|
mark?: IMark | MarkFunction;
|
|
161
198
|
type?: colType;
|
|
199
|
+
format?: string;
|
|
162
200
|
editorType?: EditorType;
|
|
163
|
-
editorConfig?: IComboEditorConfig;
|
|
201
|
+
editorConfig?: IComboEditorConfig | ICalendarConfig;
|
|
164
202
|
editable?: boolean;
|
|
165
203
|
resizable?: boolean;
|
|
166
204
|
sortable?: boolean;
|
|
167
205
|
options?: any[];
|
|
168
206
|
draggable?: boolean;
|
|
169
|
-
format?: string;
|
|
170
207
|
htmlEnable?: boolean;
|
|
171
208
|
template?: (cellValue: any, row: IRow, col: ICol) => string;
|
|
172
209
|
hidden?: boolean;
|
|
@@ -183,6 +220,7 @@ export interface ICol {
|
|
|
183
220
|
$width?: number;
|
|
184
221
|
$fixed?: boolean;
|
|
185
222
|
$htmlEnable?: boolean;
|
|
223
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
186
224
|
dateFormat?: string;
|
|
187
225
|
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
188
226
|
editing?: boolean;
|
|
@@ -266,6 +304,7 @@ export declare enum GridEvents {
|
|
|
266
304
|
scroll = "scroll",
|
|
267
305
|
expand = "expand",
|
|
268
306
|
filterChange = "filterChange",
|
|
307
|
+
beforeFilter = "beforeFilter",
|
|
269
308
|
beforeResizeStart = "beforeResizeStart",
|
|
270
309
|
resize = "resize",
|
|
271
310
|
afterResizeEnd = "afterResizeEnd",
|
|
@@ -326,7 +365,8 @@ export interface IEventHandlersMap {
|
|
|
326
365
|
[GridEvents.scroll]: (scrollState: ICoords) => void;
|
|
327
366
|
[GridEvents.beforeSort]: (col: ICol, dir: Dirs) => void | boolean;
|
|
328
367
|
[GridEvents.afterSort]: (col: ICol, dir: Dirs) => void;
|
|
329
|
-
[GridEvents.filterChange]: (value: string, colId: Id, filterId: fixedRowContent) => void;
|
|
368
|
+
[GridEvents.filterChange]: (value: string | string[], colId: Id, filterId: fixedRowContent) => void;
|
|
369
|
+
[GridEvents.beforeFilter]: (value: string, colId: Id) => void | boolean;
|
|
330
370
|
[GridEvents.beforeResizeStart]: (col: ICol, e: MouseEvent) => boolean | void;
|
|
331
371
|
[GridEvents.resize]: (col: ICol, e: MouseEvent) => void;
|
|
332
372
|
[GridEvents.afterResizeEnd]: (col: ICol, e: MouseEvent) => void;
|
|
@@ -490,4 +530,10 @@ export interface IGridSelectionEventsHandlersMap {
|
|
|
490
530
|
[GridSelectionEvents.beforeUnSelect]: (row: IRow, col: ICol) => boolean | void;
|
|
491
531
|
}
|
|
492
532
|
export declare type TRowStatus = "firstFilledRow" | "firstEmptyRow";
|
|
533
|
+
export declare enum Split {
|
|
534
|
+
left = "leftSplit",
|
|
535
|
+
right = "rightSplit",
|
|
536
|
+
top = "topSplit",
|
|
537
|
+
bottom = "bottomSplit"
|
|
538
|
+
}
|
|
493
539
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
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;
|
|
@@ -14,7 +14,7 @@ export declare function getHandlers(row: number, column: number, conf: IRenderer
|
|
|
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[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Combobox } from "../../../../ts-combobox";
|
|
2
|
+
import { IEventSystem } from "../../../../ts-common/events";
|
|
3
|
+
import { IHeaderFilter, HeaderFilterEvent, ICol, IRendererConfig, IComboFilterConfig } from "../../types";
|
|
4
|
+
export declare class ComboFilter implements IHeaderFilter {
|
|
5
|
+
column: ICol;
|
|
6
|
+
config: IRendererConfig;
|
|
7
|
+
data: any[];
|
|
8
|
+
value: string | string[];
|
|
9
|
+
filterConfig: IComboFilterConfig;
|
|
10
|
+
events: IEventSystem<HeaderFilterEvent>;
|
|
11
|
+
private _filter;
|
|
12
|
+
private _isFocused;
|
|
13
|
+
constructor(column: any, config?: any, data?: any, value?: any, conf?: any);
|
|
14
|
+
protected initFilter(): void;
|
|
15
|
+
protected initHandlers(): void;
|
|
16
|
+
getFilter(): Combobox;
|
|
17
|
+
setValue(value: string | string[]): void;
|
|
18
|
+
clear(): void;
|
|
19
|
+
focus(): void;
|
|
20
|
+
blur(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IEventSystem } from "../../../../ts-common/events";
|
|
2
|
+
import { Id } from "../../../../ts-common/types";
|
|
3
|
+
import { IBaseHandlersMap, IHeaderFilter, HeaderFilterEvent, ICol, IRendererConfig } from "../../types";
|
|
4
|
+
export declare class InputFilter implements IHeaderFilter {
|
|
5
|
+
column: ICol;
|
|
6
|
+
config: IRendererConfig;
|
|
7
|
+
value: string;
|
|
8
|
+
id: Id;
|
|
9
|
+
events: IEventSystem<HeaderFilterEvent>;
|
|
10
|
+
private _filter;
|
|
11
|
+
private _isFocused;
|
|
12
|
+
protected _handlers: IBaseHandlersMap;
|
|
13
|
+
protected _inputDelay: any;
|
|
14
|
+
constructor(column: any, config: any, id: any, value: any);
|
|
15
|
+
protected initHandlers(): void;
|
|
16
|
+
protected initFilter(): void;
|
|
17
|
+
getFilter(): HTMLElement;
|
|
18
|
+
setValue(value: string): void;
|
|
19
|
+
clear(): void;
|
|
20
|
+
focus(): void;
|
|
21
|
+
blur(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IEventSystem } from "../../../../ts-common/events";
|
|
2
|
+
import { IBaseHandlersMap, IHeaderFilter, HeaderFilterEvent, ICol, IRendererConfig } from "../../types";
|
|
3
|
+
export declare class SelectFilter implements IHeaderFilter {
|
|
4
|
+
column: ICol;
|
|
5
|
+
config: IRendererConfig;
|
|
6
|
+
data: any[];
|
|
7
|
+
value: string;
|
|
8
|
+
events: IEventSystem<HeaderFilterEvent>;
|
|
9
|
+
private _filter;
|
|
10
|
+
private _isFocused;
|
|
11
|
+
protected _handlers: IBaseHandlersMap;
|
|
12
|
+
constructor(column: any, config: any, uniqueData: any, value: any);
|
|
13
|
+
protected initHandlers(): void;
|
|
14
|
+
protected initFilter(): void;
|
|
15
|
+
getFilter(): HTMLElement;
|
|
16
|
+
setValue(value: string): void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
focus(): void;
|
|
19
|
+
blur(): void;
|
|
20
|
+
}
|
|
@@ -15,5 +15,21 @@ export declare class DateEditor implements IEditor {
|
|
|
15
15
|
constructor(row: IRow, col: ICol, config: IRendererConfig);
|
|
16
16
|
endEdit(withoutSave?: boolean, calendarChange?: boolean): void;
|
|
17
17
|
toHTML(): any;
|
|
18
|
+
protected _cleanConfig(col: ICol): {
|
|
19
|
+
date?: string | Date;
|
|
20
|
+
css?: string;
|
|
21
|
+
mark?: (a: Date) => string;
|
|
22
|
+
disabledDates?: (a: Date) => boolean;
|
|
23
|
+
weekStart?: "saturday" | "sunday" | "monday";
|
|
24
|
+
weekNumbers?: boolean;
|
|
25
|
+
mode?: import("../../../../ts-calendar").ViewMode;
|
|
26
|
+
timePicker?: boolean;
|
|
27
|
+
timeFormat?: 12 | 24;
|
|
28
|
+
thisMonthOnly?: boolean;
|
|
29
|
+
width?: import("../../../../ts-common/types").Id;
|
|
30
|
+
$rangeMark?: (a: Date) => string;
|
|
31
|
+
block?: (a: Date) => boolean;
|
|
32
|
+
view?: import("../../../../ts-calendar").ViewMode;
|
|
33
|
+
};
|
|
18
34
|
protected _initHandlers(): void;
|
|
19
35
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { IGrid, IRendererConfig, IRow,
|
|
1
|
+
import { IGrid, IGridConfig, IProGrid, IRendererConfig, IRow, Split, IScrollBarWidth } from "../types";
|
|
2
|
+
export declare const BORDERS = 2;
|
|
3
|
+
export declare function calcScrollBarWidth(config: IGridConfig | IRendererConfig): IScrollBarWidth;
|
|
2
4
|
export declare function getRenderConfig(obj: any, data: IRow[], wrapperSizes: any): IRendererConfig;
|
|
5
|
+
export declare function getEvents(config: IRendererConfig, mode?: Split): {};
|
|
3
6
|
export declare function render(vm: any, obj: IGrid, htmlEvents: any, selection: any, uid: string): any;
|
|
4
7
|
export declare function proRender(vm: any, obj: IProGrid, htmlEvents: any, selection: any, uid: string): any;
|