@adaptabletools/adaptable 23.0.4 → 23.0.5-canary.1
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.js +0 -31
- package/index.css +0 -64
- package/index.js +0 -31
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
- package/src/AdaptableOptions/AdaptablePlugin.js +1 -9
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +3 -39
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +44 -16
- package/src/AdaptableState/Aggregations/only.js +0 -11
- package/src/AdaptableState/Aggregations/weightedAverage.d.ts +0 -1
- package/src/AdaptableState/Aggregations/weightedAverage.js +1 -27
- package/src/AdaptableState/Common/AdaptableColumn.js +0 -1
- package/src/AdaptableState/Common/AdaptableForm.js +0 -49
- package/src/AdaptableState/Common/AdaptableFormatPresets.js +0 -13
- package/src/AdaptableState/Common/AdaptablePredicate.js +3 -125
- package/src/AdaptableState/Common/AggregationColumns.js +0 -10
- package/src/AdaptableState/Common/Enums.js +0 -3
- package/src/AdaptableState/Common/Menu.js +1 -7
- package/src/AdaptableState/Common/MenuItem.js +0 -2
- package/src/AdaptableState/Common/Types.js +2 -5
- package/src/AdaptableState/StatusBarState.js +0 -3
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +0 -1
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.js +0 -4
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +0 -5
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +0 -8
- package/src/AdaptableState/Uuid.js +0 -1
- package/src/Api/Implementation/AdaptableApiImpl.js +0 -4
- package/src/Api/Implementation/AlertApiImpl.js +0 -21
- package/src/Api/Implementation/ApiBase.js +0 -24
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +0 -1
- package/src/Api/Implementation/ChartingApiImpl.js +0 -3
- package/src/Api/Implementation/ColumnApiImpl.js +1 -15
- package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -9
- package/src/Api/Implementation/ColumnScopeApiImpl.js +0 -21
- package/src/Api/Implementation/DashboardApiImpl.js +0 -1
- package/src/Api/Implementation/EntitlementApiImpl.js +0 -1
- package/src/Api/Implementation/ExportApiImpl.js +0 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +0 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +0 -3
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -2
- package/src/Api/Implementation/GridApiImpl.js +1 -22
- package/src/Api/Implementation/GridFilterApiImpl.js +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -18
- package/src/Api/Implementation/LayoutHelpers.js +0 -16
- package/src/Api/Implementation/NamedQueryApiImpl.js +0 -1
- package/src/Api/Implementation/PredicateApiImpl.js +0 -5
- package/src/Api/Implementation/RowFormApiImpl.js +0 -2
- package/src/Api/Implementation/StateApiImpl.js +0 -7
- package/src/Api/Implementation/SystemStatusApiImpl.js +0 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +0 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +1 -39
- package/src/Api/Internal/AlertInternalApi.js +1 -102
- package/src/Api/Internal/CalculatedColumnInternalApi.js +0 -17
- package/src/Api/Internal/ChartingInternalApi.js +0 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +0 -52
- package/src/Api/Internal/ColumnInternalApi.js +0 -32
- package/src/Api/Internal/CustomSortInternalApi.js +0 -5
- package/src/Api/Internal/DashboardInternalApi.js +0 -23
- package/src/Api/Internal/DataImportInternalApi.js +0 -1
- package/src/Api/Internal/EventInternalApi.js +0 -2
- package/src/Api/Internal/ExportInternalApi.js +1 -16
- package/src/Api/Internal/ExpressionInternalApi.js +0 -23
- package/src/Api/Internal/Fdc3InternalApi.js +0 -9
- package/src/Api/Internal/FlashingCellInternalApi.js +0 -5
- package/src/Api/Internal/FormatColumnInternalApi.js +5 -107
- package/src/Api/Internal/FreeTextColumnInternalApi.js +0 -8
- package/src/Api/Internal/GridFilterInternalApi.js +0 -3
- package/src/Api/Internal/GridInternalApi.js +0 -37
- package/src/Api/Internal/LayoutInternalApi.js +0 -18
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -9
- package/src/Api/Internal/PredicateInternalApi.js +0 -23
- package/src/Api/Internal/RowFormInternalApi.js +0 -18
- package/src/Api/Internal/StateInternalApi.js +0 -25
- package/src/Api/Internal/StyledColumnInternalApi.js +0 -62
- package/src/Api/Internal/TeamSharingInternalApi.js +0 -9
- package/src/Redux/ActionsReducers/AlertRedux.js +0 -24
- package/src/Redux/ActionsReducers/ApplicationRedux.js +0 -9
- package/src/Redux/ActionsReducers/BulkUpdateRedux.js +0 -6
- package/src/Redux/ActionsReducers/CalculatedColumnRedux.js +1 -16
- package/src/Redux/ActionsReducers/ChartingRedux.js +0 -24
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -24
- package/src/Redux/ActionsReducers/CustomSortRedux.js +0 -24
- package/src/Redux/ActionsReducers/DashboardRedux.js +0 -33
- package/src/Redux/ActionsReducers/ExportRedux.js +0 -36
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +0 -24
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +0 -36
- package/src/Redux/ActionsReducers/FreeTextColumnRedux.js +1 -20
- package/src/Redux/ActionsReducers/InternalRedux.js +0 -42
- package/src/Redux/ActionsReducers/LayoutRedux.js +1 -67
- package/src/Redux/ActionsReducers/NamedQueryRedux.js +0 -15
- package/src/Redux/ActionsReducers/NoteRedux.js +0 -14
- package/src/Redux/ActionsReducers/PluginsRedux.js +0 -3
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +0 -34
- package/src/Redux/ActionsReducers/PopupRedux.js +2 -6
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +0 -15
- package/src/Redux/ActionsReducers/ShortcutRedux.js +0 -24
- package/src/Redux/ActionsReducers/SmartEditRedux.js +0 -6
- package/src/Redux/ActionsReducers/StatusBarRedux.js +0 -6
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +0 -27
- package/src/Redux/ActionsReducers/SystemStatusRedux.js +0 -6
- package/src/Redux/ActionsReducers/TeamSharingRedux.js +0 -1
- package/src/Redux/ActionsReducers/ThemeRedux.js +0 -26
- package/src/Redux/ActionsReducers/ToolPanelRedux.js +0 -22
- package/src/Redux/ActionsReducers/UserInterfaceRedux.js +0 -3
- package/src/Redux/ActionsReducers/utils.js +0 -6
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +0 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +0 -25
- package/src/Redux/Store/AdaptableStore.js +5 -301
- package/src/Strategy/AdaptableModuleBase.js +0 -35
- package/src/Strategy/AlertModule.js +0 -9
- package/src/Strategy/CellSummaryModule.js +0 -12
- package/src/Strategy/ChartingModule.js +0 -1
- package/src/Strategy/ColumnFilterModule.js +1 -11
- package/src/Strategy/CommentModule.js +0 -2
- package/src/Strategy/DashboardModule.js +0 -4
- package/src/Strategy/ExportModule.js +0 -1
- package/src/Strategy/FlashingCellModule.js +0 -8
- package/src/Strategy/FormatColumnModule.js +0 -3
- package/src/Strategy/FreeTextColumnModule.js +0 -3
- package/src/Strategy/LayoutModule.js +0 -26
- package/src/Strategy/NoteModule.js +0 -3
- package/src/Strategy/PlusMinusModule.js +0 -3
- package/src/Strategy/SettingsPanelModule.js +0 -1
- package/src/Strategy/ShortcutModule.js +0 -1
- package/src/Strategy/SmartEditModule.js +0 -5
- package/src/Strategy/StatusBarModule.js +0 -7
- package/src/Strategy/StyledColumnModule.js +1 -16
- package/src/Strategy/TeamSharingModule.js +0 -9
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +0 -5
- package/src/Utilities/Constants/DocumentationLinkConstants.js +0 -1
- package/src/Utilities/Constants/GeneralConstants.js +0 -10
- package/src/Utilities/Constants/ObjectDefaultConstants.js +0 -3
- package/src/Utilities/Constants/ReduxConstants.js +4 -8
- package/src/Utilities/Emitter.js +0 -9
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +0 -8
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +0 -15
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +0 -3
- package/src/Utilities/ExpressionFunctions/deepMap.js +0 -16
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +0 -9
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +7 -78
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +0 -9
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +2 -16
- package/src/Utilities/Extensions/ArrayExtensions.js +1 -63
- package/src/Utilities/Extensions/NumberExtensions.js +0 -27
- package/src/Utilities/Extensions/ObjectExtensions.js +0 -36
- package/src/Utilities/Extensions/StringExtensions.js +0 -27
- package/src/Utilities/Helpers/ActionColumnHelper.js +0 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -8
- package/src/Utilities/Helpers/DateHelper.js +0 -10
- package/src/Utilities/Helpers/DisplayFormatHelper.js +0 -8
- package/src/Utilities/Helpers/Helper.js +3 -9
- package/src/Utilities/Helpers/PlusMinusHelper.js +0 -20
- package/src/Utilities/Helpers/QuickSearchHelper.js +0 -5
- package/src/Utilities/Helpers/Scheduling/CronExpression.js +0 -43
- package/src/Utilities/Helpers/Scheduling/ScheduledReportHelper.js +0 -4
- package/src/Utilities/Helpers/SettingsPanelHelper.js +40 -4
- package/src/Utilities/Helpers/StyleHelper.js +0 -56
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.js +0 -46
- package/src/Utilities/Helpers/StyledColumns/GradientStyleHelper.js +0 -38
- package/src/Utilities/Helpers/StyledColumns/IconStyleHelper.js +0 -39
- package/src/Utilities/Helpers/StyledColumns/PercentBarStyleHelper.js +0 -1
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +0 -5
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.js +0 -37
- package/src/Utilities/Helpers/TimingHelper.js +0 -13
- package/src/Utilities/ObjectFactory.js +2 -4
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +0 -7
- package/src/Utilities/Services/AlertService.js +0 -1
- package/src/Utilities/Services/AnnotationsService.js +0 -22
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +0 -8
- package/src/Utilities/Services/ChartingService.js +0 -9
- package/src/Utilities/Services/DataService.js +0 -11
- package/src/Utilities/Services/Fdc3Service.js +0 -3
- package/src/Utilities/Services/FlashingCellService.js +0 -6
- package/src/Utilities/Services/ModuleService.js +0 -8
- package/src/Utilities/Services/QueryLanguageService.js +2 -25
- package/src/Utilities/Services/RowFormService.js +0 -1
- package/src/Utilities/Services/RowSummaryService.js +1 -20
- package/src/Utilities/Services/TeamSharingService.js +0 -15
- package/src/Utilities/Services/ThemeService.js +0 -7
- package/src/Utilities/Services/ValidationService.js +0 -21
- package/src/Utilities/createAgStatusPanelComponent.js +0 -3
- package/src/Utilities/getExpressionViewItems.js +0 -2
- package/src/Utilities/getObjectTagsViewItems.js +0 -1
- package/src/Utilities/getScrollbarSize.js +0 -1
- package/src/Utilities/logDeprecation.js +0 -3
- package/src/Utilities/resolveContainerElement.js +0 -21
- package/src/Utilities/runIfNotResolvedIn.js +0 -7
- package/src/Utilities/sortColumnStateForVisibleColumns.js +2 -12
- package/src/Utilities/waitForTimeout.js +0 -1
- package/src/Utilities/wizardSelection.js +0 -2
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/AdaptableView.js +1 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -23
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -2
- package/src/View/AdaptableWizardView/Wizard.js +0 -12
- package/src/View/AdaptableWizardView/helper.js +0 -11
- package/src/View/Alert/ActiveAlertsPanel.js +0 -2
- package/src/View/Alert/AlertStatusSubPanel.js +0 -8
- package/src/View/Alert/Utilities/getAlertType.js +0 -7
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +0 -5
- package/src/View/Alert/Utilities/mapAlertDefinition.js +0 -3
- package/src/View/Alert/Wizard/AlertWizard.js +0 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +0 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +0 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +0 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +0 -3
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -7
- package/src/View/Charting/EditChartButton.js +1 -4
- package/src/View/Charting/ShowChartButton.js +0 -3
- package/src/View/Charting/useAgChartState.js +0 -5
- package/src/View/Charting/useChartingElements.js +0 -4
- package/src/View/Charting/useExternalChartState.js +0 -6
- package/src/View/ColumnInfo/ColumnInfo.js +7 -17
- package/src/View/Comments/CommentsEditor.js +1 -16
- package/src/View/Components/AdaptableButton/AdaptableButtonComponent.js +0 -1
- package/src/View/Components/AdaptableButton/AdaptableButtonView.js +0 -3
- package/src/View/Components/AdaptableDateInput/index.js +2 -9
- package/src/View/Components/AdaptableIconComponent/index.js +0 -4
- package/src/View/Components/AdaptableIconSelector/index.js +0 -3
- package/src/View/Components/AdaptableInput/index.js +0 -2
- package/src/View/Components/Badge/index.js +0 -8
- package/src/View/Components/Buttons/ButtonNewPage.js +1 -2
- package/src/View/Components/CellPopup/index.js +1 -2
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +0 -4
- package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.js +0 -4
- package/src/View/Components/ColumnFilter/ColumnFilter.js +3 -46
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +0 -2
- package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -20
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +2 -16
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -4
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -6
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +0 -20
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +0 -5
- package/src/View/Components/ColumnFilter/utils.js +2 -9
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.js +0 -2
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +0 -1
- package/src/View/Components/EntityRulesEditor/index.js +1 -11
- package/src/View/Components/ExternalRenderer.js +1 -3
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -52
- package/src/View/Components/ModuleValueSelector/index.js +0 -2
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Panels/PanelWithRow.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -2
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +0 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +0 -3
- package/src/View/Components/Popups/AdaptableToaster.js +0 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +0 -8
- package/src/View/Components/RangesComponent.js +0 -57
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +0 -3
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -6
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -18
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +0 -4
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -4
- package/src/View/Components/ValueSelector/index.js +0 -4
- package/src/View/Components/wizardColumnListStyles.js +0 -5
- package/src/View/Dashboard/CustomToolbar.js +1 -25
- package/src/View/Dashboard/PinnedToolbarsSelector.js +0 -1
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -22
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +0 -1
- package/src/View/DataImport/systemFileHandlers.js +1 -1
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +0 -27
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +0 -7
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -12
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -10
- package/src/View/GridFilter/GridFilterPopup.js +0 -1
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +0 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -31
- package/src/View/Layout/LayoutViewPanel.js +0 -2
- package/src/View/Layout/PivotDetailsPopoup.js +0 -2
- package/src/View/Layout/TransposedPopup.js +0 -7
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -6
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +0 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -32
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +0 -3
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +0 -2
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +0 -4
- package/src/View/Note/NotePopup.js +0 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +0 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +0 -4
- package/src/View/StatusBar/StatusBarPanel.js +0 -8
- package/src/View/StatusBar/StatusBarPopup.js +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +0 -11
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +0 -28
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -25
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +0 -26
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +0 -40
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +0 -55
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +0 -15
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +0 -21
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.js +0 -10
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +0 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +1 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +0 -21
- package/src/View/SystemStatus/SystemStatusPopup.js +0 -1
- package/src/View/TeamSharing/SharedEntityObjectView.js +0 -1
- package/src/View/Theme/ThemeSelector.js +0 -1
- package/src/View/UIHelper.js +0 -6
- package/src/View/UIInterfaces.js +0 -1
- package/src/View/Wizard/CollapsibleWizardCard.js +1 -8
- package/src/View/Wizard/OnePageWizards.js +2 -9
- package/src/View/Wizard/SummaryColorTag.js +0 -1
- package/src/View/Wizard/useKeyboardNavigation.js +1 -3
- package/src/agGrid/Adaptable.js +0 -12
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
- package/src/agGrid/AdaptableAgGrid.js +3 -482
- package/src/agGrid/AdaptableFilterHandler.js +0 -5
- package/src/agGrid/AdaptableLogger.js +0 -6
- package/src/agGrid/AgGridAdapter.js +3 -90
- package/src/agGrid/AgGridColumnAdapter.js +6 -168
- package/src/agGrid/AgGridExportAdapter.js +4 -106
- package/src/agGrid/AgGridFilterAdapter.js +0 -5
- package/src/agGrid/AgGridFloatingFilterAdapter.js +0 -10
- package/src/agGrid/AgGridMenuAdapter.js +0 -143
- package/src/agGrid/AgGridModulesAdapter.js +0 -2
- package/src/agGrid/AgGridOptionsService.js +0 -2
- package/src/agGrid/AgGridThemeAdapter.js +0 -7
- package/src/agGrid/agGridDataTypeDefinitions.js +0 -8
- package/src/agGrid/cellRenderers/BadgeRenderer.js +0 -10
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +1 -96
- package/src/agGrid/cellRenderers/IconRenderer.js +0 -55
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +0 -51
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +1 -50
- package/src/agGrid/cellRenderers/RatingRenderer.js +0 -40
- package/src/agGrid/editors/AdaptableDateEditor/index.js +0 -18
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +0 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +0 -11
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +0 -9
- package/src/agGrid/index.js +1 -9
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -73
- package/src/components/CodeBlock/index.d.ts +0 -1
- package/src/components/CodeBlock/index.js +1 -2
- package/src/components/ColorPicker/ColorPicker.js +0 -6
- package/src/components/Combobox/VirtualizedList.js +0 -5
- package/src/components/Combobox/index.js +5 -63
- package/src/components/Dashboard/Dashboard.js +1 -4
- package/src/components/Datepicker/index.js +2 -97
- package/src/components/DragAndDropContext/TabList.js +2 -6
- package/src/components/Drawer/index.js +0 -7
- package/src/components/Dropdown/index.js +0 -1
- package/src/components/DropdownButton/index.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -16
- package/src/components/ExpressionEditor/EditorButton.js +0 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -7
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +0 -1
- package/src/components/ExpressionEditor/ExpressionPreview.js +4 -14
- package/src/components/ExpressionEditor/NamedQueryContext.js +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -6
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +0 -12
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +0 -4
- package/src/components/ExpressionEditor/index.js +5 -14
- package/src/components/Icon/index.js +0 -2
- package/src/components/Input/NumberInput.js +0 -10
- package/src/components/Modal/Backdrop.js +0 -1
- package/src/components/OverlayTrigger/Overlay.js +0 -1
- package/src/components/OverlayTrigger/index.js +3 -15
- package/src/components/ProgressIndicator/ProgressIndicator.js +3 -16
- package/src/components/ResizeObserver/index.js +0 -7
- package/src/components/SimpleButton/index.js +2 -16
- package/src/components/Tabs/index.js +0 -3
- package/src/components/Tag/Tag.js +0 -1
- package/src/components/Tag/columnScopeTagHelpers.js +0 -2
- package/src/components/Textarea/index.js +1 -8
- package/src/components/Toggle/Toggle.js +1 -5
- package/src/components/Toggle/ToggleGroup.js +1 -3
- package/src/components/ToggleButton/index.js +1 -3
- package/src/components/Tree/TreeDropdown/index.js +2 -130
- package/src/components/Tree/treeUtils.js +0 -4
- package/src/components/WindowModal/WindowModal.js +1 -14
- package/src/components/WindowModal/useStacking.js +0 -7
- package/src/components/icons/bullet-chart.js +0 -4
- package/src/components/icons/icon-style.js +0 -4
- package/src/components/icons/index.js +26 -36
- package/src/components/icons/range-bar.js +0 -5
- package/src/components/icons/star.js +0 -1
- package/src/components/twUtils.js +3 -12
- package/src/components/ui/calendar.js +1 -9
- package/src/components/ui/combobox.js +0 -4
- package/src/components/utils/captureTabNavigation/getFocusableChildren.js +0 -1
- package/src/components/utils/useDraggable.js +0 -4
- package/src/components/utils/useProperty.js +0 -18
- package/src/devTools/index.js +0 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/LMEmitter.js +0 -5
- package/src/layout-manager/src/destructurePivotColumnId.js +0 -19
- package/src/layout-manager/src/index.js +2 -182
- package/src/layout-manager/src/isLayoutEqual.js +0 -1
- package/src/layout-manager/src/isPivotColumnTotal.js +0 -2
- package/src/layout-manager/src/normalizeLayoutModel.js +0 -27
- package/src/layout-manager/src/simplifyLayoutModel.js +0 -11
- package/src/layout-manager/src/sortColumnIdsByOrder.js +2 -12
- package/src/lib/utils.js +0 -1
- package/src/migration/AdaptableUpgradeHelper.js +0 -2
- package/src/migration/VersionUpgrade17.js +0 -33
- package/src/migration/VersionUpgrade20.js +1 -21
- package/src/migration/VersionUpgrade21.js +0 -3
- package/src/migration/VersionUpgrade22.js +0 -11
- package/src/migration/VersionUpgrade23.js +0 -73
- package/src/parser/src/evaluator.js +0 -1
- package/src/parser/src/index.js +0 -1
- package/src/parser/src/parser.js +4 -103
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +0 -5
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +0 -2
- package/src/parser/src/tokenizer.js +0 -2
- package/src/parser/src/utils.js +0 -1
- package/src/renderReactRoot.js +0 -12
- package/src/setupDevTools.js +0 -6
- package/src/twMerge.js +0 -1
- package/src/types.d.ts +1 -1
- package/src/types.js +0 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/NamedObject.d.ts +0 -10
- package/src/AdaptableState/Common/NamedObject.js +0 -1
- package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +0 -35
- package/src/Utilities/ExpressionFunctions/groupingMap.js +0 -100
- package/src/Utilities/Interface/AdaptableToolPanelContext.d.ts +0 -4
- package/src/Utilities/Interface/AdaptableToolPanelContext.js +0 -1
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +0 -20
- package/src/Utilities/Services/Interface/IMetamodelService.js +0 -1
- package/src/Utilities/Services/MetamodelService.d.ts +0 -17
- package/src/Utilities/Services/MetamodelService.js +0 -162
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +0 -99
- package/src/View/Components/Buttons/EntityListActionButtons.d.ts +0 -38
- package/src/View/Components/Buttons/EntityListActionButtons.js +0 -42
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.d.ts +0 -12
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +0 -67
- package/src/View/Components/EntityRowItem.d.ts +0 -7
- package/src/View/Components/EntityRowItem.js +0 -7
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +0 -3
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +0 -5
- package/src/View/Components/ModuleProfile.d.ts +0 -8
- package/src/View/Components/ModuleProfile.js +0 -10
- package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +0 -23
- package/src/View/Components/ModuleSummary/ModuleDetail.js +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.d.ts +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.js +0 -15
- package/src/View/Components/ModuleSummary/SummaryRowItem.d.ts +0 -7
- package/src/View/Components/ModuleSummary/SummaryRowItem.js +0 -12
- package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +0 -9
- package/src/View/Components/SharedProps/ModuleSummaryProps.js +0 -1
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.d.ts +0 -13
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.js +0 -1
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.d.ts +0 -14
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.js +0 -1
- package/src/View/Components/StyleVisualItem.d.ts +0 -9
- package/src/View/Components/StyleVisualItem.js +0 -40
- package/src/View/Components/WizardSummaryPage.d.ts +0 -7
- package/src/View/Components/WizardSummaryPage.js +0 -17
- package/src/components/Accordion.d.ts +0 -7
- package/src/components/Accordion.js +0 -33
- package/src/components/FlexWithFooter.d.ts +0 -9
- package/src/components/FlexWithFooter.js +0 -13
- package/src/components/NotifyResize/index.d.ts +0 -9
- package/src/components/NotifyResize/index.js +0 -35
- package/src/components/PopupWithFooter.d.ts +0 -14
- package/src/components/PopupWithFooter.js +0 -11
- package/src/components/SelectableList/index.d.ts +0 -15
- package/src/components/SelectableList/index.js +0 -95
- package/src/components/SizedContainer/index.d.ts +0 -17
- package/src/components/SizedContainer/index.js +0 -20
- package/src/components/Table/index.d.ts +0 -4
- package/src/components/Table/index.js +0 -6
- package/src/components/WizardPanel/index.d.ts +0 -9
- package/src/components/WizardPanel/index.js +0 -7
- package/src/components/icons/align-justify.d.ts +0 -3
- package/src/components/icons/align-justify.js +0 -3
- package/src/components/icons/column-info.d.ts +0 -3
- package/src/components/icons/column-info.js +0 -3
- package/src/components/icons/gradient-column.d.ts +0 -3
- package/src/components/icons/gradient-column.js +0 -3
- package/src/components/icons/invalid.d.ts +0 -3
- package/src/components/icons/invalid.js +0 -3
- package/src/components/icons/logout copy.d.ts +0 -3
- package/src/components/icons/logout copy.js +0 -3
- package/src/components/icons/smart-edit.d.ts +0 -3
- package/src/components/icons/smart-edit.js +0 -3
- package/src/components/icons/team-share.d.ts +0 -3
- package/src/components/icons/team-share.js +0 -3
- package/src/components/icons/unchecked.d.ts +0 -3
- package/src/components/icons/unchecked.js +0 -3
- package/src/components/icons/user-filter.d.ts +0 -3
- package/src/components/icons/user-filter.js +0 -3
- package/src/components/utils/useContainerScrollObserver/index.d.ts +0 -6
- package/src/components/utils/useContainerScrollObserver/index.js +0 -79
- package/src/components/utils/useGlobalEvent.d.ts +0 -1
- package/src/components/utils/useGlobalEvent.js +0 -7
- package/src/components/utils/useLatest.d.ts +0 -1
- package/src/components/utils/useLatest.js +0 -6
- package/src/components/utils/usePropState.d.ts +0 -2
- package/src/components/utils/usePropState.js +0 -8
- package/src/metamodel/adaptable-metamodel-model.d.ts +0 -26
- package/src/metamodel/adaptable-metamodel-model.js +0 -1
- package/src/metamodel/adaptable.metamodel.d.ts +0 -6244
- package/src/metamodel/adaptable.metamodel.js +0 -1
|
@@ -15,7 +15,6 @@ import { Calendar } from '../ui/calendar';
|
|
|
15
15
|
import { InputGroup, InputGroupAddon } from '../ui/input-group';
|
|
16
16
|
import { SingleSelect } from '../NewSelect';
|
|
17
17
|
import { targetOwn } from '../twUtils';
|
|
18
|
-
// ── Caption dropdown components (month/year) ──────────────────────────
|
|
19
18
|
const onCaptionKeyDown = (e) => {
|
|
20
19
|
if (e.key === 'Escape' || e.key === 'Enter') {
|
|
21
20
|
e.stopPropagation();
|
|
@@ -36,15 +35,10 @@ const captionComponents = {
|
|
|
36
35
|
YearsDropdown: DatepickerYearsDropdown,
|
|
37
36
|
MonthsDropdown: DatepickerMonthsDropdown,
|
|
38
37
|
};
|
|
39
|
-
// ── Main component ────────────────────────────────────────────────────
|
|
40
38
|
const END_MONTH = endOfYear(addYears(new Date(), 10));
|
|
41
39
|
const START_MONTH = startOfYear(addYears(new Date(), -50));
|
|
42
40
|
export const Datepicker = React.forwardRef((props, ref) => {
|
|
43
|
-
const { dateProps, disabled, style, className, placeholder, showWeekNumber, showOutsideDays, datepickerButtons, showClearButton, autoFocus,
|
|
44
|
-
// openOnFocus,
|
|
45
|
-
onHide, value: _value, defaultValue: _defaultValue, onChange: _onChange,
|
|
46
|
-
// ...boxProps
|
|
47
|
-
} = props;
|
|
41
|
+
const { dateProps, disabled, style, className, placeholder, showWeekNumber, showOutsideDays, datepickerButtons, showClearButton, autoFocus, onHide, value: _value, defaultValue: _defaultValue, onChange: _onChange, } = props;
|
|
48
42
|
void _value;
|
|
49
43
|
void _defaultValue;
|
|
50
44
|
void _onChange;
|
|
@@ -63,14 +57,11 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
63
57
|
setMonth(next ?? new Date());
|
|
64
58
|
};
|
|
65
59
|
const inputValue = DateFormatter(value, { Pattern: dateProps.format }) ?? '';
|
|
66
|
-
// ── DOM refs for focus ownership ────────────────────────────────
|
|
67
60
|
const triggerRef = React.useRef(null);
|
|
68
61
|
const popupRef = React.useRef(null);
|
|
69
62
|
const isInsideDatepicker = React.useCallback((node) => {
|
|
70
63
|
if (!node)
|
|
71
64
|
return false;
|
|
72
|
-
// Focus often lands on `body` briefly when a focused control unmounts (month nav).
|
|
73
|
-
// Treat as "still in session" so we don't close before focus settles.
|
|
74
65
|
if (node === document.body || node === document.documentElement) {
|
|
75
66
|
return true;
|
|
76
67
|
}
|
|
@@ -84,8 +75,6 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
84
75
|
if (root === node || root.contains(node)) {
|
|
85
76
|
return true;
|
|
86
77
|
}
|
|
87
|
-
// `popupRef` is on an inner div; Base UI may focus `PopoverPrimitive.Popup` / Positioner
|
|
88
|
-
// (ancestors of `root`). Those must still count as inside the datepicker.
|
|
89
78
|
if (node instanceof Element && root instanceof Element) {
|
|
90
79
|
let p = root.parentElement;
|
|
91
80
|
while (p) {
|
|
@@ -97,7 +86,6 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
97
86
|
}
|
|
98
87
|
return false;
|
|
99
88
|
}, []);
|
|
100
|
-
// ── Open / close ──────────────────────────────────────────────────
|
|
101
89
|
const [open, setOpen] = useState(false);
|
|
102
90
|
const closedAtRef = React.useRef(0);
|
|
103
91
|
const tabFromOverlayRef = React.useRef(false);
|
|
@@ -114,9 +102,6 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
114
102
|
onHide?.();
|
|
115
103
|
}
|
|
116
104
|
}, [datepickerContext, onHide]);
|
|
117
|
-
// Only honour explicit, unambiguous close reasons.
|
|
118
|
-
// focus-out / trigger-press are ignored — the document-level
|
|
119
|
-
// focusin listener below handles blur-to-close reliably.
|
|
120
105
|
const handleOpenChange = React.useCallback((next, eventDetails) => {
|
|
121
106
|
if (next) {
|
|
122
107
|
setPopoverOpen(true);
|
|
@@ -132,14 +117,11 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
132
117
|
return;
|
|
133
118
|
}
|
|
134
119
|
}, [setPopoverOpen]);
|
|
135
|
-
// Close when focus moves to something truly outside the datepicker (e.g. Tab away).
|
|
136
120
|
useEffect(() => {
|
|
137
121
|
if (!open)
|
|
138
122
|
return;
|
|
139
123
|
const onFocusIn = (e) => {
|
|
140
124
|
const target = e.target;
|
|
141
|
-
// When Tab was pressed inside the overlay and focus landed outside the
|
|
142
|
-
// popup (even on the trigger), close so the user can Tab away freely.
|
|
143
125
|
if (tabFromOverlayRef.current) {
|
|
144
126
|
const popup = popupRef.current;
|
|
145
127
|
if (popup && target && !popup.contains(target) && popup !== target) {
|
|
@@ -156,8 +138,6 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
156
138
|
document.addEventListener('focusin', onFocusIn);
|
|
157
139
|
return () => document.removeEventListener('focusin', onFocusIn);
|
|
158
140
|
}, [open, isInsideDatepicker, setPopoverOpen]);
|
|
159
|
-
// Move focus into the overlay when it opens (portal + positioner need a frame to settle).
|
|
160
|
-
// Skip when autoFocus is set — the Calendar will focus a day cell itself.
|
|
161
141
|
useLayoutEffect(() => {
|
|
162
142
|
if (!open || disabled || autoFocus) {
|
|
163
143
|
return;
|
|
@@ -167,7 +147,6 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
167
147
|
});
|
|
168
148
|
return () => cancelAnimationFrame(id);
|
|
169
149
|
}, [open, disabled, autoFocus]);
|
|
170
|
-
// ── Footer buttons ────────────────────────────────────────────────
|
|
171
150
|
const clearValue = () => updateValue(undefined);
|
|
172
151
|
const renderButton = (label, onClick) => (_jsx(SimpleButton, { onClick: onClick, className: "twa:m-[2px]", children: label }));
|
|
173
152
|
const todayDate = new Date();
|
|
@@ -183,68 +162,23 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
183
162
|
'|': _jsx("hr", { style: { width: '100%', height: 0, margin: 0, border: 'none' } }),
|
|
184
163
|
};
|
|
185
164
|
const footerButtons = datepickerButtons.map((buttonKey, index) => React.cloneElement(footerButtonsMap[buttonKey], { key: index }));
|
|
186
|
-
// ── Inline buttons (clear / calendar icon) ────────────────────────
|
|
187
165
|
const clearButton = showClearButton !== false ? (_jsx(SimpleButton, { "data-name": "clear", variant: "text", tooltip: "Clear", iconSize: 20, className: "twa:p-0", icon: "close", onMouseDown: (e) => {
|
|
188
166
|
e.preventDefault();
|
|
189
|
-
// e.stopPropagation();
|
|
190
167
|
clearValue();
|
|
191
168
|
console.log('onMouseDown', e);
|
|
192
169
|
}, onClick: (e) => {
|
|
193
170
|
console.log('onClick', e);
|
|
194
171
|
e.stopPropagation();
|
|
195
|
-
// also clear on click, as the user may have "clicked" using enter
|
|
196
172
|
clearValue();
|
|
197
|
-
// and focus the input
|
|
198
173
|
triggerRef.current?.firstChild?.focus();
|
|
199
174
|
}, accessLevel: ACCESS_LEVEL_FULL })) : null;
|
|
200
175
|
const calendarButton = (_jsx(SimpleButton, { disabled: disabled, variant: "text", icon: "calendar", tooltip: "Date", iconSize: 20, className: "twa:p-0", type: "button" }));
|
|
201
|
-
// ── Select-portal container (so month/year lists stay inside the popover) ──
|
|
202
176
|
const [selectPortalRoot, setSelectPortalRoot] = React.useState(null);
|
|
203
|
-
// Stable callback ref — avoids cleanup/re-call cycle that briefly nullifies popupRef.
|
|
204
177
|
const popupRefCallback = React.useCallback((el) => {
|
|
205
178
|
popupRef.current = el;
|
|
206
179
|
setSelectPortalRoot(el);
|
|
207
180
|
}, []);
|
|
208
|
-
|
|
209
|
-
return (_jsxs(Popover, { open: open, onOpenChange: handleOpenChange, children: [_jsx(PopoverTrigger, { nativeButton: false, render:
|
|
210
|
-
// <Flex
|
|
211
|
-
// {...boxProps}
|
|
212
|
-
// ref={triggerRef as React.Ref<HTMLDivElement>}
|
|
213
|
-
// flexDirection="row"
|
|
214
|
-
// alignItems="center"
|
|
215
|
-
// style={{
|
|
216
|
-
// borderRadius: style?.borderRadius,
|
|
217
|
-
// width: style?.width,
|
|
218
|
-
// maxWidth: style?.maxWidth,
|
|
219
|
-
// border: style?.border,
|
|
220
|
-
// }}
|
|
221
|
-
// className={cn(
|
|
222
|
-
// 'ab-Datepicker twa:focus-visible:outline-none twa:rounded-standard',
|
|
223
|
-
// // targetOwn.focusWithinOutline,
|
|
224
|
-
// // targetChildren.focusWithinOutline,
|
|
225
|
-
// className
|
|
226
|
-
// )}
|
|
227
|
-
// // onMouseDown={() => {
|
|
228
|
-
// // closedByTabOutRef.current = false;
|
|
229
|
-
// // }}
|
|
230
|
-
// // onFocusCapture={() => {
|
|
231
|
-
// // if (closedByTabOutRef.current) {
|
|
232
|
-
// // return;
|
|
233
|
-
// // }
|
|
234
|
-
// // if (!open && Date.now() - closedAtRef.current > 200) {
|
|
235
|
-
// // setPopoverOpen(true);
|
|
236
|
-
// // }
|
|
237
|
-
// // }}
|
|
238
|
-
// // onBlurCapture={(e: React.FocusEvent) => {
|
|
239
|
-
// // if (closedByTabOutRef.current) {
|
|
240
|
-
// // const related = e.relatedTarget as Node | null;
|
|
241
|
-
// // if (!triggerRef.current?.contains(related)) {
|
|
242
|
-
// // closedByTabOutRef.current = false;
|
|
243
|
-
// // }
|
|
244
|
-
// // }
|
|
245
|
-
// // }}
|
|
246
|
-
// />
|
|
247
|
-
_jsxs(InputGroup, { ref: triggerRef, style: {
|
|
181
|
+
return (_jsxs(Popover, { open: open, onOpenChange: handleOpenChange, children: [_jsx(PopoverTrigger, { nativeButton: false, render: _jsxs(InputGroup, { ref: triggerRef, style: {
|
|
248
182
|
borderRadius: style?.borderRadius,
|
|
249
183
|
width: style?.width,
|
|
250
184
|
maxWidth: style?.maxWidth,
|
|
@@ -255,34 +189,5 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
255
189
|
updateValue(date);
|
|
256
190
|
}
|
|
257
191
|
}, className: "twa:h-auto twa:min-w-0 twa:outline-none twa:min-h-auto twa:py-0 twa:flex-1 twa:rounded-none twa:border-0 twa:bg-transparent twa:shadow-none twa:ring-0 twa:focus-visible:ring-0 twa:dark:bg-transparent", style: style, disabled: disabled }), _jsxs(InputGroupAddon, { align: "inline-end", children: [inputValue ? clearButton : null, calendarButton] })] }) }), _jsx(PopoverContent, { className: "twa:w-auto twa:p-0", align: "start", sideOffset: 8, children: _jsx("div", { ref: popupRefCallback, tabIndex: -1, role: "region", "aria-label": "Calendar", className: cn('twa:relative twa:isolate twa:overflow-visible twa:outline-none twa:rounded-standard', targetOwn.focusWithinOutline), onKeyDown: () => {
|
|
258
|
-
// console.log('onKeyDown', e.key);
|
|
259
|
-
// return;
|
|
260
|
-
// if (e.key === 'Tab') {
|
|
261
|
-
// tabFromOverlayRef.current = true;
|
|
262
|
-
// requestAnimationFrame(() => {
|
|
263
|
-
// tabFromOverlayRef.current = false;
|
|
264
|
-
// });
|
|
265
|
-
// }
|
|
266
|
-
// if (
|
|
267
|
-
// (e.key === 'Enter' || e.key === ' ') &&
|
|
268
|
-
// e.target instanceof HTMLElement &&
|
|
269
|
-
// e.target.tagName === 'BUTTON' &&
|
|
270
|
-
// e.target.closest('nav')
|
|
271
|
-
// ) {
|
|
272
|
-
// const nav = e.target.closest('nav')!;
|
|
273
|
-
// const buttons = nav.querySelectorAll('button');
|
|
274
|
-
// const btnIndex = Array.from(buttons).indexOf(e.target as HTMLButtonElement);
|
|
275
|
-
// if (btnIndex >= 0) {
|
|
276
|
-
// requestAnimationFrame(() => {
|
|
277
|
-
// requestAnimationFrame(() => {
|
|
278
|
-
// const popup = popupRef.current;
|
|
279
|
-
// if (!popup) return;
|
|
280
|
-
// const newNav = popup.querySelector('nav');
|
|
281
|
-
// const newBtn = newNav?.querySelectorAll('button')[btnIndex];
|
|
282
|
-
// (newBtn as HTMLElement | undefined)?.focus({ preventScroll: true });
|
|
283
|
-
// });
|
|
284
|
-
// });
|
|
285
|
-
// }
|
|
286
|
-
// }
|
|
287
192
|
}, children: _jsx(DatepickerSelectPortalContext.Provider, { value: selectPortalRoot, children: _jsx(Calendar, { fixedWeeks: true, autoFocus: !!autoFocus, showWeekNumber: showWeekNumber, showOutsideDays: showOutsideDays, mode: "single", captionLayout: "dropdown", month: month && !isNaN(month.getTime()) ? month : new Date(), selected: value, onMonthChange: setMonth, onSelect: updateValue, startMonth: START_MONTH, endMonth: END_MONTH, locale: dateProps.locale, components: captionComponents, footer: _jsx(Flex, { justifyContent: "space-between", className: "twa:mt-2", flexWrap: 'wrap', children: footerButtons }) }) }) }) })] }));
|
|
288
193
|
});
|
|
@@ -62,9 +62,7 @@ export function ToolbarList({ toolbars, tabIndex, tabs, onTabsChange, onRemove,
|
|
|
62
62
|
});
|
|
63
63
|
return sources;
|
|
64
64
|
}, [dragScope, unusedListIds, tabIndex, tabs]);
|
|
65
|
-
return (_jsx(DragList, { dragListId: scopedListId, orientation: orientation, acceptDropsFrom: [...acceptDropsFrom, scopedListId], onDragProxyMove: defaultDragProxyMove,
|
|
66
|
-
// this is called when reordering inside the same list
|
|
67
|
-
onDrop: (sortedIndexes) => {
|
|
65
|
+
return (_jsx(DragList, { dragListId: scopedListId, orientation: orientation, acceptDropsFrom: [...acceptDropsFrom, scopedListId], onDragProxyMove: defaultDragProxyMove, onDrop: (sortedIndexes) => {
|
|
68
66
|
const newItems = sortedIndexes.map((i) => toolbars[i]);
|
|
69
67
|
onTabsChange(tabs.map((t, i) => (i === tabIndex ? { ...t, Items: newItems } : t)));
|
|
70
68
|
}, shouldAcceptDrop: ({ dragItem, dragSourceListId }) => {
|
|
@@ -74,9 +72,7 @@ export function ToolbarList({ toolbars, tabIndex, tabs, onTabsChange, onRemove,
|
|
|
74
72
|
return true;
|
|
75
73
|
}
|
|
76
74
|
return !toolbars.includes(toolbarId);
|
|
77
|
-
},
|
|
78
|
-
// this is called when dropping an item from a different list
|
|
79
|
-
onAcceptDrop: ({ dragItemId, dropIndex }) => {
|
|
75
|
+
}, onAcceptDrop: ({ dragItemId, dropIndex }) => {
|
|
80
76
|
const toolbarId = unscopeDragId(dragItemId);
|
|
81
77
|
onTabsChange(tabs.map((tab, i) => {
|
|
82
78
|
if (i !== tabIndex || tab.Items.includes(toolbarId)) {
|
|
@@ -6,24 +6,17 @@ export const Drawer = (props) => {
|
|
|
6
6
|
});
|
|
7
7
|
const [show, setShow] = React.useState(props.open);
|
|
8
8
|
React.useEffect(() => {
|
|
9
|
-
// CLOSED -> OPEN
|
|
10
|
-
// SHOW Element, with closed class
|
|
11
|
-
// CHANGE class to opened
|
|
12
9
|
if (!isOpen && props.open) {
|
|
13
10
|
setShow(true);
|
|
14
11
|
requestAnimationFrame(() => {
|
|
15
12
|
setIsOpen(true);
|
|
16
13
|
});
|
|
17
14
|
}
|
|
18
|
-
// OPEN -> CLOSED
|
|
19
|
-
// CHANGE class to closed
|
|
20
|
-
// HIDE Element, when animation is finsihed
|
|
21
15
|
if (isOpen && !props.open) {
|
|
22
16
|
setIsOpen(false);
|
|
23
17
|
}
|
|
24
18
|
}, [props.open]);
|
|
25
19
|
const handleOnKeyDown = React.useCallback((event) => {
|
|
26
|
-
// escape
|
|
27
20
|
if (event.key === 'Escape') {
|
|
28
21
|
props.onOpenChange?.(false);
|
|
29
22
|
}
|
|
@@ -76,7 +76,6 @@ const Dropdown = (props) => {
|
|
|
76
76
|
if (!selectedOption) {
|
|
77
77
|
selectedText = placeholder;
|
|
78
78
|
}
|
|
79
|
-
//20 ... 20 16
|
|
80
79
|
const renderClearButton = () => (_jsx(SimpleButton, { variant: "text", icon: "close", tone: "none", tooltip: "Clear", iconSize: 20, ...clearButtonProps, className: twMerge('twa:p-0 twa:mr-1 twa:z-10 twa:color-inherit', clearButtonProps?.className), style: {
|
|
81
80
|
...(clearButtonProps ? clearButtonProps.style : null),
|
|
82
81
|
}, onClick: (e) => {
|
|
@@ -17,7 +17,6 @@ export const NewDropdownButton = React.forwardRef((props, ref) => {
|
|
|
17
17
|
? item.tooltip.length
|
|
18
18
|
: 0), 0);
|
|
19
19
|
return (_jsxs(DropdownMenu, { children: [tooltip ? _jsx(NewTooltip, { label: tooltip, children: trigger }) : trigger, _jsx(DropdownMenuContent, { side: side, align: align, style: {
|
|
20
|
-
// minWidth: `min(max(${maxLabelLength + 5}ch, calc(var(--ab-base-space) * 32)),80vw)`,
|
|
21
20
|
width: `max(${maxLabelLength + (props.extraWidthChars ?? 3)}ch, calc(var(--ab-base-space) * 20), var(--anchor-width))`,
|
|
22
21
|
}, children: items.map((item, index) => {
|
|
23
22
|
if (item.separator) {
|
|
@@ -67,7 +67,6 @@ const FunctionsDropdown = ({ expressionFunctions, baseClassName }) => {
|
|
|
67
67
|
const groupedFunctions = React.useMemo(() => {
|
|
68
68
|
return Object.keys(expressionFunctions).reduce((acc, key) => {
|
|
69
69
|
const functionDef = expressionFunctions[key];
|
|
70
|
-
// filter
|
|
71
70
|
if (currentFunctionCategory !== 'all' && functionDef.category !== currentFunctionCategory) {
|
|
72
71
|
return acc;
|
|
73
72
|
}
|
|
@@ -111,11 +110,6 @@ const FunctionsDropdown = ({ expressionFunctions, baseClassName }) => {
|
|
|
111
110
|
setOverFunction(null);
|
|
112
111
|
};
|
|
113
112
|
const [searchInputValue, setSearchInputValue] = React.useState('');
|
|
114
|
-
/**
|
|
115
|
-
* Hide when:
|
|
116
|
-
* - mouse leaves
|
|
117
|
-
* - a function is inserted
|
|
118
|
-
*/
|
|
119
113
|
return (_jsx(OverlayTrigger, { ref: dropdownRef, showEvent: "mouseenter", hideEvent: "mouseleave", targetOffset: 5, render: () => (_jsxs(Flex, { className: `${baseClassName}__dropdown-functions-list-wrapper twa:max-w-[60vw] twa:shadow-md twa:bg-background twa:text-foreground twa:text-3 twa:rounded-standard twa:p-3`, flexDirection: "column", onMouseLeave: () => hidePopup(), children: [_jsx(Flex, { className: "twa:md:gap-3 twa:gap-2 twa:pb-2 twa:md:justify-between twa:justify-start twa:flex-wrap twa:border-b twa:border-primarydark/30 twa:mb-2", children: categoryOptions.map((option, index) => {
|
|
120
114
|
return (_jsx(Radio, { onFocus: (event) => {
|
|
121
115
|
event.preventDefault();
|
|
@@ -129,7 +123,6 @@ const FunctionsDropdown = ({ expressionFunctions, baseClassName }) => {
|
|
|
129
123
|
return _jsx(React.Fragment, {}, groupName);
|
|
130
124
|
}
|
|
131
125
|
const getEditorButtonData = (functionName) => {
|
|
132
|
-
// handle special cases
|
|
133
126
|
if (functionName === 'CASE') {
|
|
134
127
|
return `CASE <caseValue> WHEN <whenValue> THEN <thenValue> ELSE <defaultValue> END`;
|
|
135
128
|
}
|
|
@@ -176,24 +169,20 @@ export function BaseEditorInput(props) {
|
|
|
176
169
|
if (!firstRowNode || !firstRowNode.data) {
|
|
177
170
|
return {};
|
|
178
171
|
}
|
|
179
|
-
// clone the class instance to still keep the prototype methods
|
|
180
172
|
return Object.assign(Object.create(Object.getPrototypeOf(firstRowNode)), firstRowNode);
|
|
181
173
|
}, []);
|
|
182
174
|
const scopeColumnId = useMemo(() => {
|
|
183
175
|
return props.api.columnScopeApi.getAnyColumnIdForScope(props.columnScope);
|
|
184
176
|
}, [props.columnScope]);
|
|
185
177
|
try {
|
|
186
|
-
// explicitly parsing & evaluating the expression because we need full control of the resulted AST
|
|
187
178
|
const expr = parser.parse(props.value || '');
|
|
188
179
|
try {
|
|
189
180
|
testRowNode.data = testData;
|
|
190
|
-
// Mock datachangedevent for change-based functions e.g. PERCENT_CHANGE
|
|
191
181
|
const dataChangedEvent = {
|
|
192
182
|
newValue: 100,
|
|
193
183
|
oldValue: 150,
|
|
194
184
|
};
|
|
195
185
|
result = expr.evaluate({
|
|
196
|
-
// we need a fully-fledged rowNode as Adaptable accesses internal methods of it
|
|
197
186
|
node: testRowNode,
|
|
198
187
|
functions: expressionFunctions,
|
|
199
188
|
evaluateCustomQueryVariable: props.api.internalApi.getQueryLanguageService().evaluateCustomQueryVariable,
|
|
@@ -207,7 +196,6 @@ export function BaseEditorInput(props) {
|
|
|
207
196
|
evaluationError = err;
|
|
208
197
|
}
|
|
209
198
|
else {
|
|
210
|
-
// unexpected error, pass it on to the enclosing handler
|
|
211
199
|
throw err;
|
|
212
200
|
}
|
|
213
201
|
}
|
|
@@ -215,7 +203,6 @@ export function BaseEditorInput(props) {
|
|
|
215
203
|
selectedFunctionName = path[0] ? path[0].type : null;
|
|
216
204
|
}
|
|
217
205
|
catch (e) {
|
|
218
|
-
// parse errors should have a hash, otherwise it's an unexpected runtime error
|
|
219
206
|
const isParserException = !!e.hash;
|
|
220
207
|
if (isParserException) {
|
|
221
208
|
expressionError = buildParserExceptionMessage(e);
|
|
@@ -226,7 +213,6 @@ export function BaseEditorInput(props) {
|
|
|
226
213
|
}
|
|
227
214
|
}
|
|
228
215
|
useEffect(() => {
|
|
229
|
-
// update selected function only for focused textareas (where cursor is present)
|
|
230
216
|
if (cursor != undefined) {
|
|
231
217
|
props.onSelectedFunctionChange(selectedFunctionName ? expressionFunctions[selectedFunctionName] : null);
|
|
232
218
|
}
|
|
@@ -235,8 +221,7 @@ export function BaseEditorInput(props) {
|
|
|
235
221
|
.filter((editorButtonDef) => !!expressionFunctions[editorButtonDef.functionName])
|
|
236
222
|
.map((editorButtonDef) => (_jsx(EditorButton, { data: editorButtonDef.data, icon: editorButtonDef.icon, children: !editorButtonDef.icon && (editorButtonDef.text || editorButtonDef.functionName) }, `${editorButtonDef.functionName}-operator`)));
|
|
237
223
|
const showDocumentationLink = props.api.internalApi.isDocumentationLinksDisplayed();
|
|
238
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { "data-name": "expression-toolbar", className: `${baseClassName} twa:py-2 twa:mb-2 twa:mt-2 twa:flex-wrap twa:w-full`, children: [_jsxs(Flex, { className: "twa:flex-1 twa:ml-1 twa:flex-wrap", children: [_jsx(FunctionsDropdown, { expressionFunctions: expressionFunctions, baseClassName: baseClassName }), operatorButtons] }), showDocumentationLink && (_jsx(Flex, { alignItems: "flex-start", children: _jsx(ButtonInfo, { className: "twa:mr-2", tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(ExpressionEditorDocsLink, '_blank') }) }))] }), _jsx(Textarea, { "data-name": `expression-input-${type}`, ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: join('ab-ExpressionEditor__textarea',
|
|
239
|
-
`${baseClassName}__textarea`, 'twa:w-full twa:min-h-[100px] twa:p-2 twa:text-4 twa:resize-y twa:font-mono'), autoFocus: true, spellCheck: "false", onChange: (event) => {
|
|
224
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { "data-name": "expression-toolbar", className: `${baseClassName} twa:py-2 twa:mb-2 twa:mt-2 twa:flex-wrap twa:w-full`, children: [_jsxs(Flex, { className: "twa:flex-1 twa:ml-1 twa:flex-wrap", children: [_jsx(FunctionsDropdown, { expressionFunctions: expressionFunctions, baseClassName: baseClassName }), operatorButtons] }), showDocumentationLink && (_jsx(Flex, { alignItems: "flex-start", children: _jsx(ButtonInfo, { className: "twa:mr-2", tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(ExpressionEditorDocsLink, '_blank') }) }))] }), _jsx(Textarea, { "data-name": `expression-input-${type}`, ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: join('ab-ExpressionEditor__textarea', `${baseClassName}__textarea`, 'twa:w-full twa:min-h-[100px] twa:p-2 twa:text-4 twa:resize-y twa:font-mono'), autoFocus: true, spellCheck: "false", onChange: (event) => {
|
|
240
225
|
props.onChange(event.target.value);
|
|
241
226
|
}, style: style }), props.isFullExpression !== true && (_jsxs(HelpBlock, { className: "twa:my-2 twa:p-2 twa:text-3", children: ["This Expression must resolve to a ", _jsx("b", { children: "boolean " }), "(i.e. true / false) value"] })), expressionError && (_jsx(ErrorBox, { className: "twa:mt-2 twa:whitespace-pre-wrap twa:w-full", children: expressionError })), evaluationError && (_jsx(ErrorBox, { className: "twa:mt-2 twa:whitespace-pre-wrap", children: `${evaluationError.expressionFnName} ${evaluationError.message}` })), !props.hideResultPreview && result !== undefined && (_jsx(Box, { className: `${baseClassName}__editor-feedback twa:mt-2 twa:p-2 twa:rounded-standard`, "data-name": "expression-editor-feedback", children: _jsxs("pre", { className: "twa:whitespace-pre-wrap twa:m-0", children: ["Result (using test data):", ' ', _jsx("b", { className: "twa:bg-accentlight twa:text-accent twa:rounded-full twa:p-1 twa:px-2", children: JSON.stringify(result) })] }) }))] }));
|
|
242
227
|
}
|
|
@@ -8,7 +8,6 @@ function EditorButton(props) {
|
|
|
8
8
|
const { textAreaRef } = useExpressionEditor();
|
|
9
9
|
return (_jsx(SimpleButton, { "data-name": 'operator-or-fn', variant: "text", draggable: true, onDragStart: (event) => {
|
|
10
10
|
if (!dragImage) {
|
|
11
|
-
// we want to lazy init the image since otherwise it fails in SSR environments if it is declared outside the cmp - ReferenceError: Image is not defined
|
|
12
11
|
dragImage = new Image(0, 0);
|
|
13
12
|
dragImage.src = DRAG_IMAGE_SRC;
|
|
14
13
|
}
|
|
@@ -15,15 +15,10 @@ function EditorInput(props) {
|
|
|
15
15
|
let filteredCollection = [];
|
|
16
16
|
if (type === 'aggregatedScalar') {
|
|
17
17
|
const excludeSet = new Set([
|
|
18
|
-
// we cannot have a hardcodede set of functions,
|
|
19
|
-
// we need to allow custom expressions
|
|
20
18
|
...cumulativeAggregatedExpressionFunctions,
|
|
21
19
|
...quantileAggregatedExpressionFunctions,
|
|
22
20
|
]);
|
|
23
|
-
filteredCollection = Object.keys(availableAggregatedExpressionFunctions).filter((key) =>
|
|
24
|
-
// need to allow standard ones
|
|
25
|
-
cumulativeAggregatedExpressionFunctions.includes(key) ||
|
|
26
|
-
// and anything else that is not cumul or quantile
|
|
21
|
+
filteredCollection = Object.keys(availableAggregatedExpressionFunctions).filter((key) => cumulativeAggregatedExpressionFunctions.includes(key) ||
|
|
27
22
|
!excludeSet.has(key));
|
|
28
23
|
}
|
|
29
24
|
else {
|
|
@@ -48,7 +43,6 @@ function EditorInput(props) {
|
|
|
48
43
|
...moduleExpressionFunctions.scalarFunctions,
|
|
49
44
|
};
|
|
50
45
|
if (!props.columnScope) {
|
|
51
|
-
// filter out $SCOPE function if no columnScope is provided
|
|
52
46
|
booleanAndScalarFunctions = Object.keys(booleanAndScalarFunctions)
|
|
53
47
|
.filter((key) => key !== '$SCOPE')
|
|
54
48
|
.reduce((obj, key) => {
|
|
@@ -48,7 +48,6 @@ function EditorInputWithWhereClause(props) {
|
|
|
48
48
|
return (_jsxs(Flex, { flexDirection: "column", alignItems: "flex-start", children: [_jsx(BaseEditorInput, { type: 'main', value: reactiveValue || '', placeholder: `Create ${queryName}`, onChange: updateReactiveValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: reactiveExpressionFns, editorButtons: props.type === 'observable' ? editorButtonsObservable : editorButtonsAggregatedBoolean, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }), _jsxs(Box, { className: "twa:text-2 twa:mt-2 twa:pl-3", children: ["Add a ", _jsx("i", { children: "WHERE" }), " Clause to narrow the scope of the Query"] }), _jsx(CheckBox, { disabled: IsNullOrEmptyOrWhiteSpace(reactiveValue), checked: showWhereClause, onChange: (checked) => {
|
|
49
49
|
setShowWhereClause(checked);
|
|
50
50
|
if (!checked) {
|
|
51
|
-
// reset whereClause value if textarea is hidden
|
|
52
51
|
updateWhereClauseValue(null);
|
|
53
52
|
}
|
|
54
53
|
}, className: "twa:pl-3 twa:items-center", children: "WHERE" }), showWhereClause && (_jsx(BaseEditorInput, { type: 'secondary', disabled: IsNullOrEmptyOrWhiteSpace(reactiveValue), value: whereClauseValue || '', placeholder: `Create BooleanQuery which narrows down the scope of the ${queryName}`, onChange: updateWhereClauseValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: whereClauseExpressionsFns, editorButtons: editorButtonsSearch, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }))] }));
|
|
@@ -8,19 +8,9 @@ export const ExpressionPreview = (props) => {
|
|
|
8
8
|
return _jsx(_Fragment, { children: adaptableApi.expressionApi.getAdaptableQueryExpression(props.query) });
|
|
9
9
|
}
|
|
10
10
|
const expressionWithFriendlyNames = adaptableApi.expressionApi.getAdaptableQueryExpressionWithColumnFriendlyNames(props.query);
|
|
11
|
-
// '[Column Name] > 2' => ['[Column Name]', '>', '2']
|
|
12
|
-
// not the prettiest
|
|
13
11
|
const strWithMarkedGroupes = expressionWithFriendlyNames.replace(/\]/gi, '],').split(',');
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* The div allows the text to flow normally.
|
|
20
|
-
*/
|
|
21
|
-
(_jsx("div", { children: strWithMarkedGroupes.map((part, index) => {
|
|
22
|
-
const partEl = part.includes('[') ? _jsx("i", { children: part.replace(/[\[\]]/g, '') }) : part;
|
|
23
|
-
return _jsx(React.Fragment, { children: partEl }, index);
|
|
24
|
-
}) }))
|
|
25
|
-
);
|
|
12
|
+
return (_jsx("div", { children: strWithMarkedGroupes.map((part, index) => {
|
|
13
|
+
const partEl = part.includes('[') ? _jsx("i", { children: part.replace(/[\[\]]/g, '') }) : part;
|
|
14
|
+
return _jsx(React.Fragment, { children: partEl }, index);
|
|
15
|
+
}) }));
|
|
26
16
|
};
|
|
@@ -2,7 +2,6 @@ import { createContext, useContext } from 'react';
|
|
|
2
2
|
export const NamedQueryContext = createContext({
|
|
3
3
|
namedQuery: false,
|
|
4
4
|
setNamedQuery: () => { },
|
|
5
|
-
// hasValidNamedQueryName: () => false,
|
|
6
5
|
});
|
|
7
6
|
export const useNamedQueryContext = () => {
|
|
8
7
|
return useContext(NamedQueryContext);
|
|
@@ -18,10 +18,7 @@ import { SingleSelect } from '../../NewSelect';
|
|
|
18
18
|
export const PrimitiveColumnOrFieldSelector = (props) => {
|
|
19
19
|
const adaptable = useAdaptable();
|
|
20
20
|
const [type, setType] = React.useState(() => {
|
|
21
|
-
return (
|
|
22
|
-
// default to column
|
|
23
|
-
(!props.fieldOrColumn || props.fieldOrColumn.includes('[') ? 'column' : 'field')
|
|
24
|
-
);
|
|
21
|
+
return (!props.fieldOrColumn || props.fieldOrColumn.includes('[') ? 'column' : 'field');
|
|
25
22
|
});
|
|
26
23
|
const hasFields = React.useMemo(() => {
|
|
27
24
|
return adaptable.api.expressionApi.internalApi.getAvailableFields()?.length > 0;
|
|
@@ -73,7 +70,6 @@ export const PrimitiveValueInput = (props) => {
|
|
|
73
70
|
});
|
|
74
71
|
const handleTypeChange = (newType) => {
|
|
75
72
|
if (type !== newType) {
|
|
76
|
-
// need to reset value
|
|
77
73
|
props.onChange(undefined);
|
|
78
74
|
setType(newType);
|
|
79
75
|
}
|
|
@@ -100,7 +96,6 @@ export const PrimitiveValueInput = (props) => {
|
|
|
100
96
|
props.onChange(event.target.value);
|
|
101
97
|
} }));
|
|
102
98
|
case 'date':
|
|
103
|
-
// date format = 'DATE(2020-01-01)'
|
|
104
99
|
const dateStr = typeof props.value === 'string' ? props.value.replace('DATE(', '').replace(')', '') : '';
|
|
105
100
|
return (_jsx(AdaptableInput, { ...common, type: "date", value: dateStr ?? '', onChange: (event) => {
|
|
106
101
|
const stringified = `DATE("${event.target.value}")`;
|
|
@@ -53,7 +53,6 @@ const LogicalFunctionEditor = (props) => {
|
|
|
53
53
|
if (typeof arg === 'object' &&
|
|
54
54
|
'operator' in arg &&
|
|
55
55
|
isQlLogicalOperator(arg.operator)) {
|
|
56
|
-
// add as a child
|
|
57
56
|
const newArg = {
|
|
58
57
|
...arg,
|
|
59
58
|
args: [...arg.args, newPredicate],
|
|
@@ -66,7 +65,6 @@ const LogicalFunctionEditor = (props) => {
|
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
else {
|
|
69
|
-
// add as a sibling
|
|
70
68
|
const prevArgs = [...props.predicate.args];
|
|
71
69
|
prevArgs.splice(index + 1, 0, newPredicate);
|
|
72
70
|
props.onChange({
|
|
@@ -171,16 +169,6 @@ const PrimitiveFunctionEditor = (props) => {
|
|
|
171
169
|
}) })] }), _jsx(Box, { className: "twa:flex-1" }), _jsx(QueryPredicateButtons, { ...props })] }));
|
|
172
170
|
} }));
|
|
173
171
|
};
|
|
174
|
-
/**
|
|
175
|
-
* Two types:
|
|
176
|
-
* - combinatory operator
|
|
177
|
-
* - can contain both expressons and combinators
|
|
178
|
-
* [handle] [combinator-dropdown]
|
|
179
|
-
* [children]
|
|
180
|
-
*
|
|
181
|
-
* - boolean function: ars do not contain other combinators
|
|
182
|
-
* [handle] [column] [operator-dropdown] [...args] [delete-button] [plus-button]
|
|
183
|
-
*/
|
|
184
172
|
export const QueryPredicateBuilder = (props) => {
|
|
185
173
|
if (isQlLogicalOperator(props.predicate.operator)) {
|
|
186
174
|
return _jsx(LogicalFunctionEditor, { ...props });
|
|
@@ -5,11 +5,8 @@ import { deepClone } from '../../../Utilities/Extensions/ObjectExtensions';
|
|
|
5
5
|
import { booleanExpressionsAvailableInQueryBuilder } from './booleanExpressions';
|
|
6
6
|
export const reorder = (predicate, from, to) => {
|
|
7
7
|
const predicateCopy = deepClone(predicate);
|
|
8
|
-
// we start from the root so no need to traverse first level
|
|
9
8
|
const [_, ...fromPath] = from.split('/');
|
|
10
9
|
const [__, ...toPath] = to.split('/');
|
|
11
|
-
// remove from old position and get the item
|
|
12
|
-
// path = '0/1/2'
|
|
13
10
|
let itemToMove = predicateCopy;
|
|
14
11
|
let prev = null;
|
|
15
12
|
for (const index of fromPath) {
|
|
@@ -17,7 +14,6 @@ export const reorder = (predicate, from, to) => {
|
|
|
17
14
|
itemToMove = itemToMove.args[parseInt(index)];
|
|
18
15
|
}
|
|
19
16
|
prev.args.splice(parseInt(fromPath[fromPath.length - 1]), 1);
|
|
20
|
-
// find the parent into wich we want to insert the item
|
|
21
17
|
let cursor = predicateCopy;
|
|
22
18
|
let parent = null;
|
|
23
19
|
for (const index of toPath) {
|
|
@@ -31,22 +31,15 @@ export function ExpressionEditor(props) {
|
|
|
31
31
|
const editorInput = type === 'observable' || type === 'aggregatedBoolean' ? (_jsx(EditorInputWithWhereClause, { type: type, module: module, value: props.value, onChange: (value) => {
|
|
32
32
|
setExpressionText(value);
|
|
33
33
|
props.onChange(value);
|
|
34
|
-
}, testData: props.initialData, api: props.api })) : (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{ type: type, module: module, columnScope: props.columnScope, value: props.value, onChange: (value) => {
|
|
39
|
-
setExpressionText(value);
|
|
40
|
-
props.onChange(value);
|
|
41
|
-
}, testData: props.initialData, isFullExpression: props.isFullExpression, api: props.api }
|
|
42
|
-
)));
|
|
34
|
+
}, testData: props.initialData, api: props.api })) : (_jsx(EditorInput, { type: type, module: module, columnScope: props.columnScope, value: props.value, onChange: (value) => {
|
|
35
|
+
setExpressionText(value);
|
|
36
|
+
props.onChange(value);
|
|
37
|
+
}, testData: props.initialData, isFullExpression: props.isFullExpression, api: props.api }));
|
|
43
38
|
const adaptableFields = props.api.expressionApi.internalApi.getAvailableFields();
|
|
44
|
-
// currently only boolean and scalar expressions support nested calculated columns (calc cols which reference other calc cols)
|
|
45
39
|
const queryableColumns = type === 'scalar' || type === 'boolean' || type === 'aggregatedScalar'
|
|
46
40
|
? props.columns
|
|
47
41
|
: props.columns.filter((c) => !c.isCalculatedColumn);
|
|
48
42
|
const showDocumentationLinks = props.api.internalApi.isDocumentationLinksDisplayed();
|
|
49
|
-
// @Bogdan i did this to be sure but i think we can get rid of this as the button does the same (and better IMO)
|
|
50
43
|
const showNamedQueryStuff = false;
|
|
51
44
|
const queryDocumentationLink = queryDocumentationLinks[type];
|
|
52
45
|
const saveAsNamedQueryElement = allowSaveNamedQuery &&
|
|
@@ -74,9 +67,7 @@ export function ExpressionEditor(props) {
|
|
|
74
67
|
if (event.target.tagName === 'TEXTAREA') {
|
|
75
68
|
textAreaRef.current = event.target;
|
|
76
69
|
}
|
|
77
|
-
}, children: _jsxs(Flex, { className: "twa:flex-1 twa:text-2", flexDirection: "row", "data-name": "expression-editor", style: { minHeight: 0 }, children: [_jsxs(Flex, { className: "twa:flex-1 twa:pr-2 twa:overflow-auto twa:min-h-0", "data-name": "expression-builder", flexDirection: "column", children: [editorInput, StringExtensions.IsNotNullOrEmpty(expressionText?.trim()) && (_jsx(ExpressionFunctionDocumentation, { expressionFunction: selectedFunction })),
|
|
78
|
-
/* displayed for advanced queries (observable&Aggregation) to give the users a starting point */
|
|
79
|
-
StringExtensions.IsNullOrEmpty(expressionText?.trim()) && renderQueryHints(type), showDocumentationLinks && (_jsxs(HelpBlock, { "data-name": "query-documentation", className: "twa:my-2 twa:p-2 twa:text-3", children: [_jsx(ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(queryDocumentationLink, '_blank') }), "See documentation for more details and examples"] })), _jsx(Box, { className: "twa:flex-1" }), showNamedQueryStuff && saveAsNamedQueryElement] }), _jsx(Box, { className: `${baseClassName}__sidebar twa:pb-2 twa:px-2 twa:overflow-auto twa:h-full twa:w-[280px]`, "data-name": "expression-sidebar", children: _jsx(Box, { className: "twa:h-full twa:p-2 twa:rounded-standard twa:shadow-md twa:bg-background twa:text-foreground", children: _jsxs(Tabs, { className: "twa:h-full", children: [_jsx(Tabs.Tab, { value: "column", children: "Columns" }), _jsx(Tabs.Tab, { value: "field", children: "Fields" }), _jsx(Tabs.Tab, { value: "named-query", children: "Named Queries" }), _jsx(Tabs.Content, { className: "twa:flex-1 twa:h-full", children: _jsx(DataTableEditor, { type: "column", dataFormatter: (value) => `[${value}]`, fields: queryableColumns.map((column) => ({
|
|
70
|
+
}, children: _jsxs(Flex, { className: "twa:flex-1 twa:text-2", flexDirection: "row", "data-name": "expression-editor", style: { minHeight: 0 }, children: [_jsxs(Flex, { className: "twa:flex-1 twa:pr-2 twa:overflow-auto twa:min-h-0", "data-name": "expression-builder", flexDirection: "column", children: [editorInput, StringExtensions.IsNotNullOrEmpty(expressionText?.trim()) && (_jsx(ExpressionFunctionDocumentation, { expressionFunction: selectedFunction })), StringExtensions.IsNullOrEmpty(expressionText?.trim()) && renderQueryHints(type), showDocumentationLinks && (_jsxs(HelpBlock, { "data-name": "query-documentation", className: "twa:my-2 twa:p-2 twa:text-3", children: [_jsx(ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(queryDocumentationLink, '_blank') }), "See documentation for more details and examples"] })), _jsx(Box, { className: "twa:flex-1" }), showNamedQueryStuff && saveAsNamedQueryElement] }), _jsx(Box, { className: `${baseClassName}__sidebar twa:pb-2 twa:px-2 twa:overflow-auto twa:h-full twa:w-[280px]`, "data-name": "expression-sidebar", children: _jsx(Box, { className: "twa:h-full twa:p-2 twa:rounded-standard twa:shadow-md twa:bg-background twa:text-foreground", children: _jsxs(Tabs, { className: "twa:h-full", children: [_jsx(Tabs.Tab, { value: "column", children: "Columns" }), _jsx(Tabs.Tab, { value: "field", children: "Fields" }), _jsx(Tabs.Tab, { value: "named-query", children: "Named Queries" }), _jsx(Tabs.Content, { className: "twa:flex-1 twa:h-full", children: _jsx(DataTableEditor, { type: "column", dataFormatter: (value) => `[${value}]`, fields: queryableColumns.map((column) => ({
|
|
80
71
|
label: column.friendlyName,
|
|
81
72
|
value: column.columnId,
|
|
82
73
|
dataType: column.dataType,
|
|
@@ -21,8 +21,6 @@ export const IconComponent = (props) => {
|
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
htmlElement = icon.element;
|
|
24
|
-
// THe element neets to be cloned.
|
|
25
|
-
// when it is used in more than one plce the element is removed from the DOM
|
|
26
24
|
htmlElement = htmlElement.cloneNode(true);
|
|
27
25
|
}
|
|
28
26
|
divRef.current.insertAdjacentElement('afterend', htmlElement);
|
|
@@ -2,28 +2,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import Input, { baseClassName } from './index';
|
|
4
4
|
import join from '../utils/join';
|
|
5
|
-
/**
|
|
6
|
-
* This component allows - and empty values as intermediery values
|
|
7
|
-
* it calls change only with valid numeric values
|
|
8
|
-
*/
|
|
9
5
|
export const NumberInput = React.forwardRef((props, ref) => {
|
|
10
6
|
const [value, setValue] = React.useState(() => {
|
|
11
|
-
// awlays controlled
|
|
12
7
|
return props.value ?? '';
|
|
13
8
|
});
|
|
14
9
|
const handleChange = React.useCallback((event) => {
|
|
15
10
|
const { value } = event.target;
|
|
16
11
|
let newVal = Number(value);
|
|
17
12
|
if (value === '-' || value === '') {
|
|
18
|
-
// we are saving invalid values so we allow values as empty string and '-'
|
|
19
|
-
// there is a validation that prevents the
|
|
20
13
|
newVal = value;
|
|
21
|
-
// the value may be empty or negative
|
|
22
14
|
setValue(value);
|
|
23
15
|
}
|
|
24
16
|
else if (!isNaN(newVal)) {
|
|
25
17
|
setValue(value);
|
|
26
|
-
// only set when a valid numer
|
|
27
18
|
props.onChange(newVal);
|
|
28
19
|
}
|
|
29
20
|
}, [props.onChange]);
|
|
@@ -32,7 +23,6 @@ export const NumberInput = React.forwardRef((props, ref) => {
|
|
|
32
23
|
}, [props.value]);
|
|
33
24
|
const handleBlur = React.useCallback((event) => {
|
|
34
25
|
props?.onBlur?.(event);
|
|
35
|
-
// show the prop value
|
|
36
26
|
if (value !== props.value) {
|
|
37
27
|
setValue(props.value);
|
|
38
28
|
}
|