@adaptabletools/adaptable 13.0.0-canary.15 → 13.0.0-canary.17

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.
Files changed (45) hide show
  1. package/bundle.cjs.js +146 -146
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableOptions/GeneralOptions.d.ts +0 -5
  6. package/src/Api/ColumnApi.d.ts +1 -1
  7. package/src/Api/FormatColumnApi.d.ts +1 -25
  8. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  9. package/src/Api/Implementation/ColumnApiImpl.js +5 -5
  10. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -6
  11. package/src/Api/Implementation/FormatColumnApiImpl.js +0 -52
  12. package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
  13. package/src/Api/Implementation/InternalApiImpl.js +0 -4
  14. package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
  15. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +9 -3
  16. package/src/Api/Implementation/StyledColumnApiImpl.js +75 -16
  17. package/src/Api/InternalApi.d.ts +0 -1
  18. package/src/Api/ScopeApi.d.ts +1 -1
  19. package/src/Api/StyledColumnApi.d.ts +70 -32
  20. package/src/PredefinedConfig/FormatColumnState.d.ts +2 -87
  21. package/src/PredefinedConfig/StyledColumnState.d.ts +11 -5
  22. package/src/Strategy/ConditionalStyleModule.d.ts +0 -4
  23. package/src/Strategy/ConditionalStyleModule.js +1 -31
  24. package/src/Strategy/FormatColumnModule.d.ts +0 -2
  25. package/src/Strategy/FormatColumnModule.js +26 -207
  26. package/src/Strategy/StyledColumnModule.js +1 -1
  27. package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
  28. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +0 -1
  29. package/src/View/Components/RangesComponent.d.ts +1 -1
  30. package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +1 -11
  31. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -2
  32. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +4 -3
  33. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -7
  34. package/src/agGrid/ActionColumnRenderer.d.ts +2 -0
  35. package/src/agGrid/ActionColumnRenderer.js +94 -62
  36. package/src/agGrid/Adaptable.d.ts +2 -8
  37. package/src/agGrid/Adaptable.js +32 -136
  38. package/src/agGrid/CheckboxRenderer.js +1 -1
  39. package/src/agGrid/PercentBarRenderer.d.ts +1 -1
  40. package/src/agGrid/PercentBarRenderer.js +13 -0
  41. package/src/agGrid/agGridHelper.d.ts +1 -1
  42. package/src/metamodel/adaptable.metamodel.d.ts +7 -0
  43. package/src/metamodel/adaptable.metamodel.js +1 -1
  44. package/version.d.ts +1 -1
  45. package/version.js +1 -1
@@ -5,7 +5,7 @@ import { AdaptableScope } from './Common/AdaptableScope';
5
5
  import { SuspendableObject } from './Common/SuspendableObject';
6
6
  import { XOR } from '../Utilities/Extensions/TypeExtensions';
7
7
  import { TypeHint } from './Common/Types';
8
- import { AdaptableBooleanQuery, AdaptablePredicate } from '../types';
8
+ import { AdaptableBooleanQuery, AdaptablePredicate, GradientStyle, PercentBarStyle } from '../types';
9
9
  /**
10
10
  * Predefined Configuration for Format Column Module
11
11
  */
@@ -33,7 +33,7 @@ export interface FormatColumn extends SuspendableObject {
33
33
  */
34
34
  Style?: AdaptableStyle;
35
35
  /**
36
- * Applies Gradient, Percent Bar or CheckBox style to a Column
36
+ * @deprecated now in StyledColumn Module
37
37
  */
38
38
  ColumnStyle?: ColumnStyle;
39
39
  /**
@@ -77,89 +77,4 @@ export interface ColumnStyle {
77
77
  */
78
78
  CheckBoxStyle?: boolean;
79
79
  }
