@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
50 lines (49 loc) • 3.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlashingAlertRulesWizardSection = exports.renderFlashingAlertRulesSummary = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
const CodeBlock_1 = require("../../../components/CodeBlock");
const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
const renderFlashingAlertRulesSummary = (flashingAlert) => {
const { api: { flashingCellApi }, } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
const FlashTarget = flashingAlert.FlashTarget ?? flashingCellApi.getFlashingCellFlashTarget(flashingAlert);
return (React.createElement(EntityRulesEditor_1.EntityRulesSummary, { data: flashingAlert, renderPredicate: (content) => {
return (React.createElement(React.Fragment, null,
"Flash ",
React.createElement(CodeBlock_1.CodeBlock, null, FlashTarget),
" - value condition",
' ',
React.createElement(CodeBlock_1.CodeBlock, null, content)));
}, renderQueryExpression: (content) => {
return (React.createElement(React.Fragment, null,
"Flash ",
React.createElement(CodeBlock_1.CodeBlock, null, FlashTarget),
" when",
' ',
React.createElement("b", null,
React.createElement(CodeBlock_1.CodeBlock, null, content))));
} }));
};
exports.renderFlashingAlertRulesSummary = renderFlashingAlertRulesSummary;
const FlashingAlertRulesWizardSection = (props) => {
const { data, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
const predicateDefs = api.flashingCellApi.getFlashingCellPredicateDefsForScope(data.Scope);
return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: "AnyChange", data: data, predicateDefs: predicateDefs, getPredicateDefsForColId: (colId) => api.flashingCellApi.getFlashingCellPredicateDefsForScope({ ColumnIds: [colId] }), onChange: props.onChange, showAggregation: false, showObservable: false, showBoolean: true, showPredicate: true, descriptions: {
selectPredicate: 'Select an Flashing Cell Rule - to be applied when data changes',
useBooleanQuery: (React.createElement(React.Fragment, null,
"Use an BooleanQuery if ",
React.createElement("i", null, "Scope"),
" is 'All Columns' - so any data change may be evaluated in a complex BooleanExpression")),
useObservableQuery: (React.createElement(React.Fragment, null,
"Use an ObservableQuery if ",
React.createElement("i", null, "Scope"),
" is 'All Columns' - so any data change may be evaluated in a complex ObservableExpression")),
useAggregationQuery: (React.createElement(React.Fragment, null,
"Use an AggregatedBooleanQuery if ",
React.createElement("i", null, "Scope"),
" is 'All Columns' - so any data change may be evaluated in a complex AggregatedBooleanExpression")),
} }));
};
exports.FlashingAlertRulesWizardSection = FlashingAlertRulesWizardSection;