import _extends from "@babel/runtime/helpers/extends";
import _Collapse from "@alifd/next/es/collapse";
import * as React from 'react';
import { intlLocal } from './locale';
import LayoutDisplaySetter from "./Layout.DisplaySetter";
import StyleItemSetter from "../../components/style-item-setter";
import LayoutMarginSetter from "./Layout.MarginSetter";
import StyleSizeSetter from "../../components/style-size-setter";
var Panel = _Collapse.Panel;
var layoutConfig = intlLocal();
var defaultLayoutPropsConfig = {
  // display 展示列表
  showDisPlayList: ['inline', 'flex', 'block', 'inline-block', 'none'],
  isShowPadding: true,
  isShowMargin: true,
  isShowWidthHeight: true
};
export default (function (props) {
  var onStyleChange = props.onStyleChange,
    styleData = props.styleData,
    layoutPropsConfig = props.layoutPropsConfig,
    unit = props.unit;

  // 配置合并
  var propsConfig = _extends({}, 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.TowColumnLayout, null, /*#__PURE__*/React.createElement(StyleItemSetter, {
    label: layoutConfig.width,
    dataInput: /*#__PURE__*/React.createElement(StyleSizeSetter, {
      styleData: styleData,
      styleKey: "width",
      onStyleChange: onStyleChange
    })
  }), /*#__PURE__*/React.createElement(StyleItemSetter, {
    label: layoutConfig.height,
    dataInput: /*#__PURE__*/React.createElement(StyleSizeSetter, {
      styleData: styleData,
      styleKey: "height",
      onStyleChange: onStyleChange
    })
  })), /*#__PURE__*/React.createElement(LayoutMarginSetter, 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(LayoutDisplaySetter, props))));
});