@pega/cosmos-react-build 9.0.0-build.6.9 → 9.0.0-build.7.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.
Files changed (63) hide show
  1. package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts.map +1 -1
  2. package/lib/components/AuthoringPanel/AuthoringPanel.styles.js +6 -1
  3. package/lib/components/AuthoringPanel/AuthoringPanel.styles.js.map +1 -1
  4. package/lib/components/DynamicInput/BooleanControl.d.ts +1 -1
  5. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
  6. package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
  7. package/lib/components/DynamicInput/ConstantControl.d.ts +2 -2
  8. package/lib/components/DynamicInput/ConstantControl.d.ts.map +1 -1
  9. package/lib/components/DynamicInput/ConstantControl.js.map +1 -1
  10. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +0 -1
  11. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
  12. package/lib/components/DynamicInput/DynamicInput.styles.js +49 -43
  13. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
  14. package/lib/components/Expression/Expression.d.ts +1 -1
  15. package/lib/components/Expression/Expression.d.ts.map +1 -1
  16. package/lib/components/Expression/Expression.js +8 -7
  17. package/lib/components/Expression/Expression.js.map +1 -1
  18. package/lib/components/Expression/Expression.styles.d.ts +5 -1
  19. package/lib/components/Expression/Expression.styles.d.ts.map +1 -1
  20. package/lib/components/Expression/Expression.styles.js +15 -3
  21. package/lib/components/Expression/Expression.styles.js.map +1 -1
  22. package/lib/components/Expression/Expression.test-ids.d.ts +1 -1
  23. package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -1
  24. package/lib/components/Expression/Expression.test-ids.js +2 -1
  25. package/lib/components/Expression/Expression.test-ids.js.map +1 -1
  26. package/lib/components/Expression/ExpressionBuilderModal.d.ts +6 -0
  27. package/lib/components/Expression/ExpressionBuilderModal.d.ts.map +1 -0
  28. package/lib/components/Expression/ExpressionBuilderModal.js +53 -0
  29. package/lib/components/Expression/ExpressionBuilderModal.js.map +1 -0
  30. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  31. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +2 -2
  32. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  33. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  34. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +2 -2
  35. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  36. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  37. package/lib/components/LifeCycle/Category.js +4 -11
  38. package/lib/components/LifeCycle/Category.js.map +1 -1
  39. package/lib/components/LifeCycle/LifeCycle.types.d.ts +4 -0
  40. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  41. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  42. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -1
  43. package/lib/components/LifeCycle/LifeCycleDragDropList.js +8 -2
  44. package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -1
  45. package/lib/components/LifeCycle/TaskGroup.d.ts +2 -2
  46. package/lib/components/LifeCycle/TaskGroup.d.ts.map +1 -1
  47. package/lib/components/LifeCycle/TaskGroup.js +6 -11
  48. package/lib/components/LifeCycle/TaskGroup.js.map +1 -1
  49. package/lib/components/LifeCycle/utils.d.ts +2 -1
  50. package/lib/components/LifeCycle/utils.d.ts.map +1 -1
  51. package/lib/components/LifeCycle/utils.js +80 -41
  52. package/lib/components/LifeCycle/utils.js.map +1 -1
  53. package/lib/components/ObjectSelect/useCreateModal.d.ts +6 -2
  54. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
  55. package/lib/components/ObjectSelect/useCreateModal.js +7 -4
  56. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
  57. package/lib/components/PageTemplates/PageTemplate.styles.d.ts.map +1 -1
  58. package/lib/components/PageTemplates/PageTemplate.styles.js +24 -8
  59. package/lib/components/PageTemplates/PageTemplate.styles.js.map +1 -1
  60. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  61. package/lib/components/PageTemplates/PageTemplates.js +2 -2
  62. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  63. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"AuthoringPanel.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AuthoringPanel/AuthoringPanel.styles.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,eAAe,yGAsB1B,CAAC;AAGH,eAAO,MAAM,oBAAoB,wIAchC,CAAC;AAGF,eAAO,MAAM,mBAAmB,kNAE/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,kNAEhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGAQlC,CAAC;AAGH,eAAO,MAAM,aAAa,kNAIzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;YAA0B,OAAO;SAalE,CAAC;AAGH,eAAO,MAAM,uBAAuB,oNAYlC,CAAC;AAGH,eAAO,MAAM,qBAAqB;2BAvChB,CAAC;uDAkDjB,CAAC;AAGH,eAAO,MAAM,qBAAqB,kNAEjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,yGAIjC,CAAC;AAGH,eAAO,MAAM,mBAAmB,yGAsB9B,CAAC"}
