@formio/js 5.0.0-dev.5673.3d062b9 → 5.0.0-dev.5673.ae99c16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/Changelog.md +63 -1
  2. package/dist/formio.builder.css +0 -1
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.embed.js +1 -1
  5. package/dist/formio.embed.min.js +1 -1
  6. package/dist/formio.form.css +0 -1
  7. package/dist/formio.form.js +646 -594
  8. package/dist/formio.form.min.css +1 -1
  9. package/dist/formio.form.min.js +1 -1
  10. package/dist/formio.form.min.js.LICENSE.txt +1 -9
  11. package/dist/formio.full.css +0 -1
  12. package/dist/formio.full.js +633 -601
  13. package/dist/formio.full.min.css +1 -1
  14. package/dist/formio.full.min.js +1 -1
  15. package/dist/formio.full.min.js.LICENSE.txt +1 -9
  16. package/dist/formio.js +4 -4
  17. package/dist/formio.min.js +1 -1
  18. package/dist/formio.utils.js +100 -38
  19. package/dist/formio.utils.min.js +1 -1
  20. package/dist/formio.utils.min.js.LICENSE.txt +5 -3
  21. package/lib/cjs/CDN.d.ts +1 -0
  22. package/lib/cjs/CDN.js +2 -2
  23. package/lib/cjs/Form.d.ts +2 -2
  24. package/lib/cjs/Form.js +11 -5
  25. package/lib/cjs/Formio.js +1 -0
  26. package/lib/cjs/PDF.js +1 -1
  27. package/lib/cjs/PDFBuilder.js +2 -1
  28. package/lib/cjs/Webform.d.ts +1 -1
  29. package/lib/cjs/Webform.js +11 -6
  30. package/lib/cjs/WebformBuilder.js +13 -3
  31. package/lib/cjs/Wizard.js +1 -1
  32. package/lib/cjs/components/_classes/component/Component.d.ts +4 -3
  33. package/lib/cjs/components/_classes/component/Component.js +31 -8
  34. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  35. package/lib/cjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
  36. package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
  37. package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
  38. package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
  39. package/lib/cjs/components/_classes/input/Input.js +23 -1
  40. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
  41. package/lib/cjs/components/_classes/multivalue/Multivalue.js +53 -26
  42. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
  43. package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
  44. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  45. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
  46. package/lib/cjs/components/address/Address.d.ts +6 -0
  47. package/lib/cjs/components/address/Address.js +11 -1
  48. package/lib/cjs/components/address/editForm/Address.edit.provider.js +1 -1
  49. package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
  50. package/lib/cjs/components/checkbox/Checkbox.js +1 -1
  51. package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
  52. package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
  53. package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
  54. package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
  55. package/lib/cjs/components/currency/Currency.d.ts +2 -0
  56. package/lib/cjs/components/datagrid/DataGrid.d.ts +11 -1
  57. package/lib/cjs/components/datagrid/DataGrid.js +59 -36
  58. package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
  59. package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
  60. package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
  61. package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -0
  62. package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  63. package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
  64. package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
  65. package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
  66. package/lib/cjs/components/datagrid/fixtures/index.d.ts +5 -1
  67. package/lib/cjs/components/datagrid/fixtures/index.js +9 -1
  68. package/lib/cjs/components/datamap/DataMap.js +2 -2
  69. package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
  70. package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
  71. package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
  72. package/lib/cjs/components/datetime/fixtures/index.js +3 -1
  73. package/lib/cjs/components/day/Day.d.ts +3 -4
  74. package/lib/cjs/components/day/Day.js +31 -10
  75. package/lib/cjs/components/day/fixtures/comp8.d.ts +41 -0
  76. package/lib/cjs/components/day/fixtures/comp8.js +40 -0
  77. package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
  78. package/lib/cjs/components/day/fixtures/index.js +3 -1
  79. package/lib/cjs/components/editgrid/EditGrid.js +16 -8
  80. package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
  81. package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
  82. package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
  83. package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
  84. package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  85. package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
  86. package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
  87. package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
  88. package/lib/cjs/components/file/File.d.ts +2 -2
  89. package/lib/cjs/components/file/File.js +13 -2
  90. package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
  91. package/lib/cjs/components/form/Form.d.ts +1 -1
  92. package/lib/cjs/components/form/Form.js +1 -1
  93. package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
  94. package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
  95. package/lib/cjs/components/form/fixtures/index.js +3 -1
  96. package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  97. package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
  98. package/lib/cjs/components/html/HTML.js +1 -1
  99. package/lib/cjs/components/number/Number.d.ts +17 -2
  100. package/lib/cjs/components/number/Number.js +27 -7
  101. package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
  102. package/lib/cjs/components/number/fixtures/comp10.js +21 -0
  103. package/lib/cjs/components/number/fixtures/comp8.d.ts +32 -0
  104. package/lib/cjs/components/number/fixtures/comp8.js +28 -0
  105. package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
  106. package/lib/cjs/components/number/fixtures/comp9.js +21 -0
  107. package/lib/cjs/components/number/fixtures/index.d.ts +4 -1
  108. package/lib/cjs/components/number/fixtures/index.js +7 -1
  109. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  110. package/lib/cjs/components/panel/Panel.js +1 -0
  111. package/lib/cjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
  112. package/lib/cjs/components/phonenumber/fixtures/comp2.js +25 -0
  113. package/lib/cjs/components/phonenumber/fixtures/index.d.ts +2 -1
  114. package/lib/cjs/components/phonenumber/fixtures/index.js +3 -1
  115. package/lib/cjs/components/radio/Radio.d.ts +2 -18
  116. package/lib/cjs/components/radio/Radio.js +29 -27
  117. package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
  118. package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
  119. package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
  120. package/lib/cjs/components/radio/fixtures/index.js +3 -1
  121. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  122. package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
  123. package/lib/cjs/components/select/Select.d.ts +38 -0
  124. package/lib/cjs/components/select/Select.js +14 -5
  125. package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
  126. package/lib/cjs/components/select/fixtures/comp25.js +66 -0
  127. package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
  128. package/lib/cjs/components/select/fixtures/comp26.js +59 -0
  129. package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
  130. package/lib/cjs/components/select/fixtures/index.js +5 -1
  131. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  132. package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
  133. package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  134. package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
  135. package/lib/cjs/components/tags/Tags.js +3 -3
  136. package/lib/cjs/components/time/Time.d.ts +2 -2
  137. package/lib/cjs/components/time/Time.form.js +2 -2
  138. package/lib/cjs/components/time/Time.js +3 -7
  139. package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
  140. package/lib/cjs/components/time/fixtures/comp4.js +171 -0
  141. package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
  142. package/lib/cjs/components/time/fixtures/index.js +3 -1
  143. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +5 -0
  144. package/lib/cjs/providers/address/GoogleAddressProvider.js +23 -1
  145. package/lib/cjs/templates/Templates.js +1 -1
  146. package/lib/cjs/translations/en.d.ts +4 -0
  147. package/lib/cjs/translations/en.js +5 -1
  148. package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
  149. package/lib/cjs/utils/utils.d.ts +2 -11
  150. package/lib/cjs/utils/utils.js +60 -24
  151. package/lib/cjs/widgets/CalendarWidget.js +24 -10
  152. package/lib/mjs/CDN.d.ts +1 -0
  153. package/lib/mjs/CDN.js +2 -2
  154. package/lib/mjs/Form.d.ts +2 -2
  155. package/lib/mjs/Form.js +11 -5
  156. package/lib/mjs/Formio.js +1 -0
  157. package/lib/mjs/PDF.js +1 -1
  158. package/lib/mjs/PDFBuilder.js +1 -1
  159. package/lib/mjs/Webform.d.ts +1 -1
  160. package/lib/mjs/Webform.js +15 -6
  161. package/lib/mjs/WebformBuilder.js +12 -3
  162. package/lib/mjs/Wizard.js +1 -1
  163. package/lib/mjs/components/_classes/component/Component.d.ts +4 -3
  164. package/lib/mjs/components/_classes/component/Component.js +17 -5
  165. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  166. package/lib/mjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
  167. package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
  168. package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
  169. package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
  170. package/lib/mjs/components/_classes/input/Input.js +22 -1
  171. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
  172. package/lib/mjs/components/_classes/multivalue/Multivalue.js +53 -26
  173. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
  174. package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
  175. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  176. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
  177. package/lib/mjs/components/address/Address.d.ts +6 -0
  178. package/lib/mjs/components/address/Address.js +14 -1
  179. package/lib/mjs/components/address/editForm/Address.edit.provider.js +1 -1
  180. package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
  181. package/lib/mjs/components/checkbox/Checkbox.js +1 -1
  182. package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
  183. package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
  184. package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
  185. package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
  186. package/lib/mjs/components/currency/Currency.d.ts +2 -0
  187. package/lib/mjs/components/datagrid/DataGrid.d.ts +11 -1
  188. package/lib/mjs/components/datagrid/DataGrid.js +58 -35
  189. package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
  190. package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
  191. package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
  192. package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -0
  193. package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  194. package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
  195. package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
  196. package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
  197. package/lib/mjs/components/datagrid/fixtures/index.d.ts +5 -1
  198. package/lib/mjs/components/datagrid/fixtures/index.js +5 -1
  199. package/lib/mjs/components/datamap/DataMap.js +2 -2
  200. package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
  201. package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
  202. package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
  203. package/lib/mjs/components/datetime/fixtures/index.js +2 -1
  204. package/lib/mjs/components/day/Day.d.ts +3 -4
  205. package/lib/mjs/components/day/Day.js +30 -10
  206. package/lib/mjs/components/day/fixtures/comp8.d.ts +41 -0
  207. package/lib/mjs/components/day/fixtures/comp8.js +38 -0
  208. package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
  209. package/lib/mjs/components/day/fixtures/index.js +2 -1
  210. package/lib/mjs/components/editgrid/EditGrid.js +16 -8
  211. package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
  212. package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
  213. package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
  214. package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
  215. package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  216. package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
  217. package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
  218. package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
  219. package/lib/mjs/components/file/File.d.ts +2 -2
  220. package/lib/mjs/components/file/File.js +13 -2
  221. package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
  222. package/lib/mjs/components/form/Form.d.ts +1 -1
  223. package/lib/mjs/components/form/Form.js +1 -1
  224. package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
  225. package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
  226. package/lib/mjs/components/form/fixtures/index.js +2 -1
  227. package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  228. package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
  229. package/lib/mjs/components/html/HTML.js +1 -1
  230. package/lib/mjs/components/number/Number.d.ts +17 -2
  231. package/lib/mjs/components/number/Number.js +26 -6
  232. package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
  233. package/lib/mjs/components/number/fixtures/comp10.js +19 -0
  234. package/lib/mjs/components/number/fixtures/comp8.d.ts +32 -0
  235. package/lib/mjs/components/number/fixtures/comp8.js +26 -0
  236. package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
  237. package/lib/mjs/components/number/fixtures/comp9.js +19 -0
  238. package/lib/mjs/components/number/fixtures/index.d.ts +4 -1
  239. package/lib/mjs/components/number/fixtures/index.js +4 -1
  240. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  241. package/lib/mjs/components/panel/Panel.js +1 -0
  242. package/lib/mjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
  243. package/lib/mjs/components/phonenumber/fixtures/comp2.js +23 -0
  244. package/lib/mjs/components/phonenumber/fixtures/index.d.ts +2 -1
  245. package/lib/mjs/components/phonenumber/fixtures/index.js +2 -1
  246. package/lib/mjs/components/radio/Radio.d.ts +2 -18
  247. package/lib/mjs/components/radio/Radio.js +32 -30
  248. package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
  249. package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
  250. package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
  251. package/lib/mjs/components/radio/fixtures/index.js +2 -1
  252. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  253. package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
  254. package/lib/mjs/components/select/Select.d.ts +38 -0
  255. package/lib/mjs/components/select/Select.js +17 -6
  256. package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
  257. package/lib/mjs/components/select/fixtures/comp25.js +64 -0
  258. package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
  259. package/lib/mjs/components/select/fixtures/comp26.js +57 -0
  260. package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
  261. package/lib/mjs/components/select/fixtures/index.js +3 -1
  262. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  263. package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
  264. package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  265. package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
  266. package/lib/mjs/components/tags/Tags.js +3 -3
  267. package/lib/mjs/components/time/Time.d.ts +2 -2
  268. package/lib/mjs/components/time/Time.form.js +2 -2
  269. package/lib/mjs/components/time/Time.js +3 -13
  270. package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
  271. package/lib/mjs/components/time/fixtures/comp4.js +169 -0
  272. package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
  273. package/lib/mjs/components/time/fixtures/index.js +2 -1
  274. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +5 -0
  275. package/lib/mjs/providers/address/GoogleAddressProvider.js +22 -1
  276. package/lib/mjs/templates/Templates.js +1 -1
  277. package/lib/mjs/translations/en.d.ts +4 -0
  278. package/lib/mjs/translations/en.js +5 -1
  279. package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
  280. package/lib/mjs/utils/utils.d.ts +2 -11
  281. package/lib/mjs/utils/utils.js +59 -13
  282. package/lib/mjs/widgets/CalendarWidget.js +24 -10
  283. package/package.json +5 -6
