UNPKG

@mui/x-data-grid-premium

Version:

The Premium plan edition of the data grid component (MUI X).

30 lines (28 loc) 1.19 kB
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"; var GridExcelExportMenuItem = function GridExcelExportMenuItem(props) { var apiRef = useGridApiContext(); var hideMenu = props.hideMenu, options = props.options; return /*#__PURE__*/_jsx(MenuItem, { onClick: function 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 };