fantasy-ngzorro 2.2.34 → 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.
@@ -11261,10 +11261,11 @@
11261
11261
  changes["tableData"]["currentValue"]["pageNumber"] !==
11262
11262
  changes["tableData"]["previousValue"]["pageNumber"]) {
11263
11263
  this.pendingResetScrollTop = true;
11264
- if (this.virtualScroll) {
11265
- // 仅虚拟/普通模式真正切换时重建,避免排序后数据刷新把排序态清掉
11266
- this.applyTableScrollMode(false);
11267
- }
11264
+ // pageSize/pageNumber 变化也要重算 scroll / fluid。
11265
+ // 业务常把 Page.pageSize 写成 content.length(如收款编辑 toPage),
11266
+ // virtualScroll=false 时若这里跳过,空表初始化后的 fluid 不会补上,勾选列被撑开。
11267
+ // applyTableScrollMode(false) 在模式未变时只 dealScroll,不会强制重建清排序态。
11268
+ this.applyTableScrollMode(false);
11268
11269
  // 翻页/改 pageSize:主动多次复位,覆盖 CDK 异步渲染时序
11269
11270
  this.scheduleResetTableBodyScrollTop();
11270
11271
  return;
@@ -11771,12 +11772,19 @@
11771
11772
  return;
11772
11773
  }
11773
11774
  /** @type {?} */
11775
+ var prevHasX = !!(this.scroll && this.scroll.x);
11776
+ /** @type {?} */
11774
11777
  var prevHasY = !!(this.scroll && this.scroll.y);
11775
11778
  this.dealScroll();
11776
11779
  /** @type {?} */
11780
+ var nextHasX = !!(this.scroll && this.scroll.x);
11781
+ /** @type {?} */
11777
11782
  var nextHasY = !!(this.scroll && this.scroll.y);
11778
- // 运行中 y 从有变无/从无变有时,也必须重建,否则同步监听仍指向旧 DOM
11779
- 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) {
11780
11788
  this.showTable = false;
11781
11789
  this.cdr.markForCheck();
11782
11790
  setTimeout((/**
@@ -11789,6 +11797,8 @@
11789
11797
  * @return {?}
11790
11798
  */
11791
11799
  function () {
11800
+ _this.dealScroll();
11801
+ _this.cdr.markForCheck();
11792
11802
  _this.afterTableRender(useVirtual);
11793
11803
  }));
11794
11804
  }));
@@ -12713,6 +12723,14 @@
12713
12723
  var viewportCompare = this.nzTableComponent
12714
12724
  ? getTableScrollXViewportWidth(this.nzTableComponent)
12715
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
+ }
12716
12734
  if (viewportCompare > 0) {
12717
12735
  if (declaredColWidth > viewportCompare + 1) {
12718
12736
  return {
@@ -12737,10 +12755,10 @@
12737
12755
  isFluid: true,
12738
12756
  };
12739
12757
  }
12740
- /** @type {?} */
12741
- var autoScroll = resolveAutoTableScroll(this.nzTableComponent, this.hasTableData(), declaredColWidth);
12758
+ // 视口仍测不到:至少用声明宽设 scroll.x,强制 fixed 布局锁勾选列,
12759
+ // 避免落回 table-layout:auto 被均摊撑开;后续 sync/remount 再转 fluid。
12742
12760
  return {
12743
- scrollX: autoScroll ? autoScroll.x : null,
12761
+ scrollX: Math.ceil(declaredColWidth) + "px",
12744
12762
  fluidExtra: 0,
12745
12763
  displayTotal: declaredColWidth,
12746
12764
  isFluid: false,
@@ -12773,16 +12791,20 @@
12773
12791
  * @return {?}
12774
12792
  */
12775
12793
  function (item) {
12776
- if (item && item.isShow) {
12794
+ if (item && item.isShow !== false) {
12777
12795
  declared += item.width > 0 ? item.width : ColWidth.fixColWidth;
12778
12796
  }
12779
12797
  }));
12780
12798
  }
12781
12799
  /** @type {?} */
12800
+ var prevHasX = !!(this.scroll && this.scroll.x);
12801
+ /** @type {?} */
12782
12802
  var layout = this.resolveHorizontalLayout(declared);
12783
12803
  /** @type {?} */
12784
12804
  var currentY = this.scroll ? this.scroll.y : null;
12785
12805
  /** @type {?} */
12806
+ var nextHasX = !!layout.scrollX;
12807
+ /** @type {?} */
12786
12808
  var sameX = this.scroll && this.scroll.x === layout.scrollX;
12787
12809
  /** @type {?} */
12788
12810
  var sameExtra = this.fluidExtraWidth === layout.fluidExtra;
@@ -12805,6 +12827,11 @@
12805
12827
  this.tableColWidthTotal = layout.displayTotal;
12806
12828
  this.scroll = { x: layout.scrollX, y: currentY };
12807
12829
  this.cdr.markForCheck();
12830
+ // sync 阶段若补上了 scroll.x,需重建才能切到 fixed 布局
12831
+ if (prevHasX !== nextHasX) {
12832
+ this.applyTableScrollMode(true);
12833
+ return;
12834
+ }
12808
12835
  setTimeout((/**
12809
12836
  * @return {?}
12810
12837
  */
@@ -13135,7 +13162,7 @@
13135
13162
  if (!item.width) {
13136
13163
  item.width = ColWidth.fixColWidth;
13137
13164
  }
13138
- if (item.isShow) {
13165
+ if (item.isShow !== false) {
13139
13166
  item.fixedWidth = colWidth;
13140
13167
  colWidth += item.width;
13141
13168
  }
@@ -13146,7 +13173,7 @@
13146
13173
  for (var i = this.tableCols.length - 1; i >= 0; i--) {
13147
13174
  /** @type {?} */
13148
13175
  var item = this.tableCols[i];
13149
- if (!item.isShow) {
13176
+ if (item.isShow === false) {
13150
13177
  continue;
13151
13178
  }
13152
13179
  if (item.fixed === "right") {