@deephaven/grid 0.4.1-modules.0 → 0.5.2-beta.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.js +88 -40
- package/dist/CellInputField.js.map +1 -1
- package/dist/Grid.js +1484 -1449
- package/dist/Grid.js.map +1 -1
- package/dist/GridColorUtils.js +51 -18
- package/dist/GridColorUtils.js.map +1 -1
- package/dist/GridMetricCalculator.js +994 -1017
- package/dist/GridMetricCalculator.js.map +1 -1
- package/dist/GridModel.js +286 -171
- package/dist/GridModel.js.map +1 -1
- package/dist/GridMouseHandler.js +59 -39
- package/dist/GridMouseHandler.js.map +1 -1
- package/dist/GridRange.js +630 -572
- package/dist/GridRange.js.map +1 -1
- package/dist/GridRenderer.d.ts.map +1 -1
- package/dist/GridRenderer.js +1564 -1650
- package/dist/GridRenderer.js.map +1 -1
- package/dist/GridTestUtils.js +29 -15
- package/dist/GridTestUtils.js.map +1 -1
- package/dist/GridUtils.js +717 -679
- package/dist/GridUtils.js.map +1 -1
- package/dist/KeyHandler.js +18 -6
- package/dist/KeyHandler.js.map +1 -1
- package/dist/MockGridModel.js +210 -105
- package/dist/MockGridModel.js.map +1 -1
- package/dist/MockTreeGridModel.js +183 -113
- package/dist/MockTreeGridModel.js.map +1 -1
- package/dist/errors/PasteError.js +44 -5
- package/dist/errors/PasteError.js.map +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/key-handlers/EditKeyHandler.js +75 -42
- package/dist/key-handlers/EditKeyHandler.js.map +1 -1
- package/dist/key-handlers/PasteKeyHandler.js +78 -42
- package/dist/key-handlers/PasteKeyHandler.js.map +1 -1
- package/dist/key-handlers/SelectionKeyHandler.js +234 -220
- package/dist/key-handlers/SelectionKeyHandler.js.map +1 -1
- package/dist/key-handlers/TreeKeyHandler.js +72 -42
- package/dist/key-handlers/TreeKeyHandler.js.map +1 -1
- package/dist/key-handlers/index.js +4 -4
- package/dist/key-handlers/index.js.map +1 -1
- package/dist/memoizeClear.js +1 -1
- package/dist/memoizeClear.js.map +1 -1
- package/dist/mouse-handlers/EditMouseHandler.js +50 -18
- package/dist/mouse-handlers/EditMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js +163 -141
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js +86 -47
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js +171 -143
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowMoveMouseHandler.js +147 -125
- package/dist/mouse-handlers/GridRowMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js +86 -47
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowTreeMouseHandler.js +76 -46
- package/dist/mouse-handlers/GridRowTreeMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js +62 -31
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSelectionMouseHandler.js +222 -200
- package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js +253 -206
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js +172 -144
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/index.js +10 -10
- package/dist/mouse-handlers/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -5
|
@@ -1,62 +1,92 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
+
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
|
+
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
+
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
16
|
+
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
|
|
1
23
|
/* eslint class-methods-use-this: "off" */
|
|
2
|
-
import GridMouseHandler from
|
|
24
|
+
import GridMouseHandler from '../GridMouseHandler';
|
|
3
25
|
/**
|
|
4
26
|
* Detect when the tree expand/collapse button is clicked
|
|
5
27
|
*/
|
|
6
28
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (column === firstColumn && row != null && visibleRowTreeBoxes.get(row) != null && x > gridX && y > gridY) {
|
|
30
|
-
var columnX = visibleColumnXs.get(column);
|
|
31
|
-
var width = visibleColumnWidths.get(column);
|
|
32
|
-
var rowY = visibleRowYs.get(row);
|
|
33
|
-
var height = visibleRowHeights.get(row);
|
|
34
|
-
|
|
35
|
-
if (x >= gridX + columnX && x <= gridX + columnX + width && y >= gridY + rowY && y <= gridY + rowY + height) {
|
|
29
|
+
var GridRowTreeMouseHandler = /*#__PURE__*/function (_GridMouseHandler) {
|
|
30
|
+
_inherits(GridRowTreeMouseHandler, _GridMouseHandler);
|
|
31
|
+
|
|
32
|
+
var _super = _createSuper(GridRowTreeMouseHandler);
|
|
33
|
+
|
|
34
|
+
function GridRowTreeMouseHandler() {
|
|
35
|
+
_classCallCheck(this, GridRowTreeMouseHandler);
|
|
36
|
+
|
|
37
|
+
return _super.apply(this, arguments);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_createClass(GridRowTreeMouseHandler, [{
|
|
41
|
+
key: "onDown",
|
|
42
|
+
value: function onDown(gridPoint, grid) {
|
|
43
|
+
return GridRowTreeMouseHandler.isInTreeBox(gridPoint, grid);
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
key: "onClick",
|
|
47
|
+
value: function onClick(gridPoint, grid) {
|
|
48
|
+
if (GridRowTreeMouseHandler.isInTreeBox(gridPoint, grid)) {
|
|
49
|
+
var row = gridPoint.row;
|
|
50
|
+
grid.toggleRowExpanded(row);
|
|
36
51
|
return true;
|
|
37
52
|
}
|
|
53
|
+
|
|
54
|
+
return false;
|
|
38
55
|
}
|
|
56
|
+
}], [{
|
|
57
|
+
key: "isInTreeBox",
|
|
58
|
+
value: function isInTreeBox(gridPoint, grid) {
|
|
59
|
+
var column = gridPoint.column,
|
|
60
|
+
row = gridPoint.row,
|
|
61
|
+
x = gridPoint.x,
|
|
62
|
+
y = gridPoint.y;
|
|
63
|
+
var metrics = grid.metrics;
|
|
64
|
+
var gridX = metrics.gridX,
|
|
65
|
+
gridY = metrics.gridY,
|
|
66
|
+
firstColumn = metrics.firstColumn,
|
|
67
|
+
visibleColumnXs = metrics.visibleColumnXs,
|
|
68
|
+
visibleColumnWidths = metrics.visibleColumnWidths,
|
|
69
|
+
visibleRowHeights = metrics.visibleRowHeights,
|
|
70
|
+
visibleRowYs = metrics.visibleRowYs,
|
|
71
|
+
visibleRowTreeBoxes = metrics.visibleRowTreeBoxes;
|
|
39
72
|
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
if (column === firstColumn && row != null && visibleRowTreeBoxes.get(row) != null && x > gridX && y > gridY) {
|
|
74
|
+
var columnX = visibleColumnXs.get(column);
|
|
75
|
+
var width = visibleColumnWidths.get(column);
|
|
76
|
+
var rowY = visibleRowYs.get(row);
|
|
77
|
+
var height = visibleRowHeights.get(row);
|
|
42
78
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
79
|
+
if (x >= gridX + columnX && x <= gridX + columnX + width && y >= gridY + rowY && y <= gridY + rowY + height) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
46
83
|
|
|
47
|
-
|
|
48
|
-
if (GridRowTreeMouseHandler.isInTreeBox(gridPoint, grid)) {
|
|
49
|
-
var {
|
|
50
|
-
row
|
|
51
|
-
} = gridPoint;
|
|
52
|
-
grid.toggleRowExpanded(row);
|
|
53
|
-
return true;
|
|
84
|
+
return false;
|
|
54
85
|
}
|
|
86
|
+
}]);
|
|
55
87
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
88
|
+
return GridRowTreeMouseHandler;
|
|
89
|
+
}(GridMouseHandler);
|
|
60
90
|
|
|
61
91
|
export default GridRowTreeMouseHandler;
|
|
62
92
|
//# sourceMappingURL=GridRowTreeMouseHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mouse-handlers/GridRowTreeMouseHandler.js"],"names":["GridMouseHandler","GridRowTreeMouseHandler","
|
|
1
|
+
{"version":3,"sources":["../../src/mouse-handlers/GridRowTreeMouseHandler.js"],"names":["GridMouseHandler","GridRowTreeMouseHandler","gridPoint","grid","isInTreeBox","row","toggleRowExpanded","column","x","y","metrics","gridX","gridY","firstColumn","visibleColumnXs","visibleColumnWidths","visibleRowHeights","visibleRowYs","visibleRowTreeBoxes","get","columnX","width","rowY","height"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,OAAOA,gBAAP,MAA6B,qBAA7B;AAEA;AACA;AACA;;IACMC,uB;;;;;;;;;;;;;WAsCJ,gBAAOC,SAAP,EAAkBC,IAAlB,EAAwB;AACtB,aAAOF,uBAAuB,CAACG,WAAxB,CAAoCF,SAApC,EAA+CC,IAA/C,CAAP;AACD;;;WAED,iBAAQD,SAAR,EAAmBC,IAAnB,EAAyB;AACvB,UAAIF,uBAAuB,CAACG,WAAxB,CAAoCF,SAApC,EAA+CC,IAA/C,CAAJ,EAA0D;AACxD,YAAQE,GAAR,GAAgBH,SAAhB,CAAQG,GAAR;AACAF,QAAAA,IAAI,CAACG,iBAAL,CAAuBD,GAAvB;AACA,eAAO,IAAP;AACD;;AACD,aAAO,KAAP;AACD;;;WAhDD,qBAAmBH,SAAnB,EAA8BC,IAA9B,EAAoC;AAClC,UAAQI,MAAR,GAA8BL,SAA9B,CAAQK,MAAR;AAAA,UAAgBF,GAAhB,GAA8BH,SAA9B,CAAgBG,GAAhB;AAAA,UAAqBG,CAArB,GAA8BN,SAA9B,CAAqBM,CAArB;AAAA,UAAwBC,CAAxB,GAA8BP,SAA9B,CAAwBO,CAAxB;AACA,UAAQC,OAAR,GAAoBP,IAApB,CAAQO,OAAR;AACA,UACEC,KADF,GASID,OATJ,CACEC,KADF;AAAA,UAEEC,KAFF,GASIF,OATJ,CAEEE,KAFF;AAAA,UAGEC,WAHF,GASIH,OATJ,CAGEG,WAHF;AAAA,UAIEC,eAJF,GASIJ,OATJ,CAIEI,eAJF;AAAA,UAKEC,mBALF,GASIL,OATJ,CAKEK,mBALF;AAAA,UAMEC,iBANF,GASIN,OATJ,CAMEM,iBANF;AAAA,UAOEC,YAPF,GASIP,OATJ,CAOEO,YAPF;AAAA,UAQEC,mBARF,GASIR,OATJ,CAQEQ,mBARF;;AAWA,UACEX,MAAM,KAAKM,WAAX,IACAR,GAAG,IAAI,IADP,IAEAa,mBAAmB,CAACC,GAApB,CAAwBd,GAAxB,KAAgC,IAFhC,IAGAG,CAAC,GAAGG,KAHJ,IAIAF,CAAC,GAAGG,KALN,EAME;AACA,YAAMQ,OAAO,GAAGN,eAAe,CAACK,GAAhB,CAAoBZ,MAApB,CAAhB;AACA,YAAMc,KAAK,GAAGN,mBAAmB,CAACI,GAApB,CAAwBZ,MAAxB,CAAd;AACA,YAAMe,IAAI,GAAGL,YAAY,CAACE,GAAb,CAAiBd,GAAjB,CAAb;AACA,YAAMkB,MAAM,GAAGP,iBAAiB,CAACG,GAAlB,CAAsBd,GAAtB,CAAf;;AACA,YACEG,CAAC,IAAIG,KAAK,GAAGS,OAAb,IACAZ,CAAC,IAAIG,KAAK,GAAGS,OAAR,GAAkBC,KADvB,IAEAZ,CAAC,IAAIG,KAAK,GAAGU,IAFb,IAGAb,CAAC,IAAIG,KAAK,GAAGU,IAAR,GAAeC,MAJtB,EAKE;AACA,iBAAO,IAAP;AACD;AACF;;AACD,aAAO,KAAP;AACD;;;;EApCmCvB,gB;;AAoDtC,eAAeC,uBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport GridMouseHandler from '../GridMouseHandler';\n\n/**\n * Detect when the tree expand/collapse button is clicked\n */\nclass GridRowTreeMouseHandler extends GridMouseHandler {\n static isInTreeBox(gridPoint, grid) {\n const { column, row, x, y } = gridPoint;\n const { metrics } = grid;\n const {\n gridX,\n gridY,\n firstColumn,\n visibleColumnXs,\n visibleColumnWidths,\n visibleRowHeights,\n visibleRowYs,\n visibleRowTreeBoxes,\n } = metrics;\n\n if (\n column === firstColumn &&\n row != null &&\n visibleRowTreeBoxes.get(row) != null &&\n x > gridX &&\n y > gridY\n ) {\n const columnX = visibleColumnXs.get(column);\n const width = visibleColumnWidths.get(column);\n const rowY = visibleRowYs.get(row);\n const height = visibleRowHeights.get(row);\n if (\n x >= gridX + columnX &&\n x <= gridX + columnX + width &&\n y >= gridY + rowY &&\n y <= gridY + rowY + height\n ) {\n return true;\n }\n }\n return false;\n }\n\n onDown(gridPoint, grid) {\n return GridRowTreeMouseHandler.isInTreeBox(gridPoint, grid);\n }\n\n onClick(gridPoint, grid) {\n if (GridRowTreeMouseHandler.isInTreeBox(gridPoint, grid)) {\n const { row } = gridPoint;\n grid.toggleRowExpanded(row);\n return true;\n }\n return false;\n }\n}\n\nexport default GridRowTreeMouseHandler;\n"],"file":"GridRowTreeMouseHandler.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridScrollBarCornerMouseHandler.d.ts","sourceRoot":"","sources":["../../src/mouse-handlers/GridScrollBarCornerMouseHandler.js"],"names":[],"mappings":";AAGA;;GAEG;AACH;IACE,+
|
|
1
|
+
{"version":3,"file":"GridScrollBarCornerMouseHandler.d.ts","sourceRoot":"","sources":["../../src/mouse-handlers/GridScrollBarCornerMouseHandler.js"],"names":[],"mappings":";AAGA;;GAEG;AACH;IACE,+CAeC;CAaF"}
|
|
@@ -1,44 +1,75 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
+
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
|
+
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
+
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
16
|
+
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
|
|
1
23
|
/* eslint class-methods-use-this: "off" */
|
|
2
|
-
import GridMouseHandler from
|
|
24
|
+
import GridMouseHandler from '../GridMouseHandler';
|
|
3
25
|
/**
|
|
4
26
|
* Used to eat the mouse event in the bottom right corner of the scroll bar
|
|
5
27
|
*/
|
|
6
28
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var theme = grid.getTheme();
|
|
10
|
-
var {
|
|
11
|
-
scrollBarSize
|
|
12
|
-
} = theme;
|
|
13
|
-
var {
|
|
14
|
-
metrics
|
|
15
|
-
} = grid;
|
|
16
|
-
var {
|
|
17
|
-
x,
|
|
18
|
-
y
|
|
19
|
-
} = gridPoint;
|
|
20
|
-
var {
|
|
21
|
-
lastLeft,
|
|
22
|
-
lastTop,
|
|
23
|
-
width,
|
|
24
|
-
height
|
|
25
|
-
} = metrics;
|
|
26
|
-
return scrollBarSize > 0 && (lastTop > 0 || lastLeft > 0) && x >= width - scrollBarSize && y >= height - scrollBarSize && x <= width && y <= height;
|
|
27
|
-
}
|
|
29
|
+
var GridScrollBarCornerMouseHandler = /*#__PURE__*/function (_GridMouseHandler) {
|
|
30
|
+
_inherits(GridScrollBarCornerMouseHandler, _GridMouseHandler);
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
return this.isInCorner(gridPoint, grid);
|
|
31
|
-
}
|
|
32
|
+
var _super = _createSuper(GridScrollBarCornerMouseHandler);
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
34
|
+
function GridScrollBarCornerMouseHandler() {
|
|
35
|
+
_classCallCheck(this, GridScrollBarCornerMouseHandler);
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
return this.isInCorner(gridPoint, grid);
|
|
37
|
+
return _super.apply(this, arguments);
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
_createClass(GridScrollBarCornerMouseHandler, [{
|
|
41
|
+
key: "isInCorner",
|
|
42
|
+
value: function isInCorner(gridPoint, grid) {
|
|
43
|
+
var theme = grid.getTheme();
|
|
44
|
+
var scrollBarSize = theme.scrollBarSize;
|
|
45
|
+
var metrics = grid.metrics;
|
|
46
|
+
var x = gridPoint.x,
|
|
47
|
+
y = gridPoint.y;
|
|
48
|
+
var lastLeft = metrics.lastLeft,
|
|
49
|
+
lastTop = metrics.lastTop,
|
|
50
|
+
width = metrics.width,
|
|
51
|
+
height = metrics.height;
|
|
52
|
+
return scrollBarSize > 0 && lastTop > 0 && lastLeft > 0 && x >= width - scrollBarSize && y >= height - scrollBarSize && x <= width && y <= height;
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "onDown",
|
|
56
|
+
value: function onDown(gridPoint, grid) {
|
|
57
|
+
return this.isInCorner(gridPoint, grid);
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "onUp",
|
|
61
|
+
value: function onUp(gridPoint, grid) {
|
|
62
|
+
return this.isInCorner(gridPoint, grid);
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "onClick",
|
|
66
|
+
value: function onClick(gridPoint, grid) {
|
|
67
|
+
return this.isInCorner(gridPoint, grid);
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
|
|
71
|
+
return GridScrollBarCornerMouseHandler;
|
|
72
|
+
}(GridMouseHandler);
|
|
42
73
|
|
|
43
74
|
export default GridScrollBarCornerMouseHandler;
|
|
44
75
|
//# sourceMappingURL=GridScrollBarCornerMouseHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mouse-handlers/GridScrollBarCornerMouseHandler.js"],"names":["GridMouseHandler","GridScrollBarCornerMouseHandler","
|
|
1
|
+
{"version":3,"sources":["../../src/mouse-handlers/GridScrollBarCornerMouseHandler.js"],"names":["GridMouseHandler","GridScrollBarCornerMouseHandler","gridPoint","grid","theme","getTheme","scrollBarSize","metrics","x","y","lastLeft","lastTop","width","height","isInCorner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,OAAOA,gBAAP,MAA6B,qBAA7B;AAEA;AACA;AACA;;IACMC,+B;;;;;;;;;;;;;WACJ,oBAAWC,SAAX,EAAsBC,IAAtB,EAA4B;AAC1B,UAAMC,KAAK,GAAGD,IAAI,CAACE,QAAL,EAAd;AACA,UAAQC,aAAR,GAA0BF,KAA1B,CAAQE,aAAR;AACA,UAAQC,OAAR,GAAoBJ,IAApB,CAAQI,OAAR;AACA,UAAQC,CAAR,GAAiBN,SAAjB,CAAQM,CAAR;AAAA,UAAWC,CAAX,GAAiBP,SAAjB,CAAWO,CAAX;AACA,UAAQC,QAAR,GAA6CH,OAA7C,CAAQG,QAAR;AAAA,UAAkBC,OAAlB,GAA6CJ,OAA7C,CAAkBI,OAAlB;AAAA,UAA2BC,KAA3B,GAA6CL,OAA7C,CAA2BK,KAA3B;AAAA,UAAkCC,MAAlC,GAA6CN,OAA7C,CAAkCM,MAAlC;AACA,aACEP,aAAa,GAAG,CAAhB,IACAK,OAAO,GAAG,CADV,IAEAD,QAAQ,GAAG,CAFX,IAGAF,CAAC,IAAII,KAAK,GAAGN,aAHb,IAIAG,CAAC,IAAII,MAAM,GAAGP,aAJd,IAKAE,CAAC,IAAII,KALL,IAMAH,CAAC,IAAII,MAPP;AASD;;;WAED,gBAAOX,SAAP,EAAkBC,IAAlB,EAAwB;AACtB,aAAO,KAAKW,UAAL,CAAgBZ,SAAhB,EAA2BC,IAA3B,CAAP;AACD;;;WAED,cAAKD,SAAL,EAAgBC,IAAhB,EAAsB;AACpB,aAAO,KAAKW,UAAL,CAAgBZ,SAAhB,EAA2BC,IAA3B,CAAP;AACD;;;WAED,iBAAQD,SAAR,EAAmBC,IAAnB,EAAyB;AACvB,aAAO,KAAKW,UAAL,CAAgBZ,SAAhB,EAA2BC,IAA3B,CAAP;AACD;;;;EA5B2CH,gB;;AA+B9C,eAAeC,+BAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport GridMouseHandler from '../GridMouseHandler';\n\n/**\n * Used to eat the mouse event in the bottom right corner of the scroll bar\n */\nclass GridScrollBarCornerMouseHandler extends GridMouseHandler {\n isInCorner(gridPoint, grid) {\n const theme = grid.getTheme();\n const { scrollBarSize } = theme;\n const { metrics } = grid;\n const { x, y } = gridPoint;\n const { lastLeft, lastTop, width, height } = metrics;\n return (\n scrollBarSize > 0 &&\n lastTop > 0 &&\n lastLeft > 0 &&\n x >= width - scrollBarSize &&\n y >= height - scrollBarSize &&\n x <= width &&\n y <= height\n );\n }\n\n onDown(gridPoint, grid) {\n return this.isInCorner(gridPoint, grid);\n }\n\n onUp(gridPoint, grid) {\n return this.isInCorner(gridPoint, grid);\n }\n\n onClick(gridPoint, grid) {\n return this.isInCorner(gridPoint, grid);\n }\n}\n\nexport default GridScrollBarCornerMouseHandler;\n"],"file":"GridScrollBarCornerMouseHandler.js"}
|