@adaptabletools/adaptable 13.0.0-canary.2 → 13.0.0-canary.4

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 (80) hide show
  1. package/agGrid.d.ts +23 -1
  2. package/agGrid.js +23 -1
  3. package/base.css +1 -0
  4. package/bundle.cjs.js +159 -159
  5. package/index.css +1 -0
  6. package/package.json +1 -1
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +42 -14
  10. package/src/AdaptableOptions/GeneralOptions.d.ts +6 -0
  11. package/src/Api/ConditionalStyleApi.d.ts +20 -0
  12. package/src/Api/FormatColumnApi.d.ts +42 -3
  13. package/src/Api/Implementation/ColumnApiImpl.js +3 -3
  14. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +17 -1
  15. package/src/Api/Implementation/FormatColumnApiImpl.js +94 -14
  16. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
  17. package/src/Api/Implementation/InternalApiImpl.js +4 -0
  18. package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +0 -2
  19. package/src/Api/Implementation/QueryLanguageApiImpl.js +0 -3
  20. package/src/Api/Implementation/ToolPanelApiImpl.d.ts +3 -1
  21. package/src/Api/Implementation/ToolPanelApiImpl.js +8 -0
  22. package/src/Api/InternalApi.d.ts +1 -0
  23. package/src/Api/QueryLanguageApi.d.ts +0 -5
  24. package/src/Api/ToolPanelApi.d.ts +10 -1
  25. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  26. package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
  27. package/src/PredefinedConfig/FormatColumnState.d.ts +19 -0
  28. package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -0
  29. package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
  30. package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
  31. package/src/Redux/Store/AdaptableStore.js +2 -0
  32. package/src/Strategy/ConditionalStyleModule.d.ts +2 -0
  33. package/src/Strategy/ConditionalStyleModule.js +6 -0
  34. package/src/Strategy/FormatColumnModule.d.ts +4 -9
  35. package/src/Strategy/FormatColumnModule.js +51 -1
  36. package/src/Strategy/Interface/IModule.d.ts +1 -0
  37. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +6 -5
  38. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
  39. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +4 -1
  40. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
  41. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +4 -1
  42. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
  43. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +4 -1
  44. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -0
  45. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +4 -1
  46. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
  47. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +4 -1
  48. package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
  49. package/src/Utilities/Extensions/TypeExtensions.js +5 -0
  50. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
  51. package/src/Utilities/Services/LicenseService.js +1 -1
  52. package/src/Utilities/Services/QueryLanguageService.d.ts +5 -3
  53. package/src/Utilities/Services/QueryLanguageService.js +92 -39
  54. package/src/Utilities/license/LicenseDetails.d.ts +1 -1
  55. package/src/Utilities/license/decode.d.ts +1 -0
  56. package/src/Utilities/license/decode.js +1 -1
  57. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -0
  58. package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +2 -0
  59. package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +18 -0
  60. package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
  61. package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
  62. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  63. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +9 -0
  64. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +66 -0
  65. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +20 -2
  66. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -1
  67. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +14 -0
  68. package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
  69. package/src/View/FormatColumn/Wizard/constants.js +4 -0
  70. package/src/agGrid/Adaptable.d.ts +5 -0
  71. package/src/agGrid/Adaptable.js +103 -45
  72. package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
  73. package/src/components/ExpressionEditor/EditorInput.js +1 -1
  74. package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
  75. package/src/metamodel/adaptable.metamodel.d.ts +47 -29
  76. package/src/metamodel/adaptable.metamodel.js +1 -1
  77. package/src/parser/src/types.d.ts +6 -3
  78. package/src/types.d.ts +2 -2
  79. package/version.d.ts +1 -1
  80. package/version.js +1 -1
package/index.css CHANGED
@@ -3733,6 +3733,7 @@ input[type='number'].ab-Input:hover::-webkit-inner-spin-button:active {
3733
3733
  display: table-cell; }
3734
3734
 
