'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _mxa = require('../../../../components/mxa');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Created by baoyinghai on 5/31/17.
 */
var Option = _mxa.Select.Option;

var keyMap = {
  x: 'x轴',
  y: 'y轴',
  lname: '折线标题'
};

exports.default = {
  getKeys: function getKeys(keys) {
    return Object.keys(keyMap);
  },
  setFormItems: function setFormItems(key, setting, fields) {
    return {
      key: key,
      label: keyMap[key],
      comp: _react2.default.createElement(
        _mxa.Select,
        null,
        fields.map(function (f) {
          return _react2.default.createElement(
            Option,
            { value: f },
            f
          );
        })
      ),
      initData: setting[key] || key
    };
  }
};