@adaptabletools/adaptable 13.0.0-canary.11 → 13.0.0-canary.13
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/bundle.cjs.js +169 -169
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +20 -3
- package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
- package/src/Api/AdaptableApi.d.ts +2 -0
- package/src/Api/ColumnApi.d.ts +7 -1
- package/src/Api/FormatColumnApi.d.ts +2 -23
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +8 -2
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -6
- package/src/Api/Implementation/FormatColumnApiImpl.js +15 -115
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +19 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +134 -0
- package/src/Api/StyledColumnApi.d.ts +68 -0
- package/src/Api/StyledColumnApi.js +2 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +3 -3
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +113 -0
- package/src/PredefinedConfig/StyledColumnState.js +2 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
- package/src/Redux/Store/AdaptableStore.js +7 -0
- package/src/Strategy/StyledColumnModule.d.ts +24 -0
- package/src/Strategy/StyledColumnModule.js +165 -0
- package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
- package/src/Utilities/Constants/ModuleConstants.js +4 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -4
- package/src/Utilities/ObjectFactory.d.ts +3 -0
- package/src/Utilities/ObjectFactory.js +11 -3
- package/src/Utilities/Services/ModuleService.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
- package/src/View/Components/RangesComponent.d.ts +1 -0
- package/src/View/Components/RangesComponent.js +19 -19
- package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
- package/src/View/Components/Selectors/ColumnSelector.js +2 -1
- package/src/View/Components/StyleComponent.js +2 -2
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +1 -11
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +21 -9
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.d.ts +1 -1
- package/src/View/Filter/FilterSummary.d.ts +1 -1
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -315
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -1
- package/src/View/Query/QueryViewPanel.d.ts +1 -1
- package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +238 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
- package/src/agGrid/Adaptable.d.ts +5 -2
- package/src/agGrid/Adaptable.js +73 -40
- package/src/agGrid/FilterWrapper.js +58 -15
- package/src/agGrid/FloatingFilterWrapper.d.ts +2 -2
- package/src/agGrid/FloatingFilterWrapper.js +71 -32
- package/src/agGrid/PercentBarRenderer.d.ts +6 -2
- package/src/agGrid/PercentBarRenderer.js +10 -18
- package/src/agGrid/agGridHelper.d.ts +6 -2
- package/src/agGrid/agGridHelper.js +4 -2
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
- package/src/agGrid/createAgStatusPanelComponent.js +17 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +84 -17
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +78 -27
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/icons/brush.d.ts +3 -0
- package/src/components/icons/brush.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +56 -20
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/renderReactRoot.d.ts +2 -0
- package/src/renderReactRoot.js +11 -9
- package/src/types.d.ts +3 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableComponents.d.ts +0 -1
- package/src/AdaptableComponents.js +0 -5
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnWizardStyleSection = exports.renderStyledColumnStyleSummary = exports.renderFormatColumnStyleWizardSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
8
|
+
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
9
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
10
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
11
|
+
const Tag_1 = require("../../../components/Tag");
|
|
12
|
+
const ColorPicker_1 = require("../../ColorPicker");
|
|
13
|
+
const RangesComponent_1 = require("../../Components/RangesComponent");
|
|
14
|
+
const StyleVisualItem_1 = require("../../Components/StyleVisualItem");
|
|
15
|
+
const UIHelper_1 = require("../../UIHelper");
|
|
16
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
17
|
+
const renderFormatColumnStyleWizardSummary = (data) => {
|
|
18
|
+
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
19
|
+
return (0, exports.renderStyledColumnStyleSummary)(data, api);
|
|
20
|
+
};
|
|
21
|
+
exports.renderFormatColumnStyleWizardSummary = renderFormatColumnStyleWizardSummary;
|
|
22
|
+
const getRanges = (ranges) => {
|
|
23
|
+
return ranges.map((r, i) => (React.createElement(rebass_1.Flex, { key: i, alignItems: "center", mr: 3 },
|
|
24
|
+
React.createElement(rebass_1.Box, { mr: 1 },
|
|
25
|
+
r.Min,
|
|
26
|
+
" to ",
|
|
27
|
+
r.Max,
|
|
28
|
+
' '),
|
|
29
|
+
React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: {
|
|
30
|
+
BackColor: r.Color,
|
|
31
|
+
ForeColor: r.Color,
|
|
32
|
+
} }))));
|
|
33
|
+
};
|
|
34
|
+
const getColumnComparison = (columnComparison, api) => {
|
|
35
|
+
return (React.createElement(rebass_1.Flex, { key: 'cc', alignItems: "center", mr: 3 },
|
|
36
|
+
React.createElement(rebass_1.Box, { mr: 1 },
|
|
37
|
+
"Min Value:",
|
|
38
|
+
' ',
|
|
39
|
+
isNaN(Number(columnComparison.MinValue))
|
|
40
|
+
? '[' + api.columnApi.getFriendlyNameFromColumnId(String(columnComparison.MinValue)) + ']'
|
|
41
|
+
: columnComparison.MinValue,
|
|
42
|
+
' ',
|
|
43
|
+
", Max Value:",
|
|
44
|
+
' ',
|
|
45
|
+
isNaN(Number(columnComparison.MaxValue))
|
|
46
|
+
? '[' + api.columnApi.getFriendlyNameFromColumnId(String(columnComparison.MaxValue)) + ']'
|
|
47
|
+
: columnComparison.MaxValue,
|
|
48
|
+
' '),
|
|
49
|
+
React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: {
|
|
50
|
+
BackColor: columnComparison.Color,
|
|
51
|
+
ForeColor: columnComparison.Color,
|
|
52
|
+
} })));
|
|
53
|
+
};
|
|
54
|
+
const renderStyledColumnStyleSummary = (data, api) => {
|
|
55
|
+
if (data.CheckBoxStyle) {
|
|
56
|
+
return React.createElement(Tag_1.Tag, null, "Checkbox Style");
|
|
57
|
+
}
|
|
58
|
+
if (data.GradientStyle) {
|
|
59
|
+
if (data.GradientStyle.CellRanges) {
|
|
60
|
+
return getRanges(data.GradientStyle.CellRanges);
|
|
61
|
+
}
|
|
62
|
+
if (data.GradientStyle.ColumnComparison) {
|
|
63
|
+
return getColumnComparison(data.GradientStyle.ColumnComparison, api);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (data.PercentBarStyle) {
|
|
67
|
+
if (data.PercentBarStyle.CellRanges) {
|
|
68
|
+
return getRanges(data.PercentBarStyle.CellRanges);
|
|
69
|
+
}
|
|
70
|
+
if (data.PercentBarStyle.ColumnComparison) {
|
|
71
|
+
return getColumnComparison(data.PercentBarStyle.ColumnComparison, api);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return React.createElement(Tag_1.Tag, null, "No Styling Defined");
|
|
75
|
+
};
|
|
76
|
+
exports.renderStyledColumnStyleSummary = renderStyledColumnStyleSummary;
|
|
77
|
+
const StyledColumnWizardStyleSection = (props) => {
|
|
78
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
79
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
80
|
+
const minMaxRangeValues = React.useMemo(() => {
|
|
81
|
+
const columnId = data.ColumnId;
|
|
82
|
+
if (!columnId) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
const column = api.columnApi.getColumnFromId(columnId);
|
|
86
|
+
return {
|
|
87
|
+
min: api.columnApi.getMinValueForNumericColumn(column),
|
|
88
|
+
max: api.columnApi.getMaxValueForNumericColumn(column),
|
|
89
|
+
};
|
|
90
|
+
}, [data]);
|
|
91
|
+
const scope = { ColumnIds: [data.ColumnId] }; // TODO: remove scope when format column columnStyle is removed
|
|
92
|
+
// gradient
|
|
93
|
+
const onUpdateGradientStyleRanges = (ranges) => {
|
|
94
|
+
const GradientStyle = {
|
|
95
|
+
CellRanges: ranges,
|
|
96
|
+
};
|
|
97
|
+
props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
|
|
98
|
+
};
|
|
99
|
+
const onUpdateGradientStyleColumnComparison = (columnComparison) => {
|
|
100
|
+
const GradientStyle = {
|
|
101
|
+
ColumnComparison: columnComparison,
|
|
102
|
+
};
|
|
103
|
+
props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
|
|
104
|
+
};
|
|
105
|
+
// percentbar
|
|
106
|
+
const onUpdatePercentBarStyleColumnComparison = (columnComparison) => {
|
|
107
|
+
const PercentBarStyle = {
|
|
108
|
+
ColumnComparison: columnComparison,
|
|
109
|
+
};
|
|
110
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle }));
|
|
111
|
+
};
|
|
112
|
+
const onUpdatePercentBarStyleRanges = (ranges) => {
|
|
113
|
+
const PercentBarStyle = {
|
|
114
|
+
CellRanges: ranges,
|
|
115
|
+
};
|
|
116
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle }));
|
|
117
|
+
};
|
|
118
|
+
const onPercentBarCellTextCellValueChanged = (checked) => {
|
|
119
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
120
|
+
if (checked) {
|
|
121
|
+
if (!percentBarStyle.CellText) {
|
|
122
|
+
percentBarStyle.CellText = ['CellValue'];
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
percentBarStyle.CellText.push('CellValue');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
if (percentBarStyle.CellText && percentBarStyle.CellText.includes('PercentageValue')) {
|
|
130
|
+
percentBarStyle.CellText = ['PercentageValue'];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
percentBarStyle.CellText = [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
137
|
+
};
|
|
138
|
+
const onPercentBarCellTextPercentValueChanged = (checked) => {
|
|
139
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
140
|
+
if (checked) {
|
|
141
|
+
if (!percentBarStyle.CellText) {
|
|
142
|
+
percentBarStyle.CellText = ['PercentageValue'];
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
percentBarStyle.CellText.push('PercentageValue');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
if (percentBarStyle.CellText && percentBarStyle.CellText.includes('CellValue')) {
|
|
150
|
+
percentBarStyle.CellText = ['CellValue'];
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
percentBarStyle.CellText = [];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
157
|
+
};
|
|
158
|
+
const onPercentBarToolTipTextCellValueChanged = (checked) => {
|
|
159
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
160
|
+
if (checked) {
|
|
161
|
+
if (!percentBarStyle.ToolTipText) {
|
|
162
|
+
percentBarStyle.ToolTipText = ['CellValue'];
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
percentBarStyle.ToolTipText.push('CellValue');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
if (percentBarStyle.ToolTipText && percentBarStyle.ToolTipText.includes('PercentageValue')) {
|
|
170
|
+
percentBarStyle.ToolTipText = ['PercentageValue'];
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
percentBarStyle.ToolTipText = [];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
177
|
+
};
|
|
178
|
+
const onPercentBarToolTipTextPercentValueChanged = (checked) => {
|
|
179
|
+
let percentBarStyle = data.PercentBarStyle;
|
|
180
|
+
if (checked) {
|
|
181
|
+
if (!percentBarStyle.ToolTipText) {
|
|
182
|
+
percentBarStyle.ToolTipText = ['PercentageValue'];
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
percentBarStyle.ToolTipText.push('PercentageValue');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
if (percentBarStyle.ToolTipText && percentBarStyle.ToolTipText.includes('CellValue')) {
|
|
190
|
+
percentBarStyle.ToolTipText = ['CellValue'];
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
percentBarStyle.ToolTipText = [];
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
197
|
+
};
|
|
198
|
+
const onUsePercentStyleColorCheckChanged = (checked) => {
|
|
199
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
200
|
+
percentBarStyle.BackColor = checked ? (0, UIHelper_1.getHexForName)(UIHelper_1.GRAY) : null;
|
|
201
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
202
|
+
};
|
|
203
|
+
const onForeColorSelectChange = (color) => {
|
|
204
|
+
let percentBarStyle = data.PercentBarStyle;
|
|
205
|
+
percentBarStyle.BackColor = color;
|
|
206
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
207
|
+
};
|
|
208
|
+
const disabled = !data.ColumnId;
|
|
209
|
+
return (React.createElement(rebass_1.Box, null,
|
|
210
|
+
data.CheckBoxStyle && (React.createElement(Tabs_1.Tabs, null,
|
|
211
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Check Box Column"),
|
|
212
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
213
|
+
React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, readOnly: true, checked: true }, "Display Column As CheckBox")))),
|
|
214
|
+
(data === null || data === void 0 ? void 0 : data.GradientStyle) && (React.createElement(RangesComponent_1.RangesComponent, { disabled: !data.ColumnId, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showRangeDirection: true, ranges: (_a = data.GradientStyle) === null || _a === void 0 ? void 0 : _a.CellRanges, columnComparison: (_b = data === null || data === void 0 ? void 0 : data.GradientStyle) === null || _b === void 0 ? void 0 : _b.ColumnComparison, updateRanges: (ranges) => onUpdateGradientStyleRanges(ranges), updateColumnComparison: (columnComparison) => onUpdateGradientStyleColumnComparison(columnComparison) })),
|
|
215
|
+
data.PercentBarStyle && (React.createElement(React.Fragment, null,
|
|
216
|
+
React.createElement(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showRangeDirection: false, ranges: (_c = data.PercentBarStyle) === null || _c === void 0 ? void 0 : _c.CellRanges, columnComparison: (_d = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _d === void 0 ? void 0 : _d.ColumnComparison, updateRanges: (ranges) => onUpdatePercentBarStyleRanges(ranges), updateColumnComparison: (columnComparison) => onUpdatePercentBarStyleColumnComparison(columnComparison) }),
|
|
217
|
+
React.createElement(FormLayout_1.default, { marginLeft: 2, marginTop: 2 },
|
|
218
|
+
React.createElement(FormLayout_1.FormRow, { label: "Cell Display:" },
|
|
219
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_f = (_e = data.PercentBarStyle) === null || _e === void 0 ? void 0 : _e.CellText) === null || _f === void 0 ? void 0 : _f.includes('CellValue'), onChange: (checked) => onPercentBarCellTextCellValueChanged(checked) }, "Cell Value"),
|
|
220
|
+
' ',
|
|
221
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_h = (_g = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _g === void 0 ? void 0 : _g.CellText) === null || _h === void 0 ? void 0 : _h.includes('PercentageValue'), onChange: (checked) => onPercentBarCellTextPercentValueChanged(checked) },
|
|
222
|
+
"Percent Value",
|
|
223
|
+
' '),
|
|
224
|
+
' '),
|
|
225
|
+
React.createElement(FormLayout_1.FormRow, { label: "ToolTip Display:" },
|
|
226
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_k = (_j = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _j === void 0 ? void 0 : _j.ToolTipText) === null || _k === void 0 ? void 0 : _k.includes('CellValue'), onChange: (checked) => onPercentBarToolTipTextCellValueChanged(checked) }, "Cell Value"),
|
|
227
|
+
' ',
|
|
228
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_m = (_l = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _l === void 0 ? void 0 : _l.ToolTipText) === null || _m === void 0 ? void 0 : _m.includes('PercentageValue'), onChange: (checked) => onPercentBarToolTipTextPercentValueChanged(checked) },
|
|
229
|
+
"Percent Value",
|
|
230
|
+
' '),
|
|
231
|
+
' '),
|
|
232
|
+
React.createElement(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}` },
|
|
233
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
234
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, checked: !!((_o = data.PercentBarStyle) === null || _o === void 0 ? void 0 : _o.BackColor), onChange: (checked) => onUsePercentStyleColorCheckChanged(checked), mr: 2 }),
|
|
235
|
+
((_p = data.PercentBarStyle) === null || _p === void 0 ? void 0 : _p.BackColor) !== undefined && (React.createElement(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: (_q = data.PercentBarStyle) === null || _q === void 0 ? void 0 : _q.BackColor, onChange: (x) => onForeColorSelectChange(x) }))))))),
|
|
236
|
+
!data.ColumnId && React.createElement(ErrorBox_1.default, { mt: 2 }, "You need to select a column before styling.")));
|
|
237
|
+
};
|
|
238
|
+
exports.StyledColumnWizardStyleSection = StyledColumnWizardStyleSection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyledColumn } from '../../../PredefinedConfig/StyledColumnState';
|
|
3
|
+
export declare const renderStyledColumnTypeSummary: (data: StyledColumn) => JSX.Element;
|
|
4
|
+
export interface StyledColumnWizardTypeSectionProps {
|
|
5
|
+
onChange: (styledColumn: StyledColumn) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StyledColumnWizardTypeSection: React.FunctionComponent<StyledColumnWizardTypeSectionProps>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnWizardTypeSection = exports.renderStyledColumnTypeSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
8
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
9
|
+
const Tag_1 = require("../../../components/Tag");
|
|
10
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
11
|
+
const renderStyledColumnTypeSummary = (data) => {
|
|
12
|
+
let type = null;
|
|
13
|
+
if (data.GradientStyle) {
|
|
14
|
+
type = 'Gradient Column';
|
|
15
|
+
}
|
|
16
|
+
else if (data.PercentBarStyle) {
|
|
17
|
+
type = 'Percent Bar';
|
|
18
|
+
}
|
|
19
|
+
else if (data.CheckBoxStyle) {
|
|
20
|
+
type = 'Check Box';
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement(rebass_1.Text, { pr: 2, py: 2 },
|
|
23
|
+
"Type ",
|
|
24
|
+
React.createElement(Tag_1.Tag, null, type)));
|
|
25
|
+
};
|
|
26
|
+
exports.renderStyledColumnTypeSummary = renderStyledColumnTypeSummary;
|
|
27
|
+
const StyledColumnWizardTypeSection = (props) => {
|
|
28
|
+
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
29
|
+
const handleTypeChange = (type) => {
|
|
30
|
+
const newStyledColumn = Object.assign({}, data);
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'gradient':
|
|
33
|
+
newStyledColumn.GradientStyle = {};
|
|
34
|
+
delete newStyledColumn.PercentBarStyle;
|
|
35
|
+
delete newStyledColumn.CheckBoxStyle;
|
|
36
|
+
break;
|
|
37
|
+
case 'percent':
|
|
38
|
+
newStyledColumn.PercentBarStyle = {};
|
|
39
|
+
delete newStyledColumn.GradientStyle;
|
|
40
|
+
delete newStyledColumn.CheckBoxStyle;
|
|
41
|
+
break;
|
|
42
|
+
case 'checkbox':
|
|
43
|
+
newStyledColumn.CheckBoxStyle = true;
|
|
44
|
+
delete newStyledColumn.GradientStyle;
|
|
45
|
+
delete newStyledColumn.PercentBarStyle;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
newStyledColumn.ColumnId = null;
|
|
49
|
+
props.onChange(newStyledColumn);
|
|
50
|
+
};
|
|
51
|
+
return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column", "data-name": "styled-column-type" },
|
|
52
|
+
React.createElement(Tabs_1.Tabs, { autoFocus: false, padding: 2 },
|
|
53
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Type"),
|
|
54
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
55
|
+
React.createElement(Radio_1.default, { checked: Boolean(data.GradientStyle), onChange: () => handleTypeChange('gradient') }, "Gradient Column"),
|
|
56
|
+
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('percent'), checked: Boolean(data.PercentBarStyle) }, "Percent Bar"),
|
|
57
|
+
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('checkbox'), checked: Boolean(data.CheckBoxStyle) }, "Check Box")))));
|
|
58
|
+
};
|
|
59
|
+
exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
|
|
@@ -8,5 +8,5 @@ declare class SystemStatusViewPanelComponent extends React.Component<SystemStatu
|
|
|
8
8
|
constructor(props: SystemStatusViewPanelComponentProps);
|
|
9
9
|
render(): JSX.Element;
|
|
10
10
|
}
|
|
11
|
-
export declare let SystemStatusViewPanel: import("react-redux").ConnectedComponent<typeof SystemStatusViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<SystemStatusViewPanelComponent> & SystemStatusViewPanelComponentProps, "api" | "
|
|
11
|
+
export declare let SystemStatusViewPanel: import("react-redux").ConnectedComponent<typeof SystemStatusViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<SystemStatusViewPanelComponent> & SystemStatusViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "SystemStatusMessageInfos" | "viewType">>;
|
|
12
12
|
export {};
|
|
@@ -22,7 +22,7 @@ export interface OnePageAdaptableWizardSection<ENTITY> {
|
|
|
22
22
|
isValid?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => true | string;
|
|
23
23
|
isVisible?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => boolean;
|
|
24
24
|
render: (data: ENTITY, index: number) => React.ReactNode;
|
|
25
|
-
renderSummary?: (data: ENTITY) => React.ReactNode;
|
|
25
|
+
renderSummary?: (data: ENTITY, api: AdaptableApi) => React.ReactNode;
|
|
26
26
|
}
|
|
27
27
|
export interface OnePageAdaptableWizardProps<ENTITY> {
|
|
28
28
|
moduleInfo: ModuleInfo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, ModuleNames, RowNode } from '@ag-grid-community/core';
|
|
2
2
|
import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
|
|
3
|
-
import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
3
|
+
import { AdaptableVariant, IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
4
4
|
import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
5
5
|
import { AdaptablePlugin } from '../AdaptableOptions/AdaptablePlugin';
|
|
6
6
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
@@ -40,6 +40,7 @@ declare type RuntimeConfig = {
|
|
|
40
40
|
waitForAgGrid?: boolean;
|
|
41
41
|
supressReact18RenderWarning?: boolean;
|
|
42
42
|
renderReactRoot?: RenderReactRootFn;
|
|
43
|
+
variant?: AdaptableVariant;
|
|
43
44
|
};
|
|
44
45
|
export declare class Adaptable implements IAdaptable {
|
|
45
46
|
api: AdaptableApi;
|
|
@@ -62,6 +63,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
62
63
|
gridOptions: GridOptions;
|
|
63
64
|
isInitialised: boolean;
|
|
64
65
|
hasAdaptableToolPanel: boolean;
|
|
66
|
+
variant: AdaptableVariant;
|
|
65
67
|
private useRowNodeLookUp;
|
|
66
68
|
private abContainerElement;
|
|
67
69
|
private gridContainerElement;
|
|
@@ -155,6 +157,8 @@ export declare class Adaptable implements IAdaptable {
|
|
|
155
157
|
updateColumnsIntoStore(): void;
|
|
156
158
|
private createAdaptableColumn;
|
|
157
159
|
private safeSetColDefs;
|
|
160
|
+
private getStyledColumnStyle;
|
|
161
|
+
private getSpecialColumnStyle;
|
|
158
162
|
private getFormatColumnSpecialColumnStyle;
|
|
159
163
|
private getFormatColumnColumnStyle;
|
|
160
164
|
private getFormatColumnCellStyle;
|
|
@@ -363,7 +367,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
363
367
|
private setupColumnHeaderAggregations;
|
|
364
368
|
private getConditionalStyleRowClass;
|
|
365
369
|
private getConditionalStyleRowStyle;
|
|
366
|
-
private getFormatColumnRowStyle;
|
|
367
370
|
private getGridOptionsApi;
|
|
368
371
|
canGenerateCharts(): boolean;
|
|
369
372
|
canHaveSparklines(): boolean;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -140,6 +140,7 @@ const forEachColumn = (cols, fn, parentColGroup) => {
|
|
|
140
140
|
const adaptableInstances = {};
|
|
141
141
|
class Adaptable {
|
|
142
142
|
constructor() {
|
|
143
|
+
this.variant = 'vanilla';
|
|
143
144
|
this.colDefPropertyCache = new Map();
|
|
144
145
|
this.gridOptionsPropertyCache = new Map();
|
|
145
146
|
this.columnMinMaxValuesCache = {};
|
|
@@ -342,10 +343,26 @@ class Adaptable {
|
|
|
342
343
|
// this is still used internally but should not be used externally as a preference
|
|
343
344
|
async init(adaptableOptions, runtimeConfig, _staticInit) {
|
|
344
345
|
var _a, _b, _c, _d, _e, _f;
|
|
346
|
+
// (globalThis as any).adaptable = this;
|
|
345
347
|
if (runtimeConfig) {
|
|
346
348
|
this.supressReact18RenderWarning = !!runtimeConfig.supressReact18RenderWarning;
|
|
347
349
|
if (runtimeConfig.renderReactRoot) {
|
|
348
|
-
this.renderReactRoot =
|
|
350
|
+
this.renderReactRoot = (el, container) => {
|
|
351
|
+
const unmount = runtimeConfig.renderReactRoot(el, container);
|
|
352
|
+
return () => {
|
|
353
|
+
// we used to capture here because of FloatingFilters/Filters - see FloatingFilterWrapper and FilterWrapper
|
|
354
|
+
// as we didn't have a native React implementation for our React wrapper
|
|
355
|
+
// but we might need to do this again in the future for some other components that are not native React
|
|
356
|
+
// captureReactWarnings();
|
|
357
|
+
if (typeof unmount === 'function') {
|
|
358
|
+
unmount();
|
|
359
|
+
}
|
|
360
|
+
// releaseReactWarnings();
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
if (runtimeConfig.variant) {
|
|
365
|
+
this.variant = runtimeConfig.variant;
|
|
349
366
|
}
|
|
350
367
|
}
|
|
351
368
|
if (!_staticInit) {
|
|
@@ -430,10 +447,12 @@ class Adaptable {
|
|
|
430
447
|
abColDefCustom: (_f = this.gridOptions.columnTypes.abColDefCustom) !== null && _f !== void 0 ? _f : {},
|
|
431
448
|
});
|
|
432
449
|
if (this.gridOptions.columnTypes.abColDefNumber.cellEditor === undefined) {
|
|
433
|
-
this.gridOptions.columnTypes.abColDefNumber.cellEditor =
|
|
450
|
+
this.gridOptions.columnTypes.abColDefNumber.cellEditor =
|
|
451
|
+
this.variant === 'react' ? AdaptableNumberEditor_1.ReactAdaptableNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
|
|
434
452
|
}
|
|
435
453
|
if (this.gridOptions.columnTypes.abColDefDate.cellEditor === undefined) {
|
|
436
|
-
this.gridOptions.columnTypes.abColDefDate.cellEditor =
|
|
454
|
+
this.gridOptions.columnTypes.abColDefDate.cellEditor =
|
|
455
|
+
this.variant === 'react' ? AdaptableDateEditor_1.ReactAdaptableDateEditor : AdaptableDateEditor_1.AdaptableDateEditor;
|
|
437
456
|
}
|
|
438
457
|
// validate the provided AdaptableOptions
|
|
439
458
|
this.MetamodelService.validateAdaptableOptionsValues();
|
|
@@ -893,13 +912,15 @@ class Adaptable {
|
|
|
893
912
|
this.gridOptions.api.setColumnDefs(colDefs);
|
|
894
913
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
895
914
|
}
|
|
896
|
-
|
|
897
|
-
|
|
915
|
+
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
916
|
+
return this.getSpecialColumnStyle(styledColumn, abColumn, params);
|
|
917
|
+
}
|
|
918
|
+
getSpecialColumnStyle(columnStyle, abColumn, params) {
|
|
898
919
|
let style = {};
|
|
899
920
|
const gradientStyle = columnStyle === null || columnStyle === void 0 ? void 0 : columnStyle.GradientStyle;
|
|
900
921
|
if (gradientStyle) {
|
|
901
|
-
const min = this.api.
|
|
902
|
-
const max = this.api.
|
|
922
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(columnStyle, abColumn, params.node, params.value);
|
|
923
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(columnStyle, abColumn, params.node, params.value);
|
|
903
924
|
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
904
925
|
let cellBackColor;
|
|
905
926
|
let reverseGradient = false;
|
|
@@ -929,10 +950,26 @@ class Adaptable {
|
|
|
929
950
|
}
|
|
930
951
|
return style;
|
|
931
952
|
}
|
|
953
|
+
getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params) {
|
|
954
|
+
return this.getSpecialColumnStyle(formatColumn.ColumnStyle, abColumn, params);
|
|
955
|
+
}
|
|
932
956
|
getFormatColumnColumnStyle(formatColumns) {
|
|
933
957
|
// first has more precedence, then they need to be applied in reverse order
|
|
934
958
|
return formatColumns.reduceRight((style, formatColumn) => {
|
|
935
959
|
const formatColumnStyle = this.convertAdaptableStyleToCSS(formatColumn.Style);
|
|
960
|
+
if (formatColumn.CellAlignment) {
|
|
961
|
+
switch (formatColumn.CellAlignment) {
|
|
962
|
+
case 'Left':
|
|
963
|
+
style.textAlign = 'left';
|
|
964
|
+
break;
|
|
965
|
+
case 'Right':
|
|
966
|
+
style.textAlign = 'right';
|
|
967
|
+
break;
|
|
968
|
+
case 'Center':
|
|
969
|
+
style.textAlign = 'center';
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
936
973
|
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
937
974
|
}, {});
|
|
938
975
|
}
|
|
@@ -956,19 +993,6 @@ class Adaptable {
|
|
|
956
993
|
}
|
|
957
994
|
style = Object.assign(Object.assign({}, style), this.getFormatColumnColumnStyle(activeFormatColumnsWithStyle));
|
|
958
995
|
}
|
|
959
|
-
if (formatColumn.CellAlignment) {
|
|
960
|
-
switch (formatColumn.CellAlignment) {
|
|
961
|
-
case 'Left':
|
|
962
|
-
style.textAlign = 'left';
|
|
963
|
-
break;
|
|
964
|
-
case 'Right':
|
|
965
|
-
style.textAlign = 'right';
|
|
966
|
-
break;
|
|
967
|
-
case 'Center':
|
|
968
|
-
style.textAlign = 'center';
|
|
969
|
-
break;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
996
|
return style;
|
|
973
997
|
}
|
|
974
998
|
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
@@ -1310,7 +1334,7 @@ class Adaptable {
|
|
|
1310
1334
|
const colId = customSort.ColumnId;
|
|
1311
1335
|
if (!layoutColumnsMap[colId]) {
|
|
1312
1336
|
// pivot layouts may have no pivot columns, only aggregation columns
|
|
1313
|
-
if (layout.AggregationColumns[colId] == undefined) {
|
|
1337
|
+
if (!layout.AggregationColumns || layout.AggregationColumns[colId] == undefined) {
|
|
1314
1338
|
return acc;
|
|
1315
1339
|
}
|
|
1316
1340
|
}
|
|
@@ -3187,16 +3211,20 @@ class Adaptable {
|
|
|
3187
3211
|
};
|
|
3188
3212
|
const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
|
|
3189
3213
|
const formatColumnsWithStyle = this.api.formatColumnApi.getColumnFormatColumnsWithStyle(abColumn);
|
|
3214
|
+
let styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3215
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) {
|
|
3216
|
+
styledColumn = null;
|
|
3217
|
+
}
|
|
3190
3218
|
const conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(abColumn);
|
|
3191
3219
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3192
3220
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3193
3221
|
const cellStyle = (params) => {
|
|
3194
|
-
const formatColumnCellStyle = formatColumn
|
|
3222
|
+
const formatColumnCellStyle = formatColumn && !styledColumn // TODO: remove after refactor columnStyle
|
|
3195
3223
|
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3196
3224
|
: undefined;
|
|
3197
3225
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3198
3226
|
const conditionalStyleObj = this.getConditionalStyleCellStyle(conditionalStyles, abColumn, params);
|
|
3199
|
-
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), formatColumnCellStyle), conditionalStyleObj), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3227
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), formatColumnCellStyle), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), conditionalStyleObj), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3200
3228
|
return result;
|
|
3201
3229
|
};
|
|
3202
3230
|
return cellStyle;
|
|
@@ -3218,10 +3246,12 @@ class Adaptable {
|
|
|
3218
3246
|
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
3219
3247
|
const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
|
|
3220
3248
|
const flashingClassName = this.getFlashingCellClass(abColumn, params);
|
|
3249
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3250
|
+
const hasStyledColumn = styledColumn && !styledColumn.IsSuspended;
|
|
3221
3251
|
const returnValue = [
|
|
3222
3252
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3223
3253
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3224
|
-
formatColumns.length
|
|
3254
|
+
!hasStyledColumn && formatColumns.length
|
|
3225
3255
|
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3226
3256
|
: null,
|
|
3227
3257
|
hasConditionalStylesWithClassNames
|
|
@@ -3236,7 +3266,9 @@ class Adaptable {
|
|
|
3236
3266
|
// we flatten the array because some rules ('userCellClass',conditionalStyles etc) might return a string[]
|
|
3237
3267
|
.flat()
|
|
3238
3268
|
.filter((x) => !!x);
|
|
3239
|
-
|
|
3269
|
+
const result = returnValue.length ? returnValue : undefined;
|
|
3270
|
+
// console.log(result);
|
|
3271
|
+
return result;
|
|
3240
3272
|
};
|
|
3241
3273
|
return cellClass;
|
|
3242
3274
|
});
|
|
@@ -3282,10 +3314,19 @@ class Adaptable {
|
|
|
3282
3314
|
}
|
|
3283
3315
|
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
3284
3316
|
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
3317
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(abColumn.columnId);
|
|
3318
|
+
if (styledColumn && !styledColumn.IsSuspended) {
|
|
3319
|
+
if (styledColumn.PercentBarStyle) {
|
|
3320
|
+
return this.agGridHelper.createPercentBarRendererComp(styledColumn, abColumn);
|
|
3321
|
+
}
|
|
3322
|
+
if (styledColumn.CheckBoxStyle) {
|
|
3323
|
+
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3285
3326
|
const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
|
|
3286
3327
|
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
|
|
3287
3328
|
if (formatColumn.ColumnStyle.PercentBarStyle) {
|
|
3288
|
-
return this.agGridHelper.createPercentBarRendererComp(formatColumn, abColumn);
|
|
3329
|
+
return this.agGridHelper.createPercentBarRendererComp(formatColumn.ColumnStyle, abColumn);
|
|
3289
3330
|
}
|
|
3290
3331
|
if (formatColumn.ColumnStyle.CheckBoxStyle) {
|
|
3291
3332
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
@@ -3304,8 +3345,8 @@ class Adaptable {
|
|
|
3304
3345
|
formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
|
|
3305
3346
|
if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle) {
|
|
3306
3347
|
return (params) => {
|
|
3307
|
-
const min = this.api.
|
|
3308
|
-
const max = this.api.
|
|
3348
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
|
|
3349
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
|
|
3309
3350
|
const textOptions = formatColumn.ColumnStyle.PercentBarStyle.ToolTipText;
|
|
3310
3351
|
let returnValue = '';
|
|
3311
3352
|
if (textOptions.includes('CellValue')) {
|
|
@@ -4366,11 +4407,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4366
4407
|
setupRowStyling() {
|
|
4367
4408
|
// first get the conditional style state
|
|
4368
4409
|
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4369
|
-
const formatColumnsStyles = this.api.formatColumnApi.getRowFormatColumnsWithStyle();
|
|
4370
4410
|
// Set any Row Styles (i.e. items without a classname)
|
|
4371
4411
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4372
4412
|
return (params) => {
|
|
4373
|
-
const result = Object.assign(Object.assign(Object.assign(Object.assign(
|
|
4413
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign({}, userGetRowStyle === null || userGetRowStyle === void 0 ? void 0 : userGetRowStyle(params)), this.getRowHighlightStyle(params)), this.getAlertRowStyle(params)), this.getConditionalStyleRowStyle(conditionalStyles, params));
|
|
4374
4414
|
return result;
|
|
4375
4415
|
};
|
|
4376
4416
|
});
|
|
@@ -4384,7 +4424,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4384
4424
|
highlightClassName,
|
|
4385
4425
|
alertHighlightClassName,
|
|
4386
4426
|
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4387
|
-
this.getFormatColumnRowClass(formatColumnsStyles, params),
|
|
4388
4427
|
]
|
|
4389
4428
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4390
4429
|
.flat()
|
|
@@ -4427,14 +4466,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4427
4466
|
}
|
|
4428
4467
|
}
|
|
4429
4468
|
}
|
|
4430
|
-
getFormatColumnRowStyle(formatColumns, params) {
|
|
4431
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(formatColumns)) {
|
|
4432
|
-
const formatColumnWithRowStyle = formatColumns.find((formatColumn) => this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params));
|
|
4433
|
-
if (formatColumnWithRowStyle) {
|
|
4434
|
-
return this.convertAdaptableStyleToCSS(formatColumnWithRowStyle.Style);
|
|
4435
|
-
}
|
|
4436
|
-
}
|
|
4437
|
-
}
|
|
4438
4469
|
getGridOptionsApi() {
|
|
4439
4470
|
if (!this.gridOptions.api) {
|
|
4440
4471
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -4793,7 +4824,9 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4793
4824
|
if (value !== undefined) {
|
|
4794
4825
|
return value;
|
|
4795
4826
|
}
|
|
4796
|
-
const distinctRawValues = this.api.columnApi
|
|
4827
|
+
const distinctRawValues = this.api.columnApi
|
|
4828
|
+
.getUnsortedDistinctRawValuesForColumn(columnId)
|
|
4829
|
+
.map((item) => item.rawValue);
|
|
4797
4830
|
value = minMax === 'min' ? Math.min(...distinctRawValues) : Math.max(...distinctRawValues);
|
|
4798
4831
|
this.columnMinMaxValuesCache[columnId] = Object.assign(Object.assign({}, this.columnMinMaxValuesCache[columnId]), { [minMax]: value });
|
|
4799
4832
|
return value;
|