@beinformed/ui 1.57.1 → 1.57.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (436) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/esm/constants/Settings.js +14 -6
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useAuthentication.js +3 -3
  5. package/esm/hooks/useAuthentication.js.map +1 -1
  6. package/esm/hooks/useModelCatalog.js.map +1 -1
  7. package/esm/hooks/useModularUI.js +9 -8
  8. package/esm/hooks/useModularUI.js.map +1 -1
  9. package/esm/hooks/useModularUIBasic.js +2 -4
  10. package/esm/hooks/useModularUIBasic.js.map +1 -1
  11. package/esm/hooks/useModularUIModel.js.map +1 -1
  12. package/esm/models/actions/ActionCollection.js +2 -3
  13. package/esm/models/actions/ActionCollection.js.map +1 -1
  14. package/esm/models/actions/ActionModel.js +13 -23
  15. package/esm/models/actions/ActionModel.js.map +1 -1
  16. package/esm/models/application/ApplicationModel.js +1 -1
  17. package/esm/models/application/ApplicationModel.js.map +1 -1
  18. package/esm/models/attributes/AttributeCollection.js +6 -3
  19. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  20. package/esm/models/attributes/AttributeModel.js +3 -3
  21. package/esm/models/attributes/AttributeModel.js.map +1 -1
  22. package/esm/models/attributes/AttributeSetModel.js +7 -4
  23. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  24. package/esm/models/attributes/BooleanAttributeModel.js +6 -3
  25. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  26. package/esm/models/attributes/ChoiceAttributeModel.js +6 -3
  27. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  28. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +18 -14
  29. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  30. package/esm/models/attributes/ChoiceAttributeOptionModel.js +17 -10
  31. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  32. package/esm/models/attributes/CompositeAttributeChildCollection.js +7 -7
  33. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  34. package/esm/models/attributes/CompositeAttributeModel.js +3 -3
  35. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  36. package/esm/models/attributes/DatetimeAttributeModel.js +2 -2
  37. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  38. package/esm/models/attributes/StringAttributeModel.js +2 -2
  39. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  40. package/esm/models/attributes/_createAttribute.js +2 -2
  41. package/esm/models/attributes/_createAttribute.js.map +1 -1
  42. package/esm/models/base/BaseModel.js +27 -1
  43. package/esm/models/base/BaseModel.js.map +1 -1
  44. package/esm/models/base/ResourceModel.js +3 -23
  45. package/esm/models/base/ResourceModel.js.map +1 -1
  46. package/esm/models/caseview/CaseViewModel.js +1 -1
  47. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  48. package/esm/models/concepts/ConceptDetailModel.js +2 -2
  49. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  50. package/esm/models/concepts/ConceptIndexModel.js +2 -2
  51. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  52. package/esm/models/concepts/ConceptLinkModel.js +4 -10
  53. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  54. package/esm/models/concepts/ConceptRelationCollection.js +11 -4
  55. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  56. package/esm/models/concepts/ConceptRelationModel.js +8 -1
  57. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  58. package/esm/models/concepts/SourceReferenceCollection.js +2 -4
  59. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  60. package/esm/models/concepts/SourceReferenceModel.js +9 -10
  61. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  62. package/esm/models/content/ContentIndexModel.js +2 -2
  63. package/esm/models/content/ContentIndexModel.js.map +1 -1
  64. package/esm/models/content/ContentLinkModel.js +4 -11
  65. package/esm/models/content/ContentLinkModel.js.map +1 -1
  66. package/esm/models/content/ContentModel.js +2 -2
  67. package/esm/models/content/ContentModel.js.map +1 -1
  68. package/esm/models/content/ContentTOCModel.js +7 -7
  69. package/esm/models/content/ContentTOCModel.js.map +1 -1
  70. package/esm/models/content/SectionModel.js +6 -12
  71. package/esm/models/content/SectionModel.js.map +1 -1
  72. package/esm/models/detail/DetailModel.js +9 -3
  73. package/esm/models/detail/DetailModel.js.map +1 -1
  74. package/esm/models/error/ErrorResponse.js +8 -10
  75. package/esm/models/error/ErrorResponse.js.map +1 -1
  76. package/esm/models/filters/AssignmentFilterModel.js +2 -2
  77. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  78. package/esm/models/filters/BaseFilterModel.js +3 -3
  79. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  80. package/esm/models/filters/ConceptIndexFilterModel.js +2 -3
  81. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  82. package/esm/models/filters/FilterCollection.js +8 -7
  83. package/esm/models/filters/FilterCollection.js.map +1 -1
  84. package/esm/models/filters/StringFilterModel.js +2 -2
  85. package/esm/models/filters/StringFilterModel.js.map +1 -1
  86. package/esm/models/form/FormModel.js +4 -4
  87. package/esm/models/form/FormModel.js.map +1 -1
  88. package/esm/models/form/FormObjectModel.js +7 -4
  89. package/esm/models/form/FormObjectModel.js.map +1 -1
  90. package/esm/models/grouping/GroupingModel.js +10 -7
  91. package/esm/models/grouping/GroupingModel.js.map +1 -1
  92. package/esm/models/href/Href.js +9 -8
  93. package/esm/models/href/Href.js.map +1 -1
  94. package/esm/models/links/LinkCollection.js +2 -3
  95. package/esm/models/links/LinkCollection.js.map +1 -1
  96. package/esm/models/links/LinkModel.js +7 -7
  97. package/esm/models/links/LinkModel.js.map +1 -1
  98. package/esm/models/list/ListDetailModel.js +1 -1
  99. package/esm/models/list/ListDetailModel.js.map +1 -1
  100. package/esm/models/list/ListItemCollection.js +1 -1
  101. package/esm/models/list/ListItemCollection.js.map +1 -1
  102. package/esm/models/list/ListItemModel.js +3 -3
  103. package/esm/models/list/ListItemModel.js.map +1 -1
  104. package/esm/models/list/ListModel.js +3 -3
  105. package/esm/models/list/ListModel.js.map +1 -1
  106. package/esm/models/lookup/LookupOptionCollection.js +5 -2
  107. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  108. package/esm/models/lookup/LookupOptionsModel.js +2 -2
  109. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  110. package/esm/models/panels/GroupingPanelModel.js +1 -1
  111. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  112. package/esm/models/tab/TabModel.js +2 -2
  113. package/esm/models/tab/TabModel.js.map +1 -1
  114. package/esm/models/taskgroup/TaskGroupModel.js +4 -5
  115. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  116. package/esm/models/types.js.map +1 -1
  117. package/esm/models/user/UserProfileModel.js +4 -1
  118. package/esm/models/user/UserProfileModel.js.map +1 -1
  119. package/esm/modularui/CaptchaRequest.js +3 -3
  120. package/esm/modularui/CaptchaRequest.js.map +1 -1
  121. package/esm/modularui/ModularUIRequest.js +8 -5
  122. package/esm/modularui/ModularUIRequest.js.map +1 -1
  123. package/esm/modularui/ModularUIResponse.js +12 -3
  124. package/esm/modularui/ModularUIResponse.js.map +1 -1
  125. package/esm/modularui/UploadRequest.js +3 -3
  126. package/esm/modularui/UploadRequest.js.map +1 -1
  127. package/esm/react-client/client.js +3 -3
  128. package/esm/react-client/client.js.map +1 -1
  129. package/esm/react-server/renderSSRComplete.js +2 -2
  130. package/esm/react-server/renderSSRComplete.js.map +1 -1
  131. package/esm/react-server/renderSSRMinimal.js +2 -2
  132. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  133. package/esm/redux/_modularui/ModularUIActions.js +8 -2
  134. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  135. package/esm/redux/_modularui/ModularUIUtils.js +8 -11
  136. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  137. package/esm/utils/browser/Cookies.js +3 -3
  138. package/esm/utils/browser/Cookies.js.map +1 -1
  139. package/esm/utils/helpers/createHref.js +23 -3
  140. package/esm/utils/helpers/createHref.js.map +1 -1
  141. package/esm/utils/helpers/repositoryResource.js +2 -2
  142. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  143. package/lib/constants/Settings.js +18 -8
  144. package/lib/constants/Settings.js.flow +16 -6
  145. package/lib/constants/Settings.js.map +1 -1
  146. package/lib/hooks/useAuthentication.js +2 -2
  147. package/lib/hooks/useAuthentication.js.flow +3 -3
  148. package/lib/hooks/useAuthentication.js.map +1 -1
  149. package/lib/hooks/useModelCatalog.js.flow +7 -6
  150. package/lib/hooks/useModelCatalog.js.map +1 -1
  151. package/lib/hooks/useModularUI.js +9 -8
  152. package/lib/hooks/useModularUI.js.flow +12 -9
  153. package/lib/hooks/useModularUI.js.map +1 -1
  154. package/lib/hooks/useModularUIBasic.js +2 -4
  155. package/lib/hooks/useModularUIBasic.js.flow +3 -4
  156. package/lib/hooks/useModularUIBasic.js.map +1 -1
  157. package/lib/hooks/useModularUIModel.js.flow +16 -11
  158. package/lib/hooks/useModularUIModel.js.map +1 -1
  159. package/lib/models/actions/ActionCollection.js +2 -2
  160. package/lib/models/actions/ActionCollection.js.flow +3 -8
  161. package/lib/models/actions/ActionCollection.js.map +1 -1
  162. package/lib/models/actions/ActionModel.js +12 -22
  163. package/lib/models/actions/ActionModel.js.flow +7 -24
  164. package/lib/models/actions/ActionModel.js.map +1 -1
  165. package/lib/models/application/ApplicationModel.js +1 -1
  166. package/lib/models/application/ApplicationModel.js.flow +1 -2
  167. package/lib/models/application/ApplicationModel.js.map +1 -1
  168. package/lib/models/attributes/AttributeCollection.js +6 -3
  169. package/lib/models/attributes/AttributeCollection.js.flow +12 -4
  170. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  171. package/lib/models/attributes/AttributeModel.js +3 -3
  172. package/lib/models/attributes/AttributeModel.js.flow +8 -2
  173. package/lib/models/attributes/AttributeModel.js.map +1 -1
  174. package/lib/models/attributes/AttributeSetModel.js +7 -3
  175. package/lib/models/attributes/AttributeSetModel.js.flow +11 -3
  176. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  177. package/lib/models/attributes/BooleanAttributeModel.js +6 -3
  178. package/lib/models/attributes/BooleanAttributeModel.js.flow +8 -4
  179. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  180. package/lib/models/attributes/ChoiceAttributeModel.js +6 -3
  181. package/lib/models/attributes/ChoiceAttributeModel.js.flow +13 -4
  182. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  183. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +18 -13
  184. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +30 -28
  185. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  186. package/lib/models/attributes/ChoiceAttributeOptionModel.js +17 -10
  187. package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +30 -11
  188. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  189. package/lib/models/attributes/CompositeAttributeChildCollection.js +7 -7
  190. package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +8 -1
  191. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  192. package/lib/models/attributes/CompositeAttributeModel.js +3 -3
  193. package/lib/models/attributes/CompositeAttributeModel.js.flow +8 -3
  194. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  195. package/lib/models/attributes/DatetimeAttributeModel.js +2 -2
  196. package/lib/models/attributes/DatetimeAttributeModel.js.flow +7 -2
  197. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  198. package/lib/models/attributes/StringAttributeModel.js +2 -2
  199. package/lib/models/attributes/StringAttributeModel.js.flow +7 -3
  200. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  201. package/lib/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +1 -1
  202. package/lib/models/attributes/_createAttribute.js +2 -2
  203. package/lib/models/attributes/_createAttribute.js.flow +3 -2
  204. package/lib/models/attributes/_createAttribute.js.map +1 -1
  205. package/lib/models/base/BaseModel.js +27 -1
  206. package/lib/models/base/BaseModel.js.flow +31 -1
  207. package/lib/models/base/BaseModel.js.map +1 -1
  208. package/lib/models/base/ResourceModel.js +3 -22
  209. package/lib/models/base/ResourceModel.js.flow +6 -23
  210. package/lib/models/base/ResourceModel.js.map +1 -1
  211. package/lib/models/base/__tests__/BaseModel.spec.js.flow +4 -0
  212. package/lib/models/caseview/CaseViewModel.js +1 -1
  213. package/lib/models/caseview/CaseViewModel.js.flow +1 -2
  214. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  215. package/lib/models/concepts/ConceptDetailModel.js +2 -2
  216. package/lib/models/concepts/ConceptDetailModel.js.flow +2 -2
  217. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  218. package/lib/models/concepts/ConceptIndexModel.js +2 -2
  219. package/lib/models/concepts/ConceptIndexModel.js.flow +9 -6
  220. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  221. package/lib/models/concepts/ConceptLinkModel.js +4 -10
  222. package/lib/models/concepts/ConceptLinkModel.js.flow +15 -12
  223. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  224. package/lib/models/concepts/ConceptRelationCollection.js +11 -4
  225. package/lib/models/concepts/ConceptRelationCollection.js.flow +17 -3
  226. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  227. package/lib/models/concepts/ConceptRelationModel.js +8 -1
  228. package/lib/models/concepts/ConceptRelationModel.js.flow +18 -2
  229. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  230. package/lib/models/concepts/SourceReferenceCollection.js +2 -3
  231. package/lib/models/concepts/SourceReferenceCollection.js.flow +3 -8
  232. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  233. package/lib/models/concepts/SourceReferenceModel.js +8 -8
  234. package/lib/models/concepts/SourceReferenceModel.js.flow +10 -11
  235. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  236. package/lib/models/content/ContentIndexModel.js +2 -2
  237. package/lib/models/content/ContentIndexModel.js.flow +10 -5
  238. package/lib/models/content/ContentIndexModel.js.map +1 -1
  239. package/lib/models/content/ContentLinkModel.js +4 -10
  240. package/lib/models/content/ContentLinkModel.js.flow +10 -13
  241. package/lib/models/content/ContentLinkModel.js.map +1 -1
  242. package/lib/models/content/ContentModel.js +2 -2
  243. package/lib/models/content/ContentModel.js.flow +6 -1
  244. package/lib/models/content/ContentModel.js.map +1 -1
  245. package/lib/models/content/ContentTOCModel.js +7 -7
  246. package/lib/models/content/ContentTOCModel.js.flow +19 -11
  247. package/lib/models/content/ContentTOCModel.js.map +1 -1
  248. package/lib/models/content/SectionModel.js +6 -11
  249. package/lib/models/content/SectionModel.js.flow +9 -21
  250. package/lib/models/content/SectionModel.js.map +1 -1
  251. package/lib/models/detail/DetailModel.js +9 -3
  252. package/lib/models/detail/DetailModel.js.flow +3 -4
  253. package/lib/models/detail/DetailModel.js.map +1 -1
  254. package/lib/models/error/ErrorResponse.js +7 -9
  255. package/lib/models/error/ErrorResponse.js.flow +9 -20
  256. package/lib/models/error/ErrorResponse.js.map +1 -1
  257. package/lib/models/filters/AssignmentFilterModel.js +2 -2
  258. package/lib/models/filters/AssignmentFilterModel.js.flow +7 -3
  259. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  260. package/lib/models/filters/BaseFilterModel.js +3 -3
  261. package/lib/models/filters/BaseFilterModel.js.flow +16 -7
  262. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  263. package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
  264. package/lib/models/filters/ConceptIndexFilterModel.js.flow +8 -2
  265. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  266. package/lib/models/filters/FilterCollection.js +8 -7
  267. package/lib/models/filters/FilterCollection.js.flow +13 -7
  268. package/lib/models/filters/FilterCollection.js.map +1 -1
  269. package/lib/models/filters/StringFilterModel.js +2 -2
  270. package/lib/models/filters/StringFilterModel.js.flow +7 -3
  271. package/lib/models/filters/StringFilterModel.js.map +1 -1
  272. package/lib/models/form/FormModel.js +4 -4
  273. package/lib/models/form/FormModel.js.flow +8 -2
  274. package/lib/models/form/FormModel.js.map +1 -1
  275. package/lib/models/form/FormObjectModel.js +7 -4
  276. package/lib/models/form/FormObjectModel.js.flow +17 -4
  277. package/lib/models/form/FormObjectModel.js.map +1 -1
  278. package/lib/models/grouping/GroupingModel.js +10 -7
  279. package/lib/models/grouping/GroupingModel.js.flow +21 -5
  280. package/lib/models/grouping/GroupingModel.js.map +1 -1
  281. package/lib/models/href/Href.js +8 -7
  282. package/lib/models/href/Href.js.flow +17 -10
  283. package/lib/models/href/Href.js.map +1 -1
  284. package/lib/models/href/__tests__/Href.spec.js.flow +5 -8
  285. package/lib/models/links/LinkCollection.js +2 -3
  286. package/lib/models/links/LinkCollection.js.flow +3 -3
  287. package/lib/models/links/LinkCollection.js.map +1 -1
  288. package/lib/models/links/LinkModel.js +7 -7
  289. package/lib/models/links/LinkModel.js.flow +8 -15
  290. package/lib/models/links/LinkModel.js.map +1 -1
  291. package/lib/models/list/ListDetailModel.js +1 -1
  292. package/lib/models/list/ListDetailModel.js.flow +6 -1
  293. package/lib/models/list/ListDetailModel.js.map +1 -1
  294. package/lib/models/list/ListItemCollection.js +1 -1
  295. package/lib/models/list/ListItemCollection.js.flow +1 -2
  296. package/lib/models/list/ListItemCollection.js.map +1 -1
  297. package/lib/models/list/ListItemModel.js +3 -3
  298. package/lib/models/list/ListItemModel.js.flow +4 -4
  299. package/lib/models/list/ListItemModel.js.map +1 -1
  300. package/lib/models/list/ListModel.js +3 -3
  301. package/lib/models/list/ListModel.js.flow +12 -8
  302. package/lib/models/list/ListModel.js.map +1 -1
  303. package/lib/models/lookup/LookupOptionCollection.js +5 -1
  304. package/lib/models/lookup/LookupOptionCollection.js.flow +17 -6
  305. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  306. package/lib/models/lookup/LookupOptionsModel.js +2 -2
  307. package/lib/models/lookup/LookupOptionsModel.js.flow +2 -0
  308. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  309. package/lib/models/panels/GroupingPanelModel.js +1 -1
  310. package/lib/models/panels/GroupingPanelModel.js.flow +1 -2
  311. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  312. package/lib/models/tab/TabModel.js +2 -2
  313. package/lib/models/tab/TabModel.js.flow +2 -4
  314. package/lib/models/tab/TabModel.js.map +1 -1
  315. package/lib/models/taskgroup/TaskGroupModel.js +4 -4
  316. package/lib/models/taskgroup/TaskGroupModel.js.flow +5 -6
  317. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  318. package/lib/models/types.js.flow +5 -0
  319. package/lib/models/types.js.map +1 -1
  320. package/lib/models/user/UserProfileModel.js +4 -1
  321. package/lib/models/user/UserProfileModel.js.flow +1 -0
  322. package/lib/models/user/UserProfileModel.js.map +1 -1
  323. package/lib/modularui/CaptchaRequest.js +2 -2
  324. package/lib/modularui/CaptchaRequest.js.flow +7 -3
  325. package/lib/modularui/CaptchaRequest.js.map +1 -1
  326. package/lib/modularui/ModularUIRequest.js +7 -4
  327. package/lib/modularui/ModularUIRequest.js.flow +8 -5
  328. package/lib/modularui/ModularUIRequest.js.map +1 -1
  329. package/lib/modularui/ModularUIResponse.js +11 -2
  330. package/lib/modularui/ModularUIResponse.js.flow +13 -3
  331. package/lib/modularui/ModularUIResponse.js.map +1 -1
  332. package/lib/modularui/UploadRequest.js +2 -2
  333. package/lib/modularui/UploadRequest.js.flow +7 -3
  334. package/lib/modularui/UploadRequest.js.map +1 -1
  335. package/lib/react-client/client.js +2 -2
  336. package/lib/react-client/client.js.flow +7 -3
  337. package/lib/react-client/client.js.map +1 -1
  338. package/lib/react-server/renderSSRComplete.js +1 -1
  339. package/lib/react-server/renderSSRComplete.js.flow +2 -2
  340. package/lib/react-server/renderSSRComplete.js.map +1 -1
  341. package/lib/react-server/renderSSRMinimal.js +1 -1
  342. package/lib/react-server/renderSSRMinimal.js.flow +2 -2
  343. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  344. package/lib/redux/_modularui/ModularUIActions.js +8 -2
  345. package/lib/redux/_modularui/ModularUIActions.js.flow +8 -7
  346. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  347. package/lib/redux/_modularui/ModularUIUtils.js +8 -11
  348. package/lib/redux/_modularui/ModularUIUtils.js.flow +13 -14
  349. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  350. package/lib/utils/browser/Cookies.js +2 -2
  351. package/lib/utils/browser/Cookies.js.flow +3 -3
  352. package/lib/utils/browser/Cookies.js.map +1 -1
  353. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -8
  354. package/lib/utils/helpers/createHref.js +23 -3
  355. package/lib/utils/helpers/createHref.js.flow +37 -8
  356. package/lib/utils/helpers/createHref.js.map +1 -1
  357. package/lib/utils/helpers/repositoryResource.js +1 -1
  358. package/lib/utils/helpers/repositoryResource.js.flow +2 -2
  359. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  360. package/package.json +4 -4
  361. package/src/constants/Settings.js +16 -6
  362. package/src/hooks/useAuthentication.js +3 -3
  363. package/src/hooks/useModelCatalog.js +7 -6
  364. package/src/hooks/useModularUI.js +12 -9
  365. package/src/hooks/useModularUIBasic.js +3 -4
  366. package/src/hooks/useModularUIModel.js +16 -11
  367. package/src/models/actions/ActionCollection.js +3 -8
  368. package/src/models/actions/ActionModel.js +7 -24
  369. package/src/models/application/ApplicationModel.js +1 -2
  370. package/src/models/attributes/AttributeCollection.js +12 -4
  371. package/src/models/attributes/AttributeModel.js +8 -2
  372. package/src/models/attributes/AttributeSetModel.js +11 -3
  373. package/src/models/attributes/BooleanAttributeModel.js +8 -4
  374. package/src/models/attributes/ChoiceAttributeModel.js +13 -4
  375. package/src/models/attributes/ChoiceAttributeOptionCollection.js +30 -28
  376. package/src/models/attributes/ChoiceAttributeOptionModel.js +30 -11
  377. package/src/models/attributes/CompositeAttributeChildCollection.js +8 -1
  378. package/src/models/attributes/CompositeAttributeModel.js +8 -3
  379. package/src/models/attributes/DatetimeAttributeModel.js +7 -2
  380. package/src/models/attributes/StringAttributeModel.js +7 -3
  381. package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +1 -1
  382. package/src/models/attributes/_createAttribute.js +3 -2
  383. package/src/models/base/BaseModel.js +31 -1
  384. package/src/models/base/ResourceModel.js +6 -23
  385. package/src/models/base/__tests__/BaseModel.spec.js +4 -0
  386. package/src/models/caseview/CaseViewModel.js +1 -2
  387. package/src/models/concepts/ConceptDetailModel.js +2 -2
  388. package/src/models/concepts/ConceptIndexModel.js +9 -6
  389. package/src/models/concepts/ConceptLinkModel.js +15 -12
  390. package/src/models/concepts/ConceptRelationCollection.js +17 -3
  391. package/src/models/concepts/ConceptRelationModel.js +18 -2
  392. package/src/models/concepts/SourceReferenceCollection.js +3 -8
  393. package/src/models/concepts/SourceReferenceModel.js +10 -11
  394. package/src/models/content/ContentIndexModel.js +10 -5
  395. package/src/models/content/ContentLinkModel.js +10 -13
  396. package/src/models/content/ContentModel.js +6 -1
  397. package/src/models/content/ContentTOCModel.js +19 -11
  398. package/src/models/content/SectionModel.js +9 -21
  399. package/src/models/detail/DetailModel.js +3 -4
  400. package/src/models/error/ErrorResponse.js +9 -20
  401. package/src/models/filters/AssignmentFilterModel.js +7 -3
  402. package/src/models/filters/BaseFilterModel.js +16 -7
  403. package/src/models/filters/ConceptIndexFilterModel.js +8 -2
  404. package/src/models/filters/FilterCollection.js +13 -7
  405. package/src/models/filters/StringFilterModel.js +7 -3
  406. package/src/models/form/FormModel.js +8 -2
  407. package/src/models/form/FormObjectModel.js +17 -4
  408. package/src/models/grouping/GroupingModel.js +21 -5
  409. package/src/models/href/Href.js +17 -10
  410. package/src/models/href/__tests__/Href.spec.js +5 -8
  411. package/src/models/links/LinkCollection.js +3 -3
  412. package/src/models/links/LinkModel.js +8 -15
  413. package/src/models/list/ListDetailModel.js +6 -1
  414. package/src/models/list/ListItemCollection.js +1 -2
  415. package/src/models/list/ListItemModel.js +4 -4
  416. package/src/models/list/ListModel.js +12 -8
  417. package/src/models/lookup/LookupOptionCollection.js +17 -6
  418. package/src/models/lookup/LookupOptionsModel.js +2 -0
  419. package/src/models/panels/GroupingPanelModel.js +1 -2
  420. package/src/models/tab/TabModel.js +2 -4
  421. package/src/models/taskgroup/TaskGroupModel.js +5 -6
  422. package/src/models/types.js +5 -0
  423. package/src/models/user/UserProfileModel.js +1 -0
  424. package/src/modularui/CaptchaRequest.js +7 -3
  425. package/src/modularui/ModularUIRequest.js +8 -5
  426. package/src/modularui/ModularUIResponse.js +13 -3
  427. package/src/modularui/UploadRequest.js +7 -3
  428. package/src/react-client/client.js +7 -3
  429. package/src/react-server/renderSSRComplete.js +2 -2
  430. package/src/react-server/renderSSRMinimal.js +2 -2
  431. package/src/redux/_modularui/ModularUIActions.js +8 -7
  432. package/src/redux/_modularui/ModularUIUtils.js +13 -14
  433. package/src/utils/browser/Cookies.js +3 -3
  434. package/src/utils/helpers/__tests__/createHref.spec.js +13 -8
  435. package/src/utils/helpers/createHref.js +37 -8
  436. package/src/utils/helpers/repositoryResource.js +2 -2
