@adaptabletools/adaptable-cjs 19.1.2 → 19.2.1-canary.0
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/package.json +1 -1
- package/src/AdaptableOptions/CommentOptions.d.ts +1 -1
- package/src/{agGrid/defaultAdaptableOptions.d.ts → AdaptableOptions/DefaultAdaptableOptions.d.ts} +1 -1
- package/src/{agGrid/defaultAdaptableOptions.js → AdaptableOptions/DefaultAdaptableOptions.js} +3 -2
- package/src/AdaptableOptions/EditOptions.d.ts +6 -2
- package/src/AdaptableOptions/NoteOptions.d.ts +1 -1
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +2 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/Api/GridApi.d.ts +3 -3
- package/src/Api/Implementation/ActionRowApiImpl.js +2 -2
- package/src/Api/Implementation/AlertApiImpl.js +6 -6
- package/src/Api/Implementation/ChartingApiImpl.js +4 -4
- package/src/Api/Implementation/ColumnApiImpl.js +5 -5
- package/src/Api/Implementation/ColumnFilterApiImpl.js +9 -9
- package/src/Api/Implementation/ColumnScopeApiImpl.js +8 -8
- package/src/Api/Implementation/ConfigApiImpl.js +2 -2
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +2 -2
- package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.js +16 -19
- package/src/Api/Implementation/LayoutApiImpl.js +4 -4
- package/src/Api/Implementation/PredicateApiImpl.js +2 -2
- package/src/Api/Implementation/ScheduleApiImpl.js +2 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -1
- package/src/Api/Implementation/ThemeApiImpl.js +2 -2
- package/src/Api/Implementation/UserInterfaceApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.js +9 -10
- package/src/Api/Internal/AdaptableInternalApi.js +2 -2
- package/src/Api/Internal/AlertInternalApi.js +3 -3
- package/src/Api/Internal/CalculatedColumnInternalApi.js +1 -1
- package/src/Api/Internal/ChartingInternalApi.js +7 -7
- package/src/Api/Internal/ColumnFilterInternalApi.js +8 -8
- package/src/Api/Internal/CustomSortInternalApi.js +1 -1
- package/src/Api/Internal/DashboardInternalApi.js +1 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.js +37 -37
- package/src/Api/Internal/ExpressionInternalApi.js +1 -1
- package/src/Api/Internal/FlashingCellInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +8 -8
- package/src/Api/Internal/GridInternalApi.d.ts +7 -0
- package/src/Api/Internal/GridInternalApi.js +21 -3
- package/src/Api/Internal/LayoutInternalApi.js +3 -3
- package/src/Api/Internal/StyledColumnInternalApi.js +6 -6
- package/src/Api/Internal/SystemStatusInternalApi.js +1 -1
- package/src/Api/Internal/TeamSharingInternalApi.js +2 -2
- package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
- package/src/Api/StatusBarApi.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableSearchState.d.ts +22 -0
- package/src/PredefinedConfig/Common/AdaptableSearchState.js +2 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +4 -4
- package/src/Strategy/BulkUpdateModule.js +0 -12
- package/src/Strategy/PlusMinusModule.js +24 -24
- package/src/Strategy/SmartEditModule.js +0 -11
- package/src/Utilities/Services/MetamodelService.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +1 -1
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -1
- package/src/agGrid/Adaptable.js +2 -2
- package/src/agGrid/AdaptableAgGrid.js +22 -21
- package/src/agGrid/AgGridAdapter.js +4 -1
- package/src/agGrid/AgGridColumnAdapter.js +18 -12
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +10 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.2.1-canary.0",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -17,7 +17,7 @@ export interface CommentOptions<TData = any> {
|
|
|
17
17
|
*/
|
|
18
18
|
persistCommentThreads?(commentThreads: CommentThread[]): Promise<void>;
|
|
19
19
|
/**
|
|
20
|
-
* Format string for
|
|
20
|
+
* Date Format string for Comments timestamp
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue 'dd-MM-yyyy HH:mm:ss'
|
|
23
23
|
*/
|
package/src/{agGrid/defaultAdaptableOptions.d.ts → AdaptableOptions/DefaultAdaptableOptions.d.ts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AdaptableOptions } from '
|
|
1
|
+
import { AdaptableOptions } from './AdaptableOptions';
|
|
2
2
|
export declare function applyDefaultAdaptableOptions(adaptableOptions: AdaptableOptions): AdaptableOptions;
|
|
3
3
|
export declare const getDefaultAdaptableOptions: () => AdaptableOptions<any>;
|
package/src/{agGrid/defaultAdaptableOptions.js → AdaptableOptions/DefaultAdaptableOptions.js}
RENAMED
|
@@ -126,7 +126,7 @@ const DefaultAdaptableOptions = {
|
|
|
126
126
|
},
|
|
127
127
|
commentOptions: {
|
|
128
128
|
showPopupCloseButton: true,
|
|
129
|
-
dateFormat:
|
|
129
|
+
dateFormat: GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME,
|
|
130
130
|
},
|
|
131
131
|
customSortOptions: { customSortComparers: undefined },
|
|
132
132
|
notificationsOptions: {
|
|
@@ -322,6 +322,7 @@ const DefaultAdaptableOptions = {
|
|
|
322
322
|
navigation: {},
|
|
323
323
|
alwaysShowInDashboard: false,
|
|
324
324
|
alwaysShowInToolPanel: false,
|
|
325
|
+
showModuleIcons: true
|
|
325
326
|
},
|
|
326
327
|
fdc3Options: {
|
|
327
328
|
enableLogging: false,
|
|
@@ -340,7 +341,7 @@ const DefaultAdaptableOptions = {
|
|
|
340
341
|
},
|
|
341
342
|
noteOptions: {
|
|
342
343
|
showPopupCloseButton: true,
|
|
343
|
-
dateFormat:
|
|
344
|
+
dateFormat: GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME,
|
|
344
345
|
},
|
|
345
346
|
};
|
|
346
347
|
function applyDefaultAdaptableOptions(adaptableOptions) {
|
|
@@ -3,11 +3,11 @@ import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedI
|
|
|
3
3
|
import { MathOperation } from '../PredefinedConfig/Common/Enums';
|
|
4
4
|
import { GridCell } from '../PredefinedConfig/Selection/GridCell';
|
|
5
5
|
/**
|
|
6
|
-
* Options related to Editing in AdapTable - includes Server Validation, Smart Edit Operations and
|
|
6
|
+
* Options related to Editing in AdapTable - includes Server Validation, Smart Edit Operations and Cell Editabiility
|
|
7
7
|
*/
|
|
8
8
|
export interface EditOptions<TData = any> {
|
|
9
9
|
/**
|
|
10
|
-
* Function to validate AdapTable data edits
|
|
10
|
+
* Function to validate AdapTable data edits remotely
|
|
11
11
|
*/
|
|
12
12
|
validateOnServer?: (serverValidationContext: ServerValidationContext<TData>) => Promise<ServerValidationResult>;
|
|
13
13
|
/**
|
|
@@ -97,4 +97,8 @@ export interface CellEditableContext<TData = any> extends BaseContext {
|
|
|
97
97
|
* Cell being edited
|
|
98
98
|
*/
|
|
99
99
|
gridCell: GridCell<TData>;
|
|
100
|
+
/**
|
|
101
|
+
* Default editability according to the AG Grid Column Definition (`ColDef.editable`)
|
|
102
|
+
*/
|
|
103
|
+
defaultColDefEditableValue: boolean;
|
|
100
104
|
}
|
|
@@ -13,10 +13,11 @@ export interface SettingsPanelOptions {
|
|
|
13
13
|
*/
|
|
14
14
|
title?: string;
|
|
15
15
|
/**
|
|
16
|
-
* Settings Panel
|
|
16
|
+
* Icon shown in top left of Settings Panel: Can be `ConfigurationIcon`, `ApplicationIcon` or custom Icon
|
|
17
17
|
* @defaultValue `ConfigurationIcon`
|
|
18
18
|
*/
|
|
19
19
|
icon?: 'ConfigurationIcon' | 'ApplicationIcon' | AdaptableIcon;
|
|
20
|
+
showModuleIcons?: boolean;
|
|
20
21
|
/**
|
|
21
22
|
* Whether a Settings Panel button should always be displayed in `ModuleButtons` area of Dashboard
|
|
22
23
|
* @defaultValue false
|
|
@@ -17,13 +17,13 @@ export interface UserInterfaceOptions<TData = any> {
|
|
|
17
17
|
*/
|
|
18
18
|
useCustomMacLikeScrollbars?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* The application icon to appear in Dashboard and elsewhere (e.g.
|
|
20
|
+
* The application icon to appear in Dashboard and elsewhere (e.g. in Notifications)
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue null
|
|
23
23
|
*/
|
|
24
24
|
applicationIcon?: AdaptableIcon;
|
|
25
25
|
/**
|
|
26
|
-
* Bespoke icons that can be used in
|
|
26
|
+
* Bespoke icons that can be used in AdapTable (e.g. Badge Styles and Buttons)
|
|
27
27
|
*/
|
|
28
28
|
customIcons?: CustomIcon[];
|
|
29
29
|
/**
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ export interface GridApi {
|
|
|
209
209
|
*/
|
|
210
210
|
getVisibleRowNodes(config?: {
|
|
211
211
|
includeGroupRows?: boolean;
|
|
212
|
-
filterFn
|
|
212
|
+
filterFn?(rowNode: IRowNode): boolean;
|
|
213
213
|
}): IRowNode[];
|
|
214
214
|
/**
|
|
215
215
|
* Retrieves all Row Nodes currently in the Grid (by default excluding the group rows)
|
|
@@ -217,14 +217,14 @@ export interface GridApi {
|
|
|
217
217
|
*/
|
|
218
218
|
getAllRowNodes(config?: {
|
|
219
219
|
includeGroupRows?: boolean;
|
|
220
|
-
filterFn
|
|
220
|
+
filterFn?(rowNode: IRowNode): boolean;
|
|
221
221
|
}): IRowNode[];
|
|
222
222
|
/**
|
|
223
223
|
* Retrieves all Grouped Row Nodes currently in the Grid
|
|
224
224
|
* @param config - configuration
|
|
225
225
|
*/
|
|
226
226
|
getGroupRowNodes(config?: {
|
|
227
|
-
filterFn
|
|
227
|
+
filterFn?(rowNode: IRowNode): boolean;
|
|
228
228
|
}): IRowNode[];
|
|
229
229
|
/**
|
|
230
230
|
* Retrieves Row Nodes that contain given Primary Keys
|
|
@@ -18,7 +18,7 @@ class ActionRowApiImpl extends ApiBase_1.ApiBase {
|
|
|
18
18
|
return actionRowButtons !== null && actionRowButtons !== void 0 ? actionRowButtons : [];
|
|
19
19
|
}
|
|
20
20
|
displayEditActionRow(primaryKey) {
|
|
21
|
-
const rowNode = this.
|
|
21
|
+
const rowNode = this.getGridApi().getRowNodeForPrimaryKey(primaryKey);
|
|
22
22
|
if (!rowNode) {
|
|
23
23
|
this.logWarn(`Can NOT edit row: rowNode not found for primaryKey ${primaryKey}`);
|
|
24
24
|
}
|
|
@@ -40,7 +40,7 @@ class ActionRowApiImpl extends ApiBase_1.ApiBase {
|
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
42
|
displayCloneActionRow(primaryKey) {
|
|
43
|
-
const rowNode = this.
|
|
43
|
+
const rowNode = this.getGridApi().getRowNodeForPrimaryKey(primaryKey);
|
|
44
44
|
if (!rowNode) {
|
|
45
45
|
this.logWarn(`Can NOT clone row: rowNode not found for primaryKey ${primaryKey}`);
|
|
46
46
|
}
|
|
@@ -48,7 +48,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
48
48
|
this.dispatchAction(SystemRedux.SystemAlertAdd(alertToShow, this.getAlertOptions().maxAlertsInStore));
|
|
49
49
|
// 2. Publish the Alert Fired Event
|
|
50
50
|
const alertFiredInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { alert: alertToShow });
|
|
51
|
-
const results = await this.
|
|
51
|
+
const results = await this.getEventApi().emit('AlertFired', alertFiredInfo);
|
|
52
52
|
const showPopup = results.reduce((endResult, aResult) => {
|
|
53
53
|
return endResult && aResult !== false;
|
|
54
54
|
}, true);
|
|
@@ -105,13 +105,13 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
105
105
|
}
|
|
106
106
|
if (alertNode) {
|
|
107
107
|
if (alertProperties.HighlightRow) {
|
|
108
|
-
this.
|
|
108
|
+
this.getGridApi().refreshRowNodes([alertNode]);
|
|
109
109
|
setTimeout(() => {
|
|
110
110
|
this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
|
|
111
111
|
}, this.getAlertOptions().rowHighlightDuration);
|
|
112
112
|
}
|
|
113
113
|
if (alertProperties.HighlightCell) {
|
|
114
|
-
this.
|
|
114
|
+
this.getGridApi().refreshCells([alertNode], [alertToShow.cellDataChangedInfo.column.columnId]);
|
|
115
115
|
setTimeout(() => {
|
|
116
116
|
this.dispatchAction(SystemRedux.SystemAlertRemoveCellHighlight(alertToShow));
|
|
117
117
|
}, this.getAlertOptions().cellHighlightDuration);
|
|
@@ -122,7 +122,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
122
122
|
else if (alertProperties.HighlightRow &&
|
|
123
123
|
(0, AdaptableAlert_1.isAdaptableRowChangedAlert)(alertToShow) &&
|
|
124
124
|
((_b = alertToShow.gridDataChangedInfo) === null || _b === void 0 ? void 0 : _b.rowTrigger) === 'Add') {
|
|
125
|
-
this.
|
|
125
|
+
this.getGridApi().refreshRowNodes(alertToShow.gridDataChangedInfo.rowNodes);
|
|
126
126
|
setTimeout(() => {
|
|
127
127
|
this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
|
|
128
128
|
}, this.getAlertOptions().rowHighlightDuration);
|
|
@@ -172,7 +172,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
172
172
|
}
|
|
173
173
|
evaluateAlertDefinitions(alertDefinitions) {
|
|
174
174
|
const filterScopeAllDefinitions = (alertDefinition) => {
|
|
175
|
-
if (this.
|
|
175
|
+
if (this.getColumnScopeApi().scopeIsAll(alertDefinition.Scope) &&
|
|
176
176
|
!this.getAdaptableApi().expressionApi.getAdaptableQueryExpression(alertDefinition.Rule)) {
|
|
177
177
|
// we don't support scope ALL without an expression
|
|
178
178
|
// the predicates for scope ALL do NOT make any sense for a programmatic evaluation
|
|
@@ -207,7 +207,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
207
207
|
// if there is an Expression defined, extract only the columns from there (in that case the Scope would be 'All' anyway)
|
|
208
208
|
// columns referenced in rule expression
|
|
209
209
|
const ruleExpression = this.getAdaptableApi().expressionApi.getAdaptableQueryExpression(alertDefinition.Rule);
|
|
210
|
-
if (this.
|
|
210
|
+
if (this.getColumnScopeApi().scopeIsAll(alertDefinition.Scope) &&
|
|
211
211
|
StringExtensions_1.default.IsNotNullOrEmpty(ruleExpression)) {
|
|
212
212
|
// return only first referenced column (otherwise we would generate multiple alerts for the same row)
|
|
213
213
|
const queryColumns = this.getAdaptableApi()
|
|
@@ -95,19 +95,19 @@ class ChartingApiImpl extends ApiBase_1.ApiBase {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
getOpenChartContainer(chartDefinition) {
|
|
98
|
-
var _a
|
|
99
|
-
const containerOptions =
|
|
98
|
+
var _a;
|
|
99
|
+
const containerOptions = this.getChartingOptions().chartContainers;
|
|
100
100
|
if (!containerOptions || !containerOptions.length) {
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
|
-
return ((
|
|
103
|
+
return ((_a = containerOptions.find((container) => {
|
|
104
104
|
const chartRef = this.getChartRef(chartDefinition.Model.chartId);
|
|
105
105
|
const containerElement = this.internalApi.getContainerElement(container);
|
|
106
106
|
if (!(chartRef === null || chartRef === void 0 ? void 0 : chartRef.chartElement) || !containerElement) {
|
|
107
107
|
return false;
|
|
108
108
|
}
|
|
109
109
|
return containerElement.contains(chartRef.chartElement);
|
|
110
|
-
})) !== null &&
|
|
110
|
+
})) !== null && _a !== void 0 ? _a : null);
|
|
111
111
|
}
|
|
112
112
|
setChartReadOnly(chartDefinition) {
|
|
113
113
|
this.dispatchAction(ChartingRedux.ChartingEditChart(Object.assign(Object.assign({}, chartDefinition), { IsReadOnly: true })));
|
|
@@ -29,7 +29,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
29
29
|
}
|
|
30
30
|
getColumns() {
|
|
31
31
|
var _a;
|
|
32
|
-
return (_a = this.
|
|
32
|
+
return (_a = this.getGridApi().getGridState().Columns) !== null && _a !== void 0 ? _a : [];
|
|
33
33
|
}
|
|
34
34
|
getStandardColumns() {
|
|
35
35
|
var _a;
|
|
@@ -42,7 +42,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
42
42
|
return cols !== null && cols !== void 0 ? cols : [];
|
|
43
43
|
}
|
|
44
44
|
getVisibleColumns() {
|
|
45
|
-
const layout = this.
|
|
45
|
+
const layout = this.getLayoutApi().getCurrentLayout();
|
|
46
46
|
const visibleCols = layout.Columns.reduce((acc, colId) => {
|
|
47
47
|
acc[colId] = true;
|
|
48
48
|
return acc;
|
|
@@ -180,7 +180,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
180
180
|
}
|
|
181
181
|
let result = columnId + GeneralConstants.MISSING_COLUMN;
|
|
182
182
|
if (this.isAutoRowGroupColumn(columnId)) {
|
|
183
|
-
const currentLayout = this.
|
|
183
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
184
184
|
if (currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) {
|
|
185
185
|
result = `[Grouped column: ${currentLayout.RowGroupedColumns.join(', ')}]`;
|
|
186
186
|
}
|
|
@@ -385,10 +385,10 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
getDistinctDisplayValuesForColumn(columnId) {
|
|
388
|
-
return this.
|
|
388
|
+
return this.getGridApi().internalApi.getDistinctDisplayValuesForColumn(columnId);
|
|
389
389
|
}
|
|
390
390
|
setColumnCaption(columnId, caption) {
|
|
391
|
-
return this.
|
|
391
|
+
return this.getLayoutApi().setColumnCaption(columnId, caption);
|
|
392
392
|
}
|
|
393
393
|
updateColumnConfiguration(columnConfig) {
|
|
394
394
|
(0, logDeprecation_1.logDeprecationExternal)(this.getAdatableLogger(), 'ColumnApi', 'updateColumnConfiguration', 'GridApi', 'updateAgGridColumnState');
|
|
@@ -18,10 +18,10 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
18
18
|
};
|
|
19
19
|
return this.getAdaptableApi()
|
|
20
20
|
.predicateApi.internalApi.getFilterPredicateDefs(scope)
|
|
21
|
-
.filter((predicate) => this.
|
|
21
|
+
.filter((predicate) => this.getColumnScopeApi().isColumnInScope(column, predicate.columnScope));
|
|
22
22
|
}
|
|
23
23
|
getFilterPredicateDefsForColumnId(columnId) {
|
|
24
|
-
const column = this.
|
|
24
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
25
25
|
return column ? this.getFilterPredicateDefsForColumn(column) : undefined;
|
|
26
26
|
}
|
|
27
27
|
showQuickFilterBar() {
|
|
@@ -39,7 +39,7 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
39
39
|
}
|
|
40
40
|
getColumnFilters() {
|
|
41
41
|
var _a;
|
|
42
|
-
const currentLayout = this.
|
|
42
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
43
43
|
return (_a = currentLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
|
|
44
44
|
}
|
|
45
45
|
getActiveColumnFilters() {
|
|
@@ -48,8 +48,8 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
48
48
|
getColumnFilterDefs() {
|
|
49
49
|
const filters = this.getColumnFilters();
|
|
50
50
|
return filters.map((columnFilter) => {
|
|
51
|
-
const column = this.
|
|
52
|
-
const predicate = this.
|
|
51
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnFilter.ColumnId);
|
|
52
|
+
const predicate = this.getPredicateApi().getPredicateDefById(columnFilter.Predicate.PredicateId);
|
|
53
53
|
return {
|
|
54
54
|
predicate,
|
|
55
55
|
dataType: column === null || column === void 0 ? void 0 : column.dataType,
|
|
@@ -59,7 +59,7 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
59
59
|
}
|
|
60
60
|
getColumnFiltersForLayout(layoutName) {
|
|
61
61
|
var _a;
|
|
62
|
-
const layout = this.
|
|
62
|
+
const layout = this.getLayoutApi().getLayoutByName(layoutName);
|
|
63
63
|
return (_a = layout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
|
|
64
64
|
}
|
|
65
65
|
setColumnFilters(columnFilters) {
|
|
@@ -68,7 +68,7 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
68
68
|
this.logWarn('Column Filter has no Predicate', columnFilter);
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
-
const isValidPredicate = this.
|
|
71
|
+
const isValidPredicate = this.getPredicateApi().isValidPredicate(columnFilter.Predicate);
|
|
72
72
|
if (!isValidPredicate) {
|
|
73
73
|
this.logWarn('Column Filter Predicate is not valid', columnFilter);
|
|
74
74
|
}
|
|
@@ -122,10 +122,10 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
122
122
|
if (!filter || !filter.Predicate || !filter.Predicate.PredicateId) {
|
|
123
123
|
return false;
|
|
124
124
|
}
|
|
125
|
-
const predicateDef = this.
|
|
125
|
+
const predicateDef = this.getPredicateApi().getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
|
|
126
126
|
if (ArrayExtensions_1.default.IsNull(predicateDef.inputs) &&
|
|
127
127
|
// values predicates have no inputs in the definition
|
|
128
|
-
!this.
|
|
128
|
+
!this.getPredicateApi().internalApi.hasPredicateValues(filter.Predicate)) {
|
|
129
129
|
return true;
|
|
130
130
|
}
|
|
131
131
|
const inputs = filter.Predicate.Inputs;
|
|
@@ -30,7 +30,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
30
30
|
if (scope == undefined) {
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
33
|
-
const columns = this.
|
|
33
|
+
const columns = this.getColumnApi().getColumns();
|
|
34
34
|
if ('All' in scope) {
|
|
35
35
|
return columns;
|
|
36
36
|
}
|
|
@@ -100,7 +100,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
100
100
|
!this.scopeIsAll(scope) &&
|
|
101
101
|
'ColumnIds' in scope &&
|
|
102
102
|
scope.ColumnIds.length == 1 &&
|
|
103
|
-
this.
|
|
103
|
+
this.getColumnApi().hasNumberDataType(scope.ColumnIds[0]));
|
|
104
104
|
}
|
|
105
105
|
isSingleBooleanColumnScope(scope) {
|
|
106
106
|
return (this.scopeHasColumns(scope) &&
|
|
@@ -108,7 +108,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
108
108
|
!this.scopeIsAll(scope) &&
|
|
109
109
|
'ColumnIds' in scope &&
|
|
110
110
|
scope.ColumnIds.length == 1 &&
|
|
111
|
-
this.
|
|
111
|
+
this.getColumnApi().hasBooleanDataType(scope.ColumnIds[0]));
|
|
112
112
|
}
|
|
113
113
|
areAllBooleanColumnsInScope(scope) {
|
|
114
114
|
return (this.scopeHasColumns(scope) &&
|
|
@@ -116,7 +116,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
116
116
|
!this.scopeIsAll(scope) &&
|
|
117
117
|
'ColumnIds' in scope &&
|
|
118
118
|
scope.ColumnIds.length &&
|
|
119
|
-
scope.ColumnIds.every((columnId) => this.
|
|
119
|
+
scope.ColumnIds.every((columnId) => this.getColumnApi().hasBooleanDataType(columnId)));
|
|
120
120
|
}
|
|
121
121
|
isColumnInScopeColumns(column, scope) {
|
|
122
122
|
return this.scopeHasColumns(scope) && this.isColumnInScope(column, scope);
|
|
@@ -124,7 +124,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
124
124
|
isPrimaryKeyColumnInScopeColumns(scope) {
|
|
125
125
|
return ('ColumnIds' in scope &&
|
|
126
126
|
scope.ColumnIds.length == 1 &&
|
|
127
|
-
scope.ColumnIds.find((c) => c == this.
|
|
127
|
+
scope.ColumnIds.find((c) => c == this.getOptions().primaryKey) != null);
|
|
128
128
|
}
|
|
129
129
|
getScopeToString(scope) {
|
|
130
130
|
if ('All' in scope) {
|
|
@@ -257,7 +257,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
257
257
|
'DataTypes' in b &&
|
|
258
258
|
a.ColumnIds.every((columnId) => {
|
|
259
259
|
var _a;
|
|
260
|
-
return b.DataTypes.includes((_a = this.
|
|
260
|
+
return b.DataTypes.includes((_a = this.getColumnApi().getColumnWithColumnId(columnId)) === null || _a === void 0 ? void 0 : _a.dataType);
|
|
261
261
|
})) {
|
|
262
262
|
return true;
|
|
263
263
|
}
|
|
@@ -269,7 +269,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
269
269
|
// check if each colum in a has column types in b
|
|
270
270
|
if ('ColumnIds' in a && 'ColumnTypes' in b) {
|
|
271
271
|
const inScope = a.ColumnIds.every((columnId) => {
|
|
272
|
-
const column = this.
|
|
272
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
273
273
|
// check if at least one column-type is in scope
|
|
274
274
|
return column.columnTypes.some((columnColumnType) => b.ColumnTypes.includes(columnColumnType));
|
|
275
275
|
});
|
|
@@ -280,7 +280,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
280
280
|
return false;
|
|
281
281
|
}
|
|
282
282
|
createCellColorRangesForScope(scope) {
|
|
283
|
-
let distinctColumnsValues = this.
|
|
283
|
+
let distinctColumnsValues = this.getGridApi().internalApi.getDistinctRawValuesForColumn(this.getSingleColumnInScope(scope));
|
|
284
284
|
let minValue = Math.min(...distinctColumnsValues);
|
|
285
285
|
let maxValue = Math.max(...distinctColumnsValues);
|
|
286
286
|
const ranges = [];
|
|
@@ -71,7 +71,7 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
|
|
|
71
71
|
const newState = this.getPersistedState();
|
|
72
72
|
const stateReloadedInfo = Object.assign({ oldState,
|
|
73
73
|
newState, adaptableStateKey: adaptableOptions.adaptableStateKey }, this.getAdaptableInternalApi().buildBaseContext());
|
|
74
|
-
this.
|
|
74
|
+
this.getEventApi().emit('AdaptableStateReloaded', stateReloadedInfo);
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
});
|
|
@@ -106,7 +106,7 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
|
|
|
106
106
|
}
|
|
107
107
|
getAdaptableSortState() {
|
|
108
108
|
const adaptableSortState = {
|
|
109
|
-
columnSorts: this.
|
|
109
|
+
columnSorts: this.getGridApi().getColumnSorts(),
|
|
110
110
|
customSorts: this.getAdaptableApi().customSortApi.getCustomSorts(),
|
|
111
111
|
};
|
|
112
112
|
return adaptableSortState;
|
|
@@ -12,7 +12,7 @@ class DataChangeHistoryApiImpl extends ApiBase_1.ApiBase {
|
|
|
12
12
|
const columnId = dataChangeInfo.column.columnId;
|
|
13
13
|
const primaryKeyValue = dataChangeInfo.primaryKeyValue;
|
|
14
14
|
const changedAt = dataChangeInfo.changedAt;
|
|
15
|
-
const showLastDataChangeOnly = this.
|
|
15
|
+
const showLastDataChangeOnly = this.getDataChangeHistoryOptions().showLastDataChangeOnly;
|
|
16
16
|
if (showLastDataChangeOnly) {
|
|
17
17
|
return JSON.stringify({ columnId, primaryKeyValue });
|
|
18
18
|
}
|
|
@@ -37,7 +37,7 @@ class FlashingCellApiImpl extends ApiBase_1.ApiBase {
|
|
|
37
37
|
showFlashingCell(flashingCellToShow) {
|
|
38
38
|
this.addUidToAdaptableObject(flashingCellToShow);
|
|
39
39
|
const flashingCellFiredInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { flashingCell: flashingCellToShow });
|
|
40
|
-
const results = this.
|
|
40
|
+
const results = this.getEventApi().emitSync('FlashingCellDisplayed', flashingCellFiredInfo);
|
|
41
41
|
const shouldShow = results.reduce((endResult, aResult) => {
|
|
42
42
|
return endResult && aResult !== false;
|
|
43
43
|
}, true);
|
|
@@ -95,7 +95,7 @@ class FlashingCellApiImpl extends ApiBase_1.ApiBase {
|
|
|
95
95
|
getFlashingCellPredicateDefsForScope(scope) {
|
|
96
96
|
return this.getAdaptableApi()
|
|
97
97
|
.predicateApi.internalApi.getFlashingCellPredicateDefs(scope)
|
|
98
|
-
.filter((predicateDef) => this.
|
|
98
|
+
.filter((predicateDef) => this.getColumnScopeApi().isScopeInScope(scope, predicateDef.columnScope));
|
|
99
99
|
}
|
|
100
100
|
clearAllFlashingCells() {
|
|
101
101
|
this.getAdaptableInternalApi().getFlashingCellService().clearAllGridCellFlashes();
|
|
@@ -75,7 +75,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
75
75
|
return this.internalApi.getFormatColumnWithColumnInScope(formatColumns, column);
|
|
76
76
|
}
|
|
77
77
|
getFormatColumnsForColumnId(columnId, config) {
|
|
78
|
-
const abColumn = this.
|
|
78
|
+
const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
79
79
|
if (!abColumn) {
|
|
80
80
|
return [];
|
|
81
81
|
}
|
|
@@ -85,13 +85,13 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
85
85
|
this.showModulePopup(ModuleConstants.FormatColumnModuleId);
|
|
86
86
|
}
|
|
87
87
|
getFormatColumnsWithAllScope(formatColumns) {
|
|
88
|
-
return formatColumns.filter((fc) => this.
|
|
88
|
+
return formatColumns.filter((fc) => this.getColumnScopeApi().scopeIsAll(fc.Scope));
|
|
89
89
|
}
|
|
90
90
|
getFormatColumnsWithDataTypeScope(formatColumns) {
|
|
91
|
-
return formatColumns.filter((fc) => this.
|
|
91
|
+
return formatColumns.filter((fc) => this.getColumnScopeApi().scopeHasDataType(fc.Scope));
|
|
92
92
|
}
|
|
93
93
|
getFormatColumnsWithColumnScope(formatColumns) {
|
|
94
|
-
return formatColumns.filter((fc) => this.
|
|
94
|
+
return formatColumns.filter((fc) => this.getColumnScopeApi().scopeHasColumns(fc.Scope));
|
|
95
95
|
}
|
|
96
96
|
hasCustomDisplayFormatter(formatColumn) {
|
|
97
97
|
var _a;
|
|
@@ -89,7 +89,7 @@ class FreeTextColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
89
89
|
}
|
|
90
90
|
getFreeTextColumnValueForRowNode(freeTextColumn, rowNode) {
|
|
91
91
|
try {
|
|
92
|
-
if (this.
|
|
92
|
+
if (this.getGridApi().isGroupRowNode(rowNode)) {
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
95
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(freeTextColumn.FreeTextStoredValues)) {
|
|
@@ -92,7 +92,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
92
92
|
}
|
|
93
93
|
setCellValue(cellUpdateRequest) {
|
|
94
94
|
var _a;
|
|
95
|
-
const abColumn = this.
|
|
95
|
+
const abColumn = this.getColumnApi().getColumnWithColumnId(cellUpdateRequest.columnId);
|
|
96
96
|
if (!abColumn) {
|
|
97
97
|
this.logWarn(`setCellValue() - column not found for columnId: ${cellUpdateRequest.columnId}`);
|
|
98
98
|
return;
|
|
@@ -245,7 +245,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
245
245
|
/**
|
|
246
246
|
* Select all rows and all columns
|
|
247
247
|
*/
|
|
248
|
-
const currentLayout = this.
|
|
248
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
249
249
|
preapredGridCellRange = {
|
|
250
250
|
columnIds: currentLayout.Columns,
|
|
251
251
|
};
|
|
@@ -281,7 +281,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
281
281
|
this.selectColumns([columnId]);
|
|
282
282
|
}
|
|
283
283
|
selectColumns(columnIds) {
|
|
284
|
-
this.
|
|
284
|
+
this.getColumnApi().selectColumns(columnIds);
|
|
285
285
|
}
|
|
286
286
|
getFirstRowNode() {
|
|
287
287
|
return this._adaptable.getFirstRowNode();
|
|
@@ -314,7 +314,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
314
314
|
}
|
|
315
315
|
getNormalisedValueFromRowNode(rowNode, columnId) {
|
|
316
316
|
const rawValue = this._adaptable.getRawValueFromRowNode(rowNode, columnId);
|
|
317
|
-
const abColumn = this.
|
|
317
|
+
const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
318
318
|
return this._adaptable.getNormalisedValueFromRawValue(rawValue, abColumn);
|
|
319
319
|
}
|
|
320
320
|
getRowNodesForPrimaryKeys(primaryKeyValues) {
|
|
@@ -498,25 +498,20 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
498
498
|
this._adaptable.updateRowGroupsExpandedState();
|
|
499
499
|
}
|
|
500
500
|
isCellEditable(gridCell) {
|
|
501
|
-
if (
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (!gridCell.column) {
|
|
505
|
-
// GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
|
|
506
|
-
return false;
|
|
507
|
-
}
|
|
508
|
-
if (gridCell.column.readOnly) {
|
|
501
|
+
// Note if cell.editable in AG Grid is a function (and nothing is provided in Adaptble) this will return true.
|
|
502
|
+
// If not Grid Cell or Column then return false - GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
|
|
503
|
+
if (!gridCell || !gridCell.column || !gridCell.rowNode) {
|
|
509
504
|
return false;
|
|
510
505
|
}
|
|
511
506
|
if (gridCell.rowNode && this.isSummaryNode(gridCell.rowNode)) {
|
|
512
507
|
return false;
|
|
513
508
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
return
|
|
509
|
+
// checking `gridCell.column.readOnly` might return misleading results
|
|
510
|
+
// because cell editability is defined by EditOptions.isCellEditable() as well
|
|
511
|
+
const agGridColumn = this.getColumnApi().internalApi.getAgGridColumnForAdaptableColumn(gridCell.column.columnId);
|
|
512
|
+
// this will invoke the colDef.editable callback
|
|
513
|
+
// there we check both Adaptable and AG Grid editability
|
|
514
|
+
return agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.isCellEditable(gridCell.rowNode);
|
|
520
515
|
}
|
|
521
516
|
isCellEdited(gridCell) {
|
|
522
517
|
if (!gridCell) {
|
|
@@ -649,7 +644,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
649
644
|
});
|
|
650
645
|
const newColumnDefinitions = columnDefinitionsToBeUpdated.filter((c) => !currentColIds.includes(c.colId));
|
|
651
646
|
if (newColumnDefinitions.length) {
|
|
652
|
-
this.logWarn(`Columns with ids ${newColumnDefinitions
|
|
647
|
+
this.logWarn(`Columns with ids ${newColumnDefinitions
|
|
648
|
+
.map((c) => c.colId)
|
|
649
|
+
.join(', ')} do not exist, will add them instead!`);
|
|
653
650
|
}
|
|
654
651
|
this.setAgGridColumnDefinitions([...updatedColDefs, ...newColumnDefinitions]);
|
|
655
652
|
}
|
|
@@ -285,25 +285,25 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
removeColumnFromLayout(columnId, layoutName) {
|
|
288
|
-
const column = this.
|
|
288
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
289
289
|
if (column) {
|
|
290
290
|
const layout = this.getLayoutByName(layoutName);
|
|
291
291
|
if (layout) {
|
|
292
292
|
if (layout.Columns.includes(columnId)) {
|
|
293
293
|
this.dispatchAction(LayoutRedux.LayoutRemoveColumn(layoutName, columnId));
|
|
294
|
-
this.
|
|
294
|
+
this.getColumnApi().hideColumn(columnId);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
addColumnToLayout(columnId, layoutName) {
|
|
300
|
-
const column = this.
|
|
300
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
301
301
|
if (column) {
|
|
302
302
|
const layout = this.getLayoutByName(layoutName);
|
|
303
303
|
if (layout) {
|
|
304
304
|
if (!layout.Columns.includes(columnId)) {
|
|
305
305
|
this.dispatchAction(LayoutRedux.LayoutAddColumn(layoutName, columnId));
|
|
306
|
-
this.
|
|
306
|
+
this.getColumnApi().showColumn(columnId);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
}
|
|
@@ -75,9 +75,9 @@ class PredicateApiImpl extends ApiBase_1.ApiBase {
|
|
|
75
75
|
if (!predicate.ColumnId) {
|
|
76
76
|
return this.handlePredicate(predicate, context, defaultReturn);
|
|
77
77
|
}
|
|
78
|
-
const paramsForColumn = Object.assign(Object.assign({}, context), { column: this.
|
|
78
|
+
const paramsForColumn = Object.assign(Object.assign({}, context), { column: this.getColumnApi().getColumnWithColumnId(predicate.ColumnId),
|
|
79
79
|
// value: params?.node?.data?.[predicate.ColumnId],
|
|
80
|
-
value: this.
|
|
80
|
+
value: this.getGridApi().getRawValueFromRowNode(context.node, predicate.ColumnId) });
|
|
81
81
|
if ('oldValue' in paramsForColumn) {
|
|
82
82
|
delete paramsForColumn.oldValue;
|
|
83
83
|
}
|