@pega/dx-component-builder-sdk 0.25.5 → 0.242.2
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/package.json +2 -2
- package/src/tasks/authenticate/index.js +1 -1
- package/src/tasks/create/templates/Constellation/field/Boolean/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/field/Boolean/index.tsx.mustache +5 -4
- package/src/tasks/create/templates/Constellation/field/Boolean/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/field/Date/index.tsx.mustache +3 -5
- package/src/tasks/create/templates/Constellation/field/Integer/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/field/Integer/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/field/Integer/index.tsx.mustache +2 -12
- package/src/tasks/create/templates/Constellation/field/Integer/mock.ts.mustache +3 -2
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache +2 -2
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +8 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +31 -47
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +31 -38
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +4 -3
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +4 -3
- package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/index.tsx.mustache +11 -11
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +3 -2
- package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +4 -3
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +3 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +27 -21
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +19 -16
- package/src/tasks/create/templates/SDK-React/template/FORM-region/index.tsx.mustache +6 -6
- package/src/tasks/create/templates/SDK-React/template/PAGE/OneColumn.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +11 -10
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +25 -19
- package/src/tasks/create/templates/SDK-React/widget/PAGE/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +18 -10
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/operator/operator.component.ts +4 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/date-time/date-time.component.html +2 -2
- package/tests/assets/sdk-a/components/create/override-sdk/field/date-time/date-time.component.ts +9 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/percentage/percentage.component.ts +1 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/rich-text/config-ext.json +11 -0
- package/tests/assets/sdk-a/components/create/override-sdk/infra/assignment/assignment.component.ts +7 -32
- package/tests/assets/sdk-a/components/create/override-sdk/infra/flow-container/flow-container.component.html +7 -2
- package/tests/assets/sdk-a/components/create/override-sdk/infra/flow-container/flow-container.component.ts +15 -8
- package/tests/assets/sdk-a/components/create/override-sdk/infra/modal-view-container/modal-view-container.component.ts +40 -7
- package/tests/assets/sdk-a/components/create/override-sdk/template/banner-page/config-ext.json +10 -0
- package/tests/assets/sdk-a/components/create/override-sdk/template/inline-dashboard-page/config-ext.json +10 -0
- package/tests/assets/sdk-a/components/create/override-sdk/widget/quick-create/config-ext.json +10 -0
- package/tests/assets/sdk-a/components/create/override-sdk/widget/todo/todo.component.html +2 -1
- package/tests/assets/sdk-a/components/create/override-sdk/widget/todo/todo.component.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date-time/pega-dxil-my-date-time.component.html +2 -2
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date-time/pega-dxil-my-date-time.component.ts +8 -0
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/pega-dxil-my-percentage.component.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/operator/operator.component.ts +4 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/date-time/date-time.component.html +2 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/date-time/date-time.component.ts +9 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/percentage/percentage.component.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/rich-text/config-ext.json +11 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/infra/assignment/assignment.component.ts +7 -32
- package/tests/assets/sdk-a/components/createAll/override-sdk/infra/flow-container/flow-container.component.html +7 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/infra/flow-container/flow-container.component.ts +15 -8
- package/tests/assets/sdk-a/components/createAll/override-sdk/infra/modal-view-container/modal-view-container.component.ts +40 -7
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/banner-page/config-ext.json +10 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/inline-dashboard-page/config-ext.json +10 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/widget/quick-create/config-ext.json +10 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/widget/todo/todo.component.html +2 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/widget/todo/todo.component.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +1 -1
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/PConnProps.d.ts +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/create-nonce.ts +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/demo.stories.tsx +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/event-utils.ts +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/index.tsx +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/mock.ts +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/styles.ts +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/suggestions-handler.ts +0 -0
- /package/tests/assets/sdk-a/components/createAll/custom-constellation/field/{Pega_DXIL_MyRadioButtons → Pega_DXIL_MyRadiobuttons}/textformat-utils.tsx +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@material
|
|
2
|
+
import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@mui/material';
|
|
3
3
|
|
|
4
4
|
import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
|
|
8
9
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
10
|
|
|
10
11
|
// Can't use RadioButtonProps until getLocaleRuleNameFromKeys is NOT private
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { TextField } from '@material
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
3
3
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
|
|
7
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
8
9
|
|
|
9
10
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { InputAdornment, TextField } from '@material
|
|
2
|
-
import MailOutlineIcon from '@
|
|
1
|
+
import { InputAdornment, TextField } from '@mui/material';
|
|
2
|
+
import MailOutlineIcon from '@mui/icons-material/MailOutline';
|
|
3
3
|
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
5
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
|
|
6
7
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
7
8
|
|
|
8
9
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { TextField } from '@material
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
3
3
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
|
|
7
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
8
9
|
|
|
9
10
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TextField } from '@material
|
|
1
|
+
import { TextField } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
4
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
7
8
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TextField } from '@material
|
|
1
|
+
import { TextField } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
4
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
7
8
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
2
|
+
// import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
3
|
+
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
4
|
+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
4
5
|
import dayjs from 'dayjs';
|
|
5
6
|
|
|
6
7
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
8
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
|
|
8
10
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
11
|
|
|
10
12
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -58,31 +60,35 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
58
60
|
|
|
59
61
|
return (
|
|
60
62
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
keyboardIcon={<AccessTimeIcon />}
|
|
67
|
-
fullWidth
|
|
68
|
-
required={required}
|
|
63
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
64
|
+
<TimePicker
|
|
65
|
+
// keyboardIcon={<AccessTimeIcon />}
|
|
66
|
+
// fullWidth
|
|
67
|
+
|
|
69
68
|
disabled={disabled}
|
|
70
|
-
error={status === 'error'}
|
|
71
|
-
helperText={helperTextToDisplay}
|
|
72
69
|
minutesStep={5}
|
|
73
|
-
size='small'
|
|
74
70
|
label={label}
|
|
75
|
-
autoOk
|
|
76
|
-
mask='__:__ _m'
|
|
71
|
+
// autoOk
|
|
72
|
+
// mask='__:__ _m'
|
|
77
73
|
format='hh:mm a'
|
|
78
74
|
value={timeValue}
|
|
79
75
|
onChange={handleChange}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
{{! pick new delimiters for mustache }}
|
|
77
|
+
{{=<% %>=}}
|
|
78
|
+
slotProps={{
|
|
79
|
+
textField: {
|
|
80
|
+
variant: 'outlined',
|
|
81
|
+
placeholder: 'hh:mm am',
|
|
82
|
+
required,
|
|
83
|
+
error: status === 'error',
|
|
84
|
+
helperText: helperTextToDisplay,
|
|
85
|
+
size: 'small',
|
|
86
|
+
InputProps: { inputProps: { ...testProp } }
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
84
90
|
/>
|
|
85
|
-
</
|
|
91
|
+
</LocalizationProvider>
|
|
86
92
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
87
93
|
);
|
|
88
94
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
import { TextField } from '@material
|
|
4
|
+
import { TextField } from '@mui/material';
|
|
5
5
|
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
7
|
+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
8
9
|
|
|
9
10
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
10
11
|
import { pyReviewRaw } from './mock';
|
|
@@ -26,26 +27,28 @@ const renderField = resolvedProps => {
|
|
|
26
27
|
|
|
27
28
|
const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
|
|
28
29
|
let val: any = '';
|
|
30
|
+
|
|
31
|
+
{{! pick new delimiters for mustache }}
|
|
32
|
+
{{=<% %>=}}
|
|
29
33
|
if (label === 'Service Date')
|
|
30
34
|
val = (
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
variant='inline'
|
|
34
|
-
inputVariant='outlined'
|
|
35
|
-
placeholder='mm/dd/yyyy'
|
|
36
|
-
fullWidth
|
|
37
|
-
format='MM/DD/YYYY'
|
|
38
|
-
mask='__/__/____'
|
|
39
|
-
size='small'
|
|
35
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
36
|
+
<DatePicker
|
|
40
37
|
label={label}
|
|
41
|
-
|
|
38
|
+
format='MM/DD/YYYY'
|
|
39
|
+
value={value ? dayjs(value) : null}
|
|
40
|
+
slotProps={{
|
|
41
|
+
textField: {
|
|
42
|
+
variant: 'outlined',
|
|
43
|
+
placeholder: 'mm/dd/yyyy',
|
|
44
|
+
size: 'small'
|
|
45
|
+
}
|
|
46
|
+
}}
|
|
42
47
|
onChange={onChange}
|
|
43
48
|
/>
|
|
44
|
-
</
|
|
49
|
+
</LocalizationProvider>
|
|
45
50
|
);
|
|
46
51
|
|
|
47
|
-
{{! pick new delimiters for mustache }}
|
|
48
|
-
{{=<% %>=}}
|
|
49
52
|
if (label === 'Email')
|
|
50
53
|
val = (
|
|
51
54
|
<TextField
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid
|
|
3
|
-
import
|
|
2
|
+
import { Grid } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
|
|
5
5
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
6
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
@@ -35,8 +35,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: PropsWithChildren<{{COMP
|
|
|
35
35
|
// Calculate the size
|
|
36
36
|
// Default to assume the 2 columns are evenly split. However, override if templateCol
|
|
37
37
|
// (example value: "1fr 1fr")
|
|
38
|
-
let aSize
|
|
39
|
-
let bSize
|
|
38
|
+
let aSize = 6;
|
|
39
|
+
let bSize = 6;
|
|
40
40
|
|
|
41
41
|
const colAArray = templateCol
|
|
42
42
|
.replaceAll(/[a-z]+/g, '')
|
|
@@ -44,8 +44,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: PropsWithChildren<{{COMP
|
|
|
44
44
|
.map(itm => Number(itm));
|
|
45
45
|
const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
|
|
46
46
|
const ratio = 12 / totalCols;
|
|
47
|
-
aSize = (ratio * colAArray[0]) as
|
|
48
|
-
bSize = (ratio * colAArray[1]) as
|
|
47
|
+
aSize = (ratio * colAArray[0]) as number;
|
|
48
|
+
bSize = (ratio * colAArray[1]) as number;
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import Grid from '@mui/material/Grid';
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
3
|
|
|
4
4
|
interface OneColumnProps {
|
|
5
5
|
// If any, enter additional props that only exist on this component
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { withStyles,
|
|
3
|
-
import Table from '@material
|
|
4
|
-
import TableBody from '@material
|
|
5
|
-
import TableCell from '@material
|
|
6
|
-
import TableContainer from '@material
|
|
7
|
-
import TableHead from '@material
|
|
8
|
-
import TableRow from '@material
|
|
2
|
+
import { withStyles, createStyles } from '@mui/styles';
|
|
3
|
+
import Table from '@mui/material/Table';
|
|
4
|
+
import TableBody from '@mui/material/TableBody';
|
|
5
|
+
import TableCell from '@mui/material/TableCell';
|
|
6
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
7
|
+
import TableHead from '@mui/material/TableHead';
|
|
8
|
+
import TableRow from '@mui/material/TableRow';
|
|
9
9
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
10
10
|
|
|
11
11
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
12
12
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
13
|
+
|
|
13
14
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
14
15
|
|
|
15
16
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
16
17
|
// If any, enter additional props that only exist on this component
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
const StyledTableCell = withStyles((
|
|
20
|
+
const StyledTableCell = withStyles((myTheme) =>
|
|
20
21
|
createStyles({
|
|
21
22
|
head: {
|
|
22
23
|
borderWidth: '1px',
|
|
23
24
|
borderStyle: 'solid',
|
|
24
25
|
borderColor: 'silver',
|
|
25
|
-
backgroundColor:
|
|
26
|
-
color:
|
|
26
|
+
backgroundColor: myTheme.palette.text.disabled,
|
|
27
|
+
color: myTheme.palette.getContrastText(myTheme.palette.text.disabled)
|
|
27
28
|
},
|
|
28
29
|
body: {
|
|
29
30
|
borderWidth: '1px',
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Card,
|
|
3
|
-
CardContent,
|
|
4
|
-
CardHeader,
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CardContent,
|
|
4
|
+
CardHeader,
|
|
5
5
|
Typography,
|
|
6
|
-
CardActions,
|
|
6
|
+
CardActions,
|
|
7
7
|
Button,
|
|
8
8
|
TableContainer,
|
|
9
9
|
Table,
|
|
10
10
|
TableBody,
|
|
11
11
|
TableHead,
|
|
12
|
-
withStyles,
|
|
13
|
-
createStyles,
|
|
14
|
-
Theme,
|
|
15
12
|
TableCell,
|
|
16
|
-
TableRow
|
|
17
|
-
} from '@material
|
|
18
|
-
import {
|
|
13
|
+
TableRow
|
|
14
|
+
} from '@mui/material';
|
|
15
|
+
import { withStyles, createStyles } from '@mui/styles';
|
|
16
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
19
17
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
18
|
+
|
|
20
19
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
21
20
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
22
21
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
23
22
|
import { useRef, useEffect, useState } from 'react';
|
|
23
|
+
import { Theme as MuiTheme } from "@mui/material/styles";
|
|
24
|
+
|
|
25
|
+
declare module "@mui/private-theming" {
|
|
26
|
+
interface DefaultTheme extends MuiTheme {
|
|
27
|
+
spacing: (spacing: number) => string;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
24
30
|
|
|
25
31
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
26
32
|
// If any, enter additional props that only exist on this component
|
|
@@ -30,23 +36,23 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
|
30
36
|
whatsnewlink?: string;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
const useStyles = makeStyles(
|
|
39
|
+
const useStyles = makeStyles(myTheme => ({
|
|
34
40
|
root: {
|
|
35
|
-
marginTop:
|
|
36
|
-
marginBottom:
|
|
41
|
+
marginTop: myTheme.spacing(1),
|
|
42
|
+
marginBottom: myTheme.spacing(1),
|
|
37
43
|
borderLeft: '6px solid',
|
|
38
|
-
borderLeftColor:
|
|
44
|
+
borderLeftColor: myTheme.palette.primary.light
|
|
39
45
|
}
|
|
40
46
|
}));
|
|
41
47
|
|
|
42
|
-
const StyledTableCell = withStyles((
|
|
48
|
+
const StyledTableCell = withStyles((myTheme) =>
|
|
43
49
|
createStyles({
|
|
44
50
|
head: {
|
|
45
51
|
borderWidth: '1px',
|
|
46
52
|
borderStyle: 'solid',
|
|
47
53
|
borderColor: 'silver',
|
|
48
|
-
backgroundColor:
|
|
49
|
-
color:
|
|
54
|
+
backgroundColor: myTheme.palette.text.disabled,
|
|
55
|
+
color: myTheme.palette.getContrastText(myTheme.palette.text.disabled)
|
|
50
56
|
},
|
|
51
57
|
body: {
|
|
52
58
|
borderWidth: '1px',
|
|
@@ -73,7 +79,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
73
79
|
const [waitingForData, setWaitingForData] = useState<boolean>(true);
|
|
74
80
|
const thePConn = getPConnect();
|
|
75
81
|
const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
|
|
76
|
-
const dataViewName = '
|
|
82
|
+
const dataViewName = 'D_pyMyWorkList';
|
|
77
83
|
const context = thePConn.getContextName();
|
|
78
84
|
|
|
79
85
|
const rowData: any = useRef([]);
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import TextField from '@material
|
|
3
|
-
import Popover from '@material
|
|
4
|
-
import Grid from '@material
|
|
5
|
-
import Typography from '@material
|
|
6
|
-
import
|
|
2
|
+
import TextField from '@mui/material/TextField';
|
|
3
|
+
import Popover from '@mui/material/Popover';
|
|
4
|
+
import Grid from '@mui/material/Grid';
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
7
|
+
import { Theme as MuiTheme } from "@mui/material/styles";
|
|
7
8
|
|
|
8
9
|
import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
9
10
|
|
|
10
11
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
12
|
+
|
|
11
13
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
14
|
|
|
15
|
+
declare module "@mui/private-theming" {
|
|
16
|
+
interface DefaultTheme extends MuiTheme {
|
|
17
|
+
spacing: (spacing: number) => string;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
14
22
|
// If any, enter additional props that only exist on this component
|
|
15
23
|
label: string;
|
|
@@ -22,14 +30,14 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
|
22
30
|
displayLabel?: any;
|
|
23
31
|
}
|
|
24
32
|
|
|
25
|
-
const useStyles = makeStyles(
|
|
33
|
+
const useStyles = makeStyles(myTheme => ({
|
|
26
34
|
root: {
|
|
27
|
-
padding:
|
|
28
|
-
margin:
|
|
35
|
+
padding: myTheme.spacing(1),
|
|
36
|
+
margin: myTheme.spacing(1)
|
|
29
37
|
},
|
|
30
38
|
popover: {
|
|
31
|
-
padding:
|
|
32
|
-
margin:
|
|
39
|
+
padding: myTheme.spacing(1),
|
|
40
|
+
margin: myTheme.spacing(1)
|
|
33
41
|
}
|
|
34
42
|
}));
|
|
35
43
|
|
|
@@ -45,8 +45,11 @@ export class OperatorComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
|
|
48
49
|
ngOnDestroy(): void {
|
|
49
|
-
|
|
50
|
+
// Ref: https://medium.com/@kamil.galek/mythical-angular-component-styles-cleanup-in-angular-17-f799a08b2abc
|
|
51
|
+
// Commenting the below line as it is causing the Operator component's styles not getting applied.
|
|
52
|
+
// this.renderer.destroy();
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
updateSelf(): void {
|
package/tests/assets/sdk-a/components/create/override-sdk/field/date-time/date-time.component.html
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
[placeholder]="placeholder"
|
|
14
14
|
[formControl]="fieldControl"
|
|
15
15
|
(blur)="fieldOnBlur($event)"
|
|
16
|
-
(dateTimeChange)="
|
|
16
|
+
(dateTimeChange)="fieldOnDateChange($event)"
|
|
17
17
|
[value]="value$"
|
|
18
18
|
[required]="bRequired$"
|
|
19
19
|
/>
|
|
20
|
-
<mat-datepicker-toggle matSuffix [
|
|
20
|
+
<mat-datepicker-toggle matSuffix [owlDateTimeTrigger]="dtPicker"></mat-datepicker-toggle>
|
|
21
21
|
<owl-date-time #dtPicker></owl-date-time>
|
|
22
22
|
<mat-error *ngIf="fieldControl?.invalid">{{ getErrorMessage() }}</mat-error>
|
|
23
23
|
</mat-form-field>
|
package/tests/assets/sdk-a/components/create/override-sdk/field/date-time/date-time.component.ts
CHANGED
|
@@ -168,6 +168,15 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
fieldOnDateChange(event: any) {
|
|
172
|
+
// this comes from the date pop up
|
|
173
|
+
if (typeof event.value === 'object') {
|
|
174
|
+
// convert date to pega "date" format
|
|
175
|
+
event.value = event.value?.toISOString();
|
|
176
|
+
}
|
|
177
|
+
this.angularPConnectData.actions?.onChange(this, { value: event.value });
|
|
178
|
+
}
|
|
179
|
+
|
|
171
180
|
fieldOnBlur(event: any) {
|
|
172
181
|
if (typeof event.value === 'object') {
|
|
173
182
|
// convert date to pega "date" format
|
package/tests/assets/sdk-a/components/create/override-sdk/field/percentage/percentage.component.ts
CHANGED
|
@@ -177,7 +177,7 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
177
177
|
const actionsApi = this.pConn$?.getActionsApi();
|
|
178
178
|
const propName = (this.pConn$?.getStateProps() as any).value;
|
|
179
179
|
let value = event?.target?.value;
|
|
180
|
-
value = value
|
|
180
|
+
value = value ? value.replace(/%/g, '') : '';
|
|
181
181
|
if (this.currSep === ',') {
|
|
182
182
|
value = value.replace(/,/g, '');
|
|
183
183
|
} else {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"componentKey": "RichText",
|
|
3
|
+
"name": "RichText",
|
|
4
|
+
"label": "Rich text editor",
|
|
5
|
+
"description": "Text (paragraph)",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Text-Paragraph",
|
|
8
|
+
"icon": "images/pz-text-area-active.svg",
|
|
9
|
+
"properties": [],
|
|
10
|
+
"defaultConfig": {}
|
|
11
|
+
}
|
package/tests/assets/sdk-a/components/create/override-sdk/infra/assignment/assignment.component.ts
CHANGED
|
@@ -38,7 +38,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
38
38
|
newPConn$: any;
|
|
39
39
|
containerName$: string;
|
|
40
40
|
|
|
41
|
-
bIsRefComponent = false;
|
|
42
41
|
bInitialized = false;
|
|
43
42
|
|
|
44
43
|
templateName$: string;
|
|
@@ -129,45 +128,19 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
updateChanges() {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.ngZone.run(() => {
|
|
135
|
-
// pConn$ may be a 'reference' component, so normalize it
|
|
136
|
-
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
137
|
-
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
138
|
-
|
|
139
|
-
// If 'reference' so we need to get the children of the normalized pConn
|
|
140
|
-
if (this.bIsRefComponent) {
|
|
141
|
-
// this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
142
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
this.createButtons();
|
|
147
|
-
}
|
|
131
|
+
// pConn$ may be a 'reference' component, so normalize it
|
|
132
|
+
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
148
133
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (thePConn && thePConn.getComponentName() == 'reference') {
|
|
152
|
-
bReturn = true;
|
|
134
|
+
if (this.arChildren$) {
|
|
135
|
+
this.createButtons();
|
|
153
136
|
}
|
|
154
|
-
|
|
155
|
-
return bReturn;
|
|
156
137
|
}
|
|
157
138
|
|
|
158
139
|
initComponent() {
|
|
159
|
-
this.bIsRefComponent = this.checkIfRefComponent(this.pConn$);
|
|
160
|
-
|
|
161
140
|
// pConn$ may be a 'reference' component, so normalize it
|
|
162
141
|
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
163
142
|
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
164
143
|
|
|
165
|
-
// If 'reference' so we need to get the children of the normalized pConn
|
|
166
|
-
if (this.bIsRefComponent) {
|
|
167
|
-
// this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
168
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
|
|
169
|
-
}
|
|
170
|
-
|
|
171
144
|
// prevent re-intializing with flowContainer update unless an action is taken
|
|
172
145
|
this.bReInit = false;
|
|
173
146
|
this.bHasNavigation$ = false;
|
|
@@ -210,7 +183,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
210
183
|
this.approveCase = actionsAPI.approveCase?.bind(actionsAPI);
|
|
211
184
|
this.rejectCase = actionsAPI.rejectCase?.bind(actionsAPI);
|
|
212
185
|
|
|
213
|
-
this.
|
|
186
|
+
if (this.arChildren$) {
|
|
187
|
+
this.createButtons();
|
|
188
|
+
}
|
|
214
189
|
}
|
|
215
190
|
|
|
216
191
|
createButtons() {
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div *ngIf="todo_showTodo$">
|
|
10
10
|
<component-mapper
|
|
11
|
+
*ngIf="pConnectOfActiveContainerItem"
|
|
11
12
|
name="Todo"
|
|
12
13
|
[props]="{
|
|
13
|
-
pConn$:
|
|
14
|
+
pConn$: pConnectOfActiveContainerItem,
|
|
14
15
|
caseInfoID$: todo_caseInfoID$,
|
|
15
16
|
datasource$: todo_datasource$,
|
|
16
17
|
showTodoList$: todo_showTodoList$,
|
|
@@ -22,7 +23,11 @@
|
|
|
22
23
|
></component-mapper>
|
|
23
24
|
</div>
|
|
24
25
|
<div *ngIf="!todo_showTodo$">
|
|
25
|
-
<component-mapper
|
|
26
|
+
<component-mapper
|
|
27
|
+
*ngIf="pConnectOfActiveContainerItem"
|
|
28
|
+
name="Assignment"
|
|
29
|
+
[props]="{ pConn$: pConnectOfActiveContainerItem, formGroup$, arChildren$, itemKey$ }"
|
|
30
|
+
></component-mapper>
|
|
26
31
|
</div>
|
|
27
32
|
</div>
|
|
28
33
|
<div *ngIf="bHasCaseMessages$">
|