@pega/cosmos-react-build 9.0.0-build.6.9 → 9.0.0-build.7.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.styles.d.ts.map +1 -1
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.js +6 -1
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.js.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.d.ts +1 -1
- 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 +2 -2
- package/lib/components/DynamicInput/ConstantControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/ConstantControl.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 +49 -43
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
- package/lib/components/Expression/Expression.d.ts +1 -1
- 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 -1
- package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -1
- package/lib/components/Expression/Expression.test-ids.js +2 -1
- 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.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +2 -2
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js +2 -2
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts.map +1 -1
- package/lib/components/LifeCycle/Category.js +4 -11
- package/lib/components/LifeCycle/Category.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +4 -0
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- 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 +8 -2
- package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -1
- package/lib/components/LifeCycle/TaskGroup.d.ts +2 -2
- package/lib/components/LifeCycle/TaskGroup.d.ts.map +1 -1
- package/lib/components/LifeCycle/TaskGroup.js +6 -11
- package/lib/components/LifeCycle/TaskGroup.js.map +1 -1
- package/lib/components/LifeCycle/utils.d.ts +2 -1
- package/lib/components/LifeCycle/utils.d.ts.map +1 -1
- package/lib/components/LifeCycle/utils.js +80 -41
- package/lib/components/LifeCycle/utils.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/PageTemplates/PageTemplate.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplate.styles.js +24 -8
- package/lib/components/PageTemplates/PageTemplate.styles.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +2 -2
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpressionBuilderModal.js","sourceRoot":"","sources":["../../../src/components/Expression/ExpressionBuilderModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,UAAU,MAAM,+EAA+E,CAAC;AAE5G,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAM5D,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEpF,YAAY,CAAC,UAAU,CAAC,CAAC;AAEzB,MAAM,QAAQ,GAAG,CAAC,KAA0E,EAAE,EAAE;IAC9F,MAAM,EACJ,cAAc,EACd,OAAO,EACP,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,qBAAqB,EACrB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAEnE,OAAO,CACL,KAAC,oBAAoB,IACnB,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,EAC7C,cAAc,EAAE,KAAK,CAAC,cAAc,YAEnC,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,QAAQ,IAAC,SAAS,EA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,CAAC,CAAC,yBAAyB,CAAC,gBACvB,CAAC,CAAC,yBAAyB,CAAC,EACxC,OAAO,EAAE,uBAAuB,iBACnB,OAAO,CAAC,qBAAqB,YAE1C,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,EAAC,GAAG,EAAC,YAAY,GAAG,GACrC,CACV,EACA,qBAAqB,IAAI,iBAAiB,IAAI,CAC7C,KAAC,eAAe,IAAC,MAAM,EAAE,MAAM,KAAM,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,IAAI,QAAQ,GAAI,CAC3F,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,sBAAsB,EAAE,+BAA+B,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\n\nimport {\n Button,\n Icon,\n Banner,\n useTestIds,\n Progress,\n withTestIds,\n useI18n,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type { OmitStrict } from '@pega/cosmos-react-core';\nimport * as CodeSearch from '@pega/cosmos-react-core/lib/components/Icon/streamline-icons/code-search.icon';\n\nimport useCreateModal from '../ObjectSelect/useCreateModal';\n\nimport type {\n ExpressionBuilderLayoutInterface,\n ExpressionBuilderWrapperProps\n} from './Expression.types';\nimport { getExpressionTestIds, getExpressionBuilderGearTestIds } from './Expression.test-ids';\nimport { StyledModalContainer, StyledExpressionBuilder } from './Expression.styles';\n\nregisterIcon(CodeSearch);\n\nconst ExpModal = (props: OmitStrict<ExpressionBuilderWrapperProps, 'onSubmit' | 'onDismiss'>) => {\n const {\n showEditorOnly,\n loading,\n onChange,\n errors,\n defaultValue,\n handle,\n fetchSuggestions,\n inLineErrors,\n expBuilderRef,\n readOnly,\n list,\n search,\n expBuilderErrorBanner,\n ...restProps\n } = props;\n const testIds = useTestIds(restProps.testId, getExpressionTestIds);\n\n return (\n <StyledModalContainer\n container={{ direction: 'column', colGap: 1 }}\n showEditorOnly={props.showEditorOnly}\n >\n {loading ? (\n <Progress placement='local' data-testid={testIds.progressBuilder} />\n ) : (\n <>\n {expBuilderErrorBanner && (\n <Banner\n variant={expBuilderErrorBanner.variant}\n onDismiss={expBuilderErrorBanner.onDismiss}\n messages={expBuilderErrorBanner.messages}\n data-testId={testIds.expressionBuilderErrorBanner}\n />\n )}\n <StyledExpressionBuilder\n testId={testIds.root}\n {...restProps}\n loading={restProps.codeEditorLoading}\n list={list}\n readOnly={readOnly}\n onChange={onChange}\n search={search}\n errors={errors}\n defaultValue={defaultValue}\n handle={handle}\n fetchSuggestions={fetchSuggestions}\n showEditorOnly={showEditorOnly}\n inLineErrors={inLineErrors}\n ref={expBuilderRef}\n />\n </>\n )}\n </StyledModalContainer>\n );\n};\n\nconst ExpModalWrapper = (props: ExpressionBuilderWrapperProps) => {\n const t = useI18n();\n const { testId } = props;\n const [showModal, setShowModal] = useState(true);\n const testIds = useTestIds(testId, getExpressionBuilderGearTestIds);\n\n const dismiss = (close: () => void) => {\n close();\n setShowModal(false);\n };\n\n const { renderModal } = useCreateModal({\n renderer: ExpModal,\n onSubmit: ({ close }) => props.onSubmit({ close: () => dismiss(close) }),\n onDismiss: ({ close }) => {\n props.onDismiss({ close: () => dismiss(close) });\n },\n heading: t('expression_builder'),\n autoWidth: true,\n testId: testIds.expressionBuilderModal,\n formActionSubmitTestId: testIds.expressionModalSubmit,\n formActionCancelTestId: testIds.expressionModalCancel\n });\n\n useEffect(() => {\n if (showModal && props.list && props.search) {\n renderModal({\n rendererProps: {\n ...props,\n testId: props.testId ?? testIds.root\n }\n });\n }\n }, [props, showModal]);\n\n return null;\n};\n\nconst ExpressionBuilderModal = ({\n showExpressionBuilder,\n onExpBuilderShowHandler,\n readOnly,\n disabled,\n testId,\n expressionBuilder\n}: ExpressionBuilderLayoutInterface) => {\n const t = useI18n();\n const testIds = useTestIds(testId, getExpressionBuilderGearTestIds);\n return (\n <>\n {!readOnly && (\n <Button\n disabled={disabled}\n icon\n variant='simple'\n label={t('open_expression_builder')}\n aria-label={t('open_expression_builder')}\n onClick={onExpBuilderShowHandler}\n data-testid={testIds.openExpressionBuilder}\n >\n <Icon name='code-search' set='streamline' />\n </Button>\n )}\n {showExpressionBuilder && expressionBuilder && (\n <ExpModalWrapper testId={testId} {...expressionBuilder} readOnly={readOnly || disabled} />\n )}\n </>\n );\n};\n\nexport default withTestIds(ExpressionBuilderModal, getExpressionBuilderGearTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAK1E,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,cAAc,0LAIzB,CAAC;AAIH,eAAO,MAAM,aAAa,yGAWxB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAIrB,CAAC;AAGH,eAAO,MAAM,gBAAgB;gBAEb,OAAO;aACV,MAAM;eACJ,OAAO;iBACL,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAK1E,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,cAAc,0LAIzB,CAAC;AAIH,eAAO,MAAM,aAAa,yGAWxB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAIrB,CAAC;AAGH,eAAO,MAAM,gBAAgB;gBAEb,OAAO;aACV,MAAM;eACJ,OAAO;iBACL,cAAc,EAAE;SAiiB/B,CAAC;AAIH,eAAO,MAAM,iBAAiB;gBAChB,OAAO;iBACN,cAAc,EAAE;4CA+C7B,CAAC"}
|
|
@@ -31,7 +31,7 @@ export const StyledList = styled.div(({ theme }) => {
|
|
|
31
31
|
`;
|
|
32
32
|
});
|
|
33
33
|
StyledList.defaultProps = defaultThemeProp;
|
|
34
|
-
export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'form-control': { ':read-only': { 'background-color': readOnlyBackgroundColor } }, 'form-field': { error: { 'status-color': errorBackground } }, input } }, errors, readOnly, showEditorOnly, editorConfigProps, isSingleLine = false }) => {
|
|
34
|
+
export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'form-control': { 'background-color': formControlBgColor, ':read-only': { 'background-color': readOnlyBackgroundColor } }, 'form-field': { error: { 'status-color': errorBackground } }, input } }, errors, readOnly, showEditorOnly, editorConfigProps, isSingleLine = false }) => {
|
|
35
35
|
const jsonMode = editorConfigProps?.mode === 'application/json';
|
|
36
36
|
return css `
|
|
37
37
|
width: 100%;
|
|
@@ -512,7 +512,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
512
512
|
font-family: monospace;
|
|
513
513
|
direction: ltr;
|
|
514
514
|
position: relative;
|
|
515
|
-
background-color: ${
|
|
515
|
+
background-color: ${formControlBgColor};
|
|
516
516
|
color: ${base.palette['foreground-color']};
|
|
517
517
|
border: 0.0625rem solid ${base.palette['border-line']};
|
|
518
518
|
border-radius: calc(0.5 * ${base['border-radius']});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,iBAAiB,GA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UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAExF,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,OAAO,GAAG,CAAA;;;sBAGU,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;2BACnB,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;kCAC3C,IAAI,CAAC,eAAe,CAAC;oBACnC,IAAI,CAAC,MAAM,CAAC,GAAG;gCACH,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;0BACjC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;mBACtC,SAAS,CAAC,CAAC;;;mBAGX,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;;0BAId,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;4BAGnB,WAAW;;;;4BAIX,UAAU;;wBAEd,IAAI,CAAC,OAAO;;;;iBAInB,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO;;;MAGlC,CAAC,SAAS;QACZ,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,GAAG,CAAA;;4BAEqB,WAAW;;KAElC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type { CodeEditorProps, SuggestionType } from './CodeEditor.types';\n\nconst primaryBackground = 'primary-background';\nconst contentWidth = 'content-width';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xxs};\n max-width: ${theme.base[contentWidth].sm};\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledPopover.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.div(({ theme }) => {\n return css`\n padding-inline-start: calc(0.25 * ${theme.base.spacing});\n `;\n});\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled(Flex)<\n Pick<CodeEditorProps, 'showEditorOnly' | 'editorConfigProps' | 'isSingleLine'> & {\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n }\n>(({\n theme: {\n base,\n components: {\n 'form-control': {\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n },\n input\n }\n },\n errors,\n readOnly,\n showEditorOnly,\n editorConfigProps,\n isSingleLine = false\n}) => {\n const jsonMode = editorConfigProps?.mode === 'application/json';\n\n return css`\n width: 100%;\n ${showEditorOnly &&\n css`\n max-height: 10rem;\n width: 27vw;\n `}\n position: relative;\n ${!showEditorOnly &&\n css`\n max-height: 100%;\n `}\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n ${isSingleLine\n ? css`\n min-height: ${input.height};\n & * {\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n `\n : css`\n min-height: 3.75rem;\n `}\n overflow-y: auto;\n ${readOnly &&\n !jsonMode &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-placeholder {\n opacity: ${base.transparency['transparent-3']};\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing} 0;\n }\n\n ${editorConfigProps?.theme === 'eclipse' &&\n css`\n .cm-s-eclipse .cm-string {\n color: ${base.palette.urgent};\n }\n `}\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid #dddddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: #999999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${base.palette.dark};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid silver;\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid #cccccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: #999977;\n }\n .cm-s-default .cm-tag {\n color: #117700;\n }\n .cm-s-default .cm-attribute {\n color: #0000cc;\n }\n .cm-s-default .cm-hr {\n color: #999999;\n }\n .cm-s-default .cm-link {\n color: #0000cc;\n }\n\n .cm-s-default .cm-error {\n color: #ff0000;\n }\n .cm-invalidchar {\n color: #ff0000;\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #00bb00;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #aa2222;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n padding: 0 ${base.spacing};\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: #d9d9d9;\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: #d7d4f0;\n }\n .CodeMirror-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: #d7d4f0;\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: #d7d4f0;\n }\n\n .cm-searching {\n background-color: rgba(255, 255, 0, 0.4);\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n ${isSingleLine &&\n css`\n white-space: nowrap;\n height: auto;\n padding-inline-end: ${base.spacing};\n `}\n overflow: hidden;\n font-family: monospace;\n direction: ltr;\n position: relative;\n background-color: ${base.palette['background-color']};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette.interactive};\n }\n .cm-ex-additional-operators {\n color: ${base.palette.interactive};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-comment {\n color: ${base.palette.info};\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n .cm-ex-underline-error {\n text-decoration: underline;\n text-decoration-style: wavy;\n text-decoration-color: ${base.colors.red.medium};\n }\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestions = createGlobalStyle<{\n isLoading?: boolean;\n suggestions: SuggestionType[];\n}>(({ theme: { base }, isLoading, suggestions }) => {\n const activeColor = mix(0.85, base.palette[primaryBackground], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette[primaryBackground], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n .CodeMirror-hints {\n position: absolute;\n z-index: calc(${base['z-index'].backdrop} + 1);\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette[primaryBackground]};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: ${base[contentWidth].xs};\n }\n\n .CodeMirror-hint {\n width: calc(1.5 * ${base[contentWidth].xs});\n cursor: pointer;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n body .CodeMirror-lint-tooltip {\n z-index: ${base['z-index'].tooltip};\n }\n\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n});\n\nStyledSuggestions.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvD,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;GACnC,CA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CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;kCAC3C,IAAI,CAAC,eAAe,CAAC;oBACnC,IAAI,CAAC,MAAM,CAAC,GAAG;gCACH,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;0BACjC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;mBACtC,SAAS,CAAC,CAAC;;;mBAGX,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;;0BAId,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;4BAGnB,WAAW;;;;4BAIX,UAAU;;wBAEd,IAAI,CAAC,OAAO;;;;iBAInB,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO;;;MAGlC,CAAC,SAAS;QACZ,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,GAAG,CAAA;;4BAEqB,WAAW;;KAElC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type { CodeEditorProps, SuggestionType } from './CodeEditor.types';\n\nconst primaryBackground = 'primary-background';\nconst contentWidth = 'content-width';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xxs};\n max-width: ${theme.base[contentWidth].sm};\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledPopover.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.div(({ theme }) => {\n return css`\n padding-inline-start: calc(0.25 * ${theme.base.spacing});\n `;\n});\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled(Flex)<\n Pick<CodeEditorProps, 'showEditorOnly' | 'editorConfigProps' | 'isSingleLine'> & {\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n }\n>(({\n theme: {\n base,\n components: {\n 'form-control': {\n 'background-color': formControlBgColor,\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n },\n input\n }\n },\n errors,\n readOnly,\n showEditorOnly,\n editorConfigProps,\n isSingleLine = false\n}) => {\n const jsonMode = editorConfigProps?.mode === 'application/json';\n\n return css`\n width: 100%;\n ${showEditorOnly &&\n css`\n max-height: 10rem;\n width: 27vw;\n `}\n position: relative;\n ${!showEditorOnly &&\n css`\n max-height: 100%;\n `}\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n ${isSingleLine\n ? css`\n min-height: ${input.height};\n & * {\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n `\n : css`\n min-height: 3.75rem;\n `}\n overflow-y: auto;\n ${readOnly &&\n !jsonMode &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-placeholder {\n opacity: ${base.transparency['transparent-3']};\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing} 0;\n }\n\n ${editorConfigProps?.theme === 'eclipse' &&\n css`\n .cm-s-eclipse .cm-string {\n color: ${base.palette.urgent};\n }\n `}\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid #dddddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: #999999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${base.palette.dark};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid silver;\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid #cccccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: #999977;\n }\n .cm-s-default .cm-tag {\n color: #117700;\n }\n .cm-s-default .cm-attribute {\n color: #0000cc;\n }\n .cm-s-default .cm-hr {\n color: #999999;\n }\n .cm-s-default .cm-link {\n color: #0000cc;\n }\n\n .cm-s-default .cm-error {\n color: #ff0000;\n }\n .cm-invalidchar {\n color: #ff0000;\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #00bb00;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #aa2222;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n padding: 0 ${base.spacing};\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: #d9d9d9;\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: #d7d4f0;\n }\n .CodeMirror-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: #d7d4f0;\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: #d7d4f0;\n }\n\n .cm-searching {\n background-color: rgba(255, 255, 0, 0.4);\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n ${isSingleLine &&\n css`\n white-space: nowrap;\n height: auto;\n padding-inline-end: ${base.spacing};\n `}\n overflow: hidden;\n font-family: monospace;\n direction: ltr;\n position: relative;\n background-color: ${formControlBgColor};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette.interactive};\n }\n .cm-ex-additional-operators {\n color: ${base.palette.interactive};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-comment {\n color: ${base.palette.info};\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n .cm-ex-underline-error {\n text-decoration: underline;\n text-decoration-style: wavy;\n text-decoration-color: ${base.colors.red.medium};\n }\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestions = createGlobalStyle<{\n isLoading?: boolean;\n suggestions: SuggestionType[];\n}>(({ theme: { base }, isLoading, suggestions }) => {\n const activeColor = mix(0.85, base.palette[primaryBackground], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette[primaryBackground], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n .CodeMirror-hints {\n position: absolute;\n z-index: calc(${base['z-index'].backdrop} + 1);\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette[primaryBackground]};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: ${base[contentWidth].xs};\n }\n\n .CodeMirror-hint {\n width: calc(1.5 * ${base[contentWidth].xs});\n cursor: pointer;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n body .CodeMirror-lint-tooltip {\n z-index: ${base['z-index'].tooltip};\n }\n\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n});\n\nStyledSuggestions.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;;;;AAsU7F,wBAAuE"}
|
|
@@ -69,7 +69,7 @@ const ExpressionBuilder = forwardRef(({ testId, list, search, errors, defaultVal
|
|
|
69
69
|
}, as: generateExpression ? StyledExpressions : undefined, children: [generateExpression && (_jsxs(_Fragment, { children: [_jsx(TextArea, { label: t('describe_expression'), defaultValue: describeExpressionTextArea?.defaultValue, autoResize: false, additionalInfo: describeExpressionTextArea?.additionalInfo, placeholder: describeExpressionTextArea?.placeholder, info: describeExpressionTextArea?.error, status: describeExpressionTextArea?.error ? 'error' : undefined, testId: testIds.describeExpression, ref: textAreaRef, row: 3 }), _jsx(Flex, { container: true, item: { alignSelf: 'end' }, children: loadingExpression ? (_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [t('generating_expression'), _jsx(Progress, { placement: 'inline' })] })) : (onGenerateExpression && (_jsx(AIButton, { onClick: () => onGenerateExpression(textAreaRef.current?.value || ''), label: t('generate'), variant: 'secondary', "data-testid": testIds.generate }))) }), _jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledGeneratedExpression, children: [_jsx(Label, { children: t('generated_expression') }), _jsx(CodeEditor, { codeEditorHandle: generatedExpressionHandler, editorConfigProps: {
|
|
70
70
|
mode: 'expression',
|
|
71
71
|
readOnly: true
|
|
72
|
-
}, readOnly: true, testId: testIds.generatedExpression }), loadingExpression && _jsx(Progress, { variant: 'ring', placement: 'local' })] }), onInsert && (_jsx(Button, { as: StyledInsertButton, onClick: () => onInsert(generatedExpressionHandler.current?.getValue() ?? ''),
|
|
72
|
+
}, readOnly: true, testId: testIds.generatedExpression }), _jsx(Text, { variant: 'secondary', children: t('verify_ai_generated_expression') }), loadingExpression && _jsx(Progress, { variant: 'ring', placement: 'local' })] }), onInsert && (_jsx(Button, { as: StyledInsertButton, onClick: () => onInsert(generatedExpressionHandler.current?.getValue() ?? ''), "data-testid": testIds.insert, children: t('insert') })), _jsx(Text, { variant: 'h4', children: t('library') })] })), _jsx(SearchInput, { testId: testIds.search, ...search }), _jsx(ExpressionBuilderContext.Provider, { value: ctxValue, children: _jsx(ExpressionList, { testId: testIds.root, ...list, onItemAdd: onItemAdd }) })] })] })), _jsxs(Flex, { container: {
|
|
73
73
|
direction: 'column',
|
|
74
74
|
gap: 1,
|
|
75
75
|
pad: [1, 2, 1, 1]
|
|
@@ -86,7 +86,7 @@ const ExpressionBuilder = forwardRef(({ testId, list, search, errors, defaultVal
|
|
|
86
86
|
readOnly,
|
|
87
87
|
lineNumbers: true,
|
|
88
88
|
placeholder
|
|
89
|
-
}, defaultValue: defaultValue, loading: loading, errors: errors, readOnly: readOnly, onChange: onChange, "aria-label": t('expression_editor'), showEditorOnly: showEditorOnly, inLineErrors: inLineErrors })) }), _jsxs(Flex, { container: { direction: 'column', gap: 1 }, children: [_jsx(Flex, { container: true, item: { alignSelf: 'end' }, as: StyledExplainContainer, children: generateExplanation?.loadingExplanation ? (_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [t('generating_explanation'), _jsx(Progress, { placement: 'inline' })] })) : (_jsx(AIButton, { onClick: generateExplanation?.onExplain, label: t('explain'), variant: 'secondary', "data-testid": testIds.explain })) }), _jsxs(Flex, { as: StyledExplanationContainer, container: { direction: 'column' }, children: [_jsx(TextArea, { label: '
|
|
89
|
+
}, defaultValue: defaultValue, loading: loading, errors: errors, readOnly: readOnly, onChange: onChange, "aria-label": t('expression_editor'), showEditorOnly: showEditorOnly, inLineErrors: inLineErrors })) }), _jsxs(Flex, { container: { direction: 'column', gap: 1 }, children: [_jsx(Flex, { container: true, item: { alignSelf: 'end' }, as: StyledExplainContainer, children: generateExplanation?.loadingExplanation ? (_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [t('generating_explanation'), _jsx(Progress, { placement: 'inline' })] })) : (_jsx(AIButton, { onClick: generateExplanation?.onExplain, label: t('explain'), variant: 'secondary', "data-testid": testIds.explain })) }), _jsxs(Flex, { as: StyledExplanationContainer, container: { direction: 'column' }, children: [_jsx(TextArea, { label: t('generated_explanation'), value: generateExplanation?.explanation, autoResize: false, testId: testIds.explanation, readOnly: true }), generateExplanation?.loadingExplanation && (_jsx(Progress, { variant: 'ring', placement: 'local' }))] }), generateExplanation?.onClearExplanation && (_jsx(Button, { as: StyledClearButton, onClick: generateExplanation.onClearExplanation, "data-testid": testIds.clear, children: t('clear') }))] })] })] }));
|
|
90
90
|
});
|
|
91
91
|
export default withTestIds(ExpressionBuilder, getExpressionBuilderIds);
|
|
92
92
|
//# sourceMappingURL=ExpressionBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionBuilder.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,M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jB,MAAM,EAAE,OAAO,CAAC,WAAW,EAC3B,QAAQ,SACR,EACD,mBAAmB,EAAE,kBAAkB,IAAI,CAC1C,KAAC,QAAQ,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,OAAO,GAAG,CAC9C,IACI,EAEN,mBAAmB,EAAE,kBAAkB,IAAI,CAC1C,KAAC,MAAM,IACL,EAAE,EAAE,iBAAiB,EACrB,OAAO,EAAE,mBAAmB,CAAC,kBAAkB,EAC/C,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,iBAChB,OAAO,CAAC,KAAK,YAEzB,CAAC,CAAC,OAAO,CAAC,GACJ,CACV,IACI,IACF,IACiB,CAC3B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useImperativeHandle, useMemo, useRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Flex,\n SearchInput,\n useI18n,\n VisuallyHiddenText,\n withTestIds,\n useTestIds,\n useLiveLog,\n useAfterInitialEffect,\n Label,\n Text,\n Progress,\n AIButton,\n Button,\n TextArea\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport type { ExpressionItemProps, ExpressionBuilderProps } from './ExpressionBuilder.types';\nimport type { EditorState } from './CodeEditor/CodeEditor.types';\nimport ExpressionList from './ExpressionList';\nimport {\n StyledExpressionWrapper,\n StyledClearButton,\n StyledExplanationContainer,\n StyledExpressionBuilder,\n StyledCodeEditorContainer,\n StyledExplainContainer,\n StyledExpressions,\n StyledFormField,\n StyledGeneratedExpression,\n StyledInsertButton\n} from './ExpressionBuilder.styles';\nimport CodeEditor from './CodeEditor/CodeEditor';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\nimport { getExpressionBuilderIds } from './ExpressionBuilder.test-ids';\n\nconst ExpressionBuilder: ForwardRefForwardPropsComponent<ExpressionBuilderProps> = forwardRef(\n (\n {\n testId,\n list,\n search,\n errors,\n defaultValue,\n handle,\n showEditorOnly = false,\n fetchSuggestions,\n loading,\n readOnly,\n onChange,\n inLineErrors,\n placeholder,\n generateExplanation,\n label,\n required,\n additionalInfo,\n generateExpression,\n ...restProps\n }: PropsWithoutRef<ExpressionBuilderProps>,\n ref: ExpressionBuilderProps['ref']\n ) => {\n const t = useI18n();\n const { announcePolite } = useLiveLog();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const codeEditorHandle = useRef<EditorState>(null);\n const generatedExpressionHandler = useRef<EditorState>(null);\n const testIds = useTestIds(testId, getExpressionBuilderIds);\n const {\n describeExpressionTextArea,\n onGenerateExpression,\n loadingExpression = false,\n generatedExpression,\n onInsert\n } = generateExpression || {};\n\n const getExpression = () => {\n return codeEditorHandle.current?.getValue() || '';\n };\n\n const insertExpression = (text: string, replaceContent?: boolean) => {\n return codeEditorHandle.current?.insertText(text, replaceContent);\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression,\n ...(!!generateExpression && { insertExpression })\n }),\n [getExpression, insertExpression]\n );\n\n const addExpression = (expression: string) => {\n codeEditorHandle.current?.insertText(expression);\n };\n const onItemAdd = (id: ExpressionItemProps['id']) => {\n list.onItemAdd(id, addExpression);\n };\n\n const ctxValue = useMemo(\n () => ({\n accent: search.accent\n }),\n [search.accent]\n );\n\n useAfterInitialEffect(() => {\n if (generateExplanation?.loadingExplanation) {\n announcePolite({ message: t('generating_explanation') });\n } else if (generateExplanation?.explanation) {\n announcePolite({ message: t('explanation_generated') });\n }\n }, [generateExplanation?.loadingExplanation, generateExplanation?.explanation]);\n\n useAfterInitialEffect(() => {\n if (loadingExpression) {\n announcePolite({ message: t('generating_expression') });\n }\n if (generatedExpression && !loadingExpression) {\n announcePolite({ message: t('expression_generated') });\n }\n }, [loadingExpression, generatedExpression]);\n\n useEffect(() => {\n if (generatedExpression !== undefined) {\n generatedExpressionHandler.current?.insertText(generatedExpression, true);\n }\n }, [generatedExpression]);\n\n return (\n <StyledExpressionBuilder\n data-testid={testIds.root}\n {...restProps}\n ref={ref}\n container={{\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n showEditorOnly={showEditorOnly}\n showGenerateExpression={!!generateExpression}\n >\n {/* Results count and Column 1 */}\n {!readOnly && !showEditorOnly && (\n <>\n <VisuallyHiddenText aria-live='polite' role='status'>\n {t('results_count', [list.items?.length || 0], { count: list.items?.length || 0 })}\n </VisuallyHiddenText>\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n gap: 1,\n pad: [1, 1, 1, 2]\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n as={generateExpression ? StyledExpressions : undefined}\n >\n {generateExpression && (\n <>\n <TextArea\n label={t('describe_expression')}\n defaultValue={describeExpressionTextArea?.defaultValue}\n autoResize={false}\n additionalInfo={describeExpressionTextArea?.additionalInfo}\n placeholder={describeExpressionTextArea?.placeholder}\n info={describeExpressionTextArea?.error}\n status={describeExpressionTextArea?.error ? 'error' : undefined}\n testId={testIds.describeExpression}\n ref={textAreaRef}\n row={3}\n />\n\n <Flex container item={{ alignSelf: 'end' }}>\n {loadingExpression ? (\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n {t('generating_expression')}\n <Progress placement='inline' />\n </Flex>\n ) : (\n onGenerateExpression && (\n <AIButton\n onClick={() => onGenerateExpression(textAreaRef.current?.value || '')}\n label={t('generate')}\n variant='secondary'\n data-testid={testIds.generate}\n />\n )\n )}\n </Flex>\n\n <Flex\n container={{ direction: 'column' }}\n item={{ grow: 1 }}\n as={StyledGeneratedExpression}\n >\n <Label>{t('generated_expression')}</Label>\n <CodeEditor\n codeEditorHandle={generatedExpressionHandler}\n editorConfigProps={{\n mode: 'expression',\n readOnly: true\n }}\n readOnly\n testId={testIds.generatedExpression}\n />\n {loadingExpression && <Progress variant='ring' placement='local' />}\n </Flex>\n\n {onInsert && (\n <Button\n as={StyledInsertButton}\n onClick={() => onInsert(generatedExpressionHandler.current?.getValue() ?? '')}\n label={t('add')}\n data-testid={testIds.insert}\n >\n {t('add')}\n </Button>\n )}\n\n <Text variant='h4'>{t('library')}</Text>\n </>\n )}\n <SearchInput testId={testIds.search} {...search} />\n <ExpressionBuilderContext.Provider value={ctxValue}>\n <ExpressionList testId={testIds.root} {...list} onItemAdd={onItemAdd} />\n </ExpressionBuilderContext.Provider>\n </Flex>\n </>\n )}\n {/* Column 2 */}\n <Flex\n container={{\n direction: 'column',\n gap: 1,\n pad: [1, 2, 1, 1]\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n as={StyledExpressionWrapper}\n >\n <Flex\n container\n as={StyledCodeEditorContainer}\n explainEnabled={!!generateExplanation?.onExplain}\n >\n {label ? (\n <StyledFormField label={label} additionalInfo={additionalInfo} required={required}>\n <CodeEditor\n testId={testIds.root}\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n autoCompleteTriggers={['.', '@', ':', '#', '(', ')']}\n editorConfigProps={{\n mode: 'expression',\n readOnly,\n lineNumbers: true,\n placeholder\n }}\n defaultValue={defaultValue}\n loading={loading}\n errors={errors}\n readOnly={readOnly}\n onChange={onChange}\n aria-label={t('expression_editor')}\n showEditorOnly={showEditorOnly}\n inLineErrors={inLineErrors}\n />\n </StyledFormField>\n ) : (\n <CodeEditor\n testId={testIds.root}\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n autoCompleteTriggers={['.', '@', ':', '#', '(', ')']}\n editorConfigProps={{\n mode: 'expression',\n readOnly,\n lineNumbers: true,\n placeholder\n }}\n defaultValue={defaultValue}\n loading={loading}\n errors={errors}\n readOnly={readOnly}\n onChange={onChange}\n aria-label={t('expression_editor')}\n showEditorOnly={showEditorOnly}\n inLineErrors={inLineErrors}\n />\n )}\n </Flex>\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Flex container item={{ alignSelf: 'end' }} as={StyledExplainContainer}>\n {generateExplanation?.loadingExplanation ? (\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n {t('generating_explanation')}\n <Progress placement='inline' />\n </Flex>\n ) : (\n <AIButton\n onClick={generateExplanation?.onExplain}\n label={t('explain')}\n variant='secondary'\n data-testid={testIds.explain}\n />\n )}\n </Flex>\n <Flex as={StyledExplanationContainer} container={{ direction: 'column' }}>\n <TextArea\n label='Generated Explanation'\n value={generateExplanation?.explanation}\n autoResize={false}\n testId={testIds.explanation}\n readOnly\n />\n {generateExplanation?.loadingExplanation && (\n <Progress variant='ring' placement='local' />\n )}\n </Flex>\n\n {generateExplanation?.onClearExplanation && (\n <Button\n as={StyledClearButton}\n onClick={generateExplanation.onClearExplanation}\n label={t('clear_explanation')}\n data-testid={testIds.clear}\n >\n {t('clear')}\n </Button>\n )}\n </Flex>\n </Flex>\n </StyledExpressionBuilder>\n );\n }\n);\n\nexport default withTestIds(ExpressionBuilder, getExpressionBuilderIds);\n"]}
|
|
1
|
+
{"version":3,"file":"ExpressionBuilder.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpF,OAAO,EACL,IAAI,EACJ,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAKjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,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AC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useImperativeHandle, useMemo, useRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Flex,\n SearchInput,\n useI18n,\n VisuallyHiddenText,\n withTestIds,\n useTestIds,\n useLiveLog,\n useAfterInitialEffect,\n Label,\n Text,\n Progress,\n AIButton,\n Button,\n TextArea\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport type { ExpressionItemProps, ExpressionBuilderProps } from './ExpressionBuilder.types';\nimport type { EditorState } from './CodeEditor/CodeEditor.types';\nimport ExpressionList from './ExpressionList';\nimport {\n StyledExpressionWrapper,\n StyledClearButton,\n StyledExplanationContainer,\n StyledExpressionBuilder,\n StyledCodeEditorContainer,\n StyledExplainContainer,\n StyledExpressions,\n StyledFormField,\n StyledGeneratedExpression,\n StyledInsertButton\n} from './ExpressionBuilder.styles';\nimport CodeEditor from './CodeEditor/CodeEditor';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\nimport { getExpressionBuilderIds } from './ExpressionBuilder.test-ids';\n\nconst ExpressionBuilder: ForwardRefForwardPropsComponent<ExpressionBuilderProps> = forwardRef(\n (\n {\n testId,\n list,\n search,\n errors,\n defaultValue,\n handle,\n showEditorOnly = false,\n fetchSuggestions,\n loading,\n readOnly,\n onChange,\n inLineErrors,\n placeholder,\n generateExplanation,\n label,\n required,\n additionalInfo,\n generateExpression,\n ...restProps\n }: PropsWithoutRef<ExpressionBuilderProps>,\n ref: ExpressionBuilderProps['ref']\n ) => {\n const t = useI18n();\n const { announcePolite } = useLiveLog();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const codeEditorHandle = useRef<EditorState>(null);\n const generatedExpressionHandler = useRef<EditorState>(null);\n const testIds = useTestIds(testId, getExpressionBuilderIds);\n const {\n describeExpressionTextArea,\n onGenerateExpression,\n loadingExpression = false,\n generatedExpression,\n onInsert\n } = generateExpression || {};\n\n const getExpression = () => {\n return codeEditorHandle.current?.getValue() || '';\n };\n\n const insertExpression = (text: string, replaceContent?: boolean) => {\n return codeEditorHandle.current?.insertText(text, replaceContent);\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression,\n ...(!!generateExpression && { insertExpression })\n }),\n [getExpression, insertExpression]\n );\n\n const addExpression = (expression: string) => {\n codeEditorHandle.current?.insertText(expression);\n };\n const onItemAdd = (id: ExpressionItemProps['id']) => {\n list.onItemAdd(id, addExpression);\n };\n\n const ctxValue = useMemo(\n () => ({\n accent: search.accent\n }),\n [search.accent]\n );\n\n useAfterInitialEffect(() => {\n if (generateExplanation?.loadingExplanation) {\n announcePolite({ message: t('generating_explanation') });\n } else if (generateExplanation?.explanation) {\n announcePolite({ message: t('explanation_generated') });\n }\n }, [generateExplanation?.loadingExplanation, generateExplanation?.explanation]);\n\n useAfterInitialEffect(() => {\n if (loadingExpression) {\n announcePolite({ message: t('generating_expression') });\n }\n if (generatedExpression && !loadingExpression) {\n announcePolite({ message: t('expression_generated') });\n }\n }, [loadingExpression, generatedExpression]);\n\n useEffect(() => {\n if (generatedExpression !== undefined) {\n generatedExpressionHandler.current?.insertText(generatedExpression, true);\n }\n }, [generatedExpression]);\n\n return (\n <StyledExpressionBuilder\n data-testid={testIds.root}\n {...restProps}\n ref={ref}\n container={{\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n showEditorOnly={showEditorOnly}\n showGenerateExpression={!!generateExpression}\n >\n {/* Results count and Column 1 */}\n {!readOnly && !showEditorOnly && (\n <>\n <VisuallyHiddenText aria-live='polite' role='status'>\n {t('results_count', [list.items?.length || 0], { count: list.items?.length || 0 })}\n </VisuallyHiddenText>\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n gap: 1,\n pad: [1, 1, 1, 2]\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n as={generateExpression ? StyledExpressions : undefined}\n >\n {generateExpression && (\n <>\n <TextArea\n label={t('describe_expression')}\n defaultValue={describeExpressionTextArea?.defaultValue}\n autoResize={false}\n additionalInfo={describeExpressionTextArea?.additionalInfo}\n placeholder={describeExpressionTextArea?.placeholder}\n info={describeExpressionTextArea?.error}\n status={describeExpressionTextArea?.error ? 'error' : undefined}\n testId={testIds.describeExpression}\n ref={textAreaRef}\n row={3}\n />\n\n <Flex container item={{ alignSelf: 'end' }}>\n {loadingExpression ? (\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n {t('generating_expression')}\n <Progress placement='inline' />\n </Flex>\n ) : (\n onGenerateExpression && (\n <AIButton\n onClick={() => onGenerateExpression(textAreaRef.current?.value || '')}\n label={t('generate')}\n variant='secondary'\n data-testid={testIds.generate}\n />\n )\n )}\n </Flex>\n\n <Flex\n container={{ direction: 'column' }}\n item={{ grow: 1 }}\n as={StyledGeneratedExpression}\n >\n <Label>{t('generated_expression')}</Label>\n <CodeEditor\n codeEditorHandle={generatedExpressionHandler}\n editorConfigProps={{\n mode: 'expression',\n readOnly: true\n }}\n readOnly\n testId={testIds.generatedExpression}\n />\n <Text variant='secondary'>{t('verify_ai_generated_expression')}</Text>\n {loadingExpression && <Progress variant='ring' placement='local' />}\n </Flex>\n\n {onInsert && (\n <Button\n as={StyledInsertButton}\n onClick={() => onInsert(generatedExpressionHandler.current?.getValue() ?? '')}\n data-testid={testIds.insert}\n >\n {t('insert')}\n </Button>\n )}\n\n <Text variant='h4'>{t('library')}</Text>\n </>\n )}\n <SearchInput testId={testIds.search} {...search} />\n <ExpressionBuilderContext.Provider value={ctxValue}>\n <ExpressionList testId={testIds.root} {...list} onItemAdd={onItemAdd} />\n </ExpressionBuilderContext.Provider>\n </Flex>\n </>\n )}\n {/* Column 2 */}\n <Flex\n container={{\n direction: 'column',\n gap: 1,\n pad: [1, 2, 1, 1]\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n as={StyledExpressionWrapper}\n >\n <Flex\n container\n as={StyledCodeEditorContainer}\n explainEnabled={!!generateExplanation?.onExplain}\n >\n {label ? (\n <StyledFormField label={label} additionalInfo={additionalInfo} required={required}>\n <CodeEditor\n testId={testIds.root}\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n autoCompleteTriggers={['.', '@', ':', '#', '(', ')']}\n editorConfigProps={{\n mode: 'expression',\n readOnly,\n lineNumbers: true,\n placeholder\n }}\n defaultValue={defaultValue}\n loading={loading}\n errors={errors}\n readOnly={readOnly}\n onChange={onChange}\n aria-label={t('expression_editor')}\n showEditorOnly={showEditorOnly}\n inLineErrors={inLineErrors}\n />\n </StyledFormField>\n ) : (\n <CodeEditor\n testId={testIds.root}\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n autoCompleteTriggers={['.', '@', ':', '#', '(', ')']}\n editorConfigProps={{\n mode: 'expression',\n readOnly,\n lineNumbers: true,\n placeholder\n }}\n defaultValue={defaultValue}\n loading={loading}\n errors={errors}\n readOnly={readOnly}\n onChange={onChange}\n aria-label={t('expression_editor')}\n showEditorOnly={showEditorOnly}\n inLineErrors={inLineErrors}\n />\n )}\n </Flex>\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Flex container item={{ alignSelf: 'end' }} as={StyledExplainContainer}>\n {generateExplanation?.loadingExplanation ? (\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n {t('generating_explanation')}\n <Progress placement='inline' />\n </Flex>\n ) : (\n <AIButton\n onClick={generateExplanation?.onExplain}\n label={t('explain')}\n variant='secondary'\n data-testid={testIds.explain}\n />\n )}\n </Flex>\n <Flex as={StyledExplanationContainer} container={{ direction: 'column' }}>\n <TextArea\n label={t('generated_explanation')}\n value={generateExplanation?.explanation}\n autoResize={false}\n testId={testIds.explanation}\n readOnly\n />\n {generateExplanation?.loadingExplanation && (\n <Progress variant='ring' placement='local' />\n )}\n </Flex>\n\n {generateExplanation?.onClearExplanation && (\n <Button\n as={StyledClearButton}\n onClick={generateExplanation.onClearExplanation}\n data-testid={testIds.clear}\n >\n {t('clear')}\n </Button>\n )}\n </Flex>\n </Flex>\n </StyledExpressionBuilder>\n );\n }\n);\n\nexport default withTestIds(ExpressionBuilder, getExpressionBuilderIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIxE,eAAO,MAAM,cAAc;eAA0B,OAAO;SAQ1D,CAAC;AAIH,eAAO,MAAM,UAAU,wGAIrB,CAAC;AAGH,eAAO,MAAM,aAAa;eAA2B,eAAe,GAAG,SAAS;QAAM,MAAM;SAW3F,CAAC;AAGF,eAAO,MAAM,mBAAmB,yGA4B9B,CAAC;;;;AAoFH,wBAAyD"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { defaultThemeProp, useTestIds, withTestIds, readableColor, tryCatch } from '@pega/cosmos-react-core';
|
|
6
|
-
import { generateDynamicTestId } from './utils';
|
|
6
|
+
import { generateDynamicTestId, isSingleTaskArray } from './utils';
|
|
7
7
|
import TaskGroup from './TaskGroup';
|
|
8
8
|
import { getCategoryTestIds } from './LifeCycle.test-ids';
|
|
9
9
|
export const StyledCategory = styled.h3(({ showTitle, theme }) => {
|
|
@@ -66,21 +66,14 @@ const Category = forwardRef(({ item, showTitle = false, stageItem, category, id,
|
|
|
66
66
|
const categoryTestID = generateDynamicTestId([stageItem.label, category?.label]);
|
|
67
67
|
const testIds = useTestIds(categoryTestID, getCategoryTestIds);
|
|
68
68
|
const hasNoTasks = item.tasks.length === 0;
|
|
69
|
-
const singleTaskArray = item.tasks.every(taskItem => !Array.isArray(taskItem));
|
|
70
69
|
const renderTaskGroups = () => {
|
|
71
70
|
if (hasNoTasks) {
|
|
72
71
|
return (_jsx(TaskGroup, { ...restProps, taskItem: [], parallel: false, index: 0, stageItem: stageItem, categoryItem: { ...item, label: category?.label }, task: task }));
|
|
73
72
|
}
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
const tasks = item.tasks;
|
|
77
|
-
return (_createElement(TaskGroup, { ...restProps,
|
|
78
|
-
// FIXME: Check if key is necessary
|
|
79
|
-
key: tasks[0].id, taskItem: tasks, parallel: false, index: 0, stageItem: stageItem, categoryItem: { ...item, label: category?.label }, task: task }));
|
|
73
|
+
if (isSingleTaskArray(item.tasks)) {
|
|
74
|
+
return (_jsx(TaskGroup, { ...restProps, taskItem: item.tasks, parallel: false, index: 0, stageItem: stageItem, categoryItem: { ...item, label: category?.label }, task: task }));
|
|
80
75
|
}
|
|
81
|
-
return item.tasks.map((taskItem, index) => (_createElement(TaskGroup, { ...restProps,
|
|
82
|
-
// FIXME: With type guard verify if ternary is necessary
|
|
83
|
-
key: Array.isArray(taskItem) ? taskItem[0]?.id : taskItem.id, taskItem: taskItem, parallel: index > 0, index: index, stageItem: stageItem, categoryItem: { ...item, label: category?.label }, task: task })));
|
|
76
|
+
return item.tasks.map((taskItem, index) => (_createElement(TaskGroup, { ...restProps, key: taskItem[0]?.id, taskItem: taskItem, parallel: index > 0, index: index, stageItem: stageItem, categoryItem: { ...item, label: category?.label }, task: task })));
|
|
84
77
|
};
|
|
85
78
|
return (_jsxs(_Fragment, { children: [category?.label && (_jsx(StyledCategory, { showTitle: showTitle, tabIndex: -1, id: item.categoryId, children: category?.label })), _jsx(StyledWrapper, { category: category, id: item.id, "data-id": item.categoryId, ref: ref, children: _jsx(StyledList, { "data-testid": testIds.root, children: renderTaskGroups() }) })] }));
|
|
86
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAyB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IACvF,OAAO,GAAG,CAAA;MACN,CAAC,SAAS;QACZ,GAAG,CAAA;;KAEF;cACS,KAAK,CAAC,IAAI,CAAC,OAAO;GAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,EA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K,GAAG,CAAC,EACnB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EACjD,IAAI,EAAE,IAAI,GACV,CACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,8BACG,QAAQ,EAAE,KAAK,IAAI,CAClB,KAAC,cAAc,IAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,YACpE,QAAQ,EAAE,KAAK,GACD,CAClB,EACD,KAAC,aAAa,IACZ,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,IAAI,CAAC,EAAE,aACF,IAAI,CAAC,UAAU,EACxB,GAAG,EAAE,GAA0B,YAE/B,KAAC,UAAU,mBAAc,OAAO,CAAC,IAAI,YAAG,gBAAgB,EAAE,GAAc,GAC1D,IACf,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n useTestIds,\n withTestIds,\n readableColor,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport { generateDynamicTestId, isSingleTaskArray } from './utils';\nimport type { CategoriesProps, CategoryProps } from './LifeCycle.types';\nimport TaskGroup from './TaskGroup';\nimport { getCategoryTestIds } from './LifeCycle.test-ids';\n\nexport const StyledCategory = styled.h3<{ showTitle: boolean }>(({ showTitle, theme }) => {\n return css`\n ${!showTitle &&\n css`\n visibility: hidden;\n `}\n margin: ${theme.base.spacing} 0 0 0;\n `;\n});\n\nStyledCategory.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.ol(() => {\n return css`\n list-style-type: none;\n `;\n});\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledWrapper = styled.div<{ category?: CategoriesProps | undefined; id: string }>(\n ({ category, theme, id }) => {\n const categoryHeight = `${category?.height}px`;\n return css`\n margin-block-start: ${theme.base.spacing};\n margin-block-end: ${theme.base.spacing};\n ${category?.elementId !== id &&\n ` min-height: ${category?.height ? categoryHeight : 'auto'};\n `}\n `;\n }\n);\nStyledWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledParallelTitle = styled.div(({ theme }) => {\n const backgroundColor = theme.base.colors.slate.dark;\n\n return css`\n position: relative;\n z-index: 1;\n margin-block-end: 0.5rem;\n text-align: center;\n &::before {\n border-block-start: calc(0.2 * ${theme.base.spacing}) solid ${backgroundColor};\n content: '';\n margin: 0 auto;\n position: absolute;\n top: 50%;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n z-index: -1;\n }\n span {\n background: ${backgroundColor};\n padding: 0 ${theme.base.spacing};\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n color: ${tryCatch(() => readableColor(backgroundColor))};\n text-transform: uppercase;\n }\n `;\n});\n\nStyledParallelTitle.defaultProps = defaultThemeProp;\n\nconst Category: ForwardRefForwardPropsComponent<CategoryProps> = forwardRef(\n (\n {\n item,\n showTitle = false,\n stageItem,\n category,\n id,\n task,\n ...restProps\n }: PropsWithoutRef<CategoryProps>,\n ref: CategoryProps['ref']\n ) => {\n const categoryTestID = generateDynamicTestId([stageItem.label, category?.label]);\n const testIds = useTestIds(categoryTestID, getCategoryTestIds);\n const hasNoTasks = item.tasks.length === 0;\n\n const renderTaskGroups = () => {\n if (hasNoTasks) {\n return (\n <TaskGroup\n {...restProps}\n taskItem={[]}\n parallel={false}\n index={0}\n stageItem={stageItem}\n categoryItem={{ ...item, label: category?.label }}\n task={task}\n />\n );\n }\n\n if (isSingleTaskArray(item.tasks)) {\n return (\n <TaskGroup\n {...restProps}\n taskItem={item.tasks}\n parallel={false}\n index={0}\n stageItem={stageItem}\n categoryItem={{ ...item, label: category?.label }}\n task={task}\n />\n );\n }\n\n return item.tasks.map((taskItem, index) => (\n <TaskGroup\n {...restProps}\n key={taskItem[0]?.id}\n taskItem={taskItem}\n parallel={index > 0}\n index={index}\n stageItem={stageItem}\n categoryItem={{ ...item, label: category?.label }}\n task={task}\n />\n ));\n };\n\n return (\n <>\n {category?.label && (\n <StyledCategory showTitle={showTitle} tabIndex={-1} id={item.categoryId}>\n {category?.label}\n </StyledCategory>\n )}\n <StyledWrapper\n category={category}\n id={item.id}\n data-id={item.categoryId}\n ref={ref as Ref<HTMLDivElement>}\n >\n <StyledList data-testid={testIds.root}>{renderTaskGroups()}</StyledList>\n </StyledWrapper>\n </>\n );\n }\n);\n\nexport default withTestIds(Category, getCategoryTestIds);\n"]}
|
|
@@ -140,6 +140,7 @@ export interface IndexData {
|
|
|
140
140
|
step?: number;
|
|
141
141
|
}
|
|
142
142
|
export type LifeCycleDragItemType = 'stage' | 'step' | 'task' | 'alternate-stage' | 'alternate-step' | 'alternate-task';
|
|
143
|
+
export type LifeCycleDragDropDirection = 'next' | 'prev';
|
|
143
144
|
export interface LifeCycleDragDropEvent {
|
|
144
145
|
/** The type of item that was moved. */
|
|
145
146
|
type: 'stage' | 'step' | 'task';
|
|
@@ -612,6 +613,9 @@ export declare const getStageInfo: (currentType: StageType, transitionType: Stag
|
|
|
612
613
|
readonly modal: {
|
|
613
614
|
readonly background: string;
|
|
614
615
|
};
|
|
616
|
+
readonly popover: {
|
|
617
|
+
readonly background: string;
|
|
618
|
+
};
|
|
615
619
|
readonly lifecycle: {
|
|
616
620
|
readonly background: string;
|
|
617
621
|
readonly task: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifeCycle.types.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,K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J,CAAC;YACD,IAAI,aAAa,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;gBAC5C,MAAM,CAAC,MAAM,GAAG;oBACd,GAAG,MAAM,CAAC,MAAM;oBAChB,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE;iBAC1B,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,WAAW;gBACvB,gBAAgB,CAAC,MAAM,CAAC,WAAW,IAAI,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type { MouseEvent, Ref } from 'react';\n\nimport type {\n Action,\n StatusProps,\n NoChildrenProp,\n BaseProps,\n FormControlProps\n} from '@pega/cosmos-react-core';\nimport { WorkTheme as Theme } from '@pega/cosmos-react-core';\n\nimport type { LibraryItem } from '../ItemLibrary';\n\nimport type { VisualStepItemProps } from './Step';\n\nexport type StageType = 'start' | 'default' | 'alternate';\n\ninterface ItemIdentifiers {\n /** The index of the item within its list */\n index?: number;\n /** If true, this item belongs to an alternate lifecycle list */\n alternate?: boolean;\n}\n\nexport interface StepItemProps extends ItemIdentifiers {\n id: string;\n label: string;\n visual: VisualStepItemProps;\n status: { type?: StatusProps['variant'] | ''; label: string };\n error?: string;\n}\n\nexport interface TaskItemProps extends ItemIdentifiers {\n id: string;\n label: string;\n visual: {\n imgSrc: string;\n };\n error?: string;\n steps: StepItemProps[];\n subIndex?: number;\n}\n\nexport interface CategoryItemProps extends ItemIdentifiers {\n /** Data model should have id of the stage item */\n id: string;\n /** id to map with category items */\n categoryId: string;\n /** Data model should have the categoryData array */\n tasks: TaskItemProps[] | TaskItemProps[][];\n}\n\nexport interface StageItemProps extends ItemIdentifiers {\n /** Data model should have id of the stage item */\n id: string;\n /** Data model should have the stage label */\n label: string;\n /** Data model should have the categoryData array */\n categories: CategoryItemProps[];\n /** Data model should have the stageType as below */\n type: StageType;\n error?: string;\n /* Sets stage transition to wait or resolution */\n transitionType?: 'wait' | 'resolution' | undefined;\n}\n\nexport interface LifeCycleActionParam {\n value?: string;\n stage?: StageItemProps;\n task?: TaskItemProps;\n category?: CategoryItemProps;\n step?: StepItemProps;\n type?: 'Stage' | 'Step' | 'Task' | 'Alternate Stage';\n routeTo?: string;\n}\n\nexport interface LifeCycleAction extends Omit<Action, 'onClick'> {\n onClick: (\n param: LifeCycleActionParam,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>,\n menuButtonEl?: HTMLButtonElement\n ) => void;\n}\n\nexport interface CategoriesItemProps {\n label: string;\n id: string;\n}\n\nexport interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Label for the region. */\n label?: string;\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: Record<StageType, LifeCycleAction[]> | LifeCycleAction[];\n /** Callback for Add stage */\n onAddStage?: () => void;\n /** Callback for Adding alternate stage */\n onAddAlternateStage?: () => void;\n /** callback for Click of stage */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface CategoriesProps extends CategoriesItemProps {\n /** height property used to manipulate height of catergory dom */\n height?: number;\n elementId?: string;\n}\n\nexport interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Tooltip for adding items to the task component */\n addStepTitle?: string;\n /** Region for adding the task component */\n addTask?: {\n title: string;\n showOnce: boolean;\n onAddTask?: LifeCycleAction['onClick'];\n };\n /** Callback for adding a step when nodeLibrary is provided. */\n onAddStep?: (param: LifeCycleActionParam, selectedItem: LibraryItem) => void;\n /** Callback for adding a step when nodeLibrary is not provided. */\n onAddCustomStep?: (param: LifeCycleActionParam) => void;\n /** callback for Click of a task */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n /** Types of Nodes */\n nodeLibrary?: LibraryItem[];\n}\n\nexport interface CategoryProps extends BaseProps, NoChildrenProp {\n ref?: Ref<HTMLOListElement | HTMLDivElement>;\n /** Pass the category items */\n item: CategoryItemProps;\n /** Enable the title for categories */\n showTitle?: boolean;\n /** Props of the categoryColumn */\n category?: CategoriesProps;\n /** Task component prop */\n task?: TaskProps;\n /** Stage data - to be passed in callbacks */\n stageItem: StageItemProps;\n /** Id for the component */\n id: string;\n}\n\nexport interface StepProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** If true, step names will wrap rather than truncate. */\n wrap?: boolean;\n /** callback for Click of a step */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface IndexData {\n /** Determines if the item part of an alternate stage. */\n alternate: boolean;\n /** The index of the parent stage to the item, or the item itself. */\n stage?: number;\n /** The index of the parent category to the item. */\n category?: number;\n /** The index of the parent task to the item, or the item itself. */\n task?: number;\n /** The index of the parent stage to the item, or the item itself, if the task is nested within another task. */\n subTask?: number;\n /** The index of the step item. */\n step?: number;\n}\n\nexport type LifeCycleDragItemType =\n | 'stage'\n | 'step'\n | 'task'\n | 'alternate-stage'\n | 'alternate-step'\n | 'alternate-task';\n\nexport interface LifeCycleDragDropEvent {\n /** The type of item that was moved. */\n type: 'stage' | 'step' | 'task';\n /** The indices of the source item. */\n sourceData: IndexData;\n /** The indices of the target location. */\n targetData: IndexData;\n}\n\nexport interface DragDropConfig\n extends Record<LifeCycleDragItemType, { enabled: boolean; accept: LifeCycleDragItemType[] }> {\n loading?: boolean;\n}\n\nexport interface LifeCycleProps extends BaseProps, NoChildrenProp {\n /** Pass reference to the LifeCycleComponent */\n ref?: Ref<HTMLDivElement>;\n /** Array of stages and its contents */\n items: StageItemProps[];\n /** Array of alternate stages and its contents */\n alternateItems?: StageItemProps[];\n /** Props for the task component */\n task?: TaskProps[];\n /** Props for the Stage component */\n stage?: StageProps;\n /** Props for the AlternatStage component */\n alternateStage?: StageProps;\n /** Props for the Cluster component */\n categories?: CategoriesProps[];\n /** Props for the Step component */\n step?: StepProps[];\n /** Call back function for on AddState */\n onAddStage?: () => void;\n /** Call back function to add alternate stages */\n onAddAlternateStage?: () => void;\n /** Selected stage or task or step */\n selectedItemId?: string;\n /** Callback function for updating the items following a drag drop event. */\n onDragDrop?: (event: LifeCycleDragDropEvent) => void;\n /**\n * Configuration to control which item types each lifecycle region can accept, and which types are draggable.\n * */\n dragDropConfig?: DragDropConfig;\n /** makes component read-only */\n readOnly?: boolean;\n}\n\nexport interface StageInfo {\n id: StageType;\n visual: {\n bgColor: string;\n bgHover: string;\n tailPointed?: boolean;\n headPointed?: boolean;\n };\n}\n\n// calculates the final stage info based on prev type and returns the final stage info\n// second param is mandatory for accurate results, optional only for the first stage\nexport const getStageInfo = (\n currentType: StageType,\n transitionType: StageItemProps['transitionType'],\n prevStageItem: StageItemProps,\n isLastItem = false,\n theme = Theme\n) => {\n const stageTypeDefaults: Record<StageType, StageInfo> = {\n start: {\n id: 'start',\n visual: {\n bgColor: theme.components.lifecycle.stage.start.background,\n bgHover: theme.components.lifecycle.stage.start['hover-color'],\n tailPointed: false,\n headPointed: true\n }\n },\n default: {\n id: 'default',\n visual: {\n bgColor: theme.components.lifecycle.stage.default.background,\n bgHover: theme.components.lifecycle.stage.default['hover-color'],\n tailPointed: true,\n headPointed: true\n }\n },\n alternate: {\n id: 'alternate',\n visual: {\n bgColor: theme.components.lifecycle.stage.alternate.background,\n bgHover: theme.components.lifecycle.stage.alternate['hover-color'],\n tailPointed: false,\n headPointed: false\n }\n }\n };\n\n const resolutionStyle = {\n bgColor: theme.components.lifecycle.stage.resolution.background,\n bgHover: theme.components.lifecycle.stage.resolution['hover-color']\n };\n const clonedStageCopy = structuredClone(stageTypeDefaults);\n const currentStageInfo = clonedStageCopy[currentType] || clonedStageCopy.default;\n if (currentType !== 'alternate') {\n if (transitionType === 'resolution') {\n currentStageInfo.visual = {\n ...resolutionStyle,\n tailPointed: currentType !== 'start'\n };\n }\n if (transitionType === 'wait') {\n currentStageInfo.visual = {\n ...currentStageInfo.visual,\n tailPointed: currentType !== 'start',\n headPointed: false\n };\n }\n }\n\n // cloning, to avoid getting modified\n const result: StageInfo = {\n ...currentStageInfo,\n visual: {\n ...currentStageInfo.visual\n }\n };\n if (prevStageItem?.type) {\n const clonedStage = JSON.parse(JSON.stringify(stageTypeDefaults));\n const prevStageInfo = clonedStage[prevStageItem.type] || clonedStage.start;\n if (prevStageItem.type !== 'alternate') {\n if (prevStageItem.transitionType === 'resolution') {\n result.visual = {\n ...result.visual,\n tailPointed: false\n };\n }\n if (prevStageItem.transitionType === 'wait') {\n result.visual = {\n ...result.visual,\n ...{ tailPointed: false }\n };\n }\n } else {\n result.visual.tailPointed =\n currentStageInfo.visual.tailPointed && prevStageInfo.visual.headPointed;\n }\n }\n if (isLastItem) {\n result.visual.headPointed = false;\n }\n return result;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"LifeCycle.types.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAmO7D,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,WAAsB,EACtB,cAAgD,EAChD,aAA6B,EAC7B,UAAU,GAAG,KAAK,EAClB,KAAK,GAAG,KAAK,EACb,EAAE;IACF,MAAM,iBAAiB,GAAiC;QACtD,KAAK,EAAE;YACL,EAAE,EAAE,OAAO;YACX,MAAM,EAAE;gBACN,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU;gBAC1D,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,C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AChB,CAAC,CAAC","sourcesContent":["import type { MouseEvent, Ref } from 'react';\n\nimport type {\n Action,\n StatusProps,\n NoChildrenProp,\n BaseProps,\n FormControlProps\n} from '@pega/cosmos-react-core';\nimport { WorkTheme as Theme } from '@pega/cosmos-react-core';\n\nimport type { LibraryItem } from '../ItemLibrary';\n\nimport type { VisualStepItemProps } from './Step';\n\nexport type StageType = 'start' | 'default' | 'alternate';\n\ninterface ItemIdentifiers {\n /** The index of the item within its list */\n index?: number;\n /** If true, this item belongs to an alternate lifecycle list */\n alternate?: boolean;\n}\n\nexport interface StepItemProps extends ItemIdentifiers {\n id: string;\n label: string;\n visual: VisualStepItemProps;\n status: { type?: StatusProps['variant'] | ''; label: string };\n error?: string;\n}\n\nexport interface TaskItemProps extends ItemIdentifiers {\n id: string;\n label: string;\n visual: {\n imgSrc: string;\n };\n error?: string;\n steps: StepItemProps[];\n subIndex?: number;\n}\n\nexport interface CategoryItemProps extends ItemIdentifiers {\n /** Data model should have id of the stage item */\n id: string;\n /** id to map with category items */\n categoryId: string;\n /** Data model should have the categoryData array */\n tasks: TaskItemProps[] | TaskItemProps[][];\n}\n\nexport interface StageItemProps extends ItemIdentifiers {\n /** Data model should have id of the stage item */\n id: string;\n /** Data model should have the stage label */\n label: string;\n /** Data model should have the categoryData array */\n categories: CategoryItemProps[];\n /** Data model should have the stageType as below */\n type: StageType;\n error?: string;\n /* Sets stage transition to wait or resolution */\n transitionType?: 'wait' | 'resolution' | undefined;\n}\n\nexport interface LifeCycleActionParam {\n value?: string;\n stage?: StageItemProps;\n task?: TaskItemProps;\n category?: CategoryItemProps;\n step?: StepItemProps;\n type?: 'Stage' | 'Step' | 'Task' | 'Alternate Stage';\n routeTo?: string;\n}\n\nexport interface LifeCycleAction extends Omit<Action, 'onClick'> {\n onClick: (\n param: LifeCycleActionParam,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>,\n menuButtonEl?: HTMLButtonElement\n ) => void;\n}\n\nexport interface CategoriesItemProps {\n label: string;\n id: string;\n}\n\nexport interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Label for the region. */\n label?: string;\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: Record<StageType, LifeCycleAction[]> | LifeCycleAction[];\n /** Callback for Add stage */\n onAddStage?: () => void;\n /** Callback for Adding alternate stage */\n onAddAlternateStage?: () => void;\n /** callback for Click of stage */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface CategoriesProps extends CategoriesItemProps {\n /** height property used to manipulate height of catergory dom */\n height?: number;\n elementId?: string;\n}\n\nexport interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Tooltip for adding items to the task component */\n addStepTitle?: string;\n /** Region for adding the task component */\n addTask?: {\n title: string;\n showOnce: boolean;\n onAddTask?: LifeCycleAction['onClick'];\n };\n /** Callback for adding a step when nodeLibrary is provided. */\n onAddStep?: (param: LifeCycleActionParam, selectedItem: LibraryItem) => void;\n /** Callback for adding a step when nodeLibrary is not provided. */\n onAddCustomStep?: (param: LifeCycleActionParam) => void;\n /** callback for Click of a task */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n /** Types of Nodes */\n nodeLibrary?: LibraryItem[];\n}\n\nexport interface CategoryProps extends BaseProps, NoChildrenProp {\n ref?: Ref<HTMLOListElement | HTMLDivElement>;\n /** Pass the category items */\n item: CategoryItemProps;\n /** Enable the title for categories */\n showTitle?: boolean;\n /** Props of the categoryColumn */\n category?: CategoriesProps;\n /** Task component prop */\n task?: TaskProps;\n /** Stage data - to be passed in callbacks */\n stageItem: StageItemProps;\n /** Id for the component */\n id: string;\n}\n\nexport interface StepProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** If true, step names will wrap rather than truncate. */\n wrap?: boolean;\n /** callback for Click of a step */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface IndexData {\n /** Determines if the item part of an alternate stage. */\n alternate: boolean;\n /** The index of the parent stage to the item, or the item itself. */\n stage?: number;\n /** The index of the parent category to the item. */\n category?: number;\n /** The index of the parent task to the item, or the item itself. */\n task?: number;\n /** The index of the parent stage to the item, or the item itself, if the task is nested within another task. */\n subTask?: number;\n /** The index of the step item. */\n step?: number;\n}\n\nexport type LifeCycleDragItemType =\n | 'stage'\n | 'step'\n | 'task'\n | 'alternate-stage'\n | 'alternate-step'\n | 'alternate-task';\n\nexport type LifeCycleDragDropDirection = 'next' | 'prev';\n\nexport interface LifeCycleDragDropEvent {\n /** The type of item that was moved. */\n type: 'stage' | 'step' | 'task';\n /** The indices of the source item. */\n sourceData: IndexData;\n /** The indices of the target location. */\n targetData: IndexData;\n}\n\nexport interface DragDropConfig\n extends Record<LifeCycleDragItemType, { enabled: boolean; accept: LifeCycleDragItemType[] }> {\n loading?: boolean;\n}\n\nexport interface LifeCycleProps extends BaseProps, NoChildrenProp {\n /** Pass reference to the LifeCycleComponent */\n ref?: Ref<HTMLDivElement>;\n /** Array of stages and its contents */\n items: StageItemProps[];\n /** Array of alternate stages and its contents */\n alternateItems?: StageItemProps[];\n /** Props for the task component */\n task?: TaskProps[];\n /** Props for the Stage component */\n stage?: StageProps;\n /** Props for the AlternatStage component */\n alternateStage?: StageProps;\n /** Props for the Cluster component */\n categories?: CategoriesProps[];\n /** Props for the Step component */\n step?: StepProps[];\n /** Call back function for on AddState */\n onAddStage?: () => void;\n /** Call back function to add alternate stages */\n onAddAlternateStage?: () => void;\n /** Selected stage or task or step */\n selectedItemId?: string;\n /** Callback function for updating the items following a drag drop event. */\n onDragDrop?: (event: LifeCycleDragDropEvent) => void;\n /**\n * Configuration to control which item types each lifecycle region can accept, and which types are draggable.\n * */\n dragDropConfig?: DragDropConfig;\n /** makes component read-only */\n readOnly?: boolean;\n}\n\nexport interface StageInfo {\n id: StageType;\n visual: {\n bgColor: string;\n bgHover: string;\n tailPointed?: boolean;\n headPointed?: boolean;\n };\n}\n\n// calculates the final stage info based on prev type and returns the final stage info\n// second param is mandatory for accurate results, optional only for the first stage\nexport const getStageInfo = (\n currentType: StageType,\n transitionType: StageItemProps['transitionType'],\n prevStageItem: StageItemProps,\n isLastItem = false,\n theme = Theme\n) => {\n const stageTypeDefaults: Record<StageType, StageInfo> = {\n start: {\n id: 'start',\n visual: {\n bgColor: theme.components.lifecycle.stage.start.background,\n bgHover: theme.components.lifecycle.stage.start['hover-color'],\n tailPointed: false,\n headPointed: true\n }\n },\n default: {\n id: 'default',\n visual: {\n bgColor: theme.components.lifecycle.stage.default.background,\n bgHover: theme.components.lifecycle.stage.default['hover-color'],\n tailPointed: true,\n headPointed: true\n }\n },\n alternate: {\n id: 'alternate',\n visual: {\n bgColor: theme.components.lifecycle.stage.alternate.background,\n bgHover: theme.components.lifecycle.stage.alternate['hover-color'],\n tailPointed: false,\n headPointed: false\n }\n }\n };\n\n const resolutionStyle = {\n bgColor: theme.components.lifecycle.stage.resolution.background,\n bgHover: theme.components.lifecycle.stage.resolution['hover-color']\n };\n const clonedStageCopy = structuredClone(stageTypeDefaults);\n const currentStageInfo = clonedStageCopy[currentType] || clonedStageCopy.default;\n if (currentType !== 'alternate') {\n if (transitionType === 'resolution') {\n currentStageInfo.visual = {\n ...resolutionStyle,\n tailPointed: currentType !== 'start'\n };\n }\n if (transitionType === 'wait') {\n currentStageInfo.visual = {\n ...currentStageInfo.visual,\n tailPointed: currentType !== 'start',\n headPointed: false\n };\n }\n }\n\n // cloning, to avoid getting modified\n const result: StageInfo = {\n ...currentStageInfo,\n visual: {\n ...currentStageInfo.visual\n }\n };\n if (prevStageItem?.type) {\n const clonedStage = JSON.parse(JSON.stringify(stageTypeDefaults));\n const prevStageInfo = clonedStage[prevStageItem.type] || clonedStage.start;\n if (prevStageItem.type !== 'alternate') {\n if (prevStageItem.transitionType === 'resolution') {\n result.visual = {\n ...result.visual,\n tailPointed: false\n };\n }\n if (prevStageItem.transitionType === 'wait') {\n result.visual = {\n ...result.visual,\n ...{ tailPointed: false }\n };\n }\n } else {\n result.visual.tailPointed =\n currentStageInfo.visual.tailPointed && prevStageInfo.visual.headPointed;\n }\n }\n if (isLastItem) {\n result.visual.headPointed = false;\n }\n return result;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifeCycleDragDropList.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleDragDropList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAIjE,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,YAAY,EACZ,cAAc,EAEd,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAA4B,MAAM,wBAAwB,CAAC;AAEtF,OAAO,KAAK,EACV,SAAS,EAET,qBAAqB,EACrB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAO3B,UAAU,0BAA0B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAC5D,SAAQ,MAAM,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC;IACpC,qCAAqC;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,+EAA+E;IAC/E,YAAY,EAAE,SAAS,CAAC;IACxB,+CAA+C;IAC/C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,kFAAkF;IAClF,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/B,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC;AAqBD,QAAA,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,4IAWvD,0BAA0B,CAAC,CAAC,CAAC,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"LifeCycleDragDropList.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleDragDropList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAIjE,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,YAAY,EACZ,cAAc,EAEd,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAA4B,MAAM,wBAAwB,CAAC;AAEtF,OAAO,KAAK,EACV,SAAS,EAET,qBAAqB,EACrB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAO3B,UAAU,0BAA0B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAC5D,SAAQ,MAAM,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC;IACpC,qCAAqC;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,+EAA+E;IAC/E,YAAY,EAAE,SAAS,CAAC;IACxB,+CAA+C;IAC/C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,kFAAkF;IAClF,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/B,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC;AAqBD,QAAA,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,4IAWvD,0BAA0B,CAAC,CAAC,CAAC,GAAG,YAAY,4CAoZ9C,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -260,7 +260,10 @@ const LifeCycleDragDropList = ({ testId, id: idProp, type, listLocation, items,
|
|
|
260
260
|
const item = newItems.splice(index, 1)[0];
|
|
261
261
|
newItems.splice(index - 1, 0, {
|
|
262
262
|
...item,
|
|
263
|
-
targetData: {
|
|
263
|
+
targetData: {
|
|
264
|
+
...itemData,
|
|
265
|
+
[normalizedType === 'task' ? 'subTask' : normalizedType]: index - 1
|
|
266
|
+
}
|
|
264
267
|
});
|
|
265
268
|
setClonedItems(newItems);
|
|
266
269
|
}
|
|
@@ -268,7 +271,10 @@ const LifeCycleDragDropList = ({ testId, id: idProp, type, listLocation, items,
|
|
|
268
271
|
const item = newItems.splice(index, 1)[0];
|
|
269
272
|
newItems.splice(index + 1, 0, {
|
|
270
273
|
...item,
|
|
271
|
-
targetData: {
|
|
274
|
+
targetData: {
|
|
275
|
+
...itemData,
|
|
276
|
+
[normalizedType === 'task' ? 'subTask' : normalizedType]: index + 1
|
|
277
|
+
}
|
|
272
278
|
});
|
|
273
279
|
setClonedItems(newItems);
|
|
274
280
|
}
|