@e-group/material-module
Version: 
EGroup Team react component modules.
33 lines (29 loc) • 1.19 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import { makeStyles } from '@material-ui/core';
import clsx from 'clsx';
import TableCell from '@material-ui/core/TableCell';
const useStyles = makeStyles(() => ({
  root: props => {
    var _props$directionValue;
    return {
      position: 'sticky',
      zIndex: props.isOverlapping ? 4 : 3,
      backgroundColor: '#fafafa',
      [props.direction]: (_props$directionValue = props.directionValue) !== null && _props$directionValue !== void 0 ? _props$directionValue : 0
    };
  }
}));
const DataTableFixedTableCell = props => {
  const className = props.className,
        direction = props.direction,
        isOverlapping = props.isOverlapping,
        directionValue = props.directionValue,
        other = _objectWithoutProperties(props, ["className", "direction", "isOverlapping", "directionValue"]);
  const classes = useStyles(props);
  return /*#__PURE__*/React.createElement(TableCell, _extends({
    className: clsx(className, classes.root)
  }, other));
};
export default DataTableFixedTableCell;