@adaptabletools/adaptable 11.2.4 → 11.3.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/bundle.cjs.js +98 -98
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
- package/src/AdaptableOptions/EditOptions.d.ts +92 -4
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +2 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -3
- package/src/Api/EventApi.d.ts +4 -1
- package/src/Api/Events/RowFormSubmitted.d.ts +19 -0
- package/src/{AdaptableOptions/SmartEdit.js → Api/Events/RowFormSubmitted.js} +0 -0
- package/src/Api/FormatColumnApi.d.ts +6 -0
- package/src/Api/GridApi.d.ts +14 -0
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FormatColumnApiImpl.js +6 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -0
- package/src/Api/Implementation/GridApiImpl.js +40 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +4 -0
- package/src/Api/Implementation/InternalApiImpl.js +37 -7
- package/src/Api/Implementation/SmartEditApiImpl.d.ts +2 -1
- package/src/Api/Implementation/SmartEditApiImpl.js +3 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -21
- package/src/Api/InternalApi.d.ts +4 -1
- package/src/Api/SmartEditApi.d.ts +6 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -0
- package/src/PredefinedConfig/Common/AdaptableForm.d.ts +3 -2
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +1 -3
- package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -11
- package/src/PredefinedConfig/Common/BaseContext.d.ts +1 -1
- package/src/PredefinedConfig/SystemState.d.ts +1 -2
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SmartEditModule.js +5 -6
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +9 -0
- package/src/Utilities/Helpers/AdaptableHelper.js +1 -0
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +8 -0
- package/src/Utilities/Services/Interface/IRowEditService.js +2 -0
- package/src/Utilities/Services/RowEditService.d.ts +25 -0
- package/src/Utilities/Services/RowEditService.js +165 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +2 -0
- package/src/View/Components/Popups/FormPopups/FormPopups.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +4 -6
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -1
- package/src/View/SmartEdit/SmartEditPopup.d.ts +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +1 -2
- package/src/View/SmartEdit/SmartEditViewPanel.d.ts +1 -1
- package/src/View/SmartEdit/SmartEditViewPanel.js +1 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +6 -1
- package/src/agGrid/ActionColumnRenderer.js +6 -4
- package/src/agGrid/Adaptable.d.ts +3 -0
- package/src/agGrid/Adaptable.js +121 -18
- package/src/agGrid/rowEditIcons.d.ts +4 -0
- package/src/agGrid/rowEditIcons.js +9 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +6 -16
- package/src/components/Datepicker/index.js +19 -18
- package/src/components/WindowModal/WindowModal.d.ts +2 -0
- package/src/components/WindowModal/WindowModal.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +72 -0
- package/src/metamodel/adaptable.metamodel.js +146 -5
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/SmartEdit.d.ts +0 -34
- package/src/View/Components/Forms/AdaptableForm.d.ts +0 -6
- package/src/View/Components/Forms/AdaptableForm.js +0 -21
|
@@ -21,15 +21,6 @@ export interface AdaptableObject {
|
|
|
21
21
|
Tags?: AdaptableObjectTag[];
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Object
|
|
24
|
+
* AdaptableObjectTag Object Tague - currently supporting only plain string values, but open for future extensions, if ever needed.
|
|
25
25
|
*/
|
|
26
|
-
export declare type AdaptableObjectTag = string
|
|
27
|
-
/**
|
|
28
|
-
* Label for the Tag
|
|
29
|
-
*/
|
|
30
|
-
label: string;
|
|
31
|
-
/**
|
|
32
|
-
* Value for the Tag - string or number
|
|
33
|
-
*/
|
|
34
|
-
value: string | number;
|
|
35
|
-
};
|
|
26
|
+
export declare type AdaptableObjectTag = string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PreviewInfo } from '../Utilities/Interface/Preview';
|
|
2
2
|
import { InternalState } from './InternalState';
|
|
3
3
|
import { BulkUpdateValidationResult } from '../Strategy/Interface/IBulkUpdateModule';
|
|
4
|
-
import { CellDataChangedInfo, GridCell } from '../types';
|
|
4
|
+
import { CellDataChangedInfo, GridCell, SmartEditOperation } from '../types';
|
|
5
5
|
import type { IPushPullState, IPushPullReport, IPushPullDomain } from './IPushPullState';
|
|
6
6
|
import { Glue42State, Glue42Report } from './Glue42State';
|
|
7
7
|
import { OpenFinState, OpenFinReport } from './OpenFinState';
|
|
@@ -13,7 +13,6 @@ import { CachedQuery } from './QueryState';
|
|
|
13
13
|
import { AdaptableFlashingCell } from './Common/AdaptableFlashingCell';
|
|
14
14
|
import { TypeUuid } from './Uuid';
|
|
15
15
|
import { SummaryOperation } from './Common/Enums';
|
|
16
|
-
import { SmartEditOperation } from '../AdaptableOptions/SmartEdit';
|
|
17
16
|
export type { IPushPullReport, IPushPullDomain };
|
|
18
17
|
export type { Glue42Report };
|
|
19
18
|
export type { OpenFinReport };
|
|
@@ -13,7 +13,7 @@ import { AdaptableFlashingCell } from '../../PredefinedConfig/Common/AdaptableFl
|
|
|
13
13
|
import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
|
|
14
14
|
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
15
15
|
import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
|
|
16
|
-
import { SmartEditOperation } from '../../AdaptableOptions/
|
|
16
|
+
import { SmartEditOperation } from '../../AdaptableOptions/EditOptions';
|
|
17
17
|
export declare const FLASHING_CELL_ROW_KEY = "__ROW";
|
|
18
18
|
export declare const SYSTEM_ALERT_ADD = "SYSTEM_ALERT_ADD";
|
|
19
19
|
export declare const SYSTEM_ALERT_DELETE = "SYSTEM_ALERT_DELETE";
|
|
@@ -6,7 +6,7 @@ import { GridCell } from '../PredefinedConfig/Selection/GridCell';
|
|
|
6
6
|
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
7
7
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
8
8
|
import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
|
|
9
|
-
import { SmartEditOperation } from '../AdaptableOptions/
|
|
9
|
+
import { SmartEditOperation } from '../AdaptableOptions/EditOptions';
|
|
10
10
|
export declare class SmartEditModule extends AdaptableModuleBase implements ISmartEditModule {
|
|
11
11
|
constructor(api: AdaptableApi);
|
|
12
12
|
getViewAccessLevel(): AccessLevel;
|
|
@@ -123,13 +123,12 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
123
123
|
selectedCellInfo.gridCells.forEach((selectedCell) => {
|
|
124
124
|
let newValue;
|
|
125
125
|
if (typeof smartEditOperation === 'object') {
|
|
126
|
-
|
|
127
|
-
smartEditValue,
|
|
128
|
-
column,
|
|
129
|
-
adaptableApi: this.api,
|
|
126
|
+
const context = {
|
|
127
|
+
smartEditValue: smartEditValue,
|
|
130
128
|
currentCell: selectedCell,
|
|
131
|
-
|
|
132
|
-
}
|
|
129
|
+
adaptableApi: this.api,
|
|
130
|
+
};
|
|
131
|
+
newValue = smartEditOperation.Operation(context);
|
|
133
132
|
}
|
|
134
133
|
else {
|
|
135
134
|
switch (smartEditOperation) {
|
|
@@ -89,6 +89,13 @@ exports.DefaultAdaptableOptions = {
|
|
|
89
89
|
validateOnServer: undefined,
|
|
90
90
|
displayServerValidationMessages: true,
|
|
91
91
|
isCellEditable: undefined,
|
|
92
|
+
rowFormOptions: {
|
|
93
|
+
formTitle: undefined,
|
|
94
|
+
formDescription: undefined,
|
|
95
|
+
formFieldLabel: undefined,
|
|
96
|
+
formButtons: undefined,
|
|
97
|
+
onFormSubmit: undefined,
|
|
98
|
+
},
|
|
92
99
|
},
|
|
93
100
|
entitlementOptions: {
|
|
94
101
|
defaultAccessLevel: 'Full',
|
|
@@ -221,6 +228,8 @@ exports.DefaultAdaptableOptions = {
|
|
|
221
228
|
showDocumentationLinks: true,
|
|
222
229
|
gridInfoSections: ['GridSummary', 'AdaptableOptions', 'ColumnInfo'],
|
|
223
230
|
showAdapTableVersion: true,
|
|
231
|
+
rowActionButtons: undefined,
|
|
232
|
+
rowActionButtonsPosition: 'pinnedLeft',
|
|
224
233
|
},
|
|
225
234
|
toolPanelOptions: {
|
|
226
235
|
showAdaptableToolPanel: true,
|
|
@@ -20,6 +20,7 @@ function assignAdaptableOptions(adaptableOptions) {
|
|
|
20
20
|
returnedAdaptableOptions.entitlementOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.entitlementOptions, adaptableOptions.entitlementOptions);
|
|
21
21
|
returnedAdaptableOptions.dashboardOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dashboardOptions, adaptableOptions.dashboardOptions);
|
|
22
22
|
returnedAdaptableOptions.editOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.editOptions, adaptableOptions.editOptions);
|
|
23
|
+
returnedAdaptableOptions.editOptions.rowFormOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.editOptions.rowFormOptions, returnedAdaptableOptions.editOptions.rowFormOptions);
|
|
23
24
|
returnedAdaptableOptions.containerOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.containerOptions, adaptableOptions.containerOptions);
|
|
24
25
|
returnedAdaptableOptions.generalOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.generalOptions, adaptableOptions.generalOptions);
|
|
25
26
|
returnedAdaptableOptions.searchOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.searchOptions, adaptableOptions.searchOptions);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RowNode } from '@ag-grid-community/all-modules';
|
|
2
|
+
import { IAdaptableService } from './IAdaptableService';
|
|
3
|
+
import { AdaptableForm } from '../../../PredefinedConfig/Common/AdaptableForm';
|
|
4
|
+
import { CreateRowFormContext, EditRowFormContext } from '../../../AdaptableOptions/EditOptions';
|
|
5
|
+
export interface IRowEditService extends IAdaptableService {
|
|
6
|
+
buildRowEditForm(rowNode: RowNode): AdaptableForm<EditRowFormContext>;
|
|
7
|
+
buildRowCreateForm(clonedRowNode?: RowNode): AdaptableForm<CreateRowFormContext>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IRowEditService } from './Interface/IRowEditService';
|
|
2
|
+
import { RowNode } from '@ag-grid-community/all-modules';
|
|
3
|
+
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
4
|
+
import { AdaptableForm } from '../../PredefinedConfig/Common/AdaptableForm';
|
|
5
|
+
import { CreateRowFormContext, EditRowFormContext } from '../../AdaptableOptions/EditOptions';
|
|
6
|
+
export declare class RowEditService implements IRowEditService {
|
|
7
|
+
private adaptableApi;
|
|
8
|
+
private adaptableInstance;
|
|
9
|
+
private rowEditFormOptions;
|
|
10
|
+
constructor(adaptableApi: AdaptableApi);
|
|
11
|
+
buildRowEditForm(rowNode: RowNode): AdaptableForm<EditRowFormContext>;
|
|
12
|
+
buildRowCreateForm(clonedRowNode?: RowNode): AdaptableForm<CreateRowFormContext>;
|
|
13
|
+
private buildRowForm;
|
|
14
|
+
private getFormTitle;
|
|
15
|
+
private getFormDescription;
|
|
16
|
+
private buildFormParamContext;
|
|
17
|
+
private buildRowFormFields;
|
|
18
|
+
private buildRowFormButtons;
|
|
19
|
+
private isColumnEditable;
|
|
20
|
+
private buildFormField;
|
|
21
|
+
private getFormFieldLabel;
|
|
22
|
+
private buildFormFieldLabelContext;
|
|
23
|
+
private getFieldTypeFromColumnType;
|
|
24
|
+
private getFieldValueOptions;
|
|
25
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RowEditService = void 0;
|
|
4
|
+
class RowEditService {
|
|
5
|
+
constructor(adaptableApi) {
|
|
6
|
+
this.adaptableApi = adaptableApi;
|
|
7
|
+
this.adaptableInstance = this.adaptableApi.internalApi.getAdaptableInstance();
|
|
8
|
+
this.rowEditFormOptions =
|
|
9
|
+
this.adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.editOptions.rowFormOptions;
|
|
10
|
+
}
|
|
11
|
+
buildRowEditForm(rowNode) {
|
|
12
|
+
return this.buildRowForm('rowEdited', rowNode);
|
|
13
|
+
}
|
|
14
|
+
buildRowCreateForm(clonedRowNode) {
|
|
15
|
+
return this.buildRowForm('rowCreated', clonedRowNode);
|
|
16
|
+
}
|
|
17
|
+
buildRowForm(type, rowNode) {
|
|
18
|
+
const formFields = this.buildRowFormFields(type, rowNode);
|
|
19
|
+
const formButtons = this.buildRowFormButtons(type, rowNode);
|
|
20
|
+
const formTitle = this.getFormTitle(type, rowNode);
|
|
21
|
+
const formDescription = this.getFormDescription(type, rowNode);
|
|
22
|
+
const rowForm = {
|
|
23
|
+
title: formTitle,
|
|
24
|
+
description: formDescription,
|
|
25
|
+
fields: formFields,
|
|
26
|
+
buttons: formButtons,
|
|
27
|
+
};
|
|
28
|
+
return rowForm;
|
|
29
|
+
}
|
|
30
|
+
getFormTitle(type, rowNode) {
|
|
31
|
+
if (this.rowEditFormOptions.formTitle == undefined) {
|
|
32
|
+
return type === 'rowCreated' ? 'Create New Row' : 'Edit Row';
|
|
33
|
+
}
|
|
34
|
+
return typeof this.rowEditFormOptions.formTitle === 'function'
|
|
35
|
+
? this.rowEditFormOptions.formTitle(this.buildFormParamContext(type, rowNode))
|
|
36
|
+
: this.rowEditFormOptions.formTitle;
|
|
37
|
+
}
|
|
38
|
+
getFormDescription(type, rowNode) {
|
|
39
|
+
return typeof this.rowEditFormOptions.formDescription === 'function'
|
|
40
|
+
? this.rowEditFormOptions.formDescription(this.buildFormParamContext(type, rowNode))
|
|
41
|
+
: this.rowEditFormOptions.formDescription;
|
|
42
|
+
}
|
|
43
|
+
buildFormParamContext(type, rowNode) {
|
|
44
|
+
return {
|
|
45
|
+
rowNode,
|
|
46
|
+
adaptableApi: this.adaptableApi,
|
|
47
|
+
type: type,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
buildRowFormFields(type, rowNode) {
|
|
51
|
+
const relevantColumns = this.adaptableApi.columnApi.getColumns().filter((column) => {
|
|
52
|
+
// if there is NO rowNode, do NOT display the non-editable fields as they will be empty
|
|
53
|
+
return !!rowNode || this.isColumnEditable(column, rowNode);
|
|
54
|
+
});
|
|
55
|
+
return relevantColumns.map((column) => this.buildFormField(type, column, rowNode));
|
|
56
|
+
}
|
|
57
|
+
buildRowFormButtons(type, rowNode) {
|
|
58
|
+
// 1. check if there are custom user provided buttons
|
|
59
|
+
if (Array.isArray(this.rowEditFormOptions.formButtons)) {
|
|
60
|
+
return this.rowEditFormOptions.formButtons;
|
|
61
|
+
}
|
|
62
|
+
// 2. else return the standard ones
|
|
63
|
+
const cancelButton = {
|
|
64
|
+
label: 'Cancel',
|
|
65
|
+
buttonStyle: {
|
|
66
|
+
variant: 'raised',
|
|
67
|
+
tone: 'neutral',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const saveButton = {
|
|
71
|
+
label: 'Save',
|
|
72
|
+
buttonStyle: {
|
|
73
|
+
variant: 'raised',
|
|
74
|
+
tone: 'success',
|
|
75
|
+
},
|
|
76
|
+
onClick: (button, context) => {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const eventInfo = type === 'rowCreated'
|
|
79
|
+
? {
|
|
80
|
+
type: 'rowCreated',
|
|
81
|
+
formData: context.formData,
|
|
82
|
+
adaptableApi: context.adaptableApi,
|
|
83
|
+
clonedRowNode: rowNode,
|
|
84
|
+
}
|
|
85
|
+
: {
|
|
86
|
+
type: 'rowEdited',
|
|
87
|
+
formData: context.formData,
|
|
88
|
+
rowNode: rowNode,
|
|
89
|
+
adaptableApi: context.adaptableApi,
|
|
90
|
+
};
|
|
91
|
+
this.adaptableApi.eventApi.emit('RowFormSubmitted', eventInfo);
|
|
92
|
+
(_b = (_a = this.adaptableInstance.adaptableOptions.editOptions.rowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
return [cancelButton, saveButton];
|
|
96
|
+
}
|
|
97
|
+
isColumnEditable(column, rowNode) {
|
|
98
|
+
return rowNode
|
|
99
|
+
? this.adaptableInstance.isCellEditable(rowNode, this.adaptableInstance.getAgGridColumnForColumnId(column.columnId))
|
|
100
|
+
: !column.readOnly;
|
|
101
|
+
}
|
|
102
|
+
buildFormField(type, column, rowNode) {
|
|
103
|
+
const isColumnEditable = this.isColumnEditable(column, rowNode);
|
|
104
|
+
const fieldValueOptions = this.getFieldValueOptions(column, rowNode);
|
|
105
|
+
const fieldType = isColumnEditable
|
|
106
|
+
? !!(fieldValueOptions === null || fieldValueOptions === void 0 ? void 0 : fieldValueOptions.length)
|
|
107
|
+
? 'select'
|
|
108
|
+
: this.getFieldTypeFromColumnType(column)
|
|
109
|
+
: 'textOutput';
|
|
110
|
+
const defaultValue = rowNode
|
|
111
|
+
? isColumnEditable
|
|
112
|
+
? this.adaptableInstance.getRawValueFromRowNode(rowNode, column.columnId)
|
|
113
|
+
: this.adaptableInstance.getDisplayValueFromRowNode(rowNode, column.columnId)
|
|
114
|
+
: null;
|
|
115
|
+
return {
|
|
116
|
+
label: this.getFormFieldLabel(type, column, rowNode),
|
|
117
|
+
name: column.columnId,
|
|
118
|
+
defaultValue,
|
|
119
|
+
fieldType,
|
|
120
|
+
options: fieldValueOptions,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
getFormFieldLabel(type, column, rowNode) {
|
|
124
|
+
const customFieldLabel = typeof this.rowEditFormOptions.formFieldLabel === 'function'
|
|
125
|
+
? this.rowEditFormOptions.formFieldLabel(this.buildFormFieldLabelContext(type, column, rowNode))
|
|
126
|
+
: undefined;
|
|
127
|
+
return customFieldLabel !== null && customFieldLabel !== void 0 ? customFieldLabel : column.friendlyName;
|
|
128
|
+
}
|
|
129
|
+
buildFormFieldLabelContext(type, column, rowNode) {
|
|
130
|
+
return {
|
|
131
|
+
rowNode,
|
|
132
|
+
column,
|
|
133
|
+
adaptableApi: this.adaptableApi,
|
|
134
|
+
type: type,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
getFieldTypeFromColumnType(column) {
|
|
138
|
+
switch (column.dataType) {
|
|
139
|
+
case 'Boolean':
|
|
140
|
+
return 'checkbox';
|
|
141
|
+
case 'Date':
|
|
142
|
+
return 'date';
|
|
143
|
+
case 'Number':
|
|
144
|
+
return 'number';
|
|
145
|
+
default:
|
|
146
|
+
// everything else is a plain text input
|
|
147
|
+
return 'text';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
getFieldValueOptions(column, rowNode) {
|
|
151
|
+
const editLookUpItem = this.adaptableApi.userInterfaceApi.getEditLookUpItemForColumn(column);
|
|
152
|
+
if (!editLookUpItem) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const gridCell = rowNode
|
|
156
|
+
? this.adaptableInstance.getGridCellFromRowNode(rowNode, column.columnId)
|
|
157
|
+
: undefined;
|
|
158
|
+
const editLookUpValues = this.adaptableApi.internalApi.getEditLookUpValuesForColumn(editLookUpItem, column, gridCell);
|
|
159
|
+
return editLookUpValues === null || editLookUpValues === void 0 ? void 0 : editLookUpValues.map((value) => ({
|
|
160
|
+
value,
|
|
161
|
+
label: value,
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.RowEditService = RowEditService;
|
|
@@ -73,7 +73,7 @@ exports.CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
73
73
|
const ColumnName = data.FriendlyName;
|
|
74
74
|
const ColumnId = data.ColumnId;
|
|
75
75
|
let { DataType: dataType } = (_a = data.CalculatedColumnSettings) !== null && _a !== void 0 ? _a : {};
|
|
76
|
-
const { Width, ShowToolTip, HeaderToolTip } = (_b = data.CalculatedColumnSettings) !== null && _b !== void 0 ? _b : {};
|
|
76
|
+
const { Width, ShowToolTip, HeaderToolTip, ExternallyEvaluatedExpression } = (_b = data.CalculatedColumnSettings) !== null && _b !== void 0 ? _b : {};
|
|
77
77
|
const handleSpecialColumnSettingsChange = (settings) => {
|
|
78
78
|
props.onChange(Object.assign(Object.assign({}, data), { CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), settings) }));
|
|
79
79
|
};
|
|
@@ -118,7 +118,14 @@ exports.CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
118
118
|
}) })),
|
|
119
119
|
' ',
|
|
120
120
|
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
121
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip }, "Show Expression as Cell Tooltip"))
|
|
121
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip }, "Show Expression as Cell Tooltip")),
|
|
122
|
+
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
123
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-external-expression-evaluation", onChange: (checked) => handleSpecialColumnSettingsChange({ ExternallyEvaluatedExpression: checked }), checked: ExternallyEvaluatedExpression }, "Suppress Expression Evaluation"),
|
|
124
|
+
ExternallyEvaluatedExpression && (React.createElement(rebass_1.Box, { "data-name": "note-external-expression-evaluation", p: 2, style: {
|
|
125
|
+
background: 'var(--ab-color-primary)',
|
|
126
|
+
borderRadius: 'var(--ab__border-radius)',
|
|
127
|
+
whiteSpace: 'pre-wrap',
|
|
128
|
+
} }, "The column value is loaded from the row data property with the same name as the ColumnId"))))))),
|
|
122
129
|
ErrorMessage ? React.createElement(ErrorBox_1.default, { marginTop: 2 }, ErrorMessage) : null,
|
|
123
130
|
React.createElement(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false, settings: data.CalculatedColumnSettings, onChange: handleSpecialColumnSettingsChange })));
|
|
124
131
|
};
|
|
@@ -36,6 +36,6 @@ exports.AdaptableObjectCompactListItem = (props) => {
|
|
|
36
36
|
};
|
|
37
37
|
exports.AdaptableObjectCompactList = (props) => {
|
|
38
38
|
return (React.createElement("div", { className: baseClassName }, props.abObjects.map((abObject) => {
|
|
39
|
-
return React.createElement(exports.AdaptableObjectCompactListItem, { abObject: abObject, module: props.module });
|
|
39
|
+
return (React.createElement(exports.AdaptableObjectCompactListItem, { key: abObject.Uuid, abObject: abObject, module: props.module }));
|
|
40
40
|
})));
|
|
41
41
|
};
|
|
@@ -32,6 +32,8 @@ const WindowDialog = (props) => {
|
|
|
32
32
|
handleSelector: isActionModule
|
|
33
33
|
? `.${baseClassName} .ab-Panel__header`
|
|
34
34
|
: '.ab-Adaptable-Popup__TopBar',
|
|
35
|
+
minHeight: 460,
|
|
36
|
+
minWidth: 400,
|
|
35
37
|
size: popupSettings.size,
|
|
36
38
|
position: popupSettings.position,
|
|
37
39
|
onChange: handleWindowSettings,
|
|
@@ -20,8 +20,8 @@ exports.FormDialog = ({ id, formProps, form, prepareContext, }) => {
|
|
|
20
20
|
dispatch(PopupRedux_1.PopupHideForm(id));
|
|
21
21
|
};
|
|
22
22
|
const context = Object.assign({ adaptableApi: adaptable.api, formData: data }, formProps);
|
|
23
|
-
return (React.createElement(Dialog_1.default, { isOpen: true, showCloseButton: false, style: { minHeight: 'auto', minWidth: 400 }, onDismiss: handleDismiss },
|
|
24
|
-
React.createElement(rebass_1.
|
|
23
|
+
return (React.createElement(Dialog_1.default, { isOpen: true, showCloseButton: false, style: { minHeight: 'auto', minWidth: 400, maxHeight: '80vh' }, onDismiss: handleDismiss },
|
|
24
|
+
React.createElement(rebass_1.Flex, { flexDirection: 'column', "data-name": "form-dialog", padding: 4, height: '100%' },
|
|
25
25
|
React.createElement(AdaptableFormComponent_1.AdaptableFormComponent, { formDef: form, data: data, context: context, onChange: setData, api: adaptable.api, displayTitle: true, onButtonClick: async (button) => {
|
|
26
26
|
var _a;
|
|
27
27
|
handleDismiss();
|
|
@@ -102,14 +102,14 @@ function splitArrayInTwo(arr) {
|
|
|
102
102
|
const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
103
103
|
var _a, _b, _c;
|
|
104
104
|
return (React.createElement(FormLayout_1.FormRow, { key: customFormatter.id, label: (_a = customFormatter.label) !== null && _a !== void 0 ? _a : customFormatter.id },
|
|
105
|
-
React.createElement(CheckBox_1.CheckBox, { checked: (_c = (_b = data.DisplayFormat.Options.CustomDisplayFormats) === null || _b === void 0 ? void 0 : _b.some) === null || _c === void 0 ? void 0 : _c.call(_b, (item) => item
|
|
105
|
+
React.createElement(CheckBox_1.CheckBox, { checked: (_c = (_b = data.DisplayFormat.Options.CustomDisplayFormats) === null || _b === void 0 ? void 0 : _b.some) === null || _c === void 0 ? void 0 : _c.call(_b, (item) => item === customFormatter.id), onChange: (checked) => {
|
|
106
106
|
var _a, _b, _c;
|
|
107
107
|
let newCustomFormats = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.DisplayFormat) === null || _a === void 0 ? void 0 : _a.Options) === null || _b === void 0 ? void 0 : _b.CustomDisplayFormats) !== null && _c !== void 0 ? _c : [];
|
|
108
108
|
if (checked) {
|
|
109
|
-
newCustomFormats = [...newCustomFormats,
|
|
109
|
+
newCustomFormats = [...newCustomFormats, customFormatter.id];
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
newCustomFormats = newCustomFormats.filter((item) => item
|
|
112
|
+
newCustomFormats = newCustomFormats.filter((item) => item !== customFormatter.id);
|
|
113
113
|
}
|
|
114
114
|
setFormatOption('CustomDisplayFormats', newCustomFormats);
|
|
115
115
|
} })));
|
|
@@ -369,16 +369,14 @@ exports.FormatColumnFormatWizardSection = (props) => {
|
|
|
369
369
|
update({ DisplayFormat });
|
|
370
370
|
};
|
|
371
371
|
const Type = data.DisplayFormat && data.DisplayFormat.Formatter;
|
|
372
|
+
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => adaptable.api.scopeApi.isScopeInScope(displayFormatter.scope, data.Scope));
|
|
372
373
|
if (Type === 'NumberFormatter') {
|
|
373
|
-
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => displayFormatter.type === 'Number');
|
|
374
374
|
return renderNumberFormat(data, update, setFormatOption, customNumberFormatters, formatColumnApi);
|
|
375
375
|
}
|
|
376
376
|
if (Type === 'DateFormatter') {
|
|
377
|
-
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => displayFormatter.type === 'Date');
|
|
378
377
|
return renderDateFormat(data, update, setFormatOption, customNumberFormatters, formatColumnApi);
|
|
379
378
|
}
|
|
380
379
|
if (Type === 'StringFormatter') {
|
|
381
|
-
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => displayFormatter.type === 'String');
|
|
382
380
|
return renderStringFormat(data, update, setFormatOption, customNumberFormatters, formatColumnApi);
|
|
383
381
|
}
|
|
384
382
|
return (React.createElement(HelpBlock_1.default, { margin: 3 },
|
|
@@ -43,7 +43,7 @@ export declare class LayoutEditorWizard extends React.Component<LayoutEditorWiza
|
|
|
43
43
|
Uuid?: string;
|
|
44
44
|
Source?: "Config" | "User";
|
|
45
45
|
IsReadOnly?: boolean;
|
|
46
|
-
Tags?:
|
|
46
|
+
Tags?: string[];
|
|
47
47
|
};
|
|
48
48
|
canNext(): boolean;
|
|
49
49
|
canBack(): boolean;
|
|
@@ -3,7 +3,7 @@ import * as SmartEditRedux from '../../Redux/ActionsReducers/SmartEditRedux';
|
|
|
3
3
|
import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
4
4
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
5
5
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
6
|
-
import { SmartEditOperation } from '../../AdaptableOptions/
|
|
6
|
+
import { SmartEditOperation } from '../../AdaptableOptions/EditOptions';
|
|
7
7
|
interface SmartEditPopupProps extends ModuleViewPopupProps<SmartEditPopupComponent> {
|
|
8
8
|
SmartEditValue: number;
|
|
9
9
|
SmartEditOperation: SmartEditOperation;
|
|
@@ -27,7 +27,6 @@ class SmartEditPopupComponent extends React.Component {
|
|
|
27
27
|
this.props.onSmartEditCheckSelectedCells();
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
var _a, _b, _c;
|
|
31
30
|
let col;
|
|
32
31
|
if (this.props.PreviewInfo) {
|
|
33
32
|
col = this.props.PreviewInfo.column;
|
|
@@ -43,7 +42,7 @@ class SmartEditPopupComponent extends React.Component {
|
|
|
43
42
|
},
|
|
44
43
|
};
|
|
45
44
|
});
|
|
46
|
-
const customOperations =
|
|
45
|
+
const customOperations = this.props.api.smartEditApi.getSmartEditCustomOperations();
|
|
47
46
|
if (customOperations === null || customOperations === void 0 ? void 0 : customOperations.length) {
|
|
48
47
|
operationMenuItems.push(...customOperations.map((operation) => {
|
|
49
48
|
return {
|
|
@@ -3,7 +3,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
3
3
|
import * as SmartEditRedux from '../../Redux/ActionsReducers/SmartEditRedux';
|
|
4
4
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { SmartEditOperation } from '../../AdaptableOptions/
|
|
6
|
+
import { SmartEditOperation } from '../../AdaptableOptions/EditOptions';
|
|
7
7
|
export interface SmartEditViewPanelComponentProps extends ViewPanelProps {
|
|
8
8
|
SmartEditValue: number | undefined;
|
|
9
9
|
SmartEditOperation: SmartEditOperation | undefined;
|
|
@@ -39,7 +39,6 @@ class SmartEditViewPanelComponent extends React.Component {
|
|
|
39
39
|
(_a = this.cleanupEvent) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
var _a, _b, _c;
|
|
43
42
|
let statusColour = this.getStatusColour();
|
|
44
43
|
let selectedColumn = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.state.SelectedColumnId)
|
|
45
44
|
? this.props.api.columnApi.getColumnFromId(this.state.SelectedColumnId)
|
|
@@ -51,7 +50,7 @@ class SmartEditViewPanelComponent extends React.Component {
|
|
|
51
50
|
label: mathOperation,
|
|
52
51
|
};
|
|
53
52
|
});
|
|
54
|
-
const customOperations =
|
|
53
|
+
const customOperations = this.props.api.smartEditApi.getSmartEditCustomOperations();
|
|
55
54
|
if (customOperations === null || customOperations === void 0 ? void 0 : customOperations.length) {
|
|
56
55
|
operationMenuItems.push(...customOperations.map((operation) => {
|
|
57
56
|
return {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/all-modules';
|
|
2
|
+
import { ActionColumn } from '../AdaptableOptions/UserInterfaceOptions';
|
|
3
|
+
interface ActionColumnCellRendererParams extends ICellRendererParams {
|
|
4
|
+
actionColumn?: ActionColumn;
|
|
5
|
+
}
|
|
2
6
|
export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
3
7
|
private eGui;
|
|
4
8
|
private eventListener;
|
|
5
|
-
init(params:
|
|
9
|
+
init(params: ActionColumnCellRendererParams): void;
|
|
6
10
|
render(): void;
|
|
7
11
|
getGui(): HTMLElement;
|
|
8
12
|
refresh(params: ICellRendererParams): boolean;
|
|
9
13
|
destroy(): void;
|
|
10
14
|
}
|
|
15
|
+
export {};
|
|
@@ -11,8 +11,10 @@ class ActionColumnRenderer {
|
|
|
11
11
|
init(params) {
|
|
12
12
|
var _a;
|
|
13
13
|
const adaptable = params.api.__adaptable;
|
|
14
|
-
const actionCol =
|
|
15
|
-
|
|
14
|
+
const actionCol = params.actionColumn
|
|
15
|
+
? params.actionColumn
|
|
16
|
+
: (_a = adaptable.api.userInterfaceApi
|
|
17
|
+
.getAllActionColumn()) === null || _a === void 0 ? void 0 : _a.find((ac) => ac.columnId == params.colDef.colId);
|
|
16
18
|
if (actionCol && actionCol.actionColumnButton) {
|
|
17
19
|
let actionButtons = Array.isArray(actionCol.actionColumnButton)
|
|
18
20
|
? actionCol.actionColumnButton
|
|
@@ -38,7 +40,7 @@ class ActionColumnRenderer {
|
|
|
38
40
|
adaptableApi: adaptable.api,
|
|
39
41
|
};
|
|
40
42
|
const renderActionButtons = (buttons, adaptableApi, context) => {
|
|
41
|
-
return (React.createElement(React.Fragment, null, buttons.map((button) => {
|
|
43
|
+
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
42
44
|
var _a, _b;
|
|
43
45
|
if (button.hidden && button.hidden(button, context)) {
|
|
44
46
|
return;
|
|
@@ -63,7 +65,7 @@ class ActionColumnRenderer {
|
|
|
63
65
|
}, 16);
|
|
64
66
|
};
|
|
65
67
|
const disabled = button.disabled && button.disabled(button, context);
|
|
66
|
-
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
|
|
68
|
+
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
|
|
67
69
|
button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
68
70
|
buttonLabel));
|
|
69
71
|
})));
|
|
@@ -36,6 +36,7 @@ import { ColumnSetupInfo } from './ColumnSetupInfo';
|
|
|
36
36
|
import { CustomSort } from '../PredefinedConfig/CustomSortState';
|
|
37
37
|
import { ColumnValuesComparer } from '../AdaptableOptions/GeneralOptions';
|
|
38
38
|
import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelService';
|
|
39
|
+
import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService';
|
|
39
40
|
declare type RuntimeConfig = {
|
|
40
41
|
waitForAgGrid?: boolean;
|
|
41
42
|
modules?: Module[];
|
|
@@ -55,6 +56,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
55
56
|
AlertService: IAlertService;
|
|
56
57
|
TeamSharingService: ITeamSharingService;
|
|
57
58
|
MetamodelService: IMetamodelService;
|
|
59
|
+
RowEditService: IRowEditService;
|
|
58
60
|
private LicenseService;
|
|
59
61
|
embedColumnMenu: boolean;
|
|
60
62
|
gridOptions: GridOptions;
|
|
@@ -243,6 +245,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
243
245
|
}[];
|
|
244
246
|
setupColumnValueGetter({ col }: ColumnSetupInfo): void;
|
|
245
247
|
setupColumnAggFunc({ col }: ColumnSetupInfo): void;
|
|
248
|
+
private getColDefsForRowEditColumns;
|
|
246
249
|
getColDefsForActionColumns(): ColDef[];
|
|
247
250
|
updateColDefsForSpecialColumns(): void;
|
|
248
251
|
private cleanupFloatingFilters_WORKAROUND;
|