@formio/js 5.0.0-dev.5956.0e71b6d → 5.0.0-dev.5957.bed9ce0

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 (99) hide show
  1. package/dist/formio.form.js +70 -48
  2. package/dist/formio.form.min.js +1 -1
  3. package/dist/formio.full.js +73 -51
  4. package/dist/formio.full.min.js +1 -1
  5. package/lib/cjs/Form.js +4 -4
  6. package/lib/cjs/PDFBuilder.js +4 -4
  7. package/lib/cjs/Webform.d.ts +13 -13
  8. package/lib/cjs/Webform.js +132 -131
  9. package/lib/cjs/WebformBuilder.js +10 -10
  10. package/lib/cjs/Wizard.js +1 -1
  11. package/lib/cjs/WizardBuilder.js +1 -1
  12. package/lib/cjs/components/_classes/component/Component.js +11 -10
  13. package/lib/cjs/components/_classes/field/Field.d.ts +2 -2
  14. package/lib/cjs/components/_classes/field/Field.js +1 -1
  15. package/lib/cjs/components/_classes/list/ListComponent.js +4 -4
  16. package/lib/cjs/components/_classes/multivalue/Multivalue.js +2 -2
  17. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +1 -1
  18. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +3 -3
  19. package/lib/cjs/components/address/Address.d.ts +2 -1
  20. package/lib/cjs/components/address/Address.js +1 -1
  21. package/lib/cjs/components/button/Button.d.ts +1 -1
  22. package/lib/cjs/components/button/Button.js +6 -6
  23. package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
  24. package/lib/cjs/components/checkbox/Checkbox.js +1 -1
  25. package/lib/cjs/components/columns/Columns.d.ts +1 -1
  26. package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -1
  27. package/lib/cjs/components/datagrid/DataGrid.js +1 -1
  28. package/lib/cjs/components/day/Day.d.ts +1 -1
  29. package/lib/cjs/components/day/Day.js +2 -2
  30. package/lib/cjs/components/editgrid/EditGrid.js +4 -4
  31. package/lib/cjs/components/file/File.d.ts +1 -1
  32. package/lib/cjs/components/file/File.js +15 -15
  33. package/lib/cjs/components/form/Form.js +4 -4
  34. package/lib/cjs/components/number/Number.js +1 -1
  35. package/lib/cjs/components/radio/Radio.d.ts +1 -1
  36. package/lib/cjs/components/recaptcha/ReCaptcha.js +2 -2
  37. package/lib/cjs/components/select/Select.d.ts +1 -1
  38. package/lib/cjs/components/select/Select.js +5 -5
  39. package/lib/cjs/components/selectboxes/SelectBoxes.js +2 -2
  40. package/lib/cjs/components/signature/Signature.d.ts +1 -1
  41. package/lib/cjs/components/signature/Signature.js +2 -2
  42. package/lib/cjs/components/survey/Survey.d.ts +1 -1
  43. package/lib/cjs/components/survey/Survey.js +2 -2
  44. package/lib/cjs/components/table/Table.d.ts +1 -1
  45. package/lib/cjs/components/tabs/Tabs.d.ts +1 -1
  46. package/lib/cjs/components/textarea/TextArea.js +6 -6
  47. package/lib/cjs/formio.form.js +4 -0
  48. package/lib/cjs/translations/en.d.ts +234 -81
  49. package/lib/cjs/translations/en.js +8 -81
  50. package/lib/cjs/utils/i18n.d.ts +5 -2
  51. package/lib/cjs/utils/i18n.js +32 -5
  52. package/lib/mjs/Form.js +4 -4
  53. package/lib/mjs/PDFBuilder.js +4 -4
  54. package/lib/mjs/Webform.d.ts +13 -13
  55. package/lib/mjs/Webform.js +142 -141
  56. package/lib/mjs/WebformBuilder.js +10 -10
  57. package/lib/mjs/Wizard.js +1 -1
  58. package/lib/mjs/WizardBuilder.js +1 -1
  59. package/lib/mjs/components/_classes/component/Component.js +11 -10
  60. package/lib/mjs/components/_classes/field/Field.d.ts +2 -2
  61. package/lib/mjs/components/_classes/field/Field.js +1 -1
  62. package/lib/mjs/components/_classes/list/ListComponent.js +4 -4
  63. package/lib/mjs/components/_classes/multivalue/Multivalue.js +2 -2
  64. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +1 -1
  65. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +3 -3
  66. package/lib/mjs/components/address/Address.d.ts +2 -1
  67. package/lib/mjs/components/address/Address.js +1 -1
  68. package/lib/mjs/components/button/Button.d.ts +1 -1
  69. package/lib/mjs/components/button/Button.js +6 -6
  70. package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
  71. package/lib/mjs/components/checkbox/Checkbox.js +1 -1
  72. package/lib/mjs/components/columns/Columns.d.ts +1 -1
  73. package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -1
  74. package/lib/mjs/components/datagrid/DataGrid.js +1 -1
  75. package/lib/mjs/components/day/Day.d.ts +1 -1
  76. package/lib/mjs/components/day/Day.js +2 -2
  77. package/lib/mjs/components/editgrid/EditGrid.js +4 -4
  78. package/lib/mjs/components/file/File.d.ts +1 -1
  79. package/lib/mjs/components/file/File.js +15 -15
  80. package/lib/mjs/components/form/Form.js +4 -4
  81. package/lib/mjs/components/number/Number.js +1 -1
  82. package/lib/mjs/components/radio/Radio.d.ts +1 -1
  83. package/lib/mjs/components/recaptcha/ReCaptcha.js +2 -2
  84. package/lib/mjs/components/select/Select.d.ts +1 -1
  85. package/lib/mjs/components/select/Select.js +7 -7
  86. package/lib/mjs/components/selectboxes/SelectBoxes.js +2 -2
  87. package/lib/mjs/components/signature/Signature.d.ts +1 -1
  88. package/lib/mjs/components/signature/Signature.js +2 -2
  89. package/lib/mjs/components/survey/Survey.d.ts +1 -1
  90. package/lib/mjs/components/survey/Survey.js +2 -2
  91. package/lib/mjs/components/table/Table.d.ts +1 -1
  92. package/lib/mjs/components/tabs/Tabs.d.ts +1 -1
  93. package/lib/mjs/components/textarea/TextArea.js +6 -6
  94. package/lib/mjs/formio.form.js +4 -0
  95. package/lib/mjs/translations/en.d.ts +234 -81
  96. package/lib/mjs/translations/en.js +87 -1
  97. package/lib/mjs/utils/i18n.d.ts +5 -2
  98. package/lib/mjs/utils/i18n.js +32 -5
  99. package/package.json +2 -2
