@formio/js 5.0.0-dev.5613.3476921 → 5.0.0-dev.5614.ea3660d

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 (69) hide show
  1. package/dist/formio.form.js +18 -18
  2. package/dist/formio.form.min.js +1 -1
  3. package/dist/formio.full.js +20 -20
  4. package/dist/formio.full.min.js +1 -1
  5. package/dist/formio.utils.js +1 -1
  6. package/dist/formio.utils.min.js +1 -1
  7. package/lib/cjs/Element.d.ts +1 -2
  8. package/lib/cjs/Element.js +8 -17
  9. package/lib/cjs/Form.js +1 -15
  10. package/lib/cjs/PDF.js +1 -8
  11. package/lib/cjs/PDFBuilder.js +3 -3
  12. package/lib/cjs/Webform.d.ts +1 -0
  13. package/lib/cjs/Webform.js +12 -17
  14. package/lib/cjs/WebformBuilder.d.ts +1 -0
  15. package/lib/cjs/WebformBuilder.js +10 -5
  16. package/lib/cjs/Wizard.js +1 -1
  17. package/lib/cjs/addons/FormioAddon.d.ts +0 -1
  18. package/lib/cjs/components/_classes/component/Component.d.ts +4 -7
  19. package/lib/cjs/components/_classes/component/Component.js +8 -45
  20. package/lib/cjs/components/_classes/input/Input.js +1 -16
  21. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -2
  22. package/lib/cjs/components/_classes/nested/NestedComponent.js +7 -8
  23. package/lib/cjs/components/columns/Columns.js +2 -2
  24. package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -1
  25. package/lib/cjs/components/editgrid/EditGrid.js +7 -21
  26. package/lib/cjs/components/file/File.d.ts +0 -1
  27. package/lib/cjs/components/file/File.js +2 -2
  28. package/lib/cjs/components/form/Form.js +3 -3
  29. package/lib/cjs/components/select/Select.js +2 -4
  30. package/lib/cjs/components/table/Table.d.ts +1 -0
  31. package/lib/cjs/components/table/Table.js +1 -1
  32. package/lib/cjs/components/tags/Tags.js +2 -4
  33. package/lib/cjs/translations/en.d.ts +0 -1
  34. package/lib/cjs/translations/en.js +0 -1
  35. package/lib/cjs/utils/utils.d.ts +1 -1
  36. package/lib/cjs/utils/utils.js +2 -14
  37. package/lib/cjs/widgets/CalendarWidget.js +2 -2
  38. package/lib/mjs/Element.d.ts +1 -2
  39. package/lib/mjs/Element.js +8 -17
  40. package/lib/mjs/Form.js +1 -15
  41. package/lib/mjs/PDF.js +1 -8
  42. package/lib/mjs/PDFBuilder.js +3 -3
  43. package/lib/mjs/Webform.d.ts +1 -0
  44. package/lib/mjs/Webform.js +12 -17
  45. package/lib/mjs/WebformBuilder.d.ts +1 -0
  46. package/lib/mjs/WebformBuilder.js +9 -5
  47. package/lib/mjs/Wizard.js +1 -1
  48. package/lib/mjs/addons/FormioAddon.d.ts +0 -1
  49. package/lib/mjs/components/_classes/component/Component.d.ts +4 -7
  50. package/lib/mjs/components/_classes/component/Component.js +8 -45
  51. package/lib/mjs/components/_classes/input/Input.js +1 -16
  52. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -2
  53. package/lib/mjs/components/_classes/nested/NestedComponent.js +7 -8
  54. package/lib/mjs/components/columns/Columns.js +2 -2
  55. package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -1
  56. package/lib/mjs/components/editgrid/EditGrid.js +7 -20
  57. package/lib/mjs/components/file/File.d.ts +0 -1
  58. package/lib/mjs/components/file/File.js +2 -2
  59. package/lib/mjs/components/form/Form.js +3 -3
  60. package/lib/mjs/components/select/Select.js +2 -4
  61. package/lib/mjs/components/table/Table.d.ts +1 -0
  62. package/lib/mjs/components/table/Table.js +1 -1
  63. package/lib/mjs/components/tags/Tags.js +2 -4
  64. package/lib/mjs/translations/en.d.ts +0 -1
  65. package/lib/mjs/translations/en.js +0 -1
  66. package/lib/mjs/utils/utils.d.ts +1 -1
  67. package/lib/mjs/utils/utils.js +1 -2
  68. package/lib/mjs/widgets/CalendarWidget.js +2 -2
  69. package/package.json +1 -1
