@worktile/theia 20.2.8 → 20.2.9

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.
@@ -10280,17 +10280,16 @@ class TheTable extends TheBaseElement {
10280
10280
  }
10281
10281
  else {
10282
10282
  if (this.readonly) {
10283
+ cellsWidth = getColumnsWidth(headerRow);
10283
10284
  // 预览模式且没有colgroup,使用数据行的宽度计算固定列宽
10284
- const dataRow = this.tbodyElement.nativeElement.childNodes[1];
10285
- cellsWidth = getColumnsWidth(dataRow);
10286
- gridColumns = getGridColumns(dataRow, cellsWidth);
10285
+ gridColumns = getGridColumns(headerRow, cellsWidth);
10287
10286
  }
10288
10287
  else {
10289
10288
  const columnCount = this.element.children[0].children.length;
10290
10289
  const percent = +(100 / columnCount).toFixed(4);
10291
10290
  cellsWidth = new Array(columnCount).fill(percent);
10292
10291
  gridColumns = getGridColumns(headerRow, cellsWidth, '%');
10293
- colControlGridColumns = getGridColumns(colControl, getColumnsWidth(colControl));
10292
+ colControlGridColumns = gridColumns;
10294
10293
  }
10295
10294
  }
10296
10295
  const tablePadding = 44;
@@ -10724,7 +10723,7 @@ class TheTable extends TheBaseElement {
10724
10723
  const buffer = this.isInTable ? -TABLE_CONTROL : 0;
10725
10724
  if (this.isStickyTop) {
10726
10725
  this.getWrapperWidthAndLeft();
10727
- const controlButtonBorder = 1;
10726
+ const controlButtonBorder = this.element.options?.numberedColumn ? 1 : 0;
10728
10727
  stickyRows.forEach((element) => {
10729
10728
  this.renderer.setStyle(element, 'left', `${this.tableWrapperLeft + (this.readonly ? 0 : this.getColControlButtonWidth() - controlButtonBorder)}px`);
10730
10729
  });
@@ -10799,13 +10798,13 @@ class TheTable extends TheBaseElement {
10799
10798
  return;
10800
10799
  }
10801
10800
  const tableRect = this.nativeElement.getBoundingClientRect();
10802
- const viewportHeight = this.getViewportHeight();
10801
+ const viewportBottom = this.getViewportBottom();
10803
10802
  const scrollbarBottomPosition = tableRect.bottom;
10804
10803
  // 是否在可视范围内
10805
- const isScrollbarOutOfView = scrollbarBottomPosition > viewportHeight && tableRect.top < viewportHeight;
10806
- this.setScrollbarFixed(isScrollbarOutOfView, viewportHeight);
10804
+ const isScrollbarOutOfView = scrollbarBottomPosition > viewportBottom && tableRect.top < viewportBottom;
10805
+ this.setScrollbarFixed(isScrollbarOutOfView, viewportBottom);
10807
10806
  }
10808
- getViewportHeight() {
10807
+ getViewportBottom() {
10809
10808
  try {
10810
10809
  const scrollContainer = this.contextService.getScrollContainer();
10811
10810
  if (scrollContainer && scrollContainer !== document.documentElement && scrollContainer !== document.body) {
@@ -10826,7 +10825,7 @@ class TheTable extends TheBaseElement {
10826
10825
  return window.innerHeight;
10827
10826
  }
10828
10827
  }
10829
- setScrollbarFixed(fixed, viewportHeight) {
10828
+ setScrollbarFixed(fixed, viewportBottom) {
10830
10829
  if (!this.horizontalScrollbarContainer || this.disabledHorizontalScrollbarFixed()) {
10831
10830
  return;
10832
10831
  }
@@ -10840,11 +10839,13 @@ class TheTable extends TheBaseElement {
10840
10839
  this.renderer.addClass(scrollbar, 'fixed');
10841
10840
  this.renderer.setStyle(scrollbar, 'left', `${Math.max(0, tableRect.left / scaleX)}px`);
10842
10841
  this.renderer.setStyle(scrollbar, 'width', `${tableRect.width / scaleX}px`);
10842
+ this.renderer.setStyle(scrollbar, 'bottom', `${Math.max(0, window.innerHeight - viewportBottom)}px`);
10843
10843
  }
10844
10844
  else {
10845
10845
  this.renderer.removeClass(scrollbar, 'fixed');
10846
10846
  this.renderer.removeStyle(scrollbar, 'left');
10847
10847
  this.renderer.removeStyle(scrollbar, 'width');
10848
+ this.renderer.removeStyle(scrollbar, 'bottom');
10848
10849
  }
10849
10850
  requestAnimationFrame(() => {
10850
10851
  if (scrollbar.scrollLeft !== currentScrollLeft) {
@@ -11190,7 +11191,8 @@ class TheQuickInsert {
11190
11191
  !this.isRichMediaScope()) {
11191
11192
  const block = Node.ancestor(editor, [editor?.selection?.anchor.path[0]]);
11192
11193
  const rootNode = AngularEditor.toDOMNode(editor, block);
11193
- this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11194
+ const editorDom = AngularEditor.toDOMNode(editor, editor);
11195
+ this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop + editorDom.offsetTop);
11194
11196
  return;
11195
11197
  }
11196
11198
  this.addHiddenClass();