@pega/custom-dx-components 0.242.18 → 0.242.20
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/README.md +1 -1
- package/package.json +2 -2
- package/src/constants.js +2 -1
- package/src/tasks/build-lib/index.js +52 -58
- package/src/tasks/bundle/builder/index.js +26 -19
- package/src/tasks/bundle/index.js +3 -2
- package/src/tasks/create/templates/Constellation/Field/Boolean/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Date/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +15 -15
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +23 -24
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +15 -17
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -0
- package/src/tasks/delete/helper.js +19 -3
- package/src/tasks/init/template/package.json.mustache +7 -6
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +5 -3
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +5 -3
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +5 -3
package/README.md
CHANGED
|
@@ -18,4 +18,4 @@ Ensure you have access to the following in your system:
|
|
|
18
18
|
|
|
19
19
|
## Latest Documentation
|
|
20
20
|
|
|
21
|
-
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/whats-new-constellation-dx-
|
|
21
|
+
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/whats-new-constellation-dx-component-builder.html)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/custom-dx-components",
|
|
3
|
-
"version": "0.242.
|
|
3
|
+
"version": "0.242.20",
|
|
4
4
|
"description": "Utility for building custom UI components",
|
|
5
5
|
"bin": "./bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
20
20
|
"@babel/preset-react": "^7.23.3",
|
|
21
21
|
"@pega/auth": "^0.1.6",
|
|
22
|
-
"@pega/constellation-dx-components-build-utils": "^1.0.1-dev-0.
|
|
22
|
+
"@pega/constellation-dx-components-build-utils": "^1.0.1-dev-0.16",
|
|
23
23
|
"ajv": "^8.12.0",
|
|
24
24
|
"ajv-keywords": "^5.1.0",
|
|
25
25
|
"archiver": "^7.0.1",
|
package/src/constants.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import inquirer from 'inquirer';
|
|
2
|
-
import { Listr } from 'listr2';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
1
|
import path from 'path';
|
|
5
2
|
import fs from 'fs';
|
|
6
3
|
|
|
4
|
+
import inquirer from 'inquirer';
|
|
5
|
+
import { Listr } from 'listr2';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { buildLib } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
7
8
|
|
|
8
9
|
import validate from '../validator/index.js';
|
|
9
10
|
import { lintComponent } from '../linter/index.js';
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
getComponentDirectoryPath,
|
|
13
|
+
showVersion,
|
|
14
|
+
getComponents,
|
|
15
|
+
getLibraryBased,
|
|
16
|
+
getC11NB2STokenAndStaticServer,
|
|
17
|
+
updateComponentDefaultVersion
|
|
18
|
+
} from '../../util.js';
|
|
19
|
+
import bundleComponent from '../bundle/index.js';
|
|
11
20
|
|
|
12
21
|
import { getBuildComponentQuestions, getOrgLib } from './helper.js';
|
|
13
|
-
import { buildLib } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
14
22
|
|
|
15
23
|
const isLibraryBased = await getLibraryBased();
|
|
16
24
|
|
|
17
25
|
export const updateConfigVersion = async (componentKey, buildVersion) => {
|
|
18
26
|
const componentDirectory = await getComponentDirectoryPath(componentKey);
|
|
19
|
-
|
|
27
|
+
const configFileName = 'config.json';
|
|
20
28
|
|
|
21
29
|
const configFile = path.join(componentDirectory, configFileName);
|
|
22
30
|
let configData;
|
|
23
31
|
try {
|
|
24
32
|
configData = fs.readFileSync(path.resolve(configFile), 'utf8');
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
|
|
33
|
+
} catch (err) {
|
|
28
34
|
// for now, if now file just end
|
|
29
|
-
console.log(`${chalk.bold.yellow(
|
|
35
|
+
console.log(`${chalk.bold.yellow(`Config file not available for: ${componentKey}`)}`);
|
|
30
36
|
return;
|
|
31
|
-
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
let data;
|
|
35
40
|
try {
|
|
36
41
|
data = JSON.parse(configData);
|
|
37
|
-
}
|
|
38
|
-
catch (er) {
|
|
42
|
+
} catch (er) {
|
|
39
43
|
throw new Error(`Invalid schema json in config.json: ${er}`);
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
data.version = buildVersion;
|
|
43
47
|
|
|
44
48
|
// write back file
|
|
45
|
-
fs.writeFileSync(configFile, JSON.stringify(data, null, 4),
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export function getCustomTasks(componentKey, devBuild, buildVersion, options) {
|
|
49
|
+
fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8' });
|
|
50
|
+
};
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
export function getCustomTasks(componentKey, devBuild, buildVersion) {
|
|
52
53
|
return new Listr(
|
|
53
54
|
[
|
|
54
55
|
{
|
|
@@ -57,7 +58,7 @@ export function getCustomTasks(componentKey, devBuild, buildVersion, options) {
|
|
|
57
58
|
await updateConfigVersion(componentKey, buildVersion);
|
|
58
59
|
await validate(componentKey);
|
|
59
60
|
},
|
|
60
|
-
skip: () =>
|
|
61
|
+
skip: () => componentKey === 'shared'
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
title: 'Lint component',
|
|
@@ -67,32 +68,25 @@ export function getCustomTasks(componentKey, devBuild, buildVersion, options) {
|
|
|
67
68
|
await lintComponent(targetDirectory);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
|
|
71
71
|
],
|
|
72
72
|
{ concurrent: false, exitOnError: true }
|
|
73
73
|
);
|
|
74
|
-
|
|
75
|
-
|
|
76
74
|
}
|
|
77
75
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export default async (options) => {
|
|
76
|
+
export default async options => {
|
|
82
77
|
if (!isLibraryBased) {
|
|
83
|
-
console.log(`Command only supported for ${chalk.bold.green('library based')} components.`)
|
|
78
|
+
console.log(`Command only supported for ${chalk.bold.green('library based')} components.`);
|
|
84
79
|
process.exit();
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
showVersion();
|
|
88
83
|
|
|
89
|
-
|
|
90
84
|
const components = await getComponents();
|
|
91
85
|
|
|
92
86
|
const compDef = await getOrgLib();
|
|
93
87
|
const organization = compDef.organization;
|
|
94
88
|
const library = compDef.library;
|
|
95
|
-
const currentOrgLib = organization.concat(
|
|
89
|
+
const currentOrgLib = organization.concat('_').concat(library);
|
|
96
90
|
|
|
97
91
|
let version;
|
|
98
92
|
let devBuild;
|
|
@@ -100,65 +94,65 @@ export default async (options) => {
|
|
|
100
94
|
if (options.params.length >= 5) {
|
|
101
95
|
version = options.params[3];
|
|
102
96
|
const dBuild = options.params[4];
|
|
103
|
-
devBuild = (dBuild === 'Y' ||
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
dBuild === 'true') ? true : false;
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
|
|
111
|
-
console.log(`\nLibrary ${chalk.bold.green(currentOrgLib)} `)
|
|
97
|
+
devBuild = !!(dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true');
|
|
98
|
+
} else {
|
|
99
|
+
console.log(`\nLibrary ${chalk.bold.green(currentOrgLib)} `);
|
|
112
100
|
const questions = await getBuildComponentQuestions(compDef.version);
|
|
113
101
|
const answers = await inquirer.prompt(questions);
|
|
114
102
|
({ version, devBuild } = answers);
|
|
115
103
|
}
|
|
116
104
|
|
|
117
|
-
|
|
118
105
|
const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
|
|
119
106
|
|
|
120
107
|
if (tokenAndStaticServer.C11NB2S === undefined) {
|
|
121
|
-
console.log(
|
|
108
|
+
console.log(
|
|
109
|
+
chalk.redBright(
|
|
110
|
+
'Need to authenticate, missing services token.\nBuilding a library requires authentication to acquire a token to build.'
|
|
111
|
+
)
|
|
112
|
+
);
|
|
122
113
|
process.exit(1);
|
|
123
|
-
|
|
124
114
|
}
|
|
125
115
|
|
|
126
|
-
const buildLibName = organization.concat(
|
|
116
|
+
const buildLibName = organization.concat('_').concat(library);
|
|
127
117
|
|
|
128
118
|
await updateComponentDefaultVersion(version);
|
|
129
119
|
|
|
130
|
-
const buildVersion = devBuild && version.indexOf(
|
|
120
|
+
const buildVersion = devBuild && version.indexOf('-dev') < 0 ? version.concat('-dev') : version;
|
|
131
121
|
|
|
132
122
|
for await (const componentKey of components) {
|
|
133
123
|
console.log(chalk.bold.green(`Building ${componentKey}`));
|
|
134
124
|
|
|
135
|
-
|
|
125
|
+
// eslint-disable-next-line sonarjs/no-extra-arguments
|
|
126
|
+
const myCustomTasks = getCustomTasks(componentKey, devBuild, buildVersion, options);
|
|
136
127
|
|
|
137
128
|
try {
|
|
138
129
|
await myCustomTasks.run();
|
|
139
|
-
}
|
|
140
|
-
catch (err) {
|
|
130
|
+
} catch (err) {
|
|
141
131
|
console.log(chalk.bold.red(err.toString()));
|
|
142
132
|
process.exit(1);
|
|
143
133
|
}
|
|
144
|
-
|
|
145
|
-
console.log(""); // line break
|
|
146
|
-
|
|
134
|
+
console.log(''); // line break
|
|
147
135
|
}
|
|
148
136
|
|
|
149
|
-
|
|
137
|
+
// bundling the first component will actually compile all. We should
|
|
138
|
+
// compile to see if any errors, as buildLib doesn't catch all errors.
|
|
139
|
+
// Turning off stats (last param), so won't show warnings, as
|
|
140
|
+
// warnings are part of buildLib
|
|
141
|
+
console.log(chalk.green.bold('Compile check...'));
|
|
142
|
+
await bundleComponent(components[0], null, devBuild, false);
|
|
143
|
+
console.log('');
|
|
150
144
|
|
|
151
|
-
|
|
152
|
-
try {
|
|
153
|
-
// await deleteLocalLibrary(currentOrgLib);
|
|
154
|
-
}
|
|
155
|
-
catch (ex) {}
|
|
145
|
+
console.log(chalk.green.bold('Building Library... '));
|
|
156
146
|
|
|
157
147
|
// call constellation-dx-components-build-utils build library, which will create a directory of the "buildLibName"
|
|
158
148
|
// with subdirectories for each version.
|
|
159
149
|
// If "buildDev", we append to version "-dev". Currently, only "-dev" versions, when published, can be deleted.
|
|
160
|
-
buildLib(
|
|
161
|
-
|
|
150
|
+
buildLib(
|
|
151
|
+
buildLibName,
|
|
152
|
+
buildVersion,
|
|
153
|
+
tokenAndStaticServer.C11NB2S,
|
|
154
|
+
tokenAndStaticServer.appStaticContentServer
|
|
155
|
+
);
|
|
162
156
|
|
|
163
157
|
return true;
|
|
164
158
|
};
|
|
@@ -47,7 +47,7 @@ const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
|
|
|
47
47
|
let compilationErrors = null;
|
|
48
48
|
|
|
49
49
|
// Create the build and print the deployment instructions.
|
|
50
|
-
function build(config, previousFileSizes) {
|
|
50
|
+
function build(config, previousFileSizes, showStats = true) {
|
|
51
51
|
console.log(`Creating a ${Env} build...`);
|
|
52
52
|
|
|
53
53
|
|
|
@@ -72,7 +72,10 @@ function build(config, previousFileSizes) {
|
|
|
72
72
|
//store and print elsewhere
|
|
73
73
|
compilationErrors = stats.compilation.errors;
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
if (showStats) {
|
|
76
|
+
console.log("stats:" + stats);
|
|
77
|
+
}
|
|
78
|
+
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
}
|
|
@@ -137,7 +140,8 @@ export default ({
|
|
|
137
140
|
externals,
|
|
138
141
|
globals,
|
|
139
142
|
sourceMap,
|
|
140
|
-
devBuild
|
|
143
|
+
devBuild,
|
|
144
|
+
showStats
|
|
141
145
|
}) => {
|
|
142
146
|
// Generate configuration
|
|
143
147
|
const config = configFactory(Env, {
|
|
@@ -161,28 +165,31 @@ export default ({
|
|
|
161
165
|
// if you're in it, you don't end up in Trash
|
|
162
166
|
fs.emptyDirSync(paths.appBuild);
|
|
163
167
|
// Start the webpack build
|
|
164
|
-
return build(config, previousFileSizes);
|
|
168
|
+
return build(config, previousFileSizes, showStats);
|
|
165
169
|
})
|
|
166
170
|
.then(
|
|
167
171
|
({ stats, previousFileSizes, warnings }) => {
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
if (showStats) {
|
|
173
|
+
if (warnings.length) {
|
|
174
|
+
//console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
|
|
175
|
+
console.log(chalk.yellow('Compiled with warnings.\n'));
|
|
176
|
+
for (let warning in warnings) {
|
|
177
|
+
console.log(chalk.yellow("Warning.."), warnings[warning].message);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
console.log(chalk.green('Compiled successfully.\n'));
|
|
173
181
|
}
|
|
174
|
-
|
|
175
|
-
console.log(
|
|
182
|
+
|
|
183
|
+
console.log('File sizes after gzip:\n');
|
|
184
|
+
printFileSizesAfterBuild(
|
|
185
|
+
stats,
|
|
186
|
+
previousFileSizes,
|
|
187
|
+
paths.appBuild,
|
|
188
|
+
WARN_AFTER_BUNDLE_GZIP_SIZE,
|
|
189
|
+
WARN_AFTER_CHUNK_GZIP_SIZE
|
|
190
|
+
);
|
|
176
191
|
}
|
|
177
192
|
|
|
178
|
-
console.log('File sizes after gzip:\n');
|
|
179
|
-
printFileSizesAfterBuild(
|
|
180
|
-
stats,
|
|
181
|
-
previousFileSizes,
|
|
182
|
-
paths.appBuild,
|
|
183
|
-
WARN_AFTER_BUNDLE_GZIP_SIZE,
|
|
184
|
-
WARN_AFTER_CHUNK_GZIP_SIZE
|
|
185
|
-
);
|
|
186
193
|
resolve('done emitting');
|
|
187
194
|
},
|
|
188
195
|
err => {
|
|
@@ -9,7 +9,7 @@ import buildComponent from './builder/index.js';
|
|
|
9
9
|
|
|
10
10
|
const extensions = ['ts', 'tsx', 'js', 'jsx'];
|
|
11
11
|
|
|
12
|
-
const bundleComponent = async (componentKey, sourceMap, devBuild) => {
|
|
12
|
+
const bundleComponent = async (componentKey, sourceMap, devBuild, showStats = true) => {
|
|
13
13
|
const componentDirectory = await getComponentDirectoryPath(componentKey);
|
|
14
14
|
|
|
15
15
|
const idx = (
|
|
@@ -58,7 +58,8 @@ const bundleComponent = async (componentKey, sourceMap, devBuild) => {
|
|
|
58
58
|
externals,
|
|
59
59
|
globals,
|
|
60
60
|
sourceMap,
|
|
61
|
-
devBuild
|
|
61
|
+
devBuild,
|
|
62
|
+
showStats
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
65
|
|
|
@@ -3,6 +3,7 @@ import { DateInput, FieldValueList, DateTimeDisplay, Text, withConfiguration } f
|
|
|
3
3
|
import FormattedText from "./FormattedText";
|
|
4
4
|
|
|
5
5
|
import type { PConnFieldProps } from './PConnProps';
|
|
6
|
+
import './create-nonce';
|
|
6
7
|
|
|
7
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
8
9
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { DateTimeInput, FieldValueList, DateTimeDisplay, Text, withConfiguration } from "@pega/cosmos-react-core";
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
// includes in bundle
|
|
6
7
|
import DateTimeFormatter from "./date-time";
|
|
@@ -2,6 +2,7 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { NumberInput, NumberDisplay, CurrencyDisplay, FieldValueList, Text, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
|
|
4
4
|
import type { PConnFieldProps } from './PConnProps';
|
|
5
|
+
import './create-nonce';
|
|
5
6
|
|
|
6
7
|
// includes in bundle
|
|
7
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache
CHANGED
|
@@ -35,23 +35,23 @@ const statelistData = {
|
|
|
35
35
|
]
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
window.PCore.getDataPageUtils = () => {
|
|
39
|
-
return {
|
|
40
|
-
getData: () => {
|
|
41
|
-
return new Promise(resolve => {
|
|
42
|
-
resolve(statelistData);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
getDataAsync: () => {
|
|
46
|
-
return new Promise(resolve => {
|
|
47
|
-
resolve(statelistData);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
|
|
53
38
|
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
54
39
|
|
|
40
|
+
window.PCore.getDataPageUtils = () => {
|
|
41
|
+
return {
|
|
42
|
+
getData: () => {
|
|
43
|
+
return new Promise(resolve => {
|
|
44
|
+
resolve(statelistData);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
getDataAsync: () => {
|
|
48
|
+
return new Promise(resolve => {
|
|
49
|
+
resolve(statelistData);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
55
|
const props = {
|
|
56
56
|
countryCode: configProps.countryCode,
|
|
57
57
|
getPConnect: () => {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
URLDisplay
|
|
11
11
|
} from '@pega/cosmos-react-core';
|
|
12
12
|
import type { PConnFieldProps } from './PConnProps';
|
|
13
|
+
import './create-nonce';
|
|
13
14
|
|
|
14
15
|
// IMPORTANT
|
|
15
16
|
// To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
|
|
@@ -3,6 +3,7 @@ import { useState, useEffect, useRef, type Key } from 'react';
|
|
|
3
3
|
import { Select, Option, FieldValueList, Text, withConfiguration } from '@pega/cosmos-react-core';
|
|
4
4
|
|
|
5
5
|
import type { PConnFieldProps } from './PConnProps';
|
|
6
|
+
import './create-nonce';
|
|
6
7
|
|
|
7
8
|
// includes in bundle
|
|
8
9
|
import handleEvent from "./event-utils";
|
package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache
CHANGED
|
@@ -4,6 +4,7 @@ import { useEffect, useRef, useState, useMemo, type MutableRefObject, type SetSt
|
|
|
4
4
|
import { ComboBox, menuHelpers, debounce, throttle, Button, Icon, withConfiguration, type MenuGroupProps, type MenuItemProps } from '@pega/cosmos-react-core';
|
|
5
5
|
import get from 'lodash.get';
|
|
6
6
|
import type { PConnFieldProps } from './PConnProps';
|
|
7
|
+
import './create-nonce';
|
|
7
8
|
|
|
8
9
|
// includes in bundle
|
|
9
10
|
import handleEvent from "./event-utils";
|
package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { RadioButton, RadioButtonGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
4
4
|
import type { PConnFieldProps } from './PConnProps';
|
|
5
|
+
import './create-nonce';
|
|
5
6
|
|
|
6
7
|
// includes in bundle
|
|
7
8
|
import { formatExists, textFormatter } from './textformat-utils';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Input, EmailDisplay, FieldValueList, Text, URLDisplay, PhoneDisplay, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
// includes in bundle
|
|
6
7
|
import { suggestionsHandler } from './suggestions-handler';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { Input, FieldValueList, Text, EmailDisplay, PhoneDisplay, URLDisplay, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
// include in bundle
|
|
6
7
|
import handleEvent from "./event-utils";
|
|
@@ -2,6 +2,7 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { TextArea as CosmosTextArea, FieldValueList, ParagraphDisplay, Text, EmailDisplay, PhoneDisplay, URLDisplay, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
|
|
4
4
|
import type { PConnFieldProps } from './PConnProps';
|
|
5
|
+
import './create-nonce';
|
|
5
6
|
|
|
6
7
|
// includes in bundle
|
|
7
8
|
import { suggestionsHandler } from './suggestions-handler';
|