@formio/js 5.0.0-dev.5723.99bf27e → 5.0.0-dev.5725.d52e1c4

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 (149) hide show
  1. package/Changelog.md +33 -0
  2. package/dist/formio.embed.js +1 -1
  3. package/dist/formio.embed.min.js +1 -1
  4. package/dist/formio.form.js +53 -33
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +2 -0
  7. package/dist/formio.full.js +59 -39
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +2 -0
  10. package/dist/formio.js +1 -1
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.utils.js +24 -4
  13. package/dist/formio.utils.min.js +1 -1
  14. package/dist/formio.utils.min.js.LICENSE.txt +2 -0
  15. package/lib/cjs/CDN.js +1 -2
  16. package/lib/cjs/Form.d.ts +2 -2
  17. package/lib/cjs/Form.js +11 -5
  18. package/lib/cjs/PDF.js +1 -1
  19. package/lib/cjs/PDFBuilder.js +2 -1
  20. package/lib/cjs/Webform.js +0 -1
  21. package/lib/cjs/WebformBuilder.js +8 -2
  22. package/lib/cjs/Wizard.js +1 -1
  23. package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
  24. package/lib/cjs/components/_classes/component/Component.js +5 -4
  25. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
  26. package/lib/cjs/components/_classes/multivalue/Multivalue.js +43 -25
  27. package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -1
  28. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  29. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
  30. package/lib/cjs/components/address/Address.d.ts +6 -0
  31. package/lib/cjs/components/address/Address.js +7 -1
  32. package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -1
  33. package/lib/cjs/components/datagrid/DataGrid.js +2 -9
  34. package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  35. package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
  36. package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
  37. package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
  38. package/lib/cjs/components/datamap/DataMap.js +1 -1
  39. package/lib/cjs/components/day/Day.d.ts +3 -4
  40. package/lib/cjs/components/day/Day.js +31 -10
  41. package/lib/cjs/components/editgrid/EditGrid.js +2 -5
  42. package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  43. package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
  44. package/lib/cjs/components/editgrid/fixtures/index.d.ts +8 -7
  45. package/lib/cjs/components/editgrid/fixtures/index.js +3 -1
  46. package/lib/cjs/components/file/File.d.ts +2 -2
  47. package/lib/cjs/components/file/File.js +13 -2
  48. package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
  49. package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
  50. package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
  51. package/lib/cjs/components/form/fixtures/index.js +3 -1
  52. package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  53. package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
  54. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  55. package/lib/cjs/components/panel/Panel.js +1 -0
  56. package/lib/cjs/components/radio/Radio.d.ts +2 -18
  57. package/lib/cjs/components/radio/Radio.js +29 -27
  58. package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
  59. package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
  60. package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
  61. package/lib/cjs/components/radio/fixtures/index.js +3 -1
  62. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  63. package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
  64. package/lib/cjs/components/select/Select.d.ts +38 -0
  65. package/lib/cjs/components/select/Select.js +13 -3
  66. package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
  67. package/lib/cjs/components/select/fixtures/comp25.js +66 -0
  68. package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
  69. package/lib/cjs/components/select/fixtures/comp26.js +59 -0
  70. package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
  71. package/lib/cjs/components/select/fixtures/index.js +5 -1
  72. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  73. package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
  74. package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  75. package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
  76. package/lib/cjs/components/tags/Tags.js +3 -3
  77. package/lib/cjs/components/time/Time.form.js +2 -2
  78. package/lib/cjs/components/time/Time.js +0 -5
  79. package/lib/cjs/templates/Templates.js +1 -1
  80. package/lib/cjs/translations/en.d.ts +1 -0
  81. package/lib/cjs/translations/en.js +1 -0
  82. package/lib/mjs/CDN.js +1 -2
  83. package/lib/mjs/Form.d.ts +2 -2
  84. package/lib/mjs/Form.js +11 -5
  85. package/lib/mjs/PDF.js +1 -1
  86. package/lib/mjs/PDFBuilder.js +1 -1
  87. package/lib/mjs/Webform.js +0 -1
  88. package/lib/mjs/WebformBuilder.js +7 -2
  89. package/lib/mjs/Wizard.js +1 -1
  90. package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
  91. package/lib/mjs/components/_classes/component/Component.js +2 -1
  92. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
  93. package/lib/mjs/components/_classes/multivalue/Multivalue.js +43 -25
  94. package/lib/mjs/components/_classes/nested/NestedComponent.js +2 -1
  95. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  96. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
  97. package/lib/mjs/components/address/Address.d.ts +6 -0
  98. package/lib/mjs/components/address/Address.js +10 -1
  99. package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -1
  100. package/lib/mjs/components/datagrid/DataGrid.js +2 -9
  101. package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  102. package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
  103. package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
  104. package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
  105. package/lib/mjs/components/datamap/DataMap.js +1 -1
  106. package/lib/mjs/components/day/Day.d.ts +3 -4
  107. package/lib/mjs/components/day/Day.js +30 -10
  108. package/lib/mjs/components/editgrid/EditGrid.js +2 -5
  109. package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  110. package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
  111. package/lib/mjs/components/editgrid/fixtures/index.d.ts +8 -7
  112. package/lib/mjs/components/editgrid/fixtures/index.js +2 -1
  113. package/lib/mjs/components/file/File.d.ts +2 -2
  114. package/lib/mjs/components/file/File.js +13 -2
  115. package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
  116. package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
  117. package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
  118. package/lib/mjs/components/form/fixtures/index.js +2 -1
  119. package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  120. package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
  121. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  122. package/lib/mjs/components/panel/Panel.js +1 -0
  123. package/lib/mjs/components/radio/Radio.d.ts +2 -18
  124. package/lib/mjs/components/radio/Radio.js +32 -30
  125. package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
  126. package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
  127. package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
  128. package/lib/mjs/components/radio/fixtures/index.js +2 -1
  129. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  130. package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
  131. package/lib/mjs/components/select/Select.d.ts +38 -0
  132. package/lib/mjs/components/select/Select.js +16 -4
  133. package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
  134. package/lib/mjs/components/select/fixtures/comp25.js +64 -0
  135. package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
  136. package/lib/mjs/components/select/fixtures/comp26.js +57 -0
  137. package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
  138. package/lib/mjs/components/select/fixtures/index.js +3 -1
  139. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  140. package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
  141. package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  142. package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
  143. package/lib/mjs/components/tags/Tags.js +3 -3
  144. package/lib/mjs/components/time/Time.form.js +2 -2
  145. package/lib/mjs/components/time/Time.js +0 -11
  146. package/lib/mjs/templates/Templates.js +1 -1
  147. package/lib/mjs/translations/en.d.ts +1 -0
  148. package/lib/mjs/translations/en.js +1 -0
  149. package/package.json +4 -4
