From ffb637660251c1dfce7c1d66ed79af2d51d9097a Mon Sep 17 00:00:00 2001 From: xingkoo Date: Sat, 28 Dec 2024 03:53:58 +0800 Subject: [PATCH 1/3] Update st.component.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持延迟渲染表格 --- packages/abc/st/st.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/abc/st/st.component.ts b/packages/abc/st/st.component.ts index d9aa42a58..e47005b56 100644 --- a/packages/abc/st/st.component.ts +++ b/packages/abc/st/st.component.ts @@ -158,6 +158,7 @@ export class STComponent implements AfterViewInit, OnChanges { this.updateTotalTpl(); } @Input() data?: string | STData[] | Observable; + @Input() delay?: boolean = false; @Input() columns?: STColumn[] | null; @Input() contextmenu?: STContextmenuFn | null; @Input({ transform: (v: unknown) => numberAttribute(v, 10) }) ps = 10; @@ -894,7 +895,7 @@ export class STComponent implements AfterViewInit, OnChanges { } ngAfterViewInit(): void { - this.refreshColumns(); + if (!this.delay) this.refreshColumns(); if (!this.req.lazyLoad) this.loadPageData().subscribe(); this.inied = true; } From eb35e393850449524275310ab10ccf39b018d3e8 Mon Sep 17 00:00:00 2001 From: xingkoo Date: Sat, 28 Dec 2024 04:00:15 +0800 Subject: [PATCH 2/3] Update index.zh-CN.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新ST组件中文文档,增加delay属性 --- packages/abc/st/index.zh-CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/abc/st/index.zh-CN.md b/packages/abc/st/index.zh-CN.md index 1a0e40b6c..aee8e1dbd 100644 --- a/packages/abc/st/index.zh-CN.md +++ b/packages/abc/st/index.zh-CN.md @@ -66,6 +66,7 @@ module: import { STModule } from '@delon/abc/st'; | `[loading]` | 页面是否加载中,当指定 `null` 由 st 受控 | `boolean | null` | `null` | - | | `[loadingIndicator]` | 加载指示符 | `TemplateRef` | - | ✅ | | `[loadingDelay]` | 延迟显示加载效果的时间(防止闪烁) | `number` | `0` | ✅ | +| `[delay]` | 是否延迟渲染表格,需手动调用`refreshColumns()`渲染 | `boolean` | `false` | - | | `[scroll]` | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{ x: "300px", y: "300px" }` | `{ y?: string; x?: string }` | - | - | | `[virtualScroll]` | 是否启用虚拟滚动模式,与 `[nzScroll]` 配合使用 | `boolean` | `false` | ✅ | | `[virtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `54` | ✅ | From 772ff687491565ed99ce2614209c7126eb1783cb Mon Sep 17 00:00:00 2001 From: xingkoo Date: Sat, 28 Dec 2024 04:01:34 +0800 Subject: [PATCH 3/3] Update index.en-US.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新ST组件英文文档,添加delay属性 --- packages/abc/st/index.en-US.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/abc/st/index.en-US.md b/packages/abc/st/index.en-US.md index 93483e0e0..9e9e560d8 100644 --- a/packages/abc/st/index.en-US.md +++ b/packages/abc/st/index.en-US.md @@ -66,6 +66,7 @@ When an exception is thrown when parsing column data, *INVALID DATA* will be for | `[loading]` | Loading status of table, when specifying `null` is controlled by st | `boolean | null` | `null` | - | | `[loadingIndicator]` | The spinning indicator | `TemplateRef` | - | ✅ | | `[loadingDelay]` | Specifies a delay in milliseconds for loading state (prevent flush) | `number` | `0` | ✅ | +| [delay] | Whether to delay table rendering, requires manual call to refreshColumns() to render | boolean | false | - | | `[scroll]` | Whether table can be scrolled in x/y direction, x or y can be a string that indicates the width and height of table body | `{ y?: string; x?: string }` | - | - | | `[virtualScroll]` | Enable virtual scroll mode,work with `[nzScroll]` | `boolean` | `false` | ✅ | | `[virtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `54` | ✅ |