import { createTextVNode as _createTextVNode, createVNode as _createVNode, Fragment as _Fragment } from "vue";
import { defineComponent } from 'vue';
import './Preview';
import Select from '../../select';
import ArrowLeftOutlined from '@pf-ui/pf-icons-vue/ArrowLeftOutlined';
import ArrowRightOutlined from '@pf-ui/pf-icons-vue/ArrowRightOutlined';
import AddFilled from '@pf-ui/pf-icons-vue/AddFilled';
import MinusOutlined from '@pf-ui/pf-icons-vue/MinusOutlined';
import OneToOneOutlined from '@pf-ui/pf-icons-vue/OneToOneOutlined';
import RotateLeftOutlined from '@pf-ui/pf-icons-vue/RotateLeftOutlined';
import RotateRightOutlined from '@pf-ui/pf-icons-vue/RotateRightOutlined';
import Button from '../../button';
import message from '../../message';
export var previewOperationsProps = {
  prefixCls: String,
  onClose: Function,
  onRotateRight: Function,
  onRotateLeft: Function,
  onScaleSelect: Function,
  onRotateSave: Function,
  onZoomIn: Function,
  onZoomOut: Function,
  onSwitchLeft: Function,
  onSwitchRight: Function,
  rotateSaveDisabled: Boolean,
  isGroup: Boolean,
  groupCount: Number,
  currentIndex: Number
};
var ScaleOptions = [50, 100, 150, 200, 250, 300].map(function (v) {
  return {
    label: "".concat(v, "%"),
    value: v
  };
});
var PreviewOperations = defineComponent({
  name: 'PreviewOperations',
  props: previewOperationsProps,
  setup: function setup(props) {
    var handleSelect = function handleSelect(value) {
      props.onScaleSelect(value / 100);
    };
    var handleReset = function handleReset() {
      props.onScaleSelect(1);
    };
    var handleRotateSave = function handleRotateSave() {
      message.success('保存成功');
      props.onRotateSave();
    };
    return function () {
      var prefixCls = props.prefixCls,
        onZoomIn = props.onZoomIn,
        onZoomOut = props.onZoomOut,
        onRotateRight = props.onRotateRight,
        onRotateLeft = props.onRotateLeft,
        onSwitchLeft = props.onSwitchLeft,
        onSwitchRight = props.onSwitchRight,
        isGroup = props.isGroup,
        groupCount = props.groupCount,
        currentIndex = props.currentIndex;
      var _prefixCls = "".concat(prefixCls, "-operations");
      return _createVNode("div", {
        "class": _prefixCls
      }, [isGroup && _createVNode(_Fragment, null, [_createVNode(ArrowLeftOutlined, {
        "class": "".concat(_prefixCls, "-icon"),
        "onClick": onSwitchLeft
      }, null), _createVNode(ArrowRightOutlined, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-margin"),
        "onClick": onSwitchRight
      }, null), _createVNode("div", {
        "class": "".concat(_prefixCls, "-group-count")
      }, ["".concat(currentIndex + 1, " / ").concat(groupCount, " \u9875")]), _createVNode("div", {
        "class": "".concat(_prefixCls, "-divide")
      }, null)]), _createVNode(AddFilled, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-mr"),
        "onClick": onZoomIn
      }, null), _createVNode(MinusOutlined, {
        "class": "".concat(_prefixCls, "-icon"),
        "onClick": onZoomOut
      }, null), _createVNode(OneToOneOutlined, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-margin"),
        "onClick": handleReset
      }, null), _createVNode(Select, {
        "class": "".concat(_prefixCls, "-select"),
        "options": ScaleOptions,
        "getPopupContainer": function getPopupContainer(triggerNode) {
          return triggerNode.parentNode;
        },
        "onChange": handleSelect,
        "defaultValue": 100
      }, null), _createVNode("div", {
        "class": "".concat(_prefixCls, "-divide")
      }, null), _createVNode(RotateLeftOutlined, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-mr"),
        "onClick": onRotateRight
      }, null), _createVNode(RotateRightOutlined, {
        "class": "".concat(_prefixCls, "-icon"),
        "onClick": onRotateLeft
      }, null), _createVNode(Button, {
        "class": "".concat(_prefixCls, "-button"),
        "onClick": handleRotateSave,
        "disabled": props.rotateSaveDisabled
      }, {
        default: function _default() {
          return [_createTextVNode("\u4FDD\u5B58")];
        }
      })]);
    };
  }
});
export default PreviewOperations;