udp-stencil-component-library 25.18.2-beta.4 → 25.18.2-beta.5

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 (231) hide show
  1. package/dist/cjs/date-time-renderer.file-upload-renderer.form-metadata-display-renderer.list-options-renderer.question-specific-configs-renderer.signature-renderer.text-input-renderer.entry.cjs.js.map +1 -1
  2. package/dist/cjs/date-time-renderer_7.cjs.entry.js +13 -13
  3. package/dist/cjs/{enums-DVbZnzL8.js → enums-CgcTuQjC.js} +8 -2
  4. package/dist/cjs/enums-CgcTuQjC.js.map +1 -0
  5. package/dist/cjs/form-metadata-display.image-upload.signature-input.stencil-form.tally-display.udp-question.udp-question-comments.udp-save-draft-button.entry.cjs.js.map +1 -1
  6. package/dist/cjs/form-metadata-display_8.cjs.entry.js +10 -10
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/question-configs-renderer.section-configs-renderer.udp-forms-builder-menu.udp-forms-builder-question-item.entry.cjs.js.map +1 -1
  9. package/dist/cjs/question-configs-renderer_4.cjs.entry.js +7 -7
  10. package/dist/cjs/stencil-library.cjs.js +1 -1
  11. package/dist/cjs/{udp-forms-builder-question-template-CNONS2l5.js → udp-forms-builder-question-template-BMMpObLX.js} +3 -3
  12. package/dist/cjs/udp-forms-builder-question-template-BMMpObLX.js.map +1 -0
  13. package/dist/cjs/udp-forms-builder.cjs.entry.js +2 -2
  14. package/dist/cjs/udp-forms-builder.entry.cjs.js.map +1 -1
  15. package/dist/cjs/udp-forms-follow-up-list-card.cjs.entry.js +3 -3
  16. package/dist/cjs/udp-forms-follow-up-list-card.entry.cjs.js.map +1 -1
  17. package/dist/cjs/udp-forms-list-card.cjs.entry.js +6 -6
  18. package/dist/cjs/udp-forms-list-card.entry.cjs.js.map +1 -1
  19. package/dist/cjs/udp-forms-list.cjs.entry.js +2 -2
  20. package/dist/cjs/udp-forms-list.entry.cjs.js.map +1 -1
  21. package/dist/cjs/udp-forms-renderer.cjs.entry.js +270 -202
  22. package/dist/cjs/udp-forms-renderer.entry.cjs.js.map +1 -1
  23. package/dist/cjs/udp-forms-ui.cjs.entry.js +6 -6
  24. package/dist/cjs/udp-forms-ui.entry.cjs.js.map +1 -1
  25. package/dist/cjs/{utils-DZ_OMtAy.js → utils-Bp02BX38.js} +8 -8
  26. package/dist/cjs/utils-Bp02BX38.js.map +1 -0
  27. package/dist/collection/components/forms/udp-forms/udp-forms-builder/forms-builder-utils.js +1 -1
  28. package/dist/collection/components/forms/udp-forms/udp-forms-builder/forms-builder-utils.js.map +1 -1
  29. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/date-time-renderer/date-time-renderer.js +3 -3
  30. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/date-time-renderer/date-time-renderer.js.map +1 -1
  31. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/file-upload-renderer/file-upload-renderer.js +4 -4
  32. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/file-upload-renderer/file-upload-renderer.js.map +1 -1
  33. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/form-metadata-display-renderer/form-metadata-display-renderer.js +5 -5
  34. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/form-metadata-display-renderer/form-metadata-display-renderer.js.map +1 -1
  35. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/list-option-renderer/list-options-renderer.js +5 -5
  36. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/list-option-renderer/list-options-renderer.js.map +1 -1
  37. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/question-configs-renderer/question-configs-renderer.js +6 -6
  38. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/question-configs-renderer/question-configs-renderer.js.map +1 -1
  39. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/question-specific-configs-renderer/question-specific-configs-renderer.js +1 -1
  40. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/question-specific-configs-renderer/question-specific-configs-renderer.js.map +1 -1
  41. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/signature-renderer/signature-renderer.js +3 -3
  42. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/signature-renderer/signature-renderer.js.map +1 -1
  43. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/text-input-renderer/text-input-renderer.js +4 -4
  44. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/text-input-renderer/text-input-renderer.js.map +1 -1
  45. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-question-template.js +1 -1
  46. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-question-template.js.map +1 -1
  47. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder.js +3 -3
  48. package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder.js.map +1 -1
  49. package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list-card/udp-forms-list-card.js +7 -7
  50. package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list-card/udp-forms-list-card.js.map +1 -1
  51. package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list.js +2 -2
  52. package/dist/collection/components/forms/udp-forms/udp-forms-list/udp-forms-list.js.map +1 -1
  53. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-follow-up-list-card/udp-forms-follow-up-list-card.js +3 -3
  54. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-follow-up-list-card/udp-forms-follow-up-list-card.js.map +1 -1
  55. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-ui/udp-forms-ui.js +13 -13
  56. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-ui/udp-forms-ui.js.map +1 -1
  57. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils.js +195 -0
  58. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils.js.map +1 -0
  59. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js +86 -238
  60. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js.map +1 -1
  61. package/dist/collection/components/forms/udp-forms/udp-forms-utils/classes/UdpForm.js.map +1 -0
  62. package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/classes/UdpFormSubmission.js +4 -12
  63. package/dist/collection/components/forms/udp-forms/udp-forms-utils/classes/UdpFormSubmission.js.map +1 -0
  64. package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/enums.js +6 -0
  65. package/dist/collection/components/forms/udp-forms/udp-forms-utils/enums.js.map +1 -0
  66. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-handler/IFormHandler.js.map +1 -0
  67. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.js.map +1 -0
  68. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.js.map +1 -0
  69. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/IFormSubmissionHandler.js.map +1 -0
  70. package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/PrivateFormSubmissionHandler.js +6 -4
  71. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PrivateFormSubmissionHandler.js.map +1 -0
  72. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PublicFormSubmissionHandler.js.map +1 -0
  73. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/formUtils.js.map +1 -0
  74. package/dist/collection/components/forms/udp-forms/udp-forms-utils/types.js.map +1 -0
  75. package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/utils.js +5 -5
  76. package/dist/collection/components/forms/udp-forms/udp-forms-utils/utils.js.map +1 -0
  77. package/dist/collection/components/forms/udp-forms/udp-question/udp-question-comment/udp-question-comments.js +10 -10
  78. package/dist/collection/components/forms/udp-forms/udp-question/udp-question-comment/udp-question-comments.js.map +1 -1
  79. package/dist/collection/components/forms/udp-forms/udp-question/udp-question.js +13 -13
  80. package/dist/collection/components/forms/udp-forms/udp-question/udp-question.js.map +1 -1
  81. package/dist/collection/components/inputs/form metadata display/form-metadata-display.js +2 -2
  82. package/dist/collection/components/inputs/form metadata display/form-metadata-display.js.map +1 -1
  83. package/dist/components/date-time-renderer2.js.map +1 -1
  84. package/dist/components/enums.js +7 -1
  85. package/dist/components/enums.js.map +1 -1
  86. package/dist/components/file-upload-renderer2.js +2 -2
  87. package/dist/components/file-upload-renderer2.js.map +1 -1
  88. package/dist/components/form-metadata-display-renderer2.js +3 -3
  89. package/dist/components/form-metadata-display-renderer2.js.map +1 -1
  90. package/dist/components/form-metadata-display2.js +1 -1
  91. package/dist/components/form-metadata-display2.js.map +1 -1
  92. package/dist/components/forms-builder-utils.js.map +1 -1
  93. package/dist/components/list-options-renderer2.js +3 -3
  94. package/dist/components/list-options-renderer2.js.map +1 -1
  95. package/dist/components/question-configs-renderer2.js +5 -5
  96. package/dist/components/question-configs-renderer2.js.map +1 -1
  97. package/dist/components/question-specific-configs-renderer2.js.map +1 -1
  98. package/dist/components/signature-renderer2.js +1 -1
  99. package/dist/components/signature-renderer2.js.map +1 -1
  100. package/dist/components/text-input-renderer2.js +2 -2
  101. package/dist/components/text-input-renderer2.js.map +1 -1
  102. package/dist/components/udp-forms-builder.js.map +1 -1
  103. package/dist/components/udp-forms-follow-up-list-card.js +2 -2
  104. package/dist/components/udp-forms-follow-up-list-card.js.map +1 -1
  105. package/dist/components/udp-forms-list-card2.js +4 -4
  106. package/dist/components/udp-forms-list-card2.js.map +1 -1
  107. package/dist/components/udp-forms-list.js +1 -1
  108. package/dist/components/udp-forms-list.js.map +1 -1
  109. package/dist/components/udp-forms-renderer.js +273 -207
  110. package/dist/components/udp-forms-renderer.js.map +1 -1
  111. package/dist/components/udp-forms-ui2.js +6 -6
  112. package/dist/components/udp-forms-ui2.js.map +1 -1
  113. package/dist/components/udp-question-comments2.js +5 -5
  114. package/dist/components/udp-question-comments2.js.map +1 -1
  115. package/dist/components/udp-question2.js +4 -4
  116. package/dist/components/udp-question2.js.map +1 -1
  117. package/dist/components/utils.js +6 -6
  118. package/dist/components/utils.js.map +1 -1
  119. package/dist/docs.json +118 -154
  120. package/dist/esm/date-time-renderer.file-upload-renderer.form-metadata-display-renderer.list-options-renderer.question-specific-configs-renderer.signature-renderer.text-input-renderer.entry.js.map +1 -1
  121. package/dist/esm/date-time-renderer_7.entry.js +13 -13
  122. package/dist/esm/{enums-CHxgVY-B.js → enums-DHT5wSnX.js} +9 -3
  123. package/dist/esm/enums-DHT5wSnX.js.map +1 -0
  124. package/dist/esm/form-metadata-display.image-upload.signature-input.stencil-form.tally-display.udp-question.udp-question-comments.udp-save-draft-button.entry.js.map +1 -1
  125. package/dist/esm/form-metadata-display_8.entry.js +10 -10
  126. package/dist/esm/loader.js +1 -1
  127. package/dist/esm/question-configs-renderer.section-configs-renderer.udp-forms-builder-menu.udp-forms-builder-question-item.entry.js.map +1 -1
  128. package/dist/esm/question-configs-renderer_4.entry.js +7 -7
  129. package/dist/esm/stencil-library.js +1 -1
  130. package/dist/esm/{udp-forms-builder-question-template-DQJb7f4Y.js → udp-forms-builder-question-template-D6ADNZEG.js} +3 -3
  131. package/dist/esm/udp-forms-builder-question-template-D6ADNZEG.js.map +1 -0
  132. package/dist/esm/udp-forms-builder.entry.js +2 -2
  133. package/dist/esm/udp-forms-builder.entry.js.map +1 -1
  134. package/dist/esm/udp-forms-follow-up-list-card.entry.js +3 -3
  135. package/dist/esm/udp-forms-follow-up-list-card.entry.js.map +1 -1
  136. package/dist/esm/udp-forms-list-card.entry.js +6 -6
  137. package/dist/esm/udp-forms-list-card.entry.js.map +1 -1
  138. package/dist/esm/udp-forms-list.entry.js +2 -2
  139. package/dist/esm/udp-forms-list.entry.js.map +1 -1
  140. package/dist/esm/udp-forms-renderer.entry.js +270 -202
  141. package/dist/esm/udp-forms-renderer.entry.js.map +1 -1
  142. package/dist/esm/udp-forms-ui.entry.js +6 -6
  143. package/dist/esm/udp-forms-ui.entry.js.map +1 -1
  144. package/dist/esm/{utils-CiUp9KGZ.js → utils-kwLwITIE.js} +8 -8
  145. package/dist/esm/utils-kwLwITIE.js.map +1 -0
  146. package/dist/stencil-library/date-time-renderer.file-upload-renderer.form-metadata-display-renderer.list-options-renderer.question-specific-configs-renderer.signature-renderer.text-input-renderer.entry.esm.js.map +1 -1
  147. package/dist/stencil-library/date-time-renderer_7.entry.js +1 -1
  148. package/dist/stencil-library/{enums-CHxgVY-B.js → enums-DHT5wSnX.js} +2 -2
  149. package/dist/stencil-library/enums-DHT5wSnX.js.map +1 -0
  150. package/dist/stencil-library/form-metadata-display.image-upload.signature-input.stencil-form.tally-display.udp-question.udp-question-comments.udp-save-draft-button.entry.esm.js.map +1 -1
  151. package/dist/stencil-library/form-metadata-display_8.entry.js +1 -1
  152. package/dist/stencil-library/form-metadata-display_8.entry.js.map +1 -1
  153. package/dist/stencil-library/question-configs-renderer.section-configs-renderer.udp-forms-builder-menu.udp-forms-builder-question-item.entry.esm.js.map +1 -1
  154. package/dist/stencil-library/question-configs-renderer_4.entry.js +1 -1
  155. package/dist/stencil-library/stencil-library.esm.js +1 -1
  156. package/dist/stencil-library/{udp-forms-builder-question-template-DQJb7f4Y.js → udp-forms-builder-question-template-D6ADNZEG.js} +2 -2
  157. package/dist/stencil-library/udp-forms-builder-question-template-D6ADNZEG.js.map +1 -0
  158. package/dist/stencil-library/udp-forms-builder.entry.esm.js.map +1 -1
  159. package/dist/stencil-library/udp-forms-builder.entry.js +1 -1
  160. package/dist/stencil-library/udp-forms-follow-up-list-card.entry.esm.js.map +1 -1
  161. package/dist/stencil-library/udp-forms-follow-up-list-card.entry.js +1 -1
  162. package/dist/stencil-library/udp-forms-list-card.entry.esm.js.map +1 -1
  163. package/dist/stencil-library/udp-forms-list-card.entry.js +1 -1
  164. package/dist/stencil-library/udp-forms-list-card.entry.js.map +1 -1
  165. package/dist/stencil-library/udp-forms-list.entry.esm.js.map +1 -1
  166. package/dist/stencil-library/udp-forms-list.entry.js +1 -1
  167. package/dist/stencil-library/udp-forms-renderer.entry.esm.js.map +1 -1
  168. package/dist/stencil-library/udp-forms-renderer.entry.js +1 -1
  169. package/dist/stencil-library/udp-forms-renderer.entry.js.map +1 -1
  170. package/dist/stencil-library/udp-forms-ui.entry.esm.js.map +1 -1
  171. package/dist/stencil-library/udp-forms-ui.entry.js +1 -1
  172. package/dist/stencil-library/udp-forms-ui.entry.js.map +1 -1
  173. package/dist/stencil-library/{utils-CiUp9KGZ.js → utils-kwLwITIE.js} +1 -1
  174. package/dist/stencil-library/utils-kwLwITIE.js.map +1 -0
  175. package/dist/types/components/forms/udp-forms/udp-forms-builder/forms-builder-utils.d.ts +2 -2
  176. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/date-time-renderer/date-time-renderer.d.ts +1 -1
  177. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/file-upload-renderer/file-upload-renderer.d.ts +1 -1
  178. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/form-metadata-display-renderer/form-metadata-display-renderer.d.ts +1 -1
  179. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/list-option-renderer/list-options-renderer.d.ts +1 -1
  180. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/signature-renderer/signature-renderer.d.ts +1 -1
  181. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-item/text-input-renderer/text-input-renderer.d.ts +1 -1
  182. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder-question-template.d.ts +1 -1
  183. package/dist/types/components/forms/udp-forms/udp-forms-builder/udp-forms-builder.d.ts +2 -2
  184. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-ui/udp-forms-ui.d.ts +4 -4
  185. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils.d.ts +12 -0
  186. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.d.ts +4 -9
  187. package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/classes/UdpFormSubmission.d.ts +4 -5
  188. package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/enums.d.ts +5 -0
  189. package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/types.d.ts +0 -1
  190. package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/utils.d.ts +1 -1
  191. package/dist/types/components/forms/udp-forms/udp-question/udp-question-comment/udp-question-comments.d.ts +2 -2
  192. package/dist/types/components/forms/udp-forms/udp-question/udp-question.d.ts +4 -4
  193. package/dist/types/components.d.ts +32 -30
  194. package/package.json +1 -1
  195. package/dist/cjs/enums-DVbZnzL8.js.map +0 -1
  196. package/dist/cjs/udp-forms-builder-question-template-CNONS2l5.js.map +0 -1
  197. package/dist/cjs/utils-DZ_OMtAy.js.map +0 -1
  198. package/dist/collection/components/forms/udp-forms/utils/classes/UdpForm.js.map +0 -1
  199. package/dist/collection/components/forms/udp-forms/utils/classes/UdpFormSubmission.js.map +0 -1
  200. package/dist/collection/components/forms/udp-forms/utils/enums.js.map +0 -1
  201. package/dist/collection/components/forms/udp-forms/utils/form-handler/IFormHandler.js.map +0 -1
  202. package/dist/collection/components/forms/udp-forms/utils/form-handler/UdpFormHandler.js.map +0 -1
  203. package/dist/collection/components/forms/udp-forms/utils/form-submission-handler/FormSubmissionHandlerFactory.js.map +0 -1
  204. package/dist/collection/components/forms/udp-forms/utils/form-submission-handler/IFormSubmissionHandler.js.map +0 -1
  205. package/dist/collection/components/forms/udp-forms/utils/form-submission-handler/PrivateFormSubmissionHandler.js.map +0 -1
  206. package/dist/collection/components/forms/udp-forms/utils/form-submission-handler/PublicFormSubmissionHandler.js.map +0 -1
  207. package/dist/collection/components/forms/udp-forms/utils/form-submission-handler/formUtils.js.map +0 -1
  208. package/dist/collection/components/forms/udp-forms/utils/types.js.map +0 -1
  209. package/dist/collection/components/forms/udp-forms/utils/utils.js.map +0 -1
  210. package/dist/esm/enums-CHxgVY-B.js.map +0 -1
  211. package/dist/esm/udp-forms-builder-question-template-DQJb7f4Y.js.map +0 -1
  212. package/dist/esm/utils-CiUp9KGZ.js.map +0 -1
  213. package/dist/stencil-library/enums-CHxgVY-B.js.map +0 -1
  214. package/dist/stencil-library/udp-forms-builder-question-template-DQJb7f4Y.js.map +0 -1
  215. package/dist/stencil-library/utils-CiUp9KGZ.js.map +0 -1
  216. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/classes/UdpForm.js +0 -0
  217. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-handler/IFormHandler.js +0 -0
  218. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-handler/UdpFormHandler.js +0 -0
  219. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/FormSubmissionHandlerFactory.js +0 -0
  220. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/IFormSubmissionHandler.js +0 -0
  221. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/PublicFormSubmissionHandler.js +0 -0
  222. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/formUtils.js +0 -0
  223. /package/dist/collection/components/forms/udp-forms/{utils → udp-forms-utils}/types.js +0 -0
  224. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/classes/UdpForm.d.ts +0 -0
  225. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-handler/IFormHandler.d.ts +0 -0
  226. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-handler/UdpFormHandler.d.ts +0 -0
  227. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/FormSubmissionHandlerFactory.d.ts +0 -0
  228. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/IFormSubmissionHandler.d.ts +0 -0
  229. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/PrivateFormSubmissionHandler.d.ts +0 -0
  230. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/PublicFormSubmissionHandler.d.ts +0 -0
  231. /package/dist/types/components/forms/udp-forms/{utils → udp-forms-utils}/form-submission-handler/formUtils.d.ts +0 -0
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, h, a as getElement } from './index-CaZq3YdB.js';
2
2
  import { throttle } from 'lodash';
