"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = BorderV2;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _collapse = _interopRequireDefault(require("@alifd/next/lib/collapse"));
var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
var React = _interopRequireWildcard(require("react"));
var _locale = require("./locale");
require("./index.less");
var _styleSizeSetter = _interopRequireDefault(require("../../components/style-size-setter"));
var _styleItemSetter = _interopRequireDefault(require("../../components/style-item-setter"));
var _colorInput = _interopRequireDefault(require("../../components/color-input"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var Option = _select["default"].Option;
var Panel = _collapse["default"].Panel;
var borderConfig = (0, _locale.intlLocal)();
var BORDER_MAX = 30;
var BorderRadiusType = /*#__PURE__*/function (BorderRadiusType) {
  BorderRadiusType["fixedBorder"] = "fixedBorder";
  BorderRadiusType["partBorder"] = "partBorder";
  return BorderRadiusType;
}(BorderRadiusType || {});
var BorderDirectionMap = {
  borderLeft: 'borderLeft',
  borderRight: 'borderRight',
  borderTop: 'borderTop',
  borderBottom: 'borderBottom'
  // border:'border'
};
var borderRadiusMap = {
  borderRadius: 'borderRadius',
  borderTopLeftRadius: 'borderTopLeftRadius',
  borderTopRightRadius: 'borderTopRightRadius',
  borderBottomLeftRadius: 'borderBottomLeftRadius',
  borderBottomRightRadius: 'borderBottomRightRadius'
};
function BorderV2(props) {
  var styleData = props.styleData,
    onStyleChange = props.onStyleChange;
  return /*#__PURE__*/React.createElement("div", {
    className: "lc-field lc-block-field",
    style: {
      background: "white"
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "lc-field-head"
  }, "\u8FB9\u6846"), /*#__PURE__*/React.createElement("div", {
    className: "lc-field-body"
  }, /*#__PURE__*/React.createElement(_styleItemSetter["default"].TowColumnLayout, null, /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "边框式样",
    dataInput: /*#__PURE__*/React.createElement(_select["default"], {
      hasClear: true,
      dataSource: [{
        value: "solid",
        label: "实线"
      }, {
        value: "dashed",
        label: "虚线"
      }, {
        value: "dotted",
        label: "点线"
      }],
      value: styleData.borderStyle,
      onChange: function onChange(value) {
        onStyleChange === null || onStyleChange === void 0 ? void 0 : onStyleChange([{
          styleKey: "borderStyle",
          value: value
        }]);
      }
    })
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "边框宽度",
    dataInput: /*#__PURE__*/React.createElement(_styleSizeSetter["default"], (0, _extends2["default"])({}, props, {
      styleKey: "borderWidth",
      units: ["px", "%"],
      defaultUint: "px"
    }))
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "边框颜色",
    dataInput: /*#__PURE__*/React.createElement(_colorInput["default"], (0, _extends2["default"])({}, props, {
      styleKey: 'borderColor',
      inputWidth: "100%"
    }))
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "圆角",
    dataInput: /*#__PURE__*/React.createElement(_styleSizeSetter["default"], (0, _extends2["default"])({}, props, {
      styleKey: "borderRadius",
      units: ["px", "%"],
      defaultUint: "px"
    }))
  }))));
}
;