@@ -5,7 +5,7 @@ export default class HTMLComponent extends Component {
5
5
  return Component.schema({
6
6
  label: 'HTML',
7
7
  type: 'htmlelement',
8
- tag: 'p',
8
+ tag: 'div',
9
9
  attrs: [],
10
10
  content: '',
11
11
  input: false,
@@ -27,11 +27,26 @@ export default class NumberComponent extends Input {
27
27
  */
28
28
  createNumberMask(): any;
29
29
  isDecimalAllowed(): any;
30
- parseNumber(value: any): number;
30
+ /**
31
+ * parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
32
+ * be processed by either parseInt or parseFloat
33
+ * @param {string} value the value to be parsed
34
+ * @returns {number} a parsed number
35
+ */
36
+ parseNumber(value: string): number;
31
37
  setInputMask(input: any): void;
32
38
  getValueAt(index: any): number | null;
33
39
  setValueAt(index: any, value: any, flags?: {}): void;
34
- parseValue(input: any): number;
40
+ /**
41
+ * Converts a string to a floating point number, formats the number based on the parsed float function
42
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
43
+ * formatted number back as a string
44
+ * Example Input: "123.456,22"
45
+ * Example Output: "123456,22"
46
+ * @param {string | number} input the numeric string to parse
47
+ * @returns {string | null} a parsed string
48
+ */
49
+ parseValue(input: string | number): string | null;
35
50
  focus(): void;
36
51
  getMaskedValue(value: any): any;
37
52
  getValueAsString(value: any, options: any): any;
@@ -46,16 +46,16 @@ export default class NumberComponent extends Input {
46
46
  constructor(...args) {
47
47
  super(...args);
48
48
  const separators = getNumberSeparators(this.options.language || navigator.language);
49
- this.decimalSeparator = this.options.decimalSeparator = this.options.decimalSeparator
49
+ this.decimalSeparator = this.options.decimalSeparator = this.component.decimalSymbol || this.options.decimalSeparator
50
50
  || this.options.properties?.decimalSeparator
51
51
  || separators.decimalSeparator;
52
52
  if (this.component.delimiter) {
53
- if (this.options.hasOwnProperty('thousandsSeparator')) {
54
- console.warn("Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.");
55
- }
56
- this.delimiter = this.options.properties?.thousandsSeparator || this.options.thousandsSeparator || separators.delimiter;
53
+ this.delimiter = this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator || separators.delimiter;
57
54
  }
58
55
  else {
56
+ if (this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator) {
57
+ console.warn('In order for thousands separator to work properly, you must set the delimiter to true in the component json');
58
+ }
59
59
  this.delimiter = '';
60
60
  }
61
61
  const requireDecimal = _.get(this.component, 'requireDecimal', false);
@@ -77,7 +77,7 @@ export default class NumberComponent extends Input {
77
77
  prefix: '',
78
78
  suffix: '',
79
79
  requireDecimal: _.get(this.component, 'requireDecimal', false),
80
- thousandsSeparatorSymbol: _.get(this.component, 'thousandsSeparator', this.delimiter),
80
+ thousandsSeparatorSymbol: this.delimiter || '',
81
81
  decimalSymbol: _.get(this.component, 'decimalSymbol', this.decimalSeparator),
82
82
  decimalLimit: _.get(this.component, 'decimalLimit', this.decimalLimit),
83
83
  allowNegative: _.get(this.component, 'allowNegative', true),
@@ -89,6 +89,11 @@ export default class NumberComponent extends Input {
89
89
  }
90
90
  get defaultValue() {
91
91
  let defaultValue = super.defaultValue;
92
+ if (typeof defaultValue === 'string') {
93
+ // Default value may be a string or have custom thousands separators or decimal symbols, so we need to call
94
+ // parseNumber on it
95
+ defaultValue = this.parseNumber(defaultValue);
96
+ }
92
97
  if (!defaultValue && this.component.defaultValue === 0) {
93
98
  defaultValue = this.component.defaultValue;
94
99
  }
@@ -100,6 +105,12 @@ export default class NumberComponent extends Input {
100
105
  isDecimalAllowed() {
101
106
  return _.get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));
102
107
  }
108
+ /**
109
+ * parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
110
+ * be processed by either parseInt or parseFloat
111
+ * @param {string} value the value to be parsed
112
+ * @returns {number} a parsed number
113
+ */
103
114
  parseNumber(value) {
104
115
  // Remove delimiters and convert decimal separator to dot.
105
116
  value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
@@ -144,6 +155,15 @@ export default class NumberComponent extends Input {
144
155
  setValueAt(index, value, flags = {}) {
145
156
  return super.setValueAt(index, this.formatValue(this.parseValue(value)), flags);
146
157
  }
158
+ /**
159
+ * Converts a string to a floating point number, formats the number based on the parsed float function
160
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
161
+ * formatted number back as a string
162
+ * Example Input: "123.456,22"
163
+ * Example Output: "123456,22"
164
+ * @param {string | number} input the numeric string to parse
165
+ * @returns {string | null} a parsed string
166
+ */
147
167
  parseValue(input) {
148
168
  if (typeof input === 'string') {
149
169
  input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
@@ -0,0 +1,18 @@
1
+ declare namespace _default {
2
+ let components: {
3
+ label: string;
4
+ applyMaskOn: string;
5
+ mask: boolean;
6
+ tableView: boolean;
7
+ delimiter: boolean;
8
+ requireDecimal: boolean;
9
+ inputFormat: string;
10
+ truncateMultipleSpaces: boolean;
11
+ validateWhenHidden: boolean;
12
+ key: string;
13
+ type: string;
14
+ input: boolean;
15
+ defaultValue: string;
16
+ }[];
17
+ }
18
+ export default _default;
@@ -0,0 +1,19 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Number",
5
+ "applyMaskOn": "change",
6
+ "mask": false,
7
+ "tableView": false,
8
+ "delimiter": false,
9
+ "requireDecimal": false,
10
+ "inputFormat": "plain",
11
+ "truncateMultipleSpaces": false,
12
+ "validateWhenHidden": false,
13
+ "key": "number",
14
+ "type": "number",
15
+ "input": true,
16
+ "defaultValue": "123.23"
17
+ }
18
+ ]
19
+ };
@@ -0,0 +1,32 @@
1
+ declare namespace _default {
2
+ let components: ({
3
+ label: string;
4
+ applyMaskOn: string;
5
+ mask: boolean;
6
+ tableView: boolean;
7
+ delimiter: boolean;
8
+ requireDecimal: boolean;
9
+ inputFormat: string;
10
+ truncateMultipleSpaces: boolean;
11
+ key: string;
12
+ type: string;
13
+ input: boolean;
14
+ decimalSymbol: string;
15
+ disableOnInvalid?: undefined;
16
+ } | {
17
+ type: string;
18
+ label: string;
19
+ key: string;
20
+ disableOnInvalid: boolean;
21
+ input: boolean;
22
+ tableView: boolean;
23
+ applyMaskOn?: undefined;
24
+ mask?: undefined;
25
+ delimiter?: undefined;
26
+ requireDecimal?: undefined;
27
+ inputFormat?: undefined;
28
+ truncateMultipleSpaces?: undefined;
29
+ decimalSymbol?: undefined;
30
+ })[];
31
+ }
32
+ export default _default;
@@ -0,0 +1,26 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Number",
5
+ "applyMaskOn": "change",
6
+ "mask": false,
7
+ "tableView": false,
8
+ "delimiter": false,
9
+ "requireDecimal": false,
10
+ "inputFormat": "plain",
11
+ "truncateMultipleSpaces": false,
12
+ "key": "number",
13
+ "type": "number",
14
+ "input": true,
15
+ "decimalSymbol": "-"
16
+ },
17
+ {
18
+ "type": "button",
19
+ "label": "Submit",
20
+ "key": "submit",
21
+ "disableOnInvalid": true,
22
+ "input": true,
23
+ "tableView": false
24
+ }
25
+ ]
26
+ };
@@ -0,0 +1,18 @@
1
+ declare namespace _default {
2
+ let components: {
3
+ label: string;
4
+ applyMaskOn: string;
5
+ mask: boolean;
6
+ tableView: boolean;
7
+ delimiter: boolean;
8
+ requireDecimal: boolean;
9
+ inputFormat: string;
10
+ truncateMultipleSpaces: boolean;
11
+ key: string;
12
+ type: string;
13
+ input: boolean;
14
+ decimalSymbol: string;
15
+ thousandsSeparator: string;
16
+ }[];
17
+ }
18
+ export default _default;
@@ -0,0 +1,19 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Number",
5
+ "applyMaskOn": "change",
6
+ "mask": false,
7
+ "tableView": false,
8
+ "delimiter": true,
9
+ "requireDecimal": false,
10
+ "inputFormat": "plain",
11
+ "truncateMultipleSpaces": false,
12
+ "key": "number",
13
+ "type": "number",
14
+ "input": true,
15
+ "decimalSymbol": ",",
16
+ "thousandsSeparator": "."
17
+ }
18
+ ]
19
+ };
@@ -5,4 +5,7 @@ import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
6
  import comp6 from './comp6';
7
7
  import comp7 from './comp7';
8
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7 };
8
+ import comp8 from './comp8';
9
+ import comp9 from './comp9';
10
+ import comp10 from './comp10';
11
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
@@ -5,4 +5,7 @@ import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
6
  import comp6 from './comp6';
7
7
  import comp7 from './comp7';
8
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7 };
8
+ import comp8 from './comp8';
9
+ import comp9 from './comp9';
10
+ import comp10 from './comp10';
11
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
@@ -4,6 +4,7 @@ export default class PanelComponent 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
  };
