"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
var _react = _interopRequireDefault(require("react"));
var Option = _select["default"].Option;
var WebRowOrder = /*#__PURE__*/function (_React$Component) {
  (0, _inheritsLoose2["default"])(WebRowOrder, _React$Component);
  function WebRowOrder() {
    return _React$Component.apply(this, arguments) || this;
  }
  var _proto = WebRowOrder.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      items = _this$props.items,
      nextTablePrefix = _this$props.nextTablePrefix,
      defaultValue = _this$props.defaultValue,
      onChange = _this$props.onChange;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: nextTablePrefix + "row-order"
    }, /*#__PURE__*/_react["default"].createElement(_select["default"], {
      defaultValue: defaultValue.value,
      onChange: onChange,
      hasBorder: false,
      autoWidth: false,
      hasArrow: false,
      valueRender: function valueRender(item) {
        return /*#__PURE__*/_react["default"].createElement("span", {
          className: nextTablePrefix + "row-order-v"
        }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
          type: "order-by",
          size: "small"
        }), item.label);
      }
    }, items.map(function (item) {
      return /*#__PURE__*/_react["default"].createElement(Option, {
        key: item.value,
        value: item.value
      }, item.text);
    })));
  };
  return WebRowOrder;
}(_react["default"].Component);
exports["default"] = WebRowOrder;