| | |
| | | |
| | | import React, { useMemo } from 'react'; |
| | | import React, { useMemo, useRef, useEffect } from 'react'; |
| | | import { DataTable, useDataTableDataContext, useTranslate } from 'react-admin'; |
| | | import { TableFooter, TableRow, TableCell } from '@mui/material'; |
| | | |
| | |
| | | }; |
| | | }, [bulkActionsOffsetY]); |
| | | |
| | | const containerRef = useRef(null); |
| | | useEffect(() => { |
| | | const el = containerRef.current; |
| | | if (!el) return; |
| | | const clearExpandIconAriaHidden = () => { |
| | | el.querySelectorAll('.RaDataTable-expandIcon').forEach((btn) => btn.removeAttribute('aria-hidden')); |
| | | }; |
| | | clearExpandIconAriaHidden(); |
| | | const mo = new MutationObserver(clearExpandIconAriaHidden); |
| | | mo.observe(el, { attributes: true, attributeFilter: ['aria-hidden'], subtree: true }); |
| | | return () => mo.disconnect(); |
| | | }, []); |
| | | |
| | | return ( |
| | | <span ref={containerRef} style={{ display: 'contents' }}> |
| | | <DataTable {...props} foot={footerComponent} sx={dataTableStyles}> |
| | | {/* {processedChildren} */} |
| | | {processedChildren |
| | |
| | | )) |
| | | } |
| | | </DataTable> |
| | | </span> |
| | | ); |
| | | }; |
| | | |