@@ -22,6 +22,7 @@ export default class PanelComponent extends NestedComponent {
22
22
  icon: 'list-alt',
23
23
  group: 'layout',
24
24
  documentation: '/userguide/form-building/layout-components#panel',
25
+ showPreview: false,
25
26
  weight: 30,
26
27
  schema: PanelComponent.schema()
27
28
  };
@@ -0,0 +1,16 @@
1
+ declare namespace _default {
2
+ let components: {
3
+ label: string;
4
+ applyMaskOn: string;
5
+ allowMultipleMasks: boolean;
6
+ tableView: boolean;
7
+ key: string;
8
+ type: string;
9
+ inputMasks: {
10
+ label: string;
11
+ mask: string;
12
+ }[];
13
+ input: boolean;
14
+ }[];
15
+ }
16
+ export default _default;
@@ -0,0 +1,23 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Phone Number",
5
+ "applyMaskOn": "change",
6
+ "allowMultipleMasks": true,
7
+ "tableView": true,
8
+ "key": "phoneNumber",
9
+ "type": "phoneNumber",
10
+ "inputMasks": [
11
+ {
12
+ "label": "Canada",
13
+ "mask": "(999) 999-9999"
14
+ },
15
+ {
16
+ "label": "Other",
17
+ "mask": ""
18
+ }
19
+ ],
20
+ "input": true
21
+ }
22
+ ]
23
+ };
@@ -1,2 +1,3 @@
1
- export { comp1 };
2
1
  import comp1 from './comp1';
