@pega/custom-dx-components 2.0.19 → 2.0.21

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": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -175,15 +175,15 @@ const validateCompile = async (
175
175
  export default async options => {
176
176
  showVersion();
177
177
 
178
- if (options.params[10]) {
179
- const componentName = options.params[3];
180
- const componentLabel = options.params[4];
181
- const library = options.params[5];
182
- const version = options.params[6];
183
- const framework = options.params[7];
184
- const type = options.params[8];
185
- const subtype = options.params[9];
186
- const description = options.params[10];
178
+ if (options.params[9]) {
179
+
180
+ const type = options.params[3];
181
+ const subtype = options.params[4];
182
+ const componentName = options.params[5];
183
+ const componentLabel = options.params[6];
184
+ const library = options.params[7];
185
+ const version = options.params[9];
186
+ const description = options.params[9];
187
187
 
188
188
  await validateCompile(
189
189
  {
@@ -201,6 +201,50 @@ export default async options => {
201
201
  } else {
202
202
  const componentDefaults = await getComponentDefaults();
203
203
  const questions = [
204
+ {
205
+ name: 'type',
206
+ type: 'rawlist',
207
+ message: 'Enter type of component',
208
+ default: componentDefaults.type,
209
+ choices: COMPONENT_SCHEMA.type
210
+ },
211
+ {
212
+ name: 'subtype',
213
+ type: 'rawlist',
214
+ message: 'Enter subtype of component',
215
+ default: componentDefaults.subtype,
216
+ choices: COMPONENT_SCHEMA.subtype.field,
217
+ when(answers) {
218
+ return answers.type === 'Field';
219
+ }
220
+ },
221
+ {
222
+ name: 'subtype',
223
+ type: 'rawlist',
224
+ message: 'Enter subtype of component',
225
+ default: componentDefaults.subtype,
226
+ choices: COMPONENT_SCHEMA.subtype.template,
227
+ when(answers) {
228
+ return answers.type === 'Template';
229
+ }
230
+ },
231
+ {
232
+ name: 'subtype',
233
+ type: 'rawlist',
234
+ message: 'Enter subtype of component',
235
+ default: [componentDefaults.subtype || COMPONENT_SCHEMA.subtype.widget[0]],
236
+ choices: COMPONENT_SCHEMA.subtype.widget,
237
+ when(answers) {
238
+ return answers.type === 'Widget';
239
+ },
240
+ validate: value => {
241
+ /* value should not be empty */
242
+ if (Array.isArray(value) && value.length) {
243
+ return true;
244
+ }
245
+ return 'Please select subtype';
246
+ }
247
+ },
204
248
  {
205
249
  name: 'componentName',
206
250
  message: 'Enter component name (required)',
@@ -258,57 +302,6 @@ export default async options => {
258
302
  message: 'Please enter the application names to be supported (comma-separated). ',
259
303
  suffix: 'Keep empty for all applications'
260
304
  },
261
- // {
262
- // name: 'framework',
263
- // type: 'rawlist',
264
- // message: 'Enter framework a',
265
- // default: 'COSMOS_React',
266
- // choices: COMPONENT_SCHEMA.framework
267
- // },
268
- {
269
- name: 'type',
270
- type: 'rawlist',
271
- message: 'Enter type of component',
272
- default: componentDefaults.type,
273
- choices: COMPONENT_SCHEMA.type
274
- },
275
- {
276
- name: 'subtype',
277
- type: 'rawlist',
278
- message: 'Enter subtype of component',
279
- default: componentDefaults.subtype,
280
- choices: COMPONENT_SCHEMA.subtype.field,
281
- when(answers) {
282
- return answers.type === 'Field';
283
- }
284
- },
285
- {
286
- name: 'subtype',
287
- type: 'rawlist',
288
- message: 'Enter subtype of component',
289
- default: componentDefaults.subtype,
290
- choices: COMPONENT_SCHEMA.subtype.template,
291
- when(answers) {
292
- return answers.type === 'Template';
293
- }
294
- },
295
- {
296
- name: 'subtype',
297
- type: 'rawlist',
298
- message: 'Enter subtype of component',
299
- default: [componentDefaults.subtype || COMPONENT_SCHEMA.subtype.widget[0]],
300
- choices: COMPONENT_SCHEMA.subtype.widget,
301
- when(answers) {
302
- return answers.type === 'Widget';
303
- },
304
- validate: value => {
305
- /* value should not be empty */
306
- if (Array.isArray(value) && value.length) {
307
- return true;
308
- }
309
- return 'Please select subtype';
310
- }
311
- },
312
305
  {
313
306
  name: 'description',
314
307
  message: 'Enter description for the component',
@@ -3,7 +3,7 @@ import { Input, FieldValueList, Text } from "@pega/cosmos-react-core";
3
3
  import PropTypes from "prop-types";
4
4
 
5
5
  // includes in bundle
6
- import {formatExists,textFormatter, urlFormatter, suggestionHandler} from "./text-url";
6
+ import {formatExists,textFormatter, urlFormatter} from "./text-url.jsx";
7
7
  import handleEvent from "./event-utils";
8
8
  import { suggestionsHandler } from './suggestions-handler';
9
9
 
@@ -1,4 +1,5 @@
1
- import {EmailDisplay, PhoneDisplay, URLDisplay } from "@pega/cosmos-react-core";
1
+ import { useState, useRef, React} from "react";
2
+ import { EmailDisplay, PhoneDisplay, URLDisplay, Image, Button, Lightbox } from '@pega/cosmos-react-core';
2
3
 
3
4
  export const formatExists = (formatterVal) => {
4
5
  const formatterValues = [
@@ -140,7 +140,7 @@ export default async options => {
140
140
  '\n',
141
141
  `Inside that directory, you can run several commands:`,
142
142
  '\n\n',
143
- `${chalk.blueBright('npm start')}`,
143
+ `${chalk.blueBright('npm run start-storybook')}`,
144
144
  `\n Start Storybook in development mode`,
145
145
  '\n\n',
146
146
  `${chalk.blueBright('npm run create')}`,
@@ -158,7 +158,7 @@ export default async options => {
158
158
  '\n\n',
159
159
  `${chalk.blueBright('cd')} ${chalk.bold(projectName)}`,
160
160
  '\n',
161
- `${chalk.blueBright('npm start')}`,
161
+ `${chalk.blueBright('npm run start-storybook')}`,
162
162
  '\n'
163
163
  );
164
164
  return true;
@@ -5,7 +5,7 @@
5
5
  "organization": "{{organization}}",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
8
- "start": "start-storybook --port 6040 --quiet",
8
+ "start-storybook": "start-storybook --port 6040 --quiet",
9
9
  "build": "tsc -b tsconfig.build.json",
10
10
  "lint": "run-p -cl lint:*",
11
11
  "fix": "run-p -cl fix:*",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@pega/configs": "^0.3.4",
57
- "@pega/custom-dx-components": "^2.0.19",
57
+ "@pega/custom-dx-components": "^2.0.21",
58
58
  "@pega/eslint-config": "^0.3.2",
59
59
  "@storybook/addon-actions": "^6.5.12",
60
60
  "@storybook/addon-essentials": "^6.5.12",