@adaptabletools/adaptable-cjs 23.0.4 → 23.0.5-canary.1
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.js +0 -31
- package/index.css +0 -64
- package/index.js +0 -31
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
- package/src/AdaptableOptions/AdaptablePlugin.js +1 -9
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +3 -39
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +44 -16
- package/src/AdaptableState/Aggregations/only.js +0 -11
- package/src/AdaptableState/Aggregations/weightedAverage.d.ts +0 -1
- package/src/AdaptableState/Aggregations/weightedAverage.js +3 -30
- package/src/AdaptableState/Common/AdaptableColumn.js +0 -1
- package/src/AdaptableState/Common/AdaptableForm.js +0 -49
- package/src/AdaptableState/Common/AdaptableFormatPresets.js +0 -13
- package/src/AdaptableState/Common/AdaptablePredicate.js +3 -125
- package/src/AdaptableState/Common/AggregationColumns.js +0 -10
- package/src/AdaptableState/Common/Enums.js +0 -3
- package/src/AdaptableState/Common/Menu.js +1 -7
- package/src/AdaptableState/Common/MenuItem.js +0 -2
- package/src/AdaptableState/Common/Types.js +2 -5
- package/src/AdaptableState/StatusBarState.js +0 -3
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +0 -1
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.js +0 -4
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +0 -5
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +0 -8
- package/src/AdaptableState/Uuid.js +0 -1
- package/src/Api/Implementation/AdaptableApiImpl.js +0 -4
- package/src/Api/Implementation/AlertApiImpl.js +0 -21
- package/src/Api/Implementation/ApiBase.js +0 -24
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +0 -1
- package/src/Api/Implementation/ChartingApiImpl.js +0 -3
- package/src/Api/Implementation/ColumnApiImpl.js +1 -15
- package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -9
- package/src/Api/Implementation/ColumnScopeApiImpl.js +0 -21
- package/src/Api/Implementation/DashboardApiImpl.js +0 -1
- package/src/Api/Implementation/EntitlementApiImpl.js +0 -1
- package/src/Api/Implementation/ExportApiImpl.js +0 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +0 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +0 -3
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -2
- package/src/Api/Implementation/GridApiImpl.js +1 -22
- package/src/Api/Implementation/GridFilterApiImpl.js +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -18
- package/src/Api/Implementation/LayoutHelpers.js +0 -16
- package/src/Api/Implementation/NamedQueryApiImpl.js +0 -1
- package/src/Api/Implementation/PredicateApiImpl.js +0 -5
- package/src/Api/Implementation/RowFormApiImpl.js +0 -2
- package/src/Api/Implementation/StateApiImpl.js +0 -7
- package/src/Api/Implementation/SystemStatusApiImpl.js +0 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +0 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +1 -39
- package/src/Api/Internal/AlertInternalApi.js +1 -102
- package/src/Api/Internal/CalculatedColumnInternalApi.js +0 -17
- package/src/Api/Internal/ChartingInternalApi.js +0 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +0 -52
- package/src/Api/Internal/ColumnInternalApi.js +0 -32
- package/src/Api/Internal/CustomSortInternalApi.js +0 -5
- package/src/Api/Internal/DashboardInternalApi.js +0 -23
- package/src/Api/Internal/DataImportInternalApi.js +0 -1
- package/src/Api/Internal/EventInternalApi.js +0 -2
- package/src/Api/Internal/ExportInternalApi.js +1 -16
- package/src/Api/Internal/ExpressionInternalApi.js +0 -23
- package/src/Api/Internal/Fdc3InternalApi.js +0 -9
- package/src/Api/Internal/FlashingCellInternalApi.js +0 -5
- package/src/Api/Internal/FormatColumnInternalApi.js +5 -107
- package/src/Api/Internal/FreeTextColumnInternalApi.js +0 -8
- package/src/Api/Internal/GridFilterInternalApi.js +0 -3
- package/src/Api/Internal/GridInternalApi.js +0 -37
- package/src/Api/Internal/LayoutInternalApi.js +0 -18
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -9
- package/src/Api/Internal/PredicateInternalApi.js +0 -23
- package/src/Api/Internal/RowFormInternalApi.js +0 -18
- package/src/Api/Internal/StateInternalApi.js +0 -25
- package/src/Api/Internal/StyledColumnInternalApi.js +0 -62
- package/src/Api/Internal/TeamSharingInternalApi.js +0 -9
- package/src/Redux/ActionsReducers/AlertRedux.js +0 -24
- package/src/Redux/ActionsReducers/ApplicationRedux.js +0 -9
- package/src/Redux/ActionsReducers/BulkUpdateRedux.js +0 -6
- package/src/Redux/ActionsReducers/CalculatedColumnRedux.js +1 -16
- package/src/Redux/ActionsReducers/ChartingRedux.js +0 -24
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -24
- package/src/Redux/ActionsReducers/CustomSortRedux.js +0 -24
- package/src/Redux/ActionsReducers/DashboardRedux.js +0 -33
- package/src/Redux/ActionsReducers/ExportRedux.js +0 -36
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +0 -24
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +0 -36
- package/src/Redux/ActionsReducers/FreeTextColumnRedux.js +1 -20
- package/src/Redux/ActionsReducers/InternalRedux.js +0 -42
- package/src/Redux/ActionsReducers/LayoutRedux.js +1 -67
- package/src/Redux/ActionsReducers/NamedQueryRedux.js +0 -15
- package/src/Redux/ActionsReducers/NoteRedux.js +0 -14
- package/src/Redux/ActionsReducers/PluginsRedux.js +0 -3
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +0 -34
- package/src/Redux/ActionsReducers/PopupRedux.js +2 -6
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +0 -15
- package/src/Redux/ActionsReducers/ShortcutRedux.js +0 -24
- package/src/Redux/ActionsReducers/SmartEditRedux.js +0 -6
- package/src/Redux/ActionsReducers/StatusBarRedux.js +0 -6
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +0 -27
- package/src/Redux/ActionsReducers/SystemStatusRedux.js +0 -6
- package/src/Redux/ActionsReducers/TeamSharingRedux.js +0 -1
- package/src/Redux/ActionsReducers/ThemeRedux.js +0 -26
- package/src/Redux/ActionsReducers/ToolPanelRedux.js +0 -22
- package/src/Redux/ActionsReducers/UserInterfaceRedux.js +0 -3
- package/src/Redux/ActionsReducers/utils.js +0 -6
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +0 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +0 -25
- package/src/Redux/Store/AdaptableStore.js +5 -301
- package/src/Strategy/AdaptableModuleBase.js +0 -35
- package/src/Strategy/AlertModule.js +0 -9
- package/src/Strategy/CellSummaryModule.js +0 -12
- package/src/Strategy/ChartingModule.js +0 -1
- package/src/Strategy/ColumnFilterModule.js +1 -11
- package/src/Strategy/CommentModule.js +0 -2
- package/src/Strategy/DashboardModule.js +0 -4
- package/src/Strategy/ExportModule.js +0 -1
- package/src/Strategy/FlashingCellModule.js +0 -8
- package/src/Strategy/FormatColumnModule.js +0 -3
- package/src/Strategy/FreeTextColumnModule.js +0 -3
- package/src/Strategy/LayoutModule.js +0 -26
- package/src/Strategy/NoteModule.js +0 -3
- package/src/Strategy/PlusMinusModule.js +0 -3
- package/src/Strategy/SettingsPanelModule.js +0 -1
- package/src/Strategy/ShortcutModule.js +0 -1
- package/src/Strategy/SmartEditModule.js +0 -5
- package/src/Strategy/StatusBarModule.js +0 -7
- package/src/Strategy/StyledColumnModule.js +1 -16
- package/src/Strategy/TeamSharingModule.js +0 -9
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +0 -5
- package/src/Utilities/Constants/DocumentationLinkConstants.js +0 -1
- package/src/Utilities/Constants/GeneralConstants.js +0 -10
- package/src/Utilities/Constants/ObjectDefaultConstants.js +0 -3
- package/src/Utilities/Constants/ReduxConstants.js +4 -8
- package/src/Utilities/Emitter.js +0 -9
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +0 -8
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +0 -15
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +0 -3
- package/src/Utilities/ExpressionFunctions/deepMap.js +0 -16
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +0 -9
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +7 -78
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +0 -9
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +2 -16
- package/src/Utilities/Extensions/ArrayExtensions.js +1 -63
- package/src/Utilities/Extensions/NumberExtensions.js +0 -27
- package/src/Utilities/Extensions/ObjectExtensions.js +0 -36
- package/src/Utilities/Extensions/StringExtensions.js +0 -27
- package/src/Utilities/Helpers/ActionColumnHelper.js +0 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -8
- package/src/Utilities/Helpers/DateHelper.js +0 -10
- package/src/Utilities/Helpers/DisplayFormatHelper.js +0 -8
- package/src/Utilities/Helpers/Helper.js +3 -9
- package/src/Utilities/Helpers/PlusMinusHelper.js +0 -20
- package/src/Utilities/Helpers/QuickSearchHelper.js +0 -5
- package/src/Utilities/Helpers/Scheduling/CronExpression.js +0 -43
- package/src/Utilities/Helpers/Scheduling/ScheduledReportHelper.js +0 -4
- package/src/Utilities/Helpers/SettingsPanelHelper.js +40 -4
- package/src/Utilities/Helpers/StyleHelper.js +0 -56
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.js +0 -46
- package/src/Utilities/Helpers/StyledColumns/GradientStyleHelper.js +0 -38
- package/src/Utilities/Helpers/StyledColumns/IconStyleHelper.js +0 -39
- package/src/Utilities/Helpers/StyledColumns/PercentBarStyleHelper.js +0 -1
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +0 -5
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.js +0 -37
- package/src/Utilities/Helpers/TimingHelper.js +0 -13
- package/src/Utilities/ObjectFactory.js +2 -4
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +0 -7
- package/src/Utilities/Services/AlertService.js +0 -1
- package/src/Utilities/Services/AnnotationsService.js +0 -22
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +0 -8
- package/src/Utilities/Services/ChartingService.js +0 -9
- package/src/Utilities/Services/DataService.js +0 -11
- package/src/Utilities/Services/Fdc3Service.js +0 -3
- package/src/Utilities/Services/FlashingCellService.js +0 -6
- package/src/Utilities/Services/ModuleService.js +0 -8
- package/src/Utilities/Services/QueryLanguageService.js +2 -25
- package/src/Utilities/Services/RowFormService.js +0 -1
- package/src/Utilities/Services/RowSummaryService.js +1 -20
- package/src/Utilities/Services/TeamSharingService.js +0 -15
- package/src/Utilities/Services/ThemeService.js +0 -7
- package/src/Utilities/Services/ValidationService.js +0 -21
- package/src/Utilities/createAgStatusPanelComponent.js +0 -3
- package/src/Utilities/getExpressionViewItems.js +0 -2
- package/src/Utilities/getObjectTagsViewItems.js +0 -1
- package/src/Utilities/getScrollbarSize.js +0 -1
- package/src/Utilities/logDeprecation.js +0 -3
- package/src/Utilities/resolveContainerElement.js +0 -21
- package/src/Utilities/runIfNotResolvedIn.js +0 -7
- package/src/Utilities/sortColumnStateForVisibleColumns.js +2 -12
- package/src/Utilities/waitForTimeout.js +0 -1
- package/src/Utilities/wizardSelection.js +0 -2
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/AdaptableView.js +1 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -23
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -2
- package/src/View/AdaptableWizardView/Wizard.js +0 -12
- package/src/View/AdaptableWizardView/helper.js +0 -11
- package/src/View/Alert/ActiveAlertsPanel.js +0 -2
- package/src/View/Alert/AlertStatusSubPanel.js +0 -8
- package/src/View/Alert/Utilities/getAlertType.js +0 -7
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +0 -5
- package/src/View/Alert/Utilities/mapAlertDefinition.js +0 -3
- package/src/View/Alert/Wizard/AlertWizard.js +0 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +0 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +0 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +0 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +0 -3
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -7
- package/src/View/Charting/EditChartButton.js +1 -4
- package/src/View/Charting/ShowChartButton.js +0 -3
- package/src/View/Charting/useAgChartState.js +0 -5
- package/src/View/Charting/useChartingElements.js +0 -4
- package/src/View/Charting/useExternalChartState.js +0 -6
- package/src/View/ColumnInfo/ColumnInfo.js +7 -17
- package/src/View/Comments/CommentsEditor.js +1 -16
- package/src/View/Components/AdaptableButton/AdaptableButtonComponent.js +0 -1
- package/src/View/Components/AdaptableButton/AdaptableButtonView.js +0 -3
- package/src/View/Components/AdaptableDateInput/index.js +2 -9
- package/src/View/Components/AdaptableIconComponent/index.js +0 -4
- package/src/View/Components/AdaptableIconSelector/index.js +0 -3
- package/src/View/Components/AdaptableInput/index.js +0 -2
- package/src/View/Components/Badge/index.js +0 -8
- package/src/View/Components/Buttons/ButtonNewPage.js +1 -2
- package/src/View/Components/CellPopup/index.js +1 -2
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +0 -4
- package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.js +0 -4
- package/src/View/Components/ColumnFilter/ColumnFilter.js +3 -46
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +0 -2
- package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -20
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +2 -16
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -4
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -6
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +0 -20
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +0 -5
- package/src/View/Components/ColumnFilter/utils.js +2 -9
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.js +0 -2
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +0 -1
- package/src/View/Components/EntityRulesEditor/index.js +1 -11
- package/src/View/Components/ExternalRenderer.js +1 -3
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -52
- package/src/View/Components/ModuleValueSelector/index.js +0 -2
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Panels/PanelWithRow.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -2
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +0 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +0 -3
- package/src/View/Components/Popups/AdaptableToaster.js +0 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +0 -8
- package/src/View/Components/RangesComponent.js +0 -57
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +0 -3
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -6
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -18
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +0 -4
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -4
- package/src/View/Components/ValueSelector/index.js +0 -4
- package/src/View/Components/wizardColumnListStyles.js +0 -5
- package/src/View/Dashboard/CustomToolbar.js +1 -25
- package/src/View/Dashboard/PinnedToolbarsSelector.js +0 -1
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -22
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +0 -1
- package/src/View/DataImport/systemFileHandlers.js +1 -1
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +0 -27
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +0 -7
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -12
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -10
- package/src/View/GridFilter/GridFilterPopup.js +0 -1
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +0 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -31
- package/src/View/Layout/LayoutViewPanel.js +0 -2
- package/src/View/Layout/PivotDetailsPopoup.js +0 -2
- package/src/View/Layout/TransposedPopup.js +0 -7
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -6
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +0 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -32
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +0 -3
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +0 -2
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +0 -4
- package/src/View/Note/NotePopup.js +0 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +0 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +0 -4
- package/src/View/StatusBar/StatusBarPanel.js +0 -8
- package/src/View/StatusBar/StatusBarPopup.js +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +0 -11
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +0 -28
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -25
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +0 -26
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +0 -40
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +0 -55
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +0 -15
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +0 -21
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.js +0 -10
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +0 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +1 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +0 -21
- package/src/View/SystemStatus/SystemStatusPopup.js +0 -1
- package/src/View/TeamSharing/SharedEntityObjectView.js +0 -1
- package/src/View/Theme/ThemeSelector.js +0 -1
- package/src/View/UIHelper.js +0 -6
- package/src/View/UIInterfaces.js +0 -1
- package/src/View/Wizard/CollapsibleWizardCard.js +1 -8
- package/src/View/Wizard/OnePageWizards.js +2 -9
- package/src/View/Wizard/SummaryColorTag.js +0 -1
- package/src/View/Wizard/useKeyboardNavigation.js +1 -3
- package/src/agGrid/Adaptable.js +0 -12
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
- package/src/agGrid/AdaptableAgGrid.js +3 -482
- package/src/agGrid/AdaptableFilterHandler.js +0 -5
- package/src/agGrid/AdaptableLogger.js +0 -6
- package/src/agGrid/AgGridAdapter.js +3 -90
- package/src/agGrid/AgGridColumnAdapter.js +6 -168
- package/src/agGrid/AgGridExportAdapter.js +4 -106
- package/src/agGrid/AgGridFilterAdapter.js +0 -5
- package/src/agGrid/AgGridFloatingFilterAdapter.js +0 -10
- package/src/agGrid/AgGridMenuAdapter.js +0 -143
- package/src/agGrid/AgGridModulesAdapter.js +0 -2
- package/src/agGrid/AgGridOptionsService.js +0 -2
- package/src/agGrid/AgGridThemeAdapter.js +0 -7
- package/src/agGrid/agGridDataTypeDefinitions.js +0 -8
- package/src/agGrid/cellRenderers/BadgeRenderer.js +0 -10
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +1 -96
- package/src/agGrid/cellRenderers/IconRenderer.js +0 -55
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +0 -51
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +1 -50
- package/src/agGrid/cellRenderers/RatingRenderer.js +0 -40
- package/src/agGrid/editors/AdaptableDateEditor/index.js +0 -18
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +0 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +0 -11
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +0 -9
- package/src/agGrid/index.js +0 -6
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -73
- package/src/components/CodeBlock/index.d.ts +0 -1
- package/src/components/CodeBlock/index.js +2 -3
- package/src/components/ColorPicker/ColorPicker.js +0 -6
- package/src/components/Combobox/VirtualizedList.js +0 -5
- package/src/components/Combobox/index.js +5 -63
- package/src/components/Dashboard/Dashboard.js +1 -4
- package/src/components/Datepicker/index.js +2 -97
- package/src/components/DragAndDropContext/TabList.js +2 -6
- package/src/components/Drawer/index.js +0 -7
- package/src/components/Dropdown/index.js +0 -1
- package/src/components/DropdownButton/index.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -16
- package/src/components/ExpressionEditor/EditorButton.js +0 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -7
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +0 -1
- package/src/components/ExpressionEditor/ExpressionPreview.js +4 -14
- package/src/components/ExpressionEditor/NamedQueryContext.js +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -6
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +0 -12
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +0 -4
- package/src/components/ExpressionEditor/index.js +5 -14
- package/src/components/Icon/index.js +0 -2
- package/src/components/Input/NumberInput.js +0 -10
- package/src/components/Modal/Backdrop.js +0 -1
- package/src/components/OverlayTrigger/Overlay.js +0 -1
- package/src/components/OverlayTrigger/index.js +3 -15
- package/src/components/ProgressIndicator/ProgressIndicator.js +3 -16
- package/src/components/ResizeObserver/index.js +0 -7
- package/src/components/SimpleButton/index.js +2 -16
- package/src/components/Tabs/index.js +0 -3
- package/src/components/Tag/Tag.js +0 -1
- package/src/components/Tag/columnScopeTagHelpers.js +0 -2
- package/src/components/Textarea/index.js +1 -8
- package/src/components/Toggle/Toggle.js +1 -5
- package/src/components/Toggle/ToggleGroup.js +1 -3
- package/src/components/ToggleButton/index.js +1 -3
- package/src/components/Tree/TreeDropdown/index.js +2 -130
- package/src/components/Tree/treeUtils.js +0 -4
- package/src/components/WindowModal/WindowModal.js +1 -14
- package/src/components/WindowModal/useStacking.js +0 -7
- package/src/components/icons/bullet-chart.js +0 -4
- package/src/components/icons/icon-style.js +0 -4
- package/src/components/icons/index.js +26 -36
- package/src/components/icons/range-bar.js +0 -5
- package/src/components/icons/star.js +0 -1
- package/src/components/twUtils.js +3 -12
- package/src/components/ui/calendar.js +1 -9
- package/src/components/ui/combobox.js +0 -4
- package/src/components/utils/captureTabNavigation/getFocusableChildren.js +0 -1
- package/src/components/utils/useDraggable.js +0 -4
- package/src/components/utils/useProperty.js +0 -18
- package/src/devTools/index.js +0 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/LMEmitter.js +0 -5
- package/src/layout-manager/src/destructurePivotColumnId.js +0 -19
- package/src/layout-manager/src/index.js +2 -182
- package/src/layout-manager/src/isLayoutEqual.js +0 -1
- package/src/layout-manager/src/isPivotColumnTotal.js +0 -2
- package/src/layout-manager/src/normalizeLayoutModel.js +0 -27
- package/src/layout-manager/src/simplifyLayoutModel.js +0 -11
- package/src/layout-manager/src/sortColumnIdsByOrder.js +2 -12
- package/src/lib/utils.js +0 -1
- package/src/migration/AdaptableUpgradeHelper.js +0 -2
- package/src/migration/VersionUpgrade17.js +0 -33
- package/src/migration/VersionUpgrade20.js +1 -21
- package/src/migration/VersionUpgrade21.js +0 -3
- package/src/migration/VersionUpgrade22.js +0 -11
- package/src/migration/VersionUpgrade23.js +0 -73
- package/src/parser/src/evaluator.js +0 -1
- package/src/parser/src/index.js +0 -1
- package/src/parser/src/parser.js +4 -103
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +0 -5
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +0 -2
- package/src/parser/src/tokenizer.js +0 -2
- package/src/parser/src/utils.js +0 -1
- package/src/renderReactRoot.js +0 -12
- package/src/setupDevTools.js +0 -6
- package/src/twMerge.js +0 -1
- package/src/types.d.ts +1 -1
- package/src/types.js +0 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/NamedObject.d.ts +0 -10
- package/src/AdaptableState/Common/NamedObject.js +0 -2
- package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +0 -35
- package/src/Utilities/ExpressionFunctions/groupingMap.js +0 -103
- package/src/Utilities/Interface/AdaptableToolPanelContext.d.ts +0 -4
- package/src/Utilities/Interface/AdaptableToolPanelContext.js +0 -2
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +0 -20
- package/src/Utilities/Services/Interface/IMetamodelService.js +0 -2
- package/src/Utilities/Services/MetamodelService.d.ts +0 -17
- package/src/Utilities/Services/MetamodelService.js +0 -167
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +0 -104
- package/src/View/Components/Buttons/EntityListActionButtons.d.ts +0 -38
- package/src/View/Components/Buttons/EntityListActionButtons.js +0 -47
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.d.ts +0 -12
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +0 -72
- package/src/View/Components/EntityRowItem.d.ts +0 -7
- package/src/View/Components/EntityRowItem.js +0 -12
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +0 -3
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +0 -9
- package/src/View/Components/ModuleProfile.d.ts +0 -8
- package/src/View/Components/ModuleProfile.js +0 -15
- package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +0 -23
- package/src/View/Components/ModuleSummary/ModuleDetail.js +0 -20
- package/src/View/Components/ModuleSummary/ModuleHeader.d.ts +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.js +0 -20
- package/src/View/Components/ModuleSummary/SummaryRowItem.d.ts +0 -7
- package/src/View/Components/ModuleSummary/SummaryRowItem.js +0 -17
- package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +0 -9
- package/src/View/Components/SharedProps/ModuleSummaryProps.js +0 -2
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.d.ts +0 -13
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.js +0 -2
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.d.ts +0 -14
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.js +0 -2
- package/src/View/Components/StyleVisualItem.d.ts +0 -9
- package/src/View/Components/StyleVisualItem.js +0 -45
- package/src/View/Components/WizardSummaryPage.d.ts +0 -7
- package/src/View/Components/WizardSummaryPage.js +0 -22
- package/src/components/Accordion.d.ts +0 -7
- package/src/components/Accordion.js +0 -38
- package/src/components/FlexWithFooter.d.ts +0 -9
- package/src/components/FlexWithFooter.js +0 -15
- package/src/components/NotifyResize/index.d.ts +0 -9
- package/src/components/NotifyResize/index.js +0 -38
- package/src/components/PopupWithFooter.d.ts +0 -14
- package/src/components/PopupWithFooter.js +0 -15
- package/src/components/SelectableList/index.d.ts +0 -15
- package/src/components/SelectableList/index.js +0 -100
- package/src/components/SizedContainer/index.d.ts +0 -17
- package/src/components/SizedContainer/index.js +0 -23
- package/src/components/Table/index.d.ts +0 -4
- package/src/components/Table/index.js +0 -9
- package/src/components/WizardPanel/index.d.ts +0 -9
- package/src/components/WizardPanel/index.js +0 -10
- package/src/components/icons/align-justify.d.ts +0 -3
- package/src/components/icons/align-justify.js +0 -6
- package/src/components/icons/column-info.d.ts +0 -3
- package/src/components/icons/column-info.js +0 -6
- package/src/components/icons/gradient-column.d.ts +0 -3
- package/src/components/icons/gradient-column.js +0 -6
- package/src/components/icons/invalid.d.ts +0 -3
- package/src/components/icons/invalid.js +0 -6
- package/src/components/icons/logout copy.d.ts +0 -3
- package/src/components/icons/logout copy.js +0 -6
- package/src/components/icons/smart-edit.d.ts +0 -3
- package/src/components/icons/smart-edit.js +0 -6
- package/src/components/icons/team-share.d.ts +0 -3
- package/src/components/icons/team-share.js +0 -6
- package/src/components/icons/unchecked.d.ts +0 -3
- package/src/components/icons/unchecked.js +0 -6
- package/src/components/icons/user-filter.d.ts +0 -3
- package/src/components/icons/user-filter.js +0 -6
- package/src/components/utils/useContainerScrollObserver/index.d.ts +0 -6
- package/src/components/utils/useContainerScrollObserver/index.js +0 -83
- package/src/components/utils/useGlobalEvent.d.ts +0 -1
- package/src/components/utils/useGlobalEvent.js +0 -12
- package/src/components/utils/useLatest.d.ts +0 -1
- package/src/components/utils/useLatest.js +0 -10
- package/src/components/utils/usePropState.d.ts +0 -2
- package/src/components/utils/usePropState.js +0 -11
- package/src/metamodel/adaptable-metamodel-model.d.ts +0 -26
- package/src/metamodel/adaptable-metamodel-model.js +0 -2
- package/src/metamodel/adaptable.metamodel.d.ts +0 -6244
- package/src/metamodel/adaptable.metamodel.js +0 -1
|
@@ -28,7 +28,6 @@ const CalculatedColumnExpressionService_2 = require("../Utilities/Services/Calcu
|
|
|
28
28
|
const QueryLanguageService_1 = require("../Utilities/Services/QueryLanguageService");
|
|
29
29
|
const AlertService_1 = require("../Utilities/Services/AlertService");
|
|
30
30
|
const TeamSharingService_1 = require("../Utilities/Services/TeamSharingService");
|
|
31
|
-
const MetamodelService_1 = require("../Utilities/Services/MetamodelService");
|
|
32
31
|
const LicenseService_1 = require("../Utilities/Services/LicenseService");
|
|
33
32
|
const Types_1 = require("../AdaptableState/Common/Types");
|
|
34
33
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
@@ -118,12 +117,10 @@ const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEven
|
|
|
118
117
|
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
119
118
|
const agGridApi = event.api;
|
|
120
119
|
if (agGridApi?.isDestroyed()) {
|
|
121
|
-
// do nothing if AG Grid was destroyed in the meantime
|
|
122
120
|
return;
|
|
123
121
|
}
|
|
124
122
|
LocalEventService_dispatchEvent.apply(this, arguments);
|
|
125
123
|
if (event.type === 'cellChanged' || event.type === 'dataChanged') {
|
|
126
|
-
// @ts-ignore
|
|
127
124
|
const eventRowNode = event.node;
|
|
128
125
|
if (!eventRowNode) {
|
|
129
126
|
AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No RowNode found in passed event, this should never happen!`, event);
|
|
@@ -136,21 +133,14 @@ LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
|
136
133
|
}
|
|
137
134
|
return rowNodeApi;
|
|
138
135
|
};
|
|
139
|
-
// we don't know from which instance of aggrid this is coming,
|
|
140
|
-
// as this fn is shared by all instances
|
|
141
136
|
if (eventRowNode) {
|
|
142
137
|
AdaptableAgGrid.forEachAdaptable((adaptable) => {
|
|
143
138
|
if (extractGridApiFromRowNode(eventRowNode) !== adaptable.agGridAdapter?.getAgGridApi(true)) {
|
|
144
|
-
// the event is coming from another aggrid instance
|
|
145
|
-
// so IGNORE IT
|
|
146
139
|
return;
|
|
147
140
|
}
|
|
148
141
|
if (adaptable.isDestroyed) {
|
|
149
|
-
// do nothing if adaptable is destroyed (this is a rare case and happens when Adaptable is quickly destroyed and recreated)
|
|
150
142
|
return;
|
|
151
143
|
}
|
|
152
|
-
// we're on the correct instance, so do this
|
|
153
|
-
//@ts-ignore
|
|
154
144
|
const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
|
|
155
145
|
if (fn) {
|
|
156
146
|
fn(event);
|
|
@@ -167,9 +157,6 @@ class AdaptableAgGrid {
|
|
|
167
157
|
lifecycleState;
|
|
168
158
|
variant;
|
|
169
159
|
emitter;
|
|
170
|
-
/**
|
|
171
|
-
* Runtime flags
|
|
172
|
-
*/
|
|
173
160
|
hasAutogeneratedPrimaryKey;
|
|
174
161
|
hasAdaptableToolPanel;
|
|
175
162
|
initWithLazyData;
|
|
@@ -196,7 +183,6 @@ class AdaptableAgGrid {
|
|
|
196
183
|
QueryLanguageService;
|
|
197
184
|
AlertService;
|
|
198
185
|
TeamSharingService;
|
|
199
|
-
MetamodelService;
|
|
200
186
|
RowFormService;
|
|
201
187
|
Fdc3Service;
|
|
202
188
|
AnnotationsService;
|
|
@@ -223,13 +209,9 @@ class AdaptableAgGrid {
|
|
|
223
209
|
renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
|
|
224
210
|
unmountReactRoot;
|
|
225
211
|
unmountLoadingScreen;
|
|
226
|
-
/**
|
|
227
|
-
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
228
|
-
*/
|
|
229
212
|
adaptableStatusPanelKeys = [];
|
|
230
213
|
adaptableStatusPanelDefs = [];
|
|
231
214
|
hasAdaptableStatusBar;
|
|
232
|
-
// see #no_additional_react_root
|
|
233
215
|
_PRIVATE_adaptableJSXElement;
|
|
234
216
|
_prevLayout;
|
|
235
217
|
__prevLayoutForRefresh;
|
|
@@ -269,8 +251,6 @@ class AdaptableAgGrid {
|
|
|
269
251
|
get isDestroyed() {
|
|
270
252
|
return this.lifecycleState === 'preDestroyed';
|
|
271
253
|
}
|
|
272
|
-
// only for our private / internal events used within Adaptable
|
|
273
|
-
// public events are emitted through the EventApi
|
|
274
254
|
_emit = (eventName, data) => {
|
|
275
255
|
if (this.emitter) {
|
|
276
256
|
return this.emitter.emit(eventName, data);
|
|
@@ -293,10 +273,6 @@ class AdaptableAgGrid {
|
|
|
293
273
|
}
|
|
294
274
|
return this.emitter.onIncludeFired(eventName, callback);
|
|
295
275
|
};
|
|
296
|
-
/**
|
|
297
|
-
* Internal initializer for Adaptable, directly called by the React and Angular Adaptable wrappers
|
|
298
|
-
* @private
|
|
299
|
-
*/
|
|
300
276
|
static async _initInternal(config) {
|
|
301
277
|
let promise = null;
|
|
302
278
|
if (Array.isArray(config.adaptableOptions.plugins)) {
|
|
@@ -312,11 +288,7 @@ class AdaptableAgGrid {
|
|
|
312
288
|
})
|
|
313
289
|
: plugin.beforeInit(config.adaptableOptions, agGridOptions);
|
|
314
290
|
}
|
|
315
|
-
// if gridOptions changed, we need to update the runtimeConfig
|
|
316
291
|
if (agGridOptions.gridOptions !== config.gridOptions) {
|
|
317
|
-
// This allows plugins to modify
|
|
318
|
-
// FIXME AFL MIG: clarify if this is still needed (for NoCode Plugin?)
|
|
319
|
-
// it looks like a code smell, ideally we should get rid of it
|
|
320
292
|
config.gridOptions = agGridOptions.gridOptions;
|
|
321
293
|
}
|
|
322
294
|
}
|
|
@@ -347,7 +319,6 @@ class AdaptableAgGrid {
|
|
|
347
319
|
}
|
|
348
320
|
}
|
|
349
321
|
async _initAdaptableAgGrid(config) {
|
|
350
|
-
// Phase 1: Preprocess Adaptable Options
|
|
351
322
|
this._isDetailGrid = config.isDetailGrid === true;
|
|
352
323
|
this._isDetailGridForIndex = config.isDetailGridForRowIndex;
|
|
353
324
|
this.lifecycleState = 'preprocessOptions';
|
|
@@ -370,11 +341,6 @@ class AdaptableAgGrid {
|
|
|
370
341
|
const { showLoadingScreen, loadingScreenDelay, loadingScreenText, loadingScreenTitle } = this.adaptableOptions.userInterfaceOptions.loadingScreenOptions;
|
|
371
342
|
if (showLoadingScreen) {
|
|
372
343
|
this.logger.info('Showing loading screen');
|
|
373
|
-
// it's important to use ensureLoadingScreenPortalElement
|
|
374
|
-
// and not ensurePortalElement, because multiple adaptable instances share the same portal element
|
|
375
|
-
// so when displaying the second one, the react root associated to the portal element
|
|
376
|
-
// seems to be somewhat shared via the html element, so the portal element of the first one is destroyed
|
|
377
|
-
// resulting in the settings popup not being displayed anymore
|
|
378
344
|
const portalElement = (0, Modal_1.ensureLoadingScreenPortalElement)();
|
|
379
345
|
if (portalElement) {
|
|
380
346
|
this.unmountLoadingScreen = this.renderReactRoot((0, react_1.createElement)(AdaptableLoadingScreen_1.AdaptableLoadingScreen, {
|
|
@@ -403,16 +369,10 @@ class AdaptableAgGrid {
|
|
|
403
369
|
await this.adaptableStore.loadStore({
|
|
404
370
|
adaptable: this,
|
|
405
371
|
adaptableStateKey: this.adaptableOptions.adaptableStateKey,
|
|
406
|
-
/**
|
|
407
|
-
* This method is called after the store is loaded;
|
|
408
|
-
* it allows to modify the state before it is used by the application
|
|
409
|
-
* e.g. migrating deprecated state, etc.
|
|
410
|
-
*/
|
|
411
372
|
postLoadHook: (state) => {
|
|
412
373
|
if (this.adaptableOptions.stateOptions.autoMigrateState) {
|
|
413
374
|
this.api.logError;
|
|
414
375
|
const config = {
|
|
415
|
-
// version 16 actually includes all versions up until 16
|
|
416
376
|
fromVersion: 16,
|
|
417
377
|
logger: this.logger,
|
|
418
378
|
};
|
|
@@ -424,24 +384,15 @@ class AdaptableAgGrid {
|
|
|
424
384
|
});
|
|
425
385
|
perfLoadStore.end();
|
|
426
386
|
loadStoreMarker.end();
|
|
427
|
-
// just in case Adaptable was destroyed while loading the store (which is an async operation)
|
|
428
387
|
if (this.isDestroyed) {
|
|
429
388
|
this.midwayDestroy();
|
|
430
389
|
return Promise.reject('Adaptable was destroyed while loading the store.');
|
|
431
|
-
// FIXME AFL MIG: is this enough?! talk with the team
|
|
432
390
|
}
|
|
433
391
|
this.forPlugins((plugin) => plugin.afterInitialStateLoaded(this));
|
|
434
|
-
// do this now so it sets module entitlements
|
|
435
392
|
this.api.entitlementApi.internalApi.setModulesEntitlements();
|
|
436
|
-
/**
|
|
437
|
-
* At this point it's mandatory to have the ALL the Adaptable blocks initialized:
|
|
438
|
-
* Store, APIs, Services, Modules
|
|
439
|
-
*/
|
|
440
393
|
this.lifecycleState = 'setupAgGrid';
|
|
441
394
|
const gridOptions = config.gridOptions;
|
|
442
|
-
// Needed here because special column defs are required for deriving the adaptable column state
|
|
443
395
|
let columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns(gridOptions.columnDefs || []);
|
|
444
|
-
// see #map_dateString_to_date
|
|
445
396
|
this.agGridAdapter.patchColDefs(columnDefs, (colDef) => {
|
|
446
397
|
if (colDef.cellDataType === 'dateString') {
|
|
447
398
|
this.logger.consoleError(`Column "${colDef.colId}" uses cellDataType="dateString" which is no longer supported. It has been replaced with cellDataType="date". Please update your column definition.`);
|
|
@@ -464,7 +415,6 @@ class AdaptableAgGrid {
|
|
|
464
415
|
gridOptions.pivotDefaultExpanded = layoutModel.PivotExpandLevel;
|
|
465
416
|
}
|
|
466
417
|
gridOptions.groupDisplayType = (0, rowGroupDisplayType_1.rowGroupDisplayTypeToGridOption)(layoutModel.RowGroupDisplayType);
|
|
467
|
-
// fixes issue #3053
|
|
468
418
|
gridOptions.suppressAggFuncInHeader = !!layoutModel.SuppressAggFuncInHeader;
|
|
469
419
|
if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(layoutModel) &&
|
|
470
420
|
src_1.LayoutManager.shouldUnlockSelectionColumnPosition(layoutModel)) {
|
|
@@ -492,12 +442,6 @@ class AdaptableAgGrid {
|
|
|
492
442
|
initialRowSelection,
|
|
493
443
|
});
|
|
494
444
|
this.silentUpdateCurrentLayoutModel(layoutModel);
|
|
495
|
-
// this shouldn't be needed
|
|
496
|
-
// but AG Grid has a bug, and in pivot layout,
|
|
497
|
-
// even if we provide an initial AG Grid state with
|
|
498
|
-
// the aggregations in the correct order,
|
|
499
|
-
// they will end up in the wrong order
|
|
500
|
-
// so we need to force the layout to be applied again
|
|
501
445
|
if ((0, isPivotLayoutModel_1.isPivotLayoutModel)(layoutModel)) {
|
|
502
446
|
this.layoutManager.setLayout(layoutModel, {
|
|
503
447
|
force: true,
|
|
@@ -514,7 +458,6 @@ class AdaptableAgGrid {
|
|
|
514
458
|
this.unmountLoadingScreen?.();
|
|
515
459
|
perfInitAgGrid.end();
|
|
516
460
|
initAgGridMarker.end();
|
|
517
|
-
// we need to intercept several AG Grid Api methods and trigger Adaptable state changes
|
|
518
461
|
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
519
462
|
this.agGridAdapter.monkeyPatchingGridOptionsUpdates();
|
|
520
463
|
this.agGridAdapter.monkeyPatchingAggColumnFilters();
|
|
@@ -523,29 +466,16 @@ class AdaptableAgGrid {
|
|
|
523
466
|
this.api.entitlementApi.internalApi.setModulesAgGridDepsInfos();
|
|
524
467
|
this.ModuleService.logMissingAgGridDepsInfos();
|
|
525
468
|
this.logger.info('Registered AG Grid modules (including dependents):', this.agGridModulesAdapter.getAgGridRegisteredModuleNames().sort());
|
|
526
|
-
/**
|
|
527
|
-
* At this point AG Grid is initialized!
|
|
528
|
-
*/
|
|
529
469
|
this.deriveAdaptableColumnStateFromAgGrid();
|
|
530
470
|
this.agGridColumnAdapter.setupColumns();
|
|
531
|
-
// we need this because we need the internal Column state to be ready before doing any extra business logic
|
|
532
471
|
this.lifecycleState = 'available';
|
|
533
472
|
this.api.themeApi.applyCurrentTheme();
|
|
534
473
|
this.validatePrimaryKey();
|
|
535
474
|
this.checkShouldClearExistingFiltersOrSearches();
|
|
536
|
-
// initial filter model
|
|
537
475
|
const filteringApplied = this.applyFiltering();
|
|
538
|
-
// We may need to re-apply sort if there are ColumnSorts for columns with CustomSort defined
|
|
539
|
-
// This is required because AG Grid wasn't aware of the CustomSort when applying sorting initially
|
|
540
|
-
// this is not required when filtering was applied because filtering also triggers a sort refresh internally
|
|
541
476
|
if (!filteringApplied) {
|
|
542
477
|
this.refreshInitialSortIfNeeded();
|
|
543
478
|
}
|
|
544
|
-
// apply quick search if there is one
|
|
545
|
-
// yes, we could have put this on the gridOptions.findSearchValue
|
|
546
|
-
// but we need to wait for setupColumns to run first so as to correctly
|
|
547
|
-
// determine on which columns the quick search should be applied or not
|
|
548
|
-
// and also to setup the quick search style
|
|
549
479
|
const quickSearchState = this.api.stateApi.getQuickSearchState();
|
|
550
480
|
if (quickSearchState.QuickSearchText) {
|
|
551
481
|
this.setAgGridFindSearchValue(quickSearchState.QuickSearchText);
|
|
@@ -570,13 +500,6 @@ class AdaptableAgGrid {
|
|
|
570
500
|
if (adaptableContainerElem != null) {
|
|
571
501
|
adaptableContainerElem.innerHTML = '';
|
|
572
502
|
if (this.variant === 'react') {
|
|
573
|
-
/**
|
|
574
|
-
* #no_additional_react_root
|
|
575
|
-
* This is only used for the React variant
|
|
576
|
-
* Where we don't want to create a new React render tree here
|
|
577
|
-
* by rendering it as a React root, but instead we want to
|
|
578
|
-
* render it as is in the React tree of our AdaptableReact component
|
|
579
|
-
*/
|
|
580
503
|
this._PRIVATE_adaptableJSXElement = (0, AdaptableView_1.AdaptableApp)({ Adaptable: this });
|
|
581
504
|
}
|
|
582
505
|
else {
|
|
@@ -586,11 +509,6 @@ class AdaptableAgGrid {
|
|
|
586
509
|
this.lifecycleState = 'ready';
|
|
587
510
|
this.forPlugins((plugin) => plugin.onAdaptableReady(this, this.adaptableOptions));
|
|
588
511
|
setTimeout(() => {
|
|
589
|
-
// without the setTimeout, calling autoSizeAllColumns immediately in the onAdaptableReady
|
|
590
|
-
// does not work. (I prefer setTimeout to rAF, as raf is not running when you switch tabs)
|
|
591
|
-
//
|
|
592
|
-
// it also makes it possible to listen to CALCULATED_COLUMN_READY, DASHBOARD_READY, etc.
|
|
593
|
-
// in onAdaptableReady - without this those event listeners are not triggered
|
|
594
512
|
this.api?.eventApi?.emit('AdaptableReady', {
|
|
595
513
|
adaptableApi: this.api,
|
|
596
514
|
agGridApi: this.agGridAdapter.getAgGridApi(),
|
|
@@ -613,19 +531,13 @@ class AdaptableAgGrid {
|
|
|
613
531
|
}
|
|
614
532
|
normaliseLayoutState(state, gridOptions) {
|
|
615
533
|
const layoutState = state.Layout;
|
|
616
|
-
// ensure that at least one Layout has been provided
|
|
617
534
|
if (!layoutState || !layoutState.Layouts?.length) {
|
|
618
535
|
this.logger.consoleError('No Layouts defined in InitialState.Layout.Layouts[]. At least one Layout is required.');
|
|
619
536
|
}
|
|
620
|
-
// ensure CurrentLayout is valid
|
|
621
537
|
if (!layoutState.CurrentLayout ||
|
|
622
538
|
!layoutState.Layouts.find((l) => l.Name === layoutState.CurrentLayout)) {
|
|
623
539
|
layoutState.CurrentLayout = layoutState.Layouts?.[0]?.Name;
|
|
624
540
|
}
|
|
625
|
-
/**
|
|
626
|
-
* Viewport mode does not support a few AG Grid features which are contained in a Layout
|
|
627
|
-
* Accordingly we remove this when using this Row Model
|
|
628
|
-
*/
|
|
629
541
|
if (gridOptions.rowModelType === 'viewport') {
|
|
630
542
|
if (state.Layout.Layouts) {
|
|
631
543
|
state.Layout.Layouts = state.Layout.Layouts.filter((layout) => {
|
|
@@ -646,16 +558,7 @@ class AdaptableAgGrid {
|
|
|
646
558
|
const normalizeOptions = {
|
|
647
559
|
isTree: !!gridOptions.treeData,
|
|
648
560
|
};
|
|
649
|
-
// it's very important that we do this here
|
|
650
|
-
// as the layout may not be fully specified in the initialState
|
|
651
|
-
// eg: might not include the generated row group columns in the column order
|
|
652
|
-
// but the normalization does this for us
|
|
653
561
|
state.Layout.Layouts = state.Layout.Layouts.map((layout) => (0, LayoutHelpers_1.normalizeLayout)(layout, normalizeOptions));
|
|
654
|
-
//now let's normalize the In/NotIn predicate for the group column
|
|
655
|
-
// the inputs in this predicate should be an array of arrays
|
|
656
|
-
// but for ease of use (and also for similarity with the In predicate for
|
|
657
|
-
// other columns) we allow the inputs to be an array of strings
|
|
658
|
-
// and change them to an array of arrays
|
|
659
562
|
state.Layout.Layouts = state.Layout.Layouts.map((layout) => {
|
|
660
563
|
if (Array.isArray(layout.ColumnFilters)) {
|
|
661
564
|
layout.ColumnFilters = layout.ColumnFilters.map((columnFilter) => {
|
|
@@ -688,7 +591,6 @@ class AdaptableAgGrid {
|
|
|
688
591
|
if (state?.ToolPanel?.ToolPanels) {
|
|
689
592
|
return state;
|
|
690
593
|
}
|
|
691
|
-
// no Initial Adaptable State provided, we will display all the panels collapsed (custom & module)
|
|
692
594
|
const defaultToolPanels = [];
|
|
693
595
|
this.adaptableOptions.toolPanelOptions?.customToolPanels?.forEach((customToolPanel) => defaultToolPanels.push({ Name: customToolPanel.name }));
|
|
694
596
|
Types_1.ALL_TOOL_PANELS.forEach((moduleToolPanel) => defaultToolPanels.push({ Name: moduleToolPanel }));
|
|
@@ -715,20 +617,13 @@ class AdaptableAgGrid {
|
|
|
715
617
|
getDefaultColumnWidthForCol(columnId) {
|
|
716
618
|
return this.layoutManager.getDefaultColumnWidthForCol(columnId);
|
|
717
619
|
}
|
|
718
|
-
/**
|
|
719
|
-
* Returns TRUE if filtering was applied, FALSE otherwise
|
|
720
|
-
* This is important in the INIT phase because applying filtering will automatically refresh AG Grids columnState,
|
|
721
|
-
* implicitly refreshing the sorting state too (hence we don't need to apply sorting separately)
|
|
722
|
-
*/
|
|
723
620
|
applyFiltering(config) {
|
|
724
621
|
let filteringApplied = false;
|
|
725
|
-
// default updateColumnFilterModel to TRUE, if not provided
|
|
726
622
|
const updateColumnFilterModel = config?.updateColumnFilterModel ?? true;
|
|
727
623
|
const agGridApi = this.agGridAdapter.getAgGridApi();
|
|
728
624
|
if (updateColumnFilterModel) {
|
|
729
625
|
const columnFilters = this.api.filterApi.columnFilterApi
|
|
730
626
|
.getActiveColumnFilters()
|
|
731
|
-
// we need this additional filter because 'getActiveColumnFilters' checks only for suspended while 'isColumnFilterActive' also checkss for COMPLETE filters
|
|
732
627
|
.filter((columnFilter) => this.api.filterApi.columnFilterApi.isColumnFilterActive(columnFilter));
|
|
733
628
|
const filterModel = {};
|
|
734
629
|
columnFilters.forEach((columnFilter) => {
|
|
@@ -737,10 +632,8 @@ class AdaptableAgGrid {
|
|
|
737
632
|
agGridApi.setFilterModel(filterModel);
|
|
738
633
|
filteringApplied = Object.keys(filterModel).length > 0;
|
|
739
634
|
}
|
|
740
|
-
// FIXME AFL FILTER why is this needed???
|
|
741
635
|
this.refreshSelectedCellsState();
|
|
742
636
|
this.refreshSelectedRowsState();
|
|
743
|
-
// agGridApi.setFilterModel() already triggered onFilterChanged(), so we skip it if updateColumnFilterModel is TRUE
|
|
744
637
|
if (!filteringApplied) {
|
|
745
638
|
agGridApi.onFilterChanged();
|
|
746
639
|
filteringApplied = true;
|
|
@@ -748,10 +641,6 @@ class AdaptableAgGrid {
|
|
|
748
641
|
this._emit('AdapTableFiltersApplied');
|
|
749
642
|
return filteringApplied;
|
|
750
643
|
}
|
|
751
|
-
/**
|
|
752
|
-
* Checks if the current layout has ColumnSorts for columns that have CustomSort defined
|
|
753
|
-
* (either via initialState CustomSorts or via customSortComparers option) and refreshes the sort if needed.
|
|
754
|
-
*/
|
|
755
644
|
refreshInitialSortIfNeeded() {
|
|
756
645
|
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
757
646
|
const columnSorts = currentLayout?.ColumnSorts;
|
|
@@ -759,12 +648,10 @@ class AdaptableAgGrid {
|
|
|
759
648
|
return;
|
|
760
649
|
}
|
|
761
650
|
const hasCustomSortForSortedColumn = columnSorts.some((columnSort) => {
|
|
762
|
-
// Check if there's a CustomSort defined in state for this column
|
|
763
651
|
const customSort = this.api.customSortApi.getCustomSortForColumn(columnSort.ColumnId);
|
|
764
652
|
if (customSort && !customSort.IsSuspended) {
|
|
765
653
|
return true;
|
|
766
654
|
}
|
|
767
|
-
// Check if there's a customSortComparer defined in options for this column
|
|
768
655
|
if (this.api.customSortApi.internalApi.columnHasCustomSortComparer(columnSort.ColumnId)) {
|
|
769
656
|
return true;
|
|
770
657
|
}
|
|
@@ -783,7 +670,6 @@ class AdaptableAgGrid {
|
|
|
783
670
|
}
|
|
784
671
|
showAdaptableToolPanel() {
|
|
785
672
|
if (!this.hasAdaptableToolPanel) {
|
|
786
|
-
// don't re-add the ToolPanel if it's hidden by entitlement
|
|
787
673
|
if (this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel')) {
|
|
788
674
|
return;
|
|
789
675
|
}
|
|
@@ -800,7 +686,6 @@ class AdaptableAgGrid {
|
|
|
800
686
|
}
|
|
801
687
|
hideAdaptableToolPanel() {
|
|
802
688
|
if (this.hasAdaptableToolPanel) {
|
|
803
|
-
// close the tool panel if it's currently open
|
|
804
689
|
this.api.toolPanelApi.closeAdapTableToolPanel();
|
|
805
690
|
const currentSideBar = this.agGridAdapter.getGridOption('sideBar');
|
|
806
691
|
if (currentSideBar?.toolPanels) {
|
|
@@ -833,7 +718,6 @@ class AdaptableAgGrid {
|
|
|
833
718
|
if (!this.hasAdaptableStatusBar && this.adaptableStatusPanelDefs.length > 0) {
|
|
834
719
|
const currentStatusBar = this.agGridAdapter.getGridOption('statusBar');
|
|
835
720
|
if (currentStatusBar) {
|
|
836
|
-
// filter out any Adaptable panels that may already exist to avoid duplicates
|
|
837
721
|
const existingNonAdaptablePanels = (currentStatusBar.statusPanels ?? []).filter((panel) => !this.adaptableStatusPanelKeys.includes(panel.key));
|
|
838
722
|
const updatedStatusBar = {
|
|
839
723
|
...currentStatusBar,
|
|
@@ -869,9 +753,6 @@ class AdaptableAgGrid {
|
|
|
869
753
|
return adaptableOptions;
|
|
870
754
|
}
|
|
871
755
|
setInitialGridOptions(gridOptions, variant) {
|
|
872
|
-
/**
|
|
873
|
-
* set Adaptable instance on the AG Grid context
|
|
874
|
-
*/
|
|
875
756
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'context', (original_context) => {
|
|
876
757
|
const userContext = original_context || {};
|
|
877
758
|
return {
|
|
@@ -880,9 +761,6 @@ class AdaptableAgGrid {
|
|
|
880
761
|
adaptableApi: this.api,
|
|
881
762
|
};
|
|
882
763
|
});
|
|
883
|
-
/**
|
|
884
|
-
* `gridId`
|
|
885
|
-
*/
|
|
886
764
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'gridId', (original_gridId) => {
|
|
887
765
|
let agGridId = original_gridId || this.adaptableOptions.adaptableId;
|
|
888
766
|
if (this._isDetailGridForIndex != null) {
|
|
@@ -891,15 +769,11 @@ class AdaptableAgGrid {
|
|
|
891
769
|
this.agGridAdapter.setAgGridId(agGridId);
|
|
892
770
|
return agGridId;
|
|
893
771
|
});
|
|
894
|
-
/**
|
|
895
|
-
* `defaultColDef`
|
|
896
|
-
*/
|
|
897
772
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'defaultColDef', (original_defaultColDef) => {
|
|
898
773
|
if (original_defaultColDef?.headerValueGetter) {
|
|
899
774
|
this.logger.warn('defaultColDef.headerValueGetter overrides the Adaptable header mechanism. Consider using ColumnOptions.columnHeader instead.');
|
|
900
775
|
return original_defaultColDef;
|
|
901
776
|
}
|
|
902
|
-
// #customize_header
|
|
903
777
|
const defaultColDef = { ...original_defaultColDef };
|
|
904
778
|
defaultColDef.headerValueGetter = (0, adaptableOverrideCheck_1.tagProvidedByAdaptable)((params) => {
|
|
905
779
|
const columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
|
|
@@ -908,9 +782,6 @@ class AdaptableAgGrid {
|
|
|
908
782
|
});
|
|
909
783
|
return defaultColDef;
|
|
910
784
|
});
|
|
911
|
-
/**
|
|
912
|
-
* `defaultColGroupDef`
|
|
913
|
-
*/
|
|
914
785
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'defaultColGroupDef', (original_defaultColGroupDef) => {
|
|
915
786
|
if (original_defaultColGroupDef?.headerValueGetter) {
|
|
916
787
|
this.logger.warn('defaultColGroupDef.headerValueGetter overrides the Adaptable header mechanism. Consider using ColumnOptions.tableColumnHeader instead.');
|
|
@@ -922,17 +793,12 @@ class AdaptableAgGrid {
|
|
|
922
793
|
});
|
|
923
794
|
return defaultColGroupDef;
|
|
924
795
|
});
|
|
925
|
-
/**
|
|
926
|
-
* `autoGroupColumnDef`
|
|
927
|
-
*/
|
|
928
796
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'autoGroupColumnDef', (original_autoGroupColumnDef) => {
|
|
929
|
-
// #autoGroupColumnDef
|
|
930
797
|
const useAdaptableFilter = this.adaptableOptions.filterOptions.useAdaptableFiltering;
|
|
931
798
|
if (!useAdaptableFilter) {
|
|
932
799
|
return original_autoGroupColumnDef;
|
|
933
800
|
}
|
|
934
801
|
if (original_autoGroupColumnDef?.filter === false) {
|
|
935
|
-
// if user disables filter on autoGroupColumnDef, we respect that
|
|
936
802
|
this.logger.info('autoGroupColumnDef.filter is disabled via user configuration.');
|
|
937
803
|
return original_autoGroupColumnDef;
|
|
938
804
|
}
|
|
@@ -941,18 +807,12 @@ class AdaptableAgGrid {
|
|
|
941
807
|
return original_autoGroupColumnDef;
|
|
942
808
|
}
|
|
943
809
|
const autoGroupColumnDef = { ...original_autoGroupColumnDef };
|
|
944
|
-
// this is required to make sure that AG Grid doesn't disable the filter
|
|
945
|
-
// !! DO NOT REMOVE THIS !!
|
|
946
|
-
// see https://github.com/ag-grid/ag-grid/blob/6f43ff257c2e285068eb425b655e58d6eeb89816/packages/ag-grid-enterprise/src/rowHierarchy/autoColService.ts#L225
|
|
947
810
|
autoGroupColumnDef.filterValueGetter = (params) => {
|
|
948
811
|
this.logger.consoleWarn('Unexpected invocation of autoGroupColumnDef.filterValueGetter. This is not expected under normal operation. Please contact support.', params);
|
|
949
812
|
return '';
|
|
950
813
|
};
|
|
951
|
-
// !! it is important that we always return the same component / handler instances
|
|
952
|
-
// otherwise AG Grid will re-create the filter instance on each filterModel change
|
|
953
814
|
const autoGroupFilterComponent = (0, AgGridFilterAdapter_1.AgGridFilterAdapterFactory)(this);
|
|
954
815
|
const autoGroupFilterHandlerGenerator = () => new AdaptableFilterHandler_1.AdaptableFilterHandler(this.api);
|
|
955
|
-
// Use a getter to dynamically return different filter values based on Layout.RowGroupDisplayType
|
|
956
816
|
Object.defineProperty(autoGroupColumnDef, 'filter', {
|
|
957
817
|
get: () => {
|
|
958
818
|
if (this.isDestroyed) {
|
|
@@ -985,7 +845,6 @@ class AdaptableAgGrid {
|
|
|
985
845
|
if (rowGroupDisplayType === 'single') {
|
|
986
846
|
return true;
|
|
987
847
|
}
|
|
988
|
-
// this is required because of AG Grid bug, see https://github.com/AdaptableTools/adaptable/issues/3212
|
|
989
848
|
if (rowGroupDisplayType === 'multi') {
|
|
990
849
|
const groupedColumnFilterConfig = this.api.layoutApi.internalApi.areAllGroupedColumnsFilterable();
|
|
991
850
|
if (groupedColumnFilterConfig.floatingFilter) {
|
|
@@ -997,10 +856,7 @@ class AdaptableAgGrid {
|
|
|
997
856
|
enumerable: true,
|
|
998
857
|
configurable: true,
|
|
999
858
|
});
|
|
1000
|
-
// !! it is important that we always return the same component / handler instances
|
|
1001
|
-
// otherwise AG Grid will re-create the filter instance on each filterModel change
|
|
1002
859
|
const autoGroupFloatingFilterComponent = (0, AgGridFloatingFilterAdapter_1.AgGridFloatingFilterAdapterFactory)(this);
|
|
1003
|
-
// Use a getter to dynamically return different floatingFilterComponent values based on Layout.RowGroupDisplayType
|
|
1004
860
|
Object.defineProperty(autoGroupColumnDef, 'floatingFilterComponent', {
|
|
1005
861
|
get: () => {
|
|
1006
862
|
if (this.isDestroyed) {
|
|
@@ -1018,31 +874,20 @@ class AdaptableAgGrid {
|
|
|
1018
874
|
}
|
|
1019
875
|
return autoGroupColumnDef;
|
|
1020
876
|
});
|
|
1021
|
-
/**
|
|
1022
|
-
* `theme`
|
|
1023
|
-
*/
|
|
1024
877
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'theme', (original_theme) => {
|
|
1025
878
|
this.agGridThemeAdapter.setAgGridThemeMode(original_theme === 'legacy' ? 'legacy' : 'themingApi');
|
|
1026
879
|
return original_theme;
|
|
1027
880
|
});
|
|
1028
|
-
/**
|
|
1029
|
-
* `getRowId`
|
|
1030
|
-
*/
|
|
1031
881
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'getRowId', (original_getRowId) => {
|
|
1032
882
|
if (original_getRowId) {
|
|
1033
883
|
return original_getRowId;
|
|
1034
884
|
}
|
|
1035
885
|
const primaryKey = this.adaptableOptions.primaryKey;
|
|
1036
886
|
if (StringExtensions_1.default.IsNullOrEmpty(primaryKey)) {
|
|
1037
|
-
// if no valid PK then do nothing
|
|
1038
887
|
return original_getRowId;
|
|
1039
888
|
}
|
|
1040
889
|
if (this.hasAutogeneratedPrimaryKey) {
|
|
1041
890
|
return (params) => {
|
|
1042
|
-
// if the PK value is autogenerated, we need to make sure that the rowData has a valid PK value
|
|
1043
|
-
// this should be taken care of in the Adaptable.[loadDataSource/setDataSource/updateRows]() methods, but the users will always make silly decisions
|
|
1044
|
-
// so just to be safe we'll check here and add a PK value is missing
|
|
1045
|
-
// thus adding a side-effect in a getter, but what can we do against it?! :)
|
|
1046
891
|
if (Helper_1.Helper.objectNotExists(params.data[primaryKey])) {
|
|
1047
892
|
params.data[primaryKey] = (0, uuid_1.createUuid)();
|
|
1048
893
|
}
|
|
@@ -1050,7 +895,6 @@ class AdaptableAgGrid {
|
|
|
1050
895
|
};
|
|
1051
896
|
}
|
|
1052
897
|
return (params) => {
|
|
1053
|
-
// might be a summary row
|
|
1054
898
|
if (params.data?.[RowSummary_1.ROW_SUMMARY_ROW_ID] != undefined) {
|
|
1055
899
|
return params.data[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
1056
900
|
}
|
|
@@ -1073,7 +917,6 @@ class AdaptableAgGrid {
|
|
|
1073
917
|
? `${primaryKeyValue}`
|
|
1074
918
|
: params.data[primaryKey];
|
|
1075
919
|
}
|
|
1076
|
-
// fallback
|
|
1077
920
|
const parentKeys = params.parentKeys ?? [];
|
|
1078
921
|
const values = Object.values(params.data);
|
|
1079
922
|
if (values.length) {
|
|
@@ -1082,10 +925,6 @@ class AdaptableAgGrid {
|
|
|
1082
925
|
}
|
|
1083
926
|
};
|
|
1084
927
|
});
|
|
1085
|
-
// this is necessary here for the initialisation of the LayoutManager
|
|
1086
|
-
/**
|
|
1087
|
-
* `grandTotalRow`
|
|
1088
|
-
*/
|
|
1089
928
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'grandTotalRow', (original_grandTotalRow) => {
|
|
1090
929
|
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
1091
930
|
if (!currentLayout) {
|
|
@@ -1097,10 +936,6 @@ class AdaptableAgGrid {
|
|
|
1097
936
|
? undefined
|
|
1098
937
|
: currentLayout.GrandTotalRow;
|
|
1099
938
|
});
|
|
1100
|
-
// this is necessary here for the initialisation of the LayoutManager
|
|
1101
|
-
/**
|
|
1102
|
-
* `suppressAggFuncInHeader`
|
|
1103
|
-
*/
|
|
1104
939
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'suppressAggFuncInHeader', (original_suppressAggFuncInHeader) => {
|
|
1105
940
|
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
1106
941
|
if (!currentLayout) {
|
|
@@ -1108,9 +943,6 @@ class AdaptableAgGrid {
|
|
|
1108
943
|
}
|
|
1109
944
|
return currentLayout.SuppressAggFuncInHeader;
|
|
1110
945
|
});
|
|
1111
|
-
/**
|
|
1112
|
-
* `aggFuncs`
|
|
1113
|
-
*/
|
|
1114
946
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'aggFuncs', (original_aggFuncs) => {
|
|
1115
947
|
const aggregationFunctions = original_aggFuncs || {};
|
|
1116
948
|
aggregationFunctions[AggregationColumns_1.ONLY_AGG_FN_NAME] = (params) => {
|
|
@@ -1129,17 +961,11 @@ class AdaptableAgGrid {
|
|
|
1129
961
|
};
|
|
1130
962
|
return aggregationFunctions;
|
|
1131
963
|
});
|
|
1132
|
-
/**
|
|
1133
|
-
* `allowContextMenuWithControlKey`
|
|
1134
|
-
*/
|
|
1135
964
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'allowContextMenuWithControlKey', (original_allowContextMenuWithControlKey) => {
|
|
1136
965
|
return original_allowContextMenuWithControlKey === undefined
|
|
1137
966
|
? true
|
|
1138
967
|
: original_allowContextMenuWithControlKey;
|
|
1139
968
|
});
|
|
1140
|
-
/**
|
|
1141
|
-
* `enableFilterHandlers`
|
|
1142
|
-
*/
|
|
1143
969
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'enableFilterHandlers', (original_enableFilterHandlers) => {
|
|
1144
970
|
const useAdaptableFiltering = this.api.optionsApi.getFilterOptions().useAdaptableFiltering;
|
|
1145
971
|
if (useAdaptableFiltering) {
|
|
@@ -1147,9 +973,6 @@ class AdaptableAgGrid {
|
|
|
1147
973
|
}
|
|
1148
974
|
return original_enableFilterHandlers;
|
|
1149
975
|
});
|
|
1150
|
-
/**
|
|
1151
|
-
* `suppressSetFilterByDefault`
|
|
1152
|
-
*/
|
|
1153
976
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'suppressSetFilterByDefault', (original_suppressSetFilterByDefault) => {
|
|
1154
977
|
const useAdaptableFiltering = this.api.optionsApi.getFilterOptions().useAdaptableFiltering;
|
|
1155
978
|
if (useAdaptableFiltering) {
|
|
@@ -1157,9 +980,6 @@ class AdaptableAgGrid {
|
|
|
1157
980
|
}
|
|
1158
981
|
return original_suppressSetFilterByDefault;
|
|
1159
982
|
});
|
|
1160
|
-
/**
|
|
1161
|
-
* `isExternalFilterPresent`
|
|
1162
|
-
*/
|
|
1163
983
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'isExternalFilterPresent', (original_isExternalFilterPresent) => {
|
|
1164
984
|
return (params) => {
|
|
1165
985
|
if (!this.isAvailable) {
|
|
@@ -1167,13 +987,9 @@ class AdaptableAgGrid {
|
|
|
1167
987
|
}
|
|
1168
988
|
const isGridFilterActive = StringExtensions_1.default.IsNotNullOrEmpty(this.api.filterApi.gridFilterApi.getCurrentGridFilterExpression());
|
|
1169
989
|
return (isGridFilterActive ||
|
|
1170
|
-
// it means that userPropertyValue will be called so we re-init that collection
|
|
1171
990
|
(original_isExternalFilterPresent ? original_isExternalFilterPresent(params) : false));
|
|
1172
991
|
};
|
|
1173
992
|
});
|
|
1174
|
-
/**
|
|
1175
|
-
* `doesExternalFilterPass`
|
|
1176
|
-
*/
|
|
1177
993
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'doesExternalFilterPass', (original_doesExternalFilterPass) => {
|
|
1178
994
|
return (node) => {
|
|
1179
995
|
if (!this.isAvailable) {
|
|
@@ -1182,31 +998,22 @@ class AdaptableAgGrid {
|
|
|
1182
998
|
if (this.isGroupRowNode(node)) {
|
|
1183
999
|
if (this.api.gridApi.isTreeDataGrid()) {
|
|
1184
1000
|
if (node.data == undefined) {
|
|
1185
|
-
// Filler Groups are not filterable
|
|
1186
|
-
// see https://www.ag-grid.com/javascript-data-grid/tree-data-paths/#filler-groups
|
|
1187
1001
|
return false;
|
|
1188
1002
|
}
|
|
1189
1003
|
}
|
|
1190
1004
|
else {
|
|
1191
|
-
// for non-Tree Data Grids, we don't filter Group Rows
|
|
1192
|
-
// not sure if that's 100% correct, but we did it like this in the past
|
|
1193
|
-
// so we keep it like this for now until bugs are reported
|
|
1194
1005
|
return true;
|
|
1195
1006
|
}
|
|
1196
1007
|
}
|
|
1197
|
-
// first assess if the Row is filterable - if not, then return true so it always appears in Grid
|
|
1198
1008
|
const isRowFilterable = this.api.gridApi.internalApi.isRowFilterable(node);
|
|
1199
1009
|
if (!isRowFilterable) {
|
|
1200
1010
|
return true;
|
|
1201
1011
|
}
|
|
1202
|
-
// next we assess a Grid Filter (if its running locally)
|
|
1203
1012
|
const currentGridFilterExpression = this.api.filterApi.gridFilterApi.getCurrentGridFilterExpression();
|
|
1204
1013
|
if (StringExtensions_1.default.IsNotNullOrEmpty(currentGridFilterExpression)) {
|
|
1205
1014
|
const evaluateGridFilterOnClient = this.api.expressionApi.internalApi.evaluateExpressionInAdaptableQL('GridFilter', undefined, currentGridFilterExpression);
|
|
1206
1015
|
if (evaluateGridFilterOnClient) {
|
|
1207
1016
|
const isCurrentGridFilterValid = this.api.expressionApi.isValidBooleanExpression(currentGridFilterExpression, ModuleConstants_1.GridFilterModuleId, `Invalid Grid Filter '${currentGridFilterExpression}'`);
|
|
1208
|
-
// Not sure about this - what should we do with an invalid Grid Filter?
|
|
1209
|
-
// Here we essentially clear the Grid for invalid Grid Filter by returning false for each row
|
|
1210
1017
|
if (!isCurrentGridFilterValid) {
|
|
1211
1018
|
return false;
|
|
1212
1019
|
}
|
|
@@ -1224,26 +1031,16 @@ class AdaptableAgGrid {
|
|
|
1224
1031
|
return result;
|
|
1225
1032
|
};
|
|
1226
1033
|
});
|
|
1227
|
-
/**
|
|
1228
|
-
* `getMainMenuItems`
|
|
1229
|
-
*/
|
|
1230
1034
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'getMainMenuItems', (original_getMainMenuItems) => {
|
|
1231
1035
|
return (params) => {
|
|
1232
|
-
// 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....
|
|
1233
1036
|
return this.agGridMenuAdapter.buildColumnMenu(params, original_getMainMenuItems);
|
|
1234
1037
|
};
|
|
1235
1038
|
});
|
|
1236
|
-
/**
|
|
1237
|
-
* `getContextMenuItems`
|
|
1238
|
-
*/
|
|
1239
1039
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'getContextMenuItems', (original_getContextMenuItems) => {
|
|
1240
1040
|
return (params) => {
|
|
1241
1041
|
return this.agGridMenuAdapter.buildContextMenu(params, original_getContextMenuItems);
|
|
1242
1042
|
};
|
|
1243
1043
|
});
|
|
1244
|
-
/**
|
|
1245
|
-
* `components`
|
|
1246
|
-
*/
|
|
1247
1044
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'components', (original_components) => {
|
|
1248
1045
|
const AdaptableToolPanel = (0, AdaptableToolPanel_1.getAdaptableToolPanelAgGridComponent)(this);
|
|
1249
1046
|
const components = original_components || {};
|
|
@@ -1254,27 +1051,15 @@ class AdaptableAgGrid {
|
|
|
1254
1051
|
return adaptableComponents;
|
|
1255
1052
|
});
|
|
1256
1053
|
if (variant === 'react') {
|
|
1257
|
-
|
|
1258
|
-
// but for now, if we simply set it to true, it will break our editors, etc
|
|
1259
|
-
// this.agGridOptionsService.setGridOptionsProperty(
|
|
1260
|
-
// gridOptions,
|
|
1261
|
-
// 'reactiveCustomComponents',
|
|
1262
|
-
// () => true
|
|
1263
|
-
// );
|
|
1264
|
-
}
|
|
1265
|
-
/**
|
|
1266
|
-
* `sidebar`
|
|
1267
|
-
*/
|
|
1054
|
+
}
|
|
1268
1055
|
if (gridOptions.sideBar != undefined) {
|
|
1269
1056
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'sideBar', (original_sideBar) => {
|
|
1270
1057
|
if (!original_sideBar) {
|
|
1271
|
-
// lucky us, no sideBar is defined, so we don't have to do anything
|
|
1272
1058
|
return original_sideBar;
|
|
1273
1059
|
}
|
|
1274
1060
|
const isAdaptableToolPanelHidden = this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel');
|
|
1275
1061
|
const adaptableToolPanelDef = this.buildAdaptableToolPanelDef();
|
|
1276
1062
|
const mapToolPanelDefs = (toolPanelDefs = []) => {
|
|
1277
|
-
// if it's an alias for the adaptable tool panel, map it to a ToolPanelDef, otherwise return it as it is
|
|
1278
1063
|
return toolPanelDefs.map((toolPanelDef) => toolPanelDef === GeneralConstants.ADAPTABLE_TOOLPANEL_ID
|
|
1279
1064
|
? adaptableToolPanelDef
|
|
1280
1065
|
: toolPanelDef);
|
|
@@ -1284,7 +1069,6 @@ class AdaptableAgGrid {
|
|
|
1284
1069
|
};
|
|
1285
1070
|
let result;
|
|
1286
1071
|
if (original_sideBar === true) {
|
|
1287
|
-
// create all tool panels with default settings
|
|
1288
1072
|
const toolPanels = [];
|
|
1289
1073
|
toolPanels.push(GeneralConstants.AGGRID_TOOLPANEL_FILTERS);
|
|
1290
1074
|
toolPanels.push(GeneralConstants.AGGRID_TOOLPANEL_COLUMNS);
|
|
@@ -1295,7 +1079,6 @@ class AdaptableAgGrid {
|
|
|
1295
1079
|
toolPanels: toolPanels,
|
|
1296
1080
|
};
|
|
1297
1081
|
}
|
|
1298
|
-
// if there is only one tool panel, and it's the adaptable one => we have to handle it
|
|
1299
1082
|
else if (typeof original_sideBar === 'string') {
|
|
1300
1083
|
if (gridOptions.sideBar === GeneralConstants.ADAPTABLE_TOOLPANEL_ID) {
|
|
1301
1084
|
if (!isAdaptableToolPanelHidden)
|
|
@@ -1307,23 +1090,19 @@ class AdaptableAgGrid {
|
|
|
1307
1090
|
result = original_sideBar;
|
|
1308
1091
|
}
|
|
1309
1092
|
}
|
|
1310
|
-
// if it's an array, process the tool panel definitions
|
|
1311
1093
|
else if (Array.isArray(original_sideBar)) {
|
|
1312
1094
|
if (!original_sideBar.includes(GeneralConstants.ADAPTABLE_TOOLPANEL_ID) ||
|
|
1313
1095
|
isAdaptableToolPanelHidden) {
|
|
1314
1096
|
result = original_sideBar;
|
|
1315
1097
|
}
|
|
1316
|
-
// if it's an array, process the tool panel definitions
|
|
1317
1098
|
const sidebarDef = {};
|
|
1318
1099
|
sidebarDef.toolPanels = mapToolPanelDefs(original_sideBar);
|
|
1319
1100
|
result = sidebarDef;
|
|
1320
1101
|
}
|
|
1321
|
-
// if it's fully-fledged SideBarDef, process its tool panel definitions
|
|
1322
1102
|
else if (isSideBarDefObject(original_sideBar)) {
|
|
1323
1103
|
if (original_sideBar.toolPanels?.some((toolpanelDef) => typeof toolpanelDef !== 'string' &&
|
|
1324
1104
|
toolpanelDef.id === GeneralConstants.ADAPTABLE_TOOLPANEL_ID &&
|
|
1325
1105
|
!isAdaptableToolPanelHidden)) {
|
|
1326
|
-
// if there is an Adaptable SideBarDef, don't touch it as it may contain user-defined properties
|
|
1327
1106
|
result = original_sideBar;
|
|
1328
1107
|
}
|
|
1329
1108
|
else {
|
|
@@ -1341,9 +1120,6 @@ class AdaptableAgGrid {
|
|
|
1341
1120
|
});
|
|
1342
1121
|
}
|
|
1343
1122
|
if (gridOptions.statusBar != undefined) {
|
|
1344
|
-
/**
|
|
1345
|
-
* `statusBar`
|
|
1346
|
-
*/
|
|
1347
1123
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'statusBar', (original_statusBar) => {
|
|
1348
1124
|
const statusPanels = (original_statusBar?.statusPanels ?? [])?.map((statusPanel) => {
|
|
1349
1125
|
if (statusPanel.statusPanel === StatusBarState_1.ADAPTABLE_STATUS_PANEL) {
|
|
@@ -1371,9 +1147,6 @@ class AdaptableAgGrid {
|
|
|
1371
1147
|
else {
|
|
1372
1148
|
this.hasAdaptableStatusBar = false;
|
|
1373
1149
|
}
|
|
1374
|
-
/**
|
|
1375
|
-
* `getRowStyle`
|
|
1376
|
-
*/
|
|
1377
1150
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'getRowStyle', (original_getRowStyle) => {
|
|
1378
1151
|
return (params) => {
|
|
1379
1152
|
const result = {
|
|
@@ -1384,9 +1157,6 @@ class AdaptableAgGrid {
|
|
|
1384
1157
|
return result;
|
|
1385
1158
|
};
|
|
1386
1159
|
});
|
|
1387
|
-
/**
|
|
1388
|
-
* `getRowClass`
|
|
1389
|
-
*/
|
|
1390
1160
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'getRowClass', (original_getRowClass) => {
|
|
1391
1161
|
return (params) => {
|
|
1392
1162
|
const alertHighlightClassName = this.api.gridApi.internalApi.getAlertRowClass(params);
|
|
@@ -1398,37 +1168,26 @@ class AdaptableAgGrid {
|
|
|
1398
1168
|
highlightClassName,
|
|
1399
1169
|
alertHighlightClassName,
|
|
1400
1170
|
]
|
|
1401
|
-
// we flatten it because 'original_getRowClass' might return a string[]
|
|
1402
1171
|
.flat()
|
|
1403
1172
|
.filter((x) => !!x);
|
|
1404
1173
|
return returnValue?.length ? returnValue : undefined;
|
|
1405
1174
|
};
|
|
1406
1175
|
});
|
|
1407
|
-
/**
|
|
1408
|
-
* `floatingFiltersHeight`
|
|
1409
|
-
*/
|
|
1410
1176
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'floatingFiltersHeight', (original_floatingFiltersHeight) => {
|
|
1411
1177
|
if (this.api.layoutApi.isCurrentLayoutPivot()) {
|
|
1412
|
-
// if Current Layout is Pivot, hide the floating filters from the beginning, otherwise we get an annoying flicker
|
|
1413
1178
|
return 0;
|
|
1414
1179
|
}
|
|
1415
1180
|
return original_floatingFiltersHeight;
|
|
1416
1181
|
});
|
|
1417
|
-
/**
|
|
1418
|
-
* `excelStyles`
|
|
1419
|
-
*/
|
|
1420
1182
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
|
|
1421
1183
|
const excelStyles = original_excelStyles || [];
|
|
1422
|
-
// see ##masterDetailHeader
|
|
1423
1184
|
excelStyles.push({
|
|
1424
1185
|
id: '_masterDetailHeader',
|
|
1425
1186
|
interior: {
|
|
1426
1187
|
color: '#aaaaaa',
|
|
1427
1188
|
pattern: 'Solid',
|
|
1428
1189
|
},
|
|
1429
|
-
},
|
|
1430
|
-
// see #EXCEL_EXPORT_DATA_TYPES
|
|
1431
|
-
{
|
|
1190
|
+
}, {
|
|
1432
1191
|
id: 'stringExcelType',
|
|
1433
1192
|
dataType: 'String',
|
|
1434
1193
|
}, {
|
|
@@ -1439,30 +1198,17 @@ class AdaptableAgGrid {
|
|
|
1439
1198
|
dataType: 'DateTime',
|
|
1440
1199
|
}, {
|
|
1441
1200
|
id: 'numberExcelType',
|
|
1442
|
-
// dataType: 'Number',
|
|
1443
|
-
// AG Grid requires either dataType or numberFormat to be set for Numbers
|
|
1444
1201
|
numberFormat: {
|
|
1445
1202
|
format: `#,##0.00`,
|
|
1446
1203
|
},
|
|
1447
1204
|
});
|
|
1448
|
-
// store original excel styles, we will have to revert to them after each VISUAL EXPORT
|
|
1449
1205
|
this.agGridExportAdapter.originalExcelStyles = [...excelStyles];
|
|
1450
1206
|
this.agGridExportAdapter.DANGER_excelStyles = excelStyles;
|
|
1451
|
-
// this array reference will be used for the entire AG Grid session
|
|
1452
1207
|
return this.agGridExportAdapter.DANGER_excelStyles;
|
|
1453
1208
|
});
|
|
1454
|
-
/**
|
|
1455
|
-
* `maintainColumnOrder`
|
|
1456
|
-
*/
|
|
1457
1209
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'maintainColumnOrder', () => {
|
|
1458
|
-
// see https://www.ag-grid.com/javascript-data-grid/column-updating-definitions/#maintain-column-order
|
|
1459
|
-
// we want to always maintain the column order (provided by Adaptable Layouts), even when column definitions change
|
|
1460
1210
|
return true;
|
|
1461
1211
|
});
|
|
1462
|
-
/**
|
|
1463
|
-
* `columnTypes`
|
|
1464
|
-
*/
|
|
1465
|
-
// this will have to go/be heavily extended with https://github.com/AdaptableTools/adaptable/issues/2230
|
|
1466
1212
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'columnTypes', (original_columnTypes) => {
|
|
1467
1213
|
const providedColumnTypes = original_columnTypes || {};
|
|
1468
1214
|
const adaptableSpecialColumnTypes = {
|
|
@@ -1485,9 +1231,6 @@ class AdaptableAgGrid {
|
|
|
1485
1231
|
}
|
|
1486
1232
|
return patchedColumnTypes;
|
|
1487
1233
|
});
|
|
1488
|
-
/**
|
|
1489
|
-
* `dataTypeDefinitions`
|
|
1490
|
-
*/
|
|
1491
1234
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'dataTypeDefinitions', () => {
|
|
1492
1235
|
const revertedDateTypeDefinitions = agGridDataTypeDefinitions_1.agGridDataTypeDefinitions;
|
|
1493
1236
|
return revertedDateTypeDefinitions;
|
|
@@ -1498,12 +1241,7 @@ class AdaptableAgGrid {
|
|
|
1498
1241
|
caseSensitive: !!this.adaptableOptions.quickSearchOptions.isQuickSearchCaseSensitive,
|
|
1499
1242
|
};
|
|
1500
1243
|
});
|
|
1501
|
-
/**
|
|
1502
|
-
* suppressOverlays
|
|
1503
|
-
*/
|
|
1504
1244
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'suppressOverlays', (original_suppressOverlays) => {
|
|
1505
|
-
// we want to suppress the exporting overlay because having it enabled will turn api.exportDataAsExcel() and api.exportDataAsCsv() into async operations,
|
|
1506
|
-
// see #export_data_synchronously
|
|
1507
1245
|
let suppressOverlays = original_suppressOverlays || [];
|
|
1508
1246
|
if (!suppressOverlays.includes('exporting')) {
|
|
1509
1247
|
suppressOverlays.push('exporting');
|
|
@@ -1511,9 +1249,6 @@ class AdaptableAgGrid {
|
|
|
1511
1249
|
return suppressOverlays;
|
|
1512
1250
|
});
|
|
1513
1251
|
}
|
|
1514
|
-
/**
|
|
1515
|
-
* Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
|
|
1516
|
-
*/
|
|
1517
1252
|
async initializeAgGrid(gridOptions, modules, renderAgGridFrameworkComponent) {
|
|
1518
1253
|
if (renderAgGridFrameworkComponent) {
|
|
1519
1254
|
let result = false;
|
|
@@ -1527,8 +1262,6 @@ class AdaptableAgGrid {
|
|
|
1527
1262
|
return false;
|
|
1528
1263
|
}
|
|
1529
1264
|
const agGridApi = result;
|
|
1530
|
-
// framework wrapper may have altered the context value via props
|
|
1531
|
-
// in that case, we have to re-populate it with the Adaptable context values
|
|
1532
1265
|
const agGridContext = agGridApi.getGridOption('context');
|
|
1533
1266
|
if (!agGridContext) {
|
|
1534
1267
|
return false;
|
|
@@ -1537,14 +1270,12 @@ class AdaptableAgGrid {
|
|
|
1537
1270
|
agGridContext.__adaptable = this;
|
|
1538
1271
|
agGridContext.adaptableApi = this.api;
|
|
1539
1272
|
}
|
|
1540
|
-
// framework wrapper may pass the rowData as a prop
|
|
1541
1273
|
const rowData = agGridApi.getGridOption('rowData');
|
|
1542
1274
|
this.initWithLazyData = rowData == undefined || rowData.length === 0;
|
|
1543
1275
|
if (this.initWithLazyData) {
|
|
1544
1276
|
this.logger.info('Initializing with lazy data (no initial rowData).');
|
|
1545
1277
|
}
|
|
1546
1278
|
if (!this.getAgGridContainerElement()) {
|
|
1547
|
-
// initialize the agGridContainerElement from the AgGrid instance
|
|
1548
1279
|
const gridRoot = this.agGridAdapter.getAgGridRootElement();
|
|
1549
1280
|
const gridContainer = gridRoot?.closest('[class*="ag-theme"]');
|
|
1550
1281
|
if (!gridContainer) {
|
|
@@ -1588,8 +1319,6 @@ class AdaptableAgGrid {
|
|
|
1588
1319
|
}
|
|
1589
1320
|
return this.DANGER_USE_GETTER_adaptableContainerElement;
|
|
1590
1321
|
}
|
|
1591
|
-
// This method returns selected cells ONLY (if selection mode is cells or multiple cells).
|
|
1592
|
-
// If the selection mode is row it will returns nothing - use the setSelectedRows() method
|
|
1593
1322
|
refreshSelectedCellsState() {
|
|
1594
1323
|
if (!this.isGridRangeSelectable()) {
|
|
1595
1324
|
return;
|
|
@@ -1675,36 +1404,18 @@ class AdaptableAgGrid {
|
|
|
1675
1404
|
};
|
|
1676
1405
|
}
|
|
1677
1406
|
addGridEventListeners() {
|
|
1678
|
-
/**
|
|
1679
|
-
* Intercept 3 DOM events and emit them as Adaptable events:
|
|
1680
|
-
* KeyDown
|
|
1681
|
-
* MouseEnter
|
|
1682
|
-
* MouseLeave
|
|
1683
|
-
*/
|
|
1684
1407
|
const gridContainerElement = this.getAgGridContainerElement();
|
|
1685
1408
|
if (gridContainerElement) {
|
|
1686
|
-
gridContainerElement.addEventListener('keydown', (this.agGridListenerKeydown = (event) => this._emit('KeyDown', event)),
|
|
1687
|
-
// This is needed to be able to prevent the editor to be opened
|
|
1688
|
-
// in bubling phase the opening is not prevented with ag-grid v30
|
|
1689
|
-
true);
|
|
1409
|
+
gridContainerElement.addEventListener('keydown', (this.agGridListenerKeydown = (event) => this._emit('KeyDown', event)), true);
|
|
1690
1410
|
gridContainerElement.addEventListener('mouseenter', (this.agGridListenerMouseEnter = (event) => {
|
|
1691
1411
|
this._emit('MouseEnter', event);
|
|
1692
1412
|
}), true);
|
|
1693
1413
|
gridContainerElement.addEventListener('mouseleave', (this.agGridListenerMouseLeave = (event) => this._emit('MouseLeave', event)));
|
|
1694
1414
|
}
|
|
1695
|
-
/**
|
|
1696
|
-
* Use Case: User has started inline editing but its disabled in Row Form Options
|
|
1697
|
-
* Action: Stop editing
|
|
1698
|
-
*/
|
|
1699
1415
|
this.agGridAdapter.getAgGridApi().addEventListener('cellEditingStarted', (this.listenerCellEditingStarted = () => {
|
|
1700
1416
|
if (this.adaptableOptions.rowFormOptions.disableInlineEditing)
|
|
1701
1417
|
this.agGridAdapter.getAgGridApi().stopEditing();
|
|
1702
1418
|
}));
|
|
1703
|
-
/**
|
|
1704
|
-
* Use Case: Grid was already set up and now the initial data has been displayed
|
|
1705
|
-
* Action1: Update the Column Model
|
|
1706
|
-
* Action2: Refresh Calculated Columns
|
|
1707
|
-
*/
|
|
1708
1419
|
this.agGridAdapter.getAgGridApi().addEventListener('firstDataRendered', (this.listenerFirstDataRendered = () => {
|
|
1709
1420
|
if (this.initWithLazyData) {
|
|
1710
1421
|
this.updateColumnModelAndRefreshGrid();
|
|
@@ -1713,10 +1424,6 @@ class AdaptableAgGrid {
|
|
|
1713
1424
|
}
|
|
1714
1425
|
this.autoSizeLayoutIfNeeded();
|
|
1715
1426
|
}));
|
|
1716
|
-
/**
|
|
1717
|
-
* Use Case: A format column that has ColumnGroupScope needs to be re-evaluated
|
|
1718
|
-
* whenever a column group is expanded or collapsed
|
|
1719
|
-
*/
|
|
1720
1427
|
this.agGridAdapter.getAgGridApi().addEventListener('columnGroupOpened', (this.listenerColumnGroupOpened = () => {
|
|
1721
1428
|
if (this.api.formatColumnApi.getActiveFormatColumns().some((fc) => {
|
|
1722
1429
|
return fc.ColumnGroupScope != null;
|
|
@@ -1724,10 +1431,6 @@ class AdaptableAgGrid {
|
|
|
1724
1431
|
this.updateColumnModelAndRefreshGrid();
|
|
1725
1432
|
}
|
|
1726
1433
|
}));
|
|
1727
|
-
/**
|
|
1728
|
-
* Use Case: A pivot column has changed
|
|
1729
|
-
* Action: Autosize pivot columns (if autosize pivot in Layout is true)
|
|
1730
|
-
*/
|
|
1731
1434
|
this.agGridAdapter.getAgGridApi().addEventListener('columnPivotChanged', (this.listenerPivotChanged = (params) => {
|
|
1732
1435
|
if (params.type == 'columnPivotChanged' &&
|
|
1733
1436
|
params.columnApi != null &&
|
|
@@ -1738,10 +1441,6 @@ class AdaptableAgGrid {
|
|
|
1738
1441
|
}
|
|
1739
1442
|
}
|
|
1740
1443
|
}));
|
|
1741
|
-
/**
|
|
1742
|
-
* Use Case: User has selected Rows or opened a Row Group
|
|
1743
|
-
* Action: Set Selected Rows (on a debounce of 500ms)
|
|
1744
|
-
*/
|
|
1745
1444
|
this.debouncedSetSelectedRows = (0, TimingHelper_1.debounce)(() => {
|
|
1746
1445
|
if (!this.isReady) {
|
|
1747
1446
|
return;
|
|
@@ -1758,10 +1457,6 @@ class AdaptableAgGrid {
|
|
|
1758
1457
|
this.debouncedSetSelectedRows();
|
|
1759
1458
|
}
|
|
1760
1459
|
}));
|
|
1761
|
-
/**
|
|
1762
|
-
* Use Case: User has selected a range of cells
|
|
1763
|
-
* Action: Set Selected Cells (on a debounce of 250ms)
|
|
1764
|
-
*/
|
|
1765
1460
|
this.debouncedSetSelectedCells = (0, TimingHelper_1.debounce)(() => {
|
|
1766
1461
|
if (!this.isReady) {
|
|
1767
1462
|
return;
|
|
@@ -1773,19 +1468,10 @@ class AdaptableAgGrid {
|
|
|
1773
1468
|
this.debouncedSetSelectedCells();
|
|
1774
1469
|
}
|
|
1775
1470
|
}));
|
|
1776
|
-
/**
|
|
1777
|
-
* Use Case: Sort has changed in the Grid
|
|
1778
|
-
* Action1: Fire the Grid Sorted Event
|
|
1779
|
-
* Action2: Set Selected Cells (on a debounce)
|
|
1780
|
-
*/
|
|
1781
1471
|
this.agGridAdapter.getAgGridApi().addEventListener('sortChanged', (this.listenerSortChanged = () => {
|
|
1782
1472
|
this.debouncedSetSelectedCells();
|
|
1783
1473
|
this.api.eventApi.internalApi.fireGridSortedEvent();
|
|
1784
1474
|
}));
|
|
1785
|
-
/**
|
|
1786
|
-
* Use Case: Charts have been created or destroyed, Chart ranges selected or Chart options changed
|
|
1787
|
-
* Action: Call onChartModelChange in Charting Service
|
|
1788
|
-
*/
|
|
1789
1475
|
const eventsThatTriggerChartingChanges = [
|
|
1790
1476
|
'chartCreated',
|
|
1791
1477
|
'chartRangeSelectionChanged',
|
|
@@ -1793,17 +1479,13 @@ class AdaptableAgGrid {
|
|
|
1793
1479
|
'chartDestroyed',
|
|
1794
1480
|
];
|
|
1795
1481
|
if (this.ModuleService.isAdapTableModulePresent('Charting')) {
|
|
1796
|
-
// We need to break the loop of charting changes for 'chartOptionsChanged', which is triggered by the subsequent agGridApi.updateChart(...)
|
|
1797
|
-
// see #ag_grid_update_chart_loop
|
|
1798
1482
|
let lastChartOptionsChangePayload = '';
|
|
1799
1483
|
this.listenerGlobalChartingChanges = (type, params) => {
|
|
1800
1484
|
if (eventsThatTriggerChartingChanges.includes(type)) {
|
|
1801
1485
|
if (type === 'chartOptionsChanged') {
|
|
1802
|
-
// Exclude api and context
|
|
1803
1486
|
const { api, context, ...sanitizedParams } = params || {};
|
|
1804
1487
|
const eventPayload = JSON.stringify(sanitizedParams);
|
|
1805
1488
|
if (eventPayload === lastChartOptionsChangePayload) {
|
|
1806
|
-
// this is a loop, so we ignore it
|
|
1807
1489
|
return;
|
|
1808
1490
|
}
|
|
1809
1491
|
lastChartOptionsChangePayload = eventPayload;
|
|
@@ -1813,10 +1495,6 @@ class AdaptableAgGrid {
|
|
|
1813
1495
|
};
|
|
1814
1496
|
this.agGridAdapter.getAgGridApi().addGlobalListener(this.listenerGlobalChartingChanges);
|
|
1815
1497
|
}
|
|
1816
|
-
/**
|
|
1817
|
-
* Row and Cell listeners created in 2020
|
|
1818
|
-
* These have supplanted many of the events we previously had and simplified things
|
|
1819
|
-
*/
|
|
1820
1498
|
this.rowListeners = {
|
|
1821
1499
|
dataChanged: (event) => {
|
|
1822
1500
|
this.onRowDataChanged({
|
|
@@ -1880,7 +1558,6 @@ class AdaptableAgGrid {
|
|
|
1880
1558
|
return thePlugin;
|
|
1881
1559
|
}
|
|
1882
1560
|
initServices() {
|
|
1883
|
-
// create the services
|
|
1884
1561
|
this.LicenseService = this.initLicenseService();
|
|
1885
1562
|
this.ChartingService = new ChartingService_1.ChartingService(this.api);
|
|
1886
1563
|
this.ThemeService = new ThemeService_1.ThemeService(this.api);
|
|
@@ -1894,7 +1571,6 @@ class AdaptableAgGrid {
|
|
|
1894
1571
|
this.AnnotationsService = new AnnotationsService_1.AnnotationsService(this.api);
|
|
1895
1572
|
this.FlashingCellService = new FlashingCellService_1.FlashingCellService(this.api);
|
|
1896
1573
|
this.RowFormService = new RowFormService_1.RowFormService(this.api);
|
|
1897
|
-
this.MetamodelService = new MetamodelService_1.MetamodelService(() => this.api.optionsApi.getAdaptableOptions(), true);
|
|
1898
1574
|
}
|
|
1899
1575
|
initLicenseService() {
|
|
1900
1576
|
const globalObject = typeof globalThis !== 'undefined' ? globalThis : window;
|
|
@@ -1942,20 +1618,13 @@ class AdaptableAgGrid {
|
|
|
1942
1618
|
modules.set(ModuleConstants.ToolPanelModuleId, new ToolPanelModule_1.ToolPanelModule(this.api));
|
|
1943
1619
|
return modules;
|
|
1944
1620
|
}
|
|
1945
|
-
/**
|
|
1946
|
-
* This method contains all the updates on the AdaptableState which were made AFTER Adaptbale was ready
|
|
1947
|
-
* This was contidioned because we required AG Grid to be ready before we could make these updates
|
|
1948
|
-
* We should be able to refactor the code, no that we no fore sure that Adaptable State is ready BEFORE AG Grid init
|
|
1949
|
-
*/
|
|
1950
1621
|
temporaryAdaptableStateUpdates() {
|
|
1951
1622
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
1952
|
-
// update status bar state
|
|
1953
1623
|
const adaptableStatusPanels = this.agGridAdapter
|
|
1954
1624
|
.getAgGridApi()
|
|
1955
1625
|
.getGridOption('statusBar')
|
|
1956
1626
|
?.statusPanels?.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key)) ?? [];
|
|
1957
1627
|
const statusBarModule = this.ModuleService.getModuleById(ModuleConstants.StatusBarModuleId);
|
|
1958
|
-
// need to add only the adaptable panels
|
|
1959
1628
|
statusBarModule.syncStateWithOptions(adaptableStatusPanels);
|
|
1960
1629
|
});
|
|
1961
1630
|
}
|
|
@@ -1964,16 +1633,13 @@ class AdaptableAgGrid {
|
|
|
1964
1633
|
return;
|
|
1965
1634
|
}
|
|
1966
1635
|
const primaryKey = this.adaptableOptions.primaryKey;
|
|
1967
|
-
// first check if there is a primary key column
|
|
1968
1636
|
const primaryKeyColDef = this.agGridAdapter.getAgGridApi().getColumnDef(primaryKey);
|
|
1969
1637
|
if (!primaryKeyColDef) {
|
|
1970
1638
|
let errorMessage;
|
|
1971
|
-
// if no primary key column then lets check the first row to see if its a data item
|
|
1972
1639
|
const primaryKeyDataItem = this.getFirstRowNode()?.data[primaryKey];
|
|
1973
1640
|
if (!primaryKeyDataItem) {
|
|
1974
1641
|
errorMessage = `Primary key column "${this.adaptableOptions.primaryKey}" not found. This will affect many Adaptable features.`;
|
|
1975
1642
|
if (this.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert) {
|
|
1976
|
-
// show an alert if that is the option
|
|
1977
1643
|
this.api.alertApi.showAlertError('No Primary Key', errorMessage);
|
|
1978
1644
|
}
|
|
1979
1645
|
else {
|
|
@@ -2026,12 +1692,10 @@ class AdaptableAgGrid {
|
|
|
2026
1692
|
this.api.gridApi.internalApi.setColumns(allColumns);
|
|
2027
1693
|
}
|
|
2028
1694
|
checkShouldClearExistingFiltersOrSearches() {
|
|
2029
|
-
// if they have selected to clear Filters on startup then do it
|
|
2030
1695
|
if (this.adaptableOptions.filterOptions.clearFiltersOnStartUp) {
|
|
2031
1696
|
this.logger.warn('Clearing saved filters (clearFiltersOnStartUp is enabled).');
|
|
2032
1697
|
this.api.filterApi.clearAllFilters();
|
|
2033
1698
|
}
|
|
2034
|
-
// if they have selected to clear searches on startup then do it
|
|
2035
1699
|
if (this.adaptableOptions.quickSearchOptions.clearQuickSearchOnStartUp) {
|
|
2036
1700
|
this.logger.warn('Clearing saved Quick Search (clearQuickSearchOnStartUp is enabled).');
|
|
2037
1701
|
this.api.quickSearchApi.clearQuickSearch();
|
|
@@ -2054,9 +1718,6 @@ class AdaptableAgGrid {
|
|
|
2054
1718
|
const foundNode = parentRowNode.childrenAfterFilter?.find((c) => c.id == rowNode.id);
|
|
2055
1719
|
return foundNode != null;
|
|
2056
1720
|
}
|
|
2057
|
-
/**
|
|
2058
|
-
* Use (lazy evaluated) getters to avoid unnecessary calculations and memoization to avoid recalculating the same values
|
|
2059
|
-
*/
|
|
2060
1721
|
createGridCell(rowNode, columnId, defaults) {
|
|
2061
1722
|
let _column;
|
|
2062
1723
|
let _primaryKeyValue;
|
|
@@ -2079,12 +1740,9 @@ class AdaptableAgGrid {
|
|
|
2079
1740
|
if (_rawValue === undefined) {
|
|
2080
1741
|
_rawValue = self.getRawValueFromRowNode(rowNode, columnId);
|
|
2081
1742
|
if (_rawValue?.value != undefined && getIsPivotCell()) {
|
|
2082
|
-
// for pivot result columns, the raw value is an object with a value property
|
|
2083
|
-
// we want to return the value property as the raw value
|
|
2084
1743
|
_rawValue = _rawValue.value;
|
|
2085
1744
|
}
|
|
2086
1745
|
if (_rawValue?.value != undefined && typeof _rawValue.toString === 'function') {
|
|
2087
|
-
// handle columns with custom valueGetters
|
|
2088
1746
|
_rawValue = _rawValue.value;
|
|
2089
1747
|
}
|
|
2090
1748
|
}
|
|
@@ -2143,17 +1801,12 @@ class AdaptableAgGrid {
|
|
|
2143
1801
|
const agGridApi = gridApi || this.agGridAdapter.getAgGridApi();
|
|
2144
1802
|
let result;
|
|
2145
1803
|
if (!this.hasAutogeneratedPrimaryKey) {
|
|
2146
|
-
// support both AG Grid pre & post v31.3.x
|
|
2147
|
-
// TODO remove this with the next major Adaptable version
|
|
2148
1804
|
result = this.agGridAdapter._agGridApi_getValue(this.adaptableOptions.primaryKey, rowNode, agGridApi);
|
|
2149
1805
|
}
|
|
2150
1806
|
if (result == undefined && rowNode.data) {
|
|
2151
1807
|
result = rowNode.data[this.adaptableOptions.primaryKey];
|
|
2152
1808
|
}
|
|
2153
1809
|
if (result == undefined && rowNode.id != undefined) {
|
|
2154
|
-
// when getPrimaryKeyValueFromRowNode is called for group rows,
|
|
2155
|
-
// which don't have a rowNode.data object, the result is undefined
|
|
2156
|
-
// but we do have an id property on the rowNode object, so we'll use that
|
|
2157
1810
|
result = rowNode.id;
|
|
2158
1811
|
}
|
|
2159
1812
|
return result;
|
|
@@ -2206,7 +1859,6 @@ class AdaptableAgGrid {
|
|
|
2206
1859
|
if (!column) {
|
|
2207
1860
|
return rawValue;
|
|
2208
1861
|
}
|
|
2209
|
-
// prevents from null
|
|
2210
1862
|
if (rawValue === undefined || rawValue === null) {
|
|
2211
1863
|
return rawValue;
|
|
2212
1864
|
}
|
|
@@ -2218,11 +1870,9 @@ class AdaptableAgGrid {
|
|
|
2218
1870
|
if (typeof rawValue === 'number') {
|
|
2219
1871
|
return rawValue;
|
|
2220
1872
|
}
|
|
2221
|
-
// empty string or space should not be converted to 0
|
|
2222
1873
|
if (typeof rawValue === 'string') {
|
|
2223
1874
|
return StringExtensions_1.default.IsNumeric(rawValue) ? Number(rawValue) : rawValue;
|
|
2224
1875
|
}
|
|
2225
|
-
// handle objects with toString() (e.g. from valueGetters)
|
|
2226
1876
|
const numValue = Number(rawValue);
|
|
2227
1877
|
return isNaN(numValue) ? rawValue : numValue;
|
|
2228
1878
|
}
|
|
@@ -2265,9 +1915,6 @@ class AdaptableAgGrid {
|
|
|
2265
1915
|
refreshHeader() {
|
|
2266
1916
|
this.agGridAdapter.getAgGridApi().refreshHeader();
|
|
2267
1917
|
}
|
|
2268
|
-
// TODO AFL: this method seems to be used A LOT
|
|
2269
|
-
// we should check if we couldn't use the `refresh` method instead for some cases
|
|
2270
|
-
// see https://www.ag-grid.com/react-data-grid/view-refresh/#redraw-rows
|
|
2271
1918
|
redrawRows(rowNodes) {
|
|
2272
1919
|
const redrawRowsParams = rowNodes
|
|
2273
1920
|
? {
|
|
@@ -2354,7 +2001,6 @@ class AdaptableAgGrid {
|
|
|
2354
2001
|
this.agGridAdapter.getAgGridApi().selectAll();
|
|
2355
2002
|
}
|
|
2356
2003
|
deselectAll() {
|
|
2357
|
-
// need to do both as first just clears selected rows and second clears ranges
|
|
2358
2004
|
this.agGridAdapter.getAgGridApi().deselectAll();
|
|
2359
2005
|
this.agGridAdapter.getAgGridApi().clearCellSelection();
|
|
2360
2006
|
}
|
|
@@ -2367,7 +2013,6 @@ class AdaptableAgGrid {
|
|
|
2367
2013
|
}
|
|
2368
2014
|
this.agGridAdapter.setGridOption('rowData', dataSource);
|
|
2369
2015
|
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
2370
|
-
// this.updateColumnModelAndRefreshGrid();
|
|
2371
2016
|
}
|
|
2372
2017
|
getGridData() {
|
|
2373
2018
|
const data = [];
|
|
@@ -2383,7 +2028,6 @@ class AdaptableAgGrid {
|
|
|
2383
2028
|
rowData[i][GeneralConstants_1.AUTOGENERATED_PK_COLUMN] = (0, uuid_1.createUuid)();
|
|
2384
2029
|
}
|
|
2385
2030
|
}
|
|
2386
|
-
// add a synthetic PK only if missing (useful in case of updating row data)
|
|
2387
2031
|
addSyntheticPrimaryKeyIfMissing(rowData = []) {
|
|
2388
2032
|
this.adaptableOptions.primaryKey = GeneralConstants_1.AUTOGENERATED_PK_COLUMN;
|
|
2389
2033
|
for (let i = 0; i < rowData.length; i++) {
|
|
@@ -2401,8 +2045,6 @@ class AdaptableAgGrid {
|
|
|
2401
2045
|
getFirstRowNode() {
|
|
2402
2046
|
let firstRowNode = this.getFirstDisplayedRowNode();
|
|
2403
2047
|
if (firstRowNode?.group) {
|
|
2404
|
-
// all groups may be closed so it is safer to get first leaf node
|
|
2405
|
-
// all groups should have at least one leafe node (though not necessarily if using SSRM)
|
|
2406
2048
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(firstRowNode.allLeafChildren)) {
|
|
2407
2049
|
firstRowNode = firstRowNode.allLeafChildren[0];
|
|
2408
2050
|
}
|
|
@@ -2441,10 +2083,6 @@ class AdaptableAgGrid {
|
|
|
2441
2083
|
});
|
|
2442
2084
|
return data;
|
|
2443
2085
|
}
|
|
2444
|
-
/**
|
|
2445
|
-
* This method internally differentiates between server-side and client-side row model
|
|
2446
|
-
* and correctly calls the appropriate method as per the current row model type
|
|
2447
|
-
*/
|
|
2448
2086
|
applyAgGridTransaction(transaction) {
|
|
2449
2087
|
const isServerSideRowModel = this.getAgGridRowModelType() === 'serverSide';
|
|
2450
2088
|
const agGridApi = this.agGridAdapter.getAgGridApi();
|
|
@@ -2452,10 +2090,6 @@ class AdaptableAgGrid {
|
|
|
2452
2090
|
? agGridApi.applyServerSideTransaction(transaction)
|
|
2453
2091
|
: agGridApi.applyTransaction(transaction);
|
|
2454
2092
|
}
|
|
2455
|
-
/**
|
|
2456
|
-
* This method internally differentiates between server-side and client-side row model
|
|
2457
|
-
* and correctly calls the appropriate method as per the current row model type
|
|
2458
|
-
*/
|
|
2459
2093
|
applyAgGridTransactionAsync(transaction, callback) {
|
|
2460
2094
|
const isServerSideRowModel = this.getAgGridRowModelType() === 'serverSide';
|
|
2461
2095
|
const agGridApi = this.agGridAdapter.getAgGridApi();
|
|
@@ -2717,12 +2351,8 @@ class AdaptableAgGrid {
|
|
|
2717
2351
|
async getDistinctFilterValuesForColumn(options) {
|
|
2718
2352
|
const { column, previousResult } = options;
|
|
2719
2353
|
const self = this;
|
|
2720
|
-
// First get the Grid Cells in the Column
|
|
2721
2354
|
let currentGridCells;
|
|
2722
2355
|
const getCurrentGridCells = () => {
|
|
2723
|
-
// we do this in a function so it's lazy
|
|
2724
|
-
// but we also store in the outside closure, so we can reuse the value if
|
|
2725
|
-
// already called
|
|
2726
2356
|
if (currentGridCells) {
|
|
2727
2357
|
return currentGridCells;
|
|
2728
2358
|
}
|
|
@@ -2733,7 +2363,6 @@ class AdaptableAgGrid {
|
|
|
2733
2363
|
? this.getDistinctGridCellsForDateColumn(column)
|
|
2734
2364
|
: this.getDistinctGridCellsForColumn(column));
|
|
2735
2365
|
};
|
|
2736
|
-
// No distinct values so lets return unique grid cells
|
|
2737
2366
|
const mapFn = (gridCell, level) => {
|
|
2738
2367
|
if (level || Array.isArray(gridCell.children)) {
|
|
2739
2368
|
const cell = gridCell;
|
|
@@ -2762,7 +2391,6 @@ class AdaptableAgGrid {
|
|
|
2762
2391
|
label: gridCell.displayValue,
|
|
2763
2392
|
};
|
|
2764
2393
|
};
|
|
2765
|
-
// If there are custom distinct value, return them; otherwise return the Grids Cells just retrieved
|
|
2766
2394
|
const customInFilterValues = this.adaptableOptions.filterOptions.customInFilterValues;
|
|
2767
2395
|
if (customInFilterValues) {
|
|
2768
2396
|
const gridApiInternal = this.api.gridApi.internalApi;
|
|
@@ -2876,9 +2504,7 @@ class AdaptableAgGrid {
|
|
|
2876
2504
|
}
|
|
2877
2505
|
async getDistinctEditValuesForColumn(options) {
|
|
2878
2506
|
const { column, gridCell } = options;
|
|
2879
|
-
// First get the Grid Cells in the Column
|
|
2880
2507
|
const currentGridCells = this.getDistinctGridCellsForColumn(column);
|
|
2881
|
-
// If there are custom distinct value, return them, but only if a module has been specifically set
|
|
2882
2508
|
const customEditColumnValues = this.adaptableOptions.editOptions.customEditColumnValues;
|
|
2883
2509
|
if (customEditColumnValues) {
|
|
2884
2510
|
const customEditValuesContext = {
|
|
@@ -2912,7 +2538,6 @@ class AdaptableAgGrid {
|
|
|
2912
2538
|
return customDistinctValues ?? [];
|
|
2913
2539
|
}
|
|
2914
2540
|
}
|
|
2915
|
-
// No distinct values so lets return unique grid cells
|
|
2916
2541
|
return currentGridCells.map((gridCell) => {
|
|
2917
2542
|
const result = {
|
|
2918
2543
|
value: gridCell.rawValue,
|
|
@@ -2924,8 +2549,6 @@ class AdaptableAgGrid {
|
|
|
2924
2549
|
getDistinctGridCellsForGroupedColumn(rowNodes) {
|
|
2925
2550
|
const groupedColumns = this.api.columnApi.getRowGroupedColumns();
|
|
2926
2551
|
const treeMode = this.api.gridApi.isTreeDataGrid();
|
|
2927
|
-
// if we're not in tree mode, return if there are no grouped columns
|
|
2928
|
-
// but in tree mode, we have to continue, even if there are no grouped columns
|
|
2929
2552
|
if (!groupedColumns.length && !treeMode) {
|
|
2930
2553
|
return [];
|
|
2931
2554
|
}
|
|
@@ -2945,15 +2568,11 @@ class AdaptableAgGrid {
|
|
|
2945
2568
|
currentParentGridCells.length = level;
|
|
2946
2569
|
}
|
|
2947
2570
|
prevLevel = level;
|
|
2948
|
-
// for non-tree mode
|
|
2949
|
-
// or for tree mode, if the rowNode has data - so it's not a filler group
|
|
2950
2571
|
if (!treeMode || (treeMode && rowNode.data)) {
|
|
2951
2572
|
currentGroupKey.push(key);
|
|
2952
2573
|
}
|
|
2953
2574
|
const parentGridCell = currentParentGridCells[currentParentGridCells.length - 1];
|
|
2954
2575
|
const gridCell = this.addDistinctColumnValue(rowNode, GeneralConstants_1.AG_GRID_GROUPED_COLUMN, false);
|
|
2955
|
-
// for tree-mode filler nodes, we might end up without a gridCell
|
|
2956
|
-
// so we need to make sure it's defined
|
|
2957
2576
|
if (gridCell) {
|
|
2958
2577
|
gridCell.leafChildrenCount = rowNode.allLeafChildren?.length ?? 0;
|
|
2959
2578
|
currentParentGridCells.push(gridCell);
|
|
@@ -2988,7 +2607,6 @@ class AdaptableAgGrid {
|
|
|
2988
2607
|
const initialCell = this.addDistinctColumnValue(rowNode, column.columnId, isPivotResultColumn);
|
|
2989
2608
|
if (initialCell) {
|
|
2990
2609
|
const value = initialCell.rawValue;
|
|
2991
|
-
// we want to filter out empty values
|
|
2992
2610
|
if (value === '' || value === null || value === undefined) {
|
|
2993
2611
|
return;
|
|
2994
2612
|
}
|
|
@@ -3028,7 +2646,6 @@ class AdaptableAgGrid {
|
|
|
3028
2646
|
treeDeepMap.set([year, month, day], dayCells);
|
|
3029
2647
|
if (includeTime) {
|
|
3030
2648
|
const timeCells = treeDeepMap.get([year, month, day, dateInstance.getTime()]) || [];
|
|
3031
|
-
// if the value is a string, let's use it as the final raw value
|
|
3032
2649
|
const timeRawValue = typeof value === 'string' ? value : `${dateInstance.toISOString()}`;
|
|
3033
2650
|
let timeDisplayValue = typeof value === 'string'
|
|
3034
2651
|
? value
|
|
@@ -3061,7 +2678,6 @@ class AdaptableAgGrid {
|
|
|
3061
2678
|
for (const keys of years) {
|
|
3062
2679
|
const [year] = keys;
|
|
3063
2680
|
const yearCells = treeDeepMap.get([year]) || [];
|
|
3064
|
-
// should only be one item in the uniqueYearCells array
|
|
3065
2681
|
const uniqueYearCell = this.getUniqueGridCells(column, yearCells)[0];
|
|
3066
2682
|
if (!uniqueYearCell) {
|
|
3067
2683
|
continue;
|
|
@@ -3081,7 +2697,6 @@ class AdaptableAgGrid {
|
|
|
3081
2697
|
}
|
|
3082
2698
|
uniqueMonthCell.children = [];
|
|
3083
2699
|
uniqueYearCell.children.push(uniqueMonthCell);
|
|
3084
|
-
// those are all the days for which there are values in this year/month
|
|
3085
2700
|
const keysForMonth = treeDeepMap.getKeysStartingWith([year, month], {
|
|
3086
2701
|
depthLimit: 1,
|
|
3087
2702
|
excludeSelf: true,
|
|
@@ -3140,12 +2755,7 @@ class AdaptableAgGrid {
|
|
|
3140
2755
|
const gridCell = this.addDistinctColumnValue(rowNode, column.columnId, isPivotResultColumn);
|
|
3141
2756
|
if (gridCell) {
|
|
3142
2757
|
const value = gridCell.rawValue;
|
|
3143
|
-
// we want to filter out empty values
|
|
3144
2758
|
if (value === '' || value === null || value === undefined) {
|
|
3145
|
-
// 2025-10-31: we want to allow empty values to be included
|
|
3146
|
-
// after all - they are not displayed by default
|
|
3147
|
-
// but will be accessible in the customInFilterValues callback
|
|
3148
|
-
// return;
|
|
3149
2759
|
}
|
|
3150
2760
|
gridCells.push(gridCell);
|
|
3151
2761
|
}
|
|
@@ -3165,17 +2775,11 @@ class AdaptableAgGrid {
|
|
|
3165
2775
|
if (!isPivotResultColumn && this.isGroupRowNode(rowNode)) {
|
|
3166
2776
|
if (this.api.gridApi.isTreeDataGrid()) {
|
|
3167
2777
|
if (rowNode.data == undefined) {
|
|
3168
|
-
// skip Tree Filler Groups
|
|
3169
|
-
// see https://www.ag-grid.com/javascript-data-grid/tree-data-paths/#filler-groups
|
|
3170
2778
|
return;
|
|
3171
2779
|
}
|
|
3172
|
-
// if (columnId !== AG_GRID_GROUPED_COLUMN) {
|
|
3173
|
-
// return;
|
|
3174
|
-
// }
|
|
3175
2780
|
return this.getGridCellFromRowNode(rowNode, columnId);
|
|
3176
2781
|
}
|
|
3177
2782
|
else {
|
|
3178
|
-
// for normal Table Columns we do NOT return the values of the aggregates
|
|
3179
2783
|
if (columnId !== GeneralConstants_1.AG_GRID_GROUPED_COLUMN) {
|
|
3180
2784
|
return;
|
|
3181
2785
|
}
|
|
@@ -3183,12 +2787,10 @@ class AdaptableAgGrid {
|
|
|
3183
2787
|
}
|
|
3184
2788
|
}
|
|
3185
2789
|
if (isPivotResultColumn) {
|
|
3186
|
-
// if it's a Pivot Result Column, we are interested only in the aggregated(pivoted) data
|
|
3187
2790
|
if (!rowNode.aggData) {
|
|
3188
2791
|
return;
|
|
3189
2792
|
}
|
|
3190
2793
|
if (!rowNode.leafGroup) {
|
|
3191
|
-
// if it's a Pivot Result Column, we are interested only in the leaf groups (pivot results, NOT group aggregates)
|
|
3192
2794
|
return;
|
|
3193
2795
|
}
|
|
3194
2796
|
}
|
|
@@ -3210,17 +2812,12 @@ class AdaptableAgGrid {
|
|
|
3210
2812
|
return value;
|
|
3211
2813
|
};
|
|
3212
2814
|
const self = this;
|
|
3213
|
-
// handle the special case where GridCells have arrays as values
|
|
3214
|
-
// in this case we want to treat each value in the array as a separate value
|
|
3215
2815
|
if (this.api.columnApi.internalApi.hasArrayDataType(column)) {
|
|
3216
2816
|
gridCellsToUse = gridCellsToUse.flatMap((gridCell) => {
|
|
3217
2817
|
const rawValueArray = gridCell.rawValue;
|
|
3218
2818
|
if (Array.isArray(rawValueArray)) {
|
|
3219
2819
|
return rawValueArray.map((rawValue) => ({
|
|
3220
2820
|
...gridCell,
|
|
3221
|
-
// for now just map the rawValue
|
|
3222
|
-
// extracting displayValue and normalisedValue is possible
|
|
3223
|
-
// but it could have a significant performance impact
|
|
3224
2821
|
rawValue: rawValue,
|
|
3225
2822
|
displayValue: rawValue,
|
|
3226
2823
|
normalisedValue: rawValue,
|
|
@@ -3229,12 +2826,6 @@ class AdaptableAgGrid {
|
|
|
3229
2826
|
return [gridCell];
|
|
3230
2827
|
});
|
|
3231
2828
|
}
|
|
3232
|
-
// those are grid cells unique per primary key - so cells corresponding to this column
|
|
3233
|
-
// by for every row in the grid
|
|
3234
|
-
// but here we want to collapse them down to values/cells unique by the
|
|
3235
|
-
// value of this column: eg - if this is country column and we have multiple rownodes
|
|
3236
|
-
// in the grid with country: UK, and multiple with country: France, then the end result
|
|
3237
|
-
// of the current function should be 2 cells: one for UK and one for France
|
|
3238
2829
|
gridCellsToUse.forEach((dataItem) => {
|
|
3239
2830
|
const value = getter(dataItem);
|
|
3240
2831
|
if (!cache.has(value)) {
|
|
@@ -3254,7 +2845,6 @@ class AdaptableAgGrid {
|
|
|
3254
2845
|
cache.forEach(({ count, cell, rowNodesWithSameCellValue }) => {
|
|
3255
2846
|
const cellWithCount = cell;
|
|
3256
2847
|
cellWithCount.count = count;
|
|
3257
|
-
// the visibility of this cell is true if any of the row nodes with this value is visible
|
|
3258
2848
|
Object.defineProperty(cellWithCount, 'visible', {
|
|
3259
2849
|
get: () => {
|
|
3260
2850
|
return (rowNodesWithSameCellValue.findIndex((pk) => self.isRowNodeAvailableAfterFiltering(pk) === true) !== -1);
|
|
@@ -3317,14 +2907,11 @@ class AdaptableAgGrid {
|
|
|
3317
2907
|
return this.agGridAdapter.getGridOption('statusBar')?.statusPanels ?? [];
|
|
3318
2908
|
}
|
|
3319
2909
|
updateCell(cellUpdateRequest) {
|
|
3320
|
-
// note: because we use RowNode.setDataValue() this will cause Validation to fire
|
|
3321
|
-
// see https://www.ag-grid.com/javascript-data-grid/change-detection/#triggering-value-change-detection
|
|
3322
2910
|
const rowNode = cellUpdateRequest.rowNode ?? this.getRowNodeForPrimaryKey(cellUpdateRequest.primaryKeyValue);
|
|
3323
2911
|
if (!rowNode) {
|
|
3324
2912
|
this.logger.warn(`updateCell() - rowNode not found for primaryKeyValue: ${cellUpdateRequest.primaryKeyValue}`);
|
|
3325
2913
|
return;
|
|
3326
2914
|
}
|
|
3327
|
-
// update the row node and set it as an edit (for AG Grid Cell Change Detection)
|
|
3328
2915
|
rowNode.setDataValue(cellUpdateRequest.columnId, cellUpdateRequest.newValue, 'edit');
|
|
3329
2916
|
}
|
|
3330
2917
|
forAllRowNodesDo(func, config) {
|
|
@@ -3338,8 +2925,6 @@ class AdaptableAgGrid {
|
|
|
3338
2925
|
}
|
|
3339
2926
|
forAllVisibleRowNodesDo(func, config) {
|
|
3340
2927
|
if (this.getAgGridRowModelType() !== 'clientSide') {
|
|
3341
|
-
// only in client-side row model can we loop through filtered&sorted rows
|
|
3342
|
-
// see https://www.ag-grid.com/javascript-data-grid/accessing-data/#iterating-rows
|
|
3343
2928
|
this.logger.warn('forAllVisibleRowNodesDo() is only supported with client-side row model. Falling back to forAllRowNodesDo().');
|
|
3344
2929
|
return this.forAllRowNodesDo(func, config);
|
|
3345
2930
|
}
|
|
@@ -3352,8 +2937,6 @@ class AdaptableAgGrid {
|
|
|
3352
2937
|
});
|
|
3353
2938
|
}
|
|
3354
2939
|
getAgGridRowModelType(gridOptions) {
|
|
3355
|
-
// it seems that this can be null so we need explicitly to return "clientSide" in this case
|
|
3356
|
-
// need to check that for ServerSideRowModel it is ALWAYS returned...
|
|
3357
2940
|
if (gridOptions) {
|
|
3358
2941
|
return gridOptions.rowModelType ?? 'clientSide';
|
|
3359
2942
|
}
|
|
@@ -3490,16 +3073,10 @@ class AdaptableAgGrid {
|
|
|
3490
3073
|
this.logger.consoleError('Cannot call showChart before Adaptable is fully initialized.');
|
|
3491
3074
|
return null;
|
|
3492
3075
|
}
|
|
3493
|
-
/**
|
|
3494
|
-
* Ag-grid always creates new charts behind the sences.
|
|
3495
|
-
* So we need to update the model inside adaptable state.
|
|
3496
|
-
* This is important to be done as soon as possible so it is not considered new.
|
|
3497
|
-
*/
|
|
3498
3076
|
const chartRef = this.agGridAdapter
|
|
3499
3077
|
.getAgGridApi()
|
|
3500
3078
|
.restoreChart(chartDefinition.Model, container);
|
|
3501
3079
|
const chartModel = this.getChartModels().find((chartModel) => chartModel.chartId === chartRef.chartId);
|
|
3502
|
-
// Update the definition in state so it is not considered new
|
|
3503
3080
|
this.api.chartingApi.editChartDefinition({
|
|
3504
3081
|
...chartDefinition,
|
|
3505
3082
|
Model: chartModel,
|
|
@@ -3512,16 +3089,12 @@ class AdaptableAgGrid {
|
|
|
3512
3089
|
return;
|
|
3513
3090
|
}
|
|
3514
3091
|
const upgradableProperties = {
|
|
3515
|
-
// Only Range charts are supported to be created at run time
|
|
3516
|
-
// the other two are pivot & cross-filter
|
|
3517
3092
|
type: 'rangeChartUpdate',
|
|
3518
3093
|
chartId: chart.Model.chartId,
|
|
3519
3094
|
unlinkChart: Boolean(chart.Model.unlinkChart),
|
|
3520
3095
|
suppressChartRanges: Boolean(chart.Model.suppressChartRanges),
|
|
3521
3096
|
aggFunc: chart.Model.aggFunc,
|
|
3522
3097
|
};
|
|
3523
|
-
// Skip the AG Grid API call if the upgradable properties haven't changed
|
|
3524
|
-
// to avoid unnecessary chartOptionsChanged events (see #ag_grid_update_chart_loop)
|
|
3525
3098
|
const currentModel = this.getChartModels().find((model) => model.chartId === chart.Model.chartId);
|
|
3526
3099
|
if (currentModel &&
|
|
3527
3100
|
Boolean(currentModel.unlinkChart) === upgradableProperties.unlinkChart &&
|
|
@@ -3529,7 +3102,6 @@ class AdaptableAgGrid {
|
|
|
3529
3102
|
currentModel.aggFunc === upgradableProperties.aggFunc) {
|
|
3530
3103
|
return;
|
|
3531
3104
|
}
|
|
3532
|
-
// see also #ag_grid_update_chart_loop
|
|
3533
3105
|
this.agGridAdapter.getAgGridApi().updateChart(upgradableProperties);
|
|
3534
3106
|
}
|
|
3535
3107
|
getChartModels() {
|
|
@@ -3616,9 +3188,6 @@ class AdaptableAgGrid {
|
|
|
3616
3188
|
const themeClassNamesToRemove = [];
|
|
3617
3189
|
const themesToRemove = [];
|
|
3618
3190
|
const allThemes = this.api.themeApi.getThemes().map((t) => {
|
|
3619
|
-
// we mutate the theme later,
|
|
3620
|
-
// and since we don't want the mutation to end up in state
|
|
3621
|
-
// we better clone it here
|
|
3622
3191
|
return { ...t };
|
|
3623
3192
|
});
|
|
3624
3193
|
const allThemesMap = allThemes.reduce((acc, theme) => {
|
|
@@ -3626,8 +3195,6 @@ class AdaptableAgGrid {
|
|
|
3626
3195
|
return acc;
|
|
3627
3196
|
}, {});
|
|
3628
3197
|
const themeObject = allThemesMap[themeName];
|
|
3629
|
-
// REMOVE PREVIOUS THEME
|
|
3630
|
-
// const themePrefix = 'ab--theme-'
|
|
3631
3198
|
const el = document.documentElement;
|
|
3632
3199
|
el.classList.forEach((cssClassName) => {
|
|
3633
3200
|
const index = cssClassName.indexOf(GeneralConstants.THEME_STYLE);
|
|
@@ -3640,17 +3207,14 @@ class AdaptableAgGrid {
|
|
|
3640
3207
|
}
|
|
3641
3208
|
});
|
|
3642
3209
|
themeClassNamesToRemove.forEach((cssClassName) => el.classList.remove(cssClassName));
|
|
3643
|
-
// remove infinite table classnames
|
|
3644
3210
|
themesToRemove.forEach((theme) => {
|
|
3645
3211
|
el.classList.remove(`infinite-theme-mode--${theme.Name}`);
|
|
3646
3212
|
});
|
|
3647
3213
|
el.classList.remove(`infinite-theme-name--default`);
|
|
3648
|
-
// VARIANT
|
|
3649
3214
|
let variantTheme = '';
|
|
3650
3215
|
if (!isSystemTheme && themeObject.Variant) {
|
|
3651
3216
|
variantTheme = themeObject.Variant;
|
|
3652
3217
|
}
|
|
3653
|
-
// APPLY NEW THEME
|
|
3654
3218
|
const newTheme = allThemesMap[themeName];
|
|
3655
3219
|
const getClassName = (theme) => GeneralConstants.THEME_STYLE + theme;
|
|
3656
3220
|
el.classList.add(getClassName(themeName));
|
|
@@ -3658,16 +3222,13 @@ class AdaptableAgGrid {
|
|
|
3658
3222
|
el.classList.add(getClassName(variantTheme));
|
|
3659
3223
|
}
|
|
3660
3224
|
if (isSystemTheme) {
|
|
3661
|
-
// add infinite table classname for theme
|
|
3662
3225
|
el.classList.add(`infinite-theme-mode--${themeName}`);
|
|
3663
3226
|
}
|
|
3664
3227
|
else if (variantTheme) {
|
|
3665
3228
|
el.classList.add(`infinite-theme-mode--${variantTheme}`);
|
|
3666
3229
|
}
|
|
3667
3230
|
el.classList.add(`infinite-theme-name--default`);
|
|
3668
|
-
// Update AG THEME
|
|
3669
3231
|
this.agGridThemeAdapter.applyAgGridThemeOnAdaptableThemeChange(newTheme, variantTheme, container, themesToRemove);
|
|
3670
|
-
// MAC LIKE SCROLLBARS
|
|
3671
3232
|
if (this.adaptableOptions.userInterfaceOptions &&
|
|
3672
3233
|
this.adaptableOptions.userInterfaceOptions.useCustomMacLikeScrollbars &&
|
|
3673
3234
|
(0, getScrollbarSize_1.default)() > 0) {
|
|
@@ -3750,7 +3311,6 @@ class AdaptableAgGrid {
|
|
|
3750
3311
|
value = sum / distinctRawValues.length;
|
|
3751
3312
|
}
|
|
3752
3313
|
else {
|
|
3753
|
-
// median - sort a shallow copy so we don't mutate the source
|
|
3754
3314
|
const sorted = [...distinctRawValues].sort((a, b) => a - b);
|
|
3755
3315
|
const mid = Math.floor(sorted.length / 2);
|
|
3756
3316
|
value = sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
|
|
@@ -3769,7 +3329,6 @@ class AdaptableAgGrid {
|
|
|
3769
3329
|
};
|
|
3770
3330
|
}
|
|
3771
3331
|
else {
|
|
3772
|
-
// should not happen unless someone ignored the TypeScript warnings
|
|
3773
3332
|
if (config.unmount == undefined) {
|
|
3774
3333
|
config.unmount = true;
|
|
3775
3334
|
}
|
|
@@ -3862,7 +3421,6 @@ class AdaptableAgGrid {
|
|
|
3862
3421
|
this.columnMinMaxValuesCache = null;
|
|
3863
3422
|
this.lifecycleState = 'preDestroyed';
|
|
3864
3423
|
AdaptableAgGrid.dismissInstance(this);
|
|
3865
|
-
// !! this has to be before clearing up references to container and/or adaptableOptions
|
|
3866
3424
|
if (config?.unmount) {
|
|
3867
3425
|
const abContainerElement = this.getAdaptableContainerElement();
|
|
3868
3426
|
if (abContainerElement != null) {
|
|
@@ -3900,8 +3458,6 @@ class AdaptableAgGrid {
|
|
|
3900
3458
|
this.TeamSharingService = null;
|
|
3901
3459
|
this.RowFormService?.destroy?.();
|
|
3902
3460
|
this.RowFormService = null;
|
|
3903
|
-
this.MetamodelService?.destroy?.();
|
|
3904
|
-
this.MetamodelService = null;
|
|
3905
3461
|
this.LicenseService?.destroy?.();
|
|
3906
3462
|
this.LicenseService = null;
|
|
3907
3463
|
this.FlashingCellService?.destroy?.();
|
|
@@ -3968,7 +3524,6 @@ class AdaptableAgGrid {
|
|
|
3968
3524
|
const perfSetLayout = this.logger.beginPerf(`setLayout(${layout.Name})`);
|
|
3969
3525
|
const setLayoutMarker = (0, devTools_1.getMarker)(this.adaptableOptions.adaptableId).track.Runtime.label.SetLayout.start();
|
|
3970
3526
|
const isPivot = (0, LayoutHelpers_1.isPivotLayout)(layout);
|
|
3971
|
-
// update the header name for all columns
|
|
3972
3527
|
this.agGridAdapter
|
|
3973
3528
|
.getAgGridApi()
|
|
3974
3529
|
.getColumns()
|
|
@@ -3984,9 +3539,6 @@ class AdaptableAgGrid {
|
|
|
3984
3539
|
};
|
|
3985
3540
|
this.agGridColumnAdapter.setupColumnHeader(colSetupInfo);
|
|
3986
3541
|
});
|
|
3987
|
-
// need to refresh the header,
|
|
3988
|
-
// as the Layout.ColumnHeaders state property is not implemented in the LayoutManager
|
|
3989
|
-
// and is specific to Adaptable, therefore we need to refresh it manually
|
|
3990
3542
|
if (!prevLayout ||
|
|
3991
3543
|
JSON.stringify(prevLayout.ColumnHeaders) !== JSON.stringify(layout.ColumnHeaders)) {
|
|
3992
3544
|
this.refreshHeader();
|
|
@@ -4011,7 +3563,6 @@ class AdaptableAgGrid {
|
|
|
4011
3563
|
});
|
|
4012
3564
|
}
|
|
4013
3565
|
}
|
|
4014
|
-
// this.showQuickFilter()
|
|
4015
3566
|
this.forPlugins((plugin) => {
|
|
4016
3567
|
if (plugin.afterSetLayout) {
|
|
4017
3568
|
plugin.afterSetLayout(this, layout);
|
|
@@ -4101,10 +3652,6 @@ class AdaptableAgGrid {
|
|
|
4101
3652
|
oldValue: oldValue,
|
|
4102
3653
|
newValue: newValue,
|
|
4103
3654
|
column: abColumn,
|
|
4104
|
-
/**
|
|
4105
|
-
* A grouped row does not have an underling data item.
|
|
4106
|
-
* Because of this we use the rowNode.id as an identifier.
|
|
4107
|
-
*/
|
|
4108
3655
|
primaryKeyValue: rowNode.id,
|
|
4109
3656
|
rowNode: rowNode,
|
|
4110
3657
|
trigger: 'aggChange',
|
|
@@ -4130,29 +3677,21 @@ class AdaptableAgGrid {
|
|
|
4130
3677
|
this.performPostEditChecks(rowNode, [cellDataChangedInfo]);
|
|
4131
3678
|
}
|
|
4132
3679
|
isUndoChange(dataChange) {
|
|
4133
|
-
// check if this is not a reverted change
|
|
4134
3680
|
const undoChange = this.api.internalApi.getDataService().extractUndoChange(dataChange);
|
|
4135
3681
|
return !!undoChange;
|
|
4136
3682
|
}
|
|
4137
|
-
/**
|
|
4138
|
-
* There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
|
|
4139
|
-
*/
|
|
4140
3683
|
performPostEditChecks(rowNode, cellDataChangedInfos) {
|
|
4141
3684
|
cellDataChangedInfos = (0, CalculatedColumnExpressionService_2.expandCellDataChangedInfosWithCalculatedColumns)(this.api, cellDataChangedInfos);
|
|
4142
3685
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
4143
|
-
// if a Cell Data Change is undone, log to the Console
|
|
4144
3686
|
if (cellDataChangedInfo.trigger === 'undo') {
|
|
4145
3687
|
this.logger.info(`Data change reverted: column="${cellDataChangedInfo.column}", primaryKey="${cellDataChangedInfo.primaryKeyValue}", from=${cellDataChangedInfo.newValue} to=${cellDataChangedInfo.oldValue}`);
|
|
4146
3688
|
}
|
|
4147
|
-
// For Changes except Aggregations, reset cell selection if required
|
|
4148
3689
|
if (cellDataChangedInfo.trigger === 'edit' ||
|
|
4149
3690
|
cellDataChangedInfo.trigger === 'undo' ||
|
|
4150
3691
|
cellDataChangedInfo.trigger === 'tick') {
|
|
4151
3692
|
this.checkIfChangedCellCurrentlySelected(cellDataChangedInfo);
|
|
4152
3693
|
}
|
|
4153
|
-
// Call the Data Service to create an Internal Event so other parts of App can respond
|
|
4154
3694
|
this.DataService.CreateCellDataChangedEvent(cellDataChangedInfo);
|
|
4155
|
-
// Reset Min and Max values for the Column
|
|
4156
3695
|
this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
|
|
4157
3696
|
});
|
|
4158
3697
|
this.refreshCellsBasedOnCellDataChange(rowNode, cellDataChangedInfos);
|
|
@@ -4167,20 +3706,16 @@ class AdaptableAgGrid {
|
|
|
4167
3706
|
}
|
|
4168
3707
|
}
|
|
4169
3708
|
refreshCellsBasedOnCellDataChange(rowNode, cellDataChangedInfos) {
|
|
4170
|
-
// Check if node is visible as otherwise AG Grid wont refresh
|
|
4171
3709
|
if (this.agGridAdapter.isVisibleNode(rowNode)) {
|
|
4172
3710
|
let dataChangedScope = {
|
|
4173
3711
|
wholeRow: false,
|
|
4174
3712
|
columnIds: new Set(),
|
|
4175
3713
|
};
|
|
4176
|
-
// First check Format Column Expressions
|
|
4177
3714
|
this.checkFormatColumnExpressionStyleChanges(dataChangedScope, cellDataChangedInfos);
|
|
4178
|
-
// If Scope is whole row then redraw row and return
|
|
4179
3715
|
if (dataChangedScope.wholeRow) {
|
|
4180
3716
|
this.redrawRow(rowNode);
|
|
4181
3717
|
return;
|
|
4182
3718
|
}
|
|
4183
|
-
// Next check for Format Column Predicates, Styled Columns and FreeText Columns to update the ColumnIds refresh list as required
|
|
4184
3719
|
this.checkFormatColumnPredicateStyleChanges(dataChangedScope, cellDataChangedInfos);
|
|
4185
3720
|
this.checkFreeTextColumnChanges(dataChangedScope, cellDataChangedInfos);
|
|
4186
3721
|
this.checkStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
@@ -4191,7 +3726,6 @@ class AdaptableAgGrid {
|
|
|
4191
3726
|
}
|
|
4192
3727
|
refreshColumnsBasedOnCellDataChange(cellDataChangedInfos) {
|
|
4193
3728
|
const columnIdsToUpdate = [];
|
|
4194
|
-
// The only use case is Styled Columns with a Relative Cell Range
|
|
4195
3729
|
cellDataChangedInfos.forEach((cellDataChangeInfo) => {
|
|
4196
3730
|
const styledColumn = this.api.styledColumnApi.getActiveStyledColumnForColumn(cellDataChangeInfo.column);
|
|
4197
3731
|
if (styledColumn &&
|
|
@@ -4300,15 +3834,8 @@ class AdaptableAgGrid {
|
|
|
4300
3834
|
}
|
|
4301
3835
|
refreshLayout() {
|
|
4302
3836
|
const columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns();
|
|
4303
|
-
// this setGridOption call will also trigger layout.onColumnDefsChanged()
|
|
4304
|
-
// which will in turn call updateColumnModelAndRefreshGrid
|
|
4305
3837
|
this.agGridAdapter.setGridOption('columnDefs', columnDefs);
|
|
4306
|
-
// the setGridOption call above already triggered updateColumnModelAndRefreshGrid,
|
|
4307
|
-
// setting the dedup guard. We force the next call so that the column model
|
|
4308
|
-
// is re-derived after the layout store has been updated.
|
|
4309
3838
|
this.__forceUpdateColumnModel = true;
|
|
4310
|
-
// this is needed here for when we call setAdaptableStateKey
|
|
4311
|
-
// and pass a new config
|
|
4312
3839
|
this.updateLayoutInManagerAfterStoreHasChanged();
|
|
4313
3840
|
this.applyFiltering();
|
|
4314
3841
|
}
|
|
@@ -4346,11 +3873,8 @@ class AdaptableAgGrid {
|
|
|
4346
3873
|
refreshAdaptableAfterLayoutChange(layout) {
|
|
4347
3874
|
this.logger.info('Refreshing Adaptable after layout change.');
|
|
4348
3875
|
const prevLayoutForRefresh = this.__prevLayoutForRefresh || this.api.layoutApi.getCurrentLayout();
|
|
4349
|
-
// see #on-regroup-expect-group-column-to-be-recomputed-and-setup-properly
|
|
4350
3876
|
const rowGroupsChanged = this.isRowGroupDifferentInLayout(prevLayoutForRefresh, layout);
|
|
4351
3877
|
if (rowGroupsChanged) {
|
|
4352
|
-
// when grouping changes, if we have a filter on the grouped column, we need to remove it
|
|
4353
|
-
// as it is no longer valid
|
|
4354
3878
|
if (layout.ColumnFilters) {
|
|
4355
3879
|
const newFilters = layout.ColumnFilters.filter((filter) => filter.ColumnId !== GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
|
|
4356
3880
|
if (newFilters.length != layout.ColumnFilters.length) {
|
|
@@ -4358,7 +3882,6 @@ class AdaptableAgGrid {
|
|
|
4358
3882
|
layout.ColumnFilters = newFilters;
|
|
4359
3883
|
}
|
|
4360
3884
|
}
|
|
4361
|
-
// also we need to reset the cache for the group column, when we have rowGripDisplayType single
|
|
4362
3885
|
if (layout.RowGroupDisplayType === 'single' &&
|
|
4363
3886
|
(layout.RowGroupedColumns?.length || layout.PivotGroupedColumns?.length)) {
|
|
4364
3887
|
this.api.filterApi.columnFilterApi.resetFilterValues(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
|
|
@@ -4376,8 +3899,6 @@ class AdaptableAgGrid {
|
|
|
4376
3899
|
return layout;
|
|
4377
3900
|
}
|
|
4378
3901
|
validateColumnDefTypes(columnDefs) {
|
|
4379
|
-
// in Adaptable version 20 we switched from colDef.type to colDef.cellDataType
|
|
4380
|
-
// although we documented this change and try to infer the correct cellDataTypes, it's best to also check if the client dev forgot to adjust his colDefs
|
|
4381
3902
|
columnDefs.forEach((colDef) => {
|
|
4382
3903
|
if (colDef.children?.length) {
|
|
4383
3904
|
this.validateColumnDefTypes(colDef.children);
|