@adaptabletools/adaptable 12.0.0-canary.0 → 12.0.0-canary.3
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 +561 -283
- package/bundle.cjs.js +162 -148
- package/index.css +631 -280
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -0
- package/src/AdaptableOptions/AlertOptions.d.ts +5 -9
- package/src/AdaptableOptions/DashboardOptions.d.ts +1 -5
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
- package/src/AdaptableOptions/EditOptions.d.ts +26 -8
- package/src/AdaptableOptions/ExportOptions.d.ts +4 -7
- package/src/AdaptableOptions/GeneralOptions.d.ts +12 -2
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +1 -5
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +21 -3
- package/src/Api/AlertApi.d.ts +3 -3
- package/src/Api/ColumnApi.d.ts +7 -2
- package/src/Api/EventApi.d.ts +11 -0
- package/src/Api/Events/RowFormSubmitted.d.ts +15 -0
- package/src/Api/Events/SearchChanged.d.ts +1 -1
- package/src/Api/ExportApi.d.ts +2 -2
- package/src/Api/FilterApi.d.ts +69 -1
- package/src/Api/Implementation/AlertApiImpl.d.ts +3 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ColumnApiImpl.js +15 -14
- package/src/Api/Implementation/ConfigApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FilterApiImpl.d.ts +16 -1
- package/src/Api/Implementation/FilterApiImpl.js +141 -0
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -2
- package/src/Api/Implementation/GridApiImpl.js +7 -3
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -3
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -15
- package/src/Api/Implementation/LayoutApiImpl.js +0 -152
- package/src/Api/Implementation/PredicateApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PredicateApiImpl.js +18 -0
- package/src/Api/LayoutApi.d.ts +1 -72
- package/src/Api/PredicateApi.d.ts +7 -0
- package/src/PredefinedConfig/AlertState.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
- package/src/PredefinedConfig/Common/FormContext.d.ts +11 -0
- package/src/PredefinedConfig/Common/FormContext.js +2 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +0 -1
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +3 -2
- package/src/Redux/Store/AdaptableStore.js +6 -0
- package/src/Strategy/AdaptableModuleBase.js +1 -2
- package/src/Strategy/BulkUpdateModule.js +3 -4
- package/src/Strategy/CellSummaryModule.js +1 -2
- package/src/Strategy/FilterModule.js +15 -18
- package/src/Strategy/LayoutModule.js +1 -0
- package/src/Strategy/PlusMinusModule.js +1 -4
- package/src/Strategy/SmartEditModule.js +2 -2
- package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +6 -7
- package/src/Utilities/Services/RowEditService.d.ts +1 -0
- package/src/Utilities/Services/RowEditService.js +34 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +8 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +3 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +9 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +30 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +87 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +18 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +16 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +2 -9
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +2 -75
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +3 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +9 -4
- package/src/View/AdaptableWizardView/Utils.d.ts +1 -0
- package/src/View/AdaptableWizardView/Utils.js +24 -0
- package/src/View/AdaptableWizardView/Wizard.d.ts +54 -0
- package/src/View/AdaptableWizardView/Wizard.js +98 -0
- package/src/View/AdaptableWizardView/index.d.ts +1 -22
- package/src/View/AdaptableWizardView/index.js +2 -103
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.d.ts +3 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -2
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +3 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +5 -6
- package/src/View/CellSummary/CellSummaryDetails.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.js +1 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +3 -3
- package/src/View/Components/WizardSummaryPage.js +2 -2
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +1 -1
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +2 -2
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +1 -1
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +2 -2
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
- package/src/View/Export/Wizard/ReportNameWizardSection.js +1 -1
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
- package/src/View/Filter/ActiveFiltersPanel.js +1 -1
- package/src/View/Filter/FilterSummary.js +1 -1
- package/src/View/Filter/FilterViewPanel.js +2 -2
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +2 -2
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +5 -6
- package/src/View/GridInfo/ColumnInfoComponent.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +2 -2
- package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleSummary.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +2 -2
- package/src/View/UIHelper.js +6 -6
- package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -2
- package/src/View/Wizard/ObjectTagsWizardSection.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +5 -6
- package/src/View/Wizard/OnePageAdaptableWizard.js +35 -169
- package/src/View/Wizard/OnePageWizards.d.ts +37 -0
- package/src/View/Wizard/OnePageWizards.js +187 -0
- package/src/View/Wizard/useKeyboardNavigation.d.ts +1 -1
- package/src/agGrid/Adaptable.js +25 -11
- package/src/agGrid/FilterWrapper.js +2 -2
- package/src/agGrid/agGridHelper.d.ts +2 -3
- package/src/agGrid/agGridHelper.js +37 -33
- package/src/agGrid/rowEditIcons.d.ts +1 -0
- package/src/agGrid/rowEditIcons.js +2 -1
- package/src/components/Datepicker/Caption.js +1 -1
- package/src/components/InfiniteTable/index.js +1 -0
- package/src/components/List/GridList/index.js +1 -1
- package/src/components/WindowModal/WindowModal.js +13 -7
- package/src/components/icons/add-row.d.ts +3 -0
- package/src/components/icons/add-row.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +106 -22
- package/src/metamodel/adaptable.metamodel.js +238 -121
- package/src/types.d.ts +5 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -168,7 +168,6 @@ exports.LayoutReducer = (state = initialState, action) => {
|
|
|
168
168
|
layoutToUpdate.Columns = layoutToUpdate.Columns.filter((col) => {
|
|
169
169
|
return col !== colToRemove;
|
|
170
170
|
});
|
|
171
|
-
console.log('updating', layoutToUpdate);
|
|
172
171
|
return Object.assign(Object.assign({}, state), { Layouts: state.Layouts.map((abObject) => abObject.Uuid === layoutToUpdate.Uuid ? layoutToUpdate : abObject) });
|
|
173
172
|
}
|
|
174
173
|
return state;
|
|
@@ -5,6 +5,7 @@ import { ModuleParams } from '../../View/Components/SharedProps/ModuleViewPopupP
|
|
|
5
5
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
6
6
|
import { AdaptableAlert } from '../../PredefinedConfig/Common/AdaptableAlert';
|
|
7
7
|
import { AdaptableForm, BaseContext } from '../../types';
|
|
8
|
+
import { FormContext } from '../../PredefinedConfig/Common/FormContext';
|
|
8
9
|
export declare const POPUP_SHOW_SCREEN = "POPUP_SHOW_SCREEN";
|
|
9
10
|
export declare const POPUP_HIDE_SCREEN = "POPUP_HIDE_SCREEN";
|
|
10
11
|
export declare const POPUP_SHOW_LOADING = "POPUP_SHOW_LOADING";
|
|
@@ -89,9 +90,9 @@ export declare const PopupShowWindow: (config: {
|
|
|
89
90
|
export declare const PopupHideWindow: (id: string) => PopupHideWindowAction;
|
|
90
91
|
export declare const PopupShowForm: (config: {
|
|
91
92
|
Id: string;
|
|
92
|
-
Form: AdaptableForm<
|
|
93
|
+
Form: AdaptableForm<FormContext>;
|
|
93
94
|
FormProps?: any;
|
|
94
|
-
prepareContext?: (context:
|
|
95
|
+
prepareContext?: (context: FormContext) => Promise<FormContext> | FormContext;
|
|
95
96
|
}) => PopupShowFormAction;
|
|
96
97
|
export declare const PopupHideForm: (id: string) => PopupHideFormAction;
|
|
97
98
|
export declare const PopupShowAlert: (alert: AdaptableAlert) => PopupShowAlertAction;
|
|
@@ -730,6 +730,12 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
730
730
|
middlewareAPI.dispatch(PopupRedux_1.PopupShowForm({
|
|
731
731
|
Id: 'data-set-form',
|
|
732
732
|
Form: dataSet.form,
|
|
733
|
+
prepareContext: (context) => {
|
|
734
|
+
return new Promise((resolve) => {
|
|
735
|
+
const preparedContext = Object.assign(Object.assign({}, context), { dataSet });
|
|
736
|
+
resolve(preparedContext);
|
|
737
|
+
});
|
|
738
|
+
},
|
|
733
739
|
}));
|
|
734
740
|
}
|
|
735
741
|
});
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AdaptableModuleBase = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
6
5
|
const StringExtensions_1 = require("../Utilities/Extensions/StringExtensions");
|
|
7
6
|
const MenuItem_1 = require("../Utilities/MenuItem");
|
|
8
7
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
@@ -128,7 +127,7 @@ class AdaptableModuleBase {
|
|
|
128
127
|
return !column.isSparkline;
|
|
129
128
|
}
|
|
130
129
|
else if (functionType == 'numeric') {
|
|
131
|
-
return column.dataType ==
|
|
130
|
+
return column.dataType == 'Number';
|
|
132
131
|
}
|
|
133
132
|
else if (functionType == 'filter') {
|
|
134
133
|
return column.filterable;
|
|
@@ -4,7 +4,6 @@ exports.BulkUpdateModule = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
|
-
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
8
7
|
const PreviewHelper_1 = require("../Utilities/Helpers/PreviewHelper");
|
|
9
8
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
|
|
10
9
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
@@ -110,13 +109,13 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
110
109
|
column = this.api.columnApi.getColumnFromId(selectedCellInfo.columns[0].columnId);
|
|
111
110
|
let typedBulkUpdateValue;
|
|
112
111
|
switch (column.dataType) {
|
|
113
|
-
case
|
|
112
|
+
case 'Number':
|
|
114
113
|
typedBulkUpdateValue = Number(bulkUpdateValue);
|
|
115
114
|
break;
|
|
116
|
-
case
|
|
115
|
+
case 'String':
|
|
117
116
|
typedBulkUpdateValue = bulkUpdateValue;
|
|
118
117
|
break;
|
|
119
|
-
case
|
|
118
|
+
case 'Date':
|
|
120
119
|
typedBulkUpdateValue = new Date(bulkUpdateValue);
|
|
121
120
|
break;
|
|
122
121
|
}
|
|
@@ -4,7 +4,6 @@ exports.CellSummaryModule = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
|
-
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
8
7
|
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
9
8
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
10
9
|
const CellSummaryStatusPanel_1 = require("../View/CellSummary/CellSummaryStatusPanel");
|
|
@@ -53,7 +52,7 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
53
52
|
let allValues = [];
|
|
54
53
|
let numericColumns = [];
|
|
55
54
|
selectedCellInfo.columns.map((c) => {
|
|
56
|
-
if (c && c.dataType ==
|
|
55
|
+
if (c && c.dataType == 'Number') {
|
|
57
56
|
numericColumns.push(c.columnId);
|
|
58
57
|
}
|
|
59
58
|
});
|
|
@@ -14,7 +14,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
14
14
|
super(ModuleConstants.FilterModuleId, 'Filter', 'column-filter', 'FilterPopup', 'Advanced filtering capability allows users to see precisely the data they want', api);
|
|
15
15
|
}
|
|
16
16
|
getModuleAdaptableObjects() {
|
|
17
|
-
return this.api.
|
|
17
|
+
return this.api.filterApi.getColumnFilters();
|
|
18
18
|
}
|
|
19
19
|
getExplicitlyReferencedColumnIds(columnFilter) {
|
|
20
20
|
return [columnFilter.ColumnId];
|
|
@@ -26,7 +26,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
26
|
if (this.api.internalApi.getAdaptableOptions().filterOptions.showQuickFilter == false) {
|
|
27
27
|
this.api.filterApi.hideQuickFilterBar();
|
|
28
28
|
}
|
|
29
|
-
const columnFilters = this.api.
|
|
29
|
+
const columnFilters = this.api.filterApi.getColumnFilters();
|
|
30
30
|
columnFilters.forEach((cf) => {
|
|
31
31
|
if (!this.api.columnApi.doesColumnExist(cf.ColumnId)) {
|
|
32
32
|
LoggingHelper_1.LogAdaptableError('Column Filter contains missing column: ' + cf.ColumnId);
|
|
@@ -41,14 +41,13 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
41
41
|
menuContext.isSingleSelectedColumn &&
|
|
42
42
|
menuContext.gridCell != null) {
|
|
43
43
|
let isMultiple = menuContext.selectedCellInfo.gridCells.length > 1;
|
|
44
|
-
let
|
|
45
|
-
?
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
44
|
+
let clickFunction = isMultiple
|
|
45
|
+
? () => {
|
|
46
|
+
this.api.filterApi.createValuesColumnFilterForCells(menuContext.selectedCellInfo.gridCells);
|
|
47
|
+
}
|
|
48
|
+
: () => {
|
|
49
|
+
this.api.filterApi.createEqualityColumnFilterForCell(menuContext.selectedCellInfo.gridCells[0]);
|
|
50
|
+
};
|
|
52
51
|
menuItemClickFunction = this.createColumnMenuItemClickFunction(isMultiple ? 'Filter on Cell Values' : 'Filter on Cell Value', this.moduleInfo.Glyph, clickFunction);
|
|
53
52
|
}
|
|
54
53
|
}
|
|
@@ -65,8 +64,8 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
if (column && this.canCreateColumnMenuItem(column, 'ReadOnly', 'filter')) {
|
|
68
|
-
let existingColumnFilter = this.api.
|
|
69
|
-
.
|
|
67
|
+
let existingColumnFilter = this.api.filterApi
|
|
68
|
+
.getColumnFilters()
|
|
70
69
|
.find((x) => x.ColumnId == column.columnId);
|
|
71
70
|
if (existingColumnFilter) {
|
|
72
71
|
baseMenuItems.push(this.createColumnMenuItemReduxAction('Clear Filter', this.moduleInfo.Glyph, LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
@@ -78,7 +77,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
78
77
|
}
|
|
79
78
|
getTeamSharingAction() {
|
|
80
79
|
return {
|
|
81
|
-
ModuleEntities: this.api.
|
|
80
|
+
ModuleEntities: this.api.filterApi.getColumnFilters(),
|
|
82
81
|
AddAction: LayoutRedux.LayoutColumnFilterAdd,
|
|
83
82
|
EditAction: LayoutRedux.LayoutColumnFilterEdit,
|
|
84
83
|
};
|
|
@@ -86,9 +85,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
86
85
|
toViewCompact(filter) {
|
|
87
86
|
return {
|
|
88
87
|
item: {
|
|
89
|
-
|
|
90
|
-
// name: this.api.columnApi.getFriendlyNameFromColumnId(filter.ColumnId),
|
|
91
|
-
values: [this.api.layoutApi.columnFilterToString(filter)],
|
|
88
|
+
values: [this.api.filterApi.columnFilterToString(filter)],
|
|
92
89
|
},
|
|
93
90
|
abObject: filter,
|
|
94
91
|
};
|
|
@@ -102,7 +99,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
102
99
|
},
|
|
103
100
|
{
|
|
104
101
|
name: 'Filter',
|
|
105
|
-
values: [this.api.
|
|
102
|
+
values: [this.api.filterApi.columnFilterToString(filter)],
|
|
106
103
|
},
|
|
107
104
|
],
|
|
108
105
|
abObject: filter,
|
|
@@ -124,7 +121,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
124
121
|
`,
|
|
125
122
|
getStatusBarPanelProps() {
|
|
126
123
|
let text;
|
|
127
|
-
const filters = api.
|
|
124
|
+
const filters = api.filterApi.getColumnFilters();
|
|
128
125
|
if (filters.length === 0) {
|
|
129
126
|
text = '0 Filters';
|
|
130
127
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlusMinusModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
6
5
|
const PlusMinusRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/PlusMinusRedux"));
|
|
7
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
8
7
|
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
@@ -91,9 +90,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
91
90
|
let failedPreventEdits = [];
|
|
92
91
|
let side = direction == 'up' ? 1 : -1;
|
|
93
92
|
cellsToUpdate.forEach((gridCell) => {
|
|
94
|
-
if (gridCell.column &&
|
|
95
|
-
gridCell.column.dataType == Enums_1.DataType.Number &&
|
|
96
|
-
!gridCell.column.readOnly) {
|
|
93
|
+
if (gridCell.column && gridCell.column.dataType == 'Number' && !gridCell.column.readOnly) {
|
|
97
94
|
let foundRule;
|
|
98
95
|
let replacementGridCell;
|
|
99
96
|
plusMinusNudges.forEach((pmr) => {
|
|
@@ -23,7 +23,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
23
23
|
let menuItemShowPopup = undefined;
|
|
24
24
|
if (!menuContext.isRowGroupColumn && this.isModuleEditable()) {
|
|
25
25
|
if (menuContext.adaptableColumn &&
|
|
26
|
-
menuContext.adaptableColumn.dataType ==
|
|
26
|
+
menuContext.adaptableColumn.dataType == 'Number' &&
|
|
27
27
|
!menuContext.adaptableColumn.readOnly &&
|
|
28
28
|
menuContext.isSelectedCell &&
|
|
29
29
|
menuContext.isSingleSelectedColumn &&
|
|
@@ -78,7 +78,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
78
78
|
}
|
|
79
79
|
let column = selectedCellInfo.columns[0];
|
|
80
80
|
if (column) {
|
|
81
|
-
if (column.dataType !=
|
|
81
|
+
if (column.dataType != 'Number') {
|
|
82
82
|
return {
|
|
83
83
|
Alert: {
|
|
84
84
|
alertType: 'generic',
|
|
@@ -26,6 +26,8 @@ export declare const AB_SPECIAL_COLUMN: AdaptableColumnType;
|
|
|
26
26
|
export declare const HALF_SECOND: number;
|
|
27
27
|
export declare const AG_GRID_GROUPED_COLUMN: string;
|
|
28
28
|
export declare const AG_GRID_PIVOT_COLUMN: string;
|
|
29
|
+
export declare const ADAPTABLE_ROW_ACTION_BUTTONS = "adaptableRowActionButtons";
|
|
30
|
+
export declare const ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = "(ActionRowButtons)";
|
|
29
31
|
export declare const SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE: number;
|
|
30
32
|
export declare const QUICK_SEARCH_DEFAULT_BACK_COLOR: string;
|
|
31
33
|
export declare const QUICK_SEARCH_DEFAULT_FORE_COLOR: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.HALF_SECOND = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
|
|
3
|
+
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.HALF_SECOND = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
|
|
4
4
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
5
|
const UIHelper_1 = require("../../View/UIHelper");
|
|
6
6
|
exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
|
|
@@ -28,6 +28,8 @@ exports.AB_SPECIAL_COLUMN = 'abSpecialColumn';
|
|
|
28
28
|
exports.HALF_SECOND = 500;
|
|
29
29
|
exports.AG_GRID_GROUPED_COLUMN = 'ag-Grid-AutoColumn';
|
|
30
30
|
exports.AG_GRID_PIVOT_COLUMN = 'pivot_';
|
|
31
|
+
exports.ADAPTABLE_ROW_ACTION_BUTTONS = 'adaptableRowActionButtons';
|
|
32
|
+
exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = '(ActionRowButtons)';
|
|
31
33
|
/*
|
|
32
34
|
Redux / State Defaults
|
|
33
35
|
Try to put all our Redux / State defaults here and ONLY reference from here - avoid magic numbers / strings.
|
|
@@ -227,6 +227,8 @@ exports.DefaultAdaptableOptions = {
|
|
|
227
227
|
actionColumns: undefined,
|
|
228
228
|
actionRowButtons: undefined,
|
|
229
229
|
actionRowButtonsPosition: 'pinnedLeft',
|
|
230
|
+
autoHandleActionRowButtons: false,
|
|
231
|
+
setPrimaryKeyValue: undefined,
|
|
230
232
|
},
|
|
231
233
|
colorPalette: UIHelper_1.default.getDefaultColors(),
|
|
232
234
|
editableCellStyle: undefined,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CalculatedColumnExpressionService = void 0;
|
|
4
|
-
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
4
|
const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
6
5
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
7
6
|
const scalarAggregationHelper_1 = require("../ExpressionFunctions/scalarAggregationHelper");
|
|
@@ -42,28 +41,28 @@ class CalculatedColumnExpressionService {
|
|
|
42
41
|
// currently AggregatedScalarExpression support only numerical values
|
|
43
42
|
// TODO AFL try to derive the type from the aggregatedColumn?
|
|
44
43
|
// we definitely don't want to aggregate everything only to get the data type
|
|
45
|
-
return
|
|
44
|
+
return 'Number';
|
|
46
45
|
}
|
|
47
46
|
let firstRowNode = this.adaptableApi.gridApi.getFirstRowNode();
|
|
48
47
|
let firstRowValue = this.adaptableApi.internalApi
|
|
49
48
|
.getQueryLanguageService()
|
|
50
49
|
.evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
|
|
51
50
|
if (firstRowValue instanceof Date) {
|
|
52
|
-
return
|
|
51
|
+
return 'Date';
|
|
53
52
|
}
|
|
54
53
|
if (typeof firstRowValue === 'boolean') {
|
|
55
|
-
return
|
|
54
|
+
return 'Boolean';
|
|
56
55
|
}
|
|
57
56
|
if (typeof firstRowValue === 'string') {
|
|
58
|
-
return
|
|
57
|
+
return 'String';
|
|
59
58
|
}
|
|
60
59
|
if (typeof firstRowValue === 'number') {
|
|
61
|
-
return
|
|
60
|
+
return 'Number';
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
catch (e) {
|
|
65
64
|
LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${this.adaptableApi.queryLanguageApi.getAdaptableQueryExpression(calculatedColumnQuery)} :: ${e}`);
|
|
66
|
-
return
|
|
65
|
+
return 'Number';
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
isCalculatedColumnQueryValid(calculatedColumnQuery) {
|
|
@@ -7,6 +7,10 @@ class RowEditService {
|
|
|
7
7
|
this.adaptableInstance = this.adaptableApi.internalApi.getAdaptableInstance();
|
|
8
8
|
this.rowEditFormOptions =
|
|
9
9
|
this.adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.editOptions.rowFormOptions;
|
|
10
|
+
if (this.adaptableInstance.adaptableOptions.userInterfaceOptions.actionOptions
|
|
11
|
+
.autoHandleActionRowButtons) {
|
|
12
|
+
this.adaptableInstance.api.eventApi.on('RowFormSubmitted', (eventInfo) => this.autoHandleActionRowButtons(eventInfo));
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
buildRowEditForm(rowNode) {
|
|
12
16
|
return this.buildRowForm('rowEdited', rowNode);
|
|
@@ -48,10 +52,13 @@ class RowEditService {
|
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
54
|
buildRowFormFields(type, rowNode) {
|
|
51
|
-
const relevantColumns = this.adaptableApi.columnApi
|
|
55
|
+
const relevantColumns = this.adaptableApi.columnApi
|
|
56
|
+
.getColumns()
|
|
57
|
+
.filter((column) => {
|
|
52
58
|
// if there is NO rowNode, do NOT display the non-editable fields as they will be empty
|
|
53
59
|
return !!rowNode || this.isColumnEditable(column, rowNode);
|
|
54
|
-
})
|
|
60
|
+
})
|
|
61
|
+
.filter((column) => !this.adaptableApi.columnApi.isActionRowButtonColumn(column.columnId));
|
|
55
62
|
return relevantColumns.map((column) => this.buildFormField(type, column, rowNode));
|
|
56
63
|
}
|
|
57
64
|
buildRowFormButtons(type, rowNode) {
|
|
@@ -161,5 +168,30 @@ class RowEditService {
|
|
|
161
168
|
label: value,
|
|
162
169
|
}));
|
|
163
170
|
}
|
|
171
|
+
autoHandleActionRowButtons(rowEditedFormInfo) {
|
|
172
|
+
const { adaptableApi } = rowEditedFormInfo;
|
|
173
|
+
if (rowEditedFormInfo.type === 'rowEdited') {
|
|
174
|
+
const { rowNode, formData } = rowEditedFormInfo;
|
|
175
|
+
const newRowData = Object.assign(Object.assign({}, rowNode.data), formData);
|
|
176
|
+
adaptableApi.gridApi.updateGridData([newRowData]);
|
|
177
|
+
}
|
|
178
|
+
if (rowEditedFormInfo.type === 'rowDeleted') {
|
|
179
|
+
const { rowNode } = rowEditedFormInfo;
|
|
180
|
+
const deletedRowData = rowNode.data;
|
|
181
|
+
adaptableApi.gridApi.deleteGridData([deletedRowData]);
|
|
182
|
+
}
|
|
183
|
+
if (rowEditedFormInfo.type === 'rowCreated') {
|
|
184
|
+
const { formData } = rowEditedFormInfo;
|
|
185
|
+
const setPrimaryKeyValueFunction = adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.userInterfaceOptions
|
|
186
|
+
.actionOptions.setPrimaryKeyValue;
|
|
187
|
+
const newRowData = typeof setPrimaryKeyValueFunction === 'function'
|
|
188
|
+
? setPrimaryKeyValueFunction({
|
|
189
|
+
rowData: formData,
|
|
190
|
+
adaptableApi,
|
|
191
|
+
})
|
|
192
|
+
: Object.assign({}, formData);
|
|
193
|
+
adaptableApi.gridApi.addGridData([newRowData], { addIndex: 0 });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
164
196
|
}
|
|
165
197
|
exports.RowEditService = RowEditService;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ColDef } from '@ag-grid-community/all-modules';
|
|
3
|
-
interface
|
|
3
|
+
export interface NocodeColumn extends Partial<ColDef> {
|
|
4
4
|
field?: string;
|
|
5
5
|
type?: string | string[];
|
|
6
6
|
caption?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ columns: cols, handle, onValidityChange, }: {
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, }: {
|
|
9
9
|
onValidityChange: (valid: boolean) => any;
|
|
10
10
|
handle: React.MutableRefObject<any>;
|
|
11
|
-
columns:
|
|
11
|
+
columns: NocodeColumn[];
|
|
12
|
+
onChange?: (columns: NocodeColumn[]) => void;
|
|
13
|
+
onSelectionChange?: (column: any, flag: boolean) => void;
|
|
14
|
+
selectedColumns?: {
|
|
15
|
+
[key: string]: boolean;
|
|
16
|
+
};
|
|
12
17
|
}) => JSX.Element>;
|
|
13
18
|
export default _default;
|
|
@@ -37,11 +37,12 @@ const useForceRender = () => {
|
|
|
37
37
|
setNow(Date.now());
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
const ColumnsList = ({ columns: cols, handle, onValidityChange, }) => {
|
|
40
|
+
const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, }) => {
|
|
41
41
|
const rerender = useForceRender();
|
|
42
42
|
const columnsRef = react_1.useRef(cols);
|
|
43
43
|
const silentSetColumns = (columns) => {
|
|
44
44
|
columnsRef.current = columns;
|
|
45
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(columns);
|
|
45
46
|
};
|
|
46
47
|
const setColumns = (columns) => {
|
|
47
48
|
silentSetColumns(columns);
|
|
@@ -83,7 +84,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, }) => {
|
|
|
83
84
|
setColumns(cols);
|
|
84
85
|
};
|
|
85
86
|
const [primaryKeyField, setPrimaryKeyField] = React.useState(columns[0].field);
|
|
86
|
-
const { selected: includedColumnsMap, isSelected: isIncludedColumn, isAllSelected: isAllIncludedColumns, isNoneSelected: isNoneIncludedColumns, selectColumn: includeColumn, deselectColumn: excludeColumn, selectAll: includeAllColumns, deselectAll: excludeAllColumns, } = useSelection_1.default(columns, true, null);
|
|
87
|
+
const { selected: includedColumnsMap, isSelected: isIncludedColumn, isAllSelected: isAllIncludedColumns, isNoneSelected: isNoneIncludedColumns, selectColumn: includeColumn, deselectColumn: excludeColumn, selectAll: includeAllColumns, deselectAll: excludeAllColumns, } = useSelection_1.default(columns, selectedColumns !== null && selectedColumns !== void 0 ? selectedColumns : true, null, { onChange: onSelectionChange });
|
|
87
88
|
handle.current = {
|
|
88
89
|
getColumns: () => getColumns().filter((col) => isIncludedColumn(col.field)),
|
|
89
90
|
getPrimaryKey: () => primaryKeyField,
|
|
@@ -9,7 +9,7 @@ const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
|
9
9
|
const rebass_1 = require("rebass");
|
|
10
10
|
const DefaultAdaptableOptions_1 = require("../../../Utilities/Defaults/DefaultAdaptableOptions");
|
|
11
11
|
const ConfigurationForm = (props) => {
|
|
12
|
-
var _a;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
let abOptions = props.adaptableOptions;
|
|
14
14
|
const layoutOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.layoutOptions), abOptions.layoutOptions);
|
|
15
15
|
const generalOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.generalOptions), abOptions.generalOptions);
|
|
@@ -20,6 +20,13 @@ const ConfigurationForm = (props) => {
|
|
|
20
20
|
// we are 'hard-coding' this to use AG Grid but so does helper so ok for now and we can refactor when Adaptable Grid is ready
|
|
21
21
|
const gridOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.gridOptions), abOptions.gridOptions);
|
|
22
22
|
return (React.createElement(React.Fragment, null,
|
|
23
|
+
React.createElement(HelpBlock_1.default, null, "Base Options"),
|
|
24
|
+
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'label', style: { textAlign: 'start' } }, { name: 'children' }] },
|
|
25
|
+
React.createElement(FormLayout_1.FormRow, { label: "Adaptable ID" },
|
|
26
|
+
React.createElement(Input_1.default, { value: (_b = (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.adaptableId) !== null && _b !== void 0 ? _b : null, onChange: (event) => {
|
|
27
|
+
var _a;
|
|
28
|
+
props.onChangeadaptableOptions(Object.assign(Object.assign({}, abOptions), { adaptableId: (_a = event.target.value) !== null && _a !== void 0 ? _a : '' }));
|
|
29
|
+
}, style: { minWidth: '20rem' } }))),
|
|
23
30
|
React.createElement(HelpBlock_1.default, null, "General Options"),
|
|
24
31
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
25
32
|
React.createElement(FormLayout_1.FormRow, { label: "Show Missing Primary Key Warning" },
|
|
@@ -39,7 +46,7 @@ const ConfigurationForm = (props) => {
|
|
|
39
46
|
props.onChangeadaptableOptions(abOptions);
|
|
40
47
|
} })),
|
|
41
48
|
React.createElement(FormLayout_1.FormRow, { label: "Show Quick Filter" },
|
|
42
|
-
React.createElement(CheckBox_1.CheckBox, { checked: (
|
|
49
|
+
React.createElement(CheckBox_1.CheckBox, { checked: (_c = gridOptions.defaultColDef) === null || _c === void 0 ? void 0 : _c.floatingFilter, onChange: (floatingFilter) => {
|
|
43
50
|
abOptions = Object.assign({}, abOptions);
|
|
44
51
|
abOptions.gridOptions = Object.assign({}, abOptions.gridOptions);
|
|
45
52
|
abOptions.gridOptions.defaultColDef = {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AdaptableOptions } from '../../../types';
|
|
3
|
+
import { OnePageWizardSection } from '../../Wizard/OnePageWizards';
|
|
4
|
+
import { AdaptableFrameworkComponent } from '../../../../types';
|
|
5
|
+
export interface CustomSection<T> {
|
|
6
|
+
title: OnePageWizardSection<T>['title'];
|
|
7
|
+
details?: AdaptableFrameworkComponent;
|
|
8
|
+
isValid?: OnePageWizardSection<T>['isValid'];
|
|
9
|
+
isVisible?: OnePageWizardSection<T>['isVisible'];
|
|
10
|
+
render: (
|
|
11
|
+
/**
|
|
12
|
+
* Internal state of adaptableOptions.
|
|
13
|
+
*/
|
|
14
|
+
adaptableOptions: AdaptableOptions,
|
|
15
|
+
/**
|
|
16
|
+
* With this callback adaptableOptions can be changed.
|
|
17
|
+
*/
|
|
18
|
+
onChange: (newAdaptableOptions: AdaptableOptions) => void,
|
|
19
|
+
/**
|
|
20
|
+
* Set the selected columns.
|
|
21
|
+
*/
|
|
22
|
+
setSelectedColumns: (selectedColumn: Record<string, boolean>) => void) => React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface ConfigurationWizardProps {
|
|
25
|
+
adaptableOptions: AdaptableOptions;
|
|
26
|
+
onFinish: (adaptableOptions: AdaptableOptions) => void;
|
|
27
|
+
onCancel: () => void;
|
|
28
|
+
startSections?: CustomSection<AdaptableOptions>[];
|
|
29
|
+
}
|
|
30
|
+
export declare const ConfigurationWizard: React.FunctionComponent<ConfigurationWizardProps>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigurationWizard = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
8
|
+
const OnePageWizards_1 = require("../../Wizard/OnePageWizards");
|
|
9
|
+
const ConfigurationWizardColumnsStep_1 = require("./ConfigurationWizardColumnsStep");
|
|
10
|
+
const ConfigurationForm_1 = tslib_1.__importDefault(require("./ConfigurationForm"));
|
|
11
|
+
exports.ConfigurationWizard = (props) => {
|
|
12
|
+
const [isPrimaryKeySelected, setIsValid] = React.useState(true);
|
|
13
|
+
const [adaptableOptions, setAdaptableOptions] = react_1.useState(props.adaptableOptions);
|
|
14
|
+
const [selectedColumns, setSelectedColumns] = react_1.useState(() => {
|
|
15
|
+
return props.adaptableOptions.gridOptions.columnDefs.reduce((acc, col) => {
|
|
16
|
+
acc[col.field] = true;
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
});
|
|
20
|
+
const columnsHandle = React.useRef();
|
|
21
|
+
const handleFinish = () => {
|
|
22
|
+
const newAdaptableOptions = Object.assign({}, adaptableOptions);
|
|
23
|
+
newAdaptableOptions.gridOptions = Object.assign({}, adaptableOptions.gridOptions);
|
|
24
|
+
newAdaptableOptions.gridOptions.columnDefs = columnsHandle
|
|
25
|
+
.current.getColumns()
|
|
26
|
+
.map((column) => {
|
|
27
|
+
const newColumn = Object.assign(Object.assign({}, column), { headerName: column.caption || StringExtensions_1.default.Humanize(column.field) });
|
|
28
|
+
delete newColumn.caption;
|
|
29
|
+
return newColumn;
|
|
30
|
+
});
|
|
31
|
+
newAdaptableOptions.primaryKey = columnsHandle.current.getPrimaryKey();
|
|
32
|
+
setAdaptableOptions(newAdaptableOptions);
|
|
33
|
+
props.onFinish(newAdaptableOptions);
|
|
34
|
+
};
|
|
35
|
+
const handlePrimaryKeyColumnIsNotSelected = React.useCallback((newIsValid) => {
|
|
36
|
+
setIsValid(newIsValid);
|
|
37
|
+
}, []);
|
|
38
|
+
const handleColumnsChange = React.useCallback((columns) => {
|
|
39
|
+
setAdaptableOptions((adaptableOptions) => (Object.assign(Object.assign({}, adaptableOptions), { gridOptions: Object.assign(Object.assign({}, adaptableOptions.gridOptions), { columnDefs: columns }) })));
|
|
40
|
+
}, []);
|
|
41
|
+
const handleColumnSelectionChange = React.useCallback((col, flag) => {
|
|
42
|
+
setSelectedColumns((selectedColumns) => {
|
|
43
|
+
const newSelectedColumns = selectedColumns !== null && selectedColumns !== void 0 ? selectedColumns : {};
|
|
44
|
+
newSelectedColumns[col.field] = flag;
|
|
45
|
+
return newSelectedColumns;
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
let sections = [
|
|
49
|
+
{
|
|
50
|
+
title: 'Columns',
|
|
51
|
+
details: 'Configure Adaptable',
|
|
52
|
+
isValid: () => {
|
|
53
|
+
if (!isPrimaryKeySelected) {
|
|
54
|
+
return 'Primary key column must be included';
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
},
|
|
58
|
+
render: () => (React.createElement(ConfigurationWizardColumnsStep_1.ConfigurationWizardColumnsStep, { adaptableOptions: adaptableOptions, setPrimaryKeyIsNotSelected: handlePrimaryKeyColumnIsNotSelected, onChange: (newAdaptableOptions) => {
|
|
59
|
+
setAdaptableOptions(newAdaptableOptions);
|
|
60
|
+
}, selectedColumns: selectedColumns, onSelectionChange: handleColumnSelectionChange, onColumnChange: handleColumnsChange, columnsHandle: columnsHandle })),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: 'Adaptable Options',
|
|
64
|
+
details: 'Configure Adaptable Options',
|
|
65
|
+
isValid: () => (adaptableOptions.adaptableId ? true : 'Adaptable ID is required'),
|
|
66
|
+
render: () => (React.createElement(ConfigurationForm_1.default, { adaptableOptions: adaptableOptions, onChangeadaptableOptions: (abOptions) => {
|
|
67
|
+
setAdaptableOptions(abOptions);
|
|
68
|
+
} })),
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
if (props.startSections) {
|
|
72
|
+
sections = [
|
|
73
|
+
...props.startSections.map((section) => {
|
|
74
|
+
return {
|
|
75
|
+
title: section.title,
|
|
76
|
+
isValid: section.isValid,
|
|
77
|
+
isVisible: section.isVisible,
|
|
78
|
+
render: () => {
|
|
79
|
+
return section.render(adaptableOptions, setAdaptableOptions, setSelectedColumns);
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}),
|
|
83
|
+
...sections,
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
return (React.createElement(OnePageWizards_1.OnePageWizard, { data: adaptableOptions, name: "Configure", defaultCurrentSectionName: 'default section name', onHide: () => null, onFinish: handleFinish, sections: sections }));
|
|
87
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { NocodeColumn } from './ColumnsList';
|
|
3
|
+
import { AdaptableOptions } from '../../../types';
|
|
4
|
+
export interface ConfigurationWizardColumnsStepProps {
|
|
5
|
+
adaptableOptions: AdaptableOptions;
|
|
6
|
+
onChange: (newOptions: AdaptableOptions) => void;
|
|
7
|
+
columnsHandle: React.MutableRefObject<{
|
|
8
|
+
getColumns: () => any[];
|
|
9
|
+
getPrimaryKey: () => string;
|
|
10
|
+
}>;
|
|
11
|
+
setPrimaryKeyIsNotSelected: (enabled: boolean) => void;
|
|
12
|
+
onColumnChange: (columns: NocodeColumn[]) => void;
|
|
13
|
+
onSelectionChange: (column: any, flag: boolean) => void;
|
|
14
|
+
selectedColumns: {
|
|
15
|
+
[key: string]: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const ConfigurationWizardColumnsStep: React.FunctionComponent<ConfigurationWizardColumnsStepProps>;
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigurationWizardColumnsStep = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
|
|
7
|
+
const ColumnsList_1 = tslib_1.__importDefault(require("./ColumnsList"));
|
|
8
|
+
exports.ConfigurationWizardColumnsStep = (props) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return (React.createElement(Panel_1.default, { header: '', border: "none", bodyScroll: false, bodyProps: {
|
|
11
|
+
style: { overflow: 'auto', display: 'flex', flexFlow: 'column' },
|
|
12
|
+
}, borderRadius: "none", style: { fontSize: 16, flex: 1 } },
|
|
13
|
+
React.createElement(ColumnsList_1.default, { handle: props.columnsHandle, onValidityChange: (valid) => {
|
|
14
|
+
props.setPrimaryKeyIsNotSelected(valid);
|
|
15
|
+
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (_b = (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions) === null || _b === void 0 ? void 0 : _b.columnDefs })));
|
|
16
|
+
};
|