@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
19 lines (18 loc) • 1.6 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as React from 'react';
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
import { NewScopeComponent } from '../../Components/NewScopeComponent';
import { Box, Flex } from '../../../components/Flex';
export const ShortcutScopeWizardSection = (props) => {
const { data, api } = useOnePageAdaptableWizardContext();
const availableColumns = React.useMemo(() => api.columnApi.getNumericColumns(), []);
return (_jsxs(Flex, { flexDirection: "column", className: "twa:h-full", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Target" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Specify where the Shortcut should be applied (numeric columns only)" })] }), _jsx(Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:p-2", children: _jsx(NewScopeComponent, { disableDataTypes: true, scopeColumns: availableColumns, scope: data.Scope, descriptions: {
rowScope: 'All Numeric Columns will have the Shortcut applied',
columnScope: 'Selected Columns will have the Shortcut applied',
}, updateScope: (Scope) => {
props.onChange({
...data,
Scope: Scope,
});
} }) })] }));
};