3735
3735
  .ab-ToggleButton {
3736
+ user-select: none;
3736
3737
  position: relative;
3737
3738
  display: inline-block;
3738
3739
  min-width: 40px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "13.0.0-canary.2",
3
+ "version": "13.0.0-canary.4",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1663166834956;
1
+ declare const _default: 1663256074117;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1663166834956;
3
+ exports.default = 1663256074117;
@@ -1,8 +1,13 @@
1
- import { ExpressionFunctionMap } from '../parser/src/types';
1
+ import { ExpressionFunction } from '../parser/src/types';
2
2
  import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredicate';
3
3
  import { AdaptableModule, AdaptableQLModule, AdaptableQLModules } from '../PredefinedConfig/Common/Types';
4
4
  import { BaseContext } from '../PredefinedConfig/Common/BaseContext';
5
5
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
6
+ import { BooleanFunctionName } from '../Utilities/ExpressionFunctions/booleanExpressionFunctions';
7
+ import { ScalarFunctionName } from '../Utilities/ExpressionFunctions/scalarExpressionFunctions';
8
+ import { ObservableFunctionName } from '../Utilities/ExpressionFunctions/observableExpressionFunctions';
9
+ import { AggregatedBooleanFunctionName } from '../Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions';
10
+ import { AggregatedScalarFunctionName } from '../Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions';
6
11
  /**
7
12
  * Options for managing AdaptableQL - the Adaptable Query Language which evaluates Predicates and Expressions
8
13
  */
@@ -52,44 +57,42 @@ export interface ExpressionOptions {
52
57
  * @defaultValue null (sets all)
53
58
  * @gridInfoItem
54
59
  */
55
- defaultBooleanFunctions?: ExpressionFunctionMap;
60
+ defaultBooleanFunctions?: ExpressionFunctionDefinitions<BooleanFunctionName> | ((context: DefaultExpressionFunctionsContext<BooleanFunctionName>) => ExpressionFunctionDefinitions<BooleanFunctionName>);
56
61
  /**
57
62
  * Scalar Expression Functions available in AdaptableQL
58
63
  *
59
64
  * @defaultValue null (sets all)
60
65
  * @gridInfoItem
61
66
  */
62
- defaultScalarFunctions?: ExpressionFunctionMap;
67
+ defaultScalarFunctions?: ExpressionFunctionDefinitions<ScalarFunctionName> | ((context: DefaultExpressionFunctionsContext<ScalarFunctionName>) => ExpressionFunctionDefinitions<ScalarFunctionName>);
63
68
  /**
64
69
  * Observable Expression Functions available in AdaptableQL
65
70
  *
66
71
  * @defaultValue null (sets all)
67
72
  * @gridInfoItem
68
73
  */
69
- defaultObservableFunctions?: ExpressionFunctionMap;
74
+ defaultObservableFunctions?: ExpressionFunctionDefinitions<ObservableFunctionName> | ((context: DefaultExpressionFunctionsContext<ObservableFunctionName>) => ExpressionFunctionDefinitions<ObservableFunctionName>);
70
75
  /**
71
76
  * Aggregated Boolean Expression Functions available in AdaptableQL
72
77
  *
73
78
  * @defaultValue null (sets all)
74
79
  * @gridInfoItem
75
80
  */
76
- defaultAggregatedBooleanFunctions?: ExpressionFunctionMap;
81
+ defaultAggregatedBooleanFunctions?: ExpressionFunctionDefinitions<AggregatedBooleanFunctionName> | ((context: DefaultExpressionFunctionsContext<AggregatedBooleanFunctionName>) => ExpressionFunctionDefinitions<AggregatedBooleanFunctionName>);
77
82
  /**
78
83
  * Aggregated Scalar Expression Functions available in AdaptableQL
79
84
  *
80
85
  * @defaultValue null (sets all)
81
86
  * @gridInfoItem
82
87
  */
83
- defaultAggregatedScalarFunctions?: ExpressionFunctionMap;
88
+ defaultAggregatedScalarFunctions?: ExpressionFunctionDefinitions<AggregatedScalarFunctionName> | ((context: DefaultExpressionFunctionsContext<AggregatedScalarFunctionName>) => ExpressionFunctionDefinitions<AggregatedScalarFunctionName>);
84
89
  /**
85
90
  * Module specific ExpressionFunctions; if not defined, it falls back to the defined default values
86
91
  *
87
92
  * @defaultValue undefined (defaults to default values)
88
93
  * @gridInfoItem
89
94
  */
90
- moduleExpressionFunctions?: {
91
- [module in AdaptableModule]?: ModuleExpressionFunctions;
92
- };
95
+ moduleExpressionFunctions?: ModuleExpressionFunctionsMap | ((context: ModuleExpressionFunctionsContext) => ModuleExpressionFunctions | undefined);
93
96
  /**
94
97
  * Columns that can be included in AdaptableQL Expressions; leave unset to include **ALL**, provide empty array to set **NONE**
95
98
  *
@@ -116,15 +119,40 @@ export interface ExpressionOptions {
116
119
  */
117
120
  customQueryVariables?: Record<string, string | number | boolean | Date | ((context: CustomQueryVariableContext) => string | number | boolean | Date)>;
118
121
  }
122
+ /**
123
+ * ExpressionFunctions which may be either referenced by name (for internal Adaptable functions) or provided with custom implementation
124
+ */
125
+ export declare type ExpressionFunctionDefinitions<T> = (T | Record<string, ExpressionFunction>)[];
119
126
  /**
120
127
  * Module specific Expression Functions
121
128
  */
129
+ export declare type ModuleExpressionFunctionsMap = Partial<Record<AdaptableModule, ModuleExpressionFunctions>>;
130
+ /**
131
+ * Type specific Expression Functions
132
+ */
122
133
  export interface ModuleExpressionFunctions {
123
- booleanFunctions?: ExpressionFunctionMap;
124
- scalarFunctions?: ExpressionFunctionMap;
125
- observableFunctions?: ExpressionFunctionMap;
126
- aggregatedBooleanFunctions?: ExpressionFunctionMap;
127
- aggregatedScalarFunctions?: ExpressionFunctionMap;
134
+ booleanFunctions?: ExpressionFunctionDefinitions<BooleanFunctionName>;
135
+ scalarFunctions?: ExpressionFunctionDefinitions<ScalarFunctionName>;
136
+ observableFunctions?: ExpressionFunctionDefinitions<ObservableFunctionName>;
137
+ aggregatedBooleanFunctions?: ExpressionFunctionDefinitions<AggregatedBooleanFunctionName>;
138
+ aggregatedScalarFunctions?: ExpressionFunctionDefinitions<AggregatedScalarFunctionName>;
139
+ }
140
+ /**
141
+ * Context provided to ExpressionOptions.defaultExpressionFunctions property callback
142
+ */
143
+ export interface DefaultExpressionFunctionsContext<T> extends BaseContext {
144
+ availableExpressionFunctionNames: T[];
145
+ }
146
+ /**
147
+ * Context provided to ExpressionOptions.moduleExpressionFunctions property callback
148
+ */
149
+ export interface ModuleExpressionFunctionsContext extends BaseContext {
150
+ module: AdaptableModule;
151
+ defaultBooleanFunctionNames: BooleanFunctionName[];
152
+ defaultScalarFunctionNames: ScalarFunctionName[];
153
+ defaultObservableFunctionNames: ObservableFunctionName[];
154
+ defaultAggregatedBooleanFunctionNames: AggregatedBooleanFunctionName[];
155
+ defaultAggregatedScalarFunctionNames: AggregatedScalarFunctionName[];
128
156
  }
129
157
  /**
130
158
  * Context passed when evaluating `ExpressionOptions.customQueryVariables`
@@ -65,6 +65,12 @@ export interface GeneralOptions {
65
65
  * Value to use for 'Unbalanced Groups' (string columns)
66
66
  */
67
67
  unbalancedGroupsKey?: string | ((context: UnbalancedGroupsKeyContext) => string);
68
+ /**
69
+ * Starting with v13, ConditionalStyle module is deprecated, and it's functionality is merged into the FormatColumn module. By default, all existing conditional styles are migrated to format columns. By setting this property to TRUE, the conditional styles are not migrated.
70
+ *
71
+ * @defaultValue false
72
+ */
73
+ keepDeprecatedConditionalStyles?: boolean;
68
74
  }
