@adaptabletools/adaptable 10.0.1 → 10.0.4-canary.1
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/base.css +68 -26
- package/index.css +80 -28
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/NotificationsOptions.d.ts +3 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +107 -5
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +39 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/Events/AdaptableReady.d.ts +2 -6
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/{Utilities/Interface/ProgressIndicator.js → Api/Events/BaseEventInfo.js} +0 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +22 -15
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +8 -0
- package/src/Api/Implementation/ColumnApiImpl.js +69 -36
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +28 -10
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +20 -4
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +69 -87
- package/src/Api/InternalApi.d.ts +3 -1
- package/src/Api/UserInterfaceApi.d.ts +16 -6
- package/src/PredefinedConfig/AlertState.d.ts +4 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +7 -3
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.js +12 -11
- package/src/Strategy/BulkUpdateModule.js +5 -5
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +5 -5
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.js +6 -6
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +14 -2
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/ReportService.js +13 -12
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +53 -32
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +72 -31
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +7 -7
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -5
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +2 -2
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +21 -4
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +249 -102
- package/src/agGrid/agGridHelper.js +33 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/metamodel/adaptable.metamodel.d.ts +125 -16
- package/src/metamodel/adaptable.metamodel.js +403 -106
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -18,7 +18,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
18
18
|
acc[colId] = true;
|
|
19
19
|
return acc;
|
|
20
20
|
}, {});
|
|
21
|
-
return this.getColumns().filter((c) => visibleCols[c.
|
|
21
|
+
return this.getColumns().filter((c) => visibleCols[c.columnId]);
|
|
22
22
|
}
|
|
23
23
|
selectColumn(columnId) {
|
|
24
24
|
this.adaptable.selectColumn(columnId);
|
|
@@ -51,7 +51,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
51
51
|
// put this here as there might be other indicators we are not aware of
|
|
52
52
|
// perhaps with non auto groups ?
|
|
53
53
|
//https://www.ag-grid.com/javascript-grid-grouping/
|
|
54
|
-
return columnId.startsWith(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
|
|
54
|
+
return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
|
|
55
55
|
}
|
|
56
56
|
isCalculatedColumn(columnId) {
|
|
57
57
|
return (this.adaptable.api.calculatedColumnApi
|
|
@@ -78,33 +78,33 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
isNumericColumn(column) {
|
|
81
|
-
return column.
|
|
81
|
+
return column.dataType == Enums_1.DataType.Number;
|
|
82
82
|
}
|
|
83
83
|
isBooleanColumn(column) {
|
|
84
|
-
return column.
|
|
84
|
+
return column.dataType == Enums_1.DataType.Boolean;
|
|
85
85
|
}
|
|
86
86
|
isDateColumn(column) {
|
|
87
|
-
return column.
|
|
87
|
+
return column.dataType == Enums_1.DataType.Date;
|
|
88
88
|
}
|
|
89
89
|
getColumnDataTypeFromColumnId(columnId) {
|
|
90
90
|
const column = this.getColumnFromId(columnId); // this.getColumns().find(c => c.ColumnId == columnId);
|
|
91
91
|
if (!column) {
|
|
92
92
|
return undefined;
|
|
93
93
|
}
|
|
94
|
-
return column.
|
|
94
|
+
return column.dataType;
|
|
95
95
|
}
|
|
96
96
|
getFriendlyNameFromColumn(columnId, column) {
|
|
97
97
|
if (columnId.includes(GeneralConstants.MISSING_COLUMN)) {
|
|
98
98
|
return columnId;
|
|
99
99
|
}
|
|
100
100
|
if (column) {
|
|
101
|
-
return column.
|
|
101
|
+
return column.friendlyName;
|
|
102
102
|
}
|
|
103
103
|
this.LogMissingColumnWarning(columnId);
|
|
104
104
|
return columnId + GeneralConstants.MISSING_COLUMN;
|
|
105
105
|
}
|
|
106
106
|
getFriendlyNameFromColumnId(columnId) {
|
|
107
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
107
|
+
const foundColumn = this.getColumns().find((c) => c.columnId == columnId);
|
|
108
108
|
if (foundColumn) {
|
|
109
109
|
return this.getFriendlyNameFromColumn(columnId, foundColumn);
|
|
110
110
|
}
|
|
@@ -130,9 +130,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
130
130
|
if (friendlyName.includes(GeneralConstants.MISSING_COLUMN)) {
|
|
131
131
|
return friendlyName.replace(GeneralConstants.MISSING_COLUMN, ''); // Ids should stay "pure"
|
|
132
132
|
}
|
|
133
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
133
|
+
const foundColumn = this.getColumns().find((c) => c.friendlyName == friendlyName);
|
|
134
134
|
if (foundColumn) {
|
|
135
|
-
return foundColumn.
|
|
135
|
+
return foundColumn.columnId;
|
|
136
136
|
}
|
|
137
137
|
this.LogMissingColumnWarning(friendlyName);
|
|
138
138
|
return friendlyName + GeneralConstants.MISSING_COLUMN;
|
|
@@ -149,7 +149,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
149
149
|
}
|
|
150
150
|
getColumnsFromFriendlyNames(friendlyNames) {
|
|
151
151
|
// not sure if this is right as might ignore bad cols
|
|
152
|
-
return friendlyNames.map((friendlyName) => this.getColumns().find((x) => x.
|
|
152
|
+
return friendlyNames.map((friendlyName) => this.getColumns().find((x) => x.friendlyName == friendlyName));
|
|
153
153
|
}
|
|
154
154
|
getColumnsFromIds(columnIds, logWarning = true) {
|
|
155
155
|
let returnCols = [];
|
|
@@ -166,7 +166,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
166
166
|
if (ArrayExtensions_1.default.IsNullOrEmpty(this.getColumns())) {
|
|
167
167
|
return null;
|
|
168
168
|
}
|
|
169
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
169
|
+
const foundColumn = this.getColumns().find((c) => c.columnId == columnId);
|
|
170
170
|
if (foundColumn) {
|
|
171
171
|
return foundColumn;
|
|
172
172
|
}
|
|
@@ -176,20 +176,13 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
176
176
|
return undefined;
|
|
177
177
|
}
|
|
178
178
|
getColumnIdsFromId(columnId, logWarning = false) {
|
|
179
|
-
var _a;
|
|
180
179
|
const col = this.getColumnFromId(columnId, logWarning);
|
|
181
180
|
if (col) {
|
|
182
|
-
if (this.isCalculatedColumn(col.
|
|
183
|
-
|
|
184
|
-
.getAllCalculatedColumn()
|
|
185
|
-
.find((cc) => cc.ColumnId == col.ColumnId);
|
|
186
|
-
if (calculatedColumn) {
|
|
187
|
-
const columnIds = this.adaptable.api.queryLanguageApi.getColumnsFromExpression((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
188
|
-
return columnIds;
|
|
189
|
-
}
|
|
181
|
+
if (this.isCalculatedColumn(col.columnId)) {
|
|
182
|
+
return this.adaptable.api.calculatedColumnApi.getReferencedColumnIdsForCalculatedColumnId(col.columnId);
|
|
190
183
|
}
|
|
191
184
|
else {
|
|
192
|
-
return [col.
|
|
185
|
+
return [col.columnId];
|
|
193
186
|
}
|
|
194
187
|
}
|
|
195
188
|
return undefined;
|
|
@@ -202,7 +195,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
202
195
|
if (ArrayExtensions_1.default.IsNullOrEmpty(this.getColumns())) {
|
|
203
196
|
return null;
|
|
204
197
|
}
|
|
205
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
198
|
+
const foundColumn = this.getColumns().find((c) => c.friendlyName == columnName);
|
|
206
199
|
if (foundColumn) {
|
|
207
200
|
return foundColumn;
|
|
208
201
|
}
|
|
@@ -230,36 +223,36 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
230
223
|
}
|
|
231
224
|
}
|
|
232
225
|
getNumericColumns() {
|
|
233
|
-
return this.getColumns().filter((c) => c.
|
|
226
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Number);
|
|
234
227
|
}
|
|
235
228
|
getNumericArrayColumns() {
|
|
236
|
-
return this.getColumns().filter((c) => c.
|
|
229
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.NumberArray);
|
|
237
230
|
}
|
|
238
231
|
getStringColumns() {
|
|
239
|
-
return this.getColumns().filter((c) => c.
|
|
232
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.String);
|
|
240
233
|
}
|
|
241
234
|
getDateColumns() {
|
|
242
|
-
return this.getColumns().filter((c) => c.
|
|
235
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Date);
|
|
243
236
|
}
|
|
244
237
|
getBooleanColumns() {
|
|
245
|
-
return this.getColumns().filter((c) => c.
|
|
238
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Boolean);
|
|
246
239
|
}
|
|
247
240
|
getSortableColumns() {
|
|
248
|
-
return this.getColumns().filter((c) => c.
|
|
241
|
+
return this.getColumns().filter((c) => c.sortable);
|
|
249
242
|
}
|
|
250
243
|
getGroupableColumns() {
|
|
251
|
-
return this.getColumns().filter((c) => c.
|
|
244
|
+
return this.getColumns().filter((c) => c.groupable);
|
|
252
245
|
}
|
|
253
246
|
getPivotableColumns() {
|
|
254
|
-
return this.getColumns().filter((c) => c.
|
|
247
|
+
return this.getColumns().filter((c) => c.pivotable);
|
|
255
248
|
}
|
|
256
249
|
getAggregetableColumns() {
|
|
257
250
|
return this.getColumns()
|
|
258
|
-
.filter((c) => c.
|
|
259
|
-
.filter((c) => c.
|
|
251
|
+
.filter((c) => c.aggregatable)
|
|
252
|
+
.filter((c) => c.dataType == Enums_1.DataType.Number);
|
|
260
253
|
}
|
|
261
254
|
getQueryableColumns() {
|
|
262
|
-
return this.getColumns().filter((c) => c.
|
|
255
|
+
return this.getColumns().filter((c) => c.queryable);
|
|
263
256
|
}
|
|
264
257
|
LogMissingColumnWarning(columnId) {
|
|
265
258
|
if (this.adaptable.adaptableOptions.generalOptions.showMissingColumnsWarning &&
|
|
@@ -282,6 +275,42 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
282
275
|
return cv.displayValue;
|
|
283
276
|
});
|
|
284
277
|
}
|
|
278
|
+
async getDistinctFilterDisplayValuesForColumn(columnId, filter) {
|
|
279
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
280
|
+
if (abColumn == undefined) {
|
|
281
|
+
return {
|
|
282
|
+
values: [],
|
|
283
|
+
suppressClientSideFilter: false,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const { gridCells, suppressClientSideFilter, } = await this.adaptable.getDistinctFilterValuesForColumn(abColumn, false, filter);
|
|
287
|
+
return {
|
|
288
|
+
values: this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
289
|
+
return cv.displayValue;
|
|
290
|
+
}),
|
|
291
|
+
suppressClientSideFilter,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
async getDistinctCustomSortDisplayValuesForColumn(columnId) {
|
|
295
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
296
|
+
if (abColumn == undefined) {
|
|
297
|
+
return [];
|
|
298
|
+
}
|
|
299
|
+
const gridCells = await this.adaptable.getDistinctCustomSortValuesForColumn(abColumn, false);
|
|
300
|
+
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
301
|
+
return cv.displayValue;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
async getDistinctBulkUpdateDisplayValuesForColumn(columnId, selectedGridCells) {
|
|
305
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
306
|
+
if (abColumn == undefined) {
|
|
307
|
+
return [];
|
|
308
|
+
}
|
|
309
|
+
const gridCells = await this.adaptable.getDistinctBulkUpdateValuesForColumn(abColumn, false, selectedGridCells);
|
|
310
|
+
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
311
|
+
return cv.displayValue;
|
|
312
|
+
});
|
|
313
|
+
}
|
|
285
314
|
getDistinctVisibleDisplayValuesForColumn(columnId) {
|
|
286
315
|
const abColumn = this.getColumnFromId(columnId);
|
|
287
316
|
if (abColumn == undefined) {
|
|
@@ -316,7 +345,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
316
345
|
// this does NOT into account Custom Sort - far too hard for now...
|
|
317
346
|
let sortOrder = Enums_1.SortOrder.Asc;
|
|
318
347
|
if (this.getFilterOptions().sortColumnValuesInFilter) {
|
|
319
|
-
let columnSort = this.adaptable.api.gridApi.getColumnSortForColumn(column.
|
|
348
|
+
let columnSort = this.adaptable.api.gridApi.getColumnSortForColumn(column.columnId);
|
|
320
349
|
if (columnSort && columnSort.SortOrder == 'Desc') {
|
|
321
350
|
sortOrder = Enums_1.SortOrder.Desc;
|
|
322
351
|
}
|
|
@@ -337,7 +366,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
337
366
|
}
|
|
338
367
|
getAllColumnFriendlyNames() {
|
|
339
368
|
return this.getColumns().map((c) => {
|
|
340
|
-
return c.
|
|
369
|
+
return c.friendlyName;
|
|
341
370
|
});
|
|
342
371
|
}
|
|
343
372
|
usesAdaptableFilterForm(columnId) {
|
|
@@ -362,5 +391,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
362
391
|
}
|
|
363
392
|
return true;
|
|
364
393
|
}
|
|
394
|
+
isColumnReferencedInExpression(columnId, expression) {
|
|
395
|
+
const colIds = this.adaptable.api.queryLanguageApi.getColumnsFromExpression(expression);
|
|
396
|
+
return colIds.some((c) => c === columnId);
|
|
397
|
+
}
|
|
365
398
|
}
|
|
366
399
|
exports.ColumnApiImpl = ColumnApiImpl;
|
|
@@ -43,7 +43,7 @@ export declare class ConfigApiImpl extends ApiBase implements ConfigApi {
|
|
|
43
43
|
setAdaptableStateKey(adaptableStateKey: string, config?: {
|
|
44
44
|
predefinedConfig: PredefinedConfig;
|
|
45
45
|
flushCurrentState?: boolean;
|
|
46
|
-
}):
|
|
46
|
+
}): Promise<any>;
|
|
47
47
|
getDescriptionForModule(module: AdaptableModule): string;
|
|
48
48
|
getHelpPageForModule(module: AdaptableModule): string;
|
|
49
49
|
getUserStateByStateKey(stateKey: AdaptableStateKey, returnJson?: boolean): ConfigState | string;
|
|
@@ -132,24 +132,35 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
|
|
|
132
132
|
return adaptableSortState;
|
|
133
133
|
}
|
|
134
134
|
setAdaptableStateKey(adaptableStateKey, config) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
this.adaptable.api.internalApi.executeWithProgressIndicator(`Initialising...`, () => {
|
|
137
|
+
this.adaptable.adaptableOptions.adaptableStateKey = adaptableStateKey;
|
|
138
|
+
const flushCurrentState = !config || config.flushCurrentState !== false;
|
|
139
|
+
// make sure we persist any "pending" changes to state - since stateOptions.debounceStateDelay can cause
|
|
140
|
+
// the state to be persisted with a delay, which we dont want in this case
|
|
141
|
+
const flushStatePromise = flushCurrentState
|
|
142
|
+
? this.adaptable.adaptableStore.saveStateNow(this.adaptable)
|
|
143
|
+
: Promise.resolve(true);
|
|
144
|
+
flushStatePromise.then(() => {
|
|
145
|
+
let predefinedConfig = config === null || config === void 0 ? void 0 : config.predefinedConfig;
|
|
146
|
+
if (predefinedConfig) {
|
|
147
|
+
predefinedConfig = AdaptableHelper_1.initPredefinedConfigWithUuids(predefinedConfig);
|
|
148
|
+
}
|
|
149
|
+
const promise = this.adaptable.adaptableStore.loadStore(this.adaptable, adaptableStateKey, predefinedConfig);
|
|
150
|
+
promise
|
|
151
|
+
.then(() => {
|
|
152
|
+
this.adaptable.prepareGrid();
|
|
153
|
+
this.adaptable.api.internalApi.hideLoadingScreen();
|
|
154
|
+
})
|
|
155
|
+
.then(() => {
|
|
156
|
+
// resolve main(result) promise
|
|
157
|
+
resolve();
|
|
158
|
+
}, () => {
|
|
159
|
+
// reject main(result) promise
|
|
160
|
+
reject();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
151
163
|
});
|
|
152
|
-
return promise;
|
|
153
164
|
});
|
|
154
165
|
}
|
|
155
166
|
getDescriptionForModule(module) {
|
|
@@ -18,6 +18,7 @@ class DashboardApiImpl extends ApiBase_1.ApiBase {
|
|
|
18
18
|
// so we debounced to only get tha latest call
|
|
19
19
|
this.fireDashboardChangedEvent = (trigger, oldDashboardState, newDashboardState) => {
|
|
20
20
|
const dashboardChangedInfo = {
|
|
21
|
+
adaptableApi: this.adaptable.api,
|
|
21
22
|
actionName: trigger,
|
|
22
23
|
oldDashboardState: oldDashboardState,
|
|
23
24
|
newDashboardState: newDashboardState,
|
|
@@ -39,7 +40,7 @@ class DashboardApiImpl extends ApiBase_1.ApiBase {
|
|
|
39
40
|
getCustomDashboardButtonByLabel(buttonLabel) {
|
|
40
41
|
const api = this.getAdaptableApi();
|
|
41
42
|
const dashboardContext = {
|
|
42
|
-
api,
|
|
43
|
+
adaptableApi: api,
|
|
43
44
|
dashboardState: api.dashboardApi.getDashboardState(),
|
|
44
45
|
};
|
|
45
46
|
return this.getDashboardOptions().customDashboardButtons.find((cb) => {
|
|
@@ -103,7 +103,6 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
103
103
|
if (report.ReportRowScope == 'CustomRows' || report.ReportColumnScope == 'CustomColumns') {
|
|
104
104
|
return false;
|
|
105
105
|
}
|
|
106
|
-
let abColumn = this.adaptable.api.columnApi.getColumnFromId(dataChangedInfo.columnId);
|
|
107
106
|
// Start with the DataChanged Column and go through all possibilities
|
|
108
107
|
switch (report.ReportColumnScope) {
|
|
109
108
|
case 'AllColumns':
|
|
@@ -111,21 +110,22 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
111
110
|
break;
|
|
112
111
|
case 'ScopeColumns':
|
|
113
112
|
// use the Scope object which will tell us if the Column is relevant
|
|
114
|
-
if (!this.adaptable.api.scopeApi.isColumnInScopeColumns(
|
|
113
|
+
if (!this.adaptable.api.scopeApi.isColumnInScopeColumns(dataChangedInfo.column, report.Scope)) {
|
|
115
114
|
return false;
|
|
116
115
|
}
|
|
117
116
|
break;
|
|
118
117
|
case 'SelectedColumns':
|
|
119
118
|
let selectedCellInfo = this.adaptable.api.gridApi.getSelectedCellInfo();
|
|
120
119
|
if (selectedCellInfo) {
|
|
121
|
-
if (selectedCellInfo.columns.find((c) => c.
|
|
120
|
+
if (selectedCellInfo.columns.find((c) => c.columnId == dataChangedInfo.column.columnId) ==
|
|
121
|
+
null) {
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
break;
|
|
126
126
|
case 'VisibleColumns':
|
|
127
127
|
// hope that visibile column property is updated whenever the layout changes... (need to check!)
|
|
128
|
-
if (!
|
|
128
|
+
if (!dataChangedInfo.column.visible) {
|
|
129
129
|
return false;
|
|
130
130
|
}
|
|
131
131
|
break;
|
|
@@ -243,7 +243,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
243
243
|
}
|
|
244
244
|
getCheckBoxStyleFormatColumn(column) {
|
|
245
245
|
var _a;
|
|
246
|
-
if (column.
|
|
246
|
+
if (column.dataType != 'Boolean') {
|
|
247
247
|
return undefined;
|
|
248
248
|
}
|
|
249
249
|
const checkBoxFormatColumns = (_a = this.getFormatColumnState().FormatColumns) === null || _a === void 0 ? void 0 : _a.filter((fc) => { var _a; return (_a = fc.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle; });
|
|
@@ -256,6 +256,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
256
256
|
}
|
|
257
257
|
fireCheckboxColumnClickedEvent(columnId, rowData, primaryKeyValue, isChecked) {
|
|
258
258
|
let checkboxColumnClickedInfo = {
|
|
259
|
+
adaptableApi: this.adaptable.api,
|
|
259
260
|
column: this.adaptable.api.columnApi.getColumnFromId(columnId),
|
|
260
261
|
rowData: rowData,
|
|
261
262
|
primaryKeyValue: primaryKeyValue,
|
|
@@ -68,7 +68,8 @@ class FreeTextColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
createFreeTextColumn({ columnName, columnId, defaultValue = null, }) {
|
|
71
|
-
let freeTextColumn = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn()
|
|
71
|
+
let freeTextColumn = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(this.adaptable.api.internalApi.getAdaptableOptions().filterOptions
|
|
72
|
+
.enableFilterOnSpecialColumns);
|
|
72
73
|
freeTextColumn.ColumnId = columnId;
|
|
73
74
|
freeTextColumn.FriendlyName = columnName || columnId;
|
|
74
75
|
freeTextColumn.DefaultValue = defaultValue;
|
|
@@ -103,14 +104,19 @@ class FreeTextColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
checkFreeTextColumnForDataChange(dataChangedInfo) {
|
|
106
|
-
let freeTextColumn = this.getAllFreeTextColumn().find((fc) => fc.ColumnId == dataChangedInfo.columnId);
|
|
107
|
+
let freeTextColumn = this.getAllFreeTextColumn().find((fc) => fc.ColumnId == dataChangedInfo.column.columnId);
|
|
107
108
|
if (freeTextColumn) {
|
|
108
109
|
let freeTextStoredValue = {
|
|
109
110
|
PrimaryKey: dataChangedInfo.primaryKeyValue,
|
|
110
111
|
FreeText: dataChangedInfo.newValue,
|
|
111
112
|
};
|
|
112
113
|
this.addEditFreeTextColumnStoredValue(freeTextColumn, freeTextStoredValue);
|
|
113
|
-
|
|
114
|
+
var colsToRefresh = [dataChangedInfo.column.columnId];
|
|
115
|
+
const refencedCalcColumns = this.adaptable.api.calculatedColumnApi.getCalculatedColumnsReferencingColumnId(dataChangedInfo.column.columnId);
|
|
116
|
+
refencedCalcColumns.forEach((calculatedColumn) => {
|
|
117
|
+
colsToRefresh.push(calculatedColumn.ColumnId);
|
|
118
|
+
});
|
|
119
|
+
this.adaptable.refreshCells([dataChangedInfo.rowNode], colsToRefresh, false);
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
getFreeTextColumnModuleReferences(freeTextColumn) {
|
|
@@ -13,12 +13,19 @@ import { GridCellRange } from '../../PredefinedConfig/Selection/GridCellRange';
|
|
|
13
13
|
export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
14
14
|
getGridState(): GridState;
|
|
15
15
|
setGridData(dataSource: any): void;
|
|
16
|
+
getGridData(): any[];
|
|
17
|
+
getFilteredData(): any[];
|
|
16
18
|
loadGridData(dataSource: any): void;
|
|
17
19
|
updateGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): void;
|
|
18
20
|
addGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): void;
|
|
19
21
|
undoCellEdit(dataChangedInfo: DataChangedInfo): boolean;
|
|
20
22
|
deleteGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): void;
|
|
21
23
|
setCellValue(columnId: string, newValue: any, primaryKeyValue: any): void;
|
|
24
|
+
setCellsValue(gridCells: {
|
|
25
|
+
columnId: any;
|
|
26
|
+
newValue: any;
|
|
27
|
+
primaryKeyValue: any;
|
|
28
|
+
}[]): void;
|
|
22
29
|
getSelectedCellInfo(): SelectedCellInfo;
|
|
23
30
|
getSelectedRowInfo(): SelectedRowInfo;
|
|
24
31
|
getCellDisplayValue(primaryKeyValue: any, columnId: string): any | undefined;
|
|
@@ -76,6 +83,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
76
83
|
unhighlightCell(cellHighlightInfo: CellHighlightInfo): void;
|
|
77
84
|
unhighlightAllCells(): void;
|
|
78
85
|
refreshCells(rowNodes: RowNode[], columnIds: string[]): void;
|
|
86
|
+
refreshRow(primaryKey: string): void;
|
|
79
87
|
areCellsEditable(gridCells: GridCell[]): boolean;
|
|
80
88
|
getRowCount(): number;
|
|
81
89
|
getVisibleRowCount(): number;
|
|
@@ -85,4 +93,5 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
85
93
|
selectAll(): void;
|
|
86
94
|
deselectAll(): void;
|
|
87
95
|
destroy(): void;
|
|
96
|
+
getGridContainerElement(): HTMLElement | null;
|
|
88
97
|
}
|
|
@@ -12,6 +12,12 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
12
12
|
setGridData(dataSource) {
|
|
13
13
|
this.adaptable.setDataSource(dataSource);
|
|
14
14
|
}
|
|
15
|
+
getGridData() {
|
|
16
|
+
return this.adaptable.getGridData();
|
|
17
|
+
}
|
|
18
|
+
getFilteredData() {
|
|
19
|
+
return this.adaptable.getFilteredData();
|
|
20
|
+
}
|
|
15
21
|
loadGridData(dataSource) {
|
|
16
22
|
this.adaptable.loadDataSource(dataSource);
|
|
17
23
|
}
|
|
@@ -26,7 +32,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
26
32
|
undoCellEdit(dataChangedInfo) {
|
|
27
33
|
// for the reason of this hacky solution see the comments in DataService
|
|
28
34
|
this.adaptable.api.internalApi.getDataService().logUndoChange(dataChangedInfo);
|
|
29
|
-
this.setCellValue(dataChangedInfo.columnId, dataChangedInfo.oldValue, dataChangedInfo.primaryKeyValue);
|
|
35
|
+
this.setCellValue(dataChangedInfo.column.columnId, dataChangedInfo.oldValue, dataChangedInfo.primaryKeyValue);
|
|
30
36
|
return true;
|
|
31
37
|
}
|
|
32
38
|
deleteGridData(dataRows, dataUpdateConfig) {
|
|
@@ -36,20 +42,23 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
setCellValue(columnId, newValue, primaryKeyValue) {
|
|
39
|
-
|
|
45
|
+
const abColumn = this.adaptable.api.columnApi.getColumnFromId(columnId);
|
|
46
|
+
if (!abColumn || abColumn.readOnly) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const gridCell = {
|
|
40
50
|
primaryKeyValue: primaryKeyValue,
|
|
41
|
-
columnId: columnId,
|
|
42
51
|
rawValue: newValue,
|
|
43
52
|
displayValue: newValue,
|
|
44
53
|
normalisedValue: newValue,
|
|
45
54
|
rowNode: this.getRowNodeForPrimaryKey(primaryKeyValue),
|
|
55
|
+
column: abColumn,
|
|
46
56
|
};
|
|
47
|
-
const abColumn = this.adaptable.api.columnApi.getColumnFromId(columnId);
|
|
48
|
-
if (!abColumn || abColumn.ReadOnly) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
57
|
this.adaptable.api.internalApi.setGridCell(gridCell);
|
|
52
58
|
}
|
|
59
|
+
setCellsValue(gridCells) {
|
|
60
|
+
gridCells === null || gridCells === void 0 ? void 0 : gridCells.forEach((gridCell) => this.setCellValue(gridCell.columnId, gridCell.newValue, gridCell.primaryKeyValue));
|
|
61
|
+
}
|
|
53
62
|
getSelectedCellInfo() {
|
|
54
63
|
return this.getGridState().SelectedCellInfo;
|
|
55
64
|
}
|
|
@@ -161,7 +170,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
161
170
|
return gridCell ? gridCell.displayValue : undefined;
|
|
162
171
|
}
|
|
163
172
|
getFormattedValueFromRawValue(columnId, rawValue) {
|
|
164
|
-
return this.adaptable.getDisplayValueFromRawValue(columnId, rawValue
|
|
173
|
+
return this.adaptable.getDisplayValueFromRawValue(columnId, rawValue);
|
|
165
174
|
}
|
|
166
175
|
getNormalisedValueFromRowNode(rowNode, columnId) {
|
|
167
176
|
const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
|
|
@@ -221,6 +230,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
221
230
|
const adaptableSearchState = this.adaptable.api.configApi.getAdaptableSearchState();
|
|
222
231
|
const adaptableSortState = this.adaptable.api.configApi.getAdaptableSortState();
|
|
223
232
|
const searchChangedInfo = {
|
|
233
|
+
adaptableApi: this.adaptable.api,
|
|
224
234
|
searchChangedTrigger,
|
|
225
235
|
adaptableSearchState: adaptableSearchState,
|
|
226
236
|
adaptableSortState: adaptableSortState,
|
|
@@ -231,6 +241,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
231
241
|
fireCellChangedEvent(dataChangedInfo) {
|
|
232
242
|
if (this.adaptable.isInitialised) {
|
|
233
243
|
const cellChangedInfo = {
|
|
244
|
+
adaptableApi: this.adaptable.api,
|
|
234
245
|
cellChange: dataChangedInfo,
|
|
235
246
|
};
|
|
236
247
|
this.adaptable.api.eventApi.emit('CellChanged', cellChangedInfo);
|
|
@@ -239,6 +250,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
239
250
|
fireGridDataChangedEvent(dataRows, rowTigger) {
|
|
240
251
|
if (this.adaptable.isInitialised) {
|
|
241
252
|
const gridDataChangedInfo = {
|
|
253
|
+
adaptableApi: this.adaptable.api,
|
|
242
254
|
rowTigger: rowTigger,
|
|
243
255
|
dataRows: dataRows,
|
|
244
256
|
};
|
|
@@ -273,12 +285,15 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
273
285
|
refreshCells(rowNodes, columnIds) {
|
|
274
286
|
this.adaptable.refreshCells(rowNodes, columnIds, true);
|
|
275
287
|
}
|
|
288
|
+
refreshRow(primaryKey) {
|
|
289
|
+
const rowNode = this.getRowNodeForPrimaryKey(primaryKey);
|
|
290
|
+
this.adaptable.redrawRow(rowNode);
|
|
291
|
+
}
|
|
276
292
|
areCellsEditable(gridCells) {
|
|
277
293
|
let returnValue = true;
|
|
278
294
|
gridCells.forEach((gridCell) => {
|
|
279
295
|
if (returnValue) {
|
|
280
|
-
|
|
281
|
-
if (abColumn.ReadOnly) {
|
|
296
|
+
if (gridCell.column.readOnly) {
|
|
282
297
|
returnValue = false;
|
|
283
298
|
return;
|
|
284
299
|
}
|
|
@@ -318,5 +333,8 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
318
333
|
destroy() {
|
|
319
334
|
this.adaptable.destroy();
|
|
320
335
|
}
|
|
336
|
+
getGridContainerElement() {
|
|
337
|
+
return this.adaptable.getGridContainerElement();
|
|
338
|
+
}
|
|
321
339
|
}
|
|
322
340
|
exports.GridApiImpl = GridApiImpl;
|
|
@@ -73,7 +73,7 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
|
|
|
73
73
|
setGridCells(gridCells: GridCell[]): void;
|
|
74
74
|
setToolbarTitle(): string;
|
|
75
75
|
setGridCell(gridCell: GridCell): void;
|
|
76
|
-
buildDataChangedInfo(config: Pick<DataChangedInfo, 'newValue' | 'oldValue' | '
|
|
76
|
+
buildDataChangedInfo(config: Pick<DataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): DataChangedInfo;
|
|
77
77
|
private createDataChangedInfoFromGridCell;
|
|
78
78
|
setLastAppliedShortCut(gridCell: GridCell | undefined): void;
|
|
79
79
|
updateCurrentDraftLayout(layout: Layout): void;
|
|
@@ -113,5 +113,7 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
|
|
|
113
113
|
destroyFrameworkComponent(containerDomNode: HTMLElement, frameworkComponent: AdaptableFrameworkComponent, componentType: 'toolPanel' | 'toolbar'): void;
|
|
114
114
|
initializeDataChangeHistory(): void;
|
|
115
115
|
isTextComparisonCaseSensitive(): boolean;
|
|
116
|
+
executeWithProgressIndicator(label: string, executeFn: () => void): void;
|
|
117
|
+
hideProgressIndicator(): void;
|
|
116
118
|
dispatchReduxAction(action: Action): void;
|
|
117
119
|
}
|
|
@@ -144,7 +144,7 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
144
144
|
this.dispatchAction(GridRedux.GridAddColumns(AdaptableColumns));
|
|
145
145
|
}
|
|
146
146
|
removeAdaptableColumn(colId) {
|
|
147
|
-
const col = this.getAdaptableState().Grid.Columns.find((c) => c.
|
|
147
|
+
const col = this.getAdaptableState().Grid.Columns.find((c) => c.columnId === colId);
|
|
148
148
|
if (col) {
|
|
149
149
|
this.dispatchAction(GridRedux.GridRemoveColumn(col));
|
|
150
150
|
}
|
|
@@ -175,12 +175,12 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
175
175
|
return Object.assign(Object.assign({}, config), { rowData: (_a = config.rowNode) === null || _a === void 0 ? void 0 : _a.data, changedAt: Date.now() });
|
|
176
176
|
}
|
|
177
177
|
createDataChangedInfoFromGridCell(gridCell) {
|
|
178
|
-
let currentValue = this.adaptable.getDisplayValue(gridCell.primaryKeyValue, gridCell.columnId);
|
|
178
|
+
let currentValue = this.adaptable.getDisplayValue(gridCell.primaryKeyValue, gridCell.column.columnId);
|
|
179
179
|
const currentRowNode = this.adaptable.getRowNodeForPrimaryKey(gridCell.primaryKeyValue);
|
|
180
180
|
const dataChangedInfo = this.buildDataChangedInfo({
|
|
181
181
|
oldValue: currentValue,
|
|
182
182
|
newValue: gridCell.rawValue,
|
|
183
|
-
|
|
183
|
+
column: gridCell.column,
|
|
184
184
|
primaryKeyValue: gridCell.primaryKeyValue,
|
|
185
185
|
rowNode: currentRowNode,
|
|
186
186
|
});
|
|
@@ -272,7 +272,7 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
272
272
|
}
|
|
273
273
|
getCustomSortComparer(column) {
|
|
274
274
|
var _a;
|
|
275
|
-
return (_a = this.getGeneralOptions().customSortComparers) === null || _a === void 0 ? void 0 : _a.find((csc) => csc.columnId == column.
|
|
275
|
+
return (_a = this.getGeneralOptions().customSortComparers) === null || _a === void 0 ? void 0 : _a.find((csc) => csc.columnId == column.columnId);
|
|
276
276
|
}
|
|
277
277
|
getLabelForButton(button, context) {
|
|
278
278
|
if (!button.label) {
|
|
@@ -394,6 +394,22 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
394
394
|
isTextComparisonCaseSensitive() {
|
|
395
395
|
return this.adaptable.adaptableOptions.generalOptions.caseSensitiveTextComparisons;
|
|
396
396
|
}
|
|
397
|
+
executeWithProgressIndicator(label, executeFn) {
|
|
398
|
+
this.dispatchReduxAction(SystemRedux_1.SystemProgressIndicatorShow(label));
|
|
399
|
+
// setTimeout required to give the ProgressIndicator rendering a head-start (see RAF in ProgressIndicator implementation)
|
|
400
|
+
setTimeout(() => {
|
|
401
|
+
try {
|
|
402
|
+
executeFn();
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
this.hideProgressIndicator();
|
|
406
|
+
LoggingHelper_1.LogAdaptableError('Unexpected error while executing a function with a progress indicator', error);
|
|
407
|
+
}
|
|
408
|
+
}, 16);
|
|
409
|
+
}
|
|
410
|
+
hideProgressIndicator() {
|
|
411
|
+
this.dispatchReduxAction(SystemRedux_1.SystemProgressIndicatorHide());
|
|
412
|
+
}
|
|
397
413
|
// General way to get to store from inside Adaptable...
|
|
398
414
|
dispatchReduxAction(action) {
|
|
399
415
|
this.dispatchAction(action);
|
|
@@ -50,6 +50,7 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
50
50
|
}
|
|
51
51
|
fireLayoutChangedEvent(trigger, oldSate, newState) {
|
|
52
52
|
const layoutChangedInfo = {
|
|
53
|
+
adaptableApi: this.adaptable.api,
|
|
53
54
|
actionName: trigger,
|
|
54
55
|
oldLayoutState: oldSate,
|
|
55
56
|
newLayoutState: newState,
|
|
@@ -188,9 +189,9 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
188
189
|
let gridState = this.getAdaptableApi().gridApi.getGridState();
|
|
189
190
|
let layoutState = this.getLayoutState();
|
|
190
191
|
const isLayoutDefined = (layoutName) => !!layoutState.Layouts.filter((layout) => layout.Name === layoutName)[0];
|
|
191
|
-
let defaultLayoutColumns = gridState.Columns.filter((column) => column.
|
|
192
|
+
let defaultLayoutColumns = gridState.Columns.filter((column) => column.visible);
|
|
192
193
|
const columnsMap = gridState.Columns.reduce((acc, col) => {
|
|
193
|
-
acc[col.
|
|
194
|
+
acc[col.columnId] = col;
|
|
194
195
|
return acc;
|
|
195
196
|
}, {});
|
|
196
197
|
let shouldCreateDefaultLayout = this.getLayoutOptions().createDefaultLayout;
|
|
@@ -201,7 +202,7 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
201
202
|
if (!layoutState.Layouts || !isLayoutDefined(GeneralConstants_1.DEFAULT_LAYOUT)) {
|
|
202
203
|
let defaultLayout = ObjectFactory_1.default.CreateEmptyLayout({
|
|
203
204
|
Name: GeneralConstants_1.DEFAULT_LAYOUT,
|
|
204
|
-
Columns: defaultLayoutColumns.map((c) => c.
|
|
205
|
+
Columns: defaultLayoutColumns.map((c) => c.columnId),
|
|
205
206
|
}, gridState.Columns);
|
|
206
207
|
this.saveLayout(defaultLayout);
|
|
207
208
|
return defaultLayout;
|