@@ -7,14 +7,13 @@ import BaseModel from "../base/BaseModel";
7
7
  import Href from "../href/Href";
8
8
 
9
9
  import {
10
- getBasePath,
11
10
  HTTP_METHODS,
12
11
  CREATE_ACTION,
13
12
  UPDATE_ACTION,
14
13
  DELETE_ACTION,
15
14
  } from "../../constants";
16
15
 
17
- import type { AttributeType } from "../types";
16
+ import type { AttributeType, ModelOptions } from "../types";
18
17
 
19
18
  /**
20
19
  * Defines an Action. For instance an action on the tab 'books', which leads to a form
@@ -23,23 +22,19 @@ export default class ActionModel extends BaseModel {
23
22
  _fieldCollection: AttributeCollection;
24
23
  _href: Href;
25
24
  _icon: string;
26
- _origin: ?string;
27
- _contextPath: ?string;
28
25
 
29
26
  constructor(
30
27
  data: Object,
31
28
  contributions: Object,
32
- origin?: string,
33
- contextPath?: string,
29
+ modelOptions?: ModelOptions,
34
30
  ) {
35
- super(data, contributions);
31
+ super(data, contributions, modelOptions);
36
32
 
37
33
  this._fieldCollection = new AttributeCollection(
38
34
  this.data.fields,
39
35
  this.contributions.fields,
36
+ { ...modelOptions, isReadonly: false },
40
37
  );
41
- this._origin = origin;
42
- this._contextPath = contextPath;
43
38
  }
44
39
 
45
40
  /**
@@ -54,7 +49,7 @@ export default class ActionModel extends BaseModel {
54
49
  ): ActionModel {
55
50
  const data = { name, href };
56
51
  const contributions = { name, label: label ?? name, type };
57
- return new ActionModel(data, contributions, origin, contextPath);
52
+ return new ActionModel(data, contributions, { origin, contextPath });
58
53
  }
59
54
 
60
55
  /**
@@ -63,18 +58,6 @@ export default class ActionModel extends BaseModel {
63
58
  return this.data.href == null;
64
59
  }
65
60
 
66
- /**
67
- */
68
- get origin(): string {
69
- return this._origin ?? "";
70
- }
71
-
72
- /**
73
- */
74
- get contextPath(): string {
75
- return this._contextPath ?? getBasePath();
76
- }
77
-
78
61
  /**
79
62
  * retrieve href of action
80
63
  */
