From 966dc8f2b39b9cc7f46e4a1c5fba157c78173a52 Mon Sep 17 00:00:00 2001 From: SunDaiyue <31619017+ousc@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:47:58 +0800 Subject: [PATCH] feat(module:select): add string array support for nzDropdownClassName (#7643) --- components/select/doc/index.en-US.md | 3 +-- components/select/doc/index.zh-CN.md | 3 +-- components/select/select.component.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/components/select/doc/index.en-US.md b/components/select/doc/index.en-US.md index cf74d8e65c..8db5b32832 100644 --- a/components/select/doc/index.en-US.md +++ b/components/select/doc/index.en-US.md @@ -38,7 +38,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select'; | `[nzOpen]` | dropdown expand state, double binding | `boolean` | `false` | | `[nzAutoFocus]` | Get focus by default | `boolean` | `false` | | `[nzDisabled]` | Whether disabled select | `boolean` | `false` | -| `[nzDropdownClassName]` | className of dropdown menu | `string` | - | +| `[nzDropdownClassName]` | className of dropdown menu | `string \| string[]` | - | | `[nzDropdownMatchSelectWidth]` | Whether dropdown's width is same width than select. | `boolean` | `true` | | `[nzDropdownStyle]` | style of dropdown menu | `object` | - | | `[nzCustomTemplate]` | The custom template of select | `TemplateRef<{ $implicit: NzOptionComponent }>` | - | @@ -48,7 +48,6 @@ import { NzSelectModule } from 'ng-zorro-antd/select'; | `[nzMode]` | Set mode of Select | `'multiple' \| 'tags' \| 'default'` | `'default'` | | `[nzNotFoundContent]` | Specify content to show when no result matches.. | `string \| TemplateRef` | `'Not Found'` | | `[nzPlaceHolder]` | Placeholder of select | `string` | - | -| `[nzPlacement]` | The position where the selection box pops up | `'bottomLeft' \| 'bottomRight' \| 'topLeft' \| 'topRight'` | `'bottomLeft'` | | `[nzShowArrow]` | Whether to show the drop-down arrow | `boolean` | `true`(for single select), `false`(for multiple select) | | `[nzShowSearch]` | Whether show search input in single mode. | `boolean` | `false` | | `[nzSize]` | Size of Select input | `'large' \| 'small' \| 'default'` | `'default'` | diff --git a/components/select/doc/index.zh-CN.md b/components/select/doc/index.zh-CN.md index 9e05c6bdaa..1b7fc0afe5 100644 --- a/components/select/doc/index.zh-CN.md +++ b/components/select/doc/index.zh-CN.md @@ -39,7 +39,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select'; | `[nzOpen]` | 下拉菜单是否打开,可双向绑定 | `boolean` | `false` | | `[nzAutoFocus]` | 默认获取焦点 | `boolean` | `false` | | `[nzDisabled]` | 是否禁用 | `boolean` | `false` | -| `[nzDropdownClassName]` | 下拉菜单的 className 属性 | `string` | - | +| `[nzDropdownClassName]` | 下拉菜单的 className 属性 | `string \| string[]` | - | | `[nzDropdownMatchSelectWidth]` | 下拉菜单和选择器同宽 | `boolean` | `true` | | `[nzDropdownStyle]` | 下拉菜单的 style 属性 | `object` | - | | `[nzCustomTemplate]` | 自定义选择框的 Template 内容 | `TemplateRef<{ $implicit: NzOptionComponent }>` | - | @@ -49,7 +49,6 @@ import { NzSelectModule } from 'ng-zorro-antd/select'; | `[nzMode]` | 设置 nz-select 的模式 | `'multiple' \| 'tags' \| 'default'` | `'default'` | | `[nzNotFoundContent]` | 当下拉列表为空时显示的内容 | `string \| TemplateRef` | - | | `[nzPlaceHolder]` | 选择框默认文字 | `string` | - | -| `[nzPlacement]` | 选择框弹出的位置 | `'bottomLeft' \| 'bottomRight' \| 'topLeft' \| 'topRight'` | `'bottomLeft'` | | `[nzShowArrow]` | 是否显示下拉小箭头 | `boolean` | 单选为 `true`,多选为 `false` | | `[nzShowSearch]` | 使单选模式可搜索 | `boolean` | `false` | | `[nzSize]` | 选择框大小 | `'large' \| 'small' \| 'default'` | `'default'` | diff --git a/components/select/select.component.ts b/components/select/select.component.ts index 7aa74d855c..1b987f290b 100644 --- a/components/select/select.component.ts +++ b/components/select/select.component.ts @@ -215,7 +215,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon @Input() nzStatus: NzStatus = ''; @Input() nzOptionHeightPx = 32; @Input() nzOptionOverflowSize = 8; - @Input() nzDropdownClassName: string | null = null; + @Input() nzDropdownClassName: string[] | string | null = null; @Input() nzDropdownMatchSelectWidth = true; @Input() nzDropdownStyle: { [key: string]: string } | null = null; @Input() nzNotFoundContent: string | TemplateRef | undefined = undefined;