优化 combo 的 tabs 模式样式 (#1456)

* 优化 combo 的 tabs 模式样式

* empty 文案没翻译问题修复

* 换成 div
This commit is contained in:
liaoxuezhi 2021-01-27 12:03:48 +08:00 committed by GitHub
parent 02250cd033
commit 856c5a82f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View File

@ -68,9 +68,13 @@
&-tab-delBtn {
color: var(--icon-color);
cursor: pointer;
position: absolute;
top: -8px;
right: 4px;
margin-left: var(--gap-sm);
display: inline-block;
> svg {
width: px2rem(11px);
height: px2rem(11px);
}
&:hover {
color: var(--icon-onHover-color);
@ -257,6 +261,9 @@
.#{$ns}ComboTabs-addLink {
float: right;
> a svg {
margin-right: var(--gap-xs);
}
}
.#{$ns}Combo-dragableTip {

View File

@ -147,6 +147,7 @@ export class Tabs extends React.Component<TabsProps> {
) : (
title
)}
{React.isValidElement(toolbar) ? toolbar : null}
</a>
{/* svg 来自 https://github.com/adamschwartz/chrome-tabs */}
{mode === 'chrome' ? (
@ -184,7 +185,6 @@ export class Tabs extends React.Component<TabsProps> {
</svg>
</div>
) : null}
{React.isValidElement(toolbar) ? toolbar : null}
</li>
);
}

View File

@ -290,7 +290,7 @@ export default class ComboControl extends React.Component<ComboProps> {
deleteIcon: '',
tabsMode: false,
tabsStyle: '',
placeholder: 'empty'
placeholder: 'placeholder.empty'
};
static propsList: Array<string> = [
'minLength',
@ -1004,7 +1004,7 @@ export default class ComboControl extends React.Component<ComboProps> {
evalExpression(itemRemovableOn, value) !== false)
) {
toolbar = (
<a
<div
onClick={this.removeItem.bind(this, index)}
key="remove"
className={cx(
@ -1018,7 +1018,7 @@ export default class ComboControl extends React.Component<ComboProps> {
) : (
<Icon icon="close" className="icon" />
)}
</a>
</div>
);
}