@beinformed/ui 1.42.1 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (632) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/esm/builder/index.js.map +1 -1
  3. package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
  4. package/esm/constants/Constants.js.map +1 -1
  5. package/esm/constants/LayoutHintConfig.js.map +1 -1
  6. package/esm/constants/LayoutHints.js.map +1 -1
  7. package/esm/constants/Settings.js.map +1 -1
  8. package/esm/constants/index.js.map +1 -1
  9. package/esm/exceptions/ConfigurationException.js.map +1 -1
  10. package/esm/exceptions/FetchException.js.map +1 -1
  11. package/esm/exceptions/IllegalArgumentException.js.map +1 -1
  12. package/esm/exceptions/IllegalReturnException.js.map +1 -1
  13. package/esm/exceptions/IllegalStateException.js.map +1 -1
  14. package/esm/exceptions/JsonParseException.js.map +1 -1
  15. package/esm/exceptions/MissingPropertyException.js.map +1 -1
  16. package/esm/exceptions/NetworkException.js.map +1 -1
  17. package/esm/exceptions/NotAllowedUriException.js.map +1 -1
  18. package/esm/exceptions/NotFoundException.js.map +1 -1
  19. package/esm/exceptions/ServerRequestException.js.map +1 -1
  20. package/esm/exceptions/ThemePropertyException.js.map +1 -1
  21. package/esm/exceptions/TimeoutException.js.map +1 -1
  22. package/esm/exceptions/UnauthorizedException.js.map +1 -1
  23. package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
  24. package/esm/exceptions/index.js.map +1 -1
  25. package/esm/hooks/index.js.map +1 -1
  26. package/esm/hooks/useAllFormsOnModel.js.map +1 -1
  27. package/esm/hooks/useAuthentication.js.map +1 -1
  28. package/esm/hooks/useContent.js.map +1 -1
  29. package/esm/hooks/useDeepCompareEffect.js.map +1 -1
  30. package/esm/hooks/useForm.js.map +1 -1
  31. package/esm/hooks/useI18n.js.map +1 -1
  32. package/esm/hooks/useModal.js.map +1 -1
  33. package/esm/hooks/useModelCatalog.js +19 -23
  34. package/esm/hooks/useModelCatalog.js.map +1 -1
  35. package/esm/hooks/useModels.js +15 -1
  36. package/esm/hooks/useModels.js.map +1 -1
  37. package/esm/hooks/useModularUI.js.map +1 -1
  38. package/esm/hooks/useModularUIBasic.js.map +1 -1
  39. package/esm/hooks/useModularUIModel.js.map +1 -1
  40. package/esm/hooks/useModularUIRequest.js.map +1 -1
  41. package/esm/hooks/useNotification.js.map +1 -1
  42. package/esm/hooks/usePreference.js.map +1 -1
  43. package/esm/hooks/useProgressIndicator.js.map +1 -1
  44. package/esm/hooks/useRouter.js.map +1 -1
  45. package/esm/i18n/Locale.js.map +1 -1
  46. package/esm/i18n/Locales.js.map +1 -1
  47. package/esm/i18n/Message.js.map +1 -1
  48. package/esm/i18n/index.js.map +1 -1
  49. package/esm/i18n/languages.js.map +1 -1
  50. package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
  51. package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
  52. package/esm/i18n/types.js.map +1 -1
  53. package/esm/i18n/withMessage.js.map +1 -1
  54. package/esm/index.js.map +1 -1
  55. package/esm/models/actions/ActionCollection.js.map +1 -1
  56. package/esm/models/actions/ActionModel.js.map +1 -1
  57. package/esm/models/application/ApplicationModel.js.map +1 -1
  58. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  59. package/esm/models/attributes/AttributeContent.js.map +1 -1
  60. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  61. package/esm/models/attributes/AttributeModel.js.map +1 -1
  62. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  63. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  64. package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
  65. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  66. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  67. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  68. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  69. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  70. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  71. package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
  72. package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
  73. package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
  74. package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
  75. package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
  76. package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
  77. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  78. package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
  79. package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
  80. package/esm/models/attributes/_createAttribute.js.map +1 -1
  81. package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  82. package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  83. package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  84. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  85. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  86. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  87. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  88. package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  89. package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  90. package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  91. package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  92. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  93. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  94. package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  95. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  96. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  97. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  98. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  99. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  100. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  101. package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  102. package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  103. package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  104. package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  105. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  106. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  107. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  108. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  109. package/esm/models/base/BaseCollection.js.map +1 -1
  110. package/esm/models/base/BaseModel.js.map +1 -1
  111. package/esm/models/base/ResourceCollection.js.map +1 -1
  112. package/esm/models/base/ResourceModel.js.map +1 -1
  113. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  114. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  115. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  116. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  117. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  118. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  119. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  120. package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  121. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  122. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  123. package/esm/models/content/ContentIndexModel.js.map +1 -1
  124. package/esm/models/content/ContentLinkModel.js.map +1 -1
  125. package/esm/models/content/ContentModel.js.map +1 -1
  126. package/esm/models/content/ContentTOCModel.js.map +1 -1
  127. package/esm/models/content/ContentTypeModel.js.map +1 -1
  128. package/esm/models/content/SectionModel.js.map +1 -1
  129. package/esm/models/content/SubSectionModel.js.map +1 -1
  130. package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  131. package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  132. package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  133. package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  134. package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  135. package/esm/models/detail/DetailModel.js.map +1 -1
  136. package/esm/models/error/ErrorCollection.js.map +1 -1
  137. package/esm/models/error/ErrorModel.js.map +1 -1
  138. package/esm/models/error/ErrorResponse.js.map +1 -1
  139. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  140. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  141. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  142. package/esm/models/filters/FilterCollection.js.map +1 -1
  143. package/esm/models/filters/FilterModel.js.map +1 -1
  144. package/esm/models/filters/RangeFilterModel.js.map +1 -1
  145. package/esm/models/filters/StringFilterModel.js.map +1 -1
  146. package/esm/models/form/FormModel.js.map +1 -1
  147. package/esm/models/form/FormObjectModel.js.map +1 -1
  148. package/esm/models/grouping/GroupingModel.js.map +1 -1
  149. package/esm/models/href/Href.js.map +1 -1
  150. package/esm/models/href/ListHref.js.map +1 -1
  151. package/esm/models/index.js.map +1 -1
  152. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  153. package/esm/models/links/LinkCollection.js.map +1 -1
  154. package/esm/models/links/LinkModel.js.map +1 -1
  155. package/esm/models/links/normalizeLinkJSON.js.map +1 -1
  156. package/esm/models/list/ListDetailModel.js.map +1 -1
  157. package/esm/models/list/ListHeaderModel.js.map +1 -1
  158. package/esm/models/list/ListItemCollection.js.map +1 -1
  159. package/esm/models/list/ListItemModel.js.map +1 -1
  160. package/esm/models/list/ListModel.js.map +1 -1
  161. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  162. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  163. package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  164. package/esm/models/paging/PagesizeModel.js.map +1 -1
  165. package/esm/models/paging/PagingModel.js.map +1 -1
  166. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  167. package/esm/models/parameter/Parameter.js.map +1 -1
  168. package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
  169. package/esm/models/resolveModel.js.map +1 -1
  170. package/esm/models/search/CaseSearchModel.js.map +1 -1
  171. package/esm/models/sorting/SortOptionModel.js.map +1 -1
  172. package/esm/models/sorting/SortingModel.js.map +1 -1
  173. package/esm/models/tab/TabModel.js.map +1 -1
  174. package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
  175. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  176. package/esm/models/types.js.map +1 -1
  177. package/esm/models/user/UserModel.js.map +1 -1
  178. package/esm/models/user/UserProfileModel.js.map +1 -1
  179. package/esm/models/user/UserServicesModel.js.map +1 -1
  180. package/esm/modularui/Authenticate.js.map +1 -1
  181. package/esm/modularui/CaptchaRequest.js.map +1 -1
  182. package/esm/modularui/ModularUIError.js.map +1 -1
  183. package/esm/modularui/ModularUIRequest.js.map +1 -1
  184. package/esm/modularui/ModularUIResponse.js.map +1 -1
  185. package/esm/modularui/UploadRequest.js.map +1 -1
  186. package/esm/modularui/index.js.map +1 -1
  187. package/esm/modularui/types.js.map +1 -1
  188. package/esm/react/ErrorBoundary.js.map +1 -1
  189. package/esm/react/ErrorBoundaryFallback.js.map +1 -1
  190. package/esm/react/index.js.map +1 -1
  191. package/esm/react/utils.js.map +1 -1
  192. package/esm/react-client/Init.js.map +1 -1
  193. package/esm/react-client/client.js.map +1 -1
  194. package/esm/react-client/contextPath.js.map +1 -1
  195. package/esm/react-client/index.js.map +1 -1
  196. package/esm/react-client/rehydrate.js.map +1 -1
  197. package/esm/react-server/contextPath.js.map +1 -1
  198. package/esm/react-server/createSSRComplete.js.map +1 -1
  199. package/esm/react-server/htmlpage.js.map +1 -1
  200. package/esm/react-server/index.js.map +1 -1
  201. package/esm/react-server/renderSSRComplete.js.map +1 -1
  202. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  203. package/esm/react-server/requestInformation.js.map +1 -1
  204. package/esm/react-server/serverNoSSR.js.map +1 -1
  205. package/esm/react-server/serverSSR.js.map +1 -1
  206. package/esm/react-server/serverUtil.js.map +1 -1
  207. package/esm/react-theme/ThemeProvider.js.map +1 -1
  208. package/esm/react-theme/createTheme.js.map +1 -1
  209. package/esm/react-theme/index.js.map +1 -1
  210. package/esm/react-theme/types.js.map +1 -1
  211. package/esm/react-theme/useTheme.js.map +1 -1
  212. package/esm/react-theme/utils/background.js.map +1 -1
  213. package/esm/react-theme/utils/colors.js.map +1 -1
  214. package/esm/react-theme/utils/contrast.js.map +1 -1
  215. package/esm/react-theme/utils/corners.js.map +1 -1
  216. package/esm/react-theme/utils/spacers.js.map +1 -1
  217. package/esm/react-theme/utils/themeProps.js.map +1 -1
  218. package/esm/redux/_i18n/I18nActions.js.map +1 -1
  219. package/esm/redux/_i18n/I18nReducer.js.map +1 -1
  220. package/esm/redux/_i18n/index.js.map +1 -1
  221. package/esm/redux/_i18n/types.js.map +1 -1
  222. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  223. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
  224. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  225. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  226. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  227. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  228. package/esm/redux/_modularui/index.js.map +1 -1
  229. package/esm/redux/_modularui/types.js.map +1 -1
  230. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  231. package/esm/redux/_router/RouterActions.js.map +1 -1
  232. package/esm/redux/_router/RouterConnectors.js.map +1 -1
  233. package/esm/redux/_router/RouterMiddleware.js.map +1 -1
  234. package/esm/redux/_router/RouterReducer.js.map +1 -1
  235. package/esm/redux/_router/index.js.map +1 -1
  236. package/esm/redux/_router/types.js.map +1 -1
  237. package/esm/redux/actions/Application.js.map +1 -1
  238. package/esm/redux/actions/Authorization.js.map +1 -1
  239. package/esm/redux/actions/Error.js.map +1 -1
  240. package/esm/redux/actions/Form.js.map +1 -1
  241. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  242. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  243. package/esm/redux/actions/FormAutosave.js.map +1 -1
  244. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  245. package/esm/redux/actions/FormValidations.js.map +1 -1
  246. package/esm/redux/actions/Modals.js.map +1 -1
  247. package/esm/redux/actions/Notification.js.map +1 -1
  248. package/esm/redux/actions/Preferences.js.map +1 -1
  249. package/esm/redux/actions/ProgressIndicator.js.map +1 -1
  250. package/esm/redux/actions/SignIn.js.map +1 -1
  251. package/esm/redux/actions/SignOut.js.map +1 -1
  252. package/esm/redux/actions/index.js.map +1 -1
  253. package/esm/redux/connectors/Application.js.map +1 -1
  254. package/esm/redux/connectors/Breadcrumb.js.map +1 -1
  255. package/esm/redux/connectors/CaseView.js.map +1 -1
  256. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  257. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  258. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  259. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  260. package/esm/redux/connectors/Form.js.map +1 -1
  261. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  262. package/esm/redux/connectors/ListDetail.js.map +1 -1
  263. package/esm/redux/connectors/Modal.js.map +1 -1
  264. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  265. package/esm/redux/connectors/Notification.js.map +1 -1
  266. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  267. package/esm/redux/connectors/Preferences.js.map +1 -1
  268. package/esm/redux/connectors/Progress.js.map +1 -1
  269. package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
  270. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  271. package/esm/redux/connectors/SignIn.js.map +1 -1
  272. package/esm/redux/connectors/SignOut.js.map +1 -1
  273. package/esm/redux/connectors/Tab.js.map +1 -1
  274. package/esm/redux/connectors/index.js.map +1 -1
  275. package/esm/redux/index.js.map +1 -1
  276. package/esm/redux/reducers/AuthReducer.js.map +1 -1
  277. package/esm/redux/reducers/ErrorReducer.js.map +1 -1
  278. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  279. package/esm/redux/reducers/NotificationReducer.js.map +1 -1
  280. package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
  281. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  282. package/esm/redux/reducers/createReducer.js.map +1 -1
  283. package/esm/redux/reducers/index.js.map +1 -1
  284. package/esm/redux/selectors/i18n.js.map +1 -1
  285. package/esm/redux/selectors/index.js.map +1 -1
  286. package/esm/redux/store/beforeRenderHooks.js.map +1 -1
  287. package/esm/redux/store/configureStore.js.map +1 -1
  288. package/esm/redux/types.js.map +1 -1
  289. package/esm/utils/browser/Cache.js.map +1 -1
  290. package/esm/utils/browser/Cookies.js.map +1 -1
  291. package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
  292. package/esm/utils/fetch/serverFetch.js.map +1 -1
  293. package/esm/utils/fetch/types.js.map +1 -1
  294. package/esm/utils/fetch/universalFetch.js.map +1 -1
  295. package/esm/utils/fetch/xhr.js.map +1 -1
  296. package/esm/utils/helpers/checkResource.js.map +1 -1
  297. package/esm/utils/helpers/createHash.js.map +1 -1
  298. package/esm/utils/helpers/createHref.js +68 -0
  299. package/esm/utils/helpers/createHref.js.map +1 -0
  300. package/esm/utils/helpers/createUUID.js.map +1 -1
  301. package/esm/utils/helpers/index.js +1 -0
  302. package/esm/utils/helpers/index.js.map +1 -1
  303. package/esm/utils/helpers/objects.js.map +1 -1
  304. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  305. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  306. package/esm/utils/helpers/text.js.map +1 -1
  307. package/esm/utils/index.js.map +1 -1
  308. package/esm/utils/number/DecimalFormat.js.map +1 -1
  309. package/esm/utils/number/formatValue.js.map +1 -1
  310. package/esm/utils/number/parseNumbers.js.map +1 -1
  311. package/lib/builder/index.js.map +1 -1
  312. package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
  313. package/lib/constants/Constants.js.map +1 -1
  314. package/lib/constants/LayoutHintConfig.js.map +1 -1
  315. package/lib/constants/LayoutHints.js.map +1 -1
  316. package/lib/constants/Settings.js.map +1 -1
  317. package/lib/constants/index.js.map +1 -1
  318. package/lib/exceptions/ConfigurationException.js.map +1 -1
  319. package/lib/exceptions/FetchException.js.map +1 -1
  320. package/lib/exceptions/IllegalArgumentException.js.map +1 -1
  321. package/lib/exceptions/IllegalReturnException.js.map +1 -1
  322. package/lib/exceptions/IllegalStateException.js.map +1 -1
  323. package/lib/exceptions/JsonParseException.js.map +1 -1
  324. package/lib/exceptions/MissingPropertyException.js.map +1 -1
  325. package/lib/exceptions/NetworkException.js.map +1 -1
  326. package/lib/exceptions/NotAllowedUriException.js.map +1 -1
  327. package/lib/exceptions/NotFoundException.js.map +1 -1
  328. package/lib/exceptions/ServerRequestException.js.map +1 -1
  329. package/lib/exceptions/ThemePropertyException.js.map +1 -1
  330. package/lib/exceptions/TimeoutException.js.map +1 -1
  331. package/lib/exceptions/UnauthorizedException.js.map +1 -1
  332. package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
  333. package/lib/exceptions/index.js.map +1 -1
  334. package/lib/hooks/__tests__/useModels.spec.js.flow +96 -1
  335. package/lib/hooks/index.js.map +1 -1
  336. package/lib/hooks/useAllFormsOnModel.js.map +1 -1
  337. package/lib/hooks/useAuthentication.js.map +1 -1
  338. package/lib/hooks/useContent.js.map +1 -1
  339. package/lib/hooks/useDeepCompareEffect.js.map +1 -1
  340. package/lib/hooks/useForm.js.map +1 -1
  341. package/lib/hooks/useI18n.js.map +1 -1
  342. package/lib/hooks/useModal.js.map +1 -1
  343. package/lib/hooks/useModelCatalog.js +19 -24
  344. package/lib/hooks/useModelCatalog.js.flow +13 -23
  345. package/lib/hooks/useModelCatalog.js.map +1 -1
  346. package/lib/hooks/useModels.js +15 -0
  347. package/lib/hooks/useModels.js.flow +17 -1
  348. package/lib/hooks/useModels.js.map +1 -1
  349. package/lib/hooks/useModularUI.js.map +1 -1
  350. package/lib/hooks/useModularUIBasic.js.map +1 -1
  351. package/lib/hooks/useModularUIModel.js.map +1 -1
  352. package/lib/hooks/useModularUIRequest.js.map +1 -1
  353. package/lib/hooks/useNotification.js.map +1 -1
  354. package/lib/hooks/usePreference.js.map +1 -1
  355. package/lib/hooks/useProgressIndicator.js.map +1 -1
  356. package/lib/hooks/useRouter.js.map +1 -1
  357. package/lib/i18n/Locale.js.map +1 -1
  358. package/lib/i18n/Locales.js.map +1 -1
  359. package/lib/i18n/Message.js.map +1 -1
  360. package/lib/i18n/index.js.map +1 -1
  361. package/lib/i18n/languages.js.map +1 -1
  362. package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
  363. package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
  364. package/lib/i18n/types.js.map +1 -1
  365. package/lib/i18n/withMessage.js.map +1 -1
  366. package/lib/index.js.map +1 -1
  367. package/lib/models/actions/ActionCollection.js.map +1 -1
  368. package/lib/models/actions/ActionModel.js.map +1 -1
  369. package/lib/models/application/ApplicationModel.js.map +1 -1
  370. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  371. package/lib/models/attributes/AttributeContent.js.map +1 -1
  372. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  373. package/lib/models/attributes/AttributeModel.js.map +1 -1
  374. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  375. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  376. package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
  377. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  378. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  379. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  380. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  381. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  382. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  383. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  384. package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
  385. package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
  386. package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
  387. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  388. package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
  389. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  390. package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
  391. package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
  392. package/lib/models/attributes/_createAttribute.js.map +1 -1
  393. package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  394. package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  395. package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  396. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  397. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  398. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  399. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  400. package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  401. package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  402. package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  403. package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  404. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  405. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  406. package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  407. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  408. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  409. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  410. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  411. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  412. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  413. package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  414. package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  415. package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  416. package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  417. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  418. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  419. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  420. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  421. package/lib/models/base/BaseCollection.js.map +1 -1
  422. package/lib/models/base/BaseModel.js.map +1 -1
  423. package/lib/models/base/ResourceCollection.js.map +1 -1
  424. package/lib/models/base/ResourceModel.js.map +1 -1
  425. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  426. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  427. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  428. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  429. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  430. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  431. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  432. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  433. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  434. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  435. package/lib/models/content/ContentIndexModel.js.map +1 -1
  436. package/lib/models/content/ContentLinkModel.js.map +1 -1
  437. package/lib/models/content/ContentModel.js.map +1 -1
  438. package/lib/models/content/ContentTOCModel.js.map +1 -1
  439. package/lib/models/content/ContentTypeModel.js.map +1 -1
  440. package/lib/models/content/SectionModel.js.map +1 -1
  441. package/lib/models/content/SubSectionModel.js.map +1 -1
  442. package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  443. package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  444. package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  445. package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  446. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  447. package/lib/models/detail/DetailModel.js.map +1 -1
  448. package/lib/models/error/ErrorCollection.js.map +1 -1
  449. package/lib/models/error/ErrorModel.js.map +1 -1
  450. package/lib/models/error/ErrorResponse.js.map +1 -1
  451. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  452. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  453. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  454. package/lib/models/filters/FilterCollection.js.map +1 -1
  455. package/lib/models/filters/FilterModel.js.map +1 -1
  456. package/lib/models/filters/RangeFilterModel.js.map +1 -1
  457. package/lib/models/filters/StringFilterModel.js.map +1 -1
  458. package/lib/models/form/FormModel.js.map +1 -1
  459. package/lib/models/form/FormObjectModel.js.map +1 -1
  460. package/lib/models/grouping/GroupingModel.js.map +1 -1
  461. package/lib/models/href/Href.js.map +1 -1
  462. package/lib/models/href/ListHref.js.map +1 -1
  463. package/lib/models/index.js.map +1 -1
  464. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  465. package/lib/models/links/LinkCollection.js.map +1 -1
  466. package/lib/models/links/LinkModel.js.map +1 -1
  467. package/lib/models/links/normalizeLinkJSON.js.map +1 -1
  468. package/lib/models/list/ListDetailModel.js.map +1 -1
  469. package/lib/models/list/ListHeaderModel.js.map +1 -1
  470. package/lib/models/list/ListItemCollection.js.map +1 -1
  471. package/lib/models/list/ListItemModel.js.map +1 -1
  472. package/lib/models/list/ListModel.js.map +1 -1
  473. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  474. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  475. package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  476. package/lib/models/paging/PagesizeModel.js.map +1 -1
  477. package/lib/models/paging/PagingModel.js.map +1 -1
  478. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  479. package/lib/models/parameter/Parameter.js.map +1 -1
  480. package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
  481. package/lib/models/resolveModel.js.map +1 -1
  482. package/lib/models/search/CaseSearchModel.js.map +1 -1
  483. package/lib/models/sorting/SortOptionModel.js.map +1 -1
  484. package/lib/models/sorting/SortingModel.js.map +1 -1
  485. package/lib/models/tab/TabModel.js.map +1 -1
  486. package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
  487. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  488. package/lib/models/types.js.map +1 -1
  489. package/lib/models/user/UserModel.js.map +1 -1
  490. package/lib/models/user/UserProfileModel.js.map +1 -1
  491. package/lib/models/user/UserServicesModel.js.map +1 -1
  492. package/lib/modularui/Authenticate.js.map +1 -1
  493. package/lib/modularui/CaptchaRequest.js.map +1 -1
  494. package/lib/modularui/ModularUIError.js.map +1 -1
  495. package/lib/modularui/ModularUIRequest.js.map +1 -1
  496. package/lib/modularui/ModularUIResponse.js.map +1 -1
  497. package/lib/modularui/UploadRequest.js.map +1 -1
  498. package/lib/modularui/index.js.map +1 -1
  499. package/lib/modularui/types.js.map +1 -1
  500. package/lib/react/ErrorBoundary.js.map +1 -1
  501. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  502. package/lib/react/index.js.map +1 -1
  503. package/lib/react/utils.js.map +1 -1
  504. package/lib/react-client/Init.js.map +1 -1
  505. package/lib/react-client/client.js.map +1 -1
  506. package/lib/react-client/contextPath.js.map +1 -1
  507. package/lib/react-client/index.js.map +1 -1
  508. package/lib/react-client/rehydrate.js.map +1 -1
  509. package/lib/react-server/contextPath.js.map +1 -1
  510. package/lib/react-server/createSSRComplete.js.map +1 -1
  511. package/lib/react-server/htmlpage.js.map +1 -1
  512. package/lib/react-server/index.js.map +1 -1
  513. package/lib/react-server/renderSSRComplete.js.map +1 -1
  514. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  515. package/lib/react-server/requestInformation.js.map +1 -1
  516. package/lib/react-server/serverNoSSR.js.map +1 -1
  517. package/lib/react-server/serverSSR.js.map +1 -1
  518. package/lib/react-server/serverUtil.js.map +1 -1
  519. package/lib/react-theme/ThemeProvider.js.map +1 -1
  520. package/lib/react-theme/createTheme.js.map +1 -1
  521. package/lib/react-theme/index.js.map +1 -1
  522. package/lib/react-theme/types.js.map +1 -1
  523. package/lib/react-theme/useTheme.js.map +1 -1
  524. package/lib/react-theme/utils/background.js.map +1 -1
  525. package/lib/react-theme/utils/colors.js.map +1 -1
  526. package/lib/react-theme/utils/contrast.js.map +1 -1
  527. package/lib/react-theme/utils/corners.js.map +1 -1
  528. package/lib/react-theme/utils/spacers.js.map +1 -1
  529. package/lib/react-theme/utils/themeProps.js.map +1 -1
  530. package/lib/redux/_i18n/I18nActions.js.map +1 -1
  531. package/lib/redux/_i18n/I18nReducer.js.map +1 -1
  532. package/lib/redux/_i18n/index.js.map +1 -1
  533. package/lib/redux/_i18n/types.js.map +1 -1
  534. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  535. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
  536. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  537. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  538. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  539. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  540. package/lib/redux/_modularui/index.js.map +1 -1
  541. package/lib/redux/_modularui/types.js.map +1 -1
  542. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  543. package/lib/redux/_router/RouterActions.js.map +1 -1
  544. package/lib/redux/_router/RouterConnectors.js.map +1 -1
  545. package/lib/redux/_router/RouterMiddleware.js.map +1 -1
  546. package/lib/redux/_router/RouterReducer.js.map +1 -1
  547. package/lib/redux/_router/index.js.map +1 -1
  548. package/lib/redux/_router/types.js.map +1 -1
  549. package/lib/redux/actions/Application.js.map +1 -1
  550. package/lib/redux/actions/Authorization.js.map +1 -1
  551. package/lib/redux/actions/Error.js.map +1 -1
  552. package/lib/redux/actions/Form.js.map +1 -1
  553. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  554. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  555. package/lib/redux/actions/FormAutosave.js.map +1 -1
  556. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  557. package/lib/redux/actions/FormValidations.js.map +1 -1
  558. package/lib/redux/actions/Modals.js.map +1 -1
  559. package/lib/redux/actions/Notification.js.map +1 -1
  560. package/lib/redux/actions/Preferences.js.map +1 -1
  561. package/lib/redux/actions/ProgressIndicator.js.map +1 -1
  562. package/lib/redux/actions/SignIn.js.map +1 -1
  563. package/lib/redux/actions/SignOut.js.map +1 -1
  564. package/lib/redux/actions/index.js.map +1 -1
  565. package/lib/redux/connectors/Application.js.map +1 -1
  566. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  567. package/lib/redux/connectors/CaseView.js.map +1 -1
  568. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  569. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  570. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  571. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  572. package/lib/redux/connectors/Form.js.map +1 -1
  573. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  574. package/lib/redux/connectors/ListDetail.js.map +1 -1
  575. package/lib/redux/connectors/Modal.js.map +1 -1
  576. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  577. package/lib/redux/connectors/Notification.js.map +1 -1
  578. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  579. package/lib/redux/connectors/Preferences.js.map +1 -1
  580. package/lib/redux/connectors/Progress.js.map +1 -1
  581. package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
  582. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  583. package/lib/redux/connectors/SignIn.js.map +1 -1
  584. package/lib/redux/connectors/SignOut.js.map +1 -1
  585. package/lib/redux/connectors/Tab.js.map +1 -1
  586. package/lib/redux/connectors/index.js.map +1 -1
  587. package/lib/redux/index.js.map +1 -1
  588. package/lib/redux/reducers/AuthReducer.js.map +1 -1
  589. package/lib/redux/reducers/ErrorReducer.js.map +1 -1
  590. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  591. package/lib/redux/reducers/NotificationReducer.js.map +1 -1
  592. package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
  593. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  594. package/lib/redux/reducers/createReducer.js.map +1 -1
  595. package/lib/redux/reducers/index.js.map +1 -1
  596. package/lib/redux/selectors/i18n.js.map +1 -1
  597. package/lib/redux/selectors/index.js.map +1 -1
  598. package/lib/redux/store/beforeRenderHooks.js.map +1 -1
  599. package/lib/redux/store/configureStore.js.map +1 -1
  600. package/lib/redux/types.js.map +1 -1
  601. package/lib/utils/browser/Cache.js.map +1 -1
  602. package/lib/utils/browser/Cookies.js.map +1 -1
  603. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  604. package/lib/utils/fetch/serverFetch.js.map +1 -1
  605. package/lib/utils/fetch/types.js.map +1 -1
  606. package/lib/utils/fetch/universalFetch.js.map +1 -1
  607. package/lib/utils/fetch/xhr.js.map +1 -1
  608. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +30 -0
  609. package/lib/utils/helpers/checkResource.js.map +1 -1
  610. package/lib/utils/helpers/createHash.js.map +1 -1
  611. package/lib/utils/helpers/createHref.js +78 -0
  612. package/lib/utils/helpers/createHref.js.flow +80 -0
  613. package/lib/utils/helpers/createHref.js.map +1 -0
  614. package/lib/utils/helpers/createUUID.js.map +1 -1
  615. package/lib/utils/helpers/index.js +12 -0
  616. package/lib/utils/helpers/index.js.flow +1 -0
  617. package/lib/utils/helpers/index.js.map +1 -1
  618. package/lib/utils/helpers/objects.js.map +1 -1
  619. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  620. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  621. package/lib/utils/helpers/text.js.map +1 -1
  622. package/lib/utils/index.js.map +1 -1
  623. package/lib/utils/number/DecimalFormat.js.map +1 -1
  624. package/lib/utils/number/formatValue.js.map +1 -1
  625. package/lib/utils/number/parseNumbers.js.map +1 -1
  626. package/package.json +1 -1
  627. package/src/hooks/__tests__/useModels.spec.js +96 -1
  628. package/src/hooks/useModelCatalog.js +13 -23
  629. package/src/hooks/useModels.js +17 -1
  630. package/src/utils/helpers/__tests__/createHref.spec.js +30 -0
  631. package/src/utils/helpers/createHref.js +80 -0
  632. package/src/utils/helpers/index.js +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.js","names":["useSelector","createSelector","memoize","getLocales","getLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","_len","arguments","length","args","Array","_key","_JSON$stringify","useMessage","useTranslate","useLocale","getLocaleCodes","state","i18n","_mapInstanceProperty","call","locale","code","useLocaleCodes"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\nexport { useTranslate, useMessage, useLocale, useLocaleCodes };\n"],"mappings":";;AACA,SAASA,WAAW,QAAQ,aAAa;AACzC,SAASC,cAAc,QAAQ,UAAU;AACzC,OAAOC,OAAO,MAAM,gBAAgB;AAEpC,SAASC,UAAU,EAAEC,SAAS,QAAQ,yBAAyB;AAE/D,MAAMC,UAAU,GAAGJ,cAAc,CAC/B,CAACE,UAAU,EAAEC,SAAS,CAAC,EACvB,CAACE,OAAO,EAAEC,UAAU,KAClBL,OAAO,CACL,CAACM,EAAU,EAAEC,cAAuB,EAAEC,YAAqB,KACzDJ,OAAO,CACJF,SAAS,CAACG,UAAU,CAAC,CACrBF,UAAU,CAACG,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC,EACjD;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAIC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EAAA,OAAKC,eAAA,CAAeH,IAAI,CAAC;AAAA,CACnC,CACJ,CAAC;;AAED;AACA;AACA,MAAMI,UAAU,GAAGA,CACjBV,EAAU,EACVC,cAAuB,EACvBC,YAA4B,KACpBV,WAAW,CAACK,UAAU,CAAC,CAACG,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC;;AAEnE;AACA;AACA,MAAMS,YAAY,GAAGA,CAAA,KAAyBnB,WAAW,CAACK,UAAU,CAAC;;AAErE;AACA;AACA,MAAMe,SAAS,GAAGA,CAAA,KAAcpB,WAAW,CAACI,SAAS,CAAC;AAEtD,MAAMiB,cAAc,GAAGpB,cAAc,CAClCqB,KAAK,IAAKA,KAAK,CAACC,IAAI,CAACjB,OAAO,EAC5BA,OAAO,IAAKkB,oBAAA,CAAAlB,OAAO,EAAAmB,IAAA,CAAPnB,OAAO,EAAMoB,MAAM,IAAKA,MAAM,CAACC,IAAI,CAClD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAAA,KAAqB5B,WAAW,CAACqB,cAAc,CAAC;AAEvE,SAASF,YAAY,EAAED,UAAU,EAAEE,SAAS,EAAEQ,cAAc"}
