Skip to content

Commit

Permalink
Merge branch 'develop' into feature/#1272
Browse files Browse the repository at this point in the history
  • Loading branch information
solarjoker authored Nov 4, 2020
2 parents 73d1c41 + 8e70513 commit b1475aa
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
- 修复 `Tag` 使用 ref 无效问题 [#1262](https://github.com/XiaoMi/hiui/issues/1262)
- 修复 `Table` data 为 undefined 时的报错问题 [#1265](https://github.com/XiaoMi/hiui/issues/1265)
- 修复 `Loading` 显示不正确的问题 [#1265](https://github.com/XiaoMi/hiui/issues/1268)
- 优化 `SelectTree` 文档以及样式相关方面 [#1272](https://github.com/XiaoMi/hiui/issues/1272)
- 优化 `SelectTree` 样式问题 [#1272](https://github.com/XiaoMi/hiui/issues/1272)
- 修复 `Table` data 为 undefined 时的报错问题 [#1273](https://github.com/XiaoMi/hiui/issues/1265)
- 修复 `Loading` 显示不正确的问题 [#1268](https://github.com/XiaoMi/hiui/issues/1268)
- 修复 `Tag` 闪烁问题 [#1273](https://github.com/XiaoMi/hiui/issues/1273)
- 修复 `Timeline` 折断样式问题 [#1276](https://github.com/XiaoMi/hiui/issues/1276)
- 修复 `Timeline` 只有一条数据时的样式问题 [#1277](https://github.com/XiaoMi/hiui/issues/1277)

## 3.0.0

Expand Down
5 changes: 3 additions & 2 deletions components/tag/TagGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const TagGroup = ({ editable, prefixCls = 'hi-tag-group', data, onAdd = noop, on
const [editInputId, setEditInputId] = useState(-1)
const [editInputValue, setEditInputValue] = useState('')
const [hoverIndex, setHoverIndex] = useState(-1)
const [renderedItem] = useState(data.map((d) => d.tagId))

useEffect(() => {
if (inputVisible) {
Expand Down Expand Up @@ -107,15 +108,15 @@ const TagGroup = ({ editable, prefixCls = 'hi-tag-group', data, onAdd = noop, on
onDoubleClick={onDoubleClick}
isLongTag={item.isLongTag}
hoverIndex={hoverIndex}
transition
transition={!renderedItem.includes(item.tagId)}
onMouseEnter={(id) => setHoverIndex(id)}
onMouseLeave={() => setHoverIndex(-1)}
>
{item.title}
</Tag>
)
},
[hoverIndex, handleClose, onDoubleClick]
[hoverIndex, handleClose, onDoubleClick, renderedItem]
)

const renderItem = useCallback(
Expand Down
18 changes: 6 additions & 12 deletions components/tag/TagItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ const InternalTagItem = ({
onMouseLeave = noop,
hoverIndex = -1,
shape = 'round',
innerRef
innerRef,
transition
}) => {
const [vi, setVi] = useState(false)
useEffect(() => {
setVi(true)
}, [])
setVi(transition)
}, [transition])
const tagStyle = color
? {
background: appearance === 'default' ? color : '',
Expand All @@ -36,14 +37,7 @@ const InternalTagItem = ({
}
: {}
return (
<CSSTransition
in={vi}
timeout={300}
classNames={'tag-transition'}
onExited={() => {
setTimeout(() => handleClose(id), 300)
}}
>
<CSSTransition in={vi} timeout={300} classNames={'tag-transition'}>
<span
className={classNames('hi-tag', {
[`hi-tag--${type}`]: type,
Expand All @@ -69,7 +63,7 @@ const InternalTagItem = ({
<Icon
name="close"
onClick={(e) => {
setVi(false)
handleClose(id)
}}
/>
</button>
Expand Down
2 changes: 1 addition & 1 deletion components/tag/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $primary: get-color($palette-primary, 'hiui-blue') !default;
transition: opacity 0.3s;

&:hover {
opacity: 0.65;
opacity: 0.85;
}

@each $key, $value in $color-map {
Expand Down
20 changes: 19 additions & 1 deletion components/timeline/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
.item__line {
height: 7px !important;
}

&.timeline__item--first {
.item__line {
height: 0 !important;
}
}
}

&--first {
Expand Down Expand Up @@ -204,6 +210,12 @@
height: 7px;
}
}

&.timeline__item--first {
.item__line {
height: 0 !important;
}
}
}

&--first {
Expand Down Expand Up @@ -304,7 +316,6 @@
.timeline__item {
display: flex;
position: relative;
margin-bottom: 20px;

.item--left {
text-align: right;
Expand Down Expand Up @@ -360,6 +371,7 @@
.item--right {
width: calc(70% - 20px);
margin-left: 20px;
margin-bottom: 20px;

.item__title {
color: use-color('black');
Expand All @@ -383,6 +395,12 @@
.item__line {
height: 7px;
}

&.timeline__item--first {
.item__line {
height: 0 !important;
}
}
}

&--first {
Expand Down
2 changes: 2 additions & 0 deletions docs/zh-CN/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- 修复 `Tag` 使用 ref 无效问题 [#1262](https://github.com/XiaoMi/hiui/issues/1262)
- 修复 `Table` data 为 undefined 时的报错问题 [#1265](https://github.com/XiaoMi/hiui/issues/1265)
- 修复 `Loading` 显示不正确的问题 [#1265](https://github.com/XiaoMi/hiui/issues/1268)
- 修复 `Timeline` 折断样式问题 [#1276](https://github.com/XiaoMi/hiui/issues/1276)
- 修复 `Timeline` 只有一条数据时的样式问题 [#1277](https://github.com/XiaoMi/hiui/issues/1277)

## 3.0.0

Expand Down

0 comments on commit b1475aa

Please sign in to comment.