@adaptabletools/adaptable 24.0.0-canary.0 → 24.0.0-canary.10
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 -3
- package/agGrid.js +2 -3
- package/aql.d.ts +132 -0
- package/aql.js +260 -0
- package/devtools.d.ts +237 -2
- package/index.css +323 -306
- package/index.d.ts +2 -3
- package/index.js +2 -3
- package/package.json +8 -7
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -4
- package/src/AdaptableOptions/ActionColumnOptions.d.ts +24 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +97 -69
- package/src/AdaptableOptions/AdaptablePlugin.d.ts +113 -1
- package/src/AdaptableOptions/AlertOptions.d.ts +0 -2
- package/src/AdaptableOptions/ChartingOptions.d.ts +11 -5
- package/src/AdaptableOptions/ColumnMenuOptions.d.ts +30 -0
- package/src/AdaptableOptions/ColumnOptions.d.ts +0 -2
- package/src/AdaptableOptions/CommentOptions.d.ts +12 -4
- package/src/AdaptableOptions/ContextMenuOptions.d.ts +31 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +0 -3
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +3 -2
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +11 -5
- package/src/AdaptableOptions/EditOptions.d.ts +18 -2
- package/src/AdaptableOptions/ExportOptions.d.ts +23 -0
- package/src/AdaptableOptions/ExpressionOptions.d.ts +0 -3
- package/src/AdaptableOptions/Fdc3Options.d.ts +77 -3
- package/src/AdaptableOptions/FilterOptions.d.ts +13 -8
- package/src/AdaptableOptions/FlashingCellOptions.d.ts +3 -3
- package/src/AdaptableOptions/LayoutOptions.d.ts +16 -3
- package/src/AdaptableOptions/NotificationsOptions.d.ts +0 -1
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +0 -2
- package/src/AdaptableOptions/RowFormOptions.d.ts +9 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +16 -5
- package/src/AdaptableOptions/StateOptions.d.ts +37 -13
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +89 -6
- package/src/AdaptableState/AdaptableState.d.ts +99 -3
- package/src/AdaptableState/AlertState.d.ts +20 -21
- package/src/AdaptableState/ApplicationState.d.ts +5 -3
- package/src/AdaptableState/BaseState.d.ts +9 -2
- package/src/AdaptableState/CalculatedColumnState.d.ts +10 -8
- package/src/AdaptableState/ChartingState.d.ts +10 -5
- package/src/AdaptableState/CommentState.d.ts +10 -4
- package/src/AdaptableState/Common/AdaptableAlert.d.ts +21 -2
- package/src/AdaptableState/Common/AdaptableAlert.js +9 -0
- package/src/AdaptableState/Common/AdaptableButton.d.ts +3 -1
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +38 -1
- package/src/AdaptableState/Common/AdaptableFilterState.d.ts +3 -1
- package/src/AdaptableState/Common/AdaptableFlashingCell.d.ts +3 -1
- package/src/AdaptableState/Common/AdaptableForm.d.ts +9 -0
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +27 -1
- package/src/AdaptableState/Common/AdaptableIcon.d.ts +4 -2
- package/src/AdaptableState/Common/AdaptableObject.d.ts +9 -1
- package/src/AdaptableState/Common/AdaptableQuery.d.ts +9 -0
- package/src/AdaptableState/Common/AdaptableStyle.d.ts +6 -8
- package/src/AdaptableState/Common/AggregationColumns.d.ts +15 -6
- package/src/AdaptableState/Common/ButtonStyle.d.ts +3 -1
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +6 -2
- package/src/AdaptableState/Common/CellHighlightInfo.d.ts +4 -2
- package/src/AdaptableState/Common/CellSummary.d.ts +33 -0
- package/src/AdaptableState/Common/ColumnFilter.d.ts +3 -1
- package/src/AdaptableState/Common/ColumnHighlightInfo.d.ts +4 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +32 -1
- package/src/AdaptableState/Common/ColumnSetupInfo.d.ts +17 -0
- package/src/AdaptableState/Common/ColumnSort.d.ts +3 -1
- package/src/AdaptableState/Common/CompactCalculatedColumnEditorInfo.d.ts +3 -0
- package/src/AdaptableState/Common/DataChangedScope.d.ts +3 -1
- package/src/AdaptableState/Common/DataUpdateConfig.d.ts +3 -1
- package/src/AdaptableState/Common/Entitlement.d.ts +4 -2
- package/src/AdaptableState/Common/Enums.d.ts +21 -0
- package/src/AdaptableState/Common/ExtendedLayout.d.ts +3 -1
- package/src/AdaptableState/Common/Fdc3Context.d.ts +9 -0
- package/src/AdaptableState/Common/Fdc3Intent.d.ts +6 -0
- package/src/AdaptableState/Common/GridFilter.d.ts +3 -1
- package/src/AdaptableState/Common/MenuItem.d.ts +9 -0
- package/src/AdaptableState/Common/RowHighlightInfo.d.ts +4 -2
- package/src/AdaptableState/Common/RowScope.d.ts +3 -1
- package/src/AdaptableState/Common/RowSummary.d.ts +14 -4
- package/src/AdaptableState/Common/RowsHighlightInfo.d.ts +5 -3
- package/src/AdaptableState/Common/Schedule.d.ts +10 -2
- package/src/AdaptableState/Common/SpecialColumnSettings.d.ts +3 -1
- package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +4 -2
- package/src/AdaptableState/Common/TransposeConfig.d.ts +1 -1
- package/src/AdaptableState/Common/Types.d.ts +9 -0
- package/src/AdaptableState/CustomSortState.d.ts +8 -5
- package/src/AdaptableState/DashboardState.d.ts +14 -10
- package/src/AdaptableState/ExportState.d.ts +12 -4
- package/src/AdaptableState/FlashingCellState.d.ts +8 -5
- package/src/AdaptableState/FormatColumnState.d.ts +28 -8
- package/src/AdaptableState/FreeTextColumnState.d.ts +14 -8
- package/src/AdaptableState/IPushPullState.d.ts +39 -3
- package/src/AdaptableState/InitialState.d.ts +9 -9
- package/src/AdaptableState/InternalState.d.ts +183 -3
- package/src/AdaptableState/LayoutState.d.ts +64 -21
- package/src/AdaptableState/NamedQueryState.d.ts +16 -4
- package/src/AdaptableState/NoteState.d.ts +7 -3
- package/src/AdaptableState/OpenFinState.d.ts +12 -2
- package/src/AdaptableState/PlusMinusState.d.ts +8 -4
- package/src/AdaptableState/PopupState.d.ts +29 -1
- package/src/AdaptableState/QuickSearchState.d.ts +9 -3
- package/src/AdaptableState/Selection/GridCell.d.ts +5 -3
- package/src/AdaptableState/Selection/GridCellRange.d.ts +8 -7
- package/src/AdaptableState/Selection/SelectedCellInfo.d.ts +1 -1
- package/src/AdaptableState/ShortcutState.d.ts +7 -3
- package/src/AdaptableState/StatusBarState.d.ts +7 -6
- package/src/AdaptableState/StyledColumnState.d.ts +46 -14
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +4 -0
- package/src/AdaptableState/TeamSharingState.d.ts +46 -2
- package/src/AdaptableState/ThemeState.d.ts +24 -2
- package/src/AdaptableState/ToolPanelState.d.ts +10 -5
- package/src/AdaptableState/UserInterfaceState.d.ts +2 -2
- package/src/AdaptableState/Uuid.d.ts +6 -0
- package/src/Api/ActionColumnApi.d.ts +3 -1
- package/src/Api/AdaptableApi.d.ts +54 -50
- package/src/Api/AlertApi.d.ts +20 -12
- package/src/Api/ApplicationApi.d.ts +6 -2
- package/src/Api/BulkUpdateApi.d.ts +2 -1
- package/src/Api/CalculatedColumnApi.d.ts +4 -1
- package/src/Api/CalendarApi.d.ts +10 -0
- package/src/Api/CellSummaryApi.d.ts +9 -3
- package/src/Api/ChartingApi.d.ts +22 -7
- package/src/Api/ColumnApi.d.ts +71 -4
- package/src/Api/ColumnFilterApi.d.ts +13 -3
- package/src/Api/ColumnMenuApi.d.ts +13 -2
- package/src/Api/ColumnScopeApi.d.ts +27 -1
- package/src/Api/CommentApi.d.ts +10 -7
- package/src/Api/ContextMenuApi.d.ts +11 -1
- package/src/Api/CustomSortApi.d.ts +6 -2
- package/src/Api/DashboardApi.d.ts +30 -9
- package/src/Api/DataChangeHistoryApi.d.ts +9 -3
- package/src/Api/DataImportApi.d.ts +1 -1
- package/src/Api/EntitlementApi.d.ts +6 -1
- package/src/Api/EventApi.d.ts +67 -19
- package/src/Api/Events/AdaptableReady.d.ts +6 -2
- package/src/Api/Events/AdaptableStateChanged.d.ts +9 -5
- package/src/Api/Events/AdaptableStateReloaded.d.ts +7 -3
- package/src/Api/Events/AlertFired.d.ts +8 -2
- package/src/Api/Events/BeforeAdaptableStateChange.d.ts +6 -2
- package/src/Api/Events/CalculatedColumnChanged.d.ts +7 -3
- package/src/Api/Events/CellChanged.d.ts +6 -2
- package/src/Api/Events/CellSelectionChanged.d.ts +6 -2
- package/src/Api/Events/ChartChanged.d.ts +16 -8
- package/src/Api/Events/CommentChanged.d.ts +8 -2
- package/src/Api/Events/CustomToolbarConfigured.d.ts +6 -2
- package/src/Api/Events/DashboardChanged.d.ts +27 -6
- package/src/Api/Events/DataImported.d.ts +8 -4
- package/src/Api/Events/DataSetSelected.d.ts +6 -2
- package/src/Api/Events/Fdc3MessageInfo.d.ts +14 -4
- package/src/Api/Events/FlashingCellDisplayed.d.ts +6 -2
- package/src/Api/Events/GridFilterApplied.d.ts +11 -3
- package/src/Api/Events/GridSorted.d.ts +6 -2
- package/src/Api/Events/LayoutChanged.d.ts +41 -8
- package/src/Api/Events/LiveDataChanged.d.ts +21 -5
- package/src/Api/Events/NoteChanged.d.ts +5 -1
- package/src/Api/Events/ReportScheduleRan.d.ts +7 -3
- package/src/Api/Events/RowChanged.d.ts +6 -2
- package/src/Api/Events/RowFormSubmitted.d.ts +28 -12
- package/src/Api/Events/RowSelectionChanged.d.ts +6 -2
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +6 -2
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +6 -2
- package/src/Api/Events/ThemeSelected.d.ts +6 -2
- package/src/Api/ExportApi.d.ts +59 -32
- package/src/Api/ExpressionApi.d.ts +27 -16
- package/src/Api/Fdc3Api.d.ts +16 -3
- package/src/Api/FlashingCellApi.d.ts +6 -1
- package/src/Api/FormatColumnApi.d.ts +18 -11
- package/src/Api/FreeTextColumnApi.d.ts +4 -2
- package/src/Api/GridApi.d.ts +92 -19
- package/src/Api/IPushPullApi.d.ts +19 -2
- package/src/Api/Implementation/AlertApiImpl.d.ts +5 -5
- package/src/Api/Implementation/AlertApiImpl.js +26 -19
- package/src/Api/Implementation/ColumnScopeApiImpl.js +3 -3
- package/src/Api/Implementation/ExpressionApiImpl.d.ts +1 -3
- package/src/Api/Implementation/ExpressionApiImpl.js +5 -6
- package/src/Api/Implementation/QuickSearchApiImpl.js +2 -2
- package/src/Api/Implementation/StateApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StateApiImpl.js +4 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +9 -15
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -2
- package/src/Api/Internal/AdaptableInternalApi.js +11 -7
- package/src/Api/Internal/AlertInternalApi.js +12 -7
- package/src/Api/Internal/CalculatedColumnInternalApi.js +1 -1
- package/src/Api/Internal/EventInternalApi.d.ts +2 -1
- package/src/Api/Internal/EventInternalApi.js +7 -0
- package/src/Api/Internal/StateInternalApi.d.ts +1 -1
- package/src/Api/Internal/StateInternalApi.js +6 -5
- package/src/Api/InteropioPluginApi.d.ts +2 -1
- package/src/Api/LayoutApi.d.ts +29 -15
- package/src/Api/NamedQueryApi.d.ts +10 -6
- package/src/Api/NoteApi.d.ts +15 -11
- package/src/Api/OpenFinApi.d.ts +8 -2
- package/src/Api/OptionsApi.d.ts +43 -1
- package/src/Api/PluginsApi.d.ts +6 -1
- package/src/Api/PlusMinusApi.d.ts +2 -1
- package/src/Api/QuickSearchApi.d.ts +6 -1
- package/src/Api/RowFormApi.d.ts +8 -7
- package/src/Api/ShortcutApi.d.ts +3 -1
- package/src/Api/SmartEditApi.d.ts +4 -1
- package/src/Api/StateApi.d.ts +32 -4
- package/src/Api/StatusBarApi.d.ts +2 -0
- package/src/Api/StyledColumnApi.d.ts +23 -12
- package/src/Api/SystemStatusApi.d.ts +18 -6
- package/src/Api/TeamSharingApi.d.ts +8 -1
- package/src/Api/ThemeApi.d.ts +17 -8
- package/src/Api/ToolPanelApi.d.ts +12 -7
- package/src/Api/UserInterfaceApi.d.ts +10 -5
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +9 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +12 -7
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.d.ts +8 -0
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +12 -12
- package/src/Redux/Store/AdaptableStore.d.ts +8 -5
- package/src/Redux/Store/AdaptableStore.js +75 -41
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +5 -5
- package/src/Redux/Store/Interface/IStorageEngine.d.ts +4 -4
- package/src/Redux/Store/StateOptionsGuards.d.ts +58 -0
- package/src/Redux/Store/StateOptionsGuards.js +112 -0
- package/src/Redux/Store/isTransientReduxAction.d.ts +5 -0
- package/src/Redux/Store/isTransientReduxAction.js +19 -0
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +5 -5
- package/src/Utilities/Helpers/AlertTypeHelper.d.ts +1 -1
- package/src/Utilities/Helpers/SettingsPanelHelper.d.ts +14 -0
- package/src/Utilities/Helpers/SettingsPanelHelper.js +37 -1
- package/src/Utilities/Helpers/UIHelper.d.ts +12 -14
- package/src/Utilities/Helpers/UIHelper.js +12 -35
- package/src/Utilities/ObjectFactory.js +3 -3
- package/src/Utilities/Services/QueryLanguageService.js +0 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +9 -11
- package/src/View/Components/StyleComponent.js +2 -2
- package/src/View/Dashboard/Dashboard.d.ts +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/Dashboard/DashboardPopupSections.js +1 -1
- package/src/View/Filter/ColumnFilter/ColumnFilterNew.js +15 -11
- package/src/View/GridInfo/GridInfoPopup.js +62 -25
- package/src/View/QuickSearch/QuickSearchInput.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.d.ts +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
- package/src/View/QuickSearch/Utilities/useQuickSearchDebounced.d.ts +2 -2
- package/src/View/StyledColumn/RangesComponent.js +13 -16
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +3 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +7 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +6 -6
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +8 -8
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +4 -4
- package/src/View/Wizard/CollapsibleWizardCard.d.ts +3 -1
- package/src/View/Wizard/CollapsibleWizardCard.js +17 -9
- package/src/agGrid/Adaptable.d.ts +0 -12
- package/src/agGrid/Adaptable.js +0 -52
- package/src/agGrid/AdaptableAgGrid.d.ts +4 -4
- package/src/agGrid/AdaptableAgGrid.js +2 -0
- package/src/agGrid/AdaptableFrameworkComponent.d.ts +12 -0
- package/src/agGrid/AdaptableLogger.d.ts +74 -1
- package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
- package/src/agGrid/AgGridColumnAdapter.js +7 -5
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +3 -0
- package/src/agGrid/index.d.ts +1 -6
- package/src/agGrid/index.js +1 -3
- package/src/aql/ExpressionEvaluation.d.ts +27 -0
- package/src/aql/types.d.ts +22 -0
- package/src/components/ColorField/index.d.ts +13 -0
- package/src/components/ColorField/index.js +26 -0
- package/src/components/aql/CompactEditor/CompactEditor.js +1 -1
- package/src/components/aql/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/aql/ExpressionEditor/CompactExpressionToolbar.d.ts +5 -0
- package/src/components/aql/ExpressionEditor/CompactExpressionToolbar.js +12 -5
- package/src/components/aql/ExpressionEditor/ExpressionPreview.js +1 -1
- package/src/components/aql/ExpressionEditor/index.d.ts +3 -2
- package/src/components/aql/QueryBuilder/GroupEditor.js +1 -1
- package/src/components/aql/QueryBuilder/QueryBuilder.d.ts +5 -0
- package/src/components/aql/QueryBuilder/QueryBuilder.js +1 -1
- package/src/components/aql/QueryBuilder/QueryBuilderInputs.js +12 -2
- package/src/components/aql/QueryBuilder/context.d.ts +7 -0
- package/src/components/aql/QueryBuilder/context.js +3 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/normalizeLayoutModel.d.ts +1 -1
- package/src/layout-manager/src/simplifyLayoutModel.d.ts +1 -1
- package/src/migration/AdaptableUpgradeHelper.d.ts +7 -2
- package/src/migration/VersionUpgrade17.js +13 -8
- package/src/migration/VersionUpgrade24.d.ts +9 -0
- package/src/migration/VersionUpgrade24.js +27 -0
- package/src/migration/legacyAdaptableQuery.d.ts +29 -4
- package/src/setupDevTools.js +827 -111
- package/src/types.d.ts +2 -4
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/upgrade.d.ts +1 -0
- package/upgrade.js +1 -0
- package/vendor/components/Button/index.d.ts +1 -1
- package/vendor/components/Button/index.d.ts.map +1 -1
- package/vendor/components/Button/index.js.map +1 -1
- package/vendor/components/CheckBox/index.d.ts +1 -1
- package/vendor/components/CheckBox/index.d.ts.map +1 -1
- package/vendor/components/CheckBox/index.js.map +1 -1
- package/vendor/components/ColorField/index.d.ts +53 -0
- package/vendor/components/ColorField/index.d.ts.map +1 -0
- package/vendor/components/ColorField/index.js +80 -0
- package/vendor/components/ColorField/index.js.map +1 -0
- package/vendor/components/ColorPicker/colorPickerTab.d.ts +4 -0
- package/vendor/components/ColorPicker/colorPickerTab.d.ts.map +1 -0
- package/vendor/components/ColorPicker/colorPickerTab.js +28 -0
- package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -0
- package/vendor/components/ColorPicker/index.d.ts +98 -0
- package/vendor/components/ColorPicker/index.d.ts.map +1 -0
- package/vendor/components/ColorPicker/index.js +322 -0
- package/vendor/components/ColorPicker/index.js.map +1 -0
- package/vendor/components/ColorPicker/themeColors.d.ts +94 -0
- package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -0
- package/vendor/components/ColorPicker/themeColors.js +240 -0
- package/vendor/components/ColorPicker/themeColors.js.map +1 -0
- package/vendor/components/Combobox/VirtualizedList.d.ts +1 -1
- package/vendor/components/Combobox/VirtualizedList.d.ts.map +1 -1
- package/vendor/components/Combobox/VirtualizedList.js.map +1 -1
- package/vendor/components/Combobox/comboboxUtils.d.ts +9 -0
- package/vendor/components/Combobox/comboboxUtils.d.ts.map +1 -1
- package/vendor/components/Combobox/comboboxUtils.js +41 -2
- package/vendor/components/Combobox/comboboxUtils.js.map +1 -1
- package/vendor/components/Combobox/index.d.ts +1 -1
- package/vendor/components/Combobox/index.d.ts.map +1 -1
- package/vendor/components/Combobox/index.js +14 -9
- package/vendor/components/Combobox/index.js.map +1 -1
- package/vendor/components/NumberInput/index.d.ts +51 -0
- package/vendor/components/NumberInput/index.d.ts.map +1 -0
- package/vendor/components/NumberInput/index.js +82 -0
- package/vendor/components/NumberInput/index.js.map +1 -0
- package/vendor/components/index.css +286 -24
- package/vendor/components/index.d.ts +6 -0
- package/vendor/components/index.d.ts.map +1 -1
- package/vendor/components/index.js +3 -0
- package/vendor/components/index.js.map +1 -1
- package/vendor/components/twMerge.d.ts +3 -2
- package/vendor/components/twMerge.d.ts.map +1 -1
- package/vendor/components/twMerge.js.map +1 -1
- package/vendor/components/ui/combobox.d.ts.map +1 -1
- package/vendor/components/ui/combobox.js +1 -1
- package/vendor/components/ui/combobox.js.map +1 -1
- package/vendor/components/ui/input-group.d.ts.map +1 -1
- package/vendor/components/ui/input-group.js +5 -4
- package/vendor/components/ui/input-group.js.map +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +0 -99
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.js +0 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.d.ts +0 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.js +0 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +0 -19
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -337
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +0 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +0 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +0 -30
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -162
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +0 -18
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +0 -12
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +0 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -131
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +0 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +0 -30
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +0 -80
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +0 -100
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +0 -11
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +0 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +0 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +0 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +0 -21
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +0 -63
- package/src/View/AdaptableWizardView/Utilities/Utils.d.ts +0 -1
- package/src/View/AdaptableWizardView/Utilities/Utils.js +0 -21
- package/src/View/AdaptableWizardView/Utilities/helper.d.ts +0 -19
- package/src/View/AdaptableWizardView/Utilities/helper.js +0 -81
- package/src/View/AdaptableWizardView/Wizard.d.ts +0 -57
- package/src/View/AdaptableWizardView/Wizard.js +0 -98
- package/src/View/AdaptableWizardView/index.d.ts +0 -4
- package/src/View/AdaptableWizardView/index.js +0 -4
- package/src/components/ColorPicker/ColorPicker.d.ts +0 -12
- package/src/components/ColorPicker/ColorPicker.js +0 -48
- package/src/components/ColorPicker/OptionalColorPicker.d.ts +0 -12
- package/src/components/ColorPicker/OptionalColorPicker.js +0 -13
- package/src/components/ColorPicker/index.d.ts +0 -2
- package/src/components/ColorPicker/index.js +0 -2
package/src/setupDevTools.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { AG_GRID_VERSION } from './agGrid/AgGridModulesAdapter';
|
|
2
2
|
import { ADAPTABLE_VERSION } from './EnvVars';
|
|
3
|
-
import
|
|
3
|
+
import { resolveVisibleSettingsPanelNavigationGroups } from './Utilities/Helpers/SettingsPanelHelper';
|
|
4
|
+
import { isTransientReduxAction } from './Redux/Store/isTransientReduxAction';
|
|
5
|
+
import { isPivotLayout } from './Utilities/Helpers/Layouts/LayoutHelper';
|
|
6
|
+
import { formatColumnInspectorPinning, formatColumnInspectorSizing, } from './View/Layout/Utilities/columnLayoutHelpers';
|
|
7
|
+
import { getVariableColor } from './Utilities/Helpers/StyleHelper';
|
|
8
|
+
import { isSummaryColorLabel, parseSummaryLabelValueString, } from './View/Wizard/SummaryColorTag';
|
|
4
9
|
import { debug } from '@infinite-table/infinite-react';
|
|
10
|
+
import { colorSchemeDark, colorSchemeLight, themeQuartz } from 'ag-grid-enterprise';
|
|
5
11
|
import { warnOnce } from './agGrid/AdaptableLogger';
|
|
6
12
|
let DEV_TOOLS_LISTENING_STARTED = false;
|
|
7
13
|
let DEV_TOOLS_READY = false;
|
|
8
|
-
const __ADAPTABLE_DEVTOOLS_EMITTER = new Emitter();
|
|
9
14
|
const LOG_LEVELS = ['info', 'success', 'warn', 'error', 'perf'];
|
|
15
|
+
const LOG_CHANNEL_BASES = ['Adaptable', 'LayoutManager'];
|
|
16
|
+
const MAX_LOG_ENTRIES_PER_INSTANCE = 500;
|
|
17
|
+
const MAX_ACTION_ENTRIES_PER_INSTANCE = 200;
|
|
18
|
+
const DEFAULT_LOG_LIMIT = 100;
|
|
19
|
+
const DEFAULT_ACTION_LIMIT = 50;
|
|
20
|
+
const DEVTOOLS_GLOBAL_NAME = '__ADAPTABLE_DEVTOOLS__';
|
|
21
|
+
const PROFILE_TRACKS_STORAGE_KEY = 'adaptableProfileTracks';
|
|
22
|
+
const DEBUG_STORAGE_KEY = 'debug';
|
|
10
23
|
function serializeForPostMessage(value) {
|
|
11
24
|
try {
|
|
12
25
|
const json = JSON.stringify(value);
|
|
@@ -17,8 +30,9 @@ function serializeForPostMessage(value) {
|
|
|
17
30
|
const seen = new WeakSet();
|
|
18
31
|
const json = JSON.stringify(value, (_key, val) => {
|
|
19
32
|
if (typeof val === 'object' && val !== null) {
|
|
20
|
-
if (seen.has(val))
|
|
33
|
+
if (seen.has(val)) {
|
|
21
34
|
return undefined;
|
|
35
|
+
}
|
|
22
36
|
seen.add(val);
|
|
23
37
|
}
|
|
24
38
|
return val;
|
|
@@ -34,7 +48,9 @@ function serializeAdaptableStateForPostMessage(state, parentKey) {
|
|
|
34
48
|
}
|
|
35
49
|
try {
|
|
36
50
|
const json = JSON.stringify(value);
|
|
37
|
-
|
|
51
|
+
if (json !== undefined) {
|
|
52
|
+
acc[key] = JSON.parse(json);
|
|
53
|
+
}
|
|
38
54
|
}
|
|
39
55
|
catch (_error) {
|
|
40
56
|
warnOnce(`Adaptable DevTools: skipping serializing state key "${parentKey ? `${parentKey}.` : ''}${key}"`);
|
|
@@ -66,23 +82,88 @@ function isMessageFromDevToolsContentScript(data) {
|
|
|
66
82
|
data.target === 'adaptable-page' &&
|
|
67
83
|
data.source.startsWith('adaptable-devtools-contentscript'));
|
|
68
84
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
const INSTANCE_REGISTRATIONS = new Map();
|
|
86
|
+
const LOG_BUFFERS = new Map();
|
|
87
|
+
const pendingGridRuntimeUpdates = new Map();
|
|
88
|
+
const GRID_RUNTIME_FALLBACK_DELAY_MS = 100;
|
|
89
|
+
function getRegistration(adaptableId) {
|
|
90
|
+
const registration = INSTANCE_REGISTRATIONS.get(adaptableId);
|
|
91
|
+
if (!registration || registration.instance?.isDestroyed) {
|
|
92
|
+
return undefined;
|
|
72
93
|
}
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
return registration;
|
|
95
|
+
}
|
|
96
|
+
function getRegisteredApi(adaptableId) {
|
|
97
|
+
return getRegistration(adaptableId)?.api;
|
|
98
|
+
}
|
|
99
|
+
function describeMountedInstances() {
|
|
100
|
+
const ids = [...INSTANCE_REGISTRATIONS.keys()];
|
|
101
|
+
return ids.length ? `Mounted instances: ${ids.map((id) => `"${id}"`).join(', ')}.` : 'No AdapTable instance is mounted.';
|
|
102
|
+
}
|
|
103
|
+
function resolveRegistration(adaptableId) {
|
|
104
|
+
if (adaptableId != null) {
|
|
105
|
+
const registration = getRegistration(adaptableId);
|
|
106
|
+
if (!registration) {
|
|
107
|
+
throw new Error(`Adaptable DevTools: no mounted AdapTable instance with adaptableId "${adaptableId}". ${describeMountedInstances()}`);
|
|
108
|
+
}
|
|
109
|
+
return registration;
|
|
110
|
+
}
|
|
111
|
+
const ids = [...INSTANCE_REGISTRATIONS.keys()];
|
|
112
|
+
if (ids.length === 1) {
|
|
113
|
+
return INSTANCE_REGISTRATIONS.get(ids[0]);
|
|
114
|
+
}
|
|
115
|
+
if (!ids.length) {
|
|
116
|
+
throw new Error('Adaptable DevTools: no AdapTable instance is mounted yet (wait for the grid to be ready, then retry).');
|
|
117
|
+
}
|
|
118
|
+
throw new Error(`Adaptable DevTools: ${ids.length} AdapTable instances are mounted; pass an adaptableId. ${describeMountedInstances()}`);
|
|
119
|
+
}
|
|
120
|
+
let LOG_INTENT_LISTENING_STARTED = false;
|
|
121
|
+
function parseLogChannel(channel) {
|
|
122
|
+
const channelParts = channel.split(':');
|
|
123
|
+
const [channelBase, adaptableId] = channelParts;
|
|
124
|
+
if (!LOG_CHANNEL_BASES.includes(channelBase)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
if (channelBase === 'LayoutManager' && adaptableId === 'Diffing') {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
if (!adaptableId) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const level = channelParts.find((part) => LOG_LEVELS.includes(part));
|
|
134
|
+
return { adaptableId, level: level ?? 'info' };
|
|
135
|
+
}
|
|
136
|
+
function bufferLogEntry(entry) {
|
|
137
|
+
let buffer = LOG_BUFFERS.get(entry.adaptableId);
|
|
138
|
+
if (!buffer) {
|
|
139
|
+
buffer = [];
|
|
140
|
+
LOG_BUFFERS.set(entry.adaptableId, buffer);
|
|
141
|
+
}
|
|
142
|
+
buffer.push(entry);
|
|
143
|
+
if (buffer.length > MAX_LOG_ENTRIES_PER_INSTANCE) {
|
|
144
|
+
buffer.splice(0, buffer.length - MAX_LOG_ENTRIES_PER_INSTANCE);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function ensureLogIntentListening() {
|
|
148
|
+
if (LOG_INTENT_LISTENING_STARTED) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
LOG_INTENT_LISTENING_STARTED = true;
|
|
75
152
|
debug.onLogIntent('*', (logOptions) => {
|
|
76
153
|
const { channel, color, timestamp, args } = logOptions;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
if (!['Adaptable', 'LayoutManager'].includes(channelBase)) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (channelBase === 'LayoutManager' && adaptableId === 'Diffing') {
|
|
154
|
+
const parsed = parseLogChannel(channel);
|
|
155
|
+
if (!parsed) {
|
|
83
156
|
return;
|
|
84
157
|
}
|
|
85
|
-
|
|
158
|
+
const formattedArgs = args.map((arg) => formatLogArgForPostMessage(arg));
|
|
159
|
+
bufferLogEntry({
|
|
160
|
+
timestamp,
|
|
161
|
+
adaptableId: parsed.adaptableId,
|
|
162
|
+
channel,
|
|
163
|
+
level: parsed.level,
|
|
164
|
+
args: formattedArgs,
|
|
165
|
+
});
|
|
166
|
+
if (!DEV_TOOLS_READY) {
|
|
86
167
|
return;
|
|
87
168
|
}
|
|
88
169
|
window.postMessage({
|
|
@@ -90,16 +171,48 @@ function ensureDevToolsReady() {
|
|
|
90
171
|
url: getPageUrlOfWindow(),
|
|
91
172
|
type: 'log',
|
|
92
173
|
payload: {
|
|
93
|
-
adaptableId,
|
|
174
|
+
adaptableId: parsed.adaptableId,
|
|
94
175
|
channel,
|
|
95
176
|
color,
|
|
96
|
-
level:
|
|
177
|
+
level: parsed.level,
|
|
97
178
|
timestamp,
|
|
98
|
-
args:
|
|
179
|
+
args: formattedArgs.map((arg) => serializeForPostMessage(arg)),
|
|
99
180
|
},
|
|
100
181
|
});
|
|
101
182
|
});
|
|
102
|
-
|
|
183
|
+
}
|
|
184
|
+
function ensureDevToolsReady() {
|
|
185
|
+
if (DEV_TOOLS_READY) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
DEV_TOOLS_READY = true;
|
|
189
|
+
console.log('Adaptable DevTools is listening for messages!');
|
|
190
|
+
for (const [adaptableId, registration] of INSTANCE_REGISTRATIONS) {
|
|
191
|
+
if (registration.instance?.isDestroyed) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
postMountMessage(adaptableId, registration.api);
|
|
195
|
+
postStateChangeMessage(adaptableId, { api: registration.api });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function handleGetColumnInfoMessage(payload) {
|
|
199
|
+
const adaptableId = payload?.adaptableId;
|
|
200
|
+
if (!adaptableId) {
|
|
201
|
+
console.warn('Adaptable DevTools: get-column-info message missing adaptableId');
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
const registration = resolveRegistration(adaptableId);
|
|
206
|
+
const columnInfo = buildColumnDetail(adaptableId, registration, payload.columnId);
|
|
207
|
+
window.postMessage(buildMessageForExtension({
|
|
208
|
+
type: 'column-info',
|
|
209
|
+
adaptableId,
|
|
210
|
+
columnInfo,
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
console.warn(error.message);
|
|
215
|
+
}
|
|
103
216
|
}
|
|
104
217
|
function handleOpenSettingsPanelMessage(payload) {
|
|
105
218
|
const { adaptableId, moduleName } = payload ?? {};
|
|
@@ -107,52 +220,199 @@ function handleOpenSettingsPanelMessage(payload) {
|
|
|
107
220
|
console.warn('Adaptable DevTools: open-settings-panel message missing adaptableId');
|
|
108
221
|
return;
|
|
109
222
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
console.warn(`Adaptable DevTools: instance "${adaptableId}" is destroyed; cannot open settings panel`);
|
|
113
|
-
return;
|
|
223
|
+
try {
|
|
224
|
+
openSettingsPanel(adaptableId, moduleName);
|
|
114
225
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (!settingsPanelApi) {
|
|
118
|
-
console.warn(`Adaptable DevTools: settings panel is not available for "${adaptableId}" (instance not ready or destroyed)`);
|
|
119
|
-
return;
|
|
226
|
+
catch (error) {
|
|
227
|
+
console.warn(error.message);
|
|
120
228
|
}
|
|
121
|
-
settingsPanelApi.openSettingsPanel(moduleName);
|
|
122
229
|
}
|
|
123
|
-
|
|
124
|
-
|
|
230
|
+
const THEME_PREVIEW_ATTR = 'data-ab-devtools-theme-preview';
|
|
231
|
+
function clearInlineAbVars(el) {
|
|
232
|
+
const style = el.style;
|
|
125
233
|
for (let i = style.length - 1; i >= 0; i--) {
|
|
126
234
|
const prop = style[i];
|
|
127
|
-
if (prop.startsWith('--ab-')) {
|
|
235
|
+
if (prop?.startsWith('--ab-') && !prop.startsWith('--ab-qs-')) {
|
|
128
236
|
style.removeProperty(prop);
|
|
129
237
|
}
|
|
130
238
|
}
|
|
239
|
+
}
|
|
240
|
+
let themeAliasMaps = null;
|
|
241
|
+
let themeAliasSheetCount = -1;
|
|
242
|
+
function collectThemeAliases() {
|
|
243
|
+
const sheetCount = document.styleSheets.length;
|
|
244
|
+
if (themeAliasMaps && themeAliasSheetCount === sheetCount) {
|
|
245
|
+
return themeAliasMaps;
|
|
246
|
+
}
|
|
247
|
+
const root = new Map();
|
|
248
|
+
const dark = new Map();
|
|
249
|
+
const visit = (rules) => {
|
|
250
|
+
for (let index = 0; index < rules.length; index++) {
|
|
251
|
+
const rule = rules[index];
|
|
252
|
+
const group = rule;
|
|
253
|
+
if (group.cssRules) {
|
|
254
|
+
visit(group.cssRules);
|
|
255
|
+
}
|
|
256
|
+
const styleRule = rule;
|
|
257
|
+
if (!styleRule.style || !styleRule.selectorText) {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
const selector = styleRule.selectorText;
|
|
261
|
+
const isDark = selector.includes('ab--theme-dark');
|
|
262
|
+
const isRoot = selector.includes(':root') ||
|
|
263
|
+
selector.includes('ab--theme-light') ||
|
|
264
|
+
/(^|[^\w-])html([^\w-]|$)/.test(selector);
|
|
265
|
+
if (!isDark && !isRoot) {
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
const target = isDark ? dark : root;
|
|
269
|
+
for (let i = 0; i < styleRule.style.length; i++) {
|
|
270
|
+
const prop = styleRule.style[i];
|
|
271
|
+
if (!prop?.startsWith('--')) {
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
const value = styleRule.style.getPropertyValue(prop).trim();
|
|
275
|
+
if (value.includes('var(')) {
|
|
276
|
+
target.set(prop, value);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
for (let index = 0; index < document.styleSheets.length; index++) {
|
|
282
|
+
const sheet = document.styleSheets[index];
|
|
283
|
+
try {
|
|
284
|
+
visit(sheet.cssRules);
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
themeAliasMaps = { root, dark };
|
|
290
|
+
themeAliasSheetCount = sheetCount;
|
|
291
|
+
return themeAliasMaps;
|
|
292
|
+
}
|
|
293
|
+
let darkThemeProbe = null;
|
|
294
|
+
function themeDefaultStyle(variant) {
|
|
295
|
+
if (variant === 'light') {
|
|
296
|
+
return getComputedStyle(document.documentElement);
|
|
297
|
+
}
|
|
298
|
+
if (!darkThemeProbe) {
|
|
299
|
+
darkThemeProbe = document.createElement('div');
|
|
300
|
+
darkThemeProbe.className = 'ab--theme-dark';
|
|
301
|
+
darkThemeProbe.setAttribute('data-ab-devtools-theme-probe', '');
|
|
302
|
+
darkThemeProbe.style.cssText =
|
|
303
|
+
'position:absolute;width:0;height:0;overflow:hidden;pointer-events:none';
|
|
304
|
+
document.body.appendChild(darkThemeProbe);
|
|
305
|
+
}
|
|
306
|
+
return getComputedStyle(darkThemeProbe);
|
|
307
|
+
}
|
|
308
|
+
function installLiveAliases(el, variant) {
|
|
309
|
+
const { root, dark } = collectThemeAliases();
|
|
310
|
+
const defaults = themeDefaultStyle(variant);
|
|
311
|
+
const aliases = variant === 'dark' ? new Map([...root, ...dark]) : root;
|
|
312
|
+
for (const [name, raw] of aliases) {
|
|
313
|
+
const inline = el.style.getPropertyValue(name).trim();
|
|
314
|
+
const fallback = defaults.getPropertyValue(name).trim();
|
|
315
|
+
if (!inline || inline === raw || inline === fallback) {
|
|
316
|
+
el.style.setProperty(name, raw);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function clearDocumentThemePreview() {
|
|
321
|
+
clearInlineAbVars(document.documentElement);
|
|
322
|
+
}
|
|
323
|
+
function getInstanceThemeElements(adaptableId) {
|
|
324
|
+
const instance = getRegistration(adaptableId)?.instance;
|
|
325
|
+
if (!instance) {
|
|
326
|
+
return [];
|
|
327
|
+
}
|
|
328
|
+
const elements = [
|
|
329
|
+
instance.getAdaptableContainerElement(),
|
|
330
|
+
instance.getAgGridContainerElement(),
|
|
331
|
+
].filter((el) => el instanceof HTMLElement);
|
|
332
|
+
return [...new Set(elements)];
|
|
333
|
+
}
|
|
334
|
+
const originalAgGridThemes = new Map();
|
|
335
|
+
function applyAgGridPreviewTheme(adaptableId, variant) {
|
|
336
|
+
const instance = getRegistration(adaptableId)?.instance;
|
|
337
|
+
const gridApi = instance?.agGridAdapter.getAgGridApi();
|
|
338
|
+
if (!instance || instance.isDestroyed || !gridApi || gridApi.isDestroyed()) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if (instance.agGridThemeAdapter.getAgGridThemeMode() === 'legacy') {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (!originalAgGridThemes.has(adaptableId)) {
|
|
345
|
+
originalAgGridThemes.set(adaptableId, gridApi.getGridOption('theme'));
|
|
346
|
+
}
|
|
347
|
+
const original = originalAgGridThemes.get(adaptableId);
|
|
348
|
+
const base = original && original !== 'legacy' && typeof original.withPart === 'function'
|
|
349
|
+
? original
|
|
350
|
+
: themeQuartz;
|
|
351
|
+
gridApi.setGridOption('theme', base.withPart(variant === 'dark' ? colorSchemeDark : colorSchemeLight));
|
|
352
|
+
}
|
|
353
|
+
function syncAgGridPreviewThemes(activeId, variant) {
|
|
354
|
+
applyAgGridPreviewTheme(activeId, variant);
|
|
355
|
+
}
|
|
356
|
+
function applyThemeVars(el, payload) {
|
|
357
|
+
clearInlineAbVars(el);
|
|
131
358
|
for (const [name, value] of Object.entries(payload.light)) {
|
|
132
359
|
if (value != null && value !== '') {
|
|
133
|
-
style.setProperty(name, String(value));
|
|
360
|
+
el.style.setProperty(name, String(value));
|
|
134
361
|
}
|
|
135
362
|
}
|
|
136
363
|
if (payload.variant === 'dark') {
|
|
137
364
|
for (const [name, value] of Object.entries(payload.dark)) {
|
|
138
365
|
if (value != null && value !== '') {
|
|
139
|
-
style.setProperty(name, String(value));
|
|
366
|
+
el.style.setProperty(name, String(value));
|
|
140
367
|
}
|
|
141
368
|
}
|
|
369
|
+
el.classList.add('ab--theme-dark');
|
|
370
|
+
}
|
|
371
|
+
else if (el.getAttribute(THEME_PREVIEW_ATTR) === 'dark') {
|
|
372
|
+
el.classList.remove('ab--theme-dark');
|
|
142
373
|
}
|
|
374
|
+
el.setAttribute(THEME_PREVIEW_ATTR, payload.variant);
|
|
375
|
+
installLiveAliases(el, payload.variant);
|
|
143
376
|
}
|
|
144
377
|
function handleThemeVarChangeMessage(payload) {
|
|
145
|
-
const { name, value } = payload ?? {};
|
|
146
|
-
if (!name) {
|
|
378
|
+
const { name, value, adaptableId } = payload ?? {};
|
|
379
|
+
if (!name || !adaptableId) {
|
|
147
380
|
return;
|
|
148
381
|
}
|
|
149
|
-
|
|
382
|
+
const targets = getInstanceThemeElements(adaptableId);
|
|
383
|
+
if (targets.length === 0) {
|
|
384
|
+
console.warn(`Adaptable DevTools: no theme container for "${adaptableId}"`);
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
const variant = payload.variant === 'dark' ? 'dark' : 'light';
|
|
388
|
+
clearDocumentThemePreview();
|
|
389
|
+
for (const el of targets) {
|
|
390
|
+
if (!el.hasAttribute(THEME_PREVIEW_ATTR)) {
|
|
391
|
+
el.setAttribute(THEME_PREVIEW_ATTR, variant);
|
|
392
|
+
}
|
|
393
|
+
installLiveAliases(el, variant);
|
|
394
|
+
el.style.setProperty(name, String(value ?? ''));
|
|
395
|
+
}
|
|
150
396
|
}
|
|
151
397
|
function handleApplyThemeMessage(payload) {
|
|
152
398
|
if (!payload || (payload.variant !== 'light' && payload.variant !== 'dark')) {
|
|
153
399
|
return;
|
|
154
400
|
}
|
|
155
|
-
|
|
401
|
+
const { adaptableId } = payload;
|
|
402
|
+
if (!adaptableId) {
|
|
403
|
+
console.warn('Adaptable DevTools: apply-theme message missing adaptableId');
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const targets = getInstanceThemeElements(adaptableId);
|
|
407
|
+
if (targets.length === 0) {
|
|
408
|
+
console.warn(`Adaptable DevTools: no theme container for "${adaptableId}"`);
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
clearDocumentThemePreview();
|
|
412
|
+
for (const el of targets) {
|
|
413
|
+
applyThemeVars(el, payload);
|
|
414
|
+
}
|
|
415
|
+
syncAgGridPreviewThemes(adaptableId, payload.variant);
|
|
156
416
|
}
|
|
157
417
|
function handleLoadVariantMessage(payload) {
|
|
158
418
|
const { adaptableId, variant } = payload ?? {};
|
|
@@ -160,7 +420,7 @@ function handleLoadVariantMessage(payload) {
|
|
|
160
420
|
console.warn('Adaptable DevTools: load-variant message missing adaptableId or variant');
|
|
161
421
|
return;
|
|
162
422
|
}
|
|
163
|
-
const api =
|
|
423
|
+
const api = getRegisteredApi(adaptableId);
|
|
164
424
|
if (!api) {
|
|
165
425
|
console.warn(`Adaptable DevTools: no registered instance for "${adaptableId}"`);
|
|
166
426
|
return;
|
|
@@ -179,26 +439,472 @@ function handleRestoreStateMessage(payload) {
|
|
|
179
439
|
console.warn('Adaptable DevTools: restore-state message missing adaptableId or state');
|
|
180
440
|
return;
|
|
181
441
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
442
|
+
void restoreState(adaptableId, state).catch((error) => {
|
|
443
|
+
console.error(`Adaptable DevTools: failed to restore state for "${adaptableId}"`, error);
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
function openSettingsPanel(adaptableId, moduleName) {
|
|
447
|
+
const { api } = resolveRegistration(adaptableId);
|
|
448
|
+
const settingsPanelApi = api?.settingsPanelApi;
|
|
449
|
+
if (!settingsPanelApi) {
|
|
450
|
+
throw new Error(`Adaptable DevTools: settings panel is not available for "${adaptableId}" (instance not ready or destroyed)`);
|
|
451
|
+
}
|
|
452
|
+
settingsPanelApi.openSettingsPanel(moduleName);
|
|
453
|
+
}
|
|
454
|
+
function restoreState(adaptableId, state) {
|
|
455
|
+
if (!state || typeof state !== 'object') {
|
|
456
|
+
return Promise.reject(new Error('Adaptable DevTools: restoreState needs a state object'));
|
|
457
|
+
}
|
|
458
|
+
const { api } = resolveRegistration(adaptableId);
|
|
459
|
+
return api.stateApi.internalApi.restoreState(state);
|
|
460
|
+
}
|
|
461
|
+
function buildGridRuntime(api) {
|
|
462
|
+
const selectedRowInfo = api.gridApi.getSelectedRowInfo();
|
|
463
|
+
return {
|
|
464
|
+
allRowsCount: api.gridApi.getRowCount(),
|
|
465
|
+
visibleRowsCount: api.gridApi.getVisibleRowCount(),
|
|
466
|
+
selectedRowsCount: selectedRowInfo?.gridRows?.length ?? 0,
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function buildInstanceSummary(api) {
|
|
470
|
+
const options = api.optionsApi.getAdaptableOptions();
|
|
471
|
+
const globalObject = typeof globalThis !== 'undefined' ? globalThis : window;
|
|
472
|
+
const licenseKey = globalObject.ADAPTABLE_LICENSE_KEY ||
|
|
473
|
+
options.licenseKey;
|
|
474
|
+
return {
|
|
475
|
+
licenseKey: licenseKey || undefined,
|
|
476
|
+
userName: api.optionsApi.getUserName(),
|
|
477
|
+
primaryKey: api.optionsApi.getPrimaryKey(),
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
function buildInstanceInfo(adaptableId, api) {
|
|
481
|
+
const { userName, primaryKey } = buildInstanceSummary(api);
|
|
482
|
+
return {
|
|
483
|
+
adaptableId,
|
|
484
|
+
adaptableVersion: ADAPTABLE_VERSION,
|
|
485
|
+
agGridVersion: AG_GRID_VERSION,
|
|
486
|
+
adaptableStateKey: api.optionsApi.getAdaptableStateKey(),
|
|
487
|
+
primaryKey,
|
|
488
|
+
userName,
|
|
489
|
+
gridRuntime: buildGridRuntime(api),
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
function getStateSnapshot(api) {
|
|
493
|
+
return api.stateApi.internalApi.getAllStateForDevTools
|
|
494
|
+
? api.stateApi.internalApi.getAllStateForDevTools()
|
|
495
|
+
: api.stateApi.getAllState();
|
|
496
|
+
}
|
|
497
|
+
function buildColumns(api) {
|
|
498
|
+
const calculated = new Set(api.calculatedColumnApi.getCalculatedColumns().map((c) => c.ColumnId));
|
|
499
|
+
const freeText = new Set(api.freeTextColumnApi.getFreeTextColumns().map((c) => c.ColumnId));
|
|
500
|
+
const action = new Set(api.actionColumnApi.getActionColumns().map((c) => c.columnId));
|
|
501
|
+
const visible = new Set(api.columnApi.getVisibleColumns().map((c) => c.columnId));
|
|
502
|
+
return api.columnApi.getColumns().map((column) => ({
|
|
503
|
+
id: column.columnId,
|
|
504
|
+
friendlyName: column.friendlyName,
|
|
505
|
+
dataType: column.dataType,
|
|
506
|
+
field: column.field,
|
|
507
|
+
columnTypes: column.columnTypes,
|
|
508
|
+
visible: visible.has(column.columnId),
|
|
509
|
+
readOnly: column.readOnly,
|
|
510
|
+
isPrimaryKey: column.isPrimaryKey,
|
|
511
|
+
isGrouped: column.isGrouped,
|
|
512
|
+
pinned: column.pinned,
|
|
513
|
+
isGeneratedRowGroupColumn: column.isGeneratedRowGroupColumn,
|
|
514
|
+
isGeneratedPivotResultColumn: column.isGeneratedPivotResultColumn,
|
|
515
|
+
isCalculatedColumn: calculated.has(column.columnId),
|
|
516
|
+
isFreeTextColumn: freeText.has(column.columnId),
|
|
517
|
+
isActionColumn: action.has(column.columnId),
|
|
518
|
+
}));
|
|
519
|
+
}
|
|
520
|
+
const COLUMN_INFO_MODULES = [
|
|
521
|
+
'Alert',
|
|
522
|
+
'CalculatedColumn',
|
|
523
|
+
'CustomSort',
|
|
524
|
+
'FormatColumn',
|
|
525
|
+
'FlashingCell',
|
|
526
|
+
'PlusMinus',
|
|
527
|
+
'Shortcut',
|
|
528
|
+
'StyledColumn',
|
|
529
|
+
];
|
|
530
|
+
function isElement(value) {
|
|
531
|
+
return Boolean(value && typeof value === 'object' && 'props' in value);
|
|
532
|
+
}
|
|
533
|
+
function collectTagParts(node, into) {
|
|
534
|
+
if (node == null || typeof node === 'boolean') {
|
|
185
535
|
return;
|
|
186
536
|
}
|
|
187
|
-
|
|
188
|
-
|
|
537
|
+
if (typeof node === 'string' || typeof node === 'number') {
|
|
538
|
+
const text = String(node).trim();
|
|
539
|
+
if (text) {
|
|
540
|
+
into.texts.push(text);
|
|
541
|
+
}
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
if (Array.isArray(node)) {
|
|
545
|
+
node.forEach((child) => collectTagParts(child, into));
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (!isElement(node)) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
const color = node.props?.color;
|
|
552
|
+
if (typeof color === 'string' && color && node.props?.children == null) {
|
|
553
|
+
into.color = getVariableColor(color);
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
collectTagParts(node.props?.children, into);
|
|
557
|
+
}
|
|
558
|
+
function valueToTag(value, variant, italic) {
|
|
559
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
560
|
+
const text = String(value).trim();
|
|
561
|
+
if (!text) {
|
|
562
|
+
return undefined;
|
|
563
|
+
}
|
|
564
|
+
const parsed = parseSummaryLabelValueString(text);
|
|
565
|
+
if (parsed && isSummaryColorLabel(parsed.label)) {
|
|
566
|
+
return { text: parsed.label, color: getVariableColor(parsed.value), variant, italic };
|
|
567
|
+
}
|
|
568
|
+
return { text, variant, italic };
|
|
569
|
+
}
|
|
570
|
+
const parts = { texts: [] };
|
|
571
|
+
collectTagParts(value, parts);
|
|
572
|
+
if (!parts.texts.length && !parts.color) {
|
|
573
|
+
return undefined;
|
|
574
|
+
}
|
|
575
|
+
return { text: parts.texts.join(' '), color: parts.color, variant, italic };
|
|
576
|
+
}
|
|
577
|
+
function viewItemLabel(item) {
|
|
578
|
+
if (typeof item.label === 'string' && item.label.trim()) {
|
|
579
|
+
return item.label.trim();
|
|
580
|
+
}
|
|
581
|
+
return item.name ?? '';
|
|
582
|
+
}
|
|
583
|
+
function serializeViewItems(items) {
|
|
584
|
+
const rows = [];
|
|
585
|
+
for (const item of items) {
|
|
586
|
+
const variant = item.tagVariant === 'default' ? undefined : item.tagVariant;
|
|
587
|
+
const italic = item.tagClassName?.includes('italic') ? true : undefined;
|
|
588
|
+
const tags = (item.values ?? [])
|
|
589
|
+
.map((value) => valueToTag(value, variant, italic))
|
|
590
|
+
.filter((tag) => tag != null);
|
|
591
|
+
if (!tags.length) {
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
rows.push({ label: viewItemLabel(item), tags });
|
|
595
|
+
}
|
|
596
|
+
return rows;
|
|
597
|
+
}
|
|
598
|
+
function summaryRow(key, value) {
|
|
599
|
+
if (value == null || value === '' || value === false) {
|
|
600
|
+
return undefined;
|
|
601
|
+
}
|
|
602
|
+
return { key, value: String(value) };
|
|
603
|
+
}
|
|
604
|
+
function yesNo(value) {
|
|
605
|
+
return value ? 'Yes' : 'No';
|
|
606
|
+
}
|
|
607
|
+
function buildColumnDetail(adaptableId, registration, columnId) {
|
|
608
|
+
const api = registration.api;
|
|
609
|
+
const columns = api.columnApi.getColumns();
|
|
610
|
+
const options = columns.map((column) => ({
|
|
611
|
+
id: column.columnId,
|
|
612
|
+
friendlyName: column.friendlyName,
|
|
613
|
+
}));
|
|
614
|
+
if (!columns.length) {
|
|
615
|
+
return { columnId: '', columns: [], summary: [], scopedObjects: [] };
|
|
616
|
+
}
|
|
617
|
+
const resolvedId = columnId || columns[0].columnId;
|
|
618
|
+
const column = api.columnApi.getColumnWithColumnId(resolvedId);
|
|
619
|
+
if (!column) {
|
|
620
|
+
throw new Error(`Adaptable DevTools: unknown column "${resolvedId}" on "${adaptableId}". Columns: ${options
|
|
621
|
+
.map((option) => `"${option.id}"`)
|
|
622
|
+
.join(', ')}.`);
|
|
623
|
+
}
|
|
624
|
+
const layout = api.layoutApi.getCurrentLayout();
|
|
625
|
+
const visible = new Set(api.columnApi.getVisibleColumns().map((entry) => entry.columnId));
|
|
626
|
+
const resolveDefaultWidth = (id) => registration.instance?.getDefaultColumnWidthForCol(id) ?? 0;
|
|
627
|
+
const columnFilter = api.filterApi.columnFilterApi.getColumnFilterForColumn(column.columnId);
|
|
628
|
+
const filterText = columnFilter
|
|
629
|
+
? api.filterApi.columnFilterApi.columnFilterToString(columnFilter)
|
|
630
|
+
: '';
|
|
631
|
+
const summary = [
|
|
632
|
+
summaryRow('Column Id', column.columnId),
|
|
633
|
+
summaryRow('Header', column.friendlyName),
|
|
634
|
+
summaryRow('Data Type', column.dataType),
|
|
635
|
+
summaryRow('Column Types', column.columnTypes?.join(', ')),
|
|
636
|
+
summaryRow('Primary Key Column', column.isPrimaryKey ? 'Yes' : undefined),
|
|
637
|
+
summaryRow('Calculated Column', column.isCalculatedColumn ? 'Yes' : undefined),
|
|
638
|
+
summaryRow('Free Text Column', column.isFreeTextColumn ? 'Yes' : undefined),
|
|
639
|
+
summaryRow('Action Column', column.isActionColumn ? 'Yes' : undefined),
|
|
640
|
+
summaryRow('Sparkline Column', column.isSparkline ? 'Yes' : undefined),
|
|
641
|
+
summaryRow('Column Group', column.columnGroup?.friendlyName),
|
|
642
|
+
{ key: 'Visible', value: yesNo(visible.has(column.columnId)) },
|
|
643
|
+
{ key: 'Pinning', value: formatColumnInspectorPinning(layout, column.columnId) },
|
|
644
|
+
{
|
|
645
|
+
key: 'Width',
|
|
646
|
+
value: (() => {
|
|
647
|
+
const explicit = formatColumnInspectorSizing(column.columnId, layout.ColumnSizing?.[column.columnId], resolveDefaultWidth);
|
|
648
|
+
return explicit === 'Default' ? String(resolveDefaultWidth(column.columnId)) : explicit;
|
|
649
|
+
})(),
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
key: 'Sorting',
|
|
653
|
+
value: (layout.ColumnSorts ?? []).find((sort) => sort.ColumnId === column.columnId)?.SortOrder ??
|
|
654
|
+
'None',
|
|
655
|
+
},
|
|
656
|
+
summaryRow('Row Grouped', column.groupable ? yesNo(column.isGrouped) : undefined),
|
|
657
|
+
{ key: 'Groupable', value: yesNo(column.groupable) },
|
|
658
|
+
{ key: 'Aggregatable', value: yesNo(column.aggregatable) },
|
|
659
|
+
summaryRow('Aggregation Function', column.aggregatable ? column.aggregationFunction : undefined),
|
|
660
|
+
{ key: 'Filterable', value: yesNo(column.filterable) },
|
|
661
|
+
summaryRow('Column Filter', column.filterable ? filterText : undefined),
|
|
662
|
+
{ key: 'Hideable', value: yesNo(column.hideable) },
|
|
663
|
+
{ key: 'Editable', value: yesNo(!column.readOnly) },
|
|
664
|
+
{ key: 'Moveable', value: yesNo(column.moveable) },
|
|
665
|
+
{ key: 'Pivotable', value: yesNo(column.pivotable) },
|
|
666
|
+
{ key: 'Queryable', value: yesNo(column.queryable) },
|
|
667
|
+
{ key: 'Exportable', value: yesNo(column.exportable) },
|
|
668
|
+
{ key: 'Sortable', value: yesNo(column.sortable) },
|
|
669
|
+
].filter((row) => row != null);
|
|
670
|
+
const moduleService = api.internalApi.getModuleService();
|
|
671
|
+
const scopedObjects = [];
|
|
672
|
+
for (const moduleName of COLUMN_INFO_MODULES) {
|
|
673
|
+
const module = moduleService.getModuleById(moduleName);
|
|
674
|
+
if (!module?.isModuleVisible() || !module.toViewAll) {
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
if (module.moduleInfo.ModuleName === 'CalculatedColumn' && !column.isCalculatedColumn) {
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
const itemsInScope = module.toViewAll().filter((item) => {
|
|
681
|
+
if ('Scope' in item.abObject) {
|
|
682
|
+
return api.columnScopeApi.isColumnInScope(column, item.abObject.Scope);
|
|
683
|
+
}
|
|
684
|
+
if ('ColumnId' in item.abObject) {
|
|
685
|
+
return item.abObject.ColumnId === column.columnId;
|
|
686
|
+
}
|
|
687
|
+
return false;
|
|
688
|
+
});
|
|
689
|
+
for (const item of itemsInScope) {
|
|
690
|
+
const rows = serializeViewItems(item.items);
|
|
691
|
+
if (rows.length) {
|
|
692
|
+
scopedObjects.push({ module: module.moduleInfo.FriendlyName, rows });
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return {
|
|
697
|
+
columnId: column.columnId,
|
|
698
|
+
columns: options,
|
|
699
|
+
summary,
|
|
700
|
+
scopedObjects,
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
function buildGridInfo(adaptableId, api) {
|
|
704
|
+
const { licenseKey, userName, primaryKey } = buildInstanceSummary(api);
|
|
705
|
+
const currentLayout = api.layoutApi.getCurrentLayout();
|
|
706
|
+
const isPivot = isPivotLayout(currentLayout);
|
|
707
|
+
const selectedRowInfo = api.gridApi.getSelectedRowInfo();
|
|
708
|
+
const available = [];
|
|
709
|
+
const unavailable = [];
|
|
710
|
+
api.internalApi.getModules().forEach((module, moduleName) => {
|
|
711
|
+
(module.isModuleAvailable() ? available : unavailable).push(moduleName);
|
|
189
712
|
});
|
|
713
|
+
return {
|
|
714
|
+
adaptableId,
|
|
715
|
+
adaptableVersion: ADAPTABLE_VERSION,
|
|
716
|
+
agGridVersion: AG_GRID_VERSION,
|
|
717
|
+
adaptableStateKey: api.optionsApi.getAdaptableStateKey(),
|
|
718
|
+
userName,
|
|
719
|
+
primaryKey,
|
|
720
|
+
isAutogeneratedPrimaryKey: api.optionsApi.isAutogeneratePrimaryKey(),
|
|
721
|
+
licenseKey,
|
|
722
|
+
layout: {
|
|
723
|
+
name: api.layoutApi.getCurrentLayoutName(),
|
|
724
|
+
type: isPivot ? 'Pivot' : 'Table',
|
|
725
|
+
rowGroups: api.layoutApi.getCurrentRowGroupsColumnIds() ?? [],
|
|
726
|
+
pivotColumns: isPivot ? (currentLayout.PivotColumns ?? []) : [],
|
|
727
|
+
sorts: (api.gridApi.getColumnSorts() ?? []).map((sort) => ({
|
|
728
|
+
columnId: sort.ColumnId,
|
|
729
|
+
sortOrder: sort.SortOrder,
|
|
730
|
+
})),
|
|
731
|
+
},
|
|
732
|
+
columnFilters: api.filterApi.columnFilterApi.columnFiltersToString(api.filterApi.columnFilterApi.getColumnFilters()),
|
|
733
|
+
gridFilter: api.filterApi.gridFilterApi.getCurrentGridFilterExpression() || undefined,
|
|
734
|
+
rows: {
|
|
735
|
+
all: api.gridApi.getRowCount(),
|
|
736
|
+
visible: api.gridApi.getVisibleRowCount(),
|
|
737
|
+
selected: selectedRowInfo?.gridRows?.length ?? 0,
|
|
738
|
+
},
|
|
739
|
+
columns: {
|
|
740
|
+
all: api.gridApi.getColumnCount(),
|
|
741
|
+
visible: api.gridApi.getVisibleColumnCount(),
|
|
742
|
+
calculated: api.calculatedColumnApi.getCalculatedColumns().map((c) => c.ColumnId),
|
|
743
|
+
freeText: api.freeTextColumnApi.getFreeTextColumns().map((c) => c.ColumnId),
|
|
744
|
+
action: api.actionColumnApi.getActionColumns().map((c) => c.columnId),
|
|
745
|
+
},
|
|
746
|
+
modules: { available, unavailable },
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
function getLocalStorage() {
|
|
750
|
+
try {
|
|
751
|
+
return typeof localStorage !== 'undefined' ? localStorage : undefined;
|
|
752
|
+
}
|
|
753
|
+
catch {
|
|
754
|
+
return undefined;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
const DEVTOOLS_HELP = `AdapTable DevTools in-page API (window.${DEVTOOLS_GLOBAL_NAME}). Every method returns plain JSON unless noted.
|
|
758
|
+
Omit adaptableId when one instance is mounted.
|
|
759
|
+
|
|
760
|
+
listInstances() -> [{ adaptableId, adaptableVersion, agGridVersion, primaryKey, userName, gridRuntime }]
|
|
761
|
+
getGridInfo(id?) -> versions, layout, filters, row/column counts, modules (the Settings Panel "Grid Info" facts)
|
|
762
|
+
getState(id?, section?) -> full AdapTable State, or one section such as 'Layout' or 'FormatColumn'
|
|
763
|
+
getPersistentState(id?) -> the user state AdapTable persists; pass it to the MCP check_state / migrate_state tools
|
|
764
|
+
getColumns(id?) -> [{ id, friendlyName, dataType, visible, ... }]; { id, dataType } is the MCP "columns" input
|
|
765
|
+
getColumnInfo(id?, columnId?) -> read-only Column Info: summary and Settings Panel tags for objects scoped to that column
|
|
766
|
+
getLogs(id?, { level?, channel?, limit? }) -> recent AdapTable log messages, buffered without localStorage.debug
|
|
767
|
+
getRecentActions(id?, limit?) -> recent state-changing actions
|
|
768
|
+
restoreState(id, state) -> Promise; restores a snapshot from getState()/getPersistentState()
|
|
769
|
+
openSettingsPanel(id?, moduleName?) -> opens the Settings Panel (e.g. 'Layout', 'FormatColumn')
|
|
770
|
+
setLogging(pattern | null) -> sets localStorage.debug (e.g. 'Adaptable:<id>:*'); returns the previous value
|
|
771
|
+
enableProfiling(enabled?) -> toggles localStorage.adaptableProfileTracks
|
|
772
|
+
getApi(id?) -> the live AdaptableApi (not serializable)
|
|
773
|
+
|
|
774
|
+
Docs: https://www.adaptabletools.com/docs/dev-guide-support-devtools`;
|
|
775
|
+
function createDevToolsGlobal() {
|
|
776
|
+
return {
|
|
777
|
+
help() {
|
|
778
|
+
return DEVTOOLS_HELP;
|
|
779
|
+
},
|
|
780
|
+
listInstances() {
|
|
781
|
+
const result = [];
|
|
782
|
+
for (const [adaptableId, registration] of INSTANCE_REGISTRATIONS) {
|
|
783
|
+
if (registration.instance?.isDestroyed) {
|
|
784
|
+
continue;
|
|
785
|
+
}
|
|
786
|
+
result.push(buildInstanceInfo(adaptableId, registration.api));
|
|
787
|
+
}
|
|
788
|
+
return result;
|
|
789
|
+
},
|
|
790
|
+
getState(adaptableId, section) {
|
|
791
|
+
const { api } = resolveRegistration(adaptableId);
|
|
792
|
+
const state = serializeAdaptableStateForPostMessage(getStateSnapshot(api));
|
|
793
|
+
if (section == null) {
|
|
794
|
+
return state;
|
|
795
|
+
}
|
|
796
|
+
if (!(section in state)) {
|
|
797
|
+
throw new Error(`Adaptable DevTools: unknown state section "${String(section)}". Sections: ${Object.keys(state).join(', ')}`);
|
|
798
|
+
}
|
|
799
|
+
return state[section];
|
|
800
|
+
},
|
|
801
|
+
getPersistentState(adaptableId) {
|
|
802
|
+
const { api } = resolveRegistration(adaptableId);
|
|
803
|
+
return serializeForPostMessage(api.stateApi.getPersistentState());
|
|
804
|
+
},
|
|
805
|
+
getColumns(adaptableId) {
|
|
806
|
+
const { api } = resolveRegistration(adaptableId);
|
|
807
|
+
return serializeForPostMessage(buildColumns(api));
|
|
808
|
+
},
|
|
809
|
+
getColumnInfo(adaptableId, columnId) {
|
|
810
|
+
const registration = resolveRegistration(adaptableId);
|
|
811
|
+
const id = adaptableId ?? registration.api.optionsApi.getAdaptableId();
|
|
812
|
+
return serializeForPostMessage(buildColumnDetail(id, registration, columnId));
|
|
813
|
+
},
|
|
814
|
+
getGridInfo(adaptableId) {
|
|
815
|
+
const registration = resolveRegistration(adaptableId);
|
|
816
|
+
const id = adaptableId ?? registration.api.optionsApi.getAdaptableId();
|
|
817
|
+
return serializeForPostMessage(buildGridInfo(id, registration.api));
|
|
818
|
+
},
|
|
819
|
+
getLogs(adaptableId, options) {
|
|
820
|
+
const registration = resolveRegistration(adaptableId);
|
|
821
|
+
const id = adaptableId ?? registration.api.optionsApi.getAdaptableId();
|
|
822
|
+
const { level, channel, limit = DEFAULT_LOG_LIMIT } = options ?? {};
|
|
823
|
+
const levels = level == null ? null : new Set(Array.isArray(level) ? level : [level]);
|
|
824
|
+
const entries = (LOG_BUFFERS.get(id) ?? []).filter((entry) => (!levels || levels.has(entry.level)) && (!channel || entry.channel.includes(channel)));
|
|
825
|
+
return entries.slice(Math.max(0, entries.length - limit)).map((entry) => ({ ...entry }));
|
|
826
|
+
},
|
|
827
|
+
getRecentActions(adaptableId, limit = DEFAULT_ACTION_LIMIT) {
|
|
828
|
+
const { actions } = resolveRegistration(adaptableId);
|
|
829
|
+
return actions.slice(Math.max(0, actions.length - limit)).map((entry) => ({ ...entry }));
|
|
830
|
+
},
|
|
831
|
+
restoreState(adaptableId, state) {
|
|
832
|
+
return restoreState(adaptableId, state);
|
|
833
|
+
},
|
|
834
|
+
openSettingsPanel(adaptableId, moduleName) {
|
|
835
|
+
openSettingsPanel(adaptableId, moduleName);
|
|
836
|
+
},
|
|
837
|
+
setLogging(pattern) {
|
|
838
|
+
const storage = getLocalStorage();
|
|
839
|
+
if (!storage) {
|
|
840
|
+
throw new Error('Adaptable DevTools: localStorage is not available');
|
|
841
|
+
}
|
|
842
|
+
const previous = storage.getItem(DEBUG_STORAGE_KEY);
|
|
843
|
+
if (pattern == null || pattern === '') {
|
|
844
|
+
storage.removeItem(DEBUG_STORAGE_KEY);
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
storage.setItem(DEBUG_STORAGE_KEY, pattern);
|
|
848
|
+
}
|
|
849
|
+
return previous;
|
|
850
|
+
},
|
|
851
|
+
enableProfiling(enabled = true) {
|
|
852
|
+
const storage = getLocalStorage();
|
|
853
|
+
if (!storage) {
|
|
854
|
+
throw new Error('Adaptable DevTools: localStorage is not available');
|
|
855
|
+
}
|
|
856
|
+
if (enabled) {
|
|
857
|
+
storage.setItem(PROFILE_TRACKS_STORAGE_KEY, 'true');
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
storage.removeItem(PROFILE_TRACKS_STORAGE_KEY);
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
getApi(adaptableId) {
|
|
864
|
+
return resolveRegistration(adaptableId).api;
|
|
865
|
+
},
|
|
866
|
+
};
|
|
190
867
|
}
|
|
868
|
+
function ensureDevToolsGlobal() {
|
|
869
|
+
if (typeof window === 'undefined') {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
if (!window[DEVTOOLS_GLOBAL_NAME]) {
|
|
873
|
+
Object.defineProperty(window, DEVTOOLS_GLOBAL_NAME, {
|
|
874
|
+
value: createDevToolsGlobal(),
|
|
875
|
+
writable: false,
|
|
876
|
+
configurable: true,
|
|
877
|
+
enumerable: false,
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
function setupDevToolsOnLoad() {
|
|
882
|
+
if (typeof window === 'undefined') {
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
ensureDevToolsGlobal();
|
|
886
|
+
ensureLogIntentListening();
|
|
887
|
+
}
|
|
888
|
+
setupDevToolsOnLoad();
|
|
191
889
|
export function listenForDevTools(adaptableInstance) {
|
|
192
|
-
if (typeof window
|
|
890
|
+
if (typeof window === 'undefined') {
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
setupDevToolsOnLoad();
|
|
894
|
+
if (!DEV_TOOLS_LISTENING_STARTED) {
|
|
193
895
|
DEV_TOOLS_LISTENING_STARTED = true;
|
|
194
896
|
window.addEventListener('message', (event) => {
|
|
897
|
+
if (event.source !== window) {
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
195
900
|
if (!isMessageFromDevToolsContentScript(event.data)) {
|
|
196
901
|
return;
|
|
197
902
|
}
|
|
198
|
-
|
|
903
|
+
ensureDevToolsReady();
|
|
199
904
|
const handlers = {
|
|
200
905
|
'restore-state': handleRestoreStateMessage,
|
|
201
906
|
'open-settings-panel': handleOpenSettingsPanelMessage,
|
|
907
|
+
'get-column-info': handleGetColumnInfoMessage,
|
|
202
908
|
'load-variant': handleLoadVariantMessage,
|
|
203
909
|
'theme-var-change': handleThemeVarChangeMessage,
|
|
204
910
|
'apply-theme': handleApplyThemeMessage,
|
|
@@ -206,28 +912,12 @@ export function listenForDevTools(adaptableInstance) {
|
|
|
206
912
|
handlers[event.data.type]?.(event.data.payload);
|
|
207
913
|
});
|
|
208
914
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
registerAdaptableInstanceInDevTools(adaptableOptions.adaptableId, { api }, adaptableInstance);
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
const REGISTERED_ADAPTABLE_IDS = new Set();
|
|
219
|
-
const REGISTERED_ADAPTABLE_APIS = new Map();
|
|
220
|
-
const REGISTERED_ADAPTABLE_INSTANCES = new Map();
|
|
221
|
-
const pendingGridRuntimeUpdates = new Map();
|
|
222
|
-
const GRID_RUNTIME_FALLBACK_DELAY_MS = 100;
|
|
223
|
-
const INSTANCE_REGISTRATIONS = new Map();
|
|
224
|
-
function buildGridRuntime(api) {
|
|
225
|
-
const selectedRowInfo = api.gridApi.getSelectedRowInfo();
|
|
226
|
-
return {
|
|
227
|
-
allRowsCount: api.gridApi.getRowCount(),
|
|
228
|
-
visibleRowsCount: api.gridApi.getVisibleRowCount(),
|
|
229
|
-
selectedRowsCount: selectedRowInfo?.gridRows?.length ?? 0,
|
|
230
|
-
};
|
|
915
|
+
const { api, adaptableOptions } = adaptableInstance;
|
|
916
|
+
if (!api || !adaptableOptions) {
|
|
917
|
+
console.error('Cannot register Adaptable instance in DevTools because it is not ready', adaptableInstance);
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
registerAdaptableInstanceInDevTools(adaptableOptions.adaptableId, api, adaptableInstance);
|
|
231
921
|
}
|
|
232
922
|
function postMountMessage(adaptableId, api) {
|
|
233
923
|
window.postMessage(buildMessageForExtension({
|
|
@@ -235,7 +925,8 @@ function postMountMessage(adaptableId, api) {
|
|
|
235
925
|
adaptableId,
|
|
236
926
|
adaptableVersion: ADAPTABLE_VERSION,
|
|
237
927
|
agGridVersion: AG_GRID_VERSION,
|
|
238
|
-
|
|
928
|
+
...buildInstanceSummary(api),
|
|
929
|
+
settingsPanelNavigation: resolveVisibleSettingsPanelNavigationGroups(api),
|
|
239
930
|
}));
|
|
240
931
|
}
|
|
241
932
|
function cancelScheduledGridRuntimeUpdate(adaptableId) {
|
|
@@ -253,28 +944,31 @@ function scheduleGridRuntimeUpdate(adaptableId, api, delayMs = GRID_RUNTIME_FALL
|
|
|
253
944
|
}, delayMs));
|
|
254
945
|
}
|
|
255
946
|
function postStateChangeMessage(adaptableId, options) {
|
|
256
|
-
const api = options?.api ??
|
|
947
|
+
const api = options?.api ?? getRegisteredApi(adaptableId);
|
|
257
948
|
if (!api) {
|
|
258
949
|
return;
|
|
259
950
|
}
|
|
260
|
-
const state = api.stateApi.internalApi.getAllStateForDevTools
|
|
261
|
-
? api.stateApi.internalApi.getAllStateForDevTools()
|
|
262
|
-
: api.stateApi.getAllState();
|
|
263
951
|
window.postMessage(buildMessageForExtension({
|
|
264
952
|
type: 'state-change',
|
|
265
953
|
adaptableId,
|
|
266
|
-
state: serializeAdaptableStateForPostMessage(
|
|
954
|
+
state: serializeAdaptableStateForPostMessage(getStateSnapshot(api)),
|
|
267
955
|
actionName: options?.actionName,
|
|
956
|
+
...buildInstanceSummary(api),
|
|
957
|
+
settingsPanelNavigation: resolveVisibleSettingsPanelNavigationGroups(api),
|
|
268
958
|
}));
|
|
269
959
|
if (options?.api) {
|
|
270
960
|
scheduleGridRuntimeUpdate(adaptableId, options.api);
|
|
271
961
|
}
|
|
272
962
|
}
|
|
273
963
|
function postGridRuntimeUpdate(adaptableId, api) {
|
|
964
|
+
if (!DEV_TOOLS_READY) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
274
967
|
window.postMessage(buildMessageForExtension({
|
|
275
968
|
type: 'state-change',
|
|
276
969
|
adaptableId,
|
|
277
970
|
gridRuntime: buildGridRuntime(api),
|
|
971
|
+
...buildInstanceSummary(api),
|
|
278
972
|
}));
|
|
279
973
|
}
|
|
280
974
|
function detachAdaptableInstanceListeners(adaptableId) {
|
|
@@ -284,13 +978,13 @@ function detachAdaptableInstanceListeners(adaptableId) {
|
|
|
284
978
|
registration.unsubscribe();
|
|
285
979
|
INSTANCE_REGISTRATIONS.delete(adaptableId);
|
|
286
980
|
}
|
|
287
|
-
REGISTERED_ADAPTABLE_IDS.delete(adaptableId);
|
|
288
|
-
REGISTERED_ADAPTABLE_APIS.delete(adaptableId);
|
|
289
|
-
REGISTERED_ADAPTABLE_INSTANCES.delete(adaptableId);
|
|
290
981
|
}
|
|
291
982
|
function unregisterAdaptableInstanceFromDevTools(adaptableId) {
|
|
292
983
|
detachAdaptableInstanceListeners(adaptableId);
|
|
293
|
-
|
|
984
|
+
LOG_BUFFERS.delete(adaptableId);
|
|
985
|
+
if (DEV_TOOLS_READY) {
|
|
986
|
+
window.postMessage(buildMessageForExtension({ type: 'unmount', adaptableId }));
|
|
987
|
+
}
|
|
294
988
|
}
|
|
295
989
|
const messageBase = {
|
|
296
990
|
source: 'adaptable-page',
|
|
@@ -324,6 +1018,20 @@ function buildMessageForExtension(params) {
|
|
|
324
1018
|
adaptableVersion: payload?.adaptableVersion,
|
|
325
1019
|
agGridVersion: payload?.agGridVersion,
|
|
326
1020
|
licenseKey: payload?.licenseKey,
|
|
1021
|
+
userName: payload?.userName,
|
|
1022
|
+
primaryKey: payload?.primaryKey,
|
|
1023
|
+
settingsPanelNavigation: payload?.settingsPanelNavigation,
|
|
1024
|
+
},
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
if (type === 'column-info') {
|
|
1028
|
+
return {
|
|
1029
|
+
...messageBase,
|
|
1030
|
+
url,
|
|
1031
|
+
type,
|
|
1032
|
+
payload: {
|
|
1033
|
+
adaptableId,
|
|
1034
|
+
columnInfo: payload?.columnInfo,
|
|
327
1035
|
},
|
|
328
1036
|
};
|
|
329
1037
|
}
|
|
@@ -337,6 +1045,10 @@ function buildMessageForExtension(params) {
|
|
|
337
1045
|
state: payload?.state,
|
|
338
1046
|
actionName: payload?.actionName,
|
|
339
1047
|
gridRuntime: payload?.gridRuntime,
|
|
1048
|
+
licenseKey: payload?.licenseKey,
|
|
1049
|
+
userName: payload?.userName,
|
|
1050
|
+
primaryKey: payload?.primaryKey,
|
|
1051
|
+
settingsPanelNavigation: payload?.settingsPanelNavigation,
|
|
340
1052
|
},
|
|
341
1053
|
};
|
|
342
1054
|
}
|
|
@@ -351,30 +1063,34 @@ function buildMessageForExtension(params) {
|
|
|
351
1063
|
};
|
|
352
1064
|
return message;
|
|
353
1065
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
if (
|
|
357
|
-
|
|
1066
|
+
function recordAction(registration, actionName) {
|
|
1067
|
+
registration.actions.push({ timestamp: Date.now(), actionName });
|
|
1068
|
+
if (registration.actions.length > MAX_ACTION_ENTRIES_PER_INSTANCE) {
|
|
1069
|
+
registration.actions.splice(0, registration.actions.length - MAX_ACTION_ENTRIES_PER_INSTANCE);
|
|
358
1070
|
}
|
|
359
|
-
postStateChangeMessage(adaptableId, { api });
|
|
360
1071
|
}
|
|
361
|
-
function registerAdaptableInstanceInDevTools(adaptableId,
|
|
362
|
-
const { api } = options;
|
|
1072
|
+
function registerAdaptableInstanceInDevTools(adaptableId, api, adaptableInstance) {
|
|
363
1073
|
detachAdaptableInstanceListeners(adaptableId);
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
1074
|
+
const registration = {
|
|
1075
|
+
api,
|
|
1076
|
+
instance: adaptableInstance,
|
|
1077
|
+
actions: [],
|
|
1078
|
+
unsubscribe: () => { },
|
|
1079
|
+
};
|
|
370
1080
|
const onStateChange = (info) => {
|
|
371
|
-
|
|
1081
|
+
if (isTransientReduxAction(info.actionName)) {
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
recordAction(registration, info.actionName);
|
|
1085
|
+
if (DEV_TOOLS_READY) {
|
|
1086
|
+
postStateChangeMessage(adaptableId, { actionName: info.actionName, api });
|
|
1087
|
+
}
|
|
372
1088
|
};
|
|
373
1089
|
const onStateReloaded = () => {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
api
|
|
377
|
-
}
|
|
1090
|
+
recordAction(registration, 'AdaptableStateReloaded');
|
|
1091
|
+
if (DEV_TOOLS_READY) {
|
|
1092
|
+
postStateChangeMessage(adaptableId, { actionName: 'AdaptableStateReloaded', api });
|
|
1093
|
+
}
|
|
378
1094
|
};
|
|
379
1095
|
const unsubscribeStateChanged = api.eventApi.on('AdaptableStateChanged', onStateChange);
|
|
380
1096
|
const unsubscribeStateReloaded = api.eventApi.on('AdaptableStateReloaded', onStateReloaded);
|
|
@@ -384,21 +1100,21 @@ function registerAdaptableInstanceInDevTools(adaptableId, options, adaptableInst
|
|
|
384
1100
|
const unsubscribeDestroy = api.eventApi.on('AdaptableDestroy', () => {
|
|
385
1101
|
unregisterAdaptableInstanceFromDevTools(adaptableId);
|
|
386
1102
|
});
|
|
387
|
-
const
|
|
388
|
-
const unsubscribeFiltersApplied = adaptableGrid?._on('AdapTableFiltersApplied', () => {
|
|
1103
|
+
const unsubscribeFiltersApplied = adaptableInstance._on('AdapTableFiltersApplied', () => {
|
|
389
1104
|
cancelScheduledGridRuntimeUpdate(adaptableId);
|
|
390
1105
|
postGridRuntimeUpdate(adaptableId, api);
|
|
391
1106
|
});
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
1107
|
+
registration.unsubscribe = () => {
|
|
1108
|
+
unsubscribeStateChanged();
|
|
1109
|
+
unsubscribeStateReloaded();
|
|
1110
|
+
unsubscribeRowSelectionChanged();
|
|
1111
|
+
unsubscribeFiltersApplied?.();
|
|
1112
|
+
unsubscribeDestroy();
|
|
1113
|
+
};
|
|
1114
|
+
INSTANCE_REGISTRATIONS.set(adaptableId, registration);
|
|
1115
|
+
if (DEV_TOOLS_READY) {
|
|
1116
|
+
console.log(`Registering instance "${adaptableId}" into Adaptable DevTools`);
|
|
1117
|
+
postMountMessage(adaptableId, api);
|
|
1118
|
+
postStateChangeMessage(adaptableId, { api });
|
|
1119
|
+
}
|
|
404
1120
|
}
|