fix: input-table 表格操作栏 文字图标更换展示位置 (#6261)

Co-authored-by: zhangzhulei <zhangzhulei@baidu.com>
This commit is contained in:
zhangzhulei 2023-02-27 16:42:18 +08:00 committed by GitHub
parent 3c597c186d
commit 04e5959122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -833,7 +833,6 @@ export default class FormTable extends React.Component<TableProps, TableState> {
disabled={disabled}
onClick={this.addItem.bind(this, rowIndex + offset, undefined)}
>
{props.addBtnLabel ? <span>{props.addBtnLabel}</span> : null}
{props.addBtnIcon ? (
typeof props.addBtnIcon === 'string' ? (
<Icon icon={props.addBtnIcon} className="icon" />
@ -841,6 +840,7 @@ export default class FormTable extends React.Component<TableProps, TableState> {
generateIcon(props.classnames, props.addBtnIcon)
)
) : null}
{props.addBtnLabel ? <span>{props.addBtnLabel}</span> : null}
</Button>
)
});
@ -870,7 +870,6 @@ export default class FormTable extends React.Component<TableProps, TableState> {
disabled={disabled}
onClick={this.copyItem.bind(this, rowIndex + offset, undefined)}
>
{props.copyBtnLabel ? <span>{props.copyBtnLabel}</span> : null}
{props.copyBtnIcon ? (
typeof props.copyBtnIcon === 'string' ? (
<Icon icon={props.copyBtnIcon} className="icon" />
@ -878,6 +877,7 @@ export default class FormTable extends React.Component<TableProps, TableState> {
generateIcon(props.classnames, props.copyBtnIcon)
)
) : null}
{props.copyBtnLabel ? <span>{props.copyBtnLabel}</span> : null}
</Button>
)
});
@ -950,9 +950,6 @@ export default class FormTable extends React.Component<TableProps, TableState> {
disabled={disabled}
onClick={() => this.startEdit(rowIndex + offset)}
>
{props.updateBtnLabel || props.editBtnLabel ? (
<span>{props.updateBtnLabel || props.editBtnLabel}</span>
) : null}
{/* 兼容之前的写法 */}
{typeof props.updateBtnIcon !== 'undefined' ? (
props.updateBtnIcon ? (
@ -969,6 +966,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
generateIcon(props.classnames, props.editBtnIcon)
)
) : null}
{props.updateBtnLabel || props.editBtnLabel ? (
<span>{props.updateBtnLabel || props.editBtnLabel}</span>
) : null}
</Button>
)
});
@ -995,9 +995,6 @@ export default class FormTable extends React.Component<TableProps, TableState> {
}
onClick={this.confirmEdit}
>
{props.confirmBtnLabel ? (
<span>{props.confirmBtnLabel}</span>
) : null}
{props.confirmBtnIcon ? (
typeof props.confirmBtnIcon === 'string' ? (
<Icon icon={props.confirmBtnIcon} className="icon" />
@ -1005,6 +1002,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
generateIcon(props.classnames, props.confirmBtnIcon)
)
) : null}
{props.confirmBtnLabel ? (
<span>{props.confirmBtnLabel}</span>
) : null}
</Button>
) : null
});
@ -1031,9 +1031,6 @@ export default class FormTable extends React.Component<TableProps, TableState> {
}
onClick={this.cancelEdit}
>
{props.cancelBtnLabel ? (
<span>{props.cancelBtnLabel}</span>
) : null}
{props.cancelBtnIcon ? (
typeof props.cancelBtnIcon === 'string' ? (
<Icon icon={props.cancelBtnIcon} className="icon" />
@ -1041,6 +1038,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
generateIcon(props.classnames, props.cancelBtnIcon)
)
) : null}
{props.cancelBtnLabel ? (
<span>{props.cancelBtnLabel}</span>
) : null}
</Button>
) : null
});
@ -1074,9 +1074,6 @@ export default class FormTable extends React.Component<TableProps, TableState> {
disabled={disabled}
onClick={this.removeItem.bind(this, rowIndex + offset)}
>
{props.deleteBtnLabel ? (
<span>{props.deleteBtnLabel}</span>
) : null}
{props.deleteBtnIcon ? (
typeof props.deleteBtnIcon === 'string' ? (
<Icon icon={props.deleteBtnIcon} className="icon" />
@ -1084,6 +1081,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
generateIcon(props.classnames, props.deleteBtnIcon)
)
) : null}
{props.deleteBtnLabel ? (
<span>{props.deleteBtnLabel}</span>
) : null}
</Button>
)
});