package/lib/cjs/Form.js CHANGED
@@ -337,10 +337,10 @@ class Form extends Element_1.default {
337
337
  */
338
338
  build() {
339
339
  if (!this.instance) {
340
- return Promise.reject('Form not ready. Use form.ready promise');
340
+ return Promise.reject(this.t('formNotReady'));
341
341
  }
342
342
  if (!this.element) {
343
- return Promise.reject('No DOM element for form.');
343
+ return Promise.reject(this.t('noFormElement'));
344
344
  }
345
345
  // Add temporary loader.
346
346
  const template = (this.options && this.options.template) ? this.options.template : 'bootstrap';
@@ -357,7 +357,7 @@ class Form extends Element_1.default {
357
357
  }
358
358
  render() {
359
359
  if (!this.instance) {
360
- return Promise.reject('Form not ready. Use form.ready promise');
360
+ return Promise.reject(this.t('formNotReady'));
361
361
  }
362
362
  return Promise.resolve(this.instance.render())
363
363
  .then((param) => {
@@ -367,7 +367,7 @@ class Form extends Element_1.default {
367
367
  }
368
368
  attach(element) {
369
369
  if (!this.instance) {
370
- return Promise.reject('Form not ready. Use form.ready promise');
370
+ return Promise.reject(this.t('formNotReady'));
371
371
  }
372
372
  if (this.element) {
373
373
  delete this.element.component;
@@ -201,10 +201,10 @@ class PDFBuilder extends WebformBuilder_1.default {
201
201
  const progress = Math.floor((event.loaded / event.total) * 100);
202
202
  this.refs.uploadProgress.style.width = `${progress}%`;
203
203
  if (progress > 98) {
204
- this.refs.uploadProgress.innerHTML = this.t('Converting PDF. Please wait.');
204
+ this.refs.uploadProgress.innerHTML = this.t('waitPdfConverting');
205
205
  }
206
206
  else {
207
- this.refs.uploadProgress.innerHTML = `${this.t('Uploading')} ${progress}%`;
207
+ this.refs.uploadProgress.innerHTML = `${this.t('uploading')} ${progress}%`;
208
208
  }
209
209
  }
210
210
  }, `${this.projectUrl}/upload`, {}, 'file')
@@ -242,7 +242,7 @@ class PDFBuilder extends WebformBuilder_1.default {
242
242
  return;
243
243
  }
244
244
  this.refs.uploadError.style.display = message ? '' : 'none';
245
- this.refs.uploadError.innerHTML = message;
245
+ this.refs.uploadError.innerHTML = this.t(`${message}`);
246
246
  }
247
247
  createForm(options) {
248
248
  // Instantiate the webform from the PDF class instead of Webform
@@ -471,7 +471,7 @@ class PDFBuilder extends WebformBuilder_1.default {
471
471
  name: 'showBuilderErrors',
472
472
  data: {
473
473
  compId: comp.component.id,
474
- errorMessage: `API Key is not unique: ${comp.key}`,
474
+ errorMessage: `${this.t('notUniqueKey')}: ${comp.key}`,
475
475
  }
476
476
  });
477
477
  }
@@ -34,10 +34,10 @@
34
34
  */
35
35
  /**
36
36
  * @typedef {object} ButtonSettings
37
- * @property {boolean} [showPrevious] - Show the "Previous" button.
38
- * @property {boolean} [showNext] - Show the "Next" button.
39
- * @property {boolean} [showCancel] - Show the "Cancel" button.
40
- * @property {boolean} [showSubmit] - Show the "Submit" button.
37
+ * @property {boolean} [showPrevious] - Show the 'Previous' button.
38
+ * @property {boolean} [showNext] - Show the 'Next' button.
39
+ * @property {boolean} [showCancel] - Show the 'Cancel' button.
40
+ * @property {boolean} [showSubmit] - Show the 'Submit' button.
41
41
  */
42
42
  /**
43
43
  * @typedef {object} FormOptions
@@ -257,7 +257,7 @@ declare class Webform extends NestedDataComponent {
257
257
  get ready(): Promise<any>;
258
258
  /**
259
259
  * Set the loading state for this form, and also show the loader spinner.
260
- * @param {boolean} loading - If this form should be "loading" or not.
260
+ * @param {boolean} loading - If this form should be 'loading' or not.
261
261
  */
262
262
  set loading(loading: boolean);
263
263
  /**
@@ -363,13 +363,13 @@ declare class Webform extends NestedDataComponent {
363
363
  executeFormController(): false | undefined;
364
364
  build(element: any): Promise<any>;
365
365
  getClassName(): string;
366
- render(): string;
366
+ render(): import("./components/_classes/field/Field").default;
367
367
  redraw(): Promise<void> | Promise<boolean>;
368
368
  attach(element: any): Promise<boolean>;
369
369
  hasRequiredFields(): boolean;
370
370
  /**
371
371
  * Sets a new alert to display in the error dialog of the form.
372
- * @param {string} type - The type of alert to display. "danger", "success", "warning", etc.
372
+ * @param {string} type - The type of alert to display. 'danger', 'success', 'warning', etc.
373
373
  * @param {string} message - The message to show in the alert.
374
374
  * @param {object} options - The options for the alert.
375
375
  */
@@ -547,19 +547,19 @@ export type SanitizeConfig = {
547
547
  };
548
548
  export type ButtonSettings = {
549
549
  /**
550
- * - Show the "Previous" button.
550
+ * - Show the 'Previous' button.
551
551
  */
552
552
  showPrevious?: boolean | undefined;
553
553
  /**
554
- * - Show the "Next" button.
554
+ * - Show the 'Next' button.
555
555
  */
556
556
  showNext?: boolean | undefined;
557
557
  /**
558
- * - Show the "Cancel" button.
558
+ * - Show the 'Cancel' button.
559
559
  */
560
560
  showCancel?: boolean | undefined;
561
561
  /**
562
- * - Show the "Submit" button.
562
+ * - Show the 'Submit' button.
563
563
  */
564
564
  showSubmit?: boolean | undefined;
565
565
  };
@@ -739,5 +739,5 @@ export type FormOptions = {
739
739
  */
740
740
  zoom?: number | undefined;
741
741
  };
742
- import NestedDataComponent from "./components/_classes/nesteddata/NestedDataComponent";
743
- import EventEmitter from "./EventEmitter";
742
+ import NestedDataComponent from './components/_classes/nesteddata/NestedDataComponent';
743
+ import EventEmitter from './EventEmitter';