@beinformed/ui 1.25.0 → 1.25.1-beta.1

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 (534) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useAuthentication.js +1 -1
  5. package/esm/hooks/useAuthentication.js.map +1 -1
  6. package/esm/hooks/useModelCatalog.js +0 -1
  7. package/esm/hooks/useModelCatalog.js.map +1 -1
  8. package/esm/hooks/useModels.js +1 -1
  9. package/esm/hooks/useModels.js.map +1 -1
  10. package/esm/hooks/useModularUI.js +1 -1
  11. package/esm/hooks/useModularUI.js.map +1 -1
  12. package/esm/hooks/useModularUIBasic.js +4 -1
  13. package/esm/hooks/useModularUIBasic.js.map +1 -1
  14. package/esm/hooks/useRouter.js +1 -1
  15. package/esm/hooks/useRouter.js.map +1 -1
  16. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  17. package/esm/models/attributes/AttributeModel.js.map +1 -1
  18. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  19. package/esm/models/attributes/NumberAttributeModel.js +5 -2
  20. package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
  21. package/esm/models/attributes/_createAttribute.js.map +1 -1
  22. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  23. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  24. package/esm/models/base/ResourceModel.js.map +1 -1
  25. package/esm/models/content/ContentTOCModel.js.map +1 -1
  26. package/esm/models/filters/FilterCollection.js.map +1 -1
  27. package/esm/models/form/FormModel.js.map +1 -1
  28. package/esm/models/links/LinkModel.js +3 -1
  29. package/esm/models/links/LinkModel.js.map +1 -1
  30. package/esm/models/links/normalizeLinkJSON.js.map +1 -1
  31. package/esm/models/list/ListModel.js.map +1 -1
  32. package/esm/models/parameter/Parameter.js +1 -1
  33. package/esm/models/parameter/Parameter.js.map +1 -1
  34. package/esm/models/types.js.map +1 -1
  35. package/esm/modularui/ModularUIRequest.js.map +1 -1
  36. package/esm/react-client/client.js +1 -1
  37. package/esm/react-client/client.js.map +1 -1
  38. package/esm/react-client/rehydrate.js.map +1 -1
  39. package/esm/react-server/createSSRComplete.js.map +1 -1
  40. package/esm/react-server/renderSSRComplete.js +4 -2
  41. package/esm/react-server/renderSSRComplete.js.map +1 -1
  42. package/esm/react-server/serverUtil.js +18 -9
  43. package/esm/react-server/serverUtil.js.map +1 -1
  44. package/esm/react-theme/ThemeProvider.js +1 -1
  45. package/esm/react-theme/ThemeProvider.js.map +1 -1
  46. package/esm/react-theme/createTheme.js +8 -3
  47. package/esm/react-theme/createTheme.js.map +1 -1
  48. package/esm/react-theme/utils/contrast.js +3 -1
  49. package/esm/react-theme/utils/contrast.js.map +1 -1
  50. package/esm/react-theme/utils/corners.js +3 -1
  51. package/esm/react-theme/utils/corners.js.map +1 -1
  52. package/esm/react-theme/utils/spacers.js +9 -3
  53. package/esm/react-theme/utils/spacers.js.map +1 -1
  54. package/esm/redux/_i18n/{actions.js → I18nActions.js} +1 -1
  55. package/esm/redux/_i18n/I18nActions.js.map +1 -0
  56. package/esm/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
  57. package/esm/redux/_i18n/I18nReducer.js.map +1 -0
  58. package/esm/redux/_i18n/index.js +2 -2
  59. package/esm/redux/_i18n/index.js.map +1 -1
  60. package/esm/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
  61. package/esm/redux/_modularui/ModularUIActions.js.map +1 -0
  62. package/esm/redux/_modularui/{connector.js → ModularUIConnector.js} +5 -5
  63. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -0
  64. package/esm/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +2 -2
  65. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -0
  66. package/esm/redux/_modularui/{reducer.js → ModularUIReducer.js} +4 -6
  67. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -0
  68. package/esm/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
  69. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -0
  70. package/esm/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
  71. package/esm/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
  72. package/esm/redux/_modularui/index.js +6 -6
  73. package/esm/redux/_modularui/index.js.map +1 -1
  74. package/esm/redux/_modularui/types.js.map +1 -1
  75. package/esm/redux/_modularui/withModularUI.js +1 -1
  76. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  77. package/esm/redux/_router/{actions.js → RouterActions.js} +1 -1
  78. package/esm/redux/_router/RouterActions.js.map +1 -0
  79. package/esm/redux/_router/{connectors.js → RouterConnectors.js} +2 -2
  80. package/esm/redux/_router/RouterConnectors.js.map +1 -0
  81. package/esm/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
  82. package/esm/redux/_router/RouterMiddleware.js.map +1 -0
  83. package/esm/redux/_router/{reducer.js → RouterReducer.js} +1 -1
  84. package/esm/redux/_router/RouterReducer.js.map +1 -0
  85. package/esm/redux/_router/index.js +4 -4
  86. package/esm/redux/_router/index.js.map +1 -1
  87. package/esm/redux/actions/Application.js +2 -2
  88. package/esm/redux/actions/Application.js.map +1 -1
  89. package/esm/redux/actions/Authorization.js +3 -3
  90. package/esm/redux/actions/Authorization.js.map +1 -1
  91. package/esm/redux/actions/Error.js +1 -1
  92. package/esm/redux/actions/Error.js.map +1 -1
  93. package/esm/redux/actions/Form.js +2 -2
  94. package/esm/redux/actions/Form.js.map +1 -1
  95. package/esm/redux/actions/FormAttributeSet.js +1 -1
  96. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  97. package/esm/redux/actions/FormAttributeSetRepeatable.js +1 -1
  98. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  99. package/esm/redux/actions/FormAutosave.js +1 -1
  100. package/esm/redux/actions/FormAutosave.js.map +1 -1
  101. package/esm/redux/actions/FormAutosubmit.js +1 -1
  102. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  103. package/esm/redux/actions/FormValidations.js +1 -1
  104. package/esm/redux/actions/FormValidations.js.map +1 -1
  105. package/esm/redux/actions/Notification.js.map +1 -1
  106. package/esm/redux/actions/Preferences.js +1 -1
  107. package/esm/redux/actions/Preferences.js.map +1 -1
  108. package/esm/redux/actions/SignIn.js +1 -1
  109. package/esm/redux/actions/SignIn.js.map +1 -1
  110. package/esm/redux/actions/SignOut.js +1 -1
  111. package/esm/redux/actions/SignOut.js.map +1 -1
  112. package/esm/redux/connectors/Application.js +1 -1
  113. package/esm/redux/connectors/Application.js.map +1 -1
  114. package/esm/redux/connectors/Breadcrumb.js +1 -1
  115. package/esm/redux/connectors/Breadcrumb.js.map +1 -1
  116. package/esm/redux/connectors/CaseView.js +1 -1
  117. package/esm/redux/connectors/CaseView.js.map +1 -1
  118. package/esm/redux/connectors/ConceptDetail.js +1 -1
  119. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  120. package/esm/redux/connectors/ContentBrowser.js +1 -1
  121. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  122. package/esm/redux/connectors/ContentDetail.js +1 -1
  123. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  124. package/esm/redux/connectors/ContentDetailSection.js +1 -1
  125. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  126. package/esm/redux/connectors/Form.js +1 -1
  127. package/esm/redux/connectors/Form.js.map +1 -1
  128. package/esm/redux/connectors/ListDetail.js +1 -1
  129. package/esm/redux/connectors/ListDetail.js.map +1 -1
  130. package/esm/redux/connectors/ModelCatalog.js +1 -1
  131. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  132. package/esm/redux/connectors/PanelRenderer.js +1 -1
  133. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  134. package/esm/redux/connectors/Preferences.js.map +1 -1
  135. package/esm/redux/connectors/QuickSearch.js +2 -2
  136. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  137. package/esm/redux/connectors/SignIn.js +1 -1
  138. package/esm/redux/connectors/SignIn.js.map +1 -1
  139. package/esm/redux/connectors/SignOut.js.map +1 -1
  140. package/esm/redux/connectors/Tab.js +1 -1
  141. package/esm/redux/connectors/Tab.js.map +1 -1
  142. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  143. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  144. package/esm/redux/reducers/createReducer.js +3 -3
  145. package/esm/redux/reducers/createReducer.js.map +1 -1
  146. package/esm/redux/store/configureStore.js +4 -4
  147. package/esm/redux/store/configureStore.js.map +1 -1
  148. package/esm/utils/fetch/universalFetch.js +3 -2
  149. package/esm/utils/fetch/universalFetch.js.map +1 -1
  150. package/esm/utils/fetch/xhr.js.map +1 -1
  151. package/esm/utils/helpers/objects.js +4 -3
  152. package/esm/utils/helpers/objects.js.map +1 -1
  153. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  154. package/esm/utils/number/parseNumbers.js.map +1 -1
  155. package/lib/builder/mergeLayoutHintConfigurations.js.flow +1 -1
  156. package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
  157. package/lib/constants/Settings.js.flow +1 -1
  158. package/lib/constants/Settings.js.map +1 -1
  159. package/lib/hooks/useAuthentication.js +3 -3
  160. package/lib/hooks/useAuthentication.js.flow +1 -1
  161. package/lib/hooks/useAuthentication.js.map +1 -1
  162. package/lib/hooks/useModelCatalog.js.flow +2 -1
  163. package/lib/hooks/useModelCatalog.js.map +1 -1
  164. package/lib/hooks/useModels.js +2 -2
  165. package/lib/hooks/useModels.js.flow +1 -1
  166. package/lib/hooks/useModels.js.map +1 -1
  167. package/lib/hooks/useModularUI.js +3 -3
  168. package/lib/hooks/useModularUI.js.flow +4 -1
  169. package/lib/hooks/useModularUI.js.map +1 -1
  170. package/lib/hooks/useModularUIBasic.js +4 -1
  171. package/lib/hooks/useModularUIBasic.js.flow +1 -1
  172. package/lib/hooks/useModularUIBasic.js.map +1 -1
  173. package/lib/hooks/useRouter.js +6 -6
  174. package/lib/hooks/useRouter.js.flow +7 -1
  175. package/lib/hooks/useRouter.js.map +1 -1
  176. package/lib/models/attributes/AttributeCollection.js.flow +8 -6
  177. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  178. package/lib/models/attributes/AttributeModel.js.flow +18 -16
  179. package/lib/models/attributes/AttributeModel.js.map +1 -1
  180. package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +1 -1
  181. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  182. package/lib/models/attributes/NumberAttributeModel.js +5 -2
  183. package/lib/models/attributes/NumberAttributeModel.js.flow +7 -3
  184. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  185. package/lib/models/attributes/_createAttribute.js.flow +1 -1
  186. package/lib/models/attributes/_createAttribute.js.map +1 -1
  187. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +1 -1
  188. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  189. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.flow +1 -1
  190. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  191. package/lib/models/base/ResourceModel.js.flow +1 -1
  192. package/lib/models/base/ResourceModel.js.map +1 -1
  193. package/lib/models/content/ContentTOCModel.js.flow +4 -1
  194. package/lib/models/content/ContentTOCModel.js.map +1 -1
  195. package/lib/models/filters/FilterCollection.js.flow +1 -1
  196. package/lib/models/filters/FilterCollection.js.map +1 -1
  197. package/lib/models/form/FormModel.js.flow +2 -2
  198. package/lib/models/form/FormModel.js.map +1 -1
  199. package/lib/models/links/LinkModel.js +3 -1
  200. package/lib/models/links/LinkModel.js.flow +4 -2
  201. package/lib/models/links/LinkModel.js.map +1 -1
  202. package/lib/models/links/normalizeLinkJSON.js.flow +1 -1
  203. package/lib/models/links/normalizeLinkJSON.js.map +1 -1
  204. package/lib/models/list/ListModel.js.flow +1 -1
  205. package/lib/models/list/ListModel.js.map +1 -1
  206. package/lib/models/parameter/Parameter.js +1 -1
  207. package/lib/models/parameter/Parameter.js.flow +1 -1
  208. package/lib/models/parameter/Parameter.js.map +1 -1
  209. package/lib/models/types.js.flow +6 -6
  210. package/lib/models/types.js.map +1 -1
  211. package/lib/modularui/ModularUIRequest.js.flow +6 -6
  212. package/lib/modularui/ModularUIRequest.js.map +1 -1
  213. package/lib/react-client/client.js +2 -2
  214. package/lib/react-client/client.js.flow +8 -8
  215. package/lib/react-client/client.js.map +1 -1
  216. package/lib/react-client/rehydrate.js.flow +2 -2
  217. package/lib/react-client/rehydrate.js.map +1 -1
  218. package/lib/react-server/createSSRComplete.js.flow +3 -3
  219. package/lib/react-server/createSSRComplete.js.map +1 -1
  220. package/lib/react-server/renderSSRComplete.js +4 -2
  221. package/lib/react-server/renderSSRComplete.js.flow +2 -2
  222. package/lib/react-server/renderSSRComplete.js.map +1 -1
  223. package/lib/react-server/serverUtil.js +19 -10
  224. package/lib/react-server/serverUtil.js.flow +20 -11
  225. package/lib/react-server/serverUtil.js.map +1 -1
  226. package/lib/react-theme/ThemeProvider.js +1 -1
  227. package/lib/react-theme/ThemeProvider.js.flow +1 -1
  228. package/lib/react-theme/ThemeProvider.js.map +1 -1
  229. package/lib/react-theme/__tests__/ThemeProvider.spec.js.flow +2 -0
  230. package/lib/react-theme/__tests__/createTheme.spec.js.flow +3 -0
  231. package/lib/react-theme/createTheme.js +8 -3
  232. package/lib/react-theme/createTheme.js.flow +7 -5
  233. package/lib/react-theme/createTheme.js.map +1 -1
  234. package/lib/react-theme/utils/contrast.js +3 -1
  235. package/lib/react-theme/utils/contrast.js.flow +1 -1
  236. package/lib/react-theme/utils/contrast.js.map +1 -1
  237. package/lib/react-theme/utils/corners.js +3 -1
  238. package/lib/react-theme/utils/corners.js.flow +1 -1
  239. package/lib/react-theme/utils/corners.js.map +1 -1
  240. package/lib/react-theme/utils/spacers.js +9 -3
  241. package/lib/react-theme/utils/spacers.js.flow +3 -3
  242. package/lib/react-theme/utils/spacers.js.map +1 -1
  243. package/lib/redux/_i18n/{actions.js → I18nActions.js} +1 -1
  244. package/lib/redux/_i18n/{actions.js.flow → I18nActions.js.flow} +0 -0
  245. package/lib/redux/_i18n/I18nActions.js.map +1 -0
  246. package/lib/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
  247. package/{src/redux/_i18n/reducer.js → lib/redux/_i18n/I18nReducer.js.flow} +5 -2
  248. package/lib/redux/_i18n/I18nReducer.js.map +1 -0
  249. package/lib/redux/_i18n/__tests__/actions.spec.js.flow +1 -1
  250. package/lib/redux/_i18n/__tests__/reducer.spec.js.flow +1 -1
  251. package/lib/redux/_i18n/index.js +8 -8
  252. package/lib/redux/_i18n/index.js.flow +2 -2
  253. package/lib/redux/_i18n/index.js.map +1 -1
  254. package/lib/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
  255. package/lib/redux/_modularui/{actions.js.flow → ModularUIActions.js.flow} +1 -1
  256. package/lib/redux/_modularui/ModularUIActions.js.map +1 -0
  257. package/lib/redux/_modularui/{connector.js → ModularUIConnector.js} +11 -11
  258. package/{src/redux/_modularui/connector.js → lib/redux/_modularui/ModularUIConnector.js.flow} +8 -4
  259. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -0
  260. package/lib/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +4 -4
  261. package/lib/redux/_modularui/{middleware.js.flow → ModularUIMiddleware.js.flow} +20 -5
  262. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -0
  263. package/lib/redux/_modularui/{reducer.js → ModularUIReducer.js} +4 -6
  264. package/lib/redux/_modularui/{reducer.js.flow → ModularUIReducer.js.flow} +14 -8
  265. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -0
  266. package/lib/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
  267. package/lib/redux/_modularui/{selectors.js.flow → ModularUISelectors.js.flow} +3 -2
  268. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -0
  269. package/lib/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
  270. package/lib/redux/_modularui/{modularuiUtils.js.flow → ModularUIUtils.js.flow} +0 -0
  271. package/lib/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
  272. package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -1
  273. package/lib/redux/_modularui/__tests__/reducer.spec.js.flow +6 -4
  274. package/lib/redux/_modularui/__tests__/selectors.spec.js.flow +1 -1
  275. package/lib/redux/_modularui/index.js +22 -22
  276. package/lib/redux/_modularui/index.js.flow +6 -6
  277. package/lib/redux/_modularui/index.js.map +1 -1
  278. package/lib/redux/_modularui/types.js.flow +10 -4
  279. package/lib/redux/_modularui/types.js.map +1 -1
  280. package/lib/redux/_modularui/withModularUI.js +2 -2
  281. package/lib/redux/_modularui/withModularUI.js.flow +1 -1
  282. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  283. package/lib/redux/_router/{actions.js → RouterActions.js} +1 -1
  284. package/lib/redux/_router/{actions.js.flow → RouterActions.js.flow} +0 -0
  285. package/lib/redux/_router/RouterActions.js.map +1 -0
  286. package/lib/redux/_router/{connectors.js → RouterConnectors.js} +7 -7
  287. package/lib/redux/_router/{connectors.js.flow → RouterConnectors.js.flow} +1 -1
  288. package/lib/redux/_router/RouterConnectors.js.map +1 -0
  289. package/lib/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
  290. package/lib/redux/_router/{middleware.js.flow → RouterMiddleware.js.flow} +0 -0
  291. package/lib/redux/_router/RouterMiddleware.js.map +1 -0
  292. package/lib/redux/_router/{reducer.js → RouterReducer.js} +1 -1
  293. package/lib/redux/_router/{reducer.js.flow → RouterReducer.js.flow} +0 -0
  294. package/lib/redux/_router/RouterReducer.js.map +1 -0
  295. package/lib/redux/_router/__tests__/actions.spec.js.flow +1 -1
  296. package/lib/redux/_router/__tests__/middleware.spec.js.flow +2 -2
  297. package/lib/redux/_router/__tests__/reducer.spec.js.flow +1 -1
  298. package/lib/redux/_router/index.js +16 -16
  299. package/lib/redux/_router/index.js.flow +4 -4
  300. package/lib/redux/_router/index.js.map +1 -1
  301. package/lib/redux/actions/Application.js +5 -5
  302. package/lib/redux/actions/Application.js.flow +5 -2
  303. package/lib/redux/actions/Application.js.map +1 -1
  304. package/lib/redux/actions/Authorization.js +6 -6
  305. package/lib/redux/actions/Authorization.js.flow +3 -3
  306. package/lib/redux/actions/Authorization.js.map +1 -1
  307. package/lib/redux/actions/Error.js +2 -2
  308. package/lib/redux/actions/Error.js.flow +2 -2
  309. package/lib/redux/actions/Error.js.map +1 -1
  310. package/lib/redux/actions/Form.js +5 -5
  311. package/lib/redux/actions/Form.js.flow +2 -2
  312. package/lib/redux/actions/Form.js.map +1 -1
  313. package/lib/redux/actions/FormAttributeSet.js +2 -2
  314. package/lib/redux/actions/FormAttributeSet.js.flow +1 -1
  315. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  316. package/lib/redux/actions/FormAttributeSetRepeatable.js +4 -4
  317. package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +1 -1
  318. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  319. package/lib/redux/actions/FormAutosave.js +2 -2
  320. package/lib/redux/actions/FormAutosave.js.flow +1 -1
  321. package/lib/redux/actions/FormAutosave.js.map +1 -1
  322. package/lib/redux/actions/FormAutosubmit.js +2 -2
  323. package/lib/redux/actions/FormAutosubmit.js.flow +1 -1
  324. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  325. package/lib/redux/actions/FormValidations.js +2 -2
  326. package/lib/redux/actions/FormValidations.js.flow +5 -3
  327. package/lib/redux/actions/FormValidations.js.map +1 -1
  328. package/lib/redux/actions/Notification.js.flow +1 -1
  329. package/lib/redux/actions/Notification.js.map +1 -1
  330. package/lib/redux/actions/Preferences.js +1 -1
  331. package/lib/redux/actions/Preferences.js.flow +3 -3
  332. package/lib/redux/actions/Preferences.js.map +1 -1
  333. package/lib/redux/actions/SignIn.js +2 -2
  334. package/lib/redux/actions/SignIn.js.flow +1 -1
  335. package/lib/redux/actions/SignIn.js.map +1 -1
  336. package/lib/redux/actions/SignOut.js +2 -2
  337. package/lib/redux/actions/SignOut.js.flow +1 -1
  338. package/lib/redux/actions/SignOut.js.map +1 -1
  339. package/lib/redux/connectors/Application.js +2 -2
  340. package/lib/redux/connectors/Application.js.flow +1 -1
  341. package/lib/redux/connectors/Application.js.map +1 -1
  342. package/lib/redux/connectors/Breadcrumb.js +2 -2
  343. package/lib/redux/connectors/Breadcrumb.js.flow +1 -1
  344. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  345. package/lib/redux/connectors/CaseView.js +2 -2
  346. package/lib/redux/connectors/CaseView.js.flow +1 -1
  347. package/lib/redux/connectors/CaseView.js.map +1 -1
  348. package/lib/redux/connectors/ConceptDetail.js +2 -2
  349. package/lib/redux/connectors/ConceptDetail.js.flow +1 -1
  350. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  351. package/lib/redux/connectors/ContentBrowser.js +2 -2
  352. package/lib/redux/connectors/ContentBrowser.js.flow +1 -1
  353. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  354. package/lib/redux/connectors/ContentDetail.js +2 -2
  355. package/lib/redux/connectors/ContentDetail.js.flow +1 -1
  356. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  357. package/lib/redux/connectors/ContentDetailSection.js +2 -2
  358. package/lib/redux/connectors/ContentDetailSection.js.flow +1 -1
  359. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  360. package/lib/redux/connectors/Form.js +2 -2
  361. package/lib/redux/connectors/Form.js.flow +1 -1
  362. package/lib/redux/connectors/Form.js.map +1 -1
  363. package/lib/redux/connectors/ListDetail.js +2 -2
  364. package/lib/redux/connectors/ListDetail.js.flow +1 -1
  365. package/lib/redux/connectors/ListDetail.js.map +1 -1
  366. package/lib/redux/connectors/ModelCatalog.js +2 -2
  367. package/lib/redux/connectors/ModelCatalog.js.flow +1 -1
  368. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  369. package/lib/redux/connectors/PanelRenderer.js +2 -2
  370. package/lib/redux/connectors/PanelRenderer.js.flow +1 -1
  371. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  372. package/lib/redux/connectors/Preferences.js.flow +5 -2
  373. package/lib/redux/connectors/Preferences.js.map +1 -1
  374. package/lib/redux/connectors/QuickSearch.js +4 -4
  375. package/lib/redux/connectors/QuickSearch.js.flow +2 -2
  376. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  377. package/lib/redux/connectors/SignIn.js +2 -2
  378. package/lib/redux/connectors/SignIn.js.flow +1 -1
  379. package/lib/redux/connectors/SignIn.js.map +1 -1
  380. package/lib/redux/connectors/SignOut.js.flow +2 -2
  381. package/lib/redux/connectors/SignOut.js.map +1 -1
  382. package/lib/redux/connectors/Tab.js +2 -2
  383. package/lib/redux/connectors/Tab.js.flow +1 -1
  384. package/lib/redux/connectors/Tab.js.map +1 -1
  385. package/lib/redux/reducers/ModalsReducer.js.flow +2 -2
  386. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  387. package/lib/redux/reducers/ProgressIndicatorReducer.js.flow +1 -1
  388. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  389. package/lib/redux/reducers/createReducer.js +6 -6
  390. package/lib/redux/reducers/createReducer.js.flow +3 -3
  391. package/lib/redux/reducers/createReducer.js.map +1 -1
  392. package/lib/redux/store/configureStore.js +5 -5
  393. package/lib/redux/store/configureStore.js.flow +4 -4
  394. package/lib/redux/store/configureStore.js.map +1 -1
  395. package/lib/utils/fetch/universalFetch.js +5 -3
  396. package/lib/utils/fetch/universalFetch.js.flow +8 -6
  397. package/lib/utils/fetch/universalFetch.js.map +1 -1
  398. package/lib/utils/fetch/xhr.js.flow +21 -21
  399. package/lib/utils/fetch/xhr.js.map +1 -1
  400. package/lib/utils/helpers/objects.js.flow +5 -3
  401. package/lib/utils/helpers/objects.js.map +1 -1
  402. package/lib/utils/helpers/sanitizeHtml.js.flow +1 -1
  403. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  404. package/lib/utils/number/parseNumbers.js.flow +8 -2
  405. package/lib/utils/number/parseNumbers.js.map +1 -1
  406. package/package.json +8 -8
  407. package/src/builder/mergeLayoutHintConfigurations.js +1 -1
  408. package/src/constants/Settings.js +1 -1
  409. package/src/hooks/useAuthentication.js +1 -1
  410. package/src/hooks/useModelCatalog.js +2 -1
  411. package/src/hooks/useModels.js +1 -1
  412. package/src/hooks/useModularUI.js +4 -1
  413. package/src/hooks/useModularUIBasic.js +1 -1
  414. package/src/hooks/useRouter.js +7 -1
  415. package/src/models/attributes/AttributeCollection.js +8 -6
  416. package/src/models/attributes/AttributeModel.js +18 -16
  417. package/src/models/attributes/CompositeAttributeChildCollection.js +1 -1
  418. package/src/models/attributes/NumberAttributeModel.js +7 -3
  419. package/src/models/attributes/_createAttribute.js +1 -1
  420. package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +1 -1
  421. package/src/models/attributes/layouthint-rules/DependentAttribute.js +1 -1
  422. package/src/models/base/ResourceModel.js +1 -1
  423. package/src/models/content/ContentTOCModel.js +4 -1
  424. package/src/models/filters/FilterCollection.js +1 -1
  425. package/src/models/form/FormModel.js +2 -2
  426. package/src/models/links/LinkModel.js +4 -2
  427. package/src/models/links/normalizeLinkJSON.js +1 -1
  428. package/src/models/list/ListModel.js +1 -1
  429. package/src/models/parameter/Parameter.js +1 -1
  430. package/src/models/types.js +6 -6
  431. package/src/modularui/ModularUIRequest.js +6 -6
  432. package/src/react-client/client.js +8 -8
  433. package/src/react-client/rehydrate.js +2 -2
  434. package/src/react-server/createSSRComplete.js +3 -3
  435. package/src/react-server/renderSSRComplete.js +2 -2
  436. package/src/react-server/serverUtil.js +20 -11
  437. package/src/react-theme/ThemeProvider.js +1 -1
  438. package/src/react-theme/__tests__/ThemeProvider.spec.js +2 -0
  439. package/src/react-theme/__tests__/createTheme.spec.js +3 -0
  440. package/src/react-theme/createTheme.js +7 -5
  441. package/src/react-theme/utils/contrast.js +1 -1
  442. package/src/react-theme/utils/corners.js +1 -1
  443. package/src/react-theme/utils/spacers.js +3 -3
  444. package/src/redux/_i18n/{actions.js → I18nActions.js} +0 -0
  445. package/{lib/redux/_i18n/reducer.js.flow → src/redux/_i18n/I18nReducer.js} +5 -2
  446. package/src/redux/_i18n/__tests__/actions.spec.js +1 -1
  447. package/src/redux/_i18n/__tests__/reducer.spec.js +1 -1
  448. package/src/redux/_i18n/index.js +2 -2
  449. package/src/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
  450. package/{lib/redux/_modularui/connector.js.flow → src/redux/_modularui/ModularUIConnector.js} +8 -4
  451. package/src/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +20 -5
  452. package/src/redux/_modularui/{reducer.js → ModularUIReducer.js} +14 -8
  453. package/src/redux/_modularui/{selectors.js → ModularUISelectors.js} +3 -2
  454. package/src/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +0 -0
  455. package/src/redux/_modularui/__tests__/actions.spec.js +1 -1
  456. package/src/redux/_modularui/__tests__/reducer.spec.js +6 -4
  457. package/src/redux/_modularui/__tests__/selectors.spec.js +1 -1
  458. package/src/redux/_modularui/index.js +6 -6
  459. package/src/redux/_modularui/types.js +10 -4
  460. package/src/redux/_modularui/withModularUI.js +1 -1
  461. package/src/redux/_router/{actions.js → RouterActions.js} +0 -0
  462. package/src/redux/_router/{connectors.js → RouterConnectors.js} +1 -1
  463. package/src/redux/_router/{middleware.js → RouterMiddleware.js} +0 -0
  464. package/src/redux/_router/{reducer.js → RouterReducer.js} +0 -0
  465. package/src/redux/_router/__tests__/actions.spec.js +1 -1
  466. package/src/redux/_router/__tests__/middleware.spec.js +2 -2
  467. package/src/redux/_router/__tests__/reducer.spec.js +1 -1
  468. package/src/redux/_router/index.js +4 -4
  469. package/src/redux/actions/Application.js +5 -2
  470. package/src/redux/actions/Authorization.js +3 -3
  471. package/src/redux/actions/Error.js +2 -2
  472. package/src/redux/actions/Form.js +2 -2
  473. package/src/redux/actions/FormAttributeSet.js +1 -1
  474. package/src/redux/actions/FormAttributeSetRepeatable.js +1 -1
  475. package/src/redux/actions/FormAutosave.js +1 -1
  476. package/src/redux/actions/FormAutosubmit.js +1 -1
  477. package/src/redux/actions/FormValidations.js +5 -3
  478. package/src/redux/actions/Notification.js +1 -1
  479. package/src/redux/actions/Preferences.js +3 -3
  480. package/src/redux/actions/SignIn.js +1 -1
  481. package/src/redux/actions/SignOut.js +1 -1
  482. package/src/redux/connectors/Application.js +1 -1
  483. package/src/redux/connectors/Breadcrumb.js +1 -1
  484. package/src/redux/connectors/CaseView.js +1 -1
  485. package/src/redux/connectors/ConceptDetail.js +1 -1
  486. package/src/redux/connectors/ContentBrowser.js +1 -1
  487. package/src/redux/connectors/ContentDetail.js +1 -1
  488. package/src/redux/connectors/ContentDetailSection.js +1 -1
  489. package/src/redux/connectors/Form.js +1 -1
  490. package/src/redux/connectors/ListDetail.js +1 -1
  491. package/src/redux/connectors/ModelCatalog.js +1 -1
  492. package/src/redux/connectors/PanelRenderer.js +1 -1
  493. package/src/redux/connectors/Preferences.js +5 -2
  494. package/src/redux/connectors/QuickSearch.js +2 -2
  495. package/src/redux/connectors/SignIn.js +1 -1
  496. package/src/redux/connectors/SignOut.js +2 -2
  497. package/src/redux/connectors/Tab.js +1 -1
  498. package/src/redux/reducers/ModalsReducer.js +2 -2
  499. package/src/redux/reducers/ProgressIndicatorReducer.js +1 -1
  500. package/src/redux/reducers/createReducer.js +3 -3
  501. package/src/redux/store/configureStore.js +4 -4
  502. package/src/utils/fetch/universalFetch.js +8 -6
  503. package/src/utils/fetch/xhr.js +21 -21
  504. package/src/utils/helpers/objects.js +5 -3
  505. package/src/utils/helpers/sanitizeHtml.js +1 -1
  506. package/src/utils/number/parseNumbers.js +8 -2
  507. package/types/models/concepts/ConceptDetailModel.d.ts +3 -3
  508. package/types/models/concepts/ConceptRelationModel.d.ts +2 -1
  509. package/types/models/types.d.ts +17 -3
  510. package/types/redux/_modularui/types.d.ts +3 -1
  511. package/types/utils/fetch/universalFetch.d.ts +3 -3
  512. package/types/utils/helpers/objects.d.ts +10 -2
  513. package/esm/redux/_i18n/actions.js.map +0 -1
  514. package/esm/redux/_i18n/reducer.js.map +0 -1
  515. package/esm/redux/_modularui/actions.js.map +0 -1
  516. package/esm/redux/_modularui/connector.js.map +0 -1
  517. package/esm/redux/_modularui/middleware.js.map +0 -1
  518. package/esm/redux/_modularui/reducer.js.map +0 -1
  519. package/esm/redux/_modularui/selectors.js.map +0 -1
  520. package/esm/redux/_router/actions.js.map +0 -1
  521. package/esm/redux/_router/connectors.js.map +0 -1
  522. package/esm/redux/_router/middleware.js.map +0 -1
  523. package/esm/redux/_router/reducer.js.map +0 -1
  524. package/lib/redux/_i18n/actions.js.map +0 -1
  525. package/lib/redux/_i18n/reducer.js.map +0 -1
  526. package/lib/redux/_modularui/actions.js.map +0 -1
  527. package/lib/redux/_modularui/connector.js.map +0 -1
  528. package/lib/redux/_modularui/middleware.js.map +0 -1
  529. package/lib/redux/_modularui/reducer.js.map +0 -1
  530. package/lib/redux/_modularui/selectors.js.map +0 -1
  531. package/lib/redux/_router/actions.js.map +0 -1
  532. package/lib/redux/_router/connectors.js.map +0 -1
  533. package/lib/redux/_router/middleware.js.map +0 -1
  534. package/lib/redux/_router/reducer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useModelCatalog.js","names":["useModelCatalog","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","useConceptIndex","href","ConceptIndexModel","getHref","context","dynamic","location","replace","search","useConceptDetail","concept","useLocation","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel =>\n useModularUIBasic(\"conceptindex\", href, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n\nconst getHref = (context, dynamic, location) => {\n let href = dynamic;\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search) {\n href = `${href}${location.search}`;\n }\n\n return href;\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = getHref(\"concepts\", concept, location);\n return useModularUIBasic(\"conceptdetail\", href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (href: string): ?ContentIndexModel =>\n useModularUIBasic(\"contentindex\", href, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n\n/**\n */\nexport const useContentTOC = (content: string): ?ContentTOCModel => {\n const location = useLocation();\n const href = getHref(\"content\", content, location);\n return useModularUIBasic(\"contenttoc\", href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (contentSection: string): ?ContentModel => {\n const href = getHref(\"content\", contentSection);\n return useModularUIBasic(\"content\", href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (contentType: string): ?ContentTypeModel => {\n const href = getHref(\"contenttypes\", contentType);\n return useModularUIBasic(\"contenttypes\", href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACO,MAAMA,eAAe,GAAG,MAC7B,IAAAC,oCAAiB,EAAC,cAAc,EAAE,eAAe,EAAE;EACjDC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEC;AACf,CAAC,CAAC;;AAEJ;AACA;AADA;AAEO,MAAMC,eAAe,GAAIC,IAAY,IAC1C,IAAAL,oCAAiB,EAAC,cAAc,EAAEK,IAAI,EAAE;EACtCJ,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEI;AACf,CAAC,CAAC;AAAC;AAEL,MAAMC,OAAO,GAAG,CAACC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,KAAK;EAC9C,IAAIL,IAAI,GAAGI,OAAO;EAClB,IAAI,CAAC,yBAAAJ,IAAI,OAAJA,IAAI,EAAa,IAAGG,OAAQ,GAAE,CAAC,EAAE;IACpCH,IAAI,GAAI,IAAGG,OAAQ,IAAGH,IAAK,EAAC;EAC9B;EAEAA,IAAI,GAAGA,IAAI,CAACM,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;EAEjC,IAAID,QAAQ,EAAEE,MAAM,EAAE;IACpBP,IAAI,GAAI,GAAEA,IAAK,GAAEK,QAAQ,CAACE,MAAO,EAAC;EACpC;EAEA,OAAOP,IAAI;AACb,CAAC;;AAED;AACA;AACO,MAAMQ,gBAAgB,GAC3BC,OAAe,IACkC;EACjD,MAAMJ,QAAQ,GAAG,IAAAK,sBAAW,GAAE;EAE9B,MAAMV,IAAI,GAAG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,CAAC;AACJ,CAAC;AAAC"}
