UNPKG

1.9 kBJavaScriptView Raw
1import { createVNode as _createVNode } from "vue";
2import LeftOutlined from "@ant-design/icons-vue/es/icons/LeftOutlined";
3import RightOutlined from "@ant-design/icons-vue/es/icons/RightOutlined";
4import Button from '../button';
5
6function noop() {}
7
8var Operation = function Operation(props) {
9 var disabled = props.disabled,
10 _props$moveToLeft = props.moveToLeft,
11 moveToLeft = _props$moveToLeft === void 0 ? noop : _props$moveToLeft,
12 _props$moveToRight = props.moveToRight,
13 moveToRight = _props$moveToRight === void 0 ? noop : _props$moveToRight,
14 _props$leftArrowText = props.leftArrowText,
15 leftArrowText = _props$leftArrowText === void 0 ? '' : _props$leftArrowText,
16 _props$rightArrowText = props.rightArrowText,
17 rightArrowText = _props$rightArrowText === void 0 ? '' : _props$rightArrowText,
18 leftActive = props.leftActive,
19 rightActive = props.rightActive,
20 className = props.class,
21 style = props.style,
22 direction = props.direction,
23 oneWay = props.oneWay;
24 return _createVNode("div", {
25 "class": className,
26 "style": style
27 }, [_createVNode(Button, {
28 "type": "primary",
29 "size": "small",
30 "disabled": disabled || !rightActive,
31 "onClick": moveToRight,
32 "icon": direction !== 'rtl' ? _createVNode(RightOutlined, null, null) : _createVNode(LeftOutlined, null, null)
33 }, {
34 default: function _default() {
35 return [rightArrowText];
36 }
37 }), !oneWay && _createVNode(Button, {
38 "type": "primary",
39 "size": "small",
40 "disabled": disabled || !leftActive,
41 "onClick": moveToLeft,
42 "icon": direction !== 'rtl' ? _createVNode(LeftOutlined, null, null) : _createVNode(RightOutlined, null, null)
43 }, {
44 default: function _default() {
45 return [leftArrowText];
46 }
47 })]);
48};
49
50Operation.displayName = 'Operation';
51Operation.inheritAttrs = false;
52export default Operation;
\No newline at end of file