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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (370) 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 -40
  5. package/dist/formio.embed.js +2 -90
  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 +1267 -1103
  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 +1302 -1127
  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.d.ts +1 -0
  26. package/lib/cjs/CDN.js +2 -1
  27. package/lib/cjs/Element.js +7 -2
  28. package/lib/cjs/Embed.d.ts +21 -1
  29. package/lib/cjs/Embed.js +211 -308
  30. package/lib/cjs/Form.d.ts +9 -6
  31. package/lib/cjs/Form.js +53 -11
  32. package/lib/cjs/PDF.d.ts +11 -3
  33. package/lib/cjs/PDF.js +4 -5
  34. package/lib/cjs/PDFBuilder.js +2 -3
  35. package/lib/cjs/Webform.d.ts +10 -13
  36. package/lib/cjs/Webform.js +46 -125
  37. package/lib/cjs/WebformBuilder.d.ts +6 -1
  38. package/lib/cjs/WebformBuilder.js +105 -65
  39. package/lib/cjs/Wizard.d.ts +8 -5
  40. package/lib/cjs/Wizard.js +12 -12
  41. package/lib/cjs/WizardBuilder.d.ts +6 -4
  42. package/lib/cjs/WizardBuilder.js +20 -3
  43. package/lib/cjs/addons/FormioAddon.d.ts +1 -1
  44. package/lib/cjs/addons/FormioAddon.js +1 -2
  45. package/lib/cjs/components/_classes/component/Component.d.ts +24 -8
  46. package/lib/cjs/components/_classes/component/Component.js +44 -14
  47. package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
  48. package/lib/cjs/components/_classes/input/Input.js +1 -2
  49. package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
  50. package/lib/cjs/components/_classes/list/ListComponent.js +43 -6
  51. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
  52. package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -4
  53. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -2
  54. package/lib/cjs/components/_classes/nested/NestedComponent.js +9 -10
  55. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
  56. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
  57. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
  58. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
  59. package/lib/cjs/components/address/Address.d.ts +8 -0
  60. package/lib/cjs/components/address/Address.js +5 -0
  61. package/lib/cjs/components/button/Button.d.ts +1 -0
  62. package/lib/cjs/components/button/Button.js +5 -3
  63. package/lib/cjs/components/checkbox/Checkbox.d.ts +41 -0
  64. package/lib/cjs/components/checkbox/Checkbox.js +32 -5
  65. package/lib/cjs/components/columns/Columns.d.ts +2 -0
  66. package/lib/cjs/components/columns/Columns.js +4 -0
  67. package/lib/cjs/components/container/Container.d.ts +1 -0
  68. package/lib/cjs/components/container/Container.js +4 -0
  69. package/lib/cjs/components/content/Content.d.ts +2 -0
  70. package/lib/cjs/components/content/Content.js +4 -2
  71. package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
  72. package/lib/cjs/components/currency/editForm/Currency.edit.data.js +4 -0
  73. package/lib/cjs/components/currency/editForm/Currency.edit.display.js +4 -0
  74. package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -0
  75. package/lib/cjs/components/datagrid/DataGrid.js +8 -1
  76. package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
  77. package/lib/cjs/components/datamap/DataMap.js +4 -0
  78. package/lib/cjs/components/datetime/DateTime.d.ts +23 -0
  79. package/lib/cjs/components/datetime/DateTime.js +20 -1
  80. package/lib/cjs/components/day/Day.d.ts +22 -1
  81. package/lib/cjs/components/day/Day.js +20 -6
  82. package/lib/cjs/components/day/fixtures/comp3.js +2 -2
  83. package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
  84. package/lib/cjs/components/editgrid/EditGrid.js +11 -6
  85. package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
  86. package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.js +227 -0
  87. package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +54 -0
  88. package/lib/cjs/components/editgrid/fixtures/comp15.js +51 -0
  89. package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
  90. package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
  91. package/lib/cjs/components/fieldset/Fieldset.d.ts +2 -0
  92. package/lib/cjs/components/fieldset/Fieldset.js +4 -0
  93. package/lib/cjs/components/file/File.d.ts +28 -6
  94. package/lib/cjs/components/file/File.js +40 -15
  95. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +62 -0
  96. package/lib/cjs/components/file/editForm/File.edit.file.js +29 -2
  97. package/lib/cjs/components/form/Form.d.ts +4 -0
  98. package/lib/cjs/components/form/Form.js +12 -10
  99. package/lib/cjs/components/hidden/Hidden.d.ts +1 -0
  100. package/lib/cjs/components/hidden/Hidden.js +1 -0
  101. package/lib/cjs/components/html/HTML.d.ts +2 -0
  102. package/lib/cjs/components/html/HTML.js +4 -0
  103. package/lib/cjs/components/number/Number.d.ts +24 -1
  104. package/lib/cjs/components/number/Number.js +18 -6
  105. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  106. package/lib/cjs/components/panel/Panel.js +3 -0
  107. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -0
  108. package/lib/cjs/components/radio/Radio.d.ts +24 -3
  109. package/lib/cjs/components/radio/Radio.js +89 -18
  110. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +2 -1
  111. package/lib/cjs/components/recaptcha/ReCaptcha.js +7 -5
  112. package/lib/cjs/components/resource/Resource.d.ts +7 -0
  113. package/lib/cjs/components/resource/Resource.js +0 -1
  114. package/lib/cjs/components/resource/editForm/Resource.edit.display.js +1 -1
  115. package/lib/cjs/components/select/Select.d.ts +25 -5
  116. package/lib/cjs/components/select/Select.js +51 -51
  117. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +37 -0
  118. package/lib/cjs/components/selectboxes/SelectBoxes.js +60 -25
  119. package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
  120. package/lib/cjs/components/selectboxes/fixtures/comp4.js +47 -32
  121. package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
  122. package/lib/cjs/components/selectboxes/fixtures/comp6.js +15 -0
  123. package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
  124. package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
  125. package/lib/cjs/components/signature/Signature.d.ts +22 -1
  126. package/lib/cjs/components/signature/Signature.js +16 -3
  127. package/lib/cjs/components/survey/Survey.d.ts +21 -0
  128. package/lib/cjs/components/survey/Survey.js +9 -0
  129. package/lib/cjs/components/table/Table.d.ts +2 -0
  130. package/lib/cjs/components/table/Table.js +4 -0
  131. package/lib/cjs/components/tabs/Tabs.d.ts +2 -0
  132. package/lib/cjs/components/tabs/Tabs.js +4 -0
  133. package/lib/cjs/components/tags/Tags.d.ts +21 -0
  134. package/lib/cjs/components/tags/Tags.js +11 -0
  135. package/lib/cjs/components/textarea/TextArea.d.ts +3 -2
  136. package/lib/cjs/components/textarea/TextArea.js +4 -5
  137. package/lib/cjs/components/textarea/fixtures/comp4.d.ts +30 -0
  138. package/lib/cjs/components/textarea/fixtures/comp4.js +27 -0
  139. package/lib/cjs/components/textarea/fixtures/index.d.ts +2 -1
  140. package/lib/cjs/components/textarea/fixtures/index.js +3 -1
  141. package/lib/cjs/components/textfield/TextField.d.ts +22 -0
  142. package/lib/cjs/components/textfield/TextField.js +11 -3
  143. package/lib/cjs/components/time/Time.d.ts +11 -0
  144. package/lib/cjs/components/time/Time.js +6 -1
  145. package/lib/cjs/components/tree/Tree.d.ts +5 -4
  146. package/lib/cjs/components/tree/Tree.form.js +5 -0
  147. package/lib/cjs/components/tree/Tree.js +8 -9
  148. package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
  149. package/lib/cjs/components/tree/editForm/Tree.edit.display.js +12 -0
  150. package/lib/cjs/components/well/Well.d.ts +2 -0
  151. package/lib/cjs/components/well/Well.js +4 -0
  152. package/lib/cjs/formio.embed.d.ts +2 -1
  153. package/lib/cjs/formio.embed.js +96 -1
  154. package/lib/cjs/formio.form.d.ts +4 -3
  155. package/lib/cjs/formio.form.js +17 -8
  156. package/lib/cjs/licenses/Licenses.d.ts +7 -0
  157. package/lib/cjs/licenses/Licenses.js +22 -0
  158. package/lib/cjs/licenses/index.d.ts +2 -0
  159. package/lib/cjs/licenses/index.js +7 -0
  160. package/lib/cjs/providers/Providers.d.ts +31 -11
  161. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +2 -2
  162. package/lib/cjs/providers/address/GoogleAddressProvider.js +2 -3
  163. package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -1
  164. package/lib/cjs/providers/processor/fileProcessor.js +1 -5
  165. package/lib/cjs/providers/storage/azure.d.ts +10 -1
  166. package/lib/cjs/providers/storage/azure.js +7 -2
  167. package/lib/cjs/providers/storage/base64.d.ts +2 -2
  168. package/lib/cjs/providers/storage/base64.js +2 -6
  169. package/lib/cjs/providers/storage/dropbox.d.ts +2 -2
  170. package/lib/cjs/providers/storage/dropbox.js +2 -6
  171. package/lib/cjs/providers/storage/googleDrive.d.ts +3 -2
  172. package/lib/cjs/providers/storage/googleDrive.js +6 -6
  173. package/lib/cjs/providers/storage/indexeddb.d.ts +3 -3
  174. package/lib/cjs/providers/storage/indexeddb.js +9 -13
  175. package/lib/cjs/providers/storage/s3.d.ts +11 -1
  176. package/lib/cjs/providers/storage/s3.js +5 -2
  177. package/lib/cjs/providers/storage/uploadAdapter.js +1 -5
  178. package/lib/cjs/providers/storage/url.d.ts +2 -2
  179. package/lib/cjs/providers/storage/url.js +12 -8
  180. package/lib/cjs/providers/storage/xhr.d.ts +1 -1
  181. package/lib/cjs/providers/storage/xhr.js +1 -2
  182. package/lib/cjs/templates/index.d.ts +226 -1
  183. package/lib/cjs/utils/Evaluator.js +4 -33
  184. package/lib/cjs/utils/i18n.d.ts +16 -0
  185. package/lib/cjs/utils/i18n.js +88 -0
  186. package/lib/cjs/utils/utils.d.ts +11 -1
  187. package/lib/cjs/utils/utils.js +29 -10
  188. package/lib/cjs/validator/Validator.d.ts +30 -2
  189. package/lib/cjs/validator/Validator.js +32 -9
  190. package/lib/cjs/validator/rules/Select.js +1 -2
  191. package/lib/cjs/validator/rules/Unique.d.ts +1 -1
  192. package/lib/cjs/validator/rules/Unique.js +1 -2
  193. package/lib/cjs/widgets/CalendarWidget.d.ts +1 -0
  194. package/lib/cjs/widgets/InputWidget.d.ts +1 -1
  195. package/lib/cjs/widgets/InputWidget.js +1 -2
  196. package/lib/mjs/CDN.d.ts +1 -0
  197. package/lib/mjs/CDN.js +2 -1
  198. package/lib/mjs/Element.js +6 -2
  199. package/lib/mjs/Embed.d.ts +21 -1
  200. package/lib/mjs/Embed.js +208 -319
  201. package/lib/mjs/Form.d.ts +9 -6
  202. package/lib/mjs/Form.js +53 -11
  203. package/lib/mjs/PDF.d.ts +11 -3
  204. package/lib/mjs/PDF.js +4 -5
  205. package/lib/mjs/PDFBuilder.js +2 -3
  206. package/lib/mjs/Webform.d.ts +10 -13
  207. package/lib/mjs/Webform.js +46 -128
  208. package/lib/mjs/WebformBuilder.d.ts +6 -1
  209. package/lib/mjs/WebformBuilder.js +103 -65
  210. package/lib/mjs/Wizard.d.ts +8 -5
  211. package/lib/mjs/Wizard.js +12 -12
  212. package/lib/mjs/WizardBuilder.d.ts +6 -4
  213. package/lib/mjs/WizardBuilder.js +20 -3
  214. package/lib/mjs/addons/FormioAddon.d.ts +1 -1
  215. package/lib/mjs/addons/FormioAddon.js +1 -2
  216. package/lib/mjs/components/_classes/component/Component.d.ts +24 -8
  217. package/lib/mjs/components/_classes/component/Component.js +44 -14
  218. package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
  219. package/lib/mjs/components/_classes/input/Input.js +1 -2
  220. package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
  221. package/lib/mjs/components/_classes/list/ListComponent.js +43 -5
  222. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
  223. package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -4
  224. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -2
  225. package/lib/mjs/components/_classes/nested/NestedComponent.js +9 -10
  226. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
  227. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
  228. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
  229. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
  230. package/lib/mjs/components/address/Address.d.ts +8 -0
  231. package/lib/mjs/components/address/Address.js +5 -0
  232. package/lib/mjs/components/button/Button.d.ts +1 -0
  233. package/lib/mjs/components/button/Button.js +6 -4
  234. package/lib/mjs/components/checkbox/Checkbox.d.ts +41 -0
  235. package/lib/mjs/components/checkbox/Checkbox.js +36 -5
  236. package/lib/mjs/components/columns/Columns.d.ts +2 -0
  237. package/lib/mjs/components/columns/Columns.js +4 -0
  238. package/lib/mjs/components/container/Container.d.ts +1 -0
  239. package/lib/mjs/components/container/Container.js +5 -1
  240. package/lib/mjs/components/content/Content.d.ts +2 -0
  241. package/lib/mjs/components/content/Content.js +4 -2
  242. package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
  243. package/lib/mjs/components/currency/editForm/Currency.edit.data.js +4 -0
  244. package/lib/mjs/components/currency/editForm/Currency.edit.display.js +4 -0
  245. package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -0
  246. package/lib/mjs/components/datagrid/DataGrid.js +8 -1
  247. package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
  248. package/lib/mjs/components/datamap/DataMap.js +5 -1
  249. package/lib/mjs/components/datetime/DateTime.d.ts +23 -0
  250. package/lib/mjs/components/datetime/DateTime.js +27 -1
  251. package/lib/mjs/components/day/Day.d.ts +22 -1
  252. package/lib/mjs/components/day/Day.js +24 -7
  253. package/lib/mjs/components/day/fixtures/comp3.js +2 -2
  254. package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
  255. package/lib/mjs/components/editgrid/EditGrid.js +11 -6
  256. package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
  257. package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.js +225 -0
  258. package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +54 -0
  259. package/lib/mjs/components/editgrid/fixtures/comp15.js +49 -0
  260. package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
  261. package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
  262. package/lib/mjs/components/fieldset/Fieldset.d.ts +2 -0
  263. package/lib/mjs/components/fieldset/Fieldset.js +4 -0
  264. package/lib/mjs/components/file/File.d.ts +28 -6
  265. package/lib/mjs/components/file/File.js +44 -16
  266. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +62 -0
  267. package/lib/mjs/components/file/editForm/File.edit.file.js +29 -2
  268. package/lib/mjs/components/form/Form.d.ts +4 -0
  269. package/lib/mjs/components/form/Form.js +13 -11
  270. package/lib/mjs/components/hidden/Hidden.d.ts +1 -0
  271. package/lib/mjs/components/hidden/Hidden.js +1 -0
  272. package/lib/mjs/components/html/HTML.d.ts +2 -0
  273. package/lib/mjs/components/html/HTML.js +4 -0
  274. package/lib/mjs/components/number/Number.d.ts +24 -1
  275. package/lib/mjs/components/number/Number.js +23 -7
  276. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  277. package/lib/mjs/components/panel/Panel.js +3 -0
  278. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -0
  279. package/lib/mjs/components/radio/Radio.d.ts +24 -3
  280. package/lib/mjs/components/radio/Radio.js +93 -19
  281. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +2 -1
  282. package/lib/mjs/components/recaptcha/ReCaptcha.js +7 -5
  283. package/lib/mjs/components/resource/Resource.d.ts +7 -0
  284. package/lib/mjs/components/resource/Resource.js +0 -1
  285. package/lib/mjs/components/resource/editForm/Resource.edit.display.js +1 -1
  286. package/lib/mjs/components/select/Select.d.ts +25 -5
  287. package/lib/mjs/components/select/Select.js +55 -52
  288. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +37 -0
  289. package/lib/mjs/components/selectboxes/SelectBoxes.js +63 -25
  290. package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
  291. package/lib/mjs/components/selectboxes/fixtures/comp4.js +47 -32
  292. package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
  293. package/lib/mjs/components/selectboxes/fixtures/comp6.js +13 -0
  294. package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
  295. package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
  296. package/lib/mjs/components/signature/Signature.d.ts +22 -1
  297. package/lib/mjs/components/signature/Signature.js +19 -3
  298. package/lib/mjs/components/survey/Survey.d.ts +21 -0
  299. package/lib/mjs/components/survey/Survey.js +13 -1
  300. package/lib/mjs/components/table/Table.d.ts +2 -0
  301. package/lib/mjs/components/table/Table.js +4 -0
  302. package/lib/mjs/components/tabs/Tabs.d.ts +2 -0
  303. package/lib/mjs/components/tabs/Tabs.js +4 -0
  304. package/lib/mjs/components/tags/Tags.d.ts +21 -0
  305. package/lib/mjs/components/tags/Tags.js +14 -0
  306. package/lib/mjs/components/textarea/TextArea.d.ts +3 -2
  307. package/lib/mjs/components/textarea/TextArea.js +4 -5
  308. package/lib/mjs/components/textarea/fixtures/comp4.d.ts +30 -0
  309. package/lib/mjs/components/textarea/fixtures/comp4.js +25 -0
  310. package/lib/mjs/components/textarea/fixtures/index.d.ts +2 -1
  311. package/lib/mjs/components/textarea/fixtures/index.js +2 -1
  312. package/lib/mjs/components/textfield/TextField.d.ts +22 -0
  313. package/lib/mjs/components/textfield/TextField.js +14 -3
  314. package/lib/mjs/components/time/Time.d.ts +11 -0
  315. package/lib/mjs/components/time/Time.js +12 -1
  316. package/lib/mjs/components/tree/Tree.d.ts +5 -4
  317. package/lib/mjs/components/tree/Tree.form.js +5 -0
  318. package/lib/mjs/components/tree/Tree.js +8 -9
  319. package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
  320. package/lib/mjs/components/tree/editForm/Tree.edit.display.js +10 -0
  321. package/lib/mjs/components/well/Well.d.ts +2 -0
  322. package/lib/mjs/components/well/Well.js +4 -0
  323. package/lib/mjs/formio.embed.d.ts +2 -1
  324. package/lib/mjs/formio.embed.js +96 -2
  325. package/lib/mjs/formio.form.d.ts +4 -3
  326. package/lib/mjs/formio.form.js +16 -8
  327. package/lib/mjs/licenses/Licenses.d.ts +7 -0
  328. package/lib/mjs/licenses/Licenses.js +17 -0
  329. package/lib/mjs/licenses/index.d.ts +2 -0
  330. package/lib/mjs/licenses/index.js +2 -0
  331. package/lib/mjs/providers/Providers.d.ts +31 -11
  332. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +2 -2
  333. package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -3
  334. package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -1
  335. package/lib/mjs/providers/processor/fileProcessor.js +1 -2
  336. package/lib/mjs/providers/storage/azure.d.ts +10 -1
  337. package/lib/mjs/providers/storage/azure.js +7 -2
  338. package/lib/mjs/providers/storage/base64.d.ts +2 -2
  339. package/lib/mjs/providers/storage/base64.js +2 -3
  340. package/lib/mjs/providers/storage/dropbox.d.ts +2 -2
  341. package/lib/mjs/providers/storage/dropbox.js +2 -3
  342. package/lib/mjs/providers/storage/googleDrive.d.ts +3 -2
  343. package/lib/mjs/providers/storage/googleDrive.js +6 -3
  344. package/lib/mjs/providers/storage/indexeddb.d.ts +3 -3
  345. package/lib/mjs/providers/storage/indexeddb.js +9 -10
  346. package/lib/mjs/providers/storage/s3.d.ts +11 -1
  347. package/lib/mjs/providers/storage/s3.js +5 -2
  348. package/lib/mjs/providers/storage/uploadAdapter.js +1 -2
  349. package/lib/mjs/providers/storage/url.d.ts +2 -2
  350. package/lib/mjs/providers/storage/url.js +12 -5
  351. package/lib/mjs/providers/storage/xhr.d.ts +1 -1
  352. package/lib/mjs/providers/storage/xhr.js +1 -2
  353. package/lib/mjs/templates/index.d.ts +226 -1
  354. package/lib/mjs/utils/Evaluator.js +4 -33
  355. package/lib/mjs/utils/i18n.d.ts +16 -0
  356. package/lib/mjs/utils/i18n.js +81 -0
  357. package/lib/mjs/utils/utils.d.ts +11 -1
  358. package/lib/mjs/utils/utils.js +27 -9
  359. package/lib/mjs/validator/Validator.d.ts +30 -2
  360. package/lib/mjs/validator/Validator.js +31 -9
  361. package/lib/mjs/validator/rules/Select.js +1 -2
  362. package/lib/mjs/validator/rules/Unique.d.ts +1 -1
  363. package/lib/mjs/validator/rules/Unique.js +1 -2
  364. package/lib/mjs/widgets/CalendarWidget.d.ts +1 -0
  365. package/lib/mjs/widgets/InputWidget.d.ts +1 -1
  366. package/lib/mjs/widgets/InputWidget.js +1 -2
  367. package/package.json +18 -15
  368. package/types/index.d.ts +1 -0
  369. package/types/licenses.d.ts +7 -0
  370. package/types/utils.d.ts +2 -0
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
8
7
  const Field_1 = __importDefault(require("../_classes/field/Field"));
