@adaptabletools/adaptable 12.1.5 → 12.1.8-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +11 -49
- package/bundle.cjs.js +106 -106
- package/index.css +13 -60
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +2 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +19 -0
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +22 -1
- package/src/AdaptableOptions/StateOptions.d.ts +25 -12
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +31 -24
- package/src/Api/ColumnApi.d.ts +6 -1
- package/src/Api/ExportApi.d.ts +5 -0
- package/src/Api/FilterApi.d.ts +29 -0
- package/src/Api/FlashingCellApi.d.ts +8 -0
- package/src/Api/GridApi.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +7 -2
- package/src/Api/Implementation/DataSetApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ExportApiImpl.js +19 -3
- package/src/Api/Implementation/FilterApiImpl.d.ts +6 -0
- package/src/Api/Implementation/FilterApiImpl.js +42 -4
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +4 -4
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +0 -3
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/PredicateApiImpl.js +4 -0
- package/src/Api/Implementation/QueryApiImpl.js +1 -1
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -1
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -1
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/Api/LayoutApi.d.ts +1 -1
- package/src/Api/SystemStatusApi.d.ts +1 -1
- package/src/Api/ToolPanelApi.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableColumn.js +3 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +30 -10
- package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +6 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +4 -0
- package/src/PredefinedConfig/Common/ColumnFilter.d.ts +2 -2
- package/src/PredefinedConfig/Common/Enums.d.ts +0 -15
- package/src/PredefinedConfig/Common/Enums.js +1 -18
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +6 -6
- package/src/PredefinedConfig/ExportState.d.ts +12 -4
- package/src/PredefinedConfig/LayoutState.d.ts +2 -1
- package/src/PredefinedConfig/PopupState.d.ts +1 -2
- package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/AlertRedux.js +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.js +1 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +1 -1
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +28 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +80 -2
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +1 -1
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +0 -2
- package/src/Redux/ActionsReducers/PopupRedux.js +1 -28
- package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/ScheduleRedux.js +5 -5
- package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ShortcutRedux.js +1 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -2
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -2
- package/src/Redux/Store/AdaptableStore.js +30 -16
- package/src/Strategy/AlertModule.d.ts +1 -0
- package/src/Strategy/AlertModule.js +20 -0
- package/src/Strategy/CalculatedColumnModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -1
- package/src/Strategy/ExportModule.js +0 -16
- package/src/Strategy/FilterModule.js +6 -0
- package/src/Strategy/FlashingCellModule.js +2 -2
- package/src/Strategy/Interface/IModule.d.ts +4 -0
- package/src/Strategy/LayoutModule.js +20 -20
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +16 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +15 -11
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +12 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +30 -66
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +22 -6
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +423 -220
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +7 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +23 -7
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +0 -1
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -54
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +17 -5
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -0
- package/src/Utilities/Helpers/CalendarHelper.js +10 -7
- package/src/Utilities/Helpers/DateHelper.d.ts +0 -26
- package/src/Utilities/Helpers/DateHelper.js +2 -32
- package/src/Utilities/Interface/MessagePopups.d.ts +0 -4
- package/src/Utilities/ObjectFactory.d.ts +6 -4
- package/src/Utilities/ObjectFactory.js +30 -17
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +25 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +103 -0
- package/src/Utilities/Services/AlertService.d.ts +0 -1
- package/src/Utilities/Services/AlertService.js +5 -17
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +4 -4
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +29 -154
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +6 -3
- package/src/Utilities/Services/QueryLanguageService.js +23 -6
- package/src/Utilities/Services/ReportService.js +47 -46
- package/src/View/AdaptableView.js +1 -2
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.d.ts +2 -0
- package/src/View/CalculatedColumn/Utilities/{getCalculatedColumnSettingTags.js → getCalculatedColumnSettingsTags.js} +5 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +80 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +21 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +1 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +10 -53
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +14 -3
- package/src/View/Components/AdaptableDateInput/index.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +42 -6
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/EntityRulesEditor/index.js +26 -5
- package/src/View/Components/FilterForm/FilterForm.js +10 -5
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -0
- package/src/View/Components/FilterForm/QuickFilterForm.js +12 -7
- package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.d.ts +9 -0
- package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.js +28 -0
- package/src/View/Components/PermittedValuesSelector/index.d.ts +1 -0
- package/src/View/Components/PermittedValuesSelector/index.js +5 -0
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +2 -2
- package/src/View/Components/Popups/AdaptableToaster.js +2 -7
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -4
- package/src/View/Export/ExportViewPanel.d.ts +1 -2
- package/src/View/Export/ExportViewPanel.js +2 -6
- package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +1 -2
- package/src/View/Export/Wizard/ReportColumnTypeWizard.js +11 -12
- package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +1 -2
- package/src/View/Export/Wizard/ReportRowTypeWizard.js +12 -13
- package/src/View/Export/Wizard/ReportSettingsWizard.js +1 -2
- package/src/View/Filter/FilterViewPanel.js +20 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +1 -1
- package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.d.ts +0 -0
- package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.js +0 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +1 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +69 -8
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Query/QueryViewPanel.js +1 -1
- package/src/agGrid/Adaptable.d.ts +12 -3
- package/src/agGrid/Adaptable.js +225 -152
- package/src/agGrid/agGridHelper.d.ts +1 -0
- package/src/agGrid/agGridHelper.js +5 -3
- package/src/agGrid/agGridMenuHelper.d.ts +1 -0
- package/src/agGrid/agGridMenuHelper.js +4 -2
- package/src/agGrid/weightedAverage.d.ts +6 -0
- package/src/agGrid/weightedAverage.js +66 -0
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -0
- package/src/components/ExpressionEditor/BaseEditorInput.js +2 -3
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +24 -4
- package/src/components/ExpressionEditor/{EditorInputReactive.d.ts → EditorInputWithWhereClause.d.ts} +3 -3
- package/src/components/ExpressionEditor/{EditorInputReactive.js → EditorInputWithWhereClause.js} +6 -5
- package/src/components/ExpressionEditor/editorButtonsAggregatedBoolean.d.ts +2 -0
- package/src/components/ExpressionEditor/{editorButtonsReactive.js → editorButtonsAggregatedBoolean.js} +22 -37
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +50 -0
- package/src/components/ExpressionEditor/editorButtonsObservable.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsObservable.js +40 -0
- package/src/components/ExpressionEditor/index.d.ts +1 -1
- package/src/components/ExpressionEditor/index.js +26 -5
- package/src/components/ProgressIndicator/ProgressIndicator.js +10 -12
- package/src/metamodel/adaptable.metamodel.d.ts +129 -7
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +1 -1
- package/src/types.d.ts +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.d.ts +0 -2
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +0 -3
- package/src/View/Layout/LayoutEditorStandalonePopup.js +0 -78
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.d.ts +0 -27
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +0 -86
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.d.ts +0 -16
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +0 -89
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.d.ts +0 -15
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +0 -70
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.d.ts +0 -15
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +0 -70
- package/src/View/Layout/Wizard/LayoutEditor/droppableIds.d.ts +0 -7
- package/src/View/Layout/Wizard/LayoutEditor/droppableIds.js +0 -11
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.d.ts +0 -6
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +0 -26
- package/src/View/Layout/Wizard/LayoutEditor/index.d.ts +0 -9
- package/src/View/Layout/Wizard/LayoutEditor/index.js +0 -367
- package/src/View/Layout/Wizard/LayoutEditor/reducer.d.ts +0 -28
- package/src/View/Layout/Wizard/LayoutEditor/reducer.js +0 -46
- package/src/View/Layout/Wizard/LayoutEditor/utils.d.ts +0 -10
- package/src/View/Layout/Wizard/LayoutEditor/utils.js +0 -14
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +0 -30
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +0 -132
- package/src/components/ExpressionEditor/editorButtonsReactive.d.ts +0 -2
|
@@ -21,8 +21,8 @@ class ReportService {
|
|
|
21
21
|
return {
|
|
22
22
|
Uuid: Uuid_1.createUuid(),
|
|
23
23
|
Name: GeneralConstants_1.VISUAL_DATA_REPORT,
|
|
24
|
-
ReportColumnScope:
|
|
25
|
-
ReportRowScope:
|
|
24
|
+
ReportColumnScope: 'VisibleColumns',
|
|
25
|
+
ReportRowScope: 'VisibleRows',
|
|
26
26
|
Query: undefined,
|
|
27
27
|
IsReadOnly: true,
|
|
28
28
|
};
|
|
@@ -30,8 +30,8 @@ class ReportService {
|
|
|
30
30
|
return {
|
|
31
31
|
Uuid: Uuid_1.createUuid(),
|
|
32
32
|
Name: GeneralConstants_1.ALL_DATA_REPORT,
|
|
33
|
-
ReportColumnScope:
|
|
34
|
-
ReportRowScope:
|
|
33
|
+
ReportColumnScope: 'AllColumns',
|
|
34
|
+
ReportRowScope: 'AllRows',
|
|
35
35
|
Query: undefined,
|
|
36
36
|
IsReadOnly: true,
|
|
37
37
|
};
|
|
@@ -39,8 +39,8 @@ class ReportService {
|
|
|
39
39
|
return {
|
|
40
40
|
Uuid: Uuid_1.createUuid(),
|
|
41
41
|
Name: GeneralConstants_1.CURRENT_DATA_REPORT,
|
|
42
|
-
ReportColumnScope:
|
|
43
|
-
ReportRowScope:
|
|
42
|
+
ReportColumnScope: 'VisibleColumns',
|
|
43
|
+
ReportRowScope: 'VisibleRows',
|
|
44
44
|
Query: undefined,
|
|
45
45
|
IsReadOnly: true,
|
|
46
46
|
};
|
|
@@ -48,8 +48,8 @@ class ReportService {
|
|
|
48
48
|
return {
|
|
49
49
|
Uuid: Uuid_1.createUuid(),
|
|
50
50
|
Name: GeneralConstants_1.SELECTED_CELLS_REPORT,
|
|
51
|
-
ReportColumnScope:
|
|
52
|
-
ReportRowScope:
|
|
51
|
+
ReportColumnScope: 'SelectedColumns',
|
|
52
|
+
ReportRowScope: 'SelectedCellRows',
|
|
53
53
|
Query: undefined,
|
|
54
54
|
IsReadOnly: true,
|
|
55
55
|
};
|
|
@@ -57,8 +57,8 @@ class ReportService {
|
|
|
57
57
|
return {
|
|
58
58
|
Uuid: Uuid_1.createUuid(),
|
|
59
59
|
Name: GeneralConstants_1.SELECTED_ROWS_REPORT,
|
|
60
|
-
ReportColumnScope:
|
|
61
|
-
ReportRowScope:
|
|
60
|
+
ReportColumnScope: 'VisibleColumns',
|
|
61
|
+
ReportRowScope: 'SelectedRows',
|
|
62
62
|
Query: undefined,
|
|
63
63
|
IsReadOnly: true,
|
|
64
64
|
};
|
|
@@ -91,38 +91,43 @@ class ReportService {
|
|
|
91
91
|
}
|
|
92
92
|
GetReportColumnScopeShortDescription(report) {
|
|
93
93
|
var _a, _b;
|
|
94
|
+
if (this.adaptableApi.exportApi.isCustomReport(report)) {
|
|
95
|
+
return ['[Custom Columns]'];
|
|
96
|
+
}
|
|
94
97
|
switch (report.ReportColumnScope) {
|
|
95
|
-
case
|
|
98
|
+
case 'AllColumns':
|
|
96
99
|
return ['[All Columns]'];
|
|
97
|
-
case
|
|
100
|
+
case 'VisibleColumns':
|
|
98
101
|
return ['[Visible Columns]'];
|
|
99
|
-
case
|
|
102
|
+
case 'SelectedColumns':
|
|
100
103
|
return ['[Selected Columns]'];
|
|
101
|
-
case
|
|
104
|
+
case 'ScopeColumns':
|
|
102
105
|
if ('ColumnIds' in (report === null || report === void 0 ? void 0 : report.Scope)) {
|
|
103
106
|
return (_b = (_a = report.Scope.ColumnIds).map) === null || _b === void 0 ? void 0 : _b.call(_a, (columnId) => { var _a; return (_a = this.adaptableApi.columnApi.getFriendlyNameFromColumnId(columnId)) !== null && _a !== void 0 ? _a : columnId; });
|
|
104
107
|
}
|
|
105
108
|
return ['[Bespoke Columns]'];
|
|
106
|
-
case Enums_1.ReportColumnScope.CustomColumns:
|
|
107
|
-
return ['[Custom Columns]'];
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
GetReportColumnScopeLongDescription(report) {
|
|
112
|
+
if (this.adaptableApi.exportApi.isCustomReport(report)) {
|
|
113
|
+
return '[Custom Columns]';
|
|
114
|
+
}
|
|
111
115
|
switch (report.ReportColumnScope) {
|
|
112
|
-
case
|
|
116
|
+
case 'AllColumns':
|
|
113
117
|
return '[All Columns]';
|
|
114
|
-
case
|
|
118
|
+
case 'VisibleColumns':
|
|
115
119
|
return '[Visible Columns]';
|
|
116
|
-
case
|
|
120
|
+
case 'SelectedColumns':
|
|
117
121
|
return '[Selected Columns]';
|
|
118
|
-
case
|
|
122
|
+
case 'ScopeColumns':
|
|
119
123
|
return this.adaptableApi.scopeApi.getScopeDescription(report.Scope);
|
|
120
|
-
case Enums_1.ReportColumnScope.CustomColumns:
|
|
121
|
-
return '[Custom Columns]';
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
GetReportExpressionDescription(report, cols) {
|
|
125
127
|
var _a;
|
|
128
|
+
if (this.adaptableApi.exportApi.isCustomReport(report)) {
|
|
129
|
+
return '[Custom Data]';
|
|
130
|
+
}
|
|
126
131
|
if (this.IsSystemReport(report.Name)) {
|
|
127
132
|
if (report.Name == GeneralConstants_1.ALL_DATA_REPORT) {
|
|
128
133
|
return '[All Data]';
|
|
@@ -142,38 +147,39 @@ class ReportService {
|
|
|
142
147
|
}
|
|
143
148
|
else {
|
|
144
149
|
switch (report.ReportRowScope) {
|
|
145
|
-
case
|
|
150
|
+
case 'AllRows':
|
|
146
151
|
return '[All Rows]';
|
|
147
|
-
case
|
|
152
|
+
case 'VisibleRows':
|
|
148
153
|
return '[Visible Rows]';
|
|
149
|
-
case
|
|
154
|
+
case 'SelectedRows':
|
|
150
155
|
return '[Selected Rows]';
|
|
151
|
-
case
|
|
156
|
+
case 'ExpressionRows':
|
|
152
157
|
return (_a = report.Query) === null || _a === void 0 ? void 0 : _a.BooleanExpression;
|
|
153
|
-
case Enums_1.ReportRowScope.CustomRows:
|
|
154
|
-
return '[Custom Rows]';
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
GetReportColumnsForReport(report, includePrimaryKey = false) {
|
|
159
162
|
let reportColumns = [];
|
|
160
163
|
let gridColumns = this.adaptableApi.columnApi.getColumns();
|
|
164
|
+
if (this.adaptableApi.exportApi.isCustomReport(report)) {
|
|
165
|
+
return reportColumns;
|
|
166
|
+
}
|
|
161
167
|
// first get the cols depending on the Column Scope
|
|
162
168
|
switch (report.ReportColumnScope) {
|
|
163
|
-
case
|
|
169
|
+
case 'AllColumns':
|
|
164
170
|
reportColumns = gridColumns;
|
|
165
171
|
break;
|
|
166
|
-
case
|
|
172
|
+
case 'VisibleColumns':
|
|
167
173
|
reportColumns = gridColumns.filter((c) => c.visible);
|
|
168
174
|
break;
|
|
169
|
-
case
|
|
175
|
+
case 'SelectedColumns':
|
|
170
176
|
// we extract the selected columns from the grid columns to preserve the grid column order
|
|
171
177
|
const selectedColumnIds = this.adaptableApi.gridApi
|
|
172
178
|
.getSelectedCellInfo()
|
|
173
179
|
.columns.map((column) => column.columnId);
|
|
174
180
|
reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.columnId));
|
|
175
181
|
break;
|
|
176
|
-
case
|
|
182
|
+
case 'ScopeColumns':
|
|
177
183
|
if ('ColumnIds' in report.Scope) {
|
|
178
184
|
reportColumns = report.Scope.ColumnIds.map((columnId) => this.adaptableApi.columnApi.getColumnFromId(columnId)).filter((c) => c);
|
|
179
185
|
}
|
|
@@ -181,9 +187,6 @@ class ReportService {
|
|
|
181
187
|
reportColumns = this.adaptableApi.scopeApi.getColumnsForScope(report.Scope);
|
|
182
188
|
}
|
|
183
189
|
break;
|
|
184
|
-
case Enums_1.ReportColumnScope.CustomColumns:
|
|
185
|
-
// nothing required if custom coluns
|
|
186
|
-
break;
|
|
187
190
|
}
|
|
188
191
|
if (includePrimaryKey) {
|
|
189
192
|
const pkColumn = reportColumns.find((column) => column.columnId === this.adaptableApi.internalApi.getAdaptableOptions().primaryKey);
|
|
@@ -202,14 +205,16 @@ class ReportService {
|
|
|
202
205
|
friendlyName: column.friendlyName,
|
|
203
206
|
dataType: column.dataType,
|
|
204
207
|
}));
|
|
205
|
-
if (
|
|
206
|
-
|
|
208
|
+
if (this.adaptableApi.exportApi.isCustomReport(report)) {
|
|
209
|
+
return this.adaptableApi.exportApi.runCustomReport(report.Name);
|
|
210
|
+
}
|
|
211
|
+
if (ArrayExtensions_1.default.IsNullOrEmpty(columns)) {
|
|
207
212
|
return { columns: [], rows: [] };
|
|
208
213
|
}
|
|
209
214
|
const data = { columns, rows: [] };
|
|
210
215
|
const columnIds = columns.map((column) => column.columnId);
|
|
211
216
|
switch (report.ReportRowScope) {
|
|
212
|
-
case
|
|
217
|
+
case 'AllRows':
|
|
213
218
|
this.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
|
|
214
219
|
// skip row groups
|
|
215
220
|
if (!rowNode.group) {
|
|
@@ -217,7 +222,7 @@ class ReportService {
|
|
|
217
222
|
}
|
|
218
223
|
});
|
|
219
224
|
break;
|
|
220
|
-
case
|
|
225
|
+
case 'VisibleRows':
|
|
221
226
|
this.adaptableApi.internalApi.forAllVisibleRowNodesDo((rowNode) => {
|
|
222
227
|
// skip row groups
|
|
223
228
|
if (!rowNode.group) {
|
|
@@ -225,7 +230,7 @@ class ReportService {
|
|
|
225
230
|
}
|
|
226
231
|
});
|
|
227
232
|
break;
|
|
228
|
-
case
|
|
233
|
+
case 'ExpressionRows':
|
|
229
234
|
this.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
|
|
230
235
|
var _a;
|
|
231
236
|
if (this.adaptableApi.internalApi
|
|
@@ -235,7 +240,7 @@ class ReportService {
|
|
|
235
240
|
}
|
|
236
241
|
});
|
|
237
242
|
break;
|
|
238
|
-
case
|
|
243
|
+
case 'SelectedCellRows':
|
|
239
244
|
const selectedCellInfo = this.adaptableApi.gridApi.getSelectedCellInfo();
|
|
240
245
|
const { gridCells: GridCells } = selectedCellInfo;
|
|
241
246
|
let selectedCellsByPrimaryKey = groupBy_1.default(GridCells, 'primaryKeyValue');
|
|
@@ -255,7 +260,7 @@ class ReportService {
|
|
|
255
260
|
}
|
|
256
261
|
});
|
|
257
262
|
break;
|
|
258
|
-
case
|
|
263
|
+
case 'SelectedRows':
|
|
259
264
|
const selectedRowInfo = this.adaptableApi.gridApi.getSelectedRowInfo();
|
|
260
265
|
const selectedGridRowPrimaryKeys = (_b = (_a = selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows) === null || _a === void 0 ? void 0 : _a.filter((gr) => gr.rowInfo.isGroup == false).map((gridRow) => gridRow.primaryKeyValue)) !== null && _b !== void 0 ? _b : [];
|
|
261
266
|
if (selectedGridRowPrimaryKeys.length) {
|
|
@@ -267,10 +272,6 @@ class ReportService {
|
|
|
267
272
|
});
|
|
268
273
|
}
|
|
269
274
|
break;
|
|
270
|
-
case Enums_1.ReportRowScope.CustomRows:
|
|
271
|
-
const reportData = this.adaptableApi.exportApi.runCustomReport(report.Name);
|
|
272
|
-
return reportData;
|
|
273
|
-
// break;
|
|
274
275
|
}
|
|
275
276
|
return data;
|
|
276
277
|
}
|
|
@@ -25,7 +25,7 @@ class AdaptableView extends React.Component {
|
|
|
25
25
|
this.props.AdaptableApi.internalApi.getModuleService().isModuleAvailable('Dashboard') && (React.createElement(Dashboard_1.Dashboard, { api: this.props.AdaptableApi })),
|
|
26
26
|
React.createElement(AdaptableLoadingScreen_1.AdaptableLoadingScreen, { onClose: this.props.onCloseLoadingPopup, showLoadingScreen: this.props.PopupState.LoadingPopup.ShowLoadingPopup }),
|
|
27
27
|
this.props.PopupState.PromptPopup.ShowPromptPopup && (React.createElement(AdaptablePopupPrompt_1.AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, onConfirmActionCreator: this.props.PopupState.PromptPopup.ConfirmActionCreator, defaultValue: this.props.PopupState.PromptPopup.DefaultValue })),
|
|
28
|
-
React.createElement(AdaptablePopupConfirmation_1.AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi }),
|
|
28
|
+
Boolean(this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup) && (React.createElement(AdaptablePopupConfirmation_1.AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi })),
|
|
29
29
|
Boolean(this.props.PopupState.ScreenPopup.ShowScreenPopup) && (React.createElement(AdaptablePopup_1.AdaptablePopup, { componentName: this.props.PopupState.ScreenPopup.ComponentName, componentModule: this.props.PopupState.ScreenPopup.ComponentModule, onHide: this.props.onCloseScreenPopup, api: this.props.AdaptableApi, onClearParams: () => this.props.onClearPopupParams(), moduleParams: this.props.PopupState.ScreenPopup.Params, moduleProps: this.props.PopupState.ScreenPopup.PopupProps })),
|
|
30
30
|
React.createElement(Toastify_1.ToastContainer
|
|
31
31
|
// we NEEEEED!!!! this containerId, otherwise, toastify will have memory leaks when the adaptable
|
|
@@ -50,7 +50,6 @@ function mapStateToProps(state, ownProps) {
|
|
|
50
50
|
function mapDispatchToProps(dispatch) {
|
|
51
51
|
return {
|
|
52
52
|
onCloseScreenPopup: () => dispatch(PopupRedux.PopupHideScreen()),
|
|
53
|
-
onCloseAlertPopup: () => dispatch(PopupRedux.PopupHideAlert()),
|
|
54
53
|
onClosePromptPopup: () => dispatch(PopupRedux.PopupHidePrompt()),
|
|
55
54
|
onConfirmPromptPopup: (inputText) => dispatch(PopupRedux.PopupConfirmPrompt(inputText)),
|
|
56
55
|
onConfirmConfirmationPopup: (comment) => dispatch(PopupRedux.PopupConfirmConfirmation(comment)),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.getCalculatedColumnSettingsTags = void 0;
|
|
4
|
+
const getCalculatedColumnSettingsTags = (settings) => {
|
|
5
5
|
const { DataType, Width, Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable } = settings !== null && settings !== void 0 ? settings : {};
|
|
6
|
+
const colTypes = (settings === null || settings === void 0 ? void 0 : settings.ColumnTypes) ? settings.ColumnTypes.join(', ') : '';
|
|
6
7
|
return [
|
|
7
8
|
DataType ? `DataType: ${DataType}` : null,
|
|
8
9
|
Width ? `Width: ${Width}px` : null,
|
|
@@ -12,6 +13,7 @@ const getCalculatedColumnSettingTags = (settings) => {
|
|
|
12
13
|
Groupable ? 'Groupable' : null,
|
|
13
14
|
Sortable ? 'Sortable' : null,
|
|
14
15
|
Aggregatable ? 'Aggregatable' : null,
|
|
16
|
+
colTypes ? `Column Types: ${colTypes}` : null,
|
|
15
17
|
].filter(Boolean);
|
|
16
18
|
};
|
|
17
|
-
exports.
|
|
19
|
+
exports.getCalculatedColumnSettingsTags = getCalculatedColumnSettingsTags;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
3
|
+
import { CalculatedColumn } from '../../../PredefinedConfig/CalculatedColumnState';
|
|
4
|
+
export declare type CalculatedColumnDefinitionWizardSectionProps = {
|
|
5
|
+
onChange: (data: CalculatedColumn) => void;
|
|
6
|
+
isEdit: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const renderCalculatedColumnDefinitionSummary: (data: CalculatedColumn) => JSX.Element;
|
|
9
|
+
export declare const isValidCalculatedColumnDefinition: (data: CalculatedColumn, api: AdaptableApi) => true | string;
|
|
10
|
+
export declare const CalculatedColumnDefinitionWizardSection: (props: CalculatedColumnDefinitionWizardSectionProps) => JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalculatedColumnDefinitionWizardSection = exports.isValidCalculatedColumnDefinition = exports.renderCalculatedColumnDefinitionSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
8
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
10
|
+
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
11
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
12
|
+
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
13
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
14
|
+
const Tag_1 = require("../../../components/Tag");
|
|
15
|
+
const renderCalculatedColumnDefinitionSummary = (data) => {
|
|
16
|
+
var _a;
|
|
17
|
+
return (React.createElement(rebass_1.Box, { fontSize: 2 },
|
|
18
|
+
React.createElement(rebass_1.Box, null,
|
|
19
|
+
"Column Identifier: ",
|
|
20
|
+
React.createElement(Tag_1.Tag, null, data.ColumnId)),
|
|
21
|
+
data.FriendlyName ? (React.createElement(rebass_1.Box, { mt: 3 },
|
|
22
|
+
"Column Name: ",
|
|
23
|
+
React.createElement(Tag_1.Tag, null, (_a = data.FriendlyName) !== null && _a !== void 0 ? _a : data.ColumnId))) : null));
|
|
24
|
+
};
|
|
25
|
+
exports.renderCalculatedColumnDefinitionSummary = renderCalculatedColumnDefinitionSummary;
|
|
26
|
+
const isValidCalculatedColumnDefinition = (data, api) => {
|
|
27
|
+
const columns = api.columnApi.getColumns();
|
|
28
|
+
if (!data.ColumnId) {
|
|
29
|
+
return 'Column Id cannot be empty';
|
|
30
|
+
}
|
|
31
|
+
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
32
|
+
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
33
|
+
return hasAlreadyExistingId ? 'A Column already exists with that id' : true;
|
|
34
|
+
};
|
|
35
|
+
exports.isValidCalculatedColumnDefinition = isValidCalculatedColumnDefinition;
|
|
36
|
+
const CalculatedColumnDefinitionWizardSection = (props) => {
|
|
37
|
+
var _a;
|
|
38
|
+
const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
39
|
+
const handleColumnIdChange = (event) => {
|
|
40
|
+
let e = event.target;
|
|
41
|
+
props.onChange(Object.assign(Object.assign({}, data), { ColumnId: e.value }));
|
|
42
|
+
};
|
|
43
|
+
const handleColumnNameChange = (event) => {
|
|
44
|
+
let e = event.target;
|
|
45
|
+
props.onChange(Object.assign(Object.assign({}, data), { FriendlyName: e.value }));
|
|
46
|
+
};
|
|
47
|
+
const inEdit = props.isEdit;
|
|
48
|
+
const validCheck = exports.isValidCalculatedColumnDefinition(data, api);
|
|
49
|
+
const ErrorMessage = validCheck === true ? null : validCheck;
|
|
50
|
+
const [ColumnNameFocused, setColumnNameFocused] = react_1.useState(false);
|
|
51
|
+
const ColumnName = data.FriendlyName;
|
|
52
|
+
const ColumnId = data.ColumnId;
|
|
53
|
+
const { ShowToolTip, HeaderToolTip } = (_a = data.CalculatedColumnSettings) !== null && _a !== void 0 ? _a : {};
|
|
54
|
+
const handleSpecialColumnSettingsChange = (settings) => {
|
|
55
|
+
props.onChange(Object.assign(Object.assign({}, data), { CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), settings) }));
|
|
56
|
+
};
|
|
57
|
+
return (React.createElement(rebass_1.Box, { "data-name": 'calculated-column-definition' },
|
|
58
|
+
React.createElement(Tabs_1.Tabs, { autoFocus: false },
|
|
59
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Column Details"),
|
|
60
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
61
|
+
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
62
|
+
React.createElement(FormLayout_1.default, null,
|
|
63
|
+
React.createElement(FormLayout_1.FormRow, { label: "Column Id" },
|
|
64
|
+
React.createElement(Input_1.default, { "data-name": "column-id", value: data.ColumnId || '', width: 300, autoFocus: !inEdit, disabled: inEdit, type: "text", placeholder: "Enter an Id for the column", onChange: handleColumnIdChange })),
|
|
65
|
+
React.createElement(FormLayout_1.FormRow, { label: "Name" },
|
|
66
|
+
React.createElement(Input_1.default, { "data-name": "column-name", autoFocus: inEdit, onFocus: () => {
|
|
67
|
+
setColumnNameFocused(true);
|
|
68
|
+
}, onBlur: () => {
|
|
69
|
+
setColumnNameFocused(false);
|
|
70
|
+
}, value: ColumnNameFocused ? ColumnName || '' : ColumnName || ColumnId || '', width: 300, type: "text", placeholder: "Enter column name", onChange: handleColumnNameChange })),
|
|
71
|
+
React.createElement(FormLayout_1.FormRow, { label: "Header Tooltip" },
|
|
72
|
+
React.createElement(Input_1.default, { "data-name": "header-tooltip", type: "text", width: 300, value: HeaderToolTip, onChange: (e) => handleSpecialColumnSettingsChange({
|
|
73
|
+
HeaderToolTip: e.target.value,
|
|
74
|
+
}) })),
|
|
75
|
+
' ',
|
|
76
|
+
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
77
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip }, "Show Expression as Cell Tooltip")))))),
|
|
78
|
+
ErrorMessage ? React.createElement(ErrorBox_1.default, { marginTop: 2 }, ErrorMessage) : null));
|
|
79
|
+
};
|
|
80
|
+
exports.CalculatedColumnDefinitionWizardSection = CalculatedColumnDefinitionWizardSection;
|
|
@@ -46,18 +46,24 @@ QueryTab.defaultProps = {
|
|
|
46
46
|
const CalculatedColumnExpressionWizardSection = (props) => {
|
|
47
47
|
const { api, data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
48
48
|
const initialData = react_1.useMemo(() => api.internalApi.getQueryPreviewData(), []);
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
const [selectedTab, setSelectedTab] = React.useState(() => {
|
|
50
|
+
return data.Query.AggregatedScalarExpression == undefined
|
|
51
|
+
? 'ScalarExpression'
|
|
52
|
+
: api.internalApi
|
|
53
|
+
.getQueryLanguageService()
|
|
54
|
+
.isCumulativeAggregate(data.Query.AggregatedScalarExpression)
|
|
55
|
+
? 'CumulativeAggregateExpression'
|
|
56
|
+
: 'AggregatedScalarExpression';
|
|
57
|
+
});
|
|
58
|
+
const updateExpressionType = (expressionType) => {
|
|
59
|
+
setSelectedTab(expressionType);
|
|
60
|
+
if (expressionType === 'ScalarExpression') {
|
|
56
61
|
props.onChange(Object.assign(Object.assign({}, data), { Query: {
|
|
57
62
|
ScalarExpression: '',
|
|
58
63
|
} }));
|
|
59
64
|
}
|
|
60
65
|
else {
|
|
66
|
+
// CumulativeAggregateExpression & AggregatedScalarExpression use the same property
|
|
61
67
|
props.onChange(Object.assign(Object.assign({}, data), { Query: {
|
|
62
68
|
AggregatedScalarExpression: '',
|
|
63
69
|
} }));
|
|
@@ -66,17 +72,17 @@ const CalculatedColumnExpressionWizardSection = (props) => {
|
|
|
66
72
|
const setCalculatedColumnExpression = (calculatedColumnQuery) => {
|
|
67
73
|
const calculatedColumnExpressionService = api.internalApi.getCalculatedColumnExpressionService();
|
|
68
74
|
const dataType = calculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumnQuery);
|
|
69
|
-
|
|
70
|
-
const Aggregatable = dataType == 'Number';
|
|
71
|
-
props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType, Pivotable,
|
|
72
|
-
Aggregatable }) }));
|
|
75
|
+
props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType }) }));
|
|
73
76
|
};
|
|
74
|
-
return (React.createElement(Tabs_1.Tabs, { onValueChange:
|
|
75
|
-
React.createElement(QueryTab, { value: "ScalarExpression", type:
|
|
77
|
+
return (React.createElement(Tabs_1.Tabs, { onValueChange: updateExpressionType, value: selectedTab, p: 2, style: { height: '100%', flex: 1, overflow: 'auto' } },
|
|
78
|
+
React.createElement(QueryTab, { value: "ScalarExpression", type: selectedTab, label: "Scalar" }),
|
|
76
79
|
React.createElement(Tabs_1.Tabs.Content, { value: 'ScalarExpression' },
|
|
77
80
|
React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'scalar', module: moduleInfo.ModuleName, style: { paddingLeft: 0 }, value: data.Query.ScalarExpression, onChange: (ScalarExpression) => setCalculatedColumnExpression({ ScalarExpression }), initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.queryApi.getAllNamedQuery(), isFullExpression: true, api: api })),
|
|
78
|
-
React.createElement(QueryTab, { value: "AggregatedScalarExpression", type:
|
|
81
|
+
React.createElement(QueryTab, { value: "AggregatedScalarExpression", type: selectedTab, label: "AggregatedScalar" }),
|
|
79
82
|
React.createElement(Tabs_1.Tabs.Content, { value: 'AggregatedScalarExpression' },
|
|
80
|
-
React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'aggregatedScalar', module: moduleInfo.ModuleName, style: { paddingLeft: 0 }, value: data.Query.AggregatedScalarExpression, onChange: (AggregatedScalarExpression) => setCalculatedColumnExpression({ AggregatedScalarExpression }), initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.queryApi.getAllNamedQuery(), isFullExpression: true, api: api }))
|
|
83
|
+
React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'aggregatedScalar', module: moduleInfo.ModuleName, style: { paddingLeft: 0 }, value: data.Query.AggregatedScalarExpression, onChange: (AggregatedScalarExpression) => setCalculatedColumnExpression({ AggregatedScalarExpression }), initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.queryApi.getAllNamedQuery(), isFullExpression: true, api: api })),
|
|
84
|
+
React.createElement(QueryTab, { value: "CumulativeAggregateExpression", type: selectedTab, label: "CumulativeAggregatedScalar" }),
|
|
85
|
+
React.createElement(Tabs_1.Tabs.Content, { value: 'CumulativeAggregateExpression' },
|
|
86
|
+
React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'cumulativeAggregatedScalar', module: moduleInfo.ModuleName, style: { paddingLeft: 0 }, value: data.Query.AggregatedScalarExpression, onChange: (AggregatedScalarExpression) => setCalculatedColumnExpression({ AggregatedScalarExpression }), initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.queryApi.getAllNamedQuery(), isFullExpression: true, api: api }))));
|
|
81
87
|
};
|
|
82
88
|
exports.CalculatedColumnExpressionWizardSection = CalculatedColumnExpressionWizardSection;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
3
2
|
import { CalculatedColumn } from '../../../PredefinedConfig/CalculatedColumnState';
|
|
4
3
|
export declare type CalculatedColumnSettingsWizardSectionProps = {
|
|
5
4
|
onChange: (data: CalculatedColumn) => void;
|
|
6
5
|
isEdit: boolean;
|
|
7
6
|
};
|
|
8
7
|
export declare const renderCalculatedColumnSettingsSummary: (data: CalculatedColumn) => JSX.Element;
|
|
9
|
-
export declare const isValidCalculatedColumnSettings: (data: CalculatedColumn
|
|
8
|
+
export declare const isValidCalculatedColumnSettings: (data: CalculatedColumn) => true | string;
|
|
10
9
|
export declare const CalculatedColumnSettingsWizardSection: (props: CalculatedColumnSettingsWizardSectionProps) => JSX.Element;
|
|
@@ -3,66 +3,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CalculatedColumnSettingsWizardSection = exports.isValidCalculatedColumnSettings = exports.renderCalculatedColumnSettingsSummary = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const rebass_1 = require("rebass");
|
|
7
8
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
8
9
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
9
10
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
10
|
-
const react_1 = require("react");
|
|
11
11
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
12
|
-
const CheckBox_1 = require("../../../components/CheckBox");
|
|
13
12
|
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
14
13
|
const Tabs_1 = require("../../../components/Tabs");
|
|
15
14
|
const ValueSelector_1 = require("../../Components/ValueSelector");
|
|
16
|
-
const Tag_1 = require("../../../components/Tag");
|
|
17
|
-
const getCalculatedColumnSettingTags_1 = require("../Utilities/getCalculatedColumnSettingTags");
|
|
18
15
|
const SpecialColumnSettingsWizardStep_1 = require("../../SpecialColumnSettingsWizardStep");
|
|
16
|
+
const getCalculatedColumnSettingsTags_1 = require("../Utilities/getCalculatedColumnSettingsTags");
|
|
19
17
|
const renderCalculatedColumnSettingsSummary = (data) => {
|
|
20
|
-
|
|
21
|
-
const options = getCalculatedColumnSettingTags_1.getCalculatedColumnSettingTags(data.CalculatedColumnSettings);
|
|
18
|
+
const options = getCalculatedColumnSettingsTags_1.getCalculatedColumnSettingsTags(data.CalculatedColumnSettings);
|
|
22
19
|
return (React.createElement(rebass_1.Box, { fontSize: 2 },
|
|
23
|
-
React.createElement(rebass_1.Box, null,
|
|
24
|
-
"Column Identifier: ",
|
|
25
|
-
React.createElement(Tag_1.Tag, null, data.ColumnId)),
|
|
26
|
-
data.FriendlyName ? (React.createElement(rebass_1.Box, { mt: 3 },
|
|
27
|
-
"Column Name: ",
|
|
28
|
-
React.createElement(Tag_1.Tag, null, (_a = data.FriendlyName) !== null && _a !== void 0 ? _a : data.ColumnId))) : null,
|
|
29
|
-
React.createElement(rebass_1.Box, { mb: 3 }),
|
|
30
20
|
React.createElement(ValueSelector_1.ValueOptionsTags, { toLabel: (x) => x, toIdentifier: (c) => c, readOnly: true, options: options, value: options })));
|
|
31
21
|
};
|
|
32
22
|
exports.renderCalculatedColumnSettingsSummary = renderCalculatedColumnSettingsSummary;
|
|
33
|
-
const isValidCalculatedColumnSettings = (data
|
|
23
|
+
const isValidCalculatedColumnSettings = (data) => {
|
|
34
24
|
var _a;
|
|
35
|
-
const columns = api.columnApi.getColumns();
|
|
36
|
-
if (!data.ColumnId) {
|
|
37
|
-
return 'Column Id cannot be empty';
|
|
38
|
-
}
|
|
39
25
|
if (!((_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.DataType)) {
|
|
40
|
-
return 'No data type specified
|
|
26
|
+
return 'No data type is specified and it could not be inferred from the defined expression';
|
|
41
27
|
}
|
|
42
|
-
|
|
43
|
-
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
44
|
-
return hasAlreadyExistingId ? 'A Column already exists with that id' : true;
|
|
28
|
+
return true;
|
|
45
29
|
};
|
|
46
30
|
exports.isValidCalculatedColumnSettings = isValidCalculatedColumnSettings;
|
|
47
31
|
const CalculatedColumnSettingsWizardSection = (props) => {
|
|
48
32
|
var _a, _b;
|
|
49
33
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
50
34
|
const calculatedColumnExpressionService = react_1.useMemo(() => api.internalApi.getCalculatedColumnExpressionService(), []);
|
|
51
|
-
const handleColumnIdChange = (event) => {
|
|
52
|
-
let e = event.target;
|
|
53
|
-
props.onChange(Object.assign(Object.assign({}, data), { ColumnId: e.value }));
|
|
54
|
-
};
|
|
55
|
-
const handleColumnNameChange = (event) => {
|
|
56
|
-
let e = event.target;
|
|
57
|
-
props.onChange(Object.assign(Object.assign({}, data), { FriendlyName: e.value }));
|
|
58
|
-
};
|
|
59
35
|
const handleDataTypeChange = (dataType) => {
|
|
60
36
|
var _a;
|
|
61
37
|
const aggregatable = dataType == 'Number' ? (_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.Aggregatable : false;
|
|
62
38
|
props.onChange(Object.assign(Object.assign({}, data), { CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType, Aggregatable: aggregatable }) }));
|
|
63
39
|
};
|
|
64
|
-
const
|
|
65
|
-
const validCheck = exports.isValidCalculatedColumnSettings(data, api);
|
|
40
|
+
const validCheck = exports.isValidCalculatedColumnSettings(data);
|
|
66
41
|
const ErrorMessage = validCheck === true ? null : validCheck;
|
|
67
42
|
let options = [
|
|
68
43
|
{ value: 'Number', label: 'Number' },
|
|
@@ -70,11 +45,8 @@ const CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
70
45
|
{ value: 'Date', label: 'Date' },
|
|
71
46
|
{ value: 'Boolean', label: 'Boolean' },
|
|
72
47
|
];
|
|
73
|
-
const [ColumnNameFocused, setColumnNameFocused] = react_1.useState(false);
|
|
74
|
-
const ColumnName = data.FriendlyName;
|
|
75
|
-
const ColumnId = data.ColumnId;
|
|
76
48
|
let { DataType: dataType } = (_a = data.CalculatedColumnSettings) !== null && _a !== void 0 ? _a : {};
|
|
77
|
-
const { Width
|
|
49
|
+
const { Width } = (_b = data.CalculatedColumnSettings) !== null && _b !== void 0 ? _b : {};
|
|
78
50
|
const handleSpecialColumnSettingsChange = (settings) => {
|
|
79
51
|
props.onChange(Object.assign(Object.assign({}, data), { CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), settings) }));
|
|
80
52
|
};
|
|
@@ -86,18 +58,10 @@ const CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
86
58
|
}, []);
|
|
87
59
|
return (React.createElement(rebass_1.Box, { "data-name": 'calculated-column-settings' },
|
|
88
60
|
React.createElement(Tabs_1.Tabs, { autoFocus: false },
|
|
89
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "Column
|
|
61
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Column Settings"),
|
|
90
62
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
91
63
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
92
64
|
React.createElement(FormLayout_1.default, null,
|
|
93
|
-
React.createElement(FormLayout_1.FormRow, { label: "Column Id" },
|
|
94
|
-
React.createElement(Input_1.default, { "data-name": "column-id", value: data.ColumnId || '', width: 300, autoFocus: !inEdit, disabled: inEdit, type: "text", placeholder: "Enter an Id for the column", onChange: handleColumnIdChange })),
|
|
95
|
-
React.createElement(FormLayout_1.FormRow, { label: "Name" },
|
|
96
|
-
React.createElement(Input_1.default, { "data-name": "column-name", autoFocus: inEdit, onFocus: () => {
|
|
97
|
-
setColumnNameFocused(true);
|
|
98
|
-
}, onBlur: () => {
|
|
99
|
-
setColumnNameFocused(false);
|
|
100
|
-
}, value: ColumnNameFocused ? ColumnName || '' : ColumnName || ColumnId || '', width: 300, type: "text", placeholder: "Enter column name", onChange: handleColumnNameChange })),
|
|
101
65
|
React.createElement(FormLayout_1.FormRow, { label: "Data Type" },
|
|
102
66
|
React.createElement(DropdownButton_1.default, { "data-name": "column-type", style: {
|
|
103
67
|
width: '300px',
|
|
@@ -112,14 +76,7 @@ const CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
112
76
|
React.createElement(FormLayout_1.FormRow, { label: "Width" },
|
|
113
77
|
React.createElement(Input_1.default, { "data-name": "column-width", type: "number", width: 300, value: Width || '', onChange: (e) => handleSpecialColumnSettingsChange({
|
|
114
78
|
Width: Number(e.target.value),
|
|
115
|
-
}) })),
|
|
116
|
-
React.createElement(FormLayout_1.FormRow, { label: "Header Tooltip" },
|
|
117
|
-
React.createElement(Input_1.default, { "data-name": "header-tooltip", type: "text", width: 300, value: HeaderToolTip, onChange: (e) => handleSpecialColumnSettingsChange({
|
|
118
|
-
HeaderToolTip: e.target.value,
|
|
119
|
-
}) })),
|
|
120
|
-
' ',
|
|
121
|
-
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
122
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip }, "Show Expression as Cell Tooltip")))))),
|
|
79
|
+
}) })))))),
|
|
123
80
|
ErrorMessage ? React.createElement(ErrorBox_1.default, { marginTop: 2 }, ErrorMessage) : null,
|
|
124
81
|
React.createElement(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false, settings: data.CalculatedColumnSettings, onChange: handleSpecialColumnSettingsChange })));
|
|
125
82
|
};
|
|
@@ -8,12 +8,13 @@ const Helper_1 = require("../../../Utilities/Helpers/Helper");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
10
10
|
const CalculatedColumnExpressionWizardSection_1 = require("./CalculatedColumnExpressionWizardSection");
|
|
11
|
-
const
|
|
11
|
+
const CalculatedColumnDefinitionWizardSection_1 = require("./CalculatedColumnDefinitionWizardSection");
|
|
12
12
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
13
13
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
|
|
14
14
|
const react_redux_1 = require("react-redux");
|
|
15
15
|
const CalculatedColumnRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/CalculatedColumnRedux"));
|
|
16
16
|
const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
|
|
17
|
+
const CalculatedColumnSettingsWizardSection_1 = require("./CalculatedColumnSettingsWizardSection");
|
|
17
18
|
const CalculatedColumnWizard = (props) => {
|
|
18
19
|
var _a;
|
|
19
20
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
@@ -29,7 +30,7 @@ const CalculatedColumnWizard = (props) => {
|
|
|
29
30
|
return calculatedColumn;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
return ObjectFactory_1.default.CreateEmptyCalculatedColumn(
|
|
33
|
+
return ObjectFactory_1.default.CreateEmptyCalculatedColumn();
|
|
33
34
|
});
|
|
34
35
|
const dispatch = react_redux_1.useDispatch();
|
|
35
36
|
const isEdit = Boolean(props.data) || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
@@ -43,6 +44,16 @@ const CalculatedColumnWizard = (props) => {
|
|
|
43
44
|
props.onCloseWizard();
|
|
44
45
|
};
|
|
45
46
|
return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: calculatedColumn, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
|
|
47
|
+
{
|
|
48
|
+
title: 'Definition',
|
|
49
|
+
details: 'Specify Column details',
|
|
50
|
+
isValid: CalculatedColumnDefinitionWizardSection_1.isValidCalculatedColumnDefinition,
|
|
51
|
+
renderSummary: CalculatedColumnDefinitionWizardSection_1.renderCalculatedColumnDefinitionSummary,
|
|
52
|
+
render: () => {
|
|
53
|
+
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
54
|
+
React.createElement(CalculatedColumnDefinitionWizardSection_1.CalculatedColumnDefinitionWizardSection, { isEdit: isEdit, onChange: setCalculatedColumn })));
|
|
55
|
+
},
|
|
56
|
+
},
|
|
46
57
|
{
|
|
47
58
|
title: 'Expression',
|
|
48
59
|
details: 'Specify the Calculated Column Expression',
|
|
@@ -54,7 +65,7 @@ const CalculatedColumnWizard = (props) => {
|
|
|
54
65
|
},
|
|
55
66
|
{
|
|
56
67
|
title: 'Settings',
|
|
57
|
-
details: 'Specify Column
|
|
68
|
+
details: 'Specify Column properties',
|
|
58
69
|
isValid: CalculatedColumnSettingsWizardSection_1.isValidCalculatedColumnSettings,
|
|
59
70
|
renderSummary: CalculatedColumnSettingsWizardSection_1.renderCalculatedColumnSettingsSummary,
|
|
60
71
|
render: () => {
|
|
@@ -21,7 +21,7 @@ const AdaptableDateInput = React.forwardRef((props, ref) => {
|
|
|
21
21
|
});
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
-
const dateValue = DateHelper_1.
|
|
24
|
+
const dateValue = value ? DateHelper_1.parseDateValue(value) : null;
|
|
25
25
|
const datepickerProps = Object.assign({
|
|
26
26
|
// this is OK as long as we do not support range datepicker
|
|
27
27
|
value: dateValue, onChange: (dateValue) => { var _a;
|