@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,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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IContainerConfig } from "../../../ts-common/core";
|
|
2
|
+
import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IScrollState, IVisibleRange, ISizes } from "./../types";
|
|
3
|
+
import { Id } from "../../../ts-common/types";
|
|
4
|
+
export declare function getTotalRowHeight(row: IRow): number;
|
|
5
|
+
export declare function normalizeArray(obj: any, name: string): void;
|
|
6
|
+
export declare function measureTextHeight({ text, width, lineHeight, font, htmlEnable, }: {
|
|
7
|
+
text?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
lineHeight?: number;
|
|
10
|
+
font?: string;
|
|
11
|
+
htmlEnable?: boolean;
|
|
12
|
+
}): number;
|
|
13
|
+
export declare function countColumns(config: IGridConfig, columns: ICol[]): number;
|
|
14
|
+
export declare function calculateVisibleRange(viewPortSize: ISizes, scroll: IScrollState, config: IGridConfig, data: IRow[]): IVisibleRange;
|
|
15
|
+
export declare function getNormalizeFilterData(arr: any[], name: Id, multiselection: boolean, editorType: ICol["editorType"]): any[];
|
|
16
|
+
export declare const getMaxRowHeight: ({ cols, row, config, }: {
|
|
17
|
+
row: IRow;
|
|
18
|
+
cols: ICol[];
|
|
19
|
+
config?: IContainerConfig;
|
|
20
|
+
}) => number;
|
|
21
|
+
export declare const getCalculatedRowHeight: (height: number, config?: {
|
|
22
|
+
rowHeight: number;
|
|
23
|
+
verticalOffset?: number;
|
|
24
|
+
}) => number;
|
|
25
|
+
export declare const getTreeCellWidthOffset: (row: IRow, toArrow?: boolean) => number;
|
|
26
|
+
export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config: IContainerConfig, target: AdjustTargetType) => IColumnsWidth;
|
|
27
|
+
export declare function applyPattern(value: string | number | boolean, col: ICol): string | number | boolean;
|
|
28
|
+
export declare function getEditorOptions(col: ICol, row?: IRow): TOption[];
|
|
29
|
+
export declare function getOptionValue(value: string, column: ICol): string;
|
|
30
|
+
export declare function getValueForNumberColumn(col: ICol, value: any): any;
|
|
31
|
+
export declare function getComboEditorValue(value: any, col: ICol, row: IRow): any;
|
|
32
|
+
export declare function getEditorValue(value: any, options: TOption[]): any;
|
|
33
|
+
export declare function getReverseScrollState(grid: any): {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IHistoryConfig } from "../modules/History";
|
|
2
|
+
import { IDragPanelConfig, IGroup, ISubRowConfig } from "../types";
|
|
3
|
+
export declare const getGroupDefaultConfig: (config?: IGroup | boolean) => IGroup;
|
|
4
|
+
export declare const defaultSubRowConfig: Omit<ISubRowConfig, "view">;
|
|
5
|
+
export declare const defaultDragPanelConfig: IDragPanelConfig;
|
|
6
|
+
export declare const defaultHistoryConfig: IHistoryConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function getKeysHandlers(grid: any): {
|
|
2
|
+
enter: () => void;
|
|
3
|
+
space: (e: any) => void;
|
|
4
|
+
escape: () => void;
|
|
5
|
+
tab: (e: any) => void;
|
|
6
|
+
delete: () => void;
|
|
7
|
+
"shift+tab": (e: any) => void;
|
|
8
|
+
arrowUp: (event: any) => void;
|
|
9
|
+
"ctrl+z": () => void;
|
|
10
|
+
"ctrl+shift+z": () => void;
|
|
11
|
+
"ctrl+enter": () => void;
|
|
12
|
+
"ctrl+arrowUp": (event: any) => void;
|
|
13
|
+
"shift+arrowUp": (event: any) => void;
|
|
14
|
+
"ctrl+shift+arrowUp": (event: any) => void;
|
|
15
|
+
arrowDown: (event: any) => void;
|
|
16
|
+
"ctrl+arrowDown": (event: any) => void;
|
|
17
|
+
"shift+arrowDown": (event: any) => void;
|
|
18
|
+
"ctrl+shift+arrowDown": (event: any) => void;
|
|
19
|
+
arrowRight: (event: any) => void;
|
|
20
|
+
"ctrl+arrowRight": (event: any) => void;
|
|
21
|
+
"shift+arrowRight": (event: any) => void;
|
|
22
|
+
"ctrl+shift+arrowRight": (event: any) => void;
|
|
23
|
+
arrowLeft: (event: any) => void;
|
|
24
|
+
"ctrl+arrowLeft": (event: any) => void;
|
|
25
|
+
"shift+arrowLeft": (event: any) => void;
|
|
26
|
+
"ctrl+shift+arrowLeft": (event: any) => void;
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ICellCss, ICol, IFooter, IGridConfig, IGridTooltipConfig, IHeader, IRow, ISpan } from "../types";
|
|
2
|
+
import { ITooltipConfig } from "../../../ts-message";
|
|
3
|
+
import { Id } from "../../../ts-common/types";
|
|
4
|
+
import { ITreeCollection } from "../../../ts-data";
|
|
5
|
+
export declare function transpose(arr: any[][], transform?: any): any[][];
|
|
6
|
+
export declare function getStyleByClass(cssClass: string, targetClass: string, def: ICellCss, container?: HTMLElement): ICellCss;
|
|
7
|
+
export declare function removeHTMLTags(str: string): string;
|
|
8
|
+
export declare function isCssSupport(property: string, value: string): boolean;
|
|
9
|
+
export declare function isRowEmpty(row: IRow): boolean;
|
|
10
|
+
export declare function isSortable(config: IGridConfig, col: ICol): boolean;
|
|
11
|
+
export declare function isAutoWidth(config: IGridConfig, col?: ICol): boolean;
|
|
12
|
+
export declare function showTooltip(value: any, config: ITooltipConfig): void;
|
|
13
|
+
export declare function isContentTooltip(config: IGridConfig, col: ICol, cell: any, type: "footer" | "header"): boolean;
|
|
14
|
+
export declare function getTooltipConfig(config: IGridConfig, col?: ICol, cell?: IHeader | IFooter | ISpan, type?: "footer" | "header"): IGridTooltipConfig;
|
|
15
|
+
export declare function isTooltip(config: IGridConfig, element: ICol | ISpan): boolean | IGridTooltipConfig;
|
|
16
|
+
export declare function isHtmlEnable(config: IGridConfig, col: ICol, content?: IHeader | IFooter): boolean;
|
|
17
|
+
export declare function getTotalWidth(columns: ICol[]): number;
|
|
18
|
+
export declare function getTotalHeight(rows: IRow[]): number;
|
|
19
|
+
export declare function scrollFixedColsAndRows(e: WheelEvent): void;
|
|
20
|
+
export declare function isWasmSupported(): boolean;
|
|
21
|
+
export declare function getLastChild(id: any, data: any, deep?: boolean): Id | null;
|
|
22
|
+
export declare function getClosestTop(id: Id, data: ITreeCollection): Id | null;
|
|
23
|
+
export declare function getClosestBottom(id: Id, data: ITreeCollection, ignore?: boolean): Id | null;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { VNode } from "../../../ts-common/dom";
|
|
2
|
+
import { ICell, IExtendedGrid, IProGrid } from "../types";
|
|
3
|
+
import { IEventSystem } from "../../../ts-common/events";
|
|
4
|
+
export type DragDirection = "up" | "down" | "right" | "left";
|
|
5
|
+
export type HandleAxis = "x" | "y" | "xy";
|
|
6
|
+
export type RangeMode = "range" | "manual";
|
|
7
|
+
export declare enum BlockSelectionEvents {
|
|
8
|
+
blockSelectionValidate = "blockSelectionValidate",
|
|
9
|
+
blockSelectionStart = "blockSelectionStart",
|
|
10
|
+
beforeBlockSelectionMove = "beforeBlockSelectionMove",
|
|
11
|
+
afterBlockSelectionMove = "afterBlockSelectionMove",
|
|
12
|
+
blockSelectionEnd = "blockSelectionEnd",
|
|
13
|
+
beforeBlockSelectionApply = "beforeBlockSelectionApply",
|
|
14
|
+
afterBlockSelectionApply = "afterBlockSelectionApply",
|
|
15
|
+
beforeBlockHandleApply = "beforeBlockHandleApply",
|
|
16
|
+
afterBlockHandleApply = "afterBlockHandleApply",
|
|
17
|
+
blockHandleMouseDown = "blockHandleMouseDown"
|
|
18
|
+
}
|
|
19
|
+
export interface IBlockSelectionEventsHandlersMap {
|
|
20
|
+
[key: string]: (...args: any[]) => any;
|
|
21
|
+
[BlockSelectionEvents.blockSelectionValidate]: (validateCell: ICell, handle: boolean, event: MouseEvent | TouchEvent) => boolean | void;
|
|
22
|
+
[BlockSelectionEvents.blockSelectionStart]: (startCell: ICell, endCell: ICell, handle: boolean, event: MouseEvent | TouchEvent) => void;
|
|
23
|
+
[BlockSelectionEvents.beforeBlockSelectionMove]: (startCell: ICell, nextCell: ICell, focusCell: ICell | null, dragDirection: DragDirection | null, event: MouseEvent | TouchEvent) => void;
|
|
24
|
+
[BlockSelectionEvents.afterBlockSelectionMove]: (startCell: ICell, endCell: ICell, focusCell: ICell | null, dragDirection: DragDirection | null, event: MouseEvent | TouchEvent) => void;
|
|
25
|
+
[BlockSelectionEvents.blockSelectionEnd]: (startCell: ICell, endCell: ICell, handle: boolean, event: MouseEvent | TouchEvent) => void;
|
|
26
|
+
[BlockSelectionEvents.beforeBlockSelectionApply]: (startCell: ICell, endCell: ICell, handle: boolean, event: MouseEvent | TouchEvent) => boolean | void;
|
|
27
|
+
[BlockSelectionEvents.afterBlockSelectionApply]: (startCell: ICell, endCell: ICell, handle: boolean, event: MouseEvent | TouchEvent) => void;
|
|
28
|
+
[BlockSelectionEvents.beforeBlockHandleApply]: (startCell: ICell, endCell: ICell, dragDirection: DragDirection | null, event: MouseEvent | TouchEvent) => boolean | void;
|
|
29
|
+
[BlockSelectionEvents.afterBlockHandleApply]: (startCell: ICell, endCell: ICell, dragDirection: DragDirection | null, event: MouseEvent | TouchEvent) => void;
|
|
30
|
+
[BlockSelectionEvents.blockHandleMouseDown]: (event: MouseEvent | TouchEvent) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface IHandleHandler {
|
|
33
|
+
cell: ICell;
|
|
34
|
+
array: ICell[];
|
|
35
|
+
range: ICell[];
|
|
36
|
+
dir: DragDirection;
|
|
37
|
+
index: number;
|
|
38
|
+
grid: IProGrid;
|
|
39
|
+
}
|
|
40
|
+
export interface IHandleHistory {
|
|
41
|
+
prev: any;
|
|
42
|
+
current: any;
|
|
43
|
+
}
|
|
44
|
+
export interface IHandleConfig {
|
|
45
|
+
allowAxis?: HandleAxis;
|
|
46
|
+
handler?: boolean | ((args: IHandleHandler) => IHandleHistory | void);
|
|
47
|
+
}
|
|
48
|
+
export interface IBlockSelectionConfig {
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
mode?: RangeMode;
|
|
51
|
+
handle?: boolean | IHandleConfig;
|
|
52
|
+
area?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface IBlockSelection {
|
|
55
|
+
config: IBlockSelectionConfig;
|
|
56
|
+
events: IEventSystem<BlockSelectionEvents, IBlockSelectionEventsHandlersMap>;
|
|
57
|
+
enable(): void;
|
|
58
|
+
disable(): void;
|
|
59
|
+
isDisabled(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
* This method destroys the module
|
|
63
|
+
*/
|
|
64
|
+
destructor(): void;
|
|
65
|
+
/**
|
|
66
|
+
* @private
|
|
67
|
+
* This method is for internal use and should not be called directly
|
|
68
|
+
*/
|
|
69
|
+
toHTML(): VNode | VNode[];
|
|
70
|
+
}
|
|
71
|
+
export declare class BlockSelection implements IBlockSelection {
|
|
72
|
+
config: IBlockSelectionConfig;
|
|
73
|
+
events: IEventSystem<BlockSelectionEvents, IBlockSelectionEventsHandlersMap>;
|
|
74
|
+
private _grid;
|
|
75
|
+
private _startCell;
|
|
76
|
+
private _endCell;
|
|
77
|
+
private _focusStartCell;
|
|
78
|
+
private _focusEndCell;
|
|
79
|
+
private _selectionBounds;
|
|
80
|
+
private _startCellRect;
|
|
81
|
+
private _endCellRect;
|
|
82
|
+
private _focusCellRect;
|
|
83
|
+
private _startPoint;
|
|
84
|
+
private _dragDirection;
|
|
85
|
+
private _disabled;
|
|
86
|
+
private _isHandleActive;
|
|
87
|
+
private _handlers;
|
|
88
|
+
private readonly HANDLE_OFFSET;
|
|
89
|
+
private readonly MOVE_THRESHOLD;
|
|
90
|
+
constructor(grid: IProGrid | IExtendedGrid);
|
|
91
|
+
enable(): void;
|
|
92
|
+
disable(): void;
|
|
93
|
+
isDisabled(): boolean;
|
|
94
|
+
destructor(): void;
|
|
95
|
+
toHTML(): VNode | null;
|
|
96
|
+
private _calculateClippedGeometry;
|
|
97
|
+
private _getAreaNode;
|
|
98
|
+
private _getStartCellNode;
|
|
99
|
+
private _getHandleAreaNode;
|
|
100
|
+
private _getHandleNode;
|
|
101
|
+
private _initConfig;
|
|
102
|
+
private _initHandlers;
|
|
103
|
+
private _blockSelectionValidate;
|
|
104
|
+
private _blockSelectionStart;
|
|
105
|
+
private _blockSelectionMove;
|
|
106
|
+
private _blockSelectionEnd;
|
|
107
|
+
private _updateSelectionBounds;
|
|
108
|
+
private _resetMoveState;
|
|
109
|
+
private _applyAreaSelection;
|
|
110
|
+
private _applyHandle;
|
|
111
|
+
private _getDragDirection;
|
|
112
|
+
private _calculateBounds;
|
|
113
|
+
private _isCellFixed;
|
|
114
|
+
private _getFixedItems;
|
|
115
|
+
private _isColumnFixed;
|
|
116
|
+
private _setHandlers;
|
|
117
|
+
private _removeHandlers;
|
|
118
|
+
private _getPageCoords;
|
|
119
|
+
private _cellHandler;
|
|
120
|
+
private _getSourceCellIndex;
|
|
121
|
+
private _paint;
|
|
122
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IEventSystem } from "../../../ts-common/events";
|
|
2
|
+
import { ICell } from "../types";
|
|
3
|
+
export declare enum ClipboardEvents {
|
|
4
|
+
beforeCopy = "beforeCopy",
|
|
5
|
+
afterCopy = "afterCopy",
|
|
6
|
+
copyError = "copyError",
|
|
7
|
+
beforePaste = "beforePaste",
|
|
8
|
+
afterPaste = "afterPaste",
|
|
9
|
+
pasteError = "pasteError"
|
|
10
|
+
}
|
|
11
|
+
export interface IClipboardEventsHandlersMap {
|
|
12
|
+
[key: string]: (...args: any[]) => any;
|
|
13
|
+
[ClipboardEvents.beforeCopy]: (isCut: boolean) => boolean | void;
|
|
14
|
+
[ClipboardEvents.afterCopy]: (isCut: boolean) => void;
|
|
15
|
+
[ClipboardEvents.copyError]: (error: string) => void;
|
|
16
|
+
[ClipboardEvents.beforePaste]: () => boolean | void;
|
|
17
|
+
[ClipboardEvents.afterPaste]: () => void;
|
|
18
|
+
[ClipboardEvents.pasteError]: (error: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface IClipboardConfig {
|
|
21
|
+
copyModifier?: (value: any, cell: ICell, cut: boolean) => string;
|
|
22
|
+
cutModifier?: (value: any, cell: ICell) => string;
|
|
23
|
+
pasteModifier?: (value: any, cell: ICell) => any;
|
|
24
|
+
}
|
|
25
|
+
export interface IClipboard {
|
|
26
|
+
config: IClipboardConfig;
|
|
27
|
+
events: IEventSystem<ClipboardEvents, IClipboardEventsHandlersMap>;
|
|
28
|
+
copy(event?: ClipboardEvent): void;
|
|
29
|
+
paste(event?: ClipboardEvent): void;
|
|
30
|
+
cut(event?: ClipboardEvent): void;
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* This method destroys the module
|
|
34
|
+
*/
|
|
35
|
+
destructor(): void;
|
|
36
|
+
}
|
|
37
|
+
export declare class Clipboard implements IClipboard {
|
|
38
|
+
config: IClipboardConfig;
|
|
39
|
+
events: IEventSystem<ClipboardEvents, IClipboardEventsHandlersMap>;
|
|
40
|
+
private _grid;
|
|
41
|
+
private _handler;
|
|
42
|
+
constructor(grid: any);
|
|
43
|
+
copy(event?: ClipboardEvent): void;
|
|
44
|
+
cut(event?: ClipboardEvent): void;
|
|
45
|
+
paste(event?: ClipboardEvent): void;
|
|
46
|
+
destructor(): void;
|
|
47
|
+
private _prepareClipboardData;
|
|
48
|
+
private _initHandlers;
|
|
49
|
+
private _isFocused;
|
|
50
|
+
private _getNextId;
|
|
51
|
+
private _processPaste;
|
|
52
|
+
private _clearCells;
|
|
53
|
+
private _setFocus;
|
|
54
|
+
private _paint;
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VNode } from "../../../ts-common/dom";
|
|
2
|
+
export declare class DropManager {
|
|
3
|
+
private _isTreeMode;
|
|
4
|
+
private _grid;
|
|
5
|
+
private _dragState;
|
|
6
|
+
private _dragType;
|
|
7
|
+
constructor({ view }: {
|
|
8
|
+
view: any;
|
|
9
|
+
});
|
|
10
|
+
toHTML(state?: any): VNode;
|
|
11
|
+
private _getDropLineNode;
|
|
12
|
+
private _getVerticalDropLine;
|
|
13
|
+
private _getHorizontalDropLine;
|
|
14
|
+
private _init;
|
|
15
|
+
private _getNextRow;
|
|
16
|
+
private _isColumnFixed;
|
|
17
|
+
private _getTopPosition;
|
|
18
|
+
private _getBottomPosition;
|
|
19
|
+
private _toggleRowDraggable;
|
|
20
|
+
private _isSameComponent;
|
|
21
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { IExportGridCell, IGrid, IProGrid, IProGridConfig, TExportConfigFunction } from "../types";
|
|
2
|
+
import { ICsvDriverConfig } from "../../../ts-data";
|
|
3
|
+
import { IPDFConfig, IPNGConfig, TExportType } from "../../../ts-common/types";
|
|
4
|
+
export type ExportType = "pdf" | "png" | "csv" | "xlsx";
|
|
5
|
+
export interface IXlsxExportConfig {
|
|
6
|
+
url?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
tableName?: string;
|
|
9
|
+
dateFormatMask?: string;
|
|
10
|
+
mapToExcelFormulas?: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ICsvExportConfig extends ICsvDriverConfig {
|
|
15
|
+
name?: string;
|
|
16
|
+
asFile?: boolean;
|
|
17
|
+
flat?: boolean;
|
|
18
|
+
rowDelimiter?: string;
|
|
19
|
+
columnDelimiter?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IExportData {
|
|
22
|
+
data: {
|
|
23
|
+
name: string;
|
|
24
|
+
cells: (IExportGridCell | undefined)[][];
|
|
25
|
+
cols: {
|
|
26
|
+
width: number;
|
|
27
|
+
}[];
|
|
28
|
+
rows: {
|
|
29
|
+
height: number;
|
|
30
|
+
}[];
|
|
31
|
+
merged: {
|
|
32
|
+
from: {
|
|
33
|
+
row: number;
|
|
34
|
+
column: number;
|
|
35
|
+
};
|
|
36
|
+
to: {
|
|
37
|
+
row: number;
|
|
38
|
+
column: number;
|
|
39
|
+
};
|
|
40
|
+
}[];
|
|
41
|
+
}[];
|
|
42
|
+
styles: {
|
|
43
|
+
[key: string]: string;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export interface IExporter {
|
|
47
|
+
pdf: (config?: IPDFConfig) => Promise<void>;
|
|
48
|
+
png: (config?: IPNGConfig) => Promise<void>;
|
|
49
|
+
xlsx: (config?: IXlsxExportConfig) => Promise<IExportData>;
|
|
50
|
+
csv: (config?: ICsvExportConfig) => Promise<string>;
|
|
51
|
+
}
|
|
52
|
+
export interface IExportConfig extends IProGridConfig {
|
|
53
|
+
typeConfig?: IXlsxExportConfig | ICsvExportConfig | IPDFConfig | IPNGConfig;
|
|
54
|
+
}
|
|
55
|
+
export declare class Exporter implements IExporter {
|
|
56
|
+
private _xlsxWorker;
|
|
57
|
+
private _name;
|
|
58
|
+
private _version;
|
|
59
|
+
private _grid;
|
|
60
|
+
private _exportConfigCallback;
|
|
61
|
+
constructor(config: {
|
|
62
|
+
name: string;
|
|
63
|
+
version: string;
|
|
64
|
+
view: IProGrid | IGrid;
|
|
65
|
+
export: TExportConfigFunction | null;
|
|
66
|
+
});
|
|
67
|
+
pdf(typeConfig?: IPDFConfig): Promise<void>;
|
|
68
|
+
png(typeConfig?: IPNGConfig): Promise<void>;
|
|
69
|
+
xlsx(typeConfig?: IXlsxExportConfig): Promise<IExportData>;
|
|
70
|
+
csv(typeConfig?: ICsvExportConfig): Promise<string>;
|
|
71
|
+
private _getExportData;
|
|
72
|
+
private _xlsxExport;
|
|
73
|
+
private getFlatCSV;
|
|
74
|
+
private _getCSV;
|
|
75
|
+
protected _rawExport(typeConfig: IPNGConfig | IPDFConfig, mode: TExportType): Promise<void>;
|
|
76
|
+
private _getExportWidget;
|
|
77
|
+
private _getExportConfig;
|
|
78
|
+
private _getCallbackData;
|
|
79
|
+
private _getXlsxWorker;
|
|
80
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IEventSystem } from "../../../ts-common/events";
|
|
2
|
+
import { IExtendedGrid, IProGrid, IRow } from "../types";
|
|
3
|
+
export type ActionType = "add" | "remove" | "removeAll" | "change";
|
|
4
|
+
export interface IAction {
|
|
5
|
+
type: ActionType;
|
|
6
|
+
batch: IRow[];
|
|
7
|
+
inverse?: IAction;
|
|
8
|
+
timestamp?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare enum HistoryEvents {
|
|
11
|
+
beforeUndo = "beforeUndo",
|
|
12
|
+
afterUndo = "afterUndo",
|
|
13
|
+
beforeRedo = "beforeRedo",
|
|
14
|
+
afterRedo = "afterRedo",
|
|
15
|
+
beforeAdd = "beforeAdd",
|
|
16
|
+
afterAdd = "afterAdd",
|
|
17
|
+
error = "error"
|
|
18
|
+
}
|
|
19
|
+
export interface IHistoryEventsHandlersMap {
|
|
20
|
+
[key: string]: (...args: any[]) => any;
|
|
21
|
+
[HistoryEvents.beforeUndo]: (action: IAction) => boolean | void;
|
|
22
|
+
[HistoryEvents.afterUndo]: (action: IAction) => void;
|
|
23
|
+
[HistoryEvents.beforeRedo]: (action: IAction) => boolean | void;
|
|
24
|
+
[HistoryEvents.afterRedo]: (action: IAction) => void;
|
|
25
|
+
[HistoryEvents.beforeAdd]: (action: IAction) => boolean | void;
|
|
26
|
+
[HistoryEvents.afterAdd]: (action: IAction) => void;
|
|
27
|
+
[HistoryEvents.error]: (error: string, action: IAction | null) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface IHistoryConfig {
|
|
30
|
+
limit?: number;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface IHistory {
|
|
34
|
+
config: IHistoryConfig;
|
|
35
|
+
events: IEventSystem<HistoryEvents, IHistoryEventsHandlersMap>;
|
|
36
|
+
add(action: IAction): void;
|
|
37
|
+
remove(): void;
|
|
38
|
+
removeAll(): void;
|
|
39
|
+
undo(): void;
|
|
40
|
+
redo(): void;
|
|
41
|
+
canUndo(): boolean;
|
|
42
|
+
canRedo(): boolean;
|
|
43
|
+
getHistory(): IAction[];
|
|
44
|
+
disable(): void;
|
|
45
|
+
enable(): void;
|
|
46
|
+
isDisabled(): boolean;
|
|
47
|
+
destructor(): void;
|
|
48
|
+
}
|
|
49
|
+
export declare class History implements IHistory {
|
|
50
|
+
config: IHistoryConfig;
|
|
51
|
+
events: IEventSystem<HistoryEvents, IHistoryEventsHandlersMap>;
|
|
52
|
+
private _history;
|
|
53
|
+
private _redoStack;
|
|
54
|
+
private _isDisabled;
|
|
55
|
+
private static readonly VALID_ACTION_TYPES;
|
|
56
|
+
constructor(grid: IProGrid | IExtendedGrid);
|
|
57
|
+
add(action: IAction): void;
|
|
58
|
+
remove(): void;
|
|
59
|
+
removeAll(): void;
|
|
60
|
+
undo(): void;
|
|
61
|
+
redo(): void;
|
|
62
|
+
canUndo(): boolean;
|
|
63
|
+
canRedo(): boolean;
|
|
64
|
+
getHistory(): IAction[];
|
|
65
|
+
disable(): void;
|
|
66
|
+
enable(): void;
|
|
67
|
+
isDisabled(): boolean;
|
|
68
|
+
destructor(): void;
|
|
69
|
+
private _initConfig;
|
|
70
|
+
private _initHandlers;
|
|
71
|
+
private _fireError;
|
|
72
|
+
}
|