2
+ import comp2 from './comp2';
3
+ export { comp1, comp2 };
@@ -1,2 +1,3 @@
1
1
  import comp1 from './comp1';
2
- export { comp1 };
2
+ import comp2 from './comp2';
3
+ export { comp1, comp2 };
@@ -8,26 +8,10 @@ export default class RadioComponent extends ListComponent {
8
8
  schema: any;
9
9
  };
10
10
  static get conditionOperatorsSettings(): {
11
- valueComponent(classComp: any): {
12
- type: string;
13
- dataSrc: string;
14
- valueProperty: string;
15
- dataType: any;
16
- data: {
17
- custom(): any;
18
- };
19
- };
11
+ valueComponent(classComp: any): any;
20
12
  };
21
13
  static get serverConditionSettings(): {
22
- valueComponent(classComp: any): {
23
- type: string;
24
- dataSrc: string;
25
- valueProperty: string;
26
- dataType: any;
27
- data: {
28
- custom: string;
29
- };
30
- };
14
+ valueComponent(classComp: any): any;
31
15
  };
32
16
  static savedValueTypes(schema: any): any[];
33
17
  constructor(component: any, options: any, data: any);
@@ -30,35 +30,26 @@ export default class RadioComponent extends ListComponent {
30
30
  return {
31
31
  ...super.conditionOperatorsSettings,
32
32
  valueComponent(classComp) {
33
- return {
34
- type: 'select',
35
- dataSrc: 'custom',
36
- valueProperty: 'value',
37
- dataType: classComp.dataType || '',
38
- data: {
39
- custom() {
40
- return classComp.values;
33
+ const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';
34
+ return isValuesSrc
35
+ ? {
36
+ type: 'select',
37
+ dataSrc: 'custom',
38
+ valueProperty: 'value',
39
+ dataType: classComp.dataType || '',
40
+ data: {
41
+ custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
41
42
  }
42
- },
43
- };
43
+ }
44
+ : {
45
+ ...classComp,
46
+ type: 'select',
47
+ };
44
48
  }
45
49
  };
46
50
  }
47
51
  static get serverConditionSettings() {
48
- return {
49
- ...super.serverConditionSettings,
50
- valueComponent(classComp) {
51
- return {
52
- type: 'select',
53
- dataSrc: 'custom',
54
- valueProperty: 'value',
55
- dataType: classComp.dataType || '',
56
- data: {
57
- custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
58
- },
59
- };
60
- },
61
- };
52
+ return RadioComponent.conditionOperatorsSettings;
62
53
  }
63
54
  static savedValueTypes(schema) {
64
55
  const { boolean, string, number, object, array } = componentValueTypes;
@@ -264,6 +255,16 @@ export default class RadioComponent extends ListComponent {
264
255
  if (method.toUpperCase() === 'GET') {
265
256
  body = null;
266
257
  }
258
+ const limit = this.component.limit || 100;
259
+ const skip = this.isScrollLoading ? this.selectOptions.length : 0;
260
+ // Allow for url interpolation.
261
+ url = this.sanitize(this.interpolate(url, {
262
+ formioBase: Formio.getBaseUrl(),
263
+ search,
264
+ limit,
265
+ skip,
266
+ page: Math.abs(Math.floor(skip / limit))
267
+ }), this.shouldSanitizeValue);
267
268
  // Set ignoreCache if it is
268
269
  options.ignoreCache = this.component.ignoreCache;
269
270
  // Make the request.
@@ -295,14 +296,15 @@ export default class RadioComponent extends ListComponent {
295
296
  setItems(items) {
296
297
  const listData = [];
297
298
  items?.forEach((item, i) => {
299
+ const valueAtProperty = _.get(item, this.component.valueProperty);
298
300
  this.loadedOptions[i] = {
299
- value: this.component.valueProperty ? item[this.component.valueProperty] : item,
300
- label: this.component.valueProperty ? this.itemTemplate(item, item[this.component.valueProperty]) : this.itemTemplate(item, item, i)
301
+ value: this.component.valueProperty ? valueAtProperty : item,
302
+ label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
301
303
  };
302
- listData.push(this.templateData[this.component.valueProperty ? item[this.component.valueProperty] : i]);
303
- if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(item[this.component.valueProperty]) ||
304
- (!this.isRadio && _.isObject(item[this.component.valueProperty])) ||
305
- (!this.isRadio && _.isBoolean(item[this.component.valueProperty])))) {
304
+ listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
305
+ if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(valueAtProperty) ||
306
+ (!this.isRadio && _.isObject(valueAtProperty)) ||
307
+ (!this.isRadio && _.isBoolean(valueAtProperty)))) {
306
308
  this.loadedOptions[i].invalid = true;
307
309
  }
308
310
  });
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ let components: {
3
+ label: string;
4
+ optionsLabelPosition: string;
5
+ tableView: boolean;
6
+ dataSrc: string;
7
+ values: {
8
+ label: string;
9
+ value: string;
10
+ shortcut: string;
11
+ }[];
12
+ valueProperty: string;
13
+ validateWhenHidden: boolean;
14
+ key: string;
15
+ type: string;
16
+ data: {
17
+ url: string;
18
+ headers: {
19
+ key: string;
20
+ value: string;
21
+ }[];
22
+ };
23
+ template: string;
24
+ authenticate: boolean;
25
+ input: boolean;
26
+ inputType: string;
27
+ }[];
28
+ }
29
+ export default _default;
@@ -0,0 +1,34 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Select Boxes",
5
+ "optionsLabelPosition": "right",
6
+ "tableView": false,
7
+ "dataSrc": "url",
8
+ "values": [
9
+ {
10
+ "label": "",
11
+ "value": "",
12
+ "shortcut": ""
13
+ }
14
+ ],
15
+ "valueProperty": "data.name",
16
+ "validateWhenHidden": false,
17
+ "key": "selectBoxes",
18
+ "type": "selectboxes",
19
+ "data": {
20
+ "url": "https://remote-dev.form.io/projectId/name/submission",
21
+ "headers": [
22
+ {
23
+ "key": "",
24
+ "value": ""
25
+ }
26
+ ]
27
+ },
28
+ "template": "<span>{{ item.data.name }}</span>",
29
+ "authenticate": true,
30
+ "input": true,
31
+ "inputType": "checkbox"
32
+ }
33
+ ]
34
+ };
@@ -9,4 +9,5 @@ import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
10
  import comp10 from './comp10';
