@adaptabletools/adaptable 13.0.0-canary.15 → 13.0.0-canary.16
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 +123 -123
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -5
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/Api/FormatColumnApi.d.ts +1 -25
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +5 -5
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -6
- package/src/Api/Implementation/FormatColumnApiImpl.js +0 -52
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +0 -4
- package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +9 -3
- package/src/Api/Implementation/StyledColumnApiImpl.js +75 -16
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/Api/ScopeApi.d.ts +1 -1
- package/src/Api/StyledColumnApi.d.ts +46 -22
- package/src/PredefinedConfig/FormatColumnState.d.ts +2 -87
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/Strategy/ConditionalStyleModule.d.ts +0 -2
- package/src/Strategy/ConditionalStyleModule.js +0 -4
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +26 -207
- package/src/Strategy/StyledColumnModule.js +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +0 -1
- package/src/View/Components/RangesComponent.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -2
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +4 -3
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -7
- package/src/agGrid/Adaptable.d.ts +2 -8
- package/src/agGrid/Adaptable.js +30 -134
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/PercentBarRenderer.d.ts +1 -1
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigState } from './ConfigState';
|
|
2
2
|
import { SuspendableObject } from './Common/SuspendableObject';
|
|
3
3
|
/**
|
|
4
|
-
* Predefined Configuration for
|
|
4
|
+
* Predefined Configuration for Styled Column Module
|
|
5
5
|
*/
|
|
6
6
|
export interface StyledColumnState extends ConfigState {
|
|
7
7
|
/**
|
|
@@ -7,10 +7,8 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
|
7
7
|
import { IConditionalStyleModule } from './Interface/IConditionalStyleModule';
|
|
8
8
|
import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
|
|
9
9
|
import { AdaptableModuleView, AdaptableObjectView } from './Interface/IModule';
|
|
10
|
-
import { AccessLevel } from '../types';
|
|
11
10
|
export declare class ConditionalStyleModule extends AdaptableModuleBase implements IConditionalStyleModule {
|
|
12
11
|
constructor(api: AdaptableApi);
|
|
13
|
-
getViewAccessLevel(): AccessLevel;
|
|
14
12
|
getModuleAdaptableObjects(config?: {
|
|
15
13
|
includeLayoutNotAssociatedObjects?: boolean;
|
|
16
14
|
}): AdaptableObject[];
|
|
@@ -18,10 +18,6 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
18
18
|
constructor(api) {
|
|
19
19
|
super(ModuleConstants.ConditionalStyleModuleId, ModuleConstants.ConditionalStyleFriendlyName, 'conditional-style', 'ConditionalStylePopup', 'Style columns and rows dynamically based on rules and cell values', api);
|
|
20
20
|
}
|
|
21
|
-
getViewAccessLevel() {
|
|
22
|
-
const keepDeprecatedConditionalStyles = this.api.internalApi.shouldKeepDeprecatedConditionalStyles();
|
|
23
|
-
return keepDeprecatedConditionalStyles ? super.getViewAccessLevel() : 'Hidden';
|
|
24
|
-
}
|
|
25
21
|
getModuleAdaptableObjects(config) {
|
|
26
22
|
return this.api.conditionalStyleApi.getAllConditionalStyle(config);
|
|
27
23
|
}
|
|
@@ -15,8 +15,6 @@ export declare class FormatColumnModule extends AdaptableModuleBase implements I
|
|
|
15
15
|
hasNamedQueryReferences(): boolean;
|
|
16
16
|
updateOldConfig(): void;
|
|
17
17
|
private updateConditionalStylesColumnsOldConfig;
|
|
18
|
-
private updateGradientColumnsOldConfig;
|
|
19
|
-
private getExistingFormatColumn;
|
|
20
18
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
21
19
|
getTeamSharingAction(): TeamSharingImportInfo<FormatColumn>;
|
|
22
20
|
toView(formatColumn: FormatColumn): AdaptableObjectView;
|
|
@@ -4,7 +4,6 @@ exports.FormatColumnModule = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
|
-
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
8
7
|
const FormatColumnRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/FormatColumnRedux"));
|
|
9
8
|
const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
|
|
10
9
|
const FormatColumnWizard_1 = require("../View/FormatColumn/Wizard/FormatColumnWizard");
|
|
@@ -18,27 +17,6 @@ const MoveFormatColumn_1 = require("../View/FormatColumn/MoveFormatColumn");
|
|
|
18
17
|
class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
19
18
|
constructor(api) {
|
|
20
19
|
super(ModuleConstants.FormatColumnModuleId, ModuleConstants.FormatColumnFriendlyName, 'format-column', 'FormatColumnPopup', 'Create a column style, display format or cell alignment', api);
|
|
21
|
-
/**
|
|
22
|
-
* Use Case: Data (cell/row) has changed
|
|
23
|
-
* Action: Any CheckboxFormatColumns need to be updated, as their disabled state may have changed
|
|
24
|
-
*/
|
|
25
|
-
this.api.internalApi
|
|
26
|
-
.getDataService()
|
|
27
|
-
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
28
|
-
const activeCheckboxColumnIds = this.api.columnApi
|
|
29
|
-
.getColumns()
|
|
30
|
-
.filter((aColumn) => {
|
|
31
|
-
const checkboxFormatColumn = this.api.formatColumnApi.getCheckBoxStyleFormatColumn(aColumn);
|
|
32
|
-
return checkboxFormatColumn && !checkboxFormatColumn.IsSuspended;
|
|
33
|
-
})
|
|
34
|
-
.map((aColumn) => aColumn.columnId);
|
|
35
|
-
// no need to refresh the CheckboxColumns if the change was triggered by one of them
|
|
36
|
-
if (!activeCheckboxColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
37
|
-
this.api.internalApi
|
|
38
|
-
.getAdaptableInstance()
|
|
39
|
-
.refreshCells(null, activeCheckboxColumnIds, true, true);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
20
|
}
|
|
43
21
|
getModuleAdaptableObjects(config) {
|
|
44
22
|
return this.api.formatColumnApi.getAllFormatColumn(config);
|
|
@@ -55,44 +33,33 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
55
33
|
return false;
|
|
56
34
|
}
|
|
57
35
|
updateOldConfig() {
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
36
|
+
this.updateConditionalStylesColumnsOldConfig();
|
|
37
|
+
// update ConditionalStyle StatusBarPanel
|
|
38
|
+
const oldStatusBars = this.api.internalApi.getState().StatusBar.StatusBars;
|
|
39
|
+
let replaceConditionalStyleStatusBar = false;
|
|
40
|
+
const newStatusBars = oldStatusBars.map((statusBar) => (Object.assign(Object.assign({}, statusBar), { StatusBarPanels: [
|
|
41
|
+
...new Set(statusBar.StatusBarPanels.map((statusBarPanel) => {
|
|
42
|
+
if (statusBarPanel === 'ConditionalStyle') {
|
|
43
|
+
replaceConditionalStyleStatusBar = true;
|
|
44
|
+
return 'FormatColumn';
|
|
45
|
+
}
|
|
46
|
+
return statusBarPanel;
|
|
47
|
+
})),
|
|
48
|
+
] })));
|
|
49
|
+
if (replaceConditionalStyleStatusBar) {
|
|
50
|
+
this.api.statusBarApi.setStatusBarPanels(newStatusBars);
|
|
64
51
|
}
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return 'FormatColumn';
|
|
77
|
-
}
|
|
78
|
-
return statusBarPanel;
|
|
79
|
-
})),
|
|
80
|
-
] })));
|
|
81
|
-
if (replaceConditionalStyleStatusBar) {
|
|
82
|
-
this.api.statusBarApi.setStatusBarPanels(newStatusBars);
|
|
83
|
-
}
|
|
84
|
-
// update ConditionalStyle dashboard buttons
|
|
85
|
-
const dashboardModuleButtons = this.api.internalApi.getState().Dashboard.ModuleButtons;
|
|
86
|
-
if (dashboardModuleButtons.includes('ConditionalStyle')) {
|
|
87
|
-
dashboardModuleButtons[dashboardModuleButtons.indexOf('ConditionalStyle')] = 'FormatColumn';
|
|
88
|
-
this.api.dashboardApi.setModuleButtons([...new Set(dashboardModuleButtons)]);
|
|
89
|
-
}
|
|
90
|
-
// update ConditionalStyle toolPanel buttons
|
|
91
|
-
const toolPanelModuleButtons = this.api.internalApi.getState().ToolPanel.ModuleButtons;
|
|
92
|
-
if (toolPanelModuleButtons.includes('ConditionalStyle')) {
|
|
93
|
-
toolPanelModuleButtons[toolPanelModuleButtons.indexOf('ConditionalStyle')] = 'FormatColumn';
|
|
94
|
-
this.api.toolPanelApi.setModuleButtons([...new Set(dashboardModuleButtons)]);
|
|
95
|
-
}
|
|
52
|
+
// update ConditionalStyle dashboard buttons
|
|
53
|
+
const dashboardModuleButtons = this.api.internalApi.getState().Dashboard.ModuleButtons;
|
|
54
|
+
if (dashboardModuleButtons.includes('ConditionalStyle')) {
|
|
55
|
+
dashboardModuleButtons[dashboardModuleButtons.indexOf('ConditionalStyle')] = 'FormatColumn';
|
|
56
|
+
this.api.dashboardApi.setModuleButtons([...new Set(dashboardModuleButtons)]);
|
|
57
|
+
}
|
|
58
|
+
// update ConditionalStyle toolPanel buttons
|
|
59
|
+
const toolPanelModuleButtons = this.api.internalApi.getState().ToolPanel.ModuleButtons;
|
|
60
|
+
if (toolPanelModuleButtons.includes('ConditionalStyle')) {
|
|
61
|
+
toolPanelModuleButtons[toolPanelModuleButtons.indexOf('ConditionalStyle')] = 'FormatColumn';
|
|
62
|
+
this.api.toolPanelApi.setModuleButtons([...new Set(dashboardModuleButtons)]);
|
|
96
63
|
}
|
|
97
64
|
}
|
|
98
65
|
updateConditionalStylesColumnsOldConfig() {
|
|
@@ -107,121 +74,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
107
74
|
// add as format column
|
|
108
75
|
this.api.formatColumnApi.addFormatColumns(oldConditionalStyles);
|
|
109
76
|
}
|
|
110
|
-
updateGradientColumnsOldConfig() {
|
|
111
|
-
let newFormatColumns = [];
|
|
112
|
-
let existingFormatColumns = [];
|
|
113
|
-
// 1. Convert Gradient Columns to Format Columns
|
|
114
|
-
let gradientColumnState = this.api.internalApi.getState().GradientColumn;
|
|
115
|
-
if (gradientColumnState === null || gradientColumnState === void 0 ? void 0 : gradientColumnState.GradientColumns) {
|
|
116
|
-
gradientColumnState.GradientColumns.forEach((gradientColumn) => {
|
|
117
|
-
const columnId = gradientColumn.ColumnId;
|
|
118
|
-
(0, LoggingHelper_1.LogAdaptableWarning)(`Merging Gradient Style into Format Column for Column: ${columnId}`);
|
|
119
|
-
let existingFormatColumn = this.getExistingFormatColumn(columnId);
|
|
120
|
-
let gradientStyle = {
|
|
121
|
-
GradientStyle: {
|
|
122
|
-
CellRanges: [
|
|
123
|
-
{
|
|
124
|
-
Min: gradientColumn.BaseValue,
|
|
125
|
-
Max: gradientColumn.PositiveValue,
|
|
126
|
-
Color: gradientColumn.PositiveColor,
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
if (!existingFormatColumn) {
|
|
132
|
-
let formatColumn = {
|
|
133
|
-
Scope: {
|
|
134
|
-
ColumnIds: [gradientColumn.ColumnId],
|
|
135
|
-
},
|
|
136
|
-
ColumnStyle: gradientStyle,
|
|
137
|
-
};
|
|
138
|
-
newFormatColumns.push(formatColumn);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
existingFormatColumn.ColumnStyle = gradientStyle;
|
|
142
|
-
existingFormatColumns.push(existingFormatColumn);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
// 2. Convert Percent Bars to Format Columns
|
|
147
|
-
let percentBarState = this.api.internalApi.getState().PercentBar;
|
|
148
|
-
if (percentBarState === null || percentBarState === void 0 ? void 0 : percentBarState.PercentBars) {
|
|
149
|
-
percentBarState === null || percentBarState === void 0 ? void 0 : percentBarState.PercentBars.forEach((percentBar) => {
|
|
150
|
-
const columnId = percentBar.ColumnId;
|
|
151
|
-
(0, LoggingHelper_1.LogAdaptableWarning)(`Merging Percent Bar Style into Format Column for Column: ${columnId}`);
|
|
152
|
-
let existingFormatColumn = this.getExistingFormatColumn(columnId);
|
|
153
|
-
const ranges = percentBar.Ranges;
|
|
154
|
-
const columnComparison = percentBar.ColumnComparison;
|
|
155
|
-
let cellText = [];
|
|
156
|
-
if (percentBar.ShowValue && percentBar.DisplayRawValue) {
|
|
157
|
-
cellText.push('CellValue');
|
|
158
|
-
}
|
|
159
|
-
if (percentBar.ShowValue && percentBar.DisplayPercentageValue) {
|
|
160
|
-
cellText.push('PercentageValue');
|
|
161
|
-
}
|
|
162
|
-
const tooltipText = [];
|
|
163
|
-
if (percentBar.ShowToolTip && percentBar.DisplayRawValue) {
|
|
164
|
-
tooltipText.push('CellValue');
|
|
165
|
-
}
|
|
166
|
-
if (percentBar.ShowToolTip && percentBar.DisplayPercentageValue) {
|
|
167
|
-
tooltipText.push('PercentageValue');
|
|
168
|
-
}
|
|
169
|
-
const percentBarStyle = {
|
|
170
|
-
PercentBarStyle: {
|
|
171
|
-
CellRanges: ranges,
|
|
172
|
-
ColumnComparison: columnComparison,
|
|
173
|
-
CellText: cellText,
|
|
174
|
-
ToolTipText: tooltipText,
|
|
175
|
-
BackColor: percentBar.BackColor,
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
if (!existingFormatColumn) {
|
|
179
|
-
const formatColumn = {
|
|
180
|
-
Scope: {
|
|
181
|
-
ColumnIds: [percentBar.ColumnId],
|
|
182
|
-
},
|
|
183
|
-
ColumnStyle: percentBarStyle,
|
|
184
|
-
};
|
|
185
|
-
newFormatColumns.push(formatColumn);
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
existingFormatColumn.ColumnStyle = percentBarStyle;
|
|
189
|
-
existingFormatColumns.push(existingFormatColumn);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
// update Redux
|
|
194
|
-
this.api.formatColumnApi.addFormatColumns(newFormatColumns);
|
|
195
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(existingFormatColumns)) {
|
|
196
|
-
existingFormatColumns.forEach((fc) => {
|
|
197
|
-
this.api.formatColumnApi.editFormatColumn(fc);
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(newFormatColumns) ||
|
|
201
|
-
ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(existingFormatColumns)) {
|
|
202
|
-
this.api.internalApi.clearGradientColumnState();
|
|
203
|
-
this.api.internalApi.clearPercentBarState();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
getExistingFormatColumn(columnId) {
|
|
207
|
-
let formatColumn = this.api.formatColumnApi.getFormatColumnWithSingleColumnScope(columnId);
|
|
208
|
-
if (formatColumn) {
|
|
209
|
-
return formatColumn;
|
|
210
|
-
}
|
|
211
|
-
// special columns (Calculated, FreeText, Action) are not yet part of AG-GridS colDefs
|
|
212
|
-
// so we have to check if the given columnId is a special column
|
|
213
|
-
const isSpecialColumn = !!this.api.calculatedColumnApi.getCalculatedColumnForColumnId(columnId) ||
|
|
214
|
-
!!this.api.freeTextColumnApi.getFreeTextColumnById(columnId);
|
|
215
|
-
if (isSpecialColumn) {
|
|
216
|
-
return this.api.formatColumnApi
|
|
217
|
-
.getAllFormatColumn()
|
|
218
|
-
.find((formatColumn) => 'ColumnIds' in formatColumn.Scope &&
|
|
219
|
-
formatColumn.Scope.ColumnIds.length == 1 &&
|
|
220
|
-
formatColumn.Scope.ColumnIds.includes(columnId));
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
77
|
addColumnMenuItems(column) {
|
|
224
|
-
var _a;
|
|
225
78
|
let returnColumnMenuItems = [];
|
|
226
79
|
if (column && this.isModuleEditable() && !column.isSparkline) {
|
|
227
80
|
// not fullproof as might be an All but its generally pretty good
|
|
@@ -240,40 +93,6 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
240
93
|
value: formatColumn,
|
|
241
94
|
};
|
|
242
95
|
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label + 'Format Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam));
|
|
243
|
-
if (column.dataType == 'Boolean' && !this.api.columnApi.isFreeTextColumn(column.columnId)) {
|
|
244
|
-
let formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(column.columnId);
|
|
245
|
-
let hasCheckBox = formatColumn && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle);
|
|
246
|
-
if (hasCheckBox) {
|
|
247
|
-
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Remove Checkbox', 'unchecked', () => {
|
|
248
|
-
this.api.formatColumnApi.deleteFormatColumn(formatColumn);
|
|
249
|
-
}));
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
// const test = this.api.formatColumnApi.getCheckBoxStyleFormatColumn(column);
|
|
253
|
-
if (formatColumn) {
|
|
254
|
-
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Show as Checkbox', 'checked', () => {
|
|
255
|
-
formatColumn.ColumnStyle = {
|
|
256
|
-
CheckBoxStyle: true,
|
|
257
|
-
};
|
|
258
|
-
formatColumn.Style = undefined;
|
|
259
|
-
this.api.formatColumnApi.editFormatColumn(formatColumn);
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Show as Checkbox', 'checked', () => {
|
|
264
|
-
let newFormatColumn = {
|
|
265
|
-
Scope: {
|
|
266
|
-
ColumnIds: [column.columnId],
|
|
267
|
-
},
|
|
268
|
-
ColumnStyle: {
|
|
269
|
-
CheckBoxStyle: true,
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
this.api.formatColumnApi.addFormatColumn(newFormatColumn);
|
|
273
|
-
}));
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
96
|
}
|
|
278
97
|
return returnColumnMenuItems;
|
|
279
98
|
}
|
|
@@ -23,7 +23,7 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
23
23
|
const activeCheckboxColumnIds = this.api.columnApi
|
|
24
24
|
.getColumns()
|
|
25
25
|
.filter((aColumn) => {
|
|
26
|
-
const checkboxColumn = this.api.
|
|
26
|
+
const checkboxColumn = this.api.styledColumnApi.getCheckBoxStyleStyledColumn(aColumn);
|
|
27
27
|
return checkboxColumn && !checkboxColumn.IsSuspended;
|
|
28
28
|
})
|
|
29
29
|
.map((aColumn) => aColumn.columnId);
|
|
@@ -6,21 +6,6 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
7
|
const FormatColumnStyleWizardSection_1 = require("../../../View/FormatColumn/Wizard/FormatColumnStyleWizardSection");
|
|
8
8
|
const getFormatColumnStyleViewItems = (formatColumn, api) => {
|
|
9
|
-
|
|
10
|
-
let styleType = '';
|
|
11
|
-
if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.GradientStyle) {
|
|
12
|
-
styleType = 'Gradient';
|
|
13
|
-
}
|
|
14
|
-
else if ((_b = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _b === void 0 ? void 0 : _b.PercentBarStyle) {
|
|
15
|
-
styleType = 'Percent Bar';
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
styleType = 'Standard';
|
|
19
|
-
}
|
|
20
|
-
return (React.createElement(rebass_1.Box, { mt: 2 },
|
|
21
|
-
React.createElement(rebass_1.Box, { mb: 1 },
|
|
22
|
-
"Type: ",
|
|
23
|
-
styleType),
|
|
24
|
-
(0, FormatColumnStyleWizardSection_1.renderFormatColumnStyleSummary)(formatColumn, api)));
|
|
9
|
+
return React.createElement(rebass_1.Box, { mt: 2 }, (0, FormatColumnStyleWizardSection_1.renderFormatColumnStyleSummary)(formatColumn, api));
|
|
25
10
|
};
|
|
26
11
|
exports.getFormatColumnStyleViewItems = getFormatColumnStyleViewItems;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
|
-
import { CellColorRange, ColumnComparison } from '../../PredefinedConfig/
|
|
3
|
+
import { CellColorRange, ColumnComparison } from '../../PredefinedConfig/StyledColumnState';
|
|
4
4
|
import { AdaptableScope } from '../../PredefinedConfig/Common/AdaptableScope';
|
|
5
5
|
export interface RangesComponentProps extends React.ClassAttributes<RangesComponent> {
|
|
6
6
|
ranges: CellColorRange[];
|
|
@@ -7,10 +7,9 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
|
7
7
|
const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
|
|
8
8
|
function FormatColumnRuleWizardSection(props) {
|
|
9
9
|
const { data, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
10
|
-
const hasIncompatibleStyle = Boolean(data.ColumnStyle);
|
|
11
10
|
return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: props.defaultPredicateId,
|
|
12
11
|
// TODO see what is this
|
|
13
|
-
predicateDefs: api.formatColumnApi.getFormatColumnDefsForScope(data.Scope), showNoRule: true, showBoolean:
|
|
12
|
+
predicateDefs: api.formatColumnApi.getFormatColumnDefsForScope(data.Scope), showNoRule: true, showBoolean: true, showAggregation: false, showObservable: false, showPredicate: !api.scopeApi.scopeIsAll(data.Scope), data: data, onChange: (formatColumn) => props.onChange(formatColumn), descriptions: {
|
|
14
13
|
selectPredicate: 'Select a Format Column Rule - to be applied when data changes',
|
|
15
14
|
useBooleanQuery: (React.createElement(React.Fragment, null,
|
|
16
15
|
"Use an BooleanQuery if ",
|
|
@@ -34,8 +34,9 @@ exports.renderFormatColumnStyleSummary = renderFormatColumnStyleSummary;
|
|
|
34
34
|
function FormatColumnStyleWizardSection(props) {
|
|
35
35
|
var _a;
|
|
36
36
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
37
|
-
return (React.createElement(React.Fragment, null,
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
return (React.createElement(React.Fragment, null,
|
|
38
|
+
React.createElement(StyleComponent_1.StyleComponent, { headless: true, api: api, Style: (_a = data.Style) !== null && _a !== void 0 ? _a : {}, UpdateStyle: (Style) => {
|
|
39
|
+
props.onChange(Object.assign(Object.assign({}, data), { Style }));
|
|
40
|
+
} })));
|
|
40
41
|
}
|
|
41
42
|
exports.FormatColumnStyleWizardSection = FormatColumnStyleWizardSection;
|
|
@@ -65,13 +65,6 @@ const adjustDisplayFormat = (formatColumn, api) => {
|
|
|
65
65
|
};
|
|
66
66
|
const adjustFormatColumn = (formatColumn, api) => {
|
|
67
67
|
formatColumn = adjustDisplayFormat(formatColumn, api);
|
|
68
|
-
if (!api.scopeApi.isSingleNumericColumnScope(formatColumn.Scope) &&
|
|
69
|
-
!(api.scopeApi.areAllBooleanColumnsInScope(formatColumn.Scope) ||
|
|
70
|
-
api.scopeApi.scopeHasOnlyBooleanDataType(formatColumn.Scope))) {
|
|
71
|
-
// when people change the scope and select more than one (numeric) column
|
|
72
|
-
// we have to discard any column style we might have
|
|
73
|
-
delete formatColumn.ColumnStyle;
|
|
74
|
-
}
|
|
75
68
|
return formatColumn;
|
|
76
69
|
};
|
|
77
70
|
function FormatColumnWizard(props) {
|
|
@@ -158,9 +158,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
158
158
|
private createAdaptableColumn;
|
|
159
159
|
private safeSetColDefs;
|
|
160
160
|
private getStyledColumnStyle;
|
|
161
|
-
private
|
|
162
|
-
private getFormatColumnSpecialColumnStyle;
|
|
163
|
-
private getFormatColumnColumnStyle;
|
|
161
|
+
private getFormatColumnAdaptableStyle;
|
|
164
162
|
private getFormatColumnCellStyle;
|
|
165
163
|
private getFormatColumnCellClass;
|
|
166
164
|
private getFormatColumnRowClass;
|
|
@@ -178,8 +176,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
178
176
|
private getQuickSearchCellStyle;
|
|
179
177
|
private getEditableCellStyle;
|
|
180
178
|
private getReadOnlyCellStyle;
|
|
181
|
-
private getConditionalStyleCellStyle;
|
|
182
|
-
private getConditionalStyleCellClass;
|
|
183
179
|
private getEditableCellClass;
|
|
184
180
|
private getReadonlyCellClass;
|
|
185
181
|
private isQuickSearchActive;
|
|
@@ -308,7 +304,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
308
304
|
*/
|
|
309
305
|
private performPostEditChecks;
|
|
310
306
|
private getExpressionStylesChanges;
|
|
311
|
-
private
|
|
307
|
+
private getStyledColumnComparisonChanges;
|
|
312
308
|
private checkChangedCellCurrentlySelected;
|
|
313
309
|
private getColumnSorts;
|
|
314
310
|
private onSortChanged;
|
|
@@ -365,8 +361,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
365
361
|
applyAdaptableTheme(theme: AdaptableTheme | string): void;
|
|
366
362
|
private setupRowStyling;
|
|
367
363
|
private setupColumnHeaderAggregations;
|
|
368
|
-
private getConditionalStyleRowClass;
|
|
369
|
-
private getConditionalStyleRowStyle;
|
|
370
364
|
private getGridOptionsApi;
|
|
371
365
|
canGenerateCharts(): boolean;
|
|
372
366
|
canHaveSparklines(): boolean;
|