"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _numberPicker = _interopRequireDefault(require("@alifd/next/lib/number-picker"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
var _collapse = _interopRequireDefault(require("@alifd/next/lib/collapse"));
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _row = _interopRequireDefault(require("../../components/row"));
var _positionBox = _interopRequireDefault(require("../position/positionBox"));
var _locale = require("./locale");
var _utils = require("../../utils");
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 positionConfig = (0, _locale.intlLocal)();
var _default = exports["default"] = function _default(props) {
  var _float = positionConfig["float"],
    clear = positionConfig.clear,
    position = positionConfig.position;
  var onStyleChange = props.onStyleChange,
    styleData = props.styleData,
    positionPropsConfig = props.positionPropsConfig;
  var isShowFloat = positionPropsConfig.isShowFloat,
    isShowClear = positionPropsConfig.isShowClear;
  var onZIndexChange = function onZIndexChange(zIndex) {
    onStyleChange === null || onStyleChange === void 0 ? void 0 : onStyleChange([{
      styleKey: 'zIndex',
      value: zIndex
    }]);
  };
  var initData = function initData() {};
  (0, _react.useEffect)(function () {
    initData();
  }, []);
  return /*#__PURE__*/React.createElement(_collapse["default"], {
    defaultExpandedKeys: ['0']
  }, /*#__PURE__*/React.createElement(Panel, {
    title: positionConfig.title
  }, /*#__PURE__*/React.createElement(_row["default"], {
    title: position.title,
    styleData: styleData,
    styleKey: "position"
  }, /*#__PURE__*/React.createElement(_select["default"], {
    dataSource: position.dataList,
    value: styleData.position,
    hasClear: true,
    onChange: function onChange(val) {
      return onStyleChange === null || onStyleChange === void 0 ? void 0 : onStyleChange([{
        styleKey: 'position',
        value: val
      }]);
    }
  })), styleData.position && styleData.position != 'static' &&
  /*#__PURE__*/
  // @ts-ignore
  React.createElement(_positionBox["default"], (0, _extends2["default"])({
    styleData: styleData,
    onStyleChange: onStyleChange
  }, props)), /*#__PURE__*/React.createElement(_row["default"], {
    title: 'zIndex',
    styleData: styleData,
    styleKey: "zIndex"
  }, /*#__PURE__*/React.createElement(_numberPicker["default"], {
    disabled: (0, _utils.isCssVarBind)(styleData.zIndex),
    step: 1,
    precision: 2,
    onChange: onZIndexChange,
    value: styleData.zIndex
  })), isShowFloat && /*#__PURE__*/React.createElement(_row["default"], {
    title: _float.title,
    dataList: _float.dataList,
    onStyleChange: onStyleChange,
    styleData: styleData,
    styleKey: "float"
  }), isShowClear && /*#__PURE__*/React.createElement(_row["default"], {
    title: clear.title,
    dataList: clear.dataList,
    onStyleChange: onStyleChange,
    styleData: styleData,
    styleKey: "clear"
  })));
};