fantasy-ngzorro 2.2.35 → 2.2.36

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.
@@ -11772,12 +11772,19 @@
11772
11772
  return;
11773
11773
  }
11774
11774
  /** @type {?} */
11775
+ var prevHasX = !!(this.scroll && this.scroll.x);
11776
+ /** @type {?} */
11775
11777
  var prevHasY = !!(this.scroll && this.scroll.y);
11776
11778
  this.dealScroll();
11777
11779
  /** @type {?} */
11780
+ var nextHasX = !!(this.scroll && this.scroll.x);
11781
+ /** @type {?} */
11778
11782
  var nextHasY = !!(this.scroll && this.scroll.y);
11779
- // 运行中 y 从有变无/从无变有时,也必须重建,否则同步监听仍指向旧 DOM
11780
- if (prevHasY !== nextHasY) {
11783
+ // 运行中 x/y 从有变无/从无变有时,也必须重建:
11784
+ // - y:ng-zorro 只在 AfterViewInit 绑一次 header/body 同步
11785
+ // - x:空表 scroll.x=null(table-layout:auto)→ 有数据后设 scroll.x(fixed),
11786
+ // 不重建时勾选列仍按 auto 均摊撑开(收款编辑等异步灌数页)
11787
+ if (prevHasY !== nextHasY || prevHasX !== nextHasX) {
11781
11788
  this.showTable = false;
11782
11789
  this.cdr.markForCheck();
11783
11790
  setTimeout((/**
@@ -11790,6 +11797,8 @@
11790
11797
  * @return {?}
11791
11798
  */
11792
11799
  function () {
11800
+ _this.dealScroll();
11801
+ _this.cdr.markForCheck();
11793
11802
  _this.afterTableRender(useVirtual);
11794
11803
  }));
11795
11804
  }));
@@ -12714,6 +12723,14 @@
12714
12723
  var viewportCompare = this.nzTableComponent
12715
12724
  ? getTableScrollXViewportWidth(this.nzTableComponent)
12716
12725
  : 0;
12726
+ // 表体尚未量到宽时(异步灌数 / spin / 刚 remount),用宿主宽兜底
12727
+ if (viewportCompare <= 0 && this.hostEl && this.hostEl.nativeElement) {
12728
+ /** @type {?} */
12729
+ var hostW = ((/** @type {?} */ (this.hostEl.nativeElement))).offsetWidth;
12730
+ if (hostW > 0) {
12731
+ viewportCompare = hostW;
12732
+ }
12733
+ }
12717
12734
  if (viewportCompare > 0) {
12718
12735
  if (declaredColWidth > viewportCompare + 1) {
12719
12736
  return {
@@ -12738,10 +12755,10 @@
12738
12755
  isFluid: true,
12739
12756
  };
12740
12757
  }
12741
- /** @type {?} */
12742
- var autoScroll = resolveAutoTableScroll(this.nzTableComponent, this.hasTableData(), declaredColWidth);
12758
+ // 视口仍测不到:至少用声明宽设 scroll.x,强制 fixed 布局锁勾选列,
12759
+ // 避免落回 table-layout:auto 被均摊撑开;后续 sync/remount 再转 fluid。
12743
12760
  return {
12744
- scrollX: autoScroll ? autoScroll.x : null,
12761
+ scrollX: Math.ceil(declaredColWidth) + "px",
12745
12762
  fluidExtra: 0,
12746
12763
  displayTotal: declaredColWidth,
12747
12764
  isFluid: false,
@@ -12774,16 +12791,20 @@
12774
12791
  * @return {?}
12775
12792
  */
12776
12793
  function (item) {
12777
- if (item && item.isShow) {
12794
+ if (item && item.isShow !== false) {
12778
12795
  declared += item.width > 0 ? item.width : ColWidth.fixColWidth;
12779
12796
  }
12780
12797
  }));
12781
12798
  }
12782
12799
  /** @type {?} */
12800
+ var prevHasX = !!(this.scroll && this.scroll.x);
12801
+ /** @type {?} */
12783
12802
  var layout = this.resolveHorizontalLayout(declared);
12784
12803
  /** @type {?} */
12785
12804
  var currentY = this.scroll ? this.scroll.y : null;
12786
12805
  /** @type {?} */
12806
+ var nextHasX = !!layout.scrollX;
12807
+ /** @type {?} */
12787
12808
  var sameX = this.scroll && this.scroll.x === layout.scrollX;
12788
12809
  /** @type {?} */
12789
12810
  var sameExtra = this.fluidExtraWidth === layout.fluidExtra;
@@ -12806,6 +12827,11 @@
12806
12827
  this.tableColWidthTotal = layout.displayTotal;
12807
12828
  this.scroll = { x: layout.scrollX, y: currentY };
12808
12829
  this.cdr.markForCheck();
12830
+ // sync 阶段若补上了 scroll.x,需重建才能切到 fixed 布局
12831
+ if (prevHasX !== nextHasX) {
12832
+ this.applyTableScrollMode(true);
12833
+ return;
12834
+ }
12809
12835
  setTimeout((/**
12810
12836
  * @return {?}
12811
12837
  */
@@ -13136,7 +13162,7 @@
13136
13162
  if (!item.width) {
13137
13163
  item.width = ColWidth.fixColWidth;
13138
13164
  }
13139
- if (item.isShow) {
13165
+ if (item.isShow !== false) {
13140
13166
  item.fixedWidth = colWidth;
13141
13167
  colWidth += item.width;
13142
13168
  }
@@ -13147,7 +13173,7 @@
13147
13173
  for (var i = this.tableCols.length - 1; i >= 0; i--) {
13148
13174
  /** @type {?} */
13149
13175
  var item = this.tableCols[i];
13150
- if (!item.isShow) {
13176
+ if (item.isShow === false) {
13151
13177
  continue;
13152
13178
  }
13153
13179
  if (item.fixed === "right") {