@@ -0,0 +1,53 @@
1
+ export default {
2
+ title: 'Select in Data Grid',
3
+ name: 'selectInDataGrid',
4
+ path: 'selectInDataGrid',
5
+ type: 'form',
6
+ display: 'form',
7
+ components: [
8
+ {
9
+ label: 'Data Grid',
10
+ reorder: false,
11
+ addAnotherPosition: 'bottom',
12
+ layoutFixed: false,
13
+ enableRowGroups: false,
14
+ initEmpty: false,
15
+ tableView: false,
16
+ key: 'dataGrid',
17
+ type: 'datagrid',
18
+ input: true,
19
+ components: [
20
+ {
21
+ label: 'Select',
22
+ widget: 'choicesjs',
23
+ tableView: true,
24
+ data: {
25
+ values: [
26
+ {
27
+ label: 'Individual',
28
+ value: 'individual'
29
+ },
30
+ {
31
+ label: 'Entity',
32
+ value: 'entity'
33
+ }
34
+ ]
35
+ },
36
+ validateWhenHidden: false,
37
+ key: 'select',
38
+ type: 'select',
39
+ input: true,
40
+ defaultValue: 'entity'
41
+ },
42
+ ]
43
+ },
44
+ {
45
+ type: 'button',
46
+ label: 'Submit',
47
+ key: 'submit',
48
+ disableOnInvalid: true,
49
+ input: true,
50
+ tableView: false
51
+ }
52
+ ]
53
+ };
@@ -8,6 +8,7 @@ import comp7 from './comp7';
8
8
  import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
