@adaptabletools/adaptable 18.0.0-canary.3 → 18.0.0-canary.31
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/agGrid.d.ts +4 -21
- package/agGrid.js +9 -26
- package/base.css +27 -21
- package/base.css.map +1 -1
- package/index.css +108 -88
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -109
- package/src/AdaptableOptions/ActionColumnOptions.d.ts +3 -2
- package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -7
- package/src/AdaptableOptions/AdaptablePlugin.d.ts +2 -0
- package/src/AdaptableOptions/AdaptablePlugin.js +2 -0
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +11 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +9 -4
- package/src/AdaptableOptions/CommentOptions.d.ts +39 -0
- package/src/AdaptableOptions/CustomSortOptions.d.ts +2 -2
- package/src/AdaptableOptions/DataImportOptions.d.ts +2 -2
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +2 -2
- package/src/AdaptableOptions/GroupingOptions.d.ts +0 -26
- package/src/AdaptableOptions/MenuOptions.d.ts +11 -71
- package/src/AdaptableOptions/MenuOptions.js +1 -99
- package/src/AdaptableOptions/NoteOptions.d.ts +25 -0
- package/src/AdaptableOptions/PredicateOptions.d.ts +2 -2
- package/src/AdaptableOptions/StateOptions.d.ts +6 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +19 -2
- package/src/Api/AdaptableApi.d.ts +9 -4
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/ColumnApi.d.ts +13 -0
- package/src/Api/CommentApi.d.ts +20 -22
- package/src/Api/ConfigApi.d.ts +4 -5
- package/src/Api/EventApi.d.ts +7 -9
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/CommentChanged.d.ts +11 -0
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/FlashingCellApi.d.ts +2 -2
- package/src/Api/GridApi.d.ts +42 -14
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +30 -0
- package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +5 -2
- package/src/Api/Implementation/AlertApiImpl.js +5 -10
- package/src/Api/Implementation/ApiBase.d.ts +5 -3
- package/src/Api/Implementation/ApiBase.js +8 -2
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CalendarApiImpl.js +1 -6
- package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
- package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
- package/src/Api/Implementation/ChartingApiImpl.js +3 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -0
- package/src/Api/Implementation/ColumnApiImpl.js +45 -15
- package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
- package/src/Api/Implementation/CommentsApiImpl.d.ts +8 -5
- package/src/Api/Implementation/CommentsApiImpl.js +12 -6
- package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ConfigApiImpl.js +34 -30
- package/src/Api/Implementation/DashboardApiImpl.js +1 -6
- package/src/Api/Implementation/ExportApiImpl.js +5 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +14 -19
- package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
- package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +10 -3
- package/src/Api/Implementation/GridApiImpl.js +78 -23
- package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -7
- package/src/Api/Implementation/LayoutApiImpl.js +19 -13
- package/src/Api/Implementation/NoteApiImpl.d.ts +18 -0
- package/src/Api/Implementation/NoteApiImpl.js +40 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -4
- package/src/Api/Implementation/OptionsApiImpl.js +4 -4
- package/src/Api/Implementation/PredicateApiImpl.js +2 -2
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- package/src/Api/Implementation/ScopeApiImpl.d.ts +26 -24
- package/src/Api/Implementation/ScopeApiImpl.js +64 -18
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
- package/src/Api/Implementation/ThemeApiImpl.js +2 -7
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +14 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +30 -25
- package/src/Api/Internal/ActionRowInternalApi.d.ts +6 -1
- package/src/Api/Internal/ActionRowInternalApi.js +117 -38
- package/src/Api/Internal/AdaptableInternalApi.d.ts +6 -8
- package/src/Api/Internal/AdaptableInternalApi.js +25 -37
- package/src/Api/Internal/AlertInternalApi.d.ts +2 -2
- package/src/Api/Internal/AlertInternalApi.js +4 -17
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +78 -14
- package/src/Api/Internal/ChartingInternalApi.js +13 -13
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +2 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +35 -31
- package/src/Api/Internal/ColumnInternalApi.d.ts +6 -1
- package/src/Api/Internal/ColumnInternalApi.js +19 -1
- package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +14 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +33 -2
- package/src/Api/Internal/DashboardInternalApi.js +5 -11
- package/src/Api/Internal/DataImportInternalApi.js +3 -9
- package/src/Api/Internal/DataSetInternalApi.js +3 -8
- package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
- package/src/Api/Internal/ExportInternalApi.js +8 -5
- package/src/Api/Internal/ExpressionInternalApi.js +2 -12
- package/src/Api/Internal/Fdc3InternalApi.js +3 -12
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +3 -6
- package/src/Api/Internal/FormatColumnInternalApi.js +39 -30
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +61 -1
- package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
- package/src/Api/Internal/GridFilterInternalApi.js +9 -9
- package/src/Api/Internal/GridInternalApi.d.ts +23 -3
- package/src/Api/Internal/GridInternalApi.js +151 -44
- package/src/Api/Internal/LayoutInternalApi.d.ts +2 -0
- package/src/Api/Internal/LayoutInternalApi.js +26 -19
- package/src/Api/Internal/NoteInternalApi.d.ts +4 -0
- package/src/Api/Internal/NoteInternalApi.js +14 -0
- package/src/Api/Internal/PredicateInternalApi.d.ts +6 -6
- package/src/Api/Internal/PredicateInternalApi.js +5 -40
- package/src/Api/Internal/ScheduleInternalApi.js +1 -6
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +2 -2
- package/src/Api/Internal/StyledColumnInternalApi.js +8 -9
- package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
- package/src/Api/Internal/TeamSharingInternalApi.js +3 -8
- package/src/Api/Internal/ThemeInternalApi.js +1 -1
- package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +17 -9
- package/src/Api/NoteApi.d.ts +48 -0
- package/src/Api/OptionsApi.d.ts +8 -8
- package/src/Api/ScopeApi.d.ts +34 -24
- package/src/Api/UserInterfaceApi.d.ts +15 -13
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/AlertState.d.ts +2 -2
- package/src/PredefinedConfig/CommentState.d.ts +27 -23
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableObject.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +2 -2
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
- package/src/PredefinedConfig/Common/{AdaptableScope.d.ts → ColumnScope.d.ts} +4 -1
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +4 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +4 -1
- package/src/PredefinedConfig/Common/Enums.js +3 -0
- package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +15 -1
- package/src/PredefinedConfig/Common/Menu.js +116 -1
- package/src/PredefinedConfig/Common/RowScope.d.ts +17 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +21 -0
- package/src/PredefinedConfig/Common/RowSummary.js +17 -0
- package/src/PredefinedConfig/Common/TransposeConfig.d.ts +30 -0
- package/src/PredefinedConfig/Common/Types.d.ts +4 -4
- package/src/PredefinedConfig/Common/Types.js +4 -1
- package/src/PredefinedConfig/ExportState.d.ts +2 -2
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +9 -5
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +12 -22
- package/src/PredefinedConfig/NoteState.js +1 -0
- package/src/PredefinedConfig/PlusMinusState.d.ts +2 -2
- package/src/PredefinedConfig/PopupState.d.ts +1 -2
- package/src/PredefinedConfig/PredefinedConfig.d.ts +3 -3
- package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
- package/src/PredefinedConfig/ShortcutState.d.ts +2 -2
- package/src/PredefinedConfig/StyledColumnState.d.ts +5 -5
- package/src/PredefinedConfig/SystemState.d.ts +12 -4
- package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -4
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -34
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +32 -10
- package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
- package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +29 -28
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +5 -13
- package/src/Redux/ActionsReducers/PopupRedux.js +0 -19
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +15 -4
- package/src/Redux/ActionsReducers/SystemRedux.js +24 -9
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +70 -80
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- package/src/Strategy/AdaptableModuleBase.d.ts +11 -12
- package/src/Strategy/AdaptableModuleBase.js +17 -23
- package/src/Strategy/AlertModule.d.ts +2 -3
- package/src/Strategy/AlertModule.js +4 -57
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/BulkUpdateModule.js +2 -1
- package/src/Strategy/CalculatedColumnModule.d.ts +4 -5
- package/src/Strategy/CalculatedColumnModule.js +8 -28
- package/src/Strategy/CellSummaryModule.d.ts +10 -8
- package/src/Strategy/CellSummaryModule.js +85 -70
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +3 -4
- package/src/Strategy/ColumnFilterModule.js +37 -121
- package/src/Strategy/ColumnInfoModule.d.ts +2 -2
- package/src/Strategy/ColumnInfoModule.js +6 -4
- package/src/Strategy/CommentModule.d.ts +11 -0
- package/src/Strategy/CommentModule.js +70 -0
- package/src/Strategy/CustomSortModule.d.ts +1 -1
- package/src/Strategy/CustomSortModule.js +4 -3
- package/src/Strategy/DashboardModule.d.ts +3 -4
- package/src/Strategy/DashboardModule.js +11 -28
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataImportModule.d.ts +4 -4
- package/src/Strategy/DataImportModule.js +8 -8
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +1 -2
- package/src/Strategy/ExportModule.js +39 -42
- package/src/Strategy/Fdc3Module.d.ts +1 -1
- package/src/Strategy/Fdc3Module.js +3 -13
- package/src/Strategy/FlashingCellModule.d.ts +3 -4
- package/src/Strategy/FlashingCellModule.js +8 -21
- package/src/Strategy/FormatColumnModule.d.ts +1 -3
- package/src/Strategy/FormatColumnModule.js +27 -91
- package/src/Strategy/FreeTextColumnModule.d.ts +1 -2
- package/src/Strategy/FreeTextColumnModule.js +2 -32
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/GridInfoModule.js +5 -3
- package/src/Strategy/Interface/IModule.d.ts +3 -4
- package/src/Strategy/LayoutModule.d.ts +5 -6
- package/src/Strategy/LayoutModule.js +77 -122
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +3 -3
- package/src/Strategy/NoteModule.js +55 -0
- package/src/Strategy/PlusMinusModule.d.ts +2 -2
- package/src/Strategy/PlusMinusModule.js +3 -3
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.d.ts +3 -3
- package/src/Strategy/SettingsPanelModule.js +6 -6
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SmartEditModule.js +2 -1
- package/src/Strategy/StyledColumnModule.d.ts +2 -2
- package/src/Strategy/StyledColumnModule.js +47 -40
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Strategy/SystemStatusModule.js +4 -3
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +4 -2
- package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
- package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
- package/src/Utilities/Constants/GeneralConstants.js +2 -0
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +6 -6
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +7 -6
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +433 -3
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +4 -0
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +19 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/Interface/MessagePopups.d.ts +0 -3
- package/src/Utilities/MenuItem.d.ts +7 -4
- package/src/Utilities/MenuItem.js +6 -3
- package/src/Utilities/ObjectFactory.d.ts +3 -3
- package/src/Utilities/ObjectFactory.js +7 -25
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +4 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +26 -19
- package/src/Utilities/Services/CellPopupService.js +2 -3
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -181
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/ModuleService.js +6 -2
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +4 -3
- package/src/Utilities/Services/ReportService.d.ts +7 -5
- package/src/Utilities/Services/ReportService.js +243 -24
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/Services/RowSummaryService.d.ts +22 -0
- package/src/Utilities/Services/RowSummaryService.js +141 -0
- package/src/Utilities/adaptableQlUtils.d.ts +2 -0
- package/src/Utilities/adaptableQlUtils.js +14 -0
- package/src/Utilities/license/decode.js +1 -65
- package/src/Utilities/license/hashing.js +1 -43
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +1 -1
- package/src/View/Alert/Utilities/getAvailablePredicates.d.ts +2 -2
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +3 -3
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsEditor.js +28 -17
- package/src/View/Comments/CommentsPopup.js +25 -13
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +5 -0
- package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +42 -0
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
- package/src/View/Components/CellPopup/index.d.ts +1 -0
- package/src/View/Components/CellPopup/index.js +6 -3
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.d.ts +3 -3
- package/src/View/Components/EntityRulesEditor/index.d.ts +3 -3
- package/src/View/Components/FilterForm/FilterForm.js +20 -12
- package/src/View/Components/FilterForm/QuickFilterForm.js +15 -8
- package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
- package/src/View/Components/NewScopeComponent.d.ts +5 -5
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +9 -1
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +7 -7
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
- package/src/View/Components/RangesComponent.d.ts +2 -2
- package/src/View/Components/Selectors/PermittedValuesSelector.js +2 -2
- package/src/View/Components/SharedProps/WizardScopeState.d.ts +2 -2
- package/src/View/Components/ValueSelector/index.d.ts +1 -0
- package/src/View/Components/ValueSelector/index.js +2 -2
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +12 -10
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +19 -6
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +27 -12
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +9 -5
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +1 -1
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/LayoutViewPanel.js +2 -1
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +195 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +38 -3
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +9 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +174 -0
- package/src/View/License/LicenseWatermark.js +1 -61
- package/src/View/Note/NotePopup.d.ts +2 -0
- package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +20 -17
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +38 -14
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +48 -10
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +346 -0
- package/src/agGrid/AdaptableAgGrid.js +3910 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +64 -0
- package/src/agGrid/AgGridAdapter.js +589 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +54 -0
- package/src/agGrid/AgGridColumnAdapter.js +795 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +44 -0
- package/src/agGrid/AgGridMenuAdapter.js +600 -0
- package/src/agGrid/AgGridOptionsService.d.ts +15 -0
- package/src/agGrid/AgGridOptionsService.js +76 -0
- package/src/agGrid/BadgeRenderer.d.ts +2 -2
- package/src/agGrid/BadgeRenderer.js +26 -12
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/PercentBarRenderer.js +2 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/buildSortedColumnStateForLayout.d.ts +7 -0
- package/src/agGrid/buildSortedColumnStateForLayout.js +120 -0
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +71 -18
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
- package/src/agGrid/sortColumnStateForVisibleColumns.js +46 -0
- package/src/agGrid/weightedAverage.d.ts +0 -2
- package/src/agGrid/weightedAverage.js +0 -54
- package/src/components/CheckBox/index.js +1 -1
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/Datepicker/index.js +10 -2
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -14
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -2
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +4 -3
- package/src/components/ProgressIndicator/ProgressIndicator.js +15 -6
- package/src/components/Select/Select.d.ts +3 -1
- package/src/components/Select/Select.js +4 -2
- package/src/components/Textarea/index.d.ts +2 -2
- package/src/components/icons/copy.d.ts +3 -0
- package/src/components/icons/copy.js +4 -0
- package/src/components/icons/filter-off.d.ts +3 -0
- package/src/components/icons/filter-off.js +4 -0
- package/src/components/icons/grid-info.d.ts +3 -0
- package/src/components/icons/grid-info.js +4 -0
- package/src/components/icons/index.js +14 -0
- package/src/components/icons/note.js +2 -2
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +4 -0
- package/src/components/icons/select-all.d.ts +3 -0
- package/src/components/icons/select-all.js +4 -0
- package/src/components/icons/select-fwd.d.ts +3 -0
- package/src/components/icons/select-fwd.js +4 -0
- package/src/components/icons/select-off.d.ts +3 -0
- package/src/components/icons/select-off.js +4 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +222 -73
- package/src/metamodel/adaptable.metamodel.js +1 -9313
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +48 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +11 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +342 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +6 -0
- package/src/parser/src/parser.js +576 -553
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +3 -4
- package/src/parser/src/types.d.ts +7 -2
- package/src/parser/src/types.js +1 -2
- package/src/types.d.ts +29 -21
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableOptions/CommentsOptions.d.ts +0 -28
- package/src/AdaptableOptions/NotesOptions.d.ts +0 -16
- package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
- package/src/Api/Implementation/NotesApiImpl.d.ts +0 -16
- package/src/Api/Implementation/NotesApiImpl.js +0 -39
- package/src/Api/NotesApi.d.ts +0 -48
- package/src/PredefinedConfig/CellAddress.d.ts +0 -13
- package/src/PredefinedConfig/CellAddress.js +0 -4
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -39
- package/src/Strategy/CommentsModule.d.ts +0 -16
- package/src/Strategy/CommentsModule.js +0 -77
- package/src/Strategy/NotesModule.js +0 -57
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -133
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -47
- package/src/View/Notes/NotesPopup.d.ts +0 -2
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -686
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -668
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
- /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
- /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
- /package/src/PredefinedConfig/Common/{AdaptableScope.js → ColumnScope.js} +0 -0
- /package/src/PredefinedConfig/{NotesState.js → Common/RowScope.js} +0 -0
- /package/src/{Utilities/Services/Interface/IRowEditService.js → PredefinedConfig/Common/TransposeConfig.js} +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
import { ModuleNames, } from '@ag-grid-community/core';
|
|
2
|
+
import merge from 'lodash/merge';
|
|
3
|
+
import { FilterWrapperFactory } from './FilterWrapper';
|
|
4
|
+
import { FloatingFilterWrapperFactory } from './FloatingFilterWrapper';
|
|
5
|
+
import { convertAdaptableStyleToCSS, getVariableColor, normalizeStyleForAgGrid, } from '../Utilities/Helpers/StyleHelper';
|
|
6
|
+
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
7
|
+
import { createBaseContext } from '../Utilities/ObjectFactory';
|
|
8
|
+
import tinycolor from 'tinycolor2';
|
|
9
|
+
import UIHelper from '../View/UIHelper';
|
|
10
|
+
import { getPercentBarRendererForColumn } from './PercentBarRenderer';
|
|
11
|
+
import { getBadgeRendererForColumn } from './BadgeRenderer';
|
|
12
|
+
import Helper from '../Utilities/Helpers/Helper';
|
|
13
|
+
import { ROW_SUMMARY_ROW_ID } from '../PredefinedConfig/Common/RowSummary';
|
|
14
|
+
export class AgGridColumnAdapter {
|
|
15
|
+
constructor(adaptableInstance) {
|
|
16
|
+
this.adaptableInstance = adaptableInstance;
|
|
17
|
+
this.colDefPropertyCache = new Map();
|
|
18
|
+
}
|
|
19
|
+
destroy() {
|
|
20
|
+
this.adaptableInstance = null;
|
|
21
|
+
this.colDefPropertyCache.clear();
|
|
22
|
+
this.colDefPropertyCache = null;
|
|
23
|
+
}
|
|
24
|
+
get adaptableApi() {
|
|
25
|
+
return this.adaptableInstance.api;
|
|
26
|
+
}
|
|
27
|
+
get adaptableOptions() {
|
|
28
|
+
return this.adaptableInstance.adaptableOptions;
|
|
29
|
+
}
|
|
30
|
+
get agGridApi() {
|
|
31
|
+
return this.adaptableInstance.agGridAdapter.getAgGridApi();
|
|
32
|
+
}
|
|
33
|
+
setColDefProperty(col, propertyName, propertyGetter) {
|
|
34
|
+
var _a;
|
|
35
|
+
const colId = col.getColId();
|
|
36
|
+
const colDef = col.getColDef();
|
|
37
|
+
const colSetupInfo = {
|
|
38
|
+
col,
|
|
39
|
+
colDef,
|
|
40
|
+
colId,
|
|
41
|
+
};
|
|
42
|
+
const userKey = `user.${colId}.${propertyName}`;
|
|
43
|
+
const adaptableKey = `adaptable.${colId}.${propertyName}`;
|
|
44
|
+
const value = colDef[propertyName];
|
|
45
|
+
const isUserDefined = value !== this.colDefPropertyCache.get(adaptableKey);
|
|
46
|
+
if (isUserDefined) {
|
|
47
|
+
this.colDefPropertyCache.set(userKey, value);
|
|
48
|
+
}
|
|
49
|
+
const userValue = this.colDefPropertyCache.get(userKey);
|
|
50
|
+
const adaptableValue = propertyGetter(userValue);
|
|
51
|
+
if (adaptableValue != null) {
|
|
52
|
+
this.colDefPropertyCache.set(adaptableKey, adaptableValue);
|
|
53
|
+
}
|
|
54
|
+
let theValue = adaptableValue !== null && adaptableValue !== void 0 ? adaptableValue : userValue;
|
|
55
|
+
this.adaptableInstance.forPlugins((plugin) => {
|
|
56
|
+
if (plugin.interceptSetupColumnProperty) {
|
|
57
|
+
theValue = plugin.interceptSetupColumnProperty(colSetupInfo, propertyName, theValue, this.adaptableApi);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
if (propertyName === 'aggFunc') {
|
|
61
|
+
if (colDef[propertyName] !== (theValue !== null && theValue !== void 0 ? theValue : null)) {
|
|
62
|
+
(_a = this.agGridApi) === null || _a === void 0 ? void 0 : _a.setColumnAggFunc(colId, theValue !== null && theValue !== void 0 ? theValue : null);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (theValue === undefined && colDef[propertyName] === undefined) {
|
|
66
|
+
// already undefined, so don't set an own property to the same undefined value
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
colDef[propertyName] = theValue;
|
|
70
|
+
}
|
|
71
|
+
getUserColDefProperty(columnId, propertyName) {
|
|
72
|
+
const userKey = `user.${columnId}.${propertyName}`;
|
|
73
|
+
return this.colDefPropertyCache.get(userKey);
|
|
74
|
+
}
|
|
75
|
+
setupColumns() {
|
|
76
|
+
const cols = this.agGridApi.getColumns();
|
|
77
|
+
// this needs to be here, before the other setup below
|
|
78
|
+
// so the setup methods below reference the correct columns in adaptable store
|
|
79
|
+
cols.forEach((col) => {
|
|
80
|
+
const colDef = col.getColDef();
|
|
81
|
+
const colId = col.getColId();
|
|
82
|
+
const abColumn = this.adaptableApi.columnApi.getColumnWithColumnId(colId);
|
|
83
|
+
const colSetupInfo = {
|
|
84
|
+
col,
|
|
85
|
+
colDef,
|
|
86
|
+
colId,
|
|
87
|
+
abColumn,
|
|
88
|
+
};
|
|
89
|
+
this.setupColumnCellRenderer(colSetupInfo);
|
|
90
|
+
this.setupColumnCellStyle(colSetupInfo);
|
|
91
|
+
this.setupColumnCellClass(colSetupInfo);
|
|
92
|
+
this.setupColumnTooltipValueGetter(colSetupInfo);
|
|
93
|
+
this.setupColumnValueGetter(colSetupInfo);
|
|
94
|
+
this.setupColumnFilter(colSetupInfo);
|
|
95
|
+
this.setupColumnFloatingFilter(colSetupInfo);
|
|
96
|
+
this.setupColumnValueFormatter(colSetupInfo);
|
|
97
|
+
this.setupColumnEditable(colSetupInfo);
|
|
98
|
+
this.setupColumnValueSetter(colSetupInfo);
|
|
99
|
+
this.setupColumnComparator(colSetupInfo);
|
|
100
|
+
this.setupColumnCellEditor(colSetupInfo);
|
|
101
|
+
this.setupColumnHeader(colSetupInfo);
|
|
102
|
+
this.setupColumnQuickFilerText(colSetupInfo);
|
|
103
|
+
this.setupColumnAllowedAggFuncs(colSetupInfo);
|
|
104
|
+
// this is just to make sure that AG Grid does NOT infer the cellDataType
|
|
105
|
+
// https://github.com/AdaptableTools/adaptable/issues/2230 should render it obsolete
|
|
106
|
+
this.setupColumnCellDataType(colSetupInfo);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
setupColumnValueGetter({ col }) {
|
|
110
|
+
// need this here if we want plugins to intercept
|
|
111
|
+
this.setColDefProperty(col, 'valueGetter', (userValue) => {
|
|
112
|
+
return userValue;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
setupColumnCellClass({ col, colId, abColumn }) {
|
|
116
|
+
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
117
|
+
const formatColumns = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
118
|
+
const quickSearchStyleClassName = this.adaptableApi.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
119
|
+
const hasQuickSearchStyleClassName = StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
120
|
+
const cellClass = (params) => {
|
|
121
|
+
const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, abColumn.columnId);
|
|
122
|
+
// if a Visual Data export is in progress, we are interested only in the Excel Style Class
|
|
123
|
+
if (this.adaptableApi.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
124
|
+
const userDefinedCellClass = typeof userCellClass === 'function' ? userCellClass(params) : userCellClass;
|
|
125
|
+
const cellClassKey = this.getExcelClassNameForCell(colId, gridCell.primaryKeyValue, userDefinedCellClass);
|
|
126
|
+
return this.adaptableApi.internalApi
|
|
127
|
+
.getReportService()
|
|
128
|
+
.getExcelStyleIdForCellClassKey(cellClassKey);
|
|
129
|
+
}
|
|
130
|
+
const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(gridCell, params);
|
|
131
|
+
const editableClassName = this.getEditableCellClass(gridCell, params);
|
|
132
|
+
const readonlyClassName = this.getReadonlyCellClass(gridCell, params);
|
|
133
|
+
const highlightAlertClassName = this.getAlertCellClass(gridCell, params);
|
|
134
|
+
const flashingClassName = this.getFlashingCellClass(gridCell, params);
|
|
135
|
+
const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
|
|
136
|
+
const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
|
|
137
|
+
const noteClassName = this.getNoteCellClassName(gridCell, params);
|
|
138
|
+
const commentsClassName = this.getCommentCellClassName(gridCell, params);
|
|
139
|
+
const returnValue = [
|
|
140
|
+
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
141
|
+
!hasStyledColumn && formatColumns.length
|
|
142
|
+
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
143
|
+
: null,
|
|
144
|
+
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
145
|
+
editableClassName,
|
|
146
|
+
readonlyClassName,
|
|
147
|
+
highlightAlertClassName,
|
|
148
|
+
flashingClassName,
|
|
149
|
+
noteClassName,
|
|
150
|
+
commentsClassName,
|
|
151
|
+
]
|
|
152
|
+
// we flatten the array because some rules ('userCellClass' etc) might return a string[]
|
|
153
|
+
.flat()
|
|
154
|
+
.filter((x) => !!x);
|
|
155
|
+
const result = returnValue.length ? returnValue : undefined;
|
|
156
|
+
return result;
|
|
157
|
+
};
|
|
158
|
+
return cellClass;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
setupColumnCellStyle({ col, colId, abColumn }) {
|
|
162
|
+
this.setColDefProperty(col, 'cellStyle', (userCellStyle) => {
|
|
163
|
+
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
164
|
+
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
165
|
+
const cellStyle = (params) => {
|
|
166
|
+
const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, abColumn.columnId);
|
|
167
|
+
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
|
|
168
|
+
const userDefined = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
|
|
169
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, userDefined), this.getReadOnlyCellStyle(gridCell, params)), this.getEditableCellStyle(gridCell, params)), this.getFormatColumnAndStyledColumnCellStyle(gridCell, params)), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(gridCell, params)), this.getFlashingCellStyle(gridCell, params)), this.getCellHighlightStyle(gridCell, params));
|
|
170
|
+
return normalizeStyleForAgGrid(result);
|
|
171
|
+
};
|
|
172
|
+
return cellStyle;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
setupColumnCellEditor({ colId, col }) {
|
|
176
|
+
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId(colId);
|
|
177
|
+
const editLookUpItem = this.adaptableApi.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
178
|
+
const hasRichSelectCellEditor = this.adaptableInstance.agGridAdapter.isModulePresent(ModuleNames.RichSelectModule);
|
|
179
|
+
this.setColDefProperty(col, 'cellEditor', () => {
|
|
180
|
+
if (editLookUpItem) {
|
|
181
|
+
return hasRichSelectCellEditor ? 'agRichSelectCellEditor' : 'agSelectCellEditor';
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
this.setColDefProperty(col, 'cellEditorPopup', () => {
|
|
185
|
+
// as specified in https://www.ag-grid.com/react-data-grid/provided-cell-editors/#rich-select-cell-editor
|
|
186
|
+
// agRichSelectCellEditor should always set cellEditorPopup=true. Otherwise the editor will be clipped to the cell contents
|
|
187
|
+
if (editLookUpItem && hasRichSelectCellEditor) {
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
this.setColDefProperty(col, 'cellEditorParams', (params) => {
|
|
192
|
+
if (editLookUpItem) {
|
|
193
|
+
return (params) => {
|
|
194
|
+
const gridCell = this.adaptableInstance.getGridCellFromRowNode(params === null || params === void 0 ? void 0 : params.node, colId);
|
|
195
|
+
return {
|
|
196
|
+
values: this.adaptableApi.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem, gridCell),
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
203
|
+
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
204
|
+
const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(abColumn.columnId);
|
|
205
|
+
if (styledColumn && !styledColumn.IsSuspended) {
|
|
206
|
+
if (styledColumn.PercentBarStyle) {
|
|
207
|
+
return getPercentBarRendererForColumn(styledColumn, abColumn, this.adaptableApi);
|
|
208
|
+
}
|
|
209
|
+
if (styledColumn.BadgeStyle) {
|
|
210
|
+
return getBadgeRendererForColumn(styledColumn.BadgeStyle, abColumn, this.adaptableApi);
|
|
211
|
+
}
|
|
212
|
+
if (styledColumn.SparkLineStyle) {
|
|
213
|
+
return 'agSparklineCellRenderer';
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
this.setColDefProperty(col, 'cellRendererParams', (userDefined) => {
|
|
218
|
+
const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(abColumn.columnId);
|
|
219
|
+
if (styledColumn && !styledColumn.IsSuspended) {
|
|
220
|
+
if (styledColumn.SparkLineStyle) {
|
|
221
|
+
const sparklineOptions = merge({}, userDefined === null || userDefined === void 0 ? void 0 : userDefined.sparklineOptions, styledColumn.SparkLineStyle.options);
|
|
222
|
+
return Object.assign(Object.assign({}, userDefined), { sparklineOptions });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
228
|
+
let hasTooptip = false;
|
|
229
|
+
this.setColDefProperty(col, 'tooltipValueGetter', () => {
|
|
230
|
+
const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
|
|
231
|
+
if (styledColumn &&
|
|
232
|
+
!styledColumn.IsSuspended &&
|
|
233
|
+
styledColumn.PercentBarStyle &&
|
|
234
|
+
styledColumn.PercentBarStyle.ToolTipText) {
|
|
235
|
+
hasTooptip = true;
|
|
236
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.PercentBarStyle) {
|
|
237
|
+
return (params) => {
|
|
238
|
+
const min = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
239
|
+
const max = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
240
|
+
const textOptions = styledColumn.PercentBarStyle.ToolTipText;
|
|
241
|
+
let returnValue = '';
|
|
242
|
+
if (textOptions.includes('CellValue')) {
|
|
243
|
+
returnValue = params.value;
|
|
244
|
+
}
|
|
245
|
+
if (textOptions.includes('PercentageValue')) {
|
|
246
|
+
const clampedValue = Helper.clamp(params.value, min, max);
|
|
247
|
+
const percentageValue = ((clampedValue - min) / (max - min)) * 100;
|
|
248
|
+
returnValue += ' ' + `(${percentageValue.toFixed(0)}%)`;
|
|
249
|
+
}
|
|
250
|
+
return returnValue ? returnValue : params.value;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
setupColumnQuickFilerText({ col, abColumn }) {
|
|
257
|
+
this.setColDefProperty(col, 'getQuickFilterText', (userGetQuickFilterText) => {
|
|
258
|
+
if (userGetQuickFilterText) {
|
|
259
|
+
return userGetQuickFilterText;
|
|
260
|
+
}
|
|
261
|
+
return (params) => {
|
|
262
|
+
const visibleCoulmnsMap = this.adaptableApi.layoutApi.getCurrentVisibleColumnIdsMap();
|
|
263
|
+
const isVisible = visibleCoulmnsMap[abColumn.columnId];
|
|
264
|
+
if (!isVisible) {
|
|
265
|
+
return '';
|
|
266
|
+
}
|
|
267
|
+
return this.adaptableInstance.getDisplayValueFromRowNode(params.node, abColumn.columnId);
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
setupColumnAllowedAggFuncs({ col, abColumn }) {
|
|
272
|
+
this.setColDefProperty(col, 'allowedAggFuncs', () => {
|
|
273
|
+
return abColumn.availableAggregationFunctions;
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
setupColumnCellDataType(columnSetupInfo) {
|
|
277
|
+
const { col } = columnSetupInfo;
|
|
278
|
+
// AG Grid introduced since v30.x an inferred cellDataType
|
|
279
|
+
// the problem is that it breaks the default value formatter and/or editor (especially for Date columns)
|
|
280
|
+
this.setColDefProperty(col, 'cellDataType', () => {
|
|
281
|
+
return false;
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
setupColumnHeader({ col, abColumn }) {
|
|
285
|
+
var _a, _b;
|
|
286
|
+
const previousColumnHeader = (_a = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _a === void 0 ? void 0 : _a.headerName;
|
|
287
|
+
this.setColDefProperty(col, 'headerName', (userHeaderName) => {
|
|
288
|
+
var _a;
|
|
289
|
+
// set the default to the AG Grid provided values
|
|
290
|
+
// from https://github.com/ag-grid/ag-grid/blob/v26.1.0/community-modules/core/src/ts/columns/columnModel.ts#L2515
|
|
291
|
+
let resultHeaderName = userHeaderName !== null && userHeaderName !== void 0 ? userHeaderName : StringExtensions.CamelCaseToHumanText(col.getColDef().field);
|
|
292
|
+
const layoutCustomHeader = (_a = this.adaptableApi.layoutApi.getCurrentLayout().ColumnHeadersMap) === null || _a === void 0 ? void 0 : _a[col.getColId()];
|
|
293
|
+
if (layoutCustomHeader) {
|
|
294
|
+
resultHeaderName = layoutCustomHeader;
|
|
295
|
+
}
|
|
296
|
+
// required here for the initial layout rendering
|
|
297
|
+
// Removed by JW, 3 october 2023; i don't think we need it and it overrides stuff unnecessarily
|
|
298
|
+
// abColumn.friendlyName = resultHeaderName;
|
|
299
|
+
return resultHeaderName;
|
|
300
|
+
});
|
|
301
|
+
const newColumnHeader = (_b = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _b === void 0 ? void 0 : _b.headerName;
|
|
302
|
+
return previousColumnHeader !== newColumnHeader;
|
|
303
|
+
}
|
|
304
|
+
setupColumnFilter({ col, colDef }) {
|
|
305
|
+
this.setColDefProperty(col, 'filter', () => {
|
|
306
|
+
if (!colDef.filter) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (!this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
this.agGridApi.destroyFilter(col);
|
|
313
|
+
return FilterWrapperFactory(this.adaptableInstance);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
setupColumnFloatingFilter({ col, colDef }) {
|
|
317
|
+
const isFloatingFilterDisabled = !colDef.floatingFilter ||
|
|
318
|
+
!this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering;
|
|
319
|
+
this.adaptableOptions.columnFilterOptions.quickFilterOptions.showQuickFilter;
|
|
320
|
+
this.setColDefProperty(col, 'floatingFilterComponent', () => {
|
|
321
|
+
if (isFloatingFilterDisabled) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
return FloatingFilterWrapperFactory(this.adaptableInstance);
|
|
325
|
+
});
|
|
326
|
+
this.setColDefProperty(col, 'floatingFilter', (original_floatingFilter) => {
|
|
327
|
+
if (isFloatingFilterDisabled) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
return FloatingFilterWrapperFactory(this.adaptableInstance);
|
|
331
|
+
});
|
|
332
|
+
this.setColDefProperty(col, 'suppressFloatingFilterButton', () => {
|
|
333
|
+
return !isFloatingFilterDisabled;
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
setupColumnValueFormatter({ col, abColumn }) {
|
|
337
|
+
this.setColDefProperty(col, 'valueFormatter', (userPropertyValue) => {
|
|
338
|
+
const activeFormatColumnsWithDisplayFormat = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
339
|
+
if (!activeFormatColumnsWithDisplayFormat.length) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
return (params) => {
|
|
343
|
+
const { node, value } = params;
|
|
344
|
+
const mostRelevantFormatColumn = this.adaptableApi.formatColumnApi.internalApi.getMostRelevantFormatColumnForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node, value });
|
|
345
|
+
if (!mostRelevantFormatColumn) {
|
|
346
|
+
// ALL FormatColumns are conditional and NONE of them are relevant for this row
|
|
347
|
+
return value;
|
|
348
|
+
}
|
|
349
|
+
const options = mostRelevantFormatColumn.DisplayFormat.Options;
|
|
350
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
351
|
+
// change the Number format - if the scope allows it
|
|
352
|
+
if (this.adaptableApi.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
353
|
+
return this.adaptableApi.formatColumnApi.internalApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
357
|
+
// change the Date format - if the scope allows it
|
|
358
|
+
if (this.adaptableApi.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
359
|
+
return this.adaptableApi.formatColumnApi.internalApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
363
|
+
// change the String format - if the scope allows it
|
|
364
|
+
if (this.adaptableApi.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
365
|
+
return this.adaptableApi.formatColumnApi.internalApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
// should NEVER arrive at this line, but just to be sure
|
|
369
|
+
return value;
|
|
370
|
+
};
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
setupColumnEditable({ col }) {
|
|
374
|
+
this.setColDefProperty(col, 'editable', (userValue) => {
|
|
375
|
+
// if AG Grid defines the column as NOT editable, we don't mess with it
|
|
376
|
+
if (typeof userValue === 'boolean' && userValue === false) {
|
|
377
|
+
return userValue;
|
|
378
|
+
}
|
|
379
|
+
const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
|
|
380
|
+
const editableCallback = (params) => {
|
|
381
|
+
// Adaptable Row Summarie rows are not editable
|
|
382
|
+
if (params.node.data[ROW_SUMMARY_ROW_ID]) {
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
if (!cellEditableFn) {
|
|
386
|
+
return typeof userValue === 'function' ? userValue(params) : userValue;
|
|
387
|
+
}
|
|
388
|
+
const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
389
|
+
const cellEditableContext = {
|
|
390
|
+
gridCell,
|
|
391
|
+
adaptableApi: this.adaptableApi,
|
|
392
|
+
userName: this.adaptableOptions.userName,
|
|
393
|
+
adaptableId: this.adaptableOptions.adaptableId,
|
|
394
|
+
};
|
|
395
|
+
return cellEditableFn(cellEditableContext);
|
|
396
|
+
};
|
|
397
|
+
return editableCallback;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
setupColumnValueSetter({ col, colId, abColumn }) {
|
|
401
|
+
this.setColDefProperty(col, 'valueSetter', (userValueSetter) => {
|
|
402
|
+
var _a;
|
|
403
|
+
const preventEditAlertsForColumn = this.adaptableApi.alertApi.internalApi
|
|
404
|
+
.getAlertDefinitionsWithPreventEdit()
|
|
405
|
+
.filter((alertDefinition) => {
|
|
406
|
+
return this.adaptableApi.scopeApi.isColumnInScope(abColumn, alertDefinition.Scope);
|
|
407
|
+
});
|
|
408
|
+
const noValidations = !preventEditAlertsForColumn.length && !((_a = this.adaptableOptions.editOptions) === null || _a === void 0 ? void 0 : _a.validateOnServer);
|
|
409
|
+
if (noValidations) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const valueSetter = (params) => {
|
|
413
|
+
var _a;
|
|
414
|
+
const field = params.column.getColDef().field;
|
|
415
|
+
if (noValidations) {
|
|
416
|
+
//TODO also consider the case when userValueSetter is a string
|
|
417
|
+
if (typeof userValueSetter === 'function') {
|
|
418
|
+
return userValueSetter(params);
|
|
419
|
+
}
|
|
420
|
+
// we allowed it go reach this point
|
|
421
|
+
// just to run isCellEditable
|
|
422
|
+
// and since this has already run and we have no other validations
|
|
423
|
+
// just assign the new value and exit
|
|
424
|
+
if (field) {
|
|
425
|
+
params.data[field] = params.newValue;
|
|
426
|
+
}
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
const cellDataChangedInfo = this.adaptableApi.internalApi.buildDataChangedInfo({
|
|
430
|
+
oldValue: params.oldValue,
|
|
431
|
+
newValue: params.newValue,
|
|
432
|
+
column: this.adaptableApi.columnApi.getColumnWithColumnId(params.column.getColId()),
|
|
433
|
+
primaryKeyValue: this.adaptableInstance.getPrimaryKeyValueFromRowNode(params.node, params.api),
|
|
434
|
+
rowNode: params.node,
|
|
435
|
+
trigger: 'edit',
|
|
436
|
+
});
|
|
437
|
+
if (cellDataChangedInfo.oldValue === cellDataChangedInfo.newValue) {
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Validate on the future row, with the new value.
|
|
442
|
+
* structuredClone fails, it contains functions.
|
|
443
|
+
*/
|
|
444
|
+
const newRow = Object.assign(Object.assign({}, params.node), { data: Object.assign({}, params.node.data) });
|
|
445
|
+
newRow.data[field] = params.newValue;
|
|
446
|
+
const cellDataChangeInfoForSyncValidation = Object.assign(Object.assign({}, cellDataChangedInfo), { rowNode: newRow });
|
|
447
|
+
if (!this.adaptableInstance.ValidationService.performValidation(cellDataChangeInfoForSyncValidation)) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
const onServerValidationCompleted = () => { };
|
|
451
|
+
if ((_a = this.adaptableOptions.editOptions) === null || _a === void 0 ? void 0 : _a.validateOnServer) {
|
|
452
|
+
this.adaptableInstance.ValidationService.performServerValidation(cellDataChangedInfo, {
|
|
453
|
+
onServerValidationCompleted,
|
|
454
|
+
})();
|
|
455
|
+
}
|
|
456
|
+
//TODO also consider the case when userValueSetter is a string
|
|
457
|
+
if (typeof userValueSetter === 'function') {
|
|
458
|
+
return userValueSetter(params);
|
|
459
|
+
}
|
|
460
|
+
if (field) {
|
|
461
|
+
params.data[field] = params.newValue;
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
throw `Cannot edit a column without a field - column id was ${colId}`;
|
|
465
|
+
}
|
|
466
|
+
return true;
|
|
467
|
+
};
|
|
468
|
+
return valueSetter;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
setupColumnComparator({ col, colId, abColumn }) {
|
|
472
|
+
const customSort = this.adaptableApi.customSortApi.getCustomSortForColumn(colId);
|
|
473
|
+
const columnSortComparer = this.adaptableApi.customSortApi.internalApi.getCustomSortComparer(abColumn.columnId);
|
|
474
|
+
const comparatorGetter = (propName) => {
|
|
475
|
+
return () => {
|
|
476
|
+
return this.adaptableApi.columnApi.internalApi.getActiveColumnComparator(colId, customSort, columnSortComparer);
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
this.setColDefProperty(col, 'comparator', comparatorGetter('comparator'));
|
|
480
|
+
this.setColDefProperty(col, 'pivotComparator', comparatorGetter('pivotComparator'));
|
|
481
|
+
}
|
|
482
|
+
getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass) {
|
|
483
|
+
let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
|
|
484
|
+
if (excelClassName.indexOf(' ') > 0) {
|
|
485
|
+
excelClassName = excelClassName.replace(/\s/g, '_');
|
|
486
|
+
}
|
|
487
|
+
return userDefinedCellClass != null
|
|
488
|
+
? `${excelClassName}-${Array.isArray(userDefinedCellClass)
|
|
489
|
+
? userDefinedCellClass.join('-')
|
|
490
|
+
: userDefinedCellClass}`
|
|
491
|
+
: excelClassName;
|
|
492
|
+
}
|
|
493
|
+
isQuickSearchActive(gridCell, params) {
|
|
494
|
+
let quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
|
|
495
|
+
if (StringExtensions.IsNullOrEmpty(quickSearchValue)) {
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
if (gridCell.column.isExcludedFromQuickSearch) {
|
|
499
|
+
return false;
|
|
500
|
+
}
|
|
501
|
+
if (!params.node) {
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
if (!gridCell.isPivotCell &&
|
|
505
|
+
!this.adaptableApi.optionsApi.getQuickSearchOptions().runQuickSearchOnRowGroups &&
|
|
506
|
+
params.node.group) {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
if (!this.adaptableApi.optionsApi.getQuickSearchOptions().runQuickSearchOnPivotColumns &&
|
|
510
|
+
gridCell.isPivotCell) {
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
if (this.adaptableApi.optionsApi.getQuickSearchOptions().runQuickSearchOnPivotColumns &&
|
|
514
|
+
gridCell.isPivotCell) {
|
|
515
|
+
gridCell.displayValue = params.value;
|
|
516
|
+
}
|
|
517
|
+
const ignoreCase = !this.adaptableOptions.quickSearchOptions.runQuickSearchWithCaseSensitivity;
|
|
518
|
+
const displayValue = ignoreCase
|
|
519
|
+
? String(gridCell.displayValue).toLocaleLowerCase()
|
|
520
|
+
: String(gridCell.displayValue);
|
|
521
|
+
const i = ignoreCase ? String(quickSearchValue).toLocaleLowerCase() : String(quickSearchValue);
|
|
522
|
+
const applyQuickSearchFunction = this.adaptableOptions.quickSearchOptions.runBespokeQuickSearch;
|
|
523
|
+
if (applyQuickSearchFunction) {
|
|
524
|
+
const quickSearchContext = Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { gridCell, quickSearchValue: quickSearchValue });
|
|
525
|
+
return applyQuickSearchFunction(quickSearchContext);
|
|
526
|
+
}
|
|
527
|
+
return displayValue.indexOf(i) !== -1;
|
|
528
|
+
}
|
|
529
|
+
getEditableCellClass(gridCell, params) {
|
|
530
|
+
const editableCellStyle = this.adaptableApi.userInterfaceApi.getEditableCellStyle();
|
|
531
|
+
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
const isCellEditable = this.adaptableApi.gridApi.isCellEditable(gridCell);
|
|
535
|
+
return isCellEditable ? editableCellStyle.ClassName : null;
|
|
536
|
+
}
|
|
537
|
+
getReadonlyCellClass(gridCell, params) {
|
|
538
|
+
const readonlyCellStyle = this.adaptableApi.userInterfaceApi.getReadOnlyCellStyle();
|
|
539
|
+
if (!(readonlyCellStyle === null || readonlyCellStyle === void 0 ? void 0 : readonlyCellStyle.ClassName)) {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
const isCellReadonly = !this.adaptableApi.gridApi.isCellEditable(gridCell);
|
|
543
|
+
return isCellReadonly ? readonlyCellStyle.ClassName : null;
|
|
544
|
+
}
|
|
545
|
+
getAlertCellClass(gridCell, params) {
|
|
546
|
+
var _a, _b;
|
|
547
|
+
const alert = this.adaptableApi.alertApi.internalApi.getAdaptableAlertWithHighlightCell(gridCell.column.columnId, params.node);
|
|
548
|
+
const highlightCell = (_b = (_a = alert === null || alert === void 0 ? void 0 : alert.alertDefinition) === null || _a === void 0 ? void 0 : _a.AlertProperties) === null || _b === void 0 ? void 0 : _b.HighlightCell;
|
|
549
|
+
return typeof highlightCell === 'object' && (highlightCell === null || highlightCell === void 0 ? void 0 : highlightCell.ClassName)
|
|
550
|
+
? highlightCell === null || highlightCell === void 0 ? void 0 : highlightCell.ClassName
|
|
551
|
+
: null;
|
|
552
|
+
}
|
|
553
|
+
getFlashingCellClass(gridcell, params) {
|
|
554
|
+
var _a, _b, _c;
|
|
555
|
+
const primaryKey = params.node.aggData ? params.node.id : gridcell.primaryKeyValue;
|
|
556
|
+
const flashingCell = this.adaptableApi.flashingCellApi.internalApi.getAdaptableFlashingCellFor(primaryKey, gridcell.column.columnId);
|
|
557
|
+
if (!flashingCell) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
return flashingCell.direction === 'up'
|
|
561
|
+
? (_a = flashingCell.flashingCellDefinition.UpChangeStyle) === null || _a === void 0 ? void 0 : _a.ClassName
|
|
562
|
+
: flashingCell.direction === 'down'
|
|
563
|
+
? (_b = flashingCell.flashingCellDefinition.DownChangeStyle) === null || _b === void 0 ? void 0 : _b.ClassName
|
|
564
|
+
: flashingCell.direction === 'neutral'
|
|
565
|
+
? (_c = flashingCell.flashingCellDefinition.NeutralChangeStyle) === null || _c === void 0 ? void 0 : _c.ClassName
|
|
566
|
+
: undefined;
|
|
567
|
+
}
|
|
568
|
+
getNoteCellClassName(gridCell, params) {
|
|
569
|
+
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (!this.adaptableApi.noteApi.internalApi.areNotesSupported()) {
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
const cellPosition = {
|
|
576
|
+
PrimaryKeyValue: gridCell.primaryKeyValue,
|
|
577
|
+
ColumnId: gridCell.column.columnId,
|
|
578
|
+
};
|
|
579
|
+
const cellNotes = this.adaptableApi.noteApi.getNotesForCell(cellPosition);
|
|
580
|
+
if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
|
|
581
|
+
return undefined;
|
|
582
|
+
}
|
|
583
|
+
return 'ab-Cell-Note';
|
|
584
|
+
}
|
|
585
|
+
getCommentCellClassName(gridCell, params) {
|
|
586
|
+
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (!this.adaptableApi.commentApi.internalApi.areCommentsSupported()) {
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const position = {
|
|
593
|
+
PrimaryKeyValue: gridCell.primaryKeyValue,
|
|
594
|
+
ColumnId: gridCell.column.columnId,
|
|
595
|
+
};
|
|
596
|
+
const cellComments = this.adaptableApi.commentApi.getCommentThread(position);
|
|
597
|
+
if (!cellComments) {
|
|
598
|
+
return undefined;
|
|
599
|
+
}
|
|
600
|
+
return 'ab-Cell-Comment';
|
|
601
|
+
}
|
|
602
|
+
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
603
|
+
const classNames = formatColumns
|
|
604
|
+
.map((formatColumn) => {
|
|
605
|
+
var _a, _b;
|
|
606
|
+
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
607
|
+
this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value)) {
|
|
608
|
+
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
609
|
+
}
|
|
610
|
+
})
|
|
611
|
+
.filter((x) => !!x);
|
|
612
|
+
return classNames;
|
|
613
|
+
}
|
|
614
|
+
getQuickSearchCellStyle() {
|
|
615
|
+
const quickSearchStyle = this.adaptableApi.quickSearchApi.getQuickSearchStyle();
|
|
616
|
+
if (!quickSearchStyle || StringExtensions.IsNotNullOrEmpty(quickSearchStyle.ClassName)) {
|
|
617
|
+
return undefined;
|
|
618
|
+
}
|
|
619
|
+
return convertAdaptableStyleToCSS(quickSearchStyle);
|
|
620
|
+
}
|
|
621
|
+
getReadOnlyCellStyle(gridCell, params) {
|
|
622
|
+
const editableCellStyle = this.adaptableApi.userInterfaceApi.getReadOnlyCellStyle();
|
|
623
|
+
if (!editableCellStyle) {
|
|
624
|
+
return undefined;
|
|
625
|
+
}
|
|
626
|
+
if (gridCell) {
|
|
627
|
+
if (!this.adaptableApi.gridApi.isCellEditable(gridCell)) {
|
|
628
|
+
return convertAdaptableStyleToCSS(editableCellStyle);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return undefined;
|
|
632
|
+
}
|
|
633
|
+
getEditableCellStyle(gridCell, params) {
|
|
634
|
+
const editableCellStyle = this.adaptableApi.userInterfaceApi.getEditableCellStyle();
|
|
635
|
+
if (!editableCellStyle) {
|
|
636
|
+
return undefined;
|
|
637
|
+
}
|
|
638
|
+
if (gridCell) {
|
|
639
|
+
if (this.adaptableApi.gridApi.isCellEditable(gridCell)) {
|
|
640
|
+
return convertAdaptableStyleToCSS(editableCellStyle);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return undefined;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* The combination of styled column and format cells
|
|
647
|
+
* This functiond decides when the two can be merged.
|
|
648
|
+
*/
|
|
649
|
+
getFormatColumnAndStyledColumnCellStyle(gridCell, params) {
|
|
650
|
+
let styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(gridCell.column.columnId);
|
|
651
|
+
let styledColumnStyle = {};
|
|
652
|
+
if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended)) {
|
|
653
|
+
const styledCellStyle = this.getStyledColumnStyle(styledColumn, gridCell.column, params);
|
|
654
|
+
// for percentbar we want to merge
|
|
655
|
+
if (styledColumn.PercentBarStyle || styledColumn.BadgeStyle) {
|
|
656
|
+
styledColumnStyle = styledCellStyle;
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
// For other ones wo do not want to merge
|
|
660
|
+
return styledCellStyle;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const activeFormatColumnsWithStyle = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithStyleForColumn(gridCell.column);
|
|
664
|
+
return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
|
|
665
|
+
}
|
|
666
|
+
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
667
|
+
var _a, _b, _c;
|
|
668
|
+
let style = {};
|
|
669
|
+
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
670
|
+
if (params.value === undefined) {
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
let colValue = params.value;
|
|
674
|
+
if (this.adaptableApi.gridApi.isGroupRowNode(params.node)) {
|
|
675
|
+
return style;
|
|
676
|
+
// if (styledColumn.IncludeGroupedRows) {
|
|
677
|
+
// const minColumnValue =
|
|
678
|
+
// this.adaptableApi.styledColumnApi.internalApi.getMinValueForNumericColumn(abColumn);
|
|
679
|
+
// const maxColumnValue =
|
|
680
|
+
// this.adaptableApi.styledColumnApi.internalApi.getMaxValueForNumericColumn(abColumn);
|
|
681
|
+
// /**
|
|
682
|
+
// * Color should always be in bounds, it should not overflow.
|
|
683
|
+
// * If the value is out of range, it shoul set the maximum/minimum color.
|
|
684
|
+
// */
|
|
685
|
+
// colValue = clamp(params.value, minColumnValue, maxColumnValue);
|
|
686
|
+
// } else {
|
|
687
|
+
// return style;
|
|
688
|
+
// }
|
|
689
|
+
}
|
|
690
|
+
if (styledColumn.BadgeStyle &&
|
|
691
|
+
!((_a = styledColumn.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeSummaryRows) &&
|
|
692
|
+
((_c = (_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c[ROW_SUMMARY_ROW_ID])) {
|
|
693
|
+
return style;
|
|
694
|
+
}
|
|
695
|
+
if (gradientStyle) {
|
|
696
|
+
const min = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, colValue);
|
|
697
|
+
const max = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, colValue);
|
|
698
|
+
let cellBackColor;
|
|
699
|
+
let reverseGradient = false;
|
|
700
|
+
if (gradientStyle.ColumnComparison) {
|
|
701
|
+
cellBackColor = gradientStyle.ColumnComparison.Color;
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
const matchingRange = this.adaptableApi.styledColumnApi.internalApi.findRangeForColumn(gradientStyle.CellRanges, abColumn, gradientStyle.RangeValueType, colValue);
|
|
705
|
+
if (matchingRange) {
|
|
706
|
+
cellBackColor = matchingRange.Color;
|
|
707
|
+
reverseGradient = matchingRange.ReverseGradient;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
const increase = Math.abs(max - min);
|
|
711
|
+
const percentage = ((colValue - min) / increase) * 100;
|
|
712
|
+
let alpha = Number((percentage / 100).toPrecision(2));
|
|
713
|
+
if (reverseGradient) {
|
|
714
|
+
alpha = 1 - alpha;
|
|
715
|
+
}
|
|
716
|
+
const preparedColor = getVariableColor(cellBackColor);
|
|
717
|
+
// if no range match, do not apply color (black in this case)
|
|
718
|
+
if (cellBackColor) {
|
|
719
|
+
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
|
|
723
|
+
style.paddingTop = 0;
|
|
724
|
+
style.paddingBottom = 0;
|
|
725
|
+
}
|
|
726
|
+
return style;
|
|
727
|
+
}
|
|
728
|
+
getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
|
|
729
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
730
|
+
return {};
|
|
731
|
+
}
|
|
732
|
+
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
733
|
+
return this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value);
|
|
734
|
+
});
|
|
735
|
+
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
736
|
+
}
|
|
737
|
+
getFormatColumnAdaptableStyle(formatColumns) {
|
|
738
|
+
// first has more precedence, then they need to be applied in reverse order
|
|
739
|
+
return formatColumns.reduceRight((style, formatColumn) => {
|
|
740
|
+
const formatColumnStyle = formatColumn.Style
|
|
741
|
+
? convertAdaptableStyleToCSS(formatColumn.Style)
|
|
742
|
+
: {};
|
|
743
|
+
if (formatColumn.CellAlignment) {
|
|
744
|
+
switch (formatColumn.CellAlignment) {
|
|
745
|
+
case 'Left':
|
|
746
|
+
style.textAlign = 'left';
|
|
747
|
+
break;
|
|
748
|
+
case 'Right':
|
|
749
|
+
style.textAlign = 'right';
|
|
750
|
+
break;
|
|
751
|
+
case 'Center':
|
|
752
|
+
style.textAlign = 'center';
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
757
|
+
}, {});
|
|
758
|
+
}
|
|
759
|
+
getAlertCellStyle(gridCell, params) {
|
|
760
|
+
const alert = this.adaptableApi.alertApi.internalApi.getAdaptableAlertWithHighlightCell(gridCell.column.columnId, params.node);
|
|
761
|
+
if (alert) {
|
|
762
|
+
const highlightCell = alert.alertDefinition.AlertProperties.HighlightCell;
|
|
763
|
+
if (typeof highlightCell === 'object') {
|
|
764
|
+
return convertAdaptableStyleToCSS(highlightCell);
|
|
765
|
+
}
|
|
766
|
+
return {
|
|
767
|
+
backgroundColor: UIHelper.getColorByMessageType(alert.alertDefinition.MessageType),
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
getFlashingCellStyle(gridCell, params) {
|
|
772
|
+
var _a;
|
|
773
|
+
const primaryKey = params.node.aggData ? params.node.id : gridCell.primaryKeyValue;
|
|
774
|
+
const flashingCell = this.adaptableApi.flashingCellApi.internalApi.getAdaptableFlashingCellFor(primaryKey, gridCell.column.columnId);
|
|
775
|
+
if (!flashingCell) {
|
|
776
|
+
return {};
|
|
777
|
+
}
|
|
778
|
+
return convertAdaptableStyleToCSS((_a = (flashingCell.direction === 'up'
|
|
779
|
+
? flashingCell.flashingCellDefinition.UpChangeStyle
|
|
780
|
+
: flashingCell.direction === 'down'
|
|
781
|
+
? flashingCell.flashingCellDefinition.DownChangeStyle
|
|
782
|
+
: flashingCell.flashingCellDefinition.NeutralChangeStyle)) !== null && _a !== void 0 ? _a : {});
|
|
783
|
+
}
|
|
784
|
+
getCellHighlightStyle(gridCell, params) {
|
|
785
|
+
const cellHightlight = this.adaptableApi.internalApi
|
|
786
|
+
.getSystemState()
|
|
787
|
+
.HighlightedCells.find((cellHighlightInfo) => {
|
|
788
|
+
return (gridCell.column.columnId === cellHighlightInfo.columnId &&
|
|
789
|
+
cellHighlightInfo.primaryKeyValue === gridCell.primaryKeyValue);
|
|
790
|
+
});
|
|
791
|
+
if (cellHightlight) {
|
|
792
|
+
return convertAdaptableStyleToCSS(cellHightlight.highlightStyle);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|