@pega/custom-dx-components 2.0.8 → 2.0.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.
Files changed (144) hide show
  1. package/package.json +1 -1
  2. package/src/constants.js +29 -7
  3. package/src/tasks/create/index.js +46 -6
  4. package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +38 -0
  5. package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +26 -0
  6. package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +145 -0
  7. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +44 -0
  8. package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.js.mustache +18 -0
  9. package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +171 -0
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +7 -0
  11. package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +195 -0
  12. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +327 -0
  13. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +44 -0
  14. package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +254 -0
  15. package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +7 -0
  16. package/src/tasks/create/templates/Constellation/Field/Date/suggestions-handler.js +10 -0
  17. package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +256 -0
  18. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +93 -0
  19. package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js +286 -0
  20. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +327 -0
  21. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +44 -0
  22. package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +252 -0
  23. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +7 -0
  24. package/src/tasks/create/templates/Constellation/Field/DateTime/suggestions-handler.js +10 -0
  25. package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +278 -0
  26. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +44 -0
  27. package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.js.mustache +18 -0
  28. package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +272 -0
  29. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +7 -0
  30. package/src/tasks/create/templates/Constellation/Field/Decimal/suggestions-handler.js +10 -0
  31. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +291 -0
  32. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +44 -0
  33. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.js.mustache +18 -0
  34. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +300 -0
  35. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +7 -0
  36. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/suggestions-handler.js +10 -0
  37. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +93 -0
  38. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +44 -0
  39. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.js.mustache +18 -0
  40. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +275 -0
  41. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +7 -0
  42. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/suggestions-handler.js +10 -0
  43. package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +347 -0
  44. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +44 -0
  45. package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.js.mustache +18 -0
  46. package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +335 -0
  47. package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +7 -0
  48. package/src/tasks/create/templates/Constellation/Field/Integer/suggestions-handler.js +10 -0
  49. package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +114 -0
  50. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +44 -0
  51. package/src/tasks/create/templates/Constellation/Field/Picklist/event-utils.js.mustache +18 -0
  52. package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +308 -0
  53. package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
  54. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +7 -0
  55. package/src/tasks/create/templates/Constellation/Field/Picklist/suggestions-handler.js +10 -0
  56. package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +62 -0
  57. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +44 -0
  58. package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +60 -0
  59. package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +7 -0
  60. package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +111 -0
  61. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +44 -0
  62. package/src/tasks/create/templates/Constellation/Field/Text-Email/event-utils.js.mustache +18 -0
  63. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +189 -0
  64. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +7 -0
  65. package/src/tasks/create/templates/Constellation/Field/Text-Email/suggestions-handler.js +10 -0
  66. package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
  67. package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.js +27 -0
  68. package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +111 -0
  69. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +44 -0
  70. package/src/tasks/create/templates/Constellation/Field/Text-Input/event-utils.js.mustache +18 -0
  71. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +196 -0
  72. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +7 -0
  73. package/src/tasks/create/templates/Constellation/Field/Text-Input/suggestions-handler.js +10 -0
  74. package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
  75. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +111 -0
  76. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +44 -0
  77. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/event-utils.js.mustache +18 -0
  78. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +189 -0
  79. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +7 -0
  80. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/suggestions-handler.js +10 -0
  81. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
  82. package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +123 -0
  83. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +44 -0
  84. package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.js.mustache +18 -0
  85. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +223 -0
  86. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +7 -0
  87. package/src/tasks/create/templates/Constellation/Field/Text-Phone/suggestions-handler.js +10 -0
  88. package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
  89. package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +237 -0
  90. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +44 -0
  91. package/src/tasks/create/templates/Constellation/Field/Text-URL/event-utils.js.mustache +18 -0
  92. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +232 -0
  93. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +7 -0
  94. package/src/tasks/create/templates/Constellation/Field/Text-URL/suggestions-handler.js +10 -0
  95. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.js.mustache +172 -0
  96. package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +185 -0
  97. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +44 -0
  98. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.jsx.mustache +213 -0
  99. package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.js.mustache +7 -0
  100. package/src/tasks/create/templates/Constellation/Field/TimeofDay/suggestions-handler.js +10 -0
  101. package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +286 -0
  102. package/src/tasks/create/templates/Constellation/Template/DETAILS/OneColumnDetails.svg +22 -0
  103. package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +35 -0
  104. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +101 -0
  105. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +7 -0
  106. package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +226 -0
  107. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
  108. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +42 -0
  109. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +101 -0
  110. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +7 -0
  111. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +226 -0
  112. package/src/tasks/create/templates/Constellation/Template/FORM/DefaultForm.svg +29 -0
  113. package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +45 -0
  114. package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +49 -0
  115. package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +7 -0
  116. package/src/tasks/create/templates/Constellation/Template/FORM-region/TwoColumn.svg +38 -0
  117. package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +27 -0
  118. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +43 -0
  119. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +7 -0
  120. package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.js.mustache +29 -0
  121. package/src/tasks/create/templates/Constellation/Template/PAGE/OneColumnPage.svg +36 -0
  122. package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +32 -0
  123. package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +68 -0
  124. package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -0
  125. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +7 -0
  126. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +226 -0
  127. package/src/tasks/create/templates/Constellation/Widget/CASE/OneColumnPage.svg +36 -0
  128. package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +23 -0
  129. package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +75 -0
  130. package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +7 -0
  131. package/src/tasks/create/templates/Constellation/Widget/PAGE/OneColumnPage.svg +36 -0
  132. package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +59 -0
  133. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +48 -0
  134. package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +7 -0
  135. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.js.mustache +73 -0
  136. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
  137. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.js.mustache +239 -0
  138. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +66 -0
  139. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +110 -0
  140. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +7 -0
  141. package/src/tasks/init/template/package.json.mustache +6 -1
  142. package/src/tasks/publish/bundle/builder/index.js +49 -5
  143. package/src/tasks/publish/bundle/builder/webpack.config.js +7 -3
  144. package/src/tasks/validator/index.js +107 -8