69
75
  /**
70
76
  * Comparer object for Column Values - used for custom sorting
@@ -7,100 +7,120 @@ import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredi
7
7
  export interface ConditionalStyleApi {
8
8
  /**
9
9
  * Retrieves Conditional Style section from Adaptable State
10
+ * @deprecated use `FormatColumn` instead
10
11
  */
11
12
  getConditionalStyleState(): ConditionalStyleState;
12
13
  /**
13
14
  * Gets all Conditional Styles in Adaptable State
15
+ * @deprecated use `FormatColumn` instead
14
16
  */
15
17
  getAllConditionalStyle(config?: {
16
18
  includeLayoutNotAssociatedObjects?: boolean;
17
19
  }): ConditionalStyle[];
18
20
  /**
19
21
  * Get conditional style by id
22
+ *
23
+ * @deprecated use `FormatColumn` instead
20
24
  * @param id conditional style id
21
25
  * @returns conditional style
22
26
  */
23
27
  getConditionalStyleById(id: ConditionalStyle['Uuid']): ConditionalStyle;
24
28
  /**
25
29
  * Gets all Conditional Styles that are active (not-suspended) in Adaptable State
30
+ * @deprecated use `FormatColumn` instead
26
31
  * @returns conditional styles
27
32
  */
28
33
  getAllActiveConditionalStyle(): ConditionalStyle[];
29
34
  /**
30
35
  * Gets all Conditional Styles that are suspended in Adaptable State
36
+ * @deprecated use `FormatColumn` instead
31
37
  * @returns conditional styles
32
38
  */
33
39
  getAllSuspendedConditionalStyle(): ConditionalStyle[];
34
40
  /**
35
41
  * Opens Settings Panel with Conditional Style section selected and visible
42
+ * @deprecated use `FormatColumn` instead
36
43
  */
37
44
  showConditionalStylePopup(): void;
38
45
  /**
39
46
  * Retrieves all Conditional Styles that style whole row
47
+ * @deprecated use `FormatColumn` instead
40
48
  * @returns conditional styles
41
49
  */
42
50
  getRowConditionalStyles(): ConditionalStyle[] | undefined;
