@dhtmlx/chart 9.3.3
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/README.md +216 -0
- package/codebase/chart.d.ts +3 -0
- package/codebase/chart.min.css +1 -0
- package/codebase/chart.min.js +21 -0
- package/codebase/chart.min.js.map +1 -0
- package/codebase/fonts/roboto-bold-webfont.woff +0 -0
- package/codebase/fonts/roboto-bold-webfont.woff2 +0 -0
- package/codebase/fonts/roboto-medium-webfont.woff +0 -0
- package/codebase/fonts/roboto-medium-webfont.woff2 +0 -0
- package/codebase/fonts/roboto-regular-webfont.woff +0 -0
- package/codebase/fonts/roboto-regular-webfont.woff2 +0 -0
- package/codebase/types/ts-calendar/index.d.ts +2 -0
- package/codebase/types/ts-calendar/sources/Calendar.d.ts +37 -0
- package/codebase/types/ts-calendar/sources/helper.d.ts +1 -0
- package/codebase/types/ts-calendar/sources/types.d.ts +64 -0
- package/codebase/types/ts-chart/sources/AxisCreator.d.ts +11 -0
- package/codebase/types/ts-chart/sources/Chart.d.ts +28 -0
- package/codebase/types/ts-chart/sources/ComposeLayer.d.ts +10 -0
- package/codebase/types/ts-chart/sources/Export.d.ts +12 -0
- package/codebase/types/ts-chart/sources/Filters.d.ts +2 -0
- package/codebase/types/ts-chart/sources/Legend.d.ts +15 -0
- package/codebase/types/ts-chart/sources/Tooltip.d.ts +13 -0
- package/codebase/types/ts-chart/sources/entry.d.ts +8 -0
- package/codebase/types/ts-chart/sources/helpers/circle.d.ts +9 -0
- package/codebase/types/ts-chart/sources/helpers/common.d.ts +45 -0
- package/codebase/types/ts-chart/sources/helpers/spline.d.ts +2 -0
- package/codebase/types/ts-chart/sources/scales/RadialScale.d.ts +8 -0
- package/codebase/types/ts-chart/sources/scales/Scale.d.ts +22 -0
- package/codebase/types/ts-chart/sources/scales/SvgScales.d.ts +12 -0
- package/codebase/types/ts-chart/sources/scales/TextScale.d.ts +11 -0
- package/codebase/types/ts-chart/sources/scales/index.d.ts +9 -0
- package/codebase/types/ts-chart/sources/series/Area.d.ts +9 -0
- package/codebase/types/ts-chart/sources/series/Bar.d.ts +22 -0
- package/codebase/types/ts-chart/sources/series/BarX.d.ts +18 -0
- package/codebase/types/ts-chart/sources/series/BaseSeria.d.ts +31 -0
- package/codebase/types/ts-chart/sources/series/CalendarHeatMap.d.ts +20 -0
- package/codebase/types/ts-chart/sources/series/Donut.d.ts +5 -0
- package/codebase/types/ts-chart/sources/series/Line.d.ts +7 -0
- package/codebase/types/ts-chart/sources/series/NoScaleSeria.d.ts +22 -0
- package/codebase/types/ts-chart/sources/series/Pie.d.ts +5 -0
- package/codebase/types/ts-chart/sources/series/Pie3D.d.ts +5 -0
- package/codebase/types/ts-chart/sources/series/Radar.d.ts +16 -0
- package/codebase/types/ts-chart/sources/series/ScaleSeria.d.ts +15 -0
- package/codebase/types/ts-chart/sources/series/Scatter.d.ts +6 -0
- package/codebase/types/ts-chart/sources/series/Spline.d.ts +5 -0
- package/codebase/types/ts-chart/sources/series/SplineArea.d.ts +5 -0
- package/codebase/types/ts-chart/sources/series/Stacker.d.ts +9 -0
- package/codebase/types/ts-chart/sources/series/TreeMap.d.ts +30 -0
- package/codebase/types/ts-chart/sources/series/index.d.ts +29 -0
- package/codebase/types/ts-chart/sources/shapes/legend.d.ts +2 -0
- package/codebase/types/ts-chart/sources/shapes/line.d.ts +7 -0
- package/codebase/types/ts-chart/sources/types.d.ts +301 -0
- package/codebase/types/ts-combobox/index.d.ts +3 -0
- package/codebase/types/ts-combobox/sources/Combobox.d.ts +53 -0
- package/codebase/types/ts-combobox/sources/ProCombobox.d.ts +6 -0
- package/codebase/types/ts-combobox/sources/helper.d.ts +4 -0
- package/codebase/types/ts-combobox/sources/keyListener.d.ts +14 -0
- package/codebase/types/ts-combobox/sources/locales/en.d.ts +8 -0
- package/codebase/types/ts-combobox/sources/types.d.ts +95 -0
- package/codebase/types/ts-common/FocusManager.d.ts +15 -0
- package/codebase/types/ts-common/KeyManager.d.ts +19 -0
- package/codebase/types/ts-common/ScrollView.d.ts +40 -0
- package/codebase/types/ts-common/core.d.ts +40 -0
- package/codebase/types/ts-common/date.d.ts +34 -0
- package/codebase/types/ts-common/dom.d.ts +24 -0
- package/codebase/types/ts-common/events.d.ts +35 -0
- package/codebase/types/ts-common/html.d.ts +74 -0
- package/codebase/types/ts-common/input.d.ts +24 -0
- package/codebase/types/ts-common/keycodes.d.ts +9 -0
- package/codebase/types/ts-common/polyfills/array.d.ts +0 -0
- package/codebase/types/ts-common/polyfills/element.d.ts +0 -0
- package/codebase/types/ts-common/polyfills/fetch.d.ts +0 -0
- package/codebase/types/ts-common/polyfills/math.d.ts +0 -0
- package/codebase/types/ts-common/polyfills/object.d.ts +0 -0
- package/codebase/types/ts-common/polyfills/string.d.ts +0 -0
- package/codebase/types/ts-common/types.d.ts +76 -0
- package/codebase/types/ts-common/view.d.ts +27 -0
- package/codebase/types/ts-data/index.d.ts +13 -0
- package/codebase/types/ts-data/sources/CollectionStore.d.ts +7 -0
- package/codebase/types/ts-data/sources/DragManager.d.ts +19 -0
- package/codebase/types/ts-data/sources/ajax.d.ts +2 -0
- package/codebase/types/ts-data/sources/datacollection/group.d.ts +43 -0
- package/codebase/types/ts-data/sources/datacollection/loader.d.ts +16 -0
- package/codebase/types/ts-data/sources/datacollection/sort.d.ts +7 -0
- package/codebase/types/ts-data/sources/datacollection.d.ts +101 -0
- package/codebase/types/ts-data/sources/dataproxy.d.ts +10 -0
- package/codebase/types/ts-data/sources/drivers/CsvDriver.d.ts +16 -0
- package/codebase/types/ts-data/sources/drivers/JsonDriver.d.ts +10 -0
- package/codebase/types/ts-data/sources/drivers/XMLDriver.d.ts +18 -0
- package/codebase/types/ts-data/sources/drivers/drivers.d.ts +12 -0
- package/codebase/types/ts-data/sources/helpers.d.ts +17 -0
- package/codebase/types/ts-data/sources/lazydataproxy.d.ts +9 -0
- package/codebase/types/ts-data/sources/methods.d.ts +11 -0
- package/codebase/types/ts-data/sources/selection.d.ts +17 -0
- package/codebase/types/ts-data/sources/serializers/xml.d.ts +2 -0
- package/codebase/types/ts-data/sources/treecollection.d.ts +72 -0
- package/codebase/types/ts-data/sources/types.d.ts +340 -0
- package/codebase/types/ts-grid/index.d.ts +7 -0
- package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +47 -0
- package/codebase/types/ts-grid/sources/Grid.d.ts +114 -0
- package/codebase/types/ts-grid/sources/ProGrid.d.ts +67 -0
- package/codebase/types/ts-grid/sources/helpers/cells.d.ts +9 -0
- package/codebase/types/ts-grid/sources/helpers/data.d.ts +36 -0
- package/codebase/types/ts-grid/sources/helpers/default.d.ts +6 -0
- package/codebase/types/ts-grid/sources/helpers/dom.d.ts +3 -0
- package/codebase/types/ts-grid/sources/helpers/keys.d.ts +27 -0
- package/codebase/types/ts-grid/sources/helpers/main.d.ts +23 -0
- package/codebase/types/ts-grid/sources/locales/en.d.ts +7 -0
- package/codebase/types/ts-grid/sources/modules/BlockSelection.d.ts +122 -0
- package/codebase/types/ts-grid/sources/modules/Clipboard.d.ts +55 -0
- package/codebase/types/ts-grid/sources/modules/DropManager.d.ts +21 -0
- package/codebase/types/ts-grid/sources/modules/Exporter.d.ts +80 -0
- package/codebase/types/ts-grid/sources/modules/History.d.ts +72 -0
- package/codebase/types/ts-grid/sources/modules/Range.d.ts +71 -0
- package/codebase/types/ts-grid/sources/modules/Resizer.d.ts +2 -0
- package/codebase/types/ts-grid/sources/modules/Selection.d.ts +58 -0
- package/codebase/types/ts-grid/sources/types.d.ts +660 -0
- package/codebase/types/ts-grid/sources/ui/FixedCols.d.ts +3 -0
- package/codebase/types/ts-grid/sources/ui/FixedRows.d.ts +5 -0
- package/codebase/types/ts-grid/sources/ui/cells.d.ts +34 -0
- package/codebase/types/ts-grid/sources/ui/common.d.ts +8 -0
- package/codebase/types/ts-grid/sources/ui/components/dragPanel.d.ts +7 -0
- package/codebase/types/ts-grid/sources/ui/components/groupPanel.d.ts +13 -0
- package/codebase/types/ts-grid/sources/ui/components/subRow.d.ts +4 -0
- package/codebase/types/ts-grid/sources/ui/content/ComboFilter.d.ts +35 -0
- package/codebase/types/ts-grid/sources/ui/content/DateFilter.d.ts +42 -0
- package/codebase/types/ts-grid/sources/ui/content/InputFilter.d.ts +32 -0
- package/codebase/types/ts-grid/sources/ui/content/SelectFilter.d.ts +28 -0
- package/codebase/types/ts-grid/sources/ui/content.d.ts +55 -0
- package/codebase/types/ts-grid/sources/ui/editors/CheckboxEditor.d.ts +18 -0
- package/codebase/types/ts-grid/sources/ui/editors/ComboboxEditor.d.ts +18 -0
- package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +37 -0
- package/codebase/types/ts-grid/sources/ui/editors/InputEditor.d.ts +22 -0
- package/codebase/types/ts-grid/sources/ui/editors/SelectEditor.d.ts +16 -0
- package/codebase/types/ts-grid/sources/ui/editors/TextAreaEditor.d.ts +27 -0
- package/codebase/types/ts-grid/sources/ui/editors/editors.d.ts +2 -0
- package/codebase/types/ts-grid/sources/ui/proContent.d.ts +37 -0
- package/codebase/types/ts-grid/sources/ui/render.d.ts +9 -0
- package/codebase/types/ts-layout/index.d.ts +3 -0
- package/codebase/types/ts-layout/sources/Cell.d.ts +60 -0
- package/codebase/types/ts-layout/sources/Layout.d.ts +29 -0
- package/codebase/types/ts-layout/sources/ProCell.d.ts +9 -0
- package/codebase/types/ts-layout/sources/ProLayout.d.ts +6 -0
- package/codebase/types/ts-layout/sources/helpers.d.ts +6 -0
- package/codebase/types/ts-layout/sources/types.d.ts +129 -0
- package/codebase/types/ts-list/index.d.ts +4 -0
- package/codebase/types/ts-list/sources/List.d.ts +56 -0
- package/codebase/types/ts-list/sources/ProList.d.ts +11 -0
- package/codebase/types/ts-list/sources/Selection.d.ts +24 -0
- package/codebase/types/ts-list/sources/editors/InputEditor.d.ts +16 -0
- package/codebase/types/ts-list/sources/editors/editors.d.ts +4 -0
- package/codebase/types/ts-list/sources/types.d.ts +98 -0
- package/codebase/types/ts-message/index.d.ts +5 -0
- package/codebase/types/ts-message/sources/alert.d.ts +2 -0
- package/codebase/types/ts-message/sources/common.d.ts +1 -0
- package/codebase/types/ts-message/sources/confirm.d.ts +2 -0
- package/codebase/types/ts-message/sources/locales/en.d.ts +5 -0
- package/codebase/types/ts-message/sources/message.d.ts +4 -0
- package/codebase/types/ts-message/sources/tooltip.d.ts +6 -0
- package/codebase/types/ts-message/sources/types.d.ts +79 -0
- package/codebase/types/ts-popup/index.d.ts +2 -0
- package/codebase/types/ts-popup/sources/Popup.d.ts +29 -0
- package/codebase/types/ts-popup/sources/types.d.ts +42 -0
- package/codebase/types/ts-slider/index.d.ts +2 -0
- package/codebase/types/ts-slider/sources/Slider.d.ts +55 -0
- package/codebase/types/ts-slider/sources/types.d.ts +60 -0
- package/codebase/types/ts-timepicker/index.d.ts +2 -0
- package/codebase/types/ts-timepicker/sources/Timepicker.d.ts +28 -0
- package/codebase/types/ts-timepicker/sources/helper.d.ts +4 -0
- package/codebase/types/ts-timepicker/sources/locales/en.d.ts +6 -0
- package/codebase/types/ts-timepicker/sources/types.d.ts +52 -0
- package/codebase/types/ts-treegrid/index.d.ts +3 -0
- package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +26 -0
- package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +21 -0
- package/codebase/types/ts-treegrid/sources/types.d.ts +17 -0
- package/dhtmlx_chart.png +0 -0
- package/dhtmlx_logo.svg +4 -0
- package/license.md +360 -0
- package/package.json +13 -0
- package/whatsnew.txt +582 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IEventSystem } from "../../ts-common/events";
|
|
2
|
+
import { DataCollection } from "./datacollection";
|
|
3
|
+
import { DataCallback, DataEvents, IDataCollection, IDataItem, ITreeCollection, IFilterCallback, IFilterMode, IFilterComplexMode, ITreeFilterConfig, DataDriver, ISortMode, IDataDriver, IUpdateObject, ISortConfig } from "./types";
|
|
4
|
+
import { Id } from "../../ts-common/types";
|
|
5
|
+
export declare function addToOrder(store: any, obj: object, parent: Id, index: number): void;
|
|
6
|
+
export declare class TreeCollection<T extends IDataItem = IDataItem> extends DataCollection<T> implements ITreeCollection<T> {
|
|
7
|
+
protected _children: {
|
|
8
|
+
[id: string]: T[];
|
|
9
|
+
};
|
|
10
|
+
protected _root: Id;
|
|
11
|
+
protected _initChildren: {
|
|
12
|
+
[id: string]: T[];
|
|
13
|
+
};
|
|
14
|
+
constructor(config?: any, events?: IEventSystem<DataEvents>);
|
|
15
|
+
add(newItem: IDataItem, index?: number, parent?: Id): Id;
|
|
16
|
+
add(newItem: IDataItem[], index?: number, parent?: Id): Id[];
|
|
17
|
+
getRoot(): Id;
|
|
18
|
+
getParent(id: Id, asObj?: boolean): Id;
|
|
19
|
+
getItems(id: Id): T[];
|
|
20
|
+
getLength(id?: Id): number;
|
|
21
|
+
removeAll(id?: Id): void;
|
|
22
|
+
update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
|
|
23
|
+
getIndex(id: Id): number;
|
|
24
|
+
sort(rule?: ISortMode, config?: ISortConfig, ignore?: boolean): void;
|
|
25
|
+
filter(rule?: IFilterMode | IFilterComplexMode | IFilterCallback, config?: ITreeFilterConfig, silent?: boolean): string;
|
|
26
|
+
restoreOrder(): void;
|
|
27
|
+
copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id;
|
|
28
|
+
copy(id: Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id[];
|
|
29
|
+
move(id: Id, index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id;
|
|
30
|
+
move(id: Id[], index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id[];
|
|
31
|
+
forEach(callback: DataCallback<any>, parent?: Id, level?: number): void;
|
|
32
|
+
eachChild(id: Id, callback: DataCallback<T>, direct?: boolean, checkItem?: (item: IDataItem) => boolean): void;
|
|
33
|
+
getNearId(id: Id): Id;
|
|
34
|
+
loadItems(id: Id, driver?: IDataDriver | DataDriver): void;
|
|
35
|
+
refreshItems(id: Id, driver?: IDataDriver | DataDriver): void;
|
|
36
|
+
eachParent(id: Id, callback: DataCallback<T>, self?: boolean): void;
|
|
37
|
+
haveItems(id: Id): boolean;
|
|
38
|
+
canCopy(id: Id, target: Id): boolean;
|
|
39
|
+
serialize(driver?: DataDriver, checkItem?: (item: any) => any): any;
|
|
40
|
+
getId(index: number, parent?: Id): Id;
|
|
41
|
+
map(callback: DataCallback<T>, parent?: Id, direct?: boolean): any[];
|
|
42
|
+
getRawData(from: number, to: number, order?: T[], mode?: number, parent?: Id): T[];
|
|
43
|
+
protected flatten(input: T[]): T[];
|
|
44
|
+
protected _add({ newItem, index, parent, order, batch, }: {
|
|
45
|
+
newItem: IDataItem;
|
|
46
|
+
batch: IDataItem[];
|
|
47
|
+
index: number;
|
|
48
|
+
parent: Id;
|
|
49
|
+
order?: number;
|
|
50
|
+
}): Id;
|
|
51
|
+
protected _setParent(item: IDataItem, parent: Id): void;
|
|
52
|
+
protected _copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number): Id;
|
|
53
|
+
protected _move(id: Id, index: number, target?: ITreeCollection | IDataCollection, targetId?: Id, key?: number): Id;
|
|
54
|
+
protected _moveItem(id: any, targetId: any, index: any): void;
|
|
55
|
+
protected _reset(config: {
|
|
56
|
+
id?: Id;
|
|
57
|
+
grouping: any;
|
|
58
|
+
}): void;
|
|
59
|
+
protected _removeCore(id: Id): void;
|
|
60
|
+
private _removeFromParentList;
|
|
61
|
+
private _removeChildren;
|
|
62
|
+
private _removeFromOrders;
|
|
63
|
+
protected _addToOrder(_order: any, obj: any, index: number): void;
|
|
64
|
+
protected _parse_data(data: any, parent?: Id): void;
|
|
65
|
+
protected _parseItem(item: any): void;
|
|
66
|
+
private _recursiveFilter;
|
|
67
|
+
private _serialize;
|
|
68
|
+
private _applyFilter;
|
|
69
|
+
protected _normalizeFilters(filters: any): any;
|
|
70
|
+
protected _checkFilterRule(rule: IFilterMode | IFilterComplexMode | IFilterCallback): boolean;
|
|
71
|
+
protected _applySorters(): void;
|
|
72
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { IEventSystem } from "../../ts-common/events";
|
|
2
|
+
import { anyFunction, IAnyObj, Id } from "../../ts-common/types";
|
|
3
|
+
import { IGroupConfig, TGroupOrder } from "./datacollection/group";
|
|
4
|
+
import { TDragItem } from "./DragManager";
|
|
5
|
+
export interface IDataProxy {
|
|
6
|
+
url: string;
|
|
7
|
+
config?: any;
|
|
8
|
+
updateUrl?: (url?: string, params?: any) => void;
|
|
9
|
+
load?: () => Promise<any[] | string | void>;
|
|
10
|
+
save?: (data: any, mode: string) => Promise<any>;
|
|
11
|
+
}
|
|
12
|
+
export interface ILazyDataProxy extends IDataProxy {
|
|
13
|
+
config: ILazyConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface ILazyConfig {
|
|
16
|
+
from?: number;
|
|
17
|
+
limit?: number;
|
|
18
|
+
delay?: number;
|
|
19
|
+
prepare?: number;
|
|
20
|
+
}
|
|
21
|
+
export type TSortDir = "asc" | "desc";
|
|
22
|
+
export interface ISortMode {
|
|
23
|
+
by?: string | number;
|
|
24
|
+
dir?: TSortDir;
|
|
25
|
+
as?: (a: any) => any;
|
|
26
|
+
rule?: (a: any, b: any) => number;
|
|
27
|
+
}
|
|
28
|
+
export type ISortingState = ISortMode & ISortConfig;
|
|
29
|
+
export type IFilterCallback = (obj: any) => boolean;
|
|
30
|
+
export interface IFilterMode {
|
|
31
|
+
by?: Id;
|
|
32
|
+
match?: string | number | boolean;
|
|
33
|
+
compare?: (value: any, match: any, obj: any, multi?: boolean) => boolean;
|
|
34
|
+
multi?: any;
|
|
35
|
+
}
|
|
36
|
+
export interface IFilterComplexMode {
|
|
37
|
+
[key: string]: IFilterMode;
|
|
38
|
+
}
|
|
39
|
+
export interface IFilter {
|
|
40
|
+
[key: string]: IFilterParams;
|
|
41
|
+
}
|
|
42
|
+
export interface IFilterParams {
|
|
43
|
+
rule: IFilterMode | IFilterComplexMode | IFilterCallback;
|
|
44
|
+
config: IFilterConfig | ITreeFilterConfig;
|
|
45
|
+
}
|
|
46
|
+
export interface IFilterConfig {
|
|
47
|
+
id?: string;
|
|
48
|
+
add?: boolean;
|
|
49
|
+
smartFilter?: boolean;
|
|
50
|
+
permanent?: boolean;
|
|
51
|
+
$restore?: boolean;
|
|
52
|
+
$local?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface IResetFilterConfig {
|
|
55
|
+
id?: string;
|
|
56
|
+
permanent?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface ISortConfig {
|
|
59
|
+
smartSorting?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface ITreeFilterConfig extends IFilterConfig {
|
|
62
|
+
type?: TreeFilterType;
|
|
63
|
+
level?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface IUpdateObject {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}
|
|
68
|
+
export interface IApproximate {
|
|
69
|
+
value: any;
|
|
70
|
+
maxNum: number;
|
|
71
|
+
}
|
|
72
|
+
export interface IDataConfig {
|
|
73
|
+
init?: anyFunction;
|
|
74
|
+
update?: anyFunction;
|
|
75
|
+
approximate?: IApproximate;
|
|
76
|
+
autoload?: string;
|
|
77
|
+
collapsed?: boolean;
|
|
78
|
+
rootId?: Id;
|
|
79
|
+
}
|
|
80
|
+
export interface IGroupDataConfig extends IGroupConfig {
|
|
81
|
+
data?: IDataItem[];
|
|
82
|
+
}
|
|
83
|
+
export interface IDataCollection<T extends IDataItem = IDataItem> {
|
|
84
|
+
config: IDataConfig;
|
|
85
|
+
events: IEventSystem<DataEvents>;
|
|
86
|
+
dataProxy: IDataProxy;
|
|
87
|
+
loadData: Promise<any>;
|
|
88
|
+
saveData: Promise<any>;
|
|
89
|
+
group(order: TGroupOrder[], config?: IGroupDataConfig): void;
|
|
90
|
+
ungroup(): void;
|
|
91
|
+
isGrouped(): boolean;
|
|
92
|
+
load(url: IDataProxy | string, driver?: IDataDriver | DataDriver): Promise<any>;
|
|
93
|
+
parse(data: T[] | string, driver?: DataDriver | IDataDriver): void;
|
|
94
|
+
$parse(data: any[]): void;
|
|
95
|
+
add(newItem: IDataItem, index?: number): Id;
|
|
96
|
+
add(newItem: IDataItem[], index?: number): Id[];
|
|
97
|
+
add(newItem: IDataItem | IDataItem[], index?: number): Id | Id[];
|
|
98
|
+
remove(id: Id | Id[]): void;
|
|
99
|
+
removeAll(): void;
|
|
100
|
+
update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
|
|
101
|
+
exists(id: Id): boolean;
|
|
102
|
+
getInitialData(): T[];
|
|
103
|
+
getItem(id: Id): T;
|
|
104
|
+
getIndex(id: Id): number;
|
|
105
|
+
getLength(): number;
|
|
106
|
+
isDataLoaded(from?: number, to?: number): boolean;
|
|
107
|
+
getId(index: number): Id;
|
|
108
|
+
filter(rule?: IFilterMode | IFilterCallback, config?: IFilterConfig, silent?: boolean): string;
|
|
109
|
+
resetFilter(config?: IResetFilterConfig, silent?: boolean): boolean;
|
|
110
|
+
getFilters(config?: {
|
|
111
|
+
permanent?: boolean;
|
|
112
|
+
}): IFilter;
|
|
113
|
+
getRawFilters(config?: {
|
|
114
|
+
permanent?: boolean;
|
|
115
|
+
}): IFilter;
|
|
116
|
+
find(rule: IFilterMode): T;
|
|
117
|
+
reduce<A>(callback: ReduceCallBack<T, A>, acc: A): A;
|
|
118
|
+
findAll(rule: IFilterMode): T[];
|
|
119
|
+
map(callback: DataCallback<T>): T[];
|
|
120
|
+
mapRange(from: number, to: number, callback: DataCallback<T>): T[];
|
|
121
|
+
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
122
|
+
getSortingStates(): ISortingState[];
|
|
123
|
+
serialize(driver?: DataDriver): T[];
|
|
124
|
+
copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
|
|
125
|
+
move(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
|
|
126
|
+
changeId(id: Id, newId?: Id, silent?: boolean): void;
|
|
127
|
+
forEach(callback: DataCallback<T>): void;
|
|
128
|
+
save(url: IDataProxy | string): void;
|
|
129
|
+
isSaved(): boolean;
|
|
130
|
+
getRawData(from: number, to: number, order?: T[] | null, mode?: number): T[];
|
|
131
|
+
}
|
|
132
|
+
export interface IDataChangeStack {
|
|
133
|
+
order: IDataChange[];
|
|
134
|
+
}
|
|
135
|
+
export type Statuses = "add" | "update" | "remove" | string;
|
|
136
|
+
export interface IDataChange {
|
|
137
|
+
id: Id;
|
|
138
|
+
status: Statuses;
|
|
139
|
+
obj: any;
|
|
140
|
+
saving: boolean;
|
|
141
|
+
promise?: Promise<any>;
|
|
142
|
+
pending?: boolean;
|
|
143
|
+
error?: boolean;
|
|
144
|
+
}
|
|
145
|
+
export type RequestStatus = "saving" | "pending" | "error";
|
|
146
|
+
export interface IDir {
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
asc: number;
|
|
149
|
+
desc: number;
|
|
150
|
+
}
|
|
151
|
+
export interface IDataDriver {
|
|
152
|
+
toJsonArray(data: any): any[];
|
|
153
|
+
serialize(data: IAnyObj[]): any;
|
|
154
|
+
getRows(data: string): any[];
|
|
155
|
+
getFields(row: any): {
|
|
156
|
+
[key: string]: any;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export interface ICsvDriverConfig {
|
|
160
|
+
skipHeader?: number;
|
|
161
|
+
nameByHeader?: boolean;
|
|
162
|
+
names?: string[];
|
|
163
|
+
rowDelimiter?: string;
|
|
164
|
+
columnDelimiter?: string;
|
|
165
|
+
}
|
|
166
|
+
export declare enum TreeFilterType {
|
|
167
|
+
all = "all",
|
|
168
|
+
level = "level",
|
|
169
|
+
leafs = "leafs"
|
|
170
|
+
}
|
|
171
|
+
export type DataCallback<T> = (item: T, index?: number, array?: T[]) => any;
|
|
172
|
+
export type ReduceCallBack<T, A> = (acc: A, item: T, index?: number) => A;
|
|
173
|
+
export interface ITreeCollection<T extends IDataItem = IDataItem> extends IDataCollection<T> {
|
|
174
|
+
add(newItem: IDataItem, index?: number, parent?: Id): Id;
|
|
175
|
+
add(newItem: IDataItem[], index?: number, parent?: Id): Id[];
|
|
176
|
+
add(newItem: IDataItem | IDataItem[], index?: number, parent?: Id): Id | Id[];
|
|
177
|
+
getRoot(): Id;
|
|
178
|
+
getParent(id: Id): Id;
|
|
179
|
+
removeAll(id?: Id): void;
|
|
180
|
+
getLength(id?: Id): number;
|
|
181
|
+
getIndex(id: Id): number;
|
|
182
|
+
getItems(id: Id): T[];
|
|
183
|
+
sort(rule?: ISortMode, config?: ISortConfig): void;
|
|
184
|
+
map(callback: DataCallback<T>, parent?: Id, direct?: boolean): any;
|
|
185
|
+
filter(rule?: IFilterMode | IFilterCallback, config?: ITreeFilterConfig, silent?: boolean): string;
|
|
186
|
+
restoreOrder(): void;
|
|
187
|
+
copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id;
|
|
188
|
+
copy(id: Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id[];
|
|
189
|
+
copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
|
|
190
|
+
move(id: Id, index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id;
|
|
191
|
+
move(id: Id[], index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id[];
|
|
192
|
+
move(id: Id | Id[], index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id | Id[];
|
|
193
|
+
eachChild(id: Id, callback: DataCallback<T>, direct?: boolean, checkItem?: (item: IDataItem) => boolean): void;
|
|
194
|
+
eachParent(id: Id, callback: DataCallback<T>, self?: boolean): void;
|
|
195
|
+
loadItems(id: Id, driver?: IDataDriver | DataDriver): void;
|
|
196
|
+
refreshItems(id: Id, driver?: IDataDriver | DataDriver): void;
|
|
197
|
+
haveItems(id: Id): boolean;
|
|
198
|
+
canCopy(id: Id, target: Id): boolean;
|
|
199
|
+
forEach(callback: DataCallback<T>, parent?: Id, level?: number): void;
|
|
200
|
+
}
|
|
201
|
+
export interface IDataItem {
|
|
202
|
+
id?: Id;
|
|
203
|
+
[key: string]: any;
|
|
204
|
+
}
|
|
205
|
+
export type DropPosition = "top" | "bottom" | "in";
|
|
206
|
+
export interface IObjWithData {
|
|
207
|
+
name?: string;
|
|
208
|
+
data: ITreeCollection | IDataCollection;
|
|
209
|
+
events: IEventSystem<DragEvents, IDragEventsHandlersMap>;
|
|
210
|
+
config: IDragConfig;
|
|
211
|
+
id?: Id;
|
|
212
|
+
}
|
|
213
|
+
export interface ITransferData {
|
|
214
|
+
initXOffset?: number;
|
|
215
|
+
initYOffset?: number;
|
|
216
|
+
x?: number;
|
|
217
|
+
y?: number;
|
|
218
|
+
ghost?: HTMLElement;
|
|
219
|
+
componentId?: Id;
|
|
220
|
+
dragConfig?: IDragConfig;
|
|
221
|
+
component?: IObjWithData;
|
|
222
|
+
dropPosition?: DropPosition;
|
|
223
|
+
dropComponentId?: Id;
|
|
224
|
+
item?: HTMLElement;
|
|
225
|
+
start?: Id;
|
|
226
|
+
source?: Id[];
|
|
227
|
+
target?: Id;
|
|
228
|
+
type?: TDragItem;
|
|
229
|
+
isWasColumn?: boolean;
|
|
230
|
+
groupable?: boolean;
|
|
231
|
+
groupOnly?: boolean;
|
|
232
|
+
}
|
|
233
|
+
export interface IDragConfig {
|
|
234
|
+
dragCopy?: boolean;
|
|
235
|
+
dropBehaviour?: DropBehaviour;
|
|
236
|
+
dragMode?: DragMode;
|
|
237
|
+
}
|
|
238
|
+
export interface ICopyObject {
|
|
239
|
+
id: Id;
|
|
240
|
+
component: IObjWithData;
|
|
241
|
+
newId?: Id;
|
|
242
|
+
}
|
|
243
|
+
export declare enum DataEvents {
|
|
244
|
+
afterAdd = "afteradd",
|
|
245
|
+
beforeAdd = "beforeadd",
|
|
246
|
+
removeAll = "removeall",
|
|
247
|
+
beforeRemove = "beforeremove",
|
|
248
|
+
afterRemove = "afterremove",
|
|
249
|
+
change = "change",
|
|
250
|
+
filter = "filter",
|
|
251
|
+
dataRequest = "dataRequest",
|
|
252
|
+
load = "load",
|
|
253
|
+
loadError = "loaderror",
|
|
254
|
+
beforeLazyLoad = "beforelazyload",
|
|
255
|
+
afterLazyLoad = "afterlazyload",
|
|
256
|
+
beforeItemLoad = "beforeItemLoad",
|
|
257
|
+
afterItemLoad = "afterItemLoad",
|
|
258
|
+
beforeGroup = "beforeGroup",
|
|
259
|
+
afterGroup = "afterGroup",
|
|
260
|
+
beforeUnGroup = "beforeUnGroup",
|
|
261
|
+
afterUnGroup = "afterUnGroup"
|
|
262
|
+
}
|
|
263
|
+
export interface IDataEventsHandlersMap {
|
|
264
|
+
[key: string]: (...args: any[]) => any;
|
|
265
|
+
[DataEvents.change]: (id?: Id, status?: Statuses, updatedItem?: IDataItem) => void;
|
|
266
|
+
[DataEvents.filter]: (filter?: IFilter) => void;
|
|
267
|
+
[DataEvents.beforeAdd]: (newItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;
|
|
268
|
+
[DataEvents.afterAdd]: (newItem: IDataItem, batch: IDataItem[], index: number) => void;
|
|
269
|
+
[DataEvents.beforeRemove]: (removedItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;
|
|
270
|
+
[DataEvents.afterRemove]: (removedItem: IDataItem, batch: IDataItem[], index: number) => void;
|
|
271
|
+
[DataEvents.removeAll]: () => void;
|
|
272
|
+
[DataEvents.dataRequest]: (from: number, to: number) => void;
|
|
273
|
+
[DataEvents.load]: () => void;
|
|
274
|
+
[DataEvents.loadError]: (response: any) => void;
|
|
275
|
+
[DataEvents.beforeItemLoad]: (id: Id) => boolean | void;
|
|
276
|
+
[DataEvents.afterItemLoad]: (id: Id) => void;
|
|
277
|
+
[DataEvents.beforeLazyLoad]: () => boolean | void;
|
|
278
|
+
[DataEvents.afterLazyLoad]: (from: number, count: number) => void;
|
|
279
|
+
[DataEvents.beforeGroup]: (config: IGroupConfig) => boolean | void;
|
|
280
|
+
[DataEvents.afterGroup]: (grouped: string[], config: IGroupConfig) => void;
|
|
281
|
+
[DataEvents.beforeUnGroup]: (grouped: string[], config: IGroupConfig) => boolean | void;
|
|
282
|
+
[DataEvents.afterUnGroup]: (grouped: string[], config: IGroupConfig) => void;
|
|
283
|
+
}
|
|
284
|
+
export declare enum DragEvents {
|
|
285
|
+
beforeDrag = "beforeDrag",
|
|
286
|
+
dragStart = "dragStart",
|
|
287
|
+
dragOut = "dragOut",
|
|
288
|
+
dragIn = "dragIn",
|
|
289
|
+
canDrop = "canDrop",
|
|
290
|
+
cancelDrop = "cancelDrop",
|
|
291
|
+
beforeDrop = "beforeDrop",
|
|
292
|
+
afterDrop = "afterDrop",
|
|
293
|
+
afterDrag = "afterDrag"
|
|
294
|
+
}
|
|
295
|
+
export interface IDragInfo {
|
|
296
|
+
start: Id;
|
|
297
|
+
source: Id[];
|
|
298
|
+
target: Id;
|
|
299
|
+
dropPosition?: DropPosition;
|
|
300
|
+
}
|
|
301
|
+
export type DragMode = "target" | "both" | "source";
|
|
302
|
+
export type DropBehaviour = "child" | "sibling" | "complex";
|
|
303
|
+
export interface IDragEventsHandlersMap {
|
|
304
|
+
[key: string]: (...args: any[]) => any;
|
|
305
|
+
[DragEvents.beforeDrag]: (data: IDragInfo, events: MouseEvent, ghost: HTMLElement, type: TDragItem) => void | boolean;
|
|
306
|
+
[DragEvents.dragStart]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
307
|
+
[DragEvents.dragOut]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
308
|
+
[DragEvents.dragIn]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
|
|
309
|
+
[DragEvents.canDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
310
|
+
[DragEvents.cancelDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
|
|
311
|
+
[DragEvents.beforeDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
|
|
312
|
+
[DragEvents.afterDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
|
|
313
|
+
[DragEvents.afterDrag]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
|
|
314
|
+
}
|
|
315
|
+
export declare enum DataDriver {
|
|
316
|
+
json = "json",
|
|
317
|
+
csv = "csv",
|
|
318
|
+
xml = "xml"
|
|
319
|
+
}
|
|
320
|
+
export type AjaxResponseType = "json" | "xml" | "text" | "raw";
|
|
321
|
+
export interface IAjaxHelperConfig {
|
|
322
|
+
headers: {
|
|
323
|
+
[key: string]: string;
|
|
324
|
+
};
|
|
325
|
+
responseType: AjaxResponseType;
|
|
326
|
+
}
|
|
327
|
+
export interface IAjaxHelper {
|
|
328
|
+
get<T>(url: string, data?: {
|
|
329
|
+
[key: string]: any;
|
|
330
|
+
} | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
|
|
331
|
+
post<T>(url: string, data?: {
|
|
332
|
+
[key: string]: any;
|
|
333
|
+
} | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
|
|
334
|
+
put<T>(url: string, data?: {
|
|
335
|
+
[key: string]: any;
|
|
336
|
+
} | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
|
|
337
|
+
delete<T>(url: string, data?: {
|
|
338
|
+
[key: string]: any;
|
|
339
|
+
} | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
|
|
340
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./sources/Grid";
|
|
2
|
+
export * from "./sources/ExtendedGrid";
|
|
3
|
+
export * from "./sources/ProGrid";
|
|
4
|
+
export * from "./sources/types";
|
|
5
|
+
export * from "./sources/helpers/cells";
|
|
6
|
+
export * from "./sources/helpers/data";
|
|
7
|
+
export * from "./sources/helpers/main";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig, ISubViewCell } from "./types";
|
|
2
|
+
import { IDataCollection, IDataItem } from "../../ts-data";
|
|
3
|
+
import { ScrollView } from "../../ts-common/ScrollView";
|
|
4
|
+
import { Id } from "../../ts-common/types";
|
|
5
|
+
import { Grid } from "./Grid";
|
|
6
|
+
import { IRange } from "./modules/Range";
|
|
7
|
+
import { IBlockSelection } from "./modules/BlockSelection";
|
|
8
|
+
import { IClipboard } from "./modules/Clipboard";
|
|
9
|
+
import { IHistory } from "./modules/History";
|
|
10
|
+
import { IProContentList } from "./ui/proContent";
|
|
11
|
+
export declare class ExtendedGrid extends Grid implements IExtendedGrid {
|
|
12
|
+
range: IRange;
|
|
13
|
+
block: IBlockSelection;
|
|
14
|
+
clipboard: IClipboard;
|
|
15
|
+
history: IHistory;
|
|
16
|
+
scrollView: ScrollView;
|
|
17
|
+
config: IExtendedGridConfig;
|
|
18
|
+
content: IProContentList;
|
|
19
|
+
constructor(container: HTMLElement | string | null, config?: IExtendedGridConfig);
|
|
20
|
+
expand(rowId: Id): void;
|
|
21
|
+
collapse(rowId: Id): void;
|
|
22
|
+
expandAll(): void;
|
|
23
|
+
collapseAll(): void;
|
|
24
|
+
getSubRow(id: Id): ISubViewCell | null;
|
|
25
|
+
destructor(): void;
|
|
26
|
+
protected _createView(): any;
|
|
27
|
+
protected _init(): void;
|
|
28
|
+
protected _dragInit(): void;
|
|
29
|
+
protected _setHTMLEventHandlers(): void;
|
|
30
|
+
protected _setEventHandlers(): void;
|
|
31
|
+
protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
|
|
32
|
+
protected _setSort(): void;
|
|
33
|
+
protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
|
|
34
|
+
protected _prepareData(data: IDataItem[] | IDataCollection): IDataItem[] | IRow[];
|
|
35
|
+
protected _prepareDataFromTo(data: IDataCollection, from: number, to: number): IDataItem[];
|
|
36
|
+
protected _dragStart(event: any): void;
|
|
37
|
+
protected _group(order: IGroupOrderItem[]): void;
|
|
38
|
+
protected _expand(row: IRow): boolean;
|
|
39
|
+
protected _collapse(row: IRow): boolean;
|
|
40
|
+
private _lazyLoad;
|
|
41
|
+
private _getGhostItem;
|
|
42
|
+
private _dragStartColumn;
|
|
43
|
+
private _dragStartGroupItem;
|
|
44
|
+
private _changeGroupItemAfterSort;
|
|
45
|
+
private _isGroupableColumn;
|
|
46
|
+
private _isGroupClosable;
|
|
47
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { IEventSystem } from "../../ts-common/events";
|
|
2
|
+
import { IKeyManager } from "../../ts-common/KeyManager";
|
|
3
|
+
import { Id, ITouchParam } from "../../ts-common/types";
|
|
4
|
+
import { View } from "../../ts-common/view";
|
|
5
|
+
import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap, TSortDir } from "../../ts-data";
|
|
6
|
+
import { Exporter } from "./modules/Exporter";
|
|
7
|
+
import { ISelection } from "./modules/Selection";
|
|
8
|
+
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, SortFunction, IAdjustColumns, IDirection, IFooter, IHeader, INormalizeColumnsParams, ISummaryList, ISortingStates } from "./types";
|
|
9
|
+
import { IContentList, IHeaderFilter } from "./ui/content";
|
|
10
|
+
import { IProContentList } from "./ui/proContent";
|
|
11
|
+
export declare class Grid extends View implements IGrid {
|
|
12
|
+
version: string;
|
|
13
|
+
name: "grid";
|
|
14
|
+
data: IDataCollection;
|
|
15
|
+
config: IGridConfig;
|
|
16
|
+
events: IEventSystem<DataEvents | GridEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
|
|
17
|
+
export: Exporter;
|
|
18
|
+
content: IContentList | IProContentList;
|
|
19
|
+
selection: ISelection;
|
|
20
|
+
keyManager: IKeyManager;
|
|
21
|
+
protected _touch: ITouchParam;
|
|
22
|
+
protected _destructed: boolean;
|
|
23
|
+
protected _scroll: IScrollState;
|
|
24
|
+
protected _events: IEventSystem<GridSystemEvents, ISystemEventHandlersMap>;
|
|
25
|
+
protected _htmlEvents: any;
|
|
26
|
+
protected _sortingStates: ISortingStates;
|
|
27
|
+
protected _activeFilters: object;
|
|
28
|
+
protected _dropManager: any;
|
|
29
|
+
private _filterData;
|
|
30
|
+
private _hiddenFilters;
|
|
31
|
+
private _commonSummary;
|
|
32
|
+
private _colSummary;
|
|
33
|
+
constructor(container: HTMLElement | string | null, config?: IGridConfig);
|
|
34
|
+
destructor(): void;
|
|
35
|
+
setColumns(columns: 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
|
+
showColumn(colId: Id): void;
|
|
41
|
+
hideColumn(colId: Id): void;
|
|
42
|
+
isColumnHidden(colId: Id): boolean;
|
|
43
|
+
showRow(rowId: Id): void;
|
|
44
|
+
hideRow(rowId: Id): void;
|
|
45
|
+
isRowHidden(rowId: Id): boolean;
|
|
46
|
+
getScrollState(): ICoords;
|
|
47
|
+
scroll(x: number, y: number): void;
|
|
48
|
+
scrollTo(rowId: Id, colId: Id): void;
|
|
49
|
+
adjustColumnWidth(colId: Id, adjust?: IAdjustBy): void;
|
|
50
|
+
getCellRect(rowId: Id, colId?: Id): ICellRect;
|
|
51
|
+
getColumn(colId: Id): ICol;
|
|
52
|
+
addSpan(spanObj: ISpan): void;
|
|
53
|
+
getSpan(rowId: Id, colId: Id): ISpan;
|
|
54
|
+
removeSpan(rowId: Id, colId: Id): void;
|
|
55
|
+
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
56
|
+
editEnd(withoutSave?: boolean): void;
|
|
57
|
+
getHeaderFilter(colId: Id): IHeaderFilter;
|
|
58
|
+
getSummary(colId?: Id): ISummaryList;
|
|
59
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
60
|
+
getSortingState(): {
|
|
61
|
+
dir?: TSortDir;
|
|
62
|
+
by?: Id;
|
|
63
|
+
};
|
|
64
|
+
protected _createView(): any;
|
|
65
|
+
protected _dragInit(): void;
|
|
66
|
+
protected _parseColumns(configChanged?: boolean): void;
|
|
67
|
+
protected normalizeColumns({ config, columns, configChanged }: INormalizeColumnsParams): void;
|
|
68
|
+
protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
|
|
69
|
+
protected _parseData(): void;
|
|
70
|
+
protected _createCollection(): void;
|
|
71
|
+
protected _getRowIndex(rowId: Id): number;
|
|
72
|
+
protected _setHTMLEventHandlers(): void;
|
|
73
|
+
protected _setEventHandlers(): void;
|
|
74
|
+
protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
|
|
75
|
+
protected _addEmptyRow(): void;
|
|
76
|
+
protected _sort(by: Id, sortAs?: SortFunction, smartSorting?: boolean): void;
|
|
77
|
+
protected _setSort(): void;
|
|
78
|
+
protected _clearTouchTimer(): void;
|
|
79
|
+
protected _checkFilters(reset?: boolean): void;
|
|
80
|
+
protected _setUniqueData(sync?: boolean): void;
|
|
81
|
+
protected _checkSelectFilterValue(): void;
|
|
82
|
+
protected _clearFilterValue(allCols?: boolean): void;
|
|
83
|
+
protected _adjustColumns(): void;
|
|
84
|
+
protected _prepareData(data: IDataItem[] | IDataCollection): any[] | IDataItem[];
|
|
85
|
+
protected _adjustColumnsWidth({ rows, cols, adjust, }: IAdjustColumns): IColumnsWidth;
|
|
86
|
+
protected _prepareColumnData(data: any, type: "header" | "footer"): IRow[];
|
|
87
|
+
protected _dragStart(event: any): void;
|
|
88
|
+
protected _dragProcess(event: MouseEvent | TouchEvent, row: IRow, column?: ICol): void;
|
|
89
|
+
protected _getRowGhost(ids: Id[]): HTMLDivElement;
|
|
90
|
+
protected _initHooks(): {
|
|
91
|
+
didMount: () => void;
|
|
92
|
+
};
|
|
93
|
+
protected _normalizeDataType(): void;
|
|
94
|
+
protected _applyLocalFilter(beforePrepareData?: boolean): void;
|
|
95
|
+
protected _normalizeSpans(): void;
|
|
96
|
+
protected _hideColumn(column: ICol): void;
|
|
97
|
+
protected _showColumn(column: ICol): void;
|
|
98
|
+
protected _setSummary(): void;
|
|
99
|
+
protected _init(): void;
|
|
100
|
+
private _applyMethod;
|
|
101
|
+
private _canDataParse;
|
|
102
|
+
private _attachDataCollection;
|
|
103
|
+
private _setMarks;
|
|
104
|
+
private _checkMarks;
|
|
105
|
+
private _removeMarks;
|
|
106
|
+
private _detectColsTypes;
|
|
107
|
+
private _destroyContent;
|
|
108
|
+
private _render;
|
|
109
|
+
private _initHotKey;
|
|
110
|
+
private _normalizeConfig;
|
|
111
|
+
protected _autoScroll(mode: IDirection): void;
|
|
112
|
+
private _applyAutoWidth;
|
|
113
|
+
private _handleRow;
|
|
114
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ScrollView } from "../../ts-common/ScrollView";
|
|
2
|
+
import { TreeGridCollection } from "../../ts-treegrid";
|
|
3
|
+
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, ICoords, IEventHandlersMap, IProGrid, IProGridConfig, ISpan, ISubViewCell, 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, TSortDir } from "../../ts-data";
|
|
8
|
+
import { ISelection } from "./modules/Selection";
|
|
9
|
+
import { IRange } from "./modules/Range";
|
|
10
|
+
import { IBlockSelection } from "./modules/BlockSelection";
|
|
11
|
+
import { IClipboard } from "./modules/Clipboard";
|
|
12
|
+
import { IHistory } from "./modules/History";
|
|
13
|
+
import { IProContentList, IProHeaderFilter } from "./ui/proContent";
|
|
14
|
+
export declare class ProGrid implements IProGrid {
|
|
15
|
+
config: IProGridConfig;
|
|
16
|
+
scrollView: ScrollView;
|
|
17
|
+
events: IEventSystem<GridEvents | DataEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
|
|
18
|
+
name: string;
|
|
19
|
+
data: IDataCollection<IDataItem> & TreeGridCollection;
|
|
20
|
+
selection: ISelection;
|
|
21
|
+
content: IProContentList;
|
|
22
|
+
keyManager: IKeyManager;
|
|
23
|
+
export: any;
|
|
24
|
+
range: IRange;
|
|
25
|
+
block: IBlockSelection;
|
|
26
|
+
clipboard: IClipboard;
|
|
27
|
+
history: IHistory;
|
|
28
|
+
constructor(container: HTMLElement | string | null, config?: IProGridConfig);
|
|
29
|
+
paint(): void;
|
|
30
|
+
destructor(): void;
|
|
31
|
+
expand(rowId: Id): void;
|
|
32
|
+
collapse(rowId: Id): void;
|
|
33
|
+
expandAll(): void;
|
|
34
|
+
collapseAll(): void;
|
|
35
|
+
showColumn(colId: Id): void;
|
|
36
|
+
hideColumn(colId: Id): void;
|
|
37
|
+
isColumnHidden(colId: Id): boolean;
|
|
38
|
+
showRow(rowId: Id): void;
|
|
39
|
+
hideRow(rowId: Id): void;
|
|
40
|
+
isRowHidden(rowId: Id): boolean;
|
|
41
|
+
scrollTo(rowId: Id, colId: Id): void;
|
|
42
|
+
scroll(x?: number, y?: number): void;
|
|
43
|
+
getScrollState(): ICoords;
|
|
44
|
+
setColumns(col: ICol[]): void;
|
|
45
|
+
addRowCss(rowId: Id, css: string): void;
|
|
46
|
+
removeRowCss(rowId: Id, css: string): void;
|
|
47
|
+
addCellCss(rowId: Id, colId: Id, css: string): void;
|
|
48
|
+
removeCellCss(rowId: Id, colId: Id, css: string): void;
|
|
49
|
+
adjustColumnWidth(colId: Id, adjust?: IAdjustBy): void;
|
|
50
|
+
getCellRect(rowId: Id, colId: Id): ICellRect;
|
|
51
|
+
getColumn(colId: Id): ICol;
|
|
52
|
+
addSpan(spanObj: ISpan): void;
|
|
53
|
+
getSpan(rowId: Id, colId: Id): ISpan;
|
|
54
|
+
removeSpan(rowId: Id, colId: Id): void;
|
|
55
|
+
editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
|
|
56
|
+
editEnd(withoutSave?: boolean): void;
|
|
57
|
+
getHeaderFilter(colId: Id): IProHeaderFilter;
|
|
58
|
+
getSummary(colId?: Id): ISummaryList;
|
|
59
|
+
getSubRow(id: Id): ISubViewCell | null;
|
|
60
|
+
getRootNode(): HTMLElement;
|
|
61
|
+
getRootView(): void;
|
|
62
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
|
|
63
|
+
getSortingState(): {
|
|
64
|
+
dir?: TSortDir;
|
|
65
|
+
by?: Id;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICell, ICol, IGrid, IRow, ISpan } from "./../types";
|
|
2
|
+
import { Id } from "../../../ts-common/types";
|
|
3
|
+
export declare function getWidth(columns: ICol[], colspan: number, index: number): number;
|
|
4
|
+
export declare function getSpanHeight(rows: IRow[], span: ISpan): number;
|
|
5
|
+
export declare function getReducedColspan(columns: ICol[], colId: Id, colspan: number): number;
|
|
6
|
+
export declare function getReducedRowspan(initialRows: IRow[], currRows: IRow[], rowIndex: number, span: ISpan): number;
|
|
7
|
+
export declare function normalizeCell(cell: ICell, grid: IGrid): ICell;
|
|
8
|
+
export declare function clearCells(grid: any, cells: ICell[]): void;
|
|
9
|
+
export declare function formatValue(value: string, cell: ICell): any;
|