@@ -36,13 +36,40 @@ const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
36
36
  const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
37
37
  const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
38
38
 
39
+ let compilationErrors = null;
40
+
39
41
  // Create the build and print the deployment instructions.
40
42
  function build(config, previousFileSizes) {
41
43
  console.log(`Creating a ${Env} build...`);
42
44
 
45
+
46
+
43
47
  const compiler = webpack(config);
44
48
  return new Promise((resolve, reject) => {
45
49
  compiler.run((err, stats) => {
50
+
51
+ if (err != null && typeof (err) == "object") {
52
+ if (err.error != undefined) {
53
+ //store and print elsewhere
54
+ compilationErrors = err.error;
55
+ //console.log("err:" + err);
56
+ }
57
+ }
58
+ if (stats != null & typeof(stats) == "object") {
59
+ if (stats.errors != undefined) {
60
+ console.log("stats:" + stats);
61
+ }
62
+ else if (stats.compilation != undefined && stats.compilation.errors != undefined) {
63
+
64
+ //store and print elsewhere
65
+ compilationErrors = stats.compilation.errors;
66
+
67
+ console.log("stats:" + stats);
68
+ }
69
+
70
+ }
71
+
72
+
46
73
  let messages;
47
74
  if (err) {
48
75
  if (!err.message) {
@@ -131,7 +158,11 @@ export default ({
131
158
  .then(
132
159
  ({ stats, previousFileSizes, warnings }) => {
133
160
  if (warnings.length) {
134
- console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
161
+ //console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
162
+ console.log(chalk.yellow('Compiled with warnings.\n'));
163
+ for (let warning in warnings) {
164
+ console.log(chalk.yellow("Warning.."), warnings[warning].message);
165
+ }
135
166
  } else {
136
167
  console.log(chalk.green('Compiled successfully.\n'));
137
168
  }
@@ -146,7 +177,7 @@ export default ({
146
177
  );
147
178
  resolve('done emitting');
148
179
  },
149
- err => {
180
+ err => {
150
181
  reject();
151
182
  const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
152
183
  if (tscCompileOnError) {
@@ -156,11 +187,24 @@ export default ({
156
187
  )
157
188
  );
158
189
  printBuildError(err);
159
- } else {
160
- console.log(chalk.red('Failed to compile.\n'));
161
- printBuildError(err);
190
+ }
191
+ else if (compilationErrors != null) {
192
+ if (compilationErrors.length == undefined) {
193
+ console.log(chalk.red("Error..."), compilationErrors.message);
194
+ }
195
+ else {
196
+ for (let error in compilationErrors) {
197
+ console.log(chalk.red("Error..."), compilationErrors[error].message);
198
+ }
199
+ }
200
+
162
201
  process.exit(1);
163
202
  }
203
+ else {
204
+ console.log(chalk.red('Failed to compile.\n'));
205
+ printBuildError(JSON.stringify(err));
206
+
207
+ }
164
208
  }
165
209
  )
166
210
  .catch(err => {
@@ -103,13 +103,13 @@ export default (
103
103
  return loaders;
104
104
  };
105
105
  return {
106
- mode: isEnvDevelopment ? 'development' : 'production',
106
+ mode: devBuild ? 'development' : 'production',
107
107
  // Stop compilation early in production
108
108
  bail: isEnvProduction,
109
109
  // These are the "entry points" to our application.
110
110
  // This means they will be the "root" imports that are included in JS bundle.
111
111
  entry: inputFile,
112
- devtool: shouldUseSourceMap ? 'source-map' : false,
112
+ devtool: devBuild ? 'eval-cheap-module-source-map' : false,
113
113
  output: {
114
114
  // The build folder.
115
115
  path: paths.appBuild,
@@ -306,22 +306,26 @@ export default (
306
306
  contextRegExp: /moment$/
307
307
  }),
308
308
  /* Ignore cosmos icons */
309
+ /*
309
310
  new webpack.IgnorePlugin({
310
311
  resourceRegExp: /^\.\/icons$/,
311
312
  contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
312
313
  }),
314
+ */
313
315
  /* Ignore cosmos icons - windows */
316
+ /*
314
317
  new webpack.IgnorePlugin({
315
318
  resourceRegExp: /^\.\/icons$/,
316
319
  contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
317
320
  }),
321
+ */
318
322
  new webpack.optimize.LimitChunkCountPlugin({
319
323
  maxChunks: 5
320
324
  }),
321
325
  new webpack.optimize.MinChunkSizePlugin({
322
326
  minChunkSize: 100000 // Minimum number of characters
323
327
  }),
324
- isEnvProduction && new CompressionPlugin(compressionBRConfObj)
328
+ !devBuild && new CompressionPlugin(compressionBRConfObj)
325
329
 
326
330
  /* Dont generate gzip file */
327
331
  /* isEnvProduction && new CompressionPlugin(compressionGZConfObj) */
@@ -43,19 +43,118 @@ const schema = {
43
43
  type: 'array',
44
44
  uniqueItems: true,
45
45
  items: {
46
- type: 'object',
47
- properties: {
48
- name: { type: 'string' },
49
- label: { type: 'string' },
50
- format: { type: 'string' }
51
- },
52
- required: ['name', 'label', 'format']
46
+ anyOf: [
47
+ {
48
+ type: 'object',
49
+ properties: {
50
+ name: { type: 'string' },
51
+ label: { type: 'string' },
52
+ format: { type: 'string' }
53
+ },
54
+ required: ['name', 'label', 'format']
55
+ },
56
+ {
57
+ type: 'object',
58
+ properties: {
59
+ format: { type: 'string' },
60
+ source: {
61
+ type: 'object',
62
+ properties: {
63
+ name: { type: 'string' },
64
+ label: { type: 'string' },
65
+ format: { type: 'string' }
66
+ },
67
+ required: ['name', 'label', 'format']
68
+ },
69
+ cascadeElements: {
70
+ type: 'array',
71
+ uniqueItems: true,
72
+ items: {
73
+ anyOf: [
74
+ {
75
+ type: 'object',
76
+ properties: {
77
+ key: { type: 'string'},
78
+ name: { type: 'string' },
79
+ label: { type: 'string' },
80
+ format: { type: 'string' }
81
+ },
82
+ required: ['key','name', 'label', 'format']
83
+ }
84
+ ]
85
+ }
86
+ },
87
+ },
88
+ required: ['format']
89
+ },
90
+ {
91
+ type: 'object',
92
+ properties: {
93
+ label: { type: 'string' },
94
+ format: { type: 'string' },
95
+ properties: {
96
+ type: 'array',
97
+ uniqueItems: true,
98
+ items: {
99
+ anyOf: [
100
+ {
101
+ type: 'object',
102
+ properties: {
103
+ name: { type: 'string' },
104
+ label: { type: 'string' },
105
+ format: { type: 'string' }
106
+ },
107
+ required: ['name', 'label', 'format']
108
+ },
109
+ {
110
+ type: 'object',
111
+ properties: {
112
+ variant: { type: 'string' },
113
+ label: { type: 'string' },
114
+ format: { type: 'string' }
115
+ },
116
+ required: ['variant', 'label', 'format']
117
+ },
118
+ {
119
+ type: 'object',
120
+ properties: {
121
+ format: { type: 'string' },
122
+ elements: {
123
+ type: 'array',
124
+ uniqueItems: true,
125
+ items: {
126
+ anyOf: [
127
+ {
128
+ type: 'object',
129
+ properties: {
130
+ key: { type: 'string' },
131
+ name: { type: 'string' },
132
+ label: { type: 'string' },
133
+ format: { type: 'string' },
134
+ variant: { type: 'string' }
135
+ },
136
+ required: ['key', 'format', 'label']
137
+ }
138
+ ]
139
+ }
140
+ }
141
+ },
142
+ required: ['format', 'elements']
143
+ },
144
+ ]
145
+ }
146
+ }
147
+
148
+ },
149
+ required: ['label', 'format'],
150
+ }
151
+ ]
53
152
  }
54
153
  },
55
154
  defaultConfig: { type: 'object' }
56
155
  },
57
156
  required: ['componentKey', 'name', 'description', 'type', 'subtype', 'properties'],
58
- additionalProperties: false
157
+ additionalProperties: true
59
158
  };
60
159
 
61
160
  const validateSchema = ajv.compile(schema);