43
51
  /**
44
52
  * Retrieves all Conditional Styles which have an Expression
53
+ * @deprecated use `FormatColumn` instead
45
54
  * @returns conditional styles
46
55
  */
47
56
  getConditionalStylesWithExpression(): ConditionalStyle[] | undefined;
48
57
  /**
49
58
  * Gets all Conditional Styles that style a given Column
59
+ * @deprecated use `FormatColumn` instead
50
60
  * @param column Column to check
51
61
  * @returns conditional styles
52
62
  */
53
63
  getConditionalStylesForColumn(column: AdaptableColumn): ConditionalStyle[] | undefined;
54
64
  /**
55
65
  * Returns all Predicates usable in Conditional Styles
66
+ * @deprecated use `FormatColumn` instead
56
67
  */
57
68
  getConditionalStylePredicateDefs(): AdaptablePredicateDef[];
58
69
  /**
59
70
  * Returns all Predicates appropriate for the given Scope
71
+ * @deprecated use `FormatColumn` instead
60
72
  * @param scope Scope to check
61
73
  */
62
74
  getCondStylePredicateDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
63
75
  /**
64
76
  * Retrieves all Conditional Styles ordered by Column then Row
77
+ * @deprecated use `FormatColumn` instead
65
78
  * @returns conditional style
66
79
  */
67
80
  getOrderedConditionalStyles(): ConditionalStyle[] | undefined;
68
81
  /**
69
82
  * Replaces Conditional Style in State with given one
83
+ * @deprecated use `FormatColumn` instead
70
84
  * @param conditionalStyle Conditional Style to edit
71
85
  * @returns conditional style
72
86
  */
73
87
  editConditionalStyle(conditionalStyle: ConditionalStyle): ConditionalStyle;
74
88
  /**
75
89
  * Replaces Conditional Styles in State with given ones
90
+ * @deprecated use `FormatColumn` instead
76
91
  * @param conditionalStyles Conditional Styles to edit
77
92
  * @returns conditional styles
78
93
  */
79
94
  editConditionalStyles(conditionalStyles: ConditionalStyle[]): ConditionalStyle[];
80
95
  /**
81
96
  * Deletes a Conditional Style
97
+ * @deprecated use `FormatColumn` instead
82
98
  * @param conditionalStyle Conditional Style to delete
83
99
  */
84
100
  deleteConditionalStyle(conditionalStyle: ConditionalStyle): void;
85
101
  /**
86
102
  * Deletes Conditional Styles
103
+ * @deprecated use `FormatColumn` instead
87
104
  * @param conditionalStyles Conditional Styles to delete
88
105
  */
89
106
  deleteConditionalStyles(conditionalStyles: ConditionalStyle[]): void;
90
107
  /**
91
108
  * Adds new Conditional Style to State
109
+ * @deprecated use `FormatColumn` instead
92
110
  * @param conditionalStyle Conditional Style to add
93
111
  * @returns conditional style
94
112
  */
95
113
  addConditionalStyle(conditionalStyle: ConditionalStyle): ConditionalStyle;
96
114
  /**
97
115
  * Suspends conditional style, a readonly object cannot be suspended
116
+ * @deprecated use `FormatColumn` instead
98
117
  * @param conditionalStyle Conditional Style to suspend
99
118
  * @returns conditional style
100
119
  */
101
120
  suspendConditionalStyle(conditionalStyle: ConditionalStyle): ConditionalStyle;
102
121
  /**
103
122
  * Un-suspends or activates a suspended conditional style
123
+ * @deprecated use `FormatColumn` instead
104
124
  * @param conditionalStyle Conditional Style to suspend
105
125
  * @returns conditional style
106
126
  */
@@ -1,5 +1,5 @@
1
1
  import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison, CellColorRange } from '../PredefinedConfig/FormatColumnState';
2
- import { AdaptableColumn, AdaptableFormat } from '../types';
2
+ import { AdaptableColumn, AdaptableFormat, AdaptablePredicateDef, AdaptableScope } from '../types';
3
3
  import { RowNode } from '@ag-grid-community/core';
4
4
  /**
5
5
  * Provides run-time access to the Format Column Module and associated state
@@ -134,12 +134,22 @@ export interface FormatColumnApi {
134
134
  * @returns format column
135
135
  */
136
136
  getFormatColumnWithStyleForColumn(column: AdaptableColumn): FormatColumn | undefined;
137
+ /**
138
+ * Retrieves all format columns with style for a column
139
+ * @param column The Column for which to retrieve the Format Column
140
+ */
141
+ getColumnFormatColumnsWithStyle(column: AdaptableColumn): FormatColumn[];
142
+ /**
143
+ * Retrieves all Format Columns with style for the whole row
144
+ * @returns format columns
145
+ */
146
+ getRowFormatColumnsWithStyle(): FormatColumn[];
137
147
  /**
138
148
  * Gets Format Column if any for given Column which includes Style element with ClassName
139
149
  * @param column The Column for which to retrieve the Format Column
140
- * @returns format column
150
+ * @returns format columns
141
151
  */
