@formio/js 5.4.1 → 5.4.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.
Files changed (215) hide show
  1. package/README.md +11 -5
  2. package/dist/formio.builder.css +1 -0
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.embed.js +1 -1
  5. package/dist/formio.embed.min.js +1 -1
  6. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.form.css +1 -0
  8. package/dist/formio.form.js +131 -109
  9. package/dist/formio.form.min.css +1 -1
  10. package/dist/formio.form.min.js +1 -1
  11. package/dist/formio.form.min.js.LICENSE.txt +2 -2
  12. package/dist/formio.full.css +1 -0
  13. package/dist/formio.full.js +155 -133
  14. package/dist/formio.full.min.css +1 -1
  15. package/dist/formio.full.min.js +1 -1
  16. package/dist/formio.full.min.js.LICENSE.txt +2 -2
  17. package/dist/formio.js +26 -26
  18. package/dist/formio.min.js +1 -1
  19. package/dist/formio.min.js.LICENSE.txt +2 -2
  20. package/dist/formio.utils.js +19 -19
  21. package/dist/formio.utils.min.js +1 -1
  22. package/dist/formio.utils.min.js.LICENSE.txt +2 -2
  23. package/lib/cjs/Embed.js +8 -16
  24. package/lib/cjs/Form.js +4 -4
  25. package/lib/cjs/Formio.js +2 -9
  26. package/lib/cjs/InlineEmbed.js +1 -4
  27. package/lib/cjs/PDF.js +28 -8
  28. package/lib/cjs/PDFBuilder.js +6 -10
  29. package/lib/cjs/Webform.d.ts +1 -0
  30. package/lib/cjs/Webform.js +19 -34
  31. package/lib/cjs/WebformBuilder.js +27 -68
  32. package/lib/cjs/Wizard.d.ts +1 -0
  33. package/lib/cjs/Wizard.js +44 -31
  34. package/lib/cjs/WizardBuilder.js +5 -15
  35. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +2 -6
  36. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -9
  37. package/lib/cjs/addons/index.js +1 -3
  38. package/lib/cjs/components/_classes/component/Component.d.ts +5 -5
  39. package/lib/cjs/components/_classes/component/Component.js +60 -132
  40. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +2 -4
  41. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +4 -16
  42. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +1 -4
  43. package/lib/cjs/components/_classes/field/Field.js +1 -4
  44. package/lib/cjs/components/_classes/input/Input.js +2 -2
  45. package/lib/cjs/components/_classes/list/ListComponent.js +4 -4
  46. package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +6 -28
  47. package/lib/cjs/components/_classes/multivalue/Multivalue.js +8 -26
  48. package/lib/cjs/components/_classes/nested/NestedComponent.js +1 -4
  49. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +5 -9
  50. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -3
  51. package/lib/cjs/components/address/Address.js +10 -30
  52. package/lib/cjs/components/address/editForm/Address.edit.provider.js +8 -32
  53. package/lib/cjs/components/alert/Alert.js +3 -6
  54. package/lib/cjs/components/button/Button.js +10 -17
  55. package/lib/cjs/components/button/editForm/Button.edit.display.js +8 -32
  56. package/lib/cjs/components/checkbox/Checkbox.js +4 -10
  57. package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +2 -8
  58. package/lib/cjs/components/columns/Columns.js +5 -17
  59. package/lib/cjs/components/container/Container.js +1 -3
  60. package/lib/cjs/components/currency/Currency.js +2 -7
  61. package/lib/cjs/components/datagrid/DataGrid.js +23 -63
  62. package/lib/cjs/components/datamap/DataMap.js +4 -16
  63. package/lib/cjs/components/datetime/DateTime.js +2 -6
  64. package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +1 -4
  65. package/lib/cjs/components/day/Day.js +12 -70
  66. package/lib/cjs/components/day/editForm/Day.edit.day.js +1 -3
  67. package/lib/cjs/components/day/editForm/Day.edit.month.js +1 -3
  68. package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -0
  69. package/lib/cjs/components/editgrid/EditGrid.js +18 -44
  70. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -4
  71. package/lib/cjs/components/file/File.js +40 -70
  72. package/lib/cjs/components/file/editForm/File.edit.display.js +1 -5
  73. package/lib/cjs/components/file/editForm/File.edit.file.js +8 -30
  74. package/lib/cjs/components/form/Form.js +5 -7
  75. package/lib/cjs/components/html/HTML.js +1 -5
  76. package/lib/cjs/components/number/Number.js +2 -4
  77. package/lib/cjs/components/panel/editForm/Panel.edit.display.js +3 -12
  78. package/lib/cjs/components/password/Password.js +1 -4
  79. package/lib/cjs/components/radio/Radio.js +7 -17
  80. package/lib/cjs/components/radio/editForm/Radio.edit.data.js +4 -14
  81. package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -6
  82. package/lib/cjs/components/select/Select.js +48 -92
  83. package/lib/cjs/components/select/editForm/Select.edit.data.js +37 -182
  84. package/lib/cjs/components/select/editForm/Select.edit.validation.js +1 -9
  85. package/lib/cjs/components/selectboxes/SelectBoxes.js +3 -6
  86. package/lib/cjs/components/signature/Signature.d.ts +1 -1
  87. package/lib/cjs/components/signature/Signature.js +5 -10
  88. package/lib/cjs/components/signature/editForm/Signature.edit.display.js +2 -6
  89. package/lib/cjs/components/survey/Survey.js +6 -17
  90. package/lib/cjs/components/survey/editForm/Survey.edit.data.js +4 -12
  91. package/lib/cjs/components/table/editForm/Table.edit.display.js +3 -3
  92. package/lib/cjs/components/tabs/Tabs.js +4 -19
  93. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +1 -3
  94. package/lib/cjs/components/tags/Tags.js +4 -14
  95. package/lib/cjs/components/textarea/TextArea.js +8 -15
  96. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +14 -56
  97. package/lib/cjs/components/textfield/TextField.js +4 -4
  98. package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +2 -8
  99. package/lib/cjs/components/time/Time.js +1 -4
  100. package/lib/cjs/components/time/editForm/Time.edit.display.js +1 -4
  101. package/lib/cjs/formio.form.js +5 -5
  102. package/lib/cjs/package.json +1 -1
  103. package/lib/cjs/providers/address/AddressProvider.js +1 -1
  104. package/lib/cjs/providers/address/GoogleAddressProvider.js +1 -3
  105. package/lib/cjs/providers/processor/fileProcessor.js +1 -3
  106. package/lib/cjs/providers/storage/azure.js +5 -6
  107. package/lib/cjs/providers/storage/indexeddb.js +5 -15
  108. package/lib/cjs/providers/storage/s3.js +3 -14
  109. package/lib/cjs/providers/storage/xhr.js +19 -28
  110. package/lib/cjs/templates/Templates.js +1 -0
  111. package/lib/cjs/translations/en.d.ts +237 -82
  112. package/lib/cjs/translations/en.js +9 -82
  113. package/lib/cjs/utils/ChoicesWrapper.js +1 -1
  114. package/lib/cjs/utils/builder.js +5 -26
  115. package/lib/cjs/utils/i18n.d.ts +5 -2
  116. package/lib/cjs/utils/i18n.js +33 -12
  117. package/lib/cjs/utils/utils.js +37 -47
  118. package/lib/cjs/widgets/CalendarWidget.js +2 -6
  119. package/lib/mjs/Embed.js +8 -16
  120. package/lib/mjs/Form.js +4 -4
  121. package/lib/mjs/Formio.js +2 -9
  122. package/lib/mjs/InlineEmbed.js +1 -4
  123. package/lib/mjs/PDF.js +27 -8
  124. package/lib/mjs/PDFBuilder.js +6 -10
  125. package/lib/mjs/Webform.d.ts +1 -0
  126. package/lib/mjs/Webform.js +19 -31
  127. package/lib/mjs/WebformBuilder.js +27 -68
  128. package/lib/mjs/Wizard.d.ts +1 -0
  129. package/lib/mjs/Wizard.js +39 -27
  130. package/lib/mjs/WizardBuilder.js +5 -15
  131. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +2 -6
  132. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -9
  133. package/lib/mjs/addons/index.js +1 -3
  134. package/lib/mjs/components/_classes/component/Component.d.ts +5 -5
  135. package/lib/mjs/components/_classes/component/Component.js +59 -132
  136. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +2 -4
  137. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +4 -16
  138. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -4
  139. package/lib/mjs/components/_classes/field/Field.js +1 -4
  140. package/lib/mjs/components/_classes/input/Input.js +2 -2
  141. package/lib/mjs/components/_classes/list/ListComponent.js +4 -4
  142. package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +6 -28
  143. package/lib/mjs/components/_classes/multivalue/Multivalue.js +8 -26
  144. package/lib/mjs/components/_classes/nested/NestedComponent.js +1 -4
  145. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +5 -9
  146. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -3
  147. package/lib/mjs/components/address/Address.js +10 -30
  148. package/lib/mjs/components/address/editForm/Address.edit.provider.js +8 -32
  149. package/lib/mjs/components/alert/Alert.js +3 -6
  150. package/lib/mjs/components/button/Button.js +9 -16
  151. package/lib/mjs/components/button/editForm/Button.edit.display.js +8 -32
  152. package/lib/mjs/components/checkbox/Checkbox.js +4 -10
  153. package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +2 -8
  154. package/lib/mjs/components/columns/Columns.js +5 -17
  155. package/lib/mjs/components/container/Container.js +1 -3
  156. package/lib/mjs/components/currency/Currency.js +2 -7
  157. package/lib/mjs/components/datagrid/DataGrid.js +23 -63
  158. package/lib/mjs/components/datamap/DataMap.js +12 -18
  159. package/lib/mjs/components/datetime/DateTime.js +2 -6
  160. package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +1 -4
  161. package/lib/mjs/components/day/Day.js +12 -70
  162. package/lib/mjs/components/day/editForm/Day.edit.day.js +1 -3
  163. package/lib/mjs/components/day/editForm/Day.edit.month.js +1 -3
  164. package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -0
  165. package/lib/mjs/components/editgrid/EditGrid.js +18 -44
  166. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -4
  167. package/lib/mjs/components/file/File.js +40 -70
  168. package/lib/mjs/components/file/editForm/File.edit.display.js +1 -5
  169. package/lib/mjs/components/file/editForm/File.edit.file.js +8 -30
  170. package/lib/mjs/components/form/Form.js +5 -7
  171. package/lib/mjs/components/html/HTML.js +1 -5
  172. package/lib/mjs/components/number/Number.js +2 -4
  173. package/lib/mjs/components/panel/editForm/Panel.edit.display.js +3 -12
  174. package/lib/mjs/components/password/Password.js +1 -4
  175. package/lib/mjs/components/radio/Radio.js +7 -17
  176. package/lib/mjs/components/radio/editForm/Radio.edit.data.js +4 -14
  177. package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -6
  178. package/lib/mjs/components/select/Select.js +51 -95
  179. package/lib/mjs/components/select/editForm/Select.edit.data.js +37 -182
  180. package/lib/mjs/components/select/editForm/Select.edit.validation.js +1 -9
  181. package/lib/mjs/components/selectboxes/SelectBoxes.js +3 -6
  182. package/lib/mjs/components/signature/Signature.d.ts +1 -1
  183. package/lib/mjs/components/signature/Signature.js +5 -10
  184. package/lib/mjs/components/signature/editForm/Signature.edit.display.js +2 -6
  185. package/lib/mjs/components/survey/Survey.js +6 -17
  186. package/lib/mjs/components/survey/editForm/Survey.edit.data.js +4 -12
  187. package/lib/mjs/components/table/editForm/Table.edit.display.js +3 -3
  188. package/lib/mjs/components/tabs/Tabs.js +4 -19
  189. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +1 -3
  190. package/lib/mjs/components/tags/Tags.js +4 -14
  191. package/lib/mjs/components/textarea/TextArea.js +8 -15
  192. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +14 -56
  193. package/lib/mjs/components/textfield/TextField.js +4 -4
  194. package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +2 -8
  195. package/lib/mjs/components/time/Time.js +1 -4
  196. package/lib/mjs/components/time/editForm/Time.edit.display.js +1 -4
  197. package/lib/mjs/formio.form.js +6 -6
  198. package/lib/mjs/package.json +1 -1
  199. package/lib/mjs/providers/address/AddressProvider.js +1 -1
  200. package/lib/mjs/providers/address/GoogleAddressProvider.js +1 -3
  201. package/lib/mjs/providers/processor/fileProcessor.js +1 -3
  202. package/lib/mjs/providers/storage/azure.js +5 -6
  203. package/lib/mjs/providers/storage/indexeddb.js +5 -15
  204. package/lib/mjs/providers/storage/s3.js +3 -14
  205. package/lib/mjs/providers/storage/xhr.js +19 -32
  206. package/lib/mjs/templates/Templates.js +1 -0
  207. package/lib/mjs/translations/en.d.ts +237 -82
  208. package/lib/mjs/translations/en.js +88 -0
  209. package/lib/mjs/utils/ChoicesWrapper.js +1 -1
  210. package/lib/mjs/utils/builder.js +5 -26
  211. package/lib/mjs/utils/i18n.d.ts +5 -2
  212. package/lib/mjs/utils/i18n.js +33 -12
  213. package/lib/mjs/utils/utils.js +37 -47
  214. package/lib/mjs/widgets/CalendarWidget.js +2 -6
  215. package/package.json +6 -4
@@ -37,9 +37,7 @@ if (htmlCanvasElement && !htmlCanvasElement.prototype.toBlob) {
37
37
  for (var i = 0; i < len; i++) {
38
38
  arr[i] = binStr.charCodeAt(i);
39
39
  }
40
- callback(new Blob([
41
- arr,
42
- ], { type: type || 'image/png' }));
40
+ callback(new Blob([arr], { type: type || 'image/png' }));
43
41
  });
44
42
  },
45
43
  });
@@ -74,16 +72,11 @@ class FileComponent extends Field_1.default {
74
72
  return FileComponent.conditionOperatorsSettings;
75
73
  }
76
74
  static get conditionOperatorsSettings() {
77
- return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [
78
- 'isEmpty',
79
- 'isNotEmpty',
80
- ] });
75
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
81
76
  }
82
77
  static savedValueTypes(schema) {
83
78
  schema = schema || {};
84
- return ((0, utils_1.getComponentSavedTypes)(schema) || [
85
- utils_1.componentValueTypes.object,
86
- ]);
79
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
87
80
  }
88
81
  init() {
89
82
  super.init();
@@ -219,7 +212,7 @@ class FileComponent extends Field_1.default {
219
212
  this.videoStream = stream;
220
213
  const { videoPlayer } = this.refs;
221
214
  if (!videoPlayer) {
222
- console.warn('Video player not found in template.');
215
+ console.warn(this.t('videoPlayerNotFound'));
223
216
  this.cameraMode = false;
224
217
  this.redraw();
225
218
  return;
@@ -244,16 +237,14 @@ class FileComponent extends Field_1.default {
244
237
  takePicture() {
245
238
  const { videoPlayer } = this.refs;
246
239
  if (!videoPlayer) {
247
- console.warn('Video player not found in template.');
240
+ console.warn(this.t('videoPlayerNotFound'));
248
241
  this.cameraMode = false;
249
242
  this.redraw();
250
243
  return;
251
244
  }
252
245
  this.getFrame(videoPlayer).then((frame) => {
253
246
  frame.name = `photo-${Date.now()}.png`;
254
- this.handleFilesToUpload([
255
- frame,
256
- ]);
247
+ this.handleFilesToUpload([frame]);
257
248
  this.cameraMode = false;
258
249
  this.redraw();
259
250
  });
@@ -428,13 +419,9 @@ class FileComponent extends Field_1.default {
428
419
  fileEntry.file((file) => {
429
420
  const reader = new FileReader();
430
421
  reader.onloadend = (evt) => {
431
- const blob = new Blob([
432
- new Uint8Array(evt.target.result),
433
- ], { type: file.type });
422
+ const blob = new Blob([new Uint8Array(evt.target.result)], { type: file.type });
434
423
  blob.name = file.name;
435
- this.handleFilesToUpload([
436
- blob,
437
- ]);
424
+ this.handleFilesToUpload([blob]);
438
425
  };
439
426
  reader.readAsArrayBuffer(file);
440
427
  });
@@ -454,13 +441,9 @@ class FileComponent extends Field_1.default {
454
441
  fileEntry.file((file) => {
455
442
  const reader = new FileReader();
456
443
  reader.onloadend = (evt) => {
457
- const blob = new Blob([
458
- new Uint8Array(evt.target.result),
459
- ], { type: file.type });
444
+ const blob = new Blob([new Uint8Array(evt.target.result)], { type: file.type });
460
445
  blob.name = file.name;
461
- this.handleFilesToUpload([
462
- blob,
463
- ]);
446
+ this.handleFilesToUpload([blob]);
464
447
  };
465
448
  reader.readAsArrayBuffer(file);
466
449
  });
@@ -631,7 +614,7 @@ class FileComponent extends Field_1.default {
631
614
  if (!target.id) {
632
615
  return;
633
616
  }
634
- const [action, id,] = target.id.split('-');
617
+ const [action, id] = target.id.split('-');
635
618
  if (!action || !id || !this.actions[action]) {
636
619
  return;
637
620
  }
@@ -656,7 +639,7 @@ class FileComponent extends Field_1.default {
656
639
  file,
657
640
  size: file.size,
658
641
  status: 'info',
659
- message: this.t('Processing file. Please wait...'),
642
+ message: this.t('waitFileProcessing'),
660
643
  hash: '',
661
644
  };
662
645
  }
@@ -687,7 +670,7 @@ class FileComponent extends Field_1.default {
687
670
  return fileWithSameNameUploaded || fileWithSameNameUploading
688
671
  ? {
689
672
  status: 'error',
690
- message: this.t(`File with the same name is already ${fileWithSameNameUploading ? 'being ' : ''}uploaded`),
673
+ message: this.t(fileWithSameNameUploading ? 'fileWithDuplicatedNameInProgress' : 'fileWithDuplicatedNameLoaded'),
691
674
  }
692
675
  : {};
693
676
  }
@@ -696,7 +679,7 @@ class FileComponent extends Field_1.default {
696
679
  if (this.component.filePattern && !this.validatePattern(file, this.component.filePattern)) {
697
680
  return {
698
681
  status: 'error',
699
- message: this.t('File is the wrong type; it must be {{ pattern }}', {
682
+ message: this.t('wrongFileType', {
700
683
  pattern: this.component.filePattern,
701
684
  }),
702
685
  };
@@ -709,7 +692,7 @@ class FileComponent extends Field_1.default {
709
692
  if (!interpolatedMinSize) {
710
693
  return {
711
694
  status: 'error',
712
- message: 'Please, check the entered parameters',
695
+ message: this.t('checkEnteredParameters'),
713
696
  };
714
697
  }
715
698
  if (!this.validateMinSize(file, interpolatedMinSize)) {
@@ -727,7 +710,7 @@ class FileComponent extends Field_1.default {
727
710
  if (!interpolatedMaxSize) {
728
711
  return {
729
712
  status: 'error',
730
- message: 'Please, check the entered parameters',
713
+ message: this.t('checkEnteredParameters'),
731
714
  };
732
715
  }
733
716
  if (!this.validateMaxSize(file, interpolatedMaxSize)) {
@@ -746,7 +729,7 @@ class FileComponent extends Field_1.default {
746
729
  return !fileService
747
730
  ? {
748
731
  status: 'error',
749
- message: this.t('File Service not provided.'),
732
+ message: this.t('noFileService'),
750
733
  }
751
734
  : {};
752
735
  }
@@ -778,11 +761,7 @@ class FileComponent extends Field_1.default {
778
761
  ]
779
762
  : element.component.submissionAccess;
780
763
  groupPermissions.forEach((permission) => {
781
- groupKey = [
782
- 'admin',
783
- 'write',
784
- 'create',
785
- ].includes(permission.type)
764
+ groupKey = ['admin', 'write', 'create'].includes(permission.type)
786
765
  ? element.component.key
787
766
  : null;
788
767
  });
@@ -806,7 +785,7 @@ class FileComponent extends Field_1.default {
806
785
  this.fileDropHidden = false;
807
786
  return {
808
787
  status: 'error',
809
- message: this.t('File processing has been failed.'),
788
+ message: this.t('fileProcessingFailed'),
810
789
  };
811
790
  }
812
791
  finally {
@@ -842,7 +821,7 @@ class FileComponent extends Field_1.default {
842
821
  return this.filesToSync.filesToUpload.push(fileToSync);
843
822
  }
844
823
  if (this.autoSync) {
845
- fileToSync.message = this.t('Ready to be uploaded into storage');
824
+ fileToSync.message = this.t('readyForUpload');
846
825
  }
847
826
  this.filesToSync.filesToUpload.push(Object.assign(Object.assign({}, fileToSync), { message: fileToSync.message, file: processedFile.file || file, url: this.interpolate(this.component.url, { file: fileToSync }), groupPermissions, groupResourceId: groupKey ? this.currentForm.submission.data[groupKey]._id : null }));
848
827
  });
@@ -855,9 +834,7 @@ class FileComponent extends Field_1.default {
855
834
  }
856
835
  if (this.component.storage && files && files.length) {
857
836
  this.fileDropHidden = true;
858
- return Promise.all([
859
- ...files,
860
- ].map((file) => __awaiter(this, void 0, void 0, function* () {
837
+ return Promise.all([...files].map((file) => __awaiter(this, void 0, void 0, function* () {
861
838
  yield this.prepareFileToUpload(file);
862
839
  this.redraw();
863
840
  })));
@@ -877,8 +854,8 @@ class FileComponent extends Field_1.default {
877
854
  }
878
855
  prepareFileToDelete(fileInfo) {
879
856
  this.filesToSync.filesToDelete.push(Object.assign(Object.assign({}, fileInfo), { status: 'info', message: this.autoSync
880
- ? this.t('Ready to be removed from storage')
881
- : this.t('Preparing file to remove') }));
857
+ ? this.t('readyForRemovingFromStorage')
858
+ : this.t('preparingFileToRemove') }));
882
859
  const index = this.dataValue.findIndex((file) => file.name === fileInfo.name);
883
860
  this.splice(index);
884
861
  this.redraw();
@@ -893,13 +870,7 @@ class FileComponent extends Field_1.default {
893
870
  return __awaiter(this, void 0, void 0, function* () {
894
871
  const { options = {} } = this.component;
895
872
  if (fileInfo &&
896
- [
897
- 'url',
898
- 'indexeddb',
899
- 's3',
900
- 'azure',
901
- 'googledrive',
902
- ].includes(this.component.storage)) {
873
+ ['url', 'indexeddb', 's3', 'azure', 'googledrive'].includes(this.component.storage)) {
903
874
  const { fileService } = this;
904
875
  if (fileService && typeof fileService.deleteFile === 'function') {
905
876
  return yield fileService.deleteFile(fileInfo, options);
@@ -925,7 +896,7 @@ class FileComponent extends Field_1.default {
925
896
  }
926
897
  yield this.deleteFile(fileToSync);
927
898
  fileToSync.status = 'success';
928
- fileToSync.message = this.t('Succefully removed');
899
+ fileToSync.message = this.t('succefullyRemoved');
929
900
  }
930
901
  catch (response) {
931
902
  fileToSync.status = 'error';
@@ -995,14 +966,14 @@ class FileComponent extends Field_1.default {
995
966
  fileInfo,
996
967
  };
997
968
  }
998
- if (fileToSync.status === "success") {
999
- const uploadedFile = this.resolvedFiles.find(x => x.fileToSync.originalName === fileToSync.originalName);
969
+ if (fileToSync.status === 'success') {
970
+ const uploadedFile = this.resolvedFiles.find((x) => x.fileToSync.originalName === fileToSync.originalName);
1000
971
  return {
1001
972
  fileToSync: uploadedFile.fileToSync,
1002
973
  fileInfo: uploadedFile.fileInfo,
1003
974
  };
1004
975
  }
1005
- const pendingFile = this.pendingfiles.find(x => x.name === fileToSync.name);
976
+ const pendingFile = this.pendingfiles.find((x) => x.name === fileToSync.name);
1006
977
  if (pendingFile) {
1007
978
  fileInfo = yield pendingFile.fileInfoProm;
1008
979
  }
@@ -1011,9 +982,9 @@ class FileComponent extends Field_1.default {
1011
982
  this.pendingfiles.push({ name: fileToSync.name, fileInfoProm: promInfo });
1012
983
  fileInfo = yield promInfo;
1013
984
  }
1014
- this.pendingfiles = this.pendingfiles.filter(x => x.name !== fileToSync.name);
985
+ this.pendingfiles = this.pendingfiles.filter((x) => x.name !== fileToSync.name);
1015
986
  fileToSync.status = 'success';
1016
- fileToSync.message = this.t('Succefully uploaded');
987
+ fileToSync.message = this.t('succefullyUploaded');
1017
988
  fileInfo.originalName = fileToSync.originalName;
1018
989
  fileInfo.hash = fileToSync.hash;
1019
990
  this.emit('fileUploadingEnd', Promise.resolve(fileInfo));
@@ -1025,7 +996,7 @@ class FileComponent extends Field_1.default {
1025
996
  typeof response === 'string'
1026
997
  ? response
1027
998
  : response.type === 'abort'
1028
- ? this.t('Request was aborted')
999
+ ? this.t('requestAborted')
1029
1000
  : response.toString();
1030
1001
  this.emit('fileUploadingEnd', Promise.reject(response));
1031
1002
  this.emit(lodash_1.default.get(response, 'type') === 'abort' ? 'fileUploadCanceled' : 'fileUploadError', {
@@ -1036,9 +1007,11 @@ class FileComponent extends Field_1.default {
1036
1007
  finally {
1037
1008
  delete fileToSync.progress;
1038
1009
  this.redraw();
1039
- const fileExists = this.resolvedFiles.find(x => x.fileInfo.originalName === fileToSync.originalName);
1040
- if (!fileExists && fileToSync.status !== 'error') {
1041
- this.resolvedFiles.push({ fileToSync, fileInfo });
1010
+ if (fileInfo) {
1011
+ const fileExists = this.resolvedFiles.find(x => x.fileInfo.originalName === fileToSync.originalName);
1012
+ if (!fileExists && fileToSync.status !== 'error') {
1013
+ this.resolvedFiles.push({ fileToSync, fileInfo });
1014
+ }
1042
1015
  }
1043
1016
  }
1044
1017
  return {
@@ -1055,7 +1028,7 @@ class FileComponent extends Field_1.default {
1055
1028
  this.fileDropHidden = true;
1056
1029
  this.redraw();
1057
1030
  try {
1058
- const [filesToDelete = [], filesToUpload = [],] = yield Promise.all([
1031
+ const [filesToDelete = [], filesToUpload = []] = yield Promise.all([
1059
1032
  this.delete(),
1060
1033
  this.upload(),
1061
1034
  ]);
@@ -1095,7 +1068,7 @@ class FileComponent extends Field_1.default {
1095
1068
  const { options = {} } = this.component;
1096
1069
  const { fileService } = this;
1097
1070
  if (!fileService) {
1098
- return alert('File Service not provided');
1071
+ return alert(this.t('noFileService'));
1099
1072
  }
1100
1073
  if (this.component.privateDownload) {
1101
1074
  fileInfo.private = true;
@@ -1104,10 +1077,7 @@ class FileComponent extends Field_1.default {
1104
1077
  .downloadFile(fileInfo, options)
1105
1078
  .then((file) => {
1106
1079
  if (file) {
1107
- if ([
1108
- 'base64',
1109
- 'indexeddb',
1110
- ].includes(file.storage)) {
1080
+ if (['base64', 'indexeddb'].includes(file.storage)) {
1111
1081
  (0, downloadjs_1.default)(file.url, file.originalName || file.name, file.type);
1112
1082
  }
1113
1083
  else {
@@ -1136,7 +1106,7 @@ class FileComponent extends Field_1.default {
1136
1106
  return Promise.resolve();
1137
1107
  }
1138
1108
  yield this.syncFiles();
1139
- return this.shouldSyncFiles ? Promise.reject('Synchronization is failed') : Promise.resolve();
1109
+ return this.shouldSyncFiles ? Promise.reject(this.t('synchronizationFailed')) : Promise.resolve();
1140
1110
  }
1141
1111
  catch (error) {
1142
1112
  return Promise.reject(error.message);
@@ -17,11 +17,7 @@ exports.default = [
17
17
  {
18
18
  var: 'data.storage',
19
19
  },
20
- [
21
- 's3',
22
- 'azure',
23
- 'googledrive',
24
- ],
20
+ ['s3', 'azure', 'googledrive'],
25
21
  ],
26
22
  },
27
23
  },
@@ -33,10 +33,7 @@ exports.default = [
33
33
  tooltip: "The <a href='https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html'>S3 Multipart Upload API</a> is designed to improve the upload experience for larger objects (> 5GB).",
34
34
  conditional: {
35
35
  json: {
36
- '===': [
37
- { var: 'data.storage' },
38
- 's3',
39
- ],
36
+ '===': [{ var: 'data.storage' }, 's3'],
40
37
  },
41
38
  },
42
39
  },
@@ -68,10 +65,7 @@ exports.default = [
68
65
  ],
69
66
  conditional: {
70
67
  json: {
71
- '===': [
72
- { var: 'data.useMultipartUpload' },
73
- true,
74
- ],
68
+ '===': [{ var: 'data.useMultipartUpload' }, true],
75
69
  },
76
70
  },
77
71
  },
@@ -85,10 +79,7 @@ exports.default = [
85
79
  tooltip: "See <a href='https://github.com/danialfarid/ng-file-upload#server-side' target='_blank'>https://github.com/danialfarid/ng-file-upload#server-side</a> for how to set up the server.",
86
80
  conditional: {
87
81
  json: {
88
- '===': [
89
- { var: 'data.storage' },
90
- 'url',
91
- ],
82
+ '===': [{ var: 'data.storage' }, 'url'],
92
83
  },
93
84
  },
94
85
  },
@@ -105,9 +96,7 @@ exports.default = [
105
96
  {
106
97
  var: 'data.storage',
107
98
  },
108
- [
109
- 'indexeddb',
110
- ],
99
+ ['indexeddb'],
111
100
  ],
112
101
  },
113
102
  },
@@ -125,9 +114,7 @@ exports.default = [
125
114
  {
126
115
  var: 'data.storage',
127
116
  },
128
- [
129
- 'indexeddb',
130
- ],
117
+ ['indexeddb'],
131
118
  ],
132
119
  },
133
120
  },
@@ -301,10 +288,7 @@ exports.default = [
301
288
  weight: 31,
302
289
  conditional: {
303
290
  json: {
304
- '===': [
305
- { var: 'data.storage' },
306
- 'url',
307
- ],
291
+ '===': [{ var: 'data.storage' }, 'url'],
308
292
  },
309
293
  },
310
294
  },
@@ -318,10 +302,7 @@ exports.default = [
318
302
  weight: 40,
319
303
  conditional: {
320
304
  json: {
321
- '==': [
322
- { var: 'data.image' },
323
- true,
324
- ],
305
+ '==': [{ var: 'data.image' }, true],
325
306
  },
326
307
  },
327
308
  },
@@ -343,10 +324,7 @@ exports.default = [
343
324
  weight: 38,
344
325
  conditional: {
345
326
  json: {
346
- '==': [
347
- { var: 'data.webcam' },
348
- true,
349
- ],
327
+ '==': [{ var: 'data.webcam' }, true],
350
328
  },
351
329
  },
352
330
  },
@@ -34,9 +34,7 @@ class FormComponent extends Component_1.default {
34
34
  };
35
35
  }
36
36
  static savedValueTypes() {
37
- return [
38
- utils_1.componentValueTypes.object,
39
- ];
37
+ return [utils_1.componentValueTypes.object];
40
38
  }
41
39
  init() {
42
40
  super.init();
@@ -222,7 +220,7 @@ class FormComponent extends Component_1.default {
222
220
  }
223
221
  render() {
224
222
  if (this.builderMode) {
225
- return super.render(this.component.label || 'Nested form');
223
+ return super.render(this.t(this.component.label || 'nestedForm'));
226
224
  }
227
225
  const subform = this.subForm ? this.subForm.render() : this.renderTemplate('loading');
228
226
  return super.render(subform);
@@ -235,13 +233,13 @@ class FormComponent extends Component_1.default {
235
233
  */
236
234
  getValueAsString(value, options) {
237
235
  if (!value) {
238
- return 'No data provided';
236
+ return this.t('noDataProvided');
239
237
  }
240
238
  if (!value.data && value._id) {
241
239
  return value._id;
242
240
  }
243
241
  if (!value.data || !Object.keys(value.data).length) {
244
- return 'No data provided';
242
+ return this.t('noDataProvided');
245
243
  }
246
244
  if (options === null || options === void 0 ? void 0 : options.email) {
247
245
  let result = `
@@ -710,7 +708,7 @@ class FormComponent extends Component_1.default {
710
708
  : {};
711
709
  this.subForm.setUrl(submissionUrl, Object.assign(Object.assign({}, this.options), options));
712
710
  this.subForm.loadSubmission().catch((err) => {
713
- console.error(`Unable to load subform submission ${submission._id}:`, err);
711
+ console.error(this.t('subformSubmissionLoadingError', { submissionId: submission._id }), err);
714
712
  });
715
713
  }
716
714
  else {
@@ -54,11 +54,7 @@ class HTMLComponent extends Component_1.default {
54
54
  return content;
55
55
  }
56
56
  get singleTags() {
57
- return [
58
- 'br',
59
- 'img',
60
- 'hr',
61
- ];
57
+ return ['br', 'img', 'hr'];
62
58
  }
63
59
  checkRefreshOn(changed) {
64
60
  super.checkRefreshOn(changed);
@@ -48,9 +48,7 @@ class NumberComponent extends Input_1.default {
48
48
  }
49
49
  static savedValueTypes(schema) {
50
50
  schema = schema || {};
51
- return ((0, utils_1.getComponentSavedTypes)(schema) || [
52
- utils_1.componentValueTypes.number,
53
- ]);
51
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.number];
54
52
  }
55
53
  constructor(...args) {
56
54
  var _a, _b, _c;
@@ -72,7 +70,7 @@ class NumberComponent extends Input_1.default {
72
70
  if (this.component.thousandsSeparator ||
73
71
  ((_c = this.options.properties) === null || _c === void 0 ? void 0 : _c.thousandsSeparator) ||
74
72
  this.options.thousandsSeparator) {
75
- console.warn('In order for thousands separator to work properly, you must set the delimiter to true in the component json');
73
+ console.warn(this.t('noDelimiterSet'));
76
74
  }
77
75
  this.delimiter = '';
78
76
  }
@@ -92,10 +92,7 @@ exports.default = [
92
92
  defaultValue: true,
93
93
  customConditional({ data = {}, buildingForm = {} }) {
94
94
  const formSettings = buildingForm.settings || {};
95
- return ![
96
- data.breadcrumb,
97
- formSettings.wizardBreadcrumbsType,
98
- ].includes('none');
95
+ return ![data.breadcrumb, formSettings.wizardBreadcrumbsType].includes('none');
99
96
  },
100
97
  },
101
98
  {
@@ -107,10 +104,7 @@ exports.default = [
107
104
  tooltip: 'Determines if the breadcrumb bar is clickable or not for visited tabs.',
108
105
  conditional: {
109
106
  json: {
110
- '===': [
111
- { var: 'data.breadcrumbClickable' },
112
- false,
113
- ],
107
+ '===': [{ var: 'data.breadcrumbClickable' }, false],
114
108
  },
115
109
  },
116
110
  },
@@ -216,10 +210,7 @@ exports.default = [
216
210
  input: true,
217
211
  conditional: {
218
212
  json: {
219
- '===': [
220
- { var: 'data.collapsible' },
221
- true,
222
- ],
213
+ '===': [{ var: 'data.collapsible' }, true],
223
214
  },
224
215
  },
225
216
  },
@@ -26,10 +26,7 @@ class PasswordComponent extends TextField_1.default {
26
26
  };
27
27
  }
28
28
  get defaultSchema() {
29
- return lodash_1.default.omit(PasswordComponent.schema(), [
30
- 'protected',
31
- 'tableView',
32
- ]);
29
+ return lodash_1.default.omit(PasswordComponent.schema(), ['protected', 'tableView']);
33
30
  }
34
31
  get inputInfo() {
35
32
  const info = super.inputInfo;
@@ -14,9 +14,7 @@ class RadioComponent extends ListComponent_1.default {
14
14
  inputType: 'radio',
15
15
  label: 'Radio',
16
16
  key: 'radio',
17
- values: [
18
- { label: '', value: '' },
19
- ],
17
+ values: [{ label: '', value: '' }],
20
18
  data: {
21
19
  url: '',
22
20
  },
@@ -60,23 +58,12 @@ class RadioComponent extends ListComponent_1.default {
60
58
  return types;
61
59
  }
62
60
  if (dataType === 'object') {
63
- return [
64
- object,
65
- array,
66
- ];
61
+ return [object, array];
67
62
  }
68
63
  if (utils_1.componentValueTypes[dataType]) {
69
- return [
70
- utils_1.componentValueTypes[dataType],
71
- ];
64
+ return [utils_1.componentValueTypes[dataType]];
72
65
  }
73
- return [
74
- boolean,
75
- string,
76
- number,
77
- object,
78
- array,
79
- ];
66
+ return [boolean, string, number, object, array];
80
67
  }
81
68
  constructor(component, options, data) {
82
69
  super(component, options, data);
@@ -417,6 +404,9 @@ class RadioComponent extends ListComponent_1.default {
417
404
  if (changed) {
418
405
  this.previousValue = this.dataValue;
419
406
  }
407
+ if (!this.visible) {
408
+ this.previousValue = this.emptyValue;
409
+ }
420
410
  return changed;
421
411
  }
422
412
  // If they clicked on the radio that is currently selected, it needs to reset the value.
@@ -23,9 +23,7 @@ exports.default = [
23
23
  },
24
24
  onChange(context) {
25
25
  if (context && context.flags && context.flags && context.flags.modified) {
26
- context.data.values = [
27
- { label: '', value: '' },
28
- ];
26
+ context.data.values = [{ label: '', value: '' }];
29
27
  }
30
28
  },
31
29
  },
@@ -37,9 +35,7 @@ exports.default = [
37
35
  tooltip: 'The radio button values that can be picked for this field. Values are text submitted with the form data. Labels are text that appears next to the radio buttons on the form.',
38
36
  weight: 10,
39
37
  reorder: true,
40
- defaultValue: [
41
- { label: '', value: '' },
42
- ],
38
+ defaultValue: [{ label: '', value: '' }],
43
39
  components: [
44
40
  {
45
41
  label: 'Label',
@@ -78,10 +74,7 @@ exports.default = [
78
74
  ],
79
75
  conditional: {
80
76
  json: {
81
- '===': [
82
- { var: 'data.dataSrc' },
83
- 'values',
84
- ],
77
+ '===': [{ var: 'data.dataSrc' }, 'values'],
85
78
  },
86
79
  },
87
80
  },
@@ -109,10 +102,7 @@ exports.default = [
109
102
  key: 'template',
110
103
  conditional: {
111
104
  json: {
112
- '===': [
113
- { var: 'data.dataSrc' },
114
- 'url',
115
- ],
105
+ '===': [{ var: 'data.dataSrc' }, 'url'],
116
106
  },
117
107
  },
118
108
  },
@@ -32,10 +32,7 @@ class ReCaptchaComponent extends Component_1.default {
32
32
  return [];
33
33
  }
34
34
  static get conditionOperatorsSettings() {
35
- return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [
36
- 'isEmpty',
37
- 'isNotEmpty',
38
- ] });
35
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
39
36
  }
40
37
  static get serverConditionSettings() {
41
38
  return ReCaptchaComponent.conditionOperatorsSettings;
@@ -62,7 +59,7 @@ class ReCaptchaComponent extends Component_1.default {
62
59
  this.recaptchaApiReady = Formio_1.Formio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);
63
60
  }
64
61
  else {
65
- console.warn('There is no Site Key specified in settings in form JSON');
62
+ console.warn(this.t('noSiteKey'));
66
63
  }
67
64
  }
68
65
  }
@@ -77,7 +74,7 @@ class ReCaptchaComponent extends Component_1.default {
77
74
  return __awaiter(this, void 0, void 0, function* () {
78
75
  const siteKey = (0, get_1.default)((_a = this.root) === null || _a === void 0 ? void 0 : _a.form, 'settings.recaptcha.siteKey');
79
76
  if (!siteKey) {
80
- console.warn('There is no Site Key specified in settings in form JSON');
77
+ console.warn(this.t('noSiteKey'));
81
78
  return;
82
79
  }
83
80
  if (!this.recaptchaApiReady) {