@@ -567,19 +567,15 @@ export default class EditGridComponent extends NestedArrayComponent {
567
567
  return this.builderMode
568
568
  ? super.getComponents()
569
569
  : _.isNumber(rowIndex)
570
- ? (this.editRows[rowIndex]?.components || [])
570
+ ? (this.editRows[rowIndex].components || [])
571
571
  : this.editRows.reduce((result, row) => result.concat(row.components || []), []);
572
572
  }
573
- destroy(all = false) {
574
- this.calculatedValue = undefined;
575
- super.destroy(all);
576
- }
577
- destroyComponents(all = false, rowIndex = 0) {
573
+ destroyComponents(rowIndex) {
578
574
  if (this.builderMode) {
579
- return super.destroyComponents(all);
575
+ return super.destroyComponents();
580
576
  }
581
577
  const components = this.getComponents(rowIndex).slice();
582
- components.forEach((comp) => this.removeComponent(comp, this.components, all));
578
+ components.forEach((comp) => this.removeComponent(comp, this.components));
583
579
  }
584
580
  createRow(dataObj, rowIndex) {
585
581
  const editRow = {
@@ -752,7 +748,7 @@ export default class EditGridComponent extends NestedArrayComponent {
752
748
  case EditRowState.New: {
753
749
  editRow.state = EditRowState.Removed;
754
750
  this.clearErrors(rowIndex);
755
- this.destroyComponents(false, rowIndex);
751
+ this.destroyComponents(rowIndex);
756
752
  if (this.inlineEditMode) {
757
753
  this.splice(rowIndex);
758
754
  }
@@ -870,7 +866,7 @@ export default class EditGridComponent extends NestedArrayComponent {
870
866
  baseRemoveRow(rowIndex) {
871
867
  const editRow = this.editRows[rowIndex];
872
868
  editRow.state = EditRowState.Removed;
873
- this.destroyComponents(false, rowIndex);
869
+ this.destroyComponents(rowIndex);
874
870
  return editRow;
875
871
  }
876
872
  removeRow(rowIndex, modified) {
@@ -893,15 +889,6 @@ export default class EditGridComponent extends NestedArrayComponent {
893
889
  this.redraw();
894
890
  }
895
891
  createRowComponents(row, rowIndex, recreatePartially) {
896
- // Iterate through existing components and destroy the ones with the same rowIndex.
897
- if (this.components) {
898
- for (let i = 0; i < this.components.length; i++) {
899
- if (this.components[i].rowIndex === rowIndex) {
900
- this.components[i].destroy();
901
- this.components.splice(i, 1);
902
- }
903
- }
904
- }
905
892
  const currentRowComponents = _.get(this.editRows, `[${rowIndex}].components`, null);
906
893
  return this.component.components.map((col, colIndex) => {
907
894
  if (recreatePartially && currentRowComponents && this.variableTypeComponentsIndexes.length) {
@@ -1181,7 +1168,7 @@ export default class EditGridComponent extends NestedArrayComponent {
1181
1168
  });
1182
1169
  }
1183
1170
  emptyRows() {
1184
- this.editRows.forEach((editRow, index) => this.destroyComponents(false, index));
1171
+ this.editRows.forEach((editRow, index) => this.destroyComponents(index));
1185
1172
  this.editRows = [];
1186
1173
  }
1187
1174
  resetValue() {
@@ -167,6 +167,5 @@ export default class FileComponent extends Field {
167
167
  getFile(fileInfo: any): any;
168
168
  focus(): void;
169
169
  beforeSubmit(): Promise<void>;
170
- destroy(all: any): void;
171
170
  }
172
171
  import Field from '../_classes/field/Field';
@@ -1022,8 +1022,8 @@ export default class FileComponent extends Field {
1022
1022
  return Promise.reject(error.message);
1023
1023
  }
1024
1024
  }
1025
- destroy(all) {
1025
+ destroy() {
1026
1026
  this.stopVideo();
1027
- super.destroy(all);
1027
+ super.destroy();
1028
1028
  }
1029
1029
  }
@@ -329,13 +329,13 @@ export default class FormComponent extends Component {
329
329
  && _.isNumber(this.formObj._vid)
330
330
  && this.formObj._vid !== this.subFormRevision;
331
331
  }
332
- destroy(all = false) {
332
+ destroy() {
333
333
  if (this.subForm) {
334
- this.subForm.destroy(all);
334
+ this.subForm.destroy();
335
335
  this.subForm = null;
336
336
  this.subFormReady = null;
337
337
  }
338
- super.destroy(all);
338
+ super.destroy();
339
339
  }
340
340
  redraw() {
341
341
  if (this.subForm) {
@@ -840,9 +840,7 @@ export default class SelectComponent extends ListComponent {
840
840
  }
841
841
  const tabIndex = input.tabIndex;
842
842
  this.addPlaceholder();
843
- if (this.i18next) {
844
- input.setAttribute('dir', this.i18next.dir());
845
- }
843
+ input.setAttribute('dir', this.i18next.dir());
846
844
  if (this.choices?.containerOuter?.element?.parentNode) {
847
845
  this.choices.destroy();
848
846
  }
@@ -1570,6 +1568,7 @@ export default class SelectComponent extends ListComponent {
1570
1568
  : '-';
1571
1569
  }
1572
1570
  detach() {
1571
+ super.detach();
1573
1572
  this.off('blur');
1574
1573
  if (this.choices) {
1575
1574
  if (this.choices.containerOuter?.element?.parentNode) {
@@ -1577,7 +1576,6 @@ export default class SelectComponent extends ListComponent {
1577
1576
  }
1578
1577
  this.choices = null;
1579
1578
  }
1580
- super.detach();
1581
1579
  }
1582
1580
  focus() {
1583
1581
  if (this.focusableElement) {
@@ -19,5 +19,6 @@ export default class TableComponent extends NestedComponent {
19
19
  noField: boolean;
20
20
  table: any[] | undefined;
21
21
  render(): any;
22
+ destroy(all: any): void;
22
23
  }
23
24
  import NestedComponent from '../_classes/nested/NestedComponent';
@@ -162,7 +162,7 @@ export default class TableComponent extends NestedComponent {
162
162
  });
163
163
  return superAttach;
164
164
  }
165
- destroy(all = false) {
165
+ destroy(all) {
166
166
  super.destroy(all);
167
167
  delete this.table;
168
168
  }
@@ -59,9 +59,7 @@ export default class TagsComponent extends Input {
59
59
  if (!element) {
60
60
  return;
61
61
  }
62
- if (this.i18next) {
63
- element.setAttribute('dir', this.i18next.dir());
64
- }
62
+ element.setAttribute('dir', this.i18next.dir());
65
63
  if (this.choices) {
66
64
  this.choices.destroy();
67
65
  }
@@ -108,11 +106,11 @@ export default class TagsComponent extends Input {
108
106
  });
109
107
  }
110
108
  detach() {
109
+ super.detach();
111
110
  if (this.choices) {
112
111
  this.choices.destroy();
113
112
  this.choices = null;
114
113
  }
115
- super.detach();
116
114
  }
117
115
  normalizeValue(value) {
118
116
  if (this.component.storeas === 'string' && Array.isArray(value)) {
@@ -71,6 +71,5 @@ declare namespace _default {
71
71
  let submitButtonAriaLabel: string;
72
72
  let reCaptchaTokenValidationError: string;
73
73
  let reCaptchaTokenNotSpecifiedError: string;
74
- let apiKey: string;
75
74
  }
76
75
  export default _default;
@@ -71,5 +71,4 @@ export default {
71
71
  submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
72
72
  reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
73
73
  reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
74
- apiKey: 'API Key is not unique: {{key}}'
75
74
  };
@@ -374,4 +374,4 @@ import jsonLogic from 'json-logic-js';
374
374
  import ConditionOperators from './conditionOperators';
375
375
  import Evaluator from './Evaluator';
376
376
  export const interpolate: (rawTemplate: any, data: any, _options: any) => any;
377
- export { jsonLogic, ConditionOperators, Evaluator, _ };
377
+ export { jsonLogic, moment, ConditionOperators, Evaluator, _ };
@@ -28,8 +28,7 @@ jsonLogic.add_operation('relativeMinDate', (relativeMinDate) => {
28
28
  jsonLogic.add_operation('relativeMaxDate', (relativeMaxDate) => {
29
29
  return moment().add(relativeMaxDate, 'days').toISOString();
30
30
  });
31
- export { jsonLogic, ConditionOperators };
32
- export * as moment from 'moment-timezone/moment-timezone';
31
+ export { jsonLogic, moment, ConditionOperators };
33
32
  function setPathToComponentAndPerentSchema(component) {
34
33
  component.path = getComponentPath(component);
35
34
  const dataParent = getDataParentComponent(component);
@@ -457,10 +457,10 @@ export default class CalendarWidget extends InputWidget {
457
457
  return Flatpickr.formatDate(date, format);
458
458
  };
459
459
  }
460
- destroy(all = false) {
460
+ destroy() {
461
+ super.destroy();
461
462
  if (this.calendar) {
462
463
  this.calendar.destroy();
463
464
  }
464
- super.destroy(all);
465
465
  }
466
466
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5613.3476921",
3
+ "version": "5.0.0-dev.5614.ea3660d",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {