@dhtmlx/vault 5.0.6
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 +251 -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-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/locale.d.ts +1 -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-dataview/index.d.ts +3 -0
- package/codebase/types/ts-dataview/sources/DataView.d.ts +41 -0
- package/codebase/types/ts-dataview/sources/ProDataView.d.ts +11 -0
- package/codebase/types/ts-dataview/sources/editors/InputEditor.d.ts +16 -0
- package/codebase/types/ts-dataview/sources/editors/editors.d.ts +4 -0
- package/codebase/types/ts-dataview/sources/types.d.ts +63 -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-navbar/index.d.ts +3 -0
- package/codebase/types/ts-navbar/sources/Navbar.d.ts +61 -0
- package/codebase/types/ts-navbar/sources/elements/button.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/customHTMLButton.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/datePicker.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/helpers.d.ts +17 -0
- package/codebase/types/ts-navbar/sources/elements/imageButton.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/input.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/menuItem.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/navItem.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/separator.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/spacer.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/elements/title.d.ts +1 -0
- package/codebase/types/ts-navbar/sources/itemfactory.d.ts +10 -0
- package/codebase/types/ts-navbar/sources/types.d.ts +210 -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-toolbar/index.d.ts +2 -0
- package/codebase/types/ts-toolbar/sources/ProToolbar.d.ts +10 -0
- package/codebase/types/ts-toolbar/sources/Toolbar.d.ts +33 -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/codebase/types/ts-vault/sources/ProgressBar.d.ts +12 -0
- package/codebase/types/ts-vault/sources/ReadStackPreview.d.ts +11 -0
- package/codebase/types/ts-vault/sources/Uploader.d.ts +26 -0
- package/codebase/types/ts-vault/sources/Vault.d.ts +39 -0
- package/codebase/types/ts-vault/sources/configs.d.ts +2 -0
- package/codebase/types/ts-vault/sources/entry.d.ts +8 -0
- package/codebase/types/ts-vault/sources/helper.d.ts +31 -0
- package/codebase/types/ts-vault/sources/locales/en.d.ts +21 -0
- package/codebase/types/ts-vault/sources/types.d.ts +127 -0
- package/codebase/vault.d.ts +3 -0
- package/codebase/vault.min.css +1 -0
- package/codebase/vault.min.js +21 -0
- package/codebase/vault.min.js.map +1 -0
- package/license.md +360 -0
- package/package.json +14 -0
- package/whatsnew.txt +99 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IAnyObj, Id } from "../../ts-common/types";
|
|
2
|
+
import { DataProxy } from "./dataproxy";
|
|
3
|
+
import { IFilterCallback, IFilterMode, IDataCollection, IDataItem, ITreeCollection, DataDriver, IDataDriver, IFilter } from "./types";
|
|
4
|
+
export declare function isEqualObj(a: any, b: any): boolean;
|
|
5
|
+
export declare function naturalCompare(a: any, b: any): any;
|
|
6
|
+
export declare function findByConf(item: IDataItem, conf: IFilterMode | IFilterCallback, index?: number, array?: IDataItem[]): IDataItem;
|
|
7
|
+
export declare function isDebug(): boolean;
|
|
8
|
+
export declare function dhxWarning(msg: string): void;
|
|
9
|
+
export declare function dhxError(msg: string): void;
|
|
10
|
+
export declare function toProxy(proxy: any): DataProxy;
|
|
11
|
+
export declare function toDataDriver(driver: DataDriver | IDataDriver): IDataDriver;
|
|
12
|
+
export declare function copyWithoutInner(obj: IAnyObj, forbidden?: IAnyObj): IAnyObj;
|
|
13
|
+
export declare function isTreeCollection(obj: IDataCollection<any> | ITreeCollection<any> | IDataItem[]): obj is ITreeCollection<any>;
|
|
14
|
+
export declare function hasJsonOrArrayStructure(str: any): boolean;
|
|
15
|
+
export declare function isOnlyPermanentFilters(filters: IFilter): boolean;
|
|
16
|
+
export declare function throwMoveWarning(id: Id, exists?: boolean): null;
|
|
17
|
+
export declare function splitCsv(csv: string, delimiter: string): string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataProxy } from "./dataproxy";
|
|
2
|
+
import { ILazyConfig, ILazyDataProxy } from "./types";
|
|
3
|
+
export declare class LazyDataProxy extends DataProxy implements ILazyDataProxy {
|
|
4
|
+
config: ILazyConfig;
|
|
5
|
+
private _timeout;
|
|
6
|
+
private _cooling;
|
|
7
|
+
constructor(url: string, config?: any);
|
|
8
|
+
load<T = string>(): Promise<T>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Item = {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
};
|
|
4
|
+
export declare const methods: {
|
|
5
|
+
sum: (items: Item[], field: string) => number;
|
|
6
|
+
avg: (items: Item[], field: string) => number;
|
|
7
|
+
count: (items: Item[], field: string) => number;
|
|
8
|
+
min: (items: Item[], field: string) => number;
|
|
9
|
+
max: (items: Item[], field: string) => number;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IEventSystem } from "../../ts-common/events";
|
|
2
|
+
import { SelectionEvents, ISelection, ISelectionConfig, Id } from "../../ts-common/types";
|
|
3
|
+
import { DataCollection } from "./datacollection";
|
|
4
|
+
export declare class Selection implements ISelection {
|
|
5
|
+
events: IEventSystem<SelectionEvents>;
|
|
6
|
+
config: ISelectionConfig;
|
|
7
|
+
private _selected;
|
|
8
|
+
private _data;
|
|
9
|
+
constructor(config: ISelectionConfig, data: DataCollection, events?: IEventSystem<any>);
|
|
10
|
+
getId(): Id;
|
|
11
|
+
getItem(): any;
|
|
12
|
+
remove(id?: Id): boolean;
|
|
13
|
+
add(id: Id): void;
|
|
14
|
+
enable(): void;
|
|
15
|
+
disable(): void;
|
|
16
|
+
private _addSingle;
|
|
17
|
+
}
|
|
@@ -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,41 @@
|
|
|
1
|
+
import { VNode } from "../../ts-common/dom";
|
|
2
|
+
import { List } from "../../ts-list";
|
|
3
|
+
import { Id, IHandlers } from "../../ts-common/types";
|
|
4
|
+
import { IDataViewConfig, IDataView } from "./types";
|
|
5
|
+
export declare class DataView extends List implements IDataView {
|
|
6
|
+
config: IDataViewConfig;
|
|
7
|
+
constructor(node: HTMLElement | string, config?: IDataViewConfig);
|
|
8
|
+
scrollTo(id: Id): void;
|
|
9
|
+
protected _scrollTo(id: Id, el: HTMLElement): void;
|
|
10
|
+
protected _didRedraw(vm: any): void;
|
|
11
|
+
protected _renderItem(item: any, index: number): VNode;
|
|
12
|
+
protected _renderList(): VNode;
|
|
13
|
+
protected _getHotkeys(): IHandlers;
|
|
14
|
+
protected getDataViewItemAriaAttrs(context: this, item: any): {
|
|
15
|
+
"aria-roledescription": string;
|
|
16
|
+
"aria-grabbed": string;
|
|
17
|
+
role: string;
|
|
18
|
+
"aria-selected": string;
|
|
19
|
+
} | {
|
|
20
|
+
"aria-roledescription"?: undefined;
|
|
21
|
+
"aria-grabbed": string;
|
|
22
|
+
role: string;
|
|
23
|
+
"aria-selected": string;
|
|
24
|
+
} | {
|
|
25
|
+
"aria-roledescription": string;
|
|
26
|
+
"aria-grabbed"?: undefined;
|
|
27
|
+
role: string;
|
|
28
|
+
"aria-selected": string;
|
|
29
|
+
} | {
|
|
30
|
+
"aria-roledescription"?: undefined;
|
|
31
|
+
"aria-grabbed"?: undefined;
|
|
32
|
+
role: string;
|
|
33
|
+
"aria-selected": string;
|
|
34
|
+
};
|
|
35
|
+
protected getDataViewAriaAttrs(config: any, itemsCount: any, rowsCount: any, itemsInRow: any): {
|
|
36
|
+
role: string;
|
|
37
|
+
"aria-label": string;
|
|
38
|
+
"aria-multiselectable": string;
|
|
39
|
+
"aria-readonly": string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScrollView } from "../../ts-common/ScrollView";
|
|
2
|
+
import { IProDataView, IDataViewConfig } from "./types";
|
|
3
|
+
import { DataView } from "./DataView";
|
|
4
|
+
import { VNode } from "../../ts-common/dom";
|
|
5
|
+
export declare class ProDataView extends DataView implements IProDataView {
|
|
6
|
+
scrollView: ScrollView;
|
|
7
|
+
constructor(node: HTMLElement | string, config?: IDataViewConfig);
|
|
8
|
+
destructor(): void;
|
|
9
|
+
scrollTo(id: string): void;
|
|
10
|
+
protected _renderList(): VNode;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDataViewConfig, IDataViewItem } from "../types";
|
|
2
|
+
import { DataView } from "../DataView";
|
|
3
|
+
export declare class InputEditor {
|
|
4
|
+
protected _handlers: {
|
|
5
|
+
[key: string]: (...args: any[]) => void;
|
|
6
|
+
};
|
|
7
|
+
protected _mode: boolean;
|
|
8
|
+
protected _config: IDataViewConfig;
|
|
9
|
+
protected _dataView: DataView;
|
|
10
|
+
protected _item: IDataViewItem;
|
|
11
|
+
protected _input: HTMLInputElement;
|
|
12
|
+
constructor(item: IDataViewItem, dataView: DataView);
|
|
13
|
+
endEdit(): void;
|
|
14
|
+
toHTML(isLastItemInRow: boolean): any;
|
|
15
|
+
protected _initHandlers(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DataCollection, DataEvents, DragEvents, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap } from "../../ts-data";
|
|
2
|
+
import { IEventSystem } from "../../ts-common/events";
|
|
3
|
+
import { ISelection, MultiselectionMode, IListConfig, IListEventHandlersMap, ListEvents } from "../../ts-list";
|
|
4
|
+
import { ScrollView } from "../../ts-common/ScrollView";
|
|
5
|
+
import { Id } from "../../ts-common/types";
|
|
6
|
+
export interface IDataViewConfig extends IListConfig {
|
|
7
|
+
data?: DataCollection<any> | any[];
|
|
8
|
+
itemsInRow?: number;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
itemHeight?: number | string;
|
|
11
|
+
gap?: number;
|
|
12
|
+
template?: (item: any) => string;
|
|
13
|
+
keyNavigation?: boolean | (() => boolean);
|
|
14
|
+
css?: string;
|
|
15
|
+
selection?: boolean;
|
|
16
|
+
multiselection?: boolean | MultiselectionMode;
|
|
17
|
+
editable?: boolean;
|
|
18
|
+
eventHandlers?: {
|
|
19
|
+
[eventName: string]: {
|
|
20
|
+
[className: string]: (event: Event, id: Id) => void | boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
24
|
+
editing?: boolean;
|
|
25
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
26
|
+
multiselectionMode?: MultiselectionMode;
|
|
27
|
+
}
|
|
28
|
+
export interface IDataView<T extends IDataItem = any> {
|
|
29
|
+
config: IDataViewConfig;
|
|
30
|
+
data: DataCollection<T>;
|
|
31
|
+
events: IEventSystem<DataEvents | DragEvents | ListEvents, IDataEventsHandlersMap & IDragEventsHandlersMap & IListEventHandlersMap>;
|
|
32
|
+
selection: ISelection;
|
|
33
|
+
paint(): void;
|
|
34
|
+
destructor(): void;
|
|
35
|
+
editItem(id: Id): void;
|
|
36
|
+
getFocusItem(): T;
|
|
37
|
+
setFocus(id: Id): void;
|
|
38
|
+
resetFocus(): void;
|
|
39
|
+
getFocus(): Id;
|
|
40
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
41
|
+
disableSelection(): void;
|
|
42
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
43
|
+
enableSelection(): void;
|
|
44
|
+
}
|
|
45
|
+
export interface IProDataView extends IDataView {
|
|
46
|
+
scrollView: ScrollView;
|
|
47
|
+
}
|
|
48
|
+
export declare enum DataViewEvents {
|
|
49
|
+
click = "click",
|
|
50
|
+
doubleClick = "doubleclick",
|
|
51
|
+
focusChange = "focuschange",
|
|
52
|
+
beforeEditStart = "beforeEditStart",
|
|
53
|
+
afterEditStart = "afterEditStart",
|
|
54
|
+
beforeEditEnd = "beforeEditEnd",
|
|
55
|
+
afterEditEnd = "afterEditEnd",
|
|
56
|
+
itemRightClick = "itemRightClick",
|
|
57
|
+
itemMouseOver = "itemMouseOver",
|
|
58
|
+
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
|
|
59
|
+
contextmenu = "contextmenu"
|
|
60
|
+
}
|
|
61
|
+
export interface IDataViewItem {
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
@@ -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
|
+
}
|