export default (function (setVersionChildren) {
  return {
    autoQuery: false,
    paging: false,
    expandField: 'expand',
    events: {
      select: function select(_ref) {
        var record = _ref.record;
        setVersionChildren(record);
        record.get('childrenDataSet').selectAll();
        record.set('indeterminate', false);
      },
      unSelect: function unSelect(_ref2) {
        var _record$get;

        var record = _ref2.record;
        (_record$get = record.get('childrenDataSet')) === null || _record$get === void 0 ? void 0 : _record$get.unSelectAll();
        record.set('indeterminate', false);
      },
      selectAll: function selectAll(_ref3) {
        var dataSet = _ref3.dataSet;
        dataSet.forEach(function (record) {
          setVersionChildren(record);
          record.get('childrenDataSet').selectAll();
          record.set('indeterminate', false);
        });
      },
      unSelectAll: function unSelectAll(_ref4) {
        var dataSet = _ref4.dataSet;
        dataSet.forEach(function (record) {
          if (record.get('childrenDataSet')) {
            record.get('childrenDataSet').unSelectAll();
            record.set('indeterminate', false);
          }
        });
      }
    }
  };
});