@adaptabletools/adaptable-cjs 20.2.10 → 20.3.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +4 -0
- package/agGrid.js +4 -0
- package/base.css +6 -6
- package/base.css.map +1 -1
- package/index.css +6 -6
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/ColumnOptions.d.ts +3 -2
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +1 -0
- package/src/AdaptableOptions/PredicateOptions.d.ts +2 -1
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -2
- package/src/AdaptableState/Common/AdaptableColumn.js +2 -1
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +4 -0
- package/src/AdaptableState/Common/AdaptableObject.d.ts +1 -1
- package/src/AdaptableState/Common/AdaptablePredicate.d.ts +4 -0
- package/src/AdaptableState/Common/AdaptablePredicate.js +17 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +1 -1
- package/src/AdaptableState/Common/CustomWindowConfig.d.ts +40 -0
- package/src/AdaptableState/Common/ProgressIndicatorConfig.d.ts +8 -1
- package/src/AdaptableState/Common/RowScope.d.ts +4 -0
- package/src/AdaptableState/FormatColumnState.d.ts +10 -0
- package/src/AdaptableState/StyledColumnState.d.ts +4 -0
- package/src/Api/ColumnApi.d.ts +6 -0
- package/src/Api/GridApi.d.ts +8 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +14 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +3 -0
- package/src/Api/Implementation/LayoutHelpers.js +6 -6
- package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -1
- package/src/Api/Implementation/PredicateApiImpl.js +25 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +3 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +6 -0
- package/src/Api/Internal/ColumnInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnInternalApi.js +3 -0
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +13 -4
- package/src/Api/Internal/FormatColumnInternalApi.js +33 -6
- package/src/Api/UserInterfaceApi.d.ts +16 -4
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -1
- package/src/Redux/ActionsReducers/PopupRedux.js +1 -0
- package/src/Strategy/StyledColumnModule.js +8 -3
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +6 -0
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -2
- package/src/Utilities/Helpers/FormatHelper.js +3 -0
- package/src/Utilities/getScopeViewItems.js +1 -1
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +1 -1
- package/src/View/Components/ColumnFilter/utils.js +9 -4
- package/src/View/Components/Popups/AdaptablePopupConfirmation.js +3 -4
- package/src/View/Components/Popups/AdaptablePopupPrompt.js +3 -4
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +1 -5
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -0
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +16 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +67 -23
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +34 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +18 -21
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +22 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +6 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +34 -0
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +27 -1
- package/src/agGrid/AgGridAdapter.js +2 -6
- package/src/agGrid/AgGridColumnAdapter.d.ts +4 -1
- package/src/agGrid/AgGridColumnAdapter.js +109 -10
- package/src/agGrid/cellRenderers/ActionColumnRenderer.js +14 -2
- package/src/agGrid/cellRenderers/BadgeRenderer.js +27 -13
- package/src/components/ProgressIndicator/ProgressIndicator.js +18 -4
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +43 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -24,6 +24,7 @@ const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstant
|
|
|
24
24
|
const Textarea_1 = tslib_1.__importDefault(require("../../../components/Textarea"));
|
|
25
25
|
const ButtonInfo_1 = require("../../Components/Buttons/ButtonInfo");
|
|
26
26
|
const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/DocumentationLinkConstants");
|
|
27
|
+
const AdaptableColumn_1 = require("../../../AdaptableState/Common/AdaptableColumn");
|
|
27
28
|
const DOLLAR_OPTIONS = {
|
|
28
29
|
FractionDigits: 2,
|
|
29
30
|
FractionSeparator: '.',
|
|
@@ -149,6 +150,18 @@ const getFormatDisplayTypeForScope = (scope, api) => {
|
|
|
149
150
|
return 'text';
|
|
150
151
|
}
|
|
151
152
|
if ('ColumnTypes' in scope && scope.ColumnTypes.length) {
|
|
153
|
+
// if a Pivot Total Column Type is specified, we can safely assume that the data type is number
|
|
154
|
+
const pivotTotalTypes = [
|
|
155
|
+
AdaptableColumn_1.PIVOT_ANY_TOTAL_COLUMN_TYPE,
|
|
156
|
+
AdaptableColumn_1.PIVOT_GRAND_TOTAL_COLUMN_TYPE,
|
|
157
|
+
AdaptableColumn_1.PIVOT_COLUMN_TOTAL_COLUMN_TYPE,
|
|
158
|
+
AdaptableColumn_1.PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE,
|
|
159
|
+
];
|
|
160
|
+
// if all column types are pivot total types, we can safely assume that the data type is number
|
|
161
|
+
if (scope.ColumnTypes.length > 0 &&
|
|
162
|
+
scope.ColumnTypes.every((type) => pivotTotalTypes.includes(type))) {
|
|
163
|
+
return 'number';
|
|
164
|
+
}
|
|
152
165
|
// need to check if all column with this column type has the same data type and return that particular one
|
|
153
166
|
const columns = scope.ColumnTypes.flatMap((columnType) => {
|
|
154
167
|
return api.columnApi.getColumnsByColumnType(columnType);
|
|
@@ -302,7 +315,9 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
302
315
|
React.createElement(FormLayout_1.FormRow, { label: "Floor" },
|
|
303
316
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "floor-checkbox", checked: data.DisplayFormat.Options.Floor, onChange: (checked) => setFormatOption('Floor', checked) })),
|
|
304
317
|
React.createElement(FormLayout_1.FormRow, { label: "Round" },
|
|
305
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) }))
|
|
318
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) })),
|
|
319
|
+
React.createElement(FormLayout_1.FormRow, { label: "Empty" },
|
|
320
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "empty-checkbox", checked: data.DisplayFormat.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) })))))),
|
|
306
321
|
scopedCustomFormatters.length > 0 && (React.createElement(Tabs_1.Tabs, { marginTop: 2, keyboardNavigation: false },
|
|
307
322
|
React.createElement(Tabs_1.Tabs.Tab, null, "Custom Formats"),
|
|
308
323
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -6,6 +6,11 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
|
|
7
7
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
10
|
+
const rebass_1 = require("rebass");
|
|
11
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
12
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
13
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
9
14
|
const renderFormatColumnScopeSummary = (data) => {
|
|
10
15
|
return (0, NewScopeComponent_1.renderScopeSummary)(data.Scope, {
|
|
11
16
|
scopeWholeRow: 'Matching rows will be formatted',
|
|
@@ -16,29 +21,68 @@ const renderFormatColumnScopeSummary = (data) => {
|
|
|
16
21
|
exports.renderFormatColumnScopeSummary = renderFormatColumnScopeSummary;
|
|
17
22
|
const FormatColumnScopeWizardSection = (props) => {
|
|
18
23
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const currentTargets = data.Target?.length ? data.Target : ['cell'];
|
|
25
|
+
const handleTargetChange = (target, checked) => {
|
|
26
|
+
let newTargets;
|
|
27
|
+
if (checked) {
|
|
28
|
+
// Add the target if it's not already included
|
|
29
|
+
newTargets = [...new Set([...currentTargets, target])];
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// Remove the target
|
|
33
|
+
newTargets = currentTargets.filter((t) => t !== target);
|
|
34
|
+
}
|
|
35
|
+
// If all checkboxes are unchecked, default to ['cell']
|
|
36
|
+
if (newTargets.length === 0) {
|
|
37
|
+
newTargets = ['cell'];
|
|
38
|
+
}
|
|
39
|
+
// Update the formatColumn object
|
|
40
|
+
props.onChange({
|
|
41
|
+
...data,
|
|
42
|
+
Target: newTargets,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
return (React.createElement(React.Fragment, null,
|
|
46
|
+
React.createElement(Tabs_1.Tabs, { mb: 3 },
|
|
47
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Target"),
|
|
48
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
49
|
+
React.createElement(rebass_1.Flex, { flexDirection: "column" },
|
|
50
|
+
React.createElement(FormLayout_1.default, { width: "100%" },
|
|
51
|
+
React.createElement(FormLayout_1.FormRow, { label: "Target Column Elements: ", tooltip: "The visual elements where formatting will be applied" },
|
|
52
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "target-cell", checked: currentTargets.includes('cell'), onChange: (target) => {
|
|
53
|
+
handleTargetChange('cell', target);
|
|
54
|
+
}, ml: 2 }, "Data Cells"),
|
|
55
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "target-column-header", checked: currentTargets.includes('columnHeader'), onChange: (target) => {
|
|
56
|
+
handleTargetChange('columnHeader', target);
|
|
57
|
+
}, ml: 4 }, "Column Headers"))),
|
|
58
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2 }, 'At least one target element must be selected (defaults to Data Cells).' +
|
|
59
|
+
' Conditional formatting rules only apply to Data Cells, not to Headers.')))),
|
|
60
|
+
React.createElement(rebass_1.Box, { "data-name": 'scope-heading', style: {
|
|
61
|
+
borderRadius: `var(--ab__border-radius)`,
|
|
62
|
+
}, padding: 2, backgroundColor: `var(--ab-color-primarylight)` }, "Scope"),
|
|
63
|
+
React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
|
|
64
|
+
rowScope: 'Format all columns in the row',
|
|
65
|
+
columnScope: 'Select columns to format',
|
|
66
|
+
}, scope: data.Scope, updateScope: (Scope) => {
|
|
67
|
+
const newData = { ...data, Scope };
|
|
68
|
+
const wholeRow = api.columnScopeApi.scopeIsAll(Scope);
|
|
69
|
+
if (newData.Rule?.Predicates?.length) {
|
|
70
|
+
if (wholeRow) {
|
|
71
|
+
// if scope is whole row, a predicate cannot be present, so we set the rule
|
|
72
|
+
// to be a boolean expression
|
|
73
|
+
delete newData.Rule.Predicates;
|
|
74
|
+
newData.Rule.BooleanExpression = '';
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// if scope is not whole row, if you have a predicate, reset it
|
|
78
|
+
newData.Rule.Predicates = [
|
|
79
|
+
{
|
|
80
|
+
PredicateId: constants_1.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN,
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
}
|
|
31
84
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
newData.Rule.Predicates = [
|
|
35
|
-
{
|
|
36
|
-
PredicateId: constants_1.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN,
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
props.onChange(newData);
|
|
42
|
-
} }));
|
|
85
|
+
props.onChange(newData);
|
|
86
|
+
} })));
|
|
43
87
|
};
|
|
44
88
|
exports.FormatColumnScopeWizardSection = FormatColumnScopeWizardSection;
|
|
@@ -11,6 +11,7 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
|
11
11
|
const Tag_1 = require("../../../components/Tag");
|
|
12
12
|
const ToggleGroup_1 = require("../../../components/Toggle/ToggleGroup");
|
|
13
13
|
const Toggle_1 = require("../../../components/Toggle/Toggle");
|
|
14
|
+
const Radio_1 = tslib_1.__importStar(require("../../../components/Radio"));
|
|
14
15
|
const renderFormatColumnSettingsSummary = (data) => {
|
|
15
16
|
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
16
17
|
React.createElement(rebass_1.Text, null,
|
|
@@ -25,7 +26,16 @@ const renderFormatColumnSettingsSummary = (data) => {
|
|
|
25
26
|
React.createElement(Tag_1.Tag, null, data.RowScope?.ExcludeGroupRows ? 'no' : 'yes')),
|
|
26
27
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
27
28
|
"Summary Rows ",
|
|
28
|
-
React.createElement(Tag_1.Tag, null, data.RowScope?.ExcludeSummaryRows ? 'no' : 'yes'))
|
|
29
|
+
React.createElement(Tag_1.Tag, null, data.RowScope?.ExcludeSummaryRows ? 'no' : 'yes')),
|
|
30
|
+
React.createElement(rebass_1.Text, { mt: 3 },
|
|
31
|
+
"Total Rows ",
|
|
32
|
+
React.createElement(Tag_1.Tag, null, data.RowScope?.ExcludeTotalRows ? 'no' : 'yes')),
|
|
33
|
+
React.createElement(rebass_1.Text, { mt: 3 },
|
|
34
|
+
"Apply on Column Groups:",
|
|
35
|
+
' ',
|
|
36
|
+
React.createElement(Tag_1.Tag, null, !data.ColumnGroupScope || data.ColumnGroupScope === 'Both'
|
|
37
|
+
? 'Always'
|
|
38
|
+
: data.ColumnGroupScope))));
|
|
29
39
|
};
|
|
30
40
|
exports.renderFormatColumnSettingsSummary = renderFormatColumnSettingsSummary;
|
|
31
41
|
const FormatColumnSettingsWizardSection = (props) => {
|
|
@@ -64,6 +74,15 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
64
74
|
},
|
|
65
75
|
});
|
|
66
76
|
};
|
|
77
|
+
const onExcludeTotalRowsChanged = (ExcludeTotalRows) => {
|
|
78
|
+
props.onChange({
|
|
79
|
+
...data,
|
|
80
|
+
RowScope: {
|
|
81
|
+
...data.RowScope,
|
|
82
|
+
ExcludeTotalRows,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
};
|
|
67
86
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
68
87
|
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
69
88
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -88,6 +107,19 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
88
107
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked: data.RowScope?.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
|
|
89
108
|
React.createElement(FormLayout_1.FormRow, { label: "Exclude Row Summaries:" },
|
|
90
109
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
91
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked: data.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 })))
|
|
110
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked: data.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))),
|
|
111
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Total Rows:" },
|
|
112
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
113
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-total-rows-checkbox", checked: data.RowScope?.ExcludeTotalRows, onChange: onExcludeTotalRowsChanged, mr: 2 }))),
|
|
114
|
+
React.createElement(FormLayout_1.FormRow, { label: "Apply on Column Group:" },
|
|
115
|
+
React.createElement(Radio_1.RadioGroup, { value: data.ColumnGroupScope || 'Both', name: "columnGroupScope", orientation: "horizontal", onRadioChange: (columnGroupScope) => {
|
|
116
|
+
props.onChange({
|
|
117
|
+
...data,
|
|
118
|
+
ColumnGroupScope: columnGroupScope,
|
|
119
|
+
});
|
|
120
|
+
} },
|
|
121
|
+
React.createElement(Radio_1.default, { marginLeft: 1, value: "Both" }, "Always"),
|
|
122
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Expanded" }, "Expanded"),
|
|
123
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Collapsed" }, "Collapsed"))))))));
|
|
92
124
|
};
|
|
93
125
|
exports.FormatColumnSettingsWizardSection = FormatColumnSettingsWizardSection;
|
|
@@ -92,7 +92,7 @@ function FormatColumnWizard(props) {
|
|
|
92
92
|
};
|
|
93
93
|
return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: formatColumn, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
|
|
94
94
|
{
|
|
95
|
-
title: 'Scope',
|
|
95
|
+
title: 'Scope & Target',
|
|
96
96
|
details: 'Select which Columns will be formatted',
|
|
97
97
|
isValid: NewScopeComponent_1.isScopeValid,
|
|
98
98
|
renderSummary: FormatColumnScopeWizardSection_1.renderFormatColumnScopeSummary,
|
|
@@ -20,6 +20,7 @@ const Badge_1 = require("../../Components/Badge");
|
|
|
20
20
|
const AdaptableIconComponent_1 = require("../../Components/AdaptableIconComponent");
|
|
21
21
|
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
22
22
|
const Accordion_1 = require("../../../components/Accordion");
|
|
23
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
23
24
|
const BadgeEditor = (props) => {
|
|
24
25
|
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
25
26
|
const { badge, columnId, onChange } = props;
|
|
@@ -29,9 +30,7 @@ const BadgeEditor = (props) => {
|
|
|
29
30
|
const previewValue = dataType === 'number' || dataType == 'numberArray'
|
|
30
31
|
? GeneralConstants_1.DEFAULT_INTEGER_DISPLAY_VALUE
|
|
31
32
|
: GeneralConstants_1.DEFAULT_STRING_DISPLAY_VALUE;
|
|
32
|
-
return (React.createElement(
|
|
33
|
-
rebass_1.Flex,
|
|
34
|
-
{ className: "ab-Badge-Definition-Editor", mb: 15, p: 3 },
|
|
33
|
+
return (React.createElement(rebass_1.Flex, { className: "ab-Badge-Definition-Editor", mb: 15, p: 3 },
|
|
35
34
|
React.createElement(rebass_1.Box, { flex: 1 },
|
|
36
35
|
React.createElement(FormLayout_1.default, null,
|
|
37
36
|
React.createElement(FormLayout_1.FormRow, { label: "Preview" },
|
|
@@ -46,22 +45,17 @@ const BadgeEditor = (props) => {
|
|
|
46
45
|
Style,
|
|
47
46
|
});
|
|
48
47
|
} }))),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
columnId ? (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Create (optional) Rule for when the Badge is displayed; if no Rule provided Badge will always display (unless overriden by another Rule)"),
|
|
55
|
-
React.createElement(PredicateEditor_1.PredicateEditor, { columnId: columnId, predicate: badge.Predicate, predicateDefs: predicateDefs, placeholder: "No Predicate Selected", onChange: (predicate) => {
|
|
56
|
-
onChange({
|
|
57
|
-
...badge,
|
|
58
|
-
Predicate: predicate,
|
|
59
|
-
});
|
|
60
|
-
}, onClear: () => onChange({
|
|
48
|
+
React.createElement(FormLayout_1.FormRow, { label: 'Predicate' }, columnId ? (React.createElement(React.Fragment, null,
|
|
49
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Create (optional) Rule for when the Badge is displayed; if no Rule provided Badge will always display (unless overriden by another Rule)"),
|
|
50
|
+
React.createElement(PredicateEditor_1.PredicateEditor, { columnId: columnId, predicate: badge.Predicate, predicateDefs: predicateDefs, placeholder: "No Predicate Selected", onChange: (predicate) => {
|
|
51
|
+
onChange({
|
|
61
52
|
...badge,
|
|
62
|
-
Predicate:
|
|
63
|
-
})
|
|
64
|
-
|
|
53
|
+
Predicate: predicate,
|
|
54
|
+
});
|
|
55
|
+
}, onClear: () => onChange({
|
|
56
|
+
...badge,
|
|
57
|
+
Predicate: undefined,
|
|
58
|
+
}) }))) : (React.createElement(ErrorBox_1.default, null, "Select a column first"))),
|
|
65
59
|
React.createElement(FormLayout_1.FormRow, { label: "Icon" },
|
|
66
60
|
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Select (optional) Icon (and Icon position) to display in the Badge"),
|
|
67
61
|
' ',
|
|
@@ -92,10 +86,13 @@ const BadgeEditor = (props) => {
|
|
|
92
86
|
label: 'End',
|
|
93
87
|
onClick: () => onChange({ ...badge, IconPosition: 'End' }),
|
|
94
88
|
},
|
|
95
|
-
] }, badge.IconPosition ?? 'Start')))
|
|
89
|
+
] }, badge.IconPosition ?? 'Start'))),
|
|
90
|
+
badge.Icon && (React.createElement(FormLayout_1.FormRow, { label: "Show Icon Only" },
|
|
91
|
+
React.createElement(CheckBox_1.CheckBox, { checked: badge.IconOnly,
|
|
92
|
+
// onClick=()=> onChange({ ...badge, IconPosition: 'End' })
|
|
93
|
+
onClick: () => onChange({ ...badge, IconOnly: !badge.IconOnly }) }))))),
|
|
96
94
|
React.createElement(rebass_1.Box, { justifyContent: "end" },
|
|
97
|
-
React.createElement(SimpleButton_1.default, { icon: "delete", onClick: props.onDelete }))
|
|
98
|
-
));
|
|
95
|
+
React.createElement(SimpleButton_1.default, { icon: "delete", onClick: props.onDelete }))));
|
|
99
96
|
};
|
|
100
97
|
const renderBadgeSummary = (styledColumn) => {
|
|
101
98
|
return React.createElement(StyledColumnBadgePreview_1.StyledColumnBadgePreview, { data: styledColumn });
|
|
@@ -104,7 +104,7 @@ const StyledColumnWizard = (props) => {
|
|
|
104
104
|
if (styledColumn.BadgeStyle.Badges?.length === 0) {
|
|
105
105
|
return 'Define at least one Badge';
|
|
106
106
|
}
|
|
107
|
-
const badgesWithNoRules = styledColumn.BadgeStyle.Badges.filter((b) => b.Expression == undefined
|
|
107
|
+
const badgesWithNoRules = styledColumn.BadgeStyle.Badges.filter((b) => b.Expression == undefined && b.Predicate == undefined);
|
|
108
108
|
if (badgesWithNoRules.length > 1) {
|
|
109
109
|
return 'Only one Badge can have no Rule';
|
|
110
110
|
}
|
|
@@ -21,7 +21,10 @@ const renderStyledColumnWizardSettingsSummary = (data) => {
|
|
|
21
21
|
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeGroupRows ? 'no' : 'yes')),
|
|
22
22
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
23
23
|
"Summary Rows ",
|
|
24
|
-
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeSummaryRows ? 'no' : 'yes'))
|
|
24
|
+
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeSummaryRows ? 'no' : 'yes')),
|
|
25
|
+
React.createElement(rebass_1.Text, { mt: 3 },
|
|
26
|
+
"Total Rows ",
|
|
27
|
+
React.createElement(Tag_1.Tag, null, badgeStyle.RowScope?.ExcludeTotalRows ? 'no' : 'yes'))));
|
|
25
28
|
};
|
|
26
29
|
exports.renderStyledColumnWizardSettingsSummary = renderStyledColumnWizardSettingsSummary;
|
|
27
30
|
const StyledColumnWizardSettingsSection = (props) => {
|
|
@@ -62,6 +65,18 @@ const StyledColumnWizardSettingsSection = (props) => {
|
|
|
62
65
|
},
|
|
63
66
|
});
|
|
64
67
|
};
|
|
68
|
+
const onExcludeTotalRowsChanged = (ExcludeTotalRows) => {
|
|
69
|
+
props.onChange({
|
|
70
|
+
...data,
|
|
71
|
+
BadgeStyle: {
|
|
72
|
+
...data.BadgeStyle,
|
|
73
|
+
RowScope: {
|
|
74
|
+
...data.BadgeStyle.RowScope,
|
|
75
|
+
ExcludeTotalRows,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
};
|
|
65
80
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
66
81
|
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
67
82
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -82,6 +97,11 @@ const StyledColumnWizardSettingsSection = (props) => {
|
|
|
82
97
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked:
|
|
83
98
|
// @ts-ignore
|
|
84
99
|
data.BadgeStyle.RowScope?.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))),
|
|
85
|
-
' '
|
|
100
|
+
' ',
|
|
101
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Total Rows:" },
|
|
102
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
103
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-total-rows-checkbox", checked:
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
data.BadgeStyle.RowScope?.ExcludeTotalRows, onChange: onExcludeTotalRowsChanged, mr: 2 }))))))));
|
|
86
106
|
};
|
|
87
107
|
exports.StyledColumnWizardSettingsSection = StyledColumnWizardSettingsSection;
|
|
@@ -4,7 +4,6 @@ exports.StyledColumnBadgePreview = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
-
const Tag_1 = require("../../../../../components/Tag");
|
|
8
7
|
const GeneralConstants_1 = require("../../../../../Utilities/Constants/GeneralConstants");
|
|
9
8
|
const AdaptableContext_1 = require("../../../../AdaptableContext");
|
|
10
9
|
const Badge_1 = require("../../../../Components/Badge");
|
|
@@ -14,20 +13,14 @@ const StyledColumnBadgePreview = ({ data }) => {
|
|
|
14
13
|
if (!badgeStyle || badgeStyle.Badges.length === 0) {
|
|
15
14
|
return React.createElement("div", null, "No Badges Defined");
|
|
16
15
|
}
|
|
17
|
-
const value = adaptable.api.columnApi.getColumnDataTypeForColumnId(data.ColumnId) === 'number'
|
|
18
|
-
? GeneralConstants_1.DEFAULT_INTEGER_DISPLAY_VALUE
|
|
19
|
-
: GeneralConstants_1.DEFAULT_STRING_DISPLAY_VALUE;
|
|
20
16
|
return (React.createElement(rebass_1.Flex, { flexDirection: "column" }, badgeStyle.Badges.map((badge, index) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ruleString = badge.Expression.BooleanExpression;
|
|
27
|
-
}
|
|
17
|
+
const badgeValue = badge.IconOnly
|
|
18
|
+
? ''
|
|
19
|
+
: adaptable.api.columnApi.getColumnDataTypeForColumnId(data.ColumnId) === 'number'
|
|
20
|
+
? GeneralConstants_1.DEFAULT_INTEGER_DISPLAY_VALUE
|
|
21
|
+
: GeneralConstants_1.DEFAULT_STRING_DISPLAY_VALUE;
|
|
28
22
|
return (React.createElement(rebass_1.Box, { mb: 1, key: index },
|
|
29
|
-
React.createElement(Badge_1.Badge, { icon: badge.Icon, adaptableStyle: badge.Style, iconPosition: badge.IconPosition },
|
|
30
|
-
React.createElement(Tag_1.Tag, { ml: 2 }, ruleString)));
|
|
23
|
+
React.createElement(Badge_1.Badge, { icon: badge.Icon, adaptableStyle: badge.Style, iconPosition: badge.IconPosition }, badgeValue)));
|
|
31
24
|
})));
|
|
32
25
|
};
|
|
33
26
|
exports.StyledColumnBadgePreview = StyledColumnBadgePreview;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnBadgeSettings = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const Tag_1 = require("../../../../../components/Tag");
|
|
8
|
+
const AdaptableContext_1 = require("../../../../AdaptableContext");
|
|
9
|
+
const StyledColumnBadgeSettings = ({ data }) => {
|
|
10
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
11
|
+
const badgeStyle = data.BadgeStyle;
|
|
12
|
+
if (!badgeStyle || badgeStyle.Badges.length === 0) {
|
|
13
|
+
return React.createElement("div", null, "No Badges Defined");
|
|
14
|
+
}
|
|
15
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column" }, badgeStyle.Badges.map((badge, index) => {
|
|
16
|
+
let ruleString = 'No Rule';
|
|
17
|
+
if (badge.Predicate) {
|
|
18
|
+
ruleString = adaptable.api.predicateApi.predicateToString(badge.Predicate);
|
|
19
|
+
}
|
|
20
|
+
if (badge.Expression) {
|
|
21
|
+
ruleString = badge.Expression.BooleanExpression;
|
|
22
|
+
}
|
|
23
|
+
const iconOnly = badge.Icon && badge.IconOnly;
|
|
24
|
+
const hasIconPosition = badge.Icon && badge.IconPosition;
|
|
25
|
+
const iconPosition = hasIconPosition ? 'Icon Position: ' + badge.IconPosition : '';
|
|
26
|
+
return (React.createElement(rebass_1.Box, { mt: 2, mb: 2, key: index },
|
|
27
|
+
React.createElement(Tag_1.Tag, null, ruleString),
|
|
28
|
+
iconOnly && React.createElement(Tag_1.Tag, { ml: 2 }, 'Icon Only'),
|
|
29
|
+
' ',
|
|
30
|
+
hasIconPosition && React.createElement(Tag_1.Tag, { ml: 2 }, iconPosition),
|
|
31
|
+
' '));
|
|
32
|
+
})));
|
|
33
|
+
};
|
|
34
|
+
exports.StyledColumnBadgeSettings = StyledColumnBadgeSettings;
|
|
@@ -223,6 +223,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
223
223
|
getFirstRowNode(): IRowNode | undefined;
|
|
224
224
|
updateRowGroupsAndColumnGroupsExpandedState(layout?: Layout): void;
|
|
225
225
|
isGroupRowNode(rowNode: IRowNode): boolean;
|
|
226
|
+
isGrandTotalRowNode(rowNode: IRowNode): boolean;
|
|
226
227
|
getFilteredData(): any[];
|
|
227
228
|
/**
|
|
228
229
|
* This method internally differentiates between server-side and client-side row model
|
|
@@ -2031,6 +2031,12 @@ You need to define at least one Layout!`);
|
|
|
2031
2031
|
}
|
|
2032
2032
|
return false;
|
|
2033
2033
|
}
|
|
2034
|
+
isGrandTotalRowNode(rowNode) {
|
|
2035
|
+
if (!rowNode) {
|
|
2036
|
+
return false;
|
|
2037
|
+
}
|
|
2038
|
+
return rowNode.id === GeneralConstants_1.AG_GRID_GRAND_TOTAL_ROW_ID;
|
|
2039
|
+
}
|
|
2034
2040
|
getFilteredData() {
|
|
2035
2041
|
const data = [];
|
|
2036
2042
|
this.agGridAdapter.getAgGridApi().forEachNodeAfterFilter((rowNode) => {
|
|
@@ -2412,6 +2418,7 @@ You need to define at least one Layout!`);
|
|
|
2412
2418
|
}
|
|
2413
2419
|
}
|
|
2414
2420
|
getUniqueGridCells(column, gridCells) {
|
|
2421
|
+
let gridCellsToUse = gridCells;
|
|
2415
2422
|
const cache = new Map();
|
|
2416
2423
|
const lowercase = this.api.predicateApi.useCaseSensitivity();
|
|
2417
2424
|
const getter = (dataItem) => {
|
|
@@ -2425,13 +2432,32 @@ You need to define at least one Layout!`);
|
|
|
2425
2432
|
return value;
|
|
2426
2433
|
};
|
|
2427
2434
|
const self = this;
|
|
2435
|
+
// handle the special case where GridCells have arrays as values
|
|
2436
|
+
// in this case we want to treat each value in the array as a separate value
|
|
2437
|
+
if (this.api.columnApi.internalApi.hasArrayDataType(column)) {
|
|
2438
|
+
gridCellsToUse = gridCellsToUse.flatMap((gridCell) => {
|
|
2439
|
+
const rawValueArray = gridCell.rawValue;
|
|
2440
|
+
if (Array.isArray(rawValueArray)) {
|
|
2441
|
+
return rawValueArray.map((rawValue) => ({
|
|
2442
|
+
...gridCell,
|
|
2443
|
+
// for now just map the rawValue
|
|
2444
|
+
// extracting displayValue and normalisedValue is possible
|
|
2445
|
+
// but it could have a significant performance impact
|
|
2446
|
+
rawValue: rawValue,
|
|
2447
|
+
displayValue: rawValue,
|
|
2448
|
+
normalisedValue: rawValue,
|
|
2449
|
+
}));
|
|
2450
|
+
}
|
|
2451
|
+
return [gridCell];
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2428
2454
|
// those are grid cells unique per primary key - so cells corresponding to this column
|
|
2429
2455
|
// by for every row in the grid
|
|
2430
2456
|
// but here we want to collapse them down to values/cells unique by the
|
|
2431
2457
|
// value of this column: eg - if this is country column and we have multiple rownodes
|
|
2432
2458
|
// in the grid with country: UK, and multiple with country: France, then the end result
|
|
2433
2459
|
// of the current function should be 2 cells: one for UK and one for France
|
|
2434
|
-
|
|
2460
|
+
gridCellsToUse.forEach((dataItem) => {
|
|
2435
2461
|
const value = getter(dataItem);
|
|
2436
2462
|
if (!cache.has(value)) {
|
|
2437
2463
|
cache.set(value, {
|
|
@@ -463,12 +463,8 @@ class AgGridAdapter {
|
|
|
463
463
|
? 'number'
|
|
464
464
|
: this.deriveAdaptableColumnDataType(agGridColumn, false);
|
|
465
465
|
const isTreeColumn = this.isTreeColumn(isGeneratedRowGroupColumn);
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
!isTreeColumn &&
|
|
469
|
-
colDef.lockVisible === true &&
|
|
470
|
-
colDef.suppressColumnsToolPanel === true &&
|
|
471
|
-
colDef.suppressFiltersToolPanel === true;
|
|
466
|
+
const alwaysHidden = this.adaptableApi.columnApi.hasColumnType(colDef, AdaptableColumn_1.HIDDEN_COLUMN_TYPE);
|
|
467
|
+
const visible = !alwaysHidden || agGridColumn.isVisible();
|
|
472
468
|
const isGenerated = isGeneratedRowGroupColumn || isGeneratedPivotResultColumn || isGeneratedSelectionColumn;
|
|
473
469
|
const abColumn = {
|
|
474
470
|
Uuid: (0, Uuid_1.createUuid)(),
|
|
@@ -19,7 +19,9 @@ export declare class AgGridColumnAdapter {
|
|
|
19
19
|
setupColumns(): void;
|
|
20
20
|
private setupColumnValueGetter;
|
|
21
21
|
private setupColumnCellClass;
|
|
22
|
+
private setupColumnHeaderClass;
|
|
22
23
|
private setupColumnCellStyle;
|
|
24
|
+
private setupColumnHeaderStyle;
|
|
23
25
|
private setupColumnCellEditor;
|
|
24
26
|
private setupColumnCellRenderer;
|
|
25
27
|
private setupColumnTooltipValueGetter;
|
|
@@ -55,9 +57,10 @@ export declare class AgGridColumnAdapter {
|
|
|
55
57
|
private getEditedCellStyle;
|
|
56
58
|
/**
|
|
57
59
|
* The combination of styled column and format cells
|
|
58
|
-
* This
|
|
60
|
+
* This function decides when the two can be merged.
|
|
59
61
|
*/
|
|
60
62
|
private getFormatColumnAndStyledColumnCellStyle;
|
|
63
|
+
private getFormatColumnHeaderStyle;
|
|
61
64
|
private getStyledColumnStyle;
|
|
62
65
|
private getFormatColumnCellStyle;
|
|
63
66
|
private getFormatColumnAdaptableStyle;
|