@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
82 lines (81 loc) • 3.91 kB
JavaScript
import * as React from 'react';
import { Box, Flex, Text } from 'rebass';
import { CheckBox } from '../../../components/CheckBox';
import FormLayout, { FormRow } from '../../../components/FormLayout';
import { Tabs } from '../../../components/Tabs';
import { Tag } from '../../../components/Tag';
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
export const renderStyledColumnWizardSettingsSummary = (data) => {
const badgeStyle = data;
return (React.createElement(Box, { padding: 2 },
React.createElement(Text, { mt: 3 },
"Data Rows ",
React.createElement(Tag, null, badgeStyle.RowScope?.ExcludeDataRows ? 'no' : 'yes')),
' ',
React.createElement(Text, { mt: 3 },
"Group Rows ",
React.createElement(Tag, null, badgeStyle.RowScope?.ExcludeGroupRows ? 'no' : 'yes')),
React.createElement(Text, { mt: 3 },
"Summary Rows ",
React.createElement(Tag, null, badgeStyle.RowScope?.ExcludeSummaryRows ? 'no' : 'yes'))));
};
export const StyledColumnWizardSettingsSection = (props) => {
const { data } = useOnePageAdaptableWizardContext();
const onExcludeDataRowsChanged = (ExcludeDataRows) => {
props.onChange({
...data,
BadgeStyle: {
...data.BadgeStyle,
RowScope: {
...data.BadgeStyle.RowScope,
ExcludeDataRows,
},
},
});
};
const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
props.onChange({
...data,
BadgeStyle: {
...data.BadgeStyle,
RowScope: {
...data.BadgeStyle.RowScope,
ExcludeGroupRows: ExcludeGroupedRows,
},
},
});
};
const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
props.onChange({
...data,
BadgeStyle: {
...data.BadgeStyle,
RowScope: {
...data.BadgeStyle.RowScope,
ExcludeSummaryRows,
},
},
});
};
return (React.createElement(Tabs, null,
React.createElement(Tabs.Tab, null, "Settings"),
React.createElement(Tabs.Content, null,
React.createElement(Flex, { flexDirection: "row" },
React.createElement(FormLayout, null,
React.createElement(FormRow, { label: "Exclude Data Rows:" },
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox, { "data-name": "exclude-data-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
React.createElement(FormRow, { label: "Exclude Group Rows:" },
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
React.createElement(FormRow, { label: "Exclude Row Summaries:" },
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))),
' ')))));
};