@beinformed/ui 1.28.2 → 1.28.4

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 (556) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
  3. package/esm/constants/LayoutHints.js.map +1 -1
  4. package/esm/constants/Settings.js.map +1 -1
  5. package/esm/exceptions/ConfigurationException.js.map +1 -1
  6. package/esm/exceptions/FetchException.js.map +1 -1
  7. package/esm/exceptions/IllegalArgumentException.js.map +1 -1
  8. package/esm/exceptions/IllegalReturnException.js.map +1 -1
  9. package/esm/exceptions/IllegalStateException.js.map +1 -1
  10. package/esm/exceptions/JsonParseException.js.map +1 -1
  11. package/esm/exceptions/MissingPropertyException.js.map +1 -1
  12. package/esm/exceptions/NetworkException.js.map +1 -1
  13. package/esm/exceptions/NotAllowedUriException.js.map +1 -1
  14. package/esm/exceptions/NotFoundException.js.map +1 -1
  15. package/esm/exceptions/ServerRequestException.js.map +1 -1
  16. package/esm/exceptions/ThemePropertyException.js.map +1 -1
  17. package/esm/exceptions/TimeoutException.js.map +1 -1
  18. package/esm/exceptions/UnauthorizedException.js.map +1 -1
  19. package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
  20. package/esm/hooks/useAllFormsOnModel.js.map +1 -1
  21. package/esm/hooks/useAuthentication.js.map +1 -1
  22. package/esm/hooks/useContent.js.map +1 -1
  23. package/esm/hooks/useDeepCompareEffect.js.map +1 -1
  24. package/esm/hooks/useForm.js.map +1 -1
  25. package/esm/hooks/useI18n.js.map +1 -1
  26. package/esm/hooks/useModal.js.map +1 -1
  27. package/esm/hooks/useModelCatalog.js.map +1 -1
  28. package/esm/hooks/useModels.js.map +1 -1
  29. package/esm/hooks/useModularUI.js.map +1 -1
  30. package/esm/hooks/useModularUIBasic.js.map +1 -1
  31. package/esm/hooks/useModularUIModel.js.map +1 -1
  32. package/esm/hooks/useModularUIRequest.js.map +1 -1
  33. package/esm/hooks/useNotification.js.map +1 -1
  34. package/esm/hooks/useProgressIndicator.js.map +1 -1
  35. package/esm/hooks/useRouter.js.map +1 -1
  36. package/esm/i18n/Locale.js.map +1 -1
  37. package/esm/i18n/Locales.js.map +1 -1
  38. package/esm/i18n/Message.js.map +1 -1
  39. package/esm/i18n/withMessage.js.map +1 -1
  40. package/esm/models/actions/ActionCollection.js.map +1 -1
  41. package/esm/models/actions/ActionModel.js.map +1 -1
  42. package/esm/models/application/ApplicationModel.js.map +1 -1
  43. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  44. package/esm/models/attributes/AttributeContent.js.map +1 -1
  45. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  46. package/esm/models/attributes/AttributeModel.js.map +1 -1
  47. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  48. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  49. package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
  50. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  51. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  52. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  53. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  54. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  55. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  56. package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
  57. package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
  58. package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
  59. package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
  60. package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
  61. package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
  62. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  63. package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
  64. package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
  65. package/esm/models/attributes/_createAttribute.js.map +1 -1
  66. package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  67. package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  68. package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  69. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  70. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  71. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  72. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  73. package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  74. package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  75. package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  76. package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  77. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  78. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  79. package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  80. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  81. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  82. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  83. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  84. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  85. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  86. package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  87. package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  88. package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  89. package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  90. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  91. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  92. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  93. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  94. package/esm/models/base/BaseCollection.js.map +1 -1
  95. package/esm/models/base/BaseModel.js.map +1 -1
  96. package/esm/models/base/ResourceCollection.js.map +1 -1
  97. package/esm/models/base/ResourceModel.js.map +1 -1
  98. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  99. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  100. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  101. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  102. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  103. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  104. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  105. package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  106. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  107. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  108. package/esm/models/content/ContentIndexModel.js.map +1 -1
  109. package/esm/models/content/ContentLinkModel.js.map +1 -1
  110. package/esm/models/content/ContentModel.js.map +1 -1
  111. package/esm/models/content/ContentTOCModel.js.map +1 -1
  112. package/esm/models/content/ContentTypeModel.js.map +1 -1
  113. package/esm/models/content/SectionModel.js.map +1 -1
  114. package/esm/models/content/SubSectionModel.js.map +1 -1
  115. package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  116. package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  117. package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  118. package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  119. package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  120. package/esm/models/detail/DetailModel.js.map +1 -1
  121. package/esm/models/error/ErrorCollection.js.map +1 -1
  122. package/esm/models/error/ErrorModel.js.map +1 -1
  123. package/esm/models/error/ErrorResponse.js.map +1 -1
  124. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  125. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  126. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  127. package/esm/models/filters/FilterCollection.js.map +1 -1
  128. package/esm/models/filters/RangeFilterModel.js.map +1 -1
  129. package/esm/models/form/FormModel.js.map +1 -1
  130. package/esm/models/form/FormObjectModel.js.map +1 -1
  131. package/esm/models/grouping/GroupingModel.js.map +1 -1
  132. package/esm/models/href/Href.js.map +1 -1
  133. package/esm/models/href/ListHref.js.map +1 -1
  134. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  135. package/esm/models/links/LinkCollection.js.map +1 -1
  136. package/esm/models/links/LinkModel.js.map +1 -1
  137. package/esm/models/links/normalizeLinkJSON.js.map +1 -1
  138. package/esm/models/list/ListDetailModel.js.map +1 -1
  139. package/esm/models/list/ListHeaderModel.js.map +1 -1
  140. package/esm/models/list/ListItemCollection.js.map +1 -1
  141. package/esm/models/list/ListItemModel.js.map +1 -1
  142. package/esm/models/list/ListModel.js.map +1 -1
  143. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  144. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  145. package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  146. package/esm/models/paging/PagesizeModel.js.map +1 -1
  147. package/esm/models/paging/PagingModel.js.map +1 -1
  148. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  149. package/esm/models/parameter/Parameter.js.map +1 -1
  150. package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
  151. package/esm/models/resolveModel.js.map +1 -1
  152. package/esm/models/search/CaseSearchModel.js.map +1 -1
  153. package/esm/models/sorting/SortOptionModel.js.map +1 -1
  154. package/esm/models/sorting/SortingModel.js.map +1 -1
  155. package/esm/models/tab/TabModel.js.map +1 -1
  156. package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
  157. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  158. package/esm/models/user/UserModel.js.map +1 -1
  159. package/esm/models/user/UserProfileModel.js.map +1 -1
  160. package/esm/models/user/UserServicesModel.js.map +1 -1
  161. package/esm/modularui/Authenticate.js.map +1 -1
  162. package/esm/modularui/CaptchaRequest.js.map +1 -1
  163. package/esm/modularui/ModularUIError.js.map +1 -1
  164. package/esm/modularui/ModularUIRequest.js.map +1 -1
  165. package/esm/modularui/ModularUIResponse.js.map +1 -1
  166. package/esm/modularui/UploadRequest.js.map +1 -1
  167. package/esm/react/ErrorBoundary.js.map +1 -1
  168. package/esm/react/ErrorBoundaryFallback.js.map +1 -1
  169. package/esm/react/utils.js.map +1 -1
  170. package/esm/react-client/Init.js.map +1 -1
  171. package/esm/react-client/client.js +6 -5
  172. package/esm/react-client/client.js.map +1 -1
  173. package/esm/react-client/contextPath.js.map +1 -1
  174. package/esm/react-client/rehydrate.js.map +1 -1
  175. package/esm/react-server/contextPath.js.map +1 -1
  176. package/esm/react-server/createSSRComplete.js.map +1 -1
  177. package/esm/react-server/htmlpage.js.map +1 -1
  178. package/esm/react-server/renderSSRComplete.js.map +1 -1
  179. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  180. package/esm/react-server/requestInformation.js.map +1 -1
  181. package/esm/react-server/serverNoSSR.js.map +1 -1
  182. package/esm/react-server/serverSSR.js.map +1 -1
  183. package/esm/react-server/serverUtil.js.map +1 -1
  184. package/esm/react-theme/ThemeProvider.js.map +1 -1
  185. package/esm/react-theme/createTheme.js.map +1 -1
  186. package/esm/react-theme/useTheme.js.map +1 -1
  187. package/esm/react-theme/utils/background.js.map +1 -1
  188. package/esm/react-theme/utils/colors.js.map +1 -1
  189. package/esm/react-theme/utils/contrast.js.map +1 -1
  190. package/esm/react-theme/utils/corners.js.map +1 -1
  191. package/esm/react-theme/utils/spacers.js.map +1 -1
  192. package/esm/react-theme/utils/themeProps.js.map +1 -1
  193. package/esm/redux/_i18n/I18nActions.js.map +1 -1
  194. package/esm/redux/_i18n/I18nReducer.js.map +1 -1
  195. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  196. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
  197. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  198. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  199. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  200. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  201. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  202. package/esm/redux/_router/RouterActions.js.map +1 -1
  203. package/esm/redux/_router/RouterReducer.js.map +1 -1
  204. package/esm/redux/actions/Application.js.map +1 -1
  205. package/esm/redux/actions/Error.js.map +1 -1
  206. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  207. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  208. package/esm/redux/actions/FormAutosave.js.map +1 -1
  209. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  210. package/esm/redux/actions/FormValidations.js.map +1 -1
  211. package/esm/redux/actions/Notification.js.map +1 -1
  212. package/esm/redux/actions/Preferences.js +2 -2
  213. package/esm/redux/actions/Preferences.js.map +1 -1
  214. package/esm/redux/actions/ProgressIndicator.js.map +1 -1
  215. package/esm/redux/actions/SignIn.js.map +1 -1
  216. package/esm/redux/actions/SignOut.js.map +1 -1
  217. package/esm/redux/connectors/CaseView.js.map +1 -1
  218. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  219. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  220. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  221. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  222. package/esm/redux/connectors/Form.js.map +1 -1
  223. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  224. package/esm/redux/connectors/ListDetail.js.map +1 -1
  225. package/esm/redux/connectors/Modal.js.map +1 -1
  226. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  227. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  228. package/esm/redux/connectors/Preferences.js.map +1 -1
  229. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  230. package/esm/redux/connectors/Tab.js.map +1 -1
  231. package/esm/redux/reducers/AuthReducer.js.map +1 -1
  232. package/esm/redux/reducers/ErrorReducer.js.map +1 -1
  233. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  234. package/esm/redux/reducers/NotificationReducer.js.map +1 -1
  235. package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
  236. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  237. package/esm/redux/reducers/createReducer.js.map +1 -1
  238. package/esm/redux/store/beforeRenderHooks.js.map +1 -1
  239. package/esm/redux/store/configureStore.js.map +1 -1
  240. package/esm/utils/browser/Cache.js.map +1 -1
  241. package/esm/utils/browser/Cookies.js.map +1 -1
  242. package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
  243. package/esm/utils/fetch/serverFetch.js.map +1 -1
  244. package/esm/utils/fetch/universalFetch.js.map +1 -1
  245. package/esm/utils/fetch/xhr.js.map +1 -1
  246. package/esm/utils/helpers/checkResource.js.map +1 -1
  247. package/esm/utils/helpers/createUUID.js.map +1 -1
  248. package/esm/utils/helpers/objects.js.map +1 -1
  249. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  250. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  251. package/esm/utils/number/DecimalFormat.js.map +1 -1
  252. package/esm/utils/number/formatValue.js.map +1 -1
  253. package/esm/utils/number/parseNumbers.js.map +1 -1
  254. package/lib/builder/index.js.map +1 -1
  255. package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
  256. package/lib/constants/Constants.js.map +1 -1
  257. package/lib/constants/LayoutHintConfig.js.map +1 -1
  258. package/lib/constants/LayoutHints.js.map +1 -1
  259. package/lib/constants/Settings.js.map +1 -1
  260. package/lib/constants/index.js.map +1 -1
  261. package/lib/exceptions/ConfigurationException.js.map +1 -1
  262. package/lib/exceptions/FetchException.js.map +1 -1
  263. package/lib/exceptions/IllegalArgumentException.js.map +1 -1
  264. package/lib/exceptions/IllegalReturnException.js.map +1 -1
  265. package/lib/exceptions/IllegalStateException.js.map +1 -1
  266. package/lib/exceptions/JsonParseException.js.map +1 -1
  267. package/lib/exceptions/MissingPropertyException.js.map +1 -1
  268. package/lib/exceptions/NetworkException.js.map +1 -1
  269. package/lib/exceptions/NotAllowedUriException.js.map +1 -1
  270. package/lib/exceptions/NotFoundException.js.map +1 -1
  271. package/lib/exceptions/ServerRequestException.js.map +1 -1
  272. package/lib/exceptions/ThemePropertyException.js.map +1 -1
  273. package/lib/exceptions/TimeoutException.js.map +1 -1
  274. package/lib/exceptions/UnauthorizedException.js.map +1 -1
  275. package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
  276. package/lib/exceptions/index.js.map +1 -1
  277. package/lib/hooks/index.js.map +1 -1
  278. package/lib/hooks/useAllFormsOnModel.js.map +1 -1
  279. package/lib/hooks/useAuthentication.js.map +1 -1
  280. package/lib/hooks/useContent.js.map +1 -1
  281. package/lib/hooks/useDeepCompareEffect.js.map +1 -1
  282. package/lib/hooks/useForm.js.map +1 -1
  283. package/lib/hooks/useI18n.js.map +1 -1
  284. package/lib/hooks/useModal.js.map +1 -1
  285. package/lib/hooks/useModelCatalog.js.map +1 -1
  286. package/lib/hooks/useModels.js.map +1 -1
  287. package/lib/hooks/useModularUI.js.map +1 -1
  288. package/lib/hooks/useModularUIBasic.js.map +1 -1
  289. package/lib/hooks/useModularUIModel.js.map +1 -1
  290. package/lib/hooks/useModularUIRequest.js.map +1 -1
  291. package/lib/hooks/useNotification.js.map +1 -1
  292. package/lib/hooks/usePreference.js.map +1 -1
  293. package/lib/hooks/useProgressIndicator.js.map +1 -1
  294. package/lib/hooks/useRouter.js.map +1 -1
  295. package/lib/i18n/Locale.js.map +1 -1
  296. package/lib/i18n/Locales.js.map +1 -1
  297. package/lib/i18n/Message.js.map +1 -1
  298. package/lib/i18n/index.js.map +1 -1
  299. package/lib/i18n/languages.js.map +1 -1
  300. package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
  301. package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
  302. package/lib/i18n/withMessage.js.map +1 -1
  303. package/lib/index.js.map +1 -1
  304. package/lib/models/actions/ActionCollection.js.map +1 -1
  305. package/lib/models/actions/ActionModel.js.map +1 -1
  306. package/lib/models/application/ApplicationModel.js.map +1 -1
  307. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  308. package/lib/models/attributes/AttributeContent.js.map +1 -1
  309. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  310. package/lib/models/attributes/AttributeModel.js.map +1 -1
  311. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  312. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  313. package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
  314. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  315. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  316. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  317. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  318. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  319. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  320. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  321. package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
  322. package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
  323. package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
  324. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  325. package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
  326. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  327. package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
  328. package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
  329. package/lib/models/attributes/_createAttribute.js.map +1 -1
  330. package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  331. package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  332. package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  333. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  334. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  335. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  336. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  337. package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  338. package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  339. package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  340. package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  341. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  342. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  343. package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  344. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  345. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  346. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  347. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  348. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  349. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  350. package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  351. package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  352. package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  353. package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  354. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  355. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  356. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  357. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  358. package/lib/models/base/BaseCollection.js.map +1 -1
  359. package/lib/models/base/BaseModel.js.map +1 -1
  360. package/lib/models/base/ResourceCollection.js.map +1 -1
  361. package/lib/models/base/ResourceModel.js.map +1 -1
  362. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  363. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  364. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  365. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  366. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  367. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  368. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  369. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  370. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  371. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  372. package/lib/models/content/ContentIndexModel.js.map +1 -1
  373. package/lib/models/content/ContentLinkModel.js.map +1 -1
  374. package/lib/models/content/ContentModel.js.map +1 -1
  375. package/lib/models/content/ContentTOCModel.js.map +1 -1
  376. package/lib/models/content/ContentTypeModel.js.map +1 -1
  377. package/lib/models/content/SectionModel.js.map +1 -1
  378. package/lib/models/content/SubSectionModel.js.map +1 -1
  379. package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  380. package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  381. package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  382. package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  383. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  384. package/lib/models/detail/DetailModel.js.map +1 -1
  385. package/lib/models/error/ErrorCollection.js.map +1 -1
  386. package/lib/models/error/ErrorModel.js.map +1 -1
  387. package/lib/models/error/ErrorResponse.js.map +1 -1
  388. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  389. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  390. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  391. package/lib/models/filters/FilterCollection.js.map +1 -1
  392. package/lib/models/filters/FilterModel.js.map +1 -1
  393. package/lib/models/filters/RangeFilterModel.js.map +1 -1
  394. package/lib/models/form/FormModel.js.map +1 -1
  395. package/lib/models/form/FormObjectModel.js.map +1 -1
  396. package/lib/models/grouping/GroupingModel.js.map +1 -1
  397. package/lib/models/href/Href.js.map +1 -1
  398. package/lib/models/href/ListHref.js.map +1 -1
  399. package/lib/models/index.js.map +1 -1
  400. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  401. package/lib/models/links/LinkCollection.js.map +1 -1
  402. package/lib/models/links/LinkModel.js.map +1 -1
  403. package/lib/models/links/normalizeLinkJSON.js.map +1 -1
  404. package/lib/models/list/ListDetailModel.js.map +1 -1
  405. package/lib/models/list/ListHeaderModel.js.map +1 -1
  406. package/lib/models/list/ListItemCollection.js.map +1 -1
  407. package/lib/models/list/ListItemModel.js.map +1 -1
  408. package/lib/models/list/ListModel.js.map +1 -1
  409. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  410. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  411. package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  412. package/lib/models/paging/PagesizeModel.js.map +1 -1
  413. package/lib/models/paging/PagingModel.js.map +1 -1
  414. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  415. package/lib/models/parameter/Parameter.js.map +1 -1
  416. package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
  417. package/lib/models/resolveModel.js.map +1 -1
  418. package/lib/models/search/CaseSearchModel.js.map +1 -1
  419. package/lib/models/sorting/SortOptionModel.js.map +1 -1
  420. package/lib/models/sorting/SortingModel.js.map +1 -1
  421. package/lib/models/tab/TabModel.js.map +1 -1
  422. package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
  423. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  424. package/lib/models/user/UserModel.js.map +1 -1
  425. package/lib/models/user/UserProfileModel.js.map +1 -1
  426. package/lib/models/user/UserServicesModel.js.map +1 -1
  427. package/lib/modularui/Authenticate.js.map +1 -1
  428. package/lib/modularui/CaptchaRequest.js.map +1 -1
  429. package/lib/modularui/ModularUIError.js.map +1 -1
  430. package/lib/modularui/ModularUIRequest.js.map +1 -1
  431. package/lib/modularui/ModularUIResponse.js.map +1 -1
  432. package/lib/modularui/UploadRequest.js.map +1 -1
  433. package/lib/modularui/index.js.map +1 -1
  434. package/lib/react/ErrorBoundary.js.map +1 -1
  435. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  436. package/lib/react/index.js.map +1 -1
  437. package/lib/react/utils.js.map +1 -1
  438. package/lib/react-client/Init.js.map +1 -1
  439. package/lib/react-client/client.js +6 -5
  440. package/lib/react-client/client.js.flow +14 -7
  441. package/lib/react-client/client.js.map +1 -1
  442. package/lib/react-client/contextPath.js.map +1 -1
  443. package/lib/react-client/index.js.map +1 -1
  444. package/lib/react-client/rehydrate.js.map +1 -1
  445. package/lib/react-server/__tests__/serverUtil.spec.js.flow +4 -4
  446. package/lib/react-server/contextPath.js.map +1 -1
  447. package/lib/react-server/createSSRComplete.js.map +1 -1
  448. package/lib/react-server/htmlpage.js.map +1 -1
  449. package/lib/react-server/index.js.map +1 -1
  450. package/lib/react-server/renderSSRComplete.js.map +1 -1
  451. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  452. package/lib/react-server/requestInformation.js.map +1 -1
  453. package/lib/react-server/serverNoSSR.js.map +1 -1
  454. package/lib/react-server/serverSSR.js.map +1 -1
  455. package/lib/react-server/serverUtil.js.map +1 -1
  456. package/lib/react-theme/ThemeProvider.js.map +1 -1
  457. package/lib/react-theme/createTheme.js.map +1 -1
  458. package/lib/react-theme/index.js.map +1 -1
  459. package/lib/react-theme/useTheme.js.map +1 -1
  460. package/lib/react-theme/utils/background.js.map +1 -1
  461. package/lib/react-theme/utils/colors.js.map +1 -1
  462. package/lib/react-theme/utils/contrast.js.map +1 -1
  463. package/lib/react-theme/utils/corners.js.map +1 -1
  464. package/lib/react-theme/utils/spacers.js.map +1 -1
  465. package/lib/react-theme/utils/themeProps.js.map +1 -1
  466. package/lib/redux/_i18n/I18nActions.js.map +1 -1
  467. package/lib/redux/_i18n/I18nReducer.js.map +1 -1
  468. package/lib/redux/_i18n/index.js.map +1 -1
  469. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  470. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
  471. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  472. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  473. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  474. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  475. package/lib/redux/_modularui/index.js.map +1 -1
  476. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  477. package/lib/redux/_router/RouterActions.js.map +1 -1
  478. package/lib/redux/_router/RouterConnectors.js.map +1 -1
  479. package/lib/redux/_router/RouterMiddleware.js.map +1 -1
  480. package/lib/redux/_router/RouterReducer.js.map +1 -1
  481. package/lib/redux/_router/index.js.map +1 -1
  482. package/lib/redux/actions/Application.js.map +1 -1
  483. package/lib/redux/actions/Authorization.js.map +1 -1
  484. package/lib/redux/actions/Error.js.map +1 -1
  485. package/lib/redux/actions/Form.js.map +1 -1
  486. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  487. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  488. package/lib/redux/actions/FormAutosave.js.map +1 -1
  489. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  490. package/lib/redux/actions/FormValidations.js.map +1 -1
  491. package/lib/redux/actions/Modals.js.map +1 -1
  492. package/lib/redux/actions/Notification.js.map +1 -1
  493. package/lib/redux/actions/Preferences.js +2 -2
  494. package/lib/redux/actions/Preferences.js.flow +3 -2
  495. package/lib/redux/actions/Preferences.js.map +1 -1
  496. package/lib/redux/actions/ProgressIndicator.js.map +1 -1
  497. package/lib/redux/actions/SignIn.js.map +1 -1
  498. package/lib/redux/actions/SignOut.js.map +1 -1
  499. package/lib/redux/actions/index.js.map +1 -1
  500. package/lib/redux/connectors/Application.js.map +1 -1
  501. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  502. package/lib/redux/connectors/CaseView.js.map +1 -1
  503. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  504. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  505. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  506. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  507. package/lib/redux/connectors/Form.js.map +1 -1
  508. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  509. package/lib/redux/connectors/ListDetail.js.map +1 -1
  510. package/lib/redux/connectors/Modal.js.map +1 -1
  511. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  512. package/lib/redux/connectors/Notification.js.map +1 -1
  513. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  514. package/lib/redux/connectors/Preferences.js.map +1 -1
  515. package/lib/redux/connectors/Progress.js.map +1 -1
  516. package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
  517. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  518. package/lib/redux/connectors/SignIn.js.map +1 -1
  519. package/lib/redux/connectors/SignOut.js.map +1 -1
  520. package/lib/redux/connectors/Tab.js.map +1 -1
  521. package/lib/redux/connectors/index.js.map +1 -1
  522. package/lib/redux/index.js.map +1 -1
  523. package/lib/redux/reducers/AuthReducer.js.map +1 -1
  524. package/lib/redux/reducers/ErrorReducer.js.map +1 -1
  525. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  526. package/lib/redux/reducers/NotificationReducer.js.map +1 -1
  527. package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
  528. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  529. package/lib/redux/reducers/createReducer.js.map +1 -1
  530. package/lib/redux/reducers/index.js.map +1 -1
  531. package/lib/redux/selectors/i18n.js.map +1 -1
  532. package/lib/redux/selectors/index.js.map +1 -1
  533. package/lib/redux/store/beforeRenderHooks.js.map +1 -1
  534. package/lib/redux/store/configureStore.js.map +1 -1
  535. package/lib/utils/browser/Cache.js.map +1 -1
  536. package/lib/utils/browser/Cookies.js.map +1 -1
  537. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  538. package/lib/utils/fetch/serverFetch.js.map +1 -1
  539. package/lib/utils/fetch/universalFetch.js.map +1 -1
  540. package/lib/utils/fetch/xhr.js.map +1 -1
  541. package/lib/utils/helpers/checkResource.js.map +1 -1
  542. package/lib/utils/helpers/createHash.js.map +1 -1
  543. package/lib/utils/helpers/createUUID.js.map +1 -1
  544. package/lib/utils/helpers/index.js.map +1 -1
  545. package/lib/utils/helpers/objects.js.map +1 -1
  546. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  547. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  548. package/lib/utils/helpers/text.js.map +1 -1
  549. package/lib/utils/index.js.map +1 -1
  550. package/lib/utils/number/DecimalFormat.js.map +1 -1
  551. package/lib/utils/number/formatValue.js.map +1 -1
  552. package/lib/utils/number/parseNumbers.js.map +1 -1
  553. package/package.json +5 -5
  554. package/src/react-client/client.js +14 -7
  555. package/src/react-server/__tests__/serverUtil.spec.js +4 -4
  556. package/src/redux/actions/Preferences.js +3 -2
