@formio/js 5.0.0-rc.19 → 5.0.0-rc.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (325) hide show
  1. package/README.md +1 -1
  2. package/dist/formio.builder.css +14 -22
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.embed.css +1 -2
  5. package/dist/formio.embed.js +2 -2
  6. package/dist/formio.embed.min.css +1 -1
  7. package/dist/formio.embed.min.js +1 -1
  8. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  9. package/dist/formio.form.css +10 -2
  10. package/dist/formio.form.js +1239 -1097
  11. package/dist/formio.form.min.css +1 -1
  12. package/dist/formio.form.min.js +1 -1
  13. package/dist/formio.form.min.js.LICENSE.txt +3 -8
  14. package/dist/formio.full.css +14 -22
  15. package/dist/formio.full.js +1271 -1118
  16. package/dist/formio.full.min.css +1 -1
  17. package/dist/formio.full.min.js +1 -1
  18. package/dist/formio.full.min.js.LICENSE.txt +3 -8
  19. package/dist/formio.js +713 -626
  20. package/dist/formio.min.js +1 -1
  21. package/dist/formio.min.js.LICENSE.txt +2 -7
  22. package/dist/formio.utils.js +220 -13
  23. package/dist/formio.utils.min.js +1 -1
  24. package/dist/formio.utils.min.js.LICENSE.txt +2 -7
  25. package/lib/cjs/CDN.js +1 -1
  26. package/lib/cjs/Element.js +7 -2
  27. package/lib/cjs/Embed.js +1 -1
  28. package/lib/cjs/Form.d.ts +8 -5
  29. package/lib/cjs/Form.js +52 -10
  30. package/lib/cjs/PDF.d.ts +11 -3
  31. package/lib/cjs/PDF.js +4 -5
  32. package/lib/cjs/PDFBuilder.js +2 -3
  33. package/lib/cjs/Webform.d.ts +4 -7
  34. package/lib/cjs/Webform.js +40 -119
  35. package/lib/cjs/WebformBuilder.d.ts +6 -1
  36. package/lib/cjs/WebformBuilder.js +104 -64
  37. package/lib/cjs/Wizard.d.ts +8 -5
  38. package/lib/cjs/Wizard.js +12 -12
  39. package/lib/cjs/WizardBuilder.d.ts +6 -4
  40. package/lib/cjs/WizardBuilder.js +20 -3
  41. package/lib/cjs/addons/FormioAddon.d.ts +1 -1
  42. package/lib/cjs/addons/FormioAddon.js +1 -2
  43. package/lib/cjs/components/_classes/component/Component.d.ts +14 -8
  44. package/lib/cjs/components/_classes/component/Component.js +24 -14
  45. package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
  46. package/lib/cjs/components/_classes/input/Input.js +1 -2
  47. package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
  48. package/lib/cjs/components/_classes/list/ListComponent.js +43 -6
  49. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
  50. package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -4
  51. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -2
  52. package/lib/cjs/components/_classes/nested/NestedComponent.js +9 -10
  53. package/lib/cjs/components/address/Address.d.ts +8 -0
  54. package/lib/cjs/components/button/Button.js +2 -3
  55. package/lib/cjs/components/checkbox/Checkbox.d.ts +13 -0
  56. package/lib/cjs/components/checkbox/Checkbox.js +17 -5
  57. package/lib/cjs/components/columns/Columns.d.ts +1 -0
  58. package/lib/cjs/components/columns/Columns.js +1 -0
  59. package/lib/cjs/components/container/Container.d.ts +1 -0
  60. package/lib/cjs/components/container/Container.js +1 -0
  61. package/lib/cjs/components/content/Content.d.ts +1 -0
  62. package/lib/cjs/components/content/Content.js +1 -2
  63. package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
  64. package/lib/cjs/components/currency/editForm/Currency.edit.data.js +4 -0
  65. package/lib/cjs/components/currency/editForm/Currency.edit.display.js +4 -0
  66. package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -0
  67. package/lib/cjs/components/datagrid/DataGrid.js +8 -1
  68. package/lib/cjs/components/datamap/DataMap.js +1 -0
  69. package/lib/cjs/components/datetime/DateTime.d.ts +4 -0
  70. package/lib/cjs/components/datetime/DateTime.js +21 -1
  71. package/lib/cjs/components/day/Day.d.ts +1 -1
  72. package/lib/cjs/components/day/Day.js +22 -6
  73. package/lib/cjs/components/day/fixtures/comp3.js +2 -2
  74. package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
  75. package/lib/cjs/components/editgrid/EditGrid.js +11 -6
  76. package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
  77. package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.js +227 -0
  78. package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +54 -0
  79. package/lib/cjs/components/editgrid/fixtures/comp15.js +51 -0
  80. package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
  81. package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
  82. package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
  83. package/lib/cjs/components/fieldset/Fieldset.js +1 -0
  84. package/lib/cjs/components/file/File.d.ts +7 -5
  85. package/lib/cjs/components/file/File.js +26 -9
  86. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +62 -0
  87. package/lib/cjs/components/file/editForm/File.edit.file.js +29 -2
  88. package/lib/cjs/components/form/Form.d.ts +3 -0
  89. package/lib/cjs/components/form/Form.js +9 -10
  90. package/lib/cjs/components/hidden/Hidden.d.ts +1 -0
  91. package/lib/cjs/components/hidden/Hidden.js +1 -0
  92. package/lib/cjs/components/html/HTML.d.ts +1 -0
  93. package/lib/cjs/components/html/HTML.js +1 -0
  94. package/lib/cjs/components/number/Number.d.ts +5 -1
  95. package/lib/cjs/components/number/Number.js +24 -7
  96. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -0
  97. package/lib/cjs/components/radio/Radio.d.ts +5 -3
  98. package/lib/cjs/components/radio/Radio.js +59 -18
  99. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  100. package/lib/cjs/components/recaptcha/ReCaptcha.js +4 -5
  101. package/lib/cjs/components/resource/Resource.d.ts +7 -0
  102. package/lib/cjs/components/resource/Resource.js +0 -1
  103. package/lib/cjs/components/resource/editForm/Resource.edit.display.js +1 -1
  104. package/lib/cjs/components/select/Select.d.ts +7 -5
  105. package/lib/cjs/components/select/Select.js +15 -49
  106. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +12 -0
  107. package/lib/cjs/components/selectboxes/SelectBoxes.js +53 -25
  108. package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
  109. package/lib/cjs/components/selectboxes/fixtures/comp4.js +47 -32
  110. package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
  111. package/lib/cjs/components/selectboxes/fixtures/comp6.js +15 -0
  112. package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
  113. package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
  114. package/lib/cjs/components/signature/Signature.d.ts +1 -1
  115. package/lib/cjs/components/signature/Signature.js +8 -3
  116. package/lib/cjs/components/survey/Survey.js +3 -0
  117. package/lib/cjs/components/table/Table.d.ts +1 -0
  118. package/lib/cjs/components/table/Table.js +1 -0
  119. package/lib/cjs/components/tabs/Tabs.d.ts +1 -0
  120. package/lib/cjs/components/tabs/Tabs.js +1 -0
  121. package/lib/cjs/components/tags/Tags.js +3 -0
  122. package/lib/cjs/components/textarea/TextArea.d.ts +3 -2
  123. package/lib/cjs/components/textarea/TextArea.js +4 -5
  124. package/lib/cjs/components/textarea/fixtures/comp4.d.ts +30 -0
  125. package/lib/cjs/components/textarea/fixtures/comp4.js +27 -0
  126. package/lib/cjs/components/textarea/fixtures/index.d.ts +2 -1
  127. package/lib/cjs/components/textarea/fixtures/index.js +3 -1
  128. package/lib/cjs/components/textfield/TextField.d.ts +1 -0
  129. package/lib/cjs/components/textfield/TextField.js +5 -3
  130. package/lib/cjs/components/time/Time.d.ts +4 -0
  131. package/lib/cjs/components/time/Time.js +6 -1
  132. package/lib/cjs/components/tree/Tree.d.ts +5 -4
  133. package/lib/cjs/components/tree/Tree.form.js +5 -0
  134. package/lib/cjs/components/tree/Tree.js +8 -9
  135. package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
  136. package/lib/cjs/components/tree/editForm/Tree.edit.display.js +12 -0
  137. package/lib/cjs/components/well/Well.d.ts +1 -0
  138. package/lib/cjs/components/well/Well.js +1 -0
  139. package/lib/cjs/providers/Providers.d.ts +31 -11
  140. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +2 -2
  141. package/lib/cjs/providers/address/GoogleAddressProvider.js +2 -3
  142. package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -1
  143. package/lib/cjs/providers/processor/fileProcessor.js +1 -5
  144. package/lib/cjs/providers/storage/azure.d.ts +10 -1
  145. package/lib/cjs/providers/storage/azure.js +7 -2
  146. package/lib/cjs/providers/storage/base64.d.ts +2 -2
  147. package/lib/cjs/providers/storage/base64.js +2 -6
  148. package/lib/cjs/providers/storage/dropbox.d.ts +2 -2
  149. package/lib/cjs/providers/storage/dropbox.js +2 -6
  150. package/lib/cjs/providers/storage/googleDrive.d.ts +3 -2
  151. package/lib/cjs/providers/storage/googleDrive.js +6 -6
  152. package/lib/cjs/providers/storage/indexeddb.d.ts +3 -3
  153. package/lib/cjs/providers/storage/indexeddb.js +9 -13
  154. package/lib/cjs/providers/storage/s3.d.ts +11 -1
  155. package/lib/cjs/providers/storage/s3.js +5 -2
  156. package/lib/cjs/providers/storage/uploadAdapter.js +1 -5
  157. package/lib/cjs/providers/storage/url.d.ts +2 -2
  158. package/lib/cjs/providers/storage/url.js +12 -8
  159. package/lib/cjs/providers/storage/xhr.d.ts +1 -1
  160. package/lib/cjs/providers/storage/xhr.js +1 -2
  161. package/lib/cjs/templates/index.d.ts +226 -1
  162. package/lib/cjs/utils/Evaluator.js +4 -33
  163. package/lib/cjs/utils/i18n.d.ts +16 -0
  164. package/lib/cjs/utils/i18n.js +88 -0
  165. package/lib/cjs/utils/utils.d.ts +1 -1
  166. package/lib/cjs/utils/utils.js +8 -9
  167. package/lib/cjs/validator/Validator.d.ts +30 -2
  168. package/lib/cjs/validator/Validator.js +32 -9
  169. package/lib/cjs/validator/rules/Select.js +1 -2
  170. package/lib/cjs/validator/rules/Unique.d.ts +1 -1
  171. package/lib/cjs/validator/rules/Unique.js +1 -2
  172. package/lib/cjs/widgets/CalendarWidget.d.ts +1 -0
  173. package/lib/cjs/widgets/InputWidget.d.ts +1 -1
  174. package/lib/cjs/widgets/InputWidget.js +1 -2
  175. package/lib/mjs/CDN.js +1 -1
  176. package/lib/mjs/Element.js +6 -2
  177. package/lib/mjs/Embed.js +4 -1
  178. package/lib/mjs/Form.d.ts +8 -5
  179. package/lib/mjs/Form.js +52 -10
  180. package/lib/mjs/PDF.d.ts +11 -3
  181. package/lib/mjs/PDF.js +4 -5
  182. package/lib/mjs/PDFBuilder.js +2 -3
  183. package/lib/mjs/Webform.d.ts +4 -7
  184. package/lib/mjs/Webform.js +40 -122
  185. package/lib/mjs/WebformBuilder.d.ts +6 -1
  186. package/lib/mjs/WebformBuilder.js +102 -64
  187. package/lib/mjs/Wizard.d.ts +8 -5
  188. package/lib/mjs/Wizard.js +12 -12
  189. package/lib/mjs/WizardBuilder.d.ts +6 -4
  190. package/lib/mjs/WizardBuilder.js +20 -3
  191. package/lib/mjs/addons/FormioAddon.d.ts +1 -1
  192. package/lib/mjs/addons/FormioAddon.js +1 -2
  193. package/lib/mjs/components/_classes/component/Component.d.ts +14 -8
  194. package/lib/mjs/components/_classes/component/Component.js +24 -14
  195. package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
  196. package/lib/mjs/components/_classes/input/Input.js +1 -2
  197. package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
  198. package/lib/mjs/components/_classes/list/ListComponent.js +43 -5
  199. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
  200. package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -4
  201. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -2
  202. package/lib/mjs/components/_classes/nested/NestedComponent.js +9 -10
  203. package/lib/mjs/components/address/Address.d.ts +8 -0
  204. package/lib/mjs/components/button/Button.js +2 -3
  205. package/lib/mjs/components/checkbox/Checkbox.d.ts +13 -0
  206. package/lib/mjs/components/checkbox/Checkbox.js +21 -5
  207. package/lib/mjs/components/columns/Columns.d.ts +1 -0
  208. package/lib/mjs/components/columns/Columns.js +1 -0
  209. package/lib/mjs/components/container/Container.d.ts +1 -0
  210. package/lib/mjs/components/container/Container.js +1 -0
  211. package/lib/mjs/components/content/Content.d.ts +1 -0
  212. package/lib/mjs/components/content/Content.js +1 -2
  213. package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
  214. package/lib/mjs/components/currency/editForm/Currency.edit.data.js +4 -0
  215. package/lib/mjs/components/currency/editForm/Currency.edit.display.js +4 -0
  216. package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -0
  217. package/lib/mjs/components/datagrid/DataGrid.js +8 -1
  218. package/lib/mjs/components/datamap/DataMap.js +1 -0
  219. package/lib/mjs/components/datetime/DateTime.d.ts +4 -0
  220. package/lib/mjs/components/datetime/DateTime.js +28 -1
  221. package/lib/mjs/components/day/Day.d.ts +1 -1
  222. package/lib/mjs/components/day/Day.js +25 -6
  223. package/lib/mjs/components/day/fixtures/comp3.js +2 -2
  224. package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
  225. package/lib/mjs/components/editgrid/EditGrid.js +11 -6
  226. package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
  227. package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.js +225 -0
  228. package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +54 -0
  229. package/lib/mjs/components/editgrid/fixtures/comp15.js +49 -0
  230. package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
  231. package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
  232. package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
  233. package/lib/mjs/components/fieldset/Fieldset.js +1 -0
  234. package/lib/mjs/components/file/File.d.ts +7 -5
  235. package/lib/mjs/components/file/File.js +29 -9
  236. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +62 -0
  237. package/lib/mjs/components/file/editForm/File.edit.file.js +29 -2
  238. package/lib/mjs/components/form/Form.d.ts +3 -0
  239. package/lib/mjs/components/form/Form.js +9 -10
  240. package/lib/mjs/components/hidden/Hidden.d.ts +1 -0
  241. package/lib/mjs/components/hidden/Hidden.js +1 -0
  242. package/lib/mjs/components/html/HTML.d.ts +1 -0
  243. package/lib/mjs/components/html/HTML.js +1 -0
  244. package/lib/mjs/components/number/Number.d.ts +5 -1
  245. package/lib/mjs/components/number/Number.js +24 -7
  246. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -0
  247. package/lib/mjs/components/radio/Radio.d.ts +5 -3
  248. package/lib/mjs/components/radio/Radio.js +59 -18
  249. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  250. package/lib/mjs/components/recaptcha/ReCaptcha.js +4 -5
  251. package/lib/mjs/components/resource/Resource.d.ts +7 -0
  252. package/lib/mjs/components/resource/Resource.js +0 -1
  253. package/lib/mjs/components/resource/editForm/Resource.edit.display.js +1 -1
  254. package/lib/mjs/components/select/Select.d.ts +7 -5
  255. package/lib/mjs/components/select/Select.js +18 -49
  256. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +12 -0
  257. package/lib/mjs/components/selectboxes/SelectBoxes.js +56 -25
  258. package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
  259. package/lib/mjs/components/selectboxes/fixtures/comp4.js +47 -32
  260. package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
  261. package/lib/mjs/components/selectboxes/fixtures/comp6.js +13 -0
  262. package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
  263. package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
  264. package/lib/mjs/components/signature/Signature.d.ts +1 -1
  265. package/lib/mjs/components/signature/Signature.js +11 -3
  266. package/lib/mjs/components/survey/Survey.js +6 -0
  267. package/lib/mjs/components/table/Table.d.ts +1 -0
  268. package/lib/mjs/components/table/Table.js +1 -0
  269. package/lib/mjs/components/tabs/Tabs.d.ts +1 -0
  270. package/lib/mjs/components/tabs/Tabs.js +1 -0
  271. package/lib/mjs/components/tags/Tags.js +6 -0
  272. package/lib/mjs/components/textarea/TextArea.d.ts +3 -2
  273. package/lib/mjs/components/textarea/TextArea.js +4 -5
  274. package/lib/mjs/components/textarea/fixtures/comp4.d.ts +30 -0
  275. package/lib/mjs/components/textarea/fixtures/comp4.js +25 -0
  276. package/lib/mjs/components/textarea/fixtures/index.d.ts +2 -1
  277. package/lib/mjs/components/textarea/fixtures/index.js +2 -1
  278. package/lib/mjs/components/textfield/TextField.d.ts +1 -0
  279. package/lib/mjs/components/textfield/TextField.js +8 -3
  280. package/lib/mjs/components/time/Time.d.ts +4 -0
  281. package/lib/mjs/components/time/Time.js +12 -1
  282. package/lib/mjs/components/tree/Tree.d.ts +5 -4
  283. package/lib/mjs/components/tree/Tree.form.js +5 -0
  284. package/lib/mjs/components/tree/Tree.js +8 -9
  285. package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
  286. package/lib/mjs/components/tree/editForm/Tree.edit.display.js +10 -0
  287. package/lib/mjs/components/well/Well.d.ts +1 -0
  288. package/lib/mjs/components/well/Well.js +1 -0
  289. package/lib/mjs/providers/Providers.d.ts +31 -11
  290. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +2 -2
  291. package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -3
  292. package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -1
  293. package/lib/mjs/providers/processor/fileProcessor.js +1 -2
  294. package/lib/mjs/providers/storage/azure.d.ts +10 -1
  295. package/lib/mjs/providers/storage/azure.js +7 -2
  296. package/lib/mjs/providers/storage/base64.d.ts +2 -2
  297. package/lib/mjs/providers/storage/base64.js +2 -3
  298. package/lib/mjs/providers/storage/dropbox.d.ts +2 -2
  299. package/lib/mjs/providers/storage/dropbox.js +2 -3
  300. package/lib/mjs/providers/storage/googleDrive.d.ts +3 -2
  301. package/lib/mjs/providers/storage/googleDrive.js +6 -3
  302. package/lib/mjs/providers/storage/indexeddb.d.ts +3 -3
  303. package/lib/mjs/providers/storage/indexeddb.js +9 -10
  304. package/lib/mjs/providers/storage/s3.d.ts +11 -1
  305. package/lib/mjs/providers/storage/s3.js +5 -2
  306. package/lib/mjs/providers/storage/uploadAdapter.js +1 -2
  307. package/lib/mjs/providers/storage/url.d.ts +2 -2
  308. package/lib/mjs/providers/storage/url.js +12 -5
  309. package/lib/mjs/providers/storage/xhr.d.ts +1 -1
  310. package/lib/mjs/providers/storage/xhr.js +1 -2
  311. package/lib/mjs/templates/index.d.ts +226 -1
  312. package/lib/mjs/utils/Evaluator.js +4 -33
  313. package/lib/mjs/utils/i18n.d.ts +16 -0
  314. package/lib/mjs/utils/i18n.js +81 -0
  315. package/lib/mjs/utils/utils.d.ts +1 -1
  316. package/lib/mjs/utils/utils.js +8 -9
  317. package/lib/mjs/validator/Validator.d.ts +30 -2
  318. package/lib/mjs/validator/Validator.js +31 -9
  319. package/lib/mjs/validator/rules/Select.js +1 -2
  320. package/lib/mjs/validator/rules/Unique.d.ts +1 -1
  321. package/lib/mjs/validator/rules/Unique.js +1 -2
  322. package/lib/mjs/widgets/CalendarWidget.d.ts +1 -0
  323. package/lib/mjs/widgets/InputWidget.d.ts +1 -1
  324. package/lib/mjs/widgets/InputWidget.js +1 -2
  325. package/package.json +14 -15
