@pega/dx-component-builder-sdk 0.242.1 → 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 +1 -1
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +22 -18
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -3
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +4 -0
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +19 -16
- /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
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
3
|
+
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
4
|
+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
3
5
|
import dayjs, { Dayjs } from 'dayjs';
|
|
4
6
|
|
|
5
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
@@ -78,27 +80,29 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
78
80
|
|
|
79
81
|
return (
|
|
80
82
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
84
|
+
<DatePicker
|
|
85
|
+
label={label}
|
|
86
|
+
disabled={disabled}
|
|
87
|
+
format={dateFormatInfo.dateFormatString}
|
|
88
|
+
value={dateValue}
|
|
86
89
|
{{! pick new delimiters for mustache }}
|
|
87
90
|
{{=<% %>=}}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
slotProps={{
|
|
92
|
+
textField: {
|
|
93
|
+
required,
|
|
94
|
+
variant: 'outlined',
|
|
95
|
+
placeholder: dateFormatInfo.dateFormatStringLC,
|
|
96
|
+
error: status === 'error',
|
|
97
|
+
helperText: helperTextToDisplay,
|
|
98
|
+
size: 'small',
|
|
99
|
+
InputProps: { ...testProp }
|
|
100
|
+
}
|
|
101
|
+
}}
|
|
99
102
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
onChange={handleChange}
|
|
104
|
+
/>
|
|
105
|
+
</LocalizationProvider>
|
|
102
106
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
103
107
|
);
|
|
104
108
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
|
|
3
|
+
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
4
|
+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
3
5
|
import dayjs, { Dayjs } from 'dayjs';
|
|
4
6
|
|
|
5
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
@@ -8,7 +10,6 @@ import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-compon
|
|
|
8
10
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
11
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
12
|
|
|
11
|
-
|
|
12
13
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
13
14
|
|
|
14
15
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
@@ -72,7 +73,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
72
73
|
|
|
73
74
|
return (
|
|
74
75
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
75
|
-
<
|
|
76
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
77
|
+
<DateTimePicker
|
|
76
78
|
// fullWidth
|
|
77
79
|
// autoOk
|
|
78
80
|
disabled={disabled}
|
|
@@ -96,7 +98,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
96
98
|
}
|
|
97
99
|
}}
|
|
98
100
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
99
|
-
|
|
101
|
+
/>
|
|
102
|
+
</LocalizationProvider>
|
|
100
103
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
101
104
|
);
|
|
102
105
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
2
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';
|
|
3
5
|
import dayjs from 'dayjs';
|
|
4
6
|
|
|
5
7
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -58,6 +60,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
58
60
|
|
|
59
61
|
return (
|
|
60
62
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
63
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
61
64
|
<TimePicker
|
|
62
65
|
// keyboardIcon={<AccessTimeIcon />}
|
|
63
66
|
// fullWidth
|
|
@@ -85,6 +88,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
85
88
|
}}
|
|
86
89
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
87
90
|
/>
|
|
91
|
+
</LocalizationProvider>
|
|
88
92
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
89
93
|
);
|
|
90
94
|
}
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|