"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.TableContextProvider = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _mobxReactLite = require("mobx-react-lite");

var _shared = require("choerodon-ui/shared");

var _excluded = ["children", "tableStore", "dataSet"];
var TableContext = (0, _shared.getContext)(_shared.Symbols.ProTableContext, {
  tableStore: {},
  dataSet: {},
  indentSize: 15,
  rowHeight: 30
});

var TableContextProvider = function TableContextProvider(props) {
  var children = props.children,
      tableStore = props.tableStore,
      dataSet = props.dataSet,
      other = (0, _objectWithoutProperties2["default"])(props, _excluded);
  var value = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
    dataSet: dataSet,
    tableStore: tableStore,
    border: tableStore.border,
    columnEditorBorder: tableStore.columnEditorBorder,
    rowHeight: tableStore.rowHeight,
    aggregation: tableStore.aggregation,
    inlineEdit: tableStore.inlineEdit,
    expandIconAsCell: tableStore.expandIconAsCell,
    canTreeLoadData: tableStore.canTreeLoadData,
    parityRow: tableStore.parityRow,
    checkField: dataSet.props.checkField
  });
  return /*#__PURE__*/_react["default"].createElement(TableContext.Provider, {
    value: value
  }, children);
};

TableContextProvider.displayName = 'TableContextProvider';
var ObserverTableContextProvider = (0, _mobxReactLite.observer)(TableContextProvider);
exports.TableContextProvider = ObserverTableContextProvider;
var _default = TableContext;
exports["default"] = _default;
//# sourceMappingURL=TableContext.js.map
