@mj-biz-apps/forms-ng 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/dist/lib/builder/builder-models.d.ts +27 -0
  2. package/dist/lib/builder/builder-models.d.ts.map +1 -0
  3. package/dist/lib/builder/builder-models.js +15 -0
  4. package/dist/lib/builder/builder-models.js.map +1 -0
  5. package/dist/lib/builder/builder-state.service.d.ts +48 -0
  6. package/dist/lib/builder/builder-state.service.d.ts.map +1 -0
  7. package/dist/lib/builder/builder-state.service.js +231 -0
  8. package/dist/lib/builder/builder-state.service.js.map +1 -0
  9. package/dist/lib/builder/builder-styles.d.ts +12 -0
  10. package/dist/lib/builder/builder-styles.d.ts.map +1 -0
  11. package/dist/lib/builder/builder-styles.js +74 -0
  12. package/dist/lib/builder/builder-styles.js.map +1 -0
  13. package/dist/lib/builder/conditional-rule-editor.component.d.ts +53 -0
  14. package/dist/lib/builder/conditional-rule-editor.component.d.ts.map +1 -0
  15. package/dist/lib/builder/conditional-rule-editor.component.js +282 -0
  16. package/dist/lib/builder/conditional-rule-editor.component.js.map +1 -0
  17. package/dist/lib/builder/design-panel.component.d.ts +71 -0
  18. package/dist/lib/builder/design-panel.component.d.ts.map +1 -0
  19. package/dist/lib/builder/design-panel.component.js +530 -0
  20. package/dist/lib/builder/design-panel.component.js.map +1 -0
  21. package/dist/lib/builder/design-panel.styles.d.ts +10 -0
  22. package/dist/lib/builder/design-panel.styles.d.ts.map +1 -0
  23. package/dist/lib/builder/design-panel.styles.js +78 -0
  24. package/dist/lib/builder/design-panel.styles.js.map +1 -0
  25. package/dist/lib/builder/design-state.service.d.ts +51 -0
  26. package/dist/lib/builder/design-state.service.d.ts.map +1 -0
  27. package/dist/lib/builder/design-state.service.js +108 -0
  28. package/dist/lib/builder/design-state.service.js.map +1 -0
  29. package/dist/lib/builder/distribution-links.d.ts +29 -0
  30. package/dist/lib/builder/distribution-links.d.ts.map +1 -0
  31. package/dist/lib/builder/distribution-links.js +53 -0
  32. package/dist/lib/builder/distribution-links.js.map +1 -0
  33. package/dist/lib/builder/distribution-manager.component.d.ts +53 -0
  34. package/dist/lib/builder/distribution-manager.component.d.ts.map +1 -0
  35. package/dist/lib/builder/distribution-manager.component.js +330 -0
  36. package/dist/lib/builder/distribution-manager.component.js.map +1 -0
  37. package/dist/lib/builder/distribution.service.d.ts +62 -0
  38. package/dist/lib/builder/distribution.service.d.ts.map +1 -0
  39. package/dist/lib/builder/distribution.service.js +140 -0
  40. package/dist/lib/builder/distribution.service.js.map +1 -0
  41. package/dist/lib/builder/entity-names.d.ts +20 -0
  42. package/dist/lib/builder/entity-names.d.ts.map +1 -0
  43. package/dist/lib/builder/entity-names.js +20 -0
  44. package/dist/lib/builder/entity-names.js.map +1 -0
  45. package/dist/lib/builder/form-builder.component.d.ts +92 -0
  46. package/dist/lib/builder/form-builder.component.d.ts.map +1 -0
  47. package/dist/lib/builder/form-builder.component.js +627 -0
  48. package/dist/lib/builder/form-builder.component.js.map +1 -0
  49. package/dist/lib/builder/form-builder.styles.d.ts +3 -0
  50. package/dist/lib/builder/form-builder.styles.d.ts.map +1 -0
  51. package/dist/lib/builder/form-builder.styles.js +94 -0
  52. package/dist/lib/builder/form-builder.styles.js.map +1 -0
  53. package/dist/lib/builder/form-preview-modal.component.d.ts +25 -0
  54. package/dist/lib/builder/form-preview-modal.component.d.ts.map +1 -0
  55. package/dist/lib/builder/form-preview-modal.component.js +90 -0
  56. package/dist/lib/builder/form-preview-modal.component.js.map +1 -0
  57. package/dist/lib/builder/index.d.ts +31 -0
  58. package/dist/lib/builder/index.d.ts.map +1 -0
  59. package/dist/lib/builder/index.js +32 -0
  60. package/dist/lib/builder/index.js.map +1 -0
  61. package/dist/lib/builder/json-fields.d.ts +14 -0
  62. package/dist/lib/builder/json-fields.d.ts.map +1 -0
  63. package/dist/lib/builder/json-fields.js +100 -0
  64. package/dist/lib/builder/json-fields.js.map +1 -0
  65. package/dist/lib/builder/publish.service.d.ts +34 -0
  66. package/dist/lib/builder/publish.service.d.ts.map +1 -0
  67. package/dist/lib/builder/publish.service.js +110 -0
  68. package/dist/lib/builder/publish.service.js.map +1 -0
  69. package/dist/lib/builder/qr-code.d.ts +26 -0
  70. package/dist/lib/builder/qr-code.d.ts.map +1 -0
  71. package/dist/lib/builder/qr-code.js +361 -0
  72. package/dist/lib/builder/qr-code.js.map +1 -0
  73. package/dist/lib/builder/question-editor.component.d.ts +41 -0
  74. package/dist/lib/builder/question-editor.component.d.ts.map +1 -0
  75. package/dist/lib/builder/question-editor.component.js +228 -0
  76. package/dist/lib/builder/question-editor.component.js.map +1 -0
  77. package/dist/lib/builder/question-type-catalog.d.ts +29 -0
  78. package/dist/lib/builder/question-type-catalog.d.ts.map +1 -0
  79. package/dist/lib/builder/question-type-catalog.js +43 -0
  80. package/dist/lib/builder/question-type-catalog.js.map +1 -0
  81. package/dist/lib/builder/reorder.d.ts +10 -0
  82. package/dist/lib/builder/reorder.d.ts.map +1 -0
  83. package/dist/lib/builder/reorder.js +18 -0
  84. package/dist/lib/builder/reorder.js.map +1 -0
  85. package/dist/lib/builder/snapshot-builder.d.ts +16 -0
  86. package/dist/lib/builder/snapshot-builder.d.ts.map +1 -0
  87. package/dist/lib/builder/snapshot-builder.js +93 -0
  88. package/dist/lib/builder/snapshot-builder.js.map +1 -0
  89. package/dist/lib/builder/style-tokens.d.ts +54 -0
  90. package/dist/lib/builder/style-tokens.d.ts.map +1 -0
  91. package/dist/lib/builder/style-tokens.js +71 -0
  92. package/dist/lib/builder/style-tokens.js.map +1 -0
  93. package/dist/lib/builder/validation-rule-editor.component.d.ts +27 -0
  94. package/dist/lib/builder/validation-rule-editor.component.d.ts.map +1 -0
  95. package/dist/lib/builder/validation-rule-editor.component.js +179 -0
  96. package/dist/lib/builder/validation-rule-editor.component.js.map +1 -0
  97. package/dist/lib/dashboard/components/distribution-chart.component.d.ts +14 -0
  98. package/dist/lib/dashboard/components/distribution-chart.component.d.ts.map +1 -0
  99. package/dist/lib/dashboard/components/distribution-chart.component.js +85 -0
  100. package/dist/lib/dashboard/components/distribution-chart.component.js.map +1 -0
  101. package/dist/lib/dashboard/components/funnel-chart.component.d.ts +14 -0
  102. package/dist/lib/dashboard/components/funnel-chart.component.d.ts.map +1 -0
  103. package/dist/lib/dashboard/components/funnel-chart.component.js +101 -0
  104. package/dist/lib/dashboard/components/funnel-chart.component.js.map +1 -0
  105. package/dist/lib/dashboard/components/question-breakdown.component.d.ts +16 -0
  106. package/dist/lib/dashboard/components/question-breakdown.component.d.ts.map +1 -0
  107. package/dist/lib/dashboard/components/question-breakdown.component.js +213 -0
  108. package/dist/lib/dashboard/components/question-breakdown.component.js.map +1 -0
  109. package/dist/lib/dashboard/components/response-detail.component.d.ts +11 -0
  110. package/dist/lib/dashboard/components/response-detail.component.d.ts.map +1 -0
  111. package/dist/lib/dashboard/components/response-detail.component.js +113 -0
  112. package/dist/lib/dashboard/components/response-detail.component.js.map +1 -0
  113. package/dist/lib/dashboard/components/response-list.component.d.ts +27 -0
  114. package/dist/lib/dashboard/components/response-list.component.d.ts.map +1 -0
  115. package/dist/lib/dashboard/components/response-list.component.js +196 -0
  116. package/dist/lib/dashboard/components/response-list.component.js.map +1 -0
  117. package/dist/lib/dashboard/components/summary-stats.component.d.ts +12 -0
  118. package/dist/lib/dashboard/components/summary-stats.component.d.ts.map +1 -0
  119. package/dist/lib/dashboard/components/summary-stats.component.js +112 -0
  120. package/dist/lib/dashboard/components/summary-stats.component.js.map +1 -0
  121. package/dist/lib/dashboard/forms-reporting-dashboard.component.d.ts +64 -0
  122. package/dist/lib/dashboard/forms-reporting-dashboard.component.d.ts.map +1 -0
  123. package/dist/lib/dashboard/forms-reporting-dashboard.component.js +397 -0
  124. package/dist/lib/dashboard/forms-reporting-dashboard.component.js.map +1 -0
  125. package/dist/lib/dashboard/index.d.ts +19 -0
  126. package/dist/lib/dashboard/index.d.ts.map +1 -0
  127. package/dist/lib/dashboard/index.js +19 -0
  128. package/dist/lib/dashboard/index.js.map +1 -0
  129. package/dist/lib/dashboard/models/reporting.model.d.ts +125 -0
  130. package/dist/lib/dashboard/models/reporting.model.d.ts.map +1 -0
  131. package/dist/lib/dashboard/models/reporting.model.js +2 -0
  132. package/dist/lib/dashboard/models/reporting.model.js.map +1 -0
  133. package/dist/lib/dashboard/services/forms-reporting-export.service.d.ts +21 -0
  134. package/dist/lib/dashboard/services/forms-reporting-export.service.d.ts.map +1 -0
  135. package/dist/lib/dashboard/services/forms-reporting-export.service.js +83 -0
  136. package/dist/lib/dashboard/services/forms-reporting-export.service.js.map +1 -0
  137. package/dist/lib/dashboard/services/forms-reporting-mock.d.ts +18 -0
  138. package/dist/lib/dashboard/services/forms-reporting-mock.d.ts.map +1 -0
  139. package/dist/lib/dashboard/services/forms-reporting-mock.js +147 -0
  140. package/dist/lib/dashboard/services/forms-reporting-mock.js.map +1 -0
  141. package/dist/lib/dashboard/services/forms-reporting.service.d.ts +45 -0
  142. package/dist/lib/dashboard/services/forms-reporting.service.d.ts.map +1 -0
  143. package/dist/lib/dashboard/services/forms-reporting.service.js +230 -0
  144. package/dist/lib/dashboard/services/forms-reporting.service.js.map +1 -0
  145. package/dist/lib/dashboard/services/reporting-aggregations.d.ts +40 -0
  146. package/dist/lib/dashboard/services/reporting-aggregations.d.ts.map +1 -0
  147. package/dist/lib/dashboard/services/reporting-aggregations.js +379 -0
  148. package/dist/lib/dashboard/services/reporting-aggregations.js.map +1 -0
  149. package/dist/lib/generated/Entities/mjBizAppsCommonAddress/mjbizappscommonaddress.form.component.d.ts +10 -0
  150. package/dist/lib/generated/Entities/mjBizAppsCommonAddress/mjbizappscommonaddress.form.component.d.ts.map +1 -0
  151. package/dist/lib/generated/Entities/mjBizAppsCommonAddress/mjbizappscommonaddress.form.component.js +104 -0
  152. package/dist/lib/generated/Entities/mjBizAppsCommonAddress/mjbizappscommonaddress.form.component.js.map +1 -0
  153. package/dist/lib/generated/Entities/mjBizAppsCommonAddressLink/mjbizappscommonaddresslink.form.component.d.ts +10 -0
  154. package/dist/lib/generated/Entities/mjBizAppsCommonAddressLink/mjbizappscommonaddresslink.form.component.d.ts.map +1 -0
  155. package/dist/lib/generated/Entities/mjBizAppsCommonAddressLink/mjbizappscommonaddresslink.form.component.js +83 -0
  156. package/dist/lib/generated/Entities/mjBizAppsCommonAddressLink/mjbizappscommonaddresslink.form.component.js.map +1 -0
  157. package/dist/lib/generated/Entities/mjBizAppsCommonAddressType/mjbizappscommonaddresstype.form.component.d.ts +10 -0
  158. package/dist/lib/generated/Entities/mjBizAppsCommonAddressType/mjbizappscommonaddresstype.form.component.d.ts.map +1 -0
  159. package/dist/lib/generated/Entities/mjBizAppsCommonAddressType/mjbizappscommonaddresstype.form.component.js +96 -0
  160. package/dist/lib/generated/Entities/mjBizAppsCommonAddressType/mjbizappscommonaddresstype.form.component.js.map +1 -0
  161. package/dist/lib/generated/Entities/mjBizAppsCommonContactMethod/mjbizappscommoncontactmethod.form.component.d.ts +10 -0
  162. package/dist/lib/generated/Entities/mjBizAppsCommonContactMethod/mjbizappscommoncontactmethod.form.component.d.ts.map +1 -0
  163. package/dist/lib/generated/Entities/mjBizAppsCommonContactMethod/mjbizappscommoncontactmethod.form.component.js +83 -0
  164. package/dist/lib/generated/Entities/mjBizAppsCommonContactMethod/mjbizappscommoncontactmethod.form.component.js.map +1 -0
  165. package/dist/lib/generated/Entities/mjBizAppsCommonContactType/mjbizappscommoncontacttype.form.component.d.ts +10 -0
  166. package/dist/lib/generated/Entities/mjBizAppsCommonContactType/mjbizappscommoncontacttype.form.component.d.ts.map +1 -0
  167. package/dist/lib/generated/Entities/mjBizAppsCommonContactType/mjbizappscommoncontacttype.form.component.js +96 -0
  168. package/dist/lib/generated/Entities/mjBizAppsCommonContactType/mjbizappscommoncontacttype.form.component.js.map +1 -0
  169. package/dist/lib/generated/Entities/mjBizAppsCommonOrganization/mjbizappscommonorganization.form.component.d.ts +10 -0
  170. package/dist/lib/generated/Entities/mjBizAppsCommonOrganization/mjbizappscommonorganization.form.component.d.ts.map +1 -0
  171. package/dist/lib/generated/Entities/mjBizAppsCommonOrganization/mjbizappscommonorganization.form.component.js +172 -0
  172. package/dist/lib/generated/Entities/mjBizAppsCommonOrganization/mjbizappscommonorganization.form.component.js.map +1 -0
  173. package/dist/lib/generated/Entities/mjBizAppsCommonOrganizationType/mjbizappscommonorganizationtype.form.component.d.ts +10 -0
  174. package/dist/lib/generated/Entities/mjBizAppsCommonOrganizationType/mjbizappscommonorganizationtype.form.component.d.ts.map +1 -0
  175. package/dist/lib/generated/Entities/mjBizAppsCommonOrganizationType/mjbizappscommonorganizationtype.form.component.js +90 -0
  176. package/dist/lib/generated/Entities/mjBizAppsCommonOrganizationType/mjbizappscommonorganizationtype.form.component.js.map +1 -0
  177. package/dist/lib/generated/Entities/mjBizAppsCommonPerson/mjbizappscommonperson.form.component.d.ts +10 -0
  178. package/dist/lib/generated/Entities/mjBizAppsCommonPerson/mjbizappscommonperson.form.component.d.ts.map +1 -0
  179. package/dist/lib/generated/Entities/mjBizAppsCommonPerson/mjbizappscommonperson.form.component.js +274 -0
  180. package/dist/lib/generated/Entities/mjBizAppsCommonPerson/mjbizappscommonperson.form.component.js.map +1 -0
  181. package/dist/lib/generated/Entities/mjBizAppsCommonRelationship/mjbizappscommonrelationship.form.component.d.ts +10 -0
  182. package/dist/lib/generated/Entities/mjBizAppsCommonRelationship/mjbizappscommonrelationship.form.component.d.ts.map +1 -0
  183. package/dist/lib/generated/Entities/mjBizAppsCommonRelationship/mjbizappscommonrelationship.form.component.js +91 -0
  184. package/dist/lib/generated/Entities/mjBizAppsCommonRelationship/mjbizappscommonrelationship.form.component.js.map +1 -0
  185. package/dist/lib/generated/Entities/mjBizAppsCommonRelationshipType/mjbizappscommonrelationshiptype.form.component.d.ts +10 -0
  186. package/dist/lib/generated/Entities/mjBizAppsCommonRelationshipType/mjbizappscommonrelationshiptype.form.component.d.ts.map +1 -0
  187. package/dist/lib/generated/Entities/mjBizAppsCommonRelationshipType/mjbizappscommonrelationshiptype.form.component.js +100 -0
  188. package/dist/lib/generated/Entities/mjBizAppsCommonRelationshipType/mjbizappscommonrelationshiptype.form.component.js.map +1 -0
  189. package/dist/lib/generated/Entities/mjBizAppsFormsForm/mjbizappsformsform.form.component.d.ts +10 -0
  190. package/dist/lib/generated/Entities/mjBizAppsFormsForm/mjbizappsformsform.form.component.d.ts.map +1 -0
  191. package/dist/lib/generated/Entities/mjBizAppsFormsForm/mjbizappsformsform.form.component.js +174 -0
  192. package/dist/lib/generated/Entities/mjBizAppsFormsForm/mjbizappsformsform.form.component.js.map +1 -0
  193. package/dist/lib/generated/Entities/mjBizAppsFormsFormCategory/mjbizappsformsformcategory.form.component.d.ts +10 -0
  194. package/dist/lib/generated/Entities/mjBizAppsFormsFormCategory/mjbizappsformsformcategory.form.component.d.ts.map +1 -0
  195. package/dist/lib/generated/Entities/mjBizAppsFormsFormCategory/mjbizappsformsformcategory.form.component.js +118 -0
  196. package/dist/lib/generated/Entities/mjBizAppsFormsFormCategory/mjbizappsformsformcategory.form.component.js.map +1 -0
  197. package/dist/lib/generated/Entities/mjBizAppsFormsFormDistribution/mjbizappsformsformdistribution.form.component.d.ts +10 -0
  198. package/dist/lib/generated/Entities/mjBizAppsFormsFormDistribution/mjbizappsformsformdistribution.form.component.d.ts.map +1 -0
  199. package/dist/lib/generated/Entities/mjBizAppsFormsFormDistribution/mjbizappsformsformdistribution.form.component.js +93 -0
  200. package/dist/lib/generated/Entities/mjBizAppsFormsFormDistribution/mjbizappsformsformdistribution.form.component.js.map +1 -0
  201. package/dist/lib/generated/Entities/mjBizAppsFormsFormPage/mjbizappsformsformpage.form.component.d.ts +10 -0
  202. package/dist/lib/generated/Entities/mjBizAppsFormsFormPage/mjbizappsformsformpage.form.component.d.ts.map +1 -0
  203. package/dist/lib/generated/Entities/mjBizAppsFormsFormPage/mjbizappsformsformpage.form.component.js +96 -0
  204. package/dist/lib/generated/Entities/mjBizAppsFormsFormPage/mjbizappsformsformpage.form.component.js.map +1 -0
  205. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestion/mjbizappsformsformquestion.form.component.d.ts +10 -0
  206. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestion/mjbizappsformsformquestion.form.component.d.ts.map +1 -0
  207. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestion/mjbizappsformsformquestion.form.component.js +132 -0
  208. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestion/mjbizappsformsformquestion.form.component.js.map +1 -0
  209. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestionOption/mjbizappsformsformquestionoption.form.component.d.ts +10 -0
  210. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestionOption/mjbizappsformsformquestionoption.form.component.d.ts.map +1 -0
  211. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestionOption/mjbizappsformsformquestionoption.form.component.js +77 -0
  212. package/dist/lib/generated/Entities/mjBizAppsFormsFormQuestionOption/mjbizappsformsformquestionoption.form.component.js.map +1 -0
  213. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponse/mjbizappsformsformresponse.form.component.d.ts +10 -0
  214. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponse/mjbizappsformsformresponse.form.component.d.ts.map +1 -0
  215. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponse/mjbizappsformsformresponse.form.component.js +108 -0
  216. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponse/mjbizappsformsformresponse.form.component.js.map +1 -0
  217. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponseAnswer/mjbizappsformsformresponseanswer.form.component.d.ts +10 -0
  218. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponseAnswer/mjbizappsformsformresponseanswer.form.component.d.ts.map +1 -0
  219. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponseAnswer/mjbizappsformsformresponseanswer.form.component.js +99 -0
  220. package/dist/lib/generated/Entities/mjBizAppsFormsFormResponseAnswer/mjbizappsformsformresponseanswer.form.component.js.map +1 -0
  221. package/dist/lib/generated/Entities/mjBizAppsFormsFormStyle/mjbizappsformsformstyle.form.component.d.ts +10 -0
  222. package/dist/lib/generated/Entities/mjBizAppsFormsFormStyle/mjbizappsformsformstyle.form.component.d.ts.map +1 -0
  223. package/dist/lib/generated/Entities/mjBizAppsFormsFormStyle/mjbizappsformsformstyle.form.component.js +100 -0
  224. package/dist/lib/generated/Entities/mjBizAppsFormsFormStyle/mjbizappsformsformstyle.form.component.js.map +1 -0
  225. package/dist/lib/generated/Entities/mjBizAppsFormsFormVersion/mjbizappsformsformversion.form.component.d.ts +10 -0
  226. package/dist/lib/generated/Entities/mjBizAppsFormsFormVersion/mjbizappsformsformversion.form.component.d.ts.map +1 -0
  227. package/dist/lib/generated/Entities/mjBizAppsFormsFormVersion/mjbizappsformsformversion.form.component.js +96 -0
  228. package/dist/lib/generated/Entities/mjBizAppsFormsFormVersion/mjbizappsformsformversion.form.component.js.map +1 -0
  229. package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.d.ts +10 -0
  230. package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.d.ts.map +1 -0
  231. package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.js +274 -0
  232. package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.js.map +1 -0
  233. package/dist/lib/generated/Entities/mjBizAppsTasksTaskActivity/mjbizappstaskstaskactivity.form.component.d.ts +10 -0
  234. package/dist/lib/generated/Entities/mjBizAppsTasksTaskActivity/mjbizappstaskstaskactivity.form.component.d.ts.map +1 -0
  235. package/dist/lib/generated/Entities/mjBizAppsTasksTaskActivity/mjbizappstaskstaskactivity.form.component.js +67 -0
  236. package/dist/lib/generated/Entities/mjBizAppsTasksTaskActivity/mjbizappstaskstaskactivity.form.component.js.map +1 -0
  237. package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.d.ts +10 -0
  238. package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.d.ts.map +1 -0
  239. package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.js +90 -0
  240. package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.js.map +1 -0
  241. package/dist/lib/generated/Entities/mjBizAppsTasksTaskCategory/mjbizappstaskstaskcategory.form.component.d.ts +10 -0
  242. package/dist/lib/generated/Entities/mjBizAppsTasksTaskCategory/mjbizappstaskstaskcategory.form.component.d.ts.map +1 -0
  243. package/dist/lib/generated/Entities/mjBizAppsTasksTaskCategory/mjbizappstaskstaskcategory.form.component.js +124 -0
  244. package/dist/lib/generated/Entities/mjBizAppsTasksTaskCategory/mjbizappstaskstaskcategory.form.component.js.map +1 -0
  245. package/dist/lib/generated/Entities/mjBizAppsTasksTaskComment/mjbizappstaskstaskcomment.form.component.d.ts +10 -0
  246. package/dist/lib/generated/Entities/mjBizAppsTasksTaskComment/mjbizappstaskstaskcomment.form.component.d.ts.map +1 -0
  247. package/dist/lib/generated/Entities/mjBizAppsTasksTaskComment/mjbizappstaskstaskcomment.form.component.js +86 -0
  248. package/dist/lib/generated/Entities/mjBizAppsTasksTaskComment/mjbizappstaskstaskcomment.form.component.js.map +1 -0
  249. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.d.ts +10 -0
  250. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.d.ts.map +1 -0
  251. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.js +67 -0
  252. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.js.map +1 -0
  253. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.d.ts +10 -0
  254. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.d.ts.map +1 -0
  255. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.js +86 -0
  256. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.js.map +1 -0
  257. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDependency/mjbizappstaskstaskdependency.form.component.d.ts +10 -0
  258. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDependency/mjbizappstaskstaskdependency.form.component.d.ts.map +1 -0
  259. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDependency/mjbizappstaskstaskdependency.form.component.js +61 -0
  260. package/dist/lib/generated/Entities/mjBizAppsTasksTaskDependency/mjbizappstaskstaskdependency.form.component.js.map +1 -0
  261. package/dist/lib/generated/Entities/mjBizAppsTasksTaskLink/mjbizappstaskstasklink.form.component.d.ts +10 -0
  262. package/dist/lib/generated/Entities/mjBizAppsTasksTaskLink/mjbizappstaskstasklink.form.component.d.ts.map +1 -0
  263. package/dist/lib/generated/Entities/mjBizAppsTasksTaskLink/mjbizappstaskstasklink.form.component.js +63 -0
  264. package/dist/lib/generated/Entities/mjBizAppsTasksTaskLink/mjbizappstaskstasklink.form.component.js.map +1 -0
  265. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationConfig/mjbizappstaskstasknotificationconfig.form.component.d.ts +10 -0
  266. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationConfig/mjbizappstaskstasknotificationconfig.form.component.d.ts.map +1 -0
  267. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationConfig/mjbizappstaskstasknotificationconfig.form.component.js +69 -0
  268. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationConfig/mjbizappstaskstasknotificationconfig.form.component.js.map +1 -0
  269. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationLog/mjbizappstaskstasknotificationlog.form.component.d.ts +10 -0
  270. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationLog/mjbizappstaskstasknotificationlog.form.component.d.ts.map +1 -0
  271. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationLog/mjbizappstaskstasknotificationlog.form.component.js +63 -0
  272. package/dist/lib/generated/Entities/mjBizAppsTasksTaskNotificationLog/mjbizappstaskstasknotificationlog.form.component.js.map +1 -0
  273. package/dist/lib/generated/Entities/mjBizAppsTasksTaskRole/mjbizappstaskstaskrole.form.component.d.ts +10 -0
  274. package/dist/lib/generated/Entities/mjBizAppsTasksTaskRole/mjbizappstaskstaskrole.form.component.d.ts.map +1 -0
  275. package/dist/lib/generated/Entities/mjBizAppsTasksTaskRole/mjbizappstaskstaskrole.form.component.js +98 -0
  276. package/dist/lib/generated/Entities/mjBizAppsTasksTaskRole/mjbizappstaskstaskrole.form.component.js.map +1 -0
  277. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTag/mjbizappstaskstasktag.form.component.d.ts +10 -0
  278. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTag/mjbizappstaskstasktag.form.component.d.ts.map +1 -0
  279. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTag/mjbizappstaskstasktag.form.component.js +80 -0
  280. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTag/mjbizappstaskstasktag.form.component.js.map +1 -0
  281. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTagLink/mjbizappstaskstasktaglink.form.component.d.ts +10 -0
  282. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTagLink/mjbizappstaskstasktaglink.form.component.d.ts.map +1 -0
  283. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTagLink/mjbizappstaskstasktaglink.form.component.js +59 -0
  284. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTagLink/mjbizappstaskstasktaglink.form.component.js.map +1 -0
  285. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplate/mjbizappstaskstasktemplate.form.component.d.ts +10 -0
  286. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplate/mjbizappstaskstasktemplate.form.component.d.ts.map +1 -0
  287. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplate/mjbizappstaskstasktemplate.form.component.js +84 -0
  288. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplate/mjbizappstaskstasktemplate.form.component.js.map +1 -0
  289. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItem/mjbizappstaskstasktemplateitem.form.component.d.ts +10 -0
  290. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItem/mjbizappstaskstasktemplateitem.form.component.d.ts.map +1 -0
  291. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItem/mjbizappstaskstasktemplateitem.form.component.js +146 -0
  292. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItem/mjbizappstaskstasktemplateitem.form.component.js.map +1 -0
  293. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemDependency/mjbizappstaskstasktemplateitemdependency.form.component.d.ts +10 -0
  294. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemDependency/mjbizappstaskstasktemplateitemdependency.form.component.d.ts.map +1 -0
  295. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemDependency/mjbizappstaskstasktemplateitemdependency.form.component.js +61 -0
  296. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemDependency/mjbizappstaskstasktemplateitemdependency.form.component.js.map +1 -0
  297. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemRole/mjbizappstaskstasktemplateitemrole.form.component.d.ts +10 -0
  298. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemRole/mjbizappstaskstasktemplateitemrole.form.component.d.ts.map +1 -0
  299. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemRole/mjbizappstaskstasktemplateitemrole.form.component.js +59 -0
  300. package/dist/lib/generated/Entities/mjBizAppsTasksTaskTemplateItemRole/mjbizappstaskstasktemplateitemrole.form.component.js.map +1 -0
  301. package/dist/lib/generated/Entities/mjBizAppsTasksTaskType/mjbizappstaskstasktype.form.component.d.ts +10 -0
  302. package/dist/lib/generated/Entities/mjBizAppsTasksTaskType/mjbizappstaskstasktype.form.component.d.ts.map +1 -0
  303. package/dist/lib/generated/Entities/mjBizAppsTasksTaskType/mjbizappstaskstasktype.form.component.js +132 -0
  304. package/dist/lib/generated/Entities/mjBizAppsTasksTaskType/mjbizappstaskstasktype.form.component.js.map +1 -0
  305. package/dist/lib/generated/class-registrations-manifest.d.ts +6 -0
  306. package/dist/lib/generated/class-registrations-manifest.d.ts.map +1 -0
  307. package/dist/lib/generated/class-registrations-manifest.js +6 -0
  308. package/dist/lib/generated/class-registrations-manifest.js.map +1 -0
  309. package/dist/lib/generated/generated-forms.module.d.ts +61 -0
  310. package/dist/lib/generated/generated-forms.module.d.ts.map +1 -0
  311. package/dist/lib/generated/generated-forms.module.js +207 -0
  312. package/dist/lib/generated/generated-forms.module.js.map +1 -0
  313. package/dist/lib/home/forms-home-dashboard.component.d.ts +61 -0
  314. package/dist/lib/home/forms-home-dashboard.component.d.ts.map +1 -0
  315. package/dist/lib/home/forms-home-dashboard.component.js +379 -0
  316. package/dist/lib/home/forms-home-dashboard.component.js.map +1 -0
  317. package/dist/lib/home/forms-home.service.d.ts +24 -0
  318. package/dist/lib/home/forms-home.service.d.ts.map +1 -0
  319. package/dist/lib/home/forms-home.service.js +92 -0
  320. package/dist/lib/home/forms-home.service.js.map +1 -0
  321. package/dist/lib/home/home-aggregations.d.ts +23 -0
  322. package/dist/lib/home/home-aggregations.d.ts.map +1 -0
  323. package/dist/lib/home/home-aggregations.js +64 -0
  324. package/dist/lib/home/home-aggregations.js.map +1 -0
  325. package/dist/lib/home/home-models.d.ts +60 -0
  326. package/dist/lib/home/home-models.d.ts.map +1 -0
  327. package/dist/lib/home/home-models.js +34 -0
  328. package/dist/lib/home/home-models.js.map +1 -0
  329. package/dist/lib/home/index.d.ts +13 -0
  330. package/dist/lib/home/index.d.ts.map +1 -0
  331. package/dist/lib/home/index.js +13 -0
  332. package/dist/lib/home/index.js.map +1 -0
  333. package/dist/lib/widget/api/form-upload.service.d.ts +41 -0
  334. package/dist/lib/widget/api/form-upload.service.d.ts.map +1 -0
  335. package/dist/lib/widget/api/form-upload.service.js +124 -0
  336. package/dist/lib/widget/api/form-upload.service.js.map +1 -0
  337. package/dist/lib/widget/api/forms-api.config.d.ts +55 -0
  338. package/dist/lib/widget/api/forms-api.config.d.ts.map +1 -0
  339. package/dist/lib/widget/api/forms-api.config.js +40 -0
  340. package/dist/lib/widget/api/forms-api.config.js.map +1 -0
  341. package/dist/lib/widget/api/forms-api.graphql.service.d.ts +20 -0
  342. package/dist/lib/widget/api/forms-api.graphql.service.d.ts.map +1 -0
  343. package/dist/lib/widget/api/forms-api.graphql.service.js +96 -0
  344. package/dist/lib/widget/api/forms-api.graphql.service.js.map +1 -0
  345. package/dist/lib/widget/api/forms-api.interface.d.ts +45 -0
  346. package/dist/lib/widget/api/forms-api.interface.d.ts.map +1 -0
  347. package/dist/lib/widget/api/forms-api.interface.js +8 -0
  348. package/dist/lib/widget/api/forms-api.interface.js.map +1 -0
  349. package/dist/lib/widget/api/forms-api.mock.service.d.ts +12 -0
  350. package/dist/lib/widget/api/forms-api.mock.service.d.ts.map +1 -0
  351. package/dist/lib/widget/api/forms-api.mock.service.js +41 -0
  352. package/dist/lib/widget/api/forms-api.mock.service.js.map +1 -0
  353. package/dist/lib/widget/api/mock-form.data.d.ts +8 -0
  354. package/dist/lib/widget/api/mock-form.data.d.ts.map +1 -0
  355. package/dist/lib/widget/api/mock-form.data.js +192 -0
  356. package/dist/lib/widget/api/mock-form.data.js.map +1 -0
  357. package/dist/lib/widget/api/submission-mapping.d.ts +60 -0
  358. package/dist/lib/widget/api/submission-mapping.d.ts.map +1 -0
  359. package/dist/lib/widget/api/submission-mapping.js +47 -0
  360. package/dist/lib/widget/api/submission-mapping.js.map +1 -0
  361. package/dist/lib/widget/components/form-one-question.component.d.ts +43 -0
  362. package/dist/lib/widget/components/form-one-question.component.d.ts.map +1 -0
  363. package/dist/lib/widget/components/form-one-question.component.js +194 -0
  364. package/dist/lib/widget/components/form-one-question.component.js.map +1 -0
  365. package/dist/lib/widget/components/form-progress.component.d.ts +9 -0
  366. package/dist/lib/widget/components/form-progress.component.d.ts.map +1 -0
  367. package/dist/lib/widget/components/form-progress.component.js +47 -0
  368. package/dist/lib/widget/components/form-progress.component.js.map +1 -0
  369. package/dist/lib/widget/components/form-scroll.component.d.ts +23 -0
  370. package/dist/lib/widget/components/form-scroll.component.d.ts.map +1 -0
  371. package/dist/lib/widget/components/form-scroll.component.js +132 -0
  372. package/dist/lib/widget/components/form-scroll.component.js.map +1 -0
  373. package/dist/lib/widget/components/questions/form-question.component.d.ts +68 -0
  374. package/dist/lib/widget/components/questions/form-question.component.d.ts.map +1 -0
  375. package/dist/lib/widget/components/questions/form-question.component.js +541 -0
  376. package/dist/lib/widget/components/questions/form-question.component.js.map +1 -0
  377. package/dist/lib/widget/components/questions/input-mode.d.ts +13 -0
  378. package/dist/lib/widget/components/questions/input-mode.d.ts.map +1 -0
  379. package/dist/lib/widget/components/questions/input-mode.js +42 -0
  380. package/dist/lib/widget/components/questions/input-mode.js.map +1 -0
  381. package/dist/lib/widget/components/turnstile-challenge.component.d.ts +52 -0
  382. package/dist/lib/widget/components/turnstile-challenge.component.d.ts.map +1 -0
  383. package/dist/lib/widget/components/turnstile-challenge.component.js +123 -0
  384. package/dist/lib/widget/components/turnstile-challenge.component.js.map +1 -0
  385. package/dist/lib/widget/core/answer-value.d.ts +17 -0
  386. package/dist/lib/widget/core/answer-value.d.ts.map +1 -0
  387. package/dist/lib/widget/core/answer-value.js +41 -0
  388. package/dist/lib/widget/core/answer-value.js.map +1 -0
  389. package/dist/lib/widget/core/autosave-controller.d.ts +65 -0
  390. package/dist/lib/widget/core/autosave-controller.d.ts.map +1 -0
  391. package/dist/lib/widget/core/autosave-controller.js +134 -0
  392. package/dist/lib/widget/core/autosave-controller.js.map +1 -0
  393. package/dist/lib/widget/core/client-id.d.ts +17 -0
  394. package/dist/lib/widget/core/client-id.d.ts.map +1 -0
  395. package/dist/lib/widget/core/client-id.js +52 -0
  396. package/dist/lib/widget/core/client-id.js.map +1 -0
  397. package/dist/lib/widget/core/form-runtime.d.ts +34 -0
  398. package/dist/lib/widget/core/form-runtime.d.ts.map +1 -0
  399. package/dist/lib/widget/core/form-runtime.js +123 -0
  400. package/dist/lib/widget/core/form-runtime.js.map +1 -0
  401. package/dist/lib/widget/core/one-question-stepper.d.ts +20 -0
  402. package/dist/lib/widget/core/one-question-stepper.d.ts.map +1 -0
  403. package/dist/lib/widget/core/one-question-stepper.js +23 -0
  404. package/dist/lib/widget/core/one-question-stepper.js.map +1 -0
  405. package/dist/lib/widget/core/submit-phase.d.ts +31 -0
  406. package/dist/lib/widget/core/submit-phase.d.ts.map +1 -0
  407. package/dist/lib/widget/core/submit-phase.js +21 -0
  408. package/dist/lib/widget/core/submit-phase.js.map +1 -0
  409. package/dist/lib/widget/core/theming.d.ts +17 -0
  410. package/dist/lib/widget/core/theming.d.ts.map +1 -0
  411. package/dist/lib/widget/core/theming.js +36 -0
  412. package/dist/lib/widget/core/theming.js.map +1 -0
  413. package/dist/lib/widget/core/turnstile-gate.d.ts +42 -0
  414. package/dist/lib/widget/core/turnstile-gate.d.ts.map +1 -0
  415. package/dist/lib/widget/core/turnstile-gate.js +61 -0
  416. package/dist/lib/widget/core/turnstile-gate.js.map +1 -0
  417. package/dist/lib/widget/core/turnstile-loader.d.ts +34 -0
  418. package/dist/lib/widget/core/turnstile-loader.d.ts.map +1 -0
  419. package/dist/lib/widget/core/turnstile-loader.js +68 -0
  420. package/dist/lib/widget/core/turnstile-loader.js.map +1 -0
  421. package/dist/lib/widget/core/validation.d.ts +19 -0
  422. package/dist/lib/widget/core/validation.d.ts.map +1 -0
  423. package/dist/lib/widget/core/validation.js +105 -0
  424. package/dist/lib/widget/core/validation.js.map +1 -0
  425. package/dist/lib/widget/index.d.ts +27 -0
  426. package/dist/lib/widget/index.d.ts.map +1 -0
  427. package/dist/lib/widget/index.js +30 -0
  428. package/dist/lib/widget/index.js.map +1 -0
  429. package/dist/lib/widget/mj-form.component.d.ts +114 -0
  430. package/dist/lib/widget/mj-form.component.d.ts.map +1 -0
  431. package/dist/lib/widget/mj-form.component.js +428 -0
  432. package/dist/lib/widget/mj-form.component.js.map +1 -0
  433. package/dist/lib/widget/register-element.d.ts +8 -0
  434. package/dist/lib/widget/register-element.d.ts.map +1 -0
  435. package/dist/lib/widget/register-element.js +98 -0
  436. package/dist/lib/widget/register-element.js.map +1 -0
  437. package/dist/public-api.d.ts +23 -0
  438. package/dist/public-api.d.ts.map +1 -0
  439. package/dist/public-api.js +33 -0
  440. package/dist/public-api.js.map +1 -0
  441. package/dist/widget-entry.d.ts +2 -0
  442. package/dist/widget-entry.d.ts.map +1 -0
  443. package/dist/widget-entry.js +20 -0
  444. package/dist/widget-entry.js.map +1 -0
  445. package/package.json +53 -5
  446. package/README.md +0 -3
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Headless runtime shared by both render modes. Holds the live answer map as a signal,
3
+ * derives per-question/per-page visibility from the conditional rules (S2), tracks
4
+ * validation + touched state, and computes the progress signal. Components read its
5
+ * signals and call its mutators; it owns no DOM and no transport.
6
+ */
7
+ import { computed, signal } from '@angular/core';
8
+ import { evaluateConditionalRule, } from '@mj-biz-apps/forms-entities';
9
+ import { toAnswerInputs } from './answer-value';
10
+ import { validateQuestion } from './validation';
11
+ export class FormRuntime {
12
+ definition;
13
+ answers = signal(new Map(), ...(ngDevMode ? [{ debugName: "answers" }] : []));
14
+ touched = signal(new Set(), ...(ngDevMode ? [{ debugName: "touched" }] : []));
15
+ constructor(definition) {
16
+ this.definition = definition;
17
+ }
18
+ // --- Answer access -------------------------------------------------------
19
+ answerMap = this.answers.asReadonly();
20
+ valueFor(questionId) {
21
+ return this.answers().get(questionId);
22
+ }
23
+ setValue(questionId, value) {
24
+ const next = new Map(this.answers());
25
+ if (value === null || value === undefined) {
26
+ next.delete(questionId);
27
+ }
28
+ else {
29
+ next.set(questionId, value);
30
+ }
31
+ this.answers.set(next);
32
+ }
33
+ markTouched(questionId) {
34
+ if (this.touched().has(questionId)) {
35
+ return;
36
+ }
37
+ const next = new Set(this.touched());
38
+ next.add(questionId);
39
+ this.touched.set(next);
40
+ }
41
+ isTouched(questionId) {
42
+ return this.touched().has(questionId);
43
+ }
44
+ // --- Visibility (conditional rules, S2) ---------------------------------
45
+ /** Pages whose page-level rule passes given current answers. */
46
+ visiblePages = computed(() => {
47
+ const map = this.answers();
48
+ return this.orderedPages().filter((p) => evaluateConditionalRule(p.conditionalRule, map));
49
+ }, ...(ngDevMode ? [{ debugName: "visiblePages" }] : []));
50
+ /** Visible questions on a given page (page must itself be visible to matter). */
51
+ visibleQuestions(page) {
52
+ const map = this.answers();
53
+ return [...page.questions]
54
+ .sort((a, b) => a.displayOrder - b.displayOrder)
55
+ .filter((q) => evaluateConditionalRule(q.conditionalRule, map));
56
+ }
57
+ /** Every visible, non-statement question across the form, in document order. */
58
+ visibleAnswerableQuestions = computed(() => {
59
+ const out = [];
60
+ for (const page of this.visiblePages()) {
61
+ for (const q of this.visibleQuestions(page)) {
62
+ if (q.type !== 'Statement') {
63
+ out.push(q);
64
+ }
65
+ }
66
+ }
67
+ return out;
68
+ }, ...(ngDevMode ? [{ debugName: "visibleAnswerableQuestions" }] : []));
69
+ // --- Validation ----------------------------------------------------------
70
+ /** Validation message for a question, or `null` when valid. */
71
+ errorFor(question) {
72
+ return validateQuestion(question, this.valueFor(question.id)).message;
73
+ }
74
+ /** Error shown in the UI only after the field has been touched. */
75
+ visibleErrorFor(question) {
76
+ return this.isTouched(question.id) ? this.errorFor(question) : null;
77
+ }
78
+ /** True when every supplied list of questions currently validates. */
79
+ areValid(questions) {
80
+ return questions.every((q) => validateQuestion(q, this.valueFor(q.id)).valid);
81
+ }
82
+ /** Mark a set of questions touched (e.g. on a failed next/submit) to surface errors. */
83
+ touchAll(questions) {
84
+ const next = new Set(this.touched());
85
+ for (const q of questions) {
86
+ next.add(q.id);
87
+ }
88
+ this.touched.set(next);
89
+ }
90
+ /** Whole-form validity over all currently-visible answerable questions. */
91
+ isFormValid = computed(() => this.visibleAnswerableQuestions().every((q) => validateQuestion(q, this.valueFor(q.id)).valid), ...(ngDevMode ? [{ debugName: "isFormValid" }] : []));
92
+ // --- Progress ------------------------------------------------------------
93
+ /** Fraction 0–1 of visible answerable questions that have a value. */
94
+ progress = computed(() => {
95
+ const qs = this.visibleAnswerableQuestions();
96
+ if (qs.length === 0) {
97
+ return 1;
98
+ }
99
+ const answered = qs.filter((q) => hasAnswer(this.valueFor(q.id))).length;
100
+ return answered / qs.length;
101
+ }, ...(ngDevMode ? [{ debugName: "progress" }] : []));
102
+ // --- Submission ----------------------------------------------------------
103
+ /** Build the wire answers for all currently-visible answerable questions. */
104
+ buildAnswerInputs() {
105
+ return toAnswerInputs(this.visibleAnswerableQuestions(), this.answers());
106
+ }
107
+ orderedPages() {
108
+ return [...this.definition.pages].sort((a, b) => a.displayOrder - b.displayOrder);
109
+ }
110
+ }
111
+ function hasAnswer(value) {
112
+ if (value === null || value === undefined) {
113
+ return false;
114
+ }
115
+ if (typeof value === 'string') {
116
+ return value.trim().length > 0;
117
+ }
118
+ if (Array.isArray(value)) {
119
+ return value.length > 0;
120
+ }
121
+ return true;
122
+ }
123
+ //# sourceMappingURL=form-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-runtime.js","sourceRoot":"","sources":["../../../../src/lib/widget/core/form-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,uBAAuB,GAMxB,MA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free cursor math for the OneQuestion (Typeform-style) render mode.
3
+ *
4
+ * The OneQuestion component shows one visible answerable question at a time. The list of
5
+ * visible questions changes live as conditional rules fire, so the cursor must never point
6
+ * past the last visible question — and, critically, must be *written back* when the path
7
+ * shrinks, so it does not "jump ahead" once the path grows again. The component owns the
8
+ * reactive cursor (an Angular signal) and routes every write through {@link clampCursor};
9
+ * keeping the clamp here (one tested function, one source of truth) is what makes that
10
+ * guarantee testable without Angular.
11
+ */
12
+ /**
13
+ * Clamp a cursor to the valid `[0, max(0, total-1)]` range.
14
+ *
15
+ * @param value the desired cursor position (may be out of range / negative)
16
+ * @param total the number of visible steps
17
+ * @returns the in-range cursor; `0` when there are no steps
18
+ */
19
+ export declare function clampCursor(value: number, total: number): number;
20
+ //# sourceMappingURL=one-question-stepper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-question-stepper.d.ts","sourceRoot":"","sources":["../../../../src/lib/widget/core/one-question-stepper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhE"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Pure, framework-free cursor math for the OneQuestion (Typeform-style) render mode.
3
+ *
4
+ * The OneQuestion component shows one visible answerable question at a time. The list of
5
+ * visible questions changes live as conditional rules fire, so the cursor must never point
6
+ * past the last visible question — and, critically, must be *written back* when the path
7
+ * shrinks, so it does not "jump ahead" once the path grows again. The component owns the
8
+ * reactive cursor (an Angular signal) and routes every write through {@link clampCursor};
9
+ * keeping the clamp here (one tested function, one source of truth) is what makes that
10
+ * guarantee testable without Angular.
11
+ */
12
+ /**
13
+ * Clamp a cursor to the valid `[0, max(0, total-1)]` range.
14
+ *
15
+ * @param value the desired cursor position (may be out of range / negative)
16
+ * @param total the number of visible steps
17
+ * @returns the in-range cursor; `0` when there are no steps
18
+ */
19
+ export function clampCursor(value, total) {
20
+ const max = Math.max(0, total - 1);
21
+ return Math.min(Math.max(0, value), max);
22
+ }
23
+ //# sourceMappingURL=one-question-stepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-question-stepper.js","sourceRoot":"","sources":["../../../../src/lib/widget/core/one-question-stepper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,KAAa;IACtD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Pure phase-transition helpers for the respondent widget's submit lifecycle.
3
+ *
4
+ * Framework-free (no Angular, no signals) so the state machine that decides "did this submit
5
+ * reach the confirmation screen?" is unit-testable in isolation — the component just wires
6
+ * these to its `phase` signal. This is the guard layer that closes the "success but no
7
+ * thank-you screen" and "double-submit" bugs.
8
+ */
9
+ import type { FormSubmissionResult } from '@mj-biz-apps/forms-entities';
10
+ /** Lifecycle phase of the widget. Mirrors the component's `WidgetPhase`. */
11
+ export type WidgetPhase = 'loading' | 'ready' | 'submitting' | 'done' | 'error';
12
+ /**
13
+ * Whether a submit attempt should be IGNORED as re-entrant. A submit is ignored while one is
14
+ * already in flight ('submitting') or the widget has already confirmed ('done') — the
15
+ * double-submit guard. From any other phase the submit proceeds.
16
+ */
17
+ export declare function shouldIgnoreSubmit(phase: WidgetPhase): boolean;
18
+ /** The phase a submit result maps to, plus whether the widget should redirect. */
19
+ export interface SubmitOutcome {
20
+ phase: WidgetPhase;
21
+ /** True only when a redirect URL is present on a successful result. */
22
+ redirect: boolean;
23
+ }
24
+ /**
25
+ * Decide the phase (and redirect intent) for a submit RESULT. On success the widget ALWAYS
26
+ * reaches 'done' — for both render modes and whether or not a redirect URL is set (a redirect
27
+ * still shows 'done' first, so a blocked/slow navigation never leaves a blank screen). On
28
+ * failure it returns to 'ready' so the respondent can fix + retry.
29
+ */
30
+ export declare function outcomeForResult(result: FormSubmissionResult): SubmitOutcome;
31
+ //# sourceMappingURL=submit-phase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submit-phase.d.ts","sourceRoot":"","sources":["../../../../src/lib/widget/core/submit-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9D;AAED,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,aAAa,CAK5E"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Whether a submit attempt should be IGNORED as re-entrant. A submit is ignored while one is
3
+ * already in flight ('submitting') or the widget has already confirmed ('done') — the
4
+ * double-submit guard. From any other phase the submit proceeds.
5
+ */
6
+ export function shouldIgnoreSubmit(phase) {
7
+ return phase === 'submitting' || phase === 'done';
8
+ }
9
+ /**
10
+ * Decide the phase (and redirect intent) for a submit RESULT. On success the widget ALWAYS
11
+ * reaches 'done' — for both render modes and whether or not a redirect URL is set (a redirect
12
+ * still shows 'done' first, so a blocked/slow navigation never leaves a blank screen). On
13
+ * failure it returns to 'ready' so the respondent can fix + retry.
14
+ */
15
+ export function outcomeForResult(result) {
16
+ if (!result.success) {
17
+ return { phase: 'ready', redirect: false };
18
+ }
19
+ return { phase: 'done', redirect: Boolean(result.redirectUrl) };
20
+ }
21
+ //# sourceMappingURL=submit-phase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submit-phase.js","sourceRoot":"","sources":["../../../../src/lib/widget/core/submit-phase.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAkB;IACnD,OAAO,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM,CAAC;AACpD,CAAC;AASD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA4B;IAC3D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;AAClE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Apply a published form's {@link FormStyleTokens} as CSS custom properties on the
3
+ * widget host element. This is the ONLY place colors enter the widget: every
4
+ * component styles itself with `--mjf-*` / `--mj-*` tokens, so a form is re-themed
5
+ * purely by the `cssVariables` map the builder captured at publish time. No hardcoded
6
+ * colors anywhere downstream.
7
+ */
8
+ import type { FormStyleTokens } from '@mj-biz-apps/forms-entities';
9
+ /**
10
+ * Set each `--token: value` from `styleTokens.cssVariables` on `host.style`, inject
11
+ * optional `customCSS` into a scoped `<style>` inside the host, and expose `logoURL`
12
+ * as the `--mjf-logo-url` token. Token names are passed through verbatim; only
13
+ * `--`-prefixed custom properties are accepted (defensive — never lets a raw color in
14
+ * under a non-custom-property name).
15
+ */
16
+ export declare function applyStyleTokens(host: HTMLElement, tokens: FormStyleTokens | undefined): void;
17
+ //# sourceMappingURL=theming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../src/lib/widget/core/theming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAe7F"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Set each `--token: value` from `styleTokens.cssVariables` on `host.style`, inject
3
+ * optional `customCSS` into a scoped `<style>` inside the host, and expose `logoURL`
4
+ * as the `--mjf-logo-url` token. Token names are passed through verbatim; only
5
+ * `--`-prefixed custom properties are accepted (defensive — never lets a raw color in
6
+ * under a non-custom-property name).
7
+ */
8
+ export function applyStyleTokens(host, tokens) {
9
+ if (!tokens) {
10
+ return;
11
+ }
12
+ for (const [name, value] of Object.entries(tokens.cssVariables ?? {})) {
13
+ if (name.startsWith('--')) {
14
+ host.style.setProperty(name, value);
15
+ }
16
+ }
17
+ if (tokens.logoURL) {
18
+ host.style.setProperty('--mjf-logo-url', `url("${tokens.logoURL}")`);
19
+ }
20
+ if (tokens.customCSS) {
21
+ applyCustomCss(host, tokens.customCSS);
22
+ }
23
+ }
24
+ /** Inject form-author custom CSS once, inside the host so it stays scoped to the widget. */
25
+ function applyCustomCss(host, css) {
26
+ const existing = host.querySelector('style[data-mjf-custom]');
27
+ if (existing) {
28
+ existing.textContent = css;
29
+ return;
30
+ }
31
+ const style = host.ownerDocument.createElement('style');
32
+ style.setAttribute('data-mjf-custom', '');
33
+ style.textContent = css;
34
+ host.appendChild(style);
35
+ }
36
+ //# sourceMappingURL=theming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theming.js","sourceRoot":"","sources":["../../../../src/lib/widget/core/theming.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAiB,EAAE,MAAmC;IACrF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;QACtE,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,gBAAgB,EAAE,QAAQ,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;IACvE,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,4FAA4F;AAC5F,SAAS,cAAc,CAAC,IAAiB,EAAE,GAAW;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;IAC9D,IAAI,QAAQ,EAAE,CAAC;QACb,QAAQ,CAAC,WAAW,GAAG,GAAG,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACxD,KAAK,CAAC,YAAY,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAC1C,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;IACxB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Pure, Angular-free helpers for the client-side Cloudflare Turnstile gate (DG-4).
3
+ *
4
+ * Captcha is a per-form / per-distribution toggle: the published definition carries
5
+ * `settings.captchaRequired`, and the server is fail-closed. The widget mirrors that
6
+ * decision here — deciding whether to render a challenge, whether the config is complete
7
+ * enough to render one, whether a final submit may proceed, and whether a failed
8
+ * submit's error came from Turnstile (so the challenge can be reset for a retry).
9
+ *
10
+ * These functions are deliberately free of Angular/DOM so they can be unit-tested
11
+ * without a browser or the Turnstile global (the package's Vitest suite is node-only).
12
+ */
13
+ import type { PublishedFormDefinition } from '@mj-biz-apps/forms-entities';
14
+ /** Server-side Turnstile error codes surfaced to the client (see Server/turnstile.service.ts). */
15
+ export declare const TURNSTILE_ERROR_CODES: readonly ["missing-token", "turnstile-not-configured", "verification-failed", "turnstile-unreachable", "invalid-input-response", "timeout-or-duplicate"];
16
+ /** Does this published form require a captcha challenge before submit? */
17
+ export declare function captchaRequired(def: PublishedFormDefinition | null): boolean;
18
+ /**
19
+ * Can the challenge actually be rendered? Requires captcha to be on AND a public site
20
+ * key to be configured. When captcha is on but the site key is missing, the widget
21
+ * shows a config-gap message rather than a silent dead-end.
22
+ */
23
+ export declare function canRenderChallenge(def: PublishedFormDefinition | null, siteKey: string | undefined): boolean;
24
+ /** True when captcha is required but no site key was supplied to the widget. */
25
+ export declare function isConfigGap(def: PublishedFormDefinition | null, siteKey: string | undefined): boolean;
26
+ /** A site key counts as configured only when it is a non-blank string. */
27
+ export declare function isSiteKeyConfigured(siteKey: string | undefined): boolean;
28
+ /**
29
+ * May the final submit proceed? When captcha is not required, always yes (behave exactly
30
+ * as before this feature). When required, a non-empty solved token must be held. If the
31
+ * site key is missing the answer is no — there is no way to produce a token, so the
32
+ * config-gap message is what the respondent sees instead.
33
+ */
34
+ export declare function canSubmit(def: PublishedFormDefinition | null, siteKey: string | undefined, token: string | null): boolean;
35
+ /**
36
+ * Whether a failed-submit error message came from the Turnstile check, meaning the
37
+ * (single-use) token was consumed/rejected and the challenge must be reset so the
38
+ * respondent can solve a fresh one. The server phrases these as
39
+ * `Captcha verification failed (<code>).`.
40
+ */
41
+ export declare function isTurnstileError(message: string | undefined | null): boolean;
42
+ //# sourceMappingURL=turnstile-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnstile-gate.d.ts","sourceRoot":"","sources":["../../../../src/lib/widget/core/turnstile-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,kGAAkG;AAClG,eAAO,MAAM,qBAAqB,0JAOxB,CAAC;AAEX,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,GAAG,EAAE,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,uBAAuB,GAAG,IAAI,EACnC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAET;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CACzB,GAAG,EAAE,uBAAuB,GAAG,IAAI,EACnC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAET;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,uBAAuB,GAAG,IAAI,EACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,OAAO,CAQT;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAS5E"}
@@ -0,0 +1,61 @@
1
+ /** Server-side Turnstile error codes surfaced to the client (see Server/turnstile.service.ts). */
2
+ export const TURNSTILE_ERROR_CODES = [
3
+ 'missing-token',
4
+ 'turnstile-not-configured',
5
+ 'verification-failed',
6
+ 'turnstile-unreachable',
7
+ 'invalid-input-response',
8
+ 'timeout-or-duplicate',
9
+ ];
10
+ /** Does this published form require a captcha challenge before submit? */
11
+ export function captchaRequired(def) {
12
+ return def?.settings.captchaRequired === true;
13
+ }
14
+ /**
15
+ * Can the challenge actually be rendered? Requires captcha to be on AND a public site
16
+ * key to be configured. When captcha is on but the site key is missing, the widget
17
+ * shows a config-gap message rather than a silent dead-end.
18
+ */
19
+ export function canRenderChallenge(def, siteKey) {
20
+ return captchaRequired(def) && isSiteKeyConfigured(siteKey);
21
+ }
22
+ /** True when captcha is required but no site key was supplied to the widget. */
23
+ export function isConfigGap(def, siteKey) {
24
+ return captchaRequired(def) && !isSiteKeyConfigured(siteKey);
25
+ }
26
+ /** A site key counts as configured only when it is a non-blank string. */
27
+ export function isSiteKeyConfigured(siteKey) {
28
+ return typeof siteKey === 'string' && siteKey.trim().length > 0;
29
+ }
30
+ /**
31
+ * May the final submit proceed? When captcha is not required, always yes (behave exactly
32
+ * as before this feature). When required, a non-empty solved token must be held. If the
33
+ * site key is missing the answer is no — there is no way to produce a token, so the
34
+ * config-gap message is what the respondent sees instead.
35
+ */
36
+ export function canSubmit(def, siteKey, token) {
37
+ if (!captchaRequired(def)) {
38
+ return true;
39
+ }
40
+ if (!isSiteKeyConfigured(siteKey)) {
41
+ return false;
42
+ }
43
+ return typeof token === 'string' && token.trim().length > 0;
44
+ }
45
+ /**
46
+ * Whether a failed-submit error message came from the Turnstile check, meaning the
47
+ * (single-use) token was consumed/rejected and the challenge must be reset so the
48
+ * respondent can solve a fresh one. The server phrases these as
49
+ * `Captcha verification failed (<code>).`.
50
+ */
51
+ export function isTurnstileError(message) {
52
+ if (!message) {
53
+ return false;
54
+ }
55
+ const lower = message.toLowerCase();
56
+ if (lower.includes('captcha')) {
57
+ return true;
58
+ }
59
+ return TURNSTILE_ERROR_CODES.some((code) => lower.includes(code));
60
+ }
61
+ //# sourceMappingURL=turnstile-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnstile-gate.js","sourceRoot":"","sources":["../../../../src/lib/widget/core/turnstile-gate.ts"],"names":[],"mappings":"A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AC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Typed access to the Cloudflare Turnstile browser global and a one-shot loader for
3
+ * its script. Kept separate from the component so the render logic has a strongly-typed
4
+ * seam (no `any`) and so tests can stub the global on `window`.
5
+ *
6
+ * The script (`https://challenges.cloudflare.com/turnstile/v0/api.js`) is loaded at most
7
+ * once per document, regardless of how many `<mj-form>` instances are on the page.
8
+ */
9
+ /** Options passed to `turnstile.render` (explicit mode subset we use). */
10
+ export interface TurnstileRenderOptions {
11
+ sitekey: string;
12
+ callback: (token: string) => void;
13
+ 'expired-callback'?: () => void;
14
+ 'error-callback'?: () => void;
15
+ }
16
+ /** The subset of the Cloudflare Turnstile API this widget calls. */
17
+ export interface TurnstileApi {
18
+ render(container: HTMLElement, options: TurnstileRenderOptions): string;
19
+ reset(widgetId: string): void;
20
+ remove(widgetId: string): void;
21
+ }
22
+ /** Default Cloudflare Turnstile script URL (overridable via widget config). */
23
+ export declare const DEFAULT_TURNSTILE_SCRIPT_URL = "https://challenges.cloudflare.com/turnstile/v0/api.js";
24
+ /** The Turnstile global if the script has loaded, else undefined. */
25
+ export declare function getTurnstile(): TurnstileApi | undefined;
26
+ /**
27
+ * Ensure the Turnstile script is loaded exactly once, resolving when `window.turnstile`
28
+ * is available. Rejects if the script fails to load or there is no DOM. Subsequent calls
29
+ * return the same promise.
30
+ */
31
+ export declare function ensureTurnstileScript(scriptUrl?: string): Promise<void>;
32
+ /** Test-only: reset the module-level load state so specs start clean. */
33
+ export declare function resetTurnstileLoaderForTest(): void;
34
+ //# sourceMappingURL=turnstile-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnstile-loader.d.ts","sourceRoot":"","sources":["../../../../src/lib/widget/core/turnstile-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAAC;IACxE,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAOD,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,0DAA0D,CAAC;AAQpG,qEAAqE;AACrE,wBAAgB,YAAY,IAAI,YAAY,GAAG,SAAS,CAKvD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,SAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,CAY7F;AA2BD,yEAAyE;AACzE,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Typed access to the Cloudflare Turnstile browser global and a one-shot loader for
3
+ * its script. Kept separate from the component so the render logic has a strongly-typed
4
+ * seam (no `any`) and so tests can stub the global on `window`.
5
+ *
6
+ * The script (`https://challenges.cloudflare.com/turnstile/v0/api.js`) is loaded at most
7
+ * once per document, regardless of how many `<mj-form>` instances are on the page.
8
+ */
9
+ /** Default Cloudflare Turnstile script URL (overridable via widget config). */
10
+ export const DEFAULT_TURNSTILE_SCRIPT_URL = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
11
+ /** DOM id for the singleton `<script>` tag, so we never inject it twice. */
12
+ const SCRIPT_ELEMENT_ID = 'mjf-turnstile-script';
13
+ /** In-flight/settled load promise, shared across all widget instances on the page. */
14
+ let loadPromise = null;
15
+ /** The Turnstile global if the script has loaded, else undefined. */
16
+ export function getTurnstile() {
17
+ if (typeof window === 'undefined') {
18
+ return undefined;
19
+ }
20
+ return window.turnstile;
21
+ }
22
+ /**
23
+ * Ensure the Turnstile script is loaded exactly once, resolving when `window.turnstile`
24
+ * is available. Rejects if the script fails to load or there is no DOM. Subsequent calls
25
+ * return the same promise.
26
+ */
27
+ export function ensureTurnstileScript(scriptUrl = DEFAULT_TURNSTILE_SCRIPT_URL) {
28
+ if (getTurnstile()) {
29
+ return Promise.resolve();
30
+ }
31
+ if (loadPromise) {
32
+ return loadPromise;
33
+ }
34
+ if (typeof document === 'undefined') {
35
+ return Promise.reject(new Error('Turnstile requires a DOM.'));
36
+ }
37
+ loadPromise = injectScript(scriptUrl);
38
+ return loadPromise;
39
+ }
40
+ /** Inject the script tag (or await an existing one) and resolve when the global appears. */
41
+ function injectScript(scriptUrl) {
42
+ return new Promise((resolve, reject) => {
43
+ const existing = document.getElementById(SCRIPT_ELEMENT_ID);
44
+ if (existing) {
45
+ existing.addEventListener('load', () => resolve(), { once: true });
46
+ existing.addEventListener('error', () => reject(new Error('Turnstile script failed to load.')), {
47
+ once: true,
48
+ });
49
+ return;
50
+ }
51
+ const script = document.createElement('script');
52
+ script.id = SCRIPT_ELEMENT_ID;
53
+ script.src = scriptUrl;
54
+ script.async = true;
55
+ script.defer = true;
56
+ script.addEventListener('load', () => resolve(), { once: true });
57
+ script.addEventListener('error', () => {
58
+ loadPromise = null; // allow a later retry
59
+ reject(new Error('Turnstile script failed to load.'));
60
+ }, { once: true });
61
+ document.head.appendChild(script);
62
+ });
63
+ }
64
+ /** Test-only: reset the module-level load state so specs start clean. */
65
+ export function resetTurnstileLoaderForTest() {
66
+ loadPromise = null;
67
+ }
68
+ //# sourceMappingURL=turnstile-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnstile-loader.js","sourceRoot":"","sources":["../../../../src/lib/widget/core/turnstile-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsBH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,uDAAuD,CAAC;AAEpG,4EAA4E;AAC5E,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEjD,sFAAsF;AACtF,IAAI,WAAW,GAAyB,IAAI,CAAC;AAE7C,qEAAqE;AACrE,MAAM,UAAU,YAAY;IAC1B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAQ,MAA0B,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAS,GAAG,4BAA4B;IAC5E,IAAI,YAAY,EAAE,EAAE,CAAC;QACnB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,4FAA4F;AAC5F,SAAS,YAAY,CAAC,SAAiB;IACrC,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAA6B,CAAC;QACxF,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACnE,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,EAAE;gBAC9F,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,EAAE,GAAG,iBAAiB,CAAC;QAC9B,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC;QACvB,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACpC,WAAW,GAAG,IAAI,CAAC,CAAC,sBAAsB;YAC1C,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;QACxD,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,2BAA2B;IACzC,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Client-side enforcement of `isRequired` + `ValidationRule` (S2). The server
3
+ * re-validates the same rules on submit; this layer gives instant, accessible
4
+ * feedback and blocks navigation/submit on a visible, required question.
5
+ */
6
+ import type { AnswerValue, PublishedFormQuestion } from '@mj-biz-apps/forms-entities';
7
+ /** A per-question validation outcome. `null` message means "valid". */
8
+ export interface FieldValidationResult {
9
+ valid: boolean;
10
+ message: string | null;
11
+ }
12
+ /** True when a value counts as "supplied" (non-empty string / non-empty array / present). */
13
+ export declare function hasValue(value: AnswerValue): boolean;
14
+ /**
15
+ * Validate one question's current value. Only call for VISIBLE questions — hidden
16
+ * questions (failed conditional rule) are never required and never validated.
17
+ */
18
+ export declare function validateQuestion(question: PublishedFormQuestion, value: AnswerValue): FieldValidationResult;
19
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/lib/widget/core/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,uEAAuE;AACvE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAID,6FAA6F;AAC7F,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAWpD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,WAAW,GACjB,qBAAqB,CAgBvB"}