@pega/cosmos-react-build 8.0.0-build.9.1 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppShell.styles.d.ts +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +1 -46
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
- package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.js +4 -4
- package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
- package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
- package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
- package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/index.d.ts +3 -0
- package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/index.js +2 -0
- package/lib/components/BackgroundPicker/index.js.map +1 -0
- package/lib/components/BackgroundPicker/utils.d.ts +24 -0
- package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/utils.js +186 -0
- package/lib/components/BackgroundPicker/utils.js.map +1 -0
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
- package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
- package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.js +33 -33
- package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
- package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
- package/lib/components/Expression/Expression.d.ts +6 -0
- package/lib/components/Expression/Expression.d.ts.map +1 -0
- package/lib/components/Expression/Expression.js +36 -0
- package/lib/components/Expression/Expression.js.map +1 -0
- package/lib/components/Expression/Expression.styles.d.ts +7 -0
- package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
- package/lib/components/Expression/Expression.styles.js +47 -0
- package/lib/components/Expression/Expression.styles.js.map +1 -0
- package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
- package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
- package/lib/components/Expression/Expression.test-ids.js +8 -0
- package/lib/components/Expression/Expression.test-ids.js.map +1 -0
- package/lib/components/Expression/Expression.types.d.ts +53 -0
- package/lib/components/Expression/Expression.types.d.ts.map +1 -0
- package/lib/components/Expression/Expression.types.js +2 -0
- package/lib/components/Expression/Expression.types.js.map +1 -0
- package/lib/components/Expression/index.d.ts +3 -0
- package/lib/components/Expression/index.d.ts.map +1 -0
- package/lib/components/Expression/index.js +2 -0
- package/lib/components/Expression/index.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/index.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
- package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.js +45 -37
- package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
- package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
- package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
- package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
- package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
- package/lib/components/FieldReference/index.d.ts +2 -2
- package/lib/components/FieldReference/index.d.ts.map +1 -1
- package/lib/components/FieldReference/index.js +1 -1
- package/lib/components/FieldReference/index.js.map +1 -1
- package/lib/components/IconTile/IconTile.d.ts +7 -3
- package/lib/components/IconTile/IconTile.d.ts.map +1 -1
- package/lib/components/IconTile/IconTile.js +40 -4
- package/lib/components/IconTile/IconTile.js.map +1 -1
- package/lib/components/IconTile/IconTile.types.d.ts +17 -15
- package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
- package/lib/components/IconTile/IconTile.types.js.map +1 -1
- package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
- package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
- package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Case.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
- package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Task.js.map +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
- package/lib/components/IconTile/iconUtils.d.ts +11 -0
- package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
- package/lib/components/IconTile/iconUtils.js +41 -0
- package/lib/components/IconTile/iconUtils.js.map +1 -0
- package/lib/components/IconTile/index.d.ts +1 -0
- package/lib/components/IconTile/index.d.ts.map +1 -1
- package/lib/components/IconTile/index.js.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
- package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
- package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts +8 -6
- package/lib/components/LifeCycle/Category.d.ts.map +1 -1
- package/lib/components/LifeCycle/Category.js +53 -36
- package/lib/components/LifeCycle/Category.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
- package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.js +113 -19
- package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
- package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
- package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
- package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
- package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleList.js +20 -30
- package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
- package/lib/components/LifeCycle/Stage.d.ts +12 -7
- package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
- package/lib/components/LifeCycle/Stage.js +87 -72
- package/lib/components/LifeCycle/Stage.js.map +1 -1
- package/lib/components/LifeCycle/Step.d.ts +21 -14
- package/lib/components/LifeCycle/Step.d.ts.map +1 -1
- package/lib/components/LifeCycle/Step.js +75 -51
- package/lib/components/LifeCycle/Step.js.map +1 -1
- package/lib/components/LifeCycle/Task.d.ts +18 -7
- package/lib/components/LifeCycle/Task.d.ts.map +1 -1
- package/lib/components/LifeCycle/Task.js +119 -55
- package/lib/components/LifeCycle/Task.js.map +1 -1
- package/lib/components/LifeCycle/index.d.ts +2 -1
- package/lib/components/LifeCycle/index.d.ts.map +1 -1
- package/lib/components/LifeCycle/index.js +1 -0
- package/lib/components/LifeCycle/index.js.map +1 -1
- package/lib/components/LifeCycle/utils.d.ts +14 -0
- package/lib/components/LifeCycle/utils.d.ts.map +1 -0
- package/lib/components/LifeCycle/utils.js +250 -0
- package/lib/components/LifeCycle/utils.js.map +1 -0
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
- package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
- package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
- package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
- package/lib/components/RuleSelect/RuleSelect.js +3 -3
- package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
- package/lib/components/Workbench/Workbench.d.ts +2 -3
- package/lib/components/Workbench/Workbench.d.ts.map +1 -1
- package/lib/components/Workbench/Workbench.js.map +1 -1
- package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
- package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
- package/lib/utils/typeIconMapping.d.ts.map +1 -0
- package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
- package/lib/utils/typeIconMapping.js.map +1 -0
- package/package.json +16 -14
- package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
- package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
- package/lib/components/FlowModeller/AddNode.d.ts +0 -18
- package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
- package/lib/components/FlowModeller/AddNode.js +0 -86
- package/lib/components/FlowModeller/AddNode.js.map +0 -1
- package/lib/components/FlowModeller/Connector.d.ts +0 -6
- package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
- package/lib/components/FlowModeller/Connector.js +0 -69
- package/lib/components/FlowModeller/Connector.js.map +0 -1
- package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
- package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
- package/lib/components/FlowModeller/DeletePopover.js +0 -136
- package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
- package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.js +0 -317
- package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
- package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
- package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
- package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
- package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
- package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
- package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.js +0 -27
- package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
- package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
- package/lib/components/FlowModeller/Node.d.ts +0 -5
- package/lib/components/FlowModeller/Node.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node.js +0 -22
- package/lib/components/FlowModeller/Node.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
- package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
- package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
- package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/helper.d.ts +0 -39
- package/lib/components/FlowModeller/helper.d.ts.map +0 -1
- package/lib/components/FlowModeller/helper.js +0 -198
- package/lib/components/FlowModeller/helper.js.map +0 -1
- package/lib/components/FlowModeller/index.d.ts +0 -20
- package/lib/components/FlowModeller/index.d.ts.map +0 -1
- package/lib/components/FlowModeller/index.js +0 -12
- package/lib/components/FlowModeller/index.js.map +0 -1
- package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
- package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
- package/lib/components/IconTile/IconTile.styles.js +0 -68
- package/lib/components/IconTile/IconTile.styles.js.map +0 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useState, useCallback, useContext } from 'react';
|
|
3
4
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Flex, defaultThemeProp, Button, Icon, useElement, Actions, useI18n, Avatar,
|
|
5
|
+
import { Flex, defaultThemeProp, Button, Icon, useElement, Actions, useI18n, Avatar, useTestIds, withTestIds, Text, Tooltip, StyledButton, StyledIcon } from '@pega/cosmos-react-core';
|
|
5
6
|
import { ItemLibrary } from '../ItemLibrary';
|
|
6
|
-
import
|
|
7
|
+
import { generateDynamicTestId } from './utils';
|
|
8
|
+
import Step, {} from './Step';
|
|
7
9
|
import LifeCycleContext from './LifeCycleContext';
|
|
10
|
+
import { getStepTestIds, getTaskTestIds } from './LifeCycle.test-ids';
|
|
11
|
+
import LifeCycleDragDropList from './LifeCycleDragDropList';
|
|
8
12
|
export const StyledTaskList = styled.li(({ theme }) => {
|
|
9
13
|
return css `
|
|
10
14
|
list-style-type: none;
|
|
@@ -16,39 +20,61 @@ export const StyledTaskList = styled.li(({ theme }) => {
|
|
|
16
20
|
`;
|
|
17
21
|
});
|
|
18
22
|
StyledTaskList.defaultProps = defaultThemeProp;
|
|
19
|
-
export const StyledCardHeader = styled.header(({ theme }) => {
|
|
23
|
+
export const StyledCardHeader = styled.header(({ theme: { base: { spacing } } }) => {
|
|
20
24
|
return css `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
padding: 0 calc(0.25 * ${spacing});
|
|
26
|
+
margin: calc(0.25 * ${spacing});
|
|
27
|
+
`;
|
|
24
28
|
});
|
|
25
29
|
StyledCardHeader.defaultProps = defaultThemeProp;
|
|
26
|
-
export const
|
|
27
|
-
return css `
|
|
28
|
-
padding: 0;
|
|
29
|
-
`;
|
|
30
|
-
});
|
|
31
|
-
export const StyledTaskButton = styled.button(({ theme }) => {
|
|
30
|
+
export const StyledAddCustomStepButton = styled(Button)(({ theme }) => {
|
|
32
31
|
return css `
|
|
33
|
-
background: ${theme.base.palette['primary-background']};
|
|
34
|
-
border: none;
|
|
35
32
|
height: ${theme.components.button.height};
|
|
36
|
-
|
|
37
|
-
text-overflow: ellipsis;
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
text-align: start;
|
|
33
|
+
margin-inline-start: calc(0.5 * ${theme.base.spacing});
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
${StyledIcon} {
|
|
36
|
+
margin-inline-end: ${theme.base.spacing};
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
`;
|
|
39
|
+
});
|
|
40
|
+
StyledAddCustomStepButton.defaultProps = defaultThemeProp;
|
|
41
|
+
export const StyledAddStepButton = styled(Button) ``;
|
|
42
|
+
export const StyledCardContent = styled.div(({ hasSteps, theme }) => {
|
|
43
|
+
if (!hasSteps)
|
|
44
|
+
return;
|
|
45
|
+
return css `
|
|
46
|
+
& > ${StyledButton}, & > ${StyledAddCustomStepButton} {
|
|
47
|
+
margin-block-start: calc(0.5 * ${theme.base.spacing});
|
|
47
48
|
}
|
|
48
49
|
`;
|
|
49
50
|
});
|
|
51
|
+
StyledCardContent.defaultProps = defaultThemeProp;
|
|
52
|
+
export const StyledTaskButton = styled.button(({ theme, visual }) => {
|
|
53
|
+
return css `
|
|
54
|
+
background: ${theme.base.palette['primary-background']};
|
|
55
|
+
border: none;
|
|
56
|
+
height: ${theme.components.button.height};
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
text-align: start;
|
|
61
|
+
|
|
62
|
+
${visual.imgSrc &&
|
|
63
|
+
css `
|
|
64
|
+
padding-inline-start: calc(0.5 * ${theme.base.spacing});
|
|
65
|
+
`}
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:focus {
|
|
72
|
+
outline: none;
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
});
|
|
50
76
|
StyledTaskButton.defaultProps = defaultThemeProp;
|
|
51
|
-
export const StyledTask = styled.article(({ hasFocus, theme }) => {
|
|
77
|
+
export const StyledTask = styled.article(({ hasFocus, hasSteps, theme, dragEnabled }) => {
|
|
52
78
|
return css `
|
|
53
79
|
background: ${theme.base.palette['primary-background']};
|
|
54
80
|
border: 0.125rem solid transparent;
|
|
@@ -67,13 +93,22 @@ export const StyledTask = styled.article(({ hasFocus, theme }) => {
|
|
|
67
93
|
&[aria-current='true'] {
|
|
68
94
|
border-color: ${theme.base.palette.interactive};
|
|
69
95
|
}
|
|
96
|
+
|
|
97
|
+
${hasSteps &&
|
|
98
|
+
!dragEnabled &&
|
|
99
|
+
css `
|
|
100
|
+
${StyledAddCustomStepButton} ,${StyledAddStepButton} {
|
|
101
|
+
margin-block-start: calc(0.5 * ${theme.base.spacing});
|
|
102
|
+
}
|
|
103
|
+
`}
|
|
70
104
|
`;
|
|
71
105
|
});
|
|
72
106
|
StyledTask.defaultProps = defaultThemeProp;
|
|
73
107
|
export const StyledWarnIcon = styled(Icon)(({ theme }) => {
|
|
74
108
|
return css `
|
|
75
109
|
color: ${theme.base.palette.urgent};
|
|
76
|
-
margin-inline: ${theme.base.spacing};
|
|
110
|
+
margin-inline-start: calc(0.5 * ${theme.base.spacing});
|
|
111
|
+
margin-inline-end: ${theme.base.spacing};
|
|
77
112
|
|
|
78
113
|
&:hover {
|
|
79
114
|
cursor: pointer;
|
|
@@ -81,13 +116,15 @@ export const StyledWarnIcon = styled(Icon)(({ theme }) => {
|
|
|
81
116
|
`;
|
|
82
117
|
});
|
|
83
118
|
StyledWarnIcon.defaultProps = defaultThemeProp;
|
|
84
|
-
const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onClick, categoryItem, id, step: stepProp, nodeLibrary, ...restProps }) => {
|
|
119
|
+
const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onAddCustomStep, onClick, categoryItem, id, step: stepProp, nodeLibrary, ...restProps }) => {
|
|
85
120
|
const t = useI18n();
|
|
86
|
-
const { selectedItemId, readOnly } = useContext(LifeCycleContext);
|
|
121
|
+
const { selectedItemId, readOnly, dragEnabled, onDragDrop } = useContext(LifeCycleContext);
|
|
87
122
|
const [taskHasFocus, setTaskHasFocus] = useState(false);
|
|
88
|
-
const [
|
|
89
|
-
const [
|
|
90
|
-
const [
|
|
123
|
+
const [taskButtonEl, setTaskButtonEl] = useElement();
|
|
124
|
+
const [addEl, setAddEl] = useElement(null);
|
|
125
|
+
const taskTestID = generateDynamicTestId([stageItem.label, categoryItem.categoryLabel, value]);
|
|
126
|
+
const testIds = useTestIds(taskTestID, getTaskTestIds);
|
|
127
|
+
const stepTestIds = useTestIds(taskTestID, getStepTestIds);
|
|
91
128
|
const onActionItemClick = (actionId, e) => {
|
|
92
129
|
const param = {
|
|
93
130
|
task: item,
|
|
@@ -109,7 +146,10 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
|
|
|
109
146
|
actionCloneItem[key] = actionItem[key];
|
|
110
147
|
});
|
|
111
148
|
actionCloneItem.onClick = onActionItemClick;
|
|
112
|
-
actionsClone.push(
|
|
149
|
+
actionsClone.push({
|
|
150
|
+
...actionCloneItem,
|
|
151
|
+
'data-testid': testIds.actionButton
|
|
152
|
+
});
|
|
113
153
|
return actionItem;
|
|
114
154
|
});
|
|
115
155
|
}
|
|
@@ -130,29 +170,53 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
|
|
|
130
170
|
category: categoryItem
|
|
131
171
|
};
|
|
132
172
|
onAddStep?.(param, libItem);
|
|
133
|
-
setLibrary(false);
|
|
134
173
|
}, [onAddStep]);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
174
|
+
const isEmpty = (readOnly || (!readOnly && !addStepTitle)) && !item?.steps?.length && !value;
|
|
175
|
+
const getStepProps = useCallback((step, index) => {
|
|
176
|
+
return {
|
|
177
|
+
id: step.id,
|
|
178
|
+
value: step.label,
|
|
179
|
+
visual: {
|
|
180
|
+
imgSrc: step.visual.imgSrc,
|
|
181
|
+
name: step.visual.name,
|
|
182
|
+
label: step.visual.label,
|
|
183
|
+
category: step.visual.category,
|
|
184
|
+
inverted: step.visual.inverted
|
|
185
|
+
},
|
|
186
|
+
item: { ...step, index, alternate: item.alternate },
|
|
187
|
+
taskItem: item,
|
|
188
|
+
stageItem,
|
|
189
|
+
badge: {
|
|
190
|
+
type: step?.status?.type ?? '',
|
|
191
|
+
label: step?.status?.label ?? ''
|
|
192
|
+
},
|
|
193
|
+
error: step.error,
|
|
194
|
+
categoryItem
|
|
195
|
+
};
|
|
196
|
+
}, [categoryItem, item, stageItem]);
|
|
197
|
+
const addStepRegion = (_jsxs(_Fragment, { children: [!readOnly && addStepTitle && nodeLibrary && (_jsxs(_Fragment, { children: [_jsx(Button, { as: StyledAddStepButton, "data-testid": stepTestIds.addButton, variant: 'simple', label: t('add_noun', [addStepTitle]), onClick: (e) => setAddEl(e.currentTarget), icon: true, children: _jsx(Icon, { name: 'plus' }) }), addEl && (_jsx(ItemLibrary, { items: nodeLibrary, target: addEl, onClick: onLibraryItemSelect, onDismiss: () => setAddEl(null), placeholder: t('search_placeholder_default') }))] })), !readOnly && addStepTitle && !nodeLibrary && onAddCustomStep && (_jsxs(Button, { as: StyledAddCustomStepButton, "data-testid": stepTestIds.addButton, variant: 'link', onClick: () => {
|
|
198
|
+
const param = {
|
|
199
|
+
task: item,
|
|
200
|
+
stage: stageItem,
|
|
201
|
+
category: categoryItem
|
|
202
|
+
};
|
|
203
|
+
onAddCustomStep(param);
|
|
204
|
+
}, children: [_jsx(Icon, { name: 'plus' }), t('add_noun', [addStepTitle])] }))] }));
|
|
205
|
+
return (_jsx(StyledTaskList, { "data-testid": testIds.root, ...restProps, id: item.id, children: isEmpty ? (_jsx(Flex, { container: { justify: 'center', pad: 1 }, children: _jsx(Text, { variant: 'secondary', children: "No Steps" }) })) : (_jsxs(Flex, { as: StyledTask, "aria-current": selectedItemId === id ? 'true' : undefined, container: { direction: 'column' }, hasFocus: taskHasFocus && selectedItemId !== id, hasSteps: !!item?.steps?.length, dragEnabled: dragEnabled, children: [!!value && (_jsxs(Flex, { as: StyledCardHeader, container: { inline: true, alignItems: 'center' }, children: [visual?.imgSrc?.length > 0 && _jsx(Avatar, { name: value, imageSrc: visual?.imgSrc }), error && _jsx(StyledWarnIcon, { name: 'warn-solid' }), _jsxs(Flex, { item: { grow: 1 }, container: { inline: true, alignItems: 'center' }, onClick: onTaskClick, children: [_jsx(StyledTaskButton, { onFocus: () => {
|
|
206
|
+
setTaskHasFocus(true);
|
|
207
|
+
}, onBlur: () => {
|
|
208
|
+
setTaskHasFocus(false);
|
|
209
|
+
}, "aria-label": t(error ? 'process_name_error' : 'process_name', [value]), visual: visual, ref: setTaskButtonEl, children: value }), taskButtonEl && (_jsx(Tooltip, { target: taskButtonEl, smart: true, children: value }))] }), actionsClone && (_jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true, contextualLabel: t('process_name', [value]) }))] })), _jsx(StyledCardContent, { hasSteps: !!item?.steps?.length, as: dragEnabled ? 'div' : 'ul', children: dragEnabled ? (_jsx(LifeCycleDragDropList, { type: stageItem.alternate ? 'alternate-step' : 'step', listLocation: {
|
|
210
|
+
alternate: !!stageItem.alternate,
|
|
211
|
+
stage: stageItem.index,
|
|
212
|
+
category: categoryItem.index,
|
|
213
|
+
task: item.index,
|
|
214
|
+
subTask: item.subIndex
|
|
215
|
+
}, items: item?.steps?.map((step, index) => ({
|
|
216
|
+
id: step.id,
|
|
217
|
+
type: stageItem.alternate ? 'alternate-step' : 'step',
|
|
218
|
+
data: { ...stepProp, ...getStepProps(step, index) }
|
|
219
|
+
})), itemRenderer: Step, onDragDrop: onDragDrop, additionalDropZone: addStepRegion })) : (_jsx(_Fragment, { children: item?.steps?.map((step, index) => (_createElement(Step, { ...stepProp, key: step.id, ...getStepProps(step, index) }))) })) }), !dragEnabled && _jsx("div", { children: addStepRegion })] })) }));
|
|
156
220
|
};
|
|
157
|
-
export default Task;
|
|
221
|
+
export default withTestIds(Task, getTaskTestIds);
|
|
158
222
|
//# sourceMappingURL=Task.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,aAAa,EACb,SAAS,EACV,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,IAAI,MAAM,QAAQ,CAAC;AAU1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAuBlD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CA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K,CAAC,EAAE,CAmBb,CACH,CAAC;wBACJ,CAAC,CAAC,EACD,CAAC,QAAQ,IAAI,CACZ,8BACE,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,YAAY,CAAC,CAAC,EACpC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EACxC,IAAI,kBAEJ,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,EACT,KAAC,WAAW,IACV,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,KAAoB,EAC5B,OAAO,EAAE,mBAAmB,EAC5B,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,IACD,CACJ,IACiB,IACf,GACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { useState, useCallback, useContext } from 'react';\nimport type { FunctionComponent, PropsWithChildren, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n Button,\n Icon,\n useElement,\n Actions,\n useI18n,\n Avatar,\n useOuterEvent,\n useEscape\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\n\nimport { ItemLibrary } from '../ItemLibrary';\nimport type { LibraryItem } from '../ItemLibrary';\n\nimport Step from './Step';\nimport type {\n TaskItemProps,\n StageItemProps,\n StepItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps,\n TaskProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\n\ninterface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgurl: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps;\n /** unique id of task */\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledTaskList.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n padding: 0;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(() => {\n return css`\n padding: 0;\n `;\n});\n\nexport const StyledTaskButton = styled.button(({ theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledTaskButton.defaultProps = defaultThemeProp;\n\nexport const StyledTask = styled.article<{ hasFocus: boolean }>(({ hasFocus, theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: calc(${theme.base.spacing} - 0.125rem);\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &[aria-current='true'] {\n border-color: ${theme.base.palette.interactive};\n }\n `;\n});\n\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onClick,\n categoryItem,\n id,\n step: stepProp,\n nodeLibrary,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const { selectedItemId, readOnly } = useContext(LifeCycleContext);\n const [taskHasFocus, setTaskHasFocus] = useState(false);\n const [showLibrary, setLibrary] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [addEl, setAddEl] = useElement();\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n const onTaskClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n task: item,\n stage: stageItem,\n category: categoryItem,\n type: 'Task'\n };\n onClick?.(actionParam, e);\n };\n\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, libItem);\n setLibrary(false);\n },\n [onAddStep]\n );\n\n useEscape(() => {\n setLibrary(false);\n });\n\n useOuterEvent('mousedown', [addEl, popoverEl], () => setLibrary(false));\n\n return (\n <StyledTaskList {...restProps} id={item.id}>\n <Flex\n as={StyledTask}\n aria-current={selectedItemId === id ? true : undefined}\n container={{ direction: 'column' }}\n id={`${id}-task`}\n hasFocus={taskHasFocus && selectedItemId !== id}\n >\n <Flex as={StyledCardHeader} container={{ inline: true, alignItems: 'center' }}>\n {visual?.imgurl.length > 0 && <Avatar name={value} imageSrc={visual?.imgurl} />}\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center' }}\n onClick={onTaskClick}\n >\n <StyledTaskButton\n onFocus={() => {\n setTaskHasFocus(true);\n }}\n onBlur={() => {\n setTaskHasFocus(false);\n }}\n aria-label={t(error ? 'process_name_error' : 'process_name', [value])}\n >\n {value}\n </StyledTaskButton>\n </Flex>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n <StyledCardContent>\n {item?.steps.map((steps: StepItemProps) => {\n const badgeStatus = steps?.status?.type ? steps.status.type : '';\n const badgeLabel = steps?.status?.label ? steps.status.label : '';\n return (\n <Step\n key={steps.id}\n id={steps.id}\n value={steps.label}\n visual={{\n imgurl: steps.visual.imgurl,\n color: steps.visual.color,\n icon: steps.visual.icon,\n title: steps.visual.label\n }}\n item={steps}\n taskItem={item}\n stageItem={stageItem}\n badge={{\n type: badgeStatus,\n label: badgeLabel\n }}\n error={steps.error}\n categoryItem={categoryItem}\n {...stepProp}\n />\n );\n })}\n {!readOnly && (\n <>\n <Button\n variant='simple'\n ref={setAddEl}\n label={t('add_noun', [addStepTitle])}\n onClick={() => setLibrary(prev => !prev)}\n icon\n >\n <Icon name='plus' />\n </Button>\n <ItemLibrary\n items={nodeLibrary}\n show={showLibrary}\n target={addEl as HTMLElement}\n onClick={onLibraryItemSelect}\n ref={setPopoverEl}\n placeholder={t('search_nodes')}\n />\n </>\n )}\n </StyledCardContent>\n </Flex>\n </StyledTaskList>\n );\n};\n\nexport default Task;\n"]}
|
|
1
|
+
{"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,WA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4BAChC,KAAK,EAAE,SAAS,CAAC,KAAK;4BACtB,QAAQ,EAAE,YAAY,CAAC,KAAK;4BAC5B,IAAI,EAAE,IAAI,CAAC,KAAK;4BAChB,OAAO,EAAE,IAAI,CAAC,QAAQ;yBACvB,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;4BACxC,EAAE,EAAE,IAAI,CAAC,EAAE;4BACX,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM;4BACrD,IAAI,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;yBACpD,CAAC,CAAC,EACH,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,aAAa,GACjC,CACH,CAAC,CAAC,CAAC,CACF,4BACG,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,eAAC,IAAI,OAAK,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,KAAM,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,GAAI,CACpE,CAAC,GACD,CACJ,GACiB,EACnB,CAAC,WAAW,IAAI,wBAAM,aAAa,GAAO,IACtC,CACR,GACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { useState, useCallback, useContext } from 'react';\nimport type { FunctionComponent, PropsWithChildren, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n Button,\n Icon,\n useElement,\n Actions,\n useI18n,\n Avatar,\n useTestIds,\n withTestIds,\n Text,\n Tooltip,\n StyledButton,\n StyledIcon\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\n\nimport { ItemLibrary } from '../ItemLibrary';\nimport type { LibraryItem } from '../ItemLibrary';\n\nimport { generateDynamicTestId } from './utils';\nimport Step, { type StepComponentProps } from './Step';\nimport type {\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps,\n TaskProps,\n StepItemProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\nimport { getStepTestIds, getTaskTestIds } from './LifeCycle.test-ids';\nimport LifeCycleDragDropList from './LifeCycleDragDropList';\n\ninterface CategoryLabelProp {\n categoryLabel?: string;\n}\nexport interface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgSrc: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps & CategoryLabelProp;\n /** unique id of task */\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledTaskList.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n padding: 0 calc(0.25 * ${spacing});\n margin: calc(0.25 * ${spacing});\n `;\n }\n);\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledAddCustomStepButton = styled(Button)(({ theme }) => {\n return css`\n height: ${theme.components.button.height};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n\n ${StyledIcon} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledAddCustomStepButton.defaultProps = defaultThemeProp;\n\nexport const StyledAddStepButton = styled(Button)``;\n\nexport const StyledCardContent = styled.div<{ hasSteps?: boolean }>(({ hasSteps, theme }) => {\n if (!hasSteps) return;\n\n return css`\n & > ${StyledButton}, & > ${StyledAddCustomStepButton} {\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledTaskButton = styled.button<Pick<TaskComponentProps, 'visual'>>(\n ({ theme, visual }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n\n ${visual.imgSrc &&\n css`\n padding-inline-start: calc(0.5 * ${theme.base.spacing});\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n }\n);\n\nStyledTaskButton.defaultProps = defaultThemeProp;\n\nexport const StyledTask = styled.article<{\n hasFocus: boolean;\n hasSteps?: boolean;\n dragEnabled?: boolean;\n}>(({ hasFocus, hasSteps, theme, dragEnabled }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: calc(${theme.base.spacing} - 0.125rem);\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &[aria-current='true'] {\n border-color: ${theme.base.palette.interactive};\n }\n\n ${hasSteps &&\n !dragEnabled &&\n css`\n ${StyledAddCustomStepButton} ,${StyledAddStepButton} {\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n }\n `}\n `;\n});\n\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onAddCustomStep,\n onClick,\n categoryItem,\n id,\n step: stepProp,\n nodeLibrary,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const { selectedItemId, readOnly, dragEnabled, onDragDrop } = useContext(LifeCycleContext);\n const [taskHasFocus, setTaskHasFocus] = useState(false);\n const [taskButtonEl, setTaskButtonEl] = useElement();\n const [addEl, setAddEl] = useElement<HTMLButtonElement>(null);\n\n const taskTestID = generateDynamicTestId([stageItem.label, categoryItem.categoryLabel, value]);\n const testIds = useTestIds(taskTestID, getTaskTestIds);\n const stepTestIds = useTestIds(taskTestID, getStepTestIds);\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push({\n ...actionCloneItem,\n 'data-testid': testIds.actionButton\n });\n return actionItem;\n });\n }\n\n const onTaskClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n task: item,\n stage: stageItem,\n category: categoryItem,\n type: 'Task'\n };\n onClick?.(actionParam, e);\n };\n\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, libItem);\n },\n [onAddStep]\n );\n\n const isEmpty = (readOnly || (!readOnly && !addStepTitle)) && !item?.steps?.length && !value;\n\n const getStepProps = useCallback(\n (step: StepItemProps, index: number): StepComponentProps => {\n return {\n id: step.id,\n value: step.label,\n visual: {\n imgSrc: step.visual.imgSrc,\n name: step.visual.name,\n label: step.visual.label,\n category: step.visual.category,\n inverted: step.visual.inverted\n },\n item: { ...step, index, alternate: item.alternate },\n taskItem: item,\n stageItem,\n badge: {\n type: step?.status?.type ?? '',\n label: step?.status?.label ?? ''\n },\n error: step.error,\n categoryItem\n };\n },\n [categoryItem, item, stageItem]\n );\n\n const addStepRegion = (\n <>\n {!readOnly && addStepTitle && nodeLibrary && (\n <>\n <Button\n as={StyledAddStepButton}\n data-testid={stepTestIds.addButton}\n variant='simple'\n label={t('add_noun', [addStepTitle])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => setAddEl(e.currentTarget)}\n icon\n >\n <Icon name='plus' />\n </Button>\n {addEl && (\n <ItemLibrary\n items={nodeLibrary}\n target={addEl}\n onClick={onLibraryItemSelect}\n onDismiss={() => setAddEl(null)}\n placeholder={t('search_placeholder_default')}\n />\n )}\n </>\n )}\n {!readOnly && addStepTitle && !nodeLibrary && onAddCustomStep && (\n <Button\n as={StyledAddCustomStepButton}\n data-testid={stepTestIds.addButton}\n variant='link'\n onClick={() => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddCustomStep(param);\n }}\n >\n <Icon name='plus' />\n {t('add_noun', [addStepTitle])}\n </Button>\n )}\n </>\n );\n\n return (\n <StyledTaskList data-testid={testIds.root} {...restProps} id={item.id}>\n {isEmpty ? (\n <Flex container={{ justify: 'center', pad: 1 }}>\n <Text variant='secondary'>No Steps</Text>\n </Flex>\n ) : (\n <Flex\n as={StyledTask}\n aria-current={selectedItemId === id ? 'true' : undefined}\n container={{ direction: 'column' }}\n hasFocus={taskHasFocus && selectedItemId !== id}\n hasSteps={!!item?.steps?.length}\n dragEnabled={dragEnabled}\n >\n {!!value && (\n <Flex as={StyledCardHeader} container={{ inline: true, alignItems: 'center' }}>\n {visual?.imgSrc?.length > 0 && <Avatar name={value} imageSrc={visual?.imgSrc} />}\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center' }}\n onClick={onTaskClick}\n >\n <StyledTaskButton\n onFocus={() => {\n setTaskHasFocus(true);\n }}\n onBlur={() => {\n setTaskHasFocus(false);\n }}\n aria-label={t(error ? 'process_name_error' : 'process_name', [value])}\n visual={visual}\n ref={setTaskButtonEl}\n >\n {value}\n </StyledTaskButton>\n {taskButtonEl && (\n <Tooltip target={taskButtonEl} smart>\n {value}\n </Tooltip>\n )}\n </Flex>\n {actionsClone && (\n <Actions\n items={actionsClone}\n menuAt={2}\n iconOnly\n contextualLabel={t('process_name', [value])}\n />\n )}\n </Flex>\n )}\n <StyledCardContent hasSteps={!!item?.steps?.length} as={dragEnabled ? 'div' : 'ul'}>\n {dragEnabled ? (\n <LifeCycleDragDropList\n type={stageItem.alternate ? 'alternate-step' : 'step'}\n listLocation={{\n alternate: !!stageItem.alternate,\n stage: stageItem.index,\n category: categoryItem.index,\n task: item.index,\n subTask: item.subIndex\n }}\n items={item?.steps?.map((step, index) => ({\n id: step.id,\n type: stageItem.alternate ? 'alternate-step' : 'step',\n data: { ...stepProp, ...getStepProps(step, index) }\n }))}\n itemRenderer={Step}\n onDragDrop={onDragDrop}\n additionalDropZone={addStepRegion}\n />\n ) : (\n <>\n {item?.steps?.map((step, index) => (\n <Step {...stepProp} key={step.id} {...getStepProps(step, index)} />\n ))}\n </>\n )}\n </StyledCardContent>\n {!dragEnabled && <div>{addStepRegion}</div>}\n </Flex>\n )}\n </StyledTaskList>\n );\n};\n\nexport default withTestIds(Task, getTaskTestIds);\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default } from './LifeCycle';
|
|
2
|
-
export
|
|
2
|
+
export { defaultDragDropConfig, moveStage, moveStep } from './utils';
|
|
3
|
+
export type { StepItemProps, TaskItemProps, StageItemProps, CategoryItemProps, CategoriesItemProps, LifeCycleActionParam, LifeCycleAction, LifeCycleDragDropEvent, DragDropConfig, LifeCycleProps } from './LifeCycle.types';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrE,YAAY,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,cAAc,EACf,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { default } from './LifeCycle';\nexport type {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction,\n LifeCycleProps\n} from './LifeCycle.types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { default } from './LifeCycle';\nexport { defaultDragDropConfig, moveStage, moveStep } from './utils';\nexport type {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction,\n LifeCycleDragDropEvent,\n DragDropConfig,\n LifeCycleProps\n} from './LifeCycle.types';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DragDropConfig, IndexData, LifeCycleDragDropEvent, StageItemProps } from './LifeCycle.types';
|
|
2
|
+
import type { LifeCycleContextValue } from './LifeCycleContext';
|
|
3
|
+
export declare const defaultDragDropConfig: DragDropConfig;
|
|
4
|
+
export declare const generateDynamicTestId: (arr: (string | undefined)[]) => string;
|
|
5
|
+
export declare const moveStage: (event: LifeCycleDragDropEvent, stages: StageItemProps[], alternateStages: StageItemProps[]) => {
|
|
6
|
+
stages: StageItemProps[];
|
|
7
|
+
alternateStages: StageItemProps[];
|
|
8
|
+
} | undefined;
|
|
9
|
+
export declare const moveStep: (event: LifeCycleDragDropEvent, stages: StageItemProps[], alternateStages: StageItemProps[]) => {
|
|
10
|
+
stages: StageItemProps[];
|
|
11
|
+
alternateStages: StageItemProps[];
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare const getListLocation: (currentListLocation: IndexData, type: LifeCycleDragDropEvent["type"], lifeCycleData: LifeCycleContextValue["lifeCycleData"], direction: "prev" | "next") => IndexData | undefined;
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,eAAO,MAAM,qBAAqB,EAAE,cAiBnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,WAKhE,CAAC;AAgCF,eAAO,MAAM,SAAS,UACb,sBAAsB,UACrB,cAAc,EAAE,mBACP,cAAc,EAAE;;;aA0BlC,CAAC;AAEF,eAAO,MAAM,QAAQ,UACZ,sBAAsB,UACrB,cAAc,EAAE,mBACP,cAAc,EAAE;;;aAqBlC,CAAC;AAmKF,eAAO,MAAM,eAAe,wBACL,SAAS,QACxB,sBAAsB,CAAC,MAAM,CAAC,iBACrB,qBAAqB,CAAC,eAAe,CAAC,aAC1C,MAAM,GAAG,MAAM,KACzB,SAAS,GAAG,SAmDd,CAAC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export const defaultDragDropConfig = {
|
|
2
|
+
stage: {
|
|
3
|
+
enabled: true,
|
|
4
|
+
accept: ['stage', 'alternate-stage']
|
|
5
|
+
},
|
|
6
|
+
step: {
|
|
7
|
+
enabled: true,
|
|
8
|
+
accept: ['step', 'alternate-step']
|
|
9
|
+
},
|
|
10
|
+
'alternate-stage': {
|
|
11
|
+
enabled: true,
|
|
12
|
+
accept: ['stage', 'alternate-stage']
|
|
13
|
+
},
|
|
14
|
+
'alternate-step': {
|
|
15
|
+
enabled: true,
|
|
16
|
+
accept: ['step', 'alternate-step']
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const generateDynamicTestId = (arr) => {
|
|
20
|
+
return arr
|
|
21
|
+
.filter(element => element)
|
|
22
|
+
.map(element => element?.replace(/\s+/g, '-').toLowerCase())
|
|
23
|
+
.join('_');
|
|
24
|
+
};
|
|
25
|
+
const getStageData = (stages, indexData) => {
|
|
26
|
+
if (indexData.stage === undefined)
|
|
27
|
+
return;
|
|
28
|
+
return stages[indexData.stage];
|
|
29
|
+
};
|
|
30
|
+
const getCategoryData = (stages, indexData) => {
|
|
31
|
+
if (indexData.category === undefined)
|
|
32
|
+
return;
|
|
33
|
+
const stage = getStageData(stages, indexData);
|
|
34
|
+
if (!stage)
|
|
35
|
+
return;
|
|
36
|
+
return stage.categories[indexData.category];
|
|
37
|
+
};
|
|
38
|
+
const getTaskData = (stages, indexData) => {
|
|
39
|
+
if (indexData.task === undefined)
|
|
40
|
+
return;
|
|
41
|
+
const category = getCategoryData(stages, indexData);
|
|
42
|
+
if (!category)
|
|
43
|
+
return;
|
|
44
|
+
if (Array.isArray(category.tasks[indexData.task])) {
|
|
45
|
+
if (indexData.subTask === undefined)
|
|
46
|
+
return;
|
|
47
|
+
return category.tasks[indexData.task][indexData.subTask];
|
|
48
|
+
}
|
|
49
|
+
return category.tasks[indexData.task];
|
|
50
|
+
};
|
|
51
|
+
const getStepData = (stages, indexData) => {
|
|
52
|
+
if (indexData.step === undefined)
|
|
53
|
+
return;
|
|
54
|
+
const task = getTaskData(stages, indexData);
|
|
55
|
+
if (!task)
|
|
56
|
+
return;
|
|
57
|
+
return task.steps[indexData.step];
|
|
58
|
+
};
|
|
59
|
+
export const moveStage = (event, stages, alternateStages) => {
|
|
60
|
+
let stagesClone = JSON.parse(JSON.stringify(stages));
|
|
61
|
+
let alternateStagesClone = JSON.parse(JSON.stringify(alternateStages));
|
|
62
|
+
// Remove the stage from its original position
|
|
63
|
+
let sourceData = event.sourceData.alternate ? alternateStagesClone : stagesClone;
|
|
64
|
+
const stage = getStageData(sourceData, event.sourceData);
|
|
65
|
+
if (!stage || event.targetData.stage === undefined)
|
|
66
|
+
return;
|
|
67
|
+
sourceData = sourceData.filter((item) => item.id !== stage.id);
|
|
68
|
+
if (event.sourceData.alternate) {
|
|
69
|
+
alternateStagesClone = sourceData;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
stagesClone = sourceData;
|
|
73
|
+
}
|
|
74
|
+
// Insert the stage in its new position
|
|
75
|
+
const targetData = event.targetData.alternate ? alternateStagesClone : stagesClone;
|
|
76
|
+
targetData.splice(event.targetData.stage, 0, stage);
|
|
77
|
+
if (event.targetData.alternate) {
|
|
78
|
+
alternateStagesClone = targetData;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
stagesClone = targetData;
|
|
82
|
+
}
|
|
83
|
+
return { stages: stagesClone, alternateStages: alternateStagesClone };
|
|
84
|
+
};
|
|
85
|
+
export const moveStep = (event, stages, alternateStages) => {
|
|
86
|
+
const stagesClone = JSON.parse(JSON.stringify(stages));
|
|
87
|
+
const alternateStagesClone = JSON.parse(JSON.stringify(alternateStages));
|
|
88
|
+
const sourceData = event.sourceData.alternate ? alternateStagesClone : stagesClone;
|
|
89
|
+
const targetData = event.targetData.alternate ? alternateStagesClone : stagesClone;
|
|
90
|
+
// Remove the step from its original position
|
|
91
|
+
const parentTask = getTaskData(sourceData, event.sourceData);
|
|
92
|
+
const step = getStepData(sourceData, event.sourceData);
|
|
93
|
+
if (!parentTask || !step)
|
|
94
|
+
return;
|
|
95
|
+
parentTask.steps = parentTask.steps.filter((item) => item.id !== step.id);
|
|
96
|
+
// Insert the step in its new position
|
|
97
|
+
const targetTask = getTaskData(targetData, event.targetData);
|
|
98
|
+
if (!targetTask || event.targetData.step === undefined)
|
|
99
|
+
return;
|
|
100
|
+
targetTask.steps = targetTask.steps || [];
|
|
101
|
+
targetTask.steps.splice(event.targetData.step, 0, step);
|
|
102
|
+
return { stages: stagesClone, alternateStages: alternateStagesClone };
|
|
103
|
+
};
|
|
104
|
+
const getTargetTaskLocation = (stages, currentListLocation, direction, layer) => {
|
|
105
|
+
const { stage, category, task } = currentListLocation;
|
|
106
|
+
if (currentListLocation[layer] === undefined || stage === undefined) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const jump = direction === 'next' ? 1 : -1;
|
|
110
|
+
let targetIndex = currentListLocation[layer] + jump;
|
|
111
|
+
if (layer === 'subTask') {
|
|
112
|
+
if (category === undefined || task === undefined) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const parentList = stages[stage].categories[category].tasks[task];
|
|
116
|
+
if (!Array.isArray(parentList)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (targetIndex < 0 || targetIndex >= parentList.length) {
|
|
120
|
+
return getTargetTaskLocation(stages, { ...currentListLocation, subTask: undefined }, direction, 'task');
|
|
121
|
+
}
|
|
122
|
+
return { ...currentListLocation, subTask: targetIndex, step: 0 };
|
|
123
|
+
}
|
|
124
|
+
if (layer === 'task') {
|
|
125
|
+
if (category === undefined) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const parentList = stages[stage].categories[category].tasks;
|
|
129
|
+
if (!Array.isArray(parentList)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (targetIndex < 0 || targetIndex >= parentList.length) {
|
|
133
|
+
return getTargetTaskLocation(stages, { ...currentListLocation, task: undefined }, direction, 'category');
|
|
134
|
+
}
|
|
135
|
+
if (Array.isArray(parentList[targetIndex])) {
|
|
136
|
+
return {
|
|
137
|
+
...currentListLocation,
|
|
138
|
+
task: targetIndex,
|
|
139
|
+
subTask: direction === 'next' ? 0 : parentList[targetIndex].length - 1,
|
|
140
|
+
step: 0
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return { ...currentListLocation, task: targetIndex, step: 0 };
|
|
144
|
+
}
|
|
145
|
+
if (layer === 'category') {
|
|
146
|
+
const parentList = stages[stage].categories;
|
|
147
|
+
if (!Array.isArray(parentList)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (targetIndex < 0 || targetIndex >= parentList.length) {
|
|
151
|
+
return getTargetTaskLocation(stages, { ...currentListLocation, category: undefined }, direction, 'stage');
|
|
152
|
+
}
|
|
153
|
+
while (parentList[targetIndex].tasks.length === 0) {
|
|
154
|
+
targetIndex += jump;
|
|
155
|
+
if (targetIndex < 0 || targetIndex >= parentList.length) {
|
|
156
|
+
return getTargetTaskLocation(stages, { ...currentListLocation, category: undefined }, direction, 'stage');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const taskIndex = direction === 'next' ? 0 : parentList[targetIndex].tasks.length - 1;
|
|
160
|
+
if (Array.isArray(parentList[targetIndex].tasks[taskIndex])) {
|
|
161
|
+
return {
|
|
162
|
+
...currentListLocation,
|
|
163
|
+
category: targetIndex,
|
|
164
|
+
task: taskIndex,
|
|
165
|
+
subTask: direction === 'next'
|
|
166
|
+
? 0
|
|
167
|
+
: parentList[targetIndex].tasks[taskIndex].length - 1,
|
|
168
|
+
step: 0
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return { ...currentListLocation, category: targetIndex, task: taskIndex, step: 0 };
|
|
172
|
+
}
|
|
173
|
+
if (layer === 'stage') {
|
|
174
|
+
const parentList = stages;
|
|
175
|
+
if (!Array.isArray(parentList)) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (targetIndex < 0 || targetIndex >= parentList.length) {
|
|
179
|
+
// Returns false to indicate that the target may be in an adjacent stages list
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
if (parentList[targetIndex].categories.length === 0 ||
|
|
183
|
+
parentList[targetIndex].categories[0].tasks.length === 0) {
|
|
184
|
+
while (parentList[targetIndex].categories.length === 0 ||
|
|
185
|
+
parentList[targetIndex].categories[0].tasks.length === 0) {
|
|
186
|
+
targetIndex += jump;
|
|
187
|
+
if (targetIndex < 0 || targetIndex >= parentList.length) {
|
|
188
|
+
// Returns false to indicate that the target may be in an adjacent stages list
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const categoryIndex = direction === 'next' ? 0 : parentList[targetIndex].categories.length - 1;
|
|
194
|
+
const taskIndex = direction === 'next' ? 0 : parentList[targetIndex].categories[categoryIndex].tasks.length - 1;
|
|
195
|
+
if (Array.isArray(parentList[targetIndex].categories[categoryIndex].tasks[taskIndex])) {
|
|
196
|
+
return {
|
|
197
|
+
...currentListLocation,
|
|
198
|
+
stage: targetIndex,
|
|
199
|
+
category: categoryIndex,
|
|
200
|
+
task: taskIndex,
|
|
201
|
+
subTask: direction === 'next'
|
|
202
|
+
? 0
|
|
203
|
+
: parentList[targetIndex].categories[categoryIndex].tasks[taskIndex].length - 1,
|
|
204
|
+
step: 0
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
...currentListLocation,
|
|
209
|
+
stage: targetIndex,
|
|
210
|
+
category: categoryIndex,
|
|
211
|
+
task: taskIndex,
|
|
212
|
+
step: 0
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
export const getListLocation = (currentListLocation, type, lifeCycleData, direction) => {
|
|
217
|
+
const { stages, alternateStages } = lifeCycleData;
|
|
218
|
+
const alternate = currentListLocation.alternate;
|
|
219
|
+
if (type === 'stage') {
|
|
220
|
+
const targetList = alternate ? stages : alternateStages;
|
|
221
|
+
if (targetList.length === 0) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
return { stage: direction === 'next' ? 0 : targetList.length, alternate: !alternate };
|
|
225
|
+
}
|
|
226
|
+
if (type === 'step') {
|
|
227
|
+
const { stage, category, task } = currentListLocation;
|
|
228
|
+
if (stage === undefined || category === undefined || task === undefined) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const sourceList = alternate ? alternateStages : stages;
|
|
232
|
+
const currentStage = sourceList[stage];
|
|
233
|
+
const currentCategory = currentStage.categories[category];
|
|
234
|
+
const currentTask = currentCategory.tasks[task];
|
|
235
|
+
let targetTaskLocation = getTargetTaskLocation(sourceList, currentListLocation, direction, Array.isArray(currentTask) ? 'subTask' : 'task');
|
|
236
|
+
// If the target task location is false, it means that the target could be in an adjacent list
|
|
237
|
+
if (targetTaskLocation === false) {
|
|
238
|
+
const adjacentList = alternate ? stages : alternateStages;
|
|
239
|
+
// Set the entry point to 1 index out of bounds since getTargetTaskLocation will move the target index by 1
|
|
240
|
+
const entryPoint = direction === 'next' ? -1 : adjacentList.length;
|
|
241
|
+
targetTaskLocation = getTargetTaskLocation(adjacentList, { alternate: !alternate, stage: entryPoint }, direction, 'stage');
|
|
242
|
+
// If the target is not in an adjacent list, return undefined
|
|
243
|
+
if (targetTaskLocation === false) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return targetTaskLocation;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
//# sourceMappingURL=utils.js.map
|