@beinformed/ui 1.20.8 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1107) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/esm/builder/mergeLayoutHintConfigurations.js +34 -59
  3. package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
  4. package/esm/constants/Constants.js +37 -37
  5. package/esm/constants/Constants.js.map +1 -1
  6. package/esm/constants/LayoutHintConfig.js +1 -1
  7. package/esm/constants/LayoutHintConfig.js.map +1 -1
  8. package/esm/constants/LayoutHints.js +20 -22
  9. package/esm/constants/LayoutHints.js.map +1 -1
  10. package/esm/constants/Settings.js +14 -26
  11. package/esm/constants/Settings.js.map +1 -1
  12. package/esm/exceptions/ConfigurationException.js +5 -27
  13. package/esm/exceptions/ConfigurationException.js.map +1 -1
  14. package/esm/exceptions/FetchException.js +33 -65
  15. package/esm/exceptions/FetchException.js.map +1 -1
  16. package/esm/exceptions/IllegalArgumentException.js +5 -27
  17. package/esm/exceptions/IllegalArgumentException.js.map +1 -1
  18. package/esm/exceptions/IllegalReturnException.js +5 -27
  19. package/esm/exceptions/IllegalReturnException.js.map +1 -1
  20. package/esm/exceptions/IllegalStateException.js +5 -27
  21. package/esm/exceptions/IllegalStateException.js.map +1 -1
  22. package/esm/exceptions/JsonParseException.js +5 -27
  23. package/esm/exceptions/JsonParseException.js.map +1 -1
  24. package/esm/exceptions/MissingPropertyException.js +5 -27
  25. package/esm/exceptions/MissingPropertyException.js.map +1 -1
  26. package/esm/exceptions/NetworkException.js +9 -31
  27. package/esm/exceptions/NetworkException.js.map +1 -1
  28. package/esm/exceptions/NotAllowedUriException.js +5 -27
  29. package/esm/exceptions/NotAllowedUriException.js.map +1 -1
  30. package/esm/exceptions/NotFoundException.js +12 -35
  31. package/esm/exceptions/NotFoundException.js.map +1 -1
  32. package/esm/exceptions/ServerRequestException.js +5 -27
  33. package/esm/exceptions/ServerRequestException.js.map +1 -1
  34. package/esm/exceptions/ThemePropertyException.js +5 -27
  35. package/esm/exceptions/ThemePropertyException.js.map +1 -1
  36. package/esm/exceptions/TimeoutException.js +5 -26
  37. package/esm/exceptions/TimeoutException.js.map +1 -1
  38. package/esm/exceptions/UnauthorizedException.js +11 -33
  39. package/esm/exceptions/UnauthorizedException.js.map +1 -1
  40. package/esm/exceptions/UnsupportedOperationException.js +5 -27
  41. package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
  42. package/esm/hooks/useAllFormsOnModel.js +25 -46
  43. package/esm/hooks/useAllFormsOnModel.js.map +1 -1
  44. package/esm/hooks/useAuthentication.js +20 -26
  45. package/esm/hooks/useAuthentication.js.map +1 -1
  46. package/esm/hooks/useContent.js +13 -24
  47. package/esm/hooks/useContent.js.map +1 -1
  48. package/esm/hooks/useDeepCompareEffect.js +3 -3
  49. package/esm/hooks/useDeepCompareEffect.js.map +1 -1
  50. package/esm/hooks/useForm.js +27 -45
  51. package/esm/hooks/useForm.js.map +1 -1
  52. package/esm/hooks/useI18n.js +9 -19
  53. package/esm/hooks/useI18n.js.map +1 -1
  54. package/esm/hooks/useModal.js +11 -11
  55. package/esm/hooks/useModal.js.map +1 -1
  56. package/esm/hooks/useModelCatalog.js +24 -30
  57. package/esm/hooks/useModelCatalog.js.map +1 -1
  58. package/esm/hooks/useModels.js +3 -3
  59. package/esm/hooks/useModels.js.map +1 -1
  60. package/esm/hooks/useModularUI.js +17 -16
  61. package/esm/hooks/useModularUI.js.map +1 -1
  62. package/esm/hooks/useModularUIBasic.js +9 -7
  63. package/esm/hooks/useModularUIBasic.js.map +1 -1
  64. package/esm/hooks/useModularUIModel.js +39 -59
  65. package/esm/hooks/useModularUIModel.js.map +1 -1
  66. package/esm/hooks/useModularUIRequest.js +4 -6
  67. package/esm/hooks/useModularUIRequest.js.map +1 -1
  68. package/esm/hooks/useNotification.js +16 -21
  69. package/esm/hooks/useNotification.js.map +1 -1
  70. package/esm/hooks/usePreference.js +3 -5
  71. package/esm/hooks/usePreference.js.map +1 -1
  72. package/esm/hooks/useProgressIndicator.js +9 -30
  73. package/esm/hooks/useProgressIndicator.js.map +1 -1
  74. package/esm/hooks/useRouter.js +12 -26
  75. package/esm/hooks/useRouter.js.map +1 -1
  76. package/esm/i18n/Locale.js +96 -135
  77. package/esm/i18n/Locale.js.map +1 -1
  78. package/esm/i18n/Locales.js +94 -148
  79. package/esm/i18n/Locales.js.map +1 -1
  80. package/esm/i18n/Message.js +13 -24
  81. package/esm/i18n/Message.js.map +1 -1
  82. package/esm/i18n/languages.js +1 -1
  83. package/esm/i18n/languages.js.map +1 -1
  84. package/esm/i18n/withMessage.js +10 -16
  85. package/esm/i18n/withMessage.js.map +1 -1
  86. package/esm/models/actions/ActionCollection.js +55 -100
  87. package/esm/models/actions/ActionCollection.js.map +1 -1
  88. package/esm/models/actions/ActionModel.js +165 -204
  89. package/esm/models/actions/ActionModel.js.map +1 -1
  90. package/esm/models/application/ApplicationModel.js +104 -153
  91. package/esm/models/application/ApplicationModel.js.map +1 -1
  92. package/esm/models/attributes/AttributeCollection.js +246 -331
  93. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  94. package/esm/models/attributes/AttributeContent.js +181 -246
  95. package/esm/models/attributes/AttributeContent.js.map +1 -1
  96. package/esm/models/attributes/AttributeDataHelper.js +208 -251
  97. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  98. package/esm/models/attributes/AttributeModel.js +832 -941
  99. package/esm/models/attributes/AttributeModel.js.map +1 -1
  100. package/esm/models/attributes/AttributeSetModel.js +46 -77
  101. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  102. package/esm/models/attributes/BooleanAttributeModel.js +259 -325
  103. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  104. package/esm/models/attributes/CaptchaAttributeModel.js +24 -55
  105. package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
  106. package/esm/models/attributes/ChoiceAttributeModel.js +337 -424
  107. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  108. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +271 -361
  109. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  110. package/esm/models/attributes/ChoiceAttributeOptionModel.js +297 -351
  111. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  112. package/esm/models/attributes/CompositeAttributeChildCollection.js +180 -257
  113. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  114. package/esm/models/attributes/CompositeAttributeModel.js +326 -401
  115. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  116. package/esm/models/attributes/DatetimeAttributeModel.js +368 -419
  117. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  118. package/esm/models/attributes/HelptextAttributeModel.js +38 -70
  119. package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
  120. package/esm/models/attributes/LabelAttributeModel.js +23 -54
  121. package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
  122. package/esm/models/attributes/MemoAttributeModel.js +31 -63
  123. package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
  124. package/esm/models/attributes/MoneyAttributeModel.js +30 -62
  125. package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
  126. package/esm/models/attributes/NumberAttributeModel.js +178 -225
  127. package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
  128. package/esm/models/attributes/PasswordAttributeModel.js +197 -246
  129. package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
  130. package/esm/models/attributes/StringAttributeModel.js +234 -282
  131. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  132. package/esm/models/attributes/UploadAttributeModel.js +181 -238
  133. package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
  134. package/esm/models/attributes/XMLAttributeModel.js +32 -64
  135. package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
  136. package/esm/models/attributes/_createAttribute.js +21 -36
  137. package/esm/models/attributes/_createAttribute.js.map +1 -1
  138. package/esm/models/attributes/input-constraints/BSNConstraint.js +63 -81
  139. package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  140. package/esm/models/attributes/input-constraints/ConstraintCollection.js +29 -66
  141. package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  142. package/esm/models/attributes/input-constraints/ConstraintModel.js +44 -59
  143. package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  144. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +170 -192
  145. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  146. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +52 -67
  147. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  148. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +52 -67
  149. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  150. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +66 -83
  151. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  152. package/esm/models/attributes/input-constraints/FileExtensionConstraint.js +53 -69
  153. package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  154. package/esm/models/attributes/input-constraints/FileSizeConstraint.js +78 -94
  155. package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  156. package/esm/models/attributes/input-constraints/IBANConstraint.js +35 -51
  157. package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  158. package/esm/models/attributes/input-constraints/MandatoryConstraint.js +39 -57
  159. package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  160. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js +62 -81
  161. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  162. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +149 -171
  163. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  164. package/esm/models/attributes/input-constraints/NumberFormatConstraint.js +104 -124
  165. package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  166. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +91 -113
  167. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  168. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js +58 -73
  169. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  170. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +35 -52
  171. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  172. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +51 -65
  173. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  174. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +51 -65
  175. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  176. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +65 -83
  177. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  178. package/esm/models/attributes/input-constraints/RangeConstraint.js +115 -134
  179. package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  180. package/esm/models/attributes/input-constraints/RegexConstraint.js +47 -61
  181. package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  182. package/esm/models/attributes/input-constraints/StringLengthConstraint.js +157 -176
  183. package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  184. package/esm/models/attributes/input-constraints/XMLConstraint.js +48 -66
  185. package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  186. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js +49 -64
  187. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  188. package/esm/models/attributes/layouthint-rules/DependentAttribute.js +167 -209
  189. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  190. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +40 -68
  191. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  192. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +30 -59
  193. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  194. package/esm/models/base/BaseCollection.js +169 -203
  195. package/esm/models/base/BaseCollection.js.map +1 -1
  196. package/esm/models/base/BaseModel.js +97 -112
  197. package/esm/models/base/BaseModel.js.map +1 -1
  198. package/esm/models/base/ResourceCollection.js +27 -55
  199. package/esm/models/base/ResourceCollection.js.map +1 -1
  200. package/esm/models/base/ResourceModel.js +167 -217
  201. package/esm/models/base/ResourceModel.js.map +1 -1
  202. package/esm/models/caseview/CaseViewModel.js +132 -180
  203. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  204. package/esm/models/concepts/BusinessScenarioModel.js +98 -147
  205. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  206. package/esm/models/concepts/ConceptDetailModel.js +239 -316
  207. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  208. package/esm/models/concepts/ConceptIndexModel.js +114 -150
  209. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  210. package/esm/models/concepts/ConceptLinkModel.js +118 -158
  211. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  212. package/esm/models/concepts/ConceptRelationCollection.js +56 -103
  213. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  214. package/esm/models/concepts/ConceptRelationModel.js +60 -75
  215. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  216. package/esm/models/concepts/ConceptTypeDetailModel.js +89 -126
  217. package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  218. package/esm/models/concepts/SourceReferenceCollection.js +11 -42
  219. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  220. package/esm/models/concepts/SourceReferenceModel.js +47 -70
  221. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  222. package/esm/models/content/ContentIndexModel.js +108 -150
  223. package/esm/models/content/ContentIndexModel.js.map +1 -1
  224. package/esm/models/content/ContentLinkModel.js +157 -199
  225. package/esm/models/content/ContentLinkModel.js.map +1 -1
  226. package/esm/models/content/ContentModel.js +184 -228
  227. package/esm/models/content/ContentModel.js.map +1 -1
  228. package/esm/models/content/ContentTOCModel.js +132 -196
  229. package/esm/models/content/ContentTOCModel.js.map +1 -1
  230. package/esm/models/content/ContentTypeModel.js +58 -93
  231. package/esm/models/content/ContentTypeModel.js.map +1 -1
  232. package/esm/models/content/SectionModel.js +161 -247
  233. package/esm/models/content/SectionModel.js.map +1 -1
  234. package/esm/models/content/SubSectionModel.js +122 -188
  235. package/esm/models/content/SubSectionModel.js.map +1 -1
  236. package/esm/models/contentconfiguration/ContentConfiguration.js +44 -58
  237. package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  238. package/esm/models/contentconfiguration/ContentConfigurationElements.js +123 -162
  239. package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  240. package/esm/models/contentconfiguration/ContentConfigurationEndResults.js +24 -38
  241. package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  242. package/esm/models/contentconfiguration/ContentConfigurationQuestions.js +30 -41
  243. package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  244. package/esm/models/contentconfiguration/ContentConfigurationResults.js +73 -95
  245. package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  246. package/esm/models/detail/DetailModel.js +174 -225
  247. package/esm/models/detail/DetailModel.js.map +1 -1
  248. package/esm/models/error/ErrorCollection.js +79 -132
  249. package/esm/models/error/ErrorCollection.js.map +1 -1
  250. package/esm/models/error/ErrorModel.js +48 -49
  251. package/esm/models/error/ErrorModel.js.map +1 -1
  252. package/esm/models/error/ErrorResponse.js +285 -203
  253. package/esm/models/error/ErrorResponse.js.map +1 -1
  254. package/esm/models/filters/AssignmentFilterModel.js +142 -186
  255. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  256. package/esm/models/filters/BaseFilterModel.js +170 -220
  257. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  258. package/esm/models/filters/ConceptIndexFilterModel.js +8 -36
  259. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  260. package/esm/models/filters/FilterCollection.js +106 -165
  261. package/esm/models/filters/FilterCollection.js.map +1 -1
  262. package/esm/models/filters/FilterModel.js +1 -26
  263. package/esm/models/filters/FilterModel.js.map +1 -1
  264. package/esm/models/filters/RangeFilterModel.js +29 -58
  265. package/esm/models/filters/RangeFilterModel.js.map +1 -1
  266. package/esm/models/form/FormModel.js +957 -1133
  267. package/esm/models/form/FormModel.js.map +1 -1
  268. package/esm/models/form/FormObjectModel.js +412 -506
  269. package/esm/models/form/FormObjectModel.js.map +1 -1
  270. package/esm/models/grouping/GroupingModel.js +115 -163
  271. package/esm/models/grouping/GroupingModel.js.map +1 -1
  272. package/esm/models/href/Href.js +391 -450
  273. package/esm/models/href/Href.js.map +1 -1
  274. package/esm/models/href/ListHref.js +116 -155
  275. package/esm/models/href/ListHref.js.map +1 -1
  276. package/esm/models/layouthint/LayoutHintCollection.js +91 -136
  277. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  278. package/esm/models/links/LinkCollection.js +127 -185
  279. package/esm/models/links/LinkCollection.js.map +1 -1
  280. package/esm/models/links/LinkModel.js +189 -228
  281. package/esm/models/links/LinkModel.js.map +1 -1
  282. package/esm/models/links/normalizeLinkJSON.js +30 -57
  283. package/esm/models/links/normalizeLinkJSON.js.map +1 -1
  284. package/esm/models/list/ListDetailModel.js +226 -289
  285. package/esm/models/list/ListDetailModel.js.map +1 -1
  286. package/esm/models/list/ListHeaderModel.js +74 -97
  287. package/esm/models/list/ListHeaderModel.js.map +1 -1
  288. package/esm/models/list/ListItemCollection.js +49 -85
  289. package/esm/models/list/ListItemCollection.js.map +1 -1
  290. package/esm/models/list/ListItemModel.js +73 -110
  291. package/esm/models/list/ListItemModel.js.map +1 -1
  292. package/esm/models/list/ListModel.js +342 -421
  293. package/esm/models/list/ListModel.js.map +1 -1
  294. package/esm/models/lookup/LookupOptionCollection.js +15 -51
  295. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  296. package/esm/models/lookup/LookupOptionsModel.js +42 -71
  297. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  298. package/esm/models/modelcatalog/ModelCatalogModel.js +35 -67
  299. package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  300. package/esm/models/paging/PagesizeModel.js +31 -42
  301. package/esm/models/paging/PagesizeModel.js.map +1 -1
  302. package/esm/models/paging/PagingModel.js +77 -94
  303. package/esm/models/paging/PagingModel.js.map +1 -1
  304. package/esm/models/panels/GroupingPanelModel.js +116 -160
  305. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  306. package/esm/models/parameter/Parameter.js +82 -97
  307. package/esm/models/parameter/Parameter.js.map +1 -1
  308. package/esm/models/process/ProcessStatusSettingsModel.js +63 -100
  309. package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
  310. package/esm/models/resolveModel.js +3 -5
  311. package/esm/models/resolveModel.js.map +1 -1
  312. package/esm/models/search/CaseSearchModel.js +23 -56
  313. package/esm/models/search/CaseSearchModel.js.map +1 -1
  314. package/esm/models/sorting/SortOptionModel.js +76 -90
  315. package/esm/models/sorting/SortOptionModel.js.map +1 -1
  316. package/esm/models/sorting/SortingModel.js +86 -134
  317. package/esm/models/sorting/SortingModel.js.map +1 -1
  318. package/esm/models/tab/TabModel.js +118 -163
  319. package/esm/models/tab/TabModel.js.map +1 -1
  320. package/esm/models/taskgroup/TaskGroupCollection.js +7 -37
  321. package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
  322. package/esm/models/taskgroup/TaskGroupModel.js +51 -83
  323. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  324. package/esm/models/types.js.map +1 -1
  325. package/esm/models/user/UserModel.js +29 -61
  326. package/esm/models/user/UserModel.js.map +1 -1
  327. package/esm/models/user/UserProfileModel.js +19 -50
  328. package/esm/models/user/UserProfileModel.js.map +1 -1
  329. package/esm/models/user/UserServicesModel.js +79 -123
  330. package/esm/models/user/UserServicesModel.js.map +1 -1
  331. package/esm/modularui/Authenticate.js +143 -156
  332. package/esm/modularui/Authenticate.js.map +1 -1
  333. package/esm/modularui/ModularUIError.js +9 -32
  334. package/esm/modularui/ModularUIError.js.map +1 -1
  335. package/esm/modularui/ModularUIRequest.js +476 -630
  336. package/esm/modularui/ModularUIRequest.js.map +1 -1
  337. package/esm/modularui/ModularUIResponse.js +104 -119
  338. package/esm/modularui/ModularUIResponse.js.map +1 -1
  339. package/esm/react/ErrorBoundary.js +32 -65
  340. package/esm/react/ErrorBoundary.js.map +1 -1
  341. package/esm/react/ErrorBoundaryFallback.js +8 -6
  342. package/esm/react/ErrorBoundaryFallback.js.map +1 -1
  343. package/esm/react/utils.js +12 -15
  344. package/esm/react/utils.js.map +1 -1
  345. package/esm/react-client/Init.js +9 -7
  346. package/esm/react-client/Init.js.map +1 -1
  347. package/esm/react-client/client.js +21 -22
  348. package/esm/react-client/client.js.map +1 -1
  349. package/esm/react-client/contextPath.js +4 -4
  350. package/esm/react-client/contextPath.js.map +1 -1
  351. package/esm/react-client/rehydrate.js +14 -21
  352. package/esm/react-client/rehydrate.js.map +1 -1
  353. package/esm/react-server/createSSRComplete.js +10 -14
  354. package/esm/react-server/createSSRComplete.js.map +1 -1
  355. package/esm/react-server/htmlpage.js +5 -8
  356. package/esm/react-server/htmlpage.js.map +1 -1
  357. package/esm/react-server/renderSSRComplete.js +50 -55
  358. package/esm/react-server/renderSSRComplete.js.map +1 -1
  359. package/esm/react-server/renderSSRMinimal.js +13 -13
  360. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  361. package/esm/react-server/requestInformation.js +8 -10
  362. package/esm/react-server/requestInformation.js.map +1 -1
  363. package/esm/react-server/serverNoSSR.js +22 -21
  364. package/esm/react-server/serverNoSSR.js.map +1 -1
  365. package/esm/react-server/serverSSR.js +24 -24
  366. package/esm/react-server/serverSSR.js.map +1 -1
  367. package/esm/react-server/serverUtil.js +45 -61
  368. package/esm/react-server/serverUtil.js.map +1 -1
  369. package/esm/react-theme/ThemeProvider.js +10 -7
  370. package/esm/react-theme/ThemeProvider.js.map +1 -1
  371. package/esm/react-theme/createTheme.js +15 -35
  372. package/esm/react-theme/createTheme.js.map +1 -1
  373. package/esm/react-theme/useTheme.js +1 -1
  374. package/esm/react-theme/useTheme.js.map +1 -1
  375. package/esm/react-theme/utils/background.js +9 -9
  376. package/esm/react-theme/utils/background.js.map +1 -1
  377. package/esm/react-theme/utils/colors.js +12 -12
  378. package/esm/react-theme/utils/colors.js.map +1 -1
  379. package/esm/react-theme/utils/contrast.js +27 -27
  380. package/esm/react-theme/utils/contrast.js.map +1 -1
  381. package/esm/react-theme/utils/corners.js +10 -9
  382. package/esm/react-theme/utils/corners.js.map +1 -1
  383. package/esm/react-theme/utils/spacers.js +23 -22
  384. package/esm/react-theme/utils/spacers.js.map +1 -1
  385. package/esm/react-theme/utils/themeProps.js +28 -29
  386. package/esm/react-theme/utils/themeProps.js.map +1 -1
  387. package/esm/redux/_i18n/actions.js +15 -21
  388. package/esm/redux/_i18n/actions.js.map +1 -1
  389. package/esm/redux/_i18n/reducer.js +20 -29
  390. package/esm/redux/_i18n/reducer.js.map +1 -1
  391. package/esm/redux/_modularui/actions.js +40 -67
  392. package/esm/redux/_modularui/actions.js.map +1 -1
  393. package/esm/redux/_modularui/connector.js +46 -50
  394. package/esm/redux/_modularui/connector.js.map +1 -1
  395. package/esm/redux/_modularui/middleware.js +23 -36
  396. package/esm/redux/_modularui/middleware.js.map +1 -1
  397. package/esm/redux/_modularui/modularuiUtils.js +16 -23
  398. package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
  399. package/esm/redux/_modularui/reducer.js +42 -53
  400. package/esm/redux/_modularui/reducer.js.map +1 -1
  401. package/esm/redux/_modularui/selectors.js +89 -99
  402. package/esm/redux/_modularui/selectors.js.map +1 -1
  403. package/esm/redux/_modularui/withModularUI.js +15 -19
  404. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  405. package/esm/redux/_router/actions.js +29 -39
  406. package/esm/redux/_router/actions.js.map +1 -1
  407. package/esm/redux/_router/connectors.js +12 -14
  408. package/esm/redux/_router/connectors.js.map +1 -1
  409. package/esm/redux/_router/middleware.js +27 -29
  410. package/esm/redux/_router/middleware.js.map +1 -1
  411. package/esm/redux/_router/reducer.js +4 -4
  412. package/esm/redux/_router/reducer.js.map +1 -1
  413. package/esm/redux/actions/Application.js +9 -32
  414. package/esm/redux/actions/Application.js.map +1 -1
  415. package/esm/redux/actions/Authorization.js +31 -33
  416. package/esm/redux/actions/Authorization.js.map +1 -1
  417. package/esm/redux/actions/Error.js +33 -43
  418. package/esm/redux/actions/Error.js.map +1 -1
  419. package/esm/redux/actions/Form.js +13 -15
  420. package/esm/redux/actions/Form.js.map +1 -1
  421. package/esm/redux/actions/FormAttributeSet.js +6 -6
  422. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  423. package/esm/redux/actions/FormAttributeSetRepeatable.js +6 -6
  424. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  425. package/esm/redux/actions/FormAutosave.js +12 -18
  426. package/esm/redux/actions/FormAutosave.js.map +1 -1
  427. package/esm/redux/actions/FormAutosubmit.js +2 -2
  428. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  429. package/esm/redux/actions/FormValidations.js +12 -20
  430. package/esm/redux/actions/FormValidations.js.map +1 -1
  431. package/esm/redux/actions/Modals.js +8 -12
  432. package/esm/redux/actions/Modals.js.map +1 -1
  433. package/esm/redux/actions/Notification.js +32 -42
  434. package/esm/redux/actions/Notification.js.map +1 -1
  435. package/esm/redux/actions/Preferences.js +32 -38
  436. package/esm/redux/actions/Preferences.js.map +1 -1
  437. package/esm/redux/actions/ProgressIndicator.js +15 -23
  438. package/esm/redux/actions/ProgressIndicator.js.map +1 -1
  439. package/esm/redux/actions/SignIn.js +39 -53
  440. package/esm/redux/actions/SignIn.js.map +1 -1
  441. package/esm/redux/actions/SignOut.js +9 -17
  442. package/esm/redux/actions/SignOut.js.map +1 -1
  443. package/esm/redux/connectors/Application.js +1 -1
  444. package/esm/redux/connectors/Application.js.map +1 -1
  445. package/esm/redux/connectors/Breadcrumb.js +4 -6
  446. package/esm/redux/connectors/Breadcrumb.js.map +1 -1
  447. package/esm/redux/connectors/CaseView.js +4 -2
  448. package/esm/redux/connectors/CaseView.js.map +1 -1
  449. package/esm/redux/connectors/ConceptDetail.js +5 -3
  450. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  451. package/esm/redux/connectors/ContentBrowser.js +4 -2
  452. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  453. package/esm/redux/connectors/ContentDetail.js +5 -3
  454. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  455. package/esm/redux/connectors/ContentDetailSection.js +6 -4
  456. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  457. package/esm/redux/connectors/Form.js +11 -9
  458. package/esm/redux/connectors/Form.js.map +1 -1
  459. package/esm/redux/connectors/FormAttributeSet.js +13 -21
  460. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  461. package/esm/redux/connectors/ListDetail.js +4 -2
  462. package/esm/redux/connectors/ListDetail.js.map +1 -1
  463. package/esm/redux/connectors/Modal.js +4 -6
  464. package/esm/redux/connectors/Modal.js.map +1 -1
  465. package/esm/redux/connectors/ModelCatalog.js +4 -2
  466. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  467. package/esm/redux/connectors/Notification.js +8 -10
  468. package/esm/redux/connectors/Notification.js.map +1 -1
  469. package/esm/redux/connectors/PanelRenderer.js +7 -6
  470. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  471. package/esm/redux/connectors/Preferences.js +6 -8
  472. package/esm/redux/connectors/Preferences.js.map +1 -1
  473. package/esm/redux/connectors/Progress.js +2 -2
  474. package/esm/redux/connectors/Progress.js.map +1 -1
  475. package/esm/redux/connectors/ProgressIndicator.js +6 -8
  476. package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
  477. package/esm/redux/connectors/QuickSearch.js +6 -4
  478. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  479. package/esm/redux/connectors/SignIn.js +4 -4
  480. package/esm/redux/connectors/SignIn.js.map +1 -1
  481. package/esm/redux/connectors/SignOut.js +3 -3
  482. package/esm/redux/connectors/SignOut.js.map +1 -1
  483. package/esm/redux/connectors/Tab.js +4 -2
  484. package/esm/redux/connectors/Tab.js.map +1 -1
  485. package/esm/redux/reducers/AuthReducer.js +14 -25
  486. package/esm/redux/reducers/AuthReducer.js.map +1 -1
  487. package/esm/redux/reducers/ErrorReducer.js +4 -4
  488. package/esm/redux/reducers/ErrorReducer.js.map +1 -1
  489. package/esm/redux/reducers/ModalsReducer.js +19 -37
  490. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  491. package/esm/redux/reducers/NotificationReducer.js +8 -19
  492. package/esm/redux/reducers/NotificationReducer.js.map +1 -1
  493. package/esm/redux/reducers/PreferencesReducer.js +10 -17
  494. package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
  495. package/esm/redux/reducers/ProgressIndicatorReducer.js +14 -25
  496. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  497. package/esm/redux/reducers/createReducer.js +11 -13
  498. package/esm/redux/reducers/createReducer.js.map +1 -1
  499. package/esm/redux/selectors/i18n.js +2 -4
  500. package/esm/redux/selectors/i18n.js.map +1 -1
  501. package/esm/redux/store/beforeRenderHooks.js +5 -26
  502. package/esm/redux/store/beforeRenderHooks.js.map +1 -1
  503. package/esm/redux/store/configureStore.js +10 -19
  504. package/esm/redux/store/configureStore.js.map +1 -1
  505. package/esm/utils/browser/Cache.js +122 -156
  506. package/esm/utils/browser/Cache.js.map +1 -1
  507. package/esm/utils/browser/Cookies.js +4 -4
  508. package/esm/utils/browser/Cookies.js.map +1 -1
  509. package/esm/utils/datetime/DateTimeUtil.js +363 -418
  510. package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
  511. package/esm/utils/fetch/serverFetch.js +5 -5
  512. package/esm/utils/fetch/serverFetch.js.map +1 -1
  513. package/esm/utils/fetch/universalFetch.js +13 -14
  514. package/esm/utils/fetch/universalFetch.js.map +1 -1
  515. package/esm/utils/fetch/xhr.js +281 -358
  516. package/esm/utils/fetch/xhr.js.map +1 -1
  517. package/esm/utils/helpers/checkResource.js +7 -7
  518. package/esm/utils/helpers/checkResource.js.map +1 -1
  519. package/esm/utils/helpers/createHash.js +5 -5
  520. package/esm/utils/helpers/createHash.js.map +1 -1
  521. package/esm/utils/helpers/createUUID.js +4 -4
  522. package/esm/utils/helpers/createUUID.js.map +1 -1
  523. package/esm/utils/helpers/objects.js +9 -14
  524. package/esm/utils/helpers/objects.js.map +1 -1
  525. package/esm/utils/helpers/sanitizeHtml.js +13 -13
  526. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  527. package/esm/utils/helpers/text.js +1 -1
  528. package/esm/utils/helpers/text.js.map +1 -1
  529. package/esm/utils/number/DecimalFormat.js +297 -327
  530. package/esm/utils/number/DecimalFormat.js.map +1 -1
  531. package/esm/utils/number/formatValue.js +10 -16
  532. package/esm/utils/number/formatValue.js.map +1 -1
  533. package/esm/utils/number/parseNumbers.js +13 -13
  534. package/esm/utils/number/parseNumbers.js.map +1 -1
  535. package/lib/builder/index.js +1 -1
  536. package/lib/builder/mergeLayoutHintConfigurations.js +34 -64
  537. package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
  538. package/lib/constants/Constants.js +37 -37
  539. package/lib/constants/Constants.js.map +1 -1
  540. package/lib/constants/LayoutHintConfig.js +1 -1
  541. package/lib/constants/LayoutHintConfig.js.map +1 -1
  542. package/lib/constants/LayoutHints.js +20 -22
  543. package/lib/constants/LayoutHints.js.map +1 -1
  544. package/lib/constants/Settings.js +17 -27
  545. package/lib/constants/Settings.js.flow +3 -0
  546. package/lib/constants/Settings.js.map +1 -1
  547. package/lib/constants/index.js +3 -3
  548. package/lib/exceptions/ConfigurationException.js +5 -34
  549. package/lib/exceptions/ConfigurationException.js.map +1 -1
  550. package/lib/exceptions/FetchException.js +32 -75
  551. package/lib/exceptions/FetchException.js.map +1 -1
  552. package/lib/exceptions/IllegalArgumentException.js +5 -34
  553. package/lib/exceptions/IllegalArgumentException.js.map +1 -1
  554. package/lib/exceptions/IllegalReturnException.js +5 -34
  555. package/lib/exceptions/IllegalReturnException.js.map +1 -1
  556. package/lib/exceptions/IllegalStateException.js +5 -34
  557. package/lib/exceptions/IllegalStateException.js.map +1 -1
  558. package/lib/exceptions/JsonParseException.js +5 -34
  559. package/lib/exceptions/JsonParseException.js.map +1 -1
  560. package/lib/exceptions/MissingPropertyException.js +5 -34
  561. package/lib/exceptions/MissingPropertyException.js.map +1 -1
  562. package/lib/exceptions/NetworkException.js +9 -38
  563. package/lib/exceptions/NetworkException.js.map +1 -1
  564. package/lib/exceptions/NotAllowedUriException.js +5 -34
  565. package/lib/exceptions/NotAllowedUriException.js.map +1 -1
  566. package/lib/exceptions/NotFoundException.js +12 -41
  567. package/lib/exceptions/NotFoundException.js.map +1 -1
  568. package/lib/exceptions/ServerRequestException.js +5 -34
  569. package/lib/exceptions/ServerRequestException.js.map +1 -1
  570. package/lib/exceptions/ThemePropertyException.js +5 -34
  571. package/lib/exceptions/ThemePropertyException.js.map +1 -1
  572. package/lib/exceptions/TimeoutException.js +5 -32
  573. package/lib/exceptions/TimeoutException.js.map +1 -1
  574. package/lib/exceptions/UnauthorizedException.js +11 -40
  575. package/lib/exceptions/UnauthorizedException.js.map +1 -1
  576. package/lib/exceptions/UnsupportedOperationException.js +5 -34
  577. package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
  578. package/lib/exceptions/index.js +15 -15
  579. package/lib/hooks/index.js +16 -16
  580. package/lib/hooks/useAllFormsOnModel.js +25 -51
  581. package/lib/hooks/useAllFormsOnModel.js.map +1 -1
  582. package/lib/hooks/useAuthentication.js +18 -24
  583. package/lib/hooks/useAuthentication.js.map +1 -1
  584. package/lib/hooks/useContent.js +14 -27
  585. package/lib/hooks/useContent.js.map +1 -1
  586. package/lib/hooks/useDeepCompareEffect.js +5 -7
  587. package/lib/hooks/useDeepCompareEffect.js.map +1 -1
  588. package/lib/hooks/useForm.js +27 -45
  589. package/lib/hooks/useForm.js.map +1 -1
  590. package/lib/hooks/useI18n.js +10 -20
  591. package/lib/hooks/useI18n.js.map +1 -1
  592. package/lib/hooks/useModal.js +11 -11
  593. package/lib/hooks/useModal.js.map +1 -1
  594. package/lib/hooks/useModelCatalog.js +24 -30
  595. package/lib/hooks/useModelCatalog.js.map +1 -1
  596. package/lib/hooks/useModels.js +3 -3
  597. package/lib/hooks/useModels.js.map +1 -1
  598. package/lib/hooks/useModularUI.js +17 -16
  599. package/lib/hooks/useModularUI.js.map +1 -1
  600. package/lib/hooks/useModularUIBasic.js +9 -7
  601. package/lib/hooks/useModularUIBasic.js.map +1 -1
  602. package/lib/hooks/useModularUIModel.js +39 -59
  603. package/lib/hooks/useModularUIModel.js.map +1 -1
  604. package/lib/hooks/useModularUIRequest.js +4 -6
  605. package/lib/hooks/useModularUIRequest.js.map +1 -1
  606. package/lib/hooks/useNotification.js +16 -21
  607. package/lib/hooks/useNotification.js.map +1 -1
  608. package/lib/hooks/usePreference.js +3 -5
  609. package/lib/hooks/usePreference.js.map +1 -1
  610. package/lib/hooks/useProgressIndicator.js +9 -37
  611. package/lib/hooks/useProgressIndicator.js.map +1 -1
  612. package/lib/hooks/useRouter.js +11 -25
  613. package/lib/hooks/useRouter.js.map +1 -1
  614. package/lib/i18n/Locale.js +97 -144
  615. package/lib/i18n/Locale.js.map +1 -1
  616. package/lib/i18n/Locales.js +97 -160
  617. package/lib/i18n/Locales.js.map +1 -1
  618. package/lib/i18n/Message.js +13 -31
  619. package/lib/i18n/Message.js.map +1 -1
  620. package/lib/i18n/index.js +9 -11
  621. package/lib/i18n/index.js.map +1 -1
  622. package/lib/i18n/languages.js +1 -1
  623. package/lib/i18n/languages.js.map +1 -1
  624. package/lib/i18n/withMessage.js +11 -17
  625. package/lib/i18n/withMessage.js.map +1 -1
  626. package/lib/index.js +6 -6
  627. package/lib/models/actions/ActionCollection.js +58 -104
  628. package/lib/models/actions/ActionCollection.js.map +1 -1
  629. package/lib/models/actions/ActionModel.js +169 -210
  630. package/lib/models/actions/ActionModel.js.map +1 -1
  631. package/lib/models/application/ApplicationModel.js +107 -159
  632. package/lib/models/application/ApplicationModel.js.map +1 -1
  633. package/lib/models/attributes/AttributeCollection.js +245 -341
  634. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  635. package/lib/models/attributes/AttributeContent.js +182 -257
  636. package/lib/models/attributes/AttributeContent.js.map +1 -1
  637. package/lib/models/attributes/AttributeDataHelper.js +209 -258
  638. package/lib/models/attributes/AttributeDataHelper.js.flow +5 -1
  639. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  640. package/lib/models/attributes/AttributeModel.js +838 -950
  641. package/lib/models/attributes/AttributeModel.js.map +1 -1
  642. package/lib/models/attributes/AttributeSetModel.js +49 -83
  643. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  644. package/lib/models/attributes/BooleanAttributeModel.js +267 -339
  645. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  646. package/lib/models/attributes/CaptchaAttributeModel.js +27 -59
  647. package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
  648. package/lib/models/attributes/ChoiceAttributeModel.js +343 -437
  649. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  650. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +268 -369
  651. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  652. package/lib/models/attributes/ChoiceAttributeOptionModel.js +299 -357
  653. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  654. package/lib/models/attributes/CompositeAttributeChildCollection.js +181 -270
  655. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  656. package/lib/models/attributes/CompositeAttributeModel.js +331 -411
  657. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  658. package/lib/models/attributes/DatetimeAttributeModel.js +371 -425
  659. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  660. package/lib/models/attributes/HelptextAttributeModel.js +41 -74
  661. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  662. package/lib/models/attributes/LabelAttributeModel.js +26 -58
  663. package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
  664. package/lib/models/attributes/MemoAttributeModel.js +34 -67
  665. package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
  666. package/lib/models/attributes/MoneyAttributeModel.js +34 -67
  667. package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
  668. package/lib/models/attributes/NumberAttributeModel.js +181 -231
  669. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  670. package/lib/models/attributes/PasswordAttributeModel.js +201 -253
  671. package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
  672. package/lib/models/attributes/StringAttributeModel.js +239 -289
  673. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  674. package/lib/models/attributes/UploadAttributeModel.js +183 -243
  675. package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
  676. package/lib/models/attributes/XMLAttributeModel.js +38 -71
  677. package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
  678. package/lib/models/attributes/_createAttribute.js +20 -43
  679. package/lib/models/attributes/_createAttribute.js.map +1 -1
  680. package/lib/models/attributes/input-constraints/BSNConstraint.js +64 -84
  681. package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  682. package/lib/models/attributes/input-constraints/ConstraintCollection.js +36 -74
  683. package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  684. package/lib/models/attributes/input-constraints/ConstraintModel.js +46 -59
  685. package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  686. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +171 -193
  687. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  688. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +53 -68
  689. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  690. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +53 -68
  691. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  692. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +67 -84
  693. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  694. package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +53 -69
  695. package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  696. package/lib/models/attributes/input-constraints/FileSizeConstraint.js +79 -95
  697. package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  698. package/lib/models/attributes/input-constraints/IBANConstraint.js +41 -58
  699. package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  700. package/lib/models/attributes/input-constraints/MandatoryConstraint.js +39 -60
  701. package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  702. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +63 -82
  703. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  704. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +150 -172
  705. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  706. package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +105 -125
  707. package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  708. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +92 -114
  709. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  710. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +58 -73
  711. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  712. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +36 -55
  713. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  714. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +51 -65
  715. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  716. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +51 -65
  717. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  718. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +64 -82
  719. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  720. package/lib/models/attributes/input-constraints/RangeConstraint.js +116 -135
  721. package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  722. package/lib/models/attributes/input-constraints/RegexConstraint.js +48 -62
  723. package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  724. package/lib/models/attributes/input-constraints/StringLengthConstraint.js +158 -177
  725. package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  726. package/lib/models/attributes/input-constraints/XMLConstraint.js +49 -69
  727. package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  728. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +54 -70
  729. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  730. package/lib/models/attributes/layouthint-rules/DependentAttribute.js +172 -218
  731. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  732. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +43 -74
  733. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  734. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +32 -64
  735. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  736. package/lib/models/base/BaseCollection.js +170 -206
  737. package/lib/models/base/BaseCollection.js.map +1 -1
  738. package/lib/models/base/BaseModel.js +98 -113
  739. package/lib/models/base/BaseModel.js.map +1 -1
  740. package/lib/models/base/ResourceCollection.js +28 -60
  741. package/lib/models/base/ResourceCollection.js.map +1 -1
  742. package/lib/models/base/ResourceModel.js +171 -231
  743. package/lib/models/base/ResourceModel.js.map +1 -1
  744. package/lib/models/caseview/CaseViewModel.js +137 -188
  745. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  746. package/lib/models/concepts/BusinessScenarioModel.js +97 -153
  747. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  748. package/lib/models/concepts/ConceptDetailModel.js +243 -329
  749. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  750. package/lib/models/concepts/ConceptIndexModel.js +118 -156
  751. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  752. package/lib/models/concepts/ConceptLinkModel.js +122 -163
  753. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  754. package/lib/models/concepts/ConceptRelationCollection.js +57 -105
  755. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  756. package/lib/models/concepts/ConceptRelationModel.js +62 -75
  757. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  758. package/lib/models/concepts/ConceptTypeDetailModel.js +87 -127
  759. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  760. package/lib/models/concepts/SourceReferenceCollection.js +13 -44
  761. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  762. package/lib/models/concepts/SourceReferenceModel.js +47 -74
  763. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  764. package/lib/models/content/ContentIndexModel.js +112 -156
  765. package/lib/models/content/ContentIndexModel.js.map +1 -1
  766. package/lib/models/content/ContentLinkModel.js +162 -205
  767. package/lib/models/content/ContentLinkModel.js.map +1 -1
  768. package/lib/models/content/ContentModel.js +188 -235
  769. package/lib/models/content/ContentModel.js.map +1 -1
  770. package/lib/models/content/ContentTOCModel.js +133 -209
  771. package/lib/models/content/ContentTOCModel.js.map +1 -1
  772. package/lib/models/content/ContentTypeModel.js +56 -92
  773. package/lib/models/content/ContentTypeModel.js.map +1 -1
  774. package/lib/models/content/SectionModel.js +160 -254
  775. package/lib/models/content/SectionModel.js.map +1 -1
  776. package/lib/models/content/SubSectionModel.js +125 -196
  777. package/lib/models/content/SubSectionModel.js.map +1 -1
  778. package/lib/models/contentconfiguration/ContentConfiguration.js +46 -58
  779. package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  780. package/lib/models/contentconfiguration/ContentConfigurationElements.js +127 -171
  781. package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  782. package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +28 -45
  783. package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  784. package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +31 -42
  785. package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  786. package/lib/models/contentconfiguration/ContentConfigurationResults.js +74 -98
  787. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  788. package/lib/models/detail/DetailModel.js +176 -232
  789. package/lib/models/detail/DetailModel.js.map +1 -1
  790. package/lib/models/error/ErrorCollection.js +82 -139
  791. package/lib/models/error/ErrorCollection.js.map +1 -1
  792. package/lib/models/error/ErrorModel.js +47 -48
  793. package/lib/models/error/ErrorModel.js.flow +9 -1
  794. package/lib/models/error/ErrorModel.js.map +1 -1
  795. package/lib/models/error/ErrorResponse.js +286 -204
  796. package/lib/models/error/ErrorResponse.js.flow +102 -0
  797. package/lib/models/error/ErrorResponse.js.map +1 -1
  798. package/lib/models/filters/AssignmentFilterModel.js +144 -195
  799. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  800. package/lib/models/filters/BaseFilterModel.js +171 -228
  801. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  802. package/lib/models/filters/ConceptIndexFilterModel.js +9 -39
  803. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  804. package/lib/models/filters/FilterCollection.js +109 -177
  805. package/lib/models/filters/FilterCollection.js.map +1 -1
  806. package/lib/models/filters/FilterModel.js +2 -29
  807. package/lib/models/filters/FilterModel.js.map +1 -1
  808. package/lib/models/filters/RangeFilterModel.js +30 -60
  809. package/lib/models/filters/RangeFilterModel.js.map +1 -1
  810. package/lib/models/form/FormModel.js +961 -1150
  811. package/lib/models/form/FormModel.js.map +1 -1
  812. package/lib/models/form/FormObjectModel.js +411 -517
  813. package/lib/models/form/FormObjectModel.js.map +1 -1
  814. package/lib/models/grouping/GroupingModel.js +117 -165
  815. package/lib/models/grouping/GroupingModel.js.map +1 -1
  816. package/lib/models/href/Href.js +392 -452
  817. package/lib/models/href/Href.js.map +1 -1
  818. package/lib/models/href/ListHref.js +119 -159
  819. package/lib/models/href/ListHref.js.map +1 -1
  820. package/lib/models/index.js +97 -99
  821. package/lib/models/index.js.map +1 -1
  822. package/lib/models/layouthint/LayoutHintCollection.js +94 -140
  823. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  824. package/lib/models/links/LinkCollection.js +136 -196
  825. package/lib/models/links/LinkCollection.js.map +1 -1
  826. package/lib/models/links/LinkModel.js +191 -235
  827. package/lib/models/links/LinkModel.js.map +1 -1
  828. package/lib/models/links/normalizeLinkJSON.js +30 -66
  829. package/lib/models/links/normalizeLinkJSON.js.map +1 -1
  830. package/lib/models/list/ListDetailModel.js +229 -302
  831. package/lib/models/list/ListDetailModel.js.map +1 -1
  832. package/lib/models/list/ListHeaderModel.js +73 -97
  833. package/lib/models/list/ListHeaderModel.js.map +1 -1
  834. package/lib/models/list/ListItemCollection.js +49 -91
  835. package/lib/models/list/ListItemCollection.js.map +1 -1
  836. package/lib/models/list/ListItemModel.js +76 -114
  837. package/lib/models/list/ListItemModel.js.map +1 -1
  838. package/lib/models/list/ListModel.js +347 -435
  839. package/lib/models/list/ListModel.js.map +1 -1
  840. package/lib/models/lookup/LookupOptionCollection.js +16 -61
  841. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  842. package/lib/models/lookup/LookupOptionsModel.js +48 -79
  843. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  844. package/lib/models/modelcatalog/ModelCatalogModel.js +39 -72
  845. package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  846. package/lib/models/paging/PagesizeModel.js +29 -38
  847. package/lib/models/paging/PagesizeModel.js.map +1 -1
  848. package/lib/models/paging/PagingModel.js +77 -92
  849. package/lib/models/paging/PagingModel.js.map +1 -1
  850. package/lib/models/panels/GroupingPanelModel.js +117 -164
  851. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  852. package/lib/models/parameter/Parameter.js +83 -99
  853. package/lib/models/parameter/Parameter.js.map +1 -1
  854. package/lib/models/process/ProcessStatusSettingsModel.js +67 -105
  855. package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
  856. package/lib/models/resolveModel.js +3 -5
  857. package/lib/models/resolveModel.js.map +1 -1
  858. package/lib/models/search/CaseSearchModel.js +26 -60
  859. package/lib/models/search/CaseSearchModel.js.map +1 -1
  860. package/lib/models/sorting/SortOptionModel.js +77 -91
  861. package/lib/models/sorting/SortOptionModel.js.map +1 -1
  862. package/lib/models/sorting/SortingModel.js +88 -140
  863. package/lib/models/sorting/SortingModel.js.map +1 -1
  864. package/lib/models/tab/TabModel.js +122 -170
  865. package/lib/models/tab/TabModel.js.map +1 -1
  866. package/lib/models/taskgroup/TaskGroupCollection.js +8 -39
  867. package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
  868. package/lib/models/taskgroup/TaskGroupModel.js +54 -88
  869. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  870. package/lib/models/types.js.flow +1 -0
  871. package/lib/models/types.js.map +1 -1
  872. package/lib/models/user/UserModel.js +32 -65
  873. package/lib/models/user/UserModel.js.map +1 -1
  874. package/lib/models/user/UserProfileModel.js +21 -56
  875. package/lib/models/user/UserProfileModel.js.map +1 -1
  876. package/lib/models/user/UserServicesModel.js +78 -128
  877. package/lib/models/user/UserServicesModel.js.flow +1 -7
  878. package/lib/models/user/UserServicesModel.js.map +1 -1
  879. package/lib/modularui/Authenticate.js +144 -157
  880. package/lib/modularui/Authenticate.js.flow +13 -7
  881. package/lib/modularui/Authenticate.js.map +1 -1
  882. package/lib/modularui/ModularUIError.js +9 -39
  883. package/lib/modularui/ModularUIError.js.map +1 -1
  884. package/lib/modularui/ModularUIRequest.js +477 -647
  885. package/lib/modularui/ModularUIRequest.js.map +1 -1
  886. package/lib/modularui/ModularUIResponse.js +102 -120
  887. package/lib/modularui/ModularUIResponse.js.map +1 -1
  888. package/lib/modularui/index.js +3 -3
  889. package/lib/react/ErrorBoundary.js +33 -71
  890. package/lib/react/ErrorBoundary.js.map +1 -1
  891. package/lib/react/ErrorBoundaryFallback.js +8 -6
  892. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  893. package/lib/react/index.js +2 -2
  894. package/lib/react/utils.js +12 -16
  895. package/lib/react/utils.js.map +1 -1
  896. package/lib/react-client/Init.js +9 -7
  897. package/lib/react-client/Init.js.map +1 -1
  898. package/lib/react-client/client.js +22 -23
  899. package/lib/react-client/client.js.map +1 -1
  900. package/lib/react-client/contextPath.js +4 -4
  901. package/lib/react-client/contextPath.js.map +1 -1
  902. package/lib/react-client/index.js +3 -3
  903. package/lib/react-client/rehydrate.js +14 -22
  904. package/lib/react-client/rehydrate.js.map +1 -1
  905. package/lib/react-server/createSSRComplete.js +10 -14
  906. package/lib/react-server/createSSRComplete.js.map +1 -1
  907. package/lib/react-server/htmlpage.js +5 -8
  908. package/lib/react-server/htmlpage.js.map +1 -1
  909. package/lib/react-server/index.js +8 -8
  910. package/lib/react-server/renderSSRComplete.js +50 -55
  911. package/lib/react-server/renderSSRComplete.js.map +1 -1
  912. package/lib/react-server/renderSSRMinimal.js +13 -13
  913. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  914. package/lib/react-server/requestInformation.js +8 -10
  915. package/lib/react-server/requestInformation.js.map +1 -1
  916. package/lib/react-server/serverNoSSR.js +22 -21
  917. package/lib/react-server/serverNoSSR.js.map +1 -1
  918. package/lib/react-server/serverSSR.js +24 -24
  919. package/lib/react-server/serverSSR.js.map +1 -1
  920. package/lib/react-server/serverUtil.js +49 -74
  921. package/lib/react-server/serverUtil.js.map +1 -1
  922. package/lib/react-theme/ThemeProvider.js +10 -7
  923. package/lib/react-theme/ThemeProvider.js.map +1 -1
  924. package/lib/react-theme/createTheme.js +15 -44
  925. package/lib/react-theme/createTheme.js.map +1 -1
  926. package/lib/react-theme/index.js +9 -9
  927. package/lib/react-theme/useTheme.js +1 -1
  928. package/lib/react-theme/useTheme.js.map +1 -1
  929. package/lib/react-theme/utils/background.js +9 -9
  930. package/lib/react-theme/utils/background.js.map +1 -1
  931. package/lib/react-theme/utils/colors.js +12 -12
  932. package/lib/react-theme/utils/colors.js.map +1 -1
  933. package/lib/react-theme/utils/contrast.js +27 -28
  934. package/lib/react-theme/utils/contrast.js.map +1 -1
  935. package/lib/react-theme/utils/corners.js +10 -9
  936. package/lib/react-theme/utils/corners.js.map +1 -1
  937. package/lib/react-theme/utils/spacers.js +23 -22
  938. package/lib/react-theme/utils/spacers.js.map +1 -1
  939. package/lib/react-theme/utils/themeProps.js +28 -30
  940. package/lib/react-theme/utils/themeProps.js.map +1 -1
  941. package/lib/redux/_i18n/actions.js +15 -21
  942. package/lib/redux/_i18n/actions.js.map +1 -1
  943. package/lib/redux/_i18n/index.js +2 -2
  944. package/lib/redux/_i18n/reducer.js +20 -34
  945. package/lib/redux/_i18n/reducer.js.map +1 -1
  946. package/lib/redux/_modularui/actions.js +40 -72
  947. package/lib/redux/_modularui/actions.js.map +1 -1
  948. package/lib/redux/_modularui/connector.js +46 -55
  949. package/lib/redux/_modularui/connector.js.map +1 -1
  950. package/lib/redux/_modularui/index.js +7 -7
  951. package/lib/redux/_modularui/middleware.js +23 -36
  952. package/lib/redux/_modularui/middleware.js.map +1 -1
  953. package/lib/redux/_modularui/modularuiUtils.js +16 -24
  954. package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
  955. package/lib/redux/_modularui/reducer.js +42 -61
  956. package/lib/redux/_modularui/reducer.js.map +1 -1
  957. package/lib/redux/_modularui/selectors.js +89 -106
  958. package/lib/redux/_modularui/selectors.js.map +1 -1
  959. package/lib/redux/_modularui/withModularUI.js +11 -15
  960. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  961. package/lib/redux/_router/actions.js +29 -39
  962. package/lib/redux/_router/actions.js.map +1 -1
  963. package/lib/redux/_router/connectors.js +7 -9
  964. package/lib/redux/_router/connectors.js.map +1 -1
  965. package/lib/redux/_router/index.js +4 -4
  966. package/lib/redux/_router/middleware.js +27 -29
  967. package/lib/redux/_router/middleware.js.map +1 -1
  968. package/lib/redux/_router/reducer.js +4 -4
  969. package/lib/redux/_router/reducer.js.map +1 -1
  970. package/lib/redux/actions/Application.js +11 -37
  971. package/lib/redux/actions/Application.js.map +1 -1
  972. package/lib/redux/actions/Authorization.js +31 -33
  973. package/lib/redux/actions/Authorization.js.map +1 -1
  974. package/lib/redux/actions/Error.js +33 -43
  975. package/lib/redux/actions/Error.js.map +1 -1
  976. package/lib/redux/actions/Form.js +14 -16
  977. package/lib/redux/actions/Form.js.map +1 -1
  978. package/lib/redux/actions/FormAttributeSet.js +6 -6
  979. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  980. package/lib/redux/actions/FormAttributeSetRepeatable.js +6 -6
  981. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  982. package/lib/redux/actions/FormAutosave.js +12 -18
  983. package/lib/redux/actions/FormAutosave.js.map +1 -1
  984. package/lib/redux/actions/FormAutosubmit.js +2 -2
  985. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  986. package/lib/redux/actions/FormValidations.js +12 -20
  987. package/lib/redux/actions/FormValidations.js.map +1 -1
  988. package/lib/redux/actions/Modals.js +8 -12
  989. package/lib/redux/actions/Modals.js.map +1 -1
  990. package/lib/redux/actions/Notification.js +32 -42
  991. package/lib/redux/actions/Notification.js.map +1 -1
  992. package/lib/redux/actions/Preferences.js +32 -43
  993. package/lib/redux/actions/Preferences.js.map +1 -1
  994. package/lib/redux/actions/ProgressIndicator.js +15 -23
  995. package/lib/redux/actions/ProgressIndicator.js.map +1 -1
  996. package/lib/redux/actions/SignIn.js +43 -57
  997. package/lib/redux/actions/SignIn.js.map +1 -1
  998. package/lib/redux/actions/SignOut.js +9 -17
  999. package/lib/redux/actions/SignOut.js.map +1 -1
  1000. package/lib/redux/actions/__tests__/Error-server.spec.js.flow +0 -1
  1001. package/lib/redux/actions/index.js +15 -15
  1002. package/lib/redux/connectors/Application.js +1 -1
  1003. package/lib/redux/connectors/Application.js.map +1 -1
  1004. package/lib/redux/connectors/Breadcrumb.js +4 -6
  1005. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  1006. package/lib/redux/connectors/CaseView.js +4 -2
  1007. package/lib/redux/connectors/CaseView.js.map +1 -1
  1008. package/lib/redux/connectors/ConceptDetail.js +5 -3
  1009. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  1010. package/lib/redux/connectors/ContentBrowser.js +4 -2
  1011. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  1012. package/lib/redux/connectors/ContentDetail.js +5 -3
  1013. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  1014. package/lib/redux/connectors/ContentDetailSection.js +6 -4
  1015. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  1016. package/lib/redux/connectors/Form.js +10 -8
  1017. package/lib/redux/connectors/Form.js.map +1 -1
  1018. package/lib/redux/connectors/FormAttributeSet.js +13 -21
  1019. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  1020. package/lib/redux/connectors/ListDetail.js +4 -2
  1021. package/lib/redux/connectors/ListDetail.js.map +1 -1
  1022. package/lib/redux/connectors/Modal.js +4 -6
  1023. package/lib/redux/connectors/Modal.js.map +1 -1
  1024. package/lib/redux/connectors/ModelCatalog.js +4 -2
  1025. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  1026. package/lib/redux/connectors/Notification.js +8 -10
  1027. package/lib/redux/connectors/Notification.js.map +1 -1
  1028. package/lib/redux/connectors/PanelRenderer.js +7 -6
  1029. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  1030. package/lib/redux/connectors/Preferences.js +6 -8
  1031. package/lib/redux/connectors/Preferences.js.map +1 -1
  1032. package/lib/redux/connectors/Progress.js +2 -2
  1033. package/lib/redux/connectors/Progress.js.map +1 -1
  1034. package/lib/redux/connectors/ProgressIndicator.js +6 -8
  1035. package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
  1036. package/lib/redux/connectors/QuickSearch.js +5 -3
  1037. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  1038. package/lib/redux/connectors/SignIn.js +4 -4
  1039. package/lib/redux/connectors/SignIn.js.map +1 -1
  1040. package/lib/redux/connectors/SignOut.js +3 -3
  1041. package/lib/redux/connectors/SignOut.js.map +1 -1
  1042. package/lib/redux/connectors/Tab.js +4 -2
  1043. package/lib/redux/connectors/Tab.js.map +1 -1
  1044. package/lib/redux/connectors/index.js +21 -21
  1045. package/lib/redux/index.js +8 -8
  1046. package/lib/redux/reducers/AuthReducer.js +14 -33
  1047. package/lib/redux/reducers/AuthReducer.js.map +1 -1
  1048. package/lib/redux/reducers/ErrorReducer.js +4 -4
  1049. package/lib/redux/reducers/ErrorReducer.js.map +1 -1
  1050. package/lib/redux/reducers/ModalsReducer.js +19 -45
  1051. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  1052. package/lib/redux/reducers/NotificationReducer.js +8 -27
  1053. package/lib/redux/reducers/NotificationReducer.js.map +1 -1
  1054. package/lib/redux/reducers/PreferencesReducer.js +10 -25
  1055. package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
  1056. package/lib/redux/reducers/ProgressIndicatorReducer.js +14 -33
  1057. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  1058. package/lib/redux/reducers/createReducer.js +11 -13
  1059. package/lib/redux/reducers/createReducer.js.map +1 -1
  1060. package/lib/redux/reducers/index.js +7 -7
  1061. package/lib/redux/selectors/i18n.js +2 -4
  1062. package/lib/redux/selectors/i18n.js.map +1 -1
  1063. package/lib/redux/selectors/index.js +1 -1
  1064. package/lib/redux/store/beforeRenderHooks.js +5 -29
  1065. package/lib/redux/store/beforeRenderHooks.js.map +1 -1
  1066. package/lib/redux/store/configureStore.js +10 -24
  1067. package/lib/redux/store/configureStore.js.map +1 -1
  1068. package/lib/utils/browser/Cache.js +126 -161
  1069. package/lib/utils/browser/Cache.js.map +1 -1
  1070. package/lib/utils/browser/Cookies.js +4 -4
  1071. package/lib/utils/browser/Cookies.js.map +1 -1
  1072. package/lib/utils/datetime/DateTimeUtil.js +364 -418
  1073. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  1074. package/lib/utils/fetch/serverFetch.js +5 -5
  1075. package/lib/utils/fetch/serverFetch.js.map +1 -1
  1076. package/lib/utils/fetch/universalFetch.js +13 -13
  1077. package/lib/utils/fetch/universalFetch.js.map +1 -1
  1078. package/lib/utils/fetch/xhr.js +281 -365
  1079. package/lib/utils/fetch/xhr.js.map +1 -1
  1080. package/lib/utils/helpers/checkResource.js +7 -7
  1081. package/lib/utils/helpers/checkResource.js.map +1 -1
  1082. package/lib/utils/helpers/createHash.js +5 -5
  1083. package/lib/utils/helpers/createHash.js.map +1 -1
  1084. package/lib/utils/helpers/createUUID.js +4 -4
  1085. package/lib/utils/helpers/createUUID.js.map +1 -1
  1086. package/lib/utils/helpers/objects.js +9 -15
  1087. package/lib/utils/helpers/objects.js.map +1 -1
  1088. package/lib/utils/helpers/sanitizeHtml.js +13 -13
  1089. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  1090. package/lib/utils/helpers/text.js +1 -1
  1091. package/lib/utils/helpers/text.js.map +1 -1
  1092. package/lib/utils/index.js +15 -15
  1093. package/lib/utils/number/DecimalFormat.js +298 -328
  1094. package/lib/utils/number/DecimalFormat.js.map +1 -1
  1095. package/lib/utils/number/formatValue.js +10 -17
  1096. package/lib/utils/number/formatValue.js.map +1 -1
  1097. package/lib/utils/number/parseNumbers.js +13 -13
  1098. package/lib/utils/number/parseNumbers.js.map +1 -1
  1099. package/package.json +14 -14
  1100. package/src/constants/Settings.js +3 -0
  1101. package/src/models/attributes/AttributeDataHelper.js +5 -1
  1102. package/src/models/error/ErrorModel.js +9 -1
  1103. package/src/models/error/ErrorResponse.js +102 -0
  1104. package/src/models/types.js +1 -0
  1105. package/src/models/user/UserServicesModel.js +1 -7
  1106. package/src/modularui/Authenticate.js +13 -7
  1107. package/src/redux/actions/__tests__/Error-server.spec.js +0 -1
