2017-11-17 14:38:54 +08:00
|
|
|
import * as React from 'react';
|
2015-11-26 16:07:11 +08:00
|
|
|
import Button from '../button';
|
|
|
|
|
2016-07-01 20:52:17 +08:00
|
|
|
export interface TransferOperationProps {
|
2016-07-13 11:14:24 +08:00
|
|
|
className?: string;
|
|
|
|
leftArrowText?: string;
|
|
|
|
rightArrowText?: string;
|
2018-05-04 14:48:41 +08:00
|
|
|
moveToLeft?: React.FormEventHandler<HTMLButtonElement>;
|
|
|
|
moveToRight?: React.FormEventHandler<HTMLButtonElement>;
|
2016-07-13 11:14:24 +08:00
|
|
|
leftActive?: boolean;
|
|
|
|
rightActive?: boolean;
|
2018-05-28 23:07:43 +08:00
|
|
|
style?: React.CSSProperties;
|
2016-07-01 20:52:17 +08:00
|
|
|
}
|
|
|
|
|
2017-11-06 22:20:54 +08:00
|
|
|
export default class Operation extends React.Component<TransferOperationProps, any> {
|
|
|
|
render() {
|
|
|
|
const {
|
2018-05-25 20:59:17 +08:00
|
|
|
moveToLeft,
|
|
|
|
moveToRight,
|
2017-11-06 22:20:54 +08:00
|
|
|
leftArrowText = '',
|
|
|
|
rightArrowText = '',
|
|
|
|
leftActive,
|
|
|
|
rightActive,
|
|
|
|
className,
|
2018-05-28 22:37:23 +08:00
|
|
|
style,
|
2017-11-06 22:20:54 +08:00
|
|
|
} = this.props;
|
|
|
|
return (
|
2018-05-28 22:37:23 +08:00
|
|
|
<div className={className} style={style}>
|
2017-11-06 22:20:54 +08:00
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
size="small"
|
|
|
|
disabled={!leftActive}
|
|
|
|
onClick={moveToLeft}
|
|
|
|
icon="left"
|
|
|
|
>
|
|
|
|
{leftArrowText}
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
size="small"
|
|
|
|
disabled={!rightActive}
|
|
|
|
onClick={moveToRight}
|
|
|
|
icon="right"
|
|
|
|
>
|
|
|
|
{rightArrowText}
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|