UNPKG

@mui/x-data-grid-premium

Version:

The Premium plan edition of the MUI X Data Grid Components.

47 lines 1.91 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _excluded = ["hideMenu", "options"]; import PropTypes from 'prop-types'; import { useGridApiContext } from "../hooks/utils/useGridApiContext.js"; import { useGridRootProps } from "../hooks/utils/useGridRootProps.js"; import { jsx as _jsx } from "react/jsx-runtime"; function GridExcelExportMenuItem(props) { const apiRef = useGridApiContext(); const rootProps = useGridRootProps(); const { hideMenu, options } = props, other = _objectWithoutPropertiesLoose(props, _excluded); return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({ onClick: () => { apiRef.current.exportDataAsExcel(options); hideMenu?.(); } }, other, { 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 "pnpm proptypes" | // ---------------------------------------------------------------------- hideMenu: PropTypes.func, options: PropTypes.shape({ allColumns: PropTypes.bool, columnsStyles: PropTypes.object, disableToolbarButton: PropTypes.bool, escapeFormulas: PropTypes.bool, exceljsPostProcess: PropTypes.func, exceljsPreProcess: PropTypes.func, fields: PropTypes.arrayOf(PropTypes.string), fileName: PropTypes.string, getRowsToExport: PropTypes.func, includeColumnGroupsHeaders: PropTypes.bool, includeHeaders: PropTypes.bool, valueOptionsSheetName: PropTypes.string, worker: PropTypes.func }) } : void 0; export { GridExcelExportMenuItem };