11
11
  import comp11 from './comp11';
12
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11 };
12
+ import comp12 from './comp12';
13
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
@@ -9,4 +9,5 @@ import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
10
  import comp10 from './comp10';
11
11
  import comp11 from './comp11';
12
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11 };
12
+ import comp12 from './comp12';
13
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
@@ -1,6 +1,12 @@
1
1
  export default class ReCaptchaComponent extends Component {
2
2
  static get builderInfo(): {};
3
3
  static savedValueTypes(): never[];
4
+ static get conditionOperatorsSettings(): {
5
+ operators: string[];
6
+ };
7
+ static get serverConditionSettings(): {
8
+ operators: string[];
9
+ };
4
10
  render(): string;
5
11
  recaptchaResult: any;
6
12
  createInput(): void;
@@ -17,6 +17,15 @@ export default class ReCaptchaComponent extends Component {
17
17
  static savedValueTypes() {
18
18
  return [];
19
19
  }
20
+ static get conditionOperatorsSettings() {
21
+ return {
22
+ ...super.conditionOperatorsSettings,
23
+ operators: ['isEmpty', 'isNotEmpty'],
24
+ };
25
+ }
26
+ static get serverConditionSettings() {
27
+ return ReCaptchaComponent.conditionOperatorsSettings;
28
+ }
20
29
  render() {
21
30
  this.recaptchaResult = null;
22
31
  if (this.builderMode) {
@@ -9,9 +9,47 @@ export default class SelectComponent extends ListComponent {
9
9
  };
10
10
  static get serverConditionSettings(): {
11
11
  valueComponent(classComp: any): any;
12
+ dataTypeOperators: {
13
+ number: string[];
14
+ };
15
+ dataTypeValueComponents: {
16
+ number: {
17
+ lessThan: () => {
18
+ type: string;
19
+ };
20
+ greaterThan: () => {
21
+ type: string;
22
+ };
23
+ lessThanOrEqual: () => {
24
+ type: string;
25
+ };
26
+ greaterThanOrEqual: () => {
27
+ type: string;
28
+ };
29
+ };
30
+ };
12
31
  };
13
32
  static get conditionOperatorsSettings(): {
14
33
  valueComponent(classComp: any): any;
34
+ dataTypeOperators: {
35
+ number: string[];
36
+ };
37
+ dataTypeValueComponents: {
38
+ number: {
39
+ lessThan: () => {
40
+ type: string;
41
+ };
42
+ greaterThan: () => {
43
+ type: string;
44
+ };
45
+ lessThanOrEqual: () => {
46
+ type: string;
47
+ };
48
+ greaterThanOrEqual: () => {
49
+ type: string;
50
+ };
51
+ };
52
+ };
15
53
  };
16
54
  static savedValueTypes(schema: any): any[];
17
55
  templateData: {} | undefined;