import _pick from "ramda/src/pick";
var _excluded = ["sm", "md", "lg", "xl"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { useContext } from 'react';
import { FlexTableContext } from './FlexTableProvider';
export var useFlexTable = function useFlexTable() {
  var contextData = useContext(FlexTableContext);
  if (contextData === undefined) {
    throw Error('No FlexTable provider, FlexTable rows can only be children of a FlexTable');
  }
  var _contextData$sm = contextData.sm,
    sm = _contextData$sm === void 0 ? {} : _contextData$sm,
    _contextData$md = contextData.md,
    md = _contextData$md === void 0 ? {} : _contextData$md,
    _contextData$lg = contextData.lg,
    lg = _contextData$lg === void 0 ? {} : _contextData$lg,
    _contextData$xl = contextData.xl,
    xl = _contextData$xl === void 0 ? {} : _contextData$xl,
    xs = _objectWithoutProperties(contextData, _excluded);
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return {
    xs: _pick(args, xs),
    sm: _pick(args, sm),
    md: _pick(args, md),
    lg: _pick(args, lg),
    xl: _pick(args, xl)
  };
};