"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.previewOperationsProps = exports.default = void 0;
var _vue = require("vue");
require("./Preview");
var _select = _interopRequireDefault(require("../../select"));
var _ArrowLeftOutlined = _interopRequireDefault(require("@pf-ui/pf-icons-vue/ArrowLeftOutlined"));
var _ArrowRightOutlined = _interopRequireDefault(require("@pf-ui/pf-icons-vue/ArrowRightOutlined"));
var _AddFilled = _interopRequireDefault(require("@pf-ui/pf-icons-vue/AddFilled"));
var _MinusOutlined = _interopRequireDefault(require("@pf-ui/pf-icons-vue/MinusOutlined"));
var _OneToOneOutlined = _interopRequireDefault(require("@pf-ui/pf-icons-vue/OneToOneOutlined"));
var _RotateLeftOutlined = _interopRequireDefault(require("@pf-ui/pf-icons-vue/RotateLeftOutlined"));
var _RotateRightOutlined = _interopRequireDefault(require("@pf-ui/pf-icons-vue/RotateRightOutlined"));
var _button = _interopRequireDefault(require("../../button"));
var _message = _interopRequireDefault(require("../../message"));
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
};
exports.previewOperationsProps = previewOperationsProps;
var ScaleOptions = [50, 100, 150, 200, 250, 300].map(function (v) {
  return {
    label: "".concat(v, "%"),
    value: v
  };
});
var PreviewOperations = (0, _vue.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.default.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 (0, _vue.createVNode)("div", {
        "class": _prefixCls
      }, [isGroup && (0, _vue.createVNode)(_vue.Fragment, null, [(0, _vue.createVNode)(_ArrowLeftOutlined.default, {
        "class": "".concat(_prefixCls, "-icon"),
        "onClick": onSwitchLeft
      }, null), (0, _vue.createVNode)(_ArrowRightOutlined.default, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-margin"),
        "onClick": onSwitchRight
      }, null), (0, _vue.createVNode)("div", {
        "class": "".concat(_prefixCls, "-group-count")
      }, ["".concat(currentIndex + 1, " / ").concat(groupCount, " \u9875")]), (0, _vue.createVNode)("div", {
        "class": "".concat(_prefixCls, "-divide")
      }, null)]), (0, _vue.createVNode)(_AddFilled.default, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-mr"),
        "onClick": onZoomIn
      }, null), (0, _vue.createVNode)(_MinusOutlined.default, {
        "class": "".concat(_prefixCls, "-icon"),
        "onClick": onZoomOut
      }, null), (0, _vue.createVNode)(_OneToOneOutlined.default, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-margin"),
        "onClick": handleReset
      }, null), (0, _vue.createVNode)(_select.default, {
        "class": "".concat(_prefixCls, "-select"),
        "options": ScaleOptions,
        "getPopupContainer": function getPopupContainer(triggerNode) {
          return triggerNode.parentNode;
        },
        "onChange": handleSelect,
        "defaultValue": 100
      }, null), (0, _vue.createVNode)("div", {
        "class": "".concat(_prefixCls, "-divide")
      }, null), (0, _vue.createVNode)(_RotateLeftOutlined.default, {
        "class": "".concat(_prefixCls, "-icon ").concat(_prefixCls, "-mr"),
        "onClick": onRotateRight
      }, null), (0, _vue.createVNode)(_RotateRightOutlined.default, {
        "class": "".concat(_prefixCls, "-icon"),
        "onClick": onRotateLeft
      }, null), (0, _vue.createVNode)(_button.default, {
        "class": "".concat(_prefixCls, "-button"),
        "onClick": handleRotateSave,
        "disabled": props.rotateSaveDisabled
      }, {
        default: function _default() {
          return [(0, _vue.createTextVNode)("\u4FDD\u5B58")];
        }
      })]);
    };
  }
});
var _default2 = PreviewOperations;
exports.default = _default2;