@adaptabletools/adaptable 23.0.0-canary.7 → 23.0.0-canary.9
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/index.css +98 -17
- package/package.json +1 -1
- package/src/{Utilities → AdaptableState/Aggregations}/weightedAverage.js +1 -1
- package/src/AdaptableState/Common/Enums.d.ts +0 -12
- package/src/AdaptableState/Common/Enums.js +0 -15
- package/src/{Utilities → AdaptableState/Common}/MenuItem.d.ts +4 -4
- package/src/{Utilities → AdaptableState/Common}/MenuItem.js +1 -1
- package/src/AdaptableState/StyledColumnState.d.ts +8 -850
- package/src/AdaptableState/StyledColumnState.js +1 -9
- package/src/AdaptableState/StyledColumns/BadgeStyle.d.ts +143 -0
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +9 -0
- package/src/AdaptableState/StyledColumns/BulletChartStyle.d.ts +147 -0
- package/src/AdaptableState/StyledColumns/BulletChartStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.d.ts +84 -0
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.js +5 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.d.ts +13 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +6 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.d.ts +79 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +9 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +48 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/IconStyle.d.ts +158 -0
- package/src/AdaptableState/StyledColumns/IconStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.d.ts +32 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.d.ts +155 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.d.ts +111 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.d.ts +21 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.js +1 -0
- package/src/Api/ColumnScopeApi.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +1 -1
- package/src/Api/Implementation/ChartingApiImpl.js +1 -1
- package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ExportApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutHelpers.js +1 -1
- package/src/Api/Implementation/QuickSearchApiImpl.js +1 -1
- package/src/Api/Implementation/ThemeApiImpl.js +1 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +1 -1
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/ChartingInternalApi.js +1 -1
- package/src/Api/Internal/ColumnInternalApi.js +1 -1
- package/src/Api/Internal/EventInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.js +1 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +3 -1
- package/src/Api/Internal/StyledColumnInternalApi.js +1 -1
- package/src/Redux/ActionsReducers/ExportRedux.js +1 -1
- package/src/Redux/ActionsReducers/InternalRedux.js +1 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +2 -4
- package/src/Redux/Store/AdaptableStore.js +3 -3
- package/src/Strategy/AdaptableModuleBase.d.ts +1 -1
- package/src/Strategy/AdaptableModuleBase.js +1 -1
- package/src/Strategy/AlertModule.d.ts +1 -1
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/ChartingModule.d.ts +1 -1
- package/src/Strategy/ChartingModule.js +1 -1
- package/src/Strategy/ColumnInfoModule.d.ts +2 -2
- package/src/Strategy/CommentModule.d.ts +1 -1
- package/src/Strategy/CustomSortModule.d.ts +1 -1
- package/src/Strategy/ExportModule.js +2 -2
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +1 -1
- package/src/Strategy/NoteModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Strategy/TeamSharingModule.js +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +32 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +49 -0
- package/src/Utilities/Extensions/NumberExtensions.d.ts +21 -0
- package/src/Utilities/Extensions/NumberExtensions.js +74 -0
- package/src/Utilities/Extensions/ObjectExtensions.d.ts +44 -0
- package/src/Utilities/Extensions/ObjectExtensions.js +271 -0
- package/src/Utilities/Extensions/StringExtensions.d.ts +26 -0
- package/src/Utilities/Extensions/StringExtensions.js +44 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/Helpers/{alertFormHelper.js → AlertHelper.js} +1 -1
- package/src/Utilities/Helpers/DateHelper.js +1 -1
- package/src/Utilities/Helpers/{FormatHelper.js → DisplayFormatHelper.js} +1 -1
- package/src/Utilities/Helpers/Helper.d.ts +0 -6
- package/src/Utilities/Helpers/Helper.js +0 -35
- package/src/Utilities/Helpers/{QuickSearchStyleHelper.js → QuickSearchHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduleHelper.d.ts → Scheduling/ScheduleHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduleHelper.js → Scheduling/ScheduleHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduleJobManager.d.ts → Scheduling/ScheduleJobManager.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduleJobRunner.d.ts → Scheduling/ScheduleJobRunner.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledAlertHelper.d.ts → Scheduling/ScheduledAlertHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledAlertHelper.js → Scheduling/ScheduledAlertHelper.js} +4 -4
- package/src/Utilities/Helpers/{ScheduledJobsMiddlewareHelper.d.ts → Scheduling/ScheduledJobsMiddlewareHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledJobsMiddlewareHelper.js → Scheduling/ScheduledJobsMiddlewareHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduledReportHelper.d.ts → Scheduling/ScheduledReportHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledReportHelper.js → Scheduling/ScheduledReportHelper.js} +1 -1
- package/src/Utilities/Helpers/SettingsPanelHelper.d.ts +5 -0
- package/src/Utilities/{Defaults/DefaultSettingsPanel.js → Helpers/SettingsPanelHelper.js} +14 -0
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.d.ts +63 -0
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.js +317 -0
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.d.ts → StyledColumns/GradientStyleHelper.d.ts} +4 -2
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.js → StyledColumns/GradientStyleHelper.js} +3 -3
- package/src/Utilities/Helpers/{IconStylePresets.d.ts → StyledColumns/IconStyleHelper.d.ts} +6 -1
- package/src/Utilities/Helpers/{IconStylePresets.js → StyledColumns/IconStyleHelper.js} +15 -0
- package/src/Utilities/Helpers/{percentBarPreviewHelper.d.ts → StyledColumns/PercentBarStyleHelper.d.ts} +2 -1
- package/src/Utilities/Helpers/{percentBarPreviewHelper.js → StyledColumns/PercentBarStyleHelper.js} +7 -12
- package/src/Utilities/Helpers/{SparklineOptionsHelper.js → StyledColumns/SparklineStyleHelper.js} +1 -1
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.d.ts +52 -0
- package/src/{agGrid/cellRenderers/shouldRenderStyledColumnOnRow.js → Utilities/Helpers/StyledColumns/StyledColumnHelper.js} +64 -2
- package/src/Utilities/Helpers/TimingHelper.d.ts +34 -0
- package/src/Utilities/{utils/debounce.js → Helpers/TimingHelper.js} +23 -9
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +2 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +114 -1
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
- package/src/Utilities/Services/RowSummaryService.js +4 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +1 -1
- package/src/View/Alert/Utilities/getAlertType.js +1 -1
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +1 -1
- package/src/View/Alert/Utilities/mapAlertDefinition.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +160 -127
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +3 -3
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertWizard.js +10 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +1 -1
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +1 -1
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Comments/CommentsPopup.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +3 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +3 -2
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.d.ts +2 -0
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.js +2 -0
- package/src/View/Components/Buttons/EntityListActionButtons.js +1 -1
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -0
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +8 -8
- package/src/View/Components/ColumnFilter/ColumnFilter.js +14 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -1
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/Popups/Utilities.js +1 -1
- package/src/View/Components/RangesComponent.d.ts +4 -3
- package/src/View/Components/RangesComponent.js +3 -7
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Dashboard/CustomDashboardButton.js +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryTable.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
- package/src/View/Export/ExportSchedulesTab.js +3 -4
- package/src/View/Filter/FilterViewPanel.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +129 -103
- package/src/View/Note/NoteEditor.js +1 -1
- package/src/View/Note/NotePopup.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +36 -30
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +1 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +79 -68
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +39 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +92 -52
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.js +33 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.d.ts +23 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.d.ts +3 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +2 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +3 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +13 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +16 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +11 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +20 -60
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +3 -1
- package/src/agGrid/AdaptableAgGrid.js +6 -6
- package/src/agGrid/AgGridColumnAdapter.js +16 -14
- package/src/agGrid/AgGridExportAdapter.js +1 -1
- package/src/agGrid/AgGridMenuAdapter.js +127 -2
- package/src/agGrid/cellRenderers/BadgeRenderer.js +8 -6
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +45 -44
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +2 -1
- package/src/agGrid/cellRenderers/IconRenderer.js +15 -14
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +26 -98
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +52 -50
- package/src/agGrid/cellRenderers/RatingRenderer.js +2 -2
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/components/ColorPicker/ColorPicker.js +1 -1
- package/src/components/Datepicker/index.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/index.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +118 -19
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +27 -31
- package/src/migration/VersionUpgrade23.js +110 -29
- package/src/types.d.ts +12 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -3
- package/src/Utilities/Helpers/iconStyledColumnColumnSupport.d.ts +0 -5
- package/src/Utilities/Helpers/iconStyledColumnColumnSupport.js +0 -15
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.d.ts +0 -3
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.js +0 -15
- package/src/Utilities/Helpers/styledColumnRowKindSupport.d.ts +0 -25
- package/src/Utilities/Helpers/styledColumnRowKindSupport.js +0 -63
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +0 -4
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +0 -115
- package/src/Utilities/utils/chunk.d.ts +0 -6
- package/src/Utilities/utils/chunk.js +0 -17
- package/src/Utilities/utils/clamp.d.ts +0 -5
- package/src/Utilities/utils/clamp.js +0 -7
- package/src/Utilities/utils/cloneDeepWith.d.ts +0 -9
- package/src/Utilities/utils/cloneDeepWith.js +0 -67
- package/src/Utilities/utils/debounce.d.ts +0 -20
- package/src/Utilities/utils/flatten.d.ts +0 -5
- package/src/Utilities/utils/flatten.js +0 -7
- package/src/Utilities/utils/flattenDeep.d.ts +0 -5
- package/src/Utilities/utils/flattenDeep.js +0 -7
- package/src/Utilities/utils/get.d.ts +0 -6
- package/src/Utilities/utils/get.js +0 -35
- package/src/Utilities/utils/index.d.ts +0 -22
- package/src/Utilities/utils/index.js +0 -22
- package/src/Utilities/utils/isArray.d.ts +0 -6
- package/src/Utilities/utils/isArray.js +0 -6
- package/src/Utilities/utils/isEqual.d.ts +0 -5
- package/src/Utilities/utils/isEqual.js +0 -124
- package/src/Utilities/utils/isObject.d.ts +0 -6
- package/src/Utilities/utils/isObject.js +0 -9
- package/src/Utilities/utils/isPlainObject.d.ts +0 -6
- package/src/Utilities/utils/isPlainObject.js +0 -17
- package/src/Utilities/utils/kebabCase.d.ts +0 -5
- package/src/Utilities/utils/kebabCase.js +0 -8
- package/src/Utilities/utils/merge.d.ts +0 -11
- package/src/Utilities/utils/merge.js +0 -40
- package/src/Utilities/utils/mergeWith.d.ts +0 -7
- package/src/Utilities/utils/mergeWith.js +0 -46
- package/src/Utilities/utils/orderBy.d.ts +0 -8
- package/src/Utilities/utils/orderBy.js +0 -30
- package/src/Utilities/utils/parseInt.d.ts +0 -6
- package/src/Utilities/utils/parseInt.js +0 -9
- package/src/Utilities/utils/sentenceCase.d.ts +0 -6
- package/src/Utilities/utils/sentenceCase.js +0 -15
- package/src/Utilities/utils/startCase.d.ts +0 -5
- package/src/Utilities/utils/startCase.js +0 -11
- package/src/Utilities/utils/throttle.d.ts +0 -17
- package/src/Utilities/utils/throttle.js +0 -19
- package/src/Utilities/utils/toNumber.d.ts +0 -5
- package/src/Utilities/utils/toNumber.js +0 -39
- package/src/Utilities/utils/uniq.d.ts +0 -7
- package/src/Utilities/utils/uniq.js +0 -9
- package/src/Utilities/utils/uniqBy.d.ts +0 -8
- package/src/Utilities/utils/uniqBy.js +0 -22
- package/src/Utilities/utils/words.d.ts +0 -7
- package/src/Utilities/utils/words.js +0 -10
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +0 -19
- package/src/agGrid/buildValueAggregationMenuItem.js +0 -111
- package/src/agGrid/cellRenderers/shouldRenderStyledColumnOnRow.d.ts +0 -30
- package/src/agGrid/createAgGridIcon.d.ts +0 -10
- package/src/agGrid/createAgGridIcon.js +0 -16
- /package/src/{Utilities → AdaptableState/Aggregations}/only.d.ts +0 -0
- /package/src/{Utilities → AdaptableState/Aggregations}/only.js +0 -0
- /package/src/{Utilities → AdaptableState/Aggregations}/weightedAverage.d.ts +0 -0
- /package/src/Utilities/Helpers/{ActionColumnWidthHelper.d.ts → ActionColumnHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ActionColumnWidthHelper.js → ActionColumnHelper.js} +0 -0
- /package/src/Utilities/Helpers/{alertFormHelper.d.ts → AlertHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{chartingHelper.d.ts → ChartHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{chartingHelper.js → ChartHelper.js} +0 -0
- /package/src/Utilities/Helpers/{FormatHelper.d.ts → DisplayFormatHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{plusMinusTriggerKeys.d.ts → PlusMinusHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{plusMinusTriggerKeys.js → PlusMinusHelper.js} +0 -0
- /package/src/Utilities/Helpers/{QuickSearchStyleHelper.d.ts → QuickSearchHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ScheduleJobManager.js → Scheduling/ScheduleJobManager.js} +0 -0
- /package/src/Utilities/Helpers/{ScheduleJobRunner.js → Scheduling/ScheduleJobRunner.js} +0 -0
- /package/src/Utilities/Helpers/{SparklineOptionsHelper.d.ts → StyledColumns/SparklineStyleHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ThemeHelpers.d.ts → ThemeHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ThemeHelpers.js → ThemeHelper.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ButtonNew } from '../../Components/Buttons/ButtonNew';
|
|
3
3
|
import SimpleButton from '../../../components/SimpleButton';
|
|
4
4
|
import Input from '../../../components/Input';
|
|
@@ -8,9 +8,12 @@ import { cloneObject } from '../../../Utilities/Helpers/Helper';
|
|
|
8
8
|
import StringExtensions from '../../../Utilities/Extensions/StringExtensions';
|
|
9
9
|
import { AdaptableIconSelector } from '../../Components/AdaptableIconSelector';
|
|
10
10
|
import { Box, Flex } from '../../../components/Flex';
|
|
11
|
-
import sentenceCase from '../../../Utilities/
|
|
11
|
+
import { sentenceCase } from '../../../Utilities/Extensions/StringExtensions';
|
|
12
12
|
import { SingleSelect } from '../../../components/NewSelect';
|
|
13
|
-
import {
|
|
13
|
+
import { Tag } from '../../../components/Tag';
|
|
14
|
+
import { CollapsibleWizardCard, getWizardAccordionSectionClassName, useWizardCardAccordion, } from '../../Wizard/CollapsibleWizardCard';
|
|
15
|
+
import { cn } from '../../../lib/utils';
|
|
16
|
+
const alertButtonCardId = (index) => `alert-button-${index}`;
|
|
14
17
|
const TONE_OPTIONS = [
|
|
15
18
|
{
|
|
16
19
|
label: 'Tone: Use Alert Tone',
|
|
@@ -34,6 +37,125 @@ const AlertButtonPreview = ({ button, messageType }) => {
|
|
|
34
37
|
function renderTone(option) {
|
|
35
38
|
return (_jsxs(Flex, { flexDirection: "row", alignItems: "center", children: [_jsx(SimpleButton, { className: "twa:mr-2 twa:w-[10px] twa:h-[10px] twa:line-height-0 twa:rounded-[100%] twa:bg-current", tone: option.value, variant: "text" }), option.label] }));
|
|
36
39
|
}
|
|
40
|
+
const getButtonCommands = (button) => {
|
|
41
|
+
if (button.Command && typeof button.Command === 'string') {
|
|
42
|
+
return [button.Command];
|
|
43
|
+
}
|
|
44
|
+
if (button.Command && Array.isArray(button.Command)) {
|
|
45
|
+
return button.Command;
|
|
46
|
+
}
|
|
47
|
+
return [];
|
|
48
|
+
};
|
|
49
|
+
const AlertButtonActionTags = ({ button }) => {
|
|
50
|
+
const commands = getButtonCommands(button);
|
|
51
|
+
if (!commands.length) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return (_jsx(_Fragment, { children: commands.map((command) => (_jsx(Tag, { className: "twa:shrink-0", children: sentenceCase(command) }, command))) }));
|
|
55
|
+
};
|
|
56
|
+
const AlertButtonCardSummary = ({ button }) => {
|
|
57
|
+
const commands = getButtonCommands(button);
|
|
58
|
+
if (!commands.length) {
|
|
59
|
+
return _jsx(Tag, { children: "No actions" });
|
|
60
|
+
}
|
|
61
|
+
return (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: _jsx(AlertButtonActionTags, { button: button }) }));
|
|
62
|
+
};
|
|
63
|
+
const AlertButtonCompactSummary = ({ button }) => (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden twa:flex-wrap", children: [_jsx(Tag, { className: "twa:shrink-0", children: button.Label || 'Untitled' }), _jsx(AlertButtonActionTags, { button: button })] }));
|
|
64
|
+
const AlertButtonEditorForm = ({ button, index, alertButtons, buttonCommands, onChange, }) => {
|
|
65
|
+
const buttonStyle = button.ButtonStyle;
|
|
66
|
+
const buttonLabel = button.Label;
|
|
67
|
+
const btnCommands = getButtonCommands(button);
|
|
68
|
+
const btnUserFunctions = btnCommands.filter((command) => !buttonCommands.includes(command));
|
|
69
|
+
const setVariant = (variant) => {
|
|
70
|
+
onChange(alertButtons.map((btn, i) => {
|
|
71
|
+
if (i === index) {
|
|
72
|
+
const nextButtonStyle = { ...btn.ButtonStyle };
|
|
73
|
+
nextButtonStyle.variant = variant;
|
|
74
|
+
return {
|
|
75
|
+
...btn,
|
|
76
|
+
ButtonStyle: nextButtonStyle,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return btn;
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
const setTone = (tone) => {
|
|
83
|
+
onChange(alertButtons.map((btn, i) => {
|
|
84
|
+
if (i === index) {
|
|
85
|
+
const nextButtonStyle = { ...btn.ButtonStyle };
|
|
86
|
+
if (tone == null) {
|
|
87
|
+
delete nextButtonStyle.tone;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
nextButtonStyle.tone = tone;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
...btn,
|
|
94
|
+
ButtonStyle: nextButtonStyle,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return btn;
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
const handleCommandChange = (checked, commandName) => {
|
|
101
|
+
let commands = btnCommands;
|
|
102
|
+
if (!checked) {
|
|
103
|
+
commands = commands.filter((a) => a !== commandName);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
commands = [...commands, commandName];
|
|
107
|
+
}
|
|
108
|
+
onChange(alertButtons.map((btn, i) => {
|
|
109
|
+
if (i === index) {
|
|
110
|
+
return {
|
|
111
|
+
...btn,
|
|
112
|
+
Command: commands.length ? commands : undefined,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return btn;
|
|
116
|
+
}));
|
|
117
|
+
};
|
|
118
|
+
let iconSelector = null;
|
|
119
|
+
if (!button.icon || (button.icon && 'name' in button.icon)) {
|
|
120
|
+
iconSelector = (_jsx(AdaptableIconSelector, { value: button.icon && 'name' in button.icon ? button?.icon?.name : '', onChange: (iconName) => {
|
|
121
|
+
onChange(alertButtons.map((btn) => {
|
|
122
|
+
if (btn === button) {
|
|
123
|
+
return {
|
|
124
|
+
...btn,
|
|
125
|
+
icon: {
|
|
126
|
+
name: iconName,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return btn;
|
|
131
|
+
}));
|
|
132
|
+
} }));
|
|
133
|
+
}
|
|
134
|
+
return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Button Text" }), children: _jsx(Input, { value: buttonLabel, className: "twa:max-w-[200px]", onChange: (e) => {
|
|
135
|
+
onChange(alertButtons.map((btn, i) => {
|
|
136
|
+
if (i === index) {
|
|
137
|
+
return { ...btn, Label: e.target.value };
|
|
138
|
+
}
|
|
139
|
+
return btn;
|
|
140
|
+
}));
|
|
141
|
+
} }) }), _jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Style" }), children: _jsxs(Flex, { flexDirection: "row", className: "twa:gap-2 twa:flex-wrap", children: [_jsx(SingleSelect, { items: ['text', 'outlined', 'raised'].map((variant) => {
|
|
142
|
+
return {
|
|
143
|
+
label: StringExtensions.CapitaliseFirstLetter(variant),
|
|
144
|
+
value: variant,
|
|
145
|
+
};
|
|
146
|
+
}), renderValue: (option) => `Variant: ${option.label}`, value: buttonStyle?.variant, onValueChange: (value) => {
|
|
147
|
+
setVariant(value);
|
|
148
|
+
} }), _jsx(SingleSelect, { items: TONE_OPTIONS, onValueChange: (value) => {
|
|
149
|
+
if (value === 'text') {
|
|
150
|
+
setTone(null);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
setTone(value);
|
|
154
|
+
}, value: buttonStyle?.tone ?? 'text' })] }) }), _jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Actions" }), children: _jsxs(Flex, { flexDirection: "row", className: "twa:gap-3 twa:flex-wrap", children: [buttonCommands.map((commandName) => {
|
|
155
|
+
return (_jsx(CheckBox, { onChange: (checked) => handleCommandChange(checked, commandName), checked: button.Command === commandName ||
|
|
156
|
+
(Array.isArray(button.Command) && button.Command.includes(commandName)), children: _jsx(Box, { className: "twa:text-2", children: sentenceCase(commandName) }) }, commandName));
|
|
157
|
+
}), btnUserFunctions.length ? (_jsx(CheckBox, { checked: true, disabled: true, children: _jsxs(Box, { className: "twa:text-2", children: ["User function", btnUserFunctions.length > 1 ? 's' : '', ": ", btnUserFunctions.join(', ')] }) })) : null] }) }), iconSelector && (_jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Icon" }), children: _jsx(Box, { children: iconSelector }) }))] }));
|
|
158
|
+
};
|
|
37
159
|
export const AlertButtonsEditor = (props) => {
|
|
38
160
|
const { api, adaptableAlert } = props;
|
|
39
161
|
const onChange = (newButtons) => {
|
|
@@ -41,22 +163,14 @@ export const AlertButtonsEditor = (props) => {
|
|
|
41
163
|
};
|
|
42
164
|
const alertDefinition = adaptableAlert.alertDefinition;
|
|
43
165
|
const messageType = alertDefinition?.MessageType ?? 'Info';
|
|
44
|
-
// const rowAddedAlert =
|
|
45
|
-
// api.alertApi.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
|
|
46
166
|
const isRowRemovedAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
|
|
47
|
-
// except row change
|
|
48
167
|
const hasHighlightCell = props.alertType !== 'RowChange';
|
|
49
|
-
// all, except row removed
|
|
50
168
|
const hasHighlightRow = !isRowRemovedAlert;
|
|
51
|
-
// except row removed
|
|
52
169
|
const hasJumpToCell = props.alertType !== 'RowChange';
|
|
53
|
-
// all
|
|
54
170
|
const hasJumpToRow = !isRowRemovedAlert;
|
|
55
|
-
// all
|
|
56
171
|
const hasSuspend = true;
|
|
57
|
-
// only data change
|
|
58
172
|
const hasUndo = props.alertType === 'DataChange';
|
|
59
|
-
const
|
|
173
|
+
const alertButtons = cloneObject(props.AlertButtons || []) || [];
|
|
60
174
|
const buttonCommands = [];
|
|
61
175
|
if (hasHighlightRow) {
|
|
62
176
|
buttonCommands.push('highlight-row');
|
|
@@ -82,120 +196,39 @@ export const AlertButtonsEditor = (props) => {
|
|
|
82
196
|
buttonCommands.push(ch.name);
|
|
83
197
|
});
|
|
84
198
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
120
|
-
const setTone = (tone) => {
|
|
121
|
-
onChange(AlertButtons.map((btn, i) => {
|
|
122
|
-
if (i === index) {
|
|
123
|
-
const buttonStyle = { ...btn.ButtonStyle };
|
|
124
|
-
if (tone == null) {
|
|
125
|
-
delete buttonStyle.tone;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
buttonStyle.tone = tone;
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
...btn,
|
|
132
|
-
ButtonStyle: buttonStyle,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return btn;
|
|
136
|
-
}));
|
|
137
|
-
};
|
|
138
|
-
const handleCommandChange = (checked, commandName) => {
|
|
139
|
-
let commands = btnCommands;
|
|
140
|
-
if (!checked) {
|
|
141
|
-
// remove current Command
|
|
142
|
-
commands = commands.filter((a) => a !== commandName);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
commands = [...commands, commandName];
|
|
146
|
-
}
|
|
147
|
-
onChange(AlertButtons.map((btn, i) => {
|
|
148
|
-
if (i === index) {
|
|
149
|
-
return {
|
|
150
|
-
...btn,
|
|
151
|
-
Command: commands.length ? commands : undefined,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
return btn;
|
|
155
|
-
}));
|
|
156
|
-
};
|
|
157
|
-
let iconSelector = null;
|
|
158
|
-
if (!button.icon || (button.icon && 'name' in button.icon)) {
|
|
159
|
-
iconSelector = (_jsx(AdaptableIconSelector, { value: button.icon && 'name' in button.icon ? button?.icon?.name : '', onChange: (iconName) => {
|
|
160
|
-
onChange(AlertButtons.map((btn) => {
|
|
161
|
-
if (btn === button) {
|
|
162
|
-
return {
|
|
163
|
-
...btn,
|
|
164
|
-
icon: {
|
|
165
|
-
name: iconName,
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
return btn;
|
|
170
|
-
}));
|
|
171
|
-
} }));
|
|
172
|
-
}
|
|
173
|
-
return (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { className: "twa:justify-between twa:gap-3", children: [_jsxs(Box, { className: "twa:font-medium twa:shrink-0", children: ["Button ", index + 1] }), _jsx(Flex, { justifyContent: "center", className: "twa:flex-1 twa:min-w-0", children: _jsx(AlertButtonPreview, { button: button, messageType: messageType }) }), _jsx(SimpleButton, { icon: "close", tone: "error", disabled: AlertButtons.length <= 1, variant: "text", tooltip: AlertButtons.length <= 1 ? 'Cannot remove last button' : 'Remove button', onClick: () => {
|
|
174
|
-
onChange(AlertButtons.filter((btn) => btn !== button));
|
|
175
|
-
} })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { children: [_jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Button Text" }), children: _jsx(Input, { value: buttonLabel, className: "twa:max-w-[200px]", onChange: (e) => {
|
|
176
|
-
onChange(AlertButtons.map((btn, i) => {
|
|
177
|
-
if (i === index) {
|
|
178
|
-
return { ...btn, Label: e.target.value };
|
|
179
|
-
}
|
|
180
|
-
return btn;
|
|
181
|
-
}));
|
|
182
|
-
} }) }), _jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Style" }), children: _jsxs(Flex, { flexDirection: "row", className: "twa:gap-2 twa:flex-wrap", children: [_jsx(SingleSelect, { items: ['text', 'outlined', 'raised'].map((variant) => {
|
|
183
|
-
return {
|
|
184
|
-
label: StringExtensions.CapitaliseFirstLetter(variant),
|
|
185
|
-
value: variant,
|
|
186
|
-
};
|
|
187
|
-
}), renderValue: (option) => `Variant: ${option.label}`, value: buttonStyle?.variant, onValueChange: (value) => {
|
|
188
|
-
setVariant(value);
|
|
189
|
-
} }), _jsx(SingleSelect, { items: TONE_OPTIONS, onValueChange: (value) => {
|
|
190
|
-
if (value === 'text') {
|
|
191
|
-
setTone(null);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
setTone(value);
|
|
195
|
-
}, value: buttonStyle?.tone ?? 'text' })] }) }), _jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Actions" }), children: _jsxs(Flex, { flexDirection: "row", className: "twa:gap-3 twa:flex-wrap", children: [buttonCommands.map((commandName) => {
|
|
196
|
-
return (_jsx(CheckBox, { onChange: (checked) => handleCommandChange(checked, commandName), checked: button.Command === commandName ||
|
|
197
|
-
(Array.isArray(button.Command) &&
|
|
198
|
-
button.Command.includes(commandName)), children: _jsx(Box, { className: "twa:text-2", children: sentenceCase(commandName) }) }, commandName));
|
|
199
|
-
}), btnUserFunctions.length ? (_jsx(CheckBox, { checked: true, disabled: true, children: _jsxs(Box, { className: "twa:text-2", children: ["User function", btnUserFunctions.length > 1 ? 's' : '', ":", ' ', btnUserFunctions.join(', ')] }) })) : null] }) }), iconSelector && (_jsx(FormRow, { label: _jsx(Box, { className: "twa:text-2", children: "Icon" }), children: _jsx(Box, { children: iconSelector }) }))] }) })] }, index));
|
|
199
|
+
const { bindCard, hasExpandedCard, expandedFillsSpace, expandedId, setExpandedId } = useWizardCardAccordion(null);
|
|
200
|
+
const handleAddButton = () => {
|
|
201
|
+
const newIndex = alertButtons.length;
|
|
202
|
+
onChange([
|
|
203
|
+
...(alertButtons || []),
|
|
204
|
+
{
|
|
205
|
+
Label: 'OK',
|
|
206
|
+
ButtonStyle: {
|
|
207
|
+
variant: 'raised',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
]);
|
|
211
|
+
setExpandedId(alertButtonCardId(newIndex));
|
|
212
|
+
};
|
|
213
|
+
const handleDeleteButton = (index) => {
|
|
214
|
+
if (alertButtons.length <= 1) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const cardId = alertButtonCardId(index);
|
|
218
|
+
onChange(alertButtons.filter((_, i) => i !== index));
|
|
219
|
+
if (expandedId === cardId) {
|
|
220
|
+
setExpandedId(null);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (expandedId?.startsWith('alert-button-')) {
|
|
224
|
+
const expandedIndex = Number(expandedId.replace('alert-button-', ''));
|
|
225
|
+
if (!Number.isNaN(expandedIndex) && expandedIndex > index) {
|
|
226
|
+
setExpandedId(alertButtonCardId(expandedIndex - 1));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
return (_jsxs(Box, { className: cn(getWizardAccordionSectionClassName(hasExpandedCard, expandedFillsSpace), 'twa:mt-3'), children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between", className: "twa:mb-2 twa:shrink-0", children: [_jsx(Box, { className: "twa:text-2 twa:max-w-[520px]", children: "Add buttons to the notification and set actions to perform when clicked" }), _jsx(ButtonNew, { onClick: handleAddButton, children: "Add" })] }), _jsx(Flex, { flexDirection: "column", className: "twa:gap-3 twa:min-h-0", children: alertButtons.map((button, index) => {
|
|
231
|
+
const cardBinding = bindCard(alertButtonCardId(index));
|
|
232
|
+
return (_jsx(CollapsibleWizardCard, { ...cardBinding, surface: "panel", "data-name": `alert-button-${index}`, title: `Button ${index + 1}`, help: "Set button text, style, icon, and actions", collapsedHelp: false, compactSummary: _jsx(AlertButtonCompactSummary, { button: button }), headerVisual: _jsxs(Flex, { alignItems: "center", justifyContent: "space-end", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden twa:flex-wrap", children: [_jsx(AlertButtonPreview, { button: button, messageType: messageType }), cardBinding.compact ? _jsx(AlertButtonActionTags, { button: button }) : null] }), headerActions: _jsx(SimpleButton, { icon: "delete", disabled: alertButtons.length <= 1, variant: "text", tooltip: alertButtons.length <= 1 ? 'Cannot remove last button' : 'Delete button', onClick: () => handleDeleteButton(index) }), summary: _jsx(AlertButtonCardSummary, { button: button }), bodyClassName: "twa:!pt-0", children: _jsx(AlertButtonEditorForm, { button: button, index: index, alertButtons: alertButtons, buttonCommands: buttonCommands, onChange: onChange }) }, alertButtonCardId(index)));
|
|
200
233
|
}) })] }));
|
|
201
234
|
};
|
|
@@ -6,8 +6,8 @@ import { CheckBox } from '../../../components/CheckBox';
|
|
|
6
6
|
import { AdaptablePopupAlert } from '../../Components/Popups/AdaptablePopupAlert';
|
|
7
7
|
import { AlertButtonsEditor } from './AlertButtonsEditor';
|
|
8
8
|
import { AlertType } from '../Utilities/getAlertType';
|
|
9
|
-
import { isScheduledAlertDefinition, scheduledAlertIncludeSuspendButton, } from '../../../Utilities/Helpers/ScheduledAlertHelper';
|
|
10
|
-
import { resolveAlertFormForDefinition } from '../../../Utilities/Helpers/
|
|
9
|
+
import { isScheduledAlertDefinition, scheduledAlertIncludeSuspendButton, } from '../../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
10
|
+
import { resolveAlertFormForDefinition } from '../../../Utilities/Helpers/AlertHelper';
|
|
11
11
|
import { Box, Flex } from '../../../components/Flex';
|
|
12
12
|
import { Card } from '../../../components/Card';
|
|
13
13
|
export const renderAlertNotificationSummary = (data, api) => {
|
|
@@ -133,5 +133,5 @@ export const AlertNotificationWizardSection = (props) => {
|
|
|
133
133
|
} }));
|
|
134
134
|
})()
|
|
135
135
|
: null] })] }) }), data.AlertProperties?.DisplayNotification ? (_jsx(Box, { "data-name": "alert-preview", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Alert Preview" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Preview how the notification will appear when triggered" })] }), _jsx(Card.Body, { children: !isScheduled &&
|
|
136
|
-
typeof data.AlertForm === 'string' ? (_jsx(Box, { className: "twa:text-2", children: "Preview not available because form is dynamically driven" })) : (_jsx(AlertPreview, { alertDefinition: data, api: api })) })] }) })) : null] }));
|
|
136
|
+
typeof data.AlertForm === 'string' ? (_jsx(Box, { className: "twa:text-2", children: "Preview not available because form is dynamically driven" })) : (_jsx(AlertPreview, { alertDefinition: data, api: api, focusFirstButton: false })) })] }) })) : null] }));
|
|
137
137
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isRuleBasedAlertDefinition } from '../../../Utilities/Helpers/ScheduledAlertHelper';
|
|
2
|
+
import { isRuleBasedAlertDefinition } from '../../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
3
3
|
import { EntityRulesEditor, EntityRulesSummary } from '../../Components/EntityRulesEditor';
|
|
4
4
|
import { Tag } from '../../../components/Tag';
|
|
5
5
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isScheduledAlertDefinition } from '../../../Utilities/Helpers/ScheduledAlertHelper';
|
|
2
|
+
import { isScheduledAlertDefinition } from '../../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
3
3
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
4
4
|
import { isScheduleValid, ScheduleBuilderWizard, } from '../../Schedule/Wizard/ScheduleScheduleWizard';
|
|
5
5
|
import { Tag } from '../../../components/Tag';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isRuleBasedAlertDefinition } from '../../../Utilities/Helpers/ScheduledAlertHelper';
|
|
2
|
+
import { isRuleBasedAlertDefinition } from '../../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
3
3
|
import { NewScopeComponent } from '../../Components/NewScopeComponent';
|
|
4
4
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
5
5
|
import { Box, Flex } from '../../../components/Flex';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { useState, useCallback } from 'react';
|
|
3
4
|
import { OnePageAdaptableWizard, OnePageWizardSummary } from '../../Wizard/OnePageAdaptableWizard';
|
|
4
5
|
import { cloneObject } from '../../../Utilities/Helpers/Helper';
|
|
@@ -11,7 +12,7 @@ import { AlertMessageWizardSection, renderAlertMessageSummary } from './AlertMes
|
|
|
11
12
|
import { isValidAlertMessage } from './isValidAlertMessage';
|
|
12
13
|
import { renderScopeSummary } from './BaseAlertScopeWizardSection';
|
|
13
14
|
import { isScopeValid } from '../../Components/NewScopeComponent';
|
|
14
|
-
import { isRuleBasedAlertDefinition } from '../../../Utilities/Helpers/ScheduledAlertHelper';
|
|
15
|
+
import { isRuleBasedAlertDefinition } from '../../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
15
16
|
import ObjectFactory from '../../../Utilities/ObjectFactory';
|
|
16
17
|
import { useDispatch } from 'react-redux';
|
|
17
18
|
import * as AlertRedux from '../../../Redux/ActionsReducers/AlertRedux';
|
|
@@ -77,7 +78,14 @@ export const AlertWizard = (props) => {
|
|
|
77
78
|
setAlertType(newAlertType);
|
|
78
79
|
doSetAlertDefinition(getDefaultAlertDefinition(alertDefinition, newAlertType));
|
|
79
80
|
};
|
|
80
|
-
|
|
81
|
+
const defaultEditSectionName = React.useMemo(() => {
|
|
82
|
+
if (props.defaultCurrentSectionName || !props.data) {
|
|
83
|
+
return props.defaultCurrentSectionName;
|
|
84
|
+
}
|
|
85
|
+
const type = getAlertType(props.data);
|
|
86
|
+
return type === AlertType.Scheduled ? 'Schedule' : 'Rule';
|
|
87
|
+
}, [props.defaultCurrentSectionName, props.data]);
|
|
88
|
+
return (_jsx(OnePageAdaptableWizard, { defaultCurrentSectionName: defaultEditSectionName, moduleInfo: props.moduleInfo, modal: props.modal, data: alertDefinition, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
|
|
81
89
|
{
|
|
82
90
|
title: 'Name & Type',
|
|
83
91
|
isValid: isSettingsValid,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isAdaptableRuleValid } from '../../Components/EntityRulesEditor/Utilities';
|
|
2
|
-
import { isScheduledAlertDefinition } from '../../../Utilities/Helpers/ScheduledAlertHelper';
|
|
2
|
+
import { isScheduledAlertDefinition } from '../../../Utilities/Helpers/Scheduling/ScheduledAlertHelper';
|
|
3
3
|
export const isValidAlertRules = (alert, api, context) => {
|
|
4
4
|
if (isScheduledAlertDefinition(alert)) {
|
|
5
5
|
return true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
|
-
import isEqual from '../../../../Utilities/
|
|
4
|
+
import { isEqual } from '../../../../Utilities/Extensions/ObjectExtensions';
|
|
5
5
|
import * as InternalRedux from '../../../../Redux/ActionsReducers/InternalRedux';
|
|
6
6
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
7
7
|
export const PreviewChartSection = (props) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CheckBox } from '../../../../components/CheckBox';
|
|
3
3
|
import { SingleSelect } from '../../../../components/NewSelect';
|
|
4
|
-
import { validateChartName } from '../../../../Utilities/Helpers/
|
|
4
|
+
import { validateChartName } from '../../../../Utilities/Helpers/ChartHelper';
|
|
5
5
|
import { Box, Flex } from '../../../../components/Flex';
|
|
6
6
|
import { Card } from '../../../../components/Card';
|
|
7
7
|
import Input from '../../../../components/Input';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { validateChartName } from '../../../../Utilities/Helpers/
|
|
2
|
+
import { validateChartName } from '../../../../Utilities/Helpers/ChartHelper';
|
|
3
3
|
import { Box, Flex } from '../../../../components/Flex';
|
|
4
4
|
import { Card } from '../../../../components/Card';
|
|
5
5
|
import Input from '../../../../components/Input';
|
|
@@ -8,7 +8,7 @@ import * as CommentsRedux from '../../Redux/ActionsReducers/CommentsRedux';
|
|
|
8
8
|
import { CommentsAndNotesSelector } from '../../Redux/ActionsReducers/InternalRedux';
|
|
9
9
|
import { useAdaptable } from '../AdaptableContext';
|
|
10
10
|
import AdaptableInput from '../Components/AdaptableInput';
|
|
11
|
-
import FormatHelper from '../../Utilities/Helpers/
|
|
11
|
+
import FormatHelper from '../../Utilities/Helpers/DisplayFormatHelper';
|
|
12
12
|
import { Box, Flex } from '../../components/Flex';
|
|
13
13
|
import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
|
|
14
14
|
// Edit Mode
|
|
@@ -6,7 +6,7 @@ import Panel from '../../components/Panel';
|
|
|
6
6
|
import { useAdaptable } from '../AdaptableContext';
|
|
7
7
|
import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
|
|
8
8
|
import { AdaptableButtonComponent } from '../Components/AdaptableButton';
|
|
9
|
-
import FormatHelper from '../../Utilities/Helpers/
|
|
9
|
+
import FormatHelper from '../../Utilities/Helpers/DisplayFormatHelper';
|
|
10
10
|
import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
|
|
11
11
|
import { Box, Flex } from '../../components/Flex';
|
|
12
12
|
const tableDOMProps = {
|
|
@@ -5,6 +5,7 @@ import SimpleButton from '../../../components/SimpleButton';
|
|
|
5
5
|
import { useAdaptable } from '../../AdaptableContext';
|
|
6
6
|
import { Box, Flex } from '../../../components/Flex';
|
|
7
7
|
import { TagList } from '../../../components/Tag/Tag';
|
|
8
|
+
import { objectListActionButtonClassName } from './objectListActionButtonStyles';
|
|
8
9
|
const baseClassName = 'ab-Adaptable-Object-Compact-List';
|
|
9
10
|
const ICON_SIZE = 20;
|
|
10
11
|
export const AdaptableObjectCompactListItem = (props) => {
|
|
@@ -41,7 +42,7 @@ export const AdaptableObjectCompactListItem = (props) => {
|
|
|
41
42
|
? React.createElement(objectView.item.view, {
|
|
42
43
|
data: props.abObject,
|
|
43
44
|
})
|
|
44
|
-
: objectView.item.view, Boolean(objectView.item?.values && objectView.item?.values?.length) && (_jsx(Box, { className: `${baseClassName}__Item__Values`, children: _jsx(TagList, { tags: objectView.item.values, variant: objectView.item.tagVariant }) }))] }), suspendAction && unSuspendAction && (_jsx(SimpleButton, { onMouseDown: handleSuspendUnSuspend, tone: isSuspended ? '
|
|
45
|
+
: objectView.item.view, Boolean(objectView.item?.values && objectView.item?.values?.length) && (_jsx(Box, { className: `${baseClassName}__Item__Values`, children: _jsx(TagList, { tags: objectView.item.values, variant: objectView.item.tagVariant }) }))] }), suspendAction && unSuspendAction && (_jsx(SimpleButton, { onMouseDown: handleSuspendUnSuspend, tone: "neutral", variant: "text", iconSize: ICON_SIZE, icon: isSuspended ? 'resume' : 'pause', tooltip: isSuspended ? 'Resume' : 'Suspend', className: objectListActionButtonClassName('suspend', isSuspended ? 'twa:opacity-60' : undefined) })), _jsx(Flex, { className: "twa:ml-1 twa:flex-[0_0_auto] twa:gap-1", children: deleteAction && (_jsx(SimpleButton, { iconSize: ICON_SIZE, icon: "delete", variant: "text", onMouseDown: handleDelete, accessLevel: moduleAccessLevel, className: objectListActionButtonClassName('delete') })) })] }));
|
|
45
46
|
};
|
|
46
47
|
export const AdaptableObjectCompactList = (props) => {
|
|
47
48
|
const adaptable = useAdaptable();
|
|
@@ -64,7 +65,7 @@ export const AdaptableObjectCompactList = (props) => {
|
|
|
64
65
|
dispatch(unSuspendAllAction);
|
|
65
66
|
}
|
|
66
67
|
}, [isAtLeastOneAbObjectActive]);
|
|
67
|
-
return (_jsxs(Flex, { flexDirection: "column", className: baseClassName, children: [_jsxs(Flex, { className: `${baseClassName}__Header twa:text-3`, children: [_jsx(Flex, { className: `${baseClassName}__Title`, alignItems: 'center', children: props.module.moduleInfo.FriendlyName }), _jsx(Box, { className: "twa:flex-1" }), suspendAllAction && unSuspendAllAction && (_jsx(SimpleButton, { className: "twa:mr-2", onMouseDown: handleSuspendUnsuspendAll, tone:
|
|
68
|
+
return (_jsxs(Flex, { flexDirection: "column", className: baseClassName, children: [_jsxs(Flex, { className: `${baseClassName}__Header twa:text-3`, children: [_jsx(Flex, { className: `${baseClassName}__Title`, alignItems: 'center', children: props.module.moduleInfo.FriendlyName }), _jsx(Box, { className: "twa:flex-1" }), suspendAllAction && unSuspendAllAction && (_jsx(SimpleButton, { className: "twa:mr-2", onMouseDown: handleSuspendUnsuspendAll, tone: "neutral", variant: "raised", icon: isAtLeastOneAbObjectActive ? 'pause' : 'resume', accessLevel: accessLevel, children: isAtLeastOneAbObjectActive ? 'Suspend All' : 'Resume All' })), deleteAllAction && (_jsx(SimpleButton, { onMouseDown: () => dispatch(deleteAllAction), variant: "raised", tone: "neutral", accessLevel: accessLevel, children: "Clear All" }))] }), _jsx(Box, { className: `${baseClassName}__Body`, children: props.abObjects.map((abObject) => {
|
|
68
69
|
return (_jsx(AdaptableObjectCompactListItem, { abObject: abObject, module: props.module }, abObject.Uuid));
|
|
69
70
|
}) })] }));
|
|
70
71
|
};
|
|
@@ -13,6 +13,7 @@ import { SuspendToggleButton } from '../Buttons/SuspendToggleButton/SuspendToggl
|
|
|
13
13
|
import { Box, Flex } from '../../../components/Flex';
|
|
14
14
|
import { twMerge } from '../../../twMerge';
|
|
15
15
|
import { TagList } from '../../../components/Tag/Tag';
|
|
16
|
+
import { objectListActionButtonClassName } from './objectListActionButtonStyles';
|
|
16
17
|
const ICON_SIZE = 26;
|
|
17
18
|
const LIST_BASE_CLASS_NAME = 'ab-Adaptable-Object-List';
|
|
18
19
|
const ITEM_BASE_CLASS_NAME = `${LIST_BASE_CLASS_NAME}__Item`;
|
|
@@ -35,7 +36,7 @@ export const AdaptableObjectListItemView = (props) => {
|
|
|
35
36
|
dispatch(props.deleteAction);
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
const deleteActionButton = _jsx(ButtonDelete, { ...deleteActionProps });
|
|
39
|
+
const deleteActionButton = (_jsx(ButtonDelete, { ...deleteActionProps, className: twMerge(objectListActionButtonClassName('delete'), deleteActionProps.className) }));
|
|
39
40
|
return (_jsxs(Flex, { "data-name": "adaptable-object-list-item", "data-value": props.abObject.Uuid, as: "li", className: twMerge(baseClassName, 'twa:rounded-standard', props.className), style: props.style, children: [_jsx(Box, { className: `twa:flex-1 ${baseClassName}__rows twa:gap-2 twa:flex twa:flex-col`, children: props.items.filter?.(Boolean)?.map((tag, index) => {
|
|
40
41
|
const labelElement = typeof tag.label === 'function'
|
|
41
42
|
? React.createElement(tag.label, { key: index, data: props.abObject })
|
|
@@ -53,7 +54,7 @@ export const AdaptableObjectListItemView = (props) => {
|
|
|
53
54
|
module: props.module,
|
|
54
55
|
})
|
|
55
56
|
: tag.viewAfter] })] }, `${index}-${tag.name}`));
|
|
56
|
-
}) }), props.showActions && (
|
|
57
|
+
}) }), props.showActions && (_jsx(Flex, { flexDirection: "column", className: `${baseClassName}__buttons twa:ml-3 twa:pl-3 twa:text-right twa:min-w-[80px]`, children: _jsxs(Flex, { className: "twa:justify-end twa:items-center twa:gap-1", children: [props.actions, props.teamSharingActivated && (_jsx(ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${props.entityType}`, accessLevel: props.accessLevel, onShare: props.onShare, className: objectListActionButtonClassName('share') })), props.showEditButton && (_jsx(ButtonEdit, { iconSize: ICON_SIZE, disabled: props.editDisabled, accessLevel: props.accessLevel, className: objectListActionButtonClassName('edit'), onClick: () => props.handleOnEdit() })), props.suspendedEnabled && (_jsx(SuspendToggleButton, { iconSize: ICON_SIZE, className: objectListActionButtonClassName('suspend'), onSuspend: props.onSuspend, onUnSuspend: props.onUnSuspend, suspendableObject: props.abObject, accessLevel: props.accessLevel })), props.onDelete && (_jsx(SimpleButton, { "data-name": "delete", disabled: props.deleteDisabled, iconSize: ICON_SIZE, tooltip: props.deleteTooltip, icon: "delete", onClick: props.onDelete, variant: "text", className: objectListActionButtonClassName('delete') })), props.deleteAction ? deleteActionButton : null] }) }))] }));
|
|
57
58
|
};
|
|
58
59
|
export const AdaptableObjectListItem = (props) => {
|
|
59
60
|
const adaptable = useAdaptable();
|
|
@@ -37,6 +37,6 @@ export class EntityListActionButtons extends React.Component {
|
|
|
37
37
|
'twa:justify-center': justifyContent === 'center',
|
|
38
38
|
'twa:justify-end': justifyContent === 'end',
|
|
39
39
|
}) || 'twa:justify-center';
|
|
40
|
-
return (_jsxs(Flex, { className: `${justifyContentClassName} twa:m-0 twa:p-0`, onClick: stopPropagation, children: [this.props.showEdit && (_jsx(ButtonEdit, { onClick: () => (this.props.editClick ? this.props.editClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-action-edit-foreground twa:bg-action-edit twa:fill-action-edit-foreground`, disabled: this.props.overrideDisableEdit || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipEdit, accessLevel: this.props.accessLevel })), this.props.showClone && (_jsx(ButtonClone, { onClick: () => (this.props.cloneClick ? this.props.cloneClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-action-clone-foreground twa:bg-action-clone twa:fill-action-clone-foreground`, children: null, disabled: this.props.overrideDisableClone || this.props.cloneAccessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipClone, accessLevel: this.props.cloneAccessLevel })), this.props.showDelete && (_jsx(ButtonDelete, { "data-name": "delete", className: `twa:mx-[px] twa:my-[2px] twa:text-action-delete-foreground twa:bg-action-delete twa:fill-action-delete-foreground`, disabled: this.props.overrideDisableDelete || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipDelete, ConfirmAction: this.props.confirmDeleteAction, ConfirmationMsg: 'Are you sure you want to delete this ' + this.props.entityType + '?', ConfirmationTitle: 'Delete ' + this.props.entityType, accessLevel: this.props.accessLevel })), this.props.showShare && (_jsx(ButtonShare, { className: `twa:mx-[1px] twa:my-[2px] twa:text-action-share-foreground twa:bg-action-share twa:fill-action-share-foreground`, onShare: (config) => this.props.shareClick ? this.props.shareClick(config) : null, Header: `TeamSharing ${this.props.entityType}`, disabled: this.props.overrideDisableShare || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipShare, accessLevel: this.props.accessLevel })), this.props.showSuspend && this.props.suspendableObject && (_jsx(SuspendToggleButton, { className:
|
|
40
|
+
return (_jsxs(Flex, { className: `${justifyContentClassName} twa:m-0 twa:p-0`, onClick: stopPropagation, children: [this.props.showEdit && (_jsx(ButtonEdit, { onClick: () => (this.props.editClick ? this.props.editClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-action-edit-foreground twa:bg-action-edit twa:fill-action-edit-foreground`, disabled: this.props.overrideDisableEdit || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipEdit, accessLevel: this.props.accessLevel })), this.props.showClone && (_jsx(ButtonClone, { onClick: () => (this.props.cloneClick ? this.props.cloneClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-action-clone-foreground twa:bg-action-clone twa:fill-action-clone-foreground`, children: null, disabled: this.props.overrideDisableClone || this.props.cloneAccessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipClone, accessLevel: this.props.cloneAccessLevel })), this.props.showDelete && (_jsx(ButtonDelete, { "data-name": "delete", className: `twa:mx-[px] twa:my-[2px] twa:text-action-delete-foreground twa:bg-action-delete twa:fill-action-delete-foreground`, disabled: this.props.overrideDisableDelete || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipDelete, ConfirmAction: this.props.confirmDeleteAction, ConfirmationMsg: 'Are you sure you want to delete this ' + this.props.entityType + '?', ConfirmationTitle: 'Delete ' + this.props.entityType, accessLevel: this.props.accessLevel })), this.props.showShare && (_jsx(ButtonShare, { className: `twa:mx-[1px] twa:my-[2px] twa:text-action-share-foreground twa:bg-action-share twa:fill-action-share-foreground`, onShare: (config) => this.props.shareClick ? this.props.shareClick(config) : null, Header: `TeamSharing ${this.props.entityType}`, disabled: this.props.overrideDisableShare || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipShare, accessLevel: this.props.accessLevel })), this.props.showSuspend && this.props.suspendableObject && (_jsx(SuspendToggleButton, { className: "twa:align-self-center", iconSize: 24, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend, suspendableObject: this.props.suspendableObject, disabled: this.props.accessLevel == ACCESS_LEVEL_READ_ONLY }))] }));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import SimpleButton from '../../../../components/SimpleButton';
|
|
4
4
|
import { ACCESS_LEVEL_READ_ONLY } from '../../../../Utilities/Constants/GeneralConstants';
|
|
5
5
|
import { cn } from '../../../../lib/utils';
|
|
6
|
-
export const SuspendToggleButton = React.memo(({ suspendableObject, onUnSuspend, onSuspend, style, disabled, accessLevel, className }) => {
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
export const SuspendToggleButton = React.memo(({ suspendableObject, onUnSuspend, onSuspend, style, disabled, accessLevel, className, iconSize = 26, }) => {
|
|
7
|
+
const preparedDisabled = (accessLevel && accessLevel === ACCESS_LEVEL_READ_ONLY) || disabled;
|
|
8
|
+
const isSuspended = suspendableObject.IsSuspended;
|
|
9
|
+
const handleClick = React.useCallback(() => {
|
|
10
|
+
if (isSuspended) {
|
|
9
11
|
onUnSuspend(suspendableObject);
|
|
10
12
|
}
|
|
11
13
|
else {
|
|
12
14
|
onSuspend(suspendableObject);
|
|
13
15
|
}
|
|
14
|
-
}, [onUnSuspend,
|
|
15
|
-
|
|
16
|
-
const isSuspended = suspendableObject.IsSuspended;
|
|
17
|
-
return (_jsx(ToggleButton, { className: cn(`ab-SuspendButton`, className), "data-name": suspendableObject.IsSuspended ? 'un-suspend' : 'suspend', disabled: preparedDisabled, style: style, onChange: handleOnChange, checked: !isSuspended, children: isSuspended ? 'inactive' : 'active' }));
|
|
16
|
+
}, [isSuspended, onSuspend, onUnSuspend, suspendableObject]);
|
|
17
|
+
return (_jsx(SimpleButton, { className: cn('ab-SuspendButton', isSuspended && 'twa:opacity-60', className), "data-name": isSuspended ? 'resume' : 'suspend', disabled: preparedDisabled, style: style, variant: "text", tone: "neutral", iconSize: iconSize, icon: isSuspended ? 'resume' : 'pause', tooltip: isSuspended ? 'Resume' : 'Suspend', accessLevel: accessLevel, onClick: handleClick }));
|
|
18
18
|
});
|