"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _collapse = _interopRequireDefault(require("@alifd/next/lib/collapse"));
var React = _interopRequireWildcard(require("react"));
var _locale = require("./locale");
var _Layout = _interopRequireDefault(require("./Layout.DisplaySetter"));
var _styleItemSetter = _interopRequireDefault(require("../../components/style-item-setter"));
var _Layout2 = _interopRequireDefault(require("./Layout.MarginSetter"));
var _styleSizeSetter = _interopRequireDefault(require("../../components/style-size-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 Panel = _collapse["default"].Panel;
var layoutConfig = (0, _locale.intlLocal)();
var defaultLayoutPropsConfig = {
  // display 展示列表
  showDisPlayList: ['inline', 'flex', 'block', 'inline-block', 'none'],
  isShowPadding: true,
  isShowMargin: true,
  isShowWidthHeight: true
};
var _default = exports["default"] = function _default(props) {
  var onStyleChange = props.onStyleChange,
    styleData = props.styleData,
    layoutPropsConfig = props.layoutPropsConfig,
    unit = props.unit;

  // 配置合并
  var propsConfig = (0, _extends2["default"])({}, defaultLayoutPropsConfig, layoutPropsConfig);

  // 传入配置
  var showDisPlayList = propsConfig.showDisPlayList,
    isShowWidthHeight = propsConfig.isShowWidthHeight;
  // 静态配置
  var display = layoutConfig.display,
    flexDirection = layoutConfig.flexDirection,
    justifyContent = layoutConfig.justifyContent,
    alignItems = layoutConfig.alignItems,
    flexWrap = layoutConfig.flexWrap;
  var displayDataList = display.dataList.filter(function (item) {
    return showDisPlayList.indexOf(item.value) >= 0;
  });
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "lc-field lc-block-field",
    style: {
      background: "white"
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "lc-field-head"
  }, "\u5C3A\u5BF8"), /*#__PURE__*/React.createElement("div", {
    className: "lc-field-body"
  }, /*#__PURE__*/React.createElement(_styleItemSetter["default"].TowColumnLayout, null, /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: layoutConfig.width,
    dataInput: /*#__PURE__*/React.createElement(_styleSizeSetter["default"], {
      styleData: styleData,
      styleKey: "width",
      onStyleChange: onStyleChange
    })
  }), /*#__PURE__*/React.createElement(_styleItemSetter["default"], {
    label: layoutConfig.height,
    dataInput: /*#__PURE__*/React.createElement(_styleSizeSetter["default"], {
      styleData: styleData,
      styleKey: "height",
      onStyleChange: onStyleChange
    })
  })), /*#__PURE__*/React.createElement(_Layout2["default"], props))), /*#__PURE__*/React.createElement("div", {
    className: "lc-field lc-block-field",
    style: {
      background: "white"
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "lc-field-head"
  }, "\u5E03\u5C40"), /*#__PURE__*/React.createElement("div", {
    className: "lc-field-body"
  }, /*#__PURE__*/React.createElement(_Layout["default"], props))));
};