@adaptabletools/adaptable 10.0.0 → 10.0.4-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +77 -29
- package/index.css +89 -31
- package/package.json +1 -5
- 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/UserInterfaceOptions.d.ts +88 -4
- 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/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +16 -9
- 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/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +1 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +25 -10
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +20 -4
- package/src/Api/Implementation/LayoutApiImpl.js +3 -3
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +3 -0
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +59 -86
- package/src/Api/InternalApi.d.ts +3 -1
- package/src/Api/QueryLanguageApi.d.ts +5 -0
- package/src/Api/UserInterfaceApi.d.ts +16 -6
- package/src/PredefinedConfig/AlertState.d.ts +10 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- 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/{Utilities/Interface/ProgressIndicator.js → PredefinedConfig/Common/SpecialColumnSettings.js} +0 -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/AdaptableReduxMerger.js +7 -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 +8 -2
- package/src/Utilities/Helpers/DateHelper.js +42 -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/MetamodelService.js +1 -0
- package/src/Utilities/Services/ModuleService.js +31 -24
- package/src/Utilities/Services/ReportService.js +12 -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/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 +6 -6
- 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/DataChangeHistory/DataChangeHistoryGrid.js +3 -3
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -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 +3 -3
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.d.ts +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +6 -8
- 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 +20 -3
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +234 -102
- package/src/agGrid/agGridHelper.js +32 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +8 -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 -7
- package/src/metamodel/adaptable.metamodel.js +416 -101
- 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
|
@@ -22,7 +22,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
22
22
|
if (this.api.scopeApi.scopeHasColumns(plusMinusNudge.Scope)) {
|
|
23
23
|
return this.api.scopeApi
|
|
24
24
|
.getColumnsForScope(plusMinusNudge.Scope)
|
|
25
|
-
.map((adaptableColumn) => adaptableColumn.
|
|
25
|
+
.map((adaptableColumn) => adaptableColumn.columnId);
|
|
26
26
|
}
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
@@ -52,7 +52,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
52
52
|
this.shouldHandleKeyDown = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(plusMinusNudges);
|
|
53
53
|
}
|
|
54
54
|
addColumnMenuItems(column) {
|
|
55
|
-
if (column && this.isModuleEditable() && column.
|
|
55
|
+
if (column && this.isModuleEditable() && column.dataType == 'Number') {
|
|
56
56
|
let popupParam = {
|
|
57
57
|
column: column,
|
|
58
58
|
action: 'New',
|
|
@@ -86,15 +86,14 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
86
86
|
let failedPreventEdits = [];
|
|
87
87
|
let side = direction == 'up' ? 1 : -1;
|
|
88
88
|
cellsToUpdate.forEach((gridCell) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
!selectedColumn.ReadOnly) {
|
|
89
|
+
if (gridCell.column &&
|
|
90
|
+
gridCell.column.dataType == Enums_1.DataType.Number &&
|
|
91
|
+
!gridCell.column.readOnly) {
|
|
93
92
|
let foundRule;
|
|
94
93
|
let replacementGridCell;
|
|
95
94
|
plusMinusNudges.forEach((pmr) => {
|
|
96
95
|
if (!foundRule) {
|
|
97
|
-
if (this.api.scopeApi.isColumnInScope(
|
|
96
|
+
if (this.api.scopeApi.isColumnInScope(gridCell.column, pmr.Scope)) {
|
|
98
97
|
if (this.api.gridApi.areCellsEditable([gridCell])) {
|
|
99
98
|
//for aggrid as we are getting strings sometimes
|
|
100
99
|
if (typeof gridCell.rawValue != 'number') {
|
|
@@ -109,7 +108,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
109
108
|
// computedValue= parseFloat(computedValue.toFixed(12));
|
|
110
109
|
replacementGridCell = {
|
|
111
110
|
primaryKeyValue: gridCell.primaryKeyValue,
|
|
112
|
-
|
|
111
|
+
column: gridCell.column,
|
|
113
112
|
rawValue: computedValue,
|
|
114
113
|
displayValue: computedValue,
|
|
115
114
|
normalisedValue: computedValue,
|
|
@@ -124,7 +123,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
124
123
|
const dataChangedEvent = this.api.internalApi.buildDataChangedInfo({
|
|
125
124
|
oldValue: Number(gridCell.rawValue),
|
|
126
125
|
newValue: replacementGridCell.rawValue,
|
|
127
|
-
|
|
126
|
+
column: gridCell.column,
|
|
128
127
|
primaryKeyValue: gridCell.primaryKeyValue,
|
|
129
128
|
rowNode: gridCell.rowNode,
|
|
130
129
|
trigger: 'edit',
|
|
@@ -23,8 +23,8 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
23
23
|
let menuItemShowPopup = undefined;
|
|
24
24
|
if (!menuContext.isRowGroupColumn && this.isModuleEditable()) {
|
|
25
25
|
if (menuContext.adaptableColumn &&
|
|
26
|
-
menuContext.adaptableColumn.
|
|
27
|
-
!menuContext.adaptableColumn.
|
|
26
|
+
menuContext.adaptableColumn.dataType == Enums_1.DataType.Number &&
|
|
27
|
+
!menuContext.adaptableColumn.readOnly &&
|
|
28
28
|
menuContext.isSelectedCell &&
|
|
29
29
|
menuContext.isSingleSelectedColumn &&
|
|
30
30
|
this.api.gridApi.areCellsEditable(menuContext.selectedCellInfo.gridCells)) {
|
|
@@ -75,7 +75,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
75
75
|
}
|
|
76
76
|
let column = selectedCellInfo.columns[0];
|
|
77
77
|
if (column) {
|
|
78
|
-
if (column.
|
|
78
|
+
if (column.dataType != Enums_1.DataType.Number) {
|
|
79
79
|
return {
|
|
80
80
|
Alert: {
|
|
81
81
|
header: 'Smart Edit Error',
|
|
@@ -84,7 +84,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
84
84
|
},
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
if (column.
|
|
87
|
+
if (column.readOnly) {
|
|
88
88
|
return {
|
|
89
89
|
Alert: {
|
|
90
90
|
header: 'Smart Edit Error',
|
|
@@ -114,7 +114,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
114
114
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(selectedCellInfo.columns)) {
|
|
115
115
|
let column = selectedCellInfo.columns[0];
|
|
116
116
|
if (column) {
|
|
117
|
-
columnId = column.
|
|
117
|
+
columnId = column.columnId;
|
|
118
118
|
selectedCellInfo.gridCells.forEach((selectedCell) => {
|
|
119
119
|
let newValue;
|
|
120
120
|
switch (smartEditOperation) {
|
|
@@ -138,7 +138,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
138
138
|
let dataChangedEvent = this.api.internalApi.buildDataChangedInfo({
|
|
139
139
|
oldValue: Number(selectedCell.rawValue),
|
|
140
140
|
newValue: newValue,
|
|
141
|
-
|
|
141
|
+
column: selectedCell.column,
|
|
142
142
|
primaryKeyValue: selectedCell.primaryKeyValue,
|
|
143
143
|
rowNode: selectedCell.rowNode,
|
|
144
144
|
trigger: 'edit',
|
|
@@ -131,6 +131,7 @@ exports.DefaultAdaptableOptions = {
|
|
|
131
131
|
useAdaptableQuickFilter: true,
|
|
132
132
|
clearFiltersOnStartUp: false,
|
|
133
133
|
quickFilterTrigger: 'mouseenter',
|
|
134
|
+
quickFilterValuesTrigger: 'mouseenter',
|
|
134
135
|
filterActionOnUserDataChange: {
|
|
135
136
|
applyFilter: GeneralConstants.FILTER_ALWAYS,
|
|
136
137
|
throttleDelay: 0,
|
|
@@ -227,7 +227,7 @@ exports.booleanExpressionFunctions = {
|
|
|
227
227
|
const searchTerm = expressionFunctionUtils_1.getStringValue(context, String(args[0]));
|
|
228
228
|
return (_a = context.api) === null || _a === void 0 ? void 0 : _a.columnApi.getColumns().some((column) => {
|
|
229
229
|
var _a;
|
|
230
|
-
const value = (_a = context.api) === null || _a === void 0 ? void 0 : _a.gridApi.getNormalisedValueFromRowNode(context.node, column.
|
|
230
|
+
const value = (_a = context.api) === null || _a === void 0 ? void 0 : _a.gridApi.getNormalisedValueFromRowNode(context.node, column.columnId);
|
|
231
231
|
const columnValue = expressionFunctionUtils_1.getStringValue(context, String(value));
|
|
232
232
|
return columnValue.indexOf(searchTerm) !== -1;
|
|
233
233
|
});
|
|
@@ -23,7 +23,7 @@ exports.isTextSearchCaseInsensitive = (context) => !context.api.internalApi.isTe
|
|
|
23
23
|
exports.getDataChangeLog$ = (context, columnNameFilter) => {
|
|
24
24
|
let dataChangeLog$ = context.api.internalApi.getDataService().dataChangeLog$;
|
|
25
25
|
// filter only the given column changes
|
|
26
|
-
dataChangeLog$ = dataChangeLog$.pipe(operators_1.filter((dataChangeLog) => dataChangeLog.columnId === columnNameFilter));
|
|
26
|
+
dataChangeLog$ = dataChangeLog$.pipe(operators_1.filter((dataChangeLog) => dataChangeLog.column.columnId === columnNameFilter));
|
|
27
27
|
// filter based on the WHERE clause
|
|
28
28
|
if (context.filterFn) {
|
|
29
29
|
dataChangeLog$ = dataChangeLog$.pipe(operators_1.filter((value) => context.filterFn(value.rowNode)));
|
|
@@ -92,7 +92,7 @@ const validateColumnId = (columnId, api) => {
|
|
|
92
92
|
if (!column) {
|
|
93
93
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('', `Column name "${columnId}" is not found`);
|
|
94
94
|
}
|
|
95
|
-
if (!column.
|
|
95
|
+
if (!column.queryable) {
|
|
96
96
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('', `Column name "${columnId}" is not queryable`);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
@@ -244,14 +244,15 @@ const getDataChangedInfoStub = (context) => {
|
|
|
244
244
|
const rowNode = rowNodeStub;
|
|
245
245
|
if (rowNode) {
|
|
246
246
|
const primaryKeyValue = context.api.gridApi.getPrimaryKeyValueForRowNode(rowNode);
|
|
247
|
-
const columnId = (_a = context.api.columnApi.getQueryableColumns()[0]) === null || _a === void 0 ? void 0 : _a.
|
|
247
|
+
const columnId = (_a = context.api.columnApi.getQueryableColumns()[0]) === null || _a === void 0 ? void 0 : _a.columnId;
|
|
248
248
|
const oldValue = context.api.gridApi.getCellRawValue(primaryKeyValue, columnId);
|
|
249
|
+
const column = context.api.columnApi.getColumnFromId(columnId);
|
|
249
250
|
const newValue = oldValue;
|
|
250
251
|
return {
|
|
251
252
|
changedAt: Date.now(),
|
|
252
253
|
rowNode,
|
|
253
254
|
primaryKeyValue,
|
|
254
|
-
|
|
255
|
+
column: column,
|
|
255
256
|
oldValue,
|
|
256
257
|
newValue,
|
|
257
258
|
};
|
|
@@ -89,7 +89,7 @@ exports.scalarExpressionFunctions = {
|
|
|
89
89
|
if (!column) {
|
|
90
90
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('COL', `Column name "${columnId}" is not found`);
|
|
91
91
|
}
|
|
92
|
-
if (!column.
|
|
92
|
+
if (!column.queryable) {
|
|
93
93
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('COL', `Column name "${columnId}" is not queryable`);
|
|
94
94
|
}
|
|
95
95
|
return (_b = context.api) === null || _b === void 0 ? void 0 : _b.gridApi.getNormalisedValueFromRowNode(context.node, columnId);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export declare const isValidDate: (date: Date) => boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the data contains a value that represents a valid date.
|
|
4
|
+
*
|
|
5
|
+
* @param data any kind of data
|
|
6
|
+
*/
|
|
7
|
+
export declare const isValueValidDate: (data: any) => boolean;
|
|
2
8
|
export declare const dateToISO: (date: Date | number | string) => string;
|
|
3
|
-
export declare const parseToISO: (date: string | Date | number, dateFormat
|
|
4
|
-
export declare const
|
|
9
|
+
export declare const parseToISO: (date: string | Date | number, dateFormat?: string) => string;
|
|
10
|
+
export declare const parseDateValue: (dateValue: string | Date | number, dateFormat?: string) => Date | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseDateValue = exports.parseToISO = exports.dateToISO = exports.isValueValidDate = exports.isValidDate = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
|
|
6
6
|
const parse_1 = tslib_1.__importDefault(require("date-fns/parse"));
|
|
@@ -9,30 +9,52 @@ const FormatHelper_1 = require("./FormatHelper");
|
|
|
9
9
|
exports.isValidDate = (date) => {
|
|
10
10
|
return date instanceof Date && !isNaN(date.getTime());
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Checks if the data contains a value that represents a valid date.
|
|
14
|
+
*
|
|
15
|
+
* @param data any kind of data
|
|
16
|
+
*/
|
|
17
|
+
exports.isValueValidDate = (data) => {
|
|
18
|
+
if (!data || typeof data === 'boolean') {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const date = new Date(data);
|
|
22
|
+
return !isNaN(date.getTime());
|
|
23
|
+
};
|
|
12
24
|
exports.dateToISO = (date) => {
|
|
13
25
|
return FormatHelper_1.DateFormatter(date, { Pattern: 'yyyy-MM-dd' });
|
|
14
26
|
};
|
|
15
27
|
exports.parseToISO = (date, dateFormat) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
: typeof date === 'number'
|
|
19
|
-
? new Date(date)
|
|
20
|
-
: exports.parseDate(date, dateFormat);
|
|
21
|
-
let valid = dateInstance && exports.isValidDate(dateInstance);
|
|
22
|
-
if (!valid) {
|
|
23
|
-
dateInstance = new Date(date);
|
|
24
|
-
valid = exports.isValidDate(dateInstance);
|
|
25
|
-
}
|
|
26
|
-
return valid ? exports.dateToISO(dateInstance) : '';
|
|
28
|
+
const dateInstance = exports.parseDateValue(date, dateFormat);
|
|
29
|
+
return exports.isValidDate(dateInstance) ? exports.dateToISO(dateInstance) : '';
|
|
27
30
|
};
|
|
28
|
-
exports.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
exports.parseDateValue = (dateValue, dateFormat) => {
|
|
32
|
+
if (dateValue == undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
if (dateValue instanceof Date) {
|
|
36
|
+
return !isNaN(dateValue.getTime()) ? dateValue : undefined;
|
|
37
|
+
}
|
|
38
|
+
let dateInstance;
|
|
39
|
+
if (typeof dateValue === 'number') {
|
|
40
|
+
dateInstance = new Date(dateValue);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// typeof dateValue === 'string'
|
|
44
|
+
if (dateFormat) {
|
|
45
|
+
dateInstance = parse_1.default(dateValue, dateFormat, new Date());
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
dateInstance = parseISO_1.default(dateValue);
|
|
49
|
+
}
|
|
50
|
+
if (!exports.isValidDate(dateInstance)) {
|
|
51
|
+
// last chance: try to use the native Date.parse(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
|
|
52
|
+
dateInstance = new Date(Date.parse(dateValue));
|
|
53
|
+
}
|
|
32
54
|
}
|
|
33
|
-
if (!exports.isValidDate(
|
|
34
|
-
LoggingHelper_1.LogAdaptableError(`Invalid date value "${
|
|
35
|
-
|
|
55
|
+
if (!exports.isValidDate(dateInstance)) {
|
|
56
|
+
LoggingHelper_1.LogAdaptableError(`Invalid date value "${dateValue}" - cannot be converted to a Date instance. Please make sure you specify adaptableOptions.userInterfaceOptions.dateInputOptions.dateFormat correctly.`);
|
|
57
|
+
dateInstance = undefined;
|
|
36
58
|
}
|
|
37
|
-
return
|
|
59
|
+
return dateInstance;
|
|
38
60
|
};
|
|
@@ -39,11 +39,11 @@ function GetCellInfosFromPreview(previewInfo, bypassValidationWarnings) {
|
|
|
39
39
|
if (previewResult.validationRules.length == 0) {
|
|
40
40
|
newValues.push({
|
|
41
41
|
primaryKeyValue: previewResult.id,
|
|
42
|
-
columnId: previewInfo.columnId,
|
|
43
42
|
rawValue: previewResult.computedValue,
|
|
44
43
|
displayValue: previewResult.computedValue,
|
|
45
44
|
normalisedValue: previewResult.computedValue,
|
|
46
45
|
rowNode: previewResult.rowNode,
|
|
46
|
+
column: this.adaptable.api.columnApi.getColumnFromId(previewInfo.columnId),
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -54,7 +54,7 @@ function GetCellInfosFromPreview(previewInfo, bypassValidationWarnings) {
|
|
|
54
54
|
.forEach((pr) => {
|
|
55
55
|
newValues.push({
|
|
56
56
|
primaryKeyValue: pr.id,
|
|
57
|
-
|
|
57
|
+
column: this.adaptable.api.columnApi.getColumnFromId(previewInfo.columnId),
|
|
58
58
|
rawValue: pr.computedValue,
|
|
59
59
|
displayValue: pr.computedValue,
|
|
60
60
|
normalisedValue: pr.computedValue,
|
|
@@ -61,7 +61,7 @@ export declare function CreateEmptySchedule(): Schedule;
|
|
|
61
61
|
export declare function CreateEmptyShortcut(): Shortcut;
|
|
62
62
|
export declare function CreateEmptyConditionalStyle(): ConditionalStyle;
|
|
63
63
|
export declare function CreateEmptyFormatColumn(): FormatColumn;
|
|
64
|
-
export declare function CreateEmptyFreeTextColumn(): FreeTextColumn;
|
|
64
|
+
export declare function CreateEmptyFreeTextColumn(isFilterable: boolean): FreeTextColumn;
|
|
65
65
|
export declare function CreateEmptyLayout(layout?: Partial<Layout> & {
|
|
66
66
|
Name: string;
|
|
67
67
|
}, adaptableColumns?: AdaptableColumn[]): Layout;
|
|
@@ -74,6 +74,8 @@ function CreateEmptyCalculatedColumn(isFilterable) {
|
|
|
74
74
|
Sortable: true,
|
|
75
75
|
Pivotable: true,
|
|
76
76
|
Aggregatable: true,
|
|
77
|
+
SuppressMenu: false,
|
|
78
|
+
SuppressMovable: false,
|
|
77
79
|
},
|
|
78
80
|
};
|
|
79
81
|
}
|
|
@@ -334,13 +336,23 @@ function CreateEmptyFormatColumn() {
|
|
|
334
336
|
};
|
|
335
337
|
}
|
|
336
338
|
exports.CreateEmptyFormatColumn = CreateEmptyFormatColumn;
|
|
337
|
-
function CreateEmptyFreeTextColumn() {
|
|
339
|
+
function CreateEmptyFreeTextColumn(isFilterable) {
|
|
338
340
|
return {
|
|
339
341
|
Uuid: Uuid_1.createUuid(),
|
|
340
342
|
ColumnId: GeneralConstants_1.EMPTY_STRING,
|
|
341
343
|
DefaultValue: GeneralConstants_1.EMPTY_STRING,
|
|
342
344
|
FreeTextStoredValues: [],
|
|
343
345
|
TextEditor: 'Inline',
|
|
346
|
+
FreeTextColumnSettings: {
|
|
347
|
+
Filterable: isFilterable,
|
|
348
|
+
Resizable: true,
|
|
349
|
+
Groupable: true,
|
|
350
|
+
Sortable: true,
|
|
351
|
+
Pivotable: true,
|
|
352
|
+
Aggregatable: true,
|
|
353
|
+
SuppressMenu: false,
|
|
354
|
+
SuppressMovable: false,
|
|
355
|
+
},
|
|
344
356
|
};
|
|
345
357
|
}
|
|
346
358
|
exports.CreateEmptyFreeTextColumn = CreateEmptyFreeTextColumn;
|
|
@@ -348,7 +360,7 @@ function CreateEmptyLayout(layout, adaptableColumns) {
|
|
|
348
360
|
return Object.assign(Object.assign({}, layout), { Uuid: Uuid_1.createUuid(), Columns: layout.Columns || [], ColumnSorts: layout.ColumnSorts || [],
|
|
349
361
|
// ColumnFlexMap: layout.ColumnFlexMap || {},
|
|
350
362
|
ColumnWidthMap: layout.ColumnWidthMap || {}, RowGroupedColumns: layout.RowGroupedColumns ||
|
|
351
|
-
(adaptableColumns ? adaptableColumns.filter((c) => c.
|
|
363
|
+
(adaptableColumns ? adaptableColumns.filter((c) => c.isGrouped).map((c) => c.columnId) : []) });
|
|
352
364
|
}
|
|
353
365
|
exports.CreateEmptyLayout = CreateEmptyLayout;
|
|
354
366
|
function CreateEmptyStyle() {
|
|
@@ -30,8 +30,8 @@ class DataService {
|
|
|
30
30
|
// we need this temporary "shared memory" because the value change and the AG Grid cellChanged event are asynchronous
|
|
31
31
|
// in the first phase we keep the undone change
|
|
32
32
|
logUndoChange(change) {
|
|
33
|
-
const { primaryKeyValue,
|
|
34
|
-
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, columnId, oldValue, newValue);
|
|
33
|
+
const { primaryKeyValue, column, oldValue, newValue } = change;
|
|
34
|
+
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, column.columnId, oldValue, newValue);
|
|
35
35
|
this.undoChangeLog.set(undoChangeKey, change);
|
|
36
36
|
// normally the extractUndoChange() should be executed right after this method
|
|
37
37
|
// just to be sure that no 'zombie' undo change remains here (if something goes wrong with the undo value change)
|
|
@@ -39,16 +39,16 @@ class DataService {
|
|
|
39
39
|
// why 2 and not 3 or 1? no good reason, only seems like a reasonable waiting time :)
|
|
40
40
|
const UNDO_WAIT = 2000;
|
|
41
41
|
const timeoutId = setTimeout(() => {
|
|
42
|
-
LoggingHelper_1.LogAdaptableInfo(`Undo change was NOT handled, this should NOT happen: PK(${change.primaryKeyValue}) Col(${change.
|
|
42
|
+
LoggingHelper_1.LogAdaptableInfo(`Undo change was NOT handled, this should NOT happen: PK(${change.primaryKeyValue}) Col(${change.column}) RevertedValue(${change.newValue}) NewValue(${change.oldValue})`);
|
|
43
43
|
this.extractUndoChange(change);
|
|
44
44
|
}, UNDO_WAIT);
|
|
45
45
|
this.undoChangeTimers.set(undoChangeKey, timeoutId);
|
|
46
46
|
}
|
|
47
47
|
// in the second phase, when AG-Grid triggers the cellChange event, we check if it corresponds to an undone change
|
|
48
48
|
extractUndoChange(change) {
|
|
49
|
-
const { primaryKeyValue,
|
|
49
|
+
const { primaryKeyValue, column, oldValue, newValue } = change;
|
|
50
50
|
// this is post-undo, so we have to swap the new& old values
|
|
51
|
-
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, columnId, newValue, oldValue);
|
|
51
|
+
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, column.columnId, newValue, oldValue);
|
|
52
52
|
const result = this.undoChangeLog.get(undoChangeKey);
|
|
53
53
|
this.undoChangeLog.delete(undoChangeKey);
|
|
54
54
|
const timeoutId = this.undoChangeTimers.get(undoChangeKey);
|
|
@@ -16,6 +16,7 @@ class MetamodelService {
|
|
|
16
16
|
buildGridInfoOptions() {
|
|
17
17
|
const gridInfoOptions = new Map();
|
|
18
18
|
const adaptableMetamodel = adaptable_metamodel_1.ADAPTABLE_METAMODEL;
|
|
19
|
+
console.log({ adaptableMetamodel });
|
|
19
20
|
const adaptableOptionsMetamodel = adaptableMetamodel['AdaptableOptions'];
|
|
20
21
|
const adaptableOptionsValues = this.adaptable.adaptableOptions;
|
|
21
22
|
const adaptableOptionsDefaultValues = DefaultAdaptableOptions_1.DefaultAdaptableOptions;
|
|
@@ -76,62 +76,69 @@ class ModuleService {
|
|
|
76
76
|
}
|
|
77
77
|
getModuleDocumentationPageByModule(adaptableModule) {
|
|
78
78
|
let url = `${DocumentationLinkConstants_1.HOST_URL_DOCS}/`;
|
|
79
|
-
let
|
|
79
|
+
let notificationUrl = url + 'notifications/';
|
|
80
|
+
let editingUrl = url + 'editing/';
|
|
81
|
+
let searchingUrl = url + 'searching/';
|
|
82
|
+
let filteringUrl = url + 'filtering/';
|
|
83
|
+
let themingUrl = url + 'theming/';
|
|
84
|
+
let stylingUrl = url + 'styling/';
|
|
85
|
+
let advancedFeaturesUrl = url + 'advanced-features/';
|
|
86
|
+
let gridManagementUrl = url + 'grid-management/';
|
|
80
87
|
let userInterfaceUrl = url + 'user-interface/';
|
|
81
88
|
let pluginUrl = url + 'plugins/';
|
|
82
89
|
switch (adaptableModule) {
|
|
83
90
|
case 'Alert':
|
|
84
|
-
return
|
|
91
|
+
return notificationUrl + 'alerts-module';
|
|
85
92
|
case 'BulkUpdate':
|
|
86
|
-
return
|
|
93
|
+
return editingUrl + 'bulk-update-module';
|
|
87
94
|
case 'CalculatedColumn':
|
|
88
|
-
return
|
|
95
|
+
return advancedFeaturesUrl + 'calculated-column-module';
|
|
89
96
|
case 'CellSummary':
|
|
90
|
-
return
|
|
97
|
+
return advancedFeaturesUrl + 'cell-summary-module';
|
|
91
98
|
case 'ConditionalStyle':
|
|
92
|
-
return
|
|
99
|
+
return stylingUrl + 'conditional-style-module';
|
|
93
100
|
case 'CustomSort':
|
|
94
|
-
return
|
|
101
|
+
return advancedFeaturesUrl + 'custom-sort-module';
|
|
95
102
|
case 'Dashboard':
|
|
96
103
|
return userInterfaceUrl + 'dashboard';
|
|
97
104
|
case 'DataSource':
|
|
98
|
-
return
|
|
105
|
+
return searchingUrl + 'data-source-module';
|
|
99
106
|
case 'Export':
|
|
100
|
-
return
|
|
107
|
+
return gridManagementUrl + 'export-module';
|
|
101
108
|
case 'Filter':
|
|
102
|
-
return
|
|
109
|
+
return filteringUrl + 'filter-module';
|
|
103
110
|
case 'FormatColumn':
|
|
104
|
-
return
|
|
111
|
+
return stylingUrl + 'format-column-module';
|
|
105
112
|
case 'FreeTextColumn':
|
|
106
|
-
return
|
|
113
|
+
return advancedFeaturesUrl + 'freetext-column-module';
|
|
107
114
|
case 'GridInfo':
|
|
108
|
-
return
|
|
115
|
+
return advancedFeaturesUrl + 'grid-info-module';
|
|
109
116
|
case 'Layout':
|
|
110
|
-
return
|
|
117
|
+
return advancedFeaturesUrl + 'layout-module';
|
|
111
118
|
case 'PlusMinus':
|
|
112
|
-
return
|
|
119
|
+
return editingUrl + 'plus-minus-module';
|
|
113
120
|
case 'Query':
|
|
114
|
-
return
|
|
121
|
+
return searchingUrl + 'query-module';
|
|
115
122
|
case 'QuickSearch':
|
|
116
|
-
return
|
|
123
|
+
return searchingUrl + 'quick-search-module';
|
|
117
124
|
case 'Schedule':
|
|
118
|
-
return
|
|
125
|
+
return advancedFeaturesUrl + 'schedule-module';
|
|
119
126
|
case 'Shortcut':
|
|
120
|
-
return
|
|
127
|
+
return editingUrl + 'shortcut-module';
|
|
121
128
|
case 'SmartEdit':
|
|
122
|
-
return
|
|
129
|
+
return editingUrl + 'smart-edit-module';
|
|
123
130
|
case 'StateManagement':
|
|
124
|
-
return
|
|
131
|
+
return advancedFeaturesUrl + 'adaptable-state-overview';
|
|
125
132
|
case 'SystemStatus':
|
|
126
|
-
return
|
|
133
|
+
return notificationUrl + 'system-status-module';
|
|
127
134
|
case 'TeamSharing':
|
|
128
135
|
return url + 'key-topics/team-sharing';
|
|
129
136
|
case 'Theme':
|
|
130
|
-
return
|
|
137
|
+
return themingUrl + 'using-themes';
|
|
131
138
|
case 'ToolPanel':
|
|
132
139
|
return userInterfaceUrl + 'tool-panel';
|
|
133
140
|
case 'DataChangeHistory':
|
|
134
|
-
return
|
|
141
|
+
return editingUrl + 'change-history-module';
|
|
135
142
|
case 'Chart':
|
|
136
143
|
return pluginUrl + 'chart/chart-plugin';
|
|
137
144
|
case 'SparklineColumn':
|
|
@@ -160,14 +160,14 @@ class ReportService {
|
|
|
160
160
|
reportColumns = gridColumns;
|
|
161
161
|
break;
|
|
162
162
|
case Enums_1.ReportColumnScope.VisibleColumns:
|
|
163
|
-
reportColumns = gridColumns.filter((c) => c.
|
|
163
|
+
reportColumns = gridColumns.filter((c) => c.visible);
|
|
164
164
|
break;
|
|
165
165
|
case Enums_1.ReportColumnScope.SelectedColumns:
|
|
166
166
|
// we extract the selected columns from the grid columns to preserve the grid column order
|
|
167
167
|
const selectedColumnIds = this.adaptable.api.gridApi
|
|
168
168
|
.getSelectedCellInfo()
|
|
169
|
-
.columns.map((column) => column.
|
|
170
|
-
reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.
|
|
169
|
+
.columns.map((column) => column.columnId);
|
|
170
|
+
reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.columnId));
|
|
171
171
|
break;
|
|
172
172
|
case Enums_1.ReportColumnScope.ScopeColumns:
|
|
173
173
|
if ('ColumnIds' in report.Scope) {
|
|
@@ -182,7 +182,7 @@ class ReportService {
|
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
if (includePrimaryKey) {
|
|
185
|
-
const pkColumn = reportColumns.find((column) => column.
|
|
185
|
+
const pkColumn = reportColumns.find((column) => column.columnId === this.adaptable.adaptableOptions.primaryKey);
|
|
186
186
|
// TODO simplify after we fix the IsPrimaryKey bug
|
|
187
187
|
// const pkColumn = reportColumns.find(column => column.IsPrimaryKey);
|
|
188
188
|
if (!pkColumn && !!this.adaptable.api.columnApi.getPrimaryKeyColumn()) {
|
|
@@ -194,16 +194,16 @@ class ReportService {
|
|
|
194
194
|
getReportData(report, includePrimaryKey = false) {
|
|
195
195
|
var _a, _b;
|
|
196
196
|
const columns = this.GetReportColumnsForReport(report, includePrimaryKey).map((column) => ({
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
columnId: column.columnId,
|
|
198
|
+
friendlyName: column.friendlyName,
|
|
199
|
+
dataType: column.dataType,
|
|
200
200
|
}));
|
|
201
201
|
if (ArrayExtensions_1.default.IsNullOrEmpty(columns) &&
|
|
202
202
|
report.ReportRowScope !== Enums_1.ReportRowScope.CustomRows) {
|
|
203
203
|
return { columns: [], rows: [] };
|
|
204
204
|
}
|
|
205
205
|
const data = { columns, rows: [] };
|
|
206
|
-
const columnIds = columns.map((column) => column.
|
|
206
|
+
const columnIds = columns.map((column) => column.columnId);
|
|
207
207
|
switch (report.ReportRowScope) {
|
|
208
208
|
case Enums_1.ReportRowScope.AllRows:
|
|
209
209
|
this.adaptable.forAllRowNodesDo((rowNode) => {
|
|
@@ -240,7 +240,7 @@ class ReportService {
|
|
|
240
240
|
const rowPrimaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(rowNode);
|
|
241
241
|
const selectedRowCells = selectedCellsByPrimaryKey[rowPrimaryKeyValue];
|
|
242
242
|
if (selectedRowCells) {
|
|
243
|
-
const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.columnId);
|
|
243
|
+
const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.column.columnId);
|
|
244
244
|
const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
|
|
245
245
|
const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds);
|
|
246
246
|
if (includePrimaryKey) {
|
|
@@ -275,8 +275,8 @@ class ReportService {
|
|
|
275
275
|
}
|
|
276
276
|
convertReportDataToArray(reportData) {
|
|
277
277
|
return [
|
|
278
|
-
reportData.columns.map((column) => column.
|
|
279
|
-
...reportData.rows.map((row) => reportData.columns.map((column) => row[column.
|
|
278
|
+
reportData.columns.map((column) => column.friendlyName),
|
|
279
|
+
...reportData.rows.map((row) => reportData.columns.map((column) => row[column.columnId])),
|
|
280
280
|
];
|
|
281
281
|
}
|
|
282
282
|
getRowObjectForColumnIds(rowNode, columnIds) {
|
|
@@ -329,7 +329,7 @@ class ReportService {
|
|
|
329
329
|
return type === 'rawValue'
|
|
330
330
|
? cellRawValue
|
|
331
331
|
: // type === formattedValue
|
|
332
|
-
this.adaptable.
|
|
332
|
+
this.adaptable.getDisplayValueFromRawValue(columnId, cellRawValue);
|
|
333
333
|
}
|
|
334
334
|
computeCellExportValueFormat(columnType) {
|
|
335
335
|
if (this.adaptable.adaptableOptions.exportOptions.exportFormatType === 'rawValue' ||
|
|
@@ -18,7 +18,7 @@ class ValidationService {
|
|
|
18
18
|
}
|
|
19
19
|
let editingRules = this.adaptable.api.alertApi
|
|
20
20
|
.getAlertDefinitionsWithPreventEdit()
|
|
21
|
-
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(
|
|
21
|
+
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(dataChangedInfo.column, v.Scope));
|
|
22
22
|
let failedValidations = [];
|
|
23
23
|
if (ArrayExtensions_1.ArrayExtensions.IsNotEmpty(editingRules)) {
|
|
24
24
|
editingRules.forEach((alertDefinition) => {
|
|
@@ -55,13 +55,12 @@ class ValidationService {
|
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
IsAlertDefinitionTriggered(alertDefinition, dataChangedEvent) {
|
|
58
|
-
const column = this.adaptable.api.columnApi.getColumnFromId(dataChangedEvent.columnId);
|
|
59
58
|
return this.adaptable.api.predicateApi.handlePredicate(alertDefinition.Rule.Predicate, {
|
|
60
59
|
value: dataChangedEvent.newValue,
|
|
61
60
|
oldValue: dataChangedEvent.oldValue,
|
|
62
|
-
displayValue: this.adaptable.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.columnId),
|
|
61
|
+
displayValue: this.adaptable.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId),
|
|
63
62
|
node: dataChangedEvent.rowNode,
|
|
64
|
-
column,
|
|
63
|
+
column: dataChangedEvent.column,
|
|
65
64
|
}, false);
|
|
66
65
|
}
|
|
67
66
|
performServerValidation(dataChangedInfo, config) {
|
|
@@ -82,7 +81,7 @@ class ValidationService {
|
|
|
82
81
|
if (!row) {
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
|
-
row[(_b = this.adaptable.api.columnApi.getVendorGridColumnFieldForColumn(dataChangedInfo.columnId)) !== null && _b !== void 0 ? _b : dataChangedInfo.columnId] = validationResult.NewValue;
|
|
84
|
+
row[(_b = this.adaptable.api.columnApi.getVendorGridColumnFieldForColumn(dataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : dataChangedInfo.column.columnId] = validationResult.NewValue;
|
|
86
85
|
this.adaptable.api.gridApi.updateGridData([row]);
|
|
87
86
|
if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
|
|
88
87
|
this.adaptable.adaptableOptions.editOptions.displayServerValidationMessages) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calls the callback if the promise does not resolve in a amount of time.
|
|
3
|
+
*
|
|
4
|
+
* @param promise
|
|
5
|
+
* @param callback Called if promise does not resolve in the time defined by 'delay'
|
|
6
|
+
* @param delay Time after which if the promise was not resolved the callback (fn) is called.
|
|
7
|
+
*/
|
|
8
|
+
export declare const runIfNotResolvedIn: <T>(promise: Promise<T>, callback: () => void, delay?: number) => Promise<T>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runIfNotResolvedIn = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Calls the callback if the promise does not resolve in a amount of time.
|
|
6
|
+
*
|
|
7
|
+
* @param promise
|
|
8
|
+
* @param callback Called if promise does not resolve in the time defined by 'delay'
|
|
9
|
+
* @param delay Time after which if the promise was not resolved the callback (fn) is called.
|
|
10
|
+
*/
|
|
11
|
+
exports.runIfNotResolvedIn = async (promise, callback, delay = 100) => {
|
|
12
|
+
let isFulfilled = false;
|
|
13
|
+
promise === null || promise === void 0 ? void 0 : promise.then(() => {
|
|
14
|
+
isFulfilled = true;
|
|
15
|
+
});
|
|
16
|
+
(async () => {
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
18
|
+
if (!isFulfilled) {
|
|
19
|
+
callback();
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
return promise;
|
|
23
|
+
};
|
|
@@ -15,9 +15,9 @@ const ChartEnums_1 = require("../PredefinedConfig/Common/ChartEnums");
|
|
|
15
15
|
const AdaptableLoadingScreen_1 = require("./Components/Popups/AdaptableLoadingScreen");
|
|
16
16
|
const Toastify_1 = require("../components/Toastify");
|
|
17
17
|
const renderWithAdaptableContext_1 = require("./renderWithAdaptableContext");
|
|
18
|
-
const ProgressIndicator_1 = require("./Export/ProgressIndicator");
|
|
19
18
|
const License_1 = require("./License");
|
|
20
19
|
const ExportCustomDestinationFormPopups_1 = require("./Export/ExportCustomDestinationFormPopups");
|
|
20
|
+
const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
|
|
21
21
|
class AdaptableView extends React.Component {
|
|
22
22
|
render() {
|
|
23
23
|
var _a, _b, _c, _d, _e;
|