@formio/js 5.5.0 → 5.5.1-api99.0

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 (61) hide show
  1. package/README.md +1 -0
  2. package/dist/formio.embed.js +1 -1
  3. package/dist/formio.embed.min.js +1 -1
  4. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  5. package/dist/formio.form.js +912 -912
  6. package/dist/formio.form.min.js +1 -1
  7. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  8. package/dist/formio.full.js +1205 -1205
  9. package/dist/formio.full.min.js +1 -1
  10. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  11. package/dist/formio.js +820 -820
  12. package/dist/formio.min.js +1 -1
  13. package/dist/formio.min.js.LICENSE.txt +1 -1
  14. package/dist/formio.utils.js +763 -763
  15. package/dist/formio.utils.min.js +1 -1
  16. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  17. package/lib/cjs/Embed.js +1 -1
  18. package/lib/cjs/Formio.js +1 -1
  19. package/lib/cjs/PDF.js +2 -0
  20. package/lib/cjs/Wizard.js +5 -2
  21. package/lib/cjs/components/_classes/component/Component.d.ts +7 -0
  22. package/lib/cjs/components/_classes/component/Component.js +37 -5
  23. package/lib/cjs/components/_classes/input/Input.js +1 -0
  24. package/lib/cjs/components/address/Address.d.ts +2 -0
  25. package/lib/cjs/components/address/Address.js +21 -16
  26. package/lib/cjs/components/editgrid/EditGrid.js +13 -1
  27. package/lib/cjs/components/form/Form.js +10 -1
  28. package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +67 -109
  29. package/lib/cjs/components/select/editForm/Select.edit.data.js +0 -42
  30. package/lib/cjs/components/textarea/TextArea.js +4 -0
  31. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.d.ts +75 -5
  32. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +13 -0
  33. package/lib/cjs/package.json +1 -1
  34. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +1 -1
  35. package/lib/cjs/providers/address/GoogleAddressProvider.js +14 -2
  36. package/lib/cjs/utils/index.d.ts +1 -0
  37. package/lib/cjs/utils/utils.d.ts +7 -0
  38. package/lib/cjs/utils/utils.js +32 -5
  39. package/lib/mjs/Embed.js +1 -1
  40. package/lib/mjs/Formio.js +1 -1
  41. package/lib/mjs/PDF.js +2 -0
  42. package/lib/mjs/Wizard.js +5 -2
  43. package/lib/mjs/components/_classes/component/Component.d.ts +7 -0
  44. package/lib/mjs/components/_classes/component/Component.js +37 -5
  45. package/lib/mjs/components/_classes/input/Input.js +1 -0
  46. package/lib/mjs/components/address/Address.d.ts +2 -0
  47. package/lib/mjs/components/address/Address.js +19 -7
  48. package/lib/mjs/components/editgrid/EditGrid.js +13 -1
  49. package/lib/mjs/components/form/Form.js +10 -1
  50. package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +67 -109
  51. package/lib/mjs/components/select/editForm/Select.edit.data.js +0 -42
  52. package/lib/mjs/components/textarea/TextArea.js +4 -0
  53. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.d.ts +75 -5
  54. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +13 -0
  55. package/lib/mjs/package.json +1 -1
  56. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +1 -1
  57. package/lib/mjs/providers/address/GoogleAddressProvider.js +13 -2
  58. package/lib/mjs/utils/index.d.ts +1 -0
  59. package/lib/mjs/utils/utils.d.ts +7 -0
  60. package/lib/mjs/utils/utils.js +29 -3
  61. package/package.json +5 -4
@@ -404,6 +404,27 @@ export function checkTrigger(component, trigger, row, data, form, instance) {
404
404
  // If none of the types matched, don't fire the trigger.
405
405
  return false;
406
406
  }
407
+ /**
408
+ * Recursively HTML-escape strings in submission-like objects so logic templates
409
+ * (e.g. dynamic labels) cannot treat user-entered values as HTML.
410
+ * @param {*} obj - The value to escape.
411
+ * @returns {*} - The same structure with strings escaped.
412
+ */
413
+ export function escapeInterpolationDataStrings(obj) {
414
+ if (obj === null || obj === undefined) {
415
+ return obj;
416
+ }
417
+ if (typeof obj === 'string') {
418
+ return _.escape(obj);
419
+ }
420
+ if (Array.isArray(obj)) {
421
+ return obj.map(escapeInterpolationDataStrings);
422
+ }
423
+ if (_.isPlainObject(obj)) {
424
+ return _.mapValues(obj, escapeInterpolationDataStrings);
425
+ }
426
+ return obj;
427
+ }
407
428
  /**
408
429
  * Sets a property on a component via an executed Logic action.
409
430
  * @param {import('@formio/core').Component} component - The component to set the property on.
@@ -426,11 +447,16 @@ export function setActionProperty(component, action, result, row, data, instance
426
447
  break;
427
448
  }
428
449
  case 'string': {
450
+ const safeData = escapeInterpolationDataStrings(data);
451
+ const safeRow = escapeInterpolationDataStrings(row);
452
+ const safeResult = typeof result === 'string'
453
+ ? _.escape(result)
454
+ : escapeInterpolationDataStrings(result);
429
455
  const evalData = {
430
- data,
431
- row,
456
+ data: safeData,
457
+ row: safeRow,
432
458
  component,
433
- result,
459
+ result: safeResult,
434
460
  };
435
461
  const textValue = action.property.component ? action[action.property.component] : action.text;
436
462
  const currentValue = _.get(component, property, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.5.0",
3
+ "version": "5.5.1-api99.0",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -59,6 +59,7 @@
59
59
  "@formio/text-mask-addons": "^3.8.0-formio.4",
60
60
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
61
61
  "abortcontroller-polyfill": "^1.7.5",
62
+ "animation-frame-polyfill": "~1.0.3",
62
63
  "autocompleter": "^8.0.4",
63
64
  "bootstrap": "^5.3.3",
64
65
  "browser-cookies": "^1.2.0",
@@ -68,7 +69,7 @@
68
69
  "core-js": "^3.37.1",
69
70
  "dialog-polyfill": "^0.5.6",
70
71
  "dom-autoscroller": "^2.3.4",
71
- "dompurify": "^3.4.0",
72
+ "dompurify": "^3.4.12",
72
73
  "downloadjs": "^1.4.7",
73
74
  "dragula": "^3.7.3",
74
75
  "eventemitter3": "^5.0.1",
@@ -89,8 +90,8 @@
89
90
  "tippy.js": "^6.3.7",
90
91
  "uuid": "^9.0.0",
91
92
  "vanilla-picker": "^2.12.3",
92
- "@formio/bootstrap": "^4.0.3",
93
- "@formio/core": "^2.8.0"
93
+ "@formio/bootstrap": "^4.0.4-api99.0",
94
+ "@formio/core": "^2.8.1-api99.0"
94
95
  },
95
96
  "devDependencies": {
96
97
  "@types/node": "^22.15.19",