80
- /**
81
- * Style used to display Percent Bars in Format Column
82
- */
83
- export interface PercentBarStyle {
84
- /**
85
- * Ranges (e.g. to allow a traffic light effect)
86
- */
87
- CellRanges?: CellColorRange[];
88
- /**
89
- * Compares cell values to another Column
90
- */
91
- ColumnComparison?: ColumnComparison;
92
- /**
93
- * Whether Cell shows Cell Value, Percent Value, both or none
94
- */
95
- CellText?: CellTextOptions;
96
- /**
97
- * Whether Tooltip shows Cell Value, Percent Value, both or none
98
- */
99
- ToolTipText?: CellTextOptions;
100
- /**
101
- * Back colour - only used for 'Percent Bar' Numeric style; leave unset if none required
102
- * @defaultValue Gray
103
- */
104
- BackColor?: string;
105
- }
106
- /**
107
- * Used to display Gradient Styles in Format Column
108
- */
109
- export interface GradientStyle {
110
- /**
111
- * Ranges (e.g. to allow a traffic light effect)
112
- */
113
- CellRanges?: CellColorRange[];
114
- /**
115
- * Compares cell values to another Column
116
- */
117
- ColumnComparison?: ColumnComparison;
118
- }
119
- /**
120
- * Defines which Colours to show in Gradient and Percent Bar Styles
121
- */
122
- export interface CellColorRange {
123
- /**
124
- * Start number of Range
125
- */
126
- Min: number | 'Col-Min';
127
- /**
128
- * End number of Range
129
- */
130
- Max: number | 'Col-Max';
131
- /**
132
- * Cell colour to use for values that fall inside Range
133
- */
134
- Color: string;
135
- /**
136
- * Reverses the Gradient so the lower the cell value the darker the colour
137
- */
138
- ReverseGradient?: boolean;
139
- }
140
- /**
141
- * Enables a Percent Bar or Gradient Style to use another column in its calculations
142
- */
143
- export interface ColumnComparison {
144
- /**
145
- * Start value - either numeric or Column name
146
- */
147
- MinValue: number | string;
148
- /**
149
- * End value - either numeric or Column name
150
- */
151
- MaxValue: number | string;
152
- /**
153
- * Colour to use for the Comparison
154
- */
155
- Color: string;
156
- }
157
- /**
158
- * Array of CellTextOption available in Format Columns
159
- */
160
- export declare type CellTextOptions = CellTextOption[];
161
- /**
162
- * Text optionally to show in a Format Column special style: 'CellValue' or 'PercentageValue'
163
- */
164
- export declare type CellTextOption = 'CellValue' | 'PercentageValue';
165
80
  export {};
@@ -1,7 +1,7 @@
1
1
  import { ConfigState } from './ConfigState';
2
2
  import { SuspendableObject } from './Common/SuspendableObject';
3
3
  /**
4
- * Predefined Configuration for Special Column Style Module
4
+ * Predefined Configuration for Styled Column Module
5
5
  */
