forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: auto merge branchs (ant-design#30926)
chore: sync master into feature
- Loading branch information
Showing
16 changed files
with
134 additions
and
61 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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.@{menu-prefix-cls} { | ||
// light theme | ||
&-light { | ||
.@{menu-prefix-cls}-item:hover, | ||
.@{menu-prefix-cls}-item-active, | ||
.@{menu-prefix-cls}:not(.@{menu-prefix-cls}-inline) .@{menu-prefix-cls}-submenu-open, | ||
.@{menu-prefix-cls}-submenu-active, | ||
.@{menu-prefix-cls}-submenu-title:hover { | ||
color: @menu-highlight-color; | ||
} | ||
} | ||
} |
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
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
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,39 @@ | ||
--- | ||
order: 4.1 | ||
title: | ||
zh-CN: 省略中间 | ||
en-US: Ellipsis from middle | ||
--- | ||
|
||
## zh-CN | ||
|
||
使用 `ellipsis={{ suffix: ... }}` 可以封装一个从中间省略内容的组件,适合于需要保留文本末位特征的内容。 | ||
|
||
## en-US | ||
|
||
You can ellipsis content from middle by customize `ellipsis={{ suffix: ... }}`. | ||
|
||
```jsx | ||
import { Typography } from 'antd'; | ||
|
||
const { Text } = Typography; | ||
|
||
const EllipsisMiddle = ({ suffixCount, children }) => { | ||
const start = children.slice(0, children.length - suffixCount).trim(); | ||
const suffix = children.slice(-suffixCount).trim(); | ||
return ( | ||
<Text style={{ maxWidth: '100%' }} ellipsis={{ suffix }}> | ||
{start} | ||
</Text> | ||
); | ||
}; | ||
|
||
ReactDOM.render( | ||
<EllipsisMiddle suffixCount={12}> | ||
In the process of internal desktop applications development, many different design specs and | ||
implementations would be involved, which might cause designers and developers difficulties and | ||
duplication and reduce the efficiency of development. | ||
</EllipsisMiddle>, | ||
mountNode, | ||
); | ||
``` |