@adaptabletools/adaptable 18.0.0-canary.12 → 18.0.0-canary.13
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 +1 -1
- package/base.css.map +1 -1
- package/index.css +1 -1
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -53
- package/src/AdaptableOptions/MenuOptions.js +3 -3
- package/src/Api/AdaptableApi.d.ts +2 -2
- package/src/Api/ConfigApi.d.ts +2 -3
- package/src/Api/GridApi.d.ts +2 -1
- package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
- package/src/Api/Implementation/ConfigApiImpl.js +7 -7
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
- package/src/Api/Implementation/GridApiImpl.js +8 -1
- package/src/Api/Implementation/NoteApiImpl.d.ts +2 -2
- package/src/Api/Implementation/NoteApiImpl.js +8 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
- package/src/Api/Internal/ActionRowInternalApi.js +1 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -2
- package/src/Api/Internal/AdaptableInternalApi.js +11 -11
- package/src/Api/Internal/CalculatedColumnInternalApi.js +3 -2
- package/src/Api/Internal/Fdc3InternalApi.js +2 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.js +3 -2
- package/src/Api/Internal/GridInternalApi.d.ts +2 -0
- package/src/Api/Internal/GridInternalApi.js +15 -0
- package/src/Api/NoteApi.d.ts +5 -5
- package/src/Api/OptionsApi.d.ts +2 -2
- package/src/Api/UserInterfaceApi.d.ts +0 -11
- package/src/PredefinedConfig/AdaptableState.d.ts +1 -1
- package/src/PredefinedConfig/CommentState.d.ts +16 -12
- package/src/PredefinedConfig/Common/TransposeConfig.d.ts +6 -0
- package/src/PredefinedConfig/Common/TransposeConfig.js +1 -0
- package/src/PredefinedConfig/Common/Types.d.ts +4 -4
- package/src/PredefinedConfig/Common/Types.js +4 -1
- package/src/PredefinedConfig/NoteState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
- package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +20 -20
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
- package/src/Redux/Store/AdaptableStore.js +7 -7
- package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +1 -5
- package/src/Strategy/{CommentsModule.js → CommentModule.js} +5 -6
- package/src/Strategy/LayoutModule.d.ts +1 -0
- package/src/Strategy/LayoutModule.js +17 -1
- package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
- package/src/Strategy/{NotesModule.js → NoteModule.js} +7 -3
- package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +6 -6
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +10 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
- package/src/Utilities/ObjectFactory.d.ts +3 -3
- package/src/Utilities/ObjectFactory.js +4 -24
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +1 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +12 -10
- package/src/Utilities/Services/CellPopupService.js +2 -2
- package/src/Utilities/Services/ModuleService.js +4 -0
- package/src/Utilities/Services/QueryLanguageService.js +2 -2
- package/src/Utilities/Services/SummaryService.d.ts +1 -1
- package/src/Utilities/adaptableQlUtils.d.ts +2 -0
- package/src/Utilities/adaptableQlUtils.js +14 -0
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Comments/CommentsPopup.js +8 -4
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +5 -5
- package/src/View/Components/ValueSelector/index.d.ts +1 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
- package/src/View/Layout/TransposedPopup.js +19 -18
- package/src/View/Layout/Wizard/LayoutWizard.js +8 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +140 -0
- package/src/View/Note/NotePopup.d.ts +2 -0
- package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +3 -3
- package/src/agGrid/AdaptableAgGrid.js +4 -4
- package/src/agGrid/AgGridAdapter.d.ts +1 -0
- package/src/agGrid/AgGridAdapter.js +5 -0
- package/src/agGrid/AgGridColumnAdapter.js +3 -3
- package/src/agGrid/defaultAdaptableOptions.js +0 -7
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -14
- package/src/components/icons/note.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +36 -11
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/parser.js +117 -1257
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
- package/src/parser/src/types.d.ts +2 -2
- package/src/types.d.ts +1 -0
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
- package/src/View/Notes/NotesPopup.d.ts +0 -2
- /package/src/Api/Internal/{NotesInternalApi.d.ts → NoteInternalApi.d.ts} +0 -0
- /package/src/Api/Internal/{NotesInternalApi.js → NoteInternalApi.js} +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
|
@@ -18,7 +18,7 @@ export function CreateAdaptableComment(text, api) {
|
|
|
18
18
|
};
|
|
19
19
|
return comment;
|
|
20
20
|
}
|
|
21
|
-
export function CreateEmptyCalculatedColumn() {
|
|
21
|
+
export function CreateEmptyCalculatedColumn(defaultSpecialColumnSettings) {
|
|
22
22
|
return {
|
|
23
23
|
Uuid: createUuid(),
|
|
24
24
|
ColumnId: EMPTY_STRING,
|
|
@@ -26,17 +26,7 @@ export function CreateEmptyCalculatedColumn() {
|
|
|
26
26
|
ScalarExpression: EMPTY_STRING,
|
|
27
27
|
},
|
|
28
28
|
// need to create some defaults - which we will change later
|
|
29
|
-
CalculatedColumnSettings: {
|
|
30
|
-
DataType: undefined,
|
|
31
|
-
Filterable: true,
|
|
32
|
-
Resizable: true,
|
|
33
|
-
Groupable: false,
|
|
34
|
-
Sortable: true,
|
|
35
|
-
Pivotable: false,
|
|
36
|
-
Aggregatable: false,
|
|
37
|
-
SuppressMenu: false,
|
|
38
|
-
SuppressMovable: false,
|
|
39
|
-
},
|
|
29
|
+
CalculatedColumnSettings: Object.assign(Object.assign({}, defaultSpecialColumnSettings), { DataType: undefined }),
|
|
40
30
|
};
|
|
41
31
|
}
|
|
42
32
|
export function CreateEmptyNamedQuery(expression) {
|
|
@@ -245,24 +235,14 @@ export function CreateEmptyFormatColumn() {
|
|
|
245
235
|
CellAlignment: undefined,
|
|
246
236
|
};
|
|
247
237
|
}
|
|
248
|
-
export function CreateEmptyFreeTextColumn() {
|
|
238
|
+
export function CreateEmptyFreeTextColumn(defaultSpecialColumnSettings) {
|
|
249
239
|
return {
|
|
250
240
|
Uuid: createUuid(),
|
|
251
241
|
ColumnId: EMPTY_STRING,
|
|
252
242
|
DefaultValue: EMPTY_STRING,
|
|
253
243
|
FreeTextStoredValues: [],
|
|
254
244
|
TextEditor: 'Inline',
|
|
255
|
-
FreeTextColumnSettings: {
|
|
256
|
-
DataType: 'String',
|
|
257
|
-
Filterable: true,
|
|
258
|
-
Resizable: true,
|
|
259
|
-
Groupable: false,
|
|
260
|
-
Sortable: true,
|
|
261
|
-
Pivotable: false,
|
|
262
|
-
Aggregatable: false,
|
|
263
|
-
SuppressMenu: false,
|
|
264
|
-
SuppressMovable: false,
|
|
265
|
-
},
|
|
245
|
+
FreeTextColumnSettings: Object.assign(Object.assign({}, defaultSpecialColumnSettings), { DataType: 'String' }),
|
|
266
246
|
};
|
|
267
247
|
}
|
|
268
248
|
export function CreateEmptyLayout(layout, adaptableColumns) {
|
|
@@ -60,7 +60,7 @@ export class AggregatedScalarLiveValue {
|
|
|
60
60
|
var _a, _b;
|
|
61
61
|
if ((_a = this.expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.length) {
|
|
62
62
|
const groupColumns = this.expressionEvaluation.aggregationParams.groupBy.map((groupByParam) => groupByParam.field);
|
|
63
|
-
const groupKeys = groupColumns.map((groupColumnName) => this.
|
|
63
|
+
const groupKeys = groupColumns.map((groupColumnName) => this.getRowNodeValueForColumnId(rowNode, groupColumnName));
|
|
64
64
|
return (_b = this.aggregationResult.deepMap.get(groupKeys)) === null || _b === void 0 ? void 0 : _b.reducerResults[this.aggregationReducerName];
|
|
65
65
|
}
|
|
66
66
|
return this.getGlobalAggregatedValue();
|
|
@@ -68,6 +68,11 @@ export class AggregatedScalarLiveValue {
|
|
|
68
68
|
getGlobalAggregatedValue() {
|
|
69
69
|
return this.aggregationResult.reducerResults[this.aggregationReducerName];
|
|
70
70
|
}
|
|
71
|
+
getRowNodeValueForColumnId(rowNode, columnId) {
|
|
72
|
+
const rawValue = this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
73
|
+
// we need to convert the Date object to a number, otherwise the grouping will not work (each Date instance is unique)
|
|
74
|
+
return rawValue instanceof Date ? rawValue.getTime() : rawValue;
|
|
75
|
+
}
|
|
71
76
|
computeAggregatedValue(expressionEvaluation) {
|
|
72
77
|
var _a;
|
|
73
78
|
const gridRowNodes = expressionEvaluation.getRowNodes
|
|
@@ -77,18 +82,16 @@ export class AggregatedScalarLiveValue {
|
|
|
77
82
|
});
|
|
78
83
|
// we iterate over the RowNode list (we need this to handle complex column values (nested values, valueGetters etc)
|
|
79
84
|
// so we will map the fieldNames to RowNode.data
|
|
80
|
-
const mapReducerValueGetter = (
|
|
81
|
-
return (rowNode) =>
|
|
82
|
-
return this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, fieldName);
|
|
83
|
-
};
|
|
85
|
+
const mapReducerValueGetter = (columnId) => {
|
|
86
|
+
return (rowNode) => this.getRowNodeValueForColumnId(rowNode, columnId);
|
|
84
87
|
};
|
|
85
88
|
Object.values(expressionEvaluation.aggregationParams.reducers).forEach((aggregationReducer) => {
|
|
86
89
|
aggregationReducer.getter = mapReducerValueGetter(aggregationReducer.field);
|
|
87
90
|
// nullify the field to force the fallback on the getter fn
|
|
88
91
|
aggregationReducer.field = null;
|
|
89
92
|
});
|
|
90
|
-
const mapGroupByToKey = (
|
|
91
|
-
return (_unusableProperty, rowNode) => this.
|
|
93
|
+
const mapGroupByToKey = (columnId) => {
|
|
94
|
+
return (_unusableProperty, rowNode) => this.getRowNodeValueForColumnId(rowNode, columnId);
|
|
92
95
|
};
|
|
93
96
|
(_a = expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.forEach((groupByDef) => {
|
|
94
97
|
groupByDef.toKey = mapGroupByToKey(groupByDef.field);
|
|
@@ -96,11 +99,10 @@ export class AggregatedScalarLiveValue {
|
|
|
96
99
|
let aggregatedRowNodes = gridRowNodes;
|
|
97
100
|
if (expressionEvaluation.sortByColumn) {
|
|
98
101
|
const sortByColumn = expressionEvaluation.sortByColumn;
|
|
99
|
-
const getRowNodeValue = (rowNode, columnId) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
100
102
|
// currently, we support only ascending sorting
|
|
101
103
|
aggregatedRowNodes.sort((first, second) => {
|
|
102
|
-
const firstValue =
|
|
103
|
-
const secondValue =
|
|
104
|
+
const firstValue = this.getRowNodeValueForColumnId(first, sortByColumn);
|
|
105
|
+
const secondValue = this.getRowNodeValueForColumnId(second, sortByColumn);
|
|
104
106
|
if (firstValue < secondValue) {
|
|
105
107
|
return -1;
|
|
106
108
|
}
|
|
@@ -74,7 +74,7 @@ export class CellPopupService {
|
|
|
74
74
|
this.hidePopup();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
const cellNotes = this.adaptable.api.noteApi.
|
|
77
|
+
const cellNotes = this.adaptable.api.noteApi.getNotesForCell(cellPosition);
|
|
78
78
|
const cellComments = this.adaptable.api.commentApi.getCommentThread(cellPosition);
|
|
79
79
|
const hasNotesOrComments = (cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length) || cellComments;
|
|
80
80
|
// call only if it is different
|
|
@@ -92,7 +92,7 @@ export class CellPopupService {
|
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
// if open but this has no note, close
|
|
95
|
-
const cellNotes = this.adaptable.api.noteApi.
|
|
95
|
+
const cellNotes = this.adaptable.api.noteApi.getNotesForCell(cellAddress);
|
|
96
96
|
const cellComments = this.adaptable.api.commentApi.getCommentThread(cellAddress);
|
|
97
97
|
const hasNotesOrComments = (cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length) || cellComments;
|
|
98
98
|
if (openCellAddress && !hasNotesOrComments) {
|
|
@@ -101,6 +101,8 @@ export class ModuleService {
|
|
|
101
101
|
return learnUrl + 'handbook-exporting';
|
|
102
102
|
case 'ColumnFilter':
|
|
103
103
|
return learnUrl + 'handbook-column-filter';
|
|
104
|
+
case 'Comment':
|
|
105
|
+
return learnUrl + 'handbook-comments';
|
|
104
106
|
case 'GridFilter':
|
|
105
107
|
return learnUrl + 'handbook-grid-filter';
|
|
106
108
|
case 'FlashingCell':
|
|
@@ -113,6 +115,8 @@ export class ModuleService {
|
|
|
113
115
|
return learnUrl + 'handbook-monitoring-grid-info';
|
|
114
116
|
case 'Layout':
|
|
115
117
|
return learnUrl + 'handbook-layouts';
|
|
118
|
+
case 'Note':
|
|
119
|
+
return learnUrl + 'handbook-notes';
|
|
116
120
|
case 'PlusMinus':
|
|
117
121
|
return learnUrl + 'handbook-editing-plus-minus';
|
|
118
122
|
case 'NamedQuery':
|
|
@@ -48,7 +48,7 @@ export class QueryLanguageService {
|
|
|
48
48
|
const moduleExpressionFunctions = this.getModuleExpressionFunctionsMap(module);
|
|
49
49
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
50
50
|
const reactiveExpression$ = parser.evaluate(reactiveExpression, {
|
|
51
|
-
node:
|
|
51
|
+
node: this.adaptableApi.gridApi.getFirstRowNode(),
|
|
52
52
|
adaptableApi: this.adaptableApi,
|
|
53
53
|
userName: this.adaptableApi.optionsApi.getUserName(),
|
|
54
54
|
adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
|
|
@@ -62,7 +62,7 @@ export class QueryLanguageService {
|
|
|
62
62
|
const moduleExpressionFunctionsMap = this.getModuleExpressionFunctionsMap(module);
|
|
63
63
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctionsMap);
|
|
64
64
|
const aggregationEvaluation = parser.evaluate(aggregationExpression, {
|
|
65
|
-
node:
|
|
65
|
+
node: this.adaptableApi.gridApi.getFirstRowNode(),
|
|
66
66
|
adaptableApi: this.adaptableApi,
|
|
67
67
|
userName: this.adaptableApi.optionsApi.getUserName(),
|
|
68
68
|
adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IRowNode } from '@ag-grid-community/core';
|
|
2
|
-
import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
|
|
3
2
|
import { AdaptableApi, AdaptableModule } from '../../types';
|
|
3
|
+
import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
|
|
4
4
|
export declare const summarySupportedExpressions: readonly ["SUM", "AVG", "MIN", "MAX", "COUNT", "MEDIAN", "MODE", "DISTINCT", "ONLY", "STD_DEVIATION"];
|
|
5
5
|
export type SummarySupportedExpression = (typeof summarySupportedExpressions)[number];
|
|
6
6
|
export type SumaryConfig = {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const mapColumnDataTypeToExpressionFunctionType = (dataType) => {
|
|
2
|
+
if (dataType === 'Number') {
|
|
3
|
+
return 'number';
|
|
4
|
+
}
|
|
5
|
+
if (dataType === 'Boolean') {
|
|
6
|
+
return 'boolean';
|
|
7
|
+
}
|
|
8
|
+
if (dataType === 'String') {
|
|
9
|
+
return 'text';
|
|
10
|
+
}
|
|
11
|
+
if (dataType === 'Date') {
|
|
12
|
+
return 'date';
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -29,7 +29,7 @@ import { StatusBarPopup } from './StatusBar/StatusBarPopup';
|
|
|
29
29
|
import { ChartingViewPanel } from './Charting/ChartingViewPanel';
|
|
30
30
|
import { GridFilterPopup } from './GridFilter/GridFilterPopup';
|
|
31
31
|
import { ColumnInfoPopup } from './ColumnInfo/ColumnInfoPopup';
|
|
32
|
-
import {
|
|
32
|
+
import { NotePopup } from './Note/NotePopup';
|
|
33
33
|
import { CommentsPopup } from './Comments/CommentsPopup';
|
|
34
34
|
import { DataImportPopup } from './DataImport/DataImportPopup';
|
|
35
35
|
export const AdaptableViewFactory = {
|
|
@@ -46,7 +46,7 @@ export const AdaptableViewFactory = {
|
|
|
46
46
|
ToolPanelPopup,
|
|
47
47
|
SystemStatusPopup,
|
|
48
48
|
DataChangeHistoryPopup,
|
|
49
|
-
|
|
49
|
+
NotePopup,
|
|
50
50
|
CommentsPopup,
|
|
51
51
|
DataImportPopup,
|
|
52
52
|
GridFilterPopup,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CalculatedColumn } from '../../../types';
|
|
3
3
|
import { AdaptableOnePageWizardProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
4
4
|
export declare const calculatedColumnTypes: readonly ["ScalarExpression", "AggregatedScalarExpression", "CumulativeAggregatedExpression", "QuantileAggregatedExpression"];
|
|
5
|
-
export type ExpressionType =
|
|
5
|
+
export type ExpressionType = typeof calculatedColumnTypes[number];
|
|
6
6
|
export interface CalculatedColumnWizardProps extends AdaptableOnePageWizardProps<CalculatedColumn> {
|
|
7
7
|
}
|
|
8
8
|
export declare const CalculatedColumnWizard: (props: CalculatedColumnWizardProps) => JSX.Element;
|
|
@@ -36,7 +36,7 @@ export const CalculatedColumnWizard = (props) => {
|
|
|
36
36
|
return cloneObject(calculatedColumn);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
return ObjectFactory.CreateEmptyCalculatedColumn();
|
|
39
|
+
return ObjectFactory.CreateEmptyCalculatedColumn(adaptable.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
|
|
40
40
|
});
|
|
41
41
|
const dispatch = useDispatch();
|
|
42
42
|
const isEdit = Boolean(props.data) || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
@@ -85,7 +85,7 @@ export const CommentsEditor = (props) => {
|
|
|
85
85
|
}
|
|
86
86
|
}, mt: 2, mb: "2", width: "100%", placeholder: "Write new comment" }),
|
|
87
87
|
React.createElement(SimpleButton, { width: "100%", variant: "raised", onClick: () => {
|
|
88
|
-
adaptable.api.settingsPanelApi.openSettingsPanel('
|
|
88
|
+
adaptable.api.settingsPanelApi.openSettingsPanel('Comment');
|
|
89
89
|
adaptable.api.internalApi.getCellPopupService().hidePopup();
|
|
90
90
|
} },
|
|
91
91
|
React.createElement(Box, { mr: 2 },
|
|
@@ -45,14 +45,18 @@ const CellComments = (props) => {
|
|
|
45
45
|
const columnFriendlyName = adaptable.api.columnApi.getFriendlyNameForColumnId(props.commentThread.ColumnId);
|
|
46
46
|
return (React.createElement(Panel, { mb: 2, header: React.createElement(Flex, { width: "100%", alignItems: "center" },
|
|
47
47
|
React.createElement(Box, { mr: 2 },
|
|
48
|
-
"Cell Value:
|
|
48
|
+
React.createElement("b", null, "Cell Value:"),
|
|
49
|
+
" ",
|
|
49
50
|
cellValue),
|
|
50
51
|
React.createElement(Box, { mr: 2 },
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
React.createElement("b", null,
|
|
53
|
+
primaryKeyHeader,
|
|
54
|
+
":"),
|
|
55
|
+
" ",
|
|
53
56
|
props.commentThread.PrimaryKeyValue),
|
|
54
57
|
React.createElement(Box, null,
|
|
55
|
-
"Column:
|
|
58
|
+
React.createElement("b", null, "Column:"),
|
|
59
|
+
" ",
|
|
56
60
|
columnFriendlyName),
|
|
57
61
|
React.createElement(Box, { flex: 1 }),
|
|
58
62
|
React.createElement(AdaptableButtonComponent, { mr: 1, variant: "text", icon: "visibility-on", onClick: () => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { Flex } from 'rebass';
|
|
4
|
-
import { GetNotesSelector } from '../../../../Redux/ActionsReducers/
|
|
4
|
+
import { GetNotesSelector } from '../../../../Redux/ActionsReducers/NoteRedux';
|
|
5
5
|
import { SystemCommentsAndNotesEditModeSelector, SystemCommentsAndNotesFocusedEntitySelector, SystemCommentsAndNotesSelector, } from '../../../../Redux/ActionsReducers/SystemRedux';
|
|
6
6
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
7
7
|
import { CommentsEditor } from '../../../Comments/CommentsEditor';
|
|
8
|
-
import { NoteEditor } from '../../../
|
|
8
|
+
import { NoteEditor } from '../../../Note/NoteEditor';
|
|
9
9
|
import { CellPopup } from '../../CellPopup';
|
|
10
10
|
const ConnectedNoteEditor = ({ enableEditMode }) => {
|
|
11
11
|
const { api } = useAdaptable();
|
|
12
|
-
const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('
|
|
12
|
+
const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('Note');
|
|
13
13
|
const editMode = useSelector((state) => SystemCommentsAndNotesEditModeSelector(state.System));
|
|
14
14
|
const cellPopupService = api.internalApi.getCellPopupService();
|
|
15
15
|
const cellAddress = useSelector((state) => SystemCommentsAndNotesSelector(state.System));
|
|
@@ -17,12 +17,12 @@ const ConnectedNoteEditor = ({ enableEditMode }) => {
|
|
|
17
17
|
// Only handle first note for now
|
|
18
18
|
// Later we can handle multiple notes
|
|
19
19
|
note,] = useSelector((state) => {
|
|
20
|
-
return cellAddress ? GetNotesSelector(state.
|
|
20
|
+
return cellAddress ? GetNotesSelector(state.Note, cellAddress) : [];
|
|
21
21
|
});
|
|
22
22
|
const handleNoteChange = React.useCallback((value) => {
|
|
23
23
|
api.noteApi.updateNoteText(value, note);
|
|
24
24
|
}, [note]);
|
|
25
|
-
return (React.createElement(Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-
|
|
25
|
+
return (React.createElement(Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotePopup" },
|
|
26
26
|
React.createElement(NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => cellPopupService.hidePopup(), note: note === null || note === void 0 ? void 0 : note.Text, onNoteChange: (value) => handleNoteChange(value) })));
|
|
27
27
|
};
|
|
28
28
|
export const GridCellPopup = (props) => {
|
|
@@ -26,6 +26,7 @@ export type ValueSelectorProps<OPTION_TYPE, ID_TYPE extends number | string> = {
|
|
|
26
26
|
onShowSelectedOnlyChange?: (selectedOnly: boolean) => void;
|
|
27
27
|
isOptionDisabled?: (option: OPTION_TYPE) => boolean;
|
|
28
28
|
disabled?: boolean;
|
|
29
|
+
style?: React.CSSProperties;
|
|
29
30
|
};
|
|
30
31
|
export declare function ValueSelector<OPTION_TYPE, ID_TYPE extends number | string>(props: ValueSelectorProps<OPTION_TYPE, ID_TYPE>): JSX.Element;
|
|
31
32
|
export declare namespace ValueSelector {
|
|
@@ -111,7 +111,7 @@ export function ValueSelector(props) {
|
|
|
111
111
|
};
|
|
112
112
|
const showOnlySelectedCheckbox = (React.createElement(CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show Selected Only'));
|
|
113
113
|
const showSelectedOnlyPosition = (_a = props.showSelectedOnlyPosition) !== null && _a !== void 0 ? _a : 'floating';
|
|
114
|
-
return (React.createElement(Flex, { className: baseClassName, flexDirection: "column", flex: 1 },
|
|
114
|
+
return (React.createElement(Flex, { style: props.style, className: baseClassName, flexDirection: "column", flex: 1 },
|
|
115
115
|
React.createElement(Flex, { mb: 1 },
|
|
116
116
|
showFilterInput && filter ? (React.createElement(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", style: { flex: 1, border: 0, margin: 3 } })) : (React.createElement(Box, { flex: 1 })),
|
|
117
117
|
showSelectedOnlyPosition === 'top' && React.createElement(Box, { ml: 20 }, showOnlySelectedCheckbox)),
|
|
@@ -45,7 +45,7 @@ export class FreeTextColumnSummaryComponent extends React.Component {
|
|
|
45
45
|
this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
|
|
46
46
|
}
|
|
47
47
|
onNew() {
|
|
48
|
-
let configEntity = ObjectFactory.CreateEmptyFreeTextColumn();
|
|
48
|
+
let configEntity = ObjectFactory.CreateEmptyFreeTextColumn(this.props.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
|
|
49
49
|
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
50
50
|
this.setState({
|
|
51
51
|
editedAdaptableObject: configEntity,
|
|
@@ -8,8 +8,10 @@ import ObjectFactory from '../../../Utilities/ObjectFactory';
|
|
|
8
8
|
import * as FreeTextColumnRedux from '../../../Redux/ActionsReducers/FreeTextColumnRedux';
|
|
9
9
|
import { useDispatch, useSelector } from 'react-redux';
|
|
10
10
|
import { ObjectTagsWizardSection, renderObjectTagsSummary, } from '../../Wizard/ObjectTagsWizardSection';
|
|
11
|
+
import { useAdaptable } from '../../AdaptableContext';
|
|
11
12
|
export const FreeTextColumnWizard = (props) => {
|
|
12
13
|
var _a;
|
|
14
|
+
const adaptable = useAdaptable();
|
|
13
15
|
const allFreeTextColumns = useSelector((state) => state.FreeTextColumn.FreeTextColumns);
|
|
14
16
|
const [freeTextColumn, setFreeTextColumn] = useState(() => {
|
|
15
17
|
var _a, _b;
|
|
@@ -19,7 +21,7 @@ export const FreeTextColumnWizard = (props) => {
|
|
|
19
21
|
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
|
|
20
22
|
return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
|
|
21
23
|
}
|
|
22
|
-
return ObjectFactory.CreateEmptyFreeTextColumn();
|
|
24
|
+
return ObjectFactory.CreateEmptyFreeTextColumn(adaptable.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
|
|
23
25
|
});
|
|
24
26
|
const dispatch = useDispatch();
|
|
25
27
|
const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
@@ -7,21 +7,21 @@ import { ColumnSelector } from '../Components/Selectors/ColumnSelector';
|
|
|
7
7
|
import { AdaptableAgGrid } from '../../agGrid/AdaptableAgGrid';
|
|
8
8
|
export const TransposedPopup = (props) => {
|
|
9
9
|
const adaptable = useAdaptable();
|
|
10
|
+
const { transposedColumnId, hideTransposedColumn, visibleColumns, visibleRows } = props.popupProps;
|
|
10
11
|
const rowNodes = React.useMemo(() => {
|
|
11
|
-
return
|
|
12
|
+
return props.popupProps.visibleRows
|
|
13
|
+
? adaptable.api.gridApi.getVisibleRowNodes()
|
|
14
|
+
: adaptable.api.gridApi.getAllRowNodes();
|
|
12
15
|
}, [
|
|
13
|
-
// can be later triggered by
|
|
16
|
+
// can be later triggered by tickng data
|
|
14
17
|
]);
|
|
15
|
-
const { transposedColumnId, hideTransposedColumn = true } = props.popupProps;
|
|
16
18
|
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
17
|
-
|
|
18
|
-
const transposeByColumnId = primaryKey;
|
|
19
|
-
// Only used to show nice values a the top of the grid, istead on the value
|
|
20
|
-
// of the primarykey
|
|
21
|
-
const [synteticTransposedByColumnId, setSynteticTransposedByColumnId] = React.useState(transposedColumnId !== null && transposedColumnId !== void 0 ? transposedColumnId : primaryKey);
|
|
19
|
+
const [syntheticTransposedByColumnId, setSyntheticTransposedByColumnId] = React.useState(transposedColumnId);
|
|
22
20
|
const columns = React.useMemo(() => {
|
|
23
21
|
// customisable
|
|
24
|
-
return
|
|
22
|
+
return visibleColumns
|
|
23
|
+
? adaptable.api.columnApi.getVisibleColumns()
|
|
24
|
+
: adaptable.api.columnApi.getColumns();
|
|
25
25
|
}, []);
|
|
26
26
|
const adaptableContainerId = 'transposed-adaptable-container';
|
|
27
27
|
const agGridContainerId = 'transposed-adaptable-ag-grid-container';
|
|
@@ -40,9 +40,10 @@ export const TransposedPopup = (props) => {
|
|
|
40
40
|
for (const row of rowNodes) {
|
|
41
41
|
// we force the col-ids to be strings, easer to work with
|
|
42
42
|
//row[transposeByColumnId] + '';
|
|
43
|
-
const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row,
|
|
43
|
+
const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, primaryKey) + '';
|
|
44
44
|
//row[synteticTransposedByColumnId] + '';
|
|
45
|
-
const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row,
|
|
45
|
+
const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, syntheticTransposedByColumnId) +
|
|
46
|
+
'';
|
|
46
47
|
transposedColumns.push({
|
|
47
48
|
colId,
|
|
48
49
|
header,
|
|
@@ -52,7 +53,7 @@ export const TransposedPopup = (props) => {
|
|
|
52
53
|
/**
|
|
53
54
|
* We can hide the transposed column, if we want
|
|
54
55
|
*/
|
|
55
|
-
if (hideTransposedColumn && column.columnId ===
|
|
56
|
+
if (hideTransposedColumn && column.columnId === syntheticTransposedByColumnId) {
|
|
56
57
|
continue;
|
|
57
58
|
}
|
|
58
59
|
const transposedRow = {
|
|
@@ -63,7 +64,7 @@ export const TransposedPopup = (props) => {
|
|
|
63
64
|
};
|
|
64
65
|
for (let row of rowNodes) {
|
|
65
66
|
// [transposed-by-column-value[n]]: [other column value[n]]
|
|
66
|
-
const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row,
|
|
67
|
+
const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, primaryKey);
|
|
67
68
|
// row[column.field]
|
|
68
69
|
let value = adaptable.api.gridApi.getDisplayValueFromRowNode(row, column.columnId);
|
|
69
70
|
if (value instanceof Date) {
|
|
@@ -77,7 +78,7 @@ export const TransposedPopup = (props) => {
|
|
|
77
78
|
transposedColumns,
|
|
78
79
|
transposedRows,
|
|
79
80
|
};
|
|
80
|
-
}, [rowNodes, primaryKey,
|
|
81
|
+
}, [rowNodes, primaryKey, syntheticTransposedByColumnId]);
|
|
81
82
|
React.useEffect(() => {
|
|
82
83
|
// Mounting in an effect, so the nodes are rendered/available
|
|
83
84
|
const hostAdaptableOptions = adaptable.adaptableOptions;
|
|
@@ -121,7 +122,7 @@ export const TransposedPopup = (props) => {
|
|
|
121
122
|
};
|
|
122
123
|
const firstColumn = {
|
|
123
124
|
field: transposedFirstColumnHeader,
|
|
124
|
-
headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(
|
|
125
|
+
headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(syntheticTransposedByColumnId),
|
|
125
126
|
};
|
|
126
127
|
const agGridOptions = {
|
|
127
128
|
suppressLoadingOverlay: true,
|
|
@@ -173,7 +174,7 @@ export const TransposedPopup = (props) => {
|
|
|
173
174
|
transposedAdaptableApi.destroy();
|
|
174
175
|
}
|
|
175
176
|
};
|
|
176
|
-
}, [
|
|
177
|
+
}, [syntheticTransposedByColumnId]);
|
|
177
178
|
/**
|
|
178
179
|
* Need to get all data, manualy pivot the grid using the primary key.
|
|
179
180
|
*
|
|
@@ -185,8 +186,8 @@ export const TransposedPopup = (props) => {
|
|
|
185
186
|
React.createElement(Panel, null,
|
|
186
187
|
React.createElement(FormLayout, null,
|
|
187
188
|
React.createElement(FormRow, { label: "Elevated Column" },
|
|
188
|
-
React.createElement(ColumnSelector, { value:
|
|
189
|
-
|
|
189
|
+
React.createElement(ColumnSelector, { value: syntheticTransposedByColumnId, onChange: (colId) => {
|
|
190
|
+
setSyntheticTransposedByColumnId(colId);
|
|
190
191
|
} })))),
|
|
191
192
|
React.createElement(Flex, { height: "100%" },
|
|
192
193
|
React.createElement(Box, { id: "transposed-adaptable-container" }),
|
|
@@ -14,6 +14,7 @@ import { AggregationsSection, AggregationsSectionSummary, isAggregationsSectionV
|
|
|
14
14
|
import { SortSection, SortSectionSummary } from './sections/SortSection';
|
|
15
15
|
import { FilterSection, FilterSectionSummary, isColumnFiltersValid, } from './sections/FilterSection';
|
|
16
16
|
import { GridFilterSection, GridFilterSectionSummary, isGridFiltersValid, } from './sections/GridFilterSection';
|
|
17
|
+
import { RowSummarySection } from './sections/RowSummarySection';
|
|
17
18
|
export const LayoutWizard = (props) => {
|
|
18
19
|
var _a, _b;
|
|
19
20
|
const dispatch = useDispatch();
|
|
@@ -107,6 +108,13 @@ export const LayoutWizard = (props) => {
|
|
|
107
108
|
render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
|
|
108
109
|
React.createElement(RowGroupingSection, { onChange: setLayout }))),
|
|
109
110
|
},
|
|
111
|
+
{
|
|
112
|
+
title: 'Row Summaries',
|
|
113
|
+
details: 'Configure Row Summaries',
|
|
114
|
+
renderSummary: () => React.createElement(RowGroupingSectionSummary, null),
|
|
115
|
+
render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
|
|
116
|
+
React.createElement(RowSummarySection, { onChange: setLayout }))),
|
|
117
|
+
},
|
|
110
118
|
{
|
|
111
119
|
title: 'Aggregations',
|
|
112
120
|
isVisible: () => layoutSupportedFeatures.AggregationColumns,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Layout } from '../../../../../types';
|
|
3
|
+
export declare const RowGroupingSectionSummary: React.FunctionComponent;
|
|
4
|
+
interface RowSummarySectionProps {
|
|
5
|
+
onChange: (data: Layout) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const RowSummarySection: React.FunctionComponent<RowSummarySectionProps>;
|
|
8
|
+
export {};
|