1
+ {"version":3,"file":"AuthoringPanel.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AuthoringPanel/AuthoringPanel.styles.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,eAAe,yGA0B1B,CAAC;AAGH,eAAO,MAAM,oBAAoB,wIAchC,CAAC;AAGF,eAAO,MAAM,mBAAmB,kNAE/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,kNAEhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGAQlC,CAAC;AAGH,eAAO,MAAM,aAAa,kNAIzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;YAA0B,OAAO;SAalE,CAAC;AAGH,eAAO,MAAM,uBAAuB,oNAYlC,CAAC;AAGH,eAAO,MAAM,qBAAqB;2BA/CtB,CAAC;uDA0DX,CAAC;AAGH,eAAO,MAAM,qBAAqB,kNAEjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,yGAIjC,CAAC;AAGH,eAAO,MAAM,mBAAmB,yGAsB9B,CAAC"}
@@ -3,6 +3,7 @@ import { Button, Text, StyledPageHeader, Link, defaultThemeProp, StyledButton, S
3
3
  import { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';
4
4
  import { StyledRegions } from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';
5
5
  import { resizeDrawerMaxWidth, resizeDrawerMinWidth } from '@pega/cosmos-react-core/lib/styles/constants';
6
+ import { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';
6
7
  import { StyledPage } from '../PageTemplates/PageTemplates';
7
8
  export const StyledPanelPage = styled(StyledPage)(({ theme }) => {
8
9
  const { spacing } = theme.base;
@@ -24,6 +25,10 @@ export const StyledPanelPage = styled(StyledPage)(({ theme }) => {
24
25
  border-bottom: none;
25
26
  padding-block: 0;
26
27
  }
28
+
29
+ ${StyledTabPanel} {
30
+ padding-inline: calc(2 * ${spacing});
31
+ }
27
32
  }
28
33
  `;
29
34
  });
@@ -106,7 +111,7 @@ export const StyledPreviewDrawer = styled.div(({ theme }) => {
106
111
  min-width: ${resizeDrawerMinWidth};
107
112
  max-width: ${resizeDrawerMaxWidth};
108
113
  width: var(--resize-drawer-width);
109
- background-color: ${theme.base.palette['app-background']};
114
+ background: ${theme.base.palette['primary-background']};
110
115
  height: calc(100vh - var(--appshell-offset, 0rem));
111
116
  top: var(--appshell-offset, 0);
112
117
  z-index: calc(${theme.base['z-index'].drawer} + 500);
@@ -1 +1 @@
1
- {"version":3,"file":"AuthoringPanel.styles.js","sourceRoot":"","sources":["../../../src/components/AuthoringPanel/AuthoringPanel.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,gBAAgB,EAChB,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,oEAAoE,CAAC;AACnG,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAI5D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAC/B,OAAO,GAAG,CAAA;;;MAGN,gBAAgB;0BACI,OAAO;;;MAG3B,YAAY;;;;MAIZ,aAAa;;;UAGT,gBAAgB;;;;;GAKvB,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAC5C,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;IAClB,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CA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AAC,MAAM,CAAC,IAAI;;yBAEzC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;;;UAGxC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;QACrF,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,WAAW;KACnB,CAAC;;GAEP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n Button,\n Text,\n StyledPageHeader,\n Link,\n defaultThemeProp,\n StyledButton,\n StyledVisual,\n Flex,\n readableHue\n} from '@pega/cosmos-react-core';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledRegions } from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';\nimport {\n resizeDrawerMaxWidth,\n resizeDrawerMinWidth\n} from '@pega/cosmos-react-core/lib/styles/constants';\n\nimport { StyledPage } from '../PageTemplates/PageTemplates';\n\nimport type { AuthoringPanelProps } from './AuthoringPanel.types';\n\nexport const StyledPanelPage = styled(StyledPage)(({ theme }) => {\n const { spacing } = theme.base;\n return css`\n width: 100%;\n\n ${StyledPageHeader} {\n padding: calc(2 * ${spacing});\n padding-block-end: 0;\n }\n ${StyledVisual} {\n align-self: start;\n }\n\n ${StyledRegions} {\n padding: 0;\n\n & ${StyledPageHeader} {\n border-bottom: none;\n padding-block: 0;\n }\n }\n `;\n});\nStyledPanelPage.defaultProps = defaultThemeProp;\n\nexport const StyledAuthoringPanel = styled.div<Pick<AuthoringPanelProps, 'open'>>(\n ({ open, theme }) => {\n const { animation, palette, spacing } = theme.base;\n const translate = open ? 0 : '100%';\n return css`\n height: calc(100vh - 3rem);\n position: relative;\n border-inline-start: solid calc(0.125 * ${spacing}) ${palette['border-line']};\n transition-property: transform, opacity;\n transition-duration: calc(2 * ${animation.speed});\n transition-timing-function: ${animation.timing.ease};\n transform: ${open ? 'none' : `translateX(${translate})`};\n `;\n }\n);\nStyledAuthoringPanel.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderContent = styled(Flex)`\n overflow: hidden;\n`;\n\nexport const StyledTitleContainer = styled(Flex)`\n overflow: hidden;\n`;\n\nexport const StyledProgressContainer = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n width: 100%;\n ${StyledButton} {\n z-index: ${theme.base['z-index'].drawer};\n }\n `;\n});\nStyledProgressContainer.defaultProps = defaultThemeProp;\n\nexport const StyledActions = styled(Flex)`\n ${StyledButton} {\n margin-inline-start: 0;\n }\n`;\n\nexport const StyledTextWithEllipsis = styled(Text)<{ isLink: boolean }>(({\n theme: {\n base: { spacing }\n },\n isLink\n}) => {\n return css`\n ${ellipsisOverflow}\n ${isLink === false &&\n `\n margin: calc(0.5 * ${spacing});\n `}\n `;\n});\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n\nexport const StyledPrimaryTextButton = styled(Button)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n overflow: hidden;\n height: 100%;\n max-width: fit-content;\n text-overflow: ellipsis;\n margin: calc(0.5 * ${spacing});\n `;\n});\nStyledPrimaryTextButton.defaultProps = defaultThemeProp;\n\nexport const StyledPrimaryTextLink = styled(Link)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n margin: calc(0.5 * ${spacing});\n overflow: hidden;\n max-width: fit-content;\n ${ellipsisOverflow}\n `;\n});\nStyledPrimaryTextLink.defaultProps = defaultThemeProp;\n\nexport const StyledTitlesContainer = styled(Flex)`\n overflow: hidden;\n`;\n\nexport const StyledPrimaryContainer = styled.div(({ theme }) => {\n return css`\n margin-block-start: calc(-1 * ${theme.base.spacing});\n `;\n});\nStyledPrimaryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledPreviewDrawer = styled.div(({ theme }) => {\n return css`\n min-width: ${resizeDrawerMinWidth};\n max-width: ${resizeDrawerMaxWidth};\n width: var(--resize-drawer-width);\n background-color: ${theme.base.palette['app-background']};\n height: calc(100vh - var(--appshell-offset, 0rem));\n top: var(--appshell-offset, 0);\n z-index: calc(${theme.base['z-index'].drawer} + 500);\n transition-property: transform, box-shadow, opacity, border-inline-start;\n transition-duration: max(${theme.base.animation.speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n box-shadow: none;\n border-inline-start: 0.0625rem solid\n ${readableHue(theme.base.palette['border-line'], theme.base.palette['app-background'], {\n mode: 'both',\n level: 'AANonText'\n })};\n }\n `;\n});\n\nStyledPreviewDrawer.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"AuthoringPanel.styles.js","sourceRoot":"","sources":["../../../src/components/AuthoringPanel/AuthoringPanel.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,gBAAgB,EAChB,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,oEAAoE,CAAC;AACnG,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAI5D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAC/B,OAAO,GA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AI,CAAC,OAAO;GACnD,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1D,OAAO,GAAG,CAAA;iBACK,oBAAoB;iBACpB,oBAAoB;;kBAEnB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;oBAGtC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM;;+BAEjB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;kCACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;yBAEzC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;;;UAGxC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;QACrF,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,WAAW;KACnB,CAAC;;GAEP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n Button,\n Text,\n StyledPageHeader,\n Link,\n defaultThemeProp,\n StyledButton,\n StyledVisual,\n Flex,\n readableHue\n} from '@pega/cosmos-react-core';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledRegions } from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';\nimport {\n resizeDrawerMaxWidth,\n resizeDrawerMinWidth\n} from '@pega/cosmos-react-core/lib/styles/constants';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nimport { StyledPage } from '../PageTemplates/PageTemplates';\n\nimport type { AuthoringPanelProps } from './AuthoringPanel.types';\n\nexport const StyledPanelPage = styled(StyledPage)(({ theme }) => {\n const { spacing } = theme.base;\n return css`\n width: 100%;\n\n ${StyledPageHeader} {\n padding: calc(2 * ${spacing});\n padding-block-end: 0;\n }\n ${StyledVisual} {\n align-self: start;\n }\n\n ${StyledRegions} {\n padding: 0;\n\n & ${StyledPageHeader} {\n border-bottom: none;\n padding-block: 0;\n }\n\n ${StyledTabPanel} {\n padding-inline: calc(2 * ${spacing});\n }\n }\n `;\n});\nStyledPanelPage.defaultProps = defaultThemeProp;\n\nexport const StyledAuthoringPanel = styled.div<Pick<AuthoringPanelProps, 'open'>>(\n ({ open, theme }) => {\n const { animation, palette, spacing } = theme.base;\n const translate = open ? 0 : '100%';\n return css`\n height: calc(100vh - 3rem);\n position: relative;\n border-inline-start: solid calc(0.125 * ${spacing}) ${palette['border-line']};\n transition-property: transform, opacity;\n transition-duration: calc(2 * ${animation.speed});\n transition-timing-function: ${animation.timing.ease};\n transform: ${open ? 'none' : `translateX(${translate})`};\n `;\n }\n);\nStyledAuthoringPanel.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderContent = styled(Flex)`\n overflow: hidden;\n`;\n\nexport const StyledTitleContainer = styled(Flex)`\n overflow: hidden;\n`;\n\nexport const StyledProgressContainer = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n width: 100%;\n ${StyledButton} {\n z-index: ${theme.base['z-index'].drawer};\n }\n `;\n});\nStyledProgressContainer.defaultProps = defaultThemeProp;\n\nexport const StyledActions = styled(Flex)`\n ${StyledButton} {\n margin-inline-start: 0;\n }\n`;\n\nexport const StyledTextWithEllipsis = styled(Text)<{ isLink: boolean }>(({\n theme: {\n base: { spacing }\n },\n isLink\n}) => {\n return css`\n ${ellipsisOverflow}\n ${isLink === false &&\n `\n margin: calc(0.5 * ${spacing});\n `}\n `;\n});\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n\nexport const StyledPrimaryTextButton = styled(Button)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n overflow: hidden;\n height: 100%;\n max-width: fit-content;\n text-overflow: ellipsis;\n margin: calc(0.5 * ${spacing});\n `;\n});\nStyledPrimaryTextButton.defaultProps = defaultThemeProp;\n\nexport const StyledPrimaryTextLink = styled(Link)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n margin: calc(0.5 * ${spacing});\n overflow: hidden;\n max-width: fit-content;\n ${ellipsisOverflow}\n `;\n});\nStyledPrimaryTextLink.defaultProps = defaultThemeProp;\n\nexport const StyledTitlesContainer = styled(Flex)`\n overflow: hidden;\n`;\n\nexport const StyledPrimaryContainer = styled.div(({ theme }) => {\n return css`\n margin-block-start: calc(-1 * ${theme.base.spacing});\n `;\n});\nStyledPrimaryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledPreviewDrawer = styled.div(({ theme }) => {\n return css`\n min-width: ${resizeDrawerMinWidth};\n max-width: ${resizeDrawerMaxWidth};\n width: var(--resize-drawer-width);\n background: ${theme.base.palette['primary-background']};\n height: calc(100vh - var(--appshell-offset, 0rem));\n top: var(--appshell-offset, 0);\n z-index: calc(${theme.base['z-index'].drawer} + 500);\n transition-property: transform, box-shadow, opacity, border-inline-start;\n transition-duration: max(${theme.base.animation.speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n box-shadow: none;\n border-inline-start: 0.0625rem solid\n ${readableHue(theme.base.palette['border-line'], theme.base.palette['app-background'], {\n mode: 'both',\n level: 'AANonText'\n })};\n }\n `;\n});\n\nStyledPreviewDrawer.defaultProps = defaultThemeProp;\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { ComboBoxProps } from '@pega/cosmos-react-core';
3
3
  import type { ConstantBooleanConfig } from './ConstantControl';
4
- type BooleanControlProps = ConstantBooleanConfig['props'] & Pick<ComboBoxProps, 'required'>;
4
+ type BooleanControlProps = ConstantBooleanConfig['props'] & Pick<ComboBoxProps, 'required' | 'disabled' | 'status' | 'readOnly'>;
5
5
  declare const BooleanControl: FC<BooleanControlProps>;
6
6
  export default BooleanControl;
7
7
  //# sourceMappingURL=BooleanControl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,KAAK,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AAE5F,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAqC3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"BooleanControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,KAAK,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC,GACvD,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;AAEvE,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAqC3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAA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AAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { FC } from 'react';\n\nimport type { ComboBoxProps } from '@pega/cosmos-react-core';\nimport { ComboBox, useI18n } from '@pega/cosmos-react-core';\n\nimport type { ConstantBooleanConfig } from './ConstantControl';\n\ntype BooleanControlProps = ConstantBooleanConfig['props'] & Pick<ComboBoxProps, 'required'>;\n\nconst BooleanControl: FC<BooleanControlProps> = ({\n booleanLabels,\n value,\n onChange,\n id,\n required,\n ...restProps\n}: BooleanControlProps) => {\n const t = useI18n();\n const primaries =\n booleanLabels === 'always|never' ? [t('always'), t('never')] : [t('true'), t('false')];\n\n const items = [\n { id: 'true', primary: primaries[0], selected: value === true },\n { id: 'false', primary: primaries[1], selected: !value }\n ];\n\n return (\n <ComboBox\n {...restProps}\n selected={{\n items: {\n id: value === true ? items[0].id : items[1].id,\n text: value === true ? items[0].primary : items[1].primary\n }\n }}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: itemId => {\n onChange(itemId === 'true');\n }\n }}\n id={id}\n required={required}\n />\n );\n};\n\nexport default BooleanControl;\n"]}
1
+ {"version":3,"file":"BooleanControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,cAAc,GAA4B,CAAC,EAC/C,aAAa,EACb,KAAK,EACL,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,GAAG,SAAS,EACQ,EAAE,EAAE;IACxB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GACb,aAAa,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzF,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,KAAK,IAAI,EAAE;QAC/D,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;KACzD,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,OACH,SAAS,EACb,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC9C,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO;aAC3D;SACF,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,WAAW,EAAE,MAAM,CAAC,EAAE;gBACpB,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC9B,CAAC;SACF,EACD,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { FC } from 'react';\n\nimport type { ComboBoxProps } from '@pega/cosmos-react-core';\nimport { ComboBox, useI18n } from '@pega/cosmos-react-core';\n\nimport type { ConstantBooleanConfig } from './ConstantControl';\n\ntype BooleanControlProps = ConstantBooleanConfig['props'] &\n Pick<ComboBoxProps, 'required' | 'disabled' | 'status' | 'readOnly'>;\n\nconst BooleanControl: FC<BooleanControlProps> = ({\n booleanLabels,\n value,\n onChange,\n id,\n required,\n ...restProps\n}: BooleanControlProps) => {\n const t = useI18n();\n const primaries =\n booleanLabels === 'always|never' ? [t('always'), t('never')] : [t('true'), t('false')];\n\n const items = [\n { id: 'true', primary: primaries[0], selected: value === true },\n { id: 'false', primary: primaries[1], selected: !value }\n ];\n\n return (\n <ComboBox\n {...restProps}\n selected={{\n items: {\n id: value === true ? items[0].id : items[1].id,\n text: value === true ? items[0].primary : items[1].primary\n }\n }}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: itemId => {\n onChange(itemId === 'true');\n }\n }}\n id={id}\n required={required}\n />\n );\n};\n\nexport default BooleanControl;\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ComboBoxProps, CurrencyInputProps, DateInputProps, DateTimeInputProps, FormControlProps, InputProps, NumberInputProps, OmitStrict, PhoneInputProps, TextAreaProps, TimeInputProps } from '@pega/cosmos-react-core';
2
- export type FormControlPropsToOmit = keyof Pick<FormControlProps, 'label' | 'labelHidden' | 'additionalInfo' | 'info' | 'required' | 'status' | 'readOnly' | 'disabled'>;
2
+ export type FormControlPropsToOmit = keyof Pick<FormControlProps, 'label' | 'labelHidden' | 'additionalInfo' | 'info' | 'required'>;
3
3
  type ConstantTextConfig = {
4
4
  format: 'Text';
5
5
  props: OmitStrict<InputProps, FormControlPropsToOmit | 'onChange'> & {
@@ -54,7 +54,7 @@ type ConstantPhoneConfig = {
54
54
  props: OmitStrict<PhoneInputProps, FormControlPropsToOmit | 'showCountryCode'>;
55
55
  };
56
56
  export type ConstantControlConfig = ConstantTextConfig | ConstantDecimalConfig | ConstantIntegerConfig | ConstantPercentageConfig | ConstantTextAreaConfig | ConstantDateConfig | ConstantDateTimeConfig | ConstantTimeConfig | ConstantBooleanConfig | ConstantCurrencyConfig | ConstantPhoneConfig;
57
- declare const ConstantControl: ({ format, props, required, "data-testid": testId, id: inputUid }: Pick<FormControlProps, "id" | "required"> & {
57
+ declare const ConstantControl: ({ format, props, required, "data-testid": testId, id: inputUid }: Pick<FormControlProps, "id" | "required" | "disabled" | "status" | "readOnly"> & {
58
58
  "data-testid"?: string;
59
59
  } & ConstantControlConfig) => JSX.Element | null;
60
60
  export default ConstantControl;
@@ -1 +1 @@
1
- {"version":3,"file":"ConstantControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAC7C,gBAAgB,EACd,OAAO,GACP,aAAa,GACb,gBAAgB,GAChB,MAAM,GACN,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,CACb,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC,UAAU,EAAE,sBAAsB,GAAG,UAAU,CAAC,GAAG;QACnE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAC;CAC7D,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,UAAU,CACf,gBAAgB,EAChB,sBAAsB,GAAG,qBAAqB,GAAG,aAAa,CAC/D,CAAC;CACH,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,UAAU,CACf,gBAAgB,EAChB,sBAAsB,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,MAAM,CAC7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AC,eAAe,EAAE,sBAAsB,GAAG,iBAAiB,CAAC,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAC7B,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,kBAAkB,GAClB,sBAAsB,GACtB,kBAAkB,GAClB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,CAAC;AAExB,QAAA,MAAM,eAAe,GAAI,kEAMtB,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,qBAAqB,uBA2GxB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ConstantControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAC7C,gBAAgB,EAChB,OAAO,GAAG,aAAa,GAAG,gBAAgB,GAAG,MAAM,GAAG,UAAU,CACjE,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC,UAAU,EAAE,sBAAsB,GAAG,UAAU,CAAC,GAAG;QACnE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAC;CAC7D,CAAC;AAEF,KAAK,qB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AO,KAAK,IAAI,CAAC;QACnC,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,CAAC;CACH,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;CAC/D,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC,eAAe,EAAE,sBAAsB,GAAG,iBAAiB,CAAC,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAC7B,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,kBAAkB,GAClB,sBAAsB,GACtB,kBAAkB,GAClB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,CAAC;AAExB,QAAA,MAAM,eAAe,GAAI,kEAMtB,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC,GAAG;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,qBAAqB,uBA2GxB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConstantControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,yBAAyB,CAAC;AAejC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAkG9C,MAAM,eAAe,GAAG,CAAC,EACvB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,QAAQ,EAGW,EAAE,EAAE;IAC3B,IAAI,OAAO,GAAuB,IAAI,CAAC;IAEvC,M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CAAC;QAED,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,GAAG,KAAC,SAAS,OAAK,KAAK,iBAAe,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;QAC5F,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import type { ChangeEvent } from 'react';\n\nimport {\n CurrencyInput,\n DateInput,\n DateTimeInput,\n Input,\n NumberInput,\n PhoneInput,\n TextArea,\n TimeInput\n} from '@pega/cosmos-react-core';\nimport type {\n ComboBoxProps,\n CurrencyInputProps,\n DateInputProps,\n DateTimeInputProps,\n FormControlProps,\n InputProps,\n NumberInputProps,\n OmitStrict,\n PhoneInputProps,\n TextAreaProps,\n TimeInputProps\n} from '@pega/cosmos-react-core';\n\nimport BooleanControl from './BooleanControl';\n\nexport type FormControlPropsToOmit = keyof Pick<\n FormControlProps,\n | 'label'\n | 'labelHidden'\n | 'additionalInfo'\n | 'info'\n | 'required'\n | 'status'\n | 'readOnly'\n | 'disabled'\n>;\n\ntype ConstantTextConfig = {\n format: 'Text';\n props: OmitStrict<InputProps, FormControlPropsToOmit | 'onChange'> & {\n onChange: (value: string | undefined) => void;\n };\n};\n\ntype ConstantDecimalConfig = {\n format: 'Decimal';\n props: OmitStrict<NumberInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantIntegerConfig = {\n format: 'Integer';\n props: OmitStrict<\n NumberInputProps,\n FormControlPropsToOmit | 'showGroupSeparators' | 'showDecimal'\n >;\n};\n\ntype ConstantPercentageConfig = {\n format: 'Percentage';\n props: OmitStrict<\n NumberInputProps,\n FormControlPropsToOmit | 'showGroupSeparators' | 'numberOfDecimals' | 'unit'\n >;\n};\n\ntype ConstantTextAreaConfig = {\n format: 'Text (paragraph)';\n props: OmitStrict<TextAreaProps, FormControlPropsToOmit | 'onChange'> & {\n onChange: (value: string | undefined) => void;\n };\n};\n\ntype ConstantDateConfig = {\n format: 'Date';\n props: OmitStrict<DateInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantDateTimeConfig = {\n format: 'DateTime';\n props: OmitStrict<DateTimeInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantTimeConfig = {\n format: 'Time';\n props: OmitStrict<TimeInputProps, FormControlPropsToOmit>;\n};\n\nexport type BooleanLabels = 'true|false' | 'always|never';\n\nexport type ConstantBooleanConfig = {\n format: 'Boolean';\n props: OmitStrict<ComboBoxProps, FormControlPropsToOmit | 'value' | 'onChange'> & {\n value?: boolean;\n onChange: (value: boolean) => void;\n booleanLabels?: BooleanLabels;\n };\n};\n\ntype ConstantCurrencyConfig = {\n format: 'Currency';\n props: OmitStrict<CurrencyInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantPhoneConfig = {\n format: 'Phone';\n props: OmitStrict<PhoneInputProps, FormControlPropsToOmit | 'showCountryCode'>;\n};\n\nexport type ConstantControlConfig =\n | ConstantTextConfig\n | ConstantDecimalConfig\n | ConstantIntegerConfig\n | ConstantPercentageConfig\n | ConstantTextAreaConfig\n | ConstantDateConfig\n | ConstantDateTimeConfig\n | ConstantTimeConfig\n | ConstantBooleanConfig\n | ConstantCurrencyConfig\n | ConstantPhoneConfig;\n\nconst ConstantControl = ({\n format,\n props,\n required,\n 'data-testid': testId,\n id: inputUid\n}: Pick<FormControlProps, 'id' | 'required'> & {\n 'data-testid'?: string;\n} & ConstantControlConfig) => {\n let control: JSX.Element | null = null;\n\n const { value } = props;\n // Note: This is just a typeguard for the value prop.\n if (typeof value === 'string' || value === undefined) {\n if (format === 'Text') {\n control = (\n <Input\n {...props}\n data-testid={testId}\n id={inputUid}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n props.onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Text (paragraph)') {\n control = (\n <TextArea\n {...props}\n data-testid={testId}\n id={inputUid}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => {\n props.onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Currency') {\n control = <CurrencyInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Percentage') {\n control = (\n <NumberInput\n {...props}\n data-testid={testId}\n id={inputUid}\n showGroupSeparators={false}\n numberOfDecimals={undefined}\n unit='percent'\n required={required}\n />\n );\n }\n\n if (format === 'Integer') {\n control = (\n <NumberInput\n {...props}\n data-testid={testId}\n id={inputUid}\n showGroupSeparators={false}\n // Note: Getting single occurrence of callback when '.' is entered w/o showDecimal = false.\n showDecimal={false}\n required={required}\n />\n );\n }\n\n if (format === 'Decimal') {\n control = <NumberInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Phone') {\n control = (\n <PhoneInput\n {...props}\n data-testid={testId}\n id={inputUid}\n required={required}\n showCountryCode\n />\n );\n }\n }\n\n if (format === 'Boolean') {\n control = <BooleanControl {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n // Note: This is just a typeguard for the value prop.\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n value instanceof Date ||\n value === undefined\n ) {\n if (format === 'DateTime') {\n control = <DateTimeInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Date') {\n control = <DateInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Time') {\n control = <TimeInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n }\n return control;\n};\n\nexport default ConstantControl;\n"]}
1
+ {"version":3,"file":"ConstantControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,yBAAyB,CAAC;AAejC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AA2F9C,MAAM,eAAe,GAAG,CAAC,EACvB,MAAM,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AE,CAAC;YACtB,OAAO,GAAG,KAAC,SAAS,OAAK,KAAK,iBAAe,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;QAC5F,CAAC;QAED,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,GAAG,KAAC,SAAS,OAAK,KAAK,iBAAe,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;QAC5F,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import type { ChangeEvent } from 'react';\n\nimport {\n CurrencyInput,\n DateInput,\n DateTimeInput,\n Input,\n NumberInput,\n PhoneInput,\n TextArea,\n TimeInput\n} from '@pega/cosmos-react-core';\nimport type {\n ComboBoxProps,\n CurrencyInputProps,\n DateInputProps,\n DateTimeInputProps,\n FormControlProps,\n InputProps,\n NumberInputProps,\n OmitStrict,\n PhoneInputProps,\n TextAreaProps,\n TimeInputProps\n} from '@pega/cosmos-react-core';\n\nimport BooleanControl from './BooleanControl';\n\nexport type FormControlPropsToOmit = keyof Pick<\n FormControlProps,\n 'label' | 'labelHidden' | 'additionalInfo' | 'info' | 'required'\n>;\n\ntype ConstantTextConfig = {\n format: 'Text';\n props: OmitStrict<InputProps, FormControlPropsToOmit | 'onChange'> & {\n onChange: (value: string | undefined) => void;\n };\n};\n\ntype ConstantDecimalConfig = {\n format: 'Decimal';\n props: OmitStrict<NumberInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantIntegerConfig = {\n format: 'Integer';\n props: OmitStrict<\n NumberInputProps,\n FormControlPropsToOmit | 'showGroupSeparators' | 'showDecimal'\n >;\n};\n\ntype ConstantPercentageConfig = {\n format: 'Percentage';\n props: OmitStrict<\n NumberInputProps,\n FormControlPropsToOmit | 'showGroupSeparators' | 'numberOfDecimals' | 'unit'\n >;\n};\n\ntype ConstantTextAreaConfig = {\n format: 'Text (paragraph)';\n props: OmitStrict<TextAreaProps, FormControlPropsToOmit | 'onChange'> & {\n onChange: (value: string | undefined) => void;\n };\n};\n\ntype ConstantDateConfig = {\n format: 'Date';\n props: OmitStrict<DateInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantDateTimeConfig = {\n format: 'DateTime';\n props: OmitStrict<DateTimeInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantTimeConfig = {\n format: 'Time';\n props: OmitStrict<TimeInputProps, FormControlPropsToOmit>;\n};\n\nexport type BooleanLabels = 'true|false' | 'always|never';\n\nexport type ConstantBooleanConfig = {\n format: 'Boolean';\n props: OmitStrict<ComboBoxProps, FormControlPropsToOmit | 'value' | 'onChange'> & {\n value?: boolean;\n onChange: (value: boolean) => void;\n booleanLabels?: BooleanLabels;\n };\n};\n\ntype ConstantCurrencyConfig = {\n format: 'Currency';\n props: OmitStrict<CurrencyInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantPhoneConfig = {\n format: 'Phone';\n props: OmitStrict<PhoneInputProps, FormControlPropsToOmit | 'showCountryCode'>;\n};\n\nexport type ConstantControlConfig =\n | ConstantTextConfig\n | ConstantDecimalConfig\n | ConstantIntegerConfig\n | ConstantPercentageConfig\n | ConstantTextAreaConfig\n | ConstantDateConfig\n | ConstantDateTimeConfig\n | ConstantTimeConfig\n | ConstantBooleanConfig\n | ConstantCurrencyConfig\n | ConstantPhoneConfig;\n\nconst ConstantControl = ({\n format,\n props,\n required,\n 'data-testid': testId,\n id: inputUid\n}: Pick<FormControlProps, 'id' | 'required' | 'disabled' | 'status' | 'readOnly'> & {\n 'data-testid'?: string;\n} & ConstantControlConfig) => {\n let control: JSX.Element | null = null;\n\n const { value } = props;\n // Note: This is just a typeguard for the value prop.\n if (typeof value === 'string' || value === undefined) {\n if (format === 'Text') {\n control = (\n <Input\n {...props}\n data-testid={testId}\n id={inputUid}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n props.onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Text (paragraph)') {\n control = (\n <TextArea\n {...props}\n data-testid={testId}\n id={inputUid}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => {\n props.onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Currency') {\n control = <CurrencyInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Percentage') {\n control = (\n <NumberInput\n {...props}\n data-testid={testId}\n id={inputUid}\n showGroupSeparators={false}\n numberOfDecimals={undefined}\n unit='percent'\n required={required}\n />\n );\n }\n\n if (format === 'Integer') {\n control = (\n <NumberInput\n {...props}\n data-testid={testId}\n id={inputUid}\n showGroupSeparators={false}\n // Note: Getting single occurrence of callback when '.' is entered w/o showDecimal = false.\n showDecimal={false}\n required={required}\n />\n );\n }\n\n if (format === 'Decimal') {\n control = <NumberInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Phone') {\n control = (\n <PhoneInput\n {...props}\n data-testid={testId}\n id={inputUid}\n required={required}\n showCountryCode\n />\n );\n }\n }\n\n if (format === 'Boolean') {\n control = <BooleanControl {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n // Note: This is just a typeguard for the value prop.\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n value instanceof Date ||\n value === undefined\n ) {\n if (format === 'DateTime') {\n control = <DateTimeInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Date') {\n control = <DateInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Time') {\n control = <TimeInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n }\n return control;\n};\n\nexport default ConstantControl;\n"]}
@@ -1,4 +1,3 @@
1
- export declare const StyledExpressionBuilderButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {}, never>;
2
1
  export declare const StyledExpressionControl: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
3
2
  export declare const StyledDynamicInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
3
  //# sourceMappingURL=DynamicInput.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,6BAA6B,oNAAmB,CAAC;AAC9D,eAAO,MAAM,uBAAuB,kNAAiB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,yGAqD7B,CAAC"}
1
+ {"version":3,"file":"DynamicInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,uBAAuB,kNAAiB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,yGAsE9B,CAAC"}
@@ -1,61 +1,67 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { Button, Flex, StyledFormControl, defaultThemeProp } from '@pega/cosmos-react-core';
2
+ import { Flex, StyledFormControl, StyledGrid, defaultThemeProp } from '@pega/cosmos-react-core';
3
3
  import { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';
4
- export const StyledExpressionBuilderButton = styled(Button) ``;
4
+ import { StyledContentWrapper, StyledInputTree } from '../ObjectSelect/InputTree/InputTree.styles';
5
+ import { StyledFieldReferenceInput, StyledFieldReferencePicker } from '../FieldReference/FieldReference.styles';
5
6
  export const StyledExpressionControl = styled(Flex) ``;
6
- export const StyledDynamicInput = styled.div(({ theme }) => {
7
+ export const StyledDynamicInput = styled.div(({ theme: { base: { palette: { 'foreground-color': foregroundColor }, 'content-width': contentWidth }, components: { 'form-control': { 'border-color': formControlBorderColor } } } }) => {
7
8
  return css `
8
- display: flex;
9
+ display: flex;
9
10
 
10
- ${StyledFormControl} {
11
- border-start-start-radius: 0;
12
- border-end-start-radius: 0;
13
- width: 100%;
14
- }
11
+ ${StyledInputTree} {
12
+ margin-inline-start: -2.5rem;
13
+ }
15
14
 
16
- ${StyledExpressionControl} {
17
- position: relative;
18
- z-index: 1;
15
+ ${StyledFieldReferencePicker} > ${StyledFieldReferenceInput} > ${StyledGrid} {
16
+ padding: 0;
17
+ }
19
18
 
20
- .react-codemirror2 {
21
- min-height: 0;
19
+ ${StyledContentWrapper} {
20
+ padding-block-start: 0;
22
21
  }
23
22
 
24
- .CodeMirror,
25
- .CodeMirror-wrap {
26
- border-color: ${theme.components['form-control']['border-color']};
23
+ ${StyledFormControl} {
27
24
  border-start-start-radius: 0;
28
25
  border-end-start-radius: 0;
26
+ width: 100%;
29
27
  }
30
28
 
31
- ${StyledExpressionBuilderButton} {
32
- position: absolute;
33
- z-index: 2;
34
- inset-block-start: 0.0625rem;
35
- inset-inline-end: 0.0625rem;
36
- border-start-start-radius: 0;
37
- border-end-start-radius: 0;
29
+ ${StyledExpressionControl} {
30
+ position: relative;
31
+ z-index: 1;
32
+
33
+ .react-codemirror2 {
34
+ min-height: 0;
35
+ }
36
+
37
+ .CodeMirror,
38
+ .CodeMirror-wrap {
39
+ border-color: ${formControlBorderColor};
40
+ border-start-start-radius: 0;
41
+ border-end-start-radius: 0;
42
+ }
43
+ }
44
+
45
+ ${StyledMenuButton} {
46
+ z-index: 0;
47
+ border-inline-end: 0;
48
+ border-color: ${formControlBorderColor};
49
+ border-start-end-radius: 0;
50
+ border-end-end-radius: 0;
51
+ align-self: flex-start;
52
+ color: ${foregroundColor};
53
+ &:focus {
54
+ z-index: 2;
55
+ }
38
56
  }
39
- }
40
-
41
- ${StyledMenuButton} {
42
- z-index: 0;
43
- border-inline-end: 0;
44
- border-color: ${theme.components['form-control']['border-color']};
45
- border-start-end-radius: 0;
46
- border-end-end-radius: 0;
47
- color: ${theme.base.palette['foreground-color']};
48
- &:focus {
49
- z-index: 2;
57
+
58
+ ${StyledMenuButton} + * {
59
+ flex-grow: 1;
60
+ z-index: 1;
61
+ width: 100%;
62
+ min-width: ${contentWidth.xs};
50
63
  }
51
- }
52
-
53
- ${StyledMenuButton} + * {
54
- flex-grow: 1;
55
- z-index: 1;
56
- min-width: ${theme.base['content-width'].xs};
57
- }
58
- `;
64
+ `;
59
65
  });
60
66
  StyledDynamicInput.defaultProps = defaultThemeProp;
61
67
  //# sourceMappingURL=DynamicInput.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicInput.styles.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,EAAE,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA,EAAE,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,OAAO,GAAG,CAAA;;;MAGN,iBAAiB;;;;;;MAMjB,uBAAuB;;;;;;;;;;wBAUL,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC;;;;;QAKhE,6BAA6B;;;;;;;;;;MAU/B,gBAAgB;;;sBAGA,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC;;;eAGvD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;;;;;MAM/C,gBAAgB;;;mBAGH,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;GAE9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Button, Flex, StyledFormControl, defaultThemeProp } from '@pega/cosmos-react-core';\nimport { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';\n\nexport const StyledExpressionBuilderButton = styled(Button)``;\nexport const StyledExpressionControl = styled(Flex)``;\n\nexport const StyledDynamicInput = styled.div(({ theme }) => {\n return css`\n display: flex;\n\n ${StyledFormControl} {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n width: 100%;\n }\n\n ${StyledExpressionControl} {\n position: relative;\n z-index: 1;\n\n .react-codemirror2 {\n min-height: 0;\n }\n\n .CodeMirror,\n .CodeMirror-wrap {\n border-color: ${theme.components['form-control']['border-color']};\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n\n ${StyledExpressionBuilderButton} {\n position: absolute;\n z-index: 2;\n inset-block-start: 0.0625rem;\n inset-inline-end: 0.0625rem;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n }\n\n ${StyledMenuButton} {\n z-index: 0;\n border-inline-end: 0;\n border-color: ${theme.components['form-control']['border-color']};\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n color: ${theme.base.palette['foreground-color']};\n &:focus {\n z-index: 2;\n }\n }\n\n ${StyledMenuButton} + * {\n flex-grow: 1;\n z-index: 1;\n min-width: ${theme.base['content-width'].xs};\n }\n `;\n});\n\nStyledDynamicInput.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"DynamicInput.styles.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,yCAAyC,CAAC;AAEjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA,EAAE,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAC1C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,kBAAkB,EAAE,eAAe,EAAE,EAChD,eAAe,EAAE,YAAY,EAC9B,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,cAAc,EAAE,sBAAsB,EAAE,EAC3D,EACF,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;QAGN,eAAe;;;;QAIf,0BAA0B,MAAM,yBAAyB,MAAM,UAAU;;;;QAIzE,oBAAoB;;;;QAIpB,iBAAiB;;;;;;QAMjB,uBAAuB;;;;;;;;;;0BAUL,sBAAsB;;;;;;QAMxC,gBAAgB;;;wBAGA,sBAAsB;;;;iBAI7B,eAAe;;;;;;QAMxB,gBAAgB;;;;qBAIH,YAAY,CAAC,EAAE;;KAE/B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Flex, StyledFormControl, StyledGrid, defaultThemeProp } from '@pega/cosmos-react-core';\nimport { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';\n\nimport { StyledContentWrapper, StyledInputTree } from '../ObjectSelect/InputTree/InputTree.styles';\nimport {\n StyledFieldReferenceInput,\n StyledFieldReferencePicker\n} from '../FieldReference/FieldReference.styles';\n\nexport const StyledExpressionControl = styled(Flex)``;\n\nexport const StyledDynamicInput = styled.div(\n ({\n theme: {\n base: {\n palette: { 'foreground-color': foregroundColor },\n 'content-width': contentWidth\n },\n components: {\n 'form-control': { 'border-color': formControlBorderColor }\n }\n }\n }) => {\n return css`\n display: flex;\n\n ${StyledInputTree} {\n margin-inline-start: -2.5rem;\n }\n\n ${StyledFieldReferencePicker} > ${StyledFieldReferenceInput} > ${StyledGrid} {\n padding: 0;\n }\n\n ${StyledContentWrapper} {\n padding-block-start: 0;\n }\n\n ${StyledFormControl} {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n width: 100%;\n }\n\n ${StyledExpressionControl} {\n position: relative;\n z-index: 1;\n\n .react-codemirror2 {\n min-height: 0;\n }\n\n .CodeMirror,\n .CodeMirror-wrap {\n border-color: ${formControlBorderColor};\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n }\n\n ${StyledMenuButton} {\n z-index: 0;\n border-inline-end: 0;\n border-color: ${formControlBorderColor};\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n align-self: flex-start;\n color: ${foregroundColor};\n &:focus {\n z-index: 2;\n }\n }\n\n ${StyledMenuButton} + * {\n flex-grow: 1;\n z-index: 1;\n width: 100%;\n min-width: ${contentWidth.xs};\n }\n `;\n }\n);\n\nStyledDynamicInput.defaultProps = defaultThemeProp;\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { ExpressionProps } from './Expression.types';
2
2
  declare const _default: import("react").ForwardRefExoticComponent<Omit<ExpressionProps, "ref"> & import("react").RefAttributes<import("./Expression.types").ExpressionRefInterface>> & {
3
- getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expression-input", "expression-menu-popover", "expression-builder-error-banner"]>;
3
+ getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expression-input", "expression-menu-popover", "expression-builder-error-banner", "progress-builder"]>;
4
4
  };
5
5
  export default _default;
6
6
  //# sourceMappingURL=Expression.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Expression.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/Expression.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;;;;AAwH1D,wBAA6D"}
1
+ {"version":3,"file":"Expression.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/Expression.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;;;;AAwI1D,wBAA6D"}
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useImperativeHandle, forwardRef } from 'react';
3
3
  import { useTestIds, withTestIds, FormField, StyledFormControl, useI18n } from '@pega/cosmos-react-core';
4
4
  import { getExpressionTestIds } from './Expression.test-ids';
5
5
  import { StyledCodeEditor, StyledFlex } from './Expression.styles';
6
- const Expression = forwardRef(({ testId, label, labelHidden, readOnly, required, value, status, info, placeholder, additionalInfo, disabled, hideFormField = false, editorInput: { fetchSuggestions, handle, loading, onChange, onBlur, inLineErrors }, id, ...restProps }, ref) => {
6
+ import ExpressionBuilderModal from './ExpressionBuilderModal';
7
+ const Expression = forwardRef(({ testId, label, labelHidden, readOnly, required, value, status, info, placeholder, additionalInfo, disabled, showExpBuilderIcon, onExpBuilderShowHandler, showExpressionBuilder, expressionBuilder, hideFormField = false, editorInput: { fetchSuggestions, handle, loading, onChange, onBlur, inLineErrors }, id, ...restProps }, ref) => {
7
8
  const textElRef = useRef(null);
8
9
  const popOverReference = useRef(null);
9
10
  const codeEditorHandle = useRef(null);
@@ -25,11 +26,11 @@ const Expression = forwardRef(({ testId, label, labelHidden, readOnly, required,
25
26
  getPopOverRef: () => popOverReference.current,
26
27
  getExpressionRef: () => expressionRef.current
27
28
  }), []);
28
- const Comp = (_jsx(StyledFormControl, { container: true, as: StyledFlex, status: status, readOnly: readOnly, disabled: disabled, ref: expressionRef, "data-testid": testIds.root, children: _jsx(StyledCodeEditor, { testId: testIds.expressionInput, isSingleLine: true, fetchSuggestions: fetchSuggestions, codeEditorHandle: codeEditorHandle, defaultValue: value, loading: loading, readOnly: readOnly, onChange: onChange, onBlur: onBlur, inLineErrors: inLineErrors, autoCompleteTriggers: ['.', '@', '#', ':', '(', ')'], editorConfigProps: {
29
- mode: 'expression',
30
- readOnly,
31
- placeholder
32
- }, "aria-label": t('expression_input') }) }));
29
+ const Comp = (_jsxs(StyledFormControl, { container: true, inline: true, as: StyledFlex, status: status, readOnly: readOnly, disabled: disabled, ref: expressionRef, "data-testid": testIds.root, children: [_jsx(StyledCodeEditor, { testId: testIds.expressionInput, isSingleLine: true, fetchSuggestions: fetchSuggestions, codeEditorHandle: codeEditorHandle, defaultValue: value, loading: loading, readOnly: readOnly, onChange: onChange, onBlur: onBlur, inLineErrors: inLineErrors, autoCompleteTriggers: ['.', '@', '#', ':', '(', ')'], editorConfigProps: {
30
+ mode: 'expression',
31
+ readOnly,
32
+ placeholder
33
+ }, "aria-label": t('expression_input') }), showExpBuilderIcon && (_jsx(ExpressionBuilderModal, { testId: testId, expressionBuilder: expressionBuilder, showExpressionBuilder: showExpressionBuilder, readOnly: readOnly, disabled: disabled, onExpBuilderShowHandler: onExpBuilderShowHandler }))] }));
33
34
  return !hideFormField ? (_jsx(FormField, { ...restProps, label: label, labelHidden: labelHidden, required: required, readOnly: readOnly, status: status, info: info, disabled: disabled, additionalInfo: additionalInfo, id: id, children: Comp })) : (Comp);
34
35
  });
35
36
  export default withTestIds(Expression, getExpressionTestIds);
@@ -1 +1 @@
1
- {"version":3,"file":"Expression.js","sourceRoot":"","sources":["../../../src/components/Expression/Expression.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAwB,MAAM,OAAO,CAAC;A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QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,EAAE,EAAE,EAAE,YAEL,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useRef, useImperativeHandle, forwardRef, type PropsWithoutRef } from 'react';\n\nimport {\n useTestIds,\n withTestIds,\n FormField,\n StyledFormControl,\n useI18n\n} from '@pega/cosmos-react-core';\n\nimport type { EditorState, CustomPositionProps } from '../ExpressionBuilder';\n\nimport { getExpressionTestIds } from './Expression.test-ids';\nimport type { ExpressionProps } from './Expression.types';\nimport { StyledCodeEditor, StyledFlex } from './Expression.styles';\n\nconst Expression = forwardRef(\n (\n {\n testId,\n label,\n labelHidden,\n readOnly,\n required,\n value,\n status,\n info,\n placeholder,\n additionalInfo,\n disabled,\n hideFormField = false,\n editorInput: { fetchSuggestions, handle, loading, onChange, onBlur, inLineErrors },\n id,\n ...restProps\n }: PropsWithoutRef<ExpressionProps>,\n ref: ExpressionProps['ref']\n ) => {\n const textElRef = useRef<HTMLInputElement>(null);\n const popOverReference = useRef<HTMLDivElement>(null);\n const codeEditorHandle = useRef<EditorState>(null);\n const expressionRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n\n const testIds = useTestIds(testId, getExpressionTestIds);\n\n const getExpression = () => {\n return codeEditorHandle.current?.getValue() || '';\n };\n\n const insertExpression = (\n expression: string,\n replaceContent?: boolean,\n customCursorPosition?: CustomPositionProps\n ) => {\n return codeEditorHandle.current?.insertText(\n expression ?? '',\n replaceContent ?? true,\n customCursorPosition\n );\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression,\n insertExpression\n }),\n [getExpression]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getTextElRef: () => textElRef.current,\n getPopOverRef: () => popOverReference.current,\n getExpressionRef: () => expressionRef.current\n }),\n []\n );\n\n const Comp = (\n <StyledFormControl\n container\n as={StyledFlex}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n ref={expressionRef}\n data-testid={testIds.root}\n >\n <StyledCodeEditor\n testId={testIds.expressionInput}\n isSingleLine\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n defaultValue={value}\n loading={loading}\n readOnly={readOnly}\n onChange={onChange}\n onBlur={onBlur}\n inLineErrors={inLineErrors}\n autoCompleteTriggers={['.', '@', '#', ':', '(', ')']}\n editorConfigProps={{\n mode: 'expression',\n readOnly,\n placeholder\n }}\n aria-label={t('expression_input')}\n />\n </StyledFormControl>\n );\n\n return !hideFormField ? (\n <FormField\n {...restProps}\n label={label}\n labelHidden={labelHidden}\n required={required}\n readOnly={readOnly}\n status={status}\n info={info}\n disabled={disabled}\n additionalInfo={additionalInfo}\n id={id}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(Expression, getExpressionTestIds);\n"]}
1
+ {"version":3,"file":"Expression.js","sourceRoot":"","sources":["../../../src/components/Expression/Expression.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAwB,MAAM,OAAO,CAAC;AAEtF,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,OAAO,EACR,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D,MAAM,UAAU,GAAG,UAAU,CAC3B,CACE,EACE,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,E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Q,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,EAAE,EAAE,EAAE,YAEL,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useRef, useImperativeHandle, forwardRef, type PropsWithoutRef } from 'react';\n\nimport {\n useTestIds,\n withTestIds,\n FormField,\n StyledFormControl,\n useI18n\n} from '@pega/cosmos-react-core';\n\nimport type { EditorState, CustomPositionProps } from '../ExpressionBuilder';\n\nimport { getExpressionTestIds } from './Expression.test-ids';\nimport type { ExpressionProps } from './Expression.types';\nimport { StyledCodeEditor, StyledFlex } from './Expression.styles';\nimport ExpressionBuilderModal from './ExpressionBuilderModal';\n\nconst Expression = forwardRef(\n (\n {\n testId,\n label,\n labelHidden,\n readOnly,\n required,\n value,\n status,\n info,\n placeholder,\n additionalInfo,\n disabled,\n showExpBuilderIcon,\n onExpBuilderShowHandler,\n showExpressionBuilder,\n expressionBuilder,\n hideFormField = false,\n editorInput: { fetchSuggestions, handle, loading, onChange, onBlur, inLineErrors },\n id,\n ...restProps\n }: PropsWithoutRef<ExpressionProps>,\n ref: ExpressionProps['ref']\n ) => {\n const textElRef = useRef<HTMLInputElement>(null);\n const popOverReference = useRef<HTMLDivElement>(null);\n const codeEditorHandle = useRef<EditorState>(null);\n const expressionRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n\n const testIds = useTestIds(testId, getExpressionTestIds);\n\n const getExpression = () => {\n return codeEditorHandle.current?.getValue() || '';\n };\n\n const insertExpression = (\n expression: string,\n replaceContent?: boolean,\n customCursorPosition?: CustomPositionProps\n ) => {\n return codeEditorHandle.current?.insertText(\n expression ?? '',\n replaceContent ?? true,\n customCursorPosition\n );\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression,\n insertExpression\n }),\n [getExpression]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getTextElRef: () => textElRef.current,\n getPopOverRef: () => popOverReference.current,\n getExpressionRef: () => expressionRef.current\n }),\n []\n );\n\n const Comp = (\n <StyledFormControl\n container\n inline\n as={StyledFlex}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n ref={expressionRef}\n data-testid={testIds.root}\n >\n <StyledCodeEditor\n testId={testIds.expressionInput}\n isSingleLine\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n defaultValue={value}\n loading={loading}\n readOnly={readOnly}\n onChange={onChange}\n onBlur={onBlur}\n inLineErrors={inLineErrors}\n autoCompleteTriggers={['.', '@', '#', ':', '(', ')']}\n editorConfigProps={{\n mode: 'expression',\n readOnly,\n placeholder\n }}\n aria-label={t('expression_input')}\n />\n {showExpBuilderIcon && (\n <ExpressionBuilderModal\n testId={testId}\n expressionBuilder={expressionBuilder}\n showExpressionBuilder={showExpressionBuilder}\n readOnly={readOnly}\n disabled={disabled}\n onExpBuilderShowHandler={onExpBuilderShowHandler}\n />\n )}\n </StyledFormControl>\n );\n\n return !hideFormField ? (\n <FormField\n {...restProps}\n label={label}\n labelHidden={labelHidden}\n required={required}\n readOnly={readOnly}\n status={status}\n info={info}\n disabled={disabled}\n additionalInfo={additionalInfo}\n id={id}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(Expression, getExpressionTestIds);\n"]}
@@ -1,4 +1,8 @@
1
- export declare const StyledFlex: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const StyledFlex: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledModalContainer: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledExpressionBuilder: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("../ExpressionBuilder").ExpressionBuilderProps> & {
4
+ getTestIds: (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"]>;
5
+ }, import("styled-components").DefaultTheme, {}, never>;
2
6
  export declare const StyledCodeEditor: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("../ExpressionBuilder").CodeEditorProps> & {
3
7
  getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["error-popover", "error-message"]>;
4
8
  }, import("styled-components").DefaultTheme, {
@@ -1 +1 @@
1
- {"version":3,"file":"Expression.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/Expression.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,yGA8BrB,CAAC;AAIH,eAAO,MAAM,gBAAgB;;;mBAAuC,OAAO;SAqBzE,CAAC"}
1
+ {"version":3,"file":"Expression.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/Expression.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,kNA8BrB,CAAC;AAIH,eAAO,MAAM,oBAAoB,kNAQ/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;uDAEnC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;mBAAuC,OAAO;SAqBzE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { defaultThemeProp } from '@pega/cosmos-react-core';
3
- import { CodeEditor } from '../ExpressionBuilder';
2
+ import { defaultThemeProp, Flex } from '@pega/cosmos-react-core';
3
+ import ExpressionBuilder, { CodeEditor } from '../ExpressionBuilder';
4
4
  const iconWidth = '3.75';
5
5
  const height = '3.75';
6
- export const StyledFlex = styled('div')(({ theme: { components: { 'form-control': { ':focus': { 'border-color': focusBorderColor, 'box-shadow': shadow } } }, base: { spacing } } }) => {
6
+ export const StyledFlex = styled(Flex)(({ theme: { components: { 'form-control': { ':focus': { 'border-color': focusBorderColor, 'box-shadow': shadow } } }, base: { spacing } } }) => {
7
7
  return css `
8
8
  &:focus-within {
9
9
  border-color: ${focusBorderColor};
@@ -26,6 +26,18 @@ export const StyledFlex = styled('div')(({ theme: { components: { 'form-control'
26
26
  `;
27
27
  });
28
28
  StyledFlex.defaultProps = defaultThemeProp;
29
+ export const StyledModalContainer = styled(Flex)(({ showEditorOnly }) => {
30
+ return css `
31
+ height: 30rem;
32
+ ${!showEditorOnly &&
33
+ css `
34
+ width: 72.5rem;
35
+ `}
36
+ `;
37
+ });
38
+ export const StyledExpressionBuilder = styled(ExpressionBuilder) `
39
+ padding-inline: 0;
40
+ `;
29
41
  export const StyledCodeEditor = styled(CodeEditor)(({ theme: { base: { spacing } }, isSingleLine }) => {
30
42
  return css `
31
43
  ${isSingleLine &&
@@ -1 +1 @@
1
- {"version":3,"file":"Expression.styles.js","sourceRoot":"","sources":["../../../src/components/Expression/Expression.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,MAAM,GAAG,MAAM,CAAC;AACtB,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACvC,KAAK,EAAE,EACL,UAAU,EAAE,EACV,cAAc,EAAE,EACd,QAAQ,EAAE,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,EACrE,EACF,EACD,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;sBAEU,gBAAgB;oBAClB,MAAM;;;;qBAIL,OAAO,MAAM,MAAM;yBACf,OAAO,MAAM,MAAM;;;oBAGxB,OAAO,MAAM,SAAS;wBAClB,OAAO,MAAM,SAAS;;;;;;;GAO3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAA6B,CAAC,EAC9E,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACD,YAAY,EACb,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;MACN,YAAY;QACd,GAAG,CAAA;;;;;;2BAMoB,OAAO,MAAM,MAAM;;;uBAGvB,OAAO,MAAM,MAAM;;KAErC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport { CodeEditor } from '../ExpressionBuilder';\n\nconst iconWidth = '3.75';\nconst height = '3.75';\nexport const StyledFlex = styled('div')(({\n theme: {\n components: {\n 'form-control': {\n ':focus': { 'border-color': focusBorderColor, 'box-shadow': shadow }\n }\n },\n base: { spacing }\n }\n}) => {\n return css`\n &:focus-within {\n border-color: ${focusBorderColor};\n box-shadow: ${shadow};\n }\n & > input,\n & > button {\n height: calc(${spacing} * ${height});\n min-height: calc(${spacing} * ${height});\n }\n & > button {\n width: calc(${spacing} * ${iconWidth});\n min-width: calc(${spacing} * ${iconWidth});\n }\n & > input,\n & > input:focus:not([disabled]) {\n border: none;\n box-shadow: none;\n }\n `;\n});\n\nStyledFlex.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled(CodeEditor)<{ isSingleLine?: boolean }>(({\n theme: {\n base: { spacing }\n },\n isSingleLine\n}) => {\n return css`\n ${isSingleLine &&\n css`\n .CodeMirror {\n border: none;\n }\n .react-codemirror2,\n .CodeMirror-lines {\n min-height: calc(${spacing} * ${height});\n }\n .CodeMirror-lines {\n height: calc(${spacing} * ${height});\n }\n `}\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Expression.styles.js","sourceRoot":"","sources":["../../../src/components/Expression/Expression.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,iBAAiB,EAAE,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,MAAM,GAAG,MAAM,CAAC;AACtB,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EACtC,KAAK,EAAE,EACL,UAAU,EAAE,EACV,cAAc,EAAE,EACd,QAAQ,EAAE,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,EACrE,EACF,EACD,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;sBAEU,gBAAgB;oBAClB,MAAM;;;;qBAIL,OAAO,MAAM,MAAM;yBACf,OAAO,MAAM,MAAM;;;oBAGxB,OAAO,MAAM,SAAS;wBAClB,OAAO,MAAM,SAAS;;;;;;;GAO3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;IACtE,OAAO,GAAG,CAAA;;MAEN,CAAC,cAAc;QACjB,GAAG,CAAA;;KAEF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;;CAE/D,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAA6B,CAAC,EAC9E,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACD,YAAY,EACb,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;MACN,YAAY;QACd,GAAG,CAAA;;;;;;2BAMoB,OAAO,MAAM,MAAM;;;uBAGvB,OAAO,MAAM,MAAM;;KAErC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Flex } from '@pega/cosmos-react-core';\n\nimport ExpressionBuilder, { CodeEditor } from '../ExpressionBuilder';\n\nconst iconWidth = '3.75';\nconst height = '3.75';\nexport const StyledFlex = styled(Flex)(({\n theme: {\n components: {\n 'form-control': {\n ':focus': { 'border-color': focusBorderColor, 'box-shadow': shadow }\n }\n },\n base: { spacing }\n }\n}) => {\n return css`\n &:focus-within {\n border-color: ${focusBorderColor};\n box-shadow: ${shadow};\n }\n & > input,\n & > button {\n height: calc(${spacing} * ${height});\n min-height: calc(${spacing} * ${height});\n }\n & > button {\n width: calc(${spacing} * ${iconWidth});\n min-width: calc(${spacing} * ${iconWidth});\n }\n & > input,\n & > input:focus:not([disabled]) {\n border: none;\n box-shadow: none;\n }\n `;\n});\n\nStyledFlex.defaultProps = defaultThemeProp;\n\nexport const StyledModalContainer = styled(Flex)(({ showEditorOnly }) => {\n return css`\n height: 30rem;\n ${!showEditorOnly &&\n css`\n width: 72.5rem;\n `}\n `;\n});\n\nexport const StyledExpressionBuilder = styled(ExpressionBuilder)`\n padding-inline: 0;\n`;\n\nexport const StyledCodeEditor = styled(CodeEditor)<{ isSingleLine?: boolean }>(({\n theme: {\n base: { spacing }\n },\n isSingleLine\n}) => {\n return css`\n ${isSingleLine &&\n css`\n .CodeMirror {\n border: none;\n }\n .react-codemirror2,\n .CodeMirror-lines {\n min-height: calc(${spacing} * ${height});\n }\n .CodeMirror-lines {\n height: calc(${spacing} * ${height});\n }\n `}\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
@@ -1,3 +1,3 @@
1
- export declare const getExpressionTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expression-input", "expression-menu-popover", "expression-builder-error-banner"]>;
1
+ export declare const getExpressionTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expression-input", "expression-menu-popover", "expression-builder-error-banner", "progress-builder"]>;
2
2
  export declare const getExpressionBuilderGearTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expression-builder-modal", "open-expression-builder", "expression-modal-cancel", "expression-modal-submit"]>;
3
3
  //# sourceMappingURL=Expression.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Expression.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/Expression.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,uNAItB,CAAC;AAEZ,eAAO,MAAM,+BAA+B,kPAKjC,CAAC"}
1
+ {"version":3,"file":"Expression.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/Expression.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,2OAKtB,CAAC;AAEZ,eAAO,MAAM,+BAA+B,kPAKjC,CAAC"}
@@ -2,7 +2,8 @@ import { createTestIds } from '@pega/cosmos-react-core';
2
2
  export const getExpressionTestIds = createTestIds('expression', [
3
3
  'expression-input',
4
4
  'expression-menu-popover',
5
- 'expression-builder-error-banner'
5
+ 'expression-builder-error-banner',
6
+ 'progress-builder'
6
7
  ]);
7
8
  export const getExpressionBuilderGearTestIds = createTestIds('expression-builder-gear', [
8
9
  'expression-builder-modal',
@@ -1 +1 @@
1
- {"version":3,"file":"Expression.test-ids.js","sourceRoot":"","sources":["../../../src/components/Expression/Expression.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,YAAY,EAAE;IAC9D,kBAAkB;IAClB,yBAAyB;IACzB,iCAAiC;CACzB,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,+BAA+B,GAAG,aAAa,CAAC,yBAAyB,EAAE;IACtF,0BAA0B;IAC1B,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;CACjB,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getExpressionTestIds = createTestIds('expression', [\n 'expression-input',\n 'expression-menu-popover',\n 'expression-builder-error-banner'\n] as const);\n\nexport const getExpressionBuilderGearTestIds = createTestIds('expression-builder-gear', [\n 'expression-builder-modal',\n 'open-expression-builder',\n 'expression-modal-cancel',\n 'expression-modal-submit'\n] as const);\n"]}
1
+ {"version":3,"file":"Expression.test-ids.js","sourceRoot":"","sources":["../../../src/components/Expression/Expression.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,YAAY,EAAE;IAC9D,kBAAkB;IAClB,yBAAyB;IACzB,iCAAiC;IACjC,kBAAkB;CACV,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,+BAA+B,GAAG,aAAa,CAAC,yBAAyB,EAAE;IACtF,0BAA0B;IAC1B,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;CACjB,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getExpressionTestIds = createTestIds('expression', [\n 'expression-input',\n 'expression-menu-popover',\n 'expression-builder-error-banner',\n 'progress-builder'\n] as const);\n\nexport const getExpressionBuilderGearTestIds = createTestIds('expression-builder-gear', [\n 'expression-builder-modal',\n 'open-expression-builder',\n 'expression-modal-cancel',\n 'expression-modal-submit'\n] as const);\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ExpressionBuilderLayoutInterface } from './Expression.types';
2
+ declare const _default: (({ showExpressionBuilder, onExpBuilderShowHandler, readOnly, disabled, testId, expressionBuilder }: ExpressionBuilderLayoutInterface) => import("react/jsx-runtime").JSX.Element) & {
3
+ getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expression-builder-modal", "open-expression-builder", "expression-modal-cancel", "expression-modal-submit"]>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=ExpressionBuilderModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilderModal.d.ts","sourceRoot":"","sources":["../../../src/components/Expression/ExpressionBuilderModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,gCAAgC,EAEjC,MAAM,oBAAoB,CAAC;6HA6GzB,gCAAgC;;;AAyBnC,wBAAoF"}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { Button, Icon, Banner, useTestIds, Progress, withTestIds, useI18n, registerIcon } from '@pega/cosmos-react-core';
4
+ import * as CodeSearch from '@pega/cosmos-react-core/lib/components/Icon/streamline-icons/code-search.icon';
5
+ import useCreateModal from '../ObjectSelect/useCreateModal';
6
+ import { getExpressionTestIds, getExpressionBuilderGearTestIds } from './Expression.test-ids';
7
+ import { StyledModalContainer, StyledExpressionBuilder } from './Expression.styles';
8
+ registerIcon(CodeSearch);
9
+ const ExpModal = (props) => {
10
+ const { showEditorOnly, loading, onChange, errors, defaultValue, handle, fetchSuggestions, inLineErrors, expBuilderRef, readOnly, list, search, expBuilderErrorBanner, ...restProps } = props;
11
+ const testIds = useTestIds(restProps.testId, getExpressionTestIds);
12
+ return (_jsx(StyledModalContainer, { container: { direction: 'column', colGap: 1 }, showEditorOnly: props.showEditorOnly, children: loading ? (_jsx(Progress, { placement: 'local', "data-testid": testIds.progressBuilder })) : (_jsxs(_Fragment, { children: [expBuilderErrorBanner && (_jsx(Banner, { variant: expBuilderErrorBanner.variant, onDismiss: expBuilderErrorBanner.onDismiss, messages: expBuilderErrorBanner.messages, "data-testId": testIds.expressionBuilderErrorBanner })), _jsx(StyledExpressionBuilder, { testId: testIds.root, ...restProps, loading: restProps.codeEditorLoading, list: list, readOnly: readOnly, onChange: onChange, search: search, errors: errors, defaultValue: defaultValue, handle: handle, fetchSuggestions: fetchSuggestions, showEditorOnly: showEditorOnly, inLineErrors: inLineErrors, ref: expBuilderRef })] })) }));
13
+ };
14
+ const ExpModalWrapper = (props) => {
15
+ const t = useI18n();
16
+ const { testId } = props;
17
+ const [showModal, setShowModal] = useState(true);
18
+ const testIds = useTestIds(testId, getExpressionBuilderGearTestIds);
19
+ const dismiss = (close) => {
20
+ close();
21
+ setShowModal(false);
22
+ };
23
+ const { renderModal } = useCreateModal({
24
+ renderer: ExpModal,
25
+ onSubmit: ({ close }) => props.onSubmit({ close: () => dismiss(close) }),
26
+ onDismiss: ({ close }) => {
27
+ props.onDismiss({ close: () => dismiss(close) });
28
+ },
29
+ heading: t('expression_builder'),
30
+ autoWidth: true,
31
+ testId: testIds.expressionBuilderModal,
32
+ formActionSubmitTestId: testIds.expressionModalSubmit,
33
+ formActionCancelTestId: testIds.expressionModalCancel
34
+ });
35
+ useEffect(() => {
36
+ if (showModal && props.list && props.search) {
37
+ renderModal({
38
+ rendererProps: {
39
+ ...props,
40
+ testId: props.testId ?? testIds.root
41
+ }
42
+ });
43
+ }
44
+ }, [props, showModal]);
45
+ return null;
46
+ };
47
+ const ExpressionBuilderModal = ({ showExpressionBuilder, onExpBuilderShowHandler, readOnly, disabled, testId, expressionBuilder }) => {
48
+ const t = useI18n();
49
+ const testIds = useTestIds(testId, getExpressionBuilderGearTestIds);
50
+ return (_jsxs(_Fragment, { children: [!readOnly && (_jsx(Button, { disabled: disabled, icon: true, variant: 'simple', label: t('open_expression_builder'), "aria-label": t('open_expression_builder'), onClick: onExpBuilderShowHandler, "data-testid": testIds.openExpressionBuilder, children: _jsx(Icon, { name: 'code-search', set: 'streamline' }) })), showExpressionBuilder && expressionBuilder && (_jsx(ExpModalWrapper, { testId: testId, ...expressionBuilder, readOnly: readOnly || disabled }))] }));
51
+ };
52
+ export default withTestIds(ExpressionBuilderModal, getExpressionBuilderGearTestIds);
53
+ //# sourceMappingURL=ExpressionBuilderModal.js.map