@pega/cosmos-react-build 8.8.0 → 9.0.0-build.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AuthoringPanel/AuthoringPanel.d.ts +7 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.js +49 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts +18 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.js +133 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.d.ts +2 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.js +16 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.d.ts +81 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.js +2 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.d.ts +6 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.js +41 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.js.map +1 -0
- package/lib/components/AuthoringPanel/index.d.ts +4 -0
- package/lib/components/AuthoringPanel/index.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/index.js +3 -0
- package/lib/components/AuthoringPanel/index.js.map +1 -0
- package/lib/components/Automation/Automation.d.ts +7 -0
- package/lib/components/Automation/Automation.d.ts.map +1 -0
- package/lib/components/Automation/Automation.js +113 -0
- package/lib/components/Automation/Automation.js.map +1 -0
- package/lib/components/Automation/Automation.styles.d.ts +12 -0
- package/lib/components/Automation/Automation.styles.d.ts.map +1 -0
- package/lib/components/Automation/Automation.styles.js +68 -0
- package/lib/components/Automation/Automation.styles.js.map +1 -0
- package/lib/components/Automation/Automation.test-ids.d.ts +3 -0
- package/lib/components/Automation/Automation.test-ids.d.ts.map +1 -0
- package/lib/components/Automation/Automation.test-ids.js +21 -0
- package/lib/components/Automation/Automation.test-ids.js.map +1 -0
- package/lib/components/Automation/Automation.types.d.ts +95 -0
- package/lib/components/Automation/Automation.types.d.ts.map +1 -0
- package/lib/components/Automation/Automation.types.js +18 -0
- package/lib/components/Automation/Automation.types.js.map +1 -0
- package/lib/components/Automation/Automation.utils.d.ts +109 -0
- package/lib/components/Automation/Automation.utils.d.ts.map +1 -0
- package/lib/components/Automation/Automation.utils.js +208 -0
- package/lib/components/Automation/Automation.utils.js.map +1 -0
- package/lib/components/Automation/AutomationContext.d.ts +4 -0
- package/lib/components/Automation/AutomationContext.d.ts.map +1 -0
- package/lib/components/Automation/AutomationContext.js +9 -0
- package/lib/components/Automation/AutomationContext.js.map +1 -0
- package/lib/components/Automation/RuleStep.d.ts +7 -0
- package/lib/components/Automation/RuleStep.d.ts.map +1 -0
- package/lib/components/Automation/RuleStep.js +151 -0
- package/lib/components/Automation/RuleStep.js.map +1 -0
- package/lib/components/Automation/index.d.ts +5 -0
- package/lib/components/Automation/index.d.ts.map +1 -0
- package/lib/components/Automation/index.js +4 -0
- package/lib/components/Automation/index.js.map +1 -0
- package/lib/components/DynamicInput/BooleanControl.d.ts +2 -2
- package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
- package/lib/components/DynamicInput/ConstantControl.d.ts +61 -0
- package/lib/components/DynamicInput/ConstantControl.d.ts.map +1 -0
- package/lib/components/DynamicInput/ConstantControl.js +58 -0
- package/lib/components/DynamicInput/ConstantControl.js.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.d.ts +2 -2
- package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.js +13 -63
- package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts +0 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.js +48 -41
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.d.ts +26 -81
- package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
- package/lib/components/DynamicInput/index.d.ts +2 -0
- package/lib/components/DynamicInput/index.d.ts.map +1 -1
- package/lib/components/DynamicInput/index.js +1 -0
- package/lib/components/DynamicInput/index.js.map +1 -1
- package/lib/components/DynamicInput/utils.d.ts.map +1 -1
- package/lib/components/DynamicInput/utils.js +3 -2
- package/lib/components/DynamicInput/utils.js.map +1 -1
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.d.ts +34 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.d.ts.map +1 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.js +55 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.js.map +1 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.d.ts +2 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.d.ts.map +1 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.js +10 -0
- package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.js.map +1 -0
- package/lib/components/EmptyRuleTemplate/index.d.ts +3 -0
- package/lib/components/EmptyRuleTemplate/index.d.ts.map +1 -0
- package/lib/components/EmptyRuleTemplate/index.js +2 -0
- package/lib/components/EmptyRuleTemplate/index.js.map +1 -0
- package/lib/components/Expression/Expression.d.ts.map +1 -1
- package/lib/components/Expression/Expression.js +8 -7
- package/lib/components/Expression/Expression.js.map +1 -1
- package/lib/components/Expression/Expression.styles.d.ts +5 -1
- package/lib/components/Expression/Expression.styles.d.ts.map +1 -1
- package/lib/components/Expression/Expression.styles.js +15 -3
- package/lib/components/Expression/Expression.styles.js.map +1 -1
- package/lib/components/Expression/Expression.test-ids.d.ts +1 -0
- package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -1
- package/lib/components/Expression/Expression.test-ids.js +6 -0
- package/lib/components/Expression/Expression.test-ids.js.map +1 -1
- package/lib/components/Expression/ExpressionBuilderModal.d.ts +6 -0
- package/lib/components/Expression/ExpressionBuilderModal.d.ts.map +1 -0
- package/lib/components/Expression/ExpressionBuilderModal.js +53 -0
- package/lib/components/Expression/ExpressionBuilderModal.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +3 -2
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +4 -2
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js +66 -25
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +18 -2
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +80 -13
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.d.ts +5 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.js +22 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.js.map +1 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +33 -5
- 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 +4 -2
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.js +6 -4
- package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +4 -2
- package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionItem.js +8 -6
- package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts +4 -2
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.js +17 -5
- package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts +1 -0
- package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/index.js +1 -0
- package/lib/components/ExpressionBuilder/index.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts +16 -2
- 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/FieldReferenceInput.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.js +5 -5
- package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
- package/lib/components/FieldReference/helpers.d.ts +7 -1
- package/lib/components/FieldReference/helpers.d.ts.map +1 -1
- package/lib/components/FieldReference/helpers.js +31 -1
- package/lib/components/FieldReference/helpers.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/iconUtils.d.ts +2 -1
- package/lib/components/IconTile/iconUtils.d.ts.map +1 -1
- package/lib/components/IconTile/iconUtils.js +94 -1
- package/lib/components/IconTile/iconUtils.js.map +1 -1
- 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 +1 -0
- package/lib/components/IconTile/index.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts +0 -1
- package/lib/components/LifeCycle/Category.d.ts.map +1 -1
- package/lib/components/LifeCycle/Category.js +16 -56
- package/lib/components/LifeCycle/Category.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.js +2 -2
- package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +37 -2
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.js +9 -9
- package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleDragDropList.js +25 -3
- package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -1
- package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
- package/lib/components/LifeCycle/Stage.js +20 -11
- package/lib/components/LifeCycle/Stage.js.map +1 -1
- package/lib/components/LifeCycle/Step.d.ts.map +1 -1
- package/lib/components/LifeCycle/Step.js +1 -0
- package/lib/components/LifeCycle/Step.js.map +1 -1
- package/lib/components/LifeCycle/Task.d.ts +7 -1
- package/lib/components/LifeCycle/Task.d.ts.map +1 -1
- package/lib/components/LifeCycle/Task.js +19 -10
- package/lib/components/LifeCycle/Task.js.map +1 -1
- package/lib/components/LifeCycle/TaskGroup.d.ts +23 -0
- package/lib/components/LifeCycle/TaskGroup.d.ts.map +1 -0
- package/lib/components/LifeCycle/TaskGroup.js +92 -0
- package/lib/components/LifeCycle/TaskGroup.js.map +1 -0
- package/lib/components/LifeCycle/index.d.ts +1 -1
- package/lib/components/LifeCycle/index.d.ts.map +1 -1
- package/lib/components/LifeCycle/index.js +1 -1
- package/lib/components/LifeCycle/index.js.map +1 -1
- package/lib/components/LifeCycle/utils.d.ts +6 -1
- package/lib/components/LifeCycle/utils.d.ts.map +1 -1
- package/lib/components/LifeCycle/utils.js +129 -0
- package/lib/components/LifeCycle/utils.js.map +1 -1
- package/lib/components/ObjectSelect/InputTree/InputTree.d.ts +21 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.d.ts.map +1 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.js +20 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.js.map +1 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.styles.d.ts +10 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.styles.d.ts.map +1 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.styles.js +82 -0
- package/lib/components/ObjectSelect/InputTree/InputTree.styles.js.map +1 -0
- package/lib/components/ObjectSelect/InputTree/index.d.ts +3 -0
- package/lib/components/ObjectSelect/InputTree/index.d.ts.map +1 -0
- package/lib/components/ObjectSelect/InputTree/index.js +2 -0
- package/lib/components/ObjectSelect/InputTree/index.js.map +1 -0
- package/lib/components/ObjectSelect/ObjectPicker.d.ts +11 -5
- package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.js +24 -15
- package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
- package/lib/components/ObjectSelect/ObjectSelect.d.ts +2 -29
- package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectSelect.js +80 -23
- package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
- package/lib/components/ObjectSelect/ObjectSelect.types.d.ts +53 -0
- package/lib/components/ObjectSelect/ObjectSelect.types.d.ts.map +1 -0
- package/lib/components/ObjectSelect/ObjectSelect.types.js +2 -0
- package/lib/components/ObjectSelect/ObjectSelect.types.js.map +1 -0
- package/lib/components/ObjectSelect/index.d.ts +1 -1
- package/lib/components/ObjectSelect/index.d.ts.map +1 -1
- package/lib/components/ObjectSelect/index.js.map +1 -1
- package/lib/components/ObjectSelect/useCreateModal.d.ts +6 -2
- package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
- package/lib/components/ObjectSelect/useCreateModal.js +7 -4
- package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
- package/lib/components/PageBanner/PageBanner.d.ts +6 -4
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.js +10 -9
- package/lib/components/PageBanner/PageBanner.js.map +1 -1
- package/lib/components/PageBanner/PageBanner.test-ids.d.ts +2 -0
- package/lib/components/PageBanner/PageBanner.test-ids.d.ts.map +1 -0
- package/lib/components/PageBanner/PageBanner.test-ids.js +9 -0
- package/lib/components/PageBanner/PageBanner.test-ids.js.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.d.ts +12 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.d.ts.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.js +158 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.js.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.d.ts +5 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.d.ts.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.js +17 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.js.map +1 -0
- package/lib/components/PageTemplates/GalleryPage.d.ts +14 -4
- package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.js +57 -12
- package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
- package/lib/components/PageTemplates/HeaderActionButtons.d.ts +5 -0
- package/lib/components/PageTemplates/HeaderActionButtons.d.ts.map +1 -0
- package/lib/components/PageTemplates/HeaderActionButtons.js +14 -0
- package/lib/components/PageTemplates/HeaderActionButtons.js.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.d.ts +8 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.d.ts.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.js +23 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.js.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.d.ts +5 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.d.ts.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.js +10 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.js.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.d.ts +5 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.d.ts.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.js +10 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.js.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.d.ts +21 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.d.ts.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.js +22 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.js.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.styles.d.ts +16 -0
- package/lib/components/PageTemplates/PageTemplate.styles.d.ts.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.styles.js +167 -0
- package/lib/components/PageTemplates/PageTemplate.styles.js.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.types.d.ts +114 -0
- package/lib/components/PageTemplates/PageTemplate.types.d.ts.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.types.js +2 -0
- package/lib/components/PageTemplates/PageTemplate.types.js.map +1 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts +16 -12
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +12 -12
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.test-ids.d.ts +4 -0
- package/lib/components/PageTemplates/PageTemplates.test-ids.d.ts.map +1 -0
- package/lib/components/PageTemplates/PageTemplates.test-ids.js +25 -0
- package/lib/components/PageTemplates/PageTemplates.test-ids.js.map +1 -0
- 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 +5 -6
- package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +6 -1
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +5 -1
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/components/RulePicker/RulePicker.d.ts +4 -0
- package/lib/components/RulePicker/RulePicker.d.ts.map +1 -0
- package/lib/components/RulePicker/RulePicker.js +81 -0
- package/lib/components/RulePicker/RulePicker.js.map +1 -0
- package/lib/index.d.ts +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/typeIconMapping.js +1 -1
- package/lib/utils/typeIconMapping.js.map +1 -1
- package/package.json +4 -4
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -2
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -14
- package/lib/utils/utils.d.ts.map +0 -1
- package/lib/utils/utils.js +0 -13
- package/lib/utils/utils.js.map +0 -1
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { defaultThemeProp, StyledButton, StyledLabel, StyledText, Text } from '@pega/cosmos-react-core';
|
|
2
|
+
import { defaultThemeProp, StyledButton, StyledLabel, StyledText, Text, Flex, FormField } from '@pega/cosmos-react-core';
|
|
3
|
+
const contentWidth = 'content-width';
|
|
4
|
+
const borderLine = 'border-line';
|
|
3
5
|
export const StyledPrimaryText = styled(Text) `
|
|
4
6
|
word-break: break-word;
|
|
5
7
|
`;
|
|
6
|
-
export const
|
|
8
|
+
export const StyledExpressionExplanation = styled.div(({ theme }) => {
|
|
7
9
|
return css `
|
|
8
10
|
padding-block: ${theme.base.spacing};
|
|
9
11
|
padding-inline: calc(0.5 * ${theme.base.spacing});
|
|
10
12
|
`;
|
|
11
13
|
});
|
|
12
|
-
|
|
13
|
-
export const StyledExpressionList = styled.ul `
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
StyledExpressionExplanation.defaultProps = defaultThemeProp;
|
|
15
|
+
export const StyledExpressionList = styled.ul(({ theme: { base: { spacing } } }) => css `
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
list-style: none;
|
|
19
|
+
padding-inline-end: ${spacing};
|
|
20
|
+
`);
|
|
21
|
+
StyledExpressionList.defaultProps = defaultThemeProp;
|
|
22
|
+
export const StyledExpressionBuilder = styled(Flex)(({ theme, showEditorOnly, showGenerateExpression }) => {
|
|
19
23
|
return css `
|
|
20
24
|
position: relative;
|
|
21
25
|
background-color: ${theme.base.palette['primary-background']};
|
|
22
26
|
min-height: calc(30 * ${theme.base.spacing});
|
|
23
27
|
max-height: 100%;
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
${showGenerateExpression &&
|
|
29
|
+
css `
|
|
30
|
+
${StyledExpressionList} {
|
|
31
|
+
overflow-y: unset;
|
|
32
|
+
}
|
|
33
|
+
`}
|
|
34
|
+
${showEditorOnly
|
|
35
|
+
? css `
|
|
36
|
+
width: max-content;
|
|
37
|
+
`
|
|
38
|
+
: css `
|
|
39
|
+
min-width: calc(${theme.base[contentWidth].lg} + 4 * ${theme.base.spacing});
|
|
40
|
+
`}
|
|
41
|
+
border: 0.0625rem solid ${theme.base.palette[borderLine]};
|
|
42
|
+
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
26
43
|
`;
|
|
27
44
|
});
|
|
28
45
|
StyledExpressionBuilder.defaultProps = defaultThemeProp;
|
|
@@ -38,7 +55,7 @@ export const StyledParamsGroup = styled.div(({ theme }) => {
|
|
|
38
55
|
StyledParamsGroup.defaultProps = defaultThemeProp;
|
|
39
56
|
export const StyledInputParamsGroup = styled(StyledParamsGroup)(({ theme }) => {
|
|
40
57
|
return css `
|
|
41
|
-
max-width: ${theme.base[
|
|
58
|
+
max-width: ${theme.base[contentWidth].lg};
|
|
42
59
|
`;
|
|
43
60
|
});
|
|
44
61
|
StyledInputParamsGroup.defaultProps = defaultThemeProp;
|
|
@@ -64,7 +81,7 @@ export const StyledExpressionItem = styled.li(({ theme, expanded }) => {
|
|
|
64
81
|
`}
|
|
65
82
|
|
|
66
83
|
:not(:last-child) {
|
|
67
|
-
border-bottom: 0.0625rem solid ${theme.base.palette[
|
|
84
|
+
border-bottom: 0.0625rem solid ${theme.base.palette[borderLine]};
|
|
68
85
|
}
|
|
69
86
|
|
|
70
87
|
${StyledExpressionDetails} {
|
|
@@ -78,4 +95,54 @@ export const StyledExpressionItem = styled.li(({ theme, expanded }) => {
|
|
|
78
95
|
`;
|
|
79
96
|
});
|
|
80
97
|
StyledExpressionItem.defaultProps = defaultThemeProp;
|
|
98
|
+
export const StyledClearButton = styled.button `
|
|
99
|
+
align-self: flex-end;
|
|
100
|
+
`;
|
|
101
|
+
export const StyledExplanationContainer = styled.div `
|
|
102
|
+
position: relative;
|
|
103
|
+
> div:nth-child(2) {
|
|
104
|
+
margin-block: 0;
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
export const StyledExpressionWrapper = styled.div(({ theme }) => css `
|
|
108
|
+
overflow-y: auto;
|
|
109
|
+
border-inline-start: 0.0625rem solid ${theme.base.palette[borderLine]};
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
flex-wrap: nowrap;
|
|
112
|
+
`);
|
|
113
|
+
StyledExpressionWrapper.defaultProps = defaultThemeProp;
|
|
114
|
+
export const StyledCodeEditorContainer = styled.div(({ explainEnabled }) => {
|
|
115
|
+
return css `
|
|
116
|
+
${explainEnabled &&
|
|
117
|
+
css `
|
|
118
|
+
min-height: 10rem;
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
flex-grow: 1;
|
|
121
|
+
`}
|
|
122
|
+
`;
|
|
123
|
+
});
|
|
124
|
+
export const StyledExplainContainer = styled.div `
|
|
125
|
+
min-height: 2rem;
|
|
126
|
+
`;
|
|
127
|
+
export const StyledExpressions = styled.div `
|
|
128
|
+
overflow-y: auto;
|
|
129
|
+
`;
|
|
130
|
+
export const StyledFormField = styled(FormField) `
|
|
131
|
+
height: inherit;
|
|
132
|
+
width: 100%;
|
|
133
|
+
`;
|
|
134
|
+
export const StyledGeneratedExpression = styled.div `
|
|
135
|
+
position: relative;
|
|
136
|
+
> div:nth-child(3) {
|
|
137
|
+
margin-block: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.react-codemirror2 {
|
|
141
|
+
height: ${props => props.theme.components['text-area']['min-height']};
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
StyledGeneratedExpression.defaultProps = defaultThemeProp;
|
|
145
|
+
export const StyledInsertButton = styled.button `
|
|
146
|
+
align-self: flex-end;
|
|
147
|
+
`;
|
|
81
148
|
//# sourceMappingURL=ExpressionBuilder.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionBuilder.styles.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,IAAI,
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.styles.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,SAAS,EACV,MAAM,yBAAyB,CAAC;AAKjC,MAAM,YAAY,GAAG,eAAe,CAAC;AACrC,MAAM,UAAU,GAAG,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE5C,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClE,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,OAAO;iCACN,KAAK,CAAC,IAAI,CAAC,OAAO;GAChD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,2BAA2B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAC3C,CAAC,E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AM,CAAC,MAAM,CAAA;;CAE7C,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKnD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAC/C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;2CAEuB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;;;GAGtE,CACF,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CACjD,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;IACrB,OAAO,GAAG,CAAA;QACN,cAAc;QAChB,GAAG,CAAA;;;;OAIF;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE/C,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE1C,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;;CAG/C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;cAOrC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;;CAEvE,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAA;;CAE9C,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StyledButton,\n StyledLabel,\n StyledText,\n Text,\n Flex,\n FormField\n} from '@pega/cosmos-react-core';\n\nimport type { ExpressionItemProps } from './ExpressionBuilder.types';\nimport type { CodeEditorProps } from './CodeEditor/CodeEditor.types';\n\nconst contentWidth = 'content-width';\nconst borderLine = 'border-line';\n\nexport const StyledPrimaryText = styled(Text)`\n word-break: break-word;\n`;\n\nexport const StyledExpressionExplanation = styled.div(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n padding-inline: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledExpressionExplanation.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionList = styled.ul(\n ({\n theme: {\n base: { spacing }\n }\n }) => css`\n overflow-y: auto;\n flex-grow: 1;\n list-style: none;\n padding-inline-end: ${spacing};\n `\n);\n\nStyledExpressionList.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionBuilder = styled(Flex)<\n Pick<CodeEditorProps, 'showEditorOnly'> & { showGenerateExpression: boolean }\n>(({ theme, showEditorOnly, showGenerateExpression }) => {\n return css`\n position: relative;\n background-color: ${theme.base.palette['primary-background']};\n min-height: calc(30 * ${theme.base.spacing});\n max-height: 100%;\n ${showGenerateExpression &&\n css`\n ${StyledExpressionList} {\n overflow-y: unset;\n }\n `}\n ${showEditorOnly\n ? css`\n width: max-content;\n `\n : css`\n min-width: calc(${theme.base[contentWidth].lg} + 4 * ${theme.base.spacing});\n `}\n border: 0.0625rem solid ${theme.base.palette[borderLine]};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n `;\n});\nStyledExpressionBuilder.defaultProps = defaultThemeProp;\n\nexport const StyledParamsGroup = styled.div(({ theme }) => {\n return css`\n margin-block-start: calc(2 * ${theme.base.spacing});\n\n ${StyledText} {\n margin-block-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledParamsGroup.defaultProps = defaultThemeProp;\n\nexport const StyledInputParamsGroup = styled(StyledParamsGroup)(({ theme }) => {\n return css`\n max-width: ${theme.base[contentWidth].lg};\n `;\n});\n\nStyledInputParamsGroup.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionDetails = styled.div``;\n\nStyledExpressionDetails.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseContent = styled.div(({ theme }) => {\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block-end: calc(2 * ${theme.base.spacing});\n ${StyledButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledExpandCollapseContent.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionItem = styled.li<{\n expanded: ExpressionItemProps['expanded'];\n}>(({ theme, expanded }) => {\n return css`\n list-style: none;\n background-color: ${theme.base.palette['primary-background']};\n ${expanded &&\n css`\n background-color: ${theme.base.palette['secondary-background']};\n `}\n\n :not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette[borderLine]};\n }\n\n ${StyledExpressionDetails} {\n padding-block-end: calc(2 * ${theme.base.spacing});\n }\n\n ${StyledLabel} {\n margin-inline-end: calc(0.5 * ${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n }\n `;\n});\n\nStyledExpressionItem.defaultProps = defaultThemeProp;\n\nexport const StyledClearButton = styled.button`\n align-self: flex-end;\n`;\n\nexport const StyledExplanationContainer = styled.div`\n position: relative;\n > div:nth-child(2) {\n margin-block: 0;\n }\n`;\n\nexport const StyledExpressionWrapper = styled.div(\n ({ theme }) => css`\n overflow-y: auto;\n border-inline-start: 0.0625rem solid ${theme.base.palette[borderLine]};\n justify-content: space-between;\n flex-wrap: nowrap;\n `\n);\n\nStyledExpressionWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditorContainer = styled.div<{ explainEnabled: boolean }>(\n ({ explainEnabled }) => {\n return css`\n ${explainEnabled &&\n css`\n min-height: 10rem;\n overflow-y: auto;\n flex-grow: 1;\n `}\n `;\n }\n);\n\nexport const StyledExplainContainer = styled.div`\n min-height: 2rem;\n`;\n\nexport const StyledExpressions = styled.div`\n overflow-y: auto;\n`;\n\nexport const StyledFormField = styled(FormField)`\n height: inherit;\n width: 100%;\n`;\n\nexport const StyledGeneratedExpression = styled.div`\n position: relative;\n > div:nth-child(3) {\n margin-block: 0;\n }\n\n .react-codemirror2 {\n height: ${props => props.theme.components['text-area']['min-height']};\n }\n`;\n\nStyledGeneratedExpression.defaultProps = defaultThemeProp;\n\nexport const StyledInsertButton = styled.button`\n align-self: flex-end;\n`;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getExpressionBuilderIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["search", "explanation", "explain", "clear", "insert", "generate", "generated-expression", "describe-expression"]>;
|
|
2
|
+
export declare const getExpressionListTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<never[]>;
|
|
3
|
+
export declare const getExpressionDetailsTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["primary-fields", "output-params"]>;
|
|
4
|
+
export declare const getExpressionItemsTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["collapse-item-button", "add-item-button", "add-item"]>;
|
|
5
|
+
//# sourceMappingURL=ExpressionBuilder.test-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,uPASzB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,mIAA4B,CAAC;AAElE,eAAO,MAAM,2BAA2B,wKAG7B,CAAC;AAEZ,eAAO,MAAM,yBAAyB,4LAI3B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createTestIds } from '@pega/cosmos-react-core';
|
|
2
|
+
export const getExpressionBuilderIds = createTestIds('expression-builder', [
|
|
3
|
+
'search',
|
|
4
|
+
'explanation',
|
|
5
|
+
'explain',
|
|
6
|
+
'clear',
|
|
7
|
+
'insert',
|
|
8
|
+
'generate',
|
|
9
|
+
'generated-expression',
|
|
10
|
+
'describe-expression'
|
|
11
|
+
]);
|
|
12
|
+
export const getExpressionListTestIds = createTestIds('list', []);
|
|
13
|
+
export const getExpressionDetailsTestIds = createTestIds('content', [
|
|
14
|
+
'primary-fields',
|
|
15
|
+
'output-params'
|
|
16
|
+
]);
|
|
17
|
+
export const getExpressionItemsTestIds = createTestIds('item', [
|
|
18
|
+
'collapse-item-button',
|
|
19
|
+
'add-item-button',
|
|
20
|
+
'add-item'
|
|
21
|
+
]);
|
|
22
|
+
//# sourceMappingURL=ExpressionBuilder.test-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.test-ids.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,oBAAoB,EAAE;IACzE,QAAQ;IACR,aAAa;IACb,SAAS;IACT,OAAO;IACP,QAAQ;IACR,UAAU;IACV,sBAAsB;IACtB,qBAAqB;CACb,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,aAAa,CAAC,SAAS,EAAE;IAClE,gBAAgB;IAChB,eAAe;CACP,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC,MAAM,EAAE;IAC7D,sBAAsB;IACtB,iBAAiB;IACjB,UAAU;CACF,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getExpressionBuilderIds = createTestIds('expression-builder', [\n 'search',\n 'explanation',\n 'explain',\n 'clear',\n 'insert',\n 'generate',\n 'generated-expression',\n 'describe-expression'\n] as const);\n\nexport const getExpressionListTestIds = createTestIds('list', []);\n\nexport const getExpressionDetailsTestIds = createTestIds('content', [\n 'primary-fields',\n 'output-params'\n] as const);\n\nexport const getExpressionItemsTestIds = createTestIds('item', [\n 'collapse-item-button',\n 'add-item-button',\n 'add-item'\n] as const);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, Ref } from 'react';
|
|
2
|
-
import type { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, FieldValueListProps, MenuProps } from '@pega/cosmos-react-core';
|
|
2
|
+
import type { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, FieldValueListProps, MenuProps, TestIdProp, FormControlProps, TextAreaProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { CodeEditorProps, CustomPositionProps } from './CodeEditor/CodeEditor.types';
|
|
4
|
-
export interface ExpressionItemProps {
|
|
4
|
+
export interface ExpressionItemProps extends TestIdProp {
|
|
5
5
|
/** Id of the item */
|
|
6
6
|
id: string;
|
|
7
7
|
/** Item name to be displayed as rule name */
|
|
@@ -24,7 +24,7 @@ export interface ExpressionItemProps {
|
|
|
24
24
|
value: string;
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export interface ExpressionListProps extends BaseProps {
|
|
27
|
+
export interface ExpressionListProps extends BaseProps, TestIdProp {
|
|
28
28
|
ref?: Ref<HTMLUListElement>;
|
|
29
29
|
/** Expression builder items */
|
|
30
30
|
items?: OmitStrict<ExpressionItemProps, 'onAdd' | 'onExpand' | 'onCollapse' | 'details'>[];
|
|
@@ -47,7 +47,9 @@ export interface HandleValue {
|
|
|
47
47
|
/** Insert the expression value */
|
|
48
48
|
insertExpression?: (expression: string, replaceContent?: boolean, customCursorPosition?: CustomPositionProps) => void;
|
|
49
49
|
}
|
|
50
|
-
export interface ExpressionBuilderProps extends BaseProps,
|
|
50
|
+
export interface ExpressionBuilderProps extends BaseProps, TestIdProp, Pick<FormControlProps, 'required' | 'label' | 'additionalInfo'>, Pick<CodeEditorProps, 'defaultValue' | 'errors' | 'readOnly' | 'fetchSuggestions' | 'autoCompleteTriggers' | 'loading' | 'onBlur' | 'onChange' | 'inLineErrors' | 'isSingleLine' | 'aria-describedby'> {
|
|
51
|
+
/** Placeholder text for the editor */
|
|
52
|
+
placeholder?: string;
|
|
51
53
|
ref?: Ref<HTMLDivElement>;
|
|
52
54
|
/** Expression items list */
|
|
53
55
|
list: OmitStrict<ExpressionListProps, 'ref' | 'onItemAdd'> & {
|
|
@@ -57,13 +59,39 @@ export interface ExpressionBuilderProps extends BaseProps, OmitStrict<CodeEditor
|
|
|
57
59
|
search: Pick<Required<SearchInputProps>, 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'> & Pick<SearchInputProps, 'defaultFilter'> & Pick<MenuProps, 'accent'>;
|
|
58
60
|
/** Imperative handle */
|
|
59
61
|
handle?: Ref<HandleValue>;
|
|
62
|
+
/** Show only editor instead of expression list and expression details */
|
|
63
|
+
showEditorOnly?: boolean;
|
|
64
|
+
/** Expression explanation */
|
|
65
|
+
generateExplanation: {
|
|
66
|
+
loadingExplanation?: boolean;
|
|
67
|
+
/** Explain expression */
|
|
68
|
+
onExplain: () => void;
|
|
69
|
+
/** Clearing explanation */
|
|
70
|
+
onClearExplanation: () => void;
|
|
71
|
+
/** Explanation of expression generated from AI */
|
|
72
|
+
explanation?: string;
|
|
73
|
+
};
|
|
74
|
+
generateExpression?: {
|
|
75
|
+
/** Describe expression textarea */
|
|
76
|
+
describeExpressionTextArea?: Pick<TextAreaProps, 'additionalInfo' | 'placeholder' | 'defaultValue'> & {
|
|
77
|
+
error?: string;
|
|
78
|
+
};
|
|
79
|
+
/** Generate expression callback */
|
|
80
|
+
onGenerateExpression: (prompt: string) => void;
|
|
81
|
+
/** Expression generation in-progress */
|
|
82
|
+
loadingExpression?: boolean;
|
|
83
|
+
/** Expression generated from AI */
|
|
84
|
+
generatedExpression?: string;
|
|
85
|
+
/** Insert expression callback */
|
|
86
|
+
onInsert: (generatedExpression: string) => void;
|
|
87
|
+
};
|
|
60
88
|
}
|
|
61
89
|
export interface InputParams<P> {
|
|
62
90
|
id: string;
|
|
63
91
|
renderer: ComponentType<P>;
|
|
64
92
|
rendererProps: P;
|
|
65
93
|
}
|
|
66
|
-
export interface ExpressionDetailsProps extends BaseProps {
|
|
94
|
+
export interface ExpressionDetailsProps extends BaseProps, TestIdProp {
|
|
67
95
|
/** Primary details of the expression */
|
|
68
96
|
primary: Required<FieldValueListProps['fields']>;
|
|
69
97
|
/** Output params of the expression */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionBuilder.types.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.types.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,MAAM,WAAW,mBAAoB,SA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AAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionBuilder.types.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentType, Ref } from 'react';\n\nimport type {\n BaseProps,\n EmptyStateProps,\n OmitStrict,\n SearchInputProps,\n FieldValueListProps,\n MenuProps\n} from '@pega/cosmos-react-core';\n\nimport type { CodeEditorProps, CustomPositionProps } from './CodeEditor/CodeEditor.types';\n\nexport interface ExpressionItemProps {\n /** Id of the item */\n id: string;\n /** Item name to be displayed as rule name */\n primary: string;\n /** Type of expression item. Eg: Decision, When, Automation etc. */\n type: string;\n /** Callback for add event */\n onAdd: (id: ExpressionItemProps['id']) => void;\n /** Callback for expand event */\n onExpand?: (id: ExpressionItemProps['id']) => void;\n /** Callback for collapse event */\n onCollapse?: (id: ExpressionItemProps['id']) => void;\n /** Show the expanded details */\n expanded?: boolean;\n /** Expression details to show in expanded view */\n details?: ExpressionDetailsProps;\n /** Matched field to be shown in expression item collapsed mode during search */\n matchedField?: { name: string; value: string };\n}\n\nexport interface ExpressionListProps extends BaseProps {\n ref?: Ref<HTMLUListElement>;\n /** Expression builder items */\n items?: OmitStrict<ExpressionItemProps, 'onAdd' | 'onExpand' | 'onCollapse' | 'details'>[];\n /** Callback for item add */\n onItemAdd: ExpressionItemProps['onAdd'];\n /** Callback for item expand */\n onItemExpand?: ExpressionItemProps['onExpand'];\n /** Callback for item collapse */\n onItemCollapse?: ExpressionItemProps['onCollapse'];\n /** No items */\n emptyText?: EmptyStateProps['message'];\n /** Expanded items data */\n details: {\n [id: string]: ExpressionDetailsProps;\n };\n}\n\nexport interface HandleValue {\n /** Returns the expression value */\n getExpression: () => string;\n /** Insert the expression value */\n insertExpression?: (\n expression: string,\n replaceContent?: boolean,\n customCursorPosition?: CustomPositionProps\n ) => void;\n}\n\nexport interface ExpressionBuilderProps\n extends BaseProps,\n
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.types.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentType, Ref } from 'react';\n\nimport type {\n BaseProps,\n EmptyStateProps,\n OmitStrict,\n SearchInputProps,\n FieldValueListProps,\n MenuProps,\n TestIdProp,\n FormControlProps,\n TextAreaProps\n} from '@pega/cosmos-react-core';\n\nimport type { CodeEditorProps, CustomPositionProps } from './CodeEditor/CodeEditor.types';\n\nexport interface ExpressionItemProps extends TestIdProp {\n /** Id of the item */\n id: string;\n /** Item name to be displayed as rule name */\n primary: string;\n /** Type of expression item. Eg: Decision, When, Automation etc. */\n type: string;\n /** Callback for add event */\n onAdd: (id: ExpressionItemProps['id']) => void;\n /** Callback for expand event */\n onExpand?: (id: ExpressionItemProps['id']) => void;\n /** Callback for collapse event */\n onCollapse?: (id: ExpressionItemProps['id']) => void;\n /** Show the expanded details */\n expanded?: boolean;\n /** Expression details to show in expanded view */\n details?: ExpressionDetailsProps;\n /** Matched field to be shown in expression item collapsed mode during search */\n matchedField?: { name: string; value: string };\n}\n\nexport interface ExpressionListProps extends BaseProps, TestIdProp {\n ref?: Ref<HTMLUListElement>;\n /** Expression builder items */\n items?: OmitStrict<ExpressionItemProps, 'onAdd' | 'onExpand' | 'onCollapse' | 'details'>[];\n /** Callback for item add */\n onItemAdd: ExpressionItemProps['onAdd'];\n /** Callback for item expand */\n onItemExpand?: ExpressionItemProps['onExpand'];\n /** Callback for item collapse */\n onItemCollapse?: ExpressionItemProps['onCollapse'];\n /** No items */\n emptyText?: EmptyStateProps['message'];\n /** Expanded items data */\n details: {\n [id: string]: ExpressionDetailsProps;\n };\n}\n\nexport interface HandleValue {\n /** Returns the expression value */\n getExpression: () => string;\n /** Insert the expression value */\n insertExpression?: (\n expression: string,\n replaceContent?: boolean,\n customCursorPosition?: CustomPositionProps\n ) => void;\n}\n\nexport interface ExpressionBuilderProps\n extends BaseProps,\n TestIdProp,\n Pick<FormControlProps, 'required' | 'label' | 'additionalInfo'>,\n Pick<\n CodeEditorProps,\n | 'defaultValue'\n | 'errors'\n | 'readOnly'\n | 'fetchSuggestions'\n | 'autoCompleteTriggers'\n | 'loading'\n | 'onBlur'\n | 'onChange'\n | 'inLineErrors'\n | 'isSingleLine'\n | 'aria-describedby'\n > {\n /** Placeholder text for the editor */\n placeholder?: string;\n ref?: Ref<HTMLDivElement>;\n /** Expression items list */\n list: OmitStrict<ExpressionListProps, 'ref' | 'onItemAdd'> & {\n onItemAdd: (id: ExpressionItemProps['id'], addExpression: (expression: string) => void) => void;\n };\n /** Search input props */\n search: Pick<\n Required<SearchInputProps>,\n 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'\n > &\n Pick<SearchInputProps, 'defaultFilter'> &\n Pick<MenuProps, 'accent'>;\n\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n /** Show only editor instead of expression list and expression details */\n showEditorOnly?: boolean;\n /** Expression explanation */\n generateExplanation: {\n loadingExplanation?: boolean;\n /** Explain expression */\n onExplain: () => void;\n /** Clearing explanation */\n onClearExplanation: () => void;\n /** Explanation of expression generated from AI */\n explanation?: string;\n };\n generateExpression?: {\n /** Describe expression textarea */\n describeExpressionTextArea?: Pick<\n TextAreaProps,\n 'additionalInfo' | 'placeholder' | 'defaultValue'\n > & {\n error?: string;\n };\n /** Generate expression callback */\n onGenerateExpression: (prompt: string) => void;\n /** Expression generation in-progress */\n loadingExpression?: boolean;\n /** Expression generated from AI */\n generatedExpression?: string;\n /** Insert expression callback */\n onInsert: (generatedExpression: string) => void;\n };\n}\n\nexport interface InputParams<P> {\n id: string;\n renderer: ComponentType<P>;\n rendererProps: P;\n}\n\nexport interface ExpressionDetailsProps extends BaseProps, TestIdProp {\n /** Primary details of the expression */\n primary: Required<FieldValueListProps['fields']>;\n /** Output params of the expression */\n outputParams?: Required<FieldValueListProps['fields']>;\n /** Input params of the expression */\n inputParams?: InputParams<any>[];\n /** Ref to the component */\n ref?: Ref<HTMLElement>;\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
|
|
2
2
|
import type { ExpressionDetailsProps } from './ExpressionBuilder.types';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
3
|
+
declare const _default: ForwardRefForwardPropsComponent<ExpressionDetailsProps> & {
|
|
4
|
+
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["primary-fields", "output-params"]>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
5
7
|
//# sourceMappingURL=ExpressionDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpressionDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;;;;AAmDxE,wBAA2E"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { FieldValueList, Flex, Text, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
+
import { FieldValueList, Flex, Text, useI18n, withTestIds, useTestIds } from '@pega/cosmos-react-core';
|
|
4
4
|
import { StyledExpressionDetails, StyledInputParamsGroup, StyledParamsGroup } from './ExpressionBuilder.styles';
|
|
5
|
-
|
|
5
|
+
import { getExpressionDetailsTestIds } from './ExpressionBuilder.test-ids';
|
|
6
|
+
const ExpressionDetails = forwardRef(function ExpressionDetails({ testId, primary, inputParams, outputParams, ...restProps }, ref) {
|
|
6
7
|
const t = useI18n();
|
|
7
|
-
|
|
8
|
+
const testIds = useTestIds(testId, getExpressionDetailsTestIds);
|
|
9
|
+
return (_jsxs(Flex, { "data-testid": testIds.root, ...restProps, ref: ref, container: { direction: 'column' }, as: StyledExpressionDetails, children: [_jsx(FieldValueList, { testId: testIds.primaryFields, fields: primary }), outputParams && (_jsxs(StyledParamsGroup, { children: [_jsx(Text, { variant: 'h4', children: t('output_parameters') }), _jsx(FieldValueList, { testId: testIds.outputParams, fields: outputParams })] })), inputParams && (_jsxs(StyledInputParamsGroup, { children: [_jsx(Text, { variant: 'h4', children: t('input_parameters') }), _jsx(Flex, { container: { direction: 'column', gap: 1 }, children: inputParams.map(({ id, renderer: Renderer, rendererProps }) => {
|
|
8
10
|
return _jsx(Renderer, { ...rendererProps }, id);
|
|
9
11
|
}) })] }))] }));
|
|
10
12
|
});
|
|
11
|
-
export default ExpressionDetails;
|
|
13
|
+
export default withTestIds(ExpressionDetails, getExpressionDetailsTestIds);
|
|
12
14
|
//# sourceMappingURL=ExpressionDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionDetails.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,
|
|
1
|
+
{"version":3,"file":"ExpressionDetails.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,WAAW,EACX,UAAU,EACX,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OA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e,WAAW,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n FieldValueList,\n Flex,\n Text,\n useI18n,\n withTestIds,\n useTestIds\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport type { ExpressionDetailsProps } from './ExpressionBuilder.types';\nimport {\n StyledExpressionDetails,\n StyledInputParamsGroup,\n StyledParamsGroup\n} from './ExpressionBuilder.styles';\nimport { getExpressionDetailsTestIds } from './ExpressionBuilder.test-ids';\n\nconst ExpressionDetails: ForwardRefForwardPropsComponent<ExpressionDetailsProps> = forwardRef(\n function ExpressionDetails(\n {\n testId,\n primary,\n inputParams,\n outputParams,\n ...restProps\n }: PropsWithoutRef<ExpressionDetailsProps>,\n ref: ExpressionDetailsProps['ref']\n ) {\n const t = useI18n();\n const testIds = useTestIds(testId as string, getExpressionDetailsTestIds);\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n ref={ref}\n container={{ direction: 'column' }}\n as={StyledExpressionDetails}\n >\n <FieldValueList testId={testIds.primaryFields} fields={primary} />\n {outputParams && (\n <StyledParamsGroup>\n <Text variant='h4'>{t('output_parameters')}</Text>\n <FieldValueList testId={testIds.outputParams} fields={outputParams} />\n </StyledParamsGroup>\n )}\n {inputParams && (\n <StyledInputParamsGroup>\n <Text variant='h4'>{t('input_parameters')}</Text>\n <Flex container={{ direction: 'column', gap: 1 }}>\n {inputParams.map(({ id, renderer: Renderer, rendererProps }) => {\n return <Renderer key={id} {...rendererProps} />;\n })}\n </Flex>\n </StyledInputParamsGroup>\n )}\n </Flex>\n );\n }\n);\n\nexport default withTestIds(ExpressionDetails, getExpressionDetailsTestIds);\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { FunctionComponent } from 'react';
|
|
2
2
|
import type { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { ExpressionItemProps } from './ExpressionBuilder.types';
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const _default: FunctionComponent<ExpressionItemProps & ForwardProps> & {
|
|
5
|
+
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["collapse-item-button", "add-item-button", "add-item"]>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
6
8
|
//# sourceMappingURL=ExpressionItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionItem.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpressionItem.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAiB/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;;;;AA2HrE,wBAAsE"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from 'react';
|
|
3
|
-
import { Button, ExpandCollapse, Flex, Icon, Mark, registerIcon, replaceMatchWithElement, StyledLabel, Text, useDirection, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
+
import { Button, ExpandCollapse, Flex, Icon, Mark, registerIcon, replaceMatchWithElement, StyledLabel, Text, useDirection, useI18n, useTestIds, withTestIds } from '@pega/cosmos-react-core';
|
|
4
4
|
import * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';
|
|
5
5
|
import * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';
|
|
6
|
-
import { StyledPrimaryText, StyledExpandCollapseContent,
|
|
6
|
+
import { StyledPrimaryText, StyledExpandCollapseContent, StyledExpressionExplanation, StyledExpressionItem } from './ExpressionBuilder.styles';
|
|
7
7
|
import ExpressionDetails from './ExpressionDetails';
|
|
8
8
|
import ExpressionBuilderContext from './ExpressionBuilderContext';
|
|
9
|
+
import { getExpressionItemsTestIds } from './ExpressionBuilder.test-ids';
|
|
9
10
|
registerIcon(caretLeftIcon, caretRightIcon);
|
|
10
|
-
const ExpressionItem = ({ id, primary, type, onAdd, onExpand, onCollapse, details, matchedField, expanded = false, ...restProps }) => {
|
|
11
|
+
const ExpressionItem = ({ id, testId, primary, type, onAdd, onExpand, onCollapse, details, matchedField, expanded = false, ...restProps }) => {
|
|
11
12
|
const { end: caretDirection } = useDirection();
|
|
12
13
|
const t = useI18n();
|
|
14
|
+
const testIds = useTestIds(testId, getExpressionItemsTestIds);
|
|
13
15
|
const { accent } = useContext(ExpressionBuilderContext);
|
|
14
16
|
const accentedText = (text) => {
|
|
15
17
|
if (accent) {
|
|
@@ -24,7 +26,7 @@ const ExpressionItem = ({ id, primary, type, onAdd, onExpand, onCollapse, detail
|
|
|
24
26
|
return expanded ? 'caret-down' : `caret-${caretDirection}`;
|
|
25
27
|
}, [expanded, caretDirection]);
|
|
26
28
|
const accentedMeta = matchedField && !expanded ? accentedText(matchedField.value) : undefined;
|
|
27
|
-
return (_jsxs(StyledExpressionItem, { expanded: expanded, children: [_jsxs(Flex, { ...restProps, as:
|
|
29
|
+
return (_jsxs(StyledExpressionItem, { expanded: expanded, children: [_jsxs(Flex, { "data-testid": testIds.root, ...restProps, as: StyledExpressionExplanation, id: id, container: { gap: 1, alignItems: 'start' }, children: [_jsx(Button, { "data-testid": testIds.collapseItemButton, icon: true, variant: 'simple', onClick: onCollapse || onExpand
|
|
28
30
|
? () => {
|
|
29
31
|
if (expanded) {
|
|
30
32
|
onCollapse?.(id);
|
|
@@ -33,7 +35,7 @@ const ExpressionItem = ({ id, primary, type, onAdd, onExpand, onCollapse, detail
|
|
|
33
35
|
onExpand?.(id);
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
|
-
: undefined, "aria-label": `${type}: ${primary}`, "aria-expanded": expanded, label: expanded ? t('collapse') : t('expand'), children: _jsx(Icon, { name: caretIcon }) }), _jsxs(Flex, { container: { alignItems: 'start', direction: 'column' }, item: { grow: 1 }, children: [_jsx(StyledPrimaryText, { variant: 'primary', children: !matchedField ? accentedText(primary) : primary }), accentedMeta ? (_jsxs("div", { children: [_jsxs(StyledLabel, { as: 'span', children: [matchedField?.name, ":"] }), accentedMeta] })) : (_jsx(Text, { variant: 'secondary', children: type }))] }), !expanded && (_jsx(Button, { icon: true, variant: 'simple', onClick: () => onAdd(id), "aria-label": t('add_noun', [`${type}: ${primary}`]), label: t('add'), children: _jsx(Icon, { name: 'plus' }) }))] }), _jsx(ExpandCollapse, { collapsed: !expanded, children: _jsxs(Flex, { as: StyledExpandCollapseContent, container: { direction: 'column' }, children: [details && _jsx(ExpressionDetails, { ...details }), _jsx(Button, { variant: 'primary', onClick: () => onAdd(id), "aria-label": t('add_noun', [`${type}: ${primary}`]), children: t('add') })] }) })] }));
|
|
38
|
+
: undefined, "aria-label": `${type}: ${primary}`, "aria-expanded": expanded, label: expanded ? t('collapse') : t('expand'), children: _jsx(Icon, { name: caretIcon }) }), _jsxs(Flex, { container: { alignItems: 'start', direction: 'column' }, item: { grow: 1 }, children: [_jsx(StyledPrimaryText, { variant: 'primary', children: !matchedField ? accentedText(primary) : primary }), accentedMeta ? (_jsxs("div", { children: [_jsxs(StyledLabel, { as: 'span', children: [matchedField?.name, ":"] }), accentedMeta] })) : (_jsx(Text, { variant: 'secondary', children: type }))] }), !expanded && (_jsx(Button, { "data-testid": testIds.addItemButton, icon: true, variant: 'simple', onClick: () => onAdd(id), "aria-label": t('add_noun', [`${type}: ${primary}`]), label: t('add'), children: _jsx(Icon, { name: 'plus' }) }))] }), _jsx(ExpandCollapse, { collapsed: !expanded, children: _jsxs(Flex, { as: StyledExpandCollapseContent, container: { direction: 'column' }, children: [details && _jsx(ExpressionDetails, { testId: testIds.root, ...details }), _jsx(Button, { "data-testid": testIds.addItem, variant: 'primary', onClick: () => onAdd(id), "aria-label": t('add_noun', [`${type}: ${primary}`]), children: t('add') })] }) })] }));
|
|
37
39
|
};
|
|
38
|
-
export default ExpressionItem;
|
|
40
|
+
export default withTestIds(ExpressionItem, getExpressionItemsTestIds);
|
|
39
41
|
//# sourceMappingURL=ExpressionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionItem.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EACL,MAAM,EACN,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"ExpressionItem.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EACL,MAAM,EACN,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,cAAc,MAAM,oEAAoE,CAAC;AACrG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAGnG,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,4BAA4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,0BACE,MAAC,WAAW,IAAC,EAAE,EAAC,MAAM,aAAE,YAAY,EAAE,IAAI,SAAgB,EACzD,YAAY,IACT,CACP,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,IAAI,GAAQ,CACxC,IACI,EAEN,CAAC,QAAQ,IAAI,CACZ,KAAC,MAAM,mBACQ,OAAO,CAAC,aAAa,EAClC,IAAI,QACJ,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,gBACZ,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,EAClD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAEf,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,CACV,IACI,EACP,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,QAAQ,YAClC,MAAC,IAAI,IAAC,EAAE,EAAE,2BAA2B,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aACtE,OAAO,IAAI,KAAC,iBAAiB,IAAC,MAAM,EAAE,OAAO,CAAC,IAAI,KAAM,OAAO,GAAI,EACpE,KAAC,MAAM,mBACQ,OAAO,CAAC,OAAO,EAC5B,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,gBACZ,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,YAEjD,CAAC,CAAC,KAAK,CAAC,GACF,IACJ,GACQ,IACI,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,cAAc,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport type { FunctionComponent } from 'react';\n\nimport {\n Button,\n ExpandCollapse,\n Flex,\n Icon,\n Mark,\n registerIcon,\n replaceMatchWithElement,\n StyledLabel,\n Text,\n useDirection,\n useI18n,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\n\nimport type { ExpressionItemProps } from './ExpressionBuilder.types';\nimport {\n StyledPrimaryText,\n StyledExpandCollapseContent,\n StyledExpressionExplanation,\n StyledExpressionItem\n} from './ExpressionBuilder.styles';\nimport ExpressionDetails from './ExpressionDetails';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\nimport { getExpressionItemsTestIds } from './ExpressionBuilder.test-ids';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nconst ExpressionItem: FunctionComponent<ExpressionItemProps & ForwardProps> = ({\n id,\n testId,\n primary,\n type,\n onAdd,\n onExpand,\n onCollapse,\n details,\n matchedField,\n expanded = false,\n ...restProps\n}) => {\n const { end: caretDirection } = useDirection();\n const t = useI18n();\n const testIds = useTestIds(testId, getExpressionItemsTestIds);\n\n const { accent } = useContext(ExpressionBuilderContext);\n\n const accentedText = (text: string) => {\n if (accent) {\n const accentRegex = typeof accent === 'function' ? accent(text) : accent;\n return replaceMatchWithElement(text, accentRegex, str => {\n return <Mark>{str}</Mark>;\n });\n }\n return text;\n };\n\n const caretIcon = useMemo(() => {\n return expanded ? 'caret-down' : `caret-${caretDirection}`;\n }, [expanded, caretDirection]);\n\n const accentedMeta = matchedField && !expanded ? accentedText(matchedField.value) : undefined;\n\n return (\n <StyledExpressionItem expanded={expanded}>\n <Flex\n data-testid={testIds.root}\n {...restProps}\n as={StyledExpressionExplanation}\n id={id}\n container={{ gap: 1, alignItems: 'start' }}\n >\n <Button\n data-testid={testIds.collapseItemButton}\n icon\n variant='simple'\n onClick={\n onCollapse || onExpand\n ? () => {\n if (expanded) {\n onCollapse?.(id);\n } else {\n onExpand?.(id);\n }\n }\n : undefined\n }\n aria-label={`${type}: ${primary}`}\n aria-expanded={expanded}\n label={expanded ? t('collapse') : t('expand')}\n >\n <Icon name={caretIcon} />\n </Button>\n\n <Flex container={{ alignItems: 'start', direction: 'column' }} item={{ grow: 1 }}>\n <StyledPrimaryText variant='primary'>\n {!matchedField ? accentedText(primary) : primary}\n </StyledPrimaryText>\n {accentedMeta ? (\n <div>\n <StyledLabel as='span'>{matchedField?.name}:</StyledLabel>\n {accentedMeta}\n </div>\n ) : (\n <Text variant='secondary'>{type}</Text>\n )}\n </Flex>\n\n {!expanded && (\n <Button\n data-testid={testIds.addItemButton}\n icon\n variant='simple'\n onClick={() => onAdd(id)}\n aria-label={t('add_noun', [`${type}: ${primary}`])}\n label={t('add')}\n >\n <Icon name='plus' />\n </Button>\n )}\n </Flex>\n <ExpandCollapse collapsed={!expanded}>\n <Flex as={StyledExpandCollapseContent} container={{ direction: 'column' }}>\n {details && <ExpressionDetails testId={testIds.root} {...details} />}\n <Button\n data-testid={testIds.addItem}\n variant='primary'\n onClick={() => onAdd(id)}\n aria-label={t('add_noun', [`${type}: ${primary}`])}\n >\n {t('add')}\n </Button>\n </Flex>\n </ExpandCollapse>\n </StyledExpressionItem>\n );\n};\n\nexport default withTestIds(ExpressionItem, getExpressionItemsTestIds);\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
|
|
2
2
|
import type { ExpressionListProps } from './ExpressionBuilder.types';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
3
|
+
declare const _default: ForwardRefForwardPropsComponent<ExpressionListProps> & {
|
|
4
|
+
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<never[]>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
5
7
|
//# sourceMappingURL=ExpressionList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpressionList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAuB,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;;;;AAiF1F,wBAAqE"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
|
-
import { forwardRef, useState } from 'react';
|
|
4
|
-
import { EmptyState } from '@pega/cosmos-react-core';
|
|
3
|
+
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { EmptyState, useItemIntersection, useConsolidatedRef, useTestIds, withTestIds } from '@pega/cosmos-react-core';
|
|
5
5
|
import ExpressionItem from './ExpressionItem';
|
|
6
6
|
import { StyledExpressionList } from './ExpressionBuilder.styles';
|
|
7
|
-
|
|
7
|
+
import { getExpressionListTestIds } from './ExpressionBuilder.test-ids';
|
|
8
|
+
const LIST_OFFSET = 20;
|
|
9
|
+
const ExpressionList = forwardRef(function ExpressionList({ testId, items = [], emptyText, onItemAdd, onItemExpand, onItemCollapse, details, ...restProps }, ref) {
|
|
10
|
+
const [count, setCount] = useState(Math.min(LIST_OFFSET, items.length));
|
|
11
|
+
const listRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setCount(Math.min(LIST_OFFSET, items.length));
|
|
14
|
+
}, [items]);
|
|
15
|
+
const consolidatedRef = useConsolidatedRef(ref, listRef);
|
|
16
|
+
useItemIntersection(consolidatedRef, count - 1, () => {
|
|
17
|
+
setCount(prev => Math.min(items.length, prev + LIST_OFFSET));
|
|
18
|
+
}, ':scope > li');
|
|
8
19
|
const [expandedItems, setExpandedItems] = useState([]);
|
|
9
20
|
const handleItemExpand = (id) => {
|
|
10
21
|
setExpandedItems(prev => {
|
|
@@ -24,9 +35,10 @@ const ExpressionList = forwardRef(function ExpressionList({ items, emptyText, on
|
|
|
24
35
|
return prev.filter(itemId => itemId !== id);
|
|
25
36
|
});
|
|
26
37
|
};
|
|
27
|
-
|
|
38
|
+
const testIds = useTestIds(testId, getExpressionListTestIds);
|
|
39
|
+
return (_jsx(StyledExpressionList, { ...restProps, ref: consolidatedRef, "data-testid": testIds.root, children: items && items.length > 0 ? (items.slice(0, count).map(item => {
|
|
28
40
|
return (_createElement(ExpressionItem, { ...item, onAdd: onItemAdd, onExpand: handleItemExpand, onCollapse: handleItemCollapse, expanded: expandedItems.includes(item.id), key: item.id, details: details?.[item.id] }));
|
|
29
41
|
})) : (_jsx(EmptyState, { message: emptyText })) }));
|
|
30
42
|
});
|
|
31
|
-
export default ExpressionList;
|
|
43
|
+
export default withTestIds(ExpressionList, getExpressionListTestIds);
|
|
32
44
|
//# sourceMappingURL=ExpressionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionList.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpressionList.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AAEtF,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAIjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAA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C,GACoB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useRef, useEffect, type PropsWithoutRef } from 'react';\n\nimport {\n EmptyState,\n useItemIntersection,\n useConsolidatedRef,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport type { ExpressionItemProps, ExpressionListProps } from './ExpressionBuilder.types';\nimport ExpressionItem from './ExpressionItem';\nimport { StyledExpressionList } from './ExpressionBuilder.styles';\nimport { getExpressionListTestIds } from './ExpressionBuilder.test-ids';\n\nconst LIST_OFFSET = 20;\nconst ExpressionList: ForwardRefForwardPropsComponent<ExpressionListProps> = forwardRef(\n function ExpressionList(\n {\n testId,\n items = [],\n emptyText,\n onItemAdd,\n onItemExpand,\n onItemCollapse,\n details,\n ...restProps\n }: PropsWithoutRef<ExpressionListProps>,\n ref: ExpressionListProps['ref']\n ) {\n const [count, setCount] = useState(Math.min(LIST_OFFSET, items.length));\n const listRef = useRef<HTMLUListElement>(null);\n\n useEffect(() => {\n setCount(Math.min(LIST_OFFSET, items.length));\n }, [items]);\n\n const consolidatedRef = useConsolidatedRef(ref, listRef);\n\n useItemIntersection(\n consolidatedRef,\n count - 1,\n () => {\n setCount(prev => Math.min(items.length, prev + LIST_OFFSET));\n },\n ':scope > li'\n );\n const [expandedItems, setExpandedItems] = useState<ExpressionItemProps['id'][]>([]);\n\n const handleItemExpand = (id: ExpressionItemProps['id']) => {\n setExpandedItems(prev => {\n const itemIndex = prev.indexOf(id);\n if (itemIndex !== -1) return prev;\n onItemExpand?.(id);\n return [...prev, id];\n });\n };\n\n const handleItemCollapse = (id: ExpressionItemProps['id']) => {\n setExpandedItems(prev => {\n const itemIndex = prev.indexOf(id);\n if (itemIndex === -1) return prev;\n onItemCollapse?.(id);\n return prev.filter(itemId => itemId !== id);\n });\n };\n const testIds = useTestIds(testId, getExpressionListTestIds);\n return (\n <StyledExpressionList {...restProps} ref={consolidatedRef} data-testid={testIds.root}>\n {items && items.length > 0 ? (\n items.slice(0, count).map(item => {\n return (\n <ExpressionItem\n {...item}\n onAdd={onItemAdd}\n onExpand={handleItemExpand}\n onCollapse={handleItemCollapse}\n expanded={expandedItems.includes(item.id)}\n key={item.id}\n details={details?.[item.id]}\n />\n );\n })\n ) : (\n <EmptyState message={emptyText} />\n )}\n </StyledExpressionList>\n );\n }\n);\n\nexport default withTestIds(ExpressionList, getExpressionListTestIds);\n"]}
|
|
@@ -5,4 +5,5 @@ export { default as ExpressionItem } from './ExpressionItem';
|
|
|
5
5
|
export { default as ExpressionList } from './ExpressionList';
|
|
6
6
|
export { default as ExpressionDetails } from './ExpressionDetails';
|
|
7
7
|
export { default as CodeEditor } from './CodeEditor/CodeEditor';
|
|
8
|
+
export { default as ExpressionBuilderContext } from './ExpressionBuilderContext';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACZ,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACZ,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -3,4 +3,5 @@ export { default as ExpressionItem } from './ExpressionItem';
|
|
|
3
3
|
export { default as ExpressionList } from './ExpressionList';
|
|
4
4
|
export { default as ExpressionDetails } from './ExpressionDetails';
|
|
5
5
|
export { default as CodeEditor } from './CodeEditor/CodeEditor';
|
|
6
|
+
export { default as ExpressionBuilderContext } from './ExpressionBuilderContext';
|
|
6
7
|
//# sourceMappingURL=index.js.map
|