@adaptabletools/adaptable-cjs 18.0.0-canary.2 → 18.0.0-canary.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +4 -21
- package/agGrid.js +5 -21
- package/base.css +22 -8
- package/base.css.map +1 -1
- package/index.css +101 -75
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +59 -108
- package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -7
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +11 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +9 -4
- package/src/AdaptableOptions/CommentOptions.d.ts +33 -0
- package/src/AdaptableOptions/GroupingOptions.d.ts +0 -7
- package/src/AdaptableOptions/MenuOptions.d.ts +6 -54
- package/src/AdaptableOptions/MenuOptions.js +72 -75
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +7 -4
- package/src/AdaptableOptions/StateOptions.d.ts +6 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +9 -4
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/ColumnApi.d.ts +4 -0
- package/src/Api/CommentApi.d.ts +13 -14
- package/src/Api/ConfigApi.d.ts +4 -5
- package/src/Api/EventApi.d.ts +7 -9
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/CommentChanged.d.ts +11 -0
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +23 -13
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +30 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +5 -2
- package/src/Api/Implementation/ApiBase.d.ts +5 -3
- package/src/Api/Implementation/ApiBase.js +8 -2
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
- package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +10 -0
- package/src/Api/Implementation/CommentsApiImpl.d.ts +5 -2
- package/src/Api/Implementation/CommentsApiImpl.js +7 -1
- package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ConfigApiImpl.js +24 -13
- package/src/Api/Implementation/GridApiImpl.d.ts +6 -3
- package/src/Api/Implementation/GridApiImpl.js +51 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +3 -0
- package/src/Api/Implementation/LayoutApiImpl.js +18 -0
- package/src/Api/Implementation/NoteApiImpl.d.ts +18 -0
- package/src/Api/Implementation/NoteApiImpl.js +45 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -4
- package/src/Api/Implementation/OptionsApiImpl.js +4 -4
- package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ScopeApiImpl.js +20 -7
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
- package/src/Api/Internal/ActionRowInternalApi.d.ts +6 -1
- package/src/Api/Internal/ActionRowInternalApi.js +119 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +6 -7
- package/src/Api/Internal/AdaptableInternalApi.js +21 -19
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +72 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +2 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +23 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
- package/src/Api/Internal/ColumnInternalApi.js +12 -0
- package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +18 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +32 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
- package/src/Api/Internal/ExportInternalApi.js +4 -1
- package/src/Api/Internal/Fdc3InternalApi.js +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +3 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +61 -0
- package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
- package/src/Api/Internal/GridFilterInternalApi.js +7 -1
- package/src/Api/Internal/GridInternalApi.d.ts +23 -3
- package/src/Api/Internal/GridInternalApi.js +141 -7
- package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
- package/src/Api/Internal/LayoutInternalApi.js +16 -0
- package/src/Api/Internal/NoteInternalApi.d.ts +4 -0
- package/src/Api/Internal/NoteInternalApi.js +18 -0
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +15 -0
- package/src/Api/NoteApi.d.ts +48 -0
- package/src/Api/OptionsApi.d.ts +8 -8
- package/src/Api/ScopeApi.d.ts +10 -0
- package/src/Api/UserInterfaceApi.d.ts +0 -11
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +8 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/CommentState.d.ts +27 -23
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +4 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
- package/src/PredefinedConfig/Common/Enums.js +1 -0
- package/src/PredefinedConfig/Common/Menu.d.ts +15 -1
- package/src/PredefinedConfig/Common/Menu.js +98 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +21 -0
- package/src/PredefinedConfig/Common/RowSummary.js +20 -0
- package/src/PredefinedConfig/Common/TransposeConfig.d.ts +30 -0
- package/src/PredefinedConfig/Common/Types.d.ts +4 -4
- package/src/PredefinedConfig/Common/Types.js +4 -1
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +12 -22
- package/src/PredefinedConfig/PredefinedConfig.d.ts +3 -3
- package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
- package/src/PredefinedConfig/SystemState.d.ts +9 -3
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +34 -11
- package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
- package/src/Redux/ActionsReducers/NoteRedux.js +89 -0
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +19 -6
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +66 -76
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- package/src/Strategy/AdaptableModuleBase.d.ts +8 -8
- package/src/Strategy/AdaptableModuleBase.js +13 -15
- package/src/Strategy/AlertModule.d.ts +1 -2
- package/src/Strategy/AlertModule.js +3 -56
- package/src/Strategy/BulkUpdateModule.js +1 -1
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
- package/src/Strategy/CalculatedColumnModule.js +6 -26
- package/src/Strategy/CellSummaryModule.d.ts +8 -6
- package/src/Strategy/CellSummaryModule.js +78 -23
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +2 -3
- package/src/Strategy/ColumnFilterModule.js +44 -103
- package/src/Strategy/ColumnInfoModule.js +2 -0
- package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +2 -5
- package/src/Strategy/{CommentsModule.js → CommentModule.js} +19 -25
- package/src/Strategy/CustomSortModule.js +3 -2
- package/src/Strategy/DashboardModule.d.ts +1 -2
- package/src/Strategy/DashboardModule.js +9 -15
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataImportModule.d.ts +1 -1
- package/src/Strategy/DataImportModule.js +5 -5
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +1 -0
- package/src/Strategy/ExportModule.js +17 -2
- package/src/Strategy/Fdc3Module.js +3 -0
- package/src/Strategy/FlashingCellModule.d.ts +1 -2
- package/src/Strategy/FlashingCellModule.js +6 -19
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +6 -51
- package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
- package/src/Strategy/FreeTextColumnModule.js +1 -31
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/GridInfoModule.js +2 -0
- package/src/Strategy/Interface/IModule.d.ts +0 -1
- package/src/Strategy/LayoutModule.d.ts +9 -3
- package/src/Strategy/LayoutModule.js +148 -62
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
- package/src/Strategy/NoteModule.js +62 -0
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +2 -2
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.js +3 -3
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/SmartEditModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +1 -1
- package/src/Strategy/StyledColumnModule.js +26 -26
- package/src/Strategy/SystemStatusModule.js +2 -2
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -2
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +7 -7
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +7 -6
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +430 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -1
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +20 -60
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +6 -1
- package/src/Utilities/MenuItem.d.ts +7 -4
- package/src/Utilities/MenuItem.js +6 -3
- package/src/Utilities/ObjectFactory.d.ts +3 -3
- package/src/Utilities/ObjectFactory.js +4 -24
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +4 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +26 -19
- package/src/Utilities/Services/CellPopupService.js +2 -3
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -186
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/ModuleService.js +4 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +4 -3
- package/src/Utilities/Services/ReportService.d.ts +7 -5
- package/src/Utilities/Services/ReportService.js +238 -22
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/adaptableQlUtils.d.ts +2 -0
- package/src/Utilities/adaptableQlUtils.js +18 -0
- package/src/Utilities/license/decode.js +1 -70
- package/src/Utilities/license/hashing.js +1 -47
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +3 -3
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsEditor.js +24 -11
- package/src/View/Comments/CommentsPopup.js +20 -11
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +5 -0
- package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +46 -0
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
- package/src/View/Components/CellPopup/index.d.ts +1 -0
- package/src/View/Components/CellPopup/index.js +5 -2
- package/src/View/Components/FilterForm/FilterForm.js +20 -12
- package/src/View/Components/FilterForm/QuickFilterForm.js +15 -8
- package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +7 -7
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +2 -2
- package/src/View/Components/ValueSelector/index.d.ts +1 -0
- package/src/View/Components/ValueSelector/index.js +2 -2
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -9
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +9 -5
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +1 -1
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/LayoutViewPanel.js +2 -1
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +200 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +36 -3
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +9 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +181 -0
- package/src/View/License/LicenseWatermark.js +1 -66
- package/src/View/Note/NotePopup.d.ts +2 -0
- package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +19 -19
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/Theme/ThemeSelector.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +7 -6
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +7 -5291
- package/src/agGrid/AdaptableAgGrid.d.ts +354 -0
- package/src/agGrid/AdaptableAgGrid.js +3972 -0
- package/src/agGrid/AdaptableLogger.js +78 -13
- package/src/agGrid/AgGridAdapter.d.ts +64 -0
- package/src/agGrid/AgGridAdapter.js +590 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +836 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +282 -0
- package/src/agGrid/AgGridOptionsService.d.ts +15 -0
- package/src/agGrid/AgGridOptionsService.js +80 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +74 -18
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/agGrid/weightedAverage.d.ts +0 -2
- package/src/agGrid/weightedAverage.js +1 -56
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/Datepicker/index.js +10 -2
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +3 -17
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -2
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +6 -4
- package/src/components/Select/Select.d.ts +3 -1
- package/src/components/Select/Select.js +4 -2
- package/src/components/Textarea/index.d.ts +2 -2
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/note.js +2 -2
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +7 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +179 -25
- package/src/metamodel/adaptable.metamodel.js +1 -9316
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +52 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +15 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +347 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +10 -0
- package/src/parser/src/parser.js +117 -1257
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
- package/src/parser/src/types.d.ts +7 -2
- package/src/types.d.ts +26 -19
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/AdaptableOptions/CommentsOptions.d.ts +0 -28
- package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
- package/src/Api/Implementation/NotesApiImpl.d.ts +0 -16
- package/src/Api/Implementation/NotesApiImpl.js +0 -44
- package/src/Api/NotesApi.d.ts +0 -48
- package/src/PredefinedConfig/CellAddress.d.ts +0 -13
- package/src/PredefinedConfig/CellAddress.js +0 -5
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -39
- package/src/Redux/ActionsReducers/NotesRedux.js +0 -87
- package/src/Strategy/NotesModule.js +0 -62
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -138
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
- package/src/View/Notes/NotesPopup.d.ts +0 -2
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -691
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -673
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
- /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
- /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
- /package/src/PredefinedConfig/{NotesState.js → Common/TransposeConfig.js} +0 -0
- /package/src/{Utilities/Services/Interface/IRowEditService.js → PredefinedConfig/NoteState.js} +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpressionFunctions = exports.quantileAggregatedExpressionFunctions = exports.cumulativeAggregatedExpressionFunctions = exports.aggregatedExpressionFunctions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
5
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
6
|
+
const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
|
|
6
7
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
8
|
+
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
9
|
+
const isAfter_1 = tslib_1.__importDefault(require("date-fns/isAfter"));
|
|
10
|
+
const DateHelper_1 = require("../Helpers/DateHelper");
|
|
7
11
|
exports.aggregatedExpressionFunctions = [
|
|
8
12
|
'SUM',
|
|
9
13
|
'PERCENTAGE',
|
|
@@ -14,6 +18,11 @@ exports.aggregatedExpressionFunctions = [
|
|
|
14
18
|
'WEIGHT',
|
|
15
19
|
'COL',
|
|
16
20
|
'GROUP_BY',
|
|
21
|
+
'MEDIAN',
|
|
22
|
+
'MODE',
|
|
23
|
+
'DISTINCT',
|
|
24
|
+
'ONLY',
|
|
25
|
+
'STD_DEVIATION',
|
|
17
26
|
];
|
|
18
27
|
exports.cumulativeAggregatedExpressionFunctions = [
|
|
19
28
|
'CUMUL',
|
|
@@ -80,6 +89,8 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
80
89
|
field: sumColumnName,
|
|
81
90
|
initialValue: 0,
|
|
82
91
|
reducer: (totalSum, rowValue) => {
|
|
92
|
+
// TODO: see why error are not concole logged
|
|
93
|
+
// debuger = 'Adaptable:*'
|
|
83
94
|
if (isUndefinedValue(rowValue)) {
|
|
84
95
|
return totalSum;
|
|
85
96
|
}
|
|
@@ -89,6 +100,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
89
100
|
},
|
|
90
101
|
},
|
|
91
102
|
rowFilterFn: context.filterFn,
|
|
103
|
+
getRowNodes: context.getRowNodes,
|
|
92
104
|
};
|
|
93
105
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
94
106
|
const result = {
|
|
@@ -107,6 +119,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
107
119
|
],
|
|
108
120
|
examples: ['SUM([colA])', 'SUM([colA], GROUP_BY([colB]))'],
|
|
109
121
|
category: 'aggregation',
|
|
122
|
+
inputs: ['number'],
|
|
110
123
|
},
|
|
111
124
|
PERCENTAGE: {
|
|
112
125
|
handler(args, context) {
|
|
@@ -151,6 +164,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
151
164
|
100);
|
|
152
165
|
},
|
|
153
166
|
rowFilterFn: context.filterFn,
|
|
167
|
+
getRowNodes: context.getRowNodes,
|
|
154
168
|
};
|
|
155
169
|
addGroupByParams(groupByColumnNames, aggregationExpressionEvaluation);
|
|
156
170
|
const result = {
|
|
@@ -225,6 +239,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
225
239
|
},
|
|
226
240
|
},
|
|
227
241
|
rowFilterFn: context.filterFn,
|
|
242
|
+
getRowNodes: context.getRowNodes,
|
|
228
243
|
};
|
|
229
244
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
230
245
|
if (weightParameter) {
|
|
@@ -248,6 +263,294 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
248
263
|
],
|
|
249
264
|
examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
|
|
250
265
|
category: 'aggregation',
|
|
266
|
+
inputs: ['number'],
|
|
267
|
+
},
|
|
268
|
+
MEDIAN: {
|
|
269
|
+
handler(args, context) {
|
|
270
|
+
const medianColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('MEDIAN', args);
|
|
271
|
+
const medianColumnName = medianColumnParameter.value;
|
|
272
|
+
(0, expressionFunctionUtils_1.validateColumnType)(medianColumnName, ['Number'], 'MEDIAN', context.adaptableApi);
|
|
273
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MEDIAN', 'operand', ['GROUP_BY'], args, {
|
|
274
|
+
isOptional: true,
|
|
275
|
+
});
|
|
276
|
+
const getCellValue = (rowNode) => {
|
|
277
|
+
return context.adaptableApi.gridApi.getNormalisedValueFromRowNode(rowNode, medianColumnName);
|
|
278
|
+
};
|
|
279
|
+
const aggregationExpressionEvaluation = {
|
|
280
|
+
aggregationParams: {
|
|
281
|
+
reducers: {
|
|
282
|
+
MEDIAN: {
|
|
283
|
+
name: 'MEDIAN',
|
|
284
|
+
field: medianColumnName,
|
|
285
|
+
initialValue: [],
|
|
286
|
+
reducer: (aggregatedValue, value, rowNode) => {
|
|
287
|
+
aggregatedValue.push(rowNode);
|
|
288
|
+
return aggregatedValue;
|
|
289
|
+
},
|
|
290
|
+
done: (aggregatedValue) => {
|
|
291
|
+
if (aggregatedValue.length === 0) {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
if (aggregatedValue.length === 1) {
|
|
295
|
+
return getCellValue(aggregatedValue[0]);
|
|
296
|
+
}
|
|
297
|
+
const lenght = aggregatedValue.length;
|
|
298
|
+
const middle = Math.floor((lenght - 1) / 2);
|
|
299
|
+
if (lenght % 2) {
|
|
300
|
+
return getCellValue(aggregatedValue[middle]);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
return ((getCellValue(aggregatedValue[middle]) +
|
|
304
|
+
getCellValue(aggregatedValue[middle + 1])) /
|
|
305
|
+
2.0);
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
rowFilterFn: context.filterFn,
|
|
312
|
+
getRowNodes: context.getRowNodes,
|
|
313
|
+
};
|
|
314
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
315
|
+
const result = {
|
|
316
|
+
name: 'MEDIAN',
|
|
317
|
+
type: 'aggregationScalar',
|
|
318
|
+
value: aggregationExpressionEvaluation,
|
|
319
|
+
};
|
|
320
|
+
return result;
|
|
321
|
+
},
|
|
322
|
+
description: 'Aggregates a column over multiple rows by computing the median of the column values\nOptionally the aggregation may be grouped.',
|
|
323
|
+
signatures: [
|
|
324
|
+
'MEDIAN( [colName] )',
|
|
325
|
+
'MEDIAN( COL(name: string))',
|
|
326
|
+
'MEDIAN( [colNameA], GROUP_BY( [colNameB] ))',
|
|
327
|
+
'MEDIAN( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
328
|
+
],
|
|
329
|
+
examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
|
|
330
|
+
category: 'aggregation',
|
|
331
|
+
inputs: ['number'],
|
|
332
|
+
},
|
|
333
|
+
MODE: {
|
|
334
|
+
handler(args, context) {
|
|
335
|
+
const modeColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('mode', args);
|
|
336
|
+
const modeColumnName = modeColumnParameter.value;
|
|
337
|
+
(0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number', 'String'], 'mode', context.adaptableApi);
|
|
338
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
|
|
339
|
+
isOptional: true,
|
|
340
|
+
});
|
|
341
|
+
const aggregationExpressionEvaluation = {
|
|
342
|
+
aggregationParams: {
|
|
343
|
+
reducers: {
|
|
344
|
+
MODE: {
|
|
345
|
+
name: 'MODE',
|
|
346
|
+
field: modeColumnName,
|
|
347
|
+
initialValue: new Map(),
|
|
348
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
349
|
+
var _a;
|
|
350
|
+
if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
|
|
351
|
+
return aggregatedValue;
|
|
352
|
+
}
|
|
353
|
+
if (!aggregatedValue) {
|
|
354
|
+
return new Map();
|
|
355
|
+
}
|
|
356
|
+
aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
|
|
357
|
+
return aggregatedValue;
|
|
358
|
+
},
|
|
359
|
+
done: (aggregatedValue) => {
|
|
360
|
+
var _a;
|
|
361
|
+
const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
|
|
362
|
+
if (aFreq < bFreq) {
|
|
363
|
+
return 1;
|
|
364
|
+
}
|
|
365
|
+
else if (aFreq > bFreq || aVal < bVal) {
|
|
366
|
+
return -1;
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
return aVal === bVal ? 0 : 1;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
return (_a = sorted === null || sorted === void 0 ? void 0 : sorted[0]) === null || _a === void 0 ? void 0 : _a[0];
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
rowFilterFn: context.filterFn,
|
|
378
|
+
getRowNodes: context.getRowNodes,
|
|
379
|
+
};
|
|
380
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
381
|
+
const result = {
|
|
382
|
+
name: 'MODE',
|
|
383
|
+
type: 'aggregationScalar',
|
|
384
|
+
value: aggregationExpressionEvaluation,
|
|
385
|
+
};
|
|
386
|
+
return result;
|
|
387
|
+
},
|
|
388
|
+
description: 'Aggregates a column over multiple rows by computing the mode of the column values\nOptionally the aggregation may be grouped.',
|
|
389
|
+
signatures: [
|
|
390
|
+
'MODE( [colName] )',
|
|
391
|
+
'MODE( COL(name: string))',
|
|
392
|
+
'MODE( [colNameA], GROUP_BY( [colNameB] ))',
|
|
393
|
+
'MODE( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
394
|
+
],
|
|
395
|
+
examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
|
|
396
|
+
category: 'aggregation',
|
|
397
|
+
inputs: [['number'], ['text']],
|
|
398
|
+
},
|
|
399
|
+
DISTINCT: {
|
|
400
|
+
handler(args, context) {
|
|
401
|
+
const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('DISTINCT', args);
|
|
402
|
+
const distinctColumnName = distinctColumnParameter.value;
|
|
403
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
|
|
404
|
+
isOptional: true,
|
|
405
|
+
});
|
|
406
|
+
const aggregationExpressionEvaluation = {
|
|
407
|
+
aggregationParams: {
|
|
408
|
+
reducers: {
|
|
409
|
+
DISTINCT: {
|
|
410
|
+
name: 'DISTINCT',
|
|
411
|
+
field: distinctColumnName,
|
|
412
|
+
initialValue: new Set(),
|
|
413
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
414
|
+
if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
|
|
415
|
+
return aggregatedValue;
|
|
416
|
+
}
|
|
417
|
+
aggregatedValue.add(rowValue);
|
|
418
|
+
return aggregatedValue;
|
|
419
|
+
},
|
|
420
|
+
done: (aggregatedValue) => {
|
|
421
|
+
return aggregatedValue.size;
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
getRowNodes: context.getRowNodes,
|
|
427
|
+
};
|
|
428
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
429
|
+
const result = {
|
|
430
|
+
name: 'DISTINCT',
|
|
431
|
+
type: 'aggregationScalar',
|
|
432
|
+
value: aggregationExpressionEvaluation,
|
|
433
|
+
};
|
|
434
|
+
return result;
|
|
435
|
+
},
|
|
436
|
+
description: 'Aggregates a column over multiple rows by computing the distinct number of the column values\nOptionally the aggregation may be grouped.',
|
|
437
|
+
signatures: [
|
|
438
|
+
'DISTINCT( [colName] )',
|
|
439
|
+
'DISTINCT( COL(name: string))',
|
|
440
|
+
'DISTINCT( [colNameA], GROUP_BY( [colNameB] ))',
|
|
441
|
+
'DISTINCT( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
442
|
+
],
|
|
443
|
+
examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
|
|
444
|
+
category: 'aggregation',
|
|
445
|
+
inputs: [['number'], ['text']],
|
|
446
|
+
},
|
|
447
|
+
ONLY: {
|
|
448
|
+
handler(args, context) {
|
|
449
|
+
const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('ONLY', args);
|
|
450
|
+
const onlyColumnName = distinctColumnParameter.value;
|
|
451
|
+
(0, expressionFunctionUtils_1.validateColumnType)(onlyColumnName, ['Number'], 'ONLY', context.adaptableApi);
|
|
452
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('ONLY', 'operand', ['GROUP_BY'], args, {
|
|
453
|
+
isOptional: true,
|
|
454
|
+
});
|
|
455
|
+
const aggregationExpressionEvaluation = {
|
|
456
|
+
aggregationParams: {
|
|
457
|
+
reducers: {
|
|
458
|
+
ONLY: {
|
|
459
|
+
name: 'ONLY',
|
|
460
|
+
field: onlyColumnName,
|
|
461
|
+
initialValue: new Set(),
|
|
462
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
463
|
+
if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
|
|
464
|
+
return aggregatedValue;
|
|
465
|
+
}
|
|
466
|
+
aggregatedValue.add(rowValue);
|
|
467
|
+
return aggregatedValue;
|
|
468
|
+
},
|
|
469
|
+
done: (aggregatedValue) => {
|
|
470
|
+
return aggregatedValue.size === 1 ? aggregatedValue.values().next().value : null;
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
rowFilterFn: context.filterFn,
|
|
476
|
+
getRowNodes: context.getRowNodes,
|
|
477
|
+
};
|
|
478
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
479
|
+
const result = {
|
|
480
|
+
name: 'ONLY',
|
|
481
|
+
type: 'aggregationScalar',
|
|
482
|
+
value: aggregationExpressionEvaluation,
|
|
483
|
+
};
|
|
484
|
+
return result;
|
|
485
|
+
},
|
|
486
|
+
description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
|
|
487
|
+
signatures: [
|
|
488
|
+
'ONLY( [colName] )',
|
|
489
|
+
'ONLY( COL(name: string))',
|
|
490
|
+
'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
|
|
491
|
+
'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
492
|
+
],
|
|
493
|
+
examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
|
|
494
|
+
category: 'aggregation',
|
|
495
|
+
inputs: [['number'], ['text']],
|
|
496
|
+
},
|
|
497
|
+
STD_DEVIATION: {
|
|
498
|
+
handler(args, context) {
|
|
499
|
+
const columnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('STD_DEVIATION', args);
|
|
500
|
+
const columnName = columnParameter.value;
|
|
501
|
+
(0, expressionFunctionUtils_1.validateColumnType)(columnName, ['Number'], 'STD_DEVIATION', context.adaptableApi);
|
|
502
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('STD_DEVIATION', 'operand', ['GROUP_BY'], args, {
|
|
503
|
+
isOptional: true,
|
|
504
|
+
});
|
|
505
|
+
const aggregationExpressionEvaluation = {
|
|
506
|
+
aggregationParams: {
|
|
507
|
+
reducers: {
|
|
508
|
+
STD_DEVIATION: {
|
|
509
|
+
name: 'STD_DEVIATION',
|
|
510
|
+
field: columnName,
|
|
511
|
+
initialValue: { sumOfValues: 0, values: [] },
|
|
512
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
513
|
+
// TODO: getNumericValue; allow numeric strings
|
|
514
|
+
if (typeof rowValue !== 'number' || isNaN(rowValue)) {
|
|
515
|
+
return aggregatedValue;
|
|
516
|
+
}
|
|
517
|
+
aggregatedValue.sumOfValues = aggregatedValue.sumOfValues + rowValue;
|
|
518
|
+
aggregatedValue.values.push(rowValue);
|
|
519
|
+
return aggregatedValue;
|
|
520
|
+
},
|
|
521
|
+
done: (aggregatedValue) => {
|
|
522
|
+
const { sumOfValues, values } = aggregatedValue;
|
|
523
|
+
if (values.length === 0) {
|
|
524
|
+
return 0;
|
|
525
|
+
}
|
|
526
|
+
const mean = sumOfValues / values.length;
|
|
527
|
+
const variance = (0, ArrayExtensions_1.SumArray)(values.map((value) => Math.pow(value - mean, 2))) / values.length;
|
|
528
|
+
return Math.sqrt(variance);
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
rowFilterFn: context.filterFn,
|
|
534
|
+
getRowNodes: context.getRowNodes,
|
|
535
|
+
};
|
|
536
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
537
|
+
const result = {
|
|
538
|
+
name: 'STD_DEVIATION',
|
|
539
|
+
type: 'aggregationScalar',
|
|
540
|
+
value: aggregationExpressionEvaluation,
|
|
541
|
+
};
|
|
542
|
+
return result;
|
|
543
|
+
},
|
|
544
|
+
description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
|
|
545
|
+
signatures: [
|
|
546
|
+
'ONLY( [colName] )',
|
|
547
|
+
'ONLY( COL(name: string))',
|
|
548
|
+
'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
|
|
549
|
+
'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
550
|
+
],
|
|
551
|
+
examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
|
|
552
|
+
category: 'aggregation',
|
|
553
|
+
inputs: ['number'],
|
|
251
554
|
},
|
|
252
555
|
MIN: {
|
|
253
556
|
handler(args, context) {
|
|
@@ -280,6 +583,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
280
583
|
},
|
|
281
584
|
},
|
|
282
585
|
rowFilterFn: context.filterFn,
|
|
586
|
+
getRowNodes: context.getRowNodes,
|
|
283
587
|
};
|
|
284
588
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
285
589
|
const result = {
|
|
@@ -298,6 +602,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
298
602
|
],
|
|
299
603
|
examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
|
|
300
604
|
category: 'aggregation',
|
|
605
|
+
inputs: ['number'],
|
|
301
606
|
},
|
|
302
607
|
MAX: {
|
|
303
608
|
handler(args, context) {
|
|
@@ -330,6 +635,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
330
635
|
},
|
|
331
636
|
},
|
|
332
637
|
rowFilterFn: context.filterFn,
|
|
638
|
+
getRowNodes: context.getRowNodes,
|
|
333
639
|
};
|
|
334
640
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
335
641
|
const result = {
|
|
@@ -348,6 +654,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
348
654
|
],
|
|
349
655
|
examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
|
|
350
656
|
category: 'aggregation',
|
|
657
|
+
inputs: ['number'],
|
|
351
658
|
},
|
|
352
659
|
QUANT: {
|
|
353
660
|
handler(args, context) {
|
|
@@ -448,6 +755,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
448
755
|
const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
|
|
449
756
|
return isDefinedValue(rowValue);
|
|
450
757
|
},
|
|
758
|
+
getRowNodes: context.getRowNodes,
|
|
451
759
|
aggregationParams: {
|
|
452
760
|
reducers: {
|
|
453
761
|
QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
|
|
@@ -526,6 +834,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
526
834
|
},
|
|
527
835
|
},
|
|
528
836
|
rowFilterFn: context.filterFn,
|
|
837
|
+
getRowNodes: context.getRowNodes,
|
|
529
838
|
};
|
|
530
839
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
531
840
|
const result = {
|
|
@@ -544,6 +853,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
544
853
|
],
|
|
545
854
|
examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
|
|
546
855
|
category: 'aggregation',
|
|
856
|
+
inputs: [['number'], ['text']],
|
|
547
857
|
},
|
|
548
858
|
OVER: {
|
|
549
859
|
handler(args, context) {
|
|
@@ -605,6 +915,124 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
605
915
|
examples: ['[col1]', 'COL("col1")'],
|
|
606
916
|
category: 'special',
|
|
607
917
|
},
|
|
918
|
+
OLDEST: {
|
|
919
|
+
handler(args, context) {
|
|
920
|
+
const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('OLDEST', args);
|
|
921
|
+
const minColumnName = minColumnParameter.value;
|
|
922
|
+
(0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'OLDEST', context.adaptableApi);
|
|
923
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('OLDEST', 'operand', ['GROUP_BY'], args, {
|
|
924
|
+
isOptional: true,
|
|
925
|
+
});
|
|
926
|
+
const aggregationExpressionEvaluation = {
|
|
927
|
+
aggregationParams: {
|
|
928
|
+
reducers: {
|
|
929
|
+
OLDEST: {
|
|
930
|
+
name: 'OLDEST',
|
|
931
|
+
field: minColumnName,
|
|
932
|
+
initialValue: null,
|
|
933
|
+
reducer: (minValue, rowValue) => {
|
|
934
|
+
if (!minValue) {
|
|
935
|
+
return rowValue;
|
|
936
|
+
}
|
|
937
|
+
if (!rowValue) {
|
|
938
|
+
return minValue;
|
|
939
|
+
}
|
|
940
|
+
if ((0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(minValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
|
|
941
|
+
return rowValue;
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
return minValue;
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
done: (minValue, arr) => {
|
|
948
|
+
if (minValue !== null) {
|
|
949
|
+
return minValue;
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
},
|
|
955
|
+
rowFilterFn: context.filterFn,
|
|
956
|
+
getRowNodes: context.getRowNodes,
|
|
957
|
+
};
|
|
958
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
959
|
+
const result = {
|
|
960
|
+
name: 'OLDEST',
|
|
961
|
+
type: 'aggregationScalar',
|
|
962
|
+
value: aggregationExpressionEvaluation,
|
|
963
|
+
};
|
|
964
|
+
return result;
|
|
965
|
+
},
|
|
966
|
+
description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
|
|
967
|
+
signatures: [
|
|
968
|
+
'OLDEST( [colName] )',
|
|
969
|
+
'OLDEST( COL(name: string))',
|
|
970
|
+
'OLDEST( [colNameA], GROUP_BY( [colNameB] ))',
|
|
971
|
+
'OLDEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
972
|
+
],
|
|
973
|
+
examples: ['OLDEST([colA])', 'OLDEST([colA], GROUP_BY([colB]))'],
|
|
974
|
+
category: 'aggregation',
|
|
975
|
+
inputs: ['date'],
|
|
976
|
+
},
|
|
977
|
+
YOUNGEST: {
|
|
978
|
+
handler(args, context) {
|
|
979
|
+
const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('YOUNGEST', args);
|
|
980
|
+
const minColumnName = minColumnParameter.value;
|
|
981
|
+
(0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
|
|
982
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('YOUNGEST', 'operand', ['GROUP_BY'], args, {
|
|
983
|
+
isOptional: true,
|
|
984
|
+
});
|
|
985
|
+
const aggregationExpressionEvaluation = {
|
|
986
|
+
aggregationParams: {
|
|
987
|
+
reducers: {
|
|
988
|
+
YOUNGEST: {
|
|
989
|
+
name: 'YOUNGEST',
|
|
990
|
+
field: minColumnName,
|
|
991
|
+
initialValue: null,
|
|
992
|
+
reducer: (minValue, rowValue) => {
|
|
993
|
+
if (!minValue) {
|
|
994
|
+
return rowValue;
|
|
995
|
+
}
|
|
996
|
+
if (!rowValue) {
|
|
997
|
+
return minValue;
|
|
998
|
+
}
|
|
999
|
+
if ((0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(minValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
|
|
1000
|
+
return minValue;
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
return rowValue;
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
done: (minValue, arr) => {
|
|
1007
|
+
if (minValue !== null) {
|
|
1008
|
+
return minValue;
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
},
|
|
1013
|
+
},
|
|
1014
|
+
rowFilterFn: context.filterFn,
|
|
1015
|
+
getRowNodes: context.getRowNodes,
|
|
1016
|
+
};
|
|
1017
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
1018
|
+
const result = {
|
|
1019
|
+
name: 'YOUNGEST',
|
|
1020
|
+
type: 'aggregationScalar',
|
|
1021
|
+
value: aggregationExpressionEvaluation,
|
|
1022
|
+
};
|
|
1023
|
+
return result;
|
|
1024
|
+
},
|
|
1025
|
+
description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
|
|
1026
|
+
signatures: [
|
|
1027
|
+
'YOUNGEST( [colName] )',
|
|
1028
|
+
'YOUNGEST( COL(name: string))',
|
|
1029
|
+
'YOUNGEST( [colNameA], GROUP_BY( [colNameB] ))',
|
|
1030
|
+
'YOUNGEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
1031
|
+
],
|
|
1032
|
+
examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
|
|
1033
|
+
category: 'aggregation',
|
|
1034
|
+
inputs: ['date'],
|
|
1035
|
+
},
|
|
608
1036
|
};
|
|
609
1037
|
const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, context) => {
|
|
610
1038
|
const aggregationEvaluation = aggregationParameter.value;
|
|
@@ -748,6 +1176,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
748
1176
|
},
|
|
749
1177
|
rowValueGetter,
|
|
750
1178
|
rowFilterFn: aggregationEvaluation.rowFilterFn,
|
|
1179
|
+
getRowNodes: context.getRowNodes,
|
|
751
1180
|
};
|
|
752
1181
|
return cumulationExpressionEvaluation;
|
|
753
1182
|
};
|
|
@@ -279,10 +279,10 @@ const isLastElementMinValue = (values) => {
|
|
|
279
279
|
};
|
|
280
280
|
// useful for functions which do NOT have an initial change (ex. GRID_CHANGE NONE)
|
|
281
281
|
const getDataChangedInfoStub = (context) => {
|
|
282
|
-
var _a;
|
|
282
|
+
var _a, _b;
|
|
283
283
|
let rowNodeStub;
|
|
284
284
|
if (!context.filterFn) {
|
|
285
|
-
rowNodeStub = context.adaptableApi.gridApi.getFirstRowNode();
|
|
285
|
+
rowNodeStub = (_a = context.node) !== null && _a !== void 0 ? _a : context.adaptableApi.gridApi.getFirstRowNode();
|
|
286
286
|
}
|
|
287
287
|
else {
|
|
288
288
|
// if there is a WHERE clause defined, find the first rowNode which satisfies the condition
|
|
@@ -297,7 +297,7 @@ const getDataChangedInfoStub = (context) => {
|
|
|
297
297
|
const rowNode = rowNodeStub;
|
|
298
298
|
if (rowNode) {
|
|
299
299
|
const primaryKeyValue = context.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
|
|
300
|
-
const columnId = (
|
|
300
|
+
const columnId = (_b = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _b === void 0 ? void 0 : _b.columnId;
|
|
301
301
|
const oldValue = context.adaptableApi.gridApi.getCellRawValue(primaryKeyValue, columnId);
|
|
302
302
|
const column = context.adaptableApi.columnApi.getColumnWithColumnId(columnId);
|
|
303
303
|
const newValue = oldValue;
|
|
@@ -11,7 +11,7 @@ function aggregate(aggregateParams, data) {
|
|
|
11
11
|
const deepMap = new deepMap_1.DeepMap();
|
|
12
12
|
let currentGroupKeys = [];
|
|
13
13
|
const getInitialReducerValue = () => {
|
|
14
|
-
return
|
|
14
|
+
return structuredClone(initReducers(reducers));
|
|
15
15
|
};
|
|
16
16
|
const globalReducerResults = getInitialReducerValue();
|
|
17
17
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
@@ -2,6 +2,6 @@ import { ExpressionFunction } from '../../parser/src/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* List of all the Scalar Functions available in AdaptableQL
|
|
4
4
|
*/
|
|
5
|
-
export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
|
|
5
|
+
export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'FIELD' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
|
|
6
6
|
export declare const scalarExpressionFunctions: Record<ScalarFunctionName, ExpressionFunction>;
|
|
7
7
|
export declare const scalarExpressionFunctionNames: ScalarFunctionName[];
|
|
@@ -72,6 +72,21 @@ exports.scalarExpressionFunctions = {
|
|
|
72
72
|
category: 'special',
|
|
73
73
|
returnType: 'any',
|
|
74
74
|
},
|
|
75
|
+
FIELD: {
|
|
76
|
+
handler(args, context) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const fieldName = args[0];
|
|
79
|
+
if (StringExtensions_1.default.IsNullOrEmpty(fieldName)) {
|
|
80
|
+
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('FIELD', 'requires a field name');
|
|
81
|
+
}
|
|
82
|
+
return (_a = context.adaptableApi) === null || _a === void 0 ? void 0 : _a.internalApi.getValueUsingField((_b = context.node) === null || _b === void 0 ? void 0 : _b.data, fieldName);
|
|
83
|
+
},
|
|
84
|
+
description: 'Returns the value of a row field (not necessarily mapped to a column). If the field is nested, use dot notation (e.g. "nested.fieldName")',
|
|
85
|
+
signatures: ['FIELD(fieldName:string)'],
|
|
86
|
+
examples: ['FIELD("fieldName")', 'FIELD("nested.fieldName")'],
|
|
87
|
+
category: 'special',
|
|
88
|
+
returnType: 'any',
|
|
89
|
+
},
|
|
75
90
|
QUERY: {
|
|
76
91
|
handler(args, context) {
|
|
77
92
|
var _a, _b;
|
|
@@ -32,6 +32,7 @@ export declare function sortCellValueArrayNumeric(cellValues: GridCell[], sortOr
|
|
|
32
32
|
export declare function sortCellValueArrayDates(cellValues: GridCell[], sortOrder?: SortOrder): GridCell[];
|
|
33
33
|
export declare function groupArrayBy(array: Array<any>, prop: string): Array<any>;
|
|
34
34
|
export declare function createCommaSeparatedString(values: any[]): string;
|
|
35
|
+
export declare function SumArray(array: (number | undefined)[]): number;
|
|
35
36
|
export declare const ArrayExtensions: {
|
|
36
37
|
GetLength: typeof GetLength;
|
|
37
38
|
CorrectLength: typeof CorrectLength;
|
|
@@ -65,5 +66,6 @@ export declare const ArrayExtensions: {
|
|
|
65
66
|
sortCellValueArrayDates: typeof sortCellValueArrayDates;
|
|
66
67
|
sortArrayWithProperty: typeof sortArrayWithProperty;
|
|
67
68
|
createCommaSeparatedString: typeof createCommaSeparatedString;
|
|
69
|
+
SumArray: typeof SumArray;
|
|
68
70
|
};
|
|
69
71
|
export default ArrayExtensions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArrayExtensions = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
|
|
3
|
+
exports.ArrayExtensions = exports.SumArray = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
|
|
4
4
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
5
|
function GetLength(arrayToCheck) {
|
|
6
6
|
return IsNotNull(arrayToCheck) ? arrayToCheck.length : 0;
|
|
@@ -289,6 +289,10 @@ function createCommaSeparatedString(values) {
|
|
|
289
289
|
return values.join(', ');
|
|
290
290
|
}
|
|
291
291
|
exports.createCommaSeparatedString = createCommaSeparatedString;
|
|
292
|
+
function SumArray(array) {
|
|
293
|
+
return array.filter((num) => typeof num === 'number' && !isNaN(num)).reduce((a, b) => a + b, 0);
|
|
294
|
+
}
|
|
295
|
+
exports.SumArray = SumArray;
|
|
292
296
|
exports.ArrayExtensions = {
|
|
293
297
|
GetLength,
|
|
294
298
|
CorrectLength,
|
|
@@ -322,5 +326,6 @@ exports.ArrayExtensions = {
|
|
|
322
326
|
sortCellValueArrayDates,
|
|
323
327
|
sortArrayWithProperty,
|
|
324
328
|
createCommaSeparatedString,
|
|
329
|
+
SumArray,
|
|
325
330
|
};
|
|
326
331
|
exports.default = exports.ArrayExtensions;
|