6
6
  export interface StyledColumnState extends ConfigState {
7
7
  /**
@@ -13,14 +13,20 @@ export interface StyledColumnState extends ConfigState {
13
13
  * Object used in Special Column Style function
14
14
  */
15
15
  export interface StyledColumn extends SuspendableObject {
16
+ /**
17
+ * Column being styled
18
+ */
16
19
  ColumnId: string;
20
+ /**
21
+ * Styles a numeric column with a Gradient
22
+ */
17
23
  GradientStyle?: GradientStyle;
18
24
  /**
19
- * Style a numeric column so each cell displays a 'bar'
25
+ * Styles a numeric column so each cell displays a 'bar'
20
26
  */
21
27
  PercentBarStyle?: PercentBarStyle;
22
28
  /**
23
- * Style a boolean column so each cell displays a checkbox
29
+ * Renders a Checkbox in a boolean column
24
30
  */
25
31
  CheckBoxStyle?: boolean;
26
32
  }
@@ -33,7 +39,7 @@ export interface PercentBarStyle extends NumericStyledColumn {
33
39
  */
34
40
  CellRanges?: CellColorRange[];
35
41
  /**
36
- * Compares cell values to another Column
42
+ * Compares Cell values to another Column
37
43
  */
38
44
  ColumnComparison?: ColumnComparison;
39
45
  /**
@@ -45,7 +51,7 @@ export interface PercentBarStyle extends NumericStyledColumn {
45
51
  */
46
52
  ToolTipText?: CellTextOptions;
47
53
  /**
48
- * Back colour - only used for 'Percent Bar' Numeric style; leave unset if none required
54
+ * Background colour for 'Percent Bar'; leave unset if none required
49
55
  * @defaultValue Gray
50
56
  */
51
57
  BackColor?: string;
@@ -1,23 +1,19 @@
1
1
  import { AdaptableApi } from '../Api/AdaptableApi';
2
2
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
3
- import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
4
3
  import { ConditionalStyle } from '../PredefinedConfig/ConditionalStyleState';
5
4
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
6
5
  import { AdaptableModuleBase } from './AdaptableModuleBase';
7
6
  import { IConditionalStyleModule } from './Interface/IConditionalStyleModule';
8
7
  import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
9
8
  import { AdaptableModuleView, AdaptableObjectView } from './Interface/IModule';
10
- import { AccessLevel } from '../types';
11
9
  export declare class ConditionalStyleModule extends AdaptableModuleBase implements IConditionalStyleModule {
12
10
  constructor(api: AdaptableApi);
13
- getViewAccessLevel(): AccessLevel;
14
11
  getModuleAdaptableObjects(config?: {
15
12
  includeLayoutNotAssociatedObjects?: boolean;
16
13
  }): AdaptableObject[];
17
14
  getExplicitlyReferencedColumnIds(conditionalStyle: ConditionalStyle): string[];
18
15
  getReferencedNamedQueryNames(conditionalStyle: ConditionalStyle): string[];
19
16
  updateOldConfig(): void;
20
- addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
21
17
  getTeamSharingAction(): TeamSharingImportInfo<ConditionalStyle>;
22
18
  isConditionalStyleActiveForColumn(conditionalStyleForColumn: ConditionalStyle, column: AdaptableColumn, params: any): boolean;
23
19
  isConditionalStyleActiveForRow(conditionalStyleForRow: ConditionalStyle, params: any): boolean;
@@ -9,7 +9,6 @@ const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
9
9
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
10
10
  const ModuleConstants_1 = require("../Utilities/Constants/ModuleConstants");
11
11
  const getScopeViewItems_1 = require("./Utilities/getScopeViewItems");
12
- const ConditionalStyleWizard_1 = require("../View/ConditionalStyle/Wizard/ConditionalStyleWizard");
13
12
  const getRuleViewItems_1 = require("./Utilities/getRuleViewItems");
14
13
  const getStyleViewItems_1 = require("./Utilities/getStyleViewItems");
15
14
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
@@ -18,10 +17,6 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
18
17
  constructor(api) {
19
18
  super(ModuleConstants.ConditionalStyleModuleId, ModuleConstants.ConditionalStyleFriendlyName, 'conditional-style', 'ConditionalStylePopup', 'Style columns and rows dynamically based on rules and cell values', api);
20
19
  }
21
- getViewAccessLevel() {
22
- const keepDeprecatedConditionalStyles = this.api.internalApi.shouldKeepDeprecatedConditionalStyles();
23
- return keepDeprecatedConditionalStyles ? super.getViewAccessLevel() : 'Hidden';
24
- }
25
20
  getModuleAdaptableObjects(config) {
26
21
  return this.api.conditionalStyleApi.getAllConditionalStyle(config);
27
22
  }
@@ -83,25 +78,6 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
83
78
  });
84
79
  this.api.conditionalStyleApi.editConditionalStyles(oldConditionalStyles);
85
80
  }