9
8
  const Input_1 = __importDefault(require("../_classes/input/Input"));
10
9
  const utils_1 = require("../../utils/utils");
@@ -35,6 +34,9 @@ class ButtonComponent extends Field_1.default {
35
34
  schema: ButtonComponent.schema()
36
35
  };
37
36
  }
37
+ static savedValueTypes(schema) {
38
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.boolean];
39
+ }
38
40
  constructor(component, options, data) {
39
41
  super(component, options, data);
40
42
  this.filesUploading = [];
@@ -360,7 +362,7 @@ class ButtonComponent extends Field_1.default {
360
362
  let params = {
361
363
  response_type: 'code',
362
364
  client_id: settings.clientId,
363
- redirect_uri: settings.redirectURI || window.location.origin || `${window.location.protocol}//${window.location.host}`,
365
+ redirect_uri: (settings.redirectURI && this.interpolate(settings.redirectURI)) || window.location.origin || `${window.location.protocol}//${window.location.host}`,
364
366
  state: settings.state,
365
367
  scope: settings.scope
366
368
  };
@@ -399,7 +401,7 @@ class ButtonComponent extends Field_1.default {
399
401
  return;
400
402
  }
401
403
  // Depending on where the settings came from, submit to either the submission endpoint (old) or oauth endpoint (new).
402
- let requestPromise = native_promise_only_1.default.resolve();
404
+ let requestPromise = Promise.resolve();
403
405
  if (lodash_1.default.has(this, 'root.form.config.oauth') && this.root.form.config.oauth[this.component.oauthProvider]) {
404
406
  params.provider = settings.provider;
405
407
  params.redirectURI = originalRedirectUri;
@@ -7,6 +7,47 @@ export default class CheckBoxComponent extends Field {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get serverConditionSettings(): {
11
+ operators: string[];
12
+ valueComponent(): {
13
+ valueType: string;
14
+ data: {
15
+ values: {
16
+ label: string;
17
+ value: string;
18
+ }[];
19
+ };
20
+ type: string;
21
+ };
22
+ constructor: Function;
23
+ toString(): string;
24
+ toLocaleString(): string;
25
+ valueOf(): Object;
26
+ hasOwnProperty(v: PropertyKey): boolean;
27
+ isPrototypeOf(v: Object): boolean;
28
+ propertyIsEnumerable(v: PropertyKey): boolean;
29
+ };
30
+ static get conditionOperatorsSettings(): {
31
+ operators: string[];
32
+ valueComponent(): {
33
+ valueType: string;
34
+ data: {
35
+ values: {
36
+ label: string;
37
+ value: string;
38
+ }[];
39
+ };
40
+ type: string;
41
+ };
42
+ constructor: Function;
43
+ toString(): string;
44
+ toLocaleString(): string;
45
+ valueOf(): Object;
46
+ hasOwnProperty(v: PropertyKey): boolean;
47
+ isPrototypeOf(v: Object): boolean;
48
+ propertyIsEnumerable(v: PropertyKey): boolean;
49
+ };
50
+ static savedValueTypes(schema: any): string[] | null;
10
51
  get labelClass(): string;
11
52
  get inputInfo(): {
12
53
  type: string;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
+ const utils_1 = require("../../utils/utils");
7
8
  const Field_1 = __importDefault(require("../_classes/field/Field"));
8
9
  class CheckBoxComponent extends Field_1.default {
9
10
  static schema(...extend) {
@@ -28,14 +29,37 @@ class CheckBoxComponent extends Field_1.default {
28
29
  schema: CheckBoxComponent.schema()
29
30
  };
30
31
  }
32
+ static get serverConditionSettings() {
33
+ return CheckBoxComponent.conditionOperatorsSettings;
34
+ }
35
+ static get conditionOperatorsSettings() {
36
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEqual'], valueComponent() {
37
+ return {
38
+ valueType: 'boolean',
39
+ data: {
40
+ values: [
41
+ { label: 'Checked', value: 'true' },
42
+ { label: 'Not Checked', value: 'false' },
43
+ ]
44
+ },
45
+ type: 'select'
46
+ };
47
+ } });
48
+ }
49
+ static savedValueTypes(schema) {
50
+ schema = schema || {};
51
+ const types = (0, utils_1.getComponentSavedTypes)(schema);
52
+ if (lodash_1.default.isArray(types)) {
53
+ return types;
54
+ }
55
+ if (schema.inputType === 'radio') {
56
+ return [utils_1.componentValueTypes.string];
57
+ }
58
+ return [utils_1.componentValueTypes.boolean];
59
+ }
31
60
  get defaultSchema() {
32
61
  return CheckBoxComponent.schema();
33
62
  }
34
- get defaultValue() {
35
- const { name } = this.component;
36
- const defaultValue = super.defaultValue;
37
- return name ? (this.component[name] || this.emptyValue) : (defaultValue || this.component.defaultValue || false).toString() === 'true';
38
- }
39
63
  get labelClass() {
40
64
  let className = '';
41
65
  if (this.isInputComponent
@@ -168,6 +192,9 @@ class CheckBoxComponent extends Field_1.default {
168
192
  getValueAsString(value) {
169
193
  const { name: componentName, value: componentValue } = this.component;
170
194
  const hasValue = componentName ? lodash_1.default.isEqual(value, componentValue) : value;
195
+ if (lodash_1.default.isUndefined(value) && this.inDataTable) {
196
+ return '';
197
+ }
171
198
  return this.t(hasValue ? 'Yes' : 'No');
172
199
  }
173
200
  updateValue(value, flags) {
@@ -4,9 +4,11 @@ export default class ColumnsComponent 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
  };
11
+ static savedValueTypes(): never[];
10
12
  rows: any[];
11
13
  get columnKey(): string;
12
14
  columns: any[] | undefined;
@@ -28,10 +28,14 @@ class ColumnsComponent extends NestedComponent_1.default {
28
28
  icon: 'columns',
29
29
  group: 'layout',
30
30
  documentation: '/userguide/form-building/layout-components#columns',
31
+ showPreview: false,
31
32
  weight: 10,
32
33
  schema: ColumnsComponent.schema()
33
34
  };
34
35
  }
36
+ static savedValueTypes() {
37
+ return [];
38
+ }
35
39
  constructor(component, options, data) {
36
40
  super(component, options, data);
37
41
  this.rows = [];
@@ -4,6 +4,7 @@ export default class ContainerComponent extends NestedDataComponent {
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
  };
@@ -27,6 +27,7 @@ class ContainerComponent extends NestedDataComponent_1.default {
27
27
  icon: 'folder-open',
28
28
  group: 'data',
29
29
  documentation: '/userguide/form-building/data-components#container',
30
+ showPreview: false,
30
31
  weight: 10,
31
32
  schema: ContainerComponent.schema()
32
33
  };
@@ -35,6 +36,9 @@ class ContainerComponent extends NestedDataComponent_1.default {
35
36
  super(...args);
36
37
  this.type = 'container';
37
38
  }
39
+ static savedValueTypes(schema) {
40
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
41
+ }
38
42
  addComponents(data, options) {
39
43
  return super.addComponents(this.dataValue, options);
40
44
  }
@@ -8,8 +8,10 @@ export default class ContentComponent extends Component {
8
8
  weight: number;
9
9
  schema: any;
10
10
  };
11
+ static savedValueTypes(): never[];
11
12
  get content(): any;
12
13
  render(): any;
14
+ get dataReady(): any;
13
15
  get emptyValue(): string;
14
16
  }
15
17
  import Component from '../_classes/component/Component';
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Component_1 = __importDefault(require("../_classes/component/Component"));
7
7
  const lodash_1 = __importDefault(require("lodash"));
8
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
9
8
  class ContentComponent extends Component_1.default {
10
9
  static schema(...extend) {
11
10
  return Component_1.default.schema({
@@ -27,6 +26,9 @@ class ContentComponent extends Component_1.default {
27
26
  schema: ContentComponent.schema()
28
27
  };
29
28
  }
29
+ static savedValueTypes() {
30
+ return [];
31
+ }
30
32
  get defaultSchema() {
31
33
  return ContentComponent.schema();
32
34
  }
@@ -51,7 +53,7 @@ class ContentComponent extends Component_1.default {
51
53
  }
52
54
  get dataReady() {
53
55
  var _a;
54
- return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submissionReady) || native_promise_only_1.default.resolve();
56
+ return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submissionReady) || Promise.resolve();
55
57
  }
56
58
  attach(element) {
57
59
  this.loadRefs(element, { html: 'single' });
@@ -1,4 +1,15 @@
1
- declare const _default: {
1
+ declare const _default: ({
2
+ key: string;
3
+ ignore: boolean;
4
+ type?: undefined;
5
+ input?: undefined;
6
+ weight?: undefined;
7
+ label?: undefined;
8
+ tooltip?: undefined;
9
+ defaultValue?: undefined;
10
+ dataSrc?: undefined;
11
+ data?: undefined;
12
+ } | {
2
13
  type: string;
3
14
  input: boolean;
4
15
  weight: number;
@@ -13,5 +24,6 @@ declare const _default: {
13
24
  value: string;
14
25
  }[];
15
26
  };
16
- }[];
27
+ ignore?: undefined;
28
+ })[];
17
29
  export default _default;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
+ {
5
+ key: 'case',
6
+ ignore: true
7
+ },
4
8
  {
5
9
  type: 'select',
6
10
  input: true,
@@ -17,6 +17,10 @@ exports.default = [
17
17
  key: 'showCharCount',
18
18
  ignore: true
19
19
  },
20
+ {
21
+ key: 'spellcheck',
22
+ ignore: true
23
+ },
20
24
  {
21
25
  type: 'textfield',
22
26
  input: true,
@@ -4,6 +4,7 @@ export default class DataGridComponent extends NestedArrayComponent {
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
  };
@@ -24,6 +24,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
24
24
  icon: 'th',
25
25
  group: 'data',
26
26
  documentation: '/userguide/form-building/data-components#data-grid',
27
+ showPreview: false,
27
28
  weight: 30,
28
29
  schema: DataGridComponent.schema()
29
30
  };
@@ -513,7 +514,13 @@ class DataGridComponent extends NestedArrayComponent_1.default {
513
514
  (col.checkConditions(data, flags, dataValue[rowIndex]) && col.type !== 'hidden');
514
515
  if (col.component.logic && firstRowCheck) {
515
516
  const compIndex = lodash_1.default.findIndex(this.columns, ['key', key]);
516
- if (!lodash_1.default.isEqual(this.columns[compIndex], col.component)) {
517
+ const equalColumns = lodash_1.default.isEqualWith(this.columns[compIndex], col.component, (col1, col2, key) => {
518
+ // Don't compare columns by their auto-generated ids.
519
+ if (key === 'id') {
520
+ return true;
521
+ }
522
+ });
523
+ if (!equalColumns) {
517
524
  logicRebuild = true;
518
525
  this.columns[compIndex] = col.component;
519
526
  }
@@ -1,4 +1,5 @@
1
1
  export default class DataMapComponent extends DataGridComponent {
2
+ static savedValueTypes(schema: any): string[];
2
3
  constructor(component: any, options: any, data: any);
3
4
  get emptyValue(): {};
4
5
  set dataValue(arg: any);
@@ -37,6 +37,7 @@ class DataMapComponent extends DataGrid_1.default {
37
37
  icon: 'th-list',
38
38
  group: 'data',
39
39
  documentation: '/userguide/form-building/data-components#data-map',
40
+ showPreview: false,
40
41
  weight: 20,
41
42
  schema: DataMapComponent.schema()
42
43
  };
@@ -48,6 +49,9 @@ class DataMapComponent extends DataGrid_1.default {
48
49
  }
49
50
  return lodash_1.default.omit(schema, 'components');
50
51
  }
52
+ static savedValueTypes(schema) {
53
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
54
+ }
51
55
  constructor(component, options, data) {
52
56
  super(component, options, data);
53
57
  this.type = 'datamap';
@@ -7,6 +7,29 @@ export default class DateTimeComponent 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
+ constructor: Function;
14
+ toString(): string;
15
+ toLocaleString(): string;
16
+ valueOf(): Object;
17
+ hasOwnProperty(v: PropertyKey): boolean;
18
+ isPrototypeOf(v: Object): boolean;
19
+ propertyIsEnumerable(v: PropertyKey): boolean;
20
+ };
21
+ static get conditionOperatorsSettings(): {
22
+ operators: string[];
23
+ valueComponent(classComp: any): any;
24
+ constructor: Function;
25
+ toString(): string;
26
+ toLocaleString(): string;
27
+ valueOf(): Object;
28
+ hasOwnProperty(v: PropertyKey): boolean;
29
+ isPrototypeOf(v: Object): boolean;
30
+ propertyIsEnumerable(v: PropertyKey): boolean;
31
+ };
32
+ static savedValueTypes(schema: any): string[];
10
33
  get emptyValue(): string;
11
34
  get momentFormat(): string;
12
35
  createWrapper(): boolean;
@@ -5,8 +5,9 @@ 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 moment_1 = __importDefault(require("moment"));
8
- const Input_1 = __importDefault(require("../_classes/input/Input"));
9
8
  const utils_1 = __importDefault(require("../../utils"));
9
+ const utils_2 = require("../../utils/utils");
10
+ const Input_1 = __importDefault(require("../_classes/input/Input"));
10
11
  class DateTimeComponent extends Input_1.default {
11
12
  static schema(...extend) {
12
13
  return Input_1.default.schema({
@@ -55,6 +56,18 @@ class DateTimeComponent extends Input_1.default {
55
56
  schema: DateTimeComponent.schema()
56
57
  };
57
58
  }
59
+ static get serverConditionSettings() {
60
+ return DateTimeComponent.conditionOperatorsSettings;
61
+ }
62
+ static get conditionOperatorsSettings() {
63
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'], valueComponent(classComp) {
64
+ return Object.assign(Object.assign({}, classComp), { type: 'datetime' });
65
+ } });
66
+ }
67
+ static savedValueTypes(schema) {
68
+ schema = schema || {};
69
+ return (0, utils_2.getComponentSavedTypes)(schema) || [utils_2.componentValueTypes.date];
70
+ }
58
71
  constructor(component, options, data) {
59
72
  super(component, options, data);
60
73
  const timezone = (this.component.timezone || this.options.timezone);
@@ -63,9 +76,15 @@ class DateTimeComponent extends Input_1.default {
63
76
  if (!this.component.enableDate) {
64
77
  this.component.format = this.component.format.replace(/yyyy-MM-dd /g, '');
65
78
  }
79
+ else if (this.component.enableDate && !/[yMd]/.test(this.component.format) && this.builderMode) {
80
+ this.component.format = `yyyy-MM-dd ${this.component.format}`;
81
+ }
66
82
  if (!this.component.enableTime) {
67
83
  this.component.format = this.component.format.replace(/ hh:mm a$/g, '');
68
84
  }
85
+ else if (this.component.enableTime && !/[mhH]/.test(this.component.format) && this.builderMode) {
86
+ this.component.format = `${this.component.format} hh:mm a`;
87
+ }
69
88
  else if (time24hr) {
70
89
  this.component.format = this.component.format.replace(/hh:mm a$/g, 'HH:mm');
71
90
  }
@@ -7,6 +7,28 @@ export default class DayComponent extends Field {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get conditionOperatorsSettings(): {
11
+ operators: string[];
12
+ constructor: Function;
13
+ toString(): string;
14
+ toLocaleString(): string;
15
+ valueOf(): Object;
16
+ hasOwnProperty(v: PropertyKey): boolean;
17
+ isPrototypeOf(v: Object): boolean;
18
+ propertyIsEnumerable(v: PropertyKey): boolean;
19
+ };
20
+ static savedValueTypes(schema: any): string[];
21
+ static get serverConditionSettings(): {
22
+ operators: string[];
23
+ constructor: Function;
24
+ toString(): string;
25
+ toLocaleString(): string;
26
+ valueOf(): Object;
27
+ hasOwnProperty(v: PropertyKey): boolean;
28
+ isPrototypeOf(v: Object): boolean;
29
+ propertyIsEnumerable(v: PropertyKey): boolean;
30
+ };
31
+ constructor(component: any, options: any, data: any);
10
32
  /**
11
33
  * The empty value for day component.
12
34
  *
@@ -122,7 +144,6 @@ export default class DayComponent extends Field {
122
144
  * @returns {Date}
123
145
  */
124
146
  get date(): Date;
125
- normalizeMinMaxDates(): any[];
126
147
  /**
127
148
  * Return the raw value.
128
149
  *
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
+ const moment_1 = __importDefault(require("moment"));
7
8
  const Field_1 = __importDefault(require("../_classes/field/Field"));
8
9
  const utils_1 = require("../../utils/utils");
9
10
  class DayComponent extends Field_1.default {
@@ -42,6 +43,25 @@ class DayComponent extends Field_1.default {
42
43
  schema: DayComponent.schema()
43
44
  };
44
45
  }
46
+ static get conditionOperatorsSettings() {
47
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'] });
48
+ }
49
+ static savedValueTypes(schema) {
50
+ schema = schema || {};
51
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.string];
52
+ }
53
+ constructor(component, options, data) {
54
+ if (component.maxDate) {
55
+ component.maxDate = (0, moment_1.default)(component.maxDate, 'YYYY-MM-DD').toISOString();
56
+ }
57
+ if (component.minDate) {
58
+ component.minDate = (0, moment_1.default)(component.minDate, 'YYYY-MM-DD').toISOString();
59
+ }
60
+ super(component, options, data);
61
+ }
62
+ static get serverConditionSettings() {
63
+ return DayComponent.conditionOperatorsSettings;
64
+ }
45
65
  /**
46
66
  * The empty value for day component.
47
67
  *
@@ -464,18 +484,12 @@ class DayComponent extends Field_1.default {
464
484
  get date() {
465
485
  return this.getDate();
466
486
  }
467
- normalizeMinMaxDates() {
468
- return [this.component.minDate, this.component.maxDate]
469
- .map(date => date ? date.split('-').reverse().join('/') : date);
470
- }
471
487
  /**
472
488
  * Return the raw value.
473
489
  *
474
490
  * @returns {Date}
475
491
  */
476
492
  get validationValue() {
477
- [this.component.minDate, this.component.maxDate] = this.dayFirst ? this.normalizeMinMaxDates()
478
- : [this.component.minDate, this.component.maxDate];
479
493
  return this.dataValue;
480
494
  }
481
495
  getValue() {
@@ -11,8 +11,8 @@ exports.default = {
11
11
  'validate': {
12
12
  'custom': ''
13
13
  },
14
- 'minDate': '2020-02-04',
15
- 'maxDate': '2020-02-09',
14
+ 'minDate': '2020-03-01',
15
+ 'maxDate': '2021-01-03',
16
16
  'clearOnHide': true,
17
17
  'persistent': true,
18
18
  'protected': false,
@@ -4,6 +4,7 @@ export default class EditGridComponent extends NestedArrayComponent {
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
  };
@@ -68,10 +69,10 @@ export default class EditGridComponent extends NestedArrayComponent {
68
69
  error: null;
69
70
  rowIndex: any;
70
71
  } | undefined;
71
- addRowModal(rowIndex: any): any;
72
+ addRowModal(rowIndex: any): Promise<any>;
72
73
  alert: Alert | null | undefined;
73
- showDialog(rowIndex: any): any;
74
- editRow(rowIndex: any): any;
74
+ showDialog(rowIndex: any): Promise<any>;
75
+ editRow(rowIndex: any): Promise<any>;
75
76
  clearErrors(rowIndex: any): void;
76
77
  cancelRow(rowIndex: any): void;
77
78
  saveRow(rowIndex: any, modified: any): boolean | undefined;
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
- const native_promise_only_1 = __importDefault(require("native-promise-only"));
8
7
  const NestedArrayComponent_1 = __importDefault(require("../_classes/nestedarray/NestedArrayComponent"));
9
8
  const Component_1 = __importDefault(require("../_classes/component/Component"));
10
9
  const Alert_1 = __importDefault(require("../alert/Alert"));
@@ -48,6 +47,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
48
47
  icon: 'tasks',
49
48
  group: 'data',
50
49
  documentation: '/userguide/form-building/data-components#edit-grid',
50
+ showPreview: false,
51
51
  weight: 30,
52
52
  schema: EditGridComponent.schema(),
53
53
  };
@@ -213,7 +213,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
213
213
  return !this.inlineEditMode;
214
214
  }
215
215
  get minLength() {
216
- return lodash_1.default.get(this.component, 'validate.minLength', 0);
216
+ return this.builderMode ? 0 : lodash_1.default.get(this.component, 'validate.minLength', 0);
217
217
  }
218
218
  get data() {
219
219
  return this._data;
@@ -473,7 +473,12 @@ class EditGridComponent extends NestedArrayComponent_1.default {
473
473
  ].forEach(({ className, event, action, }) => {
474
474
  const elements = row.getElementsByClassName(className);
475
475
  Array.prototype.forEach.call(elements, (element) => {
476
- this.addEventListener(element, event, action);
476
+ if (this.options.readOnly && lodash_1.default.intersection(element.classList, ['editRow', 'removeRow']).length) {
477
+ element.style.display = 'none';
478
+ }
479
+ else {
480
+ this.addEventListener(element, event, action);
481
+ }
477
482
  });
478
483
  });
479
484
  }
@@ -673,7 +678,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
673
678
  showDialog(rowIndex) {
674
679
  const editRow = this.editRows[rowIndex];
675
680
  if (lodash_1.default.isEqual(editRow.backup, editRow.data)) {
676
- return native_promise_only_1.default.resolve();
681
+ return Promise.resolve();
677
682
  }
678
683
  const wrapper = this.ce('div', { ref: 'confirmationDialog' });
679
684
  const dialogContent = this.component.dialogTemplate || this.defaultDialogTemplate;
@@ -691,7 +696,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
691
696
  dialog.close();
692
697
  };
693
698
  let dialogResult;
694
- const promise = new native_promise_only_1.default((resolve, reject) => {
699
+ const promise = new Promise((resolve, reject) => {
695
700
  dialogResult = { resolve, reject };
696
701
  });
697
702
  this.addEventListener(wrapper.refs.dialogYesButton, 'click', (event) => {
@@ -709,7 +714,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
709
714
  const editRow = this.editRows[rowIndex];
710
715
  const isAlreadyEditing = editRow.state === EditRowState.Editing || editRow.state === EditRowState.New;
711
716
  if (!editRow || isAlreadyEditing) {
712
- return native_promise_only_1.default.resolve();
717
+ return Promise.resolve();
713
718
  }
714
719
  editRow.prevState = editRow.state;
715
720
  editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;