@adaptabletools/adaptable 10.0.3 → 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/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +3 -4
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +6 -0
- package/src/Api/Implementation/AlertApiImpl.js +5 -5
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +32 -35
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +1 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -2
- package/src/Api/Implementation/GridApiImpl.js +8 -9
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
- package/src/Api/Implementation/InternalApiImpl.js +4 -4
- package/src/Api/Implementation/LayoutApiImpl.js +3 -3
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -8
- package/src/Api/InternalApi.d.ts +1 -1
- package/src/Api/UserInterfaceApi.d.ts +3 -2
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +3 -3
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +3 -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.js +1 -1
- 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/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/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/ReportService.js +11 -11
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +3 -3
- 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.js +14 -14
- package/src/View/Components/FilterForm/QuickFilterForm.js +13 -13
- package/src/View/Components/NewScopeComponent.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.js +4 -4
- 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/DataChangeHistory/DataChangeHistoryGrid.js +3 -3
- 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 +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +2 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- 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/agGrid/Adaptable.js +57 -51
- package/src/agGrid/agGridHelper.js +32 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/metamodel/adaptable.metamodel.d.ts +51 -5
- package/src/metamodel/adaptable.metamodel.js +99 -30
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -18,7 +18,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
18
18
|
if (this.api.scopeApi.scopeHasColumns(formatColumn.Scope)) {
|
|
19
19
|
return this.api.scopeApi
|
|
20
20
|
.getColumnsForScope(formatColumn.Scope)
|
|
21
|
-
.map((adaptableColumn) => adaptableColumn.
|
|
21
|
+
.map((adaptableColumn) => adaptableColumn.columnId);
|
|
22
22
|
}
|
|
23
23
|
return [];
|
|
24
24
|
}
|
|
@@ -148,7 +148,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
148
148
|
addColumnMenuItems(column) {
|
|
149
149
|
var _a;
|
|
150
150
|
let returnColumnMenuItems = [];
|
|
151
|
-
if (column && this.isModuleEditable() && !column.
|
|
151
|
+
if (column && this.isModuleEditable() && !column.isSparkline) {
|
|
152
152
|
// not fullproof as might be an All but its generally pretty good
|
|
153
153
|
let formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(column);
|
|
154
154
|
let formatExists = formatColumn
|
|
@@ -165,8 +165,8 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
165
165
|
value: formatColumn,
|
|
166
166
|
};
|
|
167
167
|
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label + 'Format Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam));
|
|
168
|
-
if (column.
|
|
169
|
-
let formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(column.
|
|
168
|
+
if (column.dataType == 'Boolean' && !this.api.columnApi.isFreeTextColumn(column.columnId)) {
|
|
169
|
+
let formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(column.columnId);
|
|
170
170
|
let hasCheckBox = formatColumn && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle);
|
|
171
171
|
if (hasCheckBox) {
|
|
172
172
|
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Remove Checkbox', 'check-box-outline', () => {
|
|
@@ -188,7 +188,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
188
188
|
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Show as Checkbox', 'check-box', () => {
|
|
189
189
|
let newFormatColumn = {
|
|
190
190
|
Scope: {
|
|
191
|
-
ColumnIds: [column.
|
|
191
|
+
ColumnIds: [column.columnId],
|
|
192
192
|
},
|
|
193
193
|
ColumnStyle: {
|
|
194
194
|
CheckBoxStyle: true,
|
|
@@ -24,7 +24,7 @@ class FreeTextColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
24
24
|
if (column && this.isModuleEditable()) {
|
|
25
25
|
if (this.api.freeTextColumnApi
|
|
26
26
|
.getAllFreeTextColumn()
|
|
27
|
-
.find((ftc) => ftc.ColumnId == column.
|
|
27
|
+
.find((ftc) => ftc.ColumnId == column.columnId)) {
|
|
28
28
|
let popupParam = {
|
|
29
29
|
column: column,
|
|
30
30
|
action: 'Edit',
|
|
@@ -42,15 +42,15 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
42
42
|
action: 'Edit',
|
|
43
43
|
source: 'ColumnMenu',
|
|
44
44
|
}));
|
|
45
|
-
if (column && column.
|
|
45
|
+
if (column && column.hideable) {
|
|
46
46
|
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Hide Column', 'hide-column', () => {
|
|
47
|
-
this.api.columnApi.hideColumn(column.
|
|
47
|
+
this.api.columnApi.hideColumn(column.columnId);
|
|
48
48
|
}));
|
|
49
49
|
}
|
|
50
50
|
let selectMenuItems = [];
|
|
51
51
|
if (column) {
|
|
52
52
|
selectMenuItems.push(this.createColumnMenuItemClickFunction('Column', 'column-chooser', () => {
|
|
53
|
-
this.api.columnApi.selectColumn(column.
|
|
53
|
+
this.api.columnApi.selectColumn(column.columnId);
|
|
54
54
|
}));
|
|
55
55
|
}
|
|
56
56
|
selectMenuItems.push(this.createColumnMenuItemClickFunction('Whole Grid', this.moduleInfo.Glyph, () => {
|
|
@@ -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',
|
|
@@ -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);
|
|
@@ -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,
|
|
@@ -360,7 +360,7 @@ function CreateEmptyLayout(layout, adaptableColumns) {
|
|
|
360
360
|
return Object.assign(Object.assign({}, layout), { Uuid: Uuid_1.createUuid(), Columns: layout.Columns || [], ColumnSorts: layout.ColumnSorts || [],
|
|
361
361
|
// ColumnFlexMap: layout.ColumnFlexMap || {},
|
|
362
362
|
ColumnWidthMap: layout.ColumnWidthMap || {}, RowGroupedColumns: layout.RowGroupedColumns ||
|
|
363
|
-
(adaptableColumns ? adaptableColumns.filter((c) => c.
|
|
363
|
+
(adaptableColumns ? adaptableColumns.filter((c) => c.isGrouped).map((c) => c.columnId) : []) });
|
|
364
364
|
}
|
|
365
365
|
exports.CreateEmptyLayout = CreateEmptyLayout;
|
|
366
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);
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -64,7 +64,7 @@ class AlertPopupComponent extends React.Component {
|
|
|
64
64
|
if (this.props.popupParams.action == 'New') {
|
|
65
65
|
let alertDefinition = ObjectFactory_1.ObjectFactory.CreateEmptyAlertDefinition();
|
|
66
66
|
alertDefinition.Scope = {
|
|
67
|
-
ColumnIds: [this.props.popupParams.column.
|
|
67
|
+
ColumnIds: [this.props.popupParams.column.columnId],
|
|
68
68
|
};
|
|
69
69
|
this.setState({
|
|
70
70
|
editedAdaptableObject: alertDefinition,
|
|
@@ -49,7 +49,7 @@ exports.renderBaseAlertScopeSummary = (data) => {
|
|
|
49
49
|
: null)),
|
|
50
50
|
React.createElement(rebass_1.Box, { style: { overflow: 'hidden' } }, 'ColumnIds' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
51
51
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: columnsInScope.length ? 2 : 0 }, "Changes in selected columns will trigger an alert"),
|
|
52
|
-
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.
|
|
52
|
+
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.columnId), toLabel: (c) => c.friendlyName, allowWrap: true, readOnly: true, renderLabel: (c) => React.createElement(rebass_1.Text, { fontSize: 2 }, c), toIdentifier: (c) => c.columnId })) : null)) : null),
|
|
53
53
|
React.createElement(rebass_1.Box, null, 'DataTypes' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
54
54
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: 2 }, "Changes in columns of the selected data-types trigger an alert"),
|
|
55
55
|
React.createElement(ValueSelector_1.ValueOptionsTags, { readOnly: true, options: data.Scope.DataTypes, value: data.Scope.DataTypes, toLabel: (c) => c, allowWrap: true, renderLabel: (c) => React.createElement(rebass_1.Text, { fontSize: 2 }, `DataType: ${c}`), toIdentifier: (c) => c }))) : null)));
|
|
@@ -34,7 +34,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
34
34
|
let dataTypeErrorMessage = '';
|
|
35
35
|
if (col && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue)) {
|
|
36
36
|
// check that the update value is a number for a numeric column. not issue for dates as we dont allow free text
|
|
37
|
-
if (col.
|
|
37
|
+
if (col.dataType == Enums_1.DataType.Number) {
|
|
38
38
|
if (isNaN(Number(this.props.BulkUpdateValue))) {
|
|
39
39
|
hasDataTypeError = true;
|
|
40
40
|
dataTypeErrorMessage = 'This column only accepts numbers';
|
|
@@ -50,14 +50,14 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
return (React.createElement(PanelWithImage_1.PanelWithImage, { header: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), variant: "primary", bodyProps: { padding: 2 }, style: { height: '100%' } },
|
|
53
|
-
col.
|
|
53
|
+
col.dataType == Enums_1.DataType.Date ? (React.createElement(React.Fragment, null,
|
|
54
54
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Enter a date value. Alternatively, tick the checkbox and select from an existing column value."),
|
|
55
55
|
React.createElement(rebass_1.Box, null,
|
|
56
56
|
React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, onChange: (checked) => this.onUseColumnValuesSelectorChanged(checked), checked: this.state.useSelector },
|
|
57
57
|
' ',
|
|
58
58
|
"Select from existing column values")),
|
|
59
59
|
React.createElement(rebass_1.Flex, { padding: 2, flexDirection: "row", alignItems: "center" },
|
|
60
|
-
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.
|
|
60
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.dataType), placeholder: UIHelper_1.UIHelper.getPlaceHolderforDataType(col.dataType), onChange: (e) => this.onBulkUpdateValueChange(e) }))),
|
|
61
61
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
62
62
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All', onClick: () => {
|
|
63
63
|
this.onApplyClick();
|
|
@@ -46,7 +46,7 @@ class CalculatedColumnPopupComponent extends React.Component {
|
|
|
46
46
|
if (this.props.popupParams.action && this.props.popupParams.column) {
|
|
47
47
|
if (this.props.popupParams.action == 'Edit') {
|
|
48
48
|
// only editing is possible - you cannot create a new calc column from the column menu
|
|
49
|
-
let calculatedColumn = this.props.CalculatedColumns.find((x) => x.ColumnId == this.props.popupParams.column.
|
|
49
|
+
let calculatedColumn = this.props.CalculatedColumns.find((x) => x.ColumnId == this.props.popupParams.column.columnId);
|
|
50
50
|
this.onEdit(calculatedColumn);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -29,7 +29,7 @@ class CalculatedColumnSummaryComponent extends React.Component {
|
|
|
29
29
|
let sharing = this.props.teamSharingActivated;
|
|
30
30
|
this.props.CalculatedColumns.map((item, index) => {
|
|
31
31
|
var _a;
|
|
32
|
-
if (item.ColumnId == this.props.summarisedColumn.
|
|
32
|
+
if (item.ColumnId == this.props.summarisedColumn.columnId) {
|
|
33
33
|
detailRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: 'UF' + index, item1: this.props.moduleInfo.FriendlyName, item2: (_a = item.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression, configEnity: item, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(item), onShare: (config) => this.props.onShare(item, config), onDelete: CalculatedColumnRedux.CalculatedColumnDelete(item), showBold: true, accessLevel: this.props.accessLevel }));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
@@ -48,7 +48,7 @@ exports.isValidCalculatedColumnSettings = (data, api) => {
|
|
|
48
48
|
if (!((_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.DataType)) {
|
|
49
49
|
return 'No data type specified for column';
|
|
50
50
|
}
|
|
51
|
-
const columnsWithSameIdCount = columns.filter((c) => c.
|
|
51
|
+
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
52
52
|
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
53
53
|
return hasAlreadyExistingId ? 'A Column already exists with that id' : true;
|
|
54
54
|
};
|
|
@@ -9,7 +9,7 @@ exports.NewColumnSelector = (props) => {
|
|
|
9
9
|
const { columnFilterText, availableColumns, selected, onChange, singleSelect } = props;
|
|
10
10
|
const filterFn = react_1.useMemo(() => {
|
|
11
11
|
return columnFilterText
|
|
12
|
-
? (c) => c.
|
|
12
|
+
? (c) => c.friendlyName.toLowerCase().indexOf(columnFilterText.toLowerCase()) != -1
|
|
13
13
|
: null;
|
|
14
14
|
}, [columnFilterText]);
|
|
15
15
|
return (React.createElement(ValueSelector_1.ValueSelector, { value: selected, options: availableColumns, filter: filterFn, singleSelect: singleSelect, allowReorder: false, onChange: (colIds) => {
|
|
@@ -19,7 +19,7 @@ exports.NewColumnSelector = (props) => {
|
|
|
19
19
|
else {
|
|
20
20
|
onChange(colIds);
|
|
21
21
|
}
|
|
22
|
-
}, toIdentifier: (c) => c.
|
|
22
|
+
}, toIdentifier: (c) => c.columnId, toLabel: (c) => c.friendlyName, noSelectionLabel: singleSelect ? 'Please select a column' : 'You have not selected any columns.', xSelectedLabel: singleSelect
|
|
23
23
|
? () => null
|
|
24
24
|
: (count) => (count > 1 ? `You selected ${count} columns.` : 'You selected one column.') }));
|
|
25
25
|
};
|
|
@@ -50,24 +50,24 @@ class FilterFormComponent extends React.Component {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
static createColumnFilterFromProps(props) {
|
|
53
|
-
let existingColumnFilter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.
|
|
53
|
+
let existingColumnFilter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.columnId);
|
|
54
54
|
if (!existingColumnFilter) {
|
|
55
55
|
const filterOptions = props.api.internalApi.getAdaptableOptions()
|
|
56
56
|
.filterOptions;
|
|
57
57
|
if (filterOptions.defaultFilterFormTab == 'Values') {
|
|
58
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
58
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'Values', []);
|
|
59
59
|
}
|
|
60
|
-
if (props.currentColumn.
|
|
61
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
60
|
+
if (props.currentColumn.dataType === 'Number') {
|
|
61
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultNumericColumnFilter), ['']);
|
|
62
62
|
}
|
|
63
|
-
if (props.currentColumn.
|
|
64
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
63
|
+
if (props.currentColumn.dataType === 'String') {
|
|
64
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultStringColumnFilter), ['']);
|
|
65
65
|
}
|
|
66
|
-
if (props.currentColumn.
|
|
67
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
66
|
+
if (props.currentColumn.dataType === 'Date') {
|
|
67
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultDateColumnFilter), ['']);
|
|
68
68
|
}
|
|
69
|
-
if (props.currentColumn.
|
|
70
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
69
|
+
if (props.currentColumn.dataType === 'Boolean') {
|
|
70
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'BooleanToggle', [
|
|
71
71
|
'all',
|
|
72
72
|
]);
|
|
73
73
|
}
|
|
@@ -102,12 +102,12 @@ class FilterFormComponent extends React.Component {
|
|
|
102
102
|
this._isMounted = false;
|
|
103
103
|
}
|
|
104
104
|
componentDidMount() {
|
|
105
|
-
if (this.props.currentColumn.
|
|
105
|
+
if (this.props.currentColumn.dataType != Enums_1.DataType.Boolean) {
|
|
106
106
|
this.loadPermittedValues();
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
async loadPermittedValues(filter = '') {
|
|
110
|
-
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.
|
|
110
|
+
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
111
111
|
if (!this._isMounted) {
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
@@ -141,7 +141,7 @@ class FilterFormComponent extends React.Component {
|
|
|
141
141
|
React.createElement(Radio_1.default, { marginLeft: 2, flex: 1, checked: this.state.currentTab == 'predicates', onChange: () => this.setState({ currentTab: 'predicates' }) },
|
|
142
142
|
React.createElement(rebass_1.Flex, { fontSize: 'var( --ab-font-size-2)' }, "Filters")))),
|
|
143
143
|
this.state.currentTab === 'values' && (React.createElement("div", null,
|
|
144
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.
|
|
144
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: uiSelectedColumnValues, useVendorStyle: useVendorStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
145
145
|
this.state.currentTab === 'predicates' && (React.createElement("div", null,
|
|
146
146
|
' ',
|
|
147
147
|
this.state.showTab && React.createElement("hr", null),
|
|
@@ -185,7 +185,7 @@ class FilterFormComponent extends React.Component {
|
|
|
185
185
|
} }))));
|
|
186
186
|
}
|
|
187
187
|
isFilterable() {
|
|
188
|
-
if (!this.props.currentColumn.
|
|
188
|
+
if (!this.props.currentColumn.filterable) {
|
|
189
189
|
return 'Column is not filterable';
|
|
190
190
|
}
|
|
191
191
|
return '';
|