1
+ {"version":3,"file":"useI18n.js","names":["useSelector","createSelector","memoize","getLocales","getLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","_len","arguments","length","args","Array","_key","_JSON$stringify","useMessage","useTranslate","useLocale","getLocaleCodes","state","i18n","_mapInstanceProperty","call","locale","code","useLocaleCodes"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\nexport { useTranslate, useMessage, useLocale, useLocaleCodes };\n"],"mappings":";;AACA,SAASA,WAAW,QAAQ,aAAa;AACzC,SAASC,cAAc,QAAQ,UAAU;AACzC,OAAOC,OAAO,MAAM,gBAAgB;AAEpC,SAASC,UAAU,EAAEC,SAAS,QAAQ,yBAAyB;AAE/D,MAAMC,UAAU,GAAGJ,cAAc,CAC/B,CAACE,UAAU,EAAEC,SAAS,CAAC,EACvB,CAACE,OAAO,EAAEC,UAAU,KAClBL,OAAO,CACL,CAACM,EAAU,EAAEC,cAAuB,EAAEC,YAAqB,KACzDJ,OAAO,CACJF,SAAS,CAACG,UAAU,CAAC,CACrBF,UAAU,CAACG,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC,EACjD;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAIC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EAAA,OAAKC,eAAA,CAAeH,IAAI,CAAC;AAAA,CACnC,CACJ,CAAC;;AAED;AACA;AACA,MAAMI,UAAU,GAAGA,CACjBV,EAAU,EACVC,cAAuB,EACvBC,YAA4B,KACpBV,WAAW,CAACK,UAAU,CAAC,CAACG,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC;;AAEnE;AACA;AACA,MAAMS,YAAY,GAAGA,CAAA,KAAyBnB,WAAW,CAACK,UAAU,CAAC;;AAErE;AACA;AACA,MAAMe,SAAS,GAAGA,CAAA,KAAcpB,WAAW,CAACI,SAAS,CAAC;AAEtD,MAAMiB,cAAc,GAAGpB,cAAc,CAClCqB,KAAK,IAAKA,KAAK,CAACC,IAAI,CAACjB,OAAO,EAC5BA,OAAO,IAAKkB,oBAAA,CAAAlB,OAAO,EAAAmB,IAAA,CAAPnB,OAAO,EAAMoB,MAAM,IAAKA,MAAM,CAACC,IAAI,CAClD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAAA,KAAqB5B,WAAW,CAACqB,cAAc,CAAC;AAEvE,SAASF,YAAY,EAAED,UAAU,EAAEE,SAAS,EAAEQ,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useModal.js","names":["useCallback","useDispatch","useSelector","showModal","closeModal","IllegalArgumentException","useModal","modalId","dispatch","modal","_ref","_context","modals","_findInstanceProperty","call","m","key","show","close","size","visible"],"sources":["../../src/hooks/useModal.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { showModal, closeModal } from \"../redux/actions/Modals\";\nimport { IllegalArgumentException } from \"../exceptions\";\n\ntype ModalHook = (modalId: string) => {\n key: string | null,\n size: string | null,\n visible: boolean,\n show: () => void,\n close: () => void,\n};\n\n/**\n * Manage modals\n */\nexport const useModal: ModalHook = (modalId: string) => {\n if (!modalId) {\n throw new IllegalArgumentException(\n \"Missing modalId argument for useModal hook\",\n );\n }\n\n const dispatch = useDispatch();\n const modal = useSelector(({ modals }) =>\n modals.modals.find((m) => m.key === modalId),\n );\n\n const show = useCallback(() => {\n dispatch(showModal(modalId));\n }, [dispatch, modalId]);\n\n const close = useCallback(() => {\n dispatch(closeModal(modalId));\n }, [dispatch, modalId]);\n\n return {\n key: modal ? modal.key : null,\n size: modal ? modal.size : null,\n visible: modal ? modal.visible : false,\n show,\n close,\n };\n};\n"],"mappings":";AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAEtD,SAASC,SAAS,EAAEC,UAAU,QAAQ,yBAAyB;AAC/D,SAASC,wBAAwB,QAAQ,eAAe;AAUxD;AACA;AACA;AACA,OAAO,MAAMC,QAAmB,GAAIC,OAAe,IAAK;EACtD,IAAI,CAACA,OAAO,EAAE;IACZ,MAAM,IAAIF,wBAAwB,CAChC,4CACF,CAAC;EACH;EAEA,MAAMG,QAAQ,GAAGP,WAAW,CAAC,CAAC;EAC9B,MAAMQ,KAAK,GAAGP,WAAW,CAACQ,IAAA;IAAA,IAAAC,QAAA;IAAA,IAAC;MAAEC;IAAO,CAAC,GAAAF,IAAA;IAAA,OACnCG,qBAAA,CAAAF,QAAA,GAAAC,MAAM,CAACA,MAAM,EAAAE,IAAA,CAAAH,QAAA,EAAOI,CAAC,IAAKA,CAAC,CAACC,GAAG,KAAKT,OAAO,CAAC;EAAA,CAC9C,CAAC;EAED,MAAMU,IAAI,GAAGjB,WAAW,CAAC,MAAM;IAC7BQ,QAAQ,CAACL,SAAS,CAACI,OAAO,CAAC,CAAC;EAC9B,CAAC,EAAE,CAACC,QAAQ,EAAED,OAAO,CAAC,CAAC;EAEvB,MAAMW,KAAK,GAAGlB,WAAW,CAAC,MAAM;IAC9BQ,QAAQ,CAACJ,UAAU,CAACG,OAAO,CAAC,CAAC;EAC/B,CAAC,EAAE,CAACC,QAAQ,EAAED,OAAO,CAAC,CAAC;EAEvB,OAAO;IACLS,GAAG,EAAEP,KAAK,GAAGA,KAAK,CAACO,GAAG,GAAG,IAAI;IAC7BG,IAAI,EAAEV,KAAK,GAAGA,KAAK,CAACU,IAAI,GAAG,IAAI;IAC/BC,OAAO,EAAEX,KAAK,GAAGA,KAAK,CAACW,OAAO,GAAG,KAAK;IACtCH,IAAI;IACJC;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"useModal.js","names":["useCallback","useDispatch","useSelector","showModal","closeModal","IllegalArgumentException","useModal","modalId","dispatch","modal","_ref","_context","modals","_findInstanceProperty","call","m","key","show","close","size","visible"],"sources":["../../src/hooks/useModal.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nimport { showModal, closeModal } from \"../redux/actions/Modals\";\nimport { IllegalArgumentException } from \"../exceptions\";\n\ntype ModalHook = (modalId: string) => {\n key: string | null,\n size: string | null,\n visible: boolean,\n show: () => void,\n close: () => void,\n};\n\n/**\n * Manage modals\n */\nexport const useModal: ModalHook = (modalId: string) => {\n if (!modalId) {\n throw new IllegalArgumentException(\n \"Missing modalId argument for useModal hook\",\n );\n }\n\n const dispatch = useDispatch();\n const modal = useSelector(({ modals }) =>\n modals.modals.find((m) => m.key === modalId),\n );\n\n const show = useCallback(() => {\n dispatch(showModal(modalId));\n }, [dispatch, modalId]);\n\n const close = useCallback(() => {\n dispatch(closeModal(modalId));\n }, [dispatch, modalId]);\n\n return {\n key: modal ? modal.key : null,\n size: modal ? modal.size : null,\n visible: modal ? modal.visible : false,\n show,\n close,\n };\n};\n"],"mappings":";AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAEtD,SAASC,SAAS,EAAEC,UAAU,QAAQ,yBAAyB;AAC/D,SAASC,wBAAwB,QAAQ,eAAe;AAUxD;AACA;AACA;AACA,OAAO,MAAMC,QAAmB,GAAIC,OAAe,IAAK;EACtD,IAAI,CAACA,OAAO,EAAE;IACZ,MAAM,IAAIF,wBAAwB,CAChC,4CACF,CAAC;EACH;EAEA,MAAMG,QAAQ,GAAGP,WAAW,CAAC,CAAC;EAC9B,MAAMQ,KAAK,GAAGP,WAAW,CAACQ,IAAA;IAAA,IAAAC,QAAA;IAAA,IAAC;MAAEC;IAAO,CAAC,GAAAF,IAAA;IAAA,OACnCG,qBAAA,CAAAF,QAAA,GAAAC,MAAM,CAACA,MAAM,EAAAE,IAAA,CAAAH,QAAA,EAAOI,CAAC,IAAKA,CAAC,CAACC,GAAG,KAAKT,OAAO,CAAC;EAAA,CAC9C,CAAC;EAED,MAAMU,IAAI,GAAGjB,WAAW,CAAC,MAAM;IAC7BQ,QAAQ,CAACL,SAAS,CAACI,OAAO,CAAC,CAAC;EAC9B,CAAC,EAAE,CAACC,QAAQ,EAAED,OAAO,CAAC,CAAC;EAEvB,MAAMW,KAAK,GAAGlB,WAAW,CAAC,MAAM;IAC9BQ,QAAQ,CAACJ,UAAU,CAACG,OAAO,CAAC,CAAC;EAC/B,CAAC,EAAE,CAACC,QAAQ,EAAED,OAAO,CAAC,CAAC;EAEvB,OAAO;IACLS,GAAG,EAAEP,KAAK,GAAGA,KAAK,CAACO,GAAG,GAAG,IAAI;IAC7BG,IAAI,EAAEV,KAAK,GAAGA,KAAK,CAACU,IAAI,GAAG,IAAI;IAC/BC,OAAO,EAAEX,KAAK,GAAGA,KAAK,CAACW,OAAO,GAAG,KAAK;IACtCH,IAAI;IACJC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with";
2
1
  import { useLocation } from "./useRouter";