86
- addColumnMenuItems(column) {
87
- if (column && this.isModuleEditable() && !column.isSparkline) {
88
- let conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(column);
89
- let firstConditionalStyle = ArrayExtensions_1.default.IsNotNullOrEmpty(conditionalStyles)
90
- ? conditionalStyles.find((cs) => this.api.scopeApi.isColumnInScopeColumns(column, cs.Scope))
91
- : undefined;
92
- let conditionalStyleExists = firstConditionalStyle != undefined;
93
- let label = conditionalStyleExists ? 'Edit ' : 'Create ';
94
- let popupParam = {
95
- column: column,
96
- action: conditionalStyleExists ? 'Edit' : 'New',
97
- source: 'ColumnMenu',
98
- value: firstConditionalStyle,
99
- };
100
- return [
101
- this.createColumnMenuItemShowPopup(label + this.moduleInfo.FriendlyName, this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
102
- ];
103
- }
104
- }
105
81
  getTeamSharingAction() {
106
82
  return {
107
83
  ModuleEntities: this.api.conditionalStyleApi.getAllConditionalStyle(),
@@ -215,13 +191,7 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
215
191
  getViewProperties() {
216
192
  return {
217
193
  HeaderComponent: ConditionalStylePopupHeader_1.ConditionalStylePopupHeader,
218
- getDeleteAction: (conditionalStyle) => ConditionalStyleRedux.ConditionalStyleDelete(conditionalStyle),
219
- getSuspendAction: (conditionalStyle) => ConditionalStyleRedux.ConditionalStyleSuspend(conditionalStyle),
220
- getUnSuspendAction: (conditionalStyle) => ConditionalStyleRedux.ConditionalStyleUnSuspend(conditionalStyle),
221
- emptyView: "Click 'New' to create a new Conditional Style Rule. When this is met, row or cells in the Conditional Style's scope will be styled appropriately.",
222
- getEditWizard() {
223
- return ConditionalStyleWizard_1.ConditionalStyleWizard;
224
- },
194
+ emptyView: '',
225
195
  };
226
196
  }
227
197
  canBeAssociatedWithLayouts() {
@@ -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
- var _a, _b;
59
- // warn about FormatColumn.HeaderName deprecation
60
- if ((_b = (_a = this.api.internalApi
61
- .getState()
62
- .FormatColumn) === null || _a === void 0 ? void 0 : _a.FormatColumns) === null || _b === void 0 ? void 0 : _b.some((formatColumn) => !!formatColumn.HeaderName)) {
63
- (0, LoggingHelper_1.ConsoleLogWarning)(`The 'FormatColumn.HeaderName' property was removed; use a Layout custom Column Header instead!`);
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
- this.updateGradientColumnsOldConfig();
66
- const keepDeprecatedConditionalStyles = this.api.internalApi.shouldKeepDeprecatedConditionalStyles();
67
- if (!keepDeprecatedConditionalStyles) {
68
- this.updateConditionalStylesColumnsOldConfig();
69
- // update ConditionalStyle StatusBarPanel
70
- const oldStatusBars = this.api.internalApi.getState().StatusBar.StatusBars;
71
- let replaceConditionalStyleStatusBar = false;
72
- const newStatusBars = oldStatusBars.map((statusBar) => (Object.assign(Object.assign({}, statusBar), { StatusBarPanels: [
73
- ...new Set(statusBar.StatusBarPanels.map((statusBarPanel) => {
74
- if (statusBarPanel === 'ConditionalStyle') {
75
- replaceConditionalStyleStatusBar = true;
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.formatColumnApi.getCheckBoxStyleFormatColumn(aColumn);
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
- var _a, _b;
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;
@@ -146,7 +146,6 @@ exports.DefaultAdaptableOptions = {
146
146
  customSortComparers: undefined,
147
147
  englishVariant: 'GB',
148
148
  unbalancedGroupsKey: undefined,
149
- keepDeprecatedConditionalStyles: false,
150
149
  },
151
150
  layoutOptions: {
152
151
  includeExpandedRowGroups: false,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { AdaptableApi } from '../../Api/AdaptableApi';
3
- import { CellColorRange, ColumnComparison } from '../../PredefinedConfig/FormatColumnState';
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[];
@@ -16,7 +16,6 @@ const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
16
16
  const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
17
17
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
18
18
  const react_redux_1 = require("react-redux");
19
- const ConditionalStyleRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ConditionalStyleRedux"));
20
19
  const ConditionalStyleSettingsWizardSettings_1 = require("./ConditionalStyleSettingsWizardSettings");
21
20
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
22
21
  const ConditionalStyleWizard = (props) => {
@@ -43,16 +42,7 @@ const ConditionalStyleWizard = (props) => {
43
42
  return conditionalStyle;
44
43
  });
45
44
  const dispatch = (0, react_redux_1.useDispatch)();
46
- const handleFinish = () => {
47
- if (data) {
48
- dispatch(ConditionalStyleRedux.ConditionalStyleEdit(conditionalStyle));
49
- }
50
- else {
51
- dispatch(ConditionalStyleRedux.ConditionalStyleAdd(conditionalStyle));
52
- }
53
- props.onCloseWizard();
54
- };
55
- return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: conditionalStyle, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
45
+ return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: conditionalStyle, onHide: props.onCloseWizard, sections: [
56
46
  {
57
47
  title: 'Style',
58
48
  details: 'Specify the Style to be applied conditionally',
@@ -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: !hasIncompatibleStyle, showAggregation: false, showObservable: false, showPredicate: !hasIncompatibleStyle && !api.scopeApi.scopeIsAll(data.Scope), data: data, onChange: (formatColumn) => props.onChange(formatColumn), descriptions: {
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, !data.ColumnStyle ? (React.createElement(StyleComponent_1.StyleComponent, { headless: true, api: api, Style: (_a = data.Style) !== null && _a !== void 0 ? _a : {}, UpdateStyle: (Style) => {
38
- props.onChange(Object.assign(Object.assign({}, data), { Style }));
39
- } })) : null));
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) {
@@ -1,8 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/core';
2
3
  import { ActionColumn } from '../AdaptableOptions/ActionOptions';
3
4
  interface ActionColumnCellRendererParams extends ICellRendererParams {
4
5
  actionColumn?: ActionColumn;
5
6
  }
7
+ export declare const ReactActionColumnRenderer: (props: ActionColumnCellRendererParams) => JSX.Element;
6
8
  export declare class ActionColumnRenderer implements ICellRendererComp {
7
9
  private eGui;
8
10
  private eventListener;