10
  import comp10 from './comp10';
11
+ import comp11 from './comp11';
11
12
  import withCollapsibleRowGroups from './comp-with-collapsible-groups';
12
13
  import withConditionalFieldsAndValidations from './comp-with-conditional-components-and-validations';
13
14
  import withDefValue from './comp-with-def-value';
@@ -18,4 +19,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
18
19
  import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
19
20
  import withCheckboxes from './comp-with-checkboxes';
20
21
  import withReorder from './comp-with-reorder';
21
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
22
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
@@ -8,6 +8,7 @@ import comp7 from './comp7';
8
8
  import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
10
  import comp10 from './comp10';
11
+ import comp11 from './comp11';
11
12
  import withDefValue from './comp-with-def-value';
12
13
  import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
13
14
  import modalWithRequiredFields from './comp-modal-with-required-fields';
@@ -18,4 +19,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
18
19
  import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
19
20
  import withCheckboxes from './comp-with-checkboxes';
20
21
  import withReorder from './comp-with-reorder';
21
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
22
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
@@ -236,7 +236,7 @@ export default class DataMapComponent extends DataGridComponent {
236
236
  delete dataValue[key];
237
237
  const comp = components[this.valueKey];
238
238
  comp.component.key = newKey;
239
- comp.path = Components.calculateComponentPath(comp);
239
+ comp.path = Components.getComponentPath(comp);
240
240
  key = newKey;
241
241
  });
242
242
  const valueComponent = _.clone(this.component.valueComponent);
@@ -17,9 +17,9 @@ export default class DayComponent extends Field {
17
17
  constructor(component: any, options: any, data: any);
18
18
  /**
19
19
  * The empty value for day component.
20
- * @returns {'00/00/0000'} - The empty value of the day component.
20
+ * @returns {''} - The empty value of the day component.
21
21
  */
22
- get emptyValue(): "00/00/0000";
22
+ get emptyValue(): "";
23
23
  get valueMask(): RegExp;
24
24
  get dayRequired(): any;
25
25
  get showDay(): boolean;
@@ -130,8 +130,7 @@ export default class DayComponent extends Field {
130
130
  * @returns {string|null} - The string value of the date.
131
131
  */
132
132
  getValueAsString(value: any): string | null;
133
- focus(field: any): void;
134
133
  isPartialDay(value: any): boolean;
135
- getValidationFormat(): "DD-MM-YYYY" | "MM-DD-YYYY";
134
+ getValidationFormat(): string;
136
135
  }
137
136
  import Field from '../_classes/field/Field';
@@ -25,7 +25,8 @@ export default class DayComponent extends Field {
25
25
  required: false
26
26
  }
27
27
  },
28
- dayFirst: false
28
+ dayFirst: false,
29
+ defaultValue: ''
29
30
  }, ...extend);
30
31
  }
31
32
  static get builderInfo() {
@@ -62,10 +63,10 @@ export default class DayComponent extends Field {
62
63
  }
63
64
  /**
64
65
  * The empty value for day component.
65
- * @returns {'00/00/0000'} - The empty value of the day component.
66
+ * @returns {''} - The empty value of the day component.
66
67
  */
67
68
  get emptyValue() {
68
- return '00/00/0000';
69
+ return '';
69
70
  }
70
71
  get valueMask() {
71
72
  return /^\d{2}\/\d{2}\/\d{4}$/;
@@ -341,15 +342,21 @@ export default class DayComponent extends Field {
341
342
  const valueParts = value.split('/');
342
343
  const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
343
344
  const defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';
344
- const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);
345
+ const getNextPart = (shouldTake, defaultValue) => {
346
+ // Only push the part if it's not an empty string
347
+ const part = shouldTake ? valueParts.shift() : defaultValue;
348
+ if (part !== '') {
349
+ dateParts.push(part);
350
+ }
351
+ };
345
352
  if (this.dayFirst) {
346
- getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');
353
+ getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
347
354
  }
348
- getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');
355
+ getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '');
349
356
  if (!this.dayFirst) {
350
- getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');
357
+ getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
351
358
  }
352
- getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');
359
+ getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '');
353
360
  return dateParts.join('/');
