@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
28 lines (27 loc) • 1.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderScopeSummary = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
const Flex_1 = require("../../../components/Flex");
const clsx_1 = tslib_1.__importDefault(require("clsx"));
const Tag_1 = require("../../../components/Tag/Tag");
const renderScopeSummary = (data) => {
const { api: { columnScopeApi: scopeApi }, } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
const columnsInScope = scopeApi.getColumnsInScope(data.Scope);
return (React.createElement(React.Fragment, null,
React.createElement(Flex_1.Box, null,
React.createElement(Flex_1.Box, { className: "twa:text-2" }, scopeApi.scopeIsAll(data.Scope)
? 'Changes to any Column in the row will trigger an Alert'
: null)),
React.createElement(Flex_1.Box, { className: "twa:overflow-hidden" }, 'ColumnIds' in data.Scope ? (React.createElement(React.Fragment, null,
React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('twa:text-2', columnsInScope.length ? 'twa:mb-2' : 'twa:mb-0') }, "Changes in selected columns will trigger an alert"),
columnsInScope.length ? (React.createElement(Tag_1.TagList, { tags: columnsInScope.map((c) => c.friendlyName) })) : null)) : null),
React.createElement(Flex_1.Box, null, 'DataTypes' in data.Scope ? (React.createElement(React.Fragment, null,
React.createElement(Flex_1.Box, { className: "twa:text-2 twa:mb-2" }, "Changes in Columns with these Data Types trigger an Alert"),
React.createElement(Tag_1.TagList, { tags: data.Scope.DataTypes.map((dataType) => {
return `DataType: ${dataType}`;
}) }))) : null)));
};
exports.renderScopeSummary = renderScopeSummary;