142
- getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn | undefined;
152
+ getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn[];
143
153
  /**
144
154
  * Will get the most appropriate one i.e. first named Column, then DataType, then All
145
155
  * @param column
@@ -206,4 +216,33 @@ export interface FormatColumnApi {
206
216
  * @param formatColumn Format Column
207
217
  */
208
218
  hasCustomDisplayFormatter(formatColumn: FormatColumn): boolean;
219
+ /**
220
+ * Returns all Predicates usable in Format Columns
221
+ */
222
+ getFormatColumnPredicateDefs(): AdaptablePredicateDef[];
223
+ /**
224
+ * Returns all Predicates appropriate for the given Scope
225
+ * @param scope Scope to check
226
+ */
227
+ getFormatColumnDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
228
+ /**
229
+ * Checks if format column is active for a given row
230
+ *
231
+ * @param formatColumn
232
+ * @param params
233
+ */
234
+ isFormatColumnActiveForRow(formatColumn: FormatColumn, params: {
235
+ node: RowNode;
236
+ }): boolean;
237
+ /**
238
+ * Checks if format column is active for a given cell
239
+ *
240
+ * @param formatColumn
241
+ * @param column
242
+ * @param params
243
+ */
244
+ isFormatColumnActiveForColumn(formatColumn: FormatColumn, column: AdaptableColumn, params: {
245
+ node: RowNode;
246
+ value: any;
247
+ }): boolean;
209
248
  }
@@ -89,13 +89,13 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
89
89
  return false;
90
90
  }
91
91
  isNumericColumn(column) {
92
- return column.dataType == 'Number';
92
+ return (column === null || column === void 0 ? void 0 : column.dataType) == 'Number';
93
93
  }
94
94
  isBooleanColumn(column) {
95
- return column.dataType == 'Boolean';
95
+ return (column === null || column === void 0 ? void 0 : column.dataType) == 'Boolean';
96
96
  }
97
97
  isDateColumn(column) {
98
- return column.dataType == 'Date';
98
+ return (column === null || column === void 0 ? void 0 : column.dataType) == 'Date';
99
99
  }
100
100
  getColumnDataTypeFromColumnId(columnId) {
101
101
  const column = this.getColumnFromId(columnId); // this.getColumns().find(c => c.ColumnId == columnId);
@@ -5,6 +5,7 @@ import { FormatColumnState, FormatColumn, ColumnStyle, CellColorRange, ColumnCom
5
5
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
6
6
  import { RowNode } from '@ag-grid-community/core';
7
7
  import { AdaptableFormat } from '../../types';
8
+ import { AdaptablePredicateDef, AdaptableScope } from '../../../types';
8
9
  export declare class FormatColumnApiImpl extends ApiBase implements FormatColumnApi {
9
10
  getFormatColumnState(): FormatColumnState;
10
11
  getAllFormatColumn(config?: LayoutAssociatedObjectLoadConfig): FormatColumn[];
@@ -27,12 +28,15 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
27
28
  unSuspendFormatColumn(formatColumn: FormatColumn): FormatColumn;
28
29
  applyFormatColumnDisplayFormats(): void;
29
30
  getActiveFormatColumnForColumn(column: AdaptableColumn): FormatColumn | undefined;
31
+ getColumnFormatColumnsWithStyle(column: AdaptableColumn): FormatColumn[];
32
+ getRowFormatColumnsWithStyle(): FormatColumn[];
30
33
  getFormatColumnForColumn(column: AdaptableColumn): FormatColumn | undefined;
31
34
  getFormatColumnForColumnId(columnId: string): FormatColumn | undefined;
32
35
  getFormatColumnWithStyleForColumn(column: AdaptableColumn): FormatColumn | undefined;
33
- getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn | undefined;
36
+ getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn[];
34
37
  getFormatColumnWithDisplayFormatForColumn(column: AdaptableColumn): FormatColumn | undefined;
35
38
  getFormatColumnWithSingleColumnScope(columnId: string): FormatColumn | undefined;
39
+ private getFormatColumnInColumnScope;
36
40
  private getAppropriateFormatColumn;
37
41
  hasStyleFormatColumns(): boolean;
38
42
  showFormatColumnPopup(): void;
@@ -51,4 +55,16 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
51
55
  getStringFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
52
56
  getDateFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
53
57
  hasCustomDisplayFormatter(formatColumn: FormatColumn): boolean;
58
+ getFormatColumnPredicateDefs(): AdaptablePredicateDef[];
59
+ getFormatColumnDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
60
+ isFormatColumnActiveForRow(formatColumn: FormatColumn, params: {
61
+ node: RowNode;
62
+ }): boolean;
63
+ isFormatColumnActiveForColumn(formatColumn: FormatColumn, column: AdaptableColumn, params: {
64
+ node: RowNode;
65
+ value: any;
66
+ }): boolean;
67
+ private evaluatePredicate;
68
+ private shouldRunStyle;
69
+ private evaluateExpression;
54
70
  }
@@ -110,6 +110,18 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
110
110
  const formatColumns = this.getAllActiveFormatColumn();
111
111
  return this.getAppropriateFormatColumn(formatColumns, column);
112
112
  }
113
+ getColumnFormatColumnsWithStyle(column) {
114
+ const formatColumns = this.getAllFormatColumnWithStyle();
115
+ return this.getFormatColumnInColumnScope(formatColumns, column).filter((scopedFormatColumn) => {
116
+ return (!this.adaptable.api.scopeApi.scopeIsAll(scopedFormatColumn.Scope) &&
117
+ this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
118
+ });
119
+ }
120
+ getRowFormatColumnsWithStyle() {
121
+ return this.getAllFormatColumnWithStyle().filter((formatColumn) => {
122
+ return this.adaptable.api.scopeApi.scopeIsAll(formatColumn.Scope);
123
+ });
124
+ }
113
125
  getFormatColumnForColumn(column) {
114
126
  const formatColumns = this.getAllFormatColumn();
115
127
  return this.getAppropriateFormatColumn(formatColumns, column);
@@ -126,8 +138,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
126
138
  return this.getAppropriateFormatColumn(formatColumns, column);
127
139
  }
128
140
  getFormatColumnWithStyleClassNameForColumn(column) {
129
- const formatColumns = this.getAllFormatColumnWithStyle().filter((fc) => StringExtensions_1.default.IsNotNullOrEmpty(fc.Style.ClassName));
130
- return this.getAppropriateFormatColumn(formatColumns, column);
141
+ return this.getColumnFormatColumnsWithStyle(column).filter((fc) => StringExtensions_1.default.IsNotNullOrEmpty(fc.Style.ClassName));
131
142
  }
132
143
  getFormatColumnWithDisplayFormatForColumn(column) {
133
144
  const formatColumns = this.getAllFormatColumnWithDisplayFormat().concat(this.getAllFormatColumnWithCellAlignment());
@@ -150,20 +161,14 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
150
161
  });
151
162
  return returnFormatColumn;
152
163
  }
