"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = LayoutDisplaySetter;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _radioGroup = _interopRequireDefault(require("../../components/radio-group"));
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _locale = require("./locale");
var _styleItemSetter = _interopRequireDefault(require("../../components/style-item-setter"));
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 layoutConfig = (0, _locale.intlLocal)();
function LayoutDisplaySetter(props) {
  var display = layoutConfig.display,
    flexDirection = layoutConfig.flexDirection,
    justifyContent = layoutConfig.justifyContent,
    alignItems = layoutConfig.alignItems,
    flexWrap = layoutConfig.flexWrap;
  var showSub = (0, _react.useMemo)(function () {
    return props.styleData["display"] == "flex";
  }, [props.styleData]);
  var subItem = /*#__PURE__*/React.createElement("div", {
    className: "style-item-sub"
  }, /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "主轴方向",
    dataInput: /*#__PURE__*/React.createElement(_radioGroup["default"], (0, _extends2["default"])({
      styleKey: 'flexDirection',
      dataList: flexDirection.dataList
    }, props))
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "主轴对齐",
    dataInput: /*#__PURE__*/React.createElement(_radioGroup["default"], (0, _extends2["default"])({
      styleKey: 'justifyContent',
      dataList: justifyContent.dataList
    }, props))
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "辅轴对齐",
    dataInput: /*#__PURE__*/React.createElement(_radioGroup["default"], (0, _extends2["default"])({
      styleKey: 'alignItems',
      dataList: alignItems.dataList
    }, props))
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: "换行",
    dataInput: /*#__PURE__*/React.createElement(_radioGroup["default"], (0, _extends2["default"])({
      styleKey: 'flexWrap',
      dataList: flexWrap.dataList
    }, props))
  }));
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "style-item"
  }, /*#__PURE__*/React.createElement(_radioGroup["default"], (0, _extends2["default"])({
    styleKey: 'display',
    dataList: display.dataList
  }, props))), showSub && subItem);
}