From 2289c606ab374db39771571a03b831a0cdb464f8 Mon Sep 17 00:00:00 2001 From: zkwolf Date: Fri, 20 Sep 2019 15:31:08 +0800 Subject: [PATCH 1/2] feat: select add maxTagTextLenth prop --- components/select/index.en-US.md | 1 + components/select/index.jsx | 1 + components/select/index.zh-CN.md | 1 + 3 files changed, 3 insertions(+) diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md index e46dbbf6a3..318c4d42b7 100644 --- a/components/select/index.en-US.md +++ b/components/select/index.en-US.md @@ -27,6 +27,7 @@ | labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: vNodes}` | boolean | false | | maxTagCount | Max tag count to show | number | - | | maxTagPlaceholder | Placeholder for not showing tags | slot/function(omittedValues) | - | +| maxTagTextLength | Max text length to show | number | - | | mode | Set mode of Select | 'default' \| 'multiple' \| 'tags' | 'default' | | notFoundContent | Specify content to show when no result matches.. | string\|slot | 'Not Found' | | optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value | diff --git a/components/select/index.jsx b/components/select/index.jsx index e78fc5357a..36714a2c56 100644 --- a/components/select/index.jsx +++ b/components/select/index.jsx @@ -64,6 +64,7 @@ const SelectProps = { firstActiveValue: PropTypes.oneOfType([String, PropTypes.arrayOf(String)]), maxTagCount: PropTypes.number, maxTagPlaceholder: PropTypes.any, + maxTagTextLength: PropTypes.number, dropdownMatchSelectWidth: PropTypes.bool, optionFilterProp: PropTypes.string, labelInValue: PropTypes.boolean, diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md index fea1f66df0..98792026b4 100644 --- a/components/select/index.zh-CN.md +++ b/components/select/index.zh-CN.md @@ -26,6 +26,7 @@ | labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: vNodes}` 的格式 | boolean | false | | maxTagCount | 最多显示多少个 tag | number | - | | maxTagPlaceholder | 隐藏 tag 时显示的内容 | slot/function(omittedValues) | - | +| maxTagTextLength | 最大显示的 tag 文本长度 | number | - | | mode | 设置 Select 的模式为多选或标签 | 'default' \| 'multiple' \| 'tags' \| 'combobox' | - | | notFoundContent | 当下拉列表为空时显示的内容 | string\|slot | 'Not Found' | | optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索 | string | value | From cddfbebce0902b4e840226148a953972943b331f Mon Sep 17 00:00:00 2001 From: zkwolf Date: Fri, 20 Sep 2019 18:15:12 +0800 Subject: [PATCH 2/2] fix: add select maxTagTextLength prop ts type --- types/select/select.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/select/select.d.ts b/types/select/select.d.ts index 2f93920afe..a5f2bff384 100644 --- a/types/select/select.d.ts +++ b/types/select/select.d.ts @@ -118,6 +118,12 @@ export declare class Select extends AntdComponent { */ maxTagPlaceholder: any; + /** + * Max text length to show + * @type number + */ + maxTagTextLength: number; + /** * Set mode of Select * @default 'default'