1
+ {"version":3,"file":"useModelCatalog.js","names":["useModelCatalog","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","useConceptIndex","href","ConceptIndexModel","getHref","context","dynamic","location","replace","search","useConceptDetail","concept","useLocation","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel =>\n useModularUIBasic(\"conceptindex\", href, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n\nconst getHref = (context: string, dynamic: string, location?: Location) => {\n let href = dynamic;\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search) {\n href = `${href}${location.search}`;\n }\n\n return href;\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = getHref(\"concepts\", concept, location);\n return useModularUIBasic(\"conceptdetail\", href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (href: string): ?ContentIndexModel =>\n useModularUIBasic(\"contentindex\", href, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n\n/**\n */\nexport const useContentTOC = (content: string): ?ContentTOCModel => {\n const location = useLocation();\n const href = getHref(\"content\", content, location);\n return useModularUIBasic(\"contenttoc\", href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (contentSection: string): ?ContentModel => {\n const href = getHref(\"content\", contentSection);\n return useModularUIBasic(\"content\", href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (contentType: string): ?ContentTypeModel => {\n const href = getHref(\"contenttypes\", contentType);\n return useModularUIBasic(\"contenttypes\", href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACO,MAAMA,eAAe,GAAG,MAC7B,IAAAC,oCAAiB,EAAC,cAAc,EAAE,eAAe,EAAE;EACjDC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEC;AACf,CAAC,CAAC;;AAEJ;AACA;AADA;AAEO,MAAMC,eAAe,GAAIC,IAAY,IAC1C,IAAAL,oCAAiB,EAAC,cAAc,EAAEK,IAAI,EAAE;EACtCJ,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEI;AACf,CAAC,CAAC;AAAC;AAEL,MAAMC,OAAO,GAAG,CAACC,OAAe,EAAEC,OAAe,EAAEC,QAAmB,KAAK;EACzE,IAAIL,IAAI,GAAGI,OAAO;EAClB,IAAI,CAAC,yBAAAJ,IAAI,OAAJA,IAAI,EAAa,IAAGG,OAAQ,GAAE,CAAC,EAA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AAO,IAAAtB,oCAAiB,EAAC,SAAS,EAAEK,IAAI,EAAE;IACxCJ,cAAc,EAAE,CAAC,SAAS,CAAC;IAC3BC,WAAW,EAAEqB;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AADA;AAEO,MAAMC,cAAc,GAAIC,WAAmB,IAAwB;EACxE,MAAMpB,IAAI,GAAGE,OAAO,CAAC,cAAc,EAAEkB,WAAW,CAAC;EACjD,OAAO,IAAAzB,oCAAiB,EAAC,cAAc,EAAEK,IAAI,EAAE;IAC7CJ,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/BC,WAAW,EAAEwB;EACf,CAAC,CAAC;AACJ,CAAC;AAAC"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useModels = void 0;
7
7
  var _reactRedux = require("react-redux");
8
- var _actions = require("../redux/_modularui/actions");
8
+ var _ModularUIActions = require("../redux/_modularui/ModularUIActions");
9
9
  /**
10
10
  * Hook that contains the reload property that can be used to reload a model
11
11
  */
@@ -13,7 +13,7 @@ const useModels = () => {
13
13
  const dispatch = (0, _reactRedux.useDispatch)();
14
14
  return {
15
15
  reload: (model, options) => {
16
- dispatch((0, _actions.reloadModel)(model, options));
16
+ dispatch((0, _ModularUIActions.reloadModel)(model, options));
17
17
  }
18
18
  };
19
19
  };
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import { useDispatch } from "react-redux";
3
3
 
4
- import { reloadModel } from "../redux/_modularui/actions";
4
+ import { reloadModel } from "../redux/_modularui/ModularUIActions";
5
5
 
6
6
  import type { ModularUIModel } from "../models/types";
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"useModels.js","names":["useModels","dispatch","useDispatch","reload","model","options","reloadModel"],"sources":["../../src/hooks/useModels.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport { reloadModel } from \"../redux/_modularui/actions\";\n\nimport type { ModularUIModel } from \"../models/types\";\n\ntype UseModels = () => {\n reload: (model: ModularUIModel, options?: any) => void,\n};\n\n/**\n * Hook that contains the reload property that can be used to reload a model\n */\nexport const useModels: UseModels = () => {\n const dispatch = useDispatch();\n return {\n reload: (model: ModularUIModel, options?: Object) => {\n dispatch(reloadModel(model, options));\n },\n };\n};\n"],"mappings":";;;;;;AACA;AAEA;AAQA;AACA;AACA;AACO,MAAMA,SAAoB,GAAG,MAAM;EACxC,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAC9B,OAAO;IACLC,MAAM,EAAE,CAACC,KAAqB,EAAEC,OAAgB,KAAK;MACnDJ,QAAQ,CAAC,IAAAK,oBAAW,EAACF,KAAK,EAAEC,OAAO,CAAC,CAAC;IACvC;EACF,CAAC;AACH,CAAC;AAAC"}
1
+ {"version":3,"file":"useModels.js","names":["useModels","dispatch","useDispatch","reload","model","options","reloadModel"],"sources":["../../src/hooks/useModels.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport { reloadModel } from \"../redux/_modularui/ModularUIActions\";\n\nimport type { ModularUIModel } from \"../models/types\";\n\ntype UseModels = () => {\n reload: (model: ModularUIModel, options?: any) => void,\n};\n\n/**\n * Hook that contains the reload property that can be used to reload a model\n */\nexport const useModels: UseModels = () => {\n const dispatch = useDispatch();\n return {\n reload: (model: ModularUIModel, options?: Object) => {\n dispatch(reloadModel(model, options));\n },\n };\n};\n"],"mappings":";;;;;;AACA;AAEA;AAQA;AACA;AACA;AACO,MAAMA,SAAoB,GAAG,MAAM;EACxC,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAC9B,OAAO;IACLC,MAAM,EAAE,CAACC,KAAqB,EAAEC,OAAgB,KAAK;MACnDJ,QAAQ,CAAC,IAAAK,6BAAW,EAACF,KAAK,EAAEC,OAAO,CAAC,CAAC;IACvC;EACF,CAAC;AACH,CAAC;AAAC"}
@@ -8,7 +8,7 @@ exports.useModularUI = void 0;
8
8
  var _react = require("react");
9
9
  var _reactRedux = require("react-redux");
10
10
  var _constants = require("../constants");
11
- var _actions = require("../redux/_modularui/actions");
11
+ var _ModularUIActions = require("../redux/_modularui/ModularUIActions");
12
12
  var _useDeepCompareEffect = _interopRequireDefault(require("./useDeepCompareEffect"));
13
13
  var _useI18n = require("./useI18n");
14
14
  /**
@@ -37,7 +37,7 @@ const useModularUI = function (modelKey, url) {
37
37
  // prevent reloads when previous option had the isReload, but the new options not
38
38
  const isOldReload = prevHref.current === href && prevOptions.current.isReload && !options.isReload;
39
39
  if (!isOldReload) {
40
- dispatch((0, _actions.loadModularUI)(key, href, options));
40
+ dispatch((0, _ModularUIActions.loadModularUI)(key, href, options));
41
41
  }
42
42
  prevOptions.current = options;
43
43
  prevHref.current = href;
@@ -48,7 +48,7 @@ const useModularUI = function (modelKey, url) {
48
48
  (0, _react.useEffect)(() => {
49
49
  return () => {
50
50
  if (removeOnUnmount) {
51
- dispatch((0, _actions.removeModelByKey)(key));
51
+ dispatch((0, _ModularUIActions.removeModelByKey)(key));
52
52
  }
53
53
  };
54
54
  }, [dispatch, key, removeOnUnmount]);
@@ -3,7 +3,10 @@ import { useEffect, useRef } from "react";
3
3
  import { useDispatch, useSelector } from "react-redux";
4
4
 
5
5
  import { HTTP_METHODS } from "../constants";
6
- import { loadModularUI, removeModelByKey } from "../redux/_modularui/actions";
6
+ import {
7
+ loadModularUI,
8
+ removeModelByKey,
9
+ } from "../redux/_modularui/ModularUIActions";
7
10
 
8
11
  import useDeepCompareEffect from "./useDeepCompareEffect";
9
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUI.js","names":["useKeyForHook","modelKey","url","locale","useLocale","split","useModularUI","options","method","HTTP_METHODS","GET","removeOnUnmount","dispatch","useDispatch","href","toString","key","prevOptions","useRef","prevHref","useDeepCompareEffect","isOldReload","current","isReload","loadModularUI","useEffect","removeModelByKey","useSelector","state","modularui"],"sources":["../../src/hooks/useModularUI.js"],"sourcesContent":["// @flow\nimport { useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { HTTP_METHODS } from \"../constants\";\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui/actions\";\n\nimport useDeepCompareEffect from \"./useDeepCompareEffect\";\n\nimport { useLocale } from \"./useI18n\";\n\nimport type Href from \"../models/href/Href\";\nimport type { RequestBaseOptions } from \"../utils\";\n\n/**\n */\nconst useKeyForHook = (modelKey: string, url: string) => {\n const locale = useLocale();\n return `${modelKey}(${url.split(\"?\")[0]})(${locale})`;\n};\n\n/**\n * Use redux action and selector to retrieve the correct modular ui service model\n */\nexport const useModularUI = (\n modelKey: string,\n url: string | Href,\n options: RequestBaseOptions = {\n method: HTTP_METHODS.GET,\n removeOnUnmount: false,\n }\n): any => {\n const dispatch = useDispatch();\n const href = url.toString();\n const key = useKeyForHook(modelKey, href);\n\n const prevOptions = useRef(options);\n const prevHref = useRef(href);\n\n // dispatch loadModularUI\n useDeepCompareEffect(() => {\n // prevent reloads when previous option had the isReload, but the new options not\n const isOldReload =\n prevHref.current === href &&\n prevOptions.current.isReload &&\n !options.isReload;\n\n if (!isOldReload) {\n dispatch(loadModularUI(key, href, options));\n }\n\n prevOptions.current = options;\n prevHref.current = href;\n }, [key, href, options]);\n\n const { removeOnUnmount = false } = options;\n useEffect(() => {\n return () => {\n if (removeOnUnmount) {\n dispatch(removeModelByKey(key));\n }\n };\n }, [dispatch, key, removeOnUnmount]);\n\n // retrieve current model from modularui reducer\n return useSelector((state) => {\n return state.modularui[key];\n });\n};\n"],"mappings":";;;;;;;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAKA;AACA;AACA,MAAMA,aAAa,GAAG,CAACC,QAAgB,EAAEC,GAAW,KAAK;EACvD,MAAMC,MAAM,GAAG,IAAAC,kBAAS,GAAE;EAC1B,OAAQ,GAAEH,QAAS,IAAGC,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,KAAIF,MAAO,GAAE;AACvD,CAAC;;AAED;AACA;AACA;AACO,MAAMG,YAAY,GAAG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AS,CAACb,GAAG,CAAC;EAC7B,CAAC,CAAC;AACJ,CAAC;AAAC"}
1
+ {"version":3,"file":"useModularUI.js","names":["useKeyForHook","modelKey","url","locale","useLocale","split","useModularUI","options","method","HTTP_METHODS","GET","removeOnUnmount","dispatch","useDispatch","href","toString","key","prevOptions","useRef","prevHref","useDeepCompareEffect","isOldReload","current","isReload","loadModularUI","useEffect","removeModelByKey","useSelector","state","modularui"],"sources":["../../src/hooks/useModularUI.js"],"sourcesContent":["// @flow\nimport { useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { HTTP_METHODS } from \"../constants\";\nimport {\n loadModularUI,\n removeModelByKey,\n} from \"../redux/_modularui/ModularUIActions\";\n\nimport useDeepCompareEffect from \"./useDeepCompareEffect\";\n\nimport { useLocale } from \"./useI18n\";\n\nimport type Href from \"../models/href/Href\";\nimport type { RequestBaseOptions } from \"../utils\";\n\n/**\n */\nconst useKeyForHook = (modelKey: string, url: string) => {\n const locale = useLocale();\n return `${modelKey}(${url.split(\"?\")[0]})(${locale})`;\n};\n\n/**\n * Use redux action and selector to retrieve the correct modular ui service model\n */\nexport const useModularUI = (\n modelKey: string,\n url: string | Href,\n options: RequestBaseOptions = {\n method: HTTP_METHODS.GET,\n removeOnUnmount: false,\n }\n): any => {\n const dispatch = useDispatch();\n const href = url.toString();\n const key = useKeyForHook(modelKey, href);\n\n const prevOptions = useRef(options);\n const prevHref = useRef(href);\n\n // dispatch loadModularUI\n useDeepCompareEffect(() => {\n // prevent reloads when previous option had the isReload, but the new options not\n const isOldReload =\n prevHref.current === href &&\n prevOptions.current.isReload &&\n !options.isReload;\n\n if (!isOldReload) {\n dispatch(loadModularUI(key, href, options));\n }\n\n prevOptions.current = options;\n prevHref.current = href;\n }, [key, href, options]);\n\n const { removeOnUnmount = false } = options;\n useEffect(() => {\n return () => {\n if (removeOnUnmount) {\n dispatch(removeModelByKey(key));\n }\n };\n }, [dispatch, key, removeOnUnmount]);\n\n // retrieve current model from modularui reducer\n return useSelector((state) => {\n return state.modularui[key];\n });\n};\n"],"mappings":";;;;;;;AACA;AACA;AAEA;AACA;AAKA;AAEA;AAKA;AACA;AACA,MAAMA,aAAa,GAAG,CAACC,QAAgB,EAAEC,GAAW,KAAK;EACvD,MAAMC,MAAM,GAAG,IAAAC,kBAAS,GAAE;EAC1B,OAAQ,GAAEH,QAAS,IAAGC,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,KAAIF,MAAO,GAAE;AACvD,CAAC;;AAED;AACA;AACA;AACO,MAAMG,YAAY,GAAG,UAC1BL,QAAgB,EAChBC,GAAkB,EAKV;EAAA,IAJRK,OAA2B,uEAAG;IAC5BC,MAAM,EAAEC,uBAAY,CAACC,GAAG;IACxBC,eAAe,EAAE;EACnB,CAAC;EAED,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAC9B,MAAMC,IAAI,GAAGZ,GAAG,CAACa,QAAQ,EAAE;EAC3B,MAAMC,GAAG,GAAGhB,aAAa,CAACC,QAAQ,EAAEa,IAAI,CAAC;EAEzC,MAAMG,WAAW,GAAG,IAAAC,aAAM,EAACX,OAAO,CAAC;EACnC,MAAMY,QAAQ,GAAG,IAAAD,aAAM,EAACJ,IAAI,CAAC;;EAE7B;EACA,IAAAM,6BAAoB,EAAC,MAAM;IACzB;IACA,MAAMC,WAAW,GACfF,QAAQ,CAACG,OAAO,KAAKR,IAAI,IACzBG,WAAW,CAACK,OAAO,CAACC,QAAQ,IAC5B,CAAChB,OAAO,CAACgB,QAAQ;IAEnB,IAAI,CAACF,WAAW,EAAE;MAChBT,QAAQ,CAAC,IAAAY,+BAAa,EAACR,GAAG,EAAEF,IAAI,EAAEP,OAAO,CAAC,CAAC;IAC7C;IAEAU,WAAW,CAACK,OAAO,GAAGf,OAAO;IAC7BY,QAAQ,CAACG,OAAO,GAAGR,IAAI;EACzB,CAAC,EAAE,CAACE,GAAG,EAAEF,IAAI,EAAEP,OAAO,CAAC,CAAC;EAExB,MAAM;IAAEI,eAAe,GAAG;EAAM,CAAC,GAAGJ,OAAO;EAC3C,IAAAkB,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MACX,IAAId,eAAe,EAAE;QACnBC,QAAQ,CAAC,IAAAc,kCAAgB,EAACV,GAAG,CAAC,CAAC;MACjC;IACF,CAAC;EACH,CAAC,EAAE,CAACJ,QAAQ,EAAEI,GAAG,EAAEL,eAAe,CAAC,CAAC;;EAEpC;EACA,OAAO,IAAAgB,uBAAW,EAAEC,KAAK,IAAK;IAC5B,OAAOA,KAAK,CAACC,SAAS,CAACb,GAAG,CAAC;EAC7B,CAAC,CAAC;AACJ,CAAC;AAAC"}
@@ -21,7 +21,10 @@ const useModularUIBasic = function (key, href) {
21
21
  if (!href) {
22
22
  throw new _exceptions.IllegalArgumentException("Missing href");
23
23
  }
24
- const useModularUIOptions = {};
24
+ const useModularUIOptions = {
25
+ targetModel: undefined,
26
+ isReload: false
27
+ };
25
28
  if (options.targetModel) {
26
29
  useModularUIOptions.targetModel = options.targetModel;
27
30
  }
@@ -27,7 +27,7 @@ export const useModularUIBasic = <T: ModularUIModel>(
27
27
  throw new IllegalArgumentException("Missing href");
28
28
  }
29
29
 
30
- const useModularUIOptions = {};
30
+ const useModularUIOptions = { targetModel: undefined, isReload: false };
31
31
  if (options.targetModel) {
32
32
  useModularUIOptions.targetModel = options.targetModel;
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUIBasic.js","names":["useModularUIBasic","key","href","options","expectedModels","targetModel","undefined","location","useLocation","IllegalArgumentException","useModularUIOptions","state","reload","pathname","toString","isReload","modularUI","useModularUI","model","length","isCorrectModel","some","expectedModel","type","console","error","IllegalStateException"],"sources":["../../src/hooks/useModularUIBasic.js"],"sourcesContent":["// @flow\nimport { useModularUI } from \"./useModularUI\";\n\nimport { useLocation } from \"./useRouter\";\n\nimport { IllegalArgumentException, IllegalStateException } from \"../exceptions\";\n\nimport type { ModularUIModel, Href } from \"../models\";\n\ntype UseModularUIBasicOptions<T> = {\n expectedModels: Array<string>,\n targetModel?: Class<T>,\n};\n\n/**\n */\nexport const useModularUIBasic = <T: ModularUIModel>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n }\n): ?T => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = {};\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n }\n\n // reload when the modular service starts with the current location\n if (location.state?.reload && location.pathname.startsWith(href.toString())) {\n useModularUIOptions.isReload = true;\n }\n\n const modularUI = useModularUI(key, href, useModularUIOptions);\n\n if (modularUI?.model) {\n const { model } = modularUI;\n if (options.expectedModels.length > 0) {\n const isCorrectModel = options.expectedModels.some((expectedModel) => {\n return model.type === expectedModel;\n });\n\n if (!isCorrectModel) {\n console.error(modularUI, \"is not of instance\", options.expectedModels);\n throw new IllegalStateException(\"Resolved model has incorrect type\");\n }\n }\n\n return model;\n }\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AAEA;AASA;AACA;AACO,MAAMA,iBAAiB,GAAG,UAC/BC,GAAW,EACXC,IAAmB,EAKZ;EAAA;EAAA,IAJPC,OAAoC,uEAAG;IACrCC,cAAc,EAAE,EAAE;IAClBC,WAAW,EAAEC;EACf,CAAC;EAED,MAAMC,QAAQ,GAAG,IAAAC,sBAAW,GAAE;EAC9B,IAAI,CAACN,IAAI,EAAE;IACT,MAAM,IAAIO,oCAAwB,CAAC,cAAc,CAAC;EACpD;EAEA,MAAMC,mBAAmB,GAAG,CAAC,CAAC;EAC9B,IAAIP,OAAO,CAACE,WAAW,EAAE;IACvBK,mBAAmB,CAACL,WAAW,GAAGF,OAAO,CAACE,WAAW;EACvD;;EAEA;EACA,IAAIE,QAAQ,CAACI,KAAK,EAAEC,MAAM,IAAI,oCAAAL,QAAQ,CAACM,QAAQ,iBAAYX,IAAI,CAACY,QAAQ,EAAE,CAAC,EAAE;IAC3EJ,mBAAmB,CAACK,QAAQ,GAAG,IAAI;EACrC;EAEA,MAAMC,SAAS,GAAG,IAAAC,0BAAY,EAAChB,GAAG,EAAEC,IAAI,EAAEQ,mBAAmB,CAAC;EAE9D,IAAIM,SAAS,EAAEE,KAAK,EAAE;IACpB,MAAM;MAAEA;IAAM,CAAC,GAAGF,SAAS;IAC3B,IAAIb,OAAO,CAACC,cAAc,CAACe,MAAM,GAAG,CAAC,EAAE;MACrC,MAAMC,cAAc,GAAGjB,OAAO,CAACC,cAAc,CAACiB,IAAI,CAAEC,aAAa,IAAK;QACpE,OAAOJ,KAAK,CAACK,IAAI,KAAKD,aAAa;MACrC,CAAC,CAAC;MAEF,IAAI,CAACF,cAAc,EAAE;QACnBI,OAAO,CAACC,KAAK,CAACT,SAAS,EAAE,oBAAoB,EAAEb,OAAO,CAACC,cAAc,CAAC;QACtE,MAAM,IAAIsB,iCAAqB,CAAC,mCAAmC,CAAC;MACtE;IACF;IAEA,OAAOR,KAAK;EACd;AACF,CAAC;AAAC"}
1
+ {"version":3,"file":"useModularUIBasic.js","names":["useModularUIBasic","key","href","options","expectedModels","targetModel","undefined","location","useLocation","IllegalArgumentException","useModularUIOptions","isReload","state","reload","pathname","toString","modularUI","useModularUI","model","length","isCorrectModel","some","expectedModel","type","console","error","IllegalStateException"],"sources":["../../src/hooks/useModularUIBasic.js"],"sourcesContent":["// @flow\nimport { useModularUI } from \"./useModularUI\";\n\nimport { useLocation } from \"./useRouter\";\n\nimport { IllegalArgumentException, IllegalStateException } from \"../exceptions\";\n\nimport type { ModularUIModel, Href } from \"../models\";\n\ntype UseModularUIBasicOptions<T> = {\n expectedModels: Array<string>,\n targetModel?: Class<T>,\n};\n\n/**\n */\nexport const useModularUIBasic = <T: ModularUIModel>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n }\n): ?T => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = { targetModel: undefined, isReload: false };\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n }\n\n // reload when the modular service starts with the current location\n if (location.state?.reload && location.pathname.startsWith(href.toString())) {\n useModularUIOptions.isReload = true;\n }\n\n const modularUI = useModularUI(key, href, useModularUIOptions);\n\n if (modularUI?.model) {\n const { model } = modularUI;\n if (options.expectedModels.length > 0) {\n const isCorrectModel = options.expectedModels.some((expectedModel) => {\n return model.type === expectedModel;\n });\n\n if (!isCorrectModel) {\n console.error(modularUI, \"is not of instance\", options.expectedModels);\n throw new IllegalStateException(\"Resolved model has incorrect type\");\n }\n }\n\n return model;\n }\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AAEA;AASA;AACA;AACO,MAAMA,iBAAiB,GAAG,UAC/BC,GAAW,EACXC,IAAmB,EAKZ;EAAA;EAAA,IAJPC,OAAoC,uEAAG;IACrCC,cAAc,EAAE,EAAE;IAClBC,WAAW,EAAEC;EACf,CAAC;EAED,MAAMC,QAAQ,GAAG,IAAAC,sBAAW,GAAE;EAC9B,IAAI,CAACN,IAAI,EAAE;IACT,MAAM,IAAIO,oCAAwB,CAAC,cAAc,CAAC;EACpD;EAEA,MAAMC,mBAAmB,GAAG;IAAEL,WAAW,EAAEC,SAAS;IAAEK,QAAQ,EAAE;EAAM,CAAC;EACvE,IAAIR,OAAO,CAACE,WAAW,EAAE;IACvBK,mBAAmB,CAACL,WAAW,GAAGF,OAAO,CAACE,WAAW;EACvD;;EAEA;EACA,IAAIE,QAAQ,CAACK,KAAK,EAAEC,MAAM,IAAI,oCAAAN,QAAQ,CAACO,QAAQ,iBAAYZ,IAAI,CAACa,QAAQ,EAAE,CAAC,EAAE;IAC3EL,mBAAmB,CAACC,QAAQ,GAAG,IAAI;EACrC;EAEA,MAAMK,SAAS,GAAG,IAAAC,0BAAY,EAAChB,GAAG,EAAEC,IAAI,EAAEQ,mBAAmB,CAAC;EAE9D,IAAIM,SAAS,EAAEE,KAAK,EAAE;IACpB,MAAM;MAAEA;IAAM,CAAC,GAAGF,SAAS;IAC3B,IAAIb,OAAO,CAACC,cAAc,CAACe,MAAM,GAAG,CAAC,EAAE;MACrC,MAAMC,cAAc,GAAGjB,OAAO,CAACC,cAAc,CAACiB,IAAI,CAAEC,aAAa,IAAK;QACpE,OAAOJ,KAAK,CAACK,IAAI,KAAKD,aAAa;MACrC,CAAC,CAAC;MAEF,IAAI,CAACF,cAAc,EAAE;QACnBI,OAAO,CAACC,KAAK,CAACT,SAAS,EAAE,oBAAoB,EAAEb,OAAO,CAACC,cAAc,CAAC;QACtE,MAAM,IAAIsB,iCAAqB,CAAC,mCAAmC,CAAC;MACtE;IACF;IAEA,OAAOR,KAAK;EACd;AACF,CAAC;AAAC"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useQuerystring = exports.usePathname = exports.useNavigation = exports.useLocationKey = exports.useLocation = void 0;
7
7
  var _reactRedux = require("react-redux");
8
- var _actions = require("../redux/_router/actions");
8
+ var _RouterActions = require("../redux/_router/RouterActions");
9
9
  /**
10
10
  */
11
11
  const useLocation = () => (0, _reactRedux.useSelector)(state => state.router.location);
@@ -31,11 +31,11 @@ exports.usePathname = usePathname;
31
31
  const useNavigation = () => {
32
32
  const dispatch = (0, _reactRedux.useDispatch)();
33
33
  return {
34
- push: (location, state) => dispatch((0, _actions.push)(location, state)),
35
- replace: (location, state) => dispatch((0, _actions.replace)(location, state)),
36
- go: delta => dispatch((0, _actions.go)(delta)),
37
- goBack: () => dispatch((0, _actions.goBack)()),
38
- goForward: () => dispatch((0, _actions.goForward)())
34
+ push: (location, state) => dispatch((0, _RouterActions.push)(location, state)),
35
+ replace: (location, state) => dispatch((0, _RouterActions.replace)(location, state)),
36
+ go: delta => dispatch((0, _RouterActions.go)(delta)),
37
+ goBack: () => dispatch((0, _RouterActions.goBack)()),
38
+ goForward: () => dispatch((0, _RouterActions.goForward)())
39
39
  };
40
40
  };
41
41
  exports.useNavigation = useNavigation;
@@ -2,7 +2,13 @@
2
2
  import { useDispatch, useSelector } from "react-redux";
3
3
  import type { Location, LocationShape } from "react-router";
4
4
 
5
- import { push, replace, go, goBack, goForward } from "../redux/_router/actions";
5
+ import {
6
+ push,
7
+ replace,
8
+ go,
9
+ goBack,
10
+ goForward,
11
+ } from "../redux/_router/RouterActions";
6
12
  import type {
7
13
  GoAction,
8
14
  GoBackAction,
@@ -1 +1 @@
1
- {"version":3,"file":"useRouter.js","names":["useLocation","useSelector","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","useDispatch","push","replace","go","delta","goBack","goForward"],"sources":["../../src/hooks/useRouter.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport type { Location, LocationShape } from \"react-router\";\n\nimport { push, replace, go, goBack, goForward } from \"../redux/_router/actions\";\nimport type {\n GoAction,\n GoBackAction,\n GoForwardAction,\n PushAction,\n ReplaceAction,\n} from \"../redux\";\n\ntype UseLocationHook = () => Location;\ntype UseLocationKeyHook = () => string;\ntype UseQuerystringHook = () => string;\ntype UsePathnameHook = () => string;\ntype UseNavigationHook = () => {\n push: (location: LocationShape | string, state?: { ... }) => PushAction,\n replace: (location: LocationShape | string, state?: { ... }) => ReplaceAction,\n go: (delta: number) => GoAction,\n goBack: () => GoBackAction,\n goForward: () => GoForwardAction,\n};\n\n/**\n */\nexport const useLocation: UseLocationHook = () =>\n useSelector((state) => state.router.location);\n\n/**\n */\nexport const useLocationKey: UseLocationKeyHook = () =>\n useLocation()?.key ?? \"\";\n\n/**\n */\nexport const useQuerystring: UseQuerystringHook = () => useLocation()?.search;\n\n/**\n */\nexport const usePathname: UsePathnameHook = () => useLocation()?.pathname;\n\n/**\n */\nexport const useNavigation: UseNavigationHook = () => {\n const dispatch = useDispatch();\n\n return {\n push: (location: LocationShape | string, state?: { ... }) =>\n dispatch(push(location, state)),\n replace: (location: LocationShape | string, state?: { ... }) =>\n dispatch(replace(location, state)),\n go: (delta: number) => dispatch(go(delta)),\n goBack: () => dispatch(goBack()),\n goForward: () => dispatch(goForward()),\n };\n};\n"],"mappings":";;;;;;AACA;AAGA;AAqBA;AACA;AACO,MAAMA,WAA4B,GAAG,MAC1C,IAAAC,uBAAW,EAAEC,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC;;AAE/C;AACA;AADA;AAEO,MAAMC,cAAkC,GAAG,MAChDL,WAAW,EAAE,EAAEM,GAAG,IAAI,EAAE;;AAE1B;AACA;AADA;AAEO,MAAMC,cAAkC,GAAG,MAAMP,WAAW,EAAE,EAAEQ,MAAM;;AAE7E;AACA;AADA;AAEO,MAAMC,WAA4B,GAAG,MAAMT,WAAW,EAAE,EAAEU,QAAQ;;AAEzE;AACA;AADA;AAEO,MAAMC,aAAgC,GAAG,MAAM;EACpD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAE9B,OAAO;IACLC,IAAI,EAAE,CAACV,QAAgC,EAAEF,KAAe,KACtDU,QAAQ,CAAC,IAAAE,aAAI,EAACV,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACjCa,OAAO,EAAE,CAACX,QAAgC,EAAEF,KAAe,KACzDU,QAAQ,CAAC,IAAAG,gBAAO,EAACX,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACpCc,EAAE,EAAGC,KAAa,IAAKL,QAAQ,CAAC,IAAAI,WAAE,EAACC,KAAK,CAAC,CAAC;IAC1CC,MAAM,EAAE,MAAMN,QAAQ,CAAC,IAAAM,eAAM,GAAE,CAAC;IAChCC,SAAS,EAAE,MAAMP,QAAQ,CAAC,IAAAO,kBAAS,GAAE;EACvC,CAAC;AACH,CAAC;AAAC"}
1
+ {"version":3,"file":"useRouter.js","names":["useLocation","useSelector","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","useDispatch","push","replace","go","delta","goBack","goForward"],"sources":["../../src/hooks/useRouter.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport type { Location, LocationShape } from \"react-router\";\n\nimport {\n push,\n replace,\n go,\n goBack,\n goForward,\n} from \"../redux/_router/RouterActions\";\nimport type {\n GoAction,\n GoBackAction,\n GoForwardAction,\n PushAction,\n ReplaceAction,\n} from \"../redux\";\n\ntype UseLocationHook = () => Location;\ntype UseLocationKeyHook = () => string;\ntype UseQuerystringHook = () => string;\ntype UsePathnameHook = () => string;\ntype UseNavigationHook = () => {\n push: (location: LocationShape | string, state?: { ... }) => PushAction,\n replace: (location: LocationShape | string, state?: { ... }) => ReplaceAction,\n go: (delta: number) => GoAction,\n goBack: () => GoBackAction,\n goForward: () => GoForwardAction,\n};\n\n/**\n */\nexport const useLocation: UseLocationHook = () =>\n useSelector((state) => state.router.location);\n\n/**\n */\nexport const useLocationKey: UseLocationKeyHook = () =>\n useLocation()?.key ?? \"\";\n\n/**\n */\nexport const useQuerystring: UseQuerystringHook = () => useLocation()?.search;\n\n/**\n */\nexport const usePathname: UsePathnameHook = () => useLocation()?.pathname;\n\n/**\n */\nexport const useNavigation: UseNavigationHook = () => {\n const dispatch = useDispatch();\n\n return {\n push: (location: LocationShape | string, state?: { ... }) =>\n dispatch(push(location, state)),\n replace: (location: LocationShape | string, state?: { ... }) =>\n dispatch(replace(location, state)),\n go: (delta: number) => dispatch(go(delta)),\n goBack: () => dispatch(goBack()),\n goForward: () => dispatch(goForward()),\n };\n};\n"],"mappings":";;;;;;AACA;AAGA;AA2BA;AACA;AACO,MAAMA,WAA4B,GAAG,MAC1C,IAAAC,uBAAW,EAAEC,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC;;AAE/C;AACA;AADA;AAEO,MAAMC,cAAkC,GAAG,MAChDL,WAAW,EAAE,EAAEM,GAAG,IAAI,EAAE;;AAE1B;AACA;AADA;AAEO,MAAMC,cAAkC,GAAG,MAAMP,WAAW,EAAE,EAAEQ,MAAM;;AAE7E;AACA;AADA;AAEO,MAAMC,WAA4B,GAAG,MAAMT,WAAW,EAAE,EAAEU,QAAQ;;AAEzE;AACA;AADA;AAEO,MAAMC,aAAgC,GAAG,MAAM;EACpD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAE9B,OAAO;IACLC,IAAI,EAAE,CAACV,QAAgC,EAAEF,KAAe,KACtDU,QAAQ,CAAC,IAAAE,mBAAI,EAACV,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACjCa,OAAO,EAAE,CAACX,QAAgC,EAAEF,KAAe,KACzDU,QAAQ,CAAC,IAAAG,sBAAO,EAACX,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACpCc,EAAE,EAAGC,KAAa,IAAKL,QAAQ,CAAC,IAAAI,iBAAE,EAACC,KAAK,CAAC,CAAC;IAC1CC,MAAM,EAAE,MAAMN,QAAQ,CAAC,IAAAM,qBAAM,GAAE,CAAC;IAChCC,SAAS,EAAE,MAAMP,QAAQ,CAAC,IAAAO,wBAAS,GAAE;EACvC,CAAC;AACH,CAAC;AAAC"}
@@ -63,7 +63,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
63
63
 
64
64
  /**
65
65
  */
66
- processLayoutHintRules() {
66
+ processLayoutHintRules(): void {
67
67
  this.all.forEach((attribute) => {
68
68
  attribute.processLayoutHintRules(this);
69
69
  });
@@ -157,14 +157,14 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
157
157
  /**
158
158
  * Replace an attribute instance in the collection with a new attribute instance
159
159
  */
160
- replace(oldAttribute: AttributeType, newAttribute: AttributeType) {
160
+ replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {
161
161
  this.replaceByKey(oldAttribute.key, newAttribute);
162
162
  }
163
163
 
164
164
  /**
165
165
  * Replace an attribute by the key of the attribute
166
166
  */
167
- replaceByKey(key: string, newAttribute: AttributeType) {
167
+ replaceByKey(key: string, newAttribute: AttributeType): void {
168
168
  this.forEach((attribute, index) => {
169
169
  if (attribute.key === key) {
170
170
  this.collection[index] = newAttribute;
@@ -176,7 +176,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
176
176
  * Set reference date by replacing an old attribute with a new attribute with a reference Date
177
177
  * Date is a string in ISO format yyyy-MM-dd
178
178
  */
179
- setReferenceDate(date: string) {
179
+ setReferenceDate(date: string): void {
180
180
  this.forEach((attribute) => {
181
181
  const newAttribute = attribute.clone();
182
182
 
@@ -194,7 +194,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
194
194
 
195
195
  /**
196
196
  */
197
- addServerError(error: FormErrorAnchor) {
197
+ addServerError(error: FormErrorAnchor): void {
198
198
  const elementid = error?.anchor?.elementid;
199
199
 
200
200
  if (elementid) {
@@ -244,7 +244,9 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
244
244
 
245
245
  /**
246
246
  */
247
- indicateContentConfiguration(contentConfiguration: ContentConfiguration) {
247
+ indicateContentConfiguration(
248
+ contentConfiguration: ContentConfiguration
249
+ ): void {
248
250
  if (contentConfiguration) {
249
251
  this.all.forEach((attribute) => {
250
252
  attribute.indicateContentConfiguration(contentConfiguration);
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeCollection.js","names":["AttributeCollection","ResourceCollection","constructor","data","contributions","isReadonly","forEach","contribution","key","attribute","createAttribute","has","readonly","collection","push","processLayoutHintRules","attributes","all","visible","isHidden","questions","isResult","results","getAttributeByAttribute","attr","equals","CompositeAttributeModel","getChildByAttribute","getAttributeByKey","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","hints","layouthint","getChoiceAttributeByLayoutHint","layoutHint","ChoiceAttributeModel","getAttributesByLayoutHint","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","ConfigurationException","hasErrors","updateValidations","errors","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","validationData","attributesFormData","isVisible","getEmptyFormData","attributeFormData"],"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() {\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) {\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) {\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) {\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) {\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(contentConfiguration: ContentConfiguration) {\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;AAEA;AAEA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA,MAAMA,mBAAmB,SAASC,2BAAkB,CAAgB;EAClEC,WAAW,GAIT;IAAA,IAHAC,IAA4B,uEAAG,CAAC,CAAC;IAAA,IACjCC,aAA4B,uEAAG,EAAE;IAAA,IACjCC,UAAmB,uEAAG,KAAK;IAE3B,KAAK,EAAE;IAEP,IAAID,aAAa,EAAE;MACjBA,aAAa,CAACE,OAAO,CAAEC,YAAY,IAAK;QACtC,MAAM,CAACC,GAAG,CAAC,GAAG,mBAAYD,YAAY,CAAC;QAEvC,MAAME,SAAS,GAAG,IAAAC,wBAAe,EAACF,GAAG,EAAEL,IAAI,EAAEI,YAAY,CAACC,GAAG,CAAC,CAAC;QAE/D,IAAIC,SAAS,KAAK,IAAI,EAAE;UACtB;UACA,IAAIJ,UAAU,IAAI,CAAC,IAAAM,YAAG,EAACJ,YAAY,CAACC,GAAG,CAAC,EAAE,UAAU,CAAC,EAAE;YACrDC,SAAS,CAACG,QAAQ,GAAG,IAAI;UAC3B;UAEA,IAAI,CAACC,UAAU,CAACC,IAAI,CAACL,SAAS,CAAC;QACjC;MACF,CAAC,CAAC;MAEF,IAAI,CAACM,sBAAsB,EAAE;IAC/B;EACF;;EAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAU,GAAyB;IACrC,IAAI,CAACD,sBAAsB,EAAE;IAC7B,OAAO,IAAI,CAACE,GAAG;EACjB;;EAEA;AACF;AACA;EACE,IAAID,UAAU,CAACA,UAAgC,EAAE;IAC/C,IAAI,CAACH,UAAU,GAAGG,UAAU;EAC9B;;EAEA;AACF;EACED,sBAAsB,GAAG;IACvB,IAAI,CAACE,GAAG,CAACX,OAAO,CAAEG,SAAS,IAAK;MAC9BA,SAAS,CAACM,sBAAsB,CAAC,IAAI,CAAC;IACxC,CAAC,CAAC;EACJ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
1
+ {"version":3,"file":"AttributeCollection.js","names":["AttributeCollection","ResourceCollection","constructor","data","contributions","isReadonly","forEach","contribution","key","attribute","createAttribute","has","readonly","collection","push","processLayoutHintRules","attributes","all","visible","isHidden","questions","isResult","results","getAttributeByAttribute","attr","equals","CompositeAttributeModel","getChildByAttribute","getAttributeByKey","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","hints","layouthint","getChoiceAttributeByLayoutHint","layoutHint","ChoiceAttributeModel","getAttributesByLayoutHint","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","ConfigurationException","hasErrors","updateValidations","errors","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","validationData","attributesFormData","isVisible","getEmptyFormData","attributeFormData"],"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":";;;;;;;;;;;;AACA;AAEA;AAEA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA,MAAMA,mBAAmB,SAASC,2BAAkB,CAAgB;EAClEC,WAAW,GAIT;IAAA,IAHAC,IAA4B,uEAAG,CAAC,CAAC;IAAA,IACjCC,aAA4B,uEAAG,EAAE;IAAA,IACjCC,UAAmB,uEAAG,KAAK;IAE3B,KAAK,EAAE;IAEP,IAAID,aAAa,EAAE;MACjBA,aAAa,CAACE,OAAO,CAAEC,YAAY,IAAK;QACtC,MAAM,CAACC,GAAG,CAAC,GAAG,mBAAYD,YAAY,CAAC;QAEvC,MAAME,SAAS,GAAG,IAAAC,wBAAe,EAACF,GAAG,EAAEL,IAAI,EAAEI,YAAY,CAACC,GAAG,CAAC,CAAC;QAE/D,IAAIC,SAAS,KAAK,IAAI,EAAE;UACtB;UACA,IAAIJ,UAAU,IAAI,CAAC,IAAAM,YAAG,EAACJ,YAAY,CAACC,GAAG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AG,oEAAI,CAACnD,UAAU,mBAErCP,SAAS,IACRA,SAAS,CAACuD,QAAQ,KAAK,IAAI,IAC3B,CAACvD,SAAS,CAACG,QAAQ,KAClB,CAACsD,cAAc,IAAIzD,SAAS,CAACgD,wBAAwB,CAAC,CAC1D,kBACKhD,SAAS,IAAK;MAClB;MACA,IAAIA,SAAS,CAAC2D,SAAS,EAAE;QACvB,OAAO3D,SAAS,CAACuD,QAAQ;MAC3B;MAEA,OAAOvD,SAAS,CAAC4D,gBAAgB,EAAE;IACrC,CAAC,CAAC;IAEJ,IAAIlE,IAAI,GAAG,CAAC,CAAC;IACbgE,kBAAkB,CAAC7D,OAAO,CAAEgE,iBAAiB,IAAK;MAChD;MACA;MACAnE,IAAI,GAAG;QACL,GAAGA,IAAI;QACP,GAAGmE;MACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAOnE,IAAI;EACb;AACF;AAAC,eAEcH,mBAAmB;AAAA"}
@@ -144,7 +144,7 @@ export default class AttributeModel
144
144
 
145
145
  /**
146
146
  */
147
- setChildModels(models: Array<ModularUIModel>) {
147
+ setChildModels(models: Array<ModularUIModel>): void {
148
148
  const conceptHref = this.conceptLink?.href;
149
149
  if (conceptHref) {
150
150
  this.concept = models.find((model) =>
@@ -214,7 +214,9 @@ export default class AttributeModel
214
214
 
215
215
  /**
216
216
  */
217
- indicateContentConfiguration(contentConfiguration: ContentConfiguration) {
217
+ indicateContentConfiguration(
218
+ contentConfiguration: ContentConfiguration
219
+ ): void {
218
220
  if (contentConfiguration) {
219
221
  const hasQuestionConfig = contentConfiguration.questions?.hasConfig();
220
222
 
@@ -634,7 +636,7 @@ export default class AttributeModel
634
636
  /**
635
637
  * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
636
638
  */
637
- setUseClientsideValidation(enabled: boolean) {
639
+ setUseClientsideValidation(enabled: boolean): void {
638
640
  this._useClientsideValidation = enabled;
639
641
  }
640
642
 
@@ -701,14 +703,14 @@ export default class AttributeModel
701
703
  /**
702
704
  * Reset static error messages on attribute
703
705
  */
704
- resetErrors() {
706
+ resetErrors(): void {
705
707
  this._errorCollection = new ErrorCollection("attribute");
706
708
  }
707
709
 
708
710
  /**
709
711
  * Registers an error that was received from a server response
710
712
  */
711
- addServerError(error: FormErrorAnchor) {
713
+ addServerError(error: FormErrorAnchor): void {
712
714
  this._errorCollection.addServerError(
713
715
  error.id,
714
716
  error.message,
@@ -719,7 +721,7 @@ export default class AttributeModel
719
721
 
720
722
  /**
721
723
  */
722
- removeServerError(id: string) {
724
+ removeServerError(id: string): void {
723
725
  this._errorCollection.removeServerError(id);
724
726
  }
725
727
 
@@ -738,13 +740,13 @@ export default class AttributeModel
738
740
  /**
739
741
  * Registers a missing error that was received from the server
740
742
  */
741
- addMissingError() {
743
+ addMissingError(): void {
742
744
  this._errorCollection.addServerError("Constraint.Missing");
743
745
  }
744
746
 
745
747
  /**
746
748
  */
747
- removeMissingError() {
749
+ removeMissingError(): void {
748
750
  this.removeServerError("Constraint.Missing");
749
751
  }
750
752
 
@@ -771,7 +773,7 @@ export default class AttributeModel
771
773
  return {};
772
774
  }
773
775
 
774
- const params = {};
776
+ const params: { [name: string]: string | number } = {};
775
777
 
776
778
  Object.keys(parameters).forEach((paramKey: string) => {
777
779
  const paramValue = parameters[paramKey];
@@ -793,7 +795,7 @@ export default class AttributeModel
793
795
 
794
796
  /**
795
797
  */
796
- updateValidations(errors: Array<Object>) {
798
+ updateValidations(errors: Array<Object>): void {
797
799
  if (
798
800
  errors.some((error) => error.id === "Constraint.Mandatory") ||
799
801
  this.layouthint.has(MANDATORY)
@@ -831,7 +833,7 @@ export default class AttributeModel
831
833
  /**
832
834
  * Set last modification to current timestamp
833
835
  */
834
- updateLastModification() {
836
+ updateLastModification(): void {
835
837
  this._lastModification = Date.now();
836
838
  }
837
839
 
@@ -847,7 +849,7 @@ export default class AttributeModel
847
849
  *
848
850
  * @abstract
849
851
  */
850
- reset() {
852
+ reset(): void {
851
853
  throw new UnsupportedOperationException(
852
854
  `Reset method not implemented for ${this.type}`
853
855
  );
@@ -857,7 +859,7 @@ export default class AttributeModel
857
859
  * Merge old attribute with the attribute from the server.
858
860
  * Readonly attributes always need to show the value from the server
859
861
  */
860
- mergeAttribute(oldAttribute: AttributeType) {
862
+ mergeAttribute(oldAttribute: AttributeType): void {
861
863
  this.concept = oldAttribute.concept;
862
864
 
863
865
  if (
@@ -916,13 +918,13 @@ export default class AttributeModel
916
918
  /**
917
919
  * Explicitly toggle visibility of this attribute
918
920
  */
919
- show() {
921
+ show(): void {
920
922
  this.isHidden = false;
921
923
  }
922
924
 
923
925
  /**
924
926
  */
925
- hide() {
927
+ hide(): void {
926
928
  this.isHidden = true;
927
929
  }
928
930
 
@@ -956,7 +958,7 @@ export default class AttributeModel
956
958
 
957
959
  /**
958
960
  */
959
- processLayoutHintRules(attributes: AttributeCollection) {
961
+ processLayoutHintRules(attributes: AttributeCollection): void {
960
962
  if (this._layoutHintRules) {
961
963
  this.layoutHintRules.process(this, attributes);
962
964
  }