UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

36 lines (35 loc) 1.31 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { NewDropdownButton } from '../../../components/DropdownButton'; import { handleExportState } from '../handleExportState'; export const ExportDropdown = (props) => { const { api, type, ...rest } = props; const handleChange = (destination) => { switch (type) { case 'adaptableState': { const adaptableState = api.stateApi.getPersistentState(); handleExportState(destination, 'adaptableState', adaptableState, api); break; } case 'initialState': { const initialState = api.stateApi.getInitialState(); handleExportState(destination, 'initialState', initialState, api); break; } } }; const destinationOptions = [ { label: 'Clipboard', onClick: () => handleChange('Clipboard'), }, { label: 'Console', onClick: () => handleChange('Console'), }, { label: 'JSON', onClick: () => handleChange('JSON'), }, ]; return (_jsx(NewDropdownButton, { variant: "outlined", className: "ab-StateManagement__Export-Dropdown", ...rest, items: destinationOptions })); };