@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,150 @@
1
+ import dayjs from 'dayjs';
2
+ import { getLabel, labels } from '../../../../../util/labels/labels.js';
3
+ import { TranslatableField } from '../../TranslatableField/index.js';
4
+ import { getDateFormat } from '@apia/util';
5
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __publicField = (obj, key, value) => {
10
+ __defNormalProp(obj, key + "" , value);
11
+ return value;
12
+ };
13
+ dayjs.extend(customParseFormat);
14
+ function escapeRegExp(value) {
15
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16
+ }
17
+ function parseNumber(value) {
18
+ const charThousSeparator = window.CHAR_THOUS_SEPARATOR || ".";
19
+ const charDecimalSeparator = window.CHAR_DECIMAL_SEPARATOR || ",";
20
+ const regexpThousSeparator = escapeRegExp(charThousSeparator);
21
+ const regexpDecimalSeparator = escapeRegExp(charDecimalSeparator);
22
+ const regexp = new RegExp(
23
+ `^-?(?:(?:\\d+)|(?:\\d{1,3}${regexpThousSeparator}\\d{3}(?:${regexpThousSeparator}\\d{3})*))(?:${regexpDecimalSeparator}\\d+)?$`
24
+ );
25
+ const trimmedValue = value.trim();
26
+ if (!trimmedValue.match(regexp)) {
27
+ return NaN;
28
+ }
29
+ let aux = trimmedValue.replaceAll(charThousSeparator, "");
30
+ aux = aux.replaceAll(charDecimalSeparator, ".");
31
+ return parseFloat(aux);
32
+ }
33
+ class Input extends TranslatableField {
34
+ constructor() {
35
+ super(...arguments);
36
+ __publicField(this, "validDate", true);
37
+ }
38
+ fireEvent(eventName, options) {
39
+ return super.fireEvent(eventName, options);
40
+ }
41
+ async setValue(newValue, options) {
42
+ if (this.attribute.valueType === "S") {
43
+ if (!this.definition.regExp || this.validateRegex(String(newValue))) {
44
+ if (String(newValue) !== "")
45
+ this.state.validation.errorMessage = null;
46
+ return super.setValue(String(newValue), options);
47
+ }
48
+ } else if (this.attribute.valueType === "N") {
49
+ if (newValue instanceof Date) {
50
+ throw new Error("A numeric input cannot be set from a date");
51
+ }
52
+ let actualValue = newValue;
53
+ if (typeof newValue === "string") {
54
+ const trimmedValue = newValue.trim();
55
+ if (trimmedValue === "") {
56
+ return super.setValue("", options);
57
+ }
58
+ actualValue = parseNumber(trimmedValue);
59
+ if (isNaN(actualValue)) {
60
+ this.setError("Wrong value format");
61
+ return false;
62
+ }
63
+ actualValue = String(actualValue).replaceAll(".", ",");
64
+ }
65
+ return super.setValue(actualValue, options);
66
+ } else if (this.attribute.valueType === "D") {
67
+ this.validDate = true;
68
+ const inFmt = getDateFormat(options?.format);
69
+ const outFmt = getDateFormat();
70
+ if (typeof newValue === "string") {
71
+ const trimmed = newValue.trim();
72
+ if (/^\d+$/.test(trimmed)) {
73
+ let ms = Number(trimmed);
74
+ if (trimmed.length === 10)
75
+ ms *= 1e3;
76
+ const d2 = dayjs(ms);
77
+ if (!d2.isValid() && trimmed !== "") {
78
+ this.state.validation.errorMessage = getLabel(
79
+ this.getForm().execution,
80
+ "msgInvalidDate"
81
+ ).text;
82
+ this.validDate = false;
83
+ }
84
+ return super.setValue(d2.isValid() ? d2.format(outFmt) : "", options);
85
+ }
86
+ const formats = [`${inFmt} HH:mm`, inFmt];
87
+ const d = dayjs(trimmed, formats, true);
88
+ if (!d.isValid() && trimmed !== "") {
89
+ this.state.validation.errorMessage = getLabel(
90
+ this.getForm().execution,
91
+ "msgInvalidDate"
92
+ ).text;
93
+ this.validDate = false;
94
+ }
95
+ if (!d.isValid()) {
96
+ return super.setValue("", options);
97
+ }
98
+ const hasTime = trimmed.includes(":");
99
+ const finalFormat = hasTime ? `${outFmt} HH:mm` : outFmt;
100
+ return super.setValue(d.format(finalFormat), options);
101
+ }
102
+ if (typeof newValue === "number") {
103
+ const d = dayjs(newValue);
104
+ if (!d.isValid()) {
105
+ this.state.validation.errorMessage = getLabel(
106
+ this.getForm().execution,
107
+ "msgInvalidDate"
108
+ ).text;
109
+ this.validDate = false;
110
+ }
111
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
112
+ }
113
+ if (newValue instanceof Date) {
114
+ const d = dayjs(newValue);
115
+ if (!d.isValid()) {
116
+ this.state.validation.errorMessage = getLabel(
117
+ this.getForm().execution,
118
+ "msgInvalidDate"
119
+ ).text;
120
+ this.validDate = false;
121
+ }
122
+ return super.setValue(d.isValid() ? d.format(outFmt) : "", options);
123
+ }
124
+ }
125
+ return false;
126
+ }
127
+ validateRegex(value) {
128
+ if (!value) {
129
+ this.state.validation.errorMessage = "";
130
+ return true;
131
+ }
132
+ const regex = new RegExp(this.definition.regExp ?? "");
133
+ if (!regex.test(String(value)) && value !== "") {
134
+ this.state.validation.errorMessage = this.properties.regExpMessage || labels.errorRegexNotValidated();
135
+ return false;
136
+ }
137
+ return true;
138
+ }
139
+ async validate() {
140
+ if (this.state.validation.errorMessage && !this.validDate)
141
+ return false;
142
+ return super.validate();
143
+ }
144
+ isValidValue() {
145
+ return !!String(this.getValue()).trim();
146
+ }
147
+ }
148
+
149
+ export { Input };
150
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Input/index.ts"],"sourcesContent":["import dayjs from 'dayjs';\r\nimport { getLabel, labels } from '../../../../../util/labels/labels';\r\nimport { TApiaInputProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaInputDefinition } from '../../../../InitialData/types/fields/TApiaInputDefinition';\r\nimport { TranslatableField } from '../../TranslatableField';\r\nimport { SetValueOptions } from '../../types';\r\nimport { getDateFormat } from '@apia/util';\r\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\r\nimport { TFireEventOptions } from '../../FieldWithAttribute';\r\n\r\n// Enable format-aware strict parsing so invalid dates (e.g., \"31/02/2025\") are rejected instead of auto-rolling to \"03/03/2025\".\r\ndayjs.extend(customParseFormat);\r\n\r\ntype InputEvents = 'onChange' | 'onModalReturn';\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction parseNumber(value: string) {\n const charThousSeparator = window.CHAR_THOUS_SEPARATOR || '.';\n const charDecimalSeparator = window.CHAR_DECIMAL_SEPARATOR || ',';\n\n const regexpThousSeparator = escapeRegExp(charThousSeparator);\n const regexpDecimalSeparator = escapeRegExp(charDecimalSeparator);\n\n const regexp = new RegExp(\n `^-?(?:(?:\\\\d+)|(?:\\\\d{1,3}${regexpThousSeparator}\\\\d{3}(?:${regexpThousSeparator}\\\\d{3})*))(?:${regexpDecimalSeparator}\\\\d+)?$`,\n );\n\n const trimmedValue = value.trim();\n\n if (!trimmedValue.match(regexp)) {\n return NaN;\n }\n\n let aux = trimmedValue.replaceAll(charThousSeparator, '');\n aux = aux.replaceAll(charDecimalSeparator, '.');\n return parseFloat(aux);\n}\n\r\nexport class Input extends TranslatableField<\r\n TApiaInputProperties,\r\n string | number,\r\n TApiaInputDefinition\r\n> {\r\n private validDate = true;\r\n\r\n fireEvent(\r\n eventName: InputEvents,\r\n options?: TFireEventOptions,\r\n ): Promise<boolean> {\r\n return super.fireEvent(eventName, options);\r\n }\r\n\r\n public async setValue(\r\n newValue: string | Date | number,\r\n options?: SetValueOptions,\r\n ): Promise<boolean> {\r\n if (this.attribute.valueType === 'S') {\r\n if (!this.definition.regExp || this.validateRegex(String(newValue))) {\r\n if (String(newValue) !== '') this.state.validation.errorMessage = null;\r\n return super.setValue(String(newValue), options);\r\n }\r\n } else if (this.attribute.valueType === 'N') {\r\n if (newValue instanceof Date) {\r\n throw new Error('A numeric input cannot be set from a date');\r\n }\r\n\r\n let actualValue: number | string = newValue;\r\n\r\n if (typeof newValue === 'string') {\r\n const trimmedValue = newValue.trim();\n\n if (trimmedValue === '') {\n return super.setValue('', options);\n }\n\n actualValue = parseNumber(trimmedValue);\n if (isNaN(actualValue)) {\n this.setError('Wrong value format');\n return false;\n }\n actualValue = String(actualValue).replaceAll('.', ',');\r\n }\r\n\r\n return super.setValue(actualValue, options);\r\n } else if (this.attribute.valueType === 'D') {\r\n this.validDate = true;\r\n const inFmt = getDateFormat(options?.format);\r\n const outFmt = getDateFormat();\r\n\r\n if (typeof newValue === 'string') {\r\n const trimmed = newValue.trim();\r\n\r\n if (/^\\d+$/.test(trimmed)) {\r\n let ms = Number(trimmed);\r\n if (trimmed.length === 10) ms *= 1000;\r\n\r\n const d = dayjs(ms);\r\n\r\n if (!d.isValid() && trimmed !== '') {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n\r\n return super.setValue(d.isValid() ? d.format(outFmt) : '', options);\r\n }\r\n\r\n const formats = [`${inFmt} HH:mm`, inFmt];\r\n\r\n const d = dayjs(trimmed, formats, true);\r\n\r\n if (!d.isValid() && trimmed !== '') {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n\r\n if (!d.isValid()) {\r\n return super.setValue('', options);\r\n }\r\n\r\n const hasTime = trimmed.includes(':');\r\n const finalFormat = hasTime ? `${outFmt} HH:mm` : outFmt;\r\n\r\n return super.setValue(d.format(finalFormat), options);\r\n }\r\n\r\n if (typeof newValue === 'number') {\r\n const d = dayjs(newValue);\r\n if (!d.isValid()) {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n return super.setValue(d.isValid() ? d.format(outFmt) : '', options);\r\n }\r\n\r\n if (newValue instanceof Date) {\r\n const d = dayjs(newValue);\r\n if (!d.isValid()) {\r\n this.state.validation.errorMessage = getLabel(\r\n this.getForm().execution,\r\n 'msgInvalidDate',\r\n ).text;\r\n this.validDate = false;\r\n }\r\n return super.setValue(d.isValid() ? d.format(outFmt) : '', options);\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private validateRegex(value: string): boolean {\r\n if (!value) {\r\n this.state.validation.errorMessage = '';\r\n return true;\r\n }\r\n\r\n const regex = new RegExp(this.definition.regExp ?? '');\r\n\r\n if (!regex.test(String(value)) && value !== '') {\r\n this.state.validation.errorMessage =\r\n this.properties.regExpMessage || labels.errorRegexNotValidated();\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public async validate(): Promise<boolean> {\r\n if (this.state.validation.errorMessage && !this.validDate) return false;\r\n return super.validate();\r\n }\r\n\r\n protected isValidValue(): boolean {\r\n return !!String(this.getValue()).trim();\r\n }\r\n}\r\n"],"names":["d"],"mappings":";;;;;;;;;;;;AAWA,KAAA,CAAM,OAAO,iBAAiB,CAAA;AAI9B,SAAS,aAAa,KAAA,EAAe;AACnC,EAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,qBAAA,EAAuB,MAAM,CAAA;AACpD;AAEA,SAAS,YAAY,KAAA,EAAe;AAClC,EAAA,MAAM,kBAAA,GAAqB,OAAO,oBAAA,IAAwB,GAAA;AAC1D,EAAA,MAAM,oBAAA,GAAuB,OAAO,sBAA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GT,IAAA,MAAM,QAAQ,IAAI,MAAA,CAAO,IAAA,CAAK,UAAA,CAAW,UAAU,EAAE,CAAA;AAErD,IAAA,IAAI,CAAC,MAAM,IAAA,CAAK,MAAA,CAAO,KAAK,CAAC,CAAA,IAAK,UAAU,EAAA,EAAI;AAC9C,MAAA,IAAA,CAAK,MAAM,UAAA,CAAW,YAAA,GACpB,KAAK,UAAA,CAAW,aAAA,IAAiB,OAAO,sBAAA,EAAuB;AACjE,MAAA,OAAO,KAAA;AAAA;AAGT,IAAA,OAAO,IAAA;AAAA;AACT,EAEA,MAAa,QAAA,GAA6B;AACxC,IAAA,IAAI,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,YAAA,IAAgB,CAAC,IAAA,CAAK,SAAA;AAAW,MAAA,OAAO,KAAA;AAClE,IAAA,OAAO,MAAM,QAAA,EAAS;AAAA;AACxB,EAEU,YAAA,GAAwB;AAChC,IAAA,OAAO,CAAC,CAAC,MAAA,CAAO,KAAK,QAAA,EAAU,EAAE,IAAA,EAAK;AAAA;AAE1C;;;;"}
@@ -0,0 +1,9 @@
1
+ import { TApiaLabelProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
2
+ import { TApiaLabelDefinition } from '../../../../InitialData/types/fields/TApiaLabelDefinition.js';
3
+ import { Field } from '../../Field.js';
4
+
5
+ declare class Label extends Field<TApiaLabelProperties, TApiaLabelDefinition> {
6
+ }
7
+
8
+ export { Label };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { Field } from '../../Field.js';
2
+
3
+ class Label extends Field {
4
+ }
5
+
6
+ export { Label };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Label/index.ts"],"sourcesContent":["import { TApiaLabelProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaLabelDefinition } from '../../../../InitialData/types/fields/TApiaLabelDefinition';\r\nimport { Field } from '../../Field';\r\n\r\nexport class Label extends Field<TApiaLabelProperties, TApiaLabelDefinition> {}\r\n"],"names":[],"mappings":";;AAIO,MAAM,cAAc,KAAA,CAAkD;AAAC;;;;"}
@@ -0,0 +1,8 @@
1
+ import { TApiaLinkProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
2
+ import { Field } from '../../Field.js';
3
+
4
+ declare class Link extends Field<TApiaLinkProperties> {
5
+ }
6
+
7
+ export { Link };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { Field } from '../../Field.js';
2
+
3
+ class Link extends Field {
4
+ }
5
+
6
+ export { Link };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Link/index.ts"],"sourcesContent":["import { TApiaLinkProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { Field } from '../../Field';\r\n\r\nexport class Link extends Field<TApiaLinkProperties> {}\r\n"],"names":[],"mappings":";;AAGO,MAAM,aAAa,KAAA,CAA2B;AAAC;;;;"}
@@ -0,0 +1,25 @@
1
+ import { IApiaApiPostConfig } from '../../../../../util/api/types.js';
2
+ import { TApiaInputProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
3
+ import { TApiaModalInputDefinition } from '../../../../InitialData/types/fields/TApiaModalInputDefinition.js';
4
+ import { FieldWithAttribute, TFireEventOptions } from '../../FieldWithAttribute.js';
5
+ import { SetValueOptions } from '../../types.js';
6
+
7
+ type InputEvents = 'onChange' | 'onModalReturn';
8
+ type ModalInputValue = {
9
+ showValue: string;
10
+ storeValue?: string;
11
+ };
12
+ declare class ModalInput extends FieldWithAttribute<TApiaInputProperties, ModalInputValue> {
13
+ isLoading: boolean;
14
+ constructor({ value, ...definition }: TApiaModalInputDefinition);
15
+ fireEvent(eventName: InputEvents, options?: TFireEventOptions): Promise<boolean>;
16
+ protected hasValue(): boolean;
17
+ setValueFromInputWrite(value: string): Promise<void>;
18
+ setValueFromModalSelection(rowId: string): Promise<void>;
19
+ validate(): Promise<boolean>;
20
+ setValue(newValue: any, options?: SetValueOptions): Promise<boolean>;
21
+ protected getSynchronizePostConfiguration(value: ModalInputValue): IApiaApiPostConfig<any>;
22
+ }
23
+
24
+ export { ModalInput };
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,145 @@
1
+ import { shallowEqual } from '@apia/util';
2
+ import { getWindow } from '../../../../../util/dom/getWindow.js';
3
+ import { labels } from '../../../../../util/labels/labels.js';
4
+ import { FieldWithAttribute } from '../../FieldWithAttribute.js';
5
+ import { isFieldShowAsText } from '../../util/isFieldShowAsText.js';
6
+ import { makeObservable, observable } from 'mobx';
7
+ import { post, makeApiaUrl } from '../../../../../util/api/apiaApi.js';
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __publicField = (obj, key, value) => {
12
+ __defNormalProp(obj, key + "" , value);
13
+ return value;
14
+ };
15
+ class ModalInput extends FieldWithAttribute {
16
+ constructor({ value, ...definition }) {
17
+ super({
18
+ ...definition,
19
+ properties: {
20
+ ...definition.properties
21
+ },
22
+ value: { storeValue: value, showValue: definition.qry_show_value }
23
+ });
24
+ __publicField(this, "isLoading", false);
25
+ makeObservable(this, { isLoading: observable });
26
+ }
27
+ fireEvent(eventName, options) {
28
+ return super.fireEvent(eventName, options);
29
+ }
30
+ hasValue() {
31
+ return this.getValue().showValue !== "" && this.getValue().storeValue !== "";
32
+ }
33
+ async setValueFromInputWrite(value) {
34
+ this.isLoading = true;
35
+ try {
36
+ if (isFieldShowAsText(this) || shallowEqual(value, this.getValue().showValue) || value === "")
37
+ return;
38
+ if (value !== this.getValue().showValue) {
39
+ const result = await post(
40
+ this.form.execution,
41
+ makeApiaUrl(this.form.execution, {
42
+ action: "checkModalValue",
43
+ ajaxUrl: "/apia.execution.FormAction.run"
44
+ }),
45
+ {
46
+ postData: {
47
+ frmId: this.form.definition.id,
48
+ frmParent: this.form.definition.frmParent,
49
+ fldId: this.definition.id,
50
+ attId: this.attribute.id,
51
+ qryId: this.definition.qryId,
52
+ index: this.definition.index,
53
+ value
54
+ },
55
+ postDataTreatment: "stringify"
56
+ }
57
+ );
58
+ if (result?.data?.ret_value) {
59
+ const setValueResult = await this.setValue({
60
+ storeValue: result?.data?.ret_value.value,
61
+ showValue: result?.data?.ret_value.show_value
62
+ });
63
+ if (setValueResult) {
64
+ this.fireEvent("onChange");
65
+ }
66
+ this.setError("");
67
+ } else {
68
+ this.setValue({ showValue: "", storeValue: "" });
69
+ this.setError(getWindow(this.form.execution).MSG_VAL_NOT_FOUND);
70
+ }
71
+ }
72
+ } finally {
73
+ this.isLoading = false;
74
+ }
75
+ }
76
+ async setValueFromModalSelection(rowId) {
77
+ this.isLoading = true;
78
+ try {
79
+ const result = await post(
80
+ this.form.execution,
81
+ makeApiaUrl(this.form.execution, {
82
+ ajaxUrl: "/apia.query.ModalAction.run",
83
+ action: "getValues"
84
+ }),
85
+ { postData: { id: rowId }, postDataTreatment: "stringify" }
86
+ );
87
+ if (result?.data?.row?.cell) {
88
+ const setValueResult = await this.setValue({
89
+ storeValue: result.data.row.cell[0],
90
+ showValue: result.data.row.cell[1]
91
+ });
92
+ this.form.execution.setLastModalReturn(result.data.row.cell);
93
+ if (setValueResult) {
94
+ this.fireEvent("onModalReturn");
95
+ this.fireEvent("onChange");
96
+ }
97
+ }
98
+ } finally {
99
+ this.isLoading = false;
100
+ }
101
+ }
102
+ async validate() {
103
+ if (this.state.validation.errorMessage)
104
+ return false;
105
+ const isValid = !!this.getValue().storeValue || !this.properties.required || this.properties.inputAsText || this.properties.visibilityHidden || this.properties.disabled;
106
+ if (!isValid) {
107
+ this.state.validation.errorMessage = labels.errorFieldRequired(
108
+ this.form.execution
109
+ );
110
+ return false;
111
+ }
112
+ return true;
113
+ }
114
+ setValue(newValue, options) {
115
+ if (!options?.force && (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue())))
116
+ return Promise.resolve(true);
117
+ this.state.value = newValue;
118
+ this.state.validation.errorMessage = null;
119
+ if (options?.synchronize === false) {
120
+ this.lastSynchronizationValue = newValue;
121
+ return Promise.resolve(true);
122
+ }
123
+ return this.synchronize(newValue).then((res) => {
124
+ if (res) {
125
+ if (options?.markAsDirty !== false) {
126
+ this.form.execution.state.hasChangedAnything = true;
127
+ }
128
+ return true;
129
+ }
130
+ return Promise.resolve(false);
131
+ });
132
+ }
133
+ getSynchronizePostConfiguration(value) {
134
+ const storeIdValue = this.properties.storeMdlQryResult;
135
+ return {
136
+ ...super.getSynchronizePostConfiguration(value),
137
+ postData: {
138
+ value: storeIdValue ? [this.getValue().storeValue, this.getValue().showValue] : this.getValue().storeValue
139
+ }
140
+ };
141
+ }
142
+ }
143
+
144
+ export { ModalInput };
145
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/ModalInput/index.ts"],"sourcesContent":["import { shallowEqual } from '@apia/util';\r\nimport { makeApiaUrl, post } from '../../../../../util';\r\nimport { IApiaApiPostConfig } from '../../../../../util/api/types';\r\nimport { getWindow } from '../../../../../util/dom/getWindow';\r\nimport { labels } from '../../../../../util/labels/labels';\r\nimport { TApiaInputProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaModalInputDefinition } from '../../../../InitialData/types/fields/TApiaModalInputDefinition';\r\nimport {\r\n FieldWithAttribute,\r\n TFireEventOptions,\r\n} from '../../FieldWithAttribute';\r\nimport { isFieldShowAsText } from '../../util/isFieldShowAsText';\r\nimport { SetValueOptions } from '../../types';\r\nimport { makeObservable, observable } from 'mobx';\r\n\r\ntype InputEvents = 'onChange' | 'onModalReturn';\r\ntype ModalInputValue = { showValue: string; storeValue?: string };\r\n\r\nexport class ModalInput extends FieldWithAttribute<\r\n TApiaInputProperties,\r\n ModalInputValue\r\n> {\r\n isLoading = false;\r\n\r\n constructor({ value, ...definition }: TApiaModalInputDefinition) {\r\n super({\r\n ...definition,\r\n properties: {\r\n ...definition.properties,\r\n },\r\n value: { storeValue: value, showValue: definition.qry_show_value },\r\n });\r\n\r\n makeObservable(this, { isLoading: observable });\r\n }\r\n\r\n fireEvent(\r\n eventName: InputEvents,\r\n options?: TFireEventOptions,\r\n ): Promise<boolean> {\r\n return super.fireEvent(eventName, options);\r\n }\r\n\r\n protected hasValue(): boolean {\r\n return (\r\n this.getValue().showValue !== '' && this.getValue().storeValue !== ''\r\n );\r\n }\r\n\r\n public async setValueFromInputWrite(value: string) {\r\n this.isLoading = true;\r\n try {\r\n if (\r\n isFieldShowAsText(this) ||\r\n shallowEqual(value, this.getValue().showValue) ||\r\n value === ''\r\n )\r\n return;\r\n if (value !== this.getValue().showValue) {\r\n const result = await post<{\r\n ret_value: { show_value: string; value: string };\r\n }>(\r\n this.form.execution,\r\n makeApiaUrl(this.form.execution, {\r\n action: 'checkModalValue',\r\n ajaxUrl: '/apia.execution.FormAction.run',\r\n }),\r\n {\r\n postData: {\r\n frmId: this.form.definition.id,\r\n frmParent: this.form.definition.frmParent,\r\n fldId: this.definition.id,\r\n attId: this.attribute.id,\r\n qryId: this.definition.qryId,\r\n index: this.definition.index,\r\n value,\r\n },\r\n postDataTreatment: 'stringify',\r\n },\r\n );\r\n\r\n if (result?.data?.ret_value) {\r\n const setValueResult = await this.setValue({\r\n storeValue: result?.data?.ret_value.value,\r\n showValue: result?.data?.ret_value.show_value,\r\n });\r\n if (setValueResult) {\r\n this.fireEvent('onChange');\r\n }\r\n this.setError('');\r\n } else {\r\n this.setValue({ showValue: '', storeValue: '' });\r\n this.setError(getWindow(this.form.execution).MSG_VAL_NOT_FOUND);\r\n }\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public async setValueFromModalSelection(rowId: string) {\r\n this.isLoading = true;\r\n\r\n try {\r\n const result = await post<{ row: { cell: string[] } }>(\r\n this.form.execution,\r\n makeApiaUrl(this.form.execution, {\r\n ajaxUrl: '/apia.query.ModalAction.run',\r\n action: 'getValues',\r\n }),\r\n { postData: { id: rowId }, postDataTreatment: 'stringify' },\r\n );\r\n\r\n if (result?.data?.row?.cell) {\r\n const setValueResult = await this.setValue({\r\n storeValue: result.data.row.cell[0],\r\n showValue: result.data.row.cell[1],\r\n });\r\n this.form.execution.setLastModalReturn(result.data.row.cell);\r\n\r\n if (setValueResult) {\r\n this.fireEvent('onModalReturn');\r\n this.fireEvent('onChange');\r\n }\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public async validate(): Promise<boolean> {\r\n if (this.state.validation.errorMessage) return false;\r\n\r\n const isValid =\r\n !!this.getValue().storeValue ||\r\n !this.properties.required ||\r\n this.properties.inputAsText ||\r\n this.properties.visibilityHidden ||\r\n this.properties.disabled;\r\n\r\n if (!isValid) {\r\n this.state.validation.errorMessage = labels.errorFieldRequired(\r\n this.form.execution,\r\n );\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n public setValue(newValue: any, options?: SetValueOptions) {\r\n if (\r\n !options?.force &&\r\n (isFieldShowAsText(this) || shallowEqual(newValue, this.getValue()))\r\n )\r\n return Promise.resolve(true);\r\n\r\n this.state.value = newValue;\r\n this.state.validation.errorMessage = null;\r\n\r\n if (options?.synchronize === false) {\r\n this.lastSynchronizationValue = newValue;\r\n return Promise.resolve(true);\r\n }\r\n\r\n return this.synchronize(newValue).then((res) => {\r\n if (res) {\r\n if (options?.markAsDirty !== false) {\r\n this.form.execution.state.hasChangedAnything = true;\r\n }\r\n return true;\r\n }\r\n return Promise.resolve(false);\r\n });\r\n }\r\n\r\n protected getSynchronizePostConfiguration(\r\n value: ModalInputValue,\r\n ): IApiaApiPostConfig<any> {\r\n const storeIdValue = this.properties.storeMdlQryResult;\r\n\r\n return {\r\n ...super.getSynchronizePostConfiguration(value),\r\n postData: {\r\n value: storeIdValue\r\n ? [this.getValue().storeValue!, this.getValue().showValue]\r\n : this.getValue().storeValue,\r\n },\r\n };\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBO,MAAM,mBAAmB,kBAAA,CAG9B;AAAA,EAGA,WAAA,CAAY,EAAE,KAAA,EAAO,GAAG,YAAW,EAA8B;AAC/D,IAAA,KAAA,CAAM;AAAA,MACJ,GAAG,UAAA;AAAA,MACH,UAAA,EAAY;AAAA,QACV,GAAG,UAAA,CAAW;AAAA,OAChB;AAAA,MACA,OAAO,EAAE,UAAA,EAAY,KAAA,EAAO,SAAA,EAAW,WAAW,cAAA;AAAe,KAClE,CAAA;AATH,IAAA,aAAA,CAAA,IAAA,EAAA,WAAA,EAAY,KAAA,CAAA;AAWV,IAAA,cAAA,CAAe,IAAA,EAAM,EAAE,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA;AAChD,EAEA,SAAA,CACE,WACA,OAAA,EACkB;AAClB,IAAA,OAAO,KAAA,CAAM,SAAA,CAAU,SAAA,EAAW,OAAO,CAAA;AAAA;AAC3C,EAEU,QAAA,GAAoB;AAC5B,IAAA,OACE,IAAA,CAAK,UAAS,CAAE,SAAA,KAAc,MAAM,IAAA,CAAK,QAAA,GAAW,UAAA,KAAe,EAAA;AAAA;AAEvE,EAEA,MAAa,uBAAuB,KAAA,EAAe;AACjD,IAAA,IAAA,CAAK,SAAA,GAAY,IAAA;AACjB,IAAA,IAAI;AACF,MAAA,IACE,iBAAA,CAAkB,IAAI,CAAA,IACtB,YAAA,CAAa,KAAA,EAAO,KAAK,QAAA,EAAS,CAAE,SAA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OAAA,CAAQ,QAAQ,KAAK,CAAA;AAAA,KAC7B,CAAA;AAAA;AACH,EAEU,gCACR,KAAA,EACyB;AACzB,IAAA,MAAM,YAAA,GAAe,KAAK,UAAA,CAAW,iBAAA;AAErC,IAAA,OAAO;AAAA,MACL,GAAG,KAAA,CAAM,+BAAA,CAAgC,KAAK,CAAA;AAAA,MAC9C,QAAA,EAAU;AAAA,QACR,KAAA,EAAO,YAAA,GACH,CAAC,IAAA,CAAK,UAAS,CAAE,UAAA,EAAa,IAAA,CAAK,QAAA,EAAS,CAAE,SAAS,CAAA,GACvD,IAAA,CAAK,UAAS,CAAE;AAAA;AACtB,KACF;AAAA;AAEJ;;;;"}
@@ -0,0 +1,19 @@
1
+ import { TApiaMultipleProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
2
+ import { TApiaMultipleDefinition } from '../../../../InitialData/types/fields/TApiaMultipleDefinition.js';
3
+ import { FieldWithAttribute } from '../../FieldWithAttribute.js';
4
+ import { Comparator } from '../../../../../util/comparators/shallowEqual.js';
5
+
6
+ declare class Multiple extends FieldWithAttribute<TApiaMultipleProperties, string[]> {
7
+ constructor({ possibleValue, value, ...definition }: TApiaMultipleDefinition);
8
+ protected hasValue(): boolean;
9
+ setValue(newValue: string[], options?: Partial<{
10
+ comparator: Comparator<any>;
11
+ format: 'd/m/Y' | 'apia';
12
+ markAsDirty: boolean;
13
+ synchronize: boolean;
14
+ }> | undefined): Promise<boolean>;
15
+ validate(): Promise<boolean>;
16
+ }
17
+
18
+ export { Multiple };
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ import { arrayOrArray } from '@apia/util';
2
+ import { labels } from '../../../../../util/labels/labels.js';
3
+ import { FieldWithAttribute } from '../../FieldWithAttribute.js';
4
+
5
+ class Multiple extends FieldWithAttribute {
6
+ constructor({
7
+ possibleValue,
8
+ value,
9
+ ...definition
10
+ }) {
11
+ super({
12
+ ...{
13
+ ...definition,
14
+ value: arrayOrArray(possibleValue).filter((c) => c.selected).map((c) => c.value)
15
+ },
16
+ properties: {
17
+ ...definition.properties,
18
+ possibleValue: arrayOrArray(possibleValue)
19
+ }
20
+ });
21
+ }
22
+ hasValue() {
23
+ return this.state.value.length > 0;
24
+ }
25
+ setValue(newValue, options) {
26
+ return super.setValue(arrayOrArray(newValue), options);
27
+ }
28
+ async validate() {
29
+ if (this.state.validation.dirty) {
30
+ if (!await this.synchronize(this.state.value)) {
31
+ this.state.validation.errorMessage = labels.errorCouldNotSync();
32
+ return false;
33
+ }
34
+ }
35
+ const isValid = !!this.getValue()[0] || !this.properties.required || this.properties.inputAsText || this.properties.visibilityHidden || this.properties.disabled;
36
+ this.state.validation.errorMessage = isValid ? null : labels.errorFieldRequired(this.form.execution);
37
+ return !this.state.validation.errorMessage;
38
+ }
39
+ }
40
+
41
+ export { Multiple };
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Multiple/index.ts"],"sourcesContent":["import { arrayOrArray } from '@apia/util';\r\nimport { labels } from '../../../../../util/labels/labels';\r\nimport { TApiaMultipleProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaMultipleDefinition } from '../../../../InitialData/types/fields/TApiaMultipleDefinition';\r\nimport { FieldWithAttribute } from '../../FieldWithAttribute';\r\nimport { Comparator } from '../../../../../util/comparators/shallowEqual';\r\n\r\nexport class Multiple extends FieldWithAttribute<\r\n TApiaMultipleProperties,\r\n string[]\r\n> {\r\n constructor({\r\n possibleValue,\r\n value,\r\n ...definition\r\n }: TApiaMultipleDefinition) {\r\n super({\r\n ...{\r\n ...definition,\r\n value: arrayOrArray(possibleValue)\r\n .filter((c) => c.selected)\r\n .map((c) => c.value),\r\n },\r\n properties: {\r\n ...definition.properties,\r\n possibleValue: arrayOrArray(possibleValue),\r\n },\r\n });\r\n }\r\n\r\n protected hasValue() {\r\n return this.state.value.length > 0;\r\n }\r\n\r\n public setValue(\r\n newValue: string[],\r\n options?:\r\n | Partial<{\r\n comparator: Comparator<any>;\r\n format: 'd/m/Y' | 'apia';\r\n markAsDirty: boolean;\r\n synchronize: boolean;\r\n }>\r\n | undefined,\r\n ): Promise<boolean> {\r\n return super.setValue(arrayOrArray(newValue), options);\r\n }\r\n\r\n public async validate(): Promise<boolean> {\r\n if (this.state.validation.dirty) {\r\n if (!(await this.synchronize(this.state.value))) {\r\n this.state.validation.errorMessage = labels.errorCouldNotSync();\r\n return false;\r\n }\r\n }\r\n\r\n const isValid =\r\n !!this.getValue()[0] ||\r\n !this.properties.required ||\r\n this.properties.inputAsText ||\r\n this.properties.visibilityHidden ||\r\n this.properties.disabled;\r\n\r\n this.state.validation.errorMessage = isValid\r\n ? null\r\n : labels.errorFieldRequired(this.form.execution);\r\n\r\n return !this.state.validation.errorMessage;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;AAOO,MAAM,iBAAiB,kBAAA,CAG5B;AAAA,EACA,WAAA,CAAY;AAAA,IACV,aAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG;AAAA,GACL,EAA4B;AAC1B,IAAA,KAAA,CAAM;AAAA,MACJ,GAAG;AAAA,QACD,GAAG,UAAA;AAAA,QACH,KAAA,EAAO,YAAA,CAAa,aAAa,CAAA,CAC9B,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAQ,CAAA,CACxB,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,KAAK;AAAA,OACvB;AAAA,MACA,UAAA,EAAY;AAAA,QACV,GAAG,UAAA,CAAW,UAAA;AAAA,QACd,aAAA,EAAe,aAAa,aAAa;AAAA;AAC3C,KACD,CAAA;AAAA;AACH,EAEU,QAAA,GAAW;AACnB,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,KAAA,CAAM,MAAA,GAAS,CAAA;AAAA;AACnC,EAEO,QAAA,CACL,UACA,OAAA,EAQkB;AAClB,IAAA,OAAO,KAAA,CAAM,QAAA,CAAS,YAAA,CAAa,QAAQ,GAAG,OAAO,CAAA;AAAA;AACvD,EAEA,MAAa,QAAA,GAA6B;AACxC,IAAA,IAAI,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,KAAA,EAAO;AAC/B,MAAA,IAAI,CAAE,MAAM,IAAA,CAAK,YAAY,IAAA,CAAK,KAAA,CAAM,KAAK,CAAA,EAAI;AAC/C,QAAA,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,YAAA,GAAe,MAAA,CAAO,iBAAA,EAAkB;AAC9D,QAAA,OAAO,KAAA;AAAA;AACT;AAGF,IAAA,MAAM,UACJ,CAAC,CAAC,KAAK,QAAA,EAAS,CAAE,CAAC,CAAA,IACnB,CAAC,KAAK,UAAA,CAAW,QAAA,IACjB,KAAK,UAAA,CAAW,WAAA,IAChB,KAAK,UAAA,CAAW,gBAAA,IAChB,KAAK,UAAA,CAAW,QAAA;AAElB,IAAA,IAAA,CAAK,KAAA,CAAM,WAAW,YAAA,GAAe,OAAA,GACjC,OACA,MAAA,CAAO,kBAAA,CAAmB,IAAA,CAAK,IAAA,CAAK,SAAS,CAAA;AAEjD,IAAA,OAAO,CAAC,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,YAAA;AAAA;AAElC;;;;"}
@@ -0,0 +1,9 @@
1
+ import { TApiaPasswordProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
2
+ import { FieldWithAttribute } from '../../FieldWithAttribute.js';
3
+
4
+ declare class Password extends FieldWithAttribute<TApiaPasswordProperties, string> {
5
+ protected isValidValue(): boolean;
6
+ }
7
+
8
+ export { Password };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { FieldWithAttribute } from '../../FieldWithAttribute.js';
2
+
3
+ class Password extends FieldWithAttribute {
4
+ isValidValue() {
5
+ return !!String(this.getValue()).trim();
6
+ }
7
+ }
8
+
9
+ export { Password };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Password/index.ts"],"sourcesContent":["import { TApiaPasswordProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { FieldWithAttribute } from '../../FieldWithAttribute';\r\n\r\nexport class Password extends FieldWithAttribute<\r\n TApiaPasswordProperties,\r\n string\r\n> {\r\n protected isValidValue(): boolean {\r\n return !!String(this.getValue()).trim();\r\n }\r\n}\r\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB,kBAAA,CAG5B;AAAA,EACU,YAAA,GAAwB;AAChC,IAAA,OAAO,CAAC,CAAC,MAAA,CAAO,KAAK,QAAA,EAAU,EAAE,IAAA,EAAK;AAAA;AAE1C;;;;"}
@@ -0,0 +1,15 @@
1
+ import { TApiaRadioProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
2
+ import { TApiaRadioButtonDefinition } from '../../../../InitialData/types/fields/TApiaRadioButtonDefinition.js';
3
+ import { Form } from '../../Form.js';
4
+ import { FieldWithAttribute, TFireEventOptions } from '../../FieldWithAttribute.js';
5
+
6
+ type RadioEvents = 'onPopulate' | 'onChange' | 'onClick';
7
+ declare class Radio extends FieldWithAttribute<TApiaRadioProperties, number | string, TApiaRadioButtonDefinition> {
8
+ constructor({ possibleValue, ...definition }: TApiaRadioButtonDefinition);
9
+ init(form: Form): Promise<void>;
10
+ fireEvent(eventName: RadioEvents, options?: TFireEventOptions): Promise<boolean>;
11
+ getTextValue(value: any): any;
12
+ }
13
+
14
+ export { Radio };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { FieldWithAttribute } from '../../FieldWithAttribute.js';
2
+ import { arrayOrArray } from '@apia/util';
3
+
4
+ class Radio extends FieldWithAttribute {
5
+ constructor({ possibleValue, ...definition }) {
6
+ super({
7
+ ...definition,
8
+ properties: { ...definition.properties, possibleValue }
9
+ });
10
+ }
11
+ async init(form) {
12
+ await super.init(form);
13
+ await this.fireEvent("onPopulate");
14
+ }
15
+ fireEvent(eventName, options) {
16
+ return super.fireEvent(eventName, options);
17
+ }
18
+ getTextValue(value) {
19
+ return this.properties.possibleValue ? arrayOrArray(this.properties.possibleValue).find(
20
+ (c) => c.value === value
21
+ )?.label : value;
22
+ }
23
+ }
24
+
25
+ export { Radio };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/main/Execution/FormsExecution/fields/Radio/index.ts"],"sourcesContent":["import { TApiaRadioProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties';\r\nimport { TApiaRadioButtonDefinition } from '../../../../InitialData/types/fields/TApiaRadioButtonDefinition';\r\nimport { Form } from '../../Form';\r\nimport {\r\n FieldWithAttribute,\r\n TFireEventOptions,\r\n} from '../../FieldWithAttribute';\r\nimport { arrayOrArray } from '@apia/util';\r\n\r\ntype RadioEvents = 'onPopulate' | 'onChange' | 'onClick';\r\n\r\nexport class Radio extends FieldWithAttribute<\r\n TApiaRadioProperties,\r\n number | string,\r\n TApiaRadioButtonDefinition\r\n> {\r\n constructor({ possibleValue, ...definition }: TApiaRadioButtonDefinition) {\r\n super({\r\n ...definition,\r\n properties: { ...definition.properties, possibleValue },\r\n });\r\n }\r\n\r\n async init(form: Form): Promise<void> {\r\n await super.init(form);\r\n\r\n await this.fireEvent('onPopulate');\r\n }\r\n\r\n fireEvent(\r\n eventName: RadioEvents,\r\n options?: TFireEventOptions,\r\n ): Promise<boolean> {\r\n return super.fireEvent(eventName, options);\r\n }\r\n\r\n public getTextValue(value: any) {\r\n return this.properties.possibleValue\r\n ? arrayOrArray(this.properties.possibleValue).find(\r\n (c) => c.value === value,\r\n )?.label\r\n : value;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAWO,MAAM,cAAc,kBAAA,CAIzB;AAAA,EACA,WAAA,CAAY,EAAE,aAAA,EAAe,GAAG,YAAW,EAA+B;AACxE,IAAA,KAAA,CAAM;AAAA,MACJ,GAAG,UAAA;AAAA,MACH,UAAA,EAAY,EAAE,GAAG,UAAA,CAAW,YAAY,aAAA;AAAc,KACvD,CAAA;AAAA;AACH,EAEA,MAAM,KAAK,IAAA,EAA2B;AACpC,IAAA,MAAM,KAAA,CAAM,KAAK,IAAI,CAAA;AAErB,IAAA,MAAM,IAAA,CAAK,UAAU,YAAY,CAAA;AAAA;AACnC,EAEA,SAAA,CACE,WACA,OAAA,EACkB;AAClB,IAAA,OAAO,KAAA,CAAM,SAAA,CAAU,SAAA,EAAW,OAAO,CAAA;AAAA;AAC3C,EAEO,aAAa,KAAA,EAAY;AAC9B,IAAA,OAAO,KAAK,UAAA,CAAW,aAAA,GACnB,aAAa,IAAA,CAAK,UAAA,CAAW,aAAa,CAAA,CAAE,IAAA;AAAA,MAC1C,CAAC,CAAA,KAAM,CAAA,CAAE,KAAA,KAAU;AAAA,OAClB,KAAA,GACH,KAAA;AAAA;AAER;;;;"}
@@ -0,0 +1,36 @@
1
+ import * as _apia_scheduler_controller from '@apia/scheduler-controller';
2
+ import { TScheduleResult, TTskSchDay, Scheduler } from '@apia/scheduler-controller';
3
+ import { ResponseSysMessages } from '../../../../../util/api/types.js';
4
+ import { TApiaSchedulerProperties } from '../../../../InitialData/types/fields/TApiaFieldProperties.js';
5
+ import { TApiaFieldBaseDefinition } from '../../../../InitialData/types/TApiaField.js';
6
+ import { Field } from '../../Field.js';
7
+ import { Form } from '../../Form.js';
8
+
9
+ declare class SchedulerField extends Field<TApiaSchedulerProperties> {
10
+ private _schedController;
11
+ constructor(definition: TApiaFieldBaseDefinition<TApiaSchedulerProperties>);
12
+ deleteDate(): Promise<boolean>;
13
+ get parsedInitialProperties(): {
14
+ schId: string;
15
+ proId: string;
16
+ proVerId: string;
17
+ tskId: string;
18
+ showDisponibility: string;
19
+ showAttributes: string;
20
+ };
21
+ init(form: Form): Promise<void>;
22
+ loadWeek(weekDay: string, schId: string, proId: string, proVerId: string, tskId: string): Promise<(TScheduleResult & ResponseSysMessages) | null>;
23
+ loadInfo(schId: string, weekDay: string, dayNumber: number, hour: string): Promise<_apia_scheduler_controller.TProcesses>;
24
+ markDay(weekDay: string, hour: string, dayNumber: number): Promise<void>;
25
+ selectDayHandler({ cellId, currentDayDefinition, dayNumber, hour, weekDay, }: {
26
+ cellId: string;
27
+ weekDay: string;
28
+ dayNumber: number;
29
+ hour: string;
30
+ currentDayDefinition: TTskSchDay;
31
+ }): Promise<void>;
32
+ get schedController(): Scheduler | undefined;
33
+ }
34
+
35
+ export { SchedulerField };
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}