@deephaven/grid 0.7.0 → 0.7.1-beta.13
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/Grid.css +0 -1
- package/dist/Grid.css.map +1 -1
- package/dist/Grid.d.ts +3 -13
- package/dist/Grid.d.ts.map +1 -1
- package/dist/GridMetricCalculator.d.ts +448 -165
- package/dist/GridMetricCalculator.d.ts.map +1 -1
- package/dist/GridMetricCalculator.js +523 -119
- package/dist/GridMetricCalculator.js.map +1 -1
- package/dist/GridMetrics.d.ts +97 -0
- package/dist/GridMetrics.d.ts.map +1 -0
- package/dist/GridMetrics.js +2 -0
- package/dist/GridMetrics.js.map +1 -0
- package/dist/GridRange.d.ts +186 -111
- package/dist/GridRange.d.ts.map +1 -1
- package/dist/GridRange.js +185 -87
- package/dist/GridRange.js.map +1 -1
- package/dist/GridRenderer.js +6 -1
- package/dist/GridRenderer.js.map +1 -1
- package/dist/GridTheme.d.ts +49 -37
- package/dist/GridTheme.d.ts.map +1 -1
- package/dist/GridTheme.js +8 -0
- package/dist/GridTheme.js.map +1 -1
- package/dist/GridUtils.d.ts +236 -97
- package/dist/GridUtils.d.ts.map +1 -1
- package/dist/GridUtils.js +240 -75
- package/dist/GridUtils.js.map +1 -1
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.d.ts +1 -1
- package/dist/mouse-handlers/GridRowSeparatorMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridSelectionMouseHandler.js +4 -4
- package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/GridRange.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
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; }
|
|
2
2
|
|
|
3
|
+
// Also exported via GridRange.SELECTION_DIRECTION
|
|
4
|
+
export var SELECTION_DIRECTION;
|
|
5
|
+
|
|
6
|
+
(function (SELECTION_DIRECTION) {
|
|
7
|
+
SELECTION_DIRECTION["DOWN"] = "DOWN";
|
|
8
|
+
SELECTION_DIRECTION["UP"] = "UP";
|
|
9
|
+
SELECTION_DIRECTION["LEFT"] = "LEFT";
|
|
10
|
+
SELECTION_DIRECTION["RIGHT"] = "RIGHT";
|
|
11
|
+
})(SELECTION_DIRECTION || (SELECTION_DIRECTION = {}));
|
|
12
|
+
|
|
3
13
|
class GridRange {
|
|
14
|
+
/**
|
|
15
|
+
* Returns a normalized array of indexes ensuring left <= right and top <= bottom
|
|
16
|
+
* @param startColumn Start column index
|
|
17
|
+
* @param startRow Start row index
|
|
18
|
+
* @param endColumn End column index
|
|
19
|
+
* @param endRow End row index
|
|
20
|
+
* @returns Array containing normalized indexes [left, top, right, bottom]
|
|
21
|
+
*/
|
|
4
22
|
static normalize(startColumn, startRow, endColumn, endRow) {
|
|
5
23
|
var left = startColumn;
|
|
6
24
|
var top = startRow;
|
|
@@ -19,43 +37,84 @@ class GridRange {
|
|
|
19
37
|
|
|
20
38
|
return [left, top, right, bottom];
|
|
21
39
|
}
|
|
22
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Makes a GridRange ensuring startColumn <= endColumn, startRow <= endRow
|
|
42
|
+
* @param startColumn Start column index
|
|
43
|
+
* @param startRow Start row index
|
|
44
|
+
* @param endColumn End column index
|
|
45
|
+
* @param endRow End row index
|
|
46
|
+
* @returns Normalized GridRange
|
|
47
|
+
*/
|
|
23
48
|
|
|
24
49
|
|
|
25
|
-
static makeNormalized() {
|
|
26
|
-
return new GridRange(...GridRange.normalize(
|
|
50
|
+
static makeNormalized(startColumn, startRow, endColumn, endRow) {
|
|
51
|
+
return new GridRange(...GridRange.normalize(startColumn, startRow, endColumn, endRow));
|
|
27
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a GridRange representing a single cell
|
|
55
|
+
* @param column Column index
|
|
56
|
+
* @param row Row index
|
|
57
|
+
* @returns GridRange representing the cell
|
|
58
|
+
*/
|
|
59
|
+
|
|
28
60
|
|
|
29
61
|
static makeCell(column, row) {
|
|
30
62
|
return new GridRange(column, row, column, row);
|
|
31
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a GridRange representing an infinite length column
|
|
66
|
+
* @param column Column index
|
|
67
|
+
* @returns GridRange representing the column
|
|
68
|
+
*/
|
|
69
|
+
|
|
32
70
|
|
|
33
71
|
static makeColumn(column) {
|
|
34
72
|
return new GridRange(column, null, column, null);
|
|
35
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates a GridRange representing an infinite length row
|
|
76
|
+
* @param row Row index
|
|
77
|
+
* @returns GridRange representing the row
|
|
78
|
+
*/
|
|
79
|
+
|
|
36
80
|
|
|
37
81
|
static makeRow(row) {
|
|
38
82
|
return new GridRange(null, row, null, row);
|
|
39
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns the minimum value between 2 range indexes or null if at least 1 is null
|
|
86
|
+
* @param index1 First grid range index
|
|
87
|
+
* @param index2 Second grid range index
|
|
88
|
+
* @returns Minimum index or null if either index is null
|
|
89
|
+
*/
|
|
40
90
|
|
|
41
|
-
|
|
42
|
-
|
|
91
|
+
|
|
92
|
+
static minOrNull(index1, index2) {
|
|
93
|
+
if (index1 == null || index2 == null) {
|
|
43
94
|
return null;
|
|
44
95
|
}
|
|
45
96
|
|
|
46
|
-
return Math.min(
|
|
97
|
+
return Math.min(index1, index2);
|
|
47
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns the maximum value between 2 range indexes or null if at least 1 is null
|
|
101
|
+
* @param index1 First grid range index
|
|
102
|
+
* @param index2 Second grid range index
|
|
103
|
+
* @returns Maximum index or null if either index is null
|
|
104
|
+
*/
|
|
105
|
+
|
|
48
106
|
|
|
49
|
-
static maxOrNull(
|
|
50
|
-
if (
|
|
107
|
+
static maxOrNull(index1, index2) {
|
|
108
|
+
if (index1 == null || index2 == null) {
|
|
51
109
|
return null;
|
|
52
110
|
}
|
|
53
111
|
|
|
54
|
-
return Math.max(
|
|
112
|
+
return Math.max(index1, index2);
|
|
55
113
|
}
|
|
56
114
|
/**
|
|
57
115
|
* Consolidate the passed in ranges to the minimum set, merging overlapping ranges.
|
|
58
|
-
* @param
|
|
116
|
+
* @param ranges The ranges to consolidate
|
|
117
|
+
* @returns Consolidated ranges
|
|
59
118
|
*/
|
|
60
119
|
|
|
61
120
|
|
|
@@ -117,46 +176,65 @@ class GridRange {
|
|
|
117
176
|
|
|
118
177
|
return result;
|
|
119
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Checks if the 1-D ranges between 2 index pairs overlap or are continuous.
|
|
181
|
+
* For example ranges [0, 1] and [2, 3] are continuous and will return true.
|
|
182
|
+
* [0, 1] and [1, 3] overlap and return true.
|
|
183
|
+
* [0, 1] and [3, 4] do not overlap and have a gap so this will return false.
|
|
184
|
+
* @param start1 Start of 1st range
|
|
185
|
+
* @param end1 End of 1st range
|
|
186
|
+
* @param start2 Start of 2nd range
|
|
187
|
+
* @param end2 End of 2nd range
|
|
188
|
+
* @returns True if the ranges overlap or touch, else false
|
|
189
|
+
*/
|
|
190
|
+
|
|
120
191
|
|
|
121
|
-
static isAxisRangeTouching(
|
|
122
|
-
if (
|
|
123
|
-
if (
|
|
192
|
+
static isAxisRangeTouching(start1, end1, start2, end2) {
|
|
193
|
+
if (start1 == null) {
|
|
194
|
+
if (end1 == null) {
|
|
124
195
|
return true;
|
|
125
196
|
}
|
|
126
197
|
|
|
127
|
-
if (
|
|
198
|
+
if (start2 == null) {
|
|
128
199
|
return true;
|
|
129
200
|
}
|
|
130
201
|
|
|
131
|
-
return
|
|
202
|
+
return start2 <= end1 + 1;
|
|
132
203
|
}
|
|
133
204
|
|
|
134
|
-
if (
|
|
135
|
-
if (
|
|
205
|
+
if (end1 == null) {
|
|
206
|
+
if (end2 == null) {
|
|
136
207
|
return true;
|
|
137
208
|
}
|
|
138
209
|
|
|
139
|
-
return
|
|
210
|
+
return end2 >= start1 - 1;
|
|
140
211
|
}
|
|
141
212
|
|
|
142
|
-
if (
|
|
143
|
-
if (
|
|
213
|
+
if (start2 == null) {
|
|
214
|
+
if (end2 == null) {
|
|
144
215
|
return true;
|
|
145
216
|
}
|
|
146
217
|
|
|
147
|
-
return
|
|
218
|
+
return start1 <= end2 + 1;
|
|
148
219
|
}
|
|
149
220
|
|
|
150
|
-
if (
|
|
151
|
-
return
|
|
221
|
+
if (end2 == null) {
|
|
222
|
+
return end1 >= start2 - 1;
|
|
152
223
|
}
|
|
153
224
|
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
225
|
+
if (start2 >= start1 - 1) {
|
|
226
|
+
return start2 <= end1 + 1;
|
|
156
227
|
}
|
|
157
228
|
|
|
158
|
-
return
|
|
229
|
+
return end2 >= start1 - 1;
|
|
159
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Checks if 2 arrays of ranges are the same ranges
|
|
233
|
+
* @param ranges1 First array of ranges
|
|
234
|
+
* @param ranges2 Second array of ranges
|
|
235
|
+
* @returns True if the arrays contain the same ranges in the same order
|
|
236
|
+
*/
|
|
237
|
+
|
|
160
238
|
|
|
161
239
|
static rangeArraysEqual(ranges1, ranges2) {
|
|
162
240
|
if (ranges1 === ranges2) {
|
|
@@ -177,14 +255,14 @@ class GridRange {
|
|
|
177
255
|
}
|
|
178
256
|
/**
|
|
179
257
|
* Get the intersection (overlapping area) of two ranges
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
182
|
-
* @returns
|
|
258
|
+
* @param range One range to check for the intersection
|
|
259
|
+
* @param otherRange The other range to check for the intersection
|
|
260
|
+
* @returns Intersection of the two ranges. If they do not intersect, returns `null`.
|
|
183
261
|
*/
|
|
184
262
|
|
|
185
263
|
|
|
186
264
|
static intersection(range, otherRange) {
|
|
187
|
-
var _startColumn2, _endColumn2, _startRow2, _endRow2;
|
|
265
|
+
var _startColumn2, _endColumn2, _startRow2, _endRow2, _endColumn3, _endRow3;
|
|
188
266
|
|
|
189
267
|
if (range.equals(otherRange)) {
|
|
190
268
|
return range;
|
|
@@ -201,16 +279,17 @@ class GridRange {
|
|
|
201
279
|
startRow = startRow != null && otherRange.startRow != null ? Math.max(startRow, otherRange.startRow) : (_startRow2 = startRow) !== null && _startRow2 !== void 0 ? _startRow2 : otherRange.startRow;
|
|
202
280
|
endRow = endRow != null && otherRange.endRow != null ? Math.min(endRow, otherRange.endRow) : (_endRow2 = endRow) !== null && _endRow2 !== void 0 ? _endRow2 : otherRange.endRow;
|
|
203
281
|
|
|
204
|
-
if (startColumn != null && startColumn > endColumn || startRow != null && startRow > endRow) {
|
|
282
|
+
if (startColumn != null && startColumn > ((_endColumn3 = endColumn) !== null && _endColumn3 !== void 0 ? _endColumn3 : -1) || startRow != null && startRow > ((_endRow3 = endRow) !== null && _endRow3 !== void 0 ? _endRow3 : -1)) {
|
|
205
283
|
return null;
|
|
206
284
|
}
|
|
207
285
|
|
|
208
286
|
return new GridRange(startColumn, startRow, endColumn, endRow);
|
|
209
287
|
}
|
|
210
288
|
/**
|
|
211
|
-
*
|
|
212
|
-
* @param
|
|
213
|
-
* @
|
|
289
|
+
* Subtracts 1 range from another
|
|
290
|
+
* @param range The range to be subtracted from
|
|
291
|
+
* @param subtractRange The range to subtract from within this range
|
|
292
|
+
* @returns The ranges needed to represent the remaining
|
|
214
293
|
*/
|
|
215
294
|
|
|
216
295
|
|
|
@@ -248,9 +327,9 @@ class GridRange {
|
|
|
248
327
|
}
|
|
249
328
|
/**
|
|
250
329
|
* Subtract a range from multiple ranges
|
|
251
|
-
* @param
|
|
252
|
-
* @param
|
|
253
|
-
* @returns
|
|
330
|
+
* @param ranges The ranges to be subtracted from
|
|
331
|
+
* @param subtractRange The range to subtract from within these ranges
|
|
332
|
+
* @returns The ranges needed to represent the remaining
|
|
254
333
|
*/
|
|
255
334
|
|
|
256
335
|
|
|
@@ -265,9 +344,9 @@ class GridRange {
|
|
|
265
344
|
}
|
|
266
345
|
/**
|
|
267
346
|
* Subtract multiple ranges from multiple ranges
|
|
268
|
-
* @param
|
|
269
|
-
* @param
|
|
270
|
-
* @returns
|
|
347
|
+
* @param ranges The ranges to be subtracted from
|
|
348
|
+
* @param subtractRanges The ranges to subtract from within these ranges
|
|
349
|
+
* @returns The ranges needed to represent the remaining
|
|
271
350
|
*/
|
|
272
351
|
|
|
273
352
|
|
|
@@ -286,8 +365,8 @@ class GridRange {
|
|
|
286
365
|
}
|
|
287
366
|
/**
|
|
288
367
|
* Test if a given range is bounded (all values are non-null)
|
|
289
|
-
* @param
|
|
290
|
-
* @returns
|
|
368
|
+
* @param range The range to test
|
|
369
|
+
* @returns True if this range is bounded, false otherwise
|
|
291
370
|
*/
|
|
292
371
|
|
|
293
372
|
|
|
@@ -298,10 +377,10 @@ class GridRange {
|
|
|
298
377
|
* Converts any GridRange passed in that is a full row or column selection to be bound
|
|
299
378
|
* to the `columnCount` and `rowCount` passed in
|
|
300
379
|
*
|
|
301
|
-
* @param
|
|
302
|
-
* @param
|
|
303
|
-
* @param
|
|
304
|
-
* @returns
|
|
380
|
+
* @param range The range to get the bounded range of
|
|
381
|
+
* @param columnCount The number of columns
|
|
382
|
+
* @param rowCount The number of rows
|
|
383
|
+
* @returns The passed in GridRange with any null values filled in
|
|
305
384
|
*/
|
|
306
385
|
|
|
307
386
|
|
|
@@ -317,10 +396,10 @@ class GridRange {
|
|
|
317
396
|
/**
|
|
318
397
|
* Converts the GridRanges passed in to be bound to the `columnCount` and `rowCount` passed in
|
|
319
398
|
*
|
|
320
|
-
* @param
|
|
321
|
-
* @param
|
|
322
|
-
* @param
|
|
323
|
-
* @returns
|
|
399
|
+
* @param ranges The ranges to get the bounded ranges of
|
|
400
|
+
* @param columnCount The number of columns
|
|
401
|
+
* @param rowCount The number of rows
|
|
402
|
+
* @returns The passed in GridRange with any null values filled in
|
|
324
403
|
*/
|
|
325
404
|
|
|
326
405
|
|
|
@@ -330,10 +409,10 @@ class GridRange {
|
|
|
330
409
|
/**
|
|
331
410
|
* Offsets a GridRange by the specified amount in the x and y directions
|
|
332
411
|
*
|
|
333
|
-
* @param
|
|
334
|
-
* @param
|
|
335
|
-
* @param
|
|
336
|
-
* @returns
|
|
412
|
+
* @param range The range to offset
|
|
413
|
+
* @param columnOffset The number of columns to offset
|
|
414
|
+
* @param rowOffset The number of rows to offset
|
|
415
|
+
* @returns The new grid range offset from the original
|
|
337
416
|
*/
|
|
338
417
|
|
|
339
418
|
|
|
@@ -342,11 +421,11 @@ class GridRange {
|
|
|
342
421
|
}
|
|
343
422
|
/**
|
|
344
423
|
* Get the next cell given the selected ranges and the current cell
|
|
345
|
-
* @param
|
|
346
|
-
* @param
|
|
347
|
-
* @param
|
|
348
|
-
* @param
|
|
349
|
-
* @returns
|
|
424
|
+
* @param ranges The selected bounded ranges within the grid
|
|
425
|
+
* @param column The cursor column, or null if none focused
|
|
426
|
+
* @param row The cursor row, or null if none focused
|
|
427
|
+
* @param direction The direction in which to select next
|
|
428
|
+
* @returns The next cell to focus, or null if there should be no more focus
|
|
350
429
|
*/
|
|
351
430
|
|
|
352
431
|
|
|
@@ -399,8 +478,8 @@ class GridRange {
|
|
|
399
478
|
}
|
|
400
479
|
/**
|
|
401
480
|
* Count the number of cells in the provided grid ranges
|
|
402
|
-
* @param
|
|
403
|
-
* @returns
|
|
481
|
+
* @param ranges The ranges to count the rows of
|
|
482
|
+
* @returns The number of cells in the ranges, or `NaN` if any of the ranges were unbounded
|
|
404
483
|
*/
|
|
405
484
|
|
|
406
485
|
|
|
@@ -413,8 +492,8 @@ class GridRange {
|
|
|
413
492
|
}
|
|
414
493
|
/**
|
|
415
494
|
* Count the number of rows in the provided grid ranges
|
|
416
|
-
* @param
|
|
417
|
-
* @returns
|
|
495
|
+
* @param ranges The ranges to count the rows of
|
|
496
|
+
* @returns The number of rows in the ranges, or `NaN` if any of the ranges were unbounded
|
|
418
497
|
*/
|
|
419
498
|
|
|
420
499
|
|
|
@@ -427,8 +506,8 @@ class GridRange {
|
|
|
427
506
|
}
|
|
428
507
|
/**
|
|
429
508
|
* Count the number of columns in the provided grid ranges
|
|
430
|
-
* @param
|
|
431
|
-
* @returns
|
|
509
|
+
* @param ranges The ranges to count the columns of
|
|
510
|
+
* @returns The number of columns in the ranges, or `NaN` if any of the ranges were unbounded
|
|
432
511
|
*/
|
|
433
512
|
|
|
434
513
|
|
|
@@ -441,10 +520,10 @@ class GridRange {
|
|
|
441
520
|
}
|
|
442
521
|
/**
|
|
443
522
|
* Check if the provided ranges contain the provided cell
|
|
444
|
-
* @param
|
|
445
|
-
* @param
|
|
446
|
-
* @param
|
|
447
|
-
* @returns
|
|
523
|
+
* @param ranges The ranges to check
|
|
524
|
+
* @param column The column index
|
|
525
|
+
* @param row The row index
|
|
526
|
+
* @returns True if the cell is within the provided ranges, false otherwise.
|
|
448
527
|
*/
|
|
449
528
|
|
|
450
529
|
|
|
@@ -461,7 +540,7 @@ class GridRange {
|
|
|
461
540
|
}
|
|
462
541
|
/**
|
|
463
542
|
* Iterate through each cell in the provided ranges
|
|
464
|
-
* @param
|
|
543
|
+
* @param ranges The ranges to iterate through
|
|
465
544
|
* @param {(column: number, row: number, index: number) => void} callback The callback to execute. `index` is the index within that range
|
|
466
545
|
* @param {GridRange.SELECTION_DIRECTION} direction The direction to iterate in
|
|
467
546
|
*/
|
|
@@ -476,16 +555,34 @@ class GridRange {
|
|
|
476
555
|
}
|
|
477
556
|
|
|
478
557
|
constructor(startColumn, startRow, endColumn, endRow) {
|
|
558
|
+
_defineProperty(this, "startColumn", void 0);
|
|
559
|
+
|
|
560
|
+
_defineProperty(this, "startRow", void 0);
|
|
561
|
+
|
|
562
|
+
_defineProperty(this, "endColumn", void 0);
|
|
563
|
+
|
|
564
|
+
_defineProperty(this, "endRow", void 0);
|
|
565
|
+
|
|
479
566
|
this.startColumn = startColumn;
|
|
480
567
|
this.startRow = startRow;
|
|
481
568
|
this.endColumn = endColumn;
|
|
482
569
|
this.endRow = endRow;
|
|
483
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Checks if the provided range is equivalent to this range (same start and end column/row indexes)
|
|
573
|
+
* @param other Grid range to check against
|
|
574
|
+
* @returns True if the ranges cover the same area
|
|
575
|
+
*/
|
|
576
|
+
|
|
484
577
|
|
|
485
578
|
equals(other) {
|
|
486
579
|
return this.startColumn === other.startColumn && this.startRow === other.startRow && this.endColumn === other.endColumn && this.endRow === other.endRow;
|
|
487
580
|
}
|
|
488
|
-
/**
|
|
581
|
+
/**
|
|
582
|
+
* Checks if this GridRange contains another range
|
|
583
|
+
* @param other The range to check
|
|
584
|
+
* @returns True if this GridRange completely contains `other`
|
|
585
|
+
* */
|
|
489
586
|
|
|
490
587
|
|
|
491
588
|
contains(other) {
|
|
@@ -493,9 +590,9 @@ class GridRange {
|
|
|
493
590
|
}
|
|
494
591
|
/**
|
|
495
592
|
* Check if the provided cell is in this range
|
|
496
|
-
* @param
|
|
497
|
-
* @param
|
|
498
|
-
* @returns
|
|
593
|
+
* @param column The column to check
|
|
594
|
+
* @param row The row to check
|
|
595
|
+
* @returns True if this cell is within this range
|
|
499
596
|
*/
|
|
500
597
|
|
|
501
598
|
|
|
@@ -506,15 +603,21 @@ class GridRange {
|
|
|
506
603
|
|
|
507
604
|
return (this.startColumn == null || this.startColumn <= column) && (this.endColumn == null || this.endColumn >= column) && (this.startRow == null || this.startRow <= row) && (this.endRow == null || this.endRow >= row);
|
|
508
605
|
}
|
|
509
|
-
/**
|
|
606
|
+
/**
|
|
607
|
+
* Check if the provided range touches (or overlaps) this GridRange
|
|
608
|
+
* Effectively checks if the 2 ranges could be represented by 1 continuous range
|
|
609
|
+
* @param other The range to check
|
|
610
|
+
* @returns True if this GridRange touches `other`
|
|
611
|
+
* */
|
|
510
612
|
|
|
511
613
|
|
|
512
614
|
touches(other) {
|
|
513
615
|
return GridRange.isAxisRangeTouching(this.startRow, this.endRow, other.startRow, other.endRow) && GridRange.isAxisRangeTouching(this.startColumn, this.endColumn, other.startColumn, other.endColumn);
|
|
514
616
|
}
|
|
515
617
|
/**
|
|
516
|
-
*
|
|
517
|
-
* @
|
|
618
|
+
* Subtracts a range from this range
|
|
619
|
+
* @param other The range to deselect from within this range
|
|
620
|
+
* @returns The ranges needed to represent the remaining
|
|
518
621
|
*/
|
|
519
622
|
|
|
520
623
|
|
|
@@ -524,8 +627,8 @@ class GridRange {
|
|
|
524
627
|
/**
|
|
525
628
|
* Get the first cell in this range. Throws if this range is unbounded.
|
|
526
629
|
*
|
|
527
|
-
* @param
|
|
528
|
-
* @returns
|
|
630
|
+
* @param direction The direction to get the starting cell in. Defaults to DOWN
|
|
631
|
+
* @returns The first cell in this range in the direction specified
|
|
529
632
|
*/
|
|
530
633
|
|
|
531
634
|
|
|
@@ -663,8 +766,8 @@ class GridRange {
|
|
|
663
766
|
}
|
|
664
767
|
/**
|
|
665
768
|
* Iterate through each cell in the range
|
|
666
|
-
* @param
|
|
667
|
-
* @param
|
|
769
|
+
* @param callback Callback to execute. `index` is the index within this range
|
|
770
|
+
* @param direction The direction to iterate in
|
|
668
771
|
*/
|
|
669
772
|
|
|
670
773
|
|
|
@@ -690,12 +793,7 @@ class GridRange {
|
|
|
690
793
|
|
|
691
794
|
}
|
|
692
795
|
|
|
693
|
-
_defineProperty(GridRange, "SELECTION_DIRECTION",
|
|
694
|
-
DOWN: 'DOWN',
|
|
695
|
-
UP: 'UP',
|
|
696
|
-
LEFT: 'LEFT',
|
|
697
|
-
RIGHT: 'RIGHT'
|
|
698
|
-
}));
|
|
796
|
+
_defineProperty(GridRange, "SELECTION_DIRECTION", SELECTION_DIRECTION);
|
|
699
797
|
|
|
700
798
|
export default GridRange;
|
|
701
799
|
//# sourceMappingURL=GridRange.js.map
|