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 { p as proxyCustomElement, H, h } from './index2.js';
2
2
  import { throttle } from 'lodash';
3
- import { U as UdpFormsFieldTypeEnum, b as UdpFormsPageIdEnum, a as UdpFormsTypeEnum } from './enums.js';
4
3
  import { g as getCurrentTenantId } from './tenantUtils.js';
5
4
  import { f as fetchLatestForms } from './udp-form-api-utils.js';
6
- import { b as buildEmptyInitialValues } from './utils.js';
5
+ import { c as UdpFormsSubmissionStatusEnum, U as UdpFormsFieldTypeEnum, b as UdpFormsPageIdEnum, a as UdpFormsTypeEnum } from './enums.js';
6
+ import { b as buildEmptyCurrentValues } from './utils.js';
7
7
  import { c as createFormData, m as makeApiCall } from './makeApiCall.js';
8
8
  import { S as SearchBuilder, c as SearchOperators } from './SearchBuilder.js';
9
9
  import { C as ConfigService } from './configService.js';
@@ -145,15 +145,13 @@ class UdpFormSubmission {
145
145
  // Form Data Processing
146
146
  // =============================
147
147
  processSubmissionIntoFormDataWithoutValues(status) {
148
- const statusValue = this.resolveSubmissionStatus(status);
149
- const baseData = this.buildBaseSubmissionData(statusValue);
148
+ const baseData = this.buildBaseSubmissionData(status);
150
149
  const formData = createFormData(baseData);
151
150
  formData.append('Data', JSON.stringify(this.data));
152
151
  return formData;
153
152
  }
154
153
  processSubmissionIntoFormData(formInputValuesAndMetadata, status) {
155
- const statusValue = this.resolveSubmissionStatus(status);
156
- const baseData = this.buildBaseSubmissionData(statusValue);
154
+ const baseData = this.buildBaseSubmissionData(status);
157
155
  const { cleanedData, files } = this.extractCleanedDataAndFiles(formInputValuesAndMetadata);
158
156
  const formData = createFormData(baseData);
159
157
  files.forEach(file => formData.append('FormFiles', file));
@@ -164,18 +162,11 @@ class UdpFormSubmission {
164
162
  formData.append('Data', JSON.stringify(submissionDataObject));
165
163
  return formData;
166
164
  }
167
- resolveSubmissionStatus(status) {
168
- if (status === 'submitted')
169
- return 2;
170
- if (status === 'in-progress')
171
- return 1;
172
- return typeof status === 'number' ? status : 1;
173
- }
174
165
  buildBaseSubmissionData(statusValue) {
175
166
  const baseData = {
176
167
  FormId: this.formId,
177
168
  FormVersion: this.formVersion.toString(),
178
- Status: statusValue.toString(),
169
+ Status: statusValue,
179
170
  };
180
171
  if (this.id) {
181
172
  baseData.Id = this.id;
@@ -372,7 +363,7 @@ class PrivateFormSubmissionHandler {
372
363
  * @returns newly created UdpFormSubmission
373
364
  */
374
365
  async createNewLinkedFollowUpFormSubmission(udpFormSubmission) {
375
- const formData = await this.saveFormDataWithoutValues(udpFormSubmission, 'in-progress');
366
+ const formData = await this.saveFormDataWithoutValues(udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);
376
367
  return formData;
377
368
  }
378
369
  /**
@@ -426,7 +417,7 @@ class PrivateFormSubmissionHandler {
426
417
  * @returns updated UdpFormSubmission
427
418
  */
428
419
  async saveCurrentFormSubmissionState(values, udpFormSubmission) {
429
- return this.saveSubmissionToDB(values, udpFormSubmission, 'in-progress');
420
+ return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);
430
421
  }
431
422
  /**
432
423
  * Finalize and submit the form (set state to 'submitted').
@@ -438,7 +429,7 @@ class PrivateFormSubmissionHandler {
438
429
  * @returns updated UdpFormSubmission
439
430
  */
440
431
  async finalizeFormSubmissionState(values, udpFormSubmission) {
441
- return this.saveSubmissionToDB(values, udpFormSubmission, 'submitted');
432
+ return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.Submitted);
442
433
  }
443
434
  // =============================
444
435
  // Helpers
@@ -498,9 +489,10 @@ class PrivateFormSubmissionHandler {
498
489
  * @returns updated UdpFormSubmission
499
490
  */
500
491
  async saveCommentsToDB(values, udpFormSubmission) {
492
+ var _a;
501
493
  try {
502
494
  const method = 'PUT';
503
- const status = udpFormSubmission.status || 2; // default to 'submitted' if status is null
495
+ const status = (_a = udpFormSubmission.status) !== null && _a !== void 0 ? _a : UdpFormsSubmissionStatusEnum.Submitted;
504
496
  const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}`;
505
497
  const formData = udpFormSubmission.processSubmissionIntoFormData(values, status);
506
498
  const response = await makeApiCall(method, url, formData, true);
@@ -566,6 +558,200 @@ class UdpForm {
566
558
  }
567
559
  }
568
560
 
561
+ // utility to find repeat group keys from current values
562
+ const findRepeatGroupKeys = (sectionName, values) => {
563
+ const keys = Object.keys(values);
564
+ const repeatGroupSet = new Set();
565
+ // Match: sectionName_2
566
+ const regex = new RegExp(`^${sectionName}_(\\d+)`);
567
+ keys.forEach(key => {
568
+ const match = key.match(regex);
569
+ if (match && match[1]) {
570
+ repeatGroupSet.add(Number(match[1]));
571
+ }
572
+ });
573
+ return Array.from(repeatGroupSet).sort((a, b) => a - b);
574
+ };
575
+ // build dynamic sections based on the master form
576
+ const initializeDynamicSections = (udpForm, currentValues) => {
577
+ var _a;
578
+ const dynamicSections = [];
579
+ const sortedSections = structuredClone(udpForm.udpFormUdpFormSection).sort((a, b) => a.order - b.order);
580
+ for (const section of sortedSections) {
581
+ section.sectionProperties = JSON.parse(section.sectionProperties || {});
582
+ const repeatGroupKeys = findRepeatGroupKeys(section.name, currentValues);
583
+ section.isOriginalSection = true;
584
+ section.sectionPositionSuffix = 1; // default position
585
+ // always add the original section into dynamic sections
586
+ dynamicSections.push(Object.assign(Object.assign({}, structuredClone(section)), {
587
+ // dynamicSectionName: section.name,
588
+ formQuestions: structuredClone(udpForm.formQuestions)
589
+ .filter(q => q.formSectionId === section.id)
590
+ .sort((a, b) => a.questionOrder - b.questionOrder)
591
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}.${q.name}`, isShowCommentInput: true })))
592
+ }));
593
+ // create then add additional sections if there are repeated sections
594
+ if (((_a = section.sectionProperties) === null || _a === void 0 ? void 0 : _a.isRepeatable) && repeatGroupKeys.length > 0) {
595
+ const maxRepeatedSectionSuffix = Math.max(...repeatGroupKeys); // create a new section for the max value of repeat group keys, even if there are no saved answers
596
+ // for (const repeatKey of repeatGroupKeys) { // create a section only for the suffix saved
597
+ for (let repeatKey = 2; repeatKey <= maxRepeatedSectionSuffix; repeatKey++) {
598
+ const clonedSection = Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(udpForm.formQuestions)
599
+ .filter(q => q.formSectionId === section.id)
600
+ .sort((a, b) => a.questionOrder - b.questionOrder)
601
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}_${repeatKey}.${q.name}`, isShowCommentInput: true }))), isOriginalSection: false, sectionPositionSuffix: repeatKey });
602
+ dynamicSections.push(clonedSection);
603
+ }
604
+ }
605
+ }
606
+ return dynamicSections;
607
+ };
608
+ // urlContext is derived from query params that start with `udpf_` (see useUdpFormParameters).
609
+ // Keys are stored without the prefix, e.g. `udpf_section1_3.question1=val` -> urlContext['section1_3.question1'] = 'val'
610
+ // This helper finds the maximum repeat suffix requested by urlContext for a given section base name.
611
+ // Example: { 'sectionA_3.q1': 'x', 'sectionA_2.q2': 'y' } -> { sectionA: 3 }
612
+ const getMaxRepeatSuffixBySectionFromUrlContext = (urlContext) => {
613
+ const context = (urlContext && typeof urlContext === 'object') ? urlContext : {};
614
+ const maxBySection = {};
615
+ Object.keys(context).forEach(key => {
616
+ var _a;
617
+ // Expect keys like: sectionName_3.questionName
618
+ // Only treat it as a repeat hint if it has a dot after the suffix.
619
+ const match = key.match(/^([^._?&#]+)_(\d+)\./);
620
+ if (!match)
621
+ return;
622
+ const baseSectionName = match[1];
623
+ const suffix = Number(match[2]);
624
+ if (!Number.isFinite(suffix) || suffix < 2)
625
+ return;
626
+ const existing = (_a = maxBySection[baseSectionName]) !== null && _a !== void 0 ? _a : 1;
627
+ if (suffix > existing)
628
+ maxBySection[baseSectionName] = suffix;
629
+ });
630
+ return maxBySection;
631
+ };
632
+ // build dynamic sections based on the master form plus optional repeat hints from URL context
633
+ const initializeDynamicSectionsWithUrlContext = (udpForm, currentValues, urlContext) => {
634
+ var _a, _b;
635
+ const maxRepeatFromUrl = getMaxRepeatSuffixBySectionFromUrlContext(urlContext);
636
+ const dynamicSections = [];
637
+ const sortedSections = structuredClone(udpForm.udpFormUdpFormSection).sort((a, b) => a.order - b.order);
638
+ for (const section of sortedSections) {
639
+ section.sectionProperties = JSON.parse(section.sectionProperties || {});
640
+ const repeatGroupKeys = findRepeatGroupKeys(section.name, currentValues);
641
+ const maxRepeatedFromValues = repeatGroupKeys.length > 0 ? Math.max(...repeatGroupKeys) : 1;
642
+ const maxRepeatedFromUrl = (_a = maxRepeatFromUrl === null || maxRepeatFromUrl === void 0 ? void 0 : maxRepeatFromUrl[section.name]) !== null && _a !== void 0 ? _a : 1;
643
+ const maxRepeatedSectionSuffix = Math.max(maxRepeatedFromValues, maxRepeatedFromUrl);
644
+ section.isOriginalSection = true;
645
+ section.sectionPositionSuffix = 1; // default position
646
+ // always add the original section into dynamic sections
647
+ dynamicSections.push(Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(udpForm.formQuestions)
648
+ .filter(q => q.formSectionId === section.id)
649
+ .sort((a, b) => a.questionOrder - b.questionOrder)
650
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}.${q.name}`, isShowCommentInput: true }))) }));
651
+ // create then add additional sections if repeatable and suffix requested by saved values or url
652
+ if (((_b = section.sectionProperties) === null || _b === void 0 ? void 0 : _b.isRepeatable) && maxRepeatedSectionSuffix >= 2) {
653
+ for (let repeatKey = 2; repeatKey <= maxRepeatedSectionSuffix; repeatKey++) {
654
+ const clonedSection = Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(udpForm.formQuestions)
655
+ .filter(q => q.formSectionId === section.id)
656
+ .sort((a, b) => a.questionOrder - b.questionOrder)
657
+ .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}_${repeatKey}.${q.name}`, isShowCommentInput: true }))), isOriginalSection: false, sectionPositionSuffix: repeatKey });
658
+ dynamicSections.push(clonedSection);
659
+ }
660
+ }
661
+ }
662
+ return dynamicSections;
663
+ };
664
+ const applyUrlSeedValuesForAll = (dynamicSections, urlContext) => {
665
+ if (!Array.isArray(dynamicSections))
666
+ return;
667
+ // urlContext is derived from query params that start with `udpf_` (see useUdpFormParameters).
668
+ // Keys are stored without the prefix, e.g. `udpf_section1.question1=val` -> urlContext['section1.question1'] = 'val'
669
+ const context = (urlContext && typeof urlContext === 'object') ? urlContext : {};
670
+ // Build a case-insensitive view of urlContext so callers can use udpf_ keys without worrying about case.
671
+ // If duplicate keys exist with different casing, the last one encountered wins.
672
+ const contextCI = {};
673
+ Object.keys(context).forEach(k => {
674
+ contextCI[String(k).toLowerCase()] = context[k];
675
+ });
676
+ // 1) Collect URL values into nested structure: { [sectionKey]: { [questionName]: { value, comments: [] } } }
677
+ const urlValuesNested = {};
678
+ dynamicSections.forEach(section => {
679
+ const sectionKey = section.isOriginalSection
680
+ ? section.name
681
+ : `${section.name}_${section.sectionPositionSuffix}`;
682
+ (section.formQuestions || []).forEach(q => {
683
+ if (!q)
684
+ return;
685
+ const candidates = [q.processedSubmissionName, q.questionIdentifierKey, q.name].filter(Boolean);
686
+ let urlVal = undefined;
687
+ for (const c of candidates) {
688
+ const key = String(c).toLowerCase();
689
+ if (Object.prototype.hasOwnProperty.call(contextCI, key)) {
690
+ urlVal = contextCI[key];
691
+ break;
692
+ }
693
+ }
694
+ if (urlVal !== undefined && urlVal !== null) {
695
+ if (!urlValuesNested[sectionKey])
696
+ urlValuesNested[sectionKey] = {};
697
+ urlValuesNested[sectionKey][q.name] = { value: urlVal, comments: [] };
698
+ }
699
+ });
700
+ });
701
+ // Caller is responsible for merging with saved submissionResponseData.
702
+ // Here we only return the url-derived seed values + paragraph defaults.
703
+ const merged = {};
704
+ Object.entries(urlValuesNested).forEach(([sectionKey, qMap]) => {
705
+ if (!merged[sectionKey])
706
+ merged[sectionKey] = {};
707
+ Object.entries(qMap).forEach(([qName, valObj]) => {
708
+ const existing = merged[sectionKey][qName];
709
+ // Only set from URL if no saved value exists (null/undefined/empty-string)
710
+ const isMissing = existing == null ||
711
+ existing.value == null ||
712
+ (typeof existing.value === 'string' && existing.value.trim() === '');
713
+ if (isMissing) {
714
+ merged[sectionKey][qName] = valObj;
715
+ }
716
+ });
717
+ });
718
+ // 3) Paragraph defaults: if still undefined/null, use fieldProperties.paragraphText
719
+ dynamicSections.forEach(section => {
720
+ const sectionKey = section.isOriginalSection
721
+ ? section.name
722
+ : `${section.name}_${section.sectionPositionSuffix}`;
723
+ if (!merged[sectionKey])
724
+ merged[sectionKey] = {};
725
+ (section.formQuestions || []).forEach(q => {
726
+ var _a;
727
+ if (!q)
728
+ return;
729
+ if (q.fieldTypeId === UdpFormsFieldTypeEnum.Paragraph) {
730
+ const existing = merged[sectionKey][q.name];
731
+ const isMissing = existing == null ||
732
+ existing.value == null ||
733
+ (typeof existing.value === 'string' && existing.value.trim() === '');
734
+ if (isMissing) {
735
+ let fieldProps = q === null || q === void 0 ? void 0 : q.fieldProperties;
736
+ if (typeof fieldProps === 'string') {
737
+ try {
738
+ fieldProps = JSON.parse(fieldProps || '{}');
739
+ }
740
+ catch (_b) {
741
+ fieldProps = {};
742
+ }
743
+ }
744
+ merged[sectionKey][q.name] = {
745
+ value: (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.paragraphText) !== null && _a !== void 0 ? _a : '',
746
+ comments: [],
747
+ };
748
+ }
749
+ }
750
+ });
751
+ });
752
+ return merged;
753
+ };
754
+
569
755
  const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRenderer extends H {
570
756
  constructor(registerHost) {
571
757
  super();
@@ -575,9 +761,10 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
575
761
  this.__attachShadow();
576
762
  this.isPublic = false;
577
763
  this.autoSaveDelay = 2000; // Debounce delay for auto-save in milliseconds (currently disabled)
578
- this.initialValues = {};
764
+ 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'
765
+ this.currentValues = {}; // values of the current form state
766
+ this.formInputSeedValues = {}; // support for a initial set of values to seed the form with
579
767
  this.submitSuccessful = false;
580
- this.currentFormData = {};
581
768
  this.isLoading = false;
582
769
  this.isSaving = false;
583
770
  this.isSubmitted = false;
@@ -632,7 +819,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
632
819
  return;
633
820
  const cloningSectionName = sectionToClone.name;
634
821
  // Find existing repeat group indices
635
- const repeatKeys = this.findRepeatGroupKeys(cloningSectionName, this.initialValues);
822
+ const repeatKeys = findRepeatGroupKeys(cloningSectionName, this.currentValues);
636
823
  const nextRepeatIndex = repeatKeys.length > 0 ? Math.max(...repeatKeys) + 1 : 2;
637
824
  const clonedSection = Object.assign(Object.assign({}, structuredClone(sectionToClone)), { formQuestions: sectionToClone.formQuestions.map(q => {
638
825
  const newQuestionObj = structuredClone(q);
@@ -657,13 +844,13 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
657
844
  ...this.dynamicSections.slice(insertAtIndex + 1),
658
845
  ];
659
846
  // Create new initial values structure
660
- const newInitialValues = structuredClone(this.udpFormSubmission.data.submissionResponseData);
847
+ const newCurrentValues = structuredClone(this.udpFormSubmission.data.submissionResponseData);
661
848
  clonedSection.formQuestions.forEach(q => {
662
849
  var _a, _b, _c, _d;
663
850
  const newSectionNameWithSuffix = `${cloningSectionName}_${nextRepeatIndex}`;
664
851
  const newQuestionName = q.name;
665
- if (!newInitialValues[newSectionNameWithSuffix]) {
666
- newInitialValues[newSectionNameWithSuffix] = {};
852
+ if (!newCurrentValues[newSectionNameWithSuffix]) {
853
+ newCurrentValues[newSectionNameWithSuffix] = {};
667
854
  }
668
855
  // Preserve only Paragraph values from the source section; clear others
669
856
  let value = '';
@@ -685,11 +872,11 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
685
872
  const paragraphDefault = (_d = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.paragraphText) !== null && _d !== void 0 ? _d : '';
686
873
  value = sourceVal !== null && sourceVal !== void 0 ? sourceVal : paragraphDefault;
687
874
  }
688
- newInitialValues[newSectionNameWithSuffix][newQuestionName] = { value, comments: [], metadata: {} };
875
+ newCurrentValues[newSectionNameWithSuffix][newQuestionName] = { value, comments: [], metadata: {} };
689
876
  });
690
877
  // This will trigger a complete form re-render
691
- this.initialValues = Object.assign({}, newInitialValues);
692
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
878
+ this.currentValues = Object.assign({}, newCurrentValues);
879
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
693
880
  this.triggerFormRerender();
694
881
  }
695
882
  finally {
@@ -713,8 +900,8 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
713
900
  const deleteSectionName = sectionToDelete.name;
714
901
  const deleteSuffix = sectionToDelete.sectionPositionSuffix;
715
902
  const sectionKeyToDelete = `${deleteSectionName}_${deleteSuffix}`;
716
- const newInitialValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
717
- delete newInitialValues[sectionKeyToDelete];
903
+ const newCurrentValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
904
+ delete newCurrentValues[sectionKeyToDelete];
718
905
  // Remove the section from dynamicSections
719
906
  const updatedSections = structuredClone(this.dynamicSections);
720
907
  updatedSections.splice(index, 1);
@@ -738,14 +925,14 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
738
925
  return newSectionQuestion;
739
926
  });
740
927
  // Move data in initial values
741
- if (newInitialValues[oldSectionKey]) {
742
- newInitialValues[newSectionKey] = structuredClone(newInitialValues[oldSectionKey]);
743
- delete newInitialValues[oldSectionKey];
928
+ if (newCurrentValues[oldSectionKey]) {
929
+ newCurrentValues[newSectionKey] = structuredClone(newCurrentValues[oldSectionKey]);
930
+ delete newCurrentValues[oldSectionKey];
744
931
  }
745
932
  });
746
933
  this.dynamicSections = updatedSections;
747
- this.initialValues = Object.assign({}, newInitialValues);
748
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
934
+ this.currentValues = Object.assign({}, newCurrentValues);
935
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
749
936
  this.triggerFormRerender();
750
937
  }
751
938
  finally {
@@ -763,7 +950,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
763
950
  try {
764
951
  const updatedUdpFormSubmission = await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);
765
952
  this.udpFormSubmission = updatedUdpFormSubmission;
766
- this.initialValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
953
+ this.currentValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
767
954
  if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {
768
955
  // replace the current entry's query string with udpf_submissionId without needing to know the path
769
956
  this.replaceUrlWithSubmissionId(updatedUdpFormSubmission.id);
@@ -788,7 +975,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
788
975
  try {
789
976
  const updatedUdpFormSubmission = await this.formSubmissionHandler.saveFormSubmissionComments(values, this.udpFormSubmission);
790
977
  this.udpFormSubmission = updatedUdpFormSubmission;
791
- this.initialValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
978
+ this.currentValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
792
979
  this.enqueueSnackbar('Saved sucessfully.', {
793
980
  variant: 'success',
794
981
  anchorOrigin: { vertical: 'top', horizontal: 'center' },
@@ -820,7 +1007,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
820
1007
  try {
821
1008
  const updatedUdpFormSubmission = await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);
822
1009
  this.udpFormSubmission = updatedUdpFormSubmission;
823
- this.initialValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
1010
+ this.currentValues = Object.assign({}, (((_a = updatedUdpFormSubmission.data) === null || _a === void 0 ? void 0 : _a.submissionResponseData) || {}));
824
1011
  if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {
825
1012
  // replace the current entry's query string with udpf_submissionId without needing to know the path
826
1013
  this.replaceUrlWithSubmissionId(updatedUdpFormSubmission.id);
@@ -870,7 +1057,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
870
1057
  // create a new follow up form submission instance wiht a link to the parent form submission
871
1058
  const followUpMasterForm = await this.formHandler.getFormByFormIdAndFormVersion(followUpFormId, followUpFormVersion);
872
1059
  const followUpSubmissionData = {
873
- submissionResponseData: buildEmptyInitialValues(followUpMasterForm),
1060
+ submissionResponseData: buildEmptyCurrentValues(followUpMasterForm),
874
1061
  submissionMetadata: {
875
1062
  ParentSubmission: {
876
1063
  submissionId: parentFormSubmissionId,
@@ -923,7 +1110,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
923
1110
  this.clientUserInfo.email = user.email || null;
924
1111
  }
925
1112
  this.formSubmissionHandler = FormSubmissionHandlerFactory.create(this.isPublic, this.clientUserInfo.id);
926
- 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 });
1113
+ 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 });
927
1114
  // fetch existing submission from Udp.FormSubmission if submissionId is provided
928
1115
  // take exisitng object, and populate with db values, and return new obj with updated values
929
1116
  if (this.submissionId) {
@@ -943,18 +1130,29 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
943
1130
  this.formHandler = new UdpFormHandler(this.tenantId);
944
1131
  const formData = await this.formHandler.getFormByFormIdAndFormVersion(formId, formVersion);
945
1132
  this.udpForm = new UdpForm(formData);
946
- this.initialValues = buildEmptyInitialValues(this.udpForm);
1133
+ this.currentValues = buildEmptyCurrentValues(this.udpForm);
947
1134
  // if there's existing data, update the form's state
948
1135
  if (this.udpFormSubmission.data.submissionResponseData) {
949
- this.initialValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
950
- if (this.udpFormSubmission.status === 2 || this.udpFormSubmission.status === 'submitted') {
1136
+ this.currentValues = Object.assign({}, this.udpFormSubmission.data.submissionResponseData);
1137
+ if (this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Submitted) {
951
1138
  this.isSubmitted = true;
952
1139
  }
953
1140
  }
954
- this.initializeDynamicSections(); // process the master form into dynamic sections
955
- // After sections/questions are prepared, seed initial values from URL for ALL questions,
956
- // with saved values taking precedence, and paragraph defaults as a fallback.
957
- this.applyUrlInitialValuesForAll();
1141
+ // For new submissions (un-instiantiated or in the 'created' status), we allow the seeding of initial values from URL params
1142
+ // So we build dynamicSections with urlContext first, then seed values.
1143
+ // URL params (udpf_*) may imply repeatable section instances (e.g. section1_3.question1).
1144
+ // For existing submissions that are in progress, skip URL-based seeding and do not create additional sections from URL.
1145
+ if ((!this.udpFormSubmission.id || this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Created) && this.urlContext && Object.keys(this.urlContext).length > 0) {
1146
+ this.dynamicSections = initializeDynamicSectionsWithUrlContext(this.udpForm, this.currentValues, this.urlContext);
1147
+ const seeded = applyUrlSeedValuesForAll(this.dynamicSections, this.urlContext);
1148
+ if (seeded) {
1149
+ this.currentValues = seeded;
1150
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, seeded);
1151
+ }
1152
+ }
1153
+ else {
1154
+ this.dynamicSections = initializeDynamicSections(this.udpForm, this.currentValues);
1155
+ }
958
1156
  // Set up throttled manual save function (5 seconds) - fires immediately, then throttles
959
1157
  this.debouncedManualSave = throttle(async (values) => {
960
1158
  await this.handleManualSave(values);
@@ -971,136 +1169,6 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
971
1169
  this.isLoading = false;
972
1170
  }
973
1171
  }
974
- // build dynamic sections based on the
975
- initializeDynamicSections() {
976
- var _a;
977
- const tempDynamicSection = [];
978
- const sortedSections = structuredClone(this.udpForm.udpFormUdpFormSection).sort((a, b) => a.order - b.order);
979
- for (const section of sortedSections) {
980
- section.sectionProperties = JSON.parse(section.sectionProperties || {});
981
- const repeatGroupKeys = this.findRepeatGroupKeys(section.name, this.initialValues);
982
- section.isOriginalSection = true;
983
- section.sectionPositionSuffix = 1; // default position
984
- // always add the original section into dynamic sections
985
- tempDynamicSection.push(Object.assign(Object.assign({}, structuredClone(section)), {
986
- // dynamicSectionName: section.name,
987
- formQuestions: structuredClone(this.udpForm.formQuestions)
988
- .filter(q => q.formSectionId === section.id)
989
- .sort((a, b) => a.questionOrder - b.questionOrder)
990
- .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}.${q.name}`, isShowCommentInput: true })))
991
- }));
992
- // create then add additional sections if there are repeated sections
993
- if (((_a = section.sectionProperties) === null || _a === void 0 ? void 0 : _a.isRepeatable) && repeatGroupKeys.length > 0) {
994
- const maxRepeatedSectionSuffix = Math.max(...repeatGroupKeys); // create a new section for the max value of repeat group keys, even if there are no saved answers
995
- // for (const repeatKey of repeatGroupKeys) { // create a section only for the suffix saved
996
- for (let repeatKey = 2; repeatKey <= maxRepeatedSectionSuffix; repeatKey++) {
997
- const clonedSection = Object.assign(Object.assign({}, structuredClone(section)), { formQuestions: structuredClone(this.udpForm.formQuestions)
998
- .filter(q => q.formSectionId === section.id)
999
- .sort((a, b) => a.questionOrder - b.questionOrder)
1000
- .map(q => (Object.assign(Object.assign({}, q), { questionIdentifierKey: `${section.name}_${repeatKey}.${q.name}`, isShowCommentInput: true }))), isOriginalSection: false, sectionPositionSuffix: repeatKey });
1001
- tempDynamicSection.push(clonedSection);
1002
- }
1003
- }
1004
- }
1005
- this.dynamicSections = tempDynamicSection;
1006
- }
1007
- findRepeatGroupKeys(sectionName, values) {
1008
- const keys = Object.keys(values);
1009
- const repeatGroupSet = new Set();
1010
- // Match: sectionName_2
1011
- const regex = new RegExp(`^${sectionName}_(\\d+)`);
1012
- keys.forEach(key => {
1013
- const match = key.match(regex);
1014
- if (match && match[1]) {
1015
- repeatGroupSet.add(Number(match[1]));
1016
- }
1017
- });
1018
- return Array.from(repeatGroupSet).sort((a, b) => a - b);
1019
- }
1020
- // Build initial values from URL for ALL fields, but do NOT override saved values.
1021
- // For Paragraph, also fall back to the builder's default text when nothing else provided.
1022
- applyUrlInitialValuesForAll() {
1023
- if (!Array.isArray(this.dynamicSections))
1024
- return;
1025
- const urlParams = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : null;
1026
- // 1) Collect URL values into nested structure: { [sectionKey]: { [questionName]: { value, comments: [] } } }
1027
- const urlValuesNested = {};
1028
- if (urlParams) {
1029
- this.dynamicSections.forEach(section => {
1030
- const sectionKey = section.isOriginalSection
1031
- ? section.name
1032
- : `${section.name}_${section.sectionPositionSuffix}`;
1033
- (section.formQuestions || []).forEach(q => {
1034
- if (!q)
1035
- return;
1036
- const candidates = [q.processedSubmissionName, q.questionIdentifierKey, q.name].filter(Boolean);
1037
- let urlVal = null;
1038
- for (const c of candidates) {
1039
- urlVal = urlParams.get(c);
1040
- if (urlVal !== null)
1041
- break;
1042
- }
1043
- if (urlVal !== null) {
1044
- if (!urlValuesNested[sectionKey])
1045
- urlValuesNested[sectionKey] = {};
1046
- urlValuesNested[sectionKey][q.name] = { value: urlVal, comments: [] };
1047
- }
1048
- });
1049
- });
1050
- }
1051
- // 2) Merge with saved values (this.initialValues) taking precedence
1052
- const merged = structuredClone(this.initialValues) || {};
1053
- Object.entries(urlValuesNested).forEach(([sectionKey, qMap]) => {
1054
- if (!merged[sectionKey])
1055
- merged[sectionKey] = {};
1056
- Object.entries(qMap).forEach(([qName, valObj]) => {
1057
- const existing = merged[sectionKey][qName];
1058
- // Only set from URL if no saved value exists (null/undefined/empty-string)
1059
- const isMissing = existing == null ||
1060
- existing.value == null ||
1061
- (typeof existing.value === 'string' && existing.value.trim() === '');
1062
- if (isMissing) {
1063
- merged[sectionKey][qName] = valObj;
1064
- }
1065
- });
1066
- });
1067
- // 3) Paragraph defaults: if still undefined/null, use fieldProperties.paragraphText
1068
- this.dynamicSections.forEach(section => {
1069
- const sectionKey = section.isOriginalSection
1070
- ? section.name
1071
- : `${section.name}_${section.sectionPositionSuffix}`;
1072
- if (!merged[sectionKey])
1073
- merged[sectionKey] = {};
1074
- (section.formQuestions || []).forEach(q => {
1075
- var _a;
1076
- if (!q)
1077
- return;
1078
- if (q.fieldTypeId === UdpFormsFieldTypeEnum.Paragraph) {
1079
- const existing = merged[sectionKey][q.name];
1080
- const isMissing = existing == null ||
1081
- existing.value == null ||
1082
- (typeof existing.value === 'string' && existing.value.trim() === '');
1083
- if (isMissing) {
1084
- let fieldProps = q === null || q === void 0 ? void 0 : q.fieldProperties;
1085
- if (typeof fieldProps === 'string') {
1086
- try {
1087
- fieldProps = JSON.parse(fieldProps || '{}');
1088
- }
1089
- catch (_b) {
1090
- fieldProps = {};
1091
- }
1092
- }
1093
- merged[sectionKey][q.name] = {
1094
- value: (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.paragraphText) !== null && _a !== void 0 ? _a : '',
1095
- comments: [],
1096
- };
1097
- }
1098
- }
1099
- });
1100
- });
1101
- this.initialValues = merged;
1102
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, merged);
1103
- }
1104
1172
  async handleSubmit(values) {
1105
1173
  this.isLoading = true;
1106
1174
  try {
@@ -1157,13 +1225,13 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1157
1225
  try {
1158
1226
  const { type, questionIdentifierKey, commentId } = e.detail;
1159
1227
  const [sectionName, questionName] = questionIdentifierKey.split('.');
1160
- let newInitialValues = structuredClone(this.udpFormSubmission.data.submissionResponseData || {});
1228
+ let newCurrentValues = structuredClone(this.udpFormSubmission.data.submissionResponseData || {});
1161
1229
  // ensure structure exists WITHOUT overwriting existing data
1162
- if (!newInitialValues[sectionName])
1163
- newInitialValues[sectionName] = {};
1164
- if (!newInitialValues[sectionName][questionName]) {
1230
+ if (!newCurrentValues[sectionName])
1231
+ newCurrentValues[sectionName] = {};
1232
+ if (!newCurrentValues[sectionName][questionName]) {
1165
1233
  // create defaults but do not clobber any existing saved shape from submissionResponseData
1166
- newInitialValues[sectionName][questionName] = {
1234
+ newCurrentValues[sectionName][questionName] = {
1167
1235
  value: '',
1168
1236
  comments: [],
1169
1237
  draftComments: [],
@@ -1172,20 +1240,20 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1172
1240
  }
1173
1241
  else {
1174
1242
  // ensure arrays/objects exist so later code can safely push/filter
1175
- newInitialValues[sectionName][questionName].comments = (_a = newInitialValues[sectionName][questionName].comments) !== null && _a !== void 0 ? _a : [];
1176
- newInitialValues[sectionName][questionName].draftComments = (_b = newInitialValues[sectionName][questionName].draftComments) !== null && _b !== void 0 ? _b : [];
1177
- newInitialValues[sectionName][questionName].metadata = (_c = newInitialValues[sectionName][questionName].metadata) !== null && _c !== void 0 ? _c : {};
1243
+ newCurrentValues[sectionName][questionName].comments = (_a = newCurrentValues[sectionName][questionName].comments) !== null && _a !== void 0 ? _a : [];
1244
+ newCurrentValues[sectionName][questionName].draftComments = (_b = newCurrentValues[sectionName][questionName].draftComments) !== null && _b !== void 0 ? _b : [];
1245
+ newCurrentValues[sectionName][questionName].metadata = (_c = newCurrentValues[sectionName][questionName].metadata) !== null && _c !== void 0 ? _c : {};
1178
1246
  }
1179
1247
  // normalize draftComments to array if needed (back-compat)
1180
- const maybeDraft = newInitialValues[sectionName][questionName].draftComments;
1248
+ const maybeDraft = newCurrentValues[sectionName][questionName].draftComments;
1181
1249
  if (maybeDraft && !Array.isArray(maybeDraft)) {
1182
- newInitialValues[sectionName][questionName].draftComments = [maybeDraft];
1250
+ newCurrentValues[sectionName][questionName].draftComments = [maybeDraft];
1183
1251
  }
1184
1252
  else if (!maybeDraft) {
1185
- newInitialValues[sectionName][questionName].draftComments = [];
1253
+ newCurrentValues[sectionName][questionName].draftComments = [];
1186
1254
  }
1187
- const commentsArr = newInitialValues[sectionName][questionName].comments || [];
1188
- const draftsArr = newInitialValues[sectionName][questionName].draftComments || [];
1255
+ const commentsArr = newCurrentValues[sectionName][questionName].comments || [];
1256
+ const draftsArr = newCurrentValues[sectionName][questionName].draftComments || [];
1189
1257
  switch (type) {
1190
1258
  case 'add': {
1191
1259
  const newDraft = {
@@ -1195,7 +1263,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1195
1263
  timestamp: null,
1196
1264
  };
1197
1265
  // put new draft first so activeDraft === draftComments[0] matches UX
1198
- newInitialValues[sectionName][questionName].draftComments = [newDraft, ...draftsArr];
1266
+ newCurrentValues[sectionName][questionName].draftComments = [newDraft, ...draftsArr];
1199
1267
  break;
1200
1268
  }
1201
1269
  case 'save': {
@@ -1211,13 +1279,13 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1211
1279
  if (existingIdx !== -1) {
1212
1280
  const newComments = [...commentsArr];
1213
1281
  newComments[existingIdx] = Object.assign({}, savedComment);
1214
- newInitialValues[sectionName][questionName].comments = newComments;
1282
+ newCurrentValues[sectionName][questionName].comments = newComments;
1215
1283
  }
1216
1284
  else {
1217
- newInitialValues[sectionName][questionName].comments = [...commentsArr, savedComment];
1285
+ newCurrentValues[sectionName][questionName].comments = [...commentsArr, savedComment];
1218
1286
  }
1219
1287
  // remove that draft
1220
- newInitialValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1288
+ newCurrentValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1221
1289
  break;
1222
1290
  }
1223
1291
  case 'edit': {
@@ -1227,13 +1295,13 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1227
1295
  return;
1228
1296
  const draftFromSaved = Object.assign(Object.assign({}, saved), { isDraftComment: true, timestamp: null });
1229
1297
  // Add this draft at the front; keep saved comment intact so content doesn't disappear.
1230
- newInitialValues[sectionName][questionName].draftComments = [draftFromSaved, ...draftsArr];
1231
- newInitialValues[sectionName][questionName].comments = commentsArr;
1298
+ newCurrentValues[sectionName][questionName].draftComments = [draftFromSaved, ...draftsArr];
1299
+ newCurrentValues[sectionName][questionName].comments = commentsArr;
1232
1300
  break;
1233
1301
  }
1234
1302
  case 'delete': {
1235
1303
  // mark the comment as deleted and clear its value, then persist.
1236
- newInitialValues[sectionName][questionName].comments = commentsArr.map(c => {
1304
+ newCurrentValues[sectionName][questionName].comments = commentsArr.map(c => {
1237
1305
  if (c.commentId === commentId) {
1238
1306
  return Object.assign(Object.assign({}, c), { isDeleted: true, value: '', editedTimestamp: new Date().toISOString() });
1239
1307
  }
@@ -1243,18 +1311,18 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1243
1311
  }
1244
1312
  case 'editClose': {
1245
1313
  // Cancel edit: remove the draft only, do NOT restore/alter saved comments.
1246
- newInitialValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1314
+ newCurrentValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);
1247
1315
  break;
1248
1316
  }
1249
1317
  }
1250
1318
  // if it's a save or delete action, persist immediately
1251
1319
  if (type === 'save' || type === 'delete') {
1252
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
1253
- await this.handleCommmentUpdate(newInitialValues);
1320
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
1321
+ await this.handleCommmentUpdate(newCurrentValues);
1254
1322
  }
1255
1323
  else {
1256
- this.initialValues = Object.assign({}, newInitialValues);
1257
- this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newInitialValues);
1324
+ this.currentValues = Object.assign({}, newCurrentValues);
1325
+ this.udpFormSubmission.data.submissionResponseData = Object.assign({}, newCurrentValues);
1258
1326
  }
1259
1327
  }
1260
1328
  catch (error) {
@@ -1309,7 +1377,7 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1309
1377
  return this.isSubmitted || this.udpFormSubmission.unityUserId !== this.clientUserInfo.id;
1310
1378
  }
1311
1379
  render() {
1312
- 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,
1380
+ 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,
1313
1381
  // showAutoSaveStatus={this.formSubmissionHandler.supportsAutoSave() && !!this.userId}
1314
1382
  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 })));
1315
1383
  }
@@ -1326,12 +1394,10 @@ const UdpFormsRenderer$1 = /*@__PURE__*/ proxyCustomElement(class UdpFormsRender
1326
1394
  "closeSnackbar": [16],
1327
1395
  "autoSaveDelay": [2, "auto-save-delay"],
1328
1396
  "history": [8],
1329
- "generic1": [8, "generic-1"],
1330
- "generic2": [8, "generic-2"],
1331
- "generic3": [8, "generic-3"],
1332
- "initialValues": [32],
1397
+ "urlContext": [16],
1398
+ "currentValues": [32],
1399
+ "formInputSeedValues": [32],
1333
1400
  "submitSuccessful": [32],
1334
- "currentFormData": [32],
1335
1401
  "isLoading": [32],
1336
1402
  "isSaving": [32],
1337
1403
  "isSubmitted": [32],