@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,54 +1,84 @@
|
|
|
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 KeyHandler from
|
|
3
|
-
|
|
4
|
-
class TreeKeyHandler extends KeyHandler {
|
|
5
|
-
onDown(e, grid) {
|
|
6
|
-
switch (e.key) {
|
|
7
|
-
case 'Enter':
|
|
8
|
-
case ' ':
|
|
9
|
-
{
|
|
10
|
-
return this.handleExpandKey(e, grid);
|
|
11
|
-
}
|
|
24
|
+
import KeyHandler from '../KeyHandler';
|
|
12
25
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
26
|
+
var TreeKeyHandler = /*#__PURE__*/function (_KeyHandler) {
|
|
27
|
+
_inherits(TreeKeyHandler, _KeyHandler);
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
var _super = _createSuper(TreeKeyHandler);
|
|
30
|
+
|
|
31
|
+
function TreeKeyHandler() {
|
|
32
|
+
_classCallCheck(this, TreeKeyHandler);
|
|
33
|
+
|
|
34
|
+
return _super.apply(this, arguments);
|
|
18
35
|
}
|
|
19
36
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var {
|
|
33
|
-
modelRows
|
|
34
|
-
} = grid.metrics;
|
|
35
|
-
var {
|
|
36
|
-
startRow: row,
|
|
37
|
-
startColumn: column
|
|
38
|
-
} = selectedRanges[0];
|
|
39
|
-
var modelRow = modelRows.get(row);
|
|
40
|
-
|
|
41
|
-
if ((column === 0 || column == null) && model.isRowExpandable(modelRow)) {
|
|
42
|
-
grid.toggleRowExpanded(row);
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
37
|
+
_createClass(TreeKeyHandler, [{
|
|
38
|
+
key: "onDown",
|
|
39
|
+
value: function onDown(e, grid) {
|
|
40
|
+
switch (e.key) {
|
|
41
|
+
case 'Enter':
|
|
42
|
+
case ' ':
|
|
43
|
+
{
|
|
44
|
+
return this.handleExpandKey(e, grid);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
default:
|
|
48
|
+
break;
|
|
45
49
|
}
|
|
50
|
+
|
|
51
|
+
return false;
|
|
46
52
|
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "handleExpandKey",
|
|
55
|
+
value: function handleExpandKey(e, grid) {
|
|
56
|
+
var selectedRanges = grid.state.selectedRanges;
|
|
47
57
|
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
if (selectedRanges.length === 1) {
|
|
59
|
+
var range = selectedRanges[0];
|
|
60
|
+
|
|
61
|
+
if (range.startRow === range.endRow && range.startColumn === range.endColumn) {
|
|
62
|
+
var model = grid.props.model;
|
|
63
|
+
var modelRows = grid.metrics.modelRows;
|
|
64
|
+
var _selectedRanges$ = selectedRanges[0],
|
|
65
|
+
row = _selectedRanges$.startRow,
|
|
66
|
+
column = _selectedRanges$.startColumn;
|
|
67
|
+
var modelRow = modelRows.get(row);
|
|
68
|
+
|
|
69
|
+
if ((column === 0 || column == null) && model.isRowExpandable(modelRow)) {
|
|
70
|
+
grid.toggleRowExpanded(row);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
50
79
|
|
|
51
|
-
|
|
80
|
+
return TreeKeyHandler;
|
|
81
|
+
}(KeyHandler);
|
|
52
82
|
|
|
53
83
|
export default TreeKeyHandler;
|
|
54
84
|
//# sourceMappingURL=TreeKeyHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/key-handlers/TreeKeyHandler.ts"],"names":["KeyHandler","TreeKeyHandler","
|
|
1
|
+
{"version":3,"sources":["../../src/key-handlers/TreeKeyHandler.ts"],"names":["KeyHandler","TreeKeyHandler","e","grid","key","handleExpandKey","selectedRanges","state","length","range","startRow","endRow","startColumn","endColumn","model","props","modelRows","metrics","row","column","modelRow","get","isRowExpandable","toggleRowExpanded"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAGA,OAAOA,UAAP,MAAuB,eAAvB;;IAEMC,c;;;;;;;;;;;;;WACJ,gBAAOC,CAAP,EAAyBC,IAAzB,EAA8C;AAC5C,cAAQD,CAAC,CAACE,GAAV;AACE,aAAK,OAAL;AACA,aAAK,GAAL;AAAU;AACR,mBAAO,KAAKC,eAAL,CAAqBH,CAArB,EAAwBC,IAAxB,CAAP;AACD;;AACD;AACE;AANJ;;AAQA,aAAO,KAAP;AACD;;;WAED,yBAAgBD,CAAhB,EAAkCC,IAAlC,EAAuD;AACrD,UAAQG,cAAR,GAA2BH,IAAI,CAACI,KAAhC,CAAQD,cAAR;;AACA,UAAIA,cAAc,CAACE,MAAf,KAA0B,CAA9B,EAAiC;AAC/B,YAAMC,KAAK,GAAGH,cAAc,CAAC,CAAD,CAA5B;;AACA,YACEG,KAAK,CAACC,QAAN,KAAmBD,KAAK,CAACE,MAAzB,IACAF,KAAK,CAACG,WAAN,KAAsBH,KAAK,CAACI,SAF9B,EAGE;AACA,cAAQC,KAAR,GAAkBX,IAAI,CAACY,KAAvB,CAAQD,KAAR;AACA,cAAQE,SAAR,GAAsBb,IAAI,CAACc,OAA3B,CAAQD,SAAR;AACA,iCAA+CV,cAAc,CAAC,CAAD,CAA7D;AAAA,cAAkBY,GAAlB,oBAAQR,QAAR;AAAA,cAAoCS,MAApC,oBAAuBP,WAAvB;AACA,cAAMQ,QAAQ,GAAGJ,SAAS,CAACK,GAAV,CAAcH,GAAd,CAAjB;;AACA,cACE,CAACC,MAAM,KAAK,CAAX,IAAgBA,MAAM,IAAI,IAA3B,KACAL,KAAK,CAACQ,eAAN,CAAsBF,QAAtB,CAFF,EAGE;AACAjB,YAAAA,IAAI,CAACoB,iBAAL,CAAuBL,GAAvB;AACA,mBAAO,IAAP;AACD;AACF;AACF;;AACD,aAAO,KAAP;AACD;;;;EAnC0BlB,U;;AAsC7B,eAAeC,cAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport Grid from '../Grid';\nimport GridRange from '../GridRange';\nimport KeyHandler from '../KeyHandler';\n\nclass TreeKeyHandler extends KeyHandler {\n onDown(e: KeyboardEvent, grid: Grid): boolean {\n switch (e.key) {\n case 'Enter':\n case ' ': {\n return this.handleExpandKey(e, grid);\n }\n default:\n break;\n }\n return false;\n }\n\n handleExpandKey(e: KeyboardEvent, grid: Grid): boolean {\n const { selectedRanges } = grid.state;\n if (selectedRanges.length === 1) {\n const range = selectedRanges[0] as GridRange;\n if (\n range.startRow === range.endRow &&\n range.startColumn === range.endColumn\n ) {\n const { model } = grid.props;\n const { modelRows } = grid.metrics;\n const { startRow: row, startColumn: column } = selectedRanges[0];\n const modelRow = modelRows.get(row);\n if (\n (column === 0 || column == null) &&\n model.isRowExpandable(modelRow)\n ) {\n grid.toggleRowExpanded(row);\n return true;\n }\n }\n }\n return false;\n }\n}\n\nexport default TreeKeyHandler;\n"],"file":"TreeKeyHandler.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as SelectionKeyHandler } from
|
|
2
|
-
export { default as TreeKeyHandler } from
|
|
3
|
-
export { default as EditKeyHandler } from
|
|
4
|
-
export { default as PasteKeyHandler } from
|
|
1
|
+
export { default as SelectionKeyHandler } from './SelectionKeyHandler';
|
|
2
|
+
export { default as TreeKeyHandler } from './TreeKeyHandler';
|
|
3
|
+
export { default as EditKeyHandler } from './EditKeyHandler';
|
|
4
|
+
export { default as PasteKeyHandler } from './PasteKeyHandler';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/key-handlers/index.ts"],"names":["default","SelectionKeyHandler","TreeKeyHandler","EditKeyHandler","PasteKeyHandler"],"mappings":"SAASA,OAAO,IAAIC,
|
|
1
|
+
{"version":3,"sources":["../../src/key-handlers/index.ts"],"names":["default","SelectionKeyHandler","TreeKeyHandler","EditKeyHandler","PasteKeyHandler"],"mappings":"AAAA,SAASA,OAAO,IAAIC,mBAApB,QAA+C,uBAA/C;AACA,SAASD,OAAO,IAAIE,cAApB,QAA0C,kBAA1C;AACA,SAASF,OAAO,IAAIG,cAApB,QAA0C,kBAA1C;AACA,SAASH,OAAO,IAAII,eAApB,QAA2C,mBAA3C","sourcesContent":["export { default as SelectionKeyHandler } from './SelectionKeyHandler';\nexport { default as TreeKeyHandler } from './TreeKeyHandler';\nexport { default as EditKeyHandler } from './EditKeyHandler';\nexport { default as PasteKeyHandler } from './PasteKeyHandler';\n"],"file":"index.js"}
|
package/dist/memoizeClear.js
CHANGED
|
@@ -20,7 +20,7 @@ export default (function (fn) {
|
|
|
20
20
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
21
21
|
var isClearingCache = false;
|
|
22
22
|
var memoizedFn = memoize(fn, _objectSpread(_objectSpread({}, options), {}, {
|
|
23
|
-
dispose: ()
|
|
23
|
+
dispose: function dispose() {
|
|
24
24
|
// Need to track when we're clearing because dispose gets called for all items removed
|
|
25
25
|
if (!isClearingCache) {
|
|
26
26
|
isClearingCache = true;
|
package/dist/memoizeClear.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/memoizeClear.js"],"names":["memoize","fn","options","isClearingCache","memoizedFn","dispose","clear"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,OAAP,MAAoB,UAApB;AAEA;AACA;AACA;AACA;;AACA,gBAAe,UAACC,EAAD,EAAsB;AAAA,MAAjBC,OAAiB,uEAAP,EAAO;AACnC,MAAIC,eAAe,GAAG,KAAtB;AACA,MAAMC,UAAU,GAAGJ,OAAO,CAACC,EAAD,kCACrBC,OADqB;AAExBG,IAAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/memoizeClear.js"],"names":["memoize","fn","options","isClearingCache","memoizedFn","dispose","clear"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,OAAP,MAAoB,UAApB;AAEA;AACA;AACA;AACA;;AACA,gBAAe,UAACC,EAAD,EAAsB;AAAA,MAAjBC,OAAiB,uEAAP,EAAO;AACnC,MAAIC,eAAe,GAAG,KAAtB;AACA,MAAMC,UAAU,GAAGJ,OAAO,CAACC,EAAD,kCACrBC,OADqB;AAExBG,IAAAA,OAAO,EAAE,mBAAM;AACb;AACA,UAAI,CAACF,eAAL,EAAsB;AACpBA,QAAAA,eAAe,GAAG,IAAlB;AACAC,QAAAA,UAAU,CAACE,KAAX;AACAH,QAAAA,eAAe,GAAG,KAAlB;AACD;AACF;AATuB,KAA1B;AAYA,SAAOC,UAAP;AACD,CAfD","sourcesContent":["/**\n * Extension of memoizee that clears the entire cache when it's full.\n * This avoids the situation where LRU cache starts thrashing when it fills up.\n * Could look at writing our own memoize with a smarter cache to avoid overhead of\n * LRU queue, but this should be sufficient for now.\n */\nimport memoize from 'memoizee';\n\n/**\n * @param {Function} fn The function to memoize\n * @param {Object} options The options to set for memoization\n */\nexport default (fn, options = {}) => {\n let isClearingCache = false;\n const memoizedFn = memoize(fn, {\n ...options,\n dispose: () => {\n // Need to track when we're clearing because dispose gets called for all items removed\n if (!isClearingCache) {\n isClearingCache = true;\n memoizedFn.clear();\n isClearingCache = false;\n }\n },\n });\n\n return memoizedFn;\n};\n"],"file":"memoizeClear.js"}
|
|
@@ -1,29 +1,61 @@
|
|
|
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
|
|
3
|
-
import GridRange from
|
|
24
|
+
import GridMouseHandler from '../GridMouseHandler';
|
|
25
|
+
import GridRange from '../GridRange';
|
|
4
26
|
/**
|
|
5
27
|
* Handles clicking on a cell to edit it in an editable grid
|
|
6
28
|
*/
|
|
7
29
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
model
|
|
16
|
-
} = grid.props;
|
|
17
|
-
|
|
18
|
-
if (model.isEditableRange(GridRange.makeCell(column, row))) {
|
|
19
|
-
grid.startEditing(column, row);
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
30
|
+
var EditMouseHandler = /*#__PURE__*/function (_GridMouseHandler) {
|
|
31
|
+
_inherits(EditMouseHandler, _GridMouseHandler);
|
|
32
|
+
|
|
33
|
+
var _super = _createSuper(EditMouseHandler);
|
|
34
|
+
|
|
35
|
+
function EditMouseHandler() {
|
|
36
|
+
_classCallCheck(this, EditMouseHandler);
|
|
22
37
|
|
|
23
|
-
return
|
|
38
|
+
return _super.apply(this, arguments);
|
|
24
39
|
}
|
|
25
40
|
|
|
26
|
-
|
|
41
|
+
_createClass(EditMouseHandler, [{
|
|
42
|
+
key: "onDoubleClick",
|
|
43
|
+
value: function onDoubleClick(_ref, grid) {
|
|
44
|
+
var column = _ref.column,
|
|
45
|
+
row = _ref.row;
|
|
46
|
+
var model = grid.props.model;
|
|
47
|
+
|
|
48
|
+
if (model.isEditableRange(GridRange.makeCell(column, row))) {
|
|
49
|
+
grid.startEditing(column, row);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
|
|
57
|
+
return EditMouseHandler;
|
|
58
|
+
}(GridMouseHandler);
|
|
27
59
|
|
|
28
60
|
export default EditMouseHandler;
|
|
29
61
|
//# sourceMappingURL=EditMouseHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mouse-handlers/EditMouseHandler.ts"],"names":["GridMouseHandler","GridRange","EditMouseHandler","
|
|
1
|
+
{"version":3,"sources":["../../src/mouse-handlers/EditMouseHandler.ts"],"names":["GridMouseHandler","GridRange","EditMouseHandler","grid","column","row","model","props","isEditableRange","makeCell","startEditing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA,OAAOA,gBAAP,MAA6B,qBAA7B;AACA,OAAOC,SAAP,MAAsB,cAAtB;AAEA;AACA;AACA;;IACMC,gB;;;;;;;;;;;;;WACJ,6BAEEC,IAFF,EAGW;AAAA,UAFPC,MAEO,QAFPA,MAEO;AAAA,UAFCC,GAED,QAFCA,GAED;AACT,UAAQC,KAAR,GAAkBH,IAAI,CAACI,KAAvB,CAAQD,KAAR;;AACA,UAAIA,KAAK,CAACE,eAAN,CAAsBP,SAAS,CAACQ,QAAV,CAAmBL,MAAnB,EAA2BC,GAA3B,CAAtB,CAAJ,EAA4D;AAC1DF,QAAAA,IAAI,CAACO,YAAL,CAAkBN,MAAlB,EAA0BC,GAA1B;AACA,eAAO,IAAP;AACD;;AACD,aAAO,KAAP;AACD;;;;EAX4BL,gB;;AAc/B,eAAeE,gBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport Grid from '../Grid';\nimport GridMouseHandler from '../GridMouseHandler';\nimport GridRange from '../GridRange';\n\n/**\n * Handles clicking on a cell to edit it in an editable grid\n */\nclass EditMouseHandler extends GridMouseHandler {\n onDoubleClick(\n { column, row }: { column: number; row: number },\n grid: Grid\n ): boolean {\n const { model } = grid.props;\n if (model.isEditableRange(GridRange.makeCell(column, row))) {\n grid.startEditing(column, row);\n return true;\n }\n return false;\n }\n}\n\nexport default EditMouseHandler;\n"],"file":"EditMouseHandler.js"}
|
|
@@ -1,181 +1,203 @@
|
|
|
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
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
24
|
|
|
3
|
-
import GridUtils from
|
|
4
|
-
import GridMouseHandler from
|
|
25
|
+
import GridUtils from '../GridUtils';
|
|
26
|
+
import GridMouseHandler from '../GridMouseHandler';
|
|
5
27
|
var SLOPPY_CLICK_DISTANCE = 5;
|
|
6
28
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
super(...arguments);
|
|
10
|
-
|
|
11
|
-
_defineProperty(this, "cursor", null);
|
|
29
|
+
var GridColumnMoveMouseHandler = /*#__PURE__*/function (_GridMouseHandler) {
|
|
30
|
+
_inherits(GridColumnMoveMouseHandler, _GridMouseHandler);
|
|
12
31
|
|
|
13
|
-
|
|
32
|
+
var _super = _createSuper(GridColumnMoveMouseHandler);
|
|
14
33
|
|
|
15
|
-
|
|
34
|
+
function GridColumnMoveMouseHandler() {
|
|
35
|
+
var _this;
|
|
16
36
|
|
|
17
|
-
|
|
18
|
-
}
|
|
37
|
+
_classCallCheck(this, GridColumnMoveMouseHandler);
|
|
19
38
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
model
|
|
23
|
-
} = grid.props;
|
|
24
|
-
var {
|
|
25
|
-
x,
|
|
26
|
-
y,
|
|
27
|
-
column
|
|
28
|
-
} = gridPoint;
|
|
29
|
-
var {
|
|
30
|
-
metrics
|
|
31
|
-
} = grid;
|
|
32
|
-
var {
|
|
33
|
-
columnHeaderHeight,
|
|
34
|
-
rowHeaderWidth,
|
|
35
|
-
visibleColumnXs
|
|
36
|
-
} = metrics;
|
|
37
|
-
this.startingGridPoint = gridPoint;
|
|
38
|
-
this.sloppyClickThreshold = false;
|
|
39
|
-
this.cursor = null;
|
|
40
|
-
|
|
41
|
-
if (y <= columnHeaderHeight && model.isColumnMovable(column)) {
|
|
42
|
-
var columnX = visibleColumnXs.get(column);
|
|
43
|
-
this.draggingOffset = x - columnX - rowHeaderWidth;
|
|
44
|
-
grid.setState({
|
|
45
|
-
draggingColumnOffset: this.draggingOffset
|
|
46
|
-
});
|
|
39
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
40
|
+
args[_key] = arguments[_key];
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
}
|
|
43
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
if (this.draggingOffset == null) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "cursor", null);
|
|
56
46
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var {
|
|
61
|
-
draggingColumn
|
|
62
|
-
} = grid.state;
|
|
63
|
-
var {
|
|
64
|
-
mouseX,
|
|
65
|
-
mouseY,
|
|
66
|
-
isDragging
|
|
67
|
-
} = grid.state;
|
|
68
|
-
|
|
69
|
-
if (mouseX == null || mouseY == null) {
|
|
70
|
-
return false;
|
|
71
|
-
} // before considering it a drag, the mouse must have moved a minimum distance
|
|
72
|
-
// this prevents click actions from triggering a drag state
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "draggingOffset", null);
|
|
48
|
+
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "startingGridPoint", null);
|
|
73
50
|
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "sloppyClickThreshold", false);
|
|
52
|
+
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_createClass(GridColumnMoveMouseHandler, [{
|
|
57
|
+
key: "onDown",
|
|
58
|
+
value: function onDown(gridPoint, grid) {
|
|
59
|
+
var model = grid.props.model;
|
|
60
|
+
var x = gridPoint.x,
|
|
61
|
+
y = gridPoint.y,
|
|
62
|
+
column = gridPoint.column;
|
|
63
|
+
var metrics = grid.metrics;
|
|
64
|
+
var columnHeaderHeight = metrics.columnHeaderHeight,
|
|
65
|
+
rowHeaderWidth = metrics.rowHeaderWidth,
|
|
66
|
+
visibleColumnXs = metrics.visibleColumnXs;
|
|
67
|
+
this.startingGridPoint = gridPoint;
|
|
68
|
+
this.sloppyClickThreshold = false;
|
|
69
|
+
this.cursor = null;
|
|
70
|
+
|
|
71
|
+
if (y <= columnHeaderHeight && model.isColumnMovable(column)) {
|
|
72
|
+
var columnX = visibleColumnXs.get(column);
|
|
73
|
+
this.draggingOffset = x - columnX - rowHeaderWidth;
|
|
74
|
+
grid.setState({
|
|
75
|
+
draggingColumnOffset: this.draggingOffset
|
|
76
|
+
});
|
|
77
|
+
}
|
|
74
78
|
|
|
75
|
-
if (!this.sloppyClickThreshold && Math.abs(this.startingGridPoint.x - mouseX) >= SLOPPY_CLICK_DISTANCE || Math.abs(this.startingGridPoint.y - mouseY) >= SLOPPY_CLICK_DISTANCE) {
|
|
76
|
-
this.sloppyClickThreshold = true;
|
|
77
|
-
} else if (!this.sloppyClickThreshold && !isDragging) {
|
|
78
79
|
return false;
|
|
79
80
|
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "onDrag",
|
|
83
|
+
value: function onDrag(gridPoint, grid) {
|
|
84
|
+
if (this.draggingOffset == null) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
80
87
|
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
var model = grid.props.model;
|
|
89
|
+
var draggingColumn = grid.state.draggingColumn;
|
|
90
|
+
var _grid$state = grid.state,
|
|
91
|
+
mouseX = _grid$state.mouseX,
|
|
92
|
+
mouseY = _grid$state.mouseY,
|
|
93
|
+
isDragging = _grid$state.isDragging;
|
|
85
94
|
|
|
86
|
-
if (
|
|
95
|
+
if (mouseX == null || mouseY == null) {
|
|
87
96
|
return false;
|
|
88
|
-
}
|
|
97
|
+
} // before considering it a drag, the mouse must have moved a minimum distance
|
|
98
|
+
// this prevents click actions from triggering a drag state
|
|
89
99
|
|
|
90
|
-
draggingColumn = column;
|
|
91
|
-
grid.setState({
|
|
92
|
-
draggingColumn,
|
|
93
|
-
isDragging: true
|
|
94
|
-
});
|
|
95
100
|
|
|
96
|
-
if (
|
|
101
|
+
if (!this.sloppyClickThreshold && Math.abs(this.startingGridPoint.x - mouseX) >= SLOPPY_CLICK_DISTANCE || Math.abs(this.startingGridPoint.y - mouseY) >= SLOPPY_CLICK_DISTANCE) {
|
|
102
|
+
this.sloppyClickThreshold = true;
|
|
103
|
+
} else if (!this.sloppyClickThreshold && !isDragging) {
|
|
97
104
|
return false;
|
|
98
105
|
}
|
|
99
|
-
}
|
|
100
106
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var leftColumn = draggingColumn - 1;
|
|
120
|
-
minX = visibleColumnXs.get(leftColumn) + visibleColumnWidths.get(leftColumn) * 0.5 + this.draggingOffset + rowHeaderWidth;
|
|
121
|
-
}
|
|
107
|
+
if (draggingColumn == null) {
|
|
108
|
+
var _grid$getGridPointFro = grid.getGridPointFromXY(mouseX, mouseY),
|
|
109
|
+
column = _grid$getGridPointFro.column;
|
|
110
|
+
|
|
111
|
+
if (column != null && !model.isColumnMovable(column)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
draggingColumn = column;
|
|
116
|
+
grid.setState({
|
|
117
|
+
draggingColumn: draggingColumn,
|
|
118
|
+
isDragging: true
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (draggingColumn == null) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
122
125
|
|
|
123
|
-
|
|
126
|
+
this.cursor = 'move';
|
|
127
|
+
var metrics = grid.metrics;
|
|
128
|
+
var left = metrics.left,
|
|
129
|
+
lastLeft = metrics.lastLeft,
|
|
130
|
+
right = metrics.right,
|
|
131
|
+
rightVisible = metrics.rightVisible,
|
|
132
|
+
columnCount = metrics.columnCount,
|
|
133
|
+
rowHeaderWidth = metrics.rowHeaderWidth,
|
|
134
|
+
visibleColumnWidths = metrics.visibleColumnWidths,
|
|
135
|
+
visibleColumnXs = metrics.visibleColumnXs,
|
|
136
|
+
width = metrics.width;
|
|
137
|
+
var minX = rowHeaderWidth;
|
|
138
|
+
|
|
139
|
+
if (left < draggingColumn) {
|
|
140
|
+
var leftColumn = draggingColumn - 1;
|
|
141
|
+
minX = visibleColumnXs.get(leftColumn) + visibleColumnWidths.get(leftColumn) * 0.5 + this.draggingOffset + rowHeaderWidth;
|
|
142
|
+
}
|
|
124
143
|
|
|
125
|
-
|
|
126
|
-
var rightColumn = draggingColumn + 1;
|
|
127
|
-
maxX = visibleColumnXs.get(rightColumn) + visibleColumnWidths.get(rightColumn) * 0.5 - visibleColumnWidths.get(draggingColumn) + this.draggingOffset + rowHeaderWidth;
|
|
128
|
-
}
|
|
144
|
+
var maxX = width;
|
|
129
145
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
146
|
+
if (draggingColumn < right) {
|
|
147
|
+
var rightColumn = draggingColumn + 1;
|
|
148
|
+
maxX = visibleColumnXs.get(rightColumn) + visibleColumnWidths.get(rightColumn) * 0.5 - visibleColumnWidths.get(draggingColumn) + this.draggingOffset + rowHeaderWidth;
|
|
149
|
+
}
|
|
133
150
|
|
|
134
|
-
|
|
135
|
-
movedColumns = GridUtils.moveItem(draggingColumn, draggingColumn - 1, movedColumns);
|
|
136
|
-
draggingColumn -= 1;
|
|
137
|
-
} else if (maxX < mouseX && draggingColumn < columnCount - 1 && model.isColumnMovable(draggingColumn + 1)) {
|
|
138
|
-
movedColumns = GridUtils.moveItem(draggingColumn, draggingColumn + 1, movedColumns);
|
|
139
|
-
draggingColumn += 1;
|
|
140
|
-
}
|
|
151
|
+
var movedColumns = grid.state.movedColumns;
|
|
141
152
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
if (mouseX < minX && draggingColumn > 0 && model.isColumnMovable(draggingColumn - 1)) {
|
|
154
|
+
movedColumns = GridUtils.moveItem(draggingColumn, draggingColumn - 1, movedColumns);
|
|
155
|
+
draggingColumn -= 1;
|
|
156
|
+
} else if (maxX < mouseX && draggingColumn < columnCount - 1 && model.isColumnMovable(draggingColumn + 1)) {
|
|
157
|
+
movedColumns = GridUtils.moveItem(draggingColumn, draggingColumn + 1, movedColumns);
|
|
158
|
+
draggingColumn += 1;
|
|
159
|
+
}
|
|
148
160
|
|
|
149
|
-
if (mouseX < minMoveX && left > 0) {
|
|
150
161
|
grid.setState({
|
|
151
|
-
|
|
162
|
+
movedColumns: movedColumns,
|
|
163
|
+
draggingColumn: draggingColumn
|
|
152
164
|
});
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
var minMoveX = rowHeaderWidth + visibleColumnWidths.get(left) * 0.5;
|
|
166
|
+
var maxMoveX = rowHeaderWidth + visibleColumnXs.get(rightVisible) + visibleColumnWidths.get(rightVisible) * 0.5;
|
|
167
|
+
|
|
168
|
+
if (mouseX < minMoveX && left > 0) {
|
|
169
|
+
grid.setState({
|
|
170
|
+
left: left - 1
|
|
171
|
+
});
|
|
172
|
+
} else if (mouseX > maxMoveX && left < lastLeft) {
|
|
173
|
+
grid.setState({
|
|
174
|
+
left: left + 1
|
|
175
|
+
});
|
|
176
|
+
}
|
|
164
177
|
|
|
165
|
-
if (this.draggingOffset != null) {
|
|
166
|
-
this.draggingOffset = null;
|
|
167
|
-
grid.setState({
|
|
168
|
-
draggingColumnOffset: null,
|
|
169
|
-
draggingColumn: null,
|
|
170
|
-
isDragging: false
|
|
171
|
-
});
|
|
172
178
|
return true;
|
|
173
179
|
}
|
|
180
|
+
}, {
|
|
181
|
+
key: "onUp",
|
|
182
|
+
value: function onUp(_, grid) {
|
|
183
|
+
this.cursor = null;
|
|
184
|
+
|
|
185
|
+
if (this.draggingOffset != null) {
|
|
186
|
+
this.draggingOffset = null;
|
|
187
|
+
grid.setState({
|
|
188
|
+
draggingColumnOffset: null,
|
|
189
|
+
draggingColumn: null,
|
|
190
|
+
isDragging: false
|
|
191
|
+
});
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
174
194
|
|
|
175
|
-
|
|
176
|
-
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}]);
|
|
177
198
|
|
|
178
|
-
|
|
199
|
+
return GridColumnMoveMouseHandler;
|
|
200
|
+
}(GridMouseHandler);
|
|
179
201
|
|
|
180
202
|
export default GridColumnMoveMouseHandler;
|
|
181
203
|
//# sourceMappingURL=GridColumnMoveMouseHandler.js.map
|