153
- getAppropriateFormatColumn(formatColumns, column) {
154
- let scopedFormatColumns = this.getFormatColumnsWithColumnScope(formatColumns)
164
+ getFormatColumnInColumnScope(formatColumns, column) {
165
+ return this.getFormatColumnsWithColumnScope(formatColumns)
155
166
  .concat(this.getFormatColumnsWithDataTypeScope(formatColumns))
156
167
  .concat(this.getFormatColumnsWithAllScope(formatColumns));
157
- let returnFormatColumn = undefined;
158
- scopedFormatColumns.forEach((fc) => {
159
- // we just do one and then return
160
- if (returnFormatColumn == undefined) {
161
- if (this.adaptable.api.scopeApi.isColumnInScope(column, fc.Scope)) {
162
- returnFormatColumn = fc;
163
- }
164
- }
165
- });
166
- return returnFormatColumn;
168
+ }
169
+ getAppropriateFormatColumn(formatColumns, column) {
170
+ return this.getFormatColumnInColumnScope(formatColumns, column).find((scopedFormatColumn) => !this.adaptable.api.scopeApi.scopeIsAll(scopedFormatColumn.Scope) &&
171
+ this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
167
172
  }
168
173
  hasStyleFormatColumns() {
169
174
  return ArrayExtensions_1.default.IsNotNullOrEmpty(this.getAllFormatColumnWithStyle());
@@ -355,5 +360,80 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
355
360
  }
356
361
  return true;
357
362
  }
363
+ getFormatColumnPredicateDefs() {
364
+ return this.adaptable.api.predicateApi.getPredicateDefsByModuleScope('formatColumn');
365
+ }
366
+ getFormatColumnDefsForScope(scope) {
367
+ return this.getFormatColumnPredicateDefs().filter((predicateDef) => this.adaptable.api.scopeApi.isScopeInScope(scope, predicateDef.columnScope));
368
+ }
369
+ isFormatColumnActiveForRow(formatColumn, params) {
370
+ // suspedned is important to be first
371
+ if (formatColumn.IsSuspended) {
372
+ return false;
373
+ }
374
+ if (!formatColumn.Rule) {
375
+ return true;
376
+ }
377
+ if (this.shouldRunStyle(formatColumn, params.node) &&
378
+ formatColumn.Rule.BooleanExpression &&
379
+ this.evaluateExpression(formatColumn, params.node)) {
380
+ return true;
381
+ }
382
+ // nothing has passed then return false
383
+ return false;
384
+ }
385
+ isFormatColumnActiveForColumn(formatColumn, column, params) {
386
+ // suspedned is important to be first
387
+ if (formatColumn.IsSuspended) {
388
+ return false;
389
+ }
390
+ if (!formatColumn.Rule) {
391
+ return true;
392
+ }
393
+ if (this.shouldRunStyle(formatColumn, params.node)) {
394
+ // first run the predicate
395
+ if (formatColumn.Rule.Predicate && formatColumn.Rule.Predicate.PredicateId) {
396
+ if (this.evaluatePredicate({
397
+ formatColumn,
398
+ column,
399
+ value: params.value,
400
+ node: params.node,
401
+ })) {
402
+ return true;
403
+ }
404
+ }
405
+ else if (formatColumn.Rule.BooleanExpression) {
406
+ if (this.evaluateExpression(formatColumn, params.node)) {
407
+ return true;
408
+ }
409
+ }
410
+ // nothing has passed then return false
411
+ return false;
412
+ }
413
+ }
414
+ evaluatePredicate({ formatColumn, column, value, node, }) {
415
+ const params = {
416
+ value: value,
417
+ oldValue: null,
418
+ displayValue: value,
419
+ node: node,
420
+ column: column,
421
+ };
422
+ const result = this.adaptable.api.predicateApi.handlePredicate(formatColumn.Rule.Predicate, params, false);
423
+ return result;
424
+ }
425
+ shouldRunStyle(formatColumn, node) {
426
+ if (!formatColumn.IncludeGroupedRows && this.adaptable.api.gridApi.isGroupRowNode(node)) {
427
+ return false;
428
+ }
429
+ return true;
430
+ }
431
+ evaluateExpression(formatColumn, node) {
432
+ const isValidExpression = this.adaptable.api.queryLanguageApi.isValidBooleanExpression(formatColumn.Rule.BooleanExpression, ModuleConstants.FormatColumnModuleId, `Invalid format column rule '${formatColumn.Rule.BooleanExpression}'`);
433
+ return (isValidExpression &&
434
+ this.adaptable.api.internalApi
435
+ .getQueryLanguageService()
436
+ .evaluateBooleanExpression(formatColumn.Rule.BooleanExpression, ModuleConstants.FormatColumnModuleId, node));
437
+ }
358
438
  }