354
361
  }
355
362
  /**
@@ -361,7 +368,7 @@ export default class DayComponent extends Field {
361
368
  setValueAt(index, value) {
362
369
  // temporary solution to avoid input reset
363
370
  // on invalid date.
364
- if (!value || value === 'Invalid date') {
371
+ if (value === 'Invalid date') {
365
372
  return null;
366
373
  }
367
374
  const parts = value.split('/');
@@ -554,9 +561,22 @@ export default class DayComponent extends Field {
554
561
  }
555
562
  const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
556
563
  const values = value.split('/');
564
+ if (values.length < 3) {
565
+ return true;
566
+ }
557
567
  return (values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000');
558
568
  }
559
569
  getValidationFormat() {
560
- return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';
570
+ let validationFormat = this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';
571
+ if (this.fields?.day?.hide) {
572
+ validationFormat = validationFormat.replace('DD-', '');
573
+ }
574
+ if (this.fields?.month?.hide) {
575
+ validationFormat = validationFormat.replace('MM-', '');
576
+ }
577
+ if (this.fields?.year?.hide) {
578
+ validationFormat = validationFormat.replace('-YYYY', '');
579
+ }
580
+ return validationFormat;
561
581
  }
562
582
  }
@@ -484,11 +484,7 @@ export default class EditGridComponent extends NestedArrayComponent {
484
484
  else {
485
485
  this.removeClass(this.refs.component, `formio-component-${this.component.type}-row-open`);
486
486
  }
487
- const superAttach = super.attach(element);
488
- this.loadRefs(element, {
489
- messageContainer: 'single-scope',
490
- });
491
- return superAttach;
487
+ return super.attach(element);
492
488
  }
493
489
  flattenRowDataValue(dataValue) {
494
490
  const flattened = {};
@@ -889,6 +885,7 @@ export default class EditGridComponent extends NestedArrayComponent {
889
885
  }
890
886
  this.clearErrors(rowIndex);
891
887
  this.baseRemoveRow(rowIndex);
888
+ this.removeSubmissionMetadataRow(rowIndex);
892
889
  this.splice(rowIndex);
893
890
  this.emit('editGridDeleteRow', {
894
891
  index: rowIndex
@@ -0,0 +1,80 @@
1
+ declare namespace _default {
2
+ let type: string;
3
+ let display: string;
4
+ let components: ({
5
+ label: string;
6
+ tableView: boolean;
7
+ rowDrafts: boolean;
8
+ key: string;
9
+ type: string;
10
+ input: boolean;
11
+ components: {
12
+ collapsible: boolean;
13
+ key: string;
14
+ type: string;
15
+ label: string;
16
+ input: boolean;
17
+ tableView: boolean;
18
+ components: {
19
+ label: string;
20
+ columns: ({
21
+ components: {
22
+ label: string;
23
+ optionsLabelPosition: string;
24
+ inline: boolean;
25
+ tableView: boolean;
26
+ values: {
27
+ label: string;
28
+ value: string;
29
+ shortcut: string;
30
+ }[];
31
+ key: string;
32
+ type: string;
33
+ input: boolean;
34
+ }[];
35
+ width: number;
36
+ offset: number;
37
+ push: number;
38
+ pull: number;
39
+ size: string;
40
+ currentWidth: number;
41
+ } | {
42
+ components: {
43
+ label: string;
44
+ applyMaskOn: string;
45
+ autoExpand: boolean;
46
+ tableView: boolean;
47
+ key: string;
48
+ conditional: {
49
+ show: boolean;
50
+ conjunction: string;
51
+ };
52
+ type: string;
53
+ input: boolean;
54
+ }[];
55
+ width: number;
56
+ offset: number;
57
+ push: number;
58
+ pull: number;
59
+ size: string;
60
+ currentWidth: number;
61
+ })[];
62
+ key: string;
63
+ type: string;
64
+ input: boolean;
65
+ tableView: boolean;
66
+ }[];
67
+ }[];
68
+ disableOnInvalid?: undefined;
69
+ } | {
70
+ type: string;
71
+ label: string;
72
+ key: string;
73
+ disableOnInvalid: boolean;
74
+ input: boolean;
75
+ tableView: boolean;
76
+ rowDrafts?: undefined;
77
+ components?: undefined;
78
+ })[];
79
+ }
80
+ export default _default;
@@ -0,0 +1,97 @@
1
+ export default {
2
+ type: 'form',
3
+ display: 'form',
4
+ components: [
5
+ {
6
+ label: 'Edit Grid',
7
+ tableView: false,
8
+ rowDrafts: false,
9
+ key: 'editGrid',
10
+ type: 'editgrid',
11
+ input: true,
12
+ components: [
13
+ {
14
+ collapsible: false,
15
+ key: 'panel',
16
+ type: 'panel',
17
+ label: 'Panel',
18
+ input: false,
19
+ tableView: false,
20
+ components: [
21
+ {
22
+ label: 'Columns',
23
+ columns: [
24
+ {
25
+ components: [
26
+ {
27
+ label: 'Radio',
28
+ optionsLabelPosition: 'right',
29
+ inline: false,
30
+ tableView: true,
31
+ values: [
32
+ {
33
+ label: 'yes',
34
+ value: 'yes',
35
+ shortcut: ''
36
+ },
37
+ {
38
+ label: 'no',
39
+ value: 'no',
40
+ shortcut: ''
41
+ }
42
+ ],
43
+ key: 'radio',
44
+ type: 'radio',
45
+ input: true
46
+ }
47
+ ],
48
+ width: 6,
49
+ offset: 0,
50
+ push: 0,
51
+ pull: 0,
52
+ size: 'md',
53
+ currentWidth: 6
54
+ },
55
+ {
56
+ components: [
57
+ {
58
+ label: 'Text Area',
59
+ applyMaskOn: 'change',
60
+ autoExpand: false,
61
+ tableView: true,
62
+ key: 'textArea',
63
+ conditional: {
64
+ show: true,
65
+ conjunction: 'all'
66
+ },
67
+ type: 'textarea',
68
+ input: true
69
+ }
70
+ ],
71
+ width: 6,
72
+ offset: 0,
73
+ push: 0,
74
+ pull: 0,
75
+ size: 'md',
76
+ currentWidth: 6
77
+ }
78
+ ],
79
+ key: 'columns',
80
+ type: 'columns',
81
+ input: false,
82
+ tableView: false
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ type: 'button',
90
+ label: 'Submit',
91
+ key: 'submit',
92
+ disableOnInvalid: true,
93
+ input: true,
94
+ tableView: false
95
+ }
96
+ ]
97
+ };
@@ -1,21 +1,22 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
- import comp10 from './comp10';
5
- import comp11 from './comp11';
6
- import comp12 from './comp12';
7
- import comp13 from './comp13';
8
- import comp14 from './comp14';
9
- import comp15 from './comp15';
10
4
  import comp4 from './comp4';
11
5
  import comp5 from './comp5';
12
6
  import comp6 from './comp6';
13
7
  import comp7 from './comp7';
14
8
  import comp8 from './comp8';
15
9
  import comp9 from './comp9';
10
+ import comp10 from './comp10';
11
+ import comp11 from './comp11';
12
+ import comp12 from './comp12';
13
+ import comp13 from './comp13';
14
+ import comp14 from './comp14';
15
+ import comp15 from './comp15';
16
16
  import comp16 from './comp16';
17
+ import comp17 from './comp17';
17
18
  import compOpenWhenEmpty from './comp-openWhenEmpty';
18
19
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
19
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
21
  import compTestEvents from './comp-test-events';
21
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
22
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -14,8 +14,9 @@ import comp13 from './comp13';
14
14
  import comp14 from './comp14';
15
15
  import comp15 from './comp15';
16
16
  import comp16 from './comp16';
17
+ import comp17 from './comp17';
17
18
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
18
19
  import compOpenWhenEmpty from './comp-openWhenEmpty';
19
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
21
  import compTestEvents from './comp-test-events';
21
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
22
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -33,12 +33,12 @@ export default class FileComponent extends Field {
33
33
  get dataReady(): Promise<any>;
34
34
  loadImage(fileInfo: any): any;
35
35
  get emptyValue(): never[];
36
- getValueAsString(value: any): any;
36
+ getValueAsString(value: any, options: any): any;
37
37
  get defaultValue(): any[];
38
38
  get hasTypes(): any;
39
39
  _fileBrowseHidden: any;
40
40
  get shouldSyncFiles(): boolean;
41
- get autoSync(): any;
41
+ get autoSync(): boolean;
42
42
  get columnsSize(): {
43
43
  name: number;
44
44
  size: number;
@@ -103,7 +103,12 @@ export default class FileComponent extends Field {
103
103
  get emptyValue() {
104
104
  return [];
105
105
  }
106
- getValueAsString(value) {
106
+ getValueAsString(value, options) {
107
+ if (options?.review && !this.component.uploadOnly) {
108
+ return _.map(value, (val, index) => {
109
+ return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
110
+ }).join(', ');
111
+ }
107
112
  if (_.isArray(value)) {
108
113
  return _.map(value, 'originalName').join(', ');
109
114
  }
@@ -135,7 +140,9 @@ export default class FileComponent extends Field {
135
140
  return Boolean(this.filesToSync.filesToDelete.length || this.filesToSync.filesToUpload.length);
136
141
  }
137
142
  get autoSync() {
138
- return _.get(this, 'component.autoSync', false);
143
+ // Disable autoSync for now
144
+ return false;
145
+ // return _.get(this, 'component.autoSync', false);
139
146
  }
140
147
  get columnsSize() {
141
148
  const actionsColumn = this.disabled ? 0 : this.autoSync ? 2 : 1;
@@ -931,6 +938,10 @@ export default class FileComponent extends Field {
931
938
  : response.type === 'abort'
932
939
  ? this.t('Request was aborted')
933
940
  : response.toString();
941
+ this.emit('fileUploadError', {
942
+ fileToSync,
943
+ response,
944
+ });
934
945
  }
935
946
  finally {
936
947
  delete fileToSync.progress;
@@ -4,7 +4,7 @@ export default [
4
4
  ignore: true
5
5
  },
6
6
  {
7
- type: 'checkbox',
7
+ type: 'hidden',
8
8
  label: 'Files Synchronization feature',
9
9
  tooltip: 'Enable ability to control files synchronization. Files will be auto synced before submit.',
10
10
  key: 'autoSync',
@@ -44,7 +44,7 @@ export default [
44
44
  },
45
45
  searchField: 'title__regex',
46
46
  template: '<span>{{ item._vid }}</span>',
47
- valueProperty: '_id',
47
+ valueProperty: 'revisionId',
48
48
  authenticate: true,
49
49
  label: 'Form Revision',
50
50
  key: 'revision',
@@ -7,4 +7,5 @@ import comp5 from './comp5';
7
7
  import comp6 from './comp6';
8
8
  import comp7 from './comp7';
9
9
  import comp8 from './comp8';
10
- export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
10
+ import nestedWizardForm from './nestedWizardForm';
11
+ export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, nestedWizardForm };
@@ -7,4 +7,5 @@ import comp5 from './comp5';
7
7
  import comp6 from './comp6';
8
8
  import comp7 from './comp7';
9
9
  import comp8 from './comp8';
10
- export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
10
+ import nestedWizardForm from './nestedWizardForm';
11
+ export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, nestedWizardForm };