@ai-table/grid 0.5.5 → 0.5.7

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.
@@ -8838,6 +8838,15 @@ class AITableScrollableGroup {
8838
8838
  const scrollY = this.scrollY();
8839
8839
  this.scrollPosition.emit({ scrollX, scrollY });
8840
8840
  });
8841
+ // 监听bgName变化,当cell切换时重置滚动位置
8842
+ effect(() => {
8843
+ const currentBgName = this.config().bgName;
8844
+ if (this.previousBgName !== undefined && this.previousBgName !== currentBgName) {
8845
+ this.scrollX.set(0);
8846
+ this.scrollY.set(0);
8847
+ }
8848
+ this.previousBgName = currentBgName;
8849
+ });
8841
8850
  }
8842
8851
  ngAfterViewInit() {
8843
8852
  this.contentTemplate().getNode().moveTo(this.contentGroup.getNode());
@@ -14843,10 +14852,20 @@ class AITableGrid extends AITableGridBase {
14843
14852
  this.resetScrolling();
14844
14853
  }
14845
14854
  setContainerRect() {
14855
+ const offsetWidth = this.containerElement().offsetWidth;
14856
+ const offsetHeight = this.containerElement().offsetHeight;
14846
14857
  this.containerRect.set({
14847
- width: this.containerElement().offsetWidth,
14848
- height: this.containerElement().offsetHeight
14858
+ width: offsetWidth,
14859
+ height: offsetHeight
14849
14860
  });
14861
+ console.log('setContainerRect, offsetWidth: ', offsetWidth, 'offsetHeight: ', offsetHeight);
14862
+ setTimeout(() => {
14863
+ this.containerRect.set({
14864
+ width: offsetWidth,
14865
+ height: offsetHeight
14866
+ });
14867
+ console.log('setContainerRect(setTimeout), offsetWidth: ', offsetWidth, 'offsetHeight: ', offsetHeight);
14868
+ }, 1000);
14850
14869
  }
14851
14870
  containerResizeListener() {
14852
14871
  this.resizeObserver = new ResizeObserver(() => {