@adaptabletools/adaptable 20.3.0-canary.2 → 21.0.0-canary.0
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 +2 -1
- package/agGrid.js +2 -1
- package/base.css +36 -15
- package/base.css.map +1 -1
- package/icons/add-circle.svg +1 -0
- package/icons/add.svg +1 -0
- package/icons/alert.svg +1 -0
- package/icons/align-center.svg +1 -0
- package/icons/align-justify.svg +1 -0
- package/icons/align-left.svg +1 -0
- package/icons/align-right.svg +1 -0
- package/icons/arrow-down-long.svg +1 -0
- package/icons/arrow-down.svg +1 -0
- package/icons/arrow-expand.svg +1 -0
- package/icons/arrow-left.svg +1 -0
- package/icons/arrow-right.svg +1 -0
- package/icons/arrow-up-long.svg +1 -0
- package/icons/arrow-up.svg +1 -0
- package/icons/assignment.svg +1 -0
- package/icons/badge.svg +1 -0
- package/icons/bold.svg +1 -0
- package/icons/boolean-list.svg +1 -0
- package/icons/brain.svg +1 -0
- package/icons/broadcast.svg +1 -0
- package/icons/brush.svg +1 -0
- package/icons/building.svg +1 -0
- package/icons/calculated-column.svg +1 -0
- package/icons/calendar.svg +1 -0
- package/icons/call.svg +1 -0
- package/icons/case-lower.svg +1 -0
- package/icons/case-sentence.svg +1 -0
- package/icons/case-upper.svg +1 -0
- package/icons/cells.svg +1 -0
- package/icons/chart.svg +1 -0
- package/icons/chat.svg +1 -0
- package/icons/check-circle.svg +1 -0
- package/icons/check.svg +1 -0
- package/icons/checked.svg +1 -0
- package/icons/clipboard.svg +1 -0
- package/icons/clone.svg +1 -0
- package/icons/close.svg +1 -0
- package/icons/cloud-upload.svg +1 -0
- package/icons/collapse-all.svg +1 -0
- package/icons/collapse.svg +1 -0
- package/icons/color-palette.svg +1 -0
- package/icons/column-add.svg +1 -0
- package/icons/column-outline.svg +1 -0
- package/icons/columns.svg +1 -0
- package/icons/comment.svg +1 -0
- package/icons/comments.svg +1 -0
- package/icons/contact.svg +1 -0
- package/icons/contains.svg +1 -0
- package/icons/copy.svg +1 -0
- package/icons/csv.svg +1 -0
- package/icons/dashboard.svg +1 -0
- package/icons/data-set.svg +1 -0
- package/icons/date-range.svg +1 -0
- package/icons/delete.svg +1 -0
- package/icons/division.svg +1 -0
- package/icons/dock.svg +1 -0
- package/icons/dollar.svg +1 -0
- package/icons/download.svg +1 -0
- package/icons/downloaded.svg +1 -0
- package/icons/drag.svg +1 -0
- package/icons/edit-table.svg +1 -0
- package/icons/edit.svg +1 -0
- package/icons/ends-with.svg +1 -0
- package/icons/equals.svg +1 -0
- package/icons/equation.svg +1 -0
- package/icons/error.svg +1 -0
- package/icons/excel.svg +1 -0
- package/icons/expand-all.svg +1 -0
- package/icons/expand.svg +1 -0
- package/icons/exponent.svg +1 -0
- package/icons/export-data.svg +1 -0
- package/icons/export.svg +1 -0
- package/icons/fast-backward.svg +1 -0
- package/icons/fast-forward.svg +1 -0
- package/icons/fdc3.svg +1 -0
- package/icons/filled-circle.svg +1 -0
- package/icons/filter-list.svg +1 -0
- package/icons/filter-off.svg +1 -0
- package/icons/filter.svg +1 -0
- package/icons/flag.svg +1 -0
- package/icons/folder-open.svg +1 -0
- package/icons/folder-shared.svg +1 -0
- package/icons/folder.svg +1 -0
- package/icons/function.svg +1 -0
- package/icons/gradient.svg +1 -0
- package/icons/greater-than-or-equal.svg +1 -0
- package/icons/greater-than.svg +1 -0
- package/icons/grid-filter.svg +1 -0
- package/icons/grid-info.svg +1 -0
- package/icons/grid.svg +1 -0
- package/icons/history.svg +1 -0
- package/icons/home.svg +1 -0
- package/icons/horizontal-lines.svg +1 -0
- package/icons/import-export.svg +1 -0
- package/icons/import.svg +1 -0
- package/icons/info.svg +1 -0
- package/icons/interactions.svg +1 -0
- package/icons/italic.svg +1 -0
- package/icons/json.svg +1 -0
- package/icons/laptop.svg +1 -0
- package/icons/less-than-or-equal.svg +1 -0
- package/icons/less-than.svg +1 -0
- package/icons/lightning.svg +1 -0
- package/icons/link.svg +1 -0
- package/icons/list.svg +1 -0
- package/icons/logout.svg +1 -0
- package/icons/mail.svg +1 -0
- package/icons/menu.svg +1 -0
- package/icons/minus.svg +1 -0
- package/icons/money.svg +1 -0
- package/icons/multiplication.svg +1 -0
- package/icons/newpage.svg +1 -0
- package/icons/news.svg +1 -0
- package/icons/not-contains.svg +1 -0
- package/icons/not-equal.svg +1 -0
- package/icons/note.svg +1 -0
- package/icons/open-in-new.svg +1 -0
- package/icons/order.svg +1 -0
- package/icons/organisation.svg +1 -0
- package/icons/overline.svg +1 -0
- package/icons/paperclip.svg +1 -0
- package/icons/pause.svg +1 -0
- package/icons/percent-tag.svg +1 -0
- package/icons/percent.svg +1 -0
- package/icons/person.svg +1 -0
- package/icons/pie-chart.svg +1 -0
- package/icons/play.svg +1 -0
- package/icons/plus.svg +1 -0
- package/icons/quote.svg +1 -0
- package/icons/refresh.svg +1 -0
- package/icons/regex.svg +1 -0
- package/icons/reminder.svg +1 -0
- package/icons/resume.svg +1 -0
- package/icons/rows.svg +1 -0
- package/icons/save.svg +1 -0
- package/icons/schedule.svg +1 -0
- package/icons/science.svg +1 -0
- package/icons/search-table.svg +1 -0
- package/icons/search.svg +1 -0
- package/icons/select-all.svg +1 -0
- package/icons/select-fwd.svg +1 -0
- package/icons/select-off.svg +1 -0
- package/icons/settings.svg +1 -0
- package/icons/sort-asc.svg +1 -0
- package/icons/sort-desc.svg +1 -0
- package/icons/spanner.svg +1 -0
- package/icons/spark-line.svg +1 -0
- package/icons/starts-with.svg +1 -0
- package/icons/statusbar.svg +1 -0
- package/icons/stop.svg +1 -0
- package/icons/strikethrough.svg +1 -0
- package/icons/styled-grid.svg +1 -0
- package/icons/sync.svg +1 -0
- package/icons/tab-unselected.svg +1 -0
- package/icons/target.svg +1 -0
- package/icons/theme.svg +1 -0
- package/icons/traffic-lights.svg +1 -0
- package/icons/triangle-down.svg +1 -0
- package/icons/triangle-up.svg +1 -0
- package/icons/unchecked.svg +1 -0
- package/icons/underline.svg +1 -0
- package/icons/undo.svg +1 -0
- package/icons/unfilled-circle.svg +1 -0
- package/icons/upload.svg +1 -0
- package/icons/visibility-off-bold.svg +1 -0
- package/icons/visibility-off.svg +1 -0
- package/icons/visibility-on-bold.svg +1 -0
- package/icons/visibility-on.svg +1 -0
- package/icons/warning.svg +1 -0
- package/index.css +32 -15
- package/index.css.map +1 -1
- package/package.json +2 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +10 -5
- package/src/AdaptableOptions/ColumnOptions.d.ts +71 -187
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +3 -2
- package/src/AdaptableOptions/EditOptions.d.ts +4 -7
- package/src/AdaptableOptions/FilterOptions.d.ts +50 -15
- package/src/AdaptableOptions/LayoutOptions.d.ts +8 -21
- package/src/AdaptableOptions/PredicateOptions.d.ts +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +7 -0
- package/src/AdaptableState/Common/AdaptablePredicate.js +2 -2
- package/src/AdaptableState/Common/CustomWindowConfig.d.ts +11 -11
- package/src/AdaptableState/Common/ExtendedLayout.d.ts +50 -0
- package/src/AdaptableState/Common/ProgressIndicatorConfig.d.ts +1 -4
- package/src/AdaptableState/Common/RowScope.d.ts +1 -1
- package/src/AdaptableState/FormatColumnState.d.ts +16 -9
- package/src/AdaptableState/InternalState.d.ts +1 -1
- package/src/AdaptableState/LayoutState.d.ts +26 -6
- package/src/AdaptableState/Selection/GridCell.d.ts +32 -0
- package/src/AdaptableState/StyledColumnState.d.ts +2 -2
- package/src/Api/AlertApi.d.ts +5 -11
- package/src/Api/ColumnApi.d.ts +17 -1
- package/src/Api/ColumnFilterApi.d.ts +32 -2
- package/src/Api/CustomSortApi.d.ts +5 -10
- package/src/Api/FlashingCellApi.d.ts +10 -6
- package/src/Api/FormatColumnApi.d.ts +8 -18
- package/src/Api/Implementation/AlertApiImpl.d.ts +6 -9
- package/src/Api/Implementation/AlertApiImpl.js +7 -6
- package/src/Api/Implementation/ApiBase.d.ts +2 -12
- package/src/Api/Implementation/ApiBase.js +5 -5
- package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -2
- package/src/Api/Implementation/ColumnApiImpl.js +59 -23
- package/src/Api/Implementation/ColumnFilterApiImpl.d.ts +7 -1
- package/src/Api/Implementation/ColumnFilterApiImpl.js +76 -3
- package/src/Api/Implementation/ColumnScopeApiImpl.js +10 -2
- package/src/Api/Implementation/CustomSortApiImpl.d.ts +5 -10
- package/src/Api/Implementation/CustomSortApiImpl.js +6 -4
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +7 -6
- package/src/Api/Implementation/FlashingCellApiImpl.js +11 -8
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +8 -18
- package/src/Api/Implementation/FormatColumnApiImpl.js +10 -9
- package/src/Api/Implementation/LayoutApiImpl.d.ts +3 -2
- package/src/Api/Implementation/LayoutApiImpl.js +101 -7
- package/src/Api/Implementation/LayoutHelpers.d.ts +1 -0
- package/src/Api/Implementation/LayoutHelpers.js +23 -4
- package/src/Api/Implementation/PlusMinusApiImpl.d.ts +7 -5
- package/src/Api/Implementation/PlusMinusApiImpl.js +10 -7
- package/src/Api/Implementation/ScheduleApiImpl.d.ts +9 -16
- package/src/Api/Implementation/ScheduleApiImpl.js +15 -17
- package/src/Api/Implementation/ShortcutApiImpl.d.ts +5 -6
- package/src/Api/Implementation/ShortcutApiImpl.js +7 -8
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +7 -8
- package/src/Api/Implementation/StyledColumnApiImpl.js +12 -9
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -4
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +10 -9
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -0
- package/src/Api/Internal/AdaptableInternalApi.js +3 -0
- package/src/Api/Internal/AlertInternalApi.d.ts +6 -6
- package/src/Api/Internal/AlertInternalApi.js +10 -10
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +13 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +93 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +2 -1
- package/src/Api/Internal/ColumnInternalApi.js +6 -2
- package/src/Api/Internal/DashboardInternalApi.js +1 -1
- package/src/Api/Internal/EntitlementInternalApi.d.ts +1 -0
- package/src/Api/Internal/EntitlementInternalApi.js +8 -0
- package/src/Api/Internal/ExportInternalApi.js +1 -1
- package/src/Api/Internal/FlashingCellInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +12 -13
- package/src/Api/Internal/FormatColumnInternalApi.js +45 -16
- package/src/Api/Internal/GridInternalApi.d.ts +7 -10
- package/src/Api/Internal/GridInternalApi.js +76 -27
- package/src/Api/Internal/LayoutInternalApi.d.ts +5 -5
- package/src/Api/Internal/LayoutInternalApi.js +42 -5
- package/src/Api/Internal/PredicateInternalApi.d.ts +2 -6
- package/src/Api/Internal/PredicateInternalApi.js +4 -6
- package/src/Api/Internal/UserInterfaceInternalApi.d.ts +1 -0
- package/src/Api/Internal/UserInterfaceInternalApi.js +10 -3
- package/src/Api/LayoutApi.d.ts +7 -2
- package/src/Api/PlusMinusApi.d.ts +11 -7
- package/src/Api/ScheduleApi.d.ts +9 -16
- package/src/Api/ShortcutApi.d.ts +5 -6
- package/src/Api/StyledColumnApi.d.ts +10 -7
- package/src/Api/UserInterfaceApi.d.ts +5 -6
- package/src/Redux/ActionsReducers/InternalRedux.d.ts +4 -4
- package/src/Redux/ActionsReducers/InternalRedux.js +7 -7
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +7 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +13 -0
- package/src/Redux/Store/AdaptableStore.js +10 -10
- package/src/Strategy/AdaptableModuleBase.d.ts +14 -4
- package/src/Strategy/AdaptableModuleBase.js +46 -9
- package/src/Strategy/AlertModule.d.ts +3 -4
- package/src/Strategy/AlertModule.js +7 -4
- package/src/Strategy/CalculatedColumnModule.js +2 -2
- package/src/Strategy/CellSummaryModule.js +2 -2
- package/src/Strategy/ChartingModule.d.ts +3 -1
- package/src/Strategy/ChartingModule.js +9 -3
- package/src/Strategy/ColumnFilterModule.d.ts +1 -1
- package/src/Strategy/ColumnFilterModule.js +31 -15
- package/src/Strategy/ColumnInfoModule.js +2 -2
- package/src/Strategy/CommentModule.d.ts +1 -1
- package/src/Strategy/CommentModule.js +3 -3
- package/src/Strategy/CustomSortModule.d.ts +3 -4
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/DashboardModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.d.ts +2 -1
- package/src/Strategy/DataChangeHistoryModule.js +3 -10
- package/src/Strategy/DataImportModule.js +3 -3
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/Fdc3Module.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +3 -5
- package/src/Strategy/FlashingCellModule.js +3 -3
- package/src/Strategy/FormatColumnModule.d.ts +3 -4
- package/src/Strategy/FormatColumnModule.js +4 -2
- package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
- package/src/Strategy/FreeTextColumnModule.js +2 -2
- package/src/Strategy/GridInfoModule.js +2 -2
- package/src/Strategy/Interface/IModule.d.ts +7 -3
- package/src/Strategy/LayoutModule.js +11 -11
- package/src/Strategy/NoteModule.d.ts +1 -1
- package/src/Strategy/NoteModule.js +3 -3
- package/src/Strategy/PlusMinusModule.d.ts +3 -4
- package/src/Strategy/PlusMinusModule.js +2 -2
- package/src/Strategy/QuickSearchModule.d.ts +2 -0
- package/src/Strategy/QuickSearchModule.js +9 -0
- package/src/Strategy/ScheduleModule.d.ts +3 -4
- package/src/Strategy/ScheduleModule.js +2 -2
- package/src/Strategy/SettingsPanelModule.js +1 -1
- package/src/Strategy/ShortcutModule.d.ts +3 -4
- package/src/Strategy/ShortcutModule.js +2 -2
- package/src/Strategy/StatusBarModule.d.ts +3 -2
- package/src/Strategy/StatusBarModule.js +6 -3
- package/src/Strategy/StyledColumnModule.d.ts +3 -4
- package/src/Strategy/StyledColumnModule.js +2 -2
- package/src/Strategy/SystemStatusModule.js +2 -2
- package/src/Strategy/TeamSharingModule.d.ts +1 -1
- package/src/Strategy/TeamSharingModule.js +5 -2
- package/src/Strategy/ToolPanelModule.d.ts +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -4
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.d.ts +5 -0
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +12 -0
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +1 -1
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +15 -2
- package/src/Utilities/Extensions/ArrayExtensions.js +62 -13
- package/src/Utilities/ObjectFactory.js +3 -2
- package/src/Utilities/Services/AnnotationsService.js +1 -1
- package/src/Utilities/Services/Interface/IModuleService.d.ts +2 -1
- package/src/Utilities/Services/ModuleService.d.ts +3 -3
- package/src/Utilities/Services/ModuleService.js +19 -7
- package/src/Utilities/getScopeViewItems.js +5 -2
- package/src/View/AdaptableView.js +3 -1
- package/src/View/ColumnInfo/ColumnInfo.js +9 -3
- package/src/View/Components/AdaptableIconSelector/index.js +2 -3
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.d.ts +0 -1
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +2 -3
- package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.d.ts +0 -2
- package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.js +4 -7
- package/src/View/Components/ColumnFilter/ColumnFilter.js +11 -4
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -2
- package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +2 -2
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +2 -2
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.d.ts +1 -1
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +2 -2
- package/src/View/Components/ColumnFilter/utils.d.ts +2 -2
- package/src/View/Components/ColumnFilter/utils.js +6 -1
- package/src/View/Components/EntityRulesEditor/index.js +1 -2
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
- package/src/View/Components/NewScopeComponent.js +5 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +6 -6
- package/src/View/Components/PredicateEditor/PredicateEditor.js +1 -2
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +1 -1
- package/src/View/Components/Selectors/ColumnSelector.js +1 -1
- package/src/View/Components/Selectors/FieldSelector.js +1 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.d.ts +1 -0
- package/src/View/Components/Selectors/PermittedValuesSelector.js +2 -2
- package/src/View/Dashboard/Dashboard.js +2 -2
- package/src/View/Dashboard/DashboardPopup.js +3 -1
- package/src/View/Dashboard/PinnedDashboard.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +9 -21
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +59 -22
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -40
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +13 -12
- package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.d.ts +8 -0
- package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.js +31 -0
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +18 -4
- package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +1 -1
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -1
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +64 -9
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +5 -5
- package/src/View/StatusBar/AdaptableStatusBar.js +1 -4
- package/src/View/StatusBar/StatusBarPopup.js +1 -1
- package/src/View/Theme/ThemeSelector.js +1 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +11 -7
- package/src/agGrid/AdaptableAgGrid.js +256 -218
- package/src/agGrid/AdaptableFilterHandler.d.ts +18 -0
- package/src/agGrid/AdaptableFilterHandler.js +61 -0
- package/src/agGrid/AgGridAdapter.d.ts +3 -7
- package/src/agGrid/AgGridAdapter.js +13 -46
- package/src/agGrid/AgGridColumnAdapter.d.ts +3 -3
- package/src/agGrid/AgGridColumnAdapter.js +86 -40
- package/src/agGrid/AgGridExportAdapter.js +1 -1
- package/src/agGrid/AgGridFilterAdapter.d.ts +2 -0
- package/src/agGrid/AgGridFilterAdapter.js +48 -0
- package/src/agGrid/AgGridFloatingFilterAdapter.d.ts +2 -0
- package/src/agGrid/{FloatingFilterWrapper.js → AgGridFloatingFilterAdapter.js} +24 -35
- package/src/agGrid/AgGridModulesAdapter.d.ts +15 -0
- package/src/agGrid/AgGridModulesAdapter.js +66 -0
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.js +1 -1
- package/src/components/Dialog/index.js +1 -1
- package/src/components/Dropdown/Arrows.js +2 -2
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +1 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +2 -2
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -2
- package/src/components/FileDroppable/index.js +1 -1
- package/src/components/IconSelector/IconSelector.d.ts +2 -2
- package/src/components/OverlayTrigger/index.js +1 -1
- package/src/components/Select/Select.d.ts +1 -1
- package/src/components/Select/Select.js +116 -24
- package/src/components/icons/DefaultIcon.d.ts +0 -1
- package/src/components/icons/DefaultIcon.js +0 -6
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +6 -10
- package/src/layout-manager/src/index.d.ts +11 -3
- package/src/layout-manager/src/index.js +302 -87
- package/src/layout-manager/src/normalizeLayoutModel.js +7 -4
- package/src/layout-manager/src/simplifyLayoutModel.js +4 -4
- package/src/metamodel/adaptable.metamodel.d.ts +172 -20
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/AdaptableUpgradeHelper.js +2 -0
- package/src/migration/VersionUpgrade17.js +1 -1
- package/src/migration/VersionUpgrade20.js +1 -0
- package/src/migration/VersionUpgrade21.d.ts +6 -0
- package/src/migration/VersionUpgrade21.js +24 -0
- package/src/types.d.ts +8 -9
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/ExtendedLayoutInfo.d.ts +0 -27
- package/src/agGrid/FilterWrapper.d.ts +0 -2
- package/src/agGrid/FilterWrapper.js +0 -131
- package/src/agGrid/FloatingFilterWrapper.d.ts +0 -2
- package/src/agGrid/agGridModules.d.ts +0 -3
- package/src/agGrid/agGridModules.js +0 -15
- package/src/agGrid/getAgGridFilterNotifyModelFn.d.ts +0 -2
- package/src/agGrid/getAgGridFilterNotifyModelFn.js +0 -16
- /package/src/AdaptableState/Common/{ExtendedLayoutInfo.js → ExtendedLayout.js} +0 -0
|
@@ -42,11 +42,16 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
42
42
|
getTableLayoutModelFromGrid(): TableLayoutModel;
|
|
43
43
|
private isTreeMode;
|
|
44
44
|
getUndecidedLayoutModelFromGrid(columnState: ColumnState[]): TableLayoutModel | PivotLayoutModel;
|
|
45
|
-
static
|
|
45
|
+
static getColumnDefsChangesForLayout(layout: TableLayoutModel | PivotLayoutModel, colDefs: GridOptions['columnDefs']): GridOptions['columnDefs'] | null;
|
|
46
|
+
static getAGGridInitialStateForLayout(layout: TableLayoutModel | PivotLayoutModel, colDefs: GridOptions['columnDefs'], options: {
|
|
46
47
|
isTree: boolean;
|
|
48
|
+
colTypes: GridOptions['columnTypes'];
|
|
49
|
+
defaultColDef: GridOptions['defaultColDef'];
|
|
47
50
|
}): GridState;
|
|
48
51
|
static getAGGridInitialStateForTableLayout(layout: TableLayoutModel, colDefs: GridOptions['columnDefs'], _options?: {
|
|
49
|
-
isTree
|
|
52
|
+
isTree?: boolean;
|
|
53
|
+
colTypes?: GridOptions['columnTypes'];
|
|
54
|
+
defaultColDef?: GridOptions['defaultColDef'];
|
|
50
55
|
}): GridState;
|
|
51
56
|
static getAGGridInitialStateForPivotLayout(layout: PivotLayoutModel, colDefs: GridOptions['columnDefs']): GridState;
|
|
52
57
|
silentSetCurrentLayout(layout: TableLayoutModel | PivotLayoutModel, options?: {
|
|
@@ -60,6 +65,8 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
60
65
|
private suspendAgGridListener;
|
|
61
66
|
private resumeAgGridListener;
|
|
62
67
|
private applyLayout;
|
|
68
|
+
applyColumnDefsChanges(layout: TableLayoutModel | PivotLayoutModel): boolean;
|
|
69
|
+
private applyColumnSizingColumnDefsChanges;
|
|
63
70
|
private applyTableLayout;
|
|
64
71
|
private getRowGroupNodePathsAs;
|
|
65
72
|
applyRowGroupValues(RowGroupValues: TableLayoutModel['RowGroupValues'], rowGroupedColumns: string[]): void;
|
|
@@ -71,7 +78,7 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
71
78
|
private computeRowGrouping;
|
|
72
79
|
private computeColumnSorts;
|
|
73
80
|
private getDefaultColumnWidthForCol;
|
|
74
|
-
private
|
|
81
|
+
private computeColumnSizing;
|
|
75
82
|
private computeColumnOrderAndVisibility;
|
|
76
83
|
autoSizeColumns(columnIds?: string[]): false | string[];
|
|
77
84
|
private applyPivotLayout;
|
|
@@ -82,5 +89,6 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
82
89
|
private setupPivotTotals;
|
|
83
90
|
private patchPivotAggregationTotal;
|
|
84
91
|
private getPivotTotalColumnConfig;
|
|
92
|
+
private isInPivotMode;
|
|
85
93
|
}
|
|
86
94
|
export {};
|
|
@@ -13,6 +13,16 @@ export const PIVOT_ANY_TOTAL_COL_TYPE = 'pivotAnyTotal';
|
|
|
13
13
|
export const PIVOT_GRAND_TOTAL_COL_TYPE = 'pivotGrandTotal';
|
|
14
14
|
export const PIVOT_COLUMN_TOTAL_COL_TYPE = 'pivotColumnTotal';
|
|
15
15
|
export const PIVOT_AGGREGATION_TOTAL_COL_TYPE = 'pivotAggregationTotal';
|
|
16
|
+
function mapColDefs(colDefs, mapFn) {
|
|
17
|
+
const iteration = (c) => {
|
|
18
|
+
if (c.children) {
|
|
19
|
+
return { ...c, children: mapColDefs(c.children, mapFn) };
|
|
20
|
+
}
|
|
21
|
+
const colDef = c;
|
|
22
|
+
return mapFn(colDef);
|
|
23
|
+
};
|
|
24
|
+
return colDefs.map(iteration);
|
|
25
|
+
}
|
|
16
26
|
function flattenColDefs(colDefs) {
|
|
17
27
|
const res = [];
|
|
18
28
|
const iteration = (c) => {
|
|
@@ -26,6 +36,25 @@ function flattenColDefs(colDefs) {
|
|
|
26
36
|
colDefs.forEach(iteration);
|
|
27
37
|
return res;
|
|
28
38
|
}
|
|
39
|
+
function findInColDefs(colDefs, callback) {
|
|
40
|
+
function iteration(colDefs) {
|
|
41
|
+
for (const c of colDefs) {
|
|
42
|
+
if (c.children) {
|
|
43
|
+
const res = iteration(c.children);
|
|
44
|
+
if (res) {
|
|
45
|
+
return res;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const colDef = c;
|
|
50
|
+
if (callback(colDef)) {
|
|
51
|
+
return colDef;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return iteration(colDefs);
|
|
57
|
+
}
|
|
29
58
|
const DEFAULT_COLUMN_WIDTH = 200;
|
|
30
59
|
const DEFAULT_AGG_FUNC = 'sum';
|
|
31
60
|
/**
|
|
@@ -67,6 +96,47 @@ function isGridLayoutSame(options) {
|
|
|
67
96
|
}
|
|
68
97
|
return isLayoutEqual(gridLayout, layout);
|
|
69
98
|
}
|
|
99
|
+
function getDefaultColumnSizeStateForColDef(colId, colDef, options) {
|
|
100
|
+
if (!colDef) {
|
|
101
|
+
colDef = findInColDefs(options?.columnDefs || [], (colDef) => colDef.colId ? colDef.colId === colId : colDef.field === colId);
|
|
102
|
+
if (!colDef) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
let propsFromColType = {
|
|
107
|
+
...options?.defaultColDef,
|
|
108
|
+
};
|
|
109
|
+
if (options?.colTypes) {
|
|
110
|
+
// for col sizing, we want the columns sized as flex via col.type and defaultColDef
|
|
111
|
+
// to be sized as flex, even if they are not in the layout.ColumnSizing object
|
|
112
|
+
let colType = colDef?.type;
|
|
113
|
+
if (colType && !Array.isArray(colType)) {
|
|
114
|
+
colType = colType.split(',');
|
|
115
|
+
}
|
|
116
|
+
if (Array.isArray(colType) && colType.length) {
|
|
117
|
+
propsFromColType = colType.reduce((acc, type) => {
|
|
118
|
+
const props = options.colTypes[type];
|
|
119
|
+
if (props) {
|
|
120
|
+
return { ...acc, ...props };
|
|
121
|
+
}
|
|
122
|
+
return acc;
|
|
123
|
+
}, {});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (propsFromColType.flex) {
|
|
127
|
+
return {
|
|
128
|
+
colId,
|
|
129
|
+
flex: propsFromColType.flex,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (propsFromColType.width) {
|
|
133
|
+
return {
|
|
134
|
+
colId,
|
|
135
|
+
width: propsFromColType.width,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
70
140
|
export class LayoutManager extends LMEmitter {
|
|
71
141
|
constructor(options) {
|
|
72
142
|
super({ debugId: options.debugId });
|
|
@@ -111,6 +181,9 @@ export class LayoutManager extends LMEmitter {
|
|
|
111
181
|
}
|
|
112
182
|
};
|
|
113
183
|
this.columnDefsChanged = (colDefs) => {
|
|
184
|
+
if (this.suppressGlobalAgGridEventListener) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
114
187
|
this.warn('onColumnDefsChanged');
|
|
115
188
|
this.indexColumns();
|
|
116
189
|
if (this.currentLayout) {
|
|
@@ -194,7 +267,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
194
267
|
// this.initialColumnWidths[colId] = colDef.width ?? colDef.initialWidth ?? DEFAULT_COLUMN_WIDTH; // this.gridApi.getColumn(colId).getActualWidth();
|
|
195
268
|
// this.initialColumnWidths[colId] = col.getActualWidth();
|
|
196
269
|
this.initialColumnWidths[colId] = this.getDefaultColumnWidthForCol(colId, colDef);
|
|
197
|
-
const rowGroupColumns = this.gridApi.getRowGroupColumns();
|
|
270
|
+
const rowGroupColumns = this.gridApi.getRowGroupColumns() ?? [];
|
|
198
271
|
rowGroupColumns.forEach((column) => {
|
|
199
272
|
const colId = column.getColId();
|
|
200
273
|
// const col = this.gridApi.getColumn(colId);
|
|
@@ -253,7 +326,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
253
326
|
this.gridApi = options.gridApi;
|
|
254
327
|
}
|
|
255
328
|
getLayoutModelFromGrid() {
|
|
256
|
-
return this.
|
|
329
|
+
return this.isInPivotMode()
|
|
257
330
|
? this.getPivotLayoutModelFromGrid()
|
|
258
331
|
: this.getTableLayoutModelFromGrid();
|
|
259
332
|
}
|
|
@@ -266,13 +339,15 @@ export class LayoutManager extends LMEmitter {
|
|
|
266
339
|
.filter((col) => !pivotResultColumnsSet.has(col.colId));
|
|
267
340
|
let PivotColumns = this.gridApi.getPivotColumns().map((col) => col.getColId());
|
|
268
341
|
const layout = this.getUndecidedLayoutModelFromGrid(columnState);
|
|
269
|
-
let
|
|
342
|
+
let ColumnSizing = layout.ColumnSizing || {};
|
|
270
343
|
//let's also include the column widths of the pivotResult columns
|
|
271
344
|
pivotResultColumns.forEach((col) => {
|
|
272
|
-
|
|
345
|
+
ColumnSizing[col.getColId()] = {
|
|
346
|
+
Width: col.getActualWidth(),
|
|
347
|
+
};
|
|
273
348
|
});
|
|
274
|
-
if (!Object.keys(
|
|
275
|
-
|
|
349
|
+
if (!Object.keys(ColumnSizing).length) {
|
|
350
|
+
ColumnSizing = undefined;
|
|
276
351
|
}
|
|
277
352
|
delete layout.TableColumns;
|
|
278
353
|
const pivotLayout = {
|
|
@@ -290,7 +365,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
290
365
|
PivotColumns,
|
|
291
366
|
ColumnPinning: layout.ColumnPinning,
|
|
292
367
|
ColumnSorts: layout.ColumnSorts,
|
|
293
|
-
|
|
368
|
+
ColumnSizing,
|
|
294
369
|
ColumnVisibility: layout.ColumnVisibility,
|
|
295
370
|
RowGroupValues: layout.RowGroupValues,
|
|
296
371
|
ColumnGroupValues: layout.ColumnGroupValues,
|
|
@@ -321,7 +396,6 @@ export class LayoutManager extends LMEmitter {
|
|
|
321
396
|
getUndecidedLayoutModelFromGrid(columnState) {
|
|
322
397
|
let TableColumns = columnState.map((c) => c.colId);
|
|
323
398
|
// .filter((colId) => colId !== 'ag-Grid-SelectionColumn');
|
|
324
|
-
let ColumnWidths = {};
|
|
325
399
|
let ColumnSorts = [];
|
|
326
400
|
let RowGroupedColumns = [];
|
|
327
401
|
let RowGroupValues = undefined;
|
|
@@ -331,6 +405,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
331
405
|
const gridState = this.gridApi.getState();
|
|
332
406
|
const prevLayout = this.currentLayout;
|
|
333
407
|
const prevAggColumns = prevLayout?.TableAggregationColumns ?? prevLayout?.PivotAggregationColumns;
|
|
408
|
+
let ColumnSizing = { ...prevLayout?.ColumnSizing };
|
|
334
409
|
const prevAggColumnsMap = prevAggColumns?.reduce((acc, agg) => {
|
|
335
410
|
acc[agg.ColumnId] = agg;
|
|
336
411
|
return acc;
|
|
@@ -353,10 +428,19 @@ export class LayoutManager extends LMEmitter {
|
|
|
353
428
|
this.initialColumnWidths[colId.replace(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, '')];
|
|
354
429
|
}
|
|
355
430
|
}
|
|
356
|
-
|
|
431
|
+
if (colState.flex != undefined) {
|
|
432
|
+
const colSizing = { ...ColumnSizing[colId] };
|
|
433
|
+
delete colSizing.Width;
|
|
434
|
+
colSizing.Flex = colState.flex;
|
|
435
|
+
ColumnSizing[colId] = colSizing;
|
|
436
|
+
}
|
|
437
|
+
// and only add the col width to the layout ColumnSizing
|
|
357
438
|
// if it's different from the initial default column width
|
|
358
|
-
if (colState.width && initialWidth != colState.width) {
|
|
359
|
-
|
|
439
|
+
else if (colState.width && initialWidth != colState.width) {
|
|
440
|
+
const colSizing = { ...ColumnSizing[colId] };
|
|
441
|
+
delete colSizing.Flex;
|
|
442
|
+
colSizing.Width = colState.width;
|
|
443
|
+
ColumnSizing[colId] = colSizing;
|
|
360
444
|
}
|
|
361
445
|
if (colState.hide) {
|
|
362
446
|
acc[colId] = false;
|
|
@@ -438,9 +522,9 @@ export class LayoutManager extends LMEmitter {
|
|
|
438
522
|
return col.isVisible();
|
|
439
523
|
});
|
|
440
524
|
const columnOrderSet = new Set(TableColumns);
|
|
441
|
-
Object.keys(
|
|
525
|
+
Object.keys(ColumnSizing).forEach((colId) => {
|
|
442
526
|
if (!columnOrderSet.has(colId)) {
|
|
443
|
-
delete
|
|
527
|
+
delete ColumnSizing[colId];
|
|
444
528
|
}
|
|
445
529
|
});
|
|
446
530
|
Object.keys(ColumnVisibility).forEach((colId) => {
|
|
@@ -608,7 +692,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
608
692
|
Ignore_Uuid: this.currentLayout?.Ignore_Uuid,
|
|
609
693
|
TableColumns: TableColumns,
|
|
610
694
|
ColumnVisibility,
|
|
611
|
-
|
|
695
|
+
ColumnSizing,
|
|
612
696
|
ColumnSorts,
|
|
613
697
|
RowGroupedColumns,
|
|
614
698
|
TableAggregationColumns,
|
|
@@ -620,6 +704,54 @@ export class LayoutManager extends LMEmitter {
|
|
|
620
704
|
});
|
|
621
705
|
return layout;
|
|
622
706
|
}
|
|
707
|
+
static getColumnDefsChangesForLayout(layout, colDefs) {
|
|
708
|
+
const columnSizing = layout.ColumnSizing || {};
|
|
709
|
+
const flatColDefs = flattenColDefs(colDefs);
|
|
710
|
+
const changedColDefs = new Map();
|
|
711
|
+
flatColDefs.forEach((colDef) => {
|
|
712
|
+
const colId = colDef.colId ?? colDef.field;
|
|
713
|
+
const colSizing = columnSizing[colId] || {};
|
|
714
|
+
if (colDef) {
|
|
715
|
+
let changed = false;
|
|
716
|
+
if (colSizing.MinWidth != undefined && colSizing.MinWidth != colDef.minWidth) {
|
|
717
|
+
colDef = { ...colDef, minWidth: colSizing.MinWidth };
|
|
718
|
+
changed = true;
|
|
719
|
+
}
|
|
720
|
+
if (colSizing.MaxWidth != undefined && colSizing.MaxWidth != colDef.maxWidth) {
|
|
721
|
+
colDef = { ...colDef, maxWidth: colSizing.MaxWidth };
|
|
722
|
+
changed = true;
|
|
723
|
+
}
|
|
724
|
+
// this (width and flex) shouldn't be needed theoretically, as applyColumnState will apply sizing
|
|
725
|
+
// using the newly computed column state
|
|
726
|
+
// but for whatever reason, this is needed here, for some edge cases
|
|
727
|
+
// eg: when a layout has a column width a width and minWidth
|
|
728
|
+
// and then we create a new layout with a different width and different min width
|
|
729
|
+
// then if we don't have this code, the new layout might wrongly apply the previous
|
|
730
|
+
// minWidth as the current column width
|
|
731
|
+
// see #edge-case-min-width-width-mismatch
|
|
732
|
+
if (colSizing.Width !== undefined && colSizing.Width !== colDef.width) {
|
|
733
|
+
colDef = { ...colDef, width: colSizing.Width };
|
|
734
|
+
}
|
|
735
|
+
if (colSizing.Flex !== undefined && colSizing.Flex !== colDef.flex) {
|
|
736
|
+
colDef = { ...colDef, flex: colSizing.Flex };
|
|
737
|
+
changed = true;
|
|
738
|
+
}
|
|
739
|
+
if (changed) {
|
|
740
|
+
changedColDefs.set(colId, colDef);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
if (changedColDefs.size) {
|
|
745
|
+
return mapColDefs(colDefs, (colDef) => {
|
|
746
|
+
const changedColDef = changedColDefs.get(colDef.colId);
|
|
747
|
+
if (changedColDef) {
|
|
748
|
+
return changedColDef;
|
|
749
|
+
}
|
|
750
|
+
return colDef;
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
623
755
|
static getAGGridInitialStateForLayout(layout, colDefs, options) {
|
|
624
756
|
if (isPivotLayoutModel(layout)) {
|
|
625
757
|
return LayoutManager.getAGGridInitialStateForPivotLayout(layout, colDefs);
|
|
@@ -634,14 +766,15 @@ export class LayoutManager extends LMEmitter {
|
|
|
634
766
|
}
|
|
635
767
|
// just in case the enduser provided falsy colIds, it will crash AG Grid internals
|
|
636
768
|
layout.TableColumns = layout.TableColumns.filter((colId) => colId != undefined);
|
|
637
|
-
layout = normalizeTableLayoutModel(layout, _options);
|
|
769
|
+
layout = normalizeTableLayoutModel(layout, { isTree: _options?.isTree ?? false });
|
|
638
770
|
const agGridState = {};
|
|
639
771
|
const columnIds = getColumnOrderIdsForAllColDefs(layout.TableColumns, colDefs);
|
|
640
772
|
agGridState.columnOrder = {
|
|
641
773
|
orderedColIds: columnIds,
|
|
642
774
|
};
|
|
643
775
|
const flatColDefs = flattenColDefs(colDefs);
|
|
644
|
-
const
|
|
776
|
+
const colDefsById = new Map(flatColDefs.map((colDef) => [colDef.colId ?? colDef.field, colDef]));
|
|
777
|
+
const getColDef = (colId) => colDefsById.get(colId);
|
|
645
778
|
agGridState.columnVisibility = {
|
|
646
779
|
hiddenColIds: flatColDefs
|
|
647
780
|
.filter((colDef) => {
|
|
@@ -653,15 +786,42 @@ export class LayoutManager extends LMEmitter {
|
|
|
653
786
|
})
|
|
654
787
|
.map((colDef) => colDef.colId ?? colDef.field),
|
|
655
788
|
};
|
|
656
|
-
if (layout.
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
789
|
+
if (layout.ColumnSizing) {
|
|
790
|
+
const colsInColumnSizingModel = new Set();
|
|
791
|
+
const columnSizingModel = Object.keys(layout.ColumnSizing)
|
|
792
|
+
.map((colId) => {
|
|
793
|
+
const colSizing = layout.ColumnSizing[colId];
|
|
794
|
+
if (colSizing.Flex != undefined) {
|
|
795
|
+
colsInColumnSizingModel.add(colId);
|
|
660
796
|
return {
|
|
661
797
|
colId,
|
|
662
|
-
|
|
798
|
+
flex: colSizing.Flex,
|
|
663
799
|
};
|
|
664
|
-
}
|
|
800
|
+
}
|
|
801
|
+
if (colSizing.Width != undefined) {
|
|
802
|
+
colsInColumnSizingModel.add(colId);
|
|
803
|
+
return {
|
|
804
|
+
colId,
|
|
805
|
+
width: colSizing.Width ?? DEFAULT_COLUMN_WIDTH,
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
})
|
|
809
|
+
.filter(Boolean);
|
|
810
|
+
const options = {
|
|
811
|
+
..._options,
|
|
812
|
+
columnDefs: colDefs,
|
|
813
|
+
};
|
|
814
|
+
columnIds.forEach((colId) => {
|
|
815
|
+
if (!colsInColumnSizingModel.has(colId)) {
|
|
816
|
+
const colDef = getColDef(colId);
|
|
817
|
+
const colSizeState = getDefaultColumnSizeStateForColDef(colId, colDef, options);
|
|
818
|
+
if (colSizeState) {
|
|
819
|
+
columnSizingModel.push(colSizeState);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
agGridState.columnSizing = {
|
|
824
|
+
columnSizingModel,
|
|
665
825
|
};
|
|
666
826
|
}
|
|
667
827
|
if (layout.ColumnSorts) {
|
|
@@ -724,7 +884,8 @@ export class LayoutManager extends LMEmitter {
|
|
|
724
884
|
// orderedColIds: columnIds,
|
|
725
885
|
// };
|
|
726
886
|
const flatColDefs = flattenColDefs(colDefs);
|
|
727
|
-
const
|
|
887
|
+
const colDefsById = new Map(flatColDefs.map((colDef) => [colDef.colId ?? colDef.field, colDef]));
|
|
888
|
+
const getColDef = (colId) => colDefsById.get(colId);
|
|
728
889
|
// agGridState.columnVisibility = {
|
|
729
890
|
// hiddenColIds: flatColDefs
|
|
730
891
|
// .filter((colDef) => {
|
|
@@ -742,15 +903,24 @@ export class LayoutManager extends LMEmitter {
|
|
|
742
903
|
pivotMode: true,
|
|
743
904
|
pivotColIds: layout.PivotColumns,
|
|
744
905
|
};
|
|
745
|
-
if (layout.
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
906
|
+
if (layout.ColumnSizing) {
|
|
907
|
+
const columnSizingModel = Object.keys(layout.ColumnSizing)
|
|
908
|
+
.map((colId) => {
|
|
909
|
+
const colSizing = layout.ColumnSizing[colId];
|
|
910
|
+
if (colSizing.Flex != undefined) {
|
|
749
911
|
return {
|
|
750
912
|
colId,
|
|
751
|
-
|
|
913
|
+
flex: colSizing.Flex,
|
|
752
914
|
};
|
|
753
|
-
}
|
|
915
|
+
}
|
|
916
|
+
return {
|
|
917
|
+
colId,
|
|
918
|
+
width: colSizing.Width ?? DEFAULT_COLUMN_WIDTH,
|
|
919
|
+
};
|
|
920
|
+
})
|
|
921
|
+
.filter(Boolean);
|
|
922
|
+
agGridState.columnSizing = {
|
|
923
|
+
columnSizingModel,
|
|
754
924
|
};
|
|
755
925
|
}
|
|
756
926
|
if (layout.ColumnSorts) {
|
|
@@ -861,7 +1031,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
861
1031
|
// but we still want to avoid this unnecessary initial loop
|
|
862
1032
|
// which may cause more adaptable work
|
|
863
1033
|
const resume = this.suspendAgGridListener();
|
|
864
|
-
const pivotMode = this.
|
|
1034
|
+
const pivotMode = this.isInPivotMode();
|
|
865
1035
|
if (!!layout.SuppressAggFuncInHeader !== !!this.gridApi.getGridOption('suppressAggFuncInHeader')) {
|
|
866
1036
|
this.gridApi.setGridOption('suppressAggFuncInHeader', !!layout.SuppressAggFuncInHeader);
|
|
867
1037
|
}
|
|
@@ -887,6 +1057,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
887
1057
|
else {
|
|
888
1058
|
this.gridApi.setGridOption('grandTotalRow', null);
|
|
889
1059
|
}
|
|
1060
|
+
this.applyColumnDefsChanges(layout);
|
|
890
1061
|
if (isPivotLayoutModel(layout)) {
|
|
891
1062
|
try {
|
|
892
1063
|
const perfApplyPivot = this.beginPerf('applyLayout:pivot');
|
|
@@ -911,6 +1082,17 @@ export class LayoutManager extends LMEmitter {
|
|
|
911
1082
|
resume();
|
|
912
1083
|
}
|
|
913
1084
|
}
|
|
1085
|
+
applyColumnDefsChanges(layout) {
|
|
1086
|
+
return this.applyColumnSizingColumnDefsChanges(layout);
|
|
1087
|
+
}
|
|
1088
|
+
applyColumnSizingColumnDefsChanges(layout) {
|
|
1089
|
+
const newColDefs = LayoutManager.getColumnDefsChangesForLayout(layout, this.gridApi.getColumnDefs());
|
|
1090
|
+
if (newColDefs) {
|
|
1091
|
+
this.gridApi.setGridOption('columnDefs', newColDefs);
|
|
1092
|
+
return true;
|
|
1093
|
+
}
|
|
1094
|
+
return false;
|
|
1095
|
+
}
|
|
914
1096
|
applyTableLayout(layout, options) {
|
|
915
1097
|
this.withSuppressColumnAnimation(() => {
|
|
916
1098
|
// if we apply the state here, before calling setGridOption for groupDisplayType
|
|
@@ -1034,7 +1216,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
1034
1216
|
rowGroup: rowGroupIndex != null,
|
|
1035
1217
|
};
|
|
1036
1218
|
});
|
|
1037
|
-
this.
|
|
1219
|
+
this.computeColumnSizing(layout, columnState);
|
|
1038
1220
|
this.computeColumnSorts(layout, columnState);
|
|
1039
1221
|
this.computePinnedColumns(layout, columnState);
|
|
1040
1222
|
this.computePivotAggregations(layout, columnState);
|
|
@@ -1059,7 +1241,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
1059
1241
|
computeColumnStateForTableLayout(layout) {
|
|
1060
1242
|
const columnState = {};
|
|
1061
1243
|
this.computeColumnOrderAndVisibility(layout, columnState);
|
|
1062
|
-
this.
|
|
1244
|
+
this.computeColumnSizing(layout, columnState);
|
|
1063
1245
|
this.computeColumnSorts(layout, columnState);
|
|
1064
1246
|
this.computeRowGrouping(layout, columnState);
|
|
1065
1247
|
this.computeAggregations(layout, columnState);
|
|
@@ -1174,20 +1356,38 @@ export class LayoutManager extends LMEmitter {
|
|
|
1174
1356
|
colDef = colDef ?? this.gridApi.getColumnDef(colId);
|
|
1175
1357
|
return colDef?.width ?? DEFAULT_COLUMN_WIDTH;
|
|
1176
1358
|
}
|
|
1177
|
-
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}
|
|
1359
|
+
computeColumnSizing(layout, columnState) {
|
|
1360
|
+
const ColumnSizing = layout.ColumnSizing || {};
|
|
1361
|
+
const colDefs = this.gridApi.getColumnDefs();
|
|
1362
|
+
const options = {
|
|
1363
|
+
columnDefs: colDefs,
|
|
1364
|
+
colTypes: this.gridApi.getGridOption('columnTypes'),
|
|
1365
|
+
defaultColDef: this.gridApi.getGridOption('defaultColDef'),
|
|
1366
|
+
};
|
|
1185
1367
|
columnState.state.forEach((colState) => {
|
|
1186
|
-
|
|
1187
|
-
|
|
1368
|
+
const colSizing = ColumnSizing[colState.colId];
|
|
1369
|
+
if (colSizing) {
|
|
1370
|
+
if (colSizing.Width != undefined) {
|
|
1371
|
+
colState.width = colSizing.Width;
|
|
1372
|
+
}
|
|
1373
|
+
else if (colSizing.Flex != undefined) {
|
|
1374
|
+
colState.flex = colSizing.Flex;
|
|
1375
|
+
}
|
|
1188
1376
|
}
|
|
1189
1377
|
else {
|
|
1190
|
-
|
|
1378
|
+
let defaultColState;
|
|
1379
|
+
if (!colState.flex) {
|
|
1380
|
+
defaultColState = getDefaultColumnSizeStateForColDef(colState.colId, undefined, options);
|
|
1381
|
+
if (defaultColState?.flex) {
|
|
1382
|
+
colState.flex = defaultColState.flex;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
if (!colState.flex) {
|
|
1386
|
+
colState.width =
|
|
1387
|
+
colState.width ??
|
|
1388
|
+
defaultColState?.width ??
|
|
1389
|
+
this.getDefaultColumnWidthForCol(colState.colId);
|
|
1390
|
+
}
|
|
1191
1391
|
}
|
|
1192
1392
|
});
|
|
1193
1393
|
}
|
|
@@ -1218,9 +1418,9 @@ export class LayoutManager extends LMEmitter {
|
|
|
1218
1418
|
// dont auto size hidden columns
|
|
1219
1419
|
tableColumns = tableColumns.filter((colId) => !currentLayout.ColumnVisibility[colId]);
|
|
1220
1420
|
}
|
|
1221
|
-
if (currentLayout.
|
|
1222
|
-
// dont auto size columns with a set
|
|
1223
|
-
tableColumns = tableColumns.filter((colId) => !currentLayout.
|
|
1421
|
+
if (currentLayout.ColumnSizing) {
|
|
1422
|
+
// dont auto size columns with a set sizing
|
|
1423
|
+
tableColumns = tableColumns.filter((colId) => !currentLayout.ColumnSizing[colId]);
|
|
1224
1424
|
}
|
|
1225
1425
|
}
|
|
1226
1426
|
columnIds = columnIds ?? tableColumns;
|
|
@@ -1231,50 +1431,62 @@ export class LayoutManager extends LMEmitter {
|
|
|
1231
1431
|
return columnIds;
|
|
1232
1432
|
}
|
|
1233
1433
|
applyPivotLayout(layout, options) {
|
|
1234
|
-
this.
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
// fourth: ...etc
|
|
1243
|
-
// so we apply the states for all aggregations except the last one
|
|
1244
|
-
//
|
|
1245
|
-
const aggregationsMapForOrder = (layout.PivotAggregationColumns || []).map((_, index) => layout.PivotAggregationColumns.slice(0, index));
|
|
1246
|
-
aggregationsMapForOrder.forEach((agg) => {
|
|
1247
|
-
// we're mutating the columnState here
|
|
1248
|
-
this.computePivotAggregations({ ...layout, PivotAggregationColumns: agg }, columnState);
|
|
1249
|
-
// and apply the state
|
|
1250
|
-
this.gridApi.applyColumnState(columnState);
|
|
1251
|
-
});
|
|
1252
|
-
// now recompute and apply the last one
|
|
1253
|
-
this.computePivotAggregations(layout, columnState);
|
|
1254
|
-
this.gridApi.applyColumnState(columnState);
|
|
1255
|
-
// let's also include the column widths of the pivotResult columns
|
|
1256
|
-
// we can't simply include those in the columnState because the columnState will also apply order
|
|
1257
|
-
// but we don't want to affect the order of the pivotResult columns
|
|
1258
|
-
// so we'll do it manually, and apply the widths after the columnState
|
|
1259
|
-
// by using the gridApi.setColumnWidths method
|
|
1260
|
-
if (layout.ColumnWidths) {
|
|
1261
|
-
const colWidthForPivotResultColumns = [];
|
|
1262
|
-
(this.gridApi.getPivotResultColumns() || []).forEach((col) => {
|
|
1263
|
-
const colId = col.getColId();
|
|
1264
|
-
if (layout.ColumnWidths[colId]) {
|
|
1265
|
-
colWidthForPivotResultColumns.push({ key: colId, newWidth: layout.ColumnWidths[colId] });
|
|
1434
|
+
this.withSuppressColumnAnimation(() => {
|
|
1435
|
+
this.applyPivotTotals(layout);
|
|
1436
|
+
const hasGroupedColumns = layout.PivotGroupedColumns && !!layout.PivotGroupedColumns.length;
|
|
1437
|
+
if (hasGroupedColumns) {
|
|
1438
|
+
const displayTypeFromLayout = layout.RowGroupDisplayType === 'multi' ? 'multipleColumns' : 'singleColumn';
|
|
1439
|
+
const groupDisplayType = this.gridApi.getGridOption('groupDisplayType');
|
|
1440
|
+
if (groupDisplayType !== displayTypeFromLayout) {
|
|
1441
|
+
this.gridApi.setGridOption('groupDisplayType', displayTypeFromLayout);
|
|
1266
1442
|
}
|
|
1443
|
+
}
|
|
1444
|
+
const columnState = this.computeColumnStateForPivotLayout(layout);
|
|
1445
|
+
// by simply calling this.gridApi.applyColumnState(columnState)
|
|
1446
|
+
// the order of aggregations is not preserved/guaranteed by ag-grid
|
|
1447
|
+
// so we want to apply multiple states - adding aggregations one by one
|
|
1448
|
+
// first: no aggregation
|
|
1449
|
+
// second: [agg[0]]
|
|
1450
|
+
// third: [agg[0], agg[1]]
|
|
1451
|
+
// fourth: ...etc
|
|
1452
|
+
// so we apply the states for all aggregations except the last one
|
|
1453
|
+
//
|
|
1454
|
+
const aggregationsMapForOrder = (layout.PivotAggregationColumns || []).map((_, index) => layout.PivotAggregationColumns.slice(0, index));
|
|
1455
|
+
aggregationsMapForOrder.forEach((agg) => {
|
|
1456
|
+
// we're mutating the columnState here
|
|
1457
|
+
this.computePivotAggregations({ ...layout, PivotAggregationColumns: agg }, columnState);
|
|
1458
|
+
// and apply the state
|
|
1459
|
+
this.gridApi.applyColumnState(columnState);
|
|
1267
1460
|
});
|
|
1268
|
-
|
|
1269
|
-
|
|
1461
|
+
// now recompute and apply the last one
|
|
1462
|
+
this.computePivotAggregations(layout, columnState);
|
|
1463
|
+
this.gridApi.applyColumnState(columnState);
|
|
1464
|
+
// let's also include the column widths of the pivotResult columns
|
|
1465
|
+
// we can't simply include those in the columnState because the columnState will also apply order
|
|
1466
|
+
// but we don't want to affect the order of the pivotResult columns
|
|
1467
|
+
// so we'll do it manually, and apply the widths after the columnState
|
|
1468
|
+
// by using the gridApi.setColumnWidths method
|
|
1469
|
+
if (layout.ColumnSizing) {
|
|
1470
|
+
const colWidthForPivotResultColumns = [];
|
|
1471
|
+
(this.gridApi.getPivotResultColumns() || []).forEach((col) => {
|
|
1472
|
+
const colId = col.getColId();
|
|
1473
|
+
if (layout.ColumnSizing[colId]?.Width != undefined) {
|
|
1474
|
+
colWidthForPivotResultColumns.push({
|
|
1475
|
+
key: colId,
|
|
1476
|
+
newWidth: layout.ColumnSizing[colId].Width ?? DEFAULT_COLUMN_WIDTH,
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
if (colWidthForPivotResultColumns.length) {
|
|
1481
|
+
this.gridApi.setColumnWidths(colWidthForPivotResultColumns);
|
|
1482
|
+
}
|
|
1270
1483
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
}
|
|
1484
|
+
this.applyColumnGroupCollapseExpandState(layout);
|
|
1485
|
+
// but also let's not forget to apply the row group values
|
|
1486
|
+
if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
|
|
1487
|
+
this.applyRowGroupValues(layout.RowGroupValues, layout.PivotGroupedColumns);
|
|
1488
|
+
}
|
|
1489
|
+
});
|
|
1278
1490
|
}
|
|
1279
1491
|
applyPivotTotals(layout) {
|
|
1280
1492
|
/**
|
|
@@ -1494,4 +1706,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
1494
1706
|
};
|
|
1495
1707
|
}
|
|
1496
1708
|
}
|
|
1709
|
+
isInPivotMode() {
|
|
1710
|
+
return this.gridApi.isModuleRegistered('PivotModule') && this.gridApi.isPivotMode();
|
|
1711
|
+
}
|
|
1497
1712
|
}
|
|
@@ -18,8 +18,8 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
18
18
|
if (!layout.ColumnPinning) {
|
|
19
19
|
layout.ColumnPinning = {};
|
|
20
20
|
}
|
|
21
|
-
if (!layout.
|
|
22
|
-
layout.
|
|
21
|
+
if (!layout.ColumnSizing) {
|
|
22
|
+
layout.ColumnSizing = {};
|
|
23
23
|
}
|
|
24
24
|
if (!layout.RowGroupedColumns) {
|
|
25
25
|
layout.RowGroupedColumns = [];
|
|
@@ -124,8 +124,8 @@ export function normalizePivotLayoutModel(layout) {
|
|
|
124
124
|
if (!layout.ColumnPinning) {
|
|
125
125
|
layout.ColumnPinning = {};
|
|
126
126
|
}
|
|
127
|
-
if (!layout.
|
|
128
|
-
layout.
|
|
127
|
+
if (!layout.ColumnSizing) {
|
|
128
|
+
layout.ColumnSizing = {};
|
|
129
129
|
}
|
|
130
130
|
if (!layout.PivotGroupedColumns) {
|
|
131
131
|
layout.PivotGroupedColumns = [];
|
|
@@ -157,6 +157,9 @@ export function normalizePivotLayoutModel(layout) {
|
|
|
157
157
|
// make it an own property
|
|
158
158
|
layout.PivotColumnTotal = undefined;
|
|
159
159
|
}
|
|
160
|
+
if (layout.PivotGroupedColumns && layout.PivotGroupedColumns.length) {
|
|
161
|
+
layout.RowGroupDisplayType = layout.RowGroupDisplayType || 'single';
|
|
162
|
+
}
|
|
160
163
|
return layout;
|
|
161
164
|
}
|
|
162
165
|
export function normalizeLayoutModel(layout, options) {
|