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