@apia/execution 5.0.0 → 5.0.3

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 (484) hide show
  1. package/dist/index.d.ts +92 -3688
  2. package/dist/index.js +83 -8379
  3. package/dist/index.js.map +1 -1
  4. package/dist/main/Execution/Entity/index.d.ts +30 -0
  5. package/dist/main/Execution/Entity/index.d.ts.map +1 -0
  6. package/dist/main/Execution/Entity/index.js +268 -0
  7. package/dist/main/Execution/Entity/index.js.map +1 -0
  8. package/dist/main/Execution/Entity/type.d.ts +98 -0
  9. package/dist/main/Execution/Entity/type.d.ts.map +1 -0
  10. package/dist/main/Execution/EntityFlowModals/confirmFlow.js +200 -0
  11. package/dist/main/Execution/EntityFlowModals/confirmFlow.js.map +1 -0
  12. package/dist/main/Execution/FlowModals/FlowModal.d.ts +18 -0
  13. package/dist/main/Execution/FlowModals/FlowModal.d.ts.map +1 -0
  14. package/dist/main/Execution/FlowModals/FlowModal.js +5 -0
  15. package/dist/main/Execution/FlowModals/FlowModal.js.map +1 -0
  16. package/dist/main/Execution/FlowModals/ShowConfirmMessage.d.ts +16 -0
  17. package/dist/main/Execution/FlowModals/ShowConfirmMessage.d.ts.map +1 -0
  18. package/dist/main/Execution/FlowModals/ShowConfirmMessage.js +12 -0
  19. package/dist/main/Execution/FlowModals/ShowConfirmMessage.js.map +1 -0
  20. package/dist/main/Execution/FlowModals/ShowPathSelection.d.ts +29 -0
  21. package/dist/main/Execution/FlowModals/ShowPathSelection.d.ts.map +1 -0
  22. package/dist/main/Execution/FlowModals/ShowPathSelection.js +50 -0
  23. package/dist/main/Execution/FlowModals/ShowPathSelection.js.map +1 -0
  24. package/dist/main/Execution/FlowModals/ShowPoolSelection.d.ts +20 -0
  25. package/dist/main/Execution/FlowModals/ShowPoolSelection.d.ts.map +1 -0
  26. package/dist/main/Execution/FlowModals/ShowPoolSelection.js +12 -0
  27. package/dist/main/Execution/FlowModals/ShowPoolSelection.js.map +1 -0
  28. package/dist/main/Execution/FlowModals/ShowSign.d.ts +16 -0
  29. package/dist/main/Execution/FlowModals/ShowSign.d.ts.map +1 -0
  30. package/dist/main/Execution/FlowModals/ShowSign.js +12 -0
  31. package/dist/main/Execution/FlowModals/ShowSign.js.map +1 -0
  32. package/dist/main/Execution/FlowModals/ShowSignSelection.d.ts +19 -0
  33. package/dist/main/Execution/FlowModals/ShowSignSelection.d.ts.map +1 -0
  34. package/dist/main/Execution/FlowModals/ShowSignSelection.js +12 -0
  35. package/dist/main/Execution/FlowModals/ShowSignSelection.js.map +1 -0
  36. package/dist/main/Execution/FlowModals/confirmFlow.js +420 -0
  37. package/dist/main/Execution/FlowModals/confirmFlow.js.map +1 -0
  38. package/dist/main/Execution/FlowModals/types.d.ts +44 -0
  39. package/dist/main/Execution/FlowModals/types.d.ts.map +1 -0
  40. package/dist/main/Execution/FormsExecution/Field.d.ts +43 -0
  41. package/dist/main/Execution/FormsExecution/Field.d.ts.map +1 -0
  42. package/dist/main/Execution/FormsExecution/Field.js +289 -0
  43. package/dist/main/Execution/FormsExecution/Field.js.map +1 -0
  44. package/dist/main/Execution/FormsExecution/FieldWithAttribute.d.ts +44 -0
  45. package/dist/main/Execution/FormsExecution/FieldWithAttribute.d.ts.map +1 -0
  46. package/dist/main/Execution/FormsExecution/FieldWithAttribute.js +254 -0
  47. package/dist/main/Execution/FormsExecution/FieldWithAttribute.js.map +1 -0
  48. package/dist/main/Execution/FormsExecution/Form.d.ts +83 -0
  49. package/dist/main/Execution/FormsExecution/Form.d.ts.map +1 -0
  50. package/dist/main/Execution/FormsExecution/Form.js +378 -0
  51. package/dist/main/Execution/FormsExecution/Form.js.map +1 -0
  52. package/dist/main/Execution/FormsExecution/TranslatableField/Translation.d.ts +19 -0
  53. package/dist/main/Execution/FormsExecution/TranslatableField/Translation.d.ts.map +1 -0
  54. package/dist/main/Execution/FormsExecution/TranslatableField/Translation.js +72 -0
  55. package/dist/main/Execution/FormsExecution/TranslatableField/Translation.js.map +1 -0
  56. package/dist/main/Execution/FormsExecution/TranslatableField/index.d.ts +38 -0
  57. package/dist/main/Execution/FormsExecution/TranslatableField/index.d.ts.map +1 -0
  58. package/dist/main/Execution/FormsExecution/TranslatableField/index.js +141 -0
  59. package/dist/main/Execution/FormsExecution/TranslatableField/index.js.map +1 -0
  60. package/dist/main/Execution/FormsExecution/TranslatableField/types.d.ts +11 -0
  61. package/dist/main/Execution/FormsExecution/TranslatableField/types.d.ts.map +1 -0
  62. package/dist/main/Execution/FormsExecution/TranslatableField/util.js +9 -0
  63. package/dist/main/Execution/FormsExecution/TranslatableField/util.js.map +1 -0
  64. package/dist/main/Execution/FormsExecution/WithProperties.d.ts +17 -0
  65. package/dist/main/Execution/FormsExecution/WithProperties.d.ts.map +1 -0
  66. package/dist/main/Execution/FormsExecution/WithProperties.js +38 -0
  67. package/dist/main/Execution/FormsExecution/WithProperties.js.map +1 -0
  68. package/dist/main/Execution/FormsExecution/constants/IProperty.js +10 -0
  69. package/dist/main/Execution/FormsExecution/constants/IProperty.js.map +1 -0
  70. package/dist/main/Execution/FormsExecution/constants/actions.js +5 -0
  71. package/dist/main/Execution/FormsExecution/constants/actions.js.map +1 -0
  72. package/dist/main/Execution/FormsExecution/constants/eventTypes.js +5 -0
  73. package/dist/main/Execution/FormsExecution/constants/eventTypes.js.map +1 -0
  74. package/dist/main/Execution/FormsExecution/constants/fieldProps.js +124 -0
  75. package/dist/main/Execution/FormsExecution/constants/fieldProps.js.map +1 -0
  76. package/dist/main/Execution/FormsExecution/constants/formProps.js +18 -0
  77. package/dist/main/Execution/FormsExecution/constants/formProps.js.map +1 -0
  78. package/dist/main/Execution/FormsExecution/constants/props/booleanProps.js +67 -0
  79. package/dist/main/Execution/FormsExecution/constants/props/booleanProps.js.map +1 -0
  80. package/dist/main/Execution/FormsExecution/constants/props/numberProps.js +14 -0
  81. package/dist/main/Execution/FormsExecution/constants/props/numberProps.js.map +1 -0
  82. package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.d.ts +62 -0
  83. package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.d.ts.map +1 -0
  84. package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.js +378 -0
  85. package/dist/main/Execution/FormsExecution/customComponents/CustomComponent.js.map +1 -0
  86. package/dist/main/Execution/FormsExecution/events/setAjaxFormResponse.js +150 -0
  87. package/dist/main/Execution/FormsExecution/events/setAjaxFormResponse.js.map +1 -0
  88. package/dist/main/Execution/FormsExecution/fields/Button/index.d.ts +10 -0
  89. package/dist/main/Execution/FormsExecution/fields/Button/index.d.ts.map +1 -0
  90. package/dist/main/Execution/FormsExecution/fields/Button/index.js +10 -0
  91. package/dist/main/Execution/FormsExecution/fields/Button/index.js.map +1 -0
  92. package/dist/main/Execution/FormsExecution/fields/Captcha/index.d.ts +28 -0
  93. package/dist/main/Execution/FormsExecution/fields/Captcha/index.d.ts.map +1 -0
  94. package/dist/main/Execution/FormsExecution/fields/Captcha/index.js +71 -0
  95. package/dist/main/Execution/FormsExecution/fields/Captcha/index.js.map +1 -0
  96. package/dist/main/Execution/FormsExecution/fields/Checkbox/index.d.ts +12 -0
  97. package/dist/main/Execution/FormsExecution/fields/Checkbox/index.d.ts.map +1 -0
  98. package/dist/main/Execution/FormsExecution/fields/Checkbox/index.js +19 -0
  99. package/dist/main/Execution/FormsExecution/fields/Checkbox/index.js.map +1 -0
  100. package/dist/main/Execution/FormsExecution/fields/Editor/index.d.ts +14 -0
  101. package/dist/main/Execution/FormsExecution/fields/Editor/index.d.ts.map +1 -0
  102. package/dist/main/Execution/FormsExecution/fields/Editor/index.js +18 -0
  103. package/dist/main/Execution/FormsExecution/fields/Editor/index.js.map +1 -0
  104. package/dist/main/Execution/FormsExecution/fields/File/index.d.ts +22 -0
  105. package/dist/main/Execution/FormsExecution/fields/File/index.d.ts.map +1 -0
  106. package/dist/main/Execution/FormsExecution/fields/File/index.js +116 -0
  107. package/dist/main/Execution/FormsExecution/fields/File/index.js.map +1 -0
  108. package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.d.ts +15 -0
  109. package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.d.ts.map +1 -0
  110. package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.js +17 -0
  111. package/dist/main/Execution/FormsExecution/fields/Grid/AdditionalCell.js.map +1 -0
  112. package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.d.ts +24 -0
  113. package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.d.ts.map +1 -0
  114. package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.js +43 -0
  115. package/dist/main/Execution/FormsExecution/fields/Grid/FieldsCache.js.map +1 -0
  116. package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.d.ts +9 -0
  117. package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.d.ts.map +1 -0
  118. package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.js +10 -0
  119. package/dist/main/Execution/FormsExecution/fields/Grid/GridCell.js.map +1 -0
  120. package/dist/main/Execution/FormsExecution/fields/Grid/GridEditionModal.d.ts +7 -0
  121. package/dist/main/Execution/FormsExecution/fields/Grid/GridEditionModal.d.ts.map +1 -0
  122. package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.d.ts +27 -0
  123. package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.d.ts.map +1 -0
  124. package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.js +100 -0
  125. package/dist/main/Execution/FormsExecution/fields/Grid/GridFooterHandler.js.map +1 -0
  126. package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.d.ts +14 -0
  127. package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.d.ts.map +1 -0
  128. package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.js +17 -0
  129. package/dist/main/Execution/FormsExecution/fields/Grid/HeaderCell.js.map +1 -0
  130. package/dist/main/Execution/FormsExecution/fields/Grid/index.d.ts +122 -0
  131. package/dist/main/Execution/FormsExecution/fields/Grid/index.d.ts.map +1 -0
  132. package/dist/main/Execution/FormsExecution/fields/Grid/index.js +961 -0
  133. package/dist/main/Execution/FormsExecution/fields/Grid/index.js.map +1 -0
  134. package/dist/main/Execution/FormsExecution/fields/Grid/types.d.ts +47 -0
  135. package/dist/main/Execution/FormsExecution/fields/Grid/types.d.ts.map +1 -0
  136. package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.d.ts +21 -0
  137. package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.d.ts.map +1 -0
  138. package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.js +204 -0
  139. package/dist/main/Execution/FormsExecution/fields/GridPaginated/index.js.map +1 -0
  140. package/dist/main/Execution/FormsExecution/fields/Hidden/index.d.ts +8 -0
  141. package/dist/main/Execution/FormsExecution/fields/Hidden/index.d.ts.map +1 -0
  142. package/dist/main/Execution/FormsExecution/fields/Hidden/index.js +7 -0
  143. package/dist/main/Execution/FormsExecution/fields/Hidden/index.js.map +1 -0
  144. package/dist/main/Execution/FormsExecution/fields/Image/index.d.ts +8 -0
  145. package/dist/main/Execution/FormsExecution/fields/Image/index.d.ts.map +1 -0
  146. package/dist/main/Execution/FormsExecution/fields/Image/index.js +7 -0
  147. package/dist/main/Execution/FormsExecution/fields/Image/index.js.map +1 -0
  148. package/dist/main/Execution/FormsExecution/fields/Input/index.d.ts +18 -0
  149. package/dist/main/Execution/FormsExecution/fields/Input/index.d.ts.map +1 -0
  150. package/dist/main/Execution/FormsExecution/fields/Input/index.js +150 -0
  151. package/dist/main/Execution/FormsExecution/fields/Input/index.js.map +1 -0
  152. package/dist/main/Execution/FormsExecution/fields/Label/index.d.ts +9 -0
  153. package/dist/main/Execution/FormsExecution/fields/Label/index.d.ts.map +1 -0
  154. package/dist/main/Execution/FormsExecution/fields/Label/index.js +7 -0
  155. package/dist/main/Execution/FormsExecution/fields/Label/index.js.map +1 -0
  156. package/dist/main/Execution/FormsExecution/fields/Link/index.d.ts +8 -0
  157. package/dist/main/Execution/FormsExecution/fields/Link/index.d.ts.map +1 -0
  158. package/dist/main/Execution/FormsExecution/fields/Link/index.js +7 -0
  159. package/dist/main/Execution/FormsExecution/fields/Link/index.js.map +1 -0
  160. package/dist/main/Execution/FormsExecution/fields/ModalInput/index.d.ts +25 -0
  161. package/dist/main/Execution/FormsExecution/fields/ModalInput/index.d.ts.map +1 -0
  162. package/dist/main/Execution/FormsExecution/fields/ModalInput/index.js +145 -0
  163. package/dist/main/Execution/FormsExecution/fields/ModalInput/index.js.map +1 -0
  164. package/dist/main/Execution/FormsExecution/fields/Multiple/index.d.ts +19 -0
  165. package/dist/main/Execution/FormsExecution/fields/Multiple/index.d.ts.map +1 -0
  166. package/dist/main/Execution/FormsExecution/fields/Multiple/index.js +42 -0
  167. package/dist/main/Execution/FormsExecution/fields/Multiple/index.js.map +1 -0
  168. package/dist/main/Execution/FormsExecution/fields/Password/index.d.ts +9 -0
  169. package/dist/main/Execution/FormsExecution/fields/Password/index.d.ts.map +1 -0
  170. package/dist/main/Execution/FormsExecution/fields/Password/index.js +10 -0
  171. package/dist/main/Execution/FormsExecution/fields/Password/index.js.map +1 -0
  172. package/dist/main/Execution/FormsExecution/fields/Radio/index.d.ts +15 -0
  173. package/dist/main/Execution/FormsExecution/fields/Radio/index.d.ts.map +1 -0
  174. package/dist/main/Execution/FormsExecution/fields/Radio/index.js +26 -0
  175. package/dist/main/Execution/FormsExecution/fields/Radio/index.js.map +1 -0
  176. package/dist/main/Execution/FormsExecution/fields/Scheduler/index.d.ts +36 -0
  177. package/dist/main/Execution/FormsExecution/fields/Scheduler/index.d.ts.map +1 -0
  178. package/dist/main/Execution/FormsExecution/fields/Scheduler/index.js +156 -0
  179. package/dist/main/Execution/FormsExecution/fields/Scheduler/index.js.map +1 -0
  180. package/dist/main/Execution/FormsExecution/fields/Select/index.d.ts +15 -0
  181. package/dist/main/Execution/FormsExecution/fields/Select/index.d.ts.map +1 -0
  182. package/dist/main/Execution/FormsExecution/fields/Select/index.js +35 -0
  183. package/dist/main/Execution/FormsExecution/fields/Select/index.js.map +1 -0
  184. package/dist/main/Execution/FormsExecution/fields/Textarea/index.d.ts +11 -0
  185. package/dist/main/Execution/FormsExecution/fields/Textarea/index.d.ts.map +1 -0
  186. package/dist/main/Execution/FormsExecution/fields/Textarea/index.js +15 -0
  187. package/dist/main/Execution/FormsExecution/fields/Textarea/index.js.map +1 -0
  188. package/dist/main/Execution/FormsExecution/fields/Title/index.d.ts +8 -0
  189. package/dist/main/Execution/FormsExecution/fields/Title/index.d.ts.map +1 -0
  190. package/dist/main/Execution/FormsExecution/fields/Title/index.js +7 -0
  191. package/dist/main/Execution/FormsExecution/fields/Title/index.js.map +1 -0
  192. package/dist/main/Execution/FormsExecution/fields/Tree/index.d.ts +30 -0
  193. package/dist/main/Execution/FormsExecution/fields/Tree/index.d.ts.map +1 -0
  194. package/dist/main/Execution/FormsExecution/fields/Tree/index.js +115 -0
  195. package/dist/main/Execution/FormsExecution/fields/Tree/index.js.map +1 -0
  196. package/dist/main/Execution/FormsExecution/fieldsMap.d.ts +9 -0
  197. package/dist/main/Execution/FormsExecution/fieldsMap.d.ts.map +1 -0
  198. package/dist/main/Execution/FormsExecution/fieldsMap.js +64 -0
  199. package/dist/main/Execution/FormsExecution/fieldsMap.js.map +1 -0
  200. package/dist/main/Execution/FormsExecution/types.d.ts +55 -0
  201. package/dist/main/Execution/FormsExecution/types.d.ts.map +1 -0
  202. package/dist/main/Execution/FormsExecution/util/isFieldShowAsText.js +8 -0
  203. package/dist/main/Execution/FormsExecution/util/isFieldShowAsText.js.map +1 -0
  204. package/dist/main/Execution/FormsExecution/util/util.d.ts +6 -0
  205. package/dist/main/Execution/FormsExecution/util/util.d.ts.map +1 -0
  206. package/dist/main/Execution/FormsExecution/util/util.js +7 -0
  207. package/dist/main/Execution/FormsExecution/util/util.js.map +1 -0
  208. package/dist/main/Execution/Observations/index.d.ts +16 -0
  209. package/dist/main/Execution/Observations/index.d.ts.map +1 -0
  210. package/dist/main/Execution/Observations/index.js +89 -0
  211. package/dist/main/Execution/Observations/index.js.map +1 -0
  212. package/dist/main/Execution/Observations/types.d.ts +26 -0
  213. package/dist/main/Execution/Observations/types.d.ts.map +1 -0
  214. package/dist/main/Execution/Process/index.d.ts +23 -0
  215. package/dist/main/Execution/Process/index.d.ts.map +1 -0
  216. package/dist/main/Execution/Process/index.js +77 -0
  217. package/dist/main/Execution/Process/index.js.map +1 -0
  218. package/dist/main/Execution/Process/types.d.ts +95 -0
  219. package/dist/main/Execution/Process/types.d.ts.map +1 -0
  220. package/dist/main/Execution/Signature/SignatureController.d.ts +23 -0
  221. package/dist/main/Execution/Signature/SignatureController.d.ts.map +1 -0
  222. package/dist/main/Execution/Signature/SignatureController.js +71 -0
  223. package/dist/main/Execution/Signature/SignatureController.js.map +1 -0
  224. package/dist/main/Execution/Task.d.ts +9 -0
  225. package/dist/main/Execution/Task.d.ts.map +1 -0
  226. package/dist/main/Execution/Task.js +34 -0
  227. package/dist/main/Execution/Task.js.map +1 -0
  228. package/dist/main/Execution/Uploader/FormsUploader.d.ts +145 -0
  229. package/dist/main/Execution/Uploader/FormsUploader.d.ts.map +1 -0
  230. package/dist/main/Execution/Uploader/FormsUploader.js +299 -0
  231. package/dist/main/Execution/Uploader/FormsUploader.js.map +1 -0
  232. package/dist/main/Execution/Uploader/UploaderApi.d.ts +40 -0
  233. package/dist/main/Execution/Uploader/UploaderApi.d.ts.map +1 -0
  234. package/dist/main/Execution/Uploader/UploaderApi.js +127 -0
  235. package/dist/main/Execution/Uploader/UploaderApi.js.map +1 -0
  236. package/dist/main/Execution/index.d.ts +184 -0
  237. package/dist/main/Execution/index.d.ts.map +1 -0
  238. package/dist/main/Execution/index.js +662 -0
  239. package/dist/main/Execution/index.js.map +1 -0
  240. package/dist/main/Execution/types.d.ts +99 -0
  241. package/dist/main/Execution/types.d.ts.map +1 -0
  242. package/dist/main/Execution/types.js +12 -0
  243. package/dist/main/Execution/types.js.map +1 -0
  244. package/dist/main/InitialData/bootstrap/readFormsDefinition.js +55 -0
  245. package/dist/main/InitialData/bootstrap/readFormsDefinition.js.map +1 -0
  246. package/dist/main/InitialData/index.js +10 -0
  247. package/dist/main/InitialData/index.js.map +1 -0
  248. package/dist/main/InitialData/types/TApiaField.d.ts +75 -0
  249. package/dist/main/InitialData/types/TApiaField.d.ts.map +1 -0
  250. package/dist/main/InitialData/types/TApiaForm.d.ts +102 -0
  251. package/dist/main/InitialData/types/TApiaForm.d.ts.map +1 -0
  252. package/dist/main/InitialData/types/fields/TApiaButtonDefinition.d.ts +9 -0
  253. package/dist/main/InitialData/types/fields/TApiaButtonDefinition.d.ts.map +1 -0
  254. package/dist/main/InitialData/types/fields/TApiaCaptchaDefinition.d.ts +11 -0
  255. package/dist/main/InitialData/types/fields/TApiaCaptchaDefinition.d.ts.map +1 -0
  256. package/dist/main/InitialData/types/fields/TApiaCheckboxDefinition.d.ts +10 -0
  257. package/dist/main/InitialData/types/fields/TApiaCheckboxDefinition.d.ts.map +1 -0
  258. package/dist/main/InitialData/types/fields/TApiaEditorDefinition.d.ts +10 -0
  259. package/dist/main/InitialData/types/fields/TApiaEditorDefinition.d.ts.map +1 -0
  260. package/dist/main/InitialData/types/fields/TApiaFieldProperties.d.ts +194 -0
  261. package/dist/main/InitialData/types/fields/TApiaFieldProperties.d.ts.map +1 -0
  262. package/dist/main/InitialData/types/fields/TApiaFileUploaderDefinition.d.ts +11 -0
  263. package/dist/main/InitialData/types/fields/TApiaFileUploaderDefinition.d.ts.map +1 -0
  264. package/dist/main/InitialData/types/fields/TApiaGridDefinition.d.ts +33 -0
  265. package/dist/main/InitialData/types/fields/TApiaGridDefinition.d.ts.map +1 -0
  266. package/dist/main/InitialData/types/fields/TApiaHiddenInputDefinition.d.ts +11 -0
  267. package/dist/main/InitialData/types/fields/TApiaHiddenInputDefinition.d.ts.map +1 -0
  268. package/dist/main/InitialData/types/fields/TApiaImageDefinition.d.ts +9 -0
  269. package/dist/main/InitialData/types/fields/TApiaImageDefinition.d.ts.map +1 -0
  270. package/dist/main/InitialData/types/fields/TApiaInputDefinition.d.ts +21 -0
  271. package/dist/main/InitialData/types/fields/TApiaInputDefinition.d.ts.map +1 -0
  272. package/dist/main/InitialData/types/fields/TApiaLabelDefinition.d.ts +10 -0
  273. package/dist/main/InitialData/types/fields/TApiaLabelDefinition.d.ts.map +1 -0
  274. package/dist/main/InitialData/types/fields/TApiaLinkDefinition.d.ts +10 -0
  275. package/dist/main/InitialData/types/fields/TApiaLinkDefinition.d.ts.map +1 -0
  276. package/dist/main/InitialData/types/fields/TApiaModalInputDefinition.d.ts +24 -0
  277. package/dist/main/InitialData/types/fields/TApiaModalInputDefinition.d.ts.map +1 -0
  278. package/dist/main/InitialData/types/fields/TApiaMultipleDefinition.d.ts +11 -0
  279. package/dist/main/InitialData/types/fields/TApiaMultipleDefinition.d.ts.map +1 -0
  280. package/dist/main/InitialData/types/fields/TApiaPasswordDefinition.d.ts +10 -0
  281. package/dist/main/InitialData/types/fields/TApiaPasswordDefinition.d.ts.map +1 -0
  282. package/dist/main/InitialData/types/fields/TApiaRadioButtonDefinition.d.ts +11 -0
  283. package/dist/main/InitialData/types/fields/TApiaRadioButtonDefinition.d.ts.map +1 -0
  284. package/dist/main/InitialData/types/fields/TApiaSelectDefinition.d.ts +11 -0
  285. package/dist/main/InitialData/types/fields/TApiaSelectDefinition.d.ts.map +1 -0
  286. package/dist/main/InitialData/types/fields/TApiaTextareaDefinition.d.ts +11 -0
  287. package/dist/main/InitialData/types/fields/TApiaTextareaDefinition.d.ts.map +1 -0
  288. package/dist/main/InitialData/types/fields/TApiaTitleDefinition.d.ts +9 -0
  289. package/dist/main/InitialData/types/fields/TApiaTitleDefinition.d.ts.map +1 -0
  290. package/dist/main/InitialData/types/fields/TApiaTreeDefinition.d.ts +17 -0
  291. package/dist/main/InitialData/types/fields/TApiaTreeDefinition.d.ts.map +1 -0
  292. package/dist/main/Notifications/MessageNotification.d.ts +8 -0
  293. package/dist/main/Notifications/MessageNotification.d.ts.map +1 -0
  294. package/dist/main/Notifications/MessageNotification.js +10 -0
  295. package/dist/main/Notifications/MessageNotification.js.map +1 -0
  296. package/dist/main/Notifications/Notification.d.ts +26 -0
  297. package/dist/main/Notifications/Notification.d.ts.map +1 -0
  298. package/dist/main/Notifications/Notification.js +40 -0
  299. package/dist/main/Notifications/Notification.js.map +1 -0
  300. package/dist/main/Notifications/StatusNotification.d.ts +15 -0
  301. package/dist/main/Notifications/StatusNotification.d.ts.map +1 -0
  302. package/dist/main/Notifications/StatusNotification.js +11 -0
  303. package/dist/main/Notifications/StatusNotification.js.map +1 -0
  304. package/dist/main/Notifications/index.d.ts +26 -0
  305. package/dist/main/Notifications/index.d.ts.map +1 -0
  306. package/dist/main/Notifications/index.js +48 -0
  307. package/dist/main/Notifications/index.js.map +1 -0
  308. package/dist/programming/ActionController/index.d.ts +36 -0
  309. package/dist/programming/ActionController/index.d.ts.map +1 -0
  310. package/dist/programming/ActionController/index.js +69 -0
  311. package/dist/programming/ActionController/index.js.map +1 -0
  312. package/dist/programming/ApiaField.d.ts +21 -0
  313. package/dist/programming/ApiaField.d.ts.map +1 -0
  314. package/dist/programming/ApiaField.js +58 -0
  315. package/dist/programming/ApiaField.js.map +1 -0
  316. package/dist/programming/ApiaFieldWithAttribute.d.ts +31 -0
  317. package/dist/programming/ApiaFieldWithAttribute.d.ts.map +1 -0
  318. package/dist/programming/ApiaFieldWithAttribute.js +72 -0
  319. package/dist/programming/ApiaFieldWithAttribute.js.map +1 -0
  320. package/dist/programming/ApiaForm.d.ts +148 -0
  321. package/dist/programming/ApiaForm.d.ts.map +1 -0
  322. package/dist/programming/ApiaForm.js +105 -0
  323. package/dist/programming/ApiaForm.js.map +1 -0
  324. package/dist/programming/ApiaFunctions.d.ts +54 -0
  325. package/dist/programming/ApiaFunctions.d.ts.map +1 -0
  326. package/dist/programming/ApiaFunctions.js +223 -0
  327. package/dist/programming/ApiaFunctions.js.map +1 -0
  328. package/dist/programming/constants/BooleanProps.d.ts +4 -0
  329. package/dist/programming/constants/BooleanProps.d.ts.map +1 -0
  330. package/dist/programming/constants/BooleanProps.js +67 -0
  331. package/dist/programming/constants/BooleanProps.js.map +1 -0
  332. package/dist/programming/constants/FieldConstants.d.ts +121 -0
  333. package/dist/programming/constants/FieldConstants.d.ts.map +1 -0
  334. package/dist/programming/constants/FieldConstants.js +127 -0
  335. package/dist/programming/constants/FieldConstants.js.map +1 -0
  336. package/dist/programming/constants/FormConstants.d.ts +15 -0
  337. package/dist/programming/constants/FormConstants.d.ts.map +1 -0
  338. package/dist/programming/constants/FormConstants.js +15 -0
  339. package/dist/programming/constants/FormConstants.js.map +1 -0
  340. package/dist/programming/constants/IProperty.d.ts +131 -0
  341. package/dist/programming/constants/IProperty.d.ts.map +1 -0
  342. package/dist/programming/constants/IProperty.js +10 -0
  343. package/dist/programming/constants/IProperty.js.map +1 -0
  344. package/dist/programming/constants/NumberProps.d.ts +4 -0
  345. package/dist/programming/constants/NumberProps.d.ts.map +1 -0
  346. package/dist/programming/constants/NumberProps.js +14 -0
  347. package/dist/programming/constants/NumberProps.js.map +1 -0
  348. package/dist/programming/fields/AreaField.d.ts +7 -0
  349. package/dist/programming/fields/AreaField.d.ts.map +1 -0
  350. package/dist/programming/fields/AreaField.js +7 -0
  351. package/dist/programming/fields/AreaField.js.map +1 -0
  352. package/dist/programming/fields/ButtonField.d.ts +22 -0
  353. package/dist/programming/fields/ButtonField.d.ts.map +1 -0
  354. package/dist/programming/fields/ButtonField.js +49 -0
  355. package/dist/programming/fields/ButtonField.js.map +1 -0
  356. package/dist/programming/fields/CaptchaField.d.ts +9 -0
  357. package/dist/programming/fields/CaptchaField.d.ts.map +1 -0
  358. package/dist/programming/fields/CaptchaField.js +7 -0
  359. package/dist/programming/fields/CaptchaField.js.map +1 -0
  360. package/dist/programming/fields/CheckField.d.ts +9 -0
  361. package/dist/programming/fields/CheckField.d.ts.map +1 -0
  362. package/dist/programming/fields/CheckField.js +23 -0
  363. package/dist/programming/fields/CheckField.js.map +1 -0
  364. package/dist/programming/fields/CustomComponentField.js +56 -0
  365. package/dist/programming/fields/CustomComponentField.js.map +1 -0
  366. package/dist/programming/fields/EditorField.d.ts +7 -0
  367. package/dist/programming/fields/EditorField.d.ts.map +1 -0
  368. package/dist/programming/fields/EditorField.js +7 -0
  369. package/dist/programming/fields/EditorField.js.map +1 -0
  370. package/dist/programming/fields/FileUploaderField.d.ts +17 -0
  371. package/dist/programming/fields/FileUploaderField.d.ts.map +1 -0
  372. package/dist/programming/fields/FileUploaderField.js +61 -0
  373. package/dist/programming/fields/FileUploaderField.js.map +1 -0
  374. package/dist/programming/fields/GridField.d.ts +625 -0
  375. package/dist/programming/fields/GridField.d.ts.map +1 -0
  376. package/dist/programming/fields/GridField.js +196 -0
  377. package/dist/programming/fields/GridField.js.map +1 -0
  378. package/dist/programming/fields/HiddenField.d.ts +7 -0
  379. package/dist/programming/fields/HiddenField.d.ts.map +1 -0
  380. package/dist/programming/fields/HiddenField.js +7 -0
  381. package/dist/programming/fields/HiddenField.js.map +1 -0
  382. package/dist/programming/fields/ImageField.d.ts +24 -0
  383. package/dist/programming/fields/ImageField.d.ts.map +1 -0
  384. package/dist/programming/fields/ImageField.js +61 -0
  385. package/dist/programming/fields/ImageField.js.map +1 -0
  386. package/dist/programming/fields/InputField.d.ts +15 -0
  387. package/dist/programming/fields/InputField.d.ts.map +1 -0
  388. package/dist/programming/fields/InputField.js +42 -0
  389. package/dist/programming/fields/InputField.js.map +1 -0
  390. package/dist/programming/fields/LinkField.d.ts +18 -0
  391. package/dist/programming/fields/LinkField.d.ts.map +1 -0
  392. package/dist/programming/fields/LinkField.js +39 -0
  393. package/dist/programming/fields/LinkField.js.map +1 -0
  394. package/dist/programming/fields/ModalInput.d.ts +16 -0
  395. package/dist/programming/fields/ModalInput.d.ts.map +1 -0
  396. package/dist/programming/fields/ModalInput.js +44 -0
  397. package/dist/programming/fields/ModalInput.js.map +1 -0
  398. package/dist/programming/fields/MultipleField.d.ts +22 -0
  399. package/dist/programming/fields/MultipleField.d.ts.map +1 -0
  400. package/dist/programming/fields/MultipleField.js +102 -0
  401. package/dist/programming/fields/MultipleField.js.map +1 -0
  402. package/dist/programming/fields/PasswordField.d.ts +7 -0
  403. package/dist/programming/fields/PasswordField.d.ts.map +1 -0
  404. package/dist/programming/fields/PasswordField.js +7 -0
  405. package/dist/programming/fields/PasswordField.js.map +1 -0
  406. package/dist/programming/fields/RadioField.d.ts +22 -0
  407. package/dist/programming/fields/RadioField.d.ts.map +1 -0
  408. package/dist/programming/fields/RadioField.js +98 -0
  409. package/dist/programming/fields/RadioField.js.map +1 -0
  410. package/dist/programming/fields/SelectField.d.ts +24 -0
  411. package/dist/programming/fields/SelectField.d.ts.map +1 -0
  412. package/dist/programming/fields/SelectField.js +104 -0
  413. package/dist/programming/fields/SelectField.js.map +1 -0
  414. package/dist/programming/fields/TextField.d.ts +18 -0
  415. package/dist/programming/fields/TextField.d.ts.map +1 -0
  416. package/dist/programming/fields/TextField.js +43 -0
  417. package/dist/programming/fields/TextField.js.map +1 -0
  418. package/dist/programming/fields/TreeField.d.ts +14 -0
  419. package/dist/programming/fields/TreeField.d.ts.map +1 -0
  420. package/dist/programming/fields/TreeField.js +36 -0
  421. package/dist/programming/fields/TreeField.js.map +1 -0
  422. package/dist/programming/types.d.ts +73 -0
  423. package/dist/programming/types.d.ts.map +1 -0
  424. package/dist/programming/utils/asynCreateApiaField.d.ts +10 -0
  425. package/dist/programming/utils/asynCreateApiaField.d.ts.map +1 -0
  426. package/dist/programming/utils/asynCreateApiaField.js +10 -0
  427. package/dist/programming/utils/asynCreateApiaField.js.map +1 -0
  428. package/dist/programming/utils/createApiaField.d.ts +6 -0
  429. package/dist/programming/utils/createApiaField.d.ts.map +1 -0
  430. package/dist/programming/utils/createApiaField.js +94 -0
  431. package/dist/programming/utils/createApiaField.js.map +1 -0
  432. package/dist/util/api/apiaApi.d.ts +159 -0
  433. package/dist/util/api/apiaApi.d.ts.map +1 -0
  434. package/dist/util/api/apiaApi.js +243 -0
  435. package/dist/util/api/apiaApi.js.map +1 -0
  436. package/dist/util/api/types.d.ts +38 -0
  437. package/dist/util/api/types.d.ts.map +1 -0
  438. package/dist/util/app/getCurrentTabsString.js +13 -0
  439. package/dist/util/app/getCurrentTabsString.js.map +1 -0
  440. package/dist/util/comparators/deepEqual.d.ts +5 -0
  441. package/dist/util/comparators/deepEqual.d.ts.map +1 -0
  442. package/dist/util/comparators/deepEqual.js +38 -0
  443. package/dist/util/comparators/deepEqual.js.map +1 -0
  444. package/dist/util/comparators/shallowEqual.d.ts +5 -0
  445. package/dist/util/comparators/shallowEqual.d.ts.map +1 -0
  446. package/dist/util/comparators/shallowEqual.js +38 -0
  447. package/dist/util/comparators/shallowEqual.js.map +1 -0
  448. package/dist/util/dataTypes/parseBoolean.js +12 -0
  449. package/dist/util/dataTypes/parseBoolean.js.map +1 -0
  450. package/dist/util/dom/getDocument.js +6 -0
  451. package/dist/util/dom/getDocument.js.map +1 -0
  452. package/dist/util/dom/getWindow.js +6 -0
  453. package/dist/util/dom/getWindow.js.map +1 -0
  454. package/dist/util/events/BouncingEmitter.d.ts +66 -0
  455. package/dist/util/events/BouncingEmitter.d.ts.map +1 -0
  456. package/dist/util/events/BouncingEmitter.js +78 -0
  457. package/dist/util/events/BouncingEmitter.js.map +1 -0
  458. package/dist/util/events/EventEmitter.d.ts +47 -0
  459. package/dist/util/events/EventEmitter.d.ts.map +1 -0
  460. package/dist/util/events/EventEmitter.js +81 -0
  461. package/dist/util/events/EventEmitter.js.map +1 -0
  462. package/dist/util/events/StatefulEmitter.d.ts +37 -0
  463. package/dist/util/events/StatefulEmitter.d.ts.map +1 -0
  464. package/dist/util/events/StatefulEmitter.js +51 -0
  465. package/dist/util/events/StatefulEmitter.js.map +1 -0
  466. package/dist/util/events/types.d.ts +30 -0
  467. package/dist/util/events/types.d.ts.map +1 -0
  468. package/dist/util/labels/labels.d.ts +12 -0
  469. package/dist/util/labels/labels.d.ts.map +1 -0
  470. package/dist/util/labels/labels.js +35 -0
  471. package/dist/util/labels/labels.js.map +1 -0
  472. package/dist/util/number/noNaN.js +9 -0
  473. package/dist/util/number/noNaN.js.map +1 -0
  474. package/dist/util/other/asyncRetry.js +32 -0
  475. package/dist/util/other/asyncRetry.js.map +1 -0
  476. package/dist/util/other/parseFakeJSON.d.ts +4 -0
  477. package/dist/util/other/parseFakeJSON.d.ts.map +1 -0
  478. package/dist/util/other/parseFakeJSON.js +45 -0
  479. package/dist/util/other/parseFakeJSON.js.map +1 -0
  480. package/dist/util/xml/parseXml.d.ts +10 -0
  481. package/dist/util/xml/parseXml.d.ts.map +1 -0
  482. package/dist/util/xml/parseXml.js +172 -0
  483. package/dist/util/xml/parseXml.js.map +1 -0
  484. package/package.json +8 -8