@@ -84,8 +67,7 @@ export default class ActionModel extends BaseModel {
84
67
  new Href(
85
68
  `${this.data.href}?${this.querystring}`,
86
69
  "Form",
87
- this.origin,
88
- this.contextPath,
70
+ this.modelOptions,
89
71
  )
90
72
  );
91
73
  }
@@ -204,6 +186,7 @@ export default class ActionModel extends BaseModel {
204
186
  return new ProcessStatusSettingsModel(
205
187
  this.getData("processStatus", {}),
206
188
  this.getContribution("processTask", {}),
189
+ this.modelOptions,
207
190
  );
208
191
  }
209
192
 
@@ -1 +1 @@
1
- {"version":3,"file":"ActionModel.js","names":["_objects","require","_ProcessStatusSettingsModel","_interopRequireDefault","_AttributeCollection","_BaseModel","_Href","_constants","ActionModel","BaseModel","constructor","data","contributions","origin","contextPath","_defineProperty2","default","_fieldCollection","AttributeCollection","fields","_origin","_contextPath","createFromHref","name","href","label","type","arguments","length","undefined","isDisabled","getBasePath","selfhref","_href","Href","querystring","method","getData","HTTP_METHODS","POST","layouthint","has","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","getContribution","all","fieldCollection","_context","_context2","_map","_filter","call","attribute","value","join","getFieldByKey","key","getAttributeByKey","hasFieldByKey","isProcessTask","processStatus","ProcessStatusSettingsModel","icon","_icon","exports"],"sources":["../../../src/models/actions/ActionModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ProcessStatusSettingsModel from \"../process/ProcessStatusSettingsModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\n\nimport {\n getBasePath,\n HTTP_METHODS,\n CREATE_ACTION,\n UPDATE_ACTION,\n DELETE_ACTION,\n} from \"../../constants\";\n\nimport type { AttributeType } from \"../types\";\n\n/**\n * Defines an Action. For instance an action on the tab 'books', which leads to a form\n */\nexport default class ActionModel extends BaseModel {\n _fieldCollection: AttributeCollection;\n _href: Href;\n _icon: string;\n _origin: ?string;\n _contextPath: ?string;\n\n constructor(\n data: Object,\n contributions: Object,\n origin?: string,\n contextPath?: string,\n ) {\n super(data, contributions);\n\n this._fieldCollection = new AttributeCollection(\n this.data.fields,\n this.contributions.fields,\n );\n this._origin = origin;\n this._contextPath = contextPath;\n }\n\n /**\n */\n static createFromHref(\n name: string,\n href: string,\n label: string,\n type: string = \"form\",\n origin?: string,\n contextPath?: string,\n ): ActionModel {\n const data = { name, href };\n const contributions = { name, label: label ?? name, type };\n return new ActionModel(data, contributions, origin, contextPath);\n }\n\n /**\n */\n get isDisabled(): boolean {\n return this.data.href == null;\n }\n\n /**\n */\n get origin(): string {\n return this._origin ?? \"\";\n }\n\n /**\n */\n get contextPath(): string {\n return this._contextPath ?? getBasePath();\n }\n\n /**\n * retrieve href of action\n */\n get selfhref(): Href {\n return (\n this._href ??\n new Href(\n `${this.data.href}?${this.querystring}`,\n \"Form\",\n this.origin,\n this.contextPath,\n )\n );\n }\n\n /**\n */\n set selfhref(href: Href) {\n this._href = href;\n }\n\n /**\n * retrieve request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this.getData(\"method\", HTTP_METHODS.POST);\n }\n\n /**\n * Retrieve type of method\n */\n get type(): string {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContribution(\"type\", \"general\");\n }\n\n /**\n * Retrieve name of action\n */\n get name(): string {\n return this.getData(\"name\", \"unknown\");\n }\n\n /**\n * retrieve the collection of field attributes as an array\n */\n get fields(): Array<AttributeType> {\n return this._fieldCollection.all;\n }\n\n /**\n * Retrieve the field collection\n */\n get fieldCollection(): AttributeCollection {\n return this._fieldCollection;\n }\n\n /**\n */\n set fieldCollection(fieldCollection: AttributeCollection) {\n this._fieldCollection = fieldCollection;\n }\n\n /**\n * Retrieve querystring of action\n */\n get querystring(): string {\n return this.fields\n .filter((attribute) => attribute.value != null && attribute.value !== \"\")\n .map((attribute) => {\n const { value } = attribute;\n if (value !== null) {\n return `${attribute.name}=${value}`;\n }\n return attribute.name;\n })\n .join(\"&\");\n }\n\n /**\n * Retrieve a field by it's key\n */\n getFieldByKey(key: string): AttributeType | null {\n return this._fieldCollection.getAttributeByKey(key);\n }\n\n /**\n * Indicates if field exists by the given key\n */\n hasFieldByKey(key: string): boolean {\n return this.getFieldByKey(key) !== null;\n }\n\n /**\n * Getting the key/name of this action\n */\n get key(): string {\n return this.data.name;\n }\n\n /**\n * Getting the label of the action\n */\n get label(): string {\n return this.getContribution(\"label\", this.key);\n }\n\n /**\n */\n get isProcessTask(): boolean {\n return has(this.contributions, \"processTask\");\n }\n\n /**\n */\n get processStatus(): ProcessStatusSettingsModel | null {\n if (this.isProcessTask) {\n return new ProcessStatusSettingsModel(\n this.getData(\"processStatus\", {}),\n this.getContribution(\"processTask\", {}),\n );\n }\n\n return null;\n }\n\n /**\n */\n get icon(): string {\n return this._icon;\n }\n\n /**\n */\n set icon(icon: string) {\n this._icon = icon;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,2BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,UAAA,GAAAN,OAAA;AAUA;AACA;AACA;AACe,MAAMO,WAAW,SAASC,kBAAS,CAAC;EAOjDC,WAAWA,CACTC,IAAY,EACZC,aAAqB,EACrBC,MAAe,EACfC,WAAoB,EACpB;IACA,KAAK,CAACH,IAAI,EAAEC,aAAa,CAAC;IAAC,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAE3B,IAAI,CAACC,gBAAgB,GAAG,IAAIC,4BAAmB,CAC7C,IAAI,CAACP,IAAI,CAACQ,MAAM,EAChB,IAAI,CAACP,aAAa,CAACO,MACrB,CAAC;IACD,IAAI,CAACC,OAAO,GAAGP,MAAM;IACrB,IAAI,CAACQ,YAAY,GAAGP,WAAW;EACjC;;EAEA;AACF;EACE,OAAOQ,cAAcA,CACnBC,IAAY,EACZC,IAAY,EACZC,KAAa,EAIA;IAAA,IAHbC,IAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,MAAM;IAAA,IACrBd,MAAe,GAAAc,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAAA,IACff,WAAoB,GAAAa,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAEp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EAAwB;IAC/C,OAAO,IAAI,CAACxC,gBAAgB,CAACyC,iBAAiB,CAACD,GAAG,CAAC;EACrD;;EAEA;AACF;AACA;EACEE,aAAaA,CAACF,GAAW,EAAW;IAClC,OAAO,IAAI,CAACD,aAAa,CAACC,GAAG,CAAC,KAAK,IAAI;EACzC;;EAEA;AACF;AACA;EACE,IAAIA,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAAC9C,IAAI,CAACY,IAAI;EACvB;;EAEA;AACF;AACA;EACE,IAAIE,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACoB,eAAe,CAAC,OAAO,EAAE,IAAI,CAACY,GAAG,CAAC;EAChD;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAY;IAC3B,OAAO,IAAAnB,YAAG,EAAC,IAAI,CAAC7B,aAAa,EAAE,aAAa,CAAC;EAC/C;;EAEA;AACF;EACE,IAAIiD,aAAaA,CAAA,EAAsC;IACrD,IAAI,IAAI,CAACD,aAAa,EAAE;MACtB,OAAO,IAAIE,mCAA0B,CACnC,IAAI,CAACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EACjC,IAAI,CAACQ,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,CACxC,CAAC;IACH;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIkB,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACC,KAAK;EACnB;;EAEA;AACF;EACE,IAAID,IAAIA,CAACA,IAAY,EAAE;IACrB,IAAI,CAACC,KAAK,GAAGD,IAAI;EACnB;AACF;AAACE,OAAA,CAAAjD,OAAA,GAAAR,WAAA","ignoreList":[]}
1
+ {"version":3,"file":"ActionModel.js","names":["_objects","require","_ProcessStatusSettingsModel","_interopRequireDefault","_AttributeCollection","_BaseModel","_Href","_constants","ActionModel","BaseModel","constructor","data","contributions","modelOptions","_defineProperty2","default","_fieldCollection","AttributeCollection","fields","isReadonly","createFromHref","name","href","label","type","arguments","length","undefined","origin","contextPath","isDisabled","selfhref","_href","Href","querystring","method","getData","HTTP_METHODS","POST","layouthint","has","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","getContribution","all","fieldCollection","_context","_context2","_map","_filter","call","attribute","value","join","getFieldByKey","key","getAttributeByKey","hasFieldByKey","isProcessTask","processStatus","ProcessStatusSettingsModel","icon","_icon","exports"],"sources":["../../../src/models/actions/ActionModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ProcessStatusSettingsModel from \"../process/ProcessStatusSettingsModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\n\nimport {\n HTTP_METHODS,\n CREATE_ACTION,\n UPDATE_ACTION,\n DELETE_ACTION,\n} from \"../../constants\";\n\nimport type { AttributeType, ModelOptions } from \"../types\";\n\n/**\n * Defines an Action. For instance an action on the tab 'books', which leads to a form\n */\nexport default class ActionModel extends BaseModel {\n _fieldCollection: AttributeCollection;\n _href: Href;\n _icon: string;\n\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._fieldCollection = new AttributeCollection(\n this.data.fields,\n this.contributions.fields,\n { ...modelOptions, isReadonly: false },\n );\n }\n\n /**\n */\n static createFromHref(\n name: string,\n href: string,\n label: string,\n type: string = \"form\",\n origin?: string,\n contextPath?: string,\n ): ActionModel {\n const data = { name, href };\n const contributions = { name, label: label ?? name, type };\n return new ActionModel(data, contributions, { origin, contextPath });\n }\n\n /**\n */\n get isDisabled(): boolean {\n return this.data.href == null;\n }\n\n /**\n * retrieve href of action\n */\n get selfhref(): Href {\n return (\n this._href ??\n new Href(\n `${this.data.href}?${this.querystring}`,\n \"Form\",\n this.modelOptions,\n )\n );\n }\n\n /**\n */\n set selfhref(href: Href) {\n this._href = href;\n }\n\n /**\n * retrieve request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this.getData(\"method\", HTTP_METHODS.POST);\n }\n\n /**\n * Retrieve type of method\n */\n get type(): string {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContribution(\"type\", \"general\");\n }\n\n /**\n * Retrieve name of action\n */\n get name(): string {\n return this.getData(\"name\", \"unknown\");\n }\n\n /**\n * retrieve the collection of field attributes as an array\n */\n get fields(): Array<AttributeType> {\n return this._fieldCollection.all;\n }\n\n /**\n * Retrieve the field collection\n */\n get fieldCollection(): AttributeCollection {\n return this._fieldCollection;\n }\n\n /**\n */\n set fieldCollection(fieldCollection: AttributeCollection) {\n this._fieldCollection = fieldCollection;\n }\n\n /**\n * Retrieve querystring of action\n */\n get querystring(): string {\n return this.fields\n .filter((attribute) => attribute.value != null && attribute.value !== \"\")\n .map((attribute) => {\n const { value } = attribute;\n if (value !== null) {\n return `${attribute.name}=${value}`;\n }\n return attribute.name;\n })\n .join(\"&\");\n }\n\n /**\n * Retrieve a field by it's key\n */\n getFieldByKey(key: string): AttributeType | null {\n return this._fieldCollection.getAttributeByKey(key);\n }\n\n /**\n * Indicates if field exists by the given key\n */\n hasFieldByKey(key: string): boolean {\n return this.getFieldByKey(key) !== null;\n }\n\n /**\n * Getting the key/name of this action\n */\n get key(): string {\n return this.data.name;\n }\n\n /**\n * Getting the label of the action\n */\n get label(): string {\n return this.getContribution(\"label\", this.key);\n }\n\n /**\n */\n get isProcessTask(): boolean {\n return has(this.contributions, \"processTask\");\n }\n\n /**\n */\n get processStatus(): ProcessStatusSettingsModel | null {\n if (this.isProcessTask) {\n return new ProcessStatusSettingsModel(\n this.getData(\"processStatus\", {}),\n this.getContribution(\"processTask\", {}),\n this.modelOptions,\n );\n }\n\n return null;\n }\n\n /**\n */\n get icon(): string {\n return this._icon;\n }\n\n /**\n */\n set icon(icon: string) {\n this._icon = icon;\n }\n}\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I,CAACY,GAAG,CAAC;EAChD;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAY;IAC3B,OAAO,IAAAnB,YAAG,EAAC,IAAI,CAAC5B,aAAa,EAAE,aAAa,CAAC;EAC/C;;EAEA;AACF;EACE,IAAIgD,aAAaA,CAAA,EAAsC;IACrD,IAAI,IAAI,CAACD,aAAa,EAAE;MACtB,OAAO,IAAIE,mCAA0B,CACnC,IAAI,CAACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EACjC,IAAI,CAACQ,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EACvC,IAAI,CAAC/B,YACP,CAAC;IACH;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIiD,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACC,KAAK;EACnB;;EAEA;AACF;EACE,IAAID,IAAIA,CAACA,IAAY,EAAE;IACrB,IAAI,CAACC,KAAK,GAAGD,IAAI;EACnB;AACF;AAACE,OAAA,CAAAjD,OAAA,GAAAP,WAAA","ignoreList":[]}
@@ -88,7 +88,7 @@ class ApplicationModel extends _ResourceModel.default {
88
88
  * Get modelcatalog link
89
89
  */
90
90
  get modelcatalog() {
91
- return _LinkModel.default.create("modelcatalog", "/modelcatalog", "Model catalog", this.origin, this.contextPath);
91
+ return _LinkModel.default.create("modelcatalog", "/modelcatalog", "Model catalog", this.modelOptions);
92
92
  }
93
93
 
94
94
  /**
@@ -106,8 +106,7 @@ export default class ApplicationModel extends ResourceModel {
106
106
  "modelcatalog",
107
107
  "/modelcatalog",
108
108
  "Model catalog",
109
- this.origin,
110
- this.contextPath,
109
+ this.modelOptions,
111
110
  );
112
111
  }
113
112
 
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationModel.js","names":["_ResourceModel","_interopRequireDefault","require","_LinkModel","_UserServicesModel","_exceptions","_constants","ApplicationModel","ResourceModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","NotAllowedUriException","setChildModels","models","userServiceModel","_find","call","model","userServices","label","getContribution","authenticationTypes","DEFAULT_AUTHENTICATION_TYPE","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","LinkModel","create","origin","contextPath","_userServices","UserServicesModel","isLoggedIn","userHref","userLink","userMustChangePassword","mustChangePassword","exports"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\",\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\",\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort(\n (a: AuthenticationType, b: AuthenticationType) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1,\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\n \"modelcatalog\",\n \"/modelcatalog\",\n \"Model catalog\",\n this.origin,\n this.contextPath,\n );\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices?.userLink) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n\n /**\n */\n get userMustChangePassword(): boolean {\n return this.userServices?.mustChangePassword ?? false;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAOA;AACA;AACA;AACe,MAAMK,gBAAgB,SAASC,sBAAa,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;EAAA;EAG1D;AAC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el.js","names":["_ResourceModel","_interopRequireDefault","require","_LinkModel","_UserServicesModel","_exceptions","_constants","ApplicationModel","ResourceModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","NotAllowedUriException","setChildModels","models","userServiceModel","_find","call","model","userServices","label","getContribution","authenticationTypes","DEFAULT_AUTHENTICATION_TYPE","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","LinkModel","create","modelOptions","_userServices","UserServicesModel","isLoggedIn","userHref","userLink","userMustChangePassword","mustChangePassword","exports"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\",\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\",\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort(\n (a: AuthenticationType, b: AuthenticationType) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1,\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\n \"modelcatalog\",\n \"/modelcatalog\",\n \"Model catalog\",\n this.modelOptions,\n );\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices?.userLink) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n\n /**\n */\n get userMustChangePassword(): boolean {\n return this.userServices?.mustChangePassword ?? false;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAOA;AACA;AAC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AAI,KAAK;EACvD;AACF;AAACC,OAAA,CAAA1C,OAAA,GAAAL,gBAAA","ignoreList":[]}
@@ -24,15 +24,18 @@ class AttributeCollection extends _ResourceCollection.default {
24
24
  constructor() {
25
25
  let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
26
  let contributions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
27
- let isReadonly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
27
+ let modelOptions = arguments.length > 2 ? arguments[2] : undefined;
28
28
  super();
29
29
  if (contributions) {
30
30
  contributions.forEach(contribution => {
31
31
  const [key] = (0, _keys.default)(contribution);
32
- const attribute = (0, _createAttribute.default)(key, data, contribution[key]);
32
+ const attribute = (0, _createAttribute.default)(key, data, contribution[key], {
33
+ origin: modelOptions?.origin,
34
+ contextPath: modelOptions?.contextPath
35
+ });
33
36
  if (attribute !== null) {
34
37
  // when readonly is not explicitly set in the contributions, follow argument
35
- if (isReadonly && !(0, _objects.has)(contribution[key], "readonly")) {
38
+ if (modelOptions?.isReadonly && !(0, _objects.has)(contribution[key], "readonly")) {
36
39
  attribute.readonly = true;
37
40
  }
38
41
  this.collection.push(attribute);
@@ -11,7 +11,12 @@ import ContentConfiguration from "../contentconfiguration/ContentConfiguration";
11
11
 
12
12
  import { ConfigurationException } from "../../exceptions";
13
13
 
14
- import type { AttributeType, FormErrorAnchor } from "../types";
14
+ import type { AttributeType, FormErrorAnchor, ModelOptions } from "../types";
15
+
16
+ type AttributeCollectionOptions = {
17
+ ...ModelOptions,
18
+ isReadonly: boolean,
19
+ };
15
20
 
16
21
  /**
17
22
  * Collection of attributes
@@ -20,7 +25,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
20
25
  constructor(
21
26
  data: Object | Array<Object> = {},
22
27
  contributions: Array<Object> = [],
23
- isReadonly: boolean = false,
28
+ modelOptions?: AttributeCollectionOptions,
24
29
  ) {
25
30
  super();
26
31
 
@@ -28,11 +33,14 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
28
33
  contributions.forEach((contribution) => {
29
34
  const [key] = Object.keys(contribution);
30
35
 
31
- const attribute = createAttribute(key, data, contribution[key]);
36
+ const attribute = createAttribute(key, data, contribution[key], {
37
+ origin: modelOptions?.origin,
38
+ contextPath: modelOptions?.contextPath,
39
+ });
32
40
 
33
41
  if (attribute !== null) {
34
42
  // when readonly is not explicitly set in the contributions, follow argument
35
- if (isReadonly && !has(contribution[key], "readonly")) {
43
+ if (modelOptions?.isReadonly && !has(contribution[key], "readonly")) {
36
44
  attribute.readonly = true;
37
45
  }
38
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeCollection.js","names":["_objects","require","_ResourceCollection","_interopRequireDefault","_createAttribute","_ChoiceAttributeModel","_CompositeAttributeModel","_ContentConfiguration","_exceptions","AttributeCollection","ResourceCollection","constructor","data","arguments","length","undefined","contributions","isReadonly","forEach","contribution","key","_keys","default","attribute","createAttribute","has","readonly","collection","push","processLayoutHintRules","attributes","all","visible","_context","_filter","call","isHidden","questions","_context2","isResult","results","_context3","getAttributeByAttribute","_context4","_find","attr","equals","CompositeAttributeModel","getChildByAttribute","getAttributeByKey","_context5","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","_context6","_len","hints","Array","_key","layouthint","getChoiceAttributeByLayoutHint","layoutHint","ChoiceAttributeModel","getAttributesByLayoutHint","_context7","_len2","_key2","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","ConfigurationException","hasErrors","updateValidations","errors","_context8","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","_startsWith","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","_context9","_context10","validationData","attributesFormData","_map","isVisible","getEmptyFormData","attributeFormData","_default","exports"],"sources":["../../../src/models/attributes/AttributeCollection.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceCollection from \"../base/ResourceCollection\";\n\nimport createAttribute from \"./_createAttribute\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\n\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\n\nimport { ConfigurationException } from \"../../exceptions\";\n\nimport type { AttributeType, FormErrorAnchor } from \"../types\";\n\n/**\n * Collection of attributes\n */\nclass AttributeCollection extends ResourceCollection<AttributeType> {\n constructor(\n data: Object | Array<Object> = {},\n contributions: Array<Object> = [],\n isReadonly: boolean = false,\n ) {\n super();\n\n if (contributions) {\n contributions.forEach((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attribute = createAttribute(key, data, contribution[key]);\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (isReadonly && !has(contribution[key], \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n * @returns {Array<AttributeType>}\n */\n get attributes(): Array<AttributeType> {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: Array<AttributeType>) {\n this.collection = attributes;\n }\n\n /**\n */\n processLayoutHintRules(): void {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible(): Array<AttributeType> {\n // Let flow know that this is a AttributeCollection\n if (this instanceof AttributeCollection) {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n return [];\n }\n\n /**\n */\n get questions(): Array<AttributeType> {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n /**\n */\n get results(): Array<AttributeType> {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string): boolean {\n return this.getAttributeByKey(key) !== null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: Array<string>): AttributeType | null {\n return this.find((attribute) => attribute.layouthint.has(...hints)) || null;\n }\n\n /**\n * Getting a choice attribute by layouthint, returns null when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(\n layoutHint: string,\n ): ChoiceAttributeModel | null {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n\n return attribute instanceof ChoiceAttributeModel ? attribute : null;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: Array<string>): Array<AttributeType> {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeType): void {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string): void {\n this.forEach((attribute) => {\n const newAttribute = attribute.clone();\n\n newAttribute.referenceDate = date;\n\n this.replace(attribute, newAttribute);\n });\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n /**\n */\n addServerError(error: FormErrorAnchor): void {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`,\n );\n }\n }\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): AttributeCollection {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key,\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors,\n );\n }\n });\n\n return this;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration,\n ): void {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData(false);\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData),\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n // $FlowIgnore[cannot-spread-indexer]\n // $FlowIgnore[exponential-spread]\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\n return data;\n }\n}\n\nexport default AttributeCollection;\n"],"mappings":";;;;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AA,OAAA/D,OAAA,CAAAZ,OAAA,EAAA4E,UAAA,OAAI,CAACpE,UAAU,EAAAK,IAAA,CAAA+D,UAAA,EAErC3E,SAAS,IACRA,SAAS,CAACwE,QAAQ,KAAK,IAAI,IAC3B,CAACxE,SAAS,CAACG,QAAQ,KAClB,CAACyE,cAAc,IAAI5E,SAAS,CAACgE,wBAAwB,CAC1D,CAAC,EAAApD,IAAA,CAAA8D,SAAA,EACK1E,SAAS,IAAK;MAClB;MACA,IAAIA,SAAS,CAAC+E,SAAS,EAAE;QACvB,OAAO/E,SAAS,CAACwE,QAAQ;MAC3B;MAEA,OAAOxE,SAAS,CAACgF,gBAAgB,CAAC,CAAC;IACrC,CAAC,CAAC;IAEJ,IAAI3F,IAAI,GAAG,CAAC,CAAC;IACbwF,kBAAkB,CAAClF,OAAO,CAAEsF,iBAAiB,IAAK;MAChD;MACA;MACA5F,IAAI,GAAG;QACL,GAAGA,IAAI;QACP,GAAG4F;MACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAO5F,IAAI;EACb;AACF;AAAC,IAAA6F,QAAA,GAAAC,OAAA,CAAApF,OAAA,GAEcb,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"AttributeCollection.js","names":["_objects","require","_ResourceCollection","_interopRequireDefault","_createAttribute","_ChoiceAttributeModel","_CompositeAttributeModel","_ContentConfiguration","_exceptions","AttributeCollection","ResourceCollection","constructor","data","arguments","length","undefined","contributions","modelOptions","forEach","contribution","key","_keys","default","attribute","createAttribute","origin","contextPath","isReadonly","has","readonly","collection","push","processLayoutHintRules","attributes","all","visible","_context","_filter","call","isHidden","questions","_context2","isResult","results","_context3","getAttributeByAttribute","_context4","_find","attr","equals","CompositeAttributeModel","getChildByAttribute","getAttributeByKey","_context5","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","_context6","_len","hints","Array","_key","layouthint","getChoiceAttributeByLayoutHint","layoutHint","ChoiceAttributeModel","getAttributesByLayoutHint","_context7","_len2","_key2","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","ConfigurationException","hasErrors","updateValidations","errors","_context8","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","_startsWith","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","_context9","_context10","validationData","attributesFormData","_map","isVisible","getEmptyFormData","attributeFormData","_default","exports"],"sources":["../../../src/models/attributes/AttributeCollection.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceCollection from \"../base/ResourceCollection\";\n\nimport createAttribute from \"./_createAttribute\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\n\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\n\nimport { ConfigurationException } from \"../../exceptions\";\n\nimport type { AttributeType, FormErrorAnchor, ModelOptions } from \"../types\";\n\ntype AttributeCollectionOptions = {\n ...ModelOptions,\n isReadonly: boolean,\n};\n\n/**\n * Collection of attributes\n */\nclass AttributeCollection extends ResourceCollection<AttributeType> {\n constructor(\n data: Object | Array<Object> = {},\n contributions: Array<Object> = [],\n modelOptions?: AttributeCollectionOptions,\n ) {\n super();\n\n if (contributions) {\n contributions.forEach((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attribute = createAttribute(key, data, contribution[key], {\n origin: modelOptions?.origin,\n contextPath: modelOptions?.contextPath,\n });\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (modelOptions?.isReadonly && !has(contribution[key], \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n * @returns {Array<AttributeType>}\n */\n get attributes(): Array<AttributeType> {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: Array<AttributeType>) {\n this.collection = attributes;\n }\n\n /**\n */\n processLayoutHintRules(): void {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible(): Array<AttributeType> {\n // Let flow know that this is a AttributeCollection\n if (this instanceof AttributeCollection) {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n return [];\n }\n\n /**\n */\n get questions(): Array<AttributeType> {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n /**\n */\n get results(): Array<AttributeType> {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string): boolean {\n return this.getAttributeByKey(key) !== null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: Array<string>): AttributeType | null {\n return this.find((attribute) => attribute.layouthint.has(...hints)) || null;\n }\n\n /**\n * Getting a choice attribute by layouthint, returns null when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(\n layoutHint: string,\n ): ChoiceAttributeModel | null {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n\n return attribute instanceof ChoiceAttributeModel ? attribute : null;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: Array<string>): Array<AttributeType> {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeType): void {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string): void {\n this.forEach((attribute) => {\n const newAttribute = attribute.clone();\n\n newAttribute.referenceDate = date;\n\n this.replace(attribute, newAttribute);\n });\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n /**\n */\n addServerError(error: FormErrorAnchor): void {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`,\n );\n }\n }\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): AttributeCollection {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key,\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors,\n );\n }\n });\n\n return this;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration,\n ): void {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData(false);\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData),\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n // $FlowIgnore[cannot-spread-indexer]\n // $FlowIgnore[exponential-spread]\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\n return data;\n }\n}\n\nexport default AttributeCollection;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,qBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,wBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,qBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAEA,IAAAO,WAAA,GAAAP,OAAA;AASA;AACA;AACA;AACA,MAAMQ,mBAAmB,SAASC,2BAAkB,CAAgB;EAClEC,WAAWA,CAAA,EAIT;IAAA,IAHAC,IAA4B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,IACjCG,aAA4B,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IACjCI,YAAyC,GAAAJ,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAEzC,KAAK,CAAC,CAAC;IAEP,IAAIC,aAAa,EAAE;MACjBA,aAAa,CAACE,O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AAA,GAAAC,OAAA,CAAAvF,OAAA,GAEcb,mBAAmB","ignoreList":[]}
@@ -31,8 +31,8 @@ var _AttributeContent = _interopRequireDefault(require("./AttributeContent"));
31
31
  class AttributeModel extends _BaseModel.default {
32
32
  /**
33
33
  */
34
- constructor(attribute, attributeContributions) {
35
- super(attribute, attributeContributions);
34
+ constructor(attribute, attributeContributions, modelOptions) {
35
+ super(attribute, attributeContributions, modelOptions);
36
36
  (0, _defineProperty2.default)(this, "_label", void 0);
37
37
  (0, _defineProperty2.default)(this, "_lastModification", 0);
38
38
  (0, _defineProperty2.default)(this, "_initvalue", void 0);
@@ -71,7 +71,7 @@ class AttributeModel extends _BaseModel.default {
71
71
  this._referenceDate = this.getData("referenceDate", _DateTimeUtil.DateUtil.now());
72
72
  this._isResult = this.getData("isResult", false);
73
73
  this._mandatory = this.layouthint.has(_LayoutHints.MANDATORY) || this.contributions.mandatory;
74
- this._links = new _LinkCollection.default(this.data._links, this.contributions._links);
74
+ this._links = new _LinkCollection.default(this.data._links, this.contributions._links, modelOptions);
75
75
  }
76
76
 
77
77
  /**
@@ -30,6 +30,7 @@ import type {
30
30
  AttributeType,
31
31
  FormErrorAnchor,
32
32
  IModelWithChildModels,
33
+ ModelOptions,
33
34
  ModularUIModel,
34
35
  } from "../types";
35
36
  import type LinkModel from "../links/LinkModel";
@@ -74,8 +75,12 @@ export default class AttributeModel
74
75
 
75
76
  /**
76
77
  */
77
- constructor(attribute: Object, attributeContributions: Object) {
78
- super(attribute, attributeContributions);
78
+ constructor(
79
+ attribute: Object,
80
+ attributeContributions: Object,
81
+ modelOptions?: ModelOptions,
82
+ ) {
83
+ super(attribute, attributeContributions, modelOptions);
79
84
 
80
85
  if (this.hasContentFromData && this.content.label) {
81
86
  this._label = this.content.label;
@@ -108,6 +113,7 @@ export default class AttributeModel
108
113
  this._links = new LinkCollection(
109
114
  this.data._links,
110
115
  this.contributions._links,
116
+ modelOptions,
111
117
  );
112
118
  }
113
119