@formio/js 5.0.0-bb.dev.3 → 5.0.0-bb.dev.4

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 (218) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +20 -19
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.full.js +20 -19
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  10. package/dist/formio.js +9 -8
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  14. package/lib/cjs/Form.js +1 -18
  15. package/lib/cjs/PDFBuilder.d.ts +1 -1
  16. package/lib/cjs/Webform.d.ts +1 -1
  17. package/lib/cjs/WebformBuilder.d.ts +4 -4
  18. package/lib/cjs/Wizard.d.ts +1 -2
  19. package/lib/cjs/WizardBuilder.d.ts +14 -2
  20. package/lib/cjs/components/Components.d.ts +6 -6
  21. package/lib/cjs/components/_classes/component/Component.d.ts +9 -4
  22. package/lib/cjs/components/_classes/component/Component.form.d.ts +1112 -1
  23. package/lib/cjs/components/_classes/component/Component.js +10 -4
  24. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +8 -0
  25. package/lib/cjs/components/_classes/component/editForm/utils.d.ts +2 -2
  26. package/lib/cjs/components/_classes/input/Input.d.ts +6 -2
  27. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +1112 -1
  28. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +1112 -1
  29. package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -2
  30. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -1
  31. package/lib/cjs/components/address/Address.form.d.ts +1112 -1
  32. package/lib/cjs/components/address/editForm/Address.edit.provider.d.ts +4 -1
  33. package/lib/cjs/components/button/Button.d.ts +1 -1
  34. package/lib/cjs/components/button/Button.form.d.ts +1112 -1
  35. package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
  36. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +1112 -1
  37. package/lib/cjs/components/columns/Columns.d.ts +2 -0
  38. package/lib/cjs/components/columns/Columns.form.d.ts +1112 -1
  39. package/lib/cjs/components/container/Container.form.d.ts +1112 -1
  40. package/lib/cjs/components/content/Content.form.d.ts +1112 -1
  41. package/lib/cjs/components/currency/Currency.form.d.ts +1112 -1
  42. package/lib/cjs/components/datagrid/DataGrid.d.ts +3 -3
  43. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +1112 -1
  44. package/lib/cjs/components/datagrid/DataGrid.js +2 -1
  45. package/lib/cjs/components/datagrid/fixtures/comp-with-allow-calculate-override.js +1 -1
  46. package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
  47. package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
  48. package/lib/cjs/components/datagrid/fixtures/two-comp-with-allow-calculate-override.d.ts +53 -0
  49. package/lib/cjs/components/datagrid/fixtures/two-comp-with-allow-calculate-override.js +104 -0
  50. package/lib/cjs/components/datamap/DataMap.d.ts +2 -1
  51. package/lib/cjs/components/datamap/DataMap.form.d.ts +1112 -1
  52. package/lib/cjs/components/datetime/DateTime.form.d.ts +1112 -1
  53. package/lib/cjs/components/day/Day.form.d.ts +1112 -1
  54. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +1112 -1
  55. package/lib/cjs/components/editgrid/EditGrid.js +7 -4
  56. package/lib/cjs/components/editgrid/fixtures/formsWithEditGridAndConditions.d.ts +910 -0
  57. package/lib/cjs/components/editgrid/fixtures/formsWithEditGridAndConditions.js +923 -0
  58. package/lib/cjs/components/email/Email.form.d.ts +1112 -1
  59. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +1112 -1
  60. package/lib/cjs/components/file/File.d.ts +2 -7
  61. package/lib/cjs/components/file/File.form.d.ts +1112 -1
  62. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +4 -1
  63. package/lib/cjs/components/form/Form.d.ts +1 -1
  64. package/lib/cjs/components/form/Form.form.d.ts +1112 -1
  65. package/lib/cjs/components/hidden/Hidden.form.d.ts +1112 -1
  66. package/lib/cjs/components/html/HTML.d.ts +1 -0
  67. package/lib/cjs/components/html/HTML.form.d.ts +1112 -1
  68. package/lib/cjs/components/html/HTML.js +9 -0
  69. package/lib/cjs/components/number/Number.form.d.ts +1112 -1
  70. package/lib/cjs/components/panel/Panel.form.d.ts +1112 -1
  71. package/lib/cjs/components/password/Password.d.ts +2 -0
  72. package/lib/cjs/components/password/Password.form.d.ts +1112 -1
  73. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +1112 -1
  74. package/lib/cjs/components/radio/Radio.d.ts +1 -1
  75. package/lib/cjs/components/radio/Radio.form.d.ts +1112 -1
  76. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +1112 -1
  77. package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -3
  78. package/lib/cjs/components/select/Select.d.ts +4 -5
  79. package/lib/cjs/components/select/Select.form.d.ts +1112 -1
  80. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -7
  81. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +1112 -1
  82. package/lib/cjs/components/signature/Signature.form.d.ts +1112 -1
  83. package/lib/cjs/components/survey/Survey.d.ts +1 -0
  84. package/lib/cjs/components/survey/Survey.form.d.ts +1112 -1
  85. package/lib/cjs/components/table/Table.d.ts +1 -0
  86. package/lib/cjs/components/table/Table.form.d.ts +1112 -1
  87. package/lib/cjs/components/tabs/Tabs.form.d.ts +1112 -1
  88. package/lib/cjs/components/tags/Tags.form.d.ts +1112 -1
  89. package/lib/cjs/components/textarea/TextArea.d.ts +1 -1
  90. package/lib/cjs/components/textarea/TextArea.form.d.ts +1112 -1
  91. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.d.ts +4 -1
  92. package/lib/cjs/components/textfield/TextField.form.d.ts +1112 -1
  93. package/lib/cjs/components/time/Time.form.d.ts +1112 -1
  94. package/lib/cjs/components/url/Url.form.d.ts +1112 -1
  95. package/lib/cjs/components/well/Well.form.d.ts +1112 -1
  96. package/lib/cjs/formio.form.d.ts +3 -3
  97. package/lib/cjs/formio.form.js +59 -46
  98. package/lib/cjs/providers/address/AddressProvider.d.ts +3 -3
  99. package/lib/cjs/providers/storage/s3.js +1 -29
  100. package/lib/cjs/providers/storage/xhr.d.ts +1 -1
  101. package/lib/cjs/translations/en.d.ts +2 -0
  102. package/lib/cjs/translations/en.js +2 -0
  103. package/lib/cjs/utils/builder.d.ts +1 -1
  104. package/lib/cjs/utils/conditionOperators/ConditionOperator.d.ts +1 -1
  105. package/lib/cjs/utils/conditionOperators/EndsWith.d.ts +1 -1
  106. package/lib/cjs/utils/conditionOperators/GreaterThan.d.ts +1 -1
  107. package/lib/cjs/utils/conditionOperators/GreaterThanOrEqual.d.ts +1 -1
  108. package/lib/cjs/utils/conditionOperators/Includes.d.ts +1 -1
  109. package/lib/cjs/utils/conditionOperators/LessThan.d.ts +1 -1
  110. package/lib/cjs/utils/conditionOperators/LessThanOrEqual.d.ts +1 -1
  111. package/lib/cjs/utils/conditionOperators/StartsWith.d.ts +1 -1
  112. package/lib/cjs/utils/conditionOperators/index.d.ts +2 -2
  113. package/lib/cjs/utils/utils.d.ts +4 -3
  114. package/lib/cjs/validator/Validator.d.ts +8 -3
  115. package/lib/cjs/validator/Validator.js +1 -1
  116. package/lib/mjs/Form.js +1 -18
  117. package/lib/mjs/PDFBuilder.d.ts +1 -1
  118. package/lib/mjs/Webform.d.ts +1 -1
  119. package/lib/mjs/WebformBuilder.d.ts +4 -4
  120. package/lib/mjs/Wizard.d.ts +1 -2
  121. package/lib/mjs/WizardBuilder.d.ts +14 -2
  122. package/lib/mjs/components/Components.d.ts +6 -6
  123. package/lib/mjs/components/_classes/component/Component.d.ts +9 -4
  124. package/lib/mjs/components/_classes/component/Component.form.d.ts +1112 -1
  125. package/lib/mjs/components/_classes/component/Component.js +10 -4
  126. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +8 -0
  127. package/lib/mjs/components/_classes/component/editForm/utils.d.ts +2 -2
  128. package/lib/mjs/components/_classes/input/Input.d.ts +6 -2
  129. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +1112 -1
  130. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +1112 -1
  131. package/lib/mjs/components/_classes/nested/NestedComponent.js +2 -2
  132. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -1
  133. package/lib/mjs/components/address/Address.form.d.ts +1112 -1
  134. package/lib/mjs/components/address/editForm/Address.edit.provider.d.ts +4 -1
  135. package/lib/mjs/components/button/Button.d.ts +1 -1
  136. package/lib/mjs/components/button/Button.form.d.ts +1112 -1
  137. package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
  138. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +1112 -1
  139. package/lib/mjs/components/columns/Columns.d.ts +2 -0
  140. package/lib/mjs/components/columns/Columns.form.d.ts +1112 -1
  141. package/lib/mjs/components/container/Container.form.d.ts +1112 -1
  142. package/lib/mjs/components/content/Content.form.d.ts +1112 -1
  143. package/lib/mjs/components/currency/Currency.form.d.ts +1112 -1
  144. package/lib/mjs/components/datagrid/DataGrid.d.ts +3 -3
  145. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +1112 -1
  146. package/lib/mjs/components/datagrid/DataGrid.js +2 -1
  147. package/lib/mjs/components/datagrid/fixtures/comp-with-allow-calculate-override.js +1 -1
  148. package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
  149. package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
  150. package/lib/mjs/components/datagrid/fixtures/two-comp-with-allow-calculate-override.d.ts +53 -0
  151. package/lib/mjs/components/datagrid/fixtures/two-comp-with-allow-calculate-override.js +102 -0
  152. package/lib/mjs/components/datamap/DataMap.d.ts +2 -1
  153. package/lib/mjs/components/datamap/DataMap.form.d.ts +1112 -1
  154. package/lib/mjs/components/datetime/DateTime.form.d.ts +1112 -1
  155. package/lib/mjs/components/day/Day.form.d.ts +1112 -1
  156. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +1112 -1
  157. package/lib/mjs/components/editgrid/EditGrid.js +7 -4
  158. package/lib/mjs/components/editgrid/fixtures/formsWithEditGridAndConditions.d.ts +910 -0
  159. package/lib/mjs/components/editgrid/fixtures/formsWithEditGridAndConditions.js +921 -0
  160. package/lib/mjs/components/email/Email.form.d.ts +1112 -1
  161. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +1112 -1
  162. package/lib/mjs/components/file/File.d.ts +2 -7
  163. package/lib/mjs/components/file/File.form.d.ts +1112 -1
  164. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +4 -1
  165. package/lib/mjs/components/form/Form.d.ts +1 -1
  166. package/lib/mjs/components/form/Form.form.d.ts +1112 -1
  167. package/lib/mjs/components/hidden/Hidden.form.d.ts +1112 -1
  168. package/lib/mjs/components/html/HTML.d.ts +1 -0
  169. package/lib/mjs/components/html/HTML.form.d.ts +1112 -1
  170. package/lib/mjs/components/html/HTML.js +8 -0
  171. package/lib/mjs/components/number/Number.form.d.ts +1112 -1
  172. package/lib/mjs/components/panel/Panel.form.d.ts +1112 -1
  173. package/lib/mjs/components/password/Password.d.ts +2 -0
  174. package/lib/mjs/components/password/Password.form.d.ts +1112 -1
  175. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +1112 -1
  176. package/lib/mjs/components/radio/Radio.d.ts +1 -1
  177. package/lib/mjs/components/radio/Radio.form.d.ts +1112 -1
  178. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +1112 -1
  179. package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -3
  180. package/lib/mjs/components/select/Select.d.ts +4 -5
  181. package/lib/mjs/components/select/Select.form.d.ts +1112 -1
  182. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -7
  183. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +1112 -1
  184. package/lib/mjs/components/signature/Signature.form.d.ts +1112 -1
  185. package/lib/mjs/components/survey/Survey.d.ts +1 -0
  186. package/lib/mjs/components/survey/Survey.form.d.ts +1112 -1
  187. package/lib/mjs/components/table/Table.d.ts +1 -0
  188. package/lib/mjs/components/table/Table.form.d.ts +1112 -1
  189. package/lib/mjs/components/tabs/Tabs.form.d.ts +1112 -1
  190. package/lib/mjs/components/tags/Tags.form.d.ts +1112 -1
  191. package/lib/mjs/components/textarea/TextArea.d.ts +1 -1
  192. package/lib/mjs/components/textarea/TextArea.form.d.ts +1112 -1
  193. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.d.ts +4 -1
  194. package/lib/mjs/components/textfield/TextField.form.d.ts +1112 -1
  195. package/lib/mjs/components/time/Time.form.d.ts +1112 -1
  196. package/lib/mjs/components/url/Url.form.d.ts +1112 -1
  197. package/lib/mjs/components/well/Well.form.d.ts +1112 -1
  198. package/lib/mjs/formio.form.d.ts +3 -3
  199. package/lib/mjs/formio.form.js +58 -44
  200. package/lib/mjs/providers/address/AddressProvider.d.ts +3 -3
  201. package/lib/mjs/providers/storage/s3.js +1 -6
  202. package/lib/mjs/providers/storage/xhr.d.ts +1 -1
  203. package/lib/mjs/translations/en.d.ts +2 -0
  204. package/lib/mjs/translations/en.js +2 -0
  205. package/lib/mjs/utils/builder.d.ts +1 -1
  206. package/lib/mjs/utils/conditionOperators/ConditionOperator.d.ts +1 -1
  207. package/lib/mjs/utils/conditionOperators/EndsWith.d.ts +1 -1
  208. package/lib/mjs/utils/conditionOperators/GreaterThan.d.ts +1 -1
  209. package/lib/mjs/utils/conditionOperators/GreaterThanOrEqual.d.ts +1 -1
  210. package/lib/mjs/utils/conditionOperators/Includes.d.ts +1 -1
  211. package/lib/mjs/utils/conditionOperators/LessThan.d.ts +1 -1
  212. package/lib/mjs/utils/conditionOperators/LessThanOrEqual.d.ts +1 -1
  213. package/lib/mjs/utils/conditionOperators/StartsWith.d.ts +1 -1
  214. package/lib/mjs/utils/conditionOperators/index.d.ts +2 -2
  215. package/lib/mjs/utils/utils.d.ts +4 -3
  216. package/lib/mjs/validator/Validator.d.ts +8 -3
  217. package/lib/mjs/validator/Validator.js +1 -1
  218. package/package.json +1 -1