@@ -1,17 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
4
-
5
- var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
6
-
7
- var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
8
-
9
- var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
10
-
11
- var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
12
-
13
- var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
14
-
15
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
16
4
 
17
5
  Object.defineProperty(exports, "__esModule", {
@@ -19,12 +7,8 @@ Object.defineProperty(exports, "__esModule", {
19
7
  });
20
8
  exports.default = void 0;
21
9
 
22
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
23
-
24
10
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
25
11
 
26
- var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
27
-
28
12
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
29
13
 
30
14
  var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
@@ -39,20 +23,6 @@ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-
39
23
 
40
24
  var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
41
25
 
42
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
43
-
44
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
45
-
46
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
47
-
48
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
49
-
50
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
51
-
52
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
53
-
54
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
55
-
56
26
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
57
27
 
58
28
  var _flattenDeep = _interopRequireDefault(require("lodash/flattenDeep"));
@@ -63,7 +33,7 @@ var _objects = require("../../utils/helpers/objects");
63
33
 
64
34
  var _exceptions = require("../../exceptions");
65
35
 
66
- var _ResourceModel2 = _interopRequireDefault(require("../base/ResourceModel"));
36
+ var _ResourceModel = _interopRequireDefault(require("../base/ResourceModel"));
67
37
 
68
38
  var _ErrorCollection = _interopRequireDefault(require("../error/ErrorCollection"));
69
39
 
@@ -79,1282 +49,1123 @@ var _Settings = require("../../constants/Settings");
79
49
 
80
50
  var _LayoutHints = require("../../constants/LayoutHints");
81
51
 
82
- var _excluded = ["elements"];
83
-
84
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
85
-
86
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
87
-
88
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
89
-
90
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
91
-
92
52
  /**
93
53
  */
94
- var FormModel = /*#__PURE__*/function (_ResourceModel) {
95
- (0, _inherits2.default)(FormModel, _ResourceModel);
96
-
97
- var _super = _createSuper(FormModel);
98
-
99
- /**
100
- */
101
- function FormModel(modularuiResponse) {
102
- var _this;
103
-
104
- (0, _classCallCheck2.default)(this, FormModel);
105
- _this = _super.call(this, modularuiResponse);
106
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_lastUpdate", void 0);
107
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_completedFormObjects", []);
108
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_currentFormObject", null);
109
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_previouslyEnteredFormObjects", []);
110
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_mergePreviouslyEnteredObjects", true);
111
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_endResultFormObjects", []);
112
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_previousEndResultKeys", []);
113
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_useClientsideValidation", (0, _Settings.getSetting)("USE_CLIENTSIDE_VALIDATION"));
114
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_errorCollection", new _ErrorCollection.default("form"));
115
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_redirectLocation", void 0);
116
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_commit", void 0);
117
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_isFinished", void 0);
118
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_isComplete", void 0);
119
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_parameters", void 0);
120
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_tokens", void 0);
121
- _this.lastUpdate = 0;
122
- _this.currentFormObject = _this.createFormObject();
123
- _this.endResultFormObjects = _this.setEndResultFormObjects();
124
- _this.parameters = _this.setParameters(modularuiResponse);
125
- _this.isComplete = _this.getData("complete", false);
126
-
127
- if (_this.data.errors) {
128
- _this.handleRootErrors(_this.data.errors);
54
+ class FormModel extends _ResourceModel.default {
55
+ /**
56
+ */
57
+ constructor(modularuiResponse) {
58
+ super(modularuiResponse);
59
+ (0, _defineProperty2.default)(this, "_lastUpdate", void 0);
60
+ (0, _defineProperty2.default)(this, "_completedFormObjects", []);
61
+ (0, _defineProperty2.default)(this, "_currentFormObject", null);
62
+ (0, _defineProperty2.default)(this, "_previouslyEnteredFormObjects", []);
63
+ (0, _defineProperty2.default)(this, "_mergePreviouslyEnteredObjects", true);
64
+ (0, _defineProperty2.default)(this, "_endResultFormObjects", []);
65
+ (0, _defineProperty2.default)(this, "_previousEndResultKeys", []);
66
+ (0, _defineProperty2.default)(this, "_useClientsideValidation", (0, _Settings.getSetting)("USE_CLIENTSIDE_VALIDATION"));
67
+ (0, _defineProperty2.default)(this, "_errorCollection", new _ErrorCollection.default("form"));
68
+ (0, _defineProperty2.default)(this, "_redirectLocation", void 0);
69
+ (0, _defineProperty2.default)(this, "_commit", void 0);
70
+ (0, _defineProperty2.default)(this, "_isFinished", void 0);
71
+ (0, _defineProperty2.default)(this, "_isComplete", void 0);
72
+ (0, _defineProperty2.default)(this, "_parameters", void 0);
73
+ (0, _defineProperty2.default)(this, "_tokens", void 0);
74
+ this.lastUpdate = 0;
75
+ this.currentFormObject = this.createFormObject();
76
+ this.endResultFormObjects = this.setEndResultFormObjects();
77
+ this.parameters = this.setParameters(modularuiResponse);
78
+ this.isComplete = this.getData("complete", false);
79
+
80
+ if (this.data.errors) {
81
+ this.handleRootErrors(this.data.errors);
129
82
  }
130
-
131
- return _this;
132
83
  }
133
84
  /**
134
85
  */
135
86
 
136
87
 
137
- (0, _createClass2.default)(FormModel, [{
138
- key: "type",
139
- get: function get() {
140
- return "Form";
141
- }
142
- /**
143
- */
144
-
145
- }, {
146
- key: "actiontype",
147
- get: function get() {
148
- if (this.layouthint.has(_LayoutHints.CREATE_ACTION)) {
149
- return "create";
150
- }
151
-
152
- if (this.layouthint.has(_LayoutHints.UPDATE_ACTION)) {
153
- return "update";
154
- }
88
+ get type() {
89
+ return "Form";
90
+ }
91
+ /**
92
+ */
155
93
 
156
- if (this.layouthint.has(_LayoutHints.DELETE_ACTION)) {
157
- return "delete";
158
- }
159
94
 
160
- return this.getContribution("actiontype", "form");
95
+ get actiontype() {
96
+ if (this.layouthint.has(_LayoutHints.CREATE_ACTION)) {
97
+ return "create";
161
98
  }
162
- /**
163
- */
164
-
165
- }, {
166
- key: "getInitialChildModelLinks",
167
- value:
168
- /**
169
- */
170
- function getInitialChildModelLinks() {
171
- var _context, _context2;
172
-
173
- var endResultChildLinks = (0, _flattenDeep.default)((0, _map.default)(_context = this.endResultFormObjects).call(_context, function (endResultFormObject) {
174
- return endResultFormObject.getInitialChildModelLinks();
175
- }));
176
-
177
- if (this.currentFormObject === null) {
178
- return endResultChildLinks;
179
- }
180
99
 
181
- return (0, _concat.default)(_context2 = []).call(_context2, (0, _toConsumableArray2.default)(this.currentFormObject.getInitialChildModelLinks()), (0, _toConsumableArray2.default)(endResultChildLinks));
100
+ if (this.layouthint.has(_LayoutHints.UPDATE_ACTION)) {
101
+ return "update";
182
102
  }
183
- /**
184
- */
185
-
186
- }, {
187
- key: "setChildModels",
188
- value: function setChildModels(models) {
189
- if (this.currentFormObject) {
190
- this.currentFormObject.setChildModels(models);
191
- }
192
103
 
193
- this.endResultFormObjects.forEach(function (endResultFormObject) {
194
- endResultFormObject.setChildModels(models);
195
- });
104
+ if (this.layouthint.has(_LayoutHints.DELETE_ACTION)) {
105
+ return "delete";
196
106
  }
197
- /**
198
- */
199
107
 
200
- }, {
201
- key: "label",
202
- get: function get() {
203
- return this.getContribution("label", "");
204
- }
205
- /**
206
- * Get form level button labels
207
- */
208
-
209
- }, {
210
- key: "buttonLabels",
211
- get: function get() {
212
- return this.getContribution("buttonLabels", {});
213
- }
214
- /**
215
- * @returns button label from contributions;
216
- */
108
+ return this.getContribution("actiontype", "form");
109
+ }
110
+ /**
111
+ */
112
+
217
113
 
218
- }, {
219
- key: "getButtonLabel",
220
- value: function getButtonLabel(buttonType) {
221
- var _this$currentFormObje, _this$currentFormObje2, _this$currentFormObje3;
114
+ static isApplicableModel(data) {
115
+ return data.contributions.resourcetype && data.contributions.resourcetype === "Form";
116
+ }
117
+ /**
118
+ */
222
119
 
223
- // cancel button labels are defined on the form
224
- if (buttonType === "cancel") {
225
- var _this$buttonLabels$ca, _this$buttonLabels;
226
120
 
227
- return (_this$buttonLabels$ca = (_this$buttonLabels = this.buttonLabels) === null || _this$buttonLabels === void 0 ? void 0 : _this$buttonLabels.cancel) !== null && _this$buttonLabels$ca !== void 0 ? _this$buttonLabels$ca : null;
228
- } // all other form related button labels are defined on the object
121
+ getInitialChildModelLinks() {
122
+ var _context;
229
123
 
124
+ const endResultChildLinks = (0, _flattenDeep.default)((0, _map.default)(_context = this.endResultFormObjects).call(_context, endResultFormObject => endResultFormObject.getInitialChildModelLinks()));
230
125
 
231
- return (_this$currentFormObje = (_this$currentFormObje2 = this.currentFormObject) === null || _this$currentFormObje2 === void 0 ? void 0 : (_this$currentFormObje3 = _this$currentFormObje2.buttonLabels) === null || _this$currentFormObje3 === void 0 ? void 0 : _this$currentFormObje3[buttonType]) !== null && _this$currentFormObje !== void 0 ? _this$currentFormObje : null;
126
+ if (this.currentFormObject === null) {
127
+ return endResultChildLinks;
232
128
  }
233
- /**
234
- * Get all applicable objects
235
- */
236
129
 
237
- }, {
238
- key: "allObjects",
239
- get: function get() {
240
- var _context3;
130
+ return [...this.currentFormObject.getInitialChildModelLinks(), ...endResultChildLinks];
131
+ }
132
+ /**
133
+ */
241
134
 
242
- if (this.currentFormObject === null) {
243
- return this.completedFormObjects;
244
- }
245
135
 
246
- return (0, _concat.default)(_context3 = []).call(_context3, (0, _toConsumableArray2.default)(this.completedFormObjects), [this.currentFormObject]);
136
+ setChildModels(models) {
137
+ if (this.currentFormObject) {
138
+ this.currentFormObject.setChildModels(models);
247
139
  }
248
- /**
249
- */
250
-
251
- }, {
252
- key: "objectKeys",
253
- get: function get() {
254
- if ((0, _objects.has)(this.contributions, "objects")) {
255
- return (0, _keys.default)(this.contributions.objects);
256
- }
257
140
 
258
- return [];
259
- }
260
- /**
261
- */
141
+ this.endResultFormObjects.forEach(endResultFormObject => {
142
+ endResultFormObject.setChildModels(models);
143
+ });
144
+ }
145
+ /**
146
+ */
262
147
 
263
- }, {
264
- key: "numberOfExpectedQuestions",
265
- get: function get() {
266
- return this.objectKeys.length;
267
- }
268
- /**
269
- * Has questions configured on form
270
- */
271
-
272
- }, {
273
- key: "hasNoQuestionsConfigured",
274
- get: function get() {
275
- return this.isComplete && (this.objectKeys.length === 0 || !("missing" in this.data) && !("results" in this.data) && !("errors" in this.data));
276
- }
277
- /**
278
- */
279
148
 
280
- }, {
281
- key: "addGlobalDynamicSchema",
282
- value: function addGlobalDynamicSchema(anchor, dynamicschema) {
283
- var _context4;
149
+ get label() {
150
+ return this.getContribution("label", "");
151
+ }
152
+ /**
153
+ * Get form level button labels
154
+ */
284
155
 
285
- if (!dynamicschema) {
286
- return anchor;
287
- }
288
156
 
289
- return _objectSpread(_objectSpread({}, anchor), {}, {
290
- elements: (0, _map.default)(_context4 = anchor.elements).call(_context4, function (element) {
291
- var _context5;
292
-
293
- return _objectSpread(_objectSpread({}, element), {}, {
294
- dynamicschema: element.dynamicschema ? (0, _map.default)(_context5 = element.dynamicschema).call(_context5, function (item) {
295
- return _objectSpread(_objectSpread({}, item), {}, {
296
- elements: _objectSpread(_objectSpread({}, item.elements), {}, {
297
- dynamicschema: dynamicschema
298
- })
299
- });
300
- }) : null
301
- });
302
- })
303
- });
304
- }
305
- /**
306
- */
157
+ get buttonLabels() {
158
+ return this.getContribution("buttonLabels", {});
159
+ }
160
+ /**
161
+ * @returns button label from contributions;
162
+ */
307
163
 
308
- }, {
309
- key: "getMissingAnchors",
310
- value: function getMissingAnchors() {
311
- var _this$data$missing$an,
312
- _this$data$missing,
313
- _this2 = this;
314
164
 
315
- var missingAnchors = (_this$data$missing$an = (_this$data$missing = this.data.missing) === null || _this$data$missing === void 0 ? void 0 : _this$data$missing.anchors) !== null && _this$data$missing$an !== void 0 ? _this$data$missing$an : []; // Add intermediate result data to anchor
165
+ getButtonLabel(buttonType) {
166
+ var _this$currentFormObje, _this$currentFormObje2, _this$currentFormObje3;
316
167
 
317
- return (0, _map.default)(missingAnchors).call(missingAnchors, function (anchor) {
318
- if (_this2.data.results) {
319
- var _context6;
168
+ // cancel button labels are defined on the form
169
+ if (buttonType === "cancel") {
170
+ var _this$buttonLabels$ca, _this$buttonLabels;
320
171
 
321
- var resultObject = (0, _find.default)(_context6 = _this2.data.results).call(_context6, function (result) {
322
- return result.objectid === anchor.objectid && "elements" in result;
323
- });
172
+ return (_this$buttonLabels$ca = (_this$buttonLabels = this.buttonLabels) === null || _this$buttonLabels === void 0 ? void 0 : _this$buttonLabels.cancel) !== null && _this$buttonLabels$ca !== void 0 ? _this$buttonLabels$ca : null;
173
+ } // all other form related button labels are defined on the object
324
174
 
325
- if (resultObject) {
326
- anchor.results = resultObject.elements;
327
- }
328
- }
329
175
 
330
- return _this2.addGlobalDynamicSchema(anchor, _this2.data.dynamicschema);
331
- });
332
- }
333
- /**
334
- * Create form object based on the data and contributions available in this form
335
- */
176
+ return (_this$currentFormObje = (_this$currentFormObje2 = this.currentFormObject) === null || _this$currentFormObje2 === void 0 ? void 0 : (_this$currentFormObje3 = _this$currentFormObje2.buttonLabels) === null || _this$currentFormObje3 === void 0 ? void 0 : _this$currentFormObje3[buttonType]) !== null && _this$currentFormObje !== void 0 ? _this$currentFormObje : null;
177
+ }
178
+ /**
179
+ * Get all applicable objects
180
+ */
336
181
 
337
- }, {
338
- key: "createFormObject",
339
- value: function createFormObject() {
340
- if (this.data && this.contributions) {
341
- var _missingAnchors$0$obj, _missingAnchors$, _this$contributions$o;
342
182
 
343
- var missingAnchors = this.getMissingAnchors(); // Get object id from first anchor
183
+ get allObjects() {
184
+ if (this.currentFormObject === null) {
185
+ return this.completedFormObjects;
186
+ }
344
187
 
345
- var objectId = (_missingAnchors$0$obj = missingAnchors === null || missingAnchors === void 0 ? void 0 : (_missingAnchors$ = missingAnchors[0]) === null || _missingAnchors$ === void 0 ? void 0 : _missingAnchors$.objectid) !== null && _missingAnchors$0$obj !== void 0 ? _missingAnchors$0$obj : "";
346
- var contributions = (_this$contributions$o = this.contributions.objects) === null || _this$contributions$o === void 0 ? void 0 : _this$contributions$o[objectId];
188
+ return [...this.completedFormObjects, this.currentFormObject];
189
+ }
190
+ /**
191
+ */
347
192
 
348
- if (contributions) {
349
- return new _FormObjectModel.default(missingAnchors[0], contributions);
350
- }
351
- }
352
193
 
353
- return null;
194
+ get objectKeys() {
195
+ if ((0, _objects.has)(this.contributions, "objects")) {
196
+ return (0, _keys.default)(this.contributions.objects);
354
197
  }
355
- /**
356
- */
357
198
 
358
- }, {
359
- key: "addEmptyFormObject",
360
- value: function addEmptyFormObject() {
361
- var formObjectModel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.currentFormObject;
199
+ return [];
200
+ }
201
+ /**
202
+ */
362
203
 
363
- if (formObjectModel) {
364
- var emptyFormObject = _FormObjectModel.default.createEmpty(formObjectModel);
365
204
 
366
- emptyFormObject.repeatIndex = this.getHighestRepeatIndex(formObjectModel) + 1;
367
- this.addFormObject(emptyFormObject);
368
- }
369
- }
370
- /**
371
- */
372
-
373
- }, {
374
- key: "getHighestRepeatIndex",
375
- value: function getHighestRepeatIndex(formObjectModel) {
376
- var _context7, _context8;
377
-
378
- return Math.max.apply(Math, (0, _toConsumableArray2.default)((0, _map.default)(_context7 = (0, _filter.default)(_context8 = this.allObjects).call(_context8, function (formObject) {
379
- return formObject.equals(formObjectModel, false);
380
- })).call(_context7, function (formObject) {
381
- return formObject.repeatIndex;
382
- })));
383
- }
384
- /**
385
- */
386
-
387
- }, {
388
- key: "addFormObject",
389
- value: function addFormObject(formObjectModel) {
390
- if (!formObjectModel) {
391
- throw new _exceptions.IllegalArgumentException("Missing form object to add");
392
- }
205
+ get numberOfExpectedQuestions() {
206
+ return this.objectKeys.length;
207
+ }
208
+ /**
209
+ * Has questions configured on form
210
+ */
393
211
 
394
- this.completedFormObjects = (0, _toConsumableArray2.default)(this.allObjects);
395
- this.currentFormObject = formObjectModel;
396
- }
397
- /**
398
- * Retrieve a form object by the key
399
- */
400
212
 
401
- }, {
402
- key: "getFormObjectByKey",
403
- value: function getFormObjectByKey(key) {
404
- var _context9;
213
+ get hasNoQuestionsConfigured() {
214
+ return this.isComplete && (this.objectKeys.length === 0 || !("missing" in this.data) && !("results" in this.data) && !("errors" in this.data));
215
+ }
216
+ /**
217
+ */
405
218
 
406
- return (0, _find.default)(_context9 = this.allObjects).call(_context9, function (formObject) {
407
- return formObject.key === key;
408
- });
409
- }
410
- /**
411
- * Retrieve a form object by a layouthint
412
- */
413
219
 
414
- }, {
415
- key: "getFormObjectByLayoutHint",
416
- value: function getFormObjectByLayoutHint(hint) {
417
- var _context10;
220
+ addGlobalDynamicSchema(anchor, dynamicschema) {
221
+ var _context2;
418
222
 
419
- return (0, _find.default)(_context10 = this.allObjects).call(_context10, function (formObject) {
420
- return formObject.layouthint.has(hint);
421
- });
223
+ if (!dynamicschema) {
224
+ return anchor;
422
225
  }
423
- /**
424
- */
425
226
 
426
- }, {
427
- key: "removeFormObject",
428
- value: function removeFormObject(formObjectModel) {
429
- var _context11;
227
+ return { ...anchor,
228
+ elements: (0, _map.default)(_context2 = anchor.elements).call(_context2, element => {
229
+ var _context3;
430
230
 
431
- if (!formObjectModel) {
432
- throw new _exceptions.IllegalArgumentException("Missing form object to remove");
433
- }
231
+ return { ...element,
232
+ dynamicschema: element.dynamicschema ? (0, _map.default)(_context3 = element.dynamicschema).call(_context3, item => ({ ...item,
233
+ elements: { ...item.elements,
234
+ dynamicschema
235
+ }
236
+ })) : null
237
+ };
238
+ })
239
+ };
240
+ }
241
+ /**
242
+ */
434
243
 
435
- if (formObjectModel.equals(this.currentFormObject)) {
436
- throw new _exceptions.IllegalArgumentException("Can not remove the current form object");
437
- }
438
244
 
439
- this.completedFormObjects = (0, _filter.default)(_context11 = this.completedFormObjects).call(_context11, function (formObject) {
440
- return !formObject.equals(formObjectModel);
441
- });
442
- }
443
- /**
444
- */
245
+ getMissingAnchors() {
246
+ var _this$data$missing$an, _this$data$missing;
445
247
 
446
- }, {
447
- key: "currentFormObject",
448
- get: function get() {
449
- return this._currentFormObject;
450
- }
451
- /**
452
- */
453
- ,
454
- set: function set(formObject) {
455
- this._currentFormObject = formObject;
456
- }
457
- /**
458
- * Completed objects are previously entered questions
459
- */
460
-
461
- }, {
462
- key: "completedFormObjects",
463
- get: function get() {
464
- return this._completedFormObjects;
465
- }
466
- /**
467
- */
468
- ,
469
- set: function set(formObjects) {
470
- this._completedFormObjects = formObjects;
471
- }
472
- /**
473
- * Previously entered objects are questions that have been entered before,
474
- * but are currently not applicable for the form.
475
- * For example because of previous navigation
476
- */
477
-
478
- }, {
479
- key: "previouslyEnteredFormObjects",
480
- get: function get() {
481
- return this._previouslyEnteredFormObjects;
482
- }
483
- /**
484
- */
485
- ,
486
- set: function set(formObjects) {
487
- this._previouslyEnteredFormObjects = formObjects;
488
- }
489
- /**
490
- * Handle end results
491
- */
492
-
493
- }, {
494
- key: "setEndResultFormObjects",
495
- value: function setEndResultFormObjects() {
496
- var _this3 = this;
497
-
498
- if (this.data && this.data.results) {
499
- var _this$data$missing$an2, _this$data$missing2, _context12, _context13;
500
-
501
- var missingObjects = (_this$data$missing$an2 = (_this$data$missing2 = this.data.missing) === null || _this$data$missing2 === void 0 ? void 0 : _this$data$missing2.anchors) !== null && _this$data$missing$an2 !== void 0 ? _this$data$missing$an2 : [];
502
- var missingObjectIds = (0, _map.default)(missingObjects).call(missingObjects, function (anchor) {
503
- return anchor.objectid;
504
- }); // Filter out intermediate results and rename elements property to result property
505
-
506
- var endResultAnchors = (0, _map.default)(_context12 = (0, _filter.default)(_context13 = this.data.results).call(_context13, function (result) {
507
- return !(0, _includes.default)(missingObjectIds).call(missingObjectIds, result.objectid);
508
- })).call(_context12, function (result) {
509
- var elements = result.elements,
510
- otherProps = (0, _objectWithoutProperties2.default)(result, _excluded);
511
- return _objectSpread(_objectSpread({}, otherProps), {}, {
512
- results: elements
513
- });
514
- });
248
+ const missingAnchors = (_this$data$missing$an = (_this$data$missing = this.data.missing) === null || _this$data$missing === void 0 ? void 0 : _this$data$missing.anchors) !== null && _this$data$missing$an !== void 0 ? _this$data$missing$an : []; // Add intermediate result data to anchor
249
+
250
+ return (0, _map.default)(missingAnchors).call(missingAnchors, anchor => {
251
+ if (this.data.results) {
252
+ var _context4;
515
253
 
516
- if (endResultAnchors.length > 0) {
517
- return (0, _map.default)(endResultAnchors).call(endResultAnchors, function (endResult) {
518
- return new _FormObjectModel.default(endResult, _this3.contributions.objects[endResult.objectid]);
519
- });
254
+ const resultObject = (0, _find.default)(_context4 = this.data.results).call(_context4, result => result.objectid === anchor.objectid && "elements" in result);
255
+
256
+ if (resultObject) {
257
+ anchor.results = resultObject.elements;
520
258
  }
521
259
  }
522
260
 
523
- return [];
524
- }
525
- /**
526
- */
261
+ return this.addGlobalDynamicSchema(anchor, this.data.dynamicschema);
262
+ });
263
+ }
264
+ /**
265
+ * Create form object based on the data and contributions available in this form
266
+ */
527
267
 
528
- }, {
529
- key: "expectsEndResultFormObjects",
530
- get: function get() {
531
- var _context14,
532
- _this4 = this;
533
268
 
534
- var endResultKeys = (0, _map.default)(_context14 = this.endResultFormObjects).call(_context14, function (endResult) {
535
- return endResult.key;
536
- });
537
- return this.objectKeys.some(function (objectKey) {
538
- var _this4$contributions$, _this4$contributions$2, _this4$contributions$3;
269
+ createFormObject() {
270
+ if (this.data && this.contributions) {
271
+ var _missingAnchors$0$obj, _missingAnchors$, _this$contributions$o;
539
272
 
540
- return ((_this4$contributions$ = _this4.contributions.objects) === null || _this4$contributions$ === void 0 ? void 0 : (_this4$contributions$2 = _this4$contributions$[objectKey]) === null || _this4$contributions$2 === void 0 ? void 0 : (_this4$contributions$3 = _this4$contributions$2.content) === null || _this4$contributions$3 === void 0 ? void 0 : _this4$contributions$3.results) && !(0, _includes.default)(endResultKeys).call(endResultKeys, objectKey);
541
- });
542
- }
543
- /**
544
- */
273
+ const missingAnchors = this.getMissingAnchors(); // Get object id from first anchor
545
274
 
546
- }, {
547
- key: "endResultFormObjects",
548
- get: function get() {
549
- return this._endResultFormObjects;
550
- }
551
- /**
552
- */
553
- ,
554
- set:
555
- /**
556
- */
557
- function set(endResultFormObjects) {
558
- var _context15;
559
-
560
- this.previousEndResultKeys = (0, _map.default)(_context15 = this.endResultFormObjects).call(_context15, function (endResult) {
561
- return endResult.key;
562
- });
563
- this._endResultFormObjects = endResultFormObjects;
275
+ const objectId = (_missingAnchors$0$obj = missingAnchors === null || missingAnchors === void 0 ? void 0 : (_missingAnchors$ = missingAnchors[0]) === null || _missingAnchors$ === void 0 ? void 0 : _missingAnchors$.objectid) !== null && _missingAnchors$0$obj !== void 0 ? _missingAnchors$0$obj : "";
276
+ const contributions = (_this$contributions$o = this.contributions.objects) === null || _this$contributions$o === void 0 ? void 0 : _this$contributions$o[objectId];
277
+
278
+ if (contributions) {
279
+ return new _FormObjectModel.default(missingAnchors[0], contributions);
280
+ }
564
281
  }
565
- /**
566
- */
567
282
 
568
- }, {
569
- key: "getEndResultFormObjects",
570
- value: function getEndResultFormObjects() {
571
- var _context16,
572
- _this5 = this;
283
+ return null;
284
+ }
285
+ /**
286
+ */
573
287
 
574
- return (0, _filter.default)(_context16 = this.endResultFormObjects).call(_context16, function (endResult) {
575
- var _context17;
576
288
 
577
- return !(0, _includes.default)(_context17 = _this5.previousEndResultKeys).call(_context17, endResult.key);
578
- });
579
- }
580
- }, {
581
- key: "previousEndResultKeys",
582
- get: function get() {
583
- return this._previousEndResultKeys;
584
- }
585
- /**
586
- */
587
- ,
588
- set: function set(endResultFormObjectKeys) {
589
- this._previousEndResultKeys = endResultFormObjectKeys;
590
- }
591
- /**
592
- * Error handling
593
- */
594
-
595
- }, {
596
- key: "isValid",
597
- get: function get() {
598
- var _this6 = this;
599
-
600
- if (this.currentFormObject) {
601
- var _this$currentFormObje4, _this$currentFormObje5;
602
-
603
- if (this.currentFormObject.isRepeatable) {
604
- var _context18, _context19;
605
-
606
- // repeating objects need at least one valid form object
607
- var hasOneValidQuestion = (0, _find.default)(_context18 = (0, _filter.default)(_context19 = this.allObjects).call(_context19, function (object) {
608
- return object.equals(_this6.currentFormObject, false);
609
- })).call(_context18, function (object) {
610
- return object.isValid;
611
- });
612
-
613
- if (hasOneValidQuestion) {
614
- return true;
615
- }
616
- }
289
+ addEmptyFormObject() {
290
+ let formObjectModel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.currentFormObject;
617
291
 
618
- return (_this$currentFormObje4 = (_this$currentFormObje5 = this.currentFormObject) === null || _this$currentFormObje5 === void 0 ? void 0 : _this$currentFormObje5.isValid) !== null && _this$currentFormObje4 !== void 0 ? _this$currentFormObje4 : true;
619
- }
292
+ if (formObjectModel) {
293
+ const emptyFormObject = _FormObjectModel.default.createEmpty(formObjectModel);
620
294
 
621
- return true;
295
+ emptyFormObject.repeatIndex = this.getHighestRepeatIndex(formObjectModel) + 1;
296
+ this.addFormObject(emptyFormObject);
622
297
  }
623
- /**
624
- */
625
-
626
- }, {
627
- key: "hasServerErrors",
628
- value: function hasServerErrors() {
629
- if (this.errorCollection.hasItems) {
630
- return true;
631
- }
298
+ }
299
+ /**
300
+ */
632
301
 
633
- if (this.currentFormObject) {
634
- return this.currentFormObject.hasServerErrors();
635
- }
636
302
 
637
- return false;
638
- }
639
- /**
640
- */
641
-
642
- }, {
643
- key: "hasErrors",
644
- value: function hasErrors() {
645
- if (this.errorCollection.hasItems) {
646
- return true;
647
- }
303
+ getHighestRepeatIndex(formObjectModel) {
304
+ var _context5, _context6;
648
305
 
649
- if (this.currentFormObject) {
650
- return this.currentFormObject.hasErrors();
651
- }
306
+ return Math.max(...(0, _map.default)(_context5 = (0, _filter.default)(_context6 = this.allObjects).call(_context6, formObject => formObject.equals(formObjectModel, false))).call(_context5, formObject => formObject.repeatIndex));
307
+ }
308
+ /**
309
+ */
652
310
 
653
- return false;
654
- }
655
- /**
656
- * Add an error to the error collection of this form
657
- */
658
-
659
- }, {
660
- key: "addServerError",
661
- value: function addServerError(error) {
662
- if (error.parameters) {
663
- this.errorCollection.addServerError(error.id, error.message, error.parameters);
664
- } else {
665
- this.errorCollection.addServerError(error.id, error.message);
666
- }
311
+
312
+ addFormObject(formObjectModel) {
313
+ if (!formObjectModel) {
314
+ throw new _exceptions.IllegalArgumentException("Missing form object to add");
667
315
  }
668
- /**
669
- * Reset error messages
670
- */
671
316
 
672
- }, {
673
- key: "resetErrors",
674
- value: function resetErrors() {
675
- this._errorCollection = new _ErrorCollection.default("form");
317
+ this.completedFormObjects = [...this.allObjects];
318
+ this.currentFormObject = formObjectModel;
319
+ }
320
+ /**
321
+ * Retrieve a form object by the key
322
+ */
676
323
 
677
- if (this.currentFormObject) {
678
- this.currentFormObject.resetErrors();
679
- }
680
- }
681
- /**
682
- */
683
324
 
684
- }, {
685
- key: "errorCollection",
686
- get: function get() {
687
- return this._errorCollection;
688
- }
689
- /**
690
- */
691
- ,
692
- set: function set(errorCollection) {
693
- this._errorCollection = errorCollection;
694
- }
695
- /**
696
- * Indicates if the form needs to be committed
697
- */
698
-
699
- }, {
700
- key: "commit",
701
- get: function get() {
702
- return this._commit || false;
703
- }
704
- /**
705
- */
706
- ,
707
- set: function set(commit) {
708
- this._commit = commit;
709
- }
710
- /**
711
- * Inidicates if form is finished: Form is completely entered and committed
712
- */
713
-
714
- }, {
715
- key: "isFinished",
716
- get: function get() {
717
- return this._isFinished || "success" in this.data;
718
- }
719
- /**
720
- */
721
- ,
722
- set: function set(isFinished) {
723
- this._isFinished = isFinished;
724
- }
725
- /**
726
- * Indicates if form is completely entered
727
- */
728
-
729
- }, {
730
- key: "isComplete",
731
- get: function get() {
732
- return this._isComplete;
733
- }
734
- /**
735
- */
736
- ,
737
- set: function set(isComplete) {
738
- this._isComplete = isComplete;
739
- }
740
- /**
741
- * Handle success redirects
742
- */
743
-
744
- }, {
745
- key: "successRedirect",
746
- get: function get() {
747
- return this.isFinished && this.data.success ? new _Href.default(this.data.success.redirect) : null;
748
- }
749
- /**
750
- */
325
+ getFormObjectByKey(key) {
326
+ var _context7;
751
327
 
752
- }, {
753
- key: "redirectLocation",
754
- get: function get() {
755
- return this._redirectLocation || this.successRedirect;
756
- }
757
- /**
758
- */
328
+ return (0, _find.default)(_context7 = this.allObjects).call(_context7, formObject => formObject.key === key);
329
+ }
330
+ /**
331
+ * Retrieve a form object by a layouthint
332
+ */
759
333
 
760
- }, {
761
- key: "getSuccessData",
762
- value: function getSuccessData() {
763
- var _this$data$success;
764
334
 
765
- return (_this$data$success = this.data.success) === null || _this$data$success === void 0 ? void 0 : _this$data$success.data;
766
- }
767
- /**
768
- * Href handling
769
- */
770
-
771
- }, {
772
- key: "setParameters",
773
- value: function setParameters(modularuiResponse) {
774
- var _modularuiResponse$pa;
775
-
776
- var parameters = (_modularuiResponse$pa = modularuiResponse === null || modularuiResponse === void 0 ? void 0 : modularuiResponse.parameters) !== null && _modularuiResponse$pa !== void 0 ? _modularuiResponse$pa : [];
777
- return (0, _map.default)(parameters).call(parameters, function (par) {
778
- return new _Parameter.default(par._prefix, par._name, par._value);
779
- });
780
- }
781
- /**
782
- */
335
+ getFormObjectByLayoutHint(hint) {
336
+ var _context8;
783
337
 
784
- }, {
785
- key: "parameters",
786
- get: function get() {
787
- return this._parameters;
788
- }
789
- /**
790
- */
791
- ,
792
- set: function set(parameters) {
793
- this._parameters = parameters;
338
+ return (0, _find.default)(_context8 = this.allObjects).call(_context8, formObject => formObject.layouthint.has(hint));
339
+ }
340
+ /**
341
+ */
342
+
343
+
344
+ removeFormObject(formObjectModel) {
345
+ var _context9;
346
+
347
+ if (!formObjectModel) {
348
+ throw new _exceptions.IllegalArgumentException("Missing form object to remove");
794
349
  }
795
- /**
796
- */
797
-
798
- }, {
799
- key: "selfhrefNoCommitParam",
800
- value: function selfhrefNoCommitParam() {
801
- var _context20;
802
-
803
- var selfhref = this.selflink.href;
804
- selfhref.method = _Constants.HTTP_METHODS.POST;
805
- selfhref.parameters = (0, _filter.default)(_context20 = this.parameters).call(_context20, function (parameter) {
806
- return parameter.name !== "commit";
807
- });
808
- return selfhref;
350
+
351
+ if (formObjectModel.equals(this.currentFormObject)) {
352
+ throw new _exceptions.IllegalArgumentException("Can not remove the current form object");
809
353
  }
810
- /**
811
- */
812
354
 
813
- }, {
814
- key: "selfhrefWithCommitParam",
815
- value: function selfhrefWithCommitParam() {
816
- var selfhref = this.selfhrefNoCommitParam();
355
+ this.completedFormObjects = (0, _filter.default)(_context9 = this.completedFormObjects).call(_context9, formObject => !formObject.equals(formObjectModel));
356
+ }
357
+ /**
358
+ */
817
359
 
818
- if (this.expectsEndResultFormObjects && !this.isComplete && !this.commit) {
819
- selfhref.addParameter("commit", "false");
820
- }
821
360
 
822
- return selfhref;
823
- }
824
- /**
825
- * Create a selfhref including the parameters that are used to start this form
826
- */
827
-
828
- }, {
829
- key: "selfhref",
830
- get: function get() {
831
- if (!this.selflink) {
832
- throw new Error("No self link found for form");
833
- }
361
+ get currentFormObject() {
362
+ return this._currentFormObject;
363
+ }
364
+ /**
365
+ */
834
366
 
835
- if ((0, _Settings.getSetting)("ALWAYS_COMMIT_FORM")) {
836
- return this.selfhrefNoCommitParam();
837
- }
838
367
 
839
- return this.selfhrefWithCommitParam();
840
- }
841
- /**
842
- * Handle form tokens to indicate concurrent form use
843
- */
368
+ set currentFormObject(formObject) {
369
+ this._currentFormObject = formObject;
370
+ }
371
+ /**
372
+ * Completed objects are previously entered questions
373
+ */
844
374
 
845
- }, {
846
- key: "tokens",
847
- get: function get() {
848
- if (!this._tokens) {
849
- var _this$data$tokens;
850
375
 
851
- this._tokens = (_this$data$tokens = this.data.tokens) !== null && _this$data$tokens !== void 0 ? _this$data$tokens : [];
852
- }
376
+ get completedFormObjects() {
377
+ return this._completedFormObjects;
378
+ }
379
+ /**
380
+ */
853
381
 
854
- return this._tokens;
855
- }
856
- /**
857
- * Replaces all tokens with the given collection of tokens
858
- */
859
- ,
860
- set: function set(tokens) {
861
- this._tokens = tokens;
862
- }
863
- /**
864
- * Removes all tokens from the form
865
- */
866
-
867
- }, {
868
- key: "removeTokens",
869
- value: function removeTokens() {
870
- this._tokens = [];
871
- }
872
- /**
873
- * Keep track of changed form
874
- */
875
-
876
- }, {
877
- key: "isChanged",
878
- value: function isChanged() {
879
- return this.currentFormObject !== null && this.currentFormObject.isChangedSince(this.lastUpdate);
880
- }
881
- /**
882
- */
883
382
 
884
- }, {
885
- key: "lastUpdate",
886
- get: function get() {
887
- return this._lastUpdate;
888
- }
889
- /**
890
- */
891
- ,
892
- set: function set(lastUpdate) {
893
- this._lastUpdate = lastUpdate;
894
- }
895
- /**
896
- */
897
-
898
- }, {
899
- key: "getFormDataObjects",
900
- value: function getFormDataObjects() {
901
- var _context21,
902
- _this7 = this;
903
-
904
- var validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
905
- var validationData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
906
- var formdata = [];
907
- var formObjects = (0, _filter.default)(_context21 = this.allObjects).call(_context21, function (formObject, index) {
908
- // repeatabe object without fixed nr of repeats, remove last form object from formdata,
909
- // because this is the formobject that is used as a placeholder for the create object
910
- // of the collection of repeats
911
- if (formObject.isRepeatable && !formObject.hasFixedNrOfRepeats) {
912
- var isLastRepeat = index === _this7.allObjects.length - 1 || _this7.allObjects[index + 1].key !== formObject.key;
913
-
914
- if (isLastRepeat) {
915
- return false;
916
- }
917
- }
383
+ set completedFormObjects(formObjects) {
384
+ this._completedFormObjects = formObjects;
385
+ }
386
+ /**
387
+ * Previously entered objects are questions that have been entered before,
388
+ * but are currently not applicable for the form.
389
+ * For example because of previous navigation
390
+ */
918
391
 
919
- return formObject.isValid || !validOnly;
920
- });
921
- formObjects.forEach(function (formObject) {
922
- var objectFormData = formObject.getFormData(validationData);
923
- var existingObjectIndex = (0, _findIndex.default)(formdata).call(formdata, function (obj) {
924
- return obj.key === formObject.key && obj.repeatIndex === formObject.repeatIndex;
925
- });
926
- /*
927
- * when the object already exists in the formdata with the same key and index,
928
- * merge the attributes of both objects together
929
- */
930
392
 
931
- if (existingObjectIndex > -1) {
932
- formdata[existingObjectIndex].formdata = (0, _deepmerge.default)(formdata[existingObjectIndex].formdata, objectFormData);
933
- } else {
934
- formdata.push({
935
- key: formObject.key,
936
- repeatIndex: formObject.repeatIndex,
937
- formdata: objectFormData
938
- });
939
- }
940
- });
941
- return (0, _map.default)(formdata).call(formdata, function (obj) {
942
- return (0, _defineProperty2.default)({}, obj.key, obj.formdata);
943
- });
944
- }
945
- /**
946
- */
947
-
948
- }, {
949
- key: "getFormData",
950
- value: function getFormData() {
951
- var validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
952
- var withConcurrencyToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
953
- var validationData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
954
-
955
- if (withConcurrencyToken && this.tokens.length > 0) {
956
- return (0, _stringify.default)({
957
- objects: this.getFormDataObjects(validOnly, validationData),
958
- tokens: this.tokens
959
- });
960
- }
393
+ get previouslyEnteredFormObjects() {
394
+ return this._previouslyEnteredFormObjects;
395
+ }
396
+ /**
397
+ */
961
398
 
962
- return (0, _stringify.default)({
963
- objects: this.getFormDataObjects(validOnly, validationData)
964
- });
965
- }
966
- /**
967
- * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
968
- */
969
-
970
- }, {
971
- key: "setUseClientsideValidation",
972
- value: function setUseClientsideValidation(enabled) {
973
- this._useClientsideValidation = enabled;
974
- this.allObjects.forEach(function (formObject) {
975
- formObject.attributeCollection.all.forEach(function (item) {
976
- return item.setUseClientsideValidation(enabled);
977
- });
978
- });
979
- }
980
- /**
981
- * Indicates if client side validation is enabled
982
- * @returns {boolean}
983
- */
984
399
 
985
- }, {
986
- key: "useClientsideValidation",
987
- value: function useClientsideValidation() {
988
- var _this$_useClientsideV;
400
+ set previouslyEnteredFormObjects(formObjects) {
401
+ this._previouslyEnteredFormObjects = formObjects;
402
+ }
403
+ /**
404
+ * Handle end results
405
+ */
989
406
 
990
- return (_this$_useClientsideV = this._useClientsideValidation) !== null && _this$_useClientsideV !== void 0 ? _this$_useClientsideV : true;
991
- }
992
- /**
993
- * Get form data for submitting
994
- */
995
-
996
- }, {
997
- key: "formdata",
998
- get: function get() {
999
- return this.getFormData(this.useClientsideValidation());
1000
- }
1001
- /**
1002
- */
1003
407
 
1004
- }, {
1005
- key: "validationData",
1006
- get: function get() {
1007
- return this.getFormData(false, false, true);
1008
- }
1009
- /**
1010
- * Form navigation: Go one object back (previous button)
1011
- */
1012
-
1013
- }, {
1014
- key: "hasPreviousStep",
1015
- get: function get() {
1016
- var _context22;
1017
-
1018
- var currentFormObjectKey = this.currentFormObject != null ? this.currentFormObject.key : "";
1019
- return (0, _filter.default)(_context22 = this.completedFormObjects).call(_context22, function (formObject) {
1020
- return !formObject.isRepeatWithUnknownTotal || formObject.key !== currentFormObjectKey;
1021
- }).length > 0;
1022
- }
1023
- /**
1024
- * Go one form-object back,
1025
- * for repeating object this means go back
1026
- * until we get at a form object that had
1027
- * a different key than the current form object
1028
- */
1029
-
1030
- }, {
1031
- key: "setPreviousObject",
1032
- value: function setPreviousObject() {
1033
- var _context24,
1034
- _context25,
1035
- _context26,
1036
- _this8 = this,
1037
- _context27,
1038
- _context28;
1039
-
1040
- this.isComplete = false;
1041
- var oldCurrentFormObject = this.currentFormObject;
1042
-
1043
- if (this.currentFormObject !== null) {
1044
- var _context23;
1045
-
1046
- this.previouslyEnteredFormObjects = (0, _concat.default)(_context23 = [this.currentFormObject]).call(_context23, (0, _toConsumableArray2.default)(this.previouslyEnteredFormObjects));
1047
- }
408
+ setEndResultFormObjects() {
409
+ if (this.data && this.data.results) {
410
+ var _this$data$missing$an2, _this$data$missing2, _context10, _context11;
1048
411
 
1049
- this.currentFormObject = this.completedFormObjects[this.completedFormObjects.length - 1];
1050
- this.completedFormObjects = (0, _slice.default)(_context24 = this.completedFormObjects).call(_context24, 0, -1);
1051
- var completedFormObjectKeys = (0, _filter.default)(_context25 = (0, _map.default)(_context26 = this.completedFormObjects).call(_context26, function (formObject) {
1052
- return formObject.key;
1053
- })).call(_context25, function (formObjectKey) {
1054
- var _this8$currentFormObj;
412
+ const missingObjects = (_this$data$missing$an2 = (_this$data$missing2 = this.data.missing) === null || _this$data$missing2 === void 0 ? void 0 : _this$data$missing2.anchors) !== null && _this$data$missing$an2 !== void 0 ? _this$data$missing$an2 : [];
413
+ const missingObjectIds = (0, _map.default)(missingObjects).call(missingObjects, anchor => anchor.objectid); // Filter out intermediate results and rename elements property to result property
1055
414
 
1056
- return formObjectKey !== ((_this8$currentFormObj = _this8.currentFormObject) === null || _this8$currentFormObj === void 0 ? void 0 : _this8$currentFormObj.key);
1057
- });
1058
- this.endResultFormObjects = (0, _filter.default)(_context27 = this._endResultFormObjects).call(_context27, function (endResult) {
1059
- return (0, _includes.default)(completedFormObjectKeys).call(completedFormObjectKeys, endResult.key);
415
+ const endResultAnchors = (0, _map.default)(_context10 = (0, _filter.default)(_context11 = this.data.results).call(_context11, result => !(0, _includes.default)(missingObjectIds).call(missingObjectIds, result.objectid))).call(_context10, result => {
416
+ const {
417
+ elements,
418
+ ...otherProps
419
+ } = result;
420
+ return { ...otherProps,
421
+ results: elements
422
+ };
1060
423
  });
1061
- this.previousEndResultKeys = (0, _map.default)(_context28 = this.endResultFormObjects).call(_context28, function (endResult) {
1062
- return endResult.key;
1063
- }); // while we are at the same repeating form object, go a step back
1064
424
 
1065
- if (this.currentFormObject && this.currentFormObject.equals(oldCurrentFormObject, this.currentFormObject.hasFixedNrOfRepeats)) {
1066
- this.setPreviousObject();
425
+ if (endResultAnchors.length > 0) {
426
+ return (0, _map.default)(endResultAnchors).call(endResultAnchors, endResult => new _FormObjectModel.default(endResult, this.contributions.objects[endResult.objectid]));
1067
427
  }
1068
428
  }
1069
- /**
1070
- * Form navigation: has next step or is last
1071
- */
1072
429
 
1073
- }, {
1074
- key: "hasNextStep",
1075
- get: function get() {
1076
- var _context29,
1077
- _this9 = this;
430
+ return [];
431
+ }
432
+ /**
433
+ */
1078
434
 
1079
- if (this.isComplete || this.isFinished || this.hasNoQuestionsConfigured || !this.contributions.objects) {
1080
- return false;
1081
- } // current object is a dynamic object
1082
435
 
436
+ get expectsEndResultFormObjects() {
437
+ var _context12;
1083
438
 
1084
- if (this.currentFormObject && this.currentFormObject.isDynamic) {
1085
- return true;
1086
- }
439
+ const endResultKeys = (0, _map.default)(_context12 = this.endResultFormObjects).call(_context12, endResult => endResult.key);
440
+ return this.objectKeys.some(objectKey => {
441
+ var _this$contributions$o2, _this$contributions$o3, _this$contributions$o4;
1087
442
 
1088
- if (this.expectsEndResultFormObjects) {
1089
- return true;
1090
- }
443
+ return ((_this$contributions$o2 = this.contributions.objects) === null || _this$contributions$o2 === void 0 ? void 0 : (_this$contributions$o3 = _this$contributions$o2[objectKey]) === null || _this$contributions$o3 === void 0 ? void 0 : (_this$contributions$o4 = _this$contributions$o3.content) === null || _this$contributions$o4 === void 0 ? void 0 : _this$contributions$o4.results) && !(0, _includes.default)(endResultKeys).call(endResultKeys, objectKey);
444
+ });
445
+ }
446
+ /**
447
+ */
1091
448
 
1092
- var currentObjectIndex = (0, _findIndex.default)(_context29 = this.objectKeys).call(_context29, function (objectKey) {
1093
- var _this9$currentFormObj;
1094
449
 
1095
- return objectKey === ((_this9$currentFormObj = _this9.currentFormObject) === null || _this9$currentFormObj === void 0 ? void 0 : _this9$currentFormObj.key);
1096
- });
1097
- var isLastObject = this.objectKeys.length - 1 === currentObjectIndex; // current object is a repeating question but it is not the last one
450
+ get endResultFormObjects() {
451
+ return this._endResultFormObjects;
452
+ }
453
+ /**
454
+ */
1098
455
 
1099
- if (isLastObject && this.currentFormObject && this.currentFormObject.isRepeatable && !this.currentFormObject.isLastRepeat) {
1100
- return true;
1101
- } // current object is not repeatable and the last object
1102
456
 
457
+ getEndResultFormObjects() {
458
+ var _context13;
1103
459
 
1104
- if (isLastObject) {
1105
- return false;
1106
- } // can't determine if this is te last, render a next button
460
+ return (0, _filter.default)(_context13 = this.endResultFormObjects).call(_context13, endResult => {
461
+ var _context14;
1107
462
 
463
+ return !(0, _includes.default)(_context14 = this.previousEndResultKeys).call(_context14, endResult.key);
464
+ });
465
+ }
466
+ /**
467
+ */
1108
468
 
1109
- return true;
1110
- }
1111
- /**
1112
- * Merge existing form with new form
1113
- */
1114
-
1115
- }, {
1116
- key: "update",
1117
- value: function update(receivedForm) {
1118
- if (receivedForm instanceof FormModel) {
1119
- var _receivedForm$data;
1120
-
1121
- this.resetErrors();
1122
- this.lastUpdate = Date.now();
1123
- this.lastServerUpdate = receivedForm.lastServerUpdate;
1124
- this.tokens = receivedForm.tokens;
1125
- this.isComplete = receivedForm.isComplete;
1126
- this.isFinished = receivedForm.isFinished;
1127
- var receivedFormData = (_receivedForm$data = receivedForm.data) !== null && _receivedForm$data !== void 0 ? _receivedForm$data : {};
1128
- var hasMissing = (0, _objects.has)(receivedFormData, "missing");
1129
- var hasErrors = (0, _objects.has)(receivedFormData, "errors");
1130
-
1131
- if (!hasMissing && !hasErrors) {
1132
- this.handleFinished(receivedForm);
1133
- }
1134
469
 
1135
- if (hasErrors) {
1136
- this.handleErrors(receivedForm);
1137
- }
470
+ set endResultFormObjects(endResultFormObjects) {
471
+ var _context15;
1138
472
 
1139
- if (hasMissing) {
1140
- this.handleMissing(receivedForm);
1141
- }
1142
- }
473
+ this.previousEndResultKeys = (0, _map.default)(_context15 = this.endResultFormObjects).call(_context15, endResult => endResult.key);
474
+ this._endResultFormObjects = endResultFormObjects;
475
+ }
476
+ /**
477
+ */
1143
478
 
1144
- return this;
1145
- }
1146
- /**
1147
- */
1148
-
1149
- }, {
1150
- key: "updateValidations",
1151
- value: function updateValidations(data) {
1152
- if (this.currentFormObject) {
1153
- this.currentFormObject.updateValidations(data);
479
+
480
+ get previousEndResultKeys() {
481
+ return this._previousEndResultKeys;
482
+ }
483
+ /**
484
+ */
485
+
486
+
487
+ set previousEndResultKeys(endResultFormObjectKeys) {
488
+ this._previousEndResultKeys = endResultFormObjectKeys;
489
+ }
490
+ /**
491
+ * Error handling
492
+ */
493
+
494
+
495
+ get isValid() {
496
+ if (this.currentFormObject) {
497
+ var _this$currentFormObje4, _this$currentFormObje5;
498
+
499
+ if (this.currentFormObject.isRepeatable) {
500
+ var _context16, _context17;
501
+
502
+ // repeating objects need at least one valid form object
503
+ const hasOneValidQuestion = (0, _find.default)(_context16 = (0, _filter.default)(_context17 = this.allObjects).call(_context17, object => object.equals(this.currentFormObject, false))).call(_context16, object => object.isValid);
504
+
505
+ if (hasOneValidQuestion) {
506
+ return true;
507
+ }
1154
508
  }
1155
509
 
1156
- return this;
510
+ return (_this$currentFormObje4 = (_this$currentFormObje5 = this.currentFormObject) === null || _this$currentFormObje5 === void 0 ? void 0 : _this$currentFormObje5.isValid) !== null && _this$currentFormObje4 !== void 0 ? _this$currentFormObje4 : true;
1157
511
  }
1158
- /**
1159
- * Process finished form
1160
- */
1161
-
1162
- }, {
1163
- key: "handleFinished",
1164
- value: function handleFinished(receivedForm) {
1165
- if (this.currentFormObject) {
1166
- var _context30;
1167
512
 
1168
- this.completedFormObjects = (0, _concat.default)(_context30 = []).call(_context30, (0, _toConsumableArray2.default)(this.completedFormObjects), [this.currentFormObject]);
1169
- }
513
+ return true;
514
+ }
515
+ /**
516
+ */
1170
517
 
1171
- this.currentFormObject = receivedForm.currentFormObject;
1172
- this.endResultFormObjects = receivedForm.endResultFormObjects;
1173
- this._data = receivedForm._data;
518
+
519
+ hasServerErrors() {
520
+ if (this.errorCollection.hasItems) {
521
+ return true;
1174
522
  }
1175
- /**
1176
- */
1177
-
1178
- }, {
1179
- key: "handleRootErrors",
1180
- value: function handleRootErrors(errors) {
1181
- var _this10 = this;
1182
-
1183
- (0, _filter.default)(errors).call(errors, function (error) {
1184
- return !error.anchor;
1185
- }).forEach(function (error) {
1186
- _this10.errorCollection.addServerError(error.id, error.message, error.properties);
1187
- });
523
+
524
+ if (this.currentFormObject) {
525
+ return this.currentFormObject.hasServerErrors();
1188
526
  }
1189
- /**
1190
- * Process errors from received form
1191
- */
1192
-
1193
- }, {
1194
- key: "handleErrors",
1195
- value: function handleErrors(receivedForm) {
1196
- var _this11 = this;
1197
-
1198
- var errorAnchors = receivedForm.data.errors;
1199
-
1200
- if (errorAnchors) {
1201
- errorAnchors.forEach(function (error) {
1202
- if (error.anchor && _this11.currentFormObject && _this11.currentFormObject.key === error.anchor.objectid) {
1203
- _this11.currentFormObject.addServerError(error);
1204
- } else {
1205
- _this11.errorCollection.addServerError(error.id, error.message, error.properties);
1206
- }
1207
- });
1208
- }
527
+
528
+ return false;
529
+ }
530
+ /**
531
+ */
532
+
533
+
534
+ hasErrors() {
535
+ if (this.errorCollection.hasItems) {
536
+ return true;
1209
537
  }
1210
- /**
1211
- * Process missing from received form
1212
- */
1213
-
1214
- }, {
1215
- key: "handleMissing",
1216
- value: function handleMissing(receivedForm) {
1217
- if (this.currentFormObject && this.currentFormObject.equals(receivedForm.currentFormObject)) {
1218
- this.handleMissingErrors(receivedForm);
1219
- } else {
1220
- this.handleNewFormObject(receivedForm);
1221
- }
538
+
539
+ if (this.currentFormObject) {
540
+ return this.currentFormObject.hasErrors();
1222
541
  }
1223
- /**
1224
- * Received missing anchors in the response with an object id that is the current form object
1225
- */
1226
542
 
1227
- }, {
1228
- key: "processMissingErrors",
1229
- value: function processMissingErrors(receivedForm) {
1230
- var _context31;
543
+ return false;
544
+ }
545
+ /**
546
+ * Add an error to the error collection of this form
547
+ */
1231
548
 
1232
- if (this.currentFormObject === null) {
1233
- return null;
1234
- }
1235
549
 
1236
- (0, _map.default)(_context31 = this.currentFormObject.attributeCollection).call(_context31, function (attribute) {
1237
- if (receivedForm.currentFormObject && receivedForm.currentFormObject.hasAttributeByKey(attribute.key)) {
1238
- attribute.addMissingError();
1239
- } else {
1240
- attribute.removeMissingError();
1241
- }
550
+ addServerError(error) {
551
+ if (error.parameters) {
552
+ this.errorCollection.addServerError(error.id, error.message, error.parameters);
553
+ } else {
554
+ this.errorCollection.addServerError(error.id, error.message);
555
+ }
556
+ }
557
+ /**
558
+ * Reset error messages
559
+ */
1242
560
 
1243
- return attribute;
1244
- });
1245
- return this.currentFormObject;
561
+
562
+ resetErrors() {
563
+ this._errorCollection = new _ErrorCollection.default("form");
564
+
565
+ if (this.currentFormObject) {
566
+ this.currentFormObject.resetErrors();
1246
567
  }
1247
- /**
1248
- */
568
+ }
569
+ /**
570
+ */
571
+
572
+
573
+ get errorCollection() {
574
+ return this._errorCollection;
575
+ }
576
+ /**
577
+ */
578
+
579
+
580
+ set errorCollection(errorCollection) {
581
+ this._errorCollection = errorCollection;
582
+ }
583
+ /**
584
+ * Indicates if the form needs to be committed
585
+ */
586
+
587
+
588
+ get commit() {
589
+ return this._commit || false;
590
+ }
591
+ /**
592
+ */
1249
593
 
1250
- }, {
1251
- key: "handleMissingErrors",
1252
- value: function handleMissingErrors(receivedForm) {
1253
- this.currentFormObject = this.processMissingErrors(receivedForm);
594
+
595
+ set commit(commit) {
596
+ this._commit = commit;
597
+ }
598
+ /**
599
+ * Inidicates if form is finished: Form is completely entered and committed
600
+ */
601
+
602
+
603
+ get isFinished() {
604
+ return this._isFinished || "success" in this.data;
605
+ }
606
+ /**
607
+ */
608
+
609
+
610
+ set isFinished(isFinished) {
611
+ this._isFinished = isFinished;
612
+ }
613
+ /**
614
+ * Indicates if form is completely entered
615
+ */
616
+
617
+
618
+ get isComplete() {
619
+ return this._isComplete;
620
+ }
621
+ /**
622
+ */
623
+
624
+
625
+ set isComplete(isComplete) {
626
+ this._isComplete = isComplete;
627
+ }
628
+ /**
629
+ * Handle success redirects
630
+ */
631
+
632
+
633
+ get successRedirect() {
634
+ return this.isFinished && this.data.success ? new _Href.default(this.data.success.redirect) : null;
635
+ }
636
+ /**
637
+ */
638
+
639
+
640
+ get redirectLocation() {
641
+ return this._redirectLocation || this.successRedirect;
642
+ }
643
+ /**
644
+ */
645
+
646
+
647
+ getSuccessData() {
648
+ var _this$data$success;
649
+
650
+ return (_this$data$success = this.data.success) === null || _this$data$success === void 0 ? void 0 : _this$data$success.data;
651
+ }
652
+ /**
653
+ * Href handling
654
+ */
655
+
656
+
657
+ setParameters(modularuiResponse) {
658
+ var _modularuiResponse$pa;
659
+
660
+ const parameters = (_modularuiResponse$pa = modularuiResponse === null || modularuiResponse === void 0 ? void 0 : modularuiResponse.parameters) !== null && _modularuiResponse$pa !== void 0 ? _modularuiResponse$pa : [];
661
+ return (0, _map.default)(parameters).call(parameters, par => new _Parameter.default(par._prefix, par._name, par._value));
662
+ }
663
+ /**
664
+ */
665
+
666
+
667
+ get parameters() {
668
+ return this._parameters;
669
+ }
670
+ /**
671
+ */
672
+
673
+
674
+ set parameters(parameters) {
675
+ this._parameters = parameters;
676
+ }
677
+ /**
678
+ */
679
+
680
+
681
+ selfhrefNoCommitParam() {
682
+ var _context18;
683
+
684
+ const selfhref = this.selflink.href;
685
+ selfhref.method = _Constants.HTTP_METHODS.POST;
686
+ selfhref.parameters = (0, _filter.default)(_context18 = this.parameters).call(_context18, parameter => parameter.name !== "commit");
687
+ return selfhref;
688
+ }
689
+ /**
690
+ */
691
+
692
+
693
+ selfhrefWithCommitParam() {
694
+ const selfhref = this.selfhrefNoCommitParam();
695
+
696
+ if (this.expectsEndResultFormObjects && !this.isComplete && !this.commit) {
697
+ selfhref.addParameter("commit", "false");
1254
698
  }
1255
- /**
1256
- */
1257
-
1258
- }, {
1259
- key: "handleNewFormObject",
1260
- value: function handleNewFormObject(receivedForm) {
1261
- this.endResultFormObjects = receivedForm.endResultFormObjects;
1262
- var receivedCurrentFormObject = receivedForm.currentFormObject;
1263
-
1264
- if (receivedCurrentFormObject === null) {
1265
- this.completedFormObjects = (0, _toConsumableArray2.default)(this.allObjects);
1266
- this.currentFormObject = null;
1267
- } else {
1268
- var _context32;
1269
699
 
1270
- // check if received form exists in the previously entered form objects
1271
- var previouslyEnteredFormObjects = (0, _filter.default)(_context32 = this.previouslyEnteredFormObjects).call(_context32, function (formObject) {
1272
- return formObject.equals(receivedCurrentFormObject, formObject.hasFixedNrOfRepeats);
1273
- });
700
+ return selfhref;
701
+ }
702
+ /**
703
+ * Create a selfhref including the parameters that are used to start this form
704
+ */
1274
705
 
1275
- if (previouslyEnteredFormObjects.length > 0) {
1276
- this.handlePreviouslyEnteredFormObjects(receivedCurrentFormObject, previouslyEnteredFormObjects);
1277
- } else {
1278
- this.completedFormObjects = (0, _toConsumableArray2.default)(this.allObjects);
1279
- this.currentFormObject = receivedCurrentFormObject;
1280
- }
1281
- }
706
+
707
+ get selfhref() {
708
+ if (!this.selflink) {
709
+ throw new Error("No self link found for form");
1282
710
  }
1283
- /**
1284
- * Indicate if a new form object model should be merged with a previousled entered form object model
1285
- * Set this property to false on the form that receives the new form to skip the merge behavior
1286
- */
1287
-
1288
- }, {
1289
- key: "mergePreviouslyEnteredObjects",
1290
- get: function get() {
1291
- return this._mergePreviouslyEnteredObjects;
711
+
712
+ if ((0, _Settings.getSetting)("ALWAYS_COMMIT_FORM")) {
713
+ return this.selfhrefNoCommitParam();
1292
714
  }
1293
- /**
1294
- */
1295
- ,
1296
- set: function set(mergePreviouslyEnteredObjects) {
1297
- this._mergePreviouslyEnteredObjects = mergePreviouslyEnteredObjects;
715
+
716
+ return this.selfhrefWithCommitParam();
717
+ }
718
+ /**
719
+ * Handle form tokens to indicate concurrent form use
720
+ */
721
+
722
+
723
+ get tokens() {
724
+ if (!this._tokens) {
725
+ var _this$data$tokens;
726
+
727
+ this._tokens = (_this$data$tokens = this.data.tokens) !== null && _this$data$tokens !== void 0 ? _this$data$tokens : [];
1298
728
  }
1299
- /**
1300
- */
1301
729
 
1302
- }, {
1303
- key: "handlePreviouslyEnteredFormObjects",
1304
- value: function handlePreviouslyEnteredFormObjects(receivedCurrentFormObject, previouslyEnteredFormObjects) {
1305
- var _this12 = this,
1306
- _context33;
730
+ return this._tokens;
731
+ }
732
+ /**
733
+ * Replaces all tokens with the given collection of tokens
734
+ */
735
+
736
+
737
+ set tokens(tokens) {
738
+ this._tokens = tokens;
739
+ }
740
+ /**
741
+ * Removes all tokens from the form
742
+ */
743
+
744
+
745
+ removeTokens() {
746
+ this._tokens = [];
747
+ }
748
+ /**
749
+ * Keep track of changed form
750
+ */
751
+
752
+
753
+ isChanged() {
754
+ return this.currentFormObject !== null && this.currentFormObject.isChangedSince(this.lastUpdate);
755
+ }
756
+ /**
757
+ */
758
+
759
+
760
+ get lastUpdate() {
761
+ return this._lastUpdate;
762
+ }
763
+ /**
764
+ */
765
+
766
+
767
+ set lastUpdate(lastUpdate) {
768
+ this._lastUpdate = lastUpdate;
769
+ }
770
+ /**
771
+ */
772
+
1307
773
 
1308
- previouslyEnteredFormObjects.forEach(function (previouslyEnteredFormObject) {
1309
- var mergedObject = _this12.mergePreviouslyEnteredObjects ? _this12.mergeObjects(receivedCurrentFormObject, previouslyEnteredFormObject) : receivedCurrentFormObject;
774
+ getFormDataObjects() {
775
+ var _context19;
1310
776
 
1311
- _this12.addFormObject(mergedObject);
1312
- }); // remove the previously entered form object
777
+ let validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
778
+ let validationData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
779
+ const formdata = [];
780
+ const formObjects = (0, _filter.default)(_context19 = this.allObjects).call(_context19, (formObject, index) => {
781
+ // repeatabe object without fixed nr of repeats, remove last form object from formdata,
782
+ // because this is the formobject that is used as a placeholder for the create object
783
+ // of the collection of repeats
784
+ if (formObject.isRepeatable && !formObject.hasFixedNrOfRepeats) {
785
+ const isLastRepeat = index === this.allObjects.length - 1 || this.allObjects[index + 1].key !== formObject.key;
1313
786
 
1314
- this.previouslyEnteredFormObjects = (0, _filter.default)(_context33 = this.previouslyEnteredFormObjects).call(_context33, function (formObject) {
1315
- var hasPreviouslyEnteredObject = (0, _find.default)(previouslyEnteredFormObjects).call(previouslyEnteredFormObjects, function (previouslyEnteredFormObject) {
1316
- return formObject.equals(previouslyEnteredFormObject);
787
+ if (isLastRepeat) {
788
+ return false;
789
+ }
790
+ }
791
+
792
+ return formObject.isValid || !validOnly;
793
+ });
794
+ formObjects.forEach(formObject => {
795
+ const objectFormData = formObject.getFormData(validationData);
796
+ const existingObjectIndex = (0, _findIndex.default)(formdata).call(formdata, obj => obj.key === formObject.key && obj.repeatIndex === formObject.repeatIndex);
797
+ /*
798
+ * when the object already exists in the formdata with the same key and index,
799
+ * merge the attributes of both objects together
800
+ */
801
+
802
+ if (existingObjectIndex > -1) {
803
+ formdata[existingObjectIndex].formdata = (0, _deepmerge.default)(formdata[existingObjectIndex].formdata, objectFormData);
804
+ } else {
805
+ formdata.push({
806
+ key: formObject.key,
807
+ repeatIndex: formObject.repeatIndex,
808
+ formdata: objectFormData
1317
809
  });
1318
- return !hasPreviouslyEnteredObject;
810
+ }
811
+ });
812
+ return (0, _map.default)(formdata).call(formdata, obj => ({
813
+ [obj.key]: obj.formdata
814
+ }));
815
+ }
816
+ /**
817
+ */
818
+
819
+
820
+ getFormData() {
821
+ let validOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
822
+ let withConcurrencyToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
823
+ let validationData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
824
+
825
+ if (withConcurrencyToken && this.tokens.length > 0) {
826
+ return (0, _stringify.default)({
827
+ objects: this.getFormDataObjects(validOnly, validationData),
828
+ tokens: this.tokens
1319
829
  });
1320
830
  }
1321
- /**
1322
- */
1323
831
 
1324
- }, {
1325
- key: "mergeObjects",
1326
- value: function mergeObjects(newObject, oldObject) {
1327
- var mergedFormObject = _FormObjectModel.default.createEmpty(newObject);
832
+ return (0, _stringify.default)({
833
+ objects: this.getFormDataObjects(validOnly, validationData)
834
+ });
835
+ }
836
+ /**
837
+ * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
838
+ */
839
+
840
+
841
+ setUseClientsideValidation(enabled) {
842
+ this._useClientsideValidation = enabled;
843
+ this.allObjects.forEach(formObject => {
844
+ formObject.attributeCollection.all.forEach(item => item.setUseClientsideValidation(enabled));
845
+ });
846
+ }
847
+ /**
848
+ * Indicates if client side validation is enabled
849
+ * @returns {boolean}
850
+ */
851
+
852
+
853
+ useClientsideValidation() {
854
+ var _this$_useClientsideV;
855
+
856
+ return (_this$_useClientsideV = this._useClientsideValidation) !== null && _this$_useClientsideV !== void 0 ? _this$_useClientsideV : true;
857
+ }
858
+ /**
859
+ * Get form data for submitting
860
+ */
861
+
862
+
863
+ get formdata() {
864
+ return this.getFormData(this.useClientsideValidation());
865
+ }
866
+ /**
867
+ */
868
+
869
+
870
+ get validationData() {
871
+ return this.getFormData(false, false, true);
872
+ }
873
+ /**
874
+ * Form navigation: Go one object back (previous button)
875
+ */
876
+
877
+
878
+ get hasPreviousStep() {
879
+ var _context20;
880
+
881
+ const currentFormObjectKey = this.currentFormObject != null ? this.currentFormObject.key : "";
882
+ return (0, _filter.default)(_context20 = this.completedFormObjects).call(_context20, formObject => !formObject.isRepeatWithUnknownTotal || formObject.key !== currentFormObjectKey).length > 0;
883
+ }
884
+ /**
885
+ * Go one form-object back,
886
+ * for repeating object this means go back
887
+ * until we get at a form object that had
888
+ * a different key than the current form object
889
+ */
890
+
891
+
892
+ setPreviousObject() {
893
+ var _context21, _context22, _context23, _context24, _context25;
894
+
895
+ this.isComplete = false;
896
+ const oldCurrentFormObject = this.currentFormObject;
897
+
898
+ if (this.currentFormObject !== null) {
899
+ this.previouslyEnteredFormObjects = [this.currentFormObject, ...this.previouslyEnteredFormObjects];
900
+ }
901
+
902
+ this.currentFormObject = this.completedFormObjects[this.completedFormObjects.length - 1];
903
+ this.completedFormObjects = (0, _slice.default)(_context21 = this.completedFormObjects).call(_context21, 0, -1);
904
+ const completedFormObjectKeys = (0, _filter.default)(_context22 = (0, _map.default)(_context23 = this.completedFormObjects).call(_context23, formObject => formObject.key)).call(_context22, formObjectKey => {
905
+ var _this$currentFormObje6;
906
+
907
+ return formObjectKey !== ((_this$currentFormObje6 = this.currentFormObject) === null || _this$currentFormObje6 === void 0 ? void 0 : _this$currentFormObje6.key);
908
+ });
909
+ this.endResultFormObjects = (0, _filter.default)(_context24 = this._endResultFormObjects).call(_context24, endResult => (0, _includes.default)(completedFormObjectKeys).call(completedFormObjectKeys, endResult.key));
910
+ this.previousEndResultKeys = (0, _map.default)(_context25 = this.endResultFormObjects).call(_context25, endResult => endResult.key); // while we are at the same repeating form object, go a step back
911
+
912
+ if (this.currentFormObject && this.currentFormObject.equals(oldCurrentFormObject, this.currentFormObject.hasFixedNrOfRepeats)) {
913
+ this.setPreviousObject();
914
+ }
915
+ }
916
+ /**
917
+ * Form navigation: has next step or is last
918
+ */
919
+
920
+
921
+ get hasNextStep() {
922
+ var _context26;
923
+
924
+ if (this.isComplete || this.isFinished || this.hasNoQuestionsConfigured || !this.contributions.objects) {
925
+ return false;
926
+ } // current object is a dynamic object
927
+
928
+
929
+ if (this.currentFormObject && this.currentFormObject.isDynamic) {
930
+ return true;
931
+ }
932
+
933
+ if (this.expectsEndResultFormObjects) {
934
+ return true;
935
+ }
936
+
937
+ const currentObjectIndex = (0, _findIndex.default)(_context26 = this.objectKeys).call(_context26, objectKey => {
938
+ var _this$currentFormObje7;
939
+
940
+ return objectKey === ((_this$currentFormObje7 = this.currentFormObject) === null || _this$currentFormObje7 === void 0 ? void 0 : _this$currentFormObje7.key);
941
+ });
942
+ const isLastObject = this.objectKeys.length - 1 === currentObjectIndex; // current object is a repeating question but it is not the last one
943
+
944
+ if (isLastObject && this.currentFormObject && this.currentFormObject.isRepeatable && !this.currentFormObject.isLastRepeat) {
945
+ return true;
946
+ } // current object is not repeatable and the last object
947
+
948
+
949
+ if (isLastObject) {
950
+ return false;
951
+ } // can't determine if this is te last, render a next button
952
+
953
+
954
+ return true;
955
+ }
956
+ /**
957
+ * Merge existing form with new form
958
+ */
959
+
960
+
961
+ update(receivedForm) {
962
+ if (receivedForm instanceof FormModel) {
963
+ var _receivedForm$data;
964
+
965
+ this.resetErrors();
966
+ this.lastUpdate = Date.now();
967
+ this.lastServerUpdate = receivedForm.lastServerUpdate;
968
+ this.tokens = receivedForm.tokens;
969
+ this.isComplete = receivedForm.isComplete;
970
+ this.isFinished = receivedForm.isFinished;
971
+ const receivedFormData = (_receivedForm$data = receivedForm.data) !== null && _receivedForm$data !== void 0 ? _receivedForm$data : {};
972
+ const hasMissing = (0, _objects.has)(receivedFormData, "missing");
973
+ const hasErrors = (0, _objects.has)(receivedFormData, "errors");
974
+
975
+ if (!hasMissing && !hasErrors) {
976
+ this.handleFinished(receivedForm);
977
+ }
978
+
979
+ if (hasErrors) {
980
+ this.handleErrors(receivedForm);
981
+ }
982
+
983
+ if (hasMissing) {
984
+ this.handleMissing(receivedForm);
985
+ }
986
+ }
987
+
988
+ return this;
989
+ }
990
+ /**
991
+ */
992
+
993
+
994
+ updateValidations(data) {
995
+ if (this.currentFormObject) {
996
+ this.currentFormObject.updateValidations(data);
997
+ }
998
+
999
+ return this;
1000
+ }
1001
+ /**
1002
+ * Process finished form
1003
+ */
1328
1004
 
1329
- mergedFormObject.mergeObject(oldObject);
1330
- return mergedFormObject;
1005
+
1006
+ handleFinished(receivedForm) {
1007
+ if (this.currentFormObject) {
1008
+ this.completedFormObjects = [...this.completedFormObjects, this.currentFormObject];
1331
1009
  }
1332
- /**
1333
- */
1334
-
1335
- }, {
1336
- key: "findAttribute",
1337
- value: function findAttribute(findMethod) {
1338
- var foundAttribute = null;
1339
- this.allObjects.forEach(function (formObject) {
1340
- if (foundAttribute === null) {
1341
- var _context34;
1342
-
1343
- foundAttribute = (0, _find.default)(_context34 = formObject.attributeCollection.all).call(_context34, function (item) {
1344
- return findMethod(item);
1345
- }) || null;
1010
+
1011
+ this.currentFormObject = receivedForm.currentFormObject;
1012
+ this.endResultFormObjects = receivedForm.endResultFormObjects;
1013
+ this._data = receivedForm._data;
1014
+ }
1015
+ /**
1016
+ */
1017
+
1018
+
1019
+ handleRootErrors(errors) {
1020
+ (0, _filter.default)(errors).call(errors, error => !error.anchor).forEach(error => {
1021
+ this.errorCollection.addServerError(error.id, error.message, error.properties);
1022
+ });
1023
+ }
1024
+ /**
1025
+ * Process errors from received form
1026
+ */
1027
+
1028
+
1029
+ handleErrors(receivedForm) {
1030
+ const errorAnchors = receivedForm.data.errors;
1031
+
1032
+ if (errorAnchors) {
1033
+ errorAnchors.forEach(error => {
1034
+ if (error.anchor && this.currentFormObject && this.currentFormObject.key === error.anchor.objectid) {
1035
+ this.currentFormObject.addServerError(error);
1036
+ } else {
1037
+ this.errorCollection.addServerError(error.id, error.message, error.properties);
1346
1038
  }
1347
1039
  });
1348
- return foundAttribute;
1349
1040
  }
1350
- }], [{
1351
- key: "isApplicableModel",
1352
- value: function isApplicableModel(data) {
1353
- return data.contributions.resourcetype && data.contributions.resourcetype === "Form";
1041
+ }
1042
+ /**
1043
+ * Process missing from received form
1044
+ */
1045
+
1046
+
1047
+ handleMissing(receivedForm) {
1048
+ if (this.currentFormObject && this.currentFormObject.equals(receivedForm.currentFormObject)) {
1049
+ this.handleMissingErrors(receivedForm);
1050
+ } else {
1051
+ this.handleNewFormObject(receivedForm);
1052
+ }
1053
+ }
1054
+ /**
1055
+ * Received missing anchors in the response with an object id that is the current form object
1056
+ */
1057
+
1058
+
1059
+ processMissingErrors(receivedForm) {
1060
+ var _context27;
1061
+
1062
+ if (this.currentFormObject === null) {
1063
+ return null;
1354
1064
  }
1355
- }]);
1356
- return FormModel;
1357
- }(_ResourceModel2.default);
1065
+
1066
+ (0, _map.default)(_context27 = this.currentFormObject.attributeCollection).call(_context27, attribute => {
1067
+ if (receivedForm.currentFormObject && receivedForm.currentFormObject.hasAttributeByKey(attribute.key)) {
1068
+ attribute.addMissingError();
1069
+ } else {
1070
+ attribute.removeMissingError();
1071
+ }
1072
+
1073
+ return attribute;
1074
+ });
1075
+ return this.currentFormObject;
1076
+ }
1077
+ /**
1078
+ */
1079
+
1080
+
1081
+ handleMissingErrors(receivedForm) {
1082
+ this.currentFormObject = this.processMissingErrors(receivedForm);
1083
+ }
1084
+ /**
1085
+ */
1086
+
1087
+
1088
+ handleNewFormObject(receivedForm) {
1089
+ this.endResultFormObjects = receivedForm.endResultFormObjects;
1090
+ const receivedCurrentFormObject = receivedForm.currentFormObject;
1091
+
1092
+ if (receivedCurrentFormObject === null) {
1093
+ this.completedFormObjects = [...this.allObjects];
1094
+ this.currentFormObject = null;
1095
+ } else {
1096
+ var _context28;
1097
+
1098
+ // check if received form exists in the previously entered form objects
1099
+ const previouslyEnteredFormObjects = (0, _filter.default)(_context28 = this.previouslyEnteredFormObjects).call(_context28, formObject => formObject.equals(receivedCurrentFormObject, formObject.hasFixedNrOfRepeats));
1100
+
1101
+ if (previouslyEnteredFormObjects.length > 0) {
1102
+ this.handlePreviouslyEnteredFormObjects(receivedCurrentFormObject, previouslyEnteredFormObjects);
1103
+ } else {
1104
+ this.completedFormObjects = [...this.allObjects];
1105
+ this.currentFormObject = receivedCurrentFormObject;
1106
+ }
1107
+ }
1108
+ }
1109
+ /**
1110
+ * Indicate if a new form object model should be merged with a previousled entered form object model
1111
+ * Set this property to false on the form that receives the new form to skip the merge behavior
1112
+ */
1113
+
1114
+
1115
+ get mergePreviouslyEnteredObjects() {
1116
+ return this._mergePreviouslyEnteredObjects;
1117
+ }
1118
+ /**
1119
+ */
1120
+
1121
+
1122
+ set mergePreviouslyEnteredObjects(mergePreviouslyEnteredObjects) {
1123
+ this._mergePreviouslyEnteredObjects = mergePreviouslyEnteredObjects;
1124
+ }
1125
+ /**
1126
+ */
1127
+
1128
+
1129
+ handlePreviouslyEnteredFormObjects(receivedCurrentFormObject, previouslyEnteredFormObjects) {
1130
+ var _context29;
1131
+
1132
+ previouslyEnteredFormObjects.forEach(previouslyEnteredFormObject => {
1133
+ const mergedObject = this.mergePreviouslyEnteredObjects ? this.mergeObjects(receivedCurrentFormObject, previouslyEnteredFormObject) : receivedCurrentFormObject;
1134
+ this.addFormObject(mergedObject);
1135
+ }); // remove the previously entered form object
1136
+
1137
+ this.previouslyEnteredFormObjects = (0, _filter.default)(_context29 = this.previouslyEnteredFormObjects).call(_context29, formObject => {
1138
+ const hasPreviouslyEnteredObject = (0, _find.default)(previouslyEnteredFormObjects).call(previouslyEnteredFormObjects, previouslyEnteredFormObject => formObject.equals(previouslyEnteredFormObject));
1139
+ return !hasPreviouslyEnteredObject;
1140
+ });
1141
+ }
1142
+ /**
1143
+ */
1144
+
1145
+
1146
+ mergeObjects(newObject, oldObject) {
1147
+ const mergedFormObject = _FormObjectModel.default.createEmpty(newObject);
1148
+
1149
+ mergedFormObject.mergeObject(oldObject);
1150
+ return mergedFormObject;
1151
+ }
1152
+ /**
1153
+ */
1154
+
1155
+
1156
+ findAttribute(findMethod) {
1157
+ let foundAttribute = null;
1158
+ this.allObjects.forEach(formObject => {
1159
+ if (foundAttribute === null) {
1160
+ var _context30;
1161
+
1162
+ foundAttribute = (0, _find.default)(_context30 = formObject.attributeCollection.all).call(_context30, item => findMethod(item)) || null;
1163
+ }
1164
+ });
1165
+ return foundAttribute;
1166
+ }
1167
+
1168
+ }
1358
1169
 
1359
1170
  var _default = FormModel;
1360
1171
  exports.default = _default;