359
439
  exports.FormatColumnApiImpl = FormatColumnApiImpl;
@@ -142,4 +142,5 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
142
142
  getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
143
143
  getEditLookUpValuesForColumn(editLookUpItem: EditLookUpPermittedValues, column: AdaptableColumn, gridCell?: GridCell): any[] | undefined;
144
144
  getAdaptableQueryExpressionText(query: Partial<AdaptableQuery>): string;
145
+ shouldKeepDeprecatedConditionalStyles(): boolean;
145
146
  }
@@ -650,5 +650,9 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
650
650
  ? this.adaptable.api.queryLanguageApi.getAdaptableQueryExpressionWithColumnFriendlyNames(query)
651
651
  : this.adaptable.api.queryLanguageApi.getAdaptableQueryExpression(query);
652
652
  }
653
+ shouldKeepDeprecatedConditionalStyles() {
654
+ var _a, _b;
655
+ return (_b = (_a = this.getOptions()) === null || _a === void 0 ? void 0 : _a.generalOptions) === null || _b === void 0 ? void 0 : _b.keepDeprecatedConditionalStyles;
656
+ }
653
657
  }
654
658
  exports.InternalApiImpl = InternalApiImpl;
@@ -1,7 +1,6 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
3
3
  import { QueryLanguageApi } from '../QueryLanguageApi';
4
- import { ExpressionFunctionMap } from '../../types';
5
4
  import { AdaptableQuery } from '../../PredefinedConfig/Common/AdaptableQuery';
6
5
  export declare class QueryLanguageApiImpl extends ApiBase implements QueryLanguageApi {
7
6
  isValidBooleanExpression(query: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
@@ -11,7 +10,6 @@ export declare class QueryLanguageApiImpl extends ApiBase implements QueryLangua
11
10
  getASTForExpression(query: string): any;
12
11
  getColumnsFromExpression(expression: string): string[];
13
12
  getQueryableColumnIds(): string[] | undefined;
14
- getModuleExpressionFunctionMap(): ExpressionFunctionMap;
15
13
  getAdaptableQueryExpression(query: Partial<AdaptableQuery>): string | undefined;
16
14
  getAdaptableQueryExpressionWithColumnFriendlyNames(query: Partial<AdaptableQuery>): string | undefined;
17
15
  }
@@ -83,9 +83,6 @@ class QueryLanguageApiImpl extends ApiBase_1.ApiBase {
83
83
  }
84
84
  }
85
85
  }