@@ -18,7 +18,7 @@ import Transformers from './validator/transformers';
18
18
  import ValueSources from './validator/valueSources';
19
19
  import Utils from './utils';
20
20
  import Form from './Form';
21
- import { Formio } from './Formio';
21
+ declare const extendedFormio: typeof Formio;
22
22
  import Licenses from './licenses';
23
- import EventEmitter from './EventEmitter';
24
- export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, Formio, Licenses, EventEmitter };
23
+ import { Formio } from './Formio';
24
+ export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, extendedFormio as Formio, Licenses };
@@ -16,33 +16,33 @@ import Form from './Form';
16
16
  import Utils from './utils';
17
17
  import Evaluator from './utils/Evaluator';
18
18
  import Licenses from './licenses';
19
- import EventEmitter from './EventEmitter';
20
- Formio.loadModules = (path = `${Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
21
- Formio.requireLibrary(name, name, path, true)
19
+ const extendedFormio = Formio;
20
+ // This is needed to maintain correct imports using the "dist" file.
21
+ extendedFormio.Components = Components;
22
+ extendedFormio.Templates = Templates;
23
+ extendedFormio.Utils = Utils;
24
+ extendedFormio.Form = Form;
25
+ extendedFormio.Displays = Displays;
26
+ extendedFormio.Providers = Providers;
27
+ extendedFormio.Rules = Rules;
28
+ extendedFormio.Widgets = Widgets;
29
+ extendedFormio.Evaluator = Evaluator;
30
+ extendedFormio.Conjunctions = Conjunctions;
31
+ extendedFormio.Operators = Operators;
32
+ extendedFormio.QuickRules = QuickRules;
33
+ extendedFormio.Transformers = Transformers;
34
+ extendedFormio.ValueSources = ValueSources;
35
+ extendedFormio.AllComponents = AllComponents;
36
+ extendedFormio.Licenses = Licenses;
37
+ // This is strange, but is needed for "premium" components to import correctly.
38
+ extendedFormio.Formio = Formio;
39
+ extendedFormio.Components.setComponents(AllComponents);
40
+ extendedFormio.loadModules = (path = `${Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
41
+ extendedFormio.requireLibrary(name, name, path, true)
22
42
  .then((modules) => {
23
- Formio.use(modules);
43
+ extendedFormio.use(modules);
24
44
  });
25
45
  };
26
- // This is needed to maintain correct imports using the "dist" file.
27
- Formio.Components = Components;
28
- Formio.Templates = Templates;
29
- Formio.Utils = Utils;
30
- Formio.Form = Form;
31
- Formio.Displays = Displays;
32
- Formio.Providers = Providers;
33
- Formio.Rules = Rules;
34
- Formio.Widgets = Widgets;
35
- Formio.Evaluator = Evaluator;
36
- Formio.Conjunctions = Conjunctions;
37
- Formio.Operators = Operators;
38
- Formio.QuickRules = QuickRules;
39
- Formio.Transformers = Transformers;
40
- Formio.ValueSources = ValueSources;
41
- Formio.AllComponents = AllComponents;
42
- Formio.Licenses = Licenses;
43
- // This is strange, but is needed for "premium" components to import correctly.
44
- Formio.Formio = Formio;
45
- Formio.Components.setComponents(AllComponents);
46
46
  /**
47
47
  * Register a module
48
48
  * @param {*} plugin
@@ -54,63 +54,63 @@ export function registerModule(mod, defaultFn = null, options = {}) {
54
54
  return;
55
55
  }
56
56
  for (const key of Object.keys(mod)) {
57
- const current = mod.framework || Formio.Templates.framework || 'bootstrap';
57
+ const current = mod.framework || extendedFormio.Templates.framework || 'bootstrap';
58
58
  switch (key) {
59
59
  case 'options':
60
- Formio.options = _.merge(Formio.options, mod.options);
60
+ extendedFormio.options = _.merge(extendedFormio.options, mod.options);
61
61
  break;
62
62
  case 'templates':
63
63
  for (const framework of Object.keys(mod.templates)) {
64
- Formio.Templates.extendTemplate(framework, mod.templates[framework]);
64
+ extendedFormio.Templates.extendTemplate(framework, mod.templates[framework]);
65
65
  }
66
66
  if (mod.templates[current]) {
67
- Formio.Templates.current = mod.templates[current];
67
+ extendedFormio.Templates.current = mod.templates[current];
68
68
  }
69
69
  break;
70
70
  case 'components':
71
- Formio.Components.setComponents(mod.components);
71
+ extendedFormio.Components.setComponents(mod.components);
72
72
  break;
73
73
  case 'framework':
74
- Formio.Templates.framework = mod.framework;
74
+ extendedFormio.Templates.framework = mod.framework;
75
75
  break;
76
76
  case 'fetch':
77
77
  for (const name of Object.keys(mod.fetch)) {
78
- Formio.registerPlugin(mod.fetch[name], name);
78
+ extendedFormio.registerPlugin(mod.fetch[name], name);
79
79
  }
80
80
  break;
81
81
  case 'providers':
82
82
  for (const type of Object.keys(mod.providers)) {
83
- Formio.Providers.addProviders(type, mod.providers[type]);
83
+ extendedFormio.Providers.addProviders(type, mod.providers[type]);
84
84
  }
85
85
  break;
86
86
  case 'displays':
87
- Formio.Displays.addDisplays(mod.displays);
87
+ extendedFormio.Displays.addDisplays(mod.displays);
88
88
  break;
89
89
  case 'rules':
90
- Formio.Rules.addRules(mod.rules);
90
+ extendedFormio.Rules.addRules(mod.rules);
91
91
  break;
92
92
  case 'evaluator':
93
- Formio.Evaluator.registerEvaluator(mod.evaluator);
93
+ extendedFormio.Evaluator.registerEvaluator(mod.evaluator);
94
94
  break;
95
95
  case 'conjunctions':
96
- Formio.Conjunctions.addConjunctions(mod.conjunctions);
96
+ extendedFormio.Conjunctions.addConjunctions(mod.conjunctions);
97
97
  break;
98
98
  case 'operators':
99
- Formio.Operators.addOperators(mod.operators);
99
+ extendedFormio.Operators.addOperators(mod.operators);
100
100
  break;
101
101
  case 'quickRules':
102
- Formio.QuickRules.addQuickRules(mod.quickRules);
102
+ extendedFormio.QuickRules.addQuickRules(mod.quickRules);
103
103
  break;
104
104
  case 'transformers':
105
- Formio.Transformers.addTransformers(mod.transformers);
105
+ extendedFormio.Transformers.addTransformers(mod.transformers);
106
106
  break;
107
107
  case 'valueSources':
108
- Formio.ValueSources.addValueSources(mod.valueSources);
108
+ extendedFormio.ValueSources.addValueSources(mod.valueSources);
109
109
  break;
110
110
  case 'library':
111
111
  options.license
112
- ? Formio.Licenses.addLicense(mod.library, options.license)
113
- : Formio.Licenses.removeLicense(mod.library);
112
+ ? extendedFormio.Licenses.addLicense(mod.library, options.license)
113
+ : extendedFormio.Licenses.removeLicense(mod.library);
114
114
  break;
115
115
  default:
116
116
  if (defaultFn) {
@@ -142,6 +142,20 @@ export function useModule(defaultFn = null) {
142
142
  * Formio.plugins(plugin1, options);
143
143
  * Formio.plugins([plugin1, plugin2, etc], options);
144
144
  */
145
- Formio.use = useModule();
145
+ extendedFormio.use = useModule();
146
+ // Allow simple embedding.
147
+ extendedFormio.embedForm = (embed) => Form.embed(embed);
148
+ /**
149
+ * Factory that creates a new form based on the form parameters.
150
+ *
151
+ * @param element {HMTLElement} - The HTML Element to add this form to.
152
+ * @param form {string|Object} - The src of the form, or a form object.
153
+ * @param options {Object} - The options to create this form.
154
+ *
155
+ * @return {Promise} - When the form is instance is ready.
156
+ */
157
+ extendedFormio.createForm = (...args) => {
158
+ return (new Form(...args)).ready;
159
+ };
146
160
  // Export the components.
147
- export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, Formio, Licenses, EventEmitter };
161
+ export { Components, Displays, Providers, Rules, Widgets, Templates, Conjunctions, Operators, QuickRules, Transformers, ValueSources, Utils, Form, extendedFormio as Formio, Licenses };
@@ -2,14 +2,14 @@ export class AddressProvider {
2
2
  static get name(): string;
3
3
  static get displayName(): string;
4
4
  constructor(options?: {});
5
- options: any;
5
+ options: {};
6
6
  beforeMergeOptions(): void;
7
7
  get defaultOptions(): {};
8
8
  get queryProperty(): string;
9
9
  get responseProperty(): null;
10
10
  get displayValueProperty(): null;
11
- serialize(params: any): any;
12
- getRequestOptions(options?: {}): any;
11
+ serialize(params: any): string;
12
+ getRequestOptions(options?: {}): {};
13
13
  getRequestUrl(options?: {}): void;
14
14
  makeRequest(options?: {}): any;
15
15
  search(query: any, options?: {}): any;
@@ -1,10 +1,6 @@
1
1
  import XHR from './xhr';
2
2
  import { withRetries } from './util';
3
- const loadAbortControllerPolyfill = async () => {
4
- if (typeof AbortController === 'undefined') {
5
- await import('abortcontroller-polyfill/dist/polyfill-patch-fetch');
6
- }
7
- };
3
+ const AbortController = window.AbortController || require('abortcontroller-polyfill/dist/cjs-ponyfill');
8
4
  function s3(formio) {
9
5
  return {
10
6
  async uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions) {
@@ -14,7 +10,6 @@ function s3(formio) {
14
10
  if (response.signed) {
15
11
  if (multipartOptions && Array.isArray(response.signed)) {
16
12
  // patch abort callback
17
- await loadAbortControllerPolyfill();
18
13
  const abortController = new AbortController();
19
14
  const abortSignal = abortController.signal;
20
15
  if (typeof abortCallback === 'function') {
@@ -1,7 +1,7 @@
1
1
  export function setXhrHeaders(formio: any, xhr: any): void;
2
2
  export default XHR;
3
3
  declare namespace XHR {
4
- function trim(text: any): any;
4
+ function trim(text: any): string;
5
5
  function path(items: any): any;
6
6
  function upload(formio: any, type: any, xhrCallback: any, file: any, fileName: any, dir: any, progressCallback: any, groupPermissions: any, groupId: any, abortCallback: any, multipartOptions: any): Promise<any>;
7
7
  function makeXhrRequest(formio: any, xhrCallback: any, serverResponse: any, progressCallback: any, abortCallback: any): Promise<any>;
@@ -62,5 +62,7 @@ declare namespace _default {
62
62
  const previousButtonAriaLabel: string;
63
63
  const nextButtonAriaLabel: string;
64
64
  const submitButtonAriaLabel: string;
65
+ const reCaptchaTokenValidationError: string;
66
+ const reCaptchaTokenNotSpecifiedError: string;
65
67
  }
66
68
  export default _default;
@@ -62,4 +62,6 @@ export default {
62
62
  previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab',
63
63
  nextButtonAriaLabel: 'Next button. Click to go to the next tab',
64
64
  submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
65
+ reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
66
+ reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
65
67
  };
@@ -11,7 +11,7 @@ declare namespace _default {
11
11
  namespace additionalShortcuts {
12
12
  const button: string[];
13
13
  }
14
- function getAlphaShortcuts(): any;
14
+ function getAlphaShortcuts(): string[];
15
15
  function getAdditionalShortcuts(type: any): any;
16
16
  function getBindedShortcuts(components: any, input: any): any[];
17
17
  function getAvailableShortcuts(form: any, component: any): {
@@ -3,5 +3,5 @@ export default class ConditionOperator {
3
3
  static get displayedName(): string;
4
4
  static get requireValue(): boolean;
5
5
  execute(options: any): boolean;
6
- getResult(options?: {}): any;
6
+ getResult(options?: {}): boolean;
7
7
  }
@@ -2,6 +2,6 @@ export default class EndsWith extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -2,6 +2,6 @@ export default class GeaterThan extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -2,6 +2,6 @@ export default class GreaterThanOrEqual extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -2,6 +2,6 @@ export default class Includes extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -2,6 +2,6 @@ export default class LessThan extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -2,6 +2,6 @@ export default class LessThanOrEqual extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -2,6 +2,6 @@ export default class StartsWith extends ConditionOperator {
2
2
  execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- }): any;
5
+ }): boolean;
6
6
  }
7
7
  import ConditionOperator from './ConditionOperator';
@@ -1,6 +1,6 @@
1
1
  export default ConditionOperators;
2
2
  declare const ConditionOperators: {
3
- [x: string]: typeof IsEqualTo | typeof DateGreaterThan;
3
+ [x: string]: typeof IsEmptyValue | typeof DateGreaterThan;
4
4
  };
5
- import IsEqualTo from './IsEqualTo';
5
+ import IsEmptyValue from './IsEmptyValue';
6
6
  import DateGreaterThan from './DateGreaterThan';
@@ -130,7 +130,7 @@ export function guid(): string;
130
130
  * @return {(null|Date)}
131
131
  */
132
132
  export function getDateSetting(date: any): (null | Date);
133
- export function isValidDate(date: any): any;
133
+ export function isValidDate(date: any): boolean;
134
134
  /**
135
135
  * Get the current timezone string.
136
136
  *
@@ -305,7 +305,7 @@ export function sanitize(string: any, options: any): any;
305
305
  */
306
306
  export function fastCloneDeep(obj: any): any;
307
307
  export function isInputComponent(componentJson: any): any;
308
- export function getArrayFromComponentPath(pathStr: any): any;
308
+ export function getArrayFromComponentPath(pathStr: any): any[];
309
309
  export function hasInvalidComponent(component: any): any;
310
310
  export function getStringFromComponentPath(path: any): any;
311
311
  export function round(number: any, precision: any): any;
@@ -359,7 +359,7 @@ export * from "./formUtils";
359
359
  *
360
360
  * @return {T}
361
361
  */
362
- export const firstNonNil: any;
362
+ export const firstNonNil: (...args: any[]) => any;
363
363
  export namespace componentValueTypes {
364
364
  const number: string;
365
365
  const string: string;
@@ -373,4 +373,5 @@ import jsonLogic from 'json-logic-js';
373
373
  import ConditionOperators from './conditionOperators';
374
374
  import Evaluator from './Evaluator';
375
375
  export const interpolate: (rawTemplate: any, data: any, _options: any) => any;
376
+ import _ from 'lodash';
376
377
  export { jsonLogic, ConditionOperators, Evaluator, _ };
@@ -1,7 +1,12 @@
1
1
  declare const instance: ValidationChecker;
2
2
  export class ValidationChecker {
3
3
  constructor(config?: {});
4
- config: any;
4
+ config: {
5
+ db: null;
6
+ token: null;
7
+ form: null;
8
+ submission: null;
9
+ };
5
10
  validators: {
6
11
  required: {
7
12
  key: string;
@@ -173,7 +178,7 @@ export class ValidationChecker {
173
178
  validate(component: any, validatorName: any, value: any, data: any, index: any, row: any, async: any, conditionallyVisible: any, validationObj: any): false | {
174
179
  message: string;
175
180
  level: string;
176
- path: any;
181
+ path: any[];
177
182
  context: {
178
183
  validator: any;
179
184
  hasLabel: any;
@@ -187,7 +192,7 @@ export class ValidationChecker {
187
192
  } | Promise<false | {
188
193
  message: string;
189
194
  level: string;
190
- path: any;
195
+ path: any[];
191
196
  context: {
192
197
  validator: any;
193
198
  hasLabel: any;
@@ -853,7 +853,7 @@ class ValidationChecker {
853
853
  }
854
854
  validate(component, validatorName, value, data, index, row, async, conditionallyVisible, validationObj) {
855
855
  // Skip validation for conditionally hidden components
856
- if (!conditionallyVisible) {
856
+ if (!conditionallyVisible && !_.get(component.component, 'validateWhenHidden', false)) {
857
857
  return false;
858
858
  }
859
859
  const validator = this.validators[validatorName];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-bb.dev.3",
3
+ "version": "5.0.0-bb.dev.4",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",