@mui/x-data-grid-premium
Version:
The Premium plan edition of the data grid component (MUI X).
32 lines (30 loc) • 1.13 kB
JavaScript
import * as React from 'react';
import PropTypes from 'prop-types';
import MenuItem from '@mui/material/MenuItem';
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
import { jsx as _jsx } from "react/jsx-runtime";
const GridExcelExportMenuItem = props => {
const apiRef = useGridApiContext();
const {
hideMenu,
options
} = props;
return /*#__PURE__*/_jsx(MenuItem, {
onClick: () => {
apiRef.current.exportDataAsExcel(options);
hideMenu == null ? void 0 : hideMenu();
},
children: apiRef.current.getLocaleText('toolbarExportExcel')
});
};
process.env.NODE_ENV !== "production" ? GridExcelExportMenuItem.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
hideMenu: PropTypes.func,
options: PropTypes.shape({
disableToolbarButton: PropTypes.bool
})
} : void 0;
export { GridExcelExportMenuItem };