import _NumberPicker from "@alifd/next/es/number-picker";
import _extends from "@babel/runtime/helpers/extends";
import _Select from "@alifd/next/es/select";
import _Collapse from "@alifd/next/es/collapse";
import * as React from 'react';
import Row from '../../components/row';
import { useEffect } from 'react';
import PositionBox from '../position/positionBox';
import { intlLocal } from './locale';
import { isCssVarBind } from '../../utils';
var Panel = _Collapse.Panel;
var positionConfig = intlLocal();
export default (function (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([{
      styleKey: 'zIndex',
      value: zIndex
    }]);
  };
  var initData = function initData() {};
  useEffect(function () {
    initData();
  }, []);
  return /*#__PURE__*/React.createElement(_Collapse, {
    defaultExpandedKeys: ['0']
  }, /*#__PURE__*/React.createElement(Panel, {
    title: positionConfig.title
  }, /*#__PURE__*/React.createElement(Row, {
    title: position.title,
    styleData: styleData,
    styleKey: "position"
  }, /*#__PURE__*/React.createElement(_Select, {
    dataSource: position.dataList,
    value: styleData.position,
    hasClear: true,
    onChange: function onChange(val) {
      return onStyleChange([{
        styleKey: 'position',
        value: val
      }]);
    }
  })), styleData.position && styleData.position != 'static' && /*#__PURE__*/React.createElement(PositionBox, _extends({
    styleData: styleData,
    onStyleChange: onStyleChange
  }, props)), /*#__PURE__*/React.createElement(Row, {
    title: 'zIndex',
    styleData: styleData,
    styleKey: "zIndex"
  }, /*#__PURE__*/React.createElement(_NumberPicker, {
    disabled: isCssVarBind(styleData.zIndex),
    step: 1,
    precision: 2,
    onChange: onZIndexChange,
    value: styleData.zIndex
  })), isShowFloat && /*#__PURE__*/React.createElement(Row, {
    title: _float.title,
    dataList: _float.dataList,
    onStyleChange: onStyleChange,
    styleData: styleData,
    styleKey: "float"
  }), isShowClear && /*#__PURE__*/React.createElement(Row, {
    title: clear.title,
    dataList: clear.dataList,
    onStyleChange: onStyleChange,
    styleData: styleData,
    styleKey: "clear"
  })));
});