-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(comp:tag): support css variable and add status prop (#1600)
- Loading branch information
Showing
46 changed files
with
493 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/components/tag/__tests__/__snapshots__/tag.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`Tag > render work 1`] = ` | ||
"<span class=\\"ix-tag\\"><!----><!----><span class=\\"ix-tag-content\\">test tag</span> | ||
"<span class=\\"ix-tag ix-tag-normal\\"><!----><!----><span class=\\"ix-tag-content\\">test tag</span> | ||
<!----></span>" | ||
`; |
10 changes: 7 additions & 3 deletions
10
packages/components/tag/__tests__/__snapshots__/tagGroup.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`TagGroup > render work 1`] = ` | ||
"<div class=\\"ix-tag-group\\" style=\\"gap: 8px 8px;\\"><span class=\\"ix-tag\\"><!----><!----><span class=\\"ix-tag-content\\">A</span> | ||
<!----></span><span class=\\"ix-tag\\"><!----><!----><span class=\\"ix-tag-content\\">B</span> | ||
<!----></span> | ||
"<div class=\\"ix-space ix-tag-group\\" style=\\"margin-bottom: -8px;\\"> | ||
<div class=\\"ix-space-item\\" style=\\"margin-right: 8px; padding-bottom: 8px;\\"><span class=\\"ix-tag ix-tag-normal\\"><!----><!----><span class=\\"ix-tag-content\\">A</span> | ||
<!----></span> | ||
</div> | ||
<div class=\\"ix-space-item\\" style=\\"padding-bottom: 8px;\\"><span class=\\"ix-tag ix-tag-normal\\"><!----><!----><span class=\\"ix-tag-content\\">B</span> | ||
<!----></span> | ||
</div> | ||
</div>" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ order: 1 | |
|
||
## zh | ||
|
||
基本使用 | ||
最简单的用法, 可以通过设置 `status` 来展示不同颜色的标签。 | ||
|
||
## en | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<IxTag>标签</IxTag> | ||
<IxTag status="success">标签</IxTag> | ||
<IxTag status="info">标签</IxTag> | ||
<IxTag status="warning">标签</IxTag> | ||
<IxTag status="risk">标签</IxTag> | ||
<IxTag status="error">标签</IxTag> | ||
<IxTag status="fatal">标签</IxTag> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: | ||
zh: 带边框的 | ||
en: Bordered | ||
order: 12 | ||
--- | ||
|
||
## zh | ||
|
||
通过设置 `bordered` 来展示带边框的标签 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<IxTag bordered>标签</IxTag> | ||
<IxTag bordered status="success">标签</IxTag> | ||
<IxTag bordered status="info">标签</IxTag> | ||
<IxTag bordered status="warning">标签</IxTag> | ||
<IxTag bordered status="risk">标签</IxTag> | ||
<IxTag bordered status="error">标签</IxTag> | ||
<IxTag bordered status="fatal">标签</IxTag> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 7 | ||
order: 16 | ||
title: | ||
zh: 一组标签 | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
order: 18 | ||
title: | ||
zh: 可关闭的 | ||
--- | ||
|
||
## zh | ||
|
||
`closable` 属性定义一个标签是否可以移除,当标签被移除时会触发 `close` 事件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template> | ||
<IxTagGroup closable @close="handleClose"> | ||
<IxTag key="a">两数之和</IxTag> | ||
<IxTag key="b" status="info">三数之和</IxTag> | ||
<IxTag key="c" status="warning">四数之和</IxTag> | ||
<IxTag key="d" status="error">M数之和</IxTag> | ||
</IxTagGroup> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
const handleClose = console.log | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
--- | ||
title: | ||
zh: 颜色 | ||
en: color | ||
order: 0 | ||
zh: 自定义颜色 | ||
en: Customized Color | ||
order: 14 | ||
--- | ||
|
||
## zh | ||
|
||
标签颜色配置 | ||
|
||
## en | ||
|
||
tag colors | ||
通过设置 `css` 变量: `--ix-tag-color`, `--ix-tag-background-color` 和 `--ix-tag-border-color` 来自定义标签颜色 |
Oops, something went wrong.