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.
- package/bundles/fantasy-ngzorro.umd.js +39 -12
- package/bundles/fantasy-ngzorro.umd.js.map +1 -1
- package/bundles/fantasy-ngzorro.umd.min.js +1 -1
- package/bundles/fantasy-ngzorro.umd.min.js.map +1 -1
- package/esm2015/hd-table/hd-table.component.js +42 -15
- package/esm5/hd-table/hd-table.component.js +41 -14
- package/fantasy-ngzorro.metadata.json +1 -1
- package/fesm2015/fantasy-ngzorro.js +40 -13
- package/fesm2015/fantasy-ngzorro.js.map +1 -1
- package/fesm5/fantasy-ngzorro.js +39 -12
- package/fesm5/fantasy-ngzorro.js.map +1 -1
- package/package.json +2 -2
|
@@ -9425,10 +9425,11 @@ class HdTableComponent {
|
|
|
9425
9425
|
changes["tableData"]["currentValue"]["pageNumber"] !==
|
|
9426
9426
|
changes["tableData"]["previousValue"]["pageNumber"]) {
|
|
9427
9427
|
this.pendingResetScrollTop = true;
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9428
|
+
// pageSize/pageNumber 变化也要重算 scroll / fluid。
|
|
9429
|
+
// 业务常把 Page.pageSize 写成 content.length(如收款编辑 toPage),
|
|
9430
|
+
// virtualScroll=false 时若这里跳过,空表初始化后的 fluid 不会补上,勾选列被撑开。
|
|
9431
|
+
// applyTableScrollMode(false) 在模式未变时只 dealScroll,不会强制重建清排序态。
|
|
9432
|
+
this.applyTableScrollMode(false);
|
|
9432
9433
|
// 翻页/改 pageSize:主动多次复位,覆盖 CDK 异步渲染时序
|
|
9433
9434
|
this.scheduleResetTableBodyScrollTop();
|
|
9434
9435
|
return;
|
|
@@ -9819,12 +9820,19 @@ class HdTableComponent {
|
|
|
9819
9820
|
return;
|
|
9820
9821
|
}
|
|
9821
9822
|
/** @type {?} */
|
|
9823
|
+
const prevHasX = !!(this.scroll && this.scroll.x);
|
|
9824
|
+
/** @type {?} */
|
|
9822
9825
|
const prevHasY = !!(this.scroll && this.scroll.y);
|
|
9823
9826
|
this.dealScroll();
|
|
9824
9827
|
/** @type {?} */
|
|
9828
|
+
const nextHasX = !!(this.scroll && this.scroll.x);
|
|
9829
|
+
/** @type {?} */
|
|
9825
9830
|
const nextHasY = !!(this.scroll && this.scroll.y);
|
|
9826
|
-
// 运行中 y
|
|
9827
|
-
|
|
9831
|
+
// 运行中 x/y 从有变无/从无变有时,也必须重建:
|
|
9832
|
+
// - y:ng-zorro 只在 AfterViewInit 绑一次 header/body 同步
|
|
9833
|
+
// - x:空表 scroll.x=null(table-layout:auto)→ 有数据后设 scroll.x(fixed),
|
|
9834
|
+
// 不重建时勾选列仍按 auto 均摊撑开(收款编辑等异步灌数页)
|
|
9835
|
+
if (prevHasY !== nextHasY || prevHasX !== nextHasX) {
|
|
9828
9836
|
this.showTable = false;
|
|
9829
9837
|
this.cdr.markForCheck();
|
|
9830
9838
|
setTimeout((/**
|
|
@@ -9837,6 +9845,8 @@ class HdTableComponent {
|
|
|
9837
9845
|
* @return {?}
|
|
9838
9846
|
*/
|
|
9839
9847
|
() => {
|
|
9848
|
+
this.dealScroll();
|
|
9849
|
+
this.cdr.markForCheck();
|
|
9840
9850
|
this.afterTableRender(useVirtual);
|
|
9841
9851
|
}));
|
|
9842
9852
|
}));
|
|
@@ -10590,9 +10600,17 @@ class HdTableComponent {
|
|
|
10590
10600
|
};
|
|
10591
10601
|
}
|
|
10592
10602
|
/** @type {?} */
|
|
10593
|
-
|
|
10603
|
+
let viewportCompare = this.nzTableComponent
|
|
10594
10604
|
? getTableScrollXViewportWidth(this.nzTableComponent)
|
|
10595
10605
|
: 0;
|
|
10606
|
+
// 表体尚未量到宽时(异步灌数 / spin / 刚 remount),用宿主宽兜底
|
|
10607
|
+
if (viewportCompare <= 0 && this.hostEl && this.hostEl.nativeElement) {
|
|
10608
|
+
/** @type {?} */
|
|
10609
|
+
const hostW = ((/** @type {?} */ (this.hostEl.nativeElement))).offsetWidth;
|
|
10610
|
+
if (hostW > 0) {
|
|
10611
|
+
viewportCompare = hostW;
|
|
10612
|
+
}
|
|
10613
|
+
}
|
|
10596
10614
|
if (viewportCompare > 0) {
|
|
10597
10615
|
if (declaredColWidth > viewportCompare + 1) {
|
|
10598
10616
|
return {
|
|
@@ -10617,10 +10635,10 @@ class HdTableComponent {
|
|
|
10617
10635
|
isFluid: true,
|
|
10618
10636
|
};
|
|
10619
10637
|
}
|
|
10620
|
-
|
|
10621
|
-
|
|
10638
|
+
// 视口仍测不到:至少用声明宽设 scroll.x,强制 fixed 布局锁勾选列,
|
|
10639
|
+
// 避免落回 table-layout:auto 被均摊撑开;后续 sync/remount 再转 fluid。
|
|
10622
10640
|
return {
|
|
10623
|
-
scrollX:
|
|
10641
|
+
scrollX: `${Math.ceil(declaredColWidth)}px`,
|
|
10624
10642
|
fluidExtra: 0,
|
|
10625
10643
|
displayTotal: declaredColWidth,
|
|
10626
10644
|
isFluid: false,
|
|
@@ -10646,16 +10664,20 @@ class HdTableComponent {
|
|
|
10646
10664
|
* @return {?}
|
|
10647
10665
|
*/
|
|
10648
10666
|
(item) => {
|
|
10649
|
-
if (item && item.isShow) {
|
|
10667
|
+
if (item && item.isShow !== false) {
|
|
10650
10668
|
declared += item.width > 0 ? item.width : ColWidth.fixColWidth;
|
|
10651
10669
|
}
|
|
10652
10670
|
}));
|
|
10653
10671
|
}
|
|
10654
10672
|
/** @type {?} */
|
|
10673
|
+
const prevHasX = !!(this.scroll && this.scroll.x);
|
|
10674
|
+
/** @type {?} */
|
|
10655
10675
|
const layout = this.resolveHorizontalLayout(declared);
|
|
10656
10676
|
/** @type {?} */
|
|
10657
10677
|
const currentY = this.scroll ? this.scroll.y : null;
|
|
10658
10678
|
/** @type {?} */
|
|
10679
|
+
const nextHasX = !!layout.scrollX;
|
|
10680
|
+
/** @type {?} */
|
|
10659
10681
|
const sameX = this.scroll && this.scroll.x === layout.scrollX;
|
|
10660
10682
|
/** @type {?} */
|
|
10661
10683
|
const sameExtra = this.fluidExtraWidth === layout.fluidExtra;
|
|
@@ -10678,6 +10700,11 @@ class HdTableComponent {
|
|
|
10678
10700
|
this.tableColWidthTotal = layout.displayTotal;
|
|
10679
10701
|
this.scroll = { x: layout.scrollX, y: currentY };
|
|
10680
10702
|
this.cdr.markForCheck();
|
|
10703
|
+
// sync 阶段若补上了 scroll.x,需重建才能切到 fixed 布局
|
|
10704
|
+
if (prevHasX !== nextHasX) {
|
|
10705
|
+
this.applyTableScrollMode(true);
|
|
10706
|
+
return;
|
|
10707
|
+
}
|
|
10681
10708
|
setTimeout((/**
|
|
10682
10709
|
* @return {?}
|
|
10683
10710
|
*/
|
|
@@ -10932,7 +10959,7 @@ class HdTableComponent {
|
|
|
10932
10959
|
if (!item.width) {
|
|
10933
10960
|
item.width = ColWidth.fixColWidth;
|
|
10934
10961
|
}
|
|
10935
|
-
if (item.isShow) {
|
|
10962
|
+
if (item.isShow !== false) {
|
|
10936
10963
|
item.fixedWidth = colWidth;
|
|
10937
10964
|
colWidth += item.width;
|
|
10938
10965
|
}
|
|
@@ -10943,7 +10970,7 @@ class HdTableComponent {
|
|
|
10943
10970
|
for (let i = this.tableCols.length - 1; i >= 0; i--) {
|
|
10944
10971
|
/** @type {?} */
|
|
10945
10972
|
const item = this.tableCols[i];
|
|
10946
|
-
if (
|
|
10973
|
+
if (item.isShow === false) {
|
|
10947
10974
|
continue;
|
|
10948
10975
|
}
|
|
10949
10976
|
if (item.fixed === "right") {
|