86
- getModuleExpressionFunctionMap() {
87
- return this.getExpressionOptions().moduleExpressionFunctions;
88
- }
89
86
  getAdaptableQueryExpression(query) {
90
87
  var _a, _b, _c, _d;
91
88
  return ((_d = (_c = (_b = (_a = query.BooleanExpression) !== null && _a !== void 0 ? _a : query.ScalarExpression) !== null && _b !== void 0 ? _b : query.ObservableExpression) !== null && _c !== void 0 ? _c : query.AggregatedBooleanExpression) !== null && _d !== void 0 ? _d : query.AggregatedScalarExpression);
@@ -3,7 +3,7 @@ import { ToolPanelApi } from '../ToolPanelApi';
3
3
  import { ToolPanelState, ToolPanelVisibilityMode } from '../../PredefinedConfig/ToolPanelState';
4
4
  import { CustomToolPanel, ToolPanelButtonContext } from '../../AdaptableOptions/ToolPanelOptions';
5
5
  import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
6
- import { AdaptableToolPanel } from '../../PredefinedConfig/Common/Types';
6
+ import { AdaptableModuleButtons, AdaptableToolPanel } from '../../PredefinedConfig/Common/Types';
7
7
  export declare class ToolPanelApiImpl extends ApiBase implements ToolPanelApi {
8
8
  getToolPanelState(): ToolPanelState;
9
9
  showToolPanelPopup(): void;
@@ -14,6 +14,8 @@ export declare class ToolPanelApiImpl extends ApiBase implements ToolPanelApi {
14
14
  getCustomToolPanelByName(name: string): CustomToolPanel | undefined;
15
15
  setAdaptableToolPanelVisibilityMode(adaptableToolPanel: AdaptableToolPanel, visibilityMode: ToolPanelVisibilityMode): void;
16
16
  setCustomToolPanelVisibilityMode(customToolPanelName: string, visibilityMode: ToolPanelVisibilityMode): void;
17
+ setModuleButtons(moduleButtons: AdaptableModuleButtons): void;
18
+ getModuleButtons(): AdaptableModuleButtons;
17
19
  private setExpandedToolPanelVisibility;
18
20
  private setCollapsedToolPanelVisibility;
19
21
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
7
7
  const ToolPanelRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ToolPanelRedux"));
8
+ const ToolPanelRedux_1 = require("../../Redux/ActionsReducers/ToolPanelRedux");
8
9
  class ToolPanelApiImpl extends ApiBase_1.ApiBase {
9
10
  getToolPanelState() {
10
11
  return this.getAdaptableState().ToolPanel;
@@ -51,6 +52,13 @@ class ToolPanelApiImpl extends ApiBase_1.ApiBase {
51
52
  this.setCollapsedToolPanelVisibility(customToolPanelName);
52
53
  }
53
54
  }
55
+ setModuleButtons(moduleButtons) {
56
+ this.dispatchAction((0, ToolPanelRedux_1.ToolPanelSetModuleButtons)(moduleButtons));
57
+ }
58
+ getModuleButtons() {
59
+ var _a, _b;
60
+ return (_b = (_a = this.getToolPanelState()) === null || _a === void 0 ? void 0 : _a.ModuleButtons) !== null && _b !== void 0 ? _b : [];
61
+ }
54
62
  setExpandedToolPanelVisibility(toolPanelName) {
55
63
  this.dispatchAction(ToolPanelRedux.ToolPanelExpandToolPanel(toolPanelName));
56
64
  }
@@ -144,4 +144,5 @@ export interface InternalApi {
144
144
  getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
145
145
  getEditLookUpValuesForColumn(editLookUpItem: EditLookUpPermittedValues, column: AdaptableColumn, gridCell?: GridCell): any[] | undefined;
146
146
  getAdaptableQueryExpressionText(query: Partial<AdaptableQuery>): string;
147
+ shouldKeepDeprecatedConditionalStyles(): boolean;
147
148
  }
@@ -1,5 +1,4 @@
1
1
  import { AdaptableModule } from '../PredefinedConfig/Common/Types';
2
- import { ExpressionFunctionMap } from '../types';
3
2
  import { AdaptableQuery } from '../PredefinedConfig/Common/AdaptableQuery';
4
3
  /**
5
4
  * Functions related to AdapTableQL (the Adaptable Query Language)
@@ -42,10 +41,6 @@ export interface QueryLanguageApi {
42
41
  * Returns all columns that can be used in an Expression
43
42
  */
44
43
  getQueryableColumnIds(): string[];
45
- /**
46
- * Returns the current Module Expression Map
47
- */
48
- getModuleExpressionFunctionMap(): ExpressionFunctionMap;
49
44
  /**
50
45
  * Runs the AST that AdapTableQL creates for an Expression - useful when evaluating remotely
51
46
  * @param expression expression to be run