@deephaven/grid 0.5.2-beta.0 → 0.6.1-demo.8
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 +40 -88
- package/dist/CellInputField.js.map +1 -1
- package/dist/Grid.js +1449 -1484
- package/dist/Grid.js.map +1 -1
- package/dist/GridColorUtils.js +18 -51
- package/dist/GridColorUtils.js.map +1 -1
- package/dist/GridMetricCalculator.d.ts +8 -1
- package/dist/GridMetricCalculator.d.ts.map +1 -1
- package/dist/GridMetricCalculator.js +1031 -994
- package/dist/GridMetricCalculator.js.map +1 -1
- package/dist/GridModel.d.ts +4 -1
- package/dist/GridModel.d.ts.map +1 -1
- package/dist/GridModel.js +175 -286
- package/dist/GridModel.js.map +1 -1
- package/dist/GridMouseHandler.js +39 -59
- package/dist/GridMouseHandler.js.map +1 -1
- package/dist/GridRange.js +572 -630
- package/dist/GridRange.js.map +1 -1
- package/dist/GridRenderer.js +1650 -1564
- package/dist/GridRenderer.js.map +1 -1
- package/dist/GridTestUtils.js +15 -29
- package/dist/GridTestUtils.js.map +1 -1
- package/dist/GridUtils.js +679 -717
- package/dist/GridUtils.js.map +1 -1
- package/dist/KeyHandler.js +6 -18
- package/dist/KeyHandler.js.map +1 -1
- package/dist/MockGridModel.js +105 -210
- package/dist/MockGridModel.js.map +1 -1
- package/dist/MockTreeGridModel.js +113 -183
- package/dist/MockTreeGridModel.js.map +1 -1
- package/dist/errors/PasteError.js +5 -44
- 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 +42 -75
- package/dist/key-handlers/EditKeyHandler.js.map +1 -1
- package/dist/key-handlers/PasteKeyHandler.js +42 -78
- package/dist/key-handlers/PasteKeyHandler.js.map +1 -1
- package/dist/key-handlers/SelectionKeyHandler.d.ts.map +1 -1
- package/dist/key-handlers/SelectionKeyHandler.js +239 -229
- package/dist/key-handlers/SelectionKeyHandler.js.map +1 -1
- package/dist/key-handlers/TreeKeyHandler.js +42 -72
- 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 +18 -50
- package/dist/mouse-handlers/EditMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js +141 -163
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js +47 -86
- package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js +145 -171
- package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowMoveMouseHandler.js +125 -147
- package/dist/mouse-handlers/GridRowMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js +47 -86
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridRowTreeMouseHandler.js +46 -76
- package/dist/mouse-handlers/GridRowTreeMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js +31 -62
- package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSelectionMouseHandler.js +200 -222
- package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js +206 -253
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js +146 -172
- 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 +6 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/MockGridModel.js"],"names":["GridModel","GridRange","MockGridModel","rowCount","columnCount","floatingTopRowCount","floatingBottomRowCount","floatingLeftColumnCount","floatingRightColumnCount","isEditable","numRows","numColumns","floatingTop","floatingBottom","floatingLeft","floatingRight","editedData","editable","column","row","theme","textColor","x","y","value","ranges","text","forEachCell","
|
|
1
|
+
{"version":3,"sources":["../src/MockGridModel.js"],"names":["GridModel","GridRange","MockGridModel","constructor","rowCount","columnCount","floatingTopRowCount","floatingBottomRowCount","floatingLeftColumnCount","floatingRightColumnCount","isEditable","numRows","numColumns","floatingTop","floatingBottom","floatingLeft","floatingRight","editedData","editable","textForCell","column","row","colorForCell","theme","textColor","textForColumnHeader","textForRowHeader","textForRowFooter","setValueForCell","x","y","value","setValueForRanges","ranges","text","forEachCell","setValues","edits","i","length","edit","editValueForCell","isValidForCell"],"mappings":";;;;AAAA;;AACA;OACOA,S;OACAC,S;;AAEP,MAAMC,aAAN,SAA4BF,SAA5B,CAAsC;AACpCG,EAAAA,WAAW,GAQH;AAAA,QARI;AACVC,MAAAA,QAAQ,GAAG,UADD;AAEVC,MAAAA,WAAW,GAAG,GAFJ;AAGVC,MAAAA,mBAAmB,GAAG,CAHZ;AAIVC,MAAAA,sBAAsB,GAAG,CAJf;AAKVC,MAAAA,uBAAuB,GAAG,CALhB;AAMVC,MAAAA,wBAAwB,GAAG,CANjB;AAOVC,MAAAA,UAAU,GAAG;AAPH,KAQJ,uEAAJ,EAAI;AACN;AAEA,SAAKC,OAAL,GAAeP,QAAf;AACA,SAAKQ,UAAL,GAAkBP,WAAlB;AACA,SAAKQ,WAAL,GAAmBP,mBAAnB;AACA,SAAKQ,cAAL,GAAsBP,s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UAAL,CAAgBY,CAAhB,IAAqB,EAArB;AACD;;AACD,MAAA,KAAI,CAACZ,UAAL,CAAgBY,CAAhB,EAAmBC,CAAnB,cAA2BC,KAA3B;AAJiC;AAKlC;;AAEKC,EAAAA,iBAAiB,CAACC,MAAD,EAASC,IAAT,EAAe;AAAA;;AAAA;AACpCjC,MAAAA,SAAS,CAACkC,WAAV,CAAsBF,MAAtB,EAA8B,CAACJ,CAAD,EAAIC,CAAJ,KAAU;AACtC,QAAA,MAAI,CAACF,eAAL,CAAqBC,CAArB,EAAwBC,CAAxB,EAA2BI,IAA3B;AACD,OAFD;AADoC;AAIrC;;AAEKE,EAAAA,SAAS,CAACC,KAAD,EAAQ;AAAA;;AAAA;AACrB,WAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,KAAK,CAACE,MAA1B,EAAkCD,CAAC,IAAI,CAAvC,EAA0C;AACxC,YAAME,IAAI,GAAGH,KAAK,CAACC,CAAD,CAAlB;;AACA,QAAA,MAAI,CAACV,eAAL,CAAqBY,IAAI,CAACX,CAA1B,EAA6BW,IAAI,CAACV,CAAlC,EAAqCU,IAAI,CAACN,IAA1C;AACD;AAJoB;AAKtB;;AAEDO,EAAAA,gBAAgB,CAACZ,CAAD,EAAIC,CAAJ,EAAO;AACrB,WAAO,KAAKX,WAAL,CAAiBU,CAAjB,EAAoBC,CAApB,CAAP;AACD;;AAEDY,EAAAA,cAAc,CAACb,CAAD,EAAIC,CAAJ,EAAOC,KAAP,EAAc;AAC1B,WAAO,IAAP;AACD;;AAhGmC;;AAmGtC,eAAe7B,aAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport GridModel from './GridModel';\nimport GridRange from './GridRange';\n\nclass MockGridModel extends GridModel {\n constructor({\n rowCount = 1000000000,\n columnCount = 100,\n floatingTopRowCount = 0,\n floatingBottomRowCount = 0,\n floatingLeftColumnCount = 0,\n floatingRightColumnCount = 0,\n isEditable = false,\n } = {}) {\n super();\n\n this.numRows = rowCount;\n this.numColumns = columnCount;\n this.floatingTop = floatingTopRowCount;\n this.floatingBottom = floatingBottomRowCount;\n this.floatingLeft = floatingLeftColumnCount;\n this.floatingRight = floatingRightColumnCount;\n this.editedData = [];\n this.editable = isEditable;\n }\n\n get rowCount() {\n return this.numRows;\n }\n\n get columnCount() {\n return this.numColumns;\n }\n\n get floatingTopRowCount() {\n return this.floatingTop;\n }\n\n get floatingBottomRowCount() {\n return this.floatingBottom;\n }\n\n get floatingLeftColumnCount() {\n return this.floatingLeft;\n }\n\n get floatingRightColumnCount() {\n return this.floatingRight;\n }\n\n get isEditable() {\n return this.editable;\n }\n\n textForCell(column, row) {\n return this.editedData[column]?.[row] ?? `${column},${row}`;\n }\n\n colorForCell(column, row, theme) {\n return theme.textColor;\n }\n\n textForColumnHeader(column) {\n return `${column}`;\n }\n\n textForRowHeader(row) {\n return `${row}`;\n }\n\n textForRowFooter(row) {\n return `${row}`;\n }\n\n async setValueForCell(x, y, value) {\n if (this.editedData[x] == null) {\n this.editedData[x] = [];\n }\n this.editedData[x][y] = `${value}`;\n }\n\n async setValueForRanges(ranges, text) {\n GridRange.forEachCell(ranges, (x, y) => {\n this.setValueForCell(x, y, text);\n });\n }\n\n async setValues(edits) {\n for (let i = 0; i < edits.length; i += 1) {\n const edit = edits[i];\n this.setValueForCell(edit.x, edit.y, edit.text);\n }\n }\n\n editValueForCell(x, y) {\n return this.textForCell(x, y);\n }\n\n isValidForCell(x, y, value) {\n return true;\n }\n}\n\nexport default MockGridModel;\n"],"file":"MockGridModel.js"}
|
|
@@ -1,105 +1,43 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8
|
-
|
|
9
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
-
|
|
11
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
|
|
17
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
18
|
-
|
|
19
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
|
-
|
|
21
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
22
|
-
|
|
23
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
-
|
|
25
|
-
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); } }
|
|
26
|
-
|
|
27
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
28
|
-
|
|
29
|
-
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); }
|
|
30
|
-
|
|
31
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
32
|
-
|
|
33
|
-
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); }; }
|
|
34
|
-
|
|
35
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
36
|
-
|
|
37
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
38
|
-
|
|
39
|
-
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; } }
|
|
40
|
-
|
|
41
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
42
|
-
|
|
43
1
|
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; }
|
|
44
2
|
|
|
45
3
|
/* eslint class-methods-use-this: "off" */
|
|
46
4
|
|
|
47
5
|
/* eslint no-unused-vars: "off" */
|
|
48
|
-
import MockGridModel from
|
|
49
|
-
import memoizeClear from
|
|
6
|
+
import MockGridModel from "./MockGridModel.js";
|
|
7
|
+
import memoizeClear from "./memoizeClear.js";
|
|
50
8
|
/**
|
|
51
9
|
* A class to mock a tree model so can test out tree models.
|
|
52
10
|
* Whenever a row is expanded, it creates a child model for that row, which can then make a child for those rows, etc.
|
|
53
11
|
*/
|
|
54
12
|
|
|
55
|
-
|
|
56
|
-
_inherits(MockTreeGridModel, _MockGridModel);
|
|
57
|
-
|
|
58
|
-
var _super = _createSuper(MockTreeGridModel);
|
|
59
|
-
|
|
13
|
+
class MockTreeGridModel extends MockGridModel {
|
|
60
14
|
/** How many rows a child tree should have related to the parent. Eg. if parent has 10000 rows, child will have 100 */
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
_ref$movedRows = _ref.movedRows,
|
|
78
|
-
movedRows = _ref$movedRows === void 0 ? [] : _ref$movedRows,
|
|
79
|
-
_ref$columnFormatMap = _ref.columnFormatMap,
|
|
80
|
-
columnFormatMap = _ref$columnFormatMap === void 0 ? new Map() : _ref$columnFormatMap;
|
|
81
|
-
|
|
82
|
-
_classCallCheck(this, MockTreeGridModel);
|
|
83
|
-
|
|
84
|
-
_this = _super.call(this, {
|
|
85
|
-
rowCount: rowCount,
|
|
86
|
-
columnCount: columnCount,
|
|
87
|
-
movedColumns: movedColumns,
|
|
88
|
-
movedRows: movedRows
|
|
15
|
+
constructor() {
|
|
16
|
+
var {
|
|
17
|
+
rowCount = MockTreeGridModel.DEFAULT_ROW_COUNT,
|
|
18
|
+
columnCount = MockTreeGridModel.DEFAULT_COLUMN_COUNT,
|
|
19
|
+
children: _children = new Map(),
|
|
20
|
+
childRowCount: _childRowCount = Math.ceil(Math.max(MockTreeGridModel.MIN_CHILD_ROW_COUNT, rowCount * MockTreeGridModel.DEFAULT_CHILD_ROW_COUNT_FACTOR)),
|
|
21
|
+
maxDepth: _maxDepth = MockTreeGridModel.MAX_DEPTH,
|
|
22
|
+
movedColumns = [],
|
|
23
|
+
movedRows = [],
|
|
24
|
+
columnFormatMap = new Map()
|
|
25
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
|
+
super({
|
|
27
|
+
rowCount,
|
|
28
|
+
columnCount,
|
|
29
|
+
movedColumns,
|
|
30
|
+
movedRows
|
|
89
31
|
});
|
|
90
32
|
|
|
91
|
-
_defineProperty(
|
|
33
|
+
_defineProperty(this, "getCachedModelRowOffset", memoizeClear((children, row) => {
|
|
92
34
|
var key = null;
|
|
93
35
|
var offsetRow = row; // Need to iterate through the map in order... sort it first
|
|
94
36
|
|
|
95
|
-
var sortedEntries =
|
|
96
|
-
return a[0] - b[0];
|
|
97
|
-
});
|
|
37
|
+
var sortedEntries = [...children].sort((a, b) => a[0] - b[0]);
|
|
98
38
|
|
|
99
39
|
for (var i = 0; i < sortedEntries.length; i += 1) {
|
|
100
|
-
var
|
|
101
|
-
childRow = _sortedEntries$i[0],
|
|
102
|
-
childModel = _sortedEntries$i[1];
|
|
40
|
+
var [childRow, childModel] = sortedEntries[i];
|
|
103
41
|
|
|
104
42
|
if (offsetRow <= childRow) {
|
|
105
43
|
break;
|
|
@@ -117,15 +55,16 @@ var MockTreeGridModel = /*#__PURE__*/function (_MockGridModel) {
|
|
|
117
55
|
}
|
|
118
56
|
|
|
119
57
|
return {
|
|
120
|
-
key
|
|
121
|
-
offsetRow
|
|
58
|
+
key,
|
|
59
|
+
offsetRow
|
|
122
60
|
};
|
|
123
61
|
}));
|
|
124
62
|
|
|
125
|
-
_defineProperty(
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
|
|
63
|
+
_defineProperty(this, "getCachedTextForRowHeader", memoizeClear((children, row) => {
|
|
64
|
+
var {
|
|
65
|
+
key,
|
|
66
|
+
offsetRow
|
|
67
|
+
} = this.getCachedModelRowOffset(children, row);
|
|
129
68
|
|
|
130
69
|
if (key != null) {
|
|
131
70
|
var model = children.get(key);
|
|
@@ -135,10 +74,11 @@ var MockTreeGridModel = /*#__PURE__*/function (_MockGridModel) {
|
|
|
135
74
|
return "".concat(offsetRow);
|
|
136
75
|
}));
|
|
137
76
|
|
|
138
|
-
_defineProperty(
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
77
|
+
_defineProperty(this, "getCachedTextForCell", memoizeClear((children, column, row) => {
|
|
78
|
+
var {
|
|
79
|
+
key,
|
|
80
|
+
offsetRow
|
|
81
|
+
} = this.getCachedModelRowOffset(children, row);
|
|
142
82
|
|
|
143
83
|
if (key != null) {
|
|
144
84
|
var model = children.get(key);
|
|
@@ -148,16 +88,16 @@ var MockTreeGridModel = /*#__PURE__*/function (_MockGridModel) {
|
|
|
148
88
|
return "".concat(column, ",").concat(offsetRow);
|
|
149
89
|
}));
|
|
150
90
|
|
|
151
|
-
_defineProperty(
|
|
152
|
-
var depth =
|
|
153
|
-
|
|
91
|
+
_defineProperty(this, "getCachedIsRowExpandable", memoizeClear((children, row, maxDepth) => {
|
|
92
|
+
var depth = this.getCachedDepthForRow(children, row);
|
|
154
93
|
return depth < maxDepth;
|
|
155
94
|
}));
|
|
156
95
|
|
|
157
|
-
_defineProperty(
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
96
|
+
_defineProperty(this, "getCachedIsRowExpanded", memoizeClear((children, row) => {
|
|
97
|
+
var {
|
|
98
|
+
key,
|
|
99
|
+
offsetRow
|
|
100
|
+
} = this.getCachedModelRowOffset(children, row);
|
|
161
101
|
|
|
162
102
|
if (key != null) {
|
|
163
103
|
var model = children.get(key);
|
|
@@ -167,10 +107,11 @@ var MockTreeGridModel = /*#__PURE__*/function (_MockGridModel) {
|
|
|
167
107
|
return children.has(offsetRow);
|
|
168
108
|
}));
|
|
169
109
|
|
|
170
|
-
_defineProperty(
|
|
171
|
-
var
|
|
172
|
-
|
|
173
|
-
|
|
110
|
+
_defineProperty(this, "getCachedDepthForRow", memoizeClear((children, row) => {
|
|
111
|
+
var {
|
|
112
|
+
key,
|
|
113
|
+
offsetRow
|
|
114
|
+
} = this.getCachedModelRowOffset(children, row);
|
|
174
115
|
|
|
175
116
|
if (key != null) {
|
|
176
117
|
var model = children.get(key);
|
|
@@ -180,93 +121,82 @@ var MockTreeGridModel = /*#__PURE__*/function (_MockGridModel) {
|
|
|
180
121
|
return 0;
|
|
181
122
|
}));
|
|
182
123
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return _this;
|
|
124
|
+
this.children = _children;
|
|
125
|
+
this.childRowCount = _childRowCount;
|
|
126
|
+
this.maxDepth = _maxDepth;
|
|
127
|
+
this.formatMap = columnFormatMap;
|
|
188
128
|
}
|
|
189
129
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return this.getCachedTextForCell(this.children, column, row);
|
|
194
|
-
}
|
|
195
|
-
}, {
|
|
196
|
-
key: "textForRowHeader",
|
|
197
|
-
value: function textForRowHeader(row) {
|
|
198
|
-
return this.getCachedTextForRowHeader(this.children, row);
|
|
199
|
-
}
|
|
200
|
-
}, {
|
|
201
|
-
key: "isRowMovable",
|
|
202
|
-
value: function isRowMovable(row) {
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
key: "hasExpandableRows",
|
|
207
|
-
get: function get() {
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
|
-
}, {
|
|
211
|
-
key: "floatingBottomRowCount",
|
|
212
|
-
get: function get() {
|
|
213
|
-
return 0;
|
|
214
|
-
}
|
|
215
|
-
}, {
|
|
216
|
-
key: "isRowExpandable",
|
|
217
|
-
value: function isRowExpandable(row) {
|
|
218
|
-
return this.getCachedIsRowExpandable(this.children, row, this.maxDepth);
|
|
219
|
-
}
|
|
220
|
-
}, {
|
|
221
|
-
key: "isRowExpanded",
|
|
222
|
-
value: function isRowExpanded(row) {
|
|
223
|
-
return this.getCachedIsRowExpanded(this.children, row);
|
|
224
|
-
}
|
|
225
|
-
}, {
|
|
226
|
-
key: "setRowExpanded",
|
|
227
|
-
value: function setRowExpanded(row, isExpanded) {
|
|
228
|
-
var _this$getCachedModelR5 = this.getCachedModelRowOffset(this.children, row),
|
|
229
|
-
key = _this$getCachedModelR5.key,
|
|
230
|
-
offsetRow = _this$getCachedModelR5.offsetRow; // We always set a new map so that our memoize functions work properly
|
|
130
|
+
textForCell(column, row) {
|
|
131
|
+
return this.getCachedTextForCell(this.children, column, row);
|
|
132
|
+
}
|
|
231
133
|
|
|
134
|
+
textForRowHeader(row) {
|
|
135
|
+
return this.getCachedTextForRowHeader(this.children, row);
|
|
136
|
+
}
|
|
232
137
|
|
|
233
|
-
|
|
138
|
+
isRowMovable(row) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
234
141
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
model.setRowExpanded(offsetRow, isExpanded);
|
|
239
|
-
this.numRows += model.rowCount - originalChildRowCount;
|
|
240
|
-
} else if (!isExpanded) {
|
|
241
|
-
var childModel = children.get(offsetRow);
|
|
242
|
-
this.numRows -= childModel.rowCount;
|
|
243
|
-
children["delete"](offsetRow);
|
|
244
|
-
} else {
|
|
245
|
-
var child = new MockTreeGridModel({
|
|
246
|
-
rowCount: this.childRowCount,
|
|
247
|
-
columnCount: this.numColumns
|
|
248
|
-
});
|
|
249
|
-
children.set(offsetRow, child);
|
|
250
|
-
this.numRows += child.rowCount;
|
|
251
|
-
}
|
|
142
|
+
get hasExpandableRows() {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
252
145
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
146
|
+
get floatingBottomRowCount() {
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
isRowExpandable(row) {
|
|
151
|
+
return this.getCachedIsRowExpandable(this.children, row, this.maxDepth);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
isRowExpanded(row) {
|
|
155
|
+
return this.getCachedIsRowExpanded(this.children, row);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
setRowExpanded(row, isExpanded) {
|
|
159
|
+
var {
|
|
160
|
+
key,
|
|
161
|
+
offsetRow
|
|
162
|
+
} = this.getCachedModelRowOffset(this.children, row); // We always set a new map so that our memoize functions work properly
|
|
163
|
+
|
|
164
|
+
var children = new Map(this.children);
|
|
165
|
+
|
|
166
|
+
if (key != null) {
|
|
167
|
+
var model = this.children.get(key);
|
|
168
|
+
var {
|
|
169
|
+
rowCount: originalChildRowCount
|
|
170
|
+
} = model;
|
|
171
|
+
model.setRowExpanded(offsetRow, isExpanded);
|
|
172
|
+
this.numRows += model.rowCount - originalChildRowCount;
|
|
173
|
+
} else if (!isExpanded) {
|
|
174
|
+
var childModel = children.get(offsetRow);
|
|
175
|
+
this.numRows -= childModel.rowCount;
|
|
176
|
+
children.delete(offsetRow);
|
|
177
|
+
} else {
|
|
178
|
+
var child = new MockTreeGridModel({
|
|
179
|
+
rowCount: this.childRowCount,
|
|
180
|
+
columnCount: this.numColumns
|
|
181
|
+
});
|
|
182
|
+
children.set(offsetRow, child);
|
|
183
|
+
this.numRows += child.rowCount;
|
|
259
184
|
}
|
|
260
|
-
/**
|
|
261
|
-
* Returns the map key and the offsetRow given the provided children and row index.
|
|
262
|
-
* If the returned key is null, then this offset row is within this model.
|
|
263
|
-
* Only returning the key instead of the model so that memoize doesn't cache a bunch of the children models after they've been deleted (collapsed).
|
|
264
|
-
*/
|
|
265
185
|
|
|
266
|
-
|
|
186
|
+
this.children = children;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
depthForRow(row) {
|
|
190
|
+
return this.getCachedDepthForRow(this.children, row);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Returns the map key and the offsetRow given the provided children and row index.
|
|
194
|
+
* If the returned key is null, then this offset row is within this model.
|
|
195
|
+
* Only returning the key instead of the model so that memoize doesn't cache a bunch of the children models after they've been deleted (collapsed).
|
|
196
|
+
*/
|
|
197
|
+
|
|
267
198
|
|
|
268
|
-
|
|
269
|
-
}(MockGridModel);
|
|
199
|
+
}
|
|
270
200
|
|
|
271
201
|
_defineProperty(MockTreeGridModel, "DEFAULT_ROW_COUNT", 1000000000);
|
|
272
202
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/MockTreeGridModel.js"],"names":["MockGridModel","memoizeClear","MockTreeGridModel","rowCount","DEFAULT_ROW_COUNT","columnCount","DEFAULT_COLUMN_COUNT","children","Map","childRowCount","Math","ceil","max","MIN_CHILD_ROW_COUNT","DEFAULT_CHILD_ROW_COUNT_FACTOR","maxDepth","MAX_DEPTH","movedColumns","movedRows","columnFormatMap","row","key","offsetRow","sortedEntries","sort","a","b","i","length","childRow","childModel","getCachedModelRowOffset","model","get","textForRowHeader","column","textForCell","depth","getCachedDepthForRow","isRowExpanded","has","depthForRow","formatMap","getCachedTextForCell","getCachedTextForRowHeader","getCachedIsRowExpandable","getCachedIsRowExpanded","isExpanded","originalChildRowCount","setRowExpanded","numRows","child","numColumns","set"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AACA,OAAOA,aAAP,MAA0B,iBAA1B;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA;AACA;AACA;AACA;;IACMC,iB;;;;;AAKJ;AAOA,+BAcQ;AAAA;;AAAA,mFAAJ,EAAI;AAAA,6BAbNC,QAaM;AAAA,QAbNA,QAaM,8BAbKD,iBAAiB,CAACE,iBAavB;AAAA,gCAZNC,WAYM;AAAA,QAZNA,WAYM,iCAZQH,iBAAiB,CAACI,oBAY1B;AAAA,6BAXNC,QAWM;AAAA,QAXNA,SAWM,8BAXK,IAAIC,GAAJ,EAWL;AAAA,kCAVNC,aAUM;AAAA,QAVNA,cAUM,mCAVUC,IAAI,CAACC,IAAL,CACdD,IAAI,CAACE,GAAL,CACEV,iBAAiB,CAACW,mBADpB,EAEEV,QAAQ,GAAGD,iBAAiB,CAACY,8BAF/B,CADc,CAUV;AAAA,6BAJNC,QAIM;AAAA,QAJNA,SAIM,8BAJKb,iBAAiB,CAACc,SAIvB;AAAA,iCAHNC,YAGM;AAAA,QAHNA,YAGM,kCAHS,EAGT;AAAA,8BAFNC,SAEM;AAAA,QAFNA,SAEM,+BAFM,EAEN;AAAA,oCADNC,eACM;AAAA,QADNA,eACM,qCADY,IAAIX,GAAJ,EACZ;;AAAA;;AACN,8BAAM;AAAEL,MAAAA,QAAQ,EAARA,QAAF;AAAYE,MAAAA,WAAW,EAAXA,WAAZ;AAAyBY,MAAAA,YAAY,EAAZA,YAAzB;AAAuCC,MAAAA,SAAS,EAATA;AAAvC,KAAN;;AADM,8EAwEkBjB,YAAY,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MoC,I;;gBANpCA,iB,yBAQyB,E;;gBARzBA,iB,eAUe,E;;AAiKrB,eAAeA,iBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport MockGridModel from './MockGridModel';\nimport memoizeClear from './memoizeClear';\n\n/**\n * A class to mock a tree model so can test out tree models.\n * Whenever a row is expanded, it creates a child model for that row, which can then make a child for those rows, etc.\n */\nclass MockTreeGridModel extends MockGridModel {\n static DEFAULT_ROW_COUNT = 1000000000;\n\n static DEFAULT_COLUMN_COUNT = 100;\n\n /** How many rows a child tree should have related to the parent. Eg. if parent has 10000 rows, child will have 100 */\n static DEFAULT_CHILD_ROW_COUNT_FACTOR = 0.01;\n\n static MIN_CHILD_ROW_COUNT = 10;\n\n static MAX_DEPTH = 10;\n\n constructor({\n rowCount = MockTreeGridModel.DEFAULT_ROW_COUNT,\n columnCount = MockTreeGridModel.DEFAULT_COLUMN_COUNT,\n children = new Map(),\n childRowCount = Math.ceil(\n Math.max(\n MockTreeGridModel.MIN_CHILD_ROW_COUNT,\n rowCount * MockTreeGridModel.DEFAULT_CHILD_ROW_COUNT_FACTOR\n )\n ),\n maxDepth = MockTreeGridModel.MAX_DEPTH,\n movedColumns = [],\n movedRows = [],\n columnFormatMap = new Map(),\n } = {}) {\n super({ rowCount, columnCount, movedColumns, movedRows });\n\n this.children = children;\n this.childRowCount = childRowCount;\n this.maxDepth = maxDepth;\n this.formatMap = columnFormatMap;\n }\n\n textForCell(column, row) {\n return this.getCachedTextForCell(this.children, column, row);\n }\n\n textForRowHeader(row) {\n return this.getCachedTextForRowHeader(this.children, row);\n }\n\n isRowMovable(row) {\n return false;\n }\n\n get hasExpandableRows() {\n return true;\n }\n\n get floatingBottomRowCount() {\n return 0;\n }\n\n isRowExpandable(row) {\n return this.getCachedIsRowExpandable(this.children, row, this.maxDepth);\n }\n\n isRowExpanded(row) {\n return this.getCachedIsRowExpanded(this.children, row);\n }\n\n setRowExpanded(row, isExpanded) {\n const { key, offsetRow } = this.getCachedModelRowOffset(this.children, row);\n\n // We always set a new map so that our memoize functions work properly\n const children = new Map(this.children);\n if (key != null) {\n const model = this.children.get(key);\n const { rowCount: originalChildRowCount } = model;\n model.setRowExpanded(offsetRow, isExpanded);\n this.numRows += model.rowCount - originalChildRowCount;\n } else if (!isExpanded) {\n const childModel = children.get(offsetRow);\n this.numRows -= childModel.rowCount;\n children.delete(offsetRow);\n } else {\n const child = new MockTreeGridModel({\n rowCount: this.childRowCount,\n columnCount: this.numColumns,\n });\n children.set(offsetRow, child);\n this.numRows += child.rowCount;\n }\n\n this.children = children;\n }\n\n depthForRow(row) {\n return this.getCachedDepthForRow(this.children, row);\n }\n\n /**\n * Returns the map key and the offsetRow given the provided children and row index.\n * If the returned key is null, then this offset row is within this model.\n * Only returning the key instead of the model so that memoize doesn't cache a bunch of the children models after they've been deleted (collapsed).\n */\n getCachedModelRowOffset = memoizeClear((children, row) => {\n let key = null;\n let offsetRow = row;\n // Need to iterate through the map in order... sort it first\n const sortedEntries = [...children].sort((a, b) => a[0] - b[0]);\n for (let i = 0; i < sortedEntries.length; i += 1) {\n const [childRow, childModel] = sortedEntries[i];\n if (offsetRow <= childRow) {\n break;\n }\n const childRowCount = childModel.rowCount;\n if (offsetRow <= childRow + childRowCount) {\n key = childRow;\n offsetRow = offsetRow - childRow - 1;\n break;\n }\n offsetRow -= childRowCount;\n }\n\n return { key, offsetRow };\n });\n\n getCachedTextForRowHeader = memoizeClear((children, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return `${key}.${model.textForRowHeader(offsetRow)}`;\n }\n\n return `${offsetRow}`;\n });\n\n getCachedTextForCell = memoizeClear((children, column, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return `${key}.${model.textForCell(column, offsetRow)}`;\n }\n\n return `${column},${offsetRow}`;\n });\n\n getCachedIsRowExpandable = memoizeClear((children, row, maxDepth) => {\n const depth = this.getCachedDepthForRow(children, row);\n\n return depth < maxDepth;\n });\n\n getCachedIsRowExpanded = memoizeClear((children, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return model.isRowExpanded(offsetRow);\n }\n\n return children.has(offsetRow);\n });\n\n getCachedDepthForRow = memoizeClear((children, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return model.depthForRow(offsetRow) + 1;\n }\n\n return 0;\n });\n}\n\nexport default MockTreeGridModel;\n"],"file":"MockTreeGridModel.js"}
|
|
1
|
+
{"version":3,"sources":["../src/MockTreeGridModel.js"],"names":["MockGridModel","memoizeClear","MockTreeGridModel","constructor","rowCount","DEFAULT_ROW_COUNT","columnCount","DEFAULT_COLUMN_COUNT","children","Map","childRowCount","Math","ceil","max","MIN_CHILD_ROW_COUNT","DEFAULT_CHILD_ROW_COUNT_FACTOR","maxDepth","MAX_DEPTH","movedColumns","movedRows","columnFormatMap","row","key","offsetRow","sortedEntries","sort","a","b","i","length","childRow","childModel","getCachedModelRowOffset","model","get","textForRowHeader","column","textForCell","depth","getCachedDepthForRow","isRowExpanded","has","depthForRow","formatMap","getCachedTextForCell","getCachedTextForRowHeader","isRowMovable","hasExpandableRows","floatingBottomRowCount","isRowExpandable","getCachedIsRowExpandable","getCachedIsRowExpanded","setRowExpanded","isExpanded","originalChildRowCount","numRows","delete","child","numColumns","set"],"mappings":";;AAAA;;AACA;OACOA,a;OACAC,Y;AAEP;AACA;AACA;AACA;;AACA,MAAMC,iBAAN,SAAgCF,aAAhC,CAA8C;AAK5C;AAOAG,EAAAA,WAAW,GAcH;AAAA,QAdI;AACVC,MAAAA,QAAQ,GAAGF,iBAAiB,CAACG,iBADnB;AAEVC,MAAAA,WAAW,GAAGJ,iBAAiB,CAACK,oBAFtB;AAGVC,MAAAA,QAAQ,EAARA,SAAQ,GAAG,IAAIC,GA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QAAQ,EAAE,KAAKM,aADmB;AAElCJ,QAAAA,WAAW,EAAE,KAAKoD;AAFgB,OAAtB,CAAd;AAIAlD,MAAAA,QAAQ,CAACmD,GAAT,CAAapC,SAAb,EAAwBkC,KAAxB;AACA,WAAKF,OAAL,IAAgBE,KAAK,CAACrD,QAAtB;AACD;;AAED,SAAKI,QAAL,GAAgBA,QAAhB;AACD;;AAEDkC,EAAAA,WAAW,CAACrB,GAAD,EAAM;AACf,WAAO,KAAKkB,oBAAL,CAA0B,KAAK/B,QAA/B,EAAyCa,GAAzC,CAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AAjG8C;;gBAAxCnB,iB,uBACuB,U;;gBADvBA,iB,0BAG0B,G;;gBAH1BA,iB,oCAMoC,I;;gBANpCA,iB,yBAQyB,E;;gBARzBA,iB,eAUe,E;;AAiKrB,eAAeA,iBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport MockGridModel from './MockGridModel';\nimport memoizeClear from './memoizeClear';\n\n/**\n * A class to mock a tree model so can test out tree models.\n * Whenever a row is expanded, it creates a child model for that row, which can then make a child for those rows, etc.\n */\nclass MockTreeGridModel extends MockGridModel {\n static DEFAULT_ROW_COUNT = 1000000000;\n\n static DEFAULT_COLUMN_COUNT = 100;\n\n /** How many rows a child tree should have related to the parent. Eg. if parent has 10000 rows, child will have 100 */\n static DEFAULT_CHILD_ROW_COUNT_FACTOR = 0.01;\n\n static MIN_CHILD_ROW_COUNT = 10;\n\n static MAX_DEPTH = 10;\n\n constructor({\n rowCount = MockTreeGridModel.DEFAULT_ROW_COUNT,\n columnCount = MockTreeGridModel.DEFAULT_COLUMN_COUNT,\n children = new Map(),\n childRowCount = Math.ceil(\n Math.max(\n MockTreeGridModel.MIN_CHILD_ROW_COUNT,\n rowCount * MockTreeGridModel.DEFAULT_CHILD_ROW_COUNT_FACTOR\n )\n ),\n maxDepth = MockTreeGridModel.MAX_DEPTH,\n movedColumns = [],\n movedRows = [],\n columnFormatMap = new Map(),\n } = {}) {\n super({ rowCount, columnCount, movedColumns, movedRows });\n\n this.children = children;\n this.childRowCount = childRowCount;\n this.maxDepth = maxDepth;\n this.formatMap = columnFormatMap;\n }\n\n textForCell(column, row) {\n return this.getCachedTextForCell(this.children, column, row);\n }\n\n textForRowHeader(row) {\n return this.getCachedTextForRowHeader(this.children, row);\n }\n\n isRowMovable(row) {\n return false;\n }\n\n get hasExpandableRows() {\n return true;\n }\n\n get floatingBottomRowCount() {\n return 0;\n }\n\n isRowExpandable(row) {\n return this.getCachedIsRowExpandable(this.children, row, this.maxDepth);\n }\n\n isRowExpanded(row) {\n return this.getCachedIsRowExpanded(this.children, row);\n }\n\n setRowExpanded(row, isExpanded) {\n const { key, offsetRow } = this.getCachedModelRowOffset(this.children, row);\n\n // We always set a new map so that our memoize functions work properly\n const children = new Map(this.children);\n if (key != null) {\n const model = this.children.get(key);\n const { rowCount: originalChildRowCount } = model;\n model.setRowExpanded(offsetRow, isExpanded);\n this.numRows += model.rowCount - originalChildRowCount;\n } else if (!isExpanded) {\n const childModel = children.get(offsetRow);\n this.numRows -= childModel.rowCount;\n children.delete(offsetRow);\n } else {\n const child = new MockTreeGridModel({\n rowCount: this.childRowCount,\n columnCount: this.numColumns,\n });\n children.set(offsetRow, child);\n this.numRows += child.rowCount;\n }\n\n this.children = children;\n }\n\n depthForRow(row) {\n return this.getCachedDepthForRow(this.children, row);\n }\n\n /**\n * Returns the map key and the offsetRow given the provided children and row index.\n * If the returned key is null, then this offset row is within this model.\n * Only returning the key instead of the model so that memoize doesn't cache a bunch of the children models after they've been deleted (collapsed).\n */\n getCachedModelRowOffset = memoizeClear((children, row) => {\n let key = null;\n let offsetRow = row;\n // Need to iterate through the map in order... sort it first\n const sortedEntries = [...children].sort((a, b) => a[0] - b[0]);\n for (let i = 0; i < sortedEntries.length; i += 1) {\n const [childRow, childModel] = sortedEntries[i];\n if (offsetRow <= childRow) {\n break;\n }\n const childRowCount = childModel.rowCount;\n if (offsetRow <= childRow + childRowCount) {\n key = childRow;\n offsetRow = offsetRow - childRow - 1;\n break;\n }\n offsetRow -= childRowCount;\n }\n\n return { key, offsetRow };\n });\n\n getCachedTextForRowHeader = memoizeClear((children, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return `${key}.${model.textForRowHeader(offsetRow)}`;\n }\n\n return `${offsetRow}`;\n });\n\n getCachedTextForCell = memoizeClear((children, column, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return `${key}.${model.textForCell(column, offsetRow)}`;\n }\n\n return `${column},${offsetRow}`;\n });\n\n getCachedIsRowExpandable = memoizeClear((children, row, maxDepth) => {\n const depth = this.getCachedDepthForRow(children, row);\n\n return depth < maxDepth;\n });\n\n getCachedIsRowExpanded = memoizeClear((children, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return model.isRowExpanded(offsetRow);\n }\n\n return children.has(offsetRow);\n });\n\n getCachedDepthForRow = memoizeClear((children, row) => {\n const { key, offsetRow } = this.getCachedModelRowOffset(children, row);\n\n if (key != null) {\n const model = children.get(key);\n return model.depthForRow(offsetRow) + 1;\n }\n\n return 0;\n });\n}\n\nexport default MockTreeGridModel;\n"],"file":"MockTreeGridModel.js"}
|
|
@@ -1,52 +1,13 @@
|
|
|
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 _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); }
|
|
6
|
-
|
|
7
|
-
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); }; }
|
|
8
|
-
|
|
9
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
10
|
-
|
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
|
|
13
|
-
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
14
|
-
|
|
15
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
16
|
-
|
|
17
|
-
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; } }
|
|
18
|
-
|
|
19
|
-
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
20
|
-
|
|
21
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
-
|
|
23
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
-
|
|
25
1
|
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; }
|
|
26
2
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var _super = _createSuper(PasteError);
|
|
31
|
-
|
|
32
|
-
function PasteError() {
|
|
33
|
-
var _this;
|
|
34
|
-
|
|
35
|
-
_classCallCheck(this, PasteError);
|
|
36
|
-
|
|
37
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
|
-
args[_key] = arguments[_key];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
|
-
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "isPasteError", true);
|
|
3
|
+
class PasteError extends Error {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
44
6
|
|
|
45
|
-
|
|
7
|
+
_defineProperty(this, "isPasteError", true);
|
|
46
8
|
}
|
|
47
9
|
|
|
48
|
-
|
|
49
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
10
|
+
}
|
|
50
11
|
|
|
51
12
|
export default PasteError;
|
|
52
13
|
//# sourceMappingURL=PasteError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/PasteError.ts"],"names":["PasteError","Error"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/errors/PasteError.ts"],"names":["PasteError","Error"],"mappings":";;AAAA,MAAMA,UAAN,SAAyBC,KAAzB,CAA+B;AAAA;AAAA;;AAAA,0CACd,IADc;AAAA;;AAAA;;AAI/B,eAAeD,UAAf","sourcesContent":["class PasteError extends Error {\n isPasteError = true;\n}\n\nexport default PasteError;\n"],"file":"PasteError.js"}
|
package/dist/errors/index.js
CHANGED
package/dist/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/index.ts"],"names":["default","PasteError"],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/errors/index.ts"],"names":["default","PasteError"],"mappings":"AAAA;SACSA,OAAO,IAAIC,U","sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport { default as PasteError } from './PasteError';\n"],"file":"index.js"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { default as Grid } from
|
|
2
|
-
export { default as GridMetricCalculator } from
|
|
3
|
-
export { default as GridModel } from
|
|
4
|
-
export { default as GridMouseHandler } from
|
|
5
|
-
export { default as GridRange } from
|
|
6
|
-
export { default as GridRenderer } from
|
|
7
|
-
export { default as GridTestUtils } from
|
|
8
|
-
export { default as GridTheme } from
|
|
9
|
-
export { default as GridUtils } from
|
|
10
|
-
export { default as KeyHandler } from
|
|
11
|
-
export { default as MockGridModel } from
|
|
12
|
-
export { default as MockTreeGridModel } from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
1
|
+
export { default as Grid } from "./Grid.js";
|
|
2
|
+
export { default as GridMetricCalculator } from "./GridMetricCalculator.js";
|
|
3
|
+
export { default as GridModel } from "./GridModel.js";
|
|
4
|
+
export { default as GridMouseHandler } from "./GridMouseHandler.js";
|
|
5
|
+
export { default as GridRange } from "./GridRange.js";
|
|
6
|
+
export { default as GridRenderer } from "./GridRenderer.js";
|
|
7
|
+
export { default as GridTestUtils } from "./GridTestUtils.js";
|
|
8
|
+
export { default as GridTheme } from "./GridTheme.js";
|
|
9
|
+
export { default as GridUtils } from "./GridUtils.js";
|
|
10
|
+
export { default as KeyHandler } from "./KeyHandler.js";
|
|
11
|
+
export { default as MockGridModel } from "./MockGridModel.js";
|
|
12
|
+
export { default as MockTreeGridModel } from "./MockTreeGridModel.js";
|
|
13
|
+
export * from "./key-handlers/index.js";
|
|
14
|
+
export * from "./mouse-handlers/index.js";
|
|
15
|
+
export * from "./errors/index.js";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["default","Grid","GridMetricCalculator","GridModel","GridMouseHandler","GridRange","GridRenderer","GridTestUtils","GridTheme","GridUtils","KeyHandler","MockGridModel","MockTreeGridModel"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["default","Grid","GridMetricCalculator","GridModel","GridMouseHandler","GridRange","GridRenderer","GridTestUtils","GridTheme","GridUtils","KeyHandler","MockGridModel","MockTreeGridModel"],"mappings":"SAASA,OAAO,IAAIC,I;SACXD,OAAO,IAAIE,oB;SACXF,OAAO,IAAIG,S;SACXH,OAAO,IAAII,gB;SACXJ,OAAO,IAAIK,S;SACXL,OAAO,IAAIM,Y;SACXN,OAAO,IAAIO,a;SACXP,OAAO,IAAIQ,S;SACXR,OAAO,IAAIS,S;SACXT,OAAO,IAAIU,U;SACXV,OAAO,IAAIW,a;SACXX,OAAO,IAAIY,iB","sourcesContent":["export { default as Grid } from './Grid';\nexport { default as GridMetricCalculator } from './GridMetricCalculator';\nexport { default as GridModel } from './GridModel';\nexport { default as GridMouseHandler } from './GridMouseHandler';\nexport { default as GridRange } from './GridRange';\nexport { default as GridRenderer } from './GridRenderer';\nexport { default as GridTestUtils } from './GridTestUtils';\nexport { default as GridTheme } from './GridTheme';\nexport { default as GridUtils } from './GridUtils';\nexport { default as KeyHandler } from './KeyHandler';\nexport { default as MockGridModel } from './MockGridModel';\nexport { default as MockTreeGridModel } from './MockTreeGridModel';\nexport * from './key-handlers';\nexport * from './mouse-handlers';\nexport * from './errors';\n"],"file":"index.js"}
|