All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.table.TableRowTooltip.js Maven / Gradle / Ivy

import * as React         from 'react'
import {
  TableCell,
  TableRow as MuiTableRow
} from '@mui/material'
import { RenderValue }    from 'components/render'
import TableRowMenu       from 'components/table/TableRowMenu'
import { MenuItemContext } from "contexts/MenuContext";

export default function TableRow({row, columns, index}) {
  //const [contextMenu, setContextMenu] = React.useState(null);
  //const handleMenu = React.useContext(MenuItemContext)
  //const menu = handleMenu && handleMenu(row)

  const handleContextMenu = (event) => {
    // disable context menu, when text is selected
    if (window.getSelection().type == 'Range')
      return false
    
    if (menu?.length) {
      event.preventDefault();
      setContextMenu(
        contextMenu === null
          ? {
              x: event.clientX - 15,
              y: event.clientY - 6,
            }
          : null
      )
    }
  }

  return (
    
      
      {/**/}
    
  )
}

const TableRows = ({row, columns}) => {
  return columns.map((column, index) => {
    const sx = row.rowProps?.fontWeight?  { fontWeight: row.rowProps.fontWeight } : {}

    return (
      
        
          {_.get(row, "cells." + column.field)}
        
      
    )
  })
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy