@adaptabletools/adaptable 13.0.0-canary.11 → 13.0.0-canary.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.cjs.js +169 -169
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +20 -3
- package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
- package/src/Api/AdaptableApi.d.ts +2 -0
- package/src/Api/ColumnApi.d.ts +7 -1
- package/src/Api/FormatColumnApi.d.ts +2 -23
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +8 -2
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -6
- package/src/Api/Implementation/FormatColumnApiImpl.js +15 -115
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +19 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +134 -0
- package/src/Api/StyledColumnApi.d.ts +68 -0
- package/src/Api/StyledColumnApi.js +2 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +3 -3
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +113 -0
- package/src/PredefinedConfig/StyledColumnState.js +2 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
- package/src/Redux/Store/AdaptableStore.js +7 -0
- package/src/Strategy/StyledColumnModule.d.ts +24 -0
- package/src/Strategy/StyledColumnModule.js +165 -0
- package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
- package/src/Utilities/Constants/ModuleConstants.js +4 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -4
- package/src/Utilities/ObjectFactory.d.ts +3 -0
- package/src/Utilities/ObjectFactory.js +11 -3
- package/src/Utilities/Services/ModuleService.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
- package/src/View/Components/RangesComponent.d.ts +1 -0
- package/src/View/Components/RangesComponent.js +19 -19
- package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
- package/src/View/Components/Selectors/ColumnSelector.js +2 -1
- package/src/View/Components/StyleComponent.js +2 -2
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +1 -11
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +21 -9
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.d.ts +1 -1
- package/src/View/Filter/FilterSummary.d.ts +1 -1
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -315
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -1
- package/src/View/Query/QueryViewPanel.d.ts +1 -1
- package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +238 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
- package/src/agGrid/Adaptable.d.ts +5 -2
- package/src/agGrid/Adaptable.js +73 -40
- package/src/agGrid/FilterWrapper.js +58 -15
- package/src/agGrid/FloatingFilterWrapper.d.ts +2 -2
- package/src/agGrid/FloatingFilterWrapper.js +71 -32
- package/src/agGrid/PercentBarRenderer.d.ts +6 -2
- package/src/agGrid/PercentBarRenderer.js +10 -18
- package/src/agGrid/agGridHelper.d.ts +6 -2
- package/src/agGrid/agGridHelper.js +4 -2
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
- package/src/agGrid/createAgStatusPanelComponent.js +17 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +84 -17
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +78 -27
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/icons/brush.d.ts +3 -0
- package/src/components/icons/brush.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +56 -20
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/renderReactRoot.d.ts +2 -0
- package/src/renderReactRoot.js +11 -9
- package/src/types.d.ts +3 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableComponents.d.ts +0 -1
- package/src/AdaptableComponents.js +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "13.0.0-canary.
|
|
3
|
+
"version": "13.0.0-canary.13",
|
|
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",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1663777360241;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -28,6 +28,7 @@ import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelSer
|
|
|
28
28
|
import { ColumnValuesComparer } from '../AdaptableOptions/GeneralOptions';
|
|
29
29
|
import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService';
|
|
30
30
|
import { RenderReactRootFn } from '../renderReactRoot';
|
|
31
|
+
export declare type AdaptableVariant = 'vanilla' | 'react' | 'angular';
|
|
31
32
|
/**
|
|
32
33
|
* The only interface for Adaptable
|
|
33
34
|
*
|
|
@@ -36,6 +37,7 @@ import { RenderReactRootFn } from '../renderReactRoot';
|
|
|
36
37
|
* Should only be used internally as all external access is via the Api
|
|
37
38
|
*/
|
|
38
39
|
export interface IAdaptable {
|
|
40
|
+
variant: AdaptableVariant;
|
|
39
41
|
supressReact18RenderWarning: boolean;
|
|
40
42
|
renderReactRoot: RenderReactRootFn;
|
|
41
43
|
api: AdaptableApi;
|
|
@@ -108,9 +108,8 @@ export interface ExpressionOptions {
|
|
|
108
108
|
*/
|
|
109
109
|
moduleExpressionFunctions?: ModuleExpressionFunctionsMap | ((context: ModuleExpressionFunctionsContext) => ModuleExpressionFunctions | undefined);
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
111
|
+
* Specifies if a given column can be included in Queries
|
|
112
112
|
*/
|
|
113
|
-
queryableColumns?: string[] | (() => string[]);
|
|
114
113
|
isColumnQueryable?: (queryableColumnContext: QueryableColumnContext) => boolean;
|
|
115
114
|
/**
|
|
116
115
|
* Validate Expressions before they can be run or saved
|
|
@@ -202,11 +201,29 @@ export interface GlobalExpressionFunctionsContext<T> extends BaseContext {
|
|
|
202
201
|
* Context provided to ExpressionOptions.moduleExpressionFunctions property callback
|
|
203
202
|
*/
|
|
204
203
|
export interface ModuleExpressionFunctionsContext extends BaseContext {
|
|
204
|
+
/**
|
|
205
|
+
* The Adaptable Module requesting the expression functions
|
|
206
|
+
*/
|
|
205
207
|
module: AdaptableModule;
|
|
208
|
+
/**
|
|
209
|
+
* The global boolean expression functions
|
|
210
|
+
*/
|
|
206
211
|
availableBooleanFunctionNames: BooleanFunctionName[];
|
|
212
|
+
/**
|
|
213
|
+
* The global scalar expression functions
|
|
214
|
+
*/
|
|
207
215
|
availableScalarFunctionNames: ScalarFunctionName[];
|
|
216
|
+
/**
|
|
217
|
+
* The global observable expression functions
|
|
218
|
+
*/
|
|
208
219
|
availableObservableFunctionNames: ObservableFunctionName[];
|
|
220
|
+
/**
|
|
221
|
+
* The global aggregated boolean expression functions
|
|
222
|
+
*/
|
|
209
223
|
availableAggregatedBooleanFunctionNames: AggregatedBooleanFunctionName[];
|
|
224
|
+
/**
|
|
225
|
+
* The global aggregated scalar expression functions
|
|
226
|
+
*/
|
|
210
227
|
availableAggregatedScalarFunctionNames: AggregatedScalarFunctionName[];
|
|
211
228
|
}
|
|
212
229
|
/**
|
|
@@ -240,7 +257,7 @@ export interface EvaluateExpressionExternallyContext extends BaseContext {
|
|
|
240
257
|
*/
|
|
241
258
|
export interface QueryableColumnContext extends BaseContext {
|
|
242
259
|
/**
|
|
243
|
-
* Column - just
|
|
260
|
+
* Basic Column Info - just ColumnId, DataType and FriendlyName
|
|
244
261
|
*/
|
|
245
262
|
adaptableColumn: AdaptableColumnBase;
|
|
246
263
|
}
|
|
@@ -5,6 +5,7 @@ import { FlashingCellDefinition } from '../PredefinedConfig/FlashingCellState';
|
|
|
5
5
|
import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
|
|
6
6
|
import { PlusMinusNudge } from '../PredefinedConfig/PlusMinusState';
|
|
7
7
|
import { Shortcut } from '../PredefinedConfig/ShortcutState';
|
|
8
|
+
import { StyledColumn } from '../PredefinedConfig/StyledColumnState';
|
|
8
9
|
import { BaseSchedule } from '../PredefinedConfig/Common/Schedule';
|
|
9
10
|
import { Layout } from '../PredefinedConfig/LayoutState';
|
|
10
11
|
import { AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
@@ -116,7 +117,7 @@ export interface LayoutAvailableContext extends BaseContext {
|
|
|
116
117
|
/**
|
|
117
118
|
* Types of Adaptable Objects that can be associated with a Layout
|
|
118
119
|
*/
|
|
119
|
-
export declare type LayoutAssociatedObject = AlertDefinition | ConditionalStyle | CustomSort | FlashingCellDefinition | FormatColumn | PlusMinusNudge | Shortcut | BaseSchedule;
|
|
120
|
+
export declare type LayoutAssociatedObject = AlertDefinition | ConditionalStyle | CustomSort | FlashingCellDefinition | FormatColumn | PlusMinusNudge | StyledColumn | Shortcut | BaseSchedule;
|
|
120
121
|
/**
|
|
121
122
|
* Context for `LayoutOptions.autoGenerateTagsForLayouts` method
|
|
122
123
|
*/
|
|
@@ -38,6 +38,7 @@ import { FlashingCellApi } from './FlashingCellApi';
|
|
|
38
38
|
import { ChartingApi } from './ChartingApi';
|
|
39
39
|
import { SettingsPanelApi } from './SettingsPanelApi';
|
|
40
40
|
import { StatusBarApi } from './StatusBarApi';
|
|
41
|
+
import { StyledColumnApi } from './StyledColumnApi';
|
|
41
42
|
/**
|
|
42
43
|
*
|
|
43
44
|
* The `AdaptableApi` provides developers with run-time access to AdapTable.
|
|
@@ -173,6 +174,7 @@ export interface AdaptableApi {
|
|
|
173
174
|
* Provides access to the Smart Edit Module
|
|
174
175
|
*/
|
|
175
176
|
smartEditApi: SmartEditApi;
|
|
177
|
+
styledColumnApi: StyledColumnApi;
|
|
176
178
|
/**
|
|
177
179
|
* Methods related to displaying System Status and application health messages
|
|
178
180
|
*/
|
package/src/Api/ColumnApi.d.ts
CHANGED
|
@@ -253,11 +253,17 @@ export interface ColumnApi {
|
|
|
253
253
|
*/
|
|
254
254
|
getDistinctVisibleDisplayValuesForColumn(columnId: string): any[];
|
|
255
255
|
/**
|
|
256
|
-
* Gets all distinct raw values in Column
|
|
256
|
+
* Gets all distinct raw values in Column. Values are sorted.
|
|
257
257
|
* @param columnId Column to check
|
|
258
258
|
* @param skipRowNode optional RowNode which should be skipped when collecting the distinct rawValues
|
|
259
259
|
*/
|
|
260
260
|
getDistinctRawValuesForColumn(columnId: string, skipRowNode?: RowNode): any[];
|
|
261
|
+
/**
|
|
262
|
+
* Gets all distinct raw values in Column. Values are un-sorted.
|
|
263
|
+
* @param columnId Column to check
|
|
264
|
+
* @param skipRowNode optional RowNode which should be skipped when collecting the distinct rawValues
|
|
265
|
+
*/
|
|
266
|
+
getUnsortedDistinctRawValuesForColumn(columnId: string, skipRowNode?: RowNode): any[];
|
|
261
267
|
/**
|
|
262
268
|
* Gets all distinct visible raw values in the Column
|
|
263
269
|
* @param columnId Column to check
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormatColumnState, FormatColumn,
|
|
1
|
+
import { FormatColumnState, FormatColumn, ColumnComparison } from '../PredefinedConfig/FormatColumnState';
|
|
2
2
|
import { AdaptableColumn, AdaptableFormat, AdaptablePredicateDef, AdaptableScope } from '../types';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/core';
|
|
4
4
|
/**
|
|
@@ -135,15 +135,10 @@ export interface FormatColumnApi {
|
|
|
135
135
|
*/
|
|
136
136
|
getFormatColumnWithStyleForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
137
137
|
/**
|
|
138
|
-
* Retrieves all format columns with style for a column
|
|
138
|
+
* Retrieves all format columns with style for a column. Includes text alignment.
|
|
139
139
|
* @param column The Column for which to retrieve the Format Column
|
|
140
140
|
*/
|
|
141
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[];
|
|
147
142
|
/**
|
|
148
143
|
* Gets Format Column if any for given Column which includes Style element with ClassName
|
|
149
144
|
* @param column The Column for which to retrieve the Format Column
|
|
@@ -160,22 +155,6 @@ export interface FormatColumnApi {
|
|
|
160
155
|
* Returns true if Format State includes Format Columns with a Style property
|
|
161
156
|
*/
|
|
162
157
|
hasStyleFormatColumns(): boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Gets the Minimum Value to display for a Numeric Style
|
|
165
|
-
* @param numericStyle Numeric Style to check
|
|
166
|
-
* @param rowNode current Row Node
|
|
167
|
-
* @param cellValue current Cell Value
|
|
168
|
-
*/
|
|
169
|
-
getNumericStyleMinValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
170
|
-
/**
|
|
171
|
-
* Gets the Maximum Value to display for a Numeric Style
|
|
172
|
-
* @param numericStyle Numeric Style to check
|
|
173
|
-
* @param rowNode current Row Node
|
|
174
|
-
* @param cellValue current Cell Value
|
|
175
|
-
*/
|
|
176
|
-
getNumericStyleMaxValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
177
|
-
getCellColorRangeMinValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
178
|
-
getCellColorRangeMaxValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
179
158
|
/**
|
|
180
159
|
* Returns first Format Column that contains checkbox style
|
|
181
160
|
* @param columnId column to check
|
|
@@ -39,6 +39,7 @@ import { FlashingCellApi } from '../FlashingCellApi';
|
|
|
39
39
|
import { ChartingApi } from '../ChartingApi';
|
|
40
40
|
import { StatusBarApi } from '../StatusBarApi';
|
|
41
41
|
import { ActionApi } from '../../../types';
|
|
42
|
+
import { StyledColumnApi } from '../StyledColumnApi';
|
|
42
43
|
export declare class AdaptableApiImpl implements AdaptableApi {
|
|
43
44
|
protected adaptable: IAdaptable;
|
|
44
45
|
actionApi: ActionApi;
|
|
@@ -75,6 +76,7 @@ export declare class AdaptableApiImpl implements AdaptableApi {
|
|
|
75
76
|
queryApi: QueryApi;
|
|
76
77
|
queryLanguageApi: QueryLanguageApi;
|
|
77
78
|
settingsPanelApi: SettingsPanelApi;
|
|
79
|
+
styledColumnApi: StyledColumnApi;
|
|
78
80
|
toolPanelApi: ToolPanelApi;
|
|
79
81
|
teamSharingApi: TeamSharingApi;
|
|
80
82
|
scopeApi: ScopeApi;
|
|
@@ -41,6 +41,7 @@ const FlashingCellApiImpl_1 = require("./FlashingCellApiImpl");
|
|
|
41
41
|
const ChartingApiImpl_1 = require("./ChartingApiImpl");
|
|
42
42
|
const SettingsPanelApiImpl_1 = require("./SettingsPanelApiImpl");
|
|
43
43
|
const ActionApiImpl_1 = require("./ActionApiImpl");
|
|
44
|
+
const StyledColumnApiImpl_1 = require("./StyledColumnApiImpl");
|
|
44
45
|
class AdaptableApiImpl {
|
|
45
46
|
constructor(adaptable) {
|
|
46
47
|
this.adaptable = adaptable;
|
|
@@ -79,6 +80,7 @@ class AdaptableApiImpl {
|
|
|
79
80
|
this.userInterfaceApi = new UserInterfaceApiImpl_1.UserInterfaceApiImpl(adaptable);
|
|
80
81
|
this.queryApi = new QueryApiImpl_1.QueryApiImpl(adaptable);
|
|
81
82
|
this.queryLanguageApi = new QueryLanguageApiImpl_1.QueryLanguageApiImpl(adaptable);
|
|
83
|
+
this.styledColumnApi = new StyledColumnApiImpl_1.StyledColumnApiImpl(adaptable);
|
|
82
84
|
this.toolPanelApi = new ToolPanelApiImpl_1.ToolPanelApiImpl(adaptable);
|
|
83
85
|
this.teamSharingApi = new TeamSharingApiImpl_1.TeamSharingApiImpl(adaptable);
|
|
84
86
|
this.scopeApi = new ScopeApiImpl_1.ScopeApiImpl(adaptable);
|
|
@@ -61,6 +61,7 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
|
|
|
61
61
|
getDistinctBulkUpdateDisplayValuesForColumn(columnId: string, selectedGridCells: GridCell[]): Promise<any[]>;
|
|
62
62
|
getDistinctVisibleDisplayValuesForColumn(columnId: string): any[];
|
|
63
63
|
getDistinctRawValuesForColumn(columnId: string, skipRowNode?: RowNode): any[];
|
|
64
|
+
getUnsortedDistinctRawValuesForColumn(columnId: string, skipRowNode?: RowNode): any[];
|
|
64
65
|
getDistinctVisibleRawValuesForColumn(columnId: string): any[];
|
|
65
66
|
private sortDistinctValues;
|
|
66
67
|
getPrimaryKeyColumn(): AdaptableColumn;
|
|
@@ -343,11 +343,17 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
343
343
|
if (abColumn == undefined) {
|
|
344
344
|
return [];
|
|
345
345
|
}
|
|
346
|
-
|
|
347
|
-
return this.sortDistinctValues(returnValues, abColumn).map((cv) => {
|
|
346
|
+
return this.sortDistinctValues(this.getUnsortedDistinctRawValuesForColumn(columnId, skipRowNode), abColumn).map((cv) => {
|
|
348
347
|
return cv.rawValue;
|
|
349
348
|
});
|
|
350
349
|
}
|
|
350
|
+
getUnsortedDistinctRawValuesForColumn(columnId, skipRowNode) {
|
|
351
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
352
|
+
if (abColumn == undefined) {
|
|
353
|
+
return [];
|
|
354
|
+
}
|
|
355
|
+
return this.adaptable.getDistinctValuesForColumn(abColumn, false, skipRowNode);
|
|
356
|
+
}
|
|
351
357
|
getDistinctVisibleRawValuesForColumn(columnId) {
|
|
352
358
|
const abColumn = this.getColumnFromId(columnId);
|
|
353
359
|
if (abColumn == undefined) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptableStyle } from '../../PredefinedConfig/Common/AdaptableStyle';
|
|
2
2
|
import { ApiBase, LayoutAssociatedObjectLoadConfig } from './ApiBase';
|
|
3
3
|
import { FormatColumnApi } from '../FormatColumnApi';
|
|
4
|
-
import { FormatColumnState, FormatColumn,
|
|
4
|
+
import { FormatColumnState, FormatColumn, ColumnComparison } from '../../PredefinedConfig/FormatColumnState';
|
|
5
5
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
6
|
import { RowNode } from '@ag-grid-community/core';
|
|
7
7
|
import { AdaptableFormat } from '../../types';
|
|
@@ -29,7 +29,6 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
|
|
|
29
29
|
applyFormatColumnDisplayFormats(): void;
|
|
30
30
|
getActiveFormatColumnForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
31
31
|
getColumnFormatColumnsWithStyle(column: AdaptableColumn): FormatColumn[];
|
|
32
|
-
getRowFormatColumnsWithStyle(): FormatColumn[];
|
|
33
32
|
getFormatColumnForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
34
33
|
getFormatColumnForColumnId(columnId: string): FormatColumn | undefined;
|
|
35
34
|
getFormatColumnWithStyleForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
@@ -43,10 +42,6 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
|
|
|
43
42
|
getFormatColumnsWithAllScope(formatColumns: FormatColumn[]): FormatColumn[] | undefined;
|
|
44
43
|
getFormatColumnsWithDataTypeScope(formatColumns: FormatColumn[]): FormatColumn[] | undefined;
|
|
45
44
|
getFormatColumnsWithColumnScope(formatColumns: FormatColumn[]): FormatColumn[] | undefined;
|
|
46
|
-
getNumericStyleMinValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
47
|
-
getNumericStyleMaxValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number | undefined;
|
|
48
|
-
getCellColorRangeMinValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
49
|
-
getCellColorRangeMaxValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
50
45
|
getCheckBoxStyleFormatColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
51
46
|
isCheckBoxStyleFormatColumn(column: AdaptableColumn): boolean;
|
|
52
47
|
fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
|
|
@@ -28,7 +28,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
28
28
|
return this.getAllFormatColumn().filter((formatColumn) => formatColumn.IsSuspended);
|
|
29
29
|
}
|
|
30
30
|
getAllFormatColumnWithStyle() {
|
|
31
|
-
return this.getAllFormatColumn().filter((fc) => fc.Style != null);
|
|
31
|
+
return this.getAllFormatColumn().filter((fc) => fc.Style != null || fc.CellAlignment);
|
|
32
32
|
}
|
|
33
33
|
getColumnComparisonForFormatColumn(formatColumn) {
|
|
34
34
|
var _a, _b;
|
|
@@ -113,13 +113,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
113
113
|
getColumnFormatColumnsWithStyle(column) {
|
|
114
114
|
const formatColumns = this.getAllFormatColumnWithStyle();
|
|
115
115
|
return this.getFormatColumnInColumnScope(formatColumns, column).filter((scopedFormatColumn) => {
|
|
116
|
-
return
|
|
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);
|
|
116
|
+
return this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope);
|
|
123
117
|
});
|
|
124
118
|
}
|
|
125
119
|
getFormatColumnForColumn(column) {
|
|
@@ -138,10 +132,10 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
138
132
|
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
139
133
|
}
|
|
140
134
|
getFormatColumnWithStyleClassNameForColumn(column) {
|
|
141
|
-
return this.getColumnFormatColumnsWithStyle(column).filter((fc) => StringExtensions_1.default.IsNotNullOrEmpty(fc.Style.ClassName));
|
|
135
|
+
return this.getColumnFormatColumnsWithStyle(column).filter((fc) => { var _a; return StringExtensions_1.default.IsNotNullOrEmpty((_a = fc === null || fc === void 0 ? void 0 : fc.Style) === null || _a === void 0 ? void 0 : _a.ClassName); });
|
|
142
136
|
}
|
|
143
137
|
getFormatColumnWithDisplayFormatForColumn(column) {
|
|
144
|
-
const formatColumns = this.getAllFormatColumnWithDisplayFormat()
|
|
138
|
+
const formatColumns = this.getAllFormatColumnWithDisplayFormat();
|
|
145
139
|
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
146
140
|
}
|
|
147
141
|
getFormatColumnWithSingleColumnScope(columnId) {
|
|
@@ -162,13 +156,19 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
162
156
|
return returnFormatColumn;
|
|
163
157
|
}
|
|
164
158
|
getFormatColumnInColumnScope(formatColumns, column) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
159
|
+
// we need to maintain the format columns order, therefore we will extract all 3 scope types in a single iteration
|
|
160
|
+
return formatColumns.filter((fc) => {
|
|
161
|
+
return (
|
|
162
|
+
// this.getFormatColumnsWithColumnScope(formatColumns)
|
|
163
|
+
this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope) ||
|
|
164
|
+
// this.getFormatColumnsWithDataTypeScope(formatColumns)
|
|
165
|
+
this.adaptable.api.scopeApi.scopeHasDataType(fc.Scope) ||
|
|
166
|
+
// this.getFormatColumnsWithAllScope(formatColumns)
|
|
167
|
+
this.adaptable.api.scopeApi.scopeIsAll(fc.Scope));
|
|
168
|
+
});
|
|
168
169
|
}
|
|
169
170
|
getAppropriateFormatColumn(formatColumns, column) {
|
|
170
|
-
return this.getFormatColumnInColumnScope(formatColumns, column).find((scopedFormatColumn) =>
|
|
171
|
-
this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
171
|
+
return this.getFormatColumnInColumnScope(formatColumns, column).find((scopedFormatColumn) => this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
172
172
|
}
|
|
173
173
|
hasStyleFormatColumns() {
|
|
174
174
|
return ArrayExtensions_1.default.IsNotNullOrEmpty(this.getAllFormatColumnWithStyle());
|
|
@@ -185,106 +185,6 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
185
185
|
getFormatColumnsWithColumnScope(formatColumns) {
|
|
186
186
|
return formatColumns.filter((fc) => this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope));
|
|
187
187
|
}
|
|
188
|
-
getNumericStyleMinValue(numericStyle, column, rowNode, cellValue) {
|
|
189
|
-
var _a, _b;
|
|
190
|
-
const columnComparison = numericStyle.GradientStyle
|
|
191
|
-
? numericStyle.GradientStyle.ColumnComparison
|
|
192
|
-
: (_a = numericStyle.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
193
|
-
if (columnComparison) {
|
|
194
|
-
if (!isNaN(Number(columnComparison.MinValue))) {
|
|
195
|
-
return Number(columnComparison.MinValue);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
let columnId = columnComparison.MinValue;
|
|
199
|
-
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
200
|
-
return 0;
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
// for Gradient Column we want just the range that contains cell value
|
|
208
|
-
if (numericStyle.GradientStyle) {
|
|
209
|
-
let range;
|
|
210
|
-
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
211
|
-
if (!range) {
|
|
212
|
-
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
213
|
-
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
214
|
-
range = cellRange;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
return this.getCellColorRangeMinValue(range, column);
|
|
219
|
-
}
|
|
220
|
-
// for percentbar we want to get the whole Ranges
|
|
221
|
-
if (numericStyle.PercentBarStyle) {
|
|
222
|
-
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
223
|
-
if (ranges) {
|
|
224
|
-
return this.getCellColorRangeMinValue(ranges[0], column);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
getNumericStyleMaxValue(numericStyle, column, rowNode, cellValue) {
|
|
229
|
-
var _a, _b;
|
|
230
|
-
const columnComparison = numericStyle.GradientStyle
|
|
231
|
-
? numericStyle.GradientStyle.ColumnComparison
|
|
232
|
-
: (_a = numericStyle.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
233
|
-
if (columnComparison) {
|
|
234
|
-
if (!isNaN(Number(columnComparison.MaxValue))) {
|
|
235
|
-
return Number(columnComparison.MaxValue);
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
let columnId = columnComparison.MaxValue;
|
|
239
|
-
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
240
|
-
return 0;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
if (numericStyle.GradientStyle) {
|
|
248
|
-
let range;
|
|
249
|
-
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
250
|
-
if (!range) {
|
|
251
|
-
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
252
|
-
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
253
|
-
range = cellRange;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
return this.getCellColorRangeMaxValue(range, column);
|
|
258
|
-
}
|
|
259
|
-
if (numericStyle.PercentBarStyle) {
|
|
260
|
-
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
261
|
-
if (ranges) {
|
|
262
|
-
return this.getCellColorRangeMaxValue(ranges[ranges.length - 1], column);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
getCellColorRangeMinValue(range, column) {
|
|
267
|
-
if (!range) {
|
|
268
|
-
return undefined;
|
|
269
|
-
}
|
|
270
|
-
if (range.Min == undefined) {
|
|
271
|
-
return undefined;
|
|
272
|
-
}
|
|
273
|
-
return range.Min == 'Col-Min'
|
|
274
|
-
? this.getAdaptableApi().columnApi.getMinValueForNumericColumn(column)
|
|
275
|
-
: range.Min;
|
|
276
|
-
}
|
|
277
|
-
getCellColorRangeMaxValue(range, column) {
|
|
278
|
-
if (!range) {
|
|
279
|
-
return undefined;
|
|
280
|
-
}
|
|
281
|
-
if (range.Max == undefined) {
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
|
-
return range.Max == 'Col-Max'
|
|
285
|
-
? this.getAdaptableApi().columnApi.getMaxValueForNumericColumn(column)
|
|
286
|
-
: range.Max;
|
|
287
|
-
}
|
|
288
188
|
getCheckBoxStyleFormatColumn(column) {
|
|
289
189
|
var _a;
|
|
290
190
|
if (column.dataType != 'Boolean') {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApiBase, LayoutAssociatedObjectLoadConfig } from './ApiBase';
|
|
2
|
+
import { StyledColumnApi } from '../StyledColumnApi';
|
|
3
|
+
import { StyledColumnState, StyledColumn } from '../../PredefinedConfig/StyledColumnState';
|
|
4
|
+
import { AdaptableColumn, CellColorRange } from '../../types';
|
|
5
|
+
import { RowNode } from '@ag-grid-community/core';
|
|
6
|
+
export declare class StyledColumnApiImpl extends ApiBase implements StyledColumnApi {
|
|
7
|
+
getStyledColumnState(): StyledColumnState;
|
|
8
|
+
getAllStyledColumn(config?: LayoutAssociatedObjectLoadConfig): StyledColumn[];
|
|
9
|
+
getStyledColumnById(id: StyledColumn['Uuid']): StyledColumn;
|
|
10
|
+
getStyledColumnByColumnId(id: StyledColumn['Uuid']): StyledColumn;
|
|
11
|
+
getAllActiveStyledColumn(): StyledColumn[];
|
|
12
|
+
getAllSuspendedStyledColumn(): StyledColumn[];
|
|
13
|
+
deleteStyledColumn(styledColumn: StyledColumn): void;
|
|
14
|
+
addStyledColumn(styledColumn: StyledColumn): void;
|
|
15
|
+
getNumericStyleMinValue(numericStyle: any, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
16
|
+
getNumericStyleMaxValue(numericStyle: any, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number | undefined;
|
|
17
|
+
getCellColorRangeMinValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
18
|
+
getCellColorRangeMaxValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
19
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnApiImpl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ApiBase_1 = require("./ApiBase");
|
|
6
|
+
const StyledColumnRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/StyledColumnRedux"));
|
|
7
|
+
class StyledColumnApiImpl extends ApiBase_1.ApiBase {
|
|
8
|
+
getStyledColumnState() {
|
|
9
|
+
return this.getAdaptableState().StyledColumn;
|
|
10
|
+
}
|
|
11
|
+
getAllStyledColumn(config) {
|
|
12
|
+
var _a;
|
|
13
|
+
return ((_a = this.handleLayoutAssociatedObjects(this.getStyledColumnState().StyledColumns, 'StyledColumn', config)) !== null && _a !== void 0 ? _a : []);
|
|
14
|
+
}
|
|
15
|
+
getStyledColumnById(id) {
|
|
16
|
+
return this.getAllStyledColumn().find((styledcolumn) => styledcolumn.Uuid === id);
|
|
17
|
+
}
|
|
18
|
+
getStyledColumnByColumnId(id) {
|
|
19
|
+
return this.getAllStyledColumn().find((styledcolumn) => styledcolumn.ColumnId === id);
|
|
20
|
+
}
|
|
21
|
+
getAllActiveStyledColumn() {
|
|
22
|
+
return this.getAllStyledColumn().filter((styledcolumn) => !styledcolumn.IsSuspended);
|
|
23
|
+
}
|
|
24
|
+
getAllSuspendedStyledColumn() {
|
|
25
|
+
return this.getAllStyledColumn().filter((styledcolumn) => styledcolumn.IsSuspended);
|
|
26
|
+
}
|
|
27
|
+
deleteStyledColumn(styledColumn) {
|
|
28
|
+
this.dispatchAction(StyledColumnRedux.StyledColumnDelete(styledColumn));
|
|
29
|
+
}
|
|
30
|
+
addStyledColumn(styledColumn) {
|
|
31
|
+
this.dispatchAction(StyledColumnRedux.StyledColumnAdd(styledColumn));
|
|
32
|
+
}
|
|
33
|
+
getNumericStyleMinValue(numericStyle, column, rowNode, cellValue) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const columnComparison = numericStyle.GradientStyle
|
|
36
|
+
? numericStyle.GradientStyle.ColumnComparison
|
|
37
|
+
: (_a = numericStyle.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
38
|
+
if (columnComparison) {
|
|
39
|
+
if (!isNaN(Number(columnComparison.MinValue))) {
|
|
40
|
+
return Number(columnComparison.MinValue);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
let columnId = columnComparison.MinValue;
|
|
44
|
+
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// for Gradient Column we want just the range that contains cell value
|
|
53
|
+
if (numericStyle.GradientStyle) {
|
|
54
|
+
let range;
|
|
55
|
+
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
56
|
+
if (!range) {
|
|
57
|
+
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
58
|
+
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
59
|
+
range = cellRange;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return this.getCellColorRangeMinValue(range, column);
|
|
64
|
+
}
|
|
65
|
+
// for percentbar we want to get the whole Ranges
|
|
66
|
+
if (numericStyle.PercentBarStyle) {
|
|
67
|
+
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
68
|
+
if (ranges) {
|
|
69
|
+
return this.getCellColorRangeMinValue(ranges[0], column);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
getNumericStyleMaxValue(numericStyle, column, rowNode, cellValue) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const columnComparison = numericStyle.GradientStyle
|
|
76
|
+
? numericStyle.GradientStyle.ColumnComparison
|
|
77
|
+
: (_a = numericStyle.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
78
|
+
if (columnComparison) {
|
|
79
|
+
if (!isNaN(Number(columnComparison.MaxValue))) {
|
|
80
|
+
return Number(columnComparison.MaxValue);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
let columnId = columnComparison.MaxValue;
|
|
84
|
+
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (numericStyle.GradientStyle) {
|
|
93
|
+
let range;
|
|
94
|
+
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
95
|
+
if (!range) {
|
|
96
|
+
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
97
|
+
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
98
|
+
range = cellRange;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return this.getCellColorRangeMaxValue(range, column);
|
|
103
|
+
}
|
|
104
|
+
if (numericStyle.PercentBarStyle) {
|
|
105
|
+
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
106
|
+
if (ranges) {
|
|
107
|
+
return this.getCellColorRangeMaxValue(ranges[ranges.length - 1], column);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
getCellColorRangeMinValue(range, column) {
|
|
112
|
+
if (!range) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
if (range.Min == undefined) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
return range.Min == 'Col-Min'
|
|
119
|
+
? this.getAdaptableApi().columnApi.getMinValueForNumericColumn(column)
|
|
120
|
+
: range.Min;
|
|
121
|
+
}
|
|
122
|
+
getCellColorRangeMaxValue(range, column) {
|
|
123
|
+
if (!range) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
if (range.Max == undefined) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
return range.Max == 'Col-Max'
|
|
130
|
+
? this.getAdaptableApi().columnApi.getMaxValueForNumericColumn(column)
|
|
131
|
+
: range.Max;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.StyledColumnApiImpl = StyledColumnApiImpl;
|