@pega/custom-dx-components 26.1.10-alpha-0.6 → 26.1.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "26.1.10-alpha-0.6",
3
+ "version": "26.1.10",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "keywords": [
@@ -26,7 +26,7 @@ export default function GetNextWork(props: {{COMPONENT_CLASS_NAME}}WorkProps) {
26
26
  getPConnect()
27
27
  .getActionsApi()
28
28
  .getNextWork()
29
- .catch((err) => {
29
+ .catch((err: any) => {
30
30
  console.log(err);
31
31
  if (err[0].status === 404) {
32
32
  toasterCtx.push({
@@ -110,7 +110,7 @@
110
110
  "@babel/preset-typescript": "^7.27.1",
111
111
  "@pega/configs": "^0.16.3",
112
112
  "@pega/custom-dx-components": "~26.1.10",
113
- "@pega/pcore-pconnect-typedefs": "^4.1.0",
113
+ "@pega/pcore-pconnect-typedefs": "^5.1.0",
114
114
  "@storybook/addon-docs": "^9.1.7",
115
115
  "@storybook/addon-essentials": "^9.0.0-alpha.12",
116
116
  "@storybook/addon-links": "^9.1.7",
@@ -0,0 +1,5 @@
1
+ import type { PCore as PCoreClass } from '@pega/pcore-pconnect-typedefs';
2
+
3
+ declare global {
4
+ const PCore: PCoreClass;
5
+ }
@@ -26,7 +26,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
26
26
  getPConnect()
27
27
  .getActionsApi()
28
28
  .getNextWork()
29
- .catch((err) => {
29
+ .catch((err: any) => {
30
30
  console.log(err);
31
31
  if (err[0].status === 404) {
32
32
  toasterCtx.push({
@@ -0,0 +1,45 @@
1
+ import { PConnect } from '@pega/pcore-pconnect-typedefs';
2
+
3
+ // PConnProps.d.ts
4
+ // This gives us a place to have each component (which is most DX Components) that is
5
+ // expected to have a getPConnect extend its props (from BaseProps)
6
+ // such that every component will be expected to have a getPConnect() function
7
+ // that returns a PConnect object. (new/better way of doing .propTypes).
8
+ // This PConnProps can be extended to include other props that we know are in every component
9
+ export interface PConnProps {
10
+ // getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
11
+ getPConnect: () => typeof PConnect;
12
+
13
+ // Allow any/all other key/value pairs in the BaseProps for now
14
+ // TODO: refine which other props are always expected for various component
15
+ // types and consider further interface "subclassing". For example, we may
16
+ // want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
17
+ // and any other props that every Form component expects.
18
+ // For example, see the PConnFieldProps below.
19
+ // NOTE: if you uncomment the line below, the PConnProps type will allow
20
+ // otherwise undefined types to appear. This can be helpful for debugging
21
+ // or when adding new components whose types aren't yet known.
22
+ // [key: string]: any;
23
+ }
24
+
25
+ // PConnFieldProps extends PConnProps to bring in the common properties that are
26
+ // associated with most field components (ex: Dropdown, TextInput, etc.) in the
27
+ // components/field directory
28
+ export interface PConnFieldProps extends PConnProps {
29
+ label: string;
30
+ required: boolean;
31
+ disabled: boolean;
32
+ value: any;
33
+ validatemessage: string;
34
+ status?: string;
35
+ onChange?: any;
36
+ onBlur?: any;
37
+ readOnly: boolean;
38
+ testId: string;
39
+ helperText: string;
40
+ displayMode?: string;
41
+ hideLabel: boolean;
42
+ placeholder?: string;
43
+ fieldMetadata?: any;
44
+ additionalProps?: any;
45
+ }
@@ -0,0 +1,5 @@
1
+ // @ts-ignore
2
+ if (window?.__webpack_nonce__) {
3
+ // @ts-ignore
4
+ __webpack_nonce__ = window.__webpack_nonce__;
5
+ }
@@ -0,0 +1,9 @@
1
+ export const suggestionsHandler = (accepted: boolean, pConn: any, setStatus: any) => {
2
+ if (accepted) {
3
+ pConn.acceptSuggestion();
4
+ setStatus('success');
5
+ } else {
6
+ pConn.ignoreSuggestion();
7
+ setStatus(undefined);
8
+ }
9
+ };
@@ -26,7 +26,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
26
26
  getPConnect()
27
27
  .getActionsApi()
28
28
  .getNextWork()
29
- .catch((err) => {
29
+ .catch((err: any) => {
30
30
  console.log(err);
31
31
  if (err[0].status === 404) {
32
32
  toasterCtx.push({
@@ -0,0 +1,45 @@
1
+ import { PConnect } from '@pega/pcore-pconnect-typedefs';
2
+
3
+ // PConnProps.d.ts
4
+ // This gives us a place to have each component (which is most DX Components) that is
5
+ // expected to have a getPConnect extend its props (from BaseProps)
6
+ // such that every component will be expected to have a getPConnect() function
7
+ // that returns a PConnect object. (new/better way of doing .propTypes).
8
+ // This PConnProps can be extended to include other props that we know are in every component
9
+ export interface PConnProps {
10
+ // getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
11
+ getPConnect: () => typeof PConnect;
12
+
13
+ // Allow any/all other key/value pairs in the BaseProps for now
14
+ // TODO: refine which other props are always expected for various component
15
+ // types and consider further interface "subclassing". For example, we may
16
+ // want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
17
+ // and any other props that every Form component expects.
18
+ // For example, see the PConnFieldProps below.
19
+ // NOTE: if you uncomment the line below, the PConnProps type will allow
20
+ // otherwise undefined types to appear. This can be helpful for debugging
21
+ // or when adding new components whose types aren't yet known.
22
+ // [key: string]: any;
23
+ }
24
+
25
+ // PConnFieldProps extends PConnProps to bring in the common properties that are
26
+ // associated with most field components (ex: Dropdown, TextInput, etc.) in the
27
+ // components/field directory
28
+ export interface PConnFieldProps extends PConnProps {
29
+ label: string;
30
+ required: boolean;
31
+ disabled: boolean;
32
+ value: any;
33
+ validatemessage: string;
34
+ status?: string;
35
+ onChange?: any;
36
+ onBlur?: any;
37
+ readOnly: boolean;
38
+ testId: string;
39
+ helperText: string;
40
+ displayMode?: string;
41
+ hideLabel: boolean;
42
+ placeholder?: string;
43
+ fieldMetadata?: any;
44
+ additionalProps?: any;
45
+ }
@@ -0,0 +1,5 @@
1
+ // @ts-ignore
2
+ if (window?.__webpack_nonce__) {
3
+ // @ts-ignore
4
+ __webpack_nonce__ = window.__webpack_nonce__;
5
+ }
@@ -0,0 +1,9 @@
1
+ export const suggestionsHandler = (accepted: boolean, pConn: any, setStatus: any) => {
2
+ if (accepted) {
3
+ pConn.acceptSuggestion();
4
+ setStatus('success');
5
+ } else {
6
+ pConn.ignoreSuggestion();
7
+ setStatus(undefined);
8
+ }
9
+ };
@@ -26,7 +26,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
26
26
  getPConnect()
27
27
  .getActionsApi()
28
28
  .getNextWork()
29
- .catch((err) => {
29
+ .catch((err: any) => {
30
30
  console.log(err);
31
31
  if (err[0].status === 404) {
32
32
  toasterCtx.push({
@@ -0,0 +1,45 @@
1
+ import { PConnect } from '@pega/pcore-pconnect-typedefs';
2
+
3
+ // PConnProps.d.ts
4
+ // This gives us a place to have each component (which is most DX Components) that is
5
+ // expected to have a getPConnect extend its props (from BaseProps)
6
+ // such that every component will be expected to have a getPConnect() function
7
+ // that returns a PConnect object. (new/better way of doing .propTypes).
8
+ // This PConnProps can be extended to include other props that we know are in every component
9
+ export interface PConnProps {
10
+ // getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
11
+ getPConnect: () => typeof PConnect;
12
+
13
+ // Allow any/all other key/value pairs in the BaseProps for now
14
+ // TODO: refine which other props are always expected for various component
15
+ // types and consider further interface "subclassing". For example, we may
16
+ // want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
17
+ // and any other props that every Form component expects.
18
+ // For example, see the PConnFieldProps below.
19
+ // NOTE: if you uncomment the line below, the PConnProps type will allow
20
+ // otherwise undefined types to appear. This can be helpful for debugging
21
+ // or when adding new components whose types aren't yet known.
22
+ // [key: string]: any;
23
+ }
24
+
25
+ // PConnFieldProps extends PConnProps to bring in the common properties that are
26
+ // associated with most field components (ex: Dropdown, TextInput, etc.) in the
27
+ // components/field directory
28
+ export interface PConnFieldProps extends PConnProps {
29
+ label: string;
30
+ required: boolean;
31
+ disabled: boolean;
32
+ value: any;
33
+ validatemessage: string;
34
+ status?: string;
35
+ onChange?: any;
36
+ onBlur?: any;
37
+ readOnly: boolean;
38
+ testId: string;
39
+ helperText: string;
40
+ displayMode?: string;
41
+ hideLabel: boolean;
42
+ placeholder?: string;
43
+ fieldMetadata?: any;
44
+ additionalProps?: any;
45
+ }
@@ -0,0 +1,5 @@
1
+ // @ts-ignore
2
+ if (window?.__webpack_nonce__) {
3
+ // @ts-ignore
4
+ __webpack_nonce__ = window.__webpack_nonce__;
5
+ }
@@ -0,0 +1,9 @@
1
+ export const suggestionsHandler = (accepted: boolean, pConn: any, setStatus: any) => {
2
+ if (accepted) {
3
+ pConn.acceptSuggestion();
4
+ setStatus('success');
5
+ } else {
6
+ pConn.ignoreSuggestion();
7
+ setStatus(undefined);
8
+ }
9
+ };