function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from "react";
import Sortable from "../DragSortList";
var defaultActivationConstraint = {
  distance: 5
};
var SortableList = function SortableList(props) {
  var dataSource = props.dataSource,
    onChange = props.onChange,
    rowKey = props.rowKey,
    renderItem = props.renderItem,
    _props$activationCons = props.activationConstraint,
    activationConstraint = _props$activationCons === void 0 ? defaultActivationConstraint : _props$activationCons;
  return /*#__PURE__*/React.createElement(Sortable, {
    list: dataSource,
    rowKey: rowKey,
    onChange: onChange,
    activationConstraint: activationConstraint
  }, function (params) {
    var item = params.item,
      p = params.props,
      attributes = params.attributes,
      listeners = params.listeners,
      style = params.style;
    return /*#__PURE__*/React.createElement("div", _extends({}, p, attributes, listeners, {
      style: style
    }), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item));
  });
};
export default SortableList;