@@ -0,0 +1,83 @@
1
+ import { TApiaFormProperties, TApiaForm, TFormEventName } from '../../InitialData/types/TApiaForm.js';
2
+ import { Execution } from '../index.js';
3
+ import { TSignaturesData } from './types.js';
4
+ import { Field, TFncParams } from './Field.js';
5
+ import { TApiaFieldBaseDefinition, TApiaFieldWithAttributeBaseProps } from '../../InitialData/types/TApiaField.js';
6
+ import { WithProperties } from './WithProperties.js';
7
+ import { FieldWithAttribute } from './FieldWithAttribute.js';
8
+ import { CustomComponent } from './customComponents/CustomComponent.js';
9
+ import { TApiaFieldCommonProperties } from '../../InitialData/types/fields/TApiaFieldProperties.js';
10
+ import { FieldError } from '../types.js';
11
+ import '../../../util/api/apiaApi.js';
12
+ import '../../../programming/ApiaFunctions.js';
13
+ import { Grid } from './fields/Grid/index.js';
14
+
15
+ declare class Form extends WithProperties<TApiaFormProperties> {
16
+ execution: Execution;
17
+ fields: TApiaFieldBaseDefinition<Record<string, any>>[];
18
+ state: {
19
+ isMarkedToSign: boolean;
20
+ };
21
+ protected _customComponents: Map<string, CustomComponent>;
22
+ protected fieldsById: Map<string, Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, {
23
+ definition: Omit<TApiaFieldBaseDefinition<Record<string, any>>, "properties">;
24
+ }>>;
25
+ protected fieldsByName: Map<string, Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, {
26
+ definition: Omit<TApiaFieldBaseDefinition<Record<string, any>>, "properties">;
27
+ }>>;
28
+ protected fieldsByAttributeId: Map<string | number, FieldWithAttribute<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, TApiaFieldWithAttributeBaseProps<Record<string, any>>>>;
29
+ protected fieldsByAttributeName: Map<string, FieldWithAttribute<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, TApiaFieldWithAttributeBaseProps<Record<string, any>>>>;
30
+ protected fieldsGroups: Map<string, Grid>;
31
+ definition: TApiaForm;
32
+ constructor(execution: Execution, definition: TApiaForm);
33
+ get allFields(): Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, {
34
+ definition: Omit<TApiaFieldBaseDefinition<Record<string, any>>, "properties">;
35
+ }>[];
36
+ get customComponents(): Map<string, CustomComponent>;
37
+ toggleFormCollapse(): Promise<void>;
38
+ openForm(): void;
39
+ getField(field: string, index?: number): Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
40
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
41
+ }> | FieldWithAttribute<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, TApiaFieldWithAttributeBaseProps<Record<string, any>>> | Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
42
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
43
+ }>[] | undefined;
44
+ getFieldByAttributeId(attId: string | number, index?: number): Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
45
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
46
+ }> | FieldWithAttribute<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, TApiaFieldWithAttributeBaseProps<Record<string, any>>> | Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
47
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
48
+ }>[] | undefined;
49
+ getFieldByAttributeName(attName: string, index?: number): Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
50
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
51
+ }> | FieldWithAttribute<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, TApiaFieldWithAttributeBaseProps<Record<string, any>>> | Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
52
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
53
+ }>[] | undefined;
54
+ getFieldById(id: string | number, index?: number): Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
55
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
56
+ }> | Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, {
57
+ definition: Omit<TApiaFieldBaseDefinition<TApiaFieldCommonProperties>, "properties">;
58
+ }>[] | undefined;
59
+ getFieldByName(name: string, index?: number): Field | Field[] | undefined;
60
+ protected getHiddenFields(): Field<TApiaFieldCommonProperties, TApiaFieldBaseDefinition<Record<string, any>>, {
61
+ definition: Omit<TApiaFieldBaseDefinition<Record<string, any>>, "properties">;
62
+ }>[];
63
+ markFormToSign(): Promise<void>;
64
+ viewSigns(): Promise<TSignaturesData | undefined>;
65
+ private cucCmpByAttId;
66
+ private cucCmpByFldId;
67
+ private cucCmpByAttName;
68
+ private mustRenderFields;
69
+ getCustomComponentByFldId(fldId: number): CustomComponent | undefined;
70
+ getCustomComponentByAttId(attId: number): CustomComponent | undefined;
71
+ getCustomComponentByAttName(attName: string): CustomComponent | undefined;
72
+ addFieldToRender(fldId: string, fldIndex?: number): void;
73
+ markFieldAsRendered(fldId: string, fldIndex?: number): void;
74
+ init(): Promise<void>;
75
+ protected getScriptEventParams(fncParams: TFncParams[]): Promise<unknown[]>;
76
+ fireScriptEvent(eventName: TFormEventName): Promise<boolean>;
77
+ validate(): Promise<true | Field>;
78
+ getProperty<K extends keyof TApiaFormProperties>(propName: K | 'readOnly'): TApiaFormProperties[K];
79
+ getErrorsList(): FieldError[];
80
+ }
81
+
82
+ export { Form };
83
+ //# sourceMappingURL=Form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,378 @@
1
+ import { getApiaFunctions, Field } from './Field.js';
2
+ import { parseFakeJSON } from '../../../util/other/parseFakeJSON.js';
3
+ import { WithProperties } from './WithProperties.js';
4
+ import { makeObservable, computed, observable } from 'mobx';
5
+ import { FieldWithAttribute } from './FieldWithAttribute.js';
6
+ import { CustomComponent } from './customComponents/CustomComponent.js';
7
+ import { arrayOrArray } from '@apia/util';
8
+ import { ApiaForm } from '../../../programming/ApiaForm.js';
9
+ import { MessageNotification } from '../../Notifications/MessageNotification.js';
10
+ import { labels } from '../../../util/labels/labels.js';
11
+ import { getWindow } from '../../../util/dom/getWindow.js';
12
+ import { getFocusIdentifier } from './util/util.js';
13
+ import { post, makeApiaUrl, get } from '../../../util/api/apiaApi.js';
14
+ import { Grid } from './fields/Grid/index.js';
15
+
16
+ var __defProp = Object.defineProperty;
17
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
+ var __publicField = (obj, key, value) => {
19
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
20
+ return value;
21
+ };
22
+ class Form extends WithProperties {
23
+ constructor(execution, definition) {
24
+ const props = parseFakeJSON(definition.properties);
25
+ super(props);
26
+ this.execution = execution;
27
+ __publicField(this, "fields");
28
+ __publicField(this, "state", { isMarkedToSign: false });
29
+ __publicField(this, "_customComponents", /* @__PURE__ */ new Map());
30
+ __publicField(this, "fieldsById", /* @__PURE__ */ new Map());
31
+ __publicField(this, "fieldsByName", /* @__PURE__ */ new Map());
32
+ __publicField(this, "fieldsByAttributeId", /* @__PURE__ */ new Map());
33
+ __publicField(this, "fieldsByAttributeName", /* @__PURE__ */ new Map());
34
+ __publicField(this, "fieldsGroups", /* @__PURE__ */ new Map());
35
+ __publicField(this, "definition", {});
36
+ __publicField(this, "cucCmpByAttId", /* @__PURE__ */ new Map());
37
+ __publicField(this, "cucCmpByFldId", /* @__PURE__ */ new Map());
38
+ __publicField(this, "cucCmpByAttName", /* @__PURE__ */ new Map());
39
+ __publicField(this, "mustRenderFields", []);
40
+ makeObservable(this, {
41
+ state: observable,
42
+ allFields: computed,
43
+ customComponents: computed
44
+ });
45
+ this.definition = definition;
46
+ this.fields = arrayOrArray(definition.field).sort((a, b) => {
47
+ if (a.y < b.y)
48
+ return -1;
49
+ if (a.y > b.y)
50
+ return 1;
51
+ if (a.x < b.x)
52
+ return -1;
53
+ if (a.x > b.x)
54
+ return 1;
55
+ return 0;
56
+ });
57
+ this.state.isMarkedToSign = this.definition.markedToSign;
58
+ }
59
+ get allFields() {
60
+ return [...this.fieldsById.values()];
61
+ }
62
+ get customComponents() {
63
+ return this._customComponents;
64
+ }
65
+ async toggleFormCollapse() {
66
+ this.properties.prpFrmClosed = !this.properties.prpFrmClosed;
67
+ void post(
68
+ this.execution,
69
+ makeApiaUrl(this.execution, {
70
+ ajaxUrl: "apia.execution.FormAction.run?",
71
+ action: "closeForm",
72
+ frmId: this.definition.id,
73
+ frmParent: this.definition.frmParent,
74
+ collapse: this.properties.prpFrmClosed,
75
+ react: true
76
+ })
77
+ );
78
+ }
79
+ openForm() {
80
+ this.properties.prpFrmClosed = false;
81
+ }
82
+ getField(field, index) {
83
+ const found = this.getFieldById(field, index) || this.getFieldByName(field, index) || this.getFieldByAttributeId(field, index) || this.getFieldByAttributeName(field, index);
84
+ if (found) {
85
+ return found;
86
+ }
87
+ for (const group of this.fieldsGroups.values()) {
88
+ const res = group.getField(field, index);
89
+ if (res) {
90
+ return res;
91
+ }
92
+ }
93
+ return void 0;
94
+ }
95
+ getFieldByAttributeId(attId, index) {
96
+ const found = this.fieldsByAttributeId.get(String(attId));
97
+ if (found) {
98
+ return found;
99
+ }
100
+ for (const group of this.fieldsGroups.values()) {
101
+ const res = group.getFieldByAttributeId(attId, index);
102
+ if (res) {
103
+ return res;
104
+ }
105
+ }
106
+ return void 0;
107
+ }
108
+ getFieldByAttributeName(attName, index) {
109
+ const found = this.fieldsByAttributeName.get(attName);
110
+ if (found) {
111
+ return found;
112
+ }
113
+ for (const group of this.fieldsGroups.values()) {
114
+ const res = group.getFieldByAttributeName(attName, index);
115
+ return res;
116
+ }
117
+ return void 0;
118
+ }
119
+ getFieldById(id, index) {
120
+ const found = this.fieldsById.get(String(id));
121
+ if (found)
122
+ return found;
123
+ for (const group of this.fieldsGroups.values()) {
124
+ const res = group.getFieldById(id, index);
125
+ if (res) {
126
+ return res;
127
+ }
128
+ }
129
+ return void 0;
130
+ }
131
+ getFieldByName(name, index) {
132
+ const found = this.fieldsByName.get(String(name));
133
+ if (found)
134
+ return found;
135
+ for (const group of this.fieldsGroups.values()) {
136
+ const res = group.getFieldByName(name, index);
137
+ if (res) {
138
+ return res;
139
+ }
140
+ }
141
+ return void 0;
142
+ }
143
+ getHiddenFields() {
144
+ return this.allFields.filter((c) => c.getProperty("visibilityHidden"));
145
+ }
146
+ async markFormToSign() {
147
+ void post(
148
+ this.execution,
149
+ makeApiaUrl(this.execution, {
150
+ ajaxUrl: "apia.execution.FormAction.run?",
151
+ action: "markFormToSign",
152
+ frmId: this.definition.id,
153
+ frmParent: this.definition.frmParent,
154
+ sign: !this.state.isMarkedToSign,
155
+ react: true
156
+ })
157
+ ).then((res) => {
158
+ if (res?.data && res.data.success) {
159
+ this.state.isMarkedToSign = !this.state.isMarkedToSign;
160
+ }
161
+ });
162
+ }
163
+ async viewSigns() {
164
+ const res = await get(
165
+ this.execution,
166
+ makeApiaUrl(this.execution, {
167
+ ajaxUrl: "/apia.execution.FormAction.run",
168
+ action: "viewSigns",
169
+ frmId: this.definition.id,
170
+ frmParent: this.definition.frmParent,
171
+ react: true
172
+ })
173
+ );
174
+ if (res?.data) {
175
+ return res.data;
176
+ }
177
+ }
178
+ getCustomComponentByFldId(fldId) {
179
+ return this.cucCmpByFldId.get(fldId);
180
+ }
181
+ getCustomComponentByAttId(attId) {
182
+ return this.cucCmpByAttId.get(attId);
183
+ }
184
+ getCustomComponentByAttName(attName) {
185
+ return this.cucCmpByAttName.get(attName);
186
+ }
187
+ addFieldToRender(fldId, fldIndex = 0) {
188
+ this.mustRenderFields.push(fldId + "_" + fldIndex);
189
+ }
190
+ markFieldAsRendered(fldId, fldIndex = 0) {
191
+ this.mustRenderFields = this.mustRenderFields.filter(
192
+ (c) => c !== fldId + "_" + fldIndex
193
+ );
194
+ if (this.mustRenderFields.length - this.getHiddenFields().length === 0) {
195
+ this.execution.markFormAsRendered(
196
+ this.definition.frmParent,
197
+ this.definition.formName
198
+ );
199
+ }
200
+ }
201
+ async init() {
202
+ const cusFields = arrayOrArray(this.definition.customField);
203
+ for await (const field of arrayOrArray(this.fields)) {
204
+ this.mustRenderFields.push(field.id + "_" + (field.index ?? 0));
205
+ }
206
+ for await (const customComponent of cusFields) {
207
+ this.mustRenderFields.push(customComponent.id + "_0");
208
+ }
209
+ for await (const customComponent of cusFields) {
210
+ const cc = new CustomComponent(this.execution, customComponent);
211
+ await cc.init(this);
212
+ this._customComponents.set(customComponent.id, cc);
213
+ arrayOrArray(customComponent.state.state.attribute).forEach((a) => {
214
+ this.cucCmpByAttId.set(Number.parseInt(String(a.attId)), cc);
215
+ this.cucCmpByAttName.set(a.attName, cc);
216
+ this.cucCmpByFldId.set(Number.parseInt(String(customComponent.id)), cc);
217
+ });
218
+ }
219
+ for await (const field of arrayOrArray(this.fields)) {
220
+ field.properties = parseFakeJSON(field.properties);
221
+ const fieldConstructor = this.execution.fieldsMapping[field.fieldType](field);
222
+ if (fieldConstructor) {
223
+ const newField = new fieldConstructor(field);
224
+ await newField.init(this);
225
+ this.fieldsById.set(
226
+ String(newField.definition.id),
227
+ newField
228
+ );
229
+ if (newField.properties?.name) {
230
+ this.fieldsByName.set(
231
+ String(newField.properties?.name),
232
+ newField
233
+ );
234
+ }
235
+ if (field.attName) {
236
+ this.fieldsByAttributeId.set(
237
+ String(field.attId),
238
+ newField
239
+ );
240
+ this.fieldsByAttributeName.set(
241
+ field.attName,
242
+ newField
243
+ );
244
+ }
245
+ if (newField instanceof Grid) {
246
+ this.fieldsGroups.set(String(newField.definition.id), newField);
247
+ }
248
+ } else {
249
+ throw new Error(
250
+ `Cannot build field of type ${field.fieldType}. There is no mapping for such type.`
251
+ );
252
+ }
253
+ }
254
+ }
255
+ async getScriptEventParams(fncParams) {
256
+ const fncParamsArray = [];
257
+ for (let e = 0; e < fncParams.length; e += 1) {
258
+ if (fncParams[e].type === "V") {
259
+ fncParamsArray.push(fncParams[e].value);
260
+ } else if (fncParams[e].type === "E" || fncParams[e].type === "P") {
261
+ const paraAttId = fncParams[e].attId;
262
+ if (paraAttId) {
263
+ fncParamsArray.push(
264
+ (await getApiaFunctions(this.execution)).getForm(this.definition.formName, this.definition.frmParent).getField(paraAttId)
265
+ );
266
+ }
267
+ }
268
+ }
269
+ return fncParamsArray;
270
+ }
271
+ async fireScriptEvent(eventName) {
272
+ if (eventName === "onLoad") {
273
+ const mapEvent = getWindow(this.execution)[`LOAD_RELOAD_MAP_${this.definition.frmParent}`];
274
+ const mappedEvent = mapEvent ? mapEvent[this.definition.formName] : void 0;
275
+ const actualMapEvent = mapEvent && (!mappedEvent || mappedEvent === "load" ? "onLoad" : "onReload");
276
+ eventName = actualMapEvent || (getWindow(this.execution).IS_RELOAD ? "onReload" : "onLoad");
277
+ }
278
+ const events = (this.definition.scriptEvents || []).filter(
279
+ (c) => c.evtName === eventName
280
+ );
281
+ if (events.length > 0) {
282
+ const unlock = this.execution.lock();
283
+ try {
284
+ for (const event of events) {
285
+ try {
286
+ const fn = getWindow(this.execution)[event.fncName];
287
+ const result = await fn(
288
+ new ApiaForm(this.execution, this),
289
+ ...await this.getScriptEventParams(event.fncParams)
290
+ );
291
+ if (!result) {
292
+ return false;
293
+ }
294
+ } catch (e) {
295
+ console.error(e);
296
+ this.execution.notifications.add(
297
+ new MessageNotification({
298
+ message: labels.errorOnEvent(this.execution, event.fncName) + e,
299
+ type: "error"
300
+ })
301
+ );
302
+ return false;
303
+ }
304
+ }
305
+ } finally {
306
+ unlock();
307
+ }
308
+ }
309
+ return true;
310
+ }
311
+ async validate() {
312
+ let isValid = true;
313
+ let firstInvalid = null;
314
+ if (this.properties.frmHidden) {
315
+ return true;
316
+ }
317
+ for await (const field of this.allFields) {
318
+ if (field.definition.fieldType === "grid") {
319
+ const result = await field.validate();
320
+ if (result !== true && !firstInvalid) {
321
+ firstInvalid = result;
322
+ isValid = false;
323
+ } else {
324
+ isValid = isValid && result === true;
325
+ }
326
+ } else if (field instanceof Field) {
327
+ isValid = await field.validate() && isValid;
328
+ if (!isValid && !firstInvalid) {
329
+ firstInvalid = field;
330
+ }
331
+ }
332
+ }
333
+ return isValid || firstInvalid;
334
+ }
335
+ getProperty(propName) {
336
+ if (propName === "readOnly") {
337
+ return this.definition.readOnly || this.definition.readonly;
338
+ }
339
+ return super.getProperty(propName);
340
+ }
341
+ getErrorsList() {
342
+ const errors = [];
343
+ this.allFields.forEach((f) => {
344
+ if (f instanceof FieldWithAttribute) {
345
+ const fieldErrors = f.state.validation.errorMessage;
346
+ if (fieldErrors) {
347
+ errors.push({
348
+ id: `${f.getForm().definition.frmParent}_${f.getForm().definition.id}_${f.definition.id}`,
349
+ errorMessage: fieldErrors,
350
+ title: f.attribute.title,
351
+ focus: getFocusIdentifier(f)
352
+ });
353
+ }
354
+ }
355
+ if (f instanceof Grid) {
356
+ for (const col of f.getAllColumns()) {
357
+ for (const field of col) {
358
+ if (field instanceof FieldWithAttribute) {
359
+ const fieldErrors = f.state.validation.errorMessage;
360
+ if (fieldErrors) {
361
+ errors.push({
362
+ id: `${field.getForm().definition.frmParent}_${field.getForm().definition.id}_${field.definition.id}`,
363
+ errorMessage: fieldErrors,
364
+ title: field.attribute.title,
365
+ focus: getFocusIdentifier(field)
366
+ });
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ });
373
+ return errors;
374
+ }
375
+ }
376
+
377
+ export { Form };
378
+ //# sourceMappingURL=Form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/main/Execution/FormsExecution/Form.ts"],"sourcesContent":["import type {\r\n TApiaForm,\r\n TApiaFormProperties,\r\n TFormEventName,\r\n} from '../../InitialData/types/TApiaForm';\r\nimport type { Execution } from '..';\r\nimport type { TSignaturesData } from './types';\r\nimport { Field, getApiaFunctions, TFncParams } from './Field';\r\nimport type {\r\n TApiaFieldBaseDefinition,\r\n TApiaFieldWithAttributeBaseProps,\r\n} from '../../InitialData/types/TApiaField';\r\nimport { parseFakeJSON } from '../../../util/other/parseFakeJSON';\r\nimport { WithProperties } from './WithProperties';\r\nimport { makeApiaUrl, post, get } from '../../../util';\r\nimport { computed, makeObservable, observable } from 'mobx';\r\nimport { FieldWithAttribute } from './FieldWithAttribute';\r\nimport { CustomComponent } from './customComponents/CustomComponent';\r\nimport { Grid } from './fields';\r\nimport { arrayOrArray } from '@apia/util';\r\nimport { ApiaForm } from '../../../programming/ApiaForm';\r\nimport { MessageNotification } from '../../Notifications/MessageNotification';\r\nimport { labels } from '../../../util/labels/labels';\r\nimport { getWindow } from '../../../util/dom/getWindow';\r\nimport { TApiaFieldCommonProperties } from '../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { FieldError } from '../types';\r\nimport { getFocusIdentifier } from './util/util';\r\n\r\nexport class Form extends WithProperties<TApiaFormProperties> {\r\n fields: TApiaFieldBaseDefinition<Record<string, any>>[];\r\n state = { isMarkedToSign: false };\r\n protected _customComponents: Map<string, CustomComponent> = new Map();\r\n protected fieldsById = new Map<\r\n string,\r\n Field<\r\n TApiaFieldCommonProperties,\r\n TApiaFieldBaseDefinition<Record<string, any>>,\r\n {\r\n definition: Omit<\r\n TApiaFieldBaseDefinition<Record<string, any>>,\r\n 'properties'\r\n >;\r\n }\r\n >\r\n >();\r\n protected fieldsByName = new Map<\r\n string,\r\n Field<\r\n TApiaFieldCommonProperties,\r\n TApiaFieldBaseDefinition<Record<string, any>>,\r\n {\r\n definition: Omit<\r\n TApiaFieldBaseDefinition<Record<string, any>>,\r\n 'properties'\r\n >;\r\n }\r\n >\r\n >();\r\n protected fieldsByAttributeId = new Map<\r\n string | number,\r\n FieldWithAttribute<\r\n TApiaFieldCommonProperties,\r\n TApiaFieldBaseDefinition<Record<string, any>>,\r\n TApiaFieldWithAttributeBaseProps<Record<string, any>>\r\n >\r\n >();\r\n protected fieldsByAttributeName = new Map<\r\n string,\r\n FieldWithAttribute<\r\n TApiaFieldCommonProperties,\r\n TApiaFieldBaseDefinition<Record<string, any>>,\r\n TApiaFieldWithAttributeBaseProps<Record<string, any>>\r\n >\r\n >();\r\n protected fieldsGroups = new Map<string, Grid>();\r\n definition: TApiaForm = {} as TApiaForm;\r\n\r\n constructor(\r\n public execution: Execution,\r\n definition: TApiaForm,\r\n ) {\r\n const props = parseFakeJSON<TApiaFormProperties>(definition.properties);\r\n super(props);\r\n makeObservable<Form, 'state'>(this, {\r\n state: observable,\r\n allFields: computed,\r\n customComponents: computed,\r\n });\r\n\r\n this.definition = definition;\r\n\r\n this.fields = arrayOrArray(definition.field).sort((a, b) => {\r\n if (a.y < b.y) return -1;\r\n if (a.y > b.y) return 1;\r\n\r\n if (a.x < b.x) return -1;\r\n if (a.x > b.x) return 1;\r\n\r\n return 0;\r\n });\r\n\r\n this.state.isMarkedToSign = this.definition.markedToSign;\r\n }\r\n\r\n get allFields() {\r\n return [...this.fieldsById.values()];\r\n }\r\n\r\n get customComponents() {\r\n return this._customComponents;\r\n }\r\n\r\n async toggleFormCollapse() {\r\n this.properties.prpFrmClosed = !this.properties.prpFrmClosed;\r\n void post<{ success: boolean }>(\r\n this.execution,\r\n makeApiaUrl(this.execution, {\r\n ajaxUrl: 'apia.execution.FormAction.run?',\r\n action: 'closeForm',\r\n frmId: this.definition.id,\r\n frmParent: this.definition.frmParent,\r\n collapse: this.properties.prpFrmClosed,\r\n react: true,\r\n }),\r\n );\r\n }\r\n openForm() {\r\n this.properties.prpFrmClosed = false;\r\n }\r\n\r\n getField(field: string, index?: number) {\r\n const found =\r\n this.getFieldById(field, index) ||\r\n this.getFieldByName(field, index) ||\r\n this.getFieldByAttributeId(field, index) ||\r\n this.getFieldByAttributeName(field, index);\r\n\r\n if (found) {\r\n return found;\r\n }\r\n\r\n for (const group of this.fieldsGroups.values()) {\r\n const res = group.getField(field, index);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n getFieldByAttributeId(attId: string | number, index?: number) {\r\n const found = this.fieldsByAttributeId.get(String(attId));\r\n if (found) {\r\n return found;\r\n }\r\n\r\n for (const group of this.fieldsGroups.values()) {\r\n const res = group.getFieldByAttributeId(attId, index);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n getFieldByAttributeName(attName: string, index?: number) {\r\n const found = this.fieldsByAttributeName.get(attName);\r\n if (found) {\r\n return found;\r\n }\r\n\r\n for (const group of this.fieldsGroups.values()) {\r\n const res = group.getFieldByAttributeName(attName, index);\r\n return res;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n getFieldById(id: string | number, index?: number) {\r\n const found = this.fieldsById.get(String(id));\r\n if (found) return found;\r\n\r\n for (const group of this.fieldsGroups.values()) {\r\n const res = group.getFieldById(id, index);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n getFieldByName(name: string, index?: number): Field | Field[] | undefined {\r\n const found = this.fieldsByName.get(String(name));\r\n if (found) return found;\r\n\r\n for (const group of this.fieldsGroups.values()) {\r\n const res = group.getFieldByName(name, index);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n protected getHiddenFields() {\r\n return this.allFields.filter((c) => c.getProperty('visibilityHidden'));\r\n }\r\n async markFormToSign() {\r\n void post<{ success: boolean }>(\r\n this.execution,\r\n makeApiaUrl(this.execution, {\r\n ajaxUrl: 'apia.execution.FormAction.run?',\r\n action: 'markFormToSign',\r\n frmId: this.definition.id,\r\n frmParent: this.definition.frmParent,\r\n sign: !this.state.isMarkedToSign,\r\n react: true,\r\n }),\r\n ).then((res) => {\r\n if (res?.data && res.data.success) {\r\n this.state.isMarkedToSign = !this.state.isMarkedToSign;\r\n }\r\n });\r\n }\r\n\r\n async viewSigns(): Promise<TSignaturesData | undefined> {\r\n const res = await get<TSignaturesData>(\r\n this.execution,\r\n makeApiaUrl(this.execution, {\r\n ajaxUrl: '/apia.execution.FormAction.run',\r\n action: 'viewSigns',\r\n frmId: this.definition.id,\r\n frmParent: this.definition.frmParent,\r\n react: true,\r\n }),\r\n );\r\n if (res?.data) {\r\n return res.data;\r\n }\r\n }\r\n\r\n private cucCmpByAttId = new Map<number, CustomComponent>();\r\n private cucCmpByFldId = new Map<number, CustomComponent>();\r\n private cucCmpByAttName = new Map<string, CustomComponent>();\r\n private mustRenderFields: string[] = [];\r\n\r\n getCustomComponentByFldId(fldId: number) {\r\n return this.cucCmpByFldId.get(fldId);\r\n }\r\n\r\n getCustomComponentByAttId(attId: number) {\r\n return this.cucCmpByAttId.get(attId);\r\n }\r\n\r\n getCustomComponentByAttName(attName: string) {\r\n return this.cucCmpByAttName.get(attName);\r\n }\r\n\r\n public addFieldToRender(fldId: string, fldIndex: number = 0) {\r\n this.mustRenderFields.push(fldId + '_' + fldIndex);\r\n }\r\n\r\n public markFieldAsRendered(fldId: string, fldIndex: number = 0) {\r\n this.mustRenderFields = this.mustRenderFields.filter(\r\n (c) => c !== fldId + '_' + fldIndex,\r\n );\r\n if (this.mustRenderFields.length - this.getHiddenFields().length === 0) {\r\n this.execution.markFormAsRendered(\r\n this.definition.frmParent,\r\n this.definition.formName,\r\n );\r\n }\r\n }\r\n\r\n async init() {\r\n const cusFields = arrayOrArray(this.definition.customField);\r\n\r\n for await (const field of arrayOrArray(this.fields)) {\r\n this.mustRenderFields.push(field.id + '_' + (field.index ?? 0));\r\n }\r\n for await (const customComponent of cusFields) {\r\n this.mustRenderFields.push(customComponent.id + '_' + 0);\r\n }\r\n for await (const customComponent of cusFields) {\r\n const cc = new CustomComponent(this.execution, customComponent);\r\n await cc.init(this);\r\n this._customComponents.set(customComponent.id, cc);\r\n arrayOrArray(customComponent.state.state.attribute).forEach((a) => {\r\n this.cucCmpByAttId.set(Number.parseInt(String(a.attId)), cc);\r\n this.cucCmpByAttName.set(a.attName, cc);\r\n this.cucCmpByFldId.set(Number.parseInt(String(customComponent.id)), cc);\r\n });\r\n }\r\n\r\n for await (const field of arrayOrArray(this.fields)) {\r\n /**\r\n * Esto es necesario ya que desde el server llega un objeto js en el properties.\r\n */\r\n field.properties = parseFakeJSON(field.properties as any);\r\n\r\n const fieldConstructor =\r\n this.execution.fieldsMapping[field.fieldType](field);\r\n\r\n if (fieldConstructor) {\r\n const newField = new fieldConstructor(field);\r\n await newField.init(this);\r\n\r\n this.fieldsById.set(\r\n String(newField.definition.id),\r\n newField as Field<any>,\r\n );\r\n if (newField.properties?.name) {\r\n this.fieldsByName.set(\r\n String(newField.properties?.name),\r\n newField as Field<any>,\r\n );\r\n }\r\n if ((field as TApiaFieldWithAttributeBaseProps<any>).attName) {\r\n this.fieldsByAttributeId.set(\r\n String((field as TApiaFieldWithAttributeBaseProps<any>).attId),\r\n newField as FieldWithAttribute<any>,\r\n );\r\n this.fieldsByAttributeName.set(\r\n (field as TApiaFieldWithAttributeBaseProps<any>).attName,\r\n newField as FieldWithAttribute<any>,\r\n );\r\n }\r\n\r\n if (newField instanceof Grid) {\r\n this.fieldsGroups.set(String(newField.definition.id), newField);\r\n }\r\n } else {\r\n throw new Error(\r\n `Cannot build field of type ${field.fieldType}. There is no mapping for such type.`,\r\n );\r\n }\r\n }\r\n }\r\n\r\n protected async getScriptEventParams(\r\n fncParams: TFncParams[],\r\n ): Promise<unknown[]> {\r\n const fncParamsArray = [];\r\n for (let e = 0; e < fncParams.length; e += 1) {\r\n if (fncParams[e].type === 'V') {\r\n fncParamsArray.push(fncParams[e].value);\r\n } else if (fncParams[e].type === 'E' || fncParams[e].type === 'P') {\r\n const paraAttId = fncParams[e].attId;\r\n if (paraAttId) {\r\n fncParamsArray.push(\r\n (await getApiaFunctions(this.execution))\r\n .getForm(this.definition.formName, this.definition.frmParent)!\r\n .getField(paraAttId),\r\n );\r\n }\r\n }\r\n }\r\n return fncParamsArray;\r\n }\r\n\r\n public async fireScriptEvent(eventName: TFormEventName): Promise<boolean> {\r\n if (eventName === 'onLoad') {\r\n const mapEvent = getWindow(this.execution)[\r\n `LOAD_RELOAD_MAP_${this.definition.frmParent}`\r\n ] as any as Record<string, string>;\r\n const mappedEvent = mapEvent\r\n ? mapEvent[this.definition.formName]\r\n : undefined;\r\n const actualMapEvent =\r\n mapEvent &&\r\n (!mappedEvent || mappedEvent === 'load' ? 'onLoad' : 'onReload');\r\n eventName =\r\n actualMapEvent ||\r\n (getWindow(this.execution).IS_RELOAD ? 'onReload' : 'onLoad');\r\n }\r\n\r\n const events = (this.definition.scriptEvents || []).filter(\r\n (c) => c.evtName === eventName,\r\n );\r\n if (events.length > 0) {\r\n const unlock = this.execution.lock();\r\n\r\n try {\r\n for (const event of events) {\r\n try {\r\n const fn = (getWindow(this.execution) as any)[event.fncName] as (\r\n src: ApiaForm,\r\n ...parameters: unknown[]\r\n ) => Promise<boolean>;\r\n const result = await fn(\r\n new ApiaForm(this.execution, this)!,\r\n ...(await this.getScriptEventParams(event.fncParams)),\r\n );\r\n if (!result) {\r\n return false;\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n this.execution.notifications.add(\r\n new MessageNotification({\r\n message: labels.errorOnEvent(this.execution, event.fncName) + e,\r\n type: 'error',\r\n }),\r\n );\r\n return false;\r\n }\r\n }\r\n } finally {\r\n unlock();\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n async validate(): Promise<true | Field> {\r\n let isValid = true;\r\n let firstInvalid: Field | null = null;\r\n\r\n if (this.properties.frmHidden) {\r\n return true;\r\n }\r\n\r\n for await (const field of this.allFields) {\r\n if (field.definition.fieldType === 'grid') {\r\n const result = await (field as Grid).validate();\r\n if (result !== true && !firstInvalid) {\r\n firstInvalid = result;\r\n isValid = false;\r\n } else {\r\n isValid = isValid && result === true;\r\n }\r\n } else if (field instanceof Field) {\r\n isValid = (await field.validate()) && isValid;\r\n if (!isValid && !firstInvalid) {\r\n firstInvalid = field;\r\n }\r\n }\r\n }\r\n\r\n return isValid || firstInvalid!;\r\n }\r\n\r\n getProperty<K extends keyof TApiaFormProperties>(\r\n propName: K | 'readOnly',\r\n ): TApiaFormProperties[K] {\r\n if (propName === 'readOnly') {\r\n return this.definition.readOnly || this.definition.readonly;\r\n }\r\n return super.getProperty(propName);\r\n }\r\n\r\n public getErrorsList(): FieldError[] {\r\n const errors: FieldError[] = [];\r\n this.allFields.forEach((f) => {\r\n if (f instanceof FieldWithAttribute) {\r\n const fieldErrors = f.state.validation.errorMessage;\r\n if (fieldErrors) {\r\n errors.push({\r\n id: `${f.getForm().definition.frmParent}_${f.getForm().definition.id}_${f.definition.id}`,\r\n errorMessage: fieldErrors,\r\n title: f.attribute.title,\r\n focus: getFocusIdentifier(f),\r\n });\r\n }\r\n }\r\n if (f instanceof Grid) {\r\n for (const col of f.getAllColumns()) {\r\n for (const field of col) {\r\n if (field instanceof FieldWithAttribute) {\r\n const fieldErrors = f.state.validation.errorMessage;\r\n if (fieldErrors) {\r\n errors.push({\r\n id: `${field.getForm().definition.frmParent}_${field.getForm().definition.id}_${field.definition.id}`,\r\n errorMessage: fieldErrors,\r\n title: field.attribute.title,\r\n focus: getFocusIdentifier(field),\r\n });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n return errors;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,aAAa,cAAA,CAAoC;AAAA,EAiD5D,WAAA,CACS,WACP,UAAA,EACA;AACA,IAAA,MAAM,KAAA,GAAQ,aAAA,CAAmC,UAAA,CAAW,UAAU,CAAA;AACtE,IAAA,KAAA,CAAM,KAAK,CAAA;AAJJ,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AAjDT,IAAA,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA;AACA,IAAA,aAAA,CAAA,IAAA,EAAA,OAAA,EAAQ,EAAE,gBAAgB,KAAA,EAAM,CAAA;AAChC,IAAA,aAAA,CAAA,IAAA,EAAU,mBAAA,sBAAsD,GAAA,EAAI,CAAA;AACpE,IAAA,aAAA,CAAA,IAAA,EAAU,YAAA,sBAAiB,GAAA,EAYzB,CAAA;AACF,IAAA,aAAA,CAAA,IAAA,EAAU,cAAA,sBAAmB,GAAA,EAY3B,CAAA;AACF,IAAA,aAAA,CAAA,IAAA,EAAU,qBAAA,sBAA0B,GAAA,EAOlC,CAAA;AACF,IAAA,aAAA,CAAA,IAAA,EAAU,uBAAA,sBAA4B,GAAA,EAOpC,CAAA;AACF,IAAA,aAAA,CAAA,IAAA,EAAU,cAAA,sBAAmB,GAAA,EAAkB,CAAA;AAC/C,IAAA,aAAA,CAAA,IAAA,EAAA,YAAA,EAAwB,EAAC,CAAA;AAyKzB,IAAA,aAAA,CAAA,IAAA,EAAQ,eAAA,sBAAoB,GAAA,EAA6B,CAAA;AACzD,IAAA,aAAA,CAAA,IAAA,EAAQ,eAAA,sBAAoB,GAAA,EAA6B,CAAA;AACz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KAAA;AAAA,YACnB,KAAA,EAAO,mBAAmB,CAAC;AAAA,WAC5B,CAAA;AAAA;AACH;AAEF,MAAA,IAAI,aAAa,IAAA,EAAM;AACrB,QAAA,KAAA,MAAW,GAAA,IAAO,CAAA,CAAE,aAAA,EAAc,EAAG;AACnC,UAAA,KAAA,MAAW,SAAS,GAAA,EAAK;AACvB,YAAA,IAAI,iBAAiB,kBAAA,EAAoB;AACvC,cAAA,MAAM,WAAA,GAAc,CAAA,CAAE,KAAA,CAAM,UAAA,CAAW,YAAA;AACvC,cAAA,IAAI,WAAA,EAAa;AACf,gBAAA,MAAA,CAAO,IAAA,CAAK;AAAA,kBACV,IAAI,CAAA,EAAG,KAAA,CAAM,OAAA,EAAQ,CAAE,WAAW,SAAS,CAAA,CAAA,EAAI,KAAA,CAAM,OAAA,GAAU,UAAA,CAAW,EAAE,CAAA,CAAA,EAAI,KAAA,CAAM,WAAW,EAAE,CAAA,CAAA;AAAA,kBACnG,YAAA,EAAc,WAAA;AAAA,kBACd,KAAA,EAAO,MAAM,SAAA,CAAU,KAAA;AAAA,kBACvB,KAAA,EAAO,mBAAmB,KAAK;AAAA,iBAChC,CAAA;AAAA;AACH;AACF;AACF;AACF;AACF,KACD,CAAA;AACD,IAAA,OAAO,MAAA;AAAA;AAEX;;;;"}
@@ -0,0 +1,19 @@
1
+ import { TTranslationState } from './types.js';
2
+ import { Execution } from '../../index.js';
3
+
4
+ declare class Translation {
5
+ execution: Execution;
6
+ state: TTranslationState;
7
+ constructor(execution: Execution, state: Pick<TTranslationState, 'id' | 'label' | 'isTranslated'>);
8
+ cancelTranslation(): void;
9
+ readTranslations(url: string): Promise<void>;
10
+ reset(): void;
11
+ deleteTranslation(): void;
12
+ setTempValue(str: string): void;
13
+ submitTranslation(value: string, url: string): void;
14
+ get langId(): string;
15
+ get value(): string;
16
+ }
17
+
18
+ export { Translation };
19
+ //# sourceMappingURL=Translation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Translation.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,72 @@
1
+ import { makeObservable, observable } from 'mobx';
2
+ import { post } from '../../../../util/api/apiaApi.js';
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => {
7
+ __defNormalProp(obj, key + "" , value);
8
+ return value;
9
+ };
10
+ class Translation {
11
+ constructor(execution, state) {
12
+ this.execution = execution;
13
+ __publicField(this, "state");
14
+ this.state = {
15
+ ...state,
16
+ hasChanged: false,
17
+ isTranslated: state.isTranslated,
18
+ tempValue: ""
19
+ };
20
+ makeObservable(this, { state: observable });
21
+ }
22
+ cancelTranslation() {
23
+ this.reset();
24
+ }
25
+ async readTranslations(url) {
26
+ if (this.state.remoteValue === void 0) {
27
+ const result = await post(
28
+ this.execution,
29
+ url,
30
+ { avoidNormalize: true, avoidTrimXml: true }
31
+ );
32
+ const newValue = result?.data?.values?.value;
33
+ this.state.tempValue = newValue !== "null" ? result?.data?.values?.value ?? "" : "";
34
+ this.state.remoteValue = this.state.tempValue;
35
+ }
36
+ }
37
+ reset() {
38
+ delete this.state.remoteValue;
39
+ this.state.tempValue = "";
40
+ this.state.hasChanged = false;
41
+ }
42
+ deleteTranslation() {
43
+ delete this.state.remoteValue;
44
+ this.state.tempValue = "";
45
+ this.state.hasChanged = false;
46
+ this.state.isTranslated = false;
47
+ }
48
+ setTempValue(str) {
49
+ this.state.tempValue = str;
50
+ this.state.hasChanged = str !== this.state.remoteValue;
51
+ }
52
+ submitTranslation(value, url) {
53
+ if (this.state.hasChanged) {
54
+ post(this.execution, url, {
55
+ postData: { value },
56
+ stringifyOptions: { arrayFormat: "repeat" },
57
+ postDataTreatment: "stringify"
58
+ });
59
+ }
60
+ this.state.isTranslated = this.value !== "";
61
+ this.reset();
62
+ }
63
+ get langId() {
64
+ return this.state.id;
65
+ }
66
+ get value() {
67
+ return this.state.tempValue;
68
+ }
69
+ }
70
+
71
+ export { Translation };
72
+ //# sourceMappingURL=Translation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Translation.js","sources":["../../../../../src/main/Execution/FormsExecution/TranslatableField/Translation.ts"],"sourcesContent":["import { makeObservable, observable } from 'mobx';\r\nimport { TTranslationState } from './types';\r\nimport { post } from '../../../../util';\r\nimport type { Execution } from '../..';\r\n\r\nexport class Translation {\r\n state: TTranslationState;\r\n\r\n constructor(\r\n public execution: Execution,\r\n state: Pick<TTranslationState, 'id' | 'label' | 'isTranslated'>,\r\n ) {\r\n this.state = {\r\n ...state,\r\n hasChanged: false,\r\n isTranslated: state.isTranslated,\r\n tempValue: '',\r\n };\r\n makeObservable(this, { state: observable });\r\n }\r\n\r\n cancelTranslation() {\r\n this.reset();\r\n }\r\n\r\n async readTranslations(url: string) {\r\n if (this.state.remoteValue === undefined) {\r\n const result = await post<{ values: { value: string } }>(\r\n this.execution,\r\n url,\r\n { avoidNormalize: true, avoidTrimXml: true },\r\n );\r\n\r\n const newValue = result?.data?.values?.value;\r\n this.state.tempValue =\r\n newValue !== 'null' ? (result?.data?.values?.value ?? '') : '';\r\n this.state.remoteValue = this.state.tempValue;\r\n }\r\n }\r\n\r\n reset() {\r\n delete this.state.remoteValue;\r\n this.state.tempValue = '';\r\n this.state.hasChanged = false;\r\n }\r\n\r\n deleteTranslation() {\r\n delete this.state.remoteValue;\r\n this.state.tempValue = '';\r\n this.state.hasChanged = false;\r\n this.state.isTranslated = false;\r\n }\r\n\r\n setTempValue(str: string) {\r\n this.state.tempValue = str;\r\n this.state.hasChanged = str !== this.state.remoteValue;\r\n }\r\n\r\n submitTranslation(value: string, url: string) {\r\n if (this.state.hasChanged) {\r\n post(this.execution, url, {\r\n postData: { value },\r\n stringifyOptions: { arrayFormat: 'repeat' },\r\n postDataTreatment: 'stringify',\r\n });\r\n }\r\n\r\n this.state.isTranslated = this.value !== '';\r\n this.reset();\r\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