diff --git a/components/anchor/style/patch.less b/components/anchor/style/patch.less index ea9575dde55..2e9b8799ccb 100644 --- a/components/anchor/style/patch.less +++ b/components/anchor/style/patch.less @@ -8,10 +8,10 @@ nz-link { &-wrapper { // This is a feature of Antd 5, so we need add in the patch file. &-horizontal { - margin-left: unset; - padding-left: unset; margin-bottom: -4px; + margin-left: unset; padding-bottom: 4px; + padding-left: unset; .ant-anchor { display: flex; @@ -22,7 +22,7 @@ nz-link { width: 100%; height: unset; - &:before { + &::before { width: 100%; height: 2px; } diff --git a/components/core/config/config.ts b/components/core/config/config.ts index 60df0934b76..b64e17b0c61 100644 --- a/components/core/config/config.ts +++ b/components/core/config/config.ts @@ -295,6 +295,7 @@ export interface TableConfig { nzShowSizeChanger?: boolean; nzSimple?: boolean; nzHideOnSinglePage?: boolean; + nzVirtualItemSize?: number; /** * @see {@link NzTableSortOrder} */ @@ -333,6 +334,7 @@ export interface TreeConfig { nzBlockNode?: boolean; nzShowIcon?: boolean; nzHideUnMatched?: boolean; + nzVirtualItemSize?: number; } export interface TreeSelectConfig { diff --git a/components/table/doc/index.en-US.md b/components/table/doc/index.en-US.md index 668cef95fe4..17cfd858bc0 100644 --- a/components/table/doc/index.en-US.md +++ b/components/table/doc/index.en-US.md @@ -87,7 +87,7 @@ The data passed to `[nzData]` is exported with [Template Context](https://angula | `[nzHideOnSinglePage]` | Whether to hide pagination on single page | `boolean` | `false` | | `[nzSimple]` | Whether to use simple mode | `boolean` | - | ✅ | | `[nzTemplateMode]` | Template mode,no need to pass data to `nzData` | `boolean` | `false` | -| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `0` | +| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `0` | ✅ | `[nzVirtualMaxBufferPx]` | The number of pixels worth of buffer to render for when rendering new items, same as [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `200` | | `[nzVirtualMinBufferPx]` | The minimum amount of buffer rendered beyond the viewport (in pixels),same as [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `100` | | `[nzVirtualForTrackBy]` | The TrackByFunction to be used for tracking changes. | `TrackByFunction` | - | diff --git a/components/table/doc/index.zh-CN.md b/components/table/doc/index.zh-CN.md index ffd28ba0d8f..a8cf9d0cea4 100644 --- a/components/table/doc/index.zh-CN.md +++ b/components/table/doc/index.zh-CN.md @@ -88,7 +88,7 @@ Table 组件同时具备了易用性和高度可定制性 | `[nzHideOnSinglePage]` | 只有一页时是否隐藏分页器 | `boolean` | `false` | ✅ | | `[nzSimple]` | 当添加该属性时,显示为简单分页 | `boolean` | - | ✅ | | `[nzTemplateMode]` | 模板模式,无需将数据传递给 `nzData` | `boolean` | `false` | -| `[nzVirtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `0` | +| `[nzVirtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `0` |✅ | `[nzVirtualMaxBufferPx]` | 缓冲区最大像素高度,与 [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `200` | | `[nzVirtualMinBufferPx]` | 缓冲区最小像素高度,低于该值时将加载新结构,与 [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `100` | | `[nzVirtualForTrackBy]` | 虚拟滚动数据 `TrackByFunction` 函数 | `TrackByFunction` | - | diff --git a/components/table/src/table/table.component.ts b/components/table/src/table/table.component.ts index deeb61aa258..d224db79512 100644 --- a/components/table/src/table/table.component.ts +++ b/components/table/src/table/table.component.ts @@ -176,7 +176,7 @@ export class NzTableComponent implements OnInit, OnChanges, AfterViewInit { @Input() nzFooter: string | TemplateRef | null = null; @Input() nzNoResult: string | TemplateRef | undefined = undefined; @Input() nzPageSizeOptions = [10, 20, 30, 40, 50]; - @Input() nzVirtualItemSize = 0; + @Input() @WithConfig() nzVirtualItemSize = 0; @Input() nzVirtualMaxBufferPx = 200; @Input() nzVirtualMinBufferPx = 100; @Input() nzVirtualForTrackBy: TrackByFunction = index => index; diff --git a/components/tree-select/doc/index.en-US.md b/components/tree-select/doc/index.en-US.md index 87bbd06f8f0..8c83af42f21 100755 --- a/components/tree-select/doc/index.en-US.md +++ b/components/tree-select/doc/index.en-US.md @@ -48,7 +48,7 @@ Any data whose entries are defined in a hierarchical manner is fit to use this c | `[nzTreeTemplate]` | Custom Nodes | `TemplateRef<{ $implicit: NzTreeNode }>` | - | | `[nzVariant]` | Variants of TreeSelect | `'outlined' \| 'borderless' \| 'filled' \| 'underlined'` | `'outlined'` | ✅ | 20.0.0 | | `[nzVirtualHeight]` | The height of virtual scroll | `string` | `-` | -| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `28` | +| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `28` | ✅ | `[nzVirtualMaxBufferPx]` | The number of pixels worth of buffer to render for when rendering new items, same as [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `500` | | `[nzVirtualMinBufferPx]` | The minimum amount of buffer rendered beyond the viewport (in pixels),same as [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `28` | | `[nzBackdrop]` | whether or not the overlay should attach a backdrop | `boolean` | `false` | diff --git a/components/tree-select/doc/index.zh-CN.md b/components/tree-select/doc/index.zh-CN.md index b79d99c9d79..b6423911e36 100755 --- a/components/tree-select/doc/index.zh-CN.md +++ b/components/tree-select/doc/index.zh-CN.md @@ -48,7 +48,7 @@ description: 树型选择控件。 | `[nzTreeTemplate]` | 自定义节点 | `TemplateRef<{ $implicit: NzTreeNode }>` | - | | `[nzVariant]` | 形态变体 | `'outlined' \| 'borderless' \| 'filled' \| 'underlined'` | `'outlined'` | ✅ | 20.0.0 | | `[nzVirtualHeight]` | 虚拟滚动的总高度 | `string` | `-` | -| `[nzVirtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `28` | +| `[nzVirtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `28` | ✅ | `[nzVirtualMaxBufferPx]` | 缓冲区最大像素高度,与 [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `500` | | `[nzVirtualMinBufferPx]` | 缓冲区最小像素高度,低于该值时将加载新结构,与 [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `28` | | `[nzBackdrop]` | 浮层是否应带有背景板 | `boolean` | `false` | diff --git a/components/tree-select/tree-select.component.ts b/components/tree-select/tree-select.component.ts index 1980afd5ea6..592a0f1d77b 100644 --- a/components/tree-select/tree-select.component.ts +++ b/components/tree-select/tree-select.component.ts @@ -310,7 +310,7 @@ export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAcc @Input({ transform: booleanAttribute }) nzMultiple = false; @Input({ transform: booleanAttribute }) nzDefaultExpandAll = false; @Input({ transform: booleanAttribute }) nzCheckStrictly = false; - @Input() nzVirtualItemSize = 28; + @Input() @WithConfig() nzVirtualItemSize = 28; @Input() nzVirtualMaxBufferPx = 500; @Input() nzVirtualMinBufferPx = 28; @Input() nzVirtualHeight: string | null = null; diff --git a/components/tree/doc/index.en-US.md b/components/tree/doc/index.en-US.md index a2a3dcd7d7f..adb7fe36c70 100644 --- a/components/tree/doc/index.en-US.md +++ b/components/tree/doc/index.en-US.md @@ -39,7 +39,7 @@ Almost anything can be represented in a tree structure. Examples include directo | `[nzSearchFunc]` | Custom matching method, used with `nzSearchValue` | `(node: NzTreeNodeOptions) => boolean` | `null` | | `[nzBeforeDrop]` | Drop before the second check, allowing the user to decide whether to allow placement | `(confirm: NzFormatBeforeDropEvent) => Observable` | - | | `[nzVirtualHeight]` | The height of virtual scroll | `string` | `-` | -| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `28` | +| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `28` | ✅ | `[nzVirtualMaxBufferPx]` | The number of pixels worth of buffer to render for when rendering new items, same as [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `500` | | `[nzVirtualMinBufferPx]` | The minimum amount of buffer rendered beyond the viewport (in pixels),same as [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `28` | | `(nzClick)` | Callback function for when the user clicks a treeNode | `EventEmitter` | - | diff --git a/components/tree/doc/index.zh-CN.md b/components/tree/doc/index.zh-CN.md index 517fef04472..cf1d012a99f 100644 --- a/components/tree/doc/index.zh-CN.md +++ b/components/tree/doc/index.zh-CN.md @@ -40,7 +40,7 @@ description: 多层次的结构列表。 | `[nzSearchFunc]` | 自定义匹配方法,配合 `nzSearchValue` 使用 | `(node: NzTreeNodeOptions) => boolean` | `null` | | `[nzBeforeDrop]` | drop 前二次校验,允许用户自行决定是否允许放置 | `(confirm: NzFormatBeforeDropEvent) => Observable` | - | | `[nzVirtualHeight]` | 虚拟滚动的总高度 | `string` | `-` | -| `[nzVirtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `28` | +| `[nzVirtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `28` | ✅ | `[nzVirtualMaxBufferPx]` | 缓冲区最大像素高度,与 [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `500` | | `[nzVirtualMinBufferPx]` | 缓冲区最小像素高度,低于该值时将加载新结构,与 [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `28` | | `(nzClick)` | 点击树节点触发 | `EventEmitter` | - | diff --git a/components/tree/tree.component.ts b/components/tree/tree.component.ts index 3df44823c5b..08918e8a981 100644 --- a/components/tree/tree.component.ts +++ b/components/tree/tree.component.ts @@ -204,7 +204,7 @@ export class NzTreeComponent extends NzTreeBase implements OnInit, ControlValueA @Input({ transform: booleanAttribute }) nzDraggable: boolean = false; @Input({ transform: booleanAttribute }) nzMultiple = false; @Input() nzExpandedIcon?: TemplateRef<{ $implicit: NzTreeNode; origin: NzTreeNodeOptions }>; - @Input() nzVirtualItemSize = 28; + @Input() @WithConfig() nzVirtualItemSize = 28; @Input() nzVirtualMaxBufferPx = 500; @Input() nzVirtualMinBufferPx = 28; @Input() nzVirtualHeight: string | null = null;