@adaptabletools/adaptable 23.0.0-canary.6 → 23.0.0-canary.7
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/icons/sort-asc.svg +1 -1
- package/index.css +755 -256
- package/package.json +1 -1
- package/src/AdaptableOptions/DataSetOptions.d.ts +26 -2
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -1
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +42 -10
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +7 -0
- package/src/AdaptableState/Common/AdaptableMessageType.d.ts +1 -1
- package/src/AdaptableState/Common/Enums.d.ts +1 -1
- package/src/AdaptableState/Common/Enums.js +1 -1
- package/src/AdaptableState/StyledColumnState.d.ts +2 -2
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/DataSetInternalApi.d.ts +3 -0
- package/src/Api/Internal/DataSetInternalApi.js +73 -13
- package/src/Redux/Store/AdaptableStore.js +6 -4
- package/src/Strategy/CalculatedColumnModule.js +1 -0
- package/src/Strategy/ColumnFilterModule.js +1 -0
- package/src/Strategy/FlashingCellModule.js +6 -2
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Strategy/FreeTextColumnModule.js +38 -28
- package/src/Strategy/Interface/IModule.d.ts +3 -1
- package/src/Strategy/LayoutModule.js +15 -66
- package/src/Strategy/StyledColumnModule.js +12 -29
- package/src/Strategy/Utilities/CustomSort/getCustomSortColumnViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/CustomSort/getCustomSortColumnViewItems.js +1 -0
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +2 -0
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +14 -0
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +3 -0
- package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.d.ts +11 -0
- package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.js +105 -0
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.d.ts +48 -0
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +166 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +1 -0
- package/src/Strategy/Utilities/Layout/rowGroupSummaryHelpers.d.ts +26 -0
- package/src/Strategy/Utilities/Layout/rowGroupSummaryHelpers.js +85 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +3 -5
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +46 -41
- package/src/Utilities/Helpers/FormatHelper.js +3 -0
- package/src/Utilities/Helpers/ScheduleHelper.js +2 -0
- package/src/Utilities/Helpers/StyleHelper.d.ts +18 -0
- package/src/Utilities/Helpers/StyleHelper.js +27 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +7 -5
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.d.ts +3 -0
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.js +15 -0
- package/src/Utilities/getScopeViewItems.js +2 -0
- package/src/Utilities/wizardSelection.d.ts +10 -0
- package/src/Utilities/wizardSelection.js +15 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +3 -3
- package/src/View/Alert/AlertViewPanel.js +2 -2
- package/src/View/Alert/Utilities/getAlertButtonStyle.js +7 -4
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.d.ts +0 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +0 -4
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -1
- package/src/View/Alert/Wizard/AlertMessageWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +1 -2
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +3 -4
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -2
- package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +31 -7
- package/src/View/Alert/Wizard/AlertWizard.js +4 -4
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.d.ts +2 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +4 -14
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +4 -6
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +30 -4
- package/src/View/CellSummary/CellSummaryViewPanel.js +4 -4
- package/src/View/Charting/ShowChartButton.js +8 -8
- package/src/View/ColumnInfo/ColumnInfo.js +21 -1
- package/src/View/Components/AdaptableObjectCollection/index.js +2 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +4 -4
- package/src/View/Components/AdaptableObjectRow/index.js +2 -2
- package/src/View/Components/Buttons/ButtonBase/index.js +2 -3
- package/src/View/Components/Buttons/ButtonNew.d.ts +2 -0
- package/src/View/Components/Buttons/ButtonNew.js +1 -1
- package/src/View/Components/Buttons/EntityListActionButtons.js +3 -3
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +2 -2
- package/src/View/Components/ColumnFilter/ColumnFilter.js +2 -3
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +2 -2
- package/src/View/Components/ColumnSelector/index.d.ts +12 -0
- package/src/View/Components/ColumnSelector/index.js +30 -6
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +2 -2
- package/src/View/Components/ModuleValueSelector/index.js +2 -1
- package/src/View/Components/NewScopeComponent.js +4 -9
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +5 -4
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +4 -4
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +3 -2
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +38 -28
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +3 -3
- package/src/View/Components/Popups/AdaptablePopup/TopBar.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.d.ts +11 -0
- package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.js +1 -0
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +3 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +25 -27
- package/src/View/Components/PredicateEditor/PredicateEditor.js +1 -1
- package/src/View/Components/RangesComponent.d.ts +2 -4
- package/src/View/Components/RangesComponent.js +95 -66
- package/src/View/Components/ReorderDraggable/index.js +2 -2
- package/src/View/Components/Selectors/BulkUpdateValueSelector.d.ts +0 -2
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +3 -3
- package/src/View/Components/StyleComponent.js +32 -65
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +10 -7
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +3 -13
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +5 -81
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.d.ts +17 -0
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +76 -0
- package/src/View/Components/ValueSelector/index.d.ts +29 -0
- package/src/View/Components/ValueSelector/index.js +113 -30
- package/src/View/Components/wizardColumnListStyles.d.ts +10 -0
- package/src/View/Components/wizardColumnListStyles.js +10 -0
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +5 -7
- package/src/View/CustomSort/Wizard/CustomSortWizard.js +2 -2
- package/src/View/Dashboard/DashboardPopup.d.ts +1 -11
- package/src/View/Dashboard/DashboardPopup.js +3 -67
- package/src/View/Dashboard/DashboardPopupSections.d.ts +20 -0
- package/src/View/Dashboard/DashboardPopupSections.js +68 -0
- package/src/View/Dashboard/PinnedToolbarsSelector.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +1 -6
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +8 -20
- package/src/View/DataChangeHistory/DataChangeHistoryTable.d.ts +8 -0
- package/src/View/DataChangeHistory/DataChangeHistoryTable.js +94 -0
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +5 -3
- package/src/View/DataChangeHistory/buildActionColumnButton.js +30 -39
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.d.ts +15 -0
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.js +37 -0
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +32 -19
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +2 -2
- package/src/View/Export/ExportDestinationPicker.js +3 -3
- package/src/View/Export/ExportViewPanel.js +2 -2
- package/src/View/Export/Wizard/ReportColumnsWizardSection.d.ts +2 -1
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +4 -9
- package/src/View/Export/Wizard/ReportRowsWizardSection.d.ts +2 -1
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +3 -6
- package/src/View/FlashingCell/FlashingCellStyle.d.ts +4 -2
- package/src/View/FlashingCell/FlashingCellStyle.js +4 -2
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.d.ts +2 -1
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +7 -11
- package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.d.ts +9 -0
- package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.js +5 -0
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.d.ts +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -0
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.d.ts +0 -5
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +2 -3
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +99 -42
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +0 -4
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +56 -15
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +2 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +5 -8
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +8 -13
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +3 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -2
- package/src/View/GridFilter/GridFilterPopupUI/index.js +3 -2
- package/src/View/GridFilter/GridFilterViewPanel.js +5 -5
- package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +2 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -2
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/Wizard/LayoutWizard.js +24 -28
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +13 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +73 -33
- package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +155 -276
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +148 -145
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +5 -2
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +24 -12
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +23 -12
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +5 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +19 -12
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +8 -4
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +11 -11
- package/src/View/Layout/Wizard/sections/SortSection.d.ts +12 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +41 -17
- package/src/View/Layout/Wizard/sections/columnLayoutCards.d.ts +20 -0
- package/src/View/Layout/Wizard/sections/columnLayoutCards.js +159 -0
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.d.ts +30 -0
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +201 -0
- package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.js +63 -0
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.d.ts +11 -0
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +52 -0
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.d.ts +1 -1
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -2
- package/src/View/Note/NoteEditor.js +2 -2
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -3
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +2 -2
- package/src/View/SmartEdit/SmartEditViewPanel.js +2 -2
- package/src/View/StateManagement/StateManagementPopup.js +1 -1
- package/src/View/StateManagement/components/ExportDropdown.d.ts +2 -2
- package/src/View/StateManagement/components/ExportDropdown.js +12 -12
- package/src/View/StatusBar/StatusBarPanel.js +2 -2
- package/src/View/StatusBar/StatusBarPopup.js +33 -5
- package/src/View/StatusBar/statusBarPanelHelpers.d.ts +2 -0
- package/src/View/StatusBar/statusBarPanelHelpers.js +7 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +2 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +14 -11
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +137 -119
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +8 -14
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnTypeThumbnail.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnTypeThumbnail.js +50 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +2 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +26 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +8 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +46 -28
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +98 -43
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +32 -46
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +11 -6
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +94 -7
- package/src/View/UIHelper.d.ts +0 -2
- package/src/View/UIHelper.js +8 -23
- package/src/View/Wizard/CollapsibleWizardCard.d.ts +68 -0
- package/src/View/Wizard/CollapsibleWizardCard.js +81 -0
- package/src/View/Wizard/OnePageWizards.js +6 -6
- package/src/View/Wizard/SummaryColorTag.d.ts +24 -0
- package/src/View/Wizard/SummaryColorTag.js +67 -0
- package/src/View/Wizard/WizardTypeSelection.d.ts +34 -0
- package/src/View/Wizard/WizardTypeSelection.js +31 -0
- package/src/View/Wizard/rowGroupSummaryTags.d.ts +18 -0
- package/src/View/Wizard/rowGroupSummaryTags.js +14 -0
- package/src/View/Wizard/scopeSummaryTags.d.ts +6 -0
- package/src/View/Wizard/scopeSummaryTags.js +33 -0
- package/src/agGrid/AgGridAdapter.js +0 -5
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/agGrid/cellRenderers/ActionColumnRenderer.js +4 -7
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -1
- package/src/components/Card/index.js +5 -6
- package/src/components/CheckBox/index.js +2 -3
- package/src/components/CodeBlock/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/src/components/ColorPicker/ColorPicker.js +8 -6
- package/src/components/ColorPicker/OptionalColorPicker.d.ts +12 -0
- package/src/components/ColorPicker/OptionalColorPicker.js +26 -0
- package/src/components/ColorPicker/index.d.ts +1 -0
- package/src/components/ColorPicker/index.js +1 -0
- package/src/components/Combobox/comboboxUtils.d.ts +1 -0
- package/src/components/Combobox/index.js +19 -18
- package/src/components/Dashboard/DashboardManager.js +2 -4
- package/src/components/Dialog/index.js +4 -4
- package/src/components/DragAndDropContext/DragAndDropContext.d.ts +5 -0
- package/src/components/DragAndDropContext/DragAndDropContext.js +3 -0
- package/src/components/DragAndDropContext/ModuleManager.d.ts +15 -3
- package/src/components/DragAndDropContext/ModuleManager.js +47 -8
- package/src/components/DragAndDropContext/TabList.d.ts +11 -4
- package/src/components/DragAndDropContext/TabList.js +52 -38
- package/src/components/DragAndDropContext/UnusedPanel.d.ts +4 -3
- package/src/components/DragAndDropContext/UnusedPanel.js +15 -11
- package/src/components/DragAndDropContext/dragScope.d.ts +6 -0
- package/src/components/DragAndDropContext/dragScope.js +26 -0
- package/src/components/DragAndDropContext/types.d.ts +7 -0
- package/src/components/DropdownButton/index.d.ts +33 -25
- package/src/components/DropdownButton/index.js +24 -158
- package/src/components/EmptyContent/index.js +2 -2
- package/src/components/ErrorBox/index.js +2 -2
- package/src/components/ExpressionEditor/BaseEditorInput.js +3 -3
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +3 -3
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +6 -6
- package/src/components/FieldWrap/index.js +2 -2
- package/src/components/Flex.js +2 -2
- package/src/components/FormLayout/index.d.ts +1 -1
- package/src/components/HelpBlock/index.js +3 -3
- package/src/components/IconSelector/IconSelector.d.ts +8 -0
- package/src/components/IconSelector/IconSelector.js +11 -7
- package/src/components/IconSelector/index.d.ts +1 -0
- package/src/components/IconSelector/index.js +1 -0
- package/src/components/Modal/index.js +2 -2
- package/src/components/NewSelect/index.js +11 -1
- package/src/components/Panel/index.js +7 -7
- package/src/components/Radio/index.d.ts +1 -1
- package/src/components/Radio/index.js +8 -6
- package/src/components/SimpleButton/index.js +7 -7
- package/src/components/StylePreview.js +2 -2
- package/src/components/Tabs/index.js +4 -4
- package/src/components/Tag/Tag.d.ts +16 -0
- package/src/components/Tag/Tag.js +14 -4
- package/src/components/Tag/columnScopeTagHelpers.d.ts +8 -0
- package/src/components/Tag/columnScopeTagHelpers.js +6 -0
- package/src/components/Tag/index.d.ts +1 -1
- package/src/components/Tag/index.js +1 -1
- package/src/components/Textarea/index.js +2 -3
- package/src/components/Toggle/Toggle.d.ts +2 -0
- package/src/components/Toggle/Toggle.js +14 -7
- package/src/components/Toggle/ToggleGroup.js +2 -2
- package/src/components/ToggleButton/index.js +4 -4
- package/src/components/Tree/TreeDropdown/index.js +3 -4
- package/src/components/WarningBox/index.js +2 -2
- package/src/components/icons/sort-asc.js +1 -1
- package/src/components/ui/button.d.ts +2 -2
- package/src/components/ui/combobox.d.ts +3 -1
- package/src/components/ui/combobox.js +2 -2
- package/src/components/ui/input-group.d.ts +1 -1
- package/src/components/ui/select.js +3 -2
- package/src/components/ui/textarea.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +7 -3
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +0 -17
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -290
- package/src/components/DropdownButton/DropdownButtonItem.d.ts +0 -12
- package/src/components/DropdownButton/DropdownButtonItem.js +0 -1
- package/src/components/DropdownButton/renderItem.d.ts +0 -14
- package/src/components/DropdownButton/renderItem.js +0 -11
- package/src/components/DropdownButton/useExpanded.d.ts +0 -24
- package/src/components/DropdownButton/useExpanded.js +0 -56
- package/src/components/NewDropdownButton/index.d.ts +0 -27
- package/src/components/NewDropdownButton/index.js +0 -24
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CellDataChangedInfo } from '../../AdaptableState/Common/CellDataChangedInfo';
|
|
3
|
-
export interface DataChangeHistoryData {
|
|
4
|
-
primaryKey: string;
|
|
5
|
-
changeKey: string;
|
|
6
|
-
changeTriggerLabel: string;
|
|
7
|
-
changedColumnLabel: string;
|
|
8
|
-
changeInfo: CellDataChangedInfo;
|
|
9
|
-
}
|
|
10
|
-
export interface DataChangeHistoryGridProps {
|
|
11
|
-
adaptableContainerId: string;
|
|
12
|
-
agGridContainerId: string;
|
|
13
|
-
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
14
|
-
onUndoChange: (changeKey: string) => void;
|
|
15
|
-
onClearRow: (changeKey: string) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const DataChangeHistoryGrid: (props: DataChangeHistoryGridProps) => React.JSX.Element;
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { useAdaptable } from '../AdaptableContext';
|
|
4
|
-
import usePrevious from '../../components/utils/usePrevious';
|
|
5
|
-
import { ACCESS_LEVEL_HIDDEN } from '../../Utilities/Constants/GeneralConstants';
|
|
6
|
-
import { DataChangeHistoryModuleId } from '../../Utilities/Constants/ModuleConstants';
|
|
7
|
-
import { buildActionColumnButton } from './buildActionColumnButton';
|
|
8
|
-
import { AdaptableAgGrid } from '../../agGrid/AdaptableAgGrid';
|
|
9
|
-
export const DataChangeHistoryGrid = (props) => {
|
|
10
|
-
const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange, onClearRow } = props;
|
|
11
|
-
const mainAdaptableInstance = useAdaptable();
|
|
12
|
-
const [_adaptableApi, setAdaptableApi] = useState(null);
|
|
13
|
-
const adaptableApiRef = useRef(null);
|
|
14
|
-
adaptableApiRef.current = _adaptableApi;
|
|
15
|
-
const undoChangeEnabled = mainAdaptableInstance.api.entitlementApi.isModuleFullEntitlement(DataChangeHistoryModuleId);
|
|
16
|
-
const previousChangeHistoryLog = usePrevious(changeHistoryLog, changeHistoryLog);
|
|
17
|
-
// initialize Adaptable grid
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const initializeAdaptableGrid = async () => {
|
|
20
|
-
const gridOptions = buildGridOptions(mainAdaptableInstance, changeHistoryLog);
|
|
21
|
-
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange, onClearRow);
|
|
22
|
-
const modules = mainAdaptableInstance.agGridModulesAdapter.getAgGridRegisteredModules();
|
|
23
|
-
const dataChangeHistoryAdaptableApi = await AdaptableAgGrid._initInternal({
|
|
24
|
-
variant: 'vanilla',
|
|
25
|
-
adaptableOptions,
|
|
26
|
-
gridOptions,
|
|
27
|
-
modules,
|
|
28
|
-
});
|
|
29
|
-
setAdaptableApi(dataChangeHistoryAdaptableApi);
|
|
30
|
-
};
|
|
31
|
-
initializeAdaptableGrid();
|
|
32
|
-
return () => {
|
|
33
|
-
requestAnimationFrame(() => {
|
|
34
|
-
adaptableApiRef.current?.internalApi
|
|
35
|
-
.getAdaptableInstance()
|
|
36
|
-
.destroy({ unmount: true, destroyAgGrid: true });
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
// update row data
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
const adaptableApi = adaptableApiRef.current;
|
|
43
|
-
if (!adaptableApi) {
|
|
44
|
-
// initial render
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const addedChangeKeys = Object.keys(changeHistoryLog).filter((newChangeKey) => {
|
|
48
|
-
const previousChangeWithSameKey = previousChangeHistoryLog[newChangeKey];
|
|
49
|
-
if (!previousChangeWithSameKey) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
const addedChange = changeHistoryLog[newChangeKey];
|
|
53
|
-
return addedChange.changedAt !== previousChangeWithSameKey.changedAt;
|
|
54
|
-
});
|
|
55
|
-
const removedChangeKeys = Object.keys(previousChangeHistoryLog).filter((previousChangeKey) => {
|
|
56
|
-
const newChangeWithSameKey = changeHistoryLog[previousChangeKey];
|
|
57
|
-
if (!newChangeWithSameKey) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
const previousChange = previousChangeHistoryLog[previousChangeKey];
|
|
61
|
-
return previousChange.changedAt !== newChangeWithSameKey.changedAt;
|
|
62
|
-
});
|
|
63
|
-
const addedChangeHistoryLogs = filterChangeHistoryLog(changeHistoryLog, addedChangeKeys);
|
|
64
|
-
const removedChangeHistoryLogs = filterChangeHistoryLog(previousChangeHistoryLog, removedChangeKeys);
|
|
65
|
-
// here we access directly the AG Grid API, but this is OK because:
|
|
66
|
-
// 1. this method (gridAPi.applyTransaction() is NOT accessible otherwise and making it public opens other cans of worms
|
|
67
|
-
// 2. this UI will be reimplemented with Infinite Table anyway
|
|
68
|
-
const addedRows = mapChangeHistoryRowData(addedChangeHistoryLogs, mainAdaptableInstance);
|
|
69
|
-
const removedRows = mapChangeHistoryRowData(removedChangeHistoryLogs, mainAdaptableInstance);
|
|
70
|
-
adaptableApi.agGridApi.applyTransactionAsync({
|
|
71
|
-
add: addedRows,
|
|
72
|
-
remove: removedRows,
|
|
73
|
-
});
|
|
74
|
-
}, [changeHistoryLog]);
|
|
75
|
-
return _jsx(_Fragment, {});
|
|
76
|
-
};
|
|
77
|
-
const buildAdaptableOptions = (mainAdaptableInstance, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange, onClearRow) => {
|
|
78
|
-
const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
|
|
79
|
-
const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
|
|
80
|
-
const undoRowNode = (rowNode) => {
|
|
81
|
-
const rowData = rowNode?.data;
|
|
82
|
-
const changeKey = rowData?.['changeKey'];
|
|
83
|
-
changeKey && onUndoChange(changeKey);
|
|
84
|
-
};
|
|
85
|
-
const clearRow = (rowNode) => {
|
|
86
|
-
const rowData = rowNode?.data;
|
|
87
|
-
const changeKey = rowData?.['changeKey'];
|
|
88
|
-
changeKey && onClearRow(changeKey);
|
|
89
|
-
};
|
|
90
|
-
const actionColumnButton = buildActionColumnButton(mainAdaptableInstance.adaptableOptions?.dataChangeHistoryOptions, mainAdaptableInstance.api, undoRowNode, clearRow);
|
|
91
|
-
let actionColumnOptions = undefined;
|
|
92
|
-
if (actionColumnButton) {
|
|
93
|
-
actionColumnOptions = {
|
|
94
|
-
actionColumns: [
|
|
95
|
-
{
|
|
96
|
-
columnId: 'undoActionColumn',
|
|
97
|
-
friendlyName: ' ',
|
|
98
|
-
rowScope: {
|
|
99
|
-
ExcludeGroupRows: true,
|
|
100
|
-
ExcludeSummaryRows: true,
|
|
101
|
-
ExcludeTotalRows: true,
|
|
102
|
-
},
|
|
103
|
-
actionColumnSettings: { suppressMenu: true, suppressMovable: true },
|
|
104
|
-
actionColumnButton,
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
const options = {
|
|
110
|
-
primaryKey: 'primaryKey',
|
|
111
|
-
licenseKey: mainAdaptableOptions.licenseKey,
|
|
112
|
-
userName: `${mainAdaptableOptions.userName}`,
|
|
113
|
-
adaptableId: `${mainAdaptableOptions.adaptableId}::DataChangeHistory`,
|
|
114
|
-
containerOptions: {
|
|
115
|
-
adaptableContainer: adaptableContainerId,
|
|
116
|
-
agGridContainer: agGridContainerId,
|
|
117
|
-
},
|
|
118
|
-
entitlementOptions: {
|
|
119
|
-
defaultAccessLevel: ACCESS_LEVEL_HIDDEN,
|
|
120
|
-
},
|
|
121
|
-
actionColumnOptions: actionColumnOptions,
|
|
122
|
-
initialState: {
|
|
123
|
-
Layout: {
|
|
124
|
-
Revision: Date.now(),
|
|
125
|
-
CurrentLayout: 'DataChangeHistoryLayout',
|
|
126
|
-
Layouts: [
|
|
127
|
-
{
|
|
128
|
-
Name: 'DataChangeHistoryLayout',
|
|
129
|
-
TableColumns: [
|
|
130
|
-
'changeInfo.primaryKeyValue',
|
|
131
|
-
'changedColumnLabel',
|
|
132
|
-
'changeInfo.oldValue',
|
|
133
|
-
'changeInfo.newValue',
|
|
134
|
-
'changeInfo.changedAt',
|
|
135
|
-
'changeTriggerLabel',
|
|
136
|
-
'undoActionColumn',
|
|
137
|
-
],
|
|
138
|
-
ColumnSorts: [
|
|
139
|
-
{
|
|
140
|
-
ColumnId: 'changeInfo.changedAt',
|
|
141
|
-
SortOrder: 'Desc',
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
ColumnSizing: {
|
|
145
|
-
'changeInfo.primaryKeyValue': { Flex: 3 },
|
|
146
|
-
changedColumnLabel: { Flex: 3 },
|
|
147
|
-
'changeInfo.oldValue': { Flex: 3 },
|
|
148
|
-
'changeInfo.newValue': { Flex: 3 },
|
|
149
|
-
'changeInfo.changedAt': { Flex: 3 },
|
|
150
|
-
changeTriggerLabel: { Flex: 2 },
|
|
151
|
-
undoActionColumn: { Width: 110 },
|
|
152
|
-
},
|
|
153
|
-
ColumnPinning: {
|
|
154
|
-
undoActionColumn: 'right',
|
|
155
|
-
},
|
|
156
|
-
AutoSizeColumns: true,
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
FormatColumn: {
|
|
161
|
-
Revision: Date.now(),
|
|
162
|
-
FormatColumns: [
|
|
163
|
-
{
|
|
164
|
-
Name: 'Changed At',
|
|
165
|
-
Scope: {
|
|
166
|
-
ColumnIds: ['changeInfo.changedAt'],
|
|
167
|
-
},
|
|
168
|
-
DisplayFormat: {
|
|
169
|
-
Formatter: 'DateFormatter',
|
|
170
|
-
Options: {
|
|
171
|
-
Pattern: `${mainAdaptableOptions.userInterfaceOptions?.dateInputOptions?.dateFormat} HH:mm:ss`,
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
Theme: {
|
|
178
|
-
Revision: Date.now(),
|
|
179
|
-
CurrentTheme: mainAdaptableTheme,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
if (!undoChangeEnabled) {
|
|
184
|
-
const layoutColumns = options.initialState.Layout.Layouts[0].TableColumns;
|
|
185
|
-
if (layoutColumns.includes('undoActionColumn')) {
|
|
186
|
-
// remove action column from layout
|
|
187
|
-
options.initialState.Layout.Layouts[0].TableColumns = layoutColumns.filter((columnId) => columnId !== 'undoActionColumn');
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return options;
|
|
191
|
-
};
|
|
192
|
-
const buildGridOptions = (mainAdaptableInstance, changeHistoryLog) => {
|
|
193
|
-
const mainPrimaryKeyColumnHeader = mainAdaptableInstance.api.columnApi.getPrimaryKeyColumn()?.friendlyName ?? 'Row ID';
|
|
194
|
-
const options = {
|
|
195
|
-
loading: false,
|
|
196
|
-
overlayNoRowsTemplate: '<div style="font-size: var(--ab-font-size-2);color: var(--ab-color-primary-foreground);">No Data Changes</div>',
|
|
197
|
-
defaultColDef: {
|
|
198
|
-
floatingFilter: true,
|
|
199
|
-
filter: true,
|
|
200
|
-
sortable: true,
|
|
201
|
-
resizable: true,
|
|
202
|
-
enableRowGroup: true,
|
|
203
|
-
editable: false,
|
|
204
|
-
enablePivot: false,
|
|
205
|
-
enableValue: false,
|
|
206
|
-
lockPinned: true,
|
|
207
|
-
// default set to true to pass this to the action column
|
|
208
|
-
suppressAutoSize: true,
|
|
209
|
-
menuTabs: ['generalMenuTab', 'filterMenuTab'],
|
|
210
|
-
},
|
|
211
|
-
autoGroupColumnDef: {
|
|
212
|
-
sortable: true,
|
|
213
|
-
},
|
|
214
|
-
columnDefs: [
|
|
215
|
-
{
|
|
216
|
-
field: 'primaryKey',
|
|
217
|
-
cellDataType: 'text',
|
|
218
|
-
hide: true,
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
headerName: `Row (${mainPrimaryKeyColumnHeader})`,
|
|
222
|
-
field: 'changeInfo.primaryKeyValue',
|
|
223
|
-
cellDataType: 'text',
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
headerName: 'Column',
|
|
227
|
-
field: 'changedColumnLabel',
|
|
228
|
-
cellDataType: 'text',
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
headerName: 'Previous',
|
|
232
|
-
field: 'changeInfo.oldValue',
|
|
233
|
-
cellDataType: 'text',
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
headerName: 'New',
|
|
237
|
-
field: 'changeInfo.newValue',
|
|
238
|
-
cellDataType: 'text',
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
headerName: 'Changed',
|
|
242
|
-
field: 'changeInfo.changedAt',
|
|
243
|
-
cellDataType: 'date',
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
headerName: 'Source',
|
|
247
|
-
field: 'changeTriggerLabel',
|
|
248
|
-
cellDataType: 'text',
|
|
249
|
-
},
|
|
250
|
-
],
|
|
251
|
-
rowData: mapChangeHistoryRowData(changeHistoryLog, mainAdaptableInstance),
|
|
252
|
-
cellSelection: true,
|
|
253
|
-
suppressColumnVirtualisation: false,
|
|
254
|
-
sideBar: false,
|
|
255
|
-
rowSelection: {
|
|
256
|
-
mode: 'multiRow',
|
|
257
|
-
},
|
|
258
|
-
skipHeaderOnAutoSize: true,
|
|
259
|
-
};
|
|
260
|
-
return options;
|
|
261
|
-
};
|
|
262
|
-
const mapChangeHistoryRowData = (changeHistoryLog = {}, mainAdaptableInstance) => {
|
|
263
|
-
return Object.entries(changeHistoryLog).map(([changeKey, changeInfo]) => {
|
|
264
|
-
return {
|
|
265
|
-
primaryKey: `${changeKey}::${changeInfo.changedAt}`,
|
|
266
|
-
changeKey,
|
|
267
|
-
changeTriggerLabel: getChangeTriggerLabel(changeInfo),
|
|
268
|
-
changedColumnLabel: getColumnHeaderLabel(changeInfo.column.columnId, mainAdaptableInstance),
|
|
269
|
-
changeInfo,
|
|
270
|
-
};
|
|
271
|
-
});
|
|
272
|
-
};
|
|
273
|
-
// memoize headers to avoid unnecessary main grid lookups
|
|
274
|
-
const headerMap = new Map();
|
|
275
|
-
const getColumnHeaderLabel = (columnId, mainAdaptableInstance) => {
|
|
276
|
-
if (!headerMap.has(columnId)) {
|
|
277
|
-
headerMap.set(columnId, mainAdaptableInstance.api.columnApi.getColumnWithColumnId(columnId)?.friendlyName ?? columnId);
|
|
278
|
-
}
|
|
279
|
-
return headerMap.get(columnId);
|
|
280
|
-
};
|
|
281
|
-
const getChangeTriggerLabel = (changeInfo) => {
|
|
282
|
-
return changeInfo.trigger === 'tick' ? 'Ticking' : 'User Edit';
|
|
283
|
-
};
|
|
284
|
-
const filterChangeHistoryLog = (changeObject, filterValues) => {
|
|
285
|
-
const result = {};
|
|
286
|
-
filterValues.forEach((allowedKey) => {
|
|
287
|
-
result[allowedKey] = changeObject[allowedKey];
|
|
288
|
-
});
|
|
289
|
-
return result;
|
|
290
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
type DropdownButtonItem = {
|
|
3
|
-
onClick?: (e: React.SyntheticEvent, item: DropdownButtonItem) => any;
|
|
4
|
-
onChange?: (e: React.SyntheticEvent, item: DropdownButtonItem) => any;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
clickable?: boolean;
|
|
7
|
-
label?: ReactNode;
|
|
8
|
-
icon?: ReactNode;
|
|
9
|
-
separator?: boolean;
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
12
|
-
export default DropdownButtonItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import DropdownButtonItem from './DropdownButtonItem';
|
|
3
|
-
type Params = {
|
|
4
|
-
item: DropdownButtonItem;
|
|
5
|
-
index: number;
|
|
6
|
-
columns: string[];
|
|
7
|
-
style: React.CSSProperties;
|
|
8
|
-
className: string;
|
|
9
|
-
idProperty?: string;
|
|
10
|
-
onItemClick?: (...args: any[]) => void;
|
|
11
|
-
domProps?: any;
|
|
12
|
-
};
|
|
13
|
-
declare const _default: ({ domProps, item, onItemClick, index, columns, className, idProperty, style, }: Params) => React.JSX.Element;
|
|
14
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import isPlainObject from '../../Utilities/utils/isPlainObject';
|
|
3
|
-
export default ({ domProps, item, onItemClick, index, columns, className, idProperty, style, }) => {
|
|
4
|
-
const key = item[idProperty] || index;
|
|
5
|
-
if (!isPlainObject(item)) {
|
|
6
|
-
return (_jsx("tr", { onClick: onItemClick, className: className, ...domProps, children: _jsx("td", { colSpan: columns.length, style: style, children: item }) }, key));
|
|
7
|
-
}
|
|
8
|
-
return (_jsx("tr", { onClick: onItemClick, className: className, ...domProps, children: columns.map((col) => {
|
|
9
|
-
return (_jsx("td", { style: style, children: item[col] }, col));
|
|
10
|
-
}) }, key));
|
|
11
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { ConstrainToType } from '../OverlayTrigger';
|
|
3
|
-
export interface PositionInfo {
|
|
4
|
-
verticalPosition: 'top' | 'bottom';
|
|
5
|
-
horizontalPosition: 'left' | 'right';
|
|
6
|
-
maxHeight: number | string;
|
|
7
|
-
maxWidth: number | string;
|
|
8
|
-
}
|
|
9
|
-
export type ExpandedProps = {
|
|
10
|
-
expanded?: boolean;
|
|
11
|
-
constrainTo?: ConstrainToType;
|
|
12
|
-
defaultExpanded?: boolean;
|
|
13
|
-
onExpand?: () => void;
|
|
14
|
-
onCollapse?: () => void;
|
|
15
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
16
|
-
onToggle?: (expanded: boolean) => void;
|
|
17
|
-
};
|
|
18
|
-
declare const _default: (props: ExpandedProps, positionerRef: RefObject<HTMLDivElement>) => {
|
|
19
|
-
expanded: boolean;
|
|
20
|
-
setExpanded: (newExpanded: boolean) => void;
|
|
21
|
-
toggle: () => void;
|
|
22
|
-
positionInfo: PositionInfo;
|
|
23
|
-
};
|
|
24
|
-
export default _default;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import useProperty from '../utils/useProperty';
|
|
3
|
-
import getAvailableSizeInfo from '../utils/getAvailableSizeInfo';
|
|
4
|
-
import { getConstrainRect } from '../OverlayTrigger';
|
|
5
|
-
export default (props, positionerRef) => {
|
|
6
|
-
const positionInfoRef = useRef({
|
|
7
|
-
maxHeight: '50vh',
|
|
8
|
-
maxWidth: '50vw',
|
|
9
|
-
verticalPosition: 'bottom',
|
|
10
|
-
horizontalPosition: 'right',
|
|
11
|
-
});
|
|
12
|
-
const updatePosition = () => {
|
|
13
|
-
const positionRect = positionerRef.current.getBoundingClientRect();
|
|
14
|
-
positionInfoRef.current = getAvailableSizeInfo({
|
|
15
|
-
constrainRect: getConstrainRect(positionerRef.current, props.constrainTo),
|
|
16
|
-
targetRect: positionRect,
|
|
17
|
-
maxSizeOffset: 30,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const [expanded, doSetExpanded] = useProperty(props, 'expanded', false, {
|
|
21
|
-
onChange: (expanded) => {
|
|
22
|
-
if (expanded) {
|
|
23
|
-
if (props.onExpand) {
|
|
24
|
-
props.onExpand();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else if (props.onCollapse) {
|
|
28
|
-
props.onCollapse();
|
|
29
|
-
}
|
|
30
|
-
if (props.onToggle) {
|
|
31
|
-
props.onToggle(expanded);
|
|
32
|
-
}
|
|
33
|
-
if (props.onExpandedChange) {
|
|
34
|
-
props.onExpandedChange(expanded);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const setExpanded = (newExpanded) => {
|
|
39
|
-
// if (!newExpanded) {
|
|
40
|
-
// return;
|
|
41
|
-
// }
|
|
42
|
-
if (!expanded && newExpanded) {
|
|
43
|
-
updatePosition();
|
|
44
|
-
}
|
|
45
|
-
doSetExpanded(newExpanded);
|
|
46
|
-
};
|
|
47
|
-
const toggle = () => {
|
|
48
|
-
setExpanded(!expanded);
|
|
49
|
-
};
|
|
50
|
-
return {
|
|
51
|
-
expanded,
|
|
52
|
-
setExpanded,
|
|
53
|
-
toggle,
|
|
54
|
-
positionInfo: positionInfoRef.current,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AccessLevel } from '../../AdaptableState/Common/Entitlement';
|
|
3
|
-
import { SimpleButtonProps } from '../SimpleButton';
|
|
4
|
-
export type NewDropdownButtonItem = {
|
|
5
|
-
label: React.ReactNode;
|
|
6
|
-
onClick?: (e?: React.SyntheticEvent) => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
dataName?: string;
|
|
9
|
-
separator?: boolean;
|
|
10
|
-
icon?: React.ReactNode;
|
|
11
|
-
};
|
|
12
|
-
export type NewDropdownButtonProps = {
|
|
13
|
-
items: NewDropdownButtonItem[];
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
className?: string;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
tooltip?: string;
|
|
18
|
-
variant?: SimpleButtonProps['variant'];
|
|
19
|
-
size?: SimpleButtonProps['size'];
|
|
20
|
-
accessLevel?: AccessLevel;
|
|
21
|
-
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
22
|
-
align?: 'start' | 'center' | 'end';
|
|
23
|
-
'data-name'?: string;
|
|
24
|
-
tone?: SimpleButtonProps['tone'];
|
|
25
|
-
showDivider?: boolean;
|
|
26
|
-
};
|
|
27
|
-
export declare const NewDropdownButton: React.ForwardRefExoticComponent<NewDropdownButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../ui/dropdown-menu';
|
|
4
|
-
import { NewTooltip } from '../NewTooltip';
|
|
5
|
-
import { cn } from '../../lib/utils';
|
|
6
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
7
|
-
import SimpleButton from '../SimpleButton';
|
|
8
|
-
export const NewDropdownButton = React.forwardRef((props, ref) => {
|
|
9
|
-
const { items, children, className, disabled, tooltip, variant = 'text', accessLevel, side = 'bottom', align = 'start', 'data-name': dataName, tone = 'neutral', showDivider = true, } = props;
|
|
10
|
-
const isHidden = accessLevel === 'Hidden';
|
|
11
|
-
const isReadOnly = accessLevel === 'ReadOnly';
|
|
12
|
-
const isDisabled = disabled || isHidden || isReadOnly;
|
|
13
|
-
const trigger = (_jsxs(DropdownMenuTrigger, { render: _jsx(SimpleButton, { ref: ref, tone: tone, variant: variant, disabled: isDisabled, className: cn(className, 'twa:pr-1 twa:active:translate-y-0 twa:flex-row twa:flex-none', variant !== 'text' ? 'twa:gap-1' : 'twa:gap-0.5'), "data-name": dataName }), children: [children, showDivider && (_jsx("div", { className: cn('twa:h-full twa:my-1', variant !== 'text' ? 'twa:border-l twa:border-border' : '') })), _jsx(ChevronDownIcon, { className: "twa:size-3.5 twa:opacity-60 twa:transition-transform twa:duration-200 twa:[[data-popup-open]_&]:rotate-180" })] }));
|
|
14
|
-
const maxLabelLength = items.reduce((max, item) => Math.max(max, typeof item.label === 'string' ? item.label.length : 0), 0);
|
|
15
|
-
return (_jsxs(DropdownMenu, { children: [tooltip ? _jsx(NewTooltip, { label: tooltip, children: trigger }) : trigger, _jsx(DropdownMenuContent, { side: side, align: align, style: {
|
|
16
|
-
// minWidth: `min(max(${maxLabelLength + 5}ch, calc(var(--ab-base-space) * 32)),80vw)`,
|
|
17
|
-
width: `max(${maxLabelLength + 3}ch, calc(var(--ab-base-space) * 20), var(--anchor-width))`,
|
|
18
|
-
}, children: items.map((item, index) => {
|
|
19
|
-
if (item.separator) {
|
|
20
|
-
return _jsx(DropdownMenuSeparator, {}, index);
|
|
21
|
-
}
|
|
22
|
-
return (_jsxs(DropdownMenuItem, { disabled: item.disabled, "data-name": item.dataName, onClick: (e) => item.onClick?.(e), children: [item.icon, item.label] }, item.dataName ?? index));
|
|
23
|
-
}) })] }));
|
|
24
|
-
});
|