dhx-chart 9.1.6 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/codebase/chart.min.js +3 -3
  2. package/codebase/chart.min.js.map +1 -1
  3. package/codebase/types/ts-common/date.d.ts +1 -0
  4. package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +11 -0
  5. package/codebase/types/ts-grid/sources/Grid.d.ts +6 -2
  6. package/codebase/types/ts-grid/sources/ProGrid.d.ts +9 -1
  7. package/codebase/types/ts-grid/sources/helpers/cells.d.ts +2 -0
  8. package/codebase/types/ts-grid/sources/helpers/data.d.ts +6 -2
  9. package/codebase/types/ts-grid/sources/helpers/default.d.ts +4 -1
  10. package/codebase/types/ts-grid/sources/helpers/keys.d.ts +19 -18
  11. package/codebase/types/ts-grid/sources/helpers/main.d.ts +6 -0
  12. package/codebase/types/ts-grid/sources/modules/BlockSelection.d.ts +120 -0
  13. package/codebase/types/ts-grid/sources/modules/Clipboard.d.ts +55 -0
  14. package/codebase/types/ts-grid/sources/modules/DropManager.d.ts +21 -0
  15. package/codebase/types/ts-grid/sources/{Exporter.d.ts → modules/Exporter.d.ts} +27 -14
  16. package/codebase/types/ts-grid/sources/modules/History.d.ts +72 -0
  17. package/codebase/types/ts-grid/sources/modules/Range.d.ts +71 -0
  18. package/codebase/types/ts-grid/sources/{columnsResizer.d.ts → modules/Resizer.d.ts} +1 -1
  19. package/codebase/types/ts-grid/sources/{Selection.d.ts → modules/Selection.d.ts} +8 -7
  20. package/codebase/types/ts-grid/sources/types.d.ts +44 -6
  21. package/codebase/types/ts-grid/sources/ui/FixedCols.d.ts +1 -1
  22. package/codebase/types/ts-grid/sources/ui/components/dragPanel.d.ts +3 -0
  23. package/codebase/types/ts-grid/sources/ui/{SubRows.d.ts → components/subRow.d.ts} +2 -2
  24. package/package.json +1 -1
  25. package/readme.txt +1 -1
  26. package/whatsnew.txt +3 -0
  27. /package/codebase/types/ts-grid/sources/ui/{group/panel.d.ts → components/groupPanel.d.ts} +0 -0
  28. /package/codebase/types/ts-grid/sources/ui/{Cells.d.ts → /321/201ells.d.ts"} +0 -0
@@ -6,6 +6,7 @@ export declare const locale: {
6
6
  cancel: string;
7
7
  };
8
8
  export declare function getFormattedDate(format: string, date: Date): string;
9
+ export declare function getExcelDate(date: Date): number;
9
10
  export declare function stringToDate(str: string, format: string, validate?: boolean): any;
10
11
  export declare class DateHelper {
11
12
  static nullTimestampDate: Date;
@@ -3,7 +3,15 @@ import { IDataCollection, IDataItem } from "../../ts-data";
3
3
  import { ScrollView } from "../../ts-common/ScrollView";
4
4
  import { Id } from "../../ts-common/types";
5
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";
6
10
  export declare class ExtendedGrid extends Grid implements IExtendedGrid {
11
+ range: IRange;
12
+ block: IBlockSelection;
13
+ clipboard: IClipboard;
14
+ history: IHistory;
7
15
  scrollView: ScrollView;
8
16
  config: IExtendedGridConfig;
9
17
  constructor(container: HTMLElement | string | null, config?: IExtendedGridConfig);
@@ -12,9 +20,12 @@ export declare class ExtendedGrid extends Grid implements IExtendedGrid {
12
20
  expandAll(): void;
13
21
  collapseAll(): void;
14
22
  getSubRow(id: Id): ISubViewCell | null;
23
+ destructor(): void;
15
24
  protected _createView(): any;
25
+ protected _dragInit(): void;
16
26
  protected _setHTMLEventHandlers(): void;
17
27
  protected _setEventHandlers(): void;
28
+ protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
18
29
  protected _setSort(): void;
19
30
  protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
20
31
  protected _prepareData(data: IDataItem[] | IDataCollection): IDataItem[] | IRow[];
@@ -3,8 +3,8 @@ import { IKeyManager } from "../../ts-common/KeyManager";
3
3
  import { Id, ITouchParam } from "../../ts-common/types";
4
4
  import { View } from "../../ts-common/view";
5
5
  import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap, TSortDir } from "../../ts-data";
6
- import { Exporter } from "./Exporter";
7
- import { ISelection } from "./Selection";
6
+ import { Exporter } from "./modules/Exporter";
7
+ import { ISelection } from "./modules/Selection";
8
8
  import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, IContentList, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, SortFunction, IHeaderFilter, IAdjustColumns, IDirection, IFooter, IHeader, INormalizeColumnsParams, ISummaryList, ISortingStates } from "./types";
9
9
  export declare class Grid extends View implements IGrid {
10
10
  version: string;
@@ -23,6 +23,7 @@ export declare class Grid extends View implements IGrid {
23
23
  protected _htmlEvents: any;
24
24
  protected _sortingStates: ISortingStates;
25
25
  protected _activeFilters: object;
26
+ protected _dropManager: any;
26
27
  private _filterData;
27
28
  private _hiddenFilters;
28
29
  private _commonSummary;
@@ -59,6 +60,7 @@ export declare class Grid extends View implements IGrid {
59
60
  by?: Id;
60
61
  };
61
62
  protected _createView(): any;
63
+ protected _dragInit(): void;
62
64
  protected _parseColumns(configChanged?: boolean): void;
63
65
  protected normalizeColumns({ config, columns, configChanged }: INormalizeColumnsParams): void;
64
66
  protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
@@ -67,6 +69,7 @@ export declare class Grid extends View implements IGrid {
67
69
  protected _getRowIndex(rowId: Id): number;
68
70
  protected _setHTMLEventHandlers(): void;
69
71
  protected _setEventHandlers(): void;
72
+ protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
70
73
  protected _addEmptyRow(): void;
71
74
  protected _sort(by: Id, sortAs?: SortFunction, smartSorting?: boolean): void;
72
75
  protected _setSort(): void;
@@ -80,6 +83,7 @@ export declare class Grid extends View implements IGrid {
80
83
  protected _adjustColumnsWidth({ rows, cols, adjust, }: IAdjustColumns): IColumnsWidth;
81
84
  protected _prepareColumnData(data: any, type: "header" | "footer"): IRow[];
82
85
  protected _dragStart(event: any): void;
86
+ protected _dragProcess(event: MouseEvent | TouchEvent, row: IRow, column?: ICol): void;
83
87
  protected _getRowGhost(ids: Id[]): HTMLDivElement;
84
88
  protected _initHooks(): {
85
89
  didMount: () => void;
@@ -5,7 +5,11 @@ import { IKeyManager } from "../../ts-common/KeyManager";
5
5
  import { IEventSystem } from "../../ts-common/events";
6
6
  import { Id } from "../../ts-common/types";
7
7
  import { DataEvents, DragEvents, IDataEventsHandlersMap, IDragEventsHandlersMap, IDataCollection, IDataItem, TSortDir } from "../../ts-data";
8
- import { ISelection } from "./Selection";
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";
9
13
  export declare class ProGrid implements IProGrid {
10
14
  config: IProGridConfig;
11
15
  scrollView: ScrollView;
@@ -16,6 +20,10 @@ export declare class ProGrid implements IProGrid {
16
20
  content: IContentList;
17
21
  keyManager: IKeyManager;
18
22
  export: any;
23
+ range: IRange;
24
+ block: IBlockSelection;
25
+ clipboard: IClipboard;
26
+ history: IHistory;
19
27
  constructor(container: HTMLElement | string | null, config?: IProGridConfig);
20
28
  paint(): void;
21
29
  destructor(): void;
@@ -5,3 +5,5 @@ export declare function getSpanHeight(rows: IRow[], span: ISpan): number;
5
5
  export declare function getReducedColspan(columns: ICol[], colId: Id, colspan: number): number;
6
6
  export declare function getReducedRowspan(initialRows: IRow[], currRows: IRow[], rowIndex: number, span: ISpan): number;
7
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;
@@ -1,5 +1,5 @@
1
1
  import { IContainerConfig } from "../../../ts-common/core";
2
- import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IScrollState, IRange, ISizes } from "./../types";
2
+ import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IScrollState, IVisibleRange, ISizes } from "./../types";
3
3
  export declare function getTotalRowHeight(row: IRow): number;
4
4
  export declare function normalizeArray(obj: any, name: string): void;
5
5
  export declare function measureTextHeight({ text, width, lineHeight, font, htmlEnable, }: {
@@ -10,7 +10,7 @@ export declare function measureTextHeight({ text, width, lineHeight, font, htmlE
10
10
  htmlEnable?: boolean;
11
11
  }): number;
12
12
  export declare function countColumns(config: IGridConfig, columns: ICol[]): number;
13
- export declare function calculateVisibleRange(viewPortSize: ISizes, scroll: IScrollState, config: IGridConfig, data: IRow[]): IRange;
13
+ export declare function calculateVisibleRange(viewPortSize: ISizes, scroll: IScrollState, config: IGridConfig, data: IRow[]): IVisibleRange;
14
14
  export declare function getUnique(arr: any[], name: string, multiselection: boolean, editorType: ICol["editorType"]): any[];
15
15
  export declare const getMaxRowHeight: ({ cols, row, config, }: {
16
16
  row: IRow;
@@ -29,3 +29,7 @@ export declare function getOptionValue(value: string, column: ICol): string;
29
29
  export declare function getValueForNumberColumn(col: ICol, value: any): any;
30
30
  export declare function getComboEditorValue(value: any, col: ICol, row: IRow): any;
31
31
  export declare function getEditorValue(value: any, options: TOption[]): any;
32
+ export declare function getReverseScrollState(grid: any): {
33
+ x: number;
34
+ y: number;
35
+ };
@@ -1,3 +1,6 @@
1
- import { IGroup, ISubRowConfig } from "../types";
1
+ import { IHistoryConfig } from "../modules/History";
2
+ import { IDragPanelConfig, IGroup, ISubRowConfig } from "../types";
2
3
  export declare const getGroupDefaultConfig: (config?: IGroup | boolean) => IGroup;
3
4
  export declare const defaultSubRowConfig: Omit<ISubRowConfig, "view">;
5
+ export declare const defaultDragPanelConfig: IDragPanelConfig;
6
+ export declare const defaultHistoryConfig: IHistoryConfig;
@@ -1,26 +1,27 @@
1
- import { IGrid, IDirection, IProGrid } from "../types";
2
- export declare function selectionMove(e: KeyboardEvent, grid: IGrid | IProGrid, dir: IDirection, range: number, toEnd?: boolean, ctrlUp?: boolean, shiftUp?: boolean): void;
3
1
  export declare function getKeysHandlers(grid: any): {
4
2
  enter: () => void;
5
3
  space: (e: any) => void;
6
4
  escape: () => void;
7
5
  tab: (e: any) => void;
6
+ delete: () => void;
8
7
  "shift+tab": (e: any) => void;
9
- arrowUp: (e: any) => void;
8
+ arrowUp: (event: any) => void;
9
+ "ctrl+z": () => void;
10
+ "ctrl+shift+z": () => void;
10
11
  "ctrl+enter": () => void;
11
- "ctrl+arrowUp": (e: any) => void;
12
- "shift+arrowUp": (e: any) => void;
13
- "ctrl+shift+arrowUp": (e: any) => void;
14
- arrowDown: (e: any) => void;
15
- "ctrl+arrowDown": (e: any) => void;
16
- "shift+arrowDown": (e: any) => void;
17
- "ctrl+shift+arrowDown": (e: any) => void;
18
- arrowRight: (e: any) => void;
19
- "ctrl+arrowRight": (e: any) => void;
20
- "shift+arrowRight": (e: any) => void;
21
- "ctrl+shift+arrowRight": (e: any) => void;
22
- arrowLeft: (e: any) => void;
23
- "ctrl+arrowLeft": (e: any) => void;
24
- "shift+arrowLeft": (e: any) => void;
25
- "ctrl+shift+arrowLeft": (e: any) => 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;
26
27
  };
@@ -1,5 +1,7 @@
1
1
  import { ICellCss, ICol, IFooter, IGridConfig, IGridTooltipConfig, IHeader, IRow, ISpan } from "../types";
2
2
  import { ITooltipConfig } from "../../../ts-message";
3
+ import { Id } from "../../../ts-common/types";
4
+ import { ITreeCollection } from "../../../ts-data";
3
5
  export declare function transpose(arr: any[][], transform?: any): any[][];
4
6
  export declare function getStyleByClass(cssClass: string, targetClass: string, def: ICellCss, container?: HTMLElement): ICellCss;
5
7
  export declare function removeHTMLTags(str: string): string;
@@ -15,3 +17,7 @@ export declare function isHtmlEnable(config: IGridConfig, col: ICol, content?: I
15
17
  export declare function getTotalWidth(columns: ICol[]): number;
16
18
  export declare function getTotalHeight(rows: IRow[]): number;
17
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,120 @@
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 _getAreaNode;
97
+ private _getStartCellNode;
98
+ private _getHandleAreaNode;
99
+ private _getHandleNode;
100
+ private _initConfig;
101
+ private _initHandlers;
102
+ private _blockSelectionValidate;
103
+ private _blockSelectionStart;
104
+ private _blockSelectionMove;
105
+ private _blockSelectionEnd;
106
+ private _updateSelectionBounds;
107
+ private _resetMoveState;
108
+ private _applyAreaSelection;
109
+ private _applyHandle;
110
+ private _getDragDirection;
111
+ private _calculateBounds;
112
+ private _isCellFixed;
113
+ private _getFixedItems;
114
+ private _isColumnFixed;
115
+ private _setHandlers;
116
+ private _removeHandlers;
117
+ private _getPageCoords;
118
+ private _cellHandler;
119
+ private _paint;
120
+ }
@@ -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
+ }
@@ -1,18 +1,29 @@
1
- import { ICsvExportConfig, IGrid, IXlsxExportConfig, ICellCss } from "./types";
2
- import { IPDFConfig, IPNGConfig, TExportType } from "../../ts-common/types";
1
+ import { ICsvExportConfig, IExportGridCell, IGrid, IXlsxExportConfig } from "../types";
2
+ import { IPDFConfig, IPNGConfig, TExportType } from "../../../ts-common/types";
3
3
  export interface IExportData {
4
- name: string;
5
- columns: Array<{
6
- width: number;
7
- }>;
8
- header: string[][];
9
- data: any[];
4
+ data: {
5
+ name: string;
6
+ cells: (IExportGridCell | undefined)[][];
7
+ cols: {
8
+ width: number;
9
+ }[];
10
+ rows: {
11
+ height: number;
12
+ }[];
13
+ merged: {
14
+ from: {
15
+ row: number;
16
+ column: number;
17
+ };
18
+ to: {
19
+ row: number;
20
+ column: number;
21
+ };
22
+ }[];
23
+ }[];
10
24
  styles: {
11
- cells: any[];
12
- css: {
13
- [key: string]: ICellCss;
14
- };
15
- };
25
+ [key: string]: string;
26
+ }[];
16
27
  }
17
28
  export interface IExporter {
18
29
  pdf: (config?: IPDFConfig) => void;
@@ -24,14 +35,16 @@ export declare class Exporter implements IExporter {
24
35
  private _name;
25
36
  private _version;
26
37
  private _view;
38
+ private _xlsxWorker;
27
39
  constructor(_name: string, _version: string, _view: IGrid);
28
40
  pdf(config?: IPDFConfig): void;
29
41
  png(config?: IPNGConfig): void;
30
- xlsx(config?: IXlsxExportConfig): IExportData;
42
+ xlsx(c?: IXlsxExportConfig): IExportData;
31
43
  csv(config?: ICsvExportConfig): string;
32
44
  private _export;
33
45
  private getFlatCSV;
34
46
  private _getCSV;
35
47
  protected _rawExport(config: IPNGConfig | IPDFConfig, mode: TExportType, view: any): void;
36
48
  private _getHash;
49
+ private _getXlsxWorker;
37
50
  }
@@ -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
+ }
@@ -0,0 +1,71 @@
1
+ import { IEventSystem } from "../../../ts-common/events";
2
+ import { Id } from "../../../ts-common/types";
3
+ import { ICell, IExtendedGrid, IProGrid } from "../types";
4
+ export interface IRangeSelection {
5
+ xStart?: Id;
6
+ xEnd?: Id;
7
+ yStart?: Id;
8
+ yEnd?: Id;
9
+ }
10
+ export interface IRangeCell {
11
+ x?: Id;
12
+ y?: Id;
13
+ }
14
+ export interface IRangeConfig {
15
+ disabled?: boolean;
16
+ }
17
+ export declare enum RangeEvents {
18
+ beforeSetRange = "beforeSetRange",
19
+ afterSetRange = "afterSetRange",
20
+ beforeResetRange = "beforeResetRange",
21
+ afterResetRange = "afterResetRange"
22
+ }
23
+ export interface IRangeEventsHandlersMap {
24
+ [key: string]: (...args: any[]) => any;
25
+ [RangeEvents.beforeSetRange]: (range: IRangeSelection) => boolean | void;
26
+ [RangeEvents.afterSetRange]: (range: IRangeSelection) => void;
27
+ [RangeEvents.beforeResetRange]: (range: IRangeSelection) => boolean | void;
28
+ [RangeEvents.afterResetRange]: (range: IRangeSelection) => void;
29
+ }
30
+ export interface IRange {
31
+ config: IRangeConfig;
32
+ events: IEventSystem<RangeEvents, IRangeEventsHandlersMap>;
33
+ setRange(range: IRangeSelection, join?: boolean): boolean;
34
+ resetRange(): boolean;
35
+ getRange(): IRangeSelection | null;
36
+ getRangedCells(): ICell[];
37
+ isRanged(cell: IRangeCell): boolean;
38
+ enable(): void;
39
+ disable(): void;
40
+ isDisabled(): boolean;
41
+ /**
42
+ * @private
43
+ * This method destroys the module
44
+ */
45
+ destructor(): void;
46
+ }
47
+ export declare class Range implements IRange {
48
+ config: IRangeConfig;
49
+ events: IEventSystem<RangeEvents, IRangeEventsHandlersMap>;
50
+ private _grid;
51
+ private _range;
52
+ private _cells;
53
+ private _xSet;
54
+ private _ySet;
55
+ private _disabled;
56
+ constructor(grid: IExtendedGrid | IProGrid);
57
+ setRange(range: IRangeSelection, join?: boolean): boolean;
58
+ resetRange(): boolean;
59
+ getRange(): IRangeSelection | null;
60
+ getRangedCells(): ICell[];
61
+ isRanged(cell: IRangeCell): boolean;
62
+ enable(): void;
63
+ disable(): void;
64
+ isDisabled(): boolean;
65
+ destructor(): void;
66
+ private _resetRange;
67
+ private _getColumnRange;
68
+ private _getRowRange;
69
+ private _isAllowedRange;
70
+ private _initHandlers;
71
+ }
@@ -1,2 +1,2 @@
1
- import { IGrid, IProGrid } from "./types";
1
+ import { IGrid, IProGrid } from "../types";
2
2
  export declare function startResize(grid: IGrid | IProGrid, column: string, ev: MouseEvent & TouchEvent, cb: any): void;
@@ -1,9 +1,11 @@
1
- import { VNode } from "../../ts-common/dom";
2
- import { IEventSystem } from "../../ts-common/events";
3
- import { ICell, IGrid, IRow, ICol, IProGrid } from "./types";
4
- import { Id } from "../../ts-common/types";
1
+ import { VNode } from "../../../ts-common/dom";
2
+ import { IEventSystem } from "../../../ts-common/events";
3
+ import { ICell, IGrid, IRow, ICol, ISelectionType, IProGrid } from "../types";
4
+ import { Id } from "../../../ts-common/types";
5
5
  export interface ISelectionConfig {
6
6
  disabled?: boolean;
7
+ type?: ISelectionType;
8
+ multiSelection?: boolean;
7
9
  }
8
10
  export interface ISelection {
9
11
  config?: ISelectionConfig;
@@ -13,6 +15,7 @@ export interface ISelection {
13
15
  removeCell(rowId?: Id, colId?: Id): void;
14
16
  disable(): void;
15
17
  enable(): void;
18
+ isSelectedCell(row: IRow | Id, column?: ICol | Id): boolean;
16
19
  toHTML(): VNode | VNode[];
17
20
  }
18
21
  export declare enum GridSelectionEvents {
@@ -35,8 +38,6 @@ export declare class Selection implements ISelection {
35
38
  private _gridId;
36
39
  private _selectedCell;
37
40
  private _selectedCells;
38
- private _type;
39
- private _multiselection;
40
41
  constructor(grid: IGrid | IProGrid, config?: ISelectionConfig, events?: IEventSystem<any>, gridId?: Id);
41
42
  setCell(row?: IRow | Id, col?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
42
43
  removeCell(rowId?: Id, colId?: Id): void;
@@ -45,6 +46,7 @@ export declare class Selection implements ISelection {
45
46
  disable(): void;
46
47
  enable(): void;
47
48
  toHTML(): VNode | VNode[];
49
+ isSelectedCell(row: IRow | Id, column?: ICol | Id): boolean;
48
50
  private _setCell;
49
51
  private _removeCell;
50
52
  private _removeCells;
@@ -53,5 +55,4 @@ export declare class Selection implements ISelection {
53
55
  private _isUnselected;
54
56
  private _findIndex;
55
57
  private _setBrowserFocus;
56
- private _getReverseScrollState;
57
58
  }