operation.js 1.8 KB

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