Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tag-input): add max-rows class and update the docs of tagInput #2007

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/web/api/tag-input.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Use `excessTagsDisplayType` to control the rendering method when the tag exceeds

{{ excess }}

### Maximum Number of Rows When Tags Exceed Limit

Use `maxRows` to control the maximum number of rows when tags exceed the limit. A scrollbar will appear when the number of rows exceeds this limit. By default, there is no limit.

{{ max-row }}

### Tag input box with limited number

Use `max` to control the maximum number of tags.
Expand Down
7 changes: 6 additions & 1 deletion docs/web/api/tag-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ spline: data

{{ excess }}

### 标签数量超出后限制最大行数的输入框

使用 maxRows 控制标签超出时的最大行数,超出会出现滚动条,默认为不限制。

{{ max-row }}

### 有数量限制的标签输入框

Expand Down Expand Up @@ -43,7 +48,6 @@ spline: data

{{ custom-tag }}


### 不同状态的标签输入框

标签输入框状态可分为:正常、只读、禁用、成功、告警、错误等,其中 成功、告警、错误 等状态一般用于表单验证。此特性继承至 Input 输入框组件。
Expand All @@ -61,4 +65,5 @@ spline: data
{{ auto-width }}

### 可拖拽调整顺序的标签输入框

{{ draggable }}
16 changes: 16 additions & 0 deletions style/web/components/tag-input/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,19 @@
padding-right: 0;
}
}

/** max-rows模式,限制最大高度 */
.@{prefix}-tag-input--max-rows {
.@{prefix}-input {
&.@{prefix}-size-s {
max-height: calc(var(--max-rows, 1) * @tag-input-height-s);
}

&.@{prefix}-size-l {
max-height: calc(var(--max-rows, 1) * (@tag-input-height-l - 2px));
}

max-height: calc(var(--max-rows, 1) * (@tag-input-height-default - 2px));
overflow-y: scroll;
}
}
Loading