@adaptabletools/adaptable 10.0.3 → 10.0.4-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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/base.css +16 -6
- package/bundle.cjs.js +350 -0
- package/index.css +20 -6
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +14 -12
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
- package/src/AdaptableOptions/ContainerOptions.d.ts +4 -5
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
- package/src/AdaptableOptions/DateInputOptions.d.ts +5 -1
- package/src/AdaptableOptions/EditOptions.d.ts +2 -3
- package/src/AdaptableOptions/FilterOptions.d.ts +8 -8
- package/src/AdaptableOptions/GeneralOptions.d.ts +3 -2
- package/src/AdaptableOptions/MenuOptions.d.ts +11 -11
- package/src/AdaptableOptions/NotificationsOptions.d.ts +11 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +29 -12
- package/src/Api/AdaptableApi.d.ts +12 -12
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +16 -5
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +5 -8
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/Api/Events/BaseEventInfo.js +2 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +10 -10
- package/src/Api/Implementation/AlertApiImpl.js +17 -17
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -3
- package/src/Api/Implementation/ColumnApiImpl.js +43 -44
- package/src/Api/Implementation/ConfigApiImpl.js +0 -24
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -2
- package/src/Api/Implementation/GridApiImpl.js +14 -13
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -2
- package/src/Api/Implementation/InternalApiImpl.js +5 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +19 -3
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -2
- package/src/Api/Implementation/PluginsApiImpl.js +1 -1
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +5 -4
- package/src/Api/Implementation/UserInterfaceApiImpl.js +18 -13
- package/src/Api/InternalApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +7 -0
- package/src/Api/PluginsApi.d.ts +1 -7
- package/src/Api/TeamSharingApi.d.ts +1 -1
- package/src/Api/ThemeApi.d.ts +2 -2
- package/src/Api/UserInterfaceApi.d.ts +6 -5
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
- package/src/PredefinedConfig/AlertState.d.ts +2 -3
- package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +36 -36
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +3 -3
- package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +4 -3
- package/src/PredefinedConfig/Common/Menu.d.ts +40 -17
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +5 -5
- package/src/PredefinedConfig/Common/Types.js +9 -7
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +1 -1
- package/src/PredefinedConfig/CustomSortState.d.ts +1 -1
- package/src/PredefinedConfig/DataSourceState.d.ts +1 -1
- package/src/PredefinedConfig/ExportState.d.ts +3 -3
- package/src/PredefinedConfig/FilterState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +1 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -40
- package/src/PredefinedConfig/QuickSearchState.d.ts +3 -3
- package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/ThemeState.d.ts +5 -1
- package/src/Redux/ActionsReducers/DashboardRedux.js +2 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +3 -2
- package/src/Redux/ActionsReducers/GridRedux.js +2 -2
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +12 -2
- package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/DeadRedux.d.ts +4 -8
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -1
- package/src/Redux/Store/AdaptableStore.d.ts +3 -3
- package/src/Redux/Store/AdaptableStore.js +21 -16
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.d.ts +2 -2
- package/src/Strategy/AlertModule.js +13 -105
- package/src/Strategy/BulkUpdateModule.d.ts +2 -2
- package/src/Strategy/BulkUpdateModule.js +7 -7
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/DashboardModule.d.ts +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +2 -2
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/FilterModule.d.ts +2 -2
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +6 -6
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/Interface/IModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +22 -9
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +8 -9
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +2 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +7 -7
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +8 -7
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/Interface/Preview.d.ts +2 -1
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/LicenseService.js +16 -2
- package/src/Utilities/Services/MetamodelService.js +0 -1
- package/src/Utilities/Services/ReportService.js +12 -11
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/View/AdaptableViewFactory.d.ts +2 -1
- package/src/View/AdaptableViewFactory.js +2 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +7 -7
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +3 -3
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +2 -2
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.js +18 -20
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +1 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
- package/src/View/Components/FilterForm/QuickFilterForm.js +15 -17
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Panels/FilterFormPanel.d.ts +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +423 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +23 -10
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.js +4 -4
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +10 -11
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
- package/src/View/CustomSort/CustomSortPopup.js +2 -2
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +4 -4
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +11 -10
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Export/ExportViewPanel.js +6 -6
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +2 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridOptionsComponent.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +3 -3
- package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
- package/src/View/Schedule/SchedulePopup.js +3 -3
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +1 -1
- package/src/View/StateManagement/StateManagementPopup.d.ts +2 -12
- package/src/View/StateManagement/StateManagementPopup.js +21 -114
- package/src/View/StateManagement/StateManagementViewPanel.d.ts +5 -0
- package/src/View/StateManagement/StateManagementViewPanel.js +22 -0
- package/src/View/StateManagement/components/ClearButton.d.ts +6 -0
- package/src/View/StateManagement/components/ClearButton.js +9 -0
- package/src/View/StateManagement/components/ExportDropdown.d.ts +8 -0
- package/src/View/StateManagement/components/ExportDropdown.js +43 -0
- package/src/View/StateManagement/components/LoadButton.d.ts +7 -0
- package/src/View/StateManagement/components/LoadButton.js +38 -0
- package/src/View/StateManagement/handleExportState.d.ts +1 -0
- package/src/View/StateManagement/handleExportState.js +22 -0
- package/src/View/Theme/ThemeViewPanel.js +1 -1
- package/src/agGrid/ActionColumnRenderer.js +1 -1
- package/src/agGrid/Adaptable.d.ts +9 -8
- package/src/agGrid/Adaptable.js +174 -132
- package/src/agGrid/agGridHelper.d.ts +4 -4
- package/src/agGrid/agGridHelper.js +46 -46
- package/src/agGrid/agGridMenuHelper.d.ts +15 -13
- package/src/agGrid/agGridMenuHelper.js +55 -47
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -6
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -2
- package/src/agGrid/editors/AdaptableDateEditor/index.js +16 -6
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +7 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Datepicker/DatepickerContext.d.ts +2 -2
- package/src/components/Datepicker/index.js +9 -5
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Modal/index.d.ts +1 -1
- package/src/components/OverlayTrigger/index.js +3 -3
- package/src/components/OverlayTrigger/useAgGridClassName.d.ts +2 -0
- package/src/components/OverlayTrigger/{useVendorClassName.js → useAgGridClassName.js} +3 -3
- package/src/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/upload.d.ts +3 -0
- package/src/components/icons/upload.js +8 -0
- package/src/metamodel/adaptable.metamodel.d.ts +104 -50
- package/src/metamodel/adaptable.metamodel.js +358 -300
- package/src/types.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/PredefinedConfig/DeprecatedState.d.ts +0 -82
- package/src/PredefinedConfig/DeprecatedState.js +0 -5
- package/src/components/OverlayTrigger/useVendorClassName.d.ts +0 -2
|
@@ -16,10 +16,10 @@ import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
|
|
|
16
16
|
export declare class agGridHelper {
|
|
17
17
|
private adaptable;
|
|
18
18
|
private gridOptions;
|
|
19
|
-
private
|
|
19
|
+
private initialAgGridColDefs;
|
|
20
20
|
constructor(adaptable: IAdaptable, gridOptions: GridOptions);
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
getAgGridLightThemeName(): string;
|
|
22
|
+
getAgGridDarkThemeName(): string;
|
|
23
23
|
setUpModules(): Map<AdaptableModule, IModule>;
|
|
24
24
|
TrySetUpNodeIds(): boolean;
|
|
25
25
|
createSparklineCellRendererComp(sparkline: SparklineColumn): ICellRendererFunc | undefined;
|
|
@@ -27,7 +27,7 @@ export declare class agGridHelper {
|
|
|
27
27
|
createNumericStyleRendererFunc(formatColumn: FormatColumn): ICellRendererFunc;
|
|
28
28
|
getCleanValue(value: string): string | undefined;
|
|
29
29
|
getRenderedValue(colDef: ColDef, valueToRender: any): any;
|
|
30
|
-
|
|
30
|
+
createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
|
|
31
31
|
createAdaptableSideBarDefs(showFilterPanel: boolean, showColumnsPanel: boolean): SideBarDef;
|
|
32
32
|
createAdaptableToolPanel(): ToolPanelDef;
|
|
33
33
|
orderToolPanels(toolPanelDefs: (ToolPanelDef | string)[]): void;
|
|
@@ -49,17 +49,17 @@ class agGridHelper {
|
|
|
49
49
|
constructor(adaptable, gridOptions) {
|
|
50
50
|
this.adaptable = adaptable;
|
|
51
51
|
this.gridOptions = gridOptions;
|
|
52
|
-
this.
|
|
52
|
+
this.initialAgGridColDefs = {};
|
|
53
53
|
this.adaptable = adaptable;
|
|
54
54
|
this.gridOptions = gridOptions;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
getAgGridLightThemeName() {
|
|
57
57
|
// we try not to call these two methods, as we try to detect the default grid
|
|
58
58
|
// theme from the grid container element - users should set their aggrid theme in html, on the container element
|
|
59
59
|
// so we read it from there. if we don't find it there, we'll call this method, as a last resort.
|
|
60
60
|
return 'ag-theme-balham';
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
getAgGridDarkThemeName() {
|
|
63
63
|
return 'ag-theme-balham-dark';
|
|
64
64
|
}
|
|
65
65
|
setUpModules() {
|
|
@@ -74,6 +74,7 @@ class agGridHelper {
|
|
|
74
74
|
modules.set(ModuleConstants.CellSummaryModuleId, new CellSummaryModule_1.CellSummaryModule(api));
|
|
75
75
|
modules.set(ModuleConstants.ConditionalStyleModuleId, new ConditionalStyleModule_1.ConditionalStyleModule(api));
|
|
76
76
|
modules.set(ModuleConstants.CustomSortModuleId, new CustomSortModule_1.CustomSortModule(api));
|
|
77
|
+
modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(api));
|
|
77
78
|
modules.set(ModuleConstants.DataSourceModuleId, new DataSourceModule_1.DataSourceModule(api));
|
|
78
79
|
modules.set(ModuleConstants.ExportModuleId, new ExportModule_1.ExportModule(api));
|
|
79
80
|
modules.set(ModuleConstants.FilterModuleId, new FilterModule_1.FilterModule(api));
|
|
@@ -92,7 +93,6 @@ class agGridHelper {
|
|
|
92
93
|
modules.set(ModuleConstants.SystemStatusModuleId, new SystemStatusModule_1.SystemStatusModule(api));
|
|
93
94
|
modules.set(ModuleConstants.ThemeModuleId, new ThemeModule_1.ThemeModule(api));
|
|
94
95
|
modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule_1.GridInfoModule(api));
|
|
95
|
-
modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(api));
|
|
96
96
|
return modules;
|
|
97
97
|
}
|
|
98
98
|
TrySetUpNodeIds() {
|
|
@@ -203,53 +203,52 @@ class agGridHelper {
|
|
|
203
203
|
}
|
|
204
204
|
return render({ value: valueToRender }) || '';
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
const colId =
|
|
208
|
-
const colDef =
|
|
209
|
-
const FriendlyName = this.gridOptions.columnApi.getDisplayNameForColumn(
|
|
210
|
-
if (!this.
|
|
211
|
-
this.
|
|
206
|
+
createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups) {
|
|
207
|
+
const colId = agGridColumn.getColId();
|
|
208
|
+
const colDef = agGridColumn.getColDef();
|
|
209
|
+
const FriendlyName = this.gridOptions.columnApi.getDisplayNameForColumn(agGridColumn, 'header');
|
|
210
|
+
if (!this.initialAgGridColDefs[colId]) {
|
|
211
|
+
this.initialAgGridColDefs[colId] = Object.assign({}, agGridColumn.getUserProvidedColDef());
|
|
212
212
|
}
|
|
213
213
|
const ColumnId = colId;
|
|
214
214
|
const pkColumn = this.adaptable.adaptableOptions.primaryKey;
|
|
215
215
|
let ColumnGroup = colsToGroups === null || colsToGroups === void 0 ? void 0 : colsToGroups[ColumnId];
|
|
216
216
|
const abColumn = {
|
|
217
217
|
Uuid: Uuid_1.createUuid(),
|
|
218
|
-
ColumnId,
|
|
219
|
-
FriendlyName,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
ColumnGroup,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
218
|
+
columnId: ColumnId,
|
|
219
|
+
friendlyName: FriendlyName,
|
|
220
|
+
isPrimaryKey: ColumnId === pkColumn,
|
|
221
|
+
dataType: this.getColumnDataType(agGridColumn, false),
|
|
222
|
+
visible: agGridColumn.isVisible(),
|
|
223
|
+
readOnly: this.isColumnReadonly(colDef),
|
|
224
|
+
columnGroup: ColumnGroup,
|
|
225
|
+
sortable: this.isColumnSortable(colDef),
|
|
226
|
+
filterable: this.isColumnFilterable(colDef),
|
|
227
|
+
groupable: this.isColumnGroupable(colDef),
|
|
228
|
+
pivotable: this.isColumnPivotable(colDef),
|
|
229
|
+
aggregatable: this.isColumnAggregetable(colDef),
|
|
230
|
+
availableAggregationFunctions: null,
|
|
231
|
+
aggregationFunction: null,
|
|
232
|
+
moveable: this.isColumnMoveable(colDef),
|
|
233
|
+
hideable: this.isColumnHideable(colDef),
|
|
234
|
+
queryable: this.isColumnQueryable(colDef, ColumnId),
|
|
235
|
+
isGrouped: this.isColumnGrouped(colDef),
|
|
236
|
+
isFixed: this.isColumnFixed(colDef),
|
|
237
237
|
//TODO add IsPinned??
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
isSparkline: this.adaptable.api.sparklineColumnApi.isSparklineColumn(colId),
|
|
239
|
+
isExcludedFromQuickSearch: false,
|
|
240
240
|
};
|
|
241
|
-
if (abColumn.
|
|
242
|
-
abColumn.
|
|
241
|
+
if (abColumn.aggregatable) {
|
|
242
|
+
abColumn.availableAggregationFunctions = this.getColumnAggregationFunctions(colDef);
|
|
243
243
|
if (typeof colDef.aggFunc === 'string') {
|
|
244
|
-
abColumn.
|
|
244
|
+
abColumn.aggregationFunction = colDef.aggFunc;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
// lets set this here one as the function cannot change the result so dont need to run it each time
|
|
248
|
-
let excludeColumnFromQuickSearch = this.adaptable.adaptableOptions.searchOptions
|
|
249
|
-
.excludeColumnFromQuickSearch;
|
|
248
|
+
let excludeColumnFromQuickSearch = this.adaptable.adaptableOptions.searchOptions.excludeColumnFromQuickSearch;
|
|
250
249
|
if (excludeColumnFromQuickSearch) {
|
|
251
250
|
if (excludeColumnFromQuickSearch(abColumn)) {
|
|
252
|
-
abColumn.
|
|
251
|
+
abColumn.isExcludedFromQuickSearch = true;
|
|
253
252
|
}
|
|
254
253
|
}
|
|
255
254
|
return abColumn;
|
|
@@ -286,10 +285,10 @@ class agGridHelper {
|
|
|
286
285
|
}
|
|
287
286
|
createAdaptableToolPanel() {
|
|
288
287
|
return {
|
|
289
|
-
id: '
|
|
288
|
+
id: 'adaptable',
|
|
290
289
|
toolPanel: 'AdaptableToolPanel',
|
|
291
290
|
labelDefault: this.adaptable.adaptableOptions.toolPanelOptions.adaptableToolPanelTitle,
|
|
292
|
-
labelKey: '
|
|
291
|
+
labelKey: 'adaptable',
|
|
293
292
|
iconKey: this.adaptable.adaptableOptions.toolPanelOptions.iconKey,
|
|
294
293
|
width: this.adaptable.adaptableOptions.toolPanelOptions.width,
|
|
295
294
|
minWidth: this.adaptable.adaptableOptions.toolPanelOptions.minWidth,
|
|
@@ -322,6 +321,7 @@ class agGridHelper {
|
|
|
322
321
|
}
|
|
323
322
|
fireSelectionChangedEvent() {
|
|
324
323
|
let selectionChangedInfo = {
|
|
324
|
+
adaptableApi: this.adaptable.api,
|
|
325
325
|
selectedCellInfo: this.adaptable.api.gridApi.getGridState().SelectedCellInfo,
|
|
326
326
|
selectedRowInfo: this.adaptable.api.gridApi.getGridState().SelectedRowInfo,
|
|
327
327
|
};
|
|
@@ -435,8 +435,8 @@ class agGridHelper {
|
|
|
435
435
|
let dataType = Enums_1.DataType.Unknown;
|
|
436
436
|
// get the column type if already in store (and not unknown)
|
|
437
437
|
const existingColumn = this.adaptable.api.columnApi.getColumnFromId(column.getId(), logWarning);
|
|
438
|
-
if (existingColumn && existingColumn.
|
|
439
|
-
return existingColumn.
|
|
438
|
+
if (existingColumn && existingColumn.dataType != Enums_1.DataType.Unknown) {
|
|
439
|
+
return existingColumn.dataType;
|
|
440
440
|
}
|
|
441
441
|
// check for column type
|
|
442
442
|
const colType = column.getColDef().type;
|
|
@@ -574,7 +574,7 @@ class agGridHelper {
|
|
|
574
574
|
return function compareItemsOfCustomSort(nodeA, nodeB) {
|
|
575
575
|
let firstGroupedColumn = adaptable.getFirstGroupedColumn();
|
|
576
576
|
if (firstGroupedColumn) {
|
|
577
|
-
const definedColumnComparator = adaptable.getActiveColumnComparator(firstGroupedColumn.
|
|
577
|
+
const definedColumnComparator = adaptable.getActiveColumnComparator(firstGroupedColumn.columnId, adaptable.api.customSortApi.getCustomSortByColumn(firstGroupedColumn.columnId), adaptable.api.internalApi.getCustomSortComparer(firstGroupedColumn));
|
|
578
578
|
if (definedColumnComparator) {
|
|
579
579
|
return definedColumnComparator(nodeA.key, nodeB.key);
|
|
580
580
|
}
|
|
@@ -610,10 +610,10 @@ class agGridHelper {
|
|
|
610
610
|
headerFontWeight: headerColStyle.fontWeight,
|
|
611
611
|
height: Number(headerColStyle.height.replace('px', '')),
|
|
612
612
|
Columns: this.adaptable.api.columnApi.getColumns().map((col) => {
|
|
613
|
-
const headerColumn = document.querySelector(`.ag-header-cell[col-id='${col.
|
|
613
|
+
const headerColumn = document.querySelector(`.ag-header-cell[col-id='${col.columnId}']`);
|
|
614
614
|
const headerColumnStyle = window.getComputedStyle(headerColumn || headerFirstCol, null);
|
|
615
615
|
return {
|
|
616
|
-
columnFriendlyName: col.
|
|
616
|
+
columnFriendlyName: col.friendlyName,
|
|
617
617
|
width: Number(headerColumnStyle.width.replace('px', '')),
|
|
618
618
|
textAlign: headerColumnStyle.textAlign,
|
|
619
619
|
};
|
|
@@ -629,10 +629,10 @@ class agGridHelper {
|
|
|
629
629
|
fontWeight: firstRowStyle.fontWeight,
|
|
630
630
|
height: Number(firstRowStyle.height.replace('px', '')),
|
|
631
631
|
Columns: this.adaptable.api.columnApi.getColumns().map((col) => {
|
|
632
|
-
const cellElement = document.querySelector(`.ag-cell[col-id='${col.
|
|
632
|
+
const cellElement = document.querySelector(`.ag-cell[col-id='${col.columnId}']`);
|
|
633
633
|
const headerColumnStyle = window.getComputedStyle(cellElement || firstRow, null);
|
|
634
634
|
return {
|
|
635
|
-
columnFriendlyName: col.
|
|
635
|
+
columnFriendlyName: col.friendlyName,
|
|
636
636
|
width: Number(headerColumnStyle.width.replace('px', '')),
|
|
637
637
|
textAlign: headerColumnStyle.textAlign,
|
|
638
638
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GridOptions, MenuItemDef, GetContextMenuItemsParams, GetMainMenuItems, GetMainMenuItemsParams, GetContextMenuItems, Column } from '@ag-grid-community/all-modules';
|
|
2
|
-
import { AdaptableMenuItem,
|
|
2
|
+
import { AdaptableMenuItem, ColumnMenuContext, ContextMenuContext, UserMenuItem } from '../PredefinedConfig/Common/Menu';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
4
|
import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
5
5
|
export declare class agGridMenuHelper {
|
|
@@ -10,20 +10,22 @@ export declare class agGridMenuHelper {
|
|
|
10
10
|
buildContextMenu(params: GetContextMenuItemsParams, originalgetContextMenuItems: GetContextMenuItems): (string | MenuItemDef)[];
|
|
11
11
|
createRemoveGroupsMenuItem(x: AdaptableMenuItem): MenuItemDef;
|
|
12
12
|
createAgGridMenuDefFromAdaptableMenu(adaptableMenuItem: AdaptableMenuItem): MenuItemDef;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
createAgGridColumnMenuDefFromUserMenu(menuItem: UserMenuItem<ColumnMenuContext>, menuContext: ColumnMenuContext): MenuItemDef;
|
|
14
|
+
createAgGridContextMenuDefFromUserMenu(menuItem: UserMenuItem<ContextMenuContext>, menuContext: ContextMenuContext): MenuItemDef;
|
|
15
|
+
createAdaptableColumnMenuItemFromUserMenu(menuItem: UserMenuItem<ColumnMenuContext>, menuContext: ColumnMenuContext): AdaptableMenuItem;
|
|
16
|
+
createAgGridColumnMenuItems(originalgetMainMenuItems: GetMainMenuItems, params: GetMainMenuItemsParams): (string | MenuItemDef)[] | undefined;
|
|
16
17
|
createGroupedColumnMenuItem(): MenuItemDef | undefined;
|
|
17
|
-
createAdaptableColumnMenuItems(adaptableColumn: AdaptableColumn, menuContext:
|
|
18
|
-
createUserColumnMenuItems(menuContext:
|
|
19
|
-
createColumnMenuContextObject(adaptableColumn: AdaptableColumn,
|
|
20
|
-
createContextMenuContextObject(params: GetContextMenuItemsParams, adaptableColumn: AdaptableColumn):
|
|
21
|
-
|
|
22
|
-
createAdaptableContextMenuItems(menuContext:
|
|
23
|
-
createAgGridAdaptableContextMenuItems(adaptableMenuItems: AdaptableMenuItem[], menuContext:
|
|
24
|
-
createAgGridUserContextMenuItems(userContextMenuItems: UserMenuItem[], menuContext:
|
|
18
|
+
createAdaptableColumnMenuItems(adaptableColumn: AdaptableColumn, menuContext: ColumnMenuContext): MenuItemDef[];
|
|
19
|
+
createUserColumnMenuItems(menuContext: ColumnMenuContext): MenuItemDef[];
|
|
20
|
+
createColumnMenuContextObject(adaptableColumn: AdaptableColumn, agGridColumn: Column): ColumnMenuContext;
|
|
21
|
+
createContextMenuContextObject(params: GetContextMenuItemsParams, adaptableColumn: AdaptableColumn): ContextMenuContext;
|
|
22
|
+
createAgGridContextMenuItems(originalgetContextMenuItems: GetContextMenuItems, params: GetContextMenuItemsParams): (string | MenuItemDef)[] | undefined;
|
|
23
|
+
createAdaptableContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[];
|
|
24
|
+
createAgGridAdaptableContextMenuItems(adaptableMenuItems: AdaptableMenuItem[], menuContext: ContextMenuContext): MenuItemDef[];
|
|
25
|
+
createAgGridUserContextMenuItems(userContextMenuItems: UserMenuItem<ContextMenuContext>[], menuContext: ContextMenuContext): MenuItemDef[];
|
|
25
26
|
private getAdaptableMenuItemsColumnHeader;
|
|
26
|
-
private
|
|
27
|
+
private getLabelFromUserColumnMenuItem;
|
|
28
|
+
private getLabelFromUserContextMenuItem;
|
|
27
29
|
private getUserMenuItemsColumnHeader;
|
|
28
30
|
buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
|
|
29
31
|
}
|
|
@@ -16,16 +16,15 @@ class agGridMenuHelper {
|
|
|
16
16
|
buildColumnMenu(params, originalgetMainMenuItems) {
|
|
17
17
|
// couldnt find a way to listen for menu close. There is a Menu Item Select, but you can also close menu from filter and clicking outside menu....
|
|
18
18
|
const colId = params.column.getColId();
|
|
19
|
-
let
|
|
19
|
+
let agGridColumnMenuItems = [];
|
|
20
20
|
let adaptableColumnMenuItems = [];
|
|
21
21
|
let userColumnMenuItems = [];
|
|
22
|
-
//First get
|
|
23
|
-
|
|
24
|
-
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions
|
|
25
|
-
.showAdaptableColumnMenu;
|
|
22
|
+
//First get Ag Grid Column Items
|
|
23
|
+
agGridColumnMenuItems.push(...this.createAgGridColumnMenuItems(originalgetMainMenuItems, params));
|
|
24
|
+
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableColumnMenu;
|
|
26
25
|
let hasAdaptableColumnMenuItems = showAdaptableColumnMenu == null || showAdaptableColumnMenu !== false;
|
|
27
26
|
if (hasAdaptableColumnMenuItems) {
|
|
28
|
-
|
|
27
|
+
agGridColumnMenuItems.push('separator');
|
|
29
28
|
}
|
|
30
29
|
const adaptableColumn = this.adaptable.api.columnApi.getColumnFromId(colId);
|
|
31
30
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
@@ -44,7 +43,7 @@ class agGridMenuHelper {
|
|
|
44
43
|
// Finally get all the User Menu Items
|
|
45
44
|
userColumnMenuItems.push(...this.createUserColumnMenuItems(menuContext));
|
|
46
45
|
const map = {
|
|
47
|
-
|
|
46
|
+
aggrid: agGridColumnMenuItems,
|
|
48
47
|
adaptable: adaptableColumnMenuItems,
|
|
49
48
|
user: userColumnMenuItems,
|
|
50
49
|
};
|
|
@@ -53,19 +52,18 @@ class agGridMenuHelper {
|
|
|
53
52
|
}));
|
|
54
53
|
}
|
|
55
54
|
buildContextMenu(params, originalgetContextMenuItems) {
|
|
56
|
-
let
|
|
55
|
+
let agGridContextMenuItems = [];
|
|
57
56
|
let adaptableContextMenuItems = [];
|
|
58
57
|
let userContextMenuItems = [];
|
|
59
|
-
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions
|
|
60
|
-
.showAdaptableContextMenu;
|
|
58
|
+
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableContextMenu;
|
|
61
59
|
let hasAdaptableContextMenuItems = showAdaptableContextMenu == null || showAdaptableContextMenu !== false;
|
|
62
60
|
let userDefinedContextMenuItems = this.adaptable.adaptableOptions.menuOptions.contextMenuItems;
|
|
63
61
|
let hasUserDefinedContextMenuItems = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(userDefinedContextMenuItems);
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
|
|
62
|
+
const agGridMenuItems = this.createAgGridContextMenuItems(originalgetContextMenuItems, params);
|
|
63
|
+
if (agGridMenuItems) {
|
|
64
|
+
agGridContextMenuItems.push(...agGridMenuItems);
|
|
67
65
|
if (hasAdaptableContextMenuItems || hasUserDefinedContextMenuItems) {
|
|
68
|
-
|
|
66
|
+
agGridContextMenuItems.push('separator');
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
const adaptableMenuItems = [];
|
|
@@ -91,7 +89,7 @@ class agGridMenuHelper {
|
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
91
|
const map = {
|
|
94
|
-
|
|
92
|
+
aggrid: agGridContextMenuItems,
|
|
95
93
|
adaptable: adaptableContextMenuItems,
|
|
96
94
|
user: userContextMenuItems,
|
|
97
95
|
};
|
|
@@ -133,25 +131,40 @@ class agGridMenuHelper {
|
|
|
133
131
|
subMenu: subMenuItems,
|
|
134
132
|
};
|
|
135
133
|
}
|
|
136
|
-
|
|
134
|
+
createAgGridColumnMenuDefFromUserMenu(menuItem, menuContext) {
|
|
137
135
|
const fn = menuItem.onClick;
|
|
138
136
|
const disabled = menuItem.disabled && menuItem.disabled(menuContext);
|
|
139
137
|
return {
|
|
140
|
-
name: this.
|
|
138
|
+
name: this.getLabelFromUserColumnMenuItem(menuItem, menuContext),
|
|
141
139
|
action: () => (fn ? fn(menuContext) : null),
|
|
142
140
|
icon: menuItem.icon,
|
|
143
141
|
disabled: disabled,
|
|
144
142
|
subMenu: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(menuItem.subMenuItems)
|
|
145
143
|
? undefined
|
|
146
144
|
: menuItem.subMenuItems.map((subMenuItem) => {
|
|
147
|
-
return this.
|
|
145
|
+
return this.createAgGridColumnMenuDefFromUserMenu(subMenuItem, menuContext);
|
|
148
146
|
}),
|
|
149
147
|
};
|
|
150
148
|
}
|
|
151
|
-
|
|
149
|
+
createAgGridContextMenuDefFromUserMenu(menuItem, menuContext) {
|
|
150
|
+
const fn = menuItem.onClick;
|
|
151
|
+
const disabled = menuItem.disabled && menuItem.disabled(menuContext);
|
|
152
|
+
return {
|
|
153
|
+
name: this.getLabelFromUserContextMenuItem(menuItem, menuContext),
|
|
154
|
+
action: () => (fn ? fn(menuContext) : null),
|
|
155
|
+
icon: menuItem.icon,
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
subMenu: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(menuItem.subMenuItems)
|
|
158
|
+
? undefined
|
|
159
|
+
: menuItem.subMenuItems.map((subMenuItem) => {
|
|
160
|
+
return this.createAgGridContextMenuDefFromUserMenu(subMenuItem, menuContext);
|
|
161
|
+
}),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
createAdaptableColumnMenuItemFromUserMenu(menuItem, menuContext) {
|
|
152
165
|
const fn = menuItem.onClick;
|
|
153
166
|
let adaptableMenuItem = {
|
|
154
|
-
label: this.
|
|
167
|
+
label: this.getLabelFromUserColumnMenuItem(menuItem, menuContext),
|
|
155
168
|
reduxAction: null,
|
|
156
169
|
onClick: () => (fn ? fn(menuContext) : null),
|
|
157
170
|
isVisible: true,
|
|
@@ -159,7 +172,7 @@ class agGridMenuHelper {
|
|
|
159
172
|
};
|
|
160
173
|
return adaptableMenuItem;
|
|
161
174
|
}
|
|
162
|
-
|
|
175
|
+
createAgGridColumnMenuItems(originalgetMainMenuItems, params) {
|
|
163
176
|
// if there was an initial implementation we init the list of menu items with this one; otherwise we take the default items
|
|
164
177
|
return originalgetMainMenuItems
|
|
165
178
|
? originalgetMainMenuItems(params)
|
|
@@ -195,26 +208,18 @@ class agGridMenuHelper {
|
|
|
195
208
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(userColumnMenuItems)) {
|
|
196
209
|
userColumnMenuItems.forEach((userMenuItem) => {
|
|
197
210
|
// And then convert them into Menu Item Defs
|
|
198
|
-
let menuItem = this.
|
|
211
|
+
let menuItem = this.createAgGridColumnMenuDefFromUserMenu(userMenuItem, menuContext);
|
|
199
212
|
columnMenuItems.push(menuItem);
|
|
200
213
|
});
|
|
201
214
|
}
|
|
202
215
|
return columnMenuItems;
|
|
203
216
|
}
|
|
204
|
-
createColumnMenuContextObject(adaptableColumn,
|
|
217
|
+
createColumnMenuContextObject(adaptableColumn, agGridColumn) {
|
|
205
218
|
return {
|
|
206
|
-
gridCell: undefined,
|
|
207
219
|
adaptableColumn: adaptableColumn,
|
|
208
|
-
|
|
209
|
-
isSelectedCell: false,
|
|
210
|
-
isSingleSelectedColumn: false,
|
|
211
|
-
isGroupedNode: false,
|
|
212
|
-
rowNode: undefined,
|
|
213
|
-
primaryKeyValue: undefined,
|
|
214
|
-
selectedCellInfo: this.adaptable.api.gridApi.getSelectedCellInfo(),
|
|
215
|
-
selectedRowInfo: this.adaptable.api.gridApi.getSelectedRowInfo(),
|
|
220
|
+
agGridColumn: agGridColumn,
|
|
216
221
|
adaptableApi: this.adaptable.api,
|
|
217
|
-
isRowGroupColumn: this.adaptable.api.columnApi.isRowGroupColumn(
|
|
222
|
+
isRowGroupColumn: this.adaptable.api.columnApi.isRowGroupColumn(agGridColumn.getColId()),
|
|
218
223
|
};
|
|
219
224
|
}
|
|
220
225
|
createContextMenuContextObject(params, adaptableColumn) {
|
|
@@ -223,12 +228,12 @@ class agGridMenuHelper {
|
|
|
223
228
|
let isSelectedCell = false;
|
|
224
229
|
let clickedCell = undefined;
|
|
225
230
|
if (adaptableColumn) {
|
|
226
|
-
clickedCell = this.adaptable.getGridCellFromRowNode(params.node, adaptableColumn.
|
|
231
|
+
clickedCell = this.adaptable.getGridCellFromRowNode(params.node, adaptableColumn.columnId);
|
|
227
232
|
}
|
|
228
233
|
let selectedCellInfo = this.adaptable.setSelectedCells();
|
|
229
234
|
if (clickedCell && selectedCellInfo) {
|
|
230
235
|
let matchedCell = selectedCellInfo.gridCells.find((gc) => gc != null &&
|
|
231
|
-
gc.
|
|
236
|
+
gc.column == clickedCell.column &&
|
|
232
237
|
gc.primaryKeyValue == clickedCell.primaryKeyValue);
|
|
233
238
|
isSelectedCell = matchedCell != null;
|
|
234
239
|
if (isSelectedCell) {
|
|
@@ -240,7 +245,7 @@ class agGridMenuHelper {
|
|
|
240
245
|
isSelectedCell: isSelectedCell,
|
|
241
246
|
gridCell: clickedCell,
|
|
242
247
|
adaptableColumn: adaptableColumn,
|
|
243
|
-
|
|
248
|
+
agGridColumn: params.column,
|
|
244
249
|
rowNode: params.node,
|
|
245
250
|
isGroupedNode: params.node ? params.node.group : false,
|
|
246
251
|
isSingleSelectedColumn: isSingleSelectedColumn,
|
|
@@ -251,7 +256,7 @@ class agGridMenuHelper {
|
|
|
251
256
|
isRowGroupColumn: this.adaptable.api.columnApi.isRowGroupColumn(params.column.getColId()),
|
|
252
257
|
};
|
|
253
258
|
}
|
|
254
|
-
|
|
259
|
+
createAgGridContextMenuItems(originalgetContextMenuItems, params) {
|
|
255
260
|
// if there was an initial implementation we init the list of menu items with this one, otherwise we take default items
|
|
256
261
|
// this allows us to ensure that devs can still create their own agGrid context menu without losing ours
|
|
257
262
|
return originalgetContextMenuItems
|
|
@@ -278,8 +283,7 @@ class agGridMenuHelper {
|
|
|
278
283
|
// here we create agGrid Menu items based on Adaptable Menu Items
|
|
279
284
|
// user has ability to decide whether to show or not
|
|
280
285
|
let contextMenuItems = [];
|
|
281
|
-
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions
|
|
282
|
-
.showAdaptableContextMenu;
|
|
286
|
+
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableContextMenu;
|
|
283
287
|
if (showAdaptableContextMenu == null || showAdaptableContextMenu !== false) {
|
|
284
288
|
adaptableMenuItems.forEach((adaptableMenuItem) => {
|
|
285
289
|
if (adaptableMenuItem) {
|
|
@@ -306,7 +310,7 @@ class agGridMenuHelper {
|
|
|
306
310
|
return userMenuItem.hidden ? !userMenuItem.hidden(menuContext) : true;
|
|
307
311
|
})
|
|
308
312
|
.forEach((userMenuItem) => {
|
|
309
|
-
let menuItem = this.
|
|
313
|
+
let menuItem = this.createAgGridContextMenuDefFromUserMenu(userMenuItem, menuContext);
|
|
310
314
|
contextMenuItems.push(menuItem);
|
|
311
315
|
});
|
|
312
316
|
return contextMenuItems;
|
|
@@ -314,8 +318,7 @@ class agGridMenuHelper {
|
|
|
314
318
|
// method to get all the Adaptable Menu Items - together with running the function where user can choose whether or not to display
|
|
315
319
|
getAdaptableMenuItemsColumnHeader(adaptableColumn, menuContext) {
|
|
316
320
|
const adaptableMenuItems = [];
|
|
317
|
-
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions
|
|
318
|
-
.showAdaptableColumnMenu;
|
|
321
|
+
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableColumnMenu;
|
|
319
322
|
let runCheck = showAdaptableColumnMenu == null || showAdaptableColumnMenu !== false;
|
|
320
323
|
// if (adaptableColumn != null) {
|
|
321
324
|
this.adaptable.modules.forEach((s) => {
|
|
@@ -343,10 +346,15 @@ class agGridMenuHelper {
|
|
|
343
346
|
// }
|
|
344
347
|
return adaptableMenuItems;
|
|
345
348
|
}
|
|
346
|
-
|
|
347
|
-
return typeof
|
|
348
|
-
?
|
|
349
|
-
:
|
|
349
|
+
getLabelFromUserColumnMenuItem(userColumnMenuItem, menuContext) {
|
|
350
|
+
return typeof userColumnMenuItem.label === 'function'
|
|
351
|
+
? userColumnMenuItem.label(menuContext)
|
|
352
|
+
: userColumnMenuItem.label;
|
|
353
|
+
}
|
|
354
|
+
getLabelFromUserContextMenuItem(userContextMenuItem, menuContext) {
|
|
355
|
+
return typeof userContextMenuItem.label === 'function'
|
|
356
|
+
? userContextMenuItem.label(menuContext)
|
|
357
|
+
: userContextMenuItem.label;
|
|
350
358
|
}
|
|
351
359
|
getUserMenuItemsColumnHeader(menuContext) {
|
|
352
360
|
var _a, _b;
|
|
@@ -361,7 +369,7 @@ class agGridMenuHelper {
|
|
|
361
369
|
let userColumnMenuItems = this.getUserMenuItemsColumnHeader(menuContext);
|
|
362
370
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(userColumnMenuItems)) {
|
|
363
371
|
userColumnMenuItems.forEach((userMenuItem) => {
|
|
364
|
-
let adaptableMenuItem = this.
|
|
372
|
+
let adaptableMenuItem = this.createAdaptableColumnMenuItemFromUserMenu(userMenuItem, menuContext);
|
|
365
373
|
returnMenuItems.push(adaptableMenuItem);
|
|
366
374
|
});
|
|
367
375
|
}
|
|
@@ -7,7 +7,7 @@ export declare type InternalAdaptableDateEditorProps = {
|
|
|
7
7
|
value?: string | Date | number | null;
|
|
8
8
|
dateFormat: string;
|
|
9
9
|
onValueChange?: (value: Date | null) => void;
|
|
10
|
-
|
|
10
|
+
onStopEdit?: (keyboardEventKey?: string) => void;
|
|
11
11
|
showClearButton?: boolean;
|
|
12
12
|
};
|
|
13
13
|
export declare const InternalAdaptableDateEditor: React.ForwardRefExoticComponent<InternalAdaptableDateEditorProps & React.RefAttributes<InternalAdaptableDateEditorApi>>;
|
|
@@ -34,9 +34,14 @@ exports.InternalAdaptableDateEditor = React.forwardRef((props, ref) => {
|
|
|
34
34
|
};
|
|
35
35
|
const [value, setValue] = useProperty_1.default(props, 'value', props.defaultValue, {
|
|
36
36
|
onChange: (value) => {
|
|
37
|
-
var _a;
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
var _a, _b;
|
|
38
|
+
if (value === '' || value == undefined) {
|
|
39
|
+
(_a = props.onValueChange) === null || _a === void 0 ? void 0 : _a.call(props, null);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const date = typeof value === 'string' ? parseISO_1.default(value) : new Date(value);
|
|
43
|
+
(_b = props.onValueChange) === null || _b === void 0 ? void 0 : _b.call(props, date);
|
|
44
|
+
}
|
|
40
45
|
},
|
|
41
46
|
});
|
|
42
47
|
React.useImperativeHandle(ref, () => {
|
|
@@ -50,12 +55,12 @@ exports.InternalAdaptableDateEditor = React.forwardRef((props, ref) => {
|
|
|
50
55
|
}, []);
|
|
51
56
|
return (React.createElement("div", { style: hostStyle },
|
|
52
57
|
React.createElement(DatepickerContext_1.DatepickerContext.Provider, { value: {
|
|
53
|
-
onHide: () => {
|
|
58
|
+
onHide: (keyboardEventKey) => {
|
|
54
59
|
var _a;
|
|
55
|
-
(_a = props.
|
|
60
|
+
(_a = props.onStopEdit) === null || _a === void 0 ? void 0 : _a.call(props, keyboardEventKey);
|
|
56
61
|
},
|
|
57
62
|
onShow: () => { },
|
|
58
|
-
showClearButton: (_a = props.showClearButton) !== null && _a !== void 0 ? _a :
|
|
63
|
+
showClearButton: (_a = props.showClearButton) !== null && _a !== void 0 ? _a : true,
|
|
59
64
|
} },
|
|
60
65
|
React.createElement(AdaptableInput_1.default, { type: 'date', value: stringValue, onChange: onChange, style: inputStyle, ref: inputRef }))));
|
|
61
66
|
});
|
|
@@ -9,13 +9,13 @@ import { IAdaptable } from '../../../AdaptableInterfaces/IAdaptable';
|
|
|
9
9
|
* field: 'tradeDate',
|
|
10
10
|
* type: 'abColDefDate',
|
|
11
11
|
* cellEditorParams: {
|
|
12
|
-
* showClearButton:
|
|
12
|
+
* showClearButton: true
|
|
13
13
|
* }
|
|
14
14
|
* }
|
|
15
15
|
*
|
|
16
16
|
* For now, there is just 1 editor param you can configure:
|
|
17
17
|
*
|
|
18
|
-
* cellEditorParams.showClearButton - defaults to `
|
|
18
|
+
* cellEditorParams.showClearButton - defaults to `true` - whether to show the clear button.
|
|
19
19
|
*
|
|
20
20
|
* When the colDef has a `valueParser` provided as a function, it will be used before setting the value for the cell.
|
|
21
21
|
* This is useful because dates can be stored as strings, numbers or Date instances - the value parser will be called with a `Date` instance,
|
|
@@ -37,4 +37,5 @@ export declare class AdaptableDateEditor implements ICellEditorComp {
|
|
|
37
37
|
getAdaptableInstance(params: ICellEditorParams): IAdaptable;
|
|
38
38
|
afterGuiAttached(): void;
|
|
39
39
|
destroy(): void;
|
|
40
|
+
private shouldClearExistingValue;
|
|
40
41
|
}
|
|
@@ -6,6 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_dom_1 = require("react-dom");
|
|
7
7
|
const renderWithAdaptableContext_1 = require("../../../View/renderWithAdaptableContext");
|
|
8
8
|
const InternalAdaptableDateEditor_1 = require("./InternalAdaptableDateEditor");
|
|
9
|
+
const all_modules_1 = require("@ag-grid-community/all-modules");
|
|
9
10
|
const FormatHelper_1 = require("../../../Utilities/Helpers/FormatHelper");
|
|
10
11
|
/**
|
|
11
12
|
* Used by default for all `abColDefDate` columns.
|
|
@@ -16,13 +17,13 @@ const FormatHelper_1 = require("../../../Utilities/Helpers/FormatHelper");
|
|
|
16
17
|
* field: 'tradeDate',
|
|
17
18
|
* type: 'abColDefDate',
|
|
18
19
|
* cellEditorParams: {
|
|
19
|
-
* showClearButton:
|
|
20
|
+
* showClearButton: true
|
|
20
21
|
* }
|
|
21
22
|
* }
|
|
22
23
|
*
|
|
23
24
|
* For now, there is just 1 editor param you can configure:
|
|
24
25
|
*
|
|
25
|
-
* cellEditorParams.showClearButton - defaults to `
|
|
26
|
+
* cellEditorParams.showClearButton - defaults to `true` - whether to show the clear button.
|
|
26
27
|
*
|
|
27
28
|
* When the colDef has a `valueParser` provided as a function, it will be used before setting the value for the cell.
|
|
28
29
|
* This is useful because dates can be stored as strings, numbers or Date instances - the value parser will be called with a `Date` instance,
|
|
@@ -40,7 +41,7 @@ class AdaptableDateEditor {
|
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
init(params) {
|
|
43
|
-
this.value = params.value;
|
|
44
|
+
this.value = this.shouldClearExistingValue(params) ? '' : params.value;
|
|
44
45
|
const { valueParser } = params.column.getColDef();
|
|
45
46
|
this.params = params;
|
|
46
47
|
if (typeof valueParser === 'function') {
|
|
@@ -75,7 +76,8 @@ class AdaptableDateEditor {
|
|
|
75
76
|
afterGuiAttached() {
|
|
76
77
|
var _a;
|
|
77
78
|
const adaptable = this.getAdaptableInstance(this.params);
|
|
78
|
-
const
|
|
79
|
+
const defaultValue = this.shouldClearExistingValue(this.params) ? '' : this.params.value;
|
|
80
|
+
const editorElement = (React.createElement(InternalAdaptableDateEditor_1.InternalAdaptableDateEditor, { defaultValue: defaultValue, dateFormat: adaptable.adaptableOptions.userInterfaceOptions.dateInputOptions.dateFormat, onValueChange: (value) => {
|
|
79
81
|
const invalid = isNaN(+value);
|
|
80
82
|
if (this.valueParser) {
|
|
81
83
|
const params = Object.assign(Object.assign({}, this.params), { oldValue: this.params.value, newValue: value, defaultParser: (value) => {
|
|
@@ -98,8 +100,13 @@ class AdaptableDateEditor {
|
|
|
98
100
|
this.params.stopEditing();
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
|
-
}, showClearButton: (_a = this.params.showClearButton) !== null && _a !== void 0 ? _a :
|
|
102
|
-
|
|
103
|
+
}, showClearButton: (_a = this.params.showClearButton) !== null && _a !== void 0 ? _a : true, onStopEdit: (keyboardEventKey) => {
|
|
104
|
+
if (keyboardEventKey === 'Escape') {
|
|
105
|
+
this.params.api.stopEditing(true);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
this.params.stopEditing();
|
|
109
|
+
}
|
|
103
110
|
}, ref: (editor) => {
|
|
104
111
|
this.editor = editor;
|
|
105
112
|
editor === null || editor === void 0 ? void 0 : editor.focus();
|
|
@@ -109,5 +116,8 @@ class AdaptableDateEditor {
|
|
|
109
116
|
destroy() {
|
|
110
117
|
react_dom_1.unmountComponentAtNode(this.el);
|
|
111
118
|
}
|
|
119
|
+
shouldClearExistingValue(params) {
|
|
120
|
+
return params.keyPress === all_modules_1.KeyCode.BACKSPACE || params.keyPress === all_modules_1.KeyCode.DELETE;
|
|
121
|
+
}
|
|
112
122
|
}
|
|
113
123
|
exports.AdaptableDateEditor = AdaptableDateEditor;
|