@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
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  /* global Quill */
7
7
  const TextField_1 = __importDefault(require("../textfield/TextField"));
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
10
9
  const utils_1 = require("../../utils/utils");
11
10
  class TextAreaComponent extends TextField_1.default {
12
11
  static schema(...extend) {
@@ -117,7 +116,7 @@ class TextAreaComponent extends TextField_1.default {
117
116
  this.wysiwygDefault[this.component.editor] || this.wysiwygDefault.default
118
117
  : this.component.wysiwyg;
119
118
  // Keep track of when this editor is ready.
120
- this.editorsReady[index] = new native_promise_only_1.default((editorReady) => {
119
+ this.editorsReady[index] = new Promise((editorReady) => {
121
120
  // Attempt to add a wysiwyg editor. In order to add one, it must be included on the global scope.
122
121
  switch (this.component.editor) {
123
122
  case 'ace':
@@ -285,7 +284,7 @@ class TextAreaComponent extends TextField_1.default {
285
284
  this.setConvertedValue(value);
286
285
  return super.setValue(value, flags);
287
286
  }
288
- flags.skipWysiwyg = lodash_1.default.isEqual(value, this.getValue());
287
+ flags.skipWysiwyg = value === '' && flags.resetValue ? false : lodash_1.default.isEqual(value, this.getValue());
289
288
  return super.setValue(value, flags);
290
289
  }
291
290
  setContent(element, content, forceSanitize) {
@@ -347,11 +346,11 @@ class TextAreaComponent extends TextField_1.default {
347
346
  });
348
347
  }
349
348
  else {
350
- return native_promise_only_1.default.resolve(value);
349
+ return Promise.resolve(value);
351
350
  }
352
351
  }
353
352
  setImagesUrl(images) {
354
- return native_promise_only_1.default.all(lodash_1.default.map(images, image => {
353
+ return Promise.all(lodash_1.default.map(images, image => {
355
354
  let requestData;
356
355
  try {
357
356
  requestData = JSON.parse(image.getAttribute('alt'));
@@ -0,0 +1,30 @@
1
+ declare namespace _default {
2
+ const type: string;
3
+ const components: ({
4
+ type: string;
5
+ key: string;
6
+ rows: number;
7
+ editor: string;
8
+ hideLabel: boolean;
9
+ as: string;
10
+ input: boolean;
11
+ label?: undefined;
12
+ showValidations?: undefined;
13
+ tableView?: undefined;
14
+ } | {
15
+ label: string;
16
+ showValidations: boolean;
17
+ tableView: boolean;
18
+ key: string;
19
+ type: string;
20
+ input: boolean;
21
+ rows?: undefined;
22
+ editor?: undefined;
23
+ hideLabel?: undefined;
24
+ as?: undefined;
25
+ })[];
26
+ const title: string;
27
+ const display: string;
28
+ const name: string;
29
+ }
30
+ export default _default;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ type: 'form',
5
+ components: [
6
+ {
7
+ type: 'textarea',
8
+ key: 'jsonTextarea',
9
+ rows: 5,
10
+ editor: 'ace',
11
+ hideLabel: true,
12
+ as: 'json',
13
+ input: true
14
+ },
15
+ {
16
+ label: 'Submit',
17
+ showValidations: false,
18
+ tableView: false,
19
+ key: 'submit',
20
+ type: 'button',
21
+ input: true
22
+ }
23
+ ],
24
+ title: 'text area tests',
25
+ display: 'form',
26
+ name: 'textAriaTests',
27
+ };
@@ -1,4 +1,5 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
- export { comp1, comp2, comp3 };
4
+ import comp4 from './comp4';
5
+ export { comp1, comp2, comp3, comp4 };
@@ -3,10 +3,12 @@ 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
- exports.comp3 = exports.comp2 = exports.comp1 = void 0;
6
+ exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
7
7
  const comp1_1 = __importDefault(require("./comp1"));
8
8
  exports.comp1 = comp1_1.default;
9
9
  const comp2_1 = __importDefault(require("./comp2"));
10
10
  exports.comp2 = comp2_1.default;
11
11
  const comp3_1 = __importDefault(require("./comp3"));
12
12
  exports.comp3 = comp3_1.default;
13
+ const comp4_1 = __importDefault(require("./comp4"));
14
+ exports.comp4 = comp4_1.default;
@@ -34,5 +34,6 @@ export default class TextFieldComponent extends Input {
34
34
  getValueAt(index: any): any;
35
35
  isHtmlRenderMode(): any;
36
36
  truncateMultipleSpaces(value: any): any;
37
+ beforeSubmit(): Promise<any>;
37
38
  }
38
39
  import Input from '../_classes/input/Input';
@@ -29,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const Input_1 = __importDefault(require("../_classes/input/Input"));
30
30
  const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
31
31
  const FormioUtils = __importStar(require("../../utils/utils"));
32
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
33
32
  class TextFieldComponent extends Input_1.default {
34
33
  static schema(...extend) {
35
34
  return Input_1.default.schema({
@@ -61,6 +60,9 @@ class TextFieldComponent extends Input_1.default {
61
60
  schema: TextFieldComponent.schema()
62
61
  };
63
62
  }
63
+ static get serverConditionSettings() {
64
+ return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: [...super.serverConditionSettings.operators, 'includes', 'notIncludes', 'endsWith', 'startsWith'] });
65
+ }
64
66
  get defaultSchema() {
65
67
  return TextFieldComponent.schema();
66
68
  }
@@ -233,11 +235,11 @@ class TextFieldComponent extends Input_1.default {
233
235
  beforeSubmit() {
234
236
  let value = this.dataValue;
235
237
  if (!this.component.truncateMultipleSpaces || !value) {
236
- return native_promise_only_1.default.resolve(value);
238
+ return Promise.resolve(value);
237
239
  }
238
240
  value = this.truncateMultipleSpaces(value);
239
241
  this.dataValue = value;
240
- return native_promise_only_1.default.resolve(value).then(() => super.beforeSubmit());
242
+ return Promise.resolve(value).then(() => super.beforeSubmit());
241
243
  }
242
244
  }
243
245
  exports.default = TextFieldComponent;
@@ -1,4 +1,8 @@
1
1
  export default class TimeComponent extends TextFieldComponent {
2
+ static get serverConditionSettings(): {
3
+ valueComponent(classComp: any): any;
4
+ operators: string[];
5
+ };
2
6
  rawData: string | never[];
3
7
  get dataFormat(): any;
4
8
  get skipMaskValidation(): boolean;
@@ -18,6 +18,11 @@ class TimeComponent extends TextField_1.default {
18
18
  dataFormat: defaultDataFormat,
19
19
  }, ...extend);
20
20
  }
21
+ static get serverConditionSettings() {
22
+ return Object.assign(Object.assign({}, super.serverConditionSettings), { valueComponent(classComp) {
23
+ return Object.assign(Object.assign({}, classComp), { type: 'time' });
24
+ } });
25
+ }
21
26
  constructor(component, options, data) {
22
27
  super(component, options, data);
23
28
  const { edge: isEdgeBrowser, version: edgeVersion } = (0, utils_1.getBrowserInfo)();
@@ -38,7 +43,7 @@ class TimeComponent extends TextField_1.default {
38
43
  title: 'Time',
39
44
  icon: 'clock-o',
40
45
  group: 'advanced',
41
- documentation: '/userguide/form-building/advanced-components#time',
46
+ documentation: '/userguide/form-building/advanced-components#time-1',
42
47
  weight: 55,
43
48
  schema: TimeComponent.schema(),
44
49
  };
@@ -2,9 +2,9 @@ export default class TreeComponent extends NestedDataComponent {
2
2
  static get builderInfo(): {
3
3
  title: string;
4
4
  icon: string;
5
- group: string;
6
5
  weight: number;
7
6
  documentation: string;
7
+ showPreview: boolean;
8
8
  schema: any;
9
9
  };
10
10
  constructor(...args: any[]);
@@ -23,10 +23,11 @@ export default class TreeComponent extends NestedDataComponent {
23
23
  renderChildNodes(nodes: any[] | undefined, odd: any): any;
24
24
  renderEdit(node?: {}): any;
25
25
  renderView(node?: {}): any;
26
- attachNode(element: any, node: any): any;
26
+ attach(element: any): Promise<[void, void]> | Promise<[[void, void], void | [void, void]]>;
27
+ attachNode(element: any, node: any): Promise<void> | Promise<[void, void]>;
27
28
  attachActions(node: any): void;
28
- attachComponents(node: any, ...args: any[]): any;
29
- attachChildren(node: any): any;
29
+ attachComponents(node: any, ...args: any[]): Promise<any>;
30
+ attachChildren(node: any): Promise<any>;
30
31
  addChild(parent: any): void;
31
32
  cancelNode(node: any): void;
32
33
  editNode(node: any): void;
@@ -5,8 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Component_form_1 = __importDefault(require("../_classes/component/Component.form"));
7
7
  const Tree_edit_data_1 = __importDefault(require("./editForm/Tree.edit.data"));
8
+ const Tree_edit_display_1 = __importDefault(require("./editForm/Tree.edit.display"));
8
9
  function default_1(...extend) {
9
10
  return (0, Component_form_1.default)([
11
+ {
12
+ key: 'display',
13
+ components: Tree_edit_display_1.default,
14
+ },
10
15
  {
11
16
  key: 'data',
12
17
  components: Tree_edit_data_1.default,
@@ -8,7 +8,6 @@ const Component_1 = __importDefault(require("../_classes/component/Component"));
8
8
  const Components_1 = __importDefault(require("../Components"));
9
9
  const NestedDataComponent_1 = __importDefault(require("../_classes/nesteddata/NestedDataComponent"));
10
10
  const Node_1 = __importDefault(require("./Node"));
11
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
12
11
  class TreeComponent extends NestedDataComponent_1.default {
13
12
  static schema(...extend) {
14
13
  return NestedDataComponent_1.default.schema({
@@ -26,9 +25,9 @@ class TreeComponent extends NestedDataComponent_1.default {
26
25
  return {
27
26
  title: 'Tree',
28
27
  icon: 'indent',
29
- group: 'data',
30
28
  weight: 40,
31
29
  documentation: '/userguide/form-building/data-components#tree',
30
+ showPreview: false,
32
31
  schema: TreeComponent.schema(),
33
32
  };
34
33
  }
@@ -135,17 +134,17 @@ class TreeComponent extends NestedDataComponent_1.default {
135
134
  this.loadRefs(element, {
136
135
  root: 'single',
137
136
  });
138
- return native_promise_only_1.default.all([
137
+ return Promise.all([
139
138
  super.attach(element),
140
139
  this.attachNode(this.refs.root, this.treeRoot),
141
140
  ]);
142
141
  }
143
142
  attachNode(element, node) {
144
143
  if (!element) {
145
- return native_promise_only_1.default.resolve();
144
+ return Promise.resolve();
146
145
  }
147
- let componentsPromise = native_promise_only_1.default.resolve();
148
- let childrenPromise = native_promise_only_1.default.resolve();
146
+ let componentsPromise = Promise.resolve();
147
+ let childrenPromise = Promise.resolve();
149
148
  node.refs = lodash_1.default.reduce(element.children, (refs, child) => (child.hasAttribute('ref')
150
149
  ? Object.assign(Object.assign({}, refs), { [child.getAttribute('ref')]: child }) : refs), {});
151
150
  if (node.refs.content) {
@@ -155,7 +154,7 @@ class TreeComponent extends NestedDataComponent_1.default {
155
154
  if (node.refs.childNodes) {
156
155
  childrenPromise = this.attachChildren(node);
157
156
  }
158
- return native_promise_only_1.default.all([
157
+ return Promise.all([
159
158
  componentsPromise,
160
159
  childrenPromise,
161
160
  ]);
@@ -221,11 +220,11 @@ class TreeComponent extends NestedDataComponent_1.default {
221
220
  });
222
221
  return node.refs.nodeEdit
223
222
  ? super.attachComponents(node.refs.nodeEdit, node.components)
224
- : native_promise_only_1.default.resolve();
223
+ : Promise.resolve();
225
224
  }
226
225
  attachChildren(node) {
227
226
  const childElements = node.refs.childNodes.children;
228
- return native_promise_only_1.default.all(lodash_1.default.map(childElements, (childElement, index) => this.attachNode(childElement, node.children[index])));
227
+ return Promise.all(lodash_1.default.map(childElements, (childElement, index) => this.attachNode(childElement, node.children[index])));
229
228
  }
230
229
  setValue(value, flags = {}) {
231
230
  const changed = this.updateValue(value, flags);
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ key: string;
3
+ weight: number;
4
+ type: string;
5
+ tag: string;
6
+ className: string;
7
+ content: string;
8
+ }[];
9
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = [
4
+ {
5
+ key: 'treeInfo',
6
+ weight: -10,
7
+ type: 'htmlelement',
8
+ tag: 'div',
9
+ className: 'alert alert-danger',
10
+ content: 'This component has been deprecated and will be removed in a future version of Formio.js.',
11
+ }
12
+ ];
@@ -4,6 +4,7 @@ export default class WellComponent extends NestedComponent {
4
4
  icon: string;
5
5
  group: string;
6
6
  documentation: string;
7
+ showPreview: boolean;
7
8
  weight: number;
8
9
  schema: any;
9
10
  };
@@ -20,6 +20,7 @@ class WellComponent extends NestedComponent_1.default {
20
20
  icon: 'square-o',
21
21
  group: 'layout',
22
22
  documentation: '/userguide/form-building/layout-components#well',
23
+ showPreview: false,
23
24
  weight: 60,
24
25
  schema: WellComponent.schema()
25
26
  };
@@ -9,15 +9,25 @@ export default class Providers {
9
9
  (): {
10
10
  title: string;
11
11
  name: string;
12
- uploadFile(file: any, fileName: any): any;
13
- downloadFile(file: any): any;
12
+ uploadFile(file: any, fileName: any): Promise<any>;
13
+ downloadFile(file: any): Promise<any>;
14
14
  };
15
15
  title: string;
16
16
  };
17
17
  s3: {
18
18
  (formio: any): {
19
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
19
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<{
20
+ storage: string;
21
+ name: any;
22
+ bucket: any;
23
+ key: any;
24
+ url: any;
25
+ acl: any;
26
+ size: any;
27
+ type: any;
28
+ }>;
20
29
  downloadFile(file: any): any;
30
+ deleteFile(fileInfo: any): any;
21
31
  };
22
32
  title: string;
23
33
  };
@@ -26,15 +36,24 @@ export default class Providers {
26
36
  title: string;
27
37
  name: string;
28
38
  uploadFile(file: any, name: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
29
- deleteFile(fileInfo: any): any;
30
- downloadFile(file: any): any;
39
+ deleteFile(fileInfo: any): Promise<any>;
40
+ downloadFile(file: any): Promise<any>;
31
41
  };
32
42
  title: string;
33
43
  };
34
44
  azure: {
35
45
  (formio: any): {
36
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
46
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<{
47
+ storage: string;
48
+ name: any;
49
+ size: any;
50
+ type: any;
51
+ groupPermissions: any;
52
+ groupId: any;
53
+ key: any;
54
+ }>;
37
55
  downloadFile(file: any): any;
56
+ deleteFile: (fileInfo: any) => any;
38
57
  };
39
58
  title: string;
40
59
  };
@@ -42,16 +61,17 @@ export default class Providers {
42
61
  (): {
43
62
  title: string;
44
63
  name: string;
45
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any): any;
46
- downloadFile(file: any, options: any): any;
47
- deleteFile(file: any, options: any): any;
64
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any): Promise<any> | undefined;
65
+ downloadFile(file: any, options: any): Promise<any>;
66
+ deleteFile(file: any, options: any): Promise<any>;
48
67
  };
49
68
  title: string;
50
69
  };
51
70
  googledrive: {
52
71
  (formio: any): {
53
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
54
- downloadFile(file: any): any;
72
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<any>;
73
+ downloadFile(file: any): Promise<any>;
74
+ deleteFile: (fileInfo: any) => any;
55
75
  };
56
76
  title: string;
57
77
  };
@@ -12,7 +12,7 @@ export class GoogleAddressProvider extends AddressProvider {
12
12
  addRequiredProviderOptions(options: any): void;
13
13
  filterPlace(place: any): {};
14
14
  attachAutocomplete(elem: any, index: any, onSelectAddress: any): void;
15
- search(): any;
16
- makeRequest(): any;
15
+ search(): Promise<void>;
16
+ makeRequest(): Promise<void>;
17
17
  }
18
18
  import { AddressProvider } from './AddressProvider';
@@ -8,7 +8,6 @@ exports.GoogleAddressProvider = void 0;
8
8
  const Formio_1 = require("../../Formio");
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  const AddressProvider_1 = require("./AddressProvider");
11
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
12
11
  class GoogleAddressProvider extends AddressProvider_1.AddressProvider {
13
12
  static get name() {
14
13
  return 'google';
@@ -103,10 +102,10 @@ class GoogleAddressProvider extends AddressProvider_1.AddressProvider {
103
102
  });
104
103
  }
105
104
  search() {
106
- return native_promise_only_1.default.resolve();
105
+ return Promise.resolve();
107
106
  }
108
107
  makeRequest() {
109
- return native_promise_only_1.default.resolve();
108
+ return Promise.resolve();
110
109
  }
111
110
  getDisplayValue(address) {
112
111
  const displayedProperty = lodash_1.default.has(address, this.displayValueProperty)
@@ -1,2 +1,2 @@
1
1
  export default fileProcessor;
2
- declare function fileProcessor(formio: any, config: any): (file: any, options: any) => any;
2
+ declare function fileProcessor(formio: any, config: any): (file: any, options: any) => Promise<any>;
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
7
- const fileProcessor = (formio, config) => (file, options) => new native_promise_only_1.default((resolve, reject) => {
3
+ const fileProcessor = (formio, config) => (file, options) => new Promise((resolve, reject) => {
8
4
  const xhr = new XMLHttpRequest();
9
5
  // Fire on network error.
10
6
  xhr.onerror = (err) => {
@@ -1,7 +1,16 @@
1
1
  export default azure;
2
2
  declare function azure(formio: any): {
3
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
3
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<{
4
+ storage: string;
5
+ name: any;
6
+ size: any;
7
+ type: any;
8
+ groupPermissions: any;
9
+ groupId: any;
10
+ key: any;
11
+ }>;
4
12
  downloadFile(file: any): any;
13
+ deleteFile: (fileInfo: any) => any;
5
14
  };
6
15
  declare namespace azure {
7
16
  const title: string;
@@ -11,19 +11,24 @@ const azure = (formio) => ({
11
11
  xhr.setRequestHeader('Content-Type', file.type);
12
12
  xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob');
13
13
  return file;
14
- }, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then(() => {
14
+ }, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then((response) => {
15
15
  return {
16
16
  storage: 'azure',
17
17
  name: xhr_1.default.path([dir, fileName]),
18
18
  size: file.size,
19
19
  type: file.type,
20
20
  groupPermissions,
21
- groupId
21
+ groupId,
22
+ key: response.pathFile
22
23
  };
23
24
  });
24
25
  },
25
26
  downloadFile(file) {
26
27
  return formio.makeRequest('file', `${formio.formUrl}/storage/azure?name=${xhr_1.default.trim(file.name)}`, 'GET');
28
+ },
29
+ deleteFile: function deleteFile(fileInfo) {
30
+ var url = `${formio.formUrl}/storage/azure?name=${xhr_1.default.trim(fileInfo.name)}&key=${xhr_1.default.trim(fileInfo.key)}`;
31
+ return formio.makeRequest('', url, 'delete');
27
32
  }
28
33
  });
29
34
  azure.title = 'Azure File Services';
@@ -2,8 +2,8 @@ export default base64;
2
2
  declare function base64(): {
3
3
  title: string;
4
4
  name: string;
5
- uploadFile(file: any, fileName: any): any;
6
- downloadFile(file: any): any;
5
+ uploadFile(file: any, fileName: any): Promise<any>;
6
+ downloadFile(file: any): Promise<any>;
7
7
  };
8
8
  declare namespace base64 {
9
9
  const title: string;
@@ -1,15 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
7
3
  const base64 = () => ({
8
4
  title: 'Base64',
9
5
  name: 'base64',
10
6
  uploadFile(file, fileName) {
11
7
  const reader = new FileReader();
12
- return new native_promise_only_1.default((resolve, reject) => {
8
+ return new Promise((resolve, reject) => {
13
9
  reader.onload = (event) => {
14
10
  const url = event.target.result;
15
11
  resolve({
@@ -28,7 +24,7 @@ const base64 = () => ({
28
24
  },
29
25
  downloadFile(file) {
30
26
  // Return the original as there is nothing to do.
31
- return native_promise_only_1.default.resolve(file);
27
+ return Promise.resolve(file);
32
28
  }
33
29
  });
34
30
  base64.title = 'Base64';
@@ -1,7 +1,7 @@
1
1
  export default dropbox;
2
2
  declare function dropbox(formio: any): {
3
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
4
- downloadFile(file: any): any;
3
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<any>;
4
+ downloadFile(file: any): Promise<any>;
5
5
  };
6
6
  declare namespace dropbox {
7
7
  const title: string;
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
7
3
  const xhr_1 = require("./xhr");
8
4
  const dropbox = (formio) => ({
9
5
  uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) {
10
- return new native_promise_only_1.default(((resolve, reject) => {
6
+ return new Promise(((resolve, reject) => {
11
7
  // Send the file with data.
12
8
  const xhr = new XMLHttpRequest();
13
9
  if (typeof progressCallback === 'function') {
@@ -54,7 +50,7 @@ const dropbox = (formio) => ({
54
50
  const token = formio.getToken();
55
51
  file.url =
56
52
  `${formio.formUrl}/storage/dropbox?path_lower=${file.path_lower}${token ? `&x-jwt-token=${token}` : ''}`;
57
- return native_promise_only_1.default.resolve(file);
53
+ return Promise.resolve(file);
58
54
  }
59
55
  });
60
56
  dropbox.title = 'Dropbox';
@@ -1,7 +1,8 @@
1
1
  export default googledrive;
2
2
  declare function googledrive(formio: any): {
3
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
4
- downloadFile(file: any): any;
3
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<any>;
4
+ downloadFile(file: any): Promise<any>;
5
+ deleteFile: (fileInfo: any) => any;
5
6
  };
6
7
  declare namespace googledrive {
7
8
  const title: string;
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
7
3
  const xhr_1 = require("./xhr");
8
4
  const googledrive = (formio) => ({
9
5
  uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) {
10
- return new native_promise_only_1.default(((resolve, reject) => {
6
+ return new Promise(((resolve, reject) => {
11
7
  // Send the file with data.
12
8
  const xhr = new XMLHttpRequest();
13
9
  if (typeof progressCallback === 'function') {
@@ -53,7 +49,11 @@ const googledrive = (formio) => ({
53
49
  const token = formio.getToken();
54
50
  file.url =
55
51
  `${formio.formUrl}/storage/gdrive?fileId=${file.id}&fileName=${file.originalName}${token ? `&x-jwt-token=${token}` : ''}`;
56
- return native_promise_only_1.default.resolve(file);
52
+ return Promise.resolve(file);
53
+ },
54
+ deleteFile: function deleteFile(fileInfo) {
55
+ var url = ''.concat(formio.formUrl, `/storage/gdrive?id=${fileInfo.id}&name=${fileInfo.originalName}`);
56
+ return formio.makeRequest('', url, 'delete');
57
57
  }
58
58
  });
59
59
  googledrive.title = 'Google Drive';
@@ -2,9 +2,9 @@ export default indexeddb;
2
2
  declare function indexeddb(): {
3
3
  title: string;
4
4
  name: string;
5
- uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any): any;
6
- downloadFile(file: any, options: any): any;
7
- deleteFile(file: any, options: any): any;
5
+ uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any): Promise<any> | undefined;
6
+ downloadFile(file: any, options: any): Promise<any>;
7
+ deleteFile(file: any, options: any): Promise<any>;
8
8
  };
9
9
  declare namespace indexeddb {
10
10
  const title: string;