@adaptabletools/adaptable 11.3.0 → 12.0.0-canary.2
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/base.css +568 -273
- package/bundle.cjs.js +114 -114
- package/index.css +642 -270
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -0
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -1
- package/src/AdaptableOptions/ActionOptions.d.ts +1 -0
- package/src/AdaptableOptions/{FormatColumnOptions.js → ActionOptions.js} +0 -0
- package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +5 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -10
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +5 -0
- package/src/AdaptableOptions/AlertOptions.d.ts +14 -1
- package/src/AdaptableOptions/ColumnOptions.d.ts +49 -0
- package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.js → ColumnOptions.js} +0 -0
- package/src/AdaptableOptions/DashboardOptions.d.ts +2 -7
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +19 -0
- package/src/AdaptableOptions/EditOptions.d.ts +6 -7
- package/src/AdaptableOptions/EntitlementOptions.d.ts +7 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +9 -8
- package/src/AdaptableOptions/FilterOptions.d.ts +6 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +25 -23
- package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.d.ts → MasterDetailPluginOptions.d.ts} +2 -4
- package/src/{Api/DataSourceApi.js → AdaptableOptions/MasterDetailPluginOptions.js} +0 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -6
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -49
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +88 -57
- package/src/Api/AdaptableApi.d.ts +6 -3
- package/src/Api/ColumnApi.d.ts +9 -4
- package/src/Api/ConditionalStyleApi.d.ts +10 -0
- package/src/Api/ConfigApi.d.ts +0 -12
- package/src/Api/DashboardApi.d.ts +6 -19
- package/src/Api/DataSetApi.d.ts +40 -0
- package/src/{PredefinedConfig/DataSourceState.js → Api/DataSetApi.js} +0 -0
- package/src/Api/EventApi.d.ts +26 -1
- package/src/Api/Events/DataSetChanged.d.ts +5 -0
- package/src/{PredefinedConfig/FilterState.js → Api/Events/DataSetChanged.js} +0 -0
- package/src/Api/Events/SearchChanged.d.ts +4 -5
- package/src/Api/ExportApi.d.ts +2 -2
- package/src/Api/FilterApi.d.ts +28 -36
- package/src/Api/GridApi.d.ts +1 -1
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -3
- package/src/Api/Implementation/AlertApiImpl.js +5 -1
- package/src/Api/Implementation/ApiBase.d.ts +3 -0
- package/src/Api/Implementation/ApiBase.js +6 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +4 -4
- package/src/Api/Implementation/ColumnApiImpl.js +17 -16
- package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ConditionalStyleApiImpl.js +8 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -4
- package/src/Api/Implementation/ConfigApiImpl.js +2 -24
- package/src/Api/Implementation/DashboardApiImpl.d.ts +3 -6
- package/src/Api/Implementation/DashboardApiImpl.js +5 -29
- package/src/Api/Implementation/DataSetApiImpl.d.ts +12 -0
- package/src/Api/Implementation/DataSetApiImpl.js +42 -0
- package/src/Api/Implementation/EventApiImpl.js +1 -0
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FilterApiImpl.d.ts +11 -11
- package/src/Api/Implementation/FilterApiImpl.js +59 -72
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.js +7 -3
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -2
- package/src/Api/Implementation/InternalApiImpl.js +14 -3
- package/src/Api/Implementation/LayoutApiImpl.d.ts +3 -0
- package/src/Api/Implementation/LayoutApiImpl.js +20 -0
- package/src/Api/Implementation/PredicateApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PredicateApiImpl.js +19 -1
- package/src/Api/Implementation/SmartEditApiImpl.d.ts +3 -1
- package/src/Api/Implementation/SmartEditApiImpl.js +6 -0
- package/src/Api/Implementation/TeamSharingApiImpl.d.ts +5 -3
- package/src/Api/Implementation/TeamSharingApiImpl.js +28 -10
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -4
- package/src/Api/InternalApi.d.ts +3 -2
- package/src/Api/LayoutApi.d.ts +16 -0
- package/src/Api/PredicateApi.d.ts +7 -0
- package/src/Api/SmartEditApi.d.ts +8 -2
- package/src/Api/TeamSharingApi.d.ts +18 -5
- package/src/Api/UserInterfaceApi.d.ts +4 -4
- package/src/PredefinedConfig/AdaptableState.d.ts +0 -4
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +3 -3
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +18 -1
- package/src/PredefinedConfig/{FilterState.d.ts → Common/ColumnFilter.d.ts} +2 -33
- package/src/PredefinedConfig/Common/ColumnFilter.js +2 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -2
- package/src/PredefinedConfig/Common/Enums.js +1 -1
- package/src/PredefinedConfig/Common/FormContext.d.ts +8 -0
- package/src/PredefinedConfig/Common/FormContext.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +6 -5
- package/src/PredefinedConfig/Common/Types.js +2 -3
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -10
- package/src/PredefinedConfig/StatusBarState.d.ts +1 -2
- package/src/PredefinedConfig/SystemState.d.ts +3 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +47 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +134 -1
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +3 -2
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +22 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +39 -1
- package/src/Redux/Store/AdaptableStore.js +37 -39
- package/src/Strategy/AdaptableModuleBase.js +1 -2
- package/src/Strategy/AlertModule.d.ts +11 -0
- package/src/Strategy/AlertModule.js +14 -0
- package/src/Strategy/BulkUpdateModule.js +3 -4
- package/src/Strategy/CellSummaryModule.d.ts +3 -0
- package/src/Strategy/CellSummaryModule.js +29 -16
- package/src/Strategy/DataSetModule.d.ts +25 -0
- package/src/Strategy/DataSetModule.js +65 -0
- package/src/Strategy/ExportModule.js +6 -1
- package/src/Strategy/FilterModule.d.ts +7 -11
- package/src/Strategy/FilterModule.js +26 -20
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FlashingCellModule.js +2 -2
- package/src/Strategy/Interface/IModule.d.ts +3 -1
- package/src/Strategy/LayoutModule.js +25 -2
- package/src/Strategy/PlusMinusModule.js +1 -4
- package/src/Strategy/SmartEditModule.js +3 -3
- package/src/Strategy/StatusBarModule.js +1 -3
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -4
- package/src/Utilities/Constants/GeneralConstants.d.ts +8 -2
- package/src/Utilities/Constants/GeneralConstants.js +8 -2
- package/src/Utilities/Constants/ModuleConstants.d.ts +1 -1
- package/src/Utilities/Constants/ModuleConstants.js +2 -2
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +17 -15
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +3 -1
- package/src/Utilities/ObjectFactory.d.ts +3 -6
- package/src/Utilities/ObjectFactory.js +3 -7
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +6 -7
- package/src/Utilities/Services/EntitlementService.js +7 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/ReportService.js +2 -3
- package/src/Utilities/Services/RowEditService.d.ts +1 -0
- package/src/Utilities/Services/RowEditService.js +34 -2
- package/src/Utilities/Services/TeamSharingService.js +4 -4
- package/src/View/AdaptablePopover/index.d.ts +1 -0
- package/src/View/AdaptablePopover/index.js +5 -6
- package/src/View/AdaptableView.js +1 -1
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +8 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +3 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +9 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +18 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +87 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +18 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +16 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +2 -9
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +2 -75
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +3 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +9 -4
- package/src/View/AdaptableWizardView/Utils.d.ts +1 -0
- package/src/View/AdaptableWizardView/Utils.js +24 -0
- package/src/View/AdaptableWizardView/Wizard.d.ts +54 -0
- package/src/View/AdaptableWizardView/Wizard.js +98 -0
- package/src/View/AdaptableWizardView/index.d.ts +1 -22
- package/src/View/AdaptableWizardView/index.js +2 -103
- package/src/View/Alert/ActiveAlertsPanel.d.ts +2 -0
- package/src/View/Alert/ActiveAlertsPanel.js +15 -0
- package/src/View/Alert/AlertStatusSubPanel.js +3 -8
- package/src/View/Alert/AlertViewPanel.js +2 -2
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +3 -3
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -3
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +3 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +5 -6
- package/src/View/CellSummary/CellSummaryDetails.js +4 -4
- package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -4
- package/src/View/CellSummary/CellSummaryPopover.js +3 -6
- package/src/View/CellSummary/CellSummaryPopup.js +8 -0
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
- package/src/View/CellSummary/CellSummaryStatusPanel.js +2 -2
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +18 -8
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -2
- package/src/View/Components/ExternalRenderer.d.ts +3 -6
- package/src/View/Components/ExternalRenderer.js +5 -5
- package/src/View/Components/FilterForm/FilterForm.d.ts +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +10 -8
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +1 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +5 -4
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +0 -2
- package/src/View/Components/Popups/AdaptablePopupAlert.js +13 -11
- package/src/View/Components/Popups/AdaptableToaster.js +29 -9
- package/src/View/Components/PreviewResultsPanel.js +3 -3
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -9
- package/src/View/Components/WizardSummaryPage.js +2 -2
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +1 -1
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +2 -2
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +1 -1
- package/src/View/Dashboard/CustomDashboardButton.d.ts +11 -0
- package/src/View/Dashboard/CustomDashboardButton.js +47 -0
- package/src/View/Dashboard/CustomToolbarWrapper.d.ts +1 -0
- package/src/View/Dashboard/CustomToolbarWrapper.js +30 -11
- package/src/View/Dashboard/Dashboard.d.ts +1 -0
- package/src/View/Dashboard/Dashboard.js +8 -34
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +19 -36
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +3 -0
- package/src/View/DataChangeHistory/buildActionColumnButton.js +70 -0
- package/src/View/DataSet/DataSetSelector.d.ts +7 -0
- package/src/View/DataSet/DataSetSelector.js +18 -0
- package/src/View/DataSet/DataSetStatusPanelPopover.d.ts +2 -0
- package/src/View/DataSet/DataSetStatusPanelPopover.js +19 -0
- package/src/View/DataSet/DataSetViewPanel.d.ts +19 -0
- package/src/View/DataSet/DataSetViewPanel.js +58 -0
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
- package/src/View/Export/Wizard/ReportNameWizardSection.js +1 -1
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
- package/src/View/Filter/ActiveFiltersPanel.js +1 -1
- package/src/View/Filter/FilterSummary.d.ts +5 -5
- package/src/View/Filter/FilterSummary.js +5 -4
- package/src/View/Filter/FilterViewPanel.d.ts +4 -4
- package/src/View/Filter/FilterViewPanel.js +10 -13
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +2 -2
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +5 -6
- package/src/View/GridInfo/ColumnInfoComponent.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +1 -1
- package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +6 -24
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +2 -2
- package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleSummary.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +2 -2
- package/src/View/SmartEdit/SmartEditPopup.js +2 -2
- package/src/View/SmartEdit/SmartEditViewPanel.js +2 -2
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +1 -1
- package/src/View/StatusBar/StatusBarPanel.d.ts +1 -0
- package/src/View/StatusBar/StatusBarPanel.js +5 -4
- package/src/View/Theme/ThemeStatusPanelPopover.js +5 -25
- package/src/View/UIHelper.d.ts +4 -4
- package/src/View/UIHelper.js +10 -10
- package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -2
- package/src/View/Wizard/ObjectTagsWizardSection.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +5 -6
- package/src/View/Wizard/OnePageAdaptableWizard.js +35 -169
- package/src/View/Wizard/OnePageWizards.d.ts +37 -0
- package/src/View/Wizard/OnePageWizards.js +187 -0
- package/src/View/Wizard/useKeyboardNavigation.d.ts +1 -1
- package/src/agGrid/ActionColumnRenderer.js +3 -2
- package/src/agGrid/Adaptable.d.ts +4 -2
- package/src/agGrid/Adaptable.js +99 -58
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/agGridHelper.d.ts +7 -8
- package/src/agGrid/agGridHelper.js +68 -86
- package/src/agGrid/agGridMenuHelper.js +4 -1
- package/src/agGrid/rowEditIcons.d.ts +1 -0
- package/src/agGrid/rowEditIcons.js +2 -1
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -2
- package/src/components/Dashboard/DashboardToolbar.js +2 -2
- package/src/components/InfiniteTable/index.js +1 -0
- package/src/components/List/GridList/index.js +1 -1
- package/src/components/SelectList.d.ts +10 -0
- package/src/components/SelectList.js +9 -0
- package/src/components/WindowModal/WindowModal.js +13 -7
- package/src/components/icons/{data-source.d.ts → add-row.d.ts} +0 -0
- package/src/components/icons/add-row.js +7 -0
- package/src/components/icons/data-set.d.ts +3 -0
- package/src/components/icons/{data-source.js → data-set.js} +0 -0
- package/src/components/icons/index.js +4 -2
- package/src/metamodel/adaptable.metamodel.d.ts +163 -78
- package/src/metamodel/adaptable.metamodel.js +402 -322
- package/src/types.d.ts +16 -12
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +0 -10
- package/src/Api/DataSourceApi.d.ts +0 -58
- package/src/Api/Implementation/DataSourceApiImpl.d.ts +0 -15
- package/src/Api/Implementation/DataSourceApiImpl.js +0 -51
- package/src/PredefinedConfig/DataSourceState.d.ts +0 -34
- package/src/Redux/ActionsReducers/DataSourceRedux.d.ts +0 -42
- package/src/Redux/ActionsReducers/DataSourceRedux.js +0 -76
- package/src/Redux/ActionsReducers/FilterRedux.d.ts +0 -70
- package/src/Redux/ActionsReducers/FilterRedux.js +0 -126
- package/src/Strategy/DataSourceModule.d.ts +0 -20
- package/src/Strategy/DataSourceModule.js +0 -56
- package/src/View/DataSource/DataSourceViewPanel.d.ts +0 -19
- package/src/View/DataSource/DataSourceViewPanel.js +0 -69
- package/src/View/DataSource/Wizard/DataSourceSettingsSummary.d.ts +0 -2
- package/src/View/DataSource/Wizard/DataSourceSettingsSummary.js +0 -17
- package/src/View/DataSource/Wizard/DataSourceSettingsWizard.d.ts +0 -8
- package/src/View/DataSource/Wizard/DataSourceSettingsWizard.js +0 -42
- package/src/View/DataSource/Wizard/DataSourceWizard.d.ts +0 -8
- package/src/View/DataSource/Wizard/DataSourceWizard.js +0 -53
package/src/View/UIHelper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UIHelper = exports.isBrowserDocumentAvailable = exports.setCSSVariableValue = exports.getCSSVariableValue = exports.getAdaptableToolPanelWidth = exports.getButtonTextColourForMessageType = exports.getButtonTextColourForArrayandMessageType = exports.getButtonColourForAdaptableAlerts = exports.getMessageTypeFromAdaptableAlerts = exports.getWeekDayByIndex = exports.getScheduleDescription = exports.getButtonToneForMessageType = exports.getGlyphForMessageType = exports.getGlyphForStatusColour = exports.getStyleForMessageType = exports.getStyleForStatusColour = exports.getColorByMessageType = exports.getGlyphByMessageType = exports.getButtonToneByMessageType = exports.getMessageTypeByStatusColour = exports.IsNotEmptyStyle = exports.IsEmptyStyle = exports.getModalContainer = exports.
|
|
3
|
+
exports.UIHelper = exports.isBrowserDocumentAvailable = exports.setCSSVariableValue = exports.getCSSVariableValue = exports.getAdaptableToolPanelWidth = exports.getButtonTextColourForMessageType = exports.getButtonTextColourForArrayandMessageType = exports.getButtonColourForAdaptableAlerts = exports.getMessageTypeFromAdaptableAlerts = exports.getWeekDayByIndex = exports.getScheduleDescription = exports.getButtonToneForMessageType = exports.getGlyphForMessageType = exports.getGlyphForStatusColour = exports.getStyleForMessageType = exports.getStyleForStatusColour = exports.getColorByMessageType = exports.getGlyphByMessageType = exports.getButtonToneByMessageType = exports.getMessageTypeByStatusColour = exports.IsNotEmptyStyle = exports.IsEmptyStyle = exports.getModalContainer = exports.getPlaceholderForDataType = exports.getDescriptionForDataType = exports.getEmptyConfigState = exports.getDefaultColors = exports.getHexForName = exports.ORANGE = exports.LIGHT_RED = exports.RED = exports.DARK_RED = exports.PURPLE = exports.MAGENTA = exports.CYAN = exports.LIGHT_BLUE = exports.BLUE = exports.DARK_BLUE = exports.LIGHT_YELLOW = exports.YELLOW = exports.LIME_GREEN = exports.GREEN = exports.DARK_GREEN = exports.BROWN = exports.GRAY = exports.LIGHT_GRAY = exports.WHITE = exports.BLACK = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const EditableConfigEntityState_1 = require("./Components/SharedProps/EditableConfigEntityState");
|
|
6
6
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
@@ -109,26 +109,26 @@ function getEmptyConfigState() {
|
|
|
109
109
|
exports.getEmptyConfigState = getEmptyConfigState;
|
|
110
110
|
function getDescriptionForDataType(dataType) {
|
|
111
111
|
switch (dataType) {
|
|
112
|
-
case
|
|
112
|
+
case 'String':
|
|
113
113
|
return 'string';
|
|
114
|
-
case
|
|
114
|
+
case 'Number':
|
|
115
115
|
return 'number';
|
|
116
|
-
case
|
|
116
|
+
case 'Date':
|
|
117
117
|
return 'date';
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
exports.getDescriptionForDataType = getDescriptionForDataType;
|
|
121
|
-
function
|
|
121
|
+
function getPlaceholderForDataType(dataType) {
|
|
122
122
|
switch (dataType) {
|
|
123
|
-
case
|
|
123
|
+
case 'String':
|
|
124
124
|
return 'Enter Value';
|
|
125
|
-
case
|
|
125
|
+
case 'Number':
|
|
126
126
|
return 'Enter Number';
|
|
127
|
-
case
|
|
127
|
+
case 'Date':
|
|
128
128
|
return 'Enter Date';
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
exports.
|
|
131
|
+
exports.getPlaceholderForDataType = getPlaceholderForDataType;
|
|
132
132
|
function getModalContainer(adaptableOptions, document) {
|
|
133
133
|
let modalContainer;
|
|
134
134
|
if (adaptableOptions.containerOptions.modalContainer) {
|
|
@@ -466,7 +466,7 @@ exports.UIHelper = {
|
|
|
466
466
|
getDefaultColors,
|
|
467
467
|
getEmptyConfigState,
|
|
468
468
|
getDescriptionForDataType,
|
|
469
|
-
getPlaceHolderforDataType,
|
|
469
|
+
getPlaceHolderforDataType: getPlaceholderForDataType,
|
|
470
470
|
getModalContainer,
|
|
471
471
|
IsEmptyStyle,
|
|
472
472
|
IsNotEmptyStyle,
|
|
@@ -34,9 +34,9 @@ export interface AdaptableObjectAdaptableWizardProps<View> extends AdaptableWiza
|
|
|
34
34
|
api: AdaptableApi;
|
|
35
35
|
}
|
|
36
36
|
export interface AdaptableOnePageWizardProps<T extends AdaptableObject> {
|
|
37
|
-
moduleInfo
|
|
37
|
+
moduleInfo?: ModuleInfo;
|
|
38
38
|
data: T;
|
|
39
|
-
configEntities
|
|
39
|
+
configEntities?: T[];
|
|
40
40
|
wizardStartIndex?: number;
|
|
41
41
|
onCloseWizard: VoidFunction;
|
|
42
42
|
onFinishWizard: (data: T) => void;
|
|
@@ -9,7 +9,7 @@ const OnePageAdaptableWizard_1 = require("./OnePageAdaptableWizard");
|
|
|
9
9
|
const rebass_1 = require("rebass");
|
|
10
10
|
exports.ObjectTagsWizardSection = (props) => {
|
|
11
11
|
const { onChange } = props;
|
|
12
|
-
const { data } = OnePageAdaptableWizard_1.
|
|
12
|
+
const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
13
13
|
return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
|
|
14
14
|
React.createElement(Tabs_1.Tabs.Tab, null, "Tags"),
|
|
15
15
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -6,29 +6,28 @@ import { ModuleInfo } from '../../Strategy/Interface/IModule';
|
|
|
6
6
|
import { ExpressionEditorNamedQuery } from '../../components/ExpressionEditor/NamedQueryContext';
|
|
7
7
|
export declare type OnePageAdaptableWizardContextType<T> = {
|
|
8
8
|
data: T;
|
|
9
|
-
sections: (
|
|
9
|
+
sections: (OnePageAdaptableWizardSection<T> | '-')[];
|
|
10
10
|
moduleInfo: ModuleInfo;
|
|
11
11
|
api: AdaptableApi;
|
|
12
|
-
setCurrentSection: (index: number) => void;
|
|
13
12
|
namedQuery: ExpressionEditorNamedQuery;
|
|
14
13
|
};
|
|
15
14
|
export declare const SummaryTag: React.FunctionComponent<TextProps>;
|
|
16
15
|
export declare const SummaryText: React.FunctionComponent<TextProps>;
|
|
17
16
|
export declare const FormDescriptionText: React.FunctionComponent<TextProps>;
|
|
18
17
|
export declare const OnePageAdaptableWizardContext: React.Context<OnePageAdaptableWizardContextType<any>>;
|
|
19
|
-
export declare function
|
|
20
|
-
export
|
|
18
|
+
export declare function useOnePageAdaptableWizardContext<ENTITY>(): OnePageAdaptableWizardContextType<ENTITY>;
|
|
19
|
+
export interface OnePageAdaptableWizardSection<ENTITY> {
|
|
21
20
|
title: string;
|
|
22
21
|
details?: React.ReactNode;
|
|
23
22
|
isValid?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => true | string;
|
|
24
23
|
isVisible?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => boolean;
|
|
25
24
|
render: (data: ENTITY, index: number) => React.ReactNode;
|
|
26
25
|
renderSummary?: (data: ENTITY, api: AdaptableApi) => React.ReactNode;
|
|
27
|
-
}
|
|
26
|
+
}
|
|
28
27
|
export interface OnePageAdaptableWizardProps<ENTITY> {
|
|
29
28
|
moduleInfo: ModuleInfo;
|
|
30
29
|
data: ENTITY;
|
|
31
|
-
sections: (
|
|
30
|
+
sections: (OnePageAdaptableWizardSection<ENTITY> | '-')[];
|
|
32
31
|
currentIndex?: number;
|
|
33
32
|
defaultCurrentIndex?: number;
|
|
34
33
|
defaultCurrentSectionName?: string;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OnePageWizardSummary = exports.OnePageAdaptableWizard = exports.
|
|
3
|
+
exports.OnePageWizardSummary = exports.OnePageAdaptableWizard = exports.useOnePageAdaptableWizardContext = exports.OnePageAdaptableWizardContext = exports.FormDescriptionText = exports.SummaryText = exports.SummaryTag = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const react_redux_1 = require("react-redux");
|
|
8
8
|
const rebass_1 = require("rebass");
|
|
9
9
|
const QueryRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QueryRedux"));
|
|
10
|
-
const Dialog_1 = tslib_1.__importDefault(require("../../components/Dialog"));
|
|
11
10
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
12
|
-
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
13
|
-
const useProperty_1 = tslib_1.__importDefault(require("../../components/utils/useProperty"));
|
|
14
11
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
15
|
-
const isMacLike_1 = require("../../Utilities/isMacLike");
|
|
16
12
|
const Tabs_1 = require("../../components/Tabs");
|
|
17
|
-
const KeyHint_1 = require("../KeyHint");
|
|
18
|
-
const icons_1 = require("../../components/icons");
|
|
19
|
-
const ResizeObserver_1 = require("../../components/ResizeObserver");
|
|
20
13
|
const NamedQueryContext_1 = require("../../components/ExpressionEditor/NamedQueryContext");
|
|
21
|
-
const
|
|
14
|
+
const OnePageWizards_1 = require("./OnePageWizards");
|
|
15
|
+
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
22
16
|
exports.SummaryTag = (props) => React.createElement(rebass_1.Text, Object.assign({}, props));
|
|
23
17
|
exports.SummaryText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mb: 3 }, props)));
|
|
24
18
|
exports.FormDescriptionText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mt: 1 }, props)));
|
|
@@ -26,187 +20,59 @@ exports.OnePageAdaptableWizardContext = React.createContext({
|
|
|
26
20
|
data: null,
|
|
27
21
|
sections: [],
|
|
28
22
|
moduleInfo: null,
|
|
29
|
-
setCurrentSection: (index) => { },
|
|
30
23
|
api: null,
|
|
31
24
|
namedQuery: false,
|
|
32
25
|
});
|
|
33
|
-
function
|
|
26
|
+
function useOnePageAdaptableWizardContext() {
|
|
34
27
|
return React.useContext(exports.OnePageAdaptableWizardContext);
|
|
35
28
|
}
|
|
36
|
-
exports.
|
|
29
|
+
exports.useOnePageAdaptableWizardContext = useOnePageAdaptableWizardContext;
|
|
37
30
|
exports.OnePageAdaptableWizard = (props) => {
|
|
38
|
-
var _a, _b;
|
|
39
31
|
const { api } = AdaptableContext_1.useAdaptable();
|
|
40
32
|
const dispatch = react_redux_1.useDispatch();
|
|
41
33
|
const saveNamedQuery = React.useCallback((namedQuery) => dispatch(QueryRedux.NamedQueryAdd(namedQuery)), []);
|
|
42
|
-
let defaultCurrentIndex = 0;
|
|
43
|
-
if (props.defaultCurrentSectionName) {
|
|
44
|
-
const candidate = props.sections.findIndex((section) => section !== '-' && section.title === props.defaultCurrentSectionName);
|
|
45
|
-
if (candidate >= 0) {
|
|
46
|
-
defaultCurrentIndex = candidate;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const [currentSection, setCurrentSection] = useProperty_1.default(props, 'currentIndex', defaultCurrentIndex, {
|
|
50
|
-
onChange: (index) => {
|
|
51
|
-
var _a;
|
|
52
|
-
(_a = props.onSectionChange) === null || _a === void 0 ? void 0 : _a.call(props, index);
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
34
|
const [namedQuery, setNamedQuery] = react_1.useState(false);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
saveNamedQuery(namedQuery);
|
|
61
|
-
}
|
|
62
|
-
(_a = props.onFinish) === null || _a === void 0 ? void 0 : _a.call(props, props.data);
|
|
63
|
-
};
|
|
64
|
-
const renderSection = (index) => {
|
|
65
|
-
const section = visibleSections[index];
|
|
66
|
-
if (section === '-') {
|
|
67
|
-
return React.createElement(React.Fragment, { key: index });
|
|
68
|
-
}
|
|
69
|
-
return (React.createElement(rebass_1.Flex, { flexDirection: "column", key: index, "data-name": `section-${index}`, style: { minHeight: '100%' }, mr: 2 },
|
|
70
|
-
React.createElement(rebass_1.Box, { py: 3, paddingLeft: 2, fontSize: 4, className: "ab-OnePageWizard__details" }, section.details),
|
|
71
|
-
React.createElement(rebass_1.Box, { flex: 1, className: "ab-OnePageWizard__section" }, section.render(props.data, index))));
|
|
72
|
-
};
|
|
73
|
-
const selectedNodeRef = react_1.useRef(null);
|
|
74
|
-
const selectedFeedback = (React.createElement("div", { ref: selectedNodeRef, className: "ab-OnePageWizard__selected-title-overlay", style: {
|
|
75
|
-
position: 'absolute',
|
|
76
|
-
background: 'var(--ab-cmp-one-page-wizard-selected-title__background)',
|
|
77
|
-
pointerEvents: 'none',
|
|
78
|
-
borderRadius: 'var(--ab__border-radius)',
|
|
79
|
-
transition: 'top 0.2s',
|
|
80
|
-
} }));
|
|
81
|
-
const sizeOwnerRef = react_1.useRef(null);
|
|
82
|
-
const [width, setWidth] = react_1.useState(0);
|
|
83
|
-
ResizeObserver_1.useResizeObserver(sizeOwnerRef, ({ width }) => {
|
|
84
|
-
setWidth(width);
|
|
85
|
-
});
|
|
86
|
-
React.useEffect(() => {
|
|
87
|
-
const node = selectedNodeRef.current;
|
|
88
|
-
const parent = node.parentNode;
|
|
89
|
-
const activeElement = parent.children[currentSection];
|
|
90
|
-
node.style.top = `${activeElement.offsetTop}px`;
|
|
91
|
-
node.style.left = `${activeElement.offsetLeft}px`;
|
|
92
|
-
node.style.height = `${activeElement.offsetHeight}px`;
|
|
93
|
-
node.style.width = `${activeElement.offsetWidth}px`;
|
|
94
|
-
}, [currentSection, width]);
|
|
95
|
-
let navIndex = 0;
|
|
96
|
-
const dialogRef = react_1.useRef(null);
|
|
97
|
-
let invalidCount = 0;
|
|
98
|
-
let firstErrorMessage = null;
|
|
99
|
-
const contextValue = {
|
|
35
|
+
const name = props.moduleInfo.FriendlyName
|
|
36
|
+
? `${kebabCase_1.default(props.moduleInfo.FriendlyName)}-wizard`
|
|
37
|
+
: '';
|
|
38
|
+
const extraContext = {
|
|
100
39
|
data: props.data,
|
|
101
40
|
api,
|
|
102
|
-
//visible sections is updated below, as this is a chicken-egg problem
|
|
103
|
-
sections: props.sections,
|
|
104
|
-
setCurrentSection,
|
|
105
41
|
namedQuery,
|
|
106
42
|
moduleInfo: props.moduleInfo,
|
|
43
|
+
sections: props.sections,
|
|
107
44
|
};
|
|
108
|
-
const
|
|
109
|
-
return props.sections.filter((section) => section === '-' ||
|
|
110
|
-
section.isVisible == undefined ||
|
|
111
|
-
section.isVisible(props.data, api, contextValue));
|
|
112
|
-
}, [props.sections]);
|
|
113
|
-
contextValue.sections = visibleSections;
|
|
114
|
-
const validSectionsMap = visibleSections.reduce((acc, section, index) => {
|
|
45
|
+
const sections = props.sections.map((section) => {
|
|
115
46
|
if (section === '-') {
|
|
116
|
-
|
|
117
|
-
return acc;
|
|
47
|
+
return '-';
|
|
118
48
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
49
|
+
const isValid = typeof section.isValid === 'function'
|
|
50
|
+
? (data, innerContext) => {
|
|
51
|
+
return section.isValid(data, api, Object.assign(Object.assign({}, innerContext), extraContext));
|
|
52
|
+
}
|
|
53
|
+
: void 0;
|
|
54
|
+
const isVisible = typeof section.isVisible === 'function'
|
|
55
|
+
? (data, innerContext) => {
|
|
56
|
+
return section.isVisible(data, api, Object.assign(Object.assign({}, innerContext), extraContext));
|
|
124
57
|
}
|
|
58
|
+
: void 0;
|
|
59
|
+
return Object.assign(Object.assign({}, section), { isValid,
|
|
60
|
+
isVisible });
|
|
61
|
+
});
|
|
62
|
+
const handleClickFinish = () => {
|
|
63
|
+
var _a;
|
|
64
|
+
if (namedQuery && namedQuery.Name) {
|
|
65
|
+
saveNamedQuery(namedQuery);
|
|
125
66
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return (React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: { namedQuery, setNamedQuery } },
|
|
132
|
-
React.createElement(exports.OnePageAdaptableWizardContext.Provider, { value: contextValue },
|
|
133
|
-
React.createElement(Dialog_1.default, { modal: true, isOpen: true, showCloseButton: false, focusOnBrowserVisible: true, style: {
|
|
134
|
-
borderRadius: 'var(--ab__border-radius)',
|
|
135
|
-
overflow: 'hidden',
|
|
136
|
-
height: '80vh',
|
|
137
|
-
}, ref: dialogRef, onDismiss: () => { var _a; return (_a = props.onHide) === null || _a === void 0 ? void 0 : _a.call(props); }, onKeyDown: (event) => {
|
|
138
|
-
if (event.metaKey || event.ctrlKey) {
|
|
139
|
-
const { key } = event;
|
|
140
|
-
if (!isNaN(Number(key))) {
|
|
141
|
-
const num = Number(key);
|
|
142
|
-
if (navIndexMap.has(num)) {
|
|
143
|
-
const index = navIndexMap.get(num);
|
|
144
|
-
setCurrentSection(index);
|
|
145
|
-
event.preventDefault();
|
|
146
|
-
event.stopPropagation();
|
|
147
|
-
requestAnimationFrame(() => {
|
|
148
|
-
var _a;
|
|
149
|
-
(_a = dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _a === void 0 ? void 0 : _a.bringToFront();
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
} },
|
|
155
|
-
React.createElement(rebass_1.Flex, { className: "ab-OnePageWizard", flexDirection: "column", "data-name": props.moduleInfo.FriendlyName
|
|
156
|
-
? `${kebabCase_1.default(props.moduleInfo.FriendlyName)}-wizard`
|
|
157
|
-
: '', style: Object.assign({ height: '100%', width: '90vw', maxWidth: 1000 }, props.style) },
|
|
158
|
-
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "stretch", flex: 1, style: { overflow: 'auto' } },
|
|
159
|
-
React.createElement(rebass_1.Flex, { flexDirection: "column", padding: 3, className: "ab-OnePageWizard__section-title-container", ref: sizeOwnerRef, style: { overflow: 'auto', position: 'relative', flex: 'none' } },
|
|
160
|
-
visibleSections.map((section, index) => {
|
|
161
|
-
if (section === '-') {
|
|
162
|
-
return (React.createElement(rebass_1.Box, { as: "hr", mt: 2, className: "ab-OnePageWizard__section-separator", key: `${index}-`, style: {
|
|
163
|
-
width: '100%',
|
|
164
|
-
border: 'none',
|
|
165
|
-
borderTop: `1px solid var(--ab-color-inputborder)`,
|
|
166
|
-
} }));
|
|
167
|
-
}
|
|
168
|
-
navIndex++;
|
|
169
|
-
navIndexMap.set(navIndex, index);
|
|
170
|
-
const active = index === currentSection;
|
|
171
|
-
const disabled = false; //!active && !currentSectionValid;
|
|
172
|
-
return (React.createElement(rebass_1.Flex, { className: "ab-OnePageWizard__section-title", "data-name": section.title, flexDirection: "row", style: {
|
|
173
|
-
cursor: disabled ? 'auto' : 'pointer',
|
|
174
|
-
zIndex: 10,
|
|
175
|
-
transition: 'color 0.2s',
|
|
176
|
-
opacity: disabled ? 0.5 : 1,
|
|
177
|
-
}, key: section.title, color: active ? 'var(--ab-cmp-one-page-wizard-section-title__color)' : '', px: 2, py: 1, mt: index ? 2 : 0, onClick: () => {
|
|
178
|
-
if (disabled) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
setCurrentSection(index);
|
|
182
|
-
} },
|
|
183
|
-
React.createElement(KeyHint_1.KeyHint, { mr: 2, style: { display: 'inline-block' } }, navIndex),
|
|
184
|
-
React.createElement("div", { style: { flex: 1 } }, section.title),
|
|
185
|
-
React.createElement(icons_1.Icon, { name: "error", style: {
|
|
186
|
-
marginLeft: 'var(--ab-space-2)',
|
|
187
|
-
visibility: validSectionsMap.get(index) !== true ? 'visible' : 'hidden',
|
|
188
|
-
} })));
|
|
189
|
-
}),
|
|
190
|
-
selectedFeedback,
|
|
191
|
-
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
192
|
-
React.createElement(KeyHint_1.KeyHint, { style: { lineHeight: 1.5 }, className: "ab-OnePageWizard__key-hint" },
|
|
193
|
-
isMacLike_1.isMacLike() ? 'Cmd' : 'Ctrl',
|
|
194
|
-
" + #",
|
|
195
|
-
React.createElement("br", null),
|
|
196
|
-
"to navigate")),
|
|
197
|
-
React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "column", className: "ab-OnePageWizard__section-container" }, renderSection(currentSection))),
|
|
198
|
-
React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 2, alignItems: "center", className: "ab-WizardDialog__footer ab-OnePageWizard__footer" },
|
|
199
|
-
React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "text", "data-name": "close", onClick: () => { var _a; return (_a = props.onHide) === null || _a === void 0 ? void 0 : _a.call(props); }, tooltip: (_a = props.closeTooltip) !== null && _a !== void 0 ? _a : 'Close wizard', accessLevel: 'Full' }, (_b = props.closeText) !== null && _b !== void 0 ? _b : 'CLOSE'),
|
|
200
|
-
React.createElement(KeyHint_1.KeyHint, { ml: 2 }, "Esc"),
|
|
201
|
-
React.createElement(rebass_1.Text, { fontSize: 2, mr: 3, className: "ab-OnePageWizard__error", style: {
|
|
202
|
-
flex: 1,
|
|
203
|
-
color: 'var(--ab-color-error)',
|
|
204
|
-
textAlign: 'end',
|
|
205
|
-
} }, firstErrorMessage),
|
|
206
|
-
React.createElement(SimpleButton_1.default, { tone: "accent", "data-name": "finish", variant: "raised", disabled: canFinish !== true, onClick: () => handleClickFinish(), icon: 'check', accessLevel: 'Full' }, "Finish")))))));
|
|
67
|
+
(_a = props.onFinish) === null || _a === void 0 ? void 0 : _a.call(props, props.data);
|
|
68
|
+
};
|
|
69
|
+
return (React.createElement(exports.OnePageAdaptableWizardContext.Provider, { value: extraContext },
|
|
70
|
+
React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: { namedQuery, setNamedQuery } },
|
|
71
|
+
React.createElement(OnePageWizards_1.OnePageWizard, Object.assign({}, props, { name: name, sections: sections, onFinish: handleClickFinish })))));
|
|
207
72
|
};
|
|
208
73
|
exports.OnePageWizardSummary = () => {
|
|
209
|
-
const {
|
|
74
|
+
const { setCurrentSection } = OnePageWizards_1.useOnePageWizardContext();
|
|
75
|
+
const { sections, data, api } = useOnePageAdaptableWizardContext();
|
|
210
76
|
const renderEdit = (index) => (React.createElement(SimpleButton_1.default, { px: 1, variant: "text", style: {
|
|
211
77
|
textDecoration: 'underline',
|
|
212
78
|
display: 'inline-block',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { TextProps } from 'rebass';
|
|
4
|
+
export declare type OnePageWizardContextType<T> = {
|
|
5
|
+
data: T;
|
|
6
|
+
sections: (OnePageWizardSection<T> | '-')[];
|
|
7
|
+
setCurrentSection: (index: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const SummaryTag: React.FunctionComponent<TextProps>;
|
|
10
|
+
export declare const SummaryText: React.FunctionComponent<TextProps>;
|
|
11
|
+
export declare const FormDescriptionText: React.FunctionComponent<TextProps>;
|
|
12
|
+
export declare const OnePageWizardContext: React.Context<OnePageWizardContextType<any>>;
|
|
13
|
+
export declare function useOnePageWizardContext<ENTITY>(): OnePageWizardContextType<ENTITY>;
|
|
14
|
+
export declare type OnePageWizardSection<ENTITY> = {
|
|
15
|
+
title: string;
|
|
16
|
+
details?: React.ReactNode;
|
|
17
|
+
isValid?: (data: ENTITY, context: OnePageWizardContextType<ENTITY>) => true | string;
|
|
18
|
+
isVisible?: (data: ENTITY, context: OnePageWizardContextType<ENTITY>) => boolean;
|
|
19
|
+
render: (data: ENTITY, index: number) => React.ReactNode;
|
|
20
|
+
renderSummary?: (data: ENTITY) => React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export interface OnePageWizardProps<ENTITY> {
|
|
23
|
+
data: ENTITY;
|
|
24
|
+
name: string;
|
|
25
|
+
sections: (OnePageWizardSection<ENTITY> | '-')[];
|
|
26
|
+
currentIndex?: number;
|
|
27
|
+
defaultCurrentIndex?: number;
|
|
28
|
+
defaultCurrentSectionName?: string;
|
|
29
|
+
onSectionChange?: (index: number) => void;
|
|
30
|
+
onHide?: VoidFunction;
|
|
31
|
+
onFinish?: (data: ENTITY) => any;
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
closeText?: React.ReactNode;
|
|
35
|
+
closeTooltip?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const OnePageWizard: <ENTITY extends unknown>(props: OnePageWizardProps<ENTITY>) => JSX.Element;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnePageWizard = exports.useOnePageWizardContext = exports.OnePageWizardContext = exports.FormDescriptionText = exports.SummaryText = exports.SummaryTag = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
8
|
+
const Dialog_1 = tslib_1.__importDefault(require("../../components/Dialog"));
|
|
9
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
10
|
+
const useProperty_1 = tslib_1.__importDefault(require("../../components/utils/useProperty"));
|
|
11
|
+
const isMacLike_1 = require("../../Utilities/isMacLike");
|
|
12
|
+
const KeyHint_1 = require("../KeyHint");
|
|
13
|
+
const icons_1 = require("../../components/icons");
|
|
14
|
+
const ResizeObserver_1 = require("../../components/ResizeObserver");
|
|
15
|
+
const NamedQueryContext_1 = require("../../components/ExpressionEditor/NamedQueryContext");
|
|
16
|
+
const useKeyboardNavigation_1 = require("./useKeyboardNavigation");
|
|
17
|
+
exports.SummaryTag = (props) => React.createElement(rebass_1.Text, Object.assign({}, props));
|
|
18
|
+
exports.SummaryText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mb: 3 }, props)));
|
|
19
|
+
exports.FormDescriptionText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mt: 1 }, props)));
|
|
20
|
+
exports.OnePageWizardContext = React.createContext({
|
|
21
|
+
data: null,
|
|
22
|
+
sections: [],
|
|
23
|
+
setCurrentSection: (index) => { },
|
|
24
|
+
});
|
|
25
|
+
function useOnePageWizardContext() {
|
|
26
|
+
return React.useContext(exports.OnePageWizardContext);
|
|
27
|
+
}
|
|
28
|
+
exports.useOnePageWizardContext = useOnePageWizardContext;
|
|
29
|
+
exports.OnePageWizard = (props) => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
let defaultCurrentIndex = 0;
|
|
32
|
+
if (props.defaultCurrentSectionName) {
|
|
33
|
+
const candidate = props.sections.findIndex((section) => section !== '-' && section.title === props.defaultCurrentSectionName);
|
|
34
|
+
if (candidate >= 0) {
|
|
35
|
+
defaultCurrentIndex = candidate;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const [currentSection, setCurrentSection] = useProperty_1.default(props, 'currentIndex', defaultCurrentIndex, {
|
|
39
|
+
onChange: (index) => {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = props.onSectionChange) === null || _a === void 0 ? void 0 : _a.call(props, index);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
const [namedQuery, setNamedQuery] = react_1.useState(false);
|
|
45
|
+
const [navIndexMap] = react_1.useState(() => new Map());
|
|
46
|
+
const handleClickFinish = () => {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = props.onFinish) === null || _a === void 0 ? void 0 : _a.call(props, props.data);
|
|
49
|
+
};
|
|
50
|
+
const renderSection = (index) => {
|
|
51
|
+
const section = visibleSections[index];
|
|
52
|
+
if (section === '-') {
|
|
53
|
+
return React.createElement(React.Fragment, { key: index });
|
|
54
|
+
}
|
|
55
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", key: index, "data-name": `section-${index}`, style: { minHeight: '100%' }, mr: 2 },
|
|
56
|
+
React.createElement(rebass_1.Box, { py: 3, paddingLeft: 2, fontSize: 4, className: "ab-OnePageWizard__details" }, section.details),
|
|
57
|
+
React.createElement(rebass_1.Box, { flex: 1, className: "ab-OnePageWizard__section" }, section.render(props.data, index))));
|
|
58
|
+
};
|
|
59
|
+
const selectedNodeRef = react_1.useRef(null);
|
|
60
|
+
const selectedFeedback = (React.createElement("div", { ref: selectedNodeRef, className: "ab-OnePageWizard__selected-title-overlay", style: {
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
background: 'var(--ab-cmp-one-page-wizard-selected-title__background)',
|
|
63
|
+
pointerEvents: 'none',
|
|
64
|
+
borderRadius: 'var(--ab__border-radius)',
|
|
65
|
+
transition: 'top 0.2s',
|
|
66
|
+
} }));
|
|
67
|
+
const sizeOwnerRef = react_1.useRef(null);
|
|
68
|
+
const [width, setWidth] = react_1.useState(0);
|
|
69
|
+
ResizeObserver_1.useResizeObserver(sizeOwnerRef, ({ width }) => {
|
|
70
|
+
setWidth(width);
|
|
71
|
+
});
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
const node = selectedNodeRef.current;
|
|
74
|
+
const parent = node.parentNode;
|
|
75
|
+
const activeElement = parent.children[currentSection];
|
|
76
|
+
node.style.top = `${activeElement.offsetTop}px`;
|
|
77
|
+
node.style.left = `${activeElement.offsetLeft}px`;
|
|
78
|
+
node.style.height = `${activeElement.offsetHeight}px`;
|
|
79
|
+
node.style.width = `${activeElement.offsetWidth}px`;
|
|
80
|
+
}, [currentSection, width]);
|
|
81
|
+
let navIndex = 0;
|
|
82
|
+
const dialogRef = react_1.useRef(null);
|
|
83
|
+
let invalidCount = 0;
|
|
84
|
+
let firstErrorMessage = null;
|
|
85
|
+
const contextValue = {
|
|
86
|
+
data: props.data,
|
|
87
|
+
sections: props.sections,
|
|
88
|
+
setCurrentSection,
|
|
89
|
+
};
|
|
90
|
+
const visibleSections = React.useMemo(() => {
|
|
91
|
+
return props.sections.filter((section) => section === '-' ||
|
|
92
|
+
section.isVisible == undefined ||
|
|
93
|
+
section.isVisible(props.data, contextValue));
|
|
94
|
+
}, [props.sections]);
|
|
95
|
+
contextValue.sections = visibleSections;
|
|
96
|
+
const validSectionsMap = visibleSections.reduce((acc, section, index) => {
|
|
97
|
+
if (section === '-') {
|
|
98
|
+
acc.set(index, true);
|
|
99
|
+
return acc;
|
|
100
|
+
}
|
|
101
|
+
const valid = section.isValid ? section.isValid(props.data, contextValue) : true; //!active && canFinish !== true;
|
|
102
|
+
if (valid !== true) {
|
|
103
|
+
invalidCount++;
|
|
104
|
+
if (firstErrorMessage == null) {
|
|
105
|
+
firstErrorMessage = valid;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
acc.set(index, valid);
|
|
109
|
+
return acc;
|
|
110
|
+
}, new Map());
|
|
111
|
+
useKeyboardNavigation_1.useKeyboardNavigation(setCurrentSection, visibleSections);
|
|
112
|
+
const canFinish = !invalidCount;
|
|
113
|
+
return (React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: { namedQuery, setNamedQuery } },
|
|
114
|
+
React.createElement(exports.OnePageWizardContext.Provider, { value: contextValue },
|
|
115
|
+
React.createElement(Dialog_1.default, { modal: true, isOpen: true, showCloseButton: false, focusOnBrowserVisible: true, style: {
|
|
116
|
+
borderRadius: 'var(--ab__border-radius)',
|
|
117
|
+
overflow: 'hidden',
|
|
118
|
+
height: '80vh',
|
|
119
|
+
}, ref: dialogRef, onDismiss: () => { var _a; return (_a = props.onHide) === null || _a === void 0 ? void 0 : _a.call(props); }, onKeyDown: (event) => {
|
|
120
|
+
if (event.metaKey || event.ctrlKey) {
|
|
121
|
+
const { key } = event;
|
|
122
|
+
if (!isNaN(Number(key))) {
|
|
123
|
+
const num = Number(key);
|
|
124
|
+
if (navIndexMap.has(num)) {
|
|
125
|
+
const index = navIndexMap.get(num);
|
|
126
|
+
setCurrentSection(index);
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
event.stopPropagation();
|
|
129
|
+
requestAnimationFrame(() => {
|
|
130
|
+
var _a;
|
|
131
|
+
(_a = dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _a === void 0 ? void 0 : _a.bringToFront();
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} },
|
|
137
|
+
React.createElement(rebass_1.Flex, { className: "ab-OnePageWizard", flexDirection: "column", "data-name": props.name, style: Object.assign({ height: '100%', width: '90vw', maxWidth: 1200 }, props.style) },
|
|
138
|
+
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "stretch", flex: 1, style: { overflow: 'auto' } },
|
|
139
|
+
React.createElement(rebass_1.Flex, { flexDirection: "column", padding: 3, className: "ab-OnePageWizard__section-title-container", ref: sizeOwnerRef, style: { overflow: 'auto', position: 'relative', flex: 'none' } },
|
|
140
|
+
visibleSections.map((section, index) => {
|
|
141
|
+
if (section === '-') {
|
|
142
|
+
return (React.createElement(rebass_1.Box, { as: "hr", mt: 2, className: "ab-OnePageWizard__section-separator", key: `${index}-`, style: {
|
|
143
|
+
width: '100%',
|
|
144
|
+
border: 'none',
|
|
145
|
+
borderTop: `1px solid var(--ab-color-inputborder)`,
|
|
146
|
+
} }));
|
|
147
|
+
}
|
|
148
|
+
navIndex++;
|
|
149
|
+
navIndexMap.set(navIndex, index);
|
|
150
|
+
const active = index === currentSection;
|
|
151
|
+
const disabled = false; //!active && !currentSectionValid;
|
|
152
|
+
return (React.createElement(rebass_1.Flex, { className: "ab-OnePageWizard__section-title", "data-name": section.title, flexDirection: "row", style: {
|
|
153
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
154
|
+
zIndex: 10,
|
|
155
|
+
transition: 'color 0.2s',
|
|
156
|
+
opacity: disabled ? 0.5 : 1,
|
|
157
|
+
}, key: section.title, color: active ? 'var(--ab-cmp-one-page-wizard-section-title__color)' : '', px: 2, py: 1, mt: index ? 2 : 0, onClick: () => {
|
|
158
|
+
if (disabled) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
setCurrentSection(index);
|
|
162
|
+
} },
|
|
163
|
+
React.createElement(KeyHint_1.KeyHint, { mr: 2, style: { display: 'inline-block' } }, navIndex),
|
|
164
|
+
React.createElement("div", { style: { flex: 1 } }, section.title),
|
|
165
|
+
React.createElement(icons_1.Icon, { name: "error", style: {
|
|
166
|
+
marginLeft: 'var(--ab-space-2)',
|
|
167
|
+
visibility: validSectionsMap.get(index) !== true ? 'visible' : 'hidden',
|
|
168
|
+
} })));
|
|
169
|
+
}),
|
|
170
|
+
selectedFeedback,
|
|
171
|
+
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
172
|
+
React.createElement(KeyHint_1.KeyHint, { style: { lineHeight: 1.5 }, className: "ab-OnePageWizard__key-hint" },
|
|
173
|
+
isMacLike_1.isMacLike() ? 'Cmd' : 'Ctrl',
|
|
174
|
+
" + #",
|
|
175
|
+
React.createElement("br", null),
|
|
176
|
+
"to navigate")),
|
|
177
|
+
React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "column", className: "ab-OnePageWizard__section-container" }, renderSection(currentSection))),
|
|
178
|
+
React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 2, alignItems: "center", className: "ab-WizardDialog__footer ab-OnePageWizard__footer" },
|
|
179
|
+
React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "text", "data-name": "close", onClick: () => { var _a; return (_a = props.onHide) === null || _a === void 0 ? void 0 : _a.call(props); }, tooltip: (_a = props.closeTooltip) !== null && _a !== void 0 ? _a : 'Close wizard', accessLevel: 'Full' }, (_b = props.closeText) !== null && _b !== void 0 ? _b : 'CLOSE'),
|
|
180
|
+
React.createElement(KeyHint_1.KeyHint, { ml: 2 }, "Esc"),
|
|
181
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mr: 3, className: "ab-OnePageWizard__error", style: {
|
|
182
|
+
flex: 1,
|
|
183
|
+
color: 'var(--ab-color-error)',
|
|
184
|
+
textAlign: 'end',
|
|
185
|
+
} }, firstErrorMessage),
|
|
186
|
+
React.createElement(SimpleButton_1.default, { tone: "accent", "data-name": "finish", variant: "raised", disabled: canFinish !== true, onClick: () => handleClickFinish(), icon: 'check', accessLevel: 'Full' }, "Finish")))))));
|
|
187
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OnePageWizardSection } from './
|
|
1
|
+
import { OnePageWizardSection } from './OnePageWizards';
|
|
2
2
|
export declare const useKeyboardNavigation: <ENTITY>(setCurrentSection: (value: number | ((v: number) => number)) => void, sections: ("-" | OnePageWizardSection<ENTITY>)[]) => void;
|
|
@@ -51,7 +51,8 @@ class ActionColumnRenderer {
|
|
|
51
51
|
width: 15,
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
|
-
const
|
|
54
|
+
const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context);
|
|
55
|
+
const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
|
|
55
56
|
const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
56
57
|
const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
57
58
|
const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
@@ -66,7 +67,7 @@ class ActionColumnRenderer {
|
|
|
66
67
|
};
|
|
67
68
|
const disabled = button.disabled && button.disabled(button, context);
|
|
68
69
|
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
|
|
69
|
-
|
|
70
|
+
buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
70
71
|
buttonLabel));
|
|
71
72
|
})));
|
|
72
73
|
};
|