@worktile/theia 14.3.19 → 14.3.21

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.
@@ -11333,6 +11333,9 @@ class TableStore {
11333
11333
  });
11334
11334
  }
11335
11335
  calculateSelectedColumnsAndRowIndex() {
11336
+ if (!this.editor?.selection) {
11337
+ return;
11338
+ }
11336
11339
  const pos = this.createTablePosition();
11337
11340
  if (!pos?.table) {
11338
11341
  return;
@@ -11367,7 +11370,7 @@ class TableStore {
11367
11370
  }
11368
11371
  }
11369
11372
  setSelectedCells(cells, pos) {
11370
- const uniqueCells = this.uniqueCellPosition(cells);
11373
+ const uniqueCells = this.pointerSelection ? this.uniqueCellPosition(cells) : cells;
11371
11374
  const cellElements = uniqueCells.map(cell => {
11372
11375
  return pos.findCellByPath(cell);
11373
11376
  });
@@ -11382,14 +11385,11 @@ class TableStore {
11382
11385
  * @returns
11383
11386
  */
11384
11387
  uniqueCellPosition(cells) {
11385
- let result = [];
11386
- if (this.pointerSelection) {
11387
- const modCells = new Set();
11388
- cells.concat(this.selectedCellPositions).forEach(cell => modCells.add(JSON.stringify(cell)));
11389
- modCells.forEach((cell) => result.push(JSON.parse(cell)));
11390
- return result;
11391
- }
11392
- return cells;
11388
+ const result = [];
11389
+ const modCells = new Set();
11390
+ cells.concat(this.selectedCellPositions).forEach(cell => modCells.add(JSON.stringify(cell)));
11391
+ modCells.forEach((cell) => result.push(JSON.parse(cell)));
11392
+ return result;
11393
11393
  }
11394
11394
  /**
11395
11395
  * 获取一定范围内所有的单元格