Skip to content

Commit

Permalink
feat(module:select): support nzOptionHeightPx in global config (#8504)
Browse files Browse the repository at this point in the history
Fixes #8503
  • Loading branch information
xunjianxiang committed Apr 19, 2024
1 parent b52ad50 commit 4efc5ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions components/core/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface SelectConfig {
nzBorderless?: boolean;
nzSuffixIcon?: TemplateRef<NzSafeAny> | string | null;
nzBackdrop?: boolean;
nzOptionHeightPx?: number;
}

export interface AffixConfig {
Expand Down
2 changes: 1 addition & 1 deletion components/select/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
| `[nzMaxTagCount]` | Max tag count to show | `number` | - |
| `[nzOptions]` | use nzOptions or `nz-option` to pass options to the select | `Array<{ label: string \| number \| TemplateRef<any>; value: any; key?: string \| number; disabled?: boolean; hide?: boolean; groupLabel?: string \| TemplateRef<any>;}>` | - |
| `[nzMaxTagPlaceholder]` | Placeholder for not showing tags | `TemplateRef<{ $implicit: any[] }>` | - |
| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` |
| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` |
| `[nzOptionOverflowSize]` | Max option size inside the dropdown, overflow when exceed the size | `number` | `8` |
| `[nzSelectOnTab]` | Allows to select an item with TAB key | `boolean` | `false` |
| `(ngModelChange)` | Current selected nz-option value change callback. | `EventEmitter<any[]>` | - |
Expand Down
2 changes: 1 addition & 1 deletion components/select/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
| `[nzMaxTagCount]` | 最多显示多少个 tag | `number` | - |
| `[nzMaxTagPlaceholder]` | 隐藏 tag 时显示的内容 | `TemplateRef<{ $implicit: any[] }>` | - |
| `[nzOptions]` | option 列表,可以取代 nz-option,用法参见例子 | `Array<{ label: string \| number \| TemplateRef<any>; value: any; key?: string \| number; disabled?: boolean; hide?: boolean; groupLabel?: string \| TemplateRef<any>;}>` | - |
| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` |
| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` |
| `[nzOptionOverflowSize]` | 下拉菜单中最多展示的 Option 个数,超出部分滚动 | `number` | `8` |
| `[nzSelectOnTab]` | 允许使用 TAB 键选择项目 | `boolean` | `false` |
| `(ngModelChange)` | 选中的 nz-option 发生变化时,调用此函数 | `EventEmitter<any[]>` | - |
Expand Down
2 changes: 1 addition & 1 deletion components/select/select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
@Input() nzId: string | null = null;
@Input() nzSize: NzSelectSizeType = 'default';
@Input() nzStatus: NzStatus = '';
@Input() nzOptionHeightPx = 32;
@Input() @WithConfig<number>() nzOptionHeightPx = 32;
@Input() nzOptionOverflowSize = 8;
@Input() nzDropdownClassName: string[] | string | null = null;
@Input() nzDropdownMatchSelectWidth = true;
Expand Down

0 comments on commit 4efc5ab

Please sign in to comment.