@@ -83,8 +83,11 @@ exports.default = [
83
83
  input: true,
84
84
  weight: 15,
85
85
  placeholder: `{
86
- "withCredentials": true
87
- }`,
86
+ "withCredentials": true,
87
+ "headers": {
88
+ "Authorization": "Basic <key>"
89
+ }
90
+ }`,
88
91
  conditional: {
89
92
  json: {
90
93
  '===': [{
@@ -209,6 +212,30 @@ exports.default = [
209
212
  json: { '==': [{ var: 'data.webcam' }, true] }
210
213
  }
211
214
  },
215
+ {
216
+ type: 'radio',
217
+ input: true,
218
+ key: 'capture',
219
+ label: 'Enable device capture',
220
+ tooltip: 'This will allow a mobile device to open the camera or microphone directly in capture mode.',
221
+ optionsLabelPosition: 'right',
222
+ inline: true,
223
+ defaultValue: false,
224
+ values: [
225
+ {
226
+ label: 'Disabled',
227
+ value: 'false'
228
+ },
229
+ {
230
+ label: 'Environment (rear camera)',
231
+ value: 'environment'
232
+ },
233
+ {
234
+ label: 'User (front camera)',
235
+ value: 'user'
236
+ }
237
+ ]
238
+ },
212
239
  {
213
240
  type: 'datagrid',
214
241
  input: true,
@@ -12,9 +12,11 @@ export default class FormComponent extends Component {
12
12
  valueChanged: boolean | undefined;
13
13
  subForm: any;
14
14
  formSrc: any;
15
+ get dataReady(): any;
15
16
  get emptyValue(): {
16
17
  data: {};
17
18
  };
19
+ get ready(): any;
18
20
  get useOriginalRevision(): any;
19
21
  setFormRevision(rev: any): void;
20
22
  subFormRevision: any;
@@ -26,6 +28,7 @@ export default class FormComponent extends Component {
26
28
  * Prints out the value of form components as a datagrid value.
27
29
  */
28
30
  getValueAsString(value: any): any;
31
+ attach(element: any): Promise<any>;
29
32
  get hasLoadedForm(): any;
30
33
  get isRevisionChanged(): any;
31
34
  subFormReady: any;
@@ -7,7 +7,6 @@ const lodash_1 = __importDefault(require("lodash"));
7
7
  const Component_1 = __importDefault(require("../_classes/component/Component"));
8
8
  const ComponentModal_1 = __importDefault(require("../_classes/componentModal/ComponentModal"));
9
9
  const eventemitter3_1 = __importDefault(require("eventemitter3"));
10
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
11
10
  const utils_1 = require("../../utils/utils");
12
11
  const Formio_1 = require("../../Formio");
13
12
  const Form_1 = __importDefault(require("../../Form"));
@@ -99,7 +98,7 @@ class FormComponent extends Component_1.default {
99
98
  return this.createSubForm();
100
99
  }
101
100
  get dataReady() {
102
- return this.subFormReady || native_promise_only_1.default.resolve();
101
+ return this.subFormReady || Promise.resolve();
103
102
  }
104
103
  get defaultValue() {
105
104
  // Not not provide a default value unless the subform is ready so that it will initialize correctly.
@@ -112,7 +111,7 @@ class FormComponent extends Component_1.default {
112
111
  return { data: {} };
113
112
  }
114
113
  get ready() {
115
- return this.subFormReady || native_promise_only_1.default.resolve();
114
+ return this.subFormReady || Promise.resolve();
116
115
  }
117
116
  get useOriginalRevision() {
118
117
  var _a, _b;
@@ -388,14 +387,14 @@ class FormComponent extends Component_1.default {
388
387
  */
389
388
  loadSubForm(fromAttach) {
390
389
  if (this.builderMode || this.isHidden() || (this.isSubFormLazyLoad() && !fromAttach)) {
391
- return native_promise_only_1.default.resolve();
390
+ return Promise.resolve();
392
391
  }
393
- if (this.hasLoadedForm && !this.isRevisionChanged && !(this.options.pdf && lodash_1.default.isUndefined(this.subFormRevision))) {
392
+ if (this.hasLoadedForm && !this.isRevisionChanged) {
394
393
  // Pass config down to sub forms.
395
394
  if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {
396
395
  this.formObj.config = this.root.form.config;
397
396
  }
398
- return native_promise_only_1.default.resolve(this.formObj);
397
+ return Promise.resolve(this.formObj);
399
398
  }
400
399
  else if (this.formSrc) {
401
400
  this.subFormLoading = true;
@@ -410,7 +409,7 @@ class FormComponent extends Component_1.default {
410
409
  return null;
411
410
  });
412
411
  }
413
- return native_promise_only_1.default.resolve();
412
+ return Promise.resolve();
414
413
  }
415
414
  get subFormData() {
416
415
  var _a;
@@ -473,7 +472,7 @@ class FormComponent extends Component_1.default {
473
472
  return this.subForm.getSubmission();
474
473
  }
475
474
  else {
476
- return native_promise_only_1.default.resolve(this.dataValue);
475
+ return Promise.resolve(this.dataValue);
477
476
  }
478
477
  }
479
478
  /**
@@ -498,7 +497,7 @@ class FormComponent extends Component_1.default {
498
497
  this.subForm.showAllErrors = true;
499
498
  if (rejectOnError) {
500
499
  this.subForm.onSubmissionError(err);
501
- return native_promise_only_1.default.reject(err);
500
+ return Promise.reject(err);
502
501
  }
503
502
  else {
504
503
  return {};
@@ -528,7 +527,7 @@ class FormComponent extends Component_1.default {
528
527
  // This submission has already been submitted, so just return the reference data.
529
528
  if (isAlreadySubmitted && !((_a = this.subForm) === null || _a === void 0 ? void 0 : _a.wizard)) {
530
529
  this.dataValue = submission;
531
- return native_promise_only_1.default.resolve(this.dataValue);
530
+ return Promise.resolve(this.dataValue);
532
531
  }
533
532
  return this.submitSubForm(false)
534
533
  .then(() => {
@@ -5,6 +5,7 @@ export default class HiddenComponent extends Input {
5
5
  icon: string;
6
6
  weight: number;
7
7
  documentation: string;
8
+ showPreview: boolean;
8
9
  schema: any;
9
10
  };
10
11
  get inputInfo(): {
@@ -19,6 +19,7 @@ class HiddenComponent extends Input_1.default {
19
19
  icon: 'user-secret',
20
20
  weight: 0,
21
21
  documentation: '/userguide/form-building/data-components#hidden',
22
+ showPreview: false,
22
23
  schema: HiddenComponent.schema()
23
24
  };
24
25
  }
@@ -5,6 +5,7 @@ export default class HTMLComponent extends Component {
5
5
  icon: string;
6
6
  weight: number;
7
7
  documentation: string;
8
+ showPreview: boolean;
8
9
  schema: any;
9
10
  };
10
11
  get content(): any;
@@ -24,6 +24,7 @@ class HTMLComponent extends Component_1.default {
24
24
  icon: 'code',
25
25
  weight: 0,
26
26
  documentation: '/userguide/form-building/layout-components#html-element',
27
+ showPreview: false,
27
28
  schema: HTMLComponent.schema()
28
29
  };
29
30
  }
@@ -7,11 +7,15 @@ export default class NumberComponent extends Input {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get serverConditionSettings(): {
11
+ operators: string[];
12
+ valueComponent(classComp: any): any;
13
+ };
10
14
  constructor(...args: any[]);
11
15
  validators: string[];
12
- decimalSeparator: any;
13
16
  delimiter: any;
14
17
  decimalLimit: any;
18
+ decimalSeparator: any;
15
19
  numberMask: any;
16
20
  /**
17
21
  * Creates the number mask for normal numbers.
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const text_mask_addons_1 = require("@formio/text-mask-addons");
6
7
  const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
7
8
  const lodash_1 = __importDefault(require("lodash"));
8
- const text_mask_addons_1 = require("@formio/text-mask-addons");
9
- const Input_1 = __importDefault(require("../_classes/input/Input"));
10
9
  const utils_1 = require("../../utils/utils");
10
+ const Input_1 = __importDefault(require("../_classes/input/Input"));
11
11
  class NumberComponent extends Input_1.default {
12
12
  static schema(...extend) {
13
13
  return Input_1.default.schema({
@@ -32,25 +32,42 @@ class NumberComponent extends Input_1.default {
32
32
  schema: NumberComponent.schema()
33
33
  };
34
34
  }
35
+ static get serverConditionSettings() {
36
+ return {
37
+ operators: [
38
+ 'isEqual',
39
+ 'isNotEqual',
40
+ 'isEmpty',
41
+ 'isNotEmpty',
42
+ 'greaterThan',
43
+ 'greaterThanOrEqual',
44
+ 'lessThan',
45
+ 'lessThanOrEqual',
46
+ ],
47
+ valueComponent(classComp) {
48
+ return Object.assign(Object.assign({}, classComp), { type: 'number' });
49
+ },
50
+ };
51
+ }
35
52
  constructor(...args) {
36
53
  var _a, _b;
37
54
  super(...args);
38
55
  this.validators = this.validators.concat(['min', 'max']);
39
56
  const separators = (0, utils_1.getNumberSeparators)(this.options.language || navigator.language);
40
- this.decimalSeparator = this.options.decimalSeparator = this.options.decimalSeparator
41
- || ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.decimalSeparator)
42
- || separators.decimalSeparator;
57
+ const requireDecimal = lodash_1.default.get(this.component, 'requireDecimal', false);
43
58
  if (this.component.delimiter) {
44
59
  if (this.options.hasOwnProperty('thousandsSeparator')) {
45
60
  console.warn("Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.");
46
61
  }
47
- this.delimiter = ((_b = this.options.properties) === null || _b === void 0 ? void 0 : _b.thousandsSeparator) || this.options.thousandsSeparator || separators.delimiter;
62
+ this.delimiter = ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.thousandsSeparator) || this.options.thousandsSeparator || separators.delimiter;
48
63
  }
49
64
  else {
50
65
  this.delimiter = '';
51
66
  }
52
- const requireDecimal = lodash_1.default.get(this.component, 'requireDecimal', false);
53
67
  this.decimalLimit = (0, utils_1.getNumberDecimalLimit)(this.component, requireDecimal ? 2 : 20);
68
+ this.decimalSeparator = this.decimalLimit !== 0 ?
69
+ this.options.decimalSeparator || ((_b = this.options.properties) === null || _b === void 0 ? void 0 : _b.decimalSeparator) || separators.decimalSeparator :
70
+ '';
54
71
  // Currencies to override BrowserLanguage Config. Object key {}
55
72
  if (lodash_1.default.has(this.options, `languageOverride.${this.options.language}`)) {
56
73
  const override = lodash_1.default.get(this.options, `languageOverride.${this.options.language}`);
@@ -20,6 +20,15 @@ function default_1(...extend) {
20
20
  }
21
21
  ]
22
22
  },
23
+ {
24
+ key: 'data',
25
+ components: [
26
+ {
27
+ key: 'case',
28
+ ignore: true
29
+ }
30
+ ]
31
+ },
23
32
  {
24
33
  key: 'validation',
25
34
  components: PhoneNumber_edit_validation_1.default
@@ -23,11 +23,12 @@ export default class RadioComponent extends ListComponent {
23
23
  get emptyValue(): string;
24
24
  get isRadio(): boolean;
25
25
  get optionSelectedClass(): string;
26
+ get listData(): any;
26
27
  templateData: {} | undefined;
27
28
  triggerUpdate: ((...args: any[]) => any) | undefined;
28
- itemsLoaded: any;
29
- itemsLoadedResolve: any;
30
- shouldLoad: boolean | undefined;
29
+ itemsLoaded: Promise<any> | undefined;
30
+ itemsLoadedResolve: ((value: any) => void) | undefined;
31
+ optionsLoaded: boolean | undefined;
31
32
  loadedOptions: any[] | undefined;
32
33
  render(): any;
33
34
  detach(element: any): void;
@@ -36,6 +37,7 @@ export default class RadioComponent extends ListComponent {
36
37
  getValueAsString(value: any): any;
37
38
  setValueAt(index: any, value: any): void;
38
39
  loadItems(url: any, search: any, headers: any, options: any, method: any, body: any): void;
40
+ loadItemsFromMetadata(): void;
39
41
  setItems(items: any): void;
40
42
  setSelectedClasses(): void;
41
43
  updateValue(value: any, flags: any): boolean;
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"));
8
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
9
8
  const Formio_1 = require("../../Formio");
10
9
  const utils_1 = require("../../utils/utils");
11
10
  class RadioComponent extends ListComponent_1.default {
@@ -64,6 +63,10 @@ class RadioComponent extends ListComponent_1.default {
64
63
  get optionSelectedClass() {
65
64
  return 'radio-selected';
66
65
  }
66
+ get listData() {
67
+ const listData = lodash_1.default.get(this.root, 'submission.metadata.listData', {});
68
+ return lodash_1.default.get(listData, this.path);
69
+ }
67
70
  init() {
68
71
  super.init();
69
72
  this.templateData = {};
@@ -79,7 +82,7 @@ class RadioComponent extends ListComponent_1.default {
79
82
  if (typeof this.itemsLoadedResolve === 'function') {
80
83
  this.itemsLoadedResolve();
81
84
  }
82
- this.itemsLoaded = new native_promise_only_1.default((resolve) => {
85
+ this.itemsLoaded = new Promise((resolve) => {
83
86
  this.itemsLoadedResolve = resolve;
84
87
  });
85
88
  if (args.length) {
@@ -87,11 +90,13 @@ class RadioComponent extends ListComponent_1.default {
87
90
  }
88
91
  return triggerUpdate(...updateArgs);
89
92
  };
90
- this.itemsLoaded = new native_promise_only_1.default((resolve) => {
93
+ this.itemsLoaded = new Promise((resolve) => {
91
94
  this.itemsLoadedResolve = resolve;
92
95
  });
93
- this.shouldLoad = true;
96
+ this.optionsLoaded = false;
94
97
  this.loadedOptions = [];
98
+ // Get the template keys for this radio component.
99
+ this.getTemplateKeys();
95
100
  }
96
101
  render() {
97
102
  return super.render(this.renderTemplate('radio', {
@@ -191,6 +196,13 @@ class RadioComponent extends ListComponent_1.default {
191
196
  }
192
197
  }
193
198
  loadItems(url, search, headers, options, method, body) {
199
+ if (this.optionsLoaded) {
200
+ return;
201
+ }
202
+ if (!this.shouldLoad) {
203
+ this.loadItemsFromMetadata();
204
+ return;
205
+ }
194
206
  // Ensure we have a method and remove any body if method is get
195
207
  method = method || 'GET';
196
208
  if (method.toUpperCase() === 'GET') {
@@ -200,33 +212,55 @@ class RadioComponent extends ListComponent_1.default {
200
212
  options.ignoreCache = this.component.ignoreCache;
201
213
  // Make the request.
202
214
  options.header = headers;
203
- if (this.shouldLoad) {
204
- this.loading = true;
205
- Formio_1.Formio.makeRequest(this.options.formio, 'select', url, method, body, options)
206
- .then((response) => {
207
- this.loading = false;
208
- this.error = null;
209
- this.setItems(response);
210
- this.shouldLoad = false;
211
- this.redraw();
212
- })
213
- .catch((err) => {
214
- this.handleLoadingError(err);
215
- });
216
- }
215
+ this.loading = true;
216
+ Formio_1.Formio.makeRequest(this.options.formio, 'select', url, method, body, options)
217
+ .then((response) => {
218
+ this.loading = false;
219
+ this.error = null;
220
+ this.setItems(response);
221
+ this.optionsLoaded = true;
222
+ this.redraw();
223
+ })
224
+ .catch((err) => {
225
+ this.handleLoadingError(err);
226
+ });
227
+ }
228
+ loadItemsFromMetadata() {
229
+ this.listData.forEach((item, i) => {
230
+ this.loadedOptions[i] = {
231
+ label: this.itemTemplate(item)
232
+ };
233
+ if (lodash_1.default.isEqual(item, this.selectData)) {
234
+ this.loadedOptions[i].value = this.dataValue;
235
+ }
236
+ });
237
+ this.optionsLoaded = true;
238
+ this.redraw();
217
239
  }
218
240
  setItems(items) {
241
+ const listData = [];
219
242
  items === null || items === void 0 ? void 0 : items.forEach((item, i) => {
220
243
  this.loadedOptions[i] = {
221
244
  value: item[this.component.valueProperty],
222
245
  label: this.itemTemplate(item, item[this.component.valueProperty])
223
246
  };
247
+ listData.push(this.templateData[item[this.component.valueProperty]]);
224
248
  if (lodash_1.default.isUndefined(item[this.component.valueProperty]) ||
225
249
  lodash_1.default.isObject(item[this.component.valueProperty]) ||
226
250
  (!this.isRadio && lodash_1.default.isBoolean(item[this.component.valueProperty]))) {
227
251
  this.loadedOptions[i].invalid = true;
228
252
  }
229
253
  });
254
+ if (this.isSelectURL) {
255
+ const submission = this.root.submission;
256
+ if (!submission.metadata) {
257
+ submission.metadata = {};
258
+ }
259
+ if (!submission.metadata.listData) {
260
+ submission.metadata.listData = {};
261
+ }
262
+ lodash_1.default.set(submission.metadata.listData, this.path, listData);
263
+ }
230
264
  }
231
265
  setSelectedClasses() {
232
266
  if (this.refs.wrapper) {
@@ -289,6 +323,13 @@ class RadioComponent extends ListComponent_1.default {
289
323
  if (value === 'false') {
290
324
  value = false;
291
325
  }
326
+ if (this.isSelectURL && this.templateData && this.templateData[value]) {
327
+ const submission = this.root.submission;
328
+ if (!submission.metadata.selectData) {
329
+ submission.metadata.selectData = {};
330
+ }
331
+ lodash_1.default.set(submission.metadata.selectData, this.path, this.templateData[value]);
332
+ }
292
333
  return super.normalizeValue(value);
293
334
  }
294
335
  }
@@ -13,7 +13,7 @@ export default class ReCaptchaComponent extends Component {
13
13
  recaptchaApiReady: any;
14
14
  createLabel(): void;
15
15
  verify(actionName: any): void;
16
- recaptchaVerifiedPromise: any;
16
+ recaptchaVerifiedPromise: Promise<void> | undefined;
17
17
  isLoading: boolean | undefined;
18
18
  sendVerificationRequest(token: any): any;
19
19
  checkComponentValidity(data: any, dirty: any, row: any, options?: {}): any;
@@ -8,7 +8,6 @@ const Component_1 = __importDefault(require("../_classes/component/Component"));
8
8
  const Formio_1 = require("../../Formio");
9
9
  const get_1 = __importDefault(require("lodash/get"));
10
10
  const debounce_1 = __importDefault(require("lodash/debounce"));
11
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
12
11
  class ReCaptchaComponent extends Component_1.default {
13
12
  static schema(...extend) {
14
13
  return Component_1.default.schema({
@@ -66,7 +65,7 @@ class ReCaptchaComponent extends Component_1.default {
66
65
  this.recaptchaApiReady = Formio_1.Formio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);
67
66
  }
68
67
  if (this.recaptchaApiReady) {
69
- this.recaptchaVerifiedPromise = new native_promise_only_1.default((resolve, reject) => {
68
+ this.recaptchaVerifiedPromise = new Promise((resolve, reject) => {
70
69
  this.recaptchaApiReady
71
70
  .then(() => {
72
71
  if (!this.isLoading) {
@@ -119,13 +118,13 @@ class ReCaptchaComponent extends Component_1.default {
119
118
  const componentData = row[this.component.key];
120
119
  if (!componentData || !componentData.token) {
121
120
  this.setCustomValidity('ReCAPTCHA: Token is not specified in submission');
122
- return native_promise_only_1.default.resolve(false);
121
+ return Promise.resolve(false);
123
122
  }
124
123
  if (!componentData.success) {
125
124
  this.setCustomValidity('ReCAPTCHA: Token validation error');
126
- return native_promise_only_1.default.resolve(false);
125
+ return Promise.resolve(false);
127
126
  }
128
- return this.hook('validateReCaptcha', componentData.token, () => native_promise_only_1.default.resolve(true))
127
+ return this.hook('validateReCaptcha', componentData.token, () => Promise.resolve(true))
129
128
  .then((success) => success)
130
129
  .catch((err) => {
131
130
  this.setCustomValidity(err.message || err);
@@ -1,3 +1,10 @@
1
1
  export default class ResourceComponent extends SelectComponent {
2
+ static get builderInfo(): {
3
+ title: string;
4
+ icon: string;
5
+ weight: number;
6
+ documentation: string;
7
+ schema: any;
8
+ };
2
9
  }
3
10
  import SelectComponent from '../select/Select';
@@ -19,7 +19,6 @@ class ResourceComponent extends Select_1.default {
19
19
  static get builderInfo() {
20
20
  return {
21
21
  title: 'Resource',
22
- group: 'premium',
23
22
  icon: 'files-o',
24
23
  weight: 90,
25
24
  documentation: '/userguide/form-building/form-components#resource',
@@ -7,7 +7,7 @@ exports.default = [
7
7
  type: 'htmlelement',
8
8
  tag: 'div',
9
9
  className: 'alert alert-danger',
10
- content: 'The Resource component is deprecated. Use the Select component with data source of "Resource" instead.',
10
+ content: 'This component has been deprecated and will be removed in a future version of Formio.js.',
11
11
  },
12
12
  {
13
13
  type: 'select',
@@ -7,11 +7,15 @@ export default class SelectComponent extends ListComponent {
7
7
  documentation: string;
8
8
  schema: any;
9
9
  };
10
+ static get serverConditionSettings(): {
11
+ valueComponent(classComp: any): any;
12
+ operators: string[];
13
+ };
10
14
  templateData: {} | undefined;
11
15
  triggerUpdate: ((...args: any[]) => any) | undefined;
12
16
  set itemsLoaded(arg: any);
13
17
  get itemsLoaded(): any;
14
- itemsLoadedResolve: any;
18
+ itemsLoadedResolve: ((value: any) => void) | undefined;
15
19
  isFromSearch: boolean | undefined;
16
20
  searchServerCount: any;
17
21
  defaultServerCount: any;
@@ -19,6 +23,7 @@ export default class SelectComponent extends ListComponent {
19
23
  searchDownloadedResources: any;
20
24
  defaultDownloadedResources: any;
21
25
  activated: boolean | undefined;
26
+ get dataReady(): any;
22
27
  get emptyValue(): {};
23
28
  get valueProperty(): any;
24
29
  get inputInfo(): {
@@ -55,11 +60,7 @@ export default class SelectComponent extends ListComponent {
55
60
  set downloadedResources(arg: any);
56
61
  get downloadedResources(): any;
57
62
  getSingleItemValueForHTMLMode(data: any): any;
58
- getTemplateKeys(): void;
59
- templateKeys: any[] | undefined;
60
63
  get loadingError(): boolean | undefined;
61
- get selectData(): any;
62
- get shouldLoad(): any;
63
64
  loadItems(url: any, search: any, headers: any, options: any, method: any, body: any): void;
64
65
  getCustomItems(): any;
65
66
  asyncValues: boolean | undefined;
@@ -79,6 +80,7 @@ export default class SelectComponent extends ListComponent {
79
80
  render(): any;
80
81
  wrapElement(element: any): any;
81
82
  choicesOptions(): any;
83
+ attach(element: any): Promise<void> | undefined;
82
84
  focusableElement: any;
83
85
  choices: Choices | null | undefined;
84
86
  scrollList: any;