@deephaven/grid 0.7.3-beta.8 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CellInputField.d.ts +4 -4
- package/dist/CellInputField.d.ts.map +1 -1
- package/dist/CellInputField.js +10 -11
- package/dist/CellInputField.js.map +1 -1
- package/dist/EditableGridModel.d.ts +70 -0
- package/dist/EditableGridModel.d.ts.map +1 -0
- package/dist/EditableGridModel.js +13 -0
- package/dist/EditableGridModel.js.map +1 -0
- package/dist/EventHandlerResult.d.ts +17 -0
- package/dist/EventHandlerResult.d.ts.map +1 -0
- package/dist/EventHandlerResult.js +2 -0
- package/dist/EventHandlerResult.js.map +1 -0
- package/dist/ExpandableGridModel.d.ts +34 -0
- package/dist/ExpandableGridModel.d.ts.map +1 -0
- package/dist/ExpandableGridModel.js +7 -0
- package/dist/ExpandableGridModel.js.map +1 -0
- package/dist/Grid.d.ts +283 -234
- package/dist/Grid.d.ts.map +1 -1
- package/dist/Grid.js +397 -165
- package/dist/Grid.js.map +1 -1
- package/dist/GridColorUtils.d.ts +22 -12
- package/dist/GridColorUtils.d.ts.map +1 -1
- package/dist/GridColorUtils.js +26 -21
- package/dist/GridColorUtils.js.map +1 -1
- package/dist/GridMetricCalculator.d.ts.map +1 -1
- package/dist/GridMetricCalculator.js +8 -4
- package/dist/GridMetricCalculator.js.map +1 -1
- package/dist/GridModel.d.ts +54 -60
- package/dist/GridModel.d.ts.map +1 -1
- package/dist/GridModel.js +54 -122
- package/dist/GridModel.js.map +1 -1
- package/dist/GridMouseHandler.d.ts +23 -24
- package/dist/GridMouseHandler.d.ts.map +1 -1
- package/dist/GridMouseHandler.js +8 -14
- package/dist/GridMouseHandler.js.map +1 -1
- package/dist/GridRange.d.ts +2 -2
- package/dist/GridRange.d.ts.map +1 -1
- package/dist/GridRange.js +1 -1
- package/dist/GridRange.js.map +1 -1
- package/dist/GridRenderer.d.ts +117 -69
- package/dist/GridRenderer.d.ts.map +1 -1
- package/dist/GridRenderer.js +183 -168
- package/dist/GridRenderer.js.map +1 -1
- package/dist/GridUtils.d.ts +4 -4
- package/dist/GridUtils.js +4 -4
- package/dist/GridUtils.js.map +1 -1
- package/dist/KeyHandler.d.ts +10 -7
- package/dist/KeyHandler.d.ts.map +1 -1
- package/dist/KeyHandler.js +6 -5
- package/dist/KeyHandler.js.map +1 -1
- package/dist/MockGridData.d.ts +1 -1
- package/dist/MockGridData.d.ts.map +1 -1
- package/dist/MockGridData.js.map +1 -1
- package/dist/MockGridModel.d.ts +39 -12
- package/dist/MockGridModel.d.ts.map +1 -1
- package/dist/MockGridModel.js +43 -10
- package/dist/MockGridModel.js.map +1 -1
- package/dist/MockTreeGridModel.d.ts +37 -22
- package/dist/MockTreeGridModel.d.ts.map +1 -1
- package/dist/MockTreeGridModel.js +38 -20
- package/dist/MockTreeGridModel.js.map +1 -1
- package/dist/errors/AssertionError.d.ts +5 -0
- package/dist/errors/AssertionError.d.ts.map +1 -0
- package/dist/errors/AssertionError.js +12 -0
- package/dist/errors/AssertionError.js.map +1 -0
- package/dist/errors/PasteError.d.ts +1 -1
- package/dist/errors/PasteError.d.ts.map +1 -1
- package/dist/errors/PasteError.js +1 -2
- package/dist/errors/PasteError.js.map +1 -1
- package/dist/errors/assertIsDefined.d.ts +3 -0
- package/dist/errors/assertIsDefined.d.ts.map +1 -0
- package/dist/errors/assertIsDefined.js +8 -0
- package/dist/errors/assertIsDefined.js.map +1 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +2 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/key-handlers/EditKeyHandler.d.ts +3 -2
- package/dist/key-handlers/EditKeyHandler.d.ts.map +1 -1
- package/dist/key-handlers/EditKeyHandler.js +10 -9
- package/dist/key-handlers/EditKeyHandler.js.map +1 -1
- package/dist/key-handlers/PasteKeyHandler.d.ts +3 -5
- package/dist/key-handlers/PasteKeyHandler.d.ts.map +1 -1
- package/dist/key-handlers/PasteKeyHandler.js +3 -3
- package/dist/key-handlers/PasteKeyHandler.js.map +1 -1
- package/dist/key-handlers/SelectionKeyHandler.d.ts +5 -5
- package/dist/key-handlers/SelectionKeyHandler.d.ts.map +1 -1
- package/dist/key-handlers/SelectionKeyHandler.js +16 -15
- package/dist/key-handlers/SelectionKeyHandler.js.map +1 -1
- package/dist/key-handlers/TreeKeyHandler.d.ts +2 -2
- package/dist/key-handlers/TreeKeyHandler.d.ts.map +1 -1
- package/dist/key-handlers/TreeKeyHandler.js +14 -12
- package/dist/key-handlers/TreeKeyHandler.js.map +1 -1
- package/dist/memoizeClear.d.ts +13 -3
- package/dist/memoizeClear.d.ts.map +1 -1
- package/dist/memoizeClear.js +7 -7
- package/dist/memoizeClear.js.map +1 -1
- package/dist/mouse-handlers/EditMouseHandler.d.ts +3 -4
- package/dist/mouse-handlers/EditMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/EditMouseHandler.js +3 -2
- package/dist/mouse-handlers/EditMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.d.ts +12 -5
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js +13 -10
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.d.ts +24 -3
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js +2 -1
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.d.ts +16 -6
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js +41 -37
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowMoveMouseHandler.d.ts +10 -3
- package/dist/mouse-handlers/GridRowMoveMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridRowMoveMouseHandler.js +14 -11
- package/dist/mouse-handlers/GridRowMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.d.ts +24 -3
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js +4 -3
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowTreeMouseHandler.d.ts +8 -3
- package/dist/mouse-handlers/GridRowTreeMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridRowTreeMouseHandler.js +12 -7
- package/dist/mouse-handlers/GridRowTreeMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.d.ts +9 -3
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js +2 -1
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSelectionMouseHandler.d.ts +15 -9
- package/dist/mouse-handlers/GridSelectionMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridSelectionMouseHandler.js +26 -16
- package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSeparatorMouseHandler.d.ts +46 -28
- package/dist/mouse-handlers/GridSeparatorMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js +57 -74
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.d.ts +16 -6
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js +41 -37
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/GridModel.d.ts
CHANGED
|
@@ -1,88 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+
import { EventTarget } from 'event-target-shim';
|
|
2
|
+
import { ModelIndex } from './GridMetrics';
|
|
3
|
+
import { GridColor, GridTheme, NullableGridColor } from './GridTheme';
|
|
2
4
|
/**
|
|
3
5
|
* Model for a Grid
|
|
4
6
|
* All of these methods should return very quickly, as they will be called many times in the render cycle.
|
|
5
7
|
* If data needs to be loaded asynchronously, return something immediately, then trigger an event for the table to refresh (Not yet implemented).
|
|
6
8
|
*/
|
|
7
|
-
declare class GridModel extends EventTarget
|
|
8
|
-
constructor();
|
|
9
|
+
declare abstract class GridModel extends EventTarget {
|
|
9
10
|
/** Count of rows in the grid */
|
|
10
|
-
get rowCount(): number;
|
|
11
|
+
abstract get rowCount(): number;
|
|
12
|
+
/** Count of columns in the grid */
|
|
13
|
+
abstract get columnCount(): number;
|
|
11
14
|
/** Count of rows that are frozen (or 'floating') at the top */
|
|
12
15
|
get floatingTopRowCount(): number;
|
|
13
16
|
/** Count of rows that are frozen at the bottom */
|
|
14
17
|
get floatingBottomRowCount(): number;
|
|
15
|
-
|
|
18
|
+
/** Count of columns that are frozen (or 'floating') at the left */
|
|
16
19
|
get floatingLeftColumnCount(): number;
|
|
20
|
+
/** Count of columns that are frozen (or 'floating') at the right */
|
|
17
21
|
get floatingRightColumnCount(): number;
|
|
18
|
-
get isEditable(): boolean;
|
|
19
|
-
textForCell(column: any, row: any): string;
|
|
20
|
-
textAlignForCell(column: any, row: any): string;
|
|
21
|
-
colorForCell(column: any, row: any, theme: any): any;
|
|
22
|
-
backgroundColorForCell(column: any, row: any, theme: any): null;
|
|
23
|
-
textForColumnHeader(column: any): string;
|
|
24
|
-
textForRowHeader(row: any): string;
|
|
25
|
-
textForRowFooter(row: any): string;
|
|
26
|
-
isEditableRange(range: any): boolean;
|
|
27
22
|
/**
|
|
28
|
-
*
|
|
23
|
+
* Get the text for the specified cell
|
|
24
|
+
* @param column Column to get the text for
|
|
25
|
+
* @param row Row to get the text for
|
|
26
|
+
* @returns Text for the specified cell
|
|
27
|
+
*/
|
|
28
|
+
abstract textForCell(column: ModelIndex, row: ModelIndex): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get the text alignment for the specified cell
|
|
31
|
+
* @param column Column to get the alignment for
|
|
32
|
+
* @param row Row to get the alignment for
|
|
33
|
+
* @returns Text alignment for the specified cell
|
|
29
34
|
*/
|
|
30
|
-
|
|
31
|
-
isRowMovable(row: any): boolean;
|
|
32
|
-
get hasExpandableRows(): boolean;
|
|
33
|
-
isRowExpandable(row: any): boolean;
|
|
34
|
-
isRowExpanded(row: any): boolean;
|
|
35
|
-
setRowExpanded(row: any, isExpanded: any): void;
|
|
36
|
-
depthForRow(row: any): number;
|
|
35
|
+
textAlignForCell(column: ModelIndex, row: ModelIndex): CanvasTextAlign;
|
|
37
36
|
/**
|
|
38
|
-
* Get the
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @
|
|
37
|
+
* Get the color for the text in the specified cell
|
|
38
|
+
* @param column Column to get the color for
|
|
39
|
+
* @param row Row to get the color for
|
|
40
|
+
* @param theme Theme applied to the grid
|
|
41
|
+
* @returns Color for the text in the cell
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
colorForCell(column: ModelIndex, row: ModelIndex, theme: GridTheme): GridColor;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
45
|
+
* Get the background color for the cell
|
|
46
|
+
* @param column Column to get the background color for
|
|
47
|
+
* @param row Row to get the background color for
|
|
48
|
+
* @param theme Theme applied to the grid
|
|
49
|
+
* @returns Background color for the cell
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
backgroundColorForCell(column: ModelIndex, row: ModelIndex, theme: GridTheme): NullableGridColor;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
* @param
|
|
55
|
-
* @
|
|
56
|
-
* @returns {Promise<void>} A promise that resolves successfully when the operation is complete, or rejects if there's an error
|
|
53
|
+
* Text for the column header
|
|
54
|
+
* @param column Column to get the header for
|
|
55
|
+
* @returns Text to put in the column header
|
|
57
56
|
*/
|
|
58
|
-
|
|
57
|
+
textForColumnHeader(column: ModelIndex): string;
|
|
59
58
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @param
|
|
62
|
-
*
|
|
63
|
-
* y: number,
|
|
64
|
-
* text: string,
|
|
65
|
-
* }[]} edits The edits to apply to the model
|
|
59
|
+
* Text for the row header
|
|
60
|
+
* @param row Row to get the header for
|
|
61
|
+
* @returns Text to put in the row header
|
|
66
62
|
*/
|
|
67
|
-
|
|
68
|
-
x: number;
|
|
69
|
-
y: number;
|
|
70
|
-
text: string;
|
|
71
|
-
}[]): Promise<void>;
|
|
63
|
+
textForRowHeader(row: ModelIndex): string;
|
|
72
64
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @param
|
|
75
|
-
* @
|
|
76
|
-
* @param {string} value The value to check if it's a valid value or not
|
|
77
|
-
* @returns {boolean} returns true if it's a valid value, false otherwise
|
|
65
|
+
* Text for the row footer
|
|
66
|
+
* @param row Row to get the footer for
|
|
67
|
+
* @returns Text to put in the row footer
|
|
78
68
|
*/
|
|
79
|
-
|
|
69
|
+
textForRowFooter(row: ModelIndex): string;
|
|
80
70
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @
|
|
83
|
-
* @returns {unknown} The result of the delete
|
|
71
|
+
* @param column Column to check
|
|
72
|
+
* @returns True if the column is movable
|
|
84
73
|
*/
|
|
85
|
-
|
|
74
|
+
isColumnMovable(column: ModelIndex): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @param row Row to check
|
|
77
|
+
* @returns True if the row is movable
|
|
78
|
+
*/
|
|
79
|
+
isRowMovable(row: ModelIndex): boolean;
|
|
86
80
|
}
|
|
87
|
-
|
|
81
|
+
export default GridModel;
|
|
88
82
|
//# sourceMappingURL=GridModel.d.ts.map
|
package/dist/GridModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridModel.d.ts","sourceRoot":"","sources":["../src/GridModel.
|
|
1
|
+
{"version":3,"file":"GridModel.d.ts","sourceRoot":"","sources":["../src/GridModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAItE;;;;GAIG;AACH,uBAAe,SAAU,SAAQ,WAAW;IAC1C,gCAAgC;IAChC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC;IAEhC,mCAAmC;IACnC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC;IAEnC,+DAA+D;IAC/D,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED,kDAAkD;IAClD,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,mEAAmE;IACnE,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED,oEAAoE;IACpE,IAAI,wBAAwB,IAAI,MAAM,CAErC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM;IAEjE;;;;;OAKG;IACH,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,eAAe;IAItE;;;;;;OAMG;IACH,YAAY,CACV,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,SAAS,GACf,SAAS;IAIZ;;;;;;OAMG;IACH,sBAAsB,CACpB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,SAAS,GACf,iBAAiB;IAIpB;;;;OAIG;IACH,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IAI/C;;;;OAIG;IACH,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM;IAIzC;;;;OAIG;IACH,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM;IAIzC;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO;IAI5C;;;OAGG;IACH,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO;CAGvC;AAED,eAAe,SAAS,CAAC"}
|
package/dist/GridModel.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
-
|
|
3
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
-
|
|
5
1
|
import { EventTarget } from 'event-target-shim';
|
|
2
|
+
|
|
6
3
|
/* eslint class-methods-use-this: "off" */
|
|
7
4
|
|
|
8
5
|
/* eslint no-unused-vars: "off" */
|
|
@@ -12,15 +9,12 @@ import { EventTarget } from 'event-target-shim';
|
|
|
12
9
|
* All of these methods should return very quickly, as they will be called many times in the render cycle.
|
|
13
10
|
* If data needs to be loaded asynchronously, return something immediately, then trigger an event for the table to refresh (Not yet implemented).
|
|
14
11
|
*/
|
|
15
|
-
|
|
16
12
|
class GridModel extends EventTarget {
|
|
17
13
|
/** Count of rows in the grid */
|
|
18
|
-
get rowCount() {
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
/** Count of rows that are frozen (or 'floating') at the top */
|
|
22
14
|
|
|
15
|
+
/** Count of columns in the grid */
|
|
23
16
|
|
|
17
|
+
/** Count of rows that are frozen (or 'floating') at the top */
|
|
24
18
|
get floatingTopRowCount() {
|
|
25
19
|
return 0;
|
|
26
20
|
}
|
|
@@ -30,168 +24,106 @@ class GridModel extends EventTarget {
|
|
|
30
24
|
get floatingBottomRowCount() {
|
|
31
25
|
return 0;
|
|
32
26
|
}
|
|
27
|
+
/** Count of columns that are frozen (or 'floating') at the left */
|
|
33
28
|
|
|
34
|
-
get columnCount() {
|
|
35
|
-
return 0;
|
|
36
|
-
}
|
|
37
29
|
|
|
38
30
|
get floatingLeftColumnCount() {
|
|
39
31
|
return 0;
|
|
40
32
|
}
|
|
33
|
+
/** Count of columns that are frozen (or 'floating') at the right */
|
|
34
|
+
|
|
41
35
|
|
|
42
36
|
get floatingRightColumnCount() {
|
|
43
37
|
return 0;
|
|
44
38
|
}
|
|
45
|
-
|
|
46
|
-
*
|
|
39
|
+
/**
|
|
40
|
+
* Get the text for the specified cell
|
|
41
|
+
* @param column Column to get the text for
|
|
42
|
+
* @param row Row to get the text for
|
|
43
|
+
* @returns Text for the specified cell
|
|
47
44
|
*/
|
|
48
45
|
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Get the text alignment for the specified cell
|
|
49
|
+
* @param column Column to get the alignment for
|
|
50
|
+
* @param row Row to get the alignment for
|
|
51
|
+
* @returns Text alignment for the specified cell
|
|
52
|
+
*/
|
|
58
53
|
textAlignForCell(column, row) {
|
|
59
54
|
return 'left';
|
|
60
55
|
}
|
|
61
|
-
|
|
62
|
-
colorForCell(column, row, theme) {
|
|
63
|
-
return theme.textColor;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
backgroundColorForCell(column, row, theme) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
textForColumnHeader(column) {
|
|
71
|
-
return '';
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
textForRowHeader(row) {
|
|
75
|
-
return '';
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
textForRowFooter(row) {
|
|
79
|
-
return '';
|
|
80
|
-
}
|
|
81
|
-
/*
|
|
82
|
-
* Check if a given range is editable
|
|
83
|
-
* @param {GridRange} range The range to check if it is editable
|
|
84
|
-
* @returns {boolean} True if the range is editable
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
isEditableRange(range) {
|
|
89
|
-
return this.isEditable;
|
|
90
|
-
}
|
|
91
56
|
/**
|
|
92
|
-
*
|
|
57
|
+
* Get the color for the text in the specified cell
|
|
58
|
+
* @param column Column to get the color for
|
|
59
|
+
* @param row Row to get the color for
|
|
60
|
+
* @param theme Theme applied to the grid
|
|
61
|
+
* @returns Color for the text in the cell
|
|
93
62
|
*/
|
|
94
63
|
|
|
95
64
|
|
|
96
|
-
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
isRowMovable(row) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
get hasExpandableRows() {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
isRowExpandable(row) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
isRowExpanded(row) {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
setRowExpanded(row, isExpanded) {}
|
|
117
|
-
|
|
118
|
-
depthForRow(row) {
|
|
119
|
-
return 0;
|
|
65
|
+
colorForCell(column, row, theme) {
|
|
66
|
+
return theme.textColor;
|
|
120
67
|
}
|
|
121
68
|
/**
|
|
122
|
-
* Get the
|
|
123
|
-
* @param
|
|
124
|
-
* @param
|
|
125
|
-
* @
|
|
69
|
+
* Get the background color for the cell
|
|
70
|
+
* @param column Column to get the background color for
|
|
71
|
+
* @param row Row to get the background color for
|
|
72
|
+
* @param theme Theme applied to the grid
|
|
73
|
+
* @returns Background color for the cell
|
|
126
74
|
*/
|
|
127
75
|
|
|
128
76
|
|
|
129
|
-
|
|
130
|
-
|
|
77
|
+
backgroundColorForCell(column, row, theme) {
|
|
78
|
+
return null;
|
|
131
79
|
}
|
|
132
80
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @param
|
|
135
|
-
* @
|
|
136
|
-
* @param {string} value The value to set
|
|
137
|
-
* @returns {Promise<void>} A promise that resolves successfully when the operation is complete, or rejects if there's an error
|
|
81
|
+
* Text for the column header
|
|
82
|
+
* @param column Column to get the header for
|
|
83
|
+
* @returns Text to put in the column header
|
|
138
84
|
*/
|
|
139
85
|
|
|
140
86
|
|
|
141
|
-
|
|
142
|
-
return
|
|
143
|
-
throw new Error('setValueForCell not implemented');
|
|
144
|
-
})();
|
|
87
|
+
textForColumnHeader(column) {
|
|
88
|
+
return '';
|
|
145
89
|
}
|
|
146
90
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @param
|
|
149
|
-
* @
|
|
150
|
-
* @returns {Promise<void>} A promise that resolves successfully when the operation is complete, or rejects if there's an error
|
|
91
|
+
* Text for the row header
|
|
92
|
+
* @param row Row to get the header for
|
|
93
|
+
* @returns Text to put in the row header
|
|
151
94
|
*/
|
|
152
95
|
|
|
153
96
|
|
|
154
|
-
|
|
155
|
-
return
|
|
156
|
-
throw new Error('setValueForRanges not implemented');
|
|
157
|
-
})();
|
|
97
|
+
textForRowHeader(row) {
|
|
98
|
+
return '';
|
|
158
99
|
}
|
|
159
100
|
/**
|
|
160
|
-
*
|
|
161
|
-
* @param
|
|
162
|
-
*
|
|
163
|
-
* y: number,
|
|
164
|
-
* text: string,
|
|
165
|
-
* }[]} edits The edits to apply to the model
|
|
101
|
+
* Text for the row footer
|
|
102
|
+
* @param row Row to get the footer for
|
|
103
|
+
* @returns Text to put in the row footer
|
|
166
104
|
*/
|
|
167
105
|
|
|
168
106
|
|
|
169
|
-
|
|
170
|
-
return
|
|
171
|
-
throw new Error('setValues not implemented');
|
|
172
|
-
})();
|
|
107
|
+
textForRowFooter(row) {
|
|
108
|
+
return '';
|
|
173
109
|
}
|
|
174
110
|
/**
|
|
175
|
-
*
|
|
176
|
-
* @
|
|
177
|
-
* @param {number} y The row to check
|
|
178
|
-
* @param {string} value The value to check if it's a valid value or not
|
|
179
|
-
* @returns {boolean} returns true if it's a valid value, false otherwise
|
|
111
|
+
* @param column Column to check
|
|
112
|
+
* @returns True if the column is movable
|
|
180
113
|
*/
|
|
181
114
|
|
|
182
115
|
|
|
183
|
-
|
|
184
|
-
|
|
116
|
+
isColumnMovable(column) {
|
|
117
|
+
return true;
|
|
185
118
|
}
|
|
186
119
|
/**
|
|
187
|
-
*
|
|
188
|
-
* @
|
|
189
|
-
* @returns {unknown} The result of the delete
|
|
120
|
+
* @param row Row to check
|
|
121
|
+
* @returns True if the row is movable
|
|
190
122
|
*/
|
|
191
123
|
|
|
192
124
|
|
|
193
|
-
|
|
194
|
-
|
|
125
|
+
isRowMovable(row) {
|
|
126
|
+
return true;
|
|
195
127
|
}
|
|
196
128
|
|
|
197
129
|
}
|
package/dist/GridModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/GridModel.
|
|
1
|
+
{"version":3,"sources":["../src/GridModel.ts"],"names":["EventTarget","GridModel","floatingTopRowCount","floatingBottomRowCount","floatingLeftColumnCount","floatingRightColumnCount","textAlignForCell","column","row","colorForCell","theme","textColor","backgroundColorForCell","textForColumnHeader","textForRowHeader","textForRowFooter","isColumnMovable","isRowMovable"],"mappings":"AAAA,SAASA,WAAT,QAA4B,mBAA5B;;AAIA;;AACA;;AACA;AACA;AACA;AACA;AACA;AACA,MAAeC,SAAf,SAAiCD,WAAjC,CAA6C;AAC3C;;AAGA;;AAGA;AACuB,MAAnBE,mBAAmB,GAAW;AAChC,WAAO,CAAP;AACD;AAED;;;AAC0B,MAAtBC,sBAAsB,GAAW;AACnC,WAAO,CAAP;AACD;AAED;;;AAC2B,MAAvBC,uBAAuB,GAAW;AACpC,WAAO,CAAP;AACD;AAED;;;AAC4B,MAAxBC,wBAAwB,GAAW;AACrC,WAAO,CAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AAGE;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,gBAAgB,CAACC,MAAD,EAAqBC,GAArB,EAAuD;AACrE,WAAO,MAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACEC,EAAAA,YAAY,CACVF,MADU,EAEVC,GAFU,EAGVE,KAHU,EAIC;AACX,WAAOA,KAAK,CAACC,SAAb;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACEC,EAAAA,sBAAsB,CACpBL,MADoB,EAEpBC,GAFoB,EAGpBE,KAHoB,EAID;AACnB,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEG,EAAAA,mBAAmB,CAACN,MAAD,EAA6B;AAC9C,WAAO,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEO,EAAAA,gBAAgB,CAACN,GAAD,EAA0B;AACxC,WAAO,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEO,EAAAA,gBAAgB,CAACP,GAAD,EAA0B;AACxC,WAAO,EAAP;AACD;AAED;AACF;AACA;AACA;;;AACEQ,EAAAA,eAAe,CAACT,MAAD,EAA8B;AAC3C,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;;;AACEU,EAAAA,YAAY,CAACT,GAAD,EAA2B;AACrC,WAAO,IAAP;AACD;;AApH0C;;AAuH7C,eAAeP,SAAf","sourcesContent":["import { EventTarget } from 'event-target-shim';\nimport { ModelIndex } from './GridMetrics';\nimport { GridColor, GridTheme, NullableGridColor } from './GridTheme';\n\n/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n/**\n * Model for a Grid\n * All of these methods should return very quickly, as they will be called many times in the render cycle.\n * If data needs to be loaded asynchronously, return something immediately, then trigger an event for the table to refresh (Not yet implemented).\n */\nabstract class GridModel extends EventTarget {\n /** Count of rows in the grid */\n abstract get rowCount(): number;\n\n /** Count of columns in the grid */\n abstract get columnCount(): number;\n\n /** Count of rows that are frozen (or 'floating') at the top */\n get floatingTopRowCount(): number {\n return 0;\n }\n\n /** Count of rows that are frozen at the bottom */\n get floatingBottomRowCount(): number {\n return 0;\n }\n\n /** Count of columns that are frozen (or 'floating') at the left */\n get floatingLeftColumnCount(): number {\n return 0;\n }\n\n /** Count of columns that are frozen (or 'floating') at the right */\n get floatingRightColumnCount(): number {\n return 0;\n }\n\n /**\n * Get the text for the specified cell\n * @param column Column to get the text for\n * @param row Row to get the text for\n * @returns Text for the specified cell\n */\n abstract textForCell(column: ModelIndex, row: ModelIndex): string;\n\n /**\n * Get the text alignment for the specified cell\n * @param column Column to get the alignment for\n * @param row Row to get the alignment for\n * @returns Text alignment for the specified cell\n */\n textAlignForCell(column: ModelIndex, row: ModelIndex): CanvasTextAlign {\n return 'left';\n }\n\n /**\n * Get the color for the text in the specified cell\n * @param column Column to get the color for\n * @param row Row to get the color for\n * @param theme Theme applied to the grid\n * @returns Color for the text in the cell\n */\n colorForCell(\n column: ModelIndex,\n row: ModelIndex,\n theme: GridTheme\n ): GridColor {\n return theme.textColor;\n }\n\n /**\n * Get the background color for the cell\n * @param column Column to get the background color for\n * @param row Row to get the background color for\n * @param theme Theme applied to the grid\n * @returns Background color for the cell\n */\n backgroundColorForCell(\n column: ModelIndex,\n row: ModelIndex,\n theme: GridTheme\n ): NullableGridColor {\n return null;\n }\n\n /**\n * Text for the column header\n * @param column Column to get the header for\n * @returns Text to put in the column header\n */\n textForColumnHeader(column: ModelIndex): string {\n return '';\n }\n\n /**\n * Text for the row header\n * @param row Row to get the header for\n * @returns Text to put in the row header\n */\n textForRowHeader(row: ModelIndex): string {\n return '';\n }\n\n /**\n * Text for the row footer\n * @param row Row to get the footer for\n * @returns Text to put in the row footer\n */\n textForRowFooter(row: ModelIndex): string {\n return '';\n }\n\n /**\n * @param column Column to check\n * @returns True if the column is movable\n */\n isColumnMovable(column: ModelIndex): boolean {\n return true;\n }\n\n /**\n * @param row Row to check\n * @returns True if the row is movable\n */\n isRowMovable(row: ModelIndex): boolean {\n return true;\n }\n}\n\nexport default GridModel;\n"],"file":"GridModel.js"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EventHandlerResult } from './EventHandlerResult';
|
|
3
|
+
import Grid from './Grid';
|
|
4
|
+
import { GridPoint } from './GridUtils';
|
|
5
|
+
/**
|
|
6
|
+
* Some events we listen to are a native mouse event, and others are wrapped with React's SyntheticEvent.
|
|
7
|
+
* The GridMouseHandler shouldn't care though - the properties it accesses should be common on both types of events.
|
|
8
|
+
*/
|
|
9
|
+
export declare type GridMouseEvent = MouseEvent | React.MouseEvent;
|
|
10
|
+
export declare type GridMouseHandlerFunctionName = 'onDown' | 'onMove' | 'onDrag' | 'onLeave' | 'onClick' | 'onContextMenu' | 'onDoubleClick' | 'onUp' | 'onWheel';
|
|
2
11
|
/**
|
|
3
12
|
* Define a region in the grid that interacts with the mouse on a grid.
|
|
4
13
|
* Return true from any of the events to indicate they're consumed, and stopPropagation/preventDefault will be called.
|
|
5
14
|
*/
|
|
6
|
-
declare class GridMouseHandler {
|
|
7
|
-
static FUNCTION_NAMES: Readonly<{
|
|
8
|
-
DOWN: string;
|
|
9
|
-
MOVE: string;
|
|
10
|
-
DRAG: string;
|
|
11
|
-
LEAVE: string;
|
|
12
|
-
CLICK: string;
|
|
13
|
-
CONTEXT_MENU: string;
|
|
14
|
-
DOUBLE_CLICK: string;
|
|
15
|
-
UP: string;
|
|
16
|
-
WHEEL: string;
|
|
17
|
-
}>;
|
|
18
|
-
constructor(order?: number);
|
|
15
|
+
export declare class GridMouseHandler {
|
|
19
16
|
order: number;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
constructor(order?: number);
|
|
18
|
+
cursor: string | null;
|
|
19
|
+
onDown(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
20
|
+
onMove(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
21
|
+
onDrag(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
22
|
+
onLeave(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
23
|
+
onClick(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
24
|
+
onContextMenu(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
25
|
+
onDoubleClick(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
26
|
+
onUp(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
27
|
+
onWheel(gridPoint: GridPoint, grid: Grid, event: GridMouseEvent): EventHandlerResult;
|
|
30
28
|
}
|
|
29
|
+
export default GridMouseHandler;
|
|
31
30
|
//# sourceMappingURL=GridMouseHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridMouseHandler.d.ts","sourceRoot":"","sources":["../src/GridMouseHandler.
|
|
1
|
+
{"version":3,"file":"GridMouseHandler.d.ts","sourceRoot":"","sources":["../src/GridMouseHandler.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,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AS,EACpB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,cAAc,GACpB,kBAAkB;CAGtB;AAED,eAAe,gBAAgB,CAAC"}
|
package/dist/GridMouseHandler.js
CHANGED
|
@@ -4,16 +4,23 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
4
4
|
|
|
5
5
|
/* eslint no-unused-vars: "off" */
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Some events we listen to are a native mouse event, and others are wrapped with React's SyntheticEvent.
|
|
9
|
+
* The GridMouseHandler shouldn't care though - the properties it accesses should be common on both types of events.
|
|
10
|
+
*/
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* Define a region in the grid that interacts with the mouse on a grid.
|
|
9
14
|
* Return true from any of the events to indicate they're consumed, and stopPropagation/preventDefault will be called.
|
|
10
15
|
*/
|
|
11
|
-
class GridMouseHandler {
|
|
16
|
+
export class GridMouseHandler {
|
|
12
17
|
// What order this mouse handler should trigger in
|
|
13
18
|
// Default to well below any of the GRID mouse handlers 100-1000+
|
|
14
19
|
constructor() {
|
|
15
20
|
var order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
|
|
16
21
|
|
|
22
|
+
_defineProperty(this, "order", void 0);
|
|
23
|
+
|
|
17
24
|
_defineProperty(this, "cursor", null);
|
|
18
25
|
|
|
19
26
|
this.order = order;
|
|
@@ -57,18 +64,5 @@ class GridMouseHandler {
|
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
}
|
|
60
|
-
|
|
61
|
-
_defineProperty(GridMouseHandler, "FUNCTION_NAMES", Object.freeze({
|
|
62
|
-
DOWN: 'onDown',
|
|
63
|
-
MOVE: 'onMove',
|
|
64
|
-
DRAG: 'onDrag',
|
|
65
|
-
LEAVE: 'onLeave',
|
|
66
|
-
CLICK: 'onClick',
|
|
67
|
-
CONTEXT_MENU: 'onContextMenu',
|
|
68
|
-
DOUBLE_CLICK: 'onDoubleClick',
|
|
69
|
-
UP: 'onUp',
|
|
70
|
-
WHEEL: 'onWheel'
|
|
71
|
-
}));
|
|
72
|
-
|
|
73
67
|
export default GridMouseHandler;
|
|
74
68
|
//# sourceMappingURL=GridMouseHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/GridMouseHandler.
|
|
1
|
+
{"version":3,"sources":["../src/GridMouseHandler.ts"],"names":["GridMouseHandler","constructor","order","onDown","gridPoint","grid","event","onMove","onDrag","onLeave","onClick","onContextMenu","onDoubleClick","onUp","onWheel"],"mappings":";;AAAA;;AACA;;AAKA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAN,CAAuB;AAG5B;AACA;AACAC,EAAAA,WAAW,GAAe;AAAA,QAAdC,KAAc,uEAAN,IAAM;;AAAA;;AAAA,oCAKF,IALE;;AACxB,SAAKA,KAAL,GAAaA,KAAb;AACD,GAP2B,CAS5B;;;AAGAC,EAAAA,MAAM,CACJC,SADI,EAEJC,IAFI,EAGJC,KAHI,EAIgB;AACpB,WAAO,KAAP;AACD;;AAEDC,EAAAA,MAAM,CACJH,SADI,EAEJC,IAFI,EAGJC,KAHI,EAIgB;AACpB,WAAO,KAAP;AACD;;AAEDE,EAAAA,MAAM,CACJJ,SADI,EAEJC,IAFI,EAGJC,KAHI,EAIgB;AACpB,WAAO,KAAP;AACD;;AAEDG,EAAAA,OAAO,CACLL,SADK,EAELC,IAFK,EAGLC,KAHK,EAIe;AACpB,WAAO,KAAP;AACD;;AAEDI,EAAAA,OAAO,CACLN,SADK,EAELC,IAFK,EAGLC,KAHK,EAIe;AACpB,WAAO,KAAP;AACD;;AAEDK,EAAAA,aAAa,CACXP,SADW,EAEXC,IAFW,EAGXC,KAHW,EAIS;AACpB,WAAO,KAAP;AACD;;AAEDM,EAAAA,aAAa,CACXR,SADW,EAEXC,IAFW,EAGXC,KAHW,EAIS;AACpB,WAAO,KAAP;AACD;;AAEDO,EAAAA,IAAI,CACFT,SADE,EAEFC,IAFE,EAGFC,KAHE,EAIkB;AACpB,WAAO,KAAP;AACD;;AAEDQ,EAAAA,OAAO,CACLV,SADK,EAELC,IAFK,EAGLC,KAHK,EAIe;AACpB,WAAO,KAAP;AACD;;AAlF2B;AAqF9B,eAAeN,gBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport { EventHandlerResult } from './EventHandlerResult';\nimport Grid from './Grid';\nimport { GridPoint } from './GridUtils';\n\n/**\n * Some events we listen to are a native mouse event, and others are wrapped with React's SyntheticEvent.\n * The GridMouseHandler shouldn't care though - the properties it accesses should be common on both types of events.\n */\nexport type GridMouseEvent = MouseEvent | React.MouseEvent;\n\nexport type GridMouseHandlerFunctionName =\n | 'onDown'\n | 'onMove'\n | 'onDrag'\n | 'onLeave'\n | 'onClick'\n | 'onContextMenu'\n | 'onDoubleClick'\n | 'onUp'\n | 'onWheel';\n\n/**\n * Define a region in the grid that interacts with the mouse on a grid.\n * Return true from any of the events to indicate they're consumed, and stopPropagation/preventDefault will be called.\n */\nexport class GridMouseHandler {\n order: number;\n\n // What order this mouse handler should trigger in\n // Default to well below any of the GRID mouse handlers 100-1000+\n constructor(order = 5000) {\n this.order = order;\n }\n\n // Cursor to use if this returns true from any function\n cursor: string | null = null;\n\n onDown(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onMove(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onDrag(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onLeave(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onClick(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onContextMenu(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onDoubleClick(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onUp(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onWheel(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n}\n\nexport default GridMouseHandler;\n"],"file":"GridMouseHandler.js"}
|
package/dist/GridRange.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare enum SELECTION_DIRECTION {
|
|
|
19
19
|
LEFT = "LEFT",
|
|
20
20
|
RIGHT = "RIGHT"
|
|
21
21
|
}
|
|
22
|
-
declare class GridRange {
|
|
22
|
+
export declare class GridRange {
|
|
23
23
|
startColumn: GridRangeIndex;
|
|
24
24
|
startRow: GridRangeIndex;
|
|
25
25
|
endColumn: GridRangeIndex;
|
|
@@ -197,7 +197,7 @@ declare class GridRange {
|
|
|
197
197
|
* @param row The row index
|
|
198
198
|
* @returns True if the cell is within the provided ranges, false otherwise.
|
|
199
199
|
*/
|
|
200
|
-
static containsCell(ranges: GridRange[], column:
|
|
200
|
+
static containsCell(ranges: GridRange[], column: GridRangeIndex, row: GridRangeIndex): boolean;
|
|
201
201
|
/**
|
|
202
202
|
* Iterate through each cell in the provided ranges
|
|
203
203
|
* @param ranges The ranges to iterate through
|
package/dist/GridRange.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridRange.d.ts","sourceRoot":"","sources":["../src/GridRange.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC;AAC3C,aAAK,SAAS,GAAG,cAAc,CAAC;AAChC,aAAK,UAAU,GAAG,cAAc,CAAC;AACjC,aAAK,QAAQ,GAAG,cAAc,CAAC;AAC/B,aAAK,WAAW,GAAG,cAAc,CAAC;AAElC,oBA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