@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
108 lines (107 loc) • 5.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StyledColumnWizardSettingsSection = exports.renderStyledColumnWizardSettingsSummary = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const CheckBox_1 = require("../../../components/CheckBox");
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
const Tabs_1 = require("../../../components/Tabs");
const Tag_1 = require("../../../components/Tag");
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
const renderStyledColumnWizardSettingsSummary = (data) => {
const badgeStyle = data;
return (React.createElement(rebass_1.Box, { padding: 2 },
React.createElement(rebass_1.Text, { mt: 3 },
"Data Rows ",
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeDataRows ? 'no' : 'yes')),
' ',
React.createElement(rebass_1.Text, { mt: 3 },
"Group Rows ",
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeGroupRows ? 'no' : 'yes')),
React.createElement(rebass_1.Text, { mt: 3 },
"Summary Rows ",
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeSummaryRows ? 'no' : 'yes')),
React.createElement(rebass_1.Text, { mt: 3 },
"Total Rows ",
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeTotalRows ? 'no' : 'yes'))));
};
exports.renderStyledColumnWizardSettingsSummary = renderStyledColumnWizardSettingsSummary;
const StyledColumnWizardSettingsSection = (props) => {
const { data } = (0, OnePageAdaptableWizard_1.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,
},
},
});
};
const onExcludeTotalRowsChanged = (ExcludeTotalRows) => {
props.onChange({
...data,
BadgeStyle: {
...data.BadgeStyle,
RowScope: {
...data.BadgeStyle.RowScope,
ExcludeTotalRows,
},
},
});
};
return (React.createElement(Tabs_1.Tabs, null,
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
React.createElement(Tabs_1.Tabs.Content, null,
React.createElement(rebass_1.Flex, { flexDirection: "row" },
React.createElement(FormLayout_1.default, null,
React.createElement(FormLayout_1.FormRow, { label: "Exclude Data Rows:" },
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-data-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
React.createElement(FormLayout_1.FormRow, { label: "Exclude Group Rows:" },
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
React.createElement(FormLayout_1.FormRow, { label: "Exclude Row Summaries:" },
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))),
' ',
React.createElement(FormLayout_1.FormRow, { label: "Exclude Total Rows:" },
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-total-rows-checkbox", checked:
// @ts-ignore
data.BadgeStyle.RowScope?.ExcludeTotalRows, onChange: onExcludeTotalRowsChanged, mr: 2 }))))))));
};
exports.StyledColumnWizardSettingsSection = StyledColumnWizardSettingsSection;