diff --git a/components/select/doc/index.en-US.md b/components/select/doc/index.en-US.md index 88eda8004e2..3618415e35f 100644 --- a/components/select/doc/index.en-US.md +++ b/components/select/doc/index.en-US.md @@ -55,6 +55,8 @@ import { NzSelectModule } from 'ng-zorro-antd/select'; | `[nzLoading]` | indicate loading state | `boolean` | false | | `[nzMaxTagCount]` | Max tag count to show| `number` | - | | `[nzMaxTagPlaceholder]` | Placeholder for not showing tags | `TemplateRef<{ $implicit: any[] }>` | - | +| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` | +| `[nzOptionOverflowSize]` | Max option size inside the dropdown, overflow when exceed the size | `number` | `8` | | `(ngModelChange)` | Current selected nz-option value change callback. | `EventEmitter` | - | | `(nzOpenChange)` | dropdown expand change callback | `EventEmitter` | `false` | | `(nzScrollToBottom)` | Called when dropdown scrolls to bottom | `EventEmitter` | - | diff --git a/components/select/doc/index.zh-CN.md b/components/select/doc/index.zh-CN.md index 4ddd9a2ba5e..89c738265f1 100644 --- a/components/select/doc/index.zh-CN.md +++ b/components/select/doc/index.zh-CN.md @@ -56,6 +56,8 @@ import { NzSelectModule } from 'ng-zorro-antd/select'; | `[nzLoading]` | 加载中状态 | `boolean` | `false` | | `[nzMaxTagCount]` | 最多显示多少个 tag | `number` | - | | `[nzMaxTagPlaceholder]` | 隐藏 tag 时显示的内容 | `TemplateRef<{ $implicit: any[] }>` | - | +| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` | +| `[nzOptionOverflowSize]` | 下拉菜单中最多展示的 Option 个数,超出部分滚动 | `number` | `8` | | `(ngModelChange)` | 选中的 nz-option 发生变化时,调用此函数 | `EventEmitter` | - | | `(nzOpenChange)` | 下拉菜单打开状态变化回调 | `EventEmitter` | - | | `(nzScrollToBottom)` | 下拉列表滚动到底部的回调 | `EventEmitter` | - | diff --git a/components/select/option-container.component.ts b/components/select/option-container.component.ts index 27f244be802..4f7c3191d98 100644 --- a/components/select/option-container.component.ts +++ b/components/select/option-container.component.ts @@ -81,13 +81,13 @@ export class NzOptionContainerComponent implements OnChanges, AfterViewInit { @Input() compareWith: (o1: NzSafeAny, o2: NzSafeAny) => boolean; @Input() mode: NzSelectModeType = 'default'; @Input() matchWidth = true; + @Input() itemSize = 32; + @Input() maxItemLength = 8; @Input() listOfContainerItem: NzSelectItemInterface[] = []; @Output() readonly itemClick = new EventEmitter(); @Output() readonly scrollToBottom = new EventEmitter(); @ViewChild(CdkVirtualScrollViewport, { static: true }) cdkVirtualScrollViewport: CdkVirtualScrollViewport; private scrolledIndex = 0; - readonly itemSize = 32; - readonly maxItemLength = 8; onItemClick(value: NzSafeAny): void { this.itemClick.emit(value); diff --git a/components/select/select.component.ts b/components/select/select.component.ts index 0d81c49a2a2..fe2d6e63dbc 100644 --- a/components/select/select.component.ts +++ b/components/select/select.component.ts @@ -123,6 +123,8 @@ export type NzSelectSizeType = 'large' | 'default' | 'small'; >