@@ -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,GAAG,MAC5BD,iBAAiB,CAAC,aAAa,EAAE,GAAG,EAAE;EACpCE,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEZ;AACf,CAAC,CAAC;;AAEJ;AAC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AC,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,UAAU,CAAC;EAC5BC,WAAW,EAAEX;AACf,CAAC,CAAC;;AAEJ;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AAY,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 +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,GAAG,MAGTT,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"}
@@ -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,GAAG,MAAwB;EACrD,MAAMC,QAAQ,GAAGL,WAAW,EAAE;EAC9B,MAAM;IAAEM,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,WAAW,CACxDW,KAAK,IAAKA,KAAK,CAACC,YAAY,CAC9B;EAED,OAAO;IACLL,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,KAAK;IACLG,OAAO,EAAE,MAAMP,QAAQ,CAACJ,mBAAmB,EAAE;EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AACA,OAAO,MAAMY,oBAAoB,GAAG,MAA6B;EAC/D,MAAMR,QAAQ,GAAGL,WAAW,EAAE;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,EAAE;EAC9B,MAAM;IAAEM,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,WAAW,CACxDW,KAAK,IAAKA,KAAK,CAACC,YAAY,CAC9B;EAED,OAAO;IACLL,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,KAAK;IACLG,OAAO,EAAEA,CAAA,KAAMP,QAAQ,CAACJ,mBAAmB,EAAE;EAC/C,CAAC;AACH,CAAC;;AAED;AACA;AACA,OAAO,MAAMY,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,MAAMR,QAAQ,GAAGL,WAAW,EAAE;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 +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,GAAG,MAA6B;EAC/D,MAAMC,QAAQ,GAAGP,WAAW,EAAE;EAC9B,MAAMQ,QAAQ,GAAGP,WAAW,CAAEQ,KAAK,IAAKA,KAAK,CAACC,iBAAiB,CAAC;EAEhE,OAAO;IACL,GAAGF,QAAQ;IACXG,KAAK,EAAE,MAAMJ,QAAQ,CAACL,aAAa,EAAE,CAAC;IACtCU,MAAM,EAAE,MAAML,QAAQ,CAACJ,cAAc,EAAE,CAAC;IACxCU,KAAK,EAAE,MAAMN,QAAQ,CAACH,aAAa,EAAE,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,EAAE;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,EAAE,CAAC;IACtCU,MAAM,EAAEA,CAAA,KAAML,QAAQ,CAACJ,cAAc,EAAE,CAAC;IACxCU,KAAK,EAAEA,CAAA,KAAMN,QAAQ,CAACH,aAAa,EAAE,CAAC;IACtCU,MAAM,EAAGC,eAAuB,IAC9BR,QAAQ,CAACF,cAAc,CAACU,eAAe,CAAC;EAC5C,CAAC;AACH,CAAC"}
@@ -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,GAAG,MAC1CN,WAAW,CAAEO,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC;;AAE/C;AACA;AACA,OAAO,MAAMC,cAAkC,GAAG,MAChDJ,WAAW,EAAE,EAAEK,GAAG,IAAI,EAAE;;AAE1B;AACA;AACA,OAAO,MAAMC,cAAkC,GAAG,MAAMN,WAAW,EAAE,EAAEO,MAAM;;AAE7E;AACA;AACA,OAAO,MAAMC,WAA4B,GAAG,MAAMR,WAAW,EAAE,EAAES,QAAQ;;AAEzE;AACA;AACA,OAAO,MAAMC,aAAgC,GAAG,MAAM;EACpD,MAAMC,QAAQ,GAAGlB,WAAW,EAAE;EAE9B,OAAO;IACLE,IAAI,EAAE,CAACQ,QAAgC,EAAEF,KAAe,KACtDU,QAAQ,CAAChB,IAAI,CAACQ,QAAQ,EAAEF,KAAK,CAAC,CAAC;IACjCL,OAAO,EAAE,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,EAAE,MAAMa,QAAQ,CAACb,MAAM,EAAE,CAAC;IAChCC,SAAS,EAAE,MAAMY,QAAQ,CAACZ,SAAS,EAAE;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,EAAE,EAAEK,GAAG,IAAI,EAAE;;AAE1B;AACA;AACA,OAAO,MAAMC,cAAkC,GAAGA,CAAA,KAAMN,WAAW,EAAE,EAAEO,MAAM;;AAE7E;AACA;AACA,OAAO,MAAMC,WAA4B,GAAGA,CAAA,KAAMR,WAAW,EAAE,EAAES,QAAQ;;AAEzE;AACA;AACA,OAAO,MAAMC,aAAgC,GAAGA,CAAA,KAAM;EACpD,MAAMC,QAAQ,GAAGlB,WAAW,EAAE;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,EAAE,CAAC;IAChCC,SAAS,EAAEA,CAAA,KAAMY,QAAQ,CAACZ,SAAS,EAAE;EACvC,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Locale.js","names":["formatMessage","languages","IllegalStateException","getSetting","Locale","constructor","locale","_code","code","_messages","fixPlaceHoldersInObject","messages","_errors","errors","_nativeName","nativeName","setup","missingTranslation","aLocale","split","length","language","lang","toUpperCase","fixPlaceHolders","message","replace","JSON","parse","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,WAAW,CAACC,MAA2B,EAAE;IAAA;IAAA;IAAA;IAAA;IACvC,IAAI,CAACC,KAAK,GAAGD,MAAM,CAACE,IAAI;IAExB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACC,uBAAuB,CAACJ,MAAM,CAACK,QAAQ,CAAC;IAC9D,IAAI,CAACC,OAAO,GAAG,IAAI,CAACF,uBAAuB,CAACJ,MAAM,CAACO,MAAM,CAAC;IAE1D,IAAI,CAACC,WAAW,GAAGR,MAAM,CAACS,UAAU;IAEpCf,aAAa,CAACgB,KAAK,CAAC;MAClBC,kBAAkB,EAAE;IACtB,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACE,IAAIT,IAAI,GAAW;IACjB,OAAO,IAAI,CAACD,KAAK;EACnB;;EAEA;AACF;AACA;EACE,IAAIQ,UAAU,GAAW;IACvB,IAAI,IAAI,CAACD,WAAW,EAAE;MACpB,OAAO,IAAI,CAACA,WAAW;IACzB;IAEA,MAAMI,OAAO,GAAG,IAAI,CAACV,IAAI,CAACW,KAAK,CAAC,GAAG,CAAC;IAEpC,IAAID,OAAO,CAACE,MAAM,GAAG,CAAC,EAAE;MACtB,MAAMC,QAAQ,GAAGpB,SAAS,CAACqB,IAAI,CAACJ,OAAO,CAAC,CAAC,CAAC,CAAC;MAE3C,IAAIG,QAAQ,EAAE;QACZ,OACEA,QAAQ,CAAC,CAAC,CAAC,IAAIH,OAAO,CAAC,CAAC,CAAC,GAAI,KAAIA,OAAO,CAAC,CAAC,CAAC,CAACK,WAAW,EAAG,GAAE,GAAG,EAAE,CA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B,OAAe,EAAEa,UAA8B,EAAU;IACrE,IAAIA,UAAU,EAAE;MACd,OAAOtC,aAAa,CAACyB,OAAO,EAAEa,UAAU,CAAC;IAC3C;IAEA,OAAOb,OAAO;EAChB;;EAEA;AACF;AACA;EACEc,UAAU,CACRT,EAAU,EACVC,cAAuB,EACvBO,UAA8B,EACtB;IACR,MAAMb,OAAO,GAAG,IAAI,CAACI,cAAc,CAACC,EAAE,EAAEC,cAAc,CAAC;IACvD,OAAO,IAAI,CAAC/B,aAAa,CAACyB,OAAO,EAAEa,UAAU,CAAC;EAChD;;EAEA;AACF;AACA;EACEE,MAAM,GAA6C;IAAA,IAA5C7B,QAAgB,uEAAG,CAAC,CAAC;IAAA,IAAEE,MAAc,uEAAG,CAAC,CAAC;IAC/C,IAAI,CAACJ,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,eAAeT,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),\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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,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"Locales.js","names":["Locale","englishErrors","dutchErrors","BaseCollection","IllegalArgumentException","availableLocales","code","messages","errors","createLocalesWithConfiguredErrors","configuredErrors","availableLocale","Locales","constructor","locales","locale","rehydrate","hydatedLocales","_collection","_code","_messages","_errors","hasLocale","localeCode","some","item","getLocale","availableLocaleCodes","getPreferredLocale","acceptLanguageHeader","acceptLanguages","match","preferredLocales","length","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,IAAI,EAAE,IAAI;EACVC,QAAQ,EAAE,CAAC,CAAC;EACZC,MAAM,EAAEP;AACV,CAAC,EACD;EACEK,IAAI,EAAE,IAAI;EACVC,QAAQ,EAAE,CAAC,CAAC;EACZC,MAAM,EAAEN;AACV,CAAC,CACF;;AAED;AACA;AACA;AACA,OAAO,MAAMO,iCAAiC,GAC5CC,gBAAoC,IAEpC,qBAAAL,gBAAgB,OAAhBA,gBAAgB,EAAMM,eAAe,IAAK;EACxC,IAAID,gBAAgB,CAACC,eAAe,CAACL,IAAI,CAAC,EAAE;IAC1C,OAAO;MACL,GAAGK,eAAe;MAClBH,MAAM,EAAE;QACN,GAAGG,eAAe,CAACH,MAAM;QACzB,GAAGE,gBAAgB,CAACC,eAAe,CAACL,IAAI;MAC1C;IACF,CAAC;EACH;EAEA,OAAOK,eAAe;AACxB,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,MAAMC,OAAO,SAAST,cAAc,CAAS;EAC3CU,WAAW,GAAyD;IAAA,IAAxDC,OAAmC,uEAAGT,gBAAgB;IAChE,KAAK,CAAC,qBAAAS,OAAO,OAAPA,OAAO,EAAMC,MAAM,IAAK,IAAIf,MAAM,CAACe,MAAM,CAAC,CAAC,CAAC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C,gBAAgB,GAAG,yDAAAF,eAAe,OAAfA,eAAe,EAC7Bf,MAAM,IACb,IAAI,CAACY,oBAAoB,CAACH,IAAI,CAAEb,eAAe,IAC7C,4BAAAI,MAAM,OAANA,MAAM,EAAYJ,eAAe,CAAC,CACnC,CACF,kBACKI,MAAM;QAAA;QAAA,OACV,sCAAI,CAACY,oBAAoB,kBAAOhB,eAAe,IAC7C,4BAAAI,MAAM,OAANA,MAAM,EAAYJ,eAAe,CAAC,CACnC;MAAA,EACF;MAEH,IAAIqB,gBAAgB,CAACC,MAAM,GAAG,CAAC,EAAE;QAC/B,OAAOD,gBAAgB,CAAC,CAAC,CAAC;MAC5B;IACF;IAEA,OAAO,IAAI,CAACL,oBAAoB,CAAC,CAAC,CAAC;EACrC;;EAEA;AACF;AACA;AACA;EACEO,MAAM,CAACnB,MAAc,EAA8C;IAAA,IAA5CR,QAAgB,uEAAG,CAAC,CAAC;IAAA,IAAEC,MAAc,uEAAG,CAAC,CAAC;IAC/D,IAAI,IAAI,CAACc,SAAS,CAACP,MAAM,CAAC,EAAE;MAC1B,IAAI,CAACW,SAAS,CAACX,MAAM,CAAC,CAACmB,MAAM,CAAC3B,QAAQ,EAAEC,MAAM,CAAC;IACjD,CAAC,MAAM;MACL,IAAI,CAAC2B,GAAG,CACN,IAAInC,MAAM,CAAC;QACTM,IAAI,EAAES,MAAM;QACZR,QAAQ;QACRC;MACF,CAAC,CAAC,CACH;IACH;EACF;AACF;AAEA,eAAeI,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,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,IAAI,EAAE,IAAI;EACVC,QAAQ,EAAE,CAAC,CAAC;EACZC,MAAM,EAAEP;AACV,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B,2BAAA,CAAAZ,MAAM,EAAAR,IAAA,CAANQ,MAAM,EAAYP,eAAe,CAAC,CACnC,CACF,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,CAAC,CACnC;MAAA,EACF;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,CAAC,CACH;IACH;EACF;AACF;AAEA,eAAeM,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Message.js","names":["memo","hideVisually","useMessage","Message","className","id","defaultMessage","children","data","screenreaderOnly","allowHTML","translatedMessage","styles","__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;AAY9C;AACA;AACA;AACA,MAAMC,OAAqD,gBACzDH,IAAI,CACF,QAQoB;EAAA,IARnB;IACCI,SAAS;IACTC,EAAE;IACFC,cAAc;IACdC,QAAQ;IACRC,IAAI;IACJC,gBAAgB,GAAG,KAAK;IACxBC,SAAS,GAAG;EACA,CAAC;EACb,MAAMC,iBAAiB,GAAGT,UAAU,CAClCG,EAAE,EACFC,cAAc,IAAIC,QAAQ,EAC1BC,IAAI,CACL;EAED,IAAIC,gBAAgB,EAAE;IACpB,MAAMG,MAAM,GAAG;MACb,GAAGX,YAAY;IACjB,CAAC;IAED,oBACE;MAAM,SAAS,EAAEG,SAAU;MAAC,KAAK,EAAEQ,MAAO;MAAA,UACvCD;IAAiB,EACb;EAEX;EAEA,IAAID,SAAS,EAAE;IACb,oBACE;MACE,SAAS,EAAEN,SAAU;MACrB,uBAAuB,EAAE;QACvBS,MAAM,EAAEF;MACV;IAAE,EACF;EAEN;EAEA,oBAAO;IAAM,SAAS,EAAEP,SAAU;IAAA,UAAEO;EAAiB,EAAQ;AAC/D,CAAC,CACF;AAEHR,OAAO,CAACW,WAAW,GAAG,YAAY;AAElC,eAAeX,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,IAAI,CACL;EAED,IAAIC,gBAAgB,EAAE;IACpB,MAAMG,MAAM,GAAG;MACb,GAAGd,YAAY;IACjB,CAAC;IAED,oBACEG,IAAA;MAAMG,SAAS,EAAEA,SAAU;MAACS,KAAK,EAAED,MAAO;MAAAL,QAAA,EACvCI;IAAiB,EACb;EAEX;EAEA,IAAID,SAAS,EAAE;IACb,oBACET,IAAA;MACEG,SAAS,EAAEA,SAAU;MACrBU,uBAAuB,EAAE;QACvBC,MAAM,EAAEJ;MACV;IAAE,EACF;EAEN;EAEA,oBAAOV,IAAA;IAAMG,SAAS,EAAEA,SAAU;IAAAG,QAAA,EAAEI;EAAiB,EAAQ;AAC/D,CAAC,CACF;AAEHT,OAAO,CAACc,WAAW,GAAG,YAAY;AAElC,eAAed,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMessage.js","names":["connect","createSelector","memoize","getLocales","getLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","args","mapStateToProps","state","message","withMessage"],"sources":["../../src/i18n/withMessage.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nimport type { ReduxState } from \"../redux/types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n +message: (\n id: string,\n defaultMessage: string,\n placeholders: { ... }\n ) => string,\n};\n\ntype Props = {\n ...StateProps,\n ...\n};\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\nconst mapStateToProps = (state: ReduxState): StateProps => ({\n message: getMessage(state),\n});\n\n/**\n */\nconst withMessage: ComponentType<any> = connect<Props, {}, StateProps, _, _, _>(\n mapStateToProps\n);\n\nexport default withMessage;\n"],"mappings":";AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,cAAc,QAAQ,UAAU;AACzC,OAAOC,OAAO,MAAM,gBAAgB;AAEpC,SAASC,UAAU,EAAEC,SAAS,QAAQ,yBAAyB;AAkB/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,kCAAIC,IAAI;IAAJA,IAAI;EAAA;EAAA,OAAK,gBAAeA,IAAI,CAAC;AAAA,EAClC,CACJ;AAED,MAAMC,eAAe,GAAIC,KAAiB,KAAkB;EAC1DC,OAAO,EAAET,UAAU,CAACQ,KAAK;AAC3B,CAAC,CAAC;;AAEF;AACA;AACA,MAAME,WAA+B,GAAGf,OAAO,CAC7CY,eAAe,CAChB;AAED,eAAeG,WAAW"}
1
+ {"version":3,"file":"withMessage.js","names":["connect","createSelector","memoize","getLocales","getLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","_len","arguments","length","args","Array","_key","_JSON$stringify","mapStateToProps","state","message","withMessage"],"sources":["../../src/i18n/withMessage.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nimport type { ReduxState } from \"../redux/types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n +message: (\n id: string,\n defaultMessage: string,\n placeholders: { ... }\n ) => string,\n};\n\ntype Props = {\n ...StateProps,\n ...\n};\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\nconst mapStateToProps = (state: ReduxState): StateProps => ({\n message: getMessage(state),\n});\n\n/**\n */\nconst withMessage: ComponentType<any> = connect<Props, {}, StateProps, _, _, _>(\n mapStateToProps\n);\n\nexport default withMessage;\n"],"mappings":";AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,cAAc,QAAQ,UAAU;AACzC,OAAOC,OAAO,MAAM,gBAAgB;AAEpC,SAASC,UAAU,EAAEC,SAAS,QAAQ,yBAAyB;AAkB/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,EAClC,CACJ;AAED,MAAMI,eAAe,GAAIC,KAAiB,KAAkB;EAC1DC,OAAO,EAAEf,UAAU,CAACc,KAAK;AAC3B,CAAC,CAAC;;AAEF;AACA;AACA,MAAME,WAA+B,GAAGrB,OAAO,CAC7CkB,eAAe,CAChB;AAED,eAAeG,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionCollection.js","names":["BaseCollection","ActionModel","ActionCollection","constructor","actions","actionsContributions","Array","isArray","collection","actionModels","actionData","actionContribution","name","push","getActionByKey","key","newCollection","action","first","getActionsByType","type","getActionsByLayoutHint","hints","layouthint","has","hasActionsByLayoutHint","length","routePath","enabledRoutes","isDisabled","path","selfhref","join"],"sources":["../../../src/models/actions/ActionCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ActionModel from \"./ActionModel\";\n\n/**\n * Collection of actions\n */\nexport default class ActionCollection extends BaseCollection<ActionModel> {\n constructor(actions?: Object, actionsContributions?: Object) {\n super();\n\n // no actions gives an empty collection\n if (!Array.isArray(actions)) {\n this.collection = [];\n } else if (Array.isArray(actionsContributions)) {\n const actionModels = [];\n for (const actionData of actions) {\n const actionContribution = actionsContributions.find(\n (actionContribution) => actionContribution.name === actionData.name\n );\n\n if (actionContribution) {\n actionModels.push(new ActionModel(actionData, actionContribution));\n }\n }\n\n this.collection = actionModels;\n }\n }\n\n /**\n * Retrieve action by key\n */\n getActionByKey(key: string): ActionModel | null {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) => action.key === key);\n\n return newCollection.first;\n }\n\n /**\n * Retrieve actions by type\n */\n getActionsByType(type: string | Array<string>): ActionCollection {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n Array.isArray(type) ? type.includes(action.type) : action.type === type\n );\n\n return newCollection;\n }\n\n /**\n * Retrieve actions including a layout hint\n */\n getActionsByLayoutHint(...hints: Array<string>): ActionCollection {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n action.layouthint.has(...hints)\n );\n\n return newCollection;\n }\n\n /**\n * Indicates if an action with layout hint exists\n */\n hasActionsByLayoutHint(...hints: Array<string>): boolean {\n return this.getActionsByLayoutHint(...hints).length > 0;\n }\n\n /**\n * Use as path regex for react router routes\n */\n get routePath(): string {\n const enabledRoutes = this.collection.filter(\n (action) => !action.isDisabled\n );\n\n if (enabledRoutes.length === 0) {\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n const path = enabledRoutes.map((action) => action.selfhref.path).join(\"|\");\n\n return this.length > 1 ? `(${path})` : path;\n }\n}\n"],"mappings":";;;;AACA,OAAOA,cAAc,MAAM,wBAAwB;AACnD,OAAOC,WAAW,MAAM,eAAe;;AAEvC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASF,cAAc,CAAc;EACxEG,WAAW,CAACC,OAAgB,EAAEC,oBAA6B,EAAE;IAC3D,KAAK,EAAE;;IAEP;IACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EAAE;MAC3B,IAAI,CAACI,UAAU,GAAG,EAAE;IACtB,CAAC,MAAM,IAAIF,KAAK,CAACC,OAAO,CAACF,oBAAoB,CAAC,EAAE;MAC9C,MAAMI,YAAY,GAAG,EAAE;MACvB,KAAK,MAAMC,UAAU,IAAIN,OAAO,EAAE;QAChC,MAAMO,kBAAkB,GAAG,sBAAAN,oBAAoB,OAApBA,oBAAoB,EAC5CM,kBAAkB,IAAKA,kBAAkB,CAACC,IAAI,KAAKF,UAAU,CAACE,IAAI,CACpE;QAED,IAAID,kBAAkB,EAAE;UACtBF,YAAY,CAACI,IAAI,CAAC,IAAIZ,WAAW,CAACS,UAAU,EAAEC,kBAAkB,CAAC,CAAC;QACpE;MACF;MAEA,IAAI,CAACH,UAAU,GAAGC,YAAY;IAChC;EACF;;EAEA;AACF;AACA;EACEK,cAAc,CAACC,GAAW,EAAsB;IAAA;IAC9C,MAAMC,aAAa,GAAG,IAAId,gBAAgB,EAAE;IAE5Cc,aAAa,CAACR,UAAU,GAAG,uCAAI,iBAASS,MAAM,IAAKA,MAAM,CAACF,GAAG,KAAKA,GAAG,CAAC;IAEtE,OAAOC,aAAa,CAACE,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js","names":["BaseCollection","ActionModel","ActionCollection","constructor","actions","actionsContributions","Array","isArray","collection","actionModels","actionData","actionContribution","_findInstanceProperty","call","name","push","getActionByKey","key","_context","newCollection","_filterInstanceProperty","action","first","getActionsByType","type","_context2","_includesInstanceProperty","getActionsByLayoutHint","_context3","_len","arguments","length","hints","_key","layouthint","has","hasActionsByLayoutHint","routePath","_context4","enabledRoutes","isDisabled","path","_mapInstanceProperty","selfhref","join"],"sources":["../../../src/models/actions/ActionCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ActionModel from \"./ActionModel\";\n\n/**\n * Collection of actions\n */\nexport default class ActionCollection extends BaseCollection<ActionModel> {\n constructor(actions?: Object, actionsContributions?: Object) {\n super();\n\n // no actions gives an empty collection\n if (!Array.isArray(actions)) {\n this.collection = [];\n } else if (Array.isArray(actionsContributions)) {\n const actionModels = [];\n for (const actionData of actions) {\n const actionContribution = actionsContributions.find(\n (actionContribution) => actionContribution.name === actionData.name\n );\n\n if (actionContribution) {\n actionModels.push(new ActionModel(actionData, actionContribution));\n }\n }\n\n this.collection = actionModels;\n }\n }\n\n /**\n * Retrieve action by key\n */\n getActionByKey(key: string): ActionModel | null {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) => action.key === key);\n\n return newCollection.first;\n }\n\n /**\n * Retrieve actions by type\n */\n getActionsByType(type: string | Array<string>): ActionCollection {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n Array.isArray(type) ? type.includes(action.type) : action.type === type\n );\n\n return newCollection;\n }\n\n /**\n * Retrieve actions including a layout hint\n */\n getActionsByLayoutHint(...hints: Array<string>): ActionCollection {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n action.layouthint.has(...hints)\n );\n\n return newCollection;\n }\n\n /**\n * Indicates if an action with layout hint exists\n */\n hasActionsByLayoutHint(...hints: Array<string>): boolean {\n return this.getActionsByLayoutHint(...hints).length > 0;\n }\n\n /**\n * Use as path regex for react router routes\n */\n get routePath(): string {\n const enabledRoutes = this.collection.filter(\n (action) => !action.isDisabled\n );\n\n if (enabledRoutes.length === 0) {\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n const path = enabledRoutes.map((action) => action.selfhref.path).join(\"|\");\n\n return this.length > 1 ? `(${path})` : path;\n }\n}\n"],"mappings":";;;;AACA,OAAOA,cAAc,MAAM,wBAAwB;AACnD,OAAOC,WAAW,MAAM,eAAe;;AAEvC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASF,cAAc,CAAc;EACxEG,WAAWA,CAACC,OAAgB,EAAEC,oBAA6B,EAAE;IAC3D,KAAK,EAAE;;IAEP;IACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EAAE;MAC3B,IAAI,CAACI,UAAU,GAAG,EAAE;IACtB,CAAC,MAAM,IAAIF,KAAK,CAACC,OAAO,CAACF,oBAAoB,CAAC,EAAE;MAC9C,MAAMI,YAAY,GAAG,EAAE;MACvB,KAAK,MAAMC,UAAU,IAAIN,OAAO,EAAE;QAChC,MAAMO,kBAAkB,GAAGC,qBAAA,CAAAP,oBAAoB,EAAAQ,IAAA,CAApBR,oBAAoB,EAC5CM,kBAAkB,IAAKA,kBAAkB,CAACG,IAAI,KAAKJ,UAAU,CAACI,IAAI,CACpE;QAED,IAAIH,kBAAkB,EAAE;UACtBF,YAAY,CAACM,IAAI,CAAC,IAAId,WAAW,CAACS,UAAU,EAAEC,kBAAkB,CAAC,CAAC;QACpE;MACF;MAEA,IAAI,CAACH,UAAU,GAAGC,YAAY;IAChC;EACF;;EAEA;AACF;AACA;EACEO,cAAcA,CAACC,GAAW,EAAsB;IAAA,IAAAC,QAAA;IAC9C,MAAMC,aAAa,GAAG,IAAIjB,gBAAgB,EAAE;IAE5CiB,aAAa,CAACX,UAAU,GAAGY,uBAAA,CAAAF,QAAA,OAAI,EAAAL,IAAA,CAAAK,QAAA,EAASG,MAAM,IAAKA,MAAM,CAACJ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uBAAA,CAAAkB,SAAA,OAAI,CAAC9B,UAAU,EAAAK,IAAA,CAAAyB,SAAA,EAClCjB,MAAM,IAAK,CAACA,MAAM,CAACmB,UAAU,CAC/B;IAED,IAAID,aAAa,CAACR,MAAM,KAAK,CAAC,EAAE;MAC9B,OAAO,wBAAwB;IACjC;IAEA,MAAMU,IAAI,GAAGC,oBAAA,CAAAH,aAAa,EAAA1B,IAAA,CAAb0B,aAAa,EAAMlB,MAAM,IAAKA,MAAM,CAACsB,QAAQ,CAACF,IAAI,CAAC,CAACG,IAAI,CAAC,GAAG,CAAC;IAE1E,OAAO,IAAI,CAACb,MAAM,GAAG,CAAC,GAAI,IAAGU,IAAK,GAAE,GAAGA,IAAI;EAC7C;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionModel.js","names":["has","ProcessStatusSettingsModel","AttributeCollection","BaseModel","Href","HTTP_METHODS","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","ActionModel","constructor","data","contributions","_fieldCollection","fields","createFromHref","name","href","label","type","isDisabled","selfhref","_href","querystring","method","getData","POST","layouthint","getContribution","all","fieldCollection","attribute","value","join","getFieldByKey","key","getAttributeByKey","hasFieldByKey","isProcessTask","processStatus","icon","_icon"],"sources":["../../../src/models/actions/ActionModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ProcessStatusSettingsModel from \"../process/ProcessStatusSettingsModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport {\n CREATE_ACTION,\n UPDATE_ACTION,\n DELETE_ACTION,\n} from \"../../constants/LayoutHints\";\n\nimport type { AttributeType } from \"../types\";\n\n/**\n * Defines an Action. For instance an action on the tab 'books', which leads to a form\n */\nexport default class ActionModel extends BaseModel {\n _fieldCollection: AttributeCollection;\n _href: Href;\n _icon: string;\n\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this._fieldCollection = new AttributeCollection(\n this.data.fields,\n this.contributions.fields\n );\n }\n\n /**\n */\n static createFromHref(\n name: string,\n href: string,\n label: string,\n type: string = \"form\"\n ): ActionModel {\n return new ActionModel(\n {\n name,\n href,\n },\n {\n name,\n label: label || name,\n type,\n }\n );\n }\n\n /**\n */\n get isDisabled(): boolean {\n return this.data.href == null;\n }\n\n /**\n * retrieve href of action\n */\n get selfhref(): Href {\n return (\n this._href || new Href(`${this.data.href}?${this.querystring}`, \"Form\")\n );\n }\n\n /**\n */\n set selfhref(href: Href) {\n this._href = href;\n }\n\n /**\n * retrieve request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this.getData(\"method\", HTTP_METHODS.POST);\n }\n\n /**\n * Retrieve type of method\n */\n get type(): string {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContribution(\"type\", \"general\");\n }\n\n /**\n * Retrieve name of action\n */\n get name(): string {\n return this.getData(\"name\", \"unknown\");\n }\n\n /**\n * retrieve the collection of field attributes as an array\n */\n get fields(): Array<AttributeType> {\n return this._fieldCollection.all;\n }\n\n /**\n * Retrieve the field collection\n */\n get fieldCollection(): AttributeCollection {\n return this._fieldCollection;\n }\n\n /**\n */\n set fieldCollection(fieldCollection: AttributeCollection) {\n this._fieldCollection = fieldCollection;\n }\n\n /**\n * Retrieve querystring of action\n */\n get querystring(): string {\n return this.fields\n .filter((attribute) => attribute.value != null && attribute.value !== \"\")\n .map((attribute) => {\n const { value } = attribute;\n if (value !== null) {\n return `${attribute.name}=${value}`;\n }\n return attribute.name;\n })\n .join(\"&\");\n }\n\n /**\n * Retrieve a field by it's key\n */\n getFieldByKey(key: string): AttributeType | null {\n return this._fieldCollection.getAttributeByKey(key);\n }\n\n /**\n * Indicates if field exists by the given key\n */\n hasFieldByKey(key: string): boolean {\n return this.getFieldByKey(key) !== null;\n }\n\n /**\n * Getting the key/name of this action\n */\n get key(): string {\n return this.data.name;\n }\n\n /**\n * Getting the label of the action\n */\n get label(): string {\n return this.getContribution(\"label\", this.key);\n }\n\n /**\n */\n get isProcessTask(): boolean {\n return has(this.contributions, \"processTask\");\n }\n\n /**\n */\n get processStatus(): ProcessStatusSettingsModel | null {\n if (this.isProcessTask) {\n return new ProcessStatusSettingsModel(\n this.getData(\"processStatus\", {}),\n this.getContribution(\"processTask\", {})\n );\n }\n\n return null;\n }\n\n /**\n */\n get icon(): string {\n return this._icon;\n }\n\n /**\n */\n set icon(icon: string) {\n this._icon = icon;\n }\n}\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,0BAA0B,MAAM,uCAAuC;AAC9E,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,IAAI,MAAM,cAAc;AAE/B,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SACEC,aAAa,EACbC,aAAa,EACbC,aAAa,QACR,6BAA6B;AAIpC;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASN,SAAS,CAAC;EAKjDO,WAAW,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAC/C,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAAC;IAAA;IAAA;IAE3B,IAAI,CAACC,gBAAgB,GAAG,IAAIX,mBAAmB,CAC7C,IAAI,CAACS,IAAI,CAACG,MAAM,EAChB,IAAI,CAACF,aAAa,CAACE,MAAM,CAC1B;EACH;;EAEA;AACF;EACE,OAAOC,cAAc,CACnBC,IAAY,EACZC,IAAY,EACZC,KAAa,EAEA;IAAA,IADbC,IAAY,uEAAG,MAAM;IAErB,OAAO,IAAIV,WAAW,CACpB;MACEO,IAAI;MACJC;IACF,CAAC,EACD;MACED,IAAI;MACJE,KAAK,EAAEA,KAAK,IAAIF,IAAI;MACpBG;IACF,C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aAAa,EAAE,CAAC,CAAC,CAAC,CACxC;IACH;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIY,IAAI,GAAW;IACjB,OAAO,IAAI,CAACC,KAAK;EACnB;;EAEA;AACF;EACE,IAAID,IAAI,CAACA,IAAY,EAAE;IACrB,IAAI,CAACC,KAAK,GAAGD,IAAI;EACnB;AACF"}
1
+ {"version":3,"file":"ActionModel.js","names":["has","ProcessStatusSettingsModel","AttributeCollection","BaseModel","Href","HTTP_METHODS","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","ActionModel","constructor","data","contributions","_defineProperty","_fieldCollection","fields","createFromHref","name","href","label","type","arguments","length","undefined","isDisabled","selfhref","_href","querystring","method","getData","POST","layouthint","getContribution","all","fieldCollection","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","call","attribute","value","join","getFieldByKey","key","getAttributeByKey","hasFieldByKey","isProcessTask","processStatus","icon","_icon"],"sources":["../../../src/models/actions/ActionModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ProcessStatusSettingsModel from \"../process/ProcessStatusSettingsModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport {\n CREATE_ACTION,\n UPDATE_ACTION,\n DELETE_ACTION,\n} from \"../../constants/LayoutHints\";\n\nimport type { AttributeType } from \"../types\";\n\n/**\n * Defines an Action. For instance an action on the tab 'books', which leads to a form\n */\nexport default class ActionModel extends BaseModel {\n _fieldCollection: AttributeCollection;\n _href: Href;\n _icon: string;\n\n constructor(data: Object, contributions: Object) {\n super(data, contributions);\n\n this._fieldCollection = new AttributeCollection(\n this.data.fields,\n this.contributions.fields\n );\n }\n\n /**\n */\n static createFromHref(\n name: string,\n href: string,\n label: string,\n type: string = \"form\"\n ): ActionModel {\n return new ActionModel(\n {\n name,\n href,\n },\n {\n name,\n label: label || name,\n type,\n }\n );\n }\n\n /**\n */\n get isDisabled(): boolean {\n return this.data.href == null;\n }\n\n /**\n * retrieve href of action\n */\n get selfhref(): Href {\n return (\n this._href || new Href(`${this.data.href}?${this.querystring}`, \"Form\")\n );\n }\n\n /**\n */\n set selfhref(href: Href) {\n this._href = href;\n }\n\n /**\n * retrieve request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this.getData(\"method\", HTTP_METHODS.POST);\n }\n\n /**\n * Retrieve type of method\n */\n get type(): string {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContribution(\"type\", \"general\");\n }\n\n /**\n * Retrieve name of action\n */\n get name(): string {\n return this.getData(\"name\", \"unknown\");\n }\n\n /**\n * retrieve the collection of field attributes as an array\n */\n get fields(): Array<AttributeType> {\n return this._fieldCollection.all;\n }\n\n /**\n * Retrieve the field collection\n */\n get fieldCollection(): AttributeCollection {\n return this._fieldCollection;\n }\n\n /**\n */\n set fieldCollection(fieldCollection: AttributeCollection) {\n this._fieldCollection = fieldCollection;\n }\n\n /**\n * Retrieve querystring of action\n */\n get querystring(): string {\n return this.fields\n .filter((attribute) => attribute.value != null && attribute.value !== \"\")\n .map((attribute) => {\n const { value } = attribute;\n if (value !== null) {\n return `${attribute.name}=${value}`;\n }\n return attribute.name;\n })\n .join(\"&\");\n }\n\n /**\n * Retrieve a field by it's key\n */\n getFieldByKey(key: string): AttributeType | null {\n return this._fieldCollection.getAttributeByKey(key);\n }\n\n /**\n * Indicates if field exists by the given key\n */\n hasFieldByKey(key: string): boolean {\n return this.getFieldByKey(key) !== null;\n }\n\n /**\n * Getting the key/name of this action\n */\n get key(): string {\n return this.data.name;\n }\n\n /**\n * Getting the label of the action\n */\n get label(): string {\n return this.getContribution(\"label\", this.key);\n }\n\n /**\n */\n get isProcessTask(): boolean {\n return has(this.contributions, \"processTask\");\n }\n\n /**\n */\n get processStatus(): ProcessStatusSettingsModel | null {\n if (this.isProcessTask) {\n return new ProcessStatusSettingsModel(\n this.getData(\"processStatus\", {}),\n this.getContribution(\"processTask\", {})\n );\n }\n\n return null;\n }\n\n /**\n */\n get icon(): string {\n return this._icon;\n }\n\n /**\n */\n set icon(icon: string) {\n this._icon = icon;\n }\n}\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,0BAA0B,MAAM,uCAAuC;AAC9E,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,IAAI,MAAM,cAAc;AAE/B,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SACEC,aAAa,EACbC,aAAa,EACbC,aAAa,QACR,6BAA6B;AAIpC;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASN,SAAS,CAAC;EAKjDO,WAAWA,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAC/C,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE3B,IAAI,CAACC,gBAAgB,GAAG,IAAIZ,mBAAmB,CAC7C,IAAI,CAACS,IAAI,CAACI,MAAM,EAChB,IAAI,CAACH,aAAa,CAACG,MAAM,CAC1B;EACH;;EAEA;AACF;EACE,OAAOC,cAAcA,CACnBC,IAAY,EACZC,IAAY,EACZC,KAAa,EAEA;IAAA,IADbC,IAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,MAAM;IAErB,OAAO,IAAIZ,WAAW,CACpB;MACEQ,IAAI;MACJC;IACF,CAAC,EACD;MACED,IAAI;MACJE,KAAK,EAAEA,KAAK,IAAIF,IAAI;MACpBG;IACF,CAAC,CACF;EACH;;EAEA;AACF;EACE,IAAII,UAAUA,CAAA,EAAY;IACxB,OAAO,IAAI,CAACb,IAAI,CAAC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,EAAE;MACtB,OAAO,IAAI9C,0BAA0B,CACnC,IAAI,CAAC4B,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EACjC,IAAI,CAACG,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CACxC;IACH;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIiB,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACC,KAAK;EACnB;;EAEA;AACF;EACE,IAAID,IAAIA,CAACA,IAAY,EAAE;IACrB,IAAI,CAACC,KAAK,GAAGD,IAAI;EACnB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationModel.js","names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","DEFAULT_AUTHENTICATION_TYPE","ApplicationModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","setChildModels","models","userServiceModel","model","userServices","label","getContribution","authenticationTypes","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","create","_userServices","isLoggedIn","userHref","userLink"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort(\n (a: AuthenticationType, b: AuthenticationType) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"mappings":";;AACA,O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ceModel","LinkModel","UserServicesModel","NotAllowedUriException","DEFAULT_AUTHENTICATION_TYPE","ApplicationModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","setChildModels","models","userServiceModel","_findInstanceProperty","call","model","userServices","label","getContribution","authenticationTypes","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","create","_userServices","isLoggedIn","userHref","userLink"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort(\n (a: AuthenticationType, b: AuthenticationType) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"mappings":";;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,iBAAiB,MAAM,2BAA2B;AAEzD,SAASC,sBAAsB,QAAQ,kBAAkB;AAEzD,SAASC,2BAA2B,QAAQ,iBAAiB;AAO7D;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASL,aAAa,CAAC;EAAAM,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;EAAA;EAG1D;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,WAAWC,SAASA,C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AAG,CAAC,CACzD;IACH;IAEA,OAAO,CAAC9B,2BAA2B,CAAC;EACtC;;EAEA;AACF;AACA;EACE,IAAI+B,IAAIA,CAAA,EAAmB;IACzB,OAAO,IAAI,CAAClB,KAAK,CAACmB,eAAe,CAAC,KAAK,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,YAAYA,CAAA,EAAc;IAC5B,OAAOpC,SAAS,CAACqC,MAAM,CAAC,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;EAC3E;;EAEA;AACF;AACA;EACE,IAAIX,YAAYA,CAACD,KAAsB,EAAE;IACvC,IAAI,CAACa,aAAa,GAAGb,KAAK,YAAYxB,iBAAiB,GAAGwB,KAAK,GAAG,IAAI;EACxE;;EAEA;AACF;AACA;EACE,IAAIC,YAAYA,CAAA,EAAuB;IACrC,OAAO,IAAI,CAACY,aAAa,GAAG,IAAI,CAACA,aAAa,GAAG,IAAI;EACvD;;EAEA;AACF;AACA;EACE,IAAIC,UAAUA,CAAA,EAAY;IACxB,OAAO,IAAI,CAACb,YAAY,EAAEa,UAAU,IAAI,KAAK;EAC/C;;EAEA;AACF;AACA;AACA;EACE,IAAIC,QAAQA,CAAA,EAAgB;IAC1B,IAAI,IAAI,CAACd,YAAY,IAAI,IAAI,IAAI,IAAI,CAACA,YAAY,CAACe,QAAQ,IAAI,IAAI,EAAE;MACnE,OAAO,IAAI,CAACf,YAAY,CAACe,QAAQ,CAACvB,IAAI;IACxC;IAEA,OAAO,IAAI;EACb;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeCollection.js","names":["has","ResourceCollection","createAttribute","ChoiceAttributeModel","CompositeAttributeModel","ContentConfiguration","ConfigurationException","AttributeCollection","constructor","data","contributions","isReadonly","forEach","contribution","key","attribute","readonly","collection","push","processLayoutHintRules","attributes","all","visible","isHidden","questions","isResult","results","getAttributeByAttribute","attr","equals","getChildByAttribute","getAttributeByKey","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","hints","layouthint","getChoiceAttributeByLayoutHint","layoutHint","getAttributesByLayoutHint","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","hasErrors","updateValidations","errors","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","validationData","attributesFormData","isVisible","getEmptyFormData","attributeFormData"],"sources":["../../../src/models/attributes/AttributeCollection.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceCollection from \"../base/ResourceCollection\";\n\nimport createAttribute from \"./_createAttribute\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\n\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\n\nimport { ConfigurationException } from \"../../exceptions\";\n\nimport type { AttributeType, FormErrorAnchor } from \"../types\";\n\n/**\n * Collection of attributes\n */\nclass AttributeCollection extends ResourceCollection<AttributeType> {\n constructor(\n data: Object | Array<Object> = {},\n contributions: Array<Object> = [],\n isReadonly: boolean = false\n ) {\n super();\n\n if (contributions) {\n contributions.forEach((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attribute = createAttribute(key, data, contribution[key]);\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (isReadonly && !has(contribution[key], \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n * @returns {Array<AttributeType>}\n */\n get attributes(): Array<AttributeType> {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: Array<AttributeType>) {\n this.collection = attributes;\n }\n\n /**\n */\n processLayoutHintRules(): void {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible(): Array<AttributeType> {\n // Let flow know that this is a AttributeCollection\n if (this instanceof AttributeCollection) {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n return [];\n }\n\n /**\n */\n get questions(): Array<AttributeType> {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n /**\n */\n get results(): Array<AttributeType> {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string): boolean {\n return this.getAttributeByKey(key) !== null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: Array<string>): AttributeType | null {\n return this.find((attribute) => attribute.layouthint.has(...hints)) || null;\n }\n\n /**\n * Getting a choice attribute by layouthint, returns null when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(\n layoutHint: string\n ): ChoiceAttributeModel | null {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n\n return attribute instanceof ChoiceAttributeModel ? attribute : null;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: Array<string>): Array<AttributeType> {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeType): void {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string): void {\n this.forEach((attribute) => {\n const newAttribute = attribute.clone();\n\n newAttribute.referenceDate = date;\n\n this.replace(attribute, newAttribute);\n });\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n /**\n */\n addServerError(error: FormErrorAnchor): void {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`\n );\n }\n }\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): AttributeCollection {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors\n );\n }\n });\n\n return this;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration\n ): void {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData(false);\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData)\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n // $FlowIgnore[cannot-spread-indexer]\n // $FlowIgnore[exponential-spread]\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\n return data;\n }\n}\n\nexport default AttributeCollection;\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAE3D,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,uBAAuB,MAAM,2BAA2B;AAE/D,OAAOC,oBAAoB,MAAM,8CAA8C;AAE/E,SAASC,sBAAsB,QAAQ,kBAAkB;AAIzD;AACA;AACA;AACA,MAAMC,mBAAmB,SAASN,kBAAkB,CAAgB;EAClEO,WAAW,GAIT;IAAA,IAHAC,IAA4B,uEAAG,CAAC,CAAC;IAAA,IACjCC,aAA4B,uEAAG,EAAE;IAAA,IACjCC,UAAmB,uEAAG,KAAK;IAE3B,KAAK,EAAE;IAEP,IAAID,aAAa,EAAE;MACjBA,aAAa,CAACE,OAAO,CAAEC,YAAY,IAAK;QACtC,MAAM,CAACC,GAAG,CAAC,GAAG,aAAYD,YAAY,CAAC;QAEvC,MAAME,SAAS,GAAGb,eAAe,CAACY,GAAG,EAAEL,IAAI,EAAEI,YAAY,CAACC,GAAG,CAAC,CAAC;QAE/D,IAAIC,SAAS,KAAK,IAAI,EAAE;UACtB;UACA,IAAIJ,UAAU,IAAI,CAACX,GAAG,CAACa,YAAY,CAACC,GAAG,CAAC,EAAE,UAAU,CAAC,EAAE;YACrDC,SAAS,CAACC,QAAQ,GAAG,IAAI;UAC3B;UAEA,IA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SAAS,CAACC,QAAQ,KAClB,CAACmD,cAAc,IAAIpD,SAAS,CAAC2C,wBAAwB,CAAC,CAC1D,kBACK3C,SAAS,IAAK;MAClB;MACA,IAAIA,SAAS,CAACsD,SAAS,EAAE;QACvB,OAAOtD,SAAS,CAACkD,QAAQ;MAC3B;MAEA,OAAOlD,SAAS,CAACuD,gBAAgB,EAAE;IACrC,CAAC,CAAC;IAEJ,IAAI7D,IAAI,GAAG,CAAC,CAAC;IACb2D,kBAAkB,CAACxD,OAAO,CAAE2D,iBAAiB,IAAK;MAChD;MACA;MACA9D,IAAI,GAAG;QACL,GAAGA,IAAI;QACP,GAAG8D;MACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAO9D,IAAI;EACb;AACF;AAEA,eAAeF,mBAAmB"}
1
+ {"version":3,"file":"AttributeCollection.js","names":["has","ResourceCollection","createAttribute","ChoiceAttributeModel","CompositeAttributeModel","ContentConfiguration","ConfigurationException","AttributeCollection","constructor","data","arguments","length","undefined","contributions","isReadonly","forEach","contribution","key","_Object$keys","attribute","readonly","collection","push","processLayoutHintRules","attributes","all","visible","_context","_filterInstanceProperty","call","isHidden","questions","_context2","isResult","results","_context3","getAttributeByAttribute","_context4","_findInstanceProperty","attr","equals","getChildByAttribute","getAttributeByKey","_context5","getChildByKey","hasAttributeByKey","getAttributeByLayoutHint","_context6","_len","hints","Array","_key","layouthint","getChoiceAttributeByLayoutHint","layoutHint","getAttributesByLayoutHint","_context7","_len2","_key2","replace","oldAttribute","newAttribute","replaceByKey","index","setReferenceDate","date","clone","referenceDate","hasServerErrors","some","addServerError","error","elementid","anchor","hasErrors","updateValidations","errors","_context8","hasDynamicValidationData","attributeErrors","compositeChildErrors","elementId","_startsWithInstanceProperty","children","indicateContentConfiguration","contentConfiguration","formdata","getFormData","_context9","_context10","validationData","attributesFormData","_mapInstanceProperty","isVisible","getEmptyFormData","attributeFormData"],"sources":["../../../src/models/attributes/AttributeCollection.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceCollection from \"../base/ResourceCollection\";\n\nimport createAttribute from \"./_createAttribute\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\n\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\n\nimport { ConfigurationException } from \"../../exceptions\";\n\nimport type { AttributeType, FormErrorAnchor } from \"../types\";\n\n/**\n * Collection of attributes\n */\nclass AttributeCollection extends ResourceCollection<AttributeType> {\n constructor(\n data: Object | Array<Object> = {},\n contributions: Array<Object> = [],\n isReadonly: boolean = false\n ) {\n super();\n\n if (contributions) {\n contributions.forEach((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attribute = createAttribute(key, data, contribution[key]);\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (isReadonly && !has(contribution[key], \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n * @returns {Array<AttributeType>}\n */\n get attributes(): Array<AttributeType> {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: Array<AttributeType>) {\n this.collection = attributes;\n }\n\n /**\n */\n processLayoutHintRules(): void {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible(): Array<AttributeType> {\n // Let flow know that this is a AttributeCollection\n if (this instanceof AttributeCollection) {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n return [];\n }\n\n /**\n */\n get questions(): Array<AttributeType> {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n /**\n */\n get results(): Array<AttributeType> {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string): boolean {\n return this.getAttributeByKey(key) !== null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: Array<string>): AttributeType | null {\n return this.find((attribute) => attribute.layouthint.has(...hints)) || null;\n }\n\n /**\n * Getting a choice attribute by layouthint, returns null when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(\n layoutHint: string\n ): ChoiceAttributeModel | null {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n\n return attribute instanceof ChoiceAttributeModel ? attribute : null;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: Array<string>): Array<AttributeType> {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeType): void {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string): void {\n this.forEach((attribute) => {\n const newAttribute = attribute.clone();\n\n newAttribute.referenceDate = date;\n\n this.replace(attribute, newAttribute);\n });\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n /**\n */\n addServerError(error: FormErrorAnchor): void {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`\n );\n }\n }\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): AttributeCollection {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors\n );\n }\n });\n\n return this;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration\n ): void {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData(false);\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData)\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n // $FlowIgnore[cannot-spread-indexer]\n // $FlowIgnore[exponential-spread]\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\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B,OAAO1E,SAAS,CAACmE,QAAQ;MAC3B;MAEA,OAAOnE,SAAS,CAAC2E,gBAAgB,EAAE;IACrC,CAAC,CAAC;IAEJ,IAAIrF,IAAI,GAAG,CAAC,CAAC;IACbkF,kBAAkB,CAAC5E,OAAO,CAAEgF,iBAAiB,IAAK;MAChD;MACA;MACAtF,IAAI,GAAG;QACL,GAAGA,IAAI;QACP,GAAGsF;MACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAOtF,IAAI;EACb;AACF;AAEA,eAAeF,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeContent.js","names":["retrieveText","hasAllContentInData","SectionModel","LayoutHintCollection","isPlainObject","AttributeContent","constructor","content","_content","fromData","header","headerLabel","headerDescription","label","description","message","elements","element","propertyElement","layouthint","properties","textFragmentElement","textfragments","textfragment","text","contentElement","sections","section","getContentElements","elementName","getContentElementCollections","collectionName","getContentElementCollectionByLabels","labels","getConceptPropertiesByLabels","getTextFragmentsByLabels","getSectionsByType","types","type","getSectionsByLabels","getReferredSections","referredSections","push"],"sources":["../../../src/models/attributes/AttributeContent.js"],"sourcesContent":["// @flow\nimport { retrieveText } from \"../../utils/helpers/text\";\nimport { hasAllContentInData } from \"../../constants/Settings\";\nimport SectionModel from \"../content/SectionModel\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\nimport { isPlainObject } from \"../../utils\";\n\nimport type {\n ContentData,\n ContentElementMapped,\n PropertyData,\n PropertyElementMapped,\n TextFragmentData,\n TextFragmentElementMapped,\n ContentAll,\n} from \"../types\";\nimport type SubSectionModel from \"../content/SubSectionModel\";\n\n/**\n */\nclass AttributeContent {\n _content: ?ContentData;\n\n constructor(content: ?ContentData) {\n this._content = content;\n }\n\n /**\n */\n get fromData(): boolean {\n return hasAllContentInData();\n }\n\n /**\n */\n get header(): {\n label: ?string,\n description: ?string,\n } {\n let headerLabel = null;\n let headerDescription = null;\n\n const label = this._content?.header?.label;\n if (label) {\n headerLabel = label;\n }\n\n const description = this._content?.header?.description;\n if (description) {\n if (isPlainObject(description) && \"message\" in description) {\n headerDescription = description.message;\n } else if (typeof description === \"string\") {\n headerDescription = description;\n }\n }\n\n return { label: headerLabel, description: headerDescription };\n }\n\n /**\n */\n get elements(): ContentAll {\n if (this._content?.elements) {\n return this._content.elements\n .filter((element) => element !== null)\n .map((element) => {\n if (element.propertyElement) {\n const { label, layouthint, properties } = element.propertyElement;\n\n return {\n propertyElement: {\n label,\n layouthint: new LayoutHintCollection(layouthint),\n properties,\n },\n };\n }\n\n if (element.textFragmentElement) {\n const { label, layouthint, textfragments } =\n element.textFragmentElement;\n return {\n textFragmentElement: {\n label,\n layouthint: new LayoutHintCollection(layouthint),\n textfragments: textfragments.map((textfragment) => ({\n ...textfragment,\n text: retrieveText(textfragment.text),\n })),\n },\n };\n }\n\n if (element.contentElement) {\n const { label, layouthint, sections } = element.contentElement;\n return {\n contentElement: {\n label,\n layouthint: new LayoutHintCollection(layouthint),\n sections: sections.map(\n (section) => new SectionModel(section, null)\n ),\n },\n };\n }\n\n // $FlowIssue\n return element;\n });\n }\n\n return [];\n }\n\n /**\n */\n get label(): ?string {\n return this._content?.label;\n }\n\n /**\n */\n getContentElements<T>(elementName: string): Array<T> {\n // $FlowIssue incompatible-return\n return this.elements.filter((element) => elementName in element);\n }\n\n /**\n */\n getContentElementCollections<T>(\n elementName: string,\n collectionName: string\n ): Array<T> {\n return this.getContentElements(elementName)\n .map((element) => element[elementName][collectionName])\n .flat();\n }\n\n /**\n */\n getContentElementCollectionByLabels<T, U>(\n elementName: string,\n collectionName: string,\n labels: Array<string>\n ): Array<U> {\n return (\n this.getContentElements<T>(elementName)\n // $FlowIssue incompatible-use\n .filter((element) => labels.includes(element[elementName].label))\n // $FlowIssue incompatible-use\n .map((element) => element[elementName][collectionName])\n .flat()\n );\n }\n\n /**\n */\n get properties(): Array<PropertyData> {\n return this.getContentElementCollections<PropertyData>(\n \"propertyElement\",\n \"properties\"\n );\n }\n\n /**\n * Get concept properties by property element label\n */\n getConceptPropertiesByLabels(labels: Array<string>): Array<PropertyData> {\n return this.getContentElementCollectionByLabels<\n PropertyElementMapped,\n PropertyData\n >(\"propertyElement\", \"properties\", labels);\n }\n\n /**\n */\n get textfragments(): Array<TextFragmentData> {\n return this.getContentElementCollections<TextFragmentData>(\n \"textFragmentElement\",\n \"textfragments\"\n );\n }\n\n /**\n * Get concept text fragments by text fragment element label\n */\n getTextFragmentsByLabels(labels: Array<string>): Array<TextFragmentData> {\n return this.getContentElementCollectionByLabels<\n TextFragmentElementMapped,\n TextFragmentData\n >(\"textFragmentElement\", \"textfragments\", labels);\n }\n\n /**\n */\n get sections(): Array<SectionModel> {\n return this.getContentElementCollections<SectionModel>(\n \"contentElement\",\n \"sections\"\n );\n }\n\n /**\n */\n getSectionsByType(types: Array<string>): Array<SectionModel> {\n return this.sections.filter((section) => types.includes(section.type));\n }\n\n /**\n * Get concept text fragments by text fragment element label\n */\n getSectionsByLabels(labels: Array<string>): Array<SectionModel> {\n return this.getContentElementCollectionByLabels<\n ContentElementMapped,\n SectionModel\n >(\"contentElement\", \"sections\", labels);\n }\n\n /**\n */\n getReferredSections(): Array<SectionModel | SubSectionModel> {\n const referredSections = [];\n\n for (const section of this.sections) {\n referredSections.push(...section.getReferredSections());\n }\n\n return referredSections;\n }\n}\n\nexport default AttributeContent;\n"],"mappings":";;;;;AACA,SAASA,YAAY,QAAQ,0BAA0B;AACvD,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,OAAOC,YAAY,MAAM,yBAAyB;AAElD,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,aAAa,QAAQ,aAAa;AAa3C;AACA;AACA,MAAMC,gBAAgB,CAAC;EAGrBC,WAAW,CAACC,OAAqB,EAAE;IAAA;IACjC,IAAI,CAACC,QAAQ,GAAGD,OAAO;EACzB;;EAEA;AACF;EACE,IAAIE,QAAQ,GAAY;IACtB,OAAOR,mBAAmB,EAAE;EAC9B;;EAEA;AACF;EAC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e,gBAAgB,CAACC,IAAI,CAAC,GAAGf,OAAO,CAACa,mBAAmB,EAAE,CAAC;IACzD;IAEA,OAAOC,gBAAgB;EACzB;AACF;AAEA,eAAepC,gBAAgB"}
1
+ {"version":3,"file":"AttributeContent.js","names":["retrieveText","hasAllContentInData","SectionModel","LayoutHintCollection","isPlainObject","AttributeContent","constructor","content","_defineProperty","_content","fromData","header","headerLabel","headerDescription","label","description","message","elements","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","call","element","propertyElement","layouthint","properties","textFragmentElement","textfragments","textfragment","text","contentElement","sections","section","getContentElements","elementName","_context3","getContentElementCollections","collectionName","_context4","_context5","_flatInstanceProperty","getContentElementCollectionByLabels","labels","_context6","_context7","_context8","_includesInstanceProperty","getConceptPropertiesByLabels","getTextFragmentsByLabels","getSectionsByType","types","_context9","type","getSectionsByLabels","getReferredSections","referredSections","push"],"sources":["../../../src/models/attributes/AttributeContent.js"],"sourcesContent":["// @flow\nimport { retrieveText } from \"../../utils/helpers/text\";\nimport { hasAllContentInData } from \"../../constants/Settings\";\nimport SectionModel from \"../content/SectionModel\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\nimport { isPlainObject } from \"../../utils\";\n\nimport type {\n ContentData,\n ContentElementMapped,\n PropertyData,\n PropertyElementMapped,\n TextFragmentData,\n TextFragmentElementMapped,\n ContentAll,\n} from \"../types\";\nimport type SubSectionModel from \"../content/SubSectionModel\";\n\n/**\n */\nclass AttributeContent {\n _content: ?ContentData;\n\n constructor(content: ?ContentData) {\n this._content = content;\n }\n\n /**\n */\n get fromData(): boolean {\n return hasAllContentInData();\n }\n\n /**\n */\n get header(): {\n label: ?string,\n description: ?string,\n } {\n let headerLabel = null;\n let headerDescription = null;\n\n const label = this._content?.header?.label;\n if (label) {\n headerLabel = label;\n }\n\n const description = this._content?.header?.description;\n if (description) {\n if (isPlainObject(description) && \"message\" in description) {\n headerDescription = description.message;\n } else if (typeof description === \"string\") {\n headerDescription = description;\n }\n }\n\n return { label: headerLabel, description: headerDescription };\n }\n\n /**\n */\n get elements(): ContentAll {\n if (this._content?.elements) {\n return this._content.elements\n .filter((element) => element !== null)\n .map((element) => {\n if (element.propertyElement) {\n const { label, layouthint, properties } = element.propertyElement;\n\n return {\n propertyElement: {\n label,\n layouthint: new LayoutHintCollection(layouthint),\n properties,\n },\n };\n }\n\n if (element.textFragmentElement) {\n const { label, layouthint, textfragments } =\n element.textFragmentElement;\n return {\n textFragmentElement: {\n label,\n layouthint: new LayoutHintCollection(layouthint),\n textfragments: textfragments.map((textfragment) => ({\n ...textfragment,\n text: retrieveText(textfragment.text),\n })),\n },\n };\n }\n\n if (element.contentElement) {\n const { label, layouthint, sections } = element.contentElement;\n return {\n contentElement: {\n label,\n layouthint: new LayoutHintCollection(layouthint),\n sections: sections.map(\n (section) => new SectionModel(section, null)\n ),\n },\n };\n }\n\n // $FlowIssue\n return element;\n });\n }\n\n return [];\n }\n\n /**\n */\n get label(): ?string {\n return this._content?.label;\n }\n\n /**\n */\n getContentElements<T>(elementName: string): Array<T> {\n // $FlowIssue incompatible-return\n return this.elements.filter((element) => elementName in element);\n }\n\n /**\n */\n getContentElementCollections<T>(\n elementName: string,\n collectionName: string\n ): Array<T> {\n return this.getContentElements(elementName)\n .map((element) => element[elementName][collectionName])\n .flat();\n }\n\n /**\n */\n getContentElementCollectionByLabels<T, U>(\n elementName: string,\n collectionName: string,\n labels: Array<string>\n ): Array<U> {\n return (\n this.getContentElements<T>(elementName)\n // $FlowIssue incompatible-use\n .filter((element) => labels.includes(element[elementName].label))\n // $FlowIssue incompatible-use\n .map((element) => element[elementName][collectionName])\n .flat()\n );\n }\n\n /**\n */\n get properties(): Array<PropertyData> {\n return this.getContentElementCollections<PropertyData>(\n \"propertyElement\",\n \"properties\"\n );\n }\n\n /**\n * Get concept properties by property element label\n */\n getConceptPropertiesByLabels(labels: Array<string>): Array<PropertyData> {\n return this.getContentElementCollectionByLabels<\n PropertyElementMapped,\n PropertyData\n >(\"propertyElement\", \"properties\", labels);\n }\n\n /**\n */\n get textfragments(): Array<TextFragmentData> {\n return this.getContentElementCollections<TextFragmentData>(\n \"textFragmentElement\",\n \"textfragments\"\n );\n }\n\n /**\n * Get concept text fragments by text fragment element label\n */\n getTextFragmentsByLabels(labels: Array<string>): Array<TextFragmentData> {\n return this.getContentElementCollectionByLabels<\n TextFragmentElementMapped,\n TextFragmentData\n >(\"textFragmentElement\", \"textfragments\", labels);\n }\n\n /**\n */\n get sections(): Array<SectionModel> {\n return this.getContentElementCollections<SectionModel>(\n \"contentElement\",\n \"sections\"\n );\n }\n\n /**\n */\n getSectionsByType(types: Array<string>): Array<SectionModel> {\n return this.sections.filter((section) => types.includes(section.type));\n }\n\n /**\n * Get concept text fragments by text fragment element label\n */\n getSectionsByLabels(labels: Array<string>): Array<SectionModel> {\n return this.getContentElementCollectionByLabels<\n ContentElementMapped,\n SectionModel\n >(\"contentElement\", \"sections\", labels);\n }\n\n /**\n */\n getReferredSections(): Array<SectionModel | SubSectionModel> {\n const referredSections = [];\n\n for (const section of this.sections) {\n referredSections.push(...section.getReferredSections());\n }\n\n return referredSections;\n }\n}\n\nexport default AttributeContent;\n"],"mappings":";;;;;AACA,SAASA,YAAY,QAAQ,0BAA0B;AACvD,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,OAAOC,YAAY,MAAM,yBAAyB;AAElD,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,aAAa,QAAQ,aAAa;AAa3C;AACA;AACA,MAAMC,gBAAgB,CAAC;EAGrBC,WAAWA,CAACC,OAAqB,EAAE;IAAAC,eAAA;IACjC,IAAI,CAACC,QAAQ,GAAGF,OAAO;EACzB;;EAEA;AACF;EACE,IAAIG,QAAQA,CAAA,EAAY;IACtB,OAAOT,mBAAmB,EAAE;EAC9B;;EAEA;AACF;EACE,IAAIU,MAAMA,CAAA,EAGR;IACA,IAAIC,WAAW,GAAG,IAAI;IACtB,IAAIC,iBAAiB,GAAG,IAAI;IAE5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IX,QAAQA,CAAA,EAAwB;IAClC,OAAO,IAAI,CAACK,4BAA4B,CACtC,gBAAgB,EAChB,UAAU,CACX;EACH;;EAEA;AACF;EACEa,iBAAiBA,CAACC,KAAoB,EAAuB;IAAA,IAAAC,SAAA;IAC3D,OAAO/B,uBAAA,CAAA+B,SAAA,OAAI,CAACpB,QAAQ,EAAAV,IAAA,CAAA8B,SAAA,EAASnB,OAAO,IAAKc,yBAAA,CAAAI,KAAK,EAAA7B,IAAA,CAAL6B,KAAK,EAAUlB,OAAO,CAACoB,IAAI,CAAC,CAAC;EACxE;;EAEA;AACF;AACA;EACEC,mBAAmBA,CAACX,MAAqB,EAAuB;IAC9D,OAAO,IAAI,CAACD,mCAAmC,CAG7C,gBAAgB,EAAE,UAAU,EAAEC,MAAM,CAAC;EACzC;;EAEA;AACF;EACEY,mBAAmBA,CAAA,EAA0C;IAC3D,MAAMC,gBAAgB,GAAG,EAAE;IAE3B,KAAK,MAAMvB,OAAO,IAAI,IAAI,CAACD,QAAQ,EAAE;MACnCwB,gBAAgB,CAACC,IAAI,CAAC,GAAGxB,OAAO,CAACsB,mBAAmB,EAAE,CAAC;IACzD;IAEA,OAAOC,gBAAgB;EACzB;AACF;AAEA,eAAenD,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeDataHelper.js","names":["klona","pick","has","isPlainObject","AttributeDataHelper","constructor","data","key","childrenKeys","_key","Array","isArray","_attribute","attr","elementid","name","param","_value","getValue","attributeData","_links","undefined","_children","createChildren","childData","parentKey","childKey","elements","element","parentData","content","createChild","keyObject","dynamicschema","dynamicschemaId","children","childrenIsArray","value","attribute","suggestions","suggestion","options","option","selected","code","static","links","attrDS","message","isResult","referenceDate","pickedContent","length","getData","child","subChild"],"sources":["../../../src/models/attributes/AttributeDataHelper.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\nimport pick from \"lodash/pick\";\n\nimport { has, isPlainObject } from \"../../utils/helpers/objects\";\n\n/**\n * This util helps to normalize various attribute data formats available in the modular ui.\n * It fixes differences in choice attributes with dynamic schema's, links on download attributes, composites with various children, etc\n *\n * @private\n */\nclass AttributeDataHelper {\n _key: string;\n _attribute: Object;\n _value: any;\n _children: Array<AttributeDataHelper>;\n\n /**\n */\n constructor(\n data: Object | Array<Object>,\n key: string,\n childrenKeys: Array<Object>\n ) {\n this._key = key;\n\n if (Array.isArray(data)) {\n this._attribute =\n data.find(\n (attr) =>\n attr.elementid === key || attr.name === key || attr.param === key\n ) || {};\n this._value = this.getValue(this._attribute);\n } else {\n const attributeData = klona(data);\n attributeData._links = pick(data._links, [\n \"concept\",\n \"download\",\n \"lookupOptions\",\n \"lookupList\",\n ]);\n\n this._attribute = attributeData;\n\n if (data[key] === undefined || (\"name\" in data && \"param\" in data)) {\n this._value = this.getValue(data);\n } else {\n this._value = data[key];\n }\n }\n\n this._children = this.createChildren(data, childrenKeys);\n }\n\n /**\n */\n childData(\n data: Object | Array<Object>,\n parentKey: string,\n childKey: string\n ): Object {\n if (Array.isArray(data)) {\n if (Array.isArray(this._attribute.elements)) {\n return this._attribute.elements.find(\n (element) => element.elementid === childKey\n );\n }\n } else if (has(data, parentKey) && isPlainObject(data[parentKey])) {\n const parentData = data[parentKey];\n if (isPlainObject(parentData) && data.content?.[childKey]) {\n return { ...parentData, content: data.content[childKey] };\n }\n return parentData;\n } else if (has(data, childKey) && isPlainObject(data[childKey])) {\n return data[childKey];\n }\n\n if (isPlainObject(data)) {\n return data;\n }\n\n return {};\n }\n\n /**\n */\n createChild(\n data: Object | Array<Object>,\n childData: Object,\n keyObject: Object\n ): AttributeDataHelper {\n const dynamicschema =\n isPlainObject(data) && !Array.isArray(data)\n ? data.dynamicschema\n : undefined;\n\n let dynamicschemaId = null;\n if (keyObject.dynamicschemaId) {\n dynamicschemaId = keyObject.dynamicschemaId;\n } else if (\n isPlainObject(data) &&\n typeof data.key === \"string\" &&\n keyObject.key\n ) {\n dynamicschemaId = `${data.key}.${keyObject.key}`;\n }\n\n return new AttributeDataHelper(\n {\n ...childData,\n dynamicschema,\n dynamicschemaId,\n },\n keyObject.key,\n keyObject.children\n );\n }\n\n /**\n */\n createChildren(\n data: Object | Array<Object>,\n childrenKeys: Array<Object> = []\n ): Array<AttributeDataHelper> {\n const childrenIsArray = Array.isArray(this.value);\n\n if (childrenIsArray) {\n return this.value.map((value) =>\n childrenKeys.map((keyObject) => {\n const childData = this.childData(value, this.key, keyObject.key);\n\n return this.createChild(data, childData, keyObject);\n })\n );\n }\n\n return childrenKeys.map((keyObject) => {\n const childData = this.childData(data, this.key, keyObject.key);\n\n return this.createChild(data, childData, keyObject);\n });\n }\n\n /**\n */\n getValue(attribute: Object): any {\n if (\"values\" in attribute) {\n return attribute.values;\n }\n\n if (\"value\" in attribute) {\n return attribute.value;\n }\n\n if (\"suggestions\" in attribute) {\n return attribute.suggestions;\n }\n\n if (\"suggestion\" in attribute) {\n return attribute.suggestion;\n }\n\n if (Array.isArray(attribute.options)) {\n return attribute.options\n .filter((option) => option.selected)\n .map((option) => option.code || option.key);\n }\n\n return null;\n }\n\n /**\n */\n get key(): string {\n return this._key;\n }\n\n /**\n */\n get value(): any {\n return this._value;\n }\n\n /**\n */\n get static(): boolean {\n return this._attribute.static || false;\n }\n\n /**\n */\n get links(): any {\n return this._attribute._links || void 0;\n }\n\n /**\n */\n get dynamicschemaId(): string {\n return this._attribute.dynamicschemaId || this.key;\n }\n\n /*\n retrieve the dynamischema by the dynamischemaId\n mentioned in the contributions of the attribute\n */\n /**\n */\n get dynamicschema(): any {\n const { dynamicschema } = this._attribute;\n if (!dynamicschema) {\n return void 0;\n }\n\n if (Array.isArray(dynamicschema)) {\n return dynamicschema;\n } else if (dynamicschema[this.dynamicschemaId]) {\n const attrDS = dynamicschema[this.dynamicschemaId];\n return attrDS.map((attr) => {\n if (attr.elements) {\n return {\n ...attr,\n elements: {\n ...attr.elements,\n dynamicschema,\n },\n };\n }\n\n return attr;\n });\n }\n\n return void 0;\n }\n\n /**\n */\n get options(): any {\n return this._attribute.options || void 0;\n }\n\n /**\n */\n get message(): any {\n return this._attribute.message || void 0;\n }\n\n /**\n */\n get isResult(): boolean {\n return this._attribute.isResult || false;\n }\n\n /**\n */\n get referenceDate(): any {\n return this._attribute.referenceDate || void 0;\n }\n\n /**\n */\n get children(): Array<AttributeDataHelper> {\n return this._children || [];\n }\n\n /**\n */\n get content(): Object {\n if (this._attribute.content) {\n const pickedContent = pick(this._attribute.content, [\n \"header\",\n \"label\",\n \"elements\",\n \"layouthint\",\n \"text\",\n ]);\n\n if (Object.keys(pickedContent).length > 0) {\n return pickedContent;\n }\n }\n\n return null;\n }\n\n /**\n */\n getData(): Object {\n return {\n key: this.key,\n value: this.value,\n static: this.static,\n _links: this.links,\n dynamicschema: this.dynamicschema,\n dynamicschemaId: this.dynamicschemaId,\n options: this.options,\n message: this.message,\n isResult: this.isResult,\n referenceDate: this.referenceDate,\n children: this.children.map((child) =>\n Array.isArray(child)\n ? child.map((subChild) => subChild.getData())\n : child.getData()\n ),\n content: this.content,\n };\n }\n}\n\nexport default AttributeDataHelper;\n"],"mappings":";;;;;;AACA,SAASA,KAAK,QAAQ,YAAY;AAClC,OAAOC,IAAI,MAAM,aAAa;AAE9B,SAASC,GAAG,EAAEC,aAAa,QAAQ,6BAA6B;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,CAAC;EAMxB;AACF;EACEC,WAAW,CACTC,IAA4B,EAC5BC,GAAW,EACXC,YAA2B,EAC3B;IAAA;IAAA;IAAA;IAAA;IACA,IAAI,CAACC,IAAI,GAAGF,GAAG;IAEf,IAAIG,KAAK,CAACC,OAAO,CAACL,IAAI,CAAC,EAAE;MACvB,IAAI,CAACM,UAAU,GACb,sBAAAN,IAAI,OAAJA,IAAI,EACDO,IAAI,IACHA,IAAI,CAACC,SAAS,KAAKP,GAAG,IAAIM,IAAI,CAACE,IAAI,KAAKR,GAAG,IAAIM,IAAI,CAACG,KAAK,KAAKT,GAAG,CACpE,IAAI,C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,CAACA,aAAa;MACjCf,QAAQ,EAAE,qCAAI,CAACA,QAAQ,kBAAMmB,KAAK,IAChC5C,KAAK,CAACC,OAAO,CAAC2C,KAAK,CAAC,GAChB,qBAAAA,KAAK,OAALA,KAAK,EAAMC,QAAQ,IAAKA,QAAQ,CAACF,OAAO,EAAE,CAAC,GAC3CC,KAAK,CAACD,OAAO,EAAE,CACpB;MACDvB,OAAO,EAAE,IAAI,CAACA;IAChB,CAAC;EACH;AACF;AAEA,eAAe1B,mBAAmB"}
1
+ {"version":3,"file":"AttributeDataHelper.js","names":["klona","pick","has","isPlainObject","AttributeDataHelper","constructor","data","key","childrenKeys","_defineProperty","_key","Array","isArray","_attribute","_findInstanceProperty","call","attr","elementid","name","param","_value","getValue","attributeData","_links","undefined","_children","createChildren","childData","parentKey","childKey","elements","_context","element","parentData","content","createChild","keyObject","dynamicschema","dynamicschemaId","children","arguments","length","childrenIsArray","value","_context2","_mapInstanceProperty","attribute","_valuesInstanceProperty","suggestions","suggestion","options","_context3","_context4","_filterInstanceProperty","option","selected","code","static","links","attrDS","message","isResult","referenceDate","pickedContent","_Object$keys","getData","_context5","child","subChild"],"sources":["../../../src/models/attributes/AttributeDataHelper.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\nimport pick from \"lodash/pick\";\n\nimport { has, isPlainObject } from \"../../utils/helpers/objects\";\n\n/**\n * This util helps to normalize various attribute data formats available in the modular ui.\n * It fixes differences in choice attributes with dynamic schema's, links on download attributes, composites with various children, etc\n *\n * @private\n */\nclass AttributeDataHelper {\n _key: string;\n _attribute: Object;\n _value: any;\n _children: Array<AttributeDataHelper>;\n\n /**\n */\n constructor(\n data: Object | Array<Object>,\n key: string,\n childrenKeys: Array<Object>\n ) {\n this._key = key;\n\n if (Array.isArray(data)) {\n this._attribute =\n data.find(\n (attr) =>\n attr.elementid === key || attr.name === key || attr.param === key\n ) || {};\n this._value = this.getValue(this._attribute);\n } else {\n const attributeData = klona(data);\n attributeData._links = pick(data._links, [\n \"concept\",\n \"download\",\n \"lookupOptions\",\n \"lookupList\",\n ]);\n\n this._attribute = attributeData;\n\n if (data[key] === undefined || (\"name\" in data && \"param\" in data)) {\n this._value = this.getValue(data);\n } else {\n this._value = data[key];\n }\n }\n\n this._children = this.createChildren(data, childrenKeys);\n }\n\n /**\n */\n childData(\n data: Object | Array<Object>,\n parentKey: string,\n childKey: string\n ): Object {\n if (Array.isArray(data)) {\n if (Array.isArray(this._attribute.elements)) {\n return this._attribute.elements.find(\n (element) => element.elementid === childKey\n );\n }\n } else if (has(data, parentKey) && isPlainObject(data[parentKey])) {\n const parentData = data[parentKey];\n if (isPlainObject(parentData) && data.content?.[childKey]) {\n return { ...parentData, content: data.content[childKey] };\n }\n return parentData;\n } else if (has(data, childKey) && isPlainObject(data[childKey])) {\n return data[childKey];\n }\n\n if (isPlainObject(data)) {\n return data;\n }\n\n return {};\n }\n\n /**\n */\n createChild(\n data: Object | Array<Object>,\n childData: Object,\n keyObject: Object\n ): AttributeDataHelper {\n const dynamicschema =\n isPlainObject(data) && !Array.isArray(data)\n ? data.dynamicschema\n : undefined;\n\n let dynamicschemaId = null;\n if (keyObject.dynamicschemaId) {\n dynamicschemaId = keyObject.dynamicschemaId;\n } else if (\n isPlainObject(data) &&\n typeof data.key === \"string\" &&\n keyObject.key\n ) {\n dynamicschemaId = `${data.key}.${keyObject.key}`;\n }\n\n return new AttributeDataHelper(\n {\n ...childData,\n dynamicschema,\n dynamicschemaId,\n },\n keyObject.key,\n keyObject.children\n );\n }\n\n /**\n */\n createChildren(\n data: Object | Array<Object>,\n childrenKeys: Array<Object> = []\n ): Array<AttributeDataHelper> {\n const childrenIsArray = Array.isArray(this.value);\n\n if (childrenIsArray) {\n return this.value.map((value) =>\n childrenKeys.map((keyObject) => {\n const childData = this.childData(value, this.key, keyObject.key);\n\n return this.createChild(data, childData, keyObject);\n })\n );\n }\n\n return childrenKeys.map((keyObject) => {\n const childData = this.childData(data, this.key, keyObject.key);\n\n return this.createChild(data, childData, keyObject);\n });\n }\n\n /**\n */\n getValue(attribute: Object): any {\n if (\"values\" in attribute) {\n return attribute.values;\n }\n\n if (\"value\" in attribute) {\n return attribute.value;\n }\n\n if (\"suggestions\" in attribute) {\n return attribute.suggestions;\n }\n\n if (\"suggestion\" in attribute) {\n return attribute.suggestion;\n }\n\n if (Array.isArray(attribute.options)) {\n return attribute.options\n .filter((option) => option.selected)\n .map((option) => option.code || option.key);\n }\n\n return null;\n }\n\n /**\n */\n get key(): string {\n return this._key;\n }\n\n /**\n */\n get value(): any {\n return this._value;\n }\n\n /**\n */\n get static(): boolean {\n return this._attribute.static || false;\n }\n\n /**\n */\n get links(): any {\n return this._attribute._links || void 0;\n }\n\n /**\n */\n get dynamicschemaId(): string {\n return this._attribute.dynamicschemaId || this.key;\n }\n\n /*\n retrieve the dynamischema by the dynamischemaId\n mentioned in the contributions of the attribute\n */\n /**\n */\n get dynamicschema(): any {\n const { dynamicschema } = this._attribute;\n if (!dynamicschema) {\n return void 0;\n }\n\n if (Array.isArray(dynamicschema)) {\n return dynamicschema;\n } else if (dynamicschema[this.dynamicschemaId]) {\n const attrDS = dynamicschema[this.dynamicschemaId];\n return attrDS.map((attr) => {\n if (attr.elements) {\n return {\n ...attr,\n elements: {\n ...attr.elements,\n dynamicschema,\n },\n };\n }\n\n return attr;\n });\n }\n\n return void 0;\n }\n\n /**\n */\n get options(): any {\n return this._attribute.options || void 0;\n }\n\n /**\n */\n get message(): any {\n return this._attribute.message || void 0;\n }\n\n /**\n */\n get isResult(): boolean {\n return this._attribute.isResult || false;\n }\n\n /**\n */\n get referenceDate(): any {\n return this._attribute.referenceDate || void 0;\n }\n\n /**\n */\n get children(): Array<AttributeDataHelper> {\n return this._children || [];\n }\n\n /**\n */\n get content(): Object {\n if (this._attribute.content) {\n const pickedContent = pick(this._attribute.content, [\n \"header\",\n \"label\",\n \"elements\",\n \"layouthint\",\n \"text\",\n ]);\n\n if (Object.keys(pickedContent).length > 0) {\n return pickedContent;\n }\n }\n\n return null;\n }\n\n /**\n */\n getData(): Object {\n return {\n key: this.key,\n value: this.value,\n static: this.static,\n _links: this.links,\n dynamicschema: this.dynamicschema,\n dynamicschemaId: this.dynamicschemaId,\n options: this.options,\n message: this.message,\n isResult: this.isResult,\n referenceDate: this.referenceDate,\n children: this.children.map((child) =>\n Array.isArray(child)\n ? child.map((subChild) => subChild.getData())\n : child.getData()\n ),\n content: this.content,\n };\n }\n}\n\nexport default AttributeDataHelper;\n"],"mappings":";;;;;;AACA,SAASA,KAAK,QAAQ,YAAY;AAClC,OAAOC,IAAI,MAAM,aAAa;AAE9B,SAASC,GAAG,EAAEC,aAAa,QAAQ,6BAA6B;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,CAAC;EAMxB;AACF;EACEC,WAAWA,CACTC,IAA4B,EAC5BC,GAAW,EACXC,YAA2B,EAC3B;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,IAAI,GAAGH,GAAG;IAEf,IAAII,KAAK,CAACC,OAAO,CAACN,IAAI,CAAC,EAAE;MACvB,IAAI,CAACO,UAAU,GACbC,qBAAA,CAAAR,IAAI,EAAAS,IAAA,CAAJT,IAAI,EACDU,IAAI,IACHA,IAAI,CAACC,SAAS,KAAKV,GAAG,IAAIS,IAAI,CAACE,IAAI,KAAKX,GAAG,IAAIS,IAAI,CAACG,KAAK,KAAKZ,GAAG,CACpE,IAAI,CAAC,CAAC;MACT,IAAI,CAACa,MAAM,GAAG,IAAI,CAACC,QAAQ,CAAC,IAAI,CAACR,UAAU,CAAC;IAC9C,CAAC,MAAM;MACL,MAAMS,aAAa,GAAGtB,KAAK,CAACM,IAAI,CAAC;MACjCgB,aAAa,CAACC,MAAM,GAAGtB,IAAI,CAACK,IAAI,CAACiB,MAAM,EAAE,CACvC,SAAS,EACT,UAAU,EACV,eAAe,EACf,YAAY,CACb,CAAC;MAEF,IAAI,CAACV,UAAU,GAAGS,a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