@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
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -416,7 +416,7 @@ class Adaptable {
|
|
|
416
416
|
this.isInitialised = true;
|
|
417
417
|
});
|
|
418
418
|
if (this.abContainerElement == null) {
|
|
419
|
-
this.abContainerElement = this.
|
|
419
|
+
this.abContainerElement = this.getAdaptableContainerElement();
|
|
420
420
|
}
|
|
421
421
|
if (this.abContainerElement != null) {
|
|
422
422
|
this.abContainerElement.innerHTML = '';
|
|
@@ -484,17 +484,20 @@ class Adaptable {
|
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
performAudit(action, oldState, newState) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
487
|
+
if (this.isInitialised) {
|
|
488
|
+
const adaptableStateChangedInfo = {
|
|
489
|
+
adaptableApi: this.api,
|
|
490
|
+
actionName: action.type,
|
|
491
|
+
clientTimestamp: new Date(),
|
|
492
|
+
userName: this.adaptableOptions.userName,
|
|
493
|
+
adaptableId: this.adaptableOptions.adaptableId,
|
|
494
|
+
adaptableStateKey: this.adaptableOptions.adaptableStateKey,
|
|
495
|
+
action: action,
|
|
496
|
+
oldState: oldState,
|
|
497
|
+
newState: newState,
|
|
498
|
+
};
|
|
499
|
+
this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
|
|
500
|
+
}
|
|
498
501
|
}
|
|
499
502
|
initializeAgGrid() {
|
|
500
503
|
var _a;
|
|
@@ -734,19 +737,19 @@ class Adaptable {
|
|
|
734
737
|
const columnsInGroup = columnGroup.getLeafColumns();
|
|
735
738
|
columnsInGroup.forEach((col) => {
|
|
736
739
|
const group = {
|
|
737
|
-
|
|
738
|
-
FriendlyName,
|
|
739
|
-
|
|
740
|
-
|
|
740
|
+
columnGroupId: ColumnGroupId,
|
|
741
|
+
friendlyName: FriendlyName,
|
|
742
|
+
allowGroupSplit: AllowGroupSplit,
|
|
743
|
+
groupCount: 0,
|
|
741
744
|
};
|
|
742
|
-
groupsCount[group.
|
|
743
|
-
groupsCount[group.
|
|
745
|
+
groupsCount[group.columnGroupId] = groupsCount[group.columnGroupId] || 0;
|
|
746
|
+
groupsCount[group.columnGroupId] += columnsInGroup.length;
|
|
744
747
|
acc[col.getColId()] = group;
|
|
745
748
|
});
|
|
746
749
|
return acc;
|
|
747
750
|
}, {});
|
|
748
751
|
Object.keys(colsToGroups).forEach((colId) => {
|
|
749
|
-
colsToGroups[colId].
|
|
752
|
+
colsToGroups[colId].groupCount = groupsCount[colsToGroups[colId].columnGroupId];
|
|
750
753
|
});
|
|
751
754
|
// TODO sort the visible columns by layout order
|
|
752
755
|
vendorCols.forEach((vendorColumn) => {
|
|
@@ -838,7 +841,8 @@ class Adaptable {
|
|
|
838
841
|
var _a;
|
|
839
842
|
return ((_a = aa.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
|
|
840
843
|
aa.dataChangedInfo &&
|
|
841
|
-
aa.dataChangedInfo.
|
|
844
|
+
aa.dataChangedInfo.column &&
|
|
845
|
+
aa.dataChangedInfo.column.columnId === col.columnId &&
|
|
842
846
|
aa.dataChangedInfo.rowNode === params.node;
|
|
843
847
|
});
|
|
844
848
|
const alert = activeAlerts[0];
|
|
@@ -866,7 +870,7 @@ class Adaptable {
|
|
|
866
870
|
}
|
|
867
871
|
getFlashingAlertCellStyle(col, params) {
|
|
868
872
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
869
|
-
return this.getFlashingAlertStyleFor(primaryKeyValue, col.
|
|
873
|
+
return this.getFlashingAlertStyleFor(primaryKeyValue, col.columnId);
|
|
870
874
|
}
|
|
871
875
|
getCellHighlightStyle(col, params) {
|
|
872
876
|
var _a;
|
|
@@ -874,7 +878,7 @@ class Adaptable {
|
|
|
874
878
|
const cellHightlight = this.api.internalApi
|
|
875
879
|
.getSystemState()
|
|
876
880
|
.HighlightedCells.find((cellHighlightInfo) => {
|
|
877
|
-
return (col.
|
|
881
|
+
return (col.columnId === cellHighlightInfo.columnId &&
|
|
878
882
|
cellHighlightInfo.primaryKeyValue === primaryKeyValue);
|
|
879
883
|
});
|
|
880
884
|
if (cellHightlight) {
|
|
@@ -903,7 +907,7 @@ class Adaptable {
|
|
|
903
907
|
if (!editableCellStyle) {
|
|
904
908
|
return undefined;
|
|
905
909
|
}
|
|
906
|
-
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.
|
|
910
|
+
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.columnId);
|
|
907
911
|
if (gridCell) {
|
|
908
912
|
if (this.api.gridApi.areCellsEditable([gridCell])) {
|
|
909
913
|
return this.convertAdaptableStyleToCSS(editableCellStyle);
|
|
@@ -916,7 +920,7 @@ class Adaptable {
|
|
|
916
920
|
if (!editableCellStyle) {
|
|
917
921
|
return undefined;
|
|
918
922
|
}
|
|
919
|
-
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.
|
|
923
|
+
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.columnId);
|
|
920
924
|
if (gridCell) {
|
|
921
925
|
if (!this.api.gridApi.areCellsEditable([gridCell])) {
|
|
922
926
|
return this.convertAdaptableStyleToCSS(editableCellStyle);
|
|
@@ -950,8 +954,28 @@ class Adaptable {
|
|
|
950
954
|
.join(' ');
|
|
951
955
|
return classNames;
|
|
952
956
|
}
|
|
957
|
+
getEditableCellClass(abColumn, params) {
|
|
958
|
+
const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
|
|
959
|
+
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
960
|
+
return null;
|
|
961
|
+
}
|
|
962
|
+
const isCellEditable = this.api.gridApi.areCellsEditable([
|
|
963
|
+
this.getGridCellFromRowNode(params.node, abColumn.columnId),
|
|
964
|
+
]);
|
|
965
|
+
return isCellEditable ? editableCellStyle.ClassName : null;
|
|
966
|
+
}
|
|
967
|
+
getReadonlyCellClass(abColumn, params) {
|
|
968
|
+
const readonlyCellStyle = this.api.userInterfaceApi.getReadOnlyCellStyle();
|
|
969
|
+
if (!(readonlyCellStyle === null || readonlyCellStyle === void 0 ? void 0 : readonlyCellStyle.ClassName)) {
|
|
970
|
+
return null;
|
|
971
|
+
}
|
|
972
|
+
const isCellReadonly = !this.api.gridApi.areCellsEditable([
|
|
973
|
+
this.getGridCellFromRowNode(params.node, abColumn.columnId),
|
|
974
|
+
]);
|
|
975
|
+
return isCellReadonly ? readonlyCellStyle.ClassName : null;
|
|
976
|
+
}
|
|
953
977
|
isQuickSearchActive(abColumn, params) {
|
|
954
|
-
if (abColumn.
|
|
978
|
+
if (abColumn.isExcludedFromQuickSearch) {
|
|
955
979
|
return false;
|
|
956
980
|
}
|
|
957
981
|
if (!params.node || params.node.group) {
|
|
@@ -961,7 +985,7 @@ class Adaptable {
|
|
|
961
985
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(quickSearchValue)) {
|
|
962
986
|
return false;
|
|
963
987
|
}
|
|
964
|
-
const columnFilter = ObjectFactory_1.default.CreateColumnFilter(abColumn.
|
|
988
|
+
const columnFilter = ObjectFactory_1.default.CreateColumnFilter(abColumn.columnId, 'Contains', [quickSearchValue]);
|
|
965
989
|
return this.api.filterApi.evaluateColumnFilter(columnFilter, params.node);
|
|
966
990
|
}
|
|
967
991
|
getPrimaryKeyValueFromRowNode(rowNode) {
|
|
@@ -1023,7 +1047,7 @@ class Adaptable {
|
|
|
1023
1047
|
}
|
|
1024
1048
|
setColumnOrder(VisibleColumnList) {
|
|
1025
1049
|
const newColumnState = this.getSortedColumnStateForVisibleColumns(VisibleColumnList);
|
|
1026
|
-
this.gridOptions.columnApi.
|
|
1050
|
+
this.gridOptions.columnApi.applyColumnState({ state: newColumnState, applyOrder: true });
|
|
1027
1051
|
this.updateColumnsIntoStore();
|
|
1028
1052
|
}
|
|
1029
1053
|
persistLayout(layout) {
|
|
@@ -1177,7 +1201,7 @@ class Adaptable {
|
|
|
1177
1201
|
if (shouldUpdatePivoted) {
|
|
1178
1202
|
this.gridOptions.columnApi.setPivotMode(pivoted);
|
|
1179
1203
|
}
|
|
1180
|
-
this.gridOptions.columnApi.
|
|
1204
|
+
this.gridOptions.columnApi.applyColumnState({ state: newColState, applyOrder: true });
|
|
1181
1205
|
this.api.gridApi.setColumnSorts(layout.ColumnSorts);
|
|
1182
1206
|
this.gridOptions.columnApi.setPivotColumns(layout.PivotColumns || []);
|
|
1183
1207
|
// aggrid 25.1.0 introduced a bug such that a layout that has a grouped column, if the column has enableRowGroup: true but not rowGroup: true
|
|
@@ -1325,7 +1349,7 @@ class Adaptable {
|
|
|
1325
1349
|
const colId = column.getColId();
|
|
1326
1350
|
const selectedColumn = this.api.columnApi.getColumnFromId(colId);
|
|
1327
1351
|
if (selectedColumn &&
|
|
1328
|
-
columns.find((c) => c.
|
|
1352
|
+
columns.find((c) => c.columnId == selectedColumn.columnId) == null) {
|
|
1329
1353
|
columns.push(selectedColumn);
|
|
1330
1354
|
}
|
|
1331
1355
|
for (let rowIndex = y1; rowIndex <= y2; rowIndex++) {
|
|
@@ -1365,7 +1389,9 @@ class Adaptable {
|
|
|
1365
1389
|
isMaster: !!(node.master != null && node.master == true),
|
|
1366
1390
|
isExpanded: !!(node.expanded != null && node.expanded == true),
|
|
1367
1391
|
isGroup: !!(node.group != null && node.group == true),
|
|
1368
|
-
|
|
1392
|
+
isSelected: true,
|
|
1393
|
+
isDisplayed: node.displayed == true,
|
|
1394
|
+
rowGroupLevel: node.level,
|
|
1369
1395
|
};
|
|
1370
1396
|
const gridRow = {
|
|
1371
1397
|
primaryKeyValue: this.getPrimaryKeyValueFromRowNode(node),
|
|
@@ -1384,20 +1410,20 @@ class Adaptable {
|
|
|
1384
1410
|
setValue(dataChangedInfo) {
|
|
1385
1411
|
// note: because we use rownode set data value this will cause Validation to fire
|
|
1386
1412
|
let newValue;
|
|
1387
|
-
let dataType =
|
|
1413
|
+
let dataType = dataChangedInfo.column.dataType;
|
|
1388
1414
|
newValue =
|
|
1389
1415
|
dataType == Enums_1.DataType.Number ? Number(dataChangedInfo.newValue) : dataChangedInfo.newValue;
|
|
1390
1416
|
if (dataType == undefined) {
|
|
1391
1417
|
return; // no point continuing as probably a wrong column
|
|
1392
1418
|
}
|
|
1393
1419
|
if (dataChangedInfo.rowNode) {
|
|
1394
|
-
dataChangedInfo.rowNode.setDataValue(dataChangedInfo.columnId, newValue);
|
|
1420
|
+
dataChangedInfo.rowNode.setDataValue(dataChangedInfo.column.columnId, newValue);
|
|
1395
1421
|
}
|
|
1396
1422
|
else {
|
|
1397
1423
|
if (this.useRowNodeLookUp) {
|
|
1398
1424
|
const rowNode = this.gridOptions.api.getRowNode(dataChangedInfo.primaryKeyValue);
|
|
1399
1425
|
if (rowNode != null) {
|
|
1400
|
-
rowNode.setDataValue(dataChangedInfo.columnId, newValue);
|
|
1426
|
+
rowNode.setDataValue(dataChangedInfo.column.columnId, newValue);
|
|
1401
1427
|
dataChangedInfo.rowNode = rowNode;
|
|
1402
1428
|
}
|
|
1403
1429
|
}
|
|
@@ -1407,7 +1433,7 @@ class Adaptable {
|
|
|
1407
1433
|
this.gridOptions.api.getModel().forEachNode((rowNode) => {
|
|
1408
1434
|
if (!isUpdated) {
|
|
1409
1435
|
if (dataChangedInfo.primaryKeyValue == this.getPrimaryKeyValueFromRowNode(rowNode)) {
|
|
1410
|
-
rowNode.setDataValue(dataChangedInfo.columnId, newValue);
|
|
1436
|
+
rowNode.setDataValue(dataChangedInfo.column.columnId, newValue);
|
|
1411
1437
|
dataChangedInfo.rowNode = rowNode;
|
|
1412
1438
|
isUpdated = true;
|
|
1413
1439
|
}
|
|
@@ -1419,18 +1445,19 @@ class Adaptable {
|
|
|
1419
1445
|
cancelEdit() {
|
|
1420
1446
|
this.gridOptions.api.stopEditing(true);
|
|
1421
1447
|
}
|
|
1422
|
-
getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode) {
|
|
1448
|
+
getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, permittedValues) {
|
|
1423
1449
|
let returnValues = [];
|
|
1424
1450
|
// this function does NOT look up for server values but actually it should...
|
|
1425
1451
|
// that is currently commented out in the column api function (previously in filter form)
|
|
1426
|
-
|
|
1452
|
+
permittedValues = permittedValues !== null && permittedValues !== void 0 ? permittedValues : this.api.userInterfaceApi.getPermittedValuesForColumn(column);
|
|
1427
1453
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNull(permittedValues)) {
|
|
1428
1454
|
returnValues = permittedValues.map((pv) => {
|
|
1429
1455
|
return {
|
|
1430
1456
|
rawValue: pv,
|
|
1431
1457
|
displayValue: pv,
|
|
1432
1458
|
normalisedValue: pv,
|
|
1433
|
-
columnId: column.
|
|
1459
|
+
columnId: column.columnId,
|
|
1460
|
+
column: column,
|
|
1434
1461
|
rowNode: undefined,
|
|
1435
1462
|
};
|
|
1436
1463
|
});
|
|
@@ -1438,7 +1465,7 @@ class Adaptable {
|
|
|
1438
1465
|
else {
|
|
1439
1466
|
if (visibleRowsOnly) {
|
|
1440
1467
|
this.gridOptions.api.forEachNodeAfterFilter((rowNode) => {
|
|
1441
|
-
const gridCell = this.addDistinctColumnValue(rowNode, column.
|
|
1468
|
+
const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
|
|
1442
1469
|
if (gridCell && gridCell.rawValue != undefined && gridCell.rowNode !== skipRowNode) {
|
|
1443
1470
|
returnValues.push(gridCell);
|
|
1444
1471
|
}
|
|
@@ -1446,7 +1473,7 @@ class Adaptable {
|
|
|
1446
1473
|
}
|
|
1447
1474
|
else {
|
|
1448
1475
|
this.gridOptions.api.forEachNode((rowNode) => {
|
|
1449
|
-
const gridCell = this.addDistinctColumnValue(rowNode, column.
|
|
1476
|
+
const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
|
|
1450
1477
|
if (gridCell && gridCell.rawValue != undefined && gridCell.rowNode !== skipRowNode) {
|
|
1451
1478
|
returnValues.push(gridCell);
|
|
1452
1479
|
}
|
|
@@ -1456,6 +1483,60 @@ class Adaptable {
|
|
|
1456
1483
|
const uniqueVals = uniqBy_1.default(returnValues, 'displayValue');
|
|
1457
1484
|
return uniqueVals.slice(0, this.adaptableOptions.filterOptions.maxFilterValuesToDisplay);
|
|
1458
1485
|
}
|
|
1486
|
+
async getDistinctFilterValuesForColumn(column, visibleRowsOnly, filter, skipRowNode) {
|
|
1487
|
+
var _a;
|
|
1488
|
+
const permittedValues = (_a = this.api.userInterfaceApi.getFilterPermittedValuesForColumn(column)) !== null && _a !== void 0 ? _a : {
|
|
1489
|
+
suppressClientSideFiltering: false,
|
|
1490
|
+
values: () => undefined,
|
|
1491
|
+
};
|
|
1492
|
+
let preparedPermittedValues = undefined;
|
|
1493
|
+
try {
|
|
1494
|
+
const filterPermittedValuesParams = {
|
|
1495
|
+
adaptableApi: this.api,
|
|
1496
|
+
column: column,
|
|
1497
|
+
filter: filter,
|
|
1498
|
+
};
|
|
1499
|
+
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(filterPermittedValuesParams));
|
|
1500
|
+
}
|
|
1501
|
+
catch (error) {
|
|
1502
|
+
LoggingHelper_1.ConsoleLogError(`Failed to load filter permitted values`, column, filter, error);
|
|
1503
|
+
}
|
|
1504
|
+
return {
|
|
1505
|
+
suppressClientSideFilter: permittedValues.suppressClientSideFiltering,
|
|
1506
|
+
gridCells: this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues),
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
async getDistinctCustomSortValuesForColumn(column, visibleRowsOnly, skipRowNode) {
|
|
1510
|
+
const permittedValues = await this.api.userInterfaceApi.getCustomSortPermittedValuesForColumn(column);
|
|
1511
|
+
let preparedPermittedValues = undefined;
|
|
1512
|
+
try {
|
|
1513
|
+
const permittedValuesParams = {
|
|
1514
|
+
adaptableApi: this.api,
|
|
1515
|
+
column: column,
|
|
1516
|
+
};
|
|
1517
|
+
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(permittedValuesParams));
|
|
1518
|
+
}
|
|
1519
|
+
catch (error) {
|
|
1520
|
+
LoggingHelper_1.ConsoleLogError(`Failed to load custom sort permitted values`, column, error);
|
|
1521
|
+
}
|
|
1522
|
+
return this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues);
|
|
1523
|
+
}
|
|
1524
|
+
async getDistinctBulkUpdateValuesForColumn(column, visibleRowsOnly, selectedGridCells, skipRowNode) {
|
|
1525
|
+
const permittedValues = await this.api.userInterfaceApi.getBulkUpdatePermittedValuesForColumn(column);
|
|
1526
|
+
let preparedPermittedValues = undefined;
|
|
1527
|
+
try {
|
|
1528
|
+
const bulkUpdatePermittedValuesParams = {
|
|
1529
|
+
adaptableApi: this.api,
|
|
1530
|
+
column: column,
|
|
1531
|
+
gridCells: selectedGridCells,
|
|
1532
|
+
};
|
|
1533
|
+
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(bulkUpdatePermittedValuesParams));
|
|
1534
|
+
}
|
|
1535
|
+
catch (error) {
|
|
1536
|
+
LoggingHelper_1.ConsoleLogError(`Failed to load bulk permitted values`, error, column, selectedGridCells);
|
|
1537
|
+
}
|
|
1538
|
+
return this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues);
|
|
1539
|
+
}
|
|
1459
1540
|
getColumnValueDisplayValuePairList(columnId, visibleRowsOnly, onlyIncludeIds) {
|
|
1460
1541
|
const returnArray = [];
|
|
1461
1542
|
let permittedMap = new Map();
|
|
@@ -1469,7 +1550,7 @@ class Adaptable {
|
|
|
1469
1550
|
rawValue: pv,
|
|
1470
1551
|
displayValue: pv,
|
|
1471
1552
|
normalisedValue: pv,
|
|
1472
|
-
|
|
1553
|
+
column: abColumn,
|
|
1473
1554
|
rowNode: undefined,
|
|
1474
1555
|
});
|
|
1475
1556
|
});
|
|
@@ -1518,7 +1599,7 @@ class Adaptable {
|
|
|
1518
1599
|
}
|
|
1519
1600
|
shouldUseRawValueForColumn(column) {
|
|
1520
1601
|
// we need to return false if the column has a cell rendeerer i think...
|
|
1521
|
-
const colDef = this.gridOptions.api.getColumnDef(column.
|
|
1602
|
+
const colDef = this.gridOptions.api.getColumnDef(column.columnId);
|
|
1522
1603
|
if (colDef && colDef.cellRenderer != null) {
|
|
1523
1604
|
return true;
|
|
1524
1605
|
}
|
|
@@ -1563,7 +1644,7 @@ class Adaptable {
|
|
|
1563
1644
|
rawValue: rawValue,
|
|
1564
1645
|
displayValue: displayValue,
|
|
1565
1646
|
normalisedValue: normalisedvalue,
|
|
1566
|
-
|
|
1647
|
+
column: abColumn,
|
|
1567
1648
|
primaryKeyValue: pkValue,
|
|
1568
1649
|
rowNode: rowNode,
|
|
1569
1650
|
};
|
|
@@ -1794,9 +1875,12 @@ class Adaptable {
|
|
|
1794
1875
|
];
|
|
1795
1876
|
}
|
|
1796
1877
|
getColDefsForFreeTextColumns() {
|
|
1797
|
-
|
|
1878
|
+
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions
|
|
1798
1879
|
.enableFilterOnSpecialColumns;
|
|
1880
|
+
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable)
|
|
1881
|
+
.FreeTextColumnSettings;
|
|
1799
1882
|
return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
|
|
1883
|
+
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
1800
1884
|
const dataTypeEditor = freeTextColumn.DataType === 'Number'
|
|
1801
1885
|
? AdaptableNumberEditor_1.AdaptableNumberEditor
|
|
1802
1886
|
: freeTextColumn.DataType === 'Date'
|
|
@@ -1808,10 +1892,16 @@ class Adaptable {
|
|
|
1808
1892
|
colId: freeTextColumn.ColumnId,
|
|
1809
1893
|
editable: true,
|
|
1810
1894
|
hide: true,
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1895
|
+
width: freeTextColumnSettings.Width,
|
|
1896
|
+
enableValue: freeTextColumnSettings.Aggregatable,
|
|
1897
|
+
filter: freeTextColumnSettings.Filterable,
|
|
1898
|
+
floatingFilter: freeTextColumnSettings.Filterable,
|
|
1899
|
+
resizable: freeTextColumnSettings.Resizable,
|
|
1900
|
+
enableRowGroup: freeTextColumnSettings.Groupable,
|
|
1901
|
+
sortable: freeTextColumnSettings.Sortable,
|
|
1902
|
+
enablePivot: freeTextColumnSettings.Pivotable,
|
|
1903
|
+
suppressMenu: freeTextColumnSettings.SuppressMenu,
|
|
1904
|
+
suppressMovable: freeTextColumnSettings.SuppressMovable,
|
|
1815
1905
|
cellEditor: dataTypeEditor !== null && dataTypeEditor !== void 0 ? dataTypeEditor : (freeTextColumn.TextEditor && freeTextColumn.TextEditor == 'Large'
|
|
1816
1906
|
? 'agLargeTextCellEditor'
|
|
1817
1907
|
: 'agTextCellEditor'),
|
|
@@ -1846,15 +1936,24 @@ class Adaptable {
|
|
|
1846
1936
|
}
|
|
1847
1937
|
}
|
|
1848
1938
|
getColDefsForActionColumns() {
|
|
1939
|
+
const defaultActionColumnSettings = {
|
|
1940
|
+
resizable: true,
|
|
1941
|
+
suppressMenu: false,
|
|
1942
|
+
suppressMovable: false,
|
|
1943
|
+
};
|
|
1849
1944
|
return this.api.userInterfaceApi.getAllActionColumn().map((actionColumn) => {
|
|
1945
|
+
const actionColumnSettings = Object.assign(Object.assign({}, defaultActionColumnSettings), actionColumn.actionColumnSettings);
|
|
1850
1946
|
const newColDef = {
|
|
1851
1947
|
headerName: actionColumn.friendlyName ? actionColumn.friendlyName : actionColumn.columnId,
|
|
1852
1948
|
colId: actionColumn.columnId,
|
|
1853
|
-
editable: false,
|
|
1854
1949
|
hide: false,
|
|
1950
|
+
editable: false,
|
|
1951
|
+
width: actionColumnSettings.width,
|
|
1952
|
+
resizable: actionColumnSettings.resizable,
|
|
1953
|
+
suppressMenu: actionColumnSettings.suppressMenu,
|
|
1954
|
+
suppressMovable: actionColumnSettings.suppressMovable,
|
|
1855
1955
|
filter: false,
|
|
1856
1956
|
sortable: false,
|
|
1857
|
-
resizable: true,
|
|
1858
1957
|
enableRowGroup: false,
|
|
1859
1958
|
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
1860
1959
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
@@ -1881,16 +1980,17 @@ class Adaptable {
|
|
|
1881
1980
|
this.setLayout();
|
|
1882
1981
|
}
|
|
1883
1982
|
getColDefsForCalculatedColumns() {
|
|
1983
|
+
const specialColumnsAreFilterable = this.adaptableOptions.filterOptions
|
|
1984
|
+
.enableFilterOnSpecialColumns
|
|
1985
|
+
? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
|
|
1986
|
+
: true;
|
|
1987
|
+
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable)
|
|
1988
|
+
.CalculatedColumnSettings;
|
|
1884
1989
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
1885
1990
|
var _a;
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
: true;
|
|
1890
|
-
calculatedColumn.CalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(filterable).CalculatedColumnSettings;
|
|
1891
|
-
}
|
|
1892
|
-
if (!calculatedColumn.CalculatedColumnSettings.DataType) {
|
|
1893
|
-
calculatedColumn.CalculatedColumnSettings.DataType = this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
1991
|
+
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
1992
|
+
if (!calculatedColumnSettings.DataType) {
|
|
1993
|
+
calculatedColumnSettings.DataType = this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
1894
1994
|
}
|
|
1895
1995
|
const newColDef = {
|
|
1896
1996
|
headerName: calculatedColumn.FriendlyName
|
|
@@ -1899,25 +1999,27 @@ class Adaptable {
|
|
|
1899
1999
|
colId: calculatedColumn.ColumnId,
|
|
1900
2000
|
hide: true,
|
|
1901
2001
|
editable: false,
|
|
1902
|
-
width:
|
|
1903
|
-
enableValue:
|
|
1904
|
-
filter:
|
|
1905
|
-
floatingFilter:
|
|
1906
|
-
resizable:
|
|
1907
|
-
enableRowGroup:
|
|
1908
|
-
sortable:
|
|
1909
|
-
enablePivot:
|
|
2002
|
+
width: calculatedColumnSettings.Width,
|
|
2003
|
+
enableValue: calculatedColumnSettings.Aggregatable,
|
|
2004
|
+
filter: calculatedColumnSettings.Filterable,
|
|
2005
|
+
floatingFilter: calculatedColumnSettings.Filterable,
|
|
2006
|
+
resizable: calculatedColumnSettings.Resizable,
|
|
2007
|
+
enableRowGroup: calculatedColumnSettings.Groupable,
|
|
2008
|
+
sortable: calculatedColumnSettings.Sortable,
|
|
2009
|
+
enablePivot: calculatedColumnSettings.Pivotable,
|
|
2010
|
+
suppressMenu: calculatedColumnSettings.SuppressMenu,
|
|
2011
|
+
suppressMovable: calculatedColumnSettings.SuppressMovable,
|
|
1910
2012
|
type: [
|
|
1911
2013
|
GeneralConstants_1.AB_SPECIAL_COLUMN,
|
|
1912
|
-
this.agGridHelper.getAgGridDataType(
|
|
2014
|
+
this.agGridHelper.getAgGridDataType(calculatedColumnSettings.DataType),
|
|
1913
2015
|
],
|
|
1914
2016
|
valueGetter: (params) => {
|
|
1915
2017
|
var _a;
|
|
1916
2018
|
return this.CalculatedColumnExpressionService.ComputeExpressionValue((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression, params.node);
|
|
1917
2019
|
},
|
|
1918
2020
|
};
|
|
1919
|
-
if (
|
|
1920
|
-
|
|
2021
|
+
if (calculatedColumnSettings.ShowToolTip != null &&
|
|
2022
|
+
calculatedColumnSettings.ShowToolTip == true) {
|
|
1921
2023
|
newColDef.tooltipValueGetter = () => {
|
|
1922
2024
|
var _a;
|
|
1923
2025
|
return (_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression;
|
|
@@ -1986,7 +2088,7 @@ class Adaptable {
|
|
|
1986
2088
|
this.emitter = null;
|
|
1987
2089
|
this._adaptableReady = false;
|
|
1988
2090
|
Adaptable.dismissInstance(this);
|
|
1989
|
-
const abContainerElement = this.
|
|
2091
|
+
const abContainerElement = this.getAdaptableContainerElement();
|
|
1990
2092
|
if (config && !config.unmount) {
|
|
1991
2093
|
return;
|
|
1992
2094
|
}
|
|
@@ -2018,7 +2120,7 @@ class Adaptable {
|
|
|
2018
2120
|
height: 65,
|
|
2019
2121
|
Columns: this.api.columnApi.getColumns().map((col) => {
|
|
2020
2122
|
return {
|
|
2021
|
-
columnFriendlyName: col.
|
|
2123
|
+
columnFriendlyName: col.friendlyName,
|
|
2022
2124
|
width: 200,
|
|
2023
2125
|
textAlign: 'start',
|
|
2024
2126
|
};
|
|
@@ -2035,7 +2137,7 @@ class Adaptable {
|
|
|
2035
2137
|
height: 30,
|
|
2036
2138
|
Columns: this.api.columnApi.getColumns().map((col) => {
|
|
2037
2139
|
return {
|
|
2038
|
-
columnFriendlyName: col.
|
|
2140
|
+
columnFriendlyName: col.friendlyName,
|
|
2039
2141
|
width: 200,
|
|
2040
2142
|
textAlign: 'start',
|
|
2041
2143
|
};
|
|
@@ -2048,7 +2150,7 @@ class Adaptable {
|
|
|
2048
2150
|
getCurrentIPPStyle() {
|
|
2049
2151
|
return this.agGridHelper.getCurrentIPPStyle();
|
|
2050
2152
|
}
|
|
2051
|
-
|
|
2153
|
+
getAdaptableContainerElement() {
|
|
2052
2154
|
if (!this.abContainerElement) {
|
|
2053
2155
|
let containerOptionsContainer = this.adaptableOptions.containerOptions.adaptableContainer;
|
|
2054
2156
|
this.abContainerElement =
|
|
@@ -2084,7 +2186,7 @@ class Adaptable {
|
|
|
2084
2186
|
initInternalGridLogic() {
|
|
2085
2187
|
LoggingHelper_1.LogAdaptableInfo(`Initializing InternalGridLogic...`);
|
|
2086
2188
|
if (this.abContainerElement == null) {
|
|
2087
|
-
this.abContainerElement = this.
|
|
2189
|
+
this.abContainerElement = this.getAdaptableContainerElement();
|
|
2088
2190
|
}
|
|
2089
2191
|
if (this.abContainerElement == null) {
|
|
2090
2192
|
if (typeof this.adaptableOptions.containerOptions.adaptableContainer === 'string') {
|
|
@@ -2315,11 +2417,21 @@ class Adaptable {
|
|
|
2315
2417
|
RowNodeProto.dispatchLocalEvent = function (event) {
|
|
2316
2418
|
const node = event.node;
|
|
2317
2419
|
const result = RowNode_dispatchLocalEvent.apply(this, arguments);
|
|
2420
|
+
const extractGridApiFromRowNode = (rowNode) => {
|
|
2421
|
+
var _a, _b, _c, _d;
|
|
2422
|
+
// starting with AG Grid 26.1.0 the gridApi is wrapped in a Beans property
|
|
2423
|
+
// while older versions than 26.1.0 had a direct property
|
|
2424
|
+
const rowNodeApi = (_c = (_b = (_a = rowNode) === null || _a === void 0 ? void 0 : _a.beans) === null || _b === void 0 ? void 0 : _b.gridApi) !== null && _c !== void 0 ? _c : (_d = rowNode) === null || _d === void 0 ? void 0 : _d.gridApi;
|
|
2425
|
+
if (!rowNodeApi) {
|
|
2426
|
+
LoggingHelper_1.LogAdaptableWarning(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
|
|
2427
|
+
}
|
|
2428
|
+
return rowNodeApi;
|
|
2429
|
+
};
|
|
2318
2430
|
// we don't know from which instance of aggrid this is coming,
|
|
2319
2431
|
// as this fn is shared by all instances
|
|
2320
2432
|
if (node) {
|
|
2321
2433
|
Adaptable.forEachAdaptable((adaptable) => {
|
|
2322
|
-
if (node
|
|
2434
|
+
if (extractGridApiFromRowNode(node) !== adaptable.gridOptions.api) {
|
|
2323
2435
|
// the event is coming from another aggrid instance
|
|
2324
2436
|
// so IGNORE IT
|
|
2325
2437
|
return;
|
|
@@ -2561,6 +2673,8 @@ class Adaptable {
|
|
|
2561
2673
|
const cellClass = (params) => {
|
|
2562
2674
|
const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
|
|
2563
2675
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
2676
|
+
const editableClassName = this.getEditableCellClass(abColumn, params);
|
|
2677
|
+
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
2564
2678
|
let returnValue = [
|
|
2565
2679
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
2566
2680
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
@@ -2569,6 +2683,8 @@ class Adaptable {
|
|
|
2569
2683
|
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
2570
2684
|
: null,
|
|
2571
2685
|
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
2686
|
+
editableClassName,
|
|
2687
|
+
readonlyClassName,
|
|
2572
2688
|
]
|
|
2573
2689
|
.filter((x) => !!x)
|
|
2574
2690
|
.join(' ');
|
|
@@ -2581,7 +2697,8 @@ class Adaptable {
|
|
|
2581
2697
|
return `--excel-cell-${colId}-${primaryKeyValue}`;
|
|
2582
2698
|
}
|
|
2583
2699
|
setupColumnCellEditor({ colId, col }) {
|
|
2584
|
-
const
|
|
2700
|
+
const adaptableColumn = this.api.columnApi.getColumnFromId(colId);
|
|
2701
|
+
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
2585
2702
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
2586
2703
|
if (editLookUpItem) {
|
|
2587
2704
|
return this.isModulePresent('rich-select')
|
|
@@ -2589,10 +2706,13 @@ class Adaptable {
|
|
|
2589
2706
|
: 'agSelectCellEditor';
|
|
2590
2707
|
}
|
|
2591
2708
|
});
|
|
2592
|
-
this.setColDefProperty(col, 'cellEditorParams', () => {
|
|
2709
|
+
this.setColDefProperty(col, 'cellEditorParams', (params) => {
|
|
2593
2710
|
if (editLookUpItem) {
|
|
2594
|
-
return {
|
|
2595
|
-
|
|
2711
|
+
return (params) => {
|
|
2712
|
+
const gridCell = this.getGridCellFromRowNode(params === null || params === void 0 ? void 0 : params.node, colId);
|
|
2713
|
+
return {
|
|
2714
|
+
values: this.api.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem, gridCell),
|
|
2715
|
+
};
|
|
2596
2716
|
};
|
|
2597
2717
|
}
|
|
2598
2718
|
});
|
|
@@ -2605,7 +2725,7 @@ class Adaptable {
|
|
|
2605
2725
|
return this.agGridHelper.createNumericStyleRendererFunc(formatColumn);
|
|
2606
2726
|
}
|
|
2607
2727
|
if (formatColumn.ColumnStyle.CheckBoxStyle) {
|
|
2608
|
-
return this.agGridHelper.createCheckboxRendererComp(abColumn.
|
|
2728
|
+
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
2609
2729
|
}
|
|
2610
2730
|
}
|
|
2611
2731
|
const sparkline = this.api.sparklineColumnApi.getSparklineByColumn(colId);
|
|
@@ -2674,13 +2794,13 @@ class Adaptable {
|
|
|
2674
2794
|
resultHeaderName = layoutCustomHeader;
|
|
2675
2795
|
}
|
|
2676
2796
|
// check if the deprecated formatColumn header is used
|
|
2677
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.
|
|
2797
|
+
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.columnId);
|
|
2678
2798
|
if (!layoutCustomHeader && (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.HeaderName) && !formatColumn.IsSuspended) {
|
|
2679
2799
|
// fallback to the formatColumn property if no Layout custom header is provided
|
|
2680
2800
|
resultHeaderName = formatColumn.HeaderName;
|
|
2681
2801
|
}
|
|
2682
2802
|
// required here for the initial layout rendering
|
|
2683
|
-
abColumn.
|
|
2803
|
+
abColumn.friendlyName = resultHeaderName;
|
|
2684
2804
|
return resultHeaderName;
|
|
2685
2805
|
});
|
|
2686
2806
|
const newColumnHeader = (_b = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _b === void 0 ? void 0 : _b.headerName;
|
|
@@ -2799,7 +2919,7 @@ class Adaptable {
|
|
|
2799
2919
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
2800
2920
|
oldValue: params.oldValue,
|
|
2801
2921
|
newValue: params.newValue,
|
|
2802
|
-
|
|
2922
|
+
column: this.api.columnApi.getColumnFromId(params.column.getColId()),
|
|
2803
2923
|
primaryKeyValue: this.getPrimaryKeyValueFromRowNode(params.node),
|
|
2804
2924
|
rowNode: params.node,
|
|
2805
2925
|
trigger: 'edit',
|
|
@@ -2894,7 +3014,7 @@ class Adaptable {
|
|
|
2894
3014
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
2895
3015
|
oldValue: oldValue,
|
|
2896
3016
|
newValue: newValue,
|
|
2897
|
-
|
|
3017
|
+
column: this.api.columnApi.getColumnFromId(key),
|
|
2898
3018
|
primaryKeyValue: primaryKeyValue,
|
|
2899
3019
|
rowNode: rowNode,
|
|
2900
3020
|
trigger: 'tick',
|
|
@@ -2916,13 +3036,14 @@ class Adaptable {
|
|
|
2916
3036
|
if (!primaryKeyValue) {
|
|
2917
3037
|
return;
|
|
2918
3038
|
}
|
|
2919
|
-
|
|
3039
|
+
const abColumn = this.api.columnApi.getColumnFromId(colId);
|
|
3040
|
+
if (!abColumn) {
|
|
2920
3041
|
return;
|
|
2921
3042
|
}
|
|
2922
3043
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
2923
3044
|
oldValue: oldValue,
|
|
2924
3045
|
newValue: newValue,
|
|
2925
|
-
|
|
3046
|
+
column: abColumn,
|
|
2926
3047
|
primaryKeyValue: primaryKeyValue,
|
|
2927
3048
|
rowNode: rowNode,
|
|
2928
3049
|
trigger: 'edit',
|
|
@@ -2947,7 +3068,7 @@ class Adaptable {
|
|
|
2947
3068
|
}
|
|
2948
3069
|
dataChangedInfos.forEach((dataChangedInfo) => {
|
|
2949
3070
|
if (dataChangedInfo.trigger === 'undo') {
|
|
2950
|
-
LoggingHelper_1.LogAdaptableInfo(`Undo data change: PK(${dataChangedInfo.primaryKeyValue}) Col(${dataChangedInfo.
|
|
3071
|
+
LoggingHelper_1.LogAdaptableInfo(`Undo data change: PK(${dataChangedInfo.primaryKeyValue}) Col(${dataChangedInfo.column}) RevertedValue(${dataChangedInfo.oldValue}) OriginalValue(${dataChangedInfo.newValue})`);
|
|
2951
3072
|
}
|
|
2952
3073
|
if (dataChangedInfo.trigger === 'edit' || dataChangedInfo.trigger === 'undo') {
|
|
2953
3074
|
this.checkChangedCellCurrentlySelected(dataChangedInfo);
|
|
@@ -2986,7 +3107,7 @@ class Adaptable {
|
|
|
2986
3107
|
stylesWithExpression.forEach((conditionalStyle) => {
|
|
2987
3108
|
if (!dataChangedScope.wholeRow) {
|
|
2988
3109
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(conditionalStyle.Rule.BooleanExpression);
|
|
2989
|
-
if (columnIds.includes(dataChangedInfo.columnId)) {
|
|
3110
|
+
if (columnIds.includes(dataChangedInfo.column.columnId)) {
|
|
2990
3111
|
if (this.api.scopeApi.scopeIsAll(conditionalStyle.Scope)) {
|
|
2991
3112
|
dataChangedScope.wholeRow = true;
|
|
2992
3113
|
return;
|
|
@@ -2994,7 +3115,7 @@ class Adaptable {
|
|
|
2994
3115
|
else {
|
|
2995
3116
|
this.api.scopeApi
|
|
2996
3117
|
.getColumnsForScope(conditionalStyle.Scope)
|
|
2997
|
-
.map((c) => c.
|
|
3118
|
+
.map((c) => c.columnId)
|
|
2998
3119
|
.forEach((colId) => {
|
|
2999
3120
|
dataChangedScope.columnIds.add(colId);
|
|
3000
3121
|
});
|
|
@@ -3012,10 +3133,10 @@ class Adaptable {
|
|
|
3012
3133
|
let affectedColumnIds = this.api.formatColumnApi.getColumnIdsFromColumnComparison(columnComparision);
|
|
3013
3134
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3014
3135
|
dataChangedInfos.forEach((dataChangedInfo) => {
|
|
3015
|
-
if (affectedColumnIds.includes(dataChangedInfo.columnId)) {
|
|
3136
|
+
if (affectedColumnIds.includes(dataChangedInfo.column.columnId)) {
|
|
3016
3137
|
this.api.scopeApi
|
|
3017
3138
|
.getColumnsForScope(fc.Scope)
|
|
3018
|
-
.map((c) => c.
|
|
3139
|
+
.map((c) => c.columnId)
|
|
3019
3140
|
.forEach((colId) => {
|
|
3020
3141
|
dataChangedScope.columnIds.add(colId);
|
|
3021
3142
|
});
|
|
@@ -3029,7 +3150,7 @@ class Adaptable {
|
|
|
3029
3150
|
let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
|
|
3030
3151
|
if (selectedCellInfo && ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(selectedCellInfo.gridCells)) {
|
|
3031
3152
|
let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == dataChangedInfo.primaryKeyValue &&
|
|
3032
|
-
gc.
|
|
3153
|
+
gc.column == dataChangedInfo.column);
|
|
3033
3154
|
if (matchingCell) {
|
|
3034
3155
|
this.setSelectedCells();
|
|
3035
3156
|
}
|
|
@@ -3113,7 +3234,7 @@ class Adaptable {
|
|
|
3113
3234
|
getVendorGridColumnFieldForColumn(abColumn) {
|
|
3114
3235
|
const agGridColumn = this.gridOptions.columnApi
|
|
3115
3236
|
.getAllColumns()
|
|
3116
|
-
.find((c) => c.getColId() === abColumn.
|
|
3237
|
+
.find((c) => c.getColId() === abColumn.columnId);
|
|
3117
3238
|
return agGridColumn.getColDef().field || '';
|
|
3118
3239
|
}
|
|
3119
3240
|
setRowGroupColumns(columnIds) {
|
|
@@ -3225,7 +3346,7 @@ class Adaptable {
|
|
|
3225
3346
|
}
|
|
3226
3347
|
return state;
|
|
3227
3348
|
});
|
|
3228
|
-
this.gridOptions.columnApi.
|
|
3349
|
+
this.gridOptions.columnApi.applyColumnState({ state: newColumnState, applyOrder: true });
|
|
3229
3350
|
this.gridOptions.api.onSortChanged();
|
|
3230
3351
|
}
|
|
3231
3352
|
clearColumnSort() {
|
|
@@ -3240,6 +3361,26 @@ class Adaptable {
|
|
|
3240
3361
|
}
|
|
3241
3362
|
this.gridOptions.api.setRowData(dataSource);
|
|
3242
3363
|
}
|
|
3364
|
+
getGridData() {
|
|
3365
|
+
var _a;
|
|
3366
|
+
const data = [];
|
|
3367
|
+
(_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.api.forEachNode((rowNode) => {
|
|
3368
|
+
if (!this.isGroupRowNode(rowNode)) {
|
|
3369
|
+
data.push(rowNode.data);
|
|
3370
|
+
}
|
|
3371
|
+
});
|
|
3372
|
+
return data;
|
|
3373
|
+
}
|
|
3374
|
+
getFilteredData() {
|
|
3375
|
+
var _a;
|
|
3376
|
+
const data = [];
|
|
3377
|
+
(_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.api.forEachNodeAfterFilter((rowNode) => {
|
|
3378
|
+
if (!this.isGroupRowNode(rowNode)) {
|
|
3379
|
+
data.push(rowNode.data);
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3382
|
+
return data;
|
|
3383
|
+
}
|
|
3243
3384
|
loadDataSource(dataSource) {
|
|
3244
3385
|
if (this.hasAutogeneratedPrimaryKey()) {
|
|
3245
3386
|
this.addSyntheticPrimaryKey(dataSource);
|
|
@@ -3263,11 +3404,15 @@ class Adaptable {
|
|
|
3263
3404
|
this.addSyntheticPrimaryKey(dataRows);
|
|
3264
3405
|
}
|
|
3265
3406
|
dataUpdateConfig = dataUpdateConfig || {};
|
|
3407
|
+
const newData = { add: dataRows };
|
|
3408
|
+
if (dataUpdateConfig.addIndex !== undefined) {
|
|
3409
|
+
newData.addIndex = dataUpdateConfig.addIndex;
|
|
3410
|
+
}
|
|
3266
3411
|
if (dataUpdateConfig.runAsync) {
|
|
3267
|
-
this.gridOptions.api.applyTransactionAsync(
|
|
3412
|
+
this.gridOptions.api.applyTransactionAsync(newData, dataUpdateConfig.callback);
|
|
3268
3413
|
}
|
|
3269
3414
|
else {
|
|
3270
|
-
this.gridOptions.api.applyTransaction(
|
|
3415
|
+
this.gridOptions.api.applyTransaction(newData);
|
|
3271
3416
|
}
|
|
3272
3417
|
}
|
|
3273
3418
|
deleteRows(dataRows, dataUpdateConfig) {
|
|
@@ -3289,7 +3434,7 @@ class Adaptable {
|
|
|
3289
3434
|
checkColumnsDataTypeSet() {
|
|
3290
3435
|
// check that we have no unknown columns - if we do then ok
|
|
3291
3436
|
const firstCol = this.api.columnApi.getColumns()[0];
|
|
3292
|
-
if (firstCol && firstCol.
|
|
3437
|
+
if (firstCol && firstCol.dataType == Enums_1.DataType.Unknown) {
|
|
3293
3438
|
this.updateColumnsIntoStore();
|
|
3294
3439
|
}
|
|
3295
3440
|
}
|
|
@@ -3597,21 +3742,23 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
3597
3742
|
}
|
|
3598
3743
|
exportToExcel(reportData, fileName) {
|
|
3599
3744
|
const columnDefs = reportData.columns.map((column) => ({
|
|
3600
|
-
field: column.
|
|
3601
|
-
headerName: column.
|
|
3745
|
+
field: column.columnId,
|
|
3746
|
+
headerName: column.friendlyName,
|
|
3602
3747
|
}));
|
|
3603
3748
|
const NESTED_COL_SEPARATOR = '.';
|
|
3604
|
-
const nestedColumns = reportData.columns.filter((column) => column.
|
|
3749
|
+
const nestedColumns = reportData.columns.filter((column) => column.columnId.includes(NESTED_COL_SEPARATOR));
|
|
3605
3750
|
if (nestedColumns.length) {
|
|
3606
3751
|
// the rowData of nested fields (containing dots) was flattened during the report data extraction and we need to un-flatten it back
|
|
3607
3752
|
// ex.
|
|
3608
3753
|
// current state: { field: 'outerKey.innerKey', value: 2}
|
|
3609
3754
|
// original (desired) state: { field: 'outerKey.innerKey', value: {outerKey: {innerKey: 2}}}
|
|
3610
3755
|
reportData.rows.forEach((rowDataEntry) => nestedColumns.forEach((nestedColumn) => {
|
|
3611
|
-
const cellExportValue = rowDataEntry[nestedColumn.
|
|
3756
|
+
const cellExportValue = rowDataEntry[nestedColumn.columnId];
|
|
3612
3757
|
let intermediaryValue = rowDataEntry;
|
|
3613
3758
|
// augment the rowDataEntry with the new object
|
|
3614
|
-
nestedColumn.
|
|
3759
|
+
nestedColumn.columnId
|
|
3760
|
+
.split(NESTED_COL_SEPARATOR)
|
|
3761
|
+
.forEach((nestedKey, index, nestedCols) => {
|
|
3615
3762
|
// we reached the leaf node, so we set the cell value and break
|
|
3616
3763
|
if (index === nestedCols.length - 1) {
|
|
3617
3764
|
intermediaryValue[nestedKey] = cellExportValue;
|
|
@@ -3623,7 +3770,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
3623
3770
|
intermediaryValue = intermediaryValue[nestedKey];
|
|
3624
3771
|
});
|
|
3625
3772
|
// delete the obsolete flattened property
|
|
3626
|
-
delete rowDataEntry[nestedColumn.
|
|
3773
|
+
delete rowDataEntry[nestedColumn.columnId];
|
|
3627
3774
|
}));
|
|
3628
3775
|
}
|
|
3629
3776
|
const gridOptions = {
|