@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
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as Redux from 'redux';
|
|
2
2
|
import { QuickSearchState } from '../../AdaptableState/QuickSearchState';
|
|
3
3
|
import { AdaptableStyle } from '../../AdaptableState/Common/AdaptableStyle';
|
|
4
|
-
export declare const QUICK_SEARCH_DEFAULT_CELL_MATCH_STYLE: {
|
|
5
|
-
BackColor: string;
|
|
6
|
-
ForeColor: string;
|
|
7
|
-
};
|
|
8
4
|
export declare const QUICK_SEARCH_DEFAULT_TEXT_MATCH_STYLE: {
|
|
9
5
|
BackColor: string;
|
|
10
6
|
ForeColor: string;
|
|
@@ -18,6 +14,10 @@ export declare const QUICK_SEARCH_DEFAULT_CURRENT_TEXT_MATCH_STYLE: {
|
|
|
18
14
|
* @ReduxAction Runs Quick Search
|
|
19
15
|
*/
|
|
20
16
|
export declare const QUICK_SEARCH_RUN = "QUICK_SEARCH_RUN";
|
|
17
|
+
/**
|
|
18
|
+
* @ReduxAction Clears Quick Search text
|
|
19
|
+
*/
|
|
20
|
+
export declare const QUICK_SEARCH_CLEAR = "QUICK_SEARCH_CLEAR";
|
|
21
21
|
/**
|
|
22
22
|
* @ReduxAction Sets Quick Search whole-cell style (SSRM / legacy)
|
|
23
23
|
*/
|
|
@@ -37,6 +37,8 @@ export declare const QUICK_SEARCH_READY = "QUICK_SEARCH_READY";
|
|
|
37
37
|
export interface QuickSearchRunAction extends Redux.Action {
|
|
38
38
|
quickSearchText: string;
|
|
39
39
|
}
|
|
40
|
+
export interface QuickSearchClearAction extends Redux.Action {
|
|
41
|
+
}
|
|
40
42
|
export interface QuickSearchSetMatchingCellStyleAction extends Redux.Action {
|
|
41
43
|
matchingCellStyle: AdaptableStyle;
|
|
42
44
|
}
|
|
@@ -50,6 +52,9 @@ export interface QuickSearchReadyAction extends Redux.Action {
|
|
|
50
52
|
quickSearchState: QuickSearchState;
|
|
51
53
|
}
|
|
52
54
|
export declare const QuickSearchRun: (quickSearchText: string) => QuickSearchRunAction;
|
|
55
|
+
export declare const QuickSearchClear: () => QuickSearchClearAction;
|
|
56
|
+
/** Runs Quick Search, or clears it when the text is empty. */
|
|
57
|
+
export declare const QuickSearchTextAction: (quickSearchText: string) => QuickSearchRunAction | QuickSearchClearAction;
|
|
53
58
|
export declare const QuickSearchSetCellMatchingStyle: (matchingCellStyle: AdaptableStyle) => QuickSearchSetMatchingCellStyleAction;
|
|
54
59
|
export declare const QuickSearchSetTextMatchingStyle: (textMatchStyle: AdaptableStyle) => QuickSearchSetTextMatchingStyleAction;
|
|
55
60
|
export declare const QuickSearchSetCurrentTextMatchingStyle: (currentTextMatchStyle: AdaptableStyle) => QuickSearchSetCurrentTextMatchingStyleAction;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QUICK_SEARCH_DEFAULT_CURRENT_BACK_COLOR, QUICK_SEARCH_DEFAULT_CURRENT_FORE_COLOR, QUICK_SEARCH_DEFAULT_TEXT_BACK_COLOR, QUICK_SEARCH_DEFAULT_TEXT_FORE_COLOR, } from '../../Utilities/Constants/ReduxConstants';
|
|
2
2
|
import { EMPTY_STRING } from '../../Utilities/Constants/GeneralConstants';
|
|
3
|
-
export const QUICK_SEARCH_DEFAULT_CELL_MATCH_STYLE = {
|
|
4
|
-
BackColor: QUICK_SEARCH_DEFAULT_CELL_BACK_COLOR,
|
|
5
|
-
ForeColor: QUICK_SEARCH_DEFAULT_FORE_COLOR,
|
|
6
|
-
};
|
|
7
3
|
export const QUICK_SEARCH_DEFAULT_TEXT_MATCH_STYLE = {
|
|
8
4
|
BackColor: QUICK_SEARCH_DEFAULT_TEXT_BACK_COLOR,
|
|
9
|
-
ForeColor:
|
|
5
|
+
ForeColor: QUICK_SEARCH_DEFAULT_TEXT_FORE_COLOR,
|
|
10
6
|
};
|
|
11
7
|
export const QUICK_SEARCH_DEFAULT_CURRENT_TEXT_MATCH_STYLE = {
|
|
12
8
|
BackColor: QUICK_SEARCH_DEFAULT_CURRENT_BACK_COLOR,
|
|
13
|
-
ForeColor:
|
|
9
|
+
ForeColor: QUICK_SEARCH_DEFAULT_CURRENT_FORE_COLOR,
|
|
14
10
|
FontWeight: 'Bold',
|
|
15
11
|
};
|
|
16
12
|
export const QUICK_SEARCH_RUN = 'QUICK_SEARCH_RUN';
|
|
13
|
+
export const QUICK_SEARCH_CLEAR = 'QUICK_SEARCH_CLEAR';
|
|
17
14
|
export const QUICK_SEARCH_SET_CELL_MATCHING_STYLE = 'QUICK_SEARCH_SET_CELL_MATCHING_STYLE';
|
|
18
15
|
export const QUICK_SEARCH_SET_TEXT_MATCHING_STYLE = 'QUICK_SEARCH_SET_TEXT_MATCHING_STYLE';
|
|
19
16
|
export const QUICK_SEARCH_SET_CURRENT_TEXT_MATCHING_STYLE = 'QUICK_SEARCH_SET_CURRENT_TEXT_MATCHING_STYLE';
|
|
@@ -22,6 +19,10 @@ export const QuickSearchRun = (quickSearchText) => ({
|
|
|
22
19
|
type: QUICK_SEARCH_RUN,
|
|
23
20
|
quickSearchText,
|
|
24
21
|
});
|
|
22
|
+
export const QuickSearchClear = () => ({
|
|
23
|
+
type: QUICK_SEARCH_CLEAR,
|
|
24
|
+
});
|
|
25
|
+
export const QuickSearchTextAction = (quickSearchText) => quickSearchText ? QuickSearchRun(quickSearchText) : QuickSearchClear();
|
|
25
26
|
export const QuickSearchSetCellMatchingStyle = (matchingCellStyle) => ({
|
|
26
27
|
type: QUICK_SEARCH_SET_CELL_MATCHING_STYLE,
|
|
27
28
|
matchingCellStyle: matchingCellStyle,
|
|
@@ -47,6 +48,10 @@ export const QuickSearchReducer = (state = initialState, action) => {
|
|
|
47
48
|
return Object.assign({}, state, {
|
|
48
49
|
QuickSearchText: action.quickSearchText,
|
|
49
50
|
});
|
|
51
|
+
case QUICK_SEARCH_CLEAR:
|
|
52
|
+
return Object.assign({}, state, {
|
|
53
|
+
QuickSearchText: EMPTY_STRING,
|
|
54
|
+
});
|
|
50
55
|
case QUICK_SEARCH_SET_CELL_MATCHING_STYLE:
|
|
51
56
|
return Object.assign({}, state, {
|
|
52
57
|
CellMatchStyle: action.matchingCellStyle,
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import IStorageEngine from './Interface/IStorageEngine';
|
|
2
2
|
import { InitialState } from '../../AdaptableState/InitialState';
|
|
3
3
|
import { AdaptableLoadStateFunction, AdaptablePersistStateFunction } from '../../AdaptableOptions/StateOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Default `persistState` implementation - writes the state to localStorage under `adaptableStateKey`
|
|
6
|
+
*/
|
|
7
|
+
export declare const persistState: AdaptablePersistStateFunction;
|
|
8
|
+
/**
|
|
9
|
+
* Default `loadState` implementation - reads the state from localStorage under `adaptableStateKey`
|
|
10
|
+
*/
|
|
11
|
+
export declare const loadState: AdaptableLoadStateFunction;
|
|
4
12
|
export declare function createEngine(config: {
|
|
5
13
|
adaptableId: string;
|
|
6
14
|
adaptableStateKey: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { debounce } from '../../Utilities/Helpers/TimingHelper';
|
|
2
2
|
import { MergeStateFunction } from './AdaptableReduxMerger';
|
|
3
3
|
import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
|
|
4
|
+
import { runAsyncStateFunction, runSyncStateFunction } from './StateOptionsGuards';
|
|
4
5
|
const checkStatus = (response) => {
|
|
5
6
|
const error = new Error(response.statusText);
|
|
6
7
|
if (response.status >= 200 && response.status < 300) {
|
|
@@ -8,7 +9,7 @@ const checkStatus = (response) => {
|
|
|
8
9
|
}
|
|
9
10
|
throw error;
|
|
10
11
|
};
|
|
11
|
-
const persistState = (state, config) => {
|
|
12
|
+
export const persistState = (state, config) => {
|
|
12
13
|
return new Promise((resolve, reject) => {
|
|
13
14
|
try {
|
|
14
15
|
localStorage.setItem(config.adaptableStateKey, JSON.stringify(state));
|
|
@@ -19,7 +20,7 @@ const persistState = (state, config) => {
|
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
};
|
|
22
|
-
const loadState = ({
|
|
23
|
+
export const loadState = ({ adaptableStateKey }) => {
|
|
23
24
|
const jsonState = localStorage.getItem(adaptableStateKey);
|
|
24
25
|
const parsedJsonState = JSON.parse(jsonState) || {};
|
|
25
26
|
return Promise.resolve(parsedJsonState);
|
|
@@ -49,7 +50,7 @@ class AdaptableReduxLocalStorageEngine {
|
|
|
49
50
|
this.adaptableStateKey = adaptableStateKey;
|
|
50
51
|
}
|
|
51
52
|
load(adaptableInstance, initialState = this.initialState) {
|
|
52
|
-
return (this.loadState || loadState
|
|
53
|
+
return runAsyncStateFunction('loadState', this.loadState || loadState, [adaptableInstance.api.stateApi.internalApi.buildAdaptableStateFunctionConfig()], adaptableInstance.logger).then((parsedJsonState) => {
|
|
53
54
|
return Promise.resolve(initialState)
|
|
54
55
|
.then((parsedInitialState) => {
|
|
55
56
|
return MergeStateFunction(parsedInitialState, parsedJsonState);
|
|
@@ -67,20 +68,19 @@ class AdaptableReduxLocalStorageEngine {
|
|
|
67
68
|
const config = adaptableInstance.api.stateApi.internalApi.buildAdaptableStateFunctionConfig();
|
|
68
69
|
config.actionName = actionName;
|
|
69
70
|
config.previousState = adaptableInstance.adaptableStore.getPreviousStorageState() || null;
|
|
70
|
-
let stateObject
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
stateObject = getTransformedState(stateObject, config);
|
|
71
|
+
let stateObject;
|
|
72
|
+
try {
|
|
73
|
+
stateObject = runSyncStateFunction('saveState', adaptableInstance.adaptableOptions.stateOptions.saveState, structuredClone(state), config, adaptableInstance.logger);
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
catch (error) {
|
|
76
|
+
adaptableInstance.logger.consoleError('Adaptable State was NOT persisted:', error instanceof Error ? error.message : error);
|
|
77
|
+
return Promise.reject(error);
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return runAsyncStateFunction('persistState', this.persistState || persistState, [stateObject, config], adaptableInstance.logger).catch(rejectWithMessage);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
function rejectWithMessage(error) {
|
|
83
|
-
return Promise.reject(error
|
|
83
|
+
return Promise.reject(error?.message ?? error);
|
|
84
84
|
}
|
|
85
85
|
export function createEngine(config) {
|
|
86
86
|
return new AdaptableReduxLocalStorageEngine(config);
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as Redux from 'redux';
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
import { AdaptableState } from '../../AdaptableState/AdaptableState';
|
|
3
|
+
import { AdaptablePersistentState, AdaptableState } from '../../AdaptableState/AdaptableState';
|
|
4
4
|
import { BaseState } from '../../AdaptableState/BaseState';
|
|
5
5
|
import { IAdaptableStore, LoadStoreConfig } from './Interface/IAdaptableStore';
|
|
6
6
|
type EmitterCallback = (data?: any) => any;
|
|
7
7
|
type EmitterAnyCallback = (eventName: string, data?: any) => any;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Strips the transient (non-persisted) sections from the given state object - mutates and returns the same object.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getPersistableState: (state: AdaptableState) => AdaptablePersistentState;
|
|
9
12
|
export interface ResetUserDataAction extends Redux.Action {
|
|
10
13
|
}
|
|
11
14
|
export interface InitStateAction extends Redux.Action {
|
|
@@ -40,9 +43,9 @@ export declare class AdaptableStore implements IAdaptableStore {
|
|
|
40
43
|
*/
|
|
41
44
|
constructor(adaptable: IAdaptable);
|
|
42
45
|
destroy(): void;
|
|
43
|
-
getCurrentStorageState():
|
|
44
|
-
getPreviousStorageState():
|
|
45
|
-
saveStateNow(adaptable: IAdaptable, state?:
|
|
46
|
+
getCurrentStorageState(): AdaptablePersistentState;
|
|
47
|
+
getPreviousStorageState(): AdaptablePersistentState;
|
|
48
|
+
saveStateNow(adaptable: IAdaptable, state?: AdaptablePersistentState): Promise<any>;
|
|
46
49
|
loadStore: (config: LoadStoreConfig) => Promise<any>;
|
|
47
50
|
}
|
|
48
51
|
export {};
|
|
@@ -4,8 +4,9 @@ import * as PopupRedux from '../ActionsReducers/PopupRedux';
|
|
|
4
4
|
import { PROGRESS_INDICATOR_HIDE, PROGRESS_INDICATOR_SHOW } from '../ActionsReducers/PopupRedux';
|
|
5
5
|
import { createEngine as createEngineLocal } from './AdaptableReduxLocalStorageEngine';
|
|
6
6
|
import { mergeReducer } from './AdaptableReduxMerger';
|
|
7
|
+
import { runSyncStateFunction } from './StateOptionsGuards';
|
|
7
8
|
import { isRowChangeAlertDefinition } from '../../AdaptableState/AlertState';
|
|
8
|
-
import {
|
|
9
|
+
import { getAlertCellDataChangedInfos, isAdaptableRowChangedAlert, } from '../../AdaptableState/Common/AdaptableAlert';
|
|
9
10
|
import { closeAgChartDefinitionIfOpen, closeExternalChartDefinitionIfOpen, } from '../../Utilities/Helpers/ChartHelper';
|
|
10
11
|
import { refreshScheduledAlertJobs, refreshScheduledReportJobs, } from '../../Utilities/Helpers/Scheduling/ScheduledJobsMiddlewareHelper';
|
|
11
12
|
import { getRuleAlertProperties, isScheduledAlertDefinition, } from '../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
@@ -185,13 +186,9 @@ export class AdaptableStore {
|
|
|
185
186
|
!init &&
|
|
186
187
|
!this.loadStorageInProgress;
|
|
187
188
|
if (shouldPersist) {
|
|
188
|
-
|
|
189
|
-
storageState = getPersistableState(storageState);
|
|
189
|
+
const storageState = getPersistableState({ ...finalState });
|
|
190
190
|
this.currentStorageState = storageState;
|
|
191
|
-
this.previousStorageState = { ...state };
|
|
192
|
-
NON_PERSISTENT_STORE_KEYS.forEach((key) => {
|
|
193
|
-
delete this.previousStorageState[key];
|
|
194
|
-
});
|
|
191
|
+
this.previousStorageState = getPersistableState({ ...state });
|
|
195
192
|
storageEngine.save(adaptable, storageState, action.type);
|
|
196
193
|
}
|
|
197
194
|
return finalState;
|
|
@@ -245,7 +242,9 @@ export class AdaptableStore {
|
|
|
245
242
|
return this.previousStorageState;
|
|
246
243
|
}
|
|
247
244
|
saveStateNow(adaptable, state) {
|
|
248
|
-
const newState = state
|
|
245
|
+
const newState = state
|
|
246
|
+
? getPersistableState({ ...state })
|
|
247
|
+
: this.getCurrentStorageState();
|
|
249
248
|
if (newState) {
|
|
250
249
|
return this.storageEngine.saveNow(adaptable, newState, 'API_CALL_SAVE_STATE');
|
|
251
250
|
}
|
|
@@ -260,7 +259,8 @@ export class AdaptableStore {
|
|
|
260
259
|
.load(adaptable, initialState ?? adaptable.adaptableOptions.initialState)
|
|
261
260
|
.then((storedState) => {
|
|
262
261
|
if (storedState && this.loadStateOnStartup) {
|
|
263
|
-
|
|
262
|
+
const appliedState = runSyncStateFunction('applyState', adaptable.adaptableOptions.stateOptions.applyState, storedState, adaptable.api.stateApi.internalApi.buildAdaptableStateFunctionConfig(), adaptable.logger);
|
|
263
|
+
this.TheStore.dispatch(LoadState(postProcessState(appliedState)));
|
|
264
264
|
}
|
|
265
265
|
})
|
|
266
266
|
.then(() => {
|
|
@@ -402,10 +402,26 @@ function refreshFormulaTraceCells(adaptable, formulaTraceInfo) {
|
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
const LAYOUT_EXTENSION_OBJECT_ACTIONS = {
|
|
405
|
-
[AlertRedux.ALERT_DEFINITION_EDIT]: {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
405
|
+
[AlertRedux.ALERT_DEFINITION_EDIT]: {
|
|
406
|
+
module: 'Alert',
|
|
407
|
+
payloadKey: 'alertDefinition',
|
|
408
|
+
kind: 'edit',
|
|
409
|
+
},
|
|
410
|
+
[AlertRedux.ALERT_DEFINITION_DELETE]: {
|
|
411
|
+
module: 'Alert',
|
|
412
|
+
payloadKey: 'alertDefinition',
|
|
413
|
+
kind: 'delete',
|
|
414
|
+
},
|
|
415
|
+
[CustomSortRedux.CUSTOM_SORT_EDIT]: {
|
|
416
|
+
module: 'CustomSort',
|
|
417
|
+
payloadKey: 'customSort',
|
|
418
|
+
kind: 'edit',
|
|
419
|
+
},
|
|
420
|
+
[CustomSortRedux.CUSTOM_SORT_DELETE]: {
|
|
421
|
+
module: 'CustomSort',
|
|
422
|
+
payloadKey: 'customSort',
|
|
423
|
+
kind: 'delete',
|
|
424
|
+
},
|
|
409
425
|
[FlashingCellRedux.FLASHING_CELL_DEFINITION_EDIT]: {
|
|
410
426
|
module: 'FlashingCell',
|
|
411
427
|
payloadKey: 'flashingCellDefinition',
|
|
@@ -416,13 +432,21 @@ const LAYOUT_EXTENSION_OBJECT_ACTIONS = {
|
|
|
416
432
|
payloadKey: 'flashingCellDefinition',
|
|
417
433
|
kind: 'delete',
|
|
418
434
|
},
|
|
419
|
-
[FormatColumnRedux.FORMAT_COLUMN_EDIT]: {
|
|
435
|
+
[FormatColumnRedux.FORMAT_COLUMN_EDIT]: {
|
|
436
|
+
module: 'FormatColumn',
|
|
437
|
+
payloadKey: 'formatColumn',
|
|
438
|
+
kind: 'edit',
|
|
439
|
+
},
|
|
420
440
|
[FormatColumnRedux.FORMAT_COLUMN_DELETE]: {
|
|
421
441
|
module: 'FormatColumn',
|
|
422
442
|
payloadKey: 'formatColumn',
|
|
423
443
|
kind: 'delete',
|
|
424
444
|
},
|
|
425
|
-
[PlusMinusRedux.PLUS_MINUS_RULE_EDIT]: {
|
|
445
|
+
[PlusMinusRedux.PLUS_MINUS_RULE_EDIT]: {
|
|
446
|
+
module: 'PlusMinus',
|
|
447
|
+
payloadKey: 'plusMinusNudge',
|
|
448
|
+
kind: 'edit',
|
|
449
|
+
},
|
|
426
450
|
[PlusMinusRedux.PLUS_MINUS_RULE_DELETE]: {
|
|
427
451
|
module: 'PlusMinus',
|
|
428
452
|
payloadKey: 'plusMinusNudge',
|
|
@@ -430,7 +454,11 @@ const LAYOUT_EXTENSION_OBJECT_ACTIONS = {
|
|
|
430
454
|
},
|
|
431
455
|
[ShortcutRedux.SHORTCUT_EDIT]: { module: 'Shortcut', payloadKey: 'shortcut', kind: 'edit' },
|
|
432
456
|
[ShortcutRedux.SHORTCUT_DELETE]: { module: 'Shortcut', payloadKey: 'shortcut', kind: 'delete' },
|
|
433
|
-
[StyledColumnRedux.STYLED_COLUMN_EDIT]: {
|
|
457
|
+
[StyledColumnRedux.STYLED_COLUMN_EDIT]: {
|
|
458
|
+
module: 'StyledColumn',
|
|
459
|
+
payloadKey: 'StyledColumn',
|
|
460
|
+
kind: 'edit',
|
|
461
|
+
},
|
|
434
462
|
[StyledColumnRedux.STYLED_COLUMN_DELETE]: {
|
|
435
463
|
module: 'StyledColumn',
|
|
436
464
|
payloadKey: 'StyledColumn',
|
|
@@ -585,8 +613,8 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
585
613
|
if (!adaptable.api.freeTextColumnApi.internalApi.validateDeletedFreeTextColumn(actionTyped.freeTextColumn)) {
|
|
586
614
|
return;
|
|
587
615
|
}
|
|
588
|
-
if (adaptable.api.optionsApi.getLayoutOptions()
|
|
589
|
-
|
|
616
|
+
if (adaptable.api.optionsApi.getLayoutOptions()?.autoRemoveDeletedColumnsFromLayouts !==
|
|
617
|
+
false) {
|
|
590
618
|
adaptable.api.layoutApi.internalApi.removeColumnIdFromAllLayouts(actionTyped.freeTextColumn.ColumnId);
|
|
591
619
|
}
|
|
592
620
|
}
|
|
@@ -607,8 +635,8 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
607
635
|
if (!adaptable.api.calculatedColumnApi.internalApi.validateDeletedCalculatedColumn(calculatedColumn)) {
|
|
608
636
|
return;
|
|
609
637
|
}
|
|
610
|
-
if (adaptable.api.optionsApi.getLayoutOptions()
|
|
611
|
-
|
|
638
|
+
if (adaptable.api.optionsApi.getLayoutOptions()?.autoRemoveDeletedColumnsFromLayouts !==
|
|
639
|
+
false) {
|
|
612
640
|
adaptable.api.layoutApi.internalApi.removeColumnIdFromAllLayouts(calculatedColumn.ColumnId);
|
|
613
641
|
}
|
|
614
642
|
}
|
|
@@ -692,10 +720,12 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
692
720
|
adaptable.refreshSortIfColumnsSorted();
|
|
693
721
|
return returnAction;
|
|
694
722
|
}
|
|
723
|
+
case QuickSearchRedux.QUICK_SEARCH_CLEAR:
|
|
695
724
|
case QuickSearchRedux.QUICK_SEARCH_RUN: {
|
|
696
725
|
let returnAction = next(action);
|
|
697
|
-
const
|
|
698
|
-
|
|
726
|
+
const searchText = action.type === QuickSearchRedux.QUICK_SEARCH_CLEAR
|
|
727
|
+
? ''
|
|
728
|
+
: action.quickSearchText;
|
|
699
729
|
adaptable.setAgGridFindSearchValue(searchText);
|
|
700
730
|
adaptable.api.gridApi.refreshAllCells(true);
|
|
701
731
|
if (adaptable.adaptableOptions.quickSearchOptions.filterGridAfterQuickSearch) {
|
|
@@ -712,11 +742,12 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
712
742
|
const actionTyped = action;
|
|
713
743
|
let ret = next(action);
|
|
714
744
|
const adaptableAlert = actionTyped.alert;
|
|
715
|
-
if (getRuleAlertProperties(adaptableAlert.alertDefinition)?.HighlightCell
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
745
|
+
if (getRuleAlertProperties(adaptableAlert.alertDefinition)?.HighlightCell) {
|
|
746
|
+
getAlertCellDataChangedInfos(adaptableAlert).forEach((cellChange) => {
|
|
747
|
+
if (cellChange.rowNode && cellChange.column) {
|
|
748
|
+
adaptable.api.gridApi.refreshCell(cellChange.rowNode, cellChange.column.columnId, true);
|
|
749
|
+
}
|
|
750
|
+
});
|
|
720
751
|
}
|
|
721
752
|
if (getRuleAlertProperties(adaptableAlert.alertDefinition)?.HighlightRow &&
|
|
722
753
|
isAdaptableRowChangedAlert(adaptableAlert) &&
|
|
@@ -730,11 +761,12 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
730
761
|
let ret = next(action);
|
|
731
762
|
let alerts = actionTyped.alerts;
|
|
732
763
|
alerts.forEach((alert) => {
|
|
733
|
-
if (getRuleAlertProperties(alert.alertDefinition)?.HighlightCell
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
764
|
+
if (getRuleAlertProperties(alert.alertDefinition)?.HighlightCell) {
|
|
765
|
+
getAlertCellDataChangedInfos(alert).forEach((cellChange) => {
|
|
766
|
+
if (cellChange.rowNode && cellChange.column) {
|
|
767
|
+
adaptable.api.gridApi.refreshCell(cellChange.rowNode, cellChange.column.columnId, true);
|
|
768
|
+
}
|
|
769
|
+
});
|
|
738
770
|
}
|
|
739
771
|
if (getRuleAlertProperties(alert.alertDefinition)?.HighlightRow &&
|
|
740
772
|
isAdaptableRowChangedAlert(alert) &&
|
|
@@ -749,11 +781,11 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
749
781
|
const actionTyped = action;
|
|
750
782
|
const adaptableAlert = actionTyped.alert;
|
|
751
783
|
if (getRuleAlertProperties(adaptableAlert.alertDefinition)?.HighlightCell) {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
784
|
+
getAlertCellDataChangedInfos(adaptableAlert).forEach((cellChange) => {
|
|
785
|
+
if (cellChange.rowNode && cellChange.column) {
|
|
786
|
+
adaptable.api.gridApi.refreshCell(cellChange.rowNode, cellChange.column.columnId, true);
|
|
787
|
+
}
|
|
788
|
+
});
|
|
757
789
|
}
|
|
758
790
|
return ret;
|
|
759
791
|
}
|
|
@@ -762,9 +794,11 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
762
794
|
const actionTyped = action;
|
|
763
795
|
const adaptableAlert = actionTyped.alert;
|
|
764
796
|
if (getRuleAlertProperties(adaptableAlert.alertDefinition)?.HighlightRow) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
797
|
+
const highlightRowNodes = getAlertCellDataChangedInfos(adaptableAlert)
|
|
798
|
+
.map((cellChange) => cellChange.rowNode)
|
|
799
|
+
.filter((rowNode) => !!rowNode);
|
|
800
|
+
if (highlightRowNodes.length) {
|
|
801
|
+
adaptable.api.gridApi.refreshRowNodes(highlightRowNodes);
|
|
768
802
|
}
|
|
769
803
|
if (isAdaptableRowChangedAlert(adaptableAlert) && adaptableAlert.rowDataChangedInfo) {
|
|
770
804
|
adaptable.api.gridApi.refreshRowNodes(adaptableAlert.rowDataChangedInfo.rowNodes);
|
|
@@ -968,7 +1002,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
968
1002
|
adaptable.api.gridApi.refreshCell(rowNode, columnId, true);
|
|
969
1003
|
requestAnimationFrame(() => {
|
|
970
1004
|
const commentThreads = adaptable.api.commentApi.getAllComments();
|
|
971
|
-
adaptable.api.eventApi.
|
|
1005
|
+
adaptable.api.eventApi.internalApi.fireCommentChangedEvent(commentThreads);
|
|
972
1006
|
adaptable.api.optionsApi
|
|
973
1007
|
.getCommentOptions()
|
|
974
1008
|
?.persistCommentThreads?.(commentThreads);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as Redux from 'redux';
|
|
2
|
-
import { AdaptableState } from '../../../AdaptableState/AdaptableState';
|
|
2
|
+
import { AdaptablePersistentState, AdaptableState } from '../../../AdaptableState/AdaptableState';
|
|
3
3
|
import { InitialState } from '../../../types';
|
|
4
4
|
import { IAdaptable } from '../../../AdaptableInterfaces/IAdaptable';
|
|
5
5
|
export interface LoadStoreConfig {
|
|
6
6
|
adaptable: IAdaptable;
|
|
7
7
|
adaptableStateKey: string;
|
|
8
8
|
initialState?: InitialState;
|
|
9
|
-
postLoadHook?: (state:
|
|
9
|
+
postLoadHook?: (state: Partial<AdaptablePersistentState>) => Partial<AdaptablePersistentState>;
|
|
10
10
|
}
|
|
11
11
|
export interface IAdaptableStore {
|
|
12
12
|
TheStore: Redux.Store<AdaptableState>;
|
|
13
13
|
Load: Promise<any>;
|
|
14
14
|
loadStore: (config: LoadStoreConfig) => Promise<any>;
|
|
15
|
-
getCurrentStorageState: () =>
|
|
16
|
-
getPreviousStorageState: () =>
|
|
17
|
-
saveStateNow: (adaptable: IAdaptable, state?:
|
|
15
|
+
getCurrentStorageState: () => AdaptablePersistentState | void;
|
|
16
|
+
getPreviousStorageState: () => AdaptablePersistentState | void;
|
|
17
|
+
saveStateNow: (adaptable: IAdaptable, state?: AdaptablePersistentState) => Promise<any>;
|
|
18
18
|
on: (eventName: string, callback: (data?: any) => any) => () => void;
|
|
19
19
|
onAny: (callback: (eventName: string, data?: any) => any) => () => void;
|
|
20
20
|
onBeforeAny: (callback: (eventName: string, data?: any) => any) => () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdaptablePersistentState } from '../../../AdaptableState/AdaptableState';
|
|
2
2
|
import { InitialState } from '../../../AdaptableState/InitialState';
|
|
3
3
|
import { IAdaptable } from '../../../AdaptableInterfaces/IAdaptable';
|
|
4
4
|
export default interface IStorageEngine {
|
|
5
|
-
load(adaptable: IAdaptable, initialState?: string | InitialState): Promise<
|
|
6
|
-
save(adaptable: IAdaptable, state:
|
|
7
|
-
saveNow(adaptable: IAdaptable, state:
|
|
5
|
+
load(adaptable: IAdaptable, initialState?: string | InitialState): Promise<Partial<AdaptablePersistentState> | void>;
|
|
6
|
+
save(adaptable: IAdaptable, state: AdaptablePersistentState, actionName: string): Promise<any>;
|
|
7
|
+
saveNow(adaptable: IAdaptable, state: AdaptablePersistentState, actionName: string): Promise<any>;
|
|
8
8
|
setStateKey(stateKey: string): void;
|
|
9
9
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AdaptablePersistentState } from '../../AdaptableState/AdaptableState';
|
|
2
|
+
import { AdaptableStateFunctionConfig, StateOptions } from '../../AdaptableOptions/StateOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Runtime guards for the `StateOptions` functions.
|
|
5
|
+
*
|
|
6
|
+
* The most frequent mistakes when implementing these functions are:
|
|
7
|
+
* - providing an `async` function (or otherwise returning a Promise) for `saveState` / `applyState`, which are synchronous
|
|
8
|
+
* - mutating the state in `saveState` / `applyState` but forgetting to return it
|
|
9
|
+
* - returning a plain value (not a Promise) from `loadState` / `persistState`
|
|
10
|
+
*
|
|
11
|
+
* The helpers below detect these cases - as early as possible - and either recover (when there is only one sensible
|
|
12
|
+
* interpretation) or fail with an actionable error message instead of an obscure one further down the line.
|
|
13
|
+
*/
|
|
14
|
+
export type StateOptionsLogger = {
|
|
15
|
+
consoleError(message: string, ...optionalParams: any[]): void;
|
|
16
|
+
consoleWarn(message: string, ...optionalParams: any[]): void;
|
|
17
|
+
};
|
|
18
|
+
export type SyncStateFunctionName = 'saveState' | 'applyState';
|
|
19
|
+
export type AsyncStateFunctionName = 'loadState' | 'persistState' | 'clearState';
|
|
20
|
+
export type StateFunctionName = SyncStateFunctionName | AsyncStateFunctionName;
|
|
21
|
+
/**
|
|
22
|
+
* Error thrown when a `StateOptions` function breaks its contract
|
|
23
|
+
*/
|
|
24
|
+
export declare class AdaptableStateOptionsError extends Error {
|
|
25
|
+
constructor(message: string);
|
|
26
|
+
}
|
|
27
|
+
export declare const isThenable: (value: unknown) => value is PromiseLike<unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Detects functions declared with the `async` keyword (not transpiled to generators / promises)
|
|
30
|
+
*/
|
|
31
|
+
export declare const isAsyncFunction: (fn: unknown) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Validates the shape of `stateOptions` once, at initialisation - before any state is loaded or persisted.
|
|
34
|
+
*
|
|
35
|
+
* Reports (does not throw):
|
|
36
|
+
* - non-function values for any state function
|
|
37
|
+
* - `async` functions for `saveState` / `applyState`
|
|
38
|
+
* - `loadState` without `persistState` (or vice versa) - the localStorage fallback is used for the missing one,
|
|
39
|
+
* which makes the remote and local copies of the state diverge
|
|
40
|
+
*/
|
|
41
|
+
export declare function validateStateOptions(stateOptions: StateOptions | undefined, logger: StateOptionsLogger): void;
|
|
42
|
+
/**
|
|
43
|
+
* Invokes a synchronous state transform (`saveState` / `applyState`) and validates its result.
|
|
44
|
+
*
|
|
45
|
+
* - returns the result when it is a state object
|
|
46
|
+
* - **recovers** when the function returned nothing: the input state is used (the function most likely mutated it in place
|
|
47
|
+
* and forgot to `return` it) and an error is logged
|
|
48
|
+
* - **throws** `AdaptableStateOptionsError` when the result is a Promise (async function) or any other non-object value;
|
|
49
|
+
* there is no safe way to continue in these cases
|
|
50
|
+
*/
|
|
51
|
+
export declare function runSyncStateFunction<T extends Partial<AdaptablePersistentState>>(functionName: SyncStateFunctionName, fn: ((state: T, config: AdaptableStateFunctionConfig) => T) | undefined, state: T, config: AdaptableStateFunctionConfig, logger: StateOptionsLogger): T;
|
|
52
|
+
/**
|
|
53
|
+
* Invokes an asynchronous state function (`loadState` / `persistState` / `clearState`) and normalises its result to a Promise.
|
|
54
|
+
*
|
|
55
|
+
* A non-Promise result is logged (these functions are expected to be async) and wrapped in a resolved Promise, so a
|
|
56
|
+
* synchronous implementation degrades gracefully instead of failing with `.then is not a function`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function runAsyncStateFunction<TResult, TArgs extends unknown[]>(functionName: AsyncStateFunctionName, fn: (...args: TArgs) => Promise<TResult>, args: TArgs, logger: StateOptionsLogger): Promise<TResult>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { StatePersistenceDocsLink } from '../../Utilities/Constants/DocumentationLinkConstants';
|
|
2
|
+
const STATE_FUNCTION_NAMES = [
|
|
3
|
+
'loadState',
|
|
4
|
+
'persistState',
|
|
5
|
+
'applyState',
|
|
6
|
+
'saveState',
|
|
7
|
+
'clearState',
|
|
8
|
+
];
|
|
9
|
+
export class AdaptableStateOptionsError extends Error {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'AdaptableStateOptionsError';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export const isThenable = (value) => {
|
|
16
|
+
return value != null && typeof value.then === 'function';
|
|
17
|
+
};
|
|
18
|
+
export const isAsyncFunction = (fn) => {
|
|
19
|
+
return typeof fn === 'function' && fn.constructor?.name === 'AsyncFunction';
|
|
20
|
+
};
|
|
21
|
+
const isStateObject = (value) => {
|
|
22
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
23
|
+
};
|
|
24
|
+
const docs = `See ${StatePersistenceDocsLink}`;
|
|
25
|
+
const syncFunctionMustReturnMessage = (functionName) => `stateOptions.${functionName} must be synchronous and return the (modified) state object.`;
|
|
26
|
+
const asyncFunctionMessage = (functionName, reason) => `${syncFunctionMustReturnMessage(functionName)} ${reason} ` +
|
|
27
|
+
`Asynchronous work belongs in stateOptions.${functionName === 'saveState' ? 'persistState' : 'loadState'}. ${docs}`;
|
|
28
|
+
export function validateStateOptions(stateOptions, logger) {
|
|
29
|
+
if (!stateOptions) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (const functionName of STATE_FUNCTION_NAMES) {
|
|
33
|
+
const fn = stateOptions[functionName];
|
|
34
|
+
if (fn != null && typeof fn !== 'function') {
|
|
35
|
+
logger.consoleError(`stateOptions.${functionName} must be a function, but received ${describe(fn)}. ${docs}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const functionName of ['saveState', 'applyState']) {
|
|
39
|
+
if (isAsyncFunction(stateOptions[functionName])) {
|
|
40
|
+
logger.consoleError(asyncFunctionMessage(functionName, 'It is declared as an async function.'));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const hasLoadState = typeof stateOptions.loadState === 'function';
|
|
44
|
+
const hasPersistState = typeof stateOptions.persistState === 'function';
|
|
45
|
+
if (hasLoadState !== hasPersistState) {
|
|
46
|
+
const provided = hasLoadState ? 'loadState' : 'persistState';
|
|
47
|
+
const missing = hasLoadState ? 'persistState' : 'loadState';
|
|
48
|
+
logger.consoleWarn(`stateOptions.${provided} is provided without stateOptions.${missing}; ` +
|
|
49
|
+
`the default localStorage implementation is used for ${missing}, so the loaded and the persisted state may diverge. ` +
|
|
50
|
+
`Provide both functions (or neither). ${docs}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function runSyncStateFunction(functionName, fn, state, config, logger) {
|
|
54
|
+
if (fn == null) {
|
|
55
|
+
return state;
|
|
56
|
+
}
|
|
57
|
+
if (typeof fn !== 'function') {
|
|
58
|
+
throw new AdaptableStateOptionsError(`stateOptions.${functionName} must be a function, but received ${describe(fn)}. ${docs}`);
|
|
59
|
+
}
|
|
60
|
+
const result = fn(state, config);
|
|
61
|
+
if (result === undefined) {
|
|
62
|
+
logger.consoleError(`${syncFunctionMustReturnMessage(functionName)} It returned nothing - ` +
|
|
63
|
+
`the state object passed to it is used instead (add 'return state;' to fix this). ${docs}`);
|
|
64
|
+
return state;
|
|
65
|
+
}
|
|
66
|
+
if (isThenable(result)) {
|
|
67
|
+
throw new AdaptableStateOptionsError(asyncFunctionMessage(functionName, 'It returned a Promise (is it an async function?).'));
|
|
68
|
+
}
|
|
69
|
+
if (!isStateObject(result)) {
|
|
70
|
+
throw new AdaptableStateOptionsError(`${syncFunctionMustReturnMessage(functionName)} It returned ${describe(result)}. ${docs}`);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
export function runAsyncStateFunction(functionName, fn, args, logger) {
|
|
75
|
+
if (typeof fn !== 'function') {
|
|
76
|
+
return Promise.reject(new AdaptableStateOptionsError(`stateOptions.${functionName} must be a function, but received ${describe(fn)}. ${docs}`));
|
|
77
|
+
}
|
|
78
|
+
let result;
|
|
79
|
+
try {
|
|
80
|
+
result = fn(...args);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return Promise.reject(error);
|
|
84
|
+
}
|
|
85
|
+
if (!isThenable(result)) {
|
|
86
|
+
logger.consoleWarn(`stateOptions.${functionName} should be asynchronous and return a Promise, but it returned ${describe(result)}. The value is used as if it had been resolved. ${docs}`);
|
|
87
|
+
return Promise.resolve(result);
|
|
88
|
+
}
|
|
89
|
+
return Promise.resolve(result);
|
|
90
|
+
}
|
|
91
|
+
function describe(value) {
|
|
92
|
+
if (value === null) {
|
|
93
|
+
return 'null';
|
|
94
|
+
}
|
|
95
|
+
if (value === undefined) {
|
|
96
|
+
return 'undefined';
|
|
97
|
+
}
|
|
98
|
+
if (Array.isArray(value)) {
|
|
99
|
+
return 'an array';
|
|
100
|
+
}
|
|
101
|
+
if (isThenable(value)) {
|
|
102
|
+
return 'a Promise';
|
|
103
|
+
}
|
|
104
|
+
const type = typeof value;
|
|
105
|
+
if (type === 'object') {
|
|
106
|
+
return 'an object';
|
|
107
|
+
}
|
|
108
|
+
if (type === 'string') {
|
|
109
|
+
return `a string ('${String(value).slice(0, 40)}${String(value).length > 40 ? '…' : ''}')`;
|
|
110
|
+
}
|
|
111
|
+
return `${type} (${String(value)})`;
|
|
112
|
+
}
|