import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import * as React from 'react';
import { PureComponent } from 'react';
import "./index.scss";
var positionSetter = /*#__PURE__*/function (_PureComponent) {
  _inheritsLoose(positionSetter, _PureComponent);
  function positionSetter() {
    return _PureComponent.apply(this, arguments) || this;
  }
  var _proto = positionSetter.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      value = _this$props.value,
      onChange = _this$props.onChange;
    // 定位块点击事件
    var evDomCk = function evDomCk(ev) {
      return onChange(ev.target.getAttribute('data-n'));
    };

    // 定位块样式与高亮
    function getClasses(name) {
      var _c = name.split('')[0];
      var isActive = name === value && 'active';
      return "ev-dom " + {
        l: 'left',
        c: 'center',
        r: 'right'
      }[_c] + " " + isActive;
    }
    return /*#__PURE__*/React.createElement("div", {
      className: "position"
    }, /*#__PURE__*/React.createElement("div", {
      className: "pos-main",
      onClick: evDomCk
    }, /*#__PURE__*/React.createElement("div", {
      className: "pos-main-li top"
    }, /*#__PURE__*/React.createElement("div", {
      className: getClasses('lt'),
      "data-n": "lt"
    }), /*#__PURE__*/React.createElement("div", {
      className: getClasses('ct'),
      "data-n": "ct"
    }), /*#__PURE__*/React.createElement("div", {
      className: getClasses('rt'),
      "data-n": "rt"
    })), /*#__PURE__*/React.createElement("div", {
      className: "pos-main-li middel"
    }, /*#__PURE__*/React.createElement("div", {
      className: getClasses('lc'),
      "data-n": "lc"
    }), /*#__PURE__*/React.createElement("div", {
      className: getClasses('cc'),
      "data-n": "cc"
    }), /*#__PURE__*/React.createElement("div", {
      className: getClasses('rc'),
      "data-n": "rc"
    })), /*#__PURE__*/React.createElement("div", {
      className: "pos-main-li bottom"
    }, /*#__PURE__*/React.createElement("div", {
      className: getClasses('lb'),
      "data-n": "lb"
    }), /*#__PURE__*/React.createElement("div", {
      className: getClasses('cb'),
      "data-n": "cb"
    }), /*#__PURE__*/React.createElement("div", {
      className: getClasses('rb'),
      "data-n": "rb"
    }))));
  };
  return positionSetter;
}(PureComponent);
positionSetter.displayName = 'positionSetter';
export { positionSetter as default };