3
- import { b as UdpFormsFieldTypeEnum, U as UdpFormsPageIdEnum, a as UdpFormsTypeEnum } from './enums-CHxgVY-B.js';
4
3
  import { g as getCurrentTenantId } from './tenantUtils-Basdb1b1.js';
5
4
  import { f as fetchLatestForms } from './udp-form-api-utils-vPSYCvIA.js';
6
- import { b as buildEmptyInitialValues } from './utils-CiUp9KGZ.js';
5
+ import { b as UdpFormsSubmissionStatusEnum, c as UdpFormsFieldTypeEnum, U as UdpFormsPageIdEnum, a as UdpFormsTypeEnum } from './enums-DHT5wSnX.js';
6
+ import { b as buildEmptyCurrentValues } from './utils-kwLwITIE.js';
7
7
  import { c as createFormData, m as makeApiCall } from './makeApiCall-B-daVutk.js';
8
8
  import { S as SearchBuilder, c as SearchOperators } from './SearchBuilder-CvKqGlUH.js';
9
9
  import { C as ConfigService } from './configService-BqLfkVKh.js';
@@ -109,15 +109,13 @@ class UdpFormSubmission {
109
109
  // Form Data Processing
110
110
  // =============================
111
111
  processSubmissionIntoFormDataWithoutValues(status) {
112
- const statusValue = this.resolveSubmissionStatus(status);
113
- const baseData = this.buildBaseSubmissionData(statusValue);
112
+ const baseData = this.buildBaseSubmissionData(status);
114
113
  const formData = createFormData(baseData);
115
114
  formData.append('Data', JSON.stringify(this.data));
116
115
  return formData;
117
116
  }
118
117
  processSubmissionIntoFormData(formInputValuesAndMetadata, status) {
119
- const statusValue = this.resolveSubmissionStatus(status);
120
- const baseData = this.buildBaseSubmissionData(statusValue);
118
+ const baseData = this.buildBaseSubmissionData(status);
121
119
  const { cleanedData, files } = this.extractCleanedDataAndFiles(formInputValuesAndMetadata);
122
120
  const formData = createFormData(baseData);
123
121
  files.forEach(file => formData.append('FormFiles', file));
@@ -128,18 +126,11 @@ class UdpFormSubmission {
128
126
  formData.append('Data', JSON.stringify(submissionDataObject));
129
127
  return formData;
130
128
  }
131
- resolveSubmissionStatus(status) {
132
- if (status === 'submitted')
133
- return 2;
134
- if (status === 'in-progress')
135
- return 1;
136
- return typeof status === 'number' ? status : 1;
137
- }
138
129
  buildBaseSubmissionData(statusValue) {
139
130
  const baseData = {
140
131
  FormId: this.formId,
141
132
  FormVersion: this.formVersion.toString(),
142
- Status: statusValue.toString(),
133
+ Status: statusValue,
143
134
  };
144
135
  if (this.id) {
145
136
  baseData.Id = this.id;
@@ -336,7 +327,7 @@ class PrivateFormSubmissionHandler {
336
327
  * @returns newly created UdpFormSubmission
337
328
  */
338
329
  async createNewLinkedFollowUpFormSubmission(udpFormSubmission) {
339
- const formData = await this.saveFormDataWithoutValues(udpFormSubmission, 'in-progress');
330
+ const formData = await this.saveFormDataWithoutValues(udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);
340
331
  return formData;
341
332
  }
342
333
  /**
@@ -390,7 +381,7 @@ class PrivateFormSubmissionHandler {
390
381
  * @returns updated UdpFormSubmission
391
382
  */
392
383
  async saveCurrentFormSubmissionState(values, udpFormSubmission) {
393
- return this.saveSubmissionToDB(values, udpFormSubmission, 'in-progress');
384
+ return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);
394
385
  }
395
386
  /**
396
387
  * Finalize and submit the form (set state to 'submitted').
@@ -402,7 +393,7 @@ class PrivateFormSubmissionHandler {
402
393
  * @returns updated UdpFormSubmission
403
394
  */
404
395
  async finalizeFormSubmissionState(values, udpFormSubmission) {
405
- return this.saveSubmissionToDB(values, udpFormSubmission, 'submitted');
396
+ return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.Submitted);
406
397
  }
407
398
  // =============================
408
399
  // Helpers
@@ -462,9 +453,10 @@ class PrivateFormSubmissionHandler {
462
453
  * @returns updated UdpFormSubmission
463
454
  */
464
455
  async saveCommentsToDB(values, udpFormSubmission) {
456
+ var _a;
465
457
  try {
466
458
  const method = 'PUT';
467
- const status = udpFormSubmission.status || 2; // default to 'submitted' if status is null
459
+ const status = (_a = udpFormSubmission.status) !== null && _a !== void 0 ? _a : UdpFormsSubmissionStatusEnum.Submitted;
468
460
  const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}`;
469
461
  const formData = udpFormSubmission.processSubmissionIntoFormData(values, status);
470
462
  const response = await makeApiCall(method, url, formData, true);
@@ -530,14 +522,209 @@ class UdpForm {
530
522
  }
531
523
  }
532
524
 
525
+ // utility to find repeat group keys from current values
526
+ const findRepeatGroupKeys = (sectionName, values) => {
527
+ const keys = Object.keys(values);
528
+ const repeatGroupSet = new Set();
529
+ // Match: sectionName_2
530
+ const regex = new RegExp(`^${sectionName}_(\\d+)`);
531
+ keys.forEach(key => {
532
+ const match = key.match(regex);
533
+ if (match && match[1]) {
534
+ repeatGroupSet.add(Number(match[1]));
535
+ }
536
+ });
537
+ return Array.from(repeatGroupSet).sort((a, b) => a - b);
538
+ };
539
+ // build dynamic sections based on the master form
540
+ const initializeDynamicSections = (udpForm, currentValues) => {
541
+ var _a;
542
+ const dynamicSections = [];
543
+ const sortedSections = structuredClone(udpForm.udpFormUdpFormSection).sort((a, b) => a.order - b.order);
544
+ for (const section of sortedSections) {
545
+ section.sectionProperties = JSON.parse(section.sectionProperties || {});
546
+ const repeatGroupKeys = findRepeatGroupKeys(section.name, currentValues);
547
+ section.isOriginalSection = true;
548
+ section.sectionPositionSuffix = 1; // default position
549
+ // always add the original section into dynamic sections
550
+ dynamicSections.push(Object.assign(Object.assign({}, structuredClone(section)), {
551
+ // dynamicSectionName: section.name,
552
+ formQuestions: structuredClone(udpForm.formQuestions)
553
+ .filter(q => q.formSectionId === section.id)
554
+ .sort((a, b) => a.questionOrder - b.questionOrder)
555
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}.${q.name}`, isShowCommentInput: true })))
556
+ }));
557
+ // create then add additional sections if there are repeated sections
558
+ if (((_a = section.sectionProperties) === null || _a === void 0 ? void 0 : _a.isRepeatable) && repeatGroupKeys.length > 0) {
559
+ const maxRepeatedSectionSuffix = Math.max(...repeatGroupKeys); // create a new section for the max value of repeat group keys, even if there are no saved answers
560
+ // for (const repeatKey of repeatGroupKeys) { // create a section only for the suffix saved
561
+ for (let repeatKey = 2; repeatKey <= maxRepeatedSectionSuffix; repeatKey++) {
562
+ const clonedSection = Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(udpForm.formQuestions)
563
+ .filter(q => q.formSectionId === section.id)
564
+ .sort((a, b) => a.questionOrder - b.questionOrder)
565
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}_${repeatKey}.${q.name}`, isShowCommentInput: true }))), isOriginalSection: false, sectionPositionSuffix: repeatKey });
566
+ dynamicSections.push(clonedSection);
567
+ }
568
+ }
569
+ }
570
+ return dynamicSections;
571
+ };
572
+ // urlContext is derived from query params that start with `udpf_` (see useUdpFormParameters).
573
+ // Keys are stored without the prefix, e.g. `udpf_section1_3.question1=val` -> urlContext['section1_3.question1'] = 'val'
574
+ // This helper finds the maximum repeat suffix requested by urlContext for a given section base name.
575
+ // Example: { 'sectionA_3.q1': 'x', 'sectionA_2.q2': 'y' } -> { sectionA: 3 }
576
+ const getMaxRepeatSuffixBySectionFromUrlContext = (urlContext) => {
577
+ const context = (urlContext && typeof urlContext === 'object') ? urlContext : {};
578
+ const maxBySection = {};
579
+ Object.keys(context).forEach(key => {
580
+ var _a;
581
+ // Expect keys like: sectionName_3.questionName
582
+ // Only treat it as a repeat hint if it has a dot after the suffix.
583
+ const match = key.match(/^([^._?&#]+)_(\d+)\./);
584
+ if (!match)
585
+ return;
586
+ const baseSectionName = match[1];
587
+ const suffix = Number(match[2]);
588
+ if (!Number.isFinite(suffix) || suffix < 2)
589
+ return;
590
+ const existing = (_a = maxBySection[baseSectionName]) !== null && _a !== void 0 ? _a : 1;
591
+ if (suffix > existing)
592
+ maxBySection[baseSectionName] = suffix;
593
+ });
594
+ return maxBySection;
595
+ };
596
+ // build dynamic sections based on the master form plus optional repeat hints from URL context
597
+ const initializeDynamicSectionsWithUrlContext = (udpForm, currentValues, urlContext) => {
598
+ var _a, _b;
599
+ const maxRepeatFromUrl = getMaxRepeatSuffixBySectionFromUrlContext(urlContext);
600
+ const dynamicSections = [];
601
+ const sortedSections = structuredClone(udpForm.udpFormUdpFormSection).sort((a, b) => a.order - b.order);
602
+ for (const section of sortedSections) {
603
+ section.sectionProperties = JSON.parse(section.sectionProperties || {});
604
+ const repeatGroupKeys = findRepeatGroupKeys(section.name, currentValues);
605
+ const maxRepeatedFromValues = repeatGroupKeys.length > 0 ? Math.max(...repeatGroupKeys) : 1;
606
+ const maxRepeatedFromUrl = (_a = maxRepeatFromUrl === null || maxRepeatFromUrl === void 0 ? void 0 : maxRepeatFromUrl[section.name]) !== null && _a !== void 0 ? _a : 1;
607
+ const maxRepeatedSectionSuffix = Math.max(maxRepeatedFromValues, maxRepeatedFromUrl);
608
+ section.isOriginalSection = true;
609
+ section.sectionPositionSuffix = 1; // default position
610
+ // always add the original section into dynamic sections
611
+ dynamicSections.push(Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(udpForm.formQuestions)
612
+ .filter(q => q.formSectionId === section.id)
613
+ .sort((a, b) => a.questionOrder - b.questionOrder)
614
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}.${q.name}`, isShowCommentInput: true }))) }));
615
+ // create then add additional sections if repeatable and suffix requested by saved values or url
616
+ if (((_b = section.sectionProperties) === null || _b === void 0 ? void 0 : _b.isRepeatable) && maxRepeatedSectionSuffix >= 2) {
617
+ for (let repeatKey = 2; repeatKey <= maxRepeatedSectionSuffix; repeatKey++) {
618
+ const clonedSection = Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(udpForm.formQuestions)
619
+ .filter(q => q.formSectionId === section.id)
620
+ .sort((a, b) => a.questionOrder - b.questionOrder)
621
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}_${repeatKey}.${q.name}`, isShowCommentInput: true }))), isOriginalSection: false, sectionPositionSuffix: repeatKey });
622
+ dynamicSections.push(clonedSection);
623
+ }
624
+ }
625
+ }
626
+ return dynamicSections;
627
+ };
628
+ const applyUrlSeedValuesForAll = (dynamicSections, urlContext) => {
629
+ if (!Array.isArray(dynamicSections))
630
+ return;
631
+ // urlContext is derived from query params that start with `udpf_` (see useUdpFormParameters).
632
+ // Keys are stored without the prefix, e.g. `udpf_section1.question1=val` -> urlContext['section1.question1'] = 'val'
633
+ const context = (urlContext && typeof urlContext === 'object') ? urlContext : {};
634
+ // Build a case-insensitive view of urlContext so callers can use udpf_ keys without worrying about case.
635
+ // If duplicate keys exist with different casing, the last one encountered wins.
636
+ const contextCI = {};
637
+ Object.keys(context).forEach(k => {
638
+ contextCI[String(k).toLowerCase()] = context[k];
639
+ });
640
+ // 1) Collect URL values into nested structure: { [sectionKey]: { [questionName]: { value, comments: [] } } }
641
+ const urlValuesNested = {};
642
+ dynamicSections.forEach(section => {
643
+ const sectionKey = section.isOriginalSection
644
+ ? section.name
645
+ : `${section.name}_${section.sectionPositionSuffix}`;
646
+ (section.formQuestions || []).forEach(q => {
647
+ if (!q)
648
+ return;
649
+ const candidates = [q.processedSubmissionName, q.questionIdentifierKey, q.name].filter(Boolean);
650
+ let urlVal = undefined;
651
+ for (const c of candidates) {
652
+ const key = String(c).toLowerCase();
653
+ if (Object.prototype.hasOwnProperty.call(contextCI, key)) {
654
+ urlVal = contextCI[key];
655
+ break;
656
+ }
657
+ }
658
+ if (urlVal !== undefined && urlVal !== null) {
659
+ if (!urlValuesNested[sectionKey])
660
+ urlValuesNested[sectionKey] = {};
661
+ urlValuesNested[sectionKey][q.name] = { value: urlVal, comments: [] };
662
+ }
663
+ });
664
+ });
665
+ // Caller is responsible for merging with saved submissionResponseData.
666
+ // Here we only return the url-derived seed values + paragraph defaults.
667
+ const merged = {};
668
+ Object.entries(urlValuesNested).forEach(([sectionKey, qMap]) => {
669
+ if (!merged[sectionKey])
670
+ merged[sectionKey] = {};
671
+ Object.entries(qMap).forEach(([qName, valObj]) => {
672
+ const existing = merged[sectionKey][qName];
673
+ // Only set from URL if no saved value exists (null/undefined/empty-string)
674
+ const isMissing = existing == null ||
675
+ existing.value == null ||
676
+ (typeof existing.value === 'string' && existing.value.trim() === '');
677
+ if (isMissing) {
678
+ merged[sectionKey][qName] = valObj;
679
+ }
680
+ });
681
+ });
682
+ // 3) Paragraph defaults: if still undefined/null, use fieldProperties.paragraphText
683
+ dynamicSections.forEach(section => {
684
+ const sectionKey = section.isOriginalSection
685
+ ? section.name
686
+ : `${section.name}_${section.sectionPositionSuffix}`;
687
+ if (!merged[sectionKey])
688
+ merged[sectionKey] = {};
689
+ (section.formQuestions || []).forEach(q => {
690
+ var _a;
691
+ if (!q)
692
+ return;
693
+ if (q.fieldTypeId === UdpFormsFieldTypeEnum.Paragraph) {
694
+ const existing = merged[sectionKey][q.name];
695
+ const isMissing = existing == null ||
696
+ existing.value == null ||
697
+ (typeof existing.value === 'string' && existing.value.trim() === '');
698
+ if (isMissing) {
699
+ let fieldProps = q === null || q === void 0 ? void 0 : q.fieldProperties;
700
+ if (typeof fieldProps === 'string') {
701
+ try {
702
+ fieldProps = JSON.parse(fieldProps || '{}');
703
+ }
704
+ catch (_b) {
705
+ fieldProps = {};
706
+ }
707
+ }
708
+ merged[sectionKey][q.name] = {
709
+ value: (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.paragraphText) !== null && _a !== void 0 ? _a : '',
710
+ comments: [],
711
+ };
712
+ }
713
+ }
714
+ });
715
+ });
716
+ return merged;
717
+ };
718
+
533
719
  const UdpFormsRenderer = class {
534
720
  constructor(hostRef) {
535
721
  registerInstance(this, hostRef);
536
722
  this.isPublic = false;
537
723
  this.autoSaveDelay = 2000; // Debounce delay for auto-save in milliseconds (currently disabled)
538
- this.initialValues = {};
724
+ this.urlContext = {}; // additional context from URL if needed, eg. generic1, gernic2, generic3, or any initial prepopulated values for form inputs. eg section1.question1 = 'some value'
725
+ this.currentValues = {}; // values of the current form state
726
+ this.formInputSeedValues = {}; // support for a initial set of values to seed the form with
539
727
  this.submitSuccessful = false;
540
- this.currentFormData = {};
541
728
  this.isLoading = false;
542
729
  this.isSaving = false;
543
730
  this.isSubmitted = false;
@@ -592,7 +779,7 @@ const UdpFormsRenderer = class {
592
779
  return;
593
780
  const cloningSectionName = sectionToClone.name;
594
781
  // Find existing repeat group indices
595
- const repeatKeys = this.findRepeatGroupKeys(cloningSectionName, this.initialValues);
782
+ const repeatKeys = findRepeatGroupKeys(cloningSectionName, this.currentValues);
596
783
  const nextRepeatIndex = repeatKeys.length > 0 ? Math.max(...repeatKeys) + 1 : 2;
597
784
  const clonedSection = Object.assign(Object.assign({}, structuredClone(sectionToClone)), { formQuestions: sectionToClone.formQuestions.map(q => {
598
785
  const newQuestionObj = structuredClone(q);
@@ -617,13 +804,13 @@ const UdpFormsRenderer = class {
617
804
  ...this.dynamicSections.slice(insertAtIndex + 1),
618
805
  ];
619
806
  // Create new initial values structure
620
- const newInitialValues = structuredClone(this.udpFormSubmission.data.submissionResponseData);
807
+ const newCurrentValues = structuredClone(this.udpFormSubmission.data.submissionResponseData);
621
808
  clonedSection.formQuestions.forEach(q => {
622
809
  var _a, _b, _c, _d;
623
810
  const newSectionNameWithSuffix = `${cloningSectionName}_${nextRepeatIndex}`;
624
811
  const newQuestionName = q.name;
625
- if (!newInitialValues[newSectionNameWithSuffix]) {
626
- newInitialValues[newSectionNameWithSuffix] = {};
812
+ if (!newCurrentValues[newSectionNameWithSuffix]) {
813
+ newCurrentValues[newSectionNameWithSuffix] = {};
627
814
  }
628
815
  // Preserve only Paragraph values from the source section; clear others
629
816
  let value = '';
@@ -645,11 +832,11 @@ const UdpFormsRenderer = class {
645
832
  const paragraphDefault = (_d = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.paragraphText) !== null && _d !== void 0 ? _d : '';
646
833
  value = sourceVal !== null && sourceVal !== void 0 ? sourceVal : paragraphDefault;
647
834
  }
648
- newInitialValues[newSectionNameWithSuffix][newQuestionName] = { value, comments: [], metadata: {} };
835
+ newCurrentValues[newSectionNameWithSuffix][newQuestionName] = { value, comments: [], metadata: {} };
649
836
  });
650
837
  // This will trigger a complete form re-render
651
- this.initialValues = Object.assign({}, newInitialValues);
652
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
838
+ this.currentValues = Object.assign({}, newCurrentValues);
839
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
653
840
  this.triggerFormRerender();
654
841
  }
655
842
  finally {
@@ -673,8 +860,8 @@ const UdpFormsRenderer = class {
673
860
  const deleteSectionName = sectionToDelete.name;
674
861
  const deleteSuffix = sectionToDelete.sectionPositionSuffix;
675
862
  const sectionKeyToDelete = `${deleteSectionName}_${deleteSuffix}`;
676
- const newInitialValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
677
- delete newInitialValues[sectionKeyToDelete];
863
+ const newCurrentValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
864
+ delete newCurrentValues[sectionKeyToDelete];
678
865
  // Remove the section from dynamicSections
679
866
  const updatedSections = structuredClone(this.dynamicSections);
680
867
  updatedSections.splice(index, 1);
@@ -698,14 +885,14 @@ const UdpFormsRenderer = class {
698
885
  return newSectionQuestion;
699
886
  });
700
887
  // Move data in initial values
701
- if (newInitialValues[oldSectionKey]) {
702
- newInitialValues[newSectionKey] = structuredClone(newInitialValues[oldSectionKey]);
703
- delete newInitialValues[oldSectionKey];
888
+ if (newCurrentValues[oldSectionKey]) {
889
+ newCurrentValues[newSectionKey] = structuredClone(newCurrentValues[oldSectionKey]);
890
+ delete newCurrentValues[oldSectionKey];
704
891
  }
705
892
  });
706
893
  this.dynamicSections = updatedSections;
707
- this.initialValues = Object.assign({}, newInitialValues);
708
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
894
+ this.currentValues = Object.assign({}, newCurrentValues);
895
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
709
896
  this.triggerFormRerender();
710
897
  }
711
898
  finally {
@@ -723,7 +910,7 @@ const UdpFormsRenderer = class {
723
910
  try {
724
911
  const updatedUdpFormSubmission = await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);
725
912
  this.udpFormSubmission = updatedUdpFormSubmission;
726
- this.initialValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
913
+ this.currentValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
727
914
  if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {
728
915
  // replace the current entry's query string with udpf_submissionId without needing to know the path
729
916
  this.replaceUrlWithSubmissionId(updatedUdpFormSubmission.id);
@@ -748,7 +935,7 @@ const UdpFormsRenderer = class {
748
935
  try {
749
936
  const updatedUdpFormSubmission = await this.formSubmissionHandler.saveFormSubmissionComments(values, this.udpFormSubmission);
750
937
  this.udpFormSubmission = updatedUdpFormSubmission;
751
- this.initialValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
938
+ this.currentValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
752
939
  this.enqueueSnackbar('Saved sucessfully.', {
753
940
  variant: 'success',
754
941
  anchorOrigin: { vertical: 'top', horizontal: 'center' },
@@ -780,7 +967,7 @@ const UdpFormsRenderer = class {
780
967
  try {
781
968
  const updatedUdpFormSubmission = await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);
782
969
  this.udpFormSubmission = updatedUdpFormSubmission;
783
- this.initialValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
970
+ this.currentValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
784
971
  if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {
785
972
  // replace the current entry's query string with udpf_submissionId without needing to know the path
786
973
  this.replaceUrlWithSubmissionId(updatedUdpFormSubmission.id);
@@ -830,7 +1017,7 @@ const UdpFormsRenderer = class {
830
1017
  // create a new follow up form submission instance wiht a link to the parent form submission
831
1018
  const followUpMasterForm = await this.formHandler.getFormByFormIdAndFormVersion(followUpFormId, followUpFormVersion);
832
1019
  const followUpSubmissionData = {
833
- submissionResponseData: buildEmptyInitialValues(followUpMasterForm),
1020
+ submissionResponseData: buildEmptyCurrentValues(followUpMasterForm),
834
1021
  submissionMetadata: {
835
1022
  ParentSubmission: {
836
1023
  submissionId: parentFormSubmissionId,
@@ -883,7 +1070,7 @@ const UdpFormsRenderer = class {
883
1070
  this.clientUserInfo.email = user.email || null;
884
1071
  }
885
1072
  this.formSubmissionHandler = FormSubmissionHandlerFactory.create(this.isPublic, this.clientUserInfo.id);
886
- this.udpFormSubmission = new UdpFormSubmission({ id: this.submissionId, formId: this.formId, formVersion: this.version, unityUserId: this.clientUserInfo.id, generic1: this.generic1, generic2: this.generic2, generic3: this.generic3 });
1073
+ this.udpFormSubmission = new UdpFormSubmission({ id: this.submissionId, formId: this.formId, formVersion: this.version, unityUserId: this.clientUserInfo.id, generic1: this.urlContext.generic1, generic2: this.urlContext.generic2, generic3: this.urlContext.generic3 });
887
1074
  // fetch existing submission from Udp.FormSubmission if submissionId is provided
888
1075
  // take exisitng object, and populate with db values, and return new obj with updated values
889
1076
  if (this.submissionId) {
@@ -903,18 +1090,29 @@ const UdpFormsRenderer = class {
903
1090
  this.formHandler = new UdpFormHandler(this.tenantId);
904
1091
  const formData = await this.formHandler.getFormByFormIdAndFormVersion(formId, formVersion);
905
1092
  this.udpForm = new UdpForm(formData);
906
- this.initialValues = buildEmptyInitialValues(this.udpForm);
1093
+ this.currentValues = buildEmptyCurrentValues(this.udpForm);
907
1094
  // if there's existing data, update the form's state
908
1095
  if (this.udpFormSubmission.data.submissionResponseData) {
909
- this.initialValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
910
- if (this.udpFormSubmission.status === 2 || this.udpFormSubmission.status === 'submitted') {
1096
+ this.currentValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
1097
+ if (this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Submitted) {
911
1098
  this.isSubmitted = true;
912
1099
  }
913
1100
  }
914
- this.initializeDynamicSections(); // process the master form into dynamic sections
915
- // After sections/questions are prepared, seed initial values from URL for ALL questions,
916
- // with saved values taking precedence, and paragraph defaults as a fallback.
917
- this.applyUrlInitialValuesForAll();
1101
+ // For new submissions (un-instiantiated or in the 'created' status), we allow the seeding of initial values from URL params
1102
+ // So we build dynamicSections with urlContext first, then seed values.
1103
+ // URL params (udpf_*) may imply repeatable section instances (e.g. section1_3.question1).
1104
+ // For existing submissions that are in progress, skip URL-based seeding and do not create additional sections from URL.
1105
+ if ((!this.udpFormSubmission.id || this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Created) && this.urlContext && Object.keys(this.urlContext).length > 0) {
1106
+ this.dynamicSections = initializeDynamicSectionsWithUrlContext(this.udpForm, this.currentValues, this.urlContext);
1107
+ const seeded = applyUrlSeedValuesForAll(this.dynamicSections, this.urlContext);
1108
+ if (seeded) {
1109
+ this.currentValues = seeded;
1110
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, seeded);
1111
+ }
1112
+ }
1113
+ else {
1114
+ this.dynamicSections = initializeDynamicSections(this.udpForm, this.currentValues);
1115
+ }
918
1116
  // Set up throttled manual save function (5 seconds) - fires immediately, then throttles
919
1117
  this.debouncedManualSave = throttle(async (values) => {
920
1118
  await this.handleManualSave(values);
@@ -931,136 +1129,6 @@ const UdpFormsRenderer = class {
931
1129
  this.isLoading = false;
932
1130
  }
933
1131
  }
934
- // build dynamic sections based on the
935
- initializeDynamicSections() {
936
- var _a;
937
- const tempDynamicSection = [];
938
- const sortedSections = structuredClone(this.udpForm.udpFormUdpFormSection).sort((a, b) => a.order - b.order);
939
- for (const section of sortedSections) {
940
- section.sectionProperties = JSON.parse(section.sectionProperties || {});
941
- const repeatGroupKeys = this.findRepeatGroupKeys(section.name, this.initialValues);
942
- section.isOriginalSection = true;
943
- section.sectionPositionSuffix = 1; // default position
944
- // always add the original section into dynamic sections
945
- tempDynamicSection.push(Object.assign(Object.assign({}, structuredClone(section)), {
946
- // dynamicSectionName: section.name,
947
- formQuestions: structuredClone(this.udpForm.formQuestions)
948
- .filter(q => q.formSectionId === section.id)
949
- .sort((a, b) => a.questionOrder - b.questionOrder)
950
- .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}.${q.name}`, isShowCommentInput: true })))
951
- }));
952
- // create then add additional sections if there are repeated sections
953
- if (((_a = section.sectionProperties) === null || _a === void 0 ? void 0 : _a.isRepeatable) && repeatGroupKeys.length > 0) {
954
- const maxRepeatedSectionSuffix = Math.max(...repeatGroupKeys); // create a new section for the max value of repeat group keys, even if there are no saved answers
955
- // for (const repeatKey of repeatGroupKeys) { // create a section only for the suffix saved
956
- for (let repeatKey = 2; repeatKey <= maxRepeatedSectionSuffix; repeatKey++) {
957
- const clonedSection = Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(this.udpForm.formQuestions)
958
- .filter(q => q.formSectionId === section.id)
959
- .sort((a, b) => a.questionOrder - b.questionOrder)
960
- .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}_${repeatKey}.${q.name}`, isShowCommentInput: true }))), isOriginalSection: false, sectionPositionSuffix: repeatKey });
961
- tempDynamicSection.push(clonedSection);
962
- }
963
- }
964
- }
965
- this.dynamicSections = tempDynamicSection;
966
- }
967
- findRepeatGroupKeys(sectionName, values) {
968
- const keys = Object.keys(values);
969
- const repeatGroupSet = new Set();
970
- // Match: sectionName_2
971
- const regex = new RegExp(`^${sectionName}_(\\d+)`);
972
- keys.forEach(key => {
973
- const match = key.match(regex);
974
- if (match && match[1]) {
975
- repeatGroupSet.add(Number(match[1]));
976
- }
977
- });
978
- return Array.from(repeatGroupSet).sort((a, b) => a - b);
979
- }
980
- // Build initial values from URL for ALL fields, but do NOT override saved values.
981
- // For Paragraph, also fall back to the builder's default text when nothing else provided.
982
- applyUrlInitialValuesForAll() {
983
- if (!Array.isArray(this.dynamicSections))
984
- return;
985
- const urlParams = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : null;
986
- // 1) Collect URL values into nested structure: { [sectionKey]: { [questionName]: { value, comments: [] } } }
987
- const urlValuesNested = {};
988
- if (urlParams) {
989
- this.dynamicSections.forEach(section => {
990
- const sectionKey = section.isOriginalSection
991
- ? section.name
992
- : `${section.name}_${section.sectionPositionSuffix}`;
993
- (section.formQuestions || []).forEach(q => {
994
- if (!q)
995
- return;
996
- const candidates = [q.processedSubmissionName, q.questionIdentifierKey, q.name].filter(Boolean);
997
- let urlVal = null;
998
- for (const c of candidates) {
999
- urlVal = urlParams.get(c);
1000
- if (urlVal !== null)
1001
- break;
1002
- }
1003
- if (urlVal !== null) {
1004
- if (!urlValuesNested[sectionKey])
1005
- urlValuesNested[sectionKey] = {};
1006
- urlValuesNested[sectionKey][q.name] = { value: urlVal, comments: [] };
1007
- }
1008
- });
1009
- });
1010
- }
1011
- // 2) Merge with saved values (this.initialValues) taking precedence
1012
- const merged = structuredClone(this.initialValues) || {};
1013
- Object.entries(urlValuesNested).forEach(([sectionKey, qMap]) => {
1014
- if (!merged[sectionKey])
1015
- merged[sectionKey] = {};
1016
- Object.entries(qMap).forEach(([qName, valObj]) => {
1017
- const existing = merged[sectionKey][qName];
1018
- // Only set from URL if no saved value exists (null/undefined/empty-string)
1019
- const isMissing = existing == null ||
1020
- existing.value == null ||
1021
- (typeof existing.value === 'string' && existing.value.trim() === '');
1022
- if (isMissing) {
1023
- merged[sectionKey][qName] = valObj;
1024
- }
1025
- });
1026
- });
1027
- // 3) Paragraph defaults: if still undefined/null, use fieldProperties.paragraphText
1028
- this.dynamicSections.forEach(section => {
1029
- const sectionKey = section.isOriginalSection
1030
- ? section.name
1031
- : `${section.name}_${section.sectionPositionSuffix}`;
1032
- if (!merged[sectionKey])
1033
- merged[sectionKey] = {};
1034
- (section.formQuestions || []).forEach(q => {
1035
- var _a;
1036
- if (!q)
1037
- return;
1038
- if (q.fieldTypeId === UdpFormsFieldTypeEnum.Paragraph) {
1039
- const existing = merged[sectionKey][q.name];
1040
- const isMissing = existing == null ||
1041
- existing.value == null ||
1042
- (typeof existing.value === 'string' && existing.value.trim() === '');
1043
- if (isMissing) {
1044
- let fieldProps = q === null || q === void 0 ? void 0 : q.fieldProperties;
1045
- if (typeof fieldProps === 'string') {
1046
- try {
1047
- fieldProps = JSON.parse(fieldProps || '{}');
1048
- }
1049
- catch (_b) {
1050
- fieldProps = {};
1051
- }
1052
- }
1053
- merged[sectionKey][q.name] = {
1054
- value: (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.paragraphText) !== null && _a !== void 0 ? _a : '',
1055
- comments: [],
1056
- };
1057
- }
1058
- }
1059
- });
1060
- });
1061
- this.initialValues = merged;
1062
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, merged);
1063
- }
1064
1132
  async handleSubmit(values) {
1065
1133
  this.isLoading = true;
1066
1134
  try {
@@ -1117,13 +1185,13 @@ const UdpFormsRenderer = class {
1117
1185
  try {
1118
1186
  const { type, questionIdentifierKey, commentId } = e.detail;
1119
1187
  const [sectionName, questionName] = questionIdentifierKey.split('.');
1120
- let newInitialValues = structuredClone(this.udpFormSubmission.data.submissionResponseData || {});
1188
+ let newCurrentValues = structuredClone(this.udpFormSubmission.data.submissionResponseData || {});
1121
1189
  // ensure structure exists WITHOUT overwriting existing data
1122
- if (!newInitialValues[sectionName])
1123
- newInitialValues[sectionName] = {};
1124
- if (!newInitialValues[sectionName][questionName]) {
1190
+ if (!newCurrentValues[sectionName])
1191
+ newCurrentValues[sectionName] = {};
1192
+ if (!newCurrentValues[sectionName][questionName]) {
1125
1193
  // create defaults but do not clobber any existing saved shape from submissionResponseData
1126
- newInitialValues[sectionName][questionName] = {
1194
+ newCurrentValues[sectionName][questionName] = {
1127
1195
  value: '',
1128
1196
  comments: [],
1129
1197
  draftComments: [],
@@ -1132,20 +1200,20 @@ const UdpFormsRenderer = class {
1132
1200
  }
1133
1201
  else {
1134
1202
  // ensure arrays/objects exist so later code can safely push/filter
1135
- newInitialValues[sectionName][questionName].comments = (_a = newInitialValues[sectionName][questionName].comments) !== null && _a !== void 0 ? _a : [];
1136
- newInitialValues[sectionName][questionName].draftComments = (_b = newInitialValues[sectionName][questionName].draftComments) !== null && _b !== void 0 ? _b : [];
1137
- newInitialValues[sectionName][questionName].metadata = (_c = newInitialValues[sectionName][questionName].metadata) !== null && _c !== void 0 ? _c : {};
1203
+ newCurrentValues[sectionName][questionName].comments = (_a = newCurrentValues[sectionName][questionName].comments) !== null && _a !== void 0 ? _a : [];
1204
+ newCurrentValues[sectionName][questionName].draftComments = (_b = newCurrentValues[sectionName][questionName].draftComments) !== null && _b !== void 0 ? _b : [];
1205
+ newCurrentValues[sectionName][questionName].metadata = (_c = newCurrentValues[sectionName][questionName].metadata) !== null && _c !== void 0 ? _c : {};
1138
1206
  }
1139
1207
  // normalize draftComments to array if needed (back-compat)
1140
- const maybeDraft = newInitialValues[sectionName][questionName].draftComments;
1208
+ const maybeDraft = newCurrentValues[sectionName][questionName].draftComments;
1141
1209
  if (maybeDraft && !Array.isArray(maybeDraft)) {
1142
- newInitialValues[sectionName][questionName].draftComments = [maybeDraft];
1210
+ newCurrentValues[sectionName][questionName].draftComments = [maybeDraft];
1143
1211
  }
1144
1212
  else if (!maybeDraft) {
1145
- newInitialValues[sectionName][questionName].draftComments = [];
1213
+ newCurrentValues[sectionName][questionName].draftComments = [];
1146
1214
  }
1147
- const commentsArr = newInitialValues[sectionName][questionName].comments || [];
1148
- const draftsArr = newInitialValues[sectionName][questionName].draftComments || [];
1215
+ const commentsArr = newCurrentValues[sectionName][questionName].comments || [];
1216
+ const draftsArr = newCurrentValues[sectionName][questionName].draftComments || [];
1149
1217
  switch (type) {
1150
1218
  case 'add': {
1151
1219
  const newDraft = {
@@ -1155,7 +1223,7 @@ const UdpFormsRenderer = class {
1155
1223
  timestamp: null,
1156
1224
  };
1157
1225
  // put new draft first so activeDraft === draftComments[0] matches UX
1158
- newInitialValues[sectionName][questionName].draftComments = [newDraft, ...draftsArr];
1226
+ newCurrentValues[sectionName][questionName].draftComments = [newDraft, ...draftsArr];
1159
1227
  break;
1160
1228
  }
1161
1229
  case 'save': {
@@ -1171,13 +1239,13 @@ const UdpFormsRenderer = class {
1171
1239
  if (existingIdx !== -1) {
1172
1240
  const newComments = [...commentsArr];
1173
1241
  newComments[existingIdx] = Object.assign({}, savedComment);
1174
- newInitialValues[sectionName][questionName].comments = newComments;
1242
+ newCurrentValues[sectionName][questionName].comments = newComments;
1175
1243
  }
1176
1244
  else {
1177
- newInitialValues[sectionName][questionName].comments = [...commentsArr, savedComment];
1245
+ newCurrentValues[sectionName][questionName].comments = [...commentsArr, savedComment];
1178
1246
  }
1179
1247
  // remove that draft
1180
- newInitialValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1248
+ newCurrentValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1181
1249
  break;
1182
1250
  }
1183
1251
  case 'edit': {
@@ -1187,13 +1255,13 @@ const UdpFormsRenderer = class {
1187
1255
  return;
1188
1256
  const draftFromSaved = Object.assign(Object.assign({}, saved), { isDraftComment: true, timestamp: null });
1189
1257
  // Add this draft at the front; keep saved comment intact so content doesn't disappear.
1190
- newInitialValues[sectionName][questionName].draftComments = [draftFromSaved, ...draftsArr];
1191
- newInitialValues[sectionName][questionName].comments = commentsArr;
1258
+ newCurrentValues[sectionName][questionName].draftComments = [draftFromSaved, ...draftsArr];
1259
+ newCurrentValues[sectionName][questionName].comments = commentsArr;
1192
1260
  break;
1193
1261
  }
1194
1262
  case 'delete': {
1195
1263
  // mark the comment as deleted and clear its value, then persist.
1196
- newInitialValues[sectionName][questionName].comments = commentsArr.map(c => {
1264
+ newCurrentValues[sectionName][questionName].comments = commentsArr.map(c => {
1197
1265
  if (c.commentId === commentId) {
1198
1266
  return Object.assign(Object.assign({}, c), { isDeleted: true, value: '', editedTimestamp: new Date().toISOString() });
1199
1267
  }
@@ -1203,18 +1271,18 @@ const UdpFormsRenderer = class {
1203
1271
  }
1204
1272
  case 'editClose': {
1205
1273
  // Cancel edit: remove the draft only, do NOT restore/alter saved comments.
1206
- newInitialValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1274
+ newCurrentValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1207
1275
  break;
1208
1276
  }
1209
1277
  }
1210
1278
  // if it's a save or delete action, persist immediately
1211
1279
  if (type === 'save' || type === 'delete') {
1212
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
1213
- await this.handleCommmentUpdate(newInitialValues);
1280
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
1281
+ await this.handleCommmentUpdate(newCurrentValues);
1214
1282
  }
1215
1283
  else {
1216
- this.initialValues = Object.assign({}, newInitialValues);
1217
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
1284
+ this.currentValues = Object.assign({}, newCurrentValues);
1285
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
1218
1286
  }
1219
1287
  }
1220
1288
  catch (error) {
@@ -1269,7 +1337,7 @@ const UdpFormsRenderer = class {
1269
1337
  return this.isSubmitted || this.udpFormSubmission.unityUserId !== this.clientUserInfo.id;
1270
1338
  }
1271
1339
  render() {
1272
- return (h("div", { key: 'c0adb1a4f78f6ff15ce946b44677820f716e8a86', class: "forms-renderer-container", style: this.isLoading ? { minHeight: '100vh' } : {} }, this.renderFollowUpSideSheet(), h("udp-forms-ui", { udpForm: this.udpForm, initialValues: this.initialValues, udpFormSubmission: this.udpFormSubmission, submitSuccessful: this.submitSuccessful, isSaving: this.isSaving, saveErrorMessage: this.saveErrorMessage,
1340
+ return (h("div", { key: 'd073bfa6145e449c59dc722723ac82d09730d885', class: "forms-renderer-container", style: this.isLoading ? { minHeight: '100vh' } : {} }, this.renderFollowUpSideSheet(), h("udp-forms-ui", { udpForm: this.udpForm, currentValues: this.currentValues, udpFormSubmission: this.udpFormSubmission, submitSuccessful: this.submitSuccessful, isSaving: this.isSaving, saveErrorMessage: this.saveErrorMessage,
1273
1341
  // showAutoSaveStatus={this.formSubmissionHandler.supportsAutoSave() && !!this.userId}
1274
1342
  readonly: this.isReadOnlyMode, handleSubmit: this.handleSubmit.bind(this), handleSave: values => Promise.resolve(this.debouncedManualSave(values)), handleChange: this.handleFormChange, handleAction: this.triggerAction, handleFinish: this.handleFinish, clientUserInfo: this.clientUserInfo, isSubmitted: this.isSubmitted, dynamicSections: this.dynamicSections, duplicateRepeatableSection: this.duplicateRepeatableSection, deleteRepeatableSection: this.deleteRepeatableSection, key: `form-rerender-key-${this.reRenderKey}`, isShowManualSaveIcon: this.isShowManualSaveIcon(), isLoading: this.isLoading, performBackgroundSaveAndUpdateLocalSubmissionState: this.performBackgroundSaveAndUpdateLocalSubmissionState })));
1275
1343
  }