2
+ import { createHref, filterParameters } from "../utils/helpers/createHref";
3
3
  import ModelCatalogModel from "../models/modelcatalog/ModelCatalogModel";
4
4
  import ConceptIndexModel from "../models/concepts/ConceptIndexModel";
5
5
  import ConceptDetailModel from "../models/concepts/ConceptDetailModel";
@@ -9,6 +9,7 @@ import ContentTOCModel from "../models/content/ContentTOCModel";
9
9
  import ContentModel from "../models/content/ContentModel";
10
10
  import { useModularUIBasic } from "./useModularUIBasic";
11
11
  import { ContentTypeModel } from "../models";
12
+
12
13
  /**
13
14
  */
14
15
  export const useModelCatalog = () => useModularUIBasic("modelcatalog", "/modelcatalog", {
@@ -18,27 +19,19 @@ export const useModelCatalog = () => useModularUIBasic("modelcatalog", "/modelca
18
19
 
19
20
  /**
20
21
  */
21
- export const useConceptIndex = href => useModularUIBasic("conceptindex", href, {
22
- expectedModels: ["ConceptIndex"],
23
- targetModel: ConceptIndexModel
24
- });
25
- const getHref = (context, dynamic, location) => {
26
- let href = dynamic;
27
- if (!_startsWithInstanceProperty(href).call(href, `/${context}/`)) {
28
- href = `/${context}/${href}`;
29
- }
30
- href = href.replace(/\/\//g, "/");
31
- if (location?.search) {
32
- href = `${href}${location.search}`;
33
- }
34
- return href;
22
+ export const useConceptIndex = href => {
23
+ const url = filterParameters(href, ["entryDate", "index", "label", "type"]);
24
+ return useModularUIBasic("conceptindex", url, {
25
+ expectedModels: ["ConceptIndex"],
26
+ targetModel: ConceptIndexModel
27
+ });
35
28
  };
36
29
 
37
30
  /**
38
31
  */
39
32
  export const useConceptDetail = concept => {
40
33
  const location = useLocation();
41
- const href = getHref("concepts", concept, location);
34
+ const href = createHref("concepts", concept, location, ["entryDate"]);
42
35
  return useModularUIBasic("conceptdetail", href, {
43
36
  expectedModels: ["ConceptDetail", "BusinessScenario"]
44
37
  });
@@ -46,16 +39,19 @@ export const useConceptDetail = concept => {
46
39
 
47
40
  /**
48
41
  */
49
- export const useContentIndex = href => useModularUIBasic("contentindex", href, {
50
- expectedModels: ["ContentIndex"],
51
- targetModel: ContentIndexModel
52
- });
42
+ export const useContentIndex = href => {
43
+ const url = filterParameters(href, ["index", "label", "type"]);
44
+ return useModularUIBasic("contentindex", url, {
45
+ expectedModels: ["ContentIndex"],
46
+ targetModel: ContentIndexModel
47
+ });
48
+ };
53
49
 
54
50
  /**
55
51
  */
56
52
  export const useContentTOC = content => {
57
53
  const location = useLocation();
58
- const href = getHref("content", content, location);
54
+ const href = createHref("content", content, location, ["entryDate"]);
59
55
  return useModularUIBasic("contenttoc", href, {
60
56
  expectedModels: ["ContentTOC"],
61
57
  targetModel: ContentTOCModel
@@ -65,7 +61,7 @@ export const useContentTOC = content => {
65
61
  /**
66
62
  */
67
63
  export const useContent = contentSection => {
68
- const href = getHref("content", contentSection);
64
+ const href = createHref("content", contentSection, null, ["entryDate"]);
69
65
  return useModularUIBasic("content", href, {
70
66
  expectedModels: ["Content"],
71
67
  targetModel: ContentModel
@@ -75,7 +71,7 @@ export const useContent = contentSection => {
75
71
  /**
76
72
  */
77
73
  export const useContentType = contentType => {
78
- const href = getHref("contenttypes", contentType);
74
+ const href = createHref("contenttypes", contentType, null, ["entryDate"]);
79
75
  return useModularUIBasic("contenttypes", href, {
80
76
  expectedModels: ["ContentType"],
81
77
  targetModel: ContentTypeModel
@@ -1 +1 @@
1
- {"version":3,"file":"useModelCatalog.js","names":["useLocation","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","default","BusinessScenarioModel","ContentIndexModel","ContentTOCModel","ContentModel","useModularUIBasic","ContentTypeModel","useModelCatalog","expectedModels","targetModel","useConceptIndex","href","getHref","context","dynamic","location","_startsWithInstanceProperty","call","replace","search","useConceptDetail","concept","useContentIndex","useContentTOC","content","useContent","contentSection","useContentType","contentType"],"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,SAASA,WAAW,QAAQ,aAAa;AAEzC,OAAOC,iBAAiB,MAAM,0CAA0C;AACxE,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,kBAAkB,MAAM,uCAA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ConceptIndexModel","ConceptDetailModel","default","BusinessScenarioModel","ContentIndexModel","ContentTOCModel","ContentModel","useModularUIBasic","ContentTypeModel","useModelCatalog","expectedModels","targetModel","useConceptIndex","href","url","useConceptDetail","concept","location","useContentIndex","useContentTOC","content","useContent","contentSection","useContentType","contentType"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\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 const url = filterParameters(href, [\"entryDate\", \"index\", \"label\", \"type\"]);\n return useModularUIBasic(\"conceptindex\", url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string,\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, location, [\"entryDate\"]);\n return useModularUIBasic(\"conceptdetail\", href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (href: string): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(\"contentindex\", url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n};\n\n/**\n */\nexport const useContentTOC = (content: string): ?ContentTOCModel => {\n const location = useLocation();\n const href = createHref(\"content\", content, location, [\"entryDate\"]);\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 = createHref(\"content\", contentSection, null, [\"entryDate\"]);\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 = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(\"contenttypes\", href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,aAAa;AAEzC,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,6BAA6B;AAE1E,OAAOC,iBAAiB,MAAM,0CAA0C;AACxE,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,kBAAkB,MAAM,uCAAuC;AACtE,SAASC,OAAO,IAAIC,qBAAqB,QAAQ,0CAA0C;AAC3F,OAAOC,iBAAiB,MAAM,qCAAqC;AACnE,OAAOC,eAAe,MAAM,mCAAmC;AAC/D,OAAOC,YAAY,MAAM,gCAAgC;AAEzD,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,gBAAgB,QAAQ,WAAW;;AAE5C;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAC7BF,iBAAiB,CAAC,cAAc,EAAE,eAAe,EAAE;EACjDG,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEZ;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMa,eAAe,GAAIC,IAAY,IAAyB;EACnE,MAAMC,GAAG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;AAED;AACA;AACA,OAAO,MAAMgB,UAAU,GAAIC,cAAsB,IAAoB;EACnE,MAAMT,IAAI,GAAGhB,UAAU,CAAC,SAAS,EAAEyB,cAAc,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC;EACvE,OAAOf,iBAAiB,CAAC,SAAS,EAAEM,IAAI,EAAE;IACxCH,cAAc,EAAE,CAAC,SAAS,CAAC;IAC3BC,WAAW,EAAEL;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA,OAAO,MAAMiB,cAAc,GAAIC,WAAmB,IAAwB;EACxE,MAAMX,IAAI,GAAGhB,UAAU,CAAC,cAAc,EAAE2B,WAAW,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC;EACzE,OAAOjB,iBAAiB,CAAC,cAAc,EAAEM,IAAI,EAAE;IAC7CH,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/BC,WAAW,EAAEH;EACf,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1,13 +1,27 @@
1
- import { useDispatch } from "react-redux";
1
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
2
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
3
+ import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
4
+ import { useSelector, useDispatch } from "react-redux";
2
5
  import { reloadModel } from "../redux/_modularui/ModularUIActions";
6
+ import { MODULARUI_STATUS } from "../constants/Constants";
3
7
  /**
4
8
  * Hook that contains the reload property that can be used to reload a model
5
9
  */
6
10
  export const useModels = () => {
7
11
  const dispatch = useDispatch();
12
+ const modularuiModels = useSelector(state => {
13
+ var _context, _context2;
14
+ return _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = _Object$values(state.modularui)).call(_context2, model => model.status === MODULARUI_STATUS.FINISHED)).call(_context, model => model.model);
15
+ });
8
16
  return {
9
17
  reload: (model, options) => {
10
18
  dispatch(reloadModel(model, options));
19
+ },
20
+ reloadWithFilter: (callbackFn, options) => {
21
+ const modelsToReload = _filterInstanceProperty(modularuiModels).call(modularuiModels, callbackFn);
22
+ for (const modelToReload of modelsToReload) {
23
+ dispatch(reloadModel(modelToReload, options));
24
+ }
11
25
  }
12
26
  };
13
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useModels.js","names":["useDispatch","reloadModel","useModels","dispatch","reload","model","options"],"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,SAASA,WAAW,QAAQ,aAAa;AAEzC,SAASC,WAAW,QAAQ,sCAAsC;AAQlE;AACA;AACA;AACA,OAAO,MAAMC,SAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,QAAQ,GAAGH,WAAW,CAAC,CAAC;EAC9B,OAAO;IACLI,MAAM,EAAEA,CAACC,KAAqB,EAAEC,OAAgB,KAAK;MACnDH,QAAQ,CAACF,WAAW,CAACI,KAAK,EAAEC,OAAO,CAAC,CAAC;IACvC;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"useModels.js","names":["useSelector","useDispatch","reloadModel","MODULARUI_STATUS","useModels","dispatch","modularuiModels","state","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","_Object$values","modularui","call","model","status","FINISHED","reload","options","reloadWithFilter","callbackFn","modelsToReload","modelToReload"],"sources":["../../src/hooks/useModels.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\n\nimport { reloadModel } from \"../redux/_modularui/ModularUIActions\";\nimport { MODULARUI_STATUS } from \"../constants/Constants\";\n\nimport type { ModularUIModel } from \"../models/types\";\n\ntype ReloadCallback = (model: ModularUIModel) => boolean;\n\ntype UseModels = () => {\n reload: (model: ModularUIModel, options?: any) => void,\n reloadWithFilter: (callbackFn: ReloadCallback, 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 const modularuiModels = useSelector((state) =>\n Object.values(state.modularui)\n .filter((model) => model.status === MODULARUI_STATUS.FINISHED)\n .map((model) => model.model),\n );\n\n return {\n reload: (model: ModularUIModel, options?: Object) => {\n dispatch(reloadModel(model, options));\n },\n reloadWithFilter: (callbackFn: ReloadCallback, options?: Object) => {\n const modelsToReload = modularuiModels.filter(callbackFn);\n for (const modelToReload of modelsToReload) {\n dispatch(reloadModel(modelToReload, options));\n }\n },\n };\n};\n"],"mappings":";;;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAEtD,SAASC,WAAW,QAAQ,sCAAsC;AAClE,SAASC,gBAAgB,QAAQ,wBAAwB;AAWzD;AACA;AACA;AACA,OAAO,MAAMC,SAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,QAAQ,GAAGJ,WAAW,CAAC,CAAC;EAC9B,MAAMK,eAAe,GAAGN,WAAW,CAAEO,KAAK;IAAA,IAAAC,QAAA,EAAAC,SAAA;IAAA,OACxCC,oBAAA,CAAAF,QAAA,GAAAG,uBAAA,CAAAF,SAAA,GAAAG,cAAA,CAAcL,KAAK,CAACM,SAAS,CAAC,EAAAC,IAAA,CAAAL,SAAA,EACnBM,KAAK,IAAKA,KAAK,CAACC,MAAM,KAAKb,gBAAgB,CAACc,QAAQ,CAAC,EAAAH,IAAA,CAAAN,QAAA,EACxDO,KAAK,IAAKA,KAAK,CAACA,KAAK,CAAC;EAAA,CAChC,CAAC;EAED,OAAO;IACLG,MAAM,EAAEA,CAACH,KAAqB,EAAEI,OAAgB,KAAK;MACnDd,QAAQ,CAACH,WAAW,CAACa,KAAK,EAAEI,OAAO,CAAC,CAAC;IACvC,CAAC;IACDC,gBAAgB,EAAEA,CAACC,UAA0B,EAAEF,OAAgB,KAAK;MAClE,MAAMG,cAAc,GAAGX,uBAAA,CAAAL,eAAe,EAAAQ,IAAA,CAAfR,eAAe,EAAQe,UAAU,CAAC;MACzD,KAAK,MAAME,aAAa,IAAID,cAAc,EAAE;QAC1CjB,QAAQ,CAACH,WAAW,CAACqB,aAAa,EAAEJ,OAAO,CAAC,CAAC;MAC/C;IACF;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUI.js","names":["useEffect","useRef","useDispatch","useSelector","HTTP_METHODS","loadModularUI","removeModelByKey","useDeepCompareEffect","useLocale","useKeyForHook","modelKey","url","locale","split","useModularUI","options","arguments","length","undefined","method","GET","removeOnUnmount","dispatch","href","toString","key","prevOptions","prevHref","isOldReload","current","isReload","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 { RequestModularUIOptions } 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: RequestModularUIOptions = {\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,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAEtD,SAASC,YAAY,QAAQ,cAAc;AAC3C,SACEC,aAAa,EACbC,gBAAgB,QACX,sCAAsC;AAE7C,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,SAASC,SAAS,QAAQ,WAAW;AAKrC;AACA;AACA,MAAMC,aAAa,GAAGA,CAACC,QAAgB,EAAEC,GAAW,KAAK;EACvD,MAAMC,MAAM,GAAGJ,SAAS,CAAC,CAAC;EAC1B,OAAQ,GAAEE,QAAS,IAAGC,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,KAAID,MAAO,GAAE;AACvD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAME,YAAY,GAAG,SAAAA,CAC1BJ,QAAgB,EAChBC,GAAkB,EAKV;EAAA,IAJRI,OAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IACjCG,MAAM,EAAEf,YAAY,CAACgB,GAAG;IACxBC,eAAe,EAAE;EACnB,CAAC;EAED,MAAMC,QAAQ,GAAGpB,WAAW,CAAC,CAAC;EAC9B,MAAMqB,IAAI,GAAGZ,GAAG,CAACa,QAAQ,CAAC,CAAC;EAC3B,MAAMC,GAAG,GAAGhB,aAAa,CAACC,QAAQ,EAAEa,IAAI,CAAC;EAEzC,MAAMG,WAAW,GAAGzB,MAAM,CAACc,OAAO,CAAC;EACnC,MAAMY,QAAQ,GAAG1B,MAAM,CAACsB,IAAI,CAAC;;EAE7B;EACAhB,oBAAoB,CAAC,MAAM;IACzB;IACA,MAAMqB,WAAW,GACfD,QAAQ,CAACE,OAAO,KAAKN,IAAI,IACzBG,WAAW,CAACG,OAAO,CAACC,QAAQ,IAC5B,CAACf,OAAO,CAACe,QAAQ;IAEnB,IAAI,CAACF,WAAW,EAAE;MAChBN,QAAQ,CAACjB,aAAa,CAACoB,GAAG,EAAEF,IAAI,EAAER,OAAO,CAAC,CAAC;IAC7C;IAEAW,WAAW,CAACG,OAAO,GAAGd,OAAO;IAC7BY,QAAQ,CAACE,OAAO,GAAGN,IAAI;EACzB,CAAC,EAAE,CAACE,GAAG,EAAEF,IAAI,EAAER,OAAO,CAAC,CAAC;EAExB,MAAM;IAAEM,eAAe,GAAG;EAAM,CAAC,GAAGN,OAAO;EAC3Cf,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACX,IAAIqB,eAAe,EAAE;QACnBC,QAAQ,CAAChB,gBAAgB,CAACmB,GAAG,CAAC,CAAC;MACjC;IACF,CAAC;EACH,CAAC,EAAE,CAACH,QAAQ,EAAEG,GAAG,EAAEJ,eAAe,CAAC,CAAC;;EAEpC;EACA,OAAOlB,WAAW,CAAE4B,KAAK,IAAK;IAC5B,OAAOA,KAAK,CAACC,SAAS,CAACP,GAAG,CAAC;EAC7B,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"useModularUI.js","names":["useEffect","useRef","useDispatch","useSelector","HTTP_METHODS","loadModularUI","removeModelByKey","useDeepCompareEffect","useLocale","useKeyForHook","modelKey","url","locale","split","useModularUI","options","arguments","length","undefined","method","GET","removeOnUnmount","dispatch","href","toString","key","prevOptions","prevHref","isOldReload","current","isReload","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 { RequestModularUIOptions } 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: RequestModularUIOptions = {\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,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAEtD,SAASC,YAAY,QAAQ,cAAc;AAC3C,SACEC,aAAa,EACbC,gBAAgB,QACX,sCAAsC;AAE7C,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,SAASC,SAAS,QAAQ,WAAW;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G;EAAM,CAAC,GAAGN,OAAO;EAC3Cf,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACX,IAAIqB,eAAe,EAAE;QACnBC,QAAQ,CAAChB,gBAAgB,CAACmB,GAAG,CAAC,CAAC;MACjC;IACF,CAAC;EACH,CAAC,EAAE,CAACH,QAAQ,EAAEG,GAAG,EAAEJ,eAAe,CAAC,CAAC;;EAEpC;EACA,OAAOlB,WAAW,CAAE4B,KAAK,IAAK;IAC5B,OAAOA,KAAK,CAACC,SAAS,CAACP,GAAG,CAAC;EAC7B,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUIBasic.js","names":["useModularUI","useLocation","IllegalArgumentException","IllegalStateException","useModularUIBasic","key","href","_context","options","arguments","length","undefined","expectedModels","targetModel","forceTargetModel","location","useModularUIOptions","isReload","state","reload","_startsWithInstanceProperty","pathname","call","toString","modularUI","model","isCorrectModel","some","expectedModel","type","console","error"],"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: ModularUIModel> = {\n expectedModels: Array<string>,\n targetModel?: Class<T> | Array<Class<T>>,\n forceTargetModel?: boolean,\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 forceTargetModel: false,\n },\n): T | null => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = {\n targetModel: undefined,\n forceTargetModel: undefined,\n isReload: false,\n };\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n useModularUIOptions.forceTargetModel = options.forceTargetModel;\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 // $FlowFixMe[incompatible-call]\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 return null;\n};\n"],"mappings":";AACA,SAASA,YAAY,QAAQ,gBAAgB;AAE7C,SAASC,WAAW,QAAQ,aAAa;AAEzC,SAASC,wBAAwB,EAAEC,qBAAqB,QAAQ,eAAe;AAU/E;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG,SAAAA,CAC/BC,GAAW,EACXC,IAAmB,EAMN;EAAA,IAAAC,QAAA;EAAA,IALbC,OAAoC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IACrCG,cAAc,EAAE,EAAE;IAClBC,WAAW,EAAEF,SAAS;IACtBG,gBAAgB,EAAE;EACpB,CAAC;EAED,MAAMC,QAAQ,GAAGd,WAAW,CAAC,CAAC;EAC9B,IAAI,CAACK,IAAI,EAAE;IACT,MAAM,IAAIJ,wBAAwB,CAAC,cAAc,CAAC;EACpD;EAEA,MAAMc,mBAAmB,GAAG;IAC1BH,WAAW,EAAEF,SAAS;IACtBG,gBAAgB,EAAEH,SAAS;IAC3BM,QAAQ,EAAE;EACZ,CAAC;EACD,IAAIT,OAAO,CAACK,WAAW,EAAE;IACvBG,mBAAmB,CAACH,WAAW,GAAGL,OAAO,CAACK,WAAW;IACrDG,mBAAmB,CAACF,gBAAgB,GAAGN,OAAO,CAACM,gBAAgB;EACjE;;EAEA;EACA,IAAIC,QAAQ,CAACG,KAAK,EAAEC,MAAM,IAAIC,2BAAA,CAAAb,QAAA,GAAAQ,QAAQ,CAACM,QAAQ,EAAAC,IAAA,CAAAf,QAAA,EAAYD,IAAI,CAACiB,QAAQ,CAAC,CAAC,CAAC,EAAE;IAC3EP,mBAAmB,CAACC,QAAQ,GAAG,IAAI;EACrC;;EAEA;EACA,MAAMO,SAAS,GAAGxB,YAAY,CAACK,GAAG,EAAEC,IAAI,EAAEU,mBAAmB,CAAC;EAE9D,IAAIQ,SAAS,EAAEC,KAAK,EAAE;IACpB,MAAM;MAAEA;IAAM,CAAC,GAAGD,SAAS;IAC3B,IAAIhB,OAAO,CAACI,cAAc,CAACF,MAAM,GAAG,CAAC,EAAE;MACrC,MAAMgB,cAAc,GAAGlB,OAAO,CAACI,cAAc,CAACe,IAAI,CAAEC,aAAa,IAAK;QACpE,OAAOH,KAAK,CAACI,IAAI,KAAKD,aAAa;MACrC,CAAC,CAAC;MAEF,IAAI,CAACF,cAAc,EAAE;QACnBI,OAAO,CAACC,KAAK,CAACP,SAAS,EAAE,oBAAoB,EAAEhB,OAAO,CAACI,cAAc,CAAC;QACtE,MAAM,IAAIT,qBAAqB,CAAC,mCAAmC,CAAC;MACtE;IACF;IAEA,OAAOsB,KAAK;EACd;EAEA,OAAO,IAAI;AACb,CAAC"}
1
+ {"version":3,"file":"useModularUIBasic.js","names":["useModularUI","useLocation","IllegalArgumentException","IllegalStateException","useModularUIBasic","key","href","_context","options","arguments","length","undefined","expectedModels","targetModel","forceTargetModel","location","useModularUIOptions","isReload","state","reload","_startsWithInstanceProperty","pathname","call","toString","modularUI","model","isCorrectModel","some","expectedModel","type","console","error"],"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: ModularUIModel> = {\n expectedModels: Array<string>,\n targetModel?: Class<T> | Array<Class<T>>,\n forceTargetModel?: boolean,\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 forceTargetModel: false,\n },\n): T | null => {\n const location = useLocation();\n if (!href) {\n throw new IllegalArgumentException(\"Missing href\");\n }\n\n const useModularUIOptions = {\n targetModel: undefined,\n forceTargetModel: undefined,\n isReload: false,\n };\n if (options.targetModel) {\n useModularUIOptions.targetModel = options.targetModel;\n useModularUIOptions.forceTargetModel = options.forceTargetModel;\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 // $FlowFixMe[incompatible-call]\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 return null;\n};\n"],"mappings":";AACA,SAASA,YAAY,QAAQ,gBAAgB;AAE7C,SAASC,WAAW,QAAQ,aAAa;AAEzC,SAASC,wBAAwB,EAAEC,qBAAqB,QAAQ,eAAe;AAU/E;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG,SAAAA,CAC/BC,GAAW,EACXC,IAAmB,EAMN;EAAA,IAAAC,QAAA;EAAA,IALbC,OAAoC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IACrCG,cAAc,EAAE,EAAE;IAClBC,WAAW,EAAEF,SAAS;IACtBG,gBAAgB,EAAE;EACpB,CAAC;EAED,MAAMC,QAAQ,GAAGd,WAAW,CAAC,CAAC;EAC9B,IAAI,CAACK,IAAI,EAAE;IACT,MAAM,IAAIJ,wBAAwB,CAAC,cAAc,CAAC;EACpD;EAEA,MAAMc,mBAAmB,GAAG;IAC1BH,WAAW,EAAEF,SAAS;IACtBG,gBAAgB,EAAEH,SAAS;IAC3BM,QAAQ,EAAE;EACZ,CAAC;EACD,IAAIT,OAAO,CAACK,WAAW,EAAE;IACvBG,mBAAmB,CAACH,WAAW,GAAGL,OAAO,CAACK,WAAW;IACrDG,mBAAmB,CAACF,gBAAgB,GAAGN,OAAO,CAACM,gBAAgB;EACjE;;EAEA;EACA,IAAIC,QAAQ,CAACG,KAAK,EAAEC,MAAM,IAAIC,2BAAA,CAAAb,QAAA,GAAAQ,QAAQ,CAACM,QAAQ,EAAAC,IAAA,CAAAf,QAAA,EAAYD,IAAI,CAACiB,QAAQ,CAAC,CAAC,CAAC,EAAE;IAC3EP,mBAAmB,CAACC,QAAQ,GAAG,IAAI;EACrC;;EAEA;EACA,MAAMO,SAAS,GAAGxB,YAAY,CAACK,GAAG,EAAEC,IAAI,EAAEU,mBAAmB,CAAC;EAE9D,IAAIQ,SAAS,EAAEC,KAAK,EAAE;IACpB,MAAM;MAAEA;IAAM,CAAC,GAAGD,SAAS;IAC3B,IAAIhB,OAAO,CAACI,cAAc,CAACF,MAAM,GAAG,CAAC,EAAE;MACrC,MAAMgB,cAAc,GAAGlB,OAAO,CAACI,cAAc,CAACe,IAAI,CAAEC,aAAa,IAAK;QACpE,OAAOH,KAAK,CAACI,IAAI,KAAKD,aAAa;MACrC,CAAC,CAAC;MAEF,IAAI,CAACF,cAAc,EAAE;QACnBI,OAAO,CAACC,KAAK,CAACP,SAAS,EAAE,oBAAoB,EAAEhB,OAAO,CAACI,cAAc,CAAC;QACtE,MAAM,IAAIT,qBAAqB,CAAC,mCAAmC,CAAC;MACtE;IACF;IAEA,OAAOsB,KAAK;EACd;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUIModel.js","names":["ApplicationModel","CaseViewModel","TabModel","ListModel","GroupingPanelModel","DetailModel","CaseSearchModel","ListDetailModel","UserProfileModel","useModularUIBasic","useApplication","expectedModels","targetModel","useTab","href","useCaseView","usePanel","useList","useListOrDetail","useListDetail","forceTargetModel","useGroupingPanel","useDetailPanel","useQuicksearch","useSearch","useUserProfile"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\n/**\n * Load application\n */\nexport const useApplication = (): ApplicationModel | null =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (href: string): TabModel | null =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (href: string): CaseViewModel | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n });\n\n/**\n */\nexport const usePanel = (\n href: string,\n): ListModel | GroupingPanelModel | DetailModel | null =>\n useModularUIBasic(\"panel\", href, {\n expectedModels: [\"List\", \"GroupingPanel\", \"Detail\"],\n });\n\n/**\n */\nexport const useList = (href: string): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n });\n\n/**\n */\nexport const useListOrDetail = (href: string): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n targetModel: [ListModel, DetailModel],\n });\n\n/**\n */\nexport const useListDetail = (href: string): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n });\n\n/**\n */\nexport const useGroupingPanel = (href: string): GroupingPanelModel | null =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n });\n\n/**\n */\nexport const useDetailPanel = (href: string): DetailModel | null =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n });\n\n/**\n */\nexport const useQuicksearch = (href: string): CaseSearchModel | null =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useSearch = (href: string): CaseSearchModel | null =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useUserProfile = (href: string): UserProfileModel | null =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n });\n"],"mappings":"AACA,OAAOA,gBAAgB,MAAM,wCAAwC;AACrE,OAAOC,aAAa,MAAM,kCAAkC;AAC5D,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,kBAAkB,MAAM,qCAAqC;AACpE,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,eAAe,MAAM,kCAAkC;AAC9D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,gBAAgB,MAAM,iCAAiC;AAE9D,SAASC,iBAAiB,QAAQ,qBAAqB;;AAEvD;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAC5BD,iBAAiB,CAAC,aAAa,EAAE,GAAG,EAAE;EACpCE,cAAc,EAAE,CAAC,aAAa,CA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,CAAC,eAAe,EAAEK,IAAI,EAAE;EACvCH,cAAc,EAAE,CAAC,eAAe,CAAC;EACjCC,WAAW,EAAER;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMkB,cAAc,GAAIR,IAAY,IACzCL,iBAAiB,CAAC,aAAa,EAAEK,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,QAAQ,CAAC;EAC1BC,WAAW,EAAEP;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMkB,cAAc,GAAIT,IAAY,IACzCL,iBAAiB,CAAC,aAAa,EAAEK,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMkB,SAAS,GAAIV,IAAY,IACpCL,iBAAiB,CAAC,QAAQ,EAAEK,IAAI,EAAE;EAChCH,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMmB,cAAc,GAAIX,IAAY,IACzCL,iBAAiB,CAAC,aAAa,EAAEK,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEJ;AACf,CAAC,CAAC"}
1
+ {"version":3,"file":"useModularUIModel.js","names":["ApplicationModel","CaseViewModel","TabModel","ListModel","GroupingPanelModel","DetailModel","CaseSearchModel","ListDetailModel","UserProfileModel","useModularUIBasic","useApplication","expectedModels","targetModel","useTab","href","useCaseView","usePanel","useList","useListOrDetail","useListDetail","forceTargetModel","useGroupingPanel","useDetailPanel","useQuicksearch","useSearch","useUserProfile"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\n/**\n * Load application\n */\nexport const useApplication = (): ApplicationModel | null =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (href: string): TabModel | null =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (href: string): CaseViewModel | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n });\n\n/**\n */\nexport const usePanel = (\n href: string,\n): ListModel | GroupingPanelModel | DetailModel | null =>\n useModularUIBasic(\"panel\", href, {\n expectedModels: [\"List\", \"GroupingPanel\", \"Detail\"],\n });\n\n/**\n */\nexport const useList = (href: string): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n });\n\n/**\n */\nexport const useListOrDetail = (href: string): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n targetModel: [ListModel, DetailModel],\n });\n\n/**\n */\nexport const useListDetail = (href: string): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n });\n\n/**\n */\nexport const useGroupingPanel = (href: string): GroupingPanelModel | null =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n });\n\n/**\n */\nexport const useDetailPanel = (href: string): DetailModel | null =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n });\n\n/**\n */\nexport const useQuicksearch = (href: string): CaseSearchModel | null =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useSearch = (href: string): CaseSearchModel | null =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n });\n\n/**\n */\nexport const useUserProfile = (href: string): UserProfileModel | null =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n });\n"],"mappings":"AACA,OAAOA,gBAAgB,MAAM,wCAAwC;AACrE,OAAOC,aAAa,MAAM,kCAAkC;AAC5D,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,kBAAkB,MAAM,qCAAqC;AACpE,OAAOC,WAAW,MAAM,8BAA8B;AACtD,OAAOC,eAAe,MAAM,kCAAkC;AAC9D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,gBAAgB,MAAM,iCAAiC;AAE9D,SAASC,iBAAiB,QAAQ,qBAAqB;;AAEvD;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAC5BD,iBAAiB,CAAC,aAAa,EAAE,GAAG,EAAE;EACpCE,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEZ;AACf,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,OAAO,MAAMa,MAAM,GAAIC,IAAY,IACjCL,iBAAiB,CAAC,KAAK,EAAEK,IAAI,EAAE;EAC7BH,cAAc,EAAE,CAAC,KAAK,CAAC;EACvBC,WAAW,EAAEV;AACf,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,OAAO,MAAMa,WAAW,GAAID,IAAY,IACtCL,iBAAiB,CAAC,UAAU,EAAEK,IAAI,EAAE;EAClCH,cAAc,EAAE,CAAC,UAA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AC,aAAa,EAAEK,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMkB,SAAS,GAAIV,IAAY,IACpCL,iBAAiB,CAAC,QAAQ,EAAEK,IAAI,EAAE;EAChCH,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEN;AACf,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMmB,cAAc,GAAIX,IAAY,IACzCL,iBAAiB,CAAC,aAAa,EAAEK,IAAI,EAAE;EACrCH,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEJ;AACf,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useModularUIRequest.js","names":["createSelector","useSelector","ModularUIRequest","getLocale","getModularUIRequest","localeCode","href","options","request","locale","useModularUIRequest"],"sources":["../../src/hooks/useModularUIRequest.js"],"sourcesContent":["// @flow\nimport { createSelector } from \"reselect\";\nimport { useSelector } from \"react-redux\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport type { RequestModularUIOptions } from \"../utils\";\nimport type Href from \"../models/href/Href\";\n\nconst getModularUIRequest = createSelector([getLocale], (localeCode) => {\n return (href: Href, options?: $Shape<RequestModularUIOptions>) => {\n const request = new ModularUIRequest(href, options);\n request.locale = localeCode;\n return request;\n };\n});\n\n/**\n * Creates a ModularUIRequest with the locale as available in the redux store\n */\nexport const useModularUIRequest = (): ((\n href: Href,\n options?: $Shape<RequestModularUIOptions>,\n) => ModularUIRequest) => useSelector(getModularUIRequest);\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,UAAU;AACzC,SAASC,WAAW,QAAQ,aAAa;AAEzC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,SAASC,SAAS,QAAQ,yBAAyB;AAKnD,MAAMC,mBAAmB,GAAGJ,cAAc,CAAC,CAACG,SAAS,CAAC,EAAGE,UAAU,IAAK;EACtE,OAAO,CAACC,IAAU,EAAEC,OAAyC,KAAK;IAChE,MAAMC,OAAO,GAAG,IAAIN,gBAAgB,CAACI,IAAI,EAAEC,OAAO,CAAC;IACnDC,OAAO,CAACC,MAAM,GAAGJ,UAAU;IAC3B,OAAOG,OAAO;EAChB,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAME,mBAAmB,GAAGA,CAAA,KAGTT,WAAW,CAACG,mBAAmB,CAAC"}
1
+ {"version":3,"file":"useModularUIRequest.js","names":["createSelector","useSelector","ModularUIRequest","getLocale","getModularUIRequest","localeCode","href","options","request","locale","useModularUIRequest"],"sources":["../../src/hooks/useModularUIRequest.js"],"sourcesContent":["// @flow\nimport { createSelector } from \"reselect\";\nimport { useSelector } from \"react-redux\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport type { RequestModularUIOptions } from \"../utils\";\nimport type Href from \"../models/href/Href\";\n\nconst getModularUIRequest = createSelector([getLocale], (localeCode) => {\n return (href: Href, options?: $Shape<RequestModularUIOptions>) => {\n const request = new ModularUIRequest(href, options);\n request.locale = localeCode;\n return request;\n };\n});\n\n/**\n * Creates a ModularUIRequest with the locale as available in the redux store\n */\nexport const useModularUIRequest = (): ((\n href: Href,\n options?: $Shape<RequestModularUIOptions>,\n) => ModularUIRequest) => useSelector(getModularUIRequest);\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,UAAU;AACzC,SAASC,WAAW,QAAQ,aAAa;AAEzC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,SAASC,SAAS,QAAQ,yBAAyB;AAKnD,MAAMC,mBAAmB,GAAGJ,cAAc,CAAC,CAACG,SAAS,CAAC,EAAGE,UAAU,IAAK;EACtE,OAAO,CAACC,IAAU,EAAEC,OAAyC,KAAK;IAChE,MAAMC,OAAO,GAAG,IAAIN,gBAAgB,CAACI,IAAI,EAAEC,OAAO,CAAC;IACnDC,OAAO,CAACC,MAAM,GAAGJ,UAAU;IAC3B,OAAOG,OAAO;EAChB,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAME,mBAAmB,GAAGA,CAAA,KAGTT,WAAW,CAACG,mBAAmB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useNotification.js","names":["useSelector","useDispatch","dismissNotification","showNotification","NOTIFICATION_TYPES","useNotification","dispatch","render","messageType","message","error","state","notification","dismiss","useErrorNotification","ERROR"],"sources":["../../src/hooks/useNotification.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { dismissNotification, showNotification } from \"../redux/actions\";\n\nimport type {\n DismissNotificationAction,\n NotificationState,\n ShowNotificationAction,\n} from \"../redux/types\";\n\nimport { NOTIFICATION_TYPES } from \"../constants\";\n\nimport type { MessageObject } from \"../i18n\";\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\ntype NotificationHook = {\n ...NotificationState,\n dismiss: () => DismissNotificationAction,\n};\ntype ErrorNotificationHook = (\n message: MessageObject,\n error?: ?ErrorResponse,\n) => ShowNotificationAction;\n\n/**\n */\nexport const useNotification = (): NotificationHook => {\n const dispatch = useDispatch();\n const { render, messageType, message, error } = useSelector(\n (state) => state.notification,\n );\n\n return {\n render,\n messageType,\n message,\n error,\n dismiss: () => dispatch(dismissNotification()),\n };\n};\n\n/**\n */\nexport const useErrorNotification = (): ErrorNotificationHook => {\n const dispatch = useDispatch();\n return (message: MessageObject, error?: ?ErrorResponse) => {\n return dispatch(showNotification(NOTIFICATION_TYPES.ERROR, message, error));\n };\n};\n"],"mappings":"AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,kBAAkB;AAQxE,SAASC,kBAAkB,QAAQ,cAAc;AAajD;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAwB;EACrD,MAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEM,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,WAAW,CACxDW,KAAK,IAAKA,KAAK,CAACC,YACnB,CAAC;EAED,OAAO;IACLL,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,KAAK;IACLG,OAAO,EAAEA,CAAA,KAAMP,QAAQ,CAACJ,mBAAmB,CAAC,CAAC;EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AACA,OAAO,MAAMY,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,MAAMR,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,OAAO,CAACQ,OAAsB,EAAEC,KAAsB,KAAK;IACzD,OAAOJ,QAAQ,CAACH,gBAAgB,CAACC,kBAAkB,CAACW,KAAK,EAAEN,OAAO,EAAEC,KAAK,CAAC,CAAC;EAC7E,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"useNotification.js","names":["useSelector","useDispatch","dismissNotification","showNotification","NOTIFICATION_TYPES","useNotification","dispatch","render","messageType","message","error","state","notification","dismiss","useErrorNotification","ERROR"],"sources":["../../src/hooks/useNotification.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { dismissNotification, showNotification } from \"../redux/actions\";\n\nimport type {\n DismissNotificationAction,\n NotificationState,\n ShowNotificationAction,\n} from \"../redux/types\";\n\nimport { NOTIFICATION_TYPES } from \"../constants\";\n\nimport type { MessageObject } from \"../i18n\";\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\ntype NotificationHook = {\n ...NotificationState,\n dismiss: () => DismissNotificationAction,\n};\ntype ErrorNotificationHook = (\n message: MessageObject,\n error?: ?ErrorResponse,\n) => ShowNotificationAction;\n\n/**\n */\nexport const useNotification = (): NotificationHook => {\n const dispatch = useDispatch();\n const { render, messageType, message, error } = useSelector(\n (state) => state.notification,\n );\n\n return {\n render,\n messageType,\n message,\n error,\n dismiss: () => dispatch(dismissNotification()),\n };\n};\n\n/**\n */\nexport const useErrorNotification = (): ErrorNotificationHook => {\n const dispatch = useDispatch();\n return (message: MessageObject, error?: ?ErrorResponse) => {\n return dispatch(showNotification(NOTIFICATION_TYPES.ERROR, message, error));\n };\n};\n"],"mappings":"AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,kBAAkB;AAQxE,SAASC,kBAAkB,QAAQ,cAAc;AAajD;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAwB;EACrD,MAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEM,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,WAAW,CACxDW,KAAK,IAAKA,KAAK,CAACC,YACnB,CAAC;EAED,OAAO;IACLL,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,KAAK;IACLG,OAAO,EAAEA,CAAA,KAAMP,QAAQ,CAACJ,mBAAmB,CAAC,CAAC;EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AACA,OAAO,MAAMY,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,MAAMR,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAC9B,OAAO,CAACQ,OAAsB,EAAEC,KAAsB,KAAK;IACzD,OAAOJ,QAAQ,CAACH,gBAAgB,CAACC,kBAAkB,CAACW,KAAK,EAAEN,OAAO,EAAEC,KAAK,CAAC,CAAC;EAC7E,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"usePreference.js","names":["pick","useSelector","createSelector","getPreferences","state","preferences","getPreferenceNames","preferenceNames","Array","isArray","selectPreference","usePreference"],"sources":["../../src/hooks/usePreference.js"],"sourcesContent":["// @flow\nimport pick from \"lodash/pick\";\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport type { PreferencesState, ReduxState } from \"../redux/types\";\n\nconst getPreferences = (state: ReduxState) => state.preferences;\nconst getPreferenceNames = (\n state: ReduxState,\n preferenceNames: string | Array<string>,\n) => (Array.isArray(preferenceNames) ? preferenceNames : [preferenceNames]);\n\nconst selectPreference = createSelector(\n [getPreferences, getPreferenceNames],\n (preferences, preferenceNames) => {\n return pick(preferences, preferenceNames);\n },\n);\n\n/**\n */\nexport const usePreference = (\n preferenceNames: string | Array<string>,\n): PreferencesState => {\n return useSelector((state) => selectPreference(state, preferenceNames));\n};\n"],"mappings":"AACA,OAAOA,IAAI,MAAM,aAAa;AAC9B,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,cAAc,QAAQ,UAAU;AAIzC,MAAMC,cAAc,GAAIC,KAAiB,IAAKA,KAAK,CAACC,WAAW;AAC/D,MAAMC,kBAAkB,GAAGA,CACzBF,KAAiB,EACjBG,eAAuC,KACnCC,KAAK,CAACC,OAAO,CAACF,eAAe,CAAC,GAAGA,eAAe,GAAG,CAACA,eAAe,CAAE;AAE3E,MAAMG,gBAAgB,GAAGR,cAAc,CACrC,CAACC,cAAc,EAAEG,kBAAkB,CAAC,EACpC,CAACD,WAAW,EAAEE,eAAe,KAAK;EAChC,OAAOP,IAAI,CAACK,WAAW,EAAEE,eAAe,CAAC;AAC3C,CACF,CAAC;;AAED;AACA;AACA,OAAO,MAAMI,aAAa,GACxBJ,eAAuC,IAClB;EACrB,OAAON,WAAW,CAAEG,KAAK,IAAKM,gBAAgB,CAACN,KAAK,EAAEG,eAAe,CAAC,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"usePreference.js","names":["pick","useSelector","createSelector","getPreferences","state","preferences","getPreferenceNames","preferenceNames","Array","isArray","selectPreference","usePreference"],"sources":["../../src/hooks/usePreference.js"],"sourcesContent":["// @flow\nimport pick from \"lodash/pick\";\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport type { PreferencesState, ReduxState } from \"../redux/types\";\n\nconst getPreferences = (state: ReduxState) => state.preferences;\nconst getPreferenceNames = (\n state: ReduxState,\n preferenceNames: string | Array<string>,\n) => (Array.isArray(preferenceNames) ? preferenceNames : [preferenceNames]);\n\nconst selectPreference = createSelector(\n [getPreferences, getPreferenceNames],\n (preferences, preferenceNames) => {\n return pick(preferences, preferenceNames);\n },\n);\n\n/**\n */\nexport const usePreference = (\n preferenceNames: string | Array<string>,\n): PreferencesState => {\n return useSelector((state) => selectPreference(state, preferenceNames));\n};\n"],"mappings":"AACA,OAAOA,IAAI,MAAM,aAAa;AAC9B,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,cAAc,QAAQ,UAAU;AAIzC,MAAMC,cAAc,GAAIC,KAAiB,IAAKA,KAAK,CAACC,WAAW;AAC/D,MAAMC,kBAAkB,GAAGA,CACzBF,KAAiB,EACjBG,eAAuC,KACnCC,KAAK,CAACC,OAAO,CAACF,eAAe,CAAC,GAAGA,eAAe,GAAG,CAACA,eAAe,CAAE;AAE3E,MAAMG,gBAAgB,GAAGR,cAAc,CACrC,CAACC,cAAc,EAAEG,kBAAkB,CAAC,EACpC,CAACD,WAAW,EAAEE,eAAe,KAAK;EAChC,OAAOP,IAAI,CAACK,WAAW,EAAEE,eAAe,CAAC;AAC3C,CACF,CAAC;;AAED;AACA;AACA,OAAO,MAAMI,aAAa,GACxBJ,eAAuC,IAClB;EACrB,OAAON,WAAW,CAAEG,KAAK,IAAKM,gBAAgB,CAACN,KAAK,EAAEG,eAAe,CAAC,CAAC;AACzE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useProgressIndicator.js","names":["useDispatch","useSelector","startProgress","finishProgress","resetProgress","updateProgress","useProgressIndicator","dispatch","progress","state","progressindicator","start","finish","reset","update","percentComplete"],"sources":["../../src/hooks/useProgressIndicator.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n startProgress,\n finishProgress,\n resetProgress,\n updateProgress,\n} from \"../redux/actions/ProgressIndicator\";\nimport type { ProgressIndicatorState } from \"../redux/types\";\n\ntype ProgressIndicatorHook = {\n ...ProgressIndicatorState,\n start: () => void,\n finish: () => void,\n reset: () => void,\n update: (percentComplete: number) => void,\n};\n\n/**\n */\nexport const useProgressIndicator = (): ProgressIndicatorHook => {\n const dispatch = useDispatch();\n const progress = useSelector((state) => state.progressindicator);\n\n return {\n ...progress,\n start: () => dispatch(startProgress()),\n finish: () => dispatch(finishProgress()),\n reset: () => dispatch(resetProgress()),\n update: (percentComplete: number) =>\n dispatch(updateProgress(percentComplete)),\n };\n};\n"],"mappings":"AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SACEC,aAAa,EACbC,cAAc,EACdC,aAAa,EACbC,cAAc,QACT,oCAAoC;AAW3C;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,MAAMC,QAAQ,GAAGP,WAAW,CAAC,CAAC;EAC9B,MAAMQ,QAAQ,GAAGP,WAAW,CAAEQ,KAAK,IAAKA,KAAK,CAACC,iBAAiB,CAAC;EAEhE,OAAO;IACL,GAAGF,QAAQ;IACXG,KAAK,EAAEA,CAAA,KAAMJ,QAAQ,CAACL,aAAa,CAAC,CAAC,CAAC;IACtCU,MAAM,EAAEA,CAAA,KAAML,QAAQ,CAACJ,cAAc,CAAC,CAAC,CAAC;IACxCU,KAAK,EAAEA,CAAA,KAAMN,QAAQ,CAACH,aAAa,CAAC,CAAC,CAAC;IACtCU,MAAM,EAAGC,eAAuB,IAC9BR,QAAQ,CAACF,cAAc,CAACU,eAAe,CAAC;EAC5C,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"useProgressIndicator.js","names":["useDispatch","useSelector","startProgress","finishProgress","resetProgress","updateProgress","useProgressIndicator","dispatch","progress","state","progressindicator","start","finish","reset","update","percentComplete"],"sources":["../../src/hooks/useProgressIndicator.js"],"sourcesContent":["// @flow\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n startProgress,\n finishProgress,\n resetProgress,\n updateProgress,\n} from \"../redux/actions/ProgressIndicator\";\nimport type { ProgressIndicatorState } from \"../redux/types\";\n\ntype ProgressIndicatorHook = {\n ...ProgressIndicatorState,\n start: () => void,\n finish: () => void,\n reset: () => void,\n update: (percentComplete: number) => void,\n};\n\n/**\n */\nexport const useProgressIndicator = (): ProgressIndicatorHook => {\n const dispatch = useDispatch();\n const progress = useSelector((state) => state.progressindicator);\n\n return {\n ...progress,\n start: () => dispatch(startProgress()),\n finish: () => dispatch(finishProgress()),\n reset: () => dispatch(resetProgress()),\n update: (percentComplete: number) =>\n dispatch(updateProgress(percentComplete)),\n };\n};\n"],"mappings":"AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SACEC,aAAa,EACbC,cAAc,EACdC,aAAa,EACbC,cAAc,QACT,oCAAoC;AAW3C;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,MAAMC,QAAQ,GAAGP,WAAW,CAAC,CAAC;EAC9B,MAAMQ,QAAQ,GAAGP,WAAW,CAAEQ,KAAK,IAAKA,KAAK,CAACC,iBAAiB,CAAC;EAEhE,OAAO;IACL,GAAGF,QAAQ;IACXG,KAAK,EAAEA,CAAA,KAAMJ,QAAQ,CAACL,aAAa,CAAC,CAAC,CAAC;IACtCU,MAAM,EAAEA,CAAA,KAAML,QAAQ,CAACJ,cAAc,CAAC,CAAC,CAAC;IACxCU,KAAK,EAAEA,CAAA,KAAMN,QAAQ,CAACH,aAAa,CAAC,CAAC,CAAC;IACtCU,MAAM,EAAGC,eAAuB,IAC9BR,QAAQ,CAACF,cAAc,CAACU,eAAe,CAAC;EAC5C,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useRouter.js","names":["useDispatch","useSelector","push","replace","go","goBack","goForward","useLocation","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","delta"],"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,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAGtD,SACEC,IAAI,EACJC,OAAO,EACPC,EAAE,EACFC,MAAM,EACNC,SAAS,QACJ,gCAAgC;AAqBvC;AACA;AACA,OAAO,MAAMC,WAA4B,GAAGA,CAAA,KAC1CN,WAAW,CAAEO,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC;;AAE/C;AACA;AACA,OAAO,MAAMC,cAAkC,GAAGA,CAAA,KAChDJ,WAAW,CAAC,CAAC,EAAEK,GAAG,IAAI,EAAE;;AAE1B;AACA;AACA,OAAO,MAAMC,cAAkC,GAAGA,CAAA,KAAMN,WAAW,CAAC,CAAC,EAAEO,MAAM;;AAE7E;AACA;AACA,OAAO,MAAMC,WAA4B,GAAGA,CAAA,KAAMR,WAAW,CAAC,CAAC,EAAES,QAAQ;;AAEzE;AACA;AACA,OAAO,MAAMC,aAAgC,GAAGA,CAAA,KAAM;EACpD,MAAMC,QAAQ,GAAGlB,WAAW,CAAC,CAAC;EAE9B,OAAO;IACLE,IAAI,EAAEA,CAACQ,QAAgC,EAAEF,KAAe,KACtDU,QAAQ,CAAChB,IAAI,CAACQ,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACjCL,OAAO,EAAEA,CAACO,QAAgC,EAAEF,KAAe,KACzDU,QAAQ,CAACf,OAAO,CAACO,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACpCJ,EAAE,EAAGe,KAAa,IAAKD,QAAQ,CAACd,EAAE,CAACe,KAAK,CAAC,CAAC;IAC1Cd,MAAM,EAAEA,CAAA,KAAMa,QAAQ,CAACb,MAAM,CAAC,CAAC,CAAC;IAChCC,SAAS,EAAEA,CAAA,KAAMY,QAAQ,CAACZ,SAAS,CAAC,CAAC;EACvC,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"useRouter.js","names":["useDispatch","useSelector","push","replace","go","goBack","goForward","useLocation","state","router","location","useLocationKey","key","useQuerystring","search","usePathname","pathname","useNavigation","dispatch","delta"],"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,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAGtD,SACEC,IAAI,EACJC,OAAO,EACPC,EAAE,EACFC,MAAM,EACNC,SAAS,QACJ,gCAAgC;AAqBvC;AACA;AACA,OAAO,MAAMC,WAA4B,GAAGA,CAAA,KAC1CN,WAAW,CAAEO,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC;;AAE/C;AACA;AACA,OAAO,MAAMC,cAAkC,GAAGA,CAAA,KAChDJ,WAAW,CAAC,CAAC,EAAEK,GAAG,IAAI,EAAE;;AAE1B;AACA;AACA,OAAO,MAAMC,cAAkC,GAAGA,CAAA,KAAMN,WAAW,CAAC,CAAC,EAAEO,MAAM;;AAE7E;AACA;AACA,OAAO,MAAMC,WAA4B,GAAGA,CAAA,KAAMR,WAAW,CAAC,CAAC,EAAES,QAAQ;;AAEzE;AACA;AACA,OAAO,MAAMC,aAAgC,GAAGA,CAAA,KAAM;EACpD,MAAMC,QAAQ,GAAGlB,WAAW,CAAC,CAAC;EAE9B,OAAO;IACLE,IAAI,EAAEA,CAACQ,QAAgC,EAAEF,KAAe,KACtDU,QAAQ,CAAChB,IAAI,CAACQ,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACjCL,OAAO,EAAEA,CAACO,QAAgC,EAAEF,KAAe,KACzDU,QAAQ,CAACf,OAAO,CAACO,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACpCJ,EAAE,EAAGe,KAAa,IAAKD,QAAQ,CAACd,EAAE,CAACe,KAAK,CAAC,CAAC;IAC1Cd,MAAM,EAAEA,CAAA,KAAMa,QAAQ,CAACb,MAAM,CAAC,CAAC,CAAC;IAChCC,SAAS,EAAEA,CAAA,KAAMY,QAAQ,CAACZ,SAAS,CAAC,CAAC;EACvC,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Locale.js","names":["formatMessage","languages","IllegalStateException","getSetting","Locale","constructor","locale","_defineProperty","_code","code","_messages","fixPlaceHoldersInObject","messages","_errors","errors","_nativeName","nativeName","setup","missingTranslation","aLocale","split","length","language","lang","toUpperCase","fixPlaceHolders","message","replace","arguments","undefined","JSON","parse","_JSON$stringify","getBaseMessage","id","defaultMessage","messageFromLocale","process","env","NODE_ENV","console","debug","parameters","getMessage","update"],"sources":["../../src/i18n/Locale.js"],"sourcesContent":["// @flow\nimport formatMessage from \"format-message\";\n\nimport languages from \"./languages\";\nimport { IllegalStateException } from \"../exceptions\";\n\nimport { getSetting } from \"../constants\";\n\nimport type { LocaleConfiguration, MessageParameters } from \"./types\";\n\n/**\n * Create a locale\n */\nclass Locale {\n _code: string;\n _messages: { [string]: string };\n _errors: { [string]: string };\n _nativeName: ?string;\n\n constructor(locale: LocaleConfiguration) {\n this._code = locale.code;\n\n this._messages = this.fixPlaceHoldersInObject(locale.messages);\n this._errors = this.fixPlaceHoldersInObject(locale.errors);\n\n this._nativeName = locale.nativeName;\n\n formatMessage.setup({\n missingTranslation: \"ignore\",\n });\n }\n\n /**\n * Retrieve locale code\n */\n get code(): string {\n return this._code;\n }\n\n /**\n * Retrieve nativeName\n */\n get nativeName(): string {\n if (this._nativeName) {\n return this._nativeName;\n }\n\n const aLocale = this.code.split(\"-\");\n\n if (aLocale.length > 0) {\n const language = languages.lang[aLocale[0]];\n\n if (language) {\n return (\n language[1] + (aLocale[1] ? ` (${aLocale[1].toUpperCase()})` : \"\")\n );\n }\n }\n\n throw new IllegalStateException(\n `Can not find language name based on locale: ${this.code}`,\n );\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHolders(message: ?string): null | string {\n if (typeof message === \"string\") {\n return message\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\");\n }\n\n return null;\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHoldersInObject(messages: Object = {}): Object {\n return JSON.parse(\n JSON.stringify(messages)\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\"),\n );\n }\n\n /**\n * Retrieve message by id\n */\n getBaseMessage(id: string, defaultMessage?: string): string {\n if (!id && !defaultMessage) {\n return \"[message: id or defaultMessage missing]\";\n }\n\n const messageFromLocale = this._messages[id] || this._errors[id];\n\n if (\n (typeof process === \"undefined\" ||\n process.env.NODE_ENV !== \"production\") &&\n !messageFromLocale &&\n id &&\n getSetting(\"DEBUG_I18N_MESSAGE_NOT_FOUND\")\n ) {\n // eslint-disable-next-line no-console\n console.debug(\n `Message with id ${id} not found for locale ${this.code} in layout translations`,\n );\n }\n return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;\n }\n\n /**\n * Format message using formatMessage library\n */\n formatMessage(message: string, parameters?: MessageParameters): string {\n if (parameters) {\n return formatMessage(message, parameters);\n }\n\n return message;\n }\n\n /**\n * Retrieve a messages with replaced parameters\n */\n getMessage(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n ): string {\n const message = this.getBaseMessage(id, defaultMessage);\n return this.formatMessage(message, parameters);\n }\n\n /**\n * Add or change messages for this locale. It is not possible to remove messages.\n */\n update(messages: Object = {}, errors: Object = {}) {\n this._messages = {\n ...this._messages,\n ...this.fixPlaceHoldersInObject(messages),\n };\n\n this._errors = {\n ...this._errors,\n ...this.fixPlaceHoldersInObject(errors),\n };\n }\n}\n\nexport default Locale;\n"],"mappings":";;AACA,OAAOA,aAAa,MAAM,gBAAgB;AAE1C,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,qBAAqB,QAAQ,eAAe;AAErD,SAASC,UAAU,QAAQ,cAAc;AAIzC;AACA;AACA;AACA,MAAMC,MAAM,CAAC;EAMXC,WAAWA,CAACC,MAA2B,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACvC,IAAI,CAACC,KAAK,GAAGF,MAAM,CAACG,IAAI;IAExB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACC,uBAAuB,CAACL,MAAM,CAACM,QAAQ,CAAC;IAC9D,IAAI,CAACC,OAAO,GAAG,IAAI,CAACF,uBAAuB,CAACL,MAAM,CAACQ,MAAM,CAAC;IAE1D,IAAI,CAACC,WAAW,GAAGT,MAAM,CAACU,UAAU;IAEpChB,aAAa,CAACiB,KAAK,CAAC;MAClBC,kBAAkB,EAAE;IACtB,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACE,IAAIT,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACD,KAAK;EACnB;;EAEA;AACF;AACA;EACE,IAAIQ,UAAUA,CAAA,EAAW;IACvB,IAAI,IAAI,CAACD,WAAW,EAAE;MACpB,OAAO,I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;IAED,IAAI,CAACC,OAAO,GAAG;MACb,GAAG,IAAI,CAACA,OAAO;MACf,GAAG,IAAI,CAACF,uBAAuB,CAACG,MAAM;IACxC,CAAC;EACH;AACF;AAEA,eAAeV,MAAM"}
1
+ {"version":3,"file":"Locale.js","names":["formatMessage","languages","IllegalStateException","getSetting","Locale","constructor","locale","_defineProperty","_code","code","_messages","fixPlaceHoldersInObject","messages","_errors","errors","_nativeName","nativeName","setup","missingTranslation","aLocale","split","length","language","lang","toUpperCase","fixPlaceHolders","message","replace","arguments","undefined","JSON","parse","_JSON$stringify","getBaseMessage","id","defaultMessage","messageFromLocale","process","env","NODE_ENV","console","debug","parameters","getMessage","update"],"sources":["../../src/i18n/Locale.js"],"sourcesContent":["// @flow\nimport formatMessage from \"format-message\";\n\nimport languages from \"./languages\";\nimport { IllegalStateException } from \"../exceptions\";\n\nimport { getSetting } from \"../constants\";\n\nimport type { LocaleConfiguration, MessageParameters } from \"./types\";\n\n/**\n * Create a locale\n */\nclass Locale {\n _code: string;\n _messages: { [string]: string };\n _errors: { [string]: string };\n _nativeName: ?string;\n\n constructor(locale: LocaleConfiguration) {\n this._code = locale.code;\n\n this._messages = this.fixPlaceHoldersInObject(locale.messages);\n this._errors = this.fixPlaceHoldersInObject(locale.errors);\n\n this._nativeName = locale.nativeName;\n\n formatMessage.setup({\n missingTranslation: \"ignore\",\n });\n }\n\n /**\n * Retrieve locale code\n */\n get code(): string {\n return this._code;\n }\n\n /**\n * Retrieve nativeName\n */\n get nativeName(): string {\n if (this._nativeName) {\n return this._nativeName;\n }\n\n const aLocale = this.code.split(\"-\");\n\n if (aLocale.length > 0) {\n const language = languages.lang[aLocale[0]];\n\n if (language) {\n return (\n language[1] + (aLocale[1] ? ` (${aLocale[1].toUpperCase()})` : \"\")\n );\n }\n }\n\n throw new IllegalStateException(\n `Can not find language name based on locale: ${this.code}`,\n );\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHolders(message: ?string): null | string {\n if (typeof message === \"string\") {\n return message\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\");\n }\n\n return null;\n }\n\n /**\n * Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}\n * where the ICU messageformat module uses {placeholder_name}.\n * This method converts the ${} to {}\n */\n fixPlaceHoldersInObject(messages: Object = {}): Object {\n return JSON.parse(\n JSON.stringify(messages)\n .replace(/'\\$\\{(?<key>.*?)}'/g, \"''{$<key>}''\")\n .replace(/\\$\\{(?<key>.*?)}/g, \"{$<key>}\"),\n );\n }\n\n /**\n * Retrieve message by id\n */\n getBaseMessage(id: string, defaultMessage?: string): string {\n if (!id && !defaultMessage) {\n return \"[message: id or defaultMessage missing]\";\n }\n\n const messageFromLocale = this._messages[id] || this._errors[id];\n\n if (\n (typeof process === \"undefined\" ||\n process.env.NODE_ENV !== \"production\") &&\n !messageFromLocale &&\n id &&\n getSetting(\"DEBUG_I18N_MESSAGE_NOT_FOUND\")\n ) {\n // eslint-disable-next-line no-console\n console.debug(\n `Message with id ${id} not found for locale ${this.code} in layout translations`,\n );\n }\n return messageFromLocale || this.fixPlaceHolders(defaultMessage) || id;\n }\n\n /**\n * Format message using formatMessage library\n */\n formatMessage(message: string, parameters?: MessageParameters): string {\n if (parameters) {\n return formatMessage(message, parameters);\n }\n\n return message;\n }\n\n /**\n * Retrieve a messages with replaced parameters\n */\n getMessage(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n ): string {\n const message = this.getBaseMessage(id, defaultMessage);\n return this.formatMessage(message, parameters);\n }\n\n /**\n * Add or change messages for this locale. It is not possible to remove messages.\n */\n update(messages: Object = {}, errors: Object = {}) {\n this._messages = {\n ...this._messages,\n ...this.fixPlaceHoldersInObject(messages),\n };\n\n this._errors = {\n ...this._errors,\n ...this.fixPlaceHoldersInObject(errors),\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,eAAe,CAACU,cAAc,CAAC,IAAID,EAAE;EACxE;;EAEA;AACF;AACA;EACElC,aAAaA,CAAC0B,OAAe,EAAEgB,UAA8B,EAAU;IACrE,IAAIA,UAAU,EAAE;MACd,OAAO1C,aAAa,CAAC0B,OAAO,EAAEgB,UAAU,CAAC;IAC3C;IAEA,OAAOhB,OAAO;EAChB;;EAEA;AACF;AACA;EACEiB,UAAUA,CACRT,EAAU,EACVC,cAAuB,EACvBO,UAA8B,EACtB;IACR,MAAMhB,OAAO,GAAG,IAAI,CAACO,cAAc,CAACC,EAAE,EAAEC,cAAc,CAAC;IACvD,OAAO,IAAI,CAACnC,aAAa,CAAC0B,OAAO,EAAEgB,UAAU,CAAC;EAChD;;EAEA;AACF;AACA;EACEE,MAAMA,CAAA,EAA6C;IAAA,IAA5ChC,QAAgB,GAAAgB,SAAA,CAAAP,MAAA,QAAAO,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,CAAC,CAAC;IAAA,IAAEd,MAAc,GAAAc,SAAA,CAAAP,MAAA,QAAAO,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,CAAC,CAAC;IAC/C,IAAI,CAAClB,SAAS,GAAG;MACf,GAAG,IAAI,CAACA,SAAS;MACjB,GAAG,IAAI,CAACC,uBAAuB,CAACC,QAAQ;IAC1C,CAAC;IAED,IAAI,CAACC,OAAO,GAAG;MACb,GAAG,IAAI,CAACA,OAAO;MACf,GAAG,IAAI,CAACF,uBAAuB,CAACG,MAAM;IACxC,CAAC;EACH;AACF;AAEA,eAAeV,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Locales.js","names":["Locale","englishErrors","dutchErrors","BaseCollection","IllegalArgumentException","availableLocales","code","messages","errors","createLocalesWithConfiguredErrors","configuredErrors","_mapInstanceProperty","call","availableLocale","Locales","constructor","locales","arguments","length","undefined","locale","rehydrate","hydatedLocales","_collection","_context","_code","_messages","_errors","hasLocale","localeCode","some","item","_startsWithInstanceProperty","getLocale","_context2","_findInstanceProperty","availableLocaleCodes","_context3","getPreferredLocale","acceptLanguageHeader","_context4","acceptLanguages","match","preferredLocales","_filterInstanceProperty","_context5","update","add"],"sources":["../../src/i18n/Locales.js"],"sourcesContent":["// @flow\nimport Locale from \"./Locale\";\n\nimport englishErrors from \"./translations/beinformed_error_messages_en.nl\";\nimport dutchErrors from \"./translations/beinformed_error_messages_nl.nl\";\n\nimport BaseCollection from \"../models/base/BaseCollection\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"./types\";\n\ntype ErrorMessageObject = {\n [languageCode: string]: {\n [messageID: string]: string,\n },\n};\n\ntype HydratedLocales = {\n _collection: Array<{\n _code: string,\n _messages: {\n [string]: string,\n },\n _errors: {\n [string]: string,\n },\n }>,\n};\n\n/**\n * Array of available locales\n * Order of locales is the preferred order of locales.\n * When user has an accept language header that does not correspond to the locales array,\n * the first one is used as the preferred language\n */\nexport const availableLocales: Array<LocaleConfiguration> = [\n {\n code: \"en\",\n messages: {},\n errors: englishErrors,\n },\n {\n code: \"nl\",\n messages: {},\n errors: dutchErrors,\n },\n];\n\n/**\n * Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.\n */\nexport const createLocalesWithConfiguredErrors = (\n configuredErrors: ErrorMessageObject,\n): Array<Object> =>\n availableLocales.map((availableLocale) => {\n if (configuredErrors[availableLocale.code]) {\n return {\n ...availableLocale,\n errors: {\n ...availableLocale.errors,\n ...configuredErrors[availableLocale.code],\n },\n };\n }\n\n return availableLocale;\n });\n\n/**\n * Locales, collection of Locale\n */\nclass Locales extends BaseCollection<Locale> {\n constructor(locales: Array<LocaleConfiguration> = availableLocales) {\n super(locales.map((locale) => new Locale(locale)));\n }\n\n /**\n * rehydrate\n */\n static rehydrate(hydatedLocales: HydratedLocales): Locales {\n if (hydatedLocales && hydatedLocales._collection) {\n return new Locales(\n hydatedLocales._collection.map((locale) => ({\n code: locale._code,\n messages: locale._messages,\n errors: locale._errors,\n })),\n );\n }\n\n return new Locales([]);\n }\n\n /**\n * Check if locale with localeCode exists\n */\n hasLocale(localeCode: string): boolean {\n return this.some((item) => localeCode.startsWith(item.code));\n }\n\n /**\n * Retrieve locales by localeCode from Locales collection\n */\n getLocale(localeCode: string): Locale {\n if (this.hasLocale(localeCode)) {\n const locale = this.find((item) => localeCode.startsWith(item.code));\n if (locale) {\n return locale;\n }\n }\n throw new IllegalArgumentException(\n `Locale configuration for locale ${localeCode} not found`,\n );\n }\n\n /**\n * Retrieve all available locale codes\n */\n get availableLocaleCodes(): Array<string> {\n return this.map((locale) => locale.code);\n }\n\n /**\n * Retrieve preferred locale based on the accept header of a browser\n */\n getPreferredLocale(acceptLanguageHeader: string | null): void | string {\n if (acceptLanguageHeader != null) {\n const acceptLanguages =\n acceptLanguageHeader.match(/[-A-Za-z]{2,10}/gu) || [];\n\n const preferredLocales = acceptLanguages\n .filter((locale) =>\n this.availableLocaleCodes.some((availableLocale) =>\n locale.startsWith(availableLocale),\n ),\n )\n .map((locale) =>\n this.availableLocaleCodes.find((availableLocale) =>\n locale.startsWith(availableLocale),\n ),\n );\n\n if (preferredLocales.length > 0) {\n return preferredLocales[0];\n }\n }\n\n return this.availableLocaleCodes[0];\n }\n\n /**\n * Add or change messages and errors for the given locale.<br>\n * It is not possible to remove messages.\n */\n update(locale: string, messages: Object = {}, errors: Object = {}) {\n if (this.hasLocale(locale)) {\n this.getLocale(locale).update(messages, errors);\n } else {\n this.add(\n new Locale({\n code: locale,\n messages,\n errors,\n }),\n );\n }\n }\n}\n\nexport default Locales;\n"],"mappings":";;;;AACA,OAAOA,MAAM,MAAM,UAAU;AAE7B,OAAOC,aAAa,MAAM,gDAAgD;AAC1E,OAAOC,WAAW,MAAM,gDAAgD;AAExE,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,SAASC,wBAAwB,QAAQ,eAAe;AAsBxD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAA4C,GAAG,CAC1D;EACEC,IAA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B,MAAM,IACb,IAAI,CAACgB,oBAAoB,CAACN,IAAI,CAAEjB,eAAe,IAC7CmB,2BAAA,CAAAZ,MAAM,EAAAR,IAAA,CAANQ,MAAM,EAAYP,eAAe,CACnC,CACF,CAAC,EAAAD,IAAA,CAAA4B,SAAA,EACKpB,MAAM;QAAA,IAAAyB,SAAA;QAAA,OACVV,qBAAA,CAAAU,SAAA,OAAI,CAACT,oBAAoB,EAAAxB,IAAA,CAAAiC,SAAA,EAAOhC,eAAe,IAC7CmB,2BAAA,CAAAZ,MAAM,EAAAR,IAAA,CAANQ,MAAM,EAAYP,eAAe,CACnC,CAAC;MAAA,CACH,CAAC;MAEH,IAAI8B,gBAAgB,CAACzB,MAAM,GAAG,CAAC,EAAE;QAC/B,OAAOyB,gBAAgB,CAAC,CAAC,CAAC;MAC5B;IACF;IAEA,OAAO,IAAI,CAACP,oBAAoB,CAAC,CAAC,CAAC;EACrC;;EAEA;AACF;AACA;AACA;EACEU,MAAMA,CAAC1B,MAAc,EAA8C;IAAA,IAA5Cb,QAAgB,GAAAU,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,IAAET,MAAc,GAAAS,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAC/D,IAAI,IAAI,CAACW,SAAS,CAACR,MAAM,CAAC,EAAE;MAC1B,IAAI,CAACa,SAAS,CAACb,MAAM,CAAC,CAAC0B,MAAM,CAACvC,QAAQ,EAAEC,MAAM,CAAC;IACjD,CAAC,MAAM;MACL,IAAI,CAACuC,GAAG,CACN,IAAI/C,MAAM,CAAC;QACTM,IAAI,EAAEc,MAAM;QACZb,QAAQ;QACRC;MACF,CAAC,CACH,CAAC;IACH;EACF;AACF;AAEA,eAAeM,OAAO"}
1
+ {"version":3,"file":"Locales.js","names":["Locale","englishErrors","dutchErrors","BaseCollection","IllegalArgumentException","availableLocales","code","messages","errors","createLocalesWithConfiguredErrors","configuredErrors","_mapInstanceProperty","call","availableLocale","Locales","constructor","locales","arguments","length","undefined","locale","rehydrate","hydatedLocales","_collection","_context","_code","_messages","_errors","hasLocale","localeCode","some","item","_startsWithInstanceProperty","getLocale","_context2","_findInstanceProperty","availableLocaleCodes","_context3","getPreferredLocale","acceptLanguageHeader","_context4","acceptLanguages","match","preferredLocales","_filterInstanceProperty","_context5","update","add"],"sources":["../../src/i18n/Locales.js"],"sourcesContent":["// @flow\nimport Locale from \"./Locale\";\n\nimport englishErrors from \"./translations/beinformed_error_messages_en.nl\";\nimport dutchErrors from \"./translations/beinformed_error_messages_nl.nl\";\n\nimport BaseCollection from \"../models/base/BaseCollection\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"./types\";\n\ntype ErrorMessageObject = {\n [languageCode: string]: {\n [messageID: string]: string,\n },\n};\n\ntype HydratedLocales = {\n _collection: Array<{\n _code: string,\n _messages: {\n [string]: string,\n },\n _errors: {\n [string]: string,\n },\n }>,\n};\n\n/**\n * Array of available locales\n * Order of locales is the preferred order of locales.\n * When user has an accept language header that does not correspond to the locales array,\n * the first one is used as the preferred language\n */\nexport const availableLocales: Array<LocaleConfiguration> = [\n {\n code: \"en\",\n messages: {},\n errors: englishErrors,\n },\n {\n code: \"nl\",\n messages: {},\n errors: dutchErrors,\n },\n];\n\n/**\n * Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.\n */\nexport const createLocalesWithConfiguredErrors = (\n configuredErrors: ErrorMessageObject,\n): Array<Object> =>\n availableLocales.map((availableLocale) => {\n if (configuredErrors[availableLocale.code]) {\n return {\n ...availableLocale,\n errors: {\n ...availableLocale.errors,\n ...configuredErrors[availableLocale.code],\n },\n };\n }\n\n return availableLocale;\n });\n\n/**\n * Locales, collection of Locale\n */\nclass Locales extends BaseCollection<Locale> {\n constructor(locales: Array<LocaleConfiguration> = availableLocales) {\n super(locales.map((locale) => new Locale(locale)));\n }\n\n /**\n * rehydrate\n */\n static rehydrate(hydatedLocales: HydratedLocales): Locales {\n if (hydatedLocales && hydatedLocales._collection) {\n return new Locales(\n hydatedLocales._collection.map((locale) => ({\n code: locale._code,\n messages: locale._messages,\n errors: locale._errors,\n })),\n );\n }\n\n return new Locales([]);\n }\n\n /**\n * Check if locale with localeCode exists\n */\n hasLocale(localeCode: string): boolean {\n return this.some((item) => localeCode.startsWith(item.code));\n }\n\n /**\n * Retrieve locales by localeCode from Locales collection\n */\n getLocale(localeCode: string): Locale {\n if (this.hasLocale(localeCode)) {\n const locale = this.find((item) => localeCode.startsWith(item.code));\n if (locale) {\n return locale;\n }\n }\n throw new IllegalArgumentException(\n `Locale configuration for locale ${localeCode} not found`,\n );\n }\n\n /**\n * Retrieve all available locale codes\n */\n get availableLocaleCodes(): Array<string> {\n return this.map((locale) => locale.code);\n }\n\n /**\n * Retrieve preferred locale based on the accept header of a browser\n */\n getPreferredLocale(acceptLanguageHeader: string | null): void | string {\n if (acceptLanguageHeader != null) {\n const acceptLanguages =\n acceptLanguageHeader.match(/[-A-Za-z]{2,10}/gu) || [];\n\n const preferredLocales = acceptLanguages\n .filter((locale) =>\n this.availableLocaleCodes.some((availableLocale) =>\n locale.startsWith(availableLocale),\n ),\n )\n .map((locale) =>\n this.availableLocaleCodes.find((availableLocale) =>\n locale.startsWith(availableLocale),\n ),\n );\n\n if (preferredLocales.length > 0) {\n return preferredLocales[0];\n }\n }\n\n return this.availableLocaleCodes[0];\n }\n\n /**\n * Add or change messages and errors for the given locale.<br>\n * It is not possible to remove messages.\n */\n update(locale: string, messages: Object = {}, errors: Object = {}) {\n if (this.hasLocale(locale)) {\n this.getLocale(locale).update(messages, errors);\n } else {\n this.add(\n new Locale({\n code: locale,\n messages,\n errors,\n }),\n );\n }\n }\n}\n\nexport default Locales;\n"],"mappings":";;;;AACA,OAAOA,MAAM,MAAM,UAAU;AAE7B,OAAOC,aAAa,MAAM,gDAAgD;AAC1E,OAAOC,WAAW,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Ec,MAAM;QACZb,QAAQ;QACRC;MACF,CAAC,CACH,CAAC;IACH;EACF;AACF;AAEA,eAAeM,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Message.js","names":["memo","hideVisually","useMessage","jsx","_jsx","Message","_ref","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","styles","style","dangerouslySetInnerHTML","__html","displayName"],"sources":["../../src/i18n/Message.js"],"sourcesContent":["// @flow\nimport { memo } from \"react\";\nimport { hideVisually } from \"polished\";\n\nimport { useMessage } from \"../hooks/useI18n\";\n\ntype MessageProps = {\n +className?: string,\n +id: string,\n +defaultMessage?: string | null,\n +children?: string,\n +data?: Object | null,\n +screenreaderOnly?: boolean,\n +allowHTML?: boolean,\n};\n\n/**\n * Message React component\n */\nconst Message: React$AbstractComponent<MessageProps, mixed> =\n memo<MessageProps>(\n ({\n className,\n id,\n defaultMessage,\n children,\n data,\n screenreaderOnly = false,\n allowHTML = false,\n }: MessageProps) => {\n const translatedMessage = useMessage(\n id,\n defaultMessage || children,\n data,\n );\n\n if (screenreaderOnly) {\n const styles = {\n ...hideVisually(),\n };\n\n return (\n <span className={className} style={styles}>\n {translatedMessage}\n </span>\n );\n }\n\n if (allowHTML) {\n return (\n <span\n className={className}\n dangerouslySetInnerHTML={{\n __html: translatedMessage,\n }}\n />\n );\n }\n\n return <span className={className}>{translatedMessage}</span>;\n },\n );\n\nMessage.displayName = \"BI.Message\";\n\nexport default Message;\n"],"mappings":"AACA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,YAAY,QAAQ,UAAU;AAEvC,SAASC,UAAU,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAY9C;AACA;AACA;AACA,MAAMC,OAAqD,gBACzDL,IAAI,CACFM,IAAA,IAQoB;EAAA,IARnB;IACCC,SAAS;IACTC,EAAE;IACFC,cAAc;IACdC,QAAQ;IACRC,IAAI;IACJC,gBAAgB,GAAG,KAAK;IACxBC,SAAS,GAAG;EACA,CAAC,GAAAP,IAAA;EACb,MAAMQ,iBAAiB,GAAGZ,UAAU,CAClCM,EAAE,EACFC,cAAc,IAAIC,QAAQ,EAC1BC,IACF,CAAC;EAED,IAAIC,gBAAgB,EAAE;IACpB,MAAMG,MAAM,GAAG;MACb,GAAGd,YAAY,CAAC;IAClB,CAAC;IAED,oBACEG,IAAA;MAAMG,SAAS,EAAEA,SAAU;MAACS,KAAK,EAAED,MAAO;MAAAL,QAAA,EACvCI;IAAiB,CACd,CAAC;EAEX;EAEA,IAAID,SAAS,EAAE;IACb,oBACET,IAAA;MACEG,SAAS,EAAEA,SAAU;MACrBU,uBAAuB,EAAE;QACvBC,MAAM,EAAEJ;MACV;IAAE,CACH,CAAC;EAEN;EAEA,oBAAOV,IAAA;IAAMG,SAAS,EAAEA,SAAU;IAAAG,QAAA,EAAEI;EAAiB,CAAO,CAAC;AAC/D,CACF,CAAC;AAEHT,OAAO,CAACc,WAAW,GAAG,YAAY;AAElC,eAAed,OAAO"}
1
+ {"version":3,"file":"Message.js","names":["memo","hideVisually","useMessage","jsx","_jsx","Message","_ref","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","styles","style","dangerouslySetInnerHTML","__html","displayName"],"sources":["../../src/i18n/Message.js"],"sourcesContent":["// @flow\nimport { memo } from \"react\";\nimport { hideVisually } from \"polished\";\n\nimport { useMessage } from \"../hooks/useI18n\";\n\ntype MessageProps = {\n +className?: string,\n +id: string,\n +defaultMessage?: string | null,\n +children?: string,\n +data?: Object | null,\n +screenreaderOnly?: boolean,\n +allowHTML?: boolean,\n};\n\n/**\n * Message React component\n */\nconst Message: React$AbstractComponent<MessageProps, mixed> =\n memo<MessageProps>(\n ({\n className,\n id,\n defaultMessage,\n children,\n data,\n screenreaderOnly = false,\n allowHTML = false,\n }: MessageProps) => {\n const translatedMessage = useMessage(\n id,\n defaultMessage || children,\n data,\n );\n\n if (screenreaderOnly) {\n const styles = {\n ...hideVisually(),\n };\n\n return (\n <span className={className} style={styles}>\n {translatedMessage}\n </span>\n );\n }\n\n if (allowHTML) {\n return (\n <span\n className={className}\n dangerouslySetInnerHTML={{\n __html: translatedMessage,\n }}\n />\n );\n }\n\n return <span className={className}>{translatedMessage}</span>;\n },\n );\n\nMessage.displayName = \"BI.Message\";\n\nexport default Message;\n"],"mappings":"AACA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,YAAY,QAAQ,UAAU;AAEvC,SAASC,UAAU,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAY9C;AACA;AACA;AACA,MAAMC,OAAqD,gBACzDL,IAAI,CACFM,IAAA,IAQoB;EAAA,IARnB;IACCC,SAAS;IACTC,EAAE;IACFC,cAAc;IACdC,QAAQ;IACRC,IAAI;IACJC,gBAAgB,GAAG,KAAK;IACxBC,SAAS,GAAG;EACA,CAAC,GAAAP,IAAA;EACb,MAAMQ,iBAAiB,GAAGZ,UAAU,CAClCM,EAAE,EACFC,cAAc,IAAIC,QAAQ,EAC1BC,IACF,CAAC;EAED,IAAIC,gBAAgB,EAAE;IACpB,MAAMG,MAAM,GAAG;MACb,GAAGd,YAAY,CAAC;IAClB,CAAC;IAED,oBACEG,IAAA;MAAMG,SAAS,EAAEA,SAAU;MAACS,KAAK,EAAED,MAAO;MAAAL,QAAA,EACvCI;IAAiB,CACd,CAAC;EAEX;EAEA,IAAID,SAAS,EAAE;IACb,oBACET,IAAA;MACEG,SAAS,EAAEA,SAAU;MACrBU,uBAAuB,EAAE;QACvBC,MAAM,EAAEJ;MACV;IAAE,CACH,CAAC;EAEN;EAEA,oBAAOV,IAAA;IAAMG,SAAS,EAAEA,SAAU;IAAAG,QAAA,EAAEI;EAAiB,CAAO,CAAC;AAC/D,CACF,CAAC;AAEHT,OAAO,CAACc,WAAW,GAAG,YAAY;AAElC,eAAed,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","Locales","availableLocales","createLocalesWithConfiguredErrors","Message","withMessage","useMessage","useTranslate"],"sources":["../../src/i18n/index.js"],"sourcesContent":["// @flow\nexport {\n default as Locales,\n availableLocales,\n createLocalesWithConfiguredErrors,\n} from \"./Locales\";\n\nexport { default as Message } from \"./Message\";\nexport { default as withMessage } from \"./withMessage\";\nexport { useMessage, useTranslate } from \"../hooks/useI18n\";\n\nexport type * from \"./types\";\n"],"mappings":"AACA,SACEA,OAAO,IAAIC,OAAO,EAClBC,gBAAgB,EAChBC,iCAAiC,QAC5B,WAAW;AAElB,SAASH,OAAO,IAAII,OAAO,QAAQ,WAAW;AAC9C,SAASJ,OAAO,IAAIK,WAAW,QAAQ,eAAe;AACtD,SAASC,UAAU,EAAEC,YAAY,QAAQ,kBAAkB"}
1
+ {"version":3,"file":"index.js","names":["default","Locales","availableLocales","createLocalesWithConfiguredErrors","Message","withMessage","useMessage","useTranslate"],"sources":["../../src/i18n/index.js"],"sourcesContent":["// @flow\nexport {\n default as Locales,\n availableLocales,\n createLocalesWithConfiguredErrors,\n} from \"./Locales\";\n\nexport { default as Message } from \"./Message\";\nexport { default as withMessage } from \"./withMessage\";\nexport { useMessage, useTranslate } from \"../hooks/useI18n\";\n\nexport type * from \"./types\";\n"],"mappings":"AACA,SACEA,OAAO,IAAIC,OAAO,EAClBC,gBAAgB,EAChBC,iCAAiC,QAC5B,WAAW;AAElB,SAASH,OAAO,IAAII,OAAO,QAAQ,WAAW;AAC9C,SAASJ,OAAO,IAAIK,WAAW,QAAQ,eAAe;AACtD,SAASC,UAAU,EAAEC,YAAY,QAAQ,kBAAkB","ignoreList":[]}