@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
|
@@ -29,14 +29,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
29
29
|
const setFieldValue = (key, value) => {
|
|
30
30
|
const newData = { ...data, [key]: value };
|
|
31
31
|
onChange(newData);
|
|
32
|
-
// Per-field `onValueChange` hook. We resolve the field by name from the
|
|
33
|
-
// form definition so callers (e.g. number-input keyDown handler) can use
|
|
34
|
-
// the same setter and still get the per-field callback fired.
|
|
35
|
-
//
|
|
36
|
-
// We enrich the host-supplied `context` with the freshly-computed
|
|
37
|
-
// `newData` as `formData` so consumers (e.g. CustomToolbarFormContext)
|
|
38
|
-
// see the updated values immediately - without having to wait for a
|
|
39
|
-
// React re-render to flush the new `data` prop into a rebuilt context.
|
|
40
32
|
const changedField = flatFields.find((f) => f.name === key);
|
|
41
33
|
if (changedField?.onValueChange) {
|
|
42
34
|
const enrichedContext = { ...(context ?? {}), formData: newData };
|
|
@@ -44,23 +36,13 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
44
36
|
}
|
|
45
37
|
};
|
|
46
38
|
const adaptable = useAdaptable();
|
|
47
|
-
// Stable form-instance id used to namespace every field's id so that
|
|
48
|
-
// multiple AdaptableForms on the same page (Alerts + a Custom Toolbar +
|
|
49
|
-
// a wizard, say) don't generate clashing DOM ids - and so screen readers
|
|
50
|
-
// can correctly resolve `htmlFor` / `aria-describedby` references.
|
|
51
39
|
const formInstanceId = useId();
|
|
52
40
|
const fieldDomId = (field) => `${formInstanceId}-${field.name}`;
|
|
53
41
|
const fieldLabelId = (field) => `${formInstanceId}-${field.name}-label`;
|
|
54
42
|
const fieldHelpId = (field) => `${formInstanceId}-${field.name}-help`;
|
|
55
43
|
const fieldErrorId = (field) => `${formInstanceId}-${field.name}-error`;
|
|
56
|
-
// Flat list of fields - shared by validation, options resolution, etc.
|
|
57
|
-
// Flattens both inline-row arrays and field groups.
|
|
58
44
|
const flatFields = useMemo(() => flattenAdaptableFormFields(formDef), [formDef]);
|
|
59
|
-
// Cache for async options resolution. Populated by the effect below.
|
|
60
45
|
const [asyncOptionsCache, setAsyncOptionsCache] = useState({});
|
|
61
|
-
// Kick off resolution of any function-form `options` that return a
|
|
62
|
-
// Promise. Synchronous functions are still resolved during render
|
|
63
|
-
// (via `resolveOptions`) so there's no first-paint lag for them.
|
|
64
46
|
useEffect(() => {
|
|
65
47
|
let cancelled = false;
|
|
66
48
|
flatFields.forEach((field) => {
|
|
@@ -75,7 +57,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
75
57
|
}
|
|
76
58
|
})
|
|
77
59
|
.catch(() => {
|
|
78
|
-
/* swallow - leave the previous cache entry in place */
|
|
79
60
|
});
|
|
80
61
|
}
|
|
81
62
|
}
|
|
@@ -96,16 +77,8 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
96
77
|
}
|
|
97
78
|
return result;
|
|
98
79
|
};
|
|
99
|
-
|
|
100
|
-
// exposed to button-level handlers via context (`formIsValid`,
|
|
101
|
-
// `formErrors`).
|
|
102
|
-
const formErrors = useMemo(() => validateAdaptableForm(formDef, data, context),
|
|
103
|
-
// intentionally include formDef so dynamic hidden/disabled functions
|
|
104
|
-
// re-evaluate when the form definition changes
|
|
105
|
-
[formDef, data, context]);
|
|
80
|
+
const formErrors = useMemo(() => validateAdaptableForm(formDef, data, context), [formDef, data, context]);
|
|
106
81
|
const formIsValid = Object.keys(formErrors).length === 0;
|
|
107
|
-
// Context enriched with the freshly-computed form data + validity, so
|
|
108
|
-
// that button hidden/disabled/onClick callbacks see consistent values.
|
|
109
82
|
const buttonContext = useMemo(() => ({
|
|
110
83
|
...(context ?? {}),
|
|
111
84
|
formData: data,
|
|
@@ -113,17 +86,11 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
113
86
|
formErrors,
|
|
114
87
|
}), [context, data, formIsValid, formErrors]);
|
|
115
88
|
const disabledButtons = useMemo(() => formDef.buttons?.map((button) => {
|
|
116
|
-
// defensive programming: conventionally context should ALWAYS be present for validating buttons
|
|
117
89
|
const isValid = !!button.disabled && !!buttonContext ? !button.disabled(button, buttonContext) : true;
|
|
118
90
|
return !isValid;
|
|
119
91
|
}) ?? [], [buttonContext, formDef.buttons]);
|
|
120
92
|
const renderLabel = (field) => {
|
|
121
93
|
const required = field.required;
|
|
122
|
-
// For radio groups we render a `<div>` (the radiogroup container has
|
|
123
|
-
// no single focusable element to associate the label with), but for
|
|
124
|
-
// every other field type we wire the label to the field's input with
|
|
125
|
-
// `htmlFor` so clicking the label focuses the control and so screen
|
|
126
|
-
// readers announce it correctly.
|
|
127
94
|
const useFor = field.fieldType !== 'radio' && field.fieldType !== 'textOutput';
|
|
128
95
|
const requiredMarker = required ? (_jsx("span", { className: "ab-Form_required-marker", "aria-hidden": "true", children: ' *' })) : null;
|
|
129
96
|
if (useFor) {
|
|
@@ -135,10 +102,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
135
102
|
const value = getFieldValue(field.name) ?? '';
|
|
136
103
|
const isDisabled = isAdaptableFormFieldDisabled(field, data, context);
|
|
137
104
|
const error = formErrors[field.name];
|
|
138
|
-
// Accessibility: every editable input gets a stable id (so the label's
|
|
139
|
-
// `htmlFor` resolves) plus `aria-*` attributes that announce required
|
|
140
|
-
// state, validity and link the help / error text via
|
|
141
|
-
// `aria-describedby`.
|
|
142
105
|
const inputId = fieldDomId(field);
|
|
143
106
|
const helpId = field.helpText ? fieldHelpId(field) : undefined;
|
|
144
107
|
const errorId = error ? fieldErrorId(field) : undefined;
|
|
@@ -152,7 +115,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
152
115
|
const onChange = (event) => {
|
|
153
116
|
if (field.fieldType === 'number') {
|
|
154
117
|
const rawValue = event.target.value;
|
|
155
|
-
// Empty string -> null (so `required` validation can detect it)
|
|
156
118
|
if (rawValue === '') {
|
|
157
119
|
setFieldValue(field.name, null);
|
|
158
120
|
return;
|
|
@@ -210,10 +172,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
210
172
|
label: item.label,
|
|
211
173
|
}));
|
|
212
174
|
const selectPlaceholder = resolveSelectPlaceholder(field, optionItems);
|
|
213
|
-
// The underlying SingleCombobox / MultiCombobox manage their own
|
|
214
|
-
// popup-based focus; we wrap them in a labelled `role="group"` so
|
|
215
|
-
// assistive tech announces "<label> group" when focus enters and
|
|
216
|
-
// can read out the help/error text via `aria-describedby`.
|
|
217
175
|
const groupProps = {
|
|
218
176
|
id: inputId,
|
|
219
177
|
role: 'group',
|
|
@@ -223,9 +181,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
223
181
|
'aria-describedby': describedBy,
|
|
224
182
|
};
|
|
225
183
|
if (field.multi) {
|
|
226
|
-
// For multi-selects the canonical value is an array. Coerce
|
|
227
|
-
// anything else (e.g. legacy string defaults) to [] so the
|
|
228
|
-
// underlying combobox never receives a non-array value.
|
|
229
184
|
const selected = Array.isArray(value) ? value : [];
|
|
230
185
|
control = (_jsx(Box, { ...groupProps, children: _jsx(MultiCombobox, { items: items, onValueChange: (newValues) => setFieldValue(field.name, newValues), value: selected, disabled: isDisabled, placeholder: selectPlaceholder }) }));
|
|
231
186
|
}
|
|
@@ -256,8 +211,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
256
211
|
control = _jsx(Box, { className: "twa:pl-2 twa:text-left", children: value });
|
|
257
212
|
break;
|
|
258
213
|
case 'custom':
|
|
259
|
-
// The consumer renders whatever they like; we keep the wiring
|
|
260
|
-
// controlled by routing reads/writes through `setFieldValue`.
|
|
261
214
|
control = field.render ? (field.render({
|
|
262
215
|
value,
|
|
263
216
|
setValue: (newValue) => setFieldValue(field.name, newValue),
|
|
@@ -271,21 +224,12 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
271
224
|
default:
|
|
272
225
|
control = _jsxs("div", { children: ["Unknown field type: ", field.fieldType] });
|
|
273
226
|
}
|
|
274
|
-
// No surrounding wrapper if there's nothing extra to show - keeps the
|
|
275
|
-
// existing simple cases visually identical.
|
|
276
227
|
if (!field.helpText && !error) {
|
|
277
228
|
return control;
|
|
278
229
|
}
|
|
279
230
|
return (_jsxs(Box, { children: [control, field.helpText && !error ? (_jsx(Box, { id: helpId, className: "ab-Form_help twa:text-xs twa:opacity-70 twa:mt-1", children: field.helpText })) : null, error ? (_jsx(Box, { id: errorId, role: "alert", "aria-live": "polite", className: "ab-Form_error twa:text-xs twa:mt-1", style: { color: 'var(--ab-color-destructive, #c00)' }, children: error })) : null] }));
|
|
280
231
|
};
|
|
281
|
-
// by default we have 2 columns: label & input
|
|
282
232
|
const columns = formDef.config?.columns ?? [1, 2];
|
|
283
|
-
// Form-level Enter-to-submit. Shift+Enter or Enter inside a textarea
|
|
284
|
-
// inserts a newline rather than submitting; this matches user
|
|
285
|
-
// expectations for multi-line inputs. We explicitly don't trigger on
|
|
286
|
-
// submit when a select dropdown is open (Enter selects an option),
|
|
287
|
-
// which the SingleCombobox/MultiCombobox handle internally by
|
|
288
|
-
// stopping propagation.
|
|
289
233
|
const handleFormKeyDown = (event) => {
|
|
290
234
|
handleKeyDownForNumberFields(event);
|
|
291
235
|
if (!formDef.onSubmit) {
|
|
@@ -312,9 +256,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
312
256
|
const targetName = target.name;
|
|
313
257
|
const field = flatFields.find((f) => f.name === targetName);
|
|
314
258
|
if (field && field.fieldType === 'number') {
|
|
315
|
-
// for number fields
|
|
316
|
-
// hook them up to the CellEditorKeyDown event
|
|
317
|
-
// so Shortcuts work as expected
|
|
318
259
|
const value = event.target.value;
|
|
319
260
|
adaptable._emit('CellEditorKeyDown', {
|
|
320
261
|
keyDownEvent: event,
|
|
@@ -326,14 +267,7 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
326
267
|
});
|
|
327
268
|
}
|
|
328
269
|
};
|
|
329
|
-
// `inline` lays fields out on a single horizontal row, with each field
|
|
330
|
-
// rendered as `<label> <input>` side-by-side. Designed for compact hosts
|
|
331
|
-
// like Dashboard Custom Toolbars; the standard popup/wizard layout (rows
|
|
332
|
-
// with label-on-left grid) is preserved for everything else.
|
|
333
270
|
const isInlineLayout = formDef.layout === 'inline';
|
|
334
|
-
// Inline-layout entries: groups are flattened (their title/description
|
|
335
|
-
// skipped because there's no vertical room) but inline-row arrays are
|
|
336
|
-
// also flattened so every visible field becomes its own cell.
|
|
337
271
|
const renderInlineEntries = () => {
|
|
338
272
|
const items = [];
|
|
339
273
|
for (const entry of formDef.fields ?? []) {
|
|
@@ -370,15 +304,11 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
370
304
|
if (isAdaptableFormFieldGroupHidden(entry, data, context)) {
|
|
371
305
|
return null;
|
|
372
306
|
}
|
|
373
|
-
// Render inner items using the same row/inline-row logic that
|
|
374
|
-
// top-level entries use, just nested below the group header.
|
|
375
307
|
const innerNodes = entry.fields.map((inner, innerIndex) => {
|
|
376
308
|
if (Array.isArray(inner)) {
|
|
377
309
|
const visible = inner.filter((f) => !isAdaptableFormFieldHidden(f, data, context));
|
|
378
310
|
if (visible.length === 0)
|
|
379
311
|
return null;
|
|
380
|
-
// `renderField` returns `React.ReactNode` (custom fields may
|
|
381
|
-
// produce strings/fragments) so we widen the row-bag to match.
|
|
382
312
|
const rowFields = {};
|
|
383
313
|
visible.map((fieldItem, idx) => {
|
|
384
314
|
const rowFieldIndex = 2 * idx + 1;
|
|
@@ -401,8 +331,6 @@ export function AdaptableFormComponent({ formDef, data, onChange, onButtonClick,
|
|
|
401
331
|
}, children: [entry.title ? (_jsx(Box, { className: "ab-Form_group-title twa:text-4 twa:font-bold", children: entry.title })) : null, entry.description ? (_jsx(Box, { className: "ab-Form_group-description twa:text-xs twa:opacity-70 twa:mt-1", children: entry.description })) : null] })) : null, innerNodes] }, `group-${index}`));
|
|
402
332
|
}
|
|
403
333
|
if (Array.isArray(entry)) {
|
|
404
|
-
// `renderField` returns `React.ReactNode` (custom fields may
|
|
405
|
-
// produce strings/fragments) so we widen the row-bag to match.
|
|
406
334
|
const rowFields = {};
|
|
407
335
|
const visible = entry.filter((f) => !isAdaptableFormFieldHidden(f, data, context));
|
|
408
336
|
if (visible.length === 0)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../lib/utils';
|
|
3
3
|
import { Box } from '../Flex';
|
|
4
|
-
export const baseClassName = 'ab-CodeBlock';
|
|
5
4
|
export const CodeBlock = (props) => {
|
|
6
|
-
return (_jsx(Box, { as: "code", ...props, className: cn('twa:p-1 twa:rounded-standard twa:bg-primary twa:text-primary-foreground',
|
|
5
|
+
return (_jsx(Box, { as: "code", ...props, className: cn('twa:p-1 twa:rounded-standard twa:bg-primary twa:text-primary-foreground', 'ab-CodeBlock', props.className) }));
|
|
7
6
|
};
|
|
@@ -11,12 +11,9 @@ import { twMerge } from '../../twMerge';
|
|
|
11
11
|
export const ColorPicker = React.forwardRef((props, ref) => {
|
|
12
12
|
const ColorPalette = props.api.userInterfaceApi.getColorPalette();
|
|
13
13
|
let { value, includeAlpha = true, className, ...restProps } = props;
|
|
14
|
-
// Create a debounced version of onChange
|
|
15
|
-
// we need this because moving the mouse A LOT in the custom color picker can break the React rendering
|
|
16
14
|
const debouncedOnChange = useCallback(debounce((color) => {
|
|
17
15
|
props.onChange(color);
|
|
18
16
|
}, 30), [props.onChange]);
|
|
19
|
-
// Clean up the debounce on unmount
|
|
20
17
|
useEffect(() => {
|
|
21
18
|
return () => {
|
|
22
19
|
debouncedOnChange.cancel();
|
|
@@ -40,9 +37,6 @@ export const ColorPicker = React.forwardRef((props, ref) => {
|
|
|
40
37
|
return (_jsxs(Flex, { className: cn('ColorPicker twa:items-center twa:gap-2', {
|
|
41
38
|
'twa:opacity-30': props.disabled,
|
|
42
39
|
}, className), children: [_jsx(Input, { ...restProps, as: undefined, disabled: props.disabled, className: twMerge('ab-ColorPicker-swatch'), onChange: (event) => {
|
|
43
|
-
/**
|
|
44
|
-
* The value is not in the map when the color is not in the palette.
|
|
45
|
-
*/
|
|
46
40
|
const color = optionsMap[event.target.value] ?? event.target.value;
|
|
47
41
|
debouncedOnChange(color);
|
|
48
42
|
}, value: preparedValue, ref: ref, type: "color", list: "ABcolorChoices", title: props.title }), ABcolorChoices, includeAlpha && (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1", children: [_jsx(Box, { children: "Opacity" }), _jsx(Flex, { alignItems: "center", className: "twa:min-h-input", children: _jsx(Input, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
|
|
@@ -45,11 +45,6 @@ export function VirtualizedList({ open, virtualizerRef, showItemTooltip, renderC
|
|
|
45
45
|
const label = isUncreatedCreatable ? `Create "${item.label}"` : item.label;
|
|
46
46
|
const itemLabel = renderItemLabel ? (renderItemLabel(label, item)) : (_jsx("span", { className: "twa:min-w-0 twa:flex-1 twa:truncate", children: label }));
|
|
47
47
|
const itemContent = isUncreatedCreatable ? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, {}), itemLabel] })) : (itemLabel);
|
|
48
|
-
// The Tooltip must wrap the item's inner content rather than the
|
|
49
|
-
// `ComboboxItem` itself: when the tooltip trigger renders the option
|
|
50
|
-
// element it overwrites the option's `id`, which breaks base-ui's
|
|
51
|
-
// `aria-activedescendant` (`${rootId}-${index}`) link and silences
|
|
52
|
-
// screen readers as you navigate the list.
|
|
53
48
|
return (_jsx(ComboboxItem, { index: virtualItem.index, "data-index": virtualItem.index, ref: virtualizer.measureElement, value: item, renderCheckboxIndicator: renderCheckboxIndicator, "aria-setsize": filteredItems.length, "aria-posinset": virtualItem.index + 1, "aria-label": itemText ?? undefined, style: {
|
|
54
49
|
position: 'absolute',
|
|
55
50
|
left: `var(--ab-base-space)`,
|
|
@@ -36,11 +36,6 @@ const AdaptableComboboxList = (props) => {
|
|
|
36
36
|
? `Create "${itemText}"`
|
|
37
37
|
: itemText
|
|
38
38
|
: undefined;
|
|
39
|
-
// The Tooltip must wrap the item's inner content rather than the
|
|
40
|
-
// `ComboboxItem` itself: when the tooltip trigger renders the option element
|
|
41
|
-
// it overwrites the option's `id`, which breaks base-ui's
|
|
42
|
-
// `aria-activedescendant` (`${rootId}-${index}`) link and silences screen
|
|
43
|
-
// readers as you navigate the list.
|
|
44
39
|
return (_jsx(ComboboxItem, { value: item, "aria-label": itemText ?? undefined, className: 'ab-Combobox-Row', disabled: item.disabled, renderCheckboxIndicator: props.renderCheckboxIndicator, children: tooltipText != null ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx("span", { className: "twa:flex twa:min-w-0 twa:flex-1 twa:items-center twa:gap-2" }), children: itemContent }), _jsx(TooltipContent, { side: "right", children: tooltipText })] })) : (itemContent) }, item.value));
|
|
45
40
|
};
|
|
46
41
|
const list = props.groups ? (_jsx(ComboboxList, { className: loadingClassName, children: (group, index) => (_jsxs(React.Fragment, { children: [_jsxs(ComboboxGroup, { items: group.items, children: [group.label && _jsx(ComboboxLabel, { children: group.label }), _jsx(ComboboxCollection, { children: renderItem })] }), index < (props.groups?.length || 0) - 1 && _jsx(ComboboxSeparator, {})] }, typeof group.label === 'string' ? group.label : `${index}`)) })) : props.virtualized ? (_jsx(ComboboxPrimitive.List, { className: cn(loadingClassName, RESIZABLE_VIRTUALIZED_LIST_CLASS), children: _jsx(VirtualizedList, { open: props.open, renderItemLabel: props.renderItemLabel, virtualizerRef: virtualizerRef, showItemTooltip: props.showItemTooltip, renderCheckboxIndicator: props.renderCheckboxIndicator }) })) : (_jsx(ComboboxList, { className: loadingClassName, children: renderItem }));
|
|
@@ -59,10 +54,6 @@ const AdaptableComboboxList = (props) => {
|
|
|
59
54
|
props.onCheckAllChange?.(!allChecked);
|
|
60
55
|
}
|
|
61
56
|
}, onMouseDown: (e) => {
|
|
62
|
-
// Prevent focus from moving to the checkbox input;
|
|
63
|
-
// keeps focus on the combobox input so arrow-key navigation still works.
|
|
64
|
-
// while still allowing the checkbox to be checked/unchecked as usual
|
|
65
|
-
// either by clicking or by using the keyboard
|
|
66
57
|
e.preventDefault();
|
|
67
58
|
}, className: cn('twa:m-0 twa:px-3 twa:py-1 twa:text-sm twa:font-normal twa:text-current twa:w-full twa:bg-primary', {
|
|
68
59
|
'twa:mt-1': props.searchable === 'menulist',
|
|
@@ -90,8 +81,6 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
90
81
|
const resolvedValue = props.multiple
|
|
91
82
|
? valueToItems(props.value, itemByValue)
|
|
92
83
|
: valueToItem(props.value, itemByValue);
|
|
93
|
-
// When props.value is defined, always pass null (not undefined) to keep base-ui in controlled mode,
|
|
94
|
-
// even if the item isn't in the lookup yet (e.g. async item loading).
|
|
95
84
|
const internalValue = props.value !== undefined ? resolvedValue ?? null : resolvedValue;
|
|
96
85
|
const internalDefaultValue = props.multiple
|
|
97
86
|
? valueToItems(props.defaultValue, itemByValue)
|
|
@@ -99,8 +88,6 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
99
88
|
const handleValueChange = (next, eventDetails) => {
|
|
100
89
|
if (!props.onValueChange)
|
|
101
90
|
return;
|
|
102
|
-
// base-ui clears the selected value when Escape is pressed
|
|
103
|
-
// we only want to allow this if the clearOnEscape prop is true
|
|
104
91
|
if (eventDetails?.reason === 'escape-key' && !props.clearOnEscape) {
|
|
105
92
|
eventDetails.cancel?.();
|
|
106
93
|
return;
|
|
@@ -113,8 +100,6 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
113
100
|
}
|
|
114
101
|
};
|
|
115
102
|
const handleInputValueChange = (next, eventDetails) => {
|
|
116
|
-
// base-ui blanks the input text (and then the selected value) when Escape is pressed
|
|
117
|
-
// we only want to allow this if the clearOnEscape prop is true
|
|
118
103
|
if (eventDetails?.reason === 'escape-key' && !props.clearOnEscape) {
|
|
119
104
|
eventDetails.cancel?.();
|
|
120
105
|
return;
|
|
@@ -123,7 +108,6 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
123
108
|
};
|
|
124
109
|
let comboboxItems = props.groups ?? props.items;
|
|
125
110
|
if (props.isCreatable && allItems[allItems.length - 1]?.creatable) {
|
|
126
|
-
// let's detect all "creatable" items and add them to the combobox items
|
|
127
111
|
const creatableItems = [];
|
|
128
112
|
for (let len = allItems.length - 1; len >= 0; len--) {
|
|
129
113
|
const item = allItems[len];
|
|
@@ -142,8 +126,7 @@ const useGetAllItems = (props) => {
|
|
|
142
126
|
const allItems = props.groups
|
|
143
127
|
? props.groups.flatMap((g) => g.items)
|
|
144
128
|
: props.isCreatable
|
|
145
|
-
?
|
|
146
|
-
// as we'll push to the "allItems" array
|
|
129
|
+
?
|
|
147
130
|
[].concat(props.items)
|
|
148
131
|
: props.items;
|
|
149
132
|
const itemByValue = useMemo(() => {
|
|
@@ -161,8 +144,6 @@ const useGetAllItems = (props) => {
|
|
|
161
144
|
};
|
|
162
145
|
};
|
|
163
146
|
function useCreatable(props, allItems, itemByValue) {
|
|
164
|
-
// thse are items that the user has already hit "Enter" or selected
|
|
165
|
-
// so they should be reflected as normal items in the combobox
|
|
166
147
|
const [alreadySavedCreatableItems, setAlreadySavedCreatableItems] = React.useState([]);
|
|
167
148
|
const itemByValueRef = React.useRef(itemByValue);
|
|
168
149
|
itemByValueRef.current = itemByValue;
|
|
@@ -188,8 +169,6 @@ function useCreatable(props, allItems, itemByValue) {
|
|
|
188
169
|
...item,
|
|
189
170
|
creatable: true,
|
|
190
171
|
created: true,
|
|
191
|
-
// if all other items are numeric, and the value for the created item is a valid number, then convert the value to a number
|
|
192
|
-
// we'll also have to correctly call onValueChange with the new value
|
|
193
172
|
value: itemsAllNumeric && !Number.isNaN(Number(item.value)) ? Number(item.value) : item.value,
|
|
194
173
|
}));
|
|
195
174
|
setAlreadySavedCreatableItems((current) => {
|
|
@@ -207,8 +186,6 @@ function useCreatable(props, allItems, itemByValue) {
|
|
|
207
186
|
}
|
|
208
187
|
if (savingCreatableItem) {
|
|
209
188
|
if (props.multiple) {
|
|
210
|
-
// Replace the "creatable-not-yet-created" items in the full selection
|
|
211
|
-
// with their newly-created counterparts so existing values are preserved.
|
|
212
189
|
const createdByOriginalValue = new Map();
|
|
213
190
|
itemsToCreate.forEach((it, idx) => {
|
|
214
191
|
createdByOriginalValue.set(it.value, newCreatedItems[idx]);
|
|
@@ -237,10 +214,6 @@ function useCreatable(props, allItems, itemByValue) {
|
|
|
237
214
|
initialInputValue = getItemTextLabel(item);
|
|
238
215
|
}
|
|
239
216
|
else if (props.isCreatable) {
|
|
240
|
-
// For a creatable combobox, surface a controlled value that doesn't
|
|
241
|
-
// match any item as the input so the trigger displays it instead of
|
|
242
|
-
// falling back to the placeholder. The value is also re-added below
|
|
243
|
-
// as a creatable item, so base-ui can resolve it back to a row.
|
|
244
217
|
initialInputValue = `${value}`;
|
|
245
218
|
}
|
|
246
219
|
}
|
|
@@ -269,10 +242,6 @@ function useCreatable(props, allItems, itemByValue) {
|
|
|
269
242
|
return normalizedItemValue === normalized;
|
|
270
243
|
});
|
|
271
244
|
if (newValue !== '' && !exactExists) {
|
|
272
|
-
// When the creatable input is mirroring the controlled `props.value`
|
|
273
|
-
// (e.g. an unknown numeric value), use the original value's type for
|
|
274
|
-
// the synthesized item so `valueToItem(props.value, itemByValue)` can
|
|
275
|
-
// resolve back to it. Otherwise fall back to the typed string.
|
|
276
245
|
const creatableValue = !props.multiple && props.value != undefined && `${props.value}` === newValue
|
|
277
246
|
? props.value
|
|
278
247
|
: newValue;
|
|
@@ -352,12 +321,7 @@ const SingleCombobox_MenuListSearchable = (props) => {
|
|
|
352
321
|
}
|
|
353
322
|
: undefined;
|
|
354
323
|
const { allItems, itemByValue, maxLabelLength, inputValue, onInputValueChange, onValueChange, value, } = useGetAllItems(props);
|
|
355
|
-
return (_jsxs(AdaptableCombobox_Root, { ...props, value: value, allItems: allItems, itemByValue: itemByValue, inputValue: inputValue, onInputValueChange: onInputValueChange, onValueChange: onValueChange, children: [_jsx(ComboboxPrimitive.Trigger, { ref: triggerRef, render: _jsx("div", {}), nativeButton: false, "data-slot": "combobox-menulist-trigger", tabIndex: 0, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], className: cn(
|
|
356
|
-
// we intentially replaced :focus-visible with :focus
|
|
357
|
-
// because when the user clicked an item and the combobox closed
|
|
358
|
-
// the focus ring would not be displayed properly
|
|
359
|
-
// in this specific case of SingleCombobox_MenuListSearchable
|
|
360
|
-
'twa:flex twa:w-full twa:cursor-default twa:items-center twa:justify-between twa:gap-1.5 twa:rounded-input twa:border twa:border-input twa:bg-transparent twa:py-2 twa:pr-2 twa:pl-2.5 twa:text-sm twa:whitespace-nowrap twa:shadow-xs twa:transition-[color,box-shadow] twa:outline-none twa:select-none twa:focus:border-ring twa:focus:ring-3 twa:focus:ring-ring/50 twa:disabled:cursor-not-allowed twa:disabled:opacity-50 twa:data-placeholder:text-muted-foreground twa:h-9', triggerClassName), disabled: isDisabled, onFocus: handleFocus, onBlur: handleBlur, children: _jsx(ComboboxValue, { placeholder: _jsx("span", { children: props.placeholder }), children: (value) => {
|
|
324
|
+
return (_jsxs(AdaptableCombobox_Root, { ...props, value: value, allItems: allItems, itemByValue: itemByValue, inputValue: inputValue, onInputValueChange: onInputValueChange, onValueChange: onValueChange, children: [_jsx(ComboboxPrimitive.Trigger, { ref: triggerRef, render: _jsx("div", {}), nativeButton: false, "data-slot": "combobox-menulist-trigger", tabIndex: 0, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], className: cn('twa:flex twa:w-full twa:cursor-default twa:items-center twa:justify-between twa:gap-1.5 twa:rounded-input twa:border twa:border-input twa:bg-transparent twa:py-2 twa:pr-2 twa:pl-2.5 twa:text-sm twa:whitespace-nowrap twa:shadow-xs twa:transition-[color,box-shadow] twa:outline-none twa:select-none twa:focus:border-ring twa:focus:ring-3 twa:focus:ring-ring/50 twa:disabled:cursor-not-allowed twa:disabled:opacity-50 twa:data-placeholder:text-muted-foreground twa:h-9', triggerClassName), disabled: isDisabled, onFocus: handleFocus, onBlur: handleBlur, children: _jsx(ComboboxValue, { placeholder: _jsx("span", { children: props.placeholder }), children: (value) => {
|
|
361
325
|
return (_jsxs(React.Fragment, { children: [_jsx("span", { className: "twa:flex twa:flex-1 twa:truncate twa:text-left", "data-slot": "combobox-value", children: _jsx(ComboboxValue, { placeholder: _jsx("span", { children: props.placeholder }) }) }), _jsx("input", { type: "hidden", "data-slot": "combobox-value-input", readOnly: true, value: value ? getItemTextLabel(value) : '' }), props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), value && showClear ? (_jsx(ComboboxClear, { disabled: isDisabled, onMouseDown: (e) => {
|
|
362
326
|
e.preventBaseUIHandler();
|
|
363
327
|
} })) : props.showTrigger !== false ? (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", className: 'twa:min-h-auto!', children: _jsx(ChevronDownIcon, { className: "twa:pointer-events-none twa:size-4 twa:shrink-0 twa:text-muted-foreground" }) })) : null] }));
|
|
@@ -394,10 +358,6 @@ const MultiCombobox_SimpleSearchable = (props) => {
|
|
|
394
358
|
props.onOpenChange(open);
|
|
395
359
|
};
|
|
396
360
|
return (_jsxs(AdaptableCombobox_Root, { ...props, value: value, multiple: true, allItems: allItems, itemByValue: itemByValue, inputValue: inputValue, onInputValueChange: onInputValueChange, onValueChange: onValueChange, onOpenChange: onOpenChange, children: [_jsx(ComboboxChips, { "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], onClick: (e) => {
|
|
397
|
-
// ignore clicks that originate from the right-side controls (chevron / clear),
|
|
398
|
-
// since those buttons already toggle the combobox themselves. without this guard,
|
|
399
|
-
// clicking the chevron while the popup is open would first close it (via the
|
|
400
|
-
// base-ui trigger) and then the bubbled click would re-open it here.
|
|
401
361
|
if (e.target.closest('[data-slot="input-group"]')) {
|
|
402
362
|
return;
|
|
403
363
|
}
|
|
@@ -407,7 +367,7 @@ const MultiCombobox_SimpleSearchable = (props) => {
|
|
|
407
367
|
}, ref: anchor, className: cn('twa:relative', props.className), children: _jsx(ComboboxValue, { children: (selectedItems) => {
|
|
408
368
|
const shouldKeepTrigger = props.searchable === false && selectedItems.length > 0;
|
|
409
369
|
return (_jsxs(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : (_jsx(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? (_jsxs(_Fragment, { children: [_jsx(ComboboxChipsInput, { placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: props.searchable === false, onFocus: props.onFocus, onBlur: props.onBlur, className: props.searchable === false && selectedItems.length > 0
|
|
410
|
-
? 'twa:absolute! twa:inset-0 twa:min-h-auto! twa:max-h-auto!'
|
|
370
|
+
? 'twa:absolute! twa:inset-0 twa:min-h-auto! twa:max-h-auto!'
|
|
411
371
|
: 'twa:flex-1' }), props.searchable === false && selectedItems.length > 0 ? (_jsx("div", { className: "twa:flex-1" })) : null, _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group twa:z-10", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px twa:gap-0.5", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), props.showTrigger !== false ? (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!" }), "data-slot": "combobox-toggle", className: cn(`twa:data-pressed:bg-transparent`, shouldKeepTrigger
|
|
412
372
|
? ''
|
|
413
373
|
: 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled })) : null, showClear && _jsx(ComboboxClear, { disabled: isDisabled })] }) })] })) : null] }));
|
|
@@ -415,7 +375,6 @@ const MultiCombobox_SimpleSearchable = (props) => {
|
|
|
415
375
|
};
|
|
416
376
|
const MultiComboboxChips = (props) => {
|
|
417
377
|
return (_jsx(_Fragment, { children: props.selectedItems.map((item) => (_jsx(ComboboxChip, { showRemove: props.showClear, onMouseDown: (e) => {
|
|
418
|
-
// this prevents showing the list when the user simply wants to remove a chip
|
|
419
378
|
e.preventBaseUIHandler?.();
|
|
420
379
|
}, className: 'twa:overflow-hidden', "aria-label": typeof item.label === 'string' ? item.label : undefined, children: item.label }, item.value))) }));
|
|
421
380
|
};
|
|
@@ -486,22 +445,15 @@ const MultiCombobox_MenuListSearchable = (props) => {
|
|
|
486
445
|
const isInternal = container.contains(newFocusedTarget) ||
|
|
487
446
|
contentElRef.current?.contains(newFocusedTarget);
|
|
488
447
|
if (isInternal) {
|
|
489
|
-
// if we don't have this logic here,
|
|
490
|
-
// the popup wont collapse when focus is lost
|
|
491
448
|
return;
|
|
492
449
|
}
|
|
493
|
-
// if the focused target is not inside the combobox, close the combobox
|
|
494
450
|
onOpenChange(false);
|
|
495
451
|
if (hasFocusRef.current) {
|
|
496
452
|
hasFocusRef.current = false;
|
|
497
453
|
props.onBlur?.();
|
|
498
454
|
}
|
|
499
455
|
}, className: cn('twa:relative', props.className, _props?.className), children: _jsx(ComboboxValue, { children: (selectedItems) => {
|
|
500
|
-
return (_jsxs(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : (_jsx(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? (_jsx(_Fragment, { children: _jsx(ComboboxChipsInput, { ref: chipsInputRef, placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: true, value: '', className: 'twa:flex-1' }) })) : (_jsx("div", { className: "twa:flex-1" })), _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), props.showTrigger !== false ? (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!", ref: chevronRef, "data-slot": "combobox-toggle",
|
|
501
|
-
// we already have the role="combobox" on the parent
|
|
502
|
-
// so we want to avoid the same role twice in the component,
|
|
503
|
-
// hence we use the role="widget" here.
|
|
504
|
-
role: "widget" }), "data-slot": "combobox-toggle", className: cn(`twa:data-pressed:bg-transparent`, 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled })) : null, showClear && _jsx(ComboboxClear, { disabled: isDisabled })] }) })] }));
|
|
456
|
+
return (_jsxs(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : (_jsx(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? (_jsx(_Fragment, { children: _jsx(ComboboxChipsInput, { ref: chipsInputRef, placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: true, value: '', className: 'twa:flex-1' }) })) : (_jsx("div", { className: "twa:flex-1" })), _jsx("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group", children: _jsxs(InputGroupAddon, { align: "inline-end", className: "twa:p-0 px", children: [props.isLoading && (_jsx(Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), props.showTrigger !== false ? (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, { className: "twa:min-h-auto!", ref: chevronRef, "data-slot": "combobox-toggle", role: "widget" }), "data-slot": "combobox-toggle", className: cn(`twa:data-pressed:bg-transparent`, 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled })) : null, showClear && _jsx(ComboboxClear, { disabled: isDisabled })] }) })] }));
|
|
505
457
|
} }) }));
|
|
506
458
|
};
|
|
507
459
|
return (_jsxs(AdaptableCombobox_Root, { ...props, value: value, multiple: true, allItems: allItems, itemByValue: itemByValue, inputValue: inputValue, onInputValueChange: onInputValueChange, onValueChange: onValueChange, onOpenChange: onOpenChange, children: [props.renderInput === false ? (_jsx(ComboboxTrigger, { nativeButton: false, render: renderChips, icon: props.showTrigger !== false ? undefined : null })) : (renderChips(undefined)), _jsxs(ComboboxContent, { anchor: anchor, style: getContentStyle({ maxLabelLength }), resizable: props.resizable, contentRef: contentRefCallback, children: [_jsx(ComboboxInput, { placeholder: 'Filter...', showClear: false, ref: searchInputRef, showTrigger: false, disabled: isDisabled, onFocus: handleFocus, onBlur: handleBlur, role: "searchbox", className: 'twa:min-h-input', children: typeof props.renderSearchInputTrailing === 'function'
|
|
@@ -518,16 +470,7 @@ export const MultiCombobox = (props) => {
|
|
|
518
470
|
const showItemTooltip = props.showItemTooltip ?? !!props.virtualized;
|
|
519
471
|
return searchable === 'menulist' ? (_jsx(MultiCombobox_MenuListSearchable, { renderInput: false, ...props, multiple: true, open: open, onOpenChange: onOpenChange, searchable: searchable, showItemTooltip: showItemTooltip })) : (_jsx(MultiCombobox_SimpleSearchable, { ...props, open: open, multiple: true, onOpenChange: onOpenChange, searchable: searchable, showItemTooltip: showItemTooltip }));
|
|
520
472
|
};
|
|
521
|
-
export const GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME = cn(
|
|
522
|
-
// remove the border/shadow and position it properly
|
|
523
|
-
// to adjust for outline on the input
|
|
524
|
-
'twa:[.ab-FloatingFilter_&]:border-none twa:[.ab-FloatingFilter_&]:inset-y-0.5 twa:[.ab-FloatingFilter_&]:inset-x-0 twa:[.ab-FloatingFilter_&]:absolute twa:[.ab-FloatingFilter_&]:shadow-none twa:[.ab-FloatingFilter_&]:min-h-auto!',
|
|
525
|
-
// more adjustments for very compact ag grid themes
|
|
526
|
-
'twa:[.ab-FloatingFilter_&]:[line-height:1]', 'twa:[.ab-FloatingFilter_[data-slot=combobox-trigger]]:py-0',
|
|
527
|
-
// also for very compact ag grid themes
|
|
528
|
-
// make the floating-filter combobox a size container so the toggle can
|
|
529
|
-
// shrink purely via CSS when the control is small in height (see ColumnFilter/base.css)
|
|
530
|
-
'twa:[.ab-FloatingFilter_&]:[container-type:size]');
|
|
473
|
+
export const GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME = cn('twa:[.ab-FloatingFilter_&]:border-none twa:[.ab-FloatingFilter_&]:inset-y-0.5 twa:[.ab-FloatingFilter_&]:inset-x-0 twa:[.ab-FloatingFilter_&]:absolute twa:[.ab-FloatingFilter_&]:shadow-none twa:[.ab-FloatingFilter_&]:min-h-auto!', 'twa:[.ab-FloatingFilter_&]:[line-height:1]', 'twa:[.ab-FloatingFilter_[data-slot=combobox-trigger]]:py-0', 'twa:[.ab-FloatingFilter_&]:[container-type:size]');
|
|
531
474
|
export const GridFilterCombobox = (props) => {
|
|
532
475
|
const { showSelectedCount = false, placeholder = 'Select...', ...comboboxProps } = props;
|
|
533
476
|
const sharedProps = {
|
|
@@ -539,7 +482,6 @@ export const GridFilterCombobox = (props) => {
|
|
|
539
482
|
virtualized: true,
|
|
540
483
|
resizable: true,
|
|
541
484
|
showClear: false,
|
|
542
|
-
// don't show a chevron icon in the grid filter combobox
|
|
543
485
|
showTrigger: false,
|
|
544
486
|
renderInputValues: (items) => {
|
|
545
487
|
let children = items.map((item) => getItemTextLabel(item)).join(', ');
|
|
@@ -37,7 +37,6 @@ export function Dashboard(props) {
|
|
|
37
37
|
}, children: child.props.title }, index))) }));
|
|
38
38
|
const renderBar = () => (_jsxs("div", { className: "ab-Dashboard__header", onDoubleClick: (event) => {
|
|
39
39
|
const target = event.target;
|
|
40
|
-
// ignore double clicks on buttons, inputs and their children
|
|
41
40
|
if (!props.canFloat) {
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
@@ -46,7 +45,5 @@ export function Dashboard(props) {
|
|
|
46
45
|
}
|
|
47
46
|
setFloating(!floating);
|
|
48
47
|
}, children: [_jsxs("div", { className: "ab-Dashboard__header-left", children: [left, !floating && renderTabs()] }), floating ? (_jsx("div", { className: "ab-Dashboard__title", ref: handleRef, style: { cursor: 'move' }, children: title }, "title-drag")) : (_jsx("div", { className: "ab-Dashboard__title", children: title }, "title")), _jsx("div", { className: "ab-Dashboard__header-right", children: right })] }));
|
|
49
|
-
return (_jsxs("div", {
|
|
50
|
-
// @ts-ignore
|
|
51
|
-
ref: targetRef, className: join(`ab-Dashboard`, collapsed ? 'ab-Dashboard--collapsed' : '', floating ? 'ab-Dashboard--floating' : ''), style: floating ? floatingStyle : undefined, children: [renderBar(), expanded && children && children.length ? (_jsx("div", { className: "ab-Dashboard__content", children: children[activeTabIndex] ? children[activeTabIndex].props.children : null })) : null, props.footer] }));
|
|
48
|
+
return (_jsxs("div", { ref: targetRef, className: join(`ab-Dashboard`, collapsed ? 'ab-Dashboard--collapsed' : '', floating ? 'ab-Dashboard--floating' : ''), style: floating ? floatingStyle : undefined, children: [renderBar(), expanded && children && children.length ? (_jsx("div", { className: "ab-Dashboard__content", children: children[activeTabIndex] ? children[activeTabIndex].props.children : null